Skip to content

Commit

Permalink
revert design-core files
Browse files Browse the repository at this point in the history
  • Loading branch information
gene9831 committed May 29, 2024
1 parent 1c66177 commit eb84b03
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 57 deletions.
34 changes: 18 additions & 16 deletions packages/design-core/src/DesignPlugins.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<div>
<span class="item-icon">
<svg-icon
v-if="typeof pluginsMap[item.id].icon === 'string'"
:name="pluginsMap[item.id].icon"
v-if="typeof iconComponents[item.id] === 'string'"
:name="iconComponents[item.id]"
class="panel-icon"
></svg-icon>
<component v-else :is="pluginsMap[item.id].icon" class="panel-icon"></component>
<component v-else :is="iconComponents[item.id]" class="panel-icon"></component>
</span>
</div>
</li>
Expand All @@ -40,12 +40,12 @@
<div :class="{ 'is-show': renderPanel }">
<span class="item-icon">
<public-icon
v-if="typeof pluginsMap[item.id].icon === 'string'"
:name="pluginsMap[item.id].icon"
v-if="typeof iconComponents[item.id] === 'string'"
:name="iconComponents[item.id]"
class="panel-icon"
svgClass="panel-svg"
></public-icon>
<component v-else :is="pluginsMap[item.id].icon" class="panel-icon"></component>
<component v-else :is="iconComponents[item.id]" class="panel-icon"></component>
</span>
</div>
</li>
Expand All @@ -66,17 +66,16 @@
</div>

<div
v-show="pluginsMap[renderPanel]?.component"
v-show="renderPanel && components[renderPanel]"
id="tiny-engine-left-panel"
:class="[renderPanel, { 'is-fixed': pluginsState.fixedPanels.includes(renderPanel) }]"
>
<div class="left-panel-wrap">
<keep-alive>
<component
:is="pluginsMap[renderPanel]?.component"
:is="components[renderPanel]"
ref="pluginRef"
:fixed-panels="pluginsState.fixedPanels"
:options="pluginsMap[renderPanel]?.options"
@close="close"
@fixPanel="fixPanel"
></component>
Expand Down Expand Up @@ -114,7 +113,8 @@ export default {
emits: ['click', 'node-click'],
setup(props, { emit }) {
const plugins = getMergeRegistry('plugins')
const pluginsMap = {}
const components = {}
const iconComponents = {}
const pluginRef = ref(null)
const robotVisible = ref(false)
const robotComponent = ref(null)
Expand All @@ -127,11 +127,12 @@ export default {
layoutState: { plugins: pluginsState }
} = useLayout()
plugins.forEach(({ id, ...rest }) => {
pluginsMap[id] = rest
if (rest.api) {
plugins.forEach(({ id, component, api, icon }) => {
components[id] = component
iconComponents[id] = icon
if (api) {
registerPluginApi({
[id]: rest.api
[id]: api
})
}
})
Expand Down Expand Up @@ -185,7 +186,7 @@ export default {
})
const openAIRobot = () => {
robotComponent.value = pluginsMap[PLUGIN_NAME.Robot].component
robotComponent.value = components[PLUGIN_NAME.Robot]
robotVisible.value = !robotVisible.value
}
const close = () => {
Expand All @@ -209,7 +210,8 @@ export default {
close,
fixPanel,
pluginsState,
pluginsMap,
components,
iconComponents,
completed,
doCompleted,
pluginState
Expand Down
2 changes: 1 addition & 1 deletion packages/design-core/src/DesignSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="tiny-right-panel">
<tiny-tabs v-model="layoutState.settings.render" tab-style="button-card">
<tiny-tab-item v-for="(setting, index) in settings" :key="index" :title="setting.title" :name="setting.name">
<component :is="setting.component" :options="setting.options"></component>
<component :is="setting.component"></component>
<div v-show="activating" class="active"></div>
</tiny-tab-item>
</tiny-tabs>
Expand Down
6 changes: 3 additions & 3 deletions packages/design-core/src/DesignToolbars.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div class="tiny-engine-toolbar">
<div class="toolbar-left">
<component :is="item.component" v-for="item in leftBar" :key="item.id" :options="item.options"></component>
<component :is="item.component" v-for="item in leftBar" :key="item.id"></component>
</div>
<div class="toolbar-center">
<component :is="item.component" v-for="item in centerBar" :key="item.id" :options="item.options"></component>
<component :is="item.component" v-for="item in centerBar" :key="item.id"></component>
</div>
<div class="toolbar-right">
<component :is="item.component" v-for="item in rightBar" :key="item.id" :options="item.options"></component>
<component :is="item.component" v-for="item in rightBar" :key="item.id"></component>
</div>
</div>
<div class="progress">
Expand Down
37 changes: 0 additions & 37 deletions packages/entry/registry-demo.md

This file was deleted.

0 comments on commit eb84b03

Please sign in to comment.