@flytedan/flytebot-design-system 0.68.0 → 0.70.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.
- package/dist/chunk-OVTWSE43.js +21 -0
- package/dist/chunk-OVTWSE43.js.map +1 -0
- package/dist/index.cjs +1050 -958
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -8
- package/dist/index.d.ts +68 -8
- package/dist/index.js +1043 -958
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +38 -0
- package/dist/markdown.cjs.map +1 -0
- package/dist/markdown.d.cts +9 -0
- package/dist/markdown.d.ts +9 -0
- package/dist/markdown.js +7 -0
- package/dist/markdown.js.map +1 -0
- package/package.json +6 -1
- package/styles/components.css +24 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/components/data/markdownEscape.ts
|
|
2
|
+
var ESCAPABLE = /\\([!-/:-@[-`{-~])/g;
|
|
3
|
+
var STAND_IN_BASE = 57344;
|
|
4
|
+
var STAND_IN = /[-]/g;
|
|
5
|
+
var hideEscapes = (s) => s.replace(STAND_IN, "\uFFFD").replace(ESCAPABLE, (_, c) => String.fromCharCode(STAND_IN_BASE + c.charCodeAt(0)));
|
|
6
|
+
var showEscapes = (s) => s.replace(STAND_IN, (c) => String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));
|
|
7
|
+
var showEscapesRaw = (s) => s.replace(STAND_IN, (c) => "\\" + String.fromCharCode(c.charCodeAt(0) - STAND_IN_BASE));
|
|
8
|
+
function escapeMarkdown(text) {
|
|
9
|
+
return String(text == null ? "" : text).replace(/\r\n?/g, "\n").replace(/[\\`*_[\]()<>!|~^]/g, "\\$&").replace(/\b(https?|mailto|tel):/gi, "$1\\:").split("\n").map(
|
|
10
|
+
(line) => line.replace(/^(\s*)([#>+-])/, "$1\\$2").replace(/^(\s*\d{1,9})([.)])/, "$1\\$2")
|
|
11
|
+
// task item `[ ]` is already covered by escaping `[`
|
|
12
|
+
).join("\n");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
hideEscapes,
|
|
17
|
+
showEscapes,
|
|
18
|
+
showEscapesRaw,
|
|
19
|
+
escapeMarkdown
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-OVTWSE43.js.map
|
|
@@ -0,0 +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":[]}
|