@openpawlabs/diy-guides-ui 1.3.1 → 1.5.0
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/components/GuideStep/GuideStep.d.ts +13 -7
- package/dist/components/GuideStep/GuideStep.d.ts.map +1 -1
- package/dist/components/GuideStep/GuideStep.stories.d.ts.map +1 -1
- package/dist/components/MediaFigure/MediaCropEditor.d.ts +27 -0
- package/dist/components/MediaFigure/MediaCropEditor.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaCropEditor.stories.d.ts +22 -0
- package/dist/components/MediaFigure/MediaCropEditor.stories.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaCropEditor.test.d.ts +2 -0
- package/dist/components/MediaFigure/MediaCropEditor.test.d.ts.map +1 -0
- package/dist/components/MediaFigure/MediaFigure.d.ts +40 -1
- package/dist/components/MediaFigure/MediaFigure.d.ts.map +1 -1
- package/dist/components/MediaFigure/MediaFigure.stories.d.ts +5 -0
- package/dist/components/MediaFigure/MediaFigure.stories.d.ts.map +1 -1
- package/dist/components/MediaFigure/MediaFigureAnnotationEditor.d.ts +13 -0
- package/dist/components/MediaFigure/MediaFigureAnnotationEditor.d.ts.map +1 -0
- package/dist/components/MediaFigure/index.d.ts +3 -1
- package/dist/components/MediaFigure/index.d.ts.map +1 -1
- package/dist/diy-guides-ui.cjs +6 -6
- package/dist/diy-guides-ui.cjs.map +1 -1
- package/dist/diy-guides-ui.js +5688 -4503
- package/dist/diy-guides-ui.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/mediaCrop.d.ts +14 -0
- package/dist/utils/mediaCrop.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,16 +2,22 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type GuideColor } from "../../types/colors";
|
|
3
3
|
/**
|
|
4
4
|
* Optional, editor-only media affordances. Presence switches `GuideStep.Media`
|
|
5
|
-
* into edit mode: an empty-state add target,
|
|
6
|
-
* a remove control per thumbnail, a "+" tile to append,
|
|
7
|
-
* drag-to-reorder thumbnails. All members are intent
|
|
8
|
-
* performs no file or menu logic. Omit entirely for the
|
|
5
|
+
* into edit mode: an empty-state add target, an "Edit annotations" / "Adjust crop"
|
|
6
|
+
* overlay on the main image, a remove control per thumbnail, a "+" tile to append,
|
|
7
|
+
* and (with `onReorderImage`) drag-to-reorder thumbnails. All members are intent
|
|
8
|
+
* callbacks — the library performs no file or menu logic. Omit entirely for the
|
|
9
|
+
* read-only reader experience.
|
|
9
10
|
*/
|
|
10
11
|
export interface GuideStepMediaEditing {
|
|
11
12
|
/** Append a new image (e.g. open a file picker). Drives the empty target and "+" tile. */
|
|
12
13
|
onAddImage?: () => void;
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
/** Edit annotations for the image at `index` (fired from the main image overlay). */
|
|
15
|
+
onEditAnnotations?: (index: number) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Adjust the crop / display region for the image at `index`. When set, an
|
|
18
|
+
* "Adjust crop" action appears in the main image overlay beside "Edit annotations".
|
|
19
|
+
*/
|
|
20
|
+
onEditCrop?: (index: number) => void;
|
|
15
21
|
/** Remove the image at `index` (fired by a thumbnail's remove control). */
|
|
16
22
|
onRemoveImage?: (index: number) => void;
|
|
17
23
|
/**
|
|
@@ -41,7 +47,7 @@ export interface GuideStepProps {
|
|
|
41
47
|
completable?: boolean;
|
|
42
48
|
/**
|
|
43
49
|
* Editor-only media affordances. When provided, the media area becomes
|
|
44
|
-
* editable (add /
|
|
50
|
+
* editable (add / annotate / remove / select). Leave undefined for readers.
|
|
45
51
|
*/
|
|
46
52
|
mediaEditing?: GuideStepMediaEditing;
|
|
47
53
|
/** Step body — requires `GuideStep.Media` (≥1 image) and `GuideStep.Bullets` (≥1 bullet). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideStep.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAe7D
|
|
1
|
+
{"version":3,"file":"GuideStep.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAe7D;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,2EAA2E;IAC3E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,8EAA8E;IAC9E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mCAAmC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;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AAC,EACxB,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC,+BAuDA;AAED,6FAA6F;AAC7F,iBAAS,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAmKnD;AA8OD,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,KAAK,EACL,WAAW,EACX,gBAAwB,EACxB,iBAAiB,EACjB,WAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,EAAE,cAAc,+BAsFhB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;CAIpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuideStep.stories.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAyE5D,QAAA,MAAM,IAAI;;;;
|
|
1
|
+
{"version":3,"file":"GuideStep.stories.d.ts","sourceRoot":"","sources":["../../../src/components/GuideStep/GuideStep.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAyE5D,QAAA,MAAM,IAAI;;;;oBAyOmB,CAAC;;;;qBAIqB,CAAC;mBAItC,CAAb;;;;;;;;;;;;;;;;;CArOiC,CAAC;AAEnC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAgCrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAmC5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAiDxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAsCxB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAoC7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAsC1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwBvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAyHhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KA0B/B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type MediaDisplayRegion } from "../../utils/mediaCrop";
|
|
2
|
+
export interface MediaCropEditorProps {
|
|
3
|
+
/** Image source to crop. */
|
|
4
|
+
src: string;
|
|
5
|
+
/**
|
|
6
|
+
* Current 4:3 region in source pixels. When omitted, the editor starts from the
|
|
7
|
+
* largest centered region (the same view the fixed frame center-crops to).
|
|
8
|
+
*/
|
|
9
|
+
region?: MediaDisplayRegion;
|
|
10
|
+
/** Reports a new region (source pixels) when the user finishes a drag. */
|
|
11
|
+
onChange: (region: MediaDisplayRegion) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interactive crop tool: shows the full source image with a draggable, 4:3-locked
|
|
16
|
+
* selection that maps directly to a {@link MediaDisplayRegion} in source pixels.
|
|
17
|
+
* Drag the box to move it, drag a corner to resize. The component owns all
|
|
18
|
+
* pixel geometry and reports the chosen region — selection chrome and persistence
|
|
19
|
+
* stay with the consumer (see the authoring tool's crop modal).
|
|
20
|
+
*
|
|
21
|
+
* Once the source loads, the editor publishes its aspect ratio as the
|
|
22
|
+
* `--crop-aspect` custom property on its root, so a sized container can fit the
|
|
23
|
+
* whole image without scrolling — e.g.
|
|
24
|
+
* `width: min(100cqw, calc(100cqh * var(--crop-aspect)))`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function MediaCropEditor({ src, region, onChange, className, }: MediaCropEditorProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=MediaCropEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaCropEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaCropEditor.tsx"],"names":[],"mappings":"AAUA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AA2E/B,MAAM,WAAW,oBAAoB;IACnC,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,0EAA0E;IAC1E,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAC9B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE,oBAAoB,+BA6ItB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { MediaCropEditor } from "./MediaCropEditor";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof MediaCropEditor;
|
|
6
|
+
tags: string[];
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
args: {
|
|
15
|
+
src: string;
|
|
16
|
+
onChange: () => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
export declare const Default: Story;
|
|
22
|
+
//# sourceMappingURL=MediaCropEditor.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaCropEditor.stories.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaCropEditor.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA0BpD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;CAQ8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAqCrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaCropEditor.test.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaCropEditor.test.tsx"],"names":[],"mappings":""}
|
|
@@ -45,6 +45,32 @@ export interface RectangleAnnotation extends MediaAnnotationBase {
|
|
|
45
45
|
}
|
|
46
46
|
export type MediaAnnotation = PointAnnotation | CircleAnnotation | RectangleAnnotation;
|
|
47
47
|
export type { MediaDisplayRegion };
|
|
48
|
+
/** Active annotation tool: `select` edits existing markers; the rest draw a new shape. */
|
|
49
|
+
export type AnnotationTool = "select" | "point" | "circle" | "rectangle";
|
|
50
|
+
/**
|
|
51
|
+
* Editor-only annotation affordances. Passing this turns the figure into an
|
|
52
|
+
* interactive annotation canvas — click or drag to draw, click to select, drag to
|
|
53
|
+
* move, and drag the handles to resize (the lightbox is disabled). The library owns
|
|
54
|
+
* all frame-percentage geometry and reports intent through these callbacks; tool
|
|
55
|
+
* selection, color choice, and persistence stay with the consumer. Editing relies on
|
|
56
|
+
* stable annotation `id`s so selection and updates can target a specific marker.
|
|
57
|
+
*/
|
|
58
|
+
export interface MediaAnnotationEditing {
|
|
59
|
+
/** Active tool (controlled). */
|
|
60
|
+
tool: AnnotationTool;
|
|
61
|
+
/** Color applied to newly drawn annotations. */
|
|
62
|
+
color: GuideColor;
|
|
63
|
+
/** Selected annotation id, or `null` when nothing is selected (controlled). */
|
|
64
|
+
selectedId?: string | null;
|
|
65
|
+
/** Selection changed to an annotation `id`, or `null` when cleared. */
|
|
66
|
+
onSelect?: (id: string | null) => void;
|
|
67
|
+
/** A new annotation was drawn. It carries no `id` — the consumer assigns one. */
|
|
68
|
+
onAdd?: (annotation: MediaAnnotation) => void;
|
|
69
|
+
/** The annotation with `id` was moved or resized. */
|
|
70
|
+
onChange?: (id: string, annotation: MediaAnnotation) => void;
|
|
71
|
+
/** The selected annotation was deleted via `Delete` / `Backspace`. */
|
|
72
|
+
onRemove?: (id: string) => void;
|
|
73
|
+
}
|
|
48
74
|
export interface MediaFigureProps {
|
|
49
75
|
/** Image, video, or 3D model source URL. */
|
|
50
76
|
src: string;
|
|
@@ -57,6 +83,17 @@ export interface MediaFigureProps {
|
|
|
57
83
|
* scaled to fill the frame without re-encoding the image.
|
|
58
84
|
*/
|
|
59
85
|
displayRegion?: MediaDisplayRegion;
|
|
86
|
+
/**
|
|
87
|
+
* Let readers click an image to open it full size in a modal lightbox. Applies
|
|
88
|
+
* only to `type="image"`; turn it off in editing contexts where the click drives
|
|
89
|
+
* another action. @default true
|
|
90
|
+
*/
|
|
91
|
+
zoomable?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Editor-only annotation affordances. When set, the figure becomes an interactive
|
|
94
|
+
* annotation canvas (the lightbox is disabled). Leave undefined for readers.
|
|
95
|
+
*/
|
|
96
|
+
annotationEditing?: MediaAnnotationEditing;
|
|
60
97
|
className?: string;
|
|
61
98
|
}
|
|
62
99
|
/**
|
|
@@ -65,6 +102,8 @@ export interface MediaFigureProps {
|
|
|
65
102
|
* `displayRegion` selects a source-pixel crop. Point markers use
|
|
66
103
|
* {@link GuideColor} values so they can be visually linked to matching `GuideStep`
|
|
67
104
|
* bullets; circles and rectangles use the same color for their outline and fill.
|
|
105
|
+
* Image figures are zoomable by default: clicking opens the full-size source in a
|
|
106
|
+
* modal lightbox (see `zoomable`).
|
|
68
107
|
*/
|
|
69
|
-
export declare function MediaFigure({ src, type, annotations, displayRegion, className, }: MediaFigureProps): import("react").JSX.Element;
|
|
108
|
+
export declare function MediaFigure({ src, type, annotations, displayRegion, zoomable, annotationEditing, className, }: MediaFigureProps): import("react").JSX.Element;
|
|
70
109
|
//# sourceMappingURL=MediaFigure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFigure.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaFigure.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIhE,gDAAgD;AAChD,UAAU,mBAAmB;IAC3B,6CAA6C;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,mFAAmF;AACnF,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,uBAAuB;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,CAAC,EAAE,MAAM,CAAC;IACV,qEAAqE;IACrE,CAAC,EAAE,MAAM,CAAC;IACV,uEAAuE;IACvE,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,2EAA2E;AAC3E,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,IAAI,EAAE,QAAQ,CAAC;IACf,6EAA6E;IAC7E,CAAC,EAAE,MAAM,CAAC;IACV,4EAA4E;IAC5E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AO,GAAG,OAAO,GAAG,OAAO,CAAC;IACnC,oFAAoF;IACpF,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,IAAc,EACd,WAAgB,EAChB,aAAa,EACb,QAAe,EACf,iBAAiB,EACjB,SAAS,GACV,EAAE,gBAAgB,+BAgDlB"}
|
|
@@ -16,6 +16,9 @@ declare const meta: {
|
|
|
16
16
|
control: "inline-radio";
|
|
17
17
|
options: string[];
|
|
18
18
|
};
|
|
19
|
+
zoomable: {
|
|
20
|
+
control: "boolean";
|
|
21
|
+
};
|
|
19
22
|
};
|
|
20
23
|
args: {
|
|
21
24
|
src: string;
|
|
@@ -24,10 +27,12 @@ declare const meta: {
|
|
|
24
27
|
export default meta;
|
|
25
28
|
type Story = StoryObj<typeof meta>;
|
|
26
29
|
export declare const Default: Story;
|
|
30
|
+
export declare const Lightbox: Story;
|
|
27
31
|
export declare const WithPointAnnotations: Story;
|
|
28
32
|
export declare const WithShapeAnnotations: Story;
|
|
29
33
|
export declare const Video: Story;
|
|
30
34
|
export declare const Model3D: Story;
|
|
31
35
|
export declare const TallImageCenterCrop: Story;
|
|
32
36
|
export declare const DisplayRegion: Story;
|
|
37
|
+
export declare const AnnotationEditor: Story;
|
|
33
38
|
//# sourceMappingURL=MediaFigure.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFigure.stories.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigure.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaFigure.stories.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigure.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EACL,WAAW,EAGZ,MAAM,eAAe,CAAC;AAgEvB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAc0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAiBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAqBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA2ClC,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAkBnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAkBrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAiBjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAkB3B,CAAC;AAKF,eAAO,MAAM,gBAAgB,EAAE,KA0F9B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MediaAnnotation, MediaAnnotationEditing } from "./MediaFigure";
|
|
2
|
+
export interface MediaFigureAnnotationEditorProps {
|
|
3
|
+
annotations: MediaAnnotation[];
|
|
4
|
+
editing: MediaAnnotationEditing;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Interactive overlay that turns {@link MediaFigure} annotations into a drawing
|
|
8
|
+
* canvas: click or drag to add, click to select, drag to move, and drag the
|
|
9
|
+
* handles to resize. All geometry is computed in frame percentages and reported
|
|
10
|
+
* through the editing callbacks — selection, color, and persistence stay external.
|
|
11
|
+
*/
|
|
12
|
+
export declare function MediaFigureAnnotationEditor({ annotations, editing, }: MediaFigureAnnotationEditorProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=MediaFigureAnnotationEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MediaFigureAnnotationEditor.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/MediaFigureAnnotationEditor.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,eAAe,EACf,sBAAsB,EAGvB,MAAM,eAAe,CAAC;AAkJvB,MAAM,WAAW,gCAAgC;IAC/C,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,WAAW,EACX,OAAO,GACR,EAAE,gCAAgC,+BA4OlC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { MediaFigure } from "./MediaFigure";
|
|
2
|
-
export type { MediaFigureProps, MediaAnnotation, MediaDisplayRegion, PointAnnotation, CircleAnnotation, RectangleAnnotation, } from "./MediaFigure";
|
|
2
|
+
export type { MediaFigureProps, MediaAnnotation, MediaAnnotationEditing, AnnotationTool, MediaDisplayRegion, PointAnnotation, CircleAnnotation, RectangleAnnotation, } from "./MediaFigure";
|
|
3
3
|
export { MediaFigureThumbnail } from "./MediaFigureThumbnail";
|
|
4
4
|
export type { MediaFigureThumbnailProps } from "./MediaFigureThumbnail";
|
|
5
|
+
export { MediaCropEditor } from "./MediaCropEditor";
|
|
6
|
+
export type { MediaCropEditorProps } from "./MediaCropEditor";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MediaFigure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|