Skip to content

Commit

Permalink
feat: rename metaComponent to configurator
Browse files Browse the repository at this point in the history
  • Loading branch information
chilingling committed May 31, 2024
1 parent d5590ad commit 637b244
Show file tree
Hide file tree
Showing 24 changed files with 175 additions and 177 deletions.
3 changes: 2 additions & 1 deletion designer-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"vue": "^3.4.21",
"@opentiny/tiny-engine": "workspace:^",
"@opentiny/tiny-engine-entry": "workspace:^",
"@opentiny/tiny-engine-canvas": "workspace:^"
"@opentiny/tiny-engine-canvas": "workspace:^",
"@opentiny/tiny-engine-configurator": "workspace:*"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ref } from 'vue'
import { Input } from '@opentiny/vue'
export default {
name: 'MetaInput',
name: 'MyInputConfigurator',
components: {
TinyInput: Input
},
Expand Down
11 changes: 11 additions & 0 deletions designer-demo/src/configurators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { InputConfigurator, SelectConfigurator } from '@opentiny/tiny-engine-configurator'
import MyInputConfigurator from './MyInputConfigurator.vue'

export const configurators = [
{
name: 'MyInputConfigurator',
component: MyInputConfigurator
},
InputConfigurator,
SelectConfigurator
]
4 changes: 2 additions & 2 deletions designer-demo/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
// 导入@opentiny/tiny-engine时,内部的依赖包也会逐个导入,可能会执行useComplie,此时需要templateHashMap。所以需要先执行一次defineEntry
import { registry } from './defineEntry.js'
import { init } from '@opentiny/tiny-engine'
import { metaComponents } from './metaComponents'
import { configurators } from './configurators.js'

init({ registry, metaComponents })
init({ registry, configurators })
12 changes: 0 additions & 12 deletions designer-demo/src/metaComponents.js

This file was deleted.

10 changes: 5 additions & 5 deletions packages/builtinComponent/src/meta/CanvasCol.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand All @@ -72,7 +72,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand All @@ -88,7 +88,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand All @@ -104,7 +104,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaSelect",
"component": "SelectConfigurator",
"props": {
"options": [
{ "value": "flex-start", "label": "头部对齐" },
Expand All @@ -128,7 +128,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaSelect",
"component": "SelectConfigurator",
"props": {
"options": [
{ "value": "flex-start", "label": "头部对齐" },
Expand Down
10 changes: 5 additions & 5 deletions packages/builtinComponent/src/meta/CanvasRow.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand All @@ -50,7 +50,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand All @@ -66,7 +66,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand All @@ -82,7 +82,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaSelect",
"component": "SelectConfigurator",
"props": {
"options": [
{ "value": "flex-start", "label": "头部对齐" },
Expand All @@ -106,7 +106,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaSelect",
"component": "SelectConfigurator",
"props": {
"options": [
{ "value": "flex-start", "label": "头部对齐" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/canvas/src/components/builtin/builtin.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
},
"cols": 12,
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
},
Expand Down Expand Up @@ -256,7 +256,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {
"type": "textarea",
"autosize": true
Expand Down Expand Up @@ -399,7 +399,7 @@
"cols": 12,
"rules": [],
"widget": {
"component": "MetaInput",
"component": "InputConfigurator",
"props": {}
}
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@opentiny/tiny-engine-meta-components",
"name": "@opentiny/tiny-engine-configurator",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/configurator/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as InputConfigurator } from './input-configurator'
export { default as SelectConfigurator } from './select-configurator'
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Input } from '@opentiny/vue'
import { useProperties } from '@opentiny/tiny-engine-controller'
export default {
name: 'MetaInput',
name: 'InputConfigurator',
components: {
TinyInput: Input
},
Expand Down
6 changes: 6 additions & 0 deletions packages/configurator/src/input-configurator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import InputConfigurator from './InputConfigurator.vue'

export default {
name: 'InputConfigurator',
component: InputConfigurator
}
6 changes: 6 additions & 0 deletions packages/configurator/src/select-configurator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import SelectConfigurator from './SelectConfigurator.vue'

export default {
name: 'SelectConfigurator',
component: SelectConfigurator
}
File renamed without changes.
Loading

0 comments on commit 637b244

Please sign in to comment.