@meursyphus/flitter 2.0.0-alpha.5 → 2.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +28 -5
- package/index.d.cts +12 -5
- package/index.d.ts +12 -5
- package/index.global.js +28 -5
- package/index.js +28 -5
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -123,7 +123,13 @@ var SceneBuilder = class {
|
|
|
123
123
|
}
|
|
124
124
|
render(ctx) {
|
|
125
125
|
for (const { x, y, picture } of __privateGet(this, _pictures)) {
|
|
126
|
-
ctx.drawImage(
|
|
126
|
+
ctx.drawImage(
|
|
127
|
+
picture.toImage(),
|
|
128
|
+
x,
|
|
129
|
+
y,
|
|
130
|
+
picture.size.width,
|
|
131
|
+
picture.size.height
|
|
132
|
+
);
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
addPicture(props) {
|
|
@@ -140,6 +146,12 @@ var Picture = class {
|
|
|
140
146
|
toImage() {
|
|
141
147
|
return __privateGet(this, _source);
|
|
142
148
|
}
|
|
149
|
+
get size() {
|
|
150
|
+
return {
|
|
151
|
+
width: __privateGet(this, _source).width / window.devicePixelRatio,
|
|
152
|
+
height: __privateGet(this, _source).height / window.devicePixelRatio
|
|
153
|
+
};
|
|
154
|
+
}
|
|
143
155
|
};
|
|
144
156
|
_source = new WeakMap();
|
|
145
157
|
var _source2;
|
|
@@ -151,8 +163,9 @@ var PictureRecorder = class {
|
|
|
151
163
|
constructor(paintBounds) {
|
|
152
164
|
__privateAdd(this, _source2, void 0);
|
|
153
165
|
__privateSet(this, _source2, document.createElement("canvas"));
|
|
154
|
-
|
|
155
|
-
__privateGet(this, _source2).
|
|
166
|
+
const dpr = window.devicePixelRatio;
|
|
167
|
+
__privateGet(this, _source2).width = paintBounds.width * dpr;
|
|
168
|
+
__privateGet(this, _source2).height = paintBounds.height * dpr;
|
|
156
169
|
}
|
|
157
170
|
/**
|
|
158
171
|
* @implements: This function is still incomplete. So It needs paintSize temporarily. Once completed, it will intercept the CanvasRenderingContext2D API
|
|
@@ -161,6 +174,7 @@ var PictureRecorder = class {
|
|
|
161
174
|
*/
|
|
162
175
|
createCanvasContext() {
|
|
163
176
|
const ctx = __privateGet(this, _source2).getContext("2d");
|
|
177
|
+
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
164
178
|
return ctx;
|
|
165
179
|
}
|
|
166
180
|
endRecording() {
|
|
@@ -12544,7 +12558,12 @@ var ZOrderCalculatorVisitor = class {
|
|
|
12544
12558
|
__publicField(this, "currentStackingContext", []);
|
|
12545
12559
|
}
|
|
12546
12560
|
visit(renderObject) {
|
|
12547
|
-
__privateMethod(this, _visit, visit_fn).call(this, renderObject, {
|
|
12561
|
+
__privateMethod(this, _visit, visit_fn).call(this, renderObject, {
|
|
12562
|
+
willCollect: renderObject.isPainter
|
|
12563
|
+
});
|
|
12564
|
+
}
|
|
12565
|
+
visitGestureDetector(gestureDetector) {
|
|
12566
|
+
__privateMethod(this, _visit, visit_fn).call(this, gestureDetector, { willCollect: true });
|
|
12548
12567
|
}
|
|
12549
12568
|
visitZIndex(renderObject) {
|
|
12550
12569
|
this.currentStackingContext = [...this.currentStackingContext];
|
|
@@ -13004,7 +13023,7 @@ var SvgPainter = class extends Painter {
|
|
|
13004
13023
|
rearrangeDomOrder() {
|
|
13005
13024
|
if (!__privateGet(this, _domOrderChanged))
|
|
13006
13025
|
return;
|
|
13007
|
-
if (this.isPainter) {
|
|
13026
|
+
if (this.isPainter && this.domNode) {
|
|
13008
13027
|
this.renderOwner.paintContext.insertSvgEl(
|
|
13009
13028
|
this.domNode,
|
|
13010
13029
|
this.renderObject.zOrder
|
|
@@ -14920,6 +14939,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14920
14939
|
if (this._direction === newDirection)
|
|
14921
14940
|
return;
|
|
14922
14941
|
this._direction = newDirection;
|
|
14942
|
+
this.markNeedsLayout();
|
|
14923
14943
|
}
|
|
14924
14944
|
get mainAxisAlignment() {
|
|
14925
14945
|
return this._mainAxisAlignment;
|
|
@@ -18639,6 +18659,9 @@ var RenderGestureDetector = class extends SingleChildRenderObject_default {
|
|
|
18639
18659
|
}
|
|
18640
18660
|
super.updateZOrder(value);
|
|
18641
18661
|
}
|
|
18662
|
+
accept(visitor) {
|
|
18663
|
+
visitor.visitGestureDetector(this);
|
|
18664
|
+
}
|
|
18642
18665
|
};
|
|
18643
18666
|
function emptyCallback(_arg) {
|
|
18644
18667
|
}
|
package/index.d.cts
CHANGED
|
@@ -3054,11 +3054,6 @@ declare class RenderZIndex extends SingleChildRenderObject {
|
|
|
3054
3054
|
accept(visitor: ZOrderCalculatorVisitor): void;
|
|
3055
3055
|
}
|
|
3056
3056
|
|
|
3057
|
-
interface RenderObjectVisitor {
|
|
3058
|
-
visit(renderObject: RenderObject): void;
|
|
3059
|
-
visitZIndex(zIndex: RenderZIndex): void;
|
|
3060
|
-
}
|
|
3061
|
-
|
|
3062
3057
|
type Cursor = "pointer" | "default" | "move" | "text" | "wait" | "help" | "progress" | "not-allowed" | "crosshair" | "grab" | "grabbing" | "e-resize" | "ne-resize" | "nw-resize" | "n-resize" | "se-resize" | "sw-resize" | "s-resize" | "w-resize" | "ew-resize" | "ns-resize" | "nesw-resize" | "nwse-resize" | "col-resize" | "row-resize" | "all-scroll";
|
|
3063
3058
|
declare class RenderGestureDetector extends SingleChildRenderObject {
|
|
3064
3059
|
isRenderGestureDetector: boolean;
|
|
@@ -3121,9 +3116,16 @@ declare class RenderGestureDetector extends SingleChildRenderObject {
|
|
|
3121
3116
|
globalPoint: Offset$1;
|
|
3122
3117
|
}): boolean;
|
|
3123
3118
|
updateZOrder(value: number): void;
|
|
3119
|
+
accept(visitor: RenderObjectVisitor): void;
|
|
3124
3120
|
}
|
|
3125
3121
|
type MouseEventCallback = (event: MouseEvent) => void;
|
|
3126
3122
|
|
|
3123
|
+
interface RenderObjectVisitor {
|
|
3124
|
+
visit(renderObject: RenderObject): void;
|
|
3125
|
+
visitZIndex(zIndex: RenderZIndex): void;
|
|
3126
|
+
visitGestureDetector(gestureDetector: RenderGestureDetector): void;
|
|
3127
|
+
}
|
|
3128
|
+
|
|
3127
3129
|
type EventHandlerType = "onClick" | "onMouseMove" | "onMouseUp" | "onMouseDown" | "onMouseWheel" | "onMouseEnter" | "onMouseLeave";
|
|
3128
3130
|
declare class HitTestDispatcher {
|
|
3129
3131
|
#private;
|
|
@@ -3226,6 +3228,7 @@ declare class ZOrderCalculatorVisitor implements RenderObjectVisitor {
|
|
|
3226
3228
|
private currentVisitedOrder;
|
|
3227
3229
|
private currentStackingContext;
|
|
3228
3230
|
visit(renderObject: RenderObject): void;
|
|
3231
|
+
visitGestureDetector(gestureDetector: RenderGestureDetector): void;
|
|
3229
3232
|
visitZIndex(renderObject: RenderZIndex): void;
|
|
3230
3233
|
getRenderObjectsByDomOrder(): RenderObject[];
|
|
3231
3234
|
}
|
|
@@ -3537,6 +3540,10 @@ declare class Picture {
|
|
|
3537
3540
|
#private;
|
|
3538
3541
|
constructor(source: HTMLCanvasElement);
|
|
3539
3542
|
toImage(): CanvasImageSource;
|
|
3543
|
+
get size(): {
|
|
3544
|
+
width: number;
|
|
3545
|
+
height: number;
|
|
3546
|
+
};
|
|
3540
3547
|
}
|
|
3541
3548
|
|
|
3542
3549
|
declare class CanvasPaintingContext {
|
package/index.d.ts
CHANGED
|
@@ -3054,11 +3054,6 @@ declare class RenderZIndex extends SingleChildRenderObject {
|
|
|
3054
3054
|
accept(visitor: ZOrderCalculatorVisitor): void;
|
|
3055
3055
|
}
|
|
3056
3056
|
|
|
3057
|
-
interface RenderObjectVisitor {
|
|
3058
|
-
visit(renderObject: RenderObject): void;
|
|
3059
|
-
visitZIndex(zIndex: RenderZIndex): void;
|
|
3060
|
-
}
|
|
3061
|
-
|
|
3062
3057
|
type Cursor = "pointer" | "default" | "move" | "text" | "wait" | "help" | "progress" | "not-allowed" | "crosshair" | "grab" | "grabbing" | "e-resize" | "ne-resize" | "nw-resize" | "n-resize" | "se-resize" | "sw-resize" | "s-resize" | "w-resize" | "ew-resize" | "ns-resize" | "nesw-resize" | "nwse-resize" | "col-resize" | "row-resize" | "all-scroll";
|
|
3063
3058
|
declare class RenderGestureDetector extends SingleChildRenderObject {
|
|
3064
3059
|
isRenderGestureDetector: boolean;
|
|
@@ -3121,9 +3116,16 @@ declare class RenderGestureDetector extends SingleChildRenderObject {
|
|
|
3121
3116
|
globalPoint: Offset$1;
|
|
3122
3117
|
}): boolean;
|
|
3123
3118
|
updateZOrder(value: number): void;
|
|
3119
|
+
accept(visitor: RenderObjectVisitor): void;
|
|
3124
3120
|
}
|
|
3125
3121
|
type MouseEventCallback = (event: MouseEvent) => void;
|
|
3126
3122
|
|
|
3123
|
+
interface RenderObjectVisitor {
|
|
3124
|
+
visit(renderObject: RenderObject): void;
|
|
3125
|
+
visitZIndex(zIndex: RenderZIndex): void;
|
|
3126
|
+
visitGestureDetector(gestureDetector: RenderGestureDetector): void;
|
|
3127
|
+
}
|
|
3128
|
+
|
|
3127
3129
|
type EventHandlerType = "onClick" | "onMouseMove" | "onMouseUp" | "onMouseDown" | "onMouseWheel" | "onMouseEnter" | "onMouseLeave";
|
|
3128
3130
|
declare class HitTestDispatcher {
|
|
3129
3131
|
#private;
|
|
@@ -3226,6 +3228,7 @@ declare class ZOrderCalculatorVisitor implements RenderObjectVisitor {
|
|
|
3226
3228
|
private currentVisitedOrder;
|
|
3227
3229
|
private currentStackingContext;
|
|
3228
3230
|
visit(renderObject: RenderObject): void;
|
|
3231
|
+
visitGestureDetector(gestureDetector: RenderGestureDetector): void;
|
|
3229
3232
|
visitZIndex(renderObject: RenderZIndex): void;
|
|
3230
3233
|
getRenderObjectsByDomOrder(): RenderObject[];
|
|
3231
3234
|
}
|
|
@@ -3537,6 +3540,10 @@ declare class Picture {
|
|
|
3537
3540
|
#private;
|
|
3538
3541
|
constructor(source: HTMLCanvasElement);
|
|
3539
3542
|
toImage(): CanvasImageSource;
|
|
3543
|
+
get size(): {
|
|
3544
|
+
width: number;
|
|
3545
|
+
height: number;
|
|
3546
|
+
};
|
|
3540
3547
|
}
|
|
3541
3548
|
|
|
3542
3549
|
declare class CanvasPaintingContext {
|
package/index.global.js
CHANGED
|
@@ -304,7 +304,13 @@
|
|
|
304
304
|
}
|
|
305
305
|
render(ctx) {
|
|
306
306
|
for (const { x, y, picture } of __privateGet(this, _pictures)) {
|
|
307
|
-
ctx.drawImage(
|
|
307
|
+
ctx.drawImage(
|
|
308
|
+
picture.toImage(),
|
|
309
|
+
x,
|
|
310
|
+
y,
|
|
311
|
+
picture.size.width,
|
|
312
|
+
picture.size.height
|
|
313
|
+
);
|
|
308
314
|
}
|
|
309
315
|
}
|
|
310
316
|
addPicture(props) {
|
|
@@ -321,6 +327,12 @@
|
|
|
321
327
|
toImage() {
|
|
322
328
|
return __privateGet(this, _source);
|
|
323
329
|
}
|
|
330
|
+
get size() {
|
|
331
|
+
return {
|
|
332
|
+
width: __privateGet(this, _source).width / window.devicePixelRatio,
|
|
333
|
+
height: __privateGet(this, _source).height / window.devicePixelRatio
|
|
334
|
+
};
|
|
335
|
+
}
|
|
324
336
|
};
|
|
325
337
|
_source = new WeakMap();
|
|
326
338
|
var _source2;
|
|
@@ -332,8 +344,9 @@
|
|
|
332
344
|
constructor(paintBounds) {
|
|
333
345
|
__privateAdd(this, _source2, void 0);
|
|
334
346
|
__privateSet(this, _source2, document.createElement("canvas"));
|
|
335
|
-
|
|
336
|
-
__privateGet(this, _source2).
|
|
347
|
+
const dpr = window.devicePixelRatio;
|
|
348
|
+
__privateGet(this, _source2).width = paintBounds.width * dpr;
|
|
349
|
+
__privateGet(this, _source2).height = paintBounds.height * dpr;
|
|
337
350
|
}
|
|
338
351
|
/**
|
|
339
352
|
* @implements: This function is still incomplete. So It needs paintSize temporarily. Once completed, it will intercept the CanvasRenderingContext2D API
|
|
@@ -342,6 +355,7 @@
|
|
|
342
355
|
*/
|
|
343
356
|
createCanvasContext() {
|
|
344
357
|
const ctx = __privateGet(this, _source2).getContext("2d");
|
|
358
|
+
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
345
359
|
return ctx;
|
|
346
360
|
}
|
|
347
361
|
endRecording() {
|
|
@@ -12923,7 +12937,12 @@
|
|
|
12923
12937
|
__publicField(this, "currentStackingContext", []);
|
|
12924
12938
|
}
|
|
12925
12939
|
visit(renderObject) {
|
|
12926
|
-
__privateMethod(this, _visit, visit_fn).call(this, renderObject, {
|
|
12940
|
+
__privateMethod(this, _visit, visit_fn).call(this, renderObject, {
|
|
12941
|
+
willCollect: renderObject.isPainter
|
|
12942
|
+
});
|
|
12943
|
+
}
|
|
12944
|
+
visitGestureDetector(gestureDetector) {
|
|
12945
|
+
__privateMethod(this, _visit, visit_fn).call(this, gestureDetector, { willCollect: true });
|
|
12927
12946
|
}
|
|
12928
12947
|
visitZIndex(renderObject) {
|
|
12929
12948
|
this.currentStackingContext = [...this.currentStackingContext];
|
|
@@ -13383,7 +13402,7 @@
|
|
|
13383
13402
|
rearrangeDomOrder() {
|
|
13384
13403
|
if (!__privateGet(this, _domOrderChanged))
|
|
13385
13404
|
return;
|
|
13386
|
-
if (this.isPainter) {
|
|
13405
|
+
if (this.isPainter && this.domNode) {
|
|
13387
13406
|
this.renderOwner.paintContext.insertSvgEl(
|
|
13388
13407
|
this.domNode,
|
|
13389
13408
|
this.renderObject.zOrder
|
|
@@ -16178,6 +16197,7 @@
|
|
|
16178
16197
|
if (this._direction === newDirection)
|
|
16179
16198
|
return;
|
|
16180
16199
|
this._direction = newDirection;
|
|
16200
|
+
this.markNeedsLayout();
|
|
16181
16201
|
}
|
|
16182
16202
|
get mainAxisAlignment() {
|
|
16183
16203
|
return this._mainAxisAlignment;
|
|
@@ -19897,6 +19917,9 @@
|
|
|
19897
19917
|
}
|
|
19898
19918
|
super.updateZOrder(value);
|
|
19899
19919
|
}
|
|
19920
|
+
accept(visitor) {
|
|
19921
|
+
visitor.visitGestureDetector(this);
|
|
19922
|
+
}
|
|
19900
19923
|
};
|
|
19901
19924
|
function emptyCallback(_arg) {
|
|
19902
19925
|
}
|
package/index.js
CHANGED
|
@@ -123,7 +123,13 @@ var SceneBuilder = class {
|
|
|
123
123
|
}
|
|
124
124
|
render(ctx) {
|
|
125
125
|
for (const { x, y, picture } of __privateGet(this, _pictures)) {
|
|
126
|
-
ctx.drawImage(
|
|
126
|
+
ctx.drawImage(
|
|
127
|
+
picture.toImage(),
|
|
128
|
+
x,
|
|
129
|
+
y,
|
|
130
|
+
picture.size.width,
|
|
131
|
+
picture.size.height
|
|
132
|
+
);
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
addPicture(props) {
|
|
@@ -140,6 +146,12 @@ var Picture = class {
|
|
|
140
146
|
toImage() {
|
|
141
147
|
return __privateGet(this, _source);
|
|
142
148
|
}
|
|
149
|
+
get size() {
|
|
150
|
+
return {
|
|
151
|
+
width: __privateGet(this, _source).width / window.devicePixelRatio,
|
|
152
|
+
height: __privateGet(this, _source).height / window.devicePixelRatio
|
|
153
|
+
};
|
|
154
|
+
}
|
|
143
155
|
};
|
|
144
156
|
_source = new WeakMap();
|
|
145
157
|
var _source2;
|
|
@@ -151,8 +163,9 @@ var PictureRecorder = class {
|
|
|
151
163
|
constructor(paintBounds) {
|
|
152
164
|
__privateAdd(this, _source2, void 0);
|
|
153
165
|
__privateSet(this, _source2, document.createElement("canvas"));
|
|
154
|
-
|
|
155
|
-
__privateGet(this, _source2).
|
|
166
|
+
const dpr = window.devicePixelRatio;
|
|
167
|
+
__privateGet(this, _source2).width = paintBounds.width * dpr;
|
|
168
|
+
__privateGet(this, _source2).height = paintBounds.height * dpr;
|
|
156
169
|
}
|
|
157
170
|
/**
|
|
158
171
|
* @implements: This function is still incomplete. So It needs paintSize temporarily. Once completed, it will intercept the CanvasRenderingContext2D API
|
|
@@ -161,6 +174,7 @@ var PictureRecorder = class {
|
|
|
161
174
|
*/
|
|
162
175
|
createCanvasContext() {
|
|
163
176
|
const ctx = __privateGet(this, _source2).getContext("2d");
|
|
177
|
+
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
|
164
178
|
return ctx;
|
|
165
179
|
}
|
|
166
180
|
endRecording() {
|
|
@@ -12544,7 +12558,12 @@ var ZOrderCalculatorVisitor = class {
|
|
|
12544
12558
|
__publicField(this, "currentStackingContext", []);
|
|
12545
12559
|
}
|
|
12546
12560
|
visit(renderObject) {
|
|
12547
|
-
__privateMethod(this, _visit, visit_fn).call(this, renderObject, {
|
|
12561
|
+
__privateMethod(this, _visit, visit_fn).call(this, renderObject, {
|
|
12562
|
+
willCollect: renderObject.isPainter
|
|
12563
|
+
});
|
|
12564
|
+
}
|
|
12565
|
+
visitGestureDetector(gestureDetector) {
|
|
12566
|
+
__privateMethod(this, _visit, visit_fn).call(this, gestureDetector, { willCollect: true });
|
|
12548
12567
|
}
|
|
12549
12568
|
visitZIndex(renderObject) {
|
|
12550
12569
|
this.currentStackingContext = [...this.currentStackingContext];
|
|
@@ -13004,7 +13023,7 @@ var SvgPainter = class extends Painter {
|
|
|
13004
13023
|
rearrangeDomOrder() {
|
|
13005
13024
|
if (!__privateGet(this, _domOrderChanged))
|
|
13006
13025
|
return;
|
|
13007
|
-
if (this.isPainter) {
|
|
13026
|
+
if (this.isPainter && this.domNode) {
|
|
13008
13027
|
this.renderOwner.paintContext.insertSvgEl(
|
|
13009
13028
|
this.domNode,
|
|
13010
13029
|
this.renderObject.zOrder
|
|
@@ -14920,6 +14939,7 @@ var RenderFlex = class extends MultiChildRenderObject_default {
|
|
|
14920
14939
|
if (this._direction === newDirection)
|
|
14921
14940
|
return;
|
|
14922
14941
|
this._direction = newDirection;
|
|
14942
|
+
this.markNeedsLayout();
|
|
14923
14943
|
}
|
|
14924
14944
|
get mainAxisAlignment() {
|
|
14925
14945
|
return this._mainAxisAlignment;
|
|
@@ -18639,6 +18659,9 @@ var RenderGestureDetector = class extends SingleChildRenderObject_default {
|
|
|
18639
18659
|
}
|
|
18640
18660
|
super.updateZOrder(value);
|
|
18641
18661
|
}
|
|
18662
|
+
accept(visitor) {
|
|
18663
|
+
visitor.visitGestureDetector(this);
|
|
18664
|
+
}
|
|
18642
18665
|
};
|
|
18643
18666
|
function emptyCallback(_arg) {
|
|
18644
18667
|
}
|
package/package.json
CHANGED