Plugin Directory

Changeset 3416450


Ignore:
Timestamp:
12/10/2025 01:19:50 PM (4 months ago)
Author:
nakedcatplugins
Message:

Update to version 6.8 from GitHub

Location:
shop-as-client
Files:
16 added
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shop-as-client/tags/6.8/build/ptwoo-shop-as-client-block-frontend.asset.php

    r3272290 r3416450  
    1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '414fd39c69d05d9efd62');
     1<?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '4da1a643e53ef42e6c9a');
  • shop-as-client/tags/6.8/build/ptwoo-shop-as-client-block-frontend.js

    r3272290 r3416450  
    1 (()=>{var e={942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=a(e,s(o)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=a(t,o));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var c=t[n];if(void 0!==c)return c.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wc.blocksCheckout,t=window.React;var n=o(942),c=o.n(n);const s=window.wp.i18n,a=window.wp.element,r=window.wp.data,l=window.wp.components,i=window.wp.hooks,p=window.wc.blocksComponents,u=window.wc.wcSettings,m=window.wc.wcBlocksData,d={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,s.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}},w=({title:e,stepHeadingContent:o})=>(0,t.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,t.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!o&&(0,t.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},o)),h=({title:e="",description:o="",showStepNumber:n=!0,className:s="",children:a,stepHeadingContent:r=(()=>{}),blockPosition:l=""})=>{const i=e?"fieldset":"div";return(0,t.createElement)(i,{className:c()(s,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":n}),"data-position":l},e&&(0,t.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,t.createElement)(w,{title:e,stepHeadingContent:r()}),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__container"},o&&(0,t.createElement)("p",{className:"wc-block-components-checkout-step__description"},o),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__content"},a)))},b="ptwoo-shop-as-client",{canCheckout:f,defaultShopAsClient:k,defaultCreateUser:_,showProAddOnNotice:v,blockPosition:y}=(0,u.getSetting)("ptwoo_shop_as_client_data"),C=(g=d,e=>o=>{const n=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(g,o);return(0,t.createElement)(e,{...o,...n})})((o=>{const{stepTitle:n,stepDescription:u,showStepNumber:d,className:w,inEditor:C}=o,[g,E]=(0,a.useState)(k),[N,S]=(0,a.useState)(_),{__internalIncrementCalculating:O,__internalDecrementCalculating:x}=(0,r.useDispatch)(m.CHECKOUT_STORE_KEY);if((0,a.useEffect)((()=>(f&&(0,e.extensionCartUpdate)({namespace:b,data:{resetCustomerData:!0}}),()=>{})),[f]),(0,a.useEffect)((()=>{f&&(O(),(0,e.extensionCartUpdate)({namespace:b,data:{shopAsClient:g,createUser:N},cartPropsToReceive:["extensions"]}).then((()=>{x()})))}),[f,e.extensionCartUpdate,g,N,O,x]),!f)return null;const P=(0,i.applyFilters)("shopAsClient.AddOns",null,{...o,canCheckout:f,shopAsClient:g,createUser:N});let D=(0,t.createElement)("div",{className:w},(0,t.createElement)(p.CheckboxControl,{label:(0,s.__)("Shop as client","shop-as-client"),checked:g,onChange:e=>{E(e),!1===e&&S(!1)}}),P,g&&(0,t.createElement)(p.CheckboxControl,{label:(0,s.__)("Create user (if not found by email)?","shop-as-client"),checked:N,onChange:S}),v&&(0,t.createElement)("div",{className:"wc-block-components-notices"},(0,a.createInterpolateElement)(sprintf("<a>%s<br/>%s</a>",(0,s.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,s.__)("Get the PRO add-on!","shop-as-client")),{a:(0,t.createElement)(l.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,t.createElement)("br",null)})));return C||(D=(0,t.createElement)(h,{title:n,description:u,showStepNumber:d,className:c()("wp-block-woocommerce-ptwoo-shop-as-client-block",w),blockPosition:y},D)),D}));var g;const E=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}');(0,e.registerCheckoutBlock)({metadata:E,component:C}),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".wp-block-woocommerce-checkout");if(!e)return;const t=()=>{const e=document.querySelector(".wp-block-woocommerce-ptwoo-shop-as-client-block");if(e){const t=document.querySelector(".wp-block-woocommerce-checkout-actions-block"),n=document.querySelector(e.dataset.position);e&&t&&n&&t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&(n.parentNode.insertBefore(e,n),o.disconnect())}},o=new MutationObserver(((e,o)=>{for(const o of e)"childList"===o.type&&t()}));o.observe(e,{childList:!0,subtree:!0})}))})()})();
     1(()=>{var e,t={553:(e,t,o)=>{"use strict";const n=window.wc.blocksCheckout,c=window.React;var a=o(942),s=o.n(a);const r=window.wp.i18n,l=window.wp.element,i=window.wp.data,p=window.wp.components,u=window.wp.hooks,m=window.wc.blocksComponents,d=window.wc.wcSettings,h=window.wc.wcBlocksData,w={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,r.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}},b=({title:e,stepHeadingContent:t})=>(0,c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,c.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!t&&(0,c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),f=({title:e="",description:t="",showStepNumber:o=!0,className:n="",children:a,stepHeadingContent:r=(()=>{}),blockPosition:l=""})=>{const i=e?"fieldset":"div";return(0,c.createElement)(i,{className:s()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":o}),"data-position":l},e&&(0,c.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,c.createElement)(b,{title:e,stepHeadingContent:r()}),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__container"},t&&(0,c.createElement)("p",{className:"wc-block-components-checkout-step__description"},t),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__content"},a)))},k="ptwoo-shop-as-client",{canCheckout:v,defaultShopAsClient:_,defaultCreateUser:g,showProAddOnNotice:y,blockPosition:C}=(0,d.getSetting)("ptwoo_shop_as_client_data"),E=(O=w,e=>t=>{const o=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(O,t);return(0,c.createElement)(e,{...t,...o})})((e=>{const{stepTitle:t,stepDescription:o,showStepNumber:a,className:d,inEditor:w}=e,[b,E]=(0,l.useState)(_),[O,N]=(0,l.useState)(g),{__internalIncrementCalculating:S,__internalDecrementCalculating:x}=(0,i.useDispatch)(h.CHECKOUT_STORE_KEY);if((0,l.useEffect)((()=>(v&&(0,n.extensionCartUpdate)({namespace:k,data:{resetCustomerData:!0}}),()=>{})),[v]),(0,l.useEffect)((()=>{v&&(S(),(0,n.extensionCartUpdate)({namespace:k,data:{shopAsClient:b,createUser:O},cartPropsToReceive:["extensions"]}).then((()=>{x()})))}),[v,n.extensionCartUpdate,b,O,S,x]),!v)return null;const P=(0,u.applyFilters)("shopAsClient.AddOns",null,{...e,canCheckout:v,shopAsClient:b,createUser:O});let j=(0,c.createElement)("div",{className:d},(0,c.createElement)(m.CheckboxControl,{label:(0,r.__)("Shop as client","shop-as-client"),checked:b,onChange:e=>{E(e),!1===e&&N(!1)}}),P,b&&(0,c.createElement)(m.CheckboxControl,{label:(0,r.__)("Create user (if not found by email)?","shop-as-client"),checked:O,onChange:N}),y&&(0,c.createElement)("div",{className:"wc-block-components-notices"},(0,l.createInterpolateElement)((0,r.sprintf)("<a>%s<br/>%s</a>",(0,r.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,r.__)("Get the PRO add-on!","shop-as-client")),{a:(0,c.createElement)(p.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,c.createElement)("br",null)})));return w||(j=(0,c.createElement)(f,{title:t,description:o,showStepNumber:a,className:s()("wp-block-woocommerce-ptwoo-shop-as-client-block",d),blockPosition:C},j)),j}));var O;const N=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}');(0,n.registerCheckoutBlock)({metadata:N,component:E}),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".wp-block-woocommerce-checkout");if(!e)return;const t=()=>{const e=document.querySelector(".wp-block-woocommerce-ptwoo-shop-as-client-block");if(e){const t=document.querySelector(".wp-block-woocommerce-checkout-actions-block"),n=document.querySelector(e.dataset.position);e&&t&&n&&t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&(n.parentNode.insertBefore(e,n),o.disconnect())}},o=new MutationObserver(((e,o)=>{for(const o of e)"childList"===o.type&&t()}));o.observe(e,{childList:!0,subtree:!0})}))},942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=s(e,a(o)))}return e}function a(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=s(t,o));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},o={};function n(e){var c=o[e];if(void 0!==c)return c.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,e=[],n.O=(t,o,c,a)=>{if(!o){var s=1/0;for(p=0;p<e.length;p++){for(var[o,c,a]=e[p],r=!0,l=0;l<o.length;l++)(!1&a||s>=a)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(r=!1,a<s&&(s=a));if(r){e.splice(p--,1);var i=c();void 0!==i&&(t=i)}}return t}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[o,c,a]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={39:0,731:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var c,a,[s,r,l]=o,i=0;if(s.some((t=>0!==e[t]))){for(c in r)n.o(r,c)&&(n.m[c]=r[c]);if(l)var p=l(n)}for(t&&t(o);i<s.length;i++)a=s[i],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return n.O(p)},o=globalThis.webpackChunkwoocommerce_shop_as_client=globalThis.webpackChunkwoocommerce_shop_as_client||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=n.O(void 0,[731],(()=>n(553)));c=n.O(c)})();
  • shop-as-client/tags/6.8/build/ptwoo-shop-as-client-block.asset.php

    r3272290 r3416450  
    1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '423a5cbe091bee8ca85f');
     1<?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f228402745e5f86f406b');
  • shop-as-client/tags/6.8/build/ptwoo-shop-as-client-block.js

    r3272290 r3416450  
    1 (()=>{var e={942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=a(e,s(o)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=a(t,o));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var c=t[n];if(void 0!==c)return c.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.React,n=window.wp.primitives,c=(0,t.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(n.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),s=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}'),a=window.wp.i18n,r={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,a.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}};var l=o(942),i=o.n(l);const p=window.wp.blockEditor,m=window.wp.components,u=window.wp.element,d=window.wp.data,h=window.wp.hooks,w=window.wc.blocksComponents,b=window.wc.wcSettings,k=window.wc.blocksCheckout,f=window.wc.wcBlocksData,_=({title:e,stepHeadingContent:o})=>(0,t.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,t.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!o&&(0,t.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},o)),E=({title:e="",description:o="",showStepNumber:n=!0,className:c="",children:s,stepHeadingContent:a=(()=>{}),blockPosition:r=""})=>{const l=e?"fieldset":"div";return(0,t.createElement)(l,{className:i()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":n}),"data-position":r},e&&(0,t.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,t.createElement)(_,{title:e,stepHeadingContent:a()}),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__container"},o&&(0,t.createElement)("p",{className:"wc-block-components-checkout-step__description"},o),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__content"},s)))},v="ptwoo-shop-as-client",{canCheckout:g,defaultShopAsClient:C,defaultCreateUser:N,showProAddOnNotice:y,blockPosition:S}=(0,b.getSetting)("ptwoo_shop_as_client_data"),x=(O=r,e=>o=>{const n=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(O,o);return(0,t.createElement)(e,{...o,...n})})((e=>{const{stepTitle:o,stepDescription:n,showStepNumber:c,className:s,inEditor:r}=e,[l,p]=(0,u.useState)(C),[b,_]=(0,u.useState)(N),{__internalIncrementCalculating:x,__internalDecrementCalculating:O}=(0,d.useDispatch)(f.CHECKOUT_STORE_KEY);if((0,u.useEffect)((()=>(g&&(0,k.extensionCartUpdate)({namespace:v,data:{resetCustomerData:!0}}),()=>{})),[g]),(0,u.useEffect)((()=>{g&&(x(),(0,k.extensionCartUpdate)({namespace:v,data:{shopAsClient:l,createUser:b},cartPropsToReceive:["extensions"]}).then((()=>{O()})))}),[g,k.extensionCartUpdate,l,b,x,O]),!g)return null;const A=(0,h.applyFilters)("shopAsClient.AddOns",null,{...e,canCheckout:g,shopAsClient:l,createUser:b});let P=(0,t.createElement)("div",{className:s},(0,t.createElement)(w.CheckboxControl,{label:(0,a.__)("Shop as client","shop-as-client"),checked:l,onChange:e=>{p(e),!1===e&&_(!1)}}),A,l&&(0,t.createElement)(w.CheckboxControl,{label:(0,a.__)("Create user (if not found by email)?","shop-as-client"),checked:b,onChange:_}),y&&(0,t.createElement)("div",{className:"wc-block-components-notices"},(0,u.createInterpolateElement)(sprintf("<a>%s<br/>%s</a>",(0,a.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,a.__)("Get the PRO add-on!","shop-as-client")),{a:(0,t.createElement)(m.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,t.createElement)("br",null)})));return r||(P=(0,t.createElement)(E,{title:o,description:n,showStepNumber:c,className:i()("wp-block-woocommerce-ptwoo-shop-as-client-block",s),blockPosition:S},P)),P}));var O;const A=({children:e,stepHeadingContent:o})=>(0,t.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,t.createElement)(w.Title,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},e),!!o&&(0,t.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},o)),P=({attributes:e,setAttributes:o,className:n="",children:c})=>{const{stepTitle:s,stepDescription:r,showStepNumber:l}=e;return(0,t.createElement)("div",{className:i()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":l})},(0,t.createElement)(A,null,(0,t.createElement)(p.PlainText,{value:s,onChange:e=>o({stepTitle:e}),style:{backgroundColor:"transparent"}})),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__container"},(0,t.createElement)("p",{className:"wc-block-components-checkout-step__description"},(0,t.createElement)(p.PlainText,{className:r?"":"wc-block-components-checkout-step__description-placeholder",value:r,placeholder:(0,a.__)("Optional text for this form step.","shop-as-client"),onChange:e=>o({stepDescription:e}),style:{backgroundColor:"transparent"}})),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__content"},c)))};(0,e.registerBlockType)({...s,attributes:{...r}},{icon:c,edit:function({attributes:e,setAttributes:o}){const{showStepNumber:n,className:c=""}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(p.InspectorControls,null,(0,t.createElement)(m.PanelBody,{title:(0,a.__)("Form Step Options","shop-as-client")},(0,t.createElement)(m.ToggleControl,{label:(0,a.__)("Show step number","shop-as-client"),checked:n,onChange:()=>o({showStepNumber:!n})}))),(0,t.createElement)(P,{setAttributes:o,attributes:e,className:i()("wp-block-woocommerce-ptwoo-shop-as-client-block",c)},(0,t.createElement)("div",{"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal"}},(0,t.createElement)(x,{inEditor:!0}))))},save:function({attributes:e}){const{text:o}=e;return(0,t.createElement)("div",{...p.useBlockProps.save()},(0,t.createElement)(p.RichText.Content,{value:o}))}})})()})();
     1(()=>{var e,t={432:(e,t,o)=>{"use strict";const n=window.wp.blocks,c=window.React,s=window.wp.primitives,a=(0,c.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(s.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),r=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}'),l=window.wp.i18n,i={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,l.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}};var p=o(942),m=o.n(p);const u=window.wp.blockEditor,d=window.wp.components,h=window.wp.element,w=window.wp.data,b=window.wp.hooks,k=window.wc.blocksComponents,f=window.wc.wcSettings,v=window.wc.blocksCheckout,_=window.wc.wcBlocksData,E=({title:e,stepHeadingContent:t})=>(0,c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,c.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!t&&(0,c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),g=({title:e="",description:t="",showStepNumber:o=!0,className:n="",children:s,stepHeadingContent:a=(()=>{}),blockPosition:r=""})=>{const l=e?"fieldset":"div";return(0,c.createElement)(l,{className:m()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":o}),"data-position":r},e&&(0,c.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,c.createElement)(E,{title:e,stepHeadingContent:a()}),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__container"},t&&(0,c.createElement)("p",{className:"wc-block-components-checkout-step__description"},t),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__content"},s)))},C="ptwoo-shop-as-client",{canCheckout:N,defaultShopAsClient:y,defaultCreateUser:S,showProAddOnNotice:x,blockPosition:O}=(0,f.getSetting)("ptwoo_shop_as_client_data"),T=(A=i,e=>t=>{const o=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(A,t);return(0,c.createElement)(e,{...t,...o})})((e=>{const{stepTitle:t,stepDescription:o,showStepNumber:n,className:s,inEditor:a}=e,[r,i]=(0,h.useState)(y),[p,u]=(0,h.useState)(S),{__internalIncrementCalculating:f,__internalDecrementCalculating:E}=(0,w.useDispatch)(_.CHECKOUT_STORE_KEY);if((0,h.useEffect)((()=>(N&&(0,v.extensionCartUpdate)({namespace:C,data:{resetCustomerData:!0}}),()=>{})),[N]),(0,h.useEffect)((()=>{N&&(f(),(0,v.extensionCartUpdate)({namespace:C,data:{shopAsClient:r,createUser:p},cartPropsToReceive:["extensions"]}).then((()=>{E()})))}),[N,v.extensionCartUpdate,r,p,f,E]),!N)return null;const T=(0,b.applyFilters)("shopAsClient.AddOns",null,{...e,canCheckout:N,shopAsClient:r,createUser:p});let A=(0,c.createElement)("div",{className:s},(0,c.createElement)(k.CheckboxControl,{label:(0,l.__)("Shop as client","shop-as-client"),checked:r,onChange:e=>{i(e),!1===e&&u(!1)}}),T,r&&(0,c.createElement)(k.CheckboxControl,{label:(0,l.__)("Create user (if not found by email)?","shop-as-client"),checked:p,onChange:u}),x&&(0,c.createElement)("div",{className:"wc-block-components-notices"},(0,h.createInterpolateElement)((0,l.sprintf)("<a>%s<br/>%s</a>",(0,l.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,l.__)("Get the PRO add-on!","shop-as-client")),{a:(0,c.createElement)(d.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,c.createElement)("br",null)})));return a||(A=(0,c.createElement)(g,{title:t,description:o,showStepNumber:n,className:m()("wp-block-woocommerce-ptwoo-shop-as-client-block",s),blockPosition:O},A)),A}));var A;const P=({children:e,stepHeadingContent:t})=>(0,c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,c.createElement)(k.Title,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},e),!!t&&(0,c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),j=({attributes:e,setAttributes:t,className:o="",children:n})=>{const{stepTitle:s,stepDescription:a,showStepNumber:r}=e;return(0,c.createElement)("div",{className:m()(o,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":r})},(0,c.createElement)(P,null,(0,c.createElement)(u.PlainText,{value:s,onChange:e=>t({stepTitle:e}),style:{backgroundColor:"transparent"}})),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__container"},(0,c.createElement)("p",{className:"wc-block-components-checkout-step__description"},(0,c.createElement)(u.PlainText,{className:a?"":"wc-block-components-checkout-step__description-placeholder",value:a,placeholder:(0,l.__)("Optional text for this form step.","shop-as-client"),onChange:e=>t({stepDescription:e}),style:{backgroundColor:"transparent"}})),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__content"},n)))};(0,n.registerBlockType)({...r,attributes:{...i}},{icon:a,edit:function({attributes:e,setAttributes:t}){const{showStepNumber:o,className:n=""}=e;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(u.InspectorControls,null,(0,c.createElement)(d.PanelBody,{title:(0,l.__)("Form Step Options","shop-as-client")},(0,c.createElement)(d.ToggleControl,{label:(0,l.__)("Show step number","shop-as-client"),checked:o,onChange:()=>t({showStepNumber:!o})}))),(0,c.createElement)(j,{setAttributes:t,attributes:e,className:m()("wp-block-woocommerce-ptwoo-shop-as-client-block",n)},(0,c.createElement)("div",{"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal"}},(0,c.createElement)(T,{inEditor:!0}))))},save:function({attributes:e}){const{text:t}=e;return(0,c.createElement)("div",{...u.useBlockProps.save()},(0,c.createElement)(u.RichText.Content,{value:t}))}})},942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=a(e,s(o)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=a(t,o));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},o={};function n(e){var c=o[e];if(void 0!==c)return c.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,o,c,s)=>{if(!o){var a=1/0;for(p=0;p<e.length;p++){for(var[o,c,s]=e[p],r=!0,l=0;l<o.length;l++)(!1&s||a>=s)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(r=!1,s<a&&(a=s));if(r){e.splice(p--,1);var i=c();void 0!==i&&(t=i)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[o,c,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={942:0,731:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var c,s,[a,r,l]=o,i=0;if(a.some((t=>0!==e[t]))){for(c in r)n.o(r,c)&&(n.m[c]=r[c]);if(l)var p=l(n)}for(t&&t(o);i<a.length;i++)s=a[i],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},o=globalThis.webpackChunkwoocommerce_shop_as_client=globalThis.webpackChunkwoocommerce_shop_as_client||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=n.O(void 0,[731],(()=>n(432)));c=n.O(c)})();
  • shop-as-client/tags/6.8/includes/class-shop-as-client-checkout-blocks.php

    r3045145 r3416450  
    2222        $this->register_block_frontend_scripts();
    2323        $this->register_block_editor_scripts();
     24        $this->register_block_editor_styles();
     25        $this->register_block_frontend_styles();
     26        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_block_frontend_styles' ) );
     27        add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_styles' ) );
    2428    }
    2529
     
    4145        return array( 'ptwoo-shop-as-client-block-editor' );
    4246    }
     47
     48
    4349
    4450    /**
     
    121127
    122128    /**
     129     * Register block editor styles.
     130     *
     131     * @return void
     132     */
     133    public function register_block_editor_styles() {
     134        $style_url  = SHOPASCLIENT_PLUGIN_URL . 'build/style-ptwoo-shop-as-client-block.css';
     135        $style_path = SHOPASCLIENT_PLUGIN_DIR . 'build/style-ptwoo-shop-as-client-block.css';
     136
     137        if ( file_exists( $style_path ) ) {
     138            wp_register_style(
     139                'ptwoo-shop-as-client-block-editor-style',
     140                $style_url,
     141                array(),
     142                $this->get_file_version( $style_path )
     143            );
     144        }
     145    }
     146
     147    /**
     148     * Enqueue block editor styles.
     149     *
     150     * @return void
     151     */
     152    public function enqueue_block_editor_styles() {
     153        wp_enqueue_style( 'ptwoo-shop-as-client-block-editor-style' );
     154    }
     155
     156    /**
     157     * Register block frontend styles.
     158     *
     159     * @return void
     160     */
     161    public function register_block_frontend_styles() {
     162        $style_url  = SHOPASCLIENT_PLUGIN_URL . 'build/style-ptwoo-shop-as-client-block.css';
     163        $style_path = SHOPASCLIENT_PLUGIN_DIR . 'build/style-ptwoo-shop-as-client-block.css';
     164
     165        if ( file_exists( $style_path ) ) {
     166            wp_register_style(
     167                'ptwoo-shop-as-client-block-frontend-style',
     168                $style_url,
     169                array(),
     170                $this->get_file_version( $style_path )
     171            );
     172        }
     173    }
     174
     175    /**
     176     * Enqueue block frontend styles.
     177     *
     178     * @return void
     179     */
     180    public function enqueue_block_frontend_styles() {
     181        if ( has_block( 'woocommerce/checkout' ) || has_block( 'woocommerce/ptwoo-shop-as-client' ) ) {
     182            wp_enqueue_style( 'ptwoo-shop-as-client-block-frontend-style' );
     183        }
     184    }
     185
     186    /**
    123187     * Get the file modified time as a cache buster if we're in dev mode.
    124188     *
  • shop-as-client/tags/6.8/includes/class-shop-as-client-extend-store-endpoint.php

    r3209290 r3416450  
    204204                'shop_as_client_checkout_order_process_error',
    205205                sprintf(
    206                     /* translators: %s error message. */
     206                    /* translators: %s: error message */
    207207                    __( 'Shop as Client failed to create user: %s', 'shop-as-client' ),
    208208                    $user_id->get_error_message()
  • shop-as-client/tags/6.8/languages/shop-as-client.pot

    r3272290 r3416450  
    11# Copyright (C) 2025 Naked Cat Plugins (by Webdados)
    2 # This file is distributed under the same license as the Shop as Client for WooCommerce plugin.
     2# This file is distributed under the GPLv3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Shop as Client for WooCommerce 6.0\n"
     5"Project-Id-Version: Shop as Client for WooCommerce 6.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shop-as-client\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-04-14T10:54:11+00:00\n"
     12"POT-Creation-Date: 2025-12-10T13:09:37+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    4040msgstr ""
    4141
    42 #. translators: %s error message.
    4342#. translators: %s: error message
    4443#: includes/class-shop-as-client-extend-store-endpoint.php:207
    45 #: shop-as-client.php:376
     44#: shop-as-client.php:379
    4645msgid "Shop as Client failed to create user: %s"
    4746msgstr ""
    4847
    49 #: shop-as-client.php:73
     48#: shop-as-client.php:76
    5049msgid "Settings"
    5150msgstr ""
    5251
    5352#. translators: %1$s: link open, %2$s: link close
    54 #: shop-as-client.php:90
     53#: shop-as-client.php:93
    5554msgid "Available on the %1$sPRO Add-on%2$s"
    5655msgstr ""
    5756
    58 #: shop-as-client.php:96
     57#: shop-as-client.php:99
    5958msgid "Shop as Client"
    6059msgstr ""
    6160
    62 #: shop-as-client.php:105
     61#: shop-as-client.php:108
    6362msgid "Shop as client field default"
    6463msgstr ""
    6564
    66 #: shop-as-client.php:109
    67 #: shop-as-client.php:123
    68 #: shop-as-client.php:138
    69 #: shop-as-client.php:152
    70 #: shop-as-client.php:172
    71 #: shop-as-client.php:186
    72 #: shop-as-client.php:238
    73 #: shop-as-client.php:255
    74 #: shop-as-client.php:485
     65#: shop-as-client.php:112
     66#: shop-as-client.php:126
     67#: shop-as-client.php:141
     68#: shop-as-client.php:155
     69#: shop-as-client.php:175
     70#: shop-as-client.php:189
     71#: shop-as-client.php:241
     72#: shop-as-client.php:258
     73#: shop-as-client.php:488
    7574msgid "Yes"
    7675msgstr ""
    7776
    78 #: shop-as-client.php:110
    79 #: shop-as-client.php:124
    80 #: shop-as-client.php:139
    81 #: shop-as-client.php:153
    82 #: shop-as-client.php:173
    83 #: shop-as-client.php:187
    84 #: shop-as-client.php:239
     77#: shop-as-client.php:113
     78#: shop-as-client.php:127
     79#: shop-as-client.php:142
     80#: shop-as-client.php:156
     81#: shop-as-client.php:176
     82#: shop-as-client.php:190
     83#: shop-as-client.php:242
    8584msgid "No"
    8685msgstr ""
    8786
    88 #: shop-as-client.php:119
     87#: shop-as-client.php:122
    8988msgid "Create user field default"
    9089msgstr ""
    9190
    92 #: shop-as-client.php:133
     91#: shop-as-client.php:136
    9392msgid "Search on orders"
    9493msgstr ""
    9594
    96 #: shop-as-client.php:134
     95#: shop-as-client.php:137
    9796msgid "By default, the search is only performed on registered users by their registration and billing email, but if you enable this option it will also be done on orders (if not found as user), so you can get data from guest customers."
    9897msgstr ""
    9998
    100 #: shop-as-client.php:147
     99#: shop-as-client.php:150
    101100msgid "Update customer"
    102101msgstr ""
    103102
    104 #: shop-as-client.php:148
     103#: shop-as-client.php:151
    105104msgid "Update the customer details on his profile"
    106105msgstr ""
    107106
    108 #: shop-as-client.php:161
     107#: shop-as-client.php:164
    109108msgid "Clear checkout fields"
    110109msgstr ""
    111110
    112 #: shop-as-client.php:163
     111#: shop-as-client.php:166
    113112msgid "Default all checkout fields to blank for Administrators and Shop Managers"
    114113msgstr ""
    115114
    116 #: shop-as-client.php:167
     115#: shop-as-client.php:170
    117116msgid "Only on the classic checkout"
    118117msgstr ""
    119118
    120 #: shop-as-client.php:181
     119#: shop-as-client.php:184
    121120msgid "Handler on orders list"
    122121msgstr ""
    123122
    124 #: shop-as-client.php:182
     123#: shop-as-client.php:185
    125124msgid "Add a column with the order handler and allow filtering by handler on the admin orders list"
    126125msgstr ""
    127126
    128 #: shop-as-client.php:229
    129 #: shop-as-client.php:484
     127#: shop-as-client.php:232
     128#: shop-as-client.php:487
    130129#: build/ptwoo-shop-as-client-block-frontend.js:1
    131130#: build/ptwoo-shop-as-client-block.js:1
     
    135134msgstr ""
    136135
    137 #: shop-as-client.php:246
     136#: shop-as-client.php:249
    138137#: build/ptwoo-shop-as-client-block-frontend.js:1
    139138#: build/ptwoo-shop-as-client-block.js:1
     
    142141msgstr ""
    143142
    144 #: shop-as-client.php:256
     143#: shop-as-client.php:259
    145144msgid "No (leave as guest)"
    146145msgstr ""
    147146
    148 #: shop-as-client.php:284
     147#: shop-as-client.php:287
    149148msgid "Do you want to load the customer details automatically?<br/>Get the PRO add-on!"
    150149msgstr ""
    151150
    152 #: shop-as-client.php:492
     151#: shop-as-client.php:495
    153152msgid "Order handled by"
    154153msgstr ""
    155154
    156155#. translators: $d: user id
    157 #: shop-as-client.php:511
     156#: shop-as-client.php:514
    158157msgid "User %d"
    159158msgstr ""
    160159
    161 #: shop-as-client.php:524
     160#: shop-as-client.php:528
    162161msgid "Checkout"
    163162msgstr ""
    164163
    165 #: shop-as-client.php:579
     164#: shop-as-client.php:583
    166165msgid "Get the PRO add-on to fix this"
    167166msgstr ""
    168167
    169 #: shop-as-client.php:581
     168#: shop-as-client.php:585
    170169msgid "<strong>Shop as client</strong><br/>Since WooCommerce 7.8.1 only the order owner/customer is able to see the \"Order received\" details."
    171170msgstr ""
  • shop-as-client/tags/6.8/shop-as-client.php

    r3400624 r3416450  
    44 * Plugin URI:           https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/
    55 * Description:          Allows a WooCommerce Store Administrator or Shop Manager to use the frontend and assign a new order to a registered or new customer. Useful for phone or email orders.
    6  * Version:              6.7
     6 * Version:              6.8
    77 * Author:               Naked Cat Plugins (by Webdados)
    88 * Author URI:           https://nakedcatplugins.com/
     
    1313 * Requires PHP:         7.4
    1414 * WC requires at least: 7.1
    15  * WC tested up to:      10.3
     15 * WC tested up to:      10.4
    1616 * Requires Plugins:     woocommerce
    1717 * License:              GPLv3
  • shop-as-client/trunk/build/ptwoo-shop-as-client-block-frontend.asset.php

    r3272290 r3416450  
    1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '414fd39c69d05d9efd62');
     1<?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '4da1a643e53ef42e6c9a');
  • shop-as-client/trunk/build/ptwoo-shop-as-client-block-frontend.js

    r3272290 r3416450  
    1 (()=>{var e={942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=a(e,s(o)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=a(t,o));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var c=t[n];if(void 0!==c)return c.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wc.blocksCheckout,t=window.React;var n=o(942),c=o.n(n);const s=window.wp.i18n,a=window.wp.element,r=window.wp.data,l=window.wp.components,i=window.wp.hooks,p=window.wc.blocksComponents,u=window.wc.wcSettings,m=window.wc.wcBlocksData,d={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,s.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}},w=({title:e,stepHeadingContent:o})=>(0,t.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,t.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!o&&(0,t.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},o)),h=({title:e="",description:o="",showStepNumber:n=!0,className:s="",children:a,stepHeadingContent:r=(()=>{}),blockPosition:l=""})=>{const i=e?"fieldset":"div";return(0,t.createElement)(i,{className:c()(s,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":n}),"data-position":l},e&&(0,t.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,t.createElement)(w,{title:e,stepHeadingContent:r()}),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__container"},o&&(0,t.createElement)("p",{className:"wc-block-components-checkout-step__description"},o),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__content"},a)))},b="ptwoo-shop-as-client",{canCheckout:f,defaultShopAsClient:k,defaultCreateUser:_,showProAddOnNotice:v,blockPosition:y}=(0,u.getSetting)("ptwoo_shop_as_client_data"),C=(g=d,e=>o=>{const n=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(g,o);return(0,t.createElement)(e,{...o,...n})})((o=>{const{stepTitle:n,stepDescription:u,showStepNumber:d,className:w,inEditor:C}=o,[g,E]=(0,a.useState)(k),[N,S]=(0,a.useState)(_),{__internalIncrementCalculating:O,__internalDecrementCalculating:x}=(0,r.useDispatch)(m.CHECKOUT_STORE_KEY);if((0,a.useEffect)((()=>(f&&(0,e.extensionCartUpdate)({namespace:b,data:{resetCustomerData:!0}}),()=>{})),[f]),(0,a.useEffect)((()=>{f&&(O(),(0,e.extensionCartUpdate)({namespace:b,data:{shopAsClient:g,createUser:N},cartPropsToReceive:["extensions"]}).then((()=>{x()})))}),[f,e.extensionCartUpdate,g,N,O,x]),!f)return null;const P=(0,i.applyFilters)("shopAsClient.AddOns",null,{...o,canCheckout:f,shopAsClient:g,createUser:N});let D=(0,t.createElement)("div",{className:w},(0,t.createElement)(p.CheckboxControl,{label:(0,s.__)("Shop as client","shop-as-client"),checked:g,onChange:e=>{E(e),!1===e&&S(!1)}}),P,g&&(0,t.createElement)(p.CheckboxControl,{label:(0,s.__)("Create user (if not found by email)?","shop-as-client"),checked:N,onChange:S}),v&&(0,t.createElement)("div",{className:"wc-block-components-notices"},(0,a.createInterpolateElement)(sprintf("<a>%s<br/>%s</a>",(0,s.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,s.__)("Get the PRO add-on!","shop-as-client")),{a:(0,t.createElement)(l.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,t.createElement)("br",null)})));return C||(D=(0,t.createElement)(h,{title:n,description:u,showStepNumber:d,className:c()("wp-block-woocommerce-ptwoo-shop-as-client-block",w),blockPosition:y},D)),D}));var g;const E=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}');(0,e.registerCheckoutBlock)({metadata:E,component:C}),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".wp-block-woocommerce-checkout");if(!e)return;const t=()=>{const e=document.querySelector(".wp-block-woocommerce-ptwoo-shop-as-client-block");if(e){const t=document.querySelector(".wp-block-woocommerce-checkout-actions-block"),n=document.querySelector(e.dataset.position);e&&t&&n&&t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&(n.parentNode.insertBefore(e,n),o.disconnect())}},o=new MutationObserver(((e,o)=>{for(const o of e)"childList"===o.type&&t()}));o.observe(e,{childList:!0,subtree:!0})}))})()})();
     1(()=>{var e,t={553:(e,t,o)=>{"use strict";const n=window.wc.blocksCheckout,c=window.React;var a=o(942),s=o.n(a);const r=window.wp.i18n,l=window.wp.element,i=window.wp.data,p=window.wp.components,u=window.wp.hooks,m=window.wc.blocksComponents,d=window.wc.wcSettings,h=window.wc.wcBlocksData,w={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,r.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}},b=({title:e,stepHeadingContent:t})=>(0,c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,c.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!t&&(0,c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),f=({title:e="",description:t="",showStepNumber:o=!0,className:n="",children:a,stepHeadingContent:r=(()=>{}),blockPosition:l=""})=>{const i=e?"fieldset":"div";return(0,c.createElement)(i,{className:s()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":o}),"data-position":l},e&&(0,c.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,c.createElement)(b,{title:e,stepHeadingContent:r()}),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__container"},t&&(0,c.createElement)("p",{className:"wc-block-components-checkout-step__description"},t),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__content"},a)))},k="ptwoo-shop-as-client",{canCheckout:v,defaultShopAsClient:_,defaultCreateUser:g,showProAddOnNotice:y,blockPosition:C}=(0,d.getSetting)("ptwoo_shop_as_client_data"),E=(O=w,e=>t=>{const o=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(O,t);return(0,c.createElement)(e,{...t,...o})})((e=>{const{stepTitle:t,stepDescription:o,showStepNumber:a,className:d,inEditor:w}=e,[b,E]=(0,l.useState)(_),[O,N]=(0,l.useState)(g),{__internalIncrementCalculating:S,__internalDecrementCalculating:x}=(0,i.useDispatch)(h.CHECKOUT_STORE_KEY);if((0,l.useEffect)((()=>(v&&(0,n.extensionCartUpdate)({namespace:k,data:{resetCustomerData:!0}}),()=>{})),[v]),(0,l.useEffect)((()=>{v&&(S(),(0,n.extensionCartUpdate)({namespace:k,data:{shopAsClient:b,createUser:O},cartPropsToReceive:["extensions"]}).then((()=>{x()})))}),[v,n.extensionCartUpdate,b,O,S,x]),!v)return null;const P=(0,u.applyFilters)("shopAsClient.AddOns",null,{...e,canCheckout:v,shopAsClient:b,createUser:O});let j=(0,c.createElement)("div",{className:d},(0,c.createElement)(m.CheckboxControl,{label:(0,r.__)("Shop as client","shop-as-client"),checked:b,onChange:e=>{E(e),!1===e&&N(!1)}}),P,b&&(0,c.createElement)(m.CheckboxControl,{label:(0,r.__)("Create user (if not found by email)?","shop-as-client"),checked:O,onChange:N}),y&&(0,c.createElement)("div",{className:"wc-block-components-notices"},(0,l.createInterpolateElement)((0,r.sprintf)("<a>%s<br/>%s</a>",(0,r.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,r.__)("Get the PRO add-on!","shop-as-client")),{a:(0,c.createElement)(p.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,c.createElement)("br",null)})));return w||(j=(0,c.createElement)(f,{title:t,description:o,showStepNumber:a,className:s()("wp-block-woocommerce-ptwoo-shop-as-client-block",d),blockPosition:C},j)),j}));var O;const N=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}');(0,n.registerCheckoutBlock)({metadata:N,component:E}),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".wp-block-woocommerce-checkout");if(!e)return;const t=()=>{const e=document.querySelector(".wp-block-woocommerce-ptwoo-shop-as-client-block");if(e){const t=document.querySelector(".wp-block-woocommerce-checkout-actions-block"),n=document.querySelector(e.dataset.position);e&&t&&n&&t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING&&(n.parentNode.insertBefore(e,n),o.disconnect())}},o=new MutationObserver(((e,o)=>{for(const o of e)"childList"===o.type&&t()}));o.observe(e,{childList:!0,subtree:!0})}))},942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=s(e,a(o)))}return e}function a(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=s(t,o));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},o={};function n(e){var c=o[e];if(void 0!==c)return c.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,e=[],n.O=(t,o,c,a)=>{if(!o){var s=1/0;for(p=0;p<e.length;p++){for(var[o,c,a]=e[p],r=!0,l=0;l<o.length;l++)(!1&a||s>=a)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(r=!1,a<s&&(s=a));if(r){e.splice(p--,1);var i=c();void 0!==i&&(t=i)}}return t}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[o,c,a]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={39:0,731:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var c,a,[s,r,l]=o,i=0;if(s.some((t=>0!==e[t]))){for(c in r)n.o(r,c)&&(n.m[c]=r[c]);if(l)var p=l(n)}for(t&&t(o);i<s.length;i++)a=s[i],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return n.O(p)},o=globalThis.webpackChunkwoocommerce_shop_as_client=globalThis.webpackChunkwoocommerce_shop_as_client||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=n.O(void 0,[731],(()=>n(553)));c=n.O(c)})();
  • shop-as-client/trunk/build/ptwoo-shop-as-client-block.asset.php

    r3272290 r3416450  
    1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '423a5cbe091bee8ca85f');
     1<?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-blocks-data-store', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => 'f228402745e5f86f406b');
  • shop-as-client/trunk/build/ptwoo-shop-as-client-block.js

    r3272290 r3416450  
    1 (()=>{var e={942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=a(e,s(o)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=a(t,o));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var c=t[n];if(void 0!==c)return c.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.React,n=window.wp.primitives,c=(0,t.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.createElement)(n.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),s=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}'),a=window.wp.i18n,r={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,a.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}};var l=o(942),i=o.n(l);const p=window.wp.blockEditor,m=window.wp.components,u=window.wp.element,d=window.wp.data,h=window.wp.hooks,w=window.wc.blocksComponents,b=window.wc.wcSettings,k=window.wc.blocksCheckout,f=window.wc.wcBlocksData,_=({title:e,stepHeadingContent:o})=>(0,t.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,t.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!o&&(0,t.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},o)),E=({title:e="",description:o="",showStepNumber:n=!0,className:c="",children:s,stepHeadingContent:a=(()=>{}),blockPosition:r=""})=>{const l=e?"fieldset":"div";return(0,t.createElement)(l,{className:i()(c,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":n}),"data-position":r},e&&(0,t.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,t.createElement)(_,{title:e,stepHeadingContent:a()}),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__container"},o&&(0,t.createElement)("p",{className:"wc-block-components-checkout-step__description"},o),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__content"},s)))},v="ptwoo-shop-as-client",{canCheckout:g,defaultShopAsClient:C,defaultCreateUser:N,showProAddOnNotice:y,blockPosition:S}=(0,b.getSetting)("ptwoo_shop_as_client_data"),x=(O=r,e=>o=>{const n=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(O,o);return(0,t.createElement)(e,{...o,...n})})((e=>{const{stepTitle:o,stepDescription:n,showStepNumber:c,className:s,inEditor:r}=e,[l,p]=(0,u.useState)(C),[b,_]=(0,u.useState)(N),{__internalIncrementCalculating:x,__internalDecrementCalculating:O}=(0,d.useDispatch)(f.CHECKOUT_STORE_KEY);if((0,u.useEffect)((()=>(g&&(0,k.extensionCartUpdate)({namespace:v,data:{resetCustomerData:!0}}),()=>{})),[g]),(0,u.useEffect)((()=>{g&&(x(),(0,k.extensionCartUpdate)({namespace:v,data:{shopAsClient:l,createUser:b},cartPropsToReceive:["extensions"]}).then((()=>{O()})))}),[g,k.extensionCartUpdate,l,b,x,O]),!g)return null;const A=(0,h.applyFilters)("shopAsClient.AddOns",null,{...e,canCheckout:g,shopAsClient:l,createUser:b});let P=(0,t.createElement)("div",{className:s},(0,t.createElement)(w.CheckboxControl,{label:(0,a.__)("Shop as client","shop-as-client"),checked:l,onChange:e=>{p(e),!1===e&&_(!1)}}),A,l&&(0,t.createElement)(w.CheckboxControl,{label:(0,a.__)("Create user (if not found by email)?","shop-as-client"),checked:b,onChange:_}),y&&(0,t.createElement)("div",{className:"wc-block-components-notices"},(0,u.createInterpolateElement)(sprintf("<a>%s<br/>%s</a>",(0,a.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,a.__)("Get the PRO add-on!","shop-as-client")),{a:(0,t.createElement)(m.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,t.createElement)("br",null)})));return r||(P=(0,t.createElement)(E,{title:o,description:n,showStepNumber:c,className:i()("wp-block-woocommerce-ptwoo-shop-as-client-block",s),blockPosition:S},P)),P}));var O;const A=({children:e,stepHeadingContent:o})=>(0,t.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,t.createElement)(w.Title,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},e),!!o&&(0,t.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},o)),P=({attributes:e,setAttributes:o,className:n="",children:c})=>{const{stepTitle:s,stepDescription:r,showStepNumber:l}=e;return(0,t.createElement)("div",{className:i()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":l})},(0,t.createElement)(A,null,(0,t.createElement)(p.PlainText,{value:s,onChange:e=>o({stepTitle:e}),style:{backgroundColor:"transparent"}})),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__container"},(0,t.createElement)("p",{className:"wc-block-components-checkout-step__description"},(0,t.createElement)(p.PlainText,{className:r?"":"wc-block-components-checkout-step__description-placeholder",value:r,placeholder:(0,a.__)("Optional text for this form step.","shop-as-client"),onChange:e=>o({stepDescription:e}),style:{backgroundColor:"transparent"}})),(0,t.createElement)("div",{className:"wc-block-components-checkout-step__content"},c)))};(0,e.registerBlockType)({...s,attributes:{...r}},{icon:c,edit:function({attributes:e,setAttributes:o}){const{showStepNumber:n,className:c=""}=e;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(p.InspectorControls,null,(0,t.createElement)(m.PanelBody,{title:(0,a.__)("Form Step Options","shop-as-client")},(0,t.createElement)(m.ToggleControl,{label:(0,a.__)("Show step number","shop-as-client"),checked:n,onChange:()=>o({showStepNumber:!n})}))),(0,t.createElement)(P,{setAttributes:o,attributes:e,className:i()("wp-block-woocommerce-ptwoo-shop-as-client-block",c)},(0,t.createElement)("div",{"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal"}},(0,t.createElement)(x,{inEditor:!0}))))},save:function({attributes:e}){const{text:o}=e;return(0,t.createElement)("div",{...p.useBlockProps.save()},(0,t.createElement)(p.RichText.Content,{value:o}))}})})()})();
     1(()=>{var e,t={432:(e,t,o)=>{"use strict";const n=window.wp.blocks,c=window.React,s=window.wp.primitives,a=(0,c.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,c.createElement)(s.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})),r=JSON.parse('{"apiVersion":2,"name":"woocommerce/ptwoo-shop-as-client","version":"0.1.0","title":"Shop As Client","category":"woocommerce","description":"","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"textdomain":"shop-as-client"}'),l=window.wp.i18n,i={lock:{type:"object",default:{move:!1,remove:!0}},className:{type:"string",default:""},stepTitle:{type:"string",default:(0,l.__)("Shop as client","shop-as-client")},stepDescription:{type:"string",default:""},showStepNumber:{type:"boolean",default:!0}};var p=o(942),m=o.n(p);const u=window.wp.blockEditor,d=window.wp.components,h=window.wp.element,w=window.wp.data,b=window.wp.hooks,k=window.wc.blocksComponents,f=window.wc.wcSettings,v=window.wc.blocksCheckout,_=window.wc.wcBlocksData,E=({title:e,stepHeadingContent:t})=>(0,c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,c.createElement)("h2",{"aria-hidden":"true",className:"wc-block-components-checkout-step__title wc-block-components-title"},e),!!t&&(0,c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),g=({title:e="",description:t="",showStepNumber:o=!0,className:n="",children:s,stepHeadingContent:a=(()=>{}),blockPosition:r=""})=>{const l=e?"fieldset":"div";return(0,c.createElement)(l,{className:m()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":o}),"data-position":r},e&&(0,c.createElement)("legend",{className:"screen-reader-text"},e),e&&(0,c.createElement)(E,{title:e,stepHeadingContent:a()}),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__container"},t&&(0,c.createElement)("p",{className:"wc-block-components-checkout-step__description"},t),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__content"},s)))},C="ptwoo-shop-as-client",{canCheckout:N,defaultShopAsClient:y,defaultCreateUser:S,showProAddOnNotice:x,blockPosition:O}=(0,f.getSetting)("ptwoo_shop_as_client_data"),T=(A=i,e=>t=>{const o=((e,t)=>{const o=[];return Object.keys(e).forEach((n=>{if(void 0!==t[n])switch(e[n].type){case"boolean":o[n]="false"!==t[n]&&!1!==t[n];break;case"number":o[n]=parseInt(t[n],10);break;case"array":case"object":o[n]=JSON.parse(t[n]);break;default:o[n]=t[n]}else o[n]=e[n].default})),o})(A,t);return(0,c.createElement)(e,{...t,...o})})((e=>{const{stepTitle:t,stepDescription:o,showStepNumber:n,className:s,inEditor:a}=e,[r,i]=(0,h.useState)(y),[p,u]=(0,h.useState)(S),{__internalIncrementCalculating:f,__internalDecrementCalculating:E}=(0,w.useDispatch)(_.CHECKOUT_STORE_KEY);if((0,h.useEffect)((()=>(N&&(0,v.extensionCartUpdate)({namespace:C,data:{resetCustomerData:!0}}),()=>{})),[N]),(0,h.useEffect)((()=>{N&&(f(),(0,v.extensionCartUpdate)({namespace:C,data:{shopAsClient:r,createUser:p},cartPropsToReceive:["extensions"]}).then((()=>{E()})))}),[N,v.extensionCartUpdate,r,p,f,E]),!N)return null;const T=(0,b.applyFilters)("shopAsClient.AddOns",null,{...e,canCheckout:N,shopAsClient:r,createUser:p});let A=(0,c.createElement)("div",{className:s},(0,c.createElement)(k.CheckboxControl,{label:(0,l.__)("Shop as client","shop-as-client"),checked:r,onChange:e=>{i(e),!1===e&&u(!1)}}),T,r&&(0,c.createElement)(k.CheckboxControl,{label:(0,l.__)("Create user (if not found by email)?","shop-as-client"),checked:p,onChange:u}),x&&(0,c.createElement)("div",{className:"wc-block-components-notices"},(0,h.createInterpolateElement)((0,l.sprintf)("<a>%s<br/>%s</a>",(0,l.__)("Do you want to load the customer details automatically?","shop-as-client"),(0,l.__)("Get the PRO add-on!","shop-as-client")),{a:(0,c.createElement)(d.ExternalLink,{href:"https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/"}),br:(0,c.createElement)("br",null)})));return a||(A=(0,c.createElement)(g,{title:t,description:o,showStepNumber:n,className:m()("wp-block-woocommerce-ptwoo-shop-as-client-block",s),blockPosition:O},A)),A}));var A;const P=({children:e,stepHeadingContent:t})=>(0,c.createElement)("div",{className:"wc-block-components-checkout-step__heading"},(0,c.createElement)(k.Title,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},e),!!t&&(0,c.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},t)),j=({attributes:e,setAttributes:t,className:o="",children:n})=>{const{stepTitle:s,stepDescription:a,showStepNumber:r}=e;return(0,c.createElement)("div",{className:m()(o,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":r})},(0,c.createElement)(P,null,(0,c.createElement)(u.PlainText,{value:s,onChange:e=>t({stepTitle:e}),style:{backgroundColor:"transparent"}})),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__container"},(0,c.createElement)("p",{className:"wc-block-components-checkout-step__description"},(0,c.createElement)(u.PlainText,{className:a?"":"wc-block-components-checkout-step__description-placeholder",value:a,placeholder:(0,l.__)("Optional text for this form step.","shop-as-client"),onChange:e=>t({stepDescription:e}),style:{backgroundColor:"transparent"}})),(0,c.createElement)("div",{className:"wc-block-components-checkout-step__content"},n)))};(0,n.registerBlockType)({...r,attributes:{...i}},{icon:a,edit:function({attributes:e,setAttributes:t}){const{showStepNumber:o,className:n=""}=e;return(0,c.createElement)(c.Fragment,null,(0,c.createElement)(u.InspectorControls,null,(0,c.createElement)(d.PanelBody,{title:(0,l.__)("Form Step Options","shop-as-client")},(0,c.createElement)(d.ToggleControl,{label:(0,l.__)("Show step number","shop-as-client"),checked:o,onChange:()=>t({showStepNumber:!o})}))),(0,c.createElement)(j,{setAttributes:t,attributes:e,className:m()("wp-block-woocommerce-ptwoo-shop-as-client-block",n)},(0,c.createElement)("div",{"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal"}},(0,c.createElement)(T,{inEditor:!0}))))},save:function({attributes:e}){const{text:t}=e;return(0,c.createElement)("div",{...u.useBlockProps.save()},(0,c.createElement)(u.RichText.Content,{value:t}))}})},942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=a(e,s(o)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return c.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=a(t,o));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(c.default=c,e.exports=c):void 0===(o=function(){return c}.apply(t,[]))||(e.exports=o)}()}},o={};function n(e){var c=o[e];if(void 0!==c)return c.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,o,c,s)=>{if(!o){var a=1/0;for(p=0;p<e.length;p++){for(var[o,c,s]=e[p],r=!0,l=0;l<o.length;l++)(!1&s||a>=s)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(r=!1,s<a&&(a=s));if(r){e.splice(p--,1);var i=c();void 0!==i&&(t=i)}}return t}s=s||0;for(var p=e.length;p>0&&e[p-1][2]>s;p--)e[p]=e[p-1];e[p]=[o,c,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={942:0,731:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var c,s,[a,r,l]=o,i=0;if(a.some((t=>0!==e[t]))){for(c in r)n.o(r,c)&&(n.m[c]=r[c]);if(l)var p=l(n)}for(t&&t(o);i<a.length;i++)s=a[i],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(p)},o=globalThis.webpackChunkwoocommerce_shop_as_client=globalThis.webpackChunkwoocommerce_shop_as_client||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=n.O(void 0,[731],(()=>n(432)));c=n.O(c)})();
  • shop-as-client/trunk/includes/class-shop-as-client-checkout-blocks.php

    r3045145 r3416450  
    2222        $this->register_block_frontend_scripts();
    2323        $this->register_block_editor_scripts();
     24        $this->register_block_editor_styles();
     25        $this->register_block_frontend_styles();
     26        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_block_frontend_styles' ) );
     27        add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_styles' ) );
    2428    }
    2529
     
    4145        return array( 'ptwoo-shop-as-client-block-editor' );
    4246    }
     47
     48
    4349
    4450    /**
     
    121127
    122128    /**
     129     * Register block editor styles.
     130     *
     131     * @return void
     132     */
     133    public function register_block_editor_styles() {
     134        $style_url  = SHOPASCLIENT_PLUGIN_URL . 'build/style-ptwoo-shop-as-client-block.css';
     135        $style_path = SHOPASCLIENT_PLUGIN_DIR . 'build/style-ptwoo-shop-as-client-block.css';
     136
     137        if ( file_exists( $style_path ) ) {
     138            wp_register_style(
     139                'ptwoo-shop-as-client-block-editor-style',
     140                $style_url,
     141                array(),
     142                $this->get_file_version( $style_path )
     143            );
     144        }
     145    }
     146
     147    /**
     148     * Enqueue block editor styles.
     149     *
     150     * @return void
     151     */
     152    public function enqueue_block_editor_styles() {
     153        wp_enqueue_style( 'ptwoo-shop-as-client-block-editor-style' );
     154    }
     155
     156    /**
     157     * Register block frontend styles.
     158     *
     159     * @return void
     160     */
     161    public function register_block_frontend_styles() {
     162        $style_url  = SHOPASCLIENT_PLUGIN_URL . 'build/style-ptwoo-shop-as-client-block.css';
     163        $style_path = SHOPASCLIENT_PLUGIN_DIR . 'build/style-ptwoo-shop-as-client-block.css';
     164
     165        if ( file_exists( $style_path ) ) {
     166            wp_register_style(
     167                'ptwoo-shop-as-client-block-frontend-style',
     168                $style_url,
     169                array(),
     170                $this->get_file_version( $style_path )
     171            );
     172        }
     173    }
     174
     175    /**
     176     * Enqueue block frontend styles.
     177     *
     178     * @return void
     179     */
     180    public function enqueue_block_frontend_styles() {
     181        if ( has_block( 'woocommerce/checkout' ) || has_block( 'woocommerce/ptwoo-shop-as-client' ) ) {
     182            wp_enqueue_style( 'ptwoo-shop-as-client-block-frontend-style' );
     183        }
     184    }
     185
     186    /**
    123187     * Get the file modified time as a cache buster if we're in dev mode.
    124188     *
  • shop-as-client/trunk/includes/class-shop-as-client-extend-store-endpoint.php

    r3209290 r3416450  
    204204                'shop_as_client_checkout_order_process_error',
    205205                sprintf(
    206                     /* translators: %s error message. */
     206                    /* translators: %s: error message */
    207207                    __( 'Shop as Client failed to create user: %s', 'shop-as-client' ),
    208208                    $user_id->get_error_message()
  • shop-as-client/trunk/languages/shop-as-client.pot

    r3272290 r3416450  
    11# Copyright (C) 2025 Naked Cat Plugins (by Webdados)
    2 # This file is distributed under the same license as the Shop as Client for WooCommerce plugin.
     2# This file is distributed under the GPLv3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Shop as Client for WooCommerce 6.0\n"
     5"Project-Id-Version: Shop as Client for WooCommerce 6.8\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/shop-as-client\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-04-14T10:54:11+00:00\n"
     12"POT-Creation-Date: 2025-12-10T13:09:37+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    4040msgstr ""
    4141
    42 #. translators: %s error message.
    4342#. translators: %s: error message
    4443#: includes/class-shop-as-client-extend-store-endpoint.php:207
    45 #: shop-as-client.php:376
     44#: shop-as-client.php:379
    4645msgid "Shop as Client failed to create user: %s"
    4746msgstr ""
    4847
    49 #: shop-as-client.php:73
     48#: shop-as-client.php:76
    5049msgid "Settings"
    5150msgstr ""
    5251
    5352#. translators: %1$s: link open, %2$s: link close
    54 #: shop-as-client.php:90
     53#: shop-as-client.php:93
    5554msgid "Available on the %1$sPRO Add-on%2$s"
    5655msgstr ""
    5756
    58 #: shop-as-client.php:96
     57#: shop-as-client.php:99
    5958msgid "Shop as Client"
    6059msgstr ""
    6160
    62 #: shop-as-client.php:105
     61#: shop-as-client.php:108
    6362msgid "Shop as client field default"
    6463msgstr ""
    6564
    66 #: shop-as-client.php:109
    67 #: shop-as-client.php:123
    68 #: shop-as-client.php:138
    69 #: shop-as-client.php:152
    70 #: shop-as-client.php:172
    71 #: shop-as-client.php:186
    72 #: shop-as-client.php:238
    73 #: shop-as-client.php:255
    74 #: shop-as-client.php:485
     65#: shop-as-client.php:112
     66#: shop-as-client.php:126
     67#: shop-as-client.php:141
     68#: shop-as-client.php:155
     69#: shop-as-client.php:175
     70#: shop-as-client.php:189
     71#: shop-as-client.php:241
     72#: shop-as-client.php:258
     73#: shop-as-client.php:488
    7574msgid "Yes"
    7675msgstr ""
    7776
    78 #: shop-as-client.php:110
    79 #: shop-as-client.php:124
    80 #: shop-as-client.php:139
    81 #: shop-as-client.php:153
    82 #: shop-as-client.php:173
    83 #: shop-as-client.php:187
    84 #: shop-as-client.php:239
     77#: shop-as-client.php:113
     78#: shop-as-client.php:127
     79#: shop-as-client.php:142
     80#: shop-as-client.php:156
     81#: shop-as-client.php:176
     82#: shop-as-client.php:190
     83#: shop-as-client.php:242
    8584msgid "No"
    8685msgstr ""
    8786
    88 #: shop-as-client.php:119
     87#: shop-as-client.php:122
    8988msgid "Create user field default"
    9089msgstr ""
    9190
    92 #: shop-as-client.php:133
     91#: shop-as-client.php:136
    9392msgid "Search on orders"
    9493msgstr ""
    9594
    96 #: shop-as-client.php:134
     95#: shop-as-client.php:137
    9796msgid "By default, the search is only performed on registered users by their registration and billing email, but if you enable this option it will also be done on orders (if not found as user), so you can get data from guest customers."
    9897msgstr ""
    9998
    100 #: shop-as-client.php:147
     99#: shop-as-client.php:150
    101100msgid "Update customer"
    102101msgstr ""
    103102
    104 #: shop-as-client.php:148
     103#: shop-as-client.php:151
    105104msgid "Update the customer details on his profile"
    106105msgstr ""
    107106
    108 #: shop-as-client.php:161
     107#: shop-as-client.php:164
    109108msgid "Clear checkout fields"
    110109msgstr ""
    111110
    112 #: shop-as-client.php:163
     111#: shop-as-client.php:166
    113112msgid "Default all checkout fields to blank for Administrators and Shop Managers"
    114113msgstr ""
    115114
    116 #: shop-as-client.php:167
     115#: shop-as-client.php:170
    117116msgid "Only on the classic checkout"
    118117msgstr ""
    119118
    120 #: shop-as-client.php:181
     119#: shop-as-client.php:184
    121120msgid "Handler on orders list"
    122121msgstr ""
    123122
    124 #: shop-as-client.php:182
     123#: shop-as-client.php:185
    125124msgid "Add a column with the order handler and allow filtering by handler on the admin orders list"
    126125msgstr ""
    127126
    128 #: shop-as-client.php:229
    129 #: shop-as-client.php:484
     127#: shop-as-client.php:232
     128#: shop-as-client.php:487
    130129#: build/ptwoo-shop-as-client-block-frontend.js:1
    131130#: build/ptwoo-shop-as-client-block.js:1
     
    135134msgstr ""
    136135
    137 #: shop-as-client.php:246
     136#: shop-as-client.php:249
    138137#: build/ptwoo-shop-as-client-block-frontend.js:1
    139138#: build/ptwoo-shop-as-client-block.js:1
     
    142141msgstr ""
    143142
    144 #: shop-as-client.php:256
     143#: shop-as-client.php:259
    145144msgid "No (leave as guest)"
    146145msgstr ""
    147146
    148 #: shop-as-client.php:284
     147#: shop-as-client.php:287
    149148msgid "Do you want to load the customer details automatically?<br/>Get the PRO add-on!"
    150149msgstr ""
    151150
    152 #: shop-as-client.php:492
     151#: shop-as-client.php:495
    153152msgid "Order handled by"
    154153msgstr ""
    155154
    156155#. translators: $d: user id
    157 #: shop-as-client.php:511
     156#: shop-as-client.php:514
    158157msgid "User %d"
    159158msgstr ""
    160159
    161 #: shop-as-client.php:524
     160#: shop-as-client.php:528
    162161msgid "Checkout"
    163162msgstr ""
    164163
    165 #: shop-as-client.php:579
     164#: shop-as-client.php:583
    166165msgid "Get the PRO add-on to fix this"
    167166msgstr ""
    168167
    169 #: shop-as-client.php:581
     168#: shop-as-client.php:585
    170169msgid "<strong>Shop as client</strong><br/>Since WooCommerce 7.8.1 only the order owner/customer is able to see the \"Order received\" details."
    171170msgstr ""
  • shop-as-client/trunk/shop-as-client.php

    r3400624 r3416450  
    44 * Plugin URI:           https://nakedcatplugins.com/product/shop-as-client-for-woocommerce-pro-add-on/
    55 * Description:          Allows a WooCommerce Store Administrator or Shop Manager to use the frontend and assign a new order to a registered or new customer. Useful for phone or email orders.
    6  * Version:              6.7
     6 * Version:              6.8
    77 * Author:               Naked Cat Plugins (by Webdados)
    88 * Author URI:           https://nakedcatplugins.com/
     
    1313 * Requires PHP:         7.4
    1414 * WC requires at least: 7.1
    15  * WC tested up to:      10.3
     15 * WC tested up to:      10.4
    1616 * Requires Plugins:     woocommerce
    1717 * License:              GPLv3
Note: See TracChangeset for help on using the changeset viewer.