slice-machine-ui 2.17.3-beta.7 → 2.17.3-beta.9
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/out/404.html +1 -1
- package/out/_next/static/UBLEqMkM94kXQpW0VSAQo/_buildManifest.js +1 -0
- package/out/_next/static/chunks/248-6f20227ad4764216.js +1 -0
- package/out/_next/static/chunks/489-a42bd4eeb1350d97.js +1 -0
- package/out/_next/static/chunks/{630-29c729ad2a291ef6.js → 630-799c128fd87fa645.js} +1 -1
- package/out/_next/static/chunks/907-a42dc5698d5dc000.js +1 -0
- package/out/_next/static/chunks/pages/{_app-df4a4d1aaa9d7216.js → _app-13d39ac1e1c9aa27.js} +1 -1
- package/out/_next/static/chunks/pages/changelog-98836c22c6a40c5d.js +1 -0
- package/out/_next/static/chunks/pages/changes-2bd69f3877d60b26.js +1 -0
- package/out/_next/static/chunks/pages/labs-ad7f36c6f544c1a8.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-0ecd552897e61e29.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8b6e7854cb3466d4.js +1 -0
- package/out/_next/static/chunks/pages/slices-fe1bb16ff3020762.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -3
- package/src/features/changes/PushChangesButton.tsx +4 -67
- package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/CreateSliceFromImageModal.tsx +8 -21
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -12
- package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +5 -11
- package/src/features/navigation/Navigation.tsx +1 -19
- package/src/legacy/components/ChangesItems/ChangesItems.tsx +1 -8
- package/src/legacy/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -8
- package/src/legacy/components/Simulator/components/FailedConnect/index.tsx +51 -56
- package/src/legacy/components/ToasterContainer/index.tsx +3 -14
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +1 -4
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -5
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +4 -16
- package/src/legacy/lib/builders/SliceBuilder/index.tsx +1 -6
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +5 -10
- package/src/pages/slices.tsx +10 -38
- package/out/_next/static/chunks/248-03446cd9e9f13730.js +0 -1
- package/out/_next/static/chunks/489-f1d584386a1ead7e.js +0 -1
- package/out/_next/static/chunks/907-590c914f55547b96.js +0 -1
- package/out/_next/static/chunks/pages/changelog-063c5e11dfc8fd55.js +0 -1
- package/out/_next/static/chunks/pages/changes-564336edb0ed18b0.js +0 -1
- package/out/_next/static/chunks/pages/labs-9630bfb1005be02b.js +0 -1
- package/out/_next/static/chunks/pages/settings-01f4aeb9112a1f87.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5008e29008aa04f4.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-bd5e45632c419567.js +0 -1
- package/out/_next/static/chunks/pages/slices-a0aa3bbe2cf1689c.js +0 -1
- package/out/_next/static/css/e5f781f20e24a5ea.css +0 -1
- package/out/_next/static/i3RCInXoJzCEi4NnU8YGb/_buildManifest.js +0 -1
- package/out/settings.html +0 -1
- package/src/components/FieldSet/FieldSet.module.css +0 -84
- package/src/components/FieldSet/FieldSet.module.css.d.ts +0 -16
- package/src/components/FieldSet/FieldSet.stories.tsx +0 -244
- package/src/components/FieldSet/FieldSet.tsx +0 -67
- package/src/components/FieldSet/index.ts +0 -9
- package/src/features/builder/useSectionsNamingExperiment.ts +0 -15
- package/src/features/settings/SettingsPage.tsx +0 -50
- package/src/features/settings/git/ConnectGitRepository.tsx +0 -112
- package/src/features/settings/git/ConnectGitRepositoryBlankSlate.tsx +0 -33
- package/src/features/settings/git/GitOwnerSelect.tsx +0 -71
- package/src/features/settings/git/GitProvider.ts +0 -40
- package/src/features/settings/git/GitProviderConnectButtons.tsx +0 -63
- package/src/features/settings/git/GitRepositoriesList.tsx +0 -76
- package/src/features/settings/git/GitRepositoriesSearch.tsx +0 -69
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +0 -97
- package/src/features/settings/git/GitRepositoryDisconnectDialog.tsx +0 -62
- package/src/features/settings/git/useGitIntegrationExperiment.ts +0 -8
- package/src/features/settings/git/useGitOwners.ts +0 -12
- package/src/features/settings/git/useGitRepos.ts +0 -24
- package/src/features/settings/git/useLinkedGitRepos.ts +0 -41
- package/src/features/settings/git/useWriteAPIToken.ts +0 -23
- package/src/icons/BitbucketIcon.tsx +0 -19
- package/src/icons/GitHubIcon.tsx +0 -17
- package/src/icons/GitLabIcon.tsx +0 -19
- package/src/icons/SettingsIcon.tsx +0 -19
- package/src/pages/settings.tsx +0 -1
- package/src/utils/textConversion.ts +0 -11
- /package/out/_next/static/{i3RCInXoJzCEi4NnU8YGb → UBLEqMkM94kXQpW0VSAQo}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,t,n){var i=n(34311),o=n(23779),r=i(function(e,t,n){return e+(n?" ":"")+o(t)});e.exports=r},26688:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return n(31562)}])},34166:function(e,t,n){"use strict";n.d(t,{nZ:function(){return d},rT:function(){return f},tB:function(){return u}});var i=n(52322),o=n(56803),r=n(2784),l=n(30195),s=n(94160),a=n(76611),c=n(5683);function d(e){let{type:t,library:n,sliceId:i,variationId:o,langSmithUrl:r}=e,l=(0,c.i)({type:t,library:n,sliceId:i,variationId:o}),s=JSON.stringify({langSmithUrl:r});localStorage.setItem(l,s)}function u(e){let{type:t,library:n,sliceId:i,variationId:o}=e,r=(0,c.i)({type:t,library:n,sliceId:i,variationId:o});localStorage.removeItem(r)}function f(e){let{type:t,library:n,sliceId:d,variationId:u}=e,{key:f,value:m,done:x}=function(e){let{type:t,library:n,sliceId:i,variationId:o}=e,r=(0,c.i)({type:t,library:n,sliceId:i,variationId:o}),[s,d]=(0,a.V)(r,void 0,{schema:l.z.object({langSmithUrl:l.z.string().url().optional()})});return{key:r,value:s,done:()=>d(void 0)}}({type:t,library:n,sliceId:d,variationId:u}),[h,p]=(0,r.useState)(),v=e=>()=>{m&&(p(f),s.Xe.track({event:"slice-generation-feedback",type:t,sliceId:d,variationId:u,feedback:e,langSmithUrl:m.langSmithUrl}),x())};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.be,{children:(0,i.jsx)(o.bQ,{anchor:(0,i.jsx)(o.D,{width:"100%",justifyContent:"center",position:"absolute",bottom:64}),icon:"check",title:"Thanks for your feedback!",seconds:2,open:!!h,onOpenChange:e=>{e||p(void 0)}},h)}),(0,i.jsx)(o.i,{children:m&&(0,i.jsxs)(o.D,{flexDirection:"row",justifyContent:"end",gap:8,alignItems:"center",children:[(0,i.jsx)(o.bL,{color:"grey11",children:"Did the AI get it right?"}),(0,i.jsxs)(o.D,{flexDirection:"row",gap:4,children:[(0,i.jsx)(o.c3,{side:"bottom",sideOffset:4,variant:"text",content:"Looks good",children:(0,i.jsx)(o.aZ,{variant:"solid",size:"small",icon:"thumbUp",onClick:v("up")})}),(0,i.jsx)(o.c3,{side:"bottom",sideOffset:4,variant:"text",content:"Needs improvement",children:(0,i.jsx)(o.aZ,{variant:"solid",size:"small",icon:"thumbDown",onClick:v("down")})})]})]})})]})}},76611:function(e,t,n){"use strict";n.d(t,{V:function(){return o}});var i=n(2784);function o(e,t,n){let{schema:o}=null!=n?n:{},r=()=>{try{let n=localStorage.getItem(e);if(null==n)return t;if(!o)return JSON.parse(n);return o.parse(JSON.parse(n))}catch(e){return t}},[l,s]=(0,i.useState)(r),[a,c]=(0,i.useState)(e);return a!==e&&(c(e),s(r())),[l,(0,i.useCallback)(n=>{s(i=>{let o;if(void 0===(o="function"==typeof n?n(i):n)){try{localStorage.removeItem(e)}catch(e){return i}return t}try{localStorage.setItem(e,JSON.stringify(o))}catch(e){return i}return o})},[e,t])]}},33986:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var i=n(52322),o=n(2784),r=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",s=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:a,form:c,isLoading:d=!1,disabled:u=!1,onClick:f,sx:m={},iconSize:x=16,iconFill:h,variant:p="primary",...v}=e;return(0,i.jsx)(r.zx,{ref:t,sx:{...m,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:a,form:c,disabled:u||d,onClick:d?void 0:f,variant:p,...v,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$j,{size:x,color:s(p),"data-testid":l(v["data-testid"],"spinner")}),o&&n]}):(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsx)(o,{size:x,fill:h,"data-testid":l(v["data-testid"],"icon")}),n]})})})},46999:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var i=n(52322),o=n(63397);n(2784);var r=n(75289);let l=e=>{let{name:t,label:n,placeholder:l,error:s,testId:a,onChange:c}=e;return(0,i.jsxs)(r.xu,{mb:3,children:[(0,i.jsx)(r.__,{htmlFor:t,mb:2,children:n}),(0,i.jsx)(o.gN,{name:t,type:"text",placeholder:l,as:r.II,autoComplete:"off",...c?{onChange:c}:null,...a?{"data-testid":a}:null}),s?(0,i.jsx)(r.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:s}):null]})}},59532:function(e,t,n){"use strict";var i=n(52322),o=n(63397),r=n(37149),l=n.n(r),s=n(75289),a=n(33986),c=n(55862),d=n(30527);function u(e){let{children:t}=e,n=(0,d.W)();return(0,i.jsx)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:t})}t.Z=function(e){let{children:t,close:n,isOpen:r,formId:f,validate:m,onSubmit:x,widthInPx:h,initialValues:p,content:{title:v},cardProps:y,omitFooter:g=!1,isLoading:b=!1,buttonLabel:j="Save",testId:k,actionMessage:S}=e;return l().setAppElement("#__next"),(0,i.jsx)(c.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:v,style:{content:{width:null!=h?h:"900px"}},children:(0,i.jsx)(o.J9,{initialValues:p,validate:e=>m?m(e):void 0,onSubmit:e=>{x(e)},children:e=>{let{isValid:r,isSubmitting:l,values:c,errors:m,touched:x,setFieldValue:h,setValues:p}=e;return(0,i.jsx)(o.l0,{id:f,...null!=k?{"data-testid":k}:null,children:(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"},...y,Header:(0,i.jsxs)(u,{children:[(0,i.jsx)(s.X6,{sx:{fontSize:"20px"},children:v}),(0,i.jsx)(s.x8,{type:"button",onClick:n})]}),Footer:g?null:(0,i.jsxs)(s.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(s.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof S?S(e):S}),(0,i.jsxs)(s.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(s.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||b,children:"Cancel"}),(0,i.jsx)(a.z,{label:j,form:f,type:"submit",disabled:!r||l||b,isLoading:l||b,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:r,isSubmitting:l,values:c,errors:m,touched:x,setFieldValue:h,setValues:p})})})}})})}},31562:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return q}});var i=n(52322),o=n(56803),r=n(97729),l=n.n(r),s=n(5632),a=n(2784),c=n(56580),d=n(88932),u=n(65077),f=n(75289),m=n(43388),x=n(63470),h=n(91589),p=n(27213),v=n(51507),y=n(27763),g=n(21442),b=n(51384),j=n(65186),k=n(59326),S=n(34166),w=n(80148);async function C(e){let{sliceName:t,sliceID:n,libraryID:i,sliceVariationIds:o,onSuccess:r}=e;try{let{errors:e}=await w.managerClient.slices.deleteSlice({libraryID:i,sliceID:n});if(e.length>0)throw e;o.forEach(e=>{(0,S.tB)({type:"model",library:i,sliceId:n,variationId:e})}),r(),d.Am.success("Successfully deleted slice “".concat(t,"”"))}catch(n){let e="An unexpected error happened while deleting slice “".concat(t,"”.");console.error(e,n),d.Am.error(e)}}var I=n(68968),L=n(33986),E=n(30527),O=n(55862),R=n(54597);let A=e=>{var t;let{isOpen:n,libName:o,sliceId:r,sliceName:l,sliceVariationIds:s,onClose:c}=e,[d,u]=(0,a.useState)(!1),{deleteSliceSuccess:m}=(0,R.Z)(),{syncChanges:x}=(0,I.g)(),{theme:h}=(0,k.B7)(),p=async()=>{u(!0),await C({libraryID:o,sliceID:r,sliceName:l,sliceVariationIds:s,onSuccess:()=>{m(r,o),x()}}),c(),u(!1)};return(0,i.jsx)(O.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:c,children:(0,i.jsx)(E.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},borderFooter:!0,Header:(0,i.jsxs)(f.kC,{sx:{position:"sticky",background:"gray",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(f.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(j.$vK,{size:20,color:null===(t=h.colors)||void 0===t?void 0:t.greyIcon}),(0,i.jsx)(f.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,i.jsx)(f.x8,{type:"button",onClick:c})]}),Footer:()=>(0,i.jsxs)(f.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(L.z,{label:"Cancel",variant:"secondary",onClick:c,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(L.z,{label:"Delete",variant:"danger",isLoading:d,sx:{minHeight:39,minWidth:78},onClick:()=>{p()}})]}),children:(0,i.jsxs)(f.nv,{children:["This action will immediately make the following changes:",(0,i.jsxs)("ul",{children:[(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(f.xv,{sx:{fontWeight:"bold"},children:[o,"/",l,"/"]})," ","directory."]}),(0,i.jsx)("li",{children:"Remove the Slice from all Slice Zones that use it."})]}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsx)("li",{children:"Remove the Slice from the list of available Slices to use in the Page Builder."})}),"You will need to manually remove the Slice from any Pages that currently use it."]})})})};var N=n(36887),z=n(94160),D=e=>{let{title:t,onCreateNew:n,buttonText:o,documentationComponent:r,videoPublicIdUrl:l,...s}=e;return(0,i.jsxs)(f.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},...s,children:[(0,i.jsx)(f.xu,{sx:e=>{var t;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:(0,i.jsx)(N.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:()=>{z.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,i.jsxs)(f.xu,{sx:e=>{var t;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,i.jsxs)(f.xu,{sx:e=>{var t;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:[(0,i.jsx)(f.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:t}),(0,i.jsx)(f.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:r})]}),(0,i.jsxs)(f.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,i.jsx)(f.zx,{onClick:n,"data-testid":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:o}),(0,i.jsx)(f.xv,{sx:{fontSize:"12px",color:"grey04",maxWidth:"280px"},children:"It will be stored locally and you will be able to push it to your repository"})]})]})]})},_=n(6256),W=n(63908),P=n(26109);async function F(e){let{slice:t,newSliceName:n,onSuccess:i}=e;try{let e=(0,W.PQ)(t,n),{errors:o}=await w.managerClient.slices.renameSlice({libraryID:t.from,model:P.id.fromSM(e.model)});if(o.length>0)throw o;i(e),d.Am.success("Slice name updated")}catch(n){let e="An unexpected error happened while renaming “".concat(t.model.name,"”.");console.error(e,n),d.Am.error(e)}}var Z=n(7723),T=n(59532),B=n(46999),K=n(63019);let H=e=>{var t,n;let{slice:o,isOpen:r,onClose:l}=e,{renameSliceSuccess:s}=(0,R.Z)(),{syncChanges:a}=(0,I.g)(),{localLibs:d,remoteLibs:u}=(0,c.v9)(e=>({localLibs:(0,Z.Sd)(e),remoteLibs:(0,Z.sT)(e)})),m=null!==(t=null==o?void 0:o.model.name)&&void 0!==t?t:"",x=async e=>{o&&(await F({slice:o,newSliceName:e.sliceName,onSuccess:e=>{s(e.from,e.model),a()}}),l())};return(0,i.jsx)(T.Z,{testId:"rename-slice-modal",isOpen:r,widthInPx:"530px",formId:"rename-slice-modal-".concat(null!==(n=null==o?void 0:o.model.id)&&void 0!==n?n:""),close:l,buttonLabel:"Rename",onSubmit:e=>void x(e),initialValues:{sliceName:m},content:{title:"Rename a slice"},validate:e=>(0,K.h)(e,d,u),children:e=>{let{touched:t,errors:n}=e;return(0,i.jsx)(f.xu,{children:(0,i.jsx)(B.W,{name:"sliceName",label:"Slice Name","data-testid":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?n.sliceName:void 0,testId:"slice-name-input"})})}})};var X=n(21151),U=n(68105),M=n(39204),V=n(7974),J=n(31860),q=()=>{var e,t,n,r;let j=(0,s.useRouter)(),{modalPayload:k,onOpenModal:S}=(0,g.H)(),{openLoginModal:C}=(0,R.Z)(),I=(0,x.k)(),L=(0,p.F)({menuType:"Dropdown",sectionsNamingExperiment:I}),{sliceFilterFn:E,defaultVariationSelector:O}=k,{remoteSlices:N,libraries:z}=(0,c.v9)(e=>({remoteSlices:(0,Z.sT)(e),libraries:(0,Z.Sd)(e)})),[W,P]=(0,a.useState)(!1),[F,T]=(0,a.useState)(!1),[B,K]=(0,a.useState)(!1),[q,Q]=(0,a.useState)(!1),Y=z.filter(e=>e.isLocal),G=z.map(e=>(e.components=[...e.components].sort((e,t)=>e.model.name.localeCompare(t.model.name)),e)),$=(z||[]).map(e=>e.components).flat(),ee=$.length,[et,en]=(0,a.useState)(),ei=()=>{T(!0)},eo=()=>{K(!0)},er=async()=>{await w.managerClient.user.checkIsLoggedIn()?Q(!0):C()},el=()=>{Q(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsxs)("title",{children:[(0,J._)((0,J.f)(I.value))," - Slice Machine"]})}),(0,i.jsxs)(b.LN,{children:[(0,i.jsxs)(b.wd,{children:[(0,i.jsx)(b.Cx,{children:(0,i.jsx)(m.g,{children:(0,J._)((0,J.f)(I.value))})}),(null==Y?void 0:Y.length)!==0&&0!==ee?(0,i.jsxs)(o.ar,{children:[(0,i.jsx)(o.av,{children:(0,i.jsx)(o.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(o.as,{align:"end",children:[(0,i.jsx)(o.at,{renderStartIcon:()=>L.fromImage.BackgroundIcon,onSelect:()=>void er(),description:L.fromImage.description,children:L.fromImage.title}),(0,i.jsx)(o.at,{renderStartIcon:()=>L.fromScratch.BackgroundIcon,onSelect:()=>P(!0),description:L.fromScratch.description,children:L.fromScratch.title})]})]}):void 0]}),(0,i.jsxs)(b.RN,{children:[(0,i.jsx)(u.xR,{sx:{display:"flex",flexDirection:"column"},children:G.length>0?(0,i.jsx)(f.kC,{sx:{flex:1,flexDirection:"column"},children:0===ee?(0,i.jsx)(f.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(D,{title:"What are ".concat((0,J._)(I.value),"?"),onCreateNew:()=>{P(!0)},buttonText:"Create one",videoPublicIdUrl:V.rd,documentationComponent:(0,i.jsxs)(i.Fragment,{children:[(0,J._)((0,J.f)(I.value))," ",'are sections of your website. Prismic documents contain a dynamic "',(0,J.f)(I.value)," ",'Zone" that allows content creators to add, edit, and rearrange ',(0,J._)(I.value)," ","to compose dynamic layouts for any page design."," ",(0,i.jsx)(f.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:e=>{var t;return{color:null==e?void 0:null===(t=e.colors)||void 0===t?void 0:t.primary}},children:"Learn more"}),"."]}),"data-testid":"slices-table-blank-slate"})}):G.map(e=>{let{name:t,isLocal:n,components:o}=e;return(0,i.jsxs)(f.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,i.jsxs)(f.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(f.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,i.jsx)(f.xv,{children:I.eligible&&1===G.length?"Your ".concat((0,J._)(I.value)):t})}),!n&&(0,i.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,i.jsx)(X.Z,{elems:o,defineElementKey:e=>e.model.name,renderElem:e=>(0,i.jsx)(v.b,{action:{type:"menu",onRemove:()=>{en(e),ei()},onRename:()=>{en(e),eo()}},mode:"navigation",onUpdateScreenshot:()=>{S({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"}),gridGap:"32px 16px"})]},t)})}):void 0}),(null==Y?void 0:Y.length)>0&&(0,i.jsx)(U.Z,{slices:E($),defaultVariationSelector:O}),(null==Y?void 0:Y.length)>0&&W&&(0,i.jsx)(_.c,{localLibraries:Y,location:"slices",remoteSlices:N,onSuccess:(e,t)=>{let n=e.variations[0].id,i=y.Y.getBuilderPagePathname({libraryName:t,sliceName:e.name,variationId:n});j.push(i),d.Am.success((0,M.kQ)({sectionsNamingExperiment:I,path:"".concat(t,"/").concat(e.name,"/model.json")}))},onClose:()=>{P(!1)}}),(0,i.jsx)(H,{isOpen:B,slice:et,onClose:()=>{K(!1)},"data-testid":"rename-slice-modal"}),(0,i.jsx)(A,{isOpen:F,libName:null!==(e=null==et?void 0:et.from)&&void 0!==e?e:"",sliceId:null!==(t=null==et?void 0:et.model.id)&&void 0!==t?t:"",sliceName:null!==(n=null==et?void 0:et.model.name)&&void 0!==n?n:"",sliceVariationIds:(null!==(r=null==et?void 0:et.model.variations)&&void 0!==r?r:[]).map(e=>e.id),onClose:()=>{T(!1)}}),(0,i.jsx)(h.S,{open:q,location:"slices",onSuccess:e=>{let{library:t}=e;d.Am.success((0,i.jsx)(M.GX,{message:"".concat((0,J.f)(I.value),"(s) added to ").concat(I.value," zone and created at: "),path:t})),el()},onClose:el})]})]})]})}},5683:function(e,t,n){"use strict";n.d(t,{i:function(){return r},v:function(){return o}});let i=e=>"slice-machine_".concat(e),o=i("staticFieldsInfoDialogDismissed");function r(e){let{type:t,library:n,sliceId:o,variationId:r}=e;return i(["ai-feedback",t,n,o,r].join("#"))}},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return b}});var i=n(2784);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n(52322);var r=["shift","alt","meta","mod","ctrl"],l={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function s(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function a(e,t){return void 0===t&&(t=","),e.split(t)}function c(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return s(e)}),l={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},a=i.filter(function(e){return!r.includes(e)});return o({},l,{keys:a,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([s(e.key),s(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([s(e.key),s(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){d.clear()});var d=new Set;function u(e){return Array.isArray(e)}function f(e){var t=Array.isArray(e)?e:[e];d.has("meta")&&d.forEach(function(e){return!r.includes(e)&&d.delete(e.toLowerCase())}),t.forEach(function(e){return d.add(e.toLowerCase())})}function m(e){var t=Array.isArray(e)?e:[e];"meta"===e?d.clear():t.forEach(function(e){return d.delete(e.toLowerCase())})}function x(e,t){var n=e.target;void 0===t&&(t=!1);var i=n&&n.tagName;return u(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i.toLowerCase()})):!!(i&&t&&!0===t)}var h=function(e,t,n){void 0===n&&(n=!1);var i,o=t.alt,r=t.meta,l=t.mod,a=t.shift,c=t.ctrl,f=t.keys,m=e.key,x=e.code,h=e.ctrlKey,p=e.metaKey,v=e.shiftKey,y=e.altKey,g=s(x),b=m.toLowerCase();if(!n){if(!y===o&&"alt"!==b||!v===a&&"shift"!==b)return!1;if(l){if(!p&&!h)return!1}else if(!p===r&&"meta"!==b&&"os"!==b||!h===c&&"ctrl"!==b&&"control"!==b)return!1}return!!(f&&1===f.length&&(f.includes(b)||f.includes(g)))||(f?(void 0===i&&(i=","),(u(f)?f:f.split(i)).every(function(e){return d.has(e.trim().toLowerCase())})):!f)},p=(0,i.createContext)(void 0),v=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,t,n,o){var r,l=(0,i.useRef)(null),d=(0,i.useRef)(!1),b=n instanceof Array?o instanceof Array?void 0:o:n,j=u(e)?e.join(null==b?void 0:b.splitKey):e,k=n instanceof Array?n:o instanceof Array?o:void 0,S=(0,i.useCallback)(t,null!=k?k:[]),w=(0,i.useRef)(S);k?w.current=S:w.current=t;var C=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(i,o){return i&&e(t[o],n[o])},!0):t===n}((r=(0,i.useRef)(void 0)).current,b)&&(r.current=b),r.current),I=(0,i.useContext)(v).enabledScopes,L=(0,i.useContext)(p);return g(function(){if((null==C?void 0:C.enabled)!==!1&&(e=null==C?void 0:C.scopes,0===I.length&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!e||I.some(function(t){return e.includes(t)})||I.includes("*")))){var e,t=function(e,t){var n;if(void 0===t&&(t=!1),!(x(e,["input","textarea","select"])&&!x(e,null==C?void 0:C.enableOnFormTags)||null!=C&&null!=C.ignoreEventWhen&&C.ignoreEventWhen(e))){if(null!==l.current&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){y(e);return}(null==(n=e.target)||!n.isContentEditable||null!=C&&C.enableOnContentEditable)&&a(j,null==C?void 0:C.splitKey).forEach(function(n){var i,o,r,l=c(n,null==C?void 0:C.combinationKey);if(h(e,l,null==C?void 0:C.ignoreModifiers)||null!=(r=l.keys)&&r.includes("*")){if(t&&d.current)return;if(("function"==typeof(i=null==C?void 0:C.preventDefault)&&i(e,l)||!0===i)&&e.preventDefault(),"function"==typeof(o=null==C?void 0:C.enabled)?!o(e,l):!0!==o&&void 0!==o){y(e);return}w.current(e,l),t||(d.current=!0)}})}},n=function(e){void 0!==e.key&&(f(s(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&t(e))},i=function(e){void 0!==e.key&&(m(s(e.code)),d.current=!1,null!=C&&C.keyup&&t(e,!0))},o=l.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",i),o.addEventListener("keydown",n),L&&a(j,null==C?void 0:C.splitKey).forEach(function(e){return L.addHotkey(c(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))}),function(){o.removeEventListener("keyup",i),o.removeEventListener("keydown",n),L&&a(j,null==C?void 0:C.splitKey).forEach(function(e){return L.removeHotkey(c(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))})}}},[j,C,I]),l}}},function(e){e.O(0,[898,789,397,44,34,658,907,888,774,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.FieldSet_flex__r2Zbg{all:unset;display:flex}.FieldSet_column__esHjW{flex-direction:column}.FieldSet_root__MYqY8{border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;box-shadow:var(--box-shadow-1);overflow-x:hidden}.FieldSet_row__DZZjD{align-items:center;flex-direction:row;gap:8px;padding-inline:16px}.FieldSet_borderBottom__WVCMK{box-sizing:border-box}.FieldSet_borderBottom__WVCMK:not(:last-child){border-bottom:1px solid var(--grey6)}.FieldSet_legend__4k9_l{background-color:var(--grey2);height:48px;order:0}.FieldSet_header__cR_f3{background-color:var(--grey2);height:72px;order:1}.FieldSet_content__WzxRs{background-color:var(--grey1);order:2;padding:16px}.FieldSet_list__mILoo{max-height:256px;order:2;overflow-y:auto}.FieldSet_listItem__QOhSB{background-color:var(--grey1);flex-shrink:0;height:64px}.FieldSet_borderTop__KfoL_:not(:first-child){box-shadow:0 -1px 0 0 var(--grey6)}.FieldSet_footer__1VWxY{background-color:var(--grey1);height:48px;order:3;padding-right:8px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,n,d,u,f,h,l,k,j,p,g,o,r,m){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,e,p,g,"static/chunks/pages/index-0d8cb369de720a35.js"],"/_error":["static/chunks/pages/_error-fedd2c6ebd3d27b9.js"],"/changelog":[c,t,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-063c5e11dfc8fd55.js"],"/changes":[c,i,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-fa4f2563cb5fd014.js",a,n,"static/css/d98ebc475f8423a3.css","static/chunks/pages/changes-564336edb0ed18b0.js"],"/custom-types":[s,e,p,g,"static/chunks/pages/custom-types-5acd56959b60346f.js"],"/custom-types/[customTypeId]":[c,d,u,f,h,s,t,b,l,o,a,e,k,j,r,m,"static/chunks/pages/custom-types/[customTypeId]-4024560ca59ad2be.js"],"/labs":["static/chunks/pages/labs-9630bfb1005be02b.js"],"/page-types/[pageTypeId]":[c,d,u,f,h,s,t,b,l,o,a,e,k,j,r,m,"static/chunks/pages/page-types/[pageTypeId]-0d2416da0958eb40.js"],"/settings":[s,"static/css/e5f781f20e24a5ea.css","static/chunks/pages/settings-01f4aeb9112a1f87.js"],"/slices":[c,i,s,b,a,n,j,"static/css/efa5152b7c0f35c0.css","static/chunks/pages/slices-a0aa3bbe2cf1689c.js"],"/slices/[lib]/[sliceName]/[variation]":[c,i,d,u,f,h,s,t,b,l,a,k,n,"static/css/cdee5b195444f185.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-bd5e45632c419567.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[i,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/157-54b8336d20b41933.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5008e29008aa04f4.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/397-e6c340070a3bcb41.js","static/chunks/59b4e022-ef680789f7cc9b11.js","static/chunks/34-6c3125e6f01c62c7.js","static/chunks/647-7b9b5aa9468f9e4b.js","static/chunks/183-4ea255b867ff171b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/44-a2056f993381ad0f.js","static/chunks/658-8231c0b729e0124a.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/349-7118116b93278f73.js","static/chunks/630-29c729ad2a291ef6.js","static/chunks/907-590c914f55547b96.js","static/chunks/248-03446cd9e9f13730.js","static/css/4e475d945cf8a890.css","static/chunks/385-b949173dfa03dd3e.js","static/chunks/489-f1d584386a1ead7e.js","static/css/56f2a6684a524374.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
package/out/settings.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/cc9b10286400c2b9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cc9b10286400c2b9.css" data-n-g=""/><link rel="preload" href="/_next/static/css/e5f781f20e24a5ea.css" as="style"/><link rel="stylesheet" href="/_next/static/css/e5f781f20e24a5ea.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-b3522fdebabf510a.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-df4a4d1aaa9d7216.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/pages/settings-01f4aeb9112a1f87.js" defer=""></script><script src="/_next/static/i3RCInXoJzCEi4NnU8YGb/_buildManifest.js" defer=""></script><script src="/_next/static/i3RCInXoJzCEi4NnU8YGb/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/settings","query":{},"buildId":"i3RCInXoJzCEi4NnU8YGb","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
.flex {
|
|
2
|
-
all: unset;
|
|
3
|
-
display: flex;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.column {
|
|
7
|
-
composes: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.root {
|
|
12
|
-
composes: column;
|
|
13
|
-
border-color: var(--grey6);
|
|
14
|
-
border-radius: 6px;
|
|
15
|
-
border-style: solid;
|
|
16
|
-
border-width: 1px;
|
|
17
|
-
box-shadow: var(--box-shadow-1);
|
|
18
|
-
overflow-x: hidden;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.row {
|
|
22
|
-
composes: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
flex-direction: row;
|
|
25
|
-
gap: 8px;
|
|
26
|
-
padding-inline: 16px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.borderBottom {
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
&:not(:last-child) {
|
|
32
|
-
border-bottom-color: var(--grey6);
|
|
33
|
-
border-bottom-style: solid;
|
|
34
|
-
border-bottom-width: 1px;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.legend {
|
|
39
|
-
composes: row borderBottom;
|
|
40
|
-
background-color: var(--grey2);
|
|
41
|
-
height: 48px;
|
|
42
|
-
order: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.header {
|
|
46
|
-
composes: row borderBottom;
|
|
47
|
-
background-color: var(--grey2);
|
|
48
|
-
height: 72px;
|
|
49
|
-
order: 1;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.content {
|
|
53
|
-
composes: column;
|
|
54
|
-
background-color: var(--grey1);
|
|
55
|
-
order: 2;
|
|
56
|
-
padding: 16px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.list {
|
|
60
|
-
composes: column;
|
|
61
|
-
max-height: 256px;
|
|
62
|
-
order: 2;
|
|
63
|
-
overflow-y: auto;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.listItem {
|
|
67
|
-
composes: row borderBottom;
|
|
68
|
-
background-color: var(--grey1);
|
|
69
|
-
flex-shrink: 0;
|
|
70
|
-
height: 64px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.borderTop:not(:first-child) {
|
|
74
|
-
/* stylelint-disable-next-line declaration-property-value-allowed-list -- Displays a 1 px top border outside the element. */
|
|
75
|
-
box-shadow: 0 -1px 0 0 var(--grey6);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.footer {
|
|
79
|
-
composes: row borderTop;
|
|
80
|
-
background-color: var(--grey1);
|
|
81
|
-
height: 48px;
|
|
82
|
-
order: 3;
|
|
83
|
-
padding-right: 8px;
|
|
84
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
declare const styles: {
|
|
2
|
-
readonly "borderBottom": string;
|
|
3
|
-
readonly "borderTop": string;
|
|
4
|
-
readonly "column": string;
|
|
5
|
-
readonly "content": string;
|
|
6
|
-
readonly "flex": string;
|
|
7
|
-
readonly "footer": string;
|
|
8
|
-
readonly "header": string;
|
|
9
|
-
readonly "legend": string;
|
|
10
|
-
readonly "list": string;
|
|
11
|
-
readonly "listItem": string;
|
|
12
|
-
readonly "root": string;
|
|
13
|
-
readonly "row": string;
|
|
14
|
-
};
|
|
15
|
-
export = styles;
|
|
16
|
-
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Box,
|
|
3
|
-
Button,
|
|
4
|
-
ButtonGroup,
|
|
5
|
-
IconButton,
|
|
6
|
-
Select,
|
|
7
|
-
SelectItem,
|
|
8
|
-
Skeleton,
|
|
9
|
-
Text,
|
|
10
|
-
theme,
|
|
11
|
-
} from "@prismicio/editor-ui";
|
|
12
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
13
|
-
|
|
14
|
-
import { BitbucketIcon } from "../../icons/BitbucketIcon";
|
|
15
|
-
import { GitHubIcon } from "../../icons/GitHubIcon";
|
|
16
|
-
import { GitLabIcon } from "../../icons/GitLabIcon";
|
|
17
|
-
import {
|
|
18
|
-
FieldSet,
|
|
19
|
-
FieldSetContent,
|
|
20
|
-
FieldSetFooter,
|
|
21
|
-
FieldSetHeader,
|
|
22
|
-
FieldSetLegend,
|
|
23
|
-
FieldSetList,
|
|
24
|
-
FieldSetListItem,
|
|
25
|
-
} from "./FieldSet";
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
const meta = {
|
|
30
|
-
component: FieldSet,
|
|
31
|
-
argTypes: {
|
|
32
|
-
children: { control: { disable: true } },
|
|
33
|
-
},
|
|
34
|
-
} satisfies Meta<typeof FieldSet>;
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
37
|
-
|
|
38
|
-
export const Default = {
|
|
39
|
-
args: {
|
|
40
|
-
children: (
|
|
41
|
-
<>
|
|
42
|
-
<FieldSetLegend />
|
|
43
|
-
<FieldSetHeader />
|
|
44
|
-
<FieldSetList>
|
|
45
|
-
<FieldSetListItem action={<Button color="grey">Action</Button>} />
|
|
46
|
-
</FieldSetList>
|
|
47
|
-
<FieldSetFooter action={<IconButton icon="openInNew" />} />
|
|
48
|
-
</>
|
|
49
|
-
),
|
|
50
|
-
},
|
|
51
|
-
} satisfies Story;
|
|
52
|
-
|
|
53
|
-
export const WithButtonGroupContent = {
|
|
54
|
-
args: {
|
|
55
|
-
...Default.args,
|
|
56
|
-
children: (
|
|
57
|
-
<>
|
|
58
|
-
<FieldSetLegend>Connected Git Repository</FieldSetLegend>
|
|
59
|
-
<FieldSetContent>
|
|
60
|
-
<ButtonGroup color="grey">
|
|
61
|
-
<Button
|
|
62
|
-
renderStartIcon={() => <GitHubIcon color={theme.color.grey11} />}
|
|
63
|
-
sx={{ flexBasis: 0, flexGrow: 1 }}
|
|
64
|
-
>
|
|
65
|
-
GitHub
|
|
66
|
-
</Button>
|
|
67
|
-
<Button
|
|
68
|
-
disabled
|
|
69
|
-
renderStartIcon={() => (
|
|
70
|
-
<BitbucketIcon color={theme.color.grey11} />
|
|
71
|
-
)}
|
|
72
|
-
sx={{ flexBasis: 0, flexGrow: 1 }}
|
|
73
|
-
>
|
|
74
|
-
Bitbucket{" "}
|
|
75
|
-
<Text color="inherit" variant="small">
|
|
76
|
-
(soon)
|
|
77
|
-
</Text>
|
|
78
|
-
</Button>
|
|
79
|
-
<Button
|
|
80
|
-
disabled
|
|
81
|
-
renderStartIcon={() => <GitLabIcon color={theme.color.grey11} />}
|
|
82
|
-
sx={{ flexBasis: 0, flexGrow: 1 }}
|
|
83
|
-
>
|
|
84
|
-
GitLab{" "}
|
|
85
|
-
<Text color="inherit" variant="small">
|
|
86
|
-
(soon)
|
|
87
|
-
</Text>
|
|
88
|
-
</Button>
|
|
89
|
-
</ButtonGroup>
|
|
90
|
-
</FieldSetContent>
|
|
91
|
-
<FieldSetFooter action={<IconButton icon="openInNew" />}>
|
|
92
|
-
Learn more about Prismic for Git
|
|
93
|
-
</FieldSetFooter>
|
|
94
|
-
</>
|
|
95
|
-
),
|
|
96
|
-
},
|
|
97
|
-
parameters: { controls: { hideNoControlsWarning: true, include: [] } },
|
|
98
|
-
} satisfies Story;
|
|
99
|
-
|
|
100
|
-
export const LoadingWithHeaderAndList = {
|
|
101
|
-
args: {
|
|
102
|
-
...Default.args,
|
|
103
|
-
children: (
|
|
104
|
-
<>
|
|
105
|
-
<FieldSetLegend>Connected Git Repository</FieldSetLegend>
|
|
106
|
-
<FieldSetHeader>
|
|
107
|
-
<OwnerSelect disabled />
|
|
108
|
-
</FieldSetHeader>
|
|
109
|
-
<FieldSetList>
|
|
110
|
-
{[...Array(4).keys()].map((index) => (
|
|
111
|
-
<FieldSetListItem
|
|
112
|
-
action={<Skeleton height={32} width={67.59} />}
|
|
113
|
-
key={index}
|
|
114
|
-
>
|
|
115
|
-
<Skeleton
|
|
116
|
-
height={24}
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
118
|
-
// @ts-ignore TODO(DT-1918): add `verticalAlign: "middle"` to the `sx` prop.
|
|
119
|
-
sx={{ verticalAlign: "middle" }}
|
|
120
|
-
width={129.92}
|
|
121
|
-
/>
|
|
122
|
-
</FieldSetListItem>
|
|
123
|
-
))}
|
|
124
|
-
</FieldSetList>
|
|
125
|
-
<FieldSetFooter action={<IconButton icon="openInNew" />}>
|
|
126
|
-
Learn more about Prismic for Git
|
|
127
|
-
</FieldSetFooter>
|
|
128
|
-
</>
|
|
129
|
-
),
|
|
130
|
-
},
|
|
131
|
-
parameters: { controls: { hideNoControlsWarning: true, include: [] } },
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const WithHeaderAndListOverflow = {
|
|
135
|
-
args: {
|
|
136
|
-
...Default.args,
|
|
137
|
-
children: (
|
|
138
|
-
<>
|
|
139
|
-
<FieldSetLegend>Connected Git Repository</FieldSetLegend>
|
|
140
|
-
<FieldSetHeader>
|
|
141
|
-
<OwnerSelect />
|
|
142
|
-
</FieldSetHeader>
|
|
143
|
-
<FieldSetList>
|
|
144
|
-
{[...Array(100).keys()].map((index) => (
|
|
145
|
-
<FieldSetListItem
|
|
146
|
-
action={<Button color="grey">Connect</Button>}
|
|
147
|
-
key={index}
|
|
148
|
-
>
|
|
149
|
-
Repository <Text color="grey11">• xd ago</Text>
|
|
150
|
-
</FieldSetListItem>
|
|
151
|
-
))}
|
|
152
|
-
</FieldSetList>
|
|
153
|
-
<FieldSetFooter action={<IconButton icon="openInNew" />}>
|
|
154
|
-
Learn more about Prismic for Git
|
|
155
|
-
</FieldSetFooter>
|
|
156
|
-
</>
|
|
157
|
-
),
|
|
158
|
-
},
|
|
159
|
-
parameters: { controls: { hideNoControlsWarning: true, include: [] } },
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export const WithSingleListItem = {
|
|
163
|
-
args: {
|
|
164
|
-
...Default.args,
|
|
165
|
-
children: (
|
|
166
|
-
<>
|
|
167
|
-
<FieldSetLegend>Connected Git Repository</FieldSetLegend>
|
|
168
|
-
<FieldSetList>
|
|
169
|
-
<FieldSetListItem action={<Button color="grey">Disconnect</Button>}>
|
|
170
|
-
Repository <Text color="grey11">• xd ago</Text>
|
|
171
|
-
</FieldSetListItem>
|
|
172
|
-
</FieldSetList>
|
|
173
|
-
<FieldSetFooter action={<IconButton icon="openInNew" />}>
|
|
174
|
-
Learn more about Prismic for Git
|
|
175
|
-
</FieldSetFooter>
|
|
176
|
-
</>
|
|
177
|
-
),
|
|
178
|
-
},
|
|
179
|
-
parameters: { controls: { hideNoControlsWarning: true, include: [] } },
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export const WithHeaderAndBoxContent = {
|
|
183
|
-
args: {
|
|
184
|
-
...Default.args,
|
|
185
|
-
children: (
|
|
186
|
-
<>
|
|
187
|
-
<FieldSetLegend>Connected Git Repository</FieldSetLegend>
|
|
188
|
-
<FieldSetHeader>
|
|
189
|
-
<OwnerSelect />
|
|
190
|
-
</FieldSetHeader>
|
|
191
|
-
<FieldSetContent>
|
|
192
|
-
<Box
|
|
193
|
-
flexDirection="column"
|
|
194
|
-
/*
|
|
195
|
-
* TODO: these `padding` values actually don't match Figma, but they
|
|
196
|
-
* are the closest allowed by the `Box` component.
|
|
197
|
-
*/
|
|
198
|
-
padding={{ block: 72, inline: 100 }}
|
|
199
|
-
>
|
|
200
|
-
<Text align="center" variant="emphasized">
|
|
201
|
-
No Results Found
|
|
202
|
-
</Text>
|
|
203
|
-
<Text align="center" color="grey11">
|
|
204
|
-
Try selecting a different Git account or organization on the top
|
|
205
|
-
left.
|
|
206
|
-
</Text>
|
|
207
|
-
</Box>
|
|
208
|
-
</FieldSetContent>
|
|
209
|
-
<FieldSetFooter action={<IconButton icon="openInNew" />}>
|
|
210
|
-
Learn more about Prismic for Git
|
|
211
|
-
</FieldSetFooter>
|
|
212
|
-
</>
|
|
213
|
-
),
|
|
214
|
-
},
|
|
215
|
-
parameters: { controls: { hideNoControlsWarning: true, include: [] } },
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
type OwnerSelectProps = { disabled?: boolean };
|
|
219
|
-
|
|
220
|
-
function OwnerSelect(props: OwnerSelectProps) {
|
|
221
|
-
return (
|
|
222
|
-
<Select
|
|
223
|
-
{...props}
|
|
224
|
-
color="grey"
|
|
225
|
-
constrainContentWidth
|
|
226
|
-
flexContent
|
|
227
|
-
placeholder="Owner"
|
|
228
|
-
renderStartIcon={() => <GitHubIcon color={theme.color.grey11} />}
|
|
229
|
-
size="large"
|
|
230
|
-
sx={{ width: "calc(50% - 8px)" }}
|
|
231
|
-
>
|
|
232
|
-
{[...Array(2).keys()].map((index) => (
|
|
233
|
-
<SelectItem
|
|
234
|
-
key={index}
|
|
235
|
-
renderStartIcon={() => <GitHubIcon color={theme.color.grey11} />}
|
|
236
|
-
size="large"
|
|
237
|
-
value={`owner-${index}`}
|
|
238
|
-
>
|
|
239
|
-
Owner
|
|
240
|
-
</SelectItem>
|
|
241
|
-
))}
|
|
242
|
-
</Select>
|
|
243
|
-
);
|
|
244
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Text } from "@prismicio/editor-ui";
|
|
2
|
-
import type { FC, PropsWithChildren, ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
import styles from "./FieldSet.module.css";
|
|
5
|
-
|
|
6
|
-
export const FieldSet: FC<PropsWithChildren> = (props) => (
|
|
7
|
-
<div {...props} className={styles.root} />
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
export const FieldSetLegend: FC<PropsWithChildren> = ({
|
|
11
|
-
children,
|
|
12
|
-
...otherProps
|
|
13
|
-
}) => (
|
|
14
|
-
<div {...otherProps} className={styles.legend}>
|
|
15
|
-
<Text color="grey11" component="span" noWrap variant="smallBold">
|
|
16
|
-
{children}
|
|
17
|
-
</Text>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
export const FieldSetHeader: FC<PropsWithChildren> = (props) => (
|
|
22
|
-
<div {...props} className={styles.header} />
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export const FieldSetContent: FC<PropsWithChildren> = (props) => (
|
|
26
|
-
<div {...props} className={styles.content} />
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export const FieldSetList: FC<PropsWithChildren> = (props) => (
|
|
30
|
-
<ul {...props} className={styles.list} />
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
type FieldSetListItemProps = PropsWithChildren<{ action?: ReactNode }>;
|
|
34
|
-
|
|
35
|
-
export const FieldSetListItem: FC<FieldSetListItemProps> = ({
|
|
36
|
-
action,
|
|
37
|
-
children,
|
|
38
|
-
...otherProps
|
|
39
|
-
}) => (
|
|
40
|
-
<li {...otherProps} className={styles.listItem}>
|
|
41
|
-
<Text component="span" noWrap variant="bold" sx={{ flexGrow: 1 }}>
|
|
42
|
-
{children}
|
|
43
|
-
</Text>
|
|
44
|
-
{action}
|
|
45
|
-
</li>
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
type FieldSetFooterProps = PropsWithChildren<{ action?: ReactNode }>;
|
|
49
|
-
|
|
50
|
-
export const FieldSetFooter: FC<FieldSetFooterProps> = ({
|
|
51
|
-
action,
|
|
52
|
-
children,
|
|
53
|
-
...otherProps
|
|
54
|
-
}) => (
|
|
55
|
-
<div {...otherProps} className={styles.footer}>
|
|
56
|
-
<Text
|
|
57
|
-
color="grey11"
|
|
58
|
-
component="span"
|
|
59
|
-
noWrap
|
|
60
|
-
variant="small"
|
|
61
|
-
sx={{ flexGrow: 1 }}
|
|
62
|
-
>
|
|
63
|
-
{children}
|
|
64
|
-
</Text>
|
|
65
|
-
{action}
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useExperimentVariant } from "@/hooks/useExperimentVariant";
|
|
2
|
-
|
|
3
|
-
export type UseSectionsNamingExperimentReturnType = {
|
|
4
|
-
eligible: boolean;
|
|
5
|
-
value: string;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export function useSectionsNamingExperiment(): UseSectionsNamingExperimentReturnType {
|
|
9
|
-
const variant = useExperimentVariant("section_greater_than_slice");
|
|
10
|
-
const eligible = variant?.value === "treatment";
|
|
11
|
-
return {
|
|
12
|
-
eligible,
|
|
13
|
-
value: eligible ? "section" : "slice",
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Box } from "@prismicio/editor-ui";
|
|
2
|
-
import Head from "next/head";
|
|
3
|
-
import { useRouter } from "next/router";
|
|
4
|
-
import { type FC, useEffect } from "react";
|
|
5
|
-
|
|
6
|
-
import { BreadcrumbItem } from "@/components/Breadcrumb";
|
|
7
|
-
import { ConnectGitRepository } from "@/features/settings/git/ConnectGitRepository";
|
|
8
|
-
import { useGitIntegrationExperiment } from "@/features/settings/git/useGitIntegrationExperiment";
|
|
9
|
-
import {
|
|
10
|
-
AppLayout,
|
|
11
|
-
AppLayoutBreadcrumb,
|
|
12
|
-
AppLayoutContent,
|
|
13
|
-
AppLayoutHeader,
|
|
14
|
-
} from "@/legacy/components/AppLayout";
|
|
15
|
-
|
|
16
|
-
export const SettingsPage: FC = () => {
|
|
17
|
-
const gitIntegrationExperiment = useGitIntegrationExperiment();
|
|
18
|
-
const router = useRouter();
|
|
19
|
-
|
|
20
|
-
// TODO(DT-1801): implement a 404 page.
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (!gitIntegrationExperiment.eligible) {
|
|
23
|
-
void router.replace("/");
|
|
24
|
-
}
|
|
25
|
-
}, [gitIntegrationExperiment.eligible, router]);
|
|
26
|
-
|
|
27
|
-
if (!gitIntegrationExperiment.eligible) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
<Head>
|
|
34
|
-
<title>Settings - Slice Machine</title>
|
|
35
|
-
</Head>
|
|
36
|
-
<AppLayout>
|
|
37
|
-
<AppLayoutHeader>
|
|
38
|
-
<AppLayoutBreadcrumb>
|
|
39
|
-
<BreadcrumbItem>Settings</BreadcrumbItem>
|
|
40
|
-
</AppLayoutBreadcrumb>
|
|
41
|
-
</AppLayoutHeader>
|
|
42
|
-
<AppLayoutContent>
|
|
43
|
-
<Box flexDirection="column" maxWidth={600}>
|
|
44
|
-
<ConnectGitRepository />
|
|
45
|
-
</Box>
|
|
46
|
-
</AppLayoutContent>
|
|
47
|
-
</AppLayout>
|
|
48
|
-
</>
|
|
49
|
-
);
|
|
50
|
-
};
|