sonorance 0.1.0-beta.4.1
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/LICENSE +174 -0
- package/README.md +103 -0
- package/build/icon.png +0 -0
- package/package.json +86 -0
- package/skill/SKILL.md +41 -0
- package/skill/scripts/sonorance.mjs +31 -0
- package/src/azure-monitor.mjs +221 -0
- package/src/cli.mjs +315 -0
- package/src/comment-client.mjs +75 -0
- package/src/engine-default.mjs +136 -0
- package/src/feedback.mjs +151 -0
- package/src/gitignore.mjs +27 -0
- package/src/grammar.mjs +55 -0
- package/src/identity.mjs +126 -0
- package/src/otlp.mjs +166 -0
- package/src/plugins/deliberate/contribute.mjs +28 -0
- package/src/plugins/deliberate/domain.mjs +40 -0
- package/src/plugins/deliberate/frontmatter.mjs +85 -0
- package/src/plugins/deliberate/gitignore.mjs +21 -0
- package/src/plugins/deliberate/kinds.mjs +44 -0
- package/src/plugins/deliberate/markdown.mjs +42 -0
- package/src/plugins/deliberate/paths.mjs +245 -0
- package/src/plugins/deliberate/stages.mjs +27 -0
- package/src/plugins/deliberate/vault.mjs +1043 -0
- package/src/plugins.mjs +91 -0
- package/src/release-config.mjs +2 -0
- package/src/scrubber.mjs +64 -0
- package/src/server/index.mjs +993 -0
- package/src/sources.mjs +80 -0
- package/src/telemetry-schema.mjs +187 -0
- package/src/telemetry.mjs +390 -0
- package/src/ui/active-line.mjs +42 -0
- package/src/ui/app.js +3553 -0
- package/src/ui/at-mention.mjs +67 -0
- package/src/ui/comments-plugin.mjs +107 -0
- package/src/ui/diff-plugin.mjs +73 -0
- package/src/ui/editor.mjs +210 -0
- package/src/ui/index.html +1723 -0
- package/src/ui/md.mjs +233 -0
- package/src/ui/paste-md.mjs +54 -0
- package/src/ui/shell.html +1374 -0
- package/src/ui/slash.mjs +122 -0
- package/src/vault-registry.mjs +150 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Active-line highlight for the Tiptap surface, as a ProseMirror plugin.
|
|
2
|
+
//
|
|
3
|
+
// Entering edit mode should NOT draw a frame around the whole record. Instead we
|
|
4
|
+
// mark just the block holding the caret with a warm amber wash — a single "you
|
|
5
|
+
// are here" line, like the old live-preview `.blk.active`, but native to
|
|
6
|
+
// ProseMirror. Only shown while the editor is focused and editable, and cleared
|
|
7
|
+
// the moment focus leaves so nothing lingers.
|
|
8
|
+
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
9
|
+
import { Decoration, DecorationSet } from '@tiptap/pm/view';
|
|
10
|
+
|
|
11
|
+
export const activeLineKey = new PluginKey('sonorance-activeline');
|
|
12
|
+
|
|
13
|
+
function build(state, focused) {
|
|
14
|
+
if (!focused) return DecorationSet.empty;
|
|
15
|
+
const { $head } = state.selection;
|
|
16
|
+
if (!$head || $head.depth < 1) return DecorationSet.empty; // caret directly in doc → no textblock
|
|
17
|
+
// The nearest enclosing block of the caret (paragraph/heading/list-item body/…).
|
|
18
|
+
const from = $head.before($head.depth);
|
|
19
|
+
const to = $head.after($head.depth);
|
|
20
|
+
return DecorationSet.create(state.doc, [Decoration.node(from, to, { class: 'pm-activeline' })]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function activeLinePlugin() {
|
|
24
|
+
return new Plugin({
|
|
25
|
+
key: activeLineKey,
|
|
26
|
+
state: {
|
|
27
|
+
init: () => ({ focused: false, decos: DecorationSet.empty }),
|
|
28
|
+
apply(tr, value, _old, newState) {
|
|
29
|
+
const meta = tr.getMeta(activeLineKey);
|
|
30
|
+
const focused = meta && typeof meta.focused === 'boolean' ? meta.focused : value.focused;
|
|
31
|
+
return { focused, decos: build(newState, focused) };
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
decorations(state) { return activeLineKey.getState(state)?.decos; },
|
|
36
|
+
handleDOMEvents: {
|
|
37
|
+
focus(view) { view.dispatch(view.state.tr.setMeta(activeLineKey, { focused: true })); return false; },
|
|
38
|
+
blur(view) { view.dispatch(view.state.tr.setMeta(activeLineKey, { focused: false })); return false; },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|