keycloakify 11.3.28 → 11.3.30

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.
@@ -9,8 +9,19 @@ export function createUseI18n(params) {
9
9
  const cache = new WeakMap();
10
10
  function renderHtmlString(params) {
11
11
  const { htmlString, msgKey } = params;
12
- return (_jsx("div", { "data-kc-msg": msgKey, dangerouslySetInnerHTML: {
13
- __html: kcSanitize(htmlString)
12
+ const htmlString_sanitized = kcSanitize(htmlString);
13
+ const Element = (() => {
14
+ if (htmlString_sanitized.includes("<") && htmlString_sanitized.includes(">")) {
15
+ for (const tagName of ["div", "section", "article", "ul", "ol"]) {
16
+ if (htmlString_sanitized.includes(`<${tagName}`)) {
17
+ return "div";
18
+ }
19
+ }
20
+ }
21
+ return "span";
22
+ })();
23
+ return (_jsx(Element, { "data-kc-msg": msgKey, dangerouslySetInnerHTML: {
24
+ __html: htmlString_sanitized
14
25
  } }));
15
26
  }
16
27
  function withJsx(i18n_noJsx) {
@@ -28,14 +39,14 @@ export function createUseI18n(params) {
28
39
  return { withJsx };
29
40
  })();
30
41
  add_style: {
31
- const attributeName = "data-kc-i18n";
42
+ const attributeName = "data-kc-msg";
32
43
  // Check if already exists in head
33
44
  if (document.querySelector(`style[${attributeName}]`) !== null) {
34
45
  break add_style;
35
46
  }
36
47
  const styleElement = document.createElement("style");
37
48
  styleElement.attributes.setNamedItem(document.createAttribute(attributeName));
38
- styleElement.textContent = `[data-kc-msg] { display: inline-block; }`;
49
+ styleElement.textContent = `div[${attributeName}] { display: inline-block; }`;
39
50
  document.head.prepend(styleElement);
40
51
  }
41
52
  const { getI18n } = createGetI18n({ extraLanguageTranslations, messagesByLanguageTag_themeDefined });
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.js","sourceRoot":"","sources":["../../../src/account/i18n/withJsx/useI18n.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;A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_module, __webpack_exports__, __webpack_require__) => {
333
-
334
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
335
- /* harmony export */ "h": () => (/* binding */ SemVer)
336
- /* harmony export */ });
337
- var SemVer;
338
- (function (SemVer) {
339
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
340
- function parse(versionStr) {
341
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
342
- if (!match) {
343
- throw new Error(`${versionStr} is not a valid semantic version`);
344
- }
345
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
346
- const str = match[3];
347
- return str === undefined ? 0 : parseInt(str);
348
- })() }, (() => {
349
- const str = match[4];
350
- return str === undefined ? {} : { rc: parseInt(str) };
351
- })());
352
- const initialStr = stringify(semVer);
353
- Object.defineProperty(semVer, "parsedFrom", {
354
- enumerable: true,
355
- get: function () {
356
- const currentStr = stringify(this);
357
- if (currentStr !== initialStr) {
358
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
359
- }
360
- return versionStr;
361
- }
362
- });
363
- return semVer;
364
- }
365
- SemVer.parse = parse;
366
- function stringify(v) {
367
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
368
- }
369
- SemVer.stringify = stringify;
370
- /**
371
- *
372
- * v1 < v2 => -1
373
- * v1 === v2 => 0
374
- * v1 > v2 => 1
375
- *
376
- */
377
- function compare(v1, v2) {
378
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
379
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
380
- for (const level of ["major", "minor", "patch", "rc"]) {
381
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
382
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
383
- }
384
- }
385
- return 0;
386
- }
387
- SemVer.compare = compare;
388
- /*
389
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
390
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
391
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
392
- */
393
- function bumpType(params) {
394
- const versionAhead = typeof params.versionAhead === "string"
395
- ? parse(params.versionAhead)
396
- : params.versionAhead;
397
- const versionBehind = typeof params.versionBehind === "string"
398
- ? parse(params.versionBehind)
399
- : params.versionBehind;
400
- if (compare(versionBehind, versionAhead) === 1) {
401
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
402
- }
403
- for (const level of ["major", "minor", "patch", "rc"]) {
404
- if (versionBehind[level] !== versionAhead[level]) {
405
- return level;
406
- }
407
- }
408
- return "no bump";
409
- }
410
- SemVer.bumpType = bumpType;
411
- })(SemVer || (SemVer = {}));
412
- //# sourceMappingURL=SemVer.js.map
413
-
414
- /***/ }),
415
-
416
331
  /***/ 38367:
417
332
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
418
333
 
package/bin/40.index.js CHANGED
@@ -155,91 +155,6 @@ function maybeDelegateCommandToCustomHandler(params) {
155
155
 
156
156
  /***/ }),
157
157
 
158
- /***/ 12171:
159
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
160
-
161
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
162
- /* harmony export */ "h": () => (/* binding */ SemVer)
163
- /* harmony export */ });
164
- var SemVer;
165
- (function (SemVer) {
166
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
167
- function parse(versionStr) {
168
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
169
- if (!match) {
170
- throw new Error(`${versionStr} is not a valid semantic version`);
171
- }
172
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
173
- const str = match[3];
174
- return str === undefined ? 0 : parseInt(str);
175
- })() }, (() => {
176
- const str = match[4];
177
- return str === undefined ? {} : { rc: parseInt(str) };
178
- })());
179
- const initialStr = stringify(semVer);
180
- Object.defineProperty(semVer, "parsedFrom", {
181
- enumerable: true,
182
- get: function () {
183
- const currentStr = stringify(this);
184
- if (currentStr !== initialStr) {
185
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
186
- }
187
- return versionStr;
188
- }
189
- });
190
- return semVer;
191
- }
192
- SemVer.parse = parse;
193
- function stringify(v) {
194
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
195
- }
196
- SemVer.stringify = stringify;
197
- /**
198
- *
199
- * v1 < v2 => -1
200
- * v1 === v2 => 0
201
- * v1 > v2 => 1
202
- *
203
- */
204
- function compare(v1, v2) {
205
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
206
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
207
- for (const level of ["major", "minor", "patch", "rc"]) {
208
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
209
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
210
- }
211
- }
212
- return 0;
213
- }
214
- SemVer.compare = compare;
215
- /*
216
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
217
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
218
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
219
- */
220
- function bumpType(params) {
221
- const versionAhead = typeof params.versionAhead === "string"
222
- ? parse(params.versionAhead)
223
- : params.versionAhead;
224
- const versionBehind = typeof params.versionBehind === "string"
225
- ? parse(params.versionBehind)
226
- : params.versionBehind;
227
- if (compare(versionBehind, versionAhead) === 1) {
228
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
229
- }
230
- for (const level of ["major", "minor", "patch", "rc"]) {
231
- if (versionBehind[level] !== versionAhead[level]) {
232
- return level;
233
- }
234
- }
235
- return "no bump";
236
- }
237
- SemVer.bumpType = bumpType;
238
- })(SemVer || (SemVer = {}));
239
- //# sourceMappingURL=SemVer.js.map
240
-
241
- /***/ }),
242
-
243
158
  /***/ 89693:
244
159
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
245
160
 
package/bin/573.index.js CHANGED
@@ -1529,91 +1529,6 @@ async function command(params) {
1529
1529
 
1530
1530
  /***/ }),
1531
1531
 
1532
- /***/ 12171:
1533
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1534
-
1535
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1536
- /* harmony export */ "h": () => (/* binding */ SemVer)
1537
- /* harmony export */ });
1538
- var SemVer;
1539
- (function (SemVer) {
1540
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
1541
- function parse(versionStr) {
1542
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
1543
- if (!match) {
1544
- throw new Error(`${versionStr} is not a valid semantic version`);
1545
- }
1546
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
1547
- const str = match[3];
1548
- return str === undefined ? 0 : parseInt(str);
1549
- })() }, (() => {
1550
- const str = match[4];
1551
- return str === undefined ? {} : { rc: parseInt(str) };
1552
- })());
1553
- const initialStr = stringify(semVer);
1554
- Object.defineProperty(semVer, "parsedFrom", {
1555
- enumerable: true,
1556
- get: function () {
1557
- const currentStr = stringify(this);
1558
- if (currentStr !== initialStr) {
1559
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
1560
- }
1561
- return versionStr;
1562
- }
1563
- });
1564
- return semVer;
1565
- }
1566
- SemVer.parse = parse;
1567
- function stringify(v) {
1568
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
1569
- }
1570
- SemVer.stringify = stringify;
1571
- /**
1572
- *
1573
- * v1 < v2 => -1
1574
- * v1 === v2 => 0
1575
- * v1 > v2 => 1
1576
- *
1577
- */
1578
- function compare(v1, v2) {
1579
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
1580
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
1581
- for (const level of ["major", "minor", "patch", "rc"]) {
1582
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
1583
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
1584
- }
1585
- }
1586
- return 0;
1587
- }
1588
- SemVer.compare = compare;
1589
- /*
1590
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
1591
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
1592
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
1593
- */
1594
- function bumpType(params) {
1595
- const versionAhead = typeof params.versionAhead === "string"
1596
- ? parse(params.versionAhead)
1597
- : params.versionAhead;
1598
- const versionBehind = typeof params.versionBehind === "string"
1599
- ? parse(params.versionBehind)
1600
- : params.versionBehind;
1601
- if (compare(versionBehind, versionAhead) === 1) {
1602
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
1603
- }
1604
- for (const level of ["major", "minor", "patch", "rc"]) {
1605
- if (versionBehind[level] !== versionAhead[level]) {
1606
- return level;
1607
- }
1608
- }
1609
- return "no bump";
1610
- }
1611
- SemVer.bumpType = bumpType;
1612
- })(SemVer || (SemVer = {}));
1613
- //# sourceMappingURL=SemVer.js.map
1614
-
1615
- /***/ }),
1616
-
1617
1532
  /***/ 27190:
1618
1533
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1619
1534
 
package/bin/653.index.js CHANGED
@@ -250,91 +250,6 @@ async function command(params) {
250
250
 
251
251
  /***/ }),
252
252
 
253
- /***/ 12171:
254
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
255
-
256
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
257
- /* harmony export */ "h": () => (/* binding */ SemVer)
258
- /* harmony export */ });
259
- var SemVer;
260
- (function (SemVer) {
261
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
262
- function parse(versionStr) {
263
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
264
- if (!match) {
265
- throw new Error(`${versionStr} is not a valid semantic version`);
266
- }
267
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
268
- const str = match[3];
269
- return str === undefined ? 0 : parseInt(str);
270
- })() }, (() => {
271
- const str = match[4];
272
- return str === undefined ? {} : { rc: parseInt(str) };
273
- })());
274
- const initialStr = stringify(semVer);
275
- Object.defineProperty(semVer, "parsedFrom", {
276
- enumerable: true,
277
- get: function () {
278
- const currentStr = stringify(this);
279
- if (currentStr !== initialStr) {
280
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
281
- }
282
- return versionStr;
283
- }
284
- });
285
- return semVer;
286
- }
287
- SemVer.parse = parse;
288
- function stringify(v) {
289
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
290
- }
291
- SemVer.stringify = stringify;
292
- /**
293
- *
294
- * v1 < v2 => -1
295
- * v1 === v2 => 0
296
- * v1 > v2 => 1
297
- *
298
- */
299
- function compare(v1, v2) {
300
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
301
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
302
- for (const level of ["major", "minor", "patch", "rc"]) {
303
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
304
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
305
- }
306
- }
307
- return 0;
308
- }
309
- SemVer.compare = compare;
310
- /*
311
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
312
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
313
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
314
- */
315
- function bumpType(params) {
316
- const versionAhead = typeof params.versionAhead === "string"
317
- ? parse(params.versionAhead)
318
- : params.versionAhead;
319
- const versionBehind = typeof params.versionBehind === "string"
320
- ? parse(params.versionBehind)
321
- : params.versionBehind;
322
- if (compare(versionBehind, versionAhead) === 1) {
323
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
324
- }
325
- for (const level of ["major", "minor", "patch", "rc"]) {
326
- if (versionBehind[level] !== versionAhead[level]) {
327
- return level;
328
- }
329
- }
330
- return "no bump";
331
- }
332
- SemVer.bumpType = bumpType;
333
- })(SemVer || (SemVer = {}));
334
- //# sourceMappingURL=SemVer.js.map
335
-
336
- /***/ }),
337
-
338
253
  /***/ 89693:
339
254
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
340
255
 
package/bin/735.index.js CHANGED
@@ -402,91 +402,6 @@ async function getLatestsSemVersionedTag(_a) {
402
402
 
403
403
  /***/ }),
404
404
 
405
- /***/ 12171:
406
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
407
-
408
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
409
- /* harmony export */ "h": () => (/* binding */ SemVer)
410
- /* harmony export */ });
411
- var SemVer;
412
- (function (SemVer) {
413
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
414
- function parse(versionStr) {
415
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
416
- if (!match) {
417
- throw new Error(`${versionStr} is not a valid semantic version`);
418
- }
419
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
420
- const str = match[3];
421
- return str === undefined ? 0 : parseInt(str);
422
- })() }, (() => {
423
- const str = match[4];
424
- return str === undefined ? {} : { rc: parseInt(str) };
425
- })());
426
- const initialStr = stringify(semVer);
427
- Object.defineProperty(semVer, "parsedFrom", {
428
- enumerable: true,
429
- get: function () {
430
- const currentStr = stringify(this);
431
- if (currentStr !== initialStr) {
432
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
433
- }
434
- return versionStr;
435
- }
436
- });
437
- return semVer;
438
- }
439
- SemVer.parse = parse;
440
- function stringify(v) {
441
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
442
- }
443
- SemVer.stringify = stringify;
444
- /**
445
- *
446
- * v1 < v2 => -1
447
- * v1 === v2 => 0
448
- * v1 > v2 => 1
449
- *
450
- */
451
- function compare(v1, v2) {
452
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
453
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
454
- for (const level of ["major", "minor", "patch", "rc"]) {
455
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
456
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
457
- }
458
- }
459
- return 0;
460
- }
461
- SemVer.compare = compare;
462
- /*
463
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
464
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
465
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
466
- */
467
- function bumpType(params) {
468
- const versionAhead = typeof params.versionAhead === "string"
469
- ? parse(params.versionAhead)
470
- : params.versionAhead;
471
- const versionBehind = typeof params.versionBehind === "string"
472
- ? parse(params.versionBehind)
473
- : params.versionBehind;
474
- if (compare(versionBehind, versionAhead) === 1) {
475
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
476
- }
477
- for (const level of ["major", "minor", "patch", "rc"]) {
478
- if (versionBehind[level] !== versionAhead[level]) {
479
- return level;
480
- }
481
- }
482
- return "no bump";
483
- }
484
- SemVer.bumpType = bumpType;
485
- })(SemVer || (SemVer = {}));
486
- //# sourceMappingURL=SemVer.js.map
487
-
488
- /***/ }),
489
-
490
405
  /***/ 89693:
491
406
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
492
407
 
package/bin/main.js CHANGED
@@ -87,6 +87,92 @@ const KEYCLOAK_THEME = "keycloak-theme";
87
87
 
88
88
  /***/ }),
89
89
 
90
+ /***/ 12171:
91
+ /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
92
+
93
+ "use strict";
94
+ /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
95
+ /* harmony export */ "h": () => (/* binding */ SemVer)
96
+ /* harmony export */ });
97
+ var SemVer;
98
+ (function (SemVer) {
99
+ const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
100
+ function parse(versionStr) {
101
+ const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
102
+ if (!match) {
103
+ throw new Error(`${versionStr} is not a valid semantic version`);
104
+ }
105
+ const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
106
+ const str = match[3];
107
+ return str === undefined ? 0 : parseInt(str);
108
+ })() }, (() => {
109
+ const str = match[4];
110
+ return str === undefined ? {} : { rc: parseInt(str) };
111
+ })());
112
+ const initialStr = stringify(semVer);
113
+ Object.defineProperty(semVer, "parsedFrom", {
114
+ enumerable: true,
115
+ get: function () {
116
+ const currentStr = stringify(this);
117
+ if (currentStr !== initialStr) {
118
+ throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
119
+ }
120
+ return versionStr;
121
+ }
122
+ });
123
+ return semVer;
124
+ }
125
+ SemVer.parse = parse;
126
+ function stringify(v) {
127
+ return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
128
+ }
129
+ SemVer.stringify = stringify;
130
+ /**
131
+ *
132
+ * v1 < v2 => -1
133
+ * v1 === v2 => 0
134
+ * v1 > v2 => 1
135
+ *
136
+ */
137
+ function compare(v1, v2) {
138
+ const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
139
+ const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
140
+ for (const level of ["major", "minor", "patch", "rc"]) {
141
+ if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
142
+ return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
143
+ }
144
+ }
145
+ return 0;
146
+ }
147
+ SemVer.compare = compare;
148
+ /*
149
+ console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
150
+ console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
151
+ console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
152
+ */
153
+ function bumpType(params) {
154
+ const versionAhead = typeof params.versionAhead === "string"
155
+ ? parse(params.versionAhead)
156
+ : params.versionAhead;
157
+ const versionBehind = typeof params.versionBehind === "string"
158
+ ? parse(params.versionBehind)
159
+ : params.versionBehind;
160
+ if (compare(versionBehind, versionAhead) === 1) {
161
+ throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
162
+ }
163
+ for (const level of ["major", "minor", "patch", "rc"]) {
164
+ if (versionBehind[level] !== versionAhead[level]) {
165
+ return level;
166
+ }
167
+ }
168
+ return "no bump";
169
+ }
170
+ SemVer.bumpType = bumpType;
171
+ })(SemVer || (SemVer = {}));
172
+ //# sourceMappingURL=SemVer.js.map
173
+
174
+ /***/ }),
175
+
90
176
  /***/ 73036:
91
177
  /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
92
178
 
@@ -16095,12 +16181,17 @@ function getBuildContext(params) {
16095
16181
  };
16096
16182
  }
16097
16183
  //# sourceMappingURL=buildContext.js.map
16184
+ // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
16185
+ var SemVer = __nccwpck_require__(12171);
16098
16186
  ;// CONCATENATED MODULE: ./dist/bin/main.js
16099
16187
 
16100
16188
 
16101
16189
 
16102
16190
 
16103
16191
 
16192
+
16193
+
16194
+
16104
16195
  assertNoPnpmDlx();
16105
16196
  const program = Z({
16106
16197
  name: "keycloakify",
@@ -16193,9 +16284,39 @@ program
16193
16284
  skip,
16194
16285
  handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
16195
16286
  const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(805), __nccwpck_require__.e(450), __nccwpck_require__.e(33), __nccwpck_require__.e(36), __nccwpck_require__.e(20), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
16287
+ validate_keycloak_version: {
16288
+ if (keycloakVersion === undefined) {
16289
+ break validate_keycloak_version;
16290
+ }
16291
+ const isValidVersion = (() => {
16292
+ if (typeof keycloakVersion === "number") {
16293
+ return false;
16294
+ }
16295
+ try {
16296
+ SemVer/* SemVer.parse */.h.parse(keycloakVersion);
16297
+ }
16298
+ catch (_a) {
16299
+ return false;
16300
+ }
16301
+ return;
16302
+ })();
16303
+ if (isValidVersion) {
16304
+ break validate_keycloak_version;
16305
+ }
16306
+ console.log(source_default().red([
16307
+ `Invalid Keycloak version: ${keycloakVersion}`,
16308
+ "It should be a valid semver version example: 26.0.4"
16309
+ ].join(" ")));
16310
+ process.exit(1);
16311
+ }
16312
+ (0,assert/* assert */.h)((0,assert.is)(keycloakVersion));
16196
16313
  await command({
16197
16314
  buildContext: getBuildContext({ projectDirPath }),
16198
- cliCommandOptions: { keycloakVersion, port, realmJsonFilePath }
16315
+ cliCommandOptions: {
16316
+ keycloakVersion,
16317
+ port,
16318
+ realmJsonFilePath
16319
+ }
16199
16320
  });
16200
16321
  }
16201
16322
  });
@@ -9,8 +9,19 @@ export function createUseI18n(params) {
9
9
  const cache = new WeakMap();
10
10
  function renderHtmlString(params) {
11
11
  const { htmlString, msgKey } = params;
12
- return (_jsx("div", { "data-kc-msg": msgKey, dangerouslySetInnerHTML: {
13
- __html: kcSanitize(htmlString)
12
+ const htmlString_sanitized = kcSanitize(htmlString);
13
+ const Element = (() => {
14
+ if (htmlString_sanitized.includes("<") && htmlString_sanitized.includes(">")) {
15
+ for (const tagName of ["div", "section", "article", "ul", "ol"]) {
16
+ if (htmlString_sanitized.includes(`<${tagName}`)) {
17
+ return "div";
18
+ }
19
+ }
20
+ }
21
+ return "span";
22
+ })();
23
+ return (_jsx(Element, { "data-kc-msg": msgKey, dangerouslySetInnerHTML: {
24
+ __html: htmlString_sanitized
14
25
  } }));
15
26
  }
16
27
  function withJsx(i18n_noJsx) {
@@ -28,14 +39,14 @@ export function createUseI18n(params) {
28
39
  return { withJsx };
29
40
  })();
30
41
  add_style: {
31
- const attributeName = "data-kc-i18n";
42
+ const attributeName = "data-kc-msg";
32
43
  // Check if already exists in head
33
44
  if (document.querySelector(`style[${attributeName}]`) !== null) {
34
45
  break add_style;
35
46
  }
36
47
  const styleElement = document.createElement("style");
37
48
  styleElement.attributes.setNamedItem(document.createAttribute(attributeName));
38
- styleElement.textContent = `[data-kc-msg] { display: inline-block; }`;
49
+ styleElement.textContent = `div[${attributeName}] { display: inline-block; }`;
39
50
  document.head.prepend(styleElement);
40
51
  }
41
52
  const { getI18n } = createGetI18n({ extraLanguageTranslations, messagesByLanguageTag_themeDefined });
@@ -1 +1 @@
1
- {"version":3,"file":"useI18n.js","sourceRoot":"","sources":["../../../src/login/i18n/withJsx/useI18n.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAaxC,MAAM,UAAU,aAAa,CAI3B,MAYD;IACG,MAAM,EAAE,yBAAyB,EAAE,kCAAkC,EAAE,GAAG,MAA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G,aAAa,CAAC,EAAE,yBAAyB,EAAE,kCAAkC,EAAE,CAAC,CAAC;IAErG,SAAS,OAAO,CAAC,MAAoC;QACjD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE7B,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QAEhE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAExE,SAAS,CAAC,GAAG,EAAE;YACX,IAAI,QAAQ,GAAG,IAAI,CAAC;YAEpB,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,IAAI,CAAC,IAAI,CAAC,EAAE;gBAChC,IAAI,CAAC,QAAQ,EAAE;oBACX,OAAO;iBACV;gBAED,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,OAAO,GAAG,EAAE;gBACR,QAAQ,GAAG,KAAK,CAAC;YACrB,CAAC,CAAC;QACN,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAQ,EAAE,CAAC;AACpD,CAAC"}
@@ -9,7 +9,7 @@ export default function LoginConfigTotp(props) {
9
9
  });
10
10
  const { url, isAppInitiatedAction, totp, mode, messagesPerField } = kcContext;
11
11
  const { msg, msgStr, advancedMsg } = i18n;
12
- return (_jsx(Template, Object.assign({ kcContext: kcContext, i18n: i18n, doUseDefaultCss: doUseDefaultCss, classes: classes, headerNode: msg("loginTotpTitle"), displayMessage: !messagesPerField.existsError("totp", "userLabel") }, { children: _jsxs(_Fragment, { children: [_jsxs("ol", Object.assign({ id: "kc-totp-settings" }, { children: [_jsxs("li", { children: [_jsx("p", { children: msg("loginTotpStep1") }), _jsx("ul", Object.assign({ id: "kc-totp-supported-apps" }, { children: totp.supportedApplications.map(app => (_jsx("li", { children: advancedMsg(app) }, app))) }))] }), mode == "manual" ? (_jsxs(_Fragment, { children: [_jsxs("li", { children: [_jsx("p", { children: msg("loginTotpManualStep2") }), _jsx("p", { children: _jsx("span", Object.assign({ id: "kc-totp-secret-key" }, { children: totp.totpSecretEncoded })) }), _jsx("p", { children: _jsx("a", Object.assign({ href: totp.qrUrl, id: "mode-barcode" }, { children: msg("loginTotpScanBarcode") })) })] }), _jsxs("li", { children: [_jsx("p", { children: msg("loginTotpManualStep3") }), _jsx("p", { children: _jsxs("ul", { children: [_jsxs("li", Object.assign({ id: "kc-totp-type" }, { children: [msg("loginTotpType"), ": ", msg(`loginTotp.${totp.policy.type}`)] })), _jsxs("li", Object.assign({ id: "kc-totp-algorithm" }, { children: [msg("loginTotpAlgorithm"), ": ", totp.policy.getAlgorithmKey()] })), _jsxs("li", Object.assign({ id: "kc-totp-digits" }, { children: [msg("loginTotpDigits"), ": ", totp.policy.digits] })), totp.policy.type === "totp" ? (_jsxs("li", Object.assign({ id: "kc-totp-period" }, { children: [msg("loginTotpInterval"), ": ", totp.policy.period] }))) : (_jsxs("li", Object.assign({ id: "kc-totp-counter" }, { children: [msg("loginTotpCounter"), ": ", totp.policy.initialCounter] })))] }) })] })] })) : (_jsxs("li", { children: [_jsx("p", { children: msg("loginTotpStep2") }), _jsx("img", { id: "kc-totp-secret-qr-code", src: `data:image/png;base64, ${totp.totpSecretQrCode}`, alt: "Figure: Barcode" }), _jsx("br", {}), _jsx("p", { children: _jsx("a", Object.assign({ href: totp.manualUrl, id: "mode-manual" }, { children: msg("loginTotpUnableToScan") })) })] })), _jsxs("li", { children: [_jsx("p", { children: msg("loginTotpStep3") }), _jsx("p", { children: msg("loginTotpStep3DeviceName") })] })] })), _jsxs("form", Object.assign({ action: url.loginAction, className: kcClsx("kcFormClass"), id: "kc-totp-settings-form", method: "post" }, { children: [_jsxs("div", Object.assign({ className: kcClsx("kcFormGroupClass") }, { children: [_jsxs("div", Object.assign({ className: kcClsx("kcInputWrapperClass") }, { children: [_jsx("label", Object.assign({ htmlFor: "totp", className: kcClsx("kcLabelClass") }, { children: msg("authenticatorCode") })), " ", _jsx("span", Object.assign({ className: "required" }, { children: "*" }))] })), _jsxs("div", Object.assign({ className: kcClsx("kcInputWrapperClass") }, { children: [_jsx("input", { type: "text", id: "totp", name: "totp", autoComplete: "off", className: kcClsx("kcInputClass"), "aria-invalid": messagesPerField.existsError("totp") }), messagesPerField.existsError("totp") && (_jsx("span", { id: "input-error-otp-code", className: kcClsx("kcInputErrorMessageClass"), "aria-live": "polite", dangerouslySetInnerHTML: {
12
+ return (_jsx(Template, Object.assign({ kcContext: kcContext, i18n: i18n, doUseDefaultCss: doUseDefaultCss, classes: classes, headerNode: msg("loginTotpTitle"), displayMessage: !messagesPerField.existsError("totp", "userLabel") }, { children: _jsxs(_Fragment, { children: [_jsxs("ol", Object.assign({ id: "kc-totp-settings" }, { children: [_jsxs("li", { children: [_jsx("p", { children: msg("loginTotpStep1") }), _jsx("ul", Object.assign({ id: "kc-totp-supported-apps" }, { children: totp.supportedApplications.map(app => (_jsx("li", { children: advancedMsg(app) }, app))) }))] }), mode == "manual" ? (_jsxs(_Fragment, { children: [_jsxs("li", { children: [_jsx("p", { children: msg("loginTotpManualStep2") }), _jsx("p", { children: _jsx("span", Object.assign({ id: "kc-totp-secret-key" }, { children: totp.totpSecretEncoded })) }), _jsx("p", { children: _jsx("a", Object.assign({ href: totp.qrUrl, id: "mode-barcode" }, { children: msg("loginTotpScanBarcode") })) })] }), _jsxs("li", { children: [_jsx("p", { children: msg("loginTotpManualStep3") }), _jsxs("ul", { children: [_jsxs("li", Object.assign({ id: "kc-totp-type" }, { children: [msg("loginTotpType"), ": ", msg(`loginTotp.${totp.policy.type}`)] })), _jsxs("li", Object.assign({ id: "kc-totp-algorithm" }, { children: [msg("loginTotpAlgorithm"), ": ", totp.policy.getAlgorithmKey()] })), _jsxs("li", Object.assign({ id: "kc-totp-digits" }, { children: [msg("loginTotpDigits"), ": ", totp.policy.digits] })), totp.policy.type === "totp" ? (_jsxs("li", Object.assign({ id: "kc-totp-period" }, { children: [msg("loginTotpInterval"), ": ", totp.policy.period] }))) : (_jsxs("li", Object.assign({ id: "kc-totp-counter" }, { children: [msg("loginTotpCounter"), ": ", totp.policy.initialCounter] })))] })] })] })) : (_jsxs("li", { children: [_jsx("p", { children: msg("loginTotpStep2") }), _jsx("img", { id: "kc-totp-secret-qr-code", src: `data:image/png;base64, ${totp.totpSecretQrCode}`, alt: "Figure: Barcode" }), _jsx("br", {}), _jsx("p", { children: _jsx("a", Object.assign({ href: totp.manualUrl, id: "mode-manual" }, { children: msg("loginTotpUnableToScan") })) })] })), _jsxs("li", { children: [_jsx("p", { children: msg("loginTotpStep3") }), _jsx("p", { children: msg("loginTotpStep3DeviceName") })] })] })), _jsxs("form", Object.assign({ action: url.loginAction, className: kcClsx("kcFormClass"), id: "kc-totp-settings-form", method: "post" }, { children: [_jsxs("div", Object.assign({ className: kcClsx("kcFormGroupClass") }, { children: [_jsxs("div", Object.assign({ className: kcClsx("kcInputWrapperClass") }, { children: [_jsx("label", Object.assign({ htmlFor: "totp", className: kcClsx("kcLabelClass") }, { children: msg("authenticatorCode") })), " ", _jsx("span", Object.assign({ className: "required" }, { children: "*" }))] })), _jsxs("div", Object.assign({ className: kcClsx("kcInputWrapperClass") }, { children: [_jsx("input", { type: "text", id: "totp", name: "totp", autoComplete: "off", className: kcClsx("kcInputClass"), "aria-invalid": messagesPerField.existsError("totp") }), messagesPerField.existsError("totp") && (_jsx("span", { id: "input-error-otp-code", className: kcClsx("kcInputErrorMessageClass"), "aria-live": "polite", dangerouslySetInnerHTML: {
13
13
  __html: kcSanitize(messagesPerField.get("totp"))
14
14
  } }))] })), _jsx("input", { type: "hidden", id: "totpSecret", name: "totpSecret", value: totp.totpSecret }), mode && _jsx("input", { type: "hidden", id: "mode", value: mode })] })), _jsxs("div", Object.assign({ className: kcClsx("kcFormGroupClass") }, { children: [_jsxs("div", Object.assign({ className: kcClsx("kcInputWrapperClass") }, { children: [_jsx("label", Object.assign({ htmlFor: "userLabel", className: kcClsx("kcLabelClass") }, { children: msg("loginTotpDeviceName") })), " ", totp.otpCredentials.length >= 1 && _jsx("span", Object.assign({ className: "required" }, { children: "*" }))] })), _jsxs("div", Object.assign({ className: kcClsx("kcInputWrapperClass") }, { children: [_jsx("input", { type: "text", id: "userLabel", name: "userLabel", autoComplete: "off", className: kcClsx("kcInputClass"), "aria-invalid": messagesPerField.existsError("userLabel") }), messagesPerField.existsError("userLabel") && (_jsx("span", { id: "input-error-otp-label", className: kcClsx("kcInputErrorMessageClass"), "aria-live": "polite", dangerouslySetInnerHTML: {
15
15
  __html: kcSanitize(messagesPerField.get("userLabel"))
@@ -1 +1 @@
1
- {"version":3,"file":"LoginConfigTotp.js","sourceRoot":"","sources":["../../src/login/pages/LoginConfigTotp.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAKxD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAA+E;IACnH,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEtE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QACzB,eAAe;QACf,OAAO;KACV,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAC;IAE9E,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAE1C,OAAO,CACH,KAAC,QAAQ,kBACL,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,eA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C,KAAK,EAAC,IAAI,EAAC,cAAc,EAAE,IAAI,GAAI,EACrG,GAAG,CAAC,qBAAqB,CAAC,IACvB,IACN,IACJ,IACJ,CACT,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.3.28",
3
+ "version": "11.3.30",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,11 +47,25 @@ export function createUseI18n<
47
47
 
48
48
  function renderHtmlString(params: { htmlString: string; msgKey: string }): JSX.Element {
49
49
  const { htmlString, msgKey } = params;
50
+
51
+ const htmlString_sanitized = kcSanitize(htmlString);
52
+
53
+ const Element = (() => {
54
+ if (htmlString_sanitized.includes("<") && htmlString_sanitized.includes(">")) {
55
+ for (const tagName of ["div", "section", "article", "ul", "ol"]) {
56
+ if (htmlString_sanitized.includes(`<${tagName}`)) {
57
+ return "div";
58
+ }
59
+ }
60
+ }
61
+ return "span";
62
+ })();
63
+
50
64
  return (
51
- <div
65
+ <Element
52
66
  data-kc-msg={msgKey}
53
67
  dangerouslySetInnerHTML={{
54
- __html: kcSanitize(htmlString)
68
+ __html: htmlString_sanitized
55
69
  }}
56
70
  />
57
71
  );
@@ -83,7 +97,7 @@ export function createUseI18n<
83
97
  })();
84
98
 
85
99
  add_style: {
86
- const attributeName = "data-kc-i18n";
100
+ const attributeName = "data-kc-msg";
87
101
 
88
102
  // Check if already exists in head
89
103
  if (document.querySelector(`style[${attributeName}]`) !== null) {
@@ -92,7 +106,7 @@ export function createUseI18n<
92
106
 
93
107
  const styleElement = document.createElement("style");
94
108
  styleElement.attributes.setNamedItem(document.createAttribute(attributeName));
95
- styleElement.textContent = `[data-kc-msg] { display: inline-block; }`;
109
+ styleElement.textContent = `div[${attributeName}] { display: inline-block; }`;
96
110
  document.head.prepend(styleElement);
97
111
  }
98
112
 
package/src/bin/main.ts CHANGED
@@ -5,6 +5,9 @@ import { readThisNpmPackageVersion } from "./tools/readThisNpmPackageVersion";
5
5
  import * as child_process from "child_process";
6
6
  import { assertNoPnpmDlx } from "./tools/assertNoPnpmDlx";
7
7
  import { getBuildContext } from "./shared/buildContext";
8
+ import { SemVer } from "./tools/SemVer";
9
+ import { assert, is } from "tsafe/assert";
10
+ import chalk from "chalk";
8
11
 
9
12
  type CliCommandOptions = {
10
13
  projectDirPath: string | undefined;
@@ -80,7 +83,7 @@ program
80
83
  program
81
84
  .command<{
82
85
  port: number | undefined;
83
- keycloakVersion: string | undefined;
86
+ keycloakVersion: string | number | undefined;
84
87
  realmJsonFilePath: string | undefined;
85
88
  }>({
86
89
  name: "start-keycloak",
@@ -134,9 +137,50 @@ program
134
137
  handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
135
138
  const { command } = await import("./start-keycloak");
136
139
 
140
+ validate_keycloak_version: {
141
+ if (keycloakVersion === undefined) {
142
+ break validate_keycloak_version;
143
+ }
144
+
145
+ const isValidVersion = (() => {
146
+ if (typeof keycloakVersion === "number") {
147
+ return false;
148
+ }
149
+
150
+ try {
151
+ SemVer.parse(keycloakVersion);
152
+ } catch {
153
+ return false;
154
+ }
155
+
156
+ return;
157
+ })();
158
+
159
+ if (isValidVersion) {
160
+ break validate_keycloak_version;
161
+ }
162
+
163
+ console.log(
164
+ chalk.red(
165
+ [
166
+ `Invalid Keycloak version: ${keycloakVersion}`,
167
+ "It should be a valid semver version example: 26.0.4"
168
+ ].join(" ")
169
+ )
170
+ );
171
+
172
+ process.exit(1);
173
+ }
174
+
175
+ assert(is<string | undefined>(keycloakVersion));
176
+
137
177
  await command({
138
178
  buildContext: getBuildContext({ projectDirPath }),
139
- cliCommandOptions: { keycloakVersion, port, realmJsonFilePath }
179
+ cliCommandOptions: {
180
+ keycloakVersion,
181
+ port,
182
+ realmJsonFilePath
183
+ }
140
184
  });
141
185
  }
142
186
  });
@@ -47,11 +47,25 @@ export function createUseI18n<
47
47
 
48
48
  function renderHtmlString(params: { htmlString: string; msgKey: string }): JSX.Element {
49
49
  const { htmlString, msgKey } = params;
50
+
51
+ const htmlString_sanitized = kcSanitize(htmlString);
52
+
53
+ const Element = (() => {
54
+ if (htmlString_sanitized.includes("<") && htmlString_sanitized.includes(">")) {
55
+ for (const tagName of ["div", "section", "article", "ul", "ol"]) {
56
+ if (htmlString_sanitized.includes(`<${tagName}`)) {
57
+ return "div";
58
+ }
59
+ }
60
+ }
61
+ return "span";
62
+ })();
63
+
50
64
  return (
51
- <div
65
+ <Element
52
66
  data-kc-msg={msgKey}
53
67
  dangerouslySetInnerHTML={{
54
- __html: kcSanitize(htmlString)
68
+ __html: htmlString_sanitized
55
69
  }}
56
70
  />
57
71
  );
@@ -83,7 +97,7 @@ export function createUseI18n<
83
97
  })();
84
98
 
85
99
  add_style: {
86
- const attributeName = "data-kc-i18n";
100
+ const attributeName = "data-kc-msg";
87
101
 
88
102
  // Check if already exists in head
89
103
  if (document.querySelector(`style[${attributeName}]`) !== null) {
@@ -92,7 +106,7 @@ export function createUseI18n<
92
106
 
93
107
  const styleElement = document.createElement("style");
94
108
  styleElement.attributes.setNamedItem(document.createAttribute(attributeName));
95
- styleElement.textContent = `[data-kc-msg] { display: inline-block; }`;
109
+ styleElement.textContent = `div[${attributeName}] { display: inline-block; }`;
96
110
  document.head.prepend(styleElement);
97
111
  }
98
112
 
@@ -52,28 +52,26 @@ export default function LoginConfigTotp(props: PageProps<Extract<KcContext, { pa
52
52
  </li>
53
53
  <li>
54
54
  <p>{msg("loginTotpManualStep3")}</p>
55
- <p>
56
- <ul>
57
- <li id="kc-totp-type">
58
- {msg("loginTotpType")}: {msg(`loginTotp.${totp.policy.type}`)}
59
- </li>
60
- <li id="kc-totp-algorithm">
61
- {msg("loginTotpAlgorithm")}: {totp.policy.getAlgorithmKey()}
55
+ <ul>
56
+ <li id="kc-totp-type">
57
+ {msg("loginTotpType")}: {msg(`loginTotp.${totp.policy.type}`)}
58
+ </li>
59
+ <li id="kc-totp-algorithm">
60
+ {msg("loginTotpAlgorithm")}: {totp.policy.getAlgorithmKey()}
61
+ </li>
62
+ <li id="kc-totp-digits">
63
+ {msg("loginTotpDigits")}: {totp.policy.digits}
64
+ </li>
65
+ {totp.policy.type === "totp" ? (
66
+ <li id="kc-totp-period">
67
+ {msg("loginTotpInterval")}: {totp.policy.period}
62
68
  </li>
63
- <li id="kc-totp-digits">
64
- {msg("loginTotpDigits")}: {totp.policy.digits}
69
+ ) : (
70
+ <li id="kc-totp-counter">
71
+ {msg("loginTotpCounter")}: {totp.policy.initialCounter}
65
72
  </li>
66
- {totp.policy.type === "totp" ? (
67
- <li id="kc-totp-period">
68
- {msg("loginTotpInterval")}: {totp.policy.period}
69
- </li>
70
- ) : (
71
- <li id="kc-totp-counter">
72
- {msg("loginTotpCounter")}: {totp.policy.initialCounter}
73
- </li>
74
- )}
75
- </ul>
76
- </p>
73
+ )}
74
+ </ul>
77
75
  </li>
78
76
  </>
79
77
  ) : (