PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / trunk
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler vtrunk
1.6.6 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 All 49 releases
fluent-cart / assets / ProductReviewFormBlockEditor.js

ProductReviewFormBlockEditor.js in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler trunk, at assets/ProductReviewFormBlockEditor.js

2 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{j as e}from"./chunks/jsx-runtime.js?ver=1.7.0";import{b as n}from"./chunks/BlockEditorTranslator.js?ver=1.7.0";import{E as d}from"./chunks/EditorPanel.js?ver=1.7.0";import{E as u}from"./chunks/EditorPanelRow.js?ver=1.7.0";import{R as m,u as f,a as y}from"./chunks/reviewBlockShared.js?ver=1.7.0";import{R as w}from"./chunks/Icons.js?ver=1.7.0";import"./chunks/SelectProductModal.js?ver=1.7.0";import"./chunks/index6.js?ver=1.7.0";import"./chunks/ProductListItem.js?ver=1.7.0";import"./chunks/index5.js?ver=1.7.0";import"./chunks/add-query-args.js?ver=1.7.0";import"./chunks/SingleProductContext.js?ver=1.7.0";const{InspectorControls:h}=wp.blockEditor,{SelectControl:v}=wp.components,g=({attributes:t,setAttributes:l,selectedProduct:s,setSelectedProduct:c,insideParent:o})=>e.jsx(h,{children:e.jsx("div",{className:"fct-inspector-control-wrap fct-inspector-control-wrap--product-card fct-inspector-control-wrap--review-form",children:e.jsx("div",{className:"fct-inspector-control-group",children:e.jsxs("div",{className:"fct-inspector-control-body",children:[!o&&e.jsx(m,{attributes:t,setAttributes:l,selectedProduct:s,setSelectedProduct:c}),e.jsx(d,{title:n("Form Settings"),children:e.jsx(u,{className:"flex-col",children:e.jsx(v,{label:n("Field Layout"),help:n("Steps walks the reviewer through rating, details and photos. Inline shows every field at once."),value:t.layout,options:[{label:n("Inline (all fields at once)"),value:"inline"},{label:n("Steps (one at a time)"),value:"steps"}],onChange:r=>l({layout:r})})})})]})})})}),{useBlockProps:x}=wp.blockEditor,{registerBlockType:_}=wp.blocks,{useEffect:j}=wp.element,k=wp.serverSideRender,i=window.fluent_cart_product_review_form_data;_(i.slug+"/"+i.name,{apiVersion:3,title:i.title,description:i.description,icon:{src:w},category:"fluent-cart",attributes:{query_type:{type:"string",default:"default"},product_id:{type:["string","number"],default:""},layout:{type:"string",default:"inline"},starColor:{type:"string",default:"#f59e0b"}},edit:({attributes:t,setAttributes:l,clientId:s})=>{const c=x({className:"fct-review-form-block-editor"}),o=f(s),{selectedProduct:r,setSelectedProduct:a}=y(t,o),p=r!=null&&r.ID?{...t,query_type:"custom",product_id:r.ID}:t;return j(()=>{o&&t.query_type!=="default"&&l({query_type:"default"})},[o,t.query_type]),e.jsxs("div",{...c,children:[e.jsx(g,{attributes:t,setAttributes:l,selectedProduct:r,setSelectedProduct:a,insideParent:o}),e.jsx(k,{block:i.slug+"/"+i.name,attributes:p,EmptyResponsePlaceholder:()=>e.jsx("div",{className:"fct-review-form-block-editor-hint",children:n("Reviews will be displayed for the current product")})})]})},save:function(){return null},supports:{html:!1,align:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalDefaultControls:{fontSize:!0}},color:{text:!0,background:!0},spacing:{margin:!0,padding:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0}}});
2