🔒 EXCLUSIVE: Changeset/ - High Quality

Changeset 3067676


Ignore:
Timestamp:
04/09/2024 01:01:15 PM (21 months ago)
Author:
maxpertici
Message:

Block Revealer / trunk / 1.9.1

Location:
wp-block-revealer/trunk
Files:
2 added
11 edited

Legend:

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

    r3065257 r3067676  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[102,264,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(){},N=Symbol.dispose||Symbol.for("Symbol.dispose");function O(t,e){var o=e.effect.S();return _=e,P.bind(e,t,o)}function P(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(){}})[N]=function(){};var x,L=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),x||(x=L((function(){var t;x=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=O(void 0,this)):1==t&&0==e||2==t&&0==e||(i=O(_,this))}else i=O(void 0,this)},f:function(){null==i||i(),i=void 0}})[N]=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}})},264:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});class i{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}findColor(t){let e=this.colors;return Object.keys(e).forEach((o=>{if(t===e[o])return o})),""}}var 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}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(264),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:()=>i});class i{constructor(){}getColor(){return window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){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 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)}}]);
  • wp-block-revealer/trunk/dist/431.js

    r3065257 r3067676  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[431,264,643],{87:(t,e,o)=>{o.d(e,{QZ:()=>w,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 m(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 S(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function w(t){var e=new S(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 w((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}}),S.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()}},S.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,m.bind(this,t)},S.prototype.N=function(){2&this.f||(this.f|=2,this.o=s,s=this)},S.prototype.d=function(){this.f|=8,1&this.f||g(this)};var E=o(609),k=o(888);o(848),o(446),new Map;var _,C=Symbol.for("react.element"),N=function(){},R=Symbol.dispose||Symbol.for("Symbol.dispose");function x(t,e){var o=e.effect.S();return _=e,O.bind(e,t,o)}function O(t,e){e(),_=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,B=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=B((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,r,i,n=0,s=w((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!=_){var t=_.u,e=this.u;0==t&&0==e||0==t&&1==e?(_.f(),r=x(void 0,this)):1==t&&0==e||2==t&&0==e||(r=x(_,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,k.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(264);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,m=BlockRevealerVars.translations.colors.white,S=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"},m)),(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"},S))),(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)))}},264:(t,e,o)=>{o.r(e),o.d(e,{default:()=>n});class r{constructor(){this.colors={blue:"#1989c1",white:"#b1b1b1",black:"#444343"}}findColor(t){let e=this.colors;return Object.keys(e).forEach((o=>{if(t===e[o])return o})),""}}var 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}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:()=>r});class r{constructor(){}getColor(){return window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){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 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)}}]);
  • wp-block-revealer/trunk/dist/643.js

    r3065257 r3067676  
    1 "use strict";(globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[]).push([[643],{87:(t,i,o)=>{o.d(i,{QZ:()=>_,vP:()=>a});var n=Symbol.for("preact-signals");function r(){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 n=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=n}}if(u=0,f--,i)throw t}}var e=void 0,s=void 0,f=0,u=0,v=0;function c(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 h(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function a(t){return new h(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 n=i.p;-1===i.i?(i.S.U(i),void 0!==n&&(n.n=i.n),void 0!==i.n&&(i.n.p=n)):o=i,i.S.n=i.r,void 0!==i.r&&(i.r=void 0),i=n}t.s=o}function y(t){h.call(this,void 0),this.x=t,this.s=void 0,this.g=v-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,r()}}}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),r()}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)}h.prototype.brand=n,h.prototype.h=function(){return!0},h.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)},h.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)}},h.prototype.subscribe=function(t){var i=this;return _((function(){var o=i.value,n=e;e=void 0;try{t(o)}finally{e=n}}))},h.prototype.valueOf=function(){return this.value},h.prototype.toString=function(){return this.value+""},h.prototype.toJSON=function(){return this.value},h.prototype.peek=function(){var t=e;e=void 0;try{return this.value}finally{e=t}},Object.defineProperty(h.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(u>100)throw new Error("Cycle detected");this.v=t,this.i++,v++,f++;try{for(var i=this.t;void 0!==i;i=i.x)i.t.N()}finally{r()}}}}),(y.prototype=new h).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===v)return!0;if(this.g=v,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)}h.prototype.S.call(this,t)},y.prototype.U=function(t){if(void 0!==this.t&&(h.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=c(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(){},R=Symbol.dispose||Symbol.for("Symbol.dispose");function P(t,i){var o=i.effect.S();return E=i,k.bind(i,t,o)}function k(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(){}})[R]=function(){};var N,U=Promise.prototype.then.bind(Promise.resolve());Object.defineProperties(h.prototype,{$$typeof:{configurable:!0,value:O},type:{configurable:!0,value:function(t){var i=t.data,o=function(t){void 0===t&&(t=0),N||(N=U((function(){var t;N=void 0,null==(t=E)||t.f()})));var i=(0,m.useRef)();null==i.current&&(i.current=function(t){var i,o,n,r,e=0,s=_((function(){o=this}));return o.c=function(){e=e+1|0,r&&r()},(i={u:t,effect:o,subscribe:function(t){return r=t,function(){e=e+1|0,r=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(),n=P(void 0,this)):1==t&&0==i||2==t&&0==i||(n=P(E,this))}else n=P(void 0,this)},f:function(){null==n||n(),n=void 0}})[R]=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}})},643:(t,i,o)=>{o.d(i,{GlobalSignalColor:()=>s,GlobalSignalReveal:()=>e});var n=o(87);const r=new(o(196).A),e=(0,n.vP)(r.getReveal()),s=(0,n.vP)(r.getColor())},196:(t,i,o)=>{o.d(i,{A:()=>n});class n{constructor(){}getColor(){return window.localStorage.getItem("wpbr_options__color")}getReveal(){return"true"===window.localStorage.getItem("wpbr_options__reveal")}setColor(t){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 n=o(609);Symbol.for("react.element"),Symbol.for("react.fragment"),Object.prototype.hasOwnProperty,n.__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 n=o(609),r="function"==typeof Object.is?Object.is:function(t,i){return t===i&&(0!==t||1/t==1/i)||t!=t&&i!=i},e=n.useState,s=n.useEffect,f=n.useLayoutEffect,u=n.useDebugValue;function v(t){var i=t.getSnapshot;t=t.value;try{var o=i();return!r(t,o)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,i){return i()}:function(t,i){var o=i(),n=e({inst:{value:o,getSnapshot:i}}),r=n[0].inst,c=n[1];return f((function(){r.value=o,r.getSnapshot=i,v(r)&&c({inst:r})}),[t,o,i]),s((function(){return v(r)&&c({inst:r}),t((function(){v(r)&&c({inst:r})}))}),[t]),u(o),o};i.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},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 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)}}]);
  • wp-block-revealer/trunk/dist/block-revealer.asset.php

    r3065257 r3067676  
    1 <?php return array('dependencies' => array('react', 'wp-i18n'), 'version' => 'be995d5e10278984806d');
     1<?php return array('dependencies' => array('react', 'wp-i18n'), 'version' => '538bd266d85f183295fb');
  • wp-block-revealer/trunk/dist/block-revealer.js

    r3065257 r3067676  
    1 (()=>{"use strict";var e,t,r={609:e=>{e.exports=window.React},723:e=>{e.exports=window.wp.i18n}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="block-revealer:",n.l=(r,o,a,i)=>{if(e[r])e[r].push(o);else{var l,c;if(void 0!==a)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var s=u[d];if(s.getAttribute("src")==r||s.getAttribute("data-webpack")==t+a){l=s;break}}l||(c=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+a),l.src=r),e[r]=[o];var p=(t,o)=>{l.onerror=l.onload=null,clearTimeout(m);var n=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),t)return t(o)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={421:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=a);var i=n.p+n.u(t),l=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,a,[i,l,c]=r,u=0;if(i.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);c&&c(n)}for(t&&t(r);u<i.length;u++)a=i[u],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),document.addEventListener("DOMContentLoaded",(async()=>{await async function(){if(await((e="")=>new Promise(((t,r)=>{!function r(o){null===document.querySelector(e)?new Promise((e=>setTimeout(e,100))).then((()=>{r(o+1)})):t(!0)}(0)})))(".editor-document-tools__left"),await((e=[])=>new Promise(((t,r)=>{!function r(o){e.every((e=>window.hasOwnProperty(e)))?t(!0):new Promise((e=>setTimeout(e,100))).then((()=>{r(o+1)}))}(0)})))(["React","ReactDOM"]),document.querySelector(".edit-site-layout"))return;const e=new(0,(await n.e(264).then(n.bind(n,264))).default),t=document.createElement("div");t.id="block-revealer-root";const r=document.querySelector(".editor-document-tools__left").parentNode.appendChild(t),o=(await n.e(431).then(n.bind(n,431))).default,a=window.React;let i=null;if(18<=parseInt(a.version.split(".")[0])){const{createRoot:e}=window.ReactDOM;e(r).render(a.createElement(o)),i=document.querySelector("#block-revealer-root")}else ReactDOM.render(a.createElement(o),r),i=document.querySelector("#block-revealer-root");e.keepChildAlive(".editor-document-tools__left",i);const{GlobalSignalReveal:l,GlobalSignalColor:c}=await n.e(643).then(n.bind(n,643));e.init({reveal:l.value,color:c.value}),(new(0,(await n.e(102).then(n.bind(n,102))).default)).bind()}()}))})();
     1(()=>{"use strict";var e,t,r={609:e=>{e.exports=window.React},723:e=>{e.exports=window.wp.i18n}},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="block-revealer:",n.l=(r,o,a,i)=>{if(e[r])e[r].push(o);else{var l,c;if(void 0!==a)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var s=u[d];if(s.getAttribute("src")==r||s.getAttribute("data-webpack")==t+a){l=s;break}}l||(c=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,n.nc&&l.setAttribute("nonce",n.nc),l.setAttribute("data-webpack",t+a),l.src=r),e[r]=[o];var p=(t,o)=>{l.onerror=l.onload=null,clearTimeout(m);var n=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),t)return t(o)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={421:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=a);var i=n.p+n.u(t),l=new Error;n.l(i,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var a=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,a,[i,l,c]=r,u=0;if(i.some((t=>0!==e[t]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);c&&c(n)}for(t&&t(r);u<i.length;u++)a=i[u],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=globalThis.webpackChunkblock_revealer=globalThis.webpackChunkblock_revealer||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),document.addEventListener("DOMContentLoaded",(async()=>{await async function(){if(await((e="")=>new Promise(((t,r)=>{!function r(o){null===document.querySelector(e)?new Promise((e=>setTimeout(e,100))).then((()=>{r(o+1)})):t(!0)}(0)})))(".editor-document-tools__left"),await((e=[])=>new Promise(((t,r)=>{!function r(o){e.every((e=>window.hasOwnProperty(e)))?t(!0):new Promise((e=>setTimeout(e,100))).then((()=>{r(o+1)}))}(0)})))(["React","ReactDOM"]),document.querySelector(".edit-site-layout"))return;const e=new(0,(await n.e(841).then(n.bind(n,841))).default),t=document.createElement("div");t.id="block-revealer-root";const r=document.querySelector(".editor-document-tools__left").parentNode.appendChild(t),o=(await n.e(431).then(n.bind(n,431))).default,a=window.React;let i=null;if(18<=parseInt(a.version.split(".")[0])){const{createRoot:e}=window.ReactDOM;e(r).render(a.createElement(o)),i=document.querySelector("#block-revealer-root")}else ReactDOM.render(a.createElement(o),r),i=document.querySelector("#block-revealer-root");e.keepChildAlive(".editor-document-tools__left",i);const{GlobalSignalReveal:l,GlobalSignalColor:c}=await n.e(643).then(n.bind(n,643));e.init({reveal:l.value,color:c.value}),(new(0,(await n.e(102).then(n.bind(n,102))).default)).bind()}()}))})();
  • wp-block-revealer/trunk/package-lock.json

    r3065254 r3067676  
    2222        "@wordpress/i18n": "^4.54.0",
    2323        "@wordpress/scripts": "^26.15.0",
     24        "@wp-now/wp-now": "^0.1.66",
    2425        "react": "^18.2.0",
    2526        "react-dom": "^18.2.0"
     
    25732574      }
    25742575    },
     2576    "node_modules/@php-wasm/node": {
     2577      "version": "0.6.7",
     2578      "resolved": "https://registry.npmjs.org/@php-wasm/node/-/node-0.6.7.tgz",
     2579      "integrity": "sha512-NksbEZRXAJxmlcclx36Fbg6tfb5SNNInnFPeWfaFGPSt8Kol7UY27t38RQyKUVipMjNVIYfi0zAczaS3BPSanA==",
     2580      "dev": true,
     2581      "dependencies": {
     2582        "@php-wasm/node-polyfills": "0.6.7",
     2583        "@php-wasm/universal": "0.6.7",
     2584        "@php-wasm/util": "0.6.7",
     2585        "comlink": "^4.4.1",
     2586        "express": "4.18.2",
     2587        "ws": "8.13.0",
     2588        "yargs": "17.7.2"
     2589      },
     2590      "engines": {
     2591