diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43f1c52..db5d75d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,28 +15,28 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm i yarn -g - - run: yarn - - run: yarn run build - - run: mv dist canvas-editor - - name: Copy folder content recursively to remote - uses: garygrossgarten/github-action-scp@release - with: - local: canvas-editor - remote: ${{ secrets.PATH }} - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - rmRemote: true - - name: Executing remote ssh commands - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - script: sed -i 's/<\/body>/${{ secrets.SCRIPT }}<\/body>/g' ${{ secrets.PATH }}/index.html + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm i yarn -g + - run: yarn + - run: yarn run build + - run: mv dist canvas-editor + - name: Copy folder content recursively to remote + uses: appleboy/scp-action@v0.1.7 + with: + source: canvas-editor + target: ${{ secrets.PATH }} + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + overwrite: true + - name: Executing remote ssh commands + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + script: sed -i 's/<\/body>/${{ secrets.SCRIPT }}<\/body>/g' ${{ secrets.PATH }}/canvas-editor/index.html diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c8f9b74..215cd4a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,7 @@ on: push: branches: [main] paths: + - '.github/workflows/docs.yml' - 'docs/**' jobs: @@ -11,21 +12,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm i yarn -g - - run: yarn - - run: yarn run docs:build - - run: mv ./docs/.vitepress/dist ./docs/.vitepress/canvas-editor-docs - - name: Copy folder content recursively to remote - uses: garygrossgarten/github-action-scp@release - with: - local: ./docs/.vitepress/canvas-editor-docs - remote: ${{ secrets.DOCS_PATH }} - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - rmRemote: true + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm i yarn -g + - run: yarn + - run: yarn run docs:build + - run: mv ./docs/.vitepress/dist ./docs/.vitepress/canvas-editor-docs + - name: Copy folder content recursively to remote + uses: appleboy/scp-action@v0.1.7 + with: + source: docs/.vitepress/canvas-editor-docs + target: ${{ secrets.DOCS_PATH }} + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + overwrite: true + strip_components: 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index f54e074..31e030b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +## [0.9.85](https://github.com/Hufe921/canvas-editor/compare/v0.9.84...v0.9.85) (2024-07-07) + + +### Bug Fixes + +* custom override method removes support for asynchronous #672 ([0e705d6](https://github.com/Hufe921/canvas-editor/commit/0e705d6a0bdb0922efd5c47edd8ca9eba9964199)), closes [#672](https://github.com/Hufe921/canvas-editor/issues/672) +* set control highlight and re render #678 ([24df9d3](https://github.com/Hufe921/canvas-editor/commit/24df9d3b006a8daf795ada677bfd0159e3ccc3f5)), closes [#678](https://github.com/Hufe921/canvas-editor/issues/678) + + +### Chores + +* update build.yml ([a40441d](https://github.com/Hufe921/canvas-editor/commit/a40441dc3994a41ae29c341a542be6e0e7dada2e)) + + +### Features + +* add render mode #667 ([affd191](https://github.com/Hufe921/canvas-editor/commit/affd1911552a73a2b63a13f2c423121637830b99)), closes [#667](https://github.com/Hufe921/canvas-editor/issues/667) +* add title deletable property #670 ([b3d8413](https://github.com/Hufe921/canvas-editor/commit/b3d8413b35050eac626af1c57beaaf1b8d692a0e)), closes [#670](https://github.com/Hufe921/canvas-editor/issues/670) +* insert element boundary optimization #669 ([de44bd6](https://github.com/Hufe921/canvas-editor/commit/de44bd68ab01e5ffa8d6a8dc5d566b0cdb8d08e6)), closes [#669](https://github.com/Hufe921/canvas-editor/issues/669) + + +### Tests + +* update text test case ([c24da73](https://github.com/Hufe921/canvas-editor/commit/c24da737b15200775a7d4a5edf4e2224f6ec5429)) + + + ## [0.9.84](https://github.com/Hufe921/canvas-editor/compare/v0.9.83...v0.9.84) (2024-06-30) diff --git a/cypress/e2e/menus/text.cy.ts b/cypress/e2e/menus/text.cy.ts index e75b0da..3c8eeb5 100644 --- a/cypress/e2e/menus/text.cy.ts +++ b/cypress/e2e/menus/text.cy.ts @@ -33,7 +33,7 @@ describe('菜单-文本处理', () => { .then(() => { const data = editor.command.getValue().data.main - expect(data[0].font).to.eq('宋体') + expect(data[0].font).to.eq('华文宋体') }) }) }) diff --git a/docs/en/guide/command-execute.md b/docs/en/guide/command-execute.md index e285dcd..7b0cd77 100644 --- a/docs/en/guide/command-execute.md +++ b/docs/en/guide/command-execute.md @@ -932,6 +932,16 @@ Usage: instance.command.executeLocationControl(controlId: string) ``` +## executeInsertControl + +Feature: Insert control + +Usage: + +```javascript +instance.command.executeInsertControl(payload: IElement) +``` + ## executeUpdateOptions Feature: Update options diff --git a/docs/en/guide/option.md b/docs/en/guide/option.md index ff76b45..1b27863 100644 --- a/docs/en/guide/option.md +++ b/docs/en/guide/option.md @@ -43,6 +43,7 @@ interface IEditorOption { marginIndicatorColor?: string // The margin indicator color. default: #BABABA margins?: IMargin // Page margins. default: [100, 120, 100, 120] pageMode?: PageMode // Paper mode: Linkage, Pagination. default: Pagination + renderMode?: RenderMode // Render mode: speed(multi words combination rendering), compatibility(word by word rendering:avoid environmental differences such as browse,fonts...). default: speed defaultHyperlinkColor?: string // Default hyperlink color. default: #0000FF table?: ITableOption // table configuration {tdPadding?:IPadding; defaultTrMinHeight?:number; defaultColMinWidth?:number} header?: IHeader // Header information.{top?:number; maxHeightRadio?:MaxHeightRatio;} diff --git a/docs/en/guide/schema.md b/docs/en/guide/schema.md index 682dd59..e9fe133 100644 --- a/docs/en/guide/schema.md +++ b/docs/en/guide/schema.md @@ -154,7 +154,10 @@ interface IElement { }; // title level?: TitleLevel; - title?: ITitle; + title?: { + conceptId?: string; + deletable?: boolean; + }; // list listType?: ListType; listStyle?: ListStyle; diff --git a/docs/guide/command-execute.md b/docs/guide/command-execute.md index e37ca9d..edd3da2 100644 --- a/docs/guide/command-execute.md +++ b/docs/guide/command-execute.md @@ -932,6 +932,16 @@ instance.command.executeSetControlHighlight(payload: ISetControlHighlightOption) instance.command.executeLocationControl(controlId: string) ``` +## executeInsertControl + +功能:插入控件 + +用法: + +```javascript +instance.command.executeInsertControl(payload: IElement) +``` + ## executeUpdateOptions 功能:修改配置 diff --git a/docs/guide/option.md b/docs/guide/option.md index 3ec3abb..b3158e7 100644 --- a/docs/guide/option.md +++ b/docs/guide/option.md @@ -43,6 +43,7 @@ interface IEditorOption { marginIndicatorColor?: string // 页边距指示器颜色。默认:#BABABA margins?: IMargin // 页面边距。默认:[100, 120, 100, 120] pageMode?: PageMode // 纸张模式:连页、分页。默认:分页 + renderMode?: RenderMode // 渲染模式:极速(多个字组合渲染)、兼容(逐字渲染:避免浏览器字体等环境差异)。默认:极速 defaultHyperlinkColor?: string // 默认超链接颜色。默认:#0000FF table?: ITableOption // 表格配置。{tdPadding?:IPadding; defaultTrMinHeight?:number; defaultColMinWidth?:number} header?: IHeader // 页眉信息。{top?:number; maxHeightRadio?:MaxHeightRatio;} diff --git a/docs/guide/schema.md b/docs/guide/schema.md index 8965300..11c5c55 100644 --- a/docs/guide/schema.md +++ b/docs/guide/schema.md @@ -154,7 +154,10 @@ interface IElement { }; // 标题 level?: TitleLevel; - title?: ITitle; + title?: { + conceptId?: string; + deletable?: boolean; + }; // 列表 listType?: ListType; listStyle?: ListStyle; diff --git a/index.html b/index.html index 1b4fbad..e3d64ce 100644 --- a/index.html +++ b/index.html @@ -32,11 +32,10 @@