-
Notifications
You must be signed in to change notification settings - Fork 84
Integrate Nostr-Editor #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e52b7e6
git reset
ticruz38 b475002
button restyling
ticruz38 b4b73df
get suggestions style closer to Coracle than Flotilla
ticruz38 f847a57
no block elements in editor
ticruz38 550602f
theme fix
ticruz38 75c0b8d
remove unused catch block
ticruz38 526c02f
use editor for onboarding
ticruz38 f158462
blossom support
ticruz38 7a751c8
only show suggestions once a term is set
ticruz38 8382dc0
main note send on mod+enter
ticruz38 4241fa1
link content css
ticruz38 760754f
fresh install
ticruz38 dce6a01
align paperclip with cog and alt buttons
ticruz38 2d34ab0
ts-check
ticruz38 6a19a39
select fix
ticruz38 18e30e3
rename fileUpload extension
ticruz38 14964df
parse editor content using \n
ticruz38 bac5a59
fix TagExtension
ticruz38 9c57280
unnecessary if
ticruz38 2406a5d
multi tags support
ticruz38 04f4303
apply text-neutral-800 to link-content
ticruz38 76738fa
avoid error on undefined nevent content
ticruz38 0838407
split nip96 and blossom url setting
ticruz38 93140d5
minor improvement
ticruz38 8ff5fd3
default blossom settings
ticruz38 979d16e
no-underline for tags
ticruz38 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import cx from "classnames" | ||
import type {NodeViewProps} from "@tiptap/core" | ||
import {NodeViewWrapper} from "svelte-tiptap" | ||
import Anchor from "src/partials/Anchor.svelte" | ||
import {copyToClipboard} from "src/util/html" | ||
import {showInfo} from "src/partials/Toast.svelte" | ||
|
||
export let node: NodeViewProps["node"] | ||
export let selected: NodeViewProps["selected"] | ||
|
||
const copy = () => copyToClipboard(node.attrs.lnbc) && showInfo("Copied to clipboard") | ||
</script> | ||
|
||
<NodeViewWrapper class="inline"> | ||
<Anchor on:click={copy} class={cx("link-content", {"link-content-selected": selected})}> | ||
<i class="fas fa-bolt inline-block translate-y-px"></i> | ||
{node.attrs.lnbc.slice(0, 16)}... | ||
</Anchor> | ||
</NodeViewWrapper> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script lang="ts"> | ||
import cx from "classnames" | ||
import type {NodeViewProps} from "@tiptap/core" | ||
import {NodeViewWrapper} from "svelte-tiptap" | ||
import {ellipsize, nthEq} from "@welshman/lib" | ||
import {type TrustedEvent, fromNostrURI, Address} from "@welshman/util" | ||
import {router} from "../util" | ||
import {deriveEvent} from "src/engine" | ||
|
||
export let node: NodeViewProps["node"] | ||
export let selected: NodeViewProps["selected"] | ||
|
||
const displayEvent = (e: TrustedEvent) => { | ||
const content = e?.tags.find(nthEq(0, "alt"))?.[1] || e?.content | ||
|
||
return content?.length > 1 | ||
? ellipsize(content, 30) | ||
: fromNostrURI(nevent || naddr).slice(0, 16) + "..." | ||
} | ||
|
||
$: ({identifier, pubkey, kind, id, relays = [], nevent, naddr} = node.attrs) | ||
$: event = deriveEvent(id || new Address(kind, pubkey, identifier).toString(), relays) | ||
|
||
$: src = router | ||
.at("notes") | ||
.of(id || $event?.id, {relays}) | ||
.toString() | ||
</script> | ||
|
||
<NodeViewWrapper class="inline"> | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={src} | ||
class={cx("link-content", {"link-content-selected": selected})}> | ||
{displayEvent($event)} | ||
</a> | ||
</NodeViewWrapper> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import cx from "classnames" | ||
import type {NodeViewProps} from "@tiptap/core" | ||
import {NodeViewWrapper} from "svelte-tiptap" | ||
import {displayUrl} from "@welshman/lib" | ||
|
||
export let node: NodeViewProps["node"] | ||
export let selected: NodeViewProps["selected"] | ||
</script> | ||
|
||
<NodeViewWrapper class="inline-block"> | ||
<a | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
href={node.attrs.url} | ||
class={cx("link-content", {"link-content-selected": selected})}> | ||
<i class="fas fa-link inline-block"></i> | ||
{displayUrl(node.attrs.url)} | ||
</a> | ||
</NodeViewWrapper> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<style> | ||
.loading { | ||
animation: blurPulse 1.5s infinite; | ||
} | ||
|
||
@keyframes blurPulse { | ||
0% { | ||
opacity: 0.2; | ||
} | ||
50% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0.2; | ||
} | ||
} | ||
</style> | ||
|
||
<script lang="ts"> | ||
import type {NodeViewProps} from "@tiptap/core" | ||
import {NodeViewWrapper} from "svelte-tiptap" | ||
import cx from "classnames" | ||
|
||
export let node: NodeViewProps["node"] | ||
export let selected: NodeViewProps["selected"] | ||
</script> | ||
|
||
<!-- this component display image or videos only, the filter is made by tiptap --> | ||
<NodeViewWrapper | ||
class={cx("link-content inline", { | ||
"link-content-selected": selected, | ||
})}> | ||
<span class:loading={node.attrs.uploading}> | ||
<i class="fas fa-paperclip"></i> | ||
{node.attrs.file?.name || node.attrs.src} | ||
</span> | ||
</NodeViewWrapper> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import cx from "classnames" | ||
import type {NodeViewProps} from "@tiptap/core" | ||
import {NodeViewWrapper} from "svelte-tiptap" | ||
import PersonLink from "src/app/shared/PersonLink.svelte" | ||
|
||
export let node: NodeViewProps["node"] | ||
export let selected: NodeViewProps["selected"] | ||
</script> | ||
|
||
<NodeViewWrapper class={cx("link-content inline", {"link-content-selected": selected})}> | ||
<PersonLink pubkey={node.attrs.pubkey} /> | ||
</NodeViewWrapper> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.