@flytedan/flytebot-design-system 0.70.0 → 0.71.0

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.
@@ -11,11 +11,17 @@ function escapeMarkdown(text) {
11
11
  // task item `[ ]` is already covered by escaping `[`
12
12
  ).join("\n");
13
13
  }
14
+ function markdownToText(src) {
15
+ return showEscapes(
16
+ hideEscapes(String(src == null ? "" : src)).replace(/```[\w+#-]*\n?([\s\S]*?)```/g, (_, c) => showEscapesRaw(c)).replace(/`([^`]+)`/g, (_, c) => showEscapesRaw(c)).replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/\*\*\*([^*]+)\*\*\*|\*\*([^*]+)\*\*|__([^_]+)__/g, "$1$2$3").replace(/(^|\W)[*_]([^*_\n]+)[*_](\W|$)/g, "$1$2$3").replace(/~~([^~]+)~~/g, "$1").replace(/^\s*>\s?/gm, "").trim()
17
+ );
18
+ }
14
19
 
15
20
  export {
16
21
  hideEscapes,
17
22
  showEscapes,
18
23
  showEscapesRaw,
19
- escapeMarkdown
24
+ escapeMarkdown,
25
+ markdownToText
20
26
  };
21
- //# sourceMappingURL=chunk-OVTWSE43.js.map
27
+ //# sourceMappingURL=chunk-476HCG2A.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/data/markdownEscape.ts"],"sourcesContent":["/* DS-7: the one definition of the markdown escape rule, shared by the renderer\n (Markdown.tsx) and by `escapeMarkdown` (a React-free entry, so a server can import it). */\n\n/** CommonMark: a backslash before any ASCII punctuation character makes it literal. */\nexport const ESCAPABLE = /\\\\([!-/:-@[-`{-~])/g;\n\n/* An escaped character is swapped for a private-use stand-in (U+E000 + its code) before any\n syntax pattern runs, so no pattern can see it, then swapped back where text is emitted. */\nconst STAND_IN_BASE = 0xe000;\nconst STAND_IN = /[-]/g;\n\n/** Hide every escaped character from the syntax patterns. Stray stand-ins already in the input are neutralised first. */\nexport const hideEscapes = (s: string): string =>\n s.replace(STAND_IN, \"�\").replace(ESCAPABLE, (_, c: string) => String.fromCharCode(STAND_IN_BASE + c.charCodeAt(0)));\n\n/** Put escaped characters back as the literal character. */\nexport const showEscapes = (s: string): string => s.replace(STAND_IN, (c) => String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));\n\n/** Put escaped characters back with their backslash (a code span keeps its source verbatim). */\nexport const showEscapesRaw = (s: string): string => s.replace(STAND_IN, (c) => \"\\\\\" + String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));\n\n/**\n * Backslash-escape text so `Markdown` / `MarkdownInline` render it as exactly that text:\n * every character the renderer reads as inline syntax, the `:` that starts a bare-URL or\n * mailto autolink, and any block marker (heading, quote, list, rule, table, fence) at the\n * start of a line.\n */\nexport function escapeMarkdown(text: string): string {\n return String(text == null ? \"\" : text)\n .replace(/\\r\\n?/g, \"\\n\")\n .replace(/[\\\\`*_[\\]()<>!|~^]/g, \"\\\\$&\")\n .replace(/\\b(https?|mailto|tel):/gi, \"$1\\\\:\")\n .split(\"\\n\")\n .map((line) =>\n line\n // heading, quote, bullet, rule, fence-like markers: escape the first marker character\n .replace(/^(\\s*)([#>+-])/, \"$1\\\\$2\")\n // ordered list: escape the dot or paren after the number\n .replace(/^(\\s*\\d{1,9})([.)])/, \"$1\\\\$2\")\n // task item `[ ]` is already covered by escaping `[`\n )\n .join(\"\\n\");\n}\n"],"mappings":";AAIO,IAAM,YAAY;AAIzB,IAAM,gBAAgB;AACtB,IAAM,WAAW;AAGV,IAAM,cAAc,CAAC,MAC1B,EAAE,QAAQ,UAAU,QAAG,EAAE,QAAQ,WAAW,CAAC,GAAG,MAAc,OAAO,aAAa,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;AAG7G,IAAM,cAAc,CAAC,MAAsB,EAAE,QAAQ,UAAU,CAAC,MAAM,OAAO,aAAa,EAAE,WAAW,CAAC,IAAI,aAAa,CAAC;AAG1H,IAAM,iBAAiB,CAAC,MAAsB,EAAE,QAAQ,UAAU,CAAC,MAAM,OAAO,OAAO,aAAa,EAAE,WAAW,CAAC,IAAI,aAAa,CAAC;AAQpI,SAAS,eAAe,MAAsB;AACnD,SAAO,OAAO,QAAQ,OAAO,KAAK,IAAI,EACnC,QAAQ,UAAU,IAAI,EACtB,QAAQ,uBAAuB,MAAM,EACrC,QAAQ,4BAA4B,OAAO,EAC3C,MAAM,IAAI,EACV;AAAA,IAAI,CAAC,SACJ,KAEG,QAAQ,kBAAkB,QAAQ,EAElC,QAAQ,uBAAuB,QAAQ;AAAA;AAAA,EAE5C,EACC,KAAK,IAAI;AACd;","names":[]}
1
+ {"version":3,"sources":["../src/components/data/markdownEscape.ts"],"sourcesContent":["/* DS-7: the one definition of the markdown escape rule, shared by the renderer\n (Markdown.tsx) and by `escapeMarkdown` (a React-free entry, so a server can import it). */\n\n/** CommonMark: a backslash before any ASCII punctuation character makes it literal. */\nexport const ESCAPABLE = /\\\\([!-/:-@[-`{-~])/g;\n\n/* An escaped character is swapped for a private-use stand-in (U+E000 + its code) before any\n syntax pattern runs, so no pattern can see it, then swapped back where text is emitted. */\nconst STAND_IN_BASE = 0xe000;\nconst STAND_IN = /[-]/g;\n\n/** Hide every escaped character from the syntax patterns. Stray stand-ins already in the input are neutralised first. */\nexport const hideEscapes = (s: string): string =>\n s.replace(STAND_IN, \"�\").replace(ESCAPABLE, (_, c: string) => String.fromCharCode(STAND_IN_BASE + c.charCodeAt(0)));\n\n/** Put escaped characters back as the literal character. */\nexport const showEscapes = (s: string): string => s.replace(STAND_IN, (c) => String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));\n\n/** Put escaped characters back with their backslash (a code span keeps its source verbatim). */\nexport const showEscapesRaw = (s: string): string => s.replace(STAND_IN, (c) => \"\\\\\" + String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));\n\n/**\n * Backslash-escape text so `Markdown` / `MarkdownInline` render it as exactly that text:\n * every character the renderer reads as inline syntax, the `:` that starts a bare-URL or\n * mailto autolink, and any block marker (heading, quote, list, rule, table, fence) at the\n * start of a line.\n */\nexport function escapeMarkdown(text: string): string {\n return String(text == null ? \"\" : text)\n .replace(/\\r\\n?/g, \"\\n\")\n .replace(/[\\\\`*_[\\]()<>!|~^]/g, \"\\\\$&\")\n .replace(/\\b(https?|mailto|tel):/gi, \"$1\\\\:\")\n .split(\"\\n\")\n .map((line) =>\n line\n // heading, quote, bullet, rule, fence-like markers: escape the first marker character\n .replace(/^(\\s*)([#>+-])/, \"$1\\\\$2\")\n // ordered list: escape the dot or paren after the number\n .replace(/^(\\s*\\d{1,9})([.)])/, \"$1\\\\$2\")\n // task item `[ ]` is already covered by escaping `[`\n )\n .join(\"\\n\");\n}\n\n/**\n * Strip markdown to the plain text the renderer shows — for search, copy actions, titles and\n * previews. Escaped characters become literal text; only real syntax is removed, so\n * `markdownToText(escapeMarkdown(x)) === x`. A code span keeps its source verbatim.\n */\nexport function markdownToText(src: string): string {\n return showEscapes(\n hideEscapes(String(src == null ? \"\" : src))\n .replace(/```[\\w+#-]*\\n?([\\s\\S]*?)```/g, (_, c: string) => showEscapesRaw(c))\n .replace(/`([^`]+)`/g, (_, c: string) => showEscapesRaw(c))\n .replace(/!\\[([^\\]]*)\\]\\([^)]*\\)/g, \"$1\")\n .replace(/\\[([^\\]]+)\\]\\([^)]*\\)/g, \"$1\")\n .replace(/^\\s{0,3}#{1,6}\\s+/gm, \"\")\n .replace(/\\*\\*\\*([^*]+)\\*\\*\\*|\\*\\*([^*]+)\\*\\*|__([^_]+)__/g, \"$1$2$3\")\n .replace(/(^|\\W)[*_]([^*_\\n]+)[*_](\\W|$)/g, \"$1$2$3\")\n .replace(/~~([^~]+)~~/g, \"$1\")\n .replace(/^\\s*>\\s?/gm, \"\")\n .trim(),\n );\n}\n"],"mappings":";AAIO,IAAM,YAAY;AAIzB,IAAM,gBAAgB;AACtB,IAAM,WAAW;AAGV,IAAM,cAAc,CAAC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N_BASE + c.charCodeAt(0)));
6364
6364
  var showEscapes = (s) => s.replace(STAND_IN, (c) => String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));
6365
6365
  var showEscapesRaw = (s) => s.replace(STAND_IN, (c) => "\\" + String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));
6366
+ function markdownToText(src) {
6367
+ return showEscapes(
6368
+ hideEscapes(String(src == null ? "" : src)).replace(/```[\w+#-]*\n?([\s\S]*?)```/g, (_, c) => showEscapesRaw(c)).replace(/`([^`]+)`/g, (_, c) => showEscapesRaw(c)).replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/\*\*\*([^*]+)\*\*\*|\*\*([^*]+)\*\*|__([^_]+)__/g, "$1$2$3").replace(/(^|\W)[*_]([^*_\n]+)[*_](\W|$)/g, "$1$2$3").replace(/~~([^~]+)~~/g, "$1").replace(/^\s*>\s?/gm, "").trim()
6369
+ );
6370
+ }
6366
6371
 
6367
6372
  // src/components/data/Markdown.tsx
6368
6373
  var import_jsx_runtime54 = require("react/jsx-runtime");
@@ -6597,9 +6602,6 @@ function Markdown({
6597
6602
  function MarkdownInline({ source = "", className = "", onLinkClick, size, tone }) {
6598
6603
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: mdClass("fd-md-inline", size, tone, className), children: inlineNodes(source, { allowImages: false, onLinkClick }, "i") });
6599
6604
  }
6600
- function markdownToText(src) {
6601
- return String(src == null ? "" : src).replace(/```[\w+#-]*\n?([\s\S]*?)```/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/\*\*\*([^*]+)\*\*\*|\*\*([^*]+)\*\*|__([^_]+)__/g, "$1$2$3").replace(/(^|\W)[*_]([^*_\n]+)[*_](\W|$)/g, "$1$2$3").replace(/~~([^~]+)~~/g, "$1").replace(/^\s*>\s?/gm, "").trim();
6602
- }
6603
6605
 
6604
6606
  // src/components/data/Meter.tsx
6605
6607
  var import_jsx_runtime55 = require("react/jsx-runtime");
@@ -9469,11 +9471,11 @@ function CodeEditor({
9469
9471
  // src/components/forms/RadioGroup.tsx
9470
9472
  var React53 = __toESM(require("react"), 1);
9471
9473
  var import_jsx_runtime80 = require("react/jsx-runtime");
9472
- function RadioGroup({ label, options, value, onChange, card = false, disabled = false, name, className = "" }) {
9474
+ function RadioGroup({ label, labelledBy, options, value, onChange, card = false, disabled = false, name, className = "" }) {
9473
9475
  const autoName = React53.useId();
9474
9476
  const labelId = React53.useId();
9475
- return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { role: "radiogroup", "aria-labelledby": labelId, "aria-disabled": disabled || void 0, className: ["fd-radiogroup", className].filter(Boolean).join(" "), children: [
9476
- /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { id: labelId, className: "fd-radiogroup-label", children: label }),
9477
+ return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { role: "radiogroup", "aria-labelledby": labelledBy ?? labelId, "aria-disabled": disabled || void 0, className: ["fd-radiogroup", className].filter(Boolean).join(" "), children: [
9478
+ labelledBy === void 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { id: labelId, className: "fd-radiogroup-label", children: label }),
9477
9479
  options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
9478
9480
  Radio,
9479
9481
  {