@blockspoon/cert-badge-renderer 1.0.42 → 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.
@@ -83,7 +83,7 @@ function createRibbonType93({ mainColor = "#96A6B4", subColor = "#96A6B4", }) {
83
83
  </g>
84
84
  <defs>
85
85
  <linearGradient
86
- id={paintId0}
86
+ id="${paintId0}"
87
87
  x1="0.0302734"
88
88
  y1="51.0132"
89
89
  x2="462.03"
@@ -33,7 +33,7 @@ function createRibbonType93_1({ mainColor = "#96A6B4", subColor = "#96A6B4", })
33
33
  />
34
34
  <defs>
35
35
  <linearGradient
36
- id={paintId0}
36
+ id="${paintId0}"
37
37
  x1="0.0353567"
38
38
  y1="53.8844"
39
39
  x2="230.95"
@@ -46,7 +46,7 @@ function createRibbonType93_1({ mainColor = "#96A6B4", subColor = "#96A6B4", })
46
46
  <stop offset="1" stop-color="${mainColor}" />
47
47
  </linearGradient>
48
48
  <linearGradient
49
- id={paintId1}
49
+ id="${paintId1}"
50
50
  x1="342.889"
51
51
  y1="51.2318"
52
52
  x2="573.804"
@@ -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") {
@@ -83,7 +83,7 @@ function createRibbonType93({ mainColor = "#96A6B4", subColor = "#96A6B4", }) {
83
83
  </g>
84
84
  <defs>
85
85
  <linearGradient
86
- id={paintId0}
86
+ id="${paintId0}"
87
87
  x1="0.0302734"
88
88
  y1="51.0132"
89
89
  x2="462.03"
@@ -33,7 +33,7 @@ function createRibbonType93_1({ mainColor = "#96A6B4", subColor = "#96A6B4", })
33
33
  />
34
34
  <defs>
35
35
  <linearGradient
36
- id={paintId0}
36
+ id="${paintId0}"
37
37
  x1="0.0353567"
38
38
  y1="53.8844"
39
39
  x2="230.95"
@@ -46,7 +46,7 @@ function createRibbonType93_1({ mainColor = "#96A6B4", subColor = "#96A6B4", })
46
46
  <stop offset="1" stop-color="${mainColor}" />
47
47
  </linearGradient>
48
48
  <linearGradient
49
- id={paintId1}
49
+ id="${paintId1}"
50
50
  x1="342.889"
51
51
  y1="51.2318"
52
52
  x2="573.804"
@@ -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.42",
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": {
@@ -86,7 +86,7 @@ export function createRibbonType93({
86
86
  </g>
87
87
  <defs>
88
88
  <linearGradient
89
- id={paintId0}
89
+ id="${paintId0}"
90
90
  x1="0.0302734"
91
91
  y1="51.0132"
92
92
  x2="462.03"
@@ -1,4 +1,4 @@
1
- import { ISvgProps } from "../../interface/index.js";
1
+ import { ISvgProps } from "../../interface/index.js";
2
2
 
3
3
  export function createRibbonType93_1({
4
4
  mainColor = "#96A6B4",
@@ -36,7 +36,7 @@ export function createRibbonType93_1({
36
36
  />
37
37
  <defs>
38
38
  <linearGradient
39
- id={paintId0}
39
+ id="${paintId0}"
40
40
  x1="0.0353567"
41
41
  y1="53.8844"
42
42
  x2="230.95"
@@ -49,7 +49,7 @@ export function createRibbonType93_1({
49
49
  <stop offset="1" stop-color="${mainColor}" />
50
50
  </linearGradient>
51
51
  <linearGradient
52
- id={paintId1}
52
+ id="${paintId1}"
53
53
  x1="342.889"
54
54
  y1="51.2318"
55
55
  x2="573.804"
@@ -64,4 +64,4 @@ export function createRibbonType93_1({
64
64
  </defs>
65
65
  </svg>
66
66
  `;
67
- }
67
+ }
@@ -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