Skip to content

Commit

Permalink
release: 9.0.0 (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Jun 28, 2020
1 parent 4858196 commit 7ffe392
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 40 deletions.
26 changes: 15 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
## [8.0.1](https://github.com/cipchk/ngx-weui/compare/8.0.0...8.0.1) (2019-09-11)
# [9.0.0](https://github.com/cipchk/ngx-weui/compare/8.0.0...9.0.0) (2020-06-28)

`9.0.0` 主要是同步更新 WeUI 的 `2.3` 以上版本(受限于 [#858](https://github.com/Tencent/weui/issues/858) 可能与官网看到的暗黑主题色有出入),新增 `dark` 模式。

更多关于样子优化细节,请参考 WeUI 的 [变更日志](https://github.com/Tencent/weui/edit/master/CHANGELOG.md)

# [8.0.0](https://github.com/cipchk/ngx-weui/compare/7.1.0-rc.2...8.0.0) (2019-05-31)
### 暗黑模式

默认为暗黑系(不清楚 TX 怎么想的),可在 `body` 添加属性 `data-weui-theme` 来控制,值为`light``dark`,例如:


# [7.1.0](https://github.com/cipchk/ngx-weui/compare/7.1.0-rc.2...7.1.0) (2019-05-29)



# [7.1.0-rc.2](https://github.com/cipchk/ngx-weui/compare/7.1.0-rc.1...7.1.0-rc.2) (2019-05-14)

```html
<body data-weui-theme="light">
```

### Bug Fixes

* fix invalid service ([#142](https://github.com/cipchk/ngx-weui/issues/142)) ([a95da21](https://github.com/cipchk/ngx-weui/commit/a95da21))

* 修复多列选择器在 `2.3` 下的适配
* 修复上传组件 `FileItem.index` 始终为 `0`
* 修复日期组件选择后出现 `Cannot read property 'target' of undefined`
* 修复滚动加载组件未重置滚动位置,导致重复加载数据
* 修复滚动加载设置完全完毕依然持续 `loadin` 效果

### Breaking Changes

* **weui-button** 移除 `plain` 属性,可直接使用默认来代替
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ NGX-WEUI

## Version

- WeUI 1.x using `7.0.x`
- WeUI 2.x using `8.0.x` & Angular 8
- WeUI `1.x` using `7.0.x`
- WeUI `<= 2.2` using `8.x` & Angular 8
- WeUI `>= 2.3` using `9.x` & Angular 9, Support dark & light theme

## Table of Contents

Expand Down
27 changes: 12 additions & 15 deletions components/schematics/shell/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { addPackageToPackageJson } from '../utils/package';
import { Schema } from './schema';
import { addThemeToAppStyles } from './theming';

export default function(options: Schema): Rule {
export default function (options: Schema): Rule {
return chain([
options && options.skipPackageJson ? noop() : addWeUIToPackageJson(),
addThemeToAppStyles(options),
Expand All @@ -31,7 +31,7 @@ function addWeUIRootConfig(options: Schema) {
const workspace = getWorkspace(host);
const project = getProjectFromWorkspace(workspace, options.project);

addModuleImportToRootModule(host, 'WeUiModule', 'ngx-weui', project);
addModuleImportToRootModule(host, 'ButtonModule', 'ngx-weui/button', project);

return host;
};
Expand All @@ -50,19 +50,16 @@ function addAnimationRootConfig(options: Schema) {
}

const appHTML = `<div style="text-align:center; padding: 8px;">
<h1>
ngx-weui
</h1>
<p>
ngx-weui 是 WeUI 的 Angular 版本,
WeUI
是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。
</p>
<p>
</p>
<div style="margin-top: 16px;">
<button weui-button>Button</button>
</div>
<h1>
NGX-WEUI
</h1>
<p>
<a href="https://github.com/weui/weui" target="_blank">WeUI</a> for angular,
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
</p>
<div style="margin-top: 16px;">
<button weui-button>Button</button>
</div>
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-weui",
"version": "8.0.1",
"version": "9.0.0",
"description": "WeUI for angular",
"repository": {
"type": "git",
Expand Down
24 changes: 14 additions & 10 deletions scripts/build/generate-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ function compileLess(content, savePath, min) {
const plugins = [];
if (min) {
const cleanCSSPlugin = new LessPluginCleanCSS({
advanced: true
advanced: true,
});
plugins.push(cleanCSSPlugin);
}
return less.render
.call(less, content, {
plugins
plugins,
})
.then(({
css
}) => {
.then(({ css }) => {
fs.writeFileSync(savePath, css);
resolve();
})
.catch(err => reject(err));
.catch(err => {
console.error(err);
reject(err);
});
});
}

Expand All @@ -35,14 +36,17 @@ let componentsStyleContent = '@import "./style/theme.less";\n';
fse.copySync(`${sourcePath}/style`, `${targetPath}/style`);
targetFolder.forEach(dir => {
if (fs.existsSync(`${sourcePath}/${dir}/style/index.less`)) {
componentsStyleContent += `@import "./${dir}/style/index.less";\n`
componentsStyleContent += `@import "./${dir}/style/index.less";\n`;
fse.copySync(`${sourcePath}/${dir}/style`, `${targetPath}/${dir}/style`);
}
})
});

const savePath = path.resolve(__dirname, '../../publish/');
fs.writeFileSync(path.join(savePath, 'index.less'), componentsStyleContent);

const lessContent = `@import "${savePath}/index.less";`;
const lessContent = `
@import "${path.join(__dirname, '../../node_modules/weui/src/style/base/variable/color.less')}";
@import "${savePath}/index.less";
`;
compileLess(lessContent, path.join(savePath, 'index.css'), false).then().catch();
compileLess(lessContent, path.join(savePath, 'index.min.css'), true).then().catch();
compileLess(lessContent, path.join(savePath, 'index.min.css'), true).then().catch();
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="shortcut icon" href="./favicon.ico" />
</head>

<body ontouchstart data-weui-theme="light">
<body ontouchstart>
<app-root>
<div style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; font-size: 12px;">
Loading...
Expand Down

0 comments on commit 7ffe392

Please sign in to comment.