odaptos_design_system 2.0.348 → 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 CHANGED
@@ -319,7 +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
- if (!rawText) return rawText;
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;
323
331
  const renderCode = (text) => {
324
332
  return text.split(/`([^`]+)`/g).map((part, index) => {
325
333
  if (!(index % 2 === 1)) return part;
@@ -425,40 +433,44 @@ const renderInlineMarkdown = (rawText) => {
425
433
  const codeNodes = renderCode(text);
426
434
  return renderStrongAndEm(codeNodes);
427
435
  };
428
- const lines = rawText.split("\n");
429
- const blocks = [];
430
- let i = 0;
431
- while (i < lines.length) {
432
- const line = lines[i] ?? "";
433
- const unorderedMatch = line.match(/^\s*[-*]\s+(.*)$/);
434
- const orderedMatch = line.match(/^\s*(\d+)\.\s+(.*)$/);
435
- if (unorderedMatch) {
436
- const items = [];
437
- while (i < lines.length) {
438
- const match = (lines[i] ?? "").match(/^\s*[-*]\s+(.*)$/);
439
- if (!match) break;
440
- items.push(match[1]);
441
- i += 1;
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;
442
454
  }
443
- 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)))));
444
- continue;
445
- }
446
- if (orderedMatch) {
447
- const items = [];
448
- while (i < lines.length) {
449
- const match = (lines[i] ?? "").match(/^\s*\d+\.\s+(.*)$/);
450
- if (!match) break;
451
- items.push(match[1]);
452
- i += 1;
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;
453
465
  }
454
- 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)))));
455
- continue;
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;
456
469
  }
457
- blocks.push(/* @__PURE__ */ react.default.createElement(react.default.Fragment, { key: `p-${blocks.length}` }, renderInline(line)));
458
- if (i < lines.length - 1) blocks.push(/* @__PURE__ */ react.default.createElement("br", { key: `br-${blocks.length}` }));
459
- i += 1;
470
+ return blocks;
471
+ } catch (error) {
472
+ return normalizedText;
460
473
  }
461
- return blocks;
462
474
  };
463
475
 
464
476
  //#endregion