@tmagic/editor 1.3.0-beta.0 → 1.3.0-beta.2

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 (46) hide show
  1. package/dist/style.css +30 -2
  2. package/dist/tmagic-editor.js +1053 -647
  3. package/dist/tmagic-editor.js.map +1 -1
  4. package/dist/tmagic-editor.umd.cjs +1071 -665
  5. package/dist/tmagic-editor.umd.cjs.map +1 -1
  6. package/package.json +10 -10
  7. package/src/components/CodeBlockEditor.vue +15 -6
  8. package/src/components/ContentMenu.vue +88 -42
  9. package/src/components/Resizer.vue +8 -30
  10. package/src/components/SplitView.vue +3 -2
  11. package/src/components/ToolButton.vue +1 -1
  12. package/src/fields/DataSourceFields.vue +10 -0
  13. package/src/fields/DataSourceMethods.vue +1 -0
  14. package/src/fields/EventSelect.vue +15 -3
  15. package/src/hooks/use-getso.ts +35 -0
  16. package/src/icons/PinIcon.vue +25 -0
  17. package/src/icons/PinnedIcon.vue +25 -0
  18. package/src/index.ts +2 -0
  19. package/src/layouts/workspace/Workspace.vue +1 -1
  20. package/src/layouts/workspace/viewer/NodeListMenu.vue +166 -0
  21. package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +68 -0
  22. package/src/layouts/workspace/{Stage.vue → viewer/Stage.vue} +2 -0
  23. package/src/layouts/workspace/{ViewerMenu.vue → viewer/ViewerMenu.vue} +1 -1
  24. package/src/services/dataSource.ts +11 -0
  25. package/src/theme/content-menu.scss +29 -3
  26. package/src/theme/index.scss +8 -0
  27. package/src/type.ts +3 -0
  28. package/src/utils/data-source/formConfigs/http.ts +9 -0
  29. package/src/utils/data-source/index.ts +12 -0
  30. package/src/utils/props.ts +21 -10
  31. package/types/components/CodeBlockEditor.vue.d.ts +2 -0
  32. package/types/components/ContentMenu.vue.d.ts +27 -8
  33. package/types/components/Resizer.vue.d.ts +1 -3
  34. package/types/hooks/use-code-block-edit.d.ts +7 -0
  35. package/types/hooks/use-data-source-method.d.ts +7 -0
  36. package/types/hooks/use-getso.d.ts +5 -0
  37. package/types/icons/PinIcon.vue.d.ts +2 -0
  38. package/types/icons/PinnedIcon.vue.d.ts +2 -0
  39. package/types/index.d.ts +1 -0
  40. package/types/layouts/PropsPanel.vue.d.ts +1 -1
  41. package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +15 -0
  42. package/types/layouts/workspace/viewer/NodeListMenuTitle.vue.d.ts +15 -0
  43. package/types/layouts/workspace/{Stage.vue.d.ts → viewer/Stage.vue.d.ts} +1 -1
  44. package/types/layouts/workspace/{ViewerMenu.vue.d.ts → viewer/ViewerMenu.vue.d.ts} +1 -1
  45. package/types/services/dataSource.d.ts +4 -0
  46. package/types/type.d.ts +3 -0
@@ -0,0 +1,15 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
+ pinned: boolean;
3
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ pinned: boolean;
5
+ }>>>, {}, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToRuntimeProps<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -1,4 +1,4 @@
1
- import { MenuButton, MenuComponent } from '../../type';
1
+ import { MenuButton, MenuComponent } from '../../../type';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
3
  stageContentMenu: (MenuButton | MenuComponent)[];
4
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
@@ -1,4 +1,4 @@
1
- import { MenuButton, MenuComponent } from '../../type';
1
+ import { MenuButton, MenuComponent } from '../../../type';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  isMultiSelect?: boolean | undefined;
4
4
  stageContentMenu: (MenuButton | MenuComponent)[];
@@ -1,3 +1,4 @@
1
+ import type { EventOption } from '@tmagic/core';
1
2
  import type { FormConfig } from '@tmagic/form';
2
3
  import type { DataSourceSchema } from '@tmagic/schema';
3
4
  import type { DatasourceTypeOption } from '../type';
@@ -8,6 +9,7 @@ interface State {
8
9
  editable: boolean;
9
10
  configs: Record<string, FormConfig>;
10
11
  values: Record<string, Partial<DataSourceSchema>>;
12
+ events: Record<string, EventOption[]>;
11
13
  }
12
14
  type StateKey = keyof State;
13
15
  declare class DataSource extends BaseService {
@@ -18,6 +20,8 @@ declare class DataSource extends BaseService {
18
20
  setFormConfig(type: string, config: FormConfig): void;
19
21
  getFormValue(type?: string): Partial<DataSourceSchema>;
20
22
  setFormValue(type: string, value: Partial<DataSourceSchema>): void;
23
+ getFormEvent(type?: string): EventOption[];
24
+ setFormEvent(type: string, value?: EventOption[]): void;
21
25
  add(config: DataSourceSchema): void;
22
26
  update(config: DataSourceSchema): void;
23
27
  remove(id: string): void;
package/types/type.d.ts CHANGED
@@ -159,6 +159,8 @@ export interface MenuButton {
159
159
  className?: string;
160
160
  /** type为dropdown时,下拉的菜单列表, 或者有子菜单时 */
161
161
  items?: MenuButton[];
162
+ /** 唯一标识,用于高亮 */
163
+ id?: string | number;
162
164
  }
163
165
  export interface MenuComponent {
164
166
  type: 'component';
@@ -333,6 +335,7 @@ export interface HistoryState {
333
335
  export interface EventSelectConfig {
334
336
  name: string;
335
337
  type: 'event-select';
338
+ src: 'datasource' | 'component';
336
339
  /** 事件名称表单配置 */
337
340
  eventNameConfig?: FormItem;
338
341
  /** 动作类型配置 */