Skip to content

Commit

Permalink
Release (#1421)
Browse files Browse the repository at this point in the history
* fix: draw empty Path correctly with webgl #1417 #1408 (#1418)

* fix: draw empty Path correctly with webgl #1417 #1408

* chore: commit changeset

* Fix globalthis (#1420)

* fix: return empty object for globalthis

* chore: commit changeset

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

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 authored Jul 18, 2023
1 parent aad508e commit 0e5ba2c
Show file tree
Hide file tree
Showing 119 changed files with 1,430 additions and 299 deletions.
8 changes: 8 additions & 0 deletions packages/g-camera-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-camera-api

## 1.2.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 1.2.4

### 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.4",
"version": "1.2.5",
"description": "A simple implementation of Camera API.",
"keywords": [
"antv",
Expand Down
14 changes: 14 additions & 0 deletions packages/g-canvas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @antv/g-canvas

## 1.11.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-plugin-canvas-renderer@1.9.5
- @antv/g-plugin-canvas-picker@1.10.5
- @antv/g-lite@1.2.5
- @antv/g-plugin-canvas-path-generator@1.3.5
- @antv/g-plugin-dom-interaction@1.9.5
- @antv/g-plugin-html-renderer@1.9.5
- @antv/g-plugin-image-loader@1.3.5

## 1.11.4

### 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.4",
"version": "1.11.5",
"description": "A renderer implemented by Canvas 2D API",
"keywords": [
"antv",
Expand Down
14 changes: 14 additions & 0 deletions packages/g-canvaskit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @antv/g-canvaskit

## 0.10.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-plugin-canvas-picker@1.10.5
- @antv/g-lite@1.2.5
- @antv/g-plugin-canvas-path-generator@1.3.5
- @antv/g-plugin-canvaskit-renderer@1.3.5
- @antv/g-plugin-dom-interaction@1.9.5
- @antv/g-plugin-html-renderer@1.9.5
- @antv/g-plugin-image-loader@1.3.5

## 0.10.4

### 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.4",
"version": "0.10.5",
"description": "A renderer implemented by CanvasKit",
"keywords": [
"antv",
Expand Down
8 changes: 8 additions & 0 deletions packages/g-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-components

## 1.9.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 1.9.4

### 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.4",
"version": "1.9.5",
"description": "Components for g",
"keywords": [
"antv",
Expand Down
8 changes: 8 additions & 0 deletions packages/g-dom-mutation-observer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-dom-mutation-observer-api

## 1.2.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 1.2.4

### 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.4",
"version": "1.2.5",
"description": "A simple implementation of DOM MutationObserver API.",
"keywords": [
"antv",
Expand Down
8 changes: 8 additions & 0 deletions packages/g-gesture/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-gesture

## 2.2.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 2.2.4

### 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.4",
"version": "2.2.5",
"description": "G Gesture",
"keywords": [
"antv",
Expand Down
8 changes: 8 additions & 0 deletions packages/g-image-exporter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-image-exporter

## 0.7.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 0.7.4

### 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.4",
"version": "0.7.5",
"description": "A image exporter for G using DOM API",
"keywords": [
"antv",
Expand Down
7 changes: 7 additions & 0 deletions packages/g-lite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @antv/g-lite

## 1.2.5

### Patch Changes

- ff2f4585: Return empty object for globalthis.
- 6fa21f84: Override offscreen canvas in runtime.

## 1.2.4

### 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.4",
"version": "1.2.5",
"description": "A core module for rendering engine implements DOM API.",
"keywords": [
"antv",
Expand Down
5 changes: 5 additions & 0 deletions packages/g-lite/src/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ export class Canvas extends EventTarget implements ICanvas {
canvasHeight = height || getHeight(canvas) || canvas.height / dpr;
}

// override it in runtime
if (offscreenCanvas) {
runtime.offscreenCanvas = offscreenCanvas;
}

/**
* implements `Window` interface
*/
Expand Down
9 changes: 5 additions & 4 deletions packages/g-lite/src/global-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
TextService,
TextUpdater,
} from './services';
import { Shape } from './types';
import { CanvasLike, Shape } from './types';

export const runtime: GlobalRuntime = {} as GlobalRuntime;

Expand All @@ -53,7 +53,8 @@ export interface GlobalRuntime {
// AnimationTimeline: new (doc: IDocument) => IAnimationTimeline;
AnimationTimeline: any;
EasingFunction: (...args: any[]) => (t: number) => number;
offscreenCanvas: OffscreenCanvasCreator;
offscreenCanvasCreator: OffscreenCanvasCreator;
offscreenCanvas: CanvasLike;
sceneGraphSelector: SceneGraphSelector;
sceneGraphService: SceneGraphService;
textService: TextService;
Expand Down Expand Up @@ -143,10 +144,10 @@ const getGlobalThis = () => {
if (typeof window !== 'undefined') return window;
// @ts-ignore
if (typeof global !== 'undefined') return global;
return {};
// [!] Error: The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
// @see https://rollupjs.org/troubleshooting/#error-this-is-undefined
// if (typeof this !== 'undefined') return this;
throw new Error('Unable to locate global `this`');
};

/**
Expand All @@ -162,7 +163,7 @@ runtime.AnimationTimeline = null;

runtime.EasingFunction = null;

runtime.offscreenCanvas = new OffscreenCanvasCreator();
runtime.offscreenCanvasCreator = new OffscreenCanvasCreator();

runtime.nativeHTMLMap = new WeakMap();

Expand Down
5 changes: 3 additions & 2 deletions packages/g-lite/src/services/OffscreenCanvasCreator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CanvasLike } from '..';
import { runtime } from '..';

/**
* used in following scenes:
Expand All @@ -21,8 +22,8 @@ export class OffscreenCanvasCreator {
}

// user-defined offscreen canvas
if (offscreenCanvas) {
this.canvas = offscreenCanvas;
if (offscreenCanvas || runtime.offscreenCanvas) {
this.canvas = offscreenCanvas || runtime.offscreenCanvas;
this.context = this.canvas.getContext('2d', contextAttributes);
} else {
try {
Expand Down
8 changes: 4 additions & 4 deletions packages/g-lite/src/services/TextService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export class TextService {
};

const canvas =
this.runtime.offscreenCanvas.getOrCreateCanvas(offscreenCanvas);
const context = this.runtime.offscreenCanvas.getOrCreateContext(
this.runtime.offscreenCanvasCreator.getOrCreateCanvas(offscreenCanvas);
const context = this.runtime.offscreenCanvasCreator.getOrCreateContext(
offscreenCanvas,
{
willReadFrequently: true,
Expand Down Expand Up @@ -209,7 +209,7 @@ export class TextService {
// }

const context =
this.runtime.offscreenCanvas.getOrCreateContext(offscreenCanvas);
this.runtime.offscreenCanvasCreator.getOrCreateContext(offscreenCanvas);
context.font = font;

// no overflowing by default
Expand Down Expand Up @@ -354,7 +354,7 @@ export class TextService {
textOverflow,
} = parsedStyle;
const context =
this.runtime.offscreenCanvas.getOrCreateContext(offscreenCanvas);
this.runtime.offscreenCanvasCreator.getOrCreateContext(offscreenCanvas);
const maxWidth = wordWrapWidth + letterSpacing;

let ellipsis = '';
Expand Down
5 changes: 2 additions & 3 deletions packages/g-lite/src/services/aabb/TextUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export class TextUpdater implements GeometryAABBUpdater<ParsedTextStyleProps> {

update(parsedStyle: ParsedTextStyleProps, object: DisplayObject) {
const { text, textAlign, lineWidth, textBaseline, dx, dy } = parsedStyle;
const { offscreenCanvas } =
object?.ownerDocument?.defaultView?.getConfig() || {};

if (!this.isReadyToMeasure(parsedStyle, object)) {
parsedStyle.metrics = {
font: '',
Expand All @@ -66,6 +63,8 @@ export class TextUpdater implements GeometryAABBUpdater<ParsedTextStyleProps> {
};
}

const { offscreenCanvas } =
object?.ownerDocument?.defaultView?.getConfig() || {};
const metrics = this.globalRuntime.textService.measureText(
text,
parsedStyle,
Expand Down
8 changes: 8 additions & 0 deletions packages/g-lottie-player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-lottie-player

## 0.2.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 0.2.4

### 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.4",
"version": "0.2.5",
"description": "A lottie player for G",
"keywords": [
"antv",
Expand Down
8 changes: 8 additions & 0 deletions packages/g-mobile-canvas-element/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @antv/g-mobile-canvas-element

## 0.8.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5

## 0.8.4

### 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.4",
"version": "0.8.5",
"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.10.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-plugin-canvas-renderer@1.9.5
- @antv/g-plugin-canvas-picker@1.10.5
- @antv/g-lite@1.2.5
- @antv/g-plugin-canvas-path-generator@1.3.5
- @antv/g-plugin-dragndrop@1.8.5
- @antv/g-plugin-image-loader@1.3.5
- @antv/g-plugin-mobile-interaction@0.9.5

## 0.10.4

### 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.10.4",
"version": "0.10.5",
"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.5

### Patch Changes

- Updated dependencies [ff2f4585]
- Updated dependencies [6fa21f84]
- @antv/g-lite@1.2.5
- @antv/g-plugin-dragndrop@1.8.5
- @antv/g-plugin-mobile-interaction@0.9.5
- @antv/g-plugin-svg-picker@1.9.5
- @antv/g-plugin-svg-renderer@1.10.5

## 0.10.4

### Patch Changes
Expand Down
Loading

0 comments on commit 0e5ba2c

Please sign in to comment.