@panphora/clayjs 1.20.0 → 1.22.0
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/all.js +1 -1
- package/dist/clay-dom.js +1 -1
- package/dist/clay-events.js +1 -1
- package/dist/clay-internals.js +1 -1
- package/dist/clay-options.js +1 -1
- package/dist/clay-router.js +1 -1
- package/dist/clay-ui.js +1 -1
- package/dist/clay-utils.js +1 -1
- package/dist/clay.js +1 -1
- package/dist/clay.standalone.js +7865 -8022
- package/dist/m/{c-JOH753EJ.js → c-26KVJS6J.js} +1 -1
- package/dist/m/{c-ZE46QDIH.js → c-3TLG3OLG.js} +1 -1
- package/dist/m/{c-RT3C74GY.js → c-4OGEVKR3.js} +1 -1
- package/dist/m/{c-Y33LUUIQ.js → c-4PHDUV3H.js} +1 -1
- package/dist/m/{c-SJPD46ZO.js → c-4RFZROCF.js} +4 -4
- package/dist/m/{c-XQSXKIKM.js → c-4TWARTLS.js} +1 -1
- package/dist/m/{c-S5IEIZCN.js → c-5AQYL27I.js} +1 -1
- package/dist/m/{c-OJYM642Q.js → c-5FKRZNJV.js} +1 -1
- package/dist/m/{c-CJFDLD43.js → c-6KBKYLPO.js} +1 -1
- package/dist/m/{c-DHXPDLW6.js → c-6PBXRWDX.js} +1 -1
- package/dist/m/{c-BRLCTNMC.js → c-6RC66MYY.js} +1 -1
- package/dist/m/{c-PIVIYLTY.js → c-6UEFPHHE.js} +1 -1
- package/dist/m/{c-YQUJ74R3.js → c-BV6FQQXM.js} +1 -1
- package/dist/m/{c-YSB6JKV2.js → c-DEAFCHDO.js} +2 -2
- package/dist/m/{c-NLZ5AN4L.js → c-DKFSOJCV.js} +1 -1
- package/dist/m/c-DP4X4JID.js +1 -0
- package/dist/m/{c-LIBE4HPD.js → c-DZBZ57EE.js} +1 -1
- package/dist/m/c-ECY5AZMH.js +1 -0
- package/dist/m/{c-VAK7SG37.js → c-EUGJVHDD.js} +1 -1
- package/dist/m/{c-GPGYKER7.js → c-F5AER2ID.js} +1 -1
- package/dist/m/{c-RG6XUZFA.js → c-FAXQU7MQ.js} +1 -1
- package/dist/m/{c-XD5MOROJ.js → c-FLBUYV3P.js} +1 -1
- package/dist/m/{c-NFR673TL.js → c-FMCPQ4VT.js} +2 -2
- package/dist/m/{c-VBLFAQD2.js → c-FNIGX4FI.js} +1 -1
- package/dist/m/{c-BTLFLLML.js → c-FWFJUU3T.js} +1 -1
- package/dist/m/{c-2VB555FG.js → c-GPTKI7AQ.js} +1 -1
- package/dist/m/{c-EZ7B5AZT.js → c-GY4ODHO2.js} +1 -1
- package/dist/m/{c-5734MF2P.js → c-H6DXQEH2.js} +1 -1
- package/dist/m/{c-Z32V4MHK.js → c-HAVGDXAL.js} +1 -1
- package/dist/m/{c-D3E4WJ4M.js → c-HDWZEJHM.js} +49 -32
- package/dist/m/{c-W23KVGUO.js → c-HWR6GMGK.js} +1 -1
- package/dist/m/{c-BJ7YQ5QZ.js → c-IHUWUKIU.js} +1 -1
- package/dist/m/{c-AL4RBJF2.js → c-ILGQ3UXQ.js} +1 -1
- package/dist/m/{c-W3K23S72.js → c-IWTTOC2V.js} +1 -1
- package/dist/m/c-JFST6QE7.js +1 -0
- package/dist/m/{c-FNVQAACK.js → c-KE33W4RE.js} +1 -1
- package/dist/m/c-KV7R47FR.js +1 -0
- package/dist/m/{c-LPUJXRXW.js → c-L7K5EXU2.js} +1 -1
- package/dist/m/{c-3YH6JSIL.js → c-LF6HNVPU.js} +1 -1
- package/dist/m/{c-MIL4B2JQ.js → c-MRURHLKV.js} +1 -1
- package/dist/m/{c-LQU7TXIH.js → c-N33TPVTL.js} +1 -1
- package/dist/m/{c-EOCZ2YVL.js → c-NBNRLZXO.js} +1 -1
- package/dist/m/{c-JUE7B4OX.js → c-NLWEZYKJ.js} +1 -1
- package/dist/m/{c-DDDOKPI6.js → c-NNNR7OXA.js} +1 -1
- package/dist/m/{c-E4IBSAQM.js → c-OI2BYWVV.js} +1 -1
- package/dist/m/{c-SBSMJIPC.js → c-P3WATEDR.js} +1 -1
- package/dist/m/{c-ZJLU56DV.js → c-PCEMXY2K.js} +1 -1
- package/dist/m/{c-3GJ4XARY.js → c-PWBJVHA4.js} +1 -1
- package/dist/m/{c-67ILSNPR.js → c-Q5KAQJAG.js} +1 -1
- package/dist/m/{c-U5X57T4L.js → c-QHVCUTJV.js} +1 -1
- package/dist/m/{c-GKEATME6.js → c-QJFYVCJO.js} +1 -1
- package/dist/m/{c-VY6XRBOW.js → c-QTC6VGA4.js} +1 -1
- package/dist/m/{c-44B5ODN7.js → c-TMT5TL65.js} +2 -2
- package/dist/m/{c-OABVRYOT.js → c-TV7JHSRL.js} +1 -1
- package/dist/m/{c-SO63UGPQ.js → c-UWT4CXQ4.js} +1 -1
- package/dist/m/{c-EFD6QNTE.js → c-VFES2BP5.js} +1 -1
- package/dist/m/{c-UXEVJ63W.js → c-VIW5X35H.js} +1 -1
- package/dist/m/{c-EOCKLMKX.js → c-WWE67K5Y.js} +1 -1
- package/dist/m/{c-J3BXFTZS.js → c-XDVAZDUE.js} +1 -1
- package/dist/m/{c-K76AUL4I.js → c-XZJ5IK6Q.js} +1 -1
- package/dist/m/{c-2ZZBC45O.js → c-Z7RJANGO.js} +1 -1
- package/dist/m/{c-I2IFKJX2.js → c-ZAHTFCXQ.js} +1 -1
- package/dist/m/{c-GVPNDIKJ.js → c-ZKELCT4T.js} +1 -1
- package/dist/m/{c-7SXYQCN4.js → c-ZO6VL2SC.js} +1 -1
- package/dist/m/{c-M4FSPNQ2.js → c-ZYEJLZEY.js} +1 -1
- package/dist/m/core/{autosave-VPORYJSE.js → autosave-GI3WNJYN.js} +1 -1
- package/dist/m/core/{conflict-notice-JMAZLVRX.js → conflict-notice-CEI3XY6A.js} +1 -1
- package/dist/m/core/{save-AOJBDSOK.js → save-OJ5NSLS7.js} +1 -1
- package/dist/m/core/{save-core-IOCMXO5L.js → save-core-DX3RFVO3.js} +1 -1
- package/dist/m/core/{unsaved-warning-U5VUJFOE.js → unsaved-warning-HGYH7O4H.js} +1 -1
- package/dist/m/internals/{index-HDRANDWE.js → index-V4WC44FU.js} +1 -1
- package/dist/m/loader-V6VI46HU.js +1 -0
- package/dist/m/{manifest-3AEF5191.js → manifest-83C18DED.js} +1 -1
- package/dist/m/{manifest-edit-29A26F22.js → manifest-edit-B28C1985.js} +1 -1
- package/dist/m/manifest.json +567 -567
- package/dist/m/page/{editor-EY2WAAGB.js → editor-BQEPCJLG.js} +2 -2
- package/dist/m/plugins/ai-edit-45A2J6LC.js +6 -0
- package/dist/m/plugins/cms-IFTKWF4S.js +2235 -0
- package/dist/m/plugins/{derive-FRE5JJQE.js → derive-QVI3LI3A.js} +1 -1
- package/dist/m/plugins/{indicator-4VDXWYTD.js → indicator-IPZJ35K6.js} +1 -1
- package/dist/m/plugins/{live-5EZN2EYP.js → live-GPQXSXSM.js} +1 -1
- package/dist/m/plugins/menu-UN3KRCOF.js +1 -0
- package/dist/m/plugins/{page-LVW5DWA4.js → page-BAVLWCP6.js} +2 -2
- package/dist/m/plugins/{page-view-5KQ76IJB.js → page-view-P3UGJFDZ.js} +1 -1
- package/dist/m/plugins/{people-C7TVBBMR.js → people-Z4RGVQAV.js} +1 -1
- package/dist/m/plugins/{quickcrop-BQ5YYFCH.js → quickcrop-E34PUYA3.js} +2 -2
- package/dist/m/plugins/{richclay-KLGETK77.js → richclay-S4NVJYIK.js} +2 -2
- package/dist/m/plugins/{source-CCEUM3OR.js → source-KVN6YNTY.js} +1 -1
- package/dist/m/plugins/{upgrade-NW556WJD.js → upgrade-KTSICB22.js} +1 -1
- package/dist/m/plugins/{wire-VRYPY6EJ.js → wire-SYVIBNSE.js} +1 -1
- package/dist/m/{reader-core-2GXY7SHY.js → reader-core-RUIFH32Y.js} +2 -2
- package/dist/m/sync/{live-sync-SKPMFYOO.js → live-sync-RGQMMWK2.js} +1 -1
- package/dist/m/ui/{index-QNIPDHXQ.js → index-EZGLEM5P.js} +1 -1
- package/dist/m/vendor/{sap-core.vendor-RN4ZVY4X.js → sap-core.vendor-OA5SKL7Q.js} +1 -1
- package/dist/offline-manifest.json +463 -469
- package/docs/guide.md +16 -8
- package/entries/sap.js +1 -1
- package/package.json +2 -2
- package/src/loader-logic.js +4 -1
- package/src/plugins/ai-edit.js +6 -17
- package/src/plugins/cms.js +3 -6
- package/src/plugins/menu/style.js +59 -31
- package/src/plugins/menu.js +131 -28
- package/src/ui/bevel.js +1 -1
- package/src/ui/skins/cms.js +1 -1
- package/src/ui/skins/quickcrop.js +1 -1
- package/src/ui/skins/richclay.js +1 -1
- package/src/vendor/hypercms.vendor.js +16 -69
- package/src/vendor/sap-core.vendor.js +1 -1
- package/dist/m/c-FSWRGBVQ.js +0 -1
- package/dist/m/c-HMYWIHFG.js +0 -1
- package/dist/m/c-M6FNQCTQ.js +0 -1
- package/dist/m/c-WFMRX5RZ.js +0 -1
- package/dist/m/loader-DZZLUBVB.js +0 -1
- package/dist/m/plugins/ai-edit-J5VLSW5I.js +0 -6
- package/dist/m/plugins/cms-LRAOZHT7.js +0 -2293
- package/dist/m/plugins/menu-KGWKT6CS.js +0 -1
- package/src/ui/skins/cms-toggle.js +0 -15
- /package/dist/m/plugins/{quickcrop-BQ5YYFCH.js.LEGAL.txt → quickcrop-E34PUYA3.js.LEGAL.txt} +0 -0
- /package/dist/m/plugins/{richclay-KLGETK77.js.LEGAL.txt → richclay-S4NVJYIK.js.LEGAL.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as be,b as we}from"../c-D3E4WJ4M.js";import{a as K}from"../c-AQLFEATB.js";import{b as ye}from"../c-QY7F6EN6.js";import{b as he,c as ge}from"../c-RVMWGXEJ.js";import{d as me}from"../c-MHI3GYKF.js";import{a as pe,b as fe}from"../c-RHMPKZZ7.js";import{a as de}from"../c-VKEDWYDF.js";import{b as te,c as ne,f as ie,g as ue}from"../c-3O7OBDCM.js";import"../c-BPF2NSPV.js";import"../c-P7KNDG34.js";import"../c-CYWLPPUS.js";import"../c-N7JPUPGC.js";import"../c-HA6INT6J.js";import"../c-ICMAOOGK.js";import"../c-WRBKEJD4.js";import"../c-VHNSBD2M.js";var ve='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-45.87 -57.96 100.26 60.98" fill="currentColor" aria-hidden="true" focusable="false"><path fill-rule="evenodd" d="M44.35 -4.56Q40.03 -0.52 34.69 -0.39Q29.34 -0.25 24.81 -0.14Q20.27 -0.02 15.6 0Q10.93 0.02 6.41 0Q1.89 -0.02 -2.79 -0.02Q-7.48 -0.02 -12.11 -0.14Q-16.73 -0.25 -21.64 -0.27Q-26.55 -0.3 -31.72 -2.25Q-36.88 -4.2 -39.87 -9.12Q-42.87 -14.03 -42.8 -19.61Q-42.74 -25.18 -40.43 -29.94Q-38.12 -34.69 -34.82 -38.78Q-31.52 -42.87 -27.25 -45.6Q-22.98 -48.33 -18.35 -50.59Q-13.73 -52.85 -8.7 -53.88Q-3.68 -54.91 1.32 -54.93Q6.32 -54.96 11.44 -54.56Q16.55 -54.16 21.35 -52.2Q26.16 -50.24 30.69 -48.01Q35.22 -45.78 38.99 -42.18Q42.76 -38.59 45.67 -34.37Q48.59 -30.15 49.99 -24.87Q51.39 -19.59 50.04 -14.09Q48.68 -8.6 44.35 -4.56ZM0.66 -30.49C0.5 -28.73 -0.88 -27.42 -2.42 -27.57C-3.96 -27.71 -5.08 -29.25 -4.91 -31.01C-4.75 -32.77 -3.36 -34.08 -1.83 -33.94C-0.29 -33.79 0.83 -32.25 0.66 -30.49ZM13.61 -29.28C13.44 -27.52 12.06 -26.21 10.52 -26.35C8.98 -26.5 7.87 -28.04 8.03 -29.8C8.2 -31.56 9.58 -32.87 11.12 -32.73C12.66 -32.58 13.77 -31.04 13.61 -29.28ZM-1.23 -17.71Q-0.62 -17.35 -0.03 -17.08Q0.56 -16.81 1.15 -16.54Q1.73 -16.28 2.4 -16Q3.07 -15.72 3.87 -15.6Q4.66 -15.48 5.4 -15.55Q6.13 -15.62 6.77 -15.79Q7.41 -15.96 7.97 -16.23Q8.53 -16.5 9 -16.91Q9.46 -17.32 9.73 -17.9Q9.99 -18.47 10.08 -19.12Q10.17 -19.77 10.08 -20.42Q9.99 -21.06 9.45 -21.32Q8.91 -21.58 8.27 -21.38Q7.63 -21.17 6.99 -20.91Q6.36 -20.65 5.7 -20.61Q5.04 -20.56 4.33 -20.73Q3.62 -20.9 2.92 -21.14Q2.23 -21.39 1.54 -21.68Q0.85 -21.97 0.16 -22.27Q-0.52 -22.56 -1.22 -22.79Q-1.92 -23.03 -2.49 -22.61Q-3.05 -22.19 -3.23 -21.5Q-3.4 -20.81 -3.2 -20.09Q-3.01 -19.38 -3.02 -19.15Q-3.02 -18.93 -2.42 -18.5Q-1.83 -18.06 -1.23 -17.71Z"/></svg>';var Ee=new Set(["top-left","top-right","bottom-left","bottom-right"]),Ue=4,xe="menu-corner";function Be(e,n,c,y){return`${n<y/2?"top":"bottom"}-${e<c/2?"left":"right"}`}function Ie(e,n){let[c,y]=e.split("-");if(n==="ArrowUp")c="top";else if(n==="ArrowDown")c="bottom";else if(n==="ArrowLeft")y="left";else if(n==="ArrowRight")y="right";else return null;return`${c}-${y}`}function _e(e){let n=null;try{n=e?e.get(xe):null}catch{}return Ee.has(n)?n:"top-right"}function He(e){let n=document.createElement("div");n.className="clay-menu-spots",n.setAttribute("clay","editor-ui"),n.setAttribute("aria-hidden","true");for(let c of Ee){let y=document.createElement("span");y.className="clay-menu-spot",y.dataset.to=c,n.append(y)}return e.append(n),n}function ke({dock:e,container:n=document.body,grip:c,storage:y,onMove:C,onDragStart:R}){function i(r,{remember:d=!0}={}){if(e.dataset.corner=r,d)try{y&&y.set(xe,r)}catch{}C&&C(r)}i(_e(y),{remember:!1}),c.addEventListener("keydown",r=>{let d=Ie(e.dataset.corner,r.key);d&&(r.preventDefault(),d!==e.dataset.corner&&i(d))});let o=null;c.addEventListener("pointerdown",r=>{if(r.button!==0||r.isPrimary===!1)return;let d=e.getBoundingClientRect();if(o={id:r.pointerId,x:r.clientX,y:r.clientY,dx:r.clientX-d.left,dy:r.clientY-d.top,w:d.width,h:d.height,moving:!1,spots:null,near:null},c.setPointerCapture)try{c.setPointerCapture(r.pointerId)}catch{}}),c.addEventListener("pointermove",r=>{if(!o||r.pointerId!==o.id)return;if(!o.moving){if(Math.hypot(r.clientX-o.x,r.clientY-o.y)<Ue)return;o.moving=!0,e.setAttribute("data-dragging",""),o.spots=He(n),o.spots.style.setProperty("color-scheme",getComputedStyle(e).colorScheme),R&&R()}let d=r.clientX-o.dx,E=r.clientY-o.dy;Object.assign(e.style,{left:`${d}px`,top:`${E}px`,right:"auto",bottom:"auto"}),o.near=Be(d+o.w/2,E+o.h/2,window.innerWidth,window.innerHeight);for(let k of o.spots.children)k.toggleAttribute("data-near",k.dataset.to===o.near)});let h=r=>d=>{if(!o||d.pointerId!==o.id)return;let{moving:E,near:k,spots:s}=o;if(o=null,!!E){s.remove(),e.removeAttribute("data-dragging");for(let u of["left","top","right","bottom"])e.style.removeProperty(u);r&&k?i(k):i(e.dataset.corner,{remember:!1})}};return c.addEventListener("pointerup",h(!0)),c.addEventListener("pointercancel",h(!1)),c.addEventListener("lostpointercapture",h(!1)),{setCorner:i}}var Ae=()=>/mac|iphone|ipad|ipod/i.test(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||navigator.userAgent||""),Ve=()=>/Win/.test(navigator.userAgentData&&navigator.userAgentData.platform||navigator.platform||navigator.userAgent||""),Ce=()=>Ae()?"Show in Finder":Ve()?"Show in Explorer":"Show in folder",F=(e,n)=>Ae()?e:n;var z="menu-resume",We=5e3,O=()=>window.clay||{},Se=()=>O().storage&&O().storage.session,oe=e=>{let n=O().editPlugins;return Array.isArray(n)&&n.includes(e)};function Le(e,n=We){return new Promise(c=>{let y=Date.now(),C=()=>{let R=e();R||Date.now()-y>=n?c(R||null):setTimeout(C,50)};C()})}function Qe({addItem:e,note:n,currentMode:c}){let y=new Map;async function C(s,u){if(c()==="edit")return u();let Q=Se();Q&&Q.set(z,s);let A;try{A=await O().setMode?.("edit")}catch(M){A={ok:!1,message:M&&M.message}}if(!(A&&A.ok!==!1&&A.reloading)){if(Q&&Q.remove(z),!A||A.ok===!1){let M=A?K(A):"Couldn't switch modes.";M&&n(M);return}return u()}}function R(s,u){return y.set(s,u),()=>C(s,u)}let i={canUndo:!1,canRedo:!1},o=!1;function h(){if(!oe("undo"))return;let s=c()==="edit"&&O().undo;!o&&s&&typeof s.canUndo=="boolean"&&(i={canUndo:s.canUndo,canRedo:!!s.canRedo}),e({id:"clay.undo",pair:[{id:"clay.undo.undo",label:"Undo",keys:F("\u2318Z","Ctrl+Z"),disabled:!(s&&i.canUndo),run:()=>O().undo?.undo()},{id:"clay.undo.redo",label:"Redo",keys:F("\u2318\u21E7Z","Ctrl+Shift+Z"),disabled:!(s&&i.canRedo),run:()=>O().undo?.redo()}]})}document.addEventListener("clay:undo-change",s=>{let u=s.detail||{};o=!0,i={canUndo:!!u.canUndo,canRedo:!!u.canRedo},h()}),document.addEventListener("clay:modechange",h),h(),oe("ai-edit")&&e({id:"clay.ai",label:"Ask AI\u2026",keys:F("\u2318J","Ctrl+J"),run:R("ai",async()=>{let s=await Le(()=>O().aiEdit);s&&await s.open(document.body)||n("Ask AI isn't available on this page right now.")})}),oe("cms")&&O().cms?.hasRules?.(document)&&e({id:"clay.cms",label:"Open the CMS (Edit content)",run:R("cms",async()=>{let s=await Le(()=>O().cms),u=null;try{u=s?await s.open():{ok:!1}}catch{u={ok:!1}}u&&u.ok===!1&&n("Couldn't open the CMS. Try again.")})}),e({id:"clay.download",label:"Download a copy",run:async()=>{let s=null;try{if(typeof O().getHTML=="function")s=O().getHTML();else{let u=await fetch(location.href,{cache:"no-store",credentials:"same-origin"});u.ok&&(s=await u.text())}}catch{}typeof s=="string"&&/^https?:$/.test(location.protocol)&&(s=s.replace(/(^|[^\w./:-])\/_\/uploads\//g,`$1${location.origin}/_/uploads/`)),(typeof s!="string"||!await fe({html:s,name:`${pe()}.html`}))&&n("Couldn't build the download. Try again.")}});async function r(s){let u=null;try{let Q=await fetch(s,{method:"POST",credentials:"same-origin",headers:{"Document-URL":location.href}});if(u=await Q.json().catch(()=>null),Q.ok&&u?.ok!==!1){typeof u?.href=="string"&&window.open(u.href,"_blank","noopener");return}}catch{}n(typeof u?.message=="string"&&u.message?u.message:"Couldn't do that. Try again.")}let d=(s,u,Q)=>{Q?.href?e({id:s,label:u,href:Q.href}):Q?.post&&e({id:s,label:u,run:()=>r(Q.post)})};import("../c-ZRXJD4G6.js").then(({hostActions:s})=>s()).then(s=>{d("clay.code","Open the code editor",s.codeEditor),d("clay.duplicate","Duplicate as a new page",s.duplicate),d("clay.export","Export as zip",s.export),d("clay.reveal",Ce(),s.reveal),d("clay.versions","Version history\u2026",s.versions)}).catch(()=>{});let E=Se(),k=E&&E.get(z);if(k){E.remove(z);let s=y.get(k);s&&c()==="edit"&&s()}return{inEditMode:C,resumable:R,refresh:h}}var Ye='<svg viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128 50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"/></svg>',Ke=3,X=(e,n,c)=>`${e} ${e===1?n:c}`;function ae(e){let n=document.createElement("span");n.className="clay-avatar",n.setAttribute("aria-hidden","true");let c=he(e.id);return n.style.setProperty("color",c),n.style.setProperty("border-color",c),n.style.setProperty("background","var(--bevel-surface)"),n.textContent=ge(e.name),n}function Ne({root:e,capsule:n,addItem:c,removeItem:y,closeMenu:C,note:R}){let i={supported:!1,people:[],anonymous:0},o=null,h=null,r=null,d=!1,E=()=>window.clay&&window.clay.people,k=()=>window.clay&&window.clay.me||null,s=()=>{try{return!!E()?.canRename?.()}catch{return!1}},u=()=>i.people.length+i.anonymous,Q=()=>document.documentElement.hasAttribute("clay-menu-roster");function A({restore:w=!0}={}){o&&(o.remove(),o=null,d=!1,r?.setAttribute("aria-expanded","false"),w&&h&&h.isConnected&&h.focus(),h=null)}function M(){let w=k();if(!w||!w.name)return null;let g=document.createElement("div");g.className="clay-people-me";let v=document.createElement("span");v.className="clay-people-me-label",v.textContent="Your edits are signed as";let $=document.createElement("div");if($.className="clay-people-me-row",g.append(v,$),d){let f=document.createElement("input");f.className="clay-people-input",f.type="text",f.value=w.name,f.setAttribute("aria-label","Your name"),f.maxLength=120;let x=document.createElement("button");x.type="button",x.className="clay-menu-btn clay-menu-btn-small clay-menu-btn-primary",x.textContent="Save";let l=()=>{try{E().rename(f.value)}catch(a){R(a&&a.code==="not-renamable"?"This name comes from your account, so it can't be changed here.":"Use a name of 1 to 120 characters that isn't an email address."),f.focus();return}d=!1,U(),o?.querySelector(".clay-people-me .clay-menu-btn")?.focus()};x.addEventListener("click",l),f.addEventListener("keydown",a=>{a.key==="Enter"&&(a.preventDefault(),l())}),$.append(f,x),queueMicrotask(()=>{f.isConnected&&(f.focus(),f.select())})}else{let f=document.createElement("span");if(f.className="clay-people-me-name",f.textContent=w.name,$.append(ae(w),f),s()){let x=document.createElement("button");x.type="button",x.className="clay-menu-btn clay-menu-btn-small",x.textContent="Change",x.addEventListener("click",()=>{d=!0,U()}),$.append(x)}}return g}function U(){if(!o)return;let w=u();o.textContent="";let g=document.createElement("div");g.className="clay-people-head";let v=document.createElement("h3");v.className="clay-people-title",v.textContent="Who's here";let $=document.createElement("span");$.className="clay-people-sum",$.textContent=X(w,"person","people");let f=document.createElement("button");if(f.type="button",f.className="clay-people-close",f.setAttribute("aria-label","Close"),f.innerHTML=Ye,f.addEventListener("click",()=>A()),g.append(v,$,f),o.append(g),i.people.length){let l=document.createElement("ul");l.className="clay-people-list";for(let a of i.people){let b=document.createElement("li");b.className="clay-people-row";let N=document.createElement("span");N.className="clay-people-who";let Y=document.createElement("strong");if(Y.textContent=a.name,a.you){let _=document.createElement("span");_.textContent="(you)",Y.append(_)}N.append(Y),b.append(ae(a),N),l.append(b)}o.append(l)}if(i.anonymous>0){let l=document.createElement("p");l.className="clay-people-anon",l.textContent=i.anonymous===1?"1 other person is here without a shared name.":`${i.anonymous} others are here without a shared name.`,o.append(l)}let x=M();x&&o.append(x)}function T(w){if(C(),o){A();return}h=w,o=document.createElement("div"),o.className="clay-people",o.setAttribute("role","dialog"),o.setAttribute("aria-label","Who's here"),o.addEventListener("keydown",g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),d?(d=!1,U(),o.querySelector(".clay-people-me .clay-menu-btn")?.focus()):A())}),U(),e.append(o),r?.setAttribute("aria-expanded",w===r?"true":"false"),o.querySelector(".clay-people-close").focus()}function W(){if(!(Q()&&i.supported&&u()>1)){r?.remove(),r=null;return}r||(r=document.createElement("button"),r.type="button",r.className="clay-roster",r.setAttribute("aria-haspopup","dialog"),r.setAttribute("aria-expanded",o?"true":"false"),r.addEventListener("click",()=>T(r)),e.insertBefore(r,n));let g=i.people.slice(0,Ke),v=u()-g.length,$=document.createElement("span");$.className="clay-roster-faces";for(let x of g)$.append(ae(x));r.textContent="",r.append($),v>0&&r.append(X(v,"other","others"));let f=g.map(x=>x.name);r.setAttribute("aria-label",`Who's here: ${f.join(", ")}${v>0?`${f.length?" and ":""}${X(v,"other","others")}`:""}`)}let P=null;function B(){let w=u();if(i.supported&&(w>1||s())){let g=w>1?`Who's here (${X(w,"person","people")})`:"Who's here";g!==P&&(P=g,c({id:"clay.people",label:g,run:()=>T(n.querySelector(".clay-menu-goo"))}))}else P!==null&&y("clay.people"),P=null,A({restore:!1});if(W(),o&&!d){let g=e.getRootNode().activeElement,v=g&&o.contains(g)?g.classList[0]:null;U(),v&&o.querySelector(`.${v}`)?.focus()}}return document.addEventListener("click",w=>{o&&!w.composedPath().includes(e)&&A({restore:!1})}),document.addEventListener("clay:people",()=>{d||B()}),import("../c-FTWGYI5E.js").then(({presence:w})=>{w.subscribe(g=>{i=g||i,B()})}).catch(()=>{}),{close:A}}var J="not all",G="variants-choose",re="clay.variants.keep",Ze="Change the page look",je="Keep one page look",Fe='<svg viewBox="0 0 6 10" aria-hidden="true" focusable="false"><rect x="4" width="2" height="2"/><rect x="2" y="2" width="2" height="2"/><rect y="4" width="2" height="2"/><rect x="2" y="6" width="2" height="2"/><rect x="4" y="8" width="2" height="2"/></svg>',ze='<svg viewBox="0 0 6 10" aria-hidden="true" focusable="false"><rect width="2" height="2"/><rect x="2" y="2" width="2" height="2"/><rect x="4" y="4" width="2" height="2"/><rect x="2" y="6" width="2" height="2"/><rect y="8" width="2" height="2"/></svg>',Z=()=>[...document.querySelectorAll("head style[clay-variant]")],V=e=>e.getAttribute("clay-variant"),D=()=>Z().map(V);function I(){let e=Z(),n=e.find(c=>c.getAttribute("media")!==J);return n?V(n):e.length?V(e[0]):null}function Re(e,n){let c=window.clay&&window.clay.undo;c&&typeof c.commit=="function"?c.commit(e,n):n(),!document.documentElement.hasAttribute("autosave")&&typeof window.clay?.save=="function"&&window.clay.save()}async function Xe(){let e=await import("../core/save-AOJBDSOK.js");for(;!e.baselineSettled();)await new Promise(n=>document.addEventListener("clay:baseline-settled",n,{once:!0}))}function Ge(e){let n=e.map(c=>`Variant ${c}`);return n.length<2?n.join(""):`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function $e({root:e,capsule:n,addItem:c,removeItem:y,note:C,currentMode:R}){let i=null,o=null,h=null,r=null,d=null,E=()=>R()==="edit",k=()=>i??I(),s=()=>window.clay&&window.clay.storage&&window.clay.storage.session;function u(){let l=I();i!==null&&i===l&&(i=null),h?.remove(),h=null;for(let b of Z()){if(!b.sheet)continue;let N=b.getAttribute("media")!==J;b.sheet.disabled=N&&(V(b)!==l||i!==null)}if(i===null)return;let a=Z().find(b=>V(b)===i);if(!a)return i=null,u();h=document.createElement("style"),h.setAttribute("clay","editor-ui"),h.dataset.clayVariantPreview=i,h.textContent=a.textContent,a.after(h)}function Q(){document.dispatchEvent(new CustomEvent("clay:variant-change",{detail:{active:I(),shown:k()}}))}function A(l){return E()?D().includes(l)?(o=i=null,Re(Ze,()=>{for(let a of Z())V(a)===l?a.removeAttribute("media"):a.getAttribute("media")!==J&&a.setAttribute("media",J)}),v(),{ok:!0}):{ok:!1,code:"unknown-variant"}:{ok:!1,code:"not-editing"}}function M(l){return l!==null&&!D().includes(l)?{ok:!1,code:"unknown-variant"}:(i=l,v(),{ok:!0})}function U(l){o=i=null,Re(je,()=>{for(let a of Z())V(a)===l?(a.removeAttribute("clay-variant"),a.removeAttribute("media"),a.sheet&&(a.sheet.disabled=!1)):a.remove()}),v()}function T(){if(!E())return Promise.resolve({ok:!1,code:"not-editing"});let l=I(),a=D().filter(N=>N!==l);if(!a.length)return Promise.resolve({ok:!1,code:"unknown-variant"});let b=`Keep Variant ${l} and delete ${Ge(a)}? The switcher goes away. Version history still has them.`;return import("../c-FSWRGBVQ.js").then(N=>N.consent(b)).then(()=>(U(l),{ok:!0}),()=>({ok:!1,code:"cancelled"}))}async function W(){let l=i,a=window.clay;if(l===null||!a||typeof a.setMode!="function")return;s()?.set(G,l);let b;try{b=await a.setMode("edit")}catch(N){b={ok:!1,message:N&&N.message}}if(!(b&&b.reloading)&&b&&b.ok===!1){s()?.remove(G);let N=K(b);N&&C(N)}}async function P(){let l=s(),a=l?.get(G);a!=null&&(l.remove(G),!(!E()||!D().includes(a))&&(o=i=a,v(),await Xe(),!(o!==a||!x())&&(o=null,E()&&D().includes(a)&&A(a))))}function B(l){let a=D(),b=a[(a.indexOf(k())+l+a.length)%a.length];E()?A(b):M(b)}function w(){let l=document.createElement("div");l.className="clay-variants",l.setAttribute("role","group"),l.setAttribute("aria-label","Page look"),l.innerHTML=`<button type="button" class="clay-variants-step" data-step="-1" aria-label="Previous look">${Fe}</button><span class="clay-variants-name" aria-live="polite"></span><button type="button" class="clay-variants-step" data-step="1" aria-label="Next look">${ze}</button><button type="button" class="clay-menu-btn clay-menu-btn-small clay-menu-btn-primary clay-variants-use" hidden>Use this look</button><button type="button" class="clay-menu-btn clay-menu-btn-small clay-variants-keep" hidden>Keep</button>`;for(let a of l.querySelectorAll(".clay-variants-step"))a.addEventListener("click",()=>B(Number(a.dataset.step)));return l.querySelector(".clay-variants-use").addEventListener("click",W),l.querySelector(".clay-variants-keep").addEventListener("click",()=>T()),l}function g(){let l=D();if(d=$(),l.length<2){r?.remove(),r=null,y(re);return}r||(r=w()),r.isConnected||e.insertBefore(r,e.querySelector(".clay-roster")??n);let a=k(),b=r.querySelector(".clay-variants-name");b.textContent=`Variant ${a} `;let N=document.createElement("small");N.textContent=`(${l.indexOf(a)+1}/${l.length})`,b.append(N),r.querySelector(".clay-variants-use").hidden=E()||i===null,r.querySelector(".clay-variants-keep").hidden=!E(),E()?c({id:re,label:`Keep Variant ${I()}, remove the others\u2026`,run:()=>T()}):y(re)}function v(){u(),g(),Q()}let $=()=>`${D().join(",")}|${I()}|${k()}`,f=null,x=()=>window.clay?.variants===f;document.addEventListener("clay:modechange",()=>{x()&&(E()?(i=o,P()):o=null,v())}),document.addEventListener("clay:sync-applied",()=>{x()&&v()}),document.addEventListener("clay:undo-change",()=>{x()&&$()!==d&&v()}),f=window.clay.variants={list:()=>{let l=I();return D().map(a=>({name:a,label:`Variant ${a}`,active:a===l}))},get active(){return I()},get shown(){return k()},preview:M,choose:A,keep:T},D().length>=2&&(E()&&P(),v())}var Je=!0,et=6e3,tt=12,nt='<svg viewBox="0 0 6 12" aria-hidden="true" focusable="false"><rect width="2" height="2"/><rect x="4" width="2" height="2"/><rect y="5" width="2" height="2"/><rect x="4" y="5" width="2" height="2"/><rect y="10" width="2" height="2"/><rect x="4" y="10" width="2" height="2"/></svg>',Oe=[["clay.undo","clay.cms","clay.ai","clay.code"],["seo","clay.variants.keep","clay.share","clay.people"],["clay.duplicate","clay.download","clay.export","clay.reveal"],["clay.versions"],null,["upgrade"]],ot=new Set(Oe.flat().filter(Boolean)),j=()=>window.clay&&typeof window.clay.mode=="string"?window.clay.mode:ue;function at(){if(document.querySelector('clay-editor-ui[data-clay-ui="menu"]'))return;let e=document.createElement("div");e.className="clay-menu-dock",e.setAttribute("clay","editor-ui"),e.dataset.corner="top-right",e.innerHTML=`<div class="clay-menu" clay="editor-ui"><button type="button" class="clay-menu-grip" aria-label="Move the menu. Drag it, or use the arrow keys to move it to another corner.">${nt}</button><button type="button" class="clay-menu-edit" role="switch" aria-checked="false"><span class="clay-menu-track" aria-hidden="true"><span class="clay-menu-thumb"></span></span><span class="clay-menu-label">Edit</span></button><span class="clay-menu-divider" aria-hidden="true"></span><button type="button" class="clay-menu-goo" aria-haspopup="menu" aria-expanded="false" aria-label="Clay menu">${ve}</button></div><div class="clay-menu-list" role="menu" aria-label="Clay menu" hidden></div><div class="clay-menu-note" role="status" hidden></div>`;let n=e.querySelector(".clay-menu-grip"),c=e.querySelector(".clay-menu-edit"),y=e.querySelector(".clay-menu-goo"),C=e.querySelector(".clay-menu-list"),R=e.querySelector(".clay-menu-note"),i=new Map,o=()=>e.getRootNode().activeElement||null,h=()=>!C.hidden;function r(t){C.hidden=!t,y.setAttribute("aria-expanded",t?"true":"false")}let d=()=>[...C.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')];function E(t){let p=d();p.length&&p[(t+p.length)%p.length].focus()}function k(){h()&&r(!1)}let s=null,u=null;function Q(){h()||(u?.close({restore:!1}),s?.refresh(),T(),r(!0))}function A(t){let p=t.href&&!t.disabled,m=document.createElement(p?"a":"button");if(p?(m.href=t.href,m.target="_blank",m.rel="noopener"):m.type="button",m.setAttribute("role","menuitem"),m.dataset.menuId=t.id,t.badge&&t.id==="upgrade"){let S=document.createElement("span");S.className="clay-menu-upgrade",S.textContent=t.label,m.append(S)}else m.textContent=t.label;if(t.keys){let S=document.createElement("kbd");S.textContent=t.keys,m.append(S)}return t.disabled&&m.setAttribute("aria-disabled","true"),m.addEventListener("click",()=>{t.disabled||(k(),t.run&&t.run())}),m}function M(t){if(t.text){let p=document.createElement("p");return p.className="clay-menu-version",p.dataset.menuId=t.id,p.textContent=t.label,p}if(t.pair){let p=document.createElement("div");p.className="clay-menu-pair",p.dataset.menuId=t.id;for(let m of t.pair)p.append(A(m));return p}return A(t)}function U(){let t=[...i.keys()].filter(p=>!ot.has(p));return Oe.map(p=>(p||t).map(m=>i.get(m)).filter(Boolean)).filter(p=>p.length)}function T(){let t=o(),p=t&&C.contains(t)?t.dataset.menuId:null;C.textContent="",U().forEach((L,H)=>{if(H){let q=document.createElement("div");q.className="clay-menu-sep",q.setAttribute("role","separator"),C.append(q)}for(let q of L)C.append(M(q))});let m=y.querySelector(".clay-menu-dot"),S=[...i.values()].some(L=>L.badge);if(S&&!m){let L=document.createElement("span");L.className="clay-menu-dot",L.setAttribute("aria-hidden","true"),y.append(L)}else!S&&m&&m.remove();if(p){let L=d().find(H=>H.dataset.menuId===p);L?L.focus():E(0)}}let W=({id:t,label:p,run:m,badge:S,keys:L,disabled:H,href:q})=>({id:t,href:typeof q=="string"?q:"",label:String(p??""),run:typeof m=="function"?m:null,badge:!!S,keys:L?String(L):"",disabled:!!H});function P({id:t,label:p,run:m,badge:S,keys:L,disabled:H,text:q,pair:ce,href:De}={}){if(!t)return null;let ee=W({id:t,label:p,run:m,badge:S,keys:L,disabled:H,href:De});return q&&(ee.text=!0),Array.isArray(ce)&&(ee.pair=ce.map(W)),i.set(t,ee),T(),t}function B(t){i.delete(t)&&T()}function w(t){t&&(R.textContent=t,R.hidden=!1,clearTimeout(g),g=setTimeout(()=>{R.hidden=!0,R.textContent=""},et))}let g=0,v=!1,$=()=>{e.hidden=!ne&&j()!=="edit"};function f(){c.setAttribute("aria-checked",j()==="edit"?"true":"false")}f(),document.addEventListener("clay:modechange",f),c.addEventListener("click",async()=>{if(v)return;let t=c.getAttribute("aria-checked"),p=o()===c,m=j()==="edit"?"view":"edit";v=!0,c.setAttribute("aria-busy","true"),c.disabled=!0;let S;try{S=await window.clay?.setMode?.(m)}catch(L){S={ok:!1,message:L&&L.message}}if(!(S&&S.reloading))if(v=!1,c.removeAttribute("aria-busy"),c.disabled=!1,p&&c.isConnected&&!o()&&document.activeElement===document.body&&c.focus(),S&&S.ok===!1){c.setAttribute("aria-checked",t);let L=K(S);L&&w(L)}else f()}),y.addEventListener("click",()=>{h()?k():Q()}),document.addEventListener("click",t=>{h()&&!t.composedPath().includes(e)&&k()}),e.addEventListener("keydown",t=>{if(t.key==="Escape"){if(!h())return;t.preventDefault(),k(),y.focus();return}if(t.target===y&&(t.key==="Enter"||t.key===" ")){t.preventDefault(),h()?k():(Q(),E(0));return}if(!h())return;if(t.key==="Enter"&&C.contains(t.target)){t.preventDefault(),t.target.click();return}let p=d();if(!p.length)return;let m=p.indexOf(o());t.key==="ArrowDown"?(t.preventDefault(),E(m<0?0:m+1)):t.key==="ArrowUp"&&(t.preventDefault(),E(m<0?p.length-1:m-1))});let x=document,l=null,a=null;function b(t){e.dataset.corner.startsWith("top")?e.style.top=`${Math.round(t.getBoundingClientRect().bottom)+tt}px`:e.style.removeProperty("top")}let N=()=>{a?b(a):e.style.removeProperty("top")};function Y(){if(!e.isConnected)return;let t=x.querySelector(".clay-intro");if(t!==a){if(l&&(l.disconnect(),l=null),a=t,!t){e.style.removeProperty("top");return}typeof ResizeObserver=="function"&&(l=new ResizeObserver(()=>b(t)),l.observe(t)),b(t)}}let _=document.createElement("style");_.id="clay-menu-vars",_.setAttribute("clay","editor-ui"),document.head.append(_);function se(){let t=e.getBoundingClientRect();_.textContent=`:root { --clay-menu-width: ${Math.ceil(t.width)}px; --clay-menu-height: ${Math.ceil(t.height)}px; }`}let qe=ye({name:"menu",content:e,css:[we],attributes:{"clay-mode-toggle":""}});ke({dock:e,container:qe.shadow,grip:n,storage:window.clay.storage&&window.clay.storage.local,onMove:N,onDragStart:()=>{k(),u?.close({restore:!1})}}),se(),typeof ResizeObserver=="function"&&new ResizeObserver(se).observe(e),new MutationObserver(Y).observe(x.body,{childList:!0}),Y(),me(e,e.querySelector(".clay-menu"),be);let le=()=>import("../c-Z32V4MHK.js").then(t=>t.open({returnFocus:y}));if(s=Qe({addItem:P,note:w,currentMode:j}),u=Ne({root:e,capsule:e.querySelector(".clay-menu"),addItem:P,removeItem:B,closeMenu:k,note:w}),$e({root:e,capsule:e.querySelector(".clay-menu"),addItem:P,removeItem:B,note:w,currentMode:j}),Je){P({id:"seo",label:"SEO settings\u2026",run:le});let t=window.clay.storage&&window.clay.storage.session;t&&t.get("reopen-seo")===!0&&(t.remove("reopen-seo"),le().catch(()=>{}))}Te=$,j()!=="edit"&&import("../core/host-permission-6EVJGNPL.js").then(t=>t.checkHostPermission()).catch(()=>{}),window.clay.menu={addItem:P,removeItem:B,open:Q,close:k,note:w},document.dispatchEvent(new CustomEvent("clay:menu-ready"))}var Pe=!1,Te=null,rt=()=>(ne||ie)&&!te;function Me(){Pe||!rt()||(Pe=!0,at())}te||(de(Me),document.addEventListener("clay:capabilitychange",()=>{Me(),Te?.()}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// The CMS's "Edit content" toggle in Bevel's button face. HyperCMS pins the toggle's fill
|
|
2
|
-
// to an opaque neutral (#0a0a0a or #fafafa) and exposes --hcms-toggle-bg and
|
|
3
|
-
// --hcms-toggle-color for authors; on a dark page Bevel's dark bottom-right edge vanished
|
|
4
|
-
// into the near-black fill and the button read as pressed in. Hand-written, not
|
|
5
|
-
// generated: the generated CMS skin may only pin the vendor's --mirk-* tokens.
|
|
6
|
-
import { TOKENS } from "../bevel.js";
|
|
7
|
-
|
|
8
|
-
export const ROOTS = ["[data-hcms-toggle-host]"];
|
|
9
|
-
|
|
10
|
-
export const CSS = `@layer clay-skin{
|
|
11
|
-
[data-hcms-toggle-host]{--hcms-toggle-bg:${TOKENS.face} !important;--hcms-toggle-color:${TOKENS.ink} !important}
|
|
12
|
-
[data-hcms-toggle-host] :is(.hcms-toggle__main, .hcms-toggle__arrow){border-color:${TOKENS["edge-hi"]} ${TOKENS["edge-lo"]} ${TOKENS["edge-lo"]} ${TOKENS["edge-hi"]} !important}
|
|
13
|
-
[data-hcms-toggle-host] :is(.hcms-toggle__main, .hcms-toggle__arrow):hover:not(:active){--hcms-toggle-bg:color-mix(in srgb, ${TOKENS.face}, ${TOKENS["edge-hi"]} 45%) !important}
|
|
14
|
-
[data-hcms-toggle-host] :is(.hcms-toggle__main, .hcms-toggle__arrow):active{border-color:${TOKENS["edge-lo"]} ${TOKENS["edge-hi"]} ${TOKENS["edge-hi"]} ${TOKENS["edge-lo"]} !important}
|
|
15
|
-
}`;
|
|
File without changes
|
|
File without changes
|