odaptos_design_system 2.0.346 → 2.0.348
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/index.cjs +59 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +59 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -327,10 +327,45 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
327
327
|
});
|
|
328
328
|
};
|
|
329
329
|
const renderStrongAndEm = (nodes) => {
|
|
330
|
+
const renderUnderlineAndStrong = (text) => {
|
|
331
|
+
return text.split(/__(\*\*[^*]+\*\*)__/g).map((part, index) => {
|
|
332
|
+
if (!(index % 2 === 1)) return part;
|
|
333
|
+
const strongText = part.slice(2, -2);
|
|
334
|
+
return /* @__PURE__ */ react.default.createElement("u", { key: `u-strong-${index}` }, /* @__PURE__ */ react.default.createElement("strong", null, strongText));
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
const renderStrongAndUnderline = (text) => {
|
|
338
|
+
return text.split(/\*\*(__[^_]+__)\*\*/g).map((part, index) => {
|
|
339
|
+
if (!(index % 2 === 1)) return part;
|
|
340
|
+
const underlineText = part.slice(2, -2);
|
|
341
|
+
return /* @__PURE__ */ react.default.createElement("strong", { key: `strong-u-${index}` }, /* @__PURE__ */ react.default.createElement("u", null, underlineText));
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
const renderUnderlineAndEm = (text) => {
|
|
345
|
+
return text.split(/__(\*[^*]+\*)__/g).map((part, index) => {
|
|
346
|
+
if (!(index % 2 === 1)) return part;
|
|
347
|
+
const emText = part.slice(1, -1);
|
|
348
|
+
return /* @__PURE__ */ react.default.createElement("u", { key: `u-em-${index}` }, /* @__PURE__ */ react.default.createElement("em", null, emText));
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
const renderEmAndUnderline = (text) => {
|
|
352
|
+
return text.split(/\*(__[^_]+__)\*/g).map((part, index) => {
|
|
353
|
+
if (!(index % 2 === 1)) return part;
|
|
354
|
+
const underlineText = part.slice(2, -2);
|
|
355
|
+
return /* @__PURE__ */ react.default.createElement("em", { key: `em-u-${index}` }, /* @__PURE__ */ react.default.createElement("u", null, underlineText));
|
|
356
|
+
});
|
|
357
|
+
};
|
|
330
358
|
const renderHtmlUnderline = (text) => {
|
|
359
|
+
const renderUnderlineContent = (underlineText) => {
|
|
360
|
+
const tripleStarAsStrongNodes = underlineText.split(/\*\*\*([^*]+)\*\*\*/g).map((part, index) => {
|
|
361
|
+
if (!(index % 2 === 1)) return part;
|
|
362
|
+
return /* @__PURE__ */ react.default.createElement("strong", { key: `u-strong-em-from-triple-${index}` }, /* @__PURE__ */ react.default.createElement("em", null, part));
|
|
363
|
+
});
|
|
364
|
+
return renderStrongAndEm(tripleStarAsStrongNodes);
|
|
365
|
+
};
|
|
331
366
|
return text.split(/<u>(.*?)<\/u>/g).map((part, index) => {
|
|
332
367
|
if (!(index % 2 === 1)) return part;
|
|
333
|
-
return /* @__PURE__ */ react.default.createElement("u", { key: `u-html-${index}` }, part);
|
|
368
|
+
return /* @__PURE__ */ react.default.createElement("u", { key: `u-html-${index}` }, renderUnderlineContent(part));
|
|
334
369
|
});
|
|
335
370
|
};
|
|
336
371
|
const renderUnderline = (text) => {
|
|
@@ -345,6 +380,12 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
345
380
|
return /* @__PURE__ */ react.default.createElement("strong", { key: `strong-${index}` }, part);
|
|
346
381
|
});
|
|
347
382
|
};
|
|
383
|
+
const renderStrongAndEmphasis = (text) => {
|
|
384
|
+
return text.split(/\*\*\*([^*]+)\*\*\*/g).map((part, index) => {
|
|
385
|
+
if (!(index % 2 === 1)) return part;
|
|
386
|
+
return /* @__PURE__ */ react.default.createElement("strong", { key: `strong-em-${index}` }, /* @__PURE__ */ react.default.createElement("u", null, part));
|
|
387
|
+
});
|
|
388
|
+
};
|
|
348
389
|
const renderEm = (text) => {
|
|
349
390
|
return text.split(/\*([^*]+)\*/g).map((part, index) => {
|
|
350
391
|
if (!(index % 2 === 1)) return part;
|
|
@@ -353,12 +394,27 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
353
394
|
};
|
|
354
395
|
return nodes.flatMap((node) => {
|
|
355
396
|
if (typeof node !== "string") return [node];
|
|
356
|
-
return
|
|
397
|
+
return renderUnderlineAndStrong(node).flatMap((underlineAndStrongNode) => {
|
|
398
|
+
if (typeof underlineAndStrongNode !== "string") return [underlineAndStrongNode];
|
|
399
|
+
return renderStrongAndUnderline(underlineAndStrongNode);
|
|
400
|
+
}).flatMap((strongAndUnderlineNode) => {
|
|
401
|
+
if (typeof strongAndUnderlineNode !== "string") return [strongAndUnderlineNode];
|
|
402
|
+
return renderUnderlineAndEm(strongAndUnderlineNode);
|
|
403
|
+
}).flatMap((underlineAndEmNode) => {
|
|
404
|
+
if (typeof underlineAndEmNode !== "string") return [underlineAndEmNode];
|
|
405
|
+
return renderEmAndUnderline(underlineAndEmNode);
|
|
406
|
+
}).flatMap((emAndUnderlineNode) => {
|
|
407
|
+
if (typeof emAndUnderlineNode !== "string") return [emAndUnderlineNode];
|
|
408
|
+
return renderHtmlUnderline(emAndUnderlineNode);
|
|
409
|
+
}).flatMap((htmlUnderlineNode) => {
|
|
357
410
|
if (typeof htmlUnderlineNode !== "string") return [htmlUnderlineNode];
|
|
358
411
|
return renderUnderline(htmlUnderlineNode);
|
|
359
412
|
}).flatMap((underlineNode) => {
|
|
360
413
|
if (typeof underlineNode !== "string") return [underlineNode];
|
|
361
|
-
return
|
|
414
|
+
return renderStrongAndEmphasis(underlineNode);
|
|
415
|
+
}).flatMap((strongAndEmphasisNode) => {
|
|
416
|
+
if (typeof strongAndEmphasisNode !== "string") return [strongAndEmphasisNode];
|
|
417
|
+
return renderStrong(strongAndEmphasisNode);
|
|
362
418
|
}).flatMap((strongNode) => {
|
|
363
419
|
if (typeof strongNode !== "string") return [strongNode];
|
|
364
420
|
return renderEm(strongNode);
|