1
0
mirror of synced 2026-03-22 18:48:34 +08:00

refactor: 将data-source,dep,schema,utils收敛到core,将form,table,stage,design,util收敛到editor

This commit is contained in:
roymondchen
2024-09-04 17:25:33 +08:00
committed by roymondchen
parent c3bc1035ad
commit 34fc0a15b9
212 changed files with 634 additions and 778 deletions

View File

@@ -18,7 +18,7 @@
import { describe, expect, test, vi } from 'vitest';
import { mount } from '@vue/test-utils';
import { NodeType } from '@tmagic/schema';
import { NodeType } from '@tmagic/core';
import Stage from '@editor/layouts/workspace/viewer/Stage.vue';

View File

@@ -19,15 +19,15 @@
import { beforeAll, describe, expect, test } from 'vitest';
import { cloneDeep } from 'lodash-es';
import type { MApp } from '@tmagic/schema';
import { NodeType } from '@tmagic/schema';
import type { MApp } from '@tmagic/core';
import { NodeType } from '@tmagic/core';
import editorService from '@editor/services/editor';
import historyService from '@editor/services/history';
import storageService from '@editor/services/storage';
import { COPY_STORAGE_KEY, setConfig } from '@editor/utils';
import { COPY_STORAGE_KEY, setEditorConfig } from '@editor/utils';
setConfig({
setEditorConfig({
// eslint-disable-next-line no-eval
parseDSL: (dsl: string) => eval(dsl),
});

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from 'vitest';
import { NodeType } from '@tmagic/schema';
import { NodeType } from '@tmagic/core';
import props from '@editor/services/props';

View File

@@ -17,7 +17,7 @@
*/
import { describe, expect, test } from 'vitest';
import { NodeType } from '@tmagic/schema';
import { NodeType } from '@tmagic/core';
import * as editor from '@editor/utils/editor';
@@ -60,40 +60,6 @@ describe('util form', () => {
});
});
describe('isFixed', () => {
test('true', () => {
expect(
editor.isFixed({
type: 'text',
id: 1,
style: {
position: 'fixed',
},
}),
).toBeTruthy();
});
test('false', () => {
expect(
editor.isFixed({
type: 'text',
id: 1,
style: {
position: 'absolute',
},
}),
).toBeFalsy();
expect(
editor.isFixed({
type: 'text',
id: 1,
style: {},
}),
).toBeFalsy();
});
});
describe('getNodeIndex', () => {
test('能获取到', () => {
const index = editor.getNodeIndex(1, {