siteplane 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astro/index.js +1 -1
- package/dist/astro/route.js +1 -1
- package/dist/bin/siteplane.js +1 -1
- package/dist/internal/bridge.js +1 -1
- package/dist/route.js +1 -1
- package/package.json +1 -1
package/dist/astro/index.js
CHANGED
|
@@ -1070,7 +1070,7 @@ function readSiteId(payload) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
|
|
1072
1072
|
// src/version.ts
|
|
1073
|
-
var PACKAGE_VERSION = "0.3.
|
|
1073
|
+
var PACKAGE_VERSION = "0.3.10";
|
|
1074
1074
|
|
|
1075
1075
|
// src/astro/build-images.ts
|
|
1076
1076
|
import { mkdir, readdir, readFile, rename, rm, writeFile } from "fs/promises";
|
package/dist/astro/route.js
CHANGED
|
@@ -144,7 +144,7 @@ function readSiteId(payload) {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// src/version.ts
|
|
147
|
-
var PACKAGE_VERSION = "0.3.
|
|
147
|
+
var PACKAGE_VERSION = "0.3.10";
|
|
148
148
|
|
|
149
149
|
// src/astro/route.ts
|
|
150
150
|
var embeddable = { httpOnly: true, secure: true, sameSite: "none", partitioned: true, path: "/" };
|
package/dist/bin/siteplane.js
CHANGED
|
@@ -21597,7 +21597,7 @@ async function contentRestoreCommand(deps, input) {
|
|
|
21597
21597
|
|
|
21598
21598
|
// src/version.ts
|
|
21599
21599
|
init_esm_shims();
|
|
21600
|
-
var PACKAGE_VERSION = "0.3.
|
|
21600
|
+
var PACKAGE_VERSION = "0.3.10";
|
|
21601
21601
|
|
|
21602
21602
|
// src/bin/run-siteplane.ts
|
|
21603
21603
|
var usage = [
|
package/dist/internal/bridge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! Contains the decoder of @vercel/stega 1.1.0 (source: https://www.npmjs.com/package/@vercel/stega), subject to the terms of the Mozilla Public License, v. 2.0. A copy of the licence is at https://mozilla.org/MPL/2.0/. */
|
|
2
|
-
var
|
|
2
|
+
var Y=/^[A-Za-z][A-Za-z0-9_-]*/u,Q=/^\[_key=="([a-z][a-z0-9]{7})"\]/u,ee=/^\[(0|[1-9][0-9]{0,8})\]/u;function D(e){let n="";for(let t of e)"field"in t?n+=n===""?t.field:`.${t.field}`:"key"in t?n+=`[_key=="${t.key}"]`:n+=`[${t.index}]`;return n}function I(e){if(typeof e!="string"||e.length>512)return null;let n=[],t=e;for(;t.length>0;){if(t.startsWith("[")){let u=Q.exec(t),o=u?null:ee.exec(t);if(u)n.push({key:u[1]});else if(o)n.push({index:Number(o[1])});else return null;t=t.slice((u??o)[0].length);continue}if(n.length>0){if(!t.startsWith("."))return null;t=t.slice(1)}let r=Y.exec(t);if(!r)return null;n.push({field:r[0]}),t=t.slice(r[0].length)}return n}var te="abcdefghijklmnopqrstuvwxyz",ge=`${te}0123456789`;function k(e){return ne(e)?e.type==="siteplane:refresh"?{type:"siteplane:refresh"}:e.type==="siteplane:highlight"&&(e.fieldId===null||H(e.fieldId))?{type:"siteplane:highlight",fieldId:e.fieldId}:e.type==="siteplane:outline-all"&&typeof e.on=="boolean"&&Array.isArray(e.hidden)&&e.hidden.length<=500&&e.hidden.every(H)?{type:"siteplane:outline-all",on:e.on,hidden:[...e.hidden]}:null:null}function ne(e){return typeof e=="object"&&e!==null}function H(e){return typeof e=="string"&&e.length>0&&e.length<=512}var j={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},_={0:8203,1:8204,2:8205,3:65279},re={0:String.fromCodePoint(_[0]),1:String.fromCodePoint(_[1]),2:String.fromCodePoint(_[2]),3:String.fromCodePoint(_[3])},$=new Array(4).fill(String.fromCodePoint(_[0])).join(""),F="\0";var O=Object.fromEntries(Object.entries(re).map(e=>[e[1],+e[0]])),G=Object.fromEntries(Object.entries(j).map(e=>e.reverse())),oe=`${Object.values(j).map(e=>`\\u{${e.toString(16)}}`).join("")}`,R=new RegExp(`[${oe}]{4,}`,"gu");function W(e){let n=e.match(R);if(n)return ie(n[0],!0)[0]}function ie(e,n=!1){let t=Array.from(e),r=1/0,u=-1;for(let o=0;o<t.length;++o)t[o]===$[0]&&t[o+1]===$[1]&&t[o+2]===$[2]&&t[o+3]===$[3]&&(r=Math.min(r,o),u=Math.max(u,o));if(u===-1)return se(t,n);for(let o=r;o<=u;++o)if(!((t.length-o)%4))try{let g=t.slice(o+4),p=new Uint8Array(g.length/4);for(let f=0;f<p.length;f++)p[f]=O[g[f*4]]<<6|O[g[f*4+1]]<<4|O[g[f*4+2]]<<2|O[g[f*4+3]];let c=new TextDecoder().decode(p);if(n){let f=c.indexOf(F);return f===-1&&(f=c.length),[JSON.parse(c.slice(0,f))]}return c.split(F).filter(Boolean).map(f=>JSON.parse(f))}catch{}return[]}function se(e,n){var t;let r=[];for(let p=e.length*.5;p--;){let c=`${G[e[p*2].codePointAt(0)]}${G[e[p*2+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(c,16)))}let u=[],o=[r.join("")],g=10;for(;o.length;){let p=o.shift();try{if(u.push(JSON.parse(p)),n)return u}catch(c){if(!g--)throw c;let f=+((t=c.message.match(/\sposition\s(\d+)$/))==null?void 0:t[1]);if(!f)throw c;o.unshift(p.substring(0,f),p.substring(f))}}return u}function le(e,n,t){let r=Math.floor((e+t)/(n+t)),u=(e-r*n)/(r-1),o=(e-(r+1)*n)/r;return o<=0||Math.abs(u-t)<Math.abs(o-t)?u:o}function V(e,n,t){if(e<=n*2)return[[0,e]];let r=n+le(e,n,t),u=[];for(let o=0;o<e-.01;o+=r)u.push([o,Math.min(o+n,e)]);return u}function ue(e){return e>=3?{dash:e*2,gap:e}:{dash:e*3,gap:e*2}}function X(e){let n=null,t=null,r=null,u="",o=0;function g(){if(!r||!n||!t)return;if(!r.isConnected)return p();let c=window.devicePixelRatio||1,f=r.getBoundingClientRect(),E=Number.parseFloat(getComputedStyle(r).borderTopLeftRadius)||0,w=[f.left,f.top,f.width,f.height,E,c].join();if(w!==u){u=w;let y=Math.round(4*c),M=Math.max(1,Math.round(2*c)),v=Math.round(f.left*c)-y,T=Math.round(f.top*c)-y,b=Math.round(f.right*c)+y,A=Math.round(f.bottom*c)+y,{dash:x,gap:i}=ue(M),s=M/2,d=t.style;if(d.strokeWidth=`${M}px`,E>0){let[a,m]=[b-v-M,A-T-M],l=Math.min(E*c+y-s,a/2,m/2),h=2*(a+m)-8*l+2*Math.PI*l,S=Math.max(1,Math.round(h/(x+i)));d.strokeDasharray=`${x}px ${Math.max(0,h/S-x)}px`,t.setAttribute("d",`M${v+s+l} ${T+s}h${a-2*l}a${l} ${l} 0 0 1 ${l} ${l}v${m-2*l}a${l} ${l} 0 0 1 ${-l} ${l}h${2*l-a}a${l} ${l} 0 0 1 ${-l} ${-l}v${2*l-m}a${l} ${l} 0 0 1 ${l} ${-l}z`)}else{d.strokeDasharray="none";let a=V(b-v,x,i),m=V(A-T,x,i);t.setAttribute("d",[T+s,A-s].map(l=>a.map(([h,S])=>`M${v+h} ${l}H${v+S}`).join("")).join("")+[v+s,b-s].map(l=>m.map(([h,S])=>`M${l} ${T+h}V${T+S}`).join("")).join(""))}t.style.transform=`scale(${1/c})`}o=requestAnimationFrame(g)}function p(){r=null,u="",cancelAnimationFrame(o),n&&(n.style.display="none")}return{element:()=>r,hide:p,remove(){p(),n?.remove(),n=null},show(c){let{borderBottomLeftRadius:f,borderBottomRightRadius:E,borderTopLeftRadius:w,borderTopRightRadius:y}=getComputedStyle(c);if(!(new Set([w,y,E,f]).size===1&&!/[% ]/u.test(w))||c.getClientRects().length!==1||c.closest("dialog, [popover]"))return!1;if(p(),!n){n=document.createElementNS("http://www.w3.org/2000/svg","svg"),t=document.createElementNS("http://www.w3.org/2000/svg","path"),n.setAttribute("aria-hidden","true"),n.append(t);let T=[["position","fixed"],["inset","0"],["width","100vw"],["height","100vh"],["max-width","none"],["margin","0"],["overflow","visible"],["pointer-events","none"],["z-index","2147483647"]];for(let[b,A]of T)n.style.setProperty(b,A);t.style.setProperty("fill","none"),t.style.setProperty("stroke",e),t.style.setProperty("transform-origin","0 0")}return n.isConnected||document.documentElement.append(n),n.style.display="block",r=c,g(),!0}}}var J="data-siteplane-field",L="data-siteplane-selected",ae="2px solid #2563eb",U="#2563eb",ce=`2px dashed ${U}`,fe="1px dashed #2563eb",de="1px dashed rgb(110 110 110 / 0.35)",q="script, style, noscript, template",me=256,pe=500;function Me(e){let n=e.parent??(window.parent===window?null:window.parent);if(!n)return()=>{};let t=new Map,r=new Map,u=null,o=null,g="",p,c=X(U),f=i=>n.postMessage(i,e.editorOrigin);function E(i,s){if(s===null){let d=t.get(i);if(!d)return;let a=r.get(i);if(a){i.style.outline=a,i.style.outlineOffset="2px";return}i.style.outline=d.outline,i.style.outlineOffset=d.outlineOffset,t.delete(i);return}t.has(i)||t.set(i,{outline:i.style.outline,outlineOffset:i.style.outlineOffset}),i.style.outline=s,i.style.outlineOffset="2px"}function w(){for(let a of document.querySelectorAll(`[${L}]`))a.removeAttribute(L),E(a,null);if(o===null)return;let i=o,s=a=>a===i||a.startsWith(`${i}.`)||a.startsWith(`${i}[`),d=new Set;N({text:(a,m)=>{m.some(s)&&a.parentElement instanceof HTMLElement&&d.add(a.parentElement)},element:(a,m)=>{m.some(s)&&a instanceof HTMLElement&&d.add(a)}});for(let a of d)a===c.element()&&c.hide(),a.setAttribute(L,""),E(a,ae)}function y(){let i=new Map;if(u){let{hidden:d}=u,a=(m,l)=>{if(!(m instanceof HTMLElement))return;let h=l.every(S=>{let P=z(S);return P!==null&&d.has(P)});(!i.has(m)||!h)&&i.set(m,h?de:fe)};N({text:(m,l)=>a(m.parentElement,l),element:(m,l)=>a(m,l)})}let s=[...r.keys()];r.clear();for(let[d,a]of i)r.set(d,a);for(let d of s)!r.has(d)&&!d.hasAttribute(L)&&E(d,null);for(let[d,a]of r)!d.hasAttribute(L)&&d!==c.element()&&E(d,a)}function M(){let i=new Set,s=l=>{for(let h of l){let S=z(h);S&&i.add(S)}};N({text:(l,h)=>s(h),element:(l,h)=>s(h)});let d=[...i].slice(0,pe),a=e.path(),m=JSON.stringify([a,d]);m!==g&&(g=m,f({type:"siteplane:page",version:1,path:a,fields:d}))}function v(i){for(let s=i instanceof Element?i:null;s&&s!==document.documentElement;s=s.parentElement){let d=he(s)??Z(s);if(d)return{path:d,element:s}}return null}function T(i){let s=v(i.target);s&&(i.preventDefault(),i.stopPropagation(),f({type:"siteplane:select",version:1,fieldId:s.path}))}function b(i){let s=v(i.target)?.element;if(!(!(s instanceof HTMLElement)||s.hasAttribute(L))){if(i.type==="mouseover"){s!==c.element()&&E(s,c.show(s)?"none":ce);return}s===c.element()&&c.hide(),E(s,null)}}function A(i){if(i.origin!==e.editorOrigin||i.source!==n)return;let s=k(i.data);s?.type==="siteplane:refresh"&&e.refresh(),s?.type==="siteplane:highlight"&&(o=s.fieldId,w(),u&&y()),s?.type==="siteplane:outline-all"&&(u=s.on?{hidden:new Set(s.hidden)}:null,y())}let x=new MutationObserver(()=>{clearTimeout(p),p=setTimeout(()=>{M(),o!==null&&w(),u&&y()},150)});return document.addEventListener("click",T,!0),document.addEventListener("mouseover",b),document.addEventListener("mouseout",b),window.addEventListener("message",A),x.observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributeFilter:["alt",J]}),M(),()=>{clearTimeout(p),x.disconnect(),document.removeEventListener("click",T,!0),document.removeEventListener("mouseover",b),document.removeEventListener("mouseout",b),window.removeEventListener("message",A),o=null,u=null,r.clear(),c.remove(),w();for(let i of[...t.keys()])E(i,null)}}function N(e){if(!document.body)return;let n=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:t=>t instanceof Element&&t.matches(q)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(let t=n.nextNode();t;t=n.nextNode()){if(t instanceof Text){let o=C(t.data);o.length>0&&e.text(t,o);continue}let r=t,u=[K(r),Z(r)].filter(o=>o!==null);u.length>0&&e.element(r,u)}}function he(e){let n=K(e);if(n)return n;if(e.closest(q))return null;for(let t of e.childNodes)if(t instanceof Text){let r=C(t.data)[0];if(r)return r}return null}function K(e){return e instanceof HTMLImageElement?C(e.getAttribute("alt")??"")[0]??null:null}function Z(e){let n=e.getAttribute(J);return n&&I(n)?n:null}function C(e){let n=e.match(new RegExp(R.source,"gu"));return n?n.flatMap(t=>{let r;try{r=W(t)}catch{return[]}return typeof r=="string"&&I(r)?[r]:[]}):[]}function z(e){let n=I(e)??[],t=n.findIndex(o=>!("field"in o)),r=t===-1?n:n.slice(0,t);if(r.length<2)return null;let u=D(r);return u.length<=me?u:null}export{Me as startBridge};
|
package/dist/route.js
CHANGED
|
@@ -288,7 +288,7 @@ function readSiteId(payload) {
|
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
// src/version.ts
|
|
291
|
-
var PACKAGE_VERSION = "0.3.
|
|
291
|
+
var PACKAGE_VERSION = "0.3.10";
|
|
292
292
|
|
|
293
293
|
// src/route.ts
|
|
294
294
|
var embeddable = { httpOnly: true, secure: true, sameSite: "none", partitioned: true, path: "/" };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "siteplane",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.10",
|
|
5
5
|
"description": "Siteplane for Next.js and Astro websites: content from Siteplane, Draft Mode preview, Booking and the siteplane CLI.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|