Compare commits

..

1 Commits

Author SHA1 Message Date
junyu 84b09689d7
feat: 增加物料TinyEcharts和TinyTransitions (#478)
* init project

Match-id-61778b743a9dc8d8df471dcb285fb229931648a6

* fix: fix build error (#1)

* fix: fix build error

* fix: fix server dependence

* fix: add logo and fix readme (#5)

* update readme (#6)

* fix: add logo and fix readme

* fix: update readme

* feat: add pnpm to project

* fix(bundle): fix env variable can not be bundle (#16)

* docs: add pr and bug template (#18)

* fix(bindEvents): fix bind Events can not delete (#22)

* feat: 修复当画布没有内容时控制台报错 (#26)

* fix:按钮组数据编辑后显示出错 (#24)

* fix:走马灯属性配置清空标签页后添加标签页显示出错 (#23)

* fix:走马灯属性配置清空标签页后添加标签页显示出错

* fix: 优化走马灯删除标签页问题修复方案

* fix(design-core): build error with monaco-editor (#57)

* fix(page-lock):页面解锁按钮图标修复 (#43)

* fix: 修复无页面时页面内容显示错误问题 (#31)

* fix: 修复不切换页面点击页面设置时表单校验错误问题 (#32)

* fix(block-list-icon):区块管理面板去掉列表图标 (#33)

* fix:区块管理面板去掉列表图标

* fix(block-list-icon):区块管理面板去掉列表图标

* feat(docs): add Milestones (#46)

* feat(chore): update package info (#53)

* feat(chore): update package info

* feat(docs-package): add homepage url

* fix(toolbars): disable toolbar btn when page is empty (#70)

* fix(toolbars): disable toolbar btn when page is empty

* fix(toolbar): disable preview when page is empty

* feat(doc): add doc link to readme (#54)

* fix(style): adjust style detail (#67)

* fix(canvas): change canvas menu item hiding to disabed (#75)

* fix(canvas): fix del key error when nothing is selected (#69)

* feat(chore): add setup script setup environment before serving (#80)

* fix(pluginMaterial): fix block list can't scroll when visible in canvas (#77)

* feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。 (#66)

* feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。

* feat: 方法名修改更加符合语义

* fix:修复属性面板-插槽开关切换schema不正确 (#85)

* fix:时间线步骤条编辑数据,步骤条会消失 (#84)

* fix: 时间线步骤条编辑data,时间线会消失

* Revert "fix: 时间线步骤条编辑data,时间线会消失"

This reverts commit b24f8ba60d.

* fix:时间线步骤条编辑数据,时间线会消失

* fix(pagePlugin): 删除文件夹添加节流,避免多次出现无法删除弹窗 (#74)

* fix(pagePlugin): 删除文件夹添加防抖,避免多次出现无法删除弹窗

* fix(pagePlugin): use throttle by review comment

* fix:loading can't be closed when state is saved (#87)

* fix:loading can't be closed when state is saved

* fix: remove global loading

* fix(metaComponent): fix #79 metaListItems dragging not working (#86)

* fix(pagePlugin): clear some state when delte current page (#72)

* fix(pagePlugin): clear some state when delte current page

* fix(pagePlugin): del unnecessary optional chaining operator

* fix(chore): add code readablity

* fix(chore): optimize code by review comment

* fix: 数据源面板中,点击新建字段报错 (#37)

* fix:修复组件属性绑定工具类函数,出码预览未定义 (#90)

* fix(insert-footer-button):设计器页面设置-输入设置中,保存取消按钮顺序错误,格式化按钮样式错误,应与UI保持一直;大纲书导航中,眼睛图标,建议改为睁开就是可见,闭眼就是不可见;提示框样式修改 (#94)

* fix(insert-footer-button):
设计器页面设置-输入设置中,保存取消按钮顺序错误,格式化按钮样式错误,应与UI保持一致;
大纲树导航中,眼睛图标,建议改为睁开就是可见,闭眼就是不可见;
提示框样式修改

* fix(styles-import): 解决tree组件选中样式背景色为黑色的问题 (#102)

* feat(builtin): builtinComponent 组件独立包抽离 (#52)

* feat(builtin): builtinComponent 组件独立包抽离

* 添加eslint&自动化构建 (#101)

* fix:组件属性绑定工具类utils,修改预览出码实现 (#93)

* fix: 修复空页面执行右键删除和右键复制时控制台报错的问题 (#103)

* fix: 修复空页面执行右键删除和右键复制时控制台报错的问题

* fix: 修复空页面执行右建操作时控制台报错的问题

* refactor: 简化operations空判断代码

* fix: verify operations copy  id

* fix: verify operations copy  id

* fix: verify operations copy  id

* fix: copyNode function verify  params

* fix: 不可操作的菜单项disabled

* fix: 点击disabled菜单项 不关闭菜单

* fix:修复自定义属性新增功能 (#108)

* fix:修复自定义属性新增功能

* fix: 修复MetaHtmlText组件控制台警告

* fix:调整透传Attributes警告解决方案

* fix:调整透传Attributes警告解决方案

* fix:调整透传Attributes警告解决方案

* fix(canvasShortCutPanel): add click event to quick insert component in… (#81)

* fix(canvasShotCutPanel): add click event to quick insert component in shortcutpanel

* fix(canvasShortPanel): add deepclone utils

* feat(utils): add deepClone method

* feat(unit-test): add unit test for deepclone function

* fix: code check (#112)

* fix: code check (#117)

* fix: 变量修改后保存页面,再次修改变量失败 (#110)

* fix:修复国际化参数配置 (#106)

* feat(style): stylePanel add style selector, write css to global styles (#41)

* feat(style): stylePanel add style selector, write css to global styles

* feat(style): classNameSelector support edit and delete

* fix(build): fix setting-style plugin build error

* fix(chore): fix review comment

* fix: 修复DSL出码报错 (#139)

* fix(plugin-script): js plugin code format when save (#138)

* fix: 手动更新画布key导致表格渲染出错 (#129)

* fix(dataSources): 解决collection添加表格时预览报错 #118 (#151)

* feat(block2webcomponent): add block2webcomponent package (#146)

* feat(block2webcomponent): add block2webcomponent package

* fix(build): fix build config uncorrect

* fix(build): change cdn link to npmmirror

* fix:删除lowcodeWrap多余参数 (#119)

* fix(chore): replace unpkg with npmmirror (#149)

* fix(chore): replace unpkg with npmmirror

* fix(dev): dev environment use node_moduels

* fix(chore): sync version

* fix(preview): use npmmirror link

* fix(preview): devtoolapi use unpkg link

* fix(preview): import map add esm cdn

* fix(version): fix tiny-vue version

* fix(version): fix tiny-vue version

* fix(version): fix tiny-vue version

* fix(blockBuild): change packageName to block build (#160)

* fix: 画布中右键弹框,修复添加父级-弹出框功能 (#60)

* fix: 画布中右键弹框,修复添加父级-弹出框功能

* fix: schema缺少children

* fix: 按检视意见修改

* fix: 修复画布宽度设置问题 (#128)

* fix: 修复画布宽度设置问题

* fix: 修复复制静态文件时接口报错 (#175)

* feat:引入第三方组件库element-plus部分组件示例 (#105)

* feat: 引入第三方组件库element-plus示例

* fix:修复格式错误

* feat:表格列配置组件

* feat:增加表格列配置组件

* fix:build error

* fix:修复scheme2code接口报错

* fix:修改import顺序

* fix: 使用import动态导入有cdn的工具类 (#133)

* fix: 使用import动态导入有cdn的工具类

* fix(preview): upgrade vue repl version (#170)

* fix(preview): upgrade vue repl version

* fix(preview): optimized by review comment

* fix:添加style变量赋值 (#154)

* fix: 修复unpkg依赖 (#188)

* fix: 修复unpkg依赖

* fix:固定opentiny/vue的次版本号

* fix:升级devtools-api版本

* fix:CDN域名提取环境变量

* fix:升级opentiny/vue版本

* fix:修改主题样式文件版本

* fix:修复codeCheck

* feat:设计器增加帮助文档说明 (#100)

* fix: 修复多个全局变量下载代码出错 (#197)

* fix: 修复多个全局变量下载代码出错

* fix: 精简应用发布时commit消息的校验规则 (#205)

* feat: 开放区块管理相关功能 (#206)

* feat: add materials script (#195)

增加拆分物料与构建物料脚本

* doc:README添加物料同步脚本说明 (#207)

* feat(generate-vue): change generate vue code location (#201)

* feat(generate-vue): change generate vue code location

* fix(generate-vue): fix generate route did not export

* feat(docs): 增加跟本地后端直连的方案 (#208)

* docs(readme): 增加后端的启动描述

* feat(chore): change dependencies type to workspace:* (#216)

* chore: add code review action (#215)

* chore(release): publish (#219)

* chore(release): publish

 - @opentiny/tiny-engine-mock@1.0.1
 - @opentiny/tiny-engine-block-build@1.0.0
 - @opentiny/tiny-engine-builtin-component@1.0.0
 - @opentiny/tiny-engine-canvas@1.0.1
 - @opentiny/tiny-engine-common@1.0.1
 - @opentiny/tiny-engine-controller@1.0.1
 - @opentiny/tiny-engine@1.0.0-beta.2
 - @opentiny/tiny-engine-http@1.0.1
 - @opentiny/tiny-engine-i18n-host@1.0.1
 - @opentiny/tiny-engine-plugin-block@1.0.2
 - @opentiny/tiny-engine-plugin-bridge@1.0.2
 - @opentiny/tiny-engine-plugin-data@1.0.2
 - @opentiny/tiny-engine-plugin-datasource@1.0.2
 - @opentiny/tiny-engine-plugin-help@1.0.2
 - @opentiny/tiny-engine-plugin-i18n@1.0.2
 - @opentiny/tiny-engine-plugin-materials@1.0.2
 - @opentiny/tiny-engine-plugin-page@1.0.2
 - @opentiny/tiny-engine-plugin-robot@1.0.2
 - @opentiny/tiny-engine-plugin-schema@1.0.2
 - @opentiny/tiny-engine-plugin-script@1.0.2
 - @opentiny/tiny-engine-plugin-tree@1.0.2
 - @opentiny/tiny-engine-plugin-tutorial@1.0.2
 - @opentiny/tiny-engine-setting-design@1.0.2
 - @opentiny/tiny-engine-setting-events@1.0.2
 - @opentiny/tiny-engine-setting-props@1.0.2
 - @opentiny/tiny-engine-setting-styles@1.0.2
 - @opentiny/tiny-engine-svgs@1.0.2
 - @opentiny/tiny-engine-theme-dark@1.0.2
 - @opentiny/tiny-engine-theme-light@1.0.3
 - @opentiny/tiny-engine-toolbar-breadcrumb@1.0.2
 - @opentiny/tiny-engine-toolbar-clean@1.0.2
 - @opentiny/tiny-engine-toolbar-collaboration@1.0.2
 - @opentiny/tiny-engine-toolbar-fullscreen@1.0.2
 - @opentiny/tiny-engine-toolbar-generate-vue@1.0.2
 - @opentiny/tiny-engine-toolbar-lang@1.0.2
 - @opentiny/tiny-engine-toolbar-layout@1.0.2
 - @opentiny/tiny-engine-toolbar-checkinout@1.0.2
 - @opentiny/tiny-engine-toolbar-logo@1.0.2
 - @opentiny/tiny-engine-toolbar-logout@1.0.2
 - @opentiny/tiny-engine-toolbar-media@1.0.2
 - @opentiny/tiny-engine-toolbar-preview@1.0.2
 - @opentiny/tiny-engine-toolbar-redoundo@1.0.2
 - @opentiny/tiny-engine-toolbar-refresh@1.0.2
 - @opentiny/tiny-engine-toolbar-save@1.0.2
 - @opentiny/tiny-engine-toolbar-setting@1.0.2
 - @opentiny/tiny-engine-utils@1.0.2
 - @opentiny/tiny-engine-dsl-vue@1.0.2
 - @opentiny/tiny-engine-webcomponent-core@1.0.2

* chore(release): publish

 - @opentiny/tiny-engine-mock@1.0.2
 - @opentiny/tiny-engine-block-build@1.0.1
 - @opentiny/tiny-engine-builtin-component@1.0.0
 - @opentiny/tiny-engine-canvas@1.0.2
 - @opentiny/tiny-engine-common@1.0.1
 - @opentiny/tiny-engine-controller@1.0.2
 - @opentiny/tiny-engine@1.0.0-beta.3
 - @opentiny/tiny-engine-http@1.0.1
 - @opentiny/tiny-engine-i18n-host@1.0.2
 - @opentiny/tiny-engine-plugin-block@1.0.2
 - @opentiny/tiny-engine-plugin-bridge@1.0.2
 - @opentiny/tiny-engine-plugin-data@1.0.2
 - @opentiny/tiny-engine-plugin-datasource@1.0.2
 - @opentiny/tiny-engine-plugin-help@1.0.2
 - @opentiny/tiny-engine-plugin-i18n@1.0.2
 - @opentiny/tiny-engine-plugin-materials@1.0.2
 - @opentiny/tiny-engine-plugin-page@1.0.2
 - @opentiny/tiny-engine-plugin-robot@1.0.2
 - @opentiny/tiny-engine-plugin-schema@1.0.2
 - @opentiny/tiny-engine-plugin-script@1.0.2
 - @opentiny/tiny-engine-plugin-tree@1.0.2
 - @opentiny/tiny-engine-plugin-tutorial@1.0.2
 - @opentiny/tiny-engine-setting-design@1.0.2
 - @opentiny/tiny-engine-setting-events@1.0.2
 - @opentiny/tiny-engine-setting-props@1.0.2
 - @opentiny/tiny-engine-setting-styles@1.0.2
 - @opentiny/tiny-engine-svgs@1.0.3
 - @opentiny/tiny-engine-theme-dark@1.0.3
 - @opentiny/tiny-engine-theme-light@1.0.4
 - @opentiny/tiny-engine-toolbar-breadcrumb@1.0.2
 - @opentiny/tiny-engine-toolbar-clean@1.0.2
 - @opentiny/tiny-engine-toolbar-collaboration@1.0.2
 - @opentiny/tiny-engine-toolbar-fullscreen@1.0.2
 - @opentiny/tiny-engine-toolbar-generate-vue@1.0.2
 - @opentiny/tiny-engine-toolbar-lang@1.0.3
 - @opentiny/tiny-engine-toolbar-layout@1.0.3
 - @opentiny/tiny-engine-toolbar-checkinout@1.0.2
 - @opentiny/tiny-engine-toolbar-logo@1.0.2
 - @opentiny/tiny-engine-toolbar-logout@1.0.3
 - @opentiny/tiny-engine-toolbar-media@1.0.2
 - @opentiny/tiny-engine-toolbar-preview@1.0.2
 - @opentiny/tiny-engine-toolbar-redoundo@1.0.2
 - @opentiny/tiny-engine-toolbar-refresh@1.0.2
 - @opentiny/tiny-engine-toolbar-save@1.0.2
 - @opentiny/tiny-engine-toolbar-setting@1.0.2
 - @opentiny/tiny-engine-utils@1.0.3
 - @opentiny/tiny-engine-dsl-vue@1.0.2
 - @opentiny/tiny-engine-webcomponent-core@1.0.3

* fix: 修复数据源mock数据不一致 (#211)

* fix: 修复数据源mock数据不一致

* fix:修复构建物料资产包重复组件

* fix:修改css文件cdn域名 (#228)

* fix:修改css文件cdn地址

* fix default img can't change width and height (#189)

* fix:插件面板固定后画布未自适应 (#234)

* fix: 修复数据源mock数据不一致

* fix:插件面板固定后画布未自适应

* fix:插件面板固定后画布未自适应

* fix:修复eslint报错

* [plugin-data] Fix state use jsfunction issue (#237)

* feat(monaco-editor-completion): 隔离不同代码编辑器自动补全的注册,变量声明增加自动补全去掉js函数和state变量的自动补全提示

* feat(state): 状态管理使用JS表达式创建变量的时候提示不可使用其他变量以及JS函数

* fix:materials sql (#231)

* fix: 修复数据源mock数据不一致

* fix:新增组件写入sql数据问题

* fix:修复资源管理工具类型切换 (#239)

* fix:修复资源管理工具类型切换

* fix: 左右两侧面板宽度固定为280px (#230)

* fix(styles-spacing): 增大物料设置内外边距时点击区域 #134 (#184)

* fix(styles-spacing): 增大物料设置内外边距时点击区域 #134

* fix:预览引入builtin组件依赖,built组件样式文件注入js (#251)

* add config (#262)

* add config

* update config

* fix: 修复由于物料边框引起的左侧面板样式问题 (#247)

* fix: 设计器构建后使用vue runtime prod build(本地开发保持development, preview预览保持development) (#254)

* fix(canvas-renderer): 修复 isNative component 判断失效的 bug (#241)

* feat: js panel add jsx support  (#253)

* feat: JS面板支持JSX语法

* fix: 画布解析JS表达式时支持JSX语法

* fix: 修复画布解析JSX表达式时会返回undefined

* feat: 添加Tree和Tooltip的自定义渲染函数属性

* fix: 修改变量名

* fix(toolbar-save): 修复保存时红色 icon 相对位置丢失的 bug (#250)

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互 (#238)

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互-细节优化

* feat(setting-stylePanel): 样式面板编辑全局样式新UI与交互-细节优化

* fix(settingPanel-style): 样式面板新交互细节调整

* fix(setting-stylePanel): 修复样式选择器颜色不对的 bug

* fix(setting-stylePanel): 样式选择器间距调整

* fix(setting-stylePanel): 调整样式选择器距离顶部距离与下拉列表滚动条颜色

* feat(setting-style): add help link button

* fix(setting-style): delete empty row by code review

* fix(material-panel-svg): 修复物料左侧插件面板里图标旋转的问题 (#280)

* docs(readme): 增加后端的启动描述

* docs(readme): 增加后端的启动描述

* docs(readme): 增加后端的启动描述

* docs(readme): 增加后端的启动描述

* docs(readme): 更新图片地址

* docs(readme): 更新图片地址

* fix(material-panel-svg): 修复物料左侧插件面板里图标旋转的问题

* fix:组件sql语句字段校验、提示优化 (#275)

* fix:修复新增组件sql语句字段校验

* fix:优化脚本提示

* fix:函数名优化

* fix:修复更新的sql问题

* fix:TinyTabItem、TinyBreadcrumbItem组件配置有误 (#272)

* fix:TinyTabItem、TinyBreadcrumbItem组件配置有误

* fix:修复tiny-vue组件导出名称有误

* fix: 修复robot plugin不存在时发生的白屏错误 (#271)

* fix: 修复robot plugin不存在时发生的白屏错误

* styled: 修改代码风格

* fix: 修改监视意见

* fix: 修复画布选中框的显示层级不正确的问题 (#246)

* fix: 修复画布选中框的显示层级不正确的问题

* fix: 修正错误注释

* fix: 选中节点后支持横向滚动到节点

* fix: 根据垂直滚动条调整工具操作条位置

* fix: 删除冗余代码

* fix: 代码优化

* fix: 修改变量名称

* fix: 调整函数顺序,消除eslint错误

* feat: 移除前端解锁前判断权限的逻辑,适配后台解锁接口 (#276)

* 修复画布没有根元素,与vue出码、预览不一致 (#259)

* feat: 页面输入输出配置,配置内有内容时,按钮替换为展示部分文案内容。

* feat: 方法名修改更加符合语义

* fix: 1. 给画布添加根元素(与出码、预览保持一致)。2. 选中画布相当于选中根节点,右侧面板会出现可以添加属性的节点。3. 可以支持给根节点添加类名,id、ref,并修改样式。 4. 支持给根元素添加事件,循环等

* fix: 意见修复

* fix: 修复较低的分辨率下画布初始缩放不正确的问题 (#274)

* fix(common): fix lifecycle unmount completionProvider null state caught error (#281)

* fix: 修改远程字段发送请求无效 (#278)

* fix:修复修改远程字段发送请求无效

* fix:修复请求参数处理函数未生效

* fix:修复数据源表单校验提前退出

* fix:修改提示语

* fix:按review添加注释

* Fix mockServer block group deleted bug (#279)

* fix:修复第三方组件无法渲染 (#288)

* fix:修复第三方组件无法渲染

* fix:区分环境加载prod

* fix(chore): sync vue version (#285)

* fix(chore): sync vue version

* fix(chore): sync vue-i18n version

* fix(chore): change vue and vue-i18n to peerdependencies

* fix(chore): update block build dependencies

* fix(chore): change vue-generator dependencies to update

* fix(upload-button)修复下载按钮弹出没有遮罩 (#300)

* fix: 修复新建区块的表单确定时未校验的问题 (#302)

* fix: 修复代码编辑器全屏时的样式问题 (#303)

* fix: 修复属性面板中设置空字符串的问题 (#307)

* fix(setting-stylePanel): 只允许有一个 id,样式选择器只能添加一个 id (#295)

* fix(plugin-page): setting home should not close settingPanel (#308)

* feat(setting-advanced): addcustomEvent popover change to dialog (#297)

* feat(setting-advanced): addcustomEvent popover change to dialog

* fix(setting-advanced): add custom event align left with modal title

* fix(style): delete selected symbol on select component (#306)

* fix(style): delete selected symbol on select component

* fix(style): delete space after delete selectedSymbol

* fix(http): 优化 http 接口报错 ui, 接口详情不展示在 title (#293)

* fix: 修复preview生产打包的时候repl引入的monaco-editor里的worker跨域报错 (#245)

* fix: 修复preview生产打包的时候repl引入的monaco-editor里的worker跨域报错

* feat(design-core/preview): 预览增加调试按钮来打开vue-repl编辑模式,并实现编辑器懒加载

* fix(design-core/preview): 修复repl-patch引入脚本路径模块化不支持importScripts问题

* fix: 数据源远程字段表单验证样式修改 (#309)

* fix: 数据源远程字段表单验证样式修改

* fix:资源管理工具类型文字字色与设计稿不一致 (#319)

* fix:资源管理工具类型文字字色与设计稿不一致

* fix:调整资源工具类型字体

* bundle.json and tiny-vue.css is 404 in prod mode (#315)

* chore(release): publish (#320)

- @opentiny/tiny-engine-mock: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-block-build: 1.0.1 => 1.0.2
- @opentiny/tiny-engine-builtin-component: 1.0.0 => 1.0.1
- @opentiny/tiny-engine-canvas: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-common: 1.0.1 => 1.0.2
- @opentiny/tiny-engine-controller: 1.0.2 => 1.0.3
- @opentiny/tiny-engine: 1.0.0-beta.3 => 1.0.0-beta.4
- @opentiny/tiny-engine-http: 1.0.1 => 1.0.2
- @opentiny/tiny-engine-i18n-host: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-block: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-bridge: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-data: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-datasource: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-help: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-i18n: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-materials: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-page: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-robot: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-schema: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-script: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-tree: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-plugin-tutorial: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-design: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-events: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-props: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-setting-styles: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-svgs: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-theme-dark: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-theme-light: 1.0.4 => 1.0.5
- @opentiny/tiny-engine-toolbar-breadcrumb: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-clean: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-collaboration: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-fullscreen: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-generate-vue: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-lang: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-toolbar-layout: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-toolbar-checkinout: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-logo: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-logout: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-toolbar-media: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-preview: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-redoundo: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-refresh: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-save: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-toolbar-setting: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-utils: 1.0.3 => 1.0.4
- @opentiny/tiny-engine-dsl-vue: 1.0.2 => 1.0.3
- @opentiny/tiny-engine-webcomponent-core: 1.0.3 => 1.0.4

* refactor: 解决子包循环依赖问题 (#313)

* refactor: move common/js to controller/js

* refactor: replace common/js

* refactor: replace ../js

* refactor: update package.json

* refactor: resolve canvas rely on common

* refactor: remove controller deps in http

* refactor: add canvas renderer state

* refactor: remove useless file ext

* refactor: modify controller deps path

* refactor: fix eslint

* refactor: resolve http env

* fix: switch page error (#331)

* fix: drag block into canvas error (#336)

* fix: canvas api error (#338)

* fix(datasource): data type icon invisible #312 (#332)

* fix(datasource): data type icon invisible

* fix(common): #325 reduce unnecessary network requests.

* style(datasource): remove unnecessary comment

---------

Co-authored-by: zeyong.cai <zeyong.cai@xquant.com>

* fix(build): 修复构建设计器产物 ref 值未转化的 bug (#347)

* fix(preview): fix preview vue-repl unsupport jsx bug (#343)

* docs: add project name to issue template (#335)

* feat: 状态管理代码编辑UI优化 (#318)

* feat: 状态管理代码编辑UI优化

* fix(material): elTable formatter should be function type (#355)

* fix(readme-build): 添加Readme中构建产物所在文件夹信息 (#367)

* fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug (#340)

* fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug

* fix(scrollbar): change by review comment

* fix(theme-scrollbar): change by review comment

* fix(theme-base): apply default scrollbar style to body * children

* docs: 文件名称CHANGELOG拼写错误,修改文件名称 (#389)

* fix(errorMonitor): add config for errormonitor (#381)

* fix(controller-environment): preserve import.meta.env variable when build controller lib (#380)

* fix(settings): fix text wrap of bind condition (#391)

Fixes #370

* feat:增加物料:TinyDatePicker和TinyNumeric (#399)

* 增加物料:TinyDatePicker和TinyNumeric

* 修改disabled使用MetaSwitch

* Fix:编辑器设置dark主题后预览页header文字颜色不正确 (#403)

* fix:编辑器设置dark主题后预览页header文字颜色不正确

* fix:调整主题

* fix(material): add buttonComponentsMap config (#395)

* fix(demo-data): 修复官方 demo 页面底部确认购买模块移动端设备宽度下被遮住的场景 (#398)

* fix(err-monitor): stop monitoring if monitorurl not exist (#423)

* fix(err-monitor): stop monitoring if monitorurl not exist

* fix(error-monitor): cancel request if url not exist

* fix(chore): fix some vue warining on console (#421)

* fix(controller): build with env variable (#420)

* Feat provide eslint prettier modify config (#385)

* fix(monaco-eslint): 修复eslint-worker支持问题

* fix(linter): 解决cdn后eslint worker相对路径问题

* fix: 移除多余的包

* feat(controller): eslint、prettier新增配置文件,worker文件打包从主应用改为随着分应用打包

* fix(controller): 修复eslint worker地址

* feat(controller): eslint-linter-browserify 降版本

* build: 去掉define process.env设置为空对象(旧版tinyVue库需要),当前引起eslint-linter-browserify脚本(已经处理过process的包)构建报错,且主应用有nodePollyfill可以处理process场景重复了

* fix(controller): 去掉多余注释和测试代码注释

* fix: 解决代码检视问题, 去掉注释,补充包引用去掉external,去掉多余的新增依赖

* feat: 单页预览格式化统一引用prettierrc文件配置

* fix: 解决子包的js没有打包为入口的问题

* fix(controller): 修复因目录结构改变需要worker打包为相对地址

* fix: 修复画布组件嵌套拖拽的问题 (#364)

* fix: 修复画布组件嵌套拖拽的问题

* fix: 修复画布设置成自由布局后无法拖动drag-resize改变宽高的问题 (#393)

* fix(canvas): wrapper runner render contextinitializationwithfunction#161(#426)

* fix(chore): update pr check node version (#431)

* fix(dsl-page):修复本地运行中对于props属性引用utils出码报错的问题 (#346)

* fix(dsl-page):修复对于props属性引用utils出码报错的问题

* fix(dsl-page):修复对于props属性引用utils出码报错的问题-review

* fix(plugin-dataSource): 修复数据源面板新增时未校验名称的重复性 (#434)

* fix: 修改滚动到节点的逻辑,适配超宽超高组件 (#428)

* fix(data-source): on configuring static data panel, the batch delete button should horizontally aligned. (#413)

* 【设计器】静态数据配置面板,批量删除未对齐 BUG202403140918

* (style-position)修复样式定位reset后未恢复默认值 (#433)

* fix(chore): fix vue version of 3.4.24 caught tiny-select component error (#445)

* 修复918.json mock数据不一致问题 (#452)

* 新建区块弹出框点击遮罩层会关闭 (#447)

* fix(block-diff): 修复区块发布是查看差异保存时schema出错的bug (#453)

* fix(dataSource): 数据源新增字段时,新增的表单设置在列表头部,且数组插入数据时插入到头部 (#454)

* fix(reset-button): 修复样式配置中重置按钮的样式和设计稿不一致的问题 (#435)

* Fix/serarch empty:为对部分功能设置搜索为空样式处理 (#446)

* 修复新增页面搜索条件存在并没有触发 (#448)

* fix(canvas-CanvasContainer):  修改Model单词拼写错误 (#468)

* fix(canvas): add placeholder for empty container #365 (#436)

* fix(canvas): add placeholder for empty container

* feat(canvas-render): optimize by review comment

* feat(canvasApi): use canvasApi to access canvas methods (#425)

* feat(canvasApi): use canvasApi to access canvas methods

* fix(canvas): optimize import order

* fix(canvasApi): change by review comment tips

* feat(chore): update OpenTinyVue version (#457)

* feat(chore): update OpenTinyVue version

* feat(chore): update opentinyvue version

* fix(breadcrumb): fix breadcrumb style after update opentiny vue version

* feat(chore): change opentinyvue to peer dependencies

* feat(builtinComponent): add vue to peerDependencies

* feat(vue-dsl): add app generate code (#178)

* feat(vue-dsl): add app generate code

* feat(vue-dsl): add app generate code

* feat(vue-dsl): add generate global store code

* feat(vue-dsl): delete parse config and parse schema hook

* feat(tempalte): refra generateTemplate logic

* feat(vue-generator): add generate script frame code

* feat(vue-generator): add hook flow for sfc file generate

* feat(vue-generator): support generate sfc script

* feat(vue-generator): support jsx generate

* fix(vue-generator): fix double quotes issue

* feat(vue-generator): handle app generate code

* feat(toolbar-generate-vue): toolbar-generate-vue use new codegen function

* feat(vue-generator): add requiredBlock parser

* feat(docs): add readme doc

* feat(docs): add more docs

* fix(vue-generator): adapt for more scenario

* feat(vue-generator): support tiny-grid editor use tiny component

* fix(vue-generator): complete unit test

* fix(vue-generator): add unit test

* feat(vue-generator): add sfc generator unit test

* feat(vue-generator[docs]): add contributing docs

* feat(vue-generator): add test coverage script and app generate test case

* fix(generate-vue): optimize desc and file list

* fix(vue-generate): [template] fix viteConfig process.env is processed

* fix(vue-generator): escape process.env string

* feat(vue-generator): support builtin components

* fix(vue-generator): add builtin componentsMap

* fix(vue-generator): fix bind utils props

* fix(vue-generator): support utils expression

* fix(vue-generator): support children expression add utils

* fix(vue-generator): support nested folder page

* fix(vue-generator): support get datasource with name

* fix(vue-generator): only write necessary dependencies into package.json

* feat(vue-generator): simplified genTemplate hooks

* fix(vue-generator): update vue-generator  docs

* feat(vue-generator): detect jsx on custom  method

* feat(vue-generator): add d.ts types declaration

* build: 公共依赖cdn解耦并增加开关控制 (#360)

* build: external public cdn localize 公共cdn依赖包支持本地化

* build: cdn外部依赖解耦,修复baseUrl获取

* build: cdn依赖解耦 修正baseUrl获取方式

* build: cdn依赖三方解耦,优化目录型拷贝

* build: cdn依赖解耦,解决目录复制文件的相对路径问题

* build(design-core): 修复monaco的worker使用cdn地址前缀的情况下打包失效

* build: 本地开发也支持脱离cdn三方依赖

* build: 去除代码注释

* build: 三方cdn依赖解耦  物料bundle文件依赖支持替换cdn依赖

* build(design-core) 去除冗余用不到的文件和配置项硬编码

* build: 公共依赖cdn解耦测试完成 开关默认关闭

* refactor: 简化三方cdn依赖解耦的正则,改为path方法

* refactor: 三方依赖解耦脚本代码优化,减少雷同的正则匹配

* refactor: 三方cdn依赖解耦脚本 简化合并正则

* build: 三方cdn解耦 物料本地打包逻辑优化修正

* build: 三方cdn依赖解耦,优化代码简化正则,修复计算版本号问题,修复函数名大小写问题

* build: 优化importMap版本站位符号

* build: 三方cdn物料解耦 变量改为环境变量

* build: 三方cdn依赖解耦 补充处理复制文件夹时候的去重

* fix: 三方cdn解耦, 解决本地启动问题

* feat(preview): preview也支持cdn依赖解耦

* refactor(desing-core/scripts): 重构复制cdn文件本地复制模块

* build:  重构预览的importMap复制逻辑,修复两个importMap文件不存在

* build: 进一步优化monacoEditor地址,直接打包不再跨网络获取

* refactor(design-core/scripts): 调整复制应用importMap函数的参数顺序,与其他结构类似

* refactor(design-core/script): 调整文件位置和文件引用顺序

* feat(design-core/preview): preview importMap.js 使用 importMap.json 数据归一

* fix(design-core/preview): 修复importJson的引用

* fix: mock端口号订正,解决element-plus拖入画布后无法渲染

* build(design-core/script): 修复临时安装包插件安装完包后返回目录不正确

* fix: 修正monaco-editor的worker资源的打包地址

* build(design-core/script): 修复临时安装包插件安装完包后返回目录不正确

* fix(design-core/preview): 修正cdn解耦preview获取动态的importMap.json的base路径问题

* build: 三方cdn解耦,优化拷贝脚本,修复文件夹当文件拷贝当文件夹是包路径时候目标路径版本号丢失

* build: 三方cdn解耦,解决包未安装的情况下,glob匹配不到文件导致打包不拷贝内容

* fix: 根据检视意见使用fs-extra readJsonSync替代utils工具函数

* fix: 根据检视意见修改函数名大小写和端口号读取

* feat: 三方物料解耦 preview变量替换增加注释

* feat: 根据检视意见修改函数名字

* refactor: 根据检视意见,将脚本函数的参数整改为对象,并把目录值迁移到参数默认值

* docs(design-core/scripts): 三方cdn解耦 修正描述错误

* fix: 三方cdn解耦 修正preview脚本TinyVue版本号

* feat: 增加物料TinyEcharts和TinyTransitions

* tiny-echarts v0.0.31

---------

Co-authored-by: OpenTiny <opentiny@sina.com>
Co-authored-by: ajaxzheng <894103554@qq.com>
Co-authored-by: chilingling <26962197+chilingling@users.noreply.github.com>
Co-authored-by: wenmine <wwmmail@foxmail.com>
Co-authored-by: lhuans <145339349+lhuans@users.noreply.github.com>
Co-authored-by: yaoyun8 <142570291+yaoyun8@users.noreply.github.com>
Co-authored-by: Hexqi <wu_12556@126.com>
Co-authored-by: tianxin <146069396+ianxinnew@users.noreply.github.com>
Co-authored-by: gargameljyh <58694428+gargameljyh@users.noreply.github.com>
Co-authored-by: lichunn <46984087+lichunn@users.noreply.github.com>
Co-authored-by: Xppp0217 <82315158+Xppp0217@users.noreply.github.com>
Co-authored-by: lizhijie429 <632163606@qq.com>
Co-authored-by: Gene <Pacify.98@gmail.com>
Co-authored-by: rhlin <r.h.lin@live.cn>
Co-authored-by: Lu17301156525 <128358973+Lu17301156525@users.noreply.github.com>
Co-authored-by: rhlin <r.h.lin@163.com>
Co-authored-by: GaoNeng <31283122+GaoNeng-wWw@users.noreply.github.com>
Co-authored-by: abin <luocongqiu@gmail.com>
Co-authored-by: zeyong tsai <tsai.zeyong@icloud.com>
Co-authored-by: zeyong.cai <zeyong.cai@xquant.com>
Co-authored-by: Kagol <kagol@sina.com>
Co-authored-by: yuhki <128052955+yuhkikele@users.noreply.github.com>
Co-authored-by: Xie Jay <xiejay97@gmail.com>
Co-authored-by: fox ouyang <stwflyfox@163.com>
Co-authored-by: 凌览 <58327088+CatsAndMice@users.noreply.github.com>
Co-authored-by: betterdancing <liulinclear@163.com>
Co-authored-by: jxhhdx <40119767+jxhhdx@users.noreply.github.com>
Co-authored-by: zhoujunyu <rainrcn@qq.com>
2024-05-14 10:56:27 +08:00
33 changed files with 902 additions and 466 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|mockServer/assets

23
.github/workflows/ai-code-review.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: AI Code Review
permissions:
contents: read
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: Chinese
OPENAI_API_ENDPOINT: https://api.openai.com/v1
MODEL: gpt-3.5-turbo
MAX_TOKENS: 4096
MAX_PATCH_LENGTH: 10000

View File

@ -24,7 +24,7 @@ jobs:
- name: Get changed files
id: get_changed_files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v40
with:
files: |
**.js

View File

@ -1974,48 +1974,6 @@
"destructuring": true,
"version": "0.1.16"
},
{
"componentName": "ElInput",
"package": "element-plus",
"exportName": "ElInput",
"destructuring": true,
"version": "2.4.2"
},
{
"componentName": "ElButton",
"package": "element-plus",
"exportName": "ElButton",
"destructuring": true,
"version": "2.4.2"
},
{
"componentName": "ElForm",
"package": "element-plus",
"exportName": "ElForm",
"destructuring": true,
"version": "2.4.2"
},
{
"componentName": "ElFormItem",
"package": "element-plus",
"exportName": "ElFormItem",
"destructuring": true,
"version": "2.4.2"
},
{
"componentName": "ElTable",
"package": "element-plus",
"exportName": "ElTable",
"destructuring": true,
"version": "2.4.2"
},
{
"componentName": "ElTableColumn",
"package": "element-plus",
"exportName": "ElTableColumn",
"destructuring": true,
"version": "2.4.2"
},
{
"componentName": "PortalHome",
"main": "common/components/home",

View File

@ -117,7 +117,6 @@ import {
IconEyeclose
} from '@opentiny/vue-icon'
import {
canvasState,
getCurrent,
removeNodeById,
selectNode,
@ -380,14 +379,15 @@ export default {
}
}
const getStyleValues = (selectState, canvasSize, labelWidth, optionWidth) => {
const getStyleValues = (selectState, siteCanvasWidth, siteCanvasHeight) => {
const { left, top, width, height, doc } = selectState
const { width: canvasWidth, height: canvasHeight } = canvasSize
const labelRect = labelRef.value.getBoundingClientRect()
const optionRect = optionRef.value.getBoundingClientRect()
//
const fullRectWidth = labelWidth + optionWidth + OPTION_SPACE
const fullRectWidth = labelRect.width + optionRect.width + OPTION_SPACE
// label top
const isLabelAtBottom = top < LABEL_HEIGHT
const isLabelAtBottom = top <= LABEL_HEIGHT
const labelAlign = new Align({
alignLeft: true,
horizontalValue: 0,
@ -396,7 +396,7 @@ export default {
})
//
const isOptionAtBottom = canvasHeight - top - height >= OPTION_BAR_HEIGHT
const isOptionAtBottom = siteCanvasHeight - top - height > OPTION_BAR_HEIGHT
const optionAlign = new Align({
alignLeft: false,
horizontalValue: 0,
@ -410,13 +410,13 @@ export default {
//
// labelabellabel
const isLabelAlignRight = labelWidth > width && left + labelWidth + scrollBarWidth > canvasWidth
const isLabelAlignRight = labelRect.width > width && left + labelRect.width + scrollBarWidth > siteCanvasWidth
if (isLabelAlignRight) {
labelAlign.align(positions.RIGHT)
}
// optionoptionoption
const isOptionAlignLeft = optionWidth > width && left + width - optionWidth < 0
const isOptionAlignLeft = optionRect.width > width && left + width - optionRect.width < 0
if (isOptionAlignLeft) {
optionAlign.align(positions.LEFT)
}
@ -424,14 +424,14 @@ export default {
if (isLabelAtBottom === isOptionAtBottom) {
//
if (left + fullRectWidth < canvasWidth) {
if (left + fullRectWidth < siteCanvasWidth) {
//
labelAlign.align(positions.LEFT)
optionAlign.align(positions.LEFT, labelWidth + OPTION_SPACE)
optionAlign.align(positions.LEFT, labelRect.width + OPTION_SPACE)
} else {
//
optionAlign.align(positions.RIGHT)
labelAlign.align(positions.RIGHT, optionWidth + OPTION_SPACE)
labelAlign.align(positions.RIGHT, optionRect.width + OPTION_SPACE)
}
}
} else {
@ -439,10 +439,10 @@ export default {
labelAlign.align(positions.LEFT, Math.min(-left, width - fullRectWidth))
}
if (left + width + scrollBarWidth > canvasWidth) {
if (left + width + scrollBarWidth > siteCanvasWidth) {
optionAlign.align(
positions.RIGHT,
Math.min(left + width + scrollBarWidth - canvasWidth, width - fullRectWidth)
Math.min(left + width + scrollBarWidth - siteCanvasWidth, width - fullRectWidth)
)
}
}
@ -454,7 +454,8 @@ export default {
}
watchPostEffect(async () => {
const { left, top, width, height, doc } = props.selectState
let { left } = props.selectState
const { top, width, height, doc } = props.selectState
// nextTickrefawait
await nextTick()
@ -469,17 +470,15 @@ export default {
return
}
const siteCanvasRect = document.querySelector('.site-canvas').getBoundingClientRect()
const scale = useLayout().getScale()
const canvasRect = canvasState.iframe.getBoundingClientRect()
const { width: labelWidth } = labelRef.value.getBoundingClientRect()
const { width: optionWidth } = optionRef.value.getBoundingClientRect()
// canvasiframeiframeclientRectscale
left -= ((1 - scale) / 2) * siteCanvasRect.width
const { labelStyleValue, optionStyleValue } = getStyleValues(
{ left, top, width, height, doc },
{ width: canvasRect.width / scale, height: canvasRect.height / scale },
labelWidth / scale,
optionWidth / scale
siteCanvasRect.width * scale,
siteCanvasRect.height
)
labelStyle.value = labelStyleValue

View File

@ -50,6 +50,7 @@ import {
updateRect,
getElement,
dragStart,
getOffset,
selectNode,
initCanvas,
clearLineState,
@ -100,7 +101,7 @@ export default {
//
if (event.button === 2) {
openMenu(event)
openMenu(getOffset(event.target), event)
}
}
}

View File

@ -43,8 +43,7 @@ const ROW_SNIPPET = {
grow: true,
shrink: true,
widthType: 'auto'
},
children: []
}
}
]
}
@ -104,7 +103,16 @@ export default {
if (schema.componentName === 'CanvasCol') {
//
if (!schema.children?.length) {
schema.children = [extend(true, {}, ROW_SNIPPET), extend(true, {}, ROW_SNIPPET)]
schema.children = [
{
...extend(true, {}, ROW_SNIPPET),
children: [{ ...extend(true, {}, COL_SNIPPET) }]
},
{
...extend(true, {}, ROW_SNIPPET),
children: [{ ...extend(true, {}, COL_SNIPPET) }]
}
]
} else if (schema.children[0].componentName !== 'CanvasRow') {
// row children row col
schema.children = [
@ -121,7 +129,7 @@ export default {
]
} else {
//
schema.children.push(extend(true, {}, ROW_SNIPPET))
schema.children.push(...extend(true, {}, ROW_SNIPPET))
}
}
@ -194,7 +202,7 @@ export default {
<style lang="less" scoped>
.divider-wrapper {
position: absolute;
position: fixed;
display: flex;
align-items: center;
justify-content: center;
@ -231,7 +239,7 @@ export default {
}
.divider-line {
position: absolute;
position: fixed;
border: 1px dashed var(--ti-lowcode-common-primary-color);
z-index: 2;
}

View File

@ -15,7 +15,7 @@
<span>{{ item.name }}</span>
<span v-if="item.items"><icon-right></icon-right></span>
</div>
<ul v-if="item.items && current === item" class="sub-menu menu-item" :style="subMenuStyles">
<ul v-if="item.items && current === item" class="sub-menu menu-item">
<template v-for="(subItem, subIndex) in item.items" :key="subIndex">
<li
:class="[{ 'menu-item-disabled': subItem.check && !subItem.check?.() }]"
@ -33,7 +33,7 @@
<script lang="jsx">
import { ref, reactive, nextTick } from 'vue'
import { canvasState, getConfigure, getController, getCurrent, copyNode, removeNodeById } from './container'
import { getConfigure, getController, getCurrent, copyNode, removeNodeById } from './container'
import { useLayout, useModal, useCanvas } from '@opentiny/tiny-engine-controller'
import { iconRight } from '@opentiny/vue-icon'
@ -45,35 +45,27 @@ const menuState = reactive({
const current = ref(null)
const menuDom = ref(null)
const subMenuStyles = ref(null)
export const closeMenu = () => {
menuState.show = false
current.value = null
}
export const openMenu = (event) => {
export const openMenu = (offset, event) => {
const { x, y } = offset
const { getScale } = useLayout()
menuState.position = {
left: event.clientX + 2 + 'px',
top: event.clientY + 'px'
// TODO
left: event.clientX * getScale() + x + 2 + 'px',
top: event.clientY * getScale() + y + 'px'
}
menuState.show = sessionStorage.getItem('pageInfo') ? true : false
nextTick(() => {
if (menuDom.value) {
const { right, bottom, width, height } = menuDom.value.getBoundingClientRect()
const canvasRect = canvasState.iframe.getBoundingClientRect()
if (bottom > canvasRect.bottom) {
menuState.position.top = `${parseInt(menuState.position.top) - height}px`
}
if (right > canvasRect.right) {
menuState.position.left = `${parseInt(menuState.position.left) - width - 2}px`
}
// sub-menuwidth100px100
if (right + 100 < canvasRect.right) {
subMenuStyles.value = { right: '-100px' }
} else {
subMenuStyles.value = { left: '-100px' }
const { bottom, height, top } = menuDom.value.getBoundingClientRect()
if (bottom > document.body?.clientHeight) {
menuState.position.top = top - height + 'px'
}
}
})
@ -234,7 +226,6 @@ export default {
close,
current,
menuDom,
subMenuStyles,
actionDisabled,
onShowChildrenMenu
}
@ -244,7 +235,7 @@ export default {
<style lang="less" scoped>
.context-menu {
position: absolute;
position: fixed;
z-index: 10;
}
.menu-item {
@ -285,6 +276,7 @@ export default {
&.sub-menu {
width: 100px;
position: absolute;
right: -100px;
top: -2px;
}
}

View File

@ -17,12 +17,13 @@ import { canvasState } from './container'
export default {
setup() {
const sizeStyle = computed(() => {
const { width, height, maxWidth, minWidth } = useLayout().getDimension()
const { width, maxWidth, minWidth, scale } = useLayout().getDimension()
return {
width,
height,
maxWidth,
minWidth
minWidth,
height: `${100 / scale}%`,
transform: `scale(${scale}) translateY(-${(100 / scale - 100) / 2}%)`
}
})

View File

@ -8,7 +8,6 @@
<script>
import { reactive, watch } from 'vue'
import { useLayout } from '@opentiny/tiny-engine-controller'
import { getCurrent, updateRect, selectState, querySelectById } from './container'
export default {
@ -39,17 +38,12 @@ export default {
}
const handleResize = (event, type) => {
if (!props.iframe) {
return
}
let { clientX, clientY } = event
const iframeRect = props.iframe.getBoundingClientRect()
const scale = useLayout().getScale()
if (type !== 'iframe') {
clientX = (clientX - iframeRect.left) / scale
clientY = (clientY - iframeRect.top) / scale
if (type === 'iframe' && props.iframe) {
const iframeRect = props.iframe.getBoundingClientRect()
clientX += iframeRect.left
clientY += iframeRect.top
}
const { parent, schema } = getCurrent()
@ -71,9 +65,14 @@ export default {
const parentWidth = parseInt(window.getComputedStyle(parentDomNode).width, 10)
//
newWidth = Math.min(newWidth, parentWidth)
if (newWidth >= parentWidth) {
newWidth = parentWidth
}
// 32
newWidth = Math.max(newWidth, 32)
if (newWidth <= 32) {
newWidth = 32
}
schema.props.flexBasis = `${newWidth}px`
schema.props.widthType = 'fixed'
@ -187,7 +186,7 @@ export default {
<style lang="less" scoped>
.resize-border {
position: absolute;
position: fixed;
display: flex;
justify-content: center;
align-items: center;

View File

@ -348,13 +348,16 @@ const setSelectRect = (element) => {
element = element || getDocument().body
const { left, height, top, width } = getRect(element)
const { x, y } = getOffset(element)
const siteCanvasRect = document.querySelector('.site-canvas').getBoundingClientRect()
const componentName = getCurrent().schema?.componentName || ''
const scale = useLayout().getScale()
clearHover()
Object.assign(selectState, {
width,
height,
top,
left,
width: width * scale,
height: height * scale,
top: top * scale + y - siteCanvasRect.y,
left: left * scale + x - siteCanvasRect.x,
componentName,
doc: getDocument()
})
@ -478,6 +481,9 @@ const setHoverRect = (element, data) => {
const configure = getConfigure(componentName)
const rect = getRect(element)
const { left, height, top, width } = rect
const { x, y } = getOffset(element)
const siteCanvasRect = document.querySelector('.site-canvas').getBoundingClientRect()
const scale = useLayout().getScale()
hoverState.configure = configure
@ -506,22 +512,23 @@ const setHoverRect = (element, data) => {
if (childEle) {
const childRect = getRect(childEle)
const { left, height, top, width } = childRect
const { x, y } = getOffset(childEle)
const posLine = getPosLine(childRect, lineState.configure)
Object.assign(lineState, {
width,
height,
top,
left,
width: width * scale,
height: height * scale,
top: top * scale + y - siteCanvasRect.y,
left: left * scale + x - siteCanvasRect.x,
position: canvasState.type === 'absolute' || posLine.type,
forbidden: posLine.forbidden
})
} else {
const posLine = getPosLine(rect, configure)
Object.assign(lineState, {
width,
height,
top,
left,
width: width * scale,
height: height * scale,
top: top * scale + y - siteCanvasRect.y,
left: left * scale + x - siteCanvasRect.x,
position: canvasState.type === 'absolute' || posLine.type,
forbidden: posLine.forbidden
})
@ -532,10 +539,10 @@ const setHoverRect = (element, data) => {
// 设置元素hover状态
Object.assign(hoverState, {
width,
height,
top,
left,
width: width * scale,
height: height * scale,
top: top * scale + y - siteCanvasRect.y,
left: left * scale + x - siteCanvasRect.x,
componentName
})
return undefined

View File

@ -10,7 +10,7 @@
</div>
</div>
<div class="head-content">
<meta-input v-model="state.text" type="textarea" @update:modelValue="change"></meta-input>
<meta-input v-model="state.text" type="textarea" @change="change"></meta-input>
</div>
</template>
<script>

View File

@ -31,9 +31,9 @@
"license": "MIT",
"homepage": "https://opentiny.design/tiny-engine",
"dependencies": {
"@babel/generator": "~7.23.2",
"@babel/parser": "~7.23.2",
"@babel/traverse": "~7.23.2",
"@babel/generator": "7.18.13",
"@babel/parser": "7.18.13",
"@babel/traverse": "7.18.13",
"@opentiny/tiny-engine-builtin-component": "workspace:*",
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-i18n-host": "workspace:*",

View File

@ -30,10 +30,10 @@
"author": "OpenTiny Team",
"license": "MIT",
"dependencies": {
"@babel/core": "~7.23.2",
"@babel/generator": "~7.23.2",
"@babel/parser": "~7.23.2",
"@babel/traverse": "~7.23.2",
"@babel/core": "7.18.13",
"@babel/generator": "7.18.13",
"@babel/parser": "7.18.13",
"@babel/traverse": "7.18.13",
"@opentiny/tiny-engine-canvas": "workspace:*",
"@opentiny/tiny-engine-common": "workspace:*",
"@opentiny/tiny-engine-controller": "workspace:*",

View File

@ -13005,6 +13005,700 @@
"disable": ["copy", "remove"]
}
}
},
{
"icon": "Box",
"name": {
"zh_CN": "图表"
},
"component": "TinyEcharts",
"description": "图表",
"docUrl": "",
"screenshot": "",
"tags": "",
"keywords": "",
"devMode": "proCode",
"npm": {
"package": "tiny-echarts",
"version": "0.0.31",
"dependencies": null,
"exportName": "TinyEcharts",
"script": "https://npm.onmicrosoft.cn/tiny-echarts@0.0.31/dist/index.js",
"css": ""
},
"group": "component",
"category": "扩展组件",
"configure": {
"loop": true,
"condition": true,
"styles": true,
"isContainer": false,
"isModal": false,
"nestingRule": {
"childWhitelist": "",
"parentWhitelist": "",
"descendantBlacklist": "",
"ancestorWhitelist": ""
},
"isNullNode": false,
"isLayout": false,
"rootSelector": "",
"shortcuts": {
"properties": []
},
"contextMenu": {
"actions": [],
"disable": []
},
"clickCapture": false,
"framework": "Vue"
},
"schema": {
"properties": [
{
"label": {
"zh_CN": "基础信息"
},
"description": {
"zh_CN": "基础信息"
},
"content": []
},
{
"name": "1",
"label": {
"zh_CN": "组件属性"
},
"description": {
"zh_CN": "组件属性"
},
"content": [
{
"property": "data",
"label": {
"text": {
"zh_CN": "业务数据"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "object",
"widget": {
"component": "MetaCodeEditor",
"props": {
"language": "json"
}
},
"description": {
"zh_CN": "设置图表的业务数据,数据将默认被合并到option.dataset.source,请参照文档 https://echarts.apache.org/zh/option.html#dataset.source"
}
},
{
"property": "option",
"label": {
"text": {
"zh_CN": "配置数据"
}
},
"required": true,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": ["object", "function"],
"widget": {
"component": "MetaCodeEditor",
"props": {
"language": "json"
}
},
"description": {
"zh_CN": "设置图表的配置数据或函数,请参照文档 https://echarts.apache.org/zh/option.html#title"
}
},
{
"property": "optionOpts",
"label": {
"text": {
"zh_CN": "配置参数"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "object",
"widget": {
"component": "MetaCodeEditor",
"props": {
"language": "json"
}
},
"description": {
"zh_CN": "设置图表的数据刷新参数,请参照文档 https://echarts.apache.org/zh/api.html#echartsInstance.setOption"
}
},
{
"property": "loadingOpts",
"label": {
"text": {
"zh_CN": "加载动画参数"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "object",
"widget": {
"component": "MetaCodeEditor",
"props": {
"language": "json"
}
},
"description": {
"zh_CN": "设置图表的加载动画参数,请参照文档 https://echarts.apache.org/zh/api.html#echartsInstance.showLoading"
}
},
{
"property": "initTheme",
"label": {
"text": {
"zh_CN": "初始化皮肤"
}
},
"description": {
"zh_CN": "设置图表创建时的皮肤样式,请参照文档 https://echarts.apache.org/zh/api.html#echarts.init"
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "string",
"widget": {
"component": "MetaInput",
"props": {}
},
"device": []
},
{
"property": "initOpts",
"label": {
"text": {
"zh_CN": "初始化参数"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "object",
"widget": {
"component": "MetaCodeEditor",
"props": {
"language": "json"
}
},
"description": {
"zh_CN": "设置图表创建时的初始化参数,请参照文档 https://echarts.apache.org/zh/api.html#echarts.init"
}
},
{
"property": "autoResize",
"label": {
"text": {
"zh_CN": "自动缩放"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"widget": {
"component": "MetaSwitch",
"props": {}
},
"description": {
"zh_CN": "设置图表是否自动随容器大小缩放"
},
"labelPosition": "left"
}
]
}
],
"events": {
"onInit": {
"label": {
"zh_CN": "初始化前事件"
},
"description": {
"zh_CN": "图表初始化前触发的回调函数"
},
"type": "event",
"functionInfo": {
"params": [
{
"name": "echarts",
"type": "object",
"defaultValue": null,
"description": {
"zh_CN": "图表库对象"
}
}
],
"returns": {}
},
"defaultValue": ""
},
"onInited": {
"label": {
"zh_CN": "初始化后事件"
},
"description": {
"zh_CN": "图表初始化后触发的回调函数"
},
"type": "event",
"functionInfo": {
"params": [
{
"name": "echartsInstance",
"type": "object",
"defaultValue": null,
"description": {
"zh_CN": "图表实例对象"
}
},
{
"name": "echarts",
"type": "object",
"defaultValue": null,
"description": {
"zh_CN": "图表库对象"
}
}
],
"returns": {}
},
"defaultValue": ""
}
},
"shortcuts": {
"properties": []
},
"contentMenu": {
"actions": []
}
}
},
{
"icon": "carousel",
"name": {
"zh_CN": "过渡动画"
},
"component": "TinyTransitions",
"description": "过渡动画组件",
"docUrl": "",
"screenshot": "",
"tags": "",
"keywords": "",
"devMode": "proCode",
"npm": {
"package": "tiny-transitions",
"version": "0.0.3",
"dependencies": null,
"exportName": "TinyTransitions",
"script": "https://npm.onmicrosoft.cn/tiny-transitions@0.0.3/dist/index.js",
"css": "https://npm.onmicrosoft.cn/tiny-transitions@0.0.3/dist/style.css"
},
"group": "component",
"category": "扩展组件",
"configure": {
"loop": true,
"condition": true,
"styles": true,
"isContainer": true,
"isModal": false,
"nestingRule": {
"childWhitelist": "",
"parentWhitelist": "",
"descendantBlacklist": "",
"ancestorWhitelist": ""
},
"isNullNode": false,
"isLayout": false,
"rootSelector": "",
"shortcuts": {
"properties": []
},
"contextMenu": {
"actions": [],
"disable": []
},
"clickCapture": true,
"framework": "Vue"
},
"schema": {
"properties": [
{
"label": {
"zh_CN": "基础信息"
},
"description": {
"zh_CN": "基础信息"
},
"content": []
},
{
"name": "1",
"label": {
"zh_CN": "组件属性"
},
"description": {
"zh_CN": "组件属性"
},
"content": [
{
"property": "enter",
"label": {
"text": {
"zh_CN": "enter"
}
},
"description": {
"zh_CN": "入场动画"
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "string",
"defaultValue": "",
"widget": {
"component": "MetaSelect",
"props": {
"groups": [
{
"label": "Bouncing",
"content": [
"animate__bounceIn",
"animate__bounceInDown",
"animate__bounceInLeft",
"animate__bounceInRight",
"animate__bounceInUp"
]
},
{
"label": "Fading",
"content": [
"animate__fadeIn",
"animate__fadeInDown",
"animate__fadeInDownBig",
"animate__fadeInLeft",
"animate__fadeInLeftBig",
"animate__fadeInRight",
"animate__fadeInRightBig",
"animate__fadeInUp",
"animate__fadeInUpBig",
"animate__fadeInTopLeft",
"animate__fadeInTopRight",
"animate__fadeInBottomLeft",
"animate__fadeInBottomRight"
]
},
{
"label": "Flipping",
"content": ["animate__flip", "animate__flipInX", "animate__flipInY"]
},
{
"label": "Zooming",
"content": [
"animate__zoomIn",
"animate__zoomInDown",
"animate__zoomInLeft",
"animate__zoomInRight",
"animate__zoomInUp"
]
},
{
"label": "Lightspeed",
"content": ["animate__lightSpeedInRight", "animate__lightSpeedInLeft"]
}
],
"options": [
{ "label": "bounceIn", "value": "animate__bounceIn" },
{ "label": "bounceInDown", "value": "animate__bounceInDown" },
{ "label": "bounceInLeft", "value": "animate__bounceInLeft" },
{ "label": "bounceInRight", "value": "animate__bounceInRight" },
{ "label": "bounceInUp", "value": "animate__bounceInUp" },
{ "label": "fadeIn", "value": "animate__fadeIn" },
{ "label": "fadeInDown", "value": "animate__fadeInDown" },
{ "label": "fadeInDownBig", "value": "animate__fadeInDownBig" },
{ "label": "fadeInLeft", "value": "animate__fadeInLeft" },
{ "label": "fadeInLeftBig", "value": "animate__fadeInLeftBig" },
{ "label": "fadeInRight", "value": "animate__fadeInRight" },
{ "label": "fadeInRightBig", "value": "animate__fadeInRightBig" },
{ "label": "fadeInUp", "value": "animate__fadeInUp" },
{ "label": "fadeInUpBig", "value": "animate__fadeInUpBig" },
{ "label": "fadeInTopLeft", "value": "animate__fadeInTopLeft" },
{ "label": "fadeInTopRight", "value": "animate__fadeInTopRight" },
{ "label": "fadeInBottomLeft", "value": "animate__fadeInBottomLeft" },
{ "label": "fadeInBottomRight", "value": "animate__fadeInBottomRight" },
{ "label": "flip", "value": "animate__flip" },
{ "label": "flipInX", "value": "animate__flipInX" },
{ "label": "flipInY", "value": "animate__flipInY" },
{ "label": "zoomIn", "value": "animate__zoomIn" },
{ "label": "zoomInDown", "value": "animate__zoomInDown" },
{ "label": "zoomInLeft", "value": "animate__zoomInLeft" },
{ "label": "zoomInRight", "value": "animate__zoomInRight" },
{ "label": "zoomInUp", "value": "animate__zoomInUp" },
{ "label": "lightSpeedInRight", "value": "animate__lightSpeedInRight" },
{ "label": "lightSpeedInLeft", "value": "animate__lightSpeedInLeft" }
]
}
}
},
{
"property": "enterDuration",
"label": {
"text": {
"zh_CN": "入场持续"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"description": {
"zh_CN": "入场动画持续时间毫秒"
},
"labelPosition": "top",
"widget": {
"component": "MetaNumber",
"props": {
"units": [{ "value": "ms", "label": "ms" }],
"selectedUnit": "ms",
"showUnit": true,
"allowEmpty": true
}
}
},
{
"property": "enterDelay",
"label": {
"text": {
"zh_CN": "入场延迟"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"description": {
"zh_CN": "入场动画延迟时间毫秒"
},
"labelPosition": "top",
"widget": {
"component": "MetaNumber",
"props": {
"units": [{ "value": "ms", "label": "ms" }],
"selectedUnit": "ms",
"showUnit": true,
"allowEmpty": true
}
}
},
{
"property": "leave",
"label": {
"text": {
"zh_CN": "leave"
}
},
"description": {
"zh_CN": "出场动画"
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"labelPosition": "top",
"type": "string",
"defaultValue": "",
"widget": {
"component": "MetaSelect",
"props": {
"groups": [
{
"label": "Bouncing",
"content": [
"animate__bounceOut",
"animate__bounceOutDown",
"animate__bounceOutLeft",
"animate__bounceOutRight",
"animate__bounceOutUp"
]
},
{
"label": "Fading",
"content": [
"animate__fadeOut",
"animate__fadeOutDown",
"animate__fadeOutDownBig",
"animate__fadeOutLeft",
"animate__fadeOutLeftBig",
"animate__fadeOutRight",
"animate__fadeOutRightBig",
"animate__fadeOutUp",
"animate__fadeOutUpBig",
"animate__fadeOutTopLeft",
"animate__fadeOutTopRight",
"animate__fadeOutBottomRight",
"animate__fadeOutBottomLeft"
]
},
{
"label": "Flipping",
"content": ["animate__flip", "animate__flipOutX", "animate__flipOutY"]
},
{
"label": "Zooming",
"content": [
"animate__zoomOut",
"animate__zoomOutDown",
"animate__zoomOutLeft",
"animate__zoomOutRight",
"animate__zoomOutUp"
]
},
{
"label": "Lightspeed",
"content": ["animate__lightSpeedOutRight", "animate__lightSpeedOutLeft"]
}
],
"options": [
{ "label": "bounceOut", "value": "animate__bounceOut" },
{ "label": "bounceOutDown", "value": "animate__bounceOutDown" },
{ "label": "bounceOutLeft", "value": "animate__bounceOutLeft" },
{ "label": "bounceOutRight", "value": "animate__bounceOutRight" },
{ "label": "bounceOutUp", "value": "animate__bounceOutUp" },
{ "label": "fadeOut", "value": "animate__fadeOut" },
{ "label": "fadeOutDown", "value": "animate__fadeOutDown" },
{ "label": "fadeOutDownBig", "value": "animate__fadeOutDownBig" },
{ "label": "fadeOutLeft", "value": "animate__fadeOutLeft" },
{ "label": "fadeOutLeftBig", "value": "animate__fadeOutLeftBig" },
{ "label": "fadeOutRight", "value": "animate__fadeOutRight" },
{ "label": "fadeOutRightBig", "value": "animate__fadeOutRightBig" },
{ "label": "fadeOutUp", "value": "animate__fadeOutUp" },
{ "label": "fadeOutUpBig", "value": "animate__fadeOutUpBig" },
{ "label": "fadeOutTopLeft", "value": "animate__fadeOutTopLeft" },
{ "label": "fadeOutTopRight", "value": "animate__fadeOutTopRight" },
{ "label": "fadeOutBottomRight", "value": "animate__fadeOutBottomRight" },
{ "label": "fadeOutBottomLeft", "value": "animate__fadeOutBottomLeft" },
{ "label": "flip", "value": "animate__flip" },
{ "label": "flipOutX", "value": "animate__flipOutX" },
{ "label": "flipOutY", "value": "animate__flipOutY" },
{ "label": "zoomOut", "value": "animate__zoomOut" },
{ "label": "zoomOutDown", "value": "animate__zoomOutDown" },
{ "label": "zoomOutLeft", "value": "animate__zoomOutLeft" },
{ "label": "zoomOutRight", "value": "animate__zoomOutRight" },
{ "label": "zoomOutUp", "value": "animate__zoomOutUp" },
{ "label": "lightSpeedOutRight", "value": "animate__lightSpeedOutRight" },
{ "label": "lightSpeedOutLeft", "value": "animate__lightSpeedOutLeft" }
]
}
}
},
{
"property": "leaveDuration",
"label": {
"text": {
"zh_CN": "出场持续"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"description": {
"zh_CN": "出场动画持续时间毫秒"
},
"labelPosition": "top",
"widget": {
"component": "MetaNumber",
"props": {
"units": [{ "value": "ms", "label": "ms" }],
"selectedUnit": "ms",
"showUnit": true,
"allowEmpty": true
}
}
},
{
"property": "leaveDelay",
"label": {
"text": {
"zh_CN": "出场延迟"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"description": {
"zh_CN": "出场动画延迟时间毫秒"
},
"labelPosition": "top",
"widget": {
"component": "MetaNumber",
"props": {
"units": [{ "value": "ms", "label": "ms" }],
"selectedUnit": "ms",
"showUnit": true,
"allowEmpty": true
}
}
},
{
"property": "appear",
"label": {
"text": {
"zh_CN": "初始渲染"
}
},
"required": false,
"readOnly": false,
"disabled": false,
"cols": 12,
"description": {
"zh_CN": "动画是否在初始渲染时触发"
},
"labelPosition": "left",
"defaultValue": true,
"widget": {
"component": "MetaSwitch",
"props": {}
}
}
]
}
],
"events": {},
"shortcuts": {
"properties": []
},
"contentMenu": {
"actions": []
}
}
}
],
"blocks": [],
@ -14291,6 +14985,73 @@
}
}
]
},
{
"name": {
"zh_CN": "图表"
},
"icon": "Box",
"screenshot": "",
"snippetName": "TinyEcharts",
"schema": {
"componentName": "TinyEcharts",
"props": {
"style": "height:200px",
"option": {
"tooltip": {
"trigger": "item"
},
"series": [
{
"name": "Access From",
"type": "pie",
"radius": ["40%", "70%"],
"avoidLabelOverlap": false,
"padAngle": 5,
"itemStyle": {
"borderRadius": 10
},
"label": {
"show": false,
"position": "center"
},
"emphasis": {
"label": {
"show": true,
"fontSize": 40,
"fontWeight": "bold"
}
},
"labelLine": {
"show": false
},
"data": [
{ "value": 1048, "name": "Search Engine" },
{ "value": 735, "name": "Direct" },
{ "value": 580, "name": "Email" },
{ "value": 484, "name": "Union Ads" },
{ "value": 310, "name": "Video Ads" }
]
}
]
},
"autoResize": true
}
}
},
{
"name": {
"zh_CN": "过渡动画"
},
"icon": "carousel",
"screenshot": "",
"snippetName": "TinyTransitions",
"schema": {
"componentName": "TinyTransitions",
"props": {
"appear": true
}
}
}
]
}

View File

@ -1,6 +1,6 @@
<template>
<div id="canvas-wrap" ref="canvasRef">
<div ref="siteCanvas" class="site-canvas" :style="siteCanvasStyle">
<div ref="siteCanvas" class="site-canvas">
<canvas-container
:controller="controller"
:materials-panel="materialsPanel"
@ -14,7 +14,7 @@
</template>
<script>
import { ref, watch, computed, onUnmounted } from 'vue'
import { ref, watch, onUnmounted } from 'vue'
import { CanvasContainer, CanvasFooter } from '@opentiny/tiny-engine-canvas'
import {
useProperties,
@ -60,14 +60,6 @@ export default {
pageState.properties = null
}
const siteCanvasStyle = computed(() => {
const { scale } = useLayout().getDimension()
return {
height: `calc((100% - var(--base-bottom-panel-height, 30px) - 36px) / ${scale})`,
transform: `scale(${scale})`
}
})
watch(
[() => useCanvas().isSaved(), () => useLayout().layoutState.pageStatus, () => useCanvas().getPageSchema()],
([isSaved, pageStatus, pageSchema], [oldIsSaved, _oldPageStatus, oldPageSchema]) => {
@ -188,7 +180,6 @@ export default {
request: useHttp(),
ast
},
siteCanvasStyle,
canvasRef
}
}
@ -205,11 +196,11 @@ export default {
position: relative;
.site-canvas {
height: calc(100% - var(--base-bottom-panel-height, 30px) - 36px);
background: var(--ti-lowcode-breadcrumb-hover-bg);
position: absolute;
overflow: hidden;
margin: 18px 0;
transform-origin: top;
}
}
</style>

View File

@ -26,7 +26,7 @@
"dependencies": {
"@opentiny/tiny-engine-utils": "workspace:*",
"@vueuse/core": "^9.6.0",
"axios": "~0.28.0",
"axios": "^0.27.2",
"axios-mock-adapter": "^1.21.5"
},
"devDependencies": {

View File

@ -30,7 +30,7 @@
"@opentiny/tiny-engine-http": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@vue/shared": "^3.3.4",
"axios": "~0.28.0",
"axios": "^0.27.2",
"vue-clipboard3": "^2.0.0",
"xlsx": "^0.18.5"
},

View File

@ -352,8 +352,8 @@ export default {
saveMethod?.({
name: state.bindMethodInfo.name,
content: state.enableExtraParams
? `function ${state.bindMethodInfo.name}(eventArgs,${formatParams}) ${functionBody}`
: `function ${state.bindMethodInfo.name}(${formatParams}) ${functionBody}`
? `function (eventArgs,${formatParams}) ${functionBody}`
: `function (${formatParams}) ${functionBody}`
})
activePagePlugin()

View File

@ -69,6 +69,7 @@ import { ref, watch } from 'vue'
import { Collapse, CollapseItem, Input } from '@opentiny/vue'
import { useHistory, useCanvas, useProperties } from '@opentiny/tiny-engine-controller'
import { MetaCodeEditor, MetaBindVariable } from '@opentiny/tiny-engine-common'
import { formatString } from '@opentiny/tiny-engine-controller/js/ast'
import {
SizeGroup,
LayoutGroup,
@ -127,7 +128,7 @@ export default {
const { getSchema: getCanvasPageSchema, updateRect } = useCanvas().canvasApi.value
const pageSchema = getCanvasPageSchema()
const schema = getSchema() || pageSchema
const styleString = styleStrRemoveRoot(content)
const styleString = formatString(styleStrRemoveRoot(content), 'css')
const currentSchema = getCurrentSchema() || pageSchema
state.styleContent = content

View File

@ -47,7 +47,7 @@
"fs-extra": "^10.0.1",
"prettier": "^2.6.1",
"vite": "^4.3.7",
"vite-plugin-static-copy": "^0.16.0",
"vite-plugin-static-copy": "^1.0.4",
"vitest": "^1.4.0",
"winston": "^3.10.0"
},

View File

@ -229,7 +229,7 @@ export const handleSlotBindAttrHook = (schemaData) => {
let paramsValue = ''
if (Array.isArray(params)) {
paramsValue = `="{ ${params.join(',')} }"`
paramsValue = `={ ${params.join(',')} }`
} else if (typeof params === 'string') {
paramsValue = `="${params}"`
}

View File

@ -44,8 +44,8 @@ function genDependenciesPlugin(options = {}) {
.map((item) => {
let [key, value] = item
if (typeof value === 'string') {
value = `'${value}'`
if (value === '') {
value = "''"
}
if (value && typeof value === 'object') {
@ -57,19 +57,19 @@ function genDependenciesPlugin(options = {}) {
.join(',')} })`
const getterExpression = Object.entries(getters)
.filter((item) => item[1]?.type === 'JSFunction')
.filter((item) => item.value?.type === 'JSFunction')
.map(([key, value]) => `${key}: ${value.value}`)
.join(',')
const actionExpressions = Object.entries(actions)
.filter((item) => item[1]?.type === 'JSFunction')
.filter((item) => item.value?.type === 'JSFunction')
.map(([key, value]) => `${key}: ${value.value}`)
.join(',')
const storeFiles = `
${importStatement}
export const ${id} = defineStore({
id: '${id}',
id: ${id},
state: ${stateExpression},
getters: { ${getterExpression} },
actions: { ${actionExpressions} }

View File

@ -1 +0,0 @@
export { testState } from './testState'

View File

@ -1,27 +0,0 @@
import { defineStore } from 'pinia'
export const testState = defineStore({
id: 'testState',
state: () => ({
name: 'testName',
license: '',
age: 18,
food: ['apple', 'orange', 'banana', 19],
desc: { description: 'hello world', money: 100, other: '', rest: ['a', 'b', 'c', 20] }
}),
getters: {
getAge: function getAge() {
return this.age
},
getName: function getName() {
return this.name
}
},
actions: {
setAge: function setAge(age) {
this.age = age
},
setName: function setName(name) {
this.name = name
}
}
})

View File

@ -676,43 +676,7 @@ export const appSchemaDemo01 = {
value: 'function dataHanlder(res){\n return res;\n}'
}
},
globalState: [
{
id: 'testState',
state: {
name: 'testName',
license: '',
age: 18,
food: ['apple', 'orange', 'banana', 19],
desc: {
description: 'hello world',
money: 100,
other: '',
rest: ['a', 'b', 'c', 20]
}
},
getters: {
getAge: {
type: 'JSFunction',
value: 'function getAge() {\n return this.age \n}'
},
getName: {
type: 'JSFunction',
value: 'function getName() {\n return this.name \n}'
}
},
actions: {
setAge: {
type: 'JSFunction',
value: 'function setAge(age) {\n this.age = age; \n}'
},
setName: {
type: 'JSFunction',
value: 'function setName(name) {\n this.name = name; \n}'
}
}
}
],
globalState: [],
utils: [
{
name: 'axios',

View File

@ -1,12 +0,0 @@
import { expect, test } from 'vitest'
import { genSFCWithDefaultPlugin } from '@/generator/vue/sfc'
import schema from './page.schema.json'
import componentsMap from './components-map.json'
import { formatCode } from '@/utils/formatCode'
test('should generate slot declaration correctly', async () => {
const res = genSFCWithDefaultPlugin(schema, componentsMap)
const formattedCode = formatCode(res, 'vue')
await expect(formattedCode).toMatchFileSnapshot('./expected/slotTest.vue')
})

View File

@ -1,9 +0,0 @@
[
{
"componentName": "TinyTree",
"exportName": "Tree",
"package": "@opentiny/vue",
"version": "^3.10.0",
"destructuring": true
}
]

View File

@ -1,54 +0,0 @@
<template>
<div>
<tiny-tree
:data="[
{ label: '一级 1', children: [{ label: '二级 1-1', children: [{ label: '三级 1-1-1' }] }] },
{
label: '一级 2',
children: [
{ label: '二级 2-1', children: [{ label: '三级 2-1-1' }] },
{ label: '二级 2-2', children: [{ label: '三级 2-2-1' }] }
]
}
]"
>
<template #default="{ data }">
<span>{{ data.label }}</span></template
></tiny-tree
>
<tiny-tree
:data="[
{ label: '一级 1', children: [{ label: '二级 1-1', children: [{ label: '三级 1-1-1' }] }] },
{
label: '一级 2',
children: [
{ label: '二级 2-1', children: [{ label: '三级 2-1-1' }] },
{ label: '二级 2-2', children: [{ label: '三级 2-2-1' }] }
]
}
]"
>
<template #default="data">
<span>{{ data.label }}</span></template
></tiny-tree
>
</div>
</template>
<script setup>
import { Tree as TinyTree } from '@opentiny/vue'
import * as vue from 'vue'
import { defineProps, defineEmits } from 'vue'
import { I18nInjectionKey } from 'vue-i18n'
const props = defineProps({})
const emit = defineEmits([])
const { t, lowcodeWrap, stores } = vue.inject(I18nInjectionKey).lowcode()
const wrap = lowcodeWrap(props, { emit })
wrap({ stores })
const state = vue.reactive({})
wrap({ state })
</script>
<style scoped></style>

View File

@ -1,143 +0,0 @@
{
"state": {},
"methods": {},
"componentName": "Page",
"fileName": "createVm",
"css": "",
"props": {},
"lifeCycles": {},
"children": [
{
"componentName": "TinyTree",
"props": {
"data": [
{
"label": "一级 1",
"children": [
{
"label": "二级 1-1",
"children": [
{
"label": "三级 1-1-1"
}
]
}
]
},
{
"label": "一级 2",
"children": [
{
"label": "二级 2-1",
"children": [
{
"label": "三级 2-1-1"
}
]
},
{
"label": "二级 2-2",
"children": [
{
"label": "三级 2-2-1"
}
]
}
]
}
]
},
"id": "33f52342",
"children": [
{
"componentName": "Template",
"props": {
"slot": {
"name": "default",
"params": ["data"]
}
},
"children": [
{
"componentName": "Text",
"props": {
"text": {
"type": "JSExpression",
"value": "data.label"
}
},
"id": "c225d165"
}
],
"id": "415d5f65"
}
]
},
{
"componentName": "TinyTree",
"props": {
"data": [
{
"label": "一级 1",
"children": [
{
"label": "二级 1-1",
"children": [
{
"label": "三级 1-1-1"
}
]
}
]
},
{
"label": "一级 2",
"children": [
{
"label": "二级 2-1",
"children": [
{
"label": "三级 2-1-1"
}
]
},
{
"label": "二级 2-2",
"children": [
{
"label": "三级 2-2-1"
}
]
}
]
}
]
},
"id": "33f52342",
"children": [
{
"componentName": "Template",
"props": {
"slot": {
"name": "default",
"params": "data"
}
},
"children": [
{
"componentName": "Text",
"props": {
"text": {
"type": "JSExpression",
"value": "data.label"
}
},
"id": "c225d165"
}
],
"id": "415d5f65"
}
]
}
]
}

View File

@ -17,7 +17,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'
// https://vitejs.dev/config/
export default defineConfig({
test: {
exclude: ['**/result/**', 'node_modules'],
exclude: ['**/result/**'],
watchExclude: ['**/result/**']
},
resolve: {

View File

@ -12,10 +12,7 @@ const materialsDir = 'materials'
const bundlePath = path.join(process.cwd(), '/packages/design-core/public/mock/bundle.json')
// mockServer应用数据
const appInfoPath = path.join(process.cwd(), '/mockServer/src/services/appinfo.json')
const appSchemaPath = path.join(process.cwd(), 'mockServer/src/mock/get/app-center/v1/apps/schema/918.json')
const appInfo = fsExtra.readJSONSync(appInfoPath)
const appSchema = fsExtra.readJSONSync(appSchemaPath)
const connection = new MysqlConnection()
@ -25,7 +22,6 @@ const connection = new MysqlConnection()
const write = (bundle) => {
fsExtra.outputJSONSync(bundlePath, bundle, { spaces: 2 })
fsExtra.outputJSONSync(appInfoPath, appInfo, { spaces: 2 })
fsExtra.outputJSONSync(appSchemaPath, appSchema, { spaces: 2 })
}
/**
@ -99,7 +95,6 @@ const generateComponents = () => {
}
const { components = [], snippets = [], blocks = [] } = bundle.data.materials
const componentsMap = []
const packagesMap = []
const appInfoBlocksLabels = appInfo.blockHistories.map((item) => item.label)
files.forEach((file) => {
@ -156,26 +151,8 @@ const generateComponents = () => {
appInfo.materialHistory.components = componentsMap
const { package: packageName = '', version = '', exportName = '' } = npm || {}
const mapItem = {
componentName: component,
package: packageName,
version,
exportName
}
if (typeof npm.destructuring === 'boolean') {
mapItem.destructuring = npm.destructuring
}
if (npm.package) {
packagesMap.push(mapItem)
}
write(bundle)
})
appSchema.data.componentsMap = packagesMap
write(bundle)
})
logger.success('物料资产包构建成功')

View File

@ -1,3 +1,3 @@
const { exec } = require('child_process')
exec('pnpm -F @opentiny/tiny-engine-controller -F @opentiny/tiny-engine-dsl-vue build')
exec('pnpm -F @opentiny/tiny-engine-dsl-vue build')