feat(plugins): add meta.js for plugins and replace all hard-coding plugin id (#506)

* feat(plugins): add meta.js for plugins

* feat(plugins): add generateComment vite plugin for tiny-engine plugins

* feat(plugins): remove metaService comments

* add i18n plugin metaService comment
This commit is contained in:
Gene 2024-05-25 01:18:17 -07:00 committed by GitHub
parent 491bda71c5
commit 9f53dc65fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
57 changed files with 303 additions and 206 deletions

View File

@ -117,7 +117,8 @@ export default {
emit('bind', { ...data, key })
}
const activeI18n = () => useLayout().activePlugin('I18n')
const { PLUGIN_NAME, activePlugin } = useLayout()
const activeI18n = () => activePlugin(PLUGIN_NAME.I18n)
const addBindI18n = () => {
useTranslate().ensureI18n(editForm, true)

View File

@ -16,13 +16,20 @@ import { constants } from '@opentiny/tiny-engine-utils'
const { PAGE_STATUS } = constants
const PLUGIN_NAME = {
Materials: 'Materials',
AppManage: 'AppManage',
BlockManage: 'BlockManage',
PageController: 'PageController',
Materials: 'engine.plugins.materials',
AppManage: 'engine.plugins.appmanage',
BlockManage: 'engine.plugins.blockmanage',
Bridge: 'engine.plugins.bridge',
DataSource: 'engine.plugins.datasource',
Collections: 'engine.plugins.collections',
EditorHelp: 'engine.plugins.editorhelp',
I18n: 'engine.plugins.i18n',
Robot: 'engine.plugins.robot',
Schema: 'engine.plugins.schema',
PageController: 'engine.plugins.pagecontroller',
OutlineTree: 'engine.plugins.outlinetree',
Tutorial: 'engine.plugins.tutorial',
Lock: 'Lock',
Tutorial: 'Tutorial',
OutlineTree: 'OutlineTree',
save: 'save'
}

View File

@ -119,9 +119,9 @@ export default {
const robotVisible = ref(false)
const robotComponent = ref(null)
const { isTemporaryPage } = usePage()
const HELP_PLUGIN_ID = 'EditorHelp'
const {
PLUGIN_NAME,
pluginState,
registerPluginApi,
layoutState: { plugins: pluginsState }
@ -154,7 +154,7 @@ export default {
}
const clickMenu = ({ item, index }) => {
if (item.id === HELP_PLUGIN_ID) return
if (item.id === PLUGIN_NAME.EditorHelp) return
state.prevIdex = index
//
@ -177,8 +177,8 @@ export default {
}
watch(isTemporaryPage, () => {
if (isTemporaryPage.saved) {
const pagePanel = state.topNavLists?.find((item) => item.id === 'AppManage') || null
const pageIndex = state.topNavLists?.findIndex((item) => item.id === 'AppManage') || -1
const pagePanel = state.topNavLists?.find((item) => item.id === PLUGIN_NAME.AppManage) || null
const pageIndex = state.topNavLists?.findIndex((item) => item.id === PLUGIN_NAME.AppManage) || -1
if (pagePanel !== props.renderPanel) {
clickMenu({ item: pagePanel, index: pageIndex })
}
@ -186,7 +186,7 @@ export default {
})
const openAIRobot = () => {
robotComponent.value = components.Robot
robotComponent.value = components[PLUGIN_NAME.Robot]
robotVisible.value = !robotVisible.value
}
const close = () => {

View File

@ -1,22 +1,20 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component, { api } from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'BlockManage',
title: '区块管理',
icon: 'plugin-icon-symbol',
align: 'top',
...metaData,
api,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.blockmanage',
title: '区块管理',
type: 'plugins',
align: 'top',
icon: 'plugin-icon-symbol'
}

View File

@ -27,12 +27,14 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"html2canvas": "^1.4.1",
"pinyin-pro": "^3.13.0"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,21 +1,19 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'Bridge',
title: '资源管理',
icon: 'plugin-icon-sresources',
align: 'top',
...metaData,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.bridge',
title: '资源管理',
type: 'plugins',
align: 'top',
icon: 'plugin-icon-sresources'
}

View File

@ -27,9 +27,11 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,21 +1,19 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'DataSource',
title: '状态管理',
icon: 'plugin-icon-var',
align: 'top',
...metaData,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.datasource',
title: '状态管理',
type: 'plugins',
align: 'top',
icon: 'plugin-icon-var'
}

View File

@ -27,11 +27,13 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"monaco-editor": "0.33.0"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,23 +1,21 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import { fetchDataSourceList, fetchDataSourceDetail } from './src/js/http'
import component from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'Collections',
title: '数据源',
icon: 'plugin-icon-data',
align: 'top',
...metaData,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.collections',
title: '数据源',
type: 'plugins',
align: 'top',
icon: 'plugin-icon-data'
}

View File

@ -27,6 +27,7 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@vue/shared": "^3.3.4",
@ -35,6 +36,7 @@
"xlsx": "^0.18.5"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -10,11 +10,8 @@
*
*/
import HelpIcon from './src/HelpIcon.vue'
import metaData from './meta.js'
export default {
id: 'EditorHelp',
title: '',
icon: HelpIcon,
align: 'bottom'
...metaData
}

View File

@ -0,0 +1,9 @@
import HelpIcon from './src/HelpIcon.vue'
export default {
id: 'engine.plugins.editorhelp',
title: '',
type: 'plugins',
icon: HelpIcon,
align: 'bottom'
}

View File

@ -26,9 +26,11 @@
"dependencies": {
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -24,14 +24,15 @@
"license": "MIT",
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"vue-clipboard3": "^2.0.0"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"
@ -41,4 +42,4 @@
"@opentiny/vue-icon": "^3.14.0",
"vue": "^3.4.15"
}
}
}

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,22 +1,20 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component, { api } from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'Materials',
title: '物料',
icon: 'plugin-icon-materials',
align: 'top',
...metaData,
component,
api
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.materials',
title: '物料',
type: 'plugins',
icon: 'plugin-icon-materials',
align: 'top'
}

View File

@ -27,9 +27,11 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
resolve: {},
publicDir: false,
build: {

View File

@ -1,22 +1,20 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component, { api } from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'AppManage',
title: '页面管理',
icon: 'plugin-icon-page',
align: 'top',
...metaData,
api,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.appmanage',
title: '页面管理',
type: 'plugins',
icon: 'plugin-icon-page',
align: 'top'
}

View File

@ -26,10 +26,12 @@
"dependencies": {
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,21 +1,19 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'Robot',
title: 'AI对话框',
icon: 'plugin-icon-robot',
align: 'independence',
...metaData,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.robot',
title: 'AI对话框',
type: 'plugins',
icon: 'plugin-icon-robot',
align: 'independence'
}

View File

@ -27,9 +27,11 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
resolve: {},
publicDir: false,
build: {

View File

@ -1,21 +1,19 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'Schema',
title: '页面 Schema',
icon: 'plugin-icon-page-schema',
align: 'bottom',
...metaData,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.schema',
title: '页面 Schema',
type: 'plugins',
icon: 'plugin-icon-page-schema',
align: 'bottom'
}

View File

@ -27,9 +27,11 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,23 +1,20 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component, { api } from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'PageController',
title: '页面 JS',
icon: 'plugin-icon-js',
align: 'top',
...metaData,
api,
component,
confirm: 'close', // 当点击插件栏切换或关闭前是否需要确认, 会调用插件中confirm值指定的方法e.g. 此处指向 close方法会调用插件的close方法执行确认逻辑
component
}

View File

@ -0,0 +1,8 @@
export default {
id: 'engine.plugins.pagecontroller',
title: '页面 JS',
type: 'plugins',
icon: 'plugin-icon-js',
align: 'top',
confirm: 'close' // 当点击插件栏切换或关闭前是否需要确认, 会调用插件中confirm值指定的方法e.g. 此处指向 close方法会调用插件的close方法执行确认逻辑
}

View File

@ -27,9 +27,11 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,21 +1,19 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'OutlineTree',
title: '大纲树',
icon: 'plugin-icon-tree',
align: 'top',
...metaData,
component
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.outlinetree',
title: '大纲树',
type: 'plugins',
icon: 'plugin-icon-tree',
align: 'top'
}

View File

@ -27,9 +27,11 @@
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -1,22 +1,20 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
import component, { api } from './src/Main.vue'
import metaData from './meta.js'
export default {
id: 'Tutorial',
title: 'TinyEngine 教程',
icon: 'plugin-icon-tutorial',
align: 'bottom',
...metaData,
component,
api
}

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.plugins.tutorial',
title: 'TinyEngine 教程',
type: 'plugins',
icon: 'plugin-icon-tutorial',
align: 'bottom'
}

View File

@ -26,10 +26,12 @@
"dependencies": {
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",
"@opentiny/tiny-engine-entry": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"marked": "^4.0.17"
},
"devDependencies": {
"@opentiny/vite-plugin-generate-comments": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"vite": "^4.3.7"

View File

@ -103,14 +103,13 @@ export default {
boxVisibility.value = false
}
const { PLUGIN_NAME, getPluginApi } = useLayout()
const openVideoPanel = () => {
const { getPluginApi } = useLayout()
const { open } = getPluginApi('Tutorial')
const { open } = getPluginApi(PLUGIN_NAME.Tutorial)
open()
}
const { PLUGIN_NAME } = useLayout()
return {
state,
PLUGIN_NAME,

View File

@ -14,10 +14,11 @@ import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import generateComment from '@opentiny/vite-plugin-generate-comments'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
plugins: [generateComment(), vue(), vueJsx()],
publicDir: false,
resolve: {},
build: {

View File

@ -129,7 +129,8 @@ export default {
const instance = generateApp()
const getAllPageDetails = async (pageList) => {
const detailPromise = pageList.map(({ id }) => useLayout().getPluginApi('AppManage').getPageById(id))
const { PLUGIN_NAME, getPluginApi } = useLayout()
const detailPromise = pageList.map(({ id }) => getPluginApi(PLUGIN_NAME.AppManage).getPageById(id))
const detailList = await Promise.allSettled(detailPromise)
return detailList

View File

@ -117,7 +117,7 @@ import { isDevelopEnv } from '@opentiny/tiny-engine-controller/js/environments'
const http = useHttp()
const { activePlugin } = useLayout()
const { PLUGIN_NAME, activePlugin } = useLayout()
const IconHelp = iconHelpCircle()
@ -158,10 +158,10 @@ const getTargetUrl = (centerName) => {
const actions = {
pageManagement() {
activePlugin('AppManage')
activePlugin(PLUGIN_NAME.AppManage)
},
blockManagement() {
activePlugin('BlockManage')
activePlugin(PLUGIN_NAME.BlockManage)
},
gotoPlatformCenter() {
window.open(getTargetUrl('my-platform'), '_blank')

View File

@ -37,16 +37,6 @@ export const EXPRESSION_TYPE = {
JS_EXPRESSION: 'JSExpression'
}
export const PLUGIN_NAME = {
Materials: 'Materials',
AppManage: 'AppManage',
BlockManage: 'BlockManage',
PageController: 'PageController',
Lock: 'Lock',
OutlineTree: 'OutlineTree',
save: 'save'
}
export const LOCALE = {
zh_CN: 'zh_CN',
en_US: 'en_US'