-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add dynamic links to Text plugins and
HTMLFields
with CKEdito…
…r 5 (#6) * Add dynamic link fields * Complete some left-over changes * Update private/js/ckeditor5_plugins/cms-link/src/cmsLink.js * Update private/js/ckeditor5_plugins/cms-link/src/cmsLink.js * Fix multiple editor issue * Fix toolbar logic * Fix: UI update calls when changing text * Refactor * Update private/js/ckeditor5_plugins/cms-link/src/cmsLink.js Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> * Fix sourcery recommendations * fix: Update dropdown after using the action view of the link plugin * Update readme * Prepare next release --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2d74829
commit 89f4e7e
Showing
12 changed files
with
596 additions
and
724 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
from djangocms_text.editors import RTEConfig | ||
|
||
|
||
__version__ = "0.1.0" | ||
__version__ = "0.2.0" | ||
|
||
|
||
ckeditor5 = RTEConfig( | ||
name="ckeditor5", | ||
config="CKEDITOR5", | ||
js=("djangocms_text/bundles/bundle.ckeditor5.min.js",), | ||
css={"all": ("djangocms_text/css/cms.ckeditor5.css",)}, | ||
js=("djangocms_text_ckeditor5/bundles/bundle.ckeditor5.min.js",), | ||
css={ | ||
"all": ( | ||
"djangocms_text_ckeditor5/css/cms.ckeditor5.css", | ||
"djangocms_text_ckeditor5/css/cms.linkfield.css", | ||
) | ||
}, | ||
inline_editing=True, | ||
) |
This file contains 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
65 changes: 65 additions & 0 deletions
65
djangocms_text_ckeditor5/static/djangocms_text_ckeditor5/css/cms.linkfield.css
This file contains 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,65 @@ | ||
.ck.ck-balloon-panel { | ||
.cms-linkfield-wrapper { | ||
font-size: 0.8rem; | ||
position: relative; | ||
input[type="text"] { | ||
padding-inline-end: 2em; | ||
background: var(--dca-white, white) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16" fill="%23808080" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>') no-repeat right center; | ||
&[dir=rtl] { | ||
background-position: left center; | ||
} | ||
background-size: auto 1em; | ||
} | ||
.cms-linkfield-selected { | ||
font-weight: bold; | ||
} | ||
.cms-linkfield-dropdown:not(:empty), .cms-linkfield-dropdown:active { | ||
/* Hide dropdown when empty */ | ||
visibility: visible; | ||
} | ||
.cms-linkfield-dropdown { | ||
z-index: 1; | ||
visibility: hidden; | ||
position: absolute; | ||
max-block-size: 200px; | ||
overflow: auto; | ||
inset-inline-start: 0; | ||
inset-block-start: 100%; | ||
border: 1px solid var(--dca-gray-lighter); | ||
background: var(--dca-white); | ||
inline-size: 120%; | ||
resize: both; | ||
border-end-start-radius: 4px; | ||
border-end-end-radius: 4px; | ||
box-shadow: 0 1.5px 1.5px rgba(var(--dca-shadow),.4); | ||
.cms-linkfield-error { | ||
color: red; | ||
font-size: 0.8rem; | ||
} | ||
div { | ||
padding: 0.3rem 6px; | ||
white-space: nowrap; | ||
font-weight: normal; | ||
border-block-end: 1px solid var(--dca-gray-lighter); | ||
&:last-child { | ||
border-bottom: none; | ||
} | ||
&.cms-linkfield-parent { | ||
font-weight: bold; | ||
background: var(--dca-gray-lightest); | ||
} | ||
&.cms-linkfield-message { | ||
font-style: italic; | ||
color: var(--dca-gray); | ||
} | ||
&.cms-linkfield-option { | ||
cursor: pointer; | ||
} | ||
&.cms-linkfield-option:hover { | ||
background: var(--dca-primary); | ||
color: var(--dca-white); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
162 changes: 0 additions & 162 deletions
162
private/js/ckeditor5_plugins/cms-link/src/autocomplete.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.