Skip to content

Commit

Permalink
feat(toolbar): 修改公共toolbar组件名称,并移到common目录下
Browse files Browse the repository at this point in the history
  • Loading branch information
betterdancing committed Sep 29, 2024
1 parent c9d46de commit acd0934
Show file tree
Hide file tree
Showing 35 changed files with 78 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

<script>
import { reactive, computed } from 'vue'
import ToolbarIcon from './toolbar-built-in/ToolbarIcon.vue'
import ToolbarButton from './toolbar-built-in/ToolbarButton.vue'
import ToolbarBaseIcon from './toolbar-built-in/ToolbarBaseIcon.vue'
import ToolbarBaseButton from './toolbar-built-in/ToolbarBaseButton.vue'
export default {
components: {
ToolbarIcon,
ToolbarButton
ToolbarBaseIcon,
ToolbarBaseButton
},
props: {
icon: {
Expand Down Expand Up @@ -49,9 +49,9 @@ export default {
const getRender = () => {
switch (props.options.renderType) {
case 'button':
return ToolbarButton
return ToolbarBaseButton
case 'icon':
return ToolbarIcon
return ToolbarBaseIcon
default:
return false
}
Expand Down
1 change: 1 addition & 0 deletions packages/common/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export { default as SplitPanes } from './SplitPanes.vue'
export { default as Pane } from './Pane.vue'
export { default as I18nInput } from './I18nInput.vue'
export { default as CanvasDragItem } from './CanvasDragItem.vue'
export { default as ToolbarBase } from './ToolbarBase.vue'
export { default as Modal } from './Modal.jsx'
export { default as Notify } from './Notify.jsx'
export { ConfigGroup, ConfigItem }
Expand Down
2 changes: 1 addition & 1 deletion packages/design-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export { default as Robot } from '@opentiny/tiny-engine-plugin-robot'
export { default as Props, PropertiesService, PropertyService } from '@opentiny/tiny-engine-setting-props'
export { default as Events } from '@opentiny/tiny-engine-setting-events'
export { default as Styles } from '@opentiny/tiny-engine-setting-styles'
export { default as Layout, ToolbarBaseComponent, LayoutService } from '@opentiny/tiny-engine-layout'
export { default as Layout, LayoutService } from '@opentiny/tiny-engine-layout'
export { default as Canvas } from '@opentiny/tiny-engine-canvas'
export { initPreview } from './src/preview/src/main'
export { GenerateCodeService, PluginPanel } from '@opentiny/tiny-engine-common'
Expand Down
3 changes: 1 addition & 2 deletions packages/layout/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import component from './src/Main.vue'
import metaData from './meta'
import ToolbarBaseComponent from './src/ToolbarBaseComponent.vue'
import { LayoutService } from './src/composable'
import designSmbConfig from '@opentiny/vue-design-smb'
import { ConfigProvider as TinyConfigProvider } from '@opentiny/vue'
Expand Down Expand Up @@ -31,4 +30,4 @@ export default {
metas: [LayoutService]
}

export { ToolbarBaseComponent, LayoutService }
export { LayoutService }
2 changes: 1 addition & 1 deletion packages/layout/src/DesignToolbars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="toolbar-right-content">
<div class="toolbar-right-item" v-for="(item, idx) in state.rightBar" :key="idx">
<div v-if="typeof item === 'string'">
<component :is="getMergeMeta(item)?.entry" :options="getMergeMeta(comp)?.options"></component>
<component :is="getMergeMeta(item)?.entry" :options="getMergeMeta(item)?.options"></component>
</div>
<div class="toolbar-right-item-arr" v-if="Array.isArray(item)">
<div class="toolbar-right-item-comp" v-for="comp in item" :key="comp">
Expand Down
3 changes: 1 addition & 2 deletions packages/toolbars/breadcrumb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-utils": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/toolbars/breadcrumb/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<toolbar-base-component :options="options">
<toolbar-base :options="options">
<template #default>
<div class="top-panel-breadcrumb">
<div
Expand All @@ -26,14 +26,14 @@
</div>
<block-deploy-dialog v-model:visible="state.showDeployBlock" :nextVersion="nextVersion"></block-deploy-dialog>
</template>
</toolbar-base-component>
</toolbar-base>
</template>

<script>
import { reactive, computed } from 'vue'
import { Breadcrumb, BreadcrumbItem, Button } from '@opentiny/vue'
import { useBreadcrumb, useLayout } from '@opentiny/tiny-engine-meta-register'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
import { BlockDeployDialog } from '@opentiny/tiny-engine-common'
export default {
Expand All @@ -42,7 +42,7 @@ export default {
TinyBreadcrumbItem: BreadcrumbItem,
BlockDeployDialog,
TinyButton: Button,
ToolbarBaseComponent
ToolbarBase
},
props: {
options: {
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbars/clean/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dependencies": {
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-common": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
7 changes: 3 additions & 4 deletions packages/toolbars/clean/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<div class="toolbar-itm-clean">
<toolbar-base-component content="清除屏幕" :icon="options.icon.default" :options="options" @click-api="clean">
</toolbar-base-component>
<toolbar-base content="清除屏幕" :icon="options.icon.default" :options="options" @click-api="clean"> </toolbar-base>
</div>
</template>

Expand All @@ -10,12 +9,12 @@ import { ref, watch, getCurrentInstance } from 'vue'
import { Modal } from '@opentiny/vue'
import { useCanvas, useLayout } from '@opentiny/tiny-engine-meta-register'
import { constants } from '@opentiny/tiny-engine-utils'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
const { PAGE_STATUS } = constants
export default {
components: {
ToolbarBaseComponent
ToolbarBase
},
props: {
options: {
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbars/collaboration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-common": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/toolbars/collaboration/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<toolbar-base-component :options="options">
<toolbar-base :options="options">
<template #default>
<span class="collaboration-container">
<tiny-popover
Expand Down Expand Up @@ -43,19 +43,19 @@
</tiny-popover>
</span>
</template>
</toolbar-base-component>
</toolbar-base>
</template>

<script>
import { reactive, watchEffect } from 'vue'
import { Popover } from '@opentiny/vue'
import { useLayout } from '@opentiny/tiny-engine-meta-register'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
export default {
components: {
TinyPopover: Popover,
ToolbarBaseComponent
ToolbarBase
},
props: {
options: {
Expand Down
3 changes: 1 addition & 2 deletions packages/toolbars/fullscreen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"license": "MIT",
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-common": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/toolbars/fullscreen/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<template>
<toolbar-base-component
<toolbar-base
:content="!isFullscreen ? '全屏' : '退出全屏'"
:icon="iconName"
:options="options"
@click-api="fullscreen"
>
</toolbar-base-component>
</toolbar-base>
</template>

<script>
import { ref } from 'vue'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
export default {
components: {
ToolbarBaseComponent
ToolbarBase
},
props: {
options: {
Expand Down
3 changes: 1 addition & 2 deletions packages/toolbars/generate-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-utils": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/toolbars/generate-code/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<toolbar-base-component content="出码" :icon="options.icon.default" :options="options" @click-api="generate">
<toolbar-base content="出码" :icon="options.icon.default" :options="options" @click-api="generate">
<template #default>
<generate-file-selector
:visible="state.showDialogbox"
Expand All @@ -8,7 +8,7 @@
@cancel="cancel"
></generate-file-selector>
</template>
</toolbar-base-component>
</toolbar-base>
</template>

<script>
Expand All @@ -25,14 +25,14 @@ import {
} from '@opentiny/tiny-engine-meta-register'
import { fs } from '@opentiny/tiny-engine-utils'
import { useHttp } from '@opentiny/tiny-engine-http'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
import { fetchMetaData, fetchPageList, fetchBlockSchema } from './http'
import FileSelector from './FileSelector.vue'
export default {
components: {
GenerateFileSelector: FileSelector,
ToolbarBaseComponent
ToolbarBase
},
props: {
options: {
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbars/lang/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@vueuse/core": "^9.6.0"
},
"devDependencies": {
Expand Down
13 changes: 4 additions & 9 deletions packages/toolbars/lang/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
<template>
<toolbar-base-component
content="画布中英文切换"
:icon="options.icon[langVal]"
:options="options"
@click-api="changeLang"
>
</toolbar-base-component>
<toolbar-base content="画布中英文切换" :icon="options.icon[langVal]" :options="options" @click-api="changeLang">
</toolbar-base>
</template>

<script>
import { ref, watch } from 'vue'
import { useBroadcastChannel } from '@vueuse/core'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
import { constants } from '@opentiny/tiny-engine-utils'
const { BROADCAST_CHANNEL } = constants
export default {
components: {
ToolbarBaseComponent
ToolbarBase
},
props: {
langChannel: {
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbars/lock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-common": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/toolbars/lock/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<toolbar-base-component
<toolbar-base
v-if="!state.isGuest"
:icon="iconName"
:content="statusMessageMap[state.status]?.nextOptName"
:options="options"
@click-api="lockOrUnlock"
>
</toolbar-base-component>
</toolbar-base>
</template>

<script>
import { computed, reactive } from 'vue'
import { useCanvas, useLayout, useBlock, useNotify } from '@opentiny/tiny-engine-meta-register'
import { constants } from '@opentiny/tiny-engine-utils'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
import { requestBlockPage } from './http'
const { COMPONENT_NAME, PAGE_STATUS } = constants
Expand Down Expand Up @@ -43,7 +43,7 @@ const statusMessageMap = {
export default {
components: {
ToolbarBaseComponent
ToolbarBase
},
props: {
options: {
Expand Down
3 changes: 1 addition & 2 deletions packages/toolbars/logo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"dependencies": {
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-meta-register": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/toolbars/logo/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<toolbar-base-component :options="options">
<toolbar-base :options="options">
<template #default>
<div class="top-panel-logo">
<h1 class="logo-wrap" @click.stop="handleTitleClick">
Expand Down Expand Up @@ -98,7 +98,7 @@
</tiny-dialog-box>
</div>
</template>
</toolbar-base-component>
</toolbar-base>
</template>

<script setup>
Expand All @@ -117,7 +117,7 @@ import { iconHelpCircle } from '@opentiny/vue-icon'
import { useLayout, useApp, useModal } from '@opentiny/tiny-engine-meta-register'
import { getMergeMeta } from '@opentiny/tiny-engine-meta-register'
import { useHttp } from '@opentiny/tiny-engine-http'
import { ToolbarBaseComponent } from '@opentiny/tiny-engine-layout'
import { ToolbarBase } from '@opentiny/tiny-engine-common'
import { isDevelopEnv } from '@opentiny/tiny-engine-common/js/environments'
defineProps({
Expand Down
2 changes: 1 addition & 1 deletion packages/toolbars/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {
"@opentiny/tiny-engine-meta-register": "workspace:*",
"@opentiny/tiny-engine-layout": "workspace:*"
"@opentiny/tiny-engine-common": "workspace:*"
},
"devDependencies": {
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
Expand Down
Loading

0 comments on commit acd0934

Please sign in to comment.