@k2b/editor 0.13.0 → 0.15.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Configurable Markdown editor for SolidJS: editor, toolbar, bubble menu, and slash menu on one shared state.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"@codemirror/search": "6.7.2",
|
|
71
71
|
"@codemirror/state": "6.7.6",
|
|
72
72
|
"@codemirror/view": "6.43.15",
|
|
73
|
-
"@k2b/stdlib": "0.36.
|
|
74
|
-
"@k2b/ui": "0.
|
|
73
|
+
"@k2b/stdlib": "0.36.1",
|
|
74
|
+
"@k2b/ui": "0.65.0",
|
|
75
75
|
"@lezer/common": "1.5.5",
|
|
76
76
|
"@lezer/highlight": "1.2.5",
|
|
77
77
|
"@lezer/markdown": "1.8.1",
|
package/src/markdown/images.ts
CHANGED
|
@@ -50,8 +50,8 @@ class ImageWidget extends WidgetType {
|
|
|
50
50
|
// the user's `=WxH` actually wins.
|
|
51
51
|
img.className =
|
|
52
52
|
this.width || this.height
|
|
53
|
-
? "block rounded border border-gray-200 dark:border-gray-700"
|
|
54
|
-
: "block max-h-[400px] rounded border border-gray-200 dark:border-gray-700";
|
|
53
|
+
? "block rounded border not-dark:border-gray-200 dark:border-gray-700"
|
|
54
|
+
: "block max-h-[400px] rounded border not-dark:border-gray-200 dark:border-gray-700";
|
|
55
55
|
img.src = this.url;
|
|
56
56
|
img.alt = this.alt || "";
|
|
57
57
|
if (this.title !== null) img.title = this.title;
|
|
@@ -70,7 +70,7 @@ class ImageWidget extends WidgetType {
|
|
|
70
70
|
|
|
71
71
|
if (this.alt) {
|
|
72
72
|
const caption = document.createElement("figcaption");
|
|
73
|
-
caption.className = "text-sm text-gray-500 dark:text-gray-400 mt-2 italic";
|
|
73
|
+
caption.className = "text-sm not-dark:text-gray-500 dark:text-gray-400 mt-2 italic";
|
|
74
74
|
caption.textContent = this.alt;
|
|
75
75
|
figure.appendChild(img);
|
|
76
76
|
figure.appendChild(caption);
|
|
@@ -25,7 +25,7 @@ const renderContent = (content: string): string => {
|
|
|
25
25
|
const codeSpans: string[] = [];
|
|
26
26
|
return escapeHtml(content)
|
|
27
27
|
.replace(/`([^`]+)`/g, (_match, body: string) => {
|
|
28
|
-
const index = codeSpans.push(`<code class="bg-black/10 dark:bg-white/10 px-1 py-0.5 rounded text-sm">${body}</code>`) - 1;
|
|
28
|
+
const index = codeSpans.push(`<code class="not-dark:bg-black/10 dark:bg-white/10 px-1 py-0.5 rounded text-sm">${body}</code>`) - 1;
|
|
29
29
|
return `\u0000CODE${index}\u0000`;
|
|
30
30
|
})
|
|
31
31
|
.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>")
|
|
@@ -66,7 +66,7 @@ export function MermaidEditorPreview(props: {
|
|
|
66
66
|
<span class="text-sm font-mono">{t().invalidMermaid}</span>
|
|
67
67
|
<details class="text-xs text-gray-500 max-w-full">
|
|
68
68
|
<summary class="cursor-pointer hover:text-gray-700 dark:hover:text-gray-300">{t().showErrorDetails}</summary>
|
|
69
|
-
<pre class="mt-2 p-2 bg-gray-100 dark:bg-gray-800 rounded text-left overflow-x-auto">{message()}</pre>
|
|
69
|
+
<pre class="mt-2 p-2 not-dark:bg-gray-100 dark:bg-gray-800 rounded text-left overflow-x-auto">{message()}</pre>
|
|
70
70
|
</details>
|
|
71
71
|
</div>
|
|
72
72
|
)}
|
|
@@ -99,7 +99,7 @@ const renderInlineMarkdown = (raw: string, options: PrettyTableOptions, locale?:
|
|
|
99
99
|
const withTags = formatted.replace(TAG_RE, (_match, prefix: string, tag: string) => {
|
|
100
100
|
const href = options.resolveUrl?.("tag", tag.toLowerCase()) ?? "#";
|
|
101
101
|
const title = prettyTableMessages.resolve(locale ? [locale] : []).t.showNotesWithTag({ tag: tag.toLowerCase() });
|
|
102
|
-
return `${prefix}<a href="${escapeHtml(href)}" class="cm-tag-pill inline-flex items-center px-1.5 py-0.5 rounded bg-emerald-50 dark:bg-emerald-950/40 text-emerald-700 dark:text-emerald-300 hover:bg-emerald-100 dark:hover:bg-emerald-900/50 no-underline align-baseline font-medium" title="${escapeHtml(title)}">#${escapeHtml(tag)}</a>`;
|
|
102
|
+
return `${prefix}<a href="${escapeHtml(href)}" class="cm-tag-pill inline-flex items-center px-1.5 py-0.5 rounded not-dark:bg-emerald-50 dark:bg-emerald-950/40 not-dark:text-emerald-700 dark:text-emerald-300 hover:bg-emerald-100 dark:hover:bg-emerald-900/50 no-underline align-baseline font-medium" title="${escapeHtml(title)}">#${escapeHtml(tag)}</a>`;
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
return restoreHtml(withTags, placeholders);
|