-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: framework agnostic refactor (#914)
- Loading branch information
1 parent
ab61838
commit 9243658
Showing
219 changed files
with
2,969 additions
and
1,388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
'@plait/draw': minor | ||
'@plait/flow': minor | ||
'@plait/mind': minor | ||
--- | ||
|
||
Framework agnostic refactoring: | ||
|
||
1. Use `measureElement` to measure text width and height | ||
|
||
2. Use `text-manage` in `@plait/common` to render text | ||
|
||
3. Provide an overridable method `renderEmoji` in `@plait/mind` to remove the dependency on Angular and transform the response generator | ||
|
||
4. Provide an overridable method `renderLabelIcon` in `@plait/flow` to remove the dependency on Angular and transform the response generator | ||
|
||
--- | ||
|
||
Framework agnostic 改造: | ||
|
||
1. 改用 `measureElement` 测量文本宽高 | ||
|
||
2. 改用 `@plait/common` 中的 `text-manage` 实现文本的渲染 | ||
|
||
3. `@plait/mind` 中提供可重写方法 `renderEmoji` 解除对 Angular 的依赖,并且改造响应 generator | ||
|
||
4. `@plait/flow` 中提供可重写方法 `renderLabelIcon` 解除对 Angular 的依赖,并且改造响应 generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
'@plait/common': minor | ||
'@plait/core': minor | ||
--- | ||
|
||
Framework agnostic refactoring: | ||
|
||
1. Reimplement text-manage in `@plait/common`, and remove the dependency on front-end frameworks such as Angular/React by providing an overridable method renderText | ||
|
||
2. Provide an overridable method renderImage in `@plait/common` | ||
|
||
3. Implement the `measureElement` method based on `canvas`, calculate the width and height of the text in Plait through the `measureText` API of `canvas`, and change all places that originally called `getTextSize` or `measureDivSize` to call `measureElement` | ||
|
||
4. Move the part of `@plait/core` that depends on Angular to `@plait/angular-board` | ||
|
||
--- | ||
|
||
Framework agnostic 改造: | ||
|
||
1. 在 `@plait/common` 中重新实现 text-manage,通过提供可重写方法 renderText 解除和 Angular/React 等前端框架的强依赖 | ||
2. 在 `@plait/common` 中提供可重写方法 renderImage | ||
3. 基于 `canvas` 实现 `measureElement` 方法,通过 `canvas` 的 `measureText` API 计算 Plait 中文本的宽和高,将原本调用 `getTextSize` 或者 `measureDivSize` 的地方全部改为调用 `measureElement` | ||
4. 将 `@plait/core` 中依赖 Angular 的部分移入 `@plait/angular-board` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
'@plait/text-plugins': minor | ||
--- | ||
|
||
`@plait/text-plugins` is a split from the original `@plait/text` package, which mainly contains text-related plugins and general processing required by the Plait framework. `@plait/text-plugins` does not rely on any front-end framework | ||
|
||
--- | ||
|
||
`@plait/text-plugins` 是原本的 `@plait/text` 包拆分出来,主要包含 Plait 框架需要的文本相关的插件和通用处理,`@plait/text-plugins` 不依赖任何前端框架 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@plait/angular-text': minor | ||
--- | ||
|
||
1. Rename package `@plait/text` to `@plait/angular-text` | ||
|
||
2. Move some common processing and plugins into `@plait/text-plugins` | ||
|
||
3. Rename `richtext` component to `text` component | ||
|
||
--- | ||
|
||
1. 将包 `@plait/text` 重命名为 `@plait/angular-text` | ||
|
||
2. 将一些通用处理和插件移入 `@plait/text-plugins` 中 | ||
|
||
3. 将 `richtext` 组件重命名 `text` 组件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
'@plait/angular-board': minor | ||
--- | ||
|
||
Added `@plait/angular-board` package: | ||
|
||
1. Moved the board component from `@plait/core` to `@plait/angular-board`, core no longer depends on the angular framework | ||
2. Provided `renderComponent` method to dynamically render Angular components | ||
3. Implemented `renderText` method to dynamically render text components (angular-text) | ||
4. ... | ||
|
||
|
||
--- | ||
|
||
|
||
新增 `@plait/angular-board` 包: | ||
|
||
1. 将 board 组件从 `@plait/core` 移动到 `@plait/angular-board` 中, core 不再依赖 angular 框架 | ||
2. 提供 `renderComponent` 方法实现动态渲染 Angular 组件 | ||
3. 实现 `renderText` 方法实现动态渲染文本组件(angular-text) | ||
4. ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.