Skip to content

Commit a0f5900

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents 30f539b + 83d5a5c commit a0f5900

10 files changed

+574
-1387
lines changed

CHANGELOG.rst

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog
33
=========
44

5+
0.7.0 (02-03-2025)
6+
==================
7+
8+
* fix: Avoid downcasting of text-enabled child plugins if plugins are already downcasted by @fsbraun in https://github.com/django-cms/djangocms-text/pull/58
9+
* fix: ModuleNotFoundError when CMS is not installed by @fsbraun in https://github.com/django-cms/djangocms-text/pull/56
10+
* fix: Chrome focus issue, django CMS 5 support by @fsbraun in https://github.com/django-cms/djangocms-text/pull/64
11+
512
0.6.0 (06-02-2025)
613
==================
714

djangocms_text/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
10. Github actions will publish the new package to pypi
1717
"""
1818

19-
__version__ = "0.6.0"
19+
__version__ = "0.7.0"

djangocms_text/cms_plugins.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def get_messages(self, request):
579579

580580
@classmethod
581581
@lru_cache
582-
def get_child_plugin_candidates(cls, slot: str, page=None, template=None):
582+
def get_child_plugin_candidates(cls, *args, **kwargs):
583583
"""
584584
585585
This method is a class method that returns a list of child plugin candidates for a given slot and page.
@@ -591,10 +591,7 @@ def get_child_plugin_candidates(cls, slot: str, page=None, template=None):
591591
Returns:
592592
- A list of text-enabled plugins that can be used as child plugins for the given slot and page.
593593
"""
594-
text_enabled_plugins = plugin_pool.get_text_enabled_plugins(
595-
placeholder=slot,
596-
page=page,
597-
)
594+
text_enabled_plugins = plugin_pool.get_text_enabled_plugins(*args, **kwargs) # Just pass on arguments
598595
# Filter out plugins that are not in the whitelist if given
599596
if settings.TEXT_CHILDREN_WHITELIST is not None:
600597
text_enabled_plugins = [

package-lock.json

+393-1,283
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
},
2121
"homepage": "https://github.com/django-cms/djangocms-text",
2222
"devDependencies": {
23-
"@babel/core": "^7.26.0",
24-
"@babel/preset-env": "^7.26.0",
25-
"@testing-library/dom": "^9.3.4",
23+
"@babel/core": "^7.26.9",
24+
"@babel/preset-env": "^7.26.9",
25+
"@testing-library/dom": "^10.4.0",
2626
"@testing-library/jest-dom": "^6.6.3",
2727
"babel-jest": "^29.7.0",
2828
"css-loader": "^7.1.2",
@@ -32,37 +32,37 @@
3232
"jest-environment-jsdom": "^29.7.0",
3333
"mini-css-extract-plugin": "^2.9.2",
3434
"npm-upgrade": "^3.1.0",
35-
"postcss": "^8.4.49",
35+
"postcss": "^8.5.3",
3636
"postcss-import": "^16.1.0",
3737
"postcss-loader": "^8.1.1",
38-
"postcss-nested": "^6.2.0",
39-
"sass": "^1.83.0",
40-
"sass-loader": "^16.0.4",
38+
"postcss-nested": "^7.0.2",
39+
"sass": "^1.85.1",
40+
"sass-loader": "^16.0.5",
4141
"slim-select": "^2.10.0",
4242
"source-map-loader": "^5.0.0",
4343
"style-loader": "^4.0.0",
44-
"webpack": "^5.97.1",
45-
"webpack-cli": "^5.1.4"
44+
"webpack": "^5.98.0",
45+
"webpack-cli": "^6.0.1"
4646
},
4747
"dependencies": {
48-
"@tiptap/core": "^2.10.4",
49-
"@tiptap/extension-blockquote": "^2.10.4",
50-
"@tiptap/extension-bubble-menu": "^2.10.4",
51-
"@tiptap/extension-character-count": "^2.10.4",
52-
"@tiptap/extension-floating-menu": "^2.10.4",
53-
"@tiptap/extension-image": "^2.10.4",
54-
"@tiptap/extension-link": "^2.10.4",
55-
"@tiptap/extension-placeholder": "^2.10.4",
56-
"@tiptap/extension-subscript": "^2.10.4",
57-
"@tiptap/extension-superscript": "^2.10.4",
58-
"@tiptap/extension-table": "^2.10.4",
59-
"@tiptap/extension-table-cell": "^2.10.4",
60-
"@tiptap/extension-table-header": "^2.10.4",
61-
"@tiptap/extension-table-row": "^2.10.4",
62-
"@tiptap/extension-text-align": "^2.10.4",
63-
"@tiptap/extension-underline": "^2.10.4",
64-
"@tiptap/pm": "^2.10.4",
65-
"@tiptap/starter-kit": "^2.10.4",
48+
"@tiptap/core": "^2.11.5",
49+
"@tiptap/extension-blockquote": "^2.11.5",
50+
"@tiptap/extension-bubble-menu": "^2.11.5",
51+
"@tiptap/extension-character-count": "^2.11.5",
52+
"@tiptap/extension-floating-menu": "^2.11.5",
53+
"@tiptap/extension-image": "^2.11.5",
54+
"@tiptap/extension-link": "^2.11.5",
55+
"@tiptap/extension-placeholder": "^2.11.5",
56+
"@tiptap/extension-subscript": "^2.11.5",
57+
"@tiptap/extension-superscript": "^2.11.5",
58+
"@tiptap/extension-table": "^2.11.5",
59+
"@tiptap/extension-table-cell": "^2.11.5",
60+
"@tiptap/extension-table-header": "^2.11.5",
61+
"@tiptap/extension-table-row": "^2.11.5",
62+
"@tiptap/extension-text-align": "^2.11.5",
63+
"@tiptap/extension-underline": "^2.11.5",
64+
"@tiptap/pm": "^2.11.5",
65+
"@tiptap/starter-kit": "^2.11.5",
6666
"html-loader": "^5.1.0",
6767
"quill": "^2.0.3"
6868
}

private/css/cms.toolbar.css

+9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
.ProseMirror-focused [role="menubar"] {
33
/* show toolbar if editor is focused */
44
visibility: visible;
5+
transition: visibility 150ms;
56
[role="button"].show {
67
z-index: 10;
78
> .dropdown-content {
89
visibility: visible;
10+
transition: visibility 150ms;
911
height: auto;
1012
}
1113
}
@@ -25,6 +27,7 @@
2527
font-size: 1rem;
2628
font-weight: normal;
2729
visibility: hidden;
30+
transition: visibility 150ms;
2831
position: absolute;
2932
pointer-events: all;
3033
display: flex;
@@ -47,6 +50,7 @@
4750
display: block;
4851
top: 0;
4952
visibility: visible;
53+
transition: visibility 150ms;
5054
[role="button"].show {
5155
z-index: 10;
5256
> .dropdown-content {
@@ -195,6 +199,7 @@
195199
color: var(--dca-black, var(--body-fg));
196200
border-radius: 0;
197201
visibility: hidden;
202+
transition: visibility 150ms;
198203
height: 0;
199204
overflow-y: hidden;
200205
position: absolute;
@@ -268,15 +273,18 @@
268273
.ProseMirror-focused .cms-block-toolbar, &:has(dialog.cms-form-dialog) .cms-block-toolbar {
269274
/* show toolbar if editor is focused or form dialog is open */
270275
visibility: visible;
276+
transition: visibility 150ms;
271277
&.show .cms-block-dropdown {
272278
visibility: visible;
279+
transition: visibility 150ms;
273280
}
274281
}
275282

276283
.cms-block-toolbar {
277284
--size: 1rem;
278285
position: absolute;
279286
visibility: hidden;
287+
transition: visibility 150ms;
280288
box-sizing: border-box;
281289
border-width: 0;
282290
border-style: solid;
@@ -320,6 +328,7 @@
320328
box-shadow: 0 1.5px 1.5px rgba(var(--dca-shadow),.4);
321329
border: 1px solid var(--dca-gray-light);
322330
visibility: hidden;
331+
transition: visibility 150ms;
323332
display: flex;
324333
svg {
325334
width: calc(1.2 * var(--size));

private/js/cms.dialog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class CmsDialog {
135135
if (heading) {
136136
this.dialog.querySelector(".cms-modal-title-suffix").textContent = heading.textContent;
137137
}
138+
this.open();
138139
// If form is big (i.e., scrollbars appear), make the dialog bigger
139140
if (content.documentElement.scrollHeight > content.documentElement.clientHeight) {
140141
this.dialog.style.height = "60%";
@@ -154,7 +155,6 @@ class CmsDialog {
154155
}
155156
}
156157
}
157-
this.open();
158158
}
159159

160160
_dialogSaved(el, content, data) {

private/js/cms.editor.js

+7-14
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,10 @@ class CMSEditor {
3737
this.CMS = window.parent.CMS;
3838
}
3939

40-
if (this.CMS) {
40+
if (this.mainWindow) {
4141
// Only needs to happen on the main window.
4242
this.CMS.$(window).on('cms-content-refresh', () => {
43-
if (document.querySelector('template.cms-plugin')) {
44-
// django CMS core does not wrap newly inserted inline editable fields
45-
this.CMS.API.Helpers.reloadBrowser();
46-
} else {
47-
this._resetInlineEditors();
48-
}
43+
this._resetInlineEditors();
4944
});
5045
}
5146

@@ -54,7 +49,7 @@ class CMSEditor {
5449
this._admin_selector = this._inline_admin_selector + ':not(.empty-form) ' + this._admin_selector;
5550
}
5651
this.initAll();
57-
});
52+
}, { once: true });
5853
}
5954

6055
// CMS Editor: init_all
@@ -97,10 +92,6 @@ class CMSEditor {
9792
if (!el.id) {
9893
el.id = "cms-edit-" + Math.random().toString(36).slice(2, 9);
9994
}
100-
if (el.id in this._editor_settings) {
101-
// Already initialized - happens when an inline editor is scrolled back into the viewport
102-
return;
103-
}
10495
// Create editor
10596
if (!el.dataset.cmsType || el.dataset.cmsType === 'TextPlugin' || el.dataset.cmsType === 'HTMLField') {
10697
this._createRTE(el);
@@ -127,13 +118,15 @@ class CMSEditor {
127118
this.observer = this.observer || new IntersectionObserver( (entries) => {
128119
entries.forEach((entry) => {
129120
if (entry.isIntersecting) {
121+
this.observer.unobserve(entry.target); // Only init once
130122
this.init(entry.target);
131123
}
132124
}, this);
133125
}, {
134126
root: null,
135127
threshold: 0.05
136128
});
129+
this.observer.disconnect();
137130

138131
let generic_inline_fields = document.getElementById('cms-generic-inline-fields') || {};
139132
if (generic_inline_fields) {
@@ -499,7 +492,7 @@ class CMSEditor {
499492
}
500493
}
501494
// Additional content for the page disrupts inline editing and needs to be removed
502-
delete this.CMS.API.Helpers.dataBridge.structure.content;
495+
delete this.CMS.API.Helpers.dataBridge.structure?.content;
503496

504497
if (this.CMS.settings.version.startsWith('3.')) {
505498
/* Reflect dirty flag in django CMS < 4 */
@@ -636,7 +629,7 @@ class CMSEditor {
636629

637630
// CMS Editor: resetInlineEditors
638631
_resetInlineEditors () {
639-
this.initAll();
632+
this.initInlineEditors();
640633
}
641634

642635
// CMS Editor: loadToolbar

0 commit comments

Comments
 (0)