PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | assets/MiniCartBlockEditor.js +1 -1 1.3.20 → 1.6.5 View file →
@@ -1 +1 @@
1 -import{b as e,j as o}from"./chunks/BlockEditorTranslator.js?ver=1.3.20";import"./chunks/index5.js?ver=1.3.20";import"./chunks/SingleProductContext.js?ver=1.3.20";import{p,u as m,v as f}from"./chunks/Icons.js?ver=1.3.20";const{InspectorControls:h,PanelColorSettings:W,__experimentalColorGradientSettingsDropdown:b,__experimentalUseMultipleOriginColorsAndGradients:v}=wp.blockEditor,{PanelBody:S,CheckboxControl:$,RadioControl:k,ToggleControl:T,BaseControl:_,TextControl:G,__experimentalToggleGroupControl:E,__experimentalToggleGroupControlOption:B}=wp.components,{useState:z}=wp.element,N=E,i=B,O=b,I=v,P=({attributes:n,setAttributes:l,clientId:a})=>{const c=[{label:e("Icon","fluent-cart"),colorValue:n.icon_color,onColorChange:t=>l({icon_color:t})}];n.show_total_price&&c.push({label:e("Price","fluent-cart"),colorValue:n.price_color,onColorChange:t=>l({price_color:t})}),n.show_item_count!=="never"&&c.push({label:e("Product Count","fluent-cart"),colorValue:n.product_count_color,onColorChange:t=>l({product_count_color:t})});const s=I();return o.jsxs(o.Fragment,{children:[o.jsx(h,{group:"color",children:o.jsx(O,{panelId:a,settings:c,...s})}),o.jsx(h,{children:o.jsxs(S,{title:e("Settings","fluent-cart"),initialOpen:!0,children:[o.jsxs(N,{className:"fct-mini-cart-inspector-controls",isBlock:!0,label:e("Cart Icon","fluent-cart"),value:n.cart_icon,onChange:t=>l({cart_icon:t}),children:[o.jsx(i,{value:"cart",label:o.jsx(p,{})}),o.jsx(i,{value:"bag",label:o.jsx(m,{})}),o.jsx(i,{value:"bag-alt",label:o.jsx(f,{})})]}),o.jsx(G,{label:e("Or use custom icon URL","fluent-cart"),help:e("Leave empty to use the selected icon above. Enter a URL to override with a custom icon.","fluent-cart"),value:["cart","bag","bag-alt"].includes(n.cart_icon)?"":n.cart_icon,onChange:t=>l({cart_icon:t||"cart"}),placeholder:"https://example.com/icon.svg",type:"url"}),o.jsx(_,{label:e("Display options","fluent-cart"),children:o.jsx(T,{label:e("Display total price","fluent-cart"),help:e("Toggle to display the total price of the cart.","fluent-cart"),checked:n.show_total_price,onChange:t=>l({show_total_price:t})})}),o.jsx(_,{label:e("Show cart item count","fluent-cart"),help:e("The editor does not display the real count value, but a placeholder to indicate how it will look on the front-end.","fluent-cart"),children:o.jsx(k,{selected:n.show_item_count,options:[{label:e("Always (even if empty)","fluent-cart"),value:"always"},{label:e("Only if cart has items","fluent-cart"),value:"has_items"},{label:e("Never","fluent-cart"),value:"never"}],onChange:t=>l({show_item_count:t})})})]})})]})},{useBlockProps:R,RichText:H}=wp.blockEditor,{registerBlockType:D}=wp.blocks,{useEffect:q,useState:J}=wp.element,{useSelect:K}=wp.data,{store:Q}=wp.blockEditor,r=window.fluent_cart_mini_cart_data,V=window.fluentCartRestVars.rest;V.url+"";D(r.slug+"/"+r.name,{apiVersion:3,title:r.title,description:r.description,icon:{src:p},category:"fluent-cart",attributes:{cart_icon:{type:"string",default:"cart"},show_total_price:{type:"boolean",default:!0},show_item_count:{type:"string",default:"has_items"},icon_color:{type:"string",default:""},price_color:{type:"string",default:""},product_count_color:{type:"string",default:""}},supports:{html:!1,alignWide:!1,typography:{fontSize:!0,fontFamily:!0,fontWeight:!0,lineHeight:!0},spacing:{margin:!0,padding:!0},reusable:!1,shadow:!1},edit:({attributes:n,setAttributes:l,clientId:a})=>{const{cart_icon:c,show_total_price:s,show_item_count:t,icon_color:u,price_color:d,product_count_color:g}=n,x=R(),w=u?{color:u}:{},C=d?{color:d}:{},j=g?{backgroundColor:g}:{},y=c&&!["cart","bag","bag-alt"].includes(c);return o.jsxs("div",{...x,children:[o.jsx(P,{attributes:n,setAttributes:l,clientId:a}),o.jsxs("button",{className:"fct-mini-cart-button",children:[o.jsxs("span",{className:"fct-mini-cart-wrap",style:w,children:[y?o.jsx("img",{src:c,alt:"Mini cart icon",className:"fct-mini-cart-custom-icon",style:{width:"20px",height:"20px",objectFit:"contain"}}):c==="cart"?o.jsx(p,{}):c==="bag"?o.jsx(m,{}):o.jsx(f,{}),t!=="never"&&o.jsx("span",{className:"fct-mini-cart-badge",style:j,children:"0"})]}),s&&o.jsx("span",{className:"fct-mini-cart-amount",style:C,children:"$0.00"})]})]})},save:function(n){return null}});
1 +import{j as o}from"./chunks/jsx-runtime.js?ver=1.6.5";import"./chunks/index5.js?ver=1.6.5";import"./chunks/SingleProductContext.js?ver=1.6.5";import{p as u,u as f,v as x}from"./chunks/Icons.js?ver=1.6.5";import{b as t}from"./chunks/BlockEditorTranslator.js?ver=1.6.5";const{InspectorControls:_,PanelColorSettings:W,__experimentalColorGradientSettingsDropdown:v,__experimentalUseMultipleOriginColorsAndGradients:S}=wp.blockEditor,{PanelBody:k,CheckboxControl:$,RadioControl:m,ToggleControl:T,BaseControl:i,TextControl:G,__experimentalToggleGroupControl:B,__experimentalToggleGroupControlOption:E}=wp.components,{useState:z}=wp.element,N=B,p=E,O=v,I=S,P=({attributes:n,setAttributes:l,clientId:a})=>{const c=[{label:t("Icon","fluent-cart"),colorValue:n.icon_color,onColorChange:e=>l({icon_color:e})}];n.show_total_price&&c.push({label:t("Price","fluent-cart"),colorValue:n.price_color,onColorChange:e=>l({price_color:e})}),n.show_item_count!=="never"&&c.push({label:t("Product Count","fluent-cart"),colorValue:n.product_count_color,onColorChange:e=>l({product_count_color:e})});const s=I();return o.jsxs(o.Fragment,{children:[o.jsx(_,{group:"color",children:o.jsx(O,{panelId:a,settings:c,...s})}),o.jsx(_,{children:o.jsxs(k,{title:t("Settings","fluent-cart"),initialOpen:!0,children:[o.jsxs(N,{className:"fct-mini-cart-inspector-controls",isBlock:!0,label:t("Cart Icon","fluent-cart"),value:n.cart_icon,onChange:e=>l({cart_icon:e}),children:[o.jsx(p,{value:"cart",label:o.jsx(u,{})}),o.jsx(p,{value:"bag",label:o.jsx(f,{})}),o.jsx(p,{value:"bag-alt",label:o.jsx(x,{})})]}),o.jsx(G,{label:t("Or use custom icon URL","fluent-cart"),help:t("Leave empty to use the selected icon above. Enter a URL to override with a custom icon.","fluent-cart"),value:["cart","bag","bag-alt"].includes(n.cart_icon)?"":n.cart_icon,onChange:e=>l({cart_icon:e||"cart"}),placeholder:"https://example.com/icon.svg",type:"url"}),o.jsx(i,{label:t("Display options","fluent-cart"),children:o.jsx(T,{label:t("Display total price","fluent-cart"),help:t("Toggle to display the total price of the cart.","fluent-cart"),checked:n.show_total_price,onChange:e=>l({show_total_price:e})})}),o.jsx(i,{label:t("Show cart item count","fluent-cart"),help:t("The editor does not display the real count value, but a placeholder to indicate how it will look on the front-end.","fluent-cart"),children:o.jsx(m,{selected:n.show_item_count,options:[{label:t("Always (even if empty)","fluent-cart"),value:"always"},{label:t("Only if cart has items","fluent-cart"),value:"has_items"},{label:t("Never","fluent-cart"),value:"never"}],onChange:e=>l({show_item_count:e})})}),n.show_item_count!=="never"&&o.jsx(i,{label:t("Badge count shows","fluent-cart"),children:o.jsx(m,{selected:n.count_mode,options:[{label:t("Count distinct products","fluent-cart"),value:"distinct_products"},{label:t("Count total item quantity","fluent-cart"),value:"total_quantity"}],onChange:e=>l({count_mode:e})})})]})})]})},{useBlockProps:R,RichText:H}=wp.blockEditor,{registerBlockType:D}=wp.blocks,{useEffect:J,useState:K}=wp.element,{useSelect:Q}=wp.data,{store:X}=wp.blockEditor,r=window.fluent_cart_mini_cart_data,V=window.fluentCartRestVars.rest;V.url+"";D(r.slug+"/"+r.name,{apiVersion:3,title:r.title,description:r.description,icon:{src:u},category:"fluent-cart",attributes:{cart_icon:{type:"string",default:"cart"},show_total_price:{type:"boolean",default:!0},show_item_count:{type:"string",default:"has_items"},icon_color:{type:"string",default:""},price_color:{type:"string",default:""},product_count_color:{type:"string",default:""},count_mode:{type:"string",default:"distinct_products"}},supports:{html:!1,alignWide:!1,typography:{fontSize:!0,fontFamily:!0,fontWeight:!0,lineHeight:!0},spacing:{margin:!0,padding:!0},reusable:!1,shadow:!1},edit:({attributes:n,setAttributes:l,clientId:a})=>{const{cart_icon:c,show_total_price:s,show_item_count:e,icon_color:d,price_color:h,product_count_color:g}=n,C=R(),w=d?{color:d}:{},j=h?{color:h}:{},y=g?{backgroundColor:g}:{},b=c&&!["cart","bag","bag-alt"].includes(c);return o.jsxs("div",{...C,children:[o.jsx(P,{attributes:n,setAttributes:l,clientId:a}),o.jsxs("button",{className:"fct-mini-cart-button",children:[o.jsxs("span",{className:"fct-mini-cart-wrap",style:w,children:[b?o.jsx("img",{src:c,alt:"Mini cart icon",className:"fct-mini-cart-custom-icon",style:{width:"20px",height:"20px",objectFit:"contain"}}):c==="cart"?o.jsx(u,{}):c==="bag"?o.jsx(f,{}):o.jsx(x,{}),e!=="never"&&o.jsx("span",{className:"fct-mini-cart-badge",style:y,children:"0"})]}),s&&o.jsx("span",{className:"fct-mini-cart-amount",style:j,children:"$0.00"})]})]})},save:function(n){return null}});