1
0
mirror of synced 2026-04-05 07:48:35 +08:00

style(editor): 将节点类型改成枚举

This commit is contained in:
roymondchen
2022-03-30 19:33:54 +08:00
committed by khuntoriia
parent 148d4547b0
commit 6dbda7b565
14 changed files with 67 additions and 43 deletions

View File

@@ -16,7 +16,8 @@
* limitations under the License.
*/
import { MNode } from '@tmagic/schema';
import type { MNode } from '@tmagic/schema';
import { NodeType } from '@tmagic/schema';
import * as editor from '@editor/utils/editor';
@@ -30,12 +31,12 @@ describe('util form', () => {
it('getPageList', () => {
const pageList = editor.getPageList({
id: 'app_1',
type: 'app',
type: NodeType.ROOT,
items: [
{
id: 'page_1',
name: 'index',
type: 'page',
type: NodeType.PAGE,
items: [],
},
],
@@ -49,7 +50,7 @@ describe('util form', () => {
{
id: 'page_1',
name: 'index',
type: 'page',
type: NodeType.PAGE,
items: [],
},
]);
@@ -79,7 +80,7 @@ describe('setNewItemId', () => {
it('items', () => {
const config = {
id: 1,
type: 'page',
type: NodeType.PAGE,
items: [
{
type: 'text',
@@ -95,7 +96,7 @@ describe('setNewItemId', () => {
it('pop', () => {
const config = {
id: 1,
type: 'page',
type: NodeType.PAGE,
items: [
{
type: 'button',
@@ -158,7 +159,7 @@ describe('getNodeIndex', () => {
},
{
id: 2,
type: 'page',
type: NodeType.PAGE,
items: [
{
type: 'text',
@@ -179,7 +180,7 @@ describe('getNodeIndex', () => {
},
{
id: 2,
type: 'page',
type: NodeType.PAGE,
items: [
{
type: 'text',