@hazem3500/palette 0.9.139 → 0.9.140
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/chunk-U5T4E3R7.js +1 -0
- package/dist/design-commands.d.ts +8 -2
- package/dist/index.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/react.js +1 -1
- package/dist/server.js +1 -1
- package/dist/setup.js +1 -1
- package/dist/shortcut-help-ZBS3ALR6.js +1 -0
- package/package.json +1 -1
- package/server/setup-client.txt +86 -74
- package/dist/chunk-FQMPVPFA.js +0 -1
- package/dist/shortcut-help-Y3W76ZVP.js +0 -1
package/dist/setup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,d as o}from"./chunk-
|
|
1
|
+
import{a as n,d as o}from"./chunk-U5T4E3R7.js";import"./chunk-ZEJDB2HZ.js";import"./chunk-HHUTDVTM.js";import"./chunk-RBHY7UDS.js";import"./chunk-LMXFSXO6.js";import"./chunk-5HZI7HRR.js";import"./chunk-2BS2OWWH.js";import"./chunk-UWTBLOTJ.js";import"./chunk-VX6XCU4E.js";import"./chunk-QFONAD5S.js";function r(r){return(t={})=>o(n({...r,...t}))}var t=r;export{t as defineKomo,r as definePalette};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-RBHY7UDS.js";import{a as e,b as o,c as r,d as a}from"./chunk-VX6XCU4E.js";import{E as s,G as i,N as n}from"./chunk-QFONAD5S.js";var l=(t,e,o,r={})=>({label:t,group:o,shortcut:{key:e,label:e,alt:!1,shift:!1,ctrl:!1,meta:!1,...r}});function p(o=e(),r,a=t()){let s="Design canvas",i="Experimental geometry",n="Text editing",p="Compare",c=(t,e,o)=>({label:t,group:e,shortcut:o}),u="enter"!==a.child?.key||a.child.alt||a.child.shift||a.child.ctrl||a.child.meta?a.child:null;return[c("Next sibling",s,a.next),c("Previous sibling",s,a.prev),c("Parent element",s,a.parent),l("Post comment","Enter",s),...u?[c("First child",s,u)]:[],l(u?"First child (alternative)":"First child","ArrowDown",s,{alt:!0}),l("Parent element (alternative)","ArrowUp",s,{alt:!0}),l("Exit Design mode","Escape",s),l("Undo last preview","z",s,o?{meta:!0}:{ctrl:!0}),l("Redo last undo","z",s,o?{meta:!0,shift:!0}:{ctrl:!0,shift:!0}),...o?[]:[l("Redo last undo","y",s,{ctrl:!0})],l("Focus selection to move or resize","M",s),l("Move before previous sibling","ArrowUp",i,{alt:!0}),l("Move after next sibling","ArrowDown",i,{alt:!0}),l("Move out, after its parent","ArrowUp",i,{alt:!0,shift:!0}),l("Move into previous sibling","ArrowDown",i,{alt:!0,shift:!0}),l("Resize width","ArrowRight",i,o?{meta:!0}:{ctrl:!0}),l("Resize height","ArrowDown",i,o?{meta:!0}:{ctrl:!0}),l("Resize by 10px","ArrowRight",i,o?{meta:!0,shift:!0}:{ctrl:!0,shift:!0}),l("Back to the canvas","Escape",i),...r?[{label:"Hide or show selection · hold to peek",group:s,shortcut:r}]:[],l("Commit text","Enter",n),l("New line","Enter",n,{shift:!0}),l("Cancel text edit","Escape",n),l("Toggle before and after","B",p),c("Show before",p,a.before),c("Show after",p,a.after)]}function c(t=e()){let o="Design canvas";return[{label:"Inspect element",group:o,keys:[],gesture:"Click",aria:"Click"},{label:"Select inner element",group:o,keys:[t?"⌘":"Ctrl"],gesture:"Click",aria:(t?"Command":"Control")+" + Click"},{label:"Edit text",group:o,keys:[],gesture:"Double-click",aria:"Double-click"},{label:"Keyboard shortcuts",group:o,keys:["?"],aria:"?"}]}function u(t,e,u=!1,h,d,m=!1){let b=t.querySelector("dialog.palette-shortcuts");if(b)return b.querySelector("[autofocus]")?.focus();let f=t.activeElement??document.activeElement,g=f?.closest(".morphing-menu__panel")?t.querySelector('[data-menu-item="more"]'):f,x=s("dialog","palette-shortcuts");x.setAttribute("aria-modal","true"),x.setAttribute("aria-labelledby","palette-shortcuts-title");let v=s("h2","","Keyboard shortcuts");v.id="palette-shortcuts-title";let k=i("Close",()=>K(),"icon palette-shortcuts__close","close");k.removeAttribute("title");let w=s("span","morphing-menu__tooltip palette-shortcuts__tip","Close");w.setAttribute("aria-hidden","true"),w.append(a(["Esc"],"Escape"));let y=s("header");y.append(v,k,w);let _=s("input");_.type="search",_.placeholder="Filter shortcuts",_.setAttribute("aria-label","Filter shortcuts"),_.autocomplete="off",_.spellcheck=!1;let C=s("div","palette-shortcuts__body");C.tabIndex=0,C.setAttribute("autofocus",""),C.setAttribute("role","region"),C.setAttribute("aria-label","Shortcuts");let E=u?[...c(),...p(void 0,e.find(t=>/^(Hide|Show) comments$/.test(t.label))?.shortcut,d)]:[],A=[...e,l("Post comment","Enter","Comments"),l("New line","Enter","Comments",{shift:!0}),{label:"Select several pins",group:"Comments",keys:["Shift"],gesture:"Click",aria:"Shift + Click"},...m?[l("Zoom to fit","1","Frame",{shift:!0}),l("Zoom to 100%","0","Frame",{shift:!0})]:[]],S=("design"===h?[...E,...A]:[...A,...E]).filter(t=>t.shortcut||t.keys?.length||t.gesture),D=[...new Set(S.map(t=>t.group??"General"))].sort((t,e)=>+("comment"===h&&"Comments"===e)-+("comment"===h&&"Comments"===t)),z=[];for(let t of D){let e=s("section");e.append(s("h3","",t));for(let i of S.filter(e=>(e.group??"General")===t)){let t=s("div","palette-shortcuts__row"),n=i.shortcut?o(i.shortcut):void 0;n&&t.setAttribute("aria-keyshortcuts",n.aria);let l=i.shortcut?r(i.shortcut):a(i.keys,i.aria??i.keys.join(" + "));i.gesture&&l.append(s("span","",i.gesture)),t.append(s("span","",i.label),l),e.append(t),z.push([t,`${i.label} ${l.getAttribute("aria-label")} ${l.textContent}`.toLowerCase()])}C.append(e)}let F=s("p","","No matching shortcuts");F.setAttribute("role","status"),F.hidden=!0,C.append(F,s("p","","Shortcuts pause while typing in a text field.")),_.addEventListener("input",()=>{let t=_.value.toLowerCase().split(/\s+/).filter(Boolean);for(let[e,o]of z)e.hidden=!t.every(t=>o.includes(t));for(let t of C.querySelectorAll("section"))t.hidden=!t.querySelector(".palette-shortcuts__row:not([hidden])");F.hidden=z.some(([t])=>!t.hidden)}),x.append(Object.assign(s("style"),{textContent:'.palette-shortcuts{box-sizing:border-box;width:min(720px,calc(100vw - 32px));max-width:none;max-height:min(680px,calc(100dvh - 32px));margin:auto;padding:0;overflow:hidden;border:0;border-radius:16px;background:var(--mm-surface);color:var(--mm-ink);box-shadow:inset 0 0 0 1px color-mix(in oklab,var(--mm-ink) 12%,transparent),0 24px 64px -16px rgb(0 0 0/55%);font:12px/1.4 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif;pointer-events:auto;color-scheme:dark}\n.palette-shortcuts[open]{display:flex;flex-direction:column;animation:palette-help-in var(--duration-fast) var(--ease-smooth-out)}\n.palette-shortcuts::backdrop{background:rgb(0 0 0/40%);pointer-events:auto}\n@keyframes palette-help-in{from{opacity:0;scale:.98;translate:0 4px}}\n.palette-shortcuts header{flex:none;position:relative;display:flex;align-items:center;gap:8px;padding:10px 10px 4px 16px}\n.palette-shortcuts h2{flex:1;margin:0;font-size:14px;font-weight:600}\n.palette-shortcuts__close{width:28px;height:28px;border-radius:8px;color:color-mix(in oklab,var(--mm-ink) 60%,transparent)}\n.palette-shortcuts__close:hover{background:color-mix(in oklab,var(--mm-ink) 8%,transparent);color:var(--mm-ink)}\n.palette-shortcuts__close svg{width:16px;height:16px}\n.palette-shortcuts .palette-shortcuts__tip{top:50%;bottom:auto;right:44px;translate:0 -50%;opacity:0;transition:opacity var(--duration-quick) var(--ease-smooth-out)}\n.palette-shortcuts__close:hover+.palette-shortcuts__tip,.palette-shortcuts__close:focus-visible+.palette-shortcuts__tip{opacity:1;transition-delay:400ms}\n.palette-shortcuts input{flex:none;width:auto;height:30px;margin:6px 16px;padding:0 10px;border-radius:8px;background:color-mix(in oklab,var(--mm-ink) 7%,transparent);box-shadow:none}\n.palette-shortcuts input:focus{box-shadow:inset 0 0 0 1px var(--accent,#bda6ef)}\n.palette-shortcuts input::placeholder{color:color-mix(in oklab,var(--mm-ink) 50%,transparent)}\n.palette-shortcuts__close:focus-visible{outline:2px solid var(--accent,#bda6ef);outline-offset:-2px}\n.palette-shortcuts__body{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px 16px 14px;columns:2 240px;column-gap:28px;outline:0}\n.palette-shortcuts section{break-inside:avoid;padding-bottom:10px}\n.palette-shortcuts h3{margin:0;padding:6px 0 2px;font-size:11px;font-weight:600;color:color-mix(in oklab,var(--mm-ink) 62%,transparent)}\n.palette-shortcuts__row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}\n.palette-shortcuts [hidden]{display:none}\n.palette-shortcuts .palette-kbd{align-items:center;gap:4px}\n.palette-shortcuts__row kbd{box-sizing:border-box;display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:5px;font-size:11px;line-height:1}\n.palette-shortcuts .palette-kbd span,.palette-shortcuts p{color:color-mix(in oklab,var(--mm-ink) 55%,transparent)}\n.palette-shortcuts p{column-span:all;margin:4px 0 0;font-size:11px}\n@media (prefers-reduced-motion:reduce){.palette-shortcuts[open]{animation:none}}\n@media (pointer:coarse){.palette-shortcuts__close{width:44px;height:44px}}'}),y,_,C);let M=new AbortController,{signal:R}=M,K=()=>{R.aborted||(M.abort(),x.close(),x.remove(),g?.isConnected&&g.focus({preventScroll:!0}))};x.addEventListener("close",K,{signal:R}),window.addEventListener("keydown",e=>{let o=e.composedPath().find(t=>t instanceof HTMLDialogElement&&t.open);if(o&&o!==x||(e.stopImmediatePropagation(),e.isComposing))return;let r=t.activeElement===_;if("Escape"!==e.key&&("?"!==e.key||r||e.ctrlKey||e.metaKey||e.altKey)){if("Tab"===e.key){let o=[k,_,C],r=o.indexOf(t.activeElement);e.preventDefault(),o[r<0?e.shiftKey?2:0:(r+(e.shiftKey?2:1))%3].focus()}}else e.preventDefault(),K()},{capture:!0,signal:R}),n(x,K,R),t.append(x),x.showModal()}export{u as showShortcutHelp};
|