@blankdotpage/cake 0.1.8 → 0.1.10

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.
Files changed (147) hide show
  1. package/dist/cake/clipboard.d.ts +1 -0
  2. package/dist/cake/clipboard.d.ts.map +1 -0
  3. package/dist/cake/clipboard.js +391 -0
  4. package/dist/cake/core/mapping/cursor-source-map.d.ts +1 -0
  5. package/dist/cake/core/mapping/cursor-source-map.d.ts.map +1 -0
  6. package/dist/cake/core/mapping/cursor-source-map.js +146 -0
  7. package/dist/cake/core/runtime.d.ts +1 -0
  8. package/dist/cake/core/runtime.d.ts.map +1 -0
  9. package/dist/cake/core/runtime.js +1758 -0
  10. package/dist/cake/core/types.d.ts +1 -0
  11. package/dist/cake/core/types.d.ts.map +1 -0
  12. package/dist/cake/core/types.js +1 -0
  13. package/dist/cake/dom/dom-map.d.ts +1 -0
  14. package/dist/cake/dom/dom-map.d.ts.map +1 -0
  15. package/dist/cake/dom/dom-map.js +151 -0
  16. package/dist/cake/dom/dom-selection.d.ts +1 -0
  17. package/dist/cake/dom/dom-selection.d.ts.map +1 -0
  18. package/dist/cake/dom/dom-selection.js +216 -0
  19. package/dist/cake/dom/render.d.ts +1 -0
  20. package/dist/cake/dom/render.d.ts.map +1 -0
  21. package/dist/cake/dom/render.js +470 -0
  22. package/dist/cake/dom/types.d.ts +1 -0
  23. package/dist/cake/dom/types.d.ts.map +1 -0
  24. package/dist/cake/dom/types.js +1 -0
  25. package/dist/cake/engine/cake-engine.d.ts +1 -0
  26. package/dist/cake/engine/cake-engine.d.ts.map +1 -0
  27. package/dist/cake/engine/cake-engine.js +3589 -0
  28. package/dist/cake/engine/selection/selection-geometry-dom.d.ts +1 -0
  29. package/dist/cake/engine/selection/selection-geometry-dom.d.ts.map +1 -0
  30. package/dist/cake/engine/selection/selection-geometry-dom.js +302 -0
  31. package/dist/cake/engine/selection/selection-geometry.d.ts +1 -0
  32. package/dist/cake/engine/selection/selection-geometry.d.ts.map +1 -0
  33. package/dist/cake/engine/selection/selection-geometry.js +158 -0
  34. package/dist/cake/engine/selection/selection-layout-dom.d.ts +1 -0
  35. package/dist/cake/engine/selection/selection-layout-dom.d.ts.map +1 -0
  36. package/dist/cake/engine/selection/selection-layout-dom.js +781 -0
  37. package/dist/cake/engine/selection/selection-layout.d.ts +1 -0
  38. package/dist/cake/engine/selection/selection-layout.d.ts.map +1 -0
  39. package/dist/cake/engine/selection/selection-layout.js +128 -0
  40. package/dist/cake/engine/selection/selection-navigation.d.ts +1 -0
  41. package/dist/cake/engine/selection/selection-navigation.d.ts.map +1 -0
  42. package/dist/cake/engine/selection/selection-navigation.js +229 -0
  43. package/dist/cake/engine/selection/visible-text.d.ts +1 -0
  44. package/dist/cake/engine/selection/visible-text.d.ts.map +1 -0
  45. package/dist/cake/engine/selection/visible-text.js +66 -0
  46. package/dist/cake/extensions/blockquote/blockquote.d.ts +1 -0
  47. package/dist/cake/extensions/blockquote/blockquote.d.ts.map +1 -0
  48. package/dist/cake/extensions/blockquote/blockquote.js +177 -0
  49. package/dist/cake/extensions/blockquote/index.d.ts +2 -0
  50. package/dist/cake/extensions/blockquote/index.d.ts.map +1 -0
  51. package/dist/cake/extensions/blockquote/index.js +1 -0
  52. package/dist/cake/extensions/bold/bold.d.ts +1 -0
  53. package/dist/cake/extensions/bold/bold.d.ts.map +1 -0
  54. package/dist/cake/extensions/bold/bold.js +113 -0
  55. package/dist/cake/extensions/bold/index.d.ts +2 -0
  56. package/dist/cake/extensions/bold/index.d.ts.map +1 -0
  57. package/dist/cake/extensions/bold/index.js +1 -0
  58. package/dist/cake/extensions/bundles.d.ts +1 -0
  59. package/dist/cake/extensions/bundles.d.ts.map +1 -0
  60. package/dist/cake/extensions/bundles.js +12 -0
  61. package/dist/cake/extensions/combined-emphasis/combined-emphasis.d.ts +1 -0
  62. package/dist/cake/extensions/combined-emphasis/combined-emphasis.d.ts.map +1 -0
  63. package/dist/cake/extensions/combined-emphasis/combined-emphasis.js +42 -0
  64. package/dist/cake/extensions/combined-emphasis/index.d.ts +2 -0
  65. package/dist/cake/extensions/combined-emphasis/index.d.ts.map +1 -0
  66. package/dist/cake/extensions/combined-emphasis/index.js +1 -0
  67. package/dist/cake/extensions/heading/heading.d.ts +1 -0
  68. package/dist/cake/extensions/heading/heading.d.ts.map +1 -0
  69. package/dist/cake/extensions/heading/heading.js +337 -0
  70. package/dist/cake/extensions/heading/index.d.ts +2 -0
  71. package/dist/cake/extensions/heading/index.d.ts.map +1 -0
  72. package/dist/cake/extensions/heading/index.js +1 -0
  73. package/dist/cake/extensions/image/image.d.ts +1 -0
  74. package/dist/cake/extensions/image/image.d.ts.map +1 -0
  75. package/dist/cake/extensions/image/image.js +120 -0
  76. package/dist/cake/extensions/image/index.d.ts +2 -0
  77. package/dist/cake/extensions/image/index.d.ts.map +1 -0
  78. package/dist/cake/extensions/image/index.js +1 -0
  79. package/dist/cake/extensions/index.d.ts +2 -2
  80. package/dist/cake/extensions/index.d.ts.map +1 -0
  81. package/dist/cake/extensions/index.js +25 -0
  82. package/dist/cake/extensions/italic/index.d.ts +2 -0
  83. package/dist/cake/extensions/italic/index.d.ts.map +1 -0
  84. package/dist/cake/extensions/italic/index.js +1 -0
  85. package/dist/cake/extensions/italic/italic.d.ts +1 -0
  86. package/dist/cake/extensions/italic/italic.d.ts.map +1 -0
  87. package/dist/cake/extensions/italic/italic.js +91 -0
  88. package/dist/cake/extensions/link/index.d.ts +2 -0
  89. package/dist/cake/extensions/link/index.d.ts.map +1 -0
  90. package/dist/cake/extensions/link/index.js +1 -0
  91. package/dist/cake/extensions/link/link-popover.d.ts +1 -0
  92. package/dist/cake/extensions/link/link-popover.d.ts.map +1 -0
  93. package/dist/cake/extensions/link/link-popover.js +205 -0
  94. package/dist/cake/extensions/link/link.d.ts +1 -0
  95. package/dist/cake/extensions/link/link.d.ts.map +1 -0
  96. package/dist/cake/extensions/link/link.js +202 -0
  97. package/dist/cake/extensions/list/index.d.ts +2 -0
  98. package/dist/cake/extensions/list/index.d.ts.map +1 -0
  99. package/dist/cake/extensions/list/index.js +1 -0
  100. package/dist/cake/extensions/list/list-ast.d.ts +1 -0
  101. package/dist/cake/extensions/list/list-ast.d.ts.map +1 -0
  102. package/dist/cake/extensions/list/list-ast.js +248 -0
  103. package/dist/cake/extensions/list/list.d.ts +1 -0
  104. package/dist/cake/extensions/list/list.d.ts.map +1 -0
  105. package/dist/cake/extensions/list/list.js +859 -0
  106. package/dist/cake/extensions/scrollbar/index.d.ts +1 -0
  107. package/dist/cake/extensions/scrollbar/index.d.ts.map +1 -0
  108. package/dist/cake/extensions/scrollbar/index.js +216 -0
  109. package/dist/cake/extensions/strikethrough/index.d.ts +2 -0
  110. package/dist/cake/extensions/strikethrough/index.d.ts.map +1 -0
  111. package/dist/cake/extensions/strikethrough/index.js +1 -0
  112. package/dist/cake/extensions/strikethrough/strikethrough.d.ts +1 -0
  113. package/dist/cake/extensions/strikethrough/strikethrough.d.ts.map +1 -0
  114. package/dist/cake/extensions/strikethrough/strikethrough.js +84 -0
  115. package/dist/cake/extensions/types.d.ts +1 -0
  116. package/dist/cake/extensions/types.d.ts.map +1 -0
  117. package/dist/cake/extensions/types.js +1 -0
  118. package/dist/cake/index.d.ts +1 -0
  119. package/dist/cake/index.d.ts.map +1 -0
  120. package/dist/cake/index.js +1 -0
  121. package/dist/cake/react/CakeEditor.d.ts +1 -0
  122. package/dist/cake/react/CakeEditor.d.ts.map +1 -0
  123. package/dist/cake/react/CakeEditor.js +233 -0
  124. package/dist/cake/shared/platform.d.ts +1 -0
  125. package/dist/cake/shared/platform.d.ts.map +1 -0
  126. package/dist/cake/shared/platform.js +19 -0
  127. package/dist/cake/shared/segmenter.d.ts +1 -0
  128. package/dist/cake/shared/segmenter.d.ts.map +1 -0
  129. package/dist/cake/shared/segmenter.js +46 -0
  130. package/dist/cake/shared/url.d.ts +1 -0
  131. package/dist/cake/shared/url.d.ts.map +1 -0
  132. package/dist/cake/shared/url.js +37 -0
  133. package/dist/cake/shared/word-break.d.ts +1 -0
  134. package/dist/cake/shared/word-break.d.ts.map +1 -0
  135. package/dist/cake/shared/word-break.js +178 -0
  136. package/dist/cake/test/harness.d.ts +1 -0
  137. package/dist/cake/test/harness.d.ts.map +1 -0
  138. package/dist/cake/test/harness.js +504 -0
  139. package/dist/codemirror/markdown-commands.d.ts +1 -0
  140. package/dist/codemirror/markdown-commands.d.ts.map +1 -0
  141. package/dist/codemirror/markdown-commands.js +532 -0
  142. package/dist/index.d.ts +1 -0
  143. package/dist/index.d.ts.map +1 -0
  144. package/dist/index.js +3 -11793
  145. package/package.json +8 -6
  146. package/dist/cake/extensions/pipe-link/pipe-link.d.ts +0 -1
  147. package/dist/index.cjs +0 -11793
@@ -1 +1,2 @@
1
1
  export declare function htmlToMarkdownForPaste(htmlContent: string): string | null;
2
+ //# sourceMappingURL=clipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/cake/clipboard.ts"],"names":[],"mappings":"AA6dA,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYzE"}
@@ -0,0 +1,391 @@
1
+ import TurndownService from "turndown";
2
+ const MAX_HTML_INPUT_LENGTH = 500000;
3
+ const MAX_MARKDOWN_OUTPUT_LENGTH = 100000;
4
+ function isHTMLElement(node) {
5
+ return node !== null && node.nodeType === Node.ELEMENT_NODE;
6
+ }
7
+ function isElement(node) {
8
+ return node !== null && node.nodeType === Node.ELEMENT_NODE;
9
+ }
10
+ const CLEANUP_PATTERNS = {
11
+ unescapeHeaders: /^\\(#{1,6})\s+/gm,
12
+ unescapeBlockquote: /^\\>/gm,
13
+ unescapeMarkdown: /\\([*_`~[\]])/g,
14
+ unescapeListBullets: /^(\s*)\\([-*+])(\s+)/gm,
15
+ unescapeListNumbers: /^(\s*)(\d+)\\\.(\s+)/gm,
16
+ normalizeBullets: /^(\s*)[-*+](\s{2,})/gm,
17
+ normalizeNumbers: /^[\s]*\d+\.[\s]+/gm,
18
+ normalizeHeaders: /^(#{1,6})[\s]{2,}/gm,
19
+ removeTrailingSpaces: /[ \t]+$/gm,
20
+ headersInBlockquotes: /^>\s*(#{1,6}\s+.*)/gm,
21
+ excessiveNewlines: /\n{3,}/g,
22
+ interlacedTableGaps: /(\|[^\n]*\|)\s*\n\s*\n+\s*(\|[^\n]*\|)/g,
23
+ complexTableGaps: /(\|[^\n]*\|)(\s*\n){2,}(\|[^\n]*\|)/g,
24
+ };
25
+ const HTML_PREPROCESSING_PATTERNS = {
26
+ removeStyleAndDataAttrs: /\s(?:style|data-[^=]*|id)="[^"]*"/gi,
27
+ removeNonCodeClasses: /\sclass="(?![^"]*(?:language-|hljs))[^"]*"/gi,
28
+ removeEmptyElements: /<(\w+)[^>]*>\s*<\/\1>/gi,
29
+ normalizeSpaces: /[ \t]{2,}/g,
30
+ reduceBlankLines: /\n\s*\n/g,
31
+ };
32
+ const turndownService = new TurndownService({
33
+ headingStyle: "atx",
34
+ bulletListMarker: "-",
35
+ codeBlockStyle: "fenced",
36
+ fence: "```",
37
+ emDelimiter: "*",
38
+ strongDelimiter: "**",
39
+ linkStyle: "inlined",
40
+ linkReferenceStyle: "full",
41
+ });
42
+ turndownService.addRule("strikethrough", {
43
+ filter: ["del", "s"],
44
+ replacement: (content) => `~~${content}~~`,
45
+ });
46
+ turndownService.addRule("codeBlock", {
47
+ filter: "pre",
48
+ replacement: (content, node) => {
49
+ if (!isHTMLElement(node)) {
50
+ return `\n\`\`\`\n${content}\n\`\`\`\n`;
51
+ }
52
+ const codeElement = node.querySelector("code");
53
+ if (codeElement) {
54
+ const className = codeElement.className || "";
55
+ const languageMatch = className.match(/language-(\w+)/);
56
+ const language = languageMatch ? languageMatch[1] : "";
57
+ return `\n\`\`\`${language}\n${codeElement.textContent ?? ""}\n\`\`\`\n`;
58
+ }
59
+ return `\n\`\`\`\n${content}\n\`\`\`\n`;
60
+ },
61
+ });
62
+ turndownService.addRule("tableRow", {
63
+ filter: "tr",
64
+ replacement: (_content, node) => {
65
+ if (!isHTMLElement(node)) {
66
+ return "";
67
+ }
68
+ const isHeaderRow = node.parentNode?.nodeName === "THEAD";
69
+ const cells = Array.from(node.querySelectorAll("td, th"));
70
+ const cellContents = cells.map((cell) => {
71
+ const text = cell.textContent || "";
72
+ return text.replace(/\|/g, "\\|").trim();
73
+ });
74
+ let result = "| " + cellContents.join(" | ") + " |\n";
75
+ if (isHeaderRow) {
76
+ const separators = cells.map((cell) => {
77
+ const align = cell.getAttribute("align");
78
+ if (align === "center") {
79
+ return ":-------------:";
80
+ }
81
+ if (align === "right") {
82
+ return "-------------:";
83
+ }
84
+ return "-------------";
85
+ });
86
+ result += "| " + separators.join(" | ") + " |\n";
87
+ }
88
+ return result;
89
+ },
90
+ });
91
+ turndownService.addRule("taskList", {
92
+ filter: (node) => {
93
+ if (!isHTMLElement(node)) {
94
+ return false;
95
+ }
96
+ if (node.nodeName !== "LI") {
97
+ return false;
98
+ }
99
+ if (node.querySelector('input[type="checkbox"]') !== null) {
100
+ return true;
101
+ }
102
+ const textContent = node.textContent || "";
103
+ const hasCheckboxSymbols = /^[\s]*[☐☑✓✗[\]]/m.test(textContent) ||
104
+ /^[\s]*\[[ x]\]/m.test(textContent);
105
+ const hasCheckboxClass = Boolean(node.className &&
106
+ (node.className.includes("task") ||
107
+ node.className.includes("checkbox") ||
108
+ node.className.includes("todo")));
109
+ return hasCheckboxSymbols || hasCheckboxClass;
110
+ },
111
+ replacement: (content, node) => {
112
+ if (!isHTMLElement(node)) {
113
+ return content;
114
+ }
115
+ const checkbox = node.querySelector('input[type="checkbox"]');
116
+ const isCheckbox = checkbox instanceof HTMLInputElement && checkbox.type === "checkbox";
117
+ let isChecked = false;
118
+ if (isCheckbox) {
119
+ isChecked = checkbox.checked;
120
+ }
121
+ else {
122
+ const textContent = node.textContent || "";
123
+ isChecked =
124
+ /^[\s]*[☑✓✗]/.test(textContent) || /^[\s]*\[x\]/i.test(textContent);
125
+ }
126
+ const prefix = isChecked ? "- [x] " : "- [ ] ";
127
+ let textContent = content;
128
+ textContent = textContent.replace(/^\s*\[[ x]\]\s*/gi, "");
129
+ textContent = textContent.replace(/^\s*[☐☑✓✗]\s*/g, "");
130
+ textContent = textContent.replace(/^\s*\[[x ]\]\s*/gi, "");
131
+ textContent = textContent.replace(/^\s*\\?\[[ x]\\?\]\s*/gi, "");
132
+ textContent = textContent.replace(/\\?\[\\?\s*\\?\]\\?\s*/g, "");
133
+ return prefix + textContent.trim() + "\n";
134
+ },
135
+ });
136
+ turndownService.addRule("list", {
137
+ filter: ["ul", "ol"],
138
+ replacement: (content, node) => {
139
+ const parent = node.parentNode;
140
+ const isNested = isElement(parent) && parent.tagName === "LI";
141
+ if (isNested) {
142
+ return "\n" + content;
143
+ }
144
+ return "\n" + content + "\n";
145
+ },
146
+ });
147
+ turndownService.addRule("blockquote", {
148
+ filter: "blockquote",
149
+ replacement: (content) => {
150
+ const lines = content.trim().split("\n");
151
+ const processedLines = lines.map((line) => {
152
+ const trimmed = line.trim();
153
+ if (!trimmed) {
154
+ return ">";
155
+ }
156
+ const existingQuotes = trimmed.match(/^(>\s*)+/);
157
+ if (existingQuotes) {
158
+ return existingQuotes[0] + " " + trimmed;
159
+ }
160
+ return "> " + trimmed;
161
+ });
162
+ return "\n" + processedLines.join("\n") + "\n";
163
+ },
164
+ });
165
+ turndownService.addRule("horizontalRule", {
166
+ filter: "hr",
167
+ replacement: () => "\n---\n",
168
+ });
169
+ turndownService.addRule("inlineCode", {
170
+ filter: (node) => {
171
+ const parent = node.parentNode;
172
+ return (node.nodeName === "CODE" &&
173
+ !(isElement(parent) && parent.tagName === "PRE"));
174
+ },
175
+ replacement: (content) => {
176
+ const backtickCount = Math.max(1, (content.match(/`+/g) || []).reduce((max, match) => Math.max(max, match.length), 0) + 1);
177
+ const delimiter = "`".repeat(backtickCount);
178
+ return delimiter + content + delimiter;
179
+ },
180
+ });
181
+ turndownService.addRule("image", {
182
+ filter: "img",
183
+ replacement: (_content, node) => {
184
+ if (!isHTMLElement(node)) {
185
+ return "";
186
+ }
187
+ const src = node.getAttribute("src") || "";
188
+ const alt = node.getAttribute("alt") || "";
189
+ const title = node.getAttribute("title");
190
+ if (title) {
191
+ return `![${alt}](${src} "${title}")`;
192
+ }
193
+ return `![${alt}](${src})`;
194
+ },
195
+ });
196
+ turndownService.addRule("highlight", {
197
+ filter: (node) => {
198
+ if (!isHTMLElement(node)) {
199
+ return false;
200
+ }
201
+ return (node.nodeName === "MARK" ||
202
+ (node.nodeName === "SPAN" &&
203
+ (node.style?.backgroundColor === "yellow" ||
204
+ node.className?.includes("highlight"))));
205
+ },
206
+ replacement: (content) => `==${content}==`,
207
+ });
208
+ turndownService.addRule("headerWithId", {
209
+ filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
210
+ replacement: (content, node) => {
211
+ if (!isHTMLElement(node)) {
212
+ return content;
213
+ }
214
+ const rawLevel = parseInt(node.nodeName.charAt(1));
215
+ const level = Math.min(rawLevel, 3);
216
+ const hashes = "#".repeat(level);
217
+ const id = node.getAttribute("id");
218
+ if (id) {
219
+ return `\n${hashes} ${content} {#${id}}\n`;
220
+ }
221
+ return `\n${hashes} ${content}\n`;
222
+ },
223
+ });
224
+ function processTextNodes(element) {
225
+ const spans = Array.from(element.querySelectorAll("span"));
226
+ spans.forEach((span) => {
227
+ const textContent = span.textContent || "";
228
+ const textNode = document.createTextNode(textContent);
229
+ span.parentNode?.replaceChild(textNode, span);
230
+ });
231
+ }
232
+ function detectSourceApp(html) {
233
+ const detectionPatterns = {
234
+ notion: ["notion-", "notranslate"],
235
+ github: ["github.com", "js-file-line-container"],
236
+ slack: ["slack-", "c-message"],
237
+ "google-docs": ["docs.google.com", "kix-"],
238
+ };
239
+ for (const [app, patterns] of Object.entries(detectionPatterns)) {
240
+ if (patterns.some((pattern) => html.includes(pattern))) {
241
+ return app;
242
+ }
243
+ }
244
+ return "unknown";
245
+ }
246
+ function preprocessForApp(html, app) {
247
+ switch (app) {
248
+ case "notion":
249
+ return html
250
+ .replace(/<div[^>]*class="[^"]*notion-[^"]*"[^>]*>/gi, "<div>")
251
+ .replace(/<span[^>]*class="[^"]*notion-[^"]*"[^>]*>/gi, "<span>")
252
+ .replace(/<details[^>]*>/gi, "<div>")
253
+ .replace(/<\/details>/gi, "</div>")
254
+ .replace(/<summary[^>]*>/gi, "<strong>")
255
+ .replace(/<\/summary>/gi, "</strong>");
256
+ case "github":
257
+ return html
258
+ .replace(/<td[^>]*class="[^"]*blob-num[^"]*"[^>]*>.*?<\/td>/gi, "")
259
+ .replace(/<span[^>]*class="[^"]*pl-[^"]*"[^>]*>/gi, "<span>")
260
+ .replace(/<span[^>]*class="[^"]*highlight[^"]*"[^>]*>/gi, "<span>");
261
+ case "slack":
262
+ return html
263
+ .replace(/<span[^>]*class="[^"]*c-member[^"]*"[^>]*>/gi, "<span>")
264
+ .replace(/<span[^>]*data-stringify-type="mention"[^>]*>/gi, "<span>")
265
+ .replace(/<span[^>]*class="[^"]*c-emoji[^"]*"[^>]*>([^<]*)<\/span>/gi, "$1");
266
+ case "google-docs":
267
+ return html
268
+ .replace(/<span[^>]*style="[^"]*font-weight:[^;"]*bold[^"]*"[^>]*>/gi, "<strong>")
269
+ .replace(/<span[^>]*style="[^"]*font-style:[^;"]*italic[^"]*"[^>]*>/gi, "<em>")
270
+ .replace(/<\/span>/gi, "")
271
+ .replace(/<p[^>]*style="[^"]*"[^>]*>/gi, "<p>");
272
+ default:
273
+ return html;
274
+ }
275
+ }
276
+ function cleanupMarkdown(markdown) {
277
+ return (markdown
278
+ .replace(CLEANUP_PATTERNS.unescapeHeaders, "$1 ")
279
+ .replace(CLEANUP_PATTERNS.unescapeBlockquote, ">")
280
+ .replace(CLEANUP_PATTERNS.unescapeMarkdown, "$1")
281
+ .replace(CLEANUP_PATTERNS.unescapeListBullets, "$1$2$3")
282
+ .replace(CLEANUP_PATTERNS.unescapeListNumbers, "$1$2.$3")
283
+ .replace(CLEANUP_PATTERNS.normalizeBullets, "$1- ")
284
+ .replace(CLEANUP_PATTERNS.normalizeNumbers, (match) => {
285
+ const num = match.match(/\d+/)?.[0] || "1";
286
+ return `${num}. `;
287
+ })
288
+ .replace(CLEANUP_PATTERNS.normalizeHeaders, "$1 ")
289
+ .replace(CLEANUP_PATTERNS.removeTrailingSpaces, "")
290
+ .replace(CLEANUP_PATTERNS.headersInBlockquotes, "\n$1")
291
+ .replace(CLEANUP_PATTERNS.excessiveNewlines, "\n\n")
292
+ .replace(CLEANUP_PATTERNS.interlacedTableGaps, "$1\n$2")
293
+ .replace(CLEANUP_PATTERNS.complexTableGaps, "$1\n$3")
294
+ // Keep inline formatting markers inside link labels
295
+ .replace(/\*\*\[([^\]]+?)\]\(([^)]+?)\)\*\*/g, "[**$1**]($2)")
296
+ .replace(/__\[([^\]]+?)\]\(([^)]+?)\)__/g, "[**$1**]($2)")
297
+ .replace(/\*\[([^\]]+?)\]\(([^)]+?)\)\*/g, "[*$1*]($2)")
298
+ .replace(/_\[([^\]]+?)\]\(([^)]+?)\)_/g, "[*$1*]($2)")
299
+ .trim());
300
+ }
301
+ function preprocessHtml(html) {
302
+ const sourceApp = detectSourceApp(html);
303
+ let processedHtml = preprocessForApp(html, sourceApp);
304
+ const parser = new DOMParser();
305
+ const doc = parser.parseFromString(processedHtml, "text/html");
306
+ if (doc.body) {
307
+ processTextNodes(doc.body);
308
+ processedHtml = doc.body.innerHTML;
309
+ }
310
+ return processedHtml
311
+ .replace(HTML_PREPROCESSING_PATTERNS.removeStyleAndDataAttrs, "")
312
+ .replace(HTML_PREPROCESSING_PATTERNS.removeNonCodeClasses, "")
313
+ .replace(HTML_PREPROCESSING_PATTERNS.removeEmptyElements, "")
314
+ .replace(HTML_PREPROCESSING_PATTERNS.normalizeSpaces, " ")
315
+ .replace(HTML_PREPROCESSING_PATTERNS.reduceBlankLines, "\n\n")
316
+ .trim();
317
+ }
318
+ function sanitizeContent(content) {
319
+ return content
320
+ .replace(/<script[^>]*>.*?<\/script>/gi, "")
321
+ .replace(/<(?:iframe|object|embed)[^>]*>.*?<\/(?:iframe|object|embed)>/gi, "");
322
+ }
323
+ function limitContentLength(content, maxLength = MAX_MARKDOWN_OUTPUT_LENGTH) {
324
+ return content.substring(0, maxLength);
325
+ }
326
+ function sanitizeMarkdown(markdown) {
327
+ return limitContentLength(sanitizeContent(markdown));
328
+ }
329
+ function shouldProcessPaste(htmlContent) {
330
+ if (htmlContent.length > MAX_HTML_INPUT_LENGTH) {
331
+ console.warn("HTML content too large for paste processing");
332
+ return false;
333
+ }
334
+ const hasFormatting = /<(?:strong|b|em|i|u|s|del|strike|code|pre|h[1-6]|blockquote|ul|ol|li|table|tr|td|th|a|img|mark|span|div)[\s>]/i.test(htmlContent);
335
+ if (!hasFormatting) {
336
+ return false;
337
+ }
338
+ // Images are self-closing and have no text content, so allow them
339
+ if (/<img\s/i.test(htmlContent)) {
340
+ return true;
341
+ }
342
+ const strippedContent = htmlContent.replace(/<[^>]*>/g, "").trim();
343
+ if (!strippedContent || strippedContent.length < 3) {
344
+ return false;
345
+ }
346
+ return true;
347
+ }
348
+ function normalizeListPrefixes(content) {
349
+ const lines = content.split("\n");
350
+ let currentListType = null;
351
+ let currentNumber = 1;
352
+ return lines
353
+ .map((line) => {
354
+ const match = line.match(/^(\s*)([-*+]|\d+\.)( +)(.*)$/);
355
+ if (match) {
356
+ const [, indent, marker, , listContent] = match;
357
+ if (currentListType === null) {
358
+ currentListType = /\d+\./.test(marker) ? "numbered" : "bullet";
359
+ }
360
+ const newMarker = currentListType === "bullet" ? "-" : `${currentNumber}.`;
361
+ if (currentListType === "numbered") {
362
+ currentNumber += 1;
363
+ }
364
+ return `${indent}${newMarker} ${listContent}`;
365
+ }
366
+ return line;
367
+ })
368
+ .join("\n");
369
+ }
370
+ function convertHtmlToMarkdown(html) {
371
+ try {
372
+ const processedHtml = preprocessHtml(html);
373
+ const markdown = turndownService.turndown(processedHtml);
374
+ return cleanupMarkdown(markdown);
375
+ }
376
+ catch (error) {
377
+ console.error("Error converting HTML to markdown:", error);
378
+ return "";
379
+ }
380
+ }
381
+ export function htmlToMarkdownForPaste(htmlContent) {
382
+ if (!shouldProcessPaste(htmlContent)) {
383
+ return null;
384
+ }
385
+ const markdown = convertHtmlToMarkdown(htmlContent);
386
+ if (!markdown.trim()) {
387
+ return null;
388
+ }
389
+ const normalizedMarkdown = normalizeListPrefixes(markdown);
390
+ return sanitizeMarkdown(normalizedMarkdown).replace(/\r\n?/g, "\n");
391
+ }
@@ -30,3 +30,4 @@ export declare class CursorSourceBuilder {
30
30
  map: CursorSourceMap;
31
31
  };
32
32
  }
33
+ //# sourceMappingURL=cursor-source-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor-source-map.d.ts","sourceRoot":"","sources":["../../../../src/cake/core/mapping/cursor-source-map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IACjE,cAAc,CACZ,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,QAAQ,GACb;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,QAAQ,CAAA;KAAE,CAAC;CACjD,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,cAAc,EAAE,EAC5B,YAAY,EAAE,MAAM,GACnB,eAAe,CA4CjB;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,UAAU,CAEhB;IACF,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,iBAAiB,CAAK;IAE9B,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAWpC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA0C9B,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,SAAI,GAAG,IAAI;IAiB3D,gBAAgB,CAAC,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,eAAe,CAAA;KAAE,GAAG,IAAI;IA2B5E,KAAK,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,eAAe,CAAA;KAAE;CAOlD"}
@@ -0,0 +1,146 @@
1
+ import { graphemeSegments } from "../../shared/segmenter";
2
+ export function createCursorSourceMap(boundaries, cursorLength) {
3
+ return {
4
+ cursorLength,
5
+ boundaries,
6
+ cursorToSource(cursorOffset, affinity) {
7
+ const boundary = boundaries[cursorOffset];
8
+ if (!boundary) {
9
+ throw new Error(`Cursor offset out of bounds: ${cursorOffset}`);
10
+ }
11
+ return affinity === "backward"
12
+ ? boundary.sourceBackward
13
+ : boundary.sourceForward;
14
+ },
15
+ sourceToCursor(sourceOffset, bias) {
16
+ if (sourceOffset <= 0) {
17
+ return { cursorOffset: 0, affinity: bias };
18
+ }
19
+ const lastIndex = boundaries.length - 1;
20
+ const lastBoundary = boundaries[lastIndex];
21
+ if (sourceOffset >= lastBoundary.sourceForward) {
22
+ return { cursorOffset: lastIndex, affinity: bias };
23
+ }
24
+ for (let i = 0; i < boundaries.length; i += 1) {
25
+ const boundary = boundaries[i];
26
+ if (sourceOffset > boundary.sourceForward) {
27
+ continue;
28
+ }
29
+ if (sourceOffset < boundary.sourceBackward) {
30
+ if (bias === "forward") {
31
+ return { cursorOffset: i, affinity: "forward" };
32
+ }
33
+ const prevIndex = Math.max(0, i - 1);
34
+ return { cursorOffset: prevIndex, affinity: "backward" };
35
+ }
36
+ return { cursorOffset: i, affinity: bias };
37
+ }
38
+ return { cursorOffset: lastIndex, affinity: bias };
39
+ },
40
+ };
41
+ }
42
+ export class CursorSourceBuilder {
43
+ constructor() {
44
+ this.sourceParts = [];
45
+ this.boundaries = [
46
+ { sourceBackward: 0, sourceForward: 0 },
47
+ ];
48
+ this.cursorLength = 0;
49
+ this.sourceLengthValue = 0;
50
+ }
51
+ appendSourceOnly(text) {
52
+ if (!text) {
53
+ return;
54
+ }
55
+ this.sourceParts.push(text);
56
+ this.sourceLengthValue += text.length;
57
+ const last = this.boundaries[this.boundaries.length - 1];
58
+ last.sourceForward += text.length;
59
+ }
60
+ appendText(text) {
61
+ if (!text) {
62
+ return;
63
+ }
64
+ // Fast path: check if entire text is ASCII
65
+ let isAllAscii = true;
66
+ for (let i = 0; i < text.length; i++) {
67
+ if (text.charCodeAt(i) >= 0x80) {
68
+ isAllAscii = false;
69
+ break;
70
+ }
71
+ }
72
+ if (isAllAscii) {
73
+ // ASCII fast path: each character is one grapheme
74
+ for (let i = 0; i < text.length; i++) {
75
+ const char = text[i];
76
+ this.sourceParts.push(char);
77
+ this.sourceLengthValue += 1;
78
+ const sourceLength = this.sourceLengthValue;
79
+ this.cursorLength += 1;
80
+ this.boundaries.push({
81
+ sourceBackward: sourceLength,
82
+ sourceForward: sourceLength,
83
+ });
84
+ }
85
+ }
86
+ else {
87
+ // Non-ASCII: use grapheme segmenter for proper Unicode handling
88
+ for (const segment of graphemeSegments(text)) {
89
+ this.sourceParts.push(segment.segment);
90
+ this.sourceLengthValue += segment.segment.length;
91
+ const sourceLength = this.sourceLengthValue;
92
+ this.cursorLength += 1;
93
+ this.boundaries.push({
94
+ sourceBackward: sourceLength,
95
+ sourceForward: sourceLength,
96
+ });
97
+ }
98
+ }
99
+ }
100
+ appendCursorAtom(sourceText, cursorUnits = 1) {
101
+ if (cursorUnits < 1) {
102
+ return;
103
+ }
104
+ this.sourceParts.push(sourceText);
105
+ this.sourceLengthValue += sourceText.length;
106
+ const sourceLength = this.sourceLengthValue;
107
+ for (let i = 0; i < cursorUnits; i += 1) {
108
+ this.cursorLength += 1;
109
+ this.boundaries.push({
110
+ sourceBackward: sourceLength,
111
+ sourceForward: sourceLength,
112
+ });
113
+ }
114
+ }
115
+ appendSerialized(serialized) {
116
+ if (!serialized.source && serialized.map.cursorLength === 0) {
117
+ return;
118
+ }
119
+ const base = this.sourceLengthValue;
120
+ const firstBoundary = serialized.map.boundaries[0];
121
+ if (firstBoundary) {
122
+ const last = this.boundaries[this.boundaries.length - 1];
123
+ last.sourceBackward += firstBoundary.sourceBackward;
124
+ last.sourceForward += firstBoundary.sourceForward;
125
+ }
126
+ if (serialized.source) {
127
+ this.sourceParts.push(serialized.source);
128
+ this.sourceLengthValue += serialized.source.length;
129
+ }
130
+ for (let i = 1; i < serialized.map.boundaries.length; i += 1) {
131
+ const boundary = serialized.map.boundaries[i];
132
+ this.cursorLength += 1;
133
+ this.boundaries.push({
134
+ sourceBackward: base + boundary.sourceBackward,
135
+ sourceForward: base + boundary.sourceForward,
136
+ });
137
+ }
138
+ }
139
+ build() {
140
+ const source = this.sourceParts.join("");
141
+ return {
142
+ source,
143
+ map: createCursorSourceMap(this.boundaries, this.cursorLength),
144
+ };
145
+ }
146
+ }
@@ -177,3 +177,4 @@ export type Runtime = {
177
177
  };
178
178
  export declare function createRuntime(extensions: CakeExtension[]): Runtime;
179
179
  export {};
180
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/cake/core/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,KAAK,EAAE,GAAG,EAAE,MAAM,EAAkB,SAAS,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,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