Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4523690
add prosemirror prototype
LeosPrograms Oct 31, 2025
28eb526
Merge branch 'main-0.6' into feature/prosemirror
LeosPrograms Nov 3, 2025
65001e4
user automerge/prosemirror
LeosPrograms Nov 3, 2025
3fa5961
Update packages and fix creatable
LeosPrograms Dec 9, 2025
7c6535b
Update packages and fix creatable
LeosPrograms Dec 9, 2025
9d6c2bd
Merge branch 'main-0.6' into feature/prosemirror
LeosPrograms Dec 9, 2025
3b47cd8
simplify prosemirror integration
LeosPrograms Dec 9, 2025
73a5ba5
handle prosemirror formatting and cursor position
LeosPrograms Dec 9, 2025
b761c79
handle lists and quotes
LeosPrograms Dec 9, 2025
7df14e4
move link popup css to top level html
LeosPrograms Dec 9, 2025
49980e0
allow both richtext and markdown
LeosPrograms Dec 9, 2025
9210cbf
shrink text lines
LeosPrograms Dec 9, 2025
f629826
cleanup
LeosPrograms Dec 9, 2025
03024cb
update commits viewer for rich text
LeosPrograms Dec 9, 2025
9694f3f
add style column to all notes
LeosPrograms Dec 9, 2025
d9f8818
add editor choice to weave creatable
LeosPrograms Dec 9, 2025
7f76fa3
remove view toggle in rich text view
LeosPrograms Dec 10, 2025
79a3ee7
Fix: prosemirror cursors, offline-only
LeosPrograms Dec 16, 2025
c366d42
Add auto-typing to rich text editor
LeosPrograms Jan 5, 2026
7f7027e
Fix slow cursor during collaborative typing
LeosPrograms Jan 5, 2026
6fd76d4
Preserve text selection full range
LeosPrograms Jan 5, 2026
68f9d28
Fix cursor position updates
LeosPrograms Jan 5, 2026
0ce77f7
remove margin from rich text p, ol and ul and hide collaborative curs…
LeosPrograms Jan 15, 2026
7e85efc
add image support to prosemirror adapter
LeosPrograms Jan 15, 2026
e6a9afc
use sl-split-panel for division between markdown editor and viewer
LeosPrograms Jan 15, 2026
c89e336
update version number to 0.6.6
LeosPrograms Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion applet/src/cross-applet-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export class CrossAppletMain extends LitElement {
>
<syn-context
.store=${new SynStore(
new SynClient(appletClient, "notebooks")
new SynClient(appletClient, "notebooks"),
true
)}
>
<div class="row title" style="align-items: center">
Expand Down
5 changes: 3 additions & 2 deletions applet/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {

import "@lightningrodlabs/notebooks/dist/elements/all-notes.js";
import "@lightningrodlabs/notebooks/dist/elements/column-header.js";
import "@lightningrodlabs/notebooks/dist/elements/richtext-note.js";
import "@lightningrodlabs/notebooks/dist/elements/markdown-note.js";
import "@holochain-open-dev/profiles/dist/elements/profiles-context.js";
import "@theweave/api/dist/elements/we-services-context.js";
Expand Down Expand Up @@ -50,7 +51,7 @@ function wrapAppletView(
weServices: WeServices,
innerTemplate: TemplateResult
): TemplateResult {
const synStore = new SynStore(new SynClient(client, "notebooks"));
const synStore = new SynStore(new SynClient(client, "notebooks"), true);
return html`
<attachments-context
.store=${new AttachmentsStore(new AttachmentsClient(client, "notebooks"))}
Expand Down Expand Up @@ -208,7 +209,7 @@ const applet: WeApplet = {
label: msg("Note"),
icon_src: wrapPathInSvg(mdiNotebook),
async create(attachToHrl: Hrl) {
const synStore = new SynStore(new SynClient(appletClient, "notebooks"));
const synStore = new SynStore(new SynClient(appletClient, "notebooks"), true);

const note = await createNote(synStore, msg(`Note`), attachToHrl, undefined);
const appInfo = await appletClient.appInfo();
Expand Down
379 changes: 313 additions & 66 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"weave-hash": "weave hash-webhapp 0.6.0 ./workdir/notebooks.webhapp"
},
"devDependencies": {
"@theweave/cli": "0.15.2",
"@holochain/hc-spin": "^0.600.0-dev.0",
"@theweave/cli": "0.15.5",
"@holochain/hc-spin": "^0.600.0",
"@holochain-playground/cli": "^0.300.1",
"bestzip": "^2.2.0",
"concurrently": "^6.2.1",
Expand Down
54 changes: 54 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,60 @@
display: flex;
}

.ProseMirror-prompt {
background: white;
padding: 5px 10px 5px 15px;
border: 1px solid silver;
position: fixed;
border-radius: 3px;
z-index: 11;
box-shadow: -.5px 2px 5px rgba(0, 0, 0, .2);
}

.ProseMirror-prompt h5 {
margin: 0;
font-weight: normal;
font-size: 100%;
color: #444;
}

.ProseMirror-prompt input[type="text"],
.ProseMirror-prompt textarea {
background: #eee;
border: none;
outline: none;
}

.ProseMirror-prompt input[type="text"] {
padding: 0 4px;
}

.ProseMirror-prompt-close {
position: absolute;
left: 2px; top: 1px;
color: #666;
border: none; background: transparent; padding: 0;
}

.ProseMirror-prompt-close:after {
content: "✕";
font-size: 12px;
}

.ProseMirror-invalid {
background: #ffc;
border: 1px solid #cc7;
border-radius: 4px;
padding: 5px 10px;
position: absolute;
min-width: 10em;
}

.ProseMirror-prompt-buttons {
margin-top: 5px;
text-align: center
}

:root {
--mdc-theme-primary: #7b1fa2;
--mdc-theme-secondary: #ff5722;
Expand Down
29 changes: 20 additions & 9 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Notebooks UI",
"license": "MIT",
"author": "dev@holochain.org",
"version": "0.6.1",
"version": "0.6.6",
"dnaVersion": "0.6.0",
"scripts": {
"start": "vite --port $UI_PORT --clearScreen false",
Expand All @@ -13,13 +13,13 @@
"format": "eslint --ext .ts,.html . --fix && prettier \"**/*.ts\" --write"
},
"dependencies": {
"@holochain-open-dev/elements": "^0.600.0-dev.0",
"@holochain-open-dev/profiles": "^0.600.0-dev.2",
"@holochain-open-dev/stores": "^0.600.0-dev.0",
"@holochain-open-dev/utils": "^0.600.0-dev.0",
"@holochain/client": "^0.20.0-dev.2",
"@holochain-syn/core": "^0.600.0-rc.2",
"@holochain-syn/text-editor": "^0.600.0-rc.2",
"@holochain-open-dev/elements": "^0.600.0",
"@holochain-open-dev/profiles": "^0.600.0",
"@holochain-open-dev/stores": "^0.600.0",
"@holochain-open-dev/utils": "^0.600.0",
"@holochain/client": "^0.20.0",
"@holochain-syn/core": "^0.600.0",
"@holochain-syn/text-editor": "^0.600.0",
"@theweave/api": "^0.6.0",
"@theweave/elements": "^0.6.0",
"@lit/context": "^1.0.0",
Expand All @@ -36,7 +36,18 @@
"@automerge/automerge": "^3.2.0",
"@vanillawc/wc-codemirror": "^2.1.0",
"@gitgraph/js": "^1.4.0",
"@scoped-elements/cytoscape": "^0.2.0"
"@scoped-elements/cytoscape": "^0.2.0",
"prosemirror-state":"^1.4.4",
"prosemirror-view": "^1.41.3",
"prosemirror-model": "^1.18.0",
"prosemirror-schema-basic": "^1.1.2",
"prosemirror-schema-list": "^1.1.5",
"prosemirror-example-setup": "^1.1.2",
"prosemirror-keymap": "^1.2.2",
"prosemirror-commands": "^1.5.2",
"prosemirror-history": "^1.3.0",
"prosemirror-markdown": "^1.10.1",
"@automerge/prosemirror": "^0.1.0"
},
"devDependencies": {
"@babel/preset-env": "^7.15.0",
Expand Down
23 changes: 23 additions & 0 deletions ui/src/elements/all-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum SortColumn {
Created,
Modified,
Title,
Style,
Author
}

Expand All @@ -45,6 +46,7 @@ type NoteRow = {
actionHash: ActionHash,
state: TextEditorState,
authorSort: number,
style: string,
archived: boolean
}

Expand Down Expand Up @@ -143,6 +145,7 @@ export class AllNotes extends LitElement {
actionHash:note.document.actionHash,
state: note.latestState,
authorSort,
style: (decode(note.document.entry.meta!) as any).editorType,
archived
}
}
Expand Down Expand Up @@ -183,6 +186,10 @@ export class AllNotes extends LitElement {
if (this.sortDirection=== SortDirection.Descending)
return notes.sort((a, b) => b.authorSort - a.authorSort)
return notes.sort((a, b) => a.authorSort - b.authorSort)
case SortColumn.Style:
if (this.sortDirection=== SortDirection.Descending)
return notes.sort((a, b) => b.style.localeCompare(a.style))
return notes.sort((a, b) => a.style.localeCompare(b.style))
}
return notes
}
Expand Down Expand Up @@ -235,6 +242,9 @@ export class AllNotes extends LitElement {
<span class="note-created">
${createDate.toLocaleDateString()} ${createDate.toLocaleTimeString()}
</span>
<span class="note-style">
${note.style === "richtext" ? msg("Rich Text") : msg("Markdown")}
</span>
<span class="note-author">
<agent-avatar .agentPubKey=${note.author}></agent-avatar>
</span>
Expand Down Expand Up @@ -321,6 +331,13 @@ export class AllNotes extends LitElement {
>${msg("Created")}
</column-label >
</span>
<span class="note-style">
<column-label id="style"
direction=${this.sortColumn === SortColumn.Style?this.sortDirection:SortDirection.None}
@column-selected=${(e:any)=>this.setSort(SortColumn.Style, e.detail.direction)}>
${msg("Style")}
</column-label>
</span>
<span class="note-author">
<column-label id="author"
direction=${this.sortColumn === SortColumn.Author?this.sortDirection:SortDirection.None}
Expand Down Expand Up @@ -366,6 +383,12 @@ export class AllNotes extends LitElement {
width:100%;
border-bottom: solid 1px #ccc;
}
.note-style {
display:flex;
width: 67px;
margin-left:10px;
justify-content:flex-start;
}
.note-row:hover {
box-shadow: 1px 1px 8px #a7a7a7;
}
Expand Down
13 changes: 6 additions & 7 deletions ui/src/elements/markdown-note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,20 +572,18 @@ export class MarkdownNote extends LitElement {
<slot name="toolbar-action"></slot>
</div>
<div class="row" style="flex: 1;">

${this._view === View.Both || this._view === View.Edit ? html`
<div class="flex-scrollable-parent">
<sl-split-panel position=${ this._view === View.Both ? "50" : this._view === View.View ? "0" : "100"} style="flex: 1; height: 100%; --divider-width: 8px;">
<div slot="start" class="flex-scrollable-parent">
<div class="flex-scrollable-container">
<div class="flex-scrollable-y">
<syn-md-editor
.slice=${sessionStore}
></syn-md-editor>
</div>
</div>
</div>` : ""}
</div>

${this._view === View.Both || this._view === View.View ? html`
<div class="flex-scrollable-parent">
<div slot="end" class="flex-scrollable-parent">
<div class="flex-scrollable-container">
<div class="flex-scrollable-y">
<div style="margin: 8px">
Expand All @@ -597,7 +595,8 @@ export class MarkdownNote extends LitElement {
</div>
</div>
</div>
</div>` : ""}
</div>
</sl-split-panel>
</div>
</div>
`;
Expand Down
Loading
Loading