Plugin Directory

Changeset 3067686

Timestamp:
04/09/2024 01:10:50 PM (4 months ago)
Author:
maxpertici
Message:

Block Revealer / trunk / 19.2

Location:
wp-block-revealer/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wp-block-revealer/trunk/dist/102.js

    r3067676 r3067686  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[102,841,643],{87:(t,e,o)=>{o.d(e,{QZ:()=>m,vP:()=>d});var i=Symbol.for("preact-signals");function r(){if(a>1)a--;else{for(var t,e=!1;void 0!==s;){var o=s;for(s=void 0,l++;void 0!==o;){var i=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&v(o))try{o.c()}catch(o){e||(t=o,e=!0)}o=i}}if(l=0,a--,e)throw t}}var n=void 0,s=void 0,a=0,l=0,u=0;function c(t){if(void 0!==n){var e=t.n;if(void 0===e||e.t!==n)return e={i:0,S:t,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:e},void 0!==n.s&&(n.s.n=e),n.s=e,t.n=e,32&n.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=n.s,e.n=void 0,n.s.n=e,n.s=e),e}}function f(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function d(t){return new f(t)}function v(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function h(t){for(var e=t.s;void 0!==e;e=e.n){var o=e.S.n;if(void 0!==o&&(e.r=o),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function p(t){for(var e=t.s,o=void 0;void 0!==e;){var i=e.p;-1===e.i?(e.S.U(e),void 0!==i&&(i.n=e.n),void 0!==e.n&&(e.n.p=i)):o=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=i}t.s=o}function y(t){f.call(this,void 0),this.x=t,this.s=void 0,this.g=u-1,this.f=4}function b(t){var e=t.u;if(t.u=void 0,"function"==typeof e){a++;var o=n;n=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,S(t),e}finally{n=o,r()}}}function S(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,b(t)}function g(t){if(n!==this)throw new Error("Out-of-order effect");p(this),n=t,this.f&=-2,8&this.f&&S(this),r()}function w(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function m(t){var e=new w(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}f.prototype.brand=i,f.prototype.h=function(){return!0},f.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},f.prototype.U=function(t){if(void 0!==this.t){var e=t.e,o=t.x;void 0!==e&&(e.x=o,t.e=void 0),void 0!==o&&(o.e=e,t.x=void 0),t===this.t&&(this.t=o)}},f.prototype.subscribe=function(t){var e=this;return m((function(){var o=e.value,i=n;n=void 0;try{t(o)}finally{n=i}}))},f.prototype.valueOf=function(){return this.value},f.prototype.toString=function(){return this.value+""},f.prototype.toJSON=function(){return this.value},f.prototype.peek=function(){var t=n;n=void 0;try{return this.value}finally{n=t}},Object.defineProperty(f.prototype,"value",{get:function(){var t=c(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(l>100)throw new Error("Cycle detected");this.v=t,this.i++,u++,a++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{r()}}}}),(y.prototype=new f).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===u)return!0;if(this.g=u,this.f|=1,this.i>0&&!v(this))return this.f&=-2,!0;var t=n;try{h(this),n=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return n=t,p(this),this.f&=-2,!0},y.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}f.prototype.S.call(this,t)},y.prototype.U=function(t){if(void 0!==this.t&&(f.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=c(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),w.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},w.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,b(this),h(this),a++;var t=n;return n=this,g.bind(this,t)},w.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},w.prototype.d=function(){this.f|=8,1&this.f||S(this)};var E=o(609),C=o(888);o(848),o(446),new Map;var _,k=Symbol.for("react.element"),R=function(){},O=Symbol.dispose||Symbol.for("Symbol.dispose");function x(t,e){var o=e.effect.S();return _=e,N.bind(e,t,o)}function N(t,e){e(),_=t}({u:0,effect:{s:void 0,c:function(){},S:function(){return R},d:function(){}},subscribe:function(){return R},getSnapshot:function(){return 0},S:function(){},f:function(){}})[O]=function(){};var P,I=Promise.prototype.then.bind(Promise.resolve());Object.defineProperties(f.prototype,{$$typeof:{configurable:!0,value:k},type:{configurable:!0,value:function(t){var e=t.data,o=function(t){void 0===t&&(t=0),P||(P=I((function(){var t;P=void 0,null==(t=_)||t.f()})));var e=(0,E.useRef)();null==e.current&&(e.current=function(t){var e,o,i,r,n=0,s=m((function(){o=this}));return o.c=function(){n=n+1|0,r&&r()},(e={u:t,effect:o,subscribe:function(t){return r=t,function(){n=n+1|0,r=void 0,s()}},getSnapshot:function(){return n},S:function(){if(null!=_){var t=_.u,e=this.u;0==t&&0==e||0==t&&1==e?(_.f(),i=x(void 0,this)):1==t&&0==e||2==t&&0==e||(i=x(_,this))}else i=x(void 0,this)},f:function(){null==i||i(),i=void 0}})[O]=function(){this.f()},e}(t));var o=e.current;return(0,C.useSyncExternalStore)(o.subscribe,o.getSnapshot,o.getSnapshot),o.S(),o}(1);try{return e.value}finally{o.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}})},784:(t,e,o)=>{o.d(e,{A:()=>i});class i{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return this.colors}findColor(t){let e=this.colors;return Object.keys(e).forEach((o=>{if(t===e[o])return o})),""}}},841:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});var i=o(784),r=o(196);class n{constructor(){this.bodyNodes=this.getBodyNodes()}init({reveal:t=!1,color:e="blue"}){this.setPluginClass("wp-block-revealer"),this.setColor(e),this.setReveal(t),this.bodyNodeObserver(),this.storage=new r.A,this.colors=new i.A}getBodyNodes(){let t=[],e=this.domBody();return t.push(e),document.body!==e&&t.push(document.body),t}getBody(){return this.domBody()}isPostEditorIframe(){return!document.querySelector(".block-editor-writing-flow")}isSiteEditor(){return!!document.querySelector(".edit-site-visual-editor")}domBody(){let t=null,e=this.isPostEditorIframe()?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector(".block-editor-writing-flow");return e&&this.isPostEditorIframe()&&(t=e.contentWindow.document.body),this.isSiteEditor()&&(e=document.querySelector('iframe[name="editor-canvas"]'),t=e.contentWindow.document.body),!e||this.isPostEditorIframe()||this.isSiteEditor()||(t=document.querySelector("body")),t}setPluginClass(t){this.bodyNodes.forEach((e=>{e.classList.add(t)}))}removePluginClass(t){this.bodyNodes.forEach((e=>{e.classList.remove(t)}))}setColor(t){t||(t="blue"),this.bodyNodes.forEach((e=>{e.style.setProperty("--wpbr--editor--shadow--color","var( --wpbr--color--"+t+" )"),e.style.setProperty("--wpbr--editor--shadow--color-hover","var( --wpbr--color--"+t+"-hover )")}))}setReveal(t){this.bodyNodes.forEach((e=>{t?e.classList.add("wp-block-revealer--reveal"):e.classList.remove("wp-block-revealer--reveal")}))}bodyNodeObserver(){let t=this.domBody();t&&new MutationObserver(((t,e)=>{for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=getComputedStyle(e.target).getPropertyValue("--wpbr--editor--shadow--color");this.colors.findColor(t)!==this.storage.getColor()&&this.setColor(this.storage.getColor()),!0!==this.storage.getReveal()||e.target.classList.contains("wp-block-revealer--reveal")||this.setReveal(this.storage.getReveal()),!1===this.storage.getReveal()&&e.target.classList.contains("wp-block-revealer--reveal")&&this.setReveal(this.storage.getReveal())}})).observe(t,{attributes:!0,childList:!1,subtree:!1})}keepChildAlive(t,e){setInterval((()=>{let o=null,i=document.querySelector(t);i&&(o=i.querySelector("#block-revealer-root")),o||i.appendChild(e)}),1200)}}},643:(t,e,o)=>{o.d(e,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>n});var i=o(87);const r=new(o(196).A),n=(0,i.vP)(r.getReveal()),s=(0,i.vP)(r.getColor())},102:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});var i=o(841),r=o(643);class n{constructor(){}bind(){let t=new i.default;[].forEach.call(t.getBodyNodes(),(t=>{t.addEventListener("keydown",(t=>{t.ctrlKey&&t.altKey&&82===t.keyCode&&(r.GlobalSignalReveal.value=!r.GlobalSignalReveal.value)}))})),document.body!==t.getBody()&&document.addEventListener("keydown",(t=>{t.ctrlKey&&t.altKey&&82===t.keyCode&&(r.GlobalSignalReveal.value=!r.GlobalSignalReveal.value)}))}}},196:(t,e,o)=>{o.d(e,{A:()=>r});var i=o(784);class r{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){(new i.A).getColors().indexOf(t)>-1&&(t="blue"),window.localStorage.setItem("wpbr_options__color",t)}setReveal(t){let e=!0===t?"true":"false";window.localStorage.setItem("wpbr_options__reveal",e)}}},286:(t,e)=>{Symbol.for("react.fragment")},20:(t,e,o)=>{var i=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},446:(t,e,o)=>{o(286)},848:(t,e,o)=>{o(20)},63:(t,e,o)=>{var i=o(609),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},n=i.useState,s=i.useEffect,a=i.useLayoutEffect,l=i.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var o=e();return!r(t,o)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var o=e(),i=n({inst:{value:o,getSnapshot:e}}),r=i[0].inst,c=i[1];return a((function(){r.value=o,r.getSnapshot=e,u(r)&&c({inst:r})}),[t,o,e]),s((function(){return u(r)&&c({inst:r}),t((function(){u(r)&&c({inst:r})}))}),[t]),l(o),o};e.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:c},888:(t,e,o)=>{t.exports=o(63)}}]);
     1"use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[102,841,643],{87:(t,e,o)=>{o.d(e,{QZ:()=>m,vP:()=>d});var i=Symbol.for("preact-signals");function r(){if(a>1)a--;else{for(var t,e=!1;void 0!==s;){var o=s;for(s=void 0,l++;void 0!==o;){var i=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&v(o))try{o.c()}catch(o){e||(t=o,e=!0)}o=i}}if(l=0,a--,e)throw t}}var n=void 0,s=void 0,a=0,l=0,u=0;function c(t){if(void 0!==n){var e=t.n;if(void 0===e||e.t!==n)return e={i:0,S:t,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:e},void 0!==n.s&&(n.s.n=e),n.s=e,t.n=e,32&n.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=n.s,e.n=void 0,n.s.n=e,n.s=e),e}}function f(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function d(t){return new f(t)}function v(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function h(t){for(var e=t.s;void 0!==e;e=e.n){var o=e.S.n;if(void 0!==o&&(e.r=o),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function p(t){for(var e=t.s,o=void 0;void 0!==e;){var i=e.p;-1===e.i?(e.S.U(e),void 0!==i&&(i.n=e.n),void 0!==e.n&&(e.n.p=i)):o=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=i}t.s=o}function y(t){f.call(this,void 0),this.x=t,this.s=void 0,this.g=u-1,this.f=4}function b(t){var e=t.u;if(t.u=void 0,"function"==typeof e){a++;var o=n;n=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,S(t),e}finally{n=o,r()}}}function S(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,b(t)}function g(t){if(n!==this)throw new Error("Out-of-order effect");p(this),n=t,this.f&=-2,8&this.f&&S(this),r()}function w(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function m(t){var e=new w(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}f.prototype.brand=i,f.prototype.h=function(){return!0},f.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},f.prototype.U=function(t){if(void 0!==this.t){var e=t.e,o=t.x;void 0!==e&&(e.x=o,t.e=void 0),void 0!==o&&(o.e=e,t.x=void 0),t===this.t&&(this.t=o)}},f.prototype.subscribe=function(t){var e=this;return m((function(){var o=e.value,i=n;n=void 0;try{t(o)}finally{n=i}}))},f.prototype.valueOf=function(){return this.value},f.prototype.toString=function(){return this.value+""},f.prototype.toJSON=function(){return this.value},f.prototype.peek=function(){var t=n;n=void 0;try{return this.value}finally{n=t}},Object.defineProperty(f.prototype,"value",{get:function(){var t=c(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(l>100)throw new Error("Cycle detected");this.v=t,this.i++,u++,a++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{r()}}}}),(y.prototype=new f).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===u)return!0;if(this.g=u,this.f|=1,this.i>0&&!v(this))return this.f&=-2,!0;var t=n;try{h(this),n=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return n=t,p(this),this.f&=-2,!0},y.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}f.prototype.S.call(this,t)},y.prototype.U=function(t){if(void 0!==this.t&&(f.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=c(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),w.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},w.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,b(this),h(this),a++;var t=n;return n=this,g.bind(this,t)},w.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},w.prototype.d=function(){this.f|=8,1&this.f||S(this)};var E=o(609),C=o(888);o(848),o(446),new Map;var _,k=Symbol.for("react.element"),R=function(){},O=Symbol.dispose||Symbol.for("Symbol.dispose");function x(t,e){var o=e.effect.S();return _=e,N.bind(e,t,o)}function N(t,e){e(),_=t}({u:0,effect:{s:void 0,c:function(){},S:function(){return R},d:function(){}},subscribe:function(){return R},getSnapshot:function(){return 0},S:function(){},f:function(){}})[O]=function(){};var P,I=Promise.prototype.then.bind(Promise.resolve());Object.defineProperties(f.prototype,{$$typeof:{configurable:!0,value:k},type:{configurable:!0,value:function(t){var e=t.data,o=function(t){void 0===t&&(t=0),P||(P=I((function(){var t;P=void 0,null==(t=_)||t.f()})));var e=(0,E.useRef)();null==e.current&&(e.current=function(t){var e,o,i,r,n=0,s=m((function(){o=this}));return o.c=function(){n=n+1|0,r&&r()},(e={u:t,effect:o,subscribe:function(t){return r=t,function(){n=n+1|0,r=void 0,s()}},getSnapshot:function(){return n},S:function(){if(null!=_){var t=_.u,e=this.u;0==t&&0==e||0==t&&1==e?(_.f(),i=x(void 0,this)):1==t&&0==e||2==t&&0==e||(i=x(_,this))}else i=x(void 0,this)},f:function(){null==i||i(),i=void 0}})[O]=function(){this.f()},e}(t));var o=e.current;return(0,C.useSyncExternalStore)(o.subscribe,o.getSnapshot,o.getSnapshot),o.S(),o}(1);try{return e.value}finally{o.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}})},784:(t,e,o)=>{o.d(e,{A:()=>i});class i{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return }findColor(t){let e=this.colors;return Object.keys(e).forEach((o=>{if(t===e[o])return o})),""}}},841:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});var i=o(784),r=o(196);class n{constructor(){this.bodyNodes=this.getBodyNodes()}init({reveal:t=!1,color:e="blue"}){this.setPluginClass("wp-block-revealer"),this.setColor(e),this.setReveal(t),this.bodyNodeObserver(),this.storage=new r.A,this.colors=new i.A}getBodyNodes(){let t=[],e=this.domBody();return t.push(e),document.body!==e&&t.push(document.body),t}getBody(){return this.domBody()}isPostEditorIframe(){return!document.querySelector(".block-editor-writing-flow")}isSiteEditor(){return!!document.querySelector(".edit-site-visual-editor")}domBody(){let t=null,e=this.isPostEditorIframe()?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector(".block-editor-writing-flow");return e&&this.isPostEditorIframe()&&(t=e.contentWindow.document.body),this.isSiteEditor()&&(e=document.querySelector('iframe[name="editor-canvas"]'),t=e.contentWindow.document.body),!e||this.isPostEditorIframe()||this.isSiteEditor()||(t=document.querySelector("body")),t}setPluginClass(t){this.bodyNodes.forEach((e=>{e.classList.add(t)}))}removePluginClass(t){this.bodyNodes.forEach((e=>{e.classList.remove(t)}))}setColor(t){t||(t="blue"),this.bodyNodes.forEach((e=>{e.style.setProperty("--wpbr--editor--shadow--color","var( --wpbr--color--"+t+" )"),e.style.setProperty("--wpbr--editor--shadow--color-hover","var( --wpbr--color--"+t+"-hover )")}))}setReveal(t){this.bodyNodes.forEach((e=>{t?e.classList.add("wp-block-revealer--reveal"):e.classList.remove("wp-block-revealer--reveal")}))}bodyNodeObserver(){let t=this.domBody();t&&new MutationObserver(((t,e)=>{for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=getComputedStyle(e.target).getPropertyValue("--wpbr--editor--shadow--color");this.colors.findColor(t)!==this.storage.getColor()&&this.setColor(this.storage.getColor()),!0!==this.storage.getReveal()||e.target.classList.contains("wp-block-revealer--reveal")||this.setReveal(this.storage.getReveal()),!1===this.storage.getReveal()&&e.target.classList.contains("wp-block-revealer--reveal")&&this.setReveal(this.storage.getReveal())}})).observe(t,{attributes:!0,childList:!1,subtree:!1})}keepChildAlive(t,e){setInterval((()=>{let o=null,i=document.querySelector(t);i&&(o=i.querySelector("#block-revealer-root")),o||i.appendChild(e)}),1200)}}},643:(t,e,o)=>{o.d(e,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>n});var i=o(87);const r=new(o(196).A),n=(0,i.vP)(r.getReveal()),s=(0,i.vP)(r.getColor())},102:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});var i=o(841),r=o(643);class n{constructor(){}bind(){let t=new i.default;[].forEach.call(t.getBodyNodes(),(t=>{t.addEventListener("keydown",(t=>{t.ctrlKey&&t.altKey&&82===t.keyCode&&(r.GlobalSignalReveal.value=!r.GlobalSignalReveal.value)}))})),document.body!==t.getBody()&&document.addEventListener("keydown",(t=>{t.ctrlKey&&t.altKey&&82===t.keyCode&&(r.GlobalSignalReveal.value=!r.GlobalSignalReveal.value)}))}}},196:(t,e,o)=>{o.d(e,{A:()=>r});var i=o(784);class r{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){(new i.A).getColors().indexOf(t)>-1&&(t="blue"),window.localStorage.setItem("wpbr_options__color",t)}setReveal(t){let e=!0===t?"true":"false";window.localStorage.setItem("wpbr_options__reveal",e)}}},286:(t,e)=>{Symbol.for("react.fragment")},20:(t,e,o)=>{var i=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},446:(t,e,o)=>{o(286)},848:(t,e,o)=>{o(20)},63:(t,e,o)=>{var i=o(609),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},n=i.useState,s=i.useEffect,a=i.useLayoutEffect,l=i.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var o=e();return!r(t,o)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var o=e(),i=n({inst:{value:o,getSnapshot:e}}),r=i[0].inst,c=i[1];return a((function(){r.value=o,r.getSnapshot=e,u(r)&&c({inst:r})}),[t,o,e]),s((function(){return u(r)&&c({inst:r}),t((function(){u(r)&&c({inst:r})}))}),[t]),l(o),o};e.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:c},888:(t,e,o)=>{t.exports=o(63)}}]);
  • wp-block-revealer/trunk/dist/431.js

    r3067676 r3067686  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[431,841,643],{87:(t,e,o)=>{o.d(e,{QZ:()=>S,vP:()=>f});var r=Symbol.for("preact-signals");function i(){if(l>1)l--;else{for(var t,e=!1;void 0!==s;){var o=s;for(s=void 0,a++;void 0!==o;){var r=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&d(o))try{o.c()}catch(o){e||(t=o,e=!0)}o=r}}if(a=0,l--,e)throw t}}var n=void 0,s=void 0,l=0,a=0,c=0;function u(t){if(void 0!==n){var e=t.n;if(void 0===e||e.t!==n)return e={i:0,S:t,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:e},void 0!==n.s&&(n.s.n=e),n.s=e,t.n=e,32&n.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=n.s,e.n=void 0,n.s.n=e,n.s=e),e}}function v(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function f(t){return new v(t)}function d(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function h(t){for(var e=t.s;void 0!==e;e=e.n){var o=e.S.n;if(void 0!==o&&(e.r=o),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function p(t){for(var e=t.s,o=void 0;void 0!==e;){var r=e.p;-1===e.i?(e.S.U(e),void 0!==r&&(r.n=e.n),void 0!==e.n&&(e.n.p=r)):o=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=r}t.s=o}function b(t){v.call(this,void 0),this.x=t,this.s=void 0,this.g=c-1,this.f=4}function y(t){var e=t.u;if(t.u=void 0,"function"==typeof e){l++;var o=n;n=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,g(t),e}finally{n=o,i()}}}function g(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,y(t)}function w(t){if(n!==this)throw new Error("Out-of-order effect");p(this),n=t,this.f&=-2,8&this.f&&g(this),i()}function m(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function S(t){var e=new m(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}v.prototype.brand=r,v.prototype.h=function(){return!0},v.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},v.prototype.U=function(t){if(void 0!==this.t){var e=t.e,o=t.x;void 0!==e&&(e.x=o,t.e=void 0),void 0!==o&&(o.e=e,t.x=void 0),t===this.t&&(this.t=o)}},v.prototype.subscribe=function(t){var e=this;return S((function(){var o=e.value,r=n;n=void 0;try{t(o)}finally{n=r}}))},v.prototype.valueOf=function(){return this.value},v.prototype.toString=function(){return this.value+""},v.prototype.toJSON=function(){return this.value},v.prototype.peek=function(){var t=n;n=void 0;try{return this.value}finally{n=t}},Object.defineProperty(v.prototype,"value",{get:function(){var t=u(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(a>100)throw new Error("Cycle detected");this.v=t,this.i++,c++,l++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{i()}}}}),(b.prototype=new v).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===c)return!0;if(this.g=c,this.f|=1,this.i>0&&!d(this))return this.f&=-2,!0;var t=n;try{h(this),n=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return n=t,p(this),this.f&=-2,!0},b.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}v.prototype.S.call(this,t)},b.prototype.U=function(t){if(void 0!==this.t&&(v.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},b.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(b.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=u(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),m.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},m.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,y(this),h(this),l++;var t=n;return n=this,w.bind(this,t)},m.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},m.prototype.d=function(){this.f|=8,1&this.f||g(this)};var _=o(609),E=o(888);o(848),o(446),new Map;var k,C=Symbol.for("react.element"),N=function(){},R=Symbol.dispose||Symbol.for("Symbol.dispose");function x(t,e){var o=e.effect.S();return k=e,O.bind(e,t,o)}function O(t,e){e(),k=t}({u:0,effect:{s:void 0,c:function(){},S:function(){return N},d:function(){}},subscribe:function(){return N},getSnapshot:function(){return 0},S:function(){},f:function(){}})[R]=function(){};var P,I=Promise.prototype.then.bind(Promise.resolve());Object.defineProperties(v.prototype,{$$typeof:{configurable:!0,value:C},type:{configurable:!0,value:function(t){var e=t.data,o=function(t){void 0===t&&(t=0),P||(P=I((function(){var t;P=void 0,null==(t=k)||t.f()})));var e=(0,_.useRef)();null==e.current&&(e.current=function(t){var e,o,r,i,n=0,s=S((function(){o=this}));return o.c=function(){n=n+1|0,i&&i()},(e={u:t,effect:o,subscribe:function(t){return i=t,function(){n=n+1|0,i=void 0,s()}},getSnapshot:function(){return n},S:function(){if(null!=k){var t=k.u,e=this.u;0==t&&0==e||0==t&&1==e?(k.f(),r=x(void 0,this)):1==t&&0==e||2==t&&0==e||(r=x(k,this))}else r=x(void 0,this)},f:function(){null==r||r(),r=void 0}})[R]=function(){this.f()},e}(t));var o=e.current;return(0,E.useSyncExternalStore)(o.subscribe,o.getSnapshot,o.getSnapshot),o.S(),o}(1);try{return e.value}finally{o.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}})},431:(t,e,o)=>{o.r(e),o.d(e,{default:()=>c});var r=o(609),i=(o(723),o(196)),n=o(643),s=o(87),l=o(841);function a(){const t=new i.A,e=new l.default,[o,a]=(0,r.useState)(!1),[c,u]=(0,r.useState)("blue"),[v,f]=(0,r.useState)(!1);function d(o){a(o),f(o),t.setReveal(o),e.setReveal(o),n.GlobalSignalReveal.value=o}function h(o){u(o),t.setColor(o),e.setColor(o),n.GlobalSignalColor.value=o}function p(t){t.preventDefault(),h(t.target.dataset.color)}(0,r.useEffect)((()=>{d(n.GlobalSignalColor.value),h(n.GlobalSignalColor.value)}),[]),(0,r.useEffect)((()=>{d(o),n.GlobalSignalReveal.value=o}),[o]),(0,r.useEffect)((()=>{h(c),n.GlobalSignalColor.value=c}),[c]),(0,s.QZ)((()=>{n.GlobalSignalColor.value!==c&&h(n.GlobalSignalColor.value),n.GlobalSignalReveal.value!==o&&d(n.GlobalSignalReveal.value)}));let b=o?"wp-block-revealer-options__toggle option-active":"wp-block-revealer-options__toggle",y=BlockRevealerVars.translations.reveal,g=BlockRevealerVars.translations.colors.blue,w=BlockRevealerVars.translations.colors.white,m=BlockRevealerVars.translations.colors.black;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("form",{className:"wp-block-revealer-options__form"},(0,r.createElement)("div",{className:b},(0,r.createElement)("input",{type:"checkbox",id:"wpbkr-toogle-reveal",name:"wpbkr-toogle",defaultChecked:v,onChange:function(t){d(t.target.checked)}}),(0,r.createElement)("label",{for:"wpbkr-toogle-reveal"},(0,r.createElement)("span",{className:"screen-reader-text"},y)),(0,r.createElement)("div",{className:"wp-block-revealer-options__color-swatch"},(0,r.createElement)("button",{"data-color":"blue",onClick:p,className:"wp-block-revealer-options__color wp-block-revealer-options__color--blue"},(0,r.createElement)("span",{className:"screen-reader-text"},g)),(0,r.createElement)("button",{"data-color":"white",onClick:p,className:"wp-block-revealer-options__color wp-block-revealer-options__color--white"},(0,r.createElement)("span",{className:"screen-reader-text"},w)),(0,r.createElement)("button",{"data-color":"black",onClick:p,className:"wp-block-revealer-options__color wp-block-revealer-options__color--black"},(0,r.createElement)("span",{className:"screen-reader-text"},m))),(0,r.createElement)("div",{className:"wp-block-revealer-options__indicator"}))))}function c(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-revealer-app"},(0,r.createElement)(a,null)))}},784:(t,e,o)=>{o.d(e,{A:()=>r});class r{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return this.colors}findColor(t){let e=this.colors;return Object.keys(e).forEach((o=>{if(t===e[o])return o})),""}}},841:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});var r=o(784),i=o(196);class n{constructor(){this.bodyNodes=this.getBodyNodes()}init({reveal:t=!1,color:e="blue"}){this.setPluginClass("wp-block-revealer"),this.setColor(e),this.setReveal(t),this.bodyNodeObserver(),this.storage=new i.A,this.colors=new r.A}getBodyNodes(){let t=[],e=this.domBody();return t.push(e),document.body!==e&&t.push(document.body),t}getBody(){return this.domBody()}isPostEditorIframe(){return!document.querySelector(".block-editor-writing-flow")}isSiteEditor(){return!!document.querySelector(".edit-site-visual-editor")}domBody(){let t=null,e=this.isPostEditorIframe()?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector(".block-editor-writing-flow");return e&&this.isPostEditorIframe()&&(t=e.contentWindow.document.body),this.isSiteEditor()&&(e=document.querySelector('iframe[name="editor-canvas"]'),t=e.contentWindow.document.body),!e||this.isPostEditorIframe()||this.isSiteEditor()||(t=document.querySelector("body")),t}setPluginClass(t){this.bodyNodes.forEach((e=>{e.classList.add(t)}))}removePluginClass(t){this.bodyNodes.forEach((e=>{e.classList.remove(t)}))}setColor(t){t||(t="blue"),this.bodyNodes.forEach((e=>{e.style.setProperty("--wpbr--editor--shadow--color","var( --wpbr--color--"+t+" )"),e.style.setProperty("--wpbr--editor--shadow--color-hover","var( --wpbr--color--"+t+"-hover )")}))}setReveal(t){this.bodyNodes.forEach((e=>{t?e.classList.add("wp-block-revealer--reveal"):e.classList.remove("wp-block-revealer--reveal")}))}bodyNodeObserver(){let t=this.domBody();t&&new MutationObserver(((t,e)=>{for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=getComputedStyle(e.target).getPropertyValue("--wpbr--editor--shadow--color");this.colors.findColor(t)!==this.storage.getColor()&&this.setColor(this.storage.getColor()),!0!==this.storage.getReveal()||e.target.classList.contains("wp-block-revealer--reveal")||this.setReveal(this.storage.getReveal()),!1===this.storage.getReveal()&&e.target.classList.contains("wp-block-revealer--reveal")&&this.setReveal(this.storage.getReveal())}})).observe(t,{attributes:!0,childList:!1,subtree:!1})}keepChildAlive(t,e){setInterval((()=>{let o=null,r=document.querySelector(t);r&&(o=r.querySelector("#block-revealer-root")),o||r.appendChild(e)}),1200)}}},643:(t,e,o)=>{o.d(e,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>n});var r=o(87);const i=new(o(196).A),n=(0,r.vP)(i.getReveal()),s=(0,r.vP)(i.getColor())},196:(t,e,o)=>{o.d(e,{A:()=>i});var r=o(784);class i{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){(new r.A).getColors().indexOf(t)>-1&&(t="blue"),window.localStorage.setItem("wpbr_options__color",t)}setReveal(t){let e=!0===t?"true":"false";window.localStorage.setItem("wpbr_options__reveal",e)}}},286:(t,e)=>{Symbol.for("react.fragment")},20:(t,e,o)=>{var r=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},446:(t,e,o)=>{o(286)},848:(t,e,o)=>{o(20)},63:(t,e,o)=>{var r=o(609),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},n=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var o=e();return!i(t,o)}catch(t){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var o=e(),r=n({inst:{value:o,getSnapshot:e}}),i=r[0].inst,u=r[1];return l((function(){i.value=o,i.getSnapshot=e,c(i)&&u({inst:i})}),[t,o,e]),s((function(){return c(i)&&u({inst:i}),t((function(){c(i)&&u({inst:i})}))}),[t]),a(o),o};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},888:(t,e,o)=>{t.exports=o(63)}}]);
     1"use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[431,841,643],{87:(t,e,o)=>{o.d(e,{QZ:()=>S,vP:()=>f});var r=Symbol.for("preact-signals");function i(){if(l>1)l--;else{for(var t,e=!1;void 0!==s;){var o=s;for(s=void 0,a++;void 0!==o;){var r=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&d(o))try{o.c()}catch(o){e||(t=o,e=!0)}o=r}}if(a=0,l--,e)throw t}}var n=void 0,s=void 0,l=0,a=0,c=0;function u(t){if(void 0!==n){var e=t.n;if(void 0===e||e.t!==n)return e={i:0,S:t,p:n.s,n:void 0,t:n,e:void 0,x:void 0,r:e},void 0!==n.s&&(n.s.n=e),n.s=e,t.n=e,32&n.f&&t.S(e),e;if(-1===e.i)return e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=n.s,e.n=void 0,n.s.n=e,n.s=e),e}}function v(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function f(t){return new v(t)}function d(t){for(var e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function h(t){for(var e=t.s;void 0!==e;e=e.n){var o=e.S.n;if(void 0!==o&&(e.r=o),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function p(t){for(var e=t.s,o=void 0;void 0!==e;){var r=e.p;-1===e.i?(e.S.U(e),void 0!==r&&(r.n=e.n),void 0!==e.n&&(e.n.p=r)):o=e,e.S.n=e.r,void 0!==e.r&&(e.r=void 0),e=r}t.s=o}function b(t){v.call(this,void 0),this.x=t,this.s=void 0,this.g=c-1,this.f=4}function y(t){var e=t.u;if(t.u=void 0,"function"==typeof e){l++;var o=n;n=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,g(t),e}finally{n=o,i()}}}function g(t){for(var e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,y(t)}function w(t){if(n!==this)throw new Error("Out-of-order effect");p(this),n=t,this.f&=-2,8&this.f&&g(this),i()}function m(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function S(t){var e=new m(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}v.prototype.brand=r,v.prototype.h=function(){return!0},v.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},v.prototype.U=function(t){if(void 0!==this.t){var e=t.e,o=t.x;void 0!==e&&(e.x=o,t.e=void 0),void 0!==o&&(o.e=e,t.x=void 0),t===this.t&&(this.t=o)}},v.prototype.subscribe=function(t){var e=this;return S((function(){var o=e.value,r=n;n=void 0;try{t(o)}finally{n=r}}))},v.prototype.valueOf=function(){return this.value},v.prototype.toString=function(){return this.value+""},v.prototype.toJSON=function(){return this.value},v.prototype.peek=function(){var t=n;n=void 0;try{return this.value}finally{n=t}},Object.defineProperty(v.prototype,"value",{get:function(){var t=u(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(a>100)throw new Error("Cycle detected");this.v=t,this.i++,c++,l++;try{for(var e=this.t;void 0!==e;e=e.x)e.t.N()}finally{i()}}}}),(b.prototype=new v).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===c)return!0;if(this.g=c,this.f|=1,this.i>0&&!d(this))return this.f&=-2,!0;var t=n;try{h(this),n=this;var e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return n=t,p(this),this.f&=-2,!0},b.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var e=this.s;void 0!==e;e=e.n)e.S.S(e)}v.prototype.S.call(this,t)},b.prototype.U=function(t){if(void 0!==this.t&&(v.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var e=this.s;void 0!==e;e=e.n)e.S.U(e)}},b.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(b.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=u(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),m.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var e=this.x();"function"==typeof e&&(this.u=e)}finally{t()}},m.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,y(this),h(this),l++;var t=n;return n=this,w.bind(this,t)},m.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},m.prototype.d=function(){this.f|=8,1&this.f||g(this)};var _=o(609),E=o(888);o(848),o(446),new Map;var k,C=Symbol.for("react.element"),N=function(){},R=Symbol.dispose||Symbol.for("Symbol.dispose");function x(t,e){var o=e.effect.S();return k=e,O.bind(e,t,o)}function O(t,e){e(),k=t}({u:0,effect:{s:void 0,c:function(){},S:function(){return N},d:function(){}},subscribe:function(){return N},getSnapshot:function(){return 0},S:function(){},f:function(){}})[R]=function(){};var P,I=Promise.prototype.then.bind(Promise.resolve());Object.defineProperties(v.prototype,{$$typeof:{configurable:!0,value:C},type:{configurable:!0,value:function(t){var e=t.data,o=function(t){void 0===t&&(t=0),P||(P=I((function(){var t;P=void 0,null==(t=k)||t.f()})));var e=(0,_.useRef)();null==e.current&&(e.current=function(t){var e,o,r,i,n=0,s=S((function(){o=this}));return o.c=function(){n=n+1|0,i&&i()},(e={u:t,effect:o,subscribe:function(t){return i=t,function(){n=n+1|0,i=void 0,s()}},getSnapshot:function(){return n},S:function(){if(null!=k){var t=k.u,e=this.u;0==t&&0==e||0==t&&1==e?(k.f(),r=x(void 0,this)):1==t&&0==e||2==t&&0==e||(r=x(k,this))}else r=x(void 0,this)},f:function(){null==r||r(),r=void 0}})[R]=function(){this.f()},e}(t));var o=e.current;return(0,E.useSyncExternalStore)(o.subscribe,o.getSnapshot,o.getSnapshot),o.S(),o}(1);try{return e.value}finally{o.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}})},431:(t,e,o)=>{o.r(e),o.d(e,{default:()=>c});var r=o(609),i=(o(723),o(196)),n=o(643),s=o(87),l=o(841);function a(){const t=new i.A,e=new l.default,[o,a]=(0,r.useState)(!1),[c,u]=(0,r.useState)("blue"),[v,f]=(0,r.useState)(!1);function d(o){a(o),f(o),t.setReveal(o),e.setReveal(o),n.GlobalSignalReveal.value=o}function h(o){u(o),t.setColor(o),e.setColor(o),n.GlobalSignalColor.value=o}function p(t){t.preventDefault(),h(t.target.dataset.color)}(0,r.useEffect)((()=>{d(n.GlobalSignalColor.value),h(n.GlobalSignalColor.value)}),[]),(0,r.useEffect)((()=>{d(o),n.GlobalSignalReveal.value=o}),[o]),(0,r.useEffect)((()=>{h(c),n.GlobalSignalColor.value=c}),[c]),(0,s.QZ)((()=>{n.GlobalSignalColor.value!==c&&h(n.GlobalSignalColor.value),n.GlobalSignalReveal.value!==o&&d(n.GlobalSignalReveal.value)}));let b=o?"wp-block-revealer-options__toggle option-active":"wp-block-revealer-options__toggle",y=BlockRevealerVars.translations.reveal,g=BlockRevealerVars.translations.colors.blue,w=BlockRevealerVars.translations.colors.white,m=BlockRevealerVars.translations.colors.black;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("form",{className:"wp-block-revealer-options__form"},(0,r.createElement)("div",{className:b},(0,r.createElement)("input",{type:"checkbox",id:"wpbkr-toogle-reveal",name:"wpbkr-toogle",defaultChecked:v,onChange:function(t){d(t.target.checked)}}),(0,r.createElement)("label",{for:"wpbkr-toogle-reveal"},(0,r.createElement)("span",{className:"screen-reader-text"},y)),(0,r.createElement)("div",{className:"wp-block-revealer-options__color-swatch"},(0,r.createElement)("button",{"data-color":"blue",onClick:p,className:"wp-block-revealer-options__color wp-block-revealer-options__color--blue"},(0,r.createElement)("span",{className:"screen-reader-text"},g)),(0,r.createElement)("button",{"data-color":"white",onClick:p,className:"wp-block-revealer-options__color wp-block-revealer-options__color--white"},(0,r.createElement)("span",{className:"screen-reader-text"},w)),(0,r.createElement)("button",{"data-color":"black",onClick:p,className:"wp-block-revealer-options__color wp-block-revealer-options__color--black"},(0,r.createElement)("span",{className:"screen-reader-text"},m))),(0,r.createElement)("div",{className:"wp-block-revealer-options__indicator"}))))}function c(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-revealer-app"},(0,r.createElement)(a,null)))}},784:(t,e,o)=>{o.d(e,{A:()=>r});class r{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return }findColor(t){let e=this.colors;return Object.keys(e).forEach((o=>{if(t===e[o])return o})),""}}},841:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});var r=o(784),i=o(196);class n{constructor(){this.bodyNodes=this.getBodyNodes()}init({reveal:t=!1,color:e="blue"}){this.setPluginClass("wp-block-revealer"),this.setColor(e),this.setReveal(t),this.bodyNodeObserver(),this.storage=new i.A,this.colors=new r.A}getBodyNodes(){let t=[],e=this.domBody();return t.push(e),document.body!==e&&t.push(document.body),t}getBody(){return this.domBody()}isPostEditorIframe(){return!document.querySelector(".block-editor-writing-flow")}isSiteEditor(){return!!document.querySelector(".edit-site-visual-editor")}domBody(){let t=null,e=this.isPostEditorIframe()?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector(".block-editor-writing-flow");return e&&this.isPostEditorIframe()&&(t=e.contentWindow.document.body),this.isSiteEditor()&&(e=document.querySelector('iframe[name="editor-canvas"]'),t=e.contentWindow.document.body),!e||this.isPostEditorIframe()||this.isSiteEditor()||(t=document.querySelector("body")),t}setPluginClass(t){this.bodyNodes.forEach((e=>{e.classList.add(t)}))}removePluginClass(t){this.bodyNodes.forEach((e=>{e.classList.remove(t)}))}setColor(t){t||(t="blue"),this.bodyNodes.forEach((e=>{e.style.setProperty("--wpbr--editor--shadow--color","var( --wpbr--color--"+t+" )"),e.style.setProperty("--wpbr--editor--shadow--color-hover","var( --wpbr--color--"+t+"-hover )")}))}setReveal(t){this.bodyNodes.forEach((e=>{t?e.classList.add("wp-block-revealer--reveal"):e.classList.remove("wp-block-revealer--reveal")}))}bodyNodeObserver(){let t=this.domBody();t&&new MutationObserver(((t,e)=>{for(let e of t)if("attributes"===e.type&&"class"===e.attributeName){let t=getComputedStyle(e.target).getPropertyValue("--wpbr--editor--shadow--color");this.colors.findColor(t)!==this.storage.getColor()&&this.setColor(this.storage.getColor()),!0!==this.storage.getReveal()||e.target.classList.contains("wp-block-revealer--reveal")||this.setReveal(this.storage.getReveal()),!1===this.storage.getReveal()&&e.target.classList.contains("wp-block-revealer--reveal")&&this.setReveal(this.storage.getReveal())}})).observe(t,{attributes:!0,childList:!1,subtree:!1})}keepChildAlive(t,e){setInterval((()=>{let o=null,r=document.querySelector(t);r&&(o=r.querySelector("#block-revealer-root")),o||r.appendChild(e)}),1200)}}},643:(t,e,o)=>{o.d(e,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>n});var r=o(87);const i=new(o(196).A),n=(0,r.vP)(i.getReveal()),s=(0,r.vP)(i.getColor())},196:(t,e,o)=>{o.d(e,{A:()=>i});var r=o(784);class i{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){(new r.A).getColors().indexOf(t)>-1&&(t="blue"),window.localStorage.setItem("wpbr_options__color",t)}setReveal(t){let e=!0===t?"true":"false";window.localStorage.setItem("wpbr_options__reveal",e)}}},286:(t,e)=>{Symbol.for("react.fragment")},20:(t,e,o)=>{var r=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},446:(t,e,o)=>{o(286)},848:(t,e,o)=>{o(20)},63:(t,e,o)=>{var r=o(609),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},n=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var o=e();return!i(t,o)}catch(t){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var o=e(),r=n({inst:{value:o,getSnapshot:e}}),i=r[0].inst,u=r[1];return l((function(){i.value=o,i.getSnapshot=e,c(i)&&u({inst:i})}),[t,o,e]),s((function(){return c(i)&&u({inst:i}),t((function(){c(i)&&u({inst:i})}))}),[t]),a(o),o};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},888:(t,e,o)=>{t.exports=o(63)}}]);
  • wp-block-revealer/trunk/dist/643.js

    r3067676 r3067686  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[643],{87:(t,i,o)=>{o.d(i,{QZ:()=>_,vP:()=>h});var r=Symbol.for("preact-signals");function n(){if(f>1)f--;else{for(var t,i=!1;void 0!==s;){var o=s;for(s=void 0,u++;void 0!==o;){var r=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&l(o))try{o.c()}catch(o){i||(t=o,i=!0)}o=r}}if(u=0,f--,i)throw t}}var e=void 0,s=void 0,f=0,u=0,c=0;function v(t){if(void 0!==e){var i=t.n;if(void 0===i||i.t!==e)return i={i:0,S:t,p:e.s,n:void 0,t:e,e:void 0,x:void 0,r:i},void 0!==e.s&&(e.s.n=i),e.s=i,t.n=i,32&e.f&&t.S(i),i;if(-1===i.i)return i.i=0,void 0!==i.n&&(i.n.p=i.p,void 0!==i.p&&(i.p.n=i.n),i.p=e.s,i.n=void 0,e.s.n=i,e.s=i),i}}function a(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function h(t){return new a(t)}function l(t){for(var i=t.s;void 0!==i;i=i.n)if(i.S.i!==i.i||!i.S.h()||i.S.i!==i.i)return!0;return!1}function d(t){for(var i=t.s;void 0!==i;i=i.n){var o=i.S.n;if(void 0!==o&&(i.r=o),i.S.n=i,i.i=-1,void 0===i.n){t.s=i;break}}}function p(t){for(var i=t.s,o=void 0;void 0!==i;){var r=i.p;-1===i.i?(i.S.U(i),void 0!==r&&(r.n=i.n),void 0!==i.n&&(i.n.p=r)):o=i,i.S.n=i.r,void 0!==i.r&&(i.r=void 0),i=r}t.s=o}function y(t){a.call(this,void 0),this.x=t,this.s=void 0,this.g=c-1,this.f=4}function S(t){var i=t.u;if(t.u=void 0,"function"==typeof i){f++;var o=e;e=void 0;try{i()}catch(i){throw t.f&=-2,t.f|=8,b(t),i}finally{e=o,n()}}}function b(t){for(var i=t.s;void 0!==i;i=i.n)i.S.U(i);t.x=void 0,t.s=void 0,S(t)}function w(t){if(e!==this)throw new Error("Out-of-order effect");p(this),e=t,this.f&=-2,8&this.f&&b(this),n()}function g(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function _(t){var i=new g(t);try{i.c()}catch(t){throw i.d(),t}return i.d.bind(i)}a.prototype.brand=r,a.prototype.h=function(){return!0},a.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},a.prototype.U=function(t){if(void 0!==this.t){var i=t.e,o=t.x;void 0!==i&&(i.x=o,t.e=void 0),void 0!==o&&(o.e=i,t.x=void 0),t===this.t&&(this.t=o)}},a.prototype.subscribe=function(t){var i=this;return _((function(){var o=i.value,r=e;e=void 0;try{t(o)}finally{e=r}}))},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return this.value+""},a.prototype.toJSON=function(){return this.value},a.prototype.peek=function(){var t=e;e=void 0;try{return this.value}finally{e=t}},Object.defineProperty(a.prototype,"value",{get:function(){var t=v(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(u>100)throw new Error("Cycle detected");this.v=t,this.i++,c++,f++;try{for(var i=this.t;void 0!==i;i=i.x)i.t.N()}finally{n()}}}}),(y.prototype=new a).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===c)return!0;if(this.g=c,this.f|=1,this.i>0&&!l(this))return this.f&=-2,!0;var t=e;try{d(this),e=this;var i=this.x();(16&this.f||this.v!==i||0===this.i)&&(this.v=i,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return e=t,p(this),this.f&=-2,!0},y.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var i=this.s;void 0!==i;i=i.n)i.S.S(i)}a.prototype.S.call(this,t)},y.prototype.U=function(t){if(void 0!==this.t&&(a.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var i=this.s;void 0!==i;i=i.n)i.S.U(i)}},y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=v(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),g.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var i=this.x();"function"==typeof i&&(this.u=i)}finally{t()}},g.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,S(this),d(this),f++;var t=e;return e=this,w.bind(this,t)},g.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},g.prototype.d=function(){this.f|=8,1&this.f||b(this)};var m=o(609),x=o(888);o(848),o(446),new Map;var E,O=Symbol.for("react.element"),C=function(){},k=Symbol.dispose||Symbol.for("Symbol.dispose");function R(t,i){var o=i.effect.S();return E=i,P.bind(i,t,o)}function P(t,i){i(),E=t}({u:0,effect:{s:void 0,c:function(){},S:function(){return C},d:function(){}},subscribe:function(){return C},getSnapshot:function(){return 0},S:function(){},f:function(){}})[k]=function(){};var I,N=Promise.prototype.then.bind(Promise.resolve());Object.defineProperties(a.prototype,{$$typeof:{configurable:!0,value:O},type:{configurable:!0,value:function(t){var i=t.data,o=function(t){void 0===t&&(t=0),I||(I=N((function(){var t;I=void 0,null==(t=E)||t.f()})));var i=(0,m.useRef)();null==i.current&&(i.current=function(t){var i,o,r,n,e=0,s=_((function(){o=this}));return o.c=function(){e=e+1|0,n&&n()},(i={u:t,effect:o,subscribe:function(t){return n=t,function(){e=e+1|0,n=void 0,s()}},getSnapshot:function(){return e},S:function(){if(null!=E){var t=E.u,i=this.u;0==t&&0==i||0==t&&1==i?(E.f(),r=R(void 0,this)):1==t&&0==i||2==t&&0==i||(r=R(E,this))}else r=R(void 0,this)},f:function(){null==r||r(),r=void 0}})[k]=function(){this.f()},i}(t));var o=i.current;return(0,x.useSyncExternalStore)(o.subscribe,o.getSnapshot,o.getSnapshot),o.S(),o}(1);try{return i.value}finally{o.f()}}},props:{configurable:!0,get:function(){return{data:this}}},ref:{configurable:!0,value:null}})},784:(t,i,o)=>{o.d(i,{A:()=>r});class r{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return this.colors}findColor(t){let i=this.colors;return Object.keys(i).forEach((o=>{if(t===i[o])return o})),""}}},643:(t,i,o)=>{o.d(i,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>e});var r=o(87);const n=new(o(196).A),e=(0,r.vP)(n.getReveal()),s=(0,r.vP)(n.getColor())},196:(t,i,o)=>{o.d(i,{A:()=>n});var r=o(784);class n{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){(new r.A).getColors().indexOf(t)>-1&&(t="blue"),window.localStorage.setItem("wpbr_options__color",t)}setReveal(t){let i=!0===t?"true":"false";window.localStorage.setItem("wpbr_options__reveal",i)}}},286:(t,i)=>{Symbol.for("react.fragment")},20:(t,i,o)=>{var r=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},446:(t,i,o)=>{o(286)},848:(t,i,o)=>{o(20)},63:(t,i,o)=>{var r=o(609),n="function"==typeof Object.is?Object.is:function(t,i){return t===i&&(0!==t||1/t==1/i)||t!=t&&i!=i},e=r.useState,s=r.useEffect,f=r.useLayoutEffect,u=r.useDebugValue;function c(t){var i=t.getSnapshot;t=t.value;try{var o=i();return!n(t,o)}catch(t){return!0}}var v="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,i){return i()}:function(t,i){var o=i(),r=e({inst:{value:o,getSnapshot:i}}),n=r[0].inst,v=r[1];return f((function(){n.value=o,n.getSnapshot=i,c(n)&&v({inst:n})}),[t,o,i]),s((function(){return c(n)&&v({inst:n}),t((function(){c(n)&&v({inst:n})}))}),[t]),u(o),o};i.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:v},888:(t,i,o)=>{t.exports=o(63)}}]);
     1"use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[643],{87:(t,i,o)=>{o.d(i,{QZ:()=>_,vP:()=>h});var r=Symbol.for("preact-signals");function n(){if(f>1)f--;else{for(var t,i=!1;void 0!==s;){var o=s;for(s=void 0,u++;void 0!==o;){var r=o.o;if(o.o=void 0,o.f&=-3,!(8&o.f)&&l(o))try{o.c()}catch(o){i||(t=o,i=!0)}o=r}}if(u=0,f--,i)throw t}}var e=void 0,s=void 0,f=0,u=0,c=0;function v(t){if(void 0!==e){var i=t.n;if(void 0===i||i.t!==e)return i={i:0,S:t,p:e.s,n:void 0,t:e,e:void 0,x:void 0,r:i},void 0!==e.s&&(e.s.n=i),e.s=i,t.n=i,32&e.f&&t.S(i),i;if(-1===i.i)return i.i=0,void 0!==i.n&&(i.n.p=i.p,void 0!==i.p&&(i.p.n=i.n),i.p=e.s,i.n=void 0,e.s.n=i,e.s=i),i}}function a(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function h(t){return new a(t)}function l(t){for(var i=t.s;void 0!==i;i=i.n)if(i.S.i!==i.i||!i.S.h()||i.S.i!==i.i)return!0;return!1}function d(t){for(var i=t.s;void 0!==i;i=i.n){var o=i.S.n;if(void 0!==o&&(i.r=o),i.S.n=i,i.i=-1,void 0===i.n){t.s=i;break}}}function p(t){for(var i=t.s,o=void 0;void 0!==i;){var r=i.p;-1===i.i?(i.S.U(i),void 0!==r&&(r.n=i.n),void 0!==i.n&&(i.n.p=r)):o=i,i.S.n=i.r,void 0!==i.r&&(i.r=void 0),i=r}t.s=o}function y(t){a.call(this,void 0),this.x=t,this.s=void 0,this.g=c-1,this.f=4}function S(t){var i=t.u;if(t.u=void 0,"function"==typeof i){f++;var o=e;e=void 0;try{i()}catch(i){throw t.f&=-2,t.f|=8,b(t),i}finally{e=o,n()}}}function b(t){for(var i=t.s;void 0!==i;i=i.n)i.S.U(i);t.x=void 0,t.s=void 0,S(t)}function w(t){if(e!==this)throw new Error("Out-of-order effect");p(this),e=t,this.f&=-2,8&this.f&&b(this),n()}function g(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function _(t){var i=new g(t);try{i.c()}catch(t){throw i.d(),t}return i.d.bind(i)}a.prototype.brand=r,a.prototype.h=function(){return!0},a.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},a.prototype.U=function(t){if(void 0!==this.t){var i=t.e,o=t.x;void 0!==i&&(i.x=o,t.e=void 0),void 0!==o&&(o.e=i,t.x=void 0),t===this.t&&(this.t=o)}},a.prototype.subscribe=function(t){var i=this;return _((function(){var o=i.value,r=e;e=void 0;try{t(o)}finally{e=r}}))},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return this.value+""},a.prototype.toJSON=function(){return this.value},a.prototype.peek=function(){var t=e;e=void 0;try{return this.value}finally{e=t}},Object.defineProperty(a.prototype,"value",{get:function(){var t=v(this);return void 0!==t&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(u>100)throw new Error("Cycle detected");this.v=t,this.i++,c++,f++;try{for(var i=this.t;void 0!==i;i=i.x)i.t.N()}finally{n()}}}}),(y.prototype=new a).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===c)return!0;if(this.g=c,this.f|=1,this.i>0&&!l(this))return this.f&=-2,!0;var t=e;try{d(this),e=this;var i=this.x();(16&this.f||this.v!==i||0===this.i)&&(this.v=i,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return e=t,p(this),this.f&=-2,!0},y.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(var i=this.s;void 0!==i;i=i.n)i.S.S(i)}a.prototype.S.call(this,t)},y.prototype.U=function(t){if(void 0!==this.t&&(a.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(var i=this.s;void 0!==i;i=i.n)i.S.U(i)}},y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;void 0!==t;t=t.x)t.t.N()}},Object.defineProperty(y.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=v(this);if(this.h(),void 0!==t&&(t.i=this.i),16&this.f)throw this.v;return this.v}}),g.prototype.c=function(){var t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var i=this.x();"function"==typeof i&&(this.u=i)}finally{t()}},g.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,S(this),d(this),f++;var t=e;return e=this,w.bind(this,t)},g.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},g.prototype.d=function(){this.f|=8,1&this.f||b(this)};var m=o(609),x=o(888);o(848),o(446),new Map;var E,O=Symbol.for("react.element"),C=function(){},k=Symbol.dispose||Symbol.for("Symbol.dispose");function R(t,i){var o=i.effect.S();return E=i,P.bind(i,t,o)}function P(t,i){i(),E=t}({u:0,effect:{s:void 0,c:function(){},S:function(){return C},d:function(){}},subscribe:function(){return C},getSnapshot:function(){return 0},S:function(){},f:function(){}})[k]=function(){};var }findColor(t){let i=this.colors;return Object.keys(i).forEach((o=>{if(t===i[o])return o})),""}}},643:(t,i,o)=>{o.d(i,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>e});var r=o(87);const n=new(o(196).A),e=(0,r.vP)(n.getReveal()),s=(0,r.vP)(n.getColor())},196:(t,i,o)=>{o.d(i,{A:()=>n});var r=o(784);class n{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){(new r.A).getColors().indexOf(t)>-1&&(t="blue"),window.localStorage.setItem("wpbr_options__color",t)}setReveal(t){let i=!0===t?"true":"false";window.localStorage.setItem("wpbr_options__reveal",i)}}},286:(t,i)=>{Symbol.for("react.fragment")},20:(t,i,o)=>{var r=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner},446:(t,i,o)=>{o(286)},848:(t,i,o)=>{o(20)},63:(t,i,o)=>{var r=o(609),n="function"==typeof Object.is?Object.is:function(t,i){return t===i&&(0!==t||1/t==1/i)||t!=t&&i!=i},e=r.useState,s=r.useEffect,f=r.useLayoutEffect,u=r.useDebugValue;function c(t){var i=t.getSnapshot;t=t.value;try{var o=i();return!n(t,o)}catch(t){return!0}}var v="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,i){return i()}:function(t,i){var o=i(),r=e({inst:{value:o,getSnapshot:i}}),n=r[0].inst,v=r[1];return f((function(){n.value=o,n.getSnapshot=i,c(n)&&v({inst:n})}),[t,o,i]),s((function(){return c(n)&&v({inst:n}),t((function(){c(n)&&v({inst:n})}))}),[t]),u(o),o};i.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:v},888:(t,i,o)=>{t.exports=o(63)}}]);
  • wp-block-revealer/trunk/dist/841.js

    r3067676 r3067686  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[841],{784:(e,t,o)=>{o.d(t,{A:()=>r});class r{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return this.colors}findColor(e){let t=this.colors;return Object.keys(t).forEach((o=>{if(e===t[o])return o})),""}}},841:(e,t,o)=>{o.r(t),o.d(t,{default:()=>l});var r=o(784),s=o(196);class l{constructor(){this.bodyNodes=this.getBodyNodes()}init({reveal:e=!1,color:t="blue"}){this.setPluginClass("wp-block-revealer"),this.setColor(t),this.setReveal(e),this.bodyNodeObserver(),this.storage=new s.A,this.colors=new r.A}getBodyNodes(){let e=[],t=this.domBody();return e.push(t),document.body!==t&&e.push(document.body),e}getBody(){return this.domBody()}isPostEditorIframe(){return!document.querySelector(".block-editor-writing-flow")}isSiteEditor(){return!!document.querySelector(".edit-site-visual-editor")}domBody(){let e=null,t=this.isPostEditorIframe()?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector(".block-editor-writing-flow");return t&&this.isPostEditorIframe()&&(e=t.contentWindow.document.body),this.isSiteEditor()&&(t=document.querySelector('iframe[name="editor-canvas"]'),e=t.contentWindow.document.body),!t||this.isPostEditorIframe()||this.isSiteEditor()||(e=document.querySelector("body")),e}setPluginClass(e){this.bodyNodes.forEach((t=>{t.classList.add(e)}))}removePluginClass(e){this.bodyNodes.forEach((t=>{t.classList.remove(e)}))}setColor(e){e||(e="blue"),this.bodyNodes.forEach((t=>{t.style.setProperty("--wpbr--editor--shadow--color","var( --wpbr--color--"+e+" )"),t.style.setProperty("--wpbr--editor--shadow--color-hover","var( --wpbr--color--"+e+"-hover )")}))}setReveal(e){this.bodyNodes.forEach((t=>{e?t.classList.add("wp-block-revealer--reveal"):t.classList.remove("wp-block-revealer--reveal")}))}bodyNodeObserver(){let e=this.domBody();e&&new MutationObserver(((e,t)=>{for(let t of e)if("attributes"===t.type&&"class"===t.attributeName){let e=getComputedStyle(t.target).getPropertyValue("--wpbr--editor--shadow--color");this.colors.findColor(e)!==this.storage.getColor()&&this.setColor(this.storage.getColor()),!0!==this.storage.getReveal()||t.target.classList.contains("wp-block-revealer--reveal")||this.setReveal(this.storage.getReveal()),!1===this.storage.getReveal()&&t.target.classList.contains("wp-block-revealer--reveal")&&this.setReveal(this.storage.getReveal())}})).observe(e,{attributes:!0,childList:!1,subtree:!1})}keepChildAlive(e,t){setInterval((()=>{let o=null,r=document.querySelector(e);r&&(o=r.querySelector("#block-revealer-root")),o||r.appendChild(t)}),1200)}}},196:(e,t,o)=>{o.d(t,{A:()=>s});var r=o(784);class s{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(e){(new r.A).getColors().indexOf(e)>-1&&(e="blue"),window.localStorage.setItem("wpbr_options__color",e)}setReveal(e){let t=!0===e?"true":"false";window.localStorage.setItem("wpbr_options__reveal",t)}}}}]);
     1"use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[841],{784:(e,t,o)=>{o.d(t,{A:()=>r});class r{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}getColors(){return }findColor(e){let t=this.colors;return Object.keys(t).forEach((o=>{if(e===t[o])return o})),""}}},841:(e,t,o)=>{o.r(t),o.d(t,{default:()=>l});var r=o(784),s=o(196);class l{constructor(){this.bodyNodes=this.getBodyNodes()}init({reveal:e=!1,color:t="blue"}){this.setPluginClass("wp-block-revealer"),this.setColor(t),this.setReveal(e),this.bodyNodeObserver(),this.storage=new s.A,this.colors=new r.A}getBodyNodes(){let e=[],t=this.domBody();return e.push(t),document.body!==t&&e.push(document.body),e}getBody(){return this.domBody()}isPostEditorIframe(){return!document.querySelector(".block-editor-writing-flow")}isSiteEditor(){return!!document.querySelector(".edit-site-visual-editor")}domBody(){let e=null,t=this.isPostEditorIframe()?document.querySelector('iframe[name="editor-canvas"]'):document.querySelector(".block-editor-writing-flow");return t&&this.isPostEditorIframe()&&(e=t.contentWindow.document.body),this.isSiteEditor()&&(t=document.querySelector('iframe[name="editor-canvas"]'),e=t.contentWindow.document.body),!t||this.isPostEditorIframe()||this.isSiteEditor()||(e=document.querySelector("body")),e}setPluginClass(e){this.bodyNodes.forEach((t=>{t.classList.add(e)}))}removePluginClass(e){this.bodyNodes.forEach((t=>{t.classList.remove(e)}))}setColor(e){e||(e="blue"),this.bodyNodes.forEach((t=>{t.style.setProperty("--wpbr--editor--shadow--color","var( --wpbr--color--"+e+" )"),t.style.setProperty("--wpbr--editor--shadow--color-hover","var( --wpbr--color--"+e+"-hover )")}))}setReveal(e){this.bodyNodes.forEach((t=>{e?t.classList.add("wp-block-revealer--reveal"):t.classList.remove("wp-block-revealer--reveal")}))}bodyNodeObserver(){let e=this.domBody();e&&new MutationObserver(((e,t)=>{for(let t of e)if("attributes"===t.type&&"class"===t.attributeName){let e=getComputedStyle(t.target).getPropertyValue("--wpbr--editor--shadow--color");this.colors.findColor(e)!==this.storage.getColor()&&this.setColor(this.storage.getColor()),!0!==this.storage.getReveal()||t.target.classList.contains("wp-block-revealer--reveal")||this.setReveal(this.storage.getReveal()),!1===this.storage.getReveal()&&t.target.classList.contains("wp-block-revealer--reveal")&&this.setReveal(this.storage.getReveal())}})).observe(e,{attributes:!0,childList:!1,subtree:!1})}keepChildAlive(e,t){setInterval((()=>{let o=null,r=document.querySelector(e);r&&(o=r.querySelector("#block-revealer-root")),o||r.appendChild(t)}),1200)}}},196:(e,t,o)=>{o.d(t,{A:()=>s});var r=o(784);class s{constructor(){}getColor(){return null===window.localStorage.getItem("wpbr_options__color")?"blue":window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(e){(new r.A).getColors().indexOf(e)>-1&&(e="blue"),window.localStorage.setItem("wpbr_options__color",e)}setReveal(e){let t=!0===e?"true":"false";window.localStorage.setItem("wpbr_options__reveal",t)}}}}]);
  • wp-block-revealer/trunk/package.json

    r3067676 r3067686  
    66    "watch": "wp-scripts start src/block-revealer.js --output-path=dist --webpack-devtool=eval-source-map",
    77    "build": "wp-scripts build src/block-revealer.js --output-path=dist --webpack-devtool=eval-source-map --mode=production",
    8     "playground" : "npx @wp-now/wp-now start --php=8.1 --blueprint=blueprint.json"
     8    "playground" : "npx @wp-now/wp-now start",
     9    "blueprint" : "npx @wp-now/wp-now start --php=8.1 --blueprint=blueprint.json"
    910  },
    1011  "keywords": [],
  • wp-block-revealer/trunk/readme.txt

    r3067676 r3067686  
    55Requires at least: 5.9
    66Tested up to: 6.5
    7 Stable tag: 1.9.1
     7Stable tag: 1.9.
    88Requires PHP: 7.0
    99License: GPLv2
     
    2525
    2626== Changelog ==
     27
     28
     29
    2730
    2831= 1.9.1 =
  • wp-block-revealer/trunk/src/js/Colors.js

    r3067676 r3067686  
    1313
    1414    getColors(){
    15         return this.colors ;
     15
     16        // return colors object to array
     17        return Object.values( this.colors ) ;
    1618    }
    1719
  • wp-block-revealer/trunk/wp-block-revealer.php

    r3067676 r3067686  
    44Plugin URI:   https://maxpertici.fr#block-revealer
    55Description:  Reveal blocks of Gutenberg Editor (Keyboard shortcut available : Ctrl + Alt + R).
    6 Version:      1.9.1
     6Version:      1.9.
    77Author:       @maxpertici
    88Author URI:   https://maxpertici.fr
Note: See TracChangeset for help on using the changeset viewer.