@tableslayer/ui 0.1.14 → 0.1.18
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.
|
@@ -72,14 +72,42 @@
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// Check if TipTap content is empty (only contains empty paragraphs)
|
|
76
|
+
const isTipTapContentEmpty = (content: unknown): boolean => {
|
|
77
|
+
if (!content) return true;
|
|
78
|
+
|
|
79
|
+
// Handle JSON TipTap content
|
|
80
|
+
if (typeof content === 'object' && content !== null) {
|
|
81
|
+
const doc = content as { type?: string; content?: Array<{ type?: string; content?: unknown[] }> };
|
|
82
|
+
if (doc.type === 'doc' && Array.isArray(doc.content)) {
|
|
83
|
+
// Empty if no content blocks, or only empty paragraphs
|
|
84
|
+
if (doc.content.length === 0) return true;
|
|
85
|
+
return doc.content.every(
|
|
86
|
+
(block) => block.type === 'paragraph' && (!block.content || block.content.length === 0)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Handle HTML string content
|
|
92
|
+
if (typeof content === 'string') {
|
|
93
|
+
// Strip HTML tags and check if there's any text content
|
|
94
|
+
const textContent = content.replace(/<[^>]*>/g, '').trim();
|
|
95
|
+
return textContent.length === 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return false;
|
|
99
|
+
};
|
|
100
|
+
|
|
75
101
|
const getMarkerContent = (marker: MarkerData | null) => {
|
|
76
102
|
if (!marker) return null;
|
|
77
103
|
|
|
78
104
|
if (marker.note) {
|
|
105
|
+
if (isTipTapContentEmpty(marker.note)) return null;
|
|
79
106
|
return marker.note;
|
|
80
107
|
}
|
|
81
108
|
|
|
82
109
|
if (marker.tooltip?.content) {
|
|
110
|
+
if (isTipTapContentEmpty(marker.tooltip.content)) return null;
|
|
83
111
|
if (typeof marker.tooltip.content === 'string') {
|
|
84
112
|
try {
|
|
85
113
|
return JSON.parse(marker.tooltip.content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tableslayer/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"license": "FSL-1.1-ALv2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,32 +56,33 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@magidoc/plugin-svelte-marked": "^6.3.0",
|
|
58
58
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
59
|
-
"@sveltejs/kit": "^2.
|
|
59
|
+
"@sveltejs/kit": "^2.57.1",
|
|
60
60
|
"@sveltejs/package": "^2.5.7",
|
|
61
61
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
62
62
|
"@tableslayer/eslint-config": "workspace:*",
|
|
63
63
|
"@tableslayer/tsconfig": "workspace:*",
|
|
64
64
|
"@types/chroma-js": "^3.1.2",
|
|
65
|
+
"@types/node": "^25.6.0",
|
|
65
66
|
"@types/marked": "^6.0.0",
|
|
66
|
-
"marked": "^
|
|
67
|
-
"svelte": "5.
|
|
68
|
-
"svelte-check": "^4.4.
|
|
69
|
-
"typedoc": "^0.28.
|
|
70
|
-
"typescript": "^
|
|
71
|
-
"vite": "^8.0.
|
|
67
|
+
"marked": "^18.0.2",
|
|
68
|
+
"svelte": "5.55.4",
|
|
69
|
+
"svelte-check": "^4.4.6",
|
|
70
|
+
"typedoc": "^0.28.19",
|
|
71
|
+
"typescript": "^6.0.3",
|
|
72
|
+
"vite": "^8.0.9"
|
|
72
73
|
},
|
|
73
74
|
"dependencies": {
|
|
74
75
|
"@floating-ui/dom": "^1.7.6",
|
|
75
|
-
"@tabler/icons-svelte": "^3.
|
|
76
|
-
"@tiptap/core": "^3.
|
|
77
|
-
"@tiptap/extension-link": "^3.
|
|
78
|
-
"@tiptap/extension-typography": "^3.
|
|
79
|
-
"@tiptap/pm": "^3.
|
|
80
|
-
"@tiptap/starter-kit": "^3.
|
|
76
|
+
"@tabler/icons-svelte": "^3.41.1",
|
|
77
|
+
"@tiptap/core": "^3.22.4",
|
|
78
|
+
"@tiptap/extension-link": "^3.22.4",
|
|
79
|
+
"@tiptap/extension-typography": "^3.22.4",
|
|
80
|
+
"@tiptap/pm": "^3.22.4",
|
|
81
|
+
"@tiptap/starter-kit": "^3.22.4",
|
|
81
82
|
"chroma-js": "^3.2.0",
|
|
82
83
|
"class-variance-authority": "^0.7.1",
|
|
83
84
|
"shiki": "^4.0.2",
|
|
84
|
-
"uuid": "^
|
|
85
|
+
"uuid": "^14.0.0",
|
|
85
86
|
"zod": "^4.3.6"
|
|
86
87
|
},
|
|
87
88
|
"svelte": "./dist/index.js",
|