@tmagic/editor 1.4.4 → 1.4.6

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 (52) hide show
  1. package/dist/style.css +2 -2
  2. package/dist/tmagic-editor.js +2393 -2242
  3. package/dist/tmagic-editor.umd.cjs +2403 -2248
  4. package/package.json +27 -27
  5. package/src/editorProps.ts +5 -1
  6. package/src/fields/DataSourceFieldSelect.vue +3 -41
  7. package/src/fields/EventSelect.vue +30 -9
  8. package/src/hooks/use-code-block-edit.ts +0 -2
  9. package/src/hooks/use-stage.ts +1 -1
  10. package/src/index.ts +1 -0
  11. package/src/initService.ts +12 -2
  12. package/src/layouts/workspace/viewer/Stage.vue +7 -6
  13. package/src/services/codeBlock.ts +77 -9
  14. package/src/services/dataSource.ts +53 -4
  15. package/src/services/editor.ts +2 -2
  16. package/src/services/props.ts +10 -5
  17. package/src/services/stageOverlay.ts +1 -0
  18. package/src/type.ts +1 -0
  19. package/src/utils/content-menu.ts +7 -3
  20. package/src/utils/data-source/index.ts +39 -3
  21. package/src/utils/editor.ts +16 -7
  22. package/types/components/CodeBlockEditor.vue.d.ts +21 -34
  23. package/types/components/CodeParams.vue.d.ts +2 -2
  24. package/types/components/ContentMenu.vue.d.ts +1 -1
  25. package/types/components/FloatingBox.vue.d.ts +41 -38
  26. package/types/components/ScrollViewer.vue.d.ts +1 -1
  27. package/types/components/ToolButton.vue.d.ts +4 -4
  28. package/types/components/Tree.vue.d.ts +2 -2
  29. package/types/editorProps.d.ts +5 -1
  30. package/types/fields/CodeLink.vue.d.ts +2 -2
  31. package/types/fields/DataSourceFields.vue.d.ts +32 -78
  32. package/types/fields/DataSourceInput.vue.d.ts +2 -2
  33. package/types/fields/DataSourceMethods.vue.d.ts +2 -2
  34. package/types/fields/DataSourceMocks.vue.d.ts +31 -76
  35. package/types/fields/KeyValue.vue.d.ts +2 -2
  36. package/types/fields/UISelect.vue.d.ts +2 -2
  37. package/types/hooks/use-code-block-edit.d.ts +18 -6
  38. package/types/hooks/use-data-source-edit.d.ts +18 -6
  39. package/types/hooks/use-data-source-method.d.ts +18 -6
  40. package/types/index.d.ts +1 -0
  41. package/types/layouts/CodeEditor.vue.d.ts +1 -1
  42. package/types/layouts/PropsPanel.vue.d.ts +14 -14
  43. package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +20 -30
  44. package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +6 -6
  45. package/types/layouts/workspace/viewer/Stage.vue.d.ts +4 -4
  46. package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +6 -6
  47. package/types/services/codeBlock.d.ts +22 -2
  48. package/types/services/dataSource.d.ts +13 -1
  49. package/types/services/ui.d.ts +1 -1
  50. package/types/type.d.ts +1 -0
  51. package/types/utils/data-source/index.d.ts +3 -2
  52. package/types/utils/editor.d.ts +2 -0
@@ -1,8 +1,9 @@
1
- import { FormConfig } from '@tmagic/form';
2
- import { DataSourceSchema } from '@tmagic/schema';
1
+ import { CascaderOption, FormConfig } from '@tmagic/form';
2
+ import { DataSchema, DataSourceFieldType, DataSourceSchema } from '@tmagic/schema';
3
3
  export declare const getFormConfig: (type: string, configs: Record<string, FormConfig>) => FormConfig;
4
4
  export declare const getFormValue: (type: string, values: Partial<DataSourceSchema>) => Partial<DataSourceSchema>;
5
5
  export declare const getDisplayField: (dataSources: DataSourceSchema[], key: string) => {
6
6
  value: string;
7
7
  type: 'var' | 'text';
8
8
  }[];
9
+ export declare const getCascaderOptionsFromFields: (fields?: DataSchema[], dataSourceFieldType?: DataSourceFieldType[]) => CascaderOption[];
@@ -3,6 +3,8 @@ import { NodeType } from '@tmagic/schema';
3
3
  import type StageCore from '@tmagic/stage';
4
4
  import { Layout } from '../type';
5
5
  export declare const COPY_STORAGE_KEY = "$MagicEditorCopyData";
6
+ export declare const COPY_CODE_STORAGE_KEY = "$MagicEditorCopyCode";
7
+ export declare const COPY_DS_STORAGE_KEY = "$MagicEditorCopyDataSource";
6
8
  /**
7
9
  * 获取所有页面配置
8
10
  * @param root DSL跟节点