@blockspoon/cert-badge-renderer 1.0.43 → 1.0.44

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.
@@ -140,8 +140,22 @@ async function generateAchievementHTML(achievementInfo, options = {}) {
140
140
  : element.textAlign === "left"
141
141
  ? "flex-start"
142
142
  : "flex-end"};
143
- word-break: ${type === "badge" ? "break-word" : "normal"};
144
- white-space: ${type === "badge" ? "pre" : "normal"};
143
+ word-break: ${type === "badge" ||
144
+ (element.controlType === "text" &&
145
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.TEXT) ||
146
+ (element.controlType === "text" &&
147
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.PROPS &&
148
+ element.bindingKey === "description")
149
+ ? "break-word"
150
+ : "normal"};
151
+ white-space: ${type === "badge" ||
152
+ (element.controlType === "text" &&
153
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.TEXT) ||
154
+ (element.controlType === "text" &&
155
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.PROPS &&
156
+ element.bindingKey === "description")
157
+ ? "pre-wrap"
158
+ : "normal"};
145
159
  opacity: ${element.opacity || 1};
146
160
  `;
147
161
  if (element.controlType === "svg") {
@@ -140,8 +140,22 @@ async function generateAchievementHTML(achievementInfo, options = {}) {
140
140
  : element.textAlign === "left"
141
141
  ? "flex-start"
142
142
  : "flex-end"};
143
- word-break: ${type === "badge" ? "break-word" : "normal"};
144
- white-space: ${type === "badge" ? "pre" : "normal"};
143
+ word-break: ${type === "badge" ||
144
+ (element.controlType === "text" &&
145
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.TEXT) ||
146
+ (element.controlType === "text" &&
147
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.PROPS &&
148
+ element.bindingKey === "description")
149
+ ? "break-word"
150
+ : "normal"};
151
+ white-space: ${type === "badge" ||
152
+ (element.controlType === "text" &&
153
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.TEXT) ||
154
+ (element.controlType === "text" &&
155
+ element.designType === index_js_1.CERTIFICATE_DESIGN_TYPE.PROPS &&
156
+ element.bindingKey === "description")
157
+ ? "pre-wrap"
158
+ : "normal"};
145
159
  opacity: ${element.opacity || 1};
146
160
  `;
147
161
  if (element.controlType === "svg") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockspoon/cert-badge-renderer",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "Render certificate and badge designs from Kolleges achievement data into HTML, PNG, or Base64.",
5
5
  "main": "./dist/esm/index.js",
6
6
  "exports": {
@@ -192,8 +192,26 @@ export async function generateAchievementHTML(
192
192
  ? "flex-start"
193
193
  : "flex-end"
194
194
  };
195
- word-break: ${type === "badge" ? "break-word" : "normal"};
196
- white-space: ${type === "badge" ? "pre" : "normal"};
195
+ word-break: ${
196
+ type === "badge" ||
197
+ (element.controlType === "text" &&
198
+ element.designType === CERTIFICATE_DESIGN_TYPE.TEXT) ||
199
+ (element.controlType === "text" &&
200
+ element.designType === CERTIFICATE_DESIGN_TYPE.PROPS &&
201
+ element.bindingKey === "description")
202
+ ? "break-word"
203
+ : "normal"
204
+ };
205
+ white-space: ${
206
+ type === "badge" ||
207
+ (element.controlType === "text" &&
208
+ element.designType === CERTIFICATE_DESIGN_TYPE.TEXT) ||
209
+ (element.controlType === "text" &&
210
+ element.designType === CERTIFICATE_DESIGN_TYPE.PROPS &&
211
+ element.bindingKey === "description")
212
+ ? "pre-wrap"
213
+ : "normal"
214
+ };
197
215
  opacity: ${element.opacity || 1};
198
216
  `;
199
217