Skip to content
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

new Web rich text composer #2557

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
825011f
feat: new web textinput
mary-ext Jan 17, 2024
2bce2a7
feat: partial autocomplete suggestions
mary-ext Jan 17, 2024
2d5a023
fix: prevent double-render on suggestion match
mary-ext Jan 18, 2024
e77f48c
fix: light theme styling
mary-ext Jan 18, 2024
ce3102b
fix: get emoji picker to work
mary-ext Jan 18, 2024
92e4836
fix: ensure text node is always rendered
mary-ext Jan 18, 2024
0fbc422
feat: make emoji picker work
mary-ext Jan 18, 2024
930d53f
chore: explain why ZWS is inserted
mary-ext Jan 18, 2024
7410070
feat: paste to add images
mary-ext Jan 18, 2024
0e456bf
fix: onPressPublish doesn't accept parameters
mary-ext Jan 18, 2024
b954b7a
feat: Ctrl+Enter to submit
mary-ext Jan 18, 2024
40a5014
chore: remove old files
mary-ext Jan 18, 2024
00a3632
feat: autocomplete suggestions
mary-ext Jan 18, 2024
23368a9
chore: remove link decorator as well
mary-ext Jan 18, 2024
8786682
chore: remove just about the rest
mary-ext Jan 18, 2024
00bf782
fix: don't put margin on overlay/input
mary-ext Jan 18, 2024
86616d4
chore: move styling to index.html
mary-ext Jan 18, 2024
03e1c63
fix: size differences
mary-ext Jan 18, 2024
19a36c4
refactor: use html strings
mary-ext Jan 19, 2024
3ee0148
merge: branch 'main' into feat/new-richtext-composer
mary-ext Jan 30, 2024
ad9323d
refactor: remove react-dom usage for portal
mary-ext Jan 30, 2024
b4fd957
refactor: use getImageFromUri again
mary-ext Jan 30, 2024
15a7c83
chore: descriptive comments on effects
mary-ext Jan 30, 2024
6038987
fix: properly set font-family
mary-ext Jan 30, 2024
e2a9ae3
fix: properly set selection color
mary-ext Jan 30, 2024
f1a55c7
fix: set autofocus on composer
mary-ext Jan 30, 2024
63235af
fix: oops, readd react-dom types
mary-ext Jan 30, 2024
70054c0
merge: branch 'main' into feat/new-richtext-composer
mary-ext Feb 20, 2024
719d695
fix: use inert on the overlay
mary-ext Feb 20, 2024
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
80 changes: 54 additions & 26 deletions bskyweb/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,42 +131,70 @@
scrollbar-gutter: stable both-edges;
}

/* ProseMirror */
.ProseMirror {
/* RichText composer */
.rt-editor {
font: 18px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
min-height: 140px;
line-height: 24px;
width: 100%;
margin: 0 0 10px 8px;
position: relative;
}
.ProseMirror-dark {
color: white;
.rt-editor-light {
--rt-caret-color: #000000;
}
.ProseMirror p {
margin: 0;
.rt-editor-dark {
--rt-caret-color: #ffffff;
}

.rt-overlay {
position: absolute;
inset: 0;
z-index: 0;
white-space: pre-wrap;
overflow-wrap: break-word;
}
.ProseMirror p.is-editor-empty:first-child::before {
color: #8d8e96;
content: attr(data-placeholder);
float: left;
height: 0;
pointer-events: none;
.rt-segment {
}
.ProseMirror .mention {
color: #0085ff;
.rt-segment-text {
}
.ProseMirror a,
.ProseMirror .autolink {
.rt-segment-link {
color: #0085ff;
}
/* OLLIE: TODO -- this is not accessible */
/* Remove focus state on inputs */
.ProseMirror-focused {
outline: 0;

.rt-input {
caret-color: var(--rt-caret-color);
color: transparent;
font: inherit;
line-height: inherit;
background: transparent;
width: 100%;
border: 0;
margin: 0;
display: block;
box-sizing: border-box;
position: relative;
z-index: 1;
resize: none;
}
.rt-input:focus {
outline: none;
}
textarea:focus,
input:focus {
outline: 0;
.rt-input::selection {
background: #0085ff;
color: #ffffff;
}
.tippy-content .items {
width: fit-content;
.rt-input::placeholder {
color: #878788;
opacity: 1;
}

.rt-overlay,
.rt-input {
padding: 5px;
}

.rt-autocomplete {
z-index: 3;
}

/* Tooltips */
Expand Down
18 changes: 3 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@emoji-mart/react": "^1.1.1",
"@expo/html-elements": "^0.4.2",
"@expo/webpack-config": "^19.0.0",
"@floating-ui/react-dom": "^2.0.6",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
Expand Down Expand Up @@ -75,18 +76,6 @@
"@sentry/react-native": "5.5.0",
"@tamagui/focus-scope": "^1.84.1",
"@tanstack/react-query": "^5.8.1",
"@tiptap/core": "^2.0.0-beta.220",
"@tiptap/extension-document": "^2.0.0-beta.220",
"@tiptap/extension-hard-break": "^2.0.3",
"@tiptap/extension-history": "^2.0.3",
"@tiptap/extension-mention": "^2.0.0-beta.220",
"@tiptap/extension-paragraph": "^2.0.0-beta.220",
"@tiptap/extension-placeholder": "^2.0.0-beta.220",
"@tiptap/extension-text": "^2.0.0-beta.220",
"@tiptap/html": "^2.1.11",
"@tiptap/pm": "^2.0.0-beta.220",
"@tiptap/react": "^2.0.0-beta.220",
"@tiptap/suggestion": "^2.0.0-beta.220",
"@types/node": "^18.16.2",
"@zxing/text-encoding": "^0.9.0",
"array.prototype.findlast": "^1.2.3",
Expand Down Expand Up @@ -172,9 +161,9 @@
"react-native-web-webview": "^1.0.2",
"react-native-webview": "13.6.4",
"react-responsive": "^9.0.2",
"react-textarea-autosize": "^8.5.3",
"rn-fetch-blob": "^0.12.0",
"sentry-expo": "~7.0.1",
"tippy.js": "^6.3.7",
"tlds": "^1.234.0",
"use-deep-compare": "^1.1.0",
"zeego": "^1.6.2",
Expand Down Expand Up @@ -248,8 +237,7 @@
"webpack-dev-server": "^4.11.1"
},
"resolutions": {
"@types/react": "^18",
"**/zeed-dom": "0.10.9"
"@types/react": "^18"
},
"jest": {
"preset": "jest-expo/ios",
Expand Down
2 changes: 1 addition & 1 deletion src/view/com/composer/text-input/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface TextInputProps extends ComponentProps<typeof RNTextInput> {
suggestedLinks: Set<string>
setRichText: (v: RichText | ((v: RichText) => RichText)) => void
onPhotoPasted: (uri: string) => void
onPressPublish: (richtext: RichText) => Promise<void>
onPressPublish: () => Promise<void>
onSuggestedLinksChanged: (uris: Set<string>) => void
onError: (err: string) => void
}
Expand Down
Loading
Loading