: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
re = new RegExp(prefix, 'g');
ThemifyStyles.disableNestedSel = null;
const points = ThemifyConstructor.breakpointsReverse;
for (let i = points.length - 1; i > -1; --i) {
api.activeBreakPoint = points[i];
live.setMode(points[i], true);
let stylesheet = live.currentSheet,
rules = stylesheet.cssRules || stylesheet.rules;
for (let j = rules.length - 1; j > -1; --j) {
if (rules[j].selectorText.includes(prefix)) {
let sel = rules[j].selectorText.replace(/\,\s+/g, ',').replace(re, '').split(','),
st = rules[j].cssText.split('{')[1].split(';');
if (sel[0].includes('.tb_text_wrap')) {
for (let s = sel.length - 1; s > 0; --s) {
if (sel[s].includes('.tb_text_wrap')) {
for (let k = st.length - 2; k > -1; --k) {
live.setLiveStyle(st[k].trim().split(': ')[0].trim(), '', sel);
if ('fonts' === i || 'cf_fonts' === i) {
if (css[i][f].length > 0) {
v += ':' + css[i][f].join(',');
api.activeBreakPoint = i;
let sel = j.replace(/\,\s+/g, ',').replace(re, '').split(',');
for (let k = 0, len = css[i][j].length; k < len; ++k) {
let tmp = css[i][j][k].split(';');
for (let k2 = tmp.length - 2; k2 > -1; --k2) {
let prop = tmp[k2].split(':')[0],
v = tmp[k2].replace(prop + ':', '').trim();
if (prop === 'background-image' && tmp[k2].includes('svg') && tmp[k2].includes('data:')) {
live.setLiveStyle(prop, v, sel);
ThemifyConstructor.font_select.loadGoogleFonts(fonts.join('|'));
api.activeBreakPoint = oldBreakpoint;
this.updated(css, res, values,model);
this._liveInstance = null;
if (api.activeModel !== null) {
this.previousId = api.activeModel.id;
const gsPost = this.styles[id],
args = api.Helper.cloneObject(gsPost.data[0]),
delete args.styling[this.key];
delete args.styling[this.key];
m = new api.SubRow(args);
delete args.cols[0].modules;
delete args.cols[0].styling[this.key];
m = new api.Column(args.cols[0]);
delete args.cols[0].styling;
delete args.cols[0].modules[0].mod_settings[this.key];
m = api.Module.initModule(args.cols[0].modules[0]);
api.LightBox.el.className += ' gs_post';
const lb=await m.edit('styling'),
Themify.off('themify_builder_lightbox_close', revertChange)
.off('themify_builder_save_component', saveComponent);
lb.classList.remove('gs_post');
if (!api.isVisual && this.previousId !== null && (type === 'row' || type === 'column' || type === 'subrow')) {
if (api.Registry.get(this.previousId)?.type === 'module') {
api.liveStylingInstance.removeBgSlider();
api.liveStylingInstance.removeBgVideo();
api.liveStylingInstance.removeFrames();
api.liveStylingInstance.getComponentBgOverlay()?.remove();
api.liveStylingInstance.el.classList.remove('builder-zoom-scrolling', 'builder-zooming');
this.reopenPreviousPanel();
this.activeGS = this.previousId =null;
saveComponent=async settings=>{
const id = this.activeGS,
gsPost = this.styles[id];
delete ThemifyConstructor.values.cid;
const data = api.Helper.cloneObject(settings);
if ('row' === type || type === 'subrow') {
gsPost.data[0].styling = data;
delete gsPost.data[0].cols;
delete gsPost.data[0].styling;
delete gsPost.data[0].cols[0].grid_class;
delete gsPost.data[0].cols[0].modules;
gsPost.data[0].cols[0].styling = data;
delete gsPost.data[0].cols[0].styling;
gsPost.data[0].cols[0].modules[0].mod_settings = data;
api.Spinner.showLoader();
await api.Utils.saveCss(gsPost.data, '', gsPost.id);
this.styles[id].data = gsPost.data;
const Registry= api.Registry,
items = Registry.items.keys();
let args = Registry.get(cid)?.get('styling');
if (args?.[this.key]?.includes(id)) {
await this.setGsStyle(args[this.key].split(' '));
this._liveInstance = null;
action:'tb_update_global_style',
api.Spinner.showLoader('done');
this.activeGS = this.previousId=null;
api.Spinner.showLoader('error');
lb.tfClass('current')[0].tfClass('tb_tooltip')[0].innerHTML = i18n.g_s + ' - ' + gsPost.title;
Themify.on('themify_builder_lightbox_close', revertChange,true)
.on('themify_builder_save_component', saveComponent,true);
// Open prevous module panel
reopenPreviousPanel(triggerData) {
if (null !== this.previousId) {
api.Registry.get(this.previousId)?.edit('styling');
extraStyle(css, res, values,model) {
let live = this._liveInstance || api.liveStylingInstance,
start = prefix.length - 1,
exist = live.getComponentBgOverlay(model.type)!==null,
parallaxClass = 'builder-parallax-scrolling',
zoomClass = 'builder-zoom-scrolling';
if ('fonts' !== i && 'cf_fonts' !== i && 'gs' !== i) {
if (hasOverlay === false) {
hasOverlay = j.includes('builder_row_cover', start);
if (j.includes('tb_row_frame', start)) {
if (sides[f] === false && j.includes('tb_row_frame_' + f, start)) {
if (hasOverlay === true && framesCount === 4) {
if (exist === false && hasOverlay === true) {
live.addOrRemoveComponentOverlay();
let fr = createDocumentFragment(),
frame_wrap = el.querySelector(':scope>.tb_row_frame_wrap');
frame_wrap = createElement('span','tb_row_frame_wrap tf_overflow tf_abs');
el.tfClass('tb_'+model.type+'_action')[0].after(frame_wrap);
if (sides[f] === true && !frame_wrap.tfClass('tb_row_frame_' + f)[0]) {
fr.appendChild(createElement('span','tf_abs tf_overflow tf_w tb_row_frame tb_row_frame_' + f));
frame_wrap.appendChild(fr);
let bgType = res.styling !== undefined ? (res.styling.background_type || 'image') : 'none';
if (bgType === 'image' && res.styling.background_repeat === parallaxClass && res.styling.background_image) {
el.classList.add(parallaxClass);
el.classList.remove(parallaxClass);
el.style.backgroundPosition = '';
if (bgType === 'image' && res.styling.background_repeat === zoomClass && res.styling.background_image) {
el.classList.add(zoomClass);
el.classList.remove(zoomClass);
el.style.backgroundSize = '';
})(tb_app,_CLICK_,ThemifyConstructor);