Skip to content

Commit

Permalink
Merge branch 'refactor/develop' of github.com:opentiny/tiny-engine in…
Browse files Browse the repository at this point in the history
…to refactor/block-add-ui
  • Loading branch information
gene9831 committed Dec 9, 2024
2 parents ab1cff8 + 1dc492a commit d975c5f
Show file tree
Hide file tree
Showing 103 changed files with 1,039 additions and 1,314 deletions.
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.0.0-rc.2",
"version": "2.0.0-rc.4",
"type": "module",
"scripts": {
"dev": "cross-env VITE_THEME=light vite",
Expand Down
18 changes: 10 additions & 8 deletions designer-demo/public/mock/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -9060,7 +9060,7 @@
"devMode": "proCode",
"npm": {
"package": "@opentiny/vue",
"exportName": "Select",
"exportName": "Breadcrumb",
"version": "3.14.0",
"destructuring": true,
"script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs",
Expand Down Expand Up @@ -10732,7 +10732,7 @@
"devMode": "proCode",
"npm": {
"package": "@opentiny/vue",
"exportName": "PopEditor",
"exportName": "Popeditor",
"version": "3.14.0",
"destructuring": true,
"script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs",
Expand Down Expand Up @@ -13441,18 +13441,14 @@
"props": {
"text": "提交",
"type": "primary",
"style": {
"margin": "0 5px 0 5px"
}
"style": "margin: 0 5px 0 5px;"
}
},
{
"componentName": "TinyButton",
"props": {
"text": "重置",
"style": {
"margin": "0 5px 0 5px"
}
"style": "margin: 0 5px 0 5px;"
}
},
{
Expand Down Expand Up @@ -13866,6 +13862,9 @@
"children": [
{
"componentName": "TinyCarouselItem",
"props": {
"title": "carousel-item-a"
},
"children": [
{
"componentName": "div",
Expand All @@ -13877,6 +13876,9 @@
},
{
"componentName": "TinyCarouselItem",
"props": {
"title": "carousel-item-b"
},
"children": [
{
"componentName": "div",
Expand Down
2 changes: 1 addition & 1 deletion designer-demo/src/configurators/MyInputConfigurator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
font-size: 16px;
&:hover {
cursor: pointer;
color: var(--ti-lowcode-dialog-font-color);
color: var(--te-common-text-primary);
}
}
</style>
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.0.0-rc.2",
"version": "2.0.0-rc.4",
"publishConfig": {
"access": "public"
},
Expand Down
6 changes: 3 additions & 3 deletions mockServer/src/services/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
*
*/

import { pageService } from '../routes/main-routes'
import { mockService } from '../routes/main-routes'
import { getResponseData } from '../tool/Common'
export default class AppService {
async lock(query) {
const { id, state } = query
const occupier = state === 'occupy' ? pageService.userInfo : null
await pageService.update(id, { occupier })
const occupier = state === 'occupy' ? mockService.pageService.userInfo : null
await mockService.pageService.update(id, { occupier })
return getResponseData({
operate: 'success',
occupier
Expand Down
3 changes: 2 additions & 1 deletion mockServer/src/services/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export default class BlockService {

async detail(blockId) {
const result = await this.db.findOneAsync({ _id: blockId })
return result

return getResponseData(result)
}

async delete(blockId) {
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.0.0-rc.2",
"version": "2.0.0-rc.4",
"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.0.0-rc.2",
"version": "2.0.0-rc.4",
"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.0.0-rc.2",
"version": "2.0.0-rc.4",
"description": "",
"type": "module",
"main": "dist/index.cjs",
Expand Down
6 changes: 3 additions & 3 deletions packages/builtinComponent/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@opentiny/tiny-engine-builtin-component",
"version": "2.0.0-rc.2",
"version": "2.0.0-rc.4",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"type": "module",
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/builtinComponent/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineConfig({
lib: {
entry: path.resolve(__dirname, './index.js'),
name: 'builtinComponent',
fileName: () => 'index.js',
fileName: () => 'index.mjs',
formats: ['es']
},
rollupOptions: {
Expand Down
15 changes: 1 addition & 14 deletions packages/canvas/container/src/components/CanvasAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -671,21 +671,8 @@ export default {
}
}
}
.short-cut-set.tiny-popper.tiny-popover {
background: var(--ti-lowcode-toolbar-bg);
.short-cut-set.short-cut-set.tiny-popper.tiny-popover {
padding: 10px;
.body label,
.header {
color: var(--ti-lowcode-dialog-font-color);
font-size: 12px;
}
.tiny-popover__title {
color: var(--ti-lowcode-dialog-font-color);
}
}
.short-cut-set.tiny-popper.tiny-popover[x-placement^='bottom'] .popper__arrow::after {
border-bottom-color: var(--ti-lowcode-toolbar-bg);
}
.drag-resize {
Expand Down
4 changes: 2 additions & 2 deletions packages/canvas/container/src/components/CanvasDivider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default {
left: v-bind('state.horizontalLeft');
}
&:hover {
background-color: var(--ti-lowcode-common-primary-color);
background-color: var(--te-common-bg-primary-checked);
.divider {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACbElEQVRIDZ2Vu2sVURCH9yZgbCxMsFFjKQkExScREgQtLISAXbS4GDu10fgHiL1gpxKDCLFRfICCCSpCwEiCYiNWFkYsImIRH4jgY/x+xzNy7t29614HvsycmfnN3j1nd5Nl0cysDrPwEV7DRVjn9Vaent7Y+wYvrWbUG/pJTIHsCzyBd1pg8v0NzcmC2kDswdkizIFmyKZCK4F+uWwGelxPfAx+wFPPpZ58JzyHX3DEa8TdoFmyesYf3ZKu+nd40nyJvGzEc+7JjYWK2aTn3JPXRTRzVhdYhjkvpp78KMieNeW7yGnPZYfSmsfktV3LHSSWoNVhro+CbTTvdzH+KGyI61batdSXdAcXQDYWBcGx1m2+ha/wHRZUwK+C9/ABtA3q6W7S+vadl6AH9LT8hAk4CKdAQtlJuBIis3340zE+gR+PsXqlkVYzNEsz/5wrQR/MQ2qfWYzHX72RWE+UnppPoP3vijUNVm9qCyz60rvSnXTAJtBjOwKr0wbWV8GtaDulkVYzdLbtGaLdINPed1ZVt3Mlf/21r8NVL1Cpj1+sM9IZvAK9uY8qCas2MfAGyPbC9RCZDVXVl/YxbHsc+FCNxDpE3cWDUmHVIoPug2yna4hvhYzZLs/9l2fInjjoZjqA3JaYn07zbccM0Qujw839TyB3B2Q72h4sAcIDQW52uWiABsf63aJ6aQ6h3uqX8A38q5nTULsHsq25YlkCweEgMzv3j77B2He7rK+hhmAFLII+YGsaigULevSU6bHdXFDOp2g8DrIz+Wo+Q99Q6Da7lq9mWdG3aCWNL+BskaA5V6vVHpPT8FpzTevfkrgJcwZ0OJIAAAAASUVORK5CYII=);
}
Expand All @@ -232,7 +232,7 @@ export default {
.divider-line {
position: absolute;
border: 1px dashed var(--ti-lowcode-common-primary-color);
border: 1px dashed var(--te-common-border-checked);
z-index: 2;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default {
&::after {
content: '';
display: block;
border: 1px solid var(--ti-lowcode-common-primary-color);
border: 1px solid var(--te-common-border-checked);
}
&.resize-vertical {
cursor: ns-resize;
Expand Down
10 changes: 5 additions & 5 deletions packages/canvas/container/src/components/shortCutPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default {
display: flex;
align-items: center;
padding: 0 10px;
border-bottom: 1px solid var(--ti-lowcode-toolbar-border-color, #333);
border-bottom: 1px solid var(--te-common-border-default, #333);
height: 36px;
div {
Expand All @@ -96,7 +96,7 @@ export default {
.icon-setting {
font-size: 16px;
fill: var(--ti-lowcode-toolbar-breadcrumb-color, #d9d9d9);
fill: var(--te-common-text-secondary, #d9d9d9);
}
.icon-wrap {
Expand All @@ -111,7 +111,7 @@ export default {
align-items: center;
transition: 0.3s;
&:hover {
fill: var(--ti-lowcode-toolbar-icon-color, #fff);
fill: var(--te-common-icon-primary, #fff);
background: var(--ti-lowcode-icon-hover-bg, rgba(255, 255, 255, 0.1));
}
}
Expand Down Expand Up @@ -164,14 +164,14 @@ export default {
width: 100%;
padding: 4px 0;
display: inline-block;
background: var(--ti-lowcode-toolbar-view-hover-bg, #4d4d4d);
background: var(--te-common-bg-container, #4d4d4d);
border-radius: 2px;
display: flex;
justify-content: center;
align-items: center;
}
svg {
fill: var(--ti-lowcode-toolbar-breadcrumb-color, #d9d9d9);
fill: var(--te-common-text-secondary, #d9d9d9);
margin-left: 4px;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas/layout/src/CanvasLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const siteCanvasStyle = computed(() => {

<style lang="less" scoped>
#canvas-wrap {
background: var(--ti-lowcode-canvas-wrap-bg);
background: var(--te-common-bg-container);
flex: 1 1 0;
border: none;
display: flex;
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.0.0-rc.2",
"version": "2.0.0-rc.4",
"publishConfig": {
"access": "public"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/common/component/BlockDeployDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import {
Popover as TinyPopover,
FormItem as TinyFormItem
} from '@opentiny/vue'
import { useNotify, useCanvas, getMetaApi, META_APP } from '@opentiny/tiny-engine-meta-register'
import { useNotify, useCanvas, getMetaApi, META_APP, useBlock } from '@opentiny/tiny-engine-meta-register'
import { constants } from '@opentiny/tiny-engine-utils'
import VueMonaco from './VueMonaco.vue'
Expand Down Expand Up @@ -155,7 +155,7 @@ export default {
const { getEditBlock, publishBlock } = getMetaApi(META_APP.BlockManage)
if (valid) {
const params = {
block: getEditBlock(),
block: getEditBlock() || useBlock().getCurrentBlock(),
is_compile: true,
deploy_info: formState.deployInfo,
version: formState.version,
Expand Down
3 changes: 1 addition & 2 deletions packages/common/component/SearchEmpty.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ export default {
.empty-icon {
width: 80px;
height: 80px;
color: var(--ti-lowcode-datasource-common-empty-color);
}
.empty-text {
font-size: 12px;
color: var(--te-base-text-color-3);
color: var(--te-common-text-weaken);
}
}
</style>
15 changes: 10 additions & 5 deletions packages/common/js/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { isVsCodeEnv } from './environments'
import { generateRouter, generatePage } from './vscodeGenerateFile'
import { usePage, useCanvas, useNotify } from '@opentiny/tiny-engine-meta-register'
import { usePage, useCanvas, useNotify, useBreadcrumb } from '@opentiny/tiny-engine-meta-register'
import { getMetaApi, META_SERVICE } from '@opentiny/tiny-engine-meta-register'

/**
Expand All @@ -37,7 +37,7 @@ export const requestEvent = (url, params) => {
* @returns { Promise }
*
*/
export const handlePageUpdate = (pageId, params, routerChange) => {
export const handlePageUpdate = (pageId, params, routerChange, isCurEditPage) => {
return getMetaApi(META_SERVICE.Http)
.post(`/app-center/api/pages/update/${pageId}`, params)
.then((res) => {
Expand All @@ -58,14 +58,19 @@ export const handlePageUpdate = (pageId, params, routerChange) => {
}
}

if (routerChange) {
pageSettingState.updateTreeData()
}
// 更新页面管理的列表,如果不存在,说明还没有打开过页面管理面板
pageSettingState.updateTreeData?.()
pageSettingState.isNew = false
useNotify({ message: '保存成功!', type: 'success' })

// 更新 页面状态 标志
setSaved(true)

if (isCurEditPage) {
const { setBreadcrumbPage } = useBreadcrumb()
setBreadcrumbPage([params.name])
}

return res
})
.catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/js/verification.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const REGEXP_EVENT_NAME = /^[a-z]+([A-Z][a-z]*)*$/

export const verifyEventName = (name) => REGEXP_EVENT_NAME.test(name)

export const REGEXP_BLOCK_NAME = /^([A-Z][A-Za-z0-9]{2,})*?([A-Z][A-Za-z0-9]{2,})*?$/
export const REGEXP_BLOCK_NAME = /^([A-Z][a-z0-9]*){2,}$/

export const verifyBlockName = (string) => REGEXP_BLOCK_NAME.test(string)

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.0.0-rc.2",
"version": "2.0.0-rc.4",
"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.0.0-rc.2",
"version": "2.0.0-rc.4",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
Loading

0 comments on commit d975c5f

Please sign in to comment.