nucleus-core-ts 0.10.254 → 0.10.255

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/.build-ok CHANGED
@@ -1 +1 @@
1
- 0.10.254
1
+ 0.10.255
@@ -1,3 +1,3 @@
1
1
  import type { ReplayCaptionProps } from './types';
2
- /** The current step's caption, its chapter and its position; the player's live region, so a screen reader hears each step. */
3
- export declare function ReplayCaption({ text, stepId, chapterTitle, position }: ReplayCaptionProps): import("react/jsx-runtime").JSX.Element;
2
+ /** The current step's caption and its position; the player's live region, so a screen reader hears each step. */
3
+ export declare function ReplayCaption({ text, stepId, position }: ReplayCaptionProps): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { useEffectEvent, useRef } from 'react';
6
6
  import { useReducedMotion } from '../../../DemoFilm/_hooks/useReducedMotion';
7
7
  import { REPLAY_COPY } from '../../_utils/copy';
8
8
  gsap.registerPlugin(useGSAP);
9
- /** The current step's caption, its chapter and its position; the player's live region, so a screen reader hears each step. */ export function ReplayCaption({ text, stepId, chapterTitle, position }) {
9
+ /** The current step's caption and its position; the player's live region, so a screen reader hears each step. */ export function ReplayCaption({ text, stepId, position }) {
10
10
  const reduced = useReducedMotion();
11
11
  const body = useRef(null);
12
12
  const enter = useEffectEvent(()=>{
@@ -43,10 +43,6 @@ gsap.registerPlugin(useGSAP);
43
43
  ref: body,
44
44
  className: "nc-replay__text",
45
45
  children: text || REPLAY_COPY.idle
46
- }),
47
- /*#__PURE__*/ _jsx("p", {
48
- className: "nc-replay__chapter-name",
49
- children: chapterTitle
50
46
  })
51
47
  ]
52
48
  });
@@ -3,7 +3,6 @@ export interface ReplayCaptionProps {
3
3
  text: string;
4
4
  /** Identifies the step so the caption animates when it changes. */
5
5
  stepId: string | null;
6
- chapterTitle: string;
7
6
  /** 1-based position among the recording's steps; null before the first step. */
8
7
  position: {
9
8
  index: number;
@@ -73,7 +73,6 @@ import { ReplayStage } from '../ReplayStage';
73
73
  /*#__PURE__*/ _jsx(ReplayCaption, {
74
74
  text: pickLocalized(state.caption, locale),
75
75
  stepId: state.stepId,
76
- chapterTitle: chapter ? pickLocalized(chapter.title, locale) : '',
77
76
  position: stepPosition(manifest, state.stepId)
78
77
  }),
79
78
  /*#__PURE__*/ _jsx(ReplayControls, {
@@ -1,7 +1,9 @@
1
1
  import type { ReplayStageProps } from './types';
2
2
  /**
3
3
  * The product in a same-origin iframe laid out at a virtual desktop viewport (see stageViewport) and scaled uniformly to
4
- * the width of the box it sits in, so it always keeps its desktop layout. The
5
- * frame takes no pointer events: the visitor watches, the cursor and highlight layers above it show what happens.
4
+ * fit the slot it sits in: by width everywhere, and from 1024 px up by height too, so the whole frame is on screen with
5
+ * the caption and the controls. The view is letterboxed (centred) in the slot. The frame takes no pointer events: the
6
+ * visitor watches, the cursor and highlight layers above it show what happens. The cursor layer shares the view's box
7
+ * and the frame's scale, so a point of the frame lands on the same spot of the layer.
6
8
  */
7
9
  export declare function ReplayStage(props: ReplayStageProps): import("react/jsx-runtime").JSX.Element;
@@ -8,13 +8,16 @@ import { ReplayCursorLayer } from '../ReplayCursor';
8
8
  import { ReplayVeil } from './ReplayVeil';
9
9
  /**
10
10
  * The product in a same-origin iframe laid out at a virtual desktop viewport (see stageViewport) and scaled uniformly to
11
- * the width of the box it sits in, so it always keeps its desktop layout. The
12
- * frame takes no pointer events: the visitor watches, the cursor and highlight layers above it show what happens.
11
+ * fit the slot it sits in: by width everywhere, and from 1024 px up by height too, so the whole frame is on screen with
12
+ * the caption and the controls. The view is letterboxed (centred) in the slot. The frame takes no pointer events: the
13
+ * visitor watches, the cursor and highlight layers above it show what happens. The cursor layer shares the view's box
14
+ * and the frame's scale, so a point of the frame lands on the same spot of the layer.
13
15
  */ export function ReplayStage(props) {
14
16
  const { manifest, locale, frameSrc, frameRef, cursor, rate, onArrive, loading, children } = props;
15
- const { width, height } = stageViewport(manifest.viewport);
16
- const { boxRef, scale } = useStageScale(width);
17
+ const frame = stageViewport(manifest.viewport);
18
+ const { boxRef, scale, width: shownWidth, height: shownHeight } = useStageScale(frame);
17
19
  const title = pickLocalized(manifest.title, locale);
20
+ const measured = shownWidth > 0;
18
21
  return /*#__PURE__*/ _jsxs("div", {
19
22
  className: "nc-replay__stage",
20
23
  "data-replay-stage": true,
@@ -41,37 +44,42 @@ import { ReplayVeil } from './ReplayVeil';
41
44
  })
42
45
  ]
43
46
  }),
44
- /*#__PURE__*/ _jsxs("div", {
47
+ /*#__PURE__*/ _jsx("div", {
45
48
  ref: boxRef,
46
- className: "nc-replay__view",
47
- style: {
48
- aspectRatio: `${width} / ${height}`
49
- },
50
- children: [
51
- frameSrc !== null && /*#__PURE__*/ _jsx("iframe", {
52
- ref: frameRef,
53
- className: "nc-replay__frame",
54
- src: frameSrc,
55
- title: title,
56
- tabIndex: -1,
57
- style: {
58
- width,
59
- height,
60
- transform: `scale(${scale})`
61
- }
62
- }),
63
- /*#__PURE__*/ _jsx(ReplayCursorLayer, {
64
- cursor: cursor,
65
- scale: scale,
66
- rate: rate,
67
- onArrive: onArrive
68
- }),
69
- loading && /*#__PURE__*/ _jsx(ReplayVeil, {}),
70
- children && /*#__PURE__*/ _jsx("div", {
71
- className: "nc-replay__overlay",
72
- children: children
73
- })
74
- ]
49
+ className: "nc-replay__slot",
50
+ children: /*#__PURE__*/ _jsxs("div", {
51
+ className: "nc-replay__view",
52
+ style: {
53
+ aspectRatio: `${frame.width} / ${frame.height}`,
54
+ width: measured ? shownWidth : '100%',
55
+ height: measured ? shownHeight : undefined
56
+ },
57
+ children: [
58
+ frameSrc !== null && /*#__PURE__*/ _jsx("iframe", {
59
+ ref: frameRef,
60
+ className: "nc-replay__frame",
61
+ src: frameSrc,
62
+ title: title,
63
+ tabIndex: -1,
64
+ style: {
65
+ width: frame.width,
66
+ height: frame.height,
67
+ transform: `scale(${scale})`
68
+ }
69
+ }),
70
+ /*#__PURE__*/ _jsx(ReplayCursorLayer, {
71
+ cursor: cursor,
72
+ scale: scale,
73
+ rate: rate,
74
+ onArrive: onArrive
75
+ }),
76
+ loading && /*#__PURE__*/ _jsx(ReplayVeil, {}),
77
+ children && /*#__PURE__*/ _jsx("div", {
78
+ className: "nc-replay__overlay",
79
+ children: children
80
+ })
81
+ ]
82
+ })
75
83
  })
76
84
  ]
77
85
  });
@@ -1,5 +1,11 @@
1
- /** The scale that fits a stage of `viewportWidth` px into the width of the element the returned ref points at. */
2
- export declare function useStageScale(viewportWidth: number): {
3
- boxRef: import("react").RefObject<HTMLDivElement | null>;
1
+ import { type StageViewport } from '../_utils/stageViewport';
2
+ /**
3
+ * The scale that fits `frame` into the element the returned ref points at: by width everywhere, and from 1024 px up
4
+ * also by height, so the frame, the caption and the controls are on screen together.
5
+ */
6
+ export declare function useStageScale(frame: StageViewport): {
4
7
  scale: number;
8
+ width: number;
9
+ height: number;
10
+ boxRef: import("react").RefObject<HTMLDivElement | null>;
5
11
  };
@@ -1,25 +1,49 @@
1
1
  'use client';
2
2
  import { useEffect, useEffectEvent, useRef, useState } from 'react';
3
- import { fitScale } from '../_utils/stageViewport';
4
- /** The scale that fits a stage of `viewportWidth` px into the width of the element the returned ref points at. */ export function useStageScale(viewportWidth) {
3
+ import { fitFrame } from '../_utils/stageViewport';
4
+ const FIT_HEIGHT_QUERY = '(min-width:1024px)';
5
+ const FIT_GAP = 4;
6
+ /** The height left for the frame: the window minus everything else of the player, minus the host's own offset. */ function roomHeight(box) {
7
+ if (typeof window === 'undefined' || !window.matchMedia(FIT_HEIGHT_QUERY).matches) return 0;
8
+ const root = box.closest('.nc-replay');
9
+ const view = box.firstElementChild;
10
+ if (!root || !(view instanceof HTMLElement)) return 0;
11
+ const offset = Number.parseFloat(getComputedStyle(root).getPropertyValue('--replay-fit-offset')) || 0;
12
+ return Math.max(0, window.innerHeight - (root.offsetHeight - view.offsetHeight) - offset - FIT_GAP);
13
+ }
14
+ /**
15
+ * The scale that fits `frame` into the element the returned ref points at: by width everywhere, and from 1024 px up
16
+ * also by height, so the frame, the caption and the controls are on screen together.
17
+ */ export function useStageScale(frame) {
5
18
  const boxRef = useRef(null);
6
- const [width, setWidth] = useState(0);
19
+ const [room, setRoom] = useState({
20
+ width: 0,
21
+ height: 0
22
+ });
7
23
  const measure = useEffectEvent(()=>{
8
24
  const box = boxRef.current;
9
- if (box) setWidth(box.clientWidth);
25
+ if (box) setRoom({
26
+ width: box.clientWidth,
27
+ height: roomHeight(box)
28
+ });
10
29
  });
11
30
  useEffect(()=>{
12
31
  const box = boxRef.current;
13
32
  if (!box) return;
14
33
  measure();
15
- if (typeof ResizeObserver === 'undefined') return;
34
+ window.addEventListener('resize', measure);
35
+ if (typeof ResizeObserver === 'undefined') return ()=>window.removeEventListener('resize', measure);
16
36
  const observer = new ResizeObserver(()=>measure());
17
37
  observer.observe(box);
18
- return ()=>observer.disconnect();
38
+ const root = box.closest('.nc-replay');
39
+ if (root) observer.observe(root);
40
+ return ()=>{
41
+ observer.disconnect();
42
+ window.removeEventListener('resize', measure);
43
+ };
19
44
  }, []);
20
- const scale = fitScale(width, viewportWidth);
21
45
  return {
22
46
  boxRef,
23
- scale
47
+ ...fitFrame(room.width, room.height, frame)
24
48
  };
25
49
  }
@@ -1,5 +1,5 @@
1
1
  import gsap from 'gsap';
2
- const RING_GROW = 6;
2
+ const RING_GROW = 3;
3
3
  const GLIDE_MIN = 0.35;
4
4
  const GLIDE_MAX = 1.1;
5
5
  const REST = 0.18;
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * Mobile-first layout: base is a small phone; each breakpoint (480, 640, 768, 1024, 1280) only overrides upward.
3
3
  * The stage always takes the full width of the player; the caption, the controls and the chapter list sit below it.
4
+ * From 1024 px up the player is compact so stage, caption, controls and chapters fit one screen (the stage scales by
5
+ * height too, see useStageScale): the caption and controls share one row and the chapters are one scrolling row.
6
+ * A host that has a header above the player sets `--replay-fit-offset` (px) so the stage leaves room for it.
4
7
  */
5
- export declare const REPLAY_LAYOUT_CSS = "\n.nc-replay{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:12px;box-sizing:border-box;width:100%;max-width:100%;\n background:var(--rp-bg);color:var(--rp-ink);font-family:var(--rp-sans);\n grid-template-areas:\"stage\" \"caption\" \"controls\" \"chapters\"}\n.nc-replay *,.nc-replay *::before,.nc-replay *::after{box-sizing:border-box}\n.nc-replay__stage{grid-area:stage}\n.nc-replay__caption{grid-area:caption}\n.nc-replay__controls{grid-area:controls}\n.nc-replay__chapters{grid-area:chapters}\n.nc-replay__chapter-list{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0;padding:0;list-style:none}\n@media (min-width:480px){.nc-replay{gap:14px;padding:16px}}\n@media (min-width:640px){.nc-replay__chapter-list{grid-template-columns:repeat(2,minmax(0,1fr))}}\n@media (min-width:768px){.nc-replay{gap:16px;padding:20px;grid-template-columns:minmax(0,1fr) auto;\n grid-template-areas:\"stage stage\" \"caption controls\" \"chapters chapters\"}\n .nc-replay__chapter-list{grid-template-columns:repeat(3,minmax(0,1fr))}}\n@media (min-width:1024px){.nc-replay__chapter-list{grid-template-columns:repeat(4,minmax(0,1fr))}}\n@media (min-width:1280px){.nc-replay{gap:20px;padding:28px}\n .nc-replay__chapter-list{grid-template-columns:repeat(5,minmax(0,1fr))}}\n";
8
+ export declare const REPLAY_LAYOUT_CSS = "\n.nc-replay{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:12px;box-sizing:border-box;width:100%;max-width:100%;\n background:var(--rp-bg);color:var(--rp-ink);font-family:var(--rp-sans);\n grid-template-areas:\"stage\" \"caption\" \"controls\" \"chapters\"}\n.nc-replay *,.nc-replay *::before,.nc-replay *::after{box-sizing:border-box}\n.nc-replay__stage{grid-area:stage}\n.nc-replay__caption{grid-area:caption}\n.nc-replay__controls{grid-area:controls}\n.nc-replay__chapters{grid-area:chapters;min-width:0}\n.nc-replay__chapter-list{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0;padding:0;list-style:none}\n@media (min-width:480px){.nc-replay{gap:14px;padding:16px}}\n@media (min-width:640px){.nc-replay__chapter-list{grid-template-columns:repeat(2,minmax(0,1fr))}}\n@media (min-width:768px){.nc-replay{gap:16px;padding:20px;grid-template-columns:minmax(0,1fr) auto;\n grid-template-areas:\"stage stage\" \"caption controls\" \"chapters chapters\"}\n .nc-replay__chapter-list{grid-template-columns:repeat(3,minmax(0,1fr))}}\n@media (min-width:1024px){.nc-replay{gap:10px;padding:12px 16px}\n .nc-replay__h{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}\n .nc-replay__caption{display:flex;align-items:baseline;gap:12px;padding:8px 14px}\n .nc-replay__caption .nc-replay__eyebrow{margin:0;flex:none}\n .nc-replay__caption .nc-replay__text{font-size:16px}\n .nc-replay__controls{align-self:center}\n .nc-replay__chapter-list{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);\n overflow-x:auto;scroll-snap-type:x proximity;gap:8px;padding-bottom:2px}\n .nc-replay__chapter{scroll-snap-align:start}\n .nc-replay__chapter button{gap:6px;padding:8px 10px;min-height:44px}}\n@media (min-width:1280px){.nc-replay{gap:12px;padding:12px 20px}}\n";
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * Mobile-first layout: base is a small phone; each breakpoint (480, 640, 768, 1024, 1280) only overrides upward.
3
3
  * The stage always takes the full width of the player; the caption, the controls and the chapter list sit below it.
4
+ * From 1024 px up the player is compact so stage, caption, controls and chapters fit one screen (the stage scales by
5
+ * height too, see useStageScale): the caption and controls share one row and the chapters are one scrolling row.
6
+ * A host that has a header above the player sets `--replay-fit-offset` (px) so the stage leaves room for it.
4
7
  */ export const REPLAY_LAYOUT_CSS = `
5
8
  .nc-replay{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:12px;box-sizing:border-box;width:100%;max-width:100%;
6
9
  background:var(--rp-bg);color:var(--rp-ink);font-family:var(--rp-sans);
@@ -9,14 +12,22 @@
9
12
  .nc-replay__stage{grid-area:stage}
10
13
  .nc-replay__caption{grid-area:caption}
11
14
  .nc-replay__controls{grid-area:controls}
12
- .nc-replay__chapters{grid-area:chapters}
15
+ .nc-replay__chapters{grid-area:chapters;min-width:0}
13
16
  .nc-replay__chapter-list{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0;padding:0;list-style:none}
14
17
  @media (min-width:480px){.nc-replay{gap:14px;padding:16px}}
15
18
  @media (min-width:640px){.nc-replay__chapter-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
16
19
  @media (min-width:768px){.nc-replay{gap:16px;padding:20px;grid-template-columns:minmax(0,1fr) auto;
17
20
  grid-template-areas:"stage stage" "caption controls" "chapters chapters"}
18
21
  .nc-replay__chapter-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
19
- @media (min-width:1024px){.nc-replay__chapter-list{grid-template-columns:repeat(4,minmax(0,1fr))}}
20
- @media (min-width:1280px){.nc-replay{gap:20px;padding:28px}
21
- .nc-replay__chapter-list{grid-template-columns:repeat(5,minmax(0,1fr))}}
22
+ @media (min-width:1024px){.nc-replay{gap:10px;padding:12px 16px}
23
+ .nc-replay__h{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
24
+ .nc-replay__caption{display:flex;align-items:baseline;gap:12px;padding:8px 14px}
25
+ .nc-replay__caption .nc-replay__eyebrow{margin:0;flex:none}
26
+ .nc-replay__caption .nc-replay__text{font-size:16px}
27
+ .nc-replay__controls{align-self:center}
28
+ .nc-replay__chapter-list{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);
29
+ overflow-x:auto;scroll-snap-type:x proximity;gap:8px;padding-bottom:2px}
30
+ .nc-replay__chapter{scroll-snap-align:start}
31
+ .nc-replay__chapter button{gap:6px;padding:8px 10px;min-height:44px}}
32
+ @media (min-width:1280px){.nc-replay{gap:12px;padding:12px 20px}}
22
33
  `;
@@ -6,11 +6,12 @@ const STAGE = `
6
6
  .nc-replay__dots i{width:8px;height:8px;border-radius:50%;background:#efe9dc;opacity:.28}
7
7
  .nc-replay__title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.8}
8
8
  .nc-replay__pill{flex:none;border:1px solid rgb(239 233 220 / .35);border-radius:999px;padding:4px 8px;font-size:10px;letter-spacing:.08em;text-transform:uppercase}
9
- .nc-replay__view{position:relative;width:100%;overflow:hidden;background:var(--rp-surface)}
9
+ .nc-replay__slot{display:flex;justify-content:center;min-width:0;width:100%;background:var(--rp-bezel)}
10
+ .nc-replay__view{position:relative;flex:none;max-width:100%;overflow:hidden;background:var(--rp-surface)}
10
11
  .nc-replay__frame{position:absolute;left:0;top:0;border:0;transform-origin:0 0;pointer-events:none;background:#fff}
11
12
  .nc-replay__layer{position:absolute;inset:0;overflow:hidden;pointer-events:none}
12
13
  .nc-replay__ring{position:absolute;left:0;top:0;opacity:0;border:2px solid var(--rp-accent);border-radius:8px;
13
- background:color-mix(in srgb,var(--rp-accent) 12%,transparent);box-shadow:0 0 0 4px color-mix(in srgb,var(--rp-accent) 22%,transparent)}
14
+ background:color-mix(in srgb,var(--rp-accent) 12%,transparent)}
14
15
  .nc-replay__ripple{position:absolute;left:0;top:0;width:56px;height:56px;margin:-28px 0 0 -28px;opacity:0;border-radius:50%;
15
16
  border:2px solid var(--rp-accent);background:color-mix(in srgb,var(--rp-accent) 30%,transparent)}
16
17
  .nc-replay__cursor{position:absolute;left:0;top:0;width:24px;height:24px;opacity:0;filter:drop-shadow(0 2px 3px rgb(0 0 0 / .35))}
@@ -22,7 +23,6 @@ const TEXT = `
22
23
  .nc-replay__panel{min-width:0;border:1px solid var(--rp-line);border-radius:14px;background:var(--rp-surface);padding:14px;box-shadow:var(--rp-shadow)}
23
24
  .nc-replay__eyebrow{margin:0 0 6px;color:var(--rp-accent-ink);font:600 11px/1.2 var(--rp-mono);letter-spacing:.08em;text-transform:uppercase}
24
25
  .nc-replay__text{margin:0;font:500 17px/1.3 var(--rp-display);letter-spacing:-.01em;overflow-wrap:anywhere}
25
- .nc-replay__chapter-name{margin:8px 0 0;color:var(--rp-faint);font:500 13px/1.3 var(--rp-sans)}
26
26
  .nc-replay__h{margin:0 0 8px;color:var(--rp-faint);font:600 11px/1.2 var(--rp-mono);letter-spacing:.08em;text-transform:uppercase}
27
27
  .nc-replay__card{max-width:420px;display:grid;gap:10px;border:1px solid var(--rp-line);border-radius:14px;background:var(--rp-surface);
28
28
  padding:18px;color:var(--rp-ink);box-shadow:var(--rp-shadow)}
@@ -15,3 +15,16 @@ export interface StageViewport {
15
15
  export declare function stageViewport(recorded: StageViewport): StageViewport;
16
16
  /** The uniform scale that fits a frame of `frameWidth` px into a box `boxWidth` px wide; 1 until the box is measured. */
17
17
  export declare function fitScale(boxWidth: number, frameWidth: number): number;
18
+ export interface FrameFit {
19
+ /** Uniform scale of the frame. */
20
+ scale: number;
21
+ /** The scaled frame's size in drawn pixels. */
22
+ width: number;
23
+ height: number;
24
+ }
25
+ /**
26
+ * The scale that keeps the whole frame visible: the smaller of the width fit and the height fit. `availableHeight` is
27
+ * the height left for the frame (0 or less means the height is not limited, e.g. a phone, where the page scrolls).
28
+ * The result is letterboxed by the caller: it is never wider than the box and never taller than the room.
29
+ */
30
+ export declare function fitFrame(boxWidth: number, availableHeight: number, frame: StageViewport): FrameFit;
@@ -15,3 +15,17 @@
15
15
  /** The uniform scale that fits a frame of `frameWidth` px into a box `boxWidth` px wide; 1 until the box is measured. */ export function fitScale(boxWidth, frameWidth) {
16
16
  return boxWidth > 0 && frameWidth > 0 ? boxWidth / frameWidth : 1;
17
17
  }
18
+ /**
19
+ * The scale that keeps the whole frame visible: the smaller of the width fit and the height fit. `availableHeight` is
20
+ * the height left for the frame (0 or less means the height is not limited, e.g. a phone, where the page scrolls).
21
+ * The result is letterboxed by the caller: it is never wider than the box and never taller than the room.
22
+ */ export function fitFrame(boxWidth, availableHeight, frame) {
23
+ const byWidth = fitScale(boxWidth, frame.width);
24
+ const byHeight = availableHeight > 0 && frame.height > 0 ? availableHeight / frame.height : Number.POSITIVE_INFINITY;
25
+ const scale = Math.min(byWidth, byHeight);
26
+ return {
27
+ scale,
28
+ width: frame.width * scale,
29
+ height: frame.height * scale
30
+ };
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleus-core-ts",
3
- "version": "0.10.254",
3
+ "version": "0.10.255",
4
4
  "description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
5
5
  "author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",