@sanity/presentation
Advanced tools
Comparing version 1.12.8 to 1.12.9
@@ -39,3 +39,3 @@ var e=Object.defineProperty,t=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);import{jsx as n,jsxs as r,Fragment as i}from"react/jsx-runtime";import{studioPath as o}from"@sanity/client/csm";import{Card as a,Flex as s,Container as c,Stack as l,Text as d,Inline as u,Box as p,Button as h,Code as f,Label as m,ErrorBoundary as v,TextInput as g,MenuItem as y,useToast as w,usePrefersReducedMotion as b,TooltipDelayGroupProvider as x,Tooltip as P,Switch as E,MenuButton as k,Menu as S,Spinner as I,BoundaryElementProvider as z}from"@sanity/ui";import{useContext as C,forwardRef as O,useCallback as R,useMemo as U,useState as $,useEffect as j,createContext as L,useLayoutEffect as D,useRef as T,memo as A,createElement as _,startTransition as W,useReducer as M,Suspense as N,lazy as F}from"react";import{useUnique as V,getPublishedId as B,useActiveWorkspace as K,useClient as q,useCurrentUser as G,Hotkeys as J,useProjectId as X,useDataset as H,useWorkspace as Z}from"sanity";import{StateLink as Q,useRouter as Y,decodeJsonParams as ee}from"sanity/router";import{PaneRouterContext as te,PaneLayout as ne,StructureToolProvider as re,DocumentListPane as ie,DocumentPane as oe,CommentsIntentProvider as ae}from"sanity/structure";import{styled as se}from"styled-components";import{P as ce,a as le,b as de,A as ue,M as pe,c as he,C as fe,E as me,D as ve}from"./index.js";import{D as ge}from"./DisplayedDocumentBroadcaster.js";import{ResetIcon as ye,LaunchIcon as we,CopyIcon as be,PanelLeftIcon as xe,RefreshIcon as Pe,ShareIcon as Ee,ChevronDownIcon as ke,CheckmarkIcon as Se,DesktopIcon as Ie,MobileDeviceIcon as ze,EditIcon as Ce,PublishIcon as Oe}from"@sanity/icons";import{hasSecretSearchParams as Re,setSecretSearchParams as Ue,withoutSecretSearchParams as $e}from"@sanity/preview-url-secret/without-secret-search-params";import{motion as je,MotionConfig as Le,AnimatePresence as De}from"framer-motion";import{createPreviewSecret as Te}from"@sanity/preview-url-secret/create-secret";import Ae from"fast-deep-equal";import{definePreviewUrl as _e}from"@sanity/preview-url-secret/define-preview-url";import{suspend as We}from"suspend-react";let Me;const Ne=new Uint8Array(16);function Fe(){if(!Me&&(Me=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Me))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Me(Ne)}const Ve=[];for(let e=0;e<256;++e)Ve.push((e+256).toString(16).slice(1));var Be={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ke(e,t,n){if(Be.randomUUID&&!t&&!e)return Be.randomUUID();const r=(e=e||{}).random||(e.rng||Fe)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return Ve[e[t+0]]+Ve[e[t+1]]+Ve[e[t+2]]+Ve[e[t+3]]+"-"+Ve[e[t+4]]+Ve[e[t+5]]+"-"+Ve[e[t+6]]+Ve[e[t+7]]+"-"+Ve[e[t+8]]+Ve[e[t+9]]+"-"+Ve[e[t+10]]+Ve[e[t+11]]+Ve[e[t+12]]+Ve[e[t+13]]+Ve[e[t+14]]+Ve[e[t+15]]}(r)}const qe=1e3,Ge=1e3,Je=500,Xe=["handshake/syn","handshake/syn-ack","handshake/ack"],He=e=>Xe.some((t=>t===e)),Ze=({data:e={}})=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!("domain"in e)&&["id","type","from","to"].every((t=>t in e))&&e.type.startsWith("handshake/");function Qe(e){const t=e.target,n=e.connectTo.map((e=>({buffer:[],config:e,id:"",handler:i,status:"connecting",interval:void 0,heartbeat:void 0})));function r(e){window.clearInterval(e.interval)}function i(e){const{data:t}=e;if(He(t.type)){const e=n.find((e=>e.config.id===t.from));e&&"handshake/syn-ack"===t.type&&(c(e,"connected"),l(e,"handshake/ack",{id:e.id}))}}const o=t=>{var r,i,o;const a=t.data;if(!He(a.type)&&n.find((e=>e.id===a.connectionId))){const t=n.find((e=>e.config.id===a.from));if(t){const n=[a.type,a.data];null==(i=(r=t.config).onEvent)||i.call(r,...n),null==(o=e.onEvent)||o.call(e,...n),d(t,"channel/response",{responseTo:a.id},!1)}}};function a(t){var r;if(Ze(t))console.error("Visual editing package mismatch detected! Please ensure you are using the latest version of Sanity Studio and any packages listed here:\nhttps://github.com/sanity-io/visual-editing");else if(function(t){const{data:r,origin:i}=t;return"sanity/channels"===r.domain&&r.to==e.id&&n.map((e=>e.config.id)).includes(r.from)&&"channel/response"!==r.type&&i===e.targetOrigin}(t)){const{data:e}=t;null==(r=n.find((t=>t.config.id===e.from)))||r.handler(t)}}function s(e){e.heartbeat&&window.clearInterval(e.heartbeat)}function c(t,n){var a,c,u;t.status=n,null==(c=(a=t.config).onStatusUpdate)||c.call(a,n,t.config.id),null==(u=e.onStatusUpdate)||u.call(e,n,t.config.id),"connecting"===n||"reconnecting"===n?(t.handler=i,s(t),function(e){e.id=Ke(),e.interval=window.setInterval((()=>{l(e,"handshake/syn",{id:e.id})}),Je)}(t)):"connected"===n?(t.handler=o,r(t),function(e){if(s(e),e.config.heartbeat){const t="number"==typeof e.config.heartbeat?e.config.heartbeat:Ge;e.heartbeat=window.setInterval((()=>{d(e,"channel/heartbeat")}),t)}}(t),function(e){const t=[...e.buffer];e.buffer.splice(0,e.buffer.length),t.forEach((({type:t,data:n})=>{d(e,t,n)}))}(t)):"disconnected"===n&&(t.id=null,t.handler=i,r(t),s(t))}function l(n,r,i){if(!n.id)throw new Error("No channel ID set");const o={connectionId:n.id,data:i,domain:"sanity/channels",from:e.id,id:Ke(),to:n.config.id,type:r};try{null==t||t.postMessage(o,{targetOrigin:"*"})}catch{throw new Error(`Failed to postMessage '${o.id}' on '${e.id}'`)}}function d(n,r,i,o=!0){const a=Ke();if("connecting"===n.status||"reconnecting"===n.status||"disconnected"===n.status)return void n.buffer.push({type:r,data:i});if(!n.id)throw new Error("No channel ID set");const s={connectionId:n.id,data:i,domain:"sanity/channels",from:e.id,id:a,to:n.config.id,type:r};if(o){const t=setTimeout((()=>{s.connectionId===n.id&&(window.removeEventListener("message",o,!1),"channel/heartbeat"!==r&&n.buffer.push({type:r,data:i}),c(n,"reconnecting"),console.warn(`Received no response to message '${s.type}' on client '${e.id}' (ID: '${s.id}').`))}),qe),o=e=>{var n;const{data:r}=e;"channel/response"===r.type&&null!=(n=r.data)&&n.responseTo&&r.data.responseTo===s.id&&(window.removeEventListener("message",o,!1),clearTimeout(t))};window.addEventListener("message",o,!1)}try{null==t||t.postMessage(s,{targetOrigin:e.targetOrigin})}catch{throw new Error(`Failed to postMessage '${s.id}' on client '${e.id}'`)}}return window.addEventListener("message",a,!1),n.forEach((e=>{c(e,"connecting")})),{destroy:function(){n.forEach((e=>{["disconnected"].includes(e.status)||(d(e,"channel/disconnect",{id:e.id},!1),c(e,"disconnected"))})),window.removeEventListener("message",a,!1),n.forEach((e=>{s(e),r(e)}))},send:function(e,t,r){(e?Array.isArray(e)?[...e]:[e]:n).forEach((e=>{const i=n.find((t=>t.config.id===e));if(!i)throw new Error("Invalid channel ID");d(i,t,r)}))}}}var Ye,et,tt,nt,rt=class extends Error{constructor(e){super(e[0].message),t(this,"issues"),this.name="ValiError",this.issues=e}};function it(e,t){return Array.isArray(e)?[void 0,e]:[e,t]}function ot(e,t,n,r,i){var o,a,s,c,l;const d=null!=(l=null!=(c=null!=(s=null!=(a=null!=(o=t.message)?o:function(e,t){var n;return null==(n=null==nt?void 0:nt.get(e))?void 0:n.get(t)}(n,i.lang))?a:e?(u=i.lang,null==tt?void 0:tt.get(u)):null)?s:null==r?void 0:r.message)?c:function(e){return null==et?void 0:et.get(e)}(i.lang))?l:i.message;var u;return"function"==typeof d?d(i):d}function at(e,t,n){return{typed:e,output:t,issues:n}}function st(e){let t=typeof e;return"object"===t&&(t=e?Object.getPrototypeOf(e).constructor.name:"null"),"string"===t?`"${e}"`:"number"===t||"bigint"===t||"boolean"===t?`${e}`:t}function ct(e,t,n){var r;const i=null!=(r=n.received)?r:st(n.input),o={reason:e.type,context:n.context.type,expected:n.context.expects,received:i,message:`Invalid ${n.label}: ${n.context.expects?`Expected ${n.context.expects} but r`:"R"}eceived ${i}`,input:n.input,requirement:n.context.requirement,path:n.path,lang:null==t?void 0:t.lang,abortEarly:null==t?void 0:t.abortEarly,abortPipeEarly:null==t?void 0:t.abortPipeEarly,skipPipe:null==t?void 0:t.skipPipe};return o.message=ot(!1,n.context,n.reference,t,o),o}function lt(e,t,n,r){if(e.pipe&&(null==n||!n.skipPipe))for(const i of e.pipe){const o=i._parse(t);if(o.issues){for(const t of o.issues){const i=ct(e,n,t);r?r.push(i):r=[i]}if(null!=n&&n.abortEarly||null!=n&&n.abortPipeEarly)break}else t=o.output}return at(!0,t,r)}function dt(e,t,n,r,i){var o,a;const s=st(n),c=null!=(o=null==i?void 0:i.expected)?o:e.expects,l={reason:null!=(a=null==i?void 0:i.reason)?a:"type",context:e.type,expected:c,received:s,message:`Invalid type: Expected ${c} but received ${s}`,input:n,path:null==i?void 0:i.path,issues:null==i?void 0:i.issues,lang:null==r?void 0:r.lang,abortEarly:null==r?void 0:r.abortEarly,abortPipeEarly:null==r?void 0:r.abortPipeEarly,skipPipe:null==r?void 0:r.skipPipe};return l.message=ot(!0,e,t,r,l),{typed:!1,output:n,issues:[l]}}function ut(e,t){return{...e,fallback:t,_parse(t,n){const r=e._parse(t,n);return r.issues?at(!0,function(e,t){return"function"==typeof e.fallback?e.fallback(t):e.fallback}(this,{input:t,issues:r.issues})):r}}}function pt(e,t,n,r){const[i,o,a]=function(e,t,n){if(!e||"object"==typeof e&&!Array.isArray(e)){const[r,i]=it(t,n);return[e,r,i]}const[r,i]=it(e,t);return[void 0,r,i]}(t,n,r);let s;return{type:"object",expects:"Object",async:!1,entries:e,rest:i,message:o,pipe:a,_parse(e,t){if(e&&"object"==typeof e){s=null!=s?s:Object.entries(this.entries);let n,r=!0;const i={};for(const[o,a]of s){const s=e[o],c=a._parse(s,t);if(c.issues){const i={type:"object",origin:"value",input:e,key:o,value:s};for(const e of c.issues)e.path?e.path.unshift(i):e.path=[i],null==n||n.push(e);if(n||(n=c.issues),null!=t&&t.abortEarly){r=!1;break}}c.typed||(r=!1),(void 0!==c.output||o in e)&&(i[o]=c.output)}if(this.rest&&(null==t||!t.abortEarly||!n))for(const o in e)if(!(o in this.entries)){const a=e[o],s=this.rest._parse(a,t);if(s.issues){const i={type:"object",origin:"value",input:e,key:o,value:a};for(const e of s.issues)e.path?e.path.unshift(i):e.path=[i],null==n||n.push(e);if(n||(n=s.issues),null!=t&&t.abortEarly){r=!1;break}}s.typed||(r=!1),i[o]=s.output}return r?lt(this,i,t,n):at(!1,i,n)}return dt(this,pt,e,t)}}}function ht(e,t){return{type:"picklist",expects:e.map(st).join(" | "),async:!1,options:e,message:t,_parse(e,t){return this.options.includes(e)?at(!0,e):dt(this,ht,e,t)}}}function ft(e,t,n){const r=e._parse(t,function(e){var t,n,r,i;return{lang:null!=(t=null==e?void 0:e.lang)?t:null==Ye?void 0:Ye.lang,message:null==e?void 0:e.message,abortEarly:null!=(n=null==e?void 0:e.abortEarly)?n:null==Ye?void 0:Ye.abortEarly,abortPipeEarly:null!=(r=null==e?void 0:e.abortPipeEarly)?r:null==Ye?void 0:Ye.abortPipeEarly,skipPipe:null!=(i=null==e?void 0:e.skipPipe)?i:null==Ye?void 0:Ye.skipPipe}}(n));if(r.issues)throw new rt(r.issues);return r.output}const mt=/^([A-Za-z]+):([0-9]+)$/,vt=/^([A-Za-z]+):([0-9]+),([0-9]+)$/,gt=/^([A-Za-z]+):([a-z0-9]+)$/;function yt(e,t){return`${e}-${"string"==typeof t?t:JSON.stringify(t)}`}const wt={alt:"altKey",ctrl:"ctrlKey",mod:typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function bt(e){return"Alt"===e.key}function xt(e){const{children:t,message:i,onRetry:o,onContinueAnyway:f,...m}=e,v=n(h,{fontSize:1,mode:"ghost",onClick:o,text:"Retry"}),g=n(h,{fontSize:1,mode:"ghost",tone:"critical",onClick:f,text:"Continue anyway"});return n(a,{height:"fill",...m,children:n(s,{align:"center",height:"fill",justify:"center",children:n(c,{padding:4,sizing:"border",width:0,children:r(l,{space:4,children:[r(l,{space:3,children:[n(d,{size:1,weight:"semibold",children:"An error occured"}),n(d,{muted:!0,size:1,children:i})]}),t,o&&f?r(u,{space:2,children:[v,g]}):o?n(p,{children:v}):f?n(p,{children:g}):null]})})})})}function Pt(){const e=C(ce);if(!e)throw new Error("Presentation context is missing");return e}function Et(e){const t=["comment","inspect","instruction","pathKey","rev","since","template","view"];return function(e={}){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`)).join("&");return t.length?`?${t}`:""}(Object.entries(e).filter((([e])=>t.includes(e))).reduce(((e,[t,n])=>null==n?e:{...e,[t]:n}),{}))}const kt=O((function(e,t){const{params:r,structureParams:i}=Pt();return n(Q,{...e,ref:t,state:{type:void 0,_searchParams:Object.entries({...i,preview:r.preview})},title:void 0})})),St=O((function(e,t){const{documentId:r,documentType:i,parentRefPath:o,template:a,previewUrl:s,...c}=e;return n(Q,{...c,ref:t,state:{id:r,type:i,_searchParams:Object.entries({preview:s})},title:void 0})}));function It(e){const{children:t,onStructureParams:r,params:o,previewUrl:a,refs:s}=e,{state:c,resolvePathFromState:l}=Y(),d=V(Object.fromEntries(c._searchParams||[])),u=R((e=>`${l(c)}${Et({...d,...e})}`),[l,d,c]),p=U((()=>({index:0,groupIndex:0,siblingIndex:0,payload:{},params:o,hasGroupSiblings:!1,groupLength:1,routerPanesState:[],ChildLink:e=>{const{childId:t,...r}=e,i=null==s?void 0:s.find((e=>e._id===t||B(e._id)===t));return i?n(Q,{...r,state:{id:t,type:i._type,_searchParams:Object.entries({preview:a})}}):n("div",{...r})},BackLink:kt,ReferenceChildLink:e=>n(St,{...e,previewUrl:a}),ParameterizedLink:()=>n(i,{children:"ParameterizedLink"}),closeCurrentAndAfter:()=>{console.warn("closeCurrentAndAfter")},handleEditReference:e=>{console.warn("handleEditReference",e)},replaceCurrent:e=>{console.warn("replaceCurrent",e)},closeCurrent:()=>{console.warn("closeCurrent")},duplicateCurrent:e=>{console.warn("duplicateCurrent",e)},setView:e=>{console.warn("setView",e)},setParams:e=>{var t;r({...e,inspect:null!=(t=e.inspect)?t:void 0})},setPayload:e=>{console.warn("setPayload",e)},navigateIntent:(e,t,n)=>{console.warn("navigateIntent",e,t,n)},createPathWithParams:u})),[u,r,o,a,s]);return n(te.Provider,{value:p,children:t})}const zt=se(ne)` | ||
${({$disabled:e})=>!e&&"\n /* Hover effect */\n & > span:nth-child(2) {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 9px;\n bottom: 0;\n background-color: var(--card-border-color);\n opacity: 0;\n transition: opacity 150ms;\n }\n\n @media (hover: hover) {\n &:hover > span:nth-child(2) {\n opacity: 0.2;\n }\n }\n "} | ||
`,Mt=function({id:e,order:t,disabled:i=!1}){const o=T(null),a=C(Dt);if(null===a)throw Error("Panel components must be rendered within a PanelGroup container");const s=function(e){return T(e||Ke()).current}(e),{activeResizer:c,drag:l,startDragging:d,stopDragging:u,registerElement:p,unregisterElement:h}=a,f=c===s;if(null===a)throw Error("Panel components must be rendered within a PanelGroup container");const m=R((e=>{d(s,e.nativeEvent)}),[s,d]),v=R((e=>{l(s,e)}),[s,l]),g=R((()=>{o.current.blur(),u()}),[u]);return j((()=>{if(f&&!i)return window.addEventListener("mousemove",v),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",g)}}),[i,f,v,g]),D((()=>(p(s,{id:s,order:t,type:"resizer",el:o}),()=>{h(s)})),[s,t,p,h]),n(_t,{onMouseDown:m,ref:o,children:r(Wt,{$disabled:i,children:[n("span",{}),n("span",{})]})})};function Nt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>{e.apply(e,r)}),t)}}const Ft="presentation/panels",Vt=()=>JSON.parse(localStorage.getItem(Ft)||"{}"),Bt=e=>e.map((e=>[e.id,e.order].join(":"))).join(",");function Kt(){return U((()=>{const e=(e,t)=>{const n=Vt(),r=Bt(e);(e=>{localStorage.setItem(Ft,JSON.stringify(e))})({...n,[r]:t})};return{get:e=>Vt()[Bt(e)],set:e,setDebounced:Nt(e,100)}}),[])}function qt(e,t,n){const{maxWidth:r,minWidth:i}=e,o=null==r?100:r/n*100,a=i/n*100;return Math.min(o,Math.max(a,t))}function Gt(e,t,n){if(1===e.length)return"100";const r=n[e.findIndex((e=>e.id===t))];return null==r?"0":r.toPrecision(10)}function Jt(e,t,n=0,r=null){return e.clientX-(r||t.getBoundingClientRect()).left-n}function Xt(e){return"panel"===e.type}function Ht(e){return"resizer"===e.type}function Zt(e){return Array.from(e.values()).sort((({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t))}function Qt(e,t,n){const r=t.reduce(((e,t)=>e+t),0),i=[...t].map((e=>e/r*100));let o=0;for(let t=0;t<e.length;t++){const r=e[t],a=i[t],s=qt(r,a,n);a!=s&&(o+=a-s,i[t]=s)}if("0.000"!==o.toFixed(3))for(let t=0;t<e.length;t++){const r=e[t];let{maxWidth:a,minWidth:s}=r;s=s/n*100,null!=a&&(a=a/n*100);const c=Math.min(null!=a?a:100,Math.max(s,i[t]+o));if(c!==i[t]&&(o-=c-i[t],i[t]=c,"0.000"===Math.abs(o).toFixed(3)))break}return i}const Yt=se.div` | ||
`,Mt=function({id:e,order:t,disabled:i=!1}){const o=T(null),a=C(Dt);if(null===a)throw Error("Panel components must be rendered within a PanelGroup container");const s=function(e){return T(e||Ke()).current}(e),{activeResizer:c,drag:l,startDragging:d,stopDragging:u,registerElement:p,unregisterElement:h}=a,f=c===s;if(null===a)throw Error("Panel components must be rendered within a PanelGroup container");const m=R((e=>{d(s,e.nativeEvent)}),[s,d]),v=R((e=>{l(s,e)}),[s,l]),g=R((()=>{o.current.blur(),u()}),[u]);return j((()=>{if(f&&!i)return window.addEventListener("mousemove",v),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",g)}}),[i,f,v,g]),D((()=>(p(s,{id:s,order:t,type:"resizer",el:o}),()=>{h(s)})),[s,t,p,h]),n(_t,{onMouseDown:m,ref:o,children:r(Wt,{$disabled:i,children:[n("span",{}),n("span",{})]})})};function Nt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>{e.apply(e,r)}),t)}}const Ft="presentation/panels",Vt=()=>JSON.parse(localStorage.getItem(Ft)||"{}"),Bt=e=>e.map((e=>[e.id,e.order].join(":"))).join(",");function Kt(){return U((()=>{const e=(e,t)=>{const n=Vt(),r=Bt(e);(e=>{localStorage.setItem(Ft,JSON.stringify(e))})({...n,[r]:t})};return{get:e=>{const t=Vt(),n=Bt(e);return Array.isArray(t[n])&&t[n].some((e=>null===e))?void 0:t[n]},set:e,setDebounced:Nt(e,100)}}),[])}function qt(e,t,n){const{maxWidth:r,minWidth:i}=e,o=null==r?100:r/n*100,a=i/n*100;return Math.min(o,Math.max(a,t))}function Gt(e,t,n){if(1===e.length)return"100";const r=n[e.findIndex((e=>e.id===t))];return null==r?"0":r.toPrecision(10)}function Jt(e,t,n=0,r=null){return e.clientX-(r||t.getBoundingClientRect()).left-n}function Xt(e){return"panel"===e.type}function Ht(e){return"resizer"===e.type}function Zt(e){return Array.from(e.values()).sort((({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t))}function Qt(e,t,n){const r=t.reduce(((e,t)=>e+t),0),i=[...t].map((e=>e/r*100));let o=0;for(let t=0;t<e.length;t++){const r=e[t],a=i[t],s=qt(r,a,n);a!=s&&(o+=a-s,i[t]=s)}if("0.000"!==o.toFixed(3))for(let t=0;t<e.length;t++){const r=e[t];let{maxWidth:a,minWidth:s}=r;s=s/n*100,null!=a&&(a=a/n*100);const c=Math.min(null!=a?a:100,Math.max(s,i[t]+o));if(c!==i[t]&&(o-=c-i[t],i[t]=c,"0.000"===Math.abs(o).toFixed(3)))break}return i}const Yt=se.div` | ||
display: flex; | ||
@@ -42,0 +42,0 @@ flex-direction: row; |
{ | ||
"name": "@sanity/presentation", | ||
"version": "1.12.8", | ||
"version": "1.12.9", | ||
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/presentation#readme", | ||
@@ -108,12 +108,12 @@ "bugs": { | ||
"@repo/channels": "0.4.0", | ||
"@repo/visual-editing-helpers": "0.6.8", | ||
"@repo/visual-editing-helpers": "0.6.9", | ||
"@sanity/client": "^6.15.20", | ||
"@sanity/pkg-utils": "6.8.6", | ||
"@sanity/pkg-utils": "6.8.7", | ||
"happy-dom": "^14.7.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react": "^18.3.0", | ||
"react-dom": "^18.3.0", | ||
"sanity": "^3.39.0", | ||
"styled-components": "6.1.8", | ||
"typescript": "5.4.5", | ||
"vitest": "^1.5.1", | ||
"vitest": "^1.5.2", | ||
"@repo/package.config": "0.0.0" | ||
@@ -120,0 +120,0 @@ }, |
@@ -23,3 +23,3 @@ import {useMemo} from 'react' | ||
export function usePanelsStorage(): { | ||
get: (panels: PanelElement[]) => number[] | ||
get: (panels: PanelElement[]) => number[] | undefined | ||
set: (panels: PanelElement[], widths: number[]) => void | ||
@@ -32,3 +32,5 @@ setDebounced: (panels: PanelElement[], widths: number[]) => void | ||
const key = getKeyForPanels(panels) | ||
return stored[key] | ||
return Array.isArray(stored[key]) && stored[key].some((val) => val === null) | ||
? undefined | ||
: stored[key] | ||
} | ||
@@ -35,0 +37,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1160459
6142