Changeset 3386685
- Timestamp:
- 10/29/2025 09:23:37 PM (5 months ago)
- Location:
- groundhogg
- Files:
-
- 12 edited
- 1 copied
-
tags/4.2.6.1 (copied) (copied from groundhogg/trunk)
-
tags/4.2.6.1/README.txt (modified) (2 diffs)
-
tags/4.2.6.1/assets/js/admin/emails/email-block-editor.js (modified) (1 diff)
-
tags/4.2.6.1/assets/js/admin/emails/email-block-editor.min.js (modified) (1 diff)
-
tags/4.2.6.1/groundhogg.php (modified) (2 diffs)
-
tags/4.2.6.1/includes/extension.php (modified) (1 diff)
-
tags/4.2.6.1/includes/form/form-v2.php (modified) (1 diff)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/js/admin/emails/email-block-editor.js (modified) (1 diff)
-
trunk/assets/js/admin/emails/email-block-editor.min.js (modified) (1 diff)
-
trunk/groundhogg.php (modified) (2 diffs)
-
trunk/includes/extension.php (modified) (1 diff)
-
trunk/includes/form/form-v2.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
groundhogg/tags/4.2.6.1/README.txt
r3386122 r3386685 7 7 Tested up to: 6.8 8 8 Requires PHP: 7.1 9 Stable tag: 4.2.6 9 Stable tag: 4.2.6.1 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl.md … … 379 379 == Changelog == 380 380 381 = 4.2.6 (2025-10-21) = 381 = 4.2.6.1 (2025-10-29) = 382 * FIXED Recaptcha field missing in rendered form if the recaptcha version is v3 383 * FIXED Font style not parsed correctly from text blocks if no `<p>` tag is present. 384 * FIXED Escaped HTML visible on the licenses page. 385 386 = 4.2.6 (2025-10-28) = 382 387 * ADDED Frequency limits for triggers. 383 388 * ADDED Batch scheduling for adding contacts to flows. -
groundhogg/tags/4.2.6.1/assets/js/admin/emails/email-block-editor.js
r3386122 r3386685 7424 7424 registerBlock('text', 'Text', { 7425 7425 attributes: { 7426 p: el => parseFontStyleFromTag(el, 'p '),7426 p: el => parseFontStyleFromTag(el, 'p,li'), 7427 7427 a: el => parseFontStyleFromTag(el, 'a'), 7428 7428 h1: el => parseFontStyleFromTag(el, 'h1'), -
groundhogg/tags/4.2.6.1/assets/js/admin/emails/email-block-editor.min.js
r3386122 r3386685 131 131 ${fontStyle(h3)} 132 132 } 133 `};const fontDefaults=style=>({lineHeight:"1.4",fontFamily:"system-ui, sans-serif",fontWeight:"normal",fontSize:13,fontStyle:"normal",textTransform:"none",...style});const fontStyle=style=>{return objectToStyle(fillFontStyle(style))};const fillFontStyle=({use="custom",color="",fontFamily="",fontSize=16,...style})=>{if(GlobalFonts.has(use)){let font=GlobalFonts.get(use).style;if(font){return fillFontStyle({...font,color:color})}}return{...fontDefaults(style),color:color,fontSize:`${fontSize}px`,fontFamily:normalizeFont(fontFamily)}};const FontControls=(style={},onChange=style=>{},supports={})=>{supports={fontSize:true,fontFamily:true,fontWeight:true,lineHeight:true,fontStyle:true,textTransform:true,...supports};let{fontSize="14",fontFamily="",fontWeight="normal",fontStyle="normal",textTransform="none",lineHeight="1.4"}=fontDefaults(style);const fontDisplay=font=>Span({style:{fontFamily:font}},fontFamilies[font]);fontFamily=normalizeFont(fontFamily);return Div({className:"font-controls display-flex column gap-10"},[!supports.fontFamily?null:Control({label:__("Font Family","groundhogg"),stacked:true},ItemPicker({id:`font-family`,multiple:false,selected:{id:fontFamily,text:fontDisplay(fontFamily)},fetchOptions:search=>Promise.resolve(Object.keys(fontFamilies).filter(font=>fontFamilies[font].toLowerCase().includes(search.toLowerCase())).map(font=>({id:font,text:fontDisplay(font)}))),onChange:item=>{onChange({fontFamily:item.id})}})),!supports.fontSize?null:Control({label:__("Font Size","groundhogg")},NumberControl({id:`font-size`,name:`font_size`,className:"font-control control-input",unit:"px",min:0,value:fontSize,onInput:e=>onChange({fontSize:e.target.value})})),!supports.lineHeight?null:Control({label:__("Line Height","groundhogg")},NumberControl({id:`line-height`,name:`line_height`,className:"font-control control-input",value:lineHeight,step:.1,max:10,min:0,onInput:e=>onChange({lineHeight:e.target.value})})),!supports.fontWeight?null:Control({label:__("Font Weight","groundhogg")},Select({id:`font-weight`,name:`font_weight`,className:"font-control control-input",selected:fontWeight,options:fontWeights.map(i=>({value:i,text:i})),onChange:e=>onChange({fontWeight:e.target.value})})),!supports.fontStyle?null:Control({label:__("Font Style","groundhogg")},Select({id:`font-style`,name:`font_style`,className:"font-control control-input",selected:fontStyle,options:{normal:"Normal",italic:"Italic",oblique:"Oblique"},onChange:e=>onChange({fontStyle:e.target.value})})),!supports.textTransform?null:Control({label:__("Transform","groundhogg")},Select({id:`text-transform`,name:`text_transform`,className:"font-control control-input",selected:textTransform,options:{none:"None",capitalize:"Capitalize",uppercase:"Uppercase",lowercase:"Lowercase"},onChange:e=>onChange({textTransform:e.target.value})}))])};const TagFontControlGroup=(name,tag="",style={},updateBlock=()=>{},supports={})=>{let{use="global",color=""}=style;const updateStyle=newStyle=>{style={...getActiveBlock()[tag],...newStyle};updateBlock({[tag]:style})};const DisplayFont=(font,selected,close)=>{return Div({className:`select-font ${selected?"selected":""}`,id:font.id,onClick:e=>{use=font.id;updateStyle({use:use,...font.style});morphControls();close()}},Span({style:{...fillFontStyle(font.style)}},font.name))};return ControlGroup({name:name,id:tag},[Control({label:"Font"},Div({className:"gh-input-group"},[Button({id:`${tag}-use-global`,className:`gh-button small ${GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{MiniModal({selector:`#${tag}-use-global`,dialogClasses:"no-padding"},({close})=>Div({className:"display-flex column global-font-select"},[...GlobalFonts.fonts.map(font=>DisplayFont(font,use===font.id,close))]))}},Dashicon("admin-site")),Button({id:`${tag}-use-custom`,className:`gh-button small ${!GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{updateStyle({use:"custom"});morphControls();MiniModal({dialogClasses:"no-padding",selector:`#${tag}-use-custom`},Div({className:"display-flex column gap-10"},[FontControls(style,style=>{updateStyle(style)},supports)]))}},Dashicon("edit"))])),Control({label:__("Color","groundhogg")},ColorPicker({id:`${tag}-font-color`,value:color,onChange:color=>updateStyle({color:color})}))])};const inlineStyle=(doc,selector,style={},inherit=true)=>{if(inherit){style=fillFontStyle(style)}doc.querySelectorAll(selector).forEach(el=>{for(let attr in style){el.style[attr]=style[attr]}})};const textContent=({content,p,h1,h2,h3,a})=>{if(!content){return""}const parser=new DOMParser;const doc=parser.parseFromString(content,"text/html");inlineStyle(doc,"p",{...p,margin:"1em 0"});inlineStyle(doc,"li",p);inlineStyle(doc,"h1",h1);inlineStyle(doc,"h2",h2);inlineStyle(doc,"h3",h3);inlineStyle(doc,"a",a,false);inlineStyle(doc,"b,strong",{fontWeight:"bold"},false);inlineStyle(doc,"ul",{listStyle:"disc",paddingLeft:"30px"},false);inlineStyle(doc,"ol",{paddingLeft:"30px"},false);if(doc.body.firstElementChild){doc.body.firstElementChild.style.marginTop=0}if(doc.body.lastElementChild){doc.body.lastElementChild.style.marginBottom=0}return Div([],doc.body.childNodes).innerHTML};const LinkPicker=props=>Autocomplete({...props,fetchResults:async search=>{let pages=await ajax({action:"wp-link-ajax",_ajax_linking_nonce:groundhogg_nonces._ajax_linking_nonce,term:search});return pages.map(({title,permalink})=>({id:permalink,text:title}))}});const parseFontStyleFromTag=(el,tag)=>{let styledEl=el.querySelector(tag);if(!styledEl){return BlockRegistry.defaults({type:"text"})[tag]}return parseFontStyle(styledEl.style)};registerBlock("text","Text",{attributes:{p:el=>parseFontStyleFromTag(el,"p "),a:el=>parseFontStyleFromTag(el,"a"),h1:el=>parseFontStyleFromTag(el,"h1"),h2:el=>parseFontStyleFromTag(el,"h2"),h3:el=>parseFontStyleFromTag(el,"h3"),content:el=>{let divWrap=el.querySelector(".text-content-wrap");return divWrap?divWrap.innerHTML:el.innerHTML}},svg:`133 `};const fontDefaults=style=>({lineHeight:"1.4",fontFamily:"system-ui, sans-serif",fontWeight:"normal",fontSize:13,fontStyle:"normal",textTransform:"none",...style});const fontStyle=style=>{return objectToStyle(fillFontStyle(style))};const fillFontStyle=({use="custom",color="",fontFamily="",fontSize=16,...style})=>{if(GlobalFonts.has(use)){let font=GlobalFonts.get(use).style;if(font){return fillFontStyle({...font,color:color})}}return{...fontDefaults(style),color:color,fontSize:`${fontSize}px`,fontFamily:normalizeFont(fontFamily)}};const FontControls=(style={},onChange=style=>{},supports={})=>{supports={fontSize:true,fontFamily:true,fontWeight:true,lineHeight:true,fontStyle:true,textTransform:true,...supports};let{fontSize="14",fontFamily="",fontWeight="normal",fontStyle="normal",textTransform="none",lineHeight="1.4"}=fontDefaults(style);const fontDisplay=font=>Span({style:{fontFamily:font}},fontFamilies[font]);fontFamily=normalizeFont(fontFamily);return Div({className:"font-controls display-flex column gap-10"},[!supports.fontFamily?null:Control({label:__("Font Family","groundhogg"),stacked:true},ItemPicker({id:`font-family`,multiple:false,selected:{id:fontFamily,text:fontDisplay(fontFamily)},fetchOptions:search=>Promise.resolve(Object.keys(fontFamilies).filter(font=>fontFamilies[font].toLowerCase().includes(search.toLowerCase())).map(font=>({id:font,text:fontDisplay(font)}))),onChange:item=>{onChange({fontFamily:item.id})}})),!supports.fontSize?null:Control({label:__("Font Size","groundhogg")},NumberControl({id:`font-size`,name:`font_size`,className:"font-control control-input",unit:"px",min:0,value:fontSize,onInput:e=>onChange({fontSize:e.target.value})})),!supports.lineHeight?null:Control({label:__("Line Height","groundhogg")},NumberControl({id:`line-height`,name:`line_height`,className:"font-control control-input",value:lineHeight,step:.1,max:10,min:0,onInput:e=>onChange({lineHeight:e.target.value})})),!supports.fontWeight?null:Control({label:__("Font Weight","groundhogg")},Select({id:`font-weight`,name:`font_weight`,className:"font-control control-input",selected:fontWeight,options:fontWeights.map(i=>({value:i,text:i})),onChange:e=>onChange({fontWeight:e.target.value})})),!supports.fontStyle?null:Control({label:__("Font Style","groundhogg")},Select({id:`font-style`,name:`font_style`,className:"font-control control-input",selected:fontStyle,options:{normal:"Normal",italic:"Italic",oblique:"Oblique"},onChange:e=>onChange({fontStyle:e.target.value})})),!supports.textTransform?null:Control({label:__("Transform","groundhogg")},Select({id:`text-transform`,name:`text_transform`,className:"font-control control-input",selected:textTransform,options:{none:"None",capitalize:"Capitalize",uppercase:"Uppercase",lowercase:"Lowercase"},onChange:e=>onChange({textTransform:e.target.value})}))])};const TagFontControlGroup=(name,tag="",style={},updateBlock=()=>{},supports={})=>{let{use="global",color=""}=style;const updateStyle=newStyle=>{style={...getActiveBlock()[tag],...newStyle};updateBlock({[tag]:style})};const DisplayFont=(font,selected,close)=>{return Div({className:`select-font ${selected?"selected":""}`,id:font.id,onClick:e=>{use=font.id;updateStyle({use:use,...font.style});morphControls();close()}},Span({style:{...fillFontStyle(font.style)}},font.name))};return ControlGroup({name:name,id:tag},[Control({label:"Font"},Div({className:"gh-input-group"},[Button({id:`${tag}-use-global`,className:`gh-button small ${GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{MiniModal({selector:`#${tag}-use-global`,dialogClasses:"no-padding"},({close})=>Div({className:"display-flex column global-font-select"},[...GlobalFonts.fonts.map(font=>DisplayFont(font,use===font.id,close))]))}},Dashicon("admin-site")),Button({id:`${tag}-use-custom`,className:`gh-button small ${!GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{updateStyle({use:"custom"});morphControls();MiniModal({dialogClasses:"no-padding",selector:`#${tag}-use-custom`},Div({className:"display-flex column gap-10"},[FontControls(style,style=>{updateStyle(style)},supports)]))}},Dashicon("edit"))])),Control({label:__("Color","groundhogg")},ColorPicker({id:`${tag}-font-color`,value:color,onChange:color=>updateStyle({color:color})}))])};const inlineStyle=(doc,selector,style={},inherit=true)=>{if(inherit){style=fillFontStyle(style)}doc.querySelectorAll(selector).forEach(el=>{for(let attr in style){el.style[attr]=style[attr]}})};const textContent=({content,p,h1,h2,h3,a})=>{if(!content){return""}const parser=new DOMParser;const doc=parser.parseFromString(content,"text/html");inlineStyle(doc,"p",{...p,margin:"1em 0"});inlineStyle(doc,"li",p);inlineStyle(doc,"h1",h1);inlineStyle(doc,"h2",h2);inlineStyle(doc,"h3",h3);inlineStyle(doc,"a",a,false);inlineStyle(doc,"b,strong",{fontWeight:"bold"},false);inlineStyle(doc,"ul",{listStyle:"disc",paddingLeft:"30px"},false);inlineStyle(doc,"ol",{paddingLeft:"30px"},false);if(doc.body.firstElementChild){doc.body.firstElementChild.style.marginTop=0}if(doc.body.lastElementChild){doc.body.lastElementChild.style.marginBottom=0}return Div([],doc.body.childNodes).innerHTML};const LinkPicker=props=>Autocomplete({...props,fetchResults:async search=>{let pages=await ajax({action:"wp-link-ajax",_ajax_linking_nonce:groundhogg_nonces._ajax_linking_nonce,term:search});return pages.map(({title,permalink})=>({id:permalink,text:title}))}});const parseFontStyleFromTag=(el,tag)=>{let styledEl=el.querySelector(tag);if(!styledEl){return BlockRegistry.defaults({type:"text"})[tag]}return parseFontStyle(styledEl.style)};registerBlock("text","Text",{attributes:{p:el=>parseFontStyleFromTag(el,"p,li"),a:el=>parseFontStyleFromTag(el,"a"),h1:el=>parseFontStyleFromTag(el,"h1"),h2:el=>parseFontStyleFromTag(el,"h2"),h3:el=>parseFontStyleFromTag(el,"h3"),content:el=>{let divWrap=el.querySelector(".text-content-wrap");return divWrap?divWrap.innerHTML:el.innerHTML}},svg:` 134 134 <svg xmlns="http://www.w3.org/2000/svg" style="enable-background:new 0 0 977.7 977.7" xml:space="preserve" 135 135 viewBox="0 0 977.7 977.7"> -
groundhogg/tags/4.2.6.1/groundhogg.php
r3386122 r3386685 4 4 * Plugin URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 5 5 * Description: CRM and marketing automation for WordPress 6 * Version: 4.2.6 6 * Version: 4.2.6.1 7 7 * Author: Groundhogg Inc. 8 8 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash … … 25 25 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 26 26 27 define( 'GROUNDHOGG_VERSION', '4.2.6 ' );27 define( 'GROUNDHOGG_VERSION', '4.2.6.1' ); 28 28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.5.3' ); 29 29 -
groundhogg/tags/4.2.6.1/includes/extension.php
r3344140 r3386685 622 622 623 623 /* translators: 1: license status (valid/invalid), 2: expiry string */ 624 return sprintf( esc_html__( 'Your license is %1$s and %2$s.', 'groundhogg' ), bold_it( $status ), esc_html( $expires ));624 return sprintf( esc_html__( 'Your license is %1$s and %2$s.', 'groundhogg' ), bold_it( $status ), $expires ); 625 625 } 626 626 -
groundhogg/tags/4.2.6.1/includes/form/form-v2.php
r3386122 r3386685 1912 1912 $button = get_array_var( $config, 'button', [] ); 1913 1913 1914 if ( isset_not_empty( $recaptcha, 'enabled' ) && is_recaptcha_enabled() && get_option( 'gh_recaptcha_version' ) === 'v2') {1914 if ( isset_not_empty( $recaptcha, 'enabled' ) && is_recaptcha_enabled() ) { 1915 1915 $html .= $this->render_field( $recaptcha ); 1916 1916 } -
groundhogg/trunk/README.txt
r3386122 r3386685 7 7 Tested up to: 6.8 8 8 Requires PHP: 7.1 9 Stable tag: 4.2.6 9 Stable tag: 4.2.6.1 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl.md … … 379 379 == Changelog == 380 380 381 = 4.2.6 (2025-10-21) = 381 = 4.2.6.1 (2025-10-29) = 382 * FIXED Recaptcha field missing in rendered form if the recaptcha version is v3 383 * FIXED Font style not parsed correctly from text blocks if no `<p>` tag is present. 384 * FIXED Escaped HTML visible on the licenses page. 385 386 = 4.2.6 (2025-10-28) = 382 387 * ADDED Frequency limits for triggers. 383 388 * ADDED Batch scheduling for adding contacts to flows. -
groundhogg/trunk/assets/js/admin/emails/email-block-editor.js
r3386122 r3386685 7424 7424 registerBlock('text', 'Text', { 7425 7425 attributes: { 7426 p: el => parseFontStyleFromTag(el, 'p '),7426 p: el => parseFontStyleFromTag(el, 'p,li'), 7427 7427 a: el => parseFontStyleFromTag(el, 'a'), 7428 7428 h1: el => parseFontStyleFromTag(el, 'h1'), -
groundhogg/trunk/assets/js/admin/emails/email-block-editor.min.js
r3386122 r3386685 131 131 ${fontStyle(h3)} 132 132 } 133 `};const fontDefaults=style=>({lineHeight:"1.4",fontFamily:"system-ui, sans-serif",fontWeight:"normal",fontSize:13,fontStyle:"normal",textTransform:"none",...style});const fontStyle=style=>{return objectToStyle(fillFontStyle(style))};const fillFontStyle=({use="custom",color="",fontFamily="",fontSize=16,...style})=>{if(GlobalFonts.has(use)){let font=GlobalFonts.get(use).style;if(font){return fillFontStyle({...font,color:color})}}return{...fontDefaults(style),color:color,fontSize:`${fontSize}px`,fontFamily:normalizeFont(fontFamily)}};const FontControls=(style={},onChange=style=>{},supports={})=>{supports={fontSize:true,fontFamily:true,fontWeight:true,lineHeight:true,fontStyle:true,textTransform:true,...supports};let{fontSize="14",fontFamily="",fontWeight="normal",fontStyle="normal",textTransform="none",lineHeight="1.4"}=fontDefaults(style);const fontDisplay=font=>Span({style:{fontFamily:font}},fontFamilies[font]);fontFamily=normalizeFont(fontFamily);return Div({className:"font-controls display-flex column gap-10"},[!supports.fontFamily?null:Control({label:__("Font Family","groundhogg"),stacked:true},ItemPicker({id:`font-family`,multiple:false,selected:{id:fontFamily,text:fontDisplay(fontFamily)},fetchOptions:search=>Promise.resolve(Object.keys(fontFamilies).filter(font=>fontFamilies[font].toLowerCase().includes(search.toLowerCase())).map(font=>({id:font,text:fontDisplay(font)}))),onChange:item=>{onChange({fontFamily:item.id})}})),!supports.fontSize?null:Control({label:__("Font Size","groundhogg")},NumberControl({id:`font-size`,name:`font_size`,className:"font-control control-input",unit:"px",min:0,value:fontSize,onInput:e=>onChange({fontSize:e.target.value})})),!supports.lineHeight?null:Control({label:__("Line Height","groundhogg")},NumberControl({id:`line-height`,name:`line_height`,className:"font-control control-input",value:lineHeight,step:.1,max:10,min:0,onInput:e=>onChange({lineHeight:e.target.value})})),!supports.fontWeight?null:Control({label:__("Font Weight","groundhogg")},Select({id:`font-weight`,name:`font_weight`,className:"font-control control-input",selected:fontWeight,options:fontWeights.map(i=>({value:i,text:i})),onChange:e=>onChange({fontWeight:e.target.value})})),!supports.fontStyle?null:Control({label:__("Font Style","groundhogg")},Select({id:`font-style`,name:`font_style`,className:"font-control control-input",selected:fontStyle,options:{normal:"Normal",italic:"Italic",oblique:"Oblique"},onChange:e=>onChange({fontStyle:e.target.value})})),!supports.textTransform?null:Control({label:__("Transform","groundhogg")},Select({id:`text-transform`,name:`text_transform`,className:"font-control control-input",selected:textTransform,options:{none:"None",capitalize:"Capitalize",uppercase:"Uppercase",lowercase:"Lowercase"},onChange:e=>onChange({textTransform:e.target.value})}))])};const TagFontControlGroup=(name,tag="",style={},updateBlock=()=>{},supports={})=>{let{use="global",color=""}=style;const updateStyle=newStyle=>{style={...getActiveBlock()[tag],...newStyle};updateBlock({[tag]:style})};const DisplayFont=(font,selected,close)=>{return Div({className:`select-font ${selected?"selected":""}`,id:font.id,onClick:e=>{use=font.id;updateStyle({use:use,...font.style});morphControls();close()}},Span({style:{...fillFontStyle(font.style)}},font.name))};return ControlGroup({name:name,id:tag},[Control({label:"Font"},Div({className:"gh-input-group"},[Button({id:`${tag}-use-global`,className:`gh-button small ${GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{MiniModal({selector:`#${tag}-use-global`,dialogClasses:"no-padding"},({close})=>Div({className:"display-flex column global-font-select"},[...GlobalFonts.fonts.map(font=>DisplayFont(font,use===font.id,close))]))}},Dashicon("admin-site")),Button({id:`${tag}-use-custom`,className:`gh-button small ${!GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{updateStyle({use:"custom"});morphControls();MiniModal({dialogClasses:"no-padding",selector:`#${tag}-use-custom`},Div({className:"display-flex column gap-10"},[FontControls(style,style=>{updateStyle(style)},supports)]))}},Dashicon("edit"))])),Control({label:__("Color","groundhogg")},ColorPicker({id:`${tag}-font-color`,value:color,onChange:color=>updateStyle({color:color})}))])};const inlineStyle=(doc,selector,style={},inherit=true)=>{if(inherit){style=fillFontStyle(style)}doc.querySelectorAll(selector).forEach(el=>{for(let attr in style){el.style[attr]=style[attr]}})};const textContent=({content,p,h1,h2,h3,a})=>{if(!content){return""}const parser=new DOMParser;const doc=parser.parseFromString(content,"text/html");inlineStyle(doc,"p",{...p,margin:"1em 0"});inlineStyle(doc,"li",p);inlineStyle(doc,"h1",h1);inlineStyle(doc,"h2",h2);inlineStyle(doc,"h3",h3);inlineStyle(doc,"a",a,false);inlineStyle(doc,"b,strong",{fontWeight:"bold"},false);inlineStyle(doc,"ul",{listStyle:"disc",paddingLeft:"30px"},false);inlineStyle(doc,"ol",{paddingLeft:"30px"},false);if(doc.body.firstElementChild){doc.body.firstElementChild.style.marginTop=0}if(doc.body.lastElementChild){doc.body.lastElementChild.style.marginBottom=0}return Div([],doc.body.childNodes).innerHTML};const LinkPicker=props=>Autocomplete({...props,fetchResults:async search=>{let pages=await ajax({action:"wp-link-ajax",_ajax_linking_nonce:groundhogg_nonces._ajax_linking_nonce,term:search});return pages.map(({title,permalink})=>({id:permalink,text:title}))}});const parseFontStyleFromTag=(el,tag)=>{let styledEl=el.querySelector(tag);if(!styledEl){return BlockRegistry.defaults({type:"text"})[tag]}return parseFontStyle(styledEl.style)};registerBlock("text","Text",{attributes:{p:el=>parseFontStyleFromTag(el,"p "),a:el=>parseFontStyleFromTag(el,"a"),h1:el=>parseFontStyleFromTag(el,"h1"),h2:el=>parseFontStyleFromTag(el,"h2"),h3:el=>parseFontStyleFromTag(el,"h3"),content:el=>{let divWrap=el.querySelector(".text-content-wrap");return divWrap?divWrap.innerHTML:el.innerHTML}},svg:`133 `};const fontDefaults=style=>({lineHeight:"1.4",fontFamily:"system-ui, sans-serif",fontWeight:"normal",fontSize:13,fontStyle:"normal",textTransform:"none",...style});const fontStyle=style=>{return objectToStyle(fillFontStyle(style))};const fillFontStyle=({use="custom",color="",fontFamily="",fontSize=16,...style})=>{if(GlobalFonts.has(use)){let font=GlobalFonts.get(use).style;if(font){return fillFontStyle({...font,color:color})}}return{...fontDefaults(style),color:color,fontSize:`${fontSize}px`,fontFamily:normalizeFont(fontFamily)}};const FontControls=(style={},onChange=style=>{},supports={})=>{supports={fontSize:true,fontFamily:true,fontWeight:true,lineHeight:true,fontStyle:true,textTransform:true,...supports};let{fontSize="14",fontFamily="",fontWeight="normal",fontStyle="normal",textTransform="none",lineHeight="1.4"}=fontDefaults(style);const fontDisplay=font=>Span({style:{fontFamily:font}},fontFamilies[font]);fontFamily=normalizeFont(fontFamily);return Div({className:"font-controls display-flex column gap-10"},[!supports.fontFamily?null:Control({label:__("Font Family","groundhogg"),stacked:true},ItemPicker({id:`font-family`,multiple:false,selected:{id:fontFamily,text:fontDisplay(fontFamily)},fetchOptions:search=>Promise.resolve(Object.keys(fontFamilies).filter(font=>fontFamilies[font].toLowerCase().includes(search.toLowerCase())).map(font=>({id:font,text:fontDisplay(font)}))),onChange:item=>{onChange({fontFamily:item.id})}})),!supports.fontSize?null:Control({label:__("Font Size","groundhogg")},NumberControl({id:`font-size`,name:`font_size`,className:"font-control control-input",unit:"px",min:0,value:fontSize,onInput:e=>onChange({fontSize:e.target.value})})),!supports.lineHeight?null:Control({label:__("Line Height","groundhogg")},NumberControl({id:`line-height`,name:`line_height`,className:"font-control control-input",value:lineHeight,step:.1,max:10,min:0,onInput:e=>onChange({lineHeight:e.target.value})})),!supports.fontWeight?null:Control({label:__("Font Weight","groundhogg")},Select({id:`font-weight`,name:`font_weight`,className:"font-control control-input",selected:fontWeight,options:fontWeights.map(i=>({value:i,text:i})),onChange:e=>onChange({fontWeight:e.target.value})})),!supports.fontStyle?null:Control({label:__("Font Style","groundhogg")},Select({id:`font-style`,name:`font_style`,className:"font-control control-input",selected:fontStyle,options:{normal:"Normal",italic:"Italic",oblique:"Oblique"},onChange:e=>onChange({fontStyle:e.target.value})})),!supports.textTransform?null:Control({label:__("Transform","groundhogg")},Select({id:`text-transform`,name:`text_transform`,className:"font-control control-input",selected:textTransform,options:{none:"None",capitalize:"Capitalize",uppercase:"Uppercase",lowercase:"Lowercase"},onChange:e=>onChange({textTransform:e.target.value})}))])};const TagFontControlGroup=(name,tag="",style={},updateBlock=()=>{},supports={})=>{let{use="global",color=""}=style;const updateStyle=newStyle=>{style={...getActiveBlock()[tag],...newStyle};updateBlock({[tag]:style})};const DisplayFont=(font,selected,close)=>{return Div({className:`select-font ${selected?"selected":""}`,id:font.id,onClick:e=>{use=font.id;updateStyle({use:use,...font.style});morphControls();close()}},Span({style:{...fillFontStyle(font.style)}},font.name))};return ControlGroup({name:name,id:tag},[Control({label:"Font"},Div({className:"gh-input-group"},[Button({id:`${tag}-use-global`,className:`gh-button small ${GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{MiniModal({selector:`#${tag}-use-global`,dialogClasses:"no-padding"},({close})=>Div({className:"display-flex column global-font-select"},[...GlobalFonts.fonts.map(font=>DisplayFont(font,use===font.id,close))]))}},Dashicon("admin-site")),Button({id:`${tag}-use-custom`,className:`gh-button small ${!GlobalFonts.has(use)?"primary":"secondary"}`,onClick:e=>{updateStyle({use:"custom"});morphControls();MiniModal({dialogClasses:"no-padding",selector:`#${tag}-use-custom`},Div({className:"display-flex column gap-10"},[FontControls(style,style=>{updateStyle(style)},supports)]))}},Dashicon("edit"))])),Control({label:__("Color","groundhogg")},ColorPicker({id:`${tag}-font-color`,value:color,onChange:color=>updateStyle({color:color})}))])};const inlineStyle=(doc,selector,style={},inherit=true)=>{if(inherit){style=fillFontStyle(style)}doc.querySelectorAll(selector).forEach(el=>{for(let attr in style){el.style[attr]=style[attr]}})};const textContent=({content,p,h1,h2,h3,a})=>{if(!content){return""}const parser=new DOMParser;const doc=parser.parseFromString(content,"text/html");inlineStyle(doc,"p",{...p,margin:"1em 0"});inlineStyle(doc,"li",p);inlineStyle(doc,"h1",h1);inlineStyle(doc,"h2",h2);inlineStyle(doc,"h3",h3);inlineStyle(doc,"a",a,false);inlineStyle(doc,"b,strong",{fontWeight:"bold"},false);inlineStyle(doc,"ul",{listStyle:"disc",paddingLeft:"30px"},false);inlineStyle(doc,"ol",{paddingLeft:"30px"},false);if(doc.body.firstElementChild){doc.body.firstElementChild.style.marginTop=0}if(doc.body.lastElementChild){doc.body.lastElementChild.style.marginBottom=0}return Div([],doc.body.childNodes).innerHTML};const LinkPicker=props=>Autocomplete({...props,fetchResults:async search=>{let pages=await ajax({action:"wp-link-ajax",_ajax_linking_nonce:groundhogg_nonces._ajax_linking_nonce,term:search});return pages.map(({title,permalink})=>({id:permalink,text:title}))}});const parseFontStyleFromTag=(el,tag)=>{let styledEl=el.querySelector(tag);if(!styledEl){return BlockRegistry.defaults({type:"text"})[tag]}return parseFontStyle(styledEl.style)};registerBlock("text","Text",{attributes:{p:el=>parseFontStyleFromTag(el,"p,li"),a:el=>parseFontStyleFromTag(el,"a"),h1:el=>parseFontStyleFromTag(el,"h1"),h2:el=>parseFontStyleFromTag(el,"h2"),h3:el=>parseFontStyleFromTag(el,"h3"),content:el=>{let divWrap=el.querySelector(".text-content-wrap");return divWrap?divWrap.innerHTML:el.innerHTML}},svg:` 134 134 <svg xmlns="http://www.w3.org/2000/svg" style="enable-background:new 0 0 977.7 977.7" xml:space="preserve" 135 135 viewBox="0 0 977.7 977.7"> -
groundhogg/trunk/groundhogg.php
r3386122 r3386685 4 4 * Plugin URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash 5 5 * Description: CRM and marketing automation for WordPress 6 * Version: 4.2.6 6 * Version: 4.2.6.1 7 7 * Author: Groundhogg Inc. 8 8 * Author URI: https://www.groundhogg.io/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash … … 25 25 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 26 26 27 define( 'GROUNDHOGG_VERSION', '4.2.6 ' );27 define( 'GROUNDHOGG_VERSION', '4.2.6.1' ); 28 28 define( 'GROUNDHOGG_PREVIOUS_STABLE_VERSION', '4.2.5.3' ); 29 29 -
groundhogg/trunk/includes/extension.php
r3344140 r3386685 622 622 623 623 /* translators: 1: license status (valid/invalid), 2: expiry string */ 624 return sprintf( esc_html__( 'Your license is %1$s and %2$s.', 'groundhogg' ), bold_it( $status ), esc_html( $expires ));624 return sprintf( esc_html__( 'Your license is %1$s and %2$s.', 'groundhogg' ), bold_it( $status ), $expires ); 625 625 } 626 626 -
groundhogg/trunk/includes/form/form-v2.php
r3386122 r3386685 1912 1912 $button = get_array_var( $config, 'button', [] ); 1913 1913 1914 if ( isset_not_empty( $recaptcha, 'enabled' ) && is_recaptcha_enabled() && get_option( 'gh_recaptcha_version' ) === 'v2') {1914 if ( isset_not_empty( $recaptcha, 'enabled' ) && is_recaptcha_enabled() ) { 1915 1915 $html .= $this->render_field( $recaptcha ); 1916 1916 }
Note: See TracChangeset
for help on using the changeset viewer.