@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.
Files changed (27) hide show
  1. package/dist/components/GuideStep/GuideStep.d.ts +13 -7
  2. package/dist/components/GuideStep/GuideStep.d.ts.map +1 -1
  3. package/dist/components/GuideStep/GuideStep.stories.d.ts.map +1 -1
  4. package/dist/components/MediaFigure/MediaCropEditor.d.ts +27 -0
  5. package/dist/components/MediaFigure/MediaCropEditor.d.ts.map +1 -0
  6. package/dist/components/MediaFigure/MediaCropEditor.stories.d.ts +22 -0
  7. package/dist/components/MediaFigure/MediaCropEditor.stories.d.ts.map +1 -0
  8. package/dist/components/MediaFigure/MediaCropEditor.test.d.ts +2 -0
  9. package/dist/components/MediaFigure/MediaCropEditor.test.d.ts.map +1 -0
  10. package/dist/components/MediaFigure/MediaFigure.d.ts +40 -1
  11. package/dist/components/MediaFigure/MediaFigure.d.ts.map +1 -1
  12. package/dist/components/MediaFigure/MediaFigure.stories.d.ts +5 -0
  13. package/dist/components/MediaFigure/MediaFigure.stories.d.ts.map +1 -1
  14. package/dist/components/MediaFigure/MediaFigureAnnotationEditor.d.ts +13 -0
  15. package/dist/components/MediaFigure/MediaFigureAnnotationEditor.d.ts.map +1 -0
  16. package/dist/components/MediaFigure/index.d.ts +3 -1
  17. package/dist/components/MediaFigure/index.d.ts.map +1 -1
  18. package/dist/diy-guides-ui.cjs +6 -6
  19. package/dist/diy-guides-ui.cjs.map +1 -1
  20. package/dist/diy-guides-ui.js +5688 -4503
  21. package/dist/diy-guides-ui.js.map +1 -1
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/utils/mediaCrop.d.ts +14 -0
  26. package/dist/utils/mediaCrop.d.ts.map +1 -1
  27. package/package.json +1 -1
@@ -9,8 +9,22 @@ export interface MediaDisplayRegion {
9
9
  width: number;
10
10
  }
11
11
  export declare const DISPLAY_REGION_ASPECT: number;
12
+ /** Smallest selectable region width, in source pixels, so a crop never collapses. */
13
+ export declare const MIN_REGION_WIDTH = 16;
12
14
  /** Height in source pixels for a 4:3 region with the given width. */
13
15
  export declare function displayRegionHeight(width: number): number;
16
+ /**
17
+ * Snap a region to integer source pixels and keep its 4:3 box fully inside the
18
+ * source: width is bounded by both axes, then `x` / `y` are pinned so the derived
19
+ * height fits. Use it to sanitize any externally supplied or in-progress region.
20
+ */
21
+ export declare function clampDisplayRegion(region: MediaDisplayRegion, sourceWidth: number, sourceHeight: number): MediaDisplayRegion;
22
+ /**
23
+ * Largest centered 4:3 region for a source — the rect the fixed frame shows when
24
+ * no `displayRegion` is set. Used as the starting selection in the crop editor so
25
+ * opening it mirrors the current center-crop.
26
+ */
27
+ export declare function centeredDisplayRegion(sourceWidth: number, sourceHeight: number): MediaDisplayRegion;
14
28
  /**
15
29
  * CSS styles to show a 4:3 source-pixel region scaled to fill a 4:3 frame.
16
30
  * Returns `null` when the region is invalid for the given source dimensions.
@@ -1 +1 @@
1
- {"version":3,"file":"mediaCrop.d.ts","sourceRoot":"","sources":["../../src/utils/mediaCrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,CAAC,EAAE,MAAM,CAAC;IACV,8CAA8C;IAC9C,CAAC,EAAE,MAAM,CAAC;IACV,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAgBD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,aAAa,GAAG,IAAI,CAqBtB"}
1
+ {"version":3,"file":"mediaCrop.d.ts","sourceRoot":"","sources":["../../src/utils/mediaCrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,2FAA2F;AAC3F,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,CAAC,EAAE,MAAM,CAAC;IACV,8CAA8C;IAC9C,CAAC,EAAE,MAAM,CAAC;IACV,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,kBAAkB,CAapB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,kBAAkB,CAWpB;AAgBD;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,aAAa,GAAG,IAAI,CAqBtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpawlabs/diy-guides-ui",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "React UI library for building open-source, iFixit-style step-by-step diy guides",
5
5
  "license": "MIT",
6
6
  "type": "module",