@remotion/rough-notation 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/Annotation.d.ts +2 -2
- package/dist/esm/index.mjs +88 -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
|
|
@@ -1087,9 +1089,31 @@ var makeInstructions = (arr, instruction, cb) => {
|
|
|
1087
1089
|
};
|
|
1088
1090
|
var segmentRegExp = /([astvzqmhlc])([^astvzqmhlc]*)/gi;
|
|
1089
1091
|
var numberRegExp = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;
|
|
1092
|
+
var arcNumberRegExp = /[\s,]*([-+]?(?:[0-9]+\.?[0-9]*|\.[0-9]+)(?:e[-+]?\d+)?)/iy;
|
|
1093
|
+
var arcFlagRegExp = /[\s,]*([01])/y;
|
|
1090
1094
|
var parseValues = (args, instructionType) => {
|
|
1091
|
-
|
|
1092
|
-
if (
|
|
1095
|
+
let numbers;
|
|
1096
|
+
if (instructionType === "A" || instructionType === "a") {
|
|
1097
|
+
numbers = [];
|
|
1098
|
+
let match;
|
|
1099
|
+
let lastIndex = 0;
|
|
1100
|
+
do {
|
|
1101
|
+
const regExp = numbers.length % 7 === 3 || numbers.length % 7 === 4 ? arcFlagRegExp : arcNumberRegExp;
|
|
1102
|
+
regExp.lastIndex = lastIndex;
|
|
1103
|
+
match = regExp.exec(args);
|
|
1104
|
+
if (match) {
|
|
1105
|
+
numbers.push(match[1]);
|
|
1106
|
+
lastIndex = regExp.lastIndex;
|
|
1107
|
+
}
|
|
1108
|
+
} while (match);
|
|
1109
|
+
const rest = args.slice(lastIndex);
|
|
1110
|
+
if (!/^[\s,]*$/.test(rest)) {
|
|
1111
|
+
throw new Error(`Malformed path data: ${instructionType} has an invalid value at "${rest.trim()}"`);
|
|
1112
|
+
}
|
|
1113
|
+
} else {
|
|
1114
|
+
numbers = args.match(numberRegExp);
|
|
1115
|
+
}
|
|
1116
|
+
if (!numbers || numbers.length === 0) {
|
|
1093
1117
|
if (instructionType === "Z" || instructionType === "z") {
|
|
1094
1118
|
return [];
|
|
1095
1119
|
}
|
|
@@ -2651,6 +2675,7 @@ var iterationsSchema = (defaultValue) => ({
|
|
|
2651
2675
|
type: "number",
|
|
2652
2676
|
min: 1,
|
|
2653
2677
|
step: 1,
|
|
2678
|
+
integer: true,
|
|
2654
2679
|
default: defaultValue,
|
|
2655
2680
|
description: "Iterations",
|
|
2656
2681
|
hiddenFromList: false
|
|
@@ -2719,6 +2744,7 @@ var curveControlsSchema = {
|
|
|
2719
2744
|
type: "number",
|
|
2720
2745
|
min: 1,
|
|
2721
2746
|
step: 1,
|
|
2747
|
+
integer: true,
|
|
2722
2748
|
default: 9,
|
|
2723
2749
|
description: "Curve Step Count",
|
|
2724
2750
|
hiddenFromList: false
|
|
@@ -2767,6 +2793,7 @@ var textContentSchema = {
|
|
|
2767
2793
|
};
|
|
2768
2794
|
var sharedSchema = (defaultRoughness) => ({
|
|
2769
2795
|
...Interactive.baseSchema,
|
|
2796
|
+
...Interactive.premountSchema,
|
|
2770
2797
|
progress: {
|
|
2771
2798
|
type: "number",
|
|
2772
2799
|
min: 0,
|
|
@@ -2880,7 +2907,12 @@ var makeAnnotationComponent = ({
|
|
|
2880
2907
|
children,
|
|
2881
2908
|
durationInFrames,
|
|
2882
2909
|
from,
|
|
2910
|
+
premountFor,
|
|
2911
|
+
postmountFor,
|
|
2912
|
+
styleWhilePremounted,
|
|
2913
|
+
styleWhilePostmounted,
|
|
2883
2914
|
trimBefore,
|
|
2915
|
+
playbackRate,
|
|
2884
2916
|
freeze,
|
|
2885
2917
|
hidden,
|
|
2886
2918
|
name,
|
|
@@ -2918,30 +2950,61 @@ var makeAnnotationComponent = ({
|
|
|
2918
2950
|
disableMultiStroke,
|
|
2919
2951
|
preserveVertices
|
|
2920
2952
|
});
|
|
2921
|
-
|
|
2922
|
-
|
|
2953
|
+
const {
|
|
2954
|
+
effectivePremountFor,
|
|
2955
|
+
effectivePostmountFor,
|
|
2956
|
+
freezeFrame,
|
|
2957
|
+
isPremountingOrPostmounting,
|
|
2958
|
+
premountingActive,
|
|
2959
|
+
postmountingActive,
|
|
2960
|
+
premountingStyle
|
|
2961
|
+
} = Internals.usePremounting({
|
|
2923
2962
|
from: from ?? 0,
|
|
2924
|
-
trimBefore,
|
|
2925
2963
|
durationInFrames: durationInFrames ?? Infinity,
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2964
|
+
premountFor: premountFor ?? null,
|
|
2965
|
+
postmountFor: postmountFor ?? null,
|
|
2966
|
+
style: null,
|
|
2967
|
+
styleWhilePremounted: styleWhilePremounted ?? null,
|
|
2968
|
+
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
2969
|
+
hideWhilePremounted: "opacity"
|
|
2970
|
+
});
|
|
2971
|
+
return /* @__PURE__ */ jsx3(Freeze, {
|
|
2972
|
+
frame: freezeFrame,
|
|
2973
|
+
active: isPremountingOrPostmounting,
|
|
2974
|
+
children: /* @__PURE__ */ jsx3(Sequence, {
|
|
2975
|
+
layout: "none",
|
|
2976
|
+
from: from ?? 0,
|
|
2977
|
+
trimBefore,
|
|
2978
|
+
playbackRate,
|
|
2979
|
+
durationInFrames: durationInFrames ?? Infinity,
|
|
2980
|
+
freeze,
|
|
2981
|
+
hidden,
|
|
2982
|
+
name: name ?? `<${componentName}>`,
|
|
2983
|
+
showInTimeline: showInTimeline ?? true,
|
|
2984
|
+
controls,
|
|
2985
|
+
_remotionInternalDocumentationLink: `https://www.remotion.dev/docs/rough-notation/${documentationSlug}`,
|
|
2986
|
+
outlineRef,
|
|
2987
|
+
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
2988
|
+
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
2989
|
+
_remotionInternalIsPremounting: premountingActive,
|
|
2990
|
+
_remotionInternalIsPostmounting: postmountingActive,
|
|
2991
|
+
children: /* @__PURE__ */ jsx3("span", {
|
|
2992
|
+
ref: outlineRef,
|
|
2993
|
+
style: {
|
|
2994
|
+
display: "inline-block",
|
|
2995
|
+
position: "relative",
|
|
2996
|
+
...premountingStyle
|
|
2997
|
+
},
|
|
2998
|
+
children: /* @__PURE__ */ jsxs(annotation.Container, {
|
|
2999
|
+
children: [
|
|
3000
|
+
layer === "behind" ? annotationElement : null,
|
|
3001
|
+
/* @__PURE__ */ jsx3(annotation.Tracker, {
|
|
3002
|
+
style,
|
|
3003
|
+
children
|
|
3004
|
+
}),
|
|
3005
|
+
layer === "on-top" ? annotationElement : null
|
|
3006
|
+
]
|
|
3007
|
+
})
|
|
2945
3008
|
})
|
|
2946
3009
|
})
|
|
2947
3010
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/rough-notation",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.528",
|
|
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.528",
|
|
30
|
+
"remotion": "4.0.528",
|
|
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.528",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
51
51
|
},
|