@lapis-notes/csv 0.0.0-stage → 0.2.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE.md +4 -0
  3. package/README.md +19 -2
  4. package/dist/app.css +210 -0
  5. package/dist/csv-settings.d.ts +13 -0
  6. package/dist/csv-settings.js +28 -0
  7. package/dist/index.d.ts +7 -0
  8. package/dist/index.js +7 -0
  9. package/dist/lib/CsvSheet.svelte +58 -0
  10. package/dist/lib/CsvSheet.svelte.d.ts +11 -0
  11. package/dist/lib/CsvTable.svelte +58 -0
  12. package/dist/lib/CsvTable.svelte.d.ts +11 -0
  13. package/dist/lib/codemirror/csv-language-extensions.d.ts +3 -0
  14. package/dist/lib/codemirror/csv-language-extensions.js +11 -0
  15. package/dist/lib/codemirror/csv-language.d.ts +3 -0
  16. package/dist/lib/codemirror/csv-language.js +24 -0
  17. package/dist/lib/codemirror/csv-rainbow-theme.d.ts +3 -0
  18. package/dist/lib/codemirror/csv-rainbow-theme.js +15 -0
  19. package/dist/lib/codemirror/csv-source-extensions.d.ts +7 -0
  20. package/dist/lib/codemirror/csv-source-extensions.js +9 -0
  21. package/dist/lib/codemirror/csv.parser.d.ts +2 -0
  22. package/dist/lib/codemirror/csv.parser.js +16 -0
  23. package/dist/lib/codemirror/csv.parser.terms.d.ts +1 -0
  24. package/dist/lib/codemirror/csv.parser.terms.js +2 -0
  25. package/dist/lib/codemirror/syntax.grammar +36 -0
  26. package/dist/lib/components/csv-cell.svelte +137 -0
  27. package/dist/lib/components/csv-cell.svelte.d.ts +11 -0
  28. package/dist/lib/components/csv-data-table-column-head.svelte +76 -0
  29. package/dist/lib/components/csv-data-table-column-head.svelte.d.ts +17 -0
  30. package/dist/lib/components/csv-data-table-column-header.svelte +159 -0
  31. package/dist/lib/components/csv-data-table-column-header.svelte.d.ts +23 -0
  32. package/dist/lib/components/csv-data-table-data-cell.svelte +72 -0
  33. package/dist/lib/components/csv-data-table-data-cell.svelte.d.ts +18 -0
  34. package/dist/lib/components/csv-data-table-drag-overlay.svelte +119 -0
  35. package/dist/lib/components/csv-data-table-drag-overlay.svelte.d.ts +13 -0
  36. package/dist/lib/components/csv-data-table-row-actions.svelte +47 -0
  37. package/dist/lib/components/csv-data-table-row-actions.svelte.d.ts +8 -0
  38. package/dist/lib/components/csv-data-table-row-grip-cell.svelte +102 -0
  39. package/dist/lib/components/csv-data-table-row-grip-cell.svelte.d.ts +19 -0
  40. package/dist/lib/components/csv-data-table-row.svelte +38 -0
  41. package/dist/lib/components/csv-data-table-row.svelte.d.ts +11 -0
  42. package/dist/lib/components/csv-data-table.svelte +903 -0
  43. package/dist/lib/components/csv-data-table.svelte.d.ts +21 -0
  44. package/dist/lib/components/csv-find.svelte +382 -0
  45. package/dist/lib/components/csv-find.svelte.d.ts +24 -0
  46. package/dist/lib/components/csv-row-virtualizer.svelte.d.ts +9 -0
  47. package/dist/lib/components/csv-row-virtualizer.svelte.js +59 -0
  48. package/dist/lib/components/csv-source-view.svelte +127 -0
  49. package/dist/lib/components/csv-source-view.svelte.d.ts +10 -0
  50. package/dist/lib/components/csv-status-bar.svelte +101 -0
  51. package/dist/lib/components/csv-status-bar.svelte.d.ts +14 -0
  52. package/dist/lib/components/csv-table-dnd.d.ts +9 -0
  53. package/dist/lib/components/csv-table-dnd.js +12 -0
  54. package/dist/lib/components/csv-table-drag-measure.d.ts +7 -0
  55. package/dist/lib/components/csv-table-drag-measure.js +38 -0
  56. package/dist/lib/components/csv-table-selection.d.ts +28 -0
  57. package/dist/lib/components/csv-table-selection.js +178 -0
  58. package/dist/lib/components/csv-table-view.svelte +265 -0
  59. package/dist/lib/components/csv-table-view.svelte.d.ts +16 -0
  60. package/dist/lib/csv-plugin.d.ts +9 -0
  61. package/dist/lib/csv-plugin.js +107 -0
  62. package/dist/lib/csv-view-settings.d.ts +43 -0
  63. package/dist/lib/csv-view-settings.js +86 -0
  64. package/dist/lib/ids.d.ts +8 -0
  65. package/dist/lib/ids.js +19 -0
  66. package/dist/lib/model/csv-column-sort.d.ts +16 -0
  67. package/dist/lib/model/csv-column-sort.js +81 -0
  68. package/dist/lib/model/csv-grid.d.ts +31 -0
  69. package/dist/lib/model/csv-grid.js +161 -0
  70. package/dist/lib/model/csv-search.d.ts +38 -0
  71. package/dist/lib/model/csv-search.js +101 -0
  72. package/dist/lib/model/csv-table-model.d.ts +10 -0
  73. package/dist/lib/model/csv-table-model.js +18 -0
  74. package/dist/lib/model/parse-csv.d.ts +10 -0
  75. package/dist/lib/model/parse-csv.js +13 -0
  76. package/dist/lib/model/serialize-csv.d.ts +5 -0
  77. package/dist/lib/model/serialize-csv.js +10 -0
  78. package/dist/lib/sheet/csv-sheet-toolbar.svelte +244 -0
  79. package/dist/lib/sheet/csv-sheet-toolbar.svelte.d.ts +20 -0
  80. package/dist/lib/sheet/csv-sheet-view.svelte +444 -0
  81. package/dist/lib/sheet/csv-sheet-view.svelte.d.ts +18 -0
  82. package/dist/lib/sheet/csv-sheet.svelte +1121 -0
  83. package/dist/lib/sheet/csv-sheet.svelte.d.ts +37 -0
  84. package/dist/lib/sheet/sheet-glyph.svelte +57 -0
  85. package/dist/lib/sheet/sheet-glyph.svelte.d.ts +7 -0
  86. package/dist/lib/sheet/sheet-history.d.ts +14 -0
  87. package/dist/lib/sheet/sheet-history.js +33 -0
  88. package/dist/lib/sheet/sheet-layout.d.ts +121 -0
  89. package/dist/lib/sheet/sheet-layout.js +336 -0
  90. package/dist/lib/sheet/sheet-paint.d.ts +45 -0
  91. package/dist/lib/sheet/sheet-paint.js +274 -0
  92. package/dist/lib/sheet/sheet-theme.d.ts +2 -0
  93. package/dist/lib/sheet/sheet-theme.js +26 -0
  94. package/dist/lib/views/csv-view-mode.d.ts +3 -0
  95. package/dist/lib/views/csv-view-mode.js +6 -0
  96. package/dist/lib/views/csv-view.d.ts +24 -0
  97. package/dist/lib/views/csv-view.js +125 -0
  98. package/dist/styles/csv-find.css +313 -0
  99. package/dist/styles/csv-table.css +882 -0
  100. package/dist/styles.css +37 -0
  101. package/manifest.json +45 -0
  102. package/package.json +86 -3
  103. package/registry-content/overview.md +3 -0
  104. package/registry.json +322 -0
  105. package/styles.css +1 -0
@@ -0,0 +1,37 @@
1
+ @import "./app.css";
2
+
3
+ .csv-table-frame {
4
+ display: flex;
5
+ flex-direction: column;
6
+ width: 100%;
7
+ height: 100%;
8
+ min-width: 0;
9
+ min-height: 0;
10
+ }
11
+
12
+ .csv-table-frame > .csv-table-view,
13
+ .csv-table-frame > .csv-sheet-view {
14
+ display: flex;
15
+ flex: 1 1 auto;
16
+ flex-direction: column;
17
+ min-width: 0;
18
+ min-height: 0;
19
+ }
20
+
21
+ .csv-sheet,
22
+ .csv-sheet__canvas,
23
+ .csv-sheet__editor {
24
+ font-family: var(--csv-font-mono);
25
+ }
26
+
27
+ .csv-table-frame[data-csv-role="embed"] {
28
+ height: 24rem;
29
+ max-height: 24rem;
30
+ border: 1px solid var(--border);
31
+ border-radius: var(--radius-sm, calc(var(--radius) * 0.6));
32
+ }
33
+
34
+ .csv-table-status {
35
+ margin: 0;
36
+ padding: 0.75rem;
37
+ }
package/manifest.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": "lapis-csv",
3
+ "name": "CSV",
4
+ "version": "0.2.0",
5
+ "minAppVersion": "0.1.0",
6
+ "description": "CSV and TSV table view and note embed for Lapis applications",
7
+ "author": "Lapis Notes",
8
+ "authorUrl": "https://app.lapis.md",
9
+ "authorAvatarUrl": "https://gravatar.com/avatar/f7226d5f9cf07af2a6a60d3ab11413abb9d2e2eb60f2d5cce17356845a166155?size=256&d=initials",
10
+ "isDesktopOnly": false,
11
+ "lapis": {
12
+ "manifestVersion": 1,
13
+ "source": "official",
14
+ "locked": false,
15
+ "enabledByDefault": true,
16
+ "runtime": {
17
+ "entries": {
18
+ "workspace": {
19
+ "path": "main.mjs",
20
+ "format": "esm",
21
+ "sharedDependencies": [
22
+ "@lapis-notes/api",
23
+ "@lapis-notes/api/editor/core",
24
+ "@lapis-notes/api/menu",
25
+ "@lapis-notes/api/workspace-host",
26
+ "@codemirror/language",
27
+ "@codemirror/search",
28
+ "@codemirror/state",
29
+ "@codemirror/view",
30
+ "@lezer/common",
31
+ "@lezer/highlight",
32
+ "@lezer/lr",
33
+ "svelte/renderer/5.56.10",
34
+ "svelte/renderer/5.56.10/attachments",
35
+ "svelte/renderer/5.56.10/events",
36
+ "svelte/renderer/5.56.10/internal/client",
37
+ "svelte/renderer/5.56.10/internal/disclose-version",
38
+ "svelte/renderer/5.56.10/reactivity"
39
+ ],
40
+ "requiresReloadOnUpdate": false
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,89 @@
1
1
  {
2
2
  "name": "@lapis-notes/csv",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "CSV and TSV table view and note embed for Lapis applications",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "manifest.json",
10
+ "registry.json",
11
+ "registry-content",
12
+ "styles.css",
13
+ "README.md",
14
+ "CHANGELOG.md",
15
+ "LICENSE.md",
16
+ "!dist/**/*.test.*",
17
+ "!dist/**/*.spec.*"
18
+ ],
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
22
+ "svelte": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "svelte": "./dist/index.js",
28
+ "import": "./dist/index.js",
29
+ "default": "./dist/index.js"
30
+ },
31
+ "./manifest.json": "./manifest.json",
32
+ "./styles.css": "./styles.css",
33
+ "./registry.json": "./registry.json"
34
+ },
35
+ "dependencies": {
36
+ "@dnd-kit/dom": "^0.4.0",
37
+ "@dnd-kit/helpers": "^0.4.0",
38
+ "@dnd-kit/svelte": "^0.4.0",
39
+ "@lapismd/design-core": "^0.7.0",
40
+ "@lucide/svelte": "^0.523.0",
41
+ "@tanstack/virtual-core": "^3.13.12",
42
+ "papaparse": "^5.5.2"
43
+ },
44
+ "peerDependencies": {
45
+ "@codemirror/language": "^6.11.3",
46
+ "@codemirror/search": "^6.5.11",
47
+ "@codemirror/state": "^6.6.0",
48
+ "@codemirror/view": "^6.42.1",
49
+ "@lapis-notes/api": "^0.2.0",
50
+ "@lapis-notes/ui": "^0.1.4",
51
+ "@lezer/common": "^1.5.2",
52
+ "@lezer/highlight": "^1.2.3",
53
+ "@lezer/lr": "^1.4.2",
54
+ "svelte": "^5.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "@sveltejs/package": "^2.5.0",
58
+ "@sveltejs/vite-plugin-svelte": "^5.1.1",
59
+ "@tsconfig/svelte": "^5.0.5",
60
+ "@types/papaparse": "^5.3.16",
61
+ "publint": "^0.3.12",
62
+ "svelte": "^5.38.2",
63
+ "svelte-check": "^4.3.1",
64
+ "typescript": "~5.8.3",
65
+ "vite": "^6.4.4",
66
+ "vitest": "^4.1.12"
67
+ },
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "git+https://github.com/lapismd/lapis-plugins.git",
71
+ "directory": "packages/csv"
72
+ },
73
+ "homepage": "https://github.com/lapismd/lapis-plugins/tree/main/packages/csv#readme",
74
+ "bugs": {
75
+ "url": "https://github.com/lapismd/lapis-plugins/issues"
76
+ },
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "scripts": {
81
+ "build": "pnpm run prepack",
82
+ "check": "pnpm check:svelte && pnpm check:types",
83
+ "check:svelte": "svelte-check --tsconfig ./tsconfig.app.json --fail-on-warnings --output human",
84
+ "check:types": "tsc -p tsconfig.node.json --noEmit",
85
+ "test": "vitest run",
86
+ "publint": "publint",
87
+ "pack": "pnpm pack --pack-destination ../../.release/npm"
88
+ }
6
89
  }
@@ -0,0 +1,3 @@
1
+ # CSV
2
+
3
+ Open a vault CSV or TSV as a table, or embed that same table from a note.
package/registry.json ADDED
@@ -0,0 +1,322 @@
1
+ {
2
+ "$schema": "https://registry.lapis.md/schemas/plugin-source.schema.json",
3
+ "schemaVersion": 2,
4
+ "categories": ["editing"],
5
+ "highlights": [
6
+ "Open a vault CSV or TSV as a table.",
7
+ "Embed the same table in a note.",
8
+ "Keep a quoted comma in one cell."
9
+ ],
10
+ "documentationUrl": "https://github.com/lapismd/lapis-plugins/tree/main/packages/csv#readme",
11
+ "appearance": {
12
+ "icon": "table-2",
13
+ "accent": "#06B6D4"
14
+ },
15
+ "releases": {},
16
+ "media": {
17
+ "banner": {
18
+ "alt": "Lapis CSV showing a staff-readings table with rainbow columns, a quoted comma cell, and the row count, both sidebars closed.",
19
+ "images": {
20
+ "preview": {
21
+ "path": "registry-assets/banner.preview.webp"
22
+ },
23
+ "full": {
24
+ "path": "registry-assets/banner.full.webp"
25
+ },
26
+ "light": {
27
+ "path": "registry-assets/banner.light.webp"
28
+ },
29
+ "dark": {
30
+ "path": "registry-assets/banner.dark.webp"
31
+ }
32
+ },
33
+ "capture": {
34
+ "storyId": "plugins-csv-registry-screenshots--overview",
35
+ "focus": "full-shell"
36
+ }
37
+ },
38
+ "overview": {
39
+ "alt": "Lapis CSV source showing the same staff readings as rainbow-coloured columns in the editor, both sidebars closed.",
40
+ "images": {
41
+ "preview": {
42
+ "path": "registry-assets/overview.preview.webp"
43
+ },
44
+ "full": {
45
+ "path": "registry-assets/overview.full.webp"
46
+ },
47
+ "light": {
48
+ "path": "registry-assets/overview.light.webp"
49
+ },
50
+ "dark": {
51
+ "path": "registry-assets/overview.dark.webp"
52
+ }
53
+ },
54
+ "capture": {
55
+ "storyId": "plugins-csv-registry-screenshots--source",
56
+ "focus": "full-shell"
57
+ }
58
+ }
59
+ },
60
+ "gallery": [
61
+ {
62
+ "id": "source",
63
+ "alt": "The staff-readings CSV open as coloured source, with each column in its own colour and both sidebars closed.",
64
+ "images": {
65
+ "preview": {
66
+ "path": "registry-assets/gallery/source.preview.webp"
67
+ },
68
+ "full": {
69
+ "path": "registry-assets/gallery/source.full.webp"
70
+ },
71
+ "light": {
72
+ "path": "registry-assets/gallery/source.light.webp"
73
+ },
74
+ "dark": {
75
+ "path": "registry-assets/gallery/source.dark.webp"
76
+ }
77
+ },
78
+ "capture": {
79
+ "storyId": "plugins-csv-registry-screenshots--source",
80
+ "focus": "full-shell"
81
+ },
82
+ "card": {
83
+ "headline": [
84
+ {
85
+ "text": "Colour the source",
86
+ "tone": "neutral"
87
+ },
88
+ {
89
+ "text": "by column",
90
+ "tone": "cyan"
91
+ }
92
+ ],
93
+ "description": [
94
+ {
95
+ "text": "Keep the",
96
+ "tone": "neutral"
97
+ },
98
+ {
99
+ "text": "theme mono",
100
+ "tone": "cyan"
101
+ },
102
+ {
103
+ "text": "and paint each column.",
104
+ "tone": "neutral"
105
+ }
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ "id": "embedded-note",
111
+ "alt": "A staff-readings note with both sidebars closed, embedding the same CSV table beneath a short introduction.",
112
+ "images": {
113
+ "preview": {
114
+ "path": "registry-assets/gallery/embedded-note.preview.webp"
115
+ },
116
+ "full": {
117
+ "path": "registry-assets/gallery/embedded-note.full.webp"
118
+ },
119
+ "light": {
120
+ "path": "registry-assets/gallery/embedded-note.light.webp"
121
+ },
122
+ "dark": {
123
+ "path": "registry-assets/gallery/embedded-note.dark.webp"
124
+ }
125
+ },
126
+ "capture": {
127
+ "storyId": "plugins-csv-registry-screenshots--embedded",
128
+ "focus": "full-shell"
129
+ },
130
+ "card": {
131
+ "headline": [
132
+ {
133
+ "text": "Embed the table",
134
+ "tone": "neutral"
135
+ },
136
+ {
137
+ "text": "in a note",
138
+ "tone": "violet"
139
+ }
140
+ ],
141
+ "description": [
142
+ {
143
+ "text": "Open a",
144
+ "tone": "neutral"
145
+ },
146
+ {
147
+ "text": "note",
148
+ "tone": "violet"
149
+ },
150
+ {
151
+ "text": "and keep the",
152
+ "tone": "neutral"
153
+ },
154
+ {
155
+ "text": "table",
156
+ "tone": "cyan"
157
+ },
158
+ {
159
+ "text": "inside it.",
160
+ "tone": "neutral"
161
+ }
162
+ ]
163
+ }
164
+ },
165
+ {
166
+ "id": "find",
167
+ "alt": "Find open on the staff-readings table, showing the one quoted cell that contains culvert.",
168
+ "images": {
169
+ "preview": {
170
+ "path": "registry-assets/gallery/find.preview.webp"
171
+ },
172
+ "full": {
173
+ "path": "registry-assets/gallery/find.full.webp"
174
+ },
175
+ "light": {
176
+ "path": "registry-assets/gallery/find.light.webp"
177
+ },
178
+ "dark": {
179
+ "path": "registry-assets/gallery/find.dark.webp"
180
+ }
181
+ },
182
+ "capture": {
183
+ "storyId": "plugins-csv-registry-screenshots--find",
184
+ "focus": "full-shell"
185
+ },
186
+ "card": {
187
+ "headline": [
188
+ {
189
+ "text": "Find a cell",
190
+ "tone": "neutral"
191
+ },
192
+ {
193
+ "text": "and replace it",
194
+ "tone": "green"
195
+ }
196
+ ],
197
+ "description": [
198
+ {
199
+ "text": "Search the table and write the",
200
+ "tone": "neutral"
201
+ },
202
+ {
203
+ "text": "match",
204
+ "tone": "green"
205
+ },
206
+ {
207
+ "text": "back to the file.",
208
+ "tone": "neutral"
209
+ }
210
+ ]
211
+ }
212
+ },
213
+ {
214
+ "id": "canvas",
215
+ "alt": "The staff-readings CSV open as a canvas sheet, with column letters, a fixed header, and both sidebars closed.",
216
+ "images": {
217
+ "preview": {
218
+ "path": "registry-assets/gallery/canvas.preview.webp"
219
+ },
220
+ "full": {
221
+ "path": "registry-assets/gallery/canvas.full.webp"
222
+ },
223
+ "light": {
224
+ "path": "registry-assets/gallery/canvas.light.webp"
225
+ },
226
+ "dark": {
227
+ "path": "registry-assets/gallery/canvas.dark.webp"
228
+ }
229
+ },
230
+ "capture": {
231
+ "storyId": "plugins-csv-registry-screenshots--canvas",
232
+ "focus": "full-shell"
233
+ },
234
+ "card": {
235
+ "headline": [
236
+ {
237
+ "text": "Open the canvas",
238
+ "tone": "neutral"
239
+ },
240
+ {
241
+ "text": "sheet",
242
+ "tone": "cyan"
243
+ }
244
+ ],
245
+ "description": [
246
+ {
247
+ "text": "Select a",
248
+ "tone": "neutral"
249
+ },
250
+ {
251
+ "text": "column",
252
+ "tone": "cyan"
253
+ },
254
+ {
255
+ "text": "and keep the first row",
256
+ "tone": "neutral"
257
+ },
258
+ {
259
+ "text": "fixed.",
260
+ "tone": "violet"
261
+ }
262
+ ]
263
+ }
264
+ },
265
+ {
266
+ "id": "embedded-canvas",
267
+ "alt": "A staff-readings note with both sidebars closed, embedding the same CSV as a canvas sheet beneath a short introduction.",
268
+ "images": {
269
+ "preview": {
270
+ "path": "registry-assets/gallery/embedded-canvas.preview.webp"
271
+ },
272
+ "full": {
273
+ "path": "registry-assets/gallery/embedded-canvas.full.webp"
274
+ },
275
+ "light": {
276
+ "path": "registry-assets/gallery/embedded-canvas.light.webp"
277
+ },
278
+ "dark": {
279
+ "path": "registry-assets/gallery/embedded-canvas.dark.webp"
280
+ }
281
+ },
282
+ "capture": {
283
+ "storyId": "plugins-csv-registry-screenshots--embedded-canvas",
284
+ "focus": "full-shell"
285
+ },
286
+ "card": {
287
+ "headline": [
288
+ {
289
+ "text": "Embed the sheet",
290
+ "tone": "neutral"
291
+ },
292
+ {
293
+ "text": "in a note",
294
+ "tone": "violet"
295
+ }
296
+ ],
297
+ "description": [
298
+ {
299
+ "text": "Open a",
300
+ "tone": "neutral"
301
+ },
302
+ {
303
+ "text": "note",
304
+ "tone": "violet"
305
+ },
306
+ {
307
+ "text": "and keep the",
308
+ "tone": "neutral"
309
+ },
310
+ {
311
+ "text": "sheet",
312
+ "tone": "cyan"
313
+ },
314
+ {
315
+ "text": "inside it.",
316
+ "tone": "neutral"
317
+ }
318
+ ]
319
+ }
320
+ }
321
+ ]
322
+ }
package/styles.css ADDED
@@ -0,0 +1 @@
1
+ @import "./dist/styles.css";