slice-machine-ui 1.15.1-dev-next-release.1 → 1.15.1-dev-next-release.3
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 +16 -25
- package/components/CustomTypeTable/changesPage.tsx +4 -6
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +3 -0
- package/lib/builders/CustomTypeBuilder/SliceZone/List.tsx +26 -32
- package/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +1 -0
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -0
- package/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +23 -76
- package/next.config.mjs +1 -0
- 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/14-90eaa126dcf1b635.js +1 -0
- package/out/_next/static/chunks/{377-3caacee3c3ffdc25.js → 377-467ca51a57342a23.js} +1 -1
- package/out/_next/static/chunks/{573-e92018662d1f6c26.js → 573-8678a91b09707f5d.js} +1 -1
- package/out/_next/static/chunks/590-d9046f10fcc34a4d.js +1 -0
- package/out/_next/static/chunks/840-d84a2655185995ce.js +1 -0
- package/out/_next/static/chunks/{97-f6188ebe22eb21da.js → 97-ee2fa6c3e6bf7b71.js} +1 -1
- package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]/{simulator-c608e0470a8f6099.js → simulator-47ba090193469e3f.js} +1 -1
- package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]-89838e684fcaaf5d.js +1 -0
- package/out/_next/static/chunks/pages/{_app-50e4bd906b82c68e.js → _app-f7e14ddd3e363991.js} +9 -9
- package/out/_next/static/chunks/pages/changes-c62c4ac5de9a1a09.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-9ba8a3f68a048222.js → [customTypeId]-1baa6af0ddf0ab6b.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types-78e57821222c9603.js +1 -0
- package/out/_next/static/chunks/pages/index-d3da65c8b508c26e.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-3144fdf0c6f9af94.js → [pageTypeId]-708b782db680b804.js} +1 -1
- package/out/_next/static/chunks/pages/slices-15b69ac3611efbfe.js +1 -0
- package/out/_next/static/css/22d69420bda374a7.css +1 -0
- package/out/_next/static/css/{b6bfe1e0ef76c2b1.css → 9ddd0cb7fff63603.css} +1 -1
- package/out/_next/static/css/f585032018f6024b.css +1 -0
- package/out/_next/static/pA_sw-x2_QsAanOp1Lx0c/_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 +4 -4
- package/pages/_app.tsx +37 -5
- package/pages/index.tsx +8 -0
- package/pages/slices.tsx +25 -42
- package/src/domain/slice.ts +38 -0
- package/src/features/changes/StatusBadge.tsx +107 -0
- package/src/features/customTypes/PageTypeOnboarding.tsx +60 -0
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +2 -2
- package/src/features/slices/sliceCards/NonSharedSliceViewCard.tsx +39 -0
- package/src/features/slices/sliceCards/SharedSliceSelectionCard.tsx +80 -0
- package/src/features/slices/sliceCards/SharedSliceViewCard.tsx +147 -0
- package/src/hooks/useIsEmptyProject.ts +24 -0
- package/src/icons/BlankPageIcon.tsx +58 -0
- package/src/icons/SliceMachinePrinterIcon.tsx +69 -0
- package/src/modules/pushChangesSaga/trackPushChangesSuccess.ts +1 -1
- package/test/components/CreateCustomTypeModal.test.tsx +1 -0
- package/test/pages/custom-types.test.tsx +1 -1
- package/test/pages/slices.test.tsx +2 -2
- package/components/KebabMenuDropdown/KebabMenuList.tsx +0 -71
- package/components/KebabMenuDropdown/index.tsx +0 -64
- package/components/StatusBadge/index.tsx +0 -139
- package/lib/models/ui/Link.ts +0 -23
- package/lib/models/ui/Slice/LegacySliceTooltip.module.css +0 -10
- package/lib/models/ui/Slice/index.tsx +0 -424
- package/lib/models/ui/Slice/wrappers.tsx +0 -49
- package/lib/models/ui/Store.ts +0 -10
- package/out/_next/static/chunks/323-9843d325f7ff6913.js +0 -1
- package/out/_next/static/chunks/482-93d7a0d3a0353f59.js +0 -1
- package/out/_next/static/chunks/906-9224feb63b5e36f3.js +0 -1
- package/out/_next/static/chunks/pages/[lib]/[sliceName]/[variation]-36ba0bde8415ad8b.js +0 -1
- package/out/_next/static/chunks/pages/changes-8338c9d0723a7033.js +0 -1
- package/out/_next/static/chunks/pages/custom-types-abb8c8c92880120e.js +0 -1
- package/out/_next/static/chunks/pages/index-f382c8090bd21628.js +0 -1
- package/out/_next/static/chunks/pages/slices-afa4b34df8f8e1c3.js +0 -1
- package/out/_next/static/css/6b6c11ed1fffd3e0.css +0 -1
- package/out/_next/static/css/e855bef88bb5345b.css +0 -1
- package/out/_next/static/l5qzy_xQjzd7ei5tL_M1r/_buildManifest.js +0 -1
- package/src/icons/LightningIcon3D.tsx +0 -49
- package/src/models/ApiError.ts +0 -6
- package/src/models/SyncError.ts +0 -3
- package/src/utils/screenshots/missing.ts +0 -4
- package/test/src/utils/screenshots/missing.test.ts +0 -51
- /package/out/_next/static/{l5qzy_xQjzd7ei5tL_M1r → pA_sw-x2_QsAanOp1Lx0c}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[759],{45662:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[lib]/[sliceName]/[variation]",function(){return t(18363)}])},61931:function(e,n,t){"use strict";t.d(n,{q:function(){return u}});var i=t(62230),r=t(52322),o=t(2784),a=t(75289),l=t(65186),s=(0,o.memo)(function(e){var n=e.src;return(0,r.jsx)(a.Ee,{src:n,alt:"Preview image",sx:{maxHeight:"100%"}})}),u=function(e){var n=e.hideMissingWarning,t=e.src,o=e.sx;return(0,r.jsx)(a.kC,{sx:(0,i.Z)({position:"relative",alignItems:"center",justifyContent:"center",overflow:"hidden",backgroundImage:"url(/pattern.png)",backgroundColor:"headSection",backgroundRepeat:"repeat",backgroundSize:"20px",borderRadius:"4px"},o),children:void 0!==n&&n?null:(0,r.jsx)(r.Fragment,{children:void 0!==t?(0,r.jsx)(s,{src:t}):(0,r.jsxs)(a.xv,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(l.eJU,{}),"You have no screenshot yet."]})})})}},38986:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var i=t(62230),r=t(52322),o=t(2784),a=t(19909),l=t(75289),s=function(e){var n=e.defaultValue,t=e.variations,i=e.MenuItemAction,o=e.onChange;return(0,r.jsxs)(l.xu,{sx:{py:0,flexDirection:"column",backgroundColor:"headSection",overflow:"auto",display:"flex",borderRadius:"4px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},boxShadow:"0 10px 10px rgba(0, 0, 0, 0.05)",maxHeight:340,minWidth:250,maxWidth:350,color:"text"},children:[(0,r.jsxs)(l.xv,{sx:{p:3,fontSize:12,color:"textClear"},children:[t.length," VARIATION",t.length>1?"S":""]}),(0,r.jsxs)(l.kC,{sx:{p:0,flexDirection:"column"},children:[t.map(function(e){return(0,r.jsx)(u,{value:e,isActive:e.id===n.id,onClick:o},e.id)}),i||null]})]})},u=function(e){var n=e.value,t=e.isActive,i=e.onClick;return(0,r.jsx)(l.xu,{sx:{px:3,py:2,color:t?"primary":"",cursor:"pointer",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(t?null==n?void 0:n.primary:null==n?void 0:n.background)},borderRadius:0,bg:"background",":hover":{bg:"hoverBackground",borderLeft:function(e){var n=e.colors;return"2px solid ".concat(null==n?void 0:n.primary)}}},onClick:function(){return i(n)},children:n.name})},c=t(75100),d=function(e){var n=e.buttonSx,t=e.defaultValue,u=e.variations,d=e.onNewVariation,f=e.onChange,p=e.sx,v=e.disabled,x=(0,o.useState)(!1),h=x[0],m=x[1],b=(0,o.useState)(t||u[0]),g=b[0],y=b[1];(0,o.useEffect)(function(){t&&y(t)},[t]);var j=function(e){m(!1),y(e),setTimeout(function(){return f(e)},210)},S=(0,r.jsx)(l.xu,{sx:{p:2},children:(0,r.jsx)(l.zx,{variant:"transparent",sx:{color:"text"},onClick:function(){m(!1),d&&d()},children:"+ Add new variation"})});return(0,r.jsx)(l.xu,{sx:p,children:(0,r.jsx)(a.Popover,{align:"start",isOpen:h,onClickOutside:function(){return m(!1)},positions:["bottom"],padding:10,content:function(){return(0,r.jsx)(s,{defaultValue:g,variations:u,onChange:j,MenuItemAction:d?S:void 0})},containerClassName:"variationSelectorContainer",children:(0,r.jsxs)(l.zx,{sx:(0,i.Z)({},n),variant:"dropDownButton",onClick:function(){return m(!h)},disabled:v,children:[g.name," ",h?(0,r.jsx)(c.bOz,{size:"16px","aria-label":"Collapse variations"}):(0,r.jsx)(c.mEq,{size:"16px","aria-label":"Expand variations"})]})})})}},25474:function(e,n,t){"use strict";function i(e){var n=e.lib,t=e.sliceName,i=e.variationId,r=e.options,o=void 0===r?{}:r,a=e.isSimulator,l="/[lib]/[sliceName]/[variation]".concat(a?"/simulator":""),s="/".concat(n,"/").concat(t,"/").concat(i).concat(a?"/simulator":"");return{href:l,as:s,options:o,all:[l,s,o]}}t.d(n,{P:function(){return i}})},18363:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eS}});var i=t(52322),r=t(97729),o=t.n(r),a=t(62230),l=t(71651),s=t(2784),u=t(57282),c=t(65077),d=t(75289),f=t(47560),p=t(38876),v=t(96377),x=t(4092),h=t(2353),m=t(44384),b=t(90374),g=t(53559),y=function(e){var n=e.variation,t=(0,b.Z)(),r=t.addSliceWidget,o=t.replaceSliceWidget,a=t.reorderSliceWidget,l=t.removeSliceWidget,s=t.updateSliceWidgetMock,u=t.deleteSliceWidgetMock,c=function(e){return function(t){u(n.id,e,t),l(n.id,e,t)}},y=function(e){return function(t){var i=t.apiId,r=t.newKey,a=t.value,l=t.mockValue;l?s(n.id,e,i,r,l):u(n.id,e,r),o(n.id,e,i,r,a)}},j=function(e){return function(t){var i=t.id,o=t.label,a=t.widgetTypeName,l=h[a];l||console.log('Could not find widget with type name "'.concat(a,'". Please contact us!')),r(n.id,e,i,l.create(o))}},S=function(e){return function(t){var i,r;(0,f.uS)(t)||a(n.id,e,t.source.index,null!==(r=null===(i=t.destination)||void 0===i?void 0:i.index)&&void 0!==r?r:void 0)}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.Z,{zoneType:"slice",tabId:void 0,title:"Non-Repeatable Zone",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:n.primary,EditModal:x.Z,widgetsArray:m.Z,onDeleteItem:c(g.Rt.Primary),onSave:y(g.Rt.Primary),onSaveNewField:j(g.Rt.Primary),onDragEnd:S(g.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,p.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,p.Ti)(e))},dataCy:"slice-non-repeatable-zone",isRepeatableCustomType:void 0}),(0,i.jsx)(d.xu,{mt:4}),(0,i.jsx)(v.Z,{zoneType:"slice",tabId:void 0,isRepeatable:!0,title:"Repeatable Zone",dataTip:"The repeatable zone is for a group<br/>\n of fields that you want to be able to repeat an<br/>\n indeterminate number of times, like FAQs",widgetsArray:m.Z,fields:n.items,EditModal:x.Z,onDeleteItem:c(g.Rt.Items),onSave:y(g.Rt.Items),onSaveNewField:j(g.Rt.Items),onDragEnd:S(g.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,p.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,p.Ti)(e))},dataCy:"slice-repeatable-zone",isRepeatableCustomType:void 0})]})},j=t(54132),S=t(39295),k=t(61931),C=t(84449),w=t(47731),T=t(56577),Z=t(951),R=t(33710),E=function(){return(0,i.jsx)(S.X,{children:(0,i.jsx)(R.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"update-screenshot-button-tooltip",children:"Save your work in order to update the screenshot"})})},I=function(e){var n,t=e.component,r=e.variation,o=e.isTouched,a=t.screenshots,l=(0,w.H)().openScreenshotsModal;return(0,i.jsxs)(d.xu,{children:[(0,i.jsx)(j.Z,{bg:"headSection",bodySx:{p:0},Footer:function(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.kC,{"data-tip":!0,"data-tip-disable":!1,"data-for":"update-screenshot-button-tooltip",sx:{width:"fit-content"},children:(0,i.jsx)(T.z,{onClick:l,variant:"secondarySmall",sx:{fontWeight:"bold"},Icon:Z.rJU,iconFill:"#1A1523",label:"Update screenshot",disabled:o})}),o&&(0,i.jsx)(E,{})]})},footerSx:{padding:2},sx:{overflow:"hidden"},children:(0,i.jsx)(k.q,{src:null===(n=a[r.id])||void 0===n?void 0:n.url,sx:{height:"198px",borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},borderRadius:"4px 4px 0 0"}})}),(0,i.jsx)(C.Z,{slices:[t],defaultVariationSelector:{sliceID:t.model.id,variationID:r.id}})]})},L=t(81541),A=t(22710),F=t(85244),N=t(99267),z=t(55658),O=t(63397),V=t(25812),P=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,l=e.sx,s=e.headerSx,u=void 0===s?{}:s;return(0,i.jsx)(j.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,a.Z)({border:"none"},void 0===l?{}:l),Header:function(e){var n=e.radius;return(0,i.jsxs)(d.kC,{sx:(0,a.Z)({p:3,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)}},u),children:[r,o?(0,i.jsx)(d.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(d.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(d.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},_=t(36131),M=function(e){var n=e.msg;return(0,i.jsx)(d.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},D=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,l=e.variations,u=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=l.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,s=t&&t.length?null:{name:"Required!"},u=i.value.length&&l.find(function(e){return e.id===i.value})?null:{id:"Yuu must select an existing variation!"},c=n&&n.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(n)&&{id:"No special characters allowed"};return(0,a.Z)({},r,o,s,u,c)},c=function(e){j(z.e.generateId(e))},f=function(e){Z(e),k&&c(e)},p=function(e){C(!1),c(e)},v=function(){x(),t()},x=function(){j(""),Z(""),b({}),C(!0),I({value:o.id,label:o.name})},h=(0,s.useState)({}),m=h[0],b=h[1],g=(0,s.useState)(""),y=g[0],j=g[1],S=(0,s.useState)(!0),k=S[0],C=S[1],w=(0,s.useState)(""),T=w[0],Z=w[1],R=(0,s.useState)({value:o.id,label:o.name}),E=R[0],I=R[1];function L(){return D.apply(this,arguments)}function D(){return(D=(0,A.Z)(function(){var e,n;return(0,N.__generator)(this,function(t){return Object.keys(e=u({id:y,name:T,origin:E})).length?b(e):(n=l.find(function(e){return e.id===E.value}))&&(r(y,T,n),v()),[2]})})).apply(this,arguments)}return(0,s.useEffect)(function(){x()},[o,n]),(0,i.jsx)(V.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return v()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(O.J9,{initialValues:{id:y,name:T,origin:E},onSubmit:L,children:(0,i.jsx)(O.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),L())},children:(0,i.jsx)(d.xu,{children:(0,i.jsxs)(P,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(d.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(d.kC,{sx:{justifyContent:"flex-end"},children:[(0,i.jsx)(d.zx,{onClick:v,mr:2,variant:"secondary",children:"Cancel"}),(0,i.jsx)(d.zx,{type:"submit",children:"Submit"})]}),close:v,children:[(0,i.jsxs)(d.xu,{sx:{pb:4,mt:4},children:[(0,i.jsxs)(d.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",m.name?(0,i.jsx)(M,{msg:m.name}):""]}),(0,i.jsx)(O.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:d.II,maxLength:30,value:T,onChange:function(e){return f(e.currentTarget.value)}}),(0,i.jsx)(d.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(d.xu,{sx:{pb:4},children:[(0,i.jsxs)(d.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",m.id?(0,i.jsx)(M,{msg:m.id}):""]}),(0,i.jsx)(O.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:d.II,maxLength:30,value:y,onChange:function(e){return p(e.currentTarget.value)}}),(0,i.jsx)(d.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(d.xu,{sx:{pb:4},children:[(0,i.jsx)(d.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(_.ZP,{name:"origin",options:l.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&I(e)},defaultValue:E,maxMenuHeight:150,theme:function(e){return(0,F.Z)((0,a.Z)({},e),{colors:(0,F.Z)((0,a.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},W=t(5632),H=t(25474),q=t(38986),K=function(e){var n,t=e.component,r=e.variation,o=(0,W.useRouter)(),a=(0,s.useState)(!1),l=a[0],u=a[1],c=(0,b.Z)().copyVariationSlice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.kC,{children:[(0,i.jsx)(q.Z,{defaultValue:r,variations:t.model.variations,onNewVariation:function(){return u(!0)},onChange:function(e){(n=o).push.apply(n,(0,L.Z)(H.P({lib:t.href,sliceName:t.model.name,variationId:e.id}).all))}}),(0,i.jsx)(d.xu,{ml:2,children:(0,i.jsxs)(d.xv,{variant:"xs",children:["Variation id : ",r.id]})})]}),(0,i.jsx)(D,{isOpen:l,onClose:function(){return u(!1)},onSubmit:function(e,n,i){c(e,n,i),o.push.apply(o,(0,L.Z)(H.P({lib:t.href,sliceName:t.model.name,variationId:e}).all))},initialVariation:r,variations:t.model.variations})]})},B=t(56580),J=t(25251),X=t(75329),G=t(42189),U=t(17036),Q=t(82770),Y=t(18125),$=function(){return(0,i.jsx)(S.X,{children:(0,i.jsxs)(R.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:[(0,i.jsx)(d.xv,{as:"b",children:"Framework not supported"}),(0,i.jsx)(d.xv,{as:"p",children:"Slice Simulator does not support your framework yet."})]})})},ee=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)(Y.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)(Y.Ev,{children:"Simulate your slices"}),(0,i.jsx)(Y.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:X.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){Q.Xe.track({event:"open-video-tutorials",video:X.Sn})}}),(0,i.jsx)(Y.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(Y.Rp,{children:"Got It"})]})},en=function(){return(0,i.jsx)(S.X,{children:(0,i.jsx)(R.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:"Save your work in order to simulate"})})},et=function(e){var n=e.isSimulatorAvailableForFramework,t=e.isTouched,r=(0,W.useRouter)(),o=(0,s.useRef)(null),a=(0,b.Z)().setSeenSimulatorToolTip,u=(0,B.v9)(function(e){return{hasSeenSimulatorTooltip:(0,U.bv)(e),hasSeenTutorialsToolTip:(0,U.ER)(e)}}),c=u.hasSeenSimulatorTooltip,d=u.hasSeenTutorialsToolTip;(0,s.useEffect)(function(){var e=o.current;e&&n&&!c&&d&&setTimeout(function(){return R.Z.show(e)},5e3)},[n,c,d,]);var f=function(){if(a(),o.current){var e=o.current;R.Z.hide(e)}},p=n&&!c&&d;return(0,i.jsxs)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:[(0,i.jsx)(ee,{open:p,onClose:f,children:(0,i.jsx)(l.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){f(),window.open("".concat(r.asPath,"/simulator"),X.pq)},disabled:!n||t,renderStartIcon:function(){return(0,i.jsx)(G.z,{color:l.TV.color.greyLight11,height:l.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:l.TV.size[24]})},variant:"secondary",children:"Simulate"})}),!1===n?(0,i.jsx)($,{}):n&&!1===p&&t?(0,i.jsx)(en,{}):null]})},ei=t(17329),er=t(40147);function eo(e){return ea.apply(this,arguments)}function ea(){return(ea=(0,A.Z)(function(e){var n,t,i;return(0,N.__generator)(this,function(r){switch(r.label){case 0:return[4,er.j.customTypes.readCustomType({id:e})];case 1:if(t=(n=r.sent()).errors,i=n.model,t.length>0)throw t;return[2,i]}})})).apply(this,arguments)}var el=t(67445),es=t(64722),eu=t(20812),ec=function(e){return(0,i.jsxs)("svg",(0,F.Z)((0,a.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M9.5 12L6 9.5L9.5 7V9.5V12Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M6 9.5H11C14.3 9.5 17 12.2 17 15.5V17.5M6 9.5L9.5 12V9.5V7L6 9.5Z",stroke:"currentColor",strokeLinecap:"round"})]}))},ed=function(){var e,n,t=(e=(0,es.l)().source,n=(0,el.Ag)(e.query),void 0!==n&&(0,el.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(l.SV,{children:(0,i.jsx)(s.Suspense,{children:(0,i.jsx)(l.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(ef,{sourceCustomTypeId:t})})})}):null},ef=function(e){var n,t=(n=e.sourceCustomTypeId,(0,ei.QT)(eo,[n])),r=(0,s.useState)(!0),o=r[0],a=r[1],u=(0,W.useRouter)();if(void 0===t||!o)return null;var c=t.format,d=t.id,f=el.cd[c].getBuilderPagePathname(d);return(0,i.jsxs)(l.hE,{density:"compact",variant:"tertiary",children:[(0,i.jsxs)(l.zx,{onClick:function(){u.push(f)},renderStartIcon:function(){return(0,i.jsx)(ec,{})},children:["Return to ",t.label]}),(0,i.jsx)(l.zx,{onClick:function(){a(!1)},renderStartIcon:function(){return(0,i.jsx)(eu.T,{})}})]})},ep=t(39092),ev=t(92521),ex=t(75992),eh=t(71685),em={imageLoading:!1,loading:!1,done:!1,error:null,status:null},eb=function(e){var n=e.slice,t=e.variation,r=(0,b.Z)(),o=r.openToaster,a=r.updateSlice,l=(0,B.v9)(function(e){return{isTouched:(0,ev.sY)(e,n.from,n.model.id),remoteSlice:(0,ex.O_)(e,n.model.id)}}),c=l.isTouched,d=l.remoteSlice,f=(0,s.useState)(em),p=f[0],v=f[1];return((0,s.useEffect)(function(){c&&v(em)},[c]),(0,s.useEffect)(function(){if(p.done){var e,n;n=p,n.done&&o(n.message,n.error?u.Jf.ERROR:n.warning?u.Jf.WARNING:u.Jf.SUCCESS)}},[p]),t)?(0,i.jsx)(eg,{updateSlice:a.bind(null,n,v),slice:n,variation:t,remoteSlice:d,isTouched:c,data:p}):(0,i.jsx)(J.LN,{})},eg=function(e){var n=e.updateSlice,t=e.slice,r=e.variation,o=e.remoteSlice,s=e.isTouched,u=e.data,f=(0,B.v9)(function(e){return{isSimulatorAvailableForFramework:(0,ep.Ql)(e)}}).isSimulatorAvailableForFramework,p=(0,a.Z)({local:t.model,localScreenshots:t.screenshots},o?{remote:o}:{}),v=(0,eh.J)({slices:[p]}).modelsStatuses;return(0,i.jsxs)(J.LN,{children:[(0,i.jsxs)(J.wd,{children:[(0,i.jsx)(J.Xq,{url:"/slices"}),(0,i.jsx)(J.Cx,{folder:"Slices",page:t.model.name}),(0,i.jsxs)(J.K2,{children:[(0,i.jsx)(et,{isSimulatorAvailableForFramework:f,isTouched:!!s}),(0,i.jsx)(l.zx,{loading:u.loading,disabled:!s||u.loading,onClick:n,"data-cy":"builder-save-button",children:"Save"})]})]}),(0,i.jsxs)(J.RN,{children:[(0,i.jsxs)(c.xR,{children:[(0,i.jsx)(K,{component:t,status:v.slices[t.model.id],variation:r,imageLoading:u.imageLoading}),(0,i.jsxs)(d.rj,{columns:"1fr 320px",gap:"16px",sx:{pt:4},children:[(0,i.jsx)(d.xu,{children:(0,i.jsx)(y,{variation:r})}),(0,i.jsx)(I,{component:t,variation:r,isTouched:s})]})]}),(0,i.jsx)(ed,{})]})]})},ey=t(28684),ej=(0,t(57880).y)(eb);function eS(){var e=(0,ey.Z)().slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:e?(0,i.jsxs)("title",{children:[e.model.name," - Slice Machine"]}):null}),(0,i.jsx)(ej,{})]})}},28684:function(e,n,t){"use strict";var i=t(92521),r=t(90374),o=t(5632),a=t(2784),l=t(56580),s=function(){var e=(0,o.useRouter)(),n=(0,r.Z)().initSliceStore,t=(0,l.v9)(function(n){return{slice:(0,i.tL)(n,e.query.lib,e.query.sliceName)}}).slice;if((0,a.useEffect)(function(){t?n(t):e.replace("/")},[n,t,e]),!t)return{};var s=t.model.variations.find(function(n){return n.id===e.query.variation});return s?{slice:t,variation:s}:(e.replace("/"),{})};n.Z=s},57880:function(e,n,t){"use strict";t.d(n,{y:function(){return l}});var i=t(62230),r=t(52322);t(2784);var o=t(28684),a=t(95583),l=function(e){return function(n){var t=n.pageProps,l=(0,o.Z)(),s=l.slice,u=l.variation;return s&&u?(0,r.jsx)(e,(0,i.Z)({slice:s,variation:u},t)):((0,a.gx)("/"),null)}}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return y}});var i=t(2784);function r(){return(r=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 o=["shift","alt","meta","mod","ctrl"],a={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 l(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,n){return void 0===n&&(n=","),e.split(n)}function u(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return l(e)});return r({},{alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod")},{keys:a.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&p([l(e.key),l(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){c.clear()});var c=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];c.has("meta")&&c.forEach(function(e){var n;return!o.includes(e)&&c.delete(e.toLowerCase())}),n.forEach(function(e){return c.add(e.toLowerCase())})}function p(e){var n=Array.isArray(e)?e:[e];"meta"===e?c.clear():n.forEach(function(e){return c.delete(e.toLowerCase())})}function v(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 x=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,s=n.mod,u=n.shift,f=n.ctrl,p=n.keys,v=e.key,x=e.code,h=e.ctrlKey,m=e.metaKey,b=e.shiftKey,g=e.altKey,y=l(x),j=v.toLowerCase();if(!t){if(!g===o&&"alt"!==j||!b===u&&"shift"!==j)return!1;if(s){if(!m&&!h)return!1}else if(!m===a&&"meta"!==j&&"os"!==j||!h===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(p&&1===p.length&&(p.includes(j)||p.includes(y)))||(p?(void 0===r&&(r=","),(d(i=p)?i:i.split(r)).every(function(e){return c.has(e.trim().toLowerCase())})):!p)},h=(0,i.createContext)(void 0),m=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),b=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function y(e,n,t,r){var o,a,c=(0,i.useRef)(null),y=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,S=d(e)?e.join(null==j?void 0:j.splitKey):e,k=t instanceof Array?t:r instanceof Array?r:void 0,C=(0,i.useCallback)(n,null!=k?k:[]),w=(0,i.useRef)(C);k?w.current=C:w.current=n;var T=(!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,r){return i&&e(n[r],t[r])},!0):n===t}((a=(0,i.useRef)(void 0)).current,j)&&(a.current=j),a.current),Z=(0,i.useContext)(m).enabledScopes,R=(0,i.useContext)(h);return g(function(){if((null==T?void 0:T.enabled)!==!1&&(e=Z,n=null==T?void 0:T.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),!(v(e,["input","textarea","select"])&&!v(e,null==T?void 0:T.enableOnFormTags)||null!=T&&null!=T.ignoreEventWhen&&T.ignoreEventWhen(e))){if(null!==c.current&&document.activeElement!==c.current&&!c.current.contains(document.activeElement)){b(e);return}(null==(t=e.target)||!t.isContentEditable||null!=T&&T.enableOnContentEditable)&&s(S,null==T?void 0:T.splitKey).forEach(function(t){var i,r,o,a,l,s,c,d=u(t,null==T?void 0:T.combinationKey);if(x(e,d,null==T?void 0:T.ignoreModifiers)||null!=(c=d.keys)&&c.includes("*")){if(n&&y.current)return;if(i=e,r=d,("function"==typeof(o=null==T?void 0:T.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,l=d,"function"==typeof(s=null==T?void 0:T.enabled)?!s(a,l):!0!==s&&void 0!==s){b(e);return}w.current(e,d),n||(y.current=!0)}})}},i=function(e){void 0!==e.key&&(f(l(e.code)),((null==T?void 0:T.keydown)===void 0&&(null==T?void 0:T.keyup)!==!0||null!=T&&T.keydown)&&t(e))},r=function(e){void 0!==e.key&&(p(l(e.code)),y.current=!1,null!=T&&T.keyup&&t(e,!0))},o=c.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),R&&s(S,null==T?void 0:T.splitKey).forEach(function(e){return R.addHotkey(u(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),R&&s(S,null==T?void 0:T.splitKey).forEach(function(e){return R.removeHotkey(u(e,null==T?void 0:T.combinationKey,null==T?void 0:T.description))})}}},[S,T,Z]),c}}},function(e){e.O(0,[789,909,573,377,774,888,179],function(){return e(e.s=45662)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(4920)}])},4920:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eu}});var s=t(52322),i=t(71651),r=t(2784),l=t(97729),o=t.n(l),a=t(65077),c=t(56580),d=t(25251),u=t(75289),x=t(951),h=function(e){var n=e.children;return(0,s.jsx)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:n})},m=t(36882),p=t(39097),f=t.n(p),g=t(7819),j=t(67445),v=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(u.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(u.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(u.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(m.O,{modelType:"Custom Type",modelId:n.id,status:t,authStatus:i,isOnline:r,"data-for":"".concat(n.id,"-tooltip"),"data-tip":!0})})]})},y=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(u.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(u.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,g.TG)(e)?(0,s.jsx)(f(),{passHref:!0,href:j.cd[e.local.format].getBuilderPagePathname(e.local.id),children:(0,s.jsx)("tr",{tabIndex:0,children:(0,s.jsx)(v,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r,modelsStatuses:t},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled",children:(0,s.jsx)(v,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r,modelsStatuses:t},e.remote.id)})})})]})},b=t(59469),_=t(31841),C=t(15996),S=t(84449),T=t(82223),D=t(47731),k=t(32681),O=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,l=e.isOnline,o=(0,D.H)(),a=o.modalPayload,c=o.onOpenModal,d=a.sliceFilterFn,m=a.defaultVariationSelector,p=t.filter(function(e){return i.slices[e.model.id]!==k.G.Deleted});return(0,s.jsxs)(s.Fragment,{children:[n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h,{children:(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Types"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]})}),(0,s.jsx)(y,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:l})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xu,{sx:{mb:"8px"},children:(0,s.jsxs)(h,{children:[(0,s.jsxs)(u.xu,{children:[(0,s.jsx)(u.xv,{variant:"heading",children:"Slices"}),(0,s.jsx)(u.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]}),(0,s.jsxs)(u.xu,{children:[t.some(function(e){return(0,T.c)(e)>0&&i.slices[e.model.id]!==k.G.Deleted})&&(0,s.jsxs)(u.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,s.jsx)(x.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(u.zx,{variant:"darkSmall",onClick:function(){return c({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(x.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(b.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"290px",defineElementKey:function(e){return e.model.name},renderElem:function(e){return C.M.render({showActions:!0,slice:e,wrapperType:i.slices[e.model.id]!==k.G.Deleted?_.WT.clickable:_.WT.nonClickable,StatusOrCustom:{status:i.slices[e.model.id],authStatus:r,isOnline:l},actions:{onUpdateScreenshot:function(n){n.preventDefault(),c({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})}}})}}),(0,s.jsx)(S.Z,{slices:d(p),defaultVariationSelector:m})]})]})},w=t(91914),N=function(){return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(w.wQ1,{size:48}),(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"No internet connection"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need a stable internet connection to review and push changes"})]})})},R=t(90374),Z=function(){var e=(0,R.Z)().openLoginModal;return(0,s.jsx)(u.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(u.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(u.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px"},children:"Could not access your repository"}),(0,s.jsx)(u.xv,{sx:{fontSize:"13px",lineHeight:"24px"},children:"You need to log in to Prismic in order to push your changes."}),(0,s.jsx)(u.zx,{sx:{mt:"24px"},onClick:function(){return e()},children:"Log in to Prismic"})]})})},E=t(5632),z=t.n(E),F=t(2754),I=t(34543),M=t(62230),W=t(85244),H=t(98240),P=t(6277);t(25977);var A={primary:"_1ecs97d74o _1ecs97d74p _1ecs97d74i _1ecs97d74j _1ecs97d74q _1ecs97d74r",secondary:"_1ecs97d6pe _1ecs97d6pf _1ecs97d6p8 _1ecs97d6p9 _1ecs97d6pg _1ecs97d6ph"},U={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97d9gj"},B=function(e){var n=e.children,t=e.color,l=e.endIcon,o=e.href,a=e.textVariant,c=void 0===a?"smallBold":a,d=(0,H.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,W.Z)((0,M.Z)({href:o,target:"_blank",rel:"noreferrer"},d),{className:(0,P.Z)("ovkapw0 _1ecs97d9bi _1ecs97d9gd _1ecs97d9bk _1ecs97d9bq",A[void 0===t?"primary":t]),children:[(0,s.jsx)(i.xv,{component:"span",color:"inherit",variant:c,children:n}),(0,r.isValidElement)(l)?(0,r.cloneElement)(l,{className:(0,P.Z)(l.props.className,"_1ecs97d9tn",U[c])}):null]}))},G=t(39092),V=function(){var e,n=(e=(0,c.v9)(function(e){return{repoName:(0,G.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(F.R$,{style:{alignSelf:"center",marginTop:i.TV.size[72]},children:[(0,s.jsx)(F.u2,{children:(0,s.jsx)(i.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(F.T9,{children:[(0,s.jsx)(F._T,{children:"Everything up-to-date"}),(0,s.jsx)(F.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,s.jsxs)(F.Qj,{children:[(0,s.jsx)(i.zx,{onClick:function(){z().push("/")},children:"Create a page type"}),(0,s.jsx)(B,{endIcon:(0,s.jsx)(I.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},Y=t(79096),L=t(85412),q=t(32665),X=t(3098),Q=t(56577),J=t(24340),$=t(77174),K=t(49471),ee=t(57282),en=t(78656),et=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:n}),(0,s.jsxs)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(u.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},es=function(e){var n=e.format,t=e.id,i=e.name;return(0,s.jsxs)(u.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"CustomTypesReferencesCard-".concat(i),children:[(0,s.jsxs)(u.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(u.xv,{children:i}),(0,s.jsx)(u.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:"Missing Slices"})]}),(0,s.jsxs)(u.rU,{href:j.cd[n].getBuilderPagePathname(t),target:"_blank",variant:"cardSmall",children:["View ",en.$[n].name({start:!1,plural:!1})]},t)]})},ei=t(79797),er=t(54132),el=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,l=(0,R.Z)().closeModals;return(0,s.jsx)(ei.Z,{placement:"right",open:n,level:null,onClose:l,width:496,children:(0,s.jsx)(er.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,s.jsxs)(u.kC,{sx:{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,s.jsx)(u.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(u.x8,{type:"button",onClick:function(){return l()}})]})},Footer:function(){return(0,s.jsx)(u.kC,{sx:{flexDirection:"column",justifyContent:"center",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:"white",padding:20},children:i})},children:r})})},eo=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(u.kC,{sx:(0,M.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(u.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(u.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},ea=function(e){var n=e.pushChanges,t=(0,r.useState)(!1),i=t[0],l=t[1],o=(0,c.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,J.q.SOFT_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,K.Ch)(e).filter(g.yp),modalData:e.pushChanges}}),a=o.isDeleteDocumentsDrawerOpen,d=o.remoteOnlyCustomTypes,x=o.modalData,h=(0,R.Z)(),m=h.closeModals,p=h.openToaster;if(!a)return null;if((null==x?void 0:x.type)!=="SOFT")return p("No change data",ee.Jf.ERROR),null;var f=x.details.customTypes.map(function(e){var n,t=d.find(function(n){return(0,g.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(el,{isOpen:a,title:"Confirm deletion",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{onToggle:function(){l(!i)},isConfirmed:i,sx:{mb:10}}),(0,s.jsx)(Q.z,{label:"Push changes",variant:"primary",onClick:function(){m(),n(i)},disabled:!i,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[x.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),f]})})},ec=function(e){var n=e.pushChanges,t=(0,c.v9)(function(e){return{isDeleteDocumentsDrawerOpen:(0,$.gP)(e,J.q.HARD_DELETE_DOCUMENTS_DRAWER),remoteOnlyCustomTypes:(0,K.Ch)(e).filter(g.yp),modalData:e.pushChanges}}),i=t.isDeleteDocumentsDrawerOpen,r=t.remoteOnlyCustomTypes,l=t.modalData,o=(0,R.Z)(),a=o.closeModals,d=o.openToaster;if(!i)return null;if((null==l?void 0:l.type)!=="HARD")return d("No change data",ee.Jf.ERROR),null;var x=l.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,g.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(et,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(el,{isOpen:i,title:"Manual action required",footer:(0,s.jsx)(Q.z,{label:"Try again",variant:"primary",onClick:function(){a(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",l.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:[l.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),x]})})},ed=function(e){var n=e.pushChanges,t=(0,c.v9)(function(e){return{isOpen:(0,$.gP)(e,J.q.REFERENCES_MISSING_DRAWER),localCustomTypes:(0,K.Ch)(e).filter(g.TG),modalData:e.pushChanges}}),i=t.isOpen,r=t.modalData,l=t.localCustomTypes,o=(0,R.Z)(),a=o.closeModals,d=o.openToaster;if(!i)return null;if((null==r?void 0:r.details)===void 0)return d("No change data",ee.Jf.ERROR),null;var x=(null==r?void 0:r.details.customTypes.length)>1,h=r.details.customTypes.map(function(e){var n,t=l.find(function(n){return(0,g.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(es,{format:t.local.format,id:t.local.id,name:null!==(n=t.local.label)&&void 0!==n?n:t.local.id})});return(0,s.jsx)(el,{isOpen:i,title:"Missing Slices",footer:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(Q.z,{label:"Try again",variant:"primary",onClick:function(){a(),n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(u.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["You have",x?"":" a"," type",x?"s":""," that reference"," ",x?"":"s"," one or more missing Slices"]}),(0,s.jsxs)(u.xv,{sx:{mb:24},children:["Before pushing, remove references to any missing Slices by opening"," ","the affected type",x?"s":""," and clicking the"," ",(0,s.jsx)("b",{children:"Save"})," button."]}),h]})})},eu=function(){var e=(0,L.X)(),n=e.unSyncedSlices,t=e.unSyncedCustomTypes,l=e.modelsStatuses,u=e.authStatus,x=e.isOnline,h=(0,r.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:l.slices[e.model.id]}}).filter(function(e){return L.O.includes(e.status)}),changedCustomTypes:t.map(function(e){return(0,g.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:l.customTypes[e.id]}}).filter(function(e){return L.O.includes(e.status)})}},[n,t,l]),m=h.changedSlices,p=h.changedCustomTypes,f=(0,R.Z)(),j=f.pushChanges,v=f.closeModals,y=(0,c.v9)(function(e){return{isSyncing:(0,q.hg)(e,X.z.CHANGES_PUSH)}}).isSyncing;(0,r.useEffect)(function(){return function(){v()}},[]);var b=n.length+t.length,_=function(e){return j({confirmDeleteDocuments:e,changedSlices:m,changedCustomTypes:p})},C=(0,r.useMemo)(function(){return x?u===Y.t.UNAUTHORIZED||u===Y.t.FORBIDDEN?(0,s.jsx)(Z,{}):0===b?(0,s.jsx)(V,{}):(0,s.jsx)(O,{unSyncedSlices:n,unSyncedCustomTypes:t,modelsStatuses:l,authStatus:u,isOnline:x}):(0,s.jsx)(N,{})},[x,u,b,n,t,l,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(d.LN,{children:[(0,s.jsxs)(d.wd,{children:[(0,s.jsx)(d.Cx,{folder:"Changes"}),(0,s.jsx)(d.K2,{children:(0,s.jsx)(i.zx,{onClick:function(){return _(!1)},loading:y,disabled:0===b||!x||u===Y.t.UNAUTHORIZED||u===Y.t.FORBIDDEN||y,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,s.jsx)(d.RN,{children:(0,s.jsxs)(a.xR,{sx:{display:"flex",flexDirection:"column"},children:[C,(0,s.jsx)(ea,{pushChanges:_}),(0,s.jsx)(ec,{pushChanges:_}),(0,s.jsx)(ed,{pushChanges:_})]})})]})]})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return d},Qj:function(){return p},T9:function(){return x},nf:function(){return m},u2:function(){return u},_T:function(){return h}});var s=t(67557),i=t(62230),r=t(85244),l=t(98240),o=t(52322),a=t(6277),c=t(71651);t(41236);var d=function(e){var n=e.backgroundImage,t=e.style,c=(0,l.Z)(e,["backgroundImage","style"]),d=void 0!==n;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},c),{className:(0,a.Z)("_18bjhbz0 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9uk _1ecs97d9um _1ecs97d9uo _1ecs97d268 _1ecs97d2dl _1ecs97d9d7 _1ecs97d9ej _1ecs97d9ex _1ecs97d9c7",(0,s.Z)({},"_18bjhbz1 _1ecs97d9cf _1ecs97d9h6",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(n,")"):void 0},t)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d48s _1ecs97d4g5 _1ecs97d9ep _1ecs97d9f1 _1ecs97d9c7"}))},x=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97d9bi _1ecs97d9bj _1ecs97d9bk _1ecs97d9bt _1ecs97d9rr"}))},h=function(e){return(0,o.jsx)(c.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(c.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},p=function(e){return(0,o.jsx)(c.hE,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97d9lg _1ecs97d9bq _1ecs97d9pm",size:"medium",variant:"secondary"}))}},41236:function(){},25977:function(){}},function(e){e.O(0,[789,123,909,97,918,906,573,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[379],{70320:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types",function(){return t(60306)}])},60306:function(n,u,t){"use strict";t.r(u);var _=t(52322),c=t(91563),o=function(){return(0,_.jsx)(c.F,{format:"custom"})};u.default=o}},function(n){n.O(0,[799,482,774,888,179],function(){return n(n.s=70320)}),_N_E=n.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(80316)}])},80316:function(n,u,t){"use strict";t.r(u);var _=t(52322),e=t(91563),f=function(){return(0,_.jsx)(e.F,{format:"page"})};u.default=f}},function(n){n.O(0,[799,482,774,888,179],function(){return n(n.s=87314)}),_N_E=n.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,n,t){var i=t(34311),r=t(23779),o=i(function(e,n,t){return e+(t?" ":"")+r(n)});e.exports=o},26688:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return t(40008)}])},45466:function(e,n,t){"use strict";t.d(n,{c:function(){return j}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),c=t(75289),s=t(2784),u=t(36131),d=t(68780),f=t(88932),m=t(38876),h=t(40147),p=t(82770);function x(){return(x=(0,i.Z)(function(e){var n,t,i,r,o,a,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:var s;return l.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,s=n,r={id:(0,m.T3)(s),type:"SharedSlice",name:s,description:s,variations:[{id:v,name:(0,m.MP)(v),docURL:"...",version:"initial",description:(0,m.MP)(v),imageUrl:""},]},[4,h.j.slices.createSlice({libraryID:t,model:r})];case 1:if((o=l.sent().errors).length>0)throw o;return p.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),c="Internal Error: Slice not created",console.error(c,a),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v="default",y=t(90374),b=t(66443),g=t(70041),j=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,h=e.remoteSlices,v=(0,y.Z)().createSliceSuccess,j=(0,s.useState)(!1),S=j[0],C=j[1],k=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var o;return n=e.sliceName,t=e.from,C(!0),[4,function(e){return x.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(o=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,p.y0)()];case 1:return v(n.sent().libraries),[4,f(e,t)];case 2:return n.sent(),[2]}})}),function(e){return o.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,a.jsx)(d.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:S,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,b.h)(e,m,h)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,a.jsxs)(c.xu,{children:[(0,a.jsx)(g.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,a.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,a.jsx)(u.ZP,{name:"from",options:m.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,o.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,o.Z)((0,r.Z)({},e),{colors:(0,o.Z)((0,r.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),r=t(52322);t(2784);var o=t(63397),l=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,s=e.dataCy,u=e.onChange;return(0,r.jsxs)(l.xu,{mb:3,children:[(0,r.jsx)(l.__,{htmlFor:n,mb:2,children:t}),(0,r.jsx)(o.gN,(0,i.Z)({name:n,type:"text",placeholder:a,as:l.II,autoComplete:"off"},u?{onChange:u}:null,s?{"data-cy":s}:null)),c?(0,r.jsx)(l.xv,{"data-cy":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return s}});var i=t(81541),r=t(75329),o=t(96009),l=t.n(o),a=t(74600),c=t.n(a);function s(e,n,t){var o=e.sliceName;if(!o)return{sliceName:"Cannot be empty"};if(!r.xo.exec(o))return{sliceName:"No special characters allowed"};if(c()(l()(o)).replace(/\s/gm,"")!==o.trim())return{sliceName:"Value has to be PascalCased"};if(o.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(o))return{sliceName:"".concat(o," is reserved for Slice Machine use")};var a=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),s=t.map(function(e){return e.name});if((0,i.Z)(a).concat((0,i.Z)(s)).includes(o))return{sliceName:"Slice name is already taken."}}},68780:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),c=t(25812),s=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,h=e.validate,p=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,N=e.actionMessage;return a().setAppElement("#__next"),(0,o.jsx)(c.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=x?x:"900px"}},children:(0,o.jsx)(s.J9,{validateOnChange:!0,initialValues:v,validate:function(e){return h?h(e):void 0},onSubmit:function(e){p(e)},children:function(e){var l=e.isValid,a=e.isSubmitting,c=e.values,h=e.errors,p=e.touched,x=e.setFieldValue,v=e.setValues;return(0,o.jsx)(s.l0,(0,r.Z)((0,i.Z)({id:m},null!=L?{"data-cy":L}:null),{children:(0,o.jsx)(f.Z,(0,r.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,o.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,o.jsx)(u.X6,{sx:{fontSize:"20px"},children:y}),(0,o.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,o.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof N?N(e):N}),(0,o.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||C,children:"Cancel"}),(0,o.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:c,errors:h,touched:p,setFieldValue:x,setValues:v})}))}))}})})}},40008:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return K}});var i=t(81541),r=t(52322),o=t(71651),l=t(2784),a=t(97729),c=t.n(a),s=t(65077),u=t(75289),d=t(56580),f=t(5632),m=t(88932),h=t(15996),p=t(75329),x=t(25251),v=t(45466),y=t(59469),b=t(36887),g=t(82770),j=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,o=e.documentationComponent,l=e.videoPublicIdUrl;return(0,r.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},children:[(0,r.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,r.jsx)(b.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){g.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,r.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,r.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,r.jsx)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,r.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,r.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,r.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,r.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"})]})]})]})},S=t(84449),C=t(90374),k=t(68780),w=t(70041),L=t(77174),N=t(24340),I=t(75992),E=t(66443),P=function(e){var n=e.sliceName,t=e.sliceId,i=e.libName,o=(0,C.Z)(),l=o.renameSlice,a=o.closeModals,c=(0,d.v9)(function(e){return{isRenameSliceModalOpen:(0,L.gP)(e,N.q.RENAME_SLICE),localLibs:(0,I.Sd)(e),remoteLibs:(0,I.sT)(e)}}),s=c.isRenameSliceModalOpen,f=c.localLibs,m=c.remoteLibs,h=function(e){l(i,t,e.sliceName)};return(0,r.jsx)(k.Z,{dataCy:"rename-slice-modal",isOpen:s,widthInPx:"530px",formId:"rename-slice-modal-".concat(t),close:a,buttonLabel:"Rename",onSubmit:h,initialValues:{sliceName:n},content:{title:"Rename a slice"},validate:function(e){return(0,E.h)(e,f,m)},children:function(e){var n=e.touched,t=e.errors;return(0,r.jsx)(u.xu,{children:(0,r.jsx)(w.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"})})}})},Z=t(25812),O=t(59326),R=t(54132),_=t(65186),M=t(56577),A=t(3098),D=t(32665),W=function(e){var n=e.sliceId,t=e.sliceName,i=e.libName,o=(0,d.v9)(function(e){return{isSliceModalOpen:(0,L.gP)(e,N.q.DELETE_SLICE),isDeletingSlice:(0,D.hg)(e,A.z.DELETE_SLICE)}}),l=o.isSliceModalOpen,a=o.isDeletingSlice,c=(0,C.Z)(),s=c.closeModals,f=c.deleteSlice,m=(0,O.B7)().theme;return(0,r.jsx)(Z.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:s,children:(0,r.jsx)(R.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,r.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,r.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(_.$vK,{size:20,color:null===(e=m.colors)||void 0===e?void 0:e.greyIcon}),(0,r.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,r.jsx)(u.x8,{type:"button",onClick:s})]})},Footer:function(){return(0,r.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,r.jsx)(M.z,{label:"Cancel",variant:"secondary",onClick:function(){return s()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,r.jsx)(M.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:function(){return f(n,t,i)}})]})},children:(0,r.jsxs)(u.nv,{children:["This action will immediately make the following changes:",(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:["Delete the"," ",(0,r.jsxs)(u.xv,{sx:{fontWeight:"bold"},children:[i,"/",t,"/"]})," ","directory."]}),(0,r.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,r.jsx)("ul",{children:(0,r.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."]})})})},T=t(71685),z=t(47731),F={getBuilderPagePathname:function(e){var n=e.libraryName,t=e.sliceName,i=e.variationId;return"/".concat(n.replace(/\//g,"--"),"/").concat(t,"/").concat(i)}},V=t(13858),K=function(){var e,n,t,a,b,g,k=(0,f.useRouter)(),w=(0,C.Z)(),L=w.openRenameSliceModal,N=w.openDeleteSliceModal,E=(0,z.H)(),Z=E.modalPayload,O=E.onOpenModal,R=Z.sliceFilterFn,_=Z.defaultVariationSelector,M=(0,d.v9)(function(e){return{remoteSlices:(0,I.sT)(e),libraries:(0,I.Sd)(e),frontendSlices:(0,I.xC)(e)}}),A=M.remoteSlices,D=M.libraries,K=M.frontendSlices,B=(0,l.useState)(!1),H=B[0],X=B[1],q=D.filter(function(e){return e.isLocal}),U=D.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),J=(0,T.J)({slices:K}),G=J.modelsStatuses,Q=J.authStatus,Y=J.isOnline,$=(D||[]).map(function(e){return e.components}).flat(),ee=$.length,en=(0,l.useState)(),et=en[0],ei=en[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Slices - Slice Machine"})}),(0,r.jsxs)(x.LN,{children:[(0,r.jsxs)(x.wd,{children:[(0,r.jsx)(x.Cx,{folder:"Slices"}),(null==q?void 0:q.length)!==0&&0!==ee?(0,r.jsx)(x.K2,{children:(0,r.jsx)(o.zx,{"data-cy":"create-slice",onClick:function(){X(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,r.jsxs)(x.RN,{children:[(0,r.jsx)(s.xR,{sx:{display:"flex",flexDirection:"column"},children:U.length>0?(0,r.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===ee?(0,r.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(j,{title:"What are Slices?",onCreateNew:function(){X(!0)},buttonText:"Create one",videoPublicIdUrl:p.rd,documentationComponent:(0,r.jsxs)(r.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,r.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"}),"."]})})}):U.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,r.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,r.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,r.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,r.jsx)(u.xv,{children:n})}),!t&&(0,r.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,r.jsx)(y.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return h.M.render({slice:e,StatusOrCustom:{status:G.slices[e.model.id],authStatus:Q,isOnline:Y},actions:{onUpdateScreenshot:function(n){n.preventDefault(),O({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},openRenameModal:function(e){ei(e),L()},openDeleteModal:function(e){ei(e),N()}},showActions:!0})},gridGap:"32px 16px"})]},n)})}):void 0}),(null==q?void 0:q.length)>0&&(0,r.jsx)(S.Z,{slices:R($),defaultVariationSelector:_}),(null==q?void 0:q.length)>0&&H&&(0,r.jsx)(v.c,{localLibraries:q,remoteSlices:A,onSuccess:function(e,n){var t=e.variations[0].id,i=F.getBuilderPagePathname({libraryName:n,sliceName:e.name,variationId:t});k.push(i),m.Am.success((0,V.kQ)({path:"".concat(n,"/").concat(e.name,"/model.json")}))},onClose:function(){X(!1)}}),(0,r.jsx)(P,{sliceId:null!==(e=null==et?void 0:et.model.id)&&void 0!==e?e:"",sliceName:null!==(n=null==et?void 0:et.model.name)&&void 0!==n?n:"",libName:null!==(t=null==et?void 0:et.from)&&void 0!==t?t:"","data-cy":"rename-slice-modal"}),(0,r.jsx)(W,{sliceId:null!==(a=null==et?void 0:et.model.id)&&void 0!==a?a:"",sliceName:null!==(b=null==et?void 0:et.model.name)&&void 0!==b?b:"",libName:null!==(g=null==et?void 0:et.from)&&void 0!==g?g:""})]})]})]})}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return g}});var i=t(2784);function r(){return(r=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 o=["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 c(e,n){return void 0===n&&(n=","),e.split(n)}function s(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return a(e)});return r({},{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!o.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!o.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 h(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 p=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,l=n.meta,c=n.mod,s=n.shift,f=n.ctrl,m=n.keys,h=e.key,p=e.code,x=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=a(p),j=h.toLowerCase();if(!t){if(!b===o&&"alt"!==j||!y===s&&"shift"!==j)return!1;if(c){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===r&&(r=","),(d(i=m)?i:i.split(r)).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,r){var o,l,u=(0,i.useRef)(null),g=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,S=d(e)?e.join(null==j?void 0:j.splitKey):e,C=t instanceof Array?t:r instanceof Array?r: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,r){return i&&e(n[r],t[r])},!0):n===t}((l=(0,i.useRef)(void 0)).current,j)&&(l.current=j),l.current),N=(0,i.useContext)(v).enabledScopes,I=(0,i.useContext)(x);return b(function(){if((null==L?void 0:L.enabled)!==!1&&(e=N,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),!(h(e,["input","textarea","select"])&&!h(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)&&c(S,null==L?void 0:L.splitKey).forEach(function(t){var i,r,o,l,a,c,u,d=s(t,null==L?void 0:L.combinationKey);if(p(e,d,null==L?void 0:L.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,r=d,("function"==typeof(o=null==L?void 0:L.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),l=e,a=d,"function"==typeof(c=null==L?void 0:L.enabled)?!c(l,a):!0!==c&&void 0!==c){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))},r=function(e){void 0!==e.key&&(m(a(e.code)),g.current=!1,null!=L&&L.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),I&&c(S,null==L?void 0:L.splitKey).forEach(function(e){return I.addHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),I&&c(S,null==L?void 0:L.splitKey).forEach(function(e){return I.removeHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))})}}},[S,L,N]),u}}},function(e){e.O(0,[789,909,97,906,573,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
div.LegacySliceTooltip_legacySliceTooltipContainer__QZCRH{border-radius:6px;width:230px;text-align:center;padding:8px}div.LegacySliceTooltip_legacySliceTooltipContainer__QZCRH>a{color:#fff}._1nkpwww0{border-radius:3px}._18bjhbz0{max-width:498px;min-height:400px;background-color:var(--_7j49md15)}._18bjhbz1{background-size:cover;background-color:transparent;border-radius:var(--_7j49md3);border-style:var(--_7j49mdd);height:100%;max-width:100%}._18bjhbz1 ._18bjhbz3{padding:64px}._18bjhbz4{font-size:18px;font-weight:600;line-height:32px}._18bjhbz5{font-weight:400;line-height:24px}._18bjhbz1 ._18bjhbz5{max-width:464px;align-self:center}._18bjhbz1 ._18bjhbz6{justify-content:center}.ovkapw0:focus-visible{outline:none;-webkit-text-decoration-line:underline;text-decoration-line:underline}.ovkapw1{font-size:1.2rem;width:18px;height:18px}.ovkapw2{font-size:1rem;width:16px;height:16px}.ovkapw3{font-size:inherit;width:inherit;height:inherit}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
div.LegacySliceTooltip_legacySliceTooltipContainer__QZCRH{border-radius:6px;width:230px;text-align:center;padding:8px}div.LegacySliceTooltip_legacySliceTooltipContainer__QZCRH>a{color:#fff}._1nkpwww0{border-radius:3px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,a,c,e,t,i,n,b,d,f,u,h,l){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,b,d,"static/chunks/pages/index-f382c8090bd21628.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":["static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-11c9e241f5a8a4cb.js"],"/changes":[c,"static/chunks/8eec4907-b712959d9f984b68.js",s,e,"static/chunks/918-38d08f1e885b222d.js",t,i,"static/css/6b6c11ed1fffd3e0.css","static/chunks/pages/changes-8338c9d0723a7033.js"],"/custom-types":[a,b,d,"static/chunks/pages/custom-types-abb8c8c92880120e.js"],"/custom-types/[customTypeId]":[s,e,f,a,t,n,u,h,"static/chunks/pages/custom-types/[customTypeId]-9ba8a3f68a048222.js"],"/page-types/[pageTypeId]":[s,e,f,a,t,n,u,h,"static/chunks/pages/page-types/[pageTypeId]-3144fdf0c6f9af94.js"],"/slices":[c,s,e,t,i,"static/css/e855bef88bb5345b.css","static/chunks/pages/slices-afa4b34df8f8e1c3.js"],"/[lib]/[sliceName]/[variation]":[c,s,i,n,"static/css/d4b59834999106a5.css","static/chunks/pages/[lib]/[sliceName]/[variation]-36ba0bde8415ad8b.js"],"/[lib]/[sliceName]/[variation]/screenshot":[l,"static/chunks/pages/[lib]/[sliceName]/[variation]/screenshot-2750adc7cdad5005.js"],"/[lib]/[sliceName]/[variation]/simulator":[c,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-1bb05c8aa7db2bc2.js",s,l,"static/chunks/113-34b6cf41a62f08ce.js","static/chunks/pages/[lib]/[sliceName]/[variation]/simulator-c608e0470a8f6099.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/page-types/[pageTypeId]","/slices","/[lib]/[sliceName]/[variation]","/[lib]/[sliceName]/[variation]/screenshot","/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/909-e4eec905c21ad8ad.js","static/chunks/799-5c13484e9f945e5d.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/97-f6188ebe22eb21da.js","static/chunks/906-9224feb63b5e36f3.js","static/chunks/573-e92018662d1f6c26.js","static/chunks/377-3caacee3c3ffdc25.js","static/chunks/482-93d7a0d3a0353f59.js","static/css/26b51745402a92af.css","static/chunks/125-84464edfe25651eb.js","static/chunks/323-9843d325f7ff6913.js","static/css/b6bfe1e0ef76c2b1.css","static/chunks/746-2ca4784811bde7c1.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { FC, SVGProps } from "react";
|
|
2
|
-
|
|
3
|
-
export const LightningIcon3D: FC<SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
-
<svg
|
|
5
|
-
width="65"
|
|
6
|
-
height="66"
|
|
7
|
-
viewBox="0 0 65 66"
|
|
8
|
-
fill="none"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
{...props}
|
|
11
|
-
>
|
|
12
|
-
<path
|
|
13
|
-
d="M15.6919 40.6473L46.8725 8.13344L32.7614 32.5783L48.3885 32.4863L17.2078 65.0001L31.0542 40.4849L15.6919 40.6473Z"
|
|
14
|
-
fill="#17151F"
|
|
15
|
-
stroke="#6F6E77"
|
|
16
|
-
strokeLinejoin="round"
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
d="M26.9347 33.3512L11.5723 33.5137L15.6904 40.6464L31.0528 40.484L26.9347 33.3512Z"
|
|
20
|
-
fill="#6F6E77"
|
|
21
|
-
stroke="#6F6E77"
|
|
22
|
-
strokeLinejoin="round"
|
|
23
|
-
/>
|
|
24
|
-
<path
|
|
25
|
-
d="M48.3886 32.4856L17.208 64.9995L13.0898 57.8667L44.2705 25.3528L48.3886 32.4856Z"
|
|
26
|
-
fill="#E9E8EA"
|
|
27
|
-
/>
|
|
28
|
-
<path
|
|
29
|
-
d="M46.8727 8.13278L32.7616 32.5776L28.6435 25.4448L42.7546 1L46.8727 8.13278Z"
|
|
30
|
-
fill="#E9E8EA"
|
|
31
|
-
/>
|
|
32
|
-
<path
|
|
33
|
-
d="M48.3886 32.4856L17.208 64.9995L13.0898 57.8667L44.2705 25.3528L48.3886 32.4856Z"
|
|
34
|
-
stroke="#6F6E77"
|
|
35
|
-
strokeLinejoin="round"
|
|
36
|
-
/>
|
|
37
|
-
<path
|
|
38
|
-
d="M46.8727 8.13278L32.7616 32.5776L28.6435 25.4448L42.7546 1L46.8727 8.13278Z"
|
|
39
|
-
stroke="#6F6E77"
|
|
40
|
-
strokeLinejoin="round"
|
|
41
|
-
/>
|
|
42
|
-
<path
|
|
43
|
-
d="M11.5742 33.5139L42.7549 1L28.6438 25.4448L44.2708 25.3528L13.0902 57.8667L26.9366 33.3514L11.5742 33.5139Z"
|
|
44
|
-
fill="#E9E8EA"
|
|
45
|
-
stroke="#6F6E77"
|
|
46
|
-
strokeLinejoin="round"
|
|
47
|
-
/>
|
|
48
|
-
</svg>
|
|
49
|
-
);
|
package/src/models/ApiError.ts
DELETED
package/src/models/SyncError.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { countMissingScreenshots } from "@src/utils/screenshots/missing";
|
|
2
|
-
import { getSelectedSliceDummyData } from "../../modules/screenshots/__testutils__/getSelectedSliceDummyData";
|
|
3
|
-
|
|
4
|
-
describe("[utils - screenshot - missing]", () => {
|
|
5
|
-
it("should return the number of missing screenshots", () => {
|
|
6
|
-
const { dummySliceState } = getSelectedSliceDummyData();
|
|
7
|
-
|
|
8
|
-
expect(countMissingScreenshots(dummySliceState)).toEqual(1);
|
|
9
|
-
|
|
10
|
-
expect(
|
|
11
|
-
countMissingScreenshots({
|
|
12
|
-
...dummySliceState,
|
|
13
|
-
model: {
|
|
14
|
-
...dummySliceState.model,
|
|
15
|
-
variations: [
|
|
16
|
-
...dummySliceState.model.variations,
|
|
17
|
-
...dummySliceState.model.variations,
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
})
|
|
21
|
-
).toEqual(2);
|
|
22
|
-
|
|
23
|
-
expect(
|
|
24
|
-
countMissingScreenshots({
|
|
25
|
-
...dummySliceState,
|
|
26
|
-
model: {
|
|
27
|
-
...dummySliceState.model,
|
|
28
|
-
variations: [
|
|
29
|
-
...dummySliceState.model.variations,
|
|
30
|
-
...dummySliceState.model.variations,
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
screenshots: { "default-variation": {} },
|
|
34
|
-
})
|
|
35
|
-
).toEqual(1);
|
|
36
|
-
|
|
37
|
-
expect(
|
|
38
|
-
countMissingScreenshots({
|
|
39
|
-
...dummySliceState,
|
|
40
|
-
model: {
|
|
41
|
-
...dummySliceState.model,
|
|
42
|
-
variations: [
|
|
43
|
-
...dummySliceState.model.variations,
|
|
44
|
-
...dummySliceState.model.variations,
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
screenshots: { "default-variation": {}, "variation-1": {} },
|
|
48
|
-
})
|
|
49
|
-
).toEqual(0);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
File without changes
|