🎥 Make videos programmatically with React
fix shapes package
Jonny Burger652382cb8214
diff --git a/packages/shapes/src/components/render-svg.tsx b/packages/shapes/src/components/render-svg.tsxindex f09769a31b..c94343b81c 100644--- a/packages/shapes/src/components/render-svg.tsx+++ b/packages/shapes/src/components/render-svg.tsx@@ -65,7 +65,6 @@ export const RenderSvg = ({prevInstruction.type === 'V' ||prevInstruction.type === 'H' ||prevInstruction.type === 'a' ||- prevInstruction.type === 'z' ||prevInstruction.type === 'Z' ||prevInstruction.type === 't' ||prevInstruction.type === 'q' ||diff --git a/packages/shapes/src/test/circle.test.tsx b/packages/shapes/src/test/circle.test.tsxindex f38f6e37ce..7aad5fbe11 100644--- a/packages/shapes/src/test/circle.test.tsx+++ b/packages/shapes/src/test/circle.test.tsx@@ -8,6 +8,6 @@ test('Should be able to make a circle svg', () => {);expect(container.querySelector('path')?.getAttribute('d')).toEqual(- 'M 0 100 a 100 100 0 1 0 200 0 a 100 100 0 1 0 -200 0 z'+ 'M 0 100 a 100 100 0 1 0 200 0 a 100 100 0 1 0 -200 0 Z');});diff --git a/packages/shapes/src/test/ellipse.test.tsx b/packages/shapes/src/test/ellipse.test.tsxindex ac9144c374..98cc2b83f0 100644--- a/packages/shapes/src/test/ellipse.test.tsx+++ b/packages/shapes/src/test/ellipse.test.tsx@@ -8,6 +8,6 @@ test('Should be able to make a circle svg', () => {);expect(container.querySelector('path')?.getAttribute('d')).toEqual(- 'M 100 0 a 100 100 0 1 0 1 0 z'+ 'M 100 0 a 100 100 0 1 0 1 0 Z');});diff --git a/packages/shapes/src/test/make-circle.test.ts b/packages/shapes/src/test/make-circle.test.tsindex ad398cc243..56ea6ffe96 100644--- a/packages/shapes/src/test/make-circle.test.ts+++ b/packages/shapes/src/test/make-circle.test.ts@@ -6,7 +6,7 @@ test('Should be able to make a circle path', () => {expect(circlePath).toEqual({height: 100,width: 100,- path: 'M 0 50 a 50 50 0 1 0 100 0 a 50 50 0 1 0 -100 0 z',+ path: 'M 0 50 a 50 50 0 1 0 100 0 a 50 50 0 1 0 -100 0 Z',transformOrigin: '50 50',instructions: [{type: 'M', x: 0, y: 50},@@ -31,7 +31,7 @@ test('Should be able to make a circle path', () => {dy: 0,},{- type: 'z',+ type: 'Z',},],});diff --git a/packages/shapes/src/test/make-ellipse.test.ts b/packages/shapes/src/test/make-ellipse.test.tsindex 4ccae2181c..f334981be7 100644--- a/packages/shapes/src/test/make-ellipse.test.ts+++ b/packages/shapes/src/test/make-ellipse.test.ts@@ -4,7 +4,7 @@ import {makeEllipse} from '../utils/make-ellipse';test('Should be able to make a circle path', () => {const circlePath = makeEllipse({rx: 100, ry: 50});expect(circlePath).toEqual({- path: 'M 100 0 a 100 50 0 1 0 1 0 z',+ path: 'M 100 0 a 100 50 0 1 0 1 0 Z',height: 100,width: 200,transformOrigin: '100 50',@@ -21,7 +21,7 @@ test('Should be able to make a circle path', () => {dy: 0,},{- type: 'z',+ type: 'Z',},],});diff --git a/packages/shapes/src/test/make-pie.test.ts b/packages/shapes/src/test/make-pie.test.tsindex 1e952cfb61..404802ce2d 100644--- a/packages/shapes/src/test/make-pie.test.ts+++ b/packages/shapes/src/test/make-pie.test.ts@@ -6,7 +6,7 @@ test('Test makePie() function', () => {expect(pie).toEqual({height: 200,width: 200,- path: 'M 100 0 A 100 100 0 0 1 100 200 L 100 100 z',+ path: 'M 100 0 A 100 100 0 0 1 100 200 L 100 100 Z',instructions: [{type: 'M', x: 100, y: 0},{@@ -20,7 +20,7 @@ test('Test makePie() function', () => {y: 200,},{type: 'L', x: 100, y: 100},- {type: 'z'},+ {type: 'Z'},],transformOrigin: '100 100',});diff --git a/packages/shapes/src/test/make-rect.test.ts b/packages/shapes/src/test/make-rect.test.tsindex cc61e710cd..0e182f8178 100644--- a/packages/shapes/src/test/make-rect.test.ts+++ b/packages/shapes/src/test/make-rect.test.ts@@ -6,7 +6,7 @@ test('Should be able to make a rect path', () => {expect(rect).toEqual({height: 100,width: 100,- path: 'M 0 0 L 100 0 L 100 100 L 0 100 L 0 0 z',+ path: 'M 0 0 L 100 0 L 100 100 L 0 100 L 0 0 Z',transformOrigin: '50 50',instructions: [{type: 'M', x: 0, y: 0},@@ -14,7 +14,7 @@ test('Should be able to make a rect path', () => {{type: 'L', x: 100, y: 100},{type: 'L', x: 0, y: 100},{type: 'L', x: 0, y: 0},- {type: 'z'},+ {type: 'Z'},],});});diff --git a/packages/shapes/src/test/make-star.test.ts b/packages/shapes/src/test/make-star.test.tsindex 26174f6ba4..29d69edabf 100644--- a/packages/shapes/src/test/make-star.test.ts+++ b/packages/shapes/src/test/make-star.test.ts@@ -9,7 +9,7 @@ test('Should be able to make a triangle path', () => {});expect(starPath).toEqual({- path: 'M 200 0 L 288.167787843871 78.64745084375788 L 390.21130325903073 138.19660112501052 L 342.658477444273 246.3525491562421 L 317.55705045849464 361.8033988749895 L 200 350 L 82.4429495415054 361.8033988749895 L 57.34152255572698 246.35254915624213 L 9.788696740969272 138.19660112501055 L 111.83221215612902 78.6474508437579 L 200 0 z',+ path: 'M 200 0 L 288.167787843871 78.64745084375788 L 390.21130325903073 138.19660112501052 L 342.658477444273 246.3525491562421 L 317.55705045849464 361.8033988749895 L 200 350 L 82.4429495415054 361.8033988749895 L 57.34152255572698 246.35254915624213 L 9.788696740969272 138.19660112501055 L 111.83221215612902 78.6474508437579 L 200 0 Z',width: 400,height: 400,transformOrigin: '200 200',@@ -25,7 +25,7 @@ test('Should be able to make a triangle path', () => {{type: 'L', x: 9.788696740969272, y: 138.19660112501055},{type: 'L', x: 111.83221215612902, y: 78.6474508437579},{type: 'L', x: 200, y: 0},- {type: 'z'},+ {type: 'Z'},],});});diff --git a/packages/shapes/src/test/make-triangle.test.ts b/packages/shapes/src/test/make-triangle.test.tsindex 91ea06a2cf..260d8b6e61 100644--- a/packages/shapes/src/test/make-triangle.test.ts+++ b/packages/shapes/src/test/make-triangle.test.ts@@ -10,14 +10,14 @@ test('Should be able to make a triangle path', () => {expect(rightTriangle).toEqual({width: 86.60254037844386,height: 100,- path: 'M 0 0 L 0 100 L 86.60254037844386 50 L 0 0 z',+ path: 'M 0 0 L 0 100 L 86.60254037844386 50 L 0 0 Z',transformOrigin: '28.867513459481287 50',instructions: [{type: 'M', x: 0, y: 0},{type: 'L', x: 0, y: 100},{type: 'L', x: 86.60254037844386, y: 50},{type: 'L', x: 0, y: 0},- {type: 'z'},+ {type: 'Z'},],});});diff --git a/packages/shapes/src/test/pie.test.tsx b/packages/shapes/src/test/pie.test.tsxindex d15ef0711e..cad2c6666b 100644--- a/packages/shapes/src/test/pie.test.tsx+++ b/packages/shapes/src/test/pie.test.tsx@@ -7,6 +7,6 @@ test('Should be able to make a pie svg', () => {// assert pathexpect(container.querySelector('path')?.getAttribute('d')).toEqual(- 'M 100 0 A 100 100 0 0 1 100 200 L 100 100 z'+ 'M 100 0 A 100 100 0 0 1 100 200 L 100 100 Z');});diff --git a/packages/shapes/src/test/square.test.tsx b/packages/shapes/src/test/square.test.tsxindex 8e6ef3111d..1e06445c39 100644--- a/packages/shapes/src/test/square.test.tsx+++ b/packages/shapes/src/test/square.test.tsx@@ -7,6 +7,6 @@ test('Should be able to make a rect svg', () => {// assert pathexpect(container.querySelector('path')?.getAttribute('d')).toEqual(- 'M 0 0 L 200 0 L 200 200 L 0 200 L 0 0 z'+ 'M 0 0 L 200 0 L 200 200 L 0 200 L 0 0 Z');});diff --git a/packages/shapes/src/test/star.test.tsx b/packages/shapes/src/test/star.test.tsxindex 6c1166317e..0bc2835ae9 100644--- a/packages/shapes/src/test/star.test.tsx+++ b/packages/shapes/src/test/star.test.tsx@@ -8,6 +8,6 @@ test('Should be able to make a star svg', () => {);expect(container.querySelector('path')?.getAttribute('d')).toEqual(- 'M 150 0 L 267.55705045849464 -11.803398874989483 L 292.658477444273 103.6474508437579 L 340.21130325903073 211.80339887498948 L 238.16778784387097 271.3525491562421 L 150 350 L 61.832212156129046 271.3525491562421 L -40.2113032590307 211.8033988749895 L 7.341522555726954 103.64745084375791 L 32.44294954150536 -11.803398874989455 L 150 0 z'+ 'M 150 0 L 267.55705045849464 -11.803398874989483 L 292.658477444273 103.6474508437579 L 340.21130325903073 211.80339887498948 L 238.16778784387097 271.3525491562421 L 150 350 L 61.832212156129046 271.3525491562421 L -40.2113032590307 211.8033988749895 L 7.341522555726954 103.64745084375791 L 32.44294954150536 -11.803398874989455 L 150 0 Z');});diff --git a/packages/shapes/src/test/triangle.test.tsx b/packages/shapes/src/test/triangle.test.tsxindex f43dc40471..d431c91d18 100644--- a/packages/shapes/src/test/triangle.test.tsx+++ b/packages/shapes/src/test/triangle.test.tsx@@ -9,6 +9,6 @@ test('Should be able to make a triangle svg', () => {// assert pathexpect(container.querySelector('path')?.getAttribute('d')).toEqual(- 'M 86.60254037844386 0 L 86.60254037844386 100 L 0 50 L 86.60254037844386 0 z'+ 'M 86.60254037844386 0 L 86.60254037844386 100 L 0 50 L 86.60254037844386 0 Z');});diff --git a/packages/shapes/src/utils/make-circle.ts b/packages/shapes/src/utils/make-circle.tsindex cee833ab54..ad09259ffc 100644--- a/packages/shapes/src/utils/make-circle.ts+++ b/packages/shapes/src/utils/make-circle.ts@@ -34,7 +34,7 @@ export const makeCircle = ({radius}: MakeCircleProps): ShapeInfo => {dy: 0,},{- type: 'z',+ type: 'Z',},];diff --git a/packages/shapes/src/utils/make-ellipse.ts b/packages/shapes/src/utils/make-ellipse.tsindex 57bf2c9b4f..41c4436914 100644--- a/packages/shapes/src/utils/make-ellipse.ts+++ b/packages/shapes/src/utils/make-ellipse.ts@@ -25,7 +25,7 @@ export const makeEllipse = ({rx, ry}: MakeEllipseOptions): ShapeInfo => {dy: 0,},{- type: 'z',+ type: 'Z',},];diff --git a/packages/shapes/src/utils/make-pie.ts b/packages/shapes/src/utils/make-pie.tsindex 0e23e58a0e..b7767e0e78 100644--- a/packages/shapes/src/utils/make-pie.ts+++ b/packages/shapes/src/utils/make-pie.ts@@ -130,7 +130,7 @@ export const makePie = ({: null,closePath? {- type: 'z',+ type: 'Z',}: null,].filter(Boolean) as Instruction[];diff --git a/packages/shapes/src/utils/make-rect.ts b/packages/shapes/src/utils/make-rect.tsindex 8a3bf45784..03f9308cb7 100644--- a/packages/shapes/src/utils/make-rect.ts+++ b/packages/shapes/src/utils/make-rect.ts@@ -29,7 +29,7 @@ export const makeRect = ({{edgeRoundness, cornerRadius, roundCornerStrategy: 'arc'}),{- type: 'z',+ type: 'Z',},];const path = serializeInstructions(instructions);diff --git a/packages/shapes/src/utils/make-star.ts b/packages/shapes/src/utils/make-star.tsindex 00f5f1df40..0ac2b1e10c 100644--- a/packages/shapes/src/utils/make-star.ts+++ b/packages/shapes/src/utils/make-star.ts@@ -50,7 +50,7 @@ const star = ({cornerRadius,roundCornerStrategy: cornerRadius > 0 ? 'bezier' : 'arc',}),- {type: 'z'},+ {type: 'Z'},];};diff --git a/packages/shapes/src/utils/make-triangle.ts b/packages/shapes/src/utils/make-triangle.tsindex b64f3ea76b..53a2a02eec 100644--- a/packages/shapes/src/utils/make-triangle.ts+++ b/packages/shapes/src/utils/make-triangle.ts@@ -71,7 +71,7 @@ export const makeTriangle = ({roundCornerStrategy: 'bezier',}),{- type: 'z',+ type: 'Z',},];const path = serializeInstructions(instructions);