Compare commits

...

423 Commits

Author SHA1 Message Date
chilingling fc161705e9
fix: getRenderer could be null before canvas init (#1254) 2025-04-08 20:27:11 +08:00
chilingling bf5f681ddd
fix: del event should trigger change event (#1253) 2025-04-08 20:24:02 +08:00
Hexqi a67d5fb3ce
ci: update label and release action config (#1295)
* ci: update label and release action config
2025-04-08 15:07:38 +08:00
chilingling cdf3914355
fix: globalState inCorrect spell (#1292) 2025-04-07 21:23:19 +08:00
chilingling 0118f1528d
Merge pull request #1290 from opentiny/release-v2.4.0-merge
Release v2.4.0 merge
2025-04-07 20:18:33 +08:00
hexqi ed7916d641
Merge remote-tracking branch 'origin/develop' into release-v2.4.0-merge 2025-04-07 19:58:07 +08:00
Hexqi 477aa411da
v2.4.0 (#1287) 2025-04-07 19:49:11 +08:00
yy a54202189c
fix: export more api for application (#1256) 2025-04-07 14:17:43 +08:00
lisong d0eebb3a7c
fix: save button red dot shows exception (#1285) 2025-04-07 11:07:44 +08:00
xuanlid 2610875287
fix: Modify some version issue (#1280) 2025-04-07 09:37:31 +08:00
lisong f912d399e8
fix: adjust canvas scaling after panel drag (#1268) 2025-04-02 14:21:16 +08:00
lisong c7da8376fc
fix: multiple UI and interaction issues (#1267) 2025-04-02 14:19:56 +08:00
Gene f53ea7ae6f
types: add types to useBlock, useDataSource, useTranslate, useReource, useBreadcrumb, Modal (#1262) 2025-04-02 09:40:33 +08:00
lichunn e3845e4e1c
fix: setting default page jump text to be too long across multiple pages (#1276) 2025-04-02 09:22:55 +08:00
lichunn 87d7d32e5f
fix(page): handle error case for default redirect page update (#1277) 2025-04-02 09:20:56 +08:00
Gene b7164bb57d
fix: i18n create empty entries error (#1278) 2025-04-02 09:19:34 +08:00
lisong 17a3b67015
fix(styles): sync global styles and activate panels when click contextmenu (#1246) 2025-04-02 09:18:54 +08:00
xuanlid 4d9a68b868
fix(schema-panel): correct close logic (#1274) 2025-04-01 23:55:52 +08:00
lichunn 730bfb93ae
fix: isDefault was not reset to false after dragging the subpage to another parent page (#1264) 2025-04-01 14:59:33 +08:00
xuanlid 24a3bccfae
fix: Modify AI dialog box style issues (#1258) 2025-03-30 17:53:58 +08:00
lisong f3ed92531c
fix: add block initialization logic (#1257) 2025-03-29 11:38:43 +08:00
Gene a481eff281
types: add types to hooks.ts, containers.ts and useCanvas.ts (#1240) 2025-03-29 10:12:50 +08:00
xuanlid 47d013a18d
fix: compact javaBackEnd isDemo and globalState field (#1251) 2025-03-26 20:19:23 +08:00
xuanlid bec6f7c101
fix: default vite.config template should base config
修改出码模板的 vite.config.js 文件,增加 `base: './'` 配置
2025-03-25 17:15:09 +08:00
Hexqi 40df6ee51c
v2.4.0-rc.0 (#1228) 2025-03-21 16:21:51 +08:00
lisong cb59aa0922
fix: modal box appearance position adapts to panel drag (#1234) 2025-03-21 16:05:24 +08:00
Gene bf9981446a
fix: CanvasDivider position error (#1233) 2025-03-21 15:10:11 +08:00
Gene 5600a1aa75
fix: hover rect is frozen when scroll canvas (#1235) 2025-03-21 14:26:33 +08:00
chilingling f0613535b8
fix: VITE_CDN_TYPE should not be build on sub package build (#1232) 2025-03-20 17:58:35 +08:00
lisong 3739ce2d72
refactor: project plugins module typescript support (#1217) 2025-03-20 11:49:08 +08:00
lichunn 37f71dc3bd
fix:添加renderless依赖 (#1231) 2025-03-20 11:32:44 +08:00
Gene d0f264ff5b
refactor: Migrate JavaScript files to TypeScript (#1223) 2025-03-20 11:00:12 +08:00
lisong 8d31bd3ed4
feat: plugin flexible layout (#1219) 2025-03-20 10:29:17 +08:00
Gene 20c3b071bd
feat: The outline tree supports hotkeys and works like canvas (#1226) 2025-03-19 16:39:36 +08:00
lichunn 564f929b85
feat:adjust the homepage and default page settings mode (#1214) 2025-03-19 16:37:26 +08:00
chilingling c50c8aa7ab
feat: support npmmirror cdn (#1220) 2025-03-19 15:47:48 +08:00
Gene 1dcc8e964b
refactor: multiple selection (#1221) 2025-03-19 14:57:30 +08:00
chilingling 80395da8c5
fix: contiue setting filter script to js panel (#1196)
修复连续设置需要过滤内容的 script 到js面板,js 面板没有正确显示更新的 bug
2025-03-19 09:51:08 +08:00
chilingling 2d1c06d07b
fix: prettier format script into iife caught error (#1184) 2025-03-19 09:48:58 +08:00
lisong 7297076592
fix: update the outgoing material version (#1225) 2025-03-18 17:53:54 +08:00
xuanlid 834b647958
fix: Modify rowIndex (#1224) 2025-03-18 17:37:22 +08:00
webzmj530 13e7f96063
fix:自定义渲染函数中的组件,如果页面没有引入,预览页面和出码页面会存在问题 (#1146)
* fix:自定义渲染函数中的组件,如果页面没有引入,预览页面和出码页面会存在问题
2025-03-17 11:00:01 +08:00
Ljhhhhhh 54af598411
fix: fixed material generation and database connection for components (#1215)
Co-authored-by: lujiehui <lujiehui@cptgroup.cn>
2025-03-17 10:57:53 +08:00
**啸 46dbbe8bdc
feat: 添加大纲树节点删除功能 (#1216)
Co-authored-by: 1degrees <xiaozhang20@iflytek.com>
2025-03-14 10:08:44 +08:00
Gene 38fe39c127
feat: add ESLint TypeScript rules and fix all ESLint errors (#1145)
项目ts改造基础,使用eslint9+typescript。在@vue/eslint-config-typescript默认配置上进行修改
2025-03-13 11:27:19 +08:00
xuanlid ee01af8ecb
feat: Modify the theme switching logic and add a new theme template to CLI. (#1143)
1.修改主题切换逻辑,默认值改成从注册表中的themes获取。
只有亮色和暗色两种默认主题的情况下,保持原来的逻辑,点击直接切换主题
用户添加了自定义主题,出现选择列表,在列表中切换主题
2.添加新主题模板
在终端中,用命令创建新主题,选择theme类型,添加主题模板,输入主题名称:demo-theme
在demo-theme下可以看到新创建的主题,cd demo-theme && pnpm i
将主题接入设计器
2025-03-13 11:26:47 +08:00
xuanlid f53c455eba
feat: Modify the outer class name of the module (#1181)
1. 修改plugin下模块外层类名
2. 复选框选中状态和默认状态大小调整
3. 部分模块滚动条修改
4. 弹窗关闭图标样式调整
2025-03-13 11:25:48 +08:00
lisong 24b2f69f87
fix: the display is abnormal when clicking back on multiple selected nodes (#1201)
1. 多选节点进行点击回退剩余一个元素时,框选效果异常
2. 快捷键剪切失效
2025-03-13 11:25:12 +08:00
webzmj530 6789959504
fix:When splitting materials, a component can exist in multiple snippets. Also, there can be two components within one snippet (with the same componentName but different snippetName) (#1212)
* 拆包的时候一个组件在多个分组里面也可以一个分组里面存在两个组件(componentName相同, snippetName不同)
2025-03-13 11:24:17 +08:00
Ljhhhhhh 75db0ba0e1
fix: 修复文案为空时 i18n 下的文案为 null 导致出码异常 (#1211)
修复文案为空时 i18n 下的文案为 null 导致出码异常,新增判断条件,默认为空对象
2025-03-13 11:23:36 +08:00
chilingling 66a6d00004
fix: compact schema missing css field (#1179) 2025-03-12 14:17:02 +08:00
chilingling e42a1859fe
fix: canvas actionbar move child can not work (#1180) 2025-03-12 14:16:21 +08:00
chilingling d05f724a0d
fix: datasourceMap is empty when init set schema (#1142) 2025-03-12 14:13:15 +08:00
webzmj530 47c63f77a1
fix:The packages field is lost after splitMaterials (#1200)
* fix:拆包之后packages字段丢失

* feat:合并物料时将package信息写入bundle.json

---------

Co-authored-by: mjzhu4 <mjzhu4@kxdigit.com>
2025-03-10 20:34:36 +08:00
**啸 100071c7f2
修复数据源绑定时,将数据源初始化的State 和原有State错误更新,导致功能无效,Schame沉余无用数据 (#1208)
Co-authored-by: 张啸 <xiaozhang20@iflytek.com>
修复: 数据源绑定时,将数据源初始化的State 和原有State错误更新,导致功能无效,Schame沉余无用数据
2025-03-10 20:25:15 +08:00
Gene 01500a081c
docs: add documentation (#917) 2025-03-10 09:47:11 +08:00
chilingling d0d94205b5
Merge pull request #1198 from opentiny/release/v2.3.0
Release/v2.3.0
2025-03-07 15:43:45 +08:00
Hexqi 330c4d2b31
chore: update version v2.3.0 (#1192) 2025-03-07 14:06:33 +08:00
lisong c40162cacf
fix: refactor multi-node click and fix outline tree click problem (#1166) 2025-03-07 11:06:45 +08:00
lisong 5ff98245b9
fix: undo or reply to save button tag display logic optimization (#1185) 2025-03-07 09:14:33 +08:00
lichunn 9585991779
fix: page and block preview failure (#1187)
* fix: 修复页面区块预览失效问题

* fix:fix review
2025-03-06 16:44:15 +08:00
lichunn 186ba6a336
fix: add test cases for routing code output (#1189) 2025-03-06 16:40:57 +08:00
lichunn b36da42d76
fix: the default page settings under the folder do not take effect (#1182) 2025-03-06 10:41:57 +08:00
xuanlid ba0963a378
fix: Modify the dark theme style (#1186)
暗色主题下样式调整
1.下拉框面板背景
2.折叠面板图标
3.消息提示文字颜色
4.固定面板图标
5.按钮hover背景
2025-03-05 19:16:01 +08:00
xuanlid 71c5c2be74
fix: java backend click on block with err message (#1177)
处理区块字段 assets为undefined的情况
2025-03-04 20:57:07 +08:00
lichunn e428fd0bfa
fix: fix incompatible styles in dark theme (#1174)
* fix: 修复暗色主题部分不兼容的样式
2025-03-04 16:50:52 +08:00
chilingling db82e0038e
fix: stop multiple js error modal popup (#1175) 2025-03-04 16:47:57 +08:00
Gene a5d2fd46db
feat: clicking node in the outline tree is invalid when page unlocked (#1172)
允许页面未锁定时通过点击大纲树 hover 和 选中节点。
2025-03-04 11:08:24 +08:00
Gene 855ccdf59c
fix: the list in ViewerSwitcher does not close after clicking the canvas (#1169)
修复嵌套路由预览下拉列表弹出后,无法通过点击画布内部来关闭的 bug
2025-03-04 10:13:20 +08:00
xuanlid 9152de24e4
fix: Margin supports configuring negative numbers (#1165)
* fix: Margin supports configuring negative numbers
2025-03-04 09:33:23 +08:00
xuanlid d931aeaae4
fix: style optimization (#1162)
修改样式问题
1.区块设置->事件设置 去掉无必要滚动条显示
2.数据源下拉校验错位
2025-03-03 19:26:11 +08:00
fox ouyang 33080b1166
fix: Improved data handling to ensure robust processing of grid column information (#1163)
* 修改handleTinyGridColumnsSlots方法中判断node.props.columns是否为数组
2025-03-03 11:36:00 +08:00
xuanlid cf64f90c29
feat: add API Token (#1119) 2025-02-27 20:32:53 +08:00
lisong 9b3bb55d88
fix: insert logic and multi node insert issue (#1150) 2025-02-27 20:31:20 +08:00
Gene 2860d1c9bb
fix: title content lost when dragging from outline tree (#1149)
修复拖拽Header组件会导致内容消失的 bug
2025-02-26 16:48:30 +08:00
chilingling 36a2b5ee4c
fix: add slots fail (#1140)
修复 insert 方法因为 referTargetNode 找不到引起的报错,导致 slot
插槽增加失败
2025-02-26 12:34:52 +08:00
chilingling cc2e062015
fix: add slots fail (#1141)
修复 insert 方法因为 referTargetNode 找不到引起的报错,导致 slot
插槽增加失败
2025-02-26 12:32:32 +08:00
Hexqi 5ea78adea6
chore: update version v2.3.0-rc.0 (#1130) 2025-02-19 14:08:38 +08:00
lisong 8d51ad4ee7
feat: enhance canvas foundation capabilities (#1055) 2025-02-19 12:04:44 +08:00
yy db1934da58
feat: shortcut key for saving (#951) 2025-02-18 21:02:51 +08:00
Gene ab58e88b3e
fix: add prettier version ^2 to workspace resolve lint-staged error and format all codes (#1129) 2025-02-18 20:07:59 +08:00
Gene 1ccf8e5656
feat: outline tree support dragging (#1050) 2025-02-18 19:57:03 +08:00
chilingling 11f92442ee
feat: tinyvue grid slot generate code to template (#756) 2025-02-18 19:54:16 +08:00
chilingling b94f702609
fix: TinyGrid slot children can not operate (#1100) 2025-02-18 19:44:56 +08:00
Gene 770eeebfac
feat: route bar support display preview path (#1118) 2025-02-18 19:34:29 +08:00
xuanlid 1a5587783e
feat(theme): change incorrect css variables and delete the ‘less’ file (#1121) 2025-02-18 19:28:08 +08:00
betterdancing eaebe6838e
fix(block): fix block group info missing when edit block & fix filed block_id is undefined when change bock version (#1056) 2025-02-18 19:24:27 +08:00
Gene 13dec1cfee
feat: RouteView support switching preview (#1117) 2025-02-18 17:47:37 +08:00
lichunn f5a3f5067f
fix: adjust the preview of the current page to schema data (#1095) 2025-02-18 17:45:39 +08:00
lichunn 3571a683bf
fix: route code to move the redirect of an empty node to the parent node (#1116) 2025-02-18 17:25:35 +08:00
lichunn 0a041e365e
feat:add theme switching plugin (#1070) 2025-02-18 17:06:24 +08:00
chilingling 08e8d0a88b
fix: add @eslint/js deps declaring (#1122) 2025-02-17 09:33:51 +08:00
lisong 66068fb726
fix: resolve some interaction issues (#1102) 2025-02-14 11:31:56 +08:00
xuanlid dd38dea10a
fix: Modify new page interaction (#1107) 2025-02-14 11:21:58 +08:00
hashiqi 1315b3a36a
fix: svg color not work in preview mode (#1111) 2025-02-14 11:19:53 +08:00
lichunn 4429189233
fix:after setting the subpage as the homepage, it becomes the first level page (#1115) 2025-02-13 17:50:25 +08:00
xuanlid 8d8d9982a6
feat: variable convergence( layout,toolbars, common) (#1101) 2025-02-13 17:47:56 +08:00
xuanlid ef5bd33f9b
feat: variable convergence(configurator,canvas,preview) (#1105) 2025-02-13 17:32:12 +08:00
xuanlid 52e4435b62
feat: variable convergence in setting (#1096) 2025-02-13 17:31:28 +08:00
xuanlid 60d0b2cdf8
feat: variable convergence(materials, page, schema, script, state, tree, tutorial) (#1087) 2025-02-13 17:31:11 +08:00
xuanlid fdfc1bb0b6
feat: variable convergence(block, i18n, bridge, datasource, help, robot) (#1078) 2025-02-13 17:30:17 +08:00
Gene bdbae55e51
refactor: extract URL parameter related logic to defaultGlobalService (#1103) 2025-02-10 19:39:41 +08:00
rhlin b3c4771f2c
feat(canvas/render): add router onion skinning preview (#1063) 2025-02-10 11:14:09 +08:00
chilingling 789e06a8fb
fix: injectPlaceholder compact Template Node (#1099) 2025-02-08 14:09:12 +08:00
chilingling 3c8ba634a2
fix: update splitMaterial and buildMaterials path (#1094) 2025-02-06 14:40:29 +08:00
chilingling 22a525d923
fix: canvasDivider can't work (#1075) 2025-02-06 11:08:50 +08:00
chilingling 15b6a9cbd8
fix: deDuplicated BuiltinComponentsMap (#1073) 2025-02-06 11:05:45 +08:00
chilingling 6d7303fdf5
fix: gencode element-plus test case (#1074) 2025-02-06 10:57:46 +08:00
Hexqi a2883f1210
Merge pull request #1085 from opentiny/release-v2.2.0-merge
Release v2.2.0 merge
2025-01-27 03:19:43 +08:00
hexqi 1edcfade83
Merge branch 'refactor/develop' into release-v2.2.0-merge 2025-01-27 03:11:08 +08:00
Hexqi 34525174aa
v2.2.0 (#1084) 2025-01-26 18:59:19 +08:00
lisong 8e6896eee2
fix: fix data source type display exception (#1082) 2025-01-26 17:30:17 +08:00
lisong 07509fd168
fix:Optimize JS page style (#1081) 2025-01-26 17:29:41 +08:00
lichunn c04ec56cf2
fix: preview failure (#1079) 2025-01-26 17:29:14 +08:00
betterdancing bfc9feaf90
fix(block): fix block not refresh when curd & block deploy bugs (#1080) 2025-01-26 17:28:02 +08:00
Hexqi b5789c51f4
v2.2.0-rc.1 (#1077)
* chore: add update template script

* chore: upgrade to 2.2.0-rc.1

* refactor: code refactor
2025-01-26 11:24:33 +08:00
Gene 2d47b793e7
fix: parent form field in page settings do not display (#1069) 2025-01-25 16:51:06 +08:00
xuanlid 48f25c6dfd
fix: Delete prompt box (#1068) 2025-01-24 11:26:41 +08:00
xuanlid 5b9d61a9fe
feat: Module variable rectification (#1065) 2025-01-24 11:23:52 +08:00
Gene d8c78bd9c4
fix: AI chat request error (#1059) 2025-01-23 15:57:12 +08:00
chilingling 477c96aafa
feat: bump tiny-vue version (#1008) 2025-01-23 14:50:14 +08:00
rhlin fe04e1bda6
fix(canvas/render): fix edited page not refresh on children page, fix pageSection should not be able to drag,remove post css warning (#1060) 2025-01-23 11:03:10 +08:00
rhlin 5162ab475f
fix(plugins/materials): fix new app with no page should not set url page id to undefined (#1061) 2025-01-23 10:53:16 +08:00
yy 4b9a6816e8
fix: mock utils axios cdn link 2025-01-23 10:41:55 +08:00
yy fb467a714e
fix: update template bundle (#1048) (#1058) 2025-01-22 10:10:51 +08:00
wenmine ceb8bae97b
feat(refactor/theme): change incorrect css variables to the common variables and delete theme/base.less (#1049) 2025-01-21 11:10:27 +08:00
xuanlid 4e4b18e51d
feat: Modify css variables (#1051) 2025-01-20 15:30:06 +08:00
chilingling dd8ae425bc
v2.2.0-rc.0 2025-01-16 19:38:44 -08:00
chilingling 04459f34e5
v2.2.0-beta.3 2025-01-16 19:14:26 -08:00
chilingling e0e657b685
fix: Release github action syntax issue 2025-01-16 19:14:01 -08:00
yy 9d0af81d81
fix: update template bundle (#1048) 2025-01-17 09:56:38 +08:00
chilingling 97efa2aa88
v2.2.0-beta.2 2025-01-16 17:35:50 -08:00
chilingling 61aa180438
fix(chore): output build log to tmp directory
Release 的 github action 构建日志输出到 tmp 目录
2025-01-16 17:32:33 -08:00
wenmine ed569f6815
feat(refactor/theme): change incorrect css variables to the common va… (#1027) 2025-01-16 15:15:15 +08:00
Gene bacd2999f6
fix: fix the error of routing bar caused by invalid pageid (#1045) 2025-01-16 14:04:33 +08:00
chilingling d2fc9b1b2a
v2.2.0-beta.1 2025-01-15 17:24:51 -08:00
chilingling 33a42f870a
fix: remove pnpm cache for release workflow 2025-01-15 17:23:44 -08:00
chilingling e32b9b3ab5
v2.2.0-beta.0 2025-01-15 17:07:17 -08:00
yy a7477a8d01
feat: materials new protocol (#940) 2025-01-15 12:53:40 +08:00
rhlin bf30f729bf
fix(canvas/render): fix switching between top pages in standalone view mode, cssScope not updated and entry point pageContext active error (#1044) 2025-01-15 12:48:16 +08:00
Hexqi 2e16346441
Merge pull request #1011 from opentiny/feat/router-page
feat(canvas, plugin, toolbars, generte-code, preview): add router page support
2025-01-14 19:56:05 +08:00
Gene 64315c47f8
chore: undo prettier version 3 formatting style (#1041) 2025-01-14 18:54:42 +08:00
lichunn d71c249103
fix: fix review (#1042) 2025-01-14 18:52:59 +08:00
rhlin 777bbed7d3
fix: remove redundant and wrong type declaration (#1040) 2025-01-14 18:03:37 +08:00
chilingling 931918b024
fix(vue-generator): add @babel/generator as build external (#1039) 2025-01-14 17:22:52 +08:00
Gene 1c58c2fbfd
feat: the blocks categories and groups merged by default (#1038) 2025-01-14 17:08:49 +08:00
yy 3674f8376a
fix: The style configuration binding variable component reads the configurator configuration (#949) 2025-01-14 16:56:25 +08:00
rhlin a11ca2c790
fix router page review issue (#1037)
* fix(canvas): fix misspell, remove require properties

* fix: add type to parentContext and default value to pageId

* style: add type, import type add type prefix, fix misspell

* fix: remove some redundancy usages

* fix(canvas/render): fix style sheet might not accept updated content

* fix(design-core/assets): remove svg comment

* fix: add useBroadcastChannel close

* fix: remove redundancy import, add function parameter type, fix type for method is not consistent
2025-01-14 16:27:39 +08:00
lichunn 7e8d4877fc
fix: preview page nesting and adding null detection processing (#1035)
* fix: 预览页面嵌套添加判空处理

* fix: fix review
2025-01-14 16:23:57 +08:00
Gene 8a2e34e8bc
fix: add error handlers and fix some misspelling of word (#1036) 2025-01-14 16:12:32 +08:00
rhlin 3b99bf9e34
fix(canvas): standalone view mode lost css and activity, remove invalid type declaration (#1031)
* fix(canvas/render): fix standalone view mode lost page active status and page css cope id

* fix(canvas): remove invalid type declaration
2025-01-14 11:14:24 +08:00
Gene ce853d7cf1
fix: remove 1px blank inside page tree container (#1032) 2025-01-14 11:07:56 +08:00
Gene 9b64bddbef
fix: common page do not support drag (#1029) 2025-01-13 21:54:13 +08:00
Gene ec976efb99
fix: cannot select common page (#1028) 2025-01-13 21:47:03 +08:00
lichunn 0a7e98786b
fix:preview nested pages compatible with folders (#1022)
* fix: 预览多页面兼容测试环境数据

* fix:路由增加根/

* fix: fix review

* fix: fix review

* fix: 页面嵌套预览兼容文件夹
2025-01-13 21:32:37 +08:00
rhlin 531a55e63b
Merge pull request #1025 from gene9831/fix/merge-conflict
Fix/merge conflict
2025-01-13 21:14:27 +08:00
gene9831 cfdecb6871
Merge branch 'refactor/develop' of github.com:opentiny/tiny-engine into fix/merge-conflict 2025-01-13 21:01:16 +08:00
rhlin 1edb7bf80b
fix(canvas/router-bar): fix canvas router bar clickable when node is folder (#1024) 2025-01-13 20:46:34 +08:00
Gene 1f435fc666
feat: support drag page node to root (#1023) 2025-01-13 20:35:41 +08:00
chilingling 8295c3f974
feat: add auto publish workflow (#1005) 2025-01-13 20:00:20 +08:00
chilingling af491af404
feat: generatecode support import element style (#817) 2025-01-13 19:55:21 +08:00
yy 774199b692
fix:i18n options format (#950) 2025-01-13 19:48:13 +08:00
xuanlid e17443134b
fix: Modify UI review comments (#1013) 2025-01-13 19:45:40 +08:00
lisong d955cd8fdf
fix: resolve the automatic save state invalid after refresh (#1004) 2025-01-13 19:25:15 +08:00
lisong a5b1df6c54
fix: add Page JS alert info. (#1012) 2025-01-13 19:23:55 +08:00
chilingling a440ee5a6b
fix: state accessor defaultValue support expression #977 (#997) 2025-01-13 18:01:13 +08:00
yy f7bbe33588
fix: shortcut operation attribute configuration internationalization and icon configuration closed abnormally (#970) 2025-01-13 17:45:56 +08:00
yy f2db03a6ef
fix: the position of the pop-up window for configuring internationalized entries in the editor is incorrect when the full screen is switched (#969) 2025-01-13 17:45:09 +08:00
lichunn 91c09ab7f2
fix: modify the class name of the MonacoEditor component (#999) 2025-01-13 17:19:08 +08:00
lisong 0e17cb6c9b
fix: optimize block code saving and publishing logic (#996) 2025-01-13 17:17:57 +08:00
chilingling 269f4318bd
fix: switch page or block should clear selection (#992) 2025-01-13 17:11:17 +08:00
chilingling eaf16c7ea0
fix: genCode favicon can't work on node runtime (#1000) 2025-01-13 17:10:16 +08:00
bwrong a5ebe0124d
fix: 修复在物料使用相对路径的script时,动态导入组件url报错问题 (#958)
Co-authored-by: wangwenbing <11535041@qq.com>
2025-01-13 17:05:03 +08:00
rhlin 1bf68bb23b
fix(canvas): fix popstate listener post changed-data with wrong format (#1017)
* fix(canvas): fix popstate listener post changed-data  with wrong format

* style: replace var name
2025-01-13 16:51:13 +08:00
Gene 5dd9ed7235
fix: pageId comparison type does not match (#1016)
* fix: parent is not displayed in page settings

* fix: page highlighting issue after switch to block
2025-01-13 16:26:35 +08:00
Gene e3c48cb7fe
fix: block list filters not clearing (#1006) 2025-01-10 17:56:54 +08:00
lisong 92240b6ab6
Revert "fix: resolve block search exceptions (#995)" (#1015)
This reverts commit fee84e6823.
2025-01-10 17:35:17 +08:00
rhlin 30ba9bb676
build(toolbars/view-setting): no css gen, remove vite config import css (#1014) 2025-01-10 17:31:30 +08:00
rhlin ab4e7dc2ed
Feat router page embedded view toggle (#1010)
* feat(canvas, toolbar/view-setting): add router view setting view mode switcher, support embedded and standalone mode in canvas

* fix(canvas/render): fix switch locale failed

* feat(canvas): add window.onpopstate listener

* fix(toolbars/view-setting): fix init view mode value no fallback cause next view mode label error

* fix: using enum instead of multiple time literal string declaration, add fallback for cache value getter in toolbar, fix typo mistake

* fix: simplify return value using enum, remove unnecessary style code

* fix(toolbars/view-setting): fix package.json wrong repository directory
2025-01-10 16:48:53 +08:00
rhlin 4c1c4c49f4
feat(canvas/container): canvas allow router-link quick switch page (#1001)
* feat(canvas/container):  canvas allow router-link component from inactive page to have hover menu for quick switch page action

* feat: replace css var with --te variable,  merge same action condition
2025-01-10 14:37:11 +08:00
Gene a834f60a5e
fix: resetCanvasState indirectly called in useHistory, resets the isBlock status (#1009) 2025-01-09 18:05:52 +08:00
Gene 81c0e770fb
fix: RouterLink act like a in canvas (#1007) 2025-01-09 17:59:27 +08:00
lisong fee84e6823
fix: resolve block search exceptions (#995) 2025-01-09 11:16:43 +08:00
lichunn dceffa9be1
fix:preview data structures compatible with the testing environment (#998)
* fix: 预览多页面兼容测试环境数据

* fix:路由增加根/

* fix: fix review

* fix: fix review
2025-01-08 15:58:29 +08:00
Gene 5a9253a204
Merge pull request #1003 from rhlin/resolve-router-page-merge-conflict
Resolve router page merge conflict
2025-01-08 14:20:41 +08:00
rhlin 3bc9d334f2
Merge remote-tracking branch 'upstream/refactor/develop' into resolve-router-page-merge-conflict 2025-01-07 09:06:51 -08:00
Gene 3bf93ffb55
feat: add canvas route bar (#967)
* feat: add route link bar above the canvas

* feat: route bar support switch route

* add TODO

* change css variables

* fix: fix switch page error after create one

* feat: support select router page on RouterLink

* feat: RouterLink support navigate by right-click menu operation in canvas

* feat: navigation operation place to first

* feat: support setting default page

* fix: hide route bar in block canvas

* fix: hide route bar in block canvas

* feat: add confirm modal before switch page

* fix: remove TODO comment

* fix: Modified based on review comments

* fix some issues

* fix wrong type of route id
2025-01-07 16:46:27 +08:00
xuanlid a14a508305
fix:Modify panel shadow color (#943) 2025-01-07 09:43:35 +08:00
xuanlid 15597a1544
fix: Modify UI review comments (#941)
* fix:Modify Code Font in bridge/state

* fix:modify the block list style in block

* fix:Modify schema panel style

* fix:Modify tabs in materials

* fix:Modify global dialog, modal and search

* fix:Modify the component list style in materials

* fix:Modify search in i18n

* fix: Modify UI in Schema Panel

* fix:Modify dialog style and i18n Panel shadow

* fix:Modify the component list style in materials

* fix:Modify the block list style in block

* fix: Modify UI review comments in i18n

* fix: Modify modal style

* fix: Modify modal in clean

* fix: Modify modal in block

* fix: Modify the block list and modal in block

* fix: modify the block list in block

* fix: modify font size

* fix: Modify global button

* fix: delete comment code

* fix: change plugin-icon-js.svg

* fix:Modify Code Font in bridge/state

* fix:Modify button in header

* fix: Modify button in state

* fix:Modify Font Size in datasource

* fix: Modify icon in lifecycle/blockEvent

* fix: Modify validate in dialog

* fix: modify second-panel and tree styles

* fix: Modify tree componentType

* fix: Modify the fixed column style of the table

* fix: Modify top save and more

* fix:Modify code style in state

* fix:Modify the block list in block

* fix: Modify remote panel

* fix: Modify the icon to tips and gray background

* fix:Modify global popover and toolTip

* fix:Modify open-delay to a constant
2025-01-07 09:39:50 +08:00
rhlin 170fd41b9c
Fix router page placeholder and useblock error, switch block render error (#990)
* feat: modify router-view placeholder text

* fix(plugin/block): useBlock update location history function fix

* fix(canvas/render): fix scoped css produce twice cause active page css lost accidentally

* fix(canvas/render): fix switch from page editing to block editing, rendering with error pageContext, result in  page render error

* refactor(canvas/render): move injection to setup phase

* fix(canvas/render): fix css load twice

* fix(canvas/render):  temple fix for switch page, avoid old editing schema overwrite

* fix(canvas/render): add `Ref` import
2025-01-06 11:52:18 +08:00
chilingling b38af9f2ac v2.1.0 2025-01-02 23:26:31 -08:00
chilingling 4fea04b629 fix: preview page breadcrumb don't exist useBlock method and preview block error when type undefined (#988)
* fix: preview breadcrumb don't exist useBlock method

* fix: resolve block preview error when type is undefined

---------

Co-authored-by: hexqi <wu_12556@126.com>
2025-01-02 23:26:31 -08:00
chilingling e3f3339901 fix: cannot publish current editing block (#987) 2025-01-02 23:26:31 -08:00
chilingling 7847ab51bf fix: resolve block property issue (#971)
* fix: resolve block property issue

* fix: block property form rename

---------

Co-authored-by: hexqi <wu_12556@126.com>
2025-01-02 23:26:31 -08:00
chilingling ff5048d453 fix: block switch select property failed (#984)
* fix: block switch select property failed

* fix: del assignment
2025-01-02 23:26:31 -08:00
Hexqi dc71923f4c fix: update cli template resolve preview error (#983)
更新 cli 模板
2025-01-02 23:26:31 -08:00
lisong 884f988312 fix: optimize save code button marker position (#982)
* fix: optimize save code button marker position

* fix: resolve point style issues for page Schema and page JS
2025-01-02 23:26:31 -08:00
zhangjuncao c6ce763833 fix:modify style (#981) 2025-01-02 23:26:31 -08:00
chilingling 55d1f755a0 fix: blockCompile get correct version (#964)
* fix: blockCompile get correct version

* fix: support refresh block selected version

* fix: clear all compileCache

* fix: use correct version key to find history schema

* fix: add id for stylesheet

* fix: clean style sheet when remove cache

* fix: should remove stylesheet before clean cache
2025-01-02 23:26:31 -08:00
chilingling af552d0c8f fix: blockPublishLogic (#973)
* fix: breadcrumb publish block cannot get correct version

* fix: block schema change sync

* fix: del useless comment code

* fix: hide publish block button when creating block
2025-01-02 23:26:31 -08:00
chilingling 80359a1743 fix: generate code accessor scenario (#972)
* fix: generate code accessor scenario

修复 state  accessor 出码的bug

* fix: objectVal gettter value
2025-01-02 23:26:31 -08:00
chilingling 132f3e8888 fix: basePropsGroup use deepclone prevent clone array itself (#975)
* fix: basePropsGroup use deepclone prevent clone array itself

basePropsGroup 使用深拷贝方式复制自身

* fix: filter duplicated property
2025-01-02 23:26:31 -08:00
chilingling 77ec192b56 fix: time asc add i18n failed (#976)
* fix: time asc add i18n failed

* fix: search invalid

---------

Co-authored-by: hexqi <wu_12556@126.com>
2025-01-02 23:26:31 -08:00
chilingling a05459ba2d fix: resolve warnings (#957)
* fix: resolve warnings

* fix: add access guard avoid runtime errors

* fix: change placeholder prop type

* fix: resolve type check

* fix: toolbarbaseicon props default value
2025-01-02 23:26:31 -08:00
chilingling 028b80873c fix: resolve some schema update issue (#956)
* fix: resolve some schema update issue

1. 调整画布宽度时,画布选中框不及时更新的 bug
2. 空页面的时候,拖拽组件到画布提示两次新建页面的 bug
3. importSchema 的时候,清空选择
4. 页面 schema 保存的时候,设置保存状态为 false
5. 增强 AdvanceConfig 配置对 props 的容错

* fix: updateRect async change to callback style

* fix: first time enter app should show empty page warning
2025-01-02 23:26:31 -08:00
chilingling 403620b34b fix: chore bug fix for v2.1 (#953)
1. 修复清空画布报错的 bug
2. 修复区块加载错误的 bug
3. 修复画布拖拽组件到最前面的时候,组件会消失的  bug
2025-01-02 23:26:31 -08:00
chilingling 18bb652f66 feat: add pull request base branch release/* (#954) 2025-01-02 23:26:31 -08:00
Hexqi a6b7892f98 chore: update version to 2.1.0-rc.0 (#947) 2025-01-02 23:26:31 -08:00
Gene 8fabfccfa7
fix: fix param type error when create group (#985) 2025-01-02 11:56:36 +08:00
lichunn 9e94f30fda
feat: Adjust the routing structure to increase the name (#974)
* feat: 调整路由结构为增加name,redirect也改成{name}

* fix: fix review

* fix: fix review
2025-01-02 11:18:55 +08:00
lichunn 84a403f693
feat:preview multi page structured data transfer and nested display (#978)
* feat:预览多页结构数据传输以及嵌套显示

* fix:获取链路页面兼容页面树为空的情况

* fix:fix review
2025-01-02 09:55:26 +08:00
rhlin 304e010cfd
feat: add navigation snippet (#968) 2024-12-27 17:51:56 +08:00
rhlin 98dbd02808
fix(canvas/render): fix unsubscribe error (#962) 2024-12-27 17:51:00 +08:00
yy 902790229b
Fix: preview URL (#966) 2024-12-27 16:03:17 +08:00
rhlin eb461658d5
fix(canvas-render): fix page-getter no 'return' vNode result in empty page (#961) 2024-12-26 16:21:11 +08:00
rhlin aeb13234fc
Feat support router subpage (#935)
* refactor(canvas/render): ts support,  separate context functions from RenderMain and Render

* feat(canvas/render): move context to page-block-function, unify parseList type, separate isObject-parser into 3 parsers

* feat(canvas/render): add RouteView built-in component

* fea(canvas/render): multiple instantiable RenderMain, handle multi page scoped css, add RenderView logic to render, add page-getter, extra useLocale

* chore: modify eslint rules for ts files

* build(canvas): fix file extension name for build file

* feat(canvas/render): support router page data fetch and render

* fix(canvas/render): fix modify parent page and switch to child page, child page's parent view is not updated to latest version

* feat(canvas/render): add builtin router-link material

* fix(canvas/render): fix when page ancestors contain number id cause recursive load pathFromRoot[0] page issue

* fix(canvas/render):  inactive page  should not inject placeholder for empty children, remove builtin CanvasBox placeholder

* feat(plugins/materials): useResource when no pageId, after fetching default schema, update page id in location params

* fix: fix review comments,enhance readability, remove unnecessary packages, fix unsubscribe topic no callback function issue

* fix(canvas/render): rename historyChanged to locationHistoryChanged

* fix(canvas/render): fix review comments, remove unnecessary import, add data error fallback/read protection, fix function params type declare

* fix(canvas/render): rename historyChanged to locationHistoryChanged miss 1 file
2024-12-26 14:17:32 +08:00
Gene ad794d83da
feat: page tree supports dragging (#948)
* feat: add layer line to node tree

* feat: draggable tree

* feat: save immediately after dragging

* add hover style(demo)

* feat: add lock, home icons

* fx routing path issues

* move updateTreeData to the finally block

* fix generateTemplate execution error

* fix default value incorrect in create new folder form
2024-12-24 16:18:18 +08:00
lichunn 3ac010bd1b
feat:route code output (#937)
* feat: 调整路由出码结构

* feat: 添加RouterView组件出码测试

* feat:路由出码忽略文件夹

* fix:去掉注释

* feat: 调整路由出码递归方式

* fix: 调整格式

* fix:修复路由component出码为字符串问题
2024-12-23 14:58:33 +08:00
chilingling 7716dda7b7
feat: blockCompiler (#906)
* feat: blockCompiler

* feat: block compile to blobURL

* feat: block-compiler

* fix: add dev alias

* fix: del unnecessary comments

* feat: del old block web component logic

* fix: scope id error

* feat: del umd block support

* feat: del block deploy progress bar

* feat: del block progress request

* fix: del customElement relative logic

* feat: add block loading and error status view

* fix: select blockSchema by historyid

* fix: block schema should select by version

* feat: add block compile cache

* fix: add source code cache

* fix: add default material import map

* feat: update builtin-component version

* feat(block-compiler): support compile jsx

* feat: support block compileCache

* feat: update block version slient refresh

* fix: update @vue/babel-plusin-jsx version

* fix: type checking

* fix: typescript build error

* fix: imporve type checking

* feat: use new block compile cache realize

* fix(block-compiler): remove deps order check

* fix: use has method check the specified key exists in the map instead of get method

* fix: optimize deps

* fix: update cache name params

---------

Co-authored-by: hexqi <wu_12556@126.com>
2024-12-20 11:29:30 +08:00
chilingling cff74bb791
feat: schemaDataAsync (#885)
* feat: schemaDataAsync

* fix: adapt schema plugin

* fix: add import export schema

* fix: remove useless code

* fix: shcmea change cant't trigger canvas rerender

* fix: replace setSchema

* refactor: schema data sync to canvas

* refactor: change synchoronized method between canvas and host

* fix: remove useless node tree

* fix: support recursive update attr

* feat: support recursive update nodesMap

* fix: selectNode updateRect conflict

* refactor: sync update to schemaService

* feat: migrade canvas collection

* fix: dataSourceMap update

* feat: add docs

* fix: add direct change schema api doc

* fix: use toRaw optimize performance

* fix: add default fallback for changeProps

* fix: schema update issue

* fix: add compatible for empty children

* fix: provide schemaUtils to canvas

* fix: update collection table data

* fix: add error handling
2024-12-20 10:01:37 +08:00
lichunn 9f9447df5d
feat:UI specification adjustment (#938)
* feat: 添加页面初始间距

* feat: 调整间距配置

* feat: 调整样式面板字体交互

* feat: 调整CanvasRowColContainer组件间距

* feat: 画布页面添加背景色

* feat: 区块组件添加间距

* feat: 添加样式字符串转对象方法

* feat: 添加基础样式类

* feat:添加弹性盒子组件

* feat: 调整flexBox组件

* feat: 增加Section组件以及清空画布保留基础样式

* fix:样调整时增加基础类名判断

* fix:修复在样式面板选择样式时,两个类名同时改动

* fix:调整容器默认内容样式

* fix:容器组件名以及属性改为中文
2024-12-19 19:50:43 +08:00
Gene 7360072de0
feat: Support merging categories and groups (#907)
* feat: support merge categories and groups in blocks

* add extra param to groups get request

* fix create block error

* undo changes in registry.js

* fix: Fixed the problem of using function references directly for conditional judgment
2024-12-19 19:49:53 +08:00
Gene 15d940083b
feat: page support nested routers (#932)
* feat: page support setting folder or page as parent

* remove css important syntax

* remove redundant code

* add row actions

* add getPageNodeData api

* add getAncestors API in usePage.js
2024-12-19 09:22:02 +08:00
xuanlid eb76a70819
fix: Modify UI review comments (#916)
* fix:Modify Code Font in bridge/state

* fix:modify the block list style in block

* fix:Modify schema panel style

* fix:Modify tabs in materials

* fix:Modify global dialog, modal and search

* fix:Modify the component list style in materials

* fix:Modify button style

* fix:Modify search in i18n

* fix: Modify UI in Schema Panel

* fix:Modify dialog style and i18n Panel shadow

* fix:Modify the component list style in materials

* fix:Modify the block list style in block

* fix: Modify modal style

* fix: Modify modal in clean

* fix: Modify modal in block

* fix: Modify the block list and modal in block

* fix: modify the block list in block

* fix: modify font size

* fix: Modify global button

* fix: delete comment code

* fix: change plugin-icon-js.svg
2024-12-17 15:53:14 +08:00
chilingling 230b3341d8
fix: preview should not overwrite mainFile (#920) 2024-12-16 14:15:12 +08:00
betterdancing 6b20d26bd5
fix(style-panel): resolve style-panel styles issue (#924)
1. 调整了tabsGroupConfigurator组件的一些颜色问题;
2. 修改所有大写的PX为小写;
3. 工具栏中调整屏幕大小的组件的弹窗内容样式全部丢失,重写了这部分样式;
4. TinyGrid组件的表格列编辑弹窗样式丢失,重写了这部分;
5. 属性面板和样式面板部分Label色值不对,统一修改;
6. 样式面板原有引用的部分颜色变量失效,重新替换;
2024-12-13 15:59:07 +08:00
Gene 5e6e6a53b8
fix: optimize bind-i18n styles (#925)
优化属性面板绑定国际化UI
2024-12-13 11:42:25 +08:00
Gene 0a308db98d
feat: support checking all blocks in material add block panel (#923)
物料插件-区块分组-添加区块,区块列表没有全选功能

改动点:
1. 给区块列表添加全选功能
2. 抽取了一个 SelectAll 组件到 common 包
2024-12-13 11:41:17 +08:00
wenmine e1806b3ec0
feat(theme): change datasource and setting panel theme variable
1. 对齐数据源、右侧属性面板的全部模块变量
2. 将数据源和属性面板部分文件里的变量滥用调整先调整为common变量
2024-12-13 11:36:42 +08:00
chilingling 923ad6cc16
fix: slot should extra params (#919)
* fix: slot should extra params

* fix: add unit test case

* fix: change test schema fileName
2024-12-12 14:27:34 +08:00
chilingling eee70e1796
v2.0.0 (#934) 2024-12-12 09:44:37 +08:00
Gene 0c3c989f4a
feat: update block filters UI in materials (#914) 2024-12-10 19:42:22 +08:00
chilingling d45eb4b567
fix: state & globalState getter (#930)
* fix: state & globalState getter

1. 修复 state getter、setter 无法保存、修改的bug
2. 修复 globalState getter 在画布计算不正确的 bug

* fix: del useless variable
2024-12-10 19:22:28 +08:00
lichunn 1dc492a755
fix: fix exportName mismatch (#929)
修复 TinyPopeditor 和 TinyBreadcrumb 物料配置错误的 bug
2024-12-06 17:05:30 +08:00
wenmine 3421b0ffb0
feat(theme/baseVariable): change base variable and common variable (#926)
* feat(theme/baseVariable): change base variable and common variable

* feat(theme/baseVariable): change base variable and common variable review
2024-12-06 10:17:07 +08:00
chilingling dee65eb9fc
v2.0.0-rc.4 2024-12-04 03:26:30 -08:00
chilingling 983b5108b7 fix: remove redundant block update call 2024-12-04 17:57:37 +08:00
chilingling 3dbd42a1a4 fix: change i18n import path 2024-12-04 17:57:37 +08:00
ZIA f0dce41a32 fix: The lock api does not call pageService's update method correctly (#883) 2024-12-04 17:57:37 +08:00
chilingling 2d1f45396f fix: parse template name error (#880)
* fix: parse template name error

* fix: add detection for test env
2024-12-04 17:57:37 +08:00
lichunn c30de12191 fix:Popeditor configuration issue (#881) 2024-12-04 17:57:37 +08:00
chilingling 4a6e65115b fix: datasource remote result could not reshow again after edit (#847)
修复远程数据源面板请求结果输入框在编辑之后,重新点击发送请求,如果请求结果一样,无法重新填充到请求结果输入框的
bug
2024-12-04 17:57:37 +08:00
chilingling 573bd10e25 fix: blockName regexp incorrect (#852)
* fix: blockName regexp incorrect

* fix: change regexp by review

* fix: change by review

* fix: change by review comment
2024-12-04 17:57:37 +08:00
chilingling 8bfa0a4eee fix: change namespace 2 export module (#837)
* fix: change namespace 2 export module

* fix: add missing type params
2024-12-04 17:57:37 +08:00
chilingling 273cd37239 fix: save page updateTreeData error (#839) 2024-12-04 17:57:37 +08:00
tianxin 2d74f19707 fix:table slot edit params should not get alert (#802)
* fix:table notch saving error message

* fix: change slotparams cause warning

* fix: change by review

* fix: typo parma -> param

---------

Co-authored-by: chilingling <michaelchiling1024@gmail.com>
2024-12-04 17:57:37 +08:00
betterdancing e57905ee06 fix(block): 新建区块保存后发布区块,发布无效 (#438)
* fix(block): 新建区块保存后发布区块,发布无效

* fix: del useless null check

---------

Co-authored-by: chilingling <michaelchiling1024@gmail.com>
2024-12-04 17:57:37 +08:00
zhengjg 48dbb43398 feat(vue-generator): add public floder, support image generation (#660)
* feat(vue-generator): add public floder, support image generation

* feat(vue-generator):  code add public floder, support image generation
2024-12-04 17:57:37 +08:00
chilingling fb896f3439 fix: page or block save update breadcrumb incorrectly (#820)
* fix: page or block save update breadcrumb uncorrectly

1. 修复页面名称更新时,面包屑页名称没有同步更新的 bug
2. 修复区块保存更新时,强行切换当前画布到正在编辑区块的 bug
3. 修复区块保存更新时,如果画布不是当前编辑的区块,仍取截图的 bug

* fix: add handlePageUpdate mehtod missing params
2024-12-04 17:57:37 +08:00
chilingling 1718e0c76b fix: mock block data response data missing data attribute (#818)
修复 mockService 区块详情缺失 data 嵌套结构导致无法正确加载的 bug
2024-12-04 17:57:37 +08:00
tianxin 2b03c9c45d fix:batch delete unintelligent (#795) 2024-12-04 17:57:37 +08:00
chilingling 7b3437e236 fix: switch selected component event name list still show the origin one (#757)
* fix: switch selected component event name list still show the origin one

修复画布切换选择组件后,高级面板事件列表仍然显示原组件事件列表的bug
close #747

* fix: handle potential undefined values in renderEventList

* fix: use locale instead of zh_CN attr
2024-12-04 17:57:37 +08:00
chilingling 7a753ca917
fix: sync material to cli (#921) 2024-12-04 16:02:26 +08:00
chilingling 7d0956ff34
feat/buildin com mjs format (#918)
* feat: builtinComp output mjs format

* fix: change pkg json entry
2024-12-04 10:25:03 +08:00
chilingling 9e799e702a
v2.0.0-rc.3 2024-12-02 17:27:43 -08:00
yy 49f68c3c92
fix: fix materials panel (#909)
* fix: fix materials panel

* fix: replace fixed icon

* fix: persistent fixed panels

* fix: review

* fix: review

* fix: review

* fix: 消除同源设计器storage影响
2024-11-28 15:17:07 +08:00
lichunn f1b3b5009c
fix: preview compatibility i18n is null (#912)
* fix: preview compatibility i18n is null

* fix: fix review
2024-11-28 09:29:47 +08:00
chilingling bc501cf52c
fix: monaco editor cursor mismatch caused css font-size (#905) 2024-11-18 16:06:34 +08:00
lichunn ef582f852e
fix:adjust some styles (#884) 2024-11-14 16:28:13 +08:00
lichunn c4cf60643a
fix:the second level panel style of attributes (#903)
* fix:修复属性二级面板样式问题

* fix:fix review
2024-11-14 16:24:39 +08:00
James a9bec90a83
fix: modify button padding (#894) 2024-11-14 16:24:15 +08:00
chilingling 67330d419f
v2.0.0-rc.2 2024-11-11 04:08:31 -08:00
yy f135499035
Feat: add refresh life cycles (#898)
* fear: add refresh lifeCycles

* feat: add canvas flag

* fix: spell

* fix: review

* fix: review

* fix: review
2024-11-11 16:50:29 +08:00
lichunn 2b2b685d87
fix:missing outline tree eyes icon (#900)
* fix: 修复大纲树显示隐藏按钮重叠问题

* fix: 调整大纲树眼睛控制状态
2024-11-11 14:42:07 +08:00
chilingling 5279ef1718
fix: del unnecessary scripts (#849) 2024-11-11 09:34:23 +08:00
lichunn 79199104bb
fix: 调整编辑器样式 (#901) 2024-11-08 18:02:47 +08:00
betterdancing ea73bff42f
feat(style-panel): modify this style-panel styles according to the design craft (#853)
* feat(style-panel): 根据设计稿修改样式面板的UI

* feat(style-panel): 根据设计稿修改样式面板的UI

* feat(style-panel): 根据设计稿修改样式面板的UI

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): modify this style-panel styles according to the design craft

* feat(style-panel): add style-panel can be collapsed or expanded

* feat(style-panel): modify tabGroupComponent style error;

* feat(style-panel): 对其设计稿后修改部分样式

* feat(style-pane): 修复部分样式颜色和间距问题

* feat(style-panel): 修复eslint报错问题

* feat(style-panel): 修改review意见

* feat(style-panel): 修复AI的review意见

* feat(style-panel): use color variables insteads color values;

* feat(style-panel): fix AI reviews;

* feat(style-panel): fix AI reviews

* feat(style-panel): 修改颜色变量--ti-base系列为--te-base

* feat(style-panel): fix item width error

* feat(style-panel): fix review error

* feat(style-panel): use buttonGroup & dorpDown replace tabsGroupComponent elements;

* feat(style-panel): adjust the spacing font to non-italic, the spacing of the ModalMask pop-window to 20px, and the closing icon to 16px;

* feat(style-panel): fix the color variables;

* feat(style-panel): Modified review comments: color variables; numeric component; optimized;

* feat(style-panel): Resolved the remainning styles issues

* feat(style-panel): fix some reviews

* feat(style-panel): Resolved the remainning styles issues

* feat(style-panel): fix some reviews

* feat(style-panel): fix some reviews

* feat(style-panel): fix some reviews

* feat(style-panel): add style panel collapsed or expand icon

* Create style-panel-expand.svg

feat(style-panel): add expand icon of style collapsed tab

* Create style-pabel-collapsed.svg

feat(style-panel): add collapsed icon of style panel collapsed tabs

* Delete packages/design-core/assets/style-pabel-collapsed.svg

* Create style-panel-collapsed.svg

* feat(style-panel): modify some icon color

* feat(style-panel): fix some reviews

* feat(style-panel): fix some reviews

* feat(style-panel): fix some reviews

* feat(style-panel): fix some reviews
2024-11-08 14:26:30 +08:00
chilingling ea0440b4ed
v2.0.0-rc.1 2024-11-06 04:05:46 -08:00
yy d019814580
Refactoring useHttp to httpService (#886)
* refactor/http-service
2024-11-06 17:48:54 +08:00
chilingling d158fcd9aa
v2.0.0-rc.0 2024-10-30 22:49:04 -07:00
chilingling d283c5ad83
v2.0.0-alpha.6 2024-10-30 07:09:51 -07:00
betterdancing fb1a2f9f75
fix(page-setting): Use the meta options injection method to each component of the page module. (#890) 2024-10-30 21:52:01 +08:00
wenmine 10dca1d753
fix(refactor/styles): fix property panel styles and common styles (#887)
* fix(refactor/styles): fix property panel styles and common styles

* fix(refactor/styles): fix property panel styles and common styles review

* fix(refactor/styles): fix property panel styles and common styles review
2024-10-30 21:12:12 +08:00
chilingling 48687e8731
feat: editorInfo migrate to globalService (#702)
* feat: editorInfo migrate to globalService

* feat: change to signal event

* refactor: useApp migrate to globalService

* refactor: optimize globalService state structure

* feat: metaservice provide default apis: getState and setState

* feat: poc refactor

* feat: service poc improve

* feat: improve service definition

* feat: reduce the props exposed by service

* fix: rebase to latest code

* fix: change by review comment

* fix: change import name

* fix: use constant var instead of string

* fix: adjust import order

* fix: add unsubscribe logic

* change by review

* fix: change by review comment

* fix: add initTimeout check

---------

Co-authored-by: gene9831 <pacify.98@gmail.com>
2024-10-26 17:46:21 +08:00
Gene 4697f07885
refactor(styles): rewrite block styles (#868)
* refactor(styles): rewrite PageTree styles

* refactor(styles): rewrite some block styles (#1)

refactor(styles): rewrite some block styles

* Fix/new UI lc (#2)

fix/new ui

* fix some styles

* fix some styles

* fix styles

* fix potential issue

* refactor by comments

* fix some issues

* fix some style issues

* fix some style issues
2024-10-25 17:26:47 +08:00
lichunn fb0092040d
feat: Editor full screen with title, close button, and examples (#866)
* feat: 状态管理插件的编辑器全屏加上标题、关闭按钮和示例

* fix: 抽取编辑器全屏头部组件

* fix: 抽取变量
2024-10-25 17:09:52 +08:00
chilingling add50e9750
v2.0.0-alpha.5 2024-10-23 04:59:25 -07:00
lichunn 6a736b66b0
fix some detail styles in the plugins (#831)
* fix: panel组件间距调整

* feat: page management ui redesign

* feat: block ui redesign

* fix: 去掉选择区块高亮

* feat: 数据源样式调整

* feat: 数据源交互调整

* feat: 帮助样式整改

* feat: AI功能样式调整

* feat: 资源管理、状态管理样式整改

* feat: 国际化样式调整

* feat: 头部、按钮、图标细节调整

* feat: 样式细节调整

* feat: 样式细节调整

* fix:面包屑区分区块和页面

* fix:调整帮助面板间距颜色

* fix: 页面管理间距调整

* fix: 历史备份样式调整

* fix: 数据源/状态管理下拉调整

* fix: 全屏图标位置调整

* fix:去掉工具栏左侧面包屑边框

* fix: fix review

* fix: fix pageInputOutput review

* fix: fix review

* fix: codeEditor添加插槽

* fix: 物料样式调整

* fix: 部分bug修复

* feat: 调整区块设置编辑交互

* fix: 全屏后图标游离

* fix: 调整区块列表高度

* fix: 调整AI输入框边框

* feat: 调整添加区块搜索框

* fix: 调整暂无数据样式

* feat: 调整添加区块样式

* fix: 调整合并公共组件后的区块间距

* fix: 调整合并组件后的页面区块间距

* fix: 调整数据源间距

* fix: 调整数据源静态数据样式

* fix: fix review

* feat:图标更新

* fix:修复区块遮挡

* fix: fix review

* fix: 点击编辑区块

* fix: 修改tiny-tree空数据字体颜色

* fix: 调整notify图标文字上下居中

* fix: 点击更多面板,保存下拉面板收起

* fix:调整tooltip样式

* fix:调整保存按钮气泡显示方式

* fix: 调整tooltips阴影

* fix:调整色值变量

* fix:修改编辑器全屏层级

* fix;去掉svg多余注释

* fix: fix review

* fix:fix review
2024-10-22 14:23:03 +08:00
betterdancing 399b9ade74
Feat(page): Add exporting components and APIs for page component to support page template extension (alpha version) (#797)
* feat(page): 新增页面管理导出components,扩展AstroPro页面模板功能

* Feat(page): 删除pageMain.vue,如需扩展直接使用entry

* feat(plugin-page): pageSetting暂时修改以适配扩展改造

* feat(plugin-page): pageSetting暂时修改以适配扩展改造

* feat(plugin-page): 修改api数组为对象格式
2024-10-22 10:10:50 +08:00
yy 2dfda14a39
fix: preview error (#862) 2024-10-18 10:32:46 +08:00
chilingling 87c6dd1b74
feat: remove generate code from mock server (#823)
* feat: remove generate code from mock server

* fix: replace a standard http code 410

* fix: rm useless constructor code suggested by review
2024-10-15 19:21:44 +08:00
chilingling 14f9f41f9f
bump version 2024-10-15 02:12:55 -07:00
Gene 1a75cd413c
refactor(styles): apply new styles to props panel (#830)
* refactor: apply new styles to props panel
2024-10-15 15:41:27 +08:00
yy 045b913d19
fix: catch script error (#858)
修复打开页面JS时,解析报错阻塞插件弹窗打开的问题
2024-10-15 10:10:22 +08:00
James bbed9dc476
fix(theme): modify collapse-item border (#851) 2024-10-15 10:01:04 +08:00
chilingling 0e8dc1faaa
fix: cli generate platform issue (#859)
1. 修复生成的平台模板仍然使用 useResourceAlias 配置的 bug
2. 修复生成的 package.json 未格式化的 bug
2024-10-15 09:16:34 +08:00
yy a50825514e
fix: canvas srcdoc (#856) 2024-10-14 15:34:06 +08:00
chilingling 20aba1ffa8
bump version 2024-10-11 00:54:30 -07:00
yy 6c4227e2a2
feat: customized canvas entry (#850)
* feat: customized canvas entry

* feat: export conditions

* feat: delete vue params

* feat: add beforeSaveMethod

* feat: add hooks

* fix: review

* fix: review

* fix: cjs

* fix: eslint

* fix: review

* fix: reset cjs

* fix: load render.css
2024-10-10 19:11:19 +08:00
James 4111db528c
fix: improve the style priority of overwriting tinyvue (#848) 2024-10-10 15:15:13 +08:00
chilingling 6f9ab482d1
fix: add style import to bundle (#838) 2024-09-30 17:05:41 +08:00
wenmine ff3695a44d
feat(style): modify advance panel ui (#826)
* feat(style): modify advance panel ui

* feat(style): modify button margin

* feat(style): modify button margin

* feat(style): modify button margin

* feat(style): modify button margin
2024-09-30 16:09:46 +08:00
Gene fbb42d2dff
refactor: sync designer template (#836) 2024-09-30 15:39:21 +08:00
Gene e6269182ac
feat: labelPosition support 'auto' (#835) 2024-09-30 15:38:45 +08:00
betterdancing 158310bf48
feat(toolbars): use toolbar base component in toolbar plugins (#798)
* fix(toolbars): 对于工具栏的定制化的改动,图标可替换,且可以替换展示方式(图标或按钮),同事按钮可以传入属性和样式

* fix(toolbars): 对于工具栏的定制化的改动,图标可替换,且可以替换展示方式(图标或按钮),同事按钮可以传入属性和样式

* fix(toolbars): 对于工具栏的定制化的改动,图标可替换,且可以替换展示方式(图标或按钮),同事按钮可以传入属性和样式

* feat: 工具栏定制化改造

* feat(toolbars): 头部工具栏改造,新增公共可引入组件

* feat(toolbars): package.json添加layout依赖

* feat(toolbars): 头部工具栏改造,导出toolbar公共组件

* feat(toolbar): 修复review意见,将配置项移动到options中

* feat(toolbar): 删除工具栏组件冗余属性,采用了import原组件并定制的方式扩展其余属性

* feat(toolbar): 处理工具栏代码冲突

* feat(toolbar): 修改公共toolbar组件名称,并移到common目录下

* feat(toolbar): 修改部分review意见

* feat(toolbar): 默认工具栏按钮移除边框
2024-09-29 17:21:43 +08:00
chilingling 046dca43fd
fix: add missing deps (#821) 2024-09-28 19:02:41 +08:00
chilingling 9707834fa9
fix: add block panel can't open (#827)
* fix: add block panel can't open

* fix: blockgroup select

* fix: support vue3.5 below version
2024-09-28 17:28:09 +08:00
chilingling f02d458cb6
bump deps version (#816) 2024-09-27 16:03:55 +08:00
wenmine d327eafb89
feat(theme): component style && common theme (#814)
* feat(theme): component style && common theme

* feat(theme):  merge refactor/develop

* feat(theme): common theme & fix review

* feat(theme): common theme & fix review

* feat(theme): common component review

* feat(theme): check color and fix

* feat(style): modify style panel widget margin && style

* fix(style): fix style layout no working

* fix(style): fix review

* fix(style): fix review

* fix(style): fix review

* fix(style): fix review

* fix(style): fix review

* fix(style): fix review
2024-09-26 17:23:55 +08:00
lichunn 0cf81e2d6b
feat:sort out the status and API of the layout (#736)
* feat: add grouping to toolbar

* feat:sort out the status and API of the layout

* fix:remove unused bags

* fix: DesignToolbars改用getMergeMeta

* feat: 工具栏布局调整

* feat: toolbars右侧和下拉列表兼容一维和二维数据

* fix: fix review

* feat: 删掉工具栏align字段
2024-09-26 16:08:44 +08:00
chilingling ef2f8317e4
bump version (#813) 2024-09-24 20:53:04 +08:00
Hexqi 8213973508
chore: sync dev to refactor (#808)
* fix(mockServer): mockServer page preview can't render element-plus element (#503)

* fix(style): fix render error caused by inline style breaks (#526)

* fix(metaComp): fix bug where metaHtmlText could set value to incorret schema children (#473)

* fix(vue-generator): fix globalstate codegen error (#547)

* fix(material): add componentsMap to app Schema after material build (#527)

* fix: slot params missing double quote (#605)

* fix: slot params missing double quote

* fix: exclude nodemodule test case

* fix: 修复onMouseover拼写错误 (#662)

* fix: esbuild install failed on node v16 (#668)

* fix: esbuild install failed on nodev16

* fix: esbuild install failed on nodev16

* fix: builtin components can't generate import statement with genSFCWithDefaultPlugin method (#656)

* fix: esbuild install failed on nodev16 (#671)

* fix: esbuild install failed on nodev16

* fix: esbuild install failed on nodev16

* fix: remove deps on root pkg.json

* fix(preview): multiple nested blocks cannot preview #663 (#665)

* fix(material): add missing componentsMap to mockServer (#701)

* fix(setting): fix bindEvent dialog visible can't work on tinyvue 3.17 (#715)

* feat(download-code): support download zip for not support browsers (#703)

* feat(download-code): support download zip for not support browsers

* feat(download-code): support download zip for not support browsers - review

* feat(download-code): support download zip for not support browsers - review

* docs: update milestone (#728)

* docs: update milestone

* fix: tab

* fix: abaolute canvas init inlineStyle should be string (#730)

* fix(download): Optimize download logic and adapt to iframe (#739)

* fix(download): Optimize download logic and adapt to iframe

* feat(cdn): change cdn from onmicrosoft to unpkg (#750)

* fix: 隐藏画布根节点的包裹元素的操作选项 (#492)

* fix(script): translate log (#549)

* fix: translate log

* Update scripts/connection.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update scripts/connection.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update scripts/connection.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: reset spacing cannot generate correct source code (#657)

* fix: jsx slot modelvalue can't update value (#734)

* fix: jsx slot modelvalue can't update value

* fix: add unit test for updateModel event

* fix(canvas): absolute dnd update position to schema. close #664 (#751)

* fix(generate-vue):修复出码文件选择界面打包后样式丢失问题 (#789)

Co-authored-by: wangwenbing <11535041@qq.com>

* fix(stylePanel): fix setting border-radius could not work on first time (#481)

* fix(common): fix verify required (#787)

* fix: mixed lifeCyclesContent when empty lifecycles (#810)

close #806
修复生命周期为空时,取当前页面schema生命周期值的 bug

---------

Co-authored-by: chilingling <26962197+chilingling@users.noreply.github.com>
Co-authored-by: yeser <631300329@qq.com>
Co-authored-by: wenmine <wwmmail@foxmail.com>
Co-authored-by: Gene <Pacify.98@gmail.com>
Co-authored-by: yaoyun8 <142570291+yaoyun8@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: bwrong <ibwrong@foxmail.com>
Co-authored-by: wangwenbing <11535041@qq.com>
Co-authored-by: Xie Jay <xiejay97@gmail.com>
2024-09-24 20:14:30 +08:00
betterdancing c16126176e
feat(bundle): update label and description of bundle.json (#812)
* feat(bundle): 修改bundle里物料属性的label

* Update useMaterial.js

* feat(bundle): 修改bundle.json中物料的属性label和desc,使属性面板显示中文label

* feat(bundle): 修改bundle.json中物料的属性label和desc,使属性面板显示中文label

* feat(bundle): 修改bundle.json中物料的属性label和desc,使属性面板显示中文label
2024-09-24 20:10:40 +08:00
lichunn 49fc8bc6f9
feat: page management and block ui redesign (#740)
* fix: panel组件间距调整

* feat: page management ui redesign

* feat: block ui redesign

* fix: 去掉选择区块高亮

* feat: 数据源样式调整

* feat: 数据源交互调整

* feat: 帮助样式整改

* feat: AI功能样式调整

* feat: 资源管理、状态管理样式整改

* feat: 国际化样式调整

* feat: 头部、按钮、图标细节调整

* feat: 样式细节调整

* feat: 样式细节调整

* fix:面包屑区分区块和页面

* fix:调整帮助面板间距颜色

* fix: 页面管理间距调整

* fix: 历史备份样式调整

* fix: 数据源/状态管理下拉调整

* fix: 全屏图标位置调整

* fix:去掉工具栏左侧面包屑边框

* fix: fix review

* fix: fix pageInputOutput review

* fix: fix review

* fix: codeEditor添加插槽
2024-09-23 20:37:01 +08:00
chilingling 80a36d656a
bump alpha version (#793)
* bump alpha version

* fix: add public access config

* bump version 2.0.0-alpha.1
2024-09-09 23:59:44 +08:00
Hexqi 2a5f34642c
feat(canvas): add the renderer extension capability (#718)
特性
画布create增加lifeCycles配置,添加beforeAppCreate与appCreated钩子
画布添加getRender/setRender API

---------

Co-authored-by: yaoyun8 <142570291+yaoyun8@users.noreply.github.com>
2024-09-09 15:56:12 +08:00
Hexqi 1700d3c922
fix: optimize block and material scalability issue (#788)
当前问题
从用户注册表去掉区块模块后会报错无法启动,解决该报错后,画布中依然存在了新建区块的入口,且物料插件面板报错无法展开
物料模块没有导出加载bundle.json物料的api,不太方便使用

解决方法
从common包中移除SaveNewBlock组件,画布模块从区块注册表获取组件
物料插件根据区块模块存在情况渲染区块面板
物料模块导出增加addMaterials API,传入bundle对象即可加载物料
遗留
物料插件中要隐藏区块依然需要配置注册表,没有实现自动关联
2024-09-05 14:03:43 +08:00
Hexqi 1ed870cca6
feat: optimize material group (#765)
物料分组相关优化
组件物料分组显示中文,添加label字段
调整新分组与TinyVue组件分组一致:布局与容器、基础元素、高级元素、表单、表格、导航、数据展示、ElementPlus
删除与TinyVue组件重复的HTML组件及HTML分组:button、img、table、form,部分HTML移入基础元素
TinyRow与TinyCol合并为 栅格布局组件
添加物料时支持合并snippets分组
物料分组不区分 内置组件、HTML组件
其他:部分代码优化、规范物料文件格式
2024-09-03 15:03:42 +08:00
Hexqi 591ff8e171
refactor: rename plugin name (#771)
规范插件包名称
工具栏generate-vue插件改名为 generate-code(不限定生成vue代码,传入不同的出码服务可以生成不同技术栈代码)
状态管理插件plugin-data改名为plugin-state,更符合语义
工具栏锁定插件toolbar-checkinout改名为 toolbar-lock,更易理解(当前图标早已切换为lock,而不是之前的checkin和checkout)
2024-09-03 14:11:05 +08:00
Gene 3eb2ecd039
fix: github action build too slow (#779)
* fix: github action build too slow

* fix: github action build too slow

* Revert "fix: github action build too slow"

This reverts commit bc23ee5ed1b103275704899c6cda629daf4ce1be.

* fix: patch vite-plugin-svg-icons. add cache for frequently calling fast-glob.sync in function compilerIcons

* update push-check.yml

* update push-check.yml

* test svg

* test svg

* try silent mode

* log to file

* revert some files
2024-09-02 09:42:59 +08:00
chilingling 516c35ff54
fix: add packages desc for lerna (#655)
* fix: add packages desc for lerna

* fix(engine-cli): template pkg name duplicate with demo pkg name
2024-08-30 14:06:58 +08:00
Gene e3721074ec
fix: width of i18n plugin is not enough (#773) 2024-08-30 09:37:41 +08:00
Hexqi ab783d8835
chore: add auto labeler workflow (#758)
* chore: add auto labeler workflow
添加workflow:提交PR或者修改标题后自动添加/更新 label
自动添加的label包括:
enhancement:标题以feat: 开头
document: 标题以docs: 开头
bug: 标题以fix:开头
refactor-main: 目标分支为refactor/develop
ospp-2024: 目标分支为 ospp-2024/*
2024-08-28 20:16:45 +08:00
Gene fde6eca787
fix(monaco): monaco options not working (#767) 2024-08-28 18:11:37 +08:00
Hexqi 5fa1b2b11c
fix: preview error (#760) 2024-08-27 16:37:20 +08:00
tianxin bf682470c2
feat: Edit code style (#667)
* feat: Edit code style

* feat: Edit code style
2024-08-26 10:50:11 +08:00
Gene 1e856b7731
docs(configurator): add configurator docs (#631)
* docs(configurator): add configurator docs phase one

* docs(configurator): add several docs
2024-08-24 21:37:49 +08:00
tianxin 4b0bf19aaa
feat: Panel tab style (#649)
* Panel tab style

* feat:Panel tab style
2024-08-23 17:56:12 +08:00
lichunn 52d2432d6c
Feat:toolbar style improvement (#755)
* feat: add grouping to toolbar

* feat:sort out the status and API of the layout

* fix:remove unused bags

* feat: 工具栏左侧调整

* feat: 间距调整

* fix: remove methods that do not exist

* fix: 去掉多余配置
2024-08-23 16:49:36 +08:00
rhlin 7a50b542ac
Refactor canvas single vite config (#713)
* fix: sub package.json lack of some packages

* feat: canvas separate build from main app

* fix: design-core reexport makes designer-demo dev without devAlias lack of packages

* feat: support canvas devAlias to source code in designer-demo development

* feat: canvas html add style placeholder

* fix: replace default cdn path to unpkg

* feat: canvas remove tiny-vue build-in material to bundle.json

* feat:  canvas's  block loading share TinyVue and TinyVueIcon with materials, needs to external and add importMap in build & development

* fix: add TinyVue mjs dependencies wait until bundle.json support declare package dependencies

* feat: move canvasDevExternal plugin from designer demo to default config

* fix: add toolbars lock devAlias, fix package error, fix CanvasDevPlugin style link error

* fix: fix duplicate peerDependencies, fix designer demo build prod

* fix: remove wrong path dev alias

* fix:  fix vite-plugin-build-entry emit assets error issue

* fix: canvas remove unnecessary dependencies

* docs(canvas): docs about canvas separate build

* docs(canvas): modify docs for better understanding
2024-08-23 09:34:10 +08:00
Gene 46be85d8a7
refactor: base properties configurable via registry (#555)
* refactor: base properties configurable

* refactor: base properties configurable via registry

* refactor: migrate to useMaterial

* refactor: rename file

* feat: add group and insertPosition options for base properties

* feat: add additional condition

* feat: unifiy 'others' group

* feat: unifiy 'others' label
2024-08-12 16:01:25 +08:00
chilingling f44b525321
fix: self import change to relative import path (#654) 2024-08-09 12:58:32 +08:00
Hexqi 3b20b8b10d
feat(vite-config): devalias support basepath (#711)
* feat(vite-config): devalias support basepath
2024-07-25 21:08:31 +08:00
chilingling 20e7f4f92d
fix: limit max old space size when build (#653) 2024-07-17 11:40:25 +08:00
Hexqi b140357cdd
refactor: replace getPluginApi with getMetaApi (#634)
* refactor: replace getPluginApi with getMetaApi
2024-07-12 09:28:21 +08:00
Hexqi 69d1012fb3
fix: wrong composable usage and spelling (#640)
* fix: wrong composable usage  and spelling
2024-07-12 09:07:04 +08:00
Hexqi e436982a0b
fix: remove material pkg dependency in canvas (#635) 2024-07-11 21:25:51 +08:00
Hexqi 1d3e02bc3f
fix: remove unused package.json dependency (#652) 2024-07-11 21:24:48 +08:00
Gene 9bb27926af
feat(registry): metapp in registry support configuration in array format (#625)
* refactor: metapp in registry support configuration in array format

* feat: add unit tests for preprocessRegistry function

* feat: remove array format configuration for single entry

* fix: remove redundant condition

* fix: add check array condition
2024-07-11 15:44:38 +08:00
Gene 961c8bba61
fix: fix variable configurator missing problem (#645) 2024-07-11 15:43:16 +08:00
Hexqi 4137a4d3f6
fix: cannot pin material plugin (#651)
* fix: cannot pin material plugin
2024-07-11 14:02:28 +08:00
lichunn b8da6052e1
fix: data-source dependency configurator package (#622)
* fix: data-source dependency configurator package

* fix:resolve review

* feat: troubleshooting plugin dependencies

* feat:将CanvasDragItem移到common
2024-07-11 11:30:33 +08:00
chilingling 8c5fc76e4c
feat: add build check (#646) 2024-07-11 11:13:59 +08:00
chilingling e2e9295779
fix: dev without alias error (#647)
* fix: dev without alias error

* fix: usesource alias default to true
2024-07-10 16:13:54 +08:00
chilingling c715a5ad14
feat: engine-cli support create platform with params (#626)
* feat: engine-cli support create platform with params

* fix: add choices for theme

* fix: del unnecessary empty options
2024-07-09 20:33:23 +08:00
tianxin 87169b4197
feat:Theme icon replacement (#630)
* tiny-engine主题icon图标更好

* tiny-engine主题icon图标更好
2024-07-09 15:35:51 +08:00
tianxin ac62498f04
feat: modify style of the toolbars (#596)
* tiny-engine导航栏样式修改

* tiny-engine导航栏样式修改

* tiny-engine导航栏样式修改

* tiny-engine导航栏样式修改
2024-07-09 15:32:30 +08:00
chilingling 38745dff4f
feat: update build script (#638)
* feat: update build script

* feat: update dev script
2024-07-08 18:00:22 +08:00
chilingling 1e699788fb
fix: fix cycle deps between vue-generator and common pacakge (#637) 2024-07-08 17:59:37 +08:00
chilingling eee8b7975a
fix: preserve import.meta.env when compile design-core (#606)
* fix: preserve import.meta.env when compile design-core

* fix: preserve vite_cdn_domain

* feat: preserve more import.meta.env variable

* fix: add api_mock meta env
2024-07-08 17:57:36 +08:00
James 0c6a24821d
feat: add package of opentiny/tiny-engine-theme-base (#624) 2024-07-03 15:06:25 +08:00
Hexqi 0c71520a93
refactor: reduce complexity of transform function (#620)
* refactor: reduce complexity of transform function

* fix: check.yml add exclude file

* fix: code review
2024-07-01 20:57:26 +08:00
wenmine 63a0dcb98f
refactor: extract material-related code to useMaterial from useResource (#591)
* refactor(material): 将物料(组件,区块)从resource剥离出来

* refactor(useMaterial): useResource拆分

* refactor(useMaterial): 机器人review意见修改

* refactor(useMaterial): review意见修改

* refactor(useMaterials): 更新冲突后的调整,以及增加注释

* refactor(useMaterials): review bot

* refactor(useMaterials): review bot

* fix: sync update

* refactor(useMaterials): review bot

---------

Co-authored-by: chilingling <michaelchiling1024@gmail.com>
2024-07-01 20:45:40 +08:00
chilingling d68bf5e32b
fix: add missing dependencies (#619) 2024-07-01 14:32:49 +08:00
lichunn 2501fe75b5
refactor: optimize layout module logic (#600)
* feat:add layout

* feat: 调整layout导入

* feat: 把DesignCanvas移到canvas

* feat: 暂时不改entry

* fix: 添加注释

* feat:layout部分逻辑调整

* fix:调整AI图标

* fix:调整App引用

* feat:抽取Layout全局配置组件

* fix: sync newest change

---------

Co-authored-by: chilingling <michaelchiling1024@gmail.com>
2024-07-01 09:28:52 +08:00
chilingling 5bc3872ee2
fix: mockServer build and add startup script on template (#616)
* fix: moServer build and add startup script on template

* fix: preserve only frontend script on demo
2024-07-01 09:21:25 +08:00
chilingling 48cd8f554e
feat: add simple plugin template (#615)
* feat: add simple plugin template

* fix: change by code review

* fix: includes template and bind file to npm
2024-06-30 19:08:49 +08:00
Hexqi cf0daa18f1
refactor: move controller js and remove package (#617)
* feat: copy js to common
2024-06-30 18:49:37 +08:00
Hexqi 5ad227bfd0
refactor: import composable from register (#614) 2024-06-30 17:21:33 +08:00
Hexqi b48a45c6cc
refactor: rename getPluginApi to getMetaApi (#613) 2024-06-30 16:54:18 +08:00
rhlin 4a4e185209
fix(canvas): resolve outstanding issue of canvas meta app (#604)
* feat: canvas 元应用改造2 (抽取CanvasLayout,面包屑导航去除元应用,api移动到engine.canvas顶层 )

* fix: 解决code check问题

* fix: 修正引用路径错误

* fix: 解决解决merge过程中文件修改丢失

* fix(canvas): 修复元应用改造2遗留问题
2024-06-30 16:40:31 +08:00
Hexqi 2140e8f47d
fix: breadcrumb plugin cannot work in preview mode (#612)
* fix: move useBreadcrumb to correct dir
2024-06-30 16:33:20 +08:00
chilingling 6600a7bc07
feat: add generate code service (#608)
* feat: add generate code service

* feat: move gencodeservice to common package

* fix: change gencodeservice name

* fix: add blank line to md by review comment

* fix: update export name on doc

* fix: update reference of tiny-engine-entry
2024-06-30 15:16:45 +08:00
Hexqi 7823a1343c
refactor: rename package entry to meta-register (#611) 2024-06-30 14:55:37 +08:00
Hexqi 5fb9d04eba
refactor: move global composable to common package (#610) 2024-06-30 14:26:52 +08:00
Hexqi 2831861271
refactor: optimize common package component export (#609)
* refactor: common component
2024-06-30 14:11:25 +08:00
Hexqi f0ff7cc999
refactor: remove useless (#607) 2024-06-30 11:32:49 +08:00
Lu17301156525 bdac3ae7ca
fix: mockserver build (#603)
* fix(mockServer): mockServer page preview can't render element-plus element (#503)

* 修改mockServer打包命令

---------

Co-authored-by: chilingling <26962197+chilingling@users.noreply.github.com>
Co-authored-by: hexqi <wu_12556@126.com>
2024-06-30 09:30:08 +08:00
chilingling 570ccb89d7
feat: add tinyEngineBaseConfig as base viteconfig (#583)
* feat: add tinyEnginePreset as hoc viteconfig tool

* fix: change preset to base config function

* fix: sync change to template
2024-06-29 15:14:06 +08:00
Gene c25fbacc77
refactor: meta components migration phase II (#601)
* refactor: meta components migration phase II

* refactor: rename meta components
2024-06-28 10:45:35 +08:00
Gene a6cc633914
fix: simplify monaco options (#599) 2024-06-26 17:07:05 +08:00
Gene 3258b26c2b
refactor: events meta app support custom common events and components (#586)
* refactor: events meta app support custom common events and components

* refactor: 事件绑定弹窗提取面板左右两部分组件

* fix: remove unnecessary imports

* fix: remove empty function

* refactor: rename component name

* fix: fix theme imports

* refactor: import self meta id
2024-06-26 16:31:21 +08:00
Gene 38f7ca58e4
refactor: add monaco editor default options and setGlobalEditorTheme api (#592)
* refactor: add monaco editor default options and setGlobalEditorTheme api

* refactor: tiny optimization
2024-06-26 16:20:57 +08:00
rhlin 7cf169d734
feat: canvas 元应用改造2 (抽取CanvasLayout,面包屑导航去除元应用,api移动到engine.canvas顶层 ) (#590)
* feat: canvas 元应用改造2 (抽取CanvasLayout,面包屑导航去除元应用,api移动到engine.canvas顶层 )

* fix: 解决code check问题

* fix: 修正引用路径错误

* fix: 解决解决merge过程中文件修改丢失
2024-06-26 16:20:17 +08:00
wenmine 681f03e801
refactor(material): 物料管理插件元应用拆分 (#545)
* feat(toolbars): 工具栏增加meta.js

* feat(toolbars): 工具栏增加vite-plugin-generate-comments

* feat(toolbars): 工具栏增加@opentiny/tiny-engine-entry

* refactor(material): 物料管理插件元应用拆分

* refactor(materials): 物料管理插件review

* refactor(materials): 物料管理插件review

* refactor(materials): 物料管理插件review

* refactor(materials): 物料管理插件review

* component->entry

* refactor(material): review 意见修改

* refactor(materials): review意见修改
2024-06-26 16:19:18 +08:00
Hexqi 56cf39812c
fix: useModal error (#597) 2024-06-26 16:05:26 +08:00
chilingling 54b83536c2
fix: add missing pkg deps (#589) 2024-06-20 17:18:03 +08:00
Hexqi 79a481904f
feat: move composables to module (#569)
* feat: move hooks
2024-06-20 09:47:30 +08:00
Hexqi e1e2664369
feat(cli): add build script & update template (#582)
* feat: cli add build script
2024-06-18 19:56:01 +08:00
Gene 778a916688
refactor: migrate meta components (#536)
* refactor: migrate meta components: BindI18n, BindVariable, CodeEditor, Collection, Color

* refactor: 增加全量的Configurators导出

* feat(configurator): migrate configurator

* fix: fix NumberConfiguratoric to NumberConfigurator

* refactor(configurator): replace meta components imports

* fix: change default value of param configurators of init funtion

* fix: default return empty object

---------

Co-authored-by: chilingling <michaelchiling1024@gmail.com>
2024-06-18 17:05:01 +08:00
Gene da426f8299
refactor(store): add useStore function and rewrite useShareStore (#577)
* refactor(store): add useStore function and rewrite useShareStore

* refactor: rename useShareState to useState

* refactor: update useState tests
2024-06-18 16:34:39 +08:00
Hexqi 4ddb159f7f
feat: registry metaservice (#584) 2024-06-18 14:25:40 +08:00
chilingling d5eaa6d1d5
fix: change tinyvue to peerdependencies (#573) 2024-06-15 15:22:34 +08:00
Hexqi c48cd9d81b
feat: engine export (#579) 2024-06-14 15:34:58 +08:00
Hexqi 43a65d859f
feat(registry): update registry (#578) 2024-06-14 15:34:24 +08:00
lichunn 15db7af60e
Feat/layout (#575)
* feat:add layout

* feat: 调整layout导入

* feat: 把DesignCanvas移到canvas

* feat: 暂时不改entry

* fix: 添加注释
2024-06-14 14:33:37 +08:00
chilingling 02d0e96f11
feat(configurator): migrate configurator (#546)
* feat(configurator): migrate configurator

* fix: fix NumberConfiguratoric to NumberConfigurator

* feat: register all configurator by default
2024-06-14 11:09:54 +08:00
rhlin d56935f7aa
refactor: canvas 元应用改造1 (#576)
* feat(canvas): canvas抽取两个元应用

* fix: 修复canvas导出名字不一致

* feat: canvas元应用抽取初步改造
2024-06-13 20:34:06 +08:00
chilingling ee181ae97d
fix: userinfo change to ref value (#574)
* fix: userinfo change to ref value

* fix: change by review comment
2024-06-13 08:40:58 +08:00
Hexqi 4e6064e1d6
feat: update template (#572) 2024-06-11 17:51:51 +08:00
chilingling 2bc0e42ae5
fix: entry package should share instance with user project (#571) 2024-06-11 16:20:24 +08:00
chilingling d99516b5c0
fix: fix some issue on preview page (#568) 2024-06-11 14:23:06 +08:00
Hexqi e15e6c4662
fix: tiny-engine alias (#567) 2024-06-11 11:37:57 +08:00
chilingling bc6e495612
feat: add build step to tiny-engine package (#566) 2024-06-11 09:32:04 +08:00
Hexqi d7d4d8feb2
feat: registry add themes (#565) 2024-06-08 20:10:27 +08:00
Hexqi 5636b85fa0
feat: remove env dir and add config (#564)
* feat: remove env
2024-06-08 16:03:43 +08:00
chilingling 80fd0a0626
fix: del multiple path on esbuild copy (#563) 2024-06-08 14:43:22 +08:00
Hexqi 2bfdc0dfd6
feat: add hooks useHttp and useEnv (#561)
* feat: add useHttp and useEnv
2024-06-08 14:28:06 +08:00
chilingling c1ce492a01
feat: remove plugin from default registry (#562)
* feat: remove plugin from default registry

* fix: merge registry inside init function

* fix: use merged registry to get theme
2024-06-08 14:26:49 +08:00
chilingling e4291d5452
fix: fix relative path (#560)
* fix: fix relative path

* fix: read envconfig from extOptions
2024-06-08 11:23:48 +08:00
Hexqi 97041d2937
feat: remove useless (#559) 2024-06-08 10:50:17 +08:00
chilingling c9c083951f
fix(preview): fix designer-demo can't preview (#554) 2024-06-08 09:58:26 +08:00
Hexqi f1f8478d29
feat: add vite-config package (#558)
* feat: add vite config package
2024-06-08 09:49:41 +08:00
chilingling ee82ccc6e7
feat: reexport plugin from tiny-engine (#556) 2024-06-08 09:44:18 +08:00
chilingling a285038a94
feat: migrate public resource (#557) 2024-06-08 09:43:31 +08:00
chilingling d9adbb76e9
feat: merge lowcodeconfig with registry, migrate alias config to demo (#551)
* feat: merge lowcodeconfig with registry, migrate alias config to demo

* fix: delete useless config file

* fix(theme): load theme pkg ASAP
2024-06-07 17:20:47 +08:00
chilingling d9fe2005e6
feat: reexport canvas entry on design-core (#552)
* feat: reexport canvas entry on design-core

* feat: independen entry for canvas
2024-06-07 11:05:39 +08:00
Hexqi 1724bbc945
feat: add hooks entry (#550)
* feat: add hooks api in entry
2024-06-06 20:34:24 +08:00
chilingling efd411cb8a
fix/build issues (#538)
* fix: fix some build issue

1. fix cycle dependency between utils and entry
2. change vite-plusin-generate-comments to
   tiny-engine-vite-plugin-meta-comments
3. delete duplicate dependency inside design-core

* fix: change directory desc
2024-06-04 20:46:09 +08:00
Gene e8c4ba1cfa
refactor: rollback settings layout (#539) 2024-06-04 20:27:53 +08:00
Gene ec2c75264e
refactor(docs): 添加注册表文档 (#530)
* refactor(docs): 添加注册表结构文档
2024-05-31 18:01:06 +08:00
Gene 82f8d20596
refactor: 抽取属性设置面板布局组件 (#529) 2024-05-31 18:00:21 +08:00
Hexqi 0327a400ae
feat: merge registry (#531) 2024-05-31 17:59:34 +08:00
chilingling a16e929392
feat: add capability of add custom metaComponents (#528)
* feat(metaComponent): add capability of add custom metaComponents

* feat: metaComponents pass to init fun register

* fix: refactor code by code review

* feat: rename metaComponent to configurator

* fix(configurator): add base info to package.json

* feat: rename metaxxx to configurator

* fix: rename metaxxx to configurators

* fix: refactor code by review
2024-05-31 12:03:55 +08:00
Gene 439992b0c1
refactor(registry): 更改注册表结构,覆盖配置移至overwrite字段下 (#521)
* refactor: 注册表结构更新,支持传递配置项

* revert design-core files

* fix: remove redundant statement

* fix: 添加object校验

* 删除无用的注册表项目

* fix: replace with for...of
2024-05-30 09:57:04 +08:00
chilingling 9485f38ec8
feat(entry): add plugin correspond method (#516)
* feat(entry): add plugin correspond method

* fix(entry): optimize code by review suggestion

* fix(entry): optimize code by review suggestion

* fix(entry): change entry package entry path
2024-05-29 20:56:46 +08:00
Hexqi 7e434a9225
fix: init registry error (#522) 2024-05-29 20:56:03 +08:00
Gene 4ab118966c
fix: call defineEntry before importing tiny-engine (#520) 2024-05-29 15:30:23 +08:00
Hexqi 02ff87a7fe
fix: comments plugin build error (#517) 2024-05-28 21:01:13 +08:00
Hexqi 5134ab33a2
feat: init function refactor (#515)
* feat: extract init logic to init.js

* feat: use vite command

* feat: add app lifecycle

* fix: reviews
2024-05-28 20:21:45 +08:00
Hexqi 81fae7e85d
fix: es import error、add build command(comments)、add demo designer... (#514)
* feat: add designer demo package

* fix: remove useless svg assets

* fix: add .js to resolve es import error

* fix: add build command in comments and entry

* fix: remove metaService

* feat: update registry template
2024-05-27 17:27:18 +08:00
Gene 7a583b35a6
fix(svgs): rollback svgs/index.js (#513) 2024-05-27 10:48:36 +08:00
Gene 098c5e80ef
feat: 添加基于注册表的可插拔功能的基础逻辑 (#512)
* feat: 添加基于注册表的可插拔功能的基础逻辑

* fix: fix spelling mistake and simplify conditonal logic
2024-05-25 18:06:29 +08:00
lichunn 153fbd36a3
feat: add meta data for http/theme/svg plugin (#509)
* feat: add meta for tool

* feat:add generateComment plugin for tool

* feat: add layout

* fix: 更改写错的layout

* fix: 修改layout格式
2024-05-25 17:15:12 +08:00
ajaxzheng cdba368bc5
fix(cli): 改造cli创建模版,让新建的地代码平台可以正常启动 (#510) 2024-05-25 16:35:32 +08:00
wenmine 82af56ccb6
feat(toolbars): 工具栏增加meta.js (#502)
* feat(toolbars): 工具栏增加meta.js

* feat(toolbars): 工具栏增加vite-plugin-generate-comments

* feat(toolbars): 工具栏增加@opentiny/tiny-engine-entry
2024-05-25 16:23:35 +08:00
chilingling 7b8a6c6d97
fix(setting-panel): add meta for setting panel (#501)
* fix(setting-panel): add meta for setting panel

* fix(setting-panel): add generateComment plugin for build

* fix(setting-panel): declare dependencies

* fix(setting-panel): add entry dependency
2024-05-25 16:21:24 +08:00
rhlin 514756e4ab
feat:(common,canvas,controller): 新增meta.js 和对应的打包修改 (#505) 2024-05-25 16:19:46 +08:00
Gene 9f53dc65fc
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
2024-05-25 16:18:17 +08:00
ajaxzheng 491bda71c5
fix(build): 将generate-comments插件移入devDependencies (#504) 2024-05-23 14:05:45 +08:00
ajaxzheng 02c45dd2fe
fix(build): 修复@babel/template解析占位符时报错问题 (#500) 2024-05-21 19:58:22 +08:00
Hexqi 69cafd5979
fix: import fs-extra error in module project (#499) 2024-05-21 19:29:30 +08:00
wenmine fa39c12904
refactor: 原子化重构框架搭建 (#497) 2024-05-21 17:20:07 +08:00
1896 changed files with 72624 additions and 30614 deletions

View File

@ -8,4 +8,4 @@ tool_params:
secsolar:
source_dir: ./
cmetrics:
exclude: vite.config.js|package.json|index.js|mockServer/assets|packages/vue-generator/test
exclude: vite.config.js|package.json|index.js|axios.js|.eslintrc.js|mockServer|packages/vue-generator/test|packages/vue-generator/src/templates|packages/build/vite-plugin-meta-comments/src/test

View File

@ -1,9 +0,0 @@
.vscode
dist
public
package-lock.json
**/node_modules/**
tmp
temp
mockServer
packages/vue-generator/**/output/**

View File

@ -1,31 +0,0 @@
module.exports = {
env: {
browser: true,
es2015: true,
worker: true,
node: true,
jest: true
},
extends: ['eslint:recommended', 'plugin:vue/vue3-essential'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
parserOpts: {
plugins: ['jsx']
}
}
},
plugins: ['vue'],
rules: {
'no-console': 'error',
'no-debugger': 'error',
'space-before-function-paren': 'off',
'vue/multi-word-component-names': 'off',
'no-use-before-define': 'error',
'no-unused-vars': ['error', { ignoreRestSiblings: true, varsIgnorePattern: '^_', argsIgnorePattern: '^_' }]
}
}

56
.github/auto-labeler.yml vendored Normal file
View File

@ -0,0 +1,56 @@
version: v1
labels:
- label: 'ignore-for-release'
sync: true
matcher:
title: '^[vV]?\d+(\.\d+){2}.*'
body: '#ignore'
- label: 'breaking-change'
sync: true
matcher:
title: '^.+!:|#breaking'
body: '#breaking'
- label: 'enhancement'
sync: true
matcher:
title: '^[fF]eat.*'
- label: 'bug'
sync: true
matcher:
title: '^[fF]ix.*'
- label: 'documentation'
sync: true
matcher:
title: '^[dD](ocs|ocumentation).*'
files: 'docs/**/*.md'
- label: 'refactoring'
sync: true
matcher:
title: '^[rR]efactor.*'
- label: 'test'
sync: true
matcher:
title: '^[tT]est.*'
files: '**/__tests__/**'
- label: 'chore'
sync: true
matcher:
title: '^[cC]hore.*'
- label: 'ci'
sync: true
matcher:
title: '^[cC]i.*'
files: '.github/**'
- label: 'ospp'
sync: true
matcher:
baseBranch: '^ospp-\d+\/.*'
- label: '1.x'
sync: true
matcher:
baseBranch: '^v1\.x'
- label: 'release'
sync: true
matcher:
baseBranch: '^release\/v2.*'

11
.github/release.yml vendored
View File

@ -2,8 +2,6 @@ changelog:
exclude:
labels:
- ignore-for-release
authors:
- allcontributors[bot]
categories:
- title: Breaking Changes 🛠
labels:
@ -18,9 +16,16 @@ changelog:
labels:
- Semver-Patch
- bug
- title: Other Changes
- title: "📖 Documentation"
labels:
- documentation
- title: "🔧 Maintenance"
labels:
- refactoring
- test
- unit-test
- chore
- ci
- title: "Other Changes"
labels: ["*"]
collapse: true

76
.github/workflows/Release.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
if: github.repository == 'opentiny/tiny-engine'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha > /tmp/build-alpha.log 2>&1
- name: Upload build logs
uses: actions/upload-artifact@v4
with:
name: build-alpha-log
path: /tmp/build-alpha.log
- name: Parse Publish tag
id: parse_tag
run: |
tag_name="${GITHUB_REF#refs/tags/}"
if [[ "$tag_name" == *alpha* ]]; then
echo "dist_tag=alpha" >> "$GITHUB_OUTPUT"
elif [[ "$tag_name" == *beta* ]]; then
echo "dist_tag=beta" >> "$GITHUB_OUTPUT"
elif [[ "$tag_name" == *rc* ]]; then
echo "dist_tag=rc" >> "$GITHUB_OUTPUT"
else
echo "dist_tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Verify clean working directory
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "Working directory is not clean"
exit 1
fi
- name: Verify package version match tag
run: |
tag_name="${GITHUB_REF#refs/tags/}"
package_version=$(pnpm lerna list --scope=@opentiny/tiny-engine --json | jq -r '.[0].version')
if [[ "$tag_name" != "v$package_version" ]]; then
echo "Tag name $tag_name does not match package version $package_version"
exit 1
fi
- name: Publish package to npm
run: pnpm lerna publish from-package --dist-tag ${{steps.parse_tag.outputs.dist_tag}} --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

19
.github/workflows/auto-labeler.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Pull Request Auto Labeler
on:
pull_request_target:
types: [opened, edited]
permissions:
# Setting up permissions in the workflow to limit the scope of what it can do. Optional!
contents: read # the config file
pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request)
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # optional, default to '${{ github.token }}'
config-path: .github/auto-labeler.yml # optional, default to '.github/labeler.yml'

View File

@ -4,33 +4,40 @@ on:
push:
branches: []
pull_request:
branches: [develop,main]
branches: [develop, main, refactor/develop, release/*]
jobs:
push-check:
runs-on: ubuntu-latest # windows-latest || macos-latest
runs-on: ubuntu-latest # windows-latest || macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install pnpm
run: npm i -g pnpm
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: pnpm i
- name: Install dependencies
run: pnpm i
- name: Get changed files
id: get_changed_files
uses: tj-actions/changed-files@v41
with:
files: |
**.js
**.vue
**.jsx
- name: Run ESLint
run: npx eslint ${{steps.get_changed_files.outputs.all_changed_files}}
- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha
- name: Get changed files
id: get_changed_files
uses: tj-actions/changed-files@v41
with:
files: |
**.js
**.vue
**.jsx
- name: Run ESLint
run: npx eslint ${{steps.get_changed_files.outputs.all_changed_files}}
- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha > build-alpha.log 2>&1
- name: Upload build logs
uses: actions/upload-artifact@v4
with:
name: build-alpha-log
path: build-alpha.log

0
.husky/pre-commit Normal file → Executable file
View File

View File

@ -1,5 +1,7 @@
semi: false
singleQuote: true
printWidth: 120
trailingComma: 'none'
endOfLine: 'auto'
{
"semi": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none",
"endOfLine": "auto"
}

View File

@ -88,9 +88,9 @@ gantt
dateFormat YYYY-MM-DD
axisFormat %Y-%m-%d
1.0.0-beta.x version :active,2023-09-25, 2024-03-31
1.0.0-rc version : 2024-04-01, 2024-06-30
1.0.0 version : 2024-07-01, 2024-07-31
1.0.0-beta.x version : 2023-09-25, 2024-05-20
1.0.0-rc version(refactor version) : 2024-10-01
1.0.0 version : 2024-11-01
```

View File

@ -84,13 +84,13 @@ pnpm run build:alpha 或 build:prod
## 里程碑
```mermaid
gantt
gantt
dateFormat YYYY-MM-DD
axisFormat %Y-%m-%d
1.0.0-beta.x version :active,2023-09-25, 2024-03-31
1.0.0-rc version : 2024-04-01, 2024-06-30
1.0.0 version : 2024-07-01, 2024-07-31
1.0.0-beta.x version : 2023-09-25, 2024-05-20
1.0.0-rc version(refactor version) : 2024-10-01
1.0.0 version : 2024-11-01
```

View File

@ -0,0 +1,7 @@
export default {
id: 'engine.config',
theme: 'light',
material: ['/mock/bundle.json'],
scripts: [],
styles: []
}

View File

@ -1,7 +1,10 @@
# alpha mode, used by the "build:alpha" script
NODE_ENV=production
VITE_CDN_DOMAIN=https://npm.onmicrosoft.cn
# VITE_CDN_DOMAIN=https://unpkg.com
VITE_CDN_DOMAIN=https://registry.npmmirror.com
# 使用npmmirror的cdn 时,需要声明 VITE_CDN_TYPE=npmmirror
VITE_CDN_TYPE=npmmirror
VITE_LOCAL_IMPORT_MAPS=false
VITE_LOCAL_BUNDLE_DEPS=false
# VITE_ORIGIN=

View File

@ -1,7 +1,10 @@
# development mode, used by the "vite" command
NODE_ENV=development
VITE_CDN_DOMAIN=https://npm.onmicrosoft.cn
# VITE_CDN_DOMAIN=https://unpkg.com
VITE_CDN_DOMAIN=https://registry.npmmirror.com
# 使用npmmirror的cdn 时,需要声明 VITE_CDN_TYPE=npmmirror
VITE_CDN_TYPE=npmmirror
VITE_LOCAL_IMPORT_MAPS=false
VITE_LOCAL_BUNDLE_DEPS=false
# request data via alpha service

10
designer-demo/env/.env.production vendored Normal file
View File

@ -0,0 +1,10 @@
# prod mode, used by the "build:prod" script
NODE_ENV=production
# VITE_CDN_DOMAIN=https://unpkg.com
VITE_CDN_DOMAIN=https://registry.npmmirror.com
# 使用npmmirror的cdn 时,需要声明 VITE_CDN_TYPE=npmmirror
VITE_CDN_TYPE=npmmirror
VITE_LOCAL_IMPORT_MAPS=false
VITE_LOCAL_BUNDLE_DEPS=false
#VITE_ORIGIN=

13
designer-demo/index.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

View File

@ -0,0 +1,30 @@
{
"name": "designer-demo",
"private": true,
"version": "2.4.0",
"type": "module",
"scripts": {
"dev": "cross-env vite",
"build:alpha": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode alpha",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build"
},
"dependencies": {
"@opentiny/tiny-engine": "workspace:^",
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/vue": "~3.20.0",
"@opentiny/vue-design-smb": "~3.20.0",
"@opentiny/vue-icon": "~3.20.0",
"@opentiny/vue-locale": "~3.20.0",
"@opentiny/vue-renderless": "~3.20.0",
"@opentiny/vue-theme": "~3.20.0",
"@vueuse/core": "^9.6.0",
"vue": "^3.4.21"
},
"devDependencies": {
"@opentiny/tiny-engine-mock": "workspace:^",
"@opentiny/tiny-engine-vite-config": "workspace:^",
"@vitejs/plugin-vue": "^5.1.2",
"cross-env": "^7.0.3",
"vite": "^5.4.2"
}
}

View File

@ -8,6 +8,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="./src/preview/src/main.js"></script>
<script type="module" src="/src/preview.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

124
designer-demo/registry.js Normal file
View File

@ -0,0 +1,124 @@
/**
* Copyright (c) 2024 - present TinyEngine Authors.
* Copyright (c) 2024 - 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 {
Breadcrumb,
Fullscreen,
Lang,
ViewSetting,
Logo,
Lock,
Media,
Redoundo,
Save,
Clean,
ThemeSwitch,
Preview,
GenerateCode,
Refresh,
Collaboration,
Materials,
State,
Script,
Tree,
Help,
Schema,
Page,
I18n,
Bridge,
Block,
Datasource,
Robot,
Props,
Events,
Styles,
Layout,
Canvas,
GenerateCodeService,
GlobalService,
ThemeSwitchService
} from '@opentiny/tiny-engine'
import engineConfig from './engine.config'
import { HttpService } from './src/composable'
export default {
root: {
id: 'engine.root',
metas: [HttpService, GenerateCodeService, GlobalService, ThemeSwitchService] // GlobalService 依赖 HttpServiceHttpService需要在前面处理
},
config: engineConfig,
layout: {
...Layout,
options: {
...Layout.options,
isShowLine: true,
isShowCollapse: true,
toolbars: {
left: ['engine.toolbars.breadcrumb', 'engine.toolbars.lock', 'engine.toolbars.logo'],
center: ['engine.toolbars.media'],
right: [
['engine.toolbars.themeSwitch', 'engine.toolbars.redoundo', 'engine.toolbars.clean'],
['engine.toolbars.preview'],
['engine.toolbars.generate-code', 'engine.toolbars.save']
],
collapse: [
['engine.toolbars.collaboration'],
['engine.toolbars.refresh', 'engine.toolbars.fullscreen'],
['engine.toolbars.lang'],
['engine.toolbars.viewSetting']
]
}
}
},
themes: [
{
id: 'engine.theme.light'
},
{
id: 'engine.theme.dark'
}
],
toolbars: [
ThemeSwitch,
Logo,
Breadcrumb,
Lock,
Media,
Redoundo,
Collaboration,
Clean,
Preview,
Refresh,
GenerateCode,
Save,
Fullscreen,
Lang,
ViewSetting
],
plugins: [
Materials,
Tree,
Page,
[Block, { options: { ...Block.options, mergeCategoriesAndGroups: true } }],
Datasource,
Bridge,
I18n,
Script,
State,
Schema,
Help,
Robot
],
dsls: [{ id: 'engine.dsls.dslvue' }],
settings: [Props, Styles, Events],
canvas: Canvas
}

View File

@ -0,0 +1,135 @@
import { createApp } from 'vue'
import { HttpService } from '@opentiny/tiny-engine'
import { useBroadcastChannel } from '@vueuse/core'
import { constants } from '@opentiny/tiny-engine-utils'
import Login from './Login.vue'
const LOGIN_EXPIRED_CODE = 401
const { BROADCAST_CHANNEL } = constants
const { post: globalNotify } = useBroadcastChannel({ name: BROADCAST_CHANNEL.Notify })
const procession = {
promiseLogin: null,
mePromise: {}
}
let loginVM = null
const showError = (url, message) => {
globalNotify({
type: 'error',
title: '接口报错',
message: `报错接口: ${url} \n报错信息: ${message ?? ''}`
})
}
const preRequest = (config) => {
const isDevelopEnv = import.meta.env.MODE?.includes('dev')
if (isDevelopEnv && config.url.match(/\/generate\//)) {
config.baseURL = ''
}
const isVsCodeEnv = window.vscodeBridge
if (isVsCodeEnv) {
config.baseURL = ''
}
return config
}
const preResponse = (res) => {
if (res.data?.error) {
showError(res.config?.url, res?.data?.error?.message)
return Promise.reject(res.data.error)
}
return res.data?.data
}
const openLogin = () => {
if (!window.lowcode) {
const loginDom = document.createElement('div')
document.body.appendChild(loginDom)
loginVM = createApp(Login).mount(loginDom)
window.lowcode = {
platformCenter: {
Session: {
rebuiltCallback: function () {
loginVM.closeLogin()
procession.mePromise.resolve('login ok')
procession.promiseLogin = null
procession.mePromise = {}
}
}
}
}
}
return new Promise((resolve, reject) => {
if (!procession.promiseLogin) {
procession.promiseLogin = loginVM.openLogin(procession, '/api/rebuildSession')
procession.promiseLogin.then((response) => {
HttpService.apis.request(response.config).then(resolve, reject)
})
}
})
}
const errorResponse = (error) => {
// 用户信息失效时,弹窗提示登录
const { response } = error
if (response?.status === LOGIN_EXPIRED_CODE) {
// vscode 插件环境弹出输入框提示登录
if (window.vscodeBridge) {
return Promise.resolve(true)
}
// 浏览器环境弹出小窗登录
if (response?.headers['x-login-url']) {
return openLogin()
}
}
showError(error.config?.url, error?.message)
return response?.data.error ? Promise.reject(response.data.error) : Promise.reject(error.message)
}
const getConfig = (env = import.meta.env) => {
const baseURL = env.VITE_ORIGIN
// 仅在本地开发时,启用 withCredentials
const dev = env.MODE?.includes('dev')
// 获取租户 id
const getTenant = () => new URLSearchParams(location.search).get('tenant')
return {
baseURL,
withCredentials: dev,
headers: {
...(dev && { 'x-lowcode-mode': 'develop' }),
'x-lowcode-org': getTenant()
}
}
}
const customizeHttpService = () => {
const options = {
axiosConfig: getConfig(),
interceptors: {
request: [preRequest],
response: [[preResponse, errorResponse]]
}
}
HttpService.apis.setOptions(options)
return HttpService
}
export default customizeHttpService()

View File

@ -0,0 +1 @@
export { default as HttpService } from './http'

View File

@ -0,0 +1,63 @@
<template>
<span>我是自定义的 input configurator</span>
<tiny-input v-model="value" :type="type" :placeholder="placeholder" :rows="rows" @update:modelValue="change">
</tiny-input>
</template>
<script>
import { ref } from 'vue'
import { Input } from '@opentiny/vue'
export default {
name: 'MyInputConfigurator',
components: {
TinyInput: Input
},
props: {
modelValue: {
type: String
},
type: {
type: String
},
placeholder: {
type: String
},
suffixIcons: {
type: Array,
default: () => []
},
dataType: {
type: String
},
rows: {
type: Number,
default: 10
}
},
emits: ['update:modelValue'],
setup(props, { emit }) {
const value = ref(props.modelValue)
const change = (val) => {
emit('update:modelValue', props.dataType === 'Array' ? val.split(',') : val)
}
return {
value,
change
}
}
}
</script>
<style lang="less" scoped>
.tiny-svg-size {
margin-left: 10px;
font-size: 16px;
&:hover {
cursor: pointer;
color: var(--te-common-text-primary);
}
}
</style>

View File

@ -0,0 +1,5 @@
import MyInputConfigurator from './MyInputConfigurator.vue'
export const configurators = {
MyInputConfigurator
}

View File

@ -10,9 +10,9 @@
*
*/
import { useHttp } from '@opentiny/tiny-engine-http'
import registry from '../registry.js'
import { defineEntry } from '@opentiny/tiny-engine'
const http = useHttp()
defineEntry(registry)
// 注销
export const requestLogout = () => http.post(`platform-center/api/logout`)
export { registry }

23
designer-demo/src/main.js Normal file
View File

@ -0,0 +1,23 @@
/**
* 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.
*
*/
// 导入@opentiny/tiny-engine时内部的依赖包也会逐个导入可能会执行useComplie此时需要templateHashMap。所以需要先执行一次defineEntry
import { registry } from './defineEntry.js'
import { init } from '@opentiny/tiny-engine'
import { configurators } from './configurators/'
import 'virtual:svg-icons-register'
init({
registry,
configurators,
createAppSignal: ['global_service_init_finish']
})

View File

@ -0,0 +1,34 @@
/**
* 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 { initHook, HOOK_NAME, GenerateCodeService, Breadcrumb, Media, Lang } from '@opentiny/tiny-engine'
import { initPreview } from '@opentiny/tiny-engine'
import 'virtual:svg-icons-register'
import { HttpService } from './composable'
const beforeAppCreate = () => {
initHook(HOOK_NAME.useEnv, import.meta.env)
}
initPreview({
registry: {
root: {
id: 'engine.root',
metas: [HttpService, GenerateCodeService]
},
config: { id: 'engine.config', theme: 'light' },
toolbars: [Breadcrumb, Media, Lang]
},
lifeCycles: {
beforeAppCreate
}
})

View File

@ -0,0 +1,23 @@
import path from 'node:path'
import { defineConfig, mergeConfig } from 'vite'
import { useTinyEngineBaseConfig } from '@opentiny/tiny-engine-vite-config'
export default defineConfig((configEnv) => {
const baseConfig = useTinyEngineBaseConfig({
viteConfigEnv: configEnv,
root: __dirname,
iconDirs: [path.resolve(__dirname, './node_modules/@opentiny/tiny-engine/assets/')],
useSourceAlias: true,
envDir: './env'
})
const customConfig = {
envDir: './env',
publicDir: path.resolve(__dirname, './public'),
server: {
port: 8090
}
}
return mergeConfig(baseConfig, customConfig)
})

108
docs/README.md Normal file
View File

@ -0,0 +1,108 @@
# 目录
## 使用指南
- 新手指引
- [简介](./getting-started/introduction.md)
- [快速上手](./getting-started/quick-start.md)
- 基础功能
- [初识设计器](./basic-features/intro-to-designer.md)
- [设计前端应用流程](./basic-features/frontend-application-flow.md)
- [设计器界面模块简介](./basic-features/designer-ui-modules.md)
- [页面管理](./basic-features/page-management.md)
- [使用组件](./basic-features/using-components.md)
- [样式设置](./basic-features/style-settings.md)
- [使用状态管理和变量绑定](./basic-features/state-management-and-variable-binding.md)
- [行内样式绑定状态变量](./basic-features/inline-style-variable-binding.md)
- [查看大纲树](./basic-features/outline-tree.md)
- [国际化](./basic-features/internationalization.md)
- [页面和区块预览](./basic-features/page-and-block-preview.md)
- 进阶功能
- [区块管理](./advanced-features/block-management.md)
- [使用JS面板和事件绑定](./advanced-features/js-panel-and-event-binding.md)
- [使用工具类方法 utils](./advanced-features/using-utils-methods.md)
- [高级面板设置](./advanced-features/advanced-panel-settings.md)
- [如何使用插槽](./advanced-features/how-to-use-slots.md)
- [循环渲染](./advanced-features/loop-rendering.md)
- [条件渲染](./advanced-features/conditional-rendering.md)
- [集成ChatGPT搭建简单页面能力](./advanced-features/integrating-chatgpt-for-simple-pages.md)
- [数据源和Collection—远程字段](./advanced-features/data-source-and-collection-remote-fields.md)
- [数据源和Collection—mock数据](./advanced-features/data-source-and-collection-mock-data.md)
- [数据源和Collection—使用数据源](./advanced-features/data-source-and-collection-usage.md)
- 教程
- [从零搭建一个页面](./tutorials/build-a-page-from-scratch.md)
- [第一期2023.10.27](./tutorials/issue-1-2023.10.27.md)
## 平台开发指南
- 开始
- [简介](./development-getting-started/dev-intro.md)
- [快速上手](./development-getting-started/dev-quick-start.md)
- [前后端启动联调(Java服务端)](./development-getting-started/debugging-of-java-backend.md)
- 解决方案
- [Java服务端部署](./solutions/server-deployment-solution-java.md)
- [Node.js服务端部署](./solutions/server-deployment-solution.md)
- [区块发布方案(Node.js服务端)](./solutions/block-release-solution.md)
- [区块局域网发布方案(Node.js服务端)](./solutions/block-lan-release-solution.md)
- [设计器中引入第三方组件库](./solutions/third-party-library-in-designer.md)
- [物料同步方案](./solutions/material-sync-solution.md)
- 扩展能力介绍
- [新架构介绍](./extension-capabilities-overview/new-architecture.md)
- [注册表](./extension-capabilities-overview/registry.md)
- [元服务和元应用](./extension-capabilities-overview/meta-services-and-meta-apps.md)
- 扩展能力使用教程
- [如何开发插件](./extension-capabilities-tutorial/how-to-develop-plugins.md)
- 出码功能
- [出码功能简介与使用](./extension-capabilities-tutorial/code-output-function/code-output-overview-and-usage.md)
- [如何自定义出码](./extension-capabilities-tutorial/code-output-function/how-to-customize-code-output.md)
- [如何自定义出码插件](./extension-capabilities-tutorial/code-output-function/how-to-customize-code-output-plugins.md)
- [自定义页面出码插件](./extension-capabilities-tutorial/code-output-function/custom-page-code-output-plugin.md)
- [官方出码能力API](./extension-capabilities-tutorial/code-output-function/official-code-output-api.md)
- [定制插件UI](./extension-capabilities-tutorial/customize-plugin-ui.md)
- [定制元服务逻辑](./extension-capabilities-tutorial/customize-meta-service-logic.md)
- [开发设置器组件](./extension-capabilities-tutorial/develop-configurator-components.md)
- [AI插件使用前配置](./extension-capabilities-tutorial/ai-plugin-configuration.md)
- API
- [API总览](./api/api-overview.md)
- 前端API
- [主包API](./api/frontend-api/main-package-api.md)
- [画布API](./api/frontend-api/canvas-api.md)
- [全局布局API](./api/frontend-api/global-layout-api.md)
- [物料API](./api/frontend-api/material-api.md)
- [设置面板API](./api/frontend-api/settings-panel-api.md)
- 后端API
- [AI功能接口](./api/backend-api/ai-function-api.md)
- [应用管理](./api/backend-api/app-management.md)
- [区块分类](./api/backend-api/block-categories.md)
- [应用工具类管理](./api/backend-api/app-utility-management.md)
- [区块管理](./api/backend-api/block-management-api.md)
- [数据源管理](./api/backend-api/data-source-management.md)
- [DSL代码生成](./api/backend-api/dsl-code-generation.md)
- [物料中心](./api/backend-api/material-center.md)
- [页面管理](./api/backend-api/page-management-api.md)
- [APP服务](./api/backend-api/app-services.md)
- 实战案例
- [PDM元数据审批电子流](./practical-cases/pdm-metadata-approval-workflow.md)
- [图元编排设计器](./practical-cases/graphical-element-arrangement-designer.md)
- [SMB轻量应用服务](./practical-cases/smb-lightweight-application-service.md)
## 网站文档
- 生态中心
- [介绍](./ecosystem-center/ecosystem-intro.md)
- [如何导入组件库](./ecosystem-center/how-to-import-library.md)
- [如何发布区块](./ecosystem-center/how-to-publish-block.md)
- [发布其他生态](./ecosystem-center/publish-other-ecosystems.md)
- 关于应用
- [创建应用(创建空白应用、从模板创建应用)](./about-applications/create-application-blank-or-template.md)
- [开发应用](./about-applications/develop-application.md)
- 关于物料
- [介绍](./about-materials/materials-intro.md)
- [创建物料资产包](./about-materials/create-material-asset-package.md)
- [添加组件库和区块](./about-materials/add-library-and-blocks.md)
- [构建物料资产包](./about-materials/build-material-asset-package.md)
- 关于设计器
- [介绍](./about-designer/designer-intro.md)
- [创建设计器](./about-designer/create-designer.md)
- [定制物料资产包、主题、DSL、工具栏和插件栏](./about-designer/customize-material-package-themes-dsl-toolbar-plugins.md)
- [定制设计器](./about-designer/customize-designer.md)

View File

@ -0,0 +1,13 @@
# 关于应用
## 如何创建应用
设计器定制完成后,用户可以在 [我的设计器](https://www.opentiny.design/tiny-engine#/my-platform) 中创建应用。选择对应的设计器,在设计器右下方点击“创建应用”。
创建应用有两种方式:
1.创建空白应用 &rarr; 填写必要的字段 &rarr; 保存。
![创建应用方式一]( ./imgs/appCreateOne.png)
2.从模板创建应用&rarr; 选择应用模板 &rarr; 填写必要的字段 &rarr; 保存。
![创建应用方式二]( ./imgs/appCreateTwo.png)

View File

@ -0,0 +1,11 @@
# 关于应用
## 如何去开发应用
应用创建完成后,即可在 **我的应用** 中看到这个应用,点击 **开发应用** 即可前往可视化设计器进行可视化地搭建该应用下的 *页面**区块*
![view-app1]( ./imgs/appDevOne.png)
### 可视化设计器
![view-app2]( ./imgs/appDevTwo.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -0,0 +1,6 @@
# 关于设计器
## 如何创建一个设计器
用户可以在 [我的设计器](https://www.opentiny.design/tiny-engine#/my-platform) 中创建设计器,创建设计器 &rarr; 填写必要的字段 &rarr; 确定
![create-platform]( ./imgs/createPlatform.png)

View File

@ -0,0 +1,13 @@
# 关于设计器
## 如何定制一个设计器
物料资产包、主题、工具、插件和DSL定制完成后有两种方式可以构建设计器。
方式一:可视化构建
![build-platform1]( ./imgs/buildPlatform1.png)
方式二:由源码构建
![build-platform2]( ./imgs/buildPlatform2.png)

View File

@ -0,0 +1,20 @@
# 关于设计器
## 如何定制物料资产包、主题、DSL、工具栏和插件栏
设计器创建完成后会自动打开编辑页面,用户可以在这里定制设计器的*物料资产包*、*主题*、*工具*、*插件*和*DSL*,如下图:
1. **定制物料资产包:** 物料资产包 **必选且唯一** , **不允许删除** 物料资产包,可以添加其他物料资产包来替换当前的。
![define-material]( ./imgs/defineMaterial.png)
2. **定制主题:** 主题 **必选且唯一** **不允许删除** 主题,可以添加其他主题来替换当前的
![define-theme]( ./imgs/defineTheme.png)
3. **定制DSL** DSL为 **单选**。DSL是将物料的Schema 解析成不同技术栈源码的转换工具所以DSL的必须和选择的物料在技术栈保持一致。
![define-DSL]( ./imgs/defineDsl.png)
4. **定制工具:** 可以将工具拖入上方位置栏,规划定制的设计器里工具的位置。工具可以多选,也可以删除。
![define-tools]( ./imgs/defineTools.png)
5. **定制插件:** 可以将插件拖入中间位置栏,规划定制的设计器里插件的位置。插件可以多选,也可以删除。
![define-plugs]( ./imgs/definePlugs.png)

View File

@ -0,0 +1,6 @@
# 构建自定义设计器
## 什么是定制扩展能力
什么是扩展能力呢,一方面我们可以快速拥有一个官方标准的设计器,另外一方面如果用户有独特的业务功能需要,我们可以不用看它的源码、不用关心其实现,用户可以使用 API、插件等方式快速开发自己的工具插件DSL等的npm包用于构建用户自定义的设计器。而设计器引擎对于设计器的扩展能力支持基本上覆盖了设计器的所有功能点。
![expend]( ./imgs/platformExpend.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

@ -0,0 +1,19 @@
# 添加组件库/区块
## 如何添加组件库与区块
可视化设计器已为您提供官方组件库与一些区块,物料资产包创建完成后会自动打开编辑页面,用户可以在这里添加组件库与区块,如下图:
* **添加组件库:** 选中未选择的组件库
![添加组件库](./imgs/createMaterialLib.png)
* **添加区块:** 选中未选择的区块
![添加区块](./imgs/createMaterialBlock.png)
* **移除组件库:** 取消选中已经选择的组件库,并且确认
![移除组件库](./imgs/createMaterialLibCancel.png)
* **移除区块:** 取消选中已经选择的区块,并且确认
![移除区块](./imgs/createMaterialBlockCancel.png)
* 用户也可以在生态中心录入自己的组件库与区块。

View File

@ -0,0 +1,6 @@
# 构建物料资产包
## 如何构建物料资产包
添加完组件库与区块后,点击底部 **构建物料资产包** 按钮,即可完成物料资产包的构建。构建完成后即可看到发布地址。
![构建物料资产包](./imgs/createMaterial.gif)

View File

@ -0,0 +1,10 @@
# 创建物料资产包
## 如何创建物料资产包
用户可以在生态中心创建物料资产包,*新建物料资产包* → *填写必要的字段* → *保存。*
当前支持Vue和Angular两种技术栈用户可以任意选择。当用户选择了Vue技术栈时则只能添加Vue的组件与区块不能添加Angular的组件库与区块。
物料资产包版本是用户自定义的,用户可以将物料资产包回退到任一版本。
![构建物料资产包](./imgs/createMaterial.gif)

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,16 @@
# 关于物料资产包
## 什么是物料
物料是可视化页面搭建的原料,按照粒度可分为组件库和区块
1. **组件库**:组件库一般是按照组件的性质进行组织。组件是页面搭建最小的可复用单元,其只对外暴露配置项,用户无需感知其内部实现。组件库在设计器定制完成后 **不能再次添加与删除**
2. **区块**:区块可以包含一个或多个组件也可以包含其他区块,带有一定的业务逻辑,能够实现更丰富的功能与表现。区块分为**消费侧**和**管理侧**,在区块管理侧,用户可以向设计器中拖入一个区块后可以编辑其内部的组件和区块配置,暴露区块的属性和事件供消费区块的时候使用,最后发布区块,消费侧区块就会更新为最新的区块内容。区块在设计器定制完成后仍能添加与删除。
设计器中的物料需要进行一定的配置和处理,才能让用户在设计器使用起来。这个过程中,需要一份配置文件,也就是物料资产包。物料资产包文件中,针对每个物料定义了它们在设计器中的使用描述。
## 什么是物料资产包
在设计器中,我们可以看到,组件与区块面板不只提供一个组件或区块,它们是以集合的形式提供给设计器的,而物料资产包正是这些组件与区块构成的集合。
![view-material](./imgs/materialPanel.png)

View File

@ -0,0 +1,69 @@
# 高级面板设置
> 选中组件之后,我们可以在高级面板对组件进行事件的绑定、以及循环渲染、条件渲染等高级设置
## 条件渲染
在页面开发中,我们可能需要根据某些条件来动态显示或隐藏页面中的内容,举个例子:我们希望当用户已经登录的时候,显示欢迎登录的文字,未登录的时候,显示请登录的文字。
那么,我们可以在组件上面绑定条件渲染,点击绑定变量,选择变量 state.isLogin那么我们的组件就会根据变量 state.isLogin 的真假值来进行渲染。
![条件渲染示例](./imgs/conditionRender.gif)
## 循环渲染
我们的页面可能有若干份重复的、动态生成的内容,比如商品列表页,比如表格数据。这时候,我们就需要用到循环渲染
我们可以在高级面板中指定循环数据绑定的变量、迭代的变量名、索引变量名、以及唯一的 key。
举例:假如我们的状态变量中有一个镜像列表,我们希望渲染出来镜像的 icon、镜像名称以及镜像版本那么我们可以使用循环渲染来实现
![循环渲染](./imgs/useLoop.gif)
相关概念关联:
- 循环数据,即需要循环渲染的数组,在这里是 state.imageList
- 迭代变量名,在循环渲染子项对应的变量名,默认为 item
- 索引变量名,循环渲染的索引变量名,默认为 index
- key标识唯一的 key默认为 index
最终出码:
```vue
<template>
<div v-for="(item, index) in state.imageList" :key="index">
<span>{{ item.title }}</span>
<!---列表细节--->
</div>
</template>
```
## 事件绑定
我们可以给选中的组件进行事件的绑定:
- 在绑定事件下拉按钮中选中需要绑定的事件
- 随后在事件绑定弹窗中指定方法名称
- 指定拓展参数
- 点击确定在随后弹出的JS面板中进行绑定方法的具体逻辑实现
![事件绑定演示](./imgs/bindEvent.gif)
### 拓展参数相关说明
在某些点击事件中,我们不仅仅希望得知事件是否被点击,我们还希望在点击事件中获得一些额外的参数,这时候,我们就可以用拓展参数,下面举例说明:
我们希望为镜像列表中的列表项绑定点击事件,然后将镜像的 id 和版本传入到事件处理函数中。那么,我们就可以使用拓展参数进行传入。
```bash
# 循环渲染项迭代变量名 item
# 拓展参数设置:
["item.imageId", "item.imageVersion"]
```
最终出码:
```vue
<template>
<div v-for="(item, index) in state.imageList" @click="(e) => handleClick(e, item.imageId, item.imageVersion)">
<!---列表细节--->
</div>
</template>
```

View File

@ -0,0 +1,129 @@
# 区块管理
> 区块的概念类似于前端开发中的 Component我们可以将很多页面中都一样的结构比如 Header构建到区块中发布之后直接在页面中拖入使用提高开发效率
## 区块相关概念
假设我们有如下前端工程:
```bash
- project
- components
|_ Header.vue
- Footer.vue
- Container.vue
- views
|_ Index.vue
- Page2.vue
- TodoFolder
|_ Todo.vue
```
其中views 文件夹下 views每个页面都有路由一一对应用户可以根据路由访问。components文件夹下的 Header、Footer、Container则没有对应路由可以访问但是他们可以被页面1、2、3引用提高代码复用率我们的区块则对应 components 下的Header、Footer、Container等组件概念即可重用的业务组件
### 区块发布相关概念
我们对区块编辑好之后,最终还是提供给另一个区块或者页面使用(即被另一个区块或者页面引用),所以我们设计了发布的概念,区块发布之后,会生成一个版本,可以在物料面板添加已经发布的区块,选择版本,然后拖入画布中消费使用
## 区块的基本使用与管理
创建区块可以有创建空白区块和从现有页面中创建区块两种
### 创建空白区块
![创建空白区块](./imgs/createEmptyBlock.png)
如上图,按照步骤可创建空白区块
- 点击左侧区块插件打开区块插件面板
- 点击右上角新增按钮
- 在弹窗中输入区块ID与区块名称
相关概念
- 区块ID区块的唯一ID对应出码后的区块文件名
- 区块名称:在区块管理面板和物料消费面板显示的名称
### 从现有页面中选中组件创建区块
![从现有页面中选中组件创建区块](./imgs/createBlockFromPage.gif)
如上图,我们可以从现有页面中,按照步骤创建新区块
- 点击画布选中组件
- 右键,在弹出的右键菜单中点击新建区块
- 在弹出的弹窗中输入新区块的ID和名称点击确认
- 最终我们得到了有选中组件作为初始内容的区块
## 区块管理与设置
在上述创建空白区块的区块管理插件中,我们还能看到现有的区块,对现有的区块进行修改和删除等管理操作,下面,我们来学习区块的几个管理属性
### 区块基本设置
![区块基本设置](./imgs/blockBaseSetting.png)
如上图,点击区块列表中区块的右上角的设置按钮,即可打开设置面板。区块的基本设置中,我们可以对区块的名称、描述、标签、公开范围进行设置,下面对相关设置项进行讲解
- 区块描述:区块的描述,可以让别人更好的明白该区块的用途以及含义
- 区块标签:区块的标签,方便消费侧用户搜索
- 公开范围:区块的公开范围,设置 区块发布之后别的用户是否可以搜索,私有即只有自己可以看到、公开即所有用户都可以看到、半公开可以选择可以搜索到该区块的组织
### 区块暴露属性设置
#### 区块暴露属性的相关概念
假设我们的前端工程中有一个 Header 组件,该组件定义了 title 和 description 两个 props 属性
```vue
<template>
<header>
<h1>{{props.title}}</h1>
<span>{{props.description}}</span>
</header>
</template>
<script setup>
const props = defineProps({
title: { type: String, default: '' },
description: { type: String, default: '' }
})
</script>
```
区块暴露属性的概念即对应 组件中的 props 属性。暴露属性声明了外部组件引用当前组件时,可以定义的相关属性
#### 区块暴露属性的相关设置
区块暴露属性的设置与我们代码 props 的设置相似,只是区块暴露属性多了一个指定属性面板组件和属性的相关配置
![区块暴露属性设置](./imgs/blockExposeAttr.gif)
#### 区块暴露属性的消费
在区块发布之后,我们在物料面板拖出区块到画布中,选中我们拖出的区块,右侧属性面板的属性即是我们定义的暴露属性
![区块暴露属性的消费](./imgs/blockexposeattrusage.gif)
### 区块事件设置
#### 区块事件的概念
既然区块暴露属性等同于 组件 中的 props 属性,类似的,区块的事件即等同于 vue 中的 emit 事件声明
```vue
<script setup>
const emit = defineEmits(['update:modelValue', 'success'])
</script>
```
注意的是,这里仅仅是声明我们的区块会抛出什么事件,真正的事件需要引用方(即消费该区块的一方在高级面板进行定义)
### 生命周期设置
同页面生命周期,即可以设置对应技术栈的生命周期函数
### 版本列表
可以预览对应版本的区块

View File

@ -0,0 +1,30 @@
# 条件渲染
在页面开发中,可能需要根据某些条件来动态显示或隐藏页面中的内容,例如:如果您希望当用户已经登录的时候,显示“欢迎登录“的文字,未登录的时候,显示“请登录“的文字。
1. 拖拽组件至画布,分别输入希望展示的文字。
2. 添加变量例如state.isLogin
**图 1** 添加变量
![addvar-15](./imgs/addvar-15.png)
3. 选中组件,在组件属性设置面板选择“高级”。
4. 单击“是否渲染“后的 ![变量绑定图标](./imgs/icon-code.png),进行变量绑定。
**图 2** 绑定变量
![bindVariable-16.png](./imgs/bindVariable-16.png)
5. 选项绑定的变量,单击“确定”。
绑定成功后可根据变量state.isLogin的值查看渲染效果。
**图 3** state.isLogin为false时
![state-isLogin为false时](./imgs/state-isLogin为false时.png)
**图 4** state.isLogin为ture时
![state-isLogin为ture时.png](./imgs/state-isLogin为ture时.png)

View File

@ -0,0 +1,21 @@
# 数据源Mock数据
目前数据源在编辑态时只能使用Mock数据所以我们可能需要给数据源添加Mock数据
## 操作步骤
- 打开数据源面板,选中数据源
- 点击新增数据,添加数据并保存
![新增数据](./imgs/dataSource5.png)
## 使用数据源Mock数据
- 拖动一个Collection组件到画布中在Collection组件属性面板上选择数据源
- 拖动格组件到Collection中表格组件将自动生成数据源中的字段
![使用数据源Mock数据](not-found/dataSource6.png)
## 更新数据源到画布
添加完Mock数据后画布上绑定的数据源不会同步改变需要手动更新操作如下
选中画布中的数据源,打开属性面板,点击更新数据源
![更新数据源到画布](./imgs/dataSource7.png)

View File

@ -0,0 +1,27 @@
# 数据源获取远程字段
我们可以通过已有的远程Http接口快速地生成数据源的字段
## 操作步骤
- 打开数据源面板,新建数据源。点击获取远程数据
- 设置请求地址、请求方式、请求参数、请求结果回调
![数据源设置](./imgs/dataSource1.png)
- 请求成功后获取到接口字段信息,填写字段名后,保存后即可生成数据源字段信息
![请求结果](./imgs/dataSource2.png)
![字段配置](./imgs/dataSource3.png)
![保存数据源](./imgs/dataSource4.png)
## 请求完成回调函数示例
- 解析对象数组
```javascript
function dataHandler(data) {
return data.map(v => {
return {
name: v.aa.ss,
status: v.status
}
})
}
```

View File

@ -0,0 +1,127 @@
## 数据源
### 前言
设计器提供数据源来配合画布上的组件/区块渲染,数据源的配置既可以采取在设计器中静态配置的方式,也可以采取远程 API 请求 JSON 数据动态获取的方式。
> 目前**数据源**可便捷地应用于表格组件的表格列,也可灵活地应用于手动调用指定的远程 API。
### 创建数据源
创建数据源步骤:
1. 选择左边操作栏 - 数据源
2. 点击左上操作区 - 新建数据源
![Alt text](./imgs/data-source-2.png)
3. 配置数据源类型(可选对象数组、树结构),配置数据源名称以及数据源字段
4. 保存数据源
![Alt text](./imgs/data-source-1.png)
### 表格组件中的应用
数据源主要载体为**Collection组件**,因此在使用数据源之前需要先在画布中拖放入**Collection组件**,然后在属性面板中选择需要绑定的数据源
![Alt text](./imgs/data-source-3.png)
然后需要在Collection组件中放入Grid表格组件根据提示引入配置数据就会自动解析出表格列数据
![Alt text](./imgs/data-source-4.png)
### 手动调用指定的远程 API
低代码引擎,将所有数据源都挂载到了 `dataSourceMap` 中,并为每个数据源都提供了 `load` 方法,用于手动调用场景,比如:点击保存按钮时,需要调用后端的保存接口,提交用户填写的数据,此时可以通过数据源来提交。
#### 使用说明
`this.dataSourceMap.xxx.load()`
- xxx 为在数据源面板设置的数据源名称
- 支持传入请求参数,可用于覆盖在数据源面板中配置的请求参数(默认请求参数)
- load 方法返回一个 Promise
#### 示例
以会议预订页面为例,为 `创建` 按钮绑定点击事件(`onClick`
![Alt text](./imgs/data-source-load-1.png)
绑定点击事件处理器为 `createMeeting`,补充其实现,主要为 `this.dataSourceMap.createMeeting.load(this.state.meeting)`
表示将用户填写的会议信息(`this.state.meeting`),调用数据源 `addMeeting`POST 请求),提交给后端。
![Alt text](./imgs/data-source-load-2.png)
其中,数据源 `addMeeting` 配置示例如下:
![Alt text](./imgs/data-source-load-3.png)
完整代码示例如下:
```js
async function createMeeting() {
try {
const res = await this.dataSourceMap.addMeeting.load(this.state.meeting)
console.log('成功创建以下会议:', res)
} catch {
this.utils.toast({
type: 'error',
title: '创建会议请求失败,请稍候重试或联系客服'
})
}
}
```
# 数据源获取远程字段
在使用数据源之前,我们需要向数据源中添加属性字段,可以通过“新建字段”按钮逐个添加。
但某些场景下,有更高效的添加方式,比如:基于已有的 HTTP 接口响应数据,快速地创建数据源的字段。
## 操作步骤
- 打开数据源面板,新建数据源。点击获取远程数据
- 设置请求地址、请求方式、请求参数、请求结果回调
![数据源设置](./imgs/dataSource1.png)
- 请求成功后获取到接口字段信息,填写字段名后,保存后即可生成数据源字段信息
![请求结果](./imgs/dataSource2.png)
![字段配置](./imgs/dataSource3.png)
![保存数据源](./imgs/dataSource4.png)
> 如果接口请求存在跨域、鉴权等情况无法通过“发送请求”自动填充响应数据时可以手动将响应数据比如JSON 格式数据),粘贴至下方的“请求结果”编辑器中。
## 请求完成回调函数示例
- 解析对象数组
```javascript
function dataHandler(data) {
return data.map(v => ({
name: v.nickName,
status: v.status
})
)
}
```
# 数据源Mock数据
目前数据源在编辑态时只能使用Mock数据所以我们可能需要给数据源添加Mock数据
## 操作步骤
- 打开数据源面板,选中数据源
- 点击新增数据,添加数据并保存
![新增数据](./imgs/dataSource5.png)
## 使用数据源Mock数据
- 拖动一个Collection组件到画布中在Collection组件属性面板上选择数据源
- 拖动格组件到Collection中表格组件将自动生成数据源中的字段
![使用数据源Mock数据](not-found/dataSource6.png)
## 更新数据源到画布
添加完Mock数据后画布上绑定的数据源不会同步改变需要手动更新操作如下
选中画布中的数据源,打开属性面板,点击更新数据源
![更新数据源到画布](./imgs/dataSource7.png)

View File

@ -0,0 +1,165 @@
# 插槽的声明与使用
## 插槽的相关概念
> 插槽的概念与 vue.js 的插槽 [slot](https://cn.vuejs.org/guide/components/slots.html) 概念一致
我们以上述 Header组件为例讲解插槽需要了解的核心概念
- 插槽名字:插槽名字默认为 default
- 作用域插槽:用于向插槽传入子组件状态
```vue
// Header.vue
<template>
<header>
<h1>TinyEngine</h1>
<slot name="menu" :menu="state.menu" :type="'mobile'">
<menu>
<li v-for="item in state.menu" :key="item.id">{{ item.name }}</li>
</menu>
</slot>
</header>
</template>
```
```vue
<template>
<Header>
<template #menu="{ menu, type }">
<ul>
<li v-for="item in menu" :key="item.id">{{ item.name }}</li>
</ul>
</template>
</Header>
</template>
```
如以上代码为例子,当我们使用 `Header` 组件的时候,我们可以声明 menu 插槽,并且在 menu 插槽里面获取到子组件 menu 的状态。此时即为作用域插槽。
## 插槽的声明
在区块中,我们可以通过拖入插槽的方式声明插槽。然后,我们可以在右侧设置面板设置插槽的名字,向插槽传入 props。
如果需要传入 props我们可以通过编辑代码写入我们需要的表达式将 props 传入 插槽中。
![插槽声明](./imgs/defineslot.gif)
我们得到的带有插槽的 schema 大致为以下样式:
```json5
{
"componentName": "Slot",
"props": {
"name": "menu",
"params": [
{
"name": "title",
"value": {
"type": "JSExpression",
"value": "this.state.ggggg"
}
}
]
},
"id": "25632b32",
"children": [
{
"componentName": "Text",
"props": {
"text": "TinyEngine 前端可视化设计器,为设计器开发者提供定制服务,在线构建出自己专属的设计器。"
},
"id": "63246b33"
}
]
}
```
区块出码大致为:
```vue
<template>
<div>
<slot name="menu" :title="state.ggggg">
<span>TinyEngine 前端可视化设计器,为设计器开发者提供定制服务,在线构建出自己专属的设计器。</span>
</slot>
</div>
</template>
```
最后,我们可以经过保存 -> 发布 -> 组件面板导入区块的流程,将区块变成可消费的组件。
## 插槽的使用
上一步,我们通过低代码的区块,或者导入的已有的组件声明插槽,那么我们将可以将组件或者区块拖入画布中,在右侧面板相关的配置项开启插槽。
然后画布会开启对应的插槽,我们可以往插槽中拖入编排插槽组件。
在拖入的组件中,我们可以通过绑定变量的方式获取传入的作用域插槽:
![拖入使用区块插槽](./imgs/usingslot.gif)
最终得到的 schema 大致为:
```json5
{
// 组件或者区块名
"componentName": "BlockFileName",
"props": {},
"componentType": "Block",
"id": "363d84ba",
"children": [
{
// 子组件是 template
"componentName": "Template",
"props": {
// slot 作为 props说明是插槽
"slot": {
// 插槽名称
"name": "menu",
// 插槽参数
"params": [
"title"
]
}
},
// 插槽内容
"children": [
{
"componentName": "Text",
"props": {
// 这里 text 使用作用域插槽传入的变量,我们绑定变量 title 即可生效
"text": {
"type": "JSExpression",
"value": "title"
}
},
"id": "24212a32"
}
],
"id": "42753254"
}
]
}
```
组件的插槽,也类似于区块插槽,我们在组件物料定义插槽即可:
```json5
{
// 物料 schema 定义
"schema": {
// 定义插槽
"slots": {
// 命名插槽,为 menu
"menu": {
// 在右侧属性面板显示的名称
"label": {
"zh_CN": "menu"
},
// 插槽参数名
"params": ["title"]
}
}
}
}
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Some files were not shown because too many files have changed in this diff Show More