frame.image 1.6.0 → 1.6.1

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/assets/logo.js CHANGED
@@ -2,4 +2,26 @@
2
2
  export default './R-Logo-schwarzaufweissq.gif';
3
3
 
4
4
  // Named export for convenience
5
- export const rodenstockLogoPath = './R-Logo-schwarzaufweissq.gif';
5
+ export const rodenstockLogoPath = './R-Logo-schwarzaufweissq.gif';
6
+
7
+ // Get the full URL for the logo
8
+ export function getRodenstockLogoUrl() {
9
+ return new URL('./R-Logo-schwarzaufweissq.gif', import.meta.url).href;
10
+ }
11
+
12
+ // Load the logo image asynchronously
13
+ export function loadRodenstockLogo() {
14
+ return new Promise((resolve, reject) => {
15
+ const img = new Image();
16
+ img.onload = () => resolve(img);
17
+ img.onerror = reject;
18
+ img.src = getRodenstockLogoUrl();
19
+ });
20
+ }
21
+
22
+ // Preload the logo (useful for performance)
23
+ export function preloadRodenstockLogo() {
24
+ const img = new Image();
25
+ img.src = getRodenstockLogoUrl();
26
+ return img;
27
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"DrawCanvas.d.ts","sourceRoot":"","sources":["../src/DrawCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqD,MAAM,OAAO,CAAC;AAG/E,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAisBd"}
1
+ {"version":3,"file":"DrawCanvas.d.ts","sourceRoot":"","sources":["../src/DrawCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqD,MAAM,OAAO,CAAC;AAG/E,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAqsBd"}
@@ -199,7 +199,8 @@ export function DrawCanvas(props) {
199
199
  const loadTrademarkImage = useCallback((onLoad) => {
200
200
  const newImg = new window.Image();
201
201
  newImg.onload = () => onLoad(newImg);
202
- newImg.src = '/public/R-Logo-schwarzaufweissq.gif';
202
+ // Use relative path that works both locally and when published
203
+ newImg.src = new URL('../assets/R-Logo-schwarzaufweissq.gif', import.meta.url).href;
203
204
  }, []);
204
205
  // Split drawImageBackground into two functions: loadImage and drawImageBackground
205
206
  const loadImage = useCallback((src, onLoad) => {
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export { States } from './States';
8
8
  export { TCoordsHook, TStatusHook, TShowHook, TAxisHook, TMouseCoordsHook, TImageHook, TRotationHook, TCatmullRomPointsHook, } from './types';
9
9
  export { Polygon } from './Polygon';
10
10
  export { Point } from './Point';
11
+ export declare function loadTrademarkImage(): Promise<HTMLImageElement>;
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAU9D"}
package/dist/index.js CHANGED
@@ -7,3 +7,12 @@ export { ShowOptions } from './ShowOptions';
7
7
  export { States } from './States';
8
8
  export { Polygon } from './Polygon';
9
9
  export { Point } from './Point';
10
+ // Utility function to load the Rodenstock trademark image
11
+ export function loadTrademarkImage() {
12
+ return new Promise((resolve, reject) => {
13
+ const img = new Image();
14
+ img.onload = () => resolve(img);
15
+ img.onerror = reject;
16
+ img.src = new URL('../assets/R-Logo-schwarzaufweissq.gif', import.meta.url).href;
17
+ });
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frame.image",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A React component for drawing a frame on a canvas element.",
5
5
  "license": "MIT",
6
6
  "author": "Christian.Todd@rodenstock.com",