Compare commits
266 Commits
@antv/x6-p
...
@antv/x6-s
Author | SHA1 | Date | |
---|---|---|---|
04656f33f4 | |||
441dd564b4 | |||
9ccda3e96f | |||
979b2556e9 | |||
153013a606 | |||
2c7b966f45 | |||
b199153f3b | |||
608ce9ac6c | |||
eb921f7018 | |||
68e7132213 | |||
62aa5323ce | |||
e380cba7d9 | |||
8fada570e4 | |||
1096bf171b | |||
1834cd2143 | |||
1cf9cb654f | |||
b392d78856 | |||
58c0fe459c | |||
8a510fa8f8 | |||
668c93242f | |||
c122b2122c | |||
3b9957efbb | |||
1f83a2b8a8 | |||
6699c2bd00 | |||
7192209a5c | |||
5da5575451 | |||
3377049a49 | |||
4e76734cee | |||
3a59703f1c | |||
45218c36f6 | |||
17b36e21c7 | |||
1682a1d953 | |||
bcf3380d2b | |||
24368d4f86 | |||
3265fe5b98 | |||
5599286473 | |||
d64150bfad | |||
cae8625feb | |||
d8f1729f09 | |||
20c170b44a | |||
0e8769642a | |||
bd30f7f61d | |||
e3e7cfc66f | |||
c86ed1a031 | |||
ae179eb2cd | |||
2a3e523b1b | |||
b5af7844af | |||
9c48ad8dfc | |||
1a5f1655df | |||
90dad14d7e | |||
323e01559d | |||
bfc8d7f17a | |||
df24392728 | |||
fc940fa53c | |||
604c848c2a | |||
7b091f35de | |||
95c72c3033 | |||
0c91218b64 | |||
61c030a162 | |||
5c5f3e5319 | |||
06a8f28c2d | |||
ece198265b | |||
6abd0683ea | |||
fff95806c8 | |||
a069449782 | |||
3b25683529 | |||
45337e4a62 | |||
91fc97791b | |||
cdd0913eee | |||
a696009ede | |||
c808ca6d2b | |||
d3301d33d5 | |||
0029555458 | |||
cc18463c53 | |||
fb8098c1c0 | |||
c250caba6a | |||
019333d79d | |||
33c2e59207 | |||
844ee5fa04 | |||
96010e3b52 | |||
a98e97db11 | |||
30c2ed2655 | |||
3a020d17c3 | |||
d8e1e637d8 | |||
2d04848d52 | |||
e2bb71d954 | |||
8b145941ec | |||
2c7a04a6f4 | |||
dfa8c492da | |||
3b668feb4e | |||
07f4739979 | |||
824560ddda | |||
9e37ea9f78 | |||
610349d924 | |||
2f92e33d0e | |||
df540d9b79 | |||
3bc37971f8 | |||
50284c2d51 | |||
15284e778a | |||
1a0e8cf969 | |||
1089109b08 | |||
faf294a5ec | |||
25461fd985 | |||
35f2966219 | |||
26df790b8c | |||
bc7efe8db9 | |||
abeb009d0a | |||
ad08cf87ef | |||
16c2ef35e0 | |||
187e318aee | |||
f07abff980 | |||
4a6a634a8a | |||
627368e0dd | |||
604c0244cd | |||
80898ada1c | |||
057d5209ff | |||
2070828425 | |||
502422fe24 | |||
8daf0fd62c | |||
a108b50a66 | |||
525bac1907 | |||
34ec3d29ab | |||
74fb7b86d7 | |||
1fb2d8308a | |||
b2b8ac578c | |||
1b03004ee5 | |||
53c9eaf626 | |||
05d1fe35d6 | |||
b05d1596dd | |||
8843212f53 | |||
f920d5a4ee | |||
6a81805075 | |||
94f90425f6 | |||
cd85c5bd26 | |||
16b6c89e6b | |||
76be8db8ca | |||
18c0edf483 | |||
4978110b45 | |||
8eb43874a5 | |||
83d0295596 | |||
2c40e3d129 | |||
d903e5a5b6 | |||
c350371d3c | |||
9f3ba0f3b4 | |||
b0555151e9 | |||
1d324df545 | |||
d6df2d5981 | |||
273102322b | |||
1dcab69b18 | |||
cb0cfdeb4d | |||
bdba8cef5c | |||
6c4244c747 | |||
e6a1a71932 | |||
7d64596767 | |||
54725040f2 | |||
a2a2e657e9 | |||
593416d8d9 | |||
96fc0d79cb | |||
85aa3c82ca | |||
f20127af55 | |||
f275d3df1e | |||
3a1f34ecfd | |||
279caf5173 | |||
2dcf5d2461 | |||
d83837d85a | |||
41a64aa1d8 | |||
d4df46ab40 | |||
f448f72417 | |||
557d2df152 | |||
5edd9ba5f2 | |||
bfd1103fd4 | |||
75f42978cb | |||
2ecc213094 | |||
16c19e0591 | |||
02d95cfeea | |||
602fcfa0ed | |||
4be1397374 | |||
e326d8beb9 | |||
d6ae5199c0 | |||
97e758fee6 | |||
fabd9d5ed9 | |||
08a38bfabd | |||
a6055a2b89 | |||
083948a040 | |||
bc261fb992 | |||
33a2ba2c04 | |||
40d26f87c2 | |||
f901d2c149 | |||
da99354379 | |||
28111565fa | |||
85308db9a0 | |||
b58ced43f6 | |||
9b6c5420aa | |||
6fc0344552 | |||
86fed91719 | |||
2ceee7d067 | |||
a4a1b37413 | |||
14acda8f4b | |||
8af0f1c676 | |||
58853d9ac2 | |||
7551e782c1 | |||
662f138fca | |||
f6001a4619 | |||
e0e7e2d80f | |||
8d19fbc868 | |||
5cd3809859 | |||
847f225632 | |||
826ccdd9a0 | |||
cee4aa4e53 | |||
4c87e47847 | |||
f2be4b3570 | |||
febf71b6a6 | |||
9eae1a304f | |||
7526379684 | |||
ee4ed4053f | |||
047692f4f8 | |||
53a3f63aca | |||
853b35fbfb | |||
bb9e560fd5 | |||
86412e23d2 | |||
1f1e5bc8b2 | |||
774f547b85 | |||
2194769e36 | |||
e68315528a | |||
6e7fa9d602 | |||
1f42ecda5e | |||
b450a467ce | |||
189352a09c | |||
4f3e589988 | |||
b59ff6916c | |||
30c6a522f5 | |||
4edee83946 | |||
10347d069b | |||
d9d68d182e | |||
3ef671c223 | |||
45185ed50a | |||
5295ecc957 | |||
ea92193494 | |||
8806adc673 | |||
09e8dfda8b | |||
1283b74cdb | |||
c075db4822 | |||
2727cab039 | |||
c2f5c75b2b | |||
148807ce4f | |||
a01f71730d | |||
af7993deda | |||
f130b41659 | |||
ef505fd8cf | |||
d028dbfa3e | |||
9cad409a98 | |||
41cbeb189c | |||
08d4cd0b38 | |||
69f39ba526 | |||
8f91c96631 | |||
c3600b642f | |||
dc0f905824 | |||
aede9b3ee2 | |||
44f89a1e1a | |||
6448ec31a8 | |||
d704d7fb03 | |||
bcc3fb5f50 | |||
c5a71dee65 | |||
6b112db109 | |||
6c82b21f9e | |||
79e0fac6e4 |
.github/workflows
auto-close-fixed-issues.ymlauto-comment.yml
.gitignorebackup
ci.ymlcodeql.ymlconfig
create-issue-branch.ymldeploy-sites.ymllabel-commands.ymllock.ymlneeds-more-info.ymlpotential-duplicates.ymlpr-label-branch-name.ymlpr-label-file-paths.ymlpr-label-patch-size.ymlpr-label-status.ymlpr-label-title-body.ymlpreview.ymlrebase.ymlrelease.ymlreport-monthly.ymlreport-weekly.ymlslash-commands.ymlstale.ymlsync-labels.ymlupdate-authors.ymlupdate-contributors.ymlupdate-license.ymlwelcome.yml.husky
.lgtm.yml.prettierignore.releaserc.stylelintrcCONTRIBUTORSCONTRIBUTORS.svgLICENSEREADME.en-us.mdREADME.mdexamples/x6-example-features
CHANGELOG.mdpackage.json
karma.conf.jspackage.jsonsrc
packages
x6-common
CHANGELOG.mdpackage.json
src
x6-geometry
x6-plugin-clipboard
x6-plugin-dnd
x6-plugin-export
x6-plugin-history
x6-plugin-keyboard
x6-plugin-minimap
x6-plugin-scroller
x6-plugin-selection
x6-plugin-snapline
x6-plugin-stencil
x6-plugin-transform
x6-react-components
CHANGELOG.mdpackage.json
src
auto-scroll-box/style
color-picker
context-menu/style
dropdown/style
menu/style
menubar
scroll-box/style
scrollbar/style
split-box/style
style
toolbar
x6-react-shape
x6-vue-shape
x6
scripts
sites
x6-sites-demos-helper
x6-sites-demos
CHANGELOG.mdpackage.json
packages
api
graph
async
auto-resize
checkview
coord
registry
attr
background
flip-x
flip-xy
flip-y
watermark
connection-point/playground
connector
jumpover
normal
rounded
smooth
wobble
edge-anchor/playground
edge-tool
anchor
arrowhead
boundary
button-remove
button
custom-arrowhead
custom-vertices
segments
vertices
filter
blur
brightness
contrast
drop-shadow
gray-scale
highlight
hue-rotate
invert
outline
saturate
sepia
grid
dot
double-mesh
fixed-dot
mesh
node-anchor/playground
node-tool
boundary
button-remove
button
custom-button
editor
port-label-layout
inside-outside
radial
side
port-layout
absolute
ellipse-spread
ellipse
line
side
sin
router
ui
auto-scrollbox/basic
color-picker/basic
contextmenu/basic
dropdown/basic
menu/basic
menubar/basic
scrollbox/basic
splitbox/basic
toolbar/basic
scene/sankey
tutorial
advanced
animation
along-path
animate-transform
animate
football
signal
ufo
yellow-ball
layout
circular
dagre
grid
react
html-shape
react-label-base
react-label-markup
react-port
react-shape
basic
background/playground
clipboard/playground
dnd
dnd
stencil
edge
connector
custom-marker
labels
native-marker
router
style
vertices
grid/playground
group
collapsable
embed-edge
embedding
expand-shrink
inside
outside
restrict
history/playground
keyboard/playground
minimap/playground
mousewheel/playground
node/style
port
best-practice
connect-to-port
default-port-label
default-port-style
default-port
port-label-layout
port-layout
scroller/playground
selection/playground
snapline/playground
getting-started
background
edge-shape
edge-style
helloworld
node-shape
node-style
transform
intermediate
attrs
edge-relative-position
edge-subelement-labels
ref-elem
ref-node
custom-edge/custom-edge
custom-node/custom-node
edge-labels
append-label
label-attrs
label-markup
label-offset
label-position
label-rotate
events
custom-click
native-click
interacting
connecting
resizing
rotating
marker
serialization
to-json-diff
to-json
tools
x6-sites
.dumi
.dumirc.ts.eslintrc.gitignoreCHANGELOG.mdCNAMELEGAL.mddocs
api
graph
background.en.mdbackground.zh.mdclipboard.en.mdclipboard.zh.mdcoordinate.en.mdcoordinate.zh.mdgraph.en.mdgraph.zh.mdgrid.en.mdgrid.zh.mdhistory.en.mdhistory.zh.mdinteraction.en.mdinteraction.zh.mdkeyboard.en.mdkeyboard.zh.mdminimap.en.mdminimap.zh.mdmodel.en.mdmousewheel.en.mdmousewheel.zh.mdother.en.mdother.zh.mdpanning.zh.mdscroller.en.mdscroller.zh.mdselecting.en.mdselecting.zh.mdsnapline.en.mdsnapline.zh.mdtransform.en.mdtransform.zh.mdview.en.mdview.zh.md
interacting
model
registry
attr.en.mdattr.zh.mdbackground.en.mdbackground.zh.mdconnection-point.en.mdconnection-point.zh.mdconnector.en.mdconnector.zh.mdedge-anchor.en.mdedge-anchor.zh.mdedge-tool.en.mdedge-tool.zh.mdfilter.en.mdfilter.zh.mdgrid.en.mdgrid.zh.mdhighlighter.en.mdhighlighter.zh.mdmarker.en.mdmarker.zh.mdnode-anchor.en.mdnode-anchor.zh.mdnode-tool.en.mdnode-tool.zh.mdport-label-layout.en.mdport-label-layout.zh.mdport-layout.en.mdport-layout.zh.mdrouter.en.mdrouter.zh.md
view
temp
tutorial
about.en.mdabout.zh.md
advanced
basic
background.en.mdbackground.zh.mdcell.en.mdcell.zh.mdclipboard.en.mdclipboard.zh.mddnd.en.mddnd.zh.mdedge.en.mdedge.zh.mdevents.zh.mdgraph.en.mdgraph.zh.mdgrid.en.mdgrid.zh.mdgroup.en.mdgroup.zh.mdhistory.en.mdhistory.zh.mdinteracting.en.mdinteracting.zh.mdkeyboard.en.mdkeyboard.zh.mdminimap.en.mdminimap.zh.mdmousewheel.en.mdmousewheel.zh.mdnode.en.mdnode.zh.mdport.en.mdport.zh.mdscroller.en.mdscroller.zh.mdselection.en.mdselection.zh.mdserialization.zh.mdsnapline.en.mdsnapline.zh.md
contact.en.mdcontact.zh.mdepilog.en.mdepilog.zh.mdgetting-started.en.mdgetting-started.zh.mdintermediate
attrs.en.mdconnection-point.zh.mdcustom-edge.en.mdcustom-edge.zh.mdcustom-node.en.mdcustom-node.zh.mdedge-labels.en.mdevents.en.mdevents.zh.mdgroup.zh.mdhtml.mdmarker.en.mdreact.zh.mdserialization.en.mdserialization.zh.mdtools.en.mdtools.zh.mdvue.md
log.en.mdlog.zh.mdplugins
clipboard.zh.mddnd.zh.mdexport.zh.mdhistory.zh.mdkeyboard.zh.mdminimap.zh.mdscroller.zh.mdselection.zh.mdsnapline.zh.mdstencil.mdtransform.zh.md
update.zh.mdexamples
animation/smil
edge
connector/demo
edge/demo
tool/demo
graph
scroller
snapline
layout/tree/demo
node
custom-node/demo
group/demo
port
showcase
public
data
algorithm-category.jsonbpmn.jsonclass.jsondag.jsondata-processing-dag.jsonelkdata.jsoner.jsonmindmap.jsonswimlane.json
demos
site
src
tutorial
basic
edge
connector
custom-marker
labels
native-marker
prop
registry
router
vertices
event/custom-click
graph
auto-resize
background-grid
panning-mousewheel
transform
interacting
connecting
embedding
highlighting
interacting
validate
node
ports
serialization/to-json
getting-started
intermediate
connection-point/multi
group
collapsable
embed-edge
expand-shrink
restrict
html
react
tools
vue
basic
update
plugins
clipboard
dnd
history
keyboard
minimap
scroller
selection
snapline
stencil
transform
typings
x6-svg-to-shape
@ -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 }}.
|
||||
|
5
.github/workflows/auto-comment.yml
vendored
5
.github/workflows/auto-comment.yml
vendored
@ -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 }}
|
||||
|
6
.github/workflows/backup/auto-assign.yml
vendored
6
.github/workflows/backup/auto-assign.yml
vendored
@ -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
|
||||
|
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
||||
|
42
.github/workflows/codeql.yml
vendored
Normal file
42
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: ⛵️ CodeQL
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "bot", "gh-pages", "v1" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
schedule:
|
||||
- cron: "41 2 * * 1"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ javascript ]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config-file: ./.github/workflows/config/codeql.yml
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{ matrix.language }}"
|
7
.github/workflows/config/codeql.yml
vendored
Normal file
7
.github/workflows/config/codeql.yml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
paths-ignore:
|
||||
- sites/public
|
||||
query-filters:
|
||||
- exclude:
|
||||
id: js/use-before-declaration
|
||||
- exclude:
|
||||
id: js/polynomial-redos
|
6
.github/workflows/create-issue-branch.yml
vendored
6
.github/workflows/create-issue-branch.yml
vendored
@ -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 }}
|
||||
|
6
.github/workflows/deploy-sites.yml
vendored
6
.github/workflows/deploy-sites.yml
vendored
@ -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
|
||||
|
6
.github/workflows/label-commands.yml
vendored
6
.github/workflows/label-commands.yml
vendored
@ -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
.github/workflows/lock.yml
vendored
6
.github/workflows/lock.yml
vendored
@ -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.
|
||||
|
6
.github/workflows/needs-more-info.yml
vendored
6
.github/workflows/needs-more-info.yml
vendored
@ -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
.github/workflows/potential-duplicates.yml
vendored
6
.github/workflows/potential-duplicates.yml
vendored
@ -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
.github/workflows/pr-label-branch-name.yml
vendored
6
.github/workflows/pr-label-branch-name.yml
vendored
@ -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 }}
|
||||
|
6
.github/workflows/pr-label-file-paths.yml
vendored
6
.github/workflows/pr-label-file-paths.yml
vendored
@ -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
|
||||
|
6
.github/workflows/pr-label-patch-size.yml
vendored
6
.github/workflows/pr-label-patch-size.yml
vendored
@ -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"
|
||||
|
6
.github/workflows/pr-label-status.yml
vendored
6
.github/workflows/pr-label-status.yml
vendored
@ -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 }}
|
||||
|
6
.github/workflows/pr-label-title-body.yml
vendored
6
.github/workflows/pr-label-title-body.yml
vendored
@ -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: >
|
||||
[
|
||||
{
|
||||
|
6
.github/workflows/preview.yml
vendored
6
.github/workflows/preview.yml
vendored
@ -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
|
||||
|
6
.github/workflows/rebase.yml
vendored
6
.github/workflows/rebase.yml
vendored
@ -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 }}
|
||||
|
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@ -15,7 +15,8 @@ jobs:
|
||||
steps:
|
||||
- name: ⤵️ Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: 🎉 Setup nodejs
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
@ -44,40 +45,33 @@ jobs:
|
||||
- name: 🚧 Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile --ignore-scripts
|
||||
|
||||
# - name: 📦 build
|
||||
# run: pnpm run build
|
||||
- name: 📦 build
|
||||
run: pnpm run build
|
||||
|
||||
# - name: ✅ Test
|
||||
# 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 --combine-commits --comment-footer 'Thanks for being a part of the [AntV](https://github.com/antvis) community! 💪💯'
|
||||
env:
|
||||
SRM_DEBUG: ${{ secrets.SRM_DEBUG }}
|
||||
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
.github/workflows/report-monthly.yml
vendored
6
.github/workflows/report-monthly.yml
vendored
@ -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
.github/workflows/report-weekly.yml
vendored
6
.github/workflows/report-weekly.yml
vendored
@ -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
.github/workflows/slash-commands.yml
vendored
6
.github/workflows/slash-commands.yml
vendored
@ -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
.github/workflows/stale.yml
vendored
6
.github/workflows/stale.yml
vendored
@ -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!
|
||||
|
||||
|
6
.github/workflows/sync-labels.yml
vendored
6
.github/workflows/sync-labels.yml
vendored
@ -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
|
||||
|
9
.github/workflows/update-authors.yml
vendored
9
.github/workflows/update-authors.yml
vendored
@ -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]'
|
||||
|
6
.github/workflows/update-contributors.yml
vendored
6
.github/workflows/update-contributors.yml
vendored
@ -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
|
||||
|
6
.github/workflows/update-license.yml
vendored
6
.github/workflows/update-license.yml
vendored
@ -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
.github/workflows/welcome.yml
vendored
8
.github/workflows/welcome.yml
vendored
@ -8,21 +8,19 @@ 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 }}
|
||||
|
||||
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
|
||||
|
||||
To help make it easier for us to investigate your issue, please follow the [contributing guidelines](https://github.com/antvis/X6/blob/master/CONTRIBUTING.md).
|
||||
|
||||
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
|
||||
|
||||
FIRST_PR: |
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,3 +15,5 @@ dist
|
||||
tmp
|
||||
test/coverage
|
||||
packages/**/src/style/raw.ts
|
||||
.eslintcache
|
||||
.stylelintcache
|
||||
|
14
.husky/pre-push
Executable file
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
.lgtm.yml
12
.lgtm.yml
@ -1,12 +0,0 @@
|
||||
# @see https://help.semmle.com/lgtm-enterprise/user/help/lgtm.yml-configuration-file.html
|
||||
# @template https://lgtm.com/static/downloads/lgtm.template.yml
|
||||
|
||||
queries:
|
||||
- exclude: js/use-before-declaration
|
||||
- exclude: js/polynomial-redos
|
||||
|
||||
extraction:
|
||||
javascript:
|
||||
index:
|
||||
filters:
|
||||
- exclude: "sites/x6-sites/static"
|
@ -12,5 +12,5 @@ es/
|
||||
lib/
|
||||
dist/
|
||||
coverage/
|
||||
sites/x6-sites/static/demos
|
||||
sites/public
|
||||
csstype.ts
|
||||
|
14
.releaserc
14
.releaserc
@ -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 }
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -27,7 +31,7 @@
|
||||
[
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"npmPublish": false
|
||||
"npmPublish": true
|
||||
}
|
||||
],
|
||||
[
|
||||
|
@ -15,6 +15,11 @@
|
||||
"no-invalid-double-slash-comments": null,
|
||||
"no-descending-specificity": null,
|
||||
"declaration-empty-line-before": null,
|
||||
"no-duplicate-selectors": null
|
||||
"no-duplicate-selectors": null,
|
||||
"value-no-vendor-prefix": null,
|
||||
"selector-pseudo-class-no-unknown": null,
|
||||
"selector-class-pattern": null,
|
||||
"keyframes-name-pattern": null,
|
||||
"number-max-precision": null
|
||||
}
|
||||
}
|
||||
|
38
CONTRIBUTORS
38
CONTRIBUTORS
@ -1,7 +1,7 @@
|
||||
BARM <284942955@qq.com>
|
||||
Candy <563378816@qq.com>
|
||||
Chaoqi <HAN>
|
||||
Clifford <ajard>
|
||||
Chaoqi ZHANG <prncoprs@163.com>
|
||||
Clifford Fajardo <cliffordfajardo@users.noreply.github.com>
|
||||
DaiGang <42136433+daigang666@users.noreply.github.com>
|
||||
Dong <48054715+halodong@users.noreply.github.com>
|
||||
Draco <Draco.coder@gmail.com>
|
||||
@ -10,13 +10,15 @@ Eve-Sama <948832626@qq.com>
|
||||
Gossypol <31892817+gossypol@users.noreply.github.com>
|
||||
ImgBotApp <ImgBotHelp@gmail.com>
|
||||
Indomi <indomi126@gmail.com>
|
||||
James <san>
|
||||
Jógvan <lse>
|
||||
Ken <ei>
|
||||
James Tsang <wtzeng1@gmail.com>
|
||||
Jógvan Olsen <jogvanolsen@hotmail.com>
|
||||
Ken Geis <geis.ken@gmail.com>
|
||||
Kent Wood <minzojian@hotmail.com>
|
||||
Limbo <49612796+JUST-Limbo@users.noreply.github.com>
|
||||
Lixu <37231473+wflixu@users.noreply.github.com>
|
||||
Lloyd <ho>
|
||||
Lloyd Zhou <lloydzhou@users.noreply.github.com>
|
||||
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>
|
||||
@ -24,16 +26,22 @@ NewByVector <NewByVector@users.noreply.github.com>
|
||||
Olive.Wang <olivewind.wang@gmail.com>
|
||||
Opportunity <opportunity@live.in>
|
||||
Questions <chip@twostewards.com>
|
||||
RuiLin <on>
|
||||
RuiLin Dong <48054715+halodong@users.noreply.github.com>
|
||||
SSC <273702440@qq.com>
|
||||
Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com>
|
||||
Simon He <57086651+Simon-He95@users.noreply.github.com>
|
||||
Sindori <441933726@qq.com>
|
||||
Struggle <1178825961@qq.com>
|
||||
Struggle Roue <47975400+struggleRoue@users.noreply.github.com>
|
||||
Susan <527971893@qq.com>
|
||||
Thomas <eugne>
|
||||
Tony <>
|
||||
Thomas Zeugner <tomsoftware@gmx.de>
|
||||
Tony Wu <93302820+tonywu6@users.noreply.github.com>
|
||||
Utopia <greatauk11@gmail.com>
|
||||
XLZY <1017866168@qq.com>
|
||||
Xingjian <han>
|
||||
Zhenyu <o>
|
||||
Xia Wenqi <xiawenqi90@gmail.com>
|
||||
Xingjian Zhang <44231913+THUzxj@users.noreply.github.com>
|
||||
Zhenyu Hou <skyking_H@hotmail.com>
|
||||
_XiaoTian <istianlei@qq.com>
|
||||
arthur657834 <kingkom7834@126.com>
|
||||
boyu.zlj <boyu.zlj@antgroup.com>
|
||||
breezefaith <nyzhangzc@qq.com>
|
||||
@ -57,32 +65,38 @@ myzxlin <myzxlin@163.com>
|
||||
newbyvector <vectorse@126.com>
|
||||
niexq <1879633916@qq.com>
|
||||
niexq <niexq@firstgrid.cn>
|
||||
njshuisheng <34205271+njshuisheng@users.noreply.github.com>
|
||||
pengxingjian.pxj <pengxingjian.pxj@alibaba-inc.com>
|
||||
pfdgithub <pfdgithub@users.noreply.github.com>
|
||||
qingchi <qinky94@163.com>
|
||||
qu <33251372+Qujh97@users.noreply.github.com>
|
||||
sallen450 <qinghua10199@gmail.com>
|
||||
semantic-release-bot <semantic-release-bot@martynus.net>
|
||||
siaikin <abc1310054026@outlook.com>
|
||||
vector <vectorse@126.com>
|
||||
wenbei <38773084+wb-wenbei@users.noreply.github.com>
|
||||
wgf <34190465+evelope@users.noreply.github.com>
|
||||
wind <>
|
||||
wind X <35559153+XueMeijing@users.noreply.github.com>
|
||||
wjqsummer <52412389+wjqsummer@users.noreply.github.com>
|
||||
wtzeng1 <wtzeng1@gmail.com>
|
||||
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>
|
||||
依枫 <deng25st@163.com>
|
||||
偏右 <afc163@gmail.com>
|
||||
小耀 <jinyue.gjy@antfin.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>
|
||||
|
119
CONTRIBUTORS.svg
119
CONTRIBUTORS.svg
File diff suppressed because one or more lines are too long
Before (image error) Size: 9.7 MiB After (image error) Size: 13 MiB |
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021-2022 Alipay.inc
|
||||
Copyright (c) 2021-2023 Alipay.inc
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -17,7 +17,7 @@
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://x6.antv.antgroup.com/"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
</p>
|
||||
|
||||
## Features
|
||||
@ -84,8 +84,8 @@ graph.addEdge({
|
||||
|
||||
## Links
|
||||
|
||||
- [Documents](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [Samples](https://x6.antv.vision/zh/examples/gallery)
|
||||
- [Documents](https://x6.antv.antgroup.com/tutorial/about)
|
||||
- [Samples](https://x6.antv.antgroup.com/examples)
|
||||
- [Blog](https://www.yuque.com/antv/x6/gcinvi)
|
||||
- [Versioning Release Note](https://www.yuque.com/antv/x6/bbfu6r)
|
||||
- [FAQ](https://www.yuque.com/antv/x6/be9pfx)
|
||||
|
38
README.md
38
README.md
@ -6,18 +6,17 @@
|
||||
<p align="center"><strong>提供简单易用的节点定制能力和开箱即用的交互组件,方便我们快速搭建流程图、DAG 图、ER 图等图应用</strong></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/workflow/status/antvis/x6/%F0%9F%91%B7%E3%80%80CI/master?logo=github&style=flat-square"></a>
|
||||
<a href="https://app.codecov.io/gh/antvis/X6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&style=flat-square&token=15CO54WYUV"></a>
|
||||
<a href="https://lgtm.com/projects/g/antvis/x6/context:javascript"><img alt="Language grade: JavaScript" src="https://img.shields.io/lgtm/grade/javascript/g/antvis/x6.svg?logo=lgtm&style=flat-square"></a>
|
||||
<a href="https://www.npmjs.com/package/@antv/x6"><img alt="NPM Package" src="https://img.shields.io/npm/v/@antv/x6.svg?style=flat-square"></a>
|
||||
<a href="https://www.npmjs.com/package/@antv/x6"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@antv/x6?logo=npm&style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/actions/workflow/status/antvis/x6/ci.yml?branch=master&style=for-the-badge&logo=github"></a>
|
||||
<!-- <a href="https://app.codecov.io/gh/antvis/X6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&style=for-the-badge&token=15CO54WYUV"></a> -->
|
||||
<a href="https://www.npmjs.com/package/@antv/x6"><img alt="NPM Package" src="https://img.shields.io/npm/v/@antv/x6.svg?logo=npm&style=for-the-badge"></a>
|
||||
<a href="https://www.npmjs.com/package/@antv/x6"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@antv/x6?logo=npm&style=for-the-badge"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=for-the-badge" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=for-the-badge"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=for-the-badge"></a>
|
||||
<a href="https://x6.antv.antgroup.com"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=for-the-badge&logo=google-chrome&logoColor=f5f5f5"></a>
|
||||
</p>
|
||||
|
||||
## 特性
|
||||
@ -29,12 +28,12 @@
|
||||
|
||||
## 兼容环境
|
||||
|
||||
- 现代浏览器和 IE11(需要 polyfills)
|
||||
- 现代浏览器
|
||||
- 支持服务端渲染。
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## 安装
|
||||
|
||||
@ -84,12 +83,12 @@ graph.addEdge({
|
||||
|
||||
## 链接
|
||||
|
||||
- [文档](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [示例](https://x6.antv.vision/zh/examples/gallery)
|
||||
- [博客](https://www.yuque.com/antv/x6/gcinvi)
|
||||
- [文档](http://x6.antv.antgroup.com/tutorial/about)
|
||||
- [示例](http://x6.antv.antgroup.com/examples)
|
||||
- [博客](https://www.yuque.com/antv/x6/huhla47wqalq5n7r)
|
||||
- [更新日志](https://www.yuque.com/antv/x6/bbfu6r)
|
||||
- [常见问题](https://www.yuque.com/antv/x6/be9pfx)
|
||||
- [CodeSanbox 模板](https://codesandbox.io/s/qosj0?file=/src/app.tsx)
|
||||
- [常见问题](https://www.yuque.com/antv/x6/tox1ukbz5cw57qfy)
|
||||
- [CodeSanbox 模板](https://codesandbox.io/s/mo-ban-wchooy?file=/src/App.tsx)
|
||||
|
||||
## 本地开发
|
||||
|
||||
@ -111,9 +110,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,61 +1,54 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@antv/x6-example-features",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.2",
|
||||
"scripts": {
|
||||
"start": "umi dev",
|
||||
"build": "umi build",
|
||||
"lint": "eslint 'src/**/*.{js,ts}?(x)' --fix",
|
||||
"precommit": "lint-staged"
|
||||
"lint": "eslint 'src/**/*.{js,ts}?(x)' --fix"
|
||||
},
|
||||
"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/hierarchy": "^0.6.8",
|
||||
"@antv/x6": "^2.x",
|
||||
"@antv/x6-plugin-clipboard": "^2.x",
|
||||
"@antv/x6-plugin-dnd": "^2.x",
|
||||
"@antv/x6-plugin-export": "^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-react-components": "^2.x",
|
||||
"@antv/x6-react-shape": "^2.x",
|
||||
"antd": "^4.4.2",
|
||||
"classnames": "^2.2.6",
|
||||
"dagre": "^0.8.5",
|
||||
"elkjs": "^0.7.1",
|
||||
"elkjs": "^0.8.2",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0",
|
||||
"react-helmet": "^6.0.0",
|
||||
"@antv/hierarchy": "^0.6.8"
|
||||
"react-helmet": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ant-design/icons": "^4.2.2",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/jest": "^29.2.4",
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@types/react-helmet": "^6.0.0",
|
||||
"@types/react-test-renderer": "^16.0.3",
|
||||
"eslint": "^7.16.0",
|
||||
"@types/react-test-renderer": "^18.0.0",
|
||||
"babel-plugin-import": "^1.13.5",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-config-umi": "^1.4.0",
|
||||
"eslint-plugin-flowtype": "^4.7.0",
|
||||
"eslint-plugin-flowtype": "^8.0.3",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"lint-staged": "^10.5.3",
|
||||
"react-test-renderer": "^16.7.0",
|
||||
"umi": "^2.9.0",
|
||||
"umi-plugin-react": "^1.8.0",
|
||||
"umi-types": "^0.3.0",
|
||||
"babel-plugin-import": "^1.13.5"
|
||||
},
|
||||
"lint-staged": {
|
||||
"src/**/*.ts": [
|
||||
"eslint --fix"
|
||||
]
|
||||
"umi-types": "^0.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
|
@ -7,17 +7,17 @@
|
||||
|
||||
.nav {
|
||||
position: absolute;
|
||||
z-index: 101;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
font-size: 13px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
z-index: 101;
|
||||
box-sizing: border-box;
|
||||
width: 220px;
|
||||
padding: 0 16px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
font-size: 13px;
|
||||
border-right: 1px solid #e9e9e9;
|
||||
box-sizing: border-box;
|
||||
|
||||
ul {
|
||||
padding-left: 16px;
|
||||
@ -29,11 +29,11 @@
|
||||
}
|
||||
|
||||
.content {
|
||||
flex-grow: 1;
|
||||
box-sizing: border-box;
|
||||
margin-left: 220px;
|
||||
padding: 34px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
flex-grow: 1;
|
||||
margin-left: 220px;
|
||||
background: #ffffff;
|
||||
padding: 34px;
|
||||
background: #fff;
|
||||
}
|
||||
|
@ -8,13 +8,15 @@
|
||||
border: 1px solid #c2c8d5;
|
||||
border-left: 4px solid #1890ff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 5px 1px rgba(0, 0, 0, 0.06);
|
||||
box-shadow: 0 2px 5px 1px rgb(0 0 0 / 6%);
|
||||
|
||||
img {
|
||||
flex-shrink: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
flex-shrink: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
@ -23,15 +25,19 @@
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.status {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&.success {
|
||||
border-left: 4px solid #52c41a;
|
||||
}
|
||||
|
||||
&.failed {
|
||||
border-left: 4px solid #ff4d4f;
|
||||
}
|
||||
|
||||
&.running .status img {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@ -43,11 +49,13 @@
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 4px #d4e8fe;
|
||||
}
|
||||
|
||||
.node.success {
|
||||
border-color: #52c41a;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 4px #ccecc0;
|
||||
}
|
||||
|
||||
.node.failed {
|
||||
border-color: #ff4d4f;
|
||||
border-radius: 2px;
|
||||
@ -80,6 +88,7 @@
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
visibility: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&:hover image {
|
||||
visibility: visible;
|
||||
}
|
||||
|
@ -212,12 +212,15 @@ export default class Example extends React.Component {
|
||||
return 'right'
|
||||
},
|
||||
})
|
||||
const cells: Cell[] = []
|
||||
const traverse = (hierarchyItem: HierarchyResult) => {
|
||||
if (hierarchyItem) {
|
||||
const { data, children } = hierarchyItem
|
||||
cells.push(
|
||||
graph.createNode({
|
||||
// 检查当前遍历的节点已经存在还是需要新添加?
|
||||
if (graph.hasCell(data.id)) {
|
||||
const node = graph.getCellById(data.id)
|
||||
node.prop('position', { x: hierarchyItem.x, y: hierarchyItem.y })
|
||||
} else {
|
||||
const node = graph.addNode({
|
||||
id: data.id,
|
||||
shape: data.type === 'topic-child' ? 'topic-child' : 'topic',
|
||||
x: hierarchyItem.x,
|
||||
@ -226,13 +229,18 @@ export default class Example extends React.Component {
|
||||
height: data.height,
|
||||
label: data.label,
|
||||
type: data.type,
|
||||
}),
|
||||
)
|
||||
})
|
||||
}
|
||||
if (children) {
|
||||
children.forEach((item: HierarchyResult) => {
|
||||
const { id, data } = item
|
||||
cells.push(
|
||||
graph.createEdge({
|
||||
// 先遍历子节点(里面包含创建逻辑,如果画布没有开启async的时候,创建边会提示找不到target节点)
|
||||
traverse(item)
|
||||
const eid = `${hierarchyItem.id}-->${id}`
|
||||
// 检查当前边是否已经存在
|
||||
if (!graph.hasCell(eid)) {
|
||||
graph.addEdge({
|
||||
id: eid,
|
||||
shape: 'mindmap-edge',
|
||||
source: {
|
||||
cell: hierarchyItem.id,
|
||||
@ -257,15 +265,13 @@ export default class Example extends React.Component {
|
||||
name: 'left',
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
traverse(item)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
traverse(result)
|
||||
graph.resetCells(cells)
|
||||
graph.centerContent()
|
||||
}
|
||||
|
||||
@ -334,10 +340,16 @@ export default class Example extends React.Component {
|
||||
|
||||
const removeNode = (id: string) => {
|
||||
const res = findItem(data, id)
|
||||
const dataItem = res?.parent
|
||||
if (dataItem && dataItem.children) {
|
||||
const { children } = dataItem
|
||||
const parentItem = res?.parent
|
||||
const nodeItem = res?.node
|
||||
if (parentItem && parentItem.children) {
|
||||
const { children } = parentItem
|
||||
const index = children.findIndex((item) => item.id === id)
|
||||
// 删除的时候,先删节点以及可能存在的子节点,再调用render,对data数据进行遍历
|
||||
if (nodeItem && nodeItem.children) {
|
||||
nodeItem.children.forEach((item) => graph.removeCell(item.id))
|
||||
}
|
||||
graph.removeCell(id)
|
||||
return children.splice(index, 1)
|
||||
}
|
||||
return null
|
||||
|
@ -2,24 +2,25 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.validating:after {
|
||||
.validating::after {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
content: ' ';
|
||||
display: block;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
border: 6px solid #873bf4;
|
||||
border-color: #873bf4 transparent #873bf4 transparent;
|
||||
border-color: #873bf4 transparent;
|
||||
border-radius: 50%;
|
||||
animation: lds-dual-ring 1.2s linear infinite;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
@keyframes lds-dual-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
@ -2,14 +2,14 @@
|
||||
.x6-example-wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
background-color: #fff;
|
||||
|
||||
.left-side {
|
||||
position: fixed;
|
||||
width: 336px;
|
||||
left: 24px;
|
||||
top: 0px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 24px;
|
||||
width: 336px;
|
||||
padding: 0 8px;
|
||||
overflow-x: visible;
|
||||
overflow-y: auto;
|
||||
@ -17,18 +17,18 @@
|
||||
|
||||
.right-side {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 24px;
|
||||
bottom: 0;
|
||||
width: 336px;
|
||||
padding: 0 8px;
|
||||
top: 0px;
|
||||
bottom: 0;
|
||||
overflow-x: visible;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.ant-card {
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
margin-top: 24px;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
}
|
||||
|
||||
.ant-row-flex {
|
||||
@ -36,14 +36,14 @@
|
||||
}
|
||||
|
||||
.slider-value {
|
||||
background: #eee;
|
||||
color: #333333;
|
||||
padding: 3px 7px;
|
||||
border-radius: 10px;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin-left: 8px;
|
||||
padding: 3px 7px;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
line-height: 1.25;
|
||||
background: #eee;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.x6-graph {
|
||||
@ -52,15 +52,15 @@
|
||||
|
||||
.x6-node {
|
||||
path {
|
||||
fill: #6a6c8a;
|
||||
stroke-width: 0px;
|
||||
transition: fill 0.1s;
|
||||
fill: #6a6c8a;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
text {
|
||||
fill: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: lighter;
|
||||
font-size: 12px;
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
&:hover path {
|
||||
@ -80,37 +80,37 @@
|
||||
}
|
||||
|
||||
.bbox {
|
||||
transition-duration: 0.5s;
|
||||
transition-property: stroke-opacity;
|
||||
pointer-events: none;
|
||||
fill: none;
|
||||
stroke: #16a085;
|
||||
stroke-width: 2;
|
||||
stroke-opacity: 0;
|
||||
fill: none;
|
||||
transition-property: stroke-opacity;
|
||||
transition-duration: 0.5s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.axis {
|
||||
pointer-events: none;
|
||||
stroke: #95a5a6;
|
||||
stroke-dasharray: 2, 4;
|
||||
stroke-width: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.padding {
|
||||
transition-duration: 1s;
|
||||
transition-property: stroke-opacity;
|
||||
pointer-events: none;
|
||||
stroke: #1abc9c;
|
||||
stroke-opacity: 0;
|
||||
transition-property: stroke-opacity;
|
||||
transition-duration: 1s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.grid {
|
||||
transition-duration: 1s;
|
||||
transition-property: stroke-opacity;
|
||||
pointer-events: none;
|
||||
stroke: #16a085;
|
||||
stroke-width: 0.5;
|
||||
stroke-opacity: 0;
|
||||
transition-property: stroke-opacity;
|
||||
transition-duration: 1s;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.active {
|
||||
|
@ -1,9 +1,9 @@
|
||||
.custom-html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
border: 1px solid #000;
|
||||
|
@ -1,27 +1,27 @@
|
||||
.x6-graph-wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #ffffff;
|
||||
overflow: auto;
|
||||
padding: 32px 0;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
|
||||
> h1 {
|
||||
display: block;
|
||||
width: 800px;
|
||||
margin: 0 auto 32px auto;
|
||||
margin: 0 auto 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.x6-graph-tools {
|
||||
width: 800px;
|
||||
margin: 0 auto 32px auto;
|
||||
margin: 0 auto 32px;
|
||||
}
|
||||
|
||||
.x6-graph {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
}
|
||||
|
||||
.x6-node-selected {
|
||||
|
@ -4,7 +4,10 @@ import { Keyboard } from '@antv/x6-plugin-keyboard'
|
||||
import { Selection } from '@antv/x6-plugin-selection'
|
||||
import '../index.less'
|
||||
|
||||
export default class Example extends React.Component {
|
||||
export default class Example extends React.Component<
|
||||
{},
|
||||
{ graph: Graph | undefined }
|
||||
> {
|
||||
private container: HTMLDivElement
|
||||
|
||||
componentDidMount() {
|
||||
@ -15,6 +18,8 @@ export default class Example extends React.Component {
|
||||
grid: true,
|
||||
})
|
||||
|
||||
this.setState({ graph })
|
||||
|
||||
const selection = new Selection({ enabled: true })
|
||||
const keyboard = new Keyboard({ enabled: true })
|
||||
graph.use(selection)
|
||||
@ -53,10 +58,22 @@ export default class Example extends React.Component {
|
||||
this.container = container
|
||||
}
|
||||
|
||||
enablePlugins = () => {
|
||||
const { graph } = this.state
|
||||
graph.enablePlugins('keyboard')
|
||||
}
|
||||
|
||||
disablePlugins = () => {
|
||||
const { graph } = this.state
|
||||
graph.disablePlugins('keyboard')
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="x6-graph-wrap">
|
||||
<div ref={this.refContainer} className="x6-graph" />
|
||||
<button onClick={this.enablePlugins}>enable</button>
|
||||
<button onClick={this.disablePlugins}>disable</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
.react-algo-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #5f95ff;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
@ -13,8 +13,8 @@
|
||||
|
||||
span {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
color: #000000a6;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&.dark {
|
||||
|
@ -2,20 +2,20 @@
|
||||
.my-port {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #eee;
|
||||
border: 1px solid #808080;
|
||||
border-radius: 100%;
|
||||
background: #eee;
|
||||
|
||||
&.connected {
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-top: 5px;
|
||||
margin-left: 1px;
|
||||
border-width: 5px 4px 0;
|
||||
border-style: solid;
|
||||
border-color: #808080 transparent transparent;
|
||||
border-radius: 0;
|
||||
background-color: transparent;
|
||||
border-color: #808080 transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,30 +30,30 @@
|
||||
}
|
||||
|
||||
body > div::before {
|
||||
content: ' ';
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-top: -5px;
|
||||
margin-left: -5px;
|
||||
background-color: rgb(57 202 116 / 60%);
|
||||
border-radius: 50%;
|
||||
background-color: rgba(57, 202, 116, 0.6);
|
||||
box-sizing: border-box;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
body > div::after {
|
||||
content: ' ';
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
float: left;
|
||||
clear: both;
|
||||
box-sizing: border-box;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-top: -15px;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
border: 1px solid #39ca74;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
content: ' ';
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,30 +65,30 @@
|
||||
}
|
||||
|
||||
body > div::before {
|
||||
content: ' ';
|
||||
float: left;
|
||||
box-sizing: border-box;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-top: -9px;
|
||||
margin-left: -9px;
|
||||
background-color: rgb(57 202 116 / 60%);
|
||||
border-radius: 50%;
|
||||
background-color: rgba(57, 202, 116, 0.6);
|
||||
box-sizing: border-box;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
body > div::after {
|
||||
content: ' ';
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
float: left;
|
||||
clear: both;
|
||||
box-sizing: border-box;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-top: -19px;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
border: 1px solid #39ca74;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
content: ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
.x6-graph-scroller {
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
margin: 0 auto;
|
||||
box-shadow: 0 0 10px 1px #e9e9e9;
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -25,7 +25,6 @@ export default class Example extends React.Component {
|
||||
strict: true,
|
||||
showNodeSelectionBox: true,
|
||||
selectCellOnMoved: false,
|
||||
useCellGeometry: true,
|
||||
filter(cell) {
|
||||
return cell !== a
|
||||
},
|
||||
|
@ -1,20 +1,20 @@
|
||||
.react-table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #edf2f5;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
border: 1px solid #edf2f5;
|
||||
border-radius: 5px;
|
||||
|
||||
.inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #fff;
|
||||
background: #edf2f5;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header {
|
||||
@ -36,21 +36,21 @@
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 16px;
|
||||
line-height: 40px;
|
||||
list-style: none;
|
||||
border: 1px solid transparent;
|
||||
|
||||
&:hover {
|
||||
border: 1px solid #1890ff;
|
||||
// background: rgba(230,247,255,.92);
|
||||
z-index: 0;
|
||||
border: 1px solid #1890ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,8 +58,8 @@
|
||||
.react-table-port {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #eee;
|
||||
border: 1px solid #808080;
|
||||
border-radius: 100%;
|
||||
background: #eee;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -1,41 +1,44 @@
|
||||
.tools {
|
||||
width: 800px;
|
||||
margin: 32px auto;
|
||||
|
||||
.ant-input {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.react-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #5f95ff;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
span {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
color: #000000a6;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.stutterer {
|
||||
transform: scale(1.5);
|
||||
height: 310px;
|
||||
width: 310px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 310px;
|
||||
height: 310px;
|
||||
margin: auto;
|
||||
box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 200px;
|
||||
box-shadow: 0 0 10px 10px rgb(0 0 0 / 20%);
|
||||
transform: scale(1.5);
|
||||
}
|
||||
|
||||
.clockHand {
|
||||
@ -50,12 +53,12 @@
|
||||
}
|
||||
|
||||
.innerLine {
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
height: 149px;
|
||||
left: 47.5%;
|
||||
top: 0%;
|
||||
left: 47.5%;
|
||||
width: 5%;
|
||||
height: 149px;
|
||||
background-color: red;
|
||||
border-radius: 6px;
|
||||
transform-origin: bottom center;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ module.exports = function (config, base, karmaTypescriptConfig) {
|
||||
},
|
||||
coverageOptions: {
|
||||
instrumentation: !isDebug,
|
||||
exclude: /\.test|spec\.ts$/,
|
||||
exclude: /\.(test|spec)\.ts$/,
|
||||
},
|
||||
reports: {
|
||||
html: reportsDir,
|
||||
|
92
package.json
92
package.json
@ -2,25 +2,50 @@
|
||||
"name": "x6",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"lint:ts": "eslint '**/src/**/*.{js,ts}?(x)' --fix",
|
||||
"lint:style": "stylelint '**/src/**/*.less' --syntax less --fix",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"lint:ts": "eslint '**/src/**/*.{js,ts}?(x)' --cache --fix",
|
||||
"lint:style": "stylelint '**/src/**/*.less' --customSyntax postcss-less --cache --fix",
|
||||
"lint": "run-s lint:ts lint:style",
|
||||
"prettier": "prettier --write '**/*.{js,mjs,jsx,tsx,ts,less,md,json}'",
|
||||
"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,69 +88,69 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/x6-build-tools": "workspace:*",
|
||||
"@babel/core": "^7.19.6",
|
||||
"@babel/core": "^7.20.5",
|
||||
"@babel/plugin-syntax-flow": "^7.18.6",
|
||||
"@babel/plugin-transform-react-jsx": "^7.19.0",
|
||||
"@commitlint/config-conventional": "^17.2.0",
|
||||
"@rollup/plugin-commonjs": "^23.0.2",
|
||||
"@commitlint/config-conventional": "^17.3.0",
|
||||
"@rollup/plugin-commonjs": "^23.0.5",
|
||||
"@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/changelog": "^6.0.1",
|
||||
"@rollup/plugin-typescript": "^10.0.1",
|
||||
"@semantic-release-monorepo/cli": "^2.1.2",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@types/jasmine": "^4.3.0",
|
||||
"@types/jest": "^29.2.1",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/jest": "^29.2.4",
|
||||
"@types/node": "^18.11.15",
|
||||
"@types/sinon": "^10.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
||||
"@typescript-eslint/parser": "^5.41.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
||||
"@typescript-eslint/parser": "^5.46.1",
|
||||
"boxen": "^7.0.0",
|
||||
"colors": "^1.4.0",
|
||||
"coveralls": "^3.1.1",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint": "^8.29.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.7",
|
||||
"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",
|
||||
"fs-extra": "^10.0.0",
|
||||
"eslint-plugin-unicorn": "^45.0.2",
|
||||
"fs-extra": "^11.1.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",
|
||||
"karma-jasmine": "^5.1.0",
|
||||
"karma-spec-reporter": "^0.0.34",
|
||||
"karma-spec-reporter": "^0.0.36",
|
||||
"karma-typescript": "5.5.3",
|
||||
"karma-typescript-es6-transform": "5.5.3",
|
||||
"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.20",
|
||||
"postcss-less": "^6.0.0",
|
||||
"prettier": "^2.8.0",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^3.2.5",
|
||||
"rollup": "^3.7.4",
|
||||
"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.5",
|
||||
"semantic-release": "^19.0.5",
|
||||
"sinon": "^14.0.1",
|
||||
"stylelint": "^14.14.0",
|
||||
"stylelint-config-prettier": "^9.0.3",
|
||||
"sinon": "^15.0.1",
|
||||
"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 +159,9 @@
|
||||
"ts-node": "^10.2.1",
|
||||
"tslib": "^2.4.1",
|
||||
"turbo": "^1.6.3",
|
||||
"typescript": "^4.4.3"
|
||||
"typescript": "^4.9.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-terser": "^0.2.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,170 +1,29 @@
|
||||
## @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)
|
||||
## @antv/x6-common [2.0.6](https://github.com/antvis/x6/compare/@antv/x6-common@2.0.5...@antv/x6-common@2.0.6) (2023-01-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
|
||||
* fix index error for priorityQueue ([#3179](https://github.com/antvis/x6/issues/3179)) ([d64150b](https://github.com/antvis/x6/commit/d64150bfadf10fe21f44734a0267261260b8c53b))
|
||||
|
||||
|
||||
### 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)
|
||||
## @antv/x6-common [2.0.5](https://github.com/antvis/x6/compare/@antv/x6-common@2.0.4...@antv/x6-common@2.0.5) (2023-01-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
|
||||
* optimize css loader ([#3156](https://github.com/antvis/x6/issues/3156)) ([9c48ad8](https://github.com/antvis/x6/commit/9c48ad8dfc99e623a57855295d07c35be5483073))
|
||||
|
||||
|
||||
### 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)
|
||||
## @antv/x6-common [2.0.4](https://github.com/antvis/x6/compare/@antv/x6-common@2.0.3...@antv/x6-common@2.0.4) (2022-12-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
|
||||
* fix window incompatibility problem ([#3070](https://github.com/antvis/x6/issues/3070)) ([d8e1e63](https://github.com/antvis/x6/commit/d8e1e637d8027b9494cd26efc87815d74bd51366))
|
||||
|
||||
|
||||
### 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)
|
||||
## @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-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* force bump to 2.0 ([ae7ad05](https://github.com/antvis/x6/commit/ae7ad05d9caddc1056afa17549bda74209cedfc0))
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
|
||||
### 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.6",
|
||||
"description": "Basic toolkit for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -48,13 +48,13 @@
|
||||
"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"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-common"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
@ -45,7 +45,7 @@ export class PriorityQueue<T> {
|
||||
*/
|
||||
insert(priority: number, value: T, id?: string) {
|
||||
const item: PriorityQueue.DataItem<T> = { priority, value }
|
||||
const index = this.data.length - 1
|
||||
const index = this.data.length
|
||||
if (id) {
|
||||
item.id = id
|
||||
this.index[id] = index
|
||||
@ -96,7 +96,9 @@ export class PriorityQueue<T> {
|
||||
const data = this.data
|
||||
const peek = data[0]
|
||||
const last = data.pop()!
|
||||
delete this.index[data.length]
|
||||
if (peek.id) {
|
||||
delete this.index[peek.id]
|
||||
}
|
||||
|
||||
if (data.length > 0) {
|
||||
data[0] = last
|
||||
|
@ -6,5 +6,5 @@ export {
|
||||
sortBy,
|
||||
groupBy,
|
||||
difference,
|
||||
max
|
||||
max,
|
||||
} from 'lodash-es'
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* eslint-disable no-constructor-return */
|
||||
|
||||
import { NumberExt } from '../number'
|
||||
|
||||
export class Color {
|
||||
|
@ -2,6 +2,7 @@ import { Platform } from '../platform'
|
||||
|
||||
interface CssModule {
|
||||
name: string
|
||||
loadTimes: number
|
||||
styleElement: HTMLStyleElement | null
|
||||
}
|
||||
|
||||
@ -10,7 +11,10 @@ const cssModules: CssModule[] = []
|
||||
export function ensure(name: string, content: string) {
|
||||
const cssModule = cssModules.find((m) => m.name === name)
|
||||
if (cssModule) {
|
||||
return
|
||||
cssModule.loadTimes += 1
|
||||
if (cssModule.loadTimes > 1) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (!Platform.isApplyingHMR()) {
|
||||
@ -25,6 +29,7 @@ export function ensure(name: string, content: string) {
|
||||
|
||||
cssModules.push({
|
||||
name,
|
||||
loadTimes: 1,
|
||||
styleElement,
|
||||
})
|
||||
}
|
||||
@ -34,7 +39,13 @@ export function clean(name: string) {
|
||||
const index = cssModules.findIndex((m) => m.name === name)
|
||||
|
||||
if (index > -1) {
|
||||
let styleElement = cssModules[index].styleElement
|
||||
const cssModule = cssModules[index]
|
||||
cssModule.loadTimes -= 1
|
||||
if (cssModule.loadTimes > 0) {
|
||||
return
|
||||
}
|
||||
|
||||
let styleElement = cssModule.styleElement
|
||||
if (styleElement && styleElement.parentNode) {
|
||||
styleElement.parentNode.removeChild(styleElement)
|
||||
}
|
||||
|
@ -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,26 +1,25 @@
|
||||
import { StringExt } from '../string'
|
||||
|
||||
export function getData(dataset: Record<string, any>, name: string) {
|
||||
const value = dataset[name] || dataset[StringExt.camelCase(name)]
|
||||
try {
|
||||
return JSON.parse(value)
|
||||
} catch {
|
||||
return value
|
||||
const dataset: WeakMap<Element, Record<string, any>> = new WeakMap()
|
||||
|
||||
export function getData(elem: Element, name: string) {
|
||||
const key = StringExt.camelCase(name)
|
||||
const cache = dataset.get(elem)
|
||||
if (cache) {
|
||||
return cache[key]
|
||||
}
|
||||
}
|
||||
|
||||
export function setData(
|
||||
dataset: Record<string, any>,
|
||||
name: string,
|
||||
value: any,
|
||||
) {
|
||||
let val = value
|
||||
try {
|
||||
val = JSON.stringify(val)
|
||||
} catch (e) {
|
||||
// paas
|
||||
export function setData(elem: Element, name: string, value: any) {
|
||||
const key = StringExt.camelCase(name)
|
||||
const cache = dataset.get(elem)
|
||||
if (cache) {
|
||||
cache[key] = value
|
||||
} else {
|
||||
dataset.set(elem, {
|
||||
[key]: value,
|
||||
})
|
||||
}
|
||||
dataset[StringExt.camelCase(name)] = val
|
||||
}
|
||||
|
||||
export function data(elem: Element): Record<string, any> | undefined
|
||||
@ -34,20 +33,17 @@ export function data(
|
||||
) {
|
||||
if (!name) {
|
||||
const datas: Record<string, any> = {}
|
||||
const dataset = (elem as any).dataset
|
||||
// eslint-disable-next-line
|
||||
for (const key in dataset) {
|
||||
datas[key] = getData(dataset, key)
|
||||
}
|
||||
Object.keys(dataset).forEach((key) => {
|
||||
datas[key] = getData(elem, key)
|
||||
})
|
||||
return datas
|
||||
}
|
||||
|
||||
if (typeof name === 'string') {
|
||||
const dataset = (elem as any).dataset
|
||||
if (value === undefined) {
|
||||
return getData(dataset, name)
|
||||
return getData(elem, name)
|
||||
}
|
||||
setData(dataset, name, value)
|
||||
setData(elem, name, value)
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
@ -198,7 +198,14 @@ export function text(
|
||||
const autoLineHeight = defaultLineHeight === 'auto'
|
||||
const lineHeight = autoLineHeight ? '1.5em' : defaultLineHeight || '1em'
|
||||
|
||||
empty(elem)
|
||||
let needEmptyElem = true
|
||||
const childs = elem.children
|
||||
if (childs.length === 1 && childs[0].tagName.toUpperCase() === 'TITLE') {
|
||||
needEmptyElem = false
|
||||
}
|
||||
if (needEmptyElem) {
|
||||
empty(elem)
|
||||
}
|
||||
|
||||
attr(elem, {
|
||||
// Preserve spaces, do not consecutive spaces to get collapsed to one.
|
||||
|
@ -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
|
||||
}
|
||||
}
|
@ -117,6 +117,7 @@ export function unsetByPath(
|
||||
return obj
|
||||
}
|
||||
|
||||
// eslint-disable-next-line default-param-last
|
||||
export function flatten(obj: any, delim = '/', stop?: (val: any) => boolean) {
|
||||
const ret: { [key: string]: any } = {}
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
// compatible with NodeList.prototype.forEach() before chrome 51
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
|
||||
if (window.NodeList && !NodeList.prototype.forEach) {
|
||||
if (
|
||||
typeof window === 'object' &&
|
||||
window.NodeList &&
|
||||
!NodeList.prototype.forEach
|
||||
) {
|
||||
NodeList.prototype.forEach = Array.prototype.forEach as any
|
||||
}
|
||||
|
||||
|
@ -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,12 @@
|
||||
## @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.4](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.3...@antv/x6-geometry@2.0.4) (2022-11-29)
|
||||
|
||||
|
||||
### 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)
|
||||
## @antv/x6-geometry [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-geometry@2.0.2...@antv/x6-geometry@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([49d4371](https://github.com/antvis/x6/commit/49d43716ada672e609e4e6d9c6fdca3f494b6f68))
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @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 ([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)
|
||||
|
@ -5,7 +5,7 @@
|
||||
<a href="/LICENSE"><img src="https://img.shields.io/github/license/antvis/x6?style=flat-square" alt="MIT License"></a>
|
||||
<a href="https://www.typescriptlang.org"><img alt="Language" src="https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square"></a>
|
||||
<a href="https://github.com/antvis/x6/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://x6.antv.antgroup.com"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/workflow/status/antvis/x6/%F0%9F%91%B7%E3%80%80CI/master?logo=github&style=flat-square"></a>
|
||||
<a href="https://app.codecov.io/gh/antvis/x6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&flag=x6-geometry&style=flat-square&token=15CO54WYUV"></a>
|
||||
<a href="https://lgtm.com/projects/g/antvis/x6/context:javascript"><img alt="Language grade: JavaScript" src="https://img.shields.io/lgtm/grade/javascript/g/antvis/x6.svg?logo=lgtm&style=flat-square"></a>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.0.1",
|
||||
"version": "2.0.4",
|
||||
"name": "@antv/x6-geometry",
|
||||
"description": "Geometry operations for X6",
|
||||
"main": "lib/index.js",
|
||||
@ -41,13 +41,13 @@
|
||||
"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"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-geometry"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* eslint-disable default-param-last */
|
||||
|
||||
import { Point } from '../point'
|
||||
|
||||
const regexSupportedData = new RegExp(`^[\\s\\dLMCZz,.]*$`)
|
||||
const regexSupportedData = new RegExp(`^[\\s\\dLMCZz,.]*$`) // eslint-disable-line prefer-regex-literals
|
||||
|
||||
export function isValid(data: any) {
|
||||
if (typeof data !== 'string') {
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* eslint-disable no-constructor-return */
|
||||
|
||||
import { Line } from './line'
|
||||
import { Point } from './point'
|
||||
import { Rectangle } from './rectangle'
|
||||
|
@ -1,129 +1,22 @@
|
||||
## @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)
|
||||
|
||||
|
||||
### 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)
|
||||
## @antv/x6-plugin-clipboard [2.1.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.1.2...@antv/x6-plugin-clipboard@2.1.3) (2022-11-25)
|
||||
|
||||
|
||||
### 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))
|
||||
* broken file ([d6df2d5](https://github.com/antvis/x6/commit/d6df2d59811dc18791208af36b452e11e6391f3b))
|
||||
|
||||
|
||||
### 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))
|
||||
* ✨ 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)
|
||||
## @antv/x6-plugin-clipboard [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-clipboard@2.1.1...@antv/x6-plugin-clipboard@2.1.2) (2022-11-25)
|
||||
|
||||
|
||||
### 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))
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @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 ([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 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,23 +37,23 @@
|
||||
"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"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-clipboard"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
113
packages/x6-plugin-clipboard/src/api.ts
Normal file
113
packages/x6-plugin-clipboard/src/api.ts
Normal file
@ -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: (options?: Clipboard.Options) => 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 (options?: Clipboard.Options) {
|
||||
const clipboard = this.getPlugin('clipboard') as Clipboard
|
||||
if (clipboard) {
|
||||
return clipboard.isEmpty(options)
|
||||
}
|
||||
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 []
|
||||
}
|
@ -89,7 +89,12 @@ export class ClipboardImpl {
|
||||
}
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
isEmpty(options: ClipboardImpl.Options = {}) {
|
||||
if (options.useLocalStorage) {
|
||||
// With useLocalStorage turned on, no real cells can be obtained without deserialize first
|
||||
// https://github.com/antvis/X6/issues/2573
|
||||
this.deserialize(options)
|
||||
}
|
||||
return this.cells.length <= 0
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
@ -29,14 +32,12 @@ export class Clipboard
|
||||
if (this.disabled) {
|
||||
this.options.enabled = true
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
disable() {
|
||||
if (!this.disabled) {
|
||||
this.options.enabled = false
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
toggleEnabled(enabled?: boolean) {
|
||||
@ -57,15 +58,15 @@ export class Clipboard
|
||||
return this
|
||||
}
|
||||
|
||||
isEmpty() {
|
||||
return this.clipboardImpl.isEmpty()
|
||||
isEmpty(options: Clipboard.Options = {}) {
|
||||
return this.clipboardImpl.isEmpty(options)
|
||||
}
|
||||
|
||||
getCellsInClipboard() {
|
||||
return this.cells
|
||||
}
|
||||
|
||||
private clean(force?: boolean) {
|
||||
clean(force?: boolean) {
|
||||
if (!this.disabled || force) {
|
||||
this.clipboardImpl.clean()
|
||||
this.notify('clipboard:changed', { cells: [] })
|
||||
@ -111,12 +112,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,127 +1,22 @@
|
||||
## @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.4](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.3...@antv/x6-plugin-dnd@2.0.4) (2023-01-13)
|
||||
|
||||
|
||||
### 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))
|
||||
* change dragging container options ([#3139](https://github.com/antvis/x6/issues/3139)) ([7b091f3](https://github.com/antvis/x6/commit/7b091f35dee147c5e7bf97577e14e11ceb7e8e3d))
|
||||
|
||||
|
||||
### 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)
|
||||
## @antv/x6-plugin-dnd [2.0.3](https://github.com/antvis/x6/compare/@antv/x6-plugin-dnd@2.0.2...@antv/x6-plugin-dnd@2.0.3) (2022-11-25)
|
||||
|
||||
|
||||
### 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))
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @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)
|
||||
|
||||
## @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)
|
||||
|
||||
|
||||
### 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))
|
||||
|
||||
|
||||
### 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.1",
|
||||
"version": "2.0.4",
|
||||
"description": "dnd plugin for X6",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -38,23 +38,23 @@
|
||||
"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/dnd",
|
||||
"bugs": {
|
||||
"url": "https://github.com/antvis/x6/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-dnd"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
@ -81,7 +81,10 @@ export class Dnd extends View {
|
||||
|
||||
this.targetModel.startBatch('dnd')
|
||||
Dom.addClass(this.container, 'dragging')
|
||||
Dom.appendTo(this.container, this.options.containerParent || document.body)
|
||||
Dom.appendTo(
|
||||
this.container,
|
||||
this.options.draggingContainer || document.body,
|
||||
)
|
||||
|
||||
this.sourceNode = node
|
||||
this.prepareDragging(node, e.clientX, e.clientY)
|
||||
@ -104,7 +107,7 @@ export class Dnd extends View {
|
||||
}
|
||||
|
||||
protected isSnaplineEnabled() {
|
||||
return this.snapline && this.snapline.isSnaplineEnabled()
|
||||
return this.snapline && this.snapline.isEnabled()
|
||||
}
|
||||
|
||||
protected prepareDragging(
|
||||
@ -481,7 +484,7 @@ export namespace Dnd {
|
||||
// duration?: number
|
||||
// easing?: string
|
||||
// }
|
||||
containerParent?: HTMLElement
|
||||
draggingContainer?: HTMLElement
|
||||
/**
|
||||
* dnd tool box container.
|
||||
*/
|
||||
|
@ -1,91 +1,16 @@
|
||||
## @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)
|
||||
|
||||
|
||||
### 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-export 1.0.0 (2022-11-05)
|
||||
## @antv/x6-plugin-export [2.1.2](https://github.com/antvis/x6/compare/@antv/x6-plugin-export@2.1.1...@antv/x6-plugin-export@2.1.2) (2022-11-25)
|
||||
|
||||
|
||||
### 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))
|
||||
* npm version ([cb0cfde](https://github.com/antvis/x6/commit/cb0cfdeb4dbe8858569e6899db08ccb9ab8ba4e7))
|
||||
|
||||
## @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 ([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.5",
|
||||
"description": "export plugin for X6.",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
@ -36,23 +36,23 @@
|
||||
"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"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/antvis/x6.git",
|
||||
"url": "https://github.com/antvis/x6.git",
|
||||
"directory": "packages/x6-plugin-export"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
82
packages/x6-plugin-export/src/api.ts
Normal file
82
packages/x6-plugin-export/src/api.ts
Normal file
@ -0,0 +1,82 @@
|
||||
import { Graph } from '@antv/x6'
|
||||
import { Export } from './index'
|
||||
|
||||
declare module '@antv/x6/lib/graph/graph' {
|
||||
interface Graph {
|
||||
toSVG: (
|
||||
callback: Export.ToSVGCallback,
|
||||
options?: Export.ToSVGOptions,
|
||||
) => void
|
||||
toPNG: (
|
||||
callback: Export.ToSVGCallback,
|
||||
options?: Export.ToImageOptions,
|
||||
) => void
|
||||
toJPEG: (
|
||||
callback: Export.ToSVGCallback,
|
||||
options?: Export.ToImageOptions,
|
||||
) => void
|
||||
exportPNG: (fileName?: string, options?: Export.ToImageOptions) => void
|
||||
exportJPEG: (fileName?: string, options?: Export.ToImageOptions) => void
|
||||
exportSVG: (fileName?: string, options?: Export.ToSVGOptions) => void
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.toSVG = function (
|
||||
callback: Export.ToSVGCallback,
|
||||
options?: Export.ToSVGOptions,
|
||||
) {
|
||||
const instance = this.getPlugin('export') as Export
|
||||
if (instance) {
|
||||
instance.toSVG(callback, options)
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.toPNG = function (
|
||||
callback: Export.ToSVGCallback,
|
||||
options?: Export.ToImageOptions,
|
||||
) {
|
||||
const instance = this.getPlugin('export') as Export
|
||||
if (instance) {
|
||||
instance.toPNG(callback, options)
|
||||
}
|
||||
}
|
||||
|
||||
Graph.prototype.toJPEG = function (
|
||||
callback: Export.ToSVGCallback,
|
||||
options?: Export.ToImageOptions,
|
||||
) {
|
||||
const instance = this.getPlugin('export') as Export
|
||||
if (instance) {
|
||||
instance.toJPEG(callback, options)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user