@tableslayer/ui 0.1.14 → 0.1.20

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.
@@ -4,13 +4,29 @@
4
4
  interface Props {
5
5
  brushSize: number;
6
6
  onBrushSizeChange: (value: number) => void;
7
+ gridSpacing?: number;
8
+ displayWidth?: number;
7
9
  }
8
10
 
9
- let { brushSize, onBrushSizeChange }: Props = $props();
11
+ let { brushSize, onBrushSizeChange, gridSpacing, displayWidth }: Props = $props();
12
+
13
+ const minBrushSize = $derived.by(() => {
14
+ if (gridSpacing && displayWidth && displayWidth > 0) {
15
+ return Math.max(0.5, (gridSpacing / displayWidth) * 100);
16
+ }
17
+ return 2;
18
+ });
10
19
  </script>
11
20
 
12
21
  <div class="fogSliders">
13
- <BrushSizeSlider {brushSize} {onBrushSizeChange} min={5} max={20} curve="linear" displayAsPercentage={true} />
22
+ <BrushSizeSlider
23
+ {brushSize}
24
+ {onBrushSizeChange}
25
+ min={minBrushSize}
26
+ max={20}
27
+ curve="linear"
28
+ displayAsPercentage={true}
29
+ />
14
30
  </div>
15
31
 
16
32
  <style>
@@ -1,6 +1,8 @@
1
1
  interface Props {
2
2
  brushSize: number;
3
3
  onBrushSizeChange: (value: number) => void;
4
+ gridSpacing?: number;
5
+ displayWidth?: number;
4
6
  }
5
7
  declare const FogSliders: import("svelte").Component<Props, {}, "">;
6
8
  type FogSliders = ReturnType<typeof FogSliders>;
@@ -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.14",
3
+ "version": "0.1.20",
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.55.0",
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": "^17.0.5",
67
- "svelte": "5.54.1",
68
- "svelte-check": "^4.4.5",
69
- "typedoc": "^0.28.18",
70
- "typescript": "^5.9.3",
71
- "vite": "^8.0.1"
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.40.0",
76
- "@tiptap/core": "^3.20.4",
77
- "@tiptap/extension-link": "^3.20.4",
78
- "@tiptap/extension-typography": "^3.20.4",
79
- "@tiptap/pm": "^3.20.4",
80
- "@tiptap/starter-kit": "^3.20.4",
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": "^13.0.0",
85
+ "uuid": "^14.0.0",
85
86
  "zod": "^4.3.6"
86
87
  },
87
88
  "svelte": "./dist/index.js",