@remotion/svg-3d-engine 4.0.527 → 4.0.528
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/dist/esm/index.mjs +26 -4
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -299,9 +299,31 @@ var makeInstructions = (arr, instruction, cb) => {
|
|
|
299
299
|
};
|
|
300
300
|
var segmentRegExp = /([astvzqmhlc])([^astvzqmhlc]*)/gi;
|
|
301
301
|
var numberRegExp = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
|
|
302
|
+
var arcNumberRegExp = /[\s,]*([-+]?(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:e[-+]?\d+)?)/iy;
|
|
303
|
+
var arcFlagRegExp = /[\s,]*([01])/y;
|
|
302
304
|
var parseValues = (args, instructionType) => {
|
|
303
|
-
|
|
304
|
-
if (
|
|
305
|
+
let numbers;
|
|
306
|
+
if (instructionType === "A" || instructionType === "a") {
|
|
307
|
+
numbers = [];
|
|
308
|
+
let match;
|
|
309
|
+
let lastIndex = 0;
|
|
310
|
+
do {
|
|
311
|
+
const regExp = numbers.length % 7 === 3 || numbers.length % 7 === 4 ? arcFlagRegExp : arcNumberRegExp;
|
|
312
|
+
regExp.lastIndex = lastIndex;
|
|
313
|
+
match = regExp.exec(args);
|
|
314
|
+
if (match) {
|
|
315
|
+
numbers.push(match[1]);
|
|
316
|
+
lastIndex = regExp.lastIndex;
|
|
317
|
+
}
|
|
318
|
+
} while (match);
|
|
319
|
+
const rest = args.slice(lastIndex);
|
|
320
|
+
if (!/^[\s,]*$/.test(rest)) {
|
|
321
|
+
throw new Error(`Malformed path data: ${instructionType} has an invalid value at "${rest.trim()}"`);
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
numbers = args.match(numberRegExp);
|
|
325
|
+
}
|
|
326
|
+
if (!numbers || numbers.length === 0) {
|
|
305
327
|
if (instructionType === "Z" || instructionType === "z") {
|
|
306
328
|
return [];
|
|
307
329
|
}
|
|
@@ -868,8 +890,8 @@ var normalizeInstructions = (instructions) => {
|
|
|
868
890
|
moveX = instruction.x;
|
|
869
891
|
moveY = instruction.y;
|
|
870
892
|
} else if (instruction.type === "m") {
|
|
871
|
-
moveX
|
|
872
|
-
moveY
|
|
893
|
+
moveX = x + instruction.dx;
|
|
894
|
+
moveY = y + instruction.dy;
|
|
873
895
|
}
|
|
874
896
|
if (instruction.type === "A" || instruction.type === "C" || instruction.type === "L" || instruction.type === "M" || instruction.type === "Q" || instruction.type === "S" || instruction.type === "T") {
|
|
875
897
|
normalized.push(instruction);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/svg-3d-engine",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@remotion/paths": "4.0.
|
|
4
|
+
"@remotion/paths": "4.0.528"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
7
|
+
"@remotion/eslint-config-internal": "4.0.528",
|
|
8
8
|
"eslint": "9.19.0",
|
|
9
9
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
10
10
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"require": "./dist/cjs/index.js"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
"version": "4.0.
|
|
27
|
+
"version": "4.0.528",
|
|
28
28
|
"repository": {
|
|
29
29
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/svg-3d-engine"
|
|
30
30
|
},
|