@uniformdev/mesh-sdk-react 17.6.1-alpha.60 → 17.7.1-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +151 -46
- package/dist/index.esm.js +154 -154
- package/dist/index.js +156 -156
- package/dist/index.mjs +154 -154
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Xo=Object.create;var ot=Object.defineProperty;var Jo=Object.getOwnPropertyDescriptor;var jo=Object.getOwnPropertyNames;var en=Object.getPrototypeOf,tn=Object.prototype.hasOwnProperty;var Ta=(e,t)=>{for(var a in t)ot(e,a,{get:t[a],enumerable:!0})},at=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jo(t))!tn.call(e,r)&&r!==a&&ot(e,r,{get:()=>t[r],enumerable:!(o=Jo(t,r))||o.enumerable});return e},J=(e,t,a)=>(at(e,t,"default"),a&&at(a,t,"default")),se=(e,t,a)=>(a=e!=null?Xo(en(e)):{},at(t||!e||!e.__esModule?ot(a,"default",{value:e,enumerable:!0}):a,e)),rn=e=>at(ot({},"__esModule",{value:!0}),e);var Z={};Ta(Z,{AddListButton:()=>h.AddListButton,Button:()=>h.Button,Callout:()=>h.Callout,DamSelectedItem:()=>Sn,DefaultSearchRow:()=>lr,DefaultSelectedItem:()=>br,EntrySearch:()=>Ir,Heading:()=>h.Heading,Icons:()=>ct,Input:()=>h.Input,InputComboBox:()=>h.InputComboBox,InputKeywordSearch:()=>h.InputKeywordSearch,InputSelect:()=>h.InputSelect,InputToggle:()=>h.InputToggle,InputVariables:()=>fa,KeywordSearchInput:()=>h.InputKeywordSearch,Label:()=>h.Label,LoadingIndicator:()=>h.LoadingIndicator,LoadingOverlay:()=>h.LoadingOverlay,Menu:()=>h.Menu,MenuItem:()=>h.MenuItem,MeshApp:()=>Pn,ProductPreviewList:()=>jt,ProductQuery:()=>hn,ProductQueryContext:()=>Xt,ProductSearch:()=>wn,ProductSearchContext:()=>Kr,ProductSearchRow:()=>qr,ProductSelectedItem:()=>Wr,RequestBody:()=>Ln,RequestHeaders:()=>_n,RequestMethodSelect:()=>In,RequestParameters:()=>Dn,RequestProvider:()=>kn,RequestTypeContainer:()=>pa,RequestUrl:()=>Un,RequestUrlInput:()=>Bn,ResolvableLoadingValue:()=>Yt,ScrollableList:()=>h.ScrollableList,ScrollableListItem:()=>h.ScrollableListItem,SelectionField:()=>Zt,Switch:()=>h.Switch,Textarea:()=>h.Textarea,Theme:()=>h.Theme,UniformMeshLocationContext:()=>la,UniformMeshLocationContextProvider:()=>je,UniformMeshSdkContext:()=>Je,UniformMeshSdkContextProvider:()=>Rn,VariableEditor:()=>ga,VariablesList:()=>Mn,VariablesProvider:()=>Vn,badgeIcon:()=>xt,damSelectItemImage:()=>Tt,damSelectedItemContainer:()=>Qr,damSelectedItemCopy:()=>Xr,damSelectedItemDetails:()=>Zr,damSelectedItemIcon:()=>jr,damSelectedItemInfoBtn:()=>aa,damSelectedItemInner:()=>Yr,damSelectedItemLinkBtn:()=>kt,damSelectedItemLinkContainer:()=>ta,damSelectedItemMediaContainer:()=>ra,damSelectedItemPopover:()=>ea,damSelectedItemPopoverLabel:()=>Ze,damSelectedItemSmallText:()=>_e,damSelectedItemTitle:()=>Jr,draggableContainer:()=>Tr,draggableIcon:()=>yt,draggableIconOffset:()=>_r,draggableIconWrapper:()=>Lr,entrySearchBtn:()=>xr,entrySearchConfig:()=>Sr,entrySearchConfigHidden:()=>Cr,entrySearchLoadMoreBtn:()=>wr,entrySearchResultList:()=>Rr,entrySearchSelectIcon:()=>Pr,entrySearchSelectImg:()=>kr,entrySearchSelectInput:()=>bn,entrySearchSelectOption:()=>yn,entrySearchWrapper:()=>yr,productSearchRowActiveIcon:()=>Ar,productSearchRowCategory:()=>Ur,productSearchRowContainer:()=>Dr,productSearchRowContent:()=>Vr,productSearchRowContentActive:()=>Er,productSearchRowDetails:()=>Br,productSearchRowTitle:()=>Mr,productSelectedItemContainer:()=>Gr,productSelectedItemContent:()=>Nr,productSelectedItemDetails:()=>Or,productSelectedItemIcon:()=>$r,productSelectedItemImage:()=>wt,productSelectedItemLinkContainer:()=>Fr,productedSelectedItemLinkBtn:()=>St,productedSelectedItemSmallText:()=>Ct,searchRowBtn:()=>ir,searchRowContainer:()=>rr,searchRowContainerActive:()=>or,searchRowContainerWithPopover:()=>ar,searchRowPopover:()=>nr,searchRowText:()=>ft,searchRowTextSmall:()=>mt,selectItemLinkBtn:()=>ht,selectItemLinkContainer:()=>vr,selectItemPopover:()=>fr,selectItemPopoverLabel:()=>ze,selectItemSmallText:()=>be,selectedItemContainer:()=>dr,selectedItemCopy:()=>ur,selectedItemDetails:()=>pr,selectedItemIcon:()=>mr,selectedItemInner:()=>cr,selectedItemTitle:()=>gr,urlEncodeRequestParameter:()=>ya,urlEncodeRequestUrl:()=>ba,useInitializeUniformMeshSdk:()=>na,useMeshLocation:()=>An,useProductQueryContext:()=>Jt,useProductSearchContext:()=>Ye,useRequest:()=>K,useUniformMeshLocation:()=>zn,useUniformMeshLocationContext:()=>et,useUniformMeshSdk:()=>sa,useUniformMeshSdkContext:()=>ia,useVariables:()=>ge,variablesToList:()=>va});module.exports=rn(Z);var c=require("@emotion/react"),S=se(require("react"));var ct={};Ta(ct,{Caution:()=>La,Checkmark:()=>nt,ChevronDown:()=>it,Close:()=>_a,Danger:()=>Ia,ExclamationPoint:()=>Da,Info:()=>st,Lightbulb:()=>Va,MagnifyingGlass:()=>Ea,MaximizeAlt:()=>Ma,Minus:()=>lt,MoreVerticalAlt:()=>Qe,Plus:()=>dt});var zt=require("@emotion/react/jsx-runtime"),an=e=>(0,zt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:(0,zt.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})}),La=an;var qt=require("@emotion/react/jsx-runtime"),on=e=>(0,qt.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,qt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})}),nt=on;var Ht=require("@emotion/react/jsx-runtime"),nn=e=>(0,Ht.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,Ht.jsx)("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})}),it=nn;var Be=require("@emotion/react/jsx-runtime"),sn=e=>(0,Be.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:(0,Be.jsxs)("g",{fillRule:"evenodd",children:[(0,Be.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,Be.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"})]})}),_a=sn;var Gt=require("@emotion/react/jsx-runtime"),ln=e=>(0,Gt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,Gt.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})}),Ia=ln;var Ot=require("@emotion/react/jsx-runtime"),dn=e=>(0,Ot.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:(0,Ot.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})}),Da=dn;var Ke=require("@emotion/react/jsx-runtime"),cn=e=>(0,Ke.jsxs)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[(0,Ke.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),(0,Ke.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})]}),st=cn;var Nt=require("@emotion/react/jsx-runtime"),pn=e=>(0,Nt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,Nt.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})}),Va=pn;var le=require("@emotion/react/jsx-runtime"),un=e=>(0,le.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,le.jsxs)("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[(0,le.jsx)("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),(0,le.jsx)("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})]}),(0,le.jsx)("defs",{children:(0,le.jsx)("clipPath",{id:"magnifying-glass_svg__a",children:(0,le.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),Ea=un;var $t=require("@emotion/react/jsx-runtime"),gn=e=>(0,$t.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,$t.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})}),Ma=gn;var Ft=require("@emotion/react/jsx-runtime"),mn=e=>(0,Ft.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Ft.jsx)("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),lt=mn;var Wt=require("@emotion/react/jsx-runtime"),fn=e=>(0,Wt.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,Wt.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Qe=fn;var Kt=require("@emotion/react/jsx-runtime"),vn=e=>(0,Kt.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Kt.jsx)("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})}),dt=vn;var tr=require("@emotion/react"),Ja=require("@uniformdev/design-system");var Qt=require("@emotion/react/jsx-runtime");function ae({src:e,alt:t,className:a}){let o=e&&typeof e!="string"?e:null;return o?(0,Qt.jsx)(o,{className:a}):(0,Qt.jsx)("img",{src:e,alt:t,className:a})}var q=require("@emotion/react"),F=require("@uniformdev/design-system"),ce=se(require("react")),gt=require("react-use");var za=require("@emotion/react"),ut=require("@uniformdev/design-system"),qa=require("react-icons/cg");var Ae=require("@emotion/react/jsx-runtime"),Yt=({value:e,text:t,loading:a})=>(0,Ae.jsxs)(Ae.Fragment,{children:[!!t&&t,!t&&(0,Ae.jsxs)(Ae.Fragment,{children:[a&&`${e} (Loading...)`,!a&&`${e} (Unresolvable)`]})]});var pt=require("@emotion/react"),Ua=pt.css`
|
|
1
|
+
"use strict";var dn=Object.create;var dt=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var pn=Object.getOwnPropertyNames;var un=Object.getPrototypeOf,mn=Object.prototype.hasOwnProperty;var Ua=(e,t)=>{for(var r in t)dt(e,r,{get:t[r],enumerable:!0})},lt=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pn(t))!mn.call(e,o)&&o!==r&&dt(e,o,{get:()=>t[o],enumerable:!(a=cn(t,o))||a.enumerable});return e},se=(e,t,r)=>(lt(e,t,"default"),r&<(r,t,"default")),le=(e,t,r)=>(r=e!=null?dn(un(e)):{},lt(t||!e||!e.__esModule?dt(r,"default",{value:e,enumerable:!0}):r,e)),gn=e=>lt(dt({},"__esModule",{value:!0}),e);var ne={};Ua(ne,{AddListButton:()=>h.AddListButton,Button:()=>h.Button,Callout:()=>h.Callout,DamSelectedItem:()=>En,DataResourceVariablesList:()=>An,DataSourceEditor:()=>Wn,DataTypeEditor:()=>Qn,DefaultSearchRow:()=>gr,DefaultSelectedItem:()=>Rr,EntrySearch:()=>qr,Heading:()=>h.Heading,Icons:()=>ft,Input:()=>h.Input,InputComboBox:()=>h.InputComboBox,InputKeywordSearch:()=>h.InputKeywordSearch,InputSelect:()=>h.InputSelect,InputToggle:()=>h.InputToggle,InputVariables:()=>va,KeywordSearchInput:()=>h.InputKeywordSearch,Label:()=>h.Label,LoadingIndicator:()=>h.LoadingIndicator,LoadingOverlay:()=>h.LoadingOverlay,Menu:()=>h.Menu,MenuItem:()=>h.MenuItem,MeshApp:()=>Zn,ProductPreviewList:()=>nr,ProductQuery:()=>Vn,ProductQueryContext:()=>ar,ProductSearch:()=>In,ProductSearchContext:()=>jr,ProductSearchRow:()=>$r,ProductSelectedItem:()=>Jr,RequestBody:()=>On,RequestHeaders:()=>Gn,RequestMethodSelect:()=>Hn,RequestParameters:()=>Nn,RequestProvider:()=>it,RequestTypeContainer:()=>xa,RequestUrl:()=>Fn,RequestUrlInput:()=>$n,ResolvableLoadingValue:()=>tr,ScrollableList:()=>h.ScrollableList,ScrollableListItem:()=>h.ScrollableListItem,SelectionField:()=>rr,Switch:()=>h.Switch,TextVariableRenderer:()=>ha,Textarea:()=>h.Textarea,Theme:()=>h.Theme,UniformMeshLocationContext:()=>ma,UniformMeshLocationContextProvider:()=>tt,UniformMeshSdkContext:()=>et,UniformMeshSdkContextProvider:()=>Un,VariableEditor:()=>ga,VariablesList:()=>Bn,VariablesProvider:()=>at,badgeIcon:()=>Pt,createLocationValidator:()=>Jn,damSelectItemImage:()=>It,damSelectedItemContainer:()=>ea,damSelectedItemCopy:()=>aa,damSelectedItemDetails:()=>ra,damSelectedItemIcon:()=>na,damSelectedItemInfoBtn:()=>da,damSelectedItemInner:()=>ta,damSelectedItemLinkBtn:()=>_t,damSelectedItemLinkContainer:()=>sa,damSelectedItemMediaContainer:()=>la,damSelectedItemPopover:()=>ia,damSelectedItemPopoverLabel:()=>Je,damSelectedItemSmallText:()=>De,damSelectedItemTitle:()=>oa,draggableContainer:()=>Er,draggableIcon:()=>Rt,draggableIconOffset:()=>Ur,draggableIconWrapper:()=>Mr,entrySearchBtn:()=>Tr,entrySearchConfig:()=>Vr,entrySearchConfigHidden:()=>kr,entrySearchLoadMoreBtn:()=>Lr,entrySearchResultList:()=>Dr,entrySearchSelectIcon:()=>_r,entrySearchSelectImg:()=>Ir,entrySearchSelectInput:()=>kn,entrySearchSelectOption:()=>Dn,entrySearchWrapper:()=>Pr,productSearchRowActiveIcon:()=>Nr,productSearchRowCategory:()=>Gr,productSearchRowContainer:()=>Br,productSearchRowContent:()=>Ar,productSearchRowContentActive:()=>zr,productSearchRowDetails:()=>Hr,productSearchRowTitle:()=>Or,productSelectedItemContainer:()=>Kr,productSelectedItemContent:()=>Yr,productSelectedItemDetails:()=>Qr,productSelectedItemIcon:()=>Zr,productSelectedItemImage:()=>Tt,productSelectedItemLinkContainer:()=>Xr,productedSelectedItemLinkBtn:()=>Lt,productedSelectedItemSmallText:()=>Vt,searchRowBtn:()=>ur,searchRowContainer:()=>lr,searchRowContainerActive:()=>cr,searchRowContainerWithPopover:()=>dr,searchRowPopover:()=>pr,searchRowText:()=>xt,searchRowTextSmall:()=>bt,selectItemLinkBtn:()=>St,selectItemLinkContainer:()=>Sr,selectItemPopover:()=>wr,selectItemPopoverLabel:()=>Oe,selectItemSmallText:()=>be,selectedItemContainer:()=>fr,selectedItemCopy:()=>yr,selectedItemDetails:()=>hr,selectedItemIcon:()=>xr,selectedItemInner:()=>vr,selectedItemTitle:()=>br,urlEncodeRequestParameter:()=>Ra,urlEncodeRequestUrl:()=>Ca,useInitializeUniformMeshSdk:()=>La,useMeshLocation:()=>Ee,useProductQueryContext:()=>or,useProductSearchContext:()=>Xe,useRequest:()=>K,useUniformMeshLocation:()=>Xn,useUniformMeshLocationContext:()=>rt,useUniformMeshSdk:()=>ua,useUniformMeshSdkContext:()=>pa,useVariables:()=>ge,variablesToList:()=>nt});module.exports=gn(ne);var c=require("@emotion/react"),x=le(require("react"));var ft={};Ua(ft,{Caution:()=>qa,Checkmark:()=>ct,ChevronDown:()=>pt,Close:()=>Ba,Danger:()=>Aa,ExclamationPoint:()=>za,Info:()=>ut,Lightbulb:()=>Oa,MagnifyingGlass:()=>Ga,MaximizeAlt:()=>Ha,Minus:()=>mt,MoreVerticalAlt:()=>Ze,Plus:()=>gt});var Ft=require("@emotion/react/jsx-runtime"),fn=e=>(0,Ft.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:(0,Ft.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})}),qa=fn;var $t=require("@emotion/react/jsx-runtime"),vn=e=>(0,$t.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,$t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})}),ct=vn;var Wt=require("@emotion/react/jsx-runtime"),hn=e=>(0,Wt.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,Wt.jsx)("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})}),pt=hn;var Ae=require("@emotion/react/jsx-runtime"),yn=e=>(0,Ae.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:(0,Ae.jsxs)("g",{fillRule:"evenodd",children:[(0,Ae.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,Ae.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"})]})}),Ba=yn;var Kt=require("@emotion/react/jsx-runtime"),bn=e=>(0,Kt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,Kt.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})}),Aa=bn;var Qt=require("@emotion/react/jsx-runtime"),xn=e=>(0,Qt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:(0,Qt.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})}),za=xn;var Ye=require("@emotion/react/jsx-runtime"),wn=e=>(0,Ye.jsxs)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[(0,Ye.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),(0,Ye.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})]}),ut=wn;var Yt=require("@emotion/react/jsx-runtime"),Sn=e=>(0,Yt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,Yt.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})}),Oa=Sn;var de=require("@emotion/react/jsx-runtime"),Cn=e=>(0,de.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,de.jsxs)("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[(0,de.jsx)("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),(0,de.jsx)("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})]}),(0,de.jsx)("defs",{children:(0,de.jsx)("clipPath",{id:"magnifying-glass_svg__a",children:(0,de.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),Ga=Cn;var Zt=require("@emotion/react/jsx-runtime"),Rn=e=>(0,Zt.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,Zt.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})}),Ha=Rn;var Xt=require("@emotion/react/jsx-runtime"),Pn=e=>(0,Xt.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Xt.jsx)("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),mt=Pn;var Jt=require("@emotion/react/jsx-runtime"),Tn=e=>(0,Jt.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,Jt.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ze=Tn;var jt=require("@emotion/react/jsx-runtime"),Ln=e=>(0,jt.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,jt.jsx)("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})}),gt=Ln;var sr=require("@emotion/react"),io=require("@uniformdev/design-system");var er=require("@emotion/react/jsx-runtime");function te({src:e,alt:t,className:r}){let a=e&&typeof e!="string"?e:null;return a?(0,er.jsx)(a,{className:r}):(0,er.jsx)("img",{src:e,alt:t,className:r})}var z=require("@emotion/react"),$=require("@uniformdev/design-system"),pe=le(require("react")),yt=require("react-use");var Wa=require("@emotion/react"),ht=require("@uniformdev/design-system"),Ka=require("react-icons/cg");var ze=require("@emotion/react/jsx-runtime"),tr=({value:e,text:t,loading:r})=>(0,ze.jsxs)(ze.Fragment,{children:[!!t&&t,!t&&(0,ze.jsxs)(ze.Fragment,{children:[r&&`${e} (Loading...)`,!r&&`${e} (Unresolvable)`]})]});var vt=require("@emotion/react"),Na=vt.css`
|
|
2
2
|
align-items: center;
|
|
3
3
|
background: var(--gray-100);
|
|
4
4
|
border: 1px solid var(--gray-300);
|
|
@@ -7,66 +7,66 @@
|
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
margin-bottom: var(--spacing-sm);
|
|
9
9
|
margin-right: var(--spacing-sm);
|
|
10
|
-
`,
|
|
10
|
+
`,Fa=vt.css`
|
|
11
11
|
color: var(--gray-800);
|
|
12
12
|
padding: var(--spacing-3);
|
|
13
|
-
|
|
13
|
+
`,$a=vt.css`
|
|
14
14
|
border: none;
|
|
15
15
|
border-left: 1px solid var(--gray-300);
|
|
16
16
|
background: var(--gray-100);
|
|
17
17
|
padding: var(--spacing-3);
|
|
18
|
-
`;var
|
|
18
|
+
`;var ce=require("@emotion/react/jsx-runtime"),rr=({id:e,label:t,loading:r,selectedValues:a,values:o,onAdd:i,onRemove:n})=>{var p;let s=(p=o==null?void 0:o.filter(d=>!(a!=null&&a.includes(d.id.toString()))))!=null?p:[],l=(d,u)=>{d.preventDefault(),n(u)};return(0,ce.jsxs)("div",{children:[(0,ce.jsx)(ht.InputSelect,{id:e,name:e,label:t,onChange:d=>i(d.target.value),disabled:r,options:[{value:"",label:"Add..."},...s.map(d=>({value:d.id,label:d.name||d.id}))],value:"",css:Array.isArray(a)&&a.length>0?Wa.css`
|
|
19
19
|
margin-bottom: var(--spacing-base);
|
|
20
|
-
`:""}),
|
|
20
|
+
`:""}),a==null?void 0:a.map(d=>{var u;return(0,ce.jsxs)("div",{css:Na,children:[(0,ce.jsx)("span",{css:Fa,children:(0,ce.jsx)(tr,{value:d,loading:r,text:(u=o.find(y=>y.id===d))==null?void 0:u.name})}),(0,ce.jsx)("button",{css:$a,title:"remove",onClick:y=>l(y,d),children:(0,ce.jsx)(ht.Icon,{icon:Ka.CgClose,iconColor:"currentColor",size:20})})]},d)})]})};var C=require("@emotion/react/jsx-runtime"),Qa={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Vn=({value:e,setValue:t,brands:r,categories:a,loading:o,categoriesLoading:i,brandsLoading:n,logoIcon:s,onGetProducts:l,sortOptions:p,sortOrderOptions:d,categoryLabel:u="Product Category",brandLabel:y="Brand",disableBrands:f,restrictToSingleCategory:P=!1})=>{var N,b,Q;let w=async m=>{t({...Qa,...e||{},...m})},T=(0,pe.useMemo)(()=>({...Qa,...e||{}}),[e]),[Be,Ke]=(0,yt.useAsyncFn)(async m=>await l(m),[l]);(0,yt.useDebounce)(async()=>{await Ke({brand:T.brand,categories:T.categories,keyword:T.keyword,sort:T.sort,sortOrder:T.sortOrder,count:T.count})},250,[T]);let ee=(0,pe.useMemo)(()=>{let m=[];return a==null||a.forEach(Z=>{let B=Za(Z,void 0);m.push(...B)}),m},[a]),ve=(0,pe.useMemo)(()=>[{value:"",label:"All categories"},...ee.map(m=>({label:m.name,value:m.id}))],[ee]),ie=(0,pe.useMemo)(()=>(r==null?void 0:r.map(m=>({id:m.id.toString(),name:m.name})))||[],[r]),Qe=m=>{if(!m)return;let Z=(e==null?void 0:e.categories)||[];w({categories:[...Z,m]})},st=m=>{var Z;w({categories:(Z=e==null?void 0:e.categories)==null?void 0:Z.filter(B=>B!==m)})},Re=m=>{w({brand:m.target.value})},H=m=>{w({count:m||1})};return o?(0,C.jsx)("div",{children:"Loading..."}):(0,C.jsx)(ar.Provider,{value:{categories:a,logoIcon:s},children:(0,C.jsxs)("div",{css:z.css`
|
|
21
21
|
> :not(:last-child) {
|
|
22
22
|
margin-bottom: var(--spacing-md);
|
|
23
23
|
}
|
|
24
|
-
`,children:[
|
|
24
|
+
`,children:[P?(0,C.jsx)($.InputSelect,{id:"selection-field-product-category",label:u,disabled:o,value:(b=(N=T.categories)==null?void 0:N[0])!=null?b:"",options:ve,onChange:m=>{w({categories:m.target.value===""?[]:[m.target.value]})}}):(0,C.jsx)(rr,{loading:i||!1,id:"selection-field-product-category",label:u,onAdd:Qe,onRemove:st,selectedValues:T.categories,values:ee}),(0,C.jsxs)("div",{css:z.css`
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-wrap: wrap;
|
|
27
27
|
column-gap: var(--spacing-lg);
|
|
28
28
|
row-gap: var(--spacing-md);
|
|
29
|
-
${(0
|
|
29
|
+
${(0,$.mq)("md")} {
|
|
30
30
|
flex-wrap: nowrap;
|
|
31
31
|
}
|
|
32
|
-
`,children:[
|
|
32
|
+
`,children:[f?null:(0,C.jsx)("div",{css:z.css`
|
|
33
33
|
width: 50%;
|
|
34
|
-
`,children:(0,C.jsx)(
|
|
34
|
+
`,children:(0,C.jsx)($.InputSelect,{id:"brand",name:"brand",label:y,disabled:n,value:T.brand,onChange:Re,options:[{value:"",label:"Choose..."},...ie.map(m=>({value:m.id,label:m.name}))]})}),(0,C.jsx)("div",{css:z.css`
|
|
35
35
|
flex-grow: 1;
|
|
36
36
|
position: relative;
|
|
37
|
-
`,children:(0,C.jsx)(
|
|
37
|
+
`,children:(0,C.jsx)($.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:T.keyword,placeholder:"Enter keyword",onChange:m=>w({keyword:m.target.value})})})]}),(0,C.jsxs)("div",{css:z.css`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-wrap: wrap;
|
|
40
40
|
column-gap: var(--spacing-lg);
|
|
41
41
|
row-gap: var(--spacing-md);
|
|
42
|
-
${(0
|
|
42
|
+
${(0,$.mq)("md")} {
|
|
43
43
|
flex-wrap: nowrap;
|
|
44
44
|
}
|
|
45
|
-
`,children:[(0,C.jsxs)("div",{css:
|
|
45
|
+
`,children:[(0,C.jsxs)("div",{css:z.css`
|
|
46
46
|
width: 100%;
|
|
47
|
-
${(0
|
|
47
|
+
${(0,$.mq)("md")} {
|
|
48
48
|
width: 33.333333%;
|
|
49
49
|
}
|
|
50
50
|
position: relative;
|
|
51
|
-
`,children:[(0,C.jsx)(
|
|
51
|
+
`,children:[(0,C.jsx)($.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:T.count,onChange:m=>H(m.target.valueAsNumber),label:"Count"}),(0,C.jsxs)("div",{css:z.css`
|
|
52
52
|
position: absolute;
|
|
53
53
|
bottom: var(--spacing-sm);
|
|
54
54
|
right: var(--spacing-sm);
|
|
55
55
|
display: flex;
|
|
56
56
|
gap: var(--spacing-sm);
|
|
57
|
-
`,children:[(0,C.jsx)(
|
|
57
|
+
`,children:[(0,C.jsx)(Ya,{onCountChange:()=>H(T.count-1),countIcon:"decrement",disabled:T.count===1}),(0,C.jsx)(Ya,{onCountChange:()=>H(T.count+1),countIcon:"increment"})]})]}),Array.isArray(p)&&p.length>0?(0,C.jsx)("div",{css:z.css`
|
|
58
58
|
flex-grow: 1;
|
|
59
|
-
${(0
|
|
59
|
+
${(0,$.mq)("md")} {
|
|
60
60
|
width: 33.333333%;
|
|
61
61
|
}
|
|
62
|
-
`,children:(0,C.jsx)(
|
|
62
|
+
`,children:(0,C.jsx)($.InputSelect,{id:"sort",name:"sort",label:"Sort",value:T.sort,onChange:m=>w({sort:m.target.value}),options:[{value:"",label:"Select a sort"},...p.map(m=>({value:m.sortKey,label:m.name}))]})}):null,Array.isArray(d)&&d.length>0?(0,C.jsx)("div",{css:z.css`
|
|
63
63
|
flex-grow: 1;
|
|
64
|
-
`,children:(0,C.jsx)(
|
|
64
|
+
`,children:(0,C.jsx)($.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:T.sortOrder,onChange:m=>w({sortOrder:m.target.value}),options:d.map(m=>({value:m.sortOrderKey,label:m.name}))})}):null]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("h3",{css:z.css`
|
|
65
65
|
font-size: var(--fs-md);
|
|
66
66
|
line-height: var(--spacing-md);
|
|
67
67
|
font-weight: var(--fw-bold);
|
|
68
68
|
margin-bottom: var(--spacing-xs);
|
|
69
|
-
`,children:"Result Preview"}),(0,C.jsx)(
|
|
69
|
+
`,children:"Result Preview"}),(0,C.jsx)(nr,{products:(Q=Be.value)==null?void 0:Q.products})]})]})})};function Za(e,t){var i;let r=[],a=t?`${t.name} > `:"",o={id:e.id.toString(),name:`${a}${e.name}`};return r.push(o),(i=e.children)==null||i.forEach(n=>{let s=Za(n,o);r.push(...s)}),r}function Ya({onCountChange:e,countIcon:t,disabled:r}){return(0,C.jsx)("button",{css:z.css`
|
|
70
70
|
width: 2.25rem;
|
|
71
71
|
height: 2.25rem;
|
|
72
72
|
border: 1px solid var(--gray-300);
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
&:hover {
|
|
79
79
|
background-color: var(--gray-200);
|
|
80
80
|
}
|
|
81
|
-
${
|
|
81
|
+
${r?z.css`
|
|
82
82
|
cursor: not-allowed;
|
|
83
83
|
opacity: 0.3;
|
|
84
84
|
`:""}
|
|
85
|
-
`,onClick:e,disabled:
|
|
85
|
+
`,onClick:e,disabled:r,children:t==="increment"?(0,C.jsx)(gt,{css:z.css`
|
|
86
86
|
width: 1rem;
|
|
87
87
|
height: 1rem;
|
|
88
|
-
`}):(0,C.jsx)(
|
|
88
|
+
`}):(0,C.jsx)(mt,{css:z.css`
|
|
89
89
|
width: 1rem;
|
|
90
90
|
height: 1rem;
|
|
91
|
-
`})})}var
|
|
91
|
+
`})})}var ar=pe.default.createContext(void 0),or=()=>{let e=(0,pe.useContext)(ar);if(!e)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return e};var X=require("@emotion/react"),Xa=X.css`
|
|
92
92
|
align-items: center;
|
|
93
93
|
background: var(--white);
|
|
94
94
|
border-radius: var(--rounded-base);
|
|
@@ -103,65 +103,65 @@
|
|
|
103
103
|
&:hover {
|
|
104
104
|
background: var(--gray-50);
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
`,Ja=X.css`
|
|
107
107
|
font-size: var(--fs-sm);
|
|
108
|
-
`,
|
|
108
|
+
`,ja=X.css`
|
|
109
109
|
width: 1rem;
|
|
110
110
|
height: 1rem;
|
|
111
|
-
`,
|
|
111
|
+
`,ir=X.css`
|
|
112
112
|
margin-right: var(--spacing-lg);
|
|
113
113
|
font-size: var(--fs-sm);
|
|
114
|
-
`,
|
|
114
|
+
`,eo=X.css`
|
|
115
115
|
border: 1px solid var(--gray-200);
|
|
116
116
|
border-radius: var(--rounded-md);
|
|
117
117
|
background: var(--gray-50);
|
|
118
118
|
margin: var(--spacing-base) 0;
|
|
119
|
-
`,
|
|
119
|
+
`,to=X.css`
|
|
120
120
|
align-items: center;
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-grow: 1;
|
|
123
123
|
gap: var(--spacing-base);
|
|
124
124
|
padding: var(--spacing-sm);
|
|
125
125
|
margin-right: var(--spacing-sm);
|
|
126
|
-
`,
|
|
126
|
+
`,ro=X.css`
|
|
127
127
|
background: var(--gray-200);
|
|
128
128
|
width: 3.5rem;
|
|
129
129
|
height: 3.5rem;
|
|
130
130
|
object-fit: cover;
|
|
131
|
-
`,
|
|
131
|
+
`,ao=X.css`
|
|
132
132
|
background: var(--gray-100);
|
|
133
133
|
height: 3.5rem;
|
|
134
134
|
width: 3.5rem;
|
|
135
|
-
`,
|
|
135
|
+
`,oo=X.css`
|
|
136
136
|
margin-top: 0;
|
|
137
137
|
font-weight: var(--fw-bold);
|
|
138
138
|
font-size: var(--fs-sm);
|
|
139
139
|
width: calc(100% / 3);
|
|
140
|
-
`,
|
|
140
|
+
`,no=X.css`
|
|
141
141
|
display: block;
|
|
142
142
|
font-weight: var(--fw-regular);
|
|
143
|
-
`;var U=require("@emotion/react/jsx-runtime"),
|
|
143
|
+
`;var U=require("@emotion/react/jsx-runtime"),nr=({products:e})=>{let{categories:t,logoIcon:r}=or();return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("p",{css:sr.css`
|
|
144
144
|
margin-bottom: var(--spacing-base);
|
|
145
|
-
`,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),(0,U.jsx)("ul",{css:[
|
|
145
|
+
`,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),(0,U.jsx)("ul",{css:[sr.css`
|
|
146
146
|
max-height: 24rem;
|
|
147
147
|
overflow-x: auto;
|
|
148
|
-
`,
|
|
148
|
+
`,io.scrollbarStyles],children:e==null?void 0:e.map((a,o)=>{var s,l;let[i]=(a==null?void 0:a.categories)||[],n=typeof i=="undefined"||!t||(s=t.find(p=>p.id===i.id))==null?void 0:s.name;return(0,U.jsx)("li",{css:eo,children:(0,U.jsxs)("div",{css:to,"data-test-id":`product-item-${a.sku||a.id}`,children:[a.thumbnailUrl?(0,U.jsx)("img",{src:a.thumbnailUrl,alt:typeof a.title=="string"?a.title:a.name||`Product ${o}`,css:ro,"data-test-id":"product-image"}):(0,U.jsx)("div",{css:ao}),(0,U.jsxs)("h4",{css:oo,"data-test-id":"product-name",children:[a.title||a.name,n&&(0,U.jsx)("span",{css:no,children:n})]}),a&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)("p",{css:ir,"data-test-id":"product-sku",children:["SKU: ",a.sku||a.id,(0,U.jsx)("br",{})]}),a.price!==void 0?(0,U.jsxs)("p",{css:ir,"data-test-id":"product-price",children:["Price: ",a.price]}):null,a.editLink||a.url?(0,U.jsxs)("a",{css:Xa,href:(l=a.editLink)!=null?l:a.url,title:`Go to ${a.title||a.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[(0,U.jsx)("span",{css:Ja,children:"Edit"}),r?(0,U.jsx)(te,{src:r,alt:"Logo",css:ja}):null]}):null]})]})},`product-${a.id}`)})})]})};var go=require("@uniformdev/design-system"),we=le(require("react")),Dt=require("react-use");var mr=require("@emotion/react"),Te=require("react");var ye=require("@emotion/react"),lr=ye.css`
|
|
149
149
|
cursor: pointer;
|
|
150
150
|
padding: var(--spacing-sm);
|
|
151
151
|
position: relative;
|
|
152
152
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
153
153
|
color var(--duration-fast) var(--timing-ease-out);
|
|
154
|
-
`,
|
|
154
|
+
`,dr=ye.css`
|
|
155
155
|
padding-right: var(--spacing-lg);
|
|
156
|
-
`,
|
|
156
|
+
`,cr=ye.css`
|
|
157
157
|
background: var(--brand-secondary-3);
|
|
158
158
|
color: var(--white);
|
|
159
|
-
`,
|
|
159
|
+
`,bt=ye.css`
|
|
160
160
|
font-size: var(--fs-xs);
|
|
161
|
-
`,
|
|
161
|
+
`,xt=ye.css`
|
|
162
162
|
font-weight: var(--fw-bold);
|
|
163
163
|
margin-right: var(--spacing-sm);
|
|
164
|
-
`,
|
|
164
|
+
`,pr=ye.css`
|
|
165
165
|
background: var(--white);
|
|
166
166
|
border-left: 4px solid var(--brand-secondary-3);
|
|
167
167
|
border-radius: var(--rounded-base);
|
|
@@ -173,20 +173,20 @@
|
|
|
173
173
|
right: var(--spacing-xl);
|
|
174
174
|
z-index: var(--z-10);
|
|
175
175
|
width: max-content;
|
|
176
|
-
`,
|
|
176
|
+
`,ur=ye.css`
|
|
177
177
|
position: absolute;
|
|
178
178
|
inset: 0 var(--spacing-sm) 0 auto;
|
|
179
|
-
`;var W=require("@emotion/react/jsx-runtime"),
|
|
179
|
+
`;var W=require("@emotion/react/jsx-runtime"),gr=({result:e,isSelected:t,triggerSelection:r})=>{let a=(0,Te.useRef)(null),o=(0,Te.useRef)(null),[i,n]=(0,Te.useState)(!1);(0,Te.useEffect)(()=>{function l(p){a.current&&!a.current.contains(p.target)&&o.current&&!o.current.contains(p.target)&&n(!1)}return document.addEventListener("mousedown",l),()=>{document.removeEventListener("mousedown",l)}},[o]);let s=l=>{l.stopPropagation(),n(!i)};return(0,W.jsxs)("div",{css:[lr,t?cr:void 0,e.popoverData?dr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>r(),children:[e.title,e.popoverData&&t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("button",{type:"button",ref:a,css:ur,"aria-controls":"path-details",onClick:l=>s(l),"aria-expanded":i,children:(0,W.jsx)(ut,{width:24,height:24})}),(0,W.jsxs)("div",{id:"path-details","aria-hidden":!i,ref:o,css:[pr,i?mr.css`
|
|
180
180
|
visibility: visible;
|
|
181
|
-
`:
|
|
181
|
+
`:mr.css`
|
|
182
182
|
visibility: hidden;
|
|
183
|
-
`],children:[e.metadata&&Object.entries(e.metadata).map(([
|
|
183
|
+
`],children:[e.metadata&&Object.entries(e.metadata).map(([l,p],d)=>(0,W.jsxs)("div",{css:bt,children:[(0,W.jsxs)("span",{css:xt,children:[l,":"]}),p]},d)),Object.entries(e.popoverData).map(([l,p],d)=>(0,W.jsxs)("div",{css:bt,children:[(0,W.jsxs)("span",{css:xt,children:[l,":"]}),p]},d))]})]}):null]},e.id)};var ue=require("@emotion/react"),Cr=require("@uniformdev/design-system"),Le=require("react"),Ct=require("react-icons/cg"),lo=require("timeago.js");function wt(e,t){let r=window.open(e,"_blank"),a=setInterval(()=>{r!=null&&r.closed&&(clearInterval(a),t())},500)}var Y=require("@emotion/react"),so=require("@uniformdev/design-system"),fr=Y.css`
|
|
184
184
|
border: 1px solid var(--gray-200);
|
|
185
185
|
background: var(--gray-50);
|
|
186
186
|
border-radius: var(--rounded-base);
|
|
187
187
|
display: flex;
|
|
188
188
|
width: 100%;
|
|
189
|
-
`,
|
|
189
|
+
`,vr=Y.css`
|
|
190
190
|
align-items: center;
|
|
191
191
|
display: flex;
|
|
192
192
|
flex-grow: 1;
|
|
@@ -194,22 +194,22 @@
|
|
|
194
194
|
margin-inline: 0 var(--spacing-sm);
|
|
195
195
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
196
196
|
position: relative;
|
|
197
|
-
`,
|
|
197
|
+
`,hr=Y.css`
|
|
198
198
|
flex-grow: 1;
|
|
199
|
-
`,
|
|
199
|
+
`,yr=Y.css`
|
|
200
200
|
align-items: start;
|
|
201
201
|
display: inline-flex;
|
|
202
202
|
position: relative;
|
|
203
|
-
`,
|
|
203
|
+
`,br=Y.css`
|
|
204
204
|
color: var(--brand-secondary-1);
|
|
205
205
|
font-size: var(--fs-base);
|
|
206
206
|
font-weight: var(--fw-bold);
|
|
207
207
|
line-height: 1;
|
|
208
208
|
margin: 0;
|
|
209
|
-
`,
|
|
209
|
+
`,xr=Y.css`
|
|
210
210
|
width: 1.5rem;
|
|
211
211
|
height: 1.5rem;
|
|
212
|
-
`,
|
|
212
|
+
`,wr=Y.css`
|
|
213
213
|
background: var(--white);
|
|
214
214
|
border-radius: var(--rounded-base);
|
|
215
215
|
border-left: 4px solid var(--brand-secondary-3);
|
|
@@ -220,20 +220,20 @@
|
|
|
220
220
|
width: max-content;
|
|
221
221
|
`,be=Y.css`
|
|
222
222
|
font-size: var(--fs-sm);
|
|
223
|
-
`,
|
|
223
|
+
`,Oe=Y.css`
|
|
224
224
|
font-weight: var(--fw-bold);
|
|
225
225
|
margin-right: var(--spacing-sm);
|
|
226
|
-
`,
|
|
226
|
+
`,Sr=Y.css`
|
|
227
227
|
display: flex;
|
|
228
228
|
flex-direction: column;
|
|
229
229
|
gap: var(--spacing-sm);
|
|
230
230
|
|
|
231
|
-
${(0,
|
|
231
|
+
${(0,so.mq)("md")} {
|
|
232
232
|
flex-direction: row;
|
|
233
233
|
min-width: 200px;
|
|
234
234
|
justify-content: end;
|
|
235
235
|
}
|
|
236
|
-
`,
|
|
236
|
+
`,St=Y.css`
|
|
237
237
|
align-items: center;
|
|
238
238
|
background: var(--white);
|
|
239
239
|
border-radius: var(--rounded-base);
|
|
@@ -248,29 +248,29 @@
|
|
|
248
248
|
&:hover {
|
|
249
249
|
background: var(--gray-50);
|
|
250
250
|
}
|
|
251
|
-
`;var R=require("@emotion/react/jsx-runtime"),
|
|
251
|
+
`;var R=require("@emotion/react/jsx-runtime"),Rr=({selectedItem:e,logoIcon:t,onDeselect:r,onEditClosed:a})=>{var p;let o=(0,Le.useRef)(null),i=(0,Le.useRef)(null),[n,s]=(0,Le.useState)(!1);(0,Le.useEffect)(()=>{let d=y=>{o.current&&!o.current.contains(y.target)&&i.current&&!i.current.contains(y.target)&&s(!1)},u=()=>{s(!1)};return window.addEventListener("resize",u,!0),document.addEventListener("scroll",d,!0),document.addEventListener("mousedown",d),()=>{window.removeEventListener("resize",u,!0),document.removeEventListener("scroll",d,!0),document.removeEventListener("mousedown",d)}},[i]);let l=()=>{var d;if(s(!n),i.current&&o.current){let u=(d=o==null?void 0:o.current)==null?void 0:d.getBoundingClientRect(),y=i.current.offsetWidth;i.current.style.top=`${u.top+30}px`,i.current.style.left=`${u.left-y+30}px`}};return(0,R.jsx)("div",{css:fr,children:(0,R.jsxs)("div",{css:vr,children:[(0,R.jsxs)("div",{css:hr,children:[(0,R.jsxs)("div",{css:yr,children:[(0,R.jsx)("h4",{css:[br,e.popoverData?ue.css`
|
|
252
252
|
margin-bottom: var(--spacing-sm);
|
|
253
|
-
`:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("button",{type:"button",ref:
|
|
253
|
+
`:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("button",{type:"button",ref:o,css:ue.css`
|
|
254
254
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
255
|
-
`,"aria-controls":"path-details","aria-expanded":
|
|
255
|
+
`,"aria-controls":"path-details","aria-expanded":n,onClick:l,children:(0,R.jsx)(Cr.Icon,{icon:Ct.CgInfo,iconColor:"gray",size:24,css:ue.css`
|
|
256
256
|
opacity: var(--opacity-75);
|
|
257
|
-
`})}),(0,R.jsx)("div",{id:"path-details","aria-hidden":!
|
|
257
|
+
`})}),(0,R.jsx)("div",{id:"path-details","aria-hidden":!n,ref:i,css:[wr,n?ue.css`
|
|
258
258
|
visibility: visible;
|
|
259
|
-
`:
|
|
259
|
+
`:ue.css`
|
|
260
260
|
visibility: hidden;
|
|
261
|
-
`],children:Object.entries(e.popoverData).map(([
|
|
261
|
+
`],children:Object.entries(e.popoverData).map(([d,u],y)=>(0,R.jsxs)("div",{css:be,children:[(0,R.jsxs)("span",{css:Oe,children:[d,":"]}),u]},y))})]}):null]}),e.createdDate&&(0,R.jsxs)("div",{css:be,children:[(0,R.jsx)("span",{css:Oe,children:"Created:"}),(0,lo.format)((p=e.createdDate)!=null?p:0)]}),e.metadata?Object.entries(e.metadata).filter(([d])=>["type","status"].includes(d.toLocaleLowerCase())).map(([d,u])=>(0,R.jsxs)("div",{css:[be,ue.css`
|
|
262
262
|
order: 1;
|
|
263
|
-
`],children:[(0,R.jsxs)("span",{css:
|
|
263
|
+
`],children:[(0,R.jsxs)("span",{css:Oe,children:[d,":"]}),u]},d)):null,e.metadata?Object.entries(e.metadata).filter(([d])=>!["type","status"].includes(d.toLocaleLowerCase())).map(([d,u])=>(0,R.jsxs)("div",{css:[be,ue.css`
|
|
264
264
|
order: 1;
|
|
265
|
-
`],children:[(0,R.jsxs)("span",{css:[
|
|
265
|
+
`],children:[(0,R.jsxs)("span",{css:[Oe,ue.css`
|
|
266
266
|
order: 1;
|
|
267
|
-
`],children:[
|
|
267
|
+
`],children:[d,":"]}),u]},d)):null]}),(0,R.jsxs)("div",{css:Sr,children:[e.editLink?(0,R.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:d=>{a&&(wt(d.currentTarget.href,()=>a(e)),d.preventDefault())},css:St,children:[(0,R.jsx)("span",{css:be,children:"Edit"}),(0,R.jsx)(te,{src:t,css:xr,alt:"Logo"})]}):null,(0,R.jsxs)("button",{type:"button",onClick:()=>{r(e)},css:St,children:[(0,R.jsx)("span",{css:be,children:"Unlink"}),(0,R.jsx)(Cr.Icon,{icon:Ct.CgClose,iconColor:"red",size:16})]})]})]})},e.id)};var J=require("@emotion/react"),q=require("@uniformdev/design-system"),re=le(require("react")),Ge=require("react-beautiful-dnd"),po=require("react-use"),uo=require("uuid");var Ve=require("react");function co(e,{delay:t=500,minDuration:r=200}={delay:500,minDuration:200}){let[a,o]=(0,Ve.useState)("IDLE"),i=(0,Ve.useRef)(void 0);return(0,Ve.useEffect)(()=>{e&&a==="IDLE"&&(clearTimeout(i.current),i.current=setTimeout(()=>{if(!e)return o("IDLE");i.current=setTimeout(()=>{o("EXPIRE")},r),o("DISPLAY")},t),o("DELAY")),!e&&a!=="DISPLAY"&&(clearTimeout(i.current),o("IDLE"))},[e,a,t,r]),(0,Ve.useEffect)(()=>()=>clearTimeout(i.current),[]),a==="DISPLAY"||a==="EXPIRE"}var A=require("@emotion/react"),Pr=A.css`
|
|
268
268
|
background: var(--white);
|
|
269
269
|
border: 1px solid var(--gray-300);
|
|
270
270
|
border-radius: var(--rounded-base);
|
|
271
271
|
padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
|
|
272
272
|
margin-bottom: var(--spacing-base);
|
|
273
|
-
`,
|
|
273
|
+
`,Tr=A.css`
|
|
274
274
|
align-items: center;
|
|
275
275
|
display: flex;
|
|
276
276
|
position: relative;
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
width: 100%;
|
|
279
279
|
background-color: transparent;
|
|
280
280
|
border: 0;
|
|
281
|
-
`,
|
|
281
|
+
`,Lr=A.css`
|
|
282
282
|
color: var(--brand-secondary-1);
|
|
283
283
|
display: block;
|
|
284
284
|
font-weight: var(--fw-bold);
|
|
@@ -294,15 +294,15 @@
|
|
|
294
294
|
background: var(--gray-100);
|
|
295
295
|
outline: none;
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`,Vr=A.css`
|
|
298
298
|
background: var(--white);
|
|
299
299
|
border: 1px solid var(--gray-300);
|
|
300
300
|
border-radius: var(--rounded-base);
|
|
301
301
|
padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
|
|
302
302
|
display: block;
|
|
303
|
-
`,
|
|
303
|
+
`,kr=A.css`
|
|
304
304
|
display: none;
|
|
305
|
-
`,
|
|
305
|
+
`,Dr=A.css`
|
|
306
306
|
overflow-y: auto;
|
|
307
307
|
height: 16rem;
|
|
308
308
|
margin-bottom: var(--spacing-base);
|
|
@@ -311,26 +311,26 @@
|
|
|
311
311
|
& > :not(:last-child) {
|
|
312
312
|
border-bottom: 1px solid var(--gray-200);
|
|
313
313
|
}
|
|
314
|
-
`,
|
|
314
|
+
`,kn=A.css`
|
|
315
315
|
background-color: var(--gray-50);
|
|
316
316
|
max-width: 33.33%;
|
|
317
|
-
`,
|
|
317
|
+
`,_r=A.css`
|
|
318
318
|
align-items: center;
|
|
319
319
|
display: flex;
|
|
320
320
|
position: absolute;
|
|
321
321
|
inset: 0 0 0 auto;
|
|
322
322
|
pointer-events: none;
|
|
323
323
|
padding-right: var(--spacing-sm);
|
|
324
|
-
`,
|
|
324
|
+
`,Ir=A.css`
|
|
325
325
|
color: var(--brand-secondary-1);
|
|
326
326
|
width: 1.25rem;
|
|
327
327
|
height: 1.25rem;
|
|
328
328
|
transition: transform var(--duration-fast) var(--timing-ease-out);
|
|
329
329
|
transform: rotate(0);
|
|
330
|
-
`,
|
|
330
|
+
`,Dn=A.css`
|
|
331
331
|
background: var(--white);
|
|
332
332
|
color: var(--brand-secondary-1);
|
|
333
|
-
`,
|
|
333
|
+
`,Er=A.css`
|
|
334
334
|
position: relative;
|
|
335
335
|
margin-block: var(--spacing-sm) 0;
|
|
336
336
|
|
|
@@ -342,96 +342,96 @@
|
|
|
342
342
|
left: auto !important;
|
|
343
343
|
top: auto !important;
|
|
344
344
|
}
|
|
345
|
-
`,
|
|
345
|
+
`,Mr=A.css`
|
|
346
346
|
align-items: center;
|
|
347
347
|
display: flex;
|
|
348
348
|
position: absolute;
|
|
349
349
|
inset: 0 auto 0 0;
|
|
350
350
|
margin-block: auto;
|
|
351
351
|
opacity: 0;
|
|
352
|
-
`,
|
|
352
|
+
`,Rt=A.css`
|
|
353
353
|
color: var(--brand-secondary-1);
|
|
354
|
-
`,
|
|
354
|
+
`,Ur=A.css`
|
|
355
355
|
position: absolute;
|
|
356
356
|
left: 0.375rem;
|
|
357
|
-
`,
|
|
357
|
+
`,Pt=A.css`
|
|
358
358
|
width: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
359
359
|
height: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
360
|
-
`;var
|
|
360
|
+
`;var v=require("@emotion/react/jsx-runtime"),_n=({searchText:e,selectedContentType:t})=>{let r="No content found";return t&&t!=="any"&&(r=`No ${t} content was found`),e&&(r=`${r} for keyword '${e}'.`),(0,v.jsx)(q.Callout,{type:"info",children:r})},qr=({search:e,results:t,contentTypes:r,selectedItems:a,logoIcon:o,select:i,multiSelect:n,multiSelectId:s,rowComponent:l,selectedItemComponent:p,totalResults:d,cursor:u,resultsLoading:y,requireContentType:f,onAddNew:P,onEditClosed:w,onCancel:T,noResultsComponent:Be,helpComponent:Ke,onSort:ee,typeSelectorLabel:ve="Content Type Select",typeSelectorAllTypesOptionText:ie="All content types",loadingIndicatorDelay:Qe=1e3})=>{var Ia,Ea,Ma;let Re=()=>f?Array.isArray(r)&&r.length>0?r[0].id:"":"any",[H,N]=re.useState(""),[b,Q]=re.useState(Re),[m,Z]=re.useState(!1),[B,Pe]=re.useState([]),[Qo,Va]=re.useState(!1),Gt=re.useRef(`x${(0,uo.v4)()}`);(0,po.useDebounce)(()=>{e(H,{count:5,offset:0,contentType:b==="any"?void 0:b})},300,[H,b]);let Yo=co(y,{delay:Qe}),Zo=g=>{B.some(L=>L.id===g.id)?Pe(L=>L.filter(he=>he.id!==g.id)):Pe(n?L=>[...L,g]:[g])},Xo=a==null?void 0:a.map(g=>g.id+g.title).join(",");re.useEffect(()=>{Array.isArray(a)&&Pe(a)},[Xo]);let Jo=()=>{Q(Re()),N(""),Pe(a!=null&&a.length?a:[])},jo=()=>{Z(g=>!g),m||Jo()},ka=g=>{let L=(B==null?void 0:B.filter(he=>he.id!==g.id))||[];Pe(L),i(L,"")},en=g=>{g.preventDefault(),i(B,b),Z(!1)},tn=g=>{g.preventDefault(),Z(!1),T&&T()},rn=()=>{e(H,{count:5,offset:(t==null?void 0:t.length)||0,contentType:b==="any"?void 0:b,cursor:u}),Va(!0);let g=setTimeout(()=>{Va(!1)},750);return()=>clearTimeout(g)},an=!(a==null?void 0:a.length)||n,on=l||gr,Da=p||Rr,nn=Be||_n,_a=o&&typeof o!="string"?o:null,sn=_a?(0,v.jsx)(_a,{css:Pt}):(0,v.jsx)("img",{src:o,alt:"Logo",css:Pt}),ln=g=>{var L,he;if(g.destination&&g.source.droppableId===((L=g.destination)==null?void 0:L.droppableId)){let F=[...a||[]],[Ht]=(he=F==null?void 0:F.splice(g.source.index,1))!=null?he:[];return F==null||F.splice(g.destination.index,0,Ht),ee&&(Pe(F),ee==null||ee(F)),F}};return(0,v.jsx)("div",{css:J.css`
|
|
361
361
|
width: 100%;
|
|
362
|
-
`,children:(0,
|
|
362
|
+
`,children:(0,v.jsxs)("div",{css:J.css`
|
|
363
363
|
position: relative;
|
|
364
364
|
margin-block: var(--spacing-base);
|
|
365
|
-
`,children:[
|
|
365
|
+
`,children:[an?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{css:Pr,"data-test-id":"component-search",children:(0,v.jsxs)("button",{css:Tr,onClick:jo,type:"button","aria-haspopup":!0,"aria-expanded":m,"aria-controls":`entry-search-config-${Gt.current}`,children:[sn,(0,v.jsx)("span",{css:J.css`
|
|
366
366
|
margin-left: var(--spacing-base);
|
|
367
|
-
`,children:"Select"}),(0,
|
|
367
|
+
`,children:"Select"}),(0,v.jsx)("span",{css:_r,children:(0,v.jsx)(pt,{css:[Ir,m?J.css`
|
|
368
368
|
transform: rotate(180deg);
|
|
369
|
-
`:void 0]})})]})}),(0,
|
|
369
|
+
`:void 0]})})]})}),(0,v.jsxs)("div",{id:`entry-search-config-${Gt.current}`,"aria-hidden":!m,css:[Vr,m?void 0:kr],children:[Ke||null,(0,v.jsxs)("div",{css:J.css`
|
|
370
370
|
display: flex;
|
|
371
371
|
gap: calc(var(--spacing-base) - 0.25rem);
|
|
372
372
|
margin-bottom: var(--spacing-base);
|
|
373
|
-
`,children:[(0,
|
|
373
|
+
`,children:[(0,v.jsx)(q.InputSelect,{onChange:g=>Q(g.target.value),value:b,label:ve,showLabel:!1,options:[...f?[]:[{value:"any",label:ie}],...r?r.map(g=>({value:g.id,label:g.name})):[]]}),(0,v.jsx)("div",{css:J.css`
|
|
374
374
|
flex-grow: 1;
|
|
375
|
-
`,children:(0,
|
|
375
|
+
`,children:(0,v.jsx)(q.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:N,disabledFieldSubmission:!0,value:H})})]}),(0,v.jsxs)("div",{css:[Dr,q.scrollbarStyles],id:Gt.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[(0,v.jsx)(q.LoadingOverlay,{isActive:Yo}),Array.isArray(t)&&t.length>0?t.map(g=>(0,v.jsx)(on,{isSelected:B.some(L=>L.id===g.id),result:g,triggerSelection:()=>Zo(g)},g.id)):y?null:(0,v.jsx)(nn,{searchText:H||H,selectedContentType:(Ea=(Ia=r==null?void 0:r.find(g=>g.id===b))==null?void 0:Ia.name)!=null?Ea:b}),!y&&typeof d!="undefined"&&t&&(t==null?void 0:t.length)<d&&(0,v.jsx)("button",{type:"button",css:Lr,onClick:rn,children:Qo?(0,v.jsx)(q.LoadingIndicator,{}):"Load More"})]}),(0,v.jsxs)("div",{css:J.css`
|
|
376
376
|
display: flex;
|
|
377
377
|
justify-content: space-between;
|
|
378
|
-
`,children:[(0,
|
|
378
|
+
`,children:[(0,v.jsx)("div",{children:P&&((Ma=r==null?void 0:r.length)!=null?Ma:0)>0?(0,v.jsx)(q.Menu,{menuLabel:"Add new menu",menuTrigger:(0,v.jsx)(q.Button,{buttonType:"secondary",children:"Add New"}),children:r==null?void 0:r.map(g=>(0,v.jsx)(q.MenuItem,{css:J.css`
|
|
379
379
|
background: var(--white);
|
|
380
380
|
color: var(--brand-secondary-1);
|
|
381
|
-
`,onClick:()=>
|
|
381
|
+
`,onClick:()=>P(g),children:g.name},g.id))}):null}),(0,v.jsxs)("div",{css:J.css`
|
|
382
382
|
display: flex;
|
|
383
383
|
gap: var(--spacing-base);
|
|
384
|
-
`,children:[(0,
|
|
384
|
+
`,children:[(0,v.jsx)(q.Button,{buttonType:"unimportant",onClick:tn,children:"Cancel"}),(0,v.jsx)(q.Button,{disabled:!B.length,onClick:en,"data-test-id":"entry-accept-button",children:"Accept"})]})]})]})]}):null,m?null:n&&B.length>1?(0,v.jsx)(Ge.DragDropContext,{onDragEnd:g=>ln(g),children:(0,v.jsx)(Ge.Droppable,{droppableId:s||"canvas-multi-select",children:g=>(0,v.jsxs)("div",{...g.droppableProps,ref:g.innerRef,css:J.css`
|
|
385
385
|
margin-block: var(--spacing-sm) 0;
|
|
386
|
-
`,children:[
|
|
386
|
+
`,children:[B==null?void 0:B.map((L,he)=>{if(L!=null&&L.id)return(0,v.jsx)(Ge.Draggable,{draggableId:L.id,index:he,children:(F,Ht)=>(0,v.jsxs)("div",{css:Er,ref:F.innerRef,"data-dragging":Ht.isDragging,...F.draggableProps,...F.dragHandleProps,children:[(0,v.jsxs)("span",{css:Mr,children:[(0,v.jsx)(Ze,{css:[Rt,Ur],width:24,height:24}),(0,v.jsx)(Ze,{css:Rt,width:24,height:24})]}),(0,v.jsx)(Da,{logoIcon:o,selectedItem:L,onDeselect:Nt=>ka(Nt),onEditClosed:w?Nt=>w(Nt):void 0},`selected-item-${L.id}`)]})},L.id)}),g.placeholder]})})}):B==null?void 0:B.map(g=>(0,v.jsx)(Da,{logoIcon:o,selectedItem:g,onDeselect:L=>ka(L),onEditClosed:w?L=>w(L):void 0},`selected-item-${g.id}`))]})})};var Fr=require("@emotion/react");var xe=require("@emotion/react"),Br=xe.css`
|
|
387
387
|
cursor: pointer;
|
|
388
388
|
padding: var(--spacing-sm) 0;
|
|
389
389
|
margin-right: var(--spacing-sm);
|
|
390
390
|
position: relative;
|
|
391
391
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
392
392
|
color var(--duration-fast) var(--timing-ease-out);
|
|
393
|
-
`,
|
|
393
|
+
`,Ar=xe.css`
|
|
394
394
|
border: 2px solid transparent;
|
|
395
395
|
border-radius: var(--rounded-base);
|
|
396
396
|
display: flex;
|
|
397
397
|
align-items: center;
|
|
398
398
|
gap: var(--spacing-base);
|
|
399
399
|
padding: var(--spacing-sm) var(--spacing-xs);
|
|
400
|
-
`,
|
|
400
|
+
`,zr=xe.css`
|
|
401
401
|
background-color: var(--green-50);
|
|
402
|
-
`,
|
|
402
|
+
`,Or=xe.css`
|
|
403
403
|
font-size: var(--fs-sm);
|
|
404
404
|
font-weight: var(--fw-bold);
|
|
405
405
|
width: 50%;
|
|
406
|
-
`,
|
|
406
|
+
`,Gr=xe.css`
|
|
407
407
|
font-weight: var(--fw-normal);
|
|
408
408
|
display: block;
|
|
409
|
-
`,
|
|
409
|
+
`,Hr=xe.css`
|
|
410
410
|
font-size: var(--fs-sm);
|
|
411
411
|
> * {
|
|
412
412
|
display: block;
|
|
413
413
|
}
|
|
414
|
-
`,
|
|
414
|
+
`,Nr=xe.css`
|
|
415
415
|
display: block;
|
|
416
416
|
height: 1.5rem;
|
|
417
417
|
width: 1.5rem;
|
|
418
418
|
color: var(--brand-secondary-3);
|
|
419
419
|
margin-left: auto;
|
|
420
|
-
`;var
|
|
420
|
+
`;var j=require("@emotion/react/jsx-runtime");function $r({result:e,isSelected:t,triggerSelection:r}){var s;let{categories:a,logoIcon:o}=Xe(),[i]=e.categories||[{id:"",name:""}],n=typeof i=="undefined"||!a||(s=a.find(l=>l.id===i.id))==null?void 0:s.name;return(0,j.jsx)("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>r(),css:[Br],children:(0,j.jsxs)("div",{css:[Ar,t?zr:void 0],children:[e.thumbnailUrl?(0,j.jsx)("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Fr.css`
|
|
421
421
|
background-color: var(--gray-200);
|
|
422
422
|
width: 3rem;
|
|
423
423
|
height: 3rem;
|
|
424
424
|
object-fit: cover;
|
|
425
|
-
`}):(0,
|
|
425
|
+
`}):(0,j.jsx)(te,{src:o,alt:"Logo",css:Fr.css`
|
|
426
426
|
height: 2.25rem;
|
|
427
427
|
width: 2.25rem;
|
|
428
|
-
`}),(0,
|
|
428
|
+
`}),(0,j.jsxs)("h4",{css:[Or],children:[e.title,n?(0,j.jsx)("span",{css:[Gr],children:n}):null]}),(0,j.jsxs)("p",{css:[Hr],children:["SKU: ",e.sku||e.id,e.price!==void 0?(0,j.jsx)("span",{children:e.price}):null]}),t?(0,j.jsx)(ct,{css:[Nr]}):null]})},e.id)}var ke=require("@emotion/react"),kt=require("@uniformdev/design-system"),mo=require("react-icons/cg");var me=require("@emotion/react"),Wr=require("@uniformdev/design-system"),Kr=me.css`
|
|
429
429
|
border: 1px solid var(--gray-200);
|
|
430
430
|
border-radius: var(--rounded-base);
|
|
431
431
|
background: var(--gray-50);
|
|
432
432
|
display: flex;
|
|
433
433
|
width: 100%;
|
|
434
|
-
`,
|
|
434
|
+
`,Qr=me.css`
|
|
435
435
|
align-items: center;
|
|
436
436
|
display: flex;
|
|
437
437
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
@@ -439,22 +439,22 @@
|
|
|
439
439
|
flex-grow: 1;
|
|
440
440
|
gap: var(--spacing-sm);
|
|
441
441
|
margin-inline: 0 var(--spacing-sm);
|
|
442
|
-
`,
|
|
442
|
+
`,Yr=me.css`
|
|
443
443
|
display: flex;
|
|
444
444
|
align-items: center;
|
|
445
445
|
gap: var(--spacing-sm);
|
|
446
446
|
flex-grow: 1;
|
|
447
447
|
|
|
448
|
-
${(0,
|
|
448
|
+
${(0,Wr.mq)("lg")} {
|
|
449
449
|
width: 50%;
|
|
450
450
|
margin-bottom: 0;
|
|
451
451
|
}
|
|
452
|
-
`,
|
|
452
|
+
`,Tt=me.css`
|
|
453
453
|
background-color: var(--gray-200);
|
|
454
454
|
width: 3.5rem;
|
|
455
455
|
height: 3.5rem;
|
|
456
456
|
object-fit: cover;
|
|
457
|
-
`,
|
|
457
|
+
`,Lt=me.css`
|
|
458
458
|
align-items: center;
|
|
459
459
|
background: var(--white);
|
|
460
460
|
border-radius: var(--rounded-base);
|
|
@@ -469,50 +469,50 @@
|
|
|
469
469
|
&:hover {
|
|
470
470
|
background: var(--gray-50);
|
|
471
471
|
}
|
|
472
|
-
`,
|
|
472
|
+
`,Vt=me.css`
|
|
473
473
|
font-size: var(--fs-sm);
|
|
474
|
-
|
|
474
|
+
`,Zr=me.css`
|
|
475
475
|
display: block;
|
|
476
476
|
width: 1rem;
|
|
477
477
|
height: 1rem;
|
|
478
|
-
`,
|
|
478
|
+
`,Xr=me.css`
|
|
479
479
|
display: flex;
|
|
480
480
|
flex-direction: column;
|
|
481
481
|
gap: var(--spacing-sm);
|
|
482
482
|
|
|
483
|
-
${(0,
|
|
483
|
+
${(0,Wr.mq)("md")} {
|
|
484
484
|
flex-direction: row;
|
|
485
485
|
min-width: 200px;
|
|
486
486
|
justify-content: end;
|
|
487
487
|
}
|
|
488
|
-
`;var
|
|
488
|
+
`;var k=require("@emotion/react/jsx-runtime");function Jr({selectedItem:e,onDeselect:t}){var n;let{categories:r,logoIcon:a}=Xe(),[o]=e.categories||[{id:"",name:""}],i=typeof o=="undefined"||!r||(n=r.find(s=>s.id===o.id))==null?void 0:n.name;return(0,k.jsx)("div",{css:[Kr],children:(0,k.jsxs)("article",{css:[Qr],children:[(0,k.jsxs)("div",{css:[Yr],children:[e.thumbnailUrl?(0,k.jsx)("img",{src:e.thumbnailUrl,alt:i,css:[Tt],loading:"lazy"}):(0,k.jsx)("div",{css:[Tt]}),(0,k.jsxs)("div",{css:ke.css`
|
|
489
489
|
> :not(:last-child) {
|
|
490
490
|
margin-bottom: var(--spacing-xs);
|
|
491
491
|
}
|
|
492
|
-
`,children:[(0,
|
|
492
|
+
`,children:[(0,k.jsxs)("h4",{css:ke.css`
|
|
493
493
|
margin-top: 0px;
|
|
494
494
|
font-weight: var(--fw-bold);
|
|
495
|
-
`,children:[e.title||e.id||"",
|
|
495
|
+
`,children:[e.title||e.id||"",i&&(0,k.jsx)("span",{css:ke.css`
|
|
496
496
|
display: block;
|
|
497
497
|
font-weight: var(--fw-regular);
|
|
498
|
-
`,children:
|
|
498
|
+
`,children:i})]}),(0,k.jsxs)("ul",{css:ke.css`
|
|
499
499
|
font-size: var(--fs-sm);
|
|
500
500
|
|
|
501
|
-
${(0,
|
|
501
|
+
${(0,kt.mq)("sm")} {
|
|
502
502
|
display: flex;
|
|
503
503
|
gap: var(--spacing-base);
|
|
504
504
|
}
|
|
505
|
-
`,children:[(0,
|
|
505
|
+
`,children:[(0,k.jsxs)("li",{children:[(0,k.jsx)("span",{css:ke.css`
|
|
506
506
|
margin-right: var(--spacing-xs);
|
|
507
|
-
`,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?(0,
|
|
507
|
+
`,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?(0,k.jsxs)("li",{children:[(0,k.jsx)("span",{css:ke.css`
|
|
508
508
|
margin-right: var(--spacing-xs);
|
|
509
|
-
`,children:"Price:"}),(0,
|
|
509
|
+
`,children:"Price:"}),(0,k.jsx)("span",{children:e.price})]}):null]})]})]}),(0,k.jsxs)("div",{css:Xr,children:[e.editLink?(0,k.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Lt,children:[(0,k.jsx)("span",{css:Vt,children:"Edit"}),(0,k.jsx)(te,{src:a,alt:"Logo",css:Zr})]}):null,(0,k.jsxs)("button",{type:"button",onClick:()=>{t==null||t(e)},css:Lt,children:[(0,k.jsx)("span",{css:Vt,children:"Unlink"}),(0,k.jsx)(kt.Icon,{icon:mo.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}var He=require("@emotion/react/jsx-runtime");function In({selectedProducts:e,setSelectedProducts:t,onGetCategories:r,onSearchProducts:a,logoIcon:o,multiSelect:i,multiSelectId:n,selectedItemComponent:s,rowComponent:l,errorComponent:p,helpComponent:d,noResultsComponent:u,onSort:y,typeSelectorAllTypesOptionText:f="All categories",typeSelectorLabel:P="Select Category"}){var Re,H;let{value:w,loading:T,error:Be}=(0,Dt.useAsync)(async()=>await r(),[r]),Ke=w==null?void 0:w.map(N=>N.id).join(","),ee=(0,we.useMemo)(()=>w?w.map(b=>({id:b.id,name:b.name})):void 0,[Ke]),ve=(0,we.useRef)(),[ie,Qe]=(0,Dt.useAsyncFn)(async(N,b)=>{let Q=await a({text:N,options:{limit:b==null?void 0:b.count,offset:b==null?void 0:b.offset,categoryId:b==null?void 0:b.contentType,cursor:b==null?void 0:b.cursor}});return(b==null?void 0:b.offset)===0&&(ve.current=[]),(ve.current=ve.current||[]).push(...Q.products),Q},[a]),st=async N=>{await t(N)};return Be||ie.error?(0,He.jsx)(p||(({categoriesError:b,searchError:Q})=>(0,He.jsxs)(go.Callout,{type:"error",children:["There was an error: ",(b==null?void 0:b.message)||(Q==null?void 0:Q.message)]})),{categoriesError:Be,searchError:ie.error}):(0,He.jsx)(jr.Provider,{value:{categories:w,logoIcon:o},children:(0,He.jsx)(qr,{search:Qe,results:ve.current,logoIcon:o,selectedItems:e,select:st,multiSelectId:n||"product-search-multi-select",multiSelect:i,contentTypes:ee,selectedItemComponent:s||Jr,rowComponent:l||$r,totalResults:(Re=ie.value)==null?void 0:Re.total,cursor:(H=ie.value)==null?void 0:H.cursor,resultsLoading:ie.loading||T,helpComponent:d,noResultsComponent:u,onSort:y,typeSelectorAllTypesOptionText:f,typeSelectorLabel:P})})}var jr=we.default.createContext(void 0),Xe=()=>{let e=(0,we.useContext)(jr);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};var _e=require("@emotion/react"),ca=require("@uniformdev/design-system"),Ie=require("react"),Et=require("react-icons/cg"),vo=require("timeago.js");var O=require("@emotion/react"),fo=require("@uniformdev/design-system"),ea=O.css`
|
|
510
510
|
border: 1px solid var(--gray-200);
|
|
511
511
|
background: var(--gray-50);
|
|
512
512
|
border-radius: var(--rounded-base);
|
|
513
513
|
display: flex;
|
|
514
514
|
width: 100%;
|
|
515
|
-
`,
|
|
515
|
+
`,ta=O.css`
|
|
516
516
|
align-items: center;
|
|
517
517
|
display: flex;
|
|
518
518
|
flex-grow: 1;
|
|
@@ -520,23 +520,23 @@
|
|
|
520
520
|
margin-inline: 0 var(--spacing-sm);
|
|
521
521
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
522
522
|
position: relative;
|
|
523
|
-
`,
|
|
523
|
+
`,ra=O.css`
|
|
524
524
|
flex-grow: 1;
|
|
525
|
-
`,
|
|
525
|
+
`,aa=O.css`
|
|
526
526
|
align-items: center;
|
|
527
527
|
display: flex;
|
|
528
528
|
position: relative;
|
|
529
|
-
`,
|
|
529
|
+
`,oa=O.css`
|
|
530
530
|
color: var(--brand-secondary-1);
|
|
531
531
|
font-size: var(--fs-base);
|
|
532
532
|
font-weight: var(--fw-bold);
|
|
533
533
|
line-height: 1;
|
|
534
534
|
margin: 0;
|
|
535
535
|
word-break: break-word;
|
|
536
|
-
`,
|
|
536
|
+
`,na=O.css`
|
|
537
537
|
width: 1.5rem;
|
|
538
538
|
height: 1.5rem;
|
|
539
|
-
`,
|
|
539
|
+
`,ia=O.css`
|
|
540
540
|
background: var(--white);
|
|
541
541
|
border-radius: var(--rounded-base);
|
|
542
542
|
border-left: 4px solid var(--brand-secondary-3);
|
|
@@ -545,22 +545,22 @@
|
|
|
545
545
|
padding: var(--spacing-base);
|
|
546
546
|
z-index: var(--z-10);
|
|
547
547
|
width: max-content;
|
|
548
|
-
`,
|
|
548
|
+
`,De=O.css`
|
|
549
549
|
font-size: var(--fs-sm);
|
|
550
|
-
`,
|
|
550
|
+
`,Je=O.css`
|
|
551
551
|
font-weight: var(--fw-bold);
|
|
552
552
|
margin-right: var(--spacing-sm);
|
|
553
|
-
`,
|
|
553
|
+
`,sa=O.css`
|
|
554
554
|
display: flex;
|
|
555
555
|
flex-direction: column;
|
|
556
556
|
gap: var(--spacing-sm);
|
|
557
557
|
|
|
558
|
-
${(0,
|
|
558
|
+
${(0,fo.mq)("md")} {
|
|
559
559
|
flex-direction: row;
|
|
560
560
|
justify-content: end;
|
|
561
561
|
min-width: 200px;
|
|
562
562
|
}
|
|
563
|
-
`,
|
|
563
|
+
`,_t=O.css`
|
|
564
564
|
align-items: center;
|
|
565
565
|
background: var(--white);
|
|
566
566
|
border-radius: var(--rounded-base);
|
|
@@ -575,52 +575,40 @@
|
|
|
575
575
|
&:hover {
|
|
576
576
|
background: var(--gray-50);
|
|
577
577
|
}
|
|
578
|
-
`,
|
|
578
|
+
`,la=O.css`
|
|
579
579
|
display: flex;
|
|
580
580
|
margin-top: var(--spacing-sm);
|
|
581
581
|
gap: var(--spacing-sm);
|
|
582
|
-
`,
|
|
582
|
+
`,da=O.css`
|
|
583
583
|
background: none;
|
|
584
584
|
outline: none;
|
|
585
585
|
border: none;
|
|
586
586
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
587
|
-
`,
|
|
587
|
+
`,It=O.css`
|
|
588
588
|
display: block;
|
|
589
589
|
max-width: 100%;
|
|
590
590
|
min-width: 100px;
|
|
591
591
|
height: auto;
|
|
592
|
-
`;var
|
|
592
|
+
`;var S=require("@emotion/react/jsx-runtime");function En({selectedItem:e,onDeselect:t,onEditClosed:r,logoIcon:a,itemDetailsRendererComponent:o}){let i=(0,Ie.useRef)(null),n=(0,Ie.useRef)(null),[s,l]=(0,Ie.useState)(!1);(0,Ie.useEffect)(()=>{let u=f=>{i.current&&!i.current.contains(f.target)&&n.current&&!n.current.contains(f.target)&&l(!1)},y=()=>{l(!1)};return window.addEventListener("resize",y,!0),document.addEventListener("scroll",u,!0),document.addEventListener("mousedown",u),()=>{window.removeEventListener("resize",y,!0),document.removeEventListener("scroll",u,!0),document.removeEventListener("mousedown",u)}},[n]);let p=()=>{var u;if(l(!s),n.current&&i.current){let y=(u=i==null?void 0:i.current)==null?void 0:u.getBoundingClientRect();n.current.style.top=`${y.top+30}px`}},d=o!=null?o:Mn;return(0,S.jsx)("div",{css:[ea,_e.css`
|
|
593
593
|
margin: 0 0 1rem 0;
|
|
594
|
-
`],children:(0,
|
|
594
|
+
`],children:(0,S.jsxs)("div",{css:ta,children:[(0,S.jsxs)("div",{css:ra,children:[(0,S.jsxs)("div",{css:aa,children:[(0,S.jsx)("h4",{css:[oa],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("button",{type:"button",ref:i,css:da,"aria-controls":"path-details","aria-expanded":s,onClick:p,children:(0,S.jsx)(ca.Icon,{icon:Et.CgInfo,iconColor:"gray",size:24,css:_e.css`
|
|
595
595
|
opacity: var(--opacity-75);
|
|
596
|
-
`})}),(0,
|
|
596
|
+
`})}),(0,S.jsx)("div",{id:"path-details","aria-hidden":!s,ref:n,css:[ia,s?_e.css`
|
|
597
597
|
visibility: visible;
|
|
598
|
-
`:
|
|
598
|
+
`:_e.css`
|
|
599
599
|
visibility: hidden;
|
|
600
|
-
`],children:Object.entries(e.popoverData).map(([
|
|
600
|
+
`],children:Object.entries(e.popoverData).map(([u,y],f)=>(0,S.jsxs)("div",{css:De,children:[(0,S.jsxs)("span",{css:Je,children:[u,":"]}),y]},f))})]}):null]}),(0,S.jsx)(d,{item:e})]}),(0,S.jsxs)("div",{css:sa,children:[e.editLink?typeof e.editLink=="string"?(0,S.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:u=>{r&&(wt(u.currentTarget.href,()=>r(e)),u.preventDefault())},css:_t,children:[(0,S.jsx)("span",{css:De,children:"Edit"}),a?(0,S.jsx)(te,{src:a,css:na,alt:"Logo"}):null]}):e.editLink:null,(0,S.jsxs)("button",{type:"button",onClick:()=>{t(e)},css:_t,children:[(0,S.jsx)("span",{css:De,children:"Unlink"}),(0,S.jsx)(ca.Icon,{icon:Et.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}function Mn({item:e}){let t=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?t=(0,S.jsx)("img",{src:e.previewUrl,alt:e.id,width:"200",css:It}):e.type==="video"&&(t=(0,S.jsx)("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:It})):e.previewUrl&&typeof e.previewUrl!="string"&&(t=e.previewUrl),t||e.metadata?(0,S.jsxs)("div",{css:la,children:[t?(0,S.jsx)("div",{children:t}):null,(0,S.jsxs)("ul",{children:[e.metadata?Object.entries(e.metadata).map(([r,a])=>(0,S.jsxs)("li",{css:[De,_e.css`
|
|
601
601
|
order: 1;
|
|
602
|
-
`],children:[(0,
|
|
602
|
+
`],children:[(0,S.jsxs)("span",{css:[Je,_e.css`
|
|
603
603
|
order: 1;
|
|
604
|
-
`],children:[
|
|
605
|
-
background: var(--white);
|
|
606
|
-
`,mo=e=>da.css`
|
|
607
|
-
align-items: start;
|
|
608
|
-
background: ${e};
|
|
609
|
-
display: grid;
|
|
610
|
-
grid-template-columns: 12ch 1fr;
|
|
611
|
-
gap: var(--spacing-sm);
|
|
612
|
-
`;var fo=require("@emotion/react/jsx-runtime"),pa=({bgColor:e="transparent",children:t,...a})=>(0,fo.jsx)("div",{css:mo(e),...a,children:t});var Oe=require("@emotion/react/jsx-runtime"),Tn=[{label:"Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"},{label:"JavaScript",value:"javascript"},{label:"XML",value:"xml"},{label:"HTML",value:"html"}],vo={plaintext:"text/plain",json:"application/json",yaml:"application/x-yaml",javascript:"application/javascript",xml:"application/xml",html:"text/html"};function Ln(){let{request:e,dispatch:t}=K(),[a,o]=(0,yo.useState)("json");return(0,Oe.jsxs)("div",{css:ua.css`
|
|
613
|
-
background: var(--white);
|
|
614
|
-
`,children:[(0,Oe.jsx)(pa,{bgColor:"var(--gray-100)",css:ua.css`
|
|
615
|
-
padding: var(--spacing-sm) var(--spacing-base);
|
|
616
|
-
`,children:(0,Oe.jsx)(bo.InputSelect,{label:"Language",showLabel:!1,options:Tn,value:a,onChange:r=>{let n=r.currentTarget.value;o(n),e.body&&t({type:"setBody",body:e.body,contentType:vo[n]})}})}),(0,Oe.jsx)(ho.default,{height:200,value:e.body,language:a,options:{language:a,minimap:{enabled:!1},folding:!1},onChange:r=>{r&&t({type:"setBody",body:r,contentType:vo[a]})}})]})}var _=require("@uniformdev/design-system");var V=require("@emotion/react/jsx-runtime");function _n({disableVariables:e}){var r,n;let{dispatch:t,request:a}=K(),o=[...a.headers,{key:"",value:""}];return(0,V.jsx)("div",{css:Dt,children:(0,V.jsxs)(_.Table,{children:[(0,V.jsx)(_.TableHead,{children:(0,V.jsxs)(_.TableRow,{children:[(0,V.jsx)(_.TableCellHead,{children:"Name"}),(0,V.jsx)(_.TableCellHead,{children:"Value"})]})}),(0,V.jsxs)(_.TableBody,{children:[(n=(r=a.baseRequest)==null?void 0:r.headers)==null?void 0:n.map(i=>(0,V.jsxs)(_.TableRow,{children:[(0,V.jsxs)(_.TableCellData,{width:"50%",children:[i.key,(0,V.jsx)("br",{}),(0,V.jsx)("i",{css:{color:"var(--gray-500)"},children:(0,V.jsx)("small",{children:"from data source"})})]}),(0,V.jsxs)(_.TableCellData,{width:"50%",children:[(0,V.jsx)("i",{css:{color:"var(--gray-500)"},children:i.value}),a.headers.find(l=>l.key===i.key)?(0,V.jsx)(_.WarningMessage,{message:"overridden below"}):null]})]},i.key)),o.map((i,l)=>(0,V.jsxs)(_.TableRow,{children:[(0,V.jsx)(_.TableCellData,{width:"50%",children:(0,V.jsx)(_.Input,{label:i.key,value:i.key,showLabel:!1,onChange:d=>{d.currentTarget.value?t({type:"updateHeader",header:{key:d.currentTarget.value,value:i.value},index:l}):t({type:"removeHeader",index:l})}})}),(0,V.jsx)(_.TableCellData,{width:"50%",children:i.key?(0,V.jsx)(_.Input,{showLabel:!1,label:i.value,value:i.value,onChange:d=>t({type:"updateHeader",header:{key:i.key,value:d.currentTarget.value},index:l})}):null})]},l))]})]})})}var xo=require("@uniformdev/design-system");var wo=require("@emotion/react/jsx-runtime");function In(e){var o;let{request:t,dispatch:a}=K();return(0,wo.jsx)(xo.InputSelect,{...e,options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"HEAD",value:"HEAD"}],value:(o=t.method)!=null?o:"GET",onChange:r=>a({type:"setMethod",method:r.currentTarget.value})})}var I=require("@uniformdev/design-system");var E=require("@emotion/react/jsx-runtime");function Dn({disableVariables:e}){var r,n;let{dispatch:t,request:a}=K(),o=[...a.parameters,{key:"",value:""}];return(0,E.jsx)("div",{css:Dt,children:(0,E.jsxs)(I.Table,{children:[(0,E.jsx)(I.TableHead,{children:(0,E.jsxs)(I.TableRow,{children:[(0,E.jsx)(I.TableCellHead,{children:"Name"}),(0,E.jsx)(I.TableCellHead,{children:"Value"})]})}),(0,E.jsxs)(I.TableBody,{children:[(n=(r=a.baseRequest)==null?void 0:r.parameters)==null?void 0:n.map(i=>(0,E.jsxs)(I.TableRow,{children:[(0,E.jsxs)(I.TableCellData,{width:"50%",children:[i.key,(0,E.jsx)("br",{}),(0,E.jsx)("i",{css:{color:"var(--gray-500)"},children:(0,E.jsx)("small",{children:"from data source"})})]}),(0,E.jsxs)(I.TableCellData,{width:"50%",children:[(0,E.jsx)("i",{css:{color:"var(--gray-500)"},children:i.value}),a.parameters.find(l=>l.key===i.key)?(0,E.jsx)(I.WarningMessage,{message:"overridden below"}):null]})]},i.key)),o.map((i,l)=>(0,E.jsxs)(I.TableRow,{children:[(0,E.jsx)(I.TableCellData,{width:"50%",children:(0,E.jsx)(I.Input,{label:i.key,value:i.key,showLabel:!1,onChange:d=>{d.currentTarget.value?t({type:"updateParameter",parameter:{key:d.currentTarget.value,value:i.value},index:l}):t({type:"removeParameter",index:l})}})}),(0,E.jsx)(I.TableCellData,{width:"50%",children:i.key?(0,E.jsx)(I.Input,{showLabel:!1,label:i.value,value:i.value,onChange:d=>t({type:"updateParameter",parameter:{key:i.key,value:d.currentTarget.value},index:l})}):null})]},l))]})]})})}var Mo=require("@emotion/react"),Uo=require("react");var To=require("@emotion/react"),Lo=se(require("@yaireo/tagify/dist/react.tagify")),G=se(require("react"));var Vt=require("@emotion/react"),So=Vt.css`
|
|
604
|
+
`],children:[r,":"]}),a]},r)):null,e.createdDate?(0,S.jsxs)("li",{css:De,children:[(0,S.jsx)("span",{css:Je,children:"Date:"}),(0,vo.format)(e.createdDate)]}):null]})]}):null}var At=require("@uniformdev/design-system");var Se=require("react");var ho=require("@uniformdev/design-system"),Mt=require("react");var je=require("@emotion/react/jsx-runtime"),et=(0,Mt.createContext)(void 0),Un=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),(0,je.jsxs)(et.Provider,{value:t,children:[(0,je.jsx)(ho.Theme,{}),(0,je.jsx)(tt,{children:e})]})},pa=()=>{let e=(0,Mt.useContext)(et);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function ua(){let{sdk:e}=pa();return e}var yo=require("@emotion/react/jsx-runtime"),ma=(0,Se.createContext)(void 0),tt=({children:e})=>{let t=ua(),[r,a]=(0,Se.useState)(t.getCurrentLocation()),o=i=>{a(n=>({...n,value:i.newValue}))};return(0,Se.useEffect)(()=>(t.events.on("onValueChanged",o),()=>{t.events.off("onValueChanged",o)}),[t]),(0,yo.jsx)(ma.Provider,{value:{location:r},children:e})},rt=()=>{let e=(0,Se.useContext)(ma);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};var bo=!1;function Ee(e){let{location:t}=rt(),r=e;if(e==="dataTypeInstance"&&(r="dataResource",bo||(console.warn("`dataTypeInstance` mesh location is deprecated, please switch to `dataResource` instead."),bo=!0)),r&&t.type!==r)throw new Error(`Expected location type ${e} but got ${t.type}`);return{...t,setValue:o=>{let{newValue:i,options:n}=o(t.value);t.setValue(i,n)}}}var Po=require("@emotion/react"),To=le(require("@yaireo/tagify/dist/react.tagify")),G=le(require("react"));var Ut=require("@emotion/react"),xo=Ut.css`
|
|
617
605
|
> * {
|
|
618
606
|
margin: var(--spacing-base) 0 0;
|
|
619
607
|
}
|
|
620
|
-
`,
|
|
608
|
+
`,wo=Ut.css`
|
|
621
609
|
display: flex;
|
|
622
610
|
gap: var(--spacing-sm);
|
|
623
|
-
`,
|
|
611
|
+
`,So=Ut.css`
|
|
624
612
|
:root {
|
|
625
613
|
--tagify-dd-color-primary: rgb(53, 149, 246);
|
|
626
614
|
--tagify-dd-bg-color: var(--white);
|
|
@@ -1117,14 +1105,14 @@
|
|
|
1117
1105
|
opacity: 0;
|
|
1118
1106
|
transition: inherit;
|
|
1119
1107
|
}
|
|
1120
|
-
`;var Ne=
|
|
1108
|
+
`;var Ne=le(require("react"));var Me=require("@uniformdev/design-system"),qt=require("formik");var ae=require("@emotion/react/jsx-runtime");function ga({variable:e,onSubmit:t,onCancel:r}){var o,i,n,s,l,p,d,u,y;let{variables:a}=ge();return(0,ae.jsx)(qt.Formik,{initialValues:{name:e,default:(i=(o=a[e])==null?void 0:o.default)!=null?i:"",displayName:(s=(n=a[e])==null?void 0:n.displayName)!=null?s:"",helpText:(p=(l=a[e])==null?void 0:l.helpText)!=null?p:"",order:(d=a[e])==null?void 0:d.order,type:(y=(u=a[e])==null?void 0:u.type)!=null?y:""},onSubmit:f=>{let P={...f,helpText:f.helpText||void 0,type:f.type||void 0,displayName:f.displayName||void 0};return t(P)},children:({getFieldProps:f,initialValues:P})=>(0,ae.jsxs)(qt.Form,{css:xo,children:[(0,ae.jsx)(Me.Input,{...f("name"),label:"Name",disabled:P.name!=="",caption:"This cannot change once created."}),(0,ae.jsx)(Me.Input,{...f("helpText"),label:"Help Text",caption:"Appears in the composition data resource when entering a value for this variable.",autoComplete:"off"}),(0,ae.jsx)(Me.Input,{...f("default"),label:"Default Value",autoComplete:"off"}),(0,ae.jsxs)("div",{css:wo,children:[(0,ae.jsx)(Me.Button,{type:"submit",children:"Save"}),(0,ae.jsx)(Me.Button,{type:"button",buttonType:"ghost",onClick:r,children:"cancel"})]})]})})}var Bt=require("@emotion/react/jsx-runtime"),Ro=Ne.createContext(null);function at({value:e,onChange:t,editVariableComponent:r,children:a}){let[o,i]=Ne.useState(),n=r!=null?r:ga,s={dispatch:l=>{if(l.type==="set"){let{name:p,...d}=l.variable;t({...s.variables,[l.variable.name]:d}),l.openEditor&&i(l.variable.name)}else if(l.type==="edit")i(l.variable);else if(l.type==="remove"){let p={...e};delete p[l.variable],t(p)}else if(l.type==="reorder")t(l.result);else throw new Error(`Unknown event ${JSON.stringify(l)}`)},variables:e};return(0,Bt.jsxs)(Ro.Provider,{value:s,children:[a,typeof o!="undefined"?(0,Bt.jsx)(n,{onSubmit:l=>{i(void 0);let{name:p,...d}=l;t({...e,[p]:d})},onCancel:()=>i(void 0),variable:o}):null]})}function ge(){let e=Ne.useContext(Ro);if(!e)throw new Error("No VariablesProvider present");return e}var Ue=require("@emotion/react/jsx-runtime");function fa(e){return e.replace(/\${{.*?"value":"([^"]+)".*?}}/g,"${$1}").replace(/[\r\n]+/g,"")}function va({"aria-label":e,value:t,disableVariables:r,onChange:a,onPaste:o}){let{variables:i,dispatch:n}=ge(),s=G.useRef(i),l=G.useRef(n),p=G.useRef(a),d=G.useRef();G.useEffect(()=>{s.current=i},[i]),G.useEffect(()=>{l.current=n},[n]),G.useEffect(()=>{p.current=a},[a]),G.useEffect(()=>{var f;((f=d==null?void 0:d.current)==null?void 0:f.DOM)&&o&&(d.current.DOM.input.onpaste=()=>{var P,w;return o(fa((w=(P=d.current)==null?void 0:P.getInputValue())!=null?w:""))})}),G.useEffect(()=>{var P,w,T;let f=fa((w=(P=d.current)==null?void 0:P.getInputValue())!=null?w:"");t!==f&&((T=d.current)==null||T.loadOriginalValues(t))},[t]);let u=G.useCallback(f=>{p.current(fa(f))},[]),y=G.useCallback(f=>{s.current[f]||l.current({type:"set",variable:{name:f,default:""},openEditor:!0})},[]);return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(Po.Global,{styles:So}),(0,Ue.jsx)(To.default,{tagifyRef:d,"aria-label":e,defaultValue:t,autoFocus:!1,whitelist:Object.entries(i).map(([f,P])=>{var w;return{name:(w=P.displayName)!=null?w:f,value:f}}),settings:{pattern:r?null:/\$/,enforceWhitelist:r,mixTagsInterpolator:["${","}"],duplicates:!0,tagTextProp:"name",dropdown:{position:"text",enabled:0,mapValueTo:f=>f.name,includeSelectedTags:!0,searchKeys:["name","value"],highlightFirst:!0}},InputMode:"textarea",onAdd:f=>{var w;let P=(w=f.detail.data)==null?void 0:w.value;P&&y(P)},onRemove:f=>{u(f.detail.tagify.getInputValue())},onChange:f=>{u(f.detail.value)},onInput:f=>{u(f.detail.tagify.getInputValue())}})]})}var _o=require("@emotion/react"),D=require("@uniformdev/design-system"),Fe=require("react-beautiful-dnd");var ot=require("@emotion/react"),Lo=e=>ot.css`
|
|
1121
1109
|
position: relative;
|
|
1122
1110
|
${e?`
|
|
1123
1111
|
display: table;
|
|
1124
1112
|
left: auto !important;
|
|
1125
1113
|
top: auto !important;
|
|
1126
1114
|
`:void 0}
|
|
1127
|
-
`,
|
|
1115
|
+
`,Vo=ot.css`
|
|
1128
1116
|
&::after {
|
|
1129
1117
|
content: '';
|
|
1130
1118
|
display: block;
|
|
@@ -1141,7 +1129,7 @@
|
|
|
1141
1129
|
&:hover::after {
|
|
1142
1130
|
opacity: 1;
|
|
1143
1131
|
}
|
|
1144
|
-
`,
|
|
1132
|
+
`,ko=ot.css`
|
|
1145
1133
|
border: none;
|
|
1146
1134
|
color: var(--brand-secondary-5);
|
|
1147
1135
|
font-weight: var(--fw-medium);
|
|
@@ -1151,15 +1139,27 @@
|
|
|
1151
1139
|
text-overflow: ellipsis;
|
|
1152
1140
|
white-space: nowrap;
|
|
1153
1141
|
max-width: 20ch;
|
|
1154
|
-
`,
|
|
1142
|
+
`,Do=ot.css`
|
|
1155
1143
|
overflow: hidden;
|
|
1156
1144
|
text-overflow: ellipsis;
|
|
1157
1145
|
white-space: nowrap;
|
|
1158
1146
|
max-width: 20ch;
|
|
1159
|
-
`;function
|
|
1147
|
+
`;function nt(e){return Object.entries(e||{}).sort(([t,r],[a,o])=>{var i,n;return r.order&&o.order?r.order-o.order:r.order?1:o.order?-1:((i=r.displayName)!=null?i:t).localeCompare((n=o.displayName)!=null?n:a)}).map(([t,r])=>({name:t,...r}))}var V=require("@emotion/react/jsx-runtime");function Bn(){let{variables:e,dispatch:t}=ge(),r=nt(e),a=o=>{var i,n;if(o.destination&&o.source.droppableId===((i=o.destination)==null?void 0:i.droppableId)){let s=[...r||[]],[l]=(n=s==null?void 0:s.splice(o.source.index,1))!=null?n:[];s==null||s.splice(o.destination.index,0,l);let p=s.reduce((d,u,y)=>({...d,[u.name]:{type:u.type,default:u.default,order:y}}),{});return t({type:"reorder",result:p}),s}};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Fe.DragDropContext,{onDragEnd:o=>a(o),children:(0,V.jsx)(Fe.Droppable,{droppableId:"variables-table",children:o=>(0,V.jsxs)(D.Table,{...o.droppableProps,ref:o.innerRef,children:[(0,V.jsx)(D.TableHead,{children:(0,V.jsxs)(D.TableRow,{children:[(0,V.jsx)(D.TableCellHead,{children:"Name"}),(0,V.jsx)(D.TableCellHead,{children:"Default Value"}),(0,V.jsx)(D.TableCellHead,{})]})}),(0,V.jsxs)(D.TableBody,{children:[r.map(({name:i,displayName:n,default:s},l)=>{let p=n!=null?n:i;return(0,V.jsx)(Fe.Draggable,{draggableId:i,index:l,isDragDisabled:r.length===1,children:(d,u)=>(0,V.jsxs)(D.TableRow,{ref:d.innerRef,...d.dragHandleProps,...d.draggableProps,id:p,css:Lo(u.isDragging),"data-dragging":u.isDragging,children:[(0,V.jsx)(D.TableCellData,{css:r.length>1?Vo:void 0,children:(0,V.jsx)("button",{css:ko,type:"button",onClick:y=>{y.preventDefault(),t({type:"edit",variable:i})},title:p,children:p})}),(0,V.jsx)(D.TableCellData,{children:(0,V.jsx)("span",{css:Do,title:s,children:s})}),(0,V.jsx)(D.TableCellData,{align:"right",children:(0,V.jsx)("button",{type:"button",title:`delete ${p}`,css:[D.button,_o.css`
|
|
1160
1148
|
background: transparent;
|
|
1161
|
-
`],"aria-controls":
|
|
1149
|
+
`],"aria-controls":p,onClick:()=>t({type:"remove",variable:i}),children:(0,V.jsx)(D.Icon,{icon:"trash",iconColor:"red"})})})]})},i)}),o.placeholder]})]})})}),(0,V.jsx)(D.AddListButton,{onButtonClick:()=>t({type:"edit",variable:""}),"aria-label":"Add variable",buttonText:"add variable",icon:"math-plus",css:{marginLeft:"var(--spacing-md)"}})]})}var oe=require("@emotion/react/jsx-runtime");function An({setVariables:e,noVariables:t,typeRenderers:r}){let{value:a,metadata:{dataType:o}}=Ee("dataTypeInstance"),i=nt(o.variables);return i.length===0?t?(0,oe.jsx)(t,{}):(0,oe.jsx)(At.Callout,{type:"note",children:"No settings are required."}):(0,oe.jsx)("div",{children:i.map(n=>{var l,p,d;let s=n.type&&(l=r==null?void 0:r[n.type])!=null?l:ha;return(0,oe.jsx)("div",{children:(0,oe.jsx)(s,{definition:n,value:(d=(p=a==null?void 0:a[n.name])!=null?p:n.default)!=null?d:"",setValue:u=>{e(y=>{let f=u===n.default,P={...y};return f||u===void 0?delete P[n.name]:P[n.name]=u,{newValue:P}})}})},n.name)})})}function ha({definition:e,value:t,setValue:r}){return(0,oe.jsxs)("div",{children:[(0,oe.jsx)(At.Input,{label:e.displayName||e.name,value:t,caption:e.helpText,onChange:a=>{r(a.target.value)}}),e.default!==""?(0,oe.jsxs)("small",{children:["Default value: ",e.default]}):null]})}var wa=require("@emotion/react"),Bo=le(require("@monaco-editor/react")),Ao=require("@uniformdev/design-system"),zo=require("react");var $e=le(require("react")),Eo=require("@emotion/react/jsx-runtime"),Io=$e.createContext(null);function it({value:e,onChange:t,children:r}){let a=$e.useMemo(()=>({dispatch:o=>{if(o.type==="setRelativeUrl")t(i=>({...i,relativeUrl:o.relativeUrl}));else if(o.type==="updateParameter")t(i=>{let n=[...i.parameters];return typeof o.index=="number"?n[o.index]=o.parameter:n.push(o.parameter),{...i,parameters:n}});else if(o.type==="removeParameter")t(i=>{let n=[...i.parameters];return n.splice(o.index,1),{...i,parameters:n}});else if(o.type==="updateHeader")t(i=>{let n=[...i.headers];return typeof o.index!="undefined"?n[o.index]=o.header:n.push(o.header),{...i,headers:n}});else if(o.type==="removeHeader")t(i=>{let n=[...i.headers];return n.splice(o.index,1),{...i,headers:n}});else if(o.type==="setMethod")t(i=>({...i,method:o.method}));else if(o.type==="setBody")t(i=>{let n=[...i.headers],s=n.findIndex(({key:l})=>l.trim().toLocaleLowerCase()==="content-type");return s>-1?n[s].value=o.contentType:n.push({key:"Content-Type",value:o.contentType}),{...i,body:o.body,headers:n}});else throw new Error(`Unknown event ${JSON.stringify(o)}`)},request:e}),[t,e]);return(0,Eo.jsx)(Io.Provider,{value:a,children:r})}function K(){let e=$e.useContext(Io);if(!e)throw new Error("No RequestProvider present");return e}var ya=require("@emotion/react"),zt=ya.css`
|
|
1150
|
+
background: var(--white);
|
|
1151
|
+
`,Mo=e=>ya.css`
|
|
1152
|
+
align-items: start;
|
|
1153
|
+
background: ${e};
|
|
1154
|
+
display: grid;
|
|
1155
|
+
grid-template-columns: 12ch 1fr;
|
|
1156
|
+
gap: var(--spacing-sm);
|
|
1157
|
+
`;var Uo=require("@emotion/react/jsx-runtime"),xa=({bgColor:e="transparent",children:t,...r})=>(0,Uo.jsx)("div",{css:Mo(e),...r,children:t});var We=require("@emotion/react/jsx-runtime"),zn=[{label:"Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"},{label:"JavaScript",value:"javascript"},{label:"XML",value:"xml"},{label:"HTML",value:"html"}],qo={plaintext:"text/plain",json:"application/json",yaml:"application/x-yaml",javascript:"application/javascript",xml:"application/xml",html:"text/html"};function On(){let{request:e,dispatch:t}=K(),[r,a]=(0,zo.useState)("json");return(0,We.jsxs)("div",{css:wa.css`
|
|
1158
|
+
background: var(--white);
|
|
1159
|
+
`,children:[(0,We.jsx)(xa,{bgColor:"var(--gray-100)",css:wa.css`
|
|
1160
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
1161
|
+
`,children:(0,We.jsx)(Ao.InputSelect,{label:"Language",showLabel:!1,options:zn,value:r,onChange:o=>{let i=o.currentTarget.value;a(i),e.body&&t({type:"setBody",body:e.body,contentType:qo[i]})}})}),(0,We.jsx)(Bo.default,{height:200,value:e.body,language:r,options:{language:r,minimap:{enabled:!1},folding:!1},onChange:o=>{o&&t({type:"setBody",body:o,contentType:qo[r]})}})]})}var _=require("@uniformdev/design-system");var E=require("@emotion/react/jsx-runtime");function Gn({disableVariables:e}){var o,i;let{dispatch:t,request:r}=K(),a=[...r.headers,{key:"",value:""}];return(0,E.jsx)("div",{css:zt,children:(0,E.jsxs)(_.Table,{children:[(0,E.jsx)(_.TableHead,{children:(0,E.jsxs)(_.TableRow,{children:[(0,E.jsx)(_.TableCellHead,{children:"Name"}),(0,E.jsx)(_.TableCellHead,{children:"Value"})]})}),(0,E.jsxs)(_.TableBody,{children:[(i=(o=r.baseRequest)==null?void 0:o.headers)==null?void 0:i.map(n=>(0,E.jsxs)(_.TableRow,{children:[(0,E.jsxs)(_.TableCellData,{width:"50%",children:[n.key,(0,E.jsx)("br",{}),(0,E.jsx)("i",{css:{color:"var(--gray-500)"},children:(0,E.jsx)("small",{children:"from data source"})})]}),(0,E.jsxs)(_.TableCellData,{width:"50%",children:[(0,E.jsx)("i",{css:{color:"var(--gray-500)"},children:n.value}),r.headers.find(s=>s.key===n.key)?(0,E.jsx)(_.WarningMessage,{message:"overridden below"}):null]})]},n.key)),a.map((n,s)=>(0,E.jsxs)(_.TableRow,{children:[(0,E.jsx)(_.TableCellData,{width:"50%",children:(0,E.jsx)(_.Input,{label:n.key,value:n.key,showLabel:!1,onChange:l=>{l.currentTarget.value?t({type:"updateHeader",header:{key:l.currentTarget.value,value:n.value},index:s}):t({type:"removeHeader",index:s})}})}),(0,E.jsx)(_.TableCellData,{width:"50%",children:n.key?(0,E.jsx)(_.Input,{showLabel:!1,label:n.value,value:n.value,onChange:l=>t({type:"updateHeader",header:{key:n.key,value:l.currentTarget.value},index:s})}):null})]},s))]})]})})}var Oo=require("@uniformdev/design-system");var Go=require("@emotion/react/jsx-runtime");function Hn(e){var a;let{request:t,dispatch:r}=K();return(0,Go.jsx)(Oo.InputSelect,{...e,options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"HEAD",value:"HEAD"}],value:(a=t.method)!=null?a:"GET",onChange:o=>r({type:"setMethod",method:o.currentTarget.value})})}var I=require("@uniformdev/design-system");var M=require("@emotion/react/jsx-runtime");function Nn({disableVariables:e}){var o,i;let{dispatch:t,request:r}=K(),a=[...r.parameters,{key:"",value:""}];return(0,M.jsx)("div",{css:zt,children:(0,M.jsxs)(I.Table,{children:[(0,M.jsx)(I.TableHead,{children:(0,M.jsxs)(I.TableRow,{children:[(0,M.jsx)(I.TableCellHead,{children:"Name"}),(0,M.jsx)(I.TableCellHead,{children:"Value"})]})}),(0,M.jsxs)(I.TableBody,{children:[(i=(o=r.baseRequest)==null?void 0:o.parameters)==null?void 0:i.map(n=>(0,M.jsxs)(I.TableRow,{children:[(0,M.jsxs)(I.TableCellData,{width:"50%",children:[n.key,(0,M.jsx)("br",{}),(0,M.jsx)("i",{css:{color:"var(--gray-500)"},children:(0,M.jsx)("small",{children:"from data source"})})]}),(0,M.jsxs)(I.TableCellData,{width:"50%",children:[(0,M.jsx)("i",{css:{color:"var(--gray-500)"},children:n.value}),r.parameters.find(s=>s.key===n.key)?(0,M.jsx)(I.WarningMessage,{message:"overridden below"}):null]})]},n.key)),a.map((n,s)=>(0,M.jsxs)(I.TableRow,{children:[(0,M.jsx)(I.TableCellData,{width:"50%",children:(0,M.jsx)(I.Input,{label:n.key,value:n.key,showLabel:!1,onChange:l=>{l.currentTarget.value?t({type:"updateParameter",parameter:{key:l.currentTarget.value,value:n.value},index:s}):t({type:"removeParameter",index:s})}})}),(0,M.jsx)(I.TableCellData,{width:"50%",children:n.key?(0,M.jsx)(I.Input,{showLabel:!1,label:n.value,value:n.value,onChange:l=>t({type:"updateParameter",parameter:{key:n.key,value:l.currentTarget.value},index:s})}):null})]},s))]})]})})}var Ho=require("@emotion/react"),No=require("react");function Ca(e,t){return Sa(encodeURI(e),t)}function Ra(e,t){return{key:Sa(encodeURIComponent(e.key),t),value:Sa(encodeURIComponent(e.value),t)}}function Sa(e,t){return e.replace(/(\$|%24)%7B(.*?)%7D/g,(r,a,o)=>{var n;let i=decodeURIComponent(o);return(n=t==null?void 0:t[i])!=null&&n.default?t[i].default:`\${${i}}`})}var fe=require("@emotion/react/jsx-runtime");function Fn(){var a,o;let{variables:e}=ge(),{request:t}=K(),r=(0,No.useMemo)(()=>{var i;return(i=t.baseRequest)!=null&&i.parameters?t.baseRequest.parameters.filter(n=>!t.parameters.find(s=>s.key===n.key)).concat(t.parameters):t.parameters},[(a=t.baseRequest)==null?void 0:a.parameters,t.parameters]);return(0,fe.jsxs)("small",{css:Ho.css`
|
|
1162
1162
|
display: inline-block;
|
|
1163
1163
|
margin-bottom: var(--spacing-xs);
|
|
1164
1164
|
word-break: break-word;
|
|
1165
|
-
`,children:[t.baseRequest?(0,
|
|
1165
|
+
`,children:[t.baseRequest?(0,fe.jsx)("span",{children:(o=t.baseRequest)==null?void 0:o.baseUrl}):null,(0,fe.jsxs)("span",{css:{fontWeight:t.baseRequest?"bold":"inherit"},children:[Ca(t.relativeUrl,e),r.length>0?(0,fe.jsxs)(fe.Fragment,{children:["?",r.map((i,n)=>{let s=Ra(i,e);return(0,fe.jsxs)("span",{children:[n>0?"&":null,s.key,"=",s.value]},n)})]}):null]})]})}var Fo=require("@emotion/react/jsx-runtime");function $n(e){let{request:t,dispatch:r}=K();return(0,Fo.jsx)(va,{...e,value:t.relativeUrl,onPaste:a=>{var i,n,s;let o=a.indexOf("?");if(o>=0){let l=a.substring(0,o);((i=t.baseRequest)==null?void 0:i.baseUrl)&&l.startsWith((n=t.baseRequest)==null?void 0:n.baseUrl)&&(l=l.substring((s=t.baseRequest)==null?void 0:s.baseUrl.length)),r({type:"setRelativeUrl",relativeUrl:l});for(let p=t.parameters.length-1;p>=0;p--)r({type:"removeParameter",index:p});try{new URLSearchParams(a.substring(o)).forEach((d,u)=>{r({type:"updateParameter",parameter:{key:u,value:d}})})}catch(p){}}},onChange:a=>{r({type:"setRelativeUrl",relativeUrl:a})}})}var Pa=require("@emotion/react/jsx-runtime");function Wn({onChange:e,children:t}){var o;let{value:r}=Ee("dataSource"),a=$o(r);return(0,Pa.jsx)(at,{value:(o=r.variables)!=null?o:{},onChange:i=>e(n=>({newValue:{...n,variables:i}})),children:(0,Pa.jsx)(it,{value:a,onChange:i=>{e(n=>{let s=$o(n),l=i(s);return{newValue:Kn(n,l)}})},children:t})})}function $o(e){var t,r,a;return{headers:(t=e==null?void 0:e.headers)!=null?t:[],parameters:(r=e==null?void 0:e.parameters)!=null?r:[],relativeUrl:(a=e==null?void 0:e.baseUrl)!=null?a:""}}function Kn(e,t){return{...e,baseUrl:t.relativeUrl,headers:t.headers.length?t.headers:void 0,parameters:t.parameters}}var Ta=require("@emotion/react/jsx-runtime");function Qn({onChange:e,children:t}){var i;let{value:r,metadata:{dataSource:a}}=Ee("dataType"),o=Wo(r,a);return(0,Ta.jsx)(at,{value:(i=r.variables)!=null?i:{},onChange:n=>e(s=>({newValue:{...s,variables:n}})),children:(0,Ta.jsx)(it,{value:o,onChange:n=>{e(s=>{let l=Wo(s,a),p=n(l);return{newValue:Yn(s,p)}})},children:t})})}function Wo(e,t){var r,a;return{...e,headers:(r=e.headers)!=null?r:[],parameters:(a=e.parameters)!=null?a:[],relativeUrl:e.path,baseRequest:{baseUrl:t.baseUrl,headers:t.headers,parameters:t.parameters}}}function Yn(e,t){var r;return{...e,path:t.relativeUrl,headers:t.headers.length?t.headers:void 0,parameters:t.parameters.length?t.parameters:void 0,method:(r=t.method)!=null?r:"GET",body:t.body}}var Ot=require("@uniformdev/design-system");var Ko=require("@uniformdev/mesh-sdk"),qe=require("react"),La=({autoResizingDisabled:e}={})=>{let[t,r]=(0,qe.useState)(),[a,o]=(0,qe.useState)(),i=(0,qe.useRef)(!1);return(0,qe.useEffect)(()=>{typeof window=="undefined"||a||(typeof window.UniformMeshSDK=="undefined"&&!i.current?(i.current=!0,(0,Ko.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(n=>{o(n)}).catch(n=>{r(n)}).finally(()=>{i.current=!1})):o(window.UniformMeshSDK))},[e]),{initializing:!a&&!t,error:t,sdk:a}};var Ce=require("@emotion/react/jsx-runtime"),Zn=({children:e,loadingComponent:t,errorComponent:r})=>{let{initializing:a,error:o,sdk:i}=La();if(a||!i){let n=t;return n?(0,Ce.jsx)(n,{}):(0,Ce.jsx)(Ot.LoadingIndicator,{})}if(o){let n=r;if(n)return(0,Ce.jsx)(n,{error:o});throw o}return(0,Ce.jsxs)(et.Provider,{value:{sdk:i},children:[(0,Ce.jsx)(Ot.Theme,{}),(0,Ce.jsx)(tt,{children:e})]})};function Xn(){let{location:e}=rt();return e}function Jn(e,t){return r=>e(a=>{let{newValue:o,options:i}=r(a);return{newValue:o,options:t(o,i)}})}var h=require("@uniformdev/design-system");se(ne,require("@uniformdev/mesh-sdk"),module.exports);0&&(module.exports={AddListButton,Button,Callout,DamSelectedItem,DataResourceVariablesList,DataSourceEditor,DataTypeEditor,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputComboBox,InputKeywordSearch,InputSelect,InputToggle,InputVariables,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,MeshApp,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,RequestBody,RequestHeaders,RequestMethodSelect,RequestParameters,RequestProvider,RequestTypeContainer,RequestUrl,RequestUrlInput,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,TextVariableRenderer,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,VariableEditor,VariablesList,VariablesProvider,badgeIcon,createLocationValidator,damSelectItemImage,damSelectedItemContainer,damSelectedItemCopy,damSelectedItemDetails,damSelectedItemIcon,damSelectedItemInfoBtn,damSelectedItemInner,damSelectedItemLinkBtn,damSelectedItemLinkContainer,damSelectedItemMediaContainer,damSelectedItemPopover,damSelectedItemPopoverLabel,damSelectedItemSmallText,damSelectedItemTitle,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemIcon,productSelectedItemImage,productSelectedItemLinkContainer,productedSelectedItemLinkBtn,productedSelectedItemSmallText,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,urlEncodeRequestParameter,urlEncodeRequestUrl,useInitializeUniformMeshSdk,useMeshLocation,useProductQueryContext,useProductSearchContext,useRequest,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext,useVariables,variablesToList});
|