slice-machine-ui 1.14.1-dev-upgrade-legacy.2 → 1.14.1
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/components/ChangesItems/ChangesItems.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +4 -12
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +1 -1
- package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +0 -8
- package/lib/models/ui/Slice/index.tsx +26 -52
- package/out/404.html +1 -1
- package/out/[lib]/[sliceName]/[variation]/screenshot.html +1 -1
- package/out/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/[lib]/[sliceName]/[variation].html +1 -1
- package/out/_next/static/chunks/482-a4c1c3721ca38516.js +1 -0
- package/out/_next/static/chunks/573-aaae870d20e5f86c.js +1 -0
- package/out/_next/static/chunks/{969-bcfa23e8fd4773e7.js → 740-d0642219804fa9f0.js} +1 -1
- package/out/_next/static/chunks/799-5ea3393033a9f617.js +1 -0
- package/out/_next/static/chunks/906-9224feb63b5e36f3.js +1 -0
- package/out/_next/static/chunks/97-f6188ebe22eb21da.js +1 -0
- package/out/_next/static/chunks/970-6fb969573ccdf018.js +1 -0
- package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]-9fff494255e34c39.js +1 -0
- package/out/_next/static/chunks/pages/{_app-fea3c7cfb3b5c1b5.js → _app-e667eb27c83f2806.js} +7 -7
- package/out/_next/static/chunks/pages/changes-6a039e823313b41c.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-94ffa7cbfab2ef0f.js → [customTypeId]-f8e48a51edbb5e1c.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-8d55eca5790c0406.js → custom-types-abb8c8c92880120e.js} +1 -1
- package/out/_next/static/chunks/pages/{index-203d9ef99d22841a.js → index-f382c8090bd21628.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-81e1a6a78dd46d0f.js → [pageTypeId]-ddc8d057c3e251d1.js} +1 -1
- package/out/_next/static/chunks/pages/slices-24d2714462334469.js +1 -0
- package/out/_next/static/n_JoJA4knO1LXgyjcCqiI/_buildManifest.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/page-types/[pageTypeId].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/pages/slices.tsx +1 -1
- package/components/Forms/ConvertLegacySliceModal/ConvertLegacySliceModal.css.ts +0 -35
- package/components/Forms/ConvertLegacySliceModal/ConvertLegacySliceModal.tsx +0 -287
- package/components/Forms/ConvertLegacySliceModal/FormAsNewSlice.tsx +0 -153
- package/components/Forms/ConvertLegacySliceModal/FormAsNewVariation.tsx +0 -234
- package/components/Forms/ConvertLegacySliceModal/FormMergeWithIdentical.tsx +0 -104
- package/components/Forms/ConvertLegacySliceModal/index.tsx +0 -1
- package/components/Forms/ConvertLegacySliceModal/types.ts +0 -47
- package/out/_next/static/M1R8KztYSsGkogo8JNvDL/_buildManifest.js +0 -1
- package/out/_next/static/chunks/130-5b1dc0c67078c48b.js +0 -1
- package/out/_next/static/chunks/4-11b3d83d878be4e2.js +0 -1
- package/out/_next/static/chunks/799-00944cdde5b22566.js +0 -1
- package/out/_next/static/chunks/80-dce703180b269337.js +0 -1
- package/out/_next/static/chunks/934-7e172f9ea1128015.js +0 -1
- package/out/_next/static/chunks/970-d63bac52b8b2439a.js +0 -1
- package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]-fc545d9beb1bb757.js +0 -1
- package/out/_next/static/chunks/pages/changes-eb708af5609cc7d2.js +0 -1
- package/out/_next/static/chunks/pages/slices-3ecbaeec98bc9eab.js +0 -1
- /package/out/_next/static/{M1R8KztYSsGkogo8JNvDL → n_JoJA4knO1LXgyjcCqiI}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{26688:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return t(12472)}])},44221:function(e,n,t){"use strict";t.d(n,{c:function(){return I}});var i=t(22710),o=t(62230),r=t(85244),l=t(81541),a=t(99267),s=t(52322),c=t(75289),u=t(2784),d=t(36131),f=t(5632),m=t(75708),p=t(68780),h=t(88932),x=t(38876),v=t(40147),y=t(82770),b=t(13858);function g(){return(g=(0,i.Z)(function(e){var n,t,i,o,r,l,s;return(0,a.__generator)(this,function(a){switch(a.label){case 0:var c;return a.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,c=n,o={id:(0,x.T3)(c),type:"SharedSlice",name:c,description:c,variations:[{id:j,name:(0,x.MP)(j),docURL:"...",version:"initial",description:(0,x.MP)(j),imageUrl:""},]},[4,v.j.slices.createSlice({libraryID:t,model:o})];case 1:if((r=a.sent().errors).length>0)throw r;return y.Xe.track({event:"slice:created",id:(0,x.MP)(n),name:n,library:t}),[4,i(o)];case 2:return a.sent(),h.Am.success((0,b.kQ)({path:"".concat(t,"/").concat(o.name,"/model.json")})),[3,4];case 3:return l=a.sent(),s="Internal Error: Slice not created",console.error(s,l),h.Am.error(s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var j="default",S=t(90374),C=t(78656),k=t(66443),w=t(70041),L={getBuilderPagePathname:function(e){var n=e.libraryName,t=e.sliceName,i=e.variationId;return"/".concat(n.replace(/\//g,"--"),"/").concat(t,"/").concat(i)}},I=function(e){var n,t=e.onClose,h=e.localLibraries,x=e.remoteSlices,b=e.customType,j=e.tabId,I=(0,f.useRouter)(),E=(0,S.Z)(),N=E.createSliceSuccess,Z=E.saveCustomTypeSuccess,P=(0,u.useState)(!1),O=P[0],R=P[1],_=(n=(0,i.Z)(function(e){var n,t;return(0,a.__generator)(this,function(s){switch(s.label){case 0:var c;return n=e.sliceName,t=e.from,R(!0),[4,function(e){return g.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(c=(0,i.Z)(function(e){var i,s,c,u;return(0,a.__generator)(this,function(i){switch(i.label){case 0:return[4,(0,y.y0)()];case 1:if(N(i.sent().libraries),!b)return[3,3];return s=(0,r.Z)((0,o.Z)({},b),{tabs:b.tabs.map(function(n){return n.key===j&&n.sliceZone?(0,r.Z)((0,o.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:(0,l.Z)(n.sliceZone.value).concat([{key:e.id,value:e},])}}):n})}),[4,v.j.customTypes.updateCustomType({model:m.Dc.fromSM(s)})];case 2:i.sent(),Z(m.Dc.fromSM(s)),i.label=3;case 3:return c=e.variations[0].id,u=L.getBuilderPagePathname({libraryName:t,sliceName:n,variationId:c}),I.push(u),[2]}})}),function(e){return c.apply(this,arguments)})})];case 1:return s.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,s.jsx)(p.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:O,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){_(e)},initialValues:{sliceName:"",from:h[0].name},validate:function(e){return(0,k.h)(e,h,x)},content:{title:"Create a new slice"},actionMessage:b?C.$[b.format].createSliceFromTypeActionMessage:void 0,children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(w.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,s.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,s.jsx)(d.ZP,{name:"from",options:h.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,r.Z)((0,o.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,r.Z)((0,o.Z)({},e),{colors:(0,r.Z)((0,o.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return a}});var i=t(62230),o=t(52322);t(2784);var r=t(63397),l=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,s=e.error,c=e.dataCy,u=e.onChange;return(0,o.jsxs)(l.xu,{mb:3,children:[(0,o.jsx)(l.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(r.gN,(0,i.Z)({name:n,type:"text",placeholder:a,as:l.II,autoComplete:"off"},u?{onChange:u}:null,c?{"data-cy":c}:null)),s?(0,o.jsx)(l.xv,{"data-cy":c?"".concat(c,"-error"):"input-error",sx:{color:"error",mt:1},children:s}):null]})}},68780:function(e,n,t){"use strict";var i=t(62230),o=t(85244),r=t(52322),l=t(37149),a=t.n(l),s=t(25812),c=t(63397),u=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,l=e.isOpen,m=e.formId,p=e.validate,h=e.onSubmit,x=e.widthInPx,v=e.initialValues,y=e.content.title,b=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,S=e.isLoading,C=void 0!==S&&S,k=e.buttonLabel,w=void 0===k?"Save":k,L=e.dataCy,I=e.actionMessage;return a().setAppElement("#__next"),(0,r.jsx)(s.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=x?x:"900px"}},children:(0,r.jsx)(c.J9,{validateOnChange:!0,initialValues:v,validate:function(e){return p?p(e):void 0},onSubmit:function(e){h(e)},children:function(e){var l=e.isValid,a=e.isSubmitting,s=e.values,p=e.errors,h=e.touched,x=e.setFieldValue,v=e.setValues;return(0,r.jsx)(c.l0,(0,o.Z)((0,i.Z)({id:m},null!=L?{"data-cy":L}:null),{children:(0,r.jsx)(f.Z,(0,o.Z)((0,i.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},b),{Header:function(e){var n=e.radius;return(0,r.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,r.jsx)(u.X6,{sx:{fontSize:"20px"},children:y}),(0,r.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,r.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,r.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof I?I(e):I}),(0,r.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,r.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||C,children:"Cancel"}),(0,r.jsx)(d.z,{label:w,form:m,type:"submit",disabled:!l||a||C,isLoading:a||C,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:l,isSubmitting:a,values:s,errors:p,touched:h,setFieldValue:x,setValues:v})}))}))}})})}},12472:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return W}});var i=t(81541),o=t(52322),r=t(10873),l=t(2784),a=t(97729),s=t.n(a),c=t(65077),u=t(75289),d=t(56580),f=t(4108),m=t(75329),p=t(32038),h=t(44221),x=t(59469),v=t(36887),y=t(82770),b=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,r=e.documentationComponent,l=e.videoPublicIdUrl;return(0,o.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},children:[(0,o.jsx)(u.xu,{sx:function(e){var n;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:(0,o.jsx)(v.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){y.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,o.jsxs)(u.xu,{sx:function(e){var n;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,o.jsxs)(u.xu,{sx:function(e){var n;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:[(0,o.jsx)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,o.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:r})]}),(0,o.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,o.jsx)(u.zx,{onClick:t,"data-cy":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:i}),(0,o.jsx)(u.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"})]})]})]})},g=t(84449),j=t(90374),S=t(68780),C=t(70041),k=t(77174),w=t(24340),L=t(75992),I=t(66443),E=function(e){var n=e.sliceName,t=e.sliceId,i=e.libName,r=(0,j.Z)(),l=r.renameSlice,a=r.closeModals,s=(0,d.v9)(function(e){return{isRenameSliceModalOpen:(0,k.gP)(e,w.q.RENAME_SLICE),localLibs:(0,L.Sd)(e),remoteLibs:(0,L.sT)(e)}}),c=s.isRenameSliceModalOpen,f=s.localLibs,m=s.remoteLibs,p=function(e){l(i,t,e.sliceName)};return(0,o.jsx)(S.Z,{dataCy:"rename-slice-modal",isOpen:c,widthInPx:"530px",formId:"rename-slice-modal-".concat(t),close:a,buttonLabel:"Rename",onSubmit:p,initialValues:{sliceName:n},content:{title:"Rename a slice"},validate:function(e){return(0,I.h)(e,f,m)},children:function(e){var n=e.touched,t=e.errors;return(0,o.jsx)(u.xu,{children:(0,o.jsx)(C.W,{name:"sliceName",label:"Slice Name","data-cy":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?t.sliceName:void 0,dataCy:"slice-name-input"})})}})},N=t(25812),Z=t(59326),P=t(54132),O=t(65186),R=t(56577),_=t(3098),M=t(32665),T=function(e){var n=e.sliceId,t=e.sliceName,i=e.libName,r=(0,d.v9)(function(e){return{isSliceModalOpen:(0,k.gP)(e,w.q.DELETE_SLICE),isDeletingSlice:(0,M.hg)(e,_.z.DELETE_SLICE)}}),l=r.isSliceModalOpen,a=r.isDeletingSlice,s=(0,j.Z)(),c=s.closeModals,f=s.deleteSlice,m=(0,Z.B7)().theme;return(0,o.jsx)(N.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:c,children:(0,o.jsx)(P.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:function(){var e;return(0,o.jsxs)(u.kC,{sx:{position:"sticky",background:"gray",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,o.jsx)(O.$vK,{size:20,color:null===(e=m.colors)||void 0===e?void 0:e.greyIcon}),(0,o.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,o.jsx)(u.x8,{type:"button",onClick:c})]})},Footer:function(){return(0,o.jsxs)(u.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,o.jsx)(R.z,{label:"Cancel",variant:"secondary",onClick:function(){return c()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,o.jsx)(R.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:function(){return f(n,t,i)}})]})},children:(0,o.jsxs)(u.nv,{children:["This action will immediately make the following changes:",(0,o.jsxs)("ul",{children:[(0,o.jsxs)("li",{children:["Delete the"," ",(0,o.jsxs)(u.xv,{sx:{fontWeight:"bold"},children:[i,"/",t,"/"]})," ","directory."]}),(0,o.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,o.jsx)("ul",{children:(0,o.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."]})})})},D=t(71685),A=t(47731),W=function(){var e,n,t,a,v,y,S=(0,j.Z)(),C=S.openRenameSliceModal,k=S.openDeleteSliceModal,w=(0,A.H)(),I=w.modalPayload,N=w.onOpenModal,Z=I.sliceFilterFn,P=I.defaultVariationSelector,O=(0,d.v9)(function(e){return{remoteSlices:(0,L.sT)(e),libraries:(0,L.Sd)(e),frontendSlices:(0,L.xC)(e)}}),R=O.remoteSlices,_=O.libraries,M=O.frontendSlices,W=(0,l.useState)(!1),F=W[0],z=W[1],K=_.filter(function(e){return e.isLocal}),V=_.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),B=(0,D.J)({slices:M}),H=B.modelsStatuses,X=B.authStatus,q=B.isOnline,U=(_||[]).map(function(e){return e.components}).flat(),J=U.length,$=(0,l.useState)(),G=$[0],Q=$[1];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s(),{children:(0,o.jsx)("title",{children:"Slices - Slice Machine"})}),(0,o.jsxs)(p.LN,{children:[(0,o.jsxs)(p.wd,{children:[(0,o.jsx)(p.Cx,{folder:"Slices"}),(null==K?void 0:K.length)!==0&&0!==J?(0,o.jsx)(p.K2,{children:(0,o.jsx)(r.zx,{"data-cy":"create-slice",onClick:function(){z(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,o.jsxs)(p.RN,{children:[(0,o.jsx)(c.xR,{sx:{display:"flex",flexDirection:"column"},children:V.length>0?(0,o.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===J?(0,o.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,o.jsx)(b,{title:"What are Slices?",onCreateNew:function(){z(!0)},buttonText:"Create one",videoPublicIdUrl:m.rd,documentationComponent:(0,o.jsxs)(o.Fragment,{children:['Slices are sections of your website. Prismic documents contain a dynamic "Slice Zone" that allows content creators to add, edit, and rearrange Slices to compose dynamic layouts for any page design.'," ",(0,o.jsx)(u.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:function(e){var n;return{color:null==e?void 0:null===(n=e.colors)||void 0===n?void 0:n.primary}},children:"Learn more"}),"."]})})}):V.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,o.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,o.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,o.jsx)(u.xv,{children:n})}),!t&&(0,o.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,o.jsx)(x.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return f.M.Render({slice:e,StatusOrCustom:{status:H.slices[e.model.id],authStatus:X,isOnline:q},actions:{onUpdateScreenshot:function(n){n.preventDefault(),N({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},openRenameModal:function(e){Q(e),C()},openDeleteModal:function(e){Q(e),k()}},showActions:!0})},gridGap:"32px 16px"})]},n)})}):void 0}),(null==K?void 0:K.length)>0&&(0,o.jsx)(g.Z,{slices:Z(U),defaultVariationSelector:P}),(null==K?void 0:K.length)>0&&F&&(0,o.jsx)(h.c,{localLibraries:K,remoteSlices:R,onClose:function(){z(!1)}}),(0,o.jsx)(E,{sliceId:null!==(e=null==G?void 0:G.model.id)&&void 0!==e?e:"",sliceName:null!==(n=null==G?void 0:G.model.name)&&void 0!==n?n:"",libName:null!==(t=null==G?void 0:G.from)&&void 0!==t?t:"","data-cy":"rename-slice-modal"}),(0,o.jsx)(T,{sliceId:null!==(a=null==G?void 0:G.model.id)&&void 0!==a?a:"",sliceName:null!==(v=null==G?void 0:G.model.name)&&void 0!==v?v:"",libName:null!==(y=null==G?void 0:G.from)&&void 0!==y?y:""})]})]})]})}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return g}});var i=t(2784);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}t(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 a(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,n){return void 0===n&&(n=","),e.split(n)}function c(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return a(e)});return o({},{alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod")},{keys:l.filter(function(e){return!r.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([a(e.key),a(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var n;return!r.includes(e)&&u.delete(e.toLowerCase())}),n.forEach(function(e){return u.add(e.toLowerCase())})}function m(e){var n=Array.isArray(e)?e:[e];"meta"===e?u.clear():n.forEach(function(e){return u.delete(e.toLowerCase())})}function p(e,n){var t=e.target;void 0===n&&(n=!1);var i=t&&t.tagName;return d(n)?Boolean(i&&n&&n.some(function(e){return e.toLowerCase()===i.toLowerCase()})):Boolean(i&&n&&!0===n)}var h=function(e,n,t){void 0===t&&(t=!1);var i,o,r=n.alt,l=n.meta,s=n.mod,c=n.shift,f=n.ctrl,m=n.keys,p=e.key,h=e.code,x=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=a(h),j=p.toLowerCase();if(!t){if(!b===r&&"alt"!==j||!y===c&&"shift"!==j)return!1;if(s){if(!v&&!x)return!1}else if(!v===l&&"meta"!==j&&"os"!==j||!x===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(g)))||(m?(void 0===o&&(o=","),(d(i=m)?i:i.split(o)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},x=(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()},b="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function g(e,n,t,o){var r,l,u=(0,i.useRef)(null),g=(0,i.useRef)(!1),j=t instanceof Array?o instanceof Array?void 0:o:t,S=d(e)?e.join(null==j?void 0:j.splitKey):e,C=t instanceof Array?t:o instanceof Array?o:void 0,k=(0,i.useCallback)(n,null!=C?C:[]),w=(0,i.useRef)(k);C?w.current=k:w.current=n;var L=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(i,o){return i&&e(n[o],t[o])},!0):n===t}((l=(0,i.useRef)(void 0)).current,j)&&(l.current=j),l.current),I=(0,i.useContext)(v).enabledScopes,E=(0,i.useContext)(x);return b(function(){if((null==L?void 0:L.enabled)!==!1&&(e=I,n=null==L?void 0:L.scopes,0===e.length&&n?(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):!!(!n||e.some(function(e){return n.includes(e)})||e.includes("*")))){var e,n,t=function(e,n){var t,i;if(void 0===n&&(n=!1),!(p(e,["input","textarea","select"])&&!p(e,null==L?void 0:L.enableOnFormTags)||null!=L&&null!=L.ignoreEventWhen&&L.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){y(e);return}(null==(t=e.target)||!t.isContentEditable||null!=L&&L.enableOnContentEditable)&&s(S,null==L?void 0:L.splitKey).forEach(function(t){var i,o,r,l,a,s,u,d=c(t,null==L?void 0:L.combinationKey);if(h(e,d,null==L?void 0:L.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,o=d,("function"==typeof(r=null==L?void 0:L.preventDefault)&&r(i,o)||!0===r)&&i.preventDefault(),l=e,a=d,"function"==typeof(s=null==L?void 0:L.enabled)?!s(l,a):!0!==s&&void 0!==s){y(e);return}w.current(e,d),n||(g.current=!0)}})}},i=function(e){void 0!==e.key&&(f(a(e.code)),((null==L?void 0:L.keydown)===void 0&&(null==L?void 0:L.keyup)!==!0||null!=L&&L.keydown)&&t(e))},o=function(e){void 0!==e.key&&(m(a(e.code)),g.current=!1,null!=L&&L.keyup&&t(e,!0))},r=u.current||(null==j?void 0:j.document)||document;return r.addEventListener("keyup",o),r.addEventListener("keydown",i),E&&s(S,null==L?void 0:L.splitKey).forEach(function(e){return E.addHotkey(c(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))}),function(){r.removeEventListener("keyup",o),r.removeEventListener("keydown",i),E&&s(S,null==L?void 0:L.splitKey).forEach(function(e){return E.removeHotkey(c(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))})}}},[S,L,I]),u}}},function(e){e.O(0,[789,909,934,4,80,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
|
File without changes
|