@prismicio/editor-fields 0.4.81 → 0.4.83

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/index.cjs.js CHANGED
@@ -206,4 +206,4 @@ img.ProseMirror-separator {
206
206
  `).map(t=>({type:"paragraph",content:{text:t}}))}}function A8e(e){const t=e==null?void 0:e.value.map(n=>"content"in n?n.content.text:"").join(`
207
207
  `);if(t)return{__TYPE__:"FieldContent",type:"Text",value:t}}function VJ(e){if(de.isRepeatableContent(e))return e;if(de.isLinkContent(e))return{__TYPE__:"RepeatableContent",type:"Link",value:[e]}}function zJ(e){if(de.isLinkContent(e))return e;if(de.isRepeatableContent(e)){const[t]=e.value;if(de.isLinkContent(t))return t}}function m8e(e){var s;const{content:t,id:n,field:r,onContentChange:i,readOnly:o}=e,a={id:n,readOnly:o,onContentChange:i};return(s=r.config)!=null&&s.repeat?l.jsx(lPe,{...a,field:r,content:VJ(t)}):l.jsx(jF,{...a,field:r,content:zJ(t)})}const g8e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return l.jsxs(A.Field,{children:[l.jsx(A.FieldIcon,{name:"pin"}),l.jsx(A.FieldLabel,{htmlFor:n,children:_r(t)}),l.jsx(A.FieldControl,{children:l.jsx(A.NumberInput,{id:n,value:a,min:(s=t.config)==null?void 0:s.min,max:(c=t.config)==null?void 0:c.max,padding:oQ,placeholder:Hf(t),readOnly:i,onValueChange:u=>r(v8e(u))})})]})};function v8e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function y8e(e){const{content:t,field:n,id:r,readOnly:i,onContentChange:o}=e,{placeholder:a,options:s}=n.config??{},c=!!(s!=null&&s.includes("")),u=C8e(n),d=b8e({content:t,placeholder:a,defaultValue:u,canHaveEmptyValue:c}),f=a&&u===void 0||a===void 0&&!c;return l.jsxs(A.Field,{children:[l.jsx(A.FieldIcon,{name:"arrowDropDownCircle"}),l.jsx(A.FieldLabel,{htmlFor:r,children:_r(n)}),l.jsx(A.FieldControl,{children:l.jsxs(A.Select,{id:r,size:"large",color:"grey",value:d,disabled:i,renderTrigger:()=>l.jsx(A.SelectGhostTrigger,{id:r}),onValueChange:p=>{o(S8e({value:p,placeholder:a}))},children:[f&&l.jsx(A.SelectItem,{value:a||Ov,children:a||""}),s==null?void 0:s.map(p=>l.jsx(A.SelectItem,{value:p||Ov,children:p},p))]})})]})}function b8e(e){const{content:t,placeholder:n,defaultValue:r,canHaveEmptyValue:i}=e;let{value:o}=t??{};return o===""&&i?Ov:(o===""&&(o=void 0),o??r??n??"")}function S8e(e){const{placeholder:t}=e;let{value:n}=e;if(n!==t)return n===Ov&&(n=""),{__TYPE__:"FieldContent",type:"Select",value:n}}function C8e(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}const Ov=" ",C2=QJ(2,3),w8e={__TYPE__:"TableContent",content:QJ(1,1)};function x8e(e){const{field:t,content:n,onContentChange:r,...i}=e;function o(a){if(!a)return r(w8e);e.onContentChange(I8e(a))}return l.jsx(vO,{...i,field:R8e(t),content:_8e(n),onContentChange:o,shouldReturnEmptyContent:!0,scroll:"x-auto",padding:"zero"})}function QJ(e,t){return Array.from({length:e},()=>({key:crypto.randomUUID(),type:"tableRow",content:Array.from({length:t},()=>({key:crypto.randomUUID(),type:"tableCell",content:{__TYPE__:"StructuredTextContent",value:[{type:"paragraph",content:{text:""}}]}}))}))}function _8e(e){return{__TYPE__:"StructuredTextContent",value:[{type:"table",content:T8e(e)}]}}function T8e(e){const t=de.TableContent.decode(e);return t._tag==="Left"||!t.right.content.some(r=>r.content.some(i=>i.content.value.some(({type:o})=>o)))?C2:t.right.content}function I8e(e){return{__TYPE__:"TableContent",content:e.value.flatMap(t=>t.type==="table"?t.content:[])}}function R8e(e){var t;return{...he.TableCell,config:{...he.TableCell.config,label:(t=e.config)==null?void 0:t.label,allowTargetBlank:!0,multi:[he.TableCell.config.multi,Gc.table].join(",")}}}function E8e(e){const{id:t,readOnly:n,field:r,content:i,onContentChange:o}=e,a=i!=null&&i.value?Ex.dateFromISOString(i.value):void 0;return l.jsxs(A.Field,{children:[l.jsx(A.FieldIcon,{name:"event"}),l.jsx(A.FieldLabel,{id:t,children:_r(r)}),l.jsx(A.FieldControl,{children:l.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:l.jsx(A.DateInput,{mode:"date-time","aria-labelledby":t,disabled:n,value:a,onValueChange:s=>{o($8e(s))}})})})]})}function $8e(e){if(e)return{__TYPE__:"FieldContent",type:"Timestamp",value:k8e(e)}}function k8e(e){const t=`${e.getUTCFullYear()}`.padStart(4,"0"),n=`${e.getUTCMonth()+1}`.padStart(2,"0"),r=`${e.getUTCDate()}`.padStart(2,"0"),i=`${e.getUTCHours()}`.padStart(2,"0"),o=`${e.getUTCMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}T${i}:${o}:00+00:00`}function eS(e){const{id:t,readOnly:n,content:r,nestableWidget:i}=e,o=ze.useStableCallback(e.onContentChange),a=I.useMemo(()=>{const s={id:t,readOnly:n,onContentChange:o};return i.type==="Boolean"?l.jsx(cLe,{...s,field:i,content:de.isBooleanContent(r)?r:void 0}):i.type==="Date"?l.jsx(fLe,{...s,field:i,content:de.isDateContent(r)?r:void 0}):i.type==="Timestamp"?l.jsx(E8e,{...s,field:i,content:de.isTimestampContent(r)?r:void 0}):i.type==="Image"?l.jsx(bPe,{...s,field:i,content:de.isImageContent(r)?r:void 0}):i.type==="Link"?l.jsx(m8e,{...s,field:i,content:r}):i.type==="Number"?l.jsx(g8e,{...s,field:i,content:de.isNumberContent(r)?r:void 0}):i.type==="StructuredText"?l.jsx(vO,{...s,field:i,content:de.isRichTextContent(r)?r:void 0}):i.type==="Select"?l.jsx(y8e,{...s,field:i,content:de.isSelectContent(r)?r:void 0}):i.type==="Text"?l.jsx(qJ,{...s,field:i,content:de.isTextContent(r)?r:void 0}):i.type==="Embed"?l.jsx(wLe,{...s,field:i,content:de.isEmbedContent(r)?r:void 0}):i.type==="Color"?l.jsx(lLe,{...s,field:i,content:de.isColorContent(r)?r:void 0}):i.type==="GeoPoint"?l.jsx(xLe,{...s,field:i,content:de.isGeoPointContent(r)?r:void 0}):i.type==="IntegrationFields"?l.jsx(FPe,{...s,field:i,content:de.isIntegrationFieldContent(r)?r:void 0}):i.type==="Table"?l.jsx(x8e,{...s,field:i,content:de.isTableContent(r)?r:void 0}):null},[r,t,i,o,n]);return l.jsx(kw,{id:t,children:a})}function HJ(e){const{id:t,readOnly:n,content:r,widget:i}=e,o=ze.useStableCallback(e.onContentChange);return I.useMemo(()=>{const a={id:t,readOnly:n,onContentChange:o};return i.type==="Group"?l.jsx(yF,{...a,group:i,content:de.isGroupContent(r)?r:void 0}):l.jsx(eS,{...a,nestableWidget:i,content:de.isNestableContent(r)?r:void 0})},[r,t,i,o,n])}function yO(e){const{id:t,title:n,addItemButtonTitle:r,content:i,onContentChange:o,readOnly:a,repeatable:s=!0,repeatableZone:c}=e,u=Object.entries(c),d=I.useRef([YJ()]).current;let f=i??d;!s&&f.length>1&&(f=f.slice(0,1));const{scrollOffsetTop:p}=be();function h(x){return x.key}function m(x){const w=Mv([],crypto.randomUUID()),[v]=eLe.repeatableContentWithDefaultNestableContentValues(c,[w]);v&&o(wt.insertAtIndex(f,x,v))}function g(x){const{index:w,offset:v}=x;o(wt.move(f,w,w+v))}function y(x){o(wt.removeIndex(f,x))}function b(x,w,v,S){const C=F8e(x,[v,S]),_=j8e(f,[w,C]);o(_)}return Object.keys(c).length===0?null:l.jsx(A.Group,{title:n??"Repeatable zone",addItemButtonTitle:r??"Add item in repeatable zone",items:f,maxItems:s?void 0:1,getItemKey:h,onAddItem:m,dnd:{scrollOffsetTop:p,onReorder:o,renderDragPreview:({index:x})=>l.jsx(O8e,{title:n??"Repeatable zone",index:x}),renderDropIndicator:M8e},readOnly:a,children:(x,w)=>{const v=new Map(x.value),S=h(x);return l.jsx(A.LazyRender,{keepLoaded:!0,loadWhenSearching:!0,children:l.jsx(A.GroupItem,{index:w,title:`${w+1} • Item`,onMove:g,onDelete:y,readOnly:a,children:u.map(([C,_])=>l.jsx(HJ,{id:`${t}[${S}].${C}`,content:v.get(C),widget:_,onContentChange:R=>b(x,w,C,R),readOnly:a},C))})})}})}function j8e(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function F8e(e,t){const[n,r]=t;if(!r){const o=e.value.filter(([a])=>a!==n);return Mv(o,e.key)}const i=Array.from(new Map(e.value).set(n,r));return Mv(i,e.key)}function Mv(e,t){return{__TYPE__:"GroupItemContent",value:e,key:t}}function YJ(){return Mv([],crypto.randomUUID())}function O8e(e){const{title:t,index:n}=e;return l.jsxs(A.Box,{padding:{block:8,inline:12},backgroundColor:"grey3",border:!0,borderRadius:6,alignItems:"center",justifyContent:"space-between",width:"100%",children:[l.jsxs("div",{children:[l.jsx(A.Text,{variant:"smallBold",color:"grey11",children:t??"Repeatable zone"}),l.jsxs(A.Text,{variant:"small",color:"grey11",children:[n+1," • Item"]})]}),l.jsx(A.Icon,{name:"dragIndicator",size:"small",color:"grey8"})]})}function M8e(e){const{isDropTarget:t,itemIndex:n,position:r}=e,i=t?l.jsx(A.Line,{color:"purple",thickness:2,sx:{position:"absolute",left:0,right:0,bottom:n===0&&r==="before"?0:void 0}},"line"):void 0;return l.jsx(A.AnimatedElement,{enterDuration:150,children:i})}function L8e(e,t){let n=e;return n=P8e(n,t),n=D8e(n,t),n=U8e(n,t),n=B8e(n,t),n}function D8e(e,t){return he.flattenSections(t).reduce((r,[i,o])=>!e[i]&&o.type==="Group"?{...r,[i]:GJ()}:r,e)}function U8e(e,t){return de.traverseDocument({document:e,customType:t})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}function P8e(e,t){return de.traverseDocument({document:e,customType:t})({transformWidget({model:n,content:r}){if((n==null?void 0:n.type)==="Link"){const{repeat:i}=n.config??{};switch(r.__TYPE__){case"LinkContent":return i?VJ(r)??r:r;case"RepeatableContent":return i?r:zJ(r)??r;default:return r}}return r}})}function B8e(e,t){return de.fillDocumentWithDefaultValues(t,e)}function GJ(){return{__TYPE__:"GroupContentType",value:[YJ()]}}const JJ={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},Rx={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function bO(e){const{documentId:t,versionId:n,baseUrl:r,status:i,releaseId:o}=e,a={s:i,v:n,r:o},s=oi.createRouteParams({params:a}),c=new URLSearchParams(s).toString();return new URL(`pages/${t}?${c}`,r)}function W8e(e){const{children:t,...n}=e;return l.jsx(Fn.QueryErrorResetBoundary,{children:({reset:r})=>l.jsx(A.ErrorBoundary,{...n,onReset:r,children:t})})}function K8e(e){const{href:t,tracking:n}=e;return l.jsx(A.Box,{justifyContent:"center",padding:{block:6},children:l.jsxs(A.Text,{href:t,variant:"smallBold",color:"grey11",onClick:()=>void n.track({event:"shared-onboarding:follow-tutorial",source:n.source}),children:["Or watch our in-depth course",l.jsx(A.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function N8e(e){const{step:t,stepIndex:n,isOpen:r,onActionClick:i,onClose:o,contentRef:a}=e,[s,c]=I.useState(!1),[u,d]=I.useState(e.isStepComplete);I.useEffect(()=>{r&&d(e.isStepComplete)},[e.isStepComplete,r]);async function f(){if(r)try{c(!0),await i(u)}finally{c(!1)}}return l.jsxs(A.Dialog,{open:r,onOpenChange:o,size:"small",children:[l.jsx(A.DialogHeader,{title:"Onboarding"}),l.jsxs(A.DialogContent,{children:[l.jsx(A.ScrollArea,{children:l.jsxs(A.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[l.jsx(A.DialogDescription,{asChild:!0,children:l.jsxs("section",{children:[l.jsxs(A.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),l.jsx(A.Text,{variant:"h3",children:t.title}),t.content]})}),t.videoUrl&&l.jsx(A.Video,{src:t.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),l.jsxs(A.DialogActions,{children:[l.jsx(A.DialogCancelButton,{size:"medium",children:"Close"}),!t.defaultCompleted&&l.jsx(A.DialogActionButton,{size:"medium",onClick:f,loading:s,color:u?"darkGrey":"purple",children:u?"Undo step":"Complete step"})]})]})]})}function q8e(e){const{steps:t,completedSteps:n,onToggleStep:r,tracking:i,stepOverrides:o}=e,[a,s]=I.useState(!1),[c,u]=I.useState(t[0]),d=I.useRef(null);if(!c)return null;const f=t.findIndex(({id:y})=>y===c.id);function p(y){return n.includes(y.id)}function h(y){u(y),s(!0),i.track({event:"shared-onboarding:step-opened",stepId:y.id,stepTitle:y.title,source:i.source})}async function m(y=!1){var b;if(c&&(await r(c),!y)){(b=d.current)==null||b.animate([{opacity:0},{opacity:1}],{duration:400});const x=g();x?h(x):s(!1)}}function g(){let y=f+1;for(;y<t.length;){const b=t[y];if(b&&!p(b))return b;y++}}return l.jsxs(l.Fragment,{children:[l.jsx(N8e,{contentRef:d,isOpen:a,step:c,stepIndex:f,isStepComplete:p(c),onClose:()=>s(!1),onActionClick:m}),l.jsxs(A.DropdownMenu,{children:[l.jsx(A.DropdownMenuTrigger,{children:l.jsx(A.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:V8e,children:n.length>0?"Continue":"Start now"})}),l.jsxs(A.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[l.jsx(A.DropdownMenuLabel,{children:l.jsx(A.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),t.map((y,b)=>{const x=p(y);return l.jsx(A.DropdownMenuItem,{onSelect:(o==null?void 0:o[y.id])??(()=>h(y)),description:y.description,completed:x,endAdornment:l.jsx(A.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${b+1} ${y.title}`},y.id)})]})]})]})}function V8e(){return l.jsx(A.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function z8e(e){const{steps:t,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a,stepOverrides:s}=e,c=n.length===t.length;return l.jsx(A.Card,{variant:c?"elevated":"animated-light",paddingBlock:16,onClose:a,children:l.jsxs(A.CardContent,{children:[l.jsxs("div",{children:[l.jsx(A.Text,{variant:"bold",children:`Build your first page in ${t.length.toString()} simple steps`}),l.jsx(A.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),l.jsx(A.ProgressBar,{value:n.length,max:t.length,displayLabel:!0,getValueLabel:(u,d)=>`${u}/${d}`}),l.jsx(q8e,{steps:t,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}),r&&l.jsx(K8e,{href:r,tracking:i})]})})}function Q8e(e){const{framework:t,projectName:n,starterId:r,repositoryName:i}=e,{frameworkNameLabel:o,createProjectCodeSnippet:a}=H8e(e),s=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:l.jsx(A.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!r,content:l.jsx(A.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${o}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:l.jsxs(l.Fragment,{children:[l.jsx(A.Text,{sx:{marginBottom:16},children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."}),!!a&&l.jsx(Gp,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),l.jsx(A.Text,{variant:"small",sx:{marginTop:16},children:"(example for Next.js below)"})]})},{id:"setupSliceMachine",title:"Set up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:l.jsxs(l.Fragment,{children:[l.jsx(A.Text,{sx:{marginBottom:16},children:`Slice Machine is the Prismic tool for creating your content models.
208
208
  Install it in your ${o}project by running these commands:`}),l.jsx(Gp,{code:`cd ${n??"<your project name>"}
209
- npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:l.jsx(A.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:l.jsx(A.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:l.jsx(A.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:l.jsx(A.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:l.jsx(A.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:l.jsxs(A.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",l.jsx(A.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],c={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(u=>u.defaultCompleted?[u.id]:[]),tutorialLink:t?c[t]:void 0}}function H8e(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=R2[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:E2[t]}}const ZC=3e3,w2=400;function Y8e(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:c}=e,{context:u,isDismissed:d}=t,{steps:f,defaultCompletedStepIds:p,tutorialLink:h}=Q8e({...u,repositoryName:s,projectName:c}),m=x(t.completedSteps),g=G8e(y,w2);if(ze.useOnChange(d,()=>!d&&g.reset()),u.framework==="other")return l.jsx(l.Fragment,{children:o});function y(){i()}async function b(w){const v=await r(w.id);v.includes(w.id)&&n.track({event:"shared-onboarding:step-completed",stepId:w.id,stepTitle:w.title,source:n.source}),x(v).length===f.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),g.start())}function x(w){const v=f.map(({id:S})=>S);return Array.from(new Set([...w.filter(S=>v.includes(S)),...p]))}return d?null:l.jsx(A.AnimatedElement,{enterDuration:0,exitDuration:w2,children:g.status!=="hidden"&&l.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[l.jsx(z8e,{steps:f,completedSteps:m,tutorialLink:h,tracking:n,onToggleStep:b,onClose:g.status!=="animating"?y:void 0,stepOverrides:a}),l.jsx("div",{ref:g.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function G8e(e,t=400){const n=mZ.useConfetti({config:{duration:ZC}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),ZC-t),o.current||(setTimeout(e,ZC),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},c=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:c}}function ZJ(e){const{type:t,value:n}=e,r=t===na?hh.max:Ah.max;return l.jsx(A.Box,{alignItems:"center",children:l.jsx(A.Tooltip,{title:J8e[t],content:e7e[t],stableMount:!0,children:l.jsx(A.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const J8e={[na]:"Meta title length",[ls]:"Meta description length"},Z8e=`${hh.min}-${hh.max}`,X8e=`${Ah.min}-${Ah.max}`,e7e={[na]:`For optimal mobile SEO, keep your meta title within ${Z8e} characters to prevent it from being cut off in search results.`,[ls]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${X8e} characters. This helps improve visibility and click-through rates.`};function XJ(e){const{title:t,description:n}=e;return l.jsx(A.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:l.jsxs(A.CardContent,{gap:4,children:[l.jsx(A.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:Ft.overflow(t,hh.max)}),l.jsx(A.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),l.jsx(A.Text,{variant:"small",color:"grey11",noSelect:!0,children:Ft.overflow(n,Ah.max)})]})})}const eZ=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function tZ(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function t7e(e){const{content:t,customType:n}=e;return tZ(n)&&!t.uid}function nZ(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&r7e({document:i,uid:r})&&n7e({...e,document:i}))}function n7e(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function r7e(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}function tS(e,t){return`${e}___${t}`}const rZ=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function nS(){return I.useContext(rZ)}function i7e(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return l.jsx(l.Fragment,{children:a.map(([s,c])=>{const u=t[s];return l.jsx(eS,{id:`${n}.${s}`,readOnly:o,nestableWidget:c,content:de.isNestableContent(u)?u:void 0,onContentChange:d=>{i(o7e(t,s,d))}},s)})})}function o7e(e,t,n){return n?{...e,[t]:n}:Sd.removeKey(e,t)}function a7e(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,c=nS();function u(){i&&c.update({id:i,requestedFrom:"sliceFieldSet"})}return l.jsxs(A.FieldSet,{id:i&&tS("sliceFieldSet",i),selected:i?c.isSelected(i):!1,onFocus:u,legend:s7e(t),header:s,children:[l.jsx(i7e,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:d=>{r({...n,nonRepeat:d})}}),l.jsx(yO,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:d=>{r({...n,repeat:d})}})]})}function s7e(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const iZ={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function c7e(e){const{field:t}=e;if(t.type==="Image")return iZ}function u7e(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,c=nS();function u(){r&&c.update({id:r,requestedFrom:"sliceFieldSet"})}const d=n.type==="Group"?$w(n):_r(n);return l.jsx(A.FieldSet,{id:r&&tS("sliceFieldSet",r),selected:r?c.isSelected(r):!1,onFocus:u,legend:d,header:s,children:n.type==="Group"?l.jsx(yF,{id:i,readOnly:o,onContentChange:a,group:n,content:de.isGroupContent(t)?t:void 0}):l.jsx(eS,{id:i,readOnly:o,nestableWidget:n,content:de.isNestableContent(t)?t:void 0,onContentChange:f=>{const p=c7e({field:n});!f&&p&&a(p),f&&a(f)}})})}function l7e(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return l.jsx(l.Fragment,{children:a.map(([s,c])=>{const u=t[s];return l.jsx(HJ,{id:`${n}.${s}`,readOnly:o,widget:c,content:de.isSlicePrimaryContent(u)?u:void 0,onContentChange:d=>{i(d7e(t,s,d))}},s)})})}function d7e(e,t,n){return n?{...e,[t]:n}:Sd.removeKey(e,t)}function oZ(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,c=f7e(o,n.variation),u=I.useId(),f={id:s.id??u,readOnly:i},p=nS();function h(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return c===void 0?null:l.jsx(Nv.Provider,{value:t,children:l.jsx(nLe,{children:l.jsxs(A.FieldSet,{id:r&&tS("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:h,legend:p7e(o,c),children:[l.jsx(A.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:l.jsx(l7e,{...f,slicePrimaryZone:c.primary??{},content:n.primary,onContentChange:m=>{a({...n,primary:m})}})}),l.jsx(yO,{...f,repeatableZone:c.items??{},content:n.items,onContentChange:m=>{a({...n,items:m})}})]})})})}function f7e(e,t){return I.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function p7e(e,t){return[e.name,t.name].join(" • ")}function x2(e){var c,u;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(u=(c=t.config)==null?void 0:c.labels)==null?void 0:u[i.name];if(!o)return null;const a=o.find(d=>d.name===i.maybeLabel);function s(d){const f=r.value.map(p=>p.key===i.key?{...p,maybeLabel:d}:p);n({...r,value:f})}return l.jsxs(l.Fragment,{children:[l.jsx(A.Text,{component:"span",variant:"smallBold",children:"•"}),l.jsxs(A.DropdownMenu,{children:[l.jsx(A.DropdownMenuTrigger,{children:l.jsx(A.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),l.jsxs(A.DropdownMenuContent,{align:"start",maxHeight:256,children:[l.jsx(A.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?l.jsx(A.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(d=>l.jsx(A.DropdownMenuItem,{onSelect:()=>s(d.name),endIcon:d.name===i.maybeLabel?l.jsx(A.Icon,{name:"check"}):void 0,children:d.display??"[Missing display value]"},d.name))]})]})]})}function h7e(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=be();return l.jsx(l.Fragment,{children:t==null?void 0:t.value.map((s,c)=>{var p,h;const u=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[s.name];if(u===void 0)return null;const d={...s.widget,key:s.key},f={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:m=>{const g={...s,widget:m},y=A7e(t,[c,g]);r(y)},readOnly:i};return u.type==="SharedSlice"?de.isSharedSliceContent(d)?l.jsx(oZ,{...f,config:a,sharedSlice:u,content:d}):null:u.type==="Slice"?de.isCompositeSliceContent(d)?l.jsx(a7e,{...f,compositeSlice:u,content:d,header:l.jsx(x2,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:de.isSimpleSliceContent(d)?l.jsx(u7e,{...f,legacySlice:u,content:d,header:l.jsx(x2,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function A7e(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function m7e(e){const{content:t,metadataFieldType:n,documentId:r="new-document",documentContent:i,documentCustomType:o,documentLocale:a,...s}=e,{showAlert:c}=A.useAlert(),[u,d]=I.useState(!1),f=be(),p=I.useMemo(()=>dQ(i,o),[i,o]),h=fQ(p);async function m(){if(!f.aiSeoMetadataEnabled)return;const{trackMetadataGeneration:g,authStrategy:y,documentBaseUrl:b,repository:x}=f;d(!0);try{const w=await lQ(x,b,y,{pageTextContent:p,contentLocale:a});e.onContentChange({__TYPE__:"FieldContent",type:"Text",value:w[n]}),g({documentId:r,locale:a,suggestion:w[n],type:n})}catch{c({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${_2[n]}`})}d(!1)}return l.jsx(qJ,{...s,content:t,placeholder:`${_2[n]}..`,endAdornment:l.jsxs(l.Fragment,{children:[l.jsx(ZJ,{type:n,value:(t==null?void 0:t.value)||""}),l.jsx(A.Tooltip,{content:h?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:l.jsx(A.Button,{disabled:!h,onClick:m,size:"small",color:"grey",startIcon:"autoFixHigh",loading:u,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const _2={[na]:"Meta title",[ls]:"Meta description"};function g7e(e){const{id:t,field:n,content:r,onContentChange:i,readOnly:o}=e,a=ze.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:s}=I.useContext(eZ);function c(d){s();const f=Ft.slugify(d);i(b7e(f)),a.set(f)}function u(d){o||(c(d.clipboardData.getData("Text").trim()),d.preventDefault())}return l.jsxs(A.Field,{children:[l.jsx(A.FieldIcon,{name:"tag"}),l.jsx(A.FieldLabel,{htmlFor:t,children:_r(n)}),l.jsx(A.FieldControl,{children:l.jsx(Cc,{id:t,variant:"success",placeholder:Hf(n,"Enter a unique identifier"),value:a.value,onPaste:u,onValueChange:c,endAdornment:l.jsx(A.AnimatedElement,{enterDuration:150,children:l.jsx(v7e,{uid:a.debouncedValue})}),readOnly:o})})]})}function v7e(e){const{uid:t}=e,n=be();return t?n.uidField?l.jsx(A.ErrorBoundary,{children:l.jsx(I.Suspense,{children:l.jsx(y7e,{uid:t})})}):null:l.jsx(A.Badge,{color:"tomato",title:"Required",size:"medium"})}function y7e(e){const t=S7e(e),n=be();if(!t.documentId)return null;const r=bO({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return l.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer",children:l.jsx(A.Badge,{color:"tomato",size:"medium",title:l.jsxs(A.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",l.jsx(A.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function b7e(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function S7e(e){var p,h,m,g;const{uid:t}=e,n=be();n.uidField||xt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,{data:c}=_F({baseUrl:r,authStrategy:i,uids:[t]}),u=c.results,f=nZ({customTypeId:o,languageId:a,documentsWithUid:u,documentId:s,uid:t})[0];return f?{documentId:f.id,versionId:(p=f.versions[0])==null?void 0:p.version_id,status:(h=f.versions[0])==null?void 0:h.status,releaseId:((m=f.versions[0])==null?void 0:m.status)==="release"?(g=f.versions[0])==null?void 0:g.release_id:void 0}:{}}function C7e(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:c,documentLocale:u}=e,d=be(),f=I.useMemo(()=>Object.entries(r),[r]),p=I.useRef(i);if(I.useEffect(()=>{p.current=i},[i]),f.length===0)return null;const h=x7e(f),m=lv(i[na])||"Meta title..",g=lv(i[ls])||"Meta description..";return l.jsxs(A.FieldSet,{legend:"Page data",children:[h&&l.jsx(XJ,{title:m,description:g}),f.map(([y,b])=>{const x={id:`${t}.${y}`,onContentChange:v=>{const{[y]:S,...C}=p.current;o({...C,...v!==void 0&&{[y]:v}})},readOnly:n},w=i[y];return b.type==="UID"?l.jsx(kw,{id:y,children:l.jsx(g7e,{...x,content:de.isUIDContent(w)?w:void 0,field:b})},y):b.type==="Group"?I.createElement(yF,{...x,id:y,content:de.isGroupContent(w)?w:void 0,group:b,key:y}):d.aiSeoMetadataEnabled&&w7e(y)&&b.type==="Text"?l.jsx(kw,{id:y,children:l.jsx(m7e,{...x,content:de.isTextContent(w)?w:void 0,field:b,metadataFieldType:y,documentId:a,documentContent:s,documentCustomType:c,documentLocale:u})},y):I.createElement(eS,{...x,id:y,content:de.isNestableContent(w)?w:void 0,key:y,nestableWidget:b})})]})}function w7e(e){return e===na||e===ls}const x7e=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===na&&((n=e[1])==null?void 0:n[0])===ls};function _7e(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:c,documentLocale:u}=e,[d,f]=I7e(r),[p,h]=R7e(i);return l.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[l.jsx(C7e,{id:t,readOnly:n,staticZone:d,documentId:a,content:p,onContentChange:m=>o({...h,...m}),documentContent:s,documentCustomType:c,documentLocale:u}),f.map(([m,g])=>{const y=h[m];return l.jsx(h7e,{id:m,readOnly:n,sliceZone:g,content:y,onContentChange:b=>o({...p,...h,[m]:b})},m)})]})}function T7e(e){return e.type==="Choice"||e.type==="Slices"}function I7e(e){return Object.entries(e).reduce(([t,n],[r,i])=>(T7e(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function R7e(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(de.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function E7e(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,documentId:o,content:a,locale:s,onContentChange:c}=e,u=I.useId();if(Sd.isEmpty(r.json))return null;const d=$7e(r,i),[f,p]=k7e(d,a);return l.jsx(Nv.Provider,{value:t,children:l.jsx(tLe,{customTypeFormat:r.format,children:l.jsx(_7e,{id:u,readOnly:n,section:d,documentId:o,content:f,onContentChange:h=>c({...p,...h}),documentContent:a,documentCustomType:r,documentLocale:s})})})}function $7e(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function k7e(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,s={[i]:o};return[{...n,...a?s:{}},{...r,...a?{}:s}]},[{},{}])}exports.APIExplorer=jOe;exports.DeferredBarChart=FOe;exports.DeferredCodeBlock=Gp;exports.Document=HLe;exports.DocumentEditor=E7e;exports.EditorConfigContext=Nv;exports.EditorErrorBoundary=W8e;exports.MediaLibrary=AH;exports.MetadataBadge=ZJ;exports.MetadataPreview=XJ;exports.OnboardingGuide=Y8e;exports.OnboardingStepId=oDe;exports.SelectionManagerProvider=QQ;exports.SharedSliceEditor=oZ;exports.SliceSelectionContext=rZ;exports.TeamSpace=$1;exports.UIDContext=eZ;exports.createSearchParams=SQ;exports.createTeamSpace=xDe;exports.defaultGroupContentWithOneItem=GJ;exports.defaultImageContentWidget=iZ;exports.deleteTeamSpace=TDe;exports.documentKeys=wo;exports.documentMetaSchema=wF;exports.documentStatus=JJ;exports.extractTextFromField=lv;exports.fetchCustomTypes=sFe;exports.frameworkCreateProjectCodeSnippet=E2;exports.frameworkLabels=R2;exports.generateSEOMetadata=lQ;exports.getConflictingUidDocuments=nZ;exports.getCustomTypesOptions=bm;exports.getDocumentById=Im;exports.getDocumentList=xF;exports.getDocumentListOptions=CQ;exports.getOnboarding=aDe;exports.getPageTextContent=dQ;exports.getProfile=DQ;exports.getRepository=E1;exports.getRepositoryTags=RQ;exports.getRepositoryV2=iDe;exports.getRoleLabel=dDe;exports.getRoles=FQ;exports.getRolesOptions=vDe;exports.getSliceSelectionDOMId=tS;exports.getStaticCustomTypeOptions=aF;exports.getTeamSpaces=OQ;exports.getTeamSpacesOptions=CDe;exports.hasUIDField=tZ;exports.invalidateCustomTypes=uFe;exports.invalidateDocumentListData=JLe;exports.isAdminRole=uDe;exports.isDocumentSearchVersion=Ow;exports.isDocumentVersion=gQ;exports.isMissingUID=t7e;exports.isPageContentRelevantForAISeo=fQ;exports.isValidSimulatorURL=IQ;exports.languageSchema=CF;exports.makeSearchFullTextDocumentsQueryString=bQ;exports.metaDescriptionConfig=Ah;exports.metaDescriptionProperty=ls;exports.metaTitleConfig=hh;exports.metaTitleProperty=na;exports.onboardingStateSchema=$Q;exports.onboardingToggleResultSchema=jQ;exports.onboardingToggleStepResultSchema=kQ;exports.prefetchCustomTypes=aFe;exports.prepareDocument=L8e;exports.profileResponse=LQ;exports.repositoryFramework=R1;exports.repositorySchemaV2=EQ;exports.roleMap=EDe;exports.searchDocumentStatus=Rx;exports.searchDocuments=wQ;exports.searchDocumentsQueryOptions=xQ;exports.searchFullTextDocuments=yQ;exports.sliceItemContentSchema=YLe;exports.suppressErrors=bee;exports.throwConfigError=xt;exports.toggleOnboarding=cDe;exports.toggleOnboardingStep=sDe;exports.updateDocumentListData=GLe;exports.updateRoles=yDe;exports.updateTeamSpace=_De;exports.useCustomType=cFe;exports.useCustomTypes=f1;exports.useDocumentList=_F;exports.useInvalidateRoles=bDe;exports.useInvalidateTeamSpaces=wDe;exports.usePrefetchStaticCustomType=pFe;exports.useProfile=RF;exports.useSelectionManager=wc;exports.useSliceSelection=nS;exports.useStaticCustomType=fFe;
209
+ npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:l.jsx(A.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:l.jsx(A.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:l.jsx(A.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:l.jsx(A.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:l.jsx(A.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:l.jsxs(A.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",l.jsx(A.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],c={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(u=>u.defaultCompleted?[u.id]:[]),tutorialLink:t?c[t]:void 0}}function H8e(e){const{framework:t}=e;if(!t||t==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=R2[t];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:E2[t]}}const ZC=3e3,w2=400;function Y8e(e){const{onboardingState:t,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:c}=e,{context:u,isDismissed:d}=t,{steps:f,defaultCompletedStepIds:p,tutorialLink:h}=Q8e({...u,repositoryName:s,projectName:c}),m=x(t.completedSteps),g=G8e(y,w2);if(ze.useOnChange(d,()=>!d&&g.reset()),u.framework==="other")return l.jsx(l.Fragment,{children:o});function y(){i()}async function b(w){const v=await r(w.id);v.includes(w.id)&&n.track({event:"shared-onboarding:step-completed",stepId:w.id,stepTitle:w.title,source:n.source}),x(v).length===f.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),g.start())}function x(w){const v=f.map(({id:S})=>S);return Array.from(new Set([...w.filter(S=>v.includes(S)),...p]))}return d?null:l.jsx(A.AnimatedElement,{enterDuration:0,exitDuration:w2,children:g.status!=="hidden"&&l.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[l.jsx(z8e,{steps:f,completedSteps:m,tutorialLink:h,tracking:n,onToggleStep:b,onClose:g.status!=="animating"?y:void 0,stepOverrides:a}),l.jsx("div",{ref:g.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function G8e(e,t=400){const n=mZ.useConfetti({config:{duration:ZC}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),ZC-t),o.current||(setTimeout(e,ZC),o.current=!0)},[e,t]),s=()=>{n.throwConfetti(),a()},c=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:c}}function ZJ(e){const{type:t,value:n}=e,r=t===na?hh.max:Ah.max;return l.jsx(A.Box,{alignItems:"center",children:l.jsx(A.Tooltip,{title:J8e[t],content:e7e[t],stableMount:!0,children:l.jsx(A.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const J8e={[na]:"Meta title length",[ls]:"Meta description length"},Z8e=`${hh.min}-${hh.max}`,X8e=`${Ah.min}-${Ah.max}`,e7e={[na]:`For optimal mobile SEO, keep your meta title within ${Z8e} characters to prevent it from being cut off in search results.`,[ls]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${X8e} characters. This helps improve visibility and click-through rates.`};function XJ(e){const{title:t,description:n}=e;return l.jsx(A.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:l.jsxs(A.CardContent,{gap:4,children:[l.jsx(A.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:Ft.overflow(t,hh.max)}),l.jsx(A.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),l.jsx(A.Text,{variant:"small",color:"grey11",noSelect:!0,children:Ft.overflow(n,Ah.max)})]})})}const eZ=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function tZ(e){return Object.values(e.json).some(t=>{var n;return((n=t.uid)==null?void 0:n.type)==="UID"})}function t7e(e){const{content:t,customType:n}=e;return tZ(n)&&!t.uid}function nZ(e){const{documentId:t,documentsWithUid:n,uid:r}=e;return n.filter(i=>t!==i.id&&r7e({document:i,uid:r})&&n7e({...e,document:i}))}function n7e(e){const{customTypeId:t,languageId:n,document:r}=e,i=t===r.custom_type_id,o=n===r.language.id;return i&&o}function r7e(e){const{document:t,uid:n}=e,r=t.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}function tS(e,t){return`${e}___${t}`}const rZ=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function nS(){return I.useContext(rZ)}function i7e(e){const{content:t,id:n,nonRepeatableZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return l.jsx(l.Fragment,{children:a.map(([s,c])=>{const u=t[s];return l.jsx(eS,{id:`${n}.${s}`,readOnly:o,nestableWidget:c,content:de.isNestableContent(u)?u:void 0,onContentChange:d=>{i(o7e(t,s,d))}},s)})})}function o7e(e,t,n){return n?{...e,[t]:n}:Sd.removeKey(e,t)}function a7e(e){const{compositeSlice:t,content:n,onContentChange:r,sliceKey:i,id:o,readOnly:a,header:s}=e,c=nS();function u(){i&&c.update({id:i,requestedFrom:"sliceFieldSet"})}return l.jsxs(A.FieldSet,{id:i&&tS("sliceFieldSet",i),selected:i?c.isSelected(i):!1,onFocus:u,legend:s7e(t),header:s,children:[l.jsx(i7e,{id:o,readOnly:a,nonRepeatableZone:t["non-repeat"]??{},content:n.nonRepeat,onContentChange:d=>{r({...n,nonRepeat:d})}}),l.jsx(yO,{id:o,readOnly:a,repeatableZone:t.repeat??{},content:n.repeat,onContentChange:d=>{r({...n,repeat:d})}})]})}function s7e(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const iZ={__TYPE__:"ImageContent",edit:{background:"",crop:{x:0,y:0},zoom:0},height:0,width:0,origin:{height:0,width:0,id:"",url:""},url:""};function c7e(e){const{field:t}=e;if(t.type==="Image")return iZ}function u7e(e){const{content:t,legacySlice:n,sliceKey:r,id:i,readOnly:o,onContentChange:a,header:s}=e,c=nS();function u(){r&&c.update({id:r,requestedFrom:"sliceFieldSet"})}const d=n.type==="Group"?$w(n):_r(n);return l.jsx(A.FieldSet,{id:r&&tS("sliceFieldSet",r),selected:r?c.isSelected(r):!1,onFocus:u,legend:d,header:s,children:n.type==="Group"?l.jsx(yF,{id:i,readOnly:o,onContentChange:a,group:n,content:de.isGroupContent(t)?t:void 0}):l.jsx(eS,{id:i,readOnly:o,nestableWidget:n,content:de.isNestableContent(t)?t:void 0,onContentChange:f=>{const p=c7e({field:n});!f&&p&&a(p),f&&a(f)}})})}function l7e(e){const{content:t,id:n,slicePrimaryZone:r,onContentChange:i,readOnly:o}=e,a=I.useMemo(()=>Object.entries(r),[r]);return l.jsx(l.Fragment,{children:a.map(([s,c])=>{const u=t[s];return l.jsx(HJ,{id:`${n}.${s}`,readOnly:o,widget:c,content:de.isSlicePrimaryContent(u)?u:void 0,onContentChange:d=>{i(d7e(t,s,d))}},s)})})}function d7e(e,t,n){return n?{...e,[t]:n}:Sd.removeKey(e,t)}function oZ(e){const{config:t,content:n,sliceKey:r,readOnly:i=!1,sharedSlice:o,onContentChange:a,...s}=e,c=f7e(o,n.variation),u=I.useId(),f={id:s.id??u,readOnly:i},p=nS();function h(){r&&p.update({id:r,requestedFrom:"sliceFieldSet"})}return c===void 0?null:l.jsx(Nv.Provider,{value:t,children:l.jsx(nLe,{children:l.jsxs(A.FieldSet,{id:r&&tS("sliceFieldSet",r),selected:r?p.isSelected(r):!1,onFocus:h,legend:p7e(o,c),children:[l.jsx(A.LazyRender,{heightEstimate:400,gap:16,keepLoaded:!0,loadWhenSearching:!0,children:l.jsx(l7e,{...f,slicePrimaryZone:c.primary??{},content:n.primary,onContentChange:m=>{a({...n,primary:m})}})}),l.jsx(yO,{...f,repeatableZone:c.items??{},content:n.items,onContentChange:m=>{a({...n,items:m})}})]})})})}function f7e(e,t){return I.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function p7e(e,t){return[e.name,t.name].join(" • ")}function x2(e){var c,u;const{sliceZone:t,onChange:n,slices:r,sliceContent:i}=e,o=(u=(c=t.config)==null?void 0:c.labels)==null?void 0:u[i.name];if(!o)return null;const a=o.find(d=>d.name===i.maybeLabel);function s(d){const f=r.value.map(p=>p.key===i.key?{...p,maybeLabel:d}:p);n({...r,value:f})}return l.jsxs(l.Fragment,{children:[l.jsx(A.Text,{component:"span",variant:"smallBold",children:"•"}),l.jsxs(A.DropdownMenu,{children:[l.jsx(A.DropdownMenuTrigger,{children:l.jsx(A.Button,{color:"grey",size:"small",endIcon:"arrowDropDown",invisible:!0,children:(a==null?void 0:a.display)??"Slice variation"})}),l.jsxs(A.DropdownMenuContent,{align:"start",maxHeight:256,children:[l.jsx(A.DropdownMenuItem,{onSelect:()=>s(void 0),endIcon:i.maybeLabel===void 0?l.jsx(A.Icon,{name:"check"}):void 0,children:"..."}),o==null?void 0:o.map(d=>l.jsx(A.DropdownMenuItem,{onSelect:()=>s(d.name),endIcon:d.name===i.maybeLabel?l.jsx(A.Icon,{name:"check"}):void 0,children:d.display??"[Missing display value]"},d.name))]})]})]})}function h7e(e){const{content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o}=e,a=be();return l.jsx(l.Fragment,{children:t==null?void 0:t.value.map((s,c)=>{var p,h;const u=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[s.name];if(u===void 0)return null;const d=s.widget,f={id:`${n}[${s.key}]`,key:s.key,sliceKey:s.key,onContentChange:m=>{const g={...s,widget:m},y=A7e(t,[c,g]);r(y)},readOnly:i};return u.type==="SharedSlice"?de.isSharedSliceContent(d)?l.jsx(oZ,{...f,config:a,sharedSlice:u,content:d}):null:u.type==="Slice"?de.isCompositeSliceContent(d)?l.jsx(a7e,{...f,compositeSlice:u,content:d,header:l.jsx(x2,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null:de.isSimpleSliceContent(d)?l.jsx(u7e,{...f,legacySlice:u,content:d,header:l.jsx(x2,{sliceContent:s,sliceZone:o,slices:t,onChange:r})}):null})})}function A7e(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}function m7e(e){const{content:t,metadataFieldType:n,documentId:r="new-document",documentContent:i,documentCustomType:o,documentLocale:a,...s}=e,{showAlert:c}=A.useAlert(),[u,d]=I.useState(!1),f=be(),p=I.useMemo(()=>dQ(i,o),[i,o]),h=fQ(p);async function m(){if(!f.aiSeoMetadataEnabled)return;const{trackMetadataGeneration:g,authStrategy:y,documentBaseUrl:b,repository:x}=f;d(!0);try{const w=await lQ(x,b,y,{pageTextContent:p,contentLocale:a});e.onContentChange({__TYPE__:"FieldContent",type:"Text",value:w[n]}),g({documentId:r,locale:a,suggestion:w[n],type:n})}catch{c({id:n,title:"Error",subtitle:`Failed to generate SEO metadata for ${_2[n]}`})}d(!1)}return l.jsx(qJ,{...s,content:t,placeholder:`${_2[n]}..`,endAdornment:l.jsxs(l.Fragment,{children:[l.jsx(ZJ,{type:n,value:(t==null?void 0:t.value)||""}),l.jsx(A.Tooltip,{content:h?"Generate SEO metadata from your page content.":"Your page content is too short to generate SEO metadata.",children:l.jsx(A.Button,{disabled:!h,onClick:m,size:"small",color:"grey",startIcon:"autoFixHigh",loading:u,sx:{alignSelf:"center",marginInline:8},children:"Generate"})})]})})}const _2={[na]:"Meta title",[ls]:"Meta description"};function g7e(e){const{id:t,field:n,content:r,onContentChange:i,readOnly:o}=e,a=ze.useDebounceState({state:(r==null?void 0:r.value)??"",synchronize:!0}),{onEditUID:s}=I.useContext(eZ);function c(d){s();const f=Ft.slugify(d);i(b7e(f)),a.set(f)}function u(d){o||(c(d.clipboardData.getData("Text").trim()),d.preventDefault())}return l.jsxs(A.Field,{children:[l.jsx(A.FieldIcon,{name:"tag"}),l.jsx(A.FieldLabel,{htmlFor:t,children:_r(n)}),l.jsx(A.FieldControl,{children:l.jsx(Cc,{id:t,variant:"success",placeholder:Hf(n,"Enter a unique identifier"),value:a.value,onPaste:u,onValueChange:c,endAdornment:l.jsx(A.AnimatedElement,{enterDuration:150,children:l.jsx(v7e,{uid:a.debouncedValue})}),readOnly:o})})]})}function v7e(e){const{uid:t}=e,n=be();return t?n.uidField?l.jsx(A.ErrorBoundary,{children:l.jsx(I.Suspense,{children:l.jsx(y7e,{uid:t})})}):null:l.jsx(A.Badge,{color:"tomato",title:"Required",size:"medium"})}function y7e(e){const t=S7e(e),n=be();if(!t.documentId)return null;const r=bO({status:t.status,releaseId:t.releaseId,documentId:t.documentId,versionId:t.versionId,baseUrl:n.baseUrl});return l.jsx("a",{href:r.href,target:"_blank",rel:"noreferrer",children:l.jsx(A.Badge,{color:"tomato",size:"medium",title:l.jsxs(A.Text,{color:"tomato11",variant:"small",children:["Value already used in"," ",l.jsx(A.Text,{color:"tomato11",variant:"small",underline:!0,children:"another document"})]})})})}function b7e(e){return e===""?void 0:{__TYPE__:"UIDContent",value:e}}function S7e(e){var p,h,m,g;const{uid:t}=e,n=be();n.uidField||xt("uidField");const{coreApiBaseUrl:r,authStrategy:i,customTypeId:o,localeId:a,documentId:s}=n,{data:c}=_F({baseUrl:r,authStrategy:i,uids:[t]}),u=c.results,f=nZ({customTypeId:o,languageId:a,documentsWithUid:u,documentId:s,uid:t})[0];return f?{documentId:f.id,versionId:(p=f.versions[0])==null?void 0:p.version_id,status:(h=f.versions[0])==null?void 0:h.status,releaseId:((m=f.versions[0])==null?void 0:m.status)==="release"?(g=f.versions[0])==null?void 0:g.release_id:void 0}:{}}function C7e(e){const{id:t,readOnly:n,staticZone:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:c,documentLocale:u}=e,d=be(),f=I.useMemo(()=>Object.entries(r),[r]),p=I.useRef(i);if(I.useEffect(()=>{p.current=i},[i]),I.useEffect(()=>{window.dispatchEvent(new Event("prismic-static-zone-rendered"))},[]),f.length===0)return null;const h=x7e(f),m=lv(i[na])||"Meta title..",g=lv(i[ls])||"Meta description..";return l.jsxs(A.FieldSet,{legend:"Page data",children:[h&&l.jsx(XJ,{title:m,description:g}),f.map(([y,b])=>{const x={id:`${t}.${y}`,onContentChange:v=>{const{[y]:S,...C}=p.current;o({...C,...v!==void 0&&{[y]:v}})},readOnly:n},w=i[y];return b.type==="UID"?l.jsx(kw,{id:y,children:l.jsx(g7e,{...x,content:de.isUIDContent(w)?w:void 0,field:b})},y):b.type==="Group"?I.createElement(yF,{...x,id:y,content:de.isGroupContent(w)?w:void 0,group:b,key:y}):d.aiSeoMetadataEnabled&&w7e(y)&&b.type==="Text"?l.jsx(kw,{id:y,children:l.jsx(m7e,{...x,content:de.isTextContent(w)?w:void 0,field:b,metadataFieldType:y,documentId:a,documentContent:s,documentCustomType:c,documentLocale:u})},y):I.createElement(eS,{...x,id:y,content:de.isNestableContent(w)?w:void 0,key:y,nestableWidget:b})})]})}function w7e(e){return e===na||e===ls}const x7e=e=>{var t,n;return((t=e[0])==null?void 0:t[0])===na&&((n=e[1])==null?void 0:n[0])===ls};function _7e(e){const{id:t,readOnly:n,section:r,content:i,onContentChange:o,documentId:a,documentContent:s,documentCustomType:c,documentLocale:u}=e,[d,f]=I7e(r),[p,h]=R7e(i);return l.jsxs("div",{style:{display:"flex",flexDirection:"column",position:"relative",zIndex:0},children:[l.jsx(C7e,{id:t,readOnly:n,staticZone:d,documentId:a,content:p,onContentChange:m=>o({...h,...m}),documentContent:s,documentCustomType:c,documentLocale:u}),f.map(([m,g])=>{const y=h[m];return l.jsx(h7e,{id:m,readOnly:n,sliceZone:g,content:y,onContentChange:b=>o({...p,...h,[m]:b})},m)})]})}function T7e(e){return e.type==="Choice"||e.type==="Slices"}function I7e(e){return Object.entries(e).reduce(([t,n],[r,i])=>(T7e(i)?n.push([r,i]):Object.assign(t,{[r]:i}),[t,n]),[{},[]])}function R7e(e){return Object.entries(e).reduce(([t,n],[r,i])=>{const o={[r]:i};return Object.assign(de.isSlicesContent(i)?n:t,o),[t,n]},[{},{}])}function E7e(e){const{config:t,readOnly:n=!1,customType:r,sectionName:i,documentId:o,content:a,locale:s,onContentChange:c}=e,u=I.useId();if(Sd.isEmpty(r.json))return null;const d=$7e(r,i),[f,p]=k7e(d,a);return l.jsx(Nv.Provider,{value:t,children:l.jsx(tLe,{customTypeFormat:r.format,children:l.jsx(_7e,{id:u,readOnly:n,section:d,documentId:o,content:f,onContentChange:h=>c({...p,...h}),documentContent:a,documentCustomType:r,documentLocale:s})})})}function $7e(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function k7e(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,s={[i]:o};return[{...n,...a?s:{}},{...r,...a?{}:s}]},[{},{}])}exports.APIExplorer=jOe;exports.DeferredBarChart=FOe;exports.DeferredCodeBlock=Gp;exports.Document=HLe;exports.DocumentEditor=E7e;exports.EditorConfigContext=Nv;exports.EditorErrorBoundary=W8e;exports.MediaLibrary=AH;exports.MetadataBadge=ZJ;exports.MetadataPreview=XJ;exports.OnboardingGuide=Y8e;exports.OnboardingStepId=oDe;exports.SelectionManagerProvider=QQ;exports.SharedSliceEditor=oZ;exports.SliceSelectionContext=rZ;exports.TeamSpace=$1;exports.UIDContext=eZ;exports.createSearchParams=SQ;exports.createTeamSpace=xDe;exports.defaultGroupContentWithOneItem=GJ;exports.defaultImageContentWidget=iZ;exports.deleteTeamSpace=TDe;exports.documentKeys=wo;exports.documentMetaSchema=wF;exports.documentStatus=JJ;exports.extractTextFromField=lv;exports.fetchCustomTypes=sFe;exports.frameworkCreateProjectCodeSnippet=E2;exports.frameworkLabels=R2;exports.generateSEOMetadata=lQ;exports.getConflictingUidDocuments=nZ;exports.getCustomTypesOptions=bm;exports.getDocumentById=Im;exports.getDocumentList=xF;exports.getDocumentListOptions=CQ;exports.getOnboarding=aDe;exports.getPageTextContent=dQ;exports.getProfile=DQ;exports.getRepository=E1;exports.getRepositoryTags=RQ;exports.getRepositoryV2=iDe;exports.getRoleLabel=dDe;exports.getRoles=FQ;exports.getRolesOptions=vDe;exports.getSliceSelectionDOMId=tS;exports.getStaticCustomTypeOptions=aF;exports.getTeamSpaces=OQ;exports.getTeamSpacesOptions=CDe;exports.hasUIDField=tZ;exports.invalidateCustomTypes=uFe;exports.invalidateDocumentListData=JLe;exports.isAdminRole=uDe;exports.isDocumentSearchVersion=Ow;exports.isDocumentVersion=gQ;exports.isMissingUID=t7e;exports.isPageContentRelevantForAISeo=fQ;exports.isValidSimulatorURL=IQ;exports.languageSchema=CF;exports.makeSearchFullTextDocumentsQueryString=bQ;exports.metaDescriptionConfig=Ah;exports.metaDescriptionProperty=ls;exports.metaTitleConfig=hh;exports.metaTitleProperty=na;exports.onboardingStateSchema=$Q;exports.onboardingToggleResultSchema=jQ;exports.onboardingToggleStepResultSchema=kQ;exports.prefetchCustomTypes=aFe;exports.prepareDocument=L8e;exports.profileResponse=LQ;exports.repositoryFramework=R1;exports.repositorySchemaV2=EQ;exports.roleMap=EDe;exports.searchDocumentStatus=Rx;exports.searchDocuments=wQ;exports.searchDocumentsQueryOptions=xQ;exports.searchFullTextDocuments=yQ;exports.sliceItemContentSchema=YLe;exports.suppressErrors=bee;exports.throwConfigError=xt;exports.toggleOnboarding=cDe;exports.toggleOnboardingStep=sDe;exports.updateDocumentListData=GLe;exports.updateRoles=yDe;exports.updateTeamSpace=_De;exports.useCustomType=cFe;exports.useCustomTypes=f1;exports.useDocumentList=_F;exports.useInvalidateRoles=bDe;exports.useInvalidateTeamSpaces=wDe;exports.usePrefetchStaticCustomType=pFe;exports.useProfile=RF;exports.useSelectionManager=wc;exports.useSliceSelection=nS;exports.useStaticCustomType=fFe;
package/dist/index.es.js CHANGED
@@ -2,9 +2,9 @@ var aee = Object.defineProperty;
2
2
  var see = (e, t, n) => t in e ? aee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var He = (e, t, n) => (see(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  import { jsxs as E, jsx as f, Fragment as oe } from "react/jsx-runtime";
5
- import { Box as B, Text as j, ErrorBoundary as Bt, Alert as Qy, Skeleton as Ot, LazyCodeBlock as cee, ComboBox as OA, ComboBoxInput as FA, ComboBoxContent as MA, ComboBoxItem as Nd, Badge as Gn, AnimatedFormError as uee, FormInput as Ar, FormField as hB, Dialog as Eo, DialogHeader as as, DialogContent as $o, DialogDescription as Lc, DialogActions as ss, DialogActionLink as AB, DialogCancelButton as cs, DialogActionButton as xc, FormDateInput as TS, ActionList as mB, ActionListItem as gB, IconButton as Va, DropdownMenu as $i, DropdownMenuTrigger as ki, Button as Be, DropdownMenuContent as Oi, DropdownMenuItem as At, Icon as Le, Select as Wh, SelectItem as In, SelectSeparator as vB, RadioGroup as lee, ButtonGroup as Hy, RadioItem as lx, Form as dee, useToast as yB, Kbd as dx, Tooltip as Jt, Switch as Yy, Card as us, CardContent as Ga, ToastProvider as fee, TooltipProvider as pee, Separator as nT, LazyBarChart as hee, Field as Fi, FieldIcon as mr, FieldLabel as Mi, FieldControl as Li, ColorInput as Aee, DateInput as bB, TextInput as mee, PreviewCard as rT, PreviewImage as CB, PreviewContent as iT, FieldFooter as g_, CardHeaderTitle as gee, CardHeader as vee, BlankSlate as Uc, BlankSlateIcon as ls, BlankSlateTitle as Ja, BlankSlateActions as SB, useAlert as ds, BlankSlateDescription as Cf, FileUploadButton as Kh, FormSearchInput as LA, Portal as yee, FileDropZone as wB, DefaultErrorMessage as _B, dialogErrorImage as IB, useMediaQuery as bee, MediaCard as TB, AnimatedElement as Sf, ScrollArea as wf, Toast as oT, UnorderedList as Cee, ListItem as fx, CheckerBoard as RB, Image as Gy, MediaCardPlaceholder as EB, ProgressBar as $B, Tab as px, FormInputField as v_, ContentEditable as y_, Avatar as aT, AnimatedList as kB, ComboboxAction as See, Checkbox as sT, DialogOptions as OB, DialogOptionsItem as b_, Cropper as wee, Slider as _ee, CardHeaderActions as Iee, ConjoinedIcons as FB, BackgroundIcon as Tee, Dot as Ree, CardFooter as Eee, TextOverflow as $ee, FilterField as C_, DialogTitle as MB, theme as Ld, InlineLabel as LB, Popover as kee, DropdownMenuLabel as Jy, FieldSet as xA, Draggable as Oee, HairlineButton as Fee, Line as xB, Carousel as Mee, CarouselItem as Lee, tableFieldStyles as vc, rawDragIndicatorIcon as xee, rawAddIcon as Uee, ToolbarToggleButton as Pee, ToolbarSeparator as UA, ToolbarButtonGroup as Dee, ToolbarButton as S_, ToolbarToggleButtonGroup as Bee, ToolbarToggleButtonGroupItem as Wee, Toolbar as Kee, contentEditableMultilinePlaceholderClass as Nee, contentEditableNoPaddingClass as jee, contentEditableClassWithIcon as qee, contentEditableClass as Vee, NumberInput as zee, SelectGhostTrigger as Qee, Group as Hee, LazyRender as UB, GroupItem as Yee, Video as Gee } from "@prismicio/editor-ui";
5
+ import { Box as B, Text as j, ErrorBoundary as Bt, Alert as Qy, Skeleton as Ot, LazyCodeBlock as cee, ComboBox as OA, ComboBoxInput as FA, ComboBoxContent as MA, ComboBoxItem as Nd, Badge as Gn, AnimatedFormError as uee, FormInput as Ar, FormField as hB, Dialog as Eo, DialogHeader as as, DialogContent as $o, DialogDescription as Lc, DialogActions as ss, DialogActionLink as AB, DialogCancelButton as cs, DialogActionButton as xc, FormDateInput as TS, ActionList as mB, ActionListItem as gB, IconButton as Va, DropdownMenu as $i, DropdownMenuTrigger as ki, Button as We, DropdownMenuContent as Oi, DropdownMenuItem as At, Icon as Le, Select as Wh, SelectItem as In, SelectSeparator as vB, RadioGroup as lee, ButtonGroup as Hy, RadioItem as lx, Form as dee, useToast as yB, Kbd as dx, Tooltip as Jt, Switch as Yy, Card as us, CardContent as Ga, ToastProvider as fee, TooltipProvider as pee, Separator as nT, LazyBarChart as hee, Field as Fi, FieldIcon as mr, FieldLabel as Mi, FieldControl as Li, ColorInput as Aee, DateInput as bB, TextInput as mee, PreviewCard as rT, PreviewImage as CB, PreviewContent as iT, FieldFooter as g_, CardHeaderTitle as gee, CardHeader as vee, BlankSlate as Uc, BlankSlateIcon as ls, BlankSlateTitle as Ja, BlankSlateActions as SB, useAlert as ds, BlankSlateDescription as Cf, FileUploadButton as Kh, FormSearchInput as LA, Portal as yee, FileDropZone as wB, DefaultErrorMessage as _B, dialogErrorImage as IB, useMediaQuery as bee, MediaCard as TB, AnimatedElement as Sf, ScrollArea as wf, Toast as oT, UnorderedList as Cee, ListItem as fx, CheckerBoard as RB, Image as Gy, MediaCardPlaceholder as EB, ProgressBar as $B, Tab as px, FormInputField as v_, ContentEditable as y_, Avatar as aT, AnimatedList as kB, ComboboxAction as See, Checkbox as sT, DialogOptions as OB, DialogOptionsItem as b_, Cropper as wee, Slider as _ee, CardHeaderActions as Iee, ConjoinedIcons as FB, BackgroundIcon as Tee, Dot as Ree, CardFooter as Eee, TextOverflow as $ee, FilterField as C_, DialogTitle as MB, theme as Ld, InlineLabel as LB, Popover as kee, DropdownMenuLabel as Jy, FieldSet as xA, Draggable as Oee, HairlineButton as Fee, Line as xB, Carousel as Mee, CarouselItem as Lee, tableFieldStyles as vc, rawDragIndicatorIcon as xee, rawAddIcon as Uee, ToolbarToggleButton as Pee, ToolbarSeparator as UA, ToolbarButtonGroup as Dee, ToolbarButton as S_, ToolbarToggleButtonGroup as Bee, ToolbarToggleButtonGroupItem as Wee, Toolbar as Kee, contentEditableMultilinePlaceholderClass as Nee, contentEditableNoPaddingClass as jee, contentEditableClassWithIcon as qee, contentEditableClass as Vee, NumberInput as zee, SelectGhostTrigger as Qee, Group as Hee, LazyRender as UB, GroupItem as Yee, Video as Gee } from "@prismicio/editor-ui";
6
6
  import * as Ue from "react";
7
- import qt, { Suspense as Ft, useState as V, useRef as De, useCallback as kr, useEffect as We, useMemo as $e, createContext as oi, useContext as On, useLayoutEffect as _f, forwardRef as dl, startTransition as PB, useTransition as jd, useId as cT, useDebugValue as DB, useImperativeHandle as Jee, createElement as w_ } from "react";
7
+ import qt, { Suspense as Ft, useState as V, useRef as Be, useCallback as kr, useEffect as De, useMemo as $e, createContext as oi, useContext as On, useLayoutEffect as _f, forwardRef as dl, startTransition as PB, useTransition as jd, useId as cT, useDebugValue as DB, useImperativeHandle as Jee, createElement as w_ } from "react";
8
8
  import { toURL as ta, getUrlTitle as BB, createRouteParams as Zee } from "@prismicio/editor-support/URL";
9
9
  import { sort as fl, uniqBy as Xee, range as pl, insertAtIndex as WB, removeIndex as KB, move as NB, last as __ } from "@prismicio/editor-support/Array";
10
10
  import { useDebounce as uT, useOnChange as eo, useStableCallback as bo, useDebounceState as hl, refContainsTarget as ete } from "@prismicio/editor-support/React";
@@ -4677,7 +4677,7 @@ const Fe = {
4677
4677
  };
4678
4678
  function Ao(e) {
4679
4679
  var m;
4680
- const { path: t, setPath: n, description: r, allowedPaths: i, context: o } = e, [a, s] = V(t), c = De(null), u = Object.keys(((m = o0()) == null ? void 0 : m.types) ?? {}), l = kr(
4680
+ const { path: t, setPath: n, description: r, allowedPaths: i, context: o } = e, [a, s] = V(t), c = Be(null), u = Object.keys(((m = o0()) == null ? void 0 : m.types) ?? {}), l = kr(
4681
4681
  (v) => {
4682
4682
  v.endsWith("[field]") && (v = v.replace("[field]", ""), requestAnimationFrame(() => {
4683
4683
  var y;
@@ -4686,7 +4686,7 @@ function Ao(e) {
4686
4686
  },
4687
4687
  [n, i, u, o]
4688
4688
  );
4689
- We(() => {
4689
+ De(() => {
4690
4690
  Ix(t, { allowedPaths: i, customTypeIds: u, context: o }) && s(t);
4691
4691
  }, [t, i, u, o]);
4692
4692
  const d = $e(() => {
@@ -4806,7 +4806,7 @@ function a0(e) {
4806
4806
  }
4807
4807
  function ry(e) {
4808
4808
  const { value: t, onValueChange: n, ...r } = e, [i, o] = V(() => t.join(", "));
4809
- We(() => {
4809
+ De(() => {
4810
4810
  o(t.join(", "));
4811
4811
  }, [t]);
4812
4812
  function a(s) {
@@ -5400,7 +5400,7 @@ function Tre(e) {
5400
5400
  function Rre(e) {
5401
5401
  const { onSelect: t } = e;
5402
5402
  return /* @__PURE__ */ E($i, { children: [
5403
- /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(Be, { startIcon: "add", color: "grey", children: "Add" }) }),
5403
+ /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(We, { startIcon: "add", color: "grey", children: "Add" }) }),
5404
5404
  /* @__PURE__ */ f(Oi, { align: "start", minWidth: "full-trigger-width", children: i0.map(({ type: n, icon: r }) => /* @__PURE__ */ f(
5405
5405
  At,
5406
5406
  {
@@ -5556,7 +5556,7 @@ function kre(e) {
5556
5556
  description: `Sort by ${u === "asc" ? "ascending" : "descending"} order.`,
5557
5557
  children: /* @__PURE__ */ f(lee, { value: u, onChange: l, asChild: !0, children: /* @__PURE__ */ E(Hy, { density: "compact", children: [
5558
5558
  /* @__PURE__ */ f(lx, { value: "asc", asChild: !0, children: /* @__PURE__ */ f(
5559
- Be,
5559
+ We,
5560
5560
  {
5561
5561
  startIcon: "arrowUpward",
5562
5562
  color: u === "asc" ? "purple" : "grey",
@@ -5564,7 +5564,7 @@ function kre(e) {
5564
5564
  }
5565
5565
  ) }),
5566
5566
  /* @__PURE__ */ f(lx, { value: "desc", asChild: !0, children: /* @__PURE__ */ f(
5567
- Be,
5567
+ We,
5568
5568
  {
5569
5569
  startIcon: "arrowDownward",
5570
5570
  color: u === "desc" ? "purple" : "grey",
@@ -5621,7 +5621,7 @@ function Ore() {
5621
5621
  removeOrdering: s
5622
5622
  }
5623
5623
  ),
5624
- /* @__PURE__ */ f(Be, { startIcon: "add", color: "grey", onClick: o, children: "Add" }),
5624
+ /* @__PURE__ */ f(We, { startIcon: "add", color: "grey", onClick: o, children: "Add" }),
5625
5625
  /* @__PURE__ */ f(
5626
5626
  kre,
5627
5627
  {
@@ -5767,7 +5767,7 @@ function mW() {
5767
5767
  },
5768
5768
  [e]
5769
5769
  );
5770
- if (We(() => {
5770
+ if (De(() => {
5771
5771
  var s;
5772
5772
  t && !((s = e.options[e.type]) != null && s.tag) && t[0] && n(t[0]);
5773
5773
  }, [e.options, e.type, t, n]), !t || !t.length)
@@ -27732,7 +27732,7 @@ function LH(e) {
27732
27732
  },
27733
27733
  [n]
27734
27734
  );
27735
- if (We(() => {
27735
+ if (De(() => {
27736
27736
  var u;
27737
27737
  t && !((u = n.options[n.type]) != null && u.type) && t[0] && r(t[0].id);
27738
27738
  }, [n.options, n.type, t, r]), !t || t.length === 0)
@@ -28584,9 +28584,9 @@ const Txe = (e) => {
28584
28584
  }, [c, u] = V({
28585
28585
  status: "idle"
28586
28586
  });
28587
- return We(() => {
28587
+ return De(() => {
28588
28588
  s.run();
28589
- }, []), uT(i, 200, s.run), We(() => {
28589
+ }, []), uT(i, 200, s.run), De(() => {
28590
28590
  uh.write(
28591
28591
  hh,
28592
28592
  JSON.stringify(i)
@@ -28857,14 +28857,14 @@ var Wxe = /* @__PURE__ */ oi({
28857
28857
  return On(Wxe);
28858
28858
  };
28859
28859
  function Nxe(e) {
28860
- var t = De(void 0);
28860
+ var t = Be(void 0);
28861
28861
  return WH(t.current, e) || (t.current = e), t.current;
28862
28862
  }
28863
28863
  var sU = function(t) {
28864
28864
  t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation();
28865
- }, jxe = typeof window < "u" ? _f : We;
28865
+ }, jxe = typeof window < "u" ? _f : De;
28866
28866
  function cU(e, t, n, r) {
28867
- var i = De(null), o = De(!1), a = n instanceof Array ? r instanceof Array ? void 0 : r : n, s = NL(e) ? e.join(a == null ? void 0 : a.splitKey) : e, c = n instanceof Array ? n : r instanceof Array ? r : void 0, u = kr(t, c ?? []), l = De(u);
28867
+ var i = Be(null), o = Be(!1), a = n instanceof Array ? r instanceof Array ? void 0 : r : n, s = NL(e) ? e.join(a == null ? void 0 : a.splitKey) : e, c = n instanceof Array ? n : r instanceof Array ? r : void 0, u = kr(t, c ?? []), l = Be(u);
28868
28868
  c ? l.current = u : l.current = t;
28869
28869
  var d = Nxe(a), p = Kxe(), h = p.enabledScopes, A = Bxe();
28870
28870
  return jxe(function() {
@@ -28988,7 +28988,7 @@ function zxe() {
28988
28988
  enableOnFormTags: !0,
28989
28989
  enableOnContentEditable: !0
28990
28990
  }), /* @__PURE__ */ E($i, { children: [
28991
- /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(Be, { startIcon: "link", color: "grey", children: "Share" }) }),
28991
+ /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(We, { startIcon: "link", color: "grey", children: "Share" }) }),
28992
28992
  /* @__PURE__ */ E(Oi, { align: "start", children: [
28993
28993
  t.repository && /* @__PURE__ */ E(
28994
28994
  At,
@@ -29420,7 +29420,7 @@ const NH = ({ className: e, name: t, value: n, setValue: r, handleKeyPress: i, s
29420
29420
  }, areChildrenBeingEdited: () => !1, dragSource: { path: null, pathString: null }, setDragSource: () => {
29421
29421
  }, tabDirection: "next", setTabDirection: () => {
29422
29422
  } }), lUe = ({ children: e }) => {
29423
- const [t, n] = V(null), [r, i] = V(null), [o, a] = V({ path: null, pathString: null }), s = De(null), c = De("next"), u = De(null);
29423
+ const [t, n] = V(null), [r, i] = V(null), [o, a] = V({ path: null, pathString: null }), s = Be(null), c = Be("next"), u = Be(null);
29424
29424
  return f(QH.Provider, { value: { collapseState: t, setCollapseState: (l) => {
29425
29425
  n(l), l !== null && setTimeout(() => n(null), 2e3);
29426
29426
  }, doesPathMatch: (l) => {
@@ -29439,7 +29439,7 @@ const NH = ({ className: e, name: t, value: n, setValue: r, handleKeyPress: i, s
29439
29439
  c.current = l;
29440
29440
  }, dragSource: o, setDragSource: a }, children: e });
29441
29441
  }, Og = () => On(QH), nI = "**INVALID_FUNCTION**", dUe = ({ value: e, setValue: t, isEditing: n, path: r, setIsEditing: i, handleEdit: o, stringTruncate: a, showStringQuotes: s, nodeData: c, handleKeyboard: u, keyboardCommon: l }) => {
29442
- const { getStyles: d } = Oa(), p = De(null), h = Gp(r), A = s ? '"' : "";
29442
+ const { getStyles: d } = Oa(), p = Be(null), h = Gp(r), A = s ? '"' : "";
29443
29443
  return n ? f(NH, { className: "jer-input-text", textAreaRef: p, name: h, value: e, setValue: t, isEditing: n, handleKeyPress: (m) => {
29444
29444
  u(m, Object.assign({ stringConfirm: o, stringLineBreak: () => {
29445
29445
  const v = VH(p, `
@@ -29458,8 +29458,8 @@ const NH = ({ className: e, name: t, value: n, setValue: r, handleKeyPress: i, s
29458
29458
  l.key === " " && l.preventDefault(), s(l, Object.assign({ booleanConfirm: o, booleanToggle: () => t(!e) }, c));
29459
29459
  }, autoFocus: !0 }) : f("span", { onDoubleClick: () => i(!0), className: "jer-value-boolean", style: u("boolean", a), children: String(e) });
29460
29460
  }, hUe = ({ value: e, isEditing: t, setIsEditing: n, handleEdit: r, nodeData: i, handleKeyboard: o, keyboardCommon: a }) => {
29461
- const { getStyles: s } = Oa(), c = De();
29462
- We(() => {
29461
+ const { getStyles: s } = Oa(), c = Be();
29462
+ De(() => {
29463
29463
  if (t)
29464
29464
  return c.current = window.setTimeout(() => window.addEventListener("keydown", u), 100), () => window.removeEventListener("keydown", u);
29465
29465
  window.clearTimeout(c.current);
@@ -29601,7 +29601,7 @@ const NH = ({ className: e, name: t, value: n, setValue: r, handleKeyPress: i, s
29601
29601
  const re = o({ currentData: z.fullData, newValue: L, currentValue: D, name: Y, path: K });
29602
29602
  N(re);
29603
29603
  }, [o]);
29604
- We(() => {
29604
+ De(() => {
29605
29605
  N(typeof t == "function" ? nI : t), vn(rv(t, qe));
29606
29606
  }, [t, M]);
29607
29607
  const { CustomNode: _e, customNodeProps: ot, hideKey: Ct, showEditTools: ct = !0, showOnEdit: gt, showOnView: sn } = qe, Dn = [..._Ue, ...y.filter(({ showInTypesSelector: L = !1, name: re }) => L && !!re).map(({ name: L }) => L)], cn = $e(() => {
@@ -29704,7 +29704,7 @@ const NH = ({ className: e, name: t, value: n, setValue: r, handleKeyPress: i, s
29704
29704
  }
29705
29705
  }, XH = (e) => {
29706
29706
  const { getStyles: t } = Oa(), { collapseState: n, setCollapseState: r, doesPathMatch: i, currentlyEditingElement: o, setCurrentlyEditingElement: a, areChildrenBeingEdited: s } = Og(), { mainContainerRef: c, data: u, nodeData: l, parentData: d, showCollectionCount: p, onEdit: h, onAdd: A, onDelete: m, canDragOnto: v, collapseFilter: y, collapseAnimationTime: w, onMove: S, enableClipboard: g, searchFilter: b, searchText: C, indent: _, sort: T, showArrayIndices: R, defaultValue: $, translate: O, customNodeDefinitions: D, jsonParse: N, jsonStringify: q, TextEditor: z, keyboardControls: K, handleKeyboard: Y, insertAtTop: te } = e, [x, F] = V(q(u)), M = y(l), { contentRef: H, isAnimating: ae, maxHeight: Ae, collapsed: xe, animateCollapse: Qe } = ((ve, pt, Zs, Go) => {
29707
- const [Qg, Hg] = V(Zs ? 0 : void 0), [bS, oee] = V(Zs), CS = De(!1), SS = De(null), sx = De(0), cx = De();
29707
+ const [Qg, Hg] = V(Zs ? 0 : void 0), [bS, oee] = V(Zs), CS = Be(!1), SS = Be(null), sx = Be(0), cx = Be();
29708
29708
  return { contentRef: SS, isAnimating: CS.current, animateCollapse: (wS) => {
29709
29709
  var _S, IS;
29710
29710
  if (bS !== wS) {
@@ -29724,16 +29724,16 @@ const NH = ({ className: e, name: t, value: n, setValue: r, handleKeyPress: i, s
29724
29724
  }, pt);
29725
29725
  }
29726
29726
  }, maxHeight: Qg, collapsed: bS };
29727
- })(u, w, M, c), { pathString: kt, nodeData: Ie, path: qe, name: wt, size: vn, canEdit: an, canDelete: _e, canAdd: ot, canDrag: Ct, error: ct, setError: gt, onError: sn, handleEditKey: Dn, derivedValues: cn } = GH({ props: e, collapsed: xe }), { dragSourceProps: Ut, getDropTargetProps: Qr, BottomDropTarget: Yt, DropTargetPadding: un } = JH({ canDrag: Ct, canDragOnto: v, path: qe, nodeData: Ie, onMove: S, onError: sn, translate: O }), yn = De(!M);
29728
- We(() => {
29727
+ })(u, w, M, c), { pathString: kt, nodeData: Ie, path: qe, name: wt, size: vn, canEdit: an, canDelete: _e, canAdd: ot, canDrag: Ct, error: ct, setError: gt, onError: sn, handleEditKey: Dn, derivedValues: cn } = GH({ props: e, collapsed: xe }), { dragSourceProps: Ut, getDropTargetProps: Qr, BottomDropTarget: Yt, DropTargetPadding: un } = JH({ canDrag: Ct, canDragOnto: v, path: qe, nodeData: Ie, onMove: S, onError: sn, translate: O }), yn = Be(!M);
29728
+ De(() => {
29729
29729
  F(q(u)), Wn && a(null);
29730
- }, [u]), We(() => {
29730
+ }, [u]), De(() => {
29731
29731
  const ve = y(Ie) && !cn.isEditing;
29732
29732
  yn.current = !ve, Qe(ve);
29733
- }, [y]), We(() => {
29733
+ }, [y]), De(() => {
29734
29734
  n !== null && i(qe) && (yn.current = !0, Qe(n.collapsed));
29735
29735
  }, [n]);
29736
- const Hr = De(null), Yr = $e(() => (ve, pt) => typeof $ != "function" ? $ : $(ve, pt), [$]), { CustomNode: Me, customNodeProps: ke, CustomWrapper: P, wrapperProps: U = {}, hideKey: W, showEditTools: de = !0, showOnEdit: L, showOnView: re, showCollectionWrapper: he = !0 } = $e(() => YH(D, Ie), []), ue = s(kt);
29736
+ const Hr = Be(null), Yr = $e(() => (ve, pt) => typeof $ != "function" ? $ : $(ve, pt), [$]), { CustomNode: Me, customNodeProps: ke, CustomWrapper: P, wrapperProps: U = {}, hideKey: W, showEditTools: de = !0, showOnEdit: L, showOnView: re, showCollectionWrapper: he = !0 } = $e(() => YH(D, Ie), []), ue = s(kt);
29737
29737
  if (ue && xe && Qe(!1), !(jH("collection", Ie, b, C) || Ie.level === 0) && !ue)
29738
29738
  return null;
29739
29739
  const Ce = Array.isArray(u) ? "array" : "object", ft = Ce === "array" ? { open: "[", close: "]" } : { open: "{", close: "}" }, Bn = (ve) => {
@@ -29836,11 +29836,11 @@ const kUe = ({ data: e, setData: t, rootName: n = "root", onUpdate: r = () => {
29836
29836
  const [P, U] = V(Me ? void 0 : ke), W = kr((de) => {
29837
29837
  Me ? Me(de) : U(de);
29838
29838
  }, [Me]);
29839
- return We(() => {
29839
+ return De(() => {
29840
29840
  Me || U(ke);
29841
29841
  }, [ke]), [Me ? ke : P, W];
29842
- })({ setData: t, data: e }), Ct = De(null);
29843
- We(() => {
29842
+ })({ setData: t, data: e }), Ct = Be(null);
29843
+ De(() => {
29844
29844
  Ie(null);
29845
29845
  const Me = setTimeout(() => an(b), C);
29846
29846
  return () => clearTimeout(Me);
@@ -29900,7 +29900,7 @@ const kUe = ({ data: e, setData: t, rootName: n = "root", onUpdate: r = () => {
29900
29900
  }, OUe = (e) => {
29901
29901
  var t;
29902
29902
  const [n, r] = V();
29903
- We(() => {
29903
+ De(() => {
29904
29904
  const a = document.documentElement;
29905
29905
  r(a);
29906
29906
  }, []);
@@ -29920,7 +29920,7 @@ const kUe = ({ data: e, setData: t, rootName: n = "root", onUpdate: r = () => {
29920
29920
  }, MUe = (e) => Array.isArray(e) && e.length === 2 && ["error", "value"].includes(e[0]);
29921
29921
  function eY() {
29922
29922
  const [e, t] = V(!1);
29923
- We(() => {
29923
+ De(() => {
29924
29924
  if (!e)
29925
29925
  return;
29926
29926
  const r = setTimeout(() => {
@@ -29957,7 +29957,7 @@ function LUe() {
29957
29957
  children: [
29958
29958
  /* @__PURE__ */ f(j, { variant: "small", component: "h2", color: "grey9", children: "Response" }),
29959
29959
  (e.status === "success" || e.status === "error") && /* @__PURE__ */ f(
29960
- Be,
29960
+ We,
29961
29961
  {
29962
29962
  startIcon: "refresh",
29963
29963
  color: "grey",
@@ -30003,7 +30003,7 @@ function xUe() {
30003
30003
  ] }),
30004
30004
  /* We don't display the button is the repository is already set (i.e. running in a Prismic repository) */
30005
30005
  !t.repository && /* @__PURE__ */ f(
30006
- Be,
30006
+ We,
30007
30007
  {
30008
30008
  sx: { marginTop: 16 },
30009
30009
  onClick: n,
@@ -30110,7 +30110,7 @@ function WUe(e) {
30110
30110
  children: /* @__PURE__ */ E("div", { style: { zIndex: 0 }, children: [
30111
30111
  /* @__PURE__ */ f("div", { style: { position: "sticky", top: 0, left: 0, zIndex: 1 }, children: /* @__PURE__ */ E(B, { position: "absolute", top: 16, right: 16, gap: 8, children: [
30112
30112
  /* @__PURE__ */ f(
30113
- Be,
30113
+ We,
30114
30114
  {
30115
30115
  startIcon: i ? "check" : "contentCopy",
30116
30116
  color: "grey",
@@ -30118,7 +30118,7 @@ function WUe(e) {
30118
30118
  children: "Copy"
30119
30119
  }
30120
30120
  ),
30121
- t.url && /* @__PURE__ */ f(Be, { endIcon: "link", asChild: !0, color: "grey", children: /* @__PURE__ */ f(
30121
+ t.url && /* @__PURE__ */ f(We, { endIcon: "link", asChild: !0, color: "grey", children: /* @__PURE__ */ f(
30122
30122
  "a",
30123
30123
  {
30124
30124
  href: t.url,
@@ -33812,7 +33812,7 @@ const hu = dl(
33812
33812
  )
33813
33813
  };
33814
33814
  function EY(e) {
33815
- const { debouncedUrl: t, content: n, onContentChange: r, selected: i } = e, o = De(null), [a, s] = V(!1);
33815
+ const { debouncedUrl: t, content: n, onContentChange: r, selected: i } = e, o = Be(null), [a, s] = V(!1);
33816
33816
  eo(t, () => {
33817
33817
  var u;
33818
33818
  a && (s(!1), (u = o.current) == null || u.reset());
@@ -33869,7 +33869,7 @@ function IDe(e) {
33869
33869
  }
33870
33870
  function TDe(e) {
33871
33871
  const { url: t, onContentChange: n } = e, { embedApiEndpoint: r } = Se(), i = gr(RDe, [t, r]), o = bo(n);
33872
- return We(() => {
33872
+ return De(() => {
33873
33873
  o(i);
33874
33874
  }, [i, o]), i;
33875
33875
  }
@@ -33967,7 +33967,7 @@ function kDe(e) {
33967
33967
  onValueChange: s,
33968
33968
  variant: ta(a.value) ? "link" : "normal",
33969
33969
  endAdornment: !n && /* @__PURE__ */ f(
33970
- Be,
33970
+ We,
33971
33971
  {
33972
33972
  startIcon: "close",
33973
33973
  color: "grey",
@@ -34031,7 +34031,7 @@ function ODe(e) {
34031
34031
  onBlur: r ? void 0 : s,
34032
34032
  variant: u ? "link" : "normal",
34033
34033
  endAdornment: !r && /* @__PURE__ */ f(
34034
- Be,
34034
+ We,
34035
34035
  {
34036
34036
  startIcon: "close",
34037
34037
  color: "grey",
@@ -34251,7 +34251,7 @@ function OY(e) {
34251
34251
  ),
34252
34252
  /* @__PURE__ */ f(Ja, { children: n ? "Preparing your image..." : "You haven't selected an image" }),
34253
34253
  !r && /* @__PURE__ */ f(SB, { children: /* @__PURE__ */ f(
34254
- Be,
34254
+ We,
34255
34255
  {
34256
34256
  disabled: n,
34257
34257
  onClick: () => i(!0),
@@ -35006,8 +35006,8 @@ function Pg(e) {
35006
35006
  function DBe(e) {
35007
35007
  const { assetType: t, keyword: n, mode: r, tagIds: i } = e, o = Se();
35008
35008
  o.mediaLibrary || Wt("mediaLibrary");
35009
- const { onAnalyticsEvent: a } = o, s = e0(po), c = s[s.length - 1], u = De(c);
35010
- u.current = c, We(() => {
35009
+ const { onAnalyticsEvent: a } = o, s = e0(po), c = s[s.length - 1], u = Be(c);
35010
+ u.current = c, De(() => {
35011
35011
  if (!a || !n || !u.current || u.current.keyword !== n)
35012
35012
  return;
35013
35013
  const l = String(n.split(" ").length), d = String(u.current.total), p = i.join(",");
@@ -35023,8 +35023,8 @@ function DBe(e) {
35023
35023
  }, [n, t, r, a, i]);
35024
35024
  }
35025
35025
  function BBe(e) {
35026
- const { assetType: t, mediaDialogOpen: n } = e, r = Se(), i = e0(po), o = De(0);
35027
- We(() => {
35026
+ const { assetType: t, mediaDialogOpen: n } = e, r = Se(), i = e0(po), o = Be(0);
35027
+ De(() => {
35028
35028
  n && (o.current = performance.now());
35029
35029
  }, [n]);
35030
35030
  function a(s) {
@@ -35299,7 +35299,7 @@ function QBe(e) {
35299
35299
  initialState: n,
35300
35300
  initialTotalItemCount: r,
35301
35301
  isSelectAllEnabled: i = !1
35302
- } = e, o = De(), a = De(r || 0);
35302
+ } = e, o = Be(), a = Be(r || 0);
35303
35303
  function s() {
35304
35304
  if (n && n.selectedIds) {
35305
35305
  const _ = [...n.selectedIds].pop();
@@ -35340,7 +35340,7 @@ function QBe(e) {
35340
35340
  excludedIds: /* @__PURE__ */ new Set()
35341
35341
  });
35342
35342
  });
35343
- We(() => {
35343
+ De(() => {
35344
35344
  const { isAllSelected: _, selectedIds: T, excludedIds: R } = c, $ = a.current;
35345
35345
  if (!($ === 0 || !i)) {
35346
35346
  if (_ && R.size === $) {
@@ -35446,7 +35446,7 @@ function hd(e) {
35446
35446
  } = t;
35447
35447
  n !== void 0 && n !== o && i(n);
35448
35448
  const u = bo(r);
35449
- return We(() => {
35449
+ return De(() => {
35450
35450
  u == null || u(s());
35451
35451
  }, [s, u, a]), {
35452
35452
  ...c,
@@ -35572,7 +35572,7 @@ function ZBe(e) {
35572
35572
  }), v = (w) => {
35573
35573
  m(bA({ ...A, ...w }));
35574
35574
  };
35575
- We(() => {
35575
+ De(() => {
35576
35576
  l && (h(!1), d(!1));
35577
35577
  }, [l]);
35578
35578
  function y() {
@@ -35642,7 +35642,7 @@ function XBe(e) {
35642
35642
  },
35643
35643
  [t, r]
35644
35644
  );
35645
- return We(s, [a, r, n]), {
35645
+ return De(s, [a, r, n]), {
35646
35646
  isUploading: o,
35647
35647
  uploadingFiles: r,
35648
35648
  onFilesSelected: c,
@@ -35932,7 +35932,7 @@ function rWe() {
35932
35932
  Kh,
35933
35933
  {
35934
35934
  onFilesSelected: e,
35935
- renderButton: (t) => /* @__PURE__ */ f(B, { display: "inline-flex", as: "span", children: /* @__PURE__ */ f(Be, { onClick: t, color: "grey", children: "Upload media" }) })
35935
+ renderButton: (t) => /* @__PURE__ */ f(B, { display: "inline-flex", as: "span", children: /* @__PURE__ */ f(We, { onClick: t, color: "grey", children: "Upload media" }) })
35936
35936
  }
35937
35937
  ),
35938
35938
  /* @__PURE__ */ f(Cf, { children: "Maximum upload size file: 128 MB" })
@@ -36085,7 +36085,7 @@ function cWe() {
36085
36085
  isMediaRevalidationInProgress: o,
36086
36086
  setOpenMediaSection: a,
36087
36087
  isFetchingMedia: s
36088
- } = xt(), c = hd(), u = De(null);
36088
+ } = xt(), c = hd(), u = Be(null);
36089
36089
  function l(h) {
36090
36090
  c.toggleSelection({
36091
36091
  id: h,
@@ -36215,7 +36215,7 @@ function pG(e) {
36215
36215
  title: lf.warning.uploadWhileUploading.title,
36216
36216
  content: lf.warning.uploadWhileUploading.description,
36217
36217
  visible: n,
36218
- children: /* @__PURE__ */ f(B, { display: "inline-flex", as: "span", children: /* @__PURE__ */ f(Be, { disabled: i, onClick: o, invisible: !0, children: "upload" }) })
36218
+ children: /* @__PURE__ */ f(B, { display: "inline-flex", as: "span", children: /* @__PURE__ */ f(We, { disabled: i, onClick: o, invisible: !0, children: "upload" }) })
36219
36219
  }
36220
36220
  )
36221
36221
  }
@@ -36742,7 +36742,7 @@ function vG(e) {
36742
36742
  /* @__PURE__ */ E(B, { justifyContent: "space-between", children: [
36743
36743
  /* @__PURE__ */ f(j, { color: "grey12", variant: "bold", children: r() }),
36744
36744
  /* @__PURE__ */ f(
36745
- Be,
36745
+ We,
36746
36746
  {
36747
36747
  startIcon: "edit",
36748
36748
  invisible: !0,
@@ -36797,8 +36797,8 @@ function vG(e) {
36797
36797
  ] });
36798
36798
  }
36799
36799
  function SWe(e) {
36800
- const { searchTerm: t, setSearchTerm: n } = e, r = De(null), { openMediaSection: i, setOpenMediaSection: o } = xt();
36801
- return We(() => {
36800
+ const { searchTerm: t, setSearchTerm: n } = e, r = Be(null), { openMediaSection: i, setOpenMediaSection: o } = xt();
36801
+ return De(() => {
36802
36802
  var a;
36803
36803
  i === "tags" && ((a = r.current) == null || a.focus(), o(void 0));
36804
36804
  }, [i, o]), /* @__PURE__ */ f(
@@ -37353,7 +37353,7 @@ function NWe(e) {
37353
37353
  /* @__PURE__ */ E(B, { justifyContent: "space-between", children: [
37354
37354
  /* @__PURE__ */ f(Gn, { title: t.name, color: "purple", size: "medium", onEdit: c }),
37355
37355
  /* @__PURE__ */ f(
37356
- Be,
37356
+ We,
37357
37357
  {
37358
37358
  invisible: !0,
37359
37359
  color: "tomato",
@@ -37435,7 +37435,7 @@ function qWe() {
37435
37435
  ),
37436
37436
  /* @__PURE__ */ f(Ja, { size: "big", children: "Oops!" }),
37437
37437
  /* @__PURE__ */ f(Cf, { width: 360, children: "We couldn't load your media tags." }),
37438
- /* @__PURE__ */ f(SB, { children: /* @__PURE__ */ f(Be, { onClick: e == null ? void 0 : e.reset, size: "medium", children: "Try again" }) })
37438
+ /* @__PURE__ */ f(SB, { children: /* @__PURE__ */ f(We, { onClick: e == null ? void 0 : e.reset, size: "medium", children: "Try again" }) })
37439
37439
  ] }) });
37440
37440
  }
37441
37441
  function VWe(e) {
@@ -37553,7 +37553,7 @@ const ZWe = dl(function(t, n) {
37553
37553
  content: `You can only pick ${(a == null ? void 0 : a.toLocaleLowerCase()) ?? "this type of media"}`,
37554
37554
  visible: i,
37555
37555
  children: /* @__PURE__ */ f(
37556
- Be,
37556
+ We,
37557
37557
  {
37558
37558
  startIcon: r,
37559
37559
  endIcon: "arrowDropDown",
@@ -37608,7 +37608,7 @@ function eKe() {
37608
37608
  return /* @__PURE__ */ E(oe, { children: [
37609
37609
  /* @__PURE__ */ E($i, { open: o, onOpenChange: u, children: [
37610
37610
  /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(
37611
- Be,
37611
+ We,
37612
37612
  {
37613
37613
  startIcon: "label",
37614
37614
  endIcon: "arrowDropDown",
@@ -37664,7 +37664,7 @@ function eKe() {
37664
37664
  }
37665
37665
  ) }),
37666
37666
  /* @__PURE__ */ f(See, { children: /* @__PURE__ */ f(
37667
- Be,
37667
+ We,
37668
37668
  {
37669
37669
  invisible: !0,
37670
37670
  startIcon: "edit",
@@ -37744,7 +37744,7 @@ function nKe() {
37744
37744
  }
37745
37745
  return /* @__PURE__ */ E($i, { open: i, onOpenChange: c, children: [
37746
37746
  /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(
37747
- Be,
37747
+ We,
37748
37748
  {
37749
37749
  startIcon: "people",
37750
37750
  renderStartIcon: (l) => a ? /* @__PURE__ */ f(
@@ -37941,7 +37941,7 @@ lT.registerFetcherConfig(CG, {
37941
37941
  revalidationStrategy: { type: "never" }
37942
37942
  });
37943
37943
  function lKe(e, t) {
37944
- const n = De(), r = Se(), i = gr(CG, [e, t]);
37944
+ const n = Be(), r = Se(), i = gr(CG, [e, t]);
37945
37945
  return uT(t, 1e3, () => {
37946
37946
  var o;
37947
37947
  n.current && t !== n.current && ((o = r.onAnalyticsEvent) == null || o.call(r, "Unsplash Image Searched")), n.current = t;
@@ -38024,7 +38024,7 @@ function pKe() {
38024
38024
  function hKe(e) {
38025
38025
  var u;
38026
38026
  const { term: t, onSelectedChange: n } = e, { unsplashApiBaseUrl: r } = Se(), i = lKe(r, t || "citrus fruit"), o = (u = i == null ? void 0 : i[0]) == null ? void 0 : u.id, [a, s] = V();
38027
- We(() => {
38027
+ De(() => {
38028
38028
  n == null || n([]), s(void 0);
38029
38029
  }, [o, n]);
38030
38030
  function c(l) {
@@ -38044,7 +38044,7 @@ function l2(e) {
38044
38044
  const { open: t, onOpenChange: n, onMediaSelected: r, assetType: i } = e, o = Se(), a = o.mediaLibrary, [s, c] = V(
38045
38045
  () => a ? "media" : "unsplash"
38046
38046
  ), [u, l] = V(/* @__PURE__ */ new Set()), [d, p] = V([]), h = u.size + d.length, A = e0(po);
38047
- We(() => {
38047
+ De(() => {
38048
38048
  !t || !a || ZY({ config: o, assetType: i });
38049
38049
  }, [t, o, i, a]);
38050
38050
  function m(b) {
@@ -38372,7 +38372,7 @@ function yKe(e) {
38372
38372
  children: [
38373
38373
  /* @__PURE__ */ E(B, { gap: 8, height: 32, alignItems: "flex-start", width: "100%", children: [
38374
38374
  /* @__PURE__ */ f(Jt, { content: "Center", children: /* @__PURE__ */ f(
38375
- Be,
38375
+ We,
38376
38376
  {
38377
38377
  color: "grey",
38378
38378
  size: "medium",
@@ -38381,7 +38381,7 @@ function yKe(e) {
38381
38381
  }
38382
38382
  ) }),
38383
38383
  /* @__PURE__ */ f(Jt, { content: "Cover", children: /* @__PURE__ */ f(
38384
- Be,
38384
+ We,
38385
38385
  {
38386
38386
  color: "grey",
38387
38387
  size: "medium",
@@ -38581,7 +38581,7 @@ function wKe(e) {
38581
38581
  bKe,
38582
38582
  {
38583
38583
  trigger: /* @__PURE__ */ f(
38584
- Be,
38584
+ We,
38585
38585
  {
38586
38586
  startIcon: "crop",
38587
38587
  disabled: a,
@@ -38595,14 +38595,14 @@ function wKe(e) {
38595
38595
  }
38596
38596
  ),
38597
38597
  /* @__PURE__ */ f(Jt, { content: "Replace", children: /* @__PURE__ */ f(
38598
- Be,
38598
+ We,
38599
38599
  {
38600
38600
  startIcon: "imageSearch",
38601
38601
  hiddenLabel: "Replace",
38602
38602
  onClick: () => l(!0)
38603
38603
  }
38604
38604
  ) }),
38605
- /* @__PURE__ */ f(Jt, { content: "Clear", children: /* @__PURE__ */ f(Be, { onClick: c, startIcon: "delete", hiddenLabel: "Clear" }) })
38605
+ /* @__PURE__ */ f(Jt, { content: "Clear", children: /* @__PURE__ */ f(We, { onClick: c, startIcon: "delete", hiddenLabel: "Clear" }) })
38606
38606
  ] })
38607
38607
  ]
38608
38608
  }
@@ -38637,8 +38637,8 @@ function il(e) {
38637
38637
  children: [
38638
38638
  s,
38639
38639
  /* @__PURE__ */ E(Hy, { size: "medium", color: "grey", sx: { justifySelf: "end" }, children: [
38640
- o && /* @__PURE__ */ f(Be, { startIcon: "edit", onClick: o }),
38641
- a && /* @__PURE__ */ f(Be, { startIcon: "linkOff", onClick: a })
38640
+ o && /* @__PURE__ */ f(We, { startIcon: "edit", onClick: o }),
38641
+ a && /* @__PURE__ */ f(We, { startIcon: "linkOff", onClick: a })
38642
38642
  ] })
38643
38643
  ]
38644
38644
  }
@@ -39009,7 +39009,7 @@ function NKe(e) {
39009
39009
  ] });
39010
39010
  }
39011
39011
  function dI(e) {
39012
- const [t, n] = V(!1), r = De(null);
39012
+ const [t, n] = V(!1), r = Be(null);
39013
39013
  return /* @__PURE__ */ f(
39014
39014
  Bt,
39015
39015
  {
@@ -39476,7 +39476,7 @@ function MG(e) {
39476
39476
  i === void 0 ? "unlinked" : "linked"
39477
39477
  ),
39478
39478
  !t && !r && !m && /* @__PURE__ */ f(
39479
- Be,
39479
+ We,
39480
39480
  {
39481
39481
  startIcon: Bd({ selectType: i }),
39482
39482
  color: "grey",
@@ -39488,7 +39488,7 @@ function MG(e) {
39488
39488
  }
39489
39489
  ),
39490
39490
  t && !d && !m && /* @__PURE__ */ f(
39491
- Be,
39491
+ We,
39492
39492
  {
39493
39493
  startIcon: "close",
39494
39494
  color: "grey",
@@ -39499,7 +39499,7 @@ function MG(e) {
39499
39499
  ),
39500
39500
  t && d && /* @__PURE__ */ E(Hy, { density: "compact", children: [
39501
39501
  /* @__PURE__ */ f(
39502
- Be,
39502
+ We,
39503
39503
  {
39504
39504
  startIcon: Bd({ selectType: i }),
39505
39505
  renderEndIcon: () => c && i === "web" ? /* @__PURE__ */ f(Le, { name: "openInNew", size: "extraSmall", color: "indigo11" }) : null,
@@ -39513,7 +39513,7 @@ function MG(e) {
39513
39513
  }
39514
39514
  ),
39515
39515
  /* @__PURE__ */ f(
39516
- Be,
39516
+ We,
39517
39517
  {
39518
39518
  startIcon: "close",
39519
39519
  color: "grey",
@@ -39594,14 +39594,14 @@ function t3e(e) {
39594
39594
  ] })
39595
39595
  ] }),
39596
39596
  /* @__PURE__ */ E(Hy, { size: "medium", color: "grey", children: [
39597
- i && /* @__PURE__ */ f(Jt, { content: "Edit link", side: "top", container: a, children: /* @__PURE__ */ f(Be, { startIcon: "edit", onClick: i }) }),
39598
- o && /* @__PURE__ */ f(Jt, { content: "Remove link", side: "top", container: a, children: /* @__PURE__ */ f(Be, { startIcon: "linkOff", onClick: o }) })
39597
+ i && /* @__PURE__ */ f(Jt, { content: "Edit link", side: "top", container: a, children: /* @__PURE__ */ f(We, { startIcon: "edit", onClick: i }) }),
39598
+ o && /* @__PURE__ */ f(Jt, { content: "Remove link", side: "top", container: a, children: /* @__PURE__ */ f(We, { startIcon: "linkOff", onClick: o }) })
39599
39599
  ] })
39600
39600
  ] });
39601
39601
  }
39602
39602
  function n3e(e) {
39603
39603
  var N, q, z;
39604
- const { field: t, content: n, onContentChange: r } = e, i = w(), o = ((N = t.config) == null ? void 0 : N.allowText) ?? !1, a = o && (n == null ? void 0 : n.value.text) || void 0, s = ((q = t.config) == null ? void 0 : q.variants) ?? [], u = (n == null ? void 0 : n.value.variant) && s.includes(n == null ? void 0 : n.value.variant) ? n == null ? void 0 : n.value.variant : s[0], [l, d] = V(y), p = pe.FilledExternalLinkContent.is(n == null ? void 0 : n.value) && (n == null ? void 0 : n.value.target) || void 0, [h, A] = V(!1), m = De(null);
39604
+ const { field: t, content: n, onContentChange: r } = e, i = w(), o = ((N = t.config) == null ? void 0 : N.allowText) ?? !1, a = o && (n == null ? void 0 : n.value.text) || void 0, s = ((q = t.config) == null ? void 0 : q.variants) ?? [], u = (n == null ? void 0 : n.value.variant) && s.includes(n == null ? void 0 : n.value.variant) ? n == null ? void 0 : n.value.variant : s[0], [l, d] = V(y), p = pe.FilledExternalLinkContent.is(n == null ? void 0 : n.value) && (n == null ? void 0 : n.value.target) || void 0, [h, A] = V(!1), m = Be(null);
39605
39605
  eo(i, O);
39606
39606
  const v = l ? r3e[l] : void 0;
39607
39607
  function y() {
@@ -40453,7 +40453,7 @@ function y3e(e) {
40453
40453
  }
40454
40454
  ),
40455
40455
  !r && /* @__PURE__ */ f(
40456
- Be,
40456
+ We,
40457
40457
  {
40458
40458
  startIcon: "add",
40459
40459
  color: "grey",
@@ -41139,7 +41139,7 @@ function Ed(e) {
41139
41139
  onFocus: o
41140
41140
  },
41141
41141
  endAdornment: /* @__PURE__ */ f(
41142
- Be,
41142
+ We,
41143
41143
  {
41144
41144
  startIcon: "close",
41145
41145
  color: "grey",
@@ -49504,7 +49504,7 @@ function i9e() {
49504
49504
  }
49505
49505
  process.env.NODE_ENV === "production" ? MI.exports = r9e() : MI.exports = i9e();
49506
49506
  var o9e = MI.exports;
49507
- const a9e = typeof window < "u" ? _f : We;
49507
+ const a9e = typeof window < "u" ? _f : De;
49508
49508
  class s9e {
49509
49509
  constructor(t) {
49510
49510
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = t, this.lastSnapshot = { editor: t, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
@@ -49687,10 +49687,10 @@ class M2 {
49687
49687
  }
49688
49688
  }
49689
49689
  function l9e(e = {}, t = []) {
49690
- const n = De(e);
49690
+ const n = Be(e);
49691
49691
  n.current = e;
49692
49692
  const [r] = V(() => new M2(n)), i = sS.useSyncExternalStore(r.subscribe, r.getEditor, r.getServerSnapshot);
49693
- return DB(i), We(r.onRender(t)), c9e({
49693
+ return DB(i), De(r.onRender(t)), c9e({
49694
49694
  editor: i,
49695
49695
  selector: ({ transactionNumber: o }) => e.shouldRerenderOnTransaction === !1 ? null : e.immediatelyRender && o === 0 ? 0 : o + 1
49696
49696
  }), i;
@@ -49701,7 +49701,7 @@ const mZ = oi({
49701
49701
  mZ.Consumer;
49702
49702
  const d9e = () => On(mZ), Zw = (e) => {
49703
49703
  const [t, n] = V(null), { editor: r } = d9e();
49704
- return We(() => {
49704
+ return De(() => {
49705
49705
  var i;
49706
49706
  if (!t || !((i = e.editor) === null || i === void 0) && i.isDestroyed || r != null && r.isDestroyed)
49707
49707
  return;
@@ -51418,7 +51418,7 @@ const $8e = (e, t, n) => {
51418
51418
  const r = /* @__PURE__ */ new Map(), i = { platform: R8e, ...n }, o = { ...i.platform, _c: r };
51419
51419
  return p8e(e, t, { ...i, platform: o });
51420
51420
  };
51421
- var Kv = typeof document < "u" ? _f : We;
51421
+ var Kv = typeof document < "u" ? _f : De;
51422
51422
  function Wy(e, t) {
51423
51423
  if (e === t)
51424
51424
  return !0;
@@ -51530,7 +51530,7 @@ function k8e(e) {
51530
51530
  floating: b
51531
51531
  }), [s, C, T, R, g, b]);
51532
51532
  }
51533
- var fc = typeof document < "u" ? _f : We;
51533
+ var fc = typeof document < "u" ? _f : De;
51534
51534
  function O8e() {
51535
51535
  const e = /* @__PURE__ */ new Map();
51536
51536
  return {
@@ -51697,13 +51697,13 @@ function ec(e) {
51697
51697
  e.preventDefault(), e.stopPropagation();
51698
51698
  }
51699
51699
  function B8e(e) {
51700
- const t = De(e);
51700
+ const t = Be(e);
51701
51701
  return fc(() => {
51702
51702
  t.current = e;
51703
51703
  }), t;
51704
51704
  }
51705
51705
  function FD(e) {
51706
- const t = De();
51706
+ const t = Be();
51707
51707
  return fc(() => {
51708
51708
  t.current = e;
51709
51709
  }, [e]), t.current;
@@ -52289,7 +52289,7 @@ const zZ = ["ArrowDown", "ArrowUp", "End", "Home"], QZ = ["Enter"], H8e = ["Esca
52289
52289
  });
52290
52290
  _f(() => {
52291
52291
  d(i);
52292
- }, [d, i]), We(() => {
52292
+ }, [d, i]), De(() => {
52293
52293
  let _;
52294
52294
  const T = () => {
52295
52295
  _ = window.setTimeout(() => {
@@ -52302,7 +52302,7 @@ const zZ = ["ArrowDown", "ArrowUp", "End", "Home"], QZ = ["Enter"], H8e = ["Esca
52302
52302
  o.off("focus", T).off("blur", R), clearTimeout(_);
52303
52303
  };
52304
52304
  }, [o]);
52305
- const [A, m] = V(0), v = De([]);
52305
+ const [A, m] = V(0), v = Be([]);
52306
52306
  eo(a, () => {
52307
52307
  m(0), v.current = [];
52308
52308
  });
@@ -52694,7 +52694,7 @@ const KI = P9e.extend({
52694
52694
  ), HZ = o7e;
52695
52695
  function YZ(e) {
52696
52696
  const { editor: t, getPos: n, node: r } = e, [i, o] = V(!1);
52697
- return We(() => {
52697
+ return De(() => {
52698
52698
  function a() {
52699
52699
  const { from: c, to: u } = t.state.selection, l = n(), d = n() + r.nodeSize, p = c <= l && u >= d;
52700
52700
  o(p);
@@ -52732,7 +52732,7 @@ function a7e(e, t, n) {
52732
52732
  }
52733
52733
  function s7e(e, t, n, r) {
52734
52734
  const { editor: i, getPos: o, node: a } = e, [s, c] = V(!0);
52735
- We(() => {
52735
+ De(() => {
52736
52736
  !s || !e.editor.isFocused || setTimeout(() => {
52737
52737
  var l;
52738
52738
  return (l = n.current) == null ? void 0 : l.focus();
@@ -52747,7 +52747,7 @@ function s7e(e, t, n, r) {
52747
52747
  return { containerRef: r, inputRef: n, onKeyDown: u };
52748
52748
  }
52749
52749
  function c7e(e) {
52750
- const t = De(null), n = De(null), { onKeyDown: r, url: i, urlChanged: o, onContentChange: a, debouncedUrl: s, content: c } = a7e(e, t, n), { selected: u } = YZ(e), l = !e.editor.isEditable;
52750
+ const t = Be(null), n = Be(null), { onKeyDown: r, url: i, urlChanged: o, onContentChange: a, debouncedUrl: s, content: c } = a7e(e, t, n), { selected: u } = YZ(e), l = !e.editor.isEditable;
52751
52751
  return /* @__PURE__ */ f(vZ, { className: "custom-embed", children: /* @__PURE__ */ E("div", { contentEditable: "false", suppressContentEditableWarning: !0, children: [
52752
52752
  /* @__PURE__ */ E(B, { flexGrow: 1, alignItems: "center", children: [
52753
52753
  /* @__PURE__ */ f(Le, { size: "small", name: "cloud", color: "grey11" }),
@@ -53034,7 +53034,7 @@ function h7e(e) {
53034
53034
  };
53035
53035
  }
53036
53036
  function A7e(e) {
53037
- const { node: t } = e, n = t.attrs.content, { selected: r } = YZ(e), i = De(null), o = {
53037
+ const { node: t } = e, n = t.attrs.content, { selected: r } = YZ(e), i = Be(null), o = {
53038
53038
  width: void 0,
53039
53039
  height: void 0,
53040
53040
  name: Zp
@@ -58049,7 +58049,7 @@ function FVe(e) {
58049
58049
  const { labels: t, editor: n } = e, r = n.getAttributes("label").label;
58050
58050
  return /* @__PURE__ */ E(oe, { children: [
58051
58051
  /* @__PURE__ */ E($i, { children: [
58052
- /* @__PURE__ */ f(ki, { disabled: t.length === 0, children: /* @__PURE__ */ f(Be, { endIcon: "arrowDropDown", size: "small", color: "grey", children: cB(r ?? "Labels") }) }),
58052
+ /* @__PURE__ */ f(ki, { disabled: t.length === 0, children: /* @__PURE__ */ f(We, { endIcon: "arrowDropDown", size: "small", color: "grey", children: cB(r ?? "Labels") }) }),
58053
58053
  /* @__PURE__ */ f(
58054
58054
  Oi,
58055
58055
  {
@@ -58447,7 +58447,7 @@ function ZVe(e) {
58447
58447
  const { items: t, editor: n } = e;
58448
58448
  return t.length === 0 ? null : /* @__PURE__ */ E(oe, { children: [
58449
58449
  /* @__PURE__ */ E($i, { children: [
58450
- /* @__PURE__ */ f(ki, { disabled: t.length === 1, children: /* @__PURE__ */ f(Be, { endIcon: "arrowDropDown", size: "small", color: "grey", children: ((r = t.find((i) => i.isActive(n))) == null ? void 0 : r.text) ?? "" }) }),
58450
+ /* @__PURE__ */ f(ki, { disabled: t.length === 1, children: /* @__PURE__ */ f(We, { endIcon: "arrowDropDown", size: "small", color: "grey", children: ((r = t.find((i) => i.isActive(n))) == null ? void 0 : r.text) ?? "" }) }),
58451
58451
  /* @__PURE__ */ f(
58452
58452
  Oi,
58453
58453
  {
@@ -58487,7 +58487,7 @@ function XVe(e) {
58487
58487
  const { editor: t, nodeTypes: n, labels: r, hideDisabledOptions: i = !1 } = e, [o, a] = V(), s = n.includes(me.RichTextNodeType.hyperlink), c = !o, { shouldShowBubbleMenu: u, shouldShowPopover: l } = tze({
58488
58488
  editor: t
58489
58489
  }), [d, p] = V(!0);
58490
- We(() => {
58490
+ De(() => {
58491
58491
  p(!1);
58492
58492
  }, []);
58493
58493
  function h(v) {
@@ -58620,7 +58620,7 @@ const nze = [
58620
58620
  ], VX = dl(
58621
58621
  function(t, n) {
58622
58622
  const { targetTriggerElementRef: r, style: i, ...o } = t;
58623
- return We(() => {
58623
+ return De(() => {
58624
58624
  if (r.current)
58625
58625
  for (const [a, s] of Object.entries(o))
58626
58626
  rze(a, s) && ize(r.current, a, s);
@@ -58920,13 +58920,13 @@ function Aze(e) {
58920
58920
  );
58921
58921
  }
58922
58922
  function HX(e, t) {
58923
- const n = De(), [r, i] = V(!1), { strategy: o, floating: a, reference: s, x: c, y: u } = VZ({
58923
+ const n = Be(), [r, i] = V(!1), { strategy: o, floating: a, reference: s, x: c, y: u } = VZ({
58924
58924
  open: r,
58925
58925
  onOpenChange: i,
58926
58926
  placement: e === "column" ? "bottom-start" : "right-start",
58927
58927
  strategy: "fixed"
58928
58928
  });
58929
- return We(() => vo.listen("handleClick", {
58929
+ return De(() => vo.listen("handleClick", {
58930
58930
  editor: t,
58931
58931
  callback: (l) => {
58932
58932
  l.type === e && (s(l.referenceElement), n.current = l.referenceElement, i(!0));
@@ -58968,7 +58968,7 @@ function mze(e) {
58968
58968
  }
58969
58969
  function gze(e) {
58970
58970
  const [t, n] = V(!1), { onAnalyticsEvent: r } = Se();
58971
- return We(() => vo.listen("addAtLimit", {
58971
+ return De(() => vo.listen("addAtLimit", {
58972
58972
  editor: e,
58973
58973
  callback: (i) => {
58974
58974
  r == null || r("Table Limit Reached", { type: i.type }), n(!0);
@@ -58991,7 +58991,7 @@ function J2(e) {
58991
58991
  }), A = d == null ? void 0 : d().threads, v = yze({
58992
58992
  field: n,
58993
58993
  conditionalExtensions: h ? [h] : [o4e]
58994
- }), y = De(), w = $e(() => {
58994
+ }), y = Be(), w = $e(() => {
58995
58995
  var b;
58996
58996
  if (t)
58997
58997
  return (b = xI.converter(v.nodeExtensions).fromPrismic(p, v.schema, v.nodeTypes, t, A)) == null ? void 0 : b.toJSON();
@@ -59020,7 +59020,7 @@ function J2(e) {
59020
59020
  },
59021
59021
  [v, i]
59022
59022
  );
59023
- return We(() => {
59023
+ return De(() => {
59024
59024
  g != null && g.isInitialized && y.current !== t && g.commands.setContent(w ?? null, !1);
59025
59025
  }, [g, t, w]), g ? /* @__PURE__ */ E(Fi, { display: a === "x-auto" ? "grid" : "flex", children: [
59026
59026
  c && /* @__PURE__ */ f(mr, { name: c }),
@@ -59105,7 +59105,7 @@ function Sze(e) {
59105
59105
  }
59106
59106
  function YX(e) {
59107
59107
  var l;
59108
- const { content: t, field: n, id: r, onContentChange: i, readOnly: o, placeholder: a } = e, s = De(), c = t == null ? void 0 : t.value, u = $e(() => {
59108
+ const { content: t, field: n, id: r, onContentChange: i, readOnly: o, placeholder: a } = e, s = Be(), c = t == null ? void 0 : t.value, u = $e(() => {
59109
59109
  var d, p, h;
59110
59110
  return ((p = (d = s.current) == null ? void 0 : d.plainText) == null ? void 0 : p.value) === c ? (h = s.current) == null ? void 0 : h.richText : wze(c);
59111
59111
  }, [c]);
@@ -59518,7 +59518,7 @@ function Z2(e) {
59518
59518
  readOnly: a,
59519
59519
  repeatable: s = !0,
59520
59520
  repeatableZone: c
59521
- } = e, u = Object.entries(c), l = De([eee()]).current;
59521
+ } = e, u = Object.entries(c), l = Be([eee()]).current;
59522
59522
  let d = i ?? l;
59523
59523
  !s && d.length > 1 && (d = d.slice(0, 1));
59524
59524
  const { scrollOffsetTop: p } = Se();
@@ -59777,7 +59777,7 @@ function Jze(e) {
59777
59777
  }
59778
59778
  function Zze(e) {
59779
59779
  const { step: t, stepIndex: n, isOpen: r, onActionClick: i, onClose: o, contentRef: a } = e, [s, c] = V(!1), [u, l] = V(e.isStepComplete);
59780
- We(() => {
59780
+ De(() => {
59781
59781
  r && l(e.isStepComplete);
59782
59782
  }, [e.isStepComplete, r]);
59783
59783
  async function d() {
@@ -59838,7 +59838,7 @@ function Zze(e) {
59838
59838
  ] });
59839
59839
  }
59840
59840
  function Xze(e) {
59841
- const { steps: t, completedSteps: n, onToggleStep: r, tracking: i, stepOverrides: o } = e, [a, s] = V(!1), [c, u] = V(t[0]), l = De(null);
59841
+ const { steps: t, completedSteps: n, onToggleStep: r, tracking: i, stepOverrides: o } = e, [a, s] = V(!1), [c, u] = V(t[0]), l = Be(null);
59842
59842
  if (!c)
59843
59843
  return null;
59844
59844
  const d = t.findIndex(({ id: v }) => v === c.id);
@@ -59887,7 +59887,7 @@ function Xze(e) {
59887
59887
  ),
59888
59888
  /* @__PURE__ */ E($i, { children: [
59889
59889
  /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(
59890
- Be,
59890
+ We,
59891
59891
  {
59892
59892
  size: "large",
59893
59893
  color: "grey",
@@ -60152,7 +60152,7 @@ function aYe(e) {
60152
60152
  ] }) });
60153
60153
  }
60154
60154
  function iQe(e, t = 400) {
60155
- const n = Ote({ config: { duration: m_ } }), [r, i] = V("visible"), o = De(!1), a = kr(() => {
60155
+ const n = Ote({ config: { duration: m_ } }), [r, i] = V("visible"), o = Be(!1), a = kr(() => {
60156
60156
  i("animating"), setTimeout(() => i("hidden"), m_ - t), o.current || (setTimeout(e, m_), o.current = !0);
60157
60157
  }, [e, t]), s = () => {
60158
60158
  n.throwConfetti(), a();
@@ -60533,7 +60533,7 @@ function fB(e) {
60533
60533
  return /* @__PURE__ */ E(oe, { children: [
60534
60534
  /* @__PURE__ */ f(j, { component: "span", variant: "smallBold", children: "•" }),
60535
60535
  /* @__PURE__ */ E($i, { children: [
60536
- /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(Be, { color: "grey", size: "small", endIcon: "arrowDropDown", invisible: !0, children: (a == null ? void 0 : a.display) ?? "Slice variation" }) }),
60536
+ /* @__PURE__ */ f(ki, { children: /* @__PURE__ */ f(We, { color: "grey", size: "small", endIcon: "arrowDropDown", invisible: !0, children: (a == null ? void 0 : a.display) ?? "Slice variation" }) }),
60537
60537
  /* @__PURE__ */ E(Oi, { align: "start", maxHeight: 256, children: [
60538
60538
  /* @__PURE__ */ f(
60539
60539
  At,
@@ -60563,7 +60563,7 @@ function $Qe(e) {
60563
60563
  const u = (h = (p = o.config) == null ? void 0 : p.choices) == null ? void 0 : h[s.name];
60564
60564
  if (u === void 0)
60565
60565
  return null;
60566
- const l = { ...s.widget, key: s.key }, d = {
60566
+ const l = s.widget, d = {
60567
60567
  id: `${n}[${s.key}]`,
60568
60568
  key: s.key,
60569
60569
  sliceKey: s.key,
@@ -60701,7 +60701,7 @@ function OQe(e) {
60701
60701
  {
60702
60702
  content: h ? "Generate SEO metadata from your page content." : "Your page content is too short to generate SEO metadata.",
60703
60703
  children: /* @__PURE__ */ f(
60704
- Be,
60704
+ We,
60705
60705
  {
60706
60706
  disabled: !h,
60707
60707
  onClick: A,
@@ -60818,10 +60818,12 @@ function PQe(e) {
60818
60818
  documentContent: s,
60819
60819
  documentCustomType: c,
60820
60820
  documentLocale: u
60821
- } = e, l = Se(), d = $e(() => Object.entries(r), [r]), p = De(i);
60822
- if (We(() => {
60821
+ } = e, l = Se(), d = $e(() => Object.entries(r), [r]), p = Be(i);
60822
+ if (De(() => {
60823
60823
  p.current = i;
60824
- }, [i]), d.length === 0)
60824
+ }, [i]), De(() => {
60825
+ window.dispatchEvent(new Event("prismic-static-zone-rendered"));
60826
+ }, []), d.length === 0)
60825
60827
  return null;
60826
60828
  const h = BQe(d), A = cI(i[Gs]) || "Meta title..", m = cI(i[Au]) || "Meta description..";
60827
60829
  return /* @__PURE__ */ E(xA, { legend: "Page data", children: [
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "@floating-ui/react-dom-interactions": "0.9.3",
4
4
  "@liveblocks/react": "2.24.3",
5
5
  "@prismicio/client": "7.15.1",
6
- "@prismicio/editor-support": "0.4.81",
6
+ "@prismicio/editor-support": "0.4.83",
7
7
  "@prismicio/richtext": "2.1.1",
8
8
  "@prismicio/types-internal": "3.15.0-alpha.0",
9
9
  "@tiptap/core": "2.11.5",
@@ -42,7 +42,7 @@
42
42
  "@liveblocks/react": "2.24.3",
43
43
  "@liveblocks/react-tiptap": "2.24.3",
44
44
  "@liveblocks/react-ui": "2.24.3",
45
- "@prismicio/editor-ui": "^0.4.81",
45
+ "@prismicio/editor-ui": "^0.4.83",
46
46
  "@testing-library/react": "15.0.7",
47
47
  "@tiptap/extension-collaboration": "2.22.3",
48
48
  "@tiptap/extension-collaboration-cursor": "2.22.3",
@@ -87,7 +87,7 @@
87
87
  "@liveblocks/react": "2.18.3",
88
88
  "@liveblocks/react-tiptap": "2.18.3",
89
89
  "@liveblocks/react-ui": "2.18.3",
90
- "@prismicio/editor-ui": "^0.4.81",
90
+ "@prismicio/editor-ui": "^0.4.83",
91
91
  "@tanstack/react-query": "5.55.4",
92
92
  "@tiptap/extension-collaboration": "2.11.5",
93
93
  "@tiptap/extension-collaboration-cursor": "2.11.5",
@@ -147,5 +147,5 @@
147
147
  },
148
148
  "sideEffects": false,
149
149
  "types": "./dist/index.d.ts",
150
- "version": "0.4.81"
150
+ "version": "0.4.83"
151
151
  }