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

Update TextEditor for Bokeh 3 #4467

Merged
merged 4 commits into from
Feb 27, 2023
Merged

Update TextEditor for Bokeh 3 #4467

merged 4 commits into from
Feb 27, 2023

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Feb 22, 2023

This tries to fix two things, but to be honest, I'm not sure about the implementation for any of them. And more putting it up here to have something to talk out from.

import panel as pn

pn.extension("texteditor")

pn.widgets.TextEditor(value="Highlight me to edit formatting").servable()

With the change in patch_stylesheet, my output looks like this:
image


Without the selection addition:
screenrecord-2023-02-22_17.05.08.mp4

With the selection addition:
screenrecord-2023-02-22_17.03.17.mp4

Reference for the selection

@hoxbro hoxbro marked this pull request as draft February 22, 2023 16:10
panel/io/resources.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Merging #4467 (70172bc) into main (2c38e90) will increase coverage by 0.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #4467      +/-   ##
==========================================
+ Coverage   82.09%   82.20%   +0.11%     
==========================================
  Files         243      243              
  Lines       35249    35249              
==========================================
+ Hits        28937    28977      +40     
+ Misses       6312     6272      -40     
Flag Coverage Δ
ui-tests 35.73% <ø> (+0.26%) ⬆️
unitexamples-tests 74.09% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/io/reload.py 71.73% <0.00%> (-2.18%) ⬇️
panel/io/cache.py 84.97% <0.00%> (-0.43%) ⬇️
panel/io/state.py 70.29% <0.00%> (-0.35%) ⬇️
panel/template/base.py 76.93% <0.00%> (-0.20%) ⬇️
panel/viewable.py 68.06% <0.00%> (+0.56%) ⬆️
panel/tests/util.py 89.18% <0.00%> (+0.90%) ⬆️
panel/tests/conftest.py 89.36% <0.00%> (+1.27%) ⬆️
panel/tests/test_viewable.py 100.00% <0.00%> (+1.51%) ⬆️
panel/tests/ui/io/test_jupyter_server_extension.py 100.00% <0.00%> (+50.00%) ⬆️
panel/tests/ui/widgets/test_misc.py 97.43% <0.00%> (+64.10%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@philippjfr
Copy link
Member

Sadly it does indeed look like Quill does not yet fully support the shadow DOM, here's a more complete polyfill I found in the Quill repo: slab/quill#2021 (comment)

@philippjfr
Copy link
Member

Similar polyfill (would have to test if this works in recent Safari version): https://stackoverflow.com/questions/67914657/quill-editor-inside-shadow-dom/67944380#67944380

@philippjfr philippjfr marked this pull request as ready for review February 27, 2023 17:59
@philippjfr philippjfr merged commit 1696187 into main Feb 27, 2023
@philippjfr philippjfr deleted the update_texteditor branch February 27, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants