botc-character-sheet 0.8.1 → 0.9.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 CHANGED
@@ -35,7 +35,7 @@ function App() {
35
35
  showSwirls={true}
36
36
  solidTitle={false}
37
37
  iconScale={1.6}
38
- compactAppearance={false}
38
+ appearance="normal"
39
39
  />
40
40
  <SheetBack
41
41
  title="My Custom Script"
@@ -62,7 +62,7 @@ Main character sheet component with parchment background and styled sections.
62
62
  - `showSwirls` (boolean): Show decorative swirls (default: true)
63
63
  - `solidTitle` (boolean): Use solid title background (default: false)
64
64
  - `iconScale` (number): Scale character icons (default: 1.6)
65
- - `compactAppearance` (boolean): Use compact layout (default: false)
65
+ - `appearance` ("normal" | "compact" | "super-compact"): Layout density (default: "normal")
66
66
  - `includeMargins` (boolean): Add margins for printing (default: false)
67
67
 
68
68
  ### SheetBack
@@ -1,4 +1,3 @@
1
- import "./CharacterSheet.css";
2
1
  import { GroupedCharacters, Jinx } from "./types";
3
2
  interface CharacterSheetProps {
4
3
  title: string;
@@ -10,8 +9,8 @@ interface CharacterSheetProps {
10
9
  includeMargins?: boolean;
11
10
  solidTitle?: boolean;
12
11
  iconScale?: number;
13
- compactAppearance?: boolean;
12
+ appearance?: "normal" | "compact" | "super-compact";
14
13
  }
15
- export declare function CharacterSheet({ title, author, characters, color, jinxes, showSwirls, includeMargins, solidTitle, iconScale, compactAppearance, }: CharacterSheetProps): import("preact").JSX.Element;
14
+ export declare function CharacterSheet({ title, author, characters, color, jinxes, showSwirls, includeMargins, solidTitle, iconScale, appearance, }: CharacterSheetProps): import("preact").JSX.Element;
16
15
  export {};
17
16
  //# sourceMappingURL=CharacterSheet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CharacterSheet.d.ts","sourceRoot":"","sources":["../src/CharacterSheet.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAqB,MAAM,SAAS,CAAC;AAErE,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAiB,EACjB,MAAW,EACX,UAAiB,EACjB,cAAsB,EACtB,UAAkB,EAClB,SAAe,EACf,iBAAyB,GAC1B,EAAE,mBAAmB,gCAkGrB"}
1
+ {"version":3,"file":"CharacterSheet.d.ts","sourceRoot":"","sources":["../src/CharacterSheet.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAqB,MAAM,SAAS,CAAC;AAErE,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAC;CACrD;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAiB,EACjB,MAAW,EACX,UAAiB,EACjB,cAAsB,EACtB,UAAkB,EAClB,SAAe,EACf,UAAqB,GACtB,EAAE,mBAAmB,gCAkGrB"}
@@ -1,4 +1,3 @@
1
- import "./SheetBack.css";
2
1
  import { NightOrderEntry } from "./types";
3
2
  type SheetBackProps = {
4
3
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SheetBack.d.ts","sourceRoot":"","sources":["../src/SheetBack.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,0GAQvB,cAAc,iCAsDhB,CAAC"}
1
+ {"version":3,"file":"SheetBack.d.ts","sourceRoot":"","sources":["../src/SheetBack.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,0GAQvB,cAAc,iCAyDhB,CAAC"}
package/dist/index.js CHANGED
@@ -1,77 +1,77 @@
1
- import { options as p, Fragment as u } from "preact";
2
- var y = 0;
3
- function e(i, n, r, s, t, o) {
4
- n || (n = {});
5
- var l, d, c = n;
6
- if ("ref" in c) for (d in c = {}, n) d == "ref" ? l = n[d] : c[d] = n[d];
7
- var a = { type: i, props: c, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --y, __i: -1, __u: 0, __source: t, __self: o };
8
- if (typeof i == "function" && (l = i.defaultProps)) for (d in l) c[d] === void 0 && (c[d] = l[d]);
9
- return p.vnode && p.vnode(a), a;
1
+ import { options as v, Fragment as u } from "preact";
2
+ var w = 0;
3
+ function e(i, s, a, n, t, l) {
4
+ s || (s = {});
5
+ var c, m, o = s;
6
+ if ("ref" in o) for (m in o = {}, s) m == "ref" ? c = s[m] : o[m] = s[m];
7
+ var r = { type: i, props: o, key: a, ref: c, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --w, __i: -1, __u: 0, __source: t, __self: l };
8
+ if (typeof i == "function" && (c = i.defaultProps)) for (m in c) o[m] === void 0 && (o[m] = c[m]);
9
+ return v.vnode && v.vnode(r), r;
10
10
  }
11
- function _(i) {
11
+ function C(i) {
12
12
  if (i.startsWith("#") && (i = i.slice(1)), i.length === 3 && (i = i.split("").map((t) => t + t).join("")), i.length !== 6)
13
13
  throw new Error("Invalid HEX color.");
14
- const n = parseInt(i.slice(0, 2), 16), r = parseInt(i.slice(2, 4), 16), s = parseInt(i.slice(4, 6), 16);
15
- return [n, r, s];
14
+ const s = parseInt(i.slice(0, 2), 16), a = parseInt(i.slice(2, 4), 16), n = parseInt(i.slice(4, 6), 16);
15
+ return [s, a, n];
16
16
  }
17
- function w(i, n, r) {
18
- const s = (t) => {
19
- const o = t.toString(16);
20
- return o.length === 1 ? "0" + o : o;
17
+ function M(i, s, a) {
18
+ const n = (t) => {
19
+ const l = t.toString(16);
20
+ return l.length === 1 ? "0" + l : l;
21
21
  };
22
- return `#${s(i)}${s(n)}${s(r)}`;
22
+ return `#${n(i)}${n(s)}${n(a)}`;
23
23
  }
24
- function C(i, n) {
25
- const [r, s, t] = _(i), o = Math.round(r * n), l = Math.round(s * n), d = Math.round(t * n);
26
- return w(o, l, d);
24
+ function S(i, s) {
25
+ const [a, n, t] = C(i), l = Math.round(a * s), c = Math.round(n * s), m = Math.round(t * s);
26
+ return M(l, c, m);
27
27
  }
28
- function B({
28
+ function H({
29
29
  title: i,
30
- author: n,
31
- characters: r,
32
- color: s = "#4a5568",
30
+ author: s,
31
+ characters: a,
32
+ color: n = "#4a5568",
33
33
  jinxes: t = [],
34
- showSwirls: o = !0,
35
- includeMargins: l = !1,
36
- solidTitle: d = !1,
37
- iconScale: c = 1.6,
38
- compactAppearance: a = !1
34
+ showSwirls: l = !0,
35
+ includeMargins: c = !1,
36
+ solidTitle: m = !1,
37
+ iconScale: o = 1.6,
38
+ appearance: r = "normal"
39
39
  }) {
40
- const m = [
40
+ const d = [
41
41
  {
42
42
  key: "townsfolk",
43
43
  title: "Townsfolk",
44
- chars: r.townsfolk,
44
+ chars: a.townsfolk,
45
45
  color: "#00469e"
46
46
  },
47
47
  {
48
48
  key: "outsider",
49
49
  title: "Outsiders",
50
- chars: r.outsider,
50
+ chars: a.outsider,
51
51
  color: "#00469e"
52
52
  },
53
53
  {
54
54
  key: "minion",
55
55
  title: "Minions",
56
- chars: r.minion,
56
+ chars: a.minion,
57
57
  color: "#580709"
58
58
  },
59
59
  {
60
60
  key: "demon",
61
61
  title: "Demons",
62
- chars: r.demon,
62
+ chars: a.demon,
63
63
  color: "#580709"
64
64
  }
65
- ].filter((h) => h.chars.length > 0), g = C(s, 0.4);
65
+ ].filter((h) => h.chars.length > 0), g = S(n, 0.4);
66
66
  return /* @__PURE__ */ e(
67
67
  "div",
68
68
  {
69
69
  className: "character-sheet",
70
70
  id: "character-sheet",
71
71
  style: {
72
- "--header-color-light": s,
72
+ "--header-color-light": n,
73
73
  "--header-color-dark": g,
74
- transform: l ? "scale(0.952)" : void 0
74
+ transform: c ? "scale(0.952)" : void 0
75
75
  },
76
76
  children: [
77
77
  /* @__PURE__ */ e(
@@ -81,44 +81,44 @@ function B({
81
81
  src: "/images/parchment_texture_a4_lightened.jpg"
82
82
  }
83
83
  ),
84
- /* @__PURE__ */ e(S, { color: s }),
84
+ /* @__PURE__ */ e(A, { color: n }),
85
85
  /* @__PURE__ */ e("div", { className: "sheet-content", children: [
86
86
  /* @__PURE__ */ e(
87
- M,
87
+ j,
88
88
  {
89
- showSwirls: o,
89
+ showSwirls: l,
90
90
  title: i,
91
- author: n,
92
- solidHeader: d
91
+ author: s,
92
+ solidHeader: m
93
93
  }
94
94
  ),
95
95
  /* @__PURE__ */ e("div", { className: "characters-grid", children: [
96
- m.map((h, b) => /* @__PURE__ */ e(u, { children: [
96
+ d.map((h, p) => /* @__PURE__ */ e(u, { children: [
97
97
  /* @__PURE__ */ e(
98
- j,
98
+ D,
99
99
  {
100
100
  title: h.title.toUpperCase(),
101
101
  characters: h.chars,
102
- sidebarColor: s,
102
+ sidebarColor: n,
103
103
  charNameColor: h.color,
104
- iconScale: c,
105
- compactAppearance: a
104
+ iconScale: o,
105
+ appearance: r
106
106
  },
107
107
  h.key
108
108
  ),
109
- b < m.length - 1 && /* @__PURE__ */ e("img", { src: "/images/divider.png", className: "section-divider" })
109
+ p < d.length - 1 && /* @__PURE__ */ e("img", { src: "/images/divider.png", className: "section-divider" })
110
110
  ] })),
111
111
  t.length > 0 && /* @__PURE__ */ e(u, { children: [
112
112
  /* @__PURE__ */ e("img", { src: "/images/divider.png", className: "section-divider" }),
113
113
  /* @__PURE__ */ e(
114
- D,
114
+ W,
115
115
  {
116
116
  jinxes: t,
117
117
  allCharacters: [
118
- ...r.townsfolk,
119
- ...r.outsider,
120
- ...r.minion,
121
- ...r.demon
118
+ ...a.townsfolk,
119
+ ...a.outsider,
120
+ ...a.minion,
121
+ ...a.demon
122
122
  ]
123
123
  }
124
124
  )
@@ -137,13 +137,13 @@ function B({
137
137
  }
138
138
  );
139
139
  }
140
- function M({
140
+ function j({
141
141
  showSwirls: i,
142
- title: n,
143
- author: r,
144
- solidHeader: s = !1
142
+ title: s,
143
+ author: a,
144
+ solidHeader: n = !1
145
145
  }) {
146
- return console.log("title:", n), /* @__PURE__ */ e(u, { children: [
146
+ return console.log("title:", s), /* @__PURE__ */ e(u, { children: [
147
147
  /* @__PURE__ */ e("h1", { className: "sheet-header", children: [
148
148
  i && /* @__PURE__ */ e(
149
149
  "img",
@@ -156,9 +156,9 @@ function M({
156
156
  "span",
157
157
  {
158
158
  style: {
159
- mixBlendMode: s ? "normal" : "multiply"
159
+ mixBlendMode: n ? "normal" : "multiply"
160
160
  },
161
- children: n
161
+ children: s
162
162
  }
163
163
  ),
164
164
  i && /* @__PURE__ */ e(
@@ -169,136 +169,129 @@ function M({
169
169
  }
170
170
  )
171
171
  ] }),
172
- r && /* @__PURE__ */ e("h2", { className: "sheet-author", children: [
172
+ a && /* @__PURE__ */ e("h2", { className: "sheet-author", children: [
173
173
  "by ",
174
- r
174
+ a
175
175
  ] })
176
176
  ] });
177
177
  }
178
- function S({ color: i }) {
178
+ function A({ color: i }) {
179
179
  return /* @__PURE__ */ e("div", { className: "sidebar-container", children: [
180
180
  /* @__PURE__ */ e("div", { className: "sidebar-background" }),
181
181
  /* @__PURE__ */ e("div", { className: "sidebar-overlay", style: { backgroundColor: i } })
182
182
  ] });
183
183
  }
184
- function j({
184
+ function D({
185
185
  title: i,
186
- characters: n,
187
- charNameColor: r,
188
- iconScale: s,
189
- compactAppearance: t = !1
186
+ characters: s,
187
+ charNameColor: a,
188
+ iconScale: n,
189
+ appearance: t = "normal"
190
190
  }) {
191
- const o = n.length > 8 ? "space-between" : "flex-start";
191
+ const l = s.length > 8 ? "space-between" : "flex-start";
192
192
  return /* @__PURE__ */ e("div", { className: "character-section", children: [
193
193
  /* @__PURE__ */ e("h2", { className: "section-title", children: i }),
194
194
  /* @__PURE__ */ e("div", { className: "character-list", children: [
195
- /* @__PURE__ */ e("div", { className: "character-column", children: n.slice(0, Math.ceil(n.length / 2)).map((l) => /* @__PURE__ */ e(
196
- v,
195
+ /* @__PURE__ */ e("div", { className: "character-column", children: s.slice(0, Math.ceil(s.length / 2)).map((c) => /* @__PURE__ */ e(
196
+ N,
197
197
  {
198
- character: l,
199
- color: r,
200
- iconScale: s,
201
- compactAppearance: t
198
+ character: c,
199
+ color: a,
200
+ iconScale: n,
201
+ appearance: t
202
202
  },
203
- l.id
203
+ c.id
204
204
  )) }),
205
- /* @__PURE__ */ e("div", { className: "character-column", style: { justifyContent: o }, children: n.slice(Math.ceil(n.length / 2), n.length).map((l) => /* @__PURE__ */ e(
206
- v,
205
+ /* @__PURE__ */ e("div", { className: "character-column", style: { justifyContent: l }, children: s.slice(Math.ceil(s.length / 2), s.length).map((c) => /* @__PURE__ */ e(
206
+ N,
207
207
  {
208
- character: l,
209
- color: r,
210
- iconScale: s,
211
- compactAppearance: t
208
+ character: c,
209
+ color: a,
210
+ iconScale: n,
211
+ appearance: t
212
212
  },
213
- l.id
213
+ c.id
214
214
  )) })
215
215
  ] })
216
216
  ] });
217
217
  }
218
- function v({
218
+ function N({
219
219
  character: i,
220
- color: n,
221
- iconScale: r,
222
- compactAppearance: s = !1
220
+ color: s,
221
+ iconScale: a,
222
+ appearance: n = "normal"
223
223
  }) {
224
- const t = () => i.wiki_image ? i.wiki_image : i.image ? typeof i.image == "string" ? i.image : i.image[0] : null, o = (d) => {
225
- const c = d.match(/^(.*?)(\[.*?\])$/);
226
- if (c) {
227
- const [, a, m] = c;
224
+ const t = () => i.wiki_image ? i.wiki_image : i.image ? typeof i.image == "string" ? i.image : i.image[0] : null, l = (h) => {
225
+ const p = h.match(/^(.*?)(\[.*?\])$/);
226
+ if (p) {
227
+ const [, y, _] = p;
228
228
  return /* @__PURE__ */ e(u, { children: [
229
- a,
230
- /* @__PURE__ */ e("strong", { className: "setup-ability", children: m })
229
+ y,
230
+ /* @__PURE__ */ e("strong", { className: "setup-ability", children: _ })
231
231
  ] });
232
232
  }
233
- return d;
234
- }, l = t();
235
- return /* @__PURE__ */ e(
236
- "div",
237
- {
238
- className: "character-card",
239
- style: { marginBottom: s ? "1mm" : void 0 },
240
- children: [
241
- /* @__PURE__ */ e("div", { className: "character-icon-wrapper", children: l ? /* @__PURE__ */ e(
242
- "img",
243
- {
244
- src: l,
245
- alt: i.name,
246
- className: "character-icon",
247
- style: { scale: r.toString() }
248
- }
249
- ) : /* @__PURE__ */ e(
250
- "div",
251
- {
252
- className: "character-icon-placeholder",
253
- style: { color: n, scale: r.toString() },
254
- children: i.name.charAt(0)
255
- }
256
- ) }),
257
- /* @__PURE__ */ e("div", { className: "character-info", children: [
258
- /* @__PURE__ */ e("h3", { className: "character-name", style: { color: n }, children: i.name }),
259
- /* @__PURE__ */ e("p", { className: "character-ability", children: o(i.ability) })
260
- ] })
261
- ]
262
- }
263
- );
233
+ return h;
234
+ }, c = t(), m = n !== "normal" ? `character-card ${n}` : "character-card", o = n === "super-compact" ? "character-icon super-compact" : "character-icon", r = n === "super-compact" ? "character-icon-placeholder super-compact" : "character-icon-placeholder", d = n === "super-compact" ? "character-name super-compact" : "character-name", g = n === "super-compact" ? "character-ability super-compact" : "character-ability";
235
+ return /* @__PURE__ */ e("div", { className: m, children: [
236
+ /* @__PURE__ */ e("div", { className: "character-icon-wrapper", children: c ? /* @__PURE__ */ e(
237
+ "img",
238
+ {
239
+ src: c,
240
+ alt: i.name,
241
+ className: o,
242
+ style: { scale: a.toString() }
243
+ }
244
+ ) : /* @__PURE__ */ e(
245
+ "div",
246
+ {
247
+ className: r,
248
+ style: { color: s, scale: a.toString() },
249
+ children: i.name.charAt(0)
250
+ }
251
+ ) }),
252
+ /* @__PURE__ */ e("div", { className: "character-info", children: [
253
+ /* @__PURE__ */ e("h3", { className: d, style: { color: s }, children: i.name }),
254
+ /* @__PURE__ */ e("p", { className: g, children: l(i.ability) })
255
+ ] })
256
+ ] });
264
257
  }
265
- function D({ jinxes: i, allCharacters: n }) {
266
- const r = new Map(
267
- n.map((a) => [a.id.toLowerCase(), a])
268
- ), s = (a) => a.wiki_image ? a.wiki_image : a.image ? typeof a.image == "string" ? a.image : a.image[0] : null, t = (a, m) => {
269
- const g = r.get(a.characters[0]), h = r.get(a.characters[1]);
258
+ function W({ jinxes: i, allCharacters: s }) {
259
+ const a = new Map(
260
+ s.map((r) => [r.id.toLowerCase(), r])
261
+ ), n = (r) => r.wiki_image ? r.wiki_image : r.image ? typeof r.image == "string" ? r.image : r.image[0] : null, t = (r, d) => {
262
+ const g = a.get(r.characters[0]), h = a.get(r.characters[1]);
270
263
  return /* @__PURE__ */ e("div", { className: "jinx-item", children: [
271
264
  /* @__PURE__ */ e("div", { className: "jinx-icons", children: [
272
- g && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children: s(g) ? /* @__PURE__ */ e(
265
+ g && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children: n(g) ? /* @__PURE__ */ e(
273
266
  "img",
274
267
  {
275
- src: s(g),
268
+ src: n(g),
276
269
  alt: g.name,
277
270
  className: "jinx-icon"
278
271
  }
279
272
  ) : /* @__PURE__ */ e("div", { className: "jinx-icon-placeholder", children: g.name.charAt(0) }) }),
280
273
  /* @__PURE__ */ e("span", { className: "jinx-divider" }),
281
- h && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children: s(h) ? /* @__PURE__ */ e(
274
+ h && /* @__PURE__ */ e("div", { className: "jinx-icon-wrapper", children: n(h) ? /* @__PURE__ */ e(
282
275
  "img",
283
276
  {
284
- src: s(h),
277
+ src: n(h),
285
278
  alt: h.name,
286
279
  className: "jinx-icon"
287
280
  }
288
281
  ) : /* @__PURE__ */ e("div", { className: "jinx-icon-placeholder", children: h.name.charAt(0) }) })
289
282
  ] }),
290
- /* @__PURE__ */ e("p", { className: "jinx-text", children: a.jinx })
291
- ] }, m);
292
- }, o = i.length > 4, l = o ? Math.ceil(i.length / 2) : i.length, d = i.slice(0, l), c = i.slice(l);
283
+ /* @__PURE__ */ e("p", { className: "jinx-text", children: r.jinx })
284
+ ] }, d);
285
+ }, l = i.length > 4, c = l ? Math.ceil(i.length / 2) : i.length, m = i.slice(0, c), o = i.slice(c);
293
286
  return /* @__PURE__ */ e("div", { className: "jinxes-section", children: [
294
287
  /* @__PURE__ */ e("h2", { className: "section-title" }),
295
- o ? /* @__PURE__ */ e("div", { className: "jinxes-list jinxes-two-columns", children: [
296
- /* @__PURE__ */ e("div", { className: "jinx-column", children: d.map((a, m) => t(a, m)) }),
297
- /* @__PURE__ */ e("div", { className: "jinx-column", children: c.map((a, m) => t(a, l + m)) })
298
- ] }) : /* @__PURE__ */ e("div", { className: "jinxes-list", children: i.map((a, m) => t(a, m)) })
288
+ l ? /* @__PURE__ */ e("div", { className: "jinxes-list jinxes-two-columns", children: [
289
+ /* @__PURE__ */ e("div", { className: "jinx-column", children: m.map((r, d) => t(r, d)) }),
290
+ /* @__PURE__ */ e("div", { className: "jinx-column", children: o.map((r, d) => t(r, c + d)) })
291
+ ] }) : /* @__PURE__ */ e("div", { className: "jinxes-list", children: i.map((r, d) => t(r, d)) })
299
292
  ] });
300
293
  }
301
- const N = /* @__PURE__ */ new Set([
294
+ const k = /* @__PURE__ */ new Set([
302
295
  "the",
303
296
  "of",
304
297
  "in",
@@ -318,66 +311,66 @@ const N = /* @__PURE__ */ new Set([
318
311
  "upon",
319
312
  "after",
320
313
  "before"
321
- ]), f = (i, n) => N.has(i) || n === 0 && N.has(i.toLowerCase()), W = (i) => i.split(/\s+/).reduce((n, r, s, t) => {
322
- const o = f(r, s), l = s > 0 && f(t[s - 1], s - 1);
323
- if (s === 0 || o !== l) {
324
- const c = [];
325
- for (let m = s; m < t.length && f(t[m], m) === o; m++)
326
- c.push(t[m]);
327
- const a = n.length > 0;
328
- n.push(
314
+ ]), f = (i, s) => k.has(i) || s === 0 && k.has(i.toLowerCase()), $ = (i) => i.split(/\s+/).reduce((s, a, n, t) => {
315
+ const l = f(a, n), c = n > 0 && f(t[n - 1], n - 1);
316
+ if (n === 0 || l !== c) {
317
+ const o = [];
318
+ for (let d = n; d < t.length && f(t[d], d) === l; d++)
319
+ o.push(t[d]);
320
+ const r = s.length > 0;
321
+ s.push(
329
322
  /* @__PURE__ */ e(
330
323
  "span",
331
324
  {
332
- className: o ? "minor-word" : void 0,
325
+ className: l ? "minor-word" : void 0,
333
326
  children: [
334
- a && " ",
335
- c.join(" ")
327
+ r && " ",
328
+ o.join(" ")
336
329
  ]
337
330
  },
338
- s
331
+ n
339
332
  )
340
333
  );
341
334
  }
342
- return n;
343
- }, []), H = ({
335
+ return s;
336
+ }, []), O = ({
344
337
  title: i,
345
- color: n,
346
- includeMargins: r,
347
- formatMinorWords: s = !1,
338
+ color: s,
339
+ includeMargins: a,
340
+ formatMinorWords: n = !1,
348
341
  displayNightOrder: t = !1,
349
- firstNightOrder: o = [],
350
- otherNightOrder: l = []
342
+ firstNightOrder: l = [],
343
+ otherNightOrder: c = []
351
344
  }) => /* @__PURE__ */ e(
352
345
  "div",
353
346
  {
354
347
  className: "sheet-backing",
355
348
  style: {
356
- transform: r ? "scale(0.952)" : void 0
349
+ transform: a ? "scale(0.952)" : void 0
357
350
  },
358
351
  children: [
359
352
  /* @__PURE__ */ e("div", { className: "sheet-background", children: [
360
353
  /* @__PURE__ */ e("div", { className: "title-container", children: /* @__PURE__ */ e("h1", { children: (() => {
361
- const c = i.split("&");
362
- return c.map((a, m) => /* @__PURE__ */ e(u, { children: [
363
- s ? W(a) : a,
364
- m < c.length - 1 && /* @__PURE__ */ e("span", { className: "ampersand", children: "&" })
354
+ const o = i.split("&");
355
+ return o.map((r, d) => /* @__PURE__ */ e(u, { children: [
356
+ n ? $(r) : r,
357
+ d < o.length - 1 && /* @__PURE__ */ e("span", { className: "ampersand", children: "&" })
365
358
  ] }));
366
359
  })() }) }),
367
360
  t && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e("div", { className: "night-order-container", children: [
368
361
  /* @__PURE__ */ e("div", { className: "night-order", children: [
369
362
  /* @__PURE__ */ e("span", { children: "First Night:" }),
370
- /* @__PURE__ */ e("div", { className: "night-icons", children: o.map((c) => /* @__PURE__ */ e("img", { src: k(c), class: "night-order-icon" })) })
363
+ /* @__PURE__ */ e("div", { className: "night-icons", children: l.map((o) => {
364
+ const r = b(o);
365
+ return r && /* @__PURE__ */ e("img", { src: r, class: "night-order-icon" });
366
+ }) })
371
367
  ] }),
372
368
  /* @__PURE__ */ e("div", { className: "night-order", children: [
373
369
  /* @__PURE__ */ e("span", { children: "Other Nights:" }),
374
- /* @__PURE__ */ e("div", { className: "night-icons", children: l.map((c) => /* @__PURE__ */ e(
375
- "img",
376
- {
377
- src: k(c),
378
- class: "night-order-icon"
379
- }
380
- )) })
370
+ /* @__PURE__ */ e("div", { className: "night-icons", children: c.map((o) => {
371
+ const r = b(o);
372
+ return r && /* @__PURE__ */ e("img", { src: r, class: "night-order-icon" });
373
+ }) })
381
374
  ] })
382
375
  ] }) })
383
376
  ] }),
@@ -385,19 +378,19 @@ const N = /* @__PURE__ */ new Set([
385
378
  "div",
386
379
  {
387
380
  className: "sheet-back-overlay",
388
- style: { backgroundColor: n }
381
+ style: { backgroundColor: s }
389
382
  }
390
383
  )
391
384
  ]
392
385
  }
393
386
  );
394
- function k(i) {
395
- return typeof i == "string" ? i === "dawn" ? "/images/dawn-icon.png" : i === "dusk" ? "/images/dusk-icon.png" : i === "minioninfo" ? "/images/minioninfo.png" : "/images/demoninfo.png" : i.wiki_image;
387
+ function b(i) {
388
+ return typeof i == "string" ? i === "dawn" ? "/images/dawn-icon.png" : i === "dusk" ? "/images/dusk-icon.png" : i === "minioninfo" ? "/images/minioninfo.png" : "/images/demoninfo.png" : typeof i.image == "string" ? i.image : Array.isArray(i.image) && i.image.length ? i.image[0] : i.wiki_image;
396
389
  }
397
390
  export {
398
- B as CharacterSheet,
399
- H as SheetBack,
400
- C as darken,
401
- _ as parseRgb,
402
- w as rgbString
391
+ H as CharacterSheet,
392
+ O as SheetBack,
393
+ S as darken,
394
+ C as parseRgb,
395
+ M as rgbString
403
396
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .character-sheet{width:210mm;min-height:297mm;max-height:297mm;position:relative;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;color:#2d3748;display:flex;overflow:hidden;isolation:isolate}.character-sheet-background{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:cover;z-index:0}.sidebar-container{position:relative}.sidebar-background{background-image:url(/images/sidebar-desaturated-small.jpg);background-size:105mm;width:15mm;height:100%;flex-shrink:0}.sidebar-overlay{position:absolute;top:0;left:0;width:15mm;height:100%;background-color:#0003;pointer-events:none;mix-blend-mode:multiply}.sidebar-section{flex:1;display:flex;align-items:center;justify-content:center;writing-mode:vertical-rl;text-orientation:mixed;padding:3mm 0}.sidebar-label{font-size:3.5mm;font-weight:600;letter-spacing:.5mm;color:#eee;text-shadow:.3mm .3mm .5mm rgba(0,0,0,.3)}.sheet-content{position:relative;padding:5mm 0 3mm;display:flex;flex-direction:column;min-width:0}.character-column-spacer{min-height:13mm}.sheet-header-container{display:flex;align-items:center}.sheet-header{text-align:center;margin:0 0 4mm;padding:0 10mm;display:flex;align-items:center;justify-content:center}.sheet-header span{font-weight:lighter;letter-spacing:0mm;filter:drop-shadow(.2mm .1mm 0 #222d) drop-shadow(0mm 0mm .1mm #2228);word-spacing:-3mm;background:linear-gradient(-20deg,var(--header-color-light) 50%,var(--header-color-dark));background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;font-family:Unlovable,serif;font-weight:100;font-size:14mm;padding:2mm 4mm;margin:0 -4mm;mix-blend-mode:multiply}.swirl-divider{width:35mm;mix-blend-mode:soft-light}.flip{transform:scaleX(-1)}.sheet-author{font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.5mm;font-weight:700;text-align:center;margin:-5mm 0 3mm;color:#333}.characters-grid{display:flex;flex-direction:column;gap:2.5mm;flex:1;padding:0 10mm 0 0}.character-section{display:flex;break-inside:avoid;min-height:20mm}.section-title{font-family:Dumbledor,serif;font-weight:lighter;padding:0 3.5mm;color:#eee;margin:-6mm 0 -6mm -15mm;min-width:15mm;text-align:center;z-index:1;text-orientation:upright;writing-mode:vertical-lr;letter-spacing:-.6mm;font-size:4mm;line-height:2;filter:drop-shadow(.1mm .1mm .3mm #222a) drop-shadow(-.1mm .1mm .3mm #2228) drop-shadow(.1mm -.1mm .3mm #222a) drop-shadow(-.1mm -.1mm .3mm #222a)}.section-divider{height:.8mm;opacity:1;margin-left:-50%;width:150%;mix-blend-mode:soft-light}.character-list{display:flex;margin-left:8mm;gap:5mm}.character-column{flex:1 1 0px;display:flex;flex-direction:column;justify-content:space-between}.character-card{display:flex;align-items:center;gap:2.5mm;break-inside:avoid;margin-bottom:2.5mm}.character-info{padding-left:2mm;display:flex;flex-direction:column}.character-icon-wrapper{display:flex;flex-shrink:0}.character-icon,.character-icon-placeholder{width:13mm;max-height:13mm;object-fit:contain}.character-icon-placeholder{display:flex;align-items:center;justify-content:center;color:#eee;font-weight:700;font-size:6mm}.character-name{font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.5mm;font-weight:700;margin:0 0 .5mm;color:#1a202c}.character-ability{font-family:Trade Gothic,Trade Gothic Next,Helvetica Neue,Arial,sans-serif;font-size:3.1mm;line-height:1.2;margin:0;color:#222;display:inline-block}.sheet-footer{text-align:center;font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.5mm;color:#222;opacity:.7}.asterisk{font-size:5mm}.author-credit{position:absolute;bottom:3mm;right:3mm;font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.2mm;color:#222;opacity:.6;text-align:right}.author-credit p{font-size:2.5mm;margin:0}.setup-ability{display:inline-block;white-space:normal;font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif}.jinxes-section{display:flex;break-inside:avoid;margin-top:1mm}.jinxes-list{margin-left:8mm;display:flex;flex-direction:column}.jinxes-two-columns{flex-direction:row;gap:5mm}.jinx-column{flex:1;display:flex;flex-direction:column}.jinx-item{display:flex;gap:2.5mm;align-items:center;break-inside:avoid;margin-bottom:2mm}.jinx-icons{display:flex;gap:1mm;flex-shrink:0;align-items:center}.jinx-icon-wrapper{display:flex;flex-shrink:0;align-items:center}.jinx-icon,.jinx-icon-placeholder{width:3.5mm;height:3.5mm;object-fit:contain;scale:2.8}.jinx-icon-placeholder{display:flex;align-items:center;justify-content:center;color:#eee;font-weight:700;font-size:2mm}.jinx-divider{font-family:Dumbledor,serif;font-size:4.6mm;color:#1a202c;line-height:3.5mm;margin:0 .5mm}.jinx-text{font-family:Trade Gothic,Trade Gothic Next,Helvetica Neue,Arial,sans-serif;font-size:2.6mm;line-height:1.2;margin:0;color:#222;padding-top:.5mm}.sheet-backing{position:relative;width:210mm;min-height:297mm;max-height:297mm}.sheet-background{width:210mm;min-height:297mm;max-height:297mm;background-image:url(/images/sidebar-desaturated-small.jpg);background-repeat:repeat;background-size:105mm;display:flex;flex-direction:column;align-items:center;justify-content:center}.sheet-back-overlay{position:absolute;top:0;left:0;width:100%;height:100%;mix-blend-mode:multiply;pointer-events:none}.sheet-backing h1{font-family:Unlovable,serif;mix-blend-mode:normal;font-weight:100;font-size:30mm;color:#ae9d7f;text-wrap:wrap;z-index:1;flex-shrink:1;text-align:center;padding:10mm;background-image:url(/images/parchment_texture.jpg);background-clip:text;-webkit-background-clip:text;color:transparent;background-size:100mm;filter:drop-shadow(.5mm .5mm black) drop-shadow(0mm 0mm 1mm black);word-spacing:-10mm;flex:0 1 130mm;display:flex;flex-wrap:wrap;justify-content:center}.sheet-backing h1 .ampersand{font-size:45mm;line-height:30mm;vertical-align:-5mm}.night-order-container{position:absolute;background-image:url(/images/parchment_texture.jpg);background-position:0 -50%;left:0;bottom:20mm;font-family:Dumbledor;z-index:1;background-size:200mm;padding:4mm;box-shadow:inset 0 0 5px #000;display:flex;flex-direction:column;gap:5mm;max-width:185mm}.night-order{z-index:1;display:flex;gap:2mm}.night-order span{color:#222;height:6mm;display:flex;align-items:center;justify-content:flex-end;flex:0 0 23mm}.night-icons{z-index:1;display:flex;align-items:center;gap:2mm;flex-wrap:wrap}.night-order-icon{width:6mm;scale:2.1;filter:drop-shadow(0px 0px 2px #2224)}.title-container{z-index:1;display:flex;justify-content:center}.minor-word{padding:0 8mm;font-size:15mm;word-spacing:-6mm;display:flex}
1
+ .character-sheet{width:210mm;min-height:297mm;max-height:297mm;position:relative;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;color:#2d3748;display:flex;overflow:hidden;isolation:isolate}.character-sheet-background{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;object-fit:cover;z-index:0}.sidebar-container{position:relative}.sidebar-background{background-image:url(/images/sidebar-desaturated-small.jpg);background-size:105mm;width:15mm;height:100%;flex-shrink:0}.sidebar-overlay{position:absolute;top:0;left:0;width:15mm;height:100%;background-color:#0003;pointer-events:none;mix-blend-mode:multiply}.sidebar-section{flex:1;display:flex;align-items:center;justify-content:center;writing-mode:vertical-rl;text-orientation:mixed;padding:3mm 0}.sidebar-label{font-size:3.5mm;font-weight:600;letter-spacing:.5mm;color:#eee;text-shadow:.3mm .3mm .5mm rgba(0,0,0,.3)}.sheet-content{position:relative;padding:5mm 0 3mm;display:flex;flex-direction:column;min-width:0}.character-column-spacer{min-height:13mm}.sheet-header-container{display:flex;align-items:center}.sheet-header{text-align:center;margin:0 0 4mm;padding:0 10mm;display:flex;align-items:center;justify-content:center}.sheet-header span{font-weight:lighter;letter-spacing:0mm;filter:drop-shadow(.2mm .1mm 0 #222d) drop-shadow(0mm 0mm .1mm #2228);word-spacing:-3mm;background:linear-gradient(-20deg,var(--header-color-light) 50%,var(--header-color-dark));background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;font-family:Unlovable,serif;font-weight:100;font-size:14mm;padding:2mm 4mm;margin:0 -4mm;mix-blend-mode:multiply}.swirl-divider{width:35mm;mix-blend-mode:soft-light}.flip{transform:scaleX(-1)}.sheet-author{font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.5mm;font-weight:700;text-align:center;margin:-5mm 0 3mm;color:#333}.characters-grid{display:flex;flex-direction:column;gap:2.5mm;flex:1;padding:0 10mm 0 0}.character-section{display:flex;break-inside:avoid;min-height:20mm}.section-title{font-family:Dumbledor,serif;font-weight:lighter;padding:0 3.5mm;color:#eee;margin:-2mm 0 -2mm -15mm;min-width:15mm;text-align:center;z-index:1;text-orientation:upright;writing-mode:vertical-lr;letter-spacing:-.6mm;font-size:4mm;line-height:2;filter:drop-shadow(.1mm .1mm .3mm #222a) drop-shadow(-.1mm .1mm .3mm #2228) drop-shadow(.1mm -.1mm .3mm #222a) drop-shadow(-.1mm -.1mm .3mm #222a)}.section-divider{height:.8mm;opacity:1;margin-left:-50%;width:150%;mix-blend-mode:soft-light}.character-list{display:flex;margin-left:8mm;gap:5mm}.character-column{flex:1 1 0px;display:flex;flex-direction:column;justify-content:space-between}.character-card{display:flex;align-items:center;gap:2.5mm;break-inside:avoid;margin-bottom:2.5mm}.character-info{padding-left:2mm;display:flex;flex-direction:column}.character-icon-wrapper{display:flex;flex-shrink:0}.character-icon,.character-icon-placeholder{width:13mm;max-height:13mm;object-fit:contain}.character-icon-placeholder{display:flex;align-items:center;justify-content:center;color:#eee;font-weight:700;font-size:6mm}.character-name{font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.5mm;font-weight:700;margin:0 0 .5mm;color:#1a202c}.character-ability{font-family:Trade Gothic,Trade Gothic Next,Helvetica Neue,Arial,sans-serif;font-size:3.1mm;line-height:1.2;margin:0;color:#222;display:inline-block}.character-card.compact{margin-bottom:1mm}.character-ability.super-compact{font-size:2.7mm}.character-name.super-compact{font-size:3.2mm}.character-icon.super-compact,.character-icon-placeholder.super-compact{width:12mm;max-height:12mm}.character-card.super-compact{margin-bottom:.5mm}.sheet-footer{text-align:center;font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.5mm;color:#222;opacity:.7}.asterisk{font-size:5mm}.author-credit{position:absolute;bottom:3mm;right:3mm;font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif;font-size:3.2mm;color:#222;opacity:.6;text-align:right}.author-credit p{font-size:2.5mm;margin:0}.setup-ability{display:inline-block;white-space:normal;font-family:Goudy Old Style,Goudy Oldstyle,Goudy,Georgia,serif}.jinxes-section{display:flex;break-inside:avoid;margin-top:1mm}.jinxes-list{margin-left:8mm;display:flex;flex-direction:column}.jinxes-two-columns{flex-direction:row;gap:5mm}.jinx-column{flex:1;display:flex;flex-direction:column}.jinx-item{display:flex;gap:2.5mm;align-items:center;break-inside:avoid;margin-bottom:2mm}.jinx-icons{display:flex;gap:1mm;flex-shrink:0;align-items:center}.jinx-icon-wrapper{display:flex;flex-shrink:0;align-items:center}.jinx-icon,.jinx-icon-placeholder{width:3.5mm;height:3.5mm;object-fit:contain;scale:2.8}.jinx-icon-placeholder{display:flex;align-items:center;justify-content:center;color:#eee;font-weight:700;font-size:2mm}.jinx-divider{font-family:Dumbledor,serif;font-size:4.6mm;color:#1a202c;line-height:3.5mm;margin:0 .5mm}.jinx-text{font-family:Trade Gothic,Trade Gothic Next,Helvetica Neue,Arial,sans-serif;font-size:2.6mm;line-height:1.2;margin:0;color:#222;padding-top:.5mm}.sheet-backing{position:relative;width:210mm;min-height:297mm;max-height:297mm}.sheet-background{width:210mm;min-height:297mm;max-height:297mm;background-image:url(/images/sidebar-desaturated-small.jpg);background-repeat:repeat;background-size:105mm;display:flex;flex-direction:column;align-items:center;justify-content:center}.sheet-back-overlay{position:absolute;top:0;left:0;width:100%;height:100%;mix-blend-mode:multiply;pointer-events:none}.sheet-backing h1{font-family:Unlovable,serif;mix-blend-mode:normal;font-weight:100;font-size:30mm;color:#ae9d7f;text-wrap:wrap;z-index:1;flex-shrink:1;text-align:center;padding:10mm;background-image:url(/images/parchment_texture.jpg);background-clip:text;-webkit-background-clip:text;color:transparent;background-size:100mm;filter:drop-shadow(.5mm .5mm black) drop-shadow(0mm 0mm 1mm black);word-spacing:-10mm;flex:0 1 130mm;display:flex;flex-wrap:wrap;justify-content:center}.sheet-backing h1 .ampersand{font-size:45mm;line-height:30mm;vertical-align:-5mm}.night-order-container{position:absolute;background-image:url(/images/parchment_texture.jpg);background-position:0 -50%;left:0;bottom:20mm;font-family:Dumbledor;z-index:1;background-size:200mm;padding:4mm;box-shadow:inset 0 0 5px #000;display:flex;flex-direction:column;gap:5mm;max-width:185mm}.night-order{z-index:1;display:flex;gap:2mm}.night-order span{color:#222;height:6mm;display:flex;align-items:center;justify-content:flex-end;flex:0 0 23mm}.night-icons{z-index:1;display:flex;align-items:center;gap:2mm;flex-wrap:wrap}.night-order-icon{width:6mm;scale:2.1;filter:drop-shadow(0px 0px 2px #2224)}.title-container{z-index:1;display:flex;justify-content:center}.minor-word{padding:0 8mm;font-size:15mm;word-spacing:-6mm;display:flex}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botc-character-sheet",
3
- "version": "0.8.1",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -16,14 +16,16 @@
16
16
  "dist"
17
17
  ],
18
18
  "scripts": {
19
- "build": "vite build && tsc --emitDeclarationOnly --outDir dist",
20
- "dev": "vite build --watch"
19
+ "build": "vite build && tsc --emitDeclarationOnly --outDir dist && node scripts/strip-css-imports.js",
20
+ "dev": "vite build --watch",
21
+ "prepublishOnly": "bun run build"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "preact": "^10.19.3"
24
25
  },
25
26
  "devDependencies": {
26
27
  "@preact/preset-vite": "^2.8.1",
28
+ "glob": "^11.0.3",
27
29
  "preact": "^10.19.3",
28
30
  "typescript": "^5.3.3",
29
31
  "vite": "^5.0.8"