@dloizides/poster-render 0.13.1 → 0.14.0

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/index.mjs CHANGED
@@ -95,7 +95,7 @@ var RowIcon = /* @__PURE__ */ ((RowIcon2) => {
95
95
  })(RowIcon || {});
96
96
 
97
97
  // src/schema/lineStyleSchema.ts
98
- var LINE_KEY_PATTERN = "^(title|titleBottom|script|footer|includes[.]heading|includes[.]items[.][0-5]|venue[.][0-2]|schedule[.][0-5][.](label|time)|prices[.][0-3][.](amount|label)|items[.][0-7][.](date|price|schedule[.][0-5]))$";
98
+ var LINE_KEY_PATTERN = "^(title|titleBottom|script|footer|lines[.][0-5]|includes[.]heading|includes[.]items[.][0-5]|venue[.][0-2]|schedule[.][0-5][.](label|time)|prices[.][0-3][.](amount|label)|items[.][0-7][.](date|price|schedule[.][0-5]))$";
99
99
  var MAX_FONT = 40;
100
100
  var MIN_SPACING = -0.1;
101
101
  var MAX_SPACING = 0.5;
@@ -272,6 +272,7 @@ var headerTuningSchema = {
272
272
  // src/schema/flierDocSchema.ts
273
273
  var SHORT = 60;
274
274
  var LINE = 120;
275
+ var MAX_LINES = 6;
275
276
  var MAX_ROWS2 = 6;
276
277
  var MAX_ITEMS = 8;
277
278
  var MAX_PRICES2 = 4;
@@ -316,7 +317,8 @@ var blocks = {
316
317
  additionalProperties: false,
317
318
  properties: { heading: text(SHORT), items: { type: "array", items: text(LINE), minItems: 1, maxItems: MAX_ROWS2 } }
318
319
  },
319
- footer: text(LINE)
320
+ footer: text(LINE),
321
+ lines: { type: "array", items: { type: "string", maxLength: LINE }, maxItems: MAX_LINES }
320
322
  }
321
323
  };
322
324
  var flierDocSchema = {
@@ -1001,14 +1003,16 @@ function bodyGroups(doc, p, u, options = {}) {
1001
1003
  const includeLines = b.includes ? [l.accent(b.includes.heading, SIZE.small, "includes.heading"), ...b.includes.items.map((item, i) => l.item(item, SIZE.small, `includes.items.${i}`))] : [];
1002
1004
  const includes = includeLines.length > 0 ? [{ lines: includeLines.flatMap((line) => wrapped(line, options.wrap)), gapAfter: GAP.includes * u, uniform: true }] : [];
1003
1005
  const footerLines = (b.footer ?? "").split("\n").filter((text2) => text2.trim() !== "");
1006
+ const free = (b.lines ?? []).flatMap((text2, i) => text2.trim() === "" ? [] : wrapped(l.strong(text2, SIZE.small, `lines.${i}`), options.wrap));
1004
1007
  const footer = footerLines.length > 0 ? [{ lines: footerLines.flatMap((text2) => wrapped(l.soft(text2, SIZE.small, "footer"), options.wrap)), gapAfter: 0 }] : [];
1008
+ const freeGroup = free.length > 0 ? [{ lines: free, gapAfter: GAP.includes * u }] : [];
1005
1009
  const parts = {
1006
1010
  ["venue" /* Venue */]: venueGroups(doc, p, u, l),
1007
1011
  ["schedule" /* Schedule */]: isList ? [] : rows,
1008
1012
  ["items" /* Items */]: isList ? rows : [],
1009
1013
  ["prices" /* Prices */]: prices,
1010
1014
  ["includes" /* Includes */]: includes,
1011
- ["footer" /* Footer */]: footer
1015
+ ["footer" /* Footer */]: [...freeGroup, ...footer]
1012
1016
  };
1013
1017
  return joined(sectionOrderOf(doc), parts);
1014
1018
  }