@printwithsynergy/artwork-pdf-editor 0.1.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/README.md +117 -0
- package/dist/components/DielineLibraryModal.d.ts +9 -0
- package/dist/components/DielineLibraryModal.d.ts.map +1 -0
- package/dist/components/DielineLibraryModal.js +107 -0
- package/dist/components/DielineLibraryModal.js.map +1 -0
- package/dist/components/EditorApp.d.ts +37 -0
- package/dist/components/EditorApp.d.ts.map +1 -0
- package/dist/components/EditorApp.js +89 -0
- package/dist/components/EditorApp.js.map +1 -0
- package/dist/components/EditorCanvas.d.ts +41 -0
- package/dist/components/EditorCanvas.d.ts.map +1 -0
- package/dist/components/EditorCanvas.js +852 -0
- package/dist/components/EditorCanvas.js.map +1 -0
- package/dist/components/FileDropZone.d.ts +6 -0
- package/dist/components/FileDropZone.d.ts.map +1 -0
- package/dist/components/FileDropZone.js +48 -0
- package/dist/components/FileDropZone.js.map +1 -0
- package/dist/components/LayersPanel.d.ts +12 -0
- package/dist/components/LayersPanel.d.ts.map +1 -0
- package/dist/components/LayersPanel.js +101 -0
- package/dist/components/LayersPanel.js.map +1 -0
- package/dist/components/MobileToolDrawer.d.ts +45 -0
- package/dist/components/MobileToolDrawer.d.ts.map +1 -0
- package/dist/components/MobileToolDrawer.js +164 -0
- package/dist/components/MobileToolDrawer.js.map +1 -0
- package/dist/components/ModeToggle.d.ts +8 -0
- package/dist/components/ModeToggle.d.ts.map +1 -0
- package/dist/components/ModeToggle.js +27 -0
- package/dist/components/ModeToggle.js.map +1 -0
- package/dist/components/PreflightPanel.d.ts +9 -0
- package/dist/components/PreflightPanel.d.ts.map +1 -0
- package/dist/components/PreflightPanel.js +59 -0
- package/dist/components/PreflightPanel.js.map +1 -0
- package/dist/components/SeparationsPanel.d.ts +9 -0
- package/dist/components/SeparationsPanel.d.ts.map +1 -0
- package/dist/components/SeparationsPanel.js +147 -0
- package/dist/components/SeparationsPanel.js.map +1 -0
- package/dist/components/TopBar.d.ts +57 -0
- package/dist/components/TopBar.d.ts.map +1 -0
- package/dist/components/TopBar.js +70 -0
- package/dist/components/TopBar.js.map +1 -0
- package/dist/data/dielines.json +186 -0
- package/dist/hooks/useEditorMode.d.ts +15 -0
- package/dist/hooks/useEditorMode.d.ts.map +1 -0
- package/dist/hooks/useEditorMode.js +51 -0
- package/dist/hooks/useEditorMode.js.map +1 -0
- package/dist/hooks/useIsMobile.d.ts +19 -0
- package/dist/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/hooks/useIsMobile.js +34 -0
- package/dist/hooks/useIsMobile.js.map +1 -0
- package/dist/hooks/usePreflight.d.ts +23 -0
- package/dist/hooks/usePreflight.d.ts.map +1 -0
- package/dist/hooks/usePreflight.js +48 -0
- package/dist/hooks/usePreflight.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/bleed.d.ts +27 -0
- package/dist/lib/bleed.d.ts.map +1 -0
- package/dist/lib/bleed.js +60 -0
- package/dist/lib/bleed.js.map +1 -0
- package/dist/lib/dieline-template.d.ts +33 -0
- package/dist/lib/dieline-template.d.ts.map +1 -0
- package/dist/lib/dieline-template.js +43 -0
- package/dist/lib/dieline-template.js.map +1 -0
- package/dist/lib/editor-config.d.ts +69 -0
- package/dist/lib/editor-config.d.ts.map +1 -0
- package/dist/lib/editor-config.js +66 -0
- package/dist/lib/editor-config.js.map +1 -0
- package/dist/lib/preflight/checks.d.ts +8 -0
- package/dist/lib/preflight/checks.d.ts.map +1 -0
- package/dist/lib/preflight/checks.js +276 -0
- package/dist/lib/preflight/checks.js.map +1 -0
- package/dist/lib/preflight/index.d.ts +2 -0
- package/dist/lib/preflight/index.d.ts.map +1 -0
- package/dist/lib/preflight/index.js +3 -0
- package/dist/lib/preflight/index.js.map +1 -0
- package/dist/lib/preflight/types.d.ts +24 -0
- package/dist/lib/preflight/types.d.ts.map +1 -0
- package/dist/lib/preflight/types.js +80 -0
- package/dist/lib/preflight/types.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export function PreflightPanel({ report, onProceed, onSendToLint }) {
|
|
5
|
+
const blocking = report.issues.filter((i) => i.severity === "block");
|
|
6
|
+
const warnings = report.issues.filter((i) => i.severity === "warn");
|
|
7
|
+
return (_jsxs("div", { style: {
|
|
8
|
+
background: "#1a0f08",
|
|
9
|
+
border: "1px solid #3d1a00",
|
|
10
|
+
borderRadius: 8,
|
|
11
|
+
padding: "1.5rem",
|
|
12
|
+
maxWidth: 600,
|
|
13
|
+
width: "100%",
|
|
14
|
+
}, children: [_jsx("h2", { style: { margin: "0 0 1rem", fontSize: "1rem", color: "#e8a87c" }, children: "Preflight Check" }), blocking.length === 0 && warnings.length === 0 && (_jsx(StatusRow, { color: "#4caf50", icon: "\u2713", text: "No issues found \u2014 file is ready." })), blocking.length > 0 && (_jsxs("section", { style: { marginBottom: "1rem" }, children: [_jsx(SectionHeader, { color: "#f44336", label: `${blocking.length} blocking issue${blocking.length !== 1 ? "s" : ""}` }), blocking.map((i) => (_jsx(IssueRow, { issue: i }, `${i.checkName}-${i.message}`)))] })), warnings.length > 0 && (_jsxs("section", { style: { marginBottom: "1rem" }, children: [_jsx(SectionHeader, { color: "#ff9800", label: `${warnings.length} warning${warnings.length !== 1 ? "s" : ""}` }), warnings.map((i) => (_jsx(IssueRow, { issue: i }, `${i.checkName}-${i.message}`)))] })), report.skippedChecks.length > 0 && (_jsxs("p", { style: { fontSize: "0.75rem", color: "#666", margin: "0.5rem 0 1rem" }, children: [report.skippedChecks.length, " check", report.skippedChecks.length !== 1 ? "s" : "", " deferred to lint node: ", report.skippedChecks.join(", "), "."] })), _jsxs("div", { style: { display: "flex", gap: "0.75rem", marginTop: "1rem" }, children: [_jsx("button", { type: "button", onClick: onProceed, disabled: report.hasBlockingIssues, style: {
|
|
15
|
+
padding: "0.5rem 1.25rem",
|
|
16
|
+
background: report.hasBlockingIssues ? "#333" : "#fc5102",
|
|
17
|
+
color: report.hasBlockingIssues ? "#666" : "#fff",
|
|
18
|
+
border: "none",
|
|
19
|
+
borderRadius: 4,
|
|
20
|
+
cursor: report.hasBlockingIssues ? "not-allowed" : "pointer",
|
|
21
|
+
fontWeight: 600,
|
|
22
|
+
}, children: "Open in Editor" }), _jsx("button", { type: "button", onClick: onSendToLint, style: {
|
|
23
|
+
padding: "0.5rem 1.25rem",
|
|
24
|
+
background: "transparent",
|
|
25
|
+
color: "#e8a87c",
|
|
26
|
+
border: "1px solid #3d1a00",
|
|
27
|
+
borderRadius: 4,
|
|
28
|
+
cursor: "pointer",
|
|
29
|
+
}, children: "Send to Lint Node" })] })] }));
|
|
30
|
+
}
|
|
31
|
+
function SectionHeader({ color, label }) {
|
|
32
|
+
return (_jsx("h3", { style: {
|
|
33
|
+
fontSize: "0.8rem",
|
|
34
|
+
color,
|
|
35
|
+
margin: "0 0 0.5rem",
|
|
36
|
+
textTransform: "uppercase",
|
|
37
|
+
letterSpacing: "0.05em",
|
|
38
|
+
}, children: label }));
|
|
39
|
+
}
|
|
40
|
+
function IssueRow({ issue }) {
|
|
41
|
+
return (_jsxs("div", { style: {
|
|
42
|
+
padding: "0.5rem 0.75rem",
|
|
43
|
+
background: issue.severity === "block" ? "rgba(244,67,54,0.08)" : "rgba(255,152,0,0.08)",
|
|
44
|
+
borderLeft: `3px solid ${issue.severity === "block" ? "#f44336" : "#ff9800"}`,
|
|
45
|
+
borderRadius: "0 4px 4px 0",
|
|
46
|
+
marginBottom: "0.375rem",
|
|
47
|
+
fontSize: "0.82rem",
|
|
48
|
+
color: "#ccc",
|
|
49
|
+
}, children: [_jsxs("span", { style: {
|
|
50
|
+
fontFamily: "monospace",
|
|
51
|
+
fontSize: "0.7rem",
|
|
52
|
+
color: "#888",
|
|
53
|
+
marginRight: "0.5rem",
|
|
54
|
+
}, children: ["[", issue.checkName, "]"] }), issue.message, issue.page !== undefined && (_jsxs("span", { style: { marginLeft: "0.5rem", color: "#888", fontSize: "0.75rem" }, children: ["p.", issue.page] }))] }));
|
|
55
|
+
}
|
|
56
|
+
function StatusRow({ color, icon, text }) {
|
|
57
|
+
return (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", color, marginBottom: "1rem" }, children: [_jsx("span", { style: { fontSize: "1.2rem" }, children: icon }), _jsx("span", { children: text })] }));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=PreflightPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreflightPanel.js","sourceRoot":"","sources":["../../src/components/PreflightPanel.tsx"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,YAAY,CAAC;;AASb,MAAM,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAS;IACvE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;IAEpE,OAAO,CACL,eACE,KAAK,EAAE;YACL,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,mBAAmB;YAC3B,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,MAAM;SACd,aAED,aAAI,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,gCAAsB,EAE1F,QAAQ,CAAC,MAA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AClD,yBAAO,IAAI,GAAQ,IACf,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CanvasObj } from "./EditorCanvas";
|
|
2
|
+
type Props = {
|
|
3
|
+
objects: CanvasObj[];
|
|
4
|
+
hidden: Set<string>;
|
|
5
|
+
onToggle: (color: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function SeparationsPanel({ objects, hidden, onToggle }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=SeparationsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeparationsPanel.d.ts","sourceRoot":"","sources":["../../src/components/SeparationsPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAqGF,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAuGpE"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const PANEL = "#1a0f08";
|
|
5
|
+
const BORDER = "#3d1a00";
|
|
6
|
+
const MUTED = "#888";
|
|
7
|
+
function hexToRgb(hex) {
|
|
8
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex);
|
|
9
|
+
if (!m)
|
|
10
|
+
return null;
|
|
11
|
+
const n = Number.parseInt(m[1], 16);
|
|
12
|
+
return [(n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff];
|
|
13
|
+
}
|
|
14
|
+
function isCmykPrimary(hex) {
|
|
15
|
+
const rgb = hexToRgb(hex);
|
|
16
|
+
if (!rgb)
|
|
17
|
+
return null;
|
|
18
|
+
const [r, g, b] = rgb;
|
|
19
|
+
if (r < 16 && g < 16 && b < 16)
|
|
20
|
+
return "K";
|
|
21
|
+
if (r > 220 && g < 60 && b < 60)
|
|
22
|
+
return null; // pure red → treated as spot
|
|
23
|
+
if (r < 60 && g > 200 && b > 200)
|
|
24
|
+
return "C";
|
|
25
|
+
if (r > 200 && g < 60 && b > 200)
|
|
26
|
+
return "M";
|
|
27
|
+
if (r > 200 && g > 200 && b < 60)
|
|
28
|
+
return "Y";
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
function inkChannels(objects) {
|
|
32
|
+
const map = new Map();
|
|
33
|
+
const addColor = (raw) => {
|
|
34
|
+
if (!raw || raw === "transparent")
|
|
35
|
+
return;
|
|
36
|
+
const hex = raw.toLowerCase();
|
|
37
|
+
const cmyk = isCmykPrimary(hex);
|
|
38
|
+
if (cmyk) {
|
|
39
|
+
const swatchMap = {
|
|
40
|
+
C: "#00bcd4",
|
|
41
|
+
M: "#e91e63",
|
|
42
|
+
Y: "#ffeb3b",
|
|
43
|
+
K: "#222",
|
|
44
|
+
};
|
|
45
|
+
const labelMap = {
|
|
46
|
+
C: "Cyan",
|
|
47
|
+
M: "Magenta",
|
|
48
|
+
Y: "Yellow",
|
|
49
|
+
K: "Black",
|
|
50
|
+
};
|
|
51
|
+
const existing = map.get(cmyk);
|
|
52
|
+
if (existing) {
|
|
53
|
+
if (!existing.colors.includes(hex))
|
|
54
|
+
existing.colors.push(hex);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
map.set(cmyk, {
|
|
58
|
+
key: cmyk,
|
|
59
|
+
label: labelMap[cmyk] ?? cmyk,
|
|
60
|
+
swatch: swatchMap[cmyk] ?? "#000",
|
|
61
|
+
colors: [hex],
|
|
62
|
+
isSpot: false,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
// Spot ink — group by source hex
|
|
68
|
+
const existing = map.get(hex);
|
|
69
|
+
if (existing)
|
|
70
|
+
return;
|
|
71
|
+
map.set(hex, {
|
|
72
|
+
key: hex,
|
|
73
|
+
label: `Spot ${hex.toUpperCase()}`,
|
|
74
|
+
swatch: hex,
|
|
75
|
+
colors: [hex],
|
|
76
|
+
isSpot: true,
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
for (const o of objects) {
|
|
80
|
+
addColor(o.fill);
|
|
81
|
+
addColor(o.stroke);
|
|
82
|
+
}
|
|
83
|
+
// Deterministic ordering: CMYK first, then spots.
|
|
84
|
+
const order = { C: 0, M: 1, Y: 2, K: 3 };
|
|
85
|
+
return [...map.values()].sort((a, b) => {
|
|
86
|
+
const ai = order[a.key] ?? 100;
|
|
87
|
+
const bi = order[b.key] ?? 100;
|
|
88
|
+
if (ai !== bi)
|
|
89
|
+
return ai - bi;
|
|
90
|
+
return a.label.localeCompare(b.label);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export function SeparationsPanel({ objects, hidden, onToggle }) {
|
|
94
|
+
const channels = inkChannels(objects);
|
|
95
|
+
return (_jsxs("aside", { style: {
|
|
96
|
+
width: 220,
|
|
97
|
+
background: PANEL,
|
|
98
|
+
borderLeft: `1px solid ${BORDER}`,
|
|
99
|
+
display: "flex",
|
|
100
|
+
flexDirection: "column",
|
|
101
|
+
flexShrink: 0,
|
|
102
|
+
overflow: "hidden",
|
|
103
|
+
}, children: [_jsxs("header", { style: {
|
|
104
|
+
padding: "0.5rem 0.75rem",
|
|
105
|
+
borderBottom: `1px solid ${BORDER}`,
|
|
106
|
+
fontSize: "0.7rem",
|
|
107
|
+
letterSpacing: "0.08em",
|
|
108
|
+
textTransform: "uppercase",
|
|
109
|
+
color: MUTED,
|
|
110
|
+
fontWeight: 600,
|
|
111
|
+
}, children: ["Separations (", channels.length, ")"] }), _jsxs("div", { style: { flex: 1, overflowY: "auto" }, children: [channels.length === 0 && (_jsx("p", { style: { padding: "0.75rem", fontSize: "0.75rem", color: MUTED, margin: 0 }, children: "No ink coverage yet. Set a fill or stroke to populate channels." })), channels.map((ch) => {
|
|
112
|
+
const allHidden = ch.colors.every((c) => hidden.has(c));
|
|
113
|
+
return (_jsxs("label", { style: {
|
|
114
|
+
display: "flex",
|
|
115
|
+
alignItems: "center",
|
|
116
|
+
gap: "0.55rem",
|
|
117
|
+
padding: "0.45rem 0.75rem",
|
|
118
|
+
borderBottom: `1px solid #120a04`,
|
|
119
|
+
cursor: "pointer",
|
|
120
|
+
fontSize: "0.78rem",
|
|
121
|
+
color: allHidden ? MUTED : "#ddd",
|
|
122
|
+
}, children: [_jsx("input", { type: "checkbox", checked: !allHidden, onChange: () => {
|
|
123
|
+
for (const c of ch.colors)
|
|
124
|
+
onToggle(c);
|
|
125
|
+
}, style: { accentColor: "#fc5102" } }), _jsx("span", { "aria-hidden": true, style: {
|
|
126
|
+
display: "inline-block",
|
|
127
|
+
width: 14,
|
|
128
|
+
height: 14,
|
|
129
|
+
borderRadius: 3,
|
|
130
|
+
background: ch.swatch,
|
|
131
|
+
border: ch.swatch === "#222" ? "1px solid #555" : "none",
|
|
132
|
+
} }), _jsx("span", { style: { flex: 1 }, children: ch.label }), ch.isSpot && (_jsx("span", { style: {
|
|
133
|
+
fontSize: "0.6rem",
|
|
134
|
+
color: MUTED,
|
|
135
|
+
textTransform: "uppercase",
|
|
136
|
+
letterSpacing: "0.08em",
|
|
137
|
+
}, children: "Spot" }))] }, ch.key));
|
|
138
|
+
})] }), _jsx("p", { style: {
|
|
139
|
+
padding: "0.6rem 0.75rem",
|
|
140
|
+
margin: 0,
|
|
141
|
+
fontSize: "0.65rem",
|
|
142
|
+
color: MUTED,
|
|
143
|
+
borderTop: `1px solid ${BORDER}`,
|
|
144
|
+
lineHeight: 1.4,
|
|
145
|
+
}, children: "Preview only. Final separations are produced by the render service (pdf-writer + Ghostscript ICC)." })] }));
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=SeparationsPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SeparationsPanel.js","sourceRoot":"","sources":["../../src/components/SeparationsPanel.tsx"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,YAAY,CAAC;;AASb,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC;AAiBrB,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC;IAC9C,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;IACtB,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,GAAG,CAAC;IAC3C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,IAAI,CAAC,CAAC,6BAA6B;IAC3E,IAAI,CAAC,GAAG,EAAE,IAAI,CA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AChC,UAAU,EAAE,GAAG;iBAChB,mHAIC,IACE,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One CTA the host can attach to the right-hand side of the {@link TopBar}.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type TopBarButton = {
|
|
8
|
+
label: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
target?: "_blank" | "_self";
|
|
12
|
+
primary?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Customization surface for the editor's top bar. The hamburger trigger
|
|
16
|
+
* is always rendered at the same position (mobile only) so muscle
|
|
17
|
+
* memory is preserved across hosts; everything else is host-supplied.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export type TopBarProps = {
|
|
22
|
+
/**
|
|
23
|
+
* The logo node. Pass any ReactNode (img, svg, span). Pass `null`
|
|
24
|
+
* to hide. Leaving undefined uses the bundled {@link ArtworkPdfLogo}.
|
|
25
|
+
*/
|
|
26
|
+
logo?: React.ReactNode;
|
|
27
|
+
/** Wordmark text shown next to the logo. `null` hides; defaults to "artworkPDF". */
|
|
28
|
+
brandText?: string | null;
|
|
29
|
+
/** Demo badge — shows next to the brand text when truthy. */
|
|
30
|
+
showDemoBadge?: boolean;
|
|
31
|
+
/** Host-supplied CTAs (e.g. "← Back to artworkpdf.com"). */
|
|
32
|
+
extraButtons?: TopBarButton[];
|
|
33
|
+
/** Arbitrary right-aligned slot (e.g. host's custom toggle). */
|
|
34
|
+
rightSlot?: React.ReactNode;
|
|
35
|
+
/** Click handler for the hamburger button. Wired by `EditorApp`. */
|
|
36
|
+
onMenuToggle?: () => void;
|
|
37
|
+
/** Whether to show the hamburger (mobile only — desktop hides it). */
|
|
38
|
+
showMenuButton?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Bundled default logo. Inline SVG so the package has no external
|
|
42
|
+
* asset paths leaking into consumers.
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
export declare function ArtworkPdfLogo({ size }: {
|
|
47
|
+
size?: number;
|
|
48
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* Slim top bar rendered at the top of the editor. Carries only brand
|
|
51
|
+
* + hamburger + host-supplied CTAs — the tool/mode/export controls
|
|
52
|
+
* live in the toolbar (desktop) or the slide-in drawer (mobile).
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export declare function TopBar({ logo, brandText, showDemoBadge, extraButtons, rightSlot, onMenuToggle, showMenuButton, }: TopBarProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
//# sourceMappingURL=TopBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../../src/components/TopBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,gEAAgE;IAChE,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,sEAAsE;IACtE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAOF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,2CAsB9D;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,SAAwB,EACxB,aAAqB,EACrB,YAAiB,EACjB,SAAS,EACT,YAAY,EACZ,cAAsB,GACvB,EAAE,WAAW,2CA4Fb"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
const BAR_BG = "#1a0f08";
|
|
5
|
+
const BAR_BORDER = "#3d1a00";
|
|
6
|
+
const BRAND = "#fc5102";
|
|
7
|
+
const MUTED = "#888";
|
|
8
|
+
/**
|
|
9
|
+
* Bundled default logo. Inline SVG so the package has no external
|
|
10
|
+
* asset paths leaking into consumers.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export function ArtworkPdfLogo({ size = 22 }) {
|
|
15
|
+
// Square mark — orange rounded rect with white "A" wordmark.
|
|
16
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: size, height: size, "aria-label": "artworkPDF", role: "img", children: [_jsx("rect", { x: 2, y: 2, width: 60, height: 60, rx: 12, fill: BRAND }), _jsx("path", { d: "M22 46 L32 18 L42 46 M26 38 L38 38", stroke: "#fff", strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" })] }));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Slim top bar rendered at the top of the editor. Carries only brand
|
|
20
|
+
* + hamburger + host-supplied CTAs — the tool/mode/export controls
|
|
21
|
+
* live in the toolbar (desktop) or the slide-in drawer (mobile).
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export function TopBar({ logo, brandText = "artworkPDF", showDemoBadge = false, extraButtons = [], rightSlot, onMenuToggle, showMenuButton = false, }) {
|
|
26
|
+
const resolvedLogo = logo === undefined ? _jsx(ArtworkPdfLogo, {}) : logo;
|
|
27
|
+
return (_jsxs("header", { style: {
|
|
28
|
+
display: "flex",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
gap: "0.6rem",
|
|
31
|
+
padding: "0.4rem 0.75rem",
|
|
32
|
+
background: BAR_BG,
|
|
33
|
+
borderBottom: `1px solid ${BAR_BORDER}`,
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
}, children: [showMenuButton && (_jsx("button", { type: "button", "aria-label": "Open menu", onClick: onMenuToggle, style: {
|
|
36
|
+
background: "transparent",
|
|
37
|
+
border: `1px solid ${BAR_BORDER}`,
|
|
38
|
+
color: "#ddd",
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
padding: "0.2rem 0.45rem",
|
|
41
|
+
borderRadius: 4,
|
|
42
|
+
fontSize: "1rem",
|
|
43
|
+
lineHeight: 1,
|
|
44
|
+
}, children: "\u2630" })), resolvedLogo !== null && (_jsx("span", { style: { display: "inline-flex", alignItems: "center" }, children: resolvedLogo })), brandText !== null && (_jsxs("span", { style: { fontWeight: 600, color: BRAND, fontSize: "0.9rem" }, children: [brandText, showDemoBadge && (_jsx("span", { style: {
|
|
45
|
+
marginLeft: "0.45rem",
|
|
46
|
+
fontSize: "0.6rem",
|
|
47
|
+
background: "#2a1200",
|
|
48
|
+
border: `1px solid ${BRAND}`,
|
|
49
|
+
color: BRAND,
|
|
50
|
+
padding: "0.1rem 0.35rem",
|
|
51
|
+
borderRadius: 3,
|
|
52
|
+
verticalAlign: "middle",
|
|
53
|
+
letterSpacing: "0.08em",
|
|
54
|
+
}, children: "DEMO" }))] })), _jsx("div", { style: { flex: 1 } }), extraButtons.map((b) => {
|
|
55
|
+
const style = {
|
|
56
|
+
fontSize: "0.8rem",
|
|
57
|
+
color: b.primary ? "#fff" : MUTED,
|
|
58
|
+
background: b.primary ? BRAND : "transparent",
|
|
59
|
+
border: b.primary ? `1px solid ${BRAND}` : "none",
|
|
60
|
+
borderRadius: 4,
|
|
61
|
+
padding: b.primary ? "0.25rem 0.6rem" : "0.25rem 0.4rem",
|
|
62
|
+
cursor: "pointer",
|
|
63
|
+
fontFamily: "inherit",
|
|
64
|
+
textDecoration: "none",
|
|
65
|
+
fontWeight: b.primary ? 600 : 400,
|
|
66
|
+
};
|
|
67
|
+
return b.href ? (_jsx("a", { href: b.href, target: b.target ?? "_self", rel: b.target === "_blank" ? "noopener noreferrer" : undefined, onClick: b.onClick, style: style, children: b.label }, `${b.label}-${b.href}`)) : (_jsx("button", { type: "button", onClick: b.onClick, style: style, children: b.label }, b.label));
|
|
68
|
+
}), rightSlot] }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=TopBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TopBar.js","sourceRoot":"","sources":["../../src/components/TopBar.tsx"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,YAAY,CAAC;;AA2Cb,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC;AAErB;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,GAAG,EAAE,EAAqB;IAC7D,6DAA6D;IAC7D,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,IAAI,EACX,MAAM,EAA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U,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;iBAClC,CAAC;gBACF,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACd,YAEE,IAAI,EAAE,CAAC,CAAC,IAAI,EACZ,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,OAAO,EAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAC9D,OAAO,EAAE,CAAC,CAAC,OAAO,EAClB,KAAK,EAAE,KAAK,YAEX,CAAC,CAAC,KAAK,IAPH,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,EAAE,CAQzB,CACL,CAAC,CAAC,CAAC,CACF,iBAAsB,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,YACjE,CAAC,CAAC,KAAK,IADG,CAAC,CAAC,KAAK,CAEX,CACV,CAAC;YACJ,CAAC,CAAC,EACD,SAAS,IACH,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"templates": [
|
|
4
|
+
{
|
|
5
|
+
"id": "standup-pouch-4x6",
|
|
6
|
+
"name": "Stand-Up Pouch 4×6",
|
|
7
|
+
"description": "Standard stand-up pouch for snacks, coffee, supplements. Popular for single-serve packaging.",
|
|
8
|
+
"category": "pouch",
|
|
9
|
+
"dimensions": {
|
|
10
|
+
"widthMm": 101.6,
|
|
11
|
+
"heightMm": 152.4,
|
|
12
|
+
"depthMm": 25
|
|
13
|
+
},
|
|
14
|
+
"bleedMm": 3,
|
|
15
|
+
"trimBox": {
|
|
16
|
+
"x": 3,
|
|
17
|
+
"y": 3,
|
|
18
|
+
"width": 101.6,
|
|
19
|
+
"height": 152.4
|
|
20
|
+
},
|
|
21
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 107.6 158.4'><rect x='3' y='3' width='101.6' height='152.4' fill='none' stroke='#333' stroke-width='0.5'/><line x1='3' y1='28.4' x2='104.6' y2='28.4' stroke='#666' stroke-width='0.3' stroke-dasharray='2,1'/><text x='53.8' y='18' text-anchor='middle' font-size='8' fill='#666'>Stand-Up Pouch</text><text x='53.8' y='85' text-anchor='middle' font-size='6' fill='#999'>4×6″ (101.6×152.4mm)</text></svg>",
|
|
22
|
+
"tags": ["pouch", "stand-up", "flexible", "food", "coffee", "snacks"],
|
|
23
|
+
"isDefault": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "standup-pouch-5x8",
|
|
27
|
+
"name": "Stand-Up Pouch 5×8",
|
|
28
|
+
"description": "Larger stand-up pouch for family-size snacks, pet food, bulk supplements.",
|
|
29
|
+
"category": "pouch",
|
|
30
|
+
"dimensions": {
|
|
31
|
+
"widthMm": 127,
|
|
32
|
+
"heightMm": 203.2,
|
|
33
|
+
"depthMm": 35
|
|
34
|
+
},
|
|
35
|
+
"bleedMm": 3,
|
|
36
|
+
"trimBox": {
|
|
37
|
+
"x": 3,
|
|
38
|
+
"y": 3,
|
|
39
|
+
"width": 127,
|
|
40
|
+
"height": 203.2
|
|
41
|
+
},
|
|
42
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 133 209.2'><rect x='3' y='3' width='127' height='203.2' fill='none' stroke='#333' stroke-width='0.5'/><line x1='3' y1='38.2' x2='130' y2='38.2' stroke='#666' stroke-width='0.3' stroke-dasharray='2,1'/><text x='66.5' y='22' text-anchor='middle' font-size='8' fill='#666'>Stand-Up Pouch</text><text x='66.5' y='108' text-anchor='middle' font-size='6' fill='#999'>5×8″ (127×203.2mm)</text></svg>",
|
|
43
|
+
"tags": ["pouch", "stand-up", "flexible", "family-size", "bulk"]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "flat-pouch-3x5",
|
|
47
|
+
"name": "Flat Pouch 3×5",
|
|
48
|
+
"description": "Slim flat pouch for samples, condiments, travel-size products. Heat-sealed three sides.",
|
|
49
|
+
"category": "pouch",
|
|
50
|
+
"dimensions": {
|
|
51
|
+
"widthMm": 76.2,
|
|
52
|
+
"heightMm": 127,
|
|
53
|
+
"depthMm": 0
|
|
54
|
+
},
|
|
55
|
+
"bleedMm": 3,
|
|
56
|
+
"trimBox": {
|
|
57
|
+
"x": 3,
|
|
58
|
+
"y": 3,
|
|
59
|
+
"width": 76.2,
|
|
60
|
+
"height": 127
|
|
61
|
+
},
|
|
62
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 82.2 133'><rect x='3' y='3' width='76.2' height='127' fill='none' stroke='#333' stroke-width='0.5'/><line x1='3' y1='8' x2='79.2' y2='8' stroke='#666' stroke-width='0.3'/><text x='41.1' y='72' text-anchor='middle' font-size='7' fill='#666'>Flat Pouch</text><text x='41.1' y='82' text-anchor='middle' font-size='5' fill='#999'>3×5″</text></svg>",
|
|
63
|
+
"tags": ["pouch", "flat", "three-side-seal", "sample", "travel"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "flat-pouch-4x7",
|
|
67
|
+
"name": "Flat Pouch 4×7",
|
|
68
|
+
"description": "Medium flat pouch for protein powder packets, medical devices, hardware kits.",
|
|
69
|
+
"category": "pouch",
|
|
70
|
+
"dimensions": {
|
|
71
|
+
"widthMm": 101.6,
|
|
72
|
+
"heightMm": 177.8,
|
|
73
|
+
"depthMm": 0
|
|
74
|
+
},
|
|
75
|
+
"bleedMm": 3,
|
|
76
|
+
"trimBox": {
|
|
77
|
+
"x": 3,
|
|
78
|
+
"y": 3,
|
|
79
|
+
"width": 101.6,
|
|
80
|
+
"height": 177.8
|
|
81
|
+
},
|
|
82
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 107.6 183.8'><rect x='3' y='3' width='101.6' height='177.8' fill='none' stroke='#333' stroke-width='0.5'/><line x1='3' y1='8' x2='104.6' y2='8' stroke='#666' stroke-width='0.3'/><text x='53.8' y='97' text-anchor='middle' font-size='7' fill='#666'>Flat Pouch</text><text x='53.8' y='107' text-anchor='middle' font-size='5' fill='#999'>4×7″</text></svg>",
|
|
83
|
+
"tags": ["pouch", "flat", "three-side-seal", "medical", "hardware"]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "bottle-label-2in",
|
|
87
|
+
"name": "Bottle Label 2\" Diameter",
|
|
88
|
+
"description": "Round label for standard beverage bottles, jars, cosmetics containers.",
|
|
89
|
+
"category": "label",
|
|
90
|
+
"dimensions": {
|
|
91
|
+
"widthMm": 50.8,
|
|
92
|
+
"heightMm": 50.8,
|
|
93
|
+
"depthMm": 0
|
|
94
|
+
},
|
|
95
|
+
"bleedMm": 1.5,
|
|
96
|
+
"trimBox": {
|
|
97
|
+
"x": 1.5,
|
|
98
|
+
"y": 1.5,
|
|
99
|
+
"width": 50.8,
|
|
100
|
+
"height": 50.8
|
|
101
|
+
},
|
|
102
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 53.8 53.8'><circle cx='26.9' cy='26.9' r='25.4' fill='none' stroke='#333' stroke-width='0.5'/><circle cx='26.9' cy='26.9' r='1.5' fill='#666'/><text x='26.9' y='25' text-anchor='middle' font-size='5' fill='#666'>2\" Circle</text></svg>",
|
|
103
|
+
"tags": ["label", "circle", "bottle", "jar", "cosmetics"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "bottle-label-3in",
|
|
107
|
+
"name": "Bottle Label 3\" Diameter",
|
|
108
|
+
"description": "Large round label for wine bottles, premium products, gift packaging.",
|
|
109
|
+
"category": "label",
|
|
110
|
+
"dimensions": {
|
|
111
|
+
"widthMm": 76.2,
|
|
112
|
+
"heightMm": 76.2,
|
|
113
|
+
"depthMm": 0
|
|
114
|
+
},
|
|
115
|
+
"bleedMm": 1.5,
|
|
116
|
+
"trimBox": {
|
|
117
|
+
"x": 1.5,
|
|
118
|
+
"y": 1.5,
|
|
119
|
+
"width": 76.2,
|
|
120
|
+
"height": 76.2
|
|
121
|
+
},
|
|
122
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 79.2 79.2'><circle cx='39.6' cy='39.6' r='38.1' fill='none' stroke='#333' stroke-width='0.5'/><circle cx='39.6' cy='39.6' r='1.5' fill='#666'/><text x='39.6' y='37' text-anchor='middle' font-size='6' fill='#666'>3\" Circle</text></svg>",
|
|
123
|
+
"tags": ["label", "circle", "wine", "premium", "gift"]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "carton-6x4x2",
|
|
127
|
+
"name": "Carton Box 6×4×2",
|
|
128
|
+
"description": "Straight-tuck carton for retail packaging. Common for cosmetics, electronics accessories.",
|
|
129
|
+
"category": "carton",
|
|
130
|
+
"dimensions": {
|
|
131
|
+
"widthMm": 152.4,
|
|
132
|
+
"heightMm": 101.6,
|
|
133
|
+
"depthMm": 50.8
|
|
134
|
+
},
|
|
135
|
+
"bleedMm": 3,
|
|
136
|
+
"trimBox": {
|
|
137
|
+
"x": 3,
|
|
138
|
+
"y": 3,
|
|
139
|
+
"width": 152.4,
|
|
140
|
+
"height": 101.6
|
|
141
|
+
},
|
|
142
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 158.4 107.6'><rect x='3' y='3' width='152.4' height='101.6' fill='none' stroke='#333' stroke-width='0.5'/><line x1='53.8' y1='3' x2='53.8' y2='104.6' stroke='#666' stroke-width='0.3' stroke-dasharray='2,1'/><line x1='104.6' y1='3' x2='104.6' y2='104.6' stroke='#666' stroke-width='0.3' stroke-dasharray='2,1'/><text x='79.2' y='58' text-anchor='middle' font-size='7' fill='#666'>Carton</text><text x='79.2' y='68' text-anchor='middle' font-size='5' fill='#999'>6×4×2″</text></svg>",
|
|
143
|
+
"tags": ["carton", "box", "straight-tuck", "retail", "electronics"]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "carton-8x6x3",
|
|
147
|
+
"name": "Carton Box 8×6×3",
|
|
148
|
+
"description": "Larger straight-tuck carton for premium products, gift sets, collectibles.",
|
|
149
|
+
"category": "carton",
|
|
150
|
+
"dimensions": {
|
|
151
|
+
"widthMm": 203.2,
|
|
152
|
+
"heightMm": 152.4,
|
|
153
|
+
"depthMm": 76.2
|
|
154
|
+
},
|
|
155
|
+
"bleedMm": 3,
|
|
156
|
+
"trimBox": {
|
|
157
|
+
"x": 3,
|
|
158
|
+
"y": 3,
|
|
159
|
+
"width": 203.2,
|
|
160
|
+
"height": 152.4
|
|
161
|
+
},
|
|
162
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 209.2 158.4'><rect x='3' y='3' width='203.2' height='152.4' fill='none' stroke='#333' stroke-width='0.5'/><line x1='71.7' y1='3' x2='71.7' y2='155.4' stroke='#666' stroke-width='0.3' stroke-dasharray='2,1'/><line x1='137.7' y1='3' x2='137.7' y2='155.4' stroke='#666' stroke-width='0.3' stroke-dasharray='2,1'/><text x='104.6' y='83' text-anchor='middle' font-size='8' fill='#666'>Carton</text><text x='104.6' y='95' text-anchor='middle' font-size='6' fill='#999'>8×6×3″</text></svg>",
|
|
163
|
+
"tags": ["carton", "box", "straight-tuck", "premium", "gift"]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "sachet-2x3",
|
|
167
|
+
"name": "Sachet 2×3",
|
|
168
|
+
"description": "Single-serve sachet for condiments, sauces, hotel amenities, samples.",
|
|
169
|
+
"category": "sachet",
|
|
170
|
+
"dimensions": {
|
|
171
|
+
"widthMm": 50.8,
|
|
172
|
+
"heightMm": 76.2,
|
|
173
|
+
"depthMm": 0
|
|
174
|
+
},
|
|
175
|
+
"bleedMm": 2,
|
|
176
|
+
"trimBox": {
|
|
177
|
+
"x": 2,
|
|
178
|
+
"y": 2,
|
|
179
|
+
"width": 50.8,
|
|
180
|
+
"height": 76.2
|
|
181
|
+
},
|
|
182
|
+
"previewSvg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54.8 80.2'><rect x='2' y='2' width='50.8' height='76.2' fill='none' stroke='#333' stroke-width='0.5' rx='3'/><line x1='2' y1='12' x2='52.8' y2='12' stroke='#666' stroke-width='0.3'/><text x='27.4' y='47' text-anchor='middle' font-size='6' fill='#666'>Sachet</text><text x='27.4' y='56' text-anchor='middle' font-size='4' fill='#999'>2×3″</text></svg>",
|
|
183
|
+
"tags": ["sachet", "single-serve", "condiment", "sample", "hotel"]
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type EditorMode = "basic" | "pro";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the editor mode with this precedence:
|
|
4
|
+
* 1. Explicit user choice persisted in localStorage
|
|
5
|
+
* 2. `prefer` prop (set by the page — e.g. demo passes "auto")
|
|
6
|
+
* 3. Viewport heuristic: pro on >= 900 CSS px, basic otherwise
|
|
7
|
+
*
|
|
8
|
+
* `setMode(null)` clears the saved preference and returns to auto.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useEditorMode(prefer?: EditorMode | "auto"): {
|
|
11
|
+
mode: EditorMode;
|
|
12
|
+
setMode: (next: EditorMode | null) => void;
|
|
13
|
+
isAuto: boolean;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useEditorMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEditorMode.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorMode.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;AAIzC;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,UAAU,GAAG,MAAe,GAAG;IACnE,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB,CAqCA"}
|