@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.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -97,7 +97,7 @@ interface JsonSchema {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/** Every text line a style or tie can name: block fields by path, list items by index. */
|
|
100
|
-
declare const 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]))$";
|
|
100
|
+
declare const 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]))$";
|
|
101
101
|
|
|
102
102
|
interface ScheduleRow {
|
|
103
103
|
label: string;
|
|
@@ -120,6 +120,7 @@ interface FlierBlocks {
|
|
|
120
120
|
prices?: PriceRow[];
|
|
121
121
|
includes?: IncludesBlock;
|
|
122
122
|
footer?: string;
|
|
123
|
+
lines?: string[];
|
|
123
124
|
}
|
|
124
125
|
interface ListItem {
|
|
125
126
|
date: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ interface JsonSchema {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/** Every text line a style or tie can name: block fields by path, list items by index. */
|
|
100
|
-
declare const 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]))$";
|
|
100
|
+
declare const 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]))$";
|
|
101
101
|
|
|
102
102
|
interface ScheduleRow {
|
|
103
103
|
label: string;
|
|
@@ -120,6 +120,7 @@ interface FlierBlocks {
|
|
|
120
120
|
prices?: PriceRow[];
|
|
121
121
|
includes?: IncludesBlock;
|
|
122
122
|
footer?: string;
|
|
123
|
+
lines?: string[];
|
|
123
124
|
}
|
|
124
125
|
interface ListItem {
|
|
125
126
|
date: string;
|
package/dist/index.js
CHANGED
|
@@ -97,7 +97,7 @@ var RowIcon = /* @__PURE__ */ ((RowIcon2) => {
|
|
|
97
97
|
})(RowIcon || {});
|
|
98
98
|
|
|
99
99
|
// src/schema/lineStyleSchema.ts
|
|
100
|
-
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]))$";
|
|
100
|
+
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]))$";
|
|
101
101
|
var MAX_FONT = 40;
|
|
102
102
|
var MIN_SPACING = -0.1;
|
|
103
103
|
var MAX_SPACING = 0.5;
|
|
@@ -274,6 +274,7 @@ var headerTuningSchema = {
|
|
|
274
274
|
// src/schema/flierDocSchema.ts
|
|
275
275
|
var SHORT = 60;
|
|
276
276
|
var LINE = 120;
|
|
277
|
+
var MAX_LINES = 6;
|
|
277
278
|
var MAX_ROWS2 = 6;
|
|
278
279
|
var MAX_ITEMS = 8;
|
|
279
280
|
var MAX_PRICES2 = 4;
|
|
@@ -318,7 +319,8 @@ var blocks = {
|
|
|
318
319
|
additionalProperties: false,
|
|
319
320
|
properties: { heading: text(SHORT), items: { type: "array", items: text(LINE), minItems: 1, maxItems: MAX_ROWS2 } }
|
|
320
321
|
},
|
|
321
|
-
footer: text(LINE)
|
|
322
|
+
footer: text(LINE),
|
|
323
|
+
lines: { type: "array", items: { type: "string", maxLength: LINE }, maxItems: MAX_LINES }
|
|
322
324
|
}
|
|
323
325
|
};
|
|
324
326
|
var flierDocSchema = {
|
|
@@ -1003,14 +1005,16 @@ function bodyGroups(doc, p, u, options = {}) {
|
|
|
1003
1005
|
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}`))] : [];
|
|
1004
1006
|
const includes = includeLines.length > 0 ? [{ lines: includeLines.flatMap((line) => wrapped(line, options.wrap)), gapAfter: GAP.includes * u, uniform: true }] : [];
|
|
1005
1007
|
const footerLines = (b.footer ?? "").split("\n").filter((text2) => text2.trim() !== "");
|
|
1008
|
+
const free = (b.lines ?? []).flatMap((text2, i) => text2.trim() === "" ? [] : wrapped(l.strong(text2, SIZE.small, `lines.${i}`), options.wrap));
|
|
1006
1009
|
const footer = footerLines.length > 0 ? [{ lines: footerLines.flatMap((text2) => wrapped(l.soft(text2, SIZE.small, "footer"), options.wrap)), gapAfter: 0 }] : [];
|
|
1010
|
+
const freeGroup = free.length > 0 ? [{ lines: free, gapAfter: GAP.includes * u }] : [];
|
|
1007
1011
|
const parts = {
|
|
1008
1012
|
["venue" /* Venue */]: venueGroups(doc, p, u, l),
|
|
1009
1013
|
["schedule" /* Schedule */]: isList ? [] : rows,
|
|
1010
1014
|
["items" /* Items */]: isList ? rows : [],
|
|
1011
1015
|
["prices" /* Prices */]: prices,
|
|
1012
1016
|
["includes" /* Includes */]: includes,
|
|
1013
|
-
["footer" /* Footer */]: footer
|
|
1017
|
+
["footer" /* Footer */]: [...freeGroup, ...footer]
|
|
1014
1018
|
};
|
|
1015
1019
|
return joined(sectionOrderOf(doc), parts);
|
|
1016
1020
|
}
|