@chamn/engine 0.0.4 → 0.0.7

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 (173) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +16 -0
  3. package/README.md +31 -0
  4. package/build.config.js +4 -3
  5. package/dist/Engine.module.scss.d.ts +5 -0
  6. package/dist/component/CSSEditor/index.d.ts +16 -0
  7. package/dist/component/CSSEditor/style.module.scss.d.ts +6 -0
  8. package/dist/component/CSSPropertiesEditor/cssProperties.d.ts +898 -0
  9. package/dist/component/CSSPropertiesEditor/index.d.ts +43 -0
  10. package/dist/component/CSSPropertiesEditor/style.module.scss.d.ts +15 -0
  11. package/dist/component/CSSPropertiesEditor/util.d.ts +1 -0
  12. package/dist/component/CSSPropertiesVariableBindEditor/cssProperties.d.ts +898 -0
  13. package/dist/component/CSSPropertiesVariableBindEditor/index.d.ts +37 -0
  14. package/dist/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +15 -0
  15. package/dist/component/CSSPropertiesVariableBindEditor/util.d.ts +1 -0
  16. package/dist/component/ClassNameEditor/index.d.ts +16 -0
  17. package/dist/component/CustomSchemaForm/components/Form/Field/index.d.ts +11 -0
  18. package/dist/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
  19. package/dist/component/CustomSchemaForm/components/Form/context.d.ts +10 -0
  20. package/dist/component/CustomSchemaForm/components/Form/index.d.ts +17 -0
  21. package/dist/component/CustomSchemaForm/components/SetterSwitcher/index.d.ts +12 -0
  22. package/dist/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -0
  23. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/ArrayItem.d.ts +11 -0
  24. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/SortItemOrderModal.d.ts +10 -0
  25. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/index.d.ts +14 -0
  26. package/dist/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +7 -0
  27. package/dist/component/CustomSchemaForm/components/Setters/BooleanSetter/index.d.ts +5 -0
  28. package/dist/component/CustomSchemaForm/components/Setters/CSSValueSetter/index.d.ts +6 -0
  29. package/dist/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +6 -0
  30. package/dist/component/CustomSchemaForm/components/Setters/ExpressionSetter/index.d.ts +8 -0
  31. package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/defaultDts.d.ts +1 -0
  32. package/dist/component/CustomSchemaForm/components/Setters/FunctionSetter/index.d.ts +2 -0
  33. package/dist/component/CustomSchemaForm/components/Setters/JSONSetter/index.d.ts +2 -0
  34. package/dist/component/CustomSchemaForm/components/Setters/NumberSetter/index.d.ts +3 -0
  35. package/dist/component/CustomSchemaForm/components/Setters/SelectSetter/index.d.ts +3 -0
  36. package/dist/component/CustomSchemaForm/components/Setters/ShapeSetter/index.d.ts +8 -0
  37. package/dist/component/CustomSchemaForm/components/Setters/StringSetter/index.d.ts +3 -0
  38. package/dist/component/CustomSchemaForm/components/Setters/TextAreaSetter/index.d.ts +3 -0
  39. package/dist/component/CustomSchemaForm/components/Setters/index.d.ts +3 -0
  40. package/dist/component/CustomSchemaForm/components/Setters/type.d.ts +19 -0
  41. package/dist/component/CustomSchemaForm/context.d.ts +15 -0
  42. package/dist/component/CustomSchemaForm/index.d.ts +17 -0
  43. package/dist/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
  44. package/dist/component/CustomSchemaForm/utils.d.ts +2 -0
  45. package/dist/component/MonacoEditor/index.d.ts +15 -0
  46. package/dist/component/Workbench/style.module.scss.d.ts +26 -0
  47. package/dist/core/pluginManager.d.ts +1 -1
  48. package/dist/index.cjs.js +295 -39
  49. package/dist/index.cjs.js.map +1 -1
  50. package/dist/index.d.ts +4 -2
  51. package/dist/index.es.js +44920 -9933
  52. package/dist/index.es.js.map +1 -1
  53. package/dist/material/innerMaterial.d.ts +2 -0
  54. package/dist/monacoeditorwork/css.worker.bundle.js +45072 -0
  55. package/dist/monacoeditorwork/editor.worker.bundle.js +8294 -0
  56. package/dist/monacoeditorwork/html.worker.bundle.js +24321 -0
  57. package/dist/monacoeditorwork/json.worker.bundle.js +15550 -0
  58. package/dist/monacoeditorwork/ts.worker.bundle.js +169967 -0
  59. package/dist/plugins/AdvancePanel/index.d.ts +10 -0
  60. package/dist/plugins/AdvancePanel/style.module.scss.d.ts +7 -0
  61. package/dist/plugins/ComponentLibrary/components/DragItem/index.d.ts +12 -0
  62. package/dist/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +9 -0
  63. package/dist/plugins/ComponentLibrary/components/ListView/index.d.ts +9 -0
  64. package/dist/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +12 -0
  65. package/dist/plugins/ComponentLibrary/index.d.ts +3 -0
  66. package/dist/plugins/ComponentLibrary/localize/en_US/index.d.ts +1 -0
  67. package/dist/plugins/ComponentLibrary/localize/index.d.ts +2 -0
  68. package/dist/plugins/ComponentLibrary/localize/zh_CN/index.d.ts +1 -0
  69. package/dist/plugins/ComponentLibrary/style.module.scss.d.ts +11 -0
  70. package/dist/plugins/ComponentLibrary/util.d.ts +1 -0
  71. package/dist/plugins/ComponentStatePanel/index.d.ts +10 -0
  72. package/dist/plugins/Designer/components/DefaultSelectToolBar/index.d.ts +10 -0
  73. package/dist/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +11 -0
  74. package/dist/plugins/Designer/components/GhostView/index.d.ts +5 -0
  75. package/dist/plugins/Designer/config.d.ts +1 -0
  76. package/dist/plugins/Designer/index.d.ts +15 -0
  77. package/dist/plugins/Designer/localize/en_US/index.d.ts +1 -0
  78. package/dist/plugins/Designer/localize/index.d.ts +2 -0
  79. package/dist/plugins/Designer/localize/zh_CN/index.d.ts +1 -0
  80. package/dist/plugins/Designer/style.module.scss.d.ts +5 -0
  81. package/dist/plugins/Designer/util.d.ts +2 -0
  82. package/dist/plugins/Designer/view.d.ts +30 -0
  83. package/dist/plugins/DisplaySourceSchema/index.d.ts +9 -0
  84. package/dist/plugins/GlobalStatePanel/index.d.ts +3 -0
  85. package/dist/plugins/GlobalStatePanel/localize/en_US/index.d.ts +1 -0
  86. package/dist/plugins/GlobalStatePanel/localize/index.d.ts +2 -0
  87. package/dist/plugins/GlobalStatePanel/localize/zh_CN/index.d.ts +1 -0
  88. package/dist/plugins/GlobalStatePanel/style.module.scss.d.ts +5 -0
  89. package/dist/plugins/History/index.d.ts +2 -0
  90. package/dist/plugins/OutlineTree/components/TreeView/context.d.ts +30 -0
  91. package/dist/plugins/OutlineTree/components/TreeView/dataStruct.d.ts +21 -0
  92. package/dist/plugins/OutlineTree/components/TreeView/index.d.ts +34 -0
  93. package/dist/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
  94. package/dist/plugins/OutlineTree/components/TreeView/treeNode.d.ts +9 -0
  95. package/dist/plugins/OutlineTree/index.d.ts +3 -0
  96. package/dist/plugins/OutlineTree/localize/en_US/index.d.ts +1 -0
  97. package/dist/plugins/OutlineTree/localize/index.d.ts +2 -0
  98. package/dist/plugins/OutlineTree/localize/zh_CN/index.d.ts +1 -0
  99. package/dist/plugins/OutlineTree/util.d.ts +15 -0
  100. package/dist/plugins/PropertyPanel/index.d.ts +9 -0
  101. package/dist/plugins/PropertyPanel/style.module.scss.d.ts +10 -0
  102. package/dist/plugins/RightPanel/index.d.ts +2 -0
  103. package/dist/plugins/RightPanel/style.module.scss.d.ts +10 -0
  104. package/dist/plugins/RightPanel/view.d.ts +34 -0
  105. package/dist/plugins/VisualPanelPlus/index.d.ts +9 -0
  106. package/dist/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
  107. package/dist/plugins/index.d.ts +9 -0
  108. package/dist/style.css +1 -1
  109. package/dist/utils/css.d.ts +19 -0
  110. package/dist/utils/logger.d.ts +1 -0
  111. package/package.json +16 -8
  112. package/public/Engine.module.scss.d.ts +5 -0
  113. package/public/component/CSSEditor/style.module.scss.d.ts +6 -0
  114. package/public/component/CSSPropertiesEditor/style.module.scss.d.ts +15 -0
  115. package/public/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +15 -0
  116. package/public/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
  117. package/public/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -0
  118. package/public/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +7 -0
  119. package/public/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +6 -0
  120. package/public/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
  121. package/public/component/Workbench/style.module.scss.d.ts +26 -0
  122. package/public/plugins/AdvancePanel/style.module.scss.d.ts +7 -0
  123. package/public/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +9 -0
  124. package/public/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +12 -0
  125. package/public/plugins/ComponentLibrary/style.module.scss.d.ts +11 -0
  126. package/public/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +11 -0
  127. package/public/plugins/Designer/style.module.scss.d.ts +5 -0
  128. package/public/plugins/GlobalStatePanel/style.module.scss.d.ts +5 -0
  129. package/public/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
  130. package/public/plugins/PropertyPanel/style.module.scss.d.ts +10 -0
  131. package/public/plugins/RightPanel/style.module.scss.d.ts +10 -0
  132. package/public/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
  133. package/public/render.umd.js +14 -14
  134. package/public/render.umd.js.map +1 -1
  135. package/src/Engine.module.scss.d.ts +5 -0
  136. package/src/_dev_/page/Editor/index.tsx +1 -1
  137. package/src/component/CSSEditor/index.tsx +4 -5
  138. package/src/component/CSSEditor/style.module.scss.d.ts +6 -0
  139. package/src/component/CSSPropertiesEditor/index.tsx +1 -5
  140. package/src/component/CSSPropertiesEditor/style.module.scss.d.ts +15 -0
  141. package/src/component/CSSPropertiesVariableBindEditor/index.tsx +1 -1
  142. package/src/component/CSSPropertiesVariableBindEditor/style.module.scss.d.ts +15 -0
  143. package/src/component/CustomSchemaForm/components/Form/Field/style.module.scss.d.ts +8 -0
  144. package/src/component/CustomSchemaForm/components/SetterSwitcher/style.module.scss.d.ts +7 -0
  145. package/src/component/CustomSchemaForm/components/Setters/ArraySetter/style.module.scss.d.ts +7 -0
  146. package/src/component/CustomSchemaForm/components/Setters/CSSValueSetter/style.module.scss.d.ts +6 -0
  147. package/src/component/CustomSchemaForm/style.module.scss.d.ts +11 -0
  148. package/src/component/MonacoEditor/index.tsx +1 -41
  149. package/src/component/Workbench/style.module.scss.d.ts +26 -0
  150. package/src/core/pluginManager.ts +1 -1
  151. package/src/index.tsx +5 -2
  152. package/src/plugins/AdvancePanel/style.module.scss.d.ts +7 -0
  153. package/src/plugins/ComponentLibrary/components/DragItem/style.module.scss.d.ts +9 -0
  154. package/src/plugins/ComponentLibrary/components/ListView/index.tsx +0 -1
  155. package/src/plugins/ComponentLibrary/components/ListView/style.module.scss.d.ts +12 -0
  156. package/src/plugins/ComponentLibrary/style.module.scss.d.ts +11 -0
  157. package/src/plugins/Designer/components/DefaultSelectToolBar/style.module.scss.d.ts +11 -0
  158. package/src/plugins/Designer/style.module.scss.d.ts +5 -0
  159. package/src/plugins/DisplaySourceSchema/index.tsx +1 -1
  160. package/src/plugins/GlobalStatePanel/style.module.scss.d.ts +5 -0
  161. package/src/plugins/OutlineTree/components/TreeView/style.module.scss.d.ts +16 -0
  162. package/src/plugins/PropertyPanel/style.module.scss.d.ts +10 -0
  163. package/src/plugins/RightPanel/style.module.scss.d.ts +10 -0
  164. package/src/plugins/VisualPanelPlus/index.tsx +3 -19
  165. package/src/plugins/VisualPanelPlus/style.module.scss.d.ts +10 -0
  166. package/src/plugins/index.tsx +3 -1
  167. package/src/style.d.ts +2 -0
  168. package/src/typing.d.ts +5 -0
  169. package/dist/typing.d.ts +0 -4
  170. package/dist/vite-env.d.ts +0 -1
  171. package/public/typing.d.ts +0 -4
  172. package/public/vite-env.d.ts +0 -1
  173. package/src/component/MonacoEditor/index copy.tsx +0 -119
@@ -0,0 +1,5 @@
1
+ import globalClassNames from './style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly engineContainer: 'engineContainer';
4
+ };
5
+ export = classNames;
@@ -3,7 +3,7 @@ import { Button, message, Modal } from 'antd';
3
3
  import React, { useCallback, useEffect, useState } from 'react';
4
4
  import ReactDOM from 'react-dom';
5
5
  import ReactDOMClient from 'react-dom/client';
6
- import Engine, { EnginContext } from '../../..';
6
+ import { Engine, EnginContext } from '../../..';
7
7
  import '../../index.css';
8
8
  import { DEFAULT_PLUGIN_LIST } from '../../../plugins';
9
9
  import { DesignerExports } from '../../../plugins/Designer';
@@ -1,9 +1,9 @@
1
1
  import { waitReactUpdate } from '@/utils';
2
2
  import { formatCSSProperty, StyleArr, styleArr2Obj } from '@/utils/css';
3
3
  import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
4
- import { Card, Collapse, Dropdown, Segmented, Space } from 'antd';
4
+ import { Card, Collapse, Dropdown, Space } from 'antd';
5
5
  import CheckableTag from 'antd/es/tag/CheckableTag';
6
- import { MutableRefObject, Ref, RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
+ import { MutableRefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react';
7
7
  import { CSSPropertiesEditor, CSSPropertiesEditorRef } from '../CSSPropertiesEditor';
8
8
  import styles from './style.module.scss';
9
9
  // state: 'normal' | 'hover' | 'active' | 'focus' | 'first' | 'last' | 'even' | 'odd';
@@ -139,7 +139,6 @@ export const CSSEditor = (props: CSSEditorProps) => {
139
139
 
140
140
  const updateCssVal = useCallback(
141
141
  (mediaKey: string, val: StyleArr) => {
142
- console.log(cssVal, selectedStateTag, mediaKey, val);
143
142
  const newVal = {
144
143
  ...cssVal,
145
144
  [selectedStateTag]: {
@@ -220,7 +219,7 @@ export const CSSEditor = (props: CSSEditorProps) => {
220
219
  marginBottom: '10px',
221
220
  }}
222
221
  >
223
- <Collapse.Panel header={<span className={styles.header}>Normal</span>} key="normal">
222
+ <Collapse.Panel header={<span>Normal</span>} key="normal">
224
223
  <CSSPropertiesEditor
225
224
  ref={(ref) => {
226
225
  cssPropertyRefMap.current['normal'] = ref;
@@ -231,7 +230,7 @@ export const CSSEditor = (props: CSSEditorProps) => {
231
230
  </Collapse.Panel>
232
231
  {mediaQueryList.map((el) => {
233
232
  return (
234
- <Collapse.Panel header={<span className={styles.header}>{el.label}</span>} key={el.key}>
233
+ <Collapse.Panel header={<span>{el.label}</span>} key={el.key}>
235
234
  <CSSPropertiesEditor
236
235
  ref={(ref) => {
237
236
  cssPropertyRefMap.current[el.key] = ref;
@@ -0,0 +1,6 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly stateTag: 'stateTag';
4
+ readonly stateTagClose: 'stateTagClose';
5
+ };
6
+ export = classNames;
@@ -181,11 +181,7 @@ export const SinglePropertyEditor = forwardRef<SinglePropertyEditorRef, SinglePr
181
181
  style={{
182
182
  width: `${keyInputWidth}px`,
183
183
  }}
184
- className={clsx([
185
- styles.cssKeyLabel,
186
- isCreate && styles.inputAuto,
187
- isCreate && focusState.key && styles.active,
188
- ])}
184
+ className={clsx([isCreate && styles.inputAuto, isCreate && focusState.key && styles.active])}
189
185
  onFocus={() => {
190
186
  setFocusState({
191
187
  key: true,
@@ -0,0 +1,15 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly cssFieldBox: 'cssFieldBox';
4
+ readonly 'ant-select-selector': 'ant-select-selector';
5
+ readonly 'ant-select-single': 'ant-select-single';
6
+ readonly 'ant-select-selection-search': 'ant-select-selection-search';
7
+ readonly 'ant-select-status-error': 'ant-select-status-error';
8
+ readonly inputAuto: 'inputAuto';
9
+ readonly active: 'active';
10
+ readonly cssBox: 'cssBox';
11
+ readonly 'ant-collapse-borderless': 'ant-collapse-borderless';
12
+ readonly 'ant-collapse-item': 'ant-collapse-item';
13
+ readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
14
+ };
15
+ export = classNames;
@@ -160,7 +160,7 @@ const SinglePropertyEditor = forwardRef<SinglePropertyEditorRef, SinglePropertyE
160
160
  style={{
161
161
  width: `${keyInputWidth}px`,
162
162
  }}
163
- className={clsx([styles.inputBox, focusState.key && styles.active])}
163
+ className={clsx([styles.inputBox])}
164
164
  onFocus={() => {
165
165
  setFocusState({
166
166
  key: true,
@@ -0,0 +1,15 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly cssFieldBox: 'cssFieldBox';
4
+ readonly 'ant-select-selector': 'ant-select-selector';
5
+ readonly row: 'row';
6
+ readonly fieldLabel: 'fieldLabel';
7
+ readonly leftBox: 'leftBox';
8
+ readonly rightBox: 'rightBox';
9
+ readonly inputBox: 'inputBox';
10
+ readonly cssBox: 'cssBox';
11
+ readonly 'ant-collapse-borderless': 'ant-collapse-borderless';
12
+ readonly 'ant-collapse-item': 'ant-collapse-item';
13
+ readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
14
+ };
15
+ export = classNames;
@@ -0,0 +1,8 @@
1
+ import globalClassNames from '../../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly fieldBox: 'fieldBox';
4
+ readonly label: 'label';
5
+ readonly tipsLabel: 'tipsLabel';
6
+ readonly content: 'content';
7
+ };
8
+ export = classNames;
@@ -0,0 +1,7 @@
1
+ import globalClassNames from '../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly switchBtn: 'switchBtn';
4
+ readonly shapeFieldBox: 'shapeFieldBox';
5
+ readonly collapseHeader: 'collapseHeader';
6
+ };
7
+ export = classNames;
@@ -0,0 +1,7 @@
1
+ import globalClassNames from '../../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly dragItem: 'dragItem';
4
+ readonly sortModalBox: 'sortModalBox';
5
+ readonly addOneBtn: 'addOneBtn';
6
+ };
7
+ export = classNames;
@@ -0,0 +1,6 @@
1
+ import globalClassNames from '../../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly inputAuto: 'inputAuto';
4
+ readonly active: 'active';
5
+ };
6
+ export = classNames;
@@ -0,0 +1,11 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly CFromRenderBox: 'CFromRenderBox';
4
+ readonly 'ant-collapse': 'ant-collapse';
5
+ readonly 'ant-collapse-content': 'ant-collapse-content';
6
+ readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
7
+ readonly 'ant-collapse-item': 'ant-collapse-item';
8
+ readonly 'ant-collapse-header': 'ant-collapse-header';
9
+ readonly 'ant-collapse-expand-icon': 'ant-collapse-expand-icon';
10
+ };
11
+ export = classNames;
@@ -1,49 +1,9 @@
1
- import React, { useEffect } from 'react';
1
+ import { useEffect } from 'react';
2
2
  import * as monaco from 'monaco-editor';
3
3
 
4
- // import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js';
5
- // import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js';
6
- // import 'monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js';
7
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js';
8
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js';
9
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js';
10
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js';
11
- // import 'monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js';
12
-
13
- // import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
14
- // // import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
15
- // // import 'monaco-editor/esm/vs/language/css/monaco.contribution';
16
- // import 'monaco-editor/esm/vs/language/json/monaco.contribution';
17
- // // import 'monaco-editor/esm/vs/language/html/monaco.contribution';
18
- // // import 'monaco-editor/esm/vs/basic-languages/monaco.contribution';
19
- // import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
20
-
21
- import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
22
- import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
23
- // import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
24
- // import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
25
- import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
26
4
  import { useRef } from 'react';
27
5
  import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';
28
6
 
29
- self.MonacoEnvironment = {
30
- getWorker(_, label) {
31
- if (label === 'json') {
32
- return new jsonWorker();
33
- }
34
- // if (label === 'css' || label === 'scss' || label === 'less') {
35
- // return new cssWorker();
36
- // }
37
- // if (label === 'html' || label === 'handlebars' || label === 'razor') {
38
- // return new htmlWorker();
39
- // }
40
- if (label === 'typescript' || label === 'javascript') {
41
- return new tsWorker();
42
- }
43
- return new editorWorker();
44
- },
45
- };
46
-
47
7
  export type MonacoEditorInstance = monacoEditor.editor.IStandaloneCodeEditor;
48
8
 
49
9
  export type MonacoEditorProps = {
@@ -0,0 +1,26 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly workbenchContainer: 'workbenchContainer';
4
+ readonly topToolBarBox: 'topToolBarBox';
5
+ readonly logo: 'logo';
6
+ readonly topToolBarView: 'topToolBarView';
7
+ readonly bodyContent: 'bodyContent';
8
+ readonly leftBox: 'leftBox';
9
+ readonly pluginIconBar: 'pluginIconBar';
10
+ readonly pluginIconItem: 'pluginIconItem';
11
+ readonly active: 'active';
12
+ readonly pluginPanelBoxResizeBox: 'pluginPanelBoxResizeBox';
13
+ readonly pluginHeader: 'pluginHeader';
14
+ readonly pluginNameText: 'pluginNameText';
15
+ readonly closeBtn: 'closeBtn';
16
+ readonly fixedBtn: 'fixedBtn';
17
+ readonly pluginPanelBox: 'pluginPanelBox';
18
+ readonly rightResizeBox: 'rightResizeBox';
19
+ readonly arrowCursor: 'arrowCursor';
20
+ readonly rightBox: 'rightBox';
21
+ readonly centerBox: 'centerBox';
22
+ readonly subTopToolbarBox: 'subTopToolbarBox';
23
+ readonly canvasBox: 'canvasBox';
24
+ readonly scrollBox: 'scrollBox';
25
+ };
26
+ export = classNames;
@@ -1,4 +1,4 @@
1
- import Engine from '@/Engine';
1
+ import { Engine } from '@/index';
2
2
  import { AssetPackage, CPage } from '@chamn/model';
3
3
  import { i18n } from 'i18next';
4
4
  import mitt, { Emitter } from 'mitt';
package/src/index.tsx CHANGED
@@ -21,7 +21,7 @@ export type EngineProps = {
21
21
  onReady?: (ctx: EnginContext) => void;
22
22
  };
23
23
 
24
- class Engine extends React.Component<EngineProps> {
24
+ export class Engine extends React.Component<EngineProps> {
25
25
  currentSelectNode: CNode | CRootNode | null;
26
26
 
27
27
  pluginManager!: PluginManager;
@@ -136,4 +136,7 @@ class Engine extends React.Component<EngineProps> {
136
136
  }
137
137
  }
138
138
 
139
- export default Engine;
139
+ export * as plugins from './plugins';
140
+ export * from '@chamn/layout';
141
+
142
+ export * from './material/innerMaterial';
@@ -0,0 +1,7 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly advanceBox: 'advanceBox';
4
+ readonly 'ant-input-affix-wrapper': 'ant-input-affix-wrapper';
5
+ readonly 'ant-input-prefix': 'ant-input-prefix';
6
+ };
7
+ export = classNames;
@@ -0,0 +1,9 @@
1
+ import globalClassNames from '../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly square: 'square';
4
+ readonly componentItem: 'componentItem';
5
+ readonly iconImg: 'iconImg';
6
+ readonly iconBox: 'iconBox';
7
+ readonly iconText: 'iconText';
8
+ };
9
+ export = classNames;
@@ -30,7 +30,6 @@ export const ListView = (props: ListViewProps) => {
30
30
  id={it.id!}
31
31
  key={it.id!}
32
32
  name={it.title}
33
- containerClassName={styles.itemBox}
34
33
  icon={it.snapshot || it.snapshotText}
35
34
  iconText={it.snapshotText}
36
35
  description={it.description || ''}
@@ -0,0 +1,12 @@
1
+ import globalClassNames from '../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly ListBox: 'ListBox';
4
+ readonly 'ant-collapse': 'ant-collapse';
5
+ readonly 'ant-collapse-content': 'ant-collapse-content';
6
+ readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
7
+ readonly 'ant-collapse-header': 'ant-collapse-header';
8
+ readonly 'ant-collapse-expand-icon': 'ant-collapse-expand-icon';
9
+ readonly 'ant-collapse-item': 'ant-collapse-item';
10
+ readonly collapsePanel: 'collapsePanel';
11
+ };
12
+ export = classNames;
@@ -0,0 +1,11 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly container: 'container';
4
+ readonly 'ant-tabs': 'ant-tabs';
5
+ readonly 'ant-tabs-tab': 'ant-tabs-tab';
6
+ readonly 'ant-tabs-content': 'ant-tabs-content';
7
+ readonly 'ant-tabs-content-top': 'ant-tabs-content-top';
8
+ readonly 'ant-tabs-nav': 'ant-tabs-nav';
9
+ readonly tabTitle: 'tabTitle';
10
+ };
11
+ export = classNames;
@@ -0,0 +1,11 @@
1
+ import globalClassNames from '../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly toolBarBox: 'toolBarBox';
4
+ readonly item: 'item';
5
+ readonly layoutSelectBox: 'layoutSelectBox';
6
+ readonly hoverBox: 'hoverBox';
7
+ readonly hoverBoxActive: 'hoverBoxActive';
8
+ readonly hoverItem: 'hoverItem';
9
+ readonly placeholder: 'placeholder';
10
+ };
11
+ export = classNames;
@@ -0,0 +1,5 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly hoverTips: 'hoverTips';
4
+ };
5
+ export = classNames;
@@ -3,7 +3,7 @@ import { Modal } from 'antd';
3
3
  import { MonacoEditor, MonacoEditorInstance } from '../../component/MonacoEditor';
4
4
  import { CPage } from '@chamn/model';
5
5
  import { waitReactUpdate } from '../../utils';
6
- import { EnginContext } from '../../Engine';
6
+ import { EnginContext } from '../../index';
7
7
  import { DesignerExports } from '../Designer';
8
8
 
9
9
  export type DisplaySourceSchemaProps = {
@@ -0,0 +1,5 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly box: 'box';
4
+ };
5
+ export = classNames;
@@ -0,0 +1,16 @@
1
+ import globalClassNames from '../../../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly contentBox: 'contentBox';
4
+ readonly nodeBox: 'nodeBox';
5
+ readonly toolbarBox: 'toolbarBox';
6
+ readonly iconItem: 'iconItem';
7
+ readonly nodeContent: 'nodeContent';
8
+ readonly selected: 'selected';
9
+ readonly nodeArrow: 'nodeArrow';
10
+ readonly expanded: 'expanded';
11
+ readonly nodeRenderView: 'nodeRenderView';
12
+ readonly nodeChildren: 'nodeChildren';
13
+ readonly dropAnchorLine: 'dropAnchorLine';
14
+ readonly arrowSpan: 'arrowSpan';
15
+ };
16
+ export = classNames;
@@ -0,0 +1,10 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly CFromRenderBox: 'CFromRenderBox';
4
+ readonly 'ant-collapse': 'ant-collapse';
5
+ readonly 'ant-collapse-content': 'ant-collapse-content';
6
+ readonly 'ant-collapse-content-box': 'ant-collapse-content-box';
7
+ readonly 'ant-collapse-item': 'ant-collapse-item';
8
+ readonly 'ant-collapse-header': 'ant-collapse-header';
9
+ };
10
+ export = classNames;
@@ -0,0 +1,10 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly rightPanelContainer: 'rightPanelContainer';
4
+ readonly 'ant-tabs': 'ant-tabs';
5
+ readonly 'ant-tabs-tab': 'ant-tabs-tab';
6
+ readonly 'ant-tabs-content': 'ant-tabs-content';
7
+ readonly 'ant-tabs-content-top': 'ant-tabs-content-top';
8
+ readonly 'ant-tabs-tabpane': 'ant-tabs-tabpane';
9
+ };
10
+ export = classNames;
@@ -54,7 +54,9 @@ export const VisualPanelPlus = (props: { node: CNode | CRootNode; pluginCtx: CPl
54
54
  };
55
55
 
56
56
  const onUpdateCss = (val: CSSVal) => {
57
- node.value.css = formatCssToNodeVal(node.id, val);
57
+ // class name 不能以数字开头,这里使用c_前缀
58
+ node.value.css = formatCssToNodeVal(`c_${node.id}`, val);
59
+ console.log(' node.value.css', node.value.css);
58
60
  node.updateValue();
59
61
  };
60
62
 
@@ -72,24 +74,6 @@ export const VisualPanelPlus = (props: { node: CNode | CRootNode; pluginCtx: CPl
72
74
  }}
73
75
  />
74
76
  </div>
75
- <Collapse
76
- defaultActiveKey={['origin-css-edit']}
77
- bordered={false}
78
- style={{
79
- marginBottom: '10px',
80
- }}
81
- >
82
- <Collapse.Panel header={<span className={styles.header}>Style</span>} key="origin-css-edit">
83
- <CSSPropertiesEditor
84
- key={node.id}
85
- ref={cssPropertyEditorRef}
86
- onValueChange={(val) => {
87
- onUpdateStyle([...val, ...formatStyle.expressionProperty]);
88
- }}
89
- initialValue={formatStyle.normalProperty}
90
- />
91
- </Collapse.Panel>
92
- </Collapse>
93
77
  <Collapse
94
78
  defaultActiveKey={['origin-css-edit']}
95
79
  bordered={false}
@@ -0,0 +1,10 @@
1
+ import globalClassNames from '../../style.d';
2
+ declare const classNames: typeof globalClassNames & {
3
+ readonly visualPanelBox: 'visualPanelBox';
4
+ readonly header: 'header';
5
+ readonly 'ant-collapse': 'ant-collapse';
6
+ readonly 'ant-collapse-item': 'ant-collapse-item';
7
+ readonly 'ant-collapse-header': 'ant-collapse-header';
8
+ readonly 'ant-collapse-expand-icon': 'ant-collapse-expand-icon';
9
+ };
10
+ export = classNames;
@@ -4,6 +4,7 @@ import { DesignerPlugin } from './Designer';
4
4
  import { OutlineTreePlugin } from './OutlineTree';
5
5
  import { RightPanelPlugin } from './RightPanel';
6
6
  import { GlobalStatePanelPlugin } from './GlobalStatePanel';
7
+ import { DisplaySourceSchema } from './DisplaySourceSchema';
7
8
  import { HistoryPlugin } from './History';
8
9
 
9
10
  export const DEFAULT_PLUGIN_LIST: CPlugin[] = [
@@ -15,10 +16,11 @@ export const DEFAULT_PLUGIN_LIST: CPlugin[] = [
15
16
  HistoryPlugin,
16
17
  ];
17
18
 
18
- export default {
19
+ export {
19
20
  DesignerPlugin,
20
21
  ComponentLibPlugin,
21
22
  RightPanelPlugin,
22
23
  GlobalStatePanelPlugin,
23
24
  HistoryPlugin,
25
+ DisplaySourceSchema,
24
26
  };
package/src/style.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const classNames: {};
2
+ export = classNames;
package/src/typing.d.ts CHANGED
@@ -2,3 +2,8 @@ declare module '*.scss' {
2
2
  const content: { [key: string]: any };
3
3
  export = content;
4
4
  }
5
+
6
+ declare module '*.worker?worker' {
7
+ const content: any;
8
+ export = content;
9
+ }
package/dist/typing.d.ts DELETED
@@ -1,4 +0,0 @@
1
- declare module '*.scss' {
2
- const content: { [key: string]: any };
3
- export = content;
4
- }
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,4 +0,0 @@
1
- declare module '*.scss' {
2
- const content: { [key: string]: any };
3
- export = content;
4
- }
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,119 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import * as monaco from 'monaco-editor';
3
-
4
- // import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js';
5
- // import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js';
6
- // import 'monaco-editor/esm/vs/editor/standalone/browser/inspectTokens/inspectTokens.js';
7
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneHelpQuickAccess.js';
8
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js';
9
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js';
10
- // import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js';
11
- // import 'monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch.js';
12
-
13
- // import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
14
- // // import 'monaco-editor/esm/vs/language/typescript/monaco.contribution';
15
- // // import 'monaco-editor/esm/vs/language/css/monaco.contribution';
16
- // import 'monaco-editor/esm/vs/language/json/monaco.contribution';
17
- // // import 'monaco-editor/esm/vs/language/html/monaco.contribution';
18
- // // import 'monaco-editor/esm/vs/basic-languages/monaco.contribution';
19
- // import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
20
-
21
- import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
22
- import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
23
- // import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
24
- // import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
25
- import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
26
- import { useRef } from 'react';
27
- import * as monacoEditor from 'monaco-editor/esm/vs/editor/editor.api';
28
-
29
- self.MonacoEnvironment = {
30
- getWorker(_, label) {
31
- if (label === 'json') {
32
- return new jsonWorker();
33
- }
34
- // if (label === 'css' || label === 'scss' || label === 'less') {
35
- // return new cssWorker();
36
- // }
37
- // if (label === 'html' || label === 'handlebars' || label === 'razor') {
38
- // return new htmlWorker();
39
- // }
40
- if (label === 'typescript' || label === 'javascript') {
41
- return new tsWorker();
42
- }
43
- return new editorWorker();
44
- },
45
- };
46
-
47
- export type MonacoEditorInstance = monacoEditor.editor.IStandaloneCodeEditor;
48
-
49
- export type MonacoEditorProps = {
50
- beforeMount?: (monaco: typeof monacoEditor) => void;
51
- onDidMount?: (editor: MonacoEditorInstance) => void;
52
- options?: monaco.editor.IStandaloneEditorConstructionOptions;
53
- override?: monaco.editor.IEditorOverrideServices;
54
- onChange?: (val: string) => void;
55
- onDidChangeMarkers?: (markers: monaco.editor.IMarker[]) => void;
56
- initialValue?: string;
57
- language?: 'json' | 'javascript' | 'typescript';
58
- };
59
-
60
- export const MonacoEditor = (props: MonacoEditorProps) => {
61
- const editorDomRef = useRef<HTMLDivElement>(null);
62
- const onChangeRef = useRef<MonacoEditorProps['onChange'] | undefined>();
63
- onChangeRef.current = props.onChange;
64
- const onDidChangeMarkersRef = useRef<MonacoEditorProps['onDidChangeMarkers'] | undefined>();
65
- onDidChangeMarkersRef.current = props.onDidChangeMarkers;
66
- const editorInstance = useRef<MonacoEditorInstance | null>(null);
67
-
68
- useEffect(() => {
69
- if (!editorDomRef.current) {
70
- return;
71
- }
72
- props.beforeMount?.(monaco);
73
- const editor = monaco.editor.create(
74
- editorDomRef.current,
75
- {
76
- ...(props.options || {}),
77
- value: props.initialValue || props.options?.value,
78
- language: props.language || props.options?.language,
79
- },
80
- { ...(props.override || {}) }
81
- );
82
-
83
- editorInstance.current = editor;
84
- props.onDidMount?.(editor);
85
- const subscription = editor.getModel()?.onDidChangeContent(() => {
86
- onChangeRef.current?.(editor.getValue());
87
- });
88
-
89
- monaco.editor.onDidChangeMarkers((uris) => {
90
- const editorModel = editor.getModel();
91
- if (!editorModel) {
92
- return;
93
- }
94
- const editorUri = editorModel.uri;
95
- const changeUri = uris.find((el) => el.path === editorUri.path);
96
- if (changeUri) {
97
- const res = monaco.editor.getModelMarkers({
98
- resource: editorUri,
99
- });
100
- onDidChangeMarkersRef.current?.(res);
101
- }
102
- });
103
-
104
- () => {
105
- editor.dispose();
106
- subscription?.dispose();
107
- };
108
- }, []);
109
-
110
- return (
111
- <div
112
- style={{
113
- width: '100%',
114
- height: '100%',
115
- }}
116
- ref={editorDomRef}
117
- ></div>
118
- );
119
- };