@remotion/rough-notation 4.0.527 → 4.0.529
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/Annotation.d.ts +2 -2
- package/dist/esm/index.mjs +91 -25
- package/package.json +4 -4
package/dist/Annotation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type InteractiveBaseProps, type InteractivitySchema } from 'remotion';
|
|
2
|
+
import { type InteractiveBaseProps, type InteractivePremountProps, type InteractivitySchema } from 'remotion';
|
|
3
3
|
import type { BoxConfig, BracketAnnotationConfig, CircleConfig, CrossedOffConfig, CurveAnnotationOptions, HighlightConfig, SharedRoughAnnotationOptions, StrikeThroughConfig, UnderlineConfig } from './types';
|
|
4
4
|
type SharedAnnotationComponentProps = Readonly<{
|
|
5
5
|
readonly children: React.ReactNode;
|
|
@@ -8,7 +8,7 @@ type SharedAnnotationComponentProps = Readonly<{
|
|
|
8
8
|
readonly disabled?: boolean;
|
|
9
9
|
readonly style?: React.CSSProperties;
|
|
10
10
|
} & SharedRoughAnnotationOptions>;
|
|
11
|
-
type AnnotationInteractiveProps<Config> = SharedAnnotationComponentProps & Readonly<Config> & InteractiveBaseProps;
|
|
11
|
+
type AnnotationInteractiveProps<Config> = SharedAnnotationComponentProps & Readonly<Config> & InteractiveBaseProps & InteractivePremountProps;
|
|
12
12
|
export type HighlightProps = AnnotationInteractiveProps<HighlightConfig>;
|
|
13
13
|
export type UnderlineProps = AnnotationInteractiveProps<UnderlineConfig>;
|
|
14
14
|
export type StrikeThroughProps = AnnotationInteractiveProps<StrikeThroughConfig>;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import React2, { useMemo as useMemo3 } from "react";
|
|
3
3
|
import {
|
|
4
4
|
Interactive,
|
|
5
|
-
|
|
5
|
+
Freeze,
|
|
6
|
+
Sequence,
|
|
7
|
+
Internals
|
|
6
8
|
} from "remotion";
|
|
7
9
|
|
|
8
10
|
// src/create-annotation.tsx
|
|
@@ -98,6 +100,9 @@ var useElementSize = (ref) => {
|
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
// ../paths/dist/esm/index.mjs
|
|
103
|
+
import {
|
|
104
|
+
interpolate
|
|
105
|
+
} from "remotion/no-react";
|
|
101
106
|
var tValues = [
|
|
102
107
|
[],
|
|
103
108
|
[],
|
|
@@ -1087,9 +1092,31 @@ var makeInstructions = (arr, instruction, cb) => {
|
|
|
1087
1092
|
};
|
|
1088
1093
|
var segmentRegExp = /([astvzqmhlc])([^astvzqmhlc]*)/gi;
|
|
1089
1094
|
var numberRegExp = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
|
|
1095
|
+
var arcNumberRegExp = /[\s,]*([-+]?(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:e[-+]?\d+)?)/iy;
|
|
1096
|
+
var arcFlagRegExp = /[\s,]*([01])/y;
|
|
1090
1097
|
var parseValues = (args, instructionType) => {
|
|
1091
|
-
|
|
1092
|
-
if (
|
|
1098
|
+
let numbers;
|
|
1099
|
+
if (instructionType === "A" || instructionType === "a") {
|
|
1100
|
+
numbers = [];
|
|
1101
|
+
let match;
|
|
1102
|
+
let lastIndex = 0;
|
|
1103
|
+
do {
|
|
1104
|
+
const regExp = numbers.length % 7 === 3 || numbers.length % 7 === 4 ? arcFlagRegExp : arcNumberRegExp;
|
|
1105
|
+
regExp.lastIndex = lastIndex;
|
|
1106
|
+
match = regExp.exec(args);
|
|
1107
|
+
if (match) {
|
|
1108
|
+
numbers.push(match[1]);
|
|
1109
|
+
lastIndex = regExp.lastIndex;
|
|
1110
|
+
}
|
|
1111
|
+
} while (match);
|
|
1112
|
+
const rest = args.slice(lastIndex);
|
|
1113
|
+
if (!/^[\s,]*$/.test(rest)) {
|
|
1114
|
+
throw new Error(`Malformed path data: ${instructionType} has an invalid value at "${rest.trim()}"`);
|
|
1115
|
+
}
|
|
1116
|
+
} else {
|
|
1117
|
+
numbers = args.match(numberRegExp);
|
|
1118
|
+
}
|
|
1119
|
+
if (!numbers || numbers.length === 0) {
|
|
1093
1120
|
if (instructionType === "Z" || instructionType === "z") {
|
|
1094
1121
|
return [];
|
|
1095
1122
|
}
|
|
@@ -2651,6 +2678,7 @@ var iterationsSchema = (defaultValue) => ({
|
|
|
2651
2678
|
type: "number",
|
|
2652
2679
|
min: 1,
|
|
2653
2680
|
step: 1,
|
|
2681
|
+
integer: true,
|
|
2654
2682
|
default: defaultValue,
|
|
2655
2683
|
description: "Iterations",
|
|
2656
2684
|
hiddenFromList: false
|
|
@@ -2719,6 +2747,7 @@ var curveControlsSchema = {
|
|
|
2719
2747
|
type: "number",
|
|
2720
2748
|
min: 1,
|
|
2721
2749
|
step: 1,
|
|
2750
|
+
integer: true,
|
|
2722
2751
|
default: 9,
|
|
2723
2752
|
description: "Curve Step Count",
|
|
2724
2753
|
hiddenFromList: false
|
|
@@ -2767,6 +2796,7 @@ var textContentSchema = {
|
|
|
2767
2796
|
};
|
|
2768
2797
|
var sharedSchema = (defaultRoughness) => ({
|
|
2769
2798
|
...Interactive.baseSchema,
|
|
2799
|
+
...Interactive.premountSchema,
|
|
2770
2800
|
progress: {
|
|
2771
2801
|
type: "number",
|
|
2772
2802
|
min: 0,
|
|
@@ -2880,7 +2910,12 @@ var makeAnnotationComponent = ({
|
|
|
2880
2910
|
children,
|
|
2881
2911
|
durationInFrames,
|
|
2882
2912
|
from,
|
|
2913
|
+
premountFor,
|
|
2914
|
+
postmountFor,
|
|
2915
|
+
styleWhilePremounted,
|
|
2916
|
+
styleWhilePostmounted,
|
|
2883
2917
|
trimBefore,
|
|
2918
|
+
playbackRate,
|
|
2884
2919
|
freeze,
|
|
2885
2920
|
hidden,
|
|
2886
2921
|
name,
|
|
@@ -2918,30 +2953,61 @@ var makeAnnotationComponent = ({
|
|
|
2918
2953
|
disableMultiStroke,
|
|
2919
2954
|
preserveVertices
|
|
2920
2955
|
});
|
|
2921
|
-
|
|
2922
|
-
|
|
2956
|
+
const {
|
|
2957
|
+
effectivePremountFor,
|
|
2958
|
+
effectivePostmountFor,
|
|
2959
|
+
freezeFrame,
|
|
2960
|
+
isPremountingOrPostmounting,
|
|
2961
|
+
premountingActive,
|
|
2962
|
+
postmountingActive,
|
|
2963
|
+
premountingStyle
|
|
2964
|
+
} = Internals.usePremounting({
|
|
2923
2965
|
from: from ?? 0,
|
|
2924
|
-
trimBefore,
|
|
2925
2966
|
durationInFrames: durationInFrames ?? Infinity,
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2967
|
+
premountFor: premountFor ?? null,
|
|
2968
|
+
postmountFor: postmountFor ?? null,
|
|
2969
|
+
style: null,
|
|
2970
|
+
styleWhilePremounted: styleWhilePremounted ?? null,
|
|
2971
|
+
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
2972
|
+
hideWhilePremounted: "opacity"
|
|
2973
|
+
});
|
|
2974
|
+
return /* @__PURE__ */ jsx3(Freeze, {
|
|
2975
|
+
frame: freezeFrame,
|
|
2976
|
+
active: isPremountingOrPostmounting,
|
|
2977
|
+
children: /* @__PURE__ */ jsx3(Sequence, {
|
|
2978
|
+
layout: "none",
|
|
2979
|
+
from: from ?? 0,
|
|
2980
|
+
trimBefore,
|
|
2981
|
+
playbackRate,
|
|
2982
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
2983
|
+
freeze,
|
|
2984
|
+
hidden,
|
|
2985
|
+
name: name ?? `<${componentName}>`,
|
|
2986
|
+
showInTimeline: showInTimeline ?? true,
|
|
2987
|
+
controls,
|
|
2988
|
+
_remotionInternalDocumentationLink: `https://www.remotion.dev/docs/rough-notation/${documentationSlug}`,
|
|
2989
|
+
outlineRef,
|
|
2990
|
+
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
2991
|
+
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
2992
|
+
_remotionInternalIsPremounting: premountingActive,
|
|
2993
|
+
_remotionInternalIsPostmounting: postmountingActive,
|
|
2994
|
+
children: /* @__PURE__ */ jsx3("span", {
|
|
2995
|
+
ref: outlineRef,
|
|
2996
|
+
style: {
|
|
2997
|
+
display: "inline-block",
|
|
2998
|
+
position: "relative",
|
|
2999
|
+
...premountingStyle
|
|
3000
|
+
},
|
|
3001
|
+
children: /* @__PURE__ */ jsxs(annotation.Container, {
|
|
3002
|
+
children: [
|
|
3003
|
+
layer === "behind" ? annotationElement : null,
|
|
3004
|
+
/* @__PURE__ */ jsx3(annotation.Tracker, {
|
|
3005
|
+
style,
|
|
3006
|
+
children
|
|
3007
|
+
}),
|
|
3008
|
+
layer === "on-top" ? annotationElement : null
|
|
3009
|
+
]
|
|
3010
|
+
})
|
|
2945
3011
|
})
|
|
2946
3012
|
})
|
|
2947
3013
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/rough-notation",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.529",
|
|
4
4
|
"description": "Rough annotation primitives for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@remotion/paths": "4.0.
|
|
30
|
-
"remotion": "4.0.
|
|
29
|
+
"@remotion/paths": "4.0.529",
|
|
30
|
+
"remotion": "4.0.529",
|
|
31
31
|
"roughjs": "4.6.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"react": "19.2.3",
|
|
47
47
|
"react-dom": "19.2.3",
|
|
48
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.529",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
51
51
|
},
|