Compare commits

..

117 Commits

Author SHA1 Message Date
cb0cfdeb4d fix: npm version 2022-11-25 17:44:42 +08:00
bdba8cef5c chore(release): release 16 packages [skip ci]
[@antv/x6@2.0.3](https://github.com/antvis/X6/releases/tag/%40antv/x6%402.0.3)

[@antv/x6-geometry@2.0.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-geometry%402.0.2)

[@antv/x6-plugin-clipboard@2.1.1](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-clipboard%402.1.1)

[@antv/x6-plugin-dnd@2.0.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-dnd%402.0.2)

[@antv/x6-plugin-export@2.1.1](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-export%402.1.1)

[@antv/x6-plugin-history@2.1.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-history%402.1.2)

[@antv/x6-plugin-keyboard@2.1.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-keyboard%402.1.2)

[@antv/x6-plugin-minimap@2.0.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-minimap%402.0.2)

[@antv/x6-plugin-scroller@2.0.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-scroller%402.0.2)

[@antv/x6-plugin-selection@2.1.3](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-selection%402.1.3)

[@antv/x6-plugin-snapline@2.1.3](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-snapline%402.1.3)

[@antv/x6-plugin-stencil@2.0.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-stencil%402.0.2)

[@antv/x6-plugin-transform@2.1.1](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-transform%402.1.1)

[@antv/x6-react-components@2.0.4](https://github.com/antvis/X6/releases/tag/%40antv/x6-react-components%402.0.4)

[@antv/x6-react-shape@2.0.3](https://github.com/antvis/X6/releases/tag/%40antv/x6-react-shape%402.0.3)

[@antv/x6-vue-shape@2.0.3](https://github.com/antvis/X6/releases/tag/%40antv/x6-vue-shape%402.0.3)
2022-11-25 09:27:28 +00:00
6c4244c747 chore: ignore build 2022-11-25 17:06:13 +08:00
e6a1a71932 chore: disable publish to npm 2022-11-25 17:01:54 +08:00
7d64596767 chore: disable breaking changes 2022-11-25 16:11:46 +08:00
54725040f2 fix: type errors 2022-11-25 15:12:22 +08:00
a2a2e657e9 chore: disable breaking changes 2022-11-25 15:11:02 +08:00
593416d8d9 docs: update homepage of packages 2022-11-25 14:34:56 +08:00
96fc0d79cb chore: remove "gitHead" field 2022-11-25 14:34:56 +08:00
85aa3c82ca chore(release): release 3 packages [skip ci]
[@antv/x6-plugin-keyboard@2.1.1](https://www.npmjs.com/package/@antv/x6-plugin-keyboard/v/2.1.1)
[@antv/x6-plugin-keyboard@2.1.1](https://github.com/antvis/X6/releases/tag/%40antv/x6-plugin-keyboard%402.1.1)

[@antv/x6-react-components@2.0.3](https://www.npmjs.com/package/@antv/x6-react-components/v/2.0.3)
[@antv/x6-react-components@2.0.3](https://github.com/antvis/X6/releases/tag/%40antv/x6-react-components%402.0.3)

[@antv/x6-react-shape@2.0.2](https://www.npmjs.com/package/@antv/x6-react-shape/v/2.0.2)
[@antv/x6-react-shape@2.0.2](https://github.com/antvis/X6/releases/tag/%40antv/x6-react-shape%402.0.2)
2022-11-25 06:25:01 +00:00
f20127af55 perf: update deps 2022-11-25 14:00:58 +08:00
f275d3df1e chore: combine release commits 2022-11-25 14:00:01 +08:00
3a1f34ecfd chore: do not release with "ci" and "chore" commits 2022-11-25 14:00:01 +08:00
279caf5173 chore(release): @antv/x6-react-components@2.0.3 [skip ci] 2022-11-24 14:19:16 +00:00
2dcf5d2461 chore(release): @antv/x6-plugin-selection@2.1.2 [skip ci] 2022-11-24 14:19:14 +00:00
d83837d85a chore(release): @antv/x6-plugin-history@2.1.1 [skip ci] 2022-11-24 14:19:10 +00:00
41a64aa1d8 chore(release): @antv/x6@2.0.2 [skip ci] 2022-11-24 14:19:07 +00:00
d4df46ab40 fix: update react type version () 2022-11-24 22:09:33 +08:00
f448f72417 docs: update antd to v5 for demos () 2022-11-24 21:04:58 +08:00
557d2df152 fix: get correct center when zoom () 2022-11-24 19:29:01 +08:00
5edd9ba5f2 chore: update CONTRIBUTORS [skip ci] 2022-11-24 08:23:49 +00:00
bfd1103fd4 chore: update contributors [skip ci] 2022-11-24 08:17:04 +00:00
75f42978cb fix: deep clone instead of shallow clone ()
Co-authored-by: Qinghui.Liu <Qinghui.Liu@fanruan.com>
2022-11-24 16:16:25 +08:00
2ecc213094 fix: support antd5 in react components () 2022-11-24 16:16:06 +08:00
16c19e0591 chore: fix git committer name 2022-11-24 15:34:34 +08:00
02d95cfeea docs: update deps for sites demo () 2022-11-24 15:33:09 +08:00
602fcfa0ed chore(release): @antv/x6-vue-shape@2.0.2 [skip ci] 2022-11-24 07:25:28 +00:00
4be1397374 chore(release): @antv/x6-react-components@2.0.2 [skip ci] 2022-11-24 07:25:25 +00:00
e326d8beb9 chore(release): @antv/x6-plugin-snapline@2.1.2 [skip ci] 2022-11-24 07:25:21 +00:00
d6ae5199c0 fix: updae react-resize-detector version () 2022-11-24 15:12:31 +08:00
97e758fee6 chore: config pnpm workspace 2022-11-24 14:38:01 +08:00
fabd9d5ed9 chore: enable npm publish 2022-11-24 14:31:00 +08:00
08a38bfabd chore(release): @antv/x6-plugin-snapline@2.1.1 [skip ci] 2022-11-24 06:10:43 +00:00
a6055a2b89 chore(release): @antv/x6-example-features@2.0.0 [skip ci] 2022-11-24 06:10:20 +00:00
083948a040 chore(release): @antv/x6-plugin-selection@2.1.1 [skip ci] 2022-11-24 06:10:00 +00:00
bc261fb992 fix: modify the semantics of filter () 2022-11-24 13:58:11 +08:00
33a2ba2c04 chore(release): @antv/x6-vue-shape@2.0.1 [skip ci] 2022-11-24 04:22:15 +00:00
40d26f87c2 chore(release): @antv/x6-react-shape@2.0.1 [skip ci] 2022-11-24 04:22:12 +00:00
f901d2c149 chore(release): @antv/x6-react-components@2.0.1 [skip ci] 2022-11-24 04:22:09 +00:00
da99354379 chore(release): @antv/x6-plugin-transform@2.1.0 [skip ci] 2022-11-24 04:22:06 +00:00
28111565fa chore(release): @antv/x6-plugin-stencil@2.0.1 [skip ci] 2022-11-24 04:22:03 +00:00
85308db9a0 chore(release): @antv/x6-plugin-snapline@2.1.0 [skip ci] 2022-11-24 04:22:01 +00:00
b58ced43f6 chore(release): @antv/x6-plugin-selection@2.1.0 [skip ci] 2022-11-24 04:21:58 +00:00
9b6c5420aa chore(release): @antv/x6-plugin-scroller@2.0.1 [skip ci] 2022-11-24 04:21:55 +00:00
6fc0344552 chore(release): @antv/x6-plugin-minimap@2.0.1 [skip ci] 2022-11-24 04:21:53 +00:00
86fed91719 chore(release): @antv/x6-plugin-keyboard@2.1.0 [skip ci] 2022-11-24 04:21:50 +00:00
2ceee7d067 chore(release): @antv/x6-plugin-history@2.1.0 [skip ci] 2022-11-24 04:21:48 +00:00
a4a1b37413 chore(release): @antv/x6-plugin-export@2.1.0 [skip ci] 2022-11-24 04:21:45 +00:00
14acda8f4b chore(release): @antv/x6-plugin-dnd@2.0.1 [skip ci] 2022-11-24 04:21:42 +00:00
8af0f1c676 chore(release): @antv/x6-plugin-clipboard@2.1.0 [skip ci] 2022-11-24 04:21:40 +00:00
58853d9ac2 chore(release): @antv/x6-common@2.0.1 [skip ci] 2022-11-24 04:21:37 +00:00
7551e782c1 chore(release): @antv/x6@2.0.1 [skip ci] 2022-11-24 04:21:34 +00:00
662f138fca chore(release): @antv/x6-geometry@2.0.1 [skip ci] 2022-11-24 04:21:32 +00:00
f6001a4619 docs: add performance demos () 2022-11-24 12:12:05 +08:00
e0e7e2d80f fix: input required and not supplied: GITHUB_TOKEN 2022-11-23 14:13:03 +08:00
8d19fbc868 chore: use wow-actions/use-app-token v2 2022-11-23 13:58:53 +08:00
5cd3809859 fix: add execute permission 2022-11-23 13:53:38 +08:00
847f225632 feat: add exportSVG methods () 2022-11-18 15:50:10 +08:00
826ccdd9a0 fix: export snap methods from snapline () 2022-11-18 13:47:06 +08:00
cee4aa4e53 fix: resize graph when scale scroller () 2022-11-18 10:31:02 +08:00
4c87e47847 docs: update demos for plugins () 2022-11-18 09:51:16 +08:00
f2be4b3570 chore: update CONTRIBUTORS [skip ci] 2022-11-17 02:29:54 +00:00
febf71b6a6 docs: optimize demos for plugins () 2022-11-17 10:23:06 +08:00
9eae1a304f chore: update CONTRIBUTORS [skip ci] 2022-11-15 13:10:00 +00:00
7526379684 chore: update contributors [skip ci] 2022-11-15 13:02:12 +00:00
ee4ed4053f docs: function 'addCells()' is undefined. () () 2022-11-15 21:01:53 +08:00
047692f4f8 chore: update contributors [skip ci] 2022-11-15 13:01:34 +00:00
53a3f63aca docs: add demos for websites ()
* docs: add interacting demo

* docs: add serialization demo

* docs: add tools demo

* docs: add html render demo

* docs: add demos for react render

* docs: add demo for vue node
2022-11-15 21:01:11 +08:00
853b35fbfb docs: update docs ()
* docs: add get-started demo

* docs: add docs for graph

* docs: add docs for node

* docs: add docs for edge

* docs: update demos

* docs: update docs directory
2022-11-14 09:46:44 +08:00
bb9e560fd5 chore: updae deps for demos () 2022-11-12 15:52:08 +08:00
86412e23d2 fix: optimize typo for react-shape () 2022-11-12 11:44:25 +08:00
1f1e5bc8b2 chore: update deps version for demos () 2022-11-11 09:42:46 +08:00
774f547b85 feat: attach plugin api and events to grpah instance ()
* feat: attach api and event to graph for clipboard

* feat: attach export api and event to graph instance

* feat: attach history api and event to graph instance

* feat: attach keyboard api to graph instance

* feat: attach selection api and events to graph instance

* feat: attach snapline api and events to graph instance

* feat: attach transform events to graph instance
2022-11-10 20:24:27 +08:00
2194769e36 fix: sync render when change position () 2022-11-09 16:21:16 +08:00
e68315528a fix: add missing script for building style 2022-11-09 14:52:56 +08:00
6e7fa9d602 chore: config rss 2022-11-09 14:11:05 +08:00
1f42ecda5e chore: forbidden push to master with whitelist 2022-11-09 14:10:18 +08:00
b450a467ce chore: update build cache 2022-11-09 13:58:03 +08:00
189352a09c chore: update devdeps 2022-11-08 17:01:54 +08:00
4f3e589988 refactor: put rss scripts into root package.json 2022-11-08 17:01:53 +08:00
b59ff6916c refactor: remove unused methods 2022-11-08 17:01:53 +08:00
30c6a522f5 chore: update CONTRIBUTORS [skip ci] 2022-11-08 05:03:56 +00:00
4edee83946 chore: update contributors [skip ci] 2022-11-08 04:56:22 +00:00
10347d069b fix: Cannot use "this" here: () 2022-11-08 12:56:04 +08:00
d9d68d182e chore: remove unused util methdos 2022-11-07 17:50:19 +08:00
3ef671c223 refactor: remove unused methods 2022-11-07 12:00:16 +08:00
45185ed50a docs: fix url of embeded CONTRIBUTORS.svg 2022-11-07 11:59:40 +08:00
5295ecc957 chore: update commit message of update contributor 2022-11-07 10:00:02 +08:00
ea92193494 chore: let's start v2
clean changelogs
2022-11-07 09:33:09 +08:00
8806adc673 docs: sync doc from v1.0 () 2022-11-05 21:30:56 +08:00
09e8dfda8b chore(release): @antv/x6-vue-shape@2.0.0 [skip ci] 2022-11-05 13:25:25 +00:00
1283b74cdb chore: update deps
bump  packages/x6-vue-shape to 2.0

BREAKING CHANGE: for bump  packages/x6-vue-shape to 2.0
2022-11-05 21:18:15 +08:00
c075db4822 chore(release): @antv/x6-vue-shape@1.1.0 [skip ci] 2022-11-05 12:47:24 +00:00
2727cab039 chore(release): @antv/x6-react-shape@2.0.0 [skip ci] 2022-11-05 12:47:21 +00:00
c2f5c75b2b chore(release): @antv/x6-react-components@2.0.0 [skip ci] 2022-11-05 12:47:17 +00:00
148807ce4f chore(release): @antv/x6-plugin-transform@2.0.0 [skip ci] 2022-11-05 12:47:14 +00:00
a01f71730d chore(release): @antv/x6-plugin-stencil@2.0.0 [skip ci] 2022-11-05 12:47:10 +00:00
af7993deda chore(release): @antv/x6-plugin-snapline@2.0.0 [skip ci] 2022-11-05 12:47:07 +00:00
f130b41659 chore(release): @antv/x6-plugin-selection@2.0.0 [skip ci] 2022-11-05 12:47:03 +00:00
ef505fd8cf chore(release): @antv/x6-plugin-scroller@2.0.0 [skip ci] 2022-11-05 12:47:00 +00:00
d028dbfa3e chore(release): @antv/x6-plugin-minimap@2.0.0 [skip ci] 2022-11-05 12:46:57 +00:00
9cad409a98 chore(release): @antv/x6-plugin-keyboard@2.0.0 [skip ci] 2022-11-05 12:46:53 +00:00
41cbeb189c chore(release): @antv/x6-plugin-history@2.0.0 [skip ci] 2022-11-05 12:46:50 +00:00
08d4cd0b38 chore(release): @antv/x6-plugin-export@2.0.0 [skip ci] 2022-11-05 12:46:46 +00:00
69f39ba526 chore(release): @antv/x6-plugin-clipboard@2.0.0 [skip ci] 2022-11-05 12:46:43 +00:00
8f91c96631 chore(release): @antv/x6-geometry@2.0.0 [skip ci] 2022-11-05 12:46:40 +00:00
c3600b642f chore(release): @antv/x6-common@2.0.0 [skip ci] 2022-11-05 12:46:36 +00:00
dc0f905824 chore(release): @antv/x6@2.0.0 [skip ci] 2022-11-05 12:46:33 +00:00
aede9b3ee2 chore(release): @antv/x6-plugin-dnd@2.0.0 [skip ci] 2022-11-05 12:46:29 +00:00
44f89a1e1a docs: refresh changelogs
force dump to 2.0

BREAKING CHANGE: dump to 2.0
2022-11-05 20:36:16 +08:00
6448ec31a8 chore(release): @antv/x6-plugin-minimap@1.0.2 [skip ci] 2022-11-05 12:25:57 +00:00
d704d7fb03 chore: update deps 2022-11-05 20:16:02 +08:00
bcc3fb5f50 chore: disable srm on v1 2022-11-05 20:07:32 +08:00
c5a71dee65 chore(release): @antv/x6-plugin-keyboard@1.0.2 [skip ci] 2022-11-05 11:58:50 +00:00
6b112db109 chore: enable breaking changes 2022-11-05 19:51:35 +08:00
6c82b21f9e chore: config branches 2022-11-05 17:08:37 +08:00
79e0fac6e4 chore: release from v2.0 2022-11-05 16:27:00 +08:00
1099 changed files with 11633 additions and 40898 deletions
.github/workflows
.husky
.releasercCONTRIBUTORSCONTRIBUTORS.svgREADME.md
examples/x6-example-features
package.json
packages
pnpm-lock.yamlpnpm-workspace.yaml
scripts
sites
x6-sites-demos-helper
x6-sites-demos
package.json
packages
api
graph
registry
attr
background
connection-point/playground
connector
edge-anchor/playground
edge-tool
anchor
arrowhead
boundary
button-remove
button
custom-arrowhead
custom-vertices
segments
vertices
filter
grid
node-anchor/playground
node-tool
boundary
button-remove
button
custom-button
editor
port-label-layout
port-layout
router
ui
auto-scrollbox/basic
color-picker/basic
contextmenu/basic
dropdown/basic
menu/basic
menubar/basic
scrollbox/basic
splitbox/basic
toolbar/basic
performance
scene/sankey
tutorial
advanced
basic
background/playground/src
dnd/stencil/src
edge
connector
custom-marker
labels/src
native-marker
router
style/src
vertices
events/custom-click
graph
grid/playground
group
embed-edge/src
embedding
inside
outside
restrict/src
interacting
mousewheel/playground
node
port
scroller/playground
selection/playground
serialization
snapline/playground
getting-started
intermediate
attrs
connection-point/multi
custom-edge/custom-edge
custom-node/custom-node
edge-labels
events
group
html
interacting
marker
react
serialization
tools
vue
plugins
x6-sites
x6-svg-to-shape
turbo.json

@ -8,13 +8,12 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/auto-close-fixed-issues@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
comment: |
This issue was closed by #{{ pr }}.

@ -4,11 +4,10 @@ jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -8,12 +8,12 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/auto-assign@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
CONFIG_FILE: .github/workflows/config/auto-assign.yml

@ -1,27 +0,0 @@
name: 🚀 Create Release Branch
on:
push:
branches:
- master
jobs:
crb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
echo "${{ github.sha }}" > .releasing
- uses: wow-actions/use-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: peter-evans/create-pull-request@v4
with:
token: ${{ env.bot_token }}
branch: semantic-release
commit-message: "trigger semantic release..."
delete-branch: true
labels: semantic-release
title: "chore: semantic release [skip ci]"
body: |
Your **[semantic-release-monorepo](https://github.com/bubkoo/semantic-release-monorepo)** bot base on **[semantic-release](https://github.com/semantic-release/semantic-release)** :package::rocket:`

@ -6,14 +6,14 @@ name: 🚫 Delete Stale Releases
# clean:
# runs-on: ubuntu-latest
# steps:
# - uses: wow-actions/use-app-token@v1
# - uses: wow-actions/use-app-token@v2
# with:
# app_id: ${{ secrets.APP_ID }}
# private_key: ${{ secrets.PRIVATE_KEY }}
# env_name: bot_token
#
# - uses: wow-actions/delete-stale-releases@v1
# with:
# GITHUB_TOKEN: ${{ env.bot_token }}
# GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
# delete_tags: true
# keep_latest_count: 3
# group: '(?!^)@.*$'
@ -36,13 +36,13 @@ jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/delete-stale-releases@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
delete_tags: true
keep_latest_count: -1
keep_latest_count: -1

@ -56,11 +56,11 @@ jobs:
run: pnpm run test
- name: 🔑 Generate Token
uses: wow-actions/use-app-token@v1
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- name: 💡 Codecov
uses: codecov/codecov-action@v1
@ -72,20 +72,20 @@ jobs:
- name: 🔀 Dispatch(ci_passed)
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ env.bot_token }}
token: ${{ env.BOT_TOKEN }}
event-type: ci_passed
- name: 🔀 Dispatch(ci_pr_passed)
if: github.event_name == 'pull_request_target'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ env.bot_token }}
token: ${{ env.BOT_TOKEN }}
event-type: ci_pr_passed
- name: 🔀 Dispatch(ci_master_passed)
if: github.event_name == 'push'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ env.bot_token }}
token: ${{ env.BOT_TOKEN }}
event-type: ci_master_passed

@ -6,11 +6,11 @@ jobs:
cib:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: robvanderleek/create-issue-branch@main
env:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -64,15 +64,15 @@ jobs:
run: yarn build:sites
- name: 🔑 Generate Token
uses: wow-actions/use-app-token@v1
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- name:  Deploy sites
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ env.bot_token }}
github_token: ${{ env.BOT_TOKEN }}
publish_dir: ./sites/x6-sites/public
publish_branch: gh-pages

@ -8,12 +8,12 @@ jobs:
cmd:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/label-commands@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
CONFIG_FILE: .github/workflows/config/label-commands.yml

@ -6,14 +6,14 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: dessant/lock-threads@v2
with:
github-token: ${{ env.bot_token }}
github-token: ${{ env.BOT_TOKEN }}
issue-lock-inactive-days: 365
issue-lock-comment: |
This thread has been automatically locked because it has not had recent activity.

@ -8,13 +8,13 @@ jobs:
evaluate:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/needs-more-info@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
CONFIG_FILE: .github/workflows/config/needs-more-info.yml

@ -6,11 +6,11 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/potential-duplicates@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -6,13 +6,13 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: TimonVS/pr-labeler-action@v3
with:
configuration-path: .github/workflows/config/pr-label-branch-name.yml
env:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -4,12 +4,12 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: actions/labeler@v2
with:
repo-token: ${{ env.bot_token }}
repo-token: ${{ env.BOT_TOKEN }}
configuration-path: .github/workflows/config/pr-label-file-paths.yml

@ -4,12 +4,12 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: pascalgn/size-label-action@v0.4.3
env:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
IGNORED: "!.gitignore\nyarn.lock\npnpm-lock.yaml"

@ -9,12 +9,12 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/pr-triage@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
WORKFLOW-ID: ${{ github.event.workflow_run.id }}

@ -11,15 +11,15 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: Naturalclar/issue-action@v2.0.1
with:
title-or-body: title
github-token: ${{ env.bot_token }}
github-token: ${{ env.BOT_TOKEN }}
parameters: >
[
{

@ -69,17 +69,17 @@ jobs:
run: yarn build:sites
- name: 🔑 Generate Token
uses: wow-actions/use-app-token@v1
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- name:  Deploy Sites
uses: afc163/surge-preview@v1
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ env.bot_token }}
github_token: ${{ env.BOT_TOKEN }}
build: |
echo Create sites preview
dist: sites/x6-sites/public

@ -10,11 +10,11 @@ jobs:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: cirrus-actions/rebase@master
env:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -51,33 +51,25 @@ jobs:
# run: pnpm run test
- name: 🔑 Generate Token
uses: wow-actions/use-app-token@v1
uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- name: 📦 Semantic Release
run: pnpm srm --debug --comment-footer 'Thanks for being a part of the [AntV](https://github.com/antvis) community! 💪💯'
run: pnpm srm --debug --combine-commits --comment-footer 'Thanks for being a part of the [AntV](https://github.com/antvis) community! 💪💯'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ env.bot_token }}
GIT_AUTHOR_NAME: x6-bot
GIT_AUTHOR_EMAIL: x6-bot@users.noreply.github.com
GIT_COMMITTER_NAME: x6-bot
GIT_COMMITTER_EMAIL: x6-bot@users.noreply.github.com
# - uses: actions/github-script@v6
# with:
# github-token: ${{ env.bot_token }}
# script: |
# const action = require('./scripts/finalize-release.js')
# return await action({github, context, core})
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
GIT_AUTHOR_NAME: ${{ env.BOT_NAME }}[bot]
GIT_AUTHOR_EMAIL: ${{ env.BOT_NAME }}[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: ${{ env.BOT_NAME }}[bot]
GIT_COMMITTER_EMAIL: ${{ env.BOT_NAME }}[bot]@users.noreply.github.com
- name: 🔀 Repository Dispatch
if: github.ref == 'refs/heads/master'
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ env.bot_token }}
token: ${{ env.BOT_TOKEN }}
event-type: released

@ -6,11 +6,11 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/activity-report@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -6,11 +6,11 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/activity-report@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}

@ -6,12 +6,12 @@ jobs:
cmd:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/slash-commands@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
CONFIG_FILE: .github/workflows/config/slash-commands.yml

@ -6,14 +6,14 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: actions/stale@v3
with:
repo-token: ${{ env.bot_token }}
repo-token: ${{ env.BOT_TOKEN }}
stale-issue-message: |
Hiya!

@ -9,13 +9,13 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
with:
manifest: .github/workflows/config/labels.yml

@ -14,13 +14,14 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/update-authors@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
path: CONTRIBUTORS
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
bots: false
path: CONTRIBUTORS
commit: 'chore: update CONTRIBUTORS [skip ci]'

@ -13,12 +13,12 @@ jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/contributors-list@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
excludeUsers: semantic-release-bot ImgBotApp

@ -9,11 +9,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: FantasticFiasco/action-update-license-year@v2
with:
token: ${{ env.bot_token }}
token: ${{ env.BOT_TOKEN }}

@ -8,14 +8,14 @@ jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/use-app-token@v1
- uses: wow-actions/use-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
env_name: bot_token
- uses: wow-actions/welcome@v1
with:
GITHUB_TOKEN: ${{ env.bot_token }}
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
FIRST_ISSUE: |
👋 @{{ author }}

14
.husky/pre-push Executable file

@ -0,0 +1,14 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
branch="$(git rev-parse --abbrev-ref HEAD)"
user="$(git config user.name)"
whitelist=("bubkoo" "NewByVector")
if [[ ! " ${whitelist[@]} " =~ " ${user} " ]]; then
if [ "$branch" = "master" ]; then
echo "Push to master branch is forbidden."
echo "Checkout your owne branch then submit a pr."
exit 1
fi
fi

@ -1,4 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
./scripts/pre-push-check

@ -12,13 +12,17 @@
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{ "revert": true, "release": "patch" },
{ "type": "feat", "release": "minor" },
{ "type": "build", "release": "patch" },
{ "type": "ci", "release": "patch" },
{ "type": "chore", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "refactor", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "style", "release": "patch" },
{ "type": "test", "release": "patch" }
{ "type": "test", "release": "patch" },
{ "type": "refactor", "release": "patch" },
{ "type": "ci", "release": false },
{ "type": "chore", "release": false },
{ "scope": "no-release", "release": false }
]
}
],

@ -17,6 +17,7 @@ Limbo <49612796+JUST-Limbo@users.noreply.github.com>
Lixu <37231473+wflixu@users.noreply.github.com>
Lloyd <ho>
Lyn <47809781+lyn-boyu@users.noreply.github.com>
MOMO <329053928@qq.com>
Mingfei <az8641683@163.com>
MrMengJ <2646973632@qq.com>
Naveen <172697+naveensrinivasan@users.noreply.github.com>
@ -73,6 +74,7 @@ x6-bot <x6-bot@users.noreply.github.com>
xrkffgg <xrkffgg@gmail.com>
yaojin2070 <48686959+yaojin2070@users.noreply.github.com>
zdc1111 <39116292+zdc1111@users.noreply.github.com>
€alix <qq287649920@gmail.com>
九思⚡⚡⚡ <2228429150@qq.com>
何腾飞 <avrin.live.cn@outlook.com>
偏右 <afc163@gmail.com>
@ -80,9 +82,11 @@ zdc1111 <39116292+zdc1111@users.noreply.github.com>
崖 <bubkoo.wy@gmail.com>
崖崖崖 <bubkoo.wy@gmail.com>
文瑀 <wenyu.jqq@antfin.com>
映月 <38279397+orientMoon@users.noreply.github.com>
杨凌 <89915256@qq.com>
柏愚 <boyu.zlj@antfin.com>
粑粑超 <842486229@qq.com>
诸岳 <dengfuping_private@163.com>
金强强 <wenyu.jqq@antfin.com>
问崖 <bubkoo.wy@gmail.com>
问崖 <pengxingjian.pxj@antfin.com>

File diff suppressed because one or more lines are too long

Before

(image error) Size: 9.7 MiB

After

(image error) Size: 11 MiB

@ -111,9 +111,10 @@ pnpm run start
如果希望参与到 X6 的开发中,请遵从我们的[贡献指南](/CONTRIBUTING.zh-CN.md)。如果你贡献度足够活跃,你可以申请成为社区协作者。
<a href="https://github.com/antvis/x6/graphs/contributors">
<img src="/CONTRIBUTORS.svg" alt="Contributors" width="740" />
<img src="https://raw.githubusercontent.com/antvis/X6/master/CONTRIBUTORS.svg" alt="Contributors" />
</a>
## 开源协议
该项目的代码和文档基于 [MIT License](/LICENSE) 开源协议。

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
{
"private": true,
"name": "@antv/x6-example-features",
"version": "1.0.0",
"version": "2.0.0",
"scripts": {
"start": "umi dev",
"build": "umi build",
@ -9,20 +9,20 @@
"precommit": "lint-staged"
},
"dependencies": {
"@antv/x6": "1.0.0",
"@antv/x6-plugin-clipboard": "1.0.0",
"@antv/x6-plugin-dnd": "1.0.0",
"@antv/x6-plugin-history": "1.0.0",
"@antv/x6-plugin-keyboard": "1.0.0",
"@antv/x6-plugin-minimap": "1.0.0",
"@antv/x6-plugin-scroller": "1.0.0",
"@antv/x6-plugin-selection": "1.0.0",
"@antv/x6-plugin-snapline": "1.0.0",
"@antv/x6-plugin-stencil": "1.0.0",
"@antv/x6-plugin-transform": "1.0.0",
"@antv/x6-plugin-export": "1.0.0",
"@antv/x6-react-components": "1.0.0",
"@antv/x6-react-shape": "1.0.0",
"@antv/x6": "^2.x",
"@antv/x6-plugin-clipboard": "^2.x",
"@antv/x6-plugin-dnd": "^2.x",
"@antv/x6-plugin-history": "^2.x",
"@antv/x6-plugin-keyboard": "^2.x",
"@antv/x6-plugin-minimap": "^2.x",
"@antv/x6-plugin-scroller": "^2.x",
"@antv/x6-plugin-selection": "^2.x",
"@antv/x6-plugin-snapline": "^2.x",
"@antv/x6-plugin-stencil": "^2.x",
"@antv/x6-plugin-transform": "^2.x",
"@antv/x6-plugin-export": "^2.x",
"@antv/x6-react-components": "^2.x",
"@antv/x6-react-shape": "^2.x",
"antd": "^4.4.2",
"classnames": "^2.2.6",
"dagre": "^0.8.5",

@ -13,7 +13,7 @@ export default class Example extends React.Component {
private minimapContainer: HTMLDivElement
private scroller: Scroller
private selection: Selection
private exportObj: Export
private exportInstance: Export
componentDidMount() {
this.graph = new Graph({
@ -55,12 +55,12 @@ export default class Example extends React.Component {
height: 200,
padding: 10,
})
this.exportObj = new Export()
this.exportInstance = new Export()
this.graph.use(this.scroller)
this.graph.use(this.selection)
this.graph.use(minimap)
this.graph.use(this.exportObj)
this.graph.use(this.exportInstance)
const rect = this.graph.addNode({
shape: 'rect',
@ -122,7 +122,7 @@ export default class Example extends React.Component {
}
onDownload = () => {
this.exportObj.exportPNG('scroller')
this.exportInstance.exportPNG('scroller')
}
render() {

@ -2,7 +2,7 @@
"name": "x6",
"private": true,
"scripts": {
"preinstall": "node ./scripts/preinstall.js",
"preinstall": "node ./scripts/preinstall",
"lint:ts": "eslint '**/src/**/*.{js,ts}?(x)' --fix",
"lint:style": "stylelint '**/src/**/*.less' --syntax less --fix",
"lint": "run-s lint:ts lint:style",
@ -10,17 +10,43 @@
"pretty-quick": "pretty-quick",
"test": "turbo run test --filter=./packages/*",
"build": "turbo run build --filter=./packages/*",
"build:cjs": "turbo run build:cjs --filter=./packages/*",
"build:esm": "turbo run build:esm --filter=./packages/*",
"build:dev": "turbo run build:dev --filter=./packages/*",
"build:umd": "turbo run build:umd --filter=./packages/*",
"build:demos": "sh ./scripts/build-demos",
"build:sites": "sh ./scripts/build-sites",
"update:deps": "pnpm update --interactive --latest --recursive",
"clean:turbo": "pnpm -r --if-present --parallel --filter=./packages/* run clean:turbo",
"clean:build": "pnpm -r --if-present --parallel --filter=./packages/* run clean",
"clean:modules": "pnpm -r --parallel exec rimraf node_modules && rimraf node_modules",
"clean": "run-s clean:build clean:modules",
"clean": "run-s clean:build clean:turbo clean:modules",
"update:deps": "pnpm update --interactive --latest --recursive",
"setup:husky": "husky install .husky",
"prepare": "is-ci || run-p setup:husky build:dev"
},
"rss": {
"clean:turbo": "rimraf .turbo",
"clean:build": "rimraf dist es lib",
"clean:coverage": "rimraf ./test/coverage",
"clean": "run-p clean:**",
"build:less": {
"file": "./scripts/build-less"
},
"build:esm": "tsc --module esnext --target es6 --outDir ./es",
"build:cjs": "tsc --module commonjs --target es6 --outDir ./lib",
"build:umd": "pnpm run --if-present build:less && rollup -c ../../rollup.config.js --bundleConfigAsCjs",
"build:dev": "pnpm run --if-present build:less && run-p -s build:cjs build:esm",
"build:watch": "run-s -s build:watch:esm",
"build:watch:esm": "run-s -s 'build:esm -w'",
"build:watch:cjs": "run-s -s 'build:cjs -w'",
"build": "run-p -s build:dev build:umd",
"prebuild": "run-s -s clean:build",
"test": {
"file": "./scripts/run-test"
},
"coveralls": "cat ./test/coverage/lcov.info | coveralls",
"pretest": "run-s -s clean:coverage"
},
"lint-staged": {
"*": [
"prettier --write --ignore-unknown"
@ -63,45 +89,44 @@
}
},
"dependencies": {
"@antv/x6-build-tools": "workspace:*",
"@babel/core": "^7.19.6",
"@babel/core": "^7.20.2",
"@babel/plugin-syntax-flow": "^7.18.6",
"@babel/plugin-transform-react-jsx": "^7.19.0",
"@commitlint/config-conventional": "^17.2.0",
"@commitlint/config-conventional": "^17.3.0",
"@rollup/plugin-commonjs": "^23.0.2",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-typescript": "^8.2.5",
"@semantic-release-monorepo/cli": "^1.0.28",
"@semantic-release-monorepo/cli": "^2.1.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/jasmine": "^4.3.0",
"@types/jest": "^29.2.1",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@types/sinon": "^10.0.2",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"boxen": "^7.0.0",
"colors": "^1.4.0",
"coveralls": "^3.1.1",
"eslint": "^8.26.0",
"eslint": "^8.28.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^27.1.3",
"eslint-plugin-jest": "^27.1.6",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-unicorn": "^44.0.2",
"eslint-plugin-unicorn": "^45.0.0",
"fs-extra": "^10.0.0",
"husky": "^8.0.1",
"is-ci": "^3.0.0",
"jasmine-core": "^4.5.0",
"jest": "^29.2.2",
"jest": "^29.3.1",
"karma": "^6.3.4",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
@ -112,20 +137,21 @@
"less": "^4.1.1",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.6",
"prettier": "^2.4.0",
"postcss": "^8.4.19",
"prettier": "^2.8.0",
"pretty-quick": "^3.1.1",
"rimraf": "^3.0.2",
"rollup": "^3.2.5",
"rollup": "^3.4.0",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-filesize": "^9.1.1",
"rollup-plugin-postcss": "^4.0.1",
"rollup-plugin-progress": "^1.1.2",
"rollup-plugin-terser": "^7.0.2",
"run-shared-scripts": "^1.1.4",
"semantic-release": "^19.0.5",
"sinon": "^14.0.1",
"stylelint": "^14.14.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint": "^14.15.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-standard": "^29.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.4.0",
@ -134,6 +160,6 @@
"ts-node": "^10.2.1",
"tslib": "^2.4.1",
"turbo": "^1.6.3",
"typescript": "^4.4.3"
"typescript": "^4.9.3"
}
}

@ -1,170 +1 @@
## @antv/x6-common [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-common@1.0.0...@antv/x6-common@1.0.1) (2022-11-05)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
# @antv/x6-common 1.0.0 (2022-11-05)
### Bug Fixes
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* ✨ add css method for dom ([#1959](https://github.com/antvis/x6/issues/1959)) ([e8fbcd8](https://github.com/antvis/x6/commit/e8fbcd83fd07b5d2df0abe020fc8e2481332c1b2))
* ✨ add dom data methods ([#1969](https://github.com/antvis/x6/issues/1969)) ([d1eb01c](https://github.com/antvis/x6/commit/d1eb01c491b5509686d0affa8f84fc6438673d80))
* ✨ add dom event to replace jquery event ([#1929](https://github.com/antvis/x6/issues/1929)) ([68c143b](https://github.com/antvis/x6/commit/68c143babf20f84ab7b76aada1794131c49860b2))
* ✨ add events module in common ([#1932](https://github.com/antvis/x6/issues/1932)) ([c1d0fc1](https://github.com/antvis/x6/commit/c1d0fc188e62a8e420ff03512f38c11c5c50a9ba))
* ✨ add minimap plugin ([6cdecbb](https://github.com/antvis/x6/commit/6cdecbbba9a4db1f67189e23fb89f2a7ba2af99e))
* ✨ add panning and mousewheel module ([#2243](https://github.com/antvis/x6/issues/2243)) ([55d36e4](https://github.com/antvis/x6/commit/55d36e46808a4c79b086d7798bce396d5211a1dc))
* ✨ add selection plugin ([#2742](https://github.com/antvis/x6/issues/2742)) ([50a5dc7](https://github.com/antvis/x6/commit/50a5dc7cd8c2e39a1f8bf8359a0eb189dda8cb86))
* ✨ add version.ts ([#1981](https://github.com/antvis/x6/issues/1981)) ([aee3666](https://github.com/antvis/x6/commit/aee3666da25025b7ca284134521d6c6cd7f8edbc))
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* ✨ improve auto-resize feature ([40d5335](https://github.com/antvis/x6/commit/40d53355cedc0bbbeb1e26948b67254dc6a40d85))
* ✨ improve scroller plugin ([#2667](https://github.com/antvis/x6/issues/2667)) ([25b238f](https://github.com/antvis/x6/commit/25b238fd0bd289c0175f0cb1282233cb3badbc20))
* ✨ init x6-core repo ([#1954](https://github.com/antvis/x6/issues/1954)) ([d7cfb6a](https://github.com/antvis/x6/commit/d7cfb6af19fc021ad197a8bed187d927a81d7dfa))
* ✨ put animation in x6-common ([#2411](https://github.com/antvis/x6/issues/2411)) ([f1c80a8](https://github.com/antvis/x6/commit/f1c80a8cd75efe1def32168b6acff90ece5723ba))
* ✨ remove jquery deps in x6-core ([#1971](https://github.com/antvis/x6/issues/1971)) ([38c6fd6](https://github.com/antvis/x6/commit/38c6fd69922b3db7eb938f55a8c29f8226edbed1))
* add scheduler for render nodes to improve performance ([#2044](https://github.com/antvis/x6/issues/2044)) ([57a50a9](https://github.com/antvis/x6/commit/57a50a9dec2b9dbe04f51972a1eebd7a98c116e0))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support mouseenter and mouseleave event ([#2559](https://github.com/antvis/x6/issues/2559)) ([ecfd426](https://github.com/antvis/x6/commit/ecfd4263b1266a128bf8651c4dd745ff8ab038b3))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
* sync code from master ([#2004](https://github.com/antvis/x6/issues/2004)) ([c681405](https://github.com/antvis/x6/commit/c68140504bd21f654870f3d2fc1ad2f16f1113c8)), closes [#1974](https://github.com/antvis/x6/issues/1974) [#1977](https://github.com/antvis/x6/issues/1977) [#1985](https://github.com/antvis/x6/issues/1985) [#1988](https://github.com/antvis/x6/issues/1988) [#1991](https://github.com/antvis/x6/issues/1991) [#1989](https://github.com/antvis/x6/issues/1989)
### Performance Improvements
* ⚡️ optimize breakText for a high performance version ([#2242](https://github.com/antvis/x6/issues/2242)) ([0aced58](https://github.com/antvis/x6/commit/0aced58056d908ec092bca1889b5ef367a94fe68))
* ⚡️ repalce getTransformToElement and getBBox to improve performance ([#2177](https://github.com/antvis/x6/issues/2177)) ([1436586](https://github.com/antvis/x6/commit/1436586f85cc2e2f6ec71548f6d6c232be793154))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* force bump to 2.0
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
# @antv/x6-common 1.0.0 (2022-11-04)
### Features
* ✨ add css method for dom ([#1959](https://github.com/antvis/x6/issues/1959)) ([e8fbcd8](https://github.com/antvis/x6/commit/e8fbcd83fd07b5d2df0abe020fc8e2481332c1b2))
* ✨ add dom data methods ([#1969](https://github.com/antvis/x6/issues/1969)) ([d1eb01c](https://github.com/antvis/x6/commit/d1eb01c491b5509686d0affa8f84fc6438673d80))
* ✨ add dom event to replace jquery event ([#1929](https://github.com/antvis/x6/issues/1929)) ([68c143b](https://github.com/antvis/x6/commit/68c143babf20f84ab7b76aada1794131c49860b2))
* ✨ add events module in common ([#1932](https://github.com/antvis/x6/issues/1932)) ([c1d0fc1](https://github.com/antvis/x6/commit/c1d0fc188e62a8e420ff03512f38c11c5c50a9ba))
* ✨ add minimap plugin ([6cdecbb](https://github.com/antvis/x6/commit/6cdecbbba9a4db1f67189e23fb89f2a7ba2af99e))
* ✨ add panning and mousewheel module ([#2243](https://github.com/antvis/x6/issues/2243)) ([55d36e4](https://github.com/antvis/x6/commit/55d36e46808a4c79b086d7798bce396d5211a1dc))
* ✨ add selection plugin ([#2742](https://github.com/antvis/x6/issues/2742)) ([50a5dc7](https://github.com/antvis/x6/commit/50a5dc7cd8c2e39a1f8bf8359a0eb189dda8cb86))
* ✨ add version.ts ([#1981](https://github.com/antvis/x6/issues/1981)) ([aee3666](https://github.com/antvis/x6/commit/aee3666da25025b7ca284134521d6c6cd7f8edbc))
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* ✨ improve auto-resize feature ([40d5335](https://github.com/antvis/x6/commit/40d53355cedc0bbbeb1e26948b67254dc6a40d85))
* ✨ improve scroller plugin ([#2667](https://github.com/antvis/x6/issues/2667)) ([25b238f](https://github.com/antvis/x6/commit/25b238fd0bd289c0175f0cb1282233cb3badbc20))
* ✨ init x6-core repo ([#1954](https://github.com/antvis/x6/issues/1954)) ([d7cfb6a](https://github.com/antvis/x6/commit/d7cfb6af19fc021ad197a8bed187d927a81d7dfa))
* ✨ put animation in x6-common ([#2411](https://github.com/antvis/x6/issues/2411)) ([f1c80a8](https://github.com/antvis/x6/commit/f1c80a8cd75efe1def32168b6acff90ece5723ba))
* ✨ remove jquery deps in x6-core ([#1971](https://github.com/antvis/x6/issues/1971)) ([38c6fd6](https://github.com/antvis/x6/commit/38c6fd69922b3db7eb938f55a8c29f8226edbed1))
* add scheduler for render nodes to improve performance ([#2044](https://github.com/antvis/x6/issues/2044)) ([57a50a9](https://github.com/antvis/x6/commit/57a50a9dec2b9dbe04f51972a1eebd7a98c116e0))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support mouseenter and mouseleave event ([#2559](https://github.com/antvis/x6/issues/2559)) ([ecfd426](https://github.com/antvis/x6/commit/ecfd4263b1266a128bf8651c4dd745ff8ab038b3))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
* sync code from master ([#2004](https://github.com/antvis/x6/issues/2004)) ([c681405](https://github.com/antvis/x6/commit/c68140504bd21f654870f3d2fc1ad2f16f1113c8)), closes [#1974](https://github.com/antvis/x6/issues/1974) [#1977](https://github.com/antvis/x6/issues/1977) [#1985](https://github.com/antvis/x6/issues/1985) [#1988](https://github.com/antvis/x6/issues/1988) [#1991](https://github.com/antvis/x6/issues/1991) [#1989](https://github.com/antvis/x6/issues/1989)
### Performance Improvements
* ⚡️ optimize breakText for a high performance version ([#2242](https://github.com/antvis/x6/issues/2242)) ([0aced58](https://github.com/antvis/x6/commit/0aced58056d908ec092bca1889b5ef367a94fe68))
* ⚡️ repalce getTransformToElement and getBBox to improve performance ([#2177](https://github.com/antvis/x6/issues/2177)) ([1436586](https://github.com/antvis/x6/commit/1436586f85cc2e2f6ec71548f6d6c232be793154))
### BREAKING CHANGES
* force bump to 2.0
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
# @antv/x6-common [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-common@1.0.0...@antv/x6-common@2.0.0) (2022-11-04)
### Bug Fixes
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
### chore
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
### BREAKING CHANGES
* force bump to 2.0
* bump to 2.0
* force bump to 2.0.0
# @antv/x6-common [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-common@1.0.0...@antv/x6-common@2.0.0) (2022-11-04)
### Bug Fixes
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
### chore
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
### BREAKING CHANGES
* force bump to 2.0
* bump to 2.0
* force bump to 2.0.0
# @antv/x6-common [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-common@1.0.0...@antv/x6-common@2.0.0) (2022-11-04)
### Bug Fixes
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
### chore
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
### BREAKING CHANGES
* force bump to 2.0
* bump to 2.0
* force bump to 2.0.0
## @antv/x6-common [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-common@2.0.0...@antv/x6-common@2.0.1) (2022-11-24)

@ -1,6 +1,6 @@
{
"name": "@antv/x6-common",
"version": "1.0.1",
"version": "2.0.3",
"description": "Basic toolkit for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -48,7 +48,7 @@
"email": "vectorse@126.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -1,25 +0,0 @@
import sinon from 'sinon'
import { Dom } from '../../dom'
describe('af', () => {
describe('#requestAnimationFrame', () => {
it('should call the callback', (done) => {
Dom.requestAnimationFrame(() => {
expect(1).toEqual(1)
done()
})
})
})
describe('#cancelAnimationFrame', () => {
it('requestAnimationFrame can be cancel', (done) => {
const spy = sinon.spy()
const id = Dom.requestAnimationFrame(spy)
Dom.cancelAnimationFrame(id)
setTimeout(() => {
expect(spy.callCount).toEqual(0)
done()
}, 100)
})
})
})

@ -151,72 +151,4 @@ describe('FunctionExt', () => {
expect(spy.calledWith(1, '2', true, obj, reg, arr, 'more')).toBeTruthy()
})
})
describe('#cacher', () => {
it('shoule cache function results with same args', () => {
let counter = 0
const raw = (a: number, b: number) => {
counter += 1
return a + b
}
const fn = FunctionExt.cacher(raw)
const ret1 = fn(1, 2)
expect(counter).toBe(1)
const ret2 = fn(1, 2)
expect(counter).toBe(1)
expect(ret1).toBe(ret2)
fn(2, 3)
expect(counter).toBe(2)
})
it('shoule remove cache when reach the max cache count', () => {
let counter = 0
const raw = (a: number, b: number) => {
counter += 1
return a + b
}
const fn = FunctionExt.cacher(raw)
fn(1, 2)
expect(counter).toBe(1)
for (let i = 0; i < 1000; i += 1) {
fn(i, i)
}
fn(1, 2)
expect(counter).toBe(1002)
})
it('shoule cache function with specified context', () => {
const ctx = {}
const spy = sinon.spy()
const fn = FunctionExt.cacher(spy, ctx)
fn()
expect(spy.calledOn(ctx)).toBeTruthy()
})
it('shoule return result processed by post processor', () => {
let counter = 0
const raw = (a: number, b: number) => {
counter += 1
return a + b
}
const processor = (v: number, hasCache: boolean) => {
return hasCache ? -v : v
}
const fn = FunctionExt.cacher(raw, {}, processor)
const ret1 = fn(1, 2)
const ret2 = fn(1, 2)
expect(counter).toBe(1)
expect(ret1).toBe(3)
expect(ret2).toBe(-3)
})
})
})

@ -1,92 +0,0 @@
import { JSONArray, JSONExt, JSONObject, JSONPrimitive } from '../../json'
describe('JSONExt', () => {
describe('isPrimitive()', () => {
it('should return `true` if the value is a primitive', () => {
expect(JSONExt.isPrimitive(null)).toEqual(true)
expect(JSONExt.isPrimitive(false)).toEqual(true)
expect(JSONExt.isPrimitive(true)).toEqual(true)
expect(JSONExt.isPrimitive(1)).toEqual(true)
expect(JSONExt.isPrimitive('1')).toEqual(true)
})
it('should return `false` if the value is not a primitive', () => {
expect(JSONExt.isPrimitive([])).toEqual(false)
expect(JSONExt.isPrimitive({})).toEqual(false)
})
})
describe('isArray()', () => {
it('should test whether a JSON value is an array', () => {
expect(JSONExt.isArray([])).toEqual(true)
expect(JSONExt.isArray(null)).toEqual(false)
expect(JSONExt.isArray(1)).toEqual(false)
})
})
describe('isObject()', () => {
it('should test whether a JSON value is an object', () => {
expect(JSONExt.isObject({ a: 1 })).toEqual(true)
expect(JSONExt.isObject({})).toEqual(true)
expect(JSONExt.isObject([])).toEqual(false)
expect(JSONExt.isObject(1)).toEqual(false)
})
})
describe('deepEqual()', () => {
it('should compare two JSON values for deep equality', () => {
expect(JSONExt.deepEqual([], [])).toEqual(true)
expect(JSONExt.deepEqual([1], [1])).toEqual(true)
expect(JSONExt.deepEqual({}, {})).toEqual(true)
expect(JSONExt.deepEqual({ a: [] }, { a: [] })).toEqual(true)
expect(JSONExt.deepEqual({ a: { b: null } }, { a: { b: null } })).toEqual(
true,
)
expect(JSONExt.deepEqual({ a: '1' }, { a: '1' })).toEqual(true)
expect(JSONExt.deepEqual({ a: { b: null } }, { a: { b: '1' } })).toEqual(
false,
)
expect(JSONExt.deepEqual({ a: [] }, { a: [1] })).toEqual(false)
expect(JSONExt.deepEqual([1], [1, 2])).toEqual(false)
expect(JSONExt.deepEqual(null, [1, 2])).toEqual(false)
expect(JSONExt.deepEqual([1], {})).toEqual(false)
expect(JSONExt.deepEqual([1], [2])).toEqual(false)
expect(JSONExt.deepEqual({}, { a: 1 })).toEqual(false)
expect(JSONExt.deepEqual({ b: 1 }, { a: 1 })).toEqual(false)
})
})
describe('deepCopy()', () => {
it('should deep copy an object', () => {
const v1: JSONPrimitive = null
const v2: JSONPrimitive = true
const v3: JSONPrimitive = false
const v4: JSONPrimitive = 'foo'
const v5: JSONPrimitive = 42
const v6: JSONArray = [1, 2, 3, [4, 5, 6], { a: 12, b: [4, 5] }, false]
const v7: JSONObject = { a: false, b: [null, [1, 2]], c: { a: 1 } }
const r1 = JSONExt.deepCopy(v1)
const r2 = JSONExt.deepCopy(v2)
const r3 = JSONExt.deepCopy(v3)
const r4 = JSONExt.deepCopy(v4)
const r5 = JSONExt.deepCopy(v5)
const r6 = JSONExt.deepCopy(v6)
const r7 = JSONExt.deepCopy(v7)
expect(v1).toEqual(r1)
expect(v2).toEqual(r2)
expect(v3).toEqual(r3)
expect(v4).toEqual(r4)
expect(v5).toEqual(r5)
expect(v6).toEqual(r6)
expect(v7).toEqual(r7)
expect(v6).toEqual(r6)
expect(v6[3]).not.toBe(r6[3])
expect(v6[4]).not.toBe(r6[4])
expect((v6[4] as JSONObject).b).not.toBe((r6[4] as JSONObject).b)
expect(v7).toEqual(r7)
expect(v7.b).not.toBe(r7.b)
expect((v7.b as JSONArray)[1]).not.toBe((r7.b as JSONArray)[1])
expect(v7.c).not.toBe(r7.c)
})
})
})

@ -1,63 +0,0 @@
export const requestAnimationFrame = (function () {
let raf
const win = window as any
if (win != null) {
raf =
win.requestAnimationFrame ||
win.webkitRequestAnimationFrame ||
win.mozRequestAnimationFrame ||
win.oRequestAnimationFrame ||
win.msRequestAnimationFrame
if (raf != null) {
raf = raf.bind(win)
}
}
if (raf == null) {
let lastTime = 0
raf = (callback: FrameRequestCallback) => {
const currTime = new Date().getTime()
const timeToCall = Math.max(0, 16 - (currTime - lastTime))
const id = setTimeout(() => {
callback(currTime + timeToCall)
}, timeToCall)
lastTime = currTime + timeToCall
return id
}
}
return raf as (callback: FrameRequestCallback) => number
})()
export const cancelAnimationFrame = (function () {
let caf
const win = window as any
if (win != null) {
caf =
win.cancelAnimationFrame ||
win.webkitCancelAnimationFrame ||
win.webkitCancelRequestAnimationFrame ||
win.msCancelAnimationFrame ||
win.msCancelRequestAnimationFrame ||
win.oCancelAnimationFrame ||
win.oCancelRequestAnimationFrame ||
win.mozCancelAnimationFrame ||
win.mozCancelRequestAnimationFrame
if (caf) {
caf = caf.bind(win)
}
}
if (caf == null) {
caf = clearTimeout
}
return caf as (handle: number) => void
})()

@ -33,7 +33,7 @@ export function addClass(
}
if (typeof selector === 'string' && elem.nodeType === 1) {
const classes = selector.match(rnotwhite) || []
const classes: string[] = selector.match(rnotwhite) || []
const oldValue = fillSpaces(getClass(elem)).replace(rclass, ' ')
let newValue = classes.reduce((memo, cls) => {
if (memo.indexOf(fillSpaces(cls)) < 0) {
@ -63,7 +63,7 @@ export function removeClass(
}
if ((!selector || typeof selector === 'string') && elem.nodeType === 1) {
const classes = (selector || '').match(rnotwhite) || []
const classes: string[] = (selector || '').match(rnotwhite) || []
const oldValue = fillSpaces(getClass(elem)).replace(rclass, ' ')
let newValue = classes.reduce((memo, cls) => {
const className = fillSpaces(cls)

@ -1,4 +1,3 @@
export * from './af'
export * from './attr'
export * from './elem'
export * from './class'

@ -144,8 +144,8 @@ function calculateDY(
case 'bottom':
dy = -(0.25 * llMaxFont) - rLineHeights
break
default:
case 'top':
default:
dy = 0.8 * flMaxFont
break
}

@ -1,4 +1,4 @@
export { debounce, defer } from 'lodash-es'
export { debounce } from 'lodash-es'
type Fn = (...args: any[]) => any
@ -46,38 +46,3 @@ export function call<T extends Fn>(
): ReturnType<T> {
return apply(fn, ctx, args)
}
function repush<T>(array: T[], item: T) {
for (let i = 0, ii = array.length; i < ii; i += 1) {
if (array[i] === item) {
return array.push(array.splice(i, 1)[0])
}
}
}
export function cacher<T extends Fn>(
fn: T,
ctx?: ThisParameterType<T>,
postProcessor?: (v: any, hasCache?: boolean) => any,
): T {
const keys: string[] = []
const cache: { [kry: string]: any } = {}
const f = (...args: Parameters<T>) => {
let hasCache = false
const key = args.join('\u2400')
if (key in cache) {
hasCache = true
repush(keys, key)
} else {
if (keys.length >= 1000) {
delete cache[keys.shift()!]
}
keys.push(key)
cache[key] = apply(fn, ctx || (null as ThisParameterType<T>), args)
}
return postProcessor ? postProcessor(cache[key], hasCache) : cache[key]
}
return f as T
}

@ -8,7 +8,6 @@ export * from './number'
export * from './function'
export * from './platform'
export * from './text'
export * from './json'
export * from './datauri'
export * from './unit'
export * from './dom'

@ -1,262 +0,0 @@
/**
* A type alias for a JSON primitive.
*/
export type JSONPrimitive = boolean | number | string | null | undefined
/**
* A type alias for a JSON value.
*/
export type JSONValue = JSONPrimitive | JSONObject | JSONArray
/**
* A type definition for a JSON object.
*/
export interface JSONObject {
[key: string]: JSONValue
}
/**
* A type definition for a JSON array.
*/
export interface JSONArray extends Array<JSONValue> {}
/**
* A type definition for a readonly JSON object.
*/
export interface ReadonlyJSONObject {
readonly [key: string]: ReadonlyJSONValue
}
/**
* A type definition for a readonly JSON array.
*/
export interface ReadonlyJSONArray extends ReadonlyArray<ReadonlyJSONValue> {}
/**
* A type alias for a readonly JSON value.
*/
export type ReadonlyJSONValue =
| JSONPrimitive
| ReadonlyJSONObject
| ReadonlyJSONArray
/**
* The namespace for JSON-specific functions.
*/
export namespace JSONExt {
/**
* A shared frozen empty JSONObject
*/
export const emptyObject = Object.freeze({}) as ReadonlyJSONObject
/**
* A shared frozen empty JSONArray
*/
export const emptyArray = Object.freeze([]) as ReadonlyJSONArray
/**
* Test whether a JSON value is a primitive.
*
* @param value - The JSON value of interest.
*
* @returns `true` if the value is a primitive,`false` otherwise.
*/
export function isPrimitive(
value: ReadonlyJSONValue,
): value is JSONPrimitive {
return (
value === null ||
value === undefined ||
typeof value === 'boolean' ||
typeof value === 'number' ||
typeof value === 'string'
)
}
/**
* Test whether a JSON value is an array.
*
* @param value - The JSON value of interest.
*
* @returns `true` if the value is a an array, `false` otherwise.
*/
export function isArray(value: JSONValue): value is JSONArray
export function isArray(value: ReadonlyJSONValue): value is ReadonlyJSONArray
export function isArray(value: ReadonlyJSONValue): boolean {
return Array.isArray(value)
}
/**
* Test whether a JSON value is an object.
*
* @param value - The JSON value of interest.
*
* @returns `true` if the value is a an object, `false` otherwise.
*/
export function isObject(value: JSONValue): value is JSONObject
export function isObject(
value: ReadonlyJSONValue,
): value is ReadonlyJSONObject
export function isObject(value: ReadonlyJSONValue): boolean {
return !isPrimitive(value) && !isArray(value)
}
/**
* Compare two JSON values for deep equality.
*
* @param first - The first JSON value of interest.
*
* @param second - The second JSON value of interest.
*
* @returns `true` if the values are equivalent, `false` otherwise.
*/
export function deepEqual(
first: ReadonlyJSONValue,
second: ReadonlyJSONValue,
): boolean {
// Check referential and primitive equality first.
if (first === second) {
return true
}
// If one is a primitive, the `===` check ruled out the other.
if (isPrimitive(first) || isPrimitive(second)) {
return false
}
// Test whether they are arrays.
const a1 = isArray(first)
const a2 = isArray(second)
// Bail if the types are different.
if (a1 !== a2) {
return false
}
// If they are both arrays, compare them.
if (a1 && a2) {
return deepArrayEqual(
first as ReadonlyJSONArray,
second as ReadonlyJSONArray,
)
}
// At this point, they must both be objects.
return deepObjectEqual(
first as ReadonlyJSONObject,
second as ReadonlyJSONObject,
)
}
/**
* Create a deep copy of a JSON value.
*
* @param value - The JSON value to copy.
*
* @returns A deep copy of the given JSON value.
*/
export function deepCopy<T extends ReadonlyJSONValue>(value: T): T {
// Do nothing for primitive values.
if (isPrimitive(value)) {
return value
}
// Deep copy an array.
if (isArray(value)) {
return deepArrayCopy(value)
}
// Deep copy an object.
return deepObjectCopy(value)
}
/**
* Compare two JSON arrays for deep equality.
*/
function deepArrayEqual(
first: ReadonlyJSONArray,
second: ReadonlyJSONArray,
): boolean {
// Check referential equality first.
if (first === second) {
return true
}
// Test the arrays for equal length.
if (first.length !== second.length) {
return false
}
// Compare the values for equality.
for (let i = 0, n = first.length; i < n; i += 1) {
if (!deepEqual(first[i], second[i])) {
return false
}
}
// At this point, the arrays are equal.
return true
}
/**
* Compare two JSON objects for deep equality.
*/
function deepObjectEqual(
first: ReadonlyJSONObject,
second: ReadonlyJSONObject,
): boolean {
// Check referential equality first.
if (first === second) {
return true
}
// Check for the first object's keys in the second object.
// eslint-disable-next-line
for (const key in first) {
if (!(key in second)) {
return false
}
}
// Check for the second object's keys in the first object.
// eslint-disable-next-line
for (const key in second) {
if (!(key in first)) {
return false
}
}
// Compare the values for equality.
// eslint-disable-next-line
for (const key in first) {
if (!deepEqual(first[key], second[key])) {
return false
}
}
// At this point, the objects are equal.
return true
}
/**
* Create a deep copy of a JSON array.
*/
function deepArrayCopy(value: any): any {
const result = new Array<any>(value.length) // eslint-disable-line
for (let i = 0, n = value.length; i < n; i += 1) {
result[i] = deepCopy(value[i])
}
return result
}
/**
* Create a deep copy of a JSON object.
*/
function deepObjectCopy(value: any): any {
const result: any = {}
Object.keys(value).forEach((key) => {
result[key] = deepCopy(value[key])
})
return result
}
}

@ -1,4 +1,4 @@
export { template, uniqueId } from 'lodash-es'
export { uniqueId } from 'lodash-es'
export * from './format'
export * from './hashcode'

@ -1,27 +1,75 @@
export type Nilable<T> = T | null | undefined
export interface PointLike {
x: number
y: number
}
export type PointData = [number, number]
export interface Translation {
tx: number
ty: number
}
export interface Rotation {
angle: number
cx?: number
cy?: number
}
export interface Scale {
sx: number
sy: number
}
export interface Size {
width: number
height: number
}
export type Nilable<T> = T | null | undefined
export interface KeyValue<T extends any = any> {
export interface KeyValue<T = any> {
[key: string]: T
}
/**
* A type alias for a JSON primitive.
*/
export type JSONPrimitive = boolean | number | string | null | undefined
/**
* A type alias for a JSON value.
*/
export type JSONValue = JSONPrimitive | JSONObject | JSONArray
/**
* A type definition for a JSON object.
*/
export interface JSONObject {
[key: string]: JSONValue
}
/**
* A type definition for a JSON array.
*/
export interface JSONArray extends Array<JSONValue> {}
/**
* A type definition for a readonly JSON object.
*/
export interface ReadonlyJSONObject {
readonly [key: string]: ReadonlyJSONValue
}
/**
* A type definition for a readonly JSON array.
*/
export interface ReadonlyJSONArray extends ReadonlyArray<ReadonlyJSONValue> {}
/**
* A type alias for a readonly JSON value.
*/
export type ReadonlyJSONValue =
| JSONPrimitive
| ReadonlyJSONObject
| ReadonlyJSONArray

@ -1,220 +1,3 @@
## @antv/x6-geometry [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.0...@antv/x6-geometry@1.0.1) (2022-11-05)
## @antv/x6-geometry [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.1...@antv/x6-geometry@2.0.2) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
# @antv/x6-geometry 1.0.0 (2022-11-05)
### Bug Fixes
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([49d4371](https://github.com/antvis/x6/commit/49d43716ada672e609e4e6d9c6fdca3f494b6f68))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* ✨ add geometry library ([dbba32e](https://github.com/antvis/x6/commit/dbba32eebc4531c2f040646667c7db4a69152350))
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* ✨ put animation in x6-common ([#2411](https://github.com/antvis/x6/issues/2411)) ([f1c80a8](https://github.com/antvis/x6/commit/f1c80a8cd75efe1def32168b6acff90ece5723ba))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
* support mouseenter and mouseleave event ([#2559](https://github.com/antvis/x6/issues/2559)) ([ecfd426](https://github.com/antvis/x6/commit/ecfd4263b1266a128bf8651c4dd745ff8ab038b3))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* force release 2.0-beta
* 2.0-beta
# @antv/x6-geometry 1.0.0 (2022-11-04)
### Bug Fixes
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([49d4371](https://github.com/antvis/x6/commit/49d43716ada672e609e4e6d9c6fdca3f494b6f68))
### Features
* ✨ add geometry library ([dbba32e](https://github.com/antvis/x6/commit/dbba32eebc4531c2f040646667c7db4a69152350))
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* ✨ put animation in x6-common ([#2411](https://github.com/antvis/x6/issues/2411)) ([f1c80a8](https://github.com/antvis/x6/commit/f1c80a8cd75efe1def32168b6acff90ece5723ba))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
* support mouseenter and mouseleave event ([#2559](https://github.com/antvis/x6/issues/2559)) ([ecfd426](https://github.com/antvis/x6/commit/ecfd4263b1266a128bf8651c4dd745ff8ab038b3))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### Features
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* ✨ put animation in x6-common ([#2411](https://github.com/antvis/x6/issues/2411)) ([f1c80a8](https://github.com/antvis/x6/commit/f1c80a8cd75efe1def32168b6acff90ece5723ba))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support mouseenter and mouseleave event ([#2559](https://github.com/antvis/x6/issues/2559)) ([ecfd426](https://github.com/antvis/x6/commit/ecfd4263b1266a128bf8651c4dd745ff8ab038b3))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* ✨ put animation in x6-common ([#2411](https://github.com/antvis/x6/issues/2411)) ([f1c80a8](https://github.com/antvis/x6/commit/f1c80a8cd75efe1def32168b6acff90ece5723ba))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support mouseenter and mouseleave event ([#2559](https://github.com/antvis/x6/issues/2559)) ([ecfd426](https://github.com/antvis/x6/commit/ecfd4263b1266a128bf8651c4dd745ff8ab038b3))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
## @antv/x6-geometry [1.0.11](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.10...@antv/x6-geometry@1.0.11) (2021-11-14)
# @antv/x6-geometry 1.0.0 (2021-11-11)
### Bug Fixes
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
### Features
* ✨ add geometry library ([6502513](https://github.com/antvis/x6/commit/650251331c07de39da94b1058239d044f02c8aba))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
## @antv/x6-geometry [1.0.10](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.9...@antv/x6-geometry@1.0.10) (2021-10-22)
## @antv/x6-geometry [1.0.10](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.9...@antv/x6-geometry@1.0.10) (2021-10-19)
## @antv/x6-geometry [1.0.9](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.8...@antv/x6-geometry@1.0.9) (2021-09-22)
## @antv/x6-geometry [1.0.9](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.8...@antv/x6-geometry@1.0.9) (2021-09-13)
## @antv/x6-geometry [1.0.8](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.7...@antv/x6-geometry@1.0.8) (2021-07-10)
## @antv/x6-geometry [1.0.7](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.6...@antv/x6-geometry@1.0.7) (2021-07-05)
## @antv/x6-geometry [1.0.6](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.5...@antv/x6-geometry@1.0.6) (2021-06-17)
### Bug Fixes
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
## @antv/x6-geometry [1.0.6](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.5...@antv/x6-geometry@1.0.6) (2021-06-16)
### Bug Fixes
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
## @antv/x6-geometry [1.0.5](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.4...@antv/x6-geometry@1.0.5) (2021-06-15)
## @antv/x6-geometry [1.0.5](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.4...@antv/x6-geometry@1.0.5) (2021-06-11)
## @antv/x6-geometry [1.0.4](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.3...@antv/x6-geometry@1.0.4) (2021-06-09)
## @antv/x6-geometry [1.0.4](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.3...@antv/x6-geometry@1.0.4) (2021-06-09)
## @antv/x6-geometry [1.0.3](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.2...@antv/x6-geometry@1.0.3) (2021-04-01)
## @antv/x6-geometry [1.0.3](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.2...@antv/x6-geometry@1.0.3) (2021-03-30)
## @antv/x6-geometry [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.1...@antv/x6-geometry@1.0.2) (2021-03-30)
## @antv/x6-geometry [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.1...@antv/x6-geometry@1.0.2) (2021-03-30)
## @antv/x6-geometry [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.0...@antv/x6-geometry@1.0.1) (2021-03-28)
## @antv/x6-geometry [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-geometry@1.0.0...@antv/x6-geometry@1.0.1) (2021-03-25)
# @antv/x6-geometry 1.0.0 (2021-03-24)
### Features
* ✨ add geometry library ([6502513](https://github.com/antvis/x6/commit/650251331c07de39da94b1058239d044f02c8aba))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
# @antv/x6-geometry 1.0.0 (2021-03-23)
### Features
* ✨ add geometry library ([6502513](https://github.com/antvis/x6/commit/650251331c07de39da94b1058239d044f02c8aba))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
# @antv/x6-geometry 1.0.0 (2021-03-23)
### Features
* ✨ add geometry library ([6502513](https://github.com/antvis/x6/commit/650251331c07de39da94b1058239d044f02c8aba))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
# @antv/x6-geometry 1.0.0 (2021-03-23)
### Features
* ✨ add geometry library ([6502513](https://github.com/antvis/x6/commit/650251331c07de39da94b1058239d044f02c8aba))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
# @antv/x6-geometry 1.0.0 (2021-03-23)
### Features
* ✨ add geometry library ([6502513](https://github.com/antvis/x6/commit/650251331c07de39da94b1058239d044f02c8aba))
* add some getters ([ff0273d](https://github.com/antvis/x6/commit/ff0273d119afd74b7233649308ba0035c737ca1a))
* equalPoints ([6a45c90](https://github.com/antvis/x6/commit/6a45c9027ab869a05c2f561cb7503078b0117264))
* rotate rectangle ([88a4fec](https://github.com/antvis/x6/commit/88a4fec7d1d3a49b6c1373f0641c8949474d7d83))
* round with default precision ([aef56f7](https://github.com/antvis/x6/commit/aef56f73f0627d620d36d116b74c828fa76c13f2))
## @antv/x6-geometry [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.0...@antv/x6-geometry@2.0.1) (2022-11-24)

@ -1,5 +1,5 @@
{
"version": "1.0.1",
"version": "2.0.3",
"name": "@antv/x6-geometry",
"description": "Geometry operations for X6",
"main": "lib/index.js",
@ -41,7 +41,7 @@
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -1,129 +1,8 @@
## @antv/x6-plugin-clipboard [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@1.0.0...@antv/x6-plugin-clipboard@1.0.1) (2022-11-05)
## @antv/x6-plugin-clipboard [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.1.0...@antv/x6-plugin-clipboard@2.1.1) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-clipboard 1.0.0 (2022-11-05)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
# @antv/x6-plugin-clipboard [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.0.0...@antv/x6-plugin-clipboard@2.1.0) (2022-11-24)
### Features
* ✨ add clipboard plugin ([8107f6d](https://github.com/antvis/x6/commit/8107f6df5de52a33e1b8094a44d59ee7fd2a8042))
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-clipboard 1.0.0 (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add clipboard plugin ([8107f6d](https://github.com/antvis/x6/commit/8107f6df5de52a33e1b8094a44d59ee7fd2a8042))
* ✨ export common and geometry in x6 package ([#2820](https://github.com/antvis/x6/issues/2820)) ([df28200](https://github.com/antvis/x6/commit/df282000cc5e17521147c77c210e172c444c9938))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-clipboard",
"version": "1.0.1",
"version": "2.1.3",
"description": "clipboard plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -37,17 +37,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/clipboard",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,113 @@
import { Graph, Cell } from '@antv/x6'
import { Clipboard } from './index'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
isClipboardEnabled: () => boolean
enableClipboard: () => Graph
disableClipboard: () => Graph
toggleClipboard: (enabled?: boolean) => Graph
isClipboardEmpty: () => boolean
getCellsInClipboard: () => Cell[]
cleanClipboard: () => Graph
copy: (cells: Cell[], options?: Clipboard.CopyOptions) => Graph
cut: (cells: Cell[], options?: Clipboard.CopyOptions) => Graph
paste: (options?: Clipboard.PasteOptions, graph?: Graph) => Cell[]
}
}
declare module '@antv/x6/lib/graph/events' {
interface EventArgs {
'clipboard:changed': { cells: Cell[] }
}
}
Graph.prototype.isClipboardEnabled = function () {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
return clipboard.isEnabled()
}
return false
}
Graph.prototype.enableClipboard = function () {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
clipboard.enable()
}
return this
}
Graph.prototype.disableClipboard = function () {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
clipboard.disable()
}
return this
}
Graph.prototype.toggleClipboard = function (enabled?: boolean) {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
clipboard.toggleEnabled(enabled)
}
return this
}
Graph.prototype.isClipboardEmpty = function () {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
return clipboard.isEmpty()
}
return true
}
Graph.prototype.getCellsInClipboard = function () {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
return clipboard.getCellsInClipboard()
}
return []
}
Graph.prototype.cleanClipboard = function () {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
clipboard.clean()
}
return this
}
Graph.prototype.copy = function (
cells: Cell[],
options?: Clipboard.CopyOptions,
) {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
clipboard.copy(cells, options)
}
return this
}
Graph.prototype.cut = function (
cells: Cell[],
options?: Clipboard.CopyOptions,
) {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
clipboard.cut(cells, options)
}
return this
}
Graph.prototype.paste = function (
options?: Clipboard.PasteOptions,
graph?: Graph,
) {
const clipboard = this.getPlugin('clipboard') as Clipboard
if (clipboard) {
return clipboard.paste(options, graph)
}
return []
}

@ -1,5 +1,6 @@
import { Cell, Graph, IDisablable, Basecoat } from '@antv/x6'
import { ClipboardImpl } from './clipboard'
import './api'
export class Clipboard
extends Basecoat<Clipboard.EventArgs>
@ -7,10 +8,12 @@ export class Clipboard
{
private clipboardImpl: ClipboardImpl
private graph: Graph
public options: Clipboard.Options
public name = 'clipboard'
constructor(public readonly options: Clipboard.Options) {
constructor(options: Clipboard.Options) {
super()
this.options = options
}
init(graph: Graph) {
@ -65,7 +68,7 @@ export class Clipboard
return this.cells
}
private clean(force?: boolean) {
clean(force?: boolean) {
if (!this.disabled || force) {
this.clipboardImpl.clean()
this.notify('clipboard:changed', { cells: [] })
@ -111,12 +114,12 @@ export class Clipboard
return this.options.enabled !== true
}
private get commonOptions() {
protected get commonOptions() {
const { enabled, ...others } = this.options
return others
}
private get cells() {
protected get cells() {
return this.clipboardImpl.cells
}

@ -1,137 +1,8 @@
## @antv/x6-plugin-dnd [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@1.0.1...@antv/x6-plugin-dnd@1.0.2) (2022-11-05)
## @antv/x6-plugin-dnd [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.1...@antv/x6-plugin-dnd@2.0.2) (2022-11-25)
### Dependencies
* **@antv/x6:** upgraded to 1.1.0
## @antv/x6-plugin-dnd [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@1.0.0...@antv/x6-plugin-dnd@1.0.1) (2022-11-05)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-dnd 1.0.0 (2022-11-05)
## @antv/x6-plugin-dnd [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.0...@antv/x6-plugin-dnd@2.0.1) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add dnd plugin ([269fae9](https://github.com/antvis/x6/commit/269fae9e5eeb969c6a7884373aa3a32002c064e6))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-dnd 1.0.0 (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add dnd plugin ([269fae9](https://github.com/antvis/x6/commit/269fae9e5eeb969c6a7884373aa3a32002c064e6))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* export snap methods from snapline ([#2904](https://github.com/antvis/x6/issues/2904)) ([826ccdd](https://github.com/antvis/x6/commit/826ccdd9a033486ad5b90d666340e46f6c266af7))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-dnd",
"version": "1.0.2",
"version": "2.0.3",
"description": "dnd plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -38,17 +38,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.1.0"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.1.0"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/dnd",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -104,7 +104,7 @@ export class Dnd extends View {
}
protected isSnaplineEnabled() {
return this.snapline && this.snapline.isSnaplineEnabled()
return this.snapline && this.snapline.isEnabled()
}
protected prepareDragging(

@ -1,91 +1,9 @@
## @antv/x6-plugin-export [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@1.0.0...@antv/x6-plugin-export@1.0.1) (2022-11-05)
## @antv/x6-plugin-export [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@2.1.0...@antv/x6-plugin-export@2.1.1) (2022-11-25)
# @antv/x6-plugin-export [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@2.0.0...@antv/x6-plugin-export@2.1.0) (2022-11-24)
### chore
### Features
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-export 1.0.0 (2022-11-05)
### Bug Fixes
* refactor example ([#2831](https://github.com/antvis/x6/issues/2831)) ([3d8f005](https://github.com/antvis/x6/commit/3d8f005696021f1d9f91a96812ebadce179f2d73))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-export 1.0.0 (2022-11-04)
### Bug Fixes
* refactor example ([#2831](https://github.com/antvis/x6/issues/2831)) ([3d8f005](https://github.com/antvis/x6/commit/3d8f005696021f1d9f91a96812ebadce179f2d73))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* add exportSVG methods ([#2906](https://github.com/antvis/x6/issues/2906)) ([847f225](https://github.com/antvis/x6/commit/847f2256326db0589ac37f1e1fa185560b61bdb7))
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-export",
"version": "1.0.1",
"version": "2.1.2",
"description": "export plugin for X6.",
"main": "lib/index.js",
"module": "es/index.js",
@ -36,17 +36,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/export",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,40 @@
import { Graph } from '@antv/x6'
import { Export } from './index'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
exportPNG: (fileName?: string, options?: Export.ToImageOptions) => void
exportJPEG: (fileName?: string, options?: Export.ToImageOptions) => void
exportSVG: (fileName?: string, options?: Export.ToSVGOptions) => void
}
}
Graph.prototype.exportPNG = function (
fileName?: string,
options?: Export.ToImageOptions,
) {
const instance = this.getPlugin('export') as Export
if (instance) {
instance.exportPNG(fileName, options)
}
}
Graph.prototype.exportJPEG = function (
fileName?: string,
options?: Export.ToImageOptions,
) {
const instance = this.getPlugin('export') as Export
if (instance) {
instance.exportJPEG(fileName, options)
}
}
Graph.prototype.exportSVG = function (
fileName?: string,
options?: Export.ToSVGOptions,
) {
const instance = this.getPlugin('export') as Export
if (instance) {
instance.exportSVG(fileName, options)
}
}

@ -10,6 +10,7 @@ import {
Dom,
Graph,
} from '@antv/x6'
import './api'
export class Export extends Basecoat<Export.EventArgs> {
private graph: Graph
@ -39,6 +40,12 @@ export class Export extends Basecoat<Export.EventArgs> {
}, options)
}
exportSVG(fileName = 'chart', options: Export.ToSVGOptions = {}) {
this.toSVG((svg: string) => {
DataUri.downloadDataUri(DataUri.svgToDataUrl(svg), fileName)
}, options)
}
toSVG(callback: Export.ToSVGCallback, options: Export.ToSVGOptions = {}) {
this.notify('before:export', options)

@ -1,363 +1,15 @@
## @antv/x6-plugin-history [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@1.0.1) (2022-11-05)
## @antv/x6-plugin-history [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.1.1...@antv/x6-plugin-history@2.1.2) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-history 1.0.0 (2022-11-05)
## @antv/x6-plugin-history [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.1.0...@antv/x6-plugin-history@2.1.1) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
* deep clone instead of shallow clone ([#2924](https://github.com/antvis/x6/issues/2924)) ([75f4297](https://github.com/antvis/x6/commit/75f42978cb0ed4c9e7c7ac141ffa29603cb27596))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
# @antv/x6-plugin-history [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.0.0...@antv/x6-plugin-history@2.1.0) (2022-11-24)
### Features
* add history plugin ([#2819](https://github.com/antvis/x6/issues/2819)) ([fd8d384](https://github.com/antvis/x6/commit/fd8d384a29d0f2e02bf066efd19ed3f92614c524))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-history 1.0.0 (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* ✨ add history plugin ([#2819](https://github.com/antvis/x6/issues/2819)) ([fd8d384](https://github.com/antvis/x6/commit/fd8d384a29d0f2e02bf066efd19ed3f92614c524))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-history [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
# @antv/x6-plugin-history [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
# @antv/x6-plugin-history [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
# @antv/x6-plugin-history [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
# @antv/x6-plugin-history [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6-common:** upgraded to 1.0.1
# @antv/x6-plugin-history [2.0.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 2.0.0
* **@antv/x6-common:** upgraded to 1.0.0
## @antv/x6-plugin-history [2.0.6-beta.5](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.0.6-beta.4...@antv/x6-plugin-history@2.0.6-beta.5) (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
## @antv/x6-plugin-history [2.0.6-beta.4](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.0.6-beta.3...@antv/x6-plugin-history@2.0.6-beta.4) (2022-11-04)
### Dependencies
* **@antv/x6:** upgraded to 2.0.6-beta.5
* **@antv/x6-common:** upgraded to 2.0.6-beta.1
## @antv/x6-plugin-history [2.0.6-beta.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.0.6-beta.2...@antv/x6-plugin-history@2.0.6-beta.3) (2022-11-03)
### Bug Fixes
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
### Dependencies
* **@antv/x6:** upgraded to 2.0.6-beta.4
* **@antv/x6-common:** upgraded to 1.0.0-beta.1
## @antv/x6-plugin-history [2.0.6-beta.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.0.6-beta.1...@antv/x6-plugin-history@2.0.6-beta.2) (2022-11-03)
### Dependencies
* **@antv/x6:** upgraded to 2.0.6-beta.3
* **@antv/x6-common:** upgraded to 1.0.0-beta.1
## @antv/x6-plugin-history [2.0.6-beta.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@2.0.0-beta.1...@antv/x6-plugin-history@2.0.6-beta.1) (2022-11-03)
### Dependencies
* **@antv/x6:** upgraded to 2.0.6-beta.2
* **@antv/x6-common:** upgraded to 1.0.0-beta.1
# @antv/x6-plugin-history [2.0.0-beta.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-history@1.0.0...@antv/x6-plugin-history@2.0.0-beta.1) (2022-11-03)
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 2.0.6-beta.1
* **@antv/x6-common:** upgraded to 1.0.0-beta.1
# @antv/x6-plugin-history 1.0.0 (2022-11-03)
### Features
* ✨ add history plugin ([#2819](https://github.com/antvis/x6/issues/2819)) ([fd8d384](https://github.com/antvis/x6/commit/fd8d384a29d0f2e02bf066efd19ed3f92614c524))
### Dependencies
* **@antv/x6:** upgraded to 1.31.0
* **@antv/x6-common:** upgraded to 1.0.0
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-history",
"version": "1.0.1",
"version": "2.1.3",
"description": "history plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -37,17 +37,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/history",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,109 @@
import { Graph, KeyValue } from '@antv/x6'
import { History } from './index'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
isHistoryEnabled: () => boolean
enableHistory: () => Graph
disableHistory: () => Graph
toggleHistory: (enabled?: boolean) => Graph
undo: (options?: KeyValue) => Graph
redo: (options?: KeyValue) => Graph
undoAndCancel: (options?: KeyValue) => Graph
canUndo: () => boolean
canRedo: () => boolean
cleanHistory: (options?: KeyValue) => Graph
}
}
declare module '@antv/x6/lib/graph/events' {
interface EventArgs {
'history:undo': History.Args
'history:redo': History.Args
'history:cancel': History.Args
'history:add': History.Args
'history:clean': History.Args<null>
'history:change': History.Args<null>
'history:batch': { cmd: History.Command; options: KeyValue }
}
}
Graph.prototype.isHistoryEnabled = function () {
const history = this.getPlugin('history') as History
if (history) {
return history.isEnabled()
}
return false
}
Graph.prototype.enableHistory = function () {
const history = this.getPlugin('history') as History
if (history) {
history.enable()
}
return this
}
Graph.prototype.disableHistory = function () {
const history = this.getPlugin('history') as History
if (history) {
history.disable()
}
return this
}
Graph.prototype.toggleHistory = function (enabled?: boolean) {
const history = this.getPlugin('history') as History
if (history) {
history.toggleEnabled(enabled)
}
return this
}
Graph.prototype.undo = function (options?: KeyValue) {
const history = this.getPlugin('history') as History
if (history) {
history.undo(options)
}
return this
}
Graph.prototype.redo = function (options?: KeyValue) {
const history = this.getPlugin('history') as History
if (history) {
history.redo(options)
}
return this
}
Graph.prototype.undoAndCancel = function (options?: KeyValue) {
const history = this.getPlugin('history') as History
if (history) {
history.cancel(options)
}
return this
}
Graph.prototype.canUndo = function () {
const history = this.getPlugin('history') as History
if (history) {
return history.canUndo()
}
return false
}
Graph.prototype.canRedo = function () {
const history = this.getPlugin('history') as History
if (history) {
return history.canRedo()
}
return false
}
Graph.prototype.cleanHistory = function (options?: KeyValue) {
const history = this.getPlugin('history') as History
if (history) {
history.clean(options)
}
return this
}

@ -8,6 +8,7 @@ import {
Model,
Graph,
} from '@antv/x6'
import './api'
export class History
extends Basecoat<History.EventArgs>
@ -365,7 +366,7 @@ export class History
if (data.prev == null) {
data.prev = {}
}
data.prev[key] = ObjectExt.clone(cell.previous(key))
data.prev[key] = ObjectExt.cloneDeep(cell.previous(key))
if (isModelChange) {
cmd.modelChange = true
@ -377,7 +378,7 @@ export class History
if (data.next == null) {
data.next = {}
}
data.next[key] = ObjectExt.clone(cell.prop(key))
data.next[key] = ObjectExt.cloneDeep(cell.prop(key))
return this.push(cmd, options)
}
@ -643,7 +644,7 @@ export namespace History {
}
export namespace History {
interface Args<T = never> {
export interface Args<T = never> {
cmds: Command[] | T
options: KeyValue
}

@ -1,137 +1,15 @@
## @antv/x6-plugin-keyboard [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@1.0.0...@antv/x6-plugin-keyboard@1.0.1) (2022-11-05)
## @antv/x6-plugin-keyboard [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.1.1...@antv/x6-plugin-keyboard@2.1.2) (2022-11-25)
## @antv/x6-plugin-keyboard [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.1.0...@antv/x6-plugin-keyboard@2.1.1) (2022-11-25)
### chore
### Performance Improvements
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
* update deps ([f20127a](https://github.com/antvis/x6/commit/f20127af555d9b7beaac3a07ac308d5c0d4e53a3))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-keyboard 1.0.0 (2022-11-05)
### Bug Fixes
* 🐛 change init method to public ([#2671](https://github.com/antvis/x6/issues/2671)) ([8a17bfa](https://github.com/antvis/x6/commit/8a17bfac81190e6c492690ad4f1ae4b80eeb98b5))
* 🐛 fix type error in keyboard plugin ([#2674](https://github.com/antvis/x6/issues/2674)) ([1701150](https://github.com/antvis/x6/commit/1701150042e45126415afd7768e2dc798906a1c4))
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
# @antv/x6-plugin-keyboard [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-keyboard@2.0.0...@antv/x6-plugin-keyboard@2.1.0) (2022-11-24)
### Features
* add keyboard plugin ([#2665](https://github.com/antvis/x6/issues/2665)) ([bf53677](https://github.com/antvis/x6/commit/bf536778ca7ee3229390dfcfcb085ec55edd9fb2))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* ✨ expose the selection api ([#2756](https://github.com/antvis/x6/issues/2756)) ([f3edbbc](https://github.com/antvis/x6/commit/f3edbbc95d2038a61116fa71bb0c3016f1c92d5e))
* ✨ improve scroller plugin ([#2667](https://github.com/antvis/x6/issues/2667)) ([25b238f](https://github.com/antvis/x6/commit/25b238fd0bd289c0175f0cb1282233cb3badbc20))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-keyboard 1.0.0 (2022-11-04)
### Bug Fixes
* 🐛 change init method to public ([#2671](https://github.com/antvis/x6/issues/2671)) ([8a17bfa](https://github.com/antvis/x6/commit/8a17bfac81190e6c492690ad4f1ae4b80eeb98b5))
* 🐛 fix type error in keyboard plugin ([#2674](https://github.com/antvis/x6/issues/2674)) ([1701150](https://github.com/antvis/x6/commit/1701150042e45126415afd7768e2dc798906a1c4))
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add keyboard plugin ([#2665](https://github.com/antvis/x6/issues/2665)) ([bf53677](https://github.com/antvis/x6/commit/bf536778ca7ee3229390dfcfcb085ec55edd9fb2))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* ✨ expose the selection api ([#2756](https://github.com/antvis/x6/issues/2756)) ([f3edbbc](https://github.com/antvis/x6/commit/f3edbbc95d2038a61116fa71bb0c3016f1c92d5e))
* ✨ improve scroller plugin ([#2667](https://github.com/antvis/x6/issues/2667)) ([25b238f](https://github.com/antvis/x6/commit/25b238fd0bd289c0175f0cb1282233cb3badbc20))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-keyboard",
"version": "1.0.1",
"version": "2.1.3",
"description": "keyboard plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -40,18 +40,18 @@
"mousetrap": "^1.6.5"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1",
"@types/mousetrap": "^1.6.5"
"@antv/x6": "^2.x",
"@types/mousetrap": "^1.6.11"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/keyboard",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,73 @@
import { Graph } from '@antv/x6'
import { Keyboard } from './index'
import { KeyboardImpl } from './keyboard'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
isKeyboardEnabled: () => boolean
enableKeyboard: () => Graph
disableKeyboard: () => Graph
toggleKeyboard: (enabled?: boolean) => Graph
bindKey: (
keys: string | string[],
callback: KeyboardImpl.Handler,
action?: KeyboardImpl.Action,
) => Graph
unbindKey: (keys: string | string[], action?: KeyboardImpl.Action) => Graph
}
}
Graph.prototype.isKeyboardEnabled = function () {
const keyboard = this.getPlugin('keyboard') as Keyboard
if (keyboard) {
return keyboard.isEnabled()
}
return false
}
Graph.prototype.enableKeyboard = function () {
const keyboard = this.getPlugin('keyboard') as Keyboard
if (keyboard) {
keyboard.enable()
}
return this
}
Graph.prototype.disableKeyboard = function () {
const keyboard = this.getPlugin('keyboard') as Keyboard
if (keyboard) {
keyboard.disable()
}
return this
}
Graph.prototype.toggleKeyboard = function (enabled?: boolean) {
const keyboard = this.getPlugin('keyboard') as Keyboard
if (keyboard) {
keyboard.toggleEnabled(enabled)
}
return this
}
Graph.prototype.bindKey = function (
keys: string | string[],
callback: KeyboardImpl.Handler,
action?: KeyboardImpl.Action,
) {
const keyboard = this.getPlugin('keyboard') as Keyboard
if (keyboard) {
keyboard.bindKey(keys, callback, action)
}
return this
}
Graph.prototype.unbindKey = function (
keys: string | string[],
action?: KeyboardImpl.Action,
) {
const keyboard = this.getPlugin('keyboard') as Keyboard
if (keyboard) {
keyboard.unbindKey(keys, action)
}
return this
}

@ -1,12 +1,15 @@
import { Disposable, Graph } from '@antv/x6'
import { KeyboardImpl } from './keyboard'
import './api'
export class Keyboard extends Disposable {
private keyboardImpl: KeyboardImpl
public name = 'keyboard'
public options: KeyboardImpl.Options
constructor(public readonly options: KeyboardImpl.Options) {
constructor(options: KeyboardImpl.Options) {
super()
this.options = options
}
init(graph: Graph) {

@ -1,127 +1,8 @@
## @antv/x6-plugin-minimap [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-minimap@1.0.0...@antv/x6-plugin-minimap@1.0.1) (2022-11-05)
## @antv/x6-plugin-minimap [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-minimap@2.0.1...@antv/x6-plugin-minimap@2.0.2) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-minimap 1.0.0 (2022-11-05)
## @antv/x6-plugin-minimap [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-minimap@2.0.0...@antv/x6-plugin-minimap@2.0.1) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add minimap plugin ([6cdecbb](https://github.com/antvis/x6/commit/6cdecbbba9a4db1f67189e23fb89f2a7ba2af99e))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-minimap 1.0.0 (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add minimap plugin ([6cdecbb](https://github.com/antvis/x6/commit/6cdecbbba9a4db1f67189e23fb89f2a7ba2af99e))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* add missing script for building style ([e683155](https://github.com/antvis/x6/commit/e68315528a202cbc5a9ad256d168943e001d7116))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-minimap",
"version": "1.0.1",
"version": "2.0.3",
"description": "minimap plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,6 +27,7 @@
"build:cjs": "rss",
"build:umd": "rss",
"build:dev": "rss",
"build:less": "rss",
"build:watch": "rss",
"build:watch:esm": "rss",
"build:watch:cjs": "rss",
@ -37,17 +38,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/minimap",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -1,157 +1,9 @@
## @antv/x6-plugin-scroller [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-scroller@1.0.0...@antv/x6-plugin-scroller@1.0.1) (2022-11-05)
## @antv/x6-plugin-scroller [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-scroller@2.0.1...@antv/x6-plugin-scroller@2.0.2) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-scroller 1.0.0 (2022-11-05)
## @antv/x6-plugin-scroller [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-scroller@2.0.0...@antv/x6-plugin-scroller@2.0.1) (2022-11-24)
### Bug Fixes
* 🐛 add return value for autoScroller in scroller plugin ([5e102a3](https://github.com/antvis/x6/commit/5e102a39c5bd14a478edd4f36c4264997027c2a9))
* 🐛 change init method to public ([#2671](https://github.com/antvis/x6/issues/2671)) ([8a17bfa](https://github.com/antvis/x6/commit/8a17bfac81190e6c492690ad4f1ae4b80eeb98b5))
* 🐛 debounce update methords in scroller ([6e1bd9b](https://github.com/antvis/x6/commit/6e1bd9b5307b4cf17b3951168e10527d6111e5e5))
* 🐛 ensure css loader for plugin ([24de125](https://github.com/antvis/x6/commit/24de1254a14937a8b5fbb9fd1635e470ae10ebc9))
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add autoResize feature ([5aeae97](https://github.com/antvis/x6/commit/5aeae976cd7638b2b5c05bc12bc56b562366fe5f))
* ✨ add clipboard plugin ([8107f6d](https://github.com/antvis/x6/commit/8107f6df5de52a33e1b8094a44d59ee7fd2a8042))
* ✨ add minimap plugin ([6cdecbb](https://github.com/antvis/x6/commit/6cdecbbba9a4db1f67189e23fb89f2a7ba2af99e))
* ✨ add scroller api ([12173bf](https://github.com/antvis/x6/commit/12173bf500624f197ed56cf6a797499587178cba))
* ✨ add selection plugin ([#2742](https://github.com/antvis/x6/issues/2742)) ([50a5dc7](https://github.com/antvis/x6/commit/50a5dc7cd8c2e39a1f8bf8359a0eb189dda8cb86))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* ✨ add some missing api ([1dcb3d9](https://github.com/antvis/x6/commit/1dcb3d92fd83e5dfd1a1af9670d539a99dd9f55a))
* ✨ add trnsition methods for scroller plugin ([#2670](https://github.com/antvis/x6/issues/2670)) ([f43e0a5](https://github.com/antvis/x6/commit/f43e0a5417ced76ff328f130872dea5c0b13acbd))
* ✨ expose the selection api ([#2756](https://github.com/antvis/x6/issues/2756)) ([f3edbbc](https://github.com/antvis/x6/commit/f3edbbc95d2038a61116fa71bb0c3016f1c92d5e))
* ✨ improve auto-resize feature ([40d5335](https://github.com/antvis/x6/commit/40d53355cedc0bbbeb1e26948b67254dc6a40d85))
* ✨ improve scroller plugin ([#2667](https://github.com/antvis/x6/issues/2667)) ([25b238f](https://github.com/antvis/x6/commit/25b238fd0bd289c0175f0cb1282233cb3badbc20))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-scroller 1.0.0 (2022-11-04)
### Bug Fixes
* 🐛 add return value for autoScroller in scroller plugin ([5e102a3](https://github.com/antvis/x6/commit/5e102a39c5bd14a478edd4f36c4264997027c2a9))
* 🐛 change init method to public ([#2671](https://github.com/antvis/x6/issues/2671)) ([8a17bfa](https://github.com/antvis/x6/commit/8a17bfac81190e6c492690ad4f1ae4b80eeb98b5))
* 🐛 debounce update methords in scroller ([6e1bd9b](https://github.com/antvis/x6/commit/6e1bd9b5307b4cf17b3951168e10527d6111e5e5))
* 🐛 ensure css loader for plugin ([24de125](https://github.com/antvis/x6/commit/24de1254a14937a8b5fbb9fd1635e470ae10ebc9))
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add autoResize feature ([5aeae97](https://github.com/antvis/x6/commit/5aeae976cd7638b2b5c05bc12bc56b562366fe5f))
* ✨ add clipboard plugin ([8107f6d](https://github.com/antvis/x6/commit/8107f6df5de52a33e1b8094a44d59ee7fd2a8042))
* ✨ add minimap plugin ([6cdecbb](https://github.com/antvis/x6/commit/6cdecbbba9a4db1f67189e23fb89f2a7ba2af99e))
* ✨ add scroller api ([12173bf](https://github.com/antvis/x6/commit/12173bf500624f197ed56cf6a797499587178cba))
* ✨ add selection plugin ([#2742](https://github.com/antvis/x6/issues/2742)) ([50a5dc7](https://github.com/antvis/x6/commit/50a5dc7cd8c2e39a1f8bf8359a0eb189dda8cb86))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* ✨ add some missing api ([1dcb3d9](https://github.com/antvis/x6/commit/1dcb3d92fd83e5dfd1a1af9670d539a99dd9f55a))
* ✨ add trnsition methods for scroller plugin ([#2670](https://github.com/antvis/x6/issues/2670)) ([f43e0a5](https://github.com/antvis/x6/commit/f43e0a5417ced76ff328f130872dea5c0b13acbd))
* ✨ expose the selection api ([#2756](https://github.com/antvis/x6/issues/2756)) ([f3edbbc](https://github.com/antvis/x6/commit/f3edbbc95d2038a61116fa71bb0c3016f1c92d5e))
* ✨ improve auto-resize feature ([40d5335](https://github.com/antvis/x6/commit/40d53355cedc0bbbeb1e26948b67254dc6a40d85))
* ✨ improve scroller plugin ([#2667](https://github.com/antvis/x6/issues/2667)) ([25b238f](https://github.com/antvis/x6/commit/25b238fd0bd289c0175f0cb1282233cb3badbc20))
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* add missing script for building style ([e683155](https://github.com/antvis/x6/commit/e68315528a202cbc5a9ad256d168943e001d7116))
* resize graph when scale scroller ([#2903](https://github.com/antvis/x6/issues/2903)) ([cee4aa4](https://github.com/antvis/x6/commit/cee4aa4e53b2821ed11d5602fccdb36625957c72))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-scroller",
"version": "1.0.1",
"version": "2.0.3",
"description": "scroller plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,6 +27,7 @@
"build:cjs": "rss",
"build:umd": "rss",
"build:dev": "rss",
"build:less": "rss",
"build:watch": "rss",
"build:watch:esm": "rss",
"build:watch:cjs": "rss",
@ -37,17 +38,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/scroller",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,55 @@
import { Graph } from '@antv/x6'
import { Scroller } from './index'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
lockScroller: () => Graph
unlockScroller: () => Graph
updateScroller: () => Graph
getScrollbarPosition: () => { left: number; top: number }
setScrollbarPosition: (left?: number, top?: number) => Graph
}
}
Graph.prototype.lockScroller = function () {
const scroller = this.getPlugin('scroller') as Scroller
if (scroller) {
scroller.lockScroller()
}
return this
}
Graph.prototype.unlockScroller = function () {
const scroller = this.getPlugin('scroller') as Scroller
if (scroller) {
scroller.unlockScroller()
}
return this
}
Graph.prototype.updateScroller = function () {
const scroller = this.getPlugin('scroller') as Scroller
if (scroller) {
scroller.updateScroller()
}
return this
}
Graph.prototype.getScrollbarPosition = function () {
const scroller = this.getPlugin('scroller') as Scroller
if (scroller) {
return scroller.getScrollbarPosition()
}
return {
left: 0,
top: 0,
}
}
Graph.prototype.setScrollbarPosition = function (left?: number, top?: number) {
const scroller = this.getPlugin('scroller') as Scroller
if (scroller) {
scroller.setScrollbarPosition(left, top)
}
return this
}

@ -13,6 +13,7 @@ import {
} from '@antv/x6'
import { ScrollerImpl } from './scroller'
import { content } from './style/raw'
import './api'
export class Scroller extends Basecoat<Scroller.EventArgs> {
private graph: Graph
@ -219,14 +220,17 @@ export class Scroller extends Basecoat<Scroller.EventArgs> {
lockScroller() {
this.scrollerImpl.lock()
return this
}
unlockScroller() {
this.scrollerImpl.unlock()
return this
}
updateScroller() {
this.scrollerImpl.update()
return this
}
getScrollbarPosition() {

@ -404,7 +404,7 @@ export class ScrollerImpl extends View<ScrollerImpl.EventArgs> {
this.sy = sy
this.graph.translate(options.x * dx, options.y * dy)
this.graph.resize(options.width * dx, options.height * dy)
this.graph.transform.resize(options.width * dx, options.height * dy)
}
scrollbarPosition(): { left: number; top: number }
@ -1117,7 +1117,7 @@ export class ScrollerImpl extends View<ScrollerImpl.EventArgs> {
@View.dispose()
dispose() {
Dom.before(this.graph.container, this.container)
Dom.before(this.container, this.graph.container)
this.remove()
}
}

@ -1,139 +1,27 @@
## @antv/x6-plugin-selection [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@1.0.0...@antv/x6-plugin-selection@1.0.1) (2022-11-05)
## @antv/x6-plugin-selection [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.1.2...@antv/x6-plugin-selection@2.1.3) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-selection 1.0.0 (2022-11-05)
## @antv/x6-plugin-selection [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.1.1...@antv/x6-plugin-selection@2.1.2) (2022-11-24)
### Bug Fixes
* 🐛 ensure css loader for plugin ([24de125](https://github.com/antvis/x6/commit/24de1254a14937a8b5fbb9fd1635e470ae10ebc9))
* 🐛 fix multiple selection drag error ([5ae7807](https://github.com/antvis/x6/commit/5ae78077e2a495122a28c75dbb30377eae5c45e6))
* 🐛 fix the error in selected nodes position when snapline enabled ([#2797](https://github.com/antvis/x6/issues/2797)) ([1e7f132](https://github.com/antvis/x6/commit/1e7f132bed15006cc5535f1294f0b8a545dd6441))
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
* support antd5 in react components ([#2933](https://github.com/antvis/x6/issues/2933)) ([2ecc213](https://github.com/antvis/x6/commit/2ecc213094250b476b533b444c0f3716f88b7987))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add clipboard plugin ([8107f6d](https://github.com/antvis/x6/commit/8107f6df5de52a33e1b8094a44d59ee7fd2a8042))
* ✨ add selection plugin ([#2742](https://github.com/antvis/x6/issues/2742)) ([50a5dc7](https://github.com/antvis/x6/commit/50a5dc7cd8c2e39a1f8bf8359a0eb189dda8cb86))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* ✨ expose the selection api ([#2756](https://github.com/antvis/x6/issues/2756)) ([f3edbbc](https://github.com/antvis/x6/commit/f3edbbc95d2038a61116fa71bb0c3016f1c92d5e))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-selection 1.0.0 (2022-11-04)
## @antv/x6-plugin-selection [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.1.0...@antv/x6-plugin-selection@2.1.1) (2022-11-24)
### Bug Fixes
* 🐛 ensure css loader for plugin ([24de125](https://github.com/antvis/x6/commit/24de1254a14937a8b5fbb9fd1635e470ae10ebc9))
* 🐛 fix multiple selection drag error ([5ae7807](https://github.com/antvis/x6/commit/5ae78077e2a495122a28c75dbb30377eae5c45e6))
* 🐛 fix the error in selected nodes position when snapline enabled ([#2797](https://github.com/antvis/x6/issues/2797)) ([1e7f132](https://github.com/antvis/x6/commit/1e7f132bed15006cc5535f1294f0b8a545dd6441))
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
* modify the semantics of filter ([#2927](https://github.com/antvis/x6/issues/2927)) ([bc261fb](https://github.com/antvis/x6/commit/bc261fb9929aa0b4d3fa4194bcc780ea701b029e))
# @antv/x6-plugin-selection [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-selection@2.0.0...@antv/x6-plugin-selection@2.1.0) (2022-11-24)
### chore
### Bug Fixes
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
* add missing script for building style ([e683155](https://github.com/antvis/x6/commit/e68315528a202cbc5a9ad256d168943e001d7116))
### Features
* ✨ add clipboard plugin ([8107f6d](https://github.com/antvis/x6/commit/8107f6df5de52a33e1b8094a44d59ee7fd2a8042))
* ✨ add selection plugin ([#2742](https://github.com/antvis/x6/issues/2742)) ([50a5dc7](https://github.com/antvis/x6/commit/50a5dc7cd8c2e39a1f8bf8359a0eb189dda8cb86))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* ✨ expose the selection api ([#2756](https://github.com/antvis/x6/issues/2756)) ([f3edbbc](https://github.com/antvis/x6/commit/f3edbbc95d2038a61116fa71bb0c3016f1c92d5e))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-selection",
"version": "1.0.1",
"version": "2.1.4",
"description": "selection plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,6 +27,7 @@
"build:cjs": "rss",
"build:umd": "rss",
"build:dev": "rss",
"build:less": "rss",
"build:watch": "rss",
"build:watch:esm": "rss",
"build:watch:cjs": "rss",
@ -37,17 +38,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/selection",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,313 @@
import { Graph, Cell, ModifierKey } from '@antv/x6'
import { Selection } from './index'
import { SelectionImpl } from './selection'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
isSelectionEnabled: () => boolean
enableSelection: () => Graph
disableSelection: () => Graph
toggleSelection: (enabled?: boolean) => Graph
isMultipleSelection: () => boolean
enableMultipleSelection: () => Graph
disableMultipleSelection: () => Graph
toggleMultipleSelection: (multiple?: boolean) => Graph
isSelectionMovable: () => boolean
enableSelectionMovable: () => Graph
disableSelectionMovable: () => Graph
toggleSelectionMovable: (movable?: boolean) => Graph
isRubberbandEnabled: () => boolean
enableRubberband: () => Graph
disableRubberband: () => Graph
toggleRubberband: (enabled?: boolean) => Graph
isStrictRubberband: () => boolean
enableStrictRubberband: () => Graph
disableStrictRubberband: () => Graph
toggleStrictRubberband: (strict?: boolean) => Graph
setRubberbandModifiers: (modifiers?: string | ModifierKey[] | null) => Graph
setSelectionFilter: (filter?: Selection.Filter) => Graph
setSelectionDisplayContent: (content?: Selection.Content) => Graph
isSelectionEmpty: () => boolean
cleanSelection: (options?: Selection.SetOptions) => Graph
resetSelection: (
cells?: Cell | string | (Cell | string)[],
options?: Selection.SetOptions,
) => Graph
getSelectedCells: () => Cell[]
getSelectedCellCount: () => number
isSelected: (cell: Cell | string) => boolean
select: (
cells: Cell | string | (Cell | string)[],
options?: Selection.AddOptions,
) => Graph
unselect: (
cells: Cell | string | (Cell | string)[],
options?: Selection.RemoveOptions,
) => Graph
}
}
declare module '@antv/x6/lib/graph/events' {
interface EventArgs extends SelectionImpl.SelectionEventArgs {}
}
Graph.prototype.isSelectionEnabled = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isEnabled()
}
return false
}
Graph.prototype.enableSelection = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.enable()
}
return this
}
Graph.prototype.disableSelection = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.disable()
}
return this
}
Graph.prototype.toggleSelection = function (enabled?: boolean) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.toggleEnabled(enabled)
}
return this
}
Graph.prototype.isMultipleSelection = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isMultipleSelection()
}
return false
}
Graph.prototype.enableMultipleSelection = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.enableMultipleSelection()
}
return this
}
Graph.prototype.disableMultipleSelection = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.disableMultipleSelection()
}
return this
}
Graph.prototype.toggleMultipleSelection = function (multiple?: boolean) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.toggleMultipleSelection(multiple)
}
return this
}
Graph.prototype.isSelectionMovable = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isSelectionMovable()
}
return false
}
Graph.prototype.enableSelectionMovable = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.enableSelectionMovable()
}
return this
}
Graph.prototype.disableSelectionMovable = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.disableSelectionMovable()
}
return this
}
Graph.prototype.toggleSelectionMovable = function (movable?: boolean) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.toggleSelectionMovable(movable)
}
return this
}
Graph.prototype.isRubberbandEnabled = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isRubberbandEnabled()
}
return false
}
Graph.prototype.enableRubberband = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.enableRubberband()
}
return this
}
Graph.prototype.disableRubberband = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.disableRubberband()
}
return this
}
Graph.prototype.toggleRubberband = function (enabled?: boolean) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.toggleRubberband(enabled)
}
return this
}
Graph.prototype.isStrictRubberband = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isStrictRubberband()
}
return false
}
Graph.prototype.enableStrictRubberband = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.enableStrictRubberband()
}
return this
}
Graph.prototype.disableStrictRubberband = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.disableStrictRubberband()
}
return this
}
Graph.prototype.toggleStrictRubberband = function (strict?: boolean) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.toggleStrictRubberband(strict)
}
return this
}
Graph.prototype.setRubberbandModifiers = function (
modifiers?: string | ModifierKey[] | null,
) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.setRubberbandModifiers(modifiers)
}
return this
}
Graph.prototype.setSelectionFilter = function (filter?: Selection.Filter) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.setSelectionFilter(filter)
}
return this
}
Graph.prototype.setSelectionDisplayContent = function (
content?: Selection.Content,
) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.setSelectionDisplayContent(content)
}
return this
}
Graph.prototype.isSelectionEmpty = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isEmpty()
}
return true
}
Graph.prototype.cleanSelection = function (options?: Selection.SetOptions) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.clean(options)
}
return this
}
Graph.prototype.resetSelection = function (
cells?: Cell | string | (Cell | string)[],
options?: Selection.SetOptions,
) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.reset(cells, options)
}
return this
}
Graph.prototype.getSelectedCells = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.getSelectedCells()
}
return []
}
Graph.prototype.getSelectedCellCount = function () {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.getSelectedCellCount()
}
return 0
}
Graph.prototype.isSelected = function (cell: Cell | string) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.isSelected(cell)
}
return false
}
Graph.prototype.select = function (
cells: Cell | string | (Cell | string)[],
options?: Selection.AddOptions,
) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
selection.select(cells, options)
}
return this
}
Graph.prototype.unselect = function (
cells: Cell | string | (Cell | string)[],
options?: Selection.RemoveOptions,
) {
const selection = this.getPlugin('selection') as Selection
if (selection) {
return selection.unselect(cells, options)
}
return this
}

@ -10,6 +10,7 @@ import {
} from '@antv/x6'
import { SelectionImpl } from './selection'
import { content } from './style/raw'
import './api'
export class Selection extends Basecoat<SelectionImpl.EventArgs> {
private graph: Graph
@ -244,7 +245,7 @@ export class Selection extends Basecoat<SelectionImpl.EventArgs> {
return this
}
protected reset(
reset(
cells?: Cell | string | (Cell | string)[],
options: Selection.SetOptions = {},
) {

@ -292,17 +292,22 @@ export class SelectionImpl extends View<SelectionImpl.EventArgs> {
filter(cells: Cell[]) {
const filter = this.options.filter
if (Array.isArray(filter)) {
return cells.filter(
(cell) => !filter.includes(cell) && !filter.includes(cell.shape),
)
}
if (typeof filter === 'function') {
return cells.filter((cell) => FunctionExt.call(filter, this.graph, cell))
}
return cells.filter((cell) => {
if (Array.isArray(filter)) {
return filter.some((item) => {
if (typeof item === 'string') {
return cell.shape === item
}
return cell.id === item.id
})
}
if (typeof filter === 'function') {
return FunctionExt.call(filter, this.graph, cell)
}
return cells
return true
})
}
protected stopSelecting(evt: Dom.MouseUpEvent) {

@ -1,129 +1,28 @@
## @antv/x6-plugin-snapline [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@1.0.0...@antv/x6-plugin-snapline@1.0.1) (2022-11-05)
## @antv/x6-plugin-snapline [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.1.2...@antv/x6-plugin-snapline@2.1.3) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-snapline 1.0.0 (2022-11-05)
## @antv/x6-plugin-snapline [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.1.1...@antv/x6-plugin-snapline@2.1.2) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
* updae react-resize-detector version ([#2930](https://github.com/antvis/x6/issues/2930)) ([d6ae519](https://github.com/antvis/x6/commit/d6ae5199c00be6429a828f537b194adddd2b6aeb))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add dnd plugin ([269fae9](https://github.com/antvis/x6/commit/269fae9e5eeb969c6a7884373aa3a32002c064e6))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-snapline 1.0.0 (2022-11-04)
## @antv/x6-plugin-snapline [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.1.0...@antv/x6-plugin-snapline@2.1.1) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
* modify the semantics of filter ([#2927](https://github.com/antvis/x6/issues/2927)) ([bc261fb](https://github.com/antvis/x6/commit/bc261fb9929aa0b4d3fa4194bcc780ea701b029e))
# @antv/x6-plugin-snapline [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-snapline@2.0.0...@antv/x6-plugin-snapline@2.1.0) (2022-11-24)
### chore
### Bug Fixes
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
* add missing script for building style ([e683155](https://github.com/antvis/x6/commit/e68315528a202cbc5a9ad256d168943e001d7116))
* export snap methods from snapline ([#2904](https://github.com/antvis/x6/issues/2904)) ([826ccdd](https://github.com/antvis/x6/commit/826ccdd9a033486ad5b90d666340e46f6c266af7))
### Features
* ✨ add dnd plugin ([269fae9](https://github.com/antvis/x6/commit/269fae9e5eeb969c6a7884373aa3a32002c064e6))
* ✨ add snapline plugin ([294672b](https://github.com/antvis/x6/commit/294672b3066b15ab834ce2a3172facc49004c950))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-snapline",
"version": "1.0.1",
"version": "2.1.4",
"description": "snapline plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,6 +27,7 @@
"build:cjs": "rss",
"build:umd": "rss",
"build:dev": "rss",
"build:less": "rss",
"build:watch": "rss",
"build:watch:esm": "rss",
"build:watch:cjs": "rss",
@ -37,17 +38,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/snapline",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,152 @@
import { Graph } from '@antv/x6'
import { Snapline } from './index'
declare module '@antv/x6/lib/graph/graph' {
interface Graph {
isSnaplineEnabled: () => boolean
enableSnapline: () => Graph
disableSnapline: () => Graph
toggleSnapline: (enabled?: boolean) => Graph
hideSnapline: () => Graph
setSnaplineFilter: (filter?: Snapline.Filter) => Graph
isSnaplineOnResizingEnabled: () => boolean
enableSnaplineOnResizing: () => Graph
disableSnaplineOnResizing: () => Graph
toggleSnaplineOnResizing: (enableOnResizing?: boolean) => Graph
isSharpSnapline: () => boolean
enableSharpSnapline: () => Graph
disableSharpSnapline: () => Graph
toggleSharpSnapline: (sharp?: boolean) => Graph
getSnaplineTolerance: () => number | undefined
setSnaplineTolerance: (tolerance: number) => Graph
}
}
Graph.prototype.isSnaplineEnabled = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
return snapline.isEnabled()
}
return false
}
Graph.prototype.enableSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.enable()
}
return this
}
Graph.prototype.disableSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.disable()
}
return this
}
Graph.prototype.toggleSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.toggleEnabled()
}
return this
}
Graph.prototype.hideSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.hide()
}
return this
}
Graph.prototype.setSnaplineFilter = function (filter?: Snapline.Filter) {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.setFilter(filter)
}
return this
}
Graph.prototype.isSnaplineOnResizingEnabled = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
return snapline.isOnResizingEnabled()
}
return false
}
Graph.prototype.enableSnaplineOnResizing = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.enableOnResizing()
}
return this
}
Graph.prototype.disableSnaplineOnResizing = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.disableOnResizing()
}
return this
}
Graph.prototype.toggleSnaplineOnResizing = function (
enableOnResizing?: boolean,
) {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.toggleOnResizing(enableOnResizing)
}
return this
}
Graph.prototype.isSharpSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
return snapline.isSharp()
}
return false
}
Graph.prototype.enableSharpSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.enableSharp()
}
return this
}
Graph.prototype.disableSharpSnapline = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.disableSharp()
}
return this
}
Graph.prototype.toggleSharpSnapline = function (sharp?: boolean) {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.toggleSharp(sharp)
}
return this
}
Graph.prototype.getSnaplineTolerance = function () {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
return snapline.getTolerance()
}
}
Graph.prototype.setSnaplineTolerance = function (tolerance: number) {
const snapline = this.getPlugin('snapline') as Snapline
if (snapline) {
snapline.setTolerance(tolerance)
}
return this
}

@ -1,6 +1,7 @@
import { Disposable, CssLoader, Graph, EventArgs } from '@antv/x6'
import { SnaplineImpl } from './snapline'
import { content } from './style/raw'
import './api'
export class Snapline extends Disposable {
private snaplineImpl: SnaplineImpl
@ -138,6 +139,10 @@ export class Snapline extends Disposable {
this.snaplineImpl.captureCursorOffset(e)
}
snapOnMoving(args: EventArgs['node:mousemove']) {
this.snaplineImpl.snapOnMoving(args)
}
// #endregion
@Disposable.dispose()
@ -149,4 +154,5 @@ export class Snapline extends Disposable {
export namespace Snapline {
export interface Options extends SnaplineImpl.Options {}
export type Filter = SnaplineImpl.Filter
}

@ -18,9 +18,6 @@ import {
export class SnaplineImpl extends View implements IDisablable {
public readonly options: SnaplineImpl.Options
protected readonly graph: Graph
protected filterShapes: { [type: string]: boolean }
protected filterCells: { [id: string]: boolean }
protected filterFunction: SnaplineImpl.FilterFunction | null
protected offset: Point.PointLike
protected timer: number | null
@ -53,7 +50,6 @@ export class SnaplineImpl extends View implements IDisablable {
this.options = { tolerance: 10, ...others }
this.offset = { x: 0, y: 0 }
this.render()
this.parseFilter()
if (!this.disabled) {
this.startListening()
}
@ -79,7 +75,6 @@ export class SnaplineImpl extends View implements IDisablable {
setFilter(filter?: SnaplineImpl.Filter) {
this.options.filter = filter
this.parseFilter()
}
protected render() {
@ -124,24 +119,6 @@ export class SnaplineImpl extends View implements IDisablable {
this.undelegateDocumentEvents()
}
protected parseFilter() {
this.filterShapes = {}
this.filterCells = {}
this.filterFunction = null
const filter = this.options.filter
if (Array.isArray(filter)) {
filter.forEach((item) => {
if (typeof item === 'string') {
this.filterShapes[item] = true
} else {
this.filterCells[item.id] = true
}
})
} else if (typeof filter === 'function') {
this.filterFunction = filter
}
}
protected onBatchStop({ name, data }: Model.EventArgs['batch:stop']) {
if (name === 'resize') {
this.snapOnResizing(data.cell, data as Node.ResizeOptions)
@ -577,13 +554,27 @@ export class SnaplineImpl extends View implements IDisablable {
return (
targetNode.id === snapNode.id ||
targetNode.isDescendantOf(snapNode) ||
this.filterShapes[targetNode.shape] ||
this.filterCells[targetNode.id] ||
(this.filterFunction &&
FunctionExt.call(this.filterFunction, this.graph, targetNode))
!this.filter(targetNode)
)
}
protected filter(node: Node) {
const filter = this.options.filter
if (Array.isArray(filter)) {
return filter.some((item) => {
if (typeof item === 'string') {
return node.shape === item
}
return node.id === item.id
})
}
if (typeof filter === 'function') {
return FunctionExt.call(filter, this.graph, node)
}
return true
}
protected update(metadata: {
verticalLeft?: number
verticalTop?: number

@ -1,130 +1,8 @@
## @antv/x6-plugin-stencil [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-stencil@1.0.0...@antv/x6-plugin-stencil@1.0.1) (2022-11-05)
## @antv/x6-plugin-stencil [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-stencil@2.0.1...@antv/x6-plugin-stencil@2.0.2) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
* **@antv/x6-plugin-dnd:** upgraded to 1.0.1
# @antv/x6-plugin-stencil 1.0.0 (2022-11-05)
## @antv/x6-plugin-stencil [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-stencil@2.0.0...@antv/x6-plugin-stencil@2.0.1) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add stencil plugin ([#2815](https://github.com/antvis/x6/issues/2815)) ([4e1fb7b](https://github.com/antvis/x6/commit/4e1fb7bef8ff5548edf2529eb27be0a66a600996))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* **@antv/x6-plugin-dnd:** upgraded to 1.0.0
# @antv/x6-plugin-stencil 1.0.0 (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add stencil plugin ([#2815](https://github.com/antvis/x6/issues/2815)) ([4e1fb7b](https://github.com/antvis/x6/commit/4e1fb7bef8ff5548edf2529eb27be0a66a600996))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* **@antv/x6-plugin-dnd:** upgraded to 1.0.0
* add missing script for building style ([e683155](https://github.com/antvis/x6/commit/e68315528a202cbc5a9ad256d168943e001d7116))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-stencil",
"version": "1.0.1",
"version": "2.0.4",
"description": "stencil plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,6 +27,7 @@
"build:cjs": "rss",
"build:umd": "rss",
"build:dev": "rss",
"build:less": "rss",
"build:watch": "rss",
"build:watch:esm": "rss",
"build:watch:cjs": "rss",
@ -37,19 +38,19 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1",
"@antv/x6-plugin-dnd": "1.0.1"
"@antv/x6": "^2.x",
"@antv/x6-plugin-dnd": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1",
"@antv/x6-plugin-dnd": "1.0.1"
"@antv/x6": "^2.x",
"@antv/x6-plugin-dnd": "^2.0.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/stencil",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -1,129 +1,13 @@
## @antv/x6-plugin-transform [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@1.0.0...@antv/x6-plugin-transform@1.0.1) (2022-11-05)
## @antv/x6-plugin-transform [2.1.1](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@2.1.0...@antv/x6-plugin-transform@2.1.1) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
### Dependencies
* **@antv/x6:** upgraded to 1.0.1
# @antv/x6-plugin-transform 1.0.0 (2022-11-05)
# @antv/x6-plugin-transform [2.1.0](https://github.com/antvis/x6/compare/@antv/x6-plugin-transform@2.0.0...@antv/x6-plugin-transform@2.1.0) (2022-11-24)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* refactor example ([#2831](https://github.com/antvis/x6/issues/2831)) ([3d8f005](https://github.com/antvis/x6/commit/3d8f005696021f1d9f91a96812ebadce179f2d73))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
* add missing script for building style ([e683155](https://github.com/antvis/x6/commit/e68315528a202cbc5a9ad256d168943e001d7116))
### Features
* add transform plugin ([#2818](https://github.com/antvis/x6/issues/2818)) ([660e2d7](https://github.com/antvis/x6/commit/660e2d7689bfa59a0f4a4a5e3c0ace70dec21e9e))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
# @antv/x6-plugin-transform 1.0.0 (2022-11-04)
### Bug Fixes
* bump rule ([c9559f2](https://github.com/antvis/x6/commit/c9559f2f30790857ff066be7d0ce99ed8933e20c))
* refactor example ([#2831](https://github.com/antvis/x6/issues/2831)) ([3d8f005](https://github.com/antvis/x6/commit/3d8f005696021f1d9f91a96812ebadce179f2d73))
* remove x6-common and x6-geometry deps ([#2830](https://github.com/antvis/x6/issues/2830)) ([5b5f5aa](https://github.com/antvis/x6/commit/5b5f5aa7ea6fded1b15abc79b9b5a5e2281b3ab9))
### chore
* bump to 2.0 ([1ffafce](https://github.com/antvis/x6/commit/1ffafcea22472f4e5b50319c91667a1eea457219))
* bump to 2.0 ([8638d43](https://github.com/antvis/x6/commit/8638d4310b67b9107e8ef1f6d7a22311f1999df0))
* bump to 2.0 ([0e258d0](https://github.com/antvis/x6/commit/0e258d0704b444103410a565fe033dae76426ad4))
* force bump to 2.0.0 ([0cab334](https://github.com/antvis/x6/commit/0cab334e4b72a4df33a371c37dfbeff8dc0ae231))
* force release 2.0-beta ([af8c588](https://github.com/antvis/x6/commit/af8c5887b3de721f125da6d71e40c3ec76d0f660))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Documentation
* clean up changelogs ([7c012f7](https://github.com/antvis/x6/commit/7c012f7360ad9b74e5292a7a8d0d04b0ec28987e))
### Features
* ✨ add transform plugin ([#2818](https://github.com/antvis/x6/issues/2818)) ([660e2d7](https://github.com/antvis/x6/commit/660e2d7689bfa59a0f4a4a5e3c0ace70dec21e9e))
* adjust event source and package deps ([#2826](https://github.com/antvis/x6/issues/2826)) ([a1bdb18](https://github.com/antvis/x6/commit/a1bdb18b1d1e1967e8e27862fed2e4fe8787a8cb))
* force release 2.0-beta ([6987d9c](https://github.com/antvis/x6/commit/6987d9ce64454cd76f697d33f96715dbdf56524a))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* bump version
* bump to 2.0
* force bump to 2.0.0
* force release 2.0-beta
* force release 2.0-beta
* force release 2.0-beta
* 2.0-beta
### Dependencies
* **@antv/x6:** upgraded to 1.0.0
* attach plugin api and events to grpah instance ([#2864](https://github.com/antvis/x6/issues/2864)) ([774f547](https://github.com/antvis/x6/commit/774f547b85522eb2411dca949d36ecfe535503f3))

@ -1,6 +1,6 @@
{
"name": "@antv/x6-plugin-transform",
"version": "1.0.1",
"version": "2.1.2",
"description": "transform plugin for X6",
"main": "lib/index.js",
"module": "es/index.js",
@ -27,6 +27,7 @@
"build:cjs": "rss",
"build:umd": "rss",
"build:dev": "rss",
"build:less": "rss",
"build:watch": "rss",
"build:watch:esm": "rss",
"build:watch:cjs": "rss",
@ -37,17 +38,17 @@
"pretest": "rss"
},
"peerDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"devDependencies": {
"@antv/x6": "1.0.1"
"@antv/x6": "^2.x"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com/tutorial/plugins/transform",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},

@ -0,0 +1,5 @@
import { TransformImpl } from './transform'
declare module '@antv/x6/lib/graph/events' {
interface EventArgs extends TransformImpl.EventArgs {}
}

@ -1,6 +1,7 @@
import { Basecoat, CssLoader, KeyValue, Node, Graph, EventArgs } from '@antv/x6'
import { TransformImpl } from './transform'
import { content } from './style/raw'
import './api'
export class Transform extends Basecoat<Transform.EventArgs> {
private graph: Graph

@ -1,224 +1,31 @@
## @antv/x6-react-components [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.0...@antv/x6-react-components@1.0.1) (2022-11-05)
## @antv/x6-react-components [2.0.4](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.3...@antv/x6-react-components@2.0.4) (2022-11-25)
### chore
* bump to 2.0 ([04cd9de](https://github.com/antvis/x6/commit/04cd9de505bd92a70f33dbc0cfc75b4f9b8126c1))
### BREAKING CHANGES
* bump to 2.0
# @antv/x6-react-components 1.0.0 (2022-11-05)
## @antv/x6-react-components [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.2...@antv/x6-react-components@2.0.3) (2022-11-25)
### Bug Fixes
* 🐛 add x6-react-components umd build ([fc91c27](https://github.com/antvis/x6/commit/fc91c271a78d5423bae0fedf6af2bc12d024971f))
* 🐛 fast switch menubar-item lead to multiple popup ([#398](https://github.com/antvis/x6/issues/398)) ([12eb2a3](https://github.com/antvis/x6/commit/12eb2a3c60df584d44b5a13cad21b3b90b0134b2))
* 🐛 fix x6-react-component release version ([e8e0a9d](https://github.com/antvis/x6/commit/e8e0a9d8eba07740c7aef9e54faf751e694f590f))
* 🐛 fix x6-react-components rollup config ([5e47faa](https://github.com/antvis/x6/commit/5e47faaa2c7186716f22128c940a503c63de25a2))
* 🐛 release x6-react-components 1.1.3 ([1ca9a1b](https://github.com/antvis/x6/commit/1ca9a1ba2c2931c9eae9fc2ab637777b92260184))
* 🐛 revert react-color version ([#1576](https://github.com/antvis/x6/issues/1576)) ([bcaa3a2](https://github.com/antvis/x6/commit/bcaa3a24bb5fa614d5c4299488af676000ed5b79))
* 🐛 update .lock file ([462c9a0](https://github.com/antvis/x6/commit/462c9a02014f696adeb908caa020fe2e50b6cc06))
* 🐛 update yarn.lock file ([313a471](https://github.com/antvis/x6/commit/313a471ca15bf26781257ab4f3b9b03d61f38bcd))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* fix react-color version to avoid bug ([#1571](https://github.com/antvis/x6/issues/1571)) ([d2d6d6c](https://github.com/antvis/x6/commit/d2d6d6c661d40ddaf3df2d794c3fbd67703a4027))
* fix react-color version to avoid bug ([#1579](https://github.com/antvis/x6/issues/1579)) ([8c6ae95](https://github.com/antvis/x6/commit/8c6ae95ec39e71069f0d0791c99530f41b9f35aa))
* import css replace less ([#1548](https://github.com/antvis/x6/issues/1548)) ([9ca4ef1](https://github.com/antvis/x6/commit/9ca4ef1553b903ce1da83e20bd9e007d1e85f993))
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([49d4371](https://github.com/antvis/x6/commit/49d43716ada672e609e4e6d9c6fdca3f494b6f68))
* 修复x6-react-component antd引入的问题 ([88d2e8b](https://github.com/antvis/x6/commit/88d2e8b2cf1132d680ef0a69741bad8d862f95f6))
* 修复x6-react-component antd引入的问题 ([ff29109](https://github.com/antvis/x6/commit/ff29109b9bc80e6e29ed6421939818904013563e))
* support antd5 in react components ([#2933](https://github.com/antvis/x6/issues/2933)) ([2ecc213](https://github.com/antvis/x6/commit/2ecc213094250b476b533b444c0f3716f88b7987))
* update react type version ([#2937](https://github.com/antvis/x6/issues/2937)) ([d4df46a](https://github.com/antvis/x6/commit/d4df46ab40c0f2fb6e7a76fc0083d7b4710555b9))
### chore
### Performance Improvements
* bump to 2.0 ([94af7fa](https://github.com/antvis/x6/commit/94af7fa7ec96e3417db9aa5d245751507ae2671e))
* bump to 2.0 ([ecffe1a](https://github.com/antvis/x6/commit/ecffe1a2a8bcf5538f027c3c54acaefc50215023))
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
* update deps ([f20127a](https://github.com/antvis/x6/commit/f20127af555d9b7beaac3a07ac308d5c0d4e53a3))
### Features
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
* upgrade react to 18 in react-components ([#2836](https://github.com/antvis/x6/issues/2836)) ([5138562](https://github.com/antvis/x6/commit/5138562515ddbd3975adc9d93514f21d6fc2bb3e))
### BREAKING CHANGES
* bump to 2.0
* bump to 2.0
* force release 2.0-beta
* 2.0-beta
# @antv/x6-react-components 1.0.0 (2022-11-04)
## @antv/x6-react-components [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.2...@antv/x6-react-components@2.0.3) (2022-11-24)
### Bug Fixes
* 🐛 add x6-react-components umd build ([fc91c27](https://github.com/antvis/x6/commit/fc91c271a78d5423bae0fedf6af2bc12d024971f))
* 🐛 fast switch menubar-item lead to multiple popup ([#398](https://github.com/antvis/x6/issues/398)) ([12eb2a3](https://github.com/antvis/x6/commit/12eb2a3c60df584d44b5a13cad21b3b90b0134b2))
* 🐛 fix x6-react-component release version ([e8e0a9d](https://github.com/antvis/x6/commit/e8e0a9d8eba07740c7aef9e54faf751e694f590f))
* 🐛 fix x6-react-components rollup config ([5e47faa](https://github.com/antvis/x6/commit/5e47faaa2c7186716f22128c940a503c63de25a2))
* 🐛 release x6-react-components 1.1.3 ([1ca9a1b](https://github.com/antvis/x6/commit/1ca9a1ba2c2931c9eae9fc2ab637777b92260184))
* 🐛 revert react-color version ([#1576](https://github.com/antvis/x6/issues/1576)) ([bcaa3a2](https://github.com/antvis/x6/commit/bcaa3a24bb5fa614d5c4299488af676000ed5b79))
* 🐛 update .lock file ([462c9a0](https://github.com/antvis/x6/commit/462c9a02014f696adeb908caa020fe2e50b6cc06))
* 🐛 update yarn.lock file ([313a471](https://github.com/antvis/x6/commit/313a471ca15bf26781257ab4f3b9b03d61f38bcd))
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* fix react-color version to avoid bug ([#1571](https://github.com/antvis/x6/issues/1571)) ([d2d6d6c](https://github.com/antvis/x6/commit/d2d6d6c661d40ddaf3df2d794c3fbd67703a4027))
* fix react-color version to avoid bug ([#1579](https://github.com/antvis/x6/issues/1579)) ([8c6ae95](https://github.com/antvis/x6/commit/8c6ae95ec39e71069f0d0791c99530f41b9f35aa))
* import css replace less ([#1548](https://github.com/antvis/x6/issues/1548)) ([9ca4ef1](https://github.com/antvis/x6/commit/9ca4ef1553b903ce1da83e20bd9e007d1e85f993))
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([49d4371](https://github.com/antvis/x6/commit/49d43716ada672e609e4e6d9c6fdca3f494b6f68))
* 修复x6-react-component antd引入的问题 ([88d2e8b](https://github.com/antvis/x6/commit/88d2e8b2cf1132d680ef0a69741bad8d862f95f6))
* 修复x6-react-component antd引入的问题 ([ff29109](https://github.com/antvis/x6/commit/ff29109b9bc80e6e29ed6421939818904013563e))
* support antd5 in react components ([#2933](https://github.com/antvis/x6/issues/2933)) ([2ecc213](https://github.com/antvis/x6/commit/2ecc213094250b476b533b444c0f3716f88b7987))
* update react type version ([#2937](https://github.com/antvis/x6/issues/2937)) ([d4df46a](https://github.com/antvis/x6/commit/d4df46ab40c0f2fb6e7a76fc0083d7b4710555b9))
### Features
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
## @antv/x6-react-components [2.0.2](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.1...@antv/x6-react-components@2.0.2) (2022-11-24)
### Bug Fixes
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
* updae react-resize-detector version ([#2930](https://github.com/antvis/x6/issues/2930)) ([d6ae519](https://github.com/antvis/x6/commit/d6ae5199c00be6429a828f537b194adddd2b6aeb))
### Features
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### Bug Fixes
* commit message E2BIG ([a2c5f9e](https://github.com/antvis/x6/commit/a2c5f9e943ccf1d7ae478af30cb5022dd72e2e99))
### chore
* release beta ([b5f3cfa](https://github.com/antvis/x6/commit/b5f3cfa2042f5196a995a38a8f41f140cabdce57))
### Features
* add scroller plugin ([#2580](https://github.com/antvis/x6/issues/2580)) ([5e0e2ac](https://github.com/antvis/x6/commit/5e0e2acde7d7e259ea27d001983e950878d0ecc8))
* support turbo ([1da55bf](https://github.com/antvis/x6/commit/1da55bfda73edaa96515998b5766e9ed5f241ee9))
### BREAKING CHANGES
* force release 2.0-beta
* 2.0-beta
## @antv/x6-react-components [1.1.16](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.15...@antv/x6-react-components@1.1.16) (2021-11-21)
### Bug Fixes
* 🐛 revert react-color version ([#1576](https://github.com/antvis/x6/issues/1576)) ([bcaa3a2](https://github.com/antvis/x6/commit/bcaa3a24bb5fa614d5c4299488af676000ed5b79))
* fix react-color version to avoid bug ([#1571](https://github.com/antvis/x6/issues/1571)) ([d2d6d6c](https://github.com/antvis/x6/commit/d2d6d6c661d40ddaf3df2d794c3fbd67703a4027))
* fix react-color version to avoid bug ([#1579](https://github.com/antvis/x6/issues/1579)) ([8c6ae95](https://github.com/antvis/x6/commit/8c6ae95ec39e71069f0d0791c99530f41b9f35aa))
## @antv/x6-react-components [1.1.15](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.14...@antv/x6-react-components@1.1.15) (2021-11-14)
### Bug Fixes
* import css replace less ([#1548](https://github.com/antvis/x6/issues/1548)) ([9ca4ef1](https://github.com/antvis/x6/commit/9ca4ef1553b903ce1da83e20bd9e007d1e85f993))
## @antv/x6-react-components [1.1.14](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.13...@antv/x6-react-components@1.1.14) (2021-09-13)
## @antv/x6-react-components [1.1.13](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.12...@antv/x6-react-components@1.1.13) (2021-06-16)
### Bug Fixes
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
## @antv/x6-react-components [1.1.12](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.11...@antv/x6-react-components@1.1.12) (2021-06-11)
## @antv/x6-react-components [1.1.11](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.10...@antv/x6-react-components@1.1.11) (2021-06-09)
## @antv/x6-react-components [1.1.10](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.9...@antv/x6-react-components@1.1.10) (2021-05-30)
### Bug Fixes
* 🐛 fix x6-react-component release version ([508c959](https://github.com/antvis/x6/commit/508c9592e9c2dda5888713c5b69b470ac35697fa))
## @antv/x6-react-components [1.1.9](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.8...@antv/x6-react-components@1.1.9) (2021-04-01)
### Bug Fixes
* 🐛 fix x6-react-components rollup config ([66190e5](https://github.com/antvis/x6/commit/66190e5b980f6061d3219906e9dd200d20e61534))
## @antv/x6-react-components [1.1.8](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.7...@antv/x6-react-components@1.1.8) (2021-03-30)
## @antv/x6-react-components [1.1.7](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.6...@antv/x6-react-components@1.1.7) (2021-03-30)
## @antv/x6-react-components [1.1.6](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.5...@antv/x6-react-components@1.1.6) (2021-03-29)
## @antv/x6-react-components [1.1.5](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.4...@antv/x6-react-components@1.1.5) (2021-03-24)
### Bug Fixes
* 修复x6-react-component antd引入的问题 ([edf947d](https://github.com/antvis/x6/commit/edf947debc2d2ea22569a116c41c7af27d81d331))
* 修复x6-react-component antd引入的问题 ([b261160](https://github.com/antvis/x6/commit/b261160299a92a796cda8ca96710d7b3447aa815))
## @antv/x6-react-components [1.1.4](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.3...@antv/x6-react-components@1.1.4) (2021-03-24)
### Bug Fixes
* 🐛 release x6-react-components 1.1.3 ([e362ae2](https://github.com/antvis/x6/commit/e362ae273fce752f0ee18da604cd6d3723320feb))
## @antv/x6-react-components [1.1.3](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.2...@antv/x6-react-components@1.1.3) (2021-03-24)
### Bug Fixes
* 🐛 update .lock file ([5fe675c](https://github.com/antvis/x6/commit/5fe675cd1a68a8c50c1dc12fd22c8eb7c54e1e42))
* 🐛 update yarn.lock file ([22817d1](https://github.com/antvis/x6/commit/22817d1505e017b73fcc92896cd4032d42fe82b2))
## @antv/x6-react-components [1.1.2](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.1.1...@antv/x6-react-components@1.1.2) (2021-03-23)
## @antv/x6-react-components [1.0.3](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.2...@antv/x6-react-components@1.0.3) (2021-01-13)
## @antv/x6-react-components [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.1...@antv/x6-react-components@1.0.2) (2021-01-12)
## @antv/x6-react-components [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.0...@antv/x6-react-components@1.0.1) (2021-01-11)
### Bug Fixes
* 🐛 add x6-react-components umd build ([89421c8](https://github.com/antvis/x6/commit/89421c88afa141fe753cfca65a3c9132007057ce))
* 🐛 fast switch menubar-item lead to multiple popup ([#398](https://github.com/antvis/x6/issues/398)) ([8d4644f](https://github.com/antvis/x6/commit/8d4644f27c1f837a422703bcb1ef049c9c2794b8))
## @antv/x6-react-components [1.0.4](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.3...@antv/x6-react-components@1.0.4) (2020-12-28)
### Bug Fixes
* 🐛 add x6-react-components umd build ([89421c8](https://github.com/antvis/x6/commit/89421c88afa141fe753cfca65a3c9132007057ce))
## @antv/x6-react-components [1.0.3](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.2...@antv/x6-react-components@1.0.3) (2020-12-21)
## @antv/x6-react-components [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.1...@antv/x6-react-components@1.0.2) (2020-12-13)
### Bug Fixes
* 🐛 fast switch menubar-item lead to multiple popup ([#398](https://github.com/antvis/x6/issues/398)) ([8d4644f](https://github.com/antvis/x6/commit/8d4644f27c1f837a422703bcb1ef049c9c2794b8))
## @antv/x6-react-components [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-react-components@1.0.0...@antv/x6-react-components@1.0.1) (2020-12-07)
## @antv/x6-react-components [0.10.20](https://github.com/antvis/x6/compare/@antv/x6-react-components@0.10.19...@antv/x6-react-components@0.10.20) (2020-11-17)
## @antv/x6-react-components [0.10.20-beta.1](https://github.com/antvis/x6/compare/@antv/x6-react-components@0.10.19...@antv/x6-react-components@0.10.20-beta.1) (2020-11-17)
## @antv/x6-react-components [0.10.19](https://github.com/antvis/x6/compare/@antv/x6-react-components@0.10.18...@antv/x6-react-components@0.10.19) (2020-11-10)
## @antv/x6-react-components [2.0.1](https://github.com/antvis/x6/compare/@antv/x6-react-components@2.0.0...@antv/x6-react-components@2.0.1) (2022-11-24)

@ -1,6 +1,6 @@
{
"name": "@antv/x6-react-components",
"version": "1.0.1",
"version": "2.0.5",
"description": "React components for building x6 editors",
"main": "lib/index.js",
"module": "es/index.js",
@ -48,7 +48,7 @@
"antv"
],
"peerDependencies": {
"antd": ">=4.4.2",
"antd": ">=4.4.2 || >=5.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
@ -63,20 +63,20 @@
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@types/react-color": "^3.0.1",
"@types/react-resize-detector": "^6.0.0",
"@types/react-resize-detector": "^6.1.0",
"@types/react-dom": "^18.0.9",
"@types/ua-parser-js": "^0.7.33",
"antd": "^4.4.2"
"antd": "^5.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"author": {
"name": "bubkoo",
"email": "bubkoo.wy@gmail.com"
},
"license": "MIT",
"homepage": "https://github.com/antvis/x6",
"homepage": "https://x6.antv.antgroup.com",
"bugs": {
"url": "https://github.com/antvis/x6/issues"
},
@ -88,6 +88,5 @@
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"gitHead": "576fa342fa65a6867ead29f6801a30dcb31bcdb5"
}
}

@ -5,7 +5,6 @@ import React from 'react'
import classNames from 'classnames'
import { Popover } from 'antd'
import { PopoverProps } from 'antd/es/popover'
import 'antd/es/popover/style/index.css'
import addEventListener from 'rc-util/lib/Dom/addEventListener'
import {
SketchPicker,
@ -104,8 +103,12 @@ export class ColorPicker extends React.Component<
const popoverProps: PopoverProps = {}
if (disabled) {
popoverProps.visible = false
// Support for antd 5.0
popoverProps.open = false
} else {
popoverProps.visible = this.state.active
// Support for antd 5.0
popoverProps.open = this.state.active
}
const colorStr =

Some files were not shown because too many files have changed in this diff Show More