chore(editor): 将hooks放到同一个文件夹中

This commit is contained in:
roymondchen 2023-08-09 19:22:42 +08:00
parent a8f8f488ad
commit d8a2a1f805
11 changed files with 29 additions and 10 deletions

View File

@ -43,8 +43,8 @@ import type { Id } from '@tmagic/schema';
import CodeBlockEditor from '@editor/components/CodeBlockEditor.vue';
import CodeParams from '@editor/components/CodeParams.vue';
import Icon from '@editor/components/Icon.vue';
import { useCodeBlockEdit } from '@editor/hooks/use-code-block-edit';
import type { CodeParamStatement, CodeSelectColConfig, Services } from '@editor/type';
import { useCodeBlockEdit } from '@editor/utils/use-code-block-edit';
defineOptions({
name: 'MEditorCodeSelectCol',

View File

@ -40,8 +40,8 @@ import type { CodeBlockContent, Id } from '@tmagic/schema';
import CodeBlockEditor from '@editor/components/CodeBlockEditor.vue';
import CodeParams from '@editor/components/CodeParams.vue';
import Icon from '@editor/components/Icon.vue';
import { useDataSourceMethod } from '@editor/hooks/use-data-source-method';
import type { CodeParamStatement, DataSourceMethodSelectConfig, Services } from '@editor/type';
import { useDataSourceMethod } from '@editor/utils/use-data-source-method';
defineOptions({
name: 'MEditorDataSourceMethodSelect',

View File

@ -25,8 +25,8 @@ import type { CodeBlockContent } from '@tmagic/schema';
import { MagicTable } from '@tmagic/table';
import CodeBlockEditor from '@editor/components/CodeBlockEditor.vue';
import { useDataSourceMethod } from '@editor/hooks/use-data-source-method';
import type { CodeParamStatement } from '@editor/type';
import { useDataSourceMethod } from '@editor/utils/use-data-source-method';
defineOptions({
name: 'MEditorDataSourceMethods',

View File

@ -0,0 +1,21 @@
/*
* Tencent is pleased to support the open source community by making TMagicEditor available.
*
* Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './use-code-block-edit';
export * from './use-data-source-method';
export * from './use-stage';

View File

@ -5,8 +5,7 @@ import { tMagicMessage } from '@tmagic/design';
import type { CodeBlockContent, DataSourceSchema } from '@tmagic/schema';
import CodeBlockEditor from '@editor/components/CodeBlockEditor.vue';
import { getConfig } from './config';
import { getConfig } from '@editor/utils/config';
export const useDataSourceMethod = () => {
const codeConfig = ref<CodeBlockContent>();

View File

@ -6,8 +6,7 @@ import StageCore, { GuidesType, RemoveEventData, SortEventData, UpdateEventData
import editorService from '@editor/services/editor';
import uiService from '@editor/services/ui';
import { H_GUIDE_LINE_STORAGE_KEY, StageOptions, V_GUIDE_LINE_STORAGE_KEY } from '@editor/type';
import { getGuideLineFromCache } from './editor';
import { getGuideLineFromCache } from '@editor/utils/editor';
const root = computed(() => editorService.get('root'));
const page = computed(() => editorService.get('page'));

View File

@ -39,6 +39,7 @@ import './theme/index.scss';
export type { MoveableOptions } from '@tmagic/stage';
export * from './type';
export * from './hooks';
export * from './utils';
export { default as TMagicEditor } from './Editor.vue';
export { default as TMagicCodeEditor } from './layouts/CodeEditor.vue';

View File

@ -35,8 +35,8 @@ import type { Id } from '@tmagic/schema';
import CodeBlockEditor from '@editor/components/CodeBlockEditor.vue';
import SearchInput from '@editor/components/SearchInput.vue';
import { useCodeBlockEdit } from '@editor/hooks/use-code-block-edit';
import type { CodeDeleteErrorType, Services } from '@editor/type';
import { useCodeBlockEdit } from '@editor/utils/use-code-block-edit';
import CodeBlockList from './CodeBlockList.vue';

View File

@ -36,9 +36,9 @@ import type { MContainer } from '@tmagic/schema';
import StageCore, { calcValueByFontsize, getOffset, Runtime } from '@tmagic/stage';
import ScrollViewer from '@editor/components/ScrollViewer.vue';
import { useStage } from '@editor/hooks/use-stage';
import { Layout, MenuButton, MenuComponent, Services, StageOptions } from '@editor/type';
import { getConfig } from '@editor/utils/config';
import { useStage } from '@editor/utils/stage';
import ViewerMenu from './ViewerMenu.vue';

View File

@ -20,5 +20,4 @@ export * from './config';
export * from './props';
export * from './logger';
export * from './editor';
export * from './stage';
export * from './operator';