Skip to content

Commit

Permalink
fix: code check (opentiny#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyun8 authored Dec 7, 2023
1 parent a8379f2 commit 009a6d0
Show file tree
Hide file tree
Showing 16 changed files with 135 additions and 119 deletions.
4 changes: 2 additions & 2 deletions mockServer/assets/js/1005web-components.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const cacheStringFunction = (fn) => {
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase())
var _export_sfc = (sfc, props) => {
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
Expand Down Expand Up @@ -73,7 +73,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
])
)
}
var block = /* @__PURE__ */ _export_sfc(_sfc_main, [
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render', _sfc_render],
['__file', 'D:/tmp/buildground/buildground_1673597935715/src/block/generated/components/PortalBlock.vue']
])
Expand Down
40 changes: 21 additions & 19 deletions mockServer/assets/js/1005web-components.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@
*/

;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory(
require('@opentiny/tiny-engine-webcomponent-core'),
require('vue'),
require('vue-i18n'),
require('@opentiny/vue-icon')
))
: typeof define === 'function' && define.amd
? define(['@opentiny/tiny-engine-webcomponent-core', 'vue', 'vue-i18n', '@opentiny/vue-icon'], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyVueBlock = factory(global.TinyWebcomponentCore, global.Vue, global.VueI18n, global.TinyVueIcon)))
})(this, function (tinyWebcomponentCore, vue, vueI18n, tinyVue3Icon) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory(
require('@opentiny/tiny-engine-webcomponent-core'),
require('vue'),
require('vue-i18n'),
require('@opentiny/vue-icon')
)
} else if (typeof define === 'function' && define.amd) {
define(['@opentiny/tiny-engine-webcomponent-core', 'vue', 'vue-i18n', '@opentiny/vue-icon'], factory)
} else {
;(global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyVueBlock = factory(global.TinyWebcomponentCore, global.Vue, global.VueI18n, global.TinyVueIcon))
}
})(this, (tinyWebcomponentCore, vue, vueI18n, tinyVue3Icon) => {
function _interopNamespace(e) {
if (e && e.__esModule) return e
var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } })
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } })
if (e) {
Object.keys(e).forEach(function (k) {
Object.keys(e).forEach((k) => {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k)
const d = Object.getOwnPropertyDescriptor(e, k)
Object.defineProperty(
n,
k,
Expand All @@ -45,10 +47,10 @@
}
})
}
n['default'] = e
n.default = e
return Object.freeze(n)
}
var vue__namespace = /* @__PURE__ */ _interopNamespace(vue)
const vue__namespace = /* @__PURE__ */ _interopNamespace(vue)
Object.freeze({})
Object.freeze([])
const cacheStringFunction = (fn) => {
Expand All @@ -60,7 +62,7 @@
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase())
var _export_sfc = (sfc, props) => {
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
Expand Down Expand Up @@ -112,7 +114,7 @@
])
)
}
var block = /* @__PURE__ */ _export_sfc(_sfc_main, [
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render', _sfc_render],
['__file', 'D:/tmp/buildground/buildground_1673597935715/src/block/generated/components/PortalBlock.vue']
])
Expand Down
4 changes: 2 additions & 2 deletions mockServer/assets/js/1505web-components.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ const Mapper = {
TinyDropdown: Dropdown,
TinyChartHistogram: ChartHistogram
}
Mapper['TinyTabs'].isGroup = true
Mapper['TinyGrid'].isGroup = true
Mapper.TinyTabs.isGroup = true
Mapper.TinyGrid.isGroup = true
export { Mapper as default }
40 changes: 21 additions & 19 deletions mockServer/assets/js/1505web-components.umd.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory(require('@opentiny/vue')))
: typeof define === 'function' && define.amd
? define(['@opentiny/vue'], factory)
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyLowcodeComponent = factory(global.TinyVue)))
})(this, function (tinyVue3) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory(require('@opentiny/vue'))
} else if (typeof define === 'function' && define.amd) {
define(['@opentiny/vue'], factory)
} else {
;(global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyLowcodeComponent = factory(global.TinyVue))
}
})(this, (tinyVue3) => {
'use strict'
const Mapper = {
TinyCarouselItem: tinyVue3.CarouselItem,
Expand Down Expand Up @@ -52,7 +54,7 @@
TinyDropdown: tinyVue3.Dropdown,
TinyChartHistogram: tinyVue3.ChartHistogram
}
Mapper['TinyTabs'].isGroup = true
Mapper['TinyGrid'].isGroup = true
Mapper.TinyTabs.isGroup = true
Mapper.TinyGrid.isGroup = true
return Mapper
})
8 changes: 4 additions & 4 deletions mockServer/assets/js/998web-components.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ const cacheStringFunction = (fn) => {
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase())
var _style_0 =
const _style_0 =
'\n.team-list-item.active[data-v-b66e3972] {\r\n border: 1px solid #38acff;\n}\n.toolbars-item[data-v-b66e3972]:hover {\r\n cursor: pointer;\r\n background-color: #f1f2f3;\n}\n.toolbars-item.active[data-v-b66e3972] {\r\n background-color: #e5e6e8;\n}\n'
var _export_sfc = (sfc, props) => {
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
Expand Down Expand Up @@ -406,7 +406,7 @@ const _hoisted_22 = /* @__PURE__ */ _withScopeId(() =>
)
)
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
var _a
let _a
const _component_tiny_icon_setting = resolveComponent('tiny-icon-setting')
const _component_tiny_tooltip = resolveComponent('tiny-tooltip')
const _component_tiny_icon_check_out = resolveComponent('tiny-icon-check-out')
Expand Down Expand Up @@ -640,7 +640,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
])
)
}
var block = /* @__PURE__ */ _export_sfc(_sfc_main, [
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render', _sfc_render],
['styles', [_style_0]],
['__scopeId', 'data-v-b66e3972'],
Expand Down
53 changes: 29 additions & 24 deletions mockServer/assets/js/998web-components.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,41 @@
*/

;(function (global, factory) {
typeof exports === 'object ' && typeof module !== 'undefined '
? (module.exports = factory(
require('@opentiny/tiny-engine-webcomponent-core '),
require('vue '),
require('vue-i18n '),
require('@opentiny/vue-icon '),
require('@opentiny/vue ')
))
: typeof define === 'function ' && define.amd
? define(
['@opentiny/tiny-engine-webcomponent-core ', 'vue ', 'vue-i18n ', '@opentiny/vue-icon ', '@opentiny/vue '],
factory
)
: ((global = typeof globalThis !== 'undefined ' ? globalThis : global || self),
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory(
require('@opentiny/tiny-engine-webcomponent-core'),
require('vue'),
require('vue-i18n'),
require('@opentiny/vue-icon'),
require('@opentiny/vue')
)
} else if (typeof define === 'function ' && define.amd) {
define([
'@opentiny/tiny-engine-webcomponent-core',
'vue',
'vue-i18n',
'@opentiny/vue-icon',
'@opentiny/vue'
], factory)
} else {
;(global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.TinyVueBlock = factory(
global.TinyWebcomponentCore,
global.Vue,
global.VueI18n,
global.TinyVueIcon,
global.TinyVue
)))
})(this, function (tinyWebcomponentCore, vue, vueI18n, tinyVue3Icon, tinyVue3) {
))
}
})(this, (tinyWebcomponentCore, vue, vueI18n, tinyVue3Icon, tinyVue3) => {
'use strict '
function _interopNamespace(e) {
if (e && e.__esModule) return e
var n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module ' } })
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module ' } })
if (e) {
Object.keys(e).forEach(function (k) {
Object.keys(e).forEach((k) => {
if (k !== 'default ') {
var d = Object.getOwnPropertyDescriptor(e, k)
const d = Object.getOwnPropertyDescriptor(e, k)
Object.defineProperty(
n,
k,
Expand All @@ -59,7 +64,7 @@
n['default '] = e
return Object.freeze(n)
}
var vue__namespace = /* @__PURE__ */ _interopNamespace(vue)
const vue__namespace = /* @__PURE__ */ _interopNamespace(vue)
Object.freeze({})
Object.freeze([])
const cacheStringFunction = (fn) => {
Expand All @@ -71,9 +76,9 @@
}
const hyphenateRE = /\B([A-Z])/g
const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1 ').toLowerCase())
var _style_0 =
const _style_0 =
'\n.team-list-item.active[data-v-b66e3972] {\r\n border: 1px solid #38acff;\n}\n.toolbars-item[data-v-b66e3972]:hover {\r\n cursor: pointer;\r\n background-color: #f1f2f3;\n}\n.toolbars-item.active[data-v-b66e3972] {\r\n background-color: #e5e6e8;\n}\n '
var _export_sfc = (sfc, props) => {
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc
for (const [key, val] of props) {
target[key] = val
Expand Down Expand Up @@ -446,7 +451,7 @@
)
)
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
var _a
let _a
const _component_tiny_icon_setting = vue.resolveComponent('tiny-icon-setting ')
const _component_tiny_tooltip = vue.resolveComponent('tiny-tooltip ')
const _component_tiny_icon_check_out = vue.resolveComponent('tiny-icon-check-out ')
Expand Down Expand Up @@ -688,7 +693,7 @@
])
)
}
var block = /* @__PURE__ */ _export_sfc(_sfc_main, [
const block = /* @__PURE__ */ _export_sfc(_sfc_main, [
['render ', _sfc_render],
['styles ', [_style_0]],
['__scopeId ', 'data-v-b66e3972 '],
Expand Down
4 changes: 2 additions & 2 deletions mockServer/src/services/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class AppService {
// 拼装数据源
const dataSource = {
list: source,
dataHandler: app['data_handler']
dataHandler: app.data_handler
}
// 拼装工具类
const utils = []
Expand All @@ -47,7 +47,7 @@ export default class AppService {
const i18n = this.formatI18nEntrites(entriesData)
return getResponseData({
dataSource,
globalState: app['global_state'],
globalState: app.global_state,
utils,
i18n
})
Expand Down
2 changes: 1 addition & 1 deletion mockServer/src/services/blockCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class BlockCategoryService {
const categories = await this.db.findOneAsync({ _id: id })
categories.blocks.push(params._id)
await this.db.updateAsync({ _id: id }, { $set: categories })
return
return getResponseData(categories)
}
params.app = appinfo.app
await this.db.updateAsync({ _id: id }, { $set: params })
Expand Down
15 changes: 10 additions & 5 deletions packages/canvas/src/components/render/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ const parseI18n = (i18n, scope, ctx) => {

const renderDefault = (children, scope, parent) =>
children.map?.((child) =>
// eslint-disable-next-line no-use-before-define
h(renderer, {
schema: child,
scope,
Expand Down Expand Up @@ -495,32 +496,36 @@ const stopEvent = (event) => {
return false
}

const generateSlotGroup = (children, isCustomElm) => {
const generateSlotGroup = (children, isCustomElm, schema) => {
const slotGroup = {}

children.forEach((child) => {
const { componentName, children, params = [], props } = child
const slot = child.slot || props?.slot?.name || props?.slot || 'default'
const isNotEmptyTemplate = componentName === 'Template' && children.length

isCustomElm && (child.props.slot = 'slot') // CE下需要给子节点加上slot标识
slotGroup[slot] = slotGroup[slot] || {
value: [],
params
params,
parent: isNotEmptyTemplate ? child : schema
}

slotGroup[slot].value.push(...(componentName === 'Template' && children.length ? children : [child])) // template 标签直接过滤掉
slotGroup[slot].value.push(...(isNotEmptyTemplate ? children : [child])) // template 标签直接过滤掉
})

return slotGroup
}

const renderSlot = (children, scope, schema, isCustomElm) => {
if (children.some((a) => a.componentName === 'Template')) {
const slotGroup = generateSlotGroup(children, isCustomElm)
const slotGroup = generateSlotGroup(children, isCustomElm, schema)
const slots = {}

Object.keys(slotGroup).forEach((slotName) => {
slots[slotName] = ($scope) => renderDefault(slotGroup[slotName].value, { ...scope, ...$scope }, schema)
const currentSlot = slotGroup[slotName]

slots[slotName] = ($scope) => renderDefault(currentSlot.value, { ...scope, ...$scope }, currentSlot.parent)
})

return slots
Expand Down
2 changes: 1 addition & 1 deletion packages/common/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineConfig({
return 'import "./style.css"'
}

return
return ''
}
},
external: ['vue', 'monaco-editor', /@opentiny\/tiny-engine.*/, /@opentiny\/vue.*/, /^prettier.*/]
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/block/src/js/blockSetting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ const configureSlots = (blockSchema = {}) => {
export const getDeployProgress = (taskId, block) => {
fetchDeployProgress(taskId).then((data) => {
block.deployStatus = data.taskStatus
block.publishProgress = data['progress_percent']
block.publishProgress = data.progress_percent
block.taskResult = data.taskResult

if (block.publishProgress === PROGRESS.End) {
Expand Down
Loading

0 comments on commit 009a6d0

Please sign in to comment.