From 074a86b707129da9ec491400bfd5627cecff41e3 Mon Sep 17 00:00:00 2001
From: miggymofongo
Date: Sun, 5 Jan 2025 00:34:06 -0400
Subject: [PATCH] readme foo
---
README.md | 20 ++++++++++++++-----
src/components/menu-plugin.ts | 3 +++
src/pages/app-write/app-write.ts | 34 ++++++++++++--------------------
3 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/README.md b/README.md
index 95bf94b..1077865 100644
--- a/README.md
+++ b/README.md
@@ -3,15 +3,25 @@
Aren't you tired of distracting social media platforms?
So many buttons and advertising makes a simple task of sending notes ot your
-friends very draining.
+friends very draining. This is a simple WYSIWYM style rich text editor
+built with ProseMirror
+
+ You can use a next generation social media protocol to transform
+your personal website into a micro blog client. Using WYSIWYG style
+editor builders like ProseMirror, you can render a simple rich
+text editor for visitors to compose notes with. You can type
+out a note and post it to a set of relays.
+
+This is an installable personal website that is accessible through chrome-based and firefox browsers. The website is built with PWA Builder and Lit Web Components. It utilizes the Nostr
+protocol to connect to my personal relay for fetching kind 0 and 1 notes AKA profile metadata
+and short text notes.
+
-This is an installable personal website that is accessisible through chrome-based and firefox browsers. The website is built with PWA Builder and Lit Web Components. It utilizes the Nostr
-protocol to connect to my personal relay for fetching recent notes as well as kind 0 notes AKA profile metadata.
If you're on safari browsers, try visiting the webpage then tapping on the arrow
pointing up in the bottom toolbar. Scroll down a bit to tap on "Add to Home Screen".
-If you're on a chromium-based browser you should be able to do the same
+If you're on a chromium-based browser you should be able to do the same.
@@ -19,7 +29,7 @@ If you're on a chromium-based browser you should be able to do the same
- refactor
-- refactor
+- dropdown menu a la Medium
diff --git a/src/components/menu-plugin.ts b/src/components/menu-plugin.ts
index b9c70f4..a154468 100644
--- a/src/components/menu-plugin.ts
+++ b/src/components/menu-plugin.ts
@@ -28,7 +28,10 @@ export function createMenuPlugin(customSchema: any) {
content: menuContent,
floating: true,
});
+ console.log('Creating menu plugin');
+
return new Plugin({
key: menuPluginKey
})
+
}
diff --git a/src/pages/app-write/app-write.ts b/src/pages/app-write/app-write.ts
index 7172a07..c11917a 100644
--- a/src/pages/app-write/app-write.ts
+++ b/src/pages/app-write/app-write.ts
@@ -16,7 +16,6 @@ import { toggleMark } from 'prosemirror-commands';
import {undo, redo, history} from 'prosemirror-history'
import { baseKeymap } from 'prosemirror-commands';
-import { menuBar } from 'prosemirror-menu';
import {createMenuPlugin} from '../../components/menu-plugin'
@@ -127,6 +126,9 @@ const customKeymap = keymap({
});
+
+
+
@customElement('app-write')
export class AppWrite extends LitElement {
@property({ type: String }) placeholder: string = 'Compose your note...';
@@ -163,12 +165,12 @@ export class AppWrite extends LitElement {
this.initializeEditor()
}
- private initializeEditor() {
+private initializeEditor() {
if (!this.editorContainer) {
console.error('Editor container not here');
return
}
- const doc = customSchema.nodes.doc.createAndFill();
+ const doc = customSchema.nodes.doc.createAndFill();
if (!doc) {
console.error("failed to create initial document")
return;
@@ -176,9 +178,8 @@ export class AppWrite extends LitElement {
const state = EditorState.create({
doc,
- plugins: [menuPlugin,
-
-
+ plugins: [
+ menuPlugin,
history(),
keymap({
'Mod-z': undo,
@@ -192,7 +193,6 @@ export class AppWrite extends LitElement {
- const selection = state.selection;
let view = new EditorView(this.editorContainer, {
state,
dispatchTransaction(transaction) {
@@ -219,6 +219,7 @@ export class AppWrite extends LitElement {
super.disconnectedCallback();
if (this.editorView) {
this.editorView.destroy();
+ this.editorView = null!
}
}
@@ -236,22 +237,13 @@ export class AppWrite extends LitElement {
Editor Demo
-
- Aren't you tired of distracting interfaces on mainstream blogging platforms?
- So many buttons and advertising makes a single task very draining. This is
- a platform-agnostic browser application that is installable to any homescreen!
-
- You can use a protocol to transform your personal website into
- a micro blog client. Using WYSIWYG style editor builders like
- ProseMirror, you can render a simple rich text editor for visitors to compose
- notes with. You can type out a note and post it to a set of relays.
-
+
+
Basic Intructions
- click inside the white text area to place your curson there.
- You can type and press enter to go to the next line down.
+
click inside the white text area to highlight with your curson.
+ You can type and press enter to insert a new block below.
- Click and hold down to select a piece of text, then CTRL+X to cut and
- CTRL+V to paste.
+ Highlight a piece of text, then CTRL+X to cut and CTRL+V to paste.