odaptos_design_system 2.0.349 → 2.0.350
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 +43 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -319,9 +319,15 @@ style_inject_es_default(css_248z$82);
|
|
|
319
319
|
* Supports: **bold**, *italic*, __underline__ (or <u>underline</u>), `code`, line breaks, and simple lists.
|
|
320
320
|
*/
|
|
321
321
|
const renderInlineMarkdown = (rawText) => {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
const normalizeToDisplayText = (value) => {
|
|
323
|
+
if (value === null || value === void 0) return "";
|
|
324
|
+
if (typeof value === "string") return value;
|
|
325
|
+
if (value instanceof String) return value.toString();
|
|
326
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
|
|
327
|
+
return "";
|
|
328
|
+
};
|
|
329
|
+
const normalizedText = normalizeToDisplayText(rawText);
|
|
330
|
+
if (normalizedText.length === 0) return normalizedText;
|
|
325
331
|
const renderCode = (text) => {
|
|
326
332
|
return text.split(/`([^`]+)`/g).map((part, index) => {
|
|
327
333
|
if (!(index % 2 === 1)) return part;
|
|
@@ -427,40 +433,44 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
427
433
|
const codeNodes = renderCode(text);
|
|
428
434
|
return renderStrongAndEm(codeNodes);
|
|
429
435
|
};
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
436
|
+
try {
|
|
437
|
+
const lines = normalizedText.split("\n");
|
|
438
|
+
const blocks = [];
|
|
439
|
+
let i = 0;
|
|
440
|
+
while (i < lines.length) {
|
|
441
|
+
const line = lines[i] ?? "";
|
|
442
|
+
const unorderedMatch = line.match(/^\s*[-*]\s+(.*)$/);
|
|
443
|
+
const orderedMatch = line.match(/^\s*(\d+)\.\s+(.*)$/);
|
|
444
|
+
if (unorderedMatch) {
|
|
445
|
+
const items = [];
|
|
446
|
+
while (i < lines.length) {
|
|
447
|
+
const match = (lines[i] ?? "").match(/^\s*[-*]\s+(.*)$/);
|
|
448
|
+
if (!match) break;
|
|
449
|
+
items.push(match[1]);
|
|
450
|
+
i += 1;
|
|
451
|
+
}
|
|
452
|
+
blocks.push(/* @__PURE__ */ react.default.createElement("ul", { key: `ul-${blocks.length}` }, items.map((item, index) => /* @__PURE__ */ react.default.createElement("li", { key: `ul-li-${index}` }, renderInline(item)))));
|
|
453
|
+
continue;
|
|
444
454
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
+
if (orderedMatch) {
|
|
456
|
+
const items = [];
|
|
457
|
+
while (i < lines.length) {
|
|
458
|
+
const match = (lines[i] ?? "").match(/^\s*\d+\.\s+(.*)$/);
|
|
459
|
+
if (!match) break;
|
|
460
|
+
items.push(match[1]);
|
|
461
|
+
i += 1;
|
|
462
|
+
}
|
|
463
|
+
blocks.push(/* @__PURE__ */ react.default.createElement("ol", { key: `ol-${blocks.length}` }, items.map((item, index) => /* @__PURE__ */ react.default.createElement("li", { key: `ol-li-${index}` }, renderInline(item)))));
|
|
464
|
+
continue;
|
|
455
465
|
}
|
|
456
|
-
blocks.push(/* @__PURE__ */ react.default.createElement(
|
|
457
|
-
|
|
466
|
+
blocks.push(/* @__PURE__ */ react.default.createElement(react.default.Fragment, { key: `p-${blocks.length}` }, renderInline(line)));
|
|
467
|
+
if (i < lines.length - 1) blocks.push(/* @__PURE__ */ react.default.createElement("br", { key: `br-${blocks.length}` }));
|
|
468
|
+
i += 1;
|
|
458
469
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
470
|
+
return blocks;
|
|
471
|
+
} catch (error) {
|
|
472
|
+
return normalizedText;
|
|
462
473
|
}
|
|
463
|
-
return blocks;
|
|
464
474
|
};
|
|
465
475
|
|
|
466
476
|
//#endregion
|