@remotion/rough-notation 4.0.490

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.
@@ -0,0 +1,3 @@
1
+ export { Box, Bracket, Circle, CrossedOff, Highlight, StrikeThrough, Underline, } from './Annotation';
2
+ export type { BoxProps, BracketProps, CircleProps, CrossedOffProps, HighlightProps, StrikeThroughProps, UnderlineProps, } from './Annotation';
3
+ export type { Padding } from './types';
@@ -0,0 +1,22 @@
1
+ import type { OpSet } from 'roughjs/bin/core';
2
+ import type { Rect, ResolvedAnnotationConfig, RoughAnnotationOptions } from './types';
3
+ export declare const addKeysToPaths: (paths: string[]) => {
4
+ readonly d: string;
5
+ readonly key: string;
6
+ }[];
7
+ export declare function getInstructions({ rect, config, seed, options }: {
8
+ readonly rect: Rect;
9
+ readonly config: ResolvedAnnotationConfig;
10
+ readonly seed: number;
11
+ readonly options: RoughAnnotationOptions;
12
+ }): {
13
+ opList: OpSet[];
14
+ strokeWidth: number;
15
+ };
16
+ export declare const renderAnnotation: ({ rect, config, seed, progress, options, }: {
17
+ readonly rect: Rect;
18
+ readonly config: ResolvedAnnotationConfig;
19
+ readonly seed: number;
20
+ readonly progress: number;
21
+ readonly options: RoughAnnotationOptions;
22
+ }) => import("react/jsx-runtime").JSX.Element[];
@@ -0,0 +1,11 @@
1
+ import type React from 'react';
2
+ import type { ResolvedAnnotationConfig, RoughAnnotationOptions } from './types';
3
+ export declare const render: ({ svg, seed, element, config, scale, progress, options, }: {
4
+ readonly svg: SVGSVGElement;
5
+ readonly seed: number;
6
+ readonly element: HTMLElement;
7
+ readonly config: ResolvedAnnotationConfig;
8
+ readonly scale: number;
9
+ readonly progress: number;
10
+ readonly options: RoughAnnotationOptions;
11
+ }) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>[];
@@ -0,0 +1,111 @@
1
+ export type Rect = {
2
+ readonly x: number;
3
+ readonly y: number;
4
+ readonly w: number;
5
+ readonly h: number;
6
+ };
7
+ export type Padding = {
8
+ readonly left: number;
9
+ readonly right: number;
10
+ readonly top: number;
11
+ readonly bottom: number;
12
+ };
13
+ export type Box = 'inside' | 'around';
14
+ export type RoughAnnotationOptions = {
15
+ readonly roughness?: number;
16
+ readonly maxRandomnessOffset?: number;
17
+ readonly bowing?: number;
18
+ readonly curveFitting?: number;
19
+ readonly curveTightness?: number;
20
+ readonly curveStepCount?: number;
21
+ readonly disableMultiStroke?: boolean;
22
+ readonly preserveVertices?: boolean;
23
+ };
24
+ export type SharedRoughAnnotationOptions = Omit<RoughAnnotationOptions, 'curveFitting' | 'curveTightness' | 'curveStepCount'>;
25
+ export type CurveAnnotationOptions = Pick<RoughAnnotationOptions, 'curveFitting' | 'curveTightness' | 'curveStepCount'>;
26
+ type ColorConfig = {
27
+ readonly color?: string;
28
+ };
29
+ type StrokeConfig = ColorConfig & {
30
+ readonly strokeWidth?: number;
31
+ };
32
+ type PaddingConfig = {
33
+ readonly padding?: Partial<Padding>;
34
+ };
35
+ type UnderlinePaddingConfig = {
36
+ readonly padding?: {
37
+ readonly top?: number;
38
+ };
39
+ };
40
+ type IterationConfig = {
41
+ readonly iterations?: number;
42
+ };
43
+ type RtlConfig = {
44
+ readonly rtl?: boolean;
45
+ };
46
+ type BracketConfig = {
47
+ readonly bracketLeft?: boolean;
48
+ readonly bracketRight?: boolean;
49
+ readonly bracketTop?: boolean;
50
+ readonly bracketBottom?: boolean;
51
+ };
52
+ export type UnderlineConfig = StrokeConfig & UnderlinePaddingConfig & IterationConfig & RtlConfig;
53
+ export type StrikeThroughConfig = StrokeConfig & IterationConfig & RtlConfig;
54
+ export type BoxConfig = StrokeConfig & PaddingConfig & IterationConfig;
55
+ export type BracketAnnotationConfig = BracketConfig & StrokeConfig & PaddingConfig;
56
+ export type CrossedOffConfig = StrokeConfig & IterationConfig & RtlConfig;
57
+ export type CircleConfig = StrokeConfig & PaddingConfig & IterationConfig & {
58
+ readonly box?: Box;
59
+ };
60
+ export type HighlightConfig = ColorConfig & PaddingConfig & IterationConfig & RtlConfig;
61
+ export type AnnotationConfig = {
62
+ readonly type: 'none';
63
+ } | (UnderlineConfig & {
64
+ readonly type: 'underline';
65
+ }) | (StrikeThroughConfig & {
66
+ readonly type: 'strike-through';
67
+ }) | (BoxConfig & {
68
+ readonly type: 'box';
69
+ }) | (BracketAnnotationConfig & {
70
+ readonly type: 'bracket';
71
+ }) | (CrossedOffConfig & {
72
+ readonly type: 'crossed-off';
73
+ }) | (CircleConfig & {
74
+ readonly type: 'circle';
75
+ }) | (HighlightConfig & {
76
+ readonly type: 'highlight';
77
+ });
78
+ type ResolvedSharedConfig = {
79
+ readonly color: string;
80
+ readonly strokeWidth: number;
81
+ };
82
+ type ResolvedPaddingConfig = {
83
+ readonly padding: Padding;
84
+ };
85
+ type ResolvedIterationConfig = {
86
+ readonly iterations: number;
87
+ };
88
+ type ResolvedRtlConfig = {
89
+ readonly rtl: boolean;
90
+ };
91
+ export type ResolvedAnnotationConfig = {
92
+ readonly type: 'none';
93
+ } | ({
94
+ readonly type: 'underline';
95
+ } & ResolvedSharedConfig & ResolvedPaddingConfig & ResolvedIterationConfig & ResolvedRtlConfig) | ({
96
+ readonly type: 'strike-through';
97
+ } & ResolvedSharedConfig & ResolvedIterationConfig & ResolvedRtlConfig) | ({
98
+ readonly type: 'box';
99
+ } & ResolvedSharedConfig & ResolvedPaddingConfig & ResolvedIterationConfig) | ({
100
+ readonly type: 'bracket';
101
+ } & Required<BracketConfig> & ResolvedSharedConfig & ResolvedPaddingConfig) | ({
102
+ readonly type: 'crossed-off';
103
+ } & ResolvedSharedConfig & ResolvedIterationConfig & ResolvedRtlConfig) | ({
104
+ readonly type: 'circle';
105
+ readonly box: Box;
106
+ } & ResolvedSharedConfig & ResolvedPaddingConfig & ResolvedIterationConfig) | ({
107
+ readonly type: 'highlight';
108
+ } & Omit<ResolvedSharedConfig, 'strokeWidth'> & ResolvedPaddingConfig & ResolvedIterationConfig & ResolvedRtlConfig);
109
+ export declare const resolveRoughOptions: (options: RoughAnnotationOptions) => RoughAnnotationOptions;
110
+ export declare const resolveAnnotationConfig: (config: AnnotationConfig) => ResolvedAnnotationConfig;
111
+ export {};
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@remotion/rough-notation",
3
+ "version": "4.0.490",
4
+ "description": "Rough annotation primitives for Remotion",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/esm/index.mjs",
8
+ "repository": {
9
+ "url": "https://github.com/remotion-dev/remotion/tree/main/packages/rough-notation"
10
+ },
11
+ "type": "module",
12
+ "scripts": {
13
+ "test": "bun test src/test",
14
+ "formatting": "oxfmt src --check",
15
+ "format": "oxfmt src",
16
+ "lint": "eslint src",
17
+ "watch": "tsgo -w",
18
+ "make": "tsgo && bun --env-file=../.env.bundle bundle.ts"
19
+ },
20
+ "author": "Jonny Burger <jonny@remotion.dev>",
21
+ "contributors": [
22
+ "Mohit Yadav <yo@mohitya.dev>"
23
+ ],
24
+ "license": "MIT",
25
+ "bugs": {
26
+ "url": "https://github.com/remotion-dev/remotion/issues"
27
+ },
28
+ "dependencies": {
29
+ "@remotion/paths": "4.0.490",
30
+ "remotion": "4.0.490",
31
+ "roughjs": "4.6.6"
32
+ },
33
+ "peerDependencies": {
34
+ "react": ">=16.8.0",
35
+ "react-dom": ">=16.8.0"
36
+ },
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "module": "./dist/esm/index.mjs",
41
+ "import": "./dist/esm/index.mjs"
42
+ },
43
+ "./package.json": "./package.json"
44
+ },
45
+ "devDependencies": {
46
+ "react": "19.2.3",
47
+ "react-dom": "19.2.3",
48
+ "@remotion/eslint-config-internal": "4.0.490",
49
+ "eslint": "9.19.0",
50
+ "@typescript/native-preview": "7.0.0-dev.20260217.1"
51
+ },
52
+ "keywords": [
53
+ "remotion",
54
+ "rough-notation",
55
+ "annotations"
56
+ ],
57
+ "publishConfig": {
58
+ "access": "public"
59
+ },
60
+ "homepage": "https://www.remotion.dev/docs/rough-notation"
61
+ }