@react-three/test-renderer 8.1.1 → 8.1.2
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/CHANGELOG.md
CHANGED
|
@@ -426,6 +426,30 @@ const extensions = {
|
|
|
426
426
|
};
|
|
427
427
|
class WebGLRenderingContext {
|
|
428
428
|
constructor(canvas) {
|
|
429
|
+
this.getShaderPrecisionFormat = () => {
|
|
430
|
+
return {
|
|
431
|
+
rangeMin: 127,
|
|
432
|
+
rangeMax: 127,
|
|
433
|
+
precision: 23
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
this.GL_VERSION = 7938;
|
|
437
|
+
this.SCISSOR_BOX = 3088;
|
|
438
|
+
this.VIEWPORT = 2978;
|
|
439
|
+
this.getParameter = paramId => {
|
|
440
|
+
switch (paramId) {
|
|
441
|
+
case this.GL_VERSION:
|
|
442
|
+
return ['WebGL1'];
|
|
443
|
+
case this.SCISSOR_BOX:
|
|
444
|
+
case this.VIEWPORT:
|
|
445
|
+
return [0, 0, 1, 1];
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
this.getExtension = ext => {
|
|
449
|
+
return extensions[ext];
|
|
450
|
+
};
|
|
451
|
+
this.getProgramInfoLog = () => '';
|
|
452
|
+
this.getShaderInfoLog = () => '';
|
|
429
453
|
this.canvas = canvas;
|
|
430
454
|
this.drawingBufferWidth = canvas.width;
|
|
431
455
|
this.drawingBufferHeight = canvas.height;
|
|
@@ -436,30 +460,6 @@ class WebGLRenderingContext {
|
|
|
436
460
|
});
|
|
437
461
|
Object.assign(this, enums);
|
|
438
462
|
}
|
|
439
|
-
getShaderPrecisionFormat = () => {
|
|
440
|
-
return {
|
|
441
|
-
rangeMin: 127,
|
|
442
|
-
rangeMax: 127,
|
|
443
|
-
precision: 23
|
|
444
|
-
};
|
|
445
|
-
};
|
|
446
|
-
GL_VERSION = 7938;
|
|
447
|
-
SCISSOR_BOX = 3088;
|
|
448
|
-
VIEWPORT = 2978;
|
|
449
|
-
getParameter = paramId => {
|
|
450
|
-
switch (paramId) {
|
|
451
|
-
case this.GL_VERSION:
|
|
452
|
-
return ['WebGL1'];
|
|
453
|
-
case this.SCISSOR_BOX:
|
|
454
|
-
case this.VIEWPORT:
|
|
455
|
-
return [0, 0, 1, 1];
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
getExtension = ext => {
|
|
459
|
-
return extensions[ext];
|
|
460
|
-
};
|
|
461
|
-
getProgramInfoLog = () => '';
|
|
462
|
-
getShaderInfoLog = () => '';
|
|
463
463
|
}
|
|
464
464
|
const createWebGLContext = canvas => new WebGLRenderingContext(canvas);
|
|
465
465
|
|
|
@@ -535,8 +535,27 @@ const findAll = (root, decider) => {
|
|
|
535
535
|
};
|
|
536
536
|
|
|
537
537
|
class ReactThreeTestInstance {
|
|
538
|
-
constructor(
|
|
539
|
-
this.
|
|
538
|
+
constructor(_fiber) {
|
|
539
|
+
this.getChildren = (fiber, opts = {
|
|
540
|
+
exhaustive: false
|
|
541
|
+
}) => {
|
|
542
|
+
if (opts.exhaustive) {
|
|
543
|
+
/**
|
|
544
|
+
* this will return objects like
|
|
545
|
+
* color or effects etc.
|
|
546
|
+
*/
|
|
547
|
+
return [...(fiber.children || []).map(fib => wrapFiber(fib)), ...fiber.__r3f.objects.map(fib => wrapFiber(fib))];
|
|
548
|
+
} else {
|
|
549
|
+
return (fiber.children || []).map(fib => wrapFiber(fib));
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
this.find = decider => expectOne(findAll(this, decider), `matching custom checker: ${decider.toString()}`);
|
|
553
|
+
this.findAll = decider => findAll(this, decider);
|
|
554
|
+
this.findByType = type => expectOne(findAll(this, node => Boolean(node.type && node.type === type)), `with node type: "${type || 'Unknown'}"`);
|
|
555
|
+
this.findAllByType = type => findAll(this, node => Boolean(node.type && node.type === type));
|
|
556
|
+
this.findByProps = props => expectOne(this.findAllByProps(props), `with props: ${JSON.stringify(props)}`);
|
|
557
|
+
this.findAllByProps = props => findAll(this, node => Boolean(node.props && matchProps(node.props, props)));
|
|
558
|
+
this._fiber = _fiber;
|
|
540
559
|
}
|
|
541
560
|
get instance() {
|
|
542
561
|
return this._fiber;
|
|
@@ -562,25 +581,6 @@ class ReactThreeTestInstance {
|
|
|
562
581
|
exhaustive: true
|
|
563
582
|
});
|
|
564
583
|
}
|
|
565
|
-
getChildren = (fiber, opts = {
|
|
566
|
-
exhaustive: false
|
|
567
|
-
}) => {
|
|
568
|
-
if (opts.exhaustive) {
|
|
569
|
-
/**
|
|
570
|
-
* this will return objects like
|
|
571
|
-
* color or effects etc.
|
|
572
|
-
*/
|
|
573
|
-
return [...(fiber.children || []).map(fib => wrapFiber(fib)), ...fiber.__r3f.objects.map(fib => wrapFiber(fib))];
|
|
574
|
-
} else {
|
|
575
|
-
return (fiber.children || []).map(fib => wrapFiber(fib));
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
find = decider => expectOne(findAll(this, decider), `matching custom checker: ${decider.toString()}`);
|
|
579
|
-
findAll = decider => findAll(this, decider);
|
|
580
|
-
findByType = type => expectOne(findAll(this, node => Boolean(node.type && node.type === type)), `with node type: "${type || 'Unknown'}"`);
|
|
581
|
-
findAllByType = type => findAll(this, node => Boolean(node.type && node.type === type));
|
|
582
|
-
findByProps = props => expectOne(this.findAllByProps(props), `with props: ${JSON.stringify(props)}`);
|
|
583
|
-
findAllByProps = props => findAll(this, node => Boolean(node.props && matchProps(node.props, props)));
|
|
584
584
|
}
|
|
585
585
|
const fiberToWrapper = new WeakMap();
|
|
586
586
|
const wrapFiber = fiber => {
|
|
@@ -426,6 +426,30 @@ const extensions = {
|
|
|
426
426
|
};
|
|
427
427
|
class WebGLRenderingContext {
|
|
428
428
|
constructor(canvas) {
|
|
429
|
+
this.getShaderPrecisionFormat = () => {
|
|
430
|
+
return {
|
|
431
|
+
rangeMin: 127,
|
|
432
|
+
rangeMax: 127,
|
|
433
|
+
precision: 23
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
this.GL_VERSION = 7938;
|
|
437
|
+
this.SCISSOR_BOX = 3088;
|
|
438
|
+
this.VIEWPORT = 2978;
|
|
439
|
+
this.getParameter = paramId => {
|
|
440
|
+
switch (paramId) {
|
|
441
|
+
case this.GL_VERSION:
|
|
442
|
+
return ['WebGL1'];
|
|
443
|
+
case this.SCISSOR_BOX:
|
|
444
|
+
case this.VIEWPORT:
|
|
445
|
+
return [0, 0, 1, 1];
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
this.getExtension = ext => {
|
|
449
|
+
return extensions[ext];
|
|
450
|
+
};
|
|
451
|
+
this.getProgramInfoLog = () => '';
|
|
452
|
+
this.getShaderInfoLog = () => '';
|
|
429
453
|
this.canvas = canvas;
|
|
430
454
|
this.drawingBufferWidth = canvas.width;
|
|
431
455
|
this.drawingBufferHeight = canvas.height;
|
|
@@ -436,30 +460,6 @@ class WebGLRenderingContext {
|
|
|
436
460
|
});
|
|
437
461
|
Object.assign(this, enums);
|
|
438
462
|
}
|
|
439
|
-
getShaderPrecisionFormat = () => {
|
|
440
|
-
return {
|
|
441
|
-
rangeMin: 127,
|
|
442
|
-
rangeMax: 127,
|
|
443
|
-
precision: 23
|
|
444
|
-
};
|
|
445
|
-
};
|
|
446
|
-
GL_VERSION = 7938;
|
|
447
|
-
SCISSOR_BOX = 3088;
|
|
448
|
-
VIEWPORT = 2978;
|
|
449
|
-
getParameter = paramId => {
|
|
450
|
-
switch (paramId) {
|
|
451
|
-
case this.GL_VERSION:
|
|
452
|
-
return ['WebGL1'];
|
|
453
|
-
case this.SCISSOR_BOX:
|
|
454
|
-
case this.VIEWPORT:
|
|
455
|
-
return [0, 0, 1, 1];
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
getExtension = ext => {
|
|
459
|
-
return extensions[ext];
|
|
460
|
-
};
|
|
461
|
-
getProgramInfoLog = () => '';
|
|
462
|
-
getShaderInfoLog = () => '';
|
|
463
463
|
}
|
|
464
464
|
const createWebGLContext = canvas => new WebGLRenderingContext(canvas);
|
|
465
465
|
|
|
@@ -535,8 +535,27 @@ const findAll = (root, decider) => {
|
|
|
535
535
|
};
|
|
536
536
|
|
|
537
537
|
class ReactThreeTestInstance {
|
|
538
|
-
constructor(
|
|
539
|
-
this.
|
|
538
|
+
constructor(_fiber) {
|
|
539
|
+
this.getChildren = (fiber, opts = {
|
|
540
|
+
exhaustive: false
|
|
541
|
+
}) => {
|
|
542
|
+
if (opts.exhaustive) {
|
|
543
|
+
/**
|
|
544
|
+
* this will return objects like
|
|
545
|
+
* color or effects etc.
|
|
546
|
+
*/
|
|
547
|
+
return [...(fiber.children || []).map(fib => wrapFiber(fib)), ...fiber.__r3f.objects.map(fib => wrapFiber(fib))];
|
|
548
|
+
} else {
|
|
549
|
+
return (fiber.children || []).map(fib => wrapFiber(fib));
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
this.find = decider => expectOne(findAll(this, decider), `matching custom checker: ${decider.toString()}`);
|
|
553
|
+
this.findAll = decider => findAll(this, decider);
|
|
554
|
+
this.findByType = type => expectOne(findAll(this, node => Boolean(node.type && node.type === type)), `with node type: "${type || 'Unknown'}"`);
|
|
555
|
+
this.findAllByType = type => findAll(this, node => Boolean(node.type && node.type === type));
|
|
556
|
+
this.findByProps = props => expectOne(this.findAllByProps(props), `with props: ${JSON.stringify(props)}`);
|
|
557
|
+
this.findAllByProps = props => findAll(this, node => Boolean(node.props && matchProps(node.props, props)));
|
|
558
|
+
this._fiber = _fiber;
|
|
540
559
|
}
|
|
541
560
|
get instance() {
|
|
542
561
|
return this._fiber;
|
|
@@ -562,25 +581,6 @@ class ReactThreeTestInstance {
|
|
|
562
581
|
exhaustive: true
|
|
563
582
|
});
|
|
564
583
|
}
|
|
565
|
-
getChildren = (fiber, opts = {
|
|
566
|
-
exhaustive: false
|
|
567
|
-
}) => {
|
|
568
|
-
if (opts.exhaustive) {
|
|
569
|
-
/**
|
|
570
|
-
* this will return objects like
|
|
571
|
-
* color or effects etc.
|
|
572
|
-
*/
|
|
573
|
-
return [...(fiber.children || []).map(fib => wrapFiber(fib)), ...fiber.__r3f.objects.map(fib => wrapFiber(fib))];
|
|
574
|
-
} else {
|
|
575
|
-
return (fiber.children || []).map(fib => wrapFiber(fib));
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
find = decider => expectOne(findAll(this, decider), `matching custom checker: ${decider.toString()}`);
|
|
579
|
-
findAll = decider => findAll(this, decider);
|
|
580
|
-
findByType = type => expectOne(findAll(this, node => Boolean(node.type && node.type === type)), `with node type: "${type || 'Unknown'}"`);
|
|
581
|
-
findAllByType = type => findAll(this, node => Boolean(node.type && node.type === type));
|
|
582
|
-
findByProps = props => expectOne(this.findAllByProps(props), `with props: ${JSON.stringify(props)}`);
|
|
583
|
-
findAllByProps = props => findAll(this, node => Boolean(node.props && matchProps(node.props, props)));
|
|
584
584
|
}
|
|
585
585
|
const fiberToWrapper = new WeakMap();
|
|
586
586
|
const wrapFiber = fiber => {
|
|
@@ -402,6 +402,30 @@ const extensions = {
|
|
|
402
402
|
};
|
|
403
403
|
class WebGLRenderingContext {
|
|
404
404
|
constructor(canvas) {
|
|
405
|
+
this.getShaderPrecisionFormat = () => {
|
|
406
|
+
return {
|
|
407
|
+
rangeMin: 127,
|
|
408
|
+
rangeMax: 127,
|
|
409
|
+
precision: 23
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
this.GL_VERSION = 7938;
|
|
413
|
+
this.SCISSOR_BOX = 3088;
|
|
414
|
+
this.VIEWPORT = 2978;
|
|
415
|
+
this.getParameter = paramId => {
|
|
416
|
+
switch (paramId) {
|
|
417
|
+
case this.GL_VERSION:
|
|
418
|
+
return ['WebGL1'];
|
|
419
|
+
case this.SCISSOR_BOX:
|
|
420
|
+
case this.VIEWPORT:
|
|
421
|
+
return [0, 0, 1, 1];
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
this.getExtension = ext => {
|
|
425
|
+
return extensions[ext];
|
|
426
|
+
};
|
|
427
|
+
this.getProgramInfoLog = () => '';
|
|
428
|
+
this.getShaderInfoLog = () => '';
|
|
405
429
|
this.canvas = canvas;
|
|
406
430
|
this.drawingBufferWidth = canvas.width;
|
|
407
431
|
this.drawingBufferHeight = canvas.height;
|
|
@@ -412,30 +436,6 @@ class WebGLRenderingContext {
|
|
|
412
436
|
});
|
|
413
437
|
Object.assign(this, enums);
|
|
414
438
|
}
|
|
415
|
-
getShaderPrecisionFormat = () => {
|
|
416
|
-
return {
|
|
417
|
-
rangeMin: 127,
|
|
418
|
-
rangeMax: 127,
|
|
419
|
-
precision: 23
|
|
420
|
-
};
|
|
421
|
-
};
|
|
422
|
-
GL_VERSION = 7938;
|
|
423
|
-
SCISSOR_BOX = 3088;
|
|
424
|
-
VIEWPORT = 2978;
|
|
425
|
-
getParameter = paramId => {
|
|
426
|
-
switch (paramId) {
|
|
427
|
-
case this.GL_VERSION:
|
|
428
|
-
return ['WebGL1'];
|
|
429
|
-
case this.SCISSOR_BOX:
|
|
430
|
-
case this.VIEWPORT:
|
|
431
|
-
return [0, 0, 1, 1];
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
getExtension = ext => {
|
|
435
|
-
return extensions[ext];
|
|
436
|
-
};
|
|
437
|
-
getProgramInfoLog = () => '';
|
|
438
|
-
getShaderInfoLog = () => '';
|
|
439
439
|
}
|
|
440
440
|
const createWebGLContext = canvas => new WebGLRenderingContext(canvas);
|
|
441
441
|
|
|
@@ -511,8 +511,27 @@ const findAll = (root, decider) => {
|
|
|
511
511
|
};
|
|
512
512
|
|
|
513
513
|
class ReactThreeTestInstance {
|
|
514
|
-
constructor(
|
|
515
|
-
this.
|
|
514
|
+
constructor(_fiber) {
|
|
515
|
+
this.getChildren = (fiber, opts = {
|
|
516
|
+
exhaustive: false
|
|
517
|
+
}) => {
|
|
518
|
+
if (opts.exhaustive) {
|
|
519
|
+
/**
|
|
520
|
+
* this will return objects like
|
|
521
|
+
* color or effects etc.
|
|
522
|
+
*/
|
|
523
|
+
return [...(fiber.children || []).map(fib => wrapFiber(fib)), ...fiber.__r3f.objects.map(fib => wrapFiber(fib))];
|
|
524
|
+
} else {
|
|
525
|
+
return (fiber.children || []).map(fib => wrapFiber(fib));
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
this.find = decider => expectOne(findAll(this, decider), `matching custom checker: ${decider.toString()}`);
|
|
529
|
+
this.findAll = decider => findAll(this, decider);
|
|
530
|
+
this.findByType = type => expectOne(findAll(this, node => Boolean(node.type && node.type === type)), `with node type: "${type || 'Unknown'}"`);
|
|
531
|
+
this.findAllByType = type => findAll(this, node => Boolean(node.type && node.type === type));
|
|
532
|
+
this.findByProps = props => expectOne(this.findAllByProps(props), `with props: ${JSON.stringify(props)}`);
|
|
533
|
+
this.findAllByProps = props => findAll(this, node => Boolean(node.props && matchProps(node.props, props)));
|
|
534
|
+
this._fiber = _fiber;
|
|
516
535
|
}
|
|
517
536
|
get instance() {
|
|
518
537
|
return this._fiber;
|
|
@@ -538,25 +557,6 @@ class ReactThreeTestInstance {
|
|
|
538
557
|
exhaustive: true
|
|
539
558
|
});
|
|
540
559
|
}
|
|
541
|
-
getChildren = (fiber, opts = {
|
|
542
|
-
exhaustive: false
|
|
543
|
-
}) => {
|
|
544
|
-
if (opts.exhaustive) {
|
|
545
|
-
/**
|
|
546
|
-
* this will return objects like
|
|
547
|
-
* color or effects etc.
|
|
548
|
-
*/
|
|
549
|
-
return [...(fiber.children || []).map(fib => wrapFiber(fib)), ...fiber.__r3f.objects.map(fib => wrapFiber(fib))];
|
|
550
|
-
} else {
|
|
551
|
-
return (fiber.children || []).map(fib => wrapFiber(fib));
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
find = decider => expectOne(findAll(this, decider), `matching custom checker: ${decider.toString()}`);
|
|
555
|
-
findAll = decider => findAll(this, decider);
|
|
556
|
-
findByType = type => expectOne(findAll(this, node => Boolean(node.type && node.type === type)), `with node type: "${type || 'Unknown'}"`);
|
|
557
|
-
findAllByType = type => findAll(this, node => Boolean(node.type && node.type === type));
|
|
558
|
-
findByProps = props => expectOne(this.findAllByProps(props), `with props: ${JSON.stringify(props)}`);
|
|
559
|
-
findAllByProps = props => findAll(this, node => Boolean(node.props && matchProps(node.props, props)));
|
|
560
560
|
}
|
|
561
561
|
const fiberToWrapper = new WeakMap();
|
|
562
562
|
const wrapFiber = fiber => {
|