@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.
- package/dist/cjs/templates/ribbons/RibbonType93.js +1 -1
- package/dist/cjs/templates/ribbons/RibbonType93_1.js +2 -2
- package/dist/cjs/utils/generateAchievementHTML.js +16 -2
- package/dist/esm/templates/ribbons/RibbonType93.js +1 -1
- package/dist/esm/templates/ribbons/RibbonType93_1.js +2 -2
- package/dist/esm/utils/generateAchievementHTML.js +16 -2
- package/package.json +1 -1
- package/src/templates/ribbons/RibbonType93.ts +1 -1
- package/src/templates/ribbons/RibbonType93_1.ts +4 -4
- package/src/utils/generateAchievementHTML.ts +20 -2
|
@@ -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"
|
|
144
|
-
|
|
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") {
|
|
@@ -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"
|
|
144
|
-
|
|
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,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: ${
|
|
196
|
-
|
|
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
|
|