@drawnagency/primitives 0.1.83 → 0.1.84
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/document/assets/fonts/albra-grotesk-bold.woff +0 -0
- package/dist/document/assets/fonts/albra-grotesk-regular.woff +0 -0
- package/dist/document/assets/fonts/kapra-neue-expanded-medium.woff +0 -0
- package/dist/document/assets/fonts/kapra-neue-expanded-regular.woff +0 -0
- package/dist/document/index.js +6 -5
- package/package.json +1 -1
- package/src/document/assets/fonts/albra-grotesk-bold.woff +0 -0
- package/src/document/assets/fonts/albra-grotesk-regular.woff +0 -0
- package/src/document/assets/fonts/kapra-neue-expanded-medium.woff +0 -0
- package/src/document/assets/fonts/kapra-neue-expanded-regular.woff +0 -0
- package/src/document/components/DocViewer.tsx +13 -5
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/document/index.js
CHANGED
|
@@ -925,13 +925,14 @@ function DocCanvas({
|
|
|
925
925
|
const el = containerRef.current;
|
|
926
926
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
927
927
|
const observer = new ResizeObserver(() => {
|
|
928
|
-
const
|
|
929
|
-
|
|
928
|
+
const availW = el.clientWidth - 48;
|
|
929
|
+
const availH = el.clientHeight - 48;
|
|
930
|
+
setScale(Math.max(0.15, Math.min(availW / PAGE_W2, availH / PAGE_H2)));
|
|
930
931
|
});
|
|
931
932
|
observer.observe(el);
|
|
932
933
|
return () => observer.disconnect();
|
|
933
934
|
}, []);
|
|
934
|
-
const note = (text) => /* @__PURE__ */ jsx6("p", { className: "
|
|
935
|
+
const note = (text) => /* @__PURE__ */ jsx6("p", { className: "text-sm text-neutral-400", children: text });
|
|
935
936
|
let body;
|
|
936
937
|
if (active?.kind === "cover") {
|
|
937
938
|
body = noContent ? /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center gap-4", children: [
|
|
@@ -950,8 +951,8 @@ function DocCanvas({
|
|
|
950
951
|
{
|
|
951
952
|
ref: containerRef,
|
|
952
953
|
"data-testid": "doc-canvas",
|
|
953
|
-
className: "flex
|
|
954
|
-
children: body
|
|
954
|
+
className: "flex min-h-0 min-w-0 flex-1 overflow-auto bg-neutral-100 p-6",
|
|
955
|
+
children: /* @__PURE__ */ jsx6("div", { className: "m-auto", children: body })
|
|
955
956
|
}
|
|
956
957
|
);
|
|
957
958
|
}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -243,14 +243,19 @@ function DocCanvas({
|
|
|
243
243
|
const el = containerRef.current;
|
|
244
244
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
245
245
|
const observer = new ResizeObserver(() => {
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
// Fill the canvas: fit both dimensions (clientWidth/Height include the
|
|
247
|
+
// p-6 padding — subtract it) and take the limiting axis. The page keeps
|
|
248
|
+
// its true 1632×1056 layout and is transform-scaled, so what's shown is
|
|
249
|
+
// byte-identical to the print layout at any size.
|
|
250
|
+
const availW = el.clientWidth - 48;
|
|
251
|
+
const availH = el.clientHeight - 48;
|
|
252
|
+
setScale(Math.max(0.15, Math.min(availW / PAGE_W, availH / PAGE_H)));
|
|
248
253
|
});
|
|
249
254
|
observer.observe(el);
|
|
250
255
|
return () => observer.disconnect();
|
|
251
256
|
}, []);
|
|
252
257
|
|
|
253
|
-
const note = (text: string) => <p className="
|
|
258
|
+
const note = (text: string) => <p className="text-sm text-neutral-400">{text}</p>;
|
|
254
259
|
|
|
255
260
|
let body: ReactNode;
|
|
256
261
|
if (active?.kind === "cover") {
|
|
@@ -283,9 +288,12 @@ function DocCanvas({
|
|
|
283
288
|
<div
|
|
284
289
|
ref={containerRef}
|
|
285
290
|
data-testid="doc-canvas"
|
|
286
|
-
className="flex
|
|
291
|
+
className="flex min-h-0 min-w-0 flex-1 overflow-auto bg-neutral-100 p-6"
|
|
287
292
|
>
|
|
288
|
-
{
|
|
293
|
+
{/* m-auto instead of items/justify-center: centers both axes when the
|
|
294
|
+
page fits, but keeps the top/left edge reachable when it overflows
|
|
295
|
+
(flex centering clips overflow irretrievably; auto margins don't). */}
|
|
296
|
+
<div className="m-auto">{body}</div>
|
|
289
297
|
</div>
|
|
290
298
|
);
|
|
291
299
|
}
|