frame.image 1.6.2 → 1.6.4

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.
@@ -1,5 +1,6 @@
1
1
  export declare function Designer(props: {
2
2
  onClose: (rt1: string) => void;
3
3
  nrPoints?: number;
4
+ trademarkImageUrl?: string;
4
5
  }): import("react/jsx-runtime").JSX.Element;
5
6
  //# sourceMappingURL=Designer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Designer.d.ts","sourceRoot":"","sources":["../src/Designer.tsx"],"names":[],"mappings":"AAeA,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,2CA+QA"}
1
+ {"version":3,"file":"Designer.d.ts","sourceRoot":"","sources":["../src/Designer.tsx"],"names":[],"mappings":"AAeA,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,2CAgRA"}
package/dist/Designer.js CHANGED
@@ -146,7 +146,7 @@ export function Designer(props) {
146
146
  height: '100%',
147
147
  boxSizing: 'border-box',
148
148
  backgroundColor: 'rgb(173, 216, 230)', // lightblue in rgb
149
- }, children: _jsx(DrawCanvas, { machine: currentMachine, command: sendCommand, width: width, height: height, status: { status, setStatus }, show: show, axis: { axis, setAxis }, imageUrl: imageUrl, coords: { coords, setCoords }, trademarkCenter: { trademarkCenter, setTrademarkCenter }, imageCoords: { imageCoords, setImageCoords }, rotation: { rotationAngle, setRotationAngle }, scaledSL: scaledSL, scaledSH: scaledSH, catmullRomPoints: { catmullRomPoints, setCatmullRomPoints } }) }), _jsx(Box, { id: "id.box.ScaleForm", sx: {
149
+ }, children: _jsx(DrawCanvas, { machine: currentMachine, command: sendCommand, width: width, height: height, status: { status, setStatus }, show: show, axis: { axis, setAxis }, imageUrl: imageUrl, coords: { coords, setCoords }, trademarkCenter: { trademarkCenter, setTrademarkCenter }, imageCoords: { imageCoords, setImageCoords }, rotation: { rotationAngle, setRotationAngle }, scaledSL: scaledSL, scaledSH: scaledSH, catmullRomPoints: { catmullRomPoints, setCatmullRomPoints }, trademarkImageUrl: props.trademarkImageUrl }) }), _jsx(Box, { id: "id.box.ScaleForm", sx: {
150
150
  display: 'flex',
151
151
  flexDirection: 'column',
152
152
  flex: wCol3,
@@ -17,5 +17,6 @@ export declare function DrawCanvas(props: {
17
17
  scaledSL?: number;
18
18
  scaledSH?: number;
19
19
  zoomFactor?: number;
20
+ trademarkImageUrl?: string;
20
21
  }): JSX.Element;
21
22
  //# sourceMappingURL=DrawCanvas.d.ts.map
@@ -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,CAqsBd"}
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;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,GAAG,CAAC,OAAO,CAysBd"}
@@ -199,11 +199,16 @@ export function DrawCanvas(props) {
199
199
  const loadTrademarkImage = useCallback((onLoad) => {
200
200
  const newImg = new window.Image();
201
201
  newImg.onload = () => onLoad(newImg);
202
- // Use relative path that works both locally and when published
203
- const path = '../src/assets/rlogo.gif';
204
- newImg.src = new URL(path, import.meta.url).href;
205
- newImg.onerror = () => console.error(`Failed to load trademark image from ${path}`);
206
- }, []);
202
+ newImg.onerror = () => console.warn('Failed to load trademark image');
203
+ if (props.trademarkImageUrl) {
204
+ // Use the URL provided by the external program
205
+ newImg.src = props.trademarkImageUrl;
206
+ }
207
+ else {
208
+ // Fallback to default asset path for backward compatibility
209
+ newImg.src = new URL('../assets/rlogo.gif', import.meta.url).href;
210
+ }
211
+ }, [props.trademarkImageUrl]);
207
212
  // Split drawImageBackground into two functions: loadImage and drawImageBackground
208
213
  const loadImage = useCallback((src, onLoad) => {
209
214
  const newImg = new window.Image();
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import rlogo from './assets/rlogo.gif';
1
+ import rlogo from '../src/assets/rlogo.gif';
2
2
  export { DrawCanvas } from './DrawCanvas';
3
3
  export { ModalDesigner } from './ModalDesigner';
4
4
  export { Designer } from './Designer';
@@ -10,5 +10,6 @@ export { TCoordsHook, TStatusHook, TShowHook, TAxisHook, TMouseCoordsHook, TImag
10
10
  export { Polygon } from './Polygon';
11
11
  export { Point } from './Point';
12
12
  export { rlogo };
13
+ export declare function getTrademarkImageUrl(): string;
13
14
  export declare function loadTrademarkImage(): Promise<HTMLImageElement>;
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,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;AAChC,OAAO,EAAE,KAAK,EAAE,CAAC;AAGjB,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAO9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAE5C,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;AAChC,OAAO,EAAE,KAAK,EAAE,CAAC;AAGjB,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAGD,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAO9D"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import rlogo from './assets/rlogo.gif';
1
+ import rlogo from '../src/assets/rlogo.gif';
2
2
  export { DrawCanvas } from './DrawCanvas';
3
3
  export { ModalDesigner } from './ModalDesigner';
4
4
  export { Designer } from './Designer';
@@ -9,6 +9,10 @@ export { States } from './States';
9
9
  export { Polygon } from './Polygon';
10
10
  export { Point } from './Point';
11
11
  export { rlogo };
12
+ // Get the trademark image URL for external programs
13
+ export function getTrademarkImageUrl() {
14
+ return rlogo;
15
+ }
12
16
  // Utility function to load the Rodenstock trademark image
13
17
  export function loadTrademarkImage() {
14
18
  return new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frame.image",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
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",