Skip to content

Commit

Permalink
Release (#1571)
Browse files Browse the repository at this point in the history
* Fix 1568 (#1569)

* fix: insertBefore should use correct position #1568

* chore: commit changeset

* chore(release): bump version (#1570)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 1, 2023
1 parent a07758a commit 3a65536
Show file tree
Hide file tree
Showing 96 changed files with 500 additions and 48 deletions.
58 changes: 58 additions & 0 deletions __tests__/unit/dom/element.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,64 @@ describe('DOM Element API', () => {
expect(group1.lastChild).toBe(group3);
});

it('should insertBefore correctly', () => {
const group1 = new Element();
const group2 = new Element();
const group3 = new Element();
const group4 = new Element();
const group5 = new Element();

// 2, 4, 3
group1.append(group2, group3);
group1.insertBefore(group4, group3);
expect(group1.childNodes.length).toBe(3);
expect(group1.firstChild).toBe(group2);
expect(group1.childNodes[1]).toBe(group4);
expect(group1.lastChild).toBe(group3);
group1.removeChildren();
expect(group1.childNodes.length).toBe(0);

// 4, 2, 3
group1.append(group2, group3);
group1.insertBefore(group4, group2);
expect(group1.childNodes.length).toBe(3);
expect(group1.firstChild).toBe(group4);
expect(group1.childNodes[1]).toBe(group2);
expect(group1.lastChild).toBe(group3);
group1.removeChildren();
expect(group1.childNodes.length).toBe(0);

// 2, 3, 4 -> 2, 4, 3
group1.append(group2, group3, group4);
group1.insertBefore(group4, group3);
expect(group1.childNodes.length).toBe(3);
expect(group1.firstChild).toBe(group2);
expect(group1.childNodes[1]).toBe(group4);
expect(group1.lastChild).toBe(group3);
group1.removeChildren();
expect(group1.childNodes.length).toBe(0);

// 2, 3, 4
group1.append(group2, group3);
group1.insertBefore(group4, null);
expect(group1.childNodes.length).toBe(3);
expect(group1.firstChild).toBe(group2);
expect(group1.childNodes[1]).toBe(group3);
expect(group1.lastChild).toBe(group4);
group1.removeChildren();
expect(group1.childNodes.length).toBe(0);

// 2, 3, 4
group1.append(group2, group3);
group1.insertBefore(group4, group5); // non-existed node
expect(group1.childNodes.length).toBe(3);
expect(group1.firstChild).toBe(group2);
expect(group1.childNodes[1]).toBe(group3);
expect(group1.lastChild).toBe(group4);
group1.removeChildren();
expect(group1.childNodes.length).toBe(0);
});

it('should replaceWith correctly', () => {
const group1 = new Element();
const group2 = new Element();
Expand Down
7 changes: 7 additions & 0 deletions packages/g-camera-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-camera-api

## 1.2.18

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 1.2.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-camera-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-camera-api",
"version": "1.2.17",
"version": "1.2.18",
"description": "A simple implementation of Camera API.",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-canvas

## 1.11.22

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17
- @antv/g-plugin-canvas-path-generator@1.3.17
- @antv/g-plugin-canvas-picker@1.10.19
- @antv/g-plugin-canvas-renderer@1.9.19
- @antv/g-plugin-dom-interaction@1.9.17
- @antv/g-plugin-html-renderer@1.9.20
- @antv/g-plugin-image-loader@1.3.17

## 1.11.21

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-canvas",
"version": "1.11.21",
"version": "1.11.22",
"description": "A renderer implemented by Canvas 2D API",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-canvaskit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-canvaskit

## 0.10.22

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17
- @antv/g-plugin-canvas-path-generator@1.3.17
- @antv/g-plugin-canvas-picker@1.10.19
- @antv/g-plugin-canvaskit-renderer@1.3.18
- @antv/g-plugin-dom-interaction@1.9.17
- @antv/g-plugin-html-renderer@1.9.20
- @antv/g-plugin-image-loader@1.3.17

## 0.10.21

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-canvaskit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-canvaskit",
"version": "0.10.21",
"version": "0.10.22",
"description": "A renderer implemented by CanvasKit",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-components

## 1.9.17

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 1.9.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-components",
"version": "1.9.16",
"version": "1.9.17",
"description": "Components for g",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-dom-mutation-observer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-dom-mutation-observer-api

## 1.2.17

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 1.2.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-dom-mutation-observer-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-dom-mutation-observer-api",
"version": "1.2.16",
"version": "1.2.17",
"description": "A simple implementation of DOM MutationObserver API.",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-gesture/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-gesture

## 2.2.20

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 2.2.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-gesture/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-gesture",
"version": "2.2.19",
"version": "2.2.20",
"description": "G Gesture",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-image-exporter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-image-exporter

## 0.7.17

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 0.7.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-image-exporter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-image-exporter",
"version": "0.7.16",
"version": "0.7.17",
"description": "A image exporter for G using DOM API",
"keywords": [
"antv",
Expand Down
6 changes: 6 additions & 0 deletions packages/g-lite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @antv/g-lite

## 1.2.17

### Patch Changes

- 51b42d06: Use correct position when insertBefore.

## 1.2.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-lite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-lite",
"version": "1.2.16",
"version": "1.2.17",
"description": "A core module for rendering engine implements DOM API.",
"keywords": [
"antv",
Expand Down
10 changes: 9 additions & 1 deletion packages/g-lite/src/dom/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,16 @@ export class Element<
if (!refChild) {
this.appendChild(newChild);
} else {
if (newChild.parentElement) {
newChild.parentElement.removeChild(newChild);
}

const index = this.childNodes.indexOf(refChild as IChildNode);
this.appendChild(newChild, index - 1);
if (index === -1) {
this.appendChild(newChild);
} else {
this.appendChild(newChild, index);
}
}
return newChild;
}
Expand Down
7 changes: 7 additions & 0 deletions packages/g-lottie-player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-lottie-player

## 0.2.17

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 0.2.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-lottie-player/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-lottie-player",
"version": "0.2.16",
"version": "0.2.17",
"description": "A lottie player for G",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-mobile-canvas-element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-mobile-canvas-element

## 0.8.17

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 0.8.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas-element/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas-element",
"version": "0.8.16",
"version": "0.8.17",
"description": "Create a CanvasLike element from existed context in mobile environment",
"keywords": [
"antv",
Expand Down
14 changes: 14 additions & 0 deletions packages/g-mobile-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @antv/g-mobile-canvas

## 0.11.10

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17
- @antv/g-plugin-canvas-path-generator@1.3.17
- @antv/g-plugin-canvas-picker@1.10.19
- @antv/g-plugin-canvas-renderer@1.9.19
- @antv/g-plugin-dragndrop@1.8.17
- @antv/g-plugin-gesture@1.2.5
- @antv/g-plugin-image-loader@1.3.17
- @antv/g-plugin-mobile-interaction@0.9.17

## 0.11.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-canvas",
"version": "0.11.9",
"version": "0.11.10",
"description": "A renderer implemented with Canvas2D API in mobile environment",
"keywords": [
"antv",
Expand Down
12 changes: 12 additions & 0 deletions packages/g-mobile-svg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @antv/g-mobile-svg

## 0.10.20

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17
- @antv/g-plugin-dragndrop@1.8.17
- @antv/g-plugin-gesture@1.2.5
- @antv/g-plugin-mobile-interaction@0.9.17
- @antv/g-plugin-svg-picker@1.9.19
- @antv/g-plugin-svg-renderer@1.10.19

## 0.10.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-svg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-svg",
"version": "0.10.19",
"version": "0.10.20",
"description": "A renderer implemented by SVG in mobile environment",
"keywords": [
"antv",
Expand Down
13 changes: 13 additions & 0 deletions packages/g-mobile-webgl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @antv/g-mobile-webgl

## 0.9.29

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17
- @antv/g-plugin-device-renderer@1.9.25
- @antv/g-plugin-dragndrop@1.8.17
- @antv/g-plugin-gesture@1.2.5
- @antv/g-plugin-html-renderer@1.9.20
- @antv/g-plugin-image-loader@1.3.17
- @antv/g-plugin-mobile-interaction@0.9.17

## 0.9.28

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/g-mobile-webgl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g-mobile-webgl",
"version": "0.9.28",
"version": "0.9.29",
"description": "A renderer implemented by WebGL1/2 in mobile environment",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-pattern/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-pattern

## 1.2.17

### Patch Changes

- Updated dependencies [51b42d06]
- @antv/g-lite@1.2.17

## 1.2.16

### Patch Changes
Expand Down
Loading

0 comments on commit 3a65536

Please sign in to comment.