Skip to content

Commit

Permalink
fix: link widget in slate and added Callout to blocks widget
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Oct 16, 2023
1 parent a5aa27a commit 6974462
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/config/Slate/Link/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*Customized LinkEditor to handle data-element*/
import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { ReactEditor } from 'slate-react';
Expand Down Expand Up @@ -99,7 +100,10 @@ export default function install(config) {
isActiveElement,
unwrapElement,
};

//remove Volto helper link to add custom helper link
slate.persistentHelpers = slate.persistentHelpers.filter(
(h) => h().props.pluginId !== 'link',
);
slate.persistentHelpers.push((props) => (
<LinkEditor {...props} pluginId={PLUGINID} {...pluginOptions} />
));
Expand Down
1 change: 0 additions & 1 deletion src/config/Widgets/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const getItaliaWidgets = (config) => {
},
widget: {
...config.widgets.widget,
//richtext: WysiwygWidget,
color_list: ColorListWidget,
path_filters: PathFiltersWidget,
location_filter: LocationFiltersWidget,
Expand Down
3 changes: 2 additions & 1 deletion src/config/italiaConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import LeftColumnFacets from '@plone/volto/components/manage/Blocks/Search/layou
import HandleAnchor from 'design-comuni-plone-theme/components/ItaliaTheme/AppExtras/HandleAnchor';
import GenericAppExtras from 'design-comuni-plone-theme/components/ItaliaTheme/AppExtras/GenericAppExtras';
import PageLoader from 'design-comuni-plone-theme/components/ItaliaTheme/AppExtras/PageLoader';
import redraft from 'redraft';

import { loadables as ItaliaLoadables } from 'design-comuni-plone-theme/config/loadables';

// CTs icons
Expand Down Expand Up @@ -286,6 +286,7 @@ export default function applyConfig(voltoConfig) {
'break',
'testo_riquadro_semplice',
'testo_riquadro_immagine',
'callout_block',
'rssBlock',
//se si aggiunge un nuovo blocco, verificare che in edit non ci siano bottoni che provocano il submit della form. Se succede, gestirli con e.prevenDefault() e.stopPropagation().
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ class AddLinkForm extends Component {
}

handleClickOutside = (e) => {
// console.log(
// 'handle',
// this.linkFormContainer.current,
// this.props,
// doesNodeContainClick(this.linkFormContainer.current, e),
// );
if (
this.linkFormContainer.current &&
doesNodeContainClick(this.linkFormContainer.current, e)
Expand Down Expand Up @@ -248,7 +242,13 @@ class AddLinkForm extends Component {
: cx('ui input editor-link', 'input-anchorlink-theme');

return (
<div className="link-form-container" ref={this.linkFormContainer}>
<div
className="link-form-container"
ref={this.linkFormContainer}
onClick={(e) => {
console.log(e.target);
}}
>
<div
style={{ marginLeft: '5px', display: 'flex', alignItems: 'center' }}
>
Expand Down

0 comments on commit 6974462

Please sign in to comment.