@yimoka/designable-react 0.0.0-stage → 0.1.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 (142) hide show
  1. package/README.md +6 -2
  2. package/dist/src/adapter/UIAdapterProvider.d.ts +7 -0
  3. package/dist/src/adapter/UIAdapterProvider.js +10 -0
  4. package/dist/src/adapter/context-core.d.ts +2 -0
  5. package/dist/src/adapter/context-core.js +3 -0
  6. package/dist/src/adapter/context.d.ts +6 -0
  7. package/dist/src/adapter/context.js +9 -0
  8. package/dist/src/adapter/default-components.d.ts +8 -0
  9. package/dist/src/adapter/default-components.js +38 -0
  10. package/dist/src/adapter/default.d.ts +2 -0
  11. package/dist/src/adapter/default.js +9 -0
  12. package/dist/src/adapter/index.d.ts +3 -0
  13. package/dist/src/adapter/index.js +3 -0
  14. package/dist/src/adapter/types.d.ts +63 -0
  15. package/dist/src/adapter/types.js +1 -0
  16. package/dist/src/containers/Designer.d.ts +3 -0
  17. package/dist/src/containers/Designer.js +63 -0
  18. package/dist/src/containers/Sandbox.d.ts +4 -0
  19. package/dist/src/containers/Sandbox.js +3 -0
  20. package/dist/src/containers/SandboxComponent.d.ts +3 -0
  21. package/dist/src/containers/SandboxComponent.js +15 -0
  22. package/dist/src/containers/Simulator.d.ts +3 -0
  23. package/dist/src/containers/Simulator.js +70 -0
  24. package/dist/src/containers/Viewport.d.ts +6 -0
  25. package/dist/src/containers/Viewport.js +71 -0
  26. package/dist/src/containers/Workbench.d.ts +2 -0
  27. package/dist/src/containers/Workbench.js +9 -0
  28. package/dist/src/containers/Workspace.d.ts +7 -0
  29. package/dist/src/containers/Workspace.js +39 -0
  30. package/dist/src/containers/index.d.ts +6 -0
  31. package/dist/src/containers/index.js +6 -0
  32. package/dist/src/containers/sandbox-types.d.ts +7 -0
  33. package/dist/src/containers/sandbox-types.js +1 -0
  34. package/dist/src/containers/sandbox-utils.d.ts +6 -0
  35. package/dist/src/containers/sandbox-utils.js +40 -0
  36. package/dist/src/containers/useSandbox.d.ts +3 -0
  37. package/dist/src/containers/useSandbox.js +77 -0
  38. package/dist/src/context.d.ts +7 -0
  39. package/dist/src/context.js +6 -0
  40. package/dist/src/hooks/index.d.ts +26 -0
  41. package/dist/src/hooks/index.js +26 -0
  42. package/dist/src/hooks/useComponents.d.ts +2 -0
  43. package/dist/src/hooks/useComponents.js +3 -0
  44. package/dist/src/hooks/useCurrentNode.d.ts +2 -0
  45. package/dist/src/hooks/useCurrentNode.js +7 -0
  46. package/dist/src/hooks/useCurrentNodeSelected.d.ts +1 -0
  47. package/dist/src/hooks/useCurrentNodeSelected.js +7 -0
  48. package/dist/src/hooks/useCursor.d.ts +2 -0
  49. package/dist/src/hooks/useCursor.js +5 -0
  50. package/dist/src/hooks/useDesigner.d.ts +3 -0
  51. package/dist/src/hooks/useDesigner.js +15 -0
  52. package/dist/src/hooks/useHistory.d.ts +2 -0
  53. package/dist/src/hooks/useHistory.js +5 -0
  54. package/dist/src/hooks/useHover.d.ts +2 -0
  55. package/dist/src/hooks/useHover.js +5 -0
  56. package/dist/src/hooks/useLayout.d.ts +2 -0
  57. package/dist/src/hooks/useLayout.js +8 -0
  58. package/dist/src/hooks/useNodeIdProps.d.ts +2 -0
  59. package/dist/src/hooks/useNodeIdProps.js +17 -0
  60. package/dist/src/hooks/useOperation.d.ts +2 -0
  61. package/dist/src/hooks/useOperation.js +5 -0
  62. package/dist/src/hooks/useOutline.d.ts +2 -0
  63. package/dist/src/hooks/useOutline.js +5 -0
  64. package/dist/src/hooks/useOutlineDragon.d.ts +2 -0
  65. package/dist/src/hooks/useOutlineDragon.js +5 -0
  66. package/dist/src/hooks/usePosition.d.ts +1 -0
  67. package/dist/src/hooks/usePosition.js +2 -0
  68. package/dist/src/hooks/usePrefix.d.ts +1 -0
  69. package/dist/src/hooks/usePrefix.js +5 -0
  70. package/dist/src/hooks/useRegistry.d.ts +2 -0
  71. package/dist/src/hooks/useRegistry.js +6 -0
  72. package/dist/src/hooks/useScreen.d.ts +2 -0
  73. package/dist/src/hooks/useScreen.js +2 -0
  74. package/dist/src/hooks/useSelected.d.ts +1 -0
  75. package/dist/src/hooks/useSelected.js +5 -0
  76. package/dist/src/hooks/useSelection.d.ts +2 -0
  77. package/dist/src/hooks/useSelection.js +5 -0
  78. package/dist/src/hooks/useTheme.d.ts +1 -0
  79. package/dist/src/hooks/useTheme.js +2 -0
  80. package/dist/src/hooks/useTree.d.ts +2 -0
  81. package/dist/src/hooks/useTree.js +5 -0
  82. package/dist/src/hooks/useTreeNode.d.ts +2 -0
  83. package/dist/src/hooks/useTreeNode.js +3 -0
  84. package/dist/src/hooks/useValidNodeOffsetRect.d.ts +2 -0
  85. package/dist/src/hooks/useValidNodeOffsetRect.js +81 -0
  86. package/dist/src/hooks/useViewport.d.ts +2 -0
  87. package/dist/src/hooks/useViewport.js +5 -0
  88. package/dist/src/hooks/useViewportDragon.d.ts +3 -0
  89. package/dist/src/hooks/useViewportDragon.js +6 -0
  90. package/dist/src/hooks/useWorkbench.d.ts +2 -0
  91. package/dist/src/hooks/useWorkbench.js +5 -0
  92. package/dist/src/hooks/useWorkspace.d.ts +2 -0
  93. package/dist/src/hooks/useWorkspace.js +17 -0
  94. package/dist/src/index.d.ts +8 -0
  95. package/dist/src/index.js +8 -0
  96. package/dist/src/locales/global.d.ts +17 -0
  97. package/dist/src/locales/global.js +16 -0
  98. package/dist/src/locales/icons.d.ts +157 -0
  99. package/dist/src/locales/icons.js +156 -0
  100. package/dist/src/locales/index.d.ts +5 -0
  101. package/dist/src/locales/index.js +7 -0
  102. package/dist/src/locales/operations.d.ts +57 -0
  103. package/dist/src/locales/operations.js +56 -0
  104. package/dist/src/locales/panels.d.ts +19 -0
  105. package/dist/src/locales/panels.js +18 -0
  106. package/dist/src/shared/globals.d.ts +5 -0
  107. package/dist/src/shared/globals.js +5 -0
  108. package/dist/src/types.d.ts +36 -0
  109. package/dist/src/types.js +1 -0
  110. package/dist/src/widgets/AuxToolWidget/Cover.d.ts +2 -0
  111. package/dist/src/widgets/AuxToolWidget/Cover.js +48 -0
  112. package/dist/src/widgets/AuxToolWidget/Helpers.d.ts +6 -0
  113. package/dist/src/widgets/AuxToolWidget/Helpers.js +74 -0
  114. package/dist/src/widgets/AuxToolWidget/Insertion.d.ts +2 -0
  115. package/dist/src/widgets/AuxToolWidget/Insertion.js +99 -0
  116. package/dist/src/widgets/AuxToolWidget/Selection.d.ts +7 -0
  117. package/dist/src/widgets/AuxToolWidget/Selection.js +61 -0
  118. package/dist/src/widgets/AuxToolWidget/index.d.ts +5 -0
  119. package/dist/src/widgets/AuxToolWidget/index.js +35 -0
  120. package/dist/src/widgets/DesignerToolsWidget/index.d.ts +9 -0
  121. package/dist/src/widgets/DesignerToolsWidget/index.js +179 -0
  122. package/dist/src/widgets/DroppableWidget/index.d.ts +9 -0
  123. package/dist/src/widgets/DroppableWidget/index.js +20 -0
  124. package/dist/src/widgets/EmptyWidget/index.d.ts +5 -0
  125. package/dist/src/widgets/EmptyWidget/index.js +25 -0
  126. package/dist/src/widgets/GhostWidget/index.d.ts +2 -0
  127. package/dist/src/widgets/GhostWidget/index.js +47 -0
  128. package/dist/src/widgets/HistoryWidget/index.d.ts +2 -0
  129. package/dist/src/widgets/HistoryWidget/index.js +409 -0
  130. package/dist/src/widgets/IconWidget/index.d.ts +26 -0
  131. package/dist/src/widgets/IconWidget/index.js +203 -0
  132. package/dist/src/widgets/NodePathWidget/index.d.ts +6 -0
  133. package/dist/src/widgets/NodePathWidget/index.js +32 -0
  134. package/dist/src/widgets/NodeTitleWidget/index.d.ts +6 -0
  135. package/dist/src/widgets/NodeTitleWidget/index.js +13 -0
  136. package/dist/src/widgets/TextWidget/index.d.ts +10 -0
  137. package/dist/src/widgets/TextWidget/index.js +36 -0
  138. package/dist/src/widgets/ViewToolsWidget/index.d.ts +11 -0
  139. package/dist/src/widgets/ViewToolsWidget/index.js +76 -0
  140. package/dist/src/widgets/index.d.ts +11 -0
  141. package/dist/src/widgets/index.js +11 -0
  142. package/package.json +61 -4
@@ -0,0 +1,157 @@
1
+ declare const _default: {
2
+ 'zh-CN': {
3
+ icons: {
4
+ Image: string;
5
+ ImageSize: string;
6
+ Position: string;
7
+ Number: string;
8
+ Text: string;
9
+ Expression: string;
10
+ RichText: string;
11
+ Boolean: string;
12
+ Repeat: string;
13
+ Top: string;
14
+ Left: string;
15
+ Right: string;
16
+ Bottom: string;
17
+ TopLeft: string;
18
+ TopRight: string;
19
+ BottomRight: string;
20
+ BottomLeft: string;
21
+ DisplayBlock: string;
22
+ DisplayInlineBlock: string;
23
+ DisplayInline: string;
24
+ DisplayFlex: string;
25
+ FlexDirectionRow: string;
26
+ FlexDirectionColumn: string;
27
+ FlexAlignContentCenter: string;
28
+ FlexAlignContentStart: string;
29
+ FlexAlignContentEnd: string;
30
+ FlexAlignContentSpaceAround: string;
31
+ FlexAlignContentSpaceBetween: string;
32
+ FlexAlignContentStretch: string;
33
+ FlexJustifyCenter: string;
34
+ FlexJustifyStart: string;
35
+ FlexJustifyEnd: string;
36
+ FlexJustifySpaceBetween: string;
37
+ FlexJustifySpaceAround: string;
38
+ FlexJustifySpaceEvenly: string;
39
+ FlexAlignItemsCenter: string;
40
+ FlexAlignItemsStart: string;
41
+ FlexAlignItemsEnd: string;
42
+ FlexAlignItemsStretch: string;
43
+ FlexAlignItemsBaseline: string;
44
+ FlexNoWrap: string;
45
+ FlexWrap: string;
46
+ AxisX: string;
47
+ AxisY: string;
48
+ Blur: string;
49
+ Shadow: string;
50
+ FontWeight: string;
51
+ FontStyle: string;
52
+ NormalFontStyle: string;
53
+ ItalicFontStyle: string;
54
+ FontColor: string;
55
+ FontSize: string;
56
+ LineHeight: string;
57
+ TextDecoration: string;
58
+ TextUnderline: string;
59
+ TextLineThrough: string;
60
+ TextAlign: string;
61
+ TextAlignLeft: string;
62
+ TextAlignCenter: string;
63
+ TextAlignRight: string;
64
+ TextAlignJustify: string;
65
+ Undo: string;
66
+ Redo: string;
67
+ Move: string;
68
+ Selection: string;
69
+ PC: string;
70
+ Mobile: string;
71
+ Responsive: string;
72
+ Flip: string;
73
+ Design: string;
74
+ JSON: string;
75
+ Code: string;
76
+ Play: string;
77
+ };
78
+ };
79
+ 'en-US': {
80
+ icons: {
81
+ Image: string;
82
+ ImageSize: string;
83
+ Boolean: string;
84
+ Number: string;
85
+ Text: string;
86
+ Expression: string;
87
+ RichText: string;
88
+ Position: string;
89
+ Repeat: string;
90
+ Top: string;
91
+ Left: string;
92
+ Right: string;
93
+ Bottom: string;
94
+ TopLeft: string;
95
+ TopRight: string;
96
+ BottomRight: string;
97
+ BottomLeft: string;
98
+ DisplayBlock: string;
99
+ DisplayInlineBlock: string;
100
+ DisplayInline: string;
101
+ DisplayFlex: string;
102
+ FlexDirectionRow: string;
103
+ FlexDirectionColumn: string;
104
+ FlexAlignContentCenter: string;
105
+ FlexAlignContentStart: string;
106
+ FlexAlignContentEnd: string;
107
+ FlexAlignContentSpaceAround: string;
108
+ FlexAlignContentSpaceBetween: string;
109
+ FlexAlignContentStretch: string;
110
+ FlexJustifyCenter: string;
111
+ FlexJustifyStart: string;
112
+ FlexJustifyEnd: string;
113
+ FlexJustifySpaceBetween: string;
114
+ FlexJustifySpaceAround: string;
115
+ FlexJustifySpaceEvenly: string;
116
+ FlexAlignItemsCenter: string;
117
+ FlexAlignItemsStart: string;
118
+ FlexAlignItemsEnd: string;
119
+ FlexAlignItemsStretch: string;
120
+ FlexAlignItemsBaseline: string;
121
+ FlexNoWrap: string;
122
+ FlexWrap: string;
123
+ AxisX: string;
124
+ AxisY: string;
125
+ Blur: string;
126
+ Shadow: string;
127
+ FontWeight: string;
128
+ FontStyle: string;
129
+ NormalFontStyle: string;
130
+ ItalicFontStyle: string;
131
+ FontColor: string;
132
+ FontSize: string;
133
+ LineHeight: string;
134
+ TextDecoration: string;
135
+ TextUnderline: string;
136
+ TextLineThrough: string;
137
+ TextAlign: string;
138
+ TextAlignLeft: string;
139
+ TextAlignCenter: string;
140
+ TextAlignRight: string;
141
+ TextAlignJustify: string;
142
+ Undo: string;
143
+ Redo: string;
144
+ Move: string;
145
+ Selection: string;
146
+ PC: string;
147
+ Mobile: string;
148
+ Responsive: string;
149
+ Flip: string;
150
+ Design: string;
151
+ JSON: string;
152
+ Code: string;
153
+ Play: string;
154
+ };
155
+ };
156
+ };
157
+ export default _default;
@@ -0,0 +1,156 @@
1
+ export default {
2
+ 'zh-CN': {
3
+ icons: {
4
+ Image: '图片',
5
+ ImageSize: '图片尺寸',
6
+ Position: '位置',
7
+ Number: '数字',
8
+ Text: '文本',
9
+ Expression: '表达式',
10
+ RichText: '富文本',
11
+ Boolean: '布尔',
12
+ Repeat: '重复',
13
+ Top: '上',
14
+ Left: '左',
15
+ Right: '右',
16
+ Bottom: '下',
17
+ TopLeft: '左上',
18
+ TopRight: '右上',
19
+ BottomRight: '右下',
20
+ BottomLeft: '左下',
21
+ DisplayBlock: '区块',
22
+ DisplayInlineBlock: '内联区块',
23
+ DisplayInline: '文本内联',
24
+ DisplayFlex: '弹性盒子',
25
+ FlexDirectionRow: '横向',
26
+ FlexDirectionColumn: '纵向',
27
+ FlexAlignContentCenter: '居中',
28
+ FlexAlignContentStart: '头部',
29
+ FlexAlignContentEnd: '尾部',
30
+ FlexAlignContentSpaceAround: 'Space Around',
31
+ FlexAlignContentSpaceBetween: 'Space Between',
32
+ FlexAlignContentStretch: 'Stretch',
33
+ FlexJustifyCenter: '居中',
34
+ FlexJustifyStart: '头部',
35
+ FlexJustifyEnd: '尾部',
36
+ FlexJustifySpaceBetween: 'Space Between',
37
+ FlexJustifySpaceAround: 'Space Around',
38
+ FlexJustifySpaceEvenly: 'Space Evenly',
39
+ FlexAlignItemsCenter: '居中',
40
+ FlexAlignItemsStart: '头部',
41
+ FlexAlignItemsEnd: '尾部',
42
+ FlexAlignItemsStretch: 'Stretch',
43
+ FlexAlignItemsBaseline: 'Baseline',
44
+ FlexNoWrap: '不换行',
45
+ FlexWrap: '换行',
46
+ AxisX: 'X轴',
47
+ AxisY: 'Y轴',
48
+ Blur: '模糊度',
49
+ Shadow: '阴影扩展',
50
+ FontWeight: '字重',
51
+ FontStyle: '风格',
52
+ NormalFontStyle: '标准',
53
+ ItalicFontStyle: '斜体',
54
+ FontColor: '颜色',
55
+ FontSize: '大小',
56
+ LineHeight: '行高',
57
+ TextDecoration: '修饰',
58
+ TextUnderline: '下划线',
59
+ TextLineThrough: '中横线',
60
+ TextAlign: '对齐',
61
+ TextAlignLeft: '左对齐',
62
+ TextAlignCenter: '居中',
63
+ TextAlignRight: '右对齐',
64
+ TextAlignJustify: '自适应',
65
+ Undo: '撤销',
66
+ Redo: '重做',
67
+ Move: '移动',
68
+ Selection: '选择',
69
+ PC: 'PC',
70
+ Mobile: '移动端',
71
+ Responsive: '响应式',
72
+ Flip: '翻转',
73
+ Design: '设计',
74
+ JSON: 'JSON',
75
+ Code: '代码',
76
+ Play: '预览',
77
+ },
78
+ },
79
+ 'en-US': {
80
+ icons: {
81
+ Image: 'Image',
82
+ ImageSize: 'Image Size',
83
+ Boolean: 'Boolean',
84
+ Number: 'Number',
85
+ Text: 'Text',
86
+ Expression: 'Expression',
87
+ RichText: 'Rich Text',
88
+ Position: 'Position',
89
+ Repeat: 'Repeat',
90
+ Top: 'Top',
91
+ Left: 'Left',
92
+ Right: 'Right',
93
+ Bottom: 'Bottom',
94
+ TopLeft: 'Top Left',
95
+ TopRight: 'Top Right',
96
+ BottomRight: 'Bottom Right',
97
+ BottomLeft: 'Bottom Left',
98
+ DisplayBlock: 'Block',
99
+ DisplayInlineBlock: 'Inline Block',
100
+ DisplayInline: 'Inline',
101
+ DisplayFlex: 'Flex',
102
+ FlexDirectionRow: 'Horizontal',
103
+ FlexDirectionColumn: 'Vertical',
104
+ FlexAlignContentCenter: 'Center',
105
+ FlexAlignContentStart: 'Start',
106
+ FlexAlignContentEnd: 'End',
107
+ FlexAlignContentSpaceAround: 'Space Around',
108
+ FlexAlignContentSpaceBetween: 'Space Between',
109
+ FlexAlignContentStretch: 'Stretch',
110
+ FlexJustifyCenter: 'Center',
111
+ FlexJustifyStart: 'Start',
112
+ FlexJustifyEnd: 'End',
113
+ FlexJustifySpaceBetween: 'Space Between',
114
+ FlexJustifySpaceAround: 'Space Around',
115
+ FlexJustifySpaceEvenly: 'Space Evenly',
116
+ FlexAlignItemsCenter: 'Center',
117
+ FlexAlignItemsStart: 'Start',
118
+ FlexAlignItemsEnd: 'End',
119
+ FlexAlignItemsStretch: 'Stretch',
120
+ FlexAlignItemsBaseline: 'Baseline',
121
+ FlexNoWrap: 'No Wrap',
122
+ FlexWrap: 'Wrap',
123
+ AxisX: 'X Axis',
124
+ AxisY: 'Y Axis',
125
+ Blur: 'Blur',
126
+ Shadow: 'Shadow Spread',
127
+ FontWeight: 'Font Weight',
128
+ FontStyle: 'Font Style',
129
+ NormalFontStyle: 'Normal',
130
+ ItalicFontStyle: 'Italic',
131
+ FontColor: 'Color',
132
+ FontSize: 'Font Size',
133
+ LineHeight: 'Line Height',
134
+ TextDecoration: 'Decoration',
135
+ TextUnderline: 'Underline',
136
+ TextLineThrough: 'Line Through',
137
+ TextAlign: 'Align',
138
+ TextAlignLeft: 'Left',
139
+ TextAlignCenter: 'Center',
140
+ TextAlignRight: 'Right',
141
+ TextAlignJustify: 'Justify',
142
+ Undo: 'Undo',
143
+ Redo: 'Redo',
144
+ Move: 'Move',
145
+ Selection: 'Selection',
146
+ PC: 'PC',
147
+ Mobile: 'Mobile',
148
+ Responsive: 'Responsive',
149
+ Flip: 'Flip',
150
+ Design: 'Design',
151
+ JSON: 'JSON',
152
+ Code: 'Code',
153
+ Play: 'Preview',
154
+ },
155
+ },
156
+ };
@@ -0,0 +1,5 @@
1
+ import global from "./global.js";
2
+ import icons from "./icons.js";
3
+ import operations from "./operations.js";
4
+ import panels from "./panels.js";
5
+ export { global, icons, operations, panels };
@@ -0,0 +1,7 @@
1
+ import { GlobalRegistry } from '@yimoka/designable-core';
2
+ import global from "./global.js";
3
+ import icons from "./icons.js";
4
+ import operations from "./operations.js";
5
+ import panels from "./panels.js";
6
+ GlobalRegistry.registerDesignerLocales(icons, panels, global, operations);
7
+ export { global, icons, operations, panels };
@@ -0,0 +1,57 @@
1
+ declare const _default: {
2
+ 'zh-CN': {
3
+ operations: {
4
+ default_state: string;
5
+ append_node: string;
6
+ prepend_node: string;
7
+ insert_node: string;
8
+ drop_node: string;
9
+ clone_node: string;
10
+ paste_node: string;
11
+ move_outline_node: string;
12
+ init_schema: string;
13
+ set_schema_controlled: string;
14
+ import_schema: string;
15
+ load_design: string;
16
+ clear_design: string;
17
+ update_tree_schema: string;
18
+ update_props: string;
19
+ update_node_props: string;
20
+ insert_after: string;
21
+ insert_before: string;
22
+ insert_children: string;
23
+ update_children: string;
24
+ remove_node: string;
25
+ wrap_node: string;
26
+ from_node: string;
27
+ };
28
+ };
29
+ 'en-US': {
30
+ operations: {
31
+ default_state: string;
32
+ append_node: string;
33
+ prepend_node: string;
34
+ insert_node: string;
35
+ drop_node: string;
36
+ clone_node: string;
37
+ paste_node: string;
38
+ move_outline_node: string;
39
+ init_schema: string;
40
+ set_schema_controlled: string;
41
+ import_schema: string;
42
+ load_design: string;
43
+ clear_design: string;
44
+ update_tree_schema: string;
45
+ update_props: string;
46
+ update_node_props: string;
47
+ insert_after: string;
48
+ insert_before: string;
49
+ insert_children: string;
50
+ update_children: string;
51
+ remove_node: string;
52
+ wrap_node: string;
53
+ from_node: string;
54
+ };
55
+ };
56
+ };
57
+ export default _default;
@@ -0,0 +1,56 @@
1
+ export default {
2
+ 'zh-CN': {
3
+ operations: {
4
+ default_state: '缺省态',
5
+ append_node: '追加节点',
6
+ prepend_node: '头部追加',
7
+ insert_node: '插入节点',
8
+ drop_node: '拖入节点',
9
+ clone_node: '复制节点',
10
+ paste_node: '粘贴节点',
11
+ move_outline_node: '大纲排序',
12
+ init_schema: '初始化 Schema',
13
+ set_schema_controlled: '同步 Schema',
14
+ import_schema: '导入 Schema',
15
+ load_design: '加载设计',
16
+ clear_design: '清空画布',
17
+ update_tree_schema: '应用 Schema',
18
+ update_props: '属性更改',
19
+ update_node_props: '属性更改',
20
+ insert_after: '后置插入',
21
+ insert_before: '前置插入',
22
+ insert_children: '插入子节点',
23
+ update_children: '覆盖子节点',
24
+ remove_node: '删除节点',
25
+ wrap_node: '包装节点',
26
+ from_node: '子树更新',
27
+ },
28
+ },
29
+ 'en-US': {
30
+ operations: {
31
+ default_state: 'Default State',
32
+ append_node: 'Append Node',
33
+ prepend_node: 'Prepend Node',
34
+ insert_node: 'Insert Node',
35
+ drop_node: 'Drop Node',
36
+ clone_node: 'Clone Node',
37
+ paste_node: 'Paste Node',
38
+ move_outline_node: 'Move Outline Node',
39
+ init_schema: 'Initialize Schema',
40
+ set_schema_controlled: 'Sync Schema',
41
+ import_schema: 'Import Schema',
42
+ load_design: 'Load Design',
43
+ clear_design: 'Clear Design',
44
+ update_tree_schema: 'Apply Schema',
45
+ update_props: 'Update Props',
46
+ update_node_props: 'Update Node Props',
47
+ insert_after: 'Insert Node After',
48
+ insert_before: 'Insert Node Before',
49
+ insert_children: 'Insert Node Children',
50
+ update_children: 'Update Children',
51
+ remove_node: 'Remove Node',
52
+ wrap_node: 'Wrap Node',
53
+ from_node: 'Update Child Tree',
54
+ },
55
+ },
56
+ };
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ 'zh-CN': {
3
+ panels: {
4
+ Component: string;
5
+ OutlinedTree: string;
6
+ PropertySettings: string;
7
+ History: string;
8
+ };
9
+ };
10
+ 'en-US': {
11
+ panels: {
12
+ Component: string;
13
+ OutlinedTree: string;
14
+ PropertySettings: string;
15
+ History: string;
16
+ };
17
+ };
18
+ };
19
+ export default _default;
@@ -0,0 +1,18 @@
1
+ export default {
2
+ 'zh-CN': {
3
+ panels: {
4
+ Component: '组件',
5
+ OutlinedTree: '大纲树',
6
+ PropertySettings: '属性配置',
7
+ History: '历史记录',
8
+ },
9
+ },
10
+ 'en-US': {
11
+ panels: {
12
+ Component: 'Component',
13
+ OutlinedTree: 'Outlined Tree',
14
+ PropertySettings: 'Property Settings',
15
+ History: 'History',
16
+ },
17
+ },
18
+ };
@@ -0,0 +1,5 @@
1
+ export declare const DESIGNABLE_ENGINE_KEY = "__DESIGNABLE_ENGINE__";
2
+ export declare const DESIGNABLE_LAYOUT_KEY = "__DESIGNABLE_LAYOUT__";
3
+ export declare const DESIGNABLE_WORKSPACE_KEY = "__DESIGNABLE_WORKSPACE__";
4
+ export declare const DESIGNABLE_SANDBOX_SCOPE_KEY = "__DESIGNABLE_SANDBOX_SCOPE__";
5
+ export declare const DESIGNER_REGISTRY_KEY = "__DESIGNER_REGISTRY__";
@@ -0,0 +1,5 @@
1
+ export const DESIGNABLE_ENGINE_KEY = '__DESIGNABLE_ENGINE__';
2
+ export const DESIGNABLE_LAYOUT_KEY = '__DESIGNABLE_LAYOUT__';
3
+ export const DESIGNABLE_WORKSPACE_KEY = '__DESIGNABLE_WORKSPACE__';
4
+ export const DESIGNABLE_SANDBOX_SCOPE_KEY = '__DESIGNABLE_SANDBOX_SCOPE__';
5
+ export const DESIGNER_REGISTRY_KEY = '__DESIGNER_REGISTRY__';
@@ -0,0 +1,36 @@
1
+ import type { Engine, IBehavior, IResource } from '@yimoka/designable-core';
2
+ import type { ComponentType, FC } from 'react';
3
+ export interface IDesignerLayoutProps {
4
+ prefixCls?: string;
5
+ theme?: 'dark' | 'light' | (string & {});
6
+ variables?: Record<string, string>;
7
+ position?: 'fixed' | 'absolute' | 'relative';
8
+ }
9
+ export interface IDesignerProps extends IDesignerLayoutProps {
10
+ engine: Engine;
11
+ }
12
+ export interface IDesignerComponents {
13
+ [key: string]: DnComponentRegistryItem;
14
+ }
15
+ export interface IDesignerLayoutContext {
16
+ theme?: 'dark' | 'light' | (string & {});
17
+ prefixCls: string;
18
+ position: 'fixed' | 'absolute' | 'relative';
19
+ }
20
+ export interface IWorkspaceContext {
21
+ id: string;
22
+ title?: string;
23
+ description?: string;
24
+ }
25
+ export type DnFC<P = object> = FC<P> & {
26
+ Resource?: IResource[];
27
+ Behavior?: IBehavior[];
28
+ };
29
+ export type DnComponent<P = object> = ComponentType<P> & {
30
+ Resource?: IResource[];
31
+ Behavior?: IBehavior[];
32
+ };
33
+ export type DnComponentRegistryItem = object & {
34
+ Resource?: IResource[];
35
+ Behavior?: IBehavior[];
36
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const Cover: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;
@@ -0,0 +1,48 @@
1
+ import { observer } from '@formily/reactive-react';
2
+ import { ClosestPosition, CursorStatus } from '@yimoka/designable-core';
3
+ import cls from 'classnames';
4
+ import React, { Fragment } from 'react';
5
+ import { useCursor, useDragon, usePrefix, useValidNodeOffsetRect, useViewport, } from "../../hooks/index.js";
6
+ const CoverRect = observer((props) => {
7
+ const prefix = usePrefix('aux-cover-rect');
8
+ const rect = useValidNodeOffsetRect(props.node);
9
+ if (!rect?.width || !rect?.height)
10
+ return null;
11
+ return (React.createElement("div", { className: cls(prefix, {
12
+ dragging: props.dragging,
13
+ dropping: props.dropping,
14
+ }), style: {
15
+ backgroundColor: props.dropping ? 'rgba(24, 144, 255, 0.08)' : 'rgba(0, 0, 0, 0.04)',
16
+ border: props.dropping ? '1px dashed #1890ff' : '1px solid rgba(0, 0, 0, 0.08)',
17
+ boxSizing: 'border-box',
18
+ height: rect.height,
19
+ left: 0,
20
+ pointerEvents: 'none',
21
+ position: 'absolute',
22
+ top: 0,
23
+ transform: `perspective(1px) translate3d(${rect.x}px,${rect.y}px,0)`,
24
+ width: rect.width,
25
+ } }));
26
+ });
27
+ CoverRect.displayName = 'CoverRect';
28
+ export const Cover = observer(() => {
29
+ const cursor = useCursor();
30
+ const viewport = useViewport();
31
+ const viewportDragon = useDragon();
32
+ if (cursor?.status !== CursorStatus.Dragging)
33
+ return null;
34
+ if (!viewport || !viewportDragon)
35
+ return null;
36
+ const { closestDirection, closestNode, dragNodes } = viewportDragon;
37
+ const canDropInside = Boolean(closestNode
38
+ && closestDirection === ClosestPosition.Inner
39
+ && closestNode.allowAppend(dragNodes));
40
+ return (React.createElement(Fragment, null,
41
+ dragNodes.map((node) => {
42
+ if (!node || !viewport.findElementById(node.id))
43
+ return null;
44
+ return React.createElement(CoverRect, { key: node.id, dragging: true, node: node });
45
+ }),
46
+ canDropInside && closestNode ? React.createElement(CoverRect, { dropping: true, node: closestNode }) : null));
47
+ });
48
+ Cover.displayName = 'Cover';
@@ -0,0 +1,6 @@
1
+ import type { TreeNode } from '@yimoka/designable-core';
2
+ import React from 'react';
3
+ export interface IHelpersProps {
4
+ node: TreeNode;
5
+ }
6
+ export declare const Helpers: React.FC<IHelpersProps>;
@@ -0,0 +1,74 @@
1
+ import { observer } from '@formily/reactive-react';
2
+ import cls from 'classnames';
3
+ import React from 'react';
4
+ import { useDesigner, useOperation, usePrefix, useValidNodeOffsetRect, } from "../../hooks/index.js";
5
+ import { NodeTitleWidget } from "../NodeTitleWidget/index.js";
6
+ const createActionStyle = (enabled) => ({
7
+ background: 'transparent',
8
+ border: 0,
9
+ color: 'inherit',
10
+ cursor: enabled ? 'pointer' : 'not-allowed',
11
+ lineHeight: 1,
12
+ padding: 0,
13
+ });
14
+ const getDesignerAttrNames = (designer) => ({
15
+ clickStopPropagationAttrName: designer?.props?.clickStopPropagationAttrName
16
+ ?? 'data-click-stop-propagation',
17
+ nodeDragHandlerAttrName: designer?.props?.nodeDragHandlerAttrName
18
+ ?? 'data-designer-node-handler',
19
+ nodeSelectionIdAttrName: designer?.props?.nodeSelectionIdAttrName
20
+ ?? 'data-designer-node-helpers-id',
21
+ });
22
+ const createHelpersStyle = (rect) => ({
23
+ alignItems: 'center',
24
+ background: '#1677ff',
25
+ borderRadius: 2,
26
+ boxShadow: '0 2px 6px rgba(0, 0, 0, 0.16)',
27
+ color: '#fff',
28
+ display: 'inline-flex',
29
+ fontSize: 12,
30
+ gap: 4,
31
+ lineHeight: 1,
32
+ padding: '4px 6px',
33
+ pointerEvents: 'auto',
34
+ position: 'absolute',
35
+ top: 0,
36
+ transform: `perspective(1px) translate3d(${rect.x}px,${Math.max(rect.y - 28, 0)}px,0)`,
37
+ whiteSpace: 'nowrap',
38
+ });
39
+ export const Helpers = observer(({ node }) => {
40
+ const designer = useDesigner();
41
+ const operation = useOperation();
42
+ const prefix = usePrefix('aux-helpers');
43
+ const rect = useValidNodeOffsetRect(node);
44
+ const { clickStopPropagationAttrName, nodeDragHandlerAttrName, nodeSelectionIdAttrName, } = getDesignerAttrNames(designer);
45
+ const canClone = node.allowClone() && node !== node.root;
46
+ const canDelete = node.allowDelete() && node !== node.root;
47
+ const cleanInteractionState = () => {
48
+ operation?.dragClean();
49
+ operation?.hover?.clear?.();
50
+ };
51
+ const handleClone = () => {
52
+ if (!canClone)
53
+ return;
54
+ operation?.cloneNodes([node]);
55
+ cleanInteractionState();
56
+ };
57
+ const handleDelete = () => {
58
+ if (!canDelete)
59
+ return;
60
+ operation?.removeNodes([node]);
61
+ cleanInteractionState();
62
+ };
63
+ if (!rect?.width || !rect?.height)
64
+ return null;
65
+ return (React.createElement("div", { className: prefix, [nodeSelectionIdAttrName]: node.id, style: createHelpersStyle(rect) },
66
+ React.createElement("span", { className: `${prefix}-title`, [nodeDragHandlerAttrName]: 'true', style: {
67
+ cursor: node.allowDrag() ? 'grab' : 'default',
68
+ userSelect: 'none',
69
+ } },
70
+ React.createElement(NodeTitleWidget, { node: node })),
71
+ React.createElement("button", { "aria-label": "\u590D\u5236\u8282\u70B9", className: cls(`${prefix}-action`, `${prefix}-copy`), [clickStopPropagationAttrName]: 'true', disabled: !canClone, style: createActionStyle(canClone), type: "button", onClick: handleClone }, "\u590D\u5236"),
72
+ React.createElement("button", { "aria-label": "\u5220\u9664\u8282\u70B9", className: cls(`${prefix}-action`, `${prefix}-delete`), [clickStopPropagationAttrName]: 'true', disabled: !canDelete, style: createActionStyle(canDelete), type: "button", onClick: handleDelete }, "\u5220\u9664")));
73
+ });
74
+ Helpers.displayName = 'Helpers';
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const Insertion: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;