diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 000000000..a498b0bbe --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,76 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + if: github.repository == 'opentiny/tiny-engine' + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: pnpm install + + - name: Run Build + run: pnpm run build:plugin && pnpm run build:alpha > /tmp/build-alpha.log 2>&1 + + - name: Upload build logs + uses: actions/upload-artifact@v4 + with: + name: build-alpha-log + path: /tmp/build-alpha.log + + - name: Parse Publish tag + id: parse_tag + run: | + tag_name="${GITHUB_REF#refs/tags/}" + if [[ "$tag_name" == *alpha* ]]; then + echo "dist_tag=alpha" >> "$GITHUB_OUTPUT" + elif [[ "$tag_name" == *beta* ]]; then + echo "dist_tag=beta" >> "$GITHUB_OUTPUT" + elif [[ "$tag_name" == *rc* ]]; then + echo "dist_tag=rc" >> "$GITHUB_OUTPUT" + else + echo "dist_tag=latest" >> "$GITHUB_OUTPUT" + fi + + - name: Verify clean working directory + run: | + if [[ -n "$(git status --porcelain)" ]]; then + echo "Working directory is not clean" + exit 1 + fi + + - name: Verify package version match tag + run: | + tag_name="${GITHUB_REF#refs/tags/}" + package_version=$(pnpm lerna list --scope=@opentiny/tiny-engine --json | jq -r '.[0].version') + if [[ "$tag_name" != "v$package_version" ]]; then + echo "Tag name $tag_name does not match package version $package_version" + exit 1 + fi + + - name: Publish package to npm + run: pnpm lerna publish from-package --dist-tag ${{steps.parse_tag.outputs.dist_tag}} --yes + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/push-check.yml b/.github/workflows/push-check.yml index 0acaab2bd..03d23d21c 100644 --- a/.github/workflows/push-check.yml +++ b/.github/workflows/push-check.yml @@ -4,40 +4,40 @@ on: push: branches: [] pull_request: - branches: [develop,main, refactor/develop] + branches: [develop, main, refactor/develop, release/*] jobs: push-check: - runs-on: ubuntu-latest # windows-latest || macos-latest - + runs-on: ubuntu-latest # windows-latest || macos-latest + steps: - - uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - uses: actions/setup-node@v4 + with: + node-version: 18 - - name: Install dependencies - run: pnpm i + - name: Install dependencies + run: pnpm i - - name: Get changed files - id: get_changed_files - uses: tj-actions/changed-files@v41 - with: - files: | - **.js - **.vue - **.jsx - - name: Run ESLint - run: npx eslint ${{steps.get_changed_files.outputs.all_changed_files}} - - name: Run Build - run: pnpm run build:plugin && pnpm run build:alpha > build-alpha.log 2>&1 + - name: Get changed files + id: get_changed_files + uses: tj-actions/changed-files@v41 + with: + files: | + **.js + **.vue + **.jsx + - name: Run ESLint + run: npx eslint ${{steps.get_changed_files.outputs.all_changed_files}} + - name: Run Build + run: pnpm run build:plugin && pnpm run build:alpha > build-alpha.log 2>&1 - - name: Upload build logs - uses: actions/upload-artifact@v4 - with: - name: build-alpha-log - path: build-alpha.log + - name: Upload build logs + uses: actions/upload-artifact@v4 + with: + name: build-alpha-log + path: build-alpha.log diff --git a/.prettierrc b/.prettierrc index d2baaec51..66195f34c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,7 @@ -semi: false -singleQuote: true -printWidth: 120 -trailingComma: 'none' -endOfLine: 'auto' \ No newline at end of file +{ + "semi": false, + "singleQuote": true, + "printWidth": 120, + "trailingComma": "none", + "endOfLine": "auto" +} diff --git a/designer-demo/engine.config.js b/designer-demo/engine.config.js index fa2b077e0..fa308f9bc 100644 --- a/designer-demo/engine.config.js +++ b/designer-demo/engine.config.js @@ -1,6 +1,6 @@ export default { id: 'engine.config', - theme: import.meta.env.VITE_THEME || 'light', + theme: 'light', material: ['/mock/bundle.json'], scripts: [], styles: [] diff --git a/designer-demo/package.json b/designer-demo/package.json index 4227e1722..01a739937 100644 --- a/designer-demo/package.json +++ b/designer-demo/package.json @@ -1,24 +1,22 @@ { "name": "designer-demo", "private": true, - "version": "2.0.0", + "version": "2.2.0", "type": "module", "scripts": { - "dev": "cross-env VITE_THEME=light vite", - "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" + "dev": "cross-env vite", + "build:alpha": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode alpha", + "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build" }, "dependencies": { "@opentiny/tiny-engine": "workspace:^", - "@opentiny/tiny-engine-theme-dark": "workspace:*", - "@opentiny/tiny-engine-theme-light": "workspace:*", "@opentiny/tiny-engine-utils": "workspace:*", - "@opentiny/vue": "~3.14.0", - "@opentiny/vue-design-smb": "~3.14.0", - "@opentiny/vue-icon": "~3.14.0", - "@opentiny/vue-locale": "~3.14.0", - "@opentiny/vue-renderless": "~3.14.0", - "@opentiny/vue-theme": "~3.14.0", + "@opentiny/vue": "~3.20.0", + "@opentiny/vue-design-smb": "~3.20.0", + "@opentiny/vue-icon": "~3.20.0", + "@opentiny/vue-locale": "~3.20.0", + "@opentiny/vue-renderless": "~3.20.0", + "@opentiny/vue-theme": "~3.20.0", "@vueuse/core": "^9.6.0", "vue": "^3.4.21" }, diff --git a/designer-demo/public/mock/bundle.json b/designer-demo/public/mock/bundle.json index 328a4f277..9cd3cdf17 100644 --- a/designer-demo/public/mock/bundle.json +++ b/designer-demo/public/mock/bundle.json @@ -19,10 +19,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElInput" }, "group": "表单组件", @@ -299,10 +295,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElButton" }, "group": "基础组件", @@ -620,10 +612,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElForm" }, "group": "表单组件", @@ -1075,10 +1063,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElFormItem" }, "group": "表单组件", @@ -1424,10 +1408,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElTable" }, "group": "数据展示", @@ -2661,10 +2641,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElTableColumn" }, "group": "表单组件", @@ -2727,11 +2703,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CarouselItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CarouselItem" }, "group": "component", "category": "容器组件", @@ -2860,11 +2832,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Carousel", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Carousel" }, "group": "component", "category": "容器组件", @@ -4534,11 +4502,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "ButtonGroup", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "ButtonGroup" }, "group": "component", "category": "general", @@ -4692,11 +4656,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Row", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Row" }, "group": "component", "priority": 5, @@ -4843,10 +4803,10 @@ "npm": { "package": "@opentiny/vue", "exportName": "Layout", - "version": "3.14.0", + "version": "3.20.0", "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "script": "https://unpkg.com/@opentiny/vue-runtime@~3.20/dist3/tiny-vue-pc.mjs", + "css": "https://unpkg.com/@opentiny/vue-theme@~3.20/index.css" }, "group": "component", "priority": 5, @@ -4949,11 +4909,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Form", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Form" }, "group": "component", "priority": 5, @@ -5303,11 +5259,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "FormItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "FormItem" }, "group": "component", "priority": 12, @@ -5435,11 +5387,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Col", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Col" }, "group": "component", "priority": 2, @@ -5713,11 +5661,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Button", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Button" }, "group": "component", "priority": 2, @@ -6052,11 +5996,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Input", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Input" }, "group": "component", "priority": 1, @@ -6466,11 +6406,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Radio", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Radio" }, "group": "component", "priority": 3, @@ -6703,11 +6639,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Select", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Select" }, "group": "component", "priority": 8, @@ -7108,11 +7040,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Switch", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Switch" }, "group": "component", "priority": 9, @@ -7307,11 +7235,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Search", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Search" }, "group": "component", "priority": 2, @@ -7582,11 +7506,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Checkbox", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Checkbox" }, "group": "component", "priority": 4, @@ -7841,11 +7761,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CheckboxButton", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CheckboxButton" }, "group": "component", "priority": 1, @@ -8029,11 +7945,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CheckboxGroup", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CheckboxGroup" }, "group": "component", "priority": 2, @@ -8238,11 +8150,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "DialogBox", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "DialogBox" }, "group": "component", "priority": 4, @@ -8516,11 +8424,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Tabs", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Tabs" }, "group": "component", "priority": 10, @@ -8797,11 +8701,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "TabItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "TabItem" }, "group": "component", "priority": 2, @@ -8906,11 +8806,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Breadcrumb", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Breadcrumb" }, "group": "component", "priority": 1, @@ -9045,11 +8941,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "BreadcrumbItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "BreadcrumbItem" }, "group": "component", "priority": 1, @@ -9134,11 +9026,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Collapse", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Collapse" }, "group": "component", "priority": 3, @@ -9261,11 +9149,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CollapseItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CollapseItem" }, "group": "component", "priority": 2, @@ -9372,11 +9256,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Grid", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Grid" }, "group": "component", "priority": 2, @@ -10272,6 +10152,54 @@ } } }, + { + "icon": "grid", + "name": { + "zh_CN": "表格行" + }, + "component": "TinyGridColumn", + "description": "提供了非常强大数据表格功能,可以展示数据列表,可以对数据列表进行选择、编辑等", + "docUrl": "", + "screenshot": "", + "tags": "", + "keywords": "", + "devMode": "proCode", + "npm": { + "package": "@opentiny/vue", + "exportName": "TinyGridColumn" + }, + "group": "component", + "priority": 2, + "schema": { + "properties": [], + "events": {}, + "shortcuts": {}, + "contentMenu": { + "actions": ["create symbol"] + } + }, + "configure": { + "loop": true, + "condition": true, + "styles": true, + "isContainer": false, + "isModal": false, + "nestingRule": { + "childWhitelist": "", + "parentWhitelist": "", + "descendantBlacklist": "", + "ancestorWhitelist": "" + }, + "isNullNode": false, + "isLayout": false, + "rootSelector": "", + "shortcuts": {}, + "contextMenu": { + "actions": ["create symbol"], + "disable": ["copy", "remove"] + } + } + }, { "name": { "zh_CN": "分页" @@ -10286,11 +10214,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Pager", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Pager" }, "group": "component", "priority": 1, @@ -10519,11 +10443,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Popeditor", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Popeditor" }, "group": "component", "priority": 6, @@ -10882,11 +10802,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Tree", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Tree" }, "group": "component", "priority": 12, @@ -11217,11 +11133,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "TimeLine", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "TimeLine" }, "group": "component", "priority": 3, @@ -11424,11 +11336,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Tooltip", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Tooltip" }, "group": "component", "priority": 11, @@ -11645,11 +11553,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Popover", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Popover" }, "group": "component", "priority": 7, @@ -12140,11 +12044,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "DatePicker", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "DatePicker" }, "group": "component", "priority": 1, @@ -12555,11 +12455,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Numeric", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Numeric" }, "group": "component", "priority": 1, @@ -14187,6 +14083,23 @@ } ] } + ], + "packages": [ + { + "name": "TinyVue组件库", + "package": "@opentiny/vue", + "version": "3.20.0", + "destructuring": true, + "script": "https://unpkg.com/@opentiny/vue-runtime@~3.20/dist3/tiny-vue-pc.mjs", + "css": "https://unpkg.com/@opentiny/vue-theme@~3.20/index.css" + }, + { + "name": "element-plus组件库", + "package": "element-plus", + "version": "2.4.2", + "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", + "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css" + } ] } } diff --git a/designer-demo/registry.js b/designer-demo/registry.js index 45d09f154..032a8a968 100644 --- a/designer-demo/registry.js +++ b/designer-demo/registry.js @@ -14,12 +14,14 @@ import { Breadcrumb, Fullscreen, Lang, + ViewSetting, Logo, Lock, Media, Redoundo, Save, Clean, + ThemeSwitch, Preview, GenerateCode, Refresh, @@ -42,7 +44,8 @@ import { Layout, Canvas, GenerateCodeService, - GlobalService + GlobalService, + ThemeSwitchService } from '@opentiny/tiny-engine' import engineConfig from './engine.config' import { HttpService } from './src/composable' @@ -50,7 +53,7 @@ import { HttpService } from './src/composable' export default { root: { id: 'engine.root', - metas: [HttpService, GenerateCodeService, GlobalService] // GlobalService 依赖 HttpService,HttpService需要在前面处理 + metas: [HttpService, GenerateCodeService, GlobalService, ThemeSwitchService] // GlobalService 依赖 HttpService,HttpService需要在前面处理 }, config: engineConfig, layout: { @@ -63,14 +66,15 @@ export default { left: ['engine.toolbars.breadcrumb', 'engine.toolbars.lock', 'engine.toolbars.logo'], center: ['engine.toolbars.media'], right: [ - ['engine.toolbars.redoundo', 'engine.toolbars.clean'], + ['engine.toolbars.themeSwitch', 'engine.toolbars.redoundo', 'engine.toolbars.clean'], ['engine.toolbars.preview'], ['engine.toolbars.generate-code', 'engine.toolbars.save'] ], collapse: [ ['engine.toolbars.collaboration'], ['engine.toolbars.refresh', 'engine.toolbars.fullscreen'], - ['engine.toolbars.lang'] + ['engine.toolbars.lang'], + ['engine.toolbars.viewSetting'] ] } } @@ -84,6 +88,7 @@ export default { } ], toolbars: [ + ThemeSwitch, Logo, Breadcrumb, Lock, @@ -96,9 +101,23 @@ export default { GenerateCode, Save, Fullscreen, - Lang + Lang, + ViewSetting + ], + plugins: [ + Materials, + Tree, + Page, + [Block, { options: { ...Block.options, mergeCategoriesAndGroups: true } }], + Datasource, + Bridge, + I18n, + Script, + State, + Schema, + Help, + Robot ], - plugins: [Materials, Tree, Page, Block, Datasource, Bridge, I18n, Script, State, Schema, Help, Robot], dsls: [{ id: 'engine.dsls.dslvue' }], settings: [Props, Styles, Events], canvas: Canvas diff --git a/designer-demo/src/main.js b/designer-demo/src/main.js index 6f29317b2..10457cd95 100644 --- a/designer-demo/src/main.js +++ b/designer-demo/src/main.js @@ -15,7 +15,6 @@ import { registry } from './defineEntry.js' import { init } from '@opentiny/tiny-engine' import { configurators } from './configurators/' import 'virtual:svg-icons-register' -import '@opentiny/tiny-engine-theme' init({ registry, diff --git a/designer-demo/src/preview.js b/designer-demo/src/preview.js index eb7717c66..7b53620cb 100644 --- a/designer-demo/src/preview.js +++ b/designer-demo/src/preview.js @@ -13,7 +13,6 @@ import { initHook, HOOK_NAME, GenerateCodeService, Breadcrumb, Media, Lang } from '@opentiny/tiny-engine' import { initPreview } from '@opentiny/tiny-engine' import 'virtual:svg-icons-register' -import '@opentiny/tiny-engine-theme' import { HttpService } from './composable' const beforeAppCreate = () => { diff --git a/jsconfig.json b/jsconfig.json index 9011eef09..ff8952a2a 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -23,6 +23,7 @@ "@opentiny/tiny-engine-toolbar-breadcrumb": ["packages/toolbars/breadcrumb/index"], "@opentiny/tiny-engine-toolbar-fullscreen": ["packages/toolbars/fullscreen/index"], "@opentiny/tiny-engine-toolbar-lang": ["packages/toolbars/lang/index"], + "@opentiny/tiny-engine-toolbar-view-setting": ["packages/toolbars/view-setting/index"], "@opentiny/tiny-engine-toolbar-layout": ["packages/toolbars/layout/index"], "@opentiny/tiny-engine-toolbar-lock": ["packages/toolbars/lock/index"], "@opentiny/tiny-engine-toolbar-logo": ["packages/toolbars/logo/index"], @@ -30,10 +31,9 @@ "@opentiny/tiny-engine-toolbar-preview": ["packages/toolbars/preview/index"], "@opentiny/tiny-engine-toolbar-generate-code": ["packages/toolbars/generate-code/index"], "@opentiny/tiny-engine-toolbar-clean": ["packages/toolbars/clean/index"], + "@opentiny/tiny-engine-toolbar-theme-switch": ["packages/toolbars/themeSwitch/index"], "@opentiny/tiny-engine-toolbar-save": ["packages/toolbars/save/index"], "tiny-engine-canvas": ["packages/canvas/index"], - "@opentiny/tiny-engine-theme-dark": ["packages/theme/dark/index.less"], - "@opentiny/tiny-engine-theme-light": ["packages/theme/light/index.less"], "@opentiny/tiny-engine-svgs": ["packages/svgs/index"], "@opentiny/tiny-engine-plugin-materials/*": ["packages/plugins/materials/*"], "@opentiny/tiny-engine-plugin-state/*": ["packages/plugins/state/*"], @@ -51,15 +51,15 @@ "@opentiny/tiny-engine-toolbar-breadcrumb/*": ["packages/toolbars/breadcrumb/*"], "@opentiny/tiny-engine-toolbar-fullscreen/*": ["packages/toolbars/fullscreen/*"], "@opentiny/tiny-engine-toolbar-lang/*": ["packages/toolbars/lang/*"], + "@opentiny/tiny-engine-toolbar-view-setting/*": ["packages/toolbars/view-setting/*"], "@opentiny/tiny-engine-toolbar-layout/*": ["packages/toolbars/layout/*"], "@opentiny/tiny-engine-toolbar-lock/*": ["packages/toolbars/lock/*"], "@opentiny/tiny-engine-toolbar-logo/*": ["packages/toolbars/logo/*"], "@opentiny/tiny-engine-toolbar-media/*": ["packages/toolbars/media/*"], "@opentiny/tiny-engine-toolbar-preview/*": ["packages/toolbars/preview/*"], "@opentiny/tiny-engine-toolbar-clean/*": ["packages/toolbars/clean/*"], + "@opentiny/tiny-engine-toolbar-theme-switch/*": ["packages/toolbars/themeSwitch/*"], "@opentiny/tiny-engine-toolbar-save/*": ["packages/toolbars/save/*"], - "@opentiny/tiny-engine-theme-dark/*": ["packages/theme/dark/*"], - "@opentiny/tiny-engine-theme-light/*": ["packages/theme/light/*"], "@opentiny/tiny-engine-svgs/*": ["packages/svgs/*"], "@opentiny/tiny-engine-utils": ["packages/utils/src/index.js"], "@opentiny/tiny-engine-webcomponent-core": ["packages/webcomponent/src/lib"], diff --git a/mockServer/.eslintrc.js b/mockServer/.eslintrc.js index 997ea0e78..9f439207b 100644 --- a/mockServer/.eslintrc.js +++ b/mockServer/.eslintrc.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ module.exports = { root: true, diff --git a/mockServer/build/dev-server.js b/mockServer/build/dev-server.js index f32a8a0b6..c5dbea7dd 100644 --- a/mockServer/build/dev-server.js +++ b/mockServer/build/dev-server.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ require('@babel/register') require('../src/app') diff --git a/mockServer/gulpfile.js b/mockServer/gulpfile.js index c49d674db..a2a99308c 100644 --- a/mockServer/gulpfile.js +++ b/mockServer/gulpfile.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ const gulp = require('gulp') const eslint = require('gulp-eslint') diff --git a/mockServer/package.json b/mockServer/package.json index 4ed5473c3..eed0f6bea 100644 --- a/mockServer/package.json +++ b/mockServer/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-mock", - "version": "2.0.0", + "version": "2.2.0", "publishConfig": { "access": "public" }, diff --git a/mockServer/pm2.js b/mockServer/pm2.js index b4de90cfc..ea734735d 100644 --- a/mockServer/pm2.js +++ b/mockServer/pm2.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ module.exports = { apps: [ diff --git a/mockServer/src/app.js b/mockServer/src/app.js index 8abfa078b..5287ad74d 100644 --- a/mockServer/src/app.js +++ b/mockServer/src/app.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import Koa2 from 'koa' import KoaBody from 'koa-body' diff --git a/mockServer/src/assets/js/1505web-components.es.js b/mockServer/src/assets/js/1505web-components.es.js index 1d33e4e1c..bc940f339 100644 --- a/mockServer/src/assets/js/1505web-components.es.js +++ b/mockServer/src/assets/js/1505web-components.es.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { CarouselItem, diff --git a/mockServer/src/assets/json/appinfo.json b/mockServer/src/assets/json/appinfo.json index 156bb9cce..d15b9c6f4 100644 --- a/mockServer/src/assets/json/appinfo.json +++ b/mockServer/src/assets/json/appinfo.json @@ -26956,6 +26956,54 @@ } } }, + { + "icon": "grid", + "name": { + "zh_CN": "表格行" + }, + "component": "TinyGridColumn", + "description": "提供了非常强大数据表格功能,可以展示数据列表,可以对数据列表进行选择、编辑等", + "docUrl": "", + "screenshot": "", + "tags": "", + "keywords": "", + "devMode": "proCode", + "npm": { + "package": "@opentiny/vue", + "exportName": "TinyGridColumn" + }, + "group": "component", + "priority": 2, + "schema": { + "properties": [], + "events": {}, + "shortcuts": {}, + "contentMenu": { + "actions": ["create symbol"] + } + }, + "configure": { + "loop": true, + "condition": true, + "styles": true, + "isContainer": false, + "isModal": false, + "nestingRule": { + "childWhitelist": "", + "parentWhitelist": "", + "descendantBlacklist": "", + "ancestorWhitelist": "" + }, + "isNullNode": false, + "isLayout": false, + "rootSelector": "", + "shortcuts": {}, + "contextMenu": { + "actions": ["create symbol"], + "disable": ["copy", "remove"] + } + } + }, { "name": { "zh_CN": "分页" diff --git a/mockServer/src/middleware/ErrorRoutesCatch.js b/mockServer/src/middleware/ErrorRoutesCatch.js index b1d42440a..5fdbce3ba 100644 --- a/mockServer/src/middleware/ErrorRoutesCatch.js +++ b/mockServer/src/middleware/ErrorRoutesCatch.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ const { getResponseData } = require('../tool/Common') diff --git a/mockServer/src/mock/get/app-center/v1/apps/schema/918.json b/mockServer/src/mock/get/app-center/v1/apps/schema/918.json index 17656258e..4d20d698f 100644 --- a/mockServer/src/mock/get/app-center/v1/apps/schema/918.json +++ b/mockServer/src/mock/get/app-center/v1/apps/schema/918.json @@ -1904,6 +1904,13 @@ "destructuring": true, "version": "0.1.16" }, + { + "componentName": "TinyGridColumn", + "package": "@opentiny/vue", + "exportName": "TinyGridColumn", + "destructuring": true, + "version": "0.1.16" + }, { "componentName": "TinyNumeric", "package": "@opentiny/vue", @@ -1923,7 +1930,7 @@ "package": "@opentiny/vue", "exportName": "Checkbox", "destructuring": true, - "version": "3.14.0" + "version": "3.20.0" }, { "componentName": "TinySelect", @@ -1986,28 +1993,28 @@ "package": "@opentiny/vue", "exportName": "Collapse", "destructuring": true, - "version": "3.14.0" + "version": "3.20.0" }, { "componentName": "TinyCollapseItem", "package": "@opentiny/vue", "exportName": "CollapseItem", "destructuring": true, - "version": "3.14.0" + "version": "3.20.0" }, { "componentName": "TinyBreadcrumb", "package": "@opentiny/vue", "exportName": "Breadcrumb", "destructuring": true, - "version": "3.14.0" + "version": "3.20.0" }, { "componentName": "TinyBreadcrumbItem", "package": "@opentiny/vue", "exportName": "BreadcrumbItem", "destructuring": true, - "version": "3.14.0" + "version": "3.20.0" }, { "componentName": "ElInput", @@ -2092,7 +2099,8 @@ "value": "", "package": "axios", "destructuring": false, - "exportName": "axios" + "exportName": "axios", + "cdnLink": "https://unpkg.com/axios@1.7.9/dist/esm/axios.min.js" } }, { diff --git a/mockServer/src/routes/error-routes.js b/mockServer/src/routes/error-routes.js index aca35329c..6f1a791a2 100644 --- a/mockServer/src/routes/error-routes.js +++ b/mockServer/src/routes/error-routes.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ module.exports = function () { return function (ctx, next) { diff --git a/mockServer/src/services/app.js b/mockServer/src/services/app.js index 11ff3c3de..146e8f737 100644 --- a/mockServer/src/services/app.js +++ b/mockServer/src/services/app.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { mockService } from '../routes/main-routes' import { getResponseData } from '../tool/Common' diff --git a/mockServer/src/services/pageSchema.js b/mockServer/src/services/pageSchema.js index 2b78b9be7..45bb58420 100644 --- a/mockServer/src/services/pageSchema.js +++ b/mockServer/src/services/pageSchema.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { E_SchemaFormatFunc } from './utils' import { getResponseData } from '../tool/Common' @@ -68,7 +68,6 @@ export default class PageSchemaService { this.config = config } - assembleFields(originalData, type) { let dataCopy = JSON.parse(JSON.stringify(originalData.data)) const conf = this.config[type] diff --git a/mockServer/src/services/pages.js b/mockServer/src/services/pages.js index 07b743e2e..a4164d24b 100644 --- a/mockServer/src/services/pages.js +++ b/mockServer/src/services/pages.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import path from 'path' import DateStore from '@seald-io/nedb' diff --git a/mockServer/src/services/source.js b/mockServer/src/services/source.js index e0f0386e0..04164ef59 100644 --- a/mockServer/src/services/source.js +++ b/mockServer/src/services/source.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { getResponseData } from '../tool/Common' import sources from '../assets/json/sources.json' diff --git a/mockServer/src/services/utils.js b/mockServer/src/services/utils.js index 853dc4265..97f36cb8e 100644 --- a/mockServer/src/services/utils.js +++ b/mockServer/src/services/utils.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import moment from 'moment' diff --git a/mockServer/src/tool/Common.js b/mockServer/src/tool/Common.js index 23d79880d..4649a96e0 100644 --- a/mockServer/src/tool/Common.js +++ b/mockServer/src/tool/Common.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ // 截取字符串,多余的部分用...代替 export const setString = (str, len) => { @@ -40,7 +40,6 @@ export const OptionFormat = (GetOptions) => { return JSON.parse(options + '}') } - // 数组去重 export const HovercUnique = (arr) => { const n = {} diff --git a/mockServer/test/app.test.js b/mockServer/test/app.test.js index 1af2aa315..87557a34a 100644 --- a/mockServer/test/app.test.js +++ b/mockServer/test/app.test.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import app from '../src/app' diff --git a/package.json b/package.json index af2d9e7d9..b6d3bead5 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,13 @@ "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", "@types/node": "^18.0.0", + "@vue/eslint-config-typescript": "^11.0.3", "chokidar": "^3.5.3", "concurrently": "^8.2.0", "cross-env": "^7.0.3", @@ -37,6 +39,7 @@ "lint-staged": "^13.2.0", "mysql": "^2.18.1", "picocolors": "^1.0.0", + "prettier": "^2.7.1", "vue-eslint-parser": "^8.0.1" }, "browserslist": [ diff --git a/packages/block-compiler/index.html b/packages/block-compiler/index.html index f0dde4b8c..b3b21d25b 100644 --- a/packages/block-compiler/index.html +++ b/packages/block-compiler/index.html @@ -4,7 +4,7 @@ block-compiler - + diff --git a/packages/block-compiler/package.json b/packages/block-compiler/package.json index 923c956f3..58a7dc9e2 100644 --- a/packages/block-compiler/package.json +++ b/packages/block-compiler/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-block-compiler", - "version": "2.0.0-rc.2", + "version": "2.2.0", "publishConfig": { "access": "public" }, @@ -27,15 +27,11 @@ "author": "OpenTiny Team", "license": "MIT", "homepage": "https://opentiny.design/tiny-engine", - "dependencies": {}, "devDependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@esbuild-plugins/node-modules-polyfill": "^0.2.2", "@types/babel__core": "^7.20.5", - "@typescript-eslint/eslint-plugin": "^8.14.0", - "@typescript-eslint/parser": "^8.14.0", "@vitejs/plugin-vue": "^5.1.2", - "eslint": "^8.38.0", "typescript": "~5.4.2", "vite": "^5.4.2", "vite-plugin-dts": "^4.3.0" @@ -43,7 +39,7 @@ "peerDependencies": { "@babel/core": "^7.26.0", "@vue/babel-plugin-jsx": "^1.2.5", - "vue": "^3.4.15", - "@vue/compiler-sfc": "^3.4.15" + "@vue/compiler-sfc": "^3.4.15", + "vue": "^3.4.15" } } diff --git a/packages/block-compiler/src/index.ts b/packages/block-compiler/src/index.ts index 3c537e63f..6f2c340d8 100644 --- a/packages/block-compiler/src/index.ts +++ b/packages/block-compiler/src/index.ts @@ -58,7 +58,7 @@ export interface IResultMap { [key: string]: compiledItem } -const resolveRelativeImport = (code: string, globalGetterName = 'getBlockComponentBlobUrl') => { +const resolveRelativeImport = (code: string, globalGetterName = 'loadBlockComponent') => { const magicStr = new MagicString(code) const ast = babelParse(code, { sourceType: 'module', plugins: ['jsx'] }).program.body @@ -86,7 +86,7 @@ const resolveRelativeImport = (code: string, globalGetterName = 'getBlockCompone // 声明异步组件 const Block = defineAsyncComponent(() => import(getBlockUrl(Block))) magicStr.appendLeft( node.start!, - `const ${defaultImportId} = defineAsyncComponent(() => import(window.${globalGetterName}('${fileName}')))` + `const ${defaultImportId} = defineAsyncComponent(() => window.${globalGetterName}('${fileName}'))` ) // 移除 import Block from './Block.vue' 语句 diff --git a/packages/blockToWebComponentTemplate/package.json b/packages/blockToWebComponentTemplate/package.json index 732431244..be31465c8 100644 --- a/packages/blockToWebComponentTemplate/package.json +++ b/packages/blockToWebComponentTemplate/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-block-build", - "version": "2.0.0", + "version": "2.2.0", "description": "translate block to webcomponent template", "main": "./dist/web-components.es.js", "type": "module", @@ -33,9 +33,9 @@ "dependencies": { "@opentiny/tiny-engine-i18n-host": "workspace:*", "@opentiny/tiny-engine-webcomponent-core": "workspace:*", - "@opentiny/vue": "~3.14.0", - "@opentiny/vue-icon": "~3.14.0", - "@opentiny/vue-theme": "~3.14.0", + "@opentiny/vue": "~3.20.0", + "@opentiny/vue-icon": "~3.20.0", + "@opentiny/vue-theme": "~3.20.0", "@vue/shared": "^3.3.11", "vue": "^3.4.15", "vue-i18n": "^9.9.0" diff --git a/packages/build/vite-config/package.json b/packages/build/vite-config/package.json index cde773dd4..707ad0b50 100644 --- a/packages/build/vite-config/package.json +++ b/packages/build/vite-config/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-vite-config", - "version": "2.0.0", + "version": "2.2.0", "description": "", "type": "module", "main": "./index.js", diff --git a/packages/build/vite-config/src/canvas-dev-external.js b/packages/build/vite-config/src/canvas-dev-external.js index 0d0c4bcc3..464f11d7f 100644 --- a/packages/build/vite-config/src/canvas-dev-external.js +++ b/packages/build/vite-config/src/canvas-dev-external.js @@ -7,16 +7,16 @@ export function canvasDevExternal(override = {}) { const blockRequire = { externals: [/^@opentiny\/vue$/, /^@opentiny\/vue-icon$/], imports: { - '@opentiny/vue': `${prefix}/node_modules/@opentiny/vue/runtime/tiny-vue.mjs`, - '@opentiny/vue-icon': `${prefix}/node_modules/@opentiny/vue/runtime/tiny-vue-icon.mjs` + '@opentiny/vue': `${prefix}/node_modules/@opentiny/vue-runtime/dist3/tiny-vue-pc.mjs`, + '@opentiny/vue-icon': `${prefix}/node_modules/@opentiny/vue-runtime/dist3/tiny-vue-icon.mjs` }, importStyles: [`${prefix}/node_modules/@opentiny/vue-theme/index.css`] } // 以下内容由于物料协议不支持声明子依赖而@opentiny/vue需要依赖所以需要补充 const tinyVueRequire = { imports: { - '@opentiny/vue-common': `${prefix}/node_modules/@opentiny/vue/runtime/tiny-vue-common.mjs`, - '@opentiny/vue-locale': `${prefix}/node_modules/@opentiny/vue/runtime/tiny-vue-locale.mjs` + '@opentiny/vue-common': `${prefix}/node_modules/@opentiny/vue-runtime/dist3/tiny-vue-common.mjs`, + '@opentiny/vue-locale': `${prefix}/node_modules/@opentiny/vue-runtime/dist3/tiny-vue-locale.mjs` } } return [ diff --git a/packages/build/vite-config/src/default-config.js b/packages/build/vite-config/src/default-config.js index 54f0b86b5..e19a1e778 100644 --- a/packages/build/vite-config/src/default-config.js +++ b/packages/build/vite-config/src/default-config.js @@ -29,7 +29,7 @@ const getDefaultConfig = (engineConfig) => { base: './', publicDir: path.resolve(root, './public'), resolve: { - extensions: ['.js', '.jsx', '.vue'], + extensions: ['.js', '.jsx', '.vue', '.ts', '.tsx'], alias: {} }, server: { diff --git a/packages/build/vite-config/src/localCdnFile/copyPreviewImportMap.js b/packages/build/vite-config/src/localCdnFile/copyPreviewImportMap.js index 51c853c19..78149b429 100644 --- a/packages/build/vite-config/src/localCdnFile/copyPreviewImportMap.js +++ b/packages/build/vite-config/src/localCdnFile/copyPreviewImportMap.js @@ -16,7 +16,7 @@ export function extraPreviewImport(filename, originCdnPrefix) { const result = [] const importMap = readJsonSync(filename) Object.entries(importMap.imports)?.forEach(([_key, location]) => { - const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.14') + const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.20') if (url?.startsWith(originCdnPrefix) && !result.includes(url)) { result.push(url) } @@ -29,7 +29,7 @@ export function replacePreviewImport(importMap, fileMap, originCdnPrefix) { imports: Object.fromEntries( Object.entries(importMap.imports)?.map(([key, location]) => { // 这里的替换占位符规则等同于packages/design-core/src/preview/src/preview/importMap.js, 两边修改需要同步 - const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.14') + const url = location.replace('${VITE_CDN_DOMAIN}', originCdnPrefix).replace('${opentinyVueVersion}', '~3.20') const matchRule = fileMap.find((rule) => url === rule.originUrl) if (matchRule) { return [key, matchRule.newUrl] diff --git a/packages/build/vite-config/src/vite-plugins/devAliasPlugin.js b/packages/build/vite-config/src/vite-plugins/devAliasPlugin.js index 5732d17d8..a4bf54d38 100644 --- a/packages/build/vite-config/src/vite-plugins/devAliasPlugin.js +++ b/packages/build/vite-config/src/vite-plugins/devAliasPlugin.js @@ -36,6 +36,7 @@ const getDevAlias = (useSourceAlias) => { '@opentiny/tiny-engine-toolbar-breadcrumb': path.resolve(basePath, 'packages/toolbars/breadcrumb/index.js'), '@opentiny/tiny-engine-toolbar-fullscreen': path.resolve(basePath, 'packages/toolbars/fullscreen/index.js'), '@opentiny/tiny-engine-toolbar-lang': path.resolve(basePath, 'packages/toolbars/lang/index.js'), + '@opentiny/tiny-engine-toolbar-view-setting': path.resolve(basePath, 'packages/toolbars/view-setting/index.js'), '@opentiny/tiny-engine-toolbar-layout': path.resolve(basePath, 'packages/toolbars/layout/index.js'), '@opentiny/tiny-engine-toolbar-lock': path.resolve(basePath, 'packages/toolbars/lock/index.js'), '@opentiny/tiny-engine-toolbar-logo': path.resolve(basePath, 'packages/toolbars/logo/index.js'), @@ -46,14 +47,13 @@ const getDevAlias = (useSourceAlias) => { '@opentiny/tiny-engine-toolbar-refresh': path.resolve(basePath, 'packages/toolbars/refresh/index.js'), '@opentiny/tiny-engine-toolbar-redoundo': path.resolve(basePath, 'packages/toolbars/redoundo/index.js'), '@opentiny/tiny-engine-toolbar-clean': path.resolve(basePath, 'packages/toolbars/clean/index.js'), + '@opentiny/tiny-engine-toolbar-theme-switch': path.resolve(basePath, 'packages/toolbars/themeSwitch/index.js'), '@opentiny/tiny-engine-toolbar-save': path.resolve(basePath, 'packages/toolbars/save/index.js'), '@opentiny/tiny-engine-toolbar-setting': path.resolve(basePath, 'packages/toolbars/setting/index.js'), '@opentiny/tiny-engine-toolbar-collaboration': path.resolve(basePath, 'packages/toolbars/collaboration/index.js'), - '@opentiny/tiny-engine-theme-dark': path.resolve(basePath, 'packages/theme/dark/index.less'), - '@opentiny/tiny-engine-theme-light': path.resolve(basePath, 'packages/theme/light/index.less'), '@opentiny/tiny-engine-theme-base': path.resolve(basePath, 'packages/theme/base/src/index.js'), '@opentiny/tiny-engine-svgs': path.resolve(basePath, 'packages/svgs/index.js'), - '@opentiny/tiny-engine-canvas/render': path.resolve(basePath, 'packages/canvas/render/index.js'), + '@opentiny/tiny-engine-canvas/render': path.resolve(basePath, 'packages/canvas/render/index.ts'), '@opentiny/tiny-engine-canvas': path.resolve(basePath, 'packages/canvas/index.js'), '@opentiny/tiny-engine-utils': path.resolve(basePath, 'packages/utils/src/index.js'), '@opentiny/tiny-engine-webcomponent-core': path.resolve(basePath, 'packages/webcomponent/src/lib.js'), @@ -66,19 +66,6 @@ const getDevAlias = (useSourceAlias) => { } } -const getThemePath = (theme, useSourceAlias) => { - if (!['light', 'dark'].includes(theme)) { - return '' - } - - if (useSourceAlias) { - const basePath = useSourceAlias.basePath || path.resolve(process.cwd(), '..') - return path.resolve(basePath, `packages/theme/${theme}/index.less`) - } - - return path.resolve(process.cwd(), `./node_modules/@opentiny/tiny-engine-theme-${theme}/dist/style.css`) -} - /** * 源码调试插件 * 开启后,会指定 alias 到官方源码 package @@ -94,8 +81,7 @@ export const devAliasPlugin = (env, useSourceAlias) => { return { resolve: { alias: { - ...getDevAlias(useSourceAlias), - '@opentiny/tiny-engine-theme': getThemePath(env.VITE_THEME, useSourceAlias) + ...getDevAlias(useSourceAlias) } } } @@ -106,7 +92,6 @@ export const devAliasPlugin = (env, useSourceAlias) => { resolve: { alias: { // 构建不使用 alias - '@opentiny/tiny-engine-theme': getThemePath(env.VITE_THEME, false) } } } diff --git a/packages/build/vite-plugin-meta-comments/package.json b/packages/build/vite-plugin-meta-comments/package.json index 9fe3c8d5f..d8bef2639 100644 --- a/packages/build/vite-plugin-meta-comments/package.json +++ b/packages/build/vite-plugin-meta-comments/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-vite-plugin-meta-comments", - "version": "2.0.0", + "version": "2.2.0", "description": "", "type": "module", "main": "dist/index.cjs", diff --git a/packages/builtinComponent/package.json b/packages/builtinComponent/package.json index 5ce300444..2ac55c378 100644 --- a/packages/builtinComponent/package.json +++ b/packages/builtinComponent/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-builtin-component", - "version": "2.0.0", + "version": "2.2.0", "description": "", "main": "dist/index.mjs", "module": "dist/index.mjs", diff --git a/packages/canvas/.eslintrc.cjs b/packages/canvas/.eslintrc.cjs index 7e042cff2..6dec99b0a 100644 --- a/packages/canvas/.eslintrc.cjs +++ b/packages/canvas/.eslintrc.cjs @@ -9,7 +9,6 @@ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. * */ - module.exports = { env: { browser: true, @@ -17,16 +16,16 @@ module.exports = { node: true, jest: true }, - extends: ['eslint:recommended', 'plugin:vue/vue3-essential'], + extends: ['eslint:recommended', 'plugin:vue/vue3-essential', '@vue/eslint-config-typescript'], parser: 'vue-eslint-parser', parserOptions: { - parser: '@babel/eslint-parser', + parser: '@typescript-eslint/parser', ecmaVersion: 'latest', sourceType: 'module', requireConfigFile: false, babelOptions: { parserOpts: { - plugins: ['jsx'] + plugins: ['jsx', 'typescript'] } } }, @@ -37,6 +36,8 @@ module.exports = { 'space-before-function-paren': 'off', 'vue/multi-word-component-names': 'off', 'no-use-before-define': 'error', - 'no-unused-vars': ['error', { ignoreRestSiblings: true, varsIgnorePattern: '^_', argsIgnorePattern: '^_' }] + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], + 'import/no-inner-modules': 'off' } } diff --git a/packages/canvas/DesignCanvas/src/DesignCanvas.vue b/packages/canvas/DesignCanvas/src/DesignCanvas.vue index 295c6fde6..27d99cd9e 100644 --- a/packages/canvas/DesignCanvas/src/DesignCanvas.vue +++ b/packages/canvas/DesignCanvas/src/DesignCanvas.vue @@ -1,5 +1,8 @@ diff --git a/packages/common/component/MetaModal.vue b/packages/common/component/MetaModal.vue index 8bd2115b7..a19dab280 100644 --- a/packages/common/component/MetaModal.vue +++ b/packages/common/component/MetaModal.vue @@ -74,10 +74,10 @@ export default { .modal-content { padding: 8px; - color: var(--ti-lowcode-toolbar-breadcrumb-color); - border: 1px solid var(--ti-lowcode-tabs-border-color); + color: var(--te-component-common-text-color-secondary); + border: 1px solid var(--te-component-common-border-color); border-radius: 4px; - background-color: var(--ti-lowcode-toolbar-bg); + background-color: var(--te-component-meta-modal-bg-color); overflow: auto; max-height: 100%; } diff --git a/packages/common/component/MetaModalItem.vue b/packages/common/component/MetaModalItem.vue index 9347f06e2..dda932328 100644 --- a/packages/common/component/MetaModalItem.vue +++ b/packages/common/component/MetaModalItem.vue @@ -114,8 +114,8 @@ export default { padding: 0 16px; margin: auto; border-radius: 4px; - border: 1px solid var(--ti-lowcode-tabs-border-color); - background-color: var(--ti-lowcode-toolbar-bg); + border: 1px solid var(--te-component-common-border-color); + background-color: var(--te-component-meta-modal-bg-color); box-shadow: rgb(0 0 0 / 30%) 0px 1px 15px 0px; .property-item-header { @@ -123,7 +123,7 @@ export default { justify-content: space-between; align-items: center; padding: 10px 0; - color: var(--ti-lowcode-toolbar-breadcrumb-color); + color: var(--te-component-common-text-color-secondary); .header-title { font-size: 14px; @@ -132,7 +132,7 @@ export default { .icon-wrap { width: 20px; height: 20px; - color: var(--ti-lowcode-text-color); + color: var(--te-component-common-icon-color); font-size: 16px; border-radius: 2px; cursor: pointer; @@ -141,8 +141,8 @@ export default { align-items: center; transition: 0.3s; &:hover { - color: var(--ti-lowcode-toolbar-icon-color); - background: var(--ti-lowcode-icon-hover-bg); + color: var(--te-component-common-icon-color-hover); + background: var(--te-component-common-bg-color-hover); } } } diff --git a/packages/common/component/MonacoEditor.vue b/packages/common/component/MonacoEditor.vue index 86fee58eb..610835a7a 100644 --- a/packages/common/component/MonacoEditor.vue +++ b/packages/common/component/MonacoEditor.vue @@ -6,16 +6,28 @@
-
+
- + - + - + @@ -29,6 +41,7 @@ language="javascript" @editorDidMount="$emit('editorDidMount', $event)" @shortcutSave="$emit('shortcutSave', $event)" + @change="$emit('change', $event)" >
@@ -40,6 +53,8 @@ import { computed, ref, onActivated, onDeactivated } from 'vue' import { Tooltip } from '@opentiny/vue' import PublicIcon from './PublicIcon.vue' import VueMonaco from './VueMonaco.vue' +import { constants } from '@opentiny/tiny-engine-utils' +const { OPEN_DELAY } = constants export default { components: { @@ -61,8 +76,8 @@ export default { default: true } }, - emits: ['editorDidMount', 'shortcutSave'], - setup(props) { + emits: ['editorDidMount', 'change', 'fullscreenChange', 'shortcutSave'], + setup(props, { emit }) { const editor = ref(null) const fullscreen = ref(false) const editorOptions = computed(() => { @@ -113,6 +128,7 @@ export default { const switchFullScreen = (value) => { fullscreen.value = value + emit('fullscreenChange', value) } return { @@ -123,7 +139,8 @@ export default { fullscreen, switchFullScreen, getValue, - formatCode + formatCode, + OPEN_DELAY } } } @@ -141,10 +158,10 @@ export default { top: var(--base-top-panel-height); bottom: 0; left: calc(var(--base-nav-panel-width) + var(--base-left-panel-width)); - right: var(--base-left-panel-width); + right: var(--base-right-panel-width); z-index: 100; padding: 10px 16px 16px 16px; - background-color: var(--ti-lowcode-common-component-bg); + background-color: var(--te-component-common-bg-color); height: auto !important; } @@ -157,15 +174,15 @@ export default { .buttons { display: flex; gap: 8px; - color: var(--ti-lowcode-component-svg-button-color); + color: var(--te-component-common-text-color-primary); cursor: pointer; } #icon-buttons { :deep(.svg-icon) { - color: var(--te-common-icon-secondary); + color: var(--te-component-common-text-color-secondary); } } - .fullscreen { + .monaco-btn-fullscreen { display: flex; margin-right: 20px; } @@ -179,7 +196,7 @@ export default { .editor { flex: 1; overflow: hidden; - border: 1px solid var(--ti-lowcode-state-management-monaco-editor-border-color); + border: 1px solid var(--te-component-common-border-color-hover); border-radius: 6px; } diff --git a/packages/common/component/MultiTypeSelector.vue b/packages/common/component/MultiTypeSelector.vue index 665abec7d..ce25f0c54 100644 --- a/packages/common/component/MultiTypeSelector.vue +++ b/packages/common/component/MultiTypeSelector.vue @@ -130,7 +130,7 @@ export default { align-items: center; } .tiny-radio { - color: var(--ti-lowcode-toolbar-icon-color); + color: var(--te-component-common-icon-color); } .tiny-radio-group { width: 100%; diff --git a/packages/common/component/PluginBlockItemImg.vue b/packages/common/component/PluginBlockItemImg.vue index dbd9d61ed..f6e37f260 100644 --- a/packages/common/component/PluginBlockItemImg.vue +++ b/packages/common/component/PluginBlockItemImg.vue @@ -66,7 +66,7 @@ const handleCheck = (v) => { width: 100%; flex: 1; border-radius: 4px; - background-color: var(--ti-lowcode-component-block-list-item-active-bg); + background-color: var(--te-component-block-bg-color); .top-left { display: flex; @@ -89,7 +89,7 @@ const handleCheck = (v) => { .item-default-img { width: 84px; height: 50px; - color: var(--te-common-bg-default); + color: var(--te-component-common-bg-color); } .block-item-small-list .item-image { diff --git a/packages/common/component/PluginBlockList.vue b/packages/common/component/PluginBlockList.vue index c1f34c5ee..0d980067d 100644 --- a/packages/common/component/PluginBlockList.vue +++ b/packages/common/component/PluginBlockList.vue @@ -53,14 +53,14 @@
@@ -72,14 +72,14 @@ >
@@ -205,7 +205,7 @@ export default { emits: ['click', 'iconClick', 'add', 'deleteBlock', 'openVersionPanel', 'editBlock', 'checkAll', 'cancelCheckAll'], setup(props, { emit }) { const panelState = inject('panelState', {}) - const blockUsers = inject('blockUsers') + const blockUsers = inject('blockUsers', []) const state = reactive({ activeIndex: -1, data: computed(() => props.data), @@ -356,17 +356,17 @@ export default { max-width: 500px; max-height: 136px; padding: 12px; - background: var(--ti-lowcode-component-block-list-shortcut-bg); + background: var(--te-component-common-bg-color); border-radius: 5px; - border: 1px solid var(--ti-lowcode-common-border-color-4); + border: 1px solid var(--te-component-common-border-color); top: v-bind('state.top'); .block-shortcut-title { - color: var(--ti-lowcode-component-block-list-shortcut-title-color); + color: var(--te-component-common-text-color-primary); font-weight: 600; margin-bottom: 8px; } .block-shortcut-description { - color: var(--ti-lowcode-component-block-list-item-color); + color: var(--te-component-common-text-color-secondary); margin-bottom: 20px; font-size: 12px; } @@ -384,8 +384,8 @@ export default { display: flex; align-items: center; height: 24px; - background-color: var(--te-common-bg-container); - color: var(--te-common-text-secondary); + background-color: var(--te-component-block-bg-color); + color: var(--te-component-common-text-color-secondary); position: sticky; top: 0; z-index: 100; @@ -404,7 +404,7 @@ export default { transform: translateY(-50%); width: 1px; height: 10px; - background-color: var(--te-common-border-default); + background-color: var(--te-component-common-border-color); } } @@ -437,7 +437,7 @@ export default { gap: 12px; overflow-y: auto; overflow-x: hidden; - color: var(--ti-lowcode-common-secondary-text-color); + color: var(--te-component-common-text-color-secondary); .block-item { display: flex; @@ -456,9 +456,9 @@ export default { top: 4px; text-align: center; display: block; - color: var(--te-common-text-primary); + color: var(--te-component-common-text-color-primary); font-size: 12px; - background-color: var(--te-common-bg-prompt); + background-color: var(--te-component-block-publish-flag-bg-color); padding: 2px 4px; border-radius: 2px; transform: scale(0.9); @@ -466,7 +466,7 @@ export default { } &.block-item-small-list { - color: var(--te-common-text-primary); + color: var(--te-component-common-text-color-primary); gap: 0; &:deep(.block-item-img) { width: 54px; @@ -486,17 +486,9 @@ export default { position: static; margin-left: 4px; z-index: 9; - .block-detail-icon { - color: var(--ti-lowcode-component-block-list-setting-btn-color); - display: block; - &:hover { - cursor: pointer; - color: var(--ti-lowcode-component-block-list-setting-btn-hover-color); - } - } } &:hover { - background-color: var(--te-common-bg-container); + background-color: var(--te-component-common-bg-color-hover); } } &:nth-child(even) { @@ -519,7 +511,7 @@ export default { } &.is-active { - background: var(--ti-lowcode-component-block-list-item-active-bg, --ti-lowcode-canvas-wrap-bg); + background: var(--te-component-common-bg-color-active); } &.is-disabled { @@ -549,7 +541,7 @@ export default { align-items: center; width: 100%; height: 86px; - border: 1px dashed var(--te-common-border-hover); + border: 1px dashed var(--te-component-common-border-color-hover); border-radius: 4px; } .item-text { @@ -557,23 +549,23 @@ export default { } .svg-icon { font-size: 24px; - color: var(--ti-lowcode-component-svg-button-color); + color: var(--te-component-common-text-color-primary); } &:hover { cursor: pointer; - color: var(--ti-lowcode-component-svg-button-hover-color); + color: var(--te-component-common-text-color-primary); } } .item-default-img { width: 84px; height: 50px; - color: var(--te-common-bg-default); + color: var(--te-component-common-bg-color); } .item-text { - color: var(--te-common-text-secondary); + color: var(--te-component-common-text-color-secondary); text-align: center; font-size: 12px; line-height: 1.5; @@ -599,32 +591,12 @@ export default { &.is-current-visible-icon { visibility: visible; } - - .block-detail-icon { - color: var(--ti-lowcode-base-gray-50); - &:hover { - cursor: pointer; - color: var(--ti-lowcode-component-block-list-setting-btn-hover-color); - } - } } .block-setting { right: 0px; top: 0; } } - .deploy { - position: absolute; - top: 10px; - left: 10px; - width: 114px; - color: var(--ti-lowcode-toolbar-icon-color); - font-weight: bold; - vertical-align: middle; - text-align: center; - margin: -10px -11px; - padding: 40px 10px; - } .loading { animation-duration: 5s; @@ -714,7 +686,7 @@ export default { line-height: 16px; } .item-description { - color: var(--ti-lowcode-toolbar-title-color); + color: var(--te-component-common-text-color-primary); font-size: 12px; } } @@ -733,7 +705,7 @@ export default { } .setting-menu { font-size: 12px; - color: var(--ti-lowcode-component-block-setting-item-text-color); + color: var(--te-component-common-text-color-primary); .list { display: flex; } @@ -741,32 +713,12 @@ export default { box-sizing: border-box; cursor: pointer; &:hover { - background-color: var(--ti-lowcode-component-block-setting-item-hover-bg); - color: var(--ti-lowcode-common-primary-text-color); + color: var(--te-component-common-text-color-primary); } .list-item-icon { font-size: 14px; - color: var(--te-common-icon-secondary); - } - .list-item-svg { - color: var(--te-common-icon-secondary); + color: var(--te-component-common-icon-color); } - .list-item-svg:hover { - background-color: var(--ti-lowcode-component-block-setting-item-hover-bg); - } - } -} - - - diff --git a/packages/common/component/PluginPanel.vue b/packages/common/component/PluginPanel.vue index cf0fb240f..35da8bfbf 100644 --- a/packages/common/component/PluginPanel.vue +++ b/packages/common/component/PluginPanel.vue @@ -73,7 +73,7 @@ export default { .plugin-panel { width: 100%; height: 100%; - background: var(--ti-lowcode-plugin-panel-bg, --ti-lowcode-toolbar-bg); + background: var(--te-component-common-bg-color); display: flex; flex-direction: column; position: relative; @@ -83,12 +83,11 @@ export default { justify-content: space-between; align-items: center; font-size: 12px; - font-weight: var(--ti-lowcode-plugin-panel-title-font-weight); font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; padding: 12px; - color: var(--ti-lowcode-plugin-panel-title-color); - font-weight: var(--ti-lowcode-plugin-panel-title-font-weight); + color: var(--te-component-common-text-color-primary); + font-weight: var(--te-base-font-weight-7); .plugin-panel-title { display: flex; align-items: center; @@ -108,7 +107,10 @@ export default { align-items: center; :deep(.svg-button + .svg-button) { - margin: 0; + margin-left: 4px; + } + :deep(.svg-button + .icon-wrap) { + margin-left: 4px; } } } diff --git a/packages/common/component/PluginSetting.vue b/packages/common/component/PluginSetting.vue index b822f87b1..b225c2e48 100644 --- a/packages/common/component/PluginSetting.vue +++ b/packages/common/component/PluginSetting.vue @@ -9,16 +9,17 @@
-
- - - {{ getFullScreenLabel(state.isFullScreen) }} -
- 保存 - - {{ iconButtonText }} - - + + 保存 + + {{ iconButtonText }} + +
+ + +
+ +
@@ -32,7 +33,9 @@ diff --git a/packages/common/component/toolbar-built-in/ToolbarBaseIcon.vue b/packages/common/component/toolbar-built-in/ToolbarBaseIcon.vue index b763a5059..1d7edef7e 100644 --- a/packages/common/component/toolbar-built-in/ToolbarBaseIcon.vue +++ b/packages/common/component/toolbar-built-in/ToolbarBaseIcon.vue @@ -8,7 +8,7 @@ > - + diff --git a/packages/configurator/src/related-editor-configurator/RelatedEditorConfigurator.vue b/packages/configurator/src/related-editor-configurator/RelatedEditorConfigurator.vue index 2addbb3c4..c0c407567 100644 --- a/packages/configurator/src/related-editor-configurator/RelatedEditorConfigurator.vue +++ b/packages/configurator/src/related-editor-configurator/RelatedEditorConfigurator.vue @@ -130,7 +130,7 @@ export default { justify-content: space-between; } .meta-binding-state { - background: var(--ti-lowcode-icon-bind-color); + background: var(--te-configurator-common-text-color-checked); padding: 0 4px; overflow: hidden; text-overflow: ellipsis; diff --git a/packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue b/packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue new file mode 100644 index 000000000..cabe9a936 --- /dev/null +++ b/packages/configurator/src/router-select-configurator/RouterSelectConfigurator.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue b/packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue index f8ad2fd8a..bd9bcd257 100644 --- a/packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue +++ b/packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue @@ -107,15 +107,15 @@ export default { padding-right: 20px; width: 136px; cursor: pointer; - background: var(--te-common-bg-prompt); - color: var(--te-common-text-secondary); - border: 1px solid var(--ti-lowcode-tabs-active-bg); + background: var(--te-configurator-select-icon-bg-color); + color: var(--te-configurator-common-text-color-secondary); + border: 1px solid var(--te-configurator-common-border-color-divider); border-radius: 3px; .icon-box { - border-right: 1px solid var(--ti-lowcode-tabs-active-bg); + border-right: 1px solid var(--te-configurator-common-border-color-divider); padding: 4px 8px; .tiny-svg { - color: var(--te-common-text-secondary); + color: var(--te-configurator-common-text-color-secondary); font-size: 14px; } } @@ -161,13 +161,13 @@ export default { li { width: 40px; - color: var(--ti-lowcode-icon-popover-color); + color: var(--te-configurator-common-text-color-secondary); cursor: pointer; text-align: center; .tiny-svg { font-size: 24px; &:hover { - color: var(--ti-lowcode-icon-popover-hover-color); + color: var(--te-configurator-common-text-color-primary); } } } diff --git a/packages/configurator/src/slider-configurator/SliderConfigurator.vue b/packages/configurator/src/slider-configurator/SliderConfigurator.vue index 269355087..295d882d3 100644 --- a/packages/configurator/src/slider-configurator/SliderConfigurator.vue +++ b/packages/configurator/src/slider-configurator/SliderConfigurator.vue @@ -95,7 +95,7 @@ export default { height: 3px; width: 100%; border-radius: 2px; - background-color: var(--te-common-bg-container); + background-color: var(--te-configurator-slider-bg-color); .tiny-slider__handle { width: 10px; height: 10px; @@ -103,26 +103,26 @@ export default { border-radius: 50%; border: none; cursor: ew-resize; - background-color: var(--te-common-text-secondary); + background-color: var(--te-configurator-common-text-color-secondary); box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 1px, rgba(0, 0, 0, 0.3) 0px 0px 0px 0.5px; } .tiny-slider__range { height: 3px; border-radius: 3px; margin-top: 0; - background: var(--te-common-bg-container); + background: var(--te-configurator-slider-bg-color); } .tiny-slider__tips { - color: var(--ti-lowcode-breadcrumb-color); - background: var(--ti-lowcode-breadcrumb-bg); + color: var(--te-configurator-common-text-color-weaken); + background: var(--te-configurator-common-bg-color); padding: 4px 6px; border-radius: 2px; box-shadow: rgb(0 0 0 / 15%) 0px 5px 10px; margin-top: -8px; &::before, &::after { - border-color: var(--ti-lowcode-breadcrumb-bg) transparent; + border-color: var(--te-configurator-common-bg-color) transparent; } } } @@ -133,7 +133,7 @@ export default { padding: 0; cursor: pointer; border: 0; - background-color: var(--te-common-border-bg-divider); + background-color: var(--te-configurator-slider-border-bg-color-divider); position: relative; outline: 0; -webkit-appearance: none; @@ -146,8 +146,8 @@ export default { height: 10px; border-radius: 50%; border: 0; - background-color: var(--te-common-bg-default); - box-shadow: 0 0 2px 0 var(--te-common-border-default); + background-color: var(--te-configurator-common-bg-color); + box-shadow: 0 0 2px 0 var(--te-configurator-common-border-color); -webkit-transition: border-color 0.15s, background-color 0.15s; transition: border-color 0.15s, background-color 0.15s; cursor: pointer; @@ -159,7 +159,7 @@ export default { } input[type='range']::-webkit-slider-thumb:active { border: 0; - background-color: var(--te-common-bg-default); + background-color: var(--te-configurator-common-bg-color); } } diff --git a/packages/configurator/src/slot-configurator/SlotConfigurator.vue b/packages/configurator/src/slot-configurator/SlotConfigurator.vue index 057b225f1..367f8c235 100644 --- a/packages/configurator/src/slot-configurator/SlotConfigurator.vue +++ b/packages/configurator/src/slot-configurator/SlotConfigurator.vue @@ -94,7 +94,6 @@ export default { useModal().confirm({ title: '提示', message: '关闭后插槽内的内容将被清空,是否继续?', - status: 'info', exec: () => { slotList.value[i].bind = !slotList.value[i].bind @@ -141,7 +140,7 @@ export default { } .slot-name { width: 30%; - color: var(--te-common-text-primary); + color: var(--te-configurator-common-text-color-primary); font-size: 12px; display: flex; justify-content: space-between; @@ -177,7 +176,7 @@ export default { outline: 0; border-radius: 10px; box-sizing: border-box; - background-color: var(--te-common-bg-switch); + background-color: var(--te-configurator-common-switch-bg-color); transition: border-color 0.3s, background-color 0.3s; vertical-align: middle; } @@ -191,11 +190,11 @@ export default { transition: all 0.3s; width: 16px; height: 16px; - background-color: var(--te-common-bg-default); + background-color: var(--te-configurator-common-bg-color); } .e__switch.e_is-checked .e__switch-core { - background-color: var(--te-common-bg-primary-checked); + background-color: var(--te-configurator-common-switch-bg-color-checked); } .e__switch.e_is-checked .e__switch-core::after { diff --git a/packages/configurator/src/styles/vars.less b/packages/configurator/src/styles/vars.less new file mode 100644 index 000000000..3e172e8d6 --- /dev/null +++ b/packages/configurator/src/styles/vars.less @@ -0,0 +1,43 @@ +:root { + --te-configurator-common-text-color-primary: var(--te-common-text-primary); + --te-configurator-common-text-color-secondary: var(--te-common-text-secondary); + --te-configurator-common-text-color-weaken: var(--te-common-text-weaken); + --te-configurator-common-text-color-disabled: var(--te-common-text-disabled); + --te-configurator-common-text-color-checked: var(--te-common-text-checked); + --te-configurator-common-text-color-emphasize: var(--te-common-text-emphasize); + + --te-configurator-common-icon-color-primary: var(--te-common-icon-primary); + --te-configurator-common-icon-color: var(--te-common-icon-secondary); + --te-configurator-common-icon-color-hover: var(--te-common-icon-hover); + + --te-configurator-common-bg-color: var(--te-common-bg-default); + --te-configurator-common-bg-color-active: var(--te-common-bg-container); + --te-configurator-common-bg-color-hover: var(--te-common-bg-container); + --te-configurator-common-bg-color-disabled: var(--te-common-bg-disabled); + --te-configurator-common-bg-color-transparent: var(--te-base-color-transparent); + --te-configurator-common-switch-bg-color: var(--te-common-bg-switch); + --te-configurator-common-switch-bg-color-checked: var(--te-common-bg-primary-checked); + + --te-configurator-common-border-color-divider: var(--te-common-border-divider); + --te-configurator-common-border-color: var(--te-common-border-default); + + --te-configurator-button-group-bg-color-active: var(--te-common-bg-prompt); + --te-configurator-button-group-bg-color: var(--te-common-bg-container); + + --te-configurator-html-attributes-bg-color: var(--te-common-bg-container); + + --te-configurator-layout-grid-bg-color: var(--te-common-bg-container); + + --te-configurator-number-bg-color: var(--te-common-bg-container); + + --te-configurator-select-icon-bg-color: var(--te-common-bg-prompt); + + --te-configurator-slider-bg-color: var(--te-common-bg-prompt); + --te-configurator-slider-border-bg-color-divider: var(--te-common-border-bg-divider); + + --te-configurator-tabs-group-bg-color-hover: var(--te-common-bg-prompt); + --te-configurator-tabs-group-bg-color-active: var(--te-common-bg-prompt); + --te-configurator-tabs-group-bg-color: var(--te-common-bg-container); + + --te-configurator-code-list-bg-color: var(--te-common-bg-container-weaken); +} diff --git a/packages/configurator/src/tabs-group-configurator/TabsGroupConfigurator.vue b/packages/configurator/src/tabs-group-configurator/TabsGroupConfigurator.vue index 952331936..a2f9f6a9f 100644 --- a/packages/configurator/src/tabs-group-configurator/TabsGroupConfigurator.vue +++ b/packages/configurator/src/tabs-group-configurator/TabsGroupConfigurator.vue @@ -78,8 +78,8 @@ const props = defineProps({ }, // tabItem宽度 labelWidth: { - type: Number, - default: 63 + type: [Number, String], + default: '63' }, // tab的选项,如果选项中包含collapsed,则会折叠为下拉 options: { @@ -156,7 +156,7 @@ const change = (item) => { .tabs-wrap { display: flex; justify-content: space-between; - background-color: var(--te-common-bg-container); + background-color: var(--te-configurator-tabs-group-bg-color); border-radius: 4px; .tiny-button-group { display: flex; @@ -172,19 +172,25 @@ const change = (item) => { border: none; line-height: 14px; min-width: 20px; - background-color: var(--te-common-bg-container); - color: var(--te-common-text-weaken); + background-color: var(--te-configurator-tabs-group-bg-color); + color: var(--te-configurator-common-text-color-weaken); &:hover { - background-color: var(--ti-lowcode-base-gray-101); - color: var(--te-common-text-primary); + background-color: var(--te-configurator-tabs-group-bg-color-hover); + color: var(--te-configurator-common-text-color-secondary); border-radius: 4px; + .svg-icon { + color: var(--te-configurator-common-icon-color-primary); + } } &.selected { - background-color: var(--ti-lowcode-base-gray-101); - color: var(--te-common-text-primary); + background-color: var(--te-configurator-tabs-group-bg-color-active); + color: var(--te-configurator-common-text-color-secondary); border-radius: 4px; + .svg-icon { + color: var(--te-configurator-common-icon-color-primary); + } } } .tab-item { @@ -206,21 +212,22 @@ const change = (item) => { justify-content: center; align-items: center; height: 24px; - color: var(--te-common-text-weaken); + color: var(--te-configurator-common-text-color-weaken); &:hover { - background-color: var(--te-common-bg-prompt); + background-color: var(--te-configurator-tabs-group-bg-color-hover); border-radius: 4px; - color: var(--te-common-text-primary); + color: var(--te-configurator-common-text-color-primary); } &.selected { - background-color: var(--te-common-bg-prompt); - color: var(--te-common-text-primary); + background-color: var(--te-configurator-tabs-group-bg-color-active); + color: var(--te-configurator-common-text-color-primary); border-radius: 4px; } .tiny-dropdown__title { margin: 0; line-height: 12px; + font-size: var(--te-base-font-size-base); .selected-option { text-align: center; } @@ -229,9 +236,12 @@ const change = (item) => { width: 20px; display: flex; justify-content: center; + .tiny-svg { + fill: var(--te-configurator-common-icon-color); + } } .tiny-dropdown__trigger:hover { - color: var(--te-common-text-primary); + color: var(--te-configurator-common-text-color-primary); } } } @@ -244,29 +254,33 @@ const change = (item) => { padding: 8px 0px; margin-left: 20px; border-radius: 4px; - background-color: var(--te-common-bg-default); - color: var(--te-common-text-weaken); + background-color: var(--te-configurator-common-bg-color); + color: var(--te-configurator-common-text-color-weaken); z-index: 9999; - box-shadow: 0 0 10px 0 var(--te-common-border-default); + box-shadow: 0 0 10px 0 var(--te-configurator-common-border-color); :deep(.focusing) { - background-color: var(--te-common-bg-default); + background-color: var(--te-configurator-common-bg-color); } - :deep(.tiny-dropdown-item__wrap) { - padding: 4px 12px; - background-color: var(--te-common-bg-default); + :deep(.tiny-dropdown-item) { + color: var(--te-configurator-common-text-color-weaken); + background-color: var(--te-configurator-common-bg-color); &:hover, &:active { - background-color: var(--te-common-bg-container); - color: var(--te-common-text-primary); + background-color: var(--te-configurator-common-bg-color-hover); + color: var(--te-configurator-common-text-color-primary); } } + + :deep(.tiny-dropdown-item__wrap) { + padding: 4px 12px; + } } .border-right { display: inline-block; height: 12px; - border-right: 1px solid var(--te-common-border-default); + border-right: 1px solid var(--te-configurator-common-border-color); } diff --git a/packages/configurator/src/variable-configurator/VariableConfigurator.vue b/packages/configurator/src/variable-configurator/VariableConfigurator.vue index 5bba722d7..43860532d 100644 --- a/packages/configurator/src/variable-configurator/VariableConfigurator.vue +++ b/packages/configurator/src/variable-configurator/VariableConfigurator.vue @@ -21,6 +21,7 @@ type="info" description="你可以通过点击左侧区域变量列表绑定变量或处理函数,也可以在右边输入模式输入复杂的表达式。" class="header-alert" + :closable="false" >
@@ -74,6 +75,7 @@ 定时更新: @@ -85,7 +87,7 @@
-

用法

+ 用法

你可以通过点击左侧区域绑定变量或处理函数,或者点击右边的铅笔按钮切换到输入模式,输入复杂的表达式。 @@ -554,7 +556,6 @@ export default { .header-alert { margin-top: 0; margin-bottom: 12px; - color: var(--ti-lowcode-meta-bind-variable-header-alert-color); } .bind-dialog-content { display: flex; @@ -565,11 +566,11 @@ export default { width: 38%; .content-left__title { - color: var(--ti-lowcode-meta-bind-variable-content-left-title-color); + color: var(--te-configurator-common-text-color-primary); } .list-wrap { - border: 1px solid var(--ti-lowcode-meta-bind-variable-list-wrap-border-color); + border: 1px solid var(--te-configurator-common-border-color-divider); border-radius: 4px; height: 300px; margin-top: 8px; @@ -578,8 +579,8 @@ export default { .content-left__list { width: 120px; - color: var(--ti-lowcode-meta-bind-variable-content-left-list-color); - border-right: 1px solid var(--ti-lowcode-meta-bind-variable-content-left-list-border-right-color); + color: var(--te-configurator-common-text-color-secondary); + border-right: 1px solid var(--te-configurator-common-border-color-divider); } .content-left__list-item { @@ -588,21 +589,23 @@ export default { transition: background 0.3s; &.active, &:hover { - background: var(--ti-lowcode-meta-bind-variable-list-item-hover-bg-color); + background: var(--te-configurator-common-bg-color-hover); + color: var(--te-configurator-common-text-color-primary); } } .item-selected { - background-color: var(--ti-lowcode-meta-bind-variable-item-selected-bg-color); + background-color: var(--te-configurator-common-bg-color-active); } .item-text { padding: 8px 12px; cursor: pointer; - color: var(--ti-lowcode-meta-bind-variable-item-text-color); + color: var(--te-configurator-common-text-color-secondary); &:hover { - background-color: var(--ti-lowcode-meta-bind-variable-item-hover-bg-color); + background-color: var(--te-configurator-common-bg-color-hover); + color: var(--te-configurator-common-text-color-primary); } } @@ -635,7 +638,7 @@ export default { } .content-right__title { - color: var(--ti-lowcode-meta-bind-variable-content-right-title-color); + color: var(--te-configurator-common-text-color-primary); font-weight: 600; margin-right: 5px; } @@ -658,8 +661,8 @@ export default { height: 54%; border-radius: 4px; padding: 12px 8px; - color: var(--ti-lowcode-meta-bind-variable-top-color); - border: 1px solid var(--ti-lowcode-meta-bind-variable-top-border-color); + color: var(--te-configurator-common-text-color-primary); + border: 1px solid var(--te-configurator-common-border-color-divider); box-sizing: border-box; & > div { height: 100%; @@ -695,11 +698,15 @@ export default { border-radius: 4px; box-sizing: border-box; overflow: auto; - color: var(--ti-lowcode-meta-bind-variable-bottom-color); - border: 1px solid var(--ti-lowcode-meta-bind-variable-bottom-border-color); + color: var(--te-configurator-common-text-color-secondary); + border: 1px solid var(--te-configurator-common-border-color-divider); pre { font-family: consolas; } + .bottom-title { + font-weight: var(--te-base-font-weight-6); + color: var(--te-configurator-common-text-color-primary); + } } } } @@ -709,6 +716,7 @@ export default { display: flex; justify-content: space-between; align-items: center; + width: 100%; } } diff --git a/packages/design-core/assets/add-folder.svg b/packages/design-core/assets/add-folder.svg index 87a99124f..b42f93b83 100644 --- a/packages/design-core/assets/add-folder.svg +++ b/packages/design-core/assets/add-folder.svg @@ -1,9 +1,16 @@ - - - - - - - - + + + + + diff --git a/packages/design-core/assets/background-color.svg b/packages/design-core/assets/background-color.svg index 5a5b78857..93473265e 100644 --- a/packages/design-core/assets/background-color.svg +++ b/packages/design-core/assets/background-color.svg @@ -1 +1,15 @@ - \ No newline at end of file + + + + + + + diff --git a/packages/design-core/assets/block-add-prop.svg b/packages/design-core/assets/block-add-prop.svg index a5915a9d4..82bf61e37 100644 --- a/packages/design-core/assets/block-add-prop.svg +++ b/packages/design-core/assets/block-add-prop.svg @@ -4,7 +4,7 @@ viewBox="0 0 132 132" style="enable-background:new 0 0 132 132;" xml:space="preserve"> diff --git a/packages/design-core/assets/block-bind-prop.svg b/packages/design-core/assets/block-bind-prop.svg index c0556885d..e36a0e97e 100644 --- a/packages/design-core/assets/block-bind-prop.svg +++ b/packages/design-core/assets/block-bind-prop.svg @@ -4,7 +4,7 @@ viewBox="0 0 132 132" style="enable-background:new 0 0 132 132;" xml:space="preserve"> diff --git a/packages/design-core/assets/border-radius-bottomleft.svg b/packages/design-core/assets/border-radius-bottomleft.svg index de932551b..0e4d5a40a 100644 --- a/packages/design-core/assets/border-radius-bottomleft.svg +++ b/packages/design-core/assets/border-radius-bottomleft.svg @@ -4,7 +4,7 @@ .st0{fill:none;} .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#C2C2C2;} - .st2{fill-rule:evenodd;clip-rule:evenodd;fill:#191919;} + .st2{fill-rule:evenodd;clip-rule:evenodd;fill:currentColor;} .st0{fill:none;} .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#C2C2C2;} - .st2{fill-rule:evenodd;clip-rule:evenodd;fill:#191919;} + .st2{fill-rule:evenodd;clip-rule:evenodd;fill:currentColor;} .st0{fill:none;} .st1{fill-rule:evenodd;clip-rule:evenodd;fill:#C2C2C2;} - .st2{fill-rule:evenodd;clip-rule:evenodd;fill:#191919;} + .st2{fill-rule:evenodd;clip-rule:evenodd;fill:currentColor;} + viewBox="0 0 132 132" style="enable-background:new 0 0 132 132;" xml:space="preserve"> - - - - - - - - +Created with Pixso. + diff --git a/packages/design-core/assets/collapse_all.svg b/packages/design-core/assets/collapse_all.svg new file mode 100644 index 000000000..2c692a223 --- /dev/null +++ b/packages/design-core/assets/collapse_all.svg @@ -0,0 +1,17 @@ + + + + + + + diff --git a/packages/design-core/assets/dark.svg b/packages/design-core/assets/dark.svg new file mode 100644 index 000000000..aa1201e82 --- /dev/null +++ b/packages/design-core/assets/dark.svg @@ -0,0 +1,13 @@ + + + + +Created with Pixso. + + diff --git a/packages/design-core/assets/en.svg b/packages/design-core/assets/en.svg index 0b6f6da30..017ee0d3a 100644 --- a/packages/design-core/assets/en.svg +++ b/packages/design-core/assets/en.svg @@ -1,28 +1,11 @@ - - - - - - - - - - - - - \ No newline at end of file + + + +Created with Pixso. + + diff --git a/packages/design-core/assets/expand_all.svg b/packages/design-core/assets/expand_all.svg new file mode 100644 index 000000000..deb75e7dd --- /dev/null +++ b/packages/design-core/assets/expand_all.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/design-core/assets/global-setting.svg b/packages/design-core/assets/global-setting.svg new file mode 100644 index 000000000..fdac99a7f --- /dev/null +++ b/packages/design-core/assets/global-setting.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/packages/design-core/assets/jump.svg b/packages/design-core/assets/jump.svg new file mode 100644 index 000000000..bff507ab1 --- /dev/null +++ b/packages/design-core/assets/jump.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/packages/design-core/assets/light.svg b/packages/design-core/assets/light.svg new file mode 100644 index 000000000..1f2d3b940 --- /dev/null +++ b/packages/design-core/assets/light.svg @@ -0,0 +1,20 @@ + + + + +Created with Pixso. + + diff --git a/packages/design-core/assets/navigation.svg b/packages/design-core/assets/navigation.svg new file mode 100644 index 000000000..ddb655c3f --- /dev/null +++ b/packages/design-core/assets/navigation.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/design-core/assets/navigationv.svg b/packages/design-core/assets/navigationv.svg new file mode 100644 index 000000000..c5cf7a3f8 --- /dev/null +++ b/packages/design-core/assets/navigationv.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/packages/design-core/assets/nested-page.svg b/packages/design-core/assets/nested-page.svg new file mode 100644 index 000000000..7997cc968 --- /dev/null +++ b/packages/design-core/assets/nested-page.svg @@ -0,0 +1,15 @@ + + + + +Created with Pixso. + + diff --git a/packages/design-core/assets/routerlink.svg b/packages/design-core/assets/routerlink.svg new file mode 100644 index 000000000..ab4cde8ba --- /dev/null +++ b/packages/design-core/assets/routerlink.svg @@ -0,0 +1,25 @@ + + + + + + + + +Created with Pixso. +Created with Pixso. + + + + + + + + + \ No newline at end of file diff --git a/packages/design-core/assets/routerview.svg b/packages/design-core/assets/routerview.svg new file mode 100644 index 000000000..aa830c9dd --- /dev/null +++ b/packages/design-core/assets/routerview.svg @@ -0,0 +1,41 @@ + + + + + + + + +Created with Pixso. +Created with Pixso. + + + + + + + + + + + \ No newline at end of file diff --git a/packages/design-core/assets/single-page.svg b/packages/design-core/assets/single-page.svg new file mode 100644 index 000000000..09af2ec5b --- /dev/null +++ b/packages/design-core/assets/single-page.svg @@ -0,0 +1,15 @@ + + + + +Created with Pixso. + + diff --git a/packages/design-core/index.js b/packages/design-core/index.js index 2be107bc1..0acacb590 100644 --- a/packages/design-core/index.js +++ b/packages/design-core/index.js @@ -4,12 +4,14 @@ export { init } from './src/init' export { default as Breadcrumb, BreadcrumbService } from '@opentiny/tiny-engine-toolbar-breadcrumb' export { default as Fullscreen } from '@opentiny/tiny-engine-toolbar-fullscreen' export { default as Lang } from '@opentiny/tiny-engine-toolbar-lang' +export { default as ViewSetting } from '@opentiny/tiny-engine-toolbar-view-setting' export { default as Logo } from '@opentiny/tiny-engine-toolbar-logo' export { default as Lock } from '@opentiny/tiny-engine-toolbar-lock' export { default as Media } from '@opentiny/tiny-engine-toolbar-media' export { default as Redoundo, HistoryService } from '@opentiny/tiny-engine-toolbar-redoundo' export { default as Save } from '@opentiny/tiny-engine-toolbar-save' export { default as Clean } from '@opentiny/tiny-engine-toolbar-clean' +export { default as ThemeSwitch, ThemeSwitchService } from '@opentiny/tiny-engine-toolbar-theme-switch' export { default as Preview } from '@opentiny/tiny-engine-toolbar-preview' export { default as GenerateCode, SaveLocalService } from '@opentiny/tiny-engine-toolbar-generate-code' export { default as Refresh } from '@opentiny/tiny-engine-toolbar-refresh' diff --git a/packages/design-core/package.json b/packages/design-core/package.json index c299eaa6c..c6b8ffca4 100644 --- a/packages/design-core/package.json +++ b/packages/design-core/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine", - "version": "2.0.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", @@ -68,10 +68,9 @@ "@opentiny/tiny-engine-settings-panel": "workspace:*", "@opentiny/tiny-engine-svgs": "workspace:*", "@opentiny/tiny-engine-theme-base": "workspace:*", - "@opentiny/tiny-engine-theme-dark": "workspace:*", - "@opentiny/tiny-engine-theme-light": "workspace:*", "@opentiny/tiny-engine-toolbar-breadcrumb": "workspace:*", "@opentiny/tiny-engine-toolbar-clean": "workspace:*", + "@opentiny/tiny-engine-toolbar-theme-switch": "workspace:*", "@opentiny/tiny-engine-toolbar-collaboration": "workspace:*", "@opentiny/tiny-engine-toolbar-fullscreen": "workspace:*", "@opentiny/tiny-engine-toolbar-generate-code": "workspace:*", @@ -86,6 +85,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:*", @@ -96,7 +96,7 @@ "eslint-linter-browserify": "8.57.0", "file-saver": "^2.0.5", "html2canvas": "^1.4.1", - "monaco-editor": "0.33.0", + "monaco-editor": "0.51.0", "prettier": "2.7.1", "sortablejs": "^1.14.0", "vue-i18n": "^9.9.0" @@ -119,12 +119,13 @@ "vite": "^5.4.2" }, "peerDependencies": { - "@opentiny/vue": "^3.14.0", - "@opentiny/vue-design-smb": "^3.14.0", - "@opentiny/vue-icon": "^3.14.0", - "@opentiny/vue-locale": "^3.14.0", - "@opentiny/vue-renderless": "^3.14.0", - "@opentiny/vue-theme": "^3.14.0", + "@opentiny/vue": "^3.20.0", + "@opentiny/vue-design-smb": "^3.20.0", + "@opentiny/vue-icon": "^3.20.0", + "@opentiny/vue-locale": "^3.20.0", + "@opentiny/vue-renderless": "^3.20.0", + "@opentiny/vue-runtime": "^3.20.0", + "@opentiny/vue-theme": "^3.20.0", "vue": "^3.4.23" }, "browserslist": [ diff --git a/packages/design-core/src/init.js b/packages/design-core/src/init.js index b8012c01f..6dbdf703e 100644 --- a/packages/design-core/src/init.js +++ b/packages/design-core/src/init.js @@ -21,6 +21,8 @@ import { defineEntry, mergeRegistry, getMergeMeta, + getMetaApi, + META_SERVICE, initServices, initHook, HOOK_NAME, @@ -37,6 +39,7 @@ const defaultLifeCycles = { beforeAppCreate: ({ registry }) => { // 合并用户自定义注册表 const newRegistry = mergeRegistry(registry, defaultRegistry) + const appId = getMetaApi(META_SERVICE.GlobalService).getBaseInfo().id if (process.env.NODE_ENV === 'development') { console.log('default registry:', defaultRegistry) // eslint-disable-line console.log('merged registry:', registry) // eslint-disable-line @@ -55,7 +58,7 @@ const defaultLifeCycles = { // 加载主题样式,尽早加载 // import(`./theme/${newRegistry.config.theme}.js`) - const theme = newRegistry.config.theme || 'light' + const theme = localStorage.getItem(`tiny-engine-theme-${appId}`) || newRegistry.config.theme || 'light' // eslint-disable-next-line no-new new TinyThemeTool(defaultThemeList[theme], defaultThemeList[theme]?.id) document.documentElement?.setAttribute?.('data-theme', theme) @@ -72,8 +75,10 @@ const defaultLifeCycles = { window.lowcodeI18n = i18n app.use(i18n).use(injectGlobalComponents) - const theme = getMergeMeta('engine.config').theme?.includes('dark') ? 'vs-dark' : 'vs' - setGlobalMonacoEditorTheme(theme) + const appId = getMetaApi(META_SERVICE.GlobalService).getBaseInfo().id + const theme = localStorage.getItem(`tiny-engine-theme-${appId}`) || getMergeMeta('engine.config').theme + const editorTheme = theme?.includes('dark') ? 'vs-dark' : 'vs' + setGlobalMonacoEditorTheme(editorTheme) } } diff --git a/packages/design-core/src/preview/src/Toolbar.vue b/packages/design-core/src/preview/src/Toolbar.vue index 24cc1f015..3c5c7c105 100644 --- a/packages/design-core/src/preview/src/Toolbar.vue +++ b/packages/design-core/src/preview/src/Toolbar.vue @@ -69,10 +69,10 @@ export default { width: 100%; height: var(--base-top-panel-height); text-align: center; - background-color: var(--ti-lowcode-common-layout-bg); + background-color: var(--te-preview-common-bg-color); position: relative; z-index: 1001; - border-bottom: 1px solid var(--ti-lowcode-toolbar-border-bottom-color); + border-bottom: 1px solid var(--te-preview-common-border-color); } .toolbar-left, .toolbar-right { @@ -81,7 +81,7 @@ export default { gap: 12px; } .toolbar-button-text { - color: var(--ti-lowcode-toolbar-title-color); + color: var(--te-preview-common-text-color); margin-left: 4px; font-size: 12px; } diff --git a/packages/design-core/src/preview/src/constant/index.js b/packages/design-core/src/preview/src/constant/index.js index 6debf4243..670f7d897 100644 --- a/packages/design-core/src/preview/src/constant/index.js +++ b/packages/design-core/src/preview/src/constant/index.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ const PanelType = { VUE: 'vue' diff --git a/packages/design-core/src/preview/src/main.js b/packages/design-core/src/preview/src/main.js index da28cc9b4..8b0834806 100644 --- a/packages/design-core/src/preview/src/main.js +++ b/packages/design-core/src/preview/src/main.js @@ -13,6 +13,7 @@ import { createApp } from 'vue' import initSvgs from '@opentiny/tiny-engine-svgs' import { defineEntry, mergeRegistry, initServices } from '@opentiny/tiny-engine-meta-register' +import './styles/vars.less' import defaultRegistry from '../../../registry.js' import App from './App.vue' diff --git a/packages/design-core/src/preview/src/preview/Preview.vue b/packages/design-core/src/preview/src/preview/Preview.vue index e0e3af245..1f13a70f2 100644 --- a/packages/design-core/src/preview/src/preview/Preview.vue +++ b/packages/design-core/src/preview/src/preview/Preview.vue @@ -43,6 +43,8 @@ export default { const debugSwitch = injectDebugSwitch() const editorComponent = computed(() => (debugSwitch?.value ? Monaco : EmptyEditor)) const store = new ReplStore() + const { getAllNestedBlocksSchema, generatePageCode } = getMetaApi('engine.service.generateCode') + const ROOT_ID = '0' const sfcOptions = { script: { @@ -59,18 +61,9 @@ export default { store['initTsConfig']() // 触发获取组件d.ts方便调试 } - const addUtilsImportMap = (importMap, utils = []) => { - const utilsImportMaps = {} - utils.forEach(({ type, content: { package: packageName, cdnLink } }) => { - if (type === 'npm' && cdnLink) { - utilsImportMaps[packageName] = cdnLink - } - }) - const newImportMap = { imports: { ...importMap.imports, ...utilsImportMaps } } - store.setImportMap(newImportMap) - } - const queryParams = getSearchParams() + document.documentElement?.setAttribute?.('data-theme', queryParams.theme || 'light') + const getImportMap = async () => { if (import.meta.env.VITE_LOCAL_BUNDLE_DEPS === 'true') { const mapJSON = await fetchImportMap() @@ -84,6 +77,47 @@ export default { return getInitImportMap() } + const getFamilyPages = (appData) => { + const familyPages = [] + const ancestors = queryParams.ancestors + + if (!ancestors?.length || !appData?.componentsMap) { + return familyPages + } + + for (let i = 0; i < ancestors.length; i++) { + const nextPage = i < ancestors.length - 1 ? ancestors[i + 1].name : null + const panelValueAndType = { + panelValue: + generatePageCode( + ancestors[i].page_content, + appData?.componentsMap || [], + { + blockRelativePath: './' + }, + nextPage + ) || '', + panelType: 'vue' + } + + if (ancestors[i]?.parentId === ROOT_ID) { + familyPages.push({ + ...panelValueAndType, + panelName: 'Main.vue', + index: true + }) + } else { + familyPages.push({ + ...panelValueAndType, + panelName: `${ancestors[i].name}.vue`, + index: false + }) + } + } + + return familyPages + } + const promiseList = [ fetchAppSchema(queryParams?.app), fetchMetaData(queryParams), @@ -91,24 +125,14 @@ export default { getImportMap() ] Promise.all(promiseList).then(async ([appData, metaData, _void, importMapData]) => { - addUtilsImportMap(importMapData, metaData.utils || []) - - const { getAllNestedBlocksSchema, generatePageCode } = getMetaApi('engine.service.generateCode') + store.setImportMap(importMapData) const blocks = await getAllNestedBlocksSchema(queryParams.pageInfo?.schema, fetchBlockSchema) // TODO: 需要验证级联生成 block schema // TODO: 物料内置 block 需要如何处理? const pageCode = [ - { - panelName: 'Main.vue', - panelValue: - generatePageCode(queryParams.pageInfo?.schema, appData?.componentsMap || [], { - blockRelativePath: './' - }) || '', - panelType: 'vue', - index: true - }, + ...getFamilyPages(appData), ...(blocks || []).map((blockSchema) => { return { panelName: `${blockSchema.fileName}.vue`, @@ -170,7 +194,6 @@ export default { Object.assign(newFiles, metaFiles) setFiles(newFiles) - return PreviewTips.READY_FOR_PREVIEW }) diff --git a/packages/design-core/src/preview/src/preview/importMap.js b/packages/design-core/src/preview/src/preview/importMap.js index 11849e460..be4dd081d 100644 --- a/packages/design-core/src/preview/src/preview/importMap.js +++ b/packages/design-core/src/preview/src/preview/importMap.js @@ -16,7 +16,7 @@ import importMapJSON from './importMap.json' const importMap = {} -const opentinyVueVersion = '~3.14' +const opentinyVueVersion = '~3.20' function replacePlaceholder(v) { return v.replace('${VITE_CDN_DOMAIN}', useEnv().VITE_CDN_DOMAIN).replace('${opentinyVueVersion}', opentinyVueVersion) diff --git a/packages/design-core/src/preview/src/preview/importMap.json b/packages/design-core/src/preview/src/preview/importMap.json index 1a110f907..c388447de 100644 --- a/packages/design-core/src/preview/src/preview/importMap.json +++ b/packages/design-core/src/preview/src/preview/importMap.json @@ -10,13 +10,14 @@ "axios": "${VITE_CDN_DOMAIN}/axios@1.0.0/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}/vue-demi@0.13.11/lib/index.mjs", "pinia": "${VITE_CDN_DOMAIN}/pinia@2.0.22/dist/pinia.esm-browser.js", - "@opentiny/vue": "${VITE_CDN_DOMAIN}/@opentiny/vue@${opentinyVueVersion}/runtime/tiny-vue.mjs", - "@opentiny/vue-icon": "${VITE_CDN_DOMAIN}/@opentiny/vue@${opentinyVueVersion}/runtime/tiny-vue-icon.mjs", - "@opentiny/vue-common": "${VITE_CDN_DOMAIN}/@opentiny/vue@${opentinyVueVersion}/runtime/tiny-vue-common.mjs", - "@opentiny/vue-locale": "${VITE_CDN_DOMAIN}/@opentiny/vue@${opentinyVueVersion}/runtime/tiny-vue-locale.mjs", - "@opentiny/vue-renderless/": "${VITE_CDN_DOMAIN}/@opentiny/vue-renderless@${opentinyVueVersion}/" + "@opentiny/vue": "${VITE_CDN_DOMAIN}/@opentiny/vue-runtime@${opentinyVueVersion}/dist3/tiny-vue-pc.mjs", + "@opentiny/vue-icon": "${VITE_CDN_DOMAIN}/@opentiny/vue-runtime@${opentinyVueVersion}/dist3/tiny-vue-icon.mjs", + "@opentiny/vue-common": "${VITE_CDN_DOMAIN}/@opentiny/vue-runtime@${opentinyVueVersion}/dist3/tiny-vue-common.mjs", + "@opentiny/vue-locale": "${VITE_CDN_DOMAIN}/@opentiny/vue-runtime@${opentinyVueVersion}/dist3/tiny-vue-locale.mjs", + "@opentiny/vue-renderless/": "${VITE_CDN_DOMAIN}/@opentiny/vue-renderless@${opentinyVueVersion}/", + "echarts": "${VITE_CDN_DOMAIN}/echarts@5.4.1/dist/echarts.esm.js" } } diff --git a/packages/design-core/src/preview/src/preview/srcFiles/app.js b/packages/design-core/src/preview/src/preview/srcFiles/app.js index d3654b847..90398a05c 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/app.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/app.js @@ -16,5 +16,5 @@ function addCss(href) { link.setAttribute('href', href) document.head.appendChild(link) } -addCss('VITE_CDN_DOMAIN/@opentiny/vue-theme@3.14/index.css') -addCss('VITE_CDN_DOMAIN/@opentiny/vue-theme-mobile@3.14/index.css') +addCss('VITE_CDN_DOMAIN/@opentiny/vue-theme@3.20/index.css') +addCss('VITE_CDN_DOMAIN/@opentiny/vue-theme-mobile@3.20/index.css') diff --git a/packages/design-core/src/preview/src/preview/srcFiles/bridge.js b/packages/design-core/src/preview/src/preview/srcFiles/bridge.js index 3ee6a55b4..ef458adc7 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/bridge.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/bridge.js @@ -1,13 +1,13 @@ /** -* 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. + * + */ export default {} diff --git a/packages/design-core/src/preview/src/preview/srcFiles/constant/index.js b/packages/design-core/src/preview/src/preview/srcFiles/constant/index.js index b166abbbe..8ade47a24 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/constant/index.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/constant/index.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ const BROADCAST_CHANNEL = { PreviewLang: 'tiny-lowcode-preview-lang' diff --git a/packages/design-core/src/preview/src/preview/srcFiles/dataSource.js b/packages/design-core/src/preview/src/preview/srcFiles/dataSource.js index 547a519a6..cfa7dfce6 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/dataSource.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/dataSource.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ export default { list: [], diff --git a/packages/design-core/src/preview/src/preview/srcFiles/dataSourceMap.js b/packages/design-core/src/preview/src/preview/srcFiles/dataSourceMap.js index ae37f2e25..17b018be9 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/dataSourceMap.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/dataSourceMap.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import dataSources from './dataSource.js' diff --git a/packages/design-core/src/preview/src/preview/srcFiles/injectGlobal.js b/packages/design-core/src/preview/src/preview/srcFiles/injectGlobal.js index 62bc52fa0..16d422eda 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/injectGlobal.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/injectGlobal.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import * as Vue from 'vue' import * as VueI18n from 'vue-i18n' diff --git a/packages/design-core/src/preview/src/preview/srcFiles/locales.js b/packages/design-core/src/preview/src/preview/srcFiles/locales.js index cec31cfd2..f2ce64045 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/locales.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/locales.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ export default { zh_CN: {}, diff --git a/packages/design-core/src/preview/src/preview/srcFiles/stores.js b/packages/design-core/src/preview/src/preview/srcFiles/stores.js index ff4ee0aa0..011f97759 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/stores.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/stores.js @@ -1,13 +1,13 @@ /** -* 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. + * + */ export {} diff --git a/packages/design-core/src/preview/src/preview/srcFiles/storesHelper.js b/packages/design-core/src/preview/src/preview/srcFiles/storesHelper.js index f766b5445..14aca64c7 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/storesHelper.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/storesHelper.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import * as userDefinedStores from './stores.js' diff --git a/packages/design-core/src/preview/src/preview/srcFiles/utils.js b/packages/design-core/src/preview/src/preview/srcFiles/utils.js index b51178395..da9a5add4 100644 --- a/packages/design-core/src/preview/src/preview/srcFiles/utils.js +++ b/packages/design-core/src/preview/src/preview/srcFiles/utils.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { Pager, Select, Modal, Input } from '@opentiny/vue' export { Pager, Select, Modal, Input } diff --git a/packages/design-core/src/preview/src/previewApp.js b/packages/design-core/src/preview/src/previewApp.js index 0d7dab502..166186f0d 100644 --- a/packages/design-core/src/preview/src/previewApp.js +++ b/packages/design-core/src/preview/src/previewApp.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { createApp } from 'vue' diff --git a/packages/design-core/src/preview/src/styles/vars.less b/packages/design-core/src/preview/src/styles/vars.less new file mode 100644 index 000000000..3882932ce --- /dev/null +++ b/packages/design-core/src/preview/src/styles/vars.less @@ -0,0 +1,5 @@ +:root { + --te-preview-common-text-color: var(--te-common-text-primary); + --te-preview-common-bg-color: var(--te-common-bg-default); + --te-preview-common-border-color: var(--te-common-border-divider); +} diff --git a/packages/design-core/src/theme/dark.js b/packages/design-core/src/theme/dark.js index f610c1fa5..e69de29bb 100644 --- a/packages/design-core/src/theme/dark.js +++ b/packages/design-core/src/theme/dark.js @@ -1 +0,0 @@ -import '@opentiny/tiny-engine-theme-dark' diff --git a/packages/design-core/src/theme/light.js b/packages/design-core/src/theme/light.js index 5a76eb90b..e69de29bb 100644 --- a/packages/design-core/src/theme/light.js +++ b/packages/design-core/src/theme/light.js @@ -1 +0,0 @@ -import '@opentiny/tiny-engine-theme-light' diff --git a/packages/engine-cli/package.json b/packages/engine-cli/package.json index dd5da0337..e30460494 100644 --- a/packages/engine-cli/package.json +++ b/packages/engine-cli/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-cli", - "version": "2.0.0", + "version": "2.2.0", "description": "", "main": "dist/index.js", "scripts": { diff --git a/packages/engine-cli/src/commands/generateConfig.js b/packages/engine-cli/src/commands/generateConfig.js index 9e5fc35b3..3cfd6b884 100644 --- a/packages/engine-cli/src/commands/generateConfig.js +++ b/packages/engine-cli/src/commands/generateConfig.js @@ -8,7 +8,7 @@ export const generateConfig = (options = {}) => { const configContent = ` export default { id: 'engine.config', - theme: import.meta.env.VITE_THEME || '${theme}', + theme: '${theme}', material: ${JSON.stringify(material)}, scripts: ${JSON.stringify(scripts)}, styles: ${JSON.stringify(styles)}, @@ -24,18 +24,6 @@ export const generatePackageJson = (name, options, templatePath) => { const templatePackageJson = fs.readJSONSync(path.resolve(templatePath, 'package.json')) templatePackageJson.name = name - templatePackageJson.scripts['serve:frontend'] = templatePackageJson.scripts['serve:frontend'].replace( - /VITE_THEME=[^\s]+/, - `VITE_THEME=${options.theme}` - ) - templatePackageJson.scripts.build = templatePackageJson.scripts.build.replace( - /VITE_THEME=[^\s]+/, - `VITE_THEME=${options.theme}` - ) - templatePackageJson.scripts['build:alpha'] = templatePackageJson.scripts['build:alpha'].replace( - /VITE_THEME=[^\s]+/, - `VITE_THEME=${options.theme}` - ) return templatePackageJson } diff --git a/packages/engine-cli/template/designer/engine.config.js b/packages/engine-cli/template/designer/engine.config.js index fa2b077e0..fa308f9bc 100644 --- a/packages/engine-cli/template/designer/engine.config.js +++ b/packages/engine-cli/template/designer/engine.config.js @@ -1,6 +1,6 @@ export default { id: 'engine.config', - theme: import.meta.env.VITE_THEME || 'light', + theme: 'light', material: ['/mock/bundle.json'], scripts: [], styles: [] diff --git a/packages/engine-cli/template/designer/package.json b/packages/engine-cli/template/designer/package.json index 6be053ec2..d70e33201 100644 --- a/packages/engine-cli/template/designer/package.json +++ b/packages/engine-cli/template/designer/package.json @@ -1,32 +1,33 @@ { - "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:alpha": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode alpha", + "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --mode prod", + "serve:frontend": "cross-env vite", + "serve:mock": "node node_modules/@opentiny/tiny-engine-mock/dist/app.js" }, "dependencies": { - "vue": "^3.4.21", - "@opentiny/tiny-engine": "^2.0.0-alpha.5", - "@opentiny/tiny-engine-theme-dark": "^2.0.0-alpha.5", - "@opentiny/tiny-engine-theme-light": "^2.0.0-alpha.5", - "@opentiny/vue": "~3.14.0", - "@opentiny/vue-icon": "~3.14.0", - "@opentiny/vue-design-smb": "~3.14.0", - "@opentiny/vue-renderless": "~3.14.0", - "@opentiny/vue-theme": "~3.14.0" + "@opentiny/tiny-engine": "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", + "@opentiny/vue-locale": "~3.20.0", + "@opentiny/vue-renderless": "~3.20.0", + "@opentiny/vue-theme": "~3.20.0", + "@vueuse/core": "^9.6.0", + "vue": "^3.4.21" }, "devDependencies": { - "@opentiny/tiny-engine-vite-config": "^2.0.0-alpha.5", - "@opentiny/tiny-engine-mock": "^2.0.0-alpha.5", + "@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" } } diff --git a/packages/engine-cli/template/designer/public/mock/bundle.json b/packages/engine-cli/template/designer/public/mock/bundle.json index 77114bb43..9cd3cdf17 100644 --- a/packages/engine-cli/template/designer/public/mock/bundle.json +++ b/packages/engine-cli/template/designer/public/mock/bundle.json @@ -19,10 +19,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElInput" }, "group": "表单组件", @@ -299,10 +295,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElButton" }, "group": "基础组件", @@ -620,10 +612,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElForm" }, "group": "表单组件", @@ -1075,10 +1063,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElFormItem" }, "group": "表单组件", @@ -1424,10 +1408,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElTable" }, "group": "数据展示", @@ -2661,10 +2641,6 @@ "dev_mode": "proCode", "npm": { "package": "element-plus", - "version": "2.4.2", - "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", - "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css", - "dependencies": null, "exportName": "ElTableColumn" }, "group": "表单组件", @@ -2727,11 +2703,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CarouselItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CarouselItem" }, "group": "component", "category": "容器组件", @@ -2860,11 +2832,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Carousel", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Carousel" }, "group": "component", "category": "容器组件", @@ -4534,11 +4502,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "ButtonGroup", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "ButtonGroup" }, "group": "component", "category": "general", @@ -4692,11 +4656,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Row", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Row" }, "group": "component", "priority": 5, @@ -4828,6 +4788,113 @@ } } }, + { + "icon": "row", + "name": { + "zh_CN": "row" + }, + "component": "TinyLayout", + "description": "定义 Layout 的行配置信息", + "docUrl": "", + "screenshot": "", + "tags": "", + "keywords": "", + "devMode": "proCode", + "npm": { + "package": "@opentiny/vue", + "exportName": "Layout", + "version": "3.20.0", + "destructuring": true, + "script": "https://unpkg.com/@opentiny/vue-runtime@~3.20/dist3/tiny-vue-pc.mjs", + "css": "https://unpkg.com/@opentiny/vue-theme@~3.20/index.css" + }, + "group": "component", + "priority": 5, + "schema": { + "properties": [ + { + "label": { + "zh_CN": "基础信息" + }, + "description": { + "zh_CN": "基础信息" + }, + "content": [ + { + "property": "cols", + "label": { + "text": { + "zh_CN": "总栅格数" + } + }, + "cols": 12, + "widget": { + "component": "ButtonGroupConfigurator", + "props": { + "options": [ + { + "label": "12", + "value": 12 + }, + { + "label": "24", + "value": 24 + } + ] + } + }, + "description": { + "zh_CN": "选择总栅格数" + }, + "labelPosition": "none" + }, + { + "property": "tag", + "label": { + "text": { + "zh_CN": "layout渲染的标签" + } + }, + "required": false, + "readOnly": false, + "disabled": false, + "cols": 12, + "widget": { + "component": "InputConfigurator", + "props": {} + }, + "description": { + "zh_CN": "定义Layout元素渲染后的标签,默认为 div" + } + } + ] + } + ] + }, + "configure": { + "loop": true, + "condition": true, + "styles": true, + "isContainer": true, + "isModal": false, + "nestingRule": { + "childWhitelist": ["TinyRow", "TinyCol"], + "parentWhitelist": "", + "descendantBlacklist": "", + "ancestorWhitelist": "" + }, + "isNullNode": false, + "isLayout": false, + "rootSelector": "", + "shortcuts": { + "properties": ["disabled"] + }, + "contextMenu": { + "actions": ["create symbol"], + "disable": ["copy", "remove"] + } + } + }, { "icon": "form", "name": { @@ -4842,11 +4909,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Form", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Form" }, "group": "component", "priority": 5, @@ -5196,11 +5259,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "FormItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "FormItem" }, "group": "component", "priority": 12, @@ -5328,11 +5387,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Col", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Col" }, "group": "component", "priority": 2, @@ -5606,11 +5661,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Button", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Button" }, "group": "component", "priority": 2, @@ -5945,11 +5996,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Input", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Input" }, "group": "component", "priority": 1, @@ -6359,11 +6406,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Radio", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Radio" }, "group": "component", "priority": 3, @@ -6596,11 +6639,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Select", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Select" }, "group": "component", "priority": 8, @@ -7001,11 +7040,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Switch", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Switch" }, "group": "component", "priority": 9, @@ -7200,11 +7235,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Search", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Search" }, "group": "component", "priority": 2, @@ -7475,11 +7506,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Checkbox", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Checkbox" }, "group": "component", "priority": 4, @@ -7734,11 +7761,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CheckboxButton", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CheckboxButton" }, "group": "component", "priority": 1, @@ -7922,11 +7945,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CheckboxGroup", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CheckboxGroup" }, "group": "component", "priority": 2, @@ -8131,11 +8150,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "DialogBox", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "DialogBox" }, "group": "component", "priority": 4, @@ -8409,11 +8424,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Tabs", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Tabs" }, "group": "component", "priority": 10, @@ -8690,11 +8701,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "TabItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "TabItem" }, "group": "component", "priority": 2, @@ -8799,11 +8806,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Breadcrumb", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Breadcrumb" }, "group": "component", "priority": 1, @@ -8938,11 +8941,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "BreadcrumbItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "BreadcrumbItem" }, "group": "component", "priority": 1, @@ -9027,11 +9026,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Collapse", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Collapse" }, "group": "component", "priority": 3, @@ -9154,11 +9149,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "CollapseItem", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "CollapseItem" }, "group": "component", "priority": 2, @@ -9265,11 +9256,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Grid", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Grid" }, "group": "component", "priority": 2, @@ -9613,7 +9600,7 @@ "required": true, "readOnly": false, "disabled": false, - "onChange": "this.delProp('data')", + "onChange": "function () { this.delProp('data') } ", "cols": 12, "widget": { "component": "CodeConfigurator", @@ -10165,6 +10152,54 @@ } } }, + { + "icon": "grid", + "name": { + "zh_CN": "表格行" + }, + "component": "TinyGridColumn", + "description": "提供了非常强大数据表格功能,可以展示数据列表,可以对数据列表进行选择、编辑等", + "docUrl": "", + "screenshot": "", + "tags": "", + "keywords": "", + "devMode": "proCode", + "npm": { + "package": "@opentiny/vue", + "exportName": "TinyGridColumn" + }, + "group": "component", + "priority": 2, + "schema": { + "properties": [], + "events": {}, + "shortcuts": {}, + "contentMenu": { + "actions": ["create symbol"] + } + }, + "configure": { + "loop": true, + "condition": true, + "styles": true, + "isContainer": false, + "isModal": false, + "nestingRule": { + "childWhitelist": "", + "parentWhitelist": "", + "descendantBlacklist": "", + "ancestorWhitelist": "" + }, + "isNullNode": false, + "isLayout": false, + "rootSelector": "", + "shortcuts": {}, + "contextMenu": { + "actions": ["create symbol"], + "disable": ["copy", "remove"] + } + } + }, { "name": { "zh_CN": "分页" @@ -10179,11 +10214,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Pager", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Pager" }, "group": "component", "priority": 1, @@ -10412,11 +10443,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Popeditor", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Popeditor" }, "group": "component", "priority": 6, @@ -10775,11 +10802,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Tree", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Tree" }, "group": "component", "priority": 12, @@ -11110,11 +11133,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "TimeLine", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "TimeLine" }, "group": "component", "priority": 3, @@ -11317,11 +11336,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Tooltip", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Tooltip" }, "group": "component", "priority": 11, @@ -11538,11 +11553,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Popover", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Popover" }, "group": "component", "priority": 7, @@ -12033,11 +12044,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "DatePicker", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "DatePicker" }, "group": "component", "priority": 1, @@ -12448,11 +12455,7 @@ "devMode": "proCode", "npm": { "package": "@opentiny/vue", - "exportName": "Numeric", - "version": "3.14.0", - "destructuring": true, - "script": "https://unpkg.com/@opentiny/vue@~3.14/runtime/tiny-vue.mjs", - "css": "https://unpkg.com/@opentiny/vue-theme@~3.14/index.css" + "exportName": "Numeric" }, "group": "component", "priority": 1, @@ -14080,6 +14083,23 @@ } ] } + ], + "packages": [ + { + "name": "TinyVue组件库", + "package": "@opentiny/vue", + "version": "3.20.0", + "destructuring": true, + "script": "https://unpkg.com/@opentiny/vue-runtime@~3.20/dist3/tiny-vue-pc.mjs", + "css": "https://unpkg.com/@opentiny/vue-theme@~3.20/index.css" + }, + { + "name": "element-plus组件库", + "package": "element-plus", + "version": "2.4.2", + "script": "https://unpkg.com/element-plus@2.4.2/dist/index.full.mjs", + "css": "https://unpkg.com/element-plus@2.4.2/dist/index.css" + } ] } } diff --git a/packages/engine-cli/template/designer/registry.js b/packages/engine-cli/template/designer/registry.js index ac499e930..032a8a968 100644 --- a/packages/engine-cli/template/designer/registry.js +++ b/packages/engine-cli/template/designer/registry.js @@ -14,12 +14,14 @@ import { Breadcrumb, Fullscreen, Lang, + ViewSetting, Logo, Lock, Media, Redoundo, Save, Clean, + ThemeSwitch, Preview, GenerateCode, Refresh, @@ -42,7 +44,8 @@ import { Layout, Canvas, GenerateCodeService, - GlobalService + GlobalService, + ThemeSwitchService } from '@opentiny/tiny-engine' import engineConfig from './engine.config' import { HttpService } from './src/composable' @@ -50,7 +53,7 @@ import { HttpService } from './src/composable' export default { root: { id: 'engine.root', - metas: [HttpService, GenerateCodeService, GlobalService] + metas: [HttpService, GenerateCodeService, GlobalService, ThemeSwitchService] // GlobalService 依赖 HttpService,HttpService需要在前面处理 }, config: engineConfig, layout: { @@ -63,14 +66,15 @@ export default { left: ['engine.toolbars.breadcrumb', 'engine.toolbars.lock', 'engine.toolbars.logo'], center: ['engine.toolbars.media'], right: [ - ['engine.toolbars.redoundo', 'engine.toolbars.clean'], + ['engine.toolbars.themeSwitch', 'engine.toolbars.redoundo', 'engine.toolbars.clean'], ['engine.toolbars.preview'], ['engine.toolbars.generate-code', 'engine.toolbars.save'] ], collapse: [ ['engine.toolbars.collaboration'], ['engine.toolbars.refresh', 'engine.toolbars.fullscreen'], - ['engine.toolbars.lang'] + ['engine.toolbars.lang'], + ['engine.toolbars.viewSetting'] ] } } @@ -84,6 +88,7 @@ export default { } ], toolbars: [ + ThemeSwitch, Logo, Breadcrumb, Lock, @@ -96,9 +101,23 @@ export default { GenerateCode, Save, Fullscreen, - Lang + Lang, + ViewSetting + ], + plugins: [ + Materials, + Tree, + Page, + [Block, { options: { ...Block.options, mergeCategoriesAndGroups: true } }], + Datasource, + Bridge, + I18n, + Script, + State, + Schema, + Help, + Robot ], - plugins: [Materials, Tree, Page, Block, Datasource, Bridge, I18n, Script, State, Schema, Help, Robot], dsls: [{ id: 'engine.dsls.dslvue' }], settings: [Props, Styles, Events], canvas: Canvas diff --git a/packages/engine-cli/template/designer/src/composable/http/Login.vue b/packages/engine-cli/template/designer/src/composable/http/Login.vue new file mode 100644 index 000000000..6c5c8b0d6 --- /dev/null +++ b/packages/engine-cli/template/designer/src/composable/http/Login.vue @@ -0,0 +1,83 @@ +

+
+
+ +
+
+
+ + + + + diff --git a/packages/engine-cli/template/designer/src/composable/http/index.js b/packages/engine-cli/template/designer/src/composable/http/index.js index 26b7edae7..f11538395 100644 --- a/packages/engine-cli/template/designer/src/composable/http/index.js +++ b/packages/engine-cli/template/designer/src/composable/http/index.js @@ -1,36 +1,135 @@ +import { createApp } from 'vue' import { HttpService } from '@opentiny/tiny-engine' +import { useBroadcastChannel } from '@vueuse/core' +import { constants } from '@opentiny/tiny-engine-utils' +import Login from './Login.vue' + +const LOGIN_EXPIRED_CODE = 401 +const { BROADCAST_CHANNEL } = constants + +const { post: globalNotify } = useBroadcastChannel({ name: BROADCAST_CHANNEL.Notify }) + +const procession = { + promiseLogin: null, + mePromise: {} +} +let loginVM = null + +const showError = (url, message) => { + globalNotify({ + type: 'error', + title: '接口报错', + message: `报错接口: ${url} \n报错信息: ${message ?? ''}` + }) +} const preRequest = (config) => { + const isDevelopEnv = import.meta.env.MODE?.includes('dev') + + if (isDevelopEnv && config.url.match(/\/generate\//)) { + config.baseURL = '' + } + + const isVsCodeEnv = window.vscodeBridge + + if (isVsCodeEnv) { + config.baseURL = '' + } + return config } const preResponse = (res) => { + if (res.data?.error) { + showError(res.config?.url, res?.data?.error?.message) + + return Promise.reject(res.data.error) + } + return res.data?.data } +const openLogin = () => { + if (!window.lowcode) { + const loginDom = document.createElement('div') + document.body.appendChild(loginDom) + loginVM = createApp(Login).mount(loginDom) + + window.lowcode = { + platformCenter: { + Session: { + rebuiltCallback: function () { + loginVM.closeLogin() + + procession.mePromise.resolve('login ok') + procession.promiseLogin = null + procession.mePromise = {} + } + } + } + } + } + + return new Promise((resolve, reject) => { + if (!procession.promiseLogin) { + procession.promiseLogin = loginVM.openLogin(procession, '/api/rebuildSession') + procession.promiseLogin.then((response) => { + HttpService.apis.request(response.config).then(resolve, reject) + }) + } + }) +} + const errorResponse = (error) => { - return Promise.reject(error.message) + // 用户信息失效时,弹窗提示登录 + const { response } = error + + if (response?.status === LOGIN_EXPIRED_CODE) { + // vscode 插件环境弹出输入框提示登录 + if (window.vscodeBridge) { + return Promise.resolve(true) + } + + // 浏览器环境弹出小窗登录 + if (response?.headers['x-login-url']) { + return openLogin() + } + } + + showError(error.config?.url, error?.message) + + return response?.data.error ? Promise.reject(response.data.error) : Promise.reject(error.message) } const getConfig = (env = import.meta.env) => { + const baseURL = env.VITE_ORIGIN + // 仅在本地开发时,启用 withCredentials + const dev = env.MODE?.includes('dev') + // 获取租户 id + const getTenant = () => new URLSearchParams(location.search).get('tenant') + return { - baseURL: env.VITE_ORIGIN, + baseURL, + withCredentials: dev, headers: { - 'x-lowcode-mode': env.MODE + ...(dev && { 'x-lowcode-mode': 'develop' }), + 'x-lowcode-org': getTenant() } } } -const options = { - axiosConfig: getConfig(), - enableMock: false, - mockData: {}, - interceptors: { - request: [preRequest], - response: [[preResponse, errorResponse]] +const customizeHttpService = () => { + const options = { + axiosConfig: getConfig(), + interceptors: { + request: [preRequest], + response: [[preResponse, errorResponse]] + } } -} -HttpService.apis.setOptions(options) + HttpService.apis.setOptions(options) + + return HttpService +} -export default HttpService +export default customizeHttpService() diff --git a/packages/engine-cli/template/designer/src/main.js b/packages/engine-cli/template/designer/src/main.js index 6f29317b2..10457cd95 100644 --- a/packages/engine-cli/template/designer/src/main.js +++ b/packages/engine-cli/template/designer/src/main.js @@ -15,7 +15,6 @@ import { registry } from './defineEntry.js' import { init } from '@opentiny/tiny-engine' import { configurators } from './configurators/' import 'virtual:svg-icons-register' -import '@opentiny/tiny-engine-theme' init({ registry, diff --git a/packages/engine-cli/template/designer/src/preview.js b/packages/engine-cli/template/designer/src/preview.js index 4e120d4c6..7b53620cb 100644 --- a/packages/engine-cli/template/designer/src/preview.js +++ b/packages/engine-cli/template/designer/src/preview.js @@ -13,7 +13,7 @@ import { initHook, HOOK_NAME, GenerateCodeService, Breadcrumb, Media, Lang } from '@opentiny/tiny-engine' import { initPreview } from '@opentiny/tiny-engine' import 'virtual:svg-icons-register' -import '@opentiny/tiny-engine-theme' +import { HttpService } from './composable' const beforeAppCreate = () => { initHook(HOOK_NAME.useEnv, import.meta.env) @@ -23,7 +23,7 @@ initPreview({ registry: { root: { id: 'engine.root', - metas: [GenerateCodeService] + metas: [HttpService, GenerateCodeService] }, config: { id: 'engine.config', theme: 'light' }, toolbars: [Breadcrumb, Media, Lang] diff --git a/packages/engine-cli/template/designer/vite.config.js b/packages/engine-cli/template/designer/vite.config.js index 9dd2864eb..f90c69aff 100644 --- a/packages/engine-cli/template/designer/vite.config.js +++ b/packages/engine-cli/template/designer/vite.config.js @@ -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' }) diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 08549005b..bea832163 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-i18n-host", - "version": "2.0.0", + "version": "2.2.0", "publishConfig": { "access": "public" }, diff --git a/packages/i18n/src/i18n.js b/packages/i18n/src/i18n.js index 8c72e7e1e..c2867d3ea 100644 --- a/packages/i18n/src/i18n.js +++ b/packages/i18n/src/i18n.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { createI18n } from 'vue-i18n' diff --git a/packages/i18n/src/main.js b/packages/i18n/src/main.js index afcf8cdc0..f0c5c1959 100644 --- a/packages/i18n/src/main.js +++ b/packages/i18n/src/main.js @@ -1,14 +1,14 @@ /** -* 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. + * + */ import { createApp } from 'vue' import App from './App.vue' diff --git a/packages/layout/index.js b/packages/layout/index.js index 1fb5ac1b2..28e09233e 100644 --- a/packages/layout/index.js +++ b/packages/layout/index.js @@ -3,6 +3,7 @@ import metaData from './meta' import { LayoutService } from './src/composable' import designSmbConfig from '@opentiny/vue-design-smb' import { ConfigProvider as TinyConfigProvider } from '@opentiny/vue' +import './src/styles/vars.less' export default { ...metaData, @@ -16,14 +17,15 @@ export default { left: ['engine.toolbars.breadcrumb', 'engine.toolbars.lock', 'engine.toolbars.logo'], center: ['engine.toolbars.media'], right: [ - ['engine.toolbars.redoundo', 'engine.toolbars.clean'], + ['engine.toolbars.themeSwitch', 'engine.toolbars.redoundo', 'engine.toolbars.clean'], ['engine.toolbars.preview'], ['engine.toolbars.generate-code', 'engine.toolbars.save'] ], collapse: [ ['engine.toolbars.collaboration'], ['engine.toolbars.refresh', 'engine.toolbars.fullscreen'], - ['engine.toolbars.lang'] + ['engine.toolbars.lang'], + ['engine.toolbars.viewSetting'] ] } }, diff --git a/packages/layout/package.json b/packages/layout/package.json index f699c3e1b..ad2821f2d 100644 --- a/packages/layout/package.json +++ b/packages/layout/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-layout", - "version": "2.0.0", + "version": "2.2.0", "scripts": { "build": "vite build" }, @@ -26,13 +26,7 @@ "@opentiny/tiny-engine-common": "workspace:*", "@opentiny/tiny-engine-meta-register": "workspace:*", "@opentiny/tiny-engine-utils": "workspace:*", - "@opentiny/vue": "~3.14.0", - "@opentiny/vue-design-smb": "~3.14.0", - "@opentiny/vue-icon": "~3.14.0", - "@opentiny/vue-renderless": "~3.14.0", - "@opentiny/vue-theme": "~3.14.0", - "@vueuse/core": "^9.6.0", - "vue": "3.2.45" + "@vueuse/core": "^9.6.0" }, "devDependencies": { "@opentiny/tiny-engine-vite-plugin-meta-comments": "workspace:*", @@ -40,5 +34,13 @@ "@vitejs/plugin-vue-jsx": "^4.0.1", "less": "^4.2.0", "vite": "^5.4.2" + }, + "peerDependencies": { + "@opentiny/vue": "^3.20.0", + "@opentiny/vue-design-smb": "^3.20.0", + "@opentiny/vue-icon": "^3.20.0", + "@opentiny/vue-renderless": "^3.20.0", + "@opentiny/vue-theme": "^3.20.0", + "vue": "^3.4.23" } } diff --git a/packages/layout/src/DesignPlugins.vue b/packages/layout/src/DesignPlugins.vue index 27b7c9ee6..c2f2914f2 100644 --- a/packages/layout/src/DesignPlugins.vue +++ b/packages/layout/src/DesignPlugins.vue @@ -200,8 +200,8 @@ export default { #tiny-engine-left-panel { width: var(--base-left-panel-width); height: calc(100vh - var(--base-top-panel-height)); - border-right: 1px solid var(--ti-lowcode-plugin-panel-border-right-color); - background: var(--ti-lowcode-common-component-bg); + border-right: 1px solid var(--te-layout-common-border-color); + background: var(--te-layout-common-bg-color); display: flex; flex-direction: column; position: absolute; @@ -239,10 +239,10 @@ export default { display: flex; flex-direction: column; justify-content: space-between; - background: var(--ti-lowcode-common-layout-bg); + background: var(--te-layout-common-bg-color); box-sizing: border-box; z-index: 1000; - border-right: 1px solid var(--ti-lowcode-plugin-panel-border-right-color); + border-right: 1px solid var(--te-layout-common-border-color); &.completed { display: block; @@ -257,7 +257,7 @@ export default { &.bottom { flex: 1; - padding-bottom: 20px; + padding-bottom: 28px; } .list-item { @@ -276,7 +276,7 @@ export default { &:hover, &.active { .item-icon { - background: var(--ti-lowcode-left-panel-active-bg); + background: var(--te-layout-common-bg-color-hover); border-radius: 4px; } } @@ -285,12 +285,12 @@ export default { position: relative; .item-icon { - color: var(--ti-lowcode-common-primary-color); + color: var(--te-layout-common-text-color-secondary-checked); } } &.prev { - border-bottom-color: var(--ti-lowcode-left-panel-active-border-color); + border-bottom-color: var(--te-layout-common-border-color); } } @@ -298,7 +298,7 @@ export default { display: flex; justify-content: center; align-items: center; - color: var(--ti-lowcode-design-plugin-color); + color: var(--te-layout-common-text-color); font-size: 22px; width: 26px; height: 26px; diff --git a/packages/layout/src/DesignSettings.vue b/packages/layout/src/DesignSettings.vue index c79bcaeda..63621184e 100644 --- a/packages/layout/src/DesignSettings.vue +++ b/packages/layout/src/DesignSettings.vue @@ -2,12 +2,12 @@
- +
- +
@@ -15,14 +15,15 @@ diff --git a/packages/plugins/block/src/BlockSetting.vue b/packages/plugins/block/src/BlockSetting.vue index e9b6407bc..f3e918185 100644 --- a/packages/plugins/block/src/BlockSetting.vue +++ b/packages/plugins/block/src/BlockSetting.vue @@ -69,20 +69,24 @@ - + diff --git a/packages/plugins/datasource/src/DataSourceGlobalDataHandler.vue b/packages/plugins/datasource/src/DataSourceGlobalDataHandler.vue index cadc2bb2c..c2b0a8f17 100644 --- a/packages/plugins/datasource/src/DataSourceGlobalDataHandler.vue +++ b/packages/plugins/datasource/src/DataSourceGlobalDataHandler.vue @@ -112,8 +112,11 @@ export default { height: 100%; display: flex; flex-direction: column; -} -.is-active { - flex-grow: 2; + .tiny-collapse-item:first-child { + border-top: 0; + } + :deep(.tiny-collapse-item__content) { + padding: 0 0 12px; + } } diff --git a/packages/plugins/datasource/src/DataSourceList.vue b/packages/plugins/datasource/src/DataSourceList.vue index 566ea8154..217e25385 100644 --- a/packages/plugins/datasource/src/DataSourceList.vue +++ b/packages/plugins/datasource/src/DataSourceList.vue @@ -8,12 +8,13 @@ >
- + {{ item.name }}
@@ -130,21 +132,21 @@ export default { .datasource-list { flex-grow: 1; padding-top: 12px; - border-top: 1px solid var(--ti-lowcode-datasource-border-color); + border-top: 1px solid var(--te-datasource-common-border-color); } .datasource-list-item { - box-shadow: var(--ti-lowcode-datasource-tabs-border-color) 0, -1px; + box-shadow: var(--te-datasource-tabs-border-color) 0, -1px; height: 24px; line-height: 24px; align-items: center; display: grid; padding: 0 12px; position: relative; - color: var(--ti-lowcode-datasource-common-text-main-color); + color: var(--te-datasource-list-main-text-color); cursor: pointer; &:hover, &.active { - background: var(--ti-lowcode-datasource-list-hover-color); + background: var(--te-datasource-list-text-color-hover); .item-handler { display: inline-block; } @@ -155,29 +157,20 @@ export default { display: flex; align-items: center; justify-content: space-between; - color: var(--te-common-text-primary); + color: var(--te-datasource-list-item-text-color); .item-name { display: flex; align-items: center; } .plugin-icon-data { + color: var(--te-datasource-list-item-icon-color); margin-right: 8px; - width: 18px; } } .item-handler { height: 24px; line-height: 24px; display: none; - .svg-button { - width: 16px; - height: 16px; - margin-top: 6px; - color: var(--ti-lowcode-datasource-toolbar-more-hover-color); - &:hover { - color: var(--ti-lowcode-toolbar-icon-color); - } - } } } } diff --git a/packages/plugins/datasource/src/DataSourceRecordForm.vue b/packages/plugins/datasource/src/DataSourceRecordForm.vue index 73ad112ef..fc8c0f15b 100644 --- a/packages/plugins/datasource/src/DataSourceRecordForm.vue +++ b/packages/plugins/datasource/src/DataSourceRecordForm.vue @@ -248,19 +248,19 @@ export default { .record-form-content { padding: 24px 10px 12px; .dot-tip { - color: var(--ti-lowcode-datasource-description-error-color); + color: var(--te-datasource-description-text-color-error); margin-right: 4px; vertical-align: middle; } .record-form-footer { padding: 12px 0; - border-top: 1px solid var(--ti-lowcode-datasource-tabs-border-color); + border-top: 1px solid var(--te-datasource-tabs-border-color); .tiny-svg { margin-right: 6px; } .del:hover { - background-color: var(--ti-lowcode-datasource-delete-button-hover-bg); + background-color: var(--te-datasource-delete-button-bg-color-hover); } } } diff --git a/packages/plugins/datasource/src/DataSourceRecordList.vue b/packages/plugins/datasource/src/DataSourceRecordList.vue index 48008ea1f..2fda437b1 100644 --- a/packages/plugins/datasource/src/DataSourceRecordList.vue +++ b/packages/plugins/datasource/src/DataSourceRecordList.vue @@ -307,7 +307,7 @@ export default { const messageSaved = { render: () => ( - {'您确定要删除该条数据吗?'} + 您确定要删除该条数据吗? ) } @@ -597,13 +597,16 @@ export default { } } .download { - margin: 0 12px; - text-decoration: underline; + text-decoration: none; display: inline-block; font-size: 12px; text-align: left; padding: 0; - color: var(--te-common-text-primary); + margin-left: 8px; + &:hover { + text-decoration: underline; + } + color: var(--te-datasource-common-text-color-primary); .icon-download { margin: 0 1px 4px 0; font-size: 16px; @@ -615,13 +618,13 @@ export default { display: flex; flex-direction: column; align-items: center; - color: var(--ti-lowcode-datasource-common-text-color-5); + color: var(--te-datasource-common-text-color-weaken); .empty-icon { width: 50px; height: 50px; } .add-column { - color: var(--ti-lowcode-datasource-json-border-color); + color: var(--te-datasource-json-border-color); cursor: pointer; } } @@ -633,6 +636,7 @@ export default { align-items: center; .svg-icon { margin-right: 10px; + color: var(--te-datasource-list-item-icon-color); } } } @@ -645,25 +649,25 @@ export default { padding-right: 8px; .tiny-pager__pages { li.is-active { - background-color: var(--ti-lowcode-datasource-dialog-demo-border-color); + background-color: var(--te-datasource-list-pager-bg-color); } li { &:not(.dot):not(.is-active):hover { - background-color: var(--ti-lowcode-datasource-common-hover-bg-1); - color: var(--ti-lowcode-datasource-common-primary-text-color); + background-color: var(--te-datasource-common-bg-color-hover); + color: var(--te-datasource-common-text-color-primary); } } } .tiny-pager__pull-left { - color: var(--ti-lowcode-datasource-toolbar-breadcrumb-color); + color: var(--te-datasource-toolbar-breadcrumb-text-color); } .tiny-pager__btn-next, .tiny-pager__btn-prev { &:not([disabled]):hover { - background-color: var(--ti-lowcode-datasource-icon-hover-bg); + background-color: var(--te-datasource-icon-bg-color-hover); svg { - color: var(--ti-lowcode-datasource-toolbar-icon-color); + color: var(--te-datasource-toolbar-icon-color); } } } diff --git a/packages/plugins/datasource/src/DataSourceRecordUpload.vue b/packages/plugins/datasource/src/DataSourceRecordUpload.vue index b73e8dd67..d64ee16ae 100644 --- a/packages/plugins/datasource/src/DataSourceRecordUpload.vue +++ b/packages/plugins/datasource/src/DataSourceRecordUpload.vue @@ -186,6 +186,6 @@ export default { margin-left: 10px; } .confirm { - color: var(--ti-lowcode-datasource-common-error-color); + color: var(--te-datasource-common-color-error); } diff --git a/packages/plugins/datasource/src/DataSourceRemoteAutoload.vue b/packages/plugins/datasource/src/DataSourceRemoteAutoload.vue index 628b22f6f..0324fb3d5 100644 --- a/packages/plugins/datasource/src/DataSourceRemoteAutoload.vue +++ b/packages/plugins/datasource/src/DataSourceRemoteAutoload.vue @@ -39,17 +39,15 @@ export default { diff --git a/packages/plugins/datasource/src/DataSourceRemoteDataResult.vue b/packages/plugins/datasource/src/DataSourceRemoteDataResult.vue index e15f0e9c0..af142c249 100644 --- a/packages/plugins/datasource/src/DataSourceRemoteDataResult.vue +++ b/packages/plugins/datasource/src/DataSourceRemoteDataResult.vue @@ -89,17 +89,16 @@ export default { .response-data { position: relative; .resonse-header { - padding: 10px; - margin-bottom: 16px; + margin-bottom: 12px; .life-cycle-alert { - font-size: 11px; - color: var(--ti-lowcode-datasource-tip-color); + font-size: var(--te-base-font-size-base); + color: var(--te-datasource-common-tip-text-color); } .title { - color: var(--ti-lowcode-datasource-toolbar-breadcrumb-color); + color: var(--te-datasource-toolbar-breadcrumb-text-color); display: inline-block; - border-bottom: 1px solid var(--ti-lowcode-datasource-tabs-border-color); + border-bottom: 1px solid var(--te-datasource-tabs-border-color); width: 100%; padding-bottom: 8px; } @@ -116,14 +115,17 @@ export default { z-index: 9999; .tiny-button { border-radius: 4px; - border-color: var(--te-common-border-default); + border-color: var(--te-datasource-common-btn-border-color); + & + .tiny-button { + margin-left: 4px; + } } } .monaco-editor { height: 120px; margin-top: 8px; - border: 1px solid var(--te-common-border-divider); + border: 1px solid var(--te-datasource-common-border-color-divider); border-radius: 4px; } } diff --git a/packages/plugins/datasource/src/DataSourceRemoteForm.vue b/packages/plugins/datasource/src/DataSourceRemoteForm.vue index fe2f01614..a73936a5c 100644 --- a/packages/plugins/datasource/src/DataSourceRemoteForm.vue +++ b/packages/plugins/datasource/src/DataSourceRemoteForm.vue @@ -84,12 +84,12 @@ export default { diff --git a/packages/plugins/datasource/src/DataSourceTemplate.vue b/packages/plugins/datasource/src/DataSourceTemplate.vue index 8c9a998f1..bf8997957 100644 --- a/packages/plugins/datasource/src/DataSourceTemplate.vue +++ b/packages/plugins/datasource/src/DataSourceTemplate.vue @@ -57,13 +57,13 @@ export default { diff --git a/packages/plugins/datasource/src/styles/vars.less b/packages/plugins/datasource/src/styles/vars.less new file mode 100644 index 000000000..e8f6ebb54 --- /dev/null +++ b/packages/plugins/datasource/src/styles/vars.less @@ -0,0 +1,37 @@ +:root { + --te-datasource-toolbar-icon-color: var(--te-common-text-primary); + --te-datasource-tabs-border-color: var(--te-common-border-default); + --te-datasource-toolbar-breadcrumb-text-color: var(--te-common-text-primary); + --te-datasource-json-border-color: var(--te-common-border-checked); + --te-datasource-tree-border-color: var(--te-common-color-success); + --te-datasource-common-border-color-primary: var(--te-common-border-checked); + --te-datasource-common-border-color-success: var(--te-common-color-success); + --te-datasource-input-icon-color: var(--te-common-text-secondary); + --te-datasource-dialog-demo-border-color: var(--te-common-text-secondary); + --te-datasource-dialog-font-text-color: var(--te-common-text-secondary); + --te-datasource-toolbar-bg-color: var(--te-common-bg-container); + --te-datasource-description-text-color-error: var(--te-common-color-error); + --te-datasource-list-main-text-color: var(--te-common-text-secondary); + --te-datasource-toolbar-more-text-color-hover: var(--te-common-text-weaken); + --te-datasource-delete-button-bg-color-hover: var(--te-common-color-error); + --te-datasource-common-text-color-weaken: var(--te-common-text-weaken); + --te-datasource-common-bg-color-hover: var(--te-common-bg-container); + --te-datasource-common-text-color-primary: var(--te-common-text-primary); + --te-datasource-icon-bg-color-hover: var(--te-common-bg-container); + --te-datasource-common-color-error: var(--te-common-color-error); + --te-datasource-description-text-color-warning: var(--te-common-color-warning); + --te-datasource-error-text-color: var(--te-common-color-error); + --te-datasource-label-text-color: var(--te-common-text-secondary); + --te-datasource-list-text-color-hover: var(--te-common-bg-container); + --te-datasource-modal-text-color: var(--te-common-text-primary); + --te-datasource-respones-bg-color: var(--te-common-bg-primary-checked); + --te-datasource-common-border-color: var(--te-common-border-default); + --te-datasource-box-bg-color: var(--te-common-bg-container); + --te-datasource-tip-text-color: var(--te-common-text-weaken); + --te-datasource-list-item-text-color: var(--te-common-text-primary); + --te-datasource-list-item-icon-color: var(--te-common-icon-secondary); + --te-datasource-list-pager-bg-color: var(--te-common-bg-container); + --te-datasource-common-tip-text-color: var(--te-common-text-weaken); + --te-datasource-common-btn-border-color: var(--te-common-border-secondary); + --te-datasource-common-border-color-divider: var(--te-common-border-divider); +} diff --git a/packages/plugins/help/index.js b/packages/plugins/help/index.js index 377d18c12..430c0bc35 100644 --- a/packages/plugins/help/index.js +++ b/packages/plugins/help/index.js @@ -12,6 +12,7 @@ import metaData from './meta.js' import { HelpService } from './src/composable' +import './src/styles/vars.less' export default { ...metaData, diff --git a/packages/plugins/help/package.json b/packages/plugins/help/package.json index 7f9e9bad9..c2691c349 100644 --- a/packages/plugins/help/package.json +++ b/packages/plugins/help/package.json @@ -1,6 +1,6 @@ { "name": "@opentiny/tiny-engine-plugin-help", - "version": "2.0.0", + "version": "2.2.0", "publishConfig": { "access": "public" }, @@ -34,8 +34,8 @@ "vite": "^5.4.2" }, "peerDependencies": { - "@opentiny/vue": "^3.14.0", - "@opentiny/vue-icon": "^3.14.0", + "@opentiny/vue": "^3.20.0", + "@opentiny/vue-icon": "^3.20.0", "vue": "^3.4.15" } } diff --git a/packages/plugins/help/src/HelpIcon.vue b/packages/plugins/help/src/HelpIcon.vue index bf396e08b..4140ce92f 100644 --- a/packages/plugins/help/src/HelpIcon.vue +++ b/packages/plugins/help/src/HelpIcon.vue @@ -1,7 +1,7 @@