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.js
CHANGED
|
@@ -273,10 +273,45 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
273
273
|
});
|
|
274
274
|
};
|
|
275
275
|
const renderStrongAndEm = (nodes) => {
|
|
276
|
+
const renderUnderlineAndStrong = (text) => {
|
|
277
|
+
return text.split(/__(\*\*[^*]+\*\*)__/g).map((part, index) => {
|
|
278
|
+
if (!(index % 2 === 1)) return part;
|
|
279
|
+
const strongText = part.slice(2, -2);
|
|
280
|
+
return /* @__PURE__ */ React.createElement("u", { key: `u-strong-${index}` }, /* @__PURE__ */ React.createElement("strong", null, strongText));
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
const renderStrongAndUnderline = (text) => {
|
|
284
|
+
return text.split(/\*\*(__[^_]+__)\*\*/g).map((part, index) => {
|
|
285
|
+
if (!(index % 2 === 1)) return part;
|
|
286
|
+
const underlineText = part.slice(2, -2);
|
|
287
|
+
return /* @__PURE__ */ React.createElement("strong", { key: `strong-u-${index}` }, /* @__PURE__ */ React.createElement("u", null, underlineText));
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
const renderUnderlineAndEm = (text) => {
|
|
291
|
+
return text.split(/__(\*[^*]+\*)__/g).map((part, index) => {
|
|
292
|
+
if (!(index % 2 === 1)) return part;
|
|
293
|
+
const emText = part.slice(1, -1);
|
|
294
|
+
return /* @__PURE__ */ React.createElement("u", { key: `u-em-${index}` }, /* @__PURE__ */ React.createElement("em", null, emText));
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
const renderEmAndUnderline = (text) => {
|
|
298
|
+
return text.split(/\*(__[^_]+__)\*/g).map((part, index) => {
|
|
299
|
+
if (!(index % 2 === 1)) return part;
|
|
300
|
+
const underlineText = part.slice(2, -2);
|
|
301
|
+
return /* @__PURE__ */ React.createElement("em", { key: `em-u-${index}` }, /* @__PURE__ */ React.createElement("u", null, underlineText));
|
|
302
|
+
});
|
|
303
|
+
};
|
|
276
304
|
const renderHtmlUnderline = (text) => {
|
|
305
|
+
const renderUnderlineContent = (underlineText) => {
|
|
306
|
+
const tripleStarAsStrongNodes = underlineText.split(/\*\*\*([^*]+)\*\*\*/g).map((part, index) => {
|
|
307
|
+
if (!(index % 2 === 1)) return part;
|
|
308
|
+
return /* @__PURE__ */ React.createElement("strong", { key: `u-strong-em-from-triple-${index}` }, /* @__PURE__ */ React.createElement("em", null, part));
|
|
309
|
+
});
|
|
310
|
+
return renderStrongAndEm(tripleStarAsStrongNodes);
|
|
311
|
+
};
|
|
277
312
|
return text.split(/<u>(.*?)<\/u>/g).map((part, index) => {
|
|
278
313
|
if (!(index % 2 === 1)) return part;
|
|
279
|
-
return /* @__PURE__ */ React.createElement("u", { key: `u-html-${index}` }, part);
|
|
314
|
+
return /* @__PURE__ */ React.createElement("u", { key: `u-html-${index}` }, renderUnderlineContent(part));
|
|
280
315
|
});
|
|
281
316
|
};
|
|
282
317
|
const renderUnderline = (text) => {
|
|
@@ -291,6 +326,12 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
291
326
|
return /* @__PURE__ */ React.createElement("strong", { key: `strong-${index}` }, part);
|
|
292
327
|
});
|
|
293
328
|
};
|
|
329
|
+
const renderStrongAndEmphasis = (text) => {
|
|
330
|
+
return text.split(/\*\*\*([^*]+)\*\*\*/g).map((part, index) => {
|
|
331
|
+
if (!(index % 2 === 1)) return part;
|
|
332
|
+
return /* @__PURE__ */ React.createElement("strong", { key: `strong-em-${index}` }, /* @__PURE__ */ React.createElement("u", null, part));
|
|
333
|
+
});
|
|
334
|
+
};
|
|
294
335
|
const renderEm = (text) => {
|
|
295
336
|
return text.split(/\*([^*]+)\*/g).map((part, index) => {
|
|
296
337
|
if (!(index % 2 === 1)) return part;
|
|
@@ -299,12 +340,27 @@ const renderInlineMarkdown = (rawText) => {
|
|
|
299
340
|
};
|
|
300
341
|
return nodes.flatMap((node) => {
|
|
301
342
|
if (typeof node !== "string") return [node];
|
|
302
|
-
return
|
|
343
|
+
return renderUnderlineAndStrong(node).flatMap((underlineAndStrongNode) => {
|
|
344
|
+
if (typeof underlineAndStrongNode !== "string") return [underlineAndStrongNode];
|
|
345
|
+
return renderStrongAndUnderline(underlineAndStrongNode);
|
|
346
|
+
}).flatMap((strongAndUnderlineNode) => {
|
|
347
|
+
if (typeof strongAndUnderlineNode !== "string") return [strongAndUnderlineNode];
|
|
348
|
+
return renderUnderlineAndEm(strongAndUnderlineNode);
|
|
349
|
+
}).flatMap((underlineAndEmNode) => {
|
|
350
|
+
if (typeof underlineAndEmNode !== "string") return [underlineAndEmNode];
|
|
351
|
+
return renderEmAndUnderline(underlineAndEmNode);
|
|
352
|
+
}).flatMap((emAndUnderlineNode) => {
|
|
353
|
+
if (typeof emAndUnderlineNode !== "string") return [emAndUnderlineNode];
|
|
354
|
+
return renderHtmlUnderline(emAndUnderlineNode);
|
|
355
|
+
}).flatMap((htmlUnderlineNode) => {
|
|
303
356
|
if (typeof htmlUnderlineNode !== "string") return [htmlUnderlineNode];
|
|
304
357
|
return renderUnderline(htmlUnderlineNode);
|
|
305
358
|
}).flatMap((underlineNode) => {
|
|
306
359
|
if (typeof underlineNode !== "string") return [underlineNode];
|
|
307
|
-
return
|
|
360
|
+
return renderStrongAndEmphasis(underlineNode);
|
|
361
|
+
}).flatMap((strongAndEmphasisNode) => {
|
|
362
|
+
if (typeof strongAndEmphasisNode !== "string") return [strongAndEmphasisNode];
|
|
363
|
+
return renderStrong(strongAndEmphasisNode);
|
|
308
364
|
}).flatMap((strongNode) => {
|
|
309
365
|
if (typeof strongNode !== "string") return [strongNode];
|
|
310
366
|
return renderEm(strongNode);
|