@kensio/colophon 2.13.1 → 2.14.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.
Files changed (121) hide show
  1. package/README.md +10 -0
  2. package/dist/config/defaults.d.ts +69 -2
  3. package/dist/config/defaults.d.ts.map +1 -1
  4. package/dist/config/defaults.js +61 -2
  5. package/dist/config/defaults.js.map +1 -1
  6. package/dist/config/index.d.ts.map +1 -1
  7. package/dist/config/index.js +2 -0
  8. package/dist/config/index.js.map +1 -1
  9. package/dist/config/safe-area.d.ts +27 -0
  10. package/dist/config/safe-area.d.ts.map +1 -0
  11. package/dist/config/safe-area.js +81 -0
  12. package/dist/config/safe-area.js.map +1 -0
  13. package/dist/config/size.d.ts.map +1 -1
  14. package/dist/config/size.js +1 -0
  15. package/dist/config/size.js.map +1 -1
  16. package/dist/core/index.d.ts +1 -1
  17. package/dist/core/index.d.ts.map +1 -1
  18. package/dist/core/index.js.map +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/layout/block.d.ts +6 -0
  23. package/dist/layout/block.d.ts.map +1 -1
  24. package/dist/layout/block.js.map +1 -1
  25. package/dist/layout/draw.d.ts.map +1 -1
  26. package/dist/layout/draw.js +3 -0
  27. package/dist/layout/draw.js.map +1 -1
  28. package/dist/layout/index.d.ts +1 -1
  29. package/dist/layout/index.d.ts.map +1 -1
  30. package/dist/layout/index.js +1 -1
  31. package/dist/layout/index.js.map +1 -1
  32. package/dist/templates/article/index.js +1 -1
  33. package/dist/templates/article/index.js.map +1 -1
  34. package/dist/templates/banner/badge.d.ts +8 -1
  35. package/dist/templates/banner/badge.d.ts.map +1 -1
  36. package/dist/templates/banner/badge.js +8 -4
  37. package/dist/templates/banner/badge.js.map +1 -1
  38. package/dist/templates/banner/index.d.ts.map +1 -1
  39. package/dist/templates/banner/index.js +10 -25
  40. package/dist/templates/banner/index.js.map +1 -1
  41. package/dist/templates/bottom.d.ts +1 -1
  42. package/dist/templates/bottom.d.ts.map +1 -1
  43. package/dist/templates/bottom.js +5 -5
  44. package/dist/templates/bottom.js.map +1 -1
  45. package/dist/templates/card/index.d.ts.map +1 -1
  46. package/dist/templates/card/index.js +9 -25
  47. package/dist/templates/card/index.js.map +1 -1
  48. package/dist/templates/cover/index.d.ts +21 -0
  49. package/dist/templates/cover/index.d.ts.map +1 -0
  50. package/dist/templates/cover/index.js +67 -0
  51. package/dist/templates/cover/index.js.map +1 -0
  52. package/dist/templates/cover/lines.d.ts +21 -0
  53. package/dist/templates/cover/lines.d.ts.map +1 -0
  54. package/dist/templates/cover/lines.js +77 -0
  55. package/dist/templates/cover/lines.js.map +1 -0
  56. package/dist/templates/cover/lockup.d.ts +54 -0
  57. package/dist/templates/cover/lockup.d.ts.map +1 -0
  58. package/dist/templates/cover/lockup.js +78 -0
  59. package/dist/templates/cover/lockup.js.map +1 -0
  60. package/dist/templates/cover/tracking.d.ts +16 -0
  61. package/dist/templates/cover/tracking.d.ts.map +1 -0
  62. package/dist/templates/cover/tracking.js +40 -0
  63. package/dist/templates/cover/tracking.js.map +1 -0
  64. package/dist/templates/docs/index.js +3 -3
  65. package/dist/templates/docs/index.js.map +1 -1
  66. package/dist/templates/event/index.js +3 -3
  67. package/dist/templates/event/index.js.map +1 -1
  68. package/dist/templates/footer.d.ts +3 -0
  69. package/dist/templates/footer.d.ts.map +1 -1
  70. package/dist/templates/footer.js +16 -1
  71. package/dist/templates/footer.js.map +1 -1
  72. package/dist/templates/frame.d.ts +27 -3
  73. package/dist/templates/frame.d.ts.map +1 -1
  74. package/dist/templates/frame.js +19 -7
  75. package/dist/templates/frame.js.map +1 -1
  76. package/dist/templates/index.d.ts +1 -0
  77. package/dist/templates/index.d.ts.map +1 -1
  78. package/dist/templates/index.js +3 -0
  79. package/dist/templates/index.js.map +1 -1
  80. package/dist/templates/logo.d.ts +6 -2
  81. package/dist/templates/logo.d.ts.map +1 -1
  82. package/dist/templates/logo.js +10 -6
  83. package/dist/templates/logo.js.map +1 -1
  84. package/dist/templates/photo/index.d.ts.map +1 -1
  85. package/dist/templates/photo/index.js +9 -4
  86. package/dist/templates/photo/index.js.map +1 -1
  87. package/dist/templates/quote/index.js +2 -2
  88. package/dist/templates/quote/index.js.map +1 -1
  89. package/dist/templates/release/index.js +3 -3
  90. package/dist/templates/release/index.js.map +1 -1
  91. package/dist/templates/stat/index.js +3 -3
  92. package/dist/templates/stat/index.js.map +1 -1
  93. package/dist/templates/thumbnail/index.js +3 -3
  94. package/dist/templates/thumbnail/index.js.map +1 -1
  95. package/dist/templates/wordmark/index.js +2 -2
  96. package/dist/templates/wordmark/index.js.map +1 -1
  97. package/dist/text/element.d.ts +5 -0
  98. package/dist/text/element.d.ts.map +1 -1
  99. package/dist/text/element.js +4 -1
  100. package/dist/text/element.js.map +1 -1
  101. package/dist/text/index.d.ts +1 -0
  102. package/dist/text/index.d.ts.map +1 -1
  103. package/dist/text/index.js +1 -0
  104. package/dist/text/index.js.map +1 -1
  105. package/dist/text/track.d.ts +30 -0
  106. package/dist/text/track.d.ts.map +1 -0
  107. package/dist/text/track.js +44 -0
  108. package/dist/text/track.js.map +1 -0
  109. package/dist/types.d.ts +49 -0
  110. package/dist/types.d.ts.map +1 -1
  111. package/dist/validate/collect.d.ts.map +1 -1
  112. package/dist/validate/collect.js +2 -1
  113. package/dist/validate/collect.js.map +1 -1
  114. package/dist/validate/keys.d.ts +2 -0
  115. package/dist/validate/keys.d.ts.map +1 -1
  116. package/dist/validate/keys.js +9 -0
  117. package/dist/validate/keys.js.map +1 -1
  118. package/dist/validate/overrides.d.ts.map +1 -1
  119. package/dist/validate/overrides.js +2 -1
  120. package/dist/validate/overrides.js.map +1 -1
  121. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import { measureIn, trackingFor } from "../../layout/index.js";
2
+ /**
3
+ * The most a line may be tracked, as a fraction of its own font size.
4
+ *
5
+ * Stretching a strapline to sit under a name is a typesetter's adjustment, and
6
+ * past a certain point it stops being one: a two-word tagline pulled out to the
7
+ * width of a long name reads as broken rather than as considered. Half an em
8
+ * between characters is where that starts, so a line needing more than this is
9
+ * left alone rather than drawn badly.
10
+ */
11
+ const maxTracking = 0.5;
12
+ /** How wide one line is drawn, before any tracking is added to it. */
13
+ function naturalWidth(line, measure, fontFamily) {
14
+ return measureIn(measure, fontFamily, line.fontWeight)(line.text, line.fontSize);
15
+ }
16
+ /**
17
+ * Stretch a single line of tagline out to the width of the name above it.
18
+ *
19
+ * This is the adjustment somebody makes by hand in a drawing program and then
20
+ * has to make again every time the words change: the wordmark and the line
21
+ * under it share both edges, so the pair reads as one block rather than as two
22
+ * lines that happen to be centred together.
23
+ *
24
+ * Only a tagline of one line is tracked. Justifying every line of a wrapped
25
+ * one to the same width is a different thing to want, and it goes wrong on the
26
+ * short last line in the way justified text always does.
27
+ */
28
+ export function trackTagline(name, tagline, measure, fontFamily) {
29
+ const [first] = name;
30
+ const [line] = tagline;
31
+ if (first === undefined || line === undefined || tagline.length !== 1) {
32
+ return tagline;
33
+ }
34
+ const tracking = trackingFor(line.text, naturalWidth(line, measure, fontFamily), naturalWidth(first, measure, fontFamily));
35
+ if (tracking > line.fontSize * maxTracking) {
36
+ return tagline;
37
+ }
38
+ return [{ ...line, letterSpacing: tracking }];
39
+ }
40
+ //# sourceMappingURL=tracking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/templates/cover/tracking.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG/D;;;;;;;;GAQG;AACH,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,sEAAsE;AACtE,SAAS,YAAY,CACnB,IAAc,EACd,OAAoB,EACpB,UAAkB;IAElB,OAAO,SAAS,CACd,OAAO,EACP,UAAU,EACV,IAAI,CAAC,UAAU,CAChB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAyB,EACzB,OAA4B,EAC5B,OAAoB,EACpB,UAAkB;IAElB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;IAEvB,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtE,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAC1B,IAAI,CAAC,IAAI,EACT,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,EACvC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CACzC,CAAC;IAEF,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;AAChD,CAAC"}
@@ -17,11 +17,11 @@ import { docsLines } from "./lines.js";
17
17
  export const docsTemplate = {
18
18
  name: "docs",
19
19
  render({ props, config, dimensions, measure, logo, avatar, }) {
20
- const { width, height } = dimensions;
20
+ const { height } = dimensions;
21
21
  const { fontFamily, colors } = config;
22
22
  const frame = imageFrame(dimensions, config, avatar);
23
23
  const { pad } = frame;
24
- const mark = logoRect(logo, dimensions, pad, "start");
24
+ const mark = logoRect(logo, frame.full, pad, "start");
25
25
  const chrome = docsChrome(props, config, dimensions, pad, markRoom(mark?.width, pad / 2), measure);
26
26
  // The title starts below whichever of the trail and the logo reaches
27
27
  // furthest down. Both are measured from the top of the image, so the room
@@ -41,7 +41,7 @@ export const docsTemplate = {
41
41
  return (chrome.svg +
42
42
  logoElement(logo, mark) +
43
43
  body +
44
- footerLine(config, frame, width, avatar, measure));
44
+ footerLine(config, frame, avatar, measure));
45
45
  },
46
46
  };
47
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,IAAI,EAAE,MAAM;IACZ,MAAM,CAAC,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,IAAI,EACJ,MAAM,GACU;QAChB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACrC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACtC,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;QACtB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAEtD,MAAM,MAAM,GAAG,UAAU,CACvB,KAAK,EACL,MAAM,EACN,UAAU,EACV,GAAG,EACH,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,EAC9B,OAAO,CACR,CAAC;QAEF,qEAAqE;QACrE,0EAA0E;QA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KAAK,EAAE;YACf,OAAO;YACP,UAAU;YACV,YAAY,EAAE,IAAI,CAAC,KAAK;YACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACrC,MAAM;SACP,CAAC,EACF,IAAI,EACJ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAC1D,CAAC;QAEF,OAAO,CACL,MAAM,CAAC,GAAG;YACV,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC;YACvB,IAAI;YACJ,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAC3C,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -18,13 +18,13 @@ const lineHeight = 1.24;
18
18
  export const eventTemplate = {
19
19
  name: "event",
20
20
  render({ props, config, dimensions, measure, logo, avatar, }) {
21
- const { width, height } = dimensions;
21
+ const { height } = dimensions;
22
22
  const { fontFamily, colors } = config;
23
23
  const frame = imageFrame(dimensions, config, avatar, {
24
24
  padScale: 0.09,
25
25
  });
26
26
  const { pad } = frame;
27
- const mark = logoRect(logo, dimensions, pad, "middle");
27
+ const mark = logoRect(logo, frame.full, pad, "middle");
28
28
  const area = contentArea(frame, markRoom(mark?.height, pad / 2));
29
29
  const lines = eventLines(props, {
30
30
  measure,
@@ -49,7 +49,7 @@ export const eventTemplate = {
49
49
  lineHeight,
50
50
  anchor: "middle",
51
51
  });
52
- const footer = footerLine(config, frame, width, avatar, measure, "middle");
52
+ const footer = footerLine(config, frame, avatar, measure, "middle");
53
53
  return (logoElement(logo, mark) +
54
54
  datePlate(date, dateSlot, plateStyle(config), measure) +
55
55
  body +
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAA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AC,MAAM,GAAG,KAAK,CAAC;YACtC,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAExC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,KAAK,CAChC;YACE,EAAE,IAAI,EAAE,KAAK,EAAE;YACf;gBACE,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC;gBACpC,SAAS,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;aACvD;SACF,EACD,IAAI,CACL,CAAC;QAEF,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;YACrC,UAAU;YACV,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,UAAU;YACV,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAEpE,OAAO,CACL,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC;YACvB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;YACtD,IAAI;YACJ,MAAM,CACP,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -5,6 +5,9 @@ import type { Dimensions, ResolvedConfig } from "../types.js";
5
5
  * Every template asks for it here rather than working it out, which is what
6
6
  * stops the twelve of them drifting apart. It is one number for the footer,
7
7
  * the byline and the attribution alike, since they are all the same line.
8
+ *
9
+ * The dimensions are the frame's rather than the image's, so a size with a
10
+ * safe area gets a footer scaled to the part of the picture that is seen.
8
11
  */
9
12
  export declare function footerFontSize(dimensions: Dimensions): number;
10
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/templates/footer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkB9D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAO7D;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEzD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,eAAe,GACzB,MAAM,CAeR"}
1
+ {"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../../src/templates/footer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA+B9D;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAU7D;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEzD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,eAAe,GACzB,MAAM,CAeR"}
@@ -13,15 +13,30 @@ const footerScale = 0.036;
13
13
  * and keeps the proportions it had.
14
14
  */
15
15
  const footerWidthFloor = 0.026;
16
+ /**
17
+ * The most it may be, as a fraction of the height, which is about a twelfth.
18
+ *
19
+ * The width floor assumes an image whose proportions are somewhere near a
20
+ * share card's, and a profile cover is not: a LinkedIn Page cover is 6:1, so
21
+ * the floor asks for 72px of footer in a band that has 250px for the title,
22
+ * and the site's URL comes out the same size as its name. The ceiling is what
23
+ * says the line along the bottom is a footer rather than a second heading. It
24
+ * is above every share preset, so nothing that was drawn before this existed
25
+ * is drawn differently.
26
+ */
27
+ const footerHeightCeiling = 0.08;
16
28
  /**
17
29
  * The size the line along the bottom is drawn at.
18
30
  *
19
31
  * Every template asks for it here rather than working it out, which is what
20
32
  * stops the twelve of them drifting apart. It is one number for the footer,
21
33
  * the byline and the attribution alike, since they are all the same line.
34
+ *
35
+ * The dimensions are the frame's rather than the image's, so a size with a
36
+ * safe area gets a footer scaled to the part of the picture that is seen.
22
37
  */
23
38
  export function footerFontSize(dimensions) {
24
- return Math.round(Math.max(dimensions.height * footerScale, dimensions.width * footerWidthFloor));
39
+ return Math.round(Math.min(Math.max(dimensions.height * footerScale, dimensions.width * footerWidthFloor), dimensions.height * footerHeightCeiling));
25
40
  }
26
41
  /**
27
42
  * The baseline of a footer sitting on the bottom margin.
@@ -1 +1 @@
1
- {"version":3,"file":"footer.js","sourceRoot":"","sources":["../../src/templates/footer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG9D,8DAA8D;AAC9D,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,UAAsB;IACnD,OAAO,IAAI,CAAC,KAAK,CACf,IAAI,CAAC,GAAG,CACN,UAAU,CAAC,MAAM,GAAG,WAAW,EAC/B,UAAU,CAAC,KAAK,GAAG,gBAAgB,CACpC,CACF,CAAC;AACJ,CAAC;AAeD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,GAAW,EACX,QAAgB;IAEhB,OAAO,WAAW,CAAC,MAAM,GAAG,GAAG,GAAG,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,SAAS,CAAC,MAAsB;IAC9C,OAAO,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAsB,EACtB,SAA0B;IAE1B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE;QACtC,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,MAAM,CAA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AAE,CAAC;IACZ,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE;QACtC,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;QAC9B,WAAW,EAAE,SAAS,CAAC,OAAO;QAC9B,GAAG,CAAC,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;KACpE,CAAC,CAAC;AACL,CAAC"}
@@ -13,7 +13,10 @@ export interface Frame {
13
13
  /** The margin, applied to every edge. */
14
14
  readonly pad: number;
15
15
  readonly footerFontSize: number;
16
- /** The whole image, as the rectangle the content is inset from. */
16
+ /**
17
+ * The rectangle the content is inset from: the whole image, or the part of
18
+ * it that survives being displayed where the config named a safe area.
19
+ */
17
20
  readonly full: Rect;
18
21
  /**
19
22
  * Vertical room to leave below the content, which is the footer line plus
@@ -25,8 +28,19 @@ export interface Frame {
25
28
  }
26
29
  /** What a template can tell the frame about itself. */
27
30
  export interface FrameOptions {
28
- /** The margin, as a fraction of the image's width. */
31
+ /** The margin, as a fraction of the frame's width. */
29
32
  readonly padScale?: number;
33
+ /**
34
+ * The margin outright, for a template whose frame is too wide for its height
35
+ * to take one from the width.
36
+ *
37
+ * A fraction of the width is the right unit for an image with the
38
+ * proportions of a card, and the wrong one for a strip: on a 6:1 cover the
39
+ * usual 7.5% of the width is a third of the height, spent on margins above
40
+ * and below the only band there is. Wins over `padScale` where both are
41
+ * given.
42
+ */
43
+ readonly pad?: number;
30
44
  /**
31
45
  * Whether the template draws something of its own on the bottom line, such
32
46
  * as a byline, so the room is left for it even where the config has no
@@ -38,6 +52,16 @@ export interface FrameOptions {
38
52
  * Work out a template's frame. The avatar counts as a footer even where the
39
53
  * config carries no text, since the picture is drawn on the same line and
40
54
  * needs the same room.
55
+ *
56
+ * The safe area is worked out first and everything else is measured against
57
+ * it, rather than against the image. That matters most for the margin: a
58
+ * YouTube banner is 2560 across and the part of it anyone sees is 1546, so a
59
+ * margin taken from the image would spend a quarter of the visible width on
60
+ * clear space. It matters for the footer too, which would otherwise sit on the
61
+ * bottom edge of a picture that is cropped before it gets there.
62
+ *
63
+ * A config naming no safe area gets the whole image back, so every one of
64
+ * these is the arithmetic it always was.
41
65
  */
42
66
  export declare function imageFrame(dimensions: Dimensions, config: ResolvedConfig, avatar: ImageAsset | undefined, options?: FrameOptions): Frame;
43
67
  /**
@@ -49,7 +73,7 @@ export declare function imageFrame(dimensions: Dimensions, config: ResolvedConfi
49
73
  */
50
74
  export declare function markRoom(height: number | undefined, gap: number): number;
51
75
  /**
52
- * The space a template's content has: the whole image, less the margins, less
76
+ * The space a template's content has: the frame, less the margins, less
53
77
  * whatever sits along the top, less the footer line.
54
78
  *
55
79
  * `top` is what {@link markRoom} worked out, or whatever else the template put
@@ -1 +1 @@
1
- {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/templates/frame.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQ1E;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IACpB,yCAAyC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,u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sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,GAAE,YAAiB,GACzB,KAAK,CAgBP;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,SAAI,GAAG,IAAI,CAOvD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -1,4 +1,5 @@
1
1
  import { footerBaseline, footerFontSize, hasFooter } from "./footer.js";
2
+ import { safeRect } from "../config/safe-area.js";
2
3
  import { inset } from "../layout/index.js";
3
4
  /** Margin from the image edge, as a fraction of its width. */
4
5
  const defaultPadScale = 0.075;
@@ -8,18 +9,29 @@ const footerGap = 0.02;
8
9
  * Work out a template's frame. The avatar counts as a footer even where the
9
10
  * config carries no text, since the picture is drawn on the same line and
10
11
  * needs the same room.
12
+ *
13
+ * The safe area is worked out first and everything else is measured against
14
+ * it, rather than against the image. That matters most for the margin: a
15
+ * YouTube banner is 2560 across and the part of it anyone sees is 1546, so a
16
+ * margin taken from the image would spend a quarter of the visible width on
17
+ * clear space. It matters for the footer too, which would otherwise sit on the
18
+ * bottom edge of a picture that is cropped before it gets there.
19
+ *
20
+ * A config naming no safe area gets the whole image back, so every one of
21
+ * these is the arithmetic it always was.
11
22
  */
12
23
  export function imageFrame(dimensions, config, avatar, options = {}) {
13
- const { width, height } = dimensions;
14
- const pad = Math.round(width * (options.padScale ?? defaultPadScale));
15
- const fontSize = footerFontSize(dimensions);
24
+ const full = safeRect(dimensions, config.safeArea);
25
+ const pad = options.pad ??
26
+ Math.round(full.width * (options.padScale ?? defaultPadScale));
27
+ const fontSize = footerFontSize(full);
16
28
  const isDrawn = options.footer === true || hasFooter(config) || avatar !== undefined;
17
29
  return {
18
30
  pad,
19
31
  footerFontSize: fontSize,
20
- full: { x: 0, y: 0, width, height },
21
- footerRoom: isDrawn ? fontSize + Math.round(height * footerGap) : 0,
22
- footerY: footerBaseline(height, pad, fontSize),
32
+ full,
33
+ footerRoom: isDrawn ? fontSize + Math.round(full.height * footerGap) : 0,
34
+ footerY: footerBaseline(full.y + full.height, pad, fontSize),
23
35
  };
24
36
  }
25
37
  /**
@@ -33,7 +45,7 @@ export function markRoom(height, gap) {
33
45
  return height === undefined || height === 0 ? 0 : height + gap;
34
46
  }
35
47
  /**
36
- * The space a template's content has: the whole image, less the margins, less
48
+ * The space a template's content has: the frame, less the margins, less
37
49
  * whatever sits along the top, less the footer line.
38
50
  *
39
51
  * `top` is what {@link markRoom} worked out, or whatever else the template put
@@ -1 +1 @@
1
- {"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/templates/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,8DAA8D;AAC9D,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,gFAAgF;AAChF,MAAM,SAAS,GAAG,IAAI,CAAC;AAsCvB;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,UAAsB,EACtB,MAAsB,EACtB,MAA8B,EAC9B,OAAO,GAAiB,EAAE;IAE1B,MAAM,EAAE,KAAK,E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AE,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC;KAC7D,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,MAA0B,EAAE,GAAW;IAC9D,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC;AACjE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY,EAAE,GAAG,GAAG,CAAC;IAC/C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QACvB,GAAG,EAAE,KAAK,CAAC,GAAG,GAAG,GAAG;QACpB,KAAK,EAAE,KAAK,CAAC,GAAG;QAChB,IAAI,EAAE,KAAK,CAAC,GAAG;QACf,MAAM,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,UAAU;KACrC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,GAAW;IAChD,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9B,CAAC"}
@@ -8,6 +8,7 @@ export { articleTemplate } from "./article/index.js";
8
8
  export { bannerTemplate } from "./banner/index.js";
9
9
  export { cardTemplate } from "./card/index.js";
10
10
  export { codeTemplate } from "./code/index.js";
11
+ export { coverTemplate } from "./cover/index.js";
11
12
  export { docsTemplate } from "./docs/index.js";
12
13
  export { eventTemplate } from "./event/index.js";
13
14
  export { photoTemplate } from "./photo/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAe5C;;;GAGG;AACH,eAAO,MAAM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,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -2,6 +2,7 @@ import { articleTemplate } from "./article/index.js";
2
2
  import { bannerTemplate } from "./banner/index.js";
3
3
  import { cardTemplate } from "./card/index.js";
4
4
  import { codeTemplate } from "./code/index.js";
5
+ import { coverTemplate } from "./cover/index.js";
5
6
  import { docsTemplate } from "./docs/index.js";
6
7
  import { eventTemplate } from "./event/index.js";
7
8
  import { photoTemplate } from "./photo/index.js";
@@ -20,6 +21,7 @@ export const builtinTemplates = {
20
21
  [bannerTemplate.name]: bannerTemplate,
21
22
  [cardTemplate.name]: cardTemplate,
22
23
  [codeTemplate.name]: codeTemplate,
24
+ [coverTemplate.name]: coverTemplate,
23
25
  [docsTemplate.name]: docsTemplate,
24
26
  [eventTemplate.name]: eventTemplate,
25
27
  [photoTemplate.name]: photoTemplate,
@@ -34,6 +36,7 @@ export { articleTemplate } from "./article/index.js";
34
36
  export { bannerTemplate } from "./banner/index.js";
35
37
  export { cardTemplate } from "./card/index.js";
36
38
  export { codeTemplate } from "./code/index.js";
39
+ export { coverTemplate } from "./cover/index.js";
37
40
  export { docsTemplate } from "./docs/index.js";
38
41
  export { eventTemplate } from "./event/index.js";
39
42
  export { photoTemplate } from "./photo/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAClE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,eAAe;IACvC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,cAAc;IACrC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa;IACnC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa;IACnC,CAAC,aAAa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AC,IAAI,CAAC,EAAE,iBAAiB;IAC3C,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,gBAAgB;CAC1C,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Rect } from "../layout/index.js";
2
- import type { Dimensions, ImageAsset } from "../types.js";
2
+ import type { ImageAsset } from "../types.js";
3
3
  /**
4
4
  * Where the logo goes, or nothing where there is none.
5
5
  *
@@ -8,8 +8,12 @@ import type { Dimensions, ImageAsset } from "../types.js";
8
8
  * follows from the proportions of the picture. A logo whose format does not
9
9
  * state its size is drawn in a square, where a wordmark will sit small in the
10
10
  * middle rather than being stretched to fit.
11
+ *
12
+ * `area` is the frame's, which is the whole image unless the config named a
13
+ * safe area. Taking it from the image instead would put the mark in a corner
14
+ * a profile cover crops off, and size it against a height nobody sees.
11
15
  */
12
- export declare function logoRect(logo: ImageAsset | undefined, dimensions: Dimensions, pad: number, align: "start" | "middle"): Rect | undefined;
16
+ export declare function logoRect(logo: ImageAsset | undefined, area: Rect, pad: number, align: "start" | "middle"): Rect | undefined;
13
17
  /** The logo drawn in the rectangle it was given, whole rather than cropped. */
14
18
  export declare function logoElement(logo: ImageAsset | undefined, rect: Rect | undefined): string;
15
19
  //# sourceMappingURL=logo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../src/templates/logo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK1D;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GAAG,QAAQ,GACxB,IAAI,GAAG,SAAS,CAalB;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,MAAM,CAIR"}
1
+ {"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../src/templates/logo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GAAG,QAAQ,GACxB,IAAI,GAAG,SAAS,CAalB;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,GAAG,SAAS,EAC5B,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,MAAM,CAIR"}
@@ -1,5 +1,5 @@
1
1
  import { image } from "../layout/index.js";
2
- /** The logo's height, as a fraction of the image's. */
2
+ /** The logo's height, as a fraction of the frame's. */
3
3
  const logoScale = 0.075;
4
4
  /**
5
5
  * Where the logo goes, or nothing where there is none.
@@ -9,17 +9,21 @@ const logoScale = 0.075;
9
9
  * follows from the proportions of the picture. A logo whose format does not
10
10
  * state its size is drawn in a square, where a wordmark will sit small in the
11
11
  * middle rather than being stretched to fit.
12
+ *
13
+ * `area` is the frame's, which is the whole image unless the config named a
14
+ * safe area. Taking it from the image instead would put the mark in a corner
15
+ * a profile cover crops off, and size it against a height nobody sees.
12
16
  */
13
- export function logoRect(logo, dimensions, pad, align) {
17
+ export function logoRect(logo, area, pad, align) {
14
18
  if (logo === undefined) {
15
19
  return undefined;
16
20
  }
17
- const height = Math.round(dimensions.height * logoScale);
21
+ const height = Math.round(area.height * logoScale);
18
22
  const width = Math.round(height * logo.aspect);
19
23
  const x = align === "middle"
20
- ? Math.round((dimensions.width - width) / 2)
21
- : dimensions.width - pad - width;
22
- return { x, y: pad, width, height };
24
+ ? Math.round(area.x + (area.width - width) / 2)
25
+ : area.x + area.width - pad - width;
26
+ return { x, y: area.y + pad, width, height };
23
27
  }
24
28
  /** The logo drawn in the rectangle it was given, whole rather than cropped. */
25
29
  export function logoElement(logo, rect) {
@@ -1 +1 @@
1
- {"version":3,"file":"logo.js","sourceRoot":"","sources":["../../src/templates/logo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAG3C,uDAAuD;AACvD,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CACtB,IAA4B,EAC5B,UAAsB,EACtB,GAAW,EACX,KAAyB;IAEzB,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AAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,CAAC,GACL,KAAK,KAAK,QAAQ;QAChB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/C,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;IAExC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CACzB,IAA4B,EAC5B,IAAsB;IAEtB,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS;QAC7C,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/photo/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAYhE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,EAAE,QAoD3B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/photo/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAYhE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,EAAE,QAiD3B,CAAC"}
@@ -28,11 +28,16 @@ export const photoTemplate = {
28
28
  const { fontFamily, colors } = config;
29
29
  const frame = imageFrame(dimensions, config, avatar);
30
30
  const { pad } = frame;
31
- const mark = logoRect(logo, dimensions, pad, "start");
31
+ const mark = logoRect(logo, frame.full, pad, "start");
32
+ // Over the whole image rather than over the frame, so that a safe area
33
+ // moves the words and leaves the picture behind them full-bleed. The part
34
+ // a platform crops off is still seen on some of its clients, and a
35
+ // photograph stopping short of the edge would be the visible fault there.
36
+ const canvas = { x: 0, y: 0, width, height };
32
37
  const backdrop = picture === undefined
33
38
  ? ""
34
- : image(frame.full, picture.href, { fit: "cover" }) +
35
- scrim(frame.full, scrimId, { from: scrimFrom, to: scrimTo });
39
+ : image(canvas, picture.href, { fit: "cover" }) +
40
+ scrim(canvas, scrimId, { from: scrimFrom, to: scrimTo });
36
41
  const area = contentArea(frame, markRoom(mark?.height, pad / 2));
37
42
  // Set along the bottom, where the scrim is heaviest and where a picture
38
43
  // usually has least going on.
@@ -44,7 +49,7 @@ export const photoTemplate = {
44
49
  standfirstFs: Math.round(height * 0.042),
45
50
  height,
46
51
  }), area, { fontFamily, fill: colors.foreground, lineHeight: 1.24, align: "end" });
47
- const footer = footerLine(config, frame, width, avatar, measure, "start", 0.85);
52
+ const footer = footerLine(config, frame, avatar, measure, "start", 0.85);
48
53
  return backdrop + logoElement(logo, mark) + body + footer;
49
54
  },
50
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/photo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC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,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CACxE,CAAC;QAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAEzE,OAAO,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC;IAC5D,CAAC;CACF,CAAC"}
@@ -17,7 +17,7 @@ const lineHeight = 1.3;
17
17
  export const quoteTemplate = {
18
18
  name: "quote",
19
19
  render({ props, config, dimensions, measure, avatar, }) {
20
- const { width, height } = dimensions;
20
+ const { height } = dimensions;
21
21
  const { fontFamily, colors } = config;
22
22
  // The avatar goes on the attribution line rather than the footer, so as
23
23
  // far as the frame is concerned there is none.
@@ -54,7 +54,7 @@ export const quoteTemplate = {
54
54
  return (quoteMark(markSlot, markFs, fontFamily, colors.brandWarm) +
55
55
  body +
56
56
  speaker(said, saidSlot, saidFs, config, avatar, measure) +
57
- footerLine(config, frame, width, undefined, measure, "middle", 0.7));
57
+ footerLine(config, frame, undefined, measure, "middle", 0.7));
58
58
  },
59
59
  };
60
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/quote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,WA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IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;YACrC,UAAU;YACV,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,UAAU;YACV,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;QAEH,OAAO,CACL,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC;YACzD,IAAI;YACJ,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;YACxD,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAC7D,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -18,11 +18,11 @@ const lineHeight = 1.2;
18
18
  export const releaseTemplate = {
19
19
  name: "release",
20
20
  render({ props, config, dimensions, measure, logo, avatar, }) {
21
- const { width, height } = dimensions;
21
+ const { height } = dimensions;
22
22
  const { fontFamily, colors } = config;
23
23
  const frame = imageFrame(dimensions, config, avatar);
24
24
  const { pad } = frame;
25
- const mark = logoRect(logo, dimensions, pad, "start");
25
+ const mark = logoRect(logo, frame.full, pad, "start");
26
26
  const area = contentArea(frame, markRoom(mark?.height, Math.round(height * 0.03)));
27
27
  const lines = releaseLines(props, {
28
28
  measure,
@@ -48,7 +48,7 @@ export const releaseTemplate = {
48
48
  lineHeight,
49
49
  });
50
50
  const list = changeBlock(changes, listSlot, changeFs, config, measure);
51
- const footer = footerLine(config, frame, width, avatar, measure);
51
+ const footer = footerLine(config, frame, avatar, measure);
52
52
  return logoElement(logo, mark) + head + list + footer;
53
53
  },
54
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/release/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,QAAQ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
  render({ props, config, dimensions, measure, logo, avatar, }) {
17
- const { width, height } = dimensions;
17
+ const { height } = dimensions;
18
18
  const frame = imageFrame(dimensions, config, avatar, {
19
19
  padScale: 0.09,
20
20
  });
21
21
  const { pad } = frame;
22
- const mark = logoRect(logo, dimensions, pad, "middle");
22
+ const mark = logoRect(logo, frame.full, pad, "middle");
23
23
  const area = contentArea(frame, markRoom(mark?.height, pad / 2));
24
24
  const lines = statLines(props, {
25
25
  measure,
@@ -36,7 +36,7 @@ export const statTemplate = {
36
36
  lineHeight: 1.15,
37
37
  anchor: "middle",
38
38
  });
39
- const footer = footerLine(config, frame, width, avatar, measure, "middle");
39
+ const footer = footerLine(config, frame, avatar, measure, "middle");
40
40
  return logoElement(logo, mark) + body + footer;
41
41
  },
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/stat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,IAAI,EAAE,MAAM;IACZ,MAAM,CAAC,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,IAAI,EACJ,MAAM,GACU;QAChB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACrC,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;YACnD,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,MAAM,EAAE,GAAG,EAAE,GAAG,K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AAM,CAAC,MAAM,CAAC,UAAU;YAC9B,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAEpE,OAAO,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC;IACjD,CAAC;CACF,CAAC"}
@@ -30,10 +30,10 @@ const padScale = 0.055;
30
30
  export const thumbnailTemplate = {
31
31
  name: "thumbnail",
32
32
  render({ props, config, dimensions, measure, logo, avatar, }) {
33
- const { width, height } = dimensions;
33
+ const { height } = dimensions;
34
34
  const frame = imageFrame(dimensions, config, avatar, { padScale });
35
35
  const { pad } = frame;
36
- const mark = logoRect(logo, dimensions, pad, "middle");
36
+ const mark = logoRect(logo, frame.full, pad, "middle");
37
37
  const area = contentArea(frame, markRoom(mark?.height, pad / 2));
38
38
  const text = {
39
39
  measure,
@@ -62,7 +62,7 @@ export const thumbnailTemplate = {
62
62
  ...style,
63
63
  lineHeight: subtitleLineHeight,
64
64
  }) +
65
- footerLine(config, frame, width, avatar, measure, "middle"));
65
+ footerLine(config, frame, avatar, measure, "middle"));
66
66
  },
67
67
  };
68
68
  //# sourceMappingURL=index.js.map