@lapis-notes/history 0.1.2 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # History changelog
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6](https://github.com/lapismd/lapis-plugins/pull/6) [`03b483c`](https://github.com/lapismd/lapis-plugins/commit/03b483c89f4e3d9b8ce9af2919903ad42e9b66ad) Thanks [@stevejuma](https://github.com/stevejuma)! - Center comparison actions between revision timestamps and diff statistics on one
8
+ row, wrapping the actions below on narrow workspace panes.
9
+
10
+ ## 0.1.3
11
+
12
+ ### Patch Changes
13
+
14
+ - Add official author avatars and deterministic split, light, and dark registry media for plugin banners, overviews, and galleries.
15
+
3
16
  ## 0.1.2
4
17
 
5
18
  - Initial independent public package extracted from Lapis Notes without changing
package/LICENSE.md CHANGED
@@ -1,8 +1,4 @@
1
- # License
1
+ Apache-2.0
2
2
 
3
- Copyright (c) LapisMD contributors.
4
-
5
- This software is licensed under the GNU Affero General Public License, version
6
- 3 or (at your option) any later version (`AGPL-3.0-or-later`). The complete
7
- license text is available from the
8
- [GNU Project](https://www.gnu.org/licenses/agpl-3.0.html).
3
+ This project is licensed under the Apache License 2.0.
4
+ See <https://www.apache.org/licenses/LICENSE-2.0>.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # History
2
2
 
3
- File history
3
+ Browse, compare, and restore saved file revisions
4
4
 
5
5
  ## Install for static composition
6
6
 
@@ -13,7 +13,7 @@ Register the exported plugin class in the application's `PluginProfile`. Import
13
13
  registration so the host owns its lifecycle.
14
14
 
15
15
  The runtime plugin ID is `history`. A matching signed
16
- `history-0.1.2.lapis-plugin` archive is attached to the
16
+ `history-0.1.4.lapis-plugin` archive is attached to the
17
17
  package-scoped GitHub release for manual or registry installation.
18
18
 
19
19
  See the [repository README](https://github.com/lapismd/lapis-plugins#readme) for
@@ -15,6 +15,7 @@
15
15
  "Liberation Mono",
16
16
  monospace
17
17
  );
18
+ container: history-compare / inline-size;
18
19
  display: flex;
19
20
  box-sizing: border-box;
20
21
  width: 100%;
@@ -33,19 +34,23 @@
33
34
  flex-direction: column;
34
35
  align-items: stretch;
35
36
  gap: 0;
36
- padding: 0.25rem 0.25rem 0;
37
+ padding: 0.25rem;
37
38
  border-bottom: 1px solid
38
- var(--ui-workspace-border, color-mix(in srgb, currentColor 14%, transparent));
39
+ var(
40
+ --ui-workspace-border,
41
+ color-mix(in srgb, currentColor 14%, transparent)
42
+ );
39
43
  background: var(--ui-workspace-view-background, transparent);
40
44
  }
41
45
 
42
46
  .history-compare__revision {
43
- display: flex;
47
+ display: grid;
48
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
44
49
  min-width: 0;
45
50
  align-items: center;
46
51
  justify-content: space-between;
47
52
  gap: 0.5rem;
48
- padding: 0.35rem 0.5rem 0.15rem;
53
+ padding: 0.15rem 0.5rem;
49
54
  color: var(--ui-workspace-muted-foreground, var(--muted-foreground));
50
55
  font-size: 0.75rem;
51
56
  }
@@ -58,7 +63,7 @@
58
63
  }
59
64
 
60
65
  .history-compare__revision [data-ui-component="file-change-stats"] {
61
- flex: 0 0 auto;
66
+ justify-self: end;
62
67
  }
63
68
 
64
69
  .history-compare__toolbar {
@@ -66,7 +71,7 @@
66
71
  align-items: center;
67
72
  justify-content: center;
68
73
  gap: 0.125rem;
69
- padding: 0.15rem 0 0.25rem;
74
+ padding: 0;
70
75
  }
71
76
 
72
77
  .history-compare__toolbar
@@ -124,3 +129,20 @@
124
129
  padding: 0.75rem;
125
130
  color: var(--ui-workspace-muted-foreground, var(--muted-foreground));
126
131
  }
132
+
133
+ @container history-compare (max-width: 40rem) {
134
+ .history-compare__revision {
135
+ grid-template-columns: minmax(0, 1fr) auto;
136
+ }
137
+
138
+ .history-compare__toolbar {
139
+ grid-column: 1 / -1;
140
+ grid-row: 2;
141
+ flex-wrap: wrap;
142
+ }
143
+
144
+ .history-compare__revision [data-ui-component="file-change-stats"] {
145
+ grid-column: 2;
146
+ grid-row: 1;
147
+ }
148
+ }
@@ -148,56 +148,31 @@
148
148
  aria-label="File history comparison"
149
149
  >
150
150
  <div class="history-compare__chrome" data-ui-part="chrome">
151
- {#if model}
152
- <div class="history-compare__revision">
153
- <span>{model.beforeLabel} → {model.afterLabel}</span>
154
- <FileChangeStats
155
- additions={stats.additions}
156
- deletions={stats.deletions}
157
- showZero
158
- />
159
- </div>
160
- {/if}
161
- <Tooltip.Provider delayDuration={0}>
162
- <div class="history-compare__toolbar" data-ui-part="toolbar">
163
- <Tooltip.Root>
164
- <Tooltip.Trigger>
165
- {#snippet child({ props })}
166
- <Button
167
- {...props}
168
- variant="ghost"
169
- size="icon-sm"
170
- class="history-compare__toolbar-action"
171
- aria-label="Compare with current"
172
- aria-pressed={model?.compareMode === "current"}
173
- onclick={() => openMode("current")}
174
- >
175
- <GitCompare aria-hidden="true" />
176
- </Button>
177
- {/snippet}
178
- </Tooltip.Trigger>
179
- <Tooltip.Content side="bottom">Compare with current</Tooltip.Content>
180
- </Tooltip.Root>
181
- <Tooltip.Root>
182
- <Tooltip.Trigger>
183
- {#snippet child({ props })}
184
- <Button
185
- {...props}
186
- variant="ghost"
187
- size="icon-sm"
188
- class="history-compare__toolbar-action"
189
- aria-label="Compare with previous"
190
- aria-pressed={model?.compareMode === "previous"}
191
- disabled={!model?.previousRevision}
192
- onclick={() => openMode("previous")}
193
- >
194
- <GitCompareArrows aria-hidden="true" />
195
- </Button>
196
- {/snippet}
197
- </Tooltip.Trigger>
198
- <Tooltip.Content side="bottom">Compare with previous</Tooltip.Content>
199
- </Tooltip.Root>
200
- {#if model?.compareMode !== "current"}
151
+ <div class="history-compare__revision">
152
+ <span
153
+ >{#if model}{model.beforeLabel} → {model.afterLabel}{/if}</span
154
+ >
155
+ <Tooltip.Provider delayDuration={0}>
156
+ <div class="history-compare__toolbar" data-ui-part="toolbar">
157
+ <Tooltip.Root>
158
+ <Tooltip.Trigger>
159
+ {#snippet child({ props })}
160
+ <Button
161
+ {...props}
162
+ variant="ghost"
163
+ size="icon-sm"
164
+ class="history-compare__toolbar-action"
165
+ aria-label="Compare with current"
166
+ aria-pressed={model?.compareMode === "current"}
167
+ onclick={() => openMode("current")}
168
+ >
169
+ <GitCompare aria-hidden="true" />
170
+ </Button>
171
+ {/snippet}
172
+ </Tooltip.Trigger>
173
+ <Tooltip.Content side="bottom">Compare with current</Tooltip.Content
174
+ >
175
+ </Tooltip.Root>
201
176
  <Tooltip.Root>
202
177
  <Tooltip.Trigger>
203
178
  {#snippet child({ props })}
@@ -206,43 +181,45 @@
206
181
  variant="ghost"
207
182
  size="icon-sm"
208
183
  class="history-compare__toolbar-action"
209
- data-testid="history-compare-view-mode"
210
- data-view-mode={viewMode}
211
- aria-label={viewModeLabel}
212
- onclick={() =>
213
- (viewMode = viewMode === "split" ? "unified" : "split")}
184
+ aria-label="Compare with previous"
185
+ aria-pressed={model?.compareMode === "previous"}
186
+ disabled={!model?.previousRevision}
187
+ onclick={() => openMode("previous")}
214
188
  >
215
- {#if viewMode === "split"}
216
- <Columns2 aria-hidden="true" />
217
- {:else}
218
- <Rows2 aria-hidden="true" />
219
- {/if}
189
+ <GitCompareArrows aria-hidden="true" />
220
190
  </Button>
221
191
  {/snippet}
222
192
  </Tooltip.Trigger>
223
- <Tooltip.Content side="bottom">{viewModeLabel}</Tooltip.Content>
193
+ <Tooltip.Content side="bottom"
194
+ >Compare with previous</Tooltip.Content
195
+ >
224
196
  </Tooltip.Root>
225
- {/if}
226
- <Tooltip.Root>
227
- <Tooltip.Trigger>
228
- {#snippet child({ props })}
229
- <Button
230
- {...props}
231
- variant="ghost"
232
- size="icon-sm"
233
- class="history-compare__toolbar-action"
234
- data-testid="history-compare-wrap"
235
- aria-label="Wrap text"
236
- aria-pressed={wrap ? "true" : "false"}
237
- onclick={() => (wrap = !wrap)}
238
- >
239
- <WrapText aria-hidden="true" />
240
- </Button>
241
- {/snippet}
242
- </Tooltip.Trigger>
243
- <Tooltip.Content side="bottom">Wrap text</Tooltip.Content>
244
- </Tooltip.Root>
245
- {#if model?.compareMode === "current"}
197
+ {#if model?.compareMode !== "current"}
198
+ <Tooltip.Root>
199
+ <Tooltip.Trigger>
200
+ {#snippet child({ props })}
201
+ <Button
202
+ {...props}
203
+ variant="ghost"
204
+ size="icon-sm"
205
+ class="history-compare__toolbar-action"
206
+ data-testid="history-compare-view-mode"
207
+ data-view-mode={viewMode}
208
+ aria-label={viewModeLabel}
209
+ onclick={() =>
210
+ (viewMode = viewMode === "split" ? "unified" : "split")}
211
+ >
212
+ {#if viewMode === "split"}
213
+ <Columns2 aria-hidden="true" />
214
+ {:else}
215
+ <Rows2 aria-hidden="true" />
216
+ {/if}
217
+ </Button>
218
+ {/snippet}
219
+ </Tooltip.Trigger>
220
+ <Tooltip.Content side="bottom">{viewModeLabel}</Tooltip.Content>
221
+ </Tooltip.Root>
222
+ {/if}
246
223
  <Tooltip.Root>
247
224
  <Tooltip.Trigger>
248
225
  {#snippet child({ props })}
@@ -251,36 +228,66 @@
251
228
  variant="ghost"
252
229
  size="icon-sm"
253
230
  class="history-compare__toolbar-action"
254
- aria-label="Apply"
255
- disabled={pendingContent == null}
256
- onclick={() => void applyMerged()}
231
+ data-testid="history-compare-wrap"
232
+ aria-label="Wrap text"
233
+ aria-pressed={wrap ? "true" : "false"}
234
+ onclick={() => (wrap = !wrap)}
257
235
  >
258
- <Check aria-hidden="true" />
236
+ <WrapText aria-hidden="true" />
259
237
  </Button>
260
238
  {/snippet}
261
239
  </Tooltip.Trigger>
262
- <Tooltip.Content side="bottom">Apply</Tooltip.Content>
240
+ <Tooltip.Content side="bottom">Wrap text</Tooltip.Content>
263
241
  </Tooltip.Root>
264
- {/if}
265
- <Tooltip.Root>
266
- <Tooltip.Trigger>
267
- {#snippet child({ props })}
268
- <Button
269
- {...props}
270
- variant="ghost"
271
- size="icon-sm"
272
- class="history-compare__toolbar-action"
273
- aria-label="Restore this revision"
274
- onclick={() => void restoreSelected()}
275
- >
276
- <ArchiveRestore aria-hidden="true" />
277
- </Button>
278
- {/snippet}
279
- </Tooltip.Trigger>
280
- <Tooltip.Content side="bottom">Restore this revision</Tooltip.Content>
281
- </Tooltip.Root>
282
- </div>
283
- </Tooltip.Provider>
242
+ {#if model?.compareMode === "current"}
243
+ <Tooltip.Root>
244
+ <Tooltip.Trigger>
245
+ {#snippet child({ props })}
246
+ <Button
247
+ {...props}
248
+ variant="ghost"
249
+ size="icon-sm"
250
+ class="history-compare__toolbar-action"
251
+ aria-label="Apply"
252
+ disabled={pendingContent == null}
253
+ onclick={() => void applyMerged()}
254
+ >
255
+ <Check aria-hidden="true" />
256
+ </Button>
257
+ {/snippet}
258
+ </Tooltip.Trigger>
259
+ <Tooltip.Content side="bottom">Apply</Tooltip.Content>
260
+ </Tooltip.Root>
261
+ {/if}
262
+ <Tooltip.Root>
263
+ <Tooltip.Trigger>
264
+ {#snippet child({ props })}
265
+ <Button
266
+ {...props}
267
+ variant="ghost"
268
+ size="icon-sm"
269
+ class="history-compare__toolbar-action"
270
+ aria-label="Restore this revision"
271
+ onclick={() => void restoreSelected()}
272
+ >
273
+ <ArchiveRestore aria-hidden="true" />
274
+ </Button>
275
+ {/snippet}
276
+ </Tooltip.Trigger>
277
+ <Tooltip.Content side="bottom"
278
+ >Restore this revision</Tooltip.Content
279
+ >
280
+ </Tooltip.Root>
281
+ </div>
282
+ </Tooltip.Provider>
283
+ {#if model}
284
+ <FileChangeStats
285
+ additions={stats.additions}
286
+ deletions={stats.deletions}
287
+ showZero
288
+ />
289
+ {/if}
290
+ </div>
284
291
  </div>
285
292
  <div class="history-compare__body">
286
293
  {#if error}
@@ -299,7 +306,7 @@
299
306
  path={model.filePath}
300
307
  syncHorizontalScroll
301
308
  {wrap}
302
- onResolvedChange={onResolvedChange}
309
+ {onResolvedChange}
303
310
  />
304
311
  {:else}
305
312
  <FileDiff
package/manifest.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "id": "history",
3
3
  "name": "History",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "minAppVersion": "0.1.0",
6
- "description": "File history",
6
+ "description": "Browse, compare, and restore saved file revisions",
7
7
  "author": "Lapis Notes",
8
+ "authorAvatarUrl": "https://www.gravatar.com/avatar/1df68d9ff087b0dd72fd8626056fca7f?s=128&d=404",
9
+ "isDesktopOnly": false,
8
10
  "lapis": {
9
11
  "manifestVersion": 1,
10
12
  "source": "official",
@@ -17,7 +19,14 @@
17
19
  "format": "esm",
18
20
  "sharedDependencies": [
19
21
  "@lapis-notes/api",
20
- "@lapis-notes/api/workspace-host"
22
+ "@lapis-notes/api/workspace-host",
23
+ "svelte/renderer/5.56.10",
24
+ "svelte/renderer/5.56.10/attachments",
25
+ "svelte/renderer/5.56.10/events",
26
+ "svelte/renderer/5.56.10/internal/client",
27
+ "svelte/renderer/5.56.10/internal/disclose-version",
28
+ "svelte/renderer/5.56.10/reactivity",
29
+ "svelte/renderer/5.56.10/store"
21
30
  ],
22
31
  "requiresReloadOnUpdate": false
23
32
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@lapis-notes/history",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Lapis Notes file history plugin",
5
- "license": "AGPL-3.0-or-later",
5
+ "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",
9
9
  "manifest.json",
10
10
  "registry.json",
11
+ "registry-content",
11
12
  "styles.css",
12
13
  "README.md",
13
14
  "CHANGELOG.md",
@@ -32,11 +33,11 @@
32
33
  "./registry.json": "./registry.json"
33
34
  },
34
35
  "dependencies": {
35
- "@lapismd/design-core": "^0.1.0",
36
+ "@lapismd/design-core": "^0.3.2",
36
37
  "@lucide/svelte": "^0.523.0"
37
38
  },
38
39
  "peerDependencies": {
39
- "@lapis-notes/api": "^0.1.0",
40
+ "@lapis-notes/api": "^0.1.2",
40
41
  "svelte": "^5.0.0"
41
42
  },
42
43
  "devDependencies": {
@@ -0,0 +1,10 @@
1
+ # History
2
+
3
+ History keeps a bounded, local timeline of meaningful file revisions as notes
4
+ change. Select the active note to browse timestamped snapshots in the sidebar,
5
+ then open any revision in a clear comparison against the document you have now.
6
+
7
+ When an earlier version contains something worth recovering, restore it through
8
+ the normal vault write path so every other Lapis view observes the update. The
9
+ retention limit and ignored paths remain configurable per vault, and revision
10
+ content never needs to leave the workspace.
package/registry.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://registry.lapis.md/schemas/plugin-source.schema.json",
3
- "schemaVersion": 1,
3
+ "schemaVersion": 2,
4
4
  "categories": ["history", "versioning"],
5
5
  "highlights": [
6
6
  "Capture bounded local revisions as vault files change.",
@@ -8,5 +8,134 @@
8
8
  "Restore selected content through the normal vault write path."
9
9
  ],
10
10
  "documentationUrl": "https://github.com/lapismd/lapis-plugins/tree/main/packages/history#readme",
11
- "content": { "overview": "README.md", "changelog": "CHANGELOG.md" }
11
+ "appearance": {
12
+ "icon": "history",
13
+ "accent": "#6366F1"
14
+ },
15
+ "media": {
16
+ "banner": {
17
+ "alt": "Lapis History with Explorer on the left, a revision comparison in the main workspace, and History on the right.",
18
+ "images": {
19
+ "preview": {
20
+ "path": "registry-assets/banner.preview.webp"
21
+ },
22
+ "full": {
23
+ "path": "registry-assets/banner.full.webp"
24
+ },
25
+ "light": {
26
+ "path": "registry-assets/banner.light.webp"
27
+ },
28
+ "dark": {
29
+ "path": "registry-assets/banner.dark.webp"
30
+ }
31
+ },
32
+ "capture": {
33
+ "storyId": "plugins-history-registry-screenshots--overview",
34
+ "focus": "full-shell"
35
+ }
36
+ },
37
+ "overview": {
38
+ "alt": "Lapis History Compare view showing changes between two revisions in the full workspace.",
39
+ "images": {
40
+ "preview": {
41
+ "path": "registry-assets/overview.preview.webp"
42
+ },
43
+ "full": {
44
+ "path": "registry-assets/overview.full.webp"
45
+ },
46
+ "light": {
47
+ "path": "registry-assets/overview.light.webp"
48
+ },
49
+ "dark": {
50
+ "path": "registry-assets/overview.dark.webp"
51
+ }
52
+ },
53
+ "capture": {
54
+ "storyId": "plugins-history-registry-screenshots--compare",
55
+ "focus": "full-shell"
56
+ }
57
+ }
58
+ },
59
+ "gallery": [
60
+ {
61
+ "id": "history-sidebar",
62
+ "alt": "History sidebar showing saved local revisions for the active Welcome note.",
63
+ "images": {
64
+ "preview": {
65
+ "path": "registry-assets/gallery/history-sidebar.preview.webp"
66
+ },
67
+ "full": {
68
+ "path": "registry-assets/gallery/history-sidebar.full.webp"
69
+ },
70
+ "light": {
71
+ "path": "registry-assets/gallery/history-sidebar.light.webp"
72
+ },
73
+ "dark": {
74
+ "path": "registry-assets/gallery/history-sidebar.dark.webp"
75
+ }
76
+ },
77
+ "capture": {
78
+ "storyId": "plugins-history-registry-screenshots--history-sidebar",
79
+ "focus": "right-sidebar"
80
+ },
81
+ "card": {
82
+ "headline": [
83
+ {
84
+ "text": "A local timeline",
85
+ "tone": "neutral"
86
+ },
87
+ {
88
+ "text": "for every edit",
89
+ "tone": "amber"
90
+ }
91
+ ],
92
+ "description": [
93
+ {
94
+ "text": "Browse timestamped local snapshots of the active note, with bounded retention and no remote history service.",
95
+ "tone": "neutral"
96
+ }
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ "id": "compare",
102
+ "alt": "History compare view showing a saved revision beside the current Markdown document.",
103
+ "images": {
104
+ "preview": {
105
+ "path": "registry-assets/gallery/compare.preview.webp"
106
+ },
107
+ "full": {
108
+ "path": "registry-assets/gallery/compare.full.webp"
109
+ },
110
+ "light": {
111
+ "path": "registry-assets/gallery/compare.light.webp"
112
+ },
113
+ "dark": {
114
+ "path": "registry-assets/gallery/compare.dark.webp"
115
+ }
116
+ },
117
+ "capture": {
118
+ "storyId": "plugins-history-registry-screenshots--compare",
119
+ "focus": "full-shell"
120
+ },
121
+ "card": {
122
+ "headline": [
123
+ {
124
+ "text": "Compare changes",
125
+ "tone": "neutral"
126
+ },
127
+ {
128
+ "text": "before restoring",
129
+ "tone": "green"
130
+ }
131
+ ],
132
+ "description": [
133
+ {
134
+ "text": "Review a saved revision against the live document, then restore through the vault.",
135
+ "tone": "neutral"
136
+ }
137
+ ]
138
+ }
139
+ }
140
+ ]
12
141
  }