Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
61c7387
Copy Highlighter
omnibs Oct 9, 2024
f62e970
Add longform highlighter example
omnibs Oct 14, 2024
5017793
Wire new example in
omnibs Oct 14, 2024
1368317
Remove functions not used in Writing
omnibs Oct 9, 2024
3c38280
Use Longform in example and remove unused functions
omnibs Oct 14, 2024
9ccfce3
Remove unused bits
omnibs Oct 10, 2024
d01c4a7
Start making unstyled from the outside in
omnibs Oct 10, 2024
fad0615
Unstyle viewFoldHelper and FoldState
omnibs Oct 10, 2024
a2ff902
Unstyle viewHighlightable
omnibs Oct 10, 2024
1b90f99
Unstyle view_
omnibs Oct 14, 2024
33ea2d5
Unstyle Longform example
omnibs Oct 14, 2024
e4363d8
Create a copy of mark for longform
omnibs Oct 14, 2024
1527f04
Move toUnstyled into Mark
omnibs Oct 14, 2024
6779a8e
Unstyle Mark.view_
omnibs Oct 14, 2024
ed009c5
Extract viewMarked styles to global CSS
omnibs Oct 14, 2024
feeac73
Unstyle viewMarked
omnibs Oct 14, 2024
727448c
Fix inline tags
omnibs Oct 14, 2024
c20265d
Remove viewTag, branch on tagStyle
omnibs Oct 14, 2024
8cc1470
Extract viewInlineTag styles to global CSS
omnibs Oct 14, 2024
2f0db47
Restructure for readability
omnibs Oct 14, 2024
801219e
Fix missing css on viewInlineTags direct call
omnibs Oct 14, 2024
4b49247
Unstyle viewInlineTag
omnibs Oct 14, 2024
a0f8b49
Remove config from maybeHighlightableStyles
omnibs Oct 15, 2024
7b61b20
Create a top-level renderStyles
omnibs Oct 15, 2024
624f384
Use renderStyles in view_
omnibs Oct 15, 2024
0094eff
Render styles in viewFoldHelper
omnibs Oct 15, 2024
615f165
Unstyle eventListeners
omnibs Oct 15, 2024
aadb205
Make a longform highlightable
omnibs Oct 15, 2024
747b0fd
Make highlightable attributes unstyled
omnibs Oct 15, 2024
cec57d4
Unstyle viewHighlightableSegment (css pending)
omnibs Oct 15, 2024
1b87b6b
Unstyle viewHighlightable(Segment) w/ bugs
omnibs Oct 16, 2024
9196e43
Fix overlapping/fold highlight styling
omnibs Oct 16, 2024
4a479dc
Fix before/after in non-overlapping case
omnibs Oct 16, 2024
eb4f6ea
Make a huge example so we can compare perf gains
omnibs Oct 16, 2024
913d5b0
Make it lazy (little benefit)
omnibs Oct 16, 2024
ca63a8a
isHovering is never used
omnibs Oct 17, 2024
4bf8a5f
Use own Attribute type so lazy can compare it
omnibs Oct 17, 2024
8cd13b2
Enforce highlightable.index matches index on list
omnibs Oct 17, 2024
27f3c93
Make highlightable capable of tracking state
omnibs Oct 17, 2024
7ba2cbe
Track focused on Highlightable
omnibs Oct 17, 2024
3743b83
Track hinted on Highlightable
omnibs Oct 18, 2024
6841889
Remove unused hintingIndices
omnibs Oct 21, 2024
1df17fe
Make overlapsSupport a flag in the model
omnibs Oct 21, 2024
ff644a0
Remove unused extensible record fields
omnibs Oct 21, 2024
97f0be3
Use getAt
omnibs Oct 24, 2024
81f5be3
Remove functions not used by Writing
omnibs Oct 25, 2024
c4c7884
Calculate range of every marker
omnibs Oct 27, 2024
2e0b5d6
Store marked ranges in the model
omnibs Oct 27, 2024
eb4ef9a
We can have multiple highlights of the same marker
omnibs Oct 27, 2024
23140eb
viewHighlightable doesn't need overlaps anymore
omnibs Oct 27, 2024
15b2320
Remove dead code
omnibs Oct 27, 2024
13b3a68
mouseDownIndex is not used in view anymore
omnibs Oct 27, 2024
0ebe147
Remove a few model dependencies
omnibs Oct 27, 2024
bb2a4dd
Remove stray comments
omnibs Oct 27, 2024
bcb6aa4
Create pipeline for updating highlightables
omnibs Oct 27, 2024
9c385a6
Update focused state on the pipeline
omnibs Oct 27, 2024
afd30ec
Move clean near update
omnibs Oct 27, 2024
0b7b634
Update hinted on the pipeline
omnibs Oct 27, 2024
ed7ed97
Fix bug: overlapping highlights weren't working
omnibs Oct 27, 2024
29a36e9
Remove support for same-kind marks to be independently hovered
omnibs Oct 27, 2024
65096b4
Remove overlapsSupport from FoldState
omnibs Oct 27, 2024
971b9bc
No need to carry around shortest hovered marker
omnibs Oct 27, 2024
2c5d63f
Writing never uses showTagsInline
omnibs Oct 27, 2024
0f9f1f9
Move hinting class to viewHighlightableSegment
omnibs Oct 27, 2024
9aec07e
Fix overlaps erased on hinting
omnibs Oct 27, 2024
3202b4c
FocusRing was being overridden by Highlighter css
omnibs Oct 27, 2024
2a2948d
Fix hint right to left
omnibs Oct 27, 2024
e21bcd2
UpdateHinted even tho writing has no eraser
omnibs Oct 27, 2024
bd0911d
Update hovered state on the pipeline
omnibs Oct 27, 2024
ea40a52
Duplicate hovered and hinted styling
omnibs Oct 27, 2024
a65e74f
Remove dead code
omnibs Oct 27, 2024
f47d6d8
Track what a Highlightable is hinted or hovered by
omnibs Oct 27, 2024
49abde1
Pass id as argument to viewHighlightable
omnibs Oct 27, 2024
ef6779f
Render markdown is never used by writing
omnibs Oct 27, 2024
42042ee
Stop passing model to viewHighlightable
omnibs Oct 27, 2024
3059339
joinAdjacent was breaking lazy for static spaces
omnibs Oct 27, 2024
9b2001d
trimHighlightableGroups wasn't doing anything
omnibs Oct 27, 2024
3b9c3ad
Fix stray hints on whitespace
omnibs Oct 27, 2024
42fccfb
removeHighlights_ was breaking lazy
omnibs Oct 27, 2024
323a608
Trim highlighter examples to help demo perf fixes
omnibs Oct 28, 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
22 changes: 22 additions & 0 deletions component-catalog/src/Examples.elm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Examples.Highlighter as Highlighter
import Examples.HighlighterToolbar as HighlighterToolbar
import Examples.Loading as Loading
import Examples.Logo as Logo
import Examples.LongFormHighlighter as LongForm
import Examples.Menu as Menu
import Examples.Message as Message
import Examples.Modal as Modal
Expand Down Expand Up @@ -458,6 +459,25 @@ all =
HighlighterState childState ->
Just childState

_ ->
Nothing
)
, LongForm.example
|> Example.wrapMsg LongFormHighlighterMsg
(\msg ->
case msg of
LongFormHighlighterMsg childMsg ->
Just childMsg

_ ->
Nothing
)
|> Example.wrapState LongFormHighlighterState
(\msg ->
case msg of
LongFormHighlighterState childState ->
Just childState

_ ->
Nothing
)
Expand Down Expand Up @@ -1113,6 +1133,7 @@ type State
| HeaderState Header.State
| HeadingState Heading.State
| HighlighterState Highlighter.State
| LongFormHighlighterState LongForm.State
| HighlighterToolbarState HighlighterToolbar.State
| LoadingState Loading.State
| LogoState Logo.State
Expand Down Expand Up @@ -1170,6 +1191,7 @@ type Msg
| HeaderMsg Header.Msg
| HeadingMsg Heading.Msg
| HighlighterMsg Highlighter.Msg
| LongFormHighlighterMsg LongForm.Msg
| HighlighterToolbarMsg HighlighterToolbar.Msg
| LoadingMsg Loading.Msg
| LogoMsg Logo.Msg
Expand Down
3,091 changes: 2,819 additions & 272 deletions component-catalog/src/Examples/Highlighter.elm

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions component-catalog/src/Examples/HighlighterPort.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
port module Examples.HighlighterPort exposing (..)

{-| Start listening to events on a highlighter
-}


port highlighterInit : ( String, Bool, Bool ) -> Cmd msg


{-| Listen to mouseup/touchend events on the whole document, to stop highlighting.
-}
port highlighterTouchPointerRelease : (( String, String ) -> msg) -> Sub msg


{-| Listen to touch events, and get the element under the finger.
-}
port highlighterOnTouchEvent : (( String, String, Int ) -> msg) -> Sub msg
Loading