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.js CHANGED
@@ -265,7 +265,15 @@ style_inject_es_default(css_248z$82);
265
265
  * Supports: **bold**, *italic*, __underline__ (or <u>underline</u>), `code`, line breaks, and simple lists.
266
266
  */
267
267
  const renderInlineMarkdown = (rawText) => {
268
- if (!rawText) return rawText;
268
+ const normalizeToDisplayText = (value) => {
269
+ if (value === null || value === void 0) return "";
270
+ if (typeof value === "string") return value;
271
+ if (value instanceof String) return value.toString();
272
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
273
+ return "";
274
+ };
275
+ const normalizedText = normalizeToDisplayText(rawText);
276
+ if (normalizedText.length === 0) return normalizedText;
269
277
  const renderCode = (text) => {
270
278
  return text.split(/`([^`]+)`/g).map((part, index) => {
271
279
  if (!(index % 2 === 1)) return part;
@@ -371,40 +379,44 @@ const renderInlineMarkdown = (rawText) => {
371
379
  const codeNodes = renderCode(text);
372
380
  return renderStrongAndEm(codeNodes);
373
381
  };
374
- const lines = rawText.split("\n");
375
- const blocks = [];
376
- let i = 0;
377
- while (i < lines.length) {
378
- const line = lines[i] ?? "";
379
- const unorderedMatch = line.match(/^\s*[-*]\s+(.*)$/);
380
- const orderedMatch = line.match(/^\s*(\d+)\.\s+(.*)$/);
381
- if (unorderedMatch) {
382
- const items = [];
383
- while (i < lines.length) {
384
- const match = (lines[i] ?? "").match(/^\s*[-*]\s+(.*)$/);
385
- if (!match) break;
386
- items.push(match[1]);
387
- i += 1;
382
+ try {
383
+ const lines = normalizedText.split("\n");
384
+ const blocks = [];
385
+ let i = 0;
386
+ while (i < lines.length) {
387
+ const line = lines[i] ?? "";
388
+ const unorderedMatch = line.match(/^\s*[-*]\s+(.*)$/);
389
+ const orderedMatch = line.match(/^\s*(\d+)\.\s+(.*)$/);
390
+ if (unorderedMatch) {
391
+ const items = [];
392
+ while (i < lines.length) {
393
+ const match = (lines[i] ?? "").match(/^\s*[-*]\s+(.*)$/);
394
+ if (!match) break;
395
+ items.push(match[1]);
396
+ i += 1;
397
+ }
398
+ blocks.push(/* @__PURE__ */ React.createElement("ul", { key: `ul-${blocks.length}` }, items.map((item, index) => /* @__PURE__ */ React.createElement("li", { key: `ul-li-${index}` }, renderInline(item)))));
399
+ continue;
388
400
  }
389
- blocks.push(/* @__PURE__ */ React.createElement("ul", { key: `ul-${blocks.length}` }, items.map((item, index) => /* @__PURE__ */ React.createElement("li", { key: `ul-li-${index}` }, renderInline(item)))));
390
- continue;
391
- }
392
- if (orderedMatch) {
393
- const items = [];
394
- while (i < lines.length) {
395
- const match = (lines[i] ?? "").match(/^\s*\d+\.\s+(.*)$/);
396
- if (!match) break;
397
- items.push(match[1]);
398
- i += 1;
401
+ if (orderedMatch) {
402
+ const items = [];
403
+ while (i < lines.length) {
404
+ const match = (lines[i] ?? "").match(/^\s*\d+\.\s+(.*)$/);
405
+ if (!match) break;
406
+ items.push(match[1]);
407
+ i += 1;
408
+ }
409
+ blocks.push(/* @__PURE__ */ React.createElement("ol", { key: `ol-${blocks.length}` }, items.map((item, index) => /* @__PURE__ */ React.createElement("li", { key: `ol-li-${index}` }, renderInline(item)))));
410
+ continue;
399
411
  }
400
- blocks.push(/* @__PURE__ */ React.createElement("ol", { key: `ol-${blocks.length}` }, items.map((item, index) => /* @__PURE__ */ React.createElement("li", { key: `ol-li-${index}` }, renderInline(item)))));
401
- continue;
412
+ blocks.push(/* @__PURE__ */ React.createElement(React.Fragment, { key: `p-${blocks.length}` }, renderInline(line)));
413
+ if (i < lines.length - 1) blocks.push(/* @__PURE__ */ React.createElement("br", { key: `br-${blocks.length}` }));
414
+ i += 1;
402
415
  }
403
- blocks.push(/* @__PURE__ */ React.createElement(React.Fragment, { key: `p-${blocks.length}` }, renderInline(line)));
404
- if (i < lines.length - 1) blocks.push(/* @__PURE__ */ React.createElement("br", { key: `br-${blocks.length}` }));
405
- i += 1;
416
+ return blocks;
417
+ } catch (error) {
418
+ return normalizedText;
406
419
  }
407
- return blocks;
408
420
  };
409
421
 
410
422
  //#endregion