Skip to content

Commit

Permalink
Merge pull request #1085 from opentiny/release-v2.2.0-merge
Browse files Browse the repository at this point in the history
Release v2.2.0 merge
  • Loading branch information
hexqi authored Jan 26, 2025
2 parents 5b9d61a + 1edcfad commit a2883f1
Show file tree
Hide file tree
Showing 85 changed files with 365 additions and 228 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install

- name: Run Build
run: pnpm run build:plugin && pnpm run build:alpha > build-alpha.log 2>&1
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: build-alpha.log
path: /tmp/build-alpha.log

- name: Parse Publish tag
id: parse_tag
Expand Down Expand Up @@ -74,4 +73,4 @@ jobs:
- 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}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion designer-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "designer-demo",
"private": true,
"version": "2.1.0",
"version": "2.2.0",
"type": "module",
"scripts": {
"dev": "cross-env VITE_THEME=light vite",
Expand Down
2 changes: 1 addition & 1 deletion mockServer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-mock",
"version": "2.1.0",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion mockServer/src/mock/get/app-center/v1/apps/schema/918.json
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@
"package": "axios",
"destructuring": false,
"exportName": "axios",
"cdnLink": "https://unpkg.com/browse/[email protected]/dist/esm/axios.min.js"
"cdnLink": "https://unpkg.com/[email protected]/dist/esm/axios.min.js"
}
},
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"pub:prerelease": "pnpm run build:plugin && pnpm run build:alpha && pnpm lerna version prerelease --preid beta --no-push --yes && lerna publish from-package --pre-dist-tag beta --yes",
"setup": "node ./scripts/setup.js",
"splitMaterials": "node ./scripts/splitMaterials.mjs",
"buildMaterials": "node ./scripts/buildMaterials.mjs"
"buildMaterials": "node ./scripts/buildMaterials.mjs",
"updateTemplate": "node ./scripts/updateTemplate.mjs"
},
"devDependencies": {
"@babel/eslint-parser": "^7.21.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-block-compiler",
"version": "2.1.0",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/blockToWebComponentTemplate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-block-build",
"version": "2.1.0",
"version": "2.2.0",
"description": "translate block to webcomponent template",
"main": "./dist/web-components.es.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/build/vite-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-vite-config",
"version": "2.1.0",
"version": "2.2.0",
"description": "",
"type": "module",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/build/vite-plugin-meta-comments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-vite-plugin-meta-comments",
"version": "2.1.0",
"version": "2.2.0",
"description": "",
"type": "module",
"main": "dist/index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/builtinComponent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-builtin-component",
"version": "2.1.0",
"version": "2.2.0",
"description": "",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-canvas",
"version": "2.1.0",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function defaultRenderer(schema, refreshKey, entry, active, isPage = true) {
const rootChildrenSchema = {
id: 0,
componentName: 'div',
componentType: 'PageSection',
// 手动添加一个唯一的属性,后续在画布选中此节点时方便处理额外的逻辑。由于没有修改schema,不会影响出码
props: { ...schema.props, 'data-id': 'root-container', 'data-page-active': active },
children: schema.children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import postcss from 'postcss'
import scopedPlugin from './scope-css-plugin'

export function handleScopedCss(id: string, content: string) {
return postcss([scopedPlugin(id)]).process(content)
return postcss([scopedPlugin(id)]).process(content, { from: undefined })
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const wrapPageComponent = (pageId: string) => {
() => active.value,
(activeValue) => {
if (!activeValue) {
asyncData.value = null
updateSchema()
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/canvas/render/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const checkGroup = (componentName) => configure[componentName]?.nestingRule?.chi
const clickCapture = (componentName) => configure[componentName]?.clickCapture !== false

const getBindProps = (schema, scope, context, pageContext) => {
const { id, componentName } = schema
const { id, componentName, componentType } = schema
const invalidity = configure[componentName]?.invalidity || []

if (componentName === 'CanvasPlaceholder') {
Expand Down Expand Up @@ -120,7 +120,7 @@ const getBindProps = (schema, scope, context, pageContext) => {
delete bindProps.className

// 使画布中元素可拖拽
if (active) {
if (active && !['PageStart', 'PageSection'].includes(componentType)) {
bindProps.draggable = true
}

Expand Down
24 changes: 14 additions & 10 deletions packages/canvas/route-bar/src/CanvasRouteBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ watch(
}
const ancestors = (await getAncestors(value, true)) || []
routes.value = ancestors.concat(value).map((id) => {
const { route, isPage } = pageSettingState.treeDataMapping[id]
return {
id,
route: route
.replace(/\/+/g, '/') // 替换连续的 '/' 为单个 '/'
.replace(/^\/|\/$/g, ''), // 去掉开头和结尾的 '/'
isPage
}
})
routes.value = ancestors
.concat(value)
.map((id) => pageSettingState.treeDataMapping[id])
.filter((item) => Boolean(item))
.map((pageData) => {
const { id, route, isPage } = pageData
return {
id,
route: route
.replace(/\/+/g, '/') // 替换连续的 '/' 为单个 '/'
.replace(/^\/|\/$/g, ''), // 去掉开头和结尾的 '/'
isPage
}
})
},
{ immediate: true }
)
Expand Down
2 changes: 1 addition & 1 deletion packages/common/component/BlockHistoryList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<tiny-grid v-if="history.length" :data="history" height="300">
<tiny-grid v-if="history.length" :data="history" row-id="id" height="300">
<tiny-grid-column v-if="isBlockManage" field="version" title="版本号">
<template v-slot="data">
{{ data.row.version }}
Expand Down
12 changes: 9 additions & 3 deletions packages/common/component/SvgButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<span class="svg-button" :class="{ 'svg-button-hover': hoverBgColor }" @click="$emit('click', $event)">
<span class="svg-button" :class="{ 'svg-button-hover': hoverBgColor }" @click="handleClick($event)">
<tiny-tooltip effect="light" :content="tips" :placement="placement">
<component :is="name" v-if="isTinyIcon" />
<svg-icon v-else :name="name"></svg-icon>
Expand Down Expand Up @@ -34,11 +34,17 @@ export default {
}
},
emits: ['click'],
setup(props) {
setup(props, { emit }) {
const isTinyIcon = computed(() => props.name.toLowerCase().indexOf('icon') === 0)
const handleClick = (event) => {
event.target.blur()
emit('click', event)
}
return {
isTinyIcon
isTinyIcon,
handleClick
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-common",
"version": "2.1.0",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/configurator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-configurator",
"version": "2.1.0",
"version": "2.2.0",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,10 @@ export default {
}
</script>
<style lang="less" scoped></style>
<style lang="less" scoped>
.meta-radio-group-container {
:deep(.tiny-radio-button__inner.tiny-radio-button__inner.tiny-radio-button__inner) {
padding: 5px 16px;
}
}
</style>
4 changes: 2 additions & 2 deletions packages/design-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine",
"version": "2.1.0",
"version": "2.2.0",
"type": "module",
"description": "TinyEngine enables developers to customize low-code platforms, build low-bit platforms online in real time, and support secondary development or integration of low-bit platform capabilities.",
"homepage": "https://opentiny.design/tiny-engine",
Expand Down Expand Up @@ -76,7 +76,6 @@
"@opentiny/tiny-engine-toolbar-fullscreen": "workspace:*",
"@opentiny/tiny-engine-toolbar-generate-code": "workspace:*",
"@opentiny/tiny-engine-toolbar-lang": "workspace:*",
"@opentiny/tiny-engine-toolbar-view-setting": "workspace:*",
"@opentiny/tiny-engine-toolbar-layout": "workspace:*",
"@opentiny/tiny-engine-toolbar-lock": "workspace:*",
"@opentiny/tiny-engine-toolbar-logo": "workspace:*",
Expand All @@ -87,6 +86,7 @@
"@opentiny/tiny-engine-toolbar-refresh": "workspace:*",
"@opentiny/tiny-engine-toolbar-save": "workspace:*",
"@opentiny/tiny-engine-toolbar-setting": "workspace:*",
"@opentiny/tiny-engine-toolbar-view-setting": "workspace:*",
"@opentiny/tiny-engine-utils": "workspace:*",
"@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*",
"@opentiny/tiny-engine-webcomponent-core": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"axios": "${VITE_CDN_DOMAIN}/[email protected]/dist/esm/axios.js",
"@opentiny/tiny-engine-webcomponent-core": "${VITE_CDN_DOMAIN}/@opentiny/tiny-engine-webcomponent-core@1/dist/tiny-engine-webcomponent-core.es.js",
"@opentiny/tiny-engine-i18n-host": "${VITE_CDN_DOMAIN}/@opentiny/tiny-engine-i18n-host@1/dist/lowcode-design-i18n-host.es.js",
"@opentiny/tiny-engine-builtin-component": "${VITE_CDN_DOMAIN}/@opentiny/tiny-engine-builtin-component@^2.0.0/dist/index.js",
"@opentiny/tiny-engine-builtin-component": "${VITE_CDN_DOMAIN}/@opentiny/tiny-engine-builtin-component@^2.0.0/dist/index.mjs",
"vue-demi": "${VITE_CDN_DOMAIN}/[email protected]/lib/index.mjs",
"pinia": "${VITE_CDN_DOMAIN}/[email protected]/dist/pinia.esm-browser.js",
"@opentiny/vue": "${VITE_CDN_DOMAIN}/@opentiny/vue-runtime@${opentinyVueVersion}/dist3/tiny-vue-pc.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-cli",
"version": "2.1.0",
"version": "2.2.0",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand Down
24 changes: 12 additions & 12 deletions packages/engine-cli/template/designer/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "designer-demo-template",
"name": "designer-demo",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "concurrently 'pnpm:serve:mock' 'pnpm:serve:frontend'",
"serve:frontend": "cross-env VITE_THEME=light vite",
"serve:mock": "node node_modules/@opentiny/tiny-engine-mock/dist/app.js",
"build:alpha": "cross-env NODE_OPTIONS=--max-old-space-size=8192 VITE_THEME=light vite build --mode alpha",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 VITE_THEME=light vite build --mode prod"
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 VITE_THEME=light vite build --mode prod",
"serve:frontend": "cross-env VITE_THEME=light vite",
"serve:mock": "node node_modules/@opentiny/tiny-engine-mock/dist/app.js"
},
"dependencies": {
"@opentiny/tiny-engine": "^2.1.0",
"@opentiny/tiny-engine-theme-dark": "^2.1.0",
"@opentiny/tiny-engine-theme-light": "^2.1.0",
"@opentiny/tiny-engine-utils": "^2.1.0",
"@opentiny/tiny-engine": "2.2.0",
"@opentiny/tiny-engine-theme-dark": "2.2.0",
"@opentiny/tiny-engine-theme-light": "2.2.0",
"@opentiny/tiny-engine-utils": "2.2.0",
"@opentiny/vue": "~3.20.0",
"@opentiny/vue-design-smb": "~3.20.0",
"@opentiny/vue-icon": "~3.20.0",
Expand All @@ -25,11 +25,11 @@
"vue": "^3.4.21"
},
"devDependencies": {
"@opentiny/tiny-engine-mock": "^2.1.0",
"@opentiny/tiny-engine-vite-config": "^2.1.0",
"@opentiny/tiny-engine-mock": "2.2.0",
"@opentiny/tiny-engine-vite-config": "2.2.0",
"@vitejs/plugin-vue": "^5.1.2",
"cross-env": "^7.0.3",
"concurrently": "^8.2.0",
"vite": "^5.4.2"
"vite": "^5.4.2",
"concurrently": "^8.2.0"
}
}
15 changes: 14 additions & 1 deletion packages/engine-cli/template/designer/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,20 @@ export default {
Lang,
ViewSetting
],
plugins: [Materials, Tree, Page, Block, Datasource, Bridge, I18n, Script, State, Schema, Help, Robot],
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
Expand Down
1 change: 1 addition & 0 deletions packages/engine-cli/template/designer/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default defineConfig((configEnv) => {
viteConfigEnv: configEnv,
root: __dirname,
iconDirs: [path.resolve(__dirname, './node_modules/@opentiny/tiny-engine/assets/')],
useSourceAlias: false,
envDir: './env'
})

Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-i18n-host",
"version": "2.1.0",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-layout",
"version": "2.1.0",
"version": "2.2.0",
"scripts": {
"build": "vite build"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/block/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-plugin-block",
"version": "2.1.0",
"version": "2.2.0",
"publishConfig": {
"access": "public"
},
Expand Down
Loading

0 comments on commit a2883f1

Please sign in to comment.