const panelView = elementor?.getPanelView();
const currentPageView = panelView?.currentPageView;
if (panelView && currentPageView?.model && currentPageView?.model?.attributes?.widgetType) {
const widgetModel = currentPageView.model;
// Getter
widgetModel.getSetting(key);
// Setter
widgetModel.setSetting(key, value);
}
// Found another hook too for new version of Elementor.
// Fires when a widget gets active.
elementor.hooks.addAction('panel/open_editor/widget', (panel, model) => {
// Your code here.
}