@uniformdev/mesh-sdk-react 16.0.1-alpha.221 → 16.1.1-alpha.145
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 +9 -3
- package/dist/index.esm.js +136 -136
- package/dist/index.js +128 -128
- package/dist/index.mjs +136 -136
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var xr=Object.create;var Se=Object.defineProperty;var Er=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Vr=Object.getPrototypeOf,Tr=Object.prototype.hasOwnProperty;var Qt=(t,n)=>{for(var o in n)Se(t,o,{get:n[o],enumerable:!0})},be=(t,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Mr(n))!Tr.call(t,a)&&a!==o&&Se(t,a,{get:()=>n[a],enumerable:!(r=Er(n,a))||r.enumerable});return t},U=(t,n,o)=>(be(t,n,"default"),o&&be(o,n,"default")),X=(t,n,o)=>(o=t!=null?xr(Vr(t)):{},be(n||!t||!t.__esModule?Se(o,"default",{value:t,enumerable:!0}):o,t)),Ir=t=>be(Se({},"__esModule",{value:!0}),t);var A={};Qt(A,{Button:()=>l.Button,Callout:()=>l.Callout,DefaultSearchRow:()=>lt,DefaultSelectedItem:()=>ot,EntrySearch:()=>Ct,Heading:()=>l.Heading,Icons:()=>xe,Input:()=>l.Input,InputSelect:()=>l.InputSelect,InputToggle:()=>l.InputToggle,KeywordSearchInput:()=>l.InputKeywordSearch,Label:()=>l.Label,LoadingIndicator:()=>l.LoadingIndicator,LoadingOverlay:()=>l.LoadingOverlay,Menu:()=>l.Menu,MenuItem:()=>l.MenuItem,ProductPreviewList:()=>We,ProductQuery:()=>Br,ProductQueryContext:()=>Qe,ProductSearch:()=>eo,ProductSearchContext:()=>At,ProductSearchRow:()=>Tt,ProductSelectedItem:()=>zt,ResolvableLoadingValue:()=>Fe,ScrollableList:()=>l.ScrollableList,ScrollableListItem:()=>l.ScrollableListItem,SelectionField:()=>Ke,Switch:()=>l.Switch,Textarea:()=>l.Textarea,Theme:()=>l.Theme,UniformMeshLocationContext:()=>Ae,UniformMeshLocationContextProvider:()=>Ue,UniformMeshSdkContext:()=>Be,UniformMeshSdkContextProvider:()=>zr,badgeIcon:()=>Ie,draggableContainer:()=>bt,draggableIcon:()=>Te,draggableIconOffset:()=>wt,draggableIconWrapper:()=>St,entrySearchBtn:()=>ut,entrySearchConfig:()=>gt,entrySearchConfigHidden:()=>ft,entrySearchLoadMoreBtn:()=>mt,entrySearchResultList:()=>vt,entrySearchSelectIcon:()=>ht,entrySearchSelectImg:()=>yt,entrySearchSelectInput:()=>qr,entrySearchSelectOption:()=>Jr,entrySearchWrapper:()=>pt,productSearchRowActiveIcon:()=>Mt,productSearchRowCategory:()=>xt,productSearchRowContainer:()=>Pt,productSearchRowContent:()=>Rt,productSearchRowContentActive:()=>Lt,productSearchRowDetails:()=>Et,productSearchRowTitle:()=>kt,productSelectedItemContainer:()=>It,productSelectedItemContent:()=>Gt,productSelectedItemDetails:()=>Dt,productSelectedItemImage:()=>De,searchRowBtn:()=>ct,searchRowContainer:()=>nt,searchRowContainerActive:()=>it,searchRowContainerWithPopover:()=>at,searchRowPopover:()=>st,searchRowText:()=>Ve,searchRowTextSmall:()=>Me,selectItemLinkBtn:()=>Ee,selectItemLinkContainer:()=>rt,selectItemPopover:()=>tt,selectItemPopoverLabel:()=>le,selectItemSmallText:()=>q,selectedItemCloseIcon:()=>et,selectedItemContainer:()=>Ze,selectedItemCopy:()=>qe,selectedItemDetails:()=>Ye,selectedItemIcon:()=>je,selectedItemInner:()=>Xe,selectedItemTitle:()=>Je,useInitializeUniformMeshSdk:()=>Gr,useProductQueryContext:()=>Ne,useProductSearchContext:()=>fe,useUniformMeshLocation:()=>Dr,useUniformMeshLocationContext:()=>Oe,useUniformMeshSdk:()=>Ar,useUniformMeshSdkContext:()=>He});module.exports=Ir(A);var e=require("@emotion/react"),M=X(require("react"));var ie=require("react"),Ae=(0,ie.createContext)(void 0),Ue=({children:t})=>{let[n,o]=(0,ie.useState)(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async(s,u)=>{await a.setValue(s,u),o(window.UniformMeshSDK.getCurrentLocation())},setValidationResult:async s=>{await a.setValidationResult(s)}}}}return(0,e.jsx)(Ae.Provider,{value:r},t)},Oe=()=>{let t=(0,ie.useContext)(Ae);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function Dr(){let{location:t}=Oe();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata(),setValidationResult:t==null?void 0:t.setValidationResult}}var Nt=require("@uniformdev/mesh-sdk"),me=require("react"),Gr=({autoResizingDisabled:t}={})=>{let[n,o]=(0,me.useState)(),[r,a]=(0,me.useState)();return(0,me.useEffect)(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?(0,Nt.initializeUniformMeshSDK)({autoResizingDisabled:t}).then(s=>{a(s)}).catch(s=>{o(s)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};var we=require("react");var Wt=require("@uniformdev/design-system"),Be=(0,we.createContext)(void 0),zr=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),(0,e.jsx)(Be.Provider,{value:n},(0,e.jsx)(Wt.Theme,null),(0,e.jsx)(Ue,null,t))},He=()=>{let t=(0,we.useContext)(Be);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Ar(){let{sdk:t}=He();return t}var _e=X(require("react"));var H=X(require("react"));var se=require("@emotion/react"),_t=require("@uniformdev/design-system");var $e=X(require("react")),Fe=({value:t,text:n,loading:o})=>(0,e.jsx)($e.default.Fragment,null,!!n&&n,!n&&(0,e.jsx)($e.default.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Ke=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:s,onRemove:u})=>{var h;let v=(h=a==null?void 0:a.filter(i=>!(r!=null&&r.includes(i.id.toString()))))!=null?h:[],m=(i,f)=>{i.preventDefault(),u(f)};return(0,e.jsx)("div",null,(0,e.jsx)(_t.InputSelect,{id:t,name:t,label:n,onChange:i=>s(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...v.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(r)&&r.length>0?se.css`
|
|
2
2
|
margin-bottom: var(--spacing-base);
|
|
3
|
-
`:""}),r==null?void 0:r.map(i=>{var
|
|
3
|
+
`:""}),r==null?void 0:r.map(i=>{var f;return(0,e.jsx)("div",{css:se.css`
|
|
4
4
|
font-size: var(--fs-sm);
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
align-items: center;
|
|
@@ -9,67 +9,67 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
9
9
|
border: 1px solid var(--gray-300);
|
|
10
10
|
margin-bottom: var(--spacing-sm);
|
|
11
11
|
margin-right: var(--spacing-sm);
|
|
12
|
-
`,key:i},(0,e.jsx)("span",{css:
|
|
12
|
+
`,key:i},(0,e.jsx)("span",{css:se.css`
|
|
13
13
|
padding: var(--spacing-3);
|
|
14
14
|
color: var(--gray-800);
|
|
15
|
-
`},(0,e.jsx)(
|
|
15
|
+
`},(0,e.jsx)(Fe,{value:i,loading:o,text:(f=a.find(C=>C.id===i))==null?void 0:f.name})),(0,e.jsx)("button",{css:se.css`
|
|
16
16
|
padding: var(--spacing-3);
|
|
17
17
|
border-left: 1px solid var(--gray-300);
|
|
18
|
-
`,title:"remove",onClick:
|
|
18
|
+
`,title:"remove",onClick:C=>m(C,i)},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",css:se.css`
|
|
19
19
|
height: 1.25rem;
|
|
20
20
|
width: 1.25rem;
|
|
21
21
|
pointer-events: none;
|
|
22
22
|
display: block;
|
|
23
|
-
`,viewBox:"0 0 20 20",fill:"currentColor"},(0,e.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var
|
|
23
|
+
`,viewBox:"0 0 20 20",fill:"currentColor"},(0,e.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var Ur=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.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"})),Ce=Ur;var Or=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.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"})),Pe=Or;var Re=require("react-use"),V=require("@uniformdev/design-system"),R=require("@emotion/react"),Zt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Br=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:s,brandsLoading:u,logoIcon:v,onGetProducts:m,sortOptions:h,sortOrderOptions:i,categoryLabel:f="Product Category",brandLabel:C="Brand",disableBrands:oe,restrictToSingleCategory:K=!1})=>{var p,D,B;let w=async d=>{n({...Zt,...t||{},...d})},y=(0,H.useMemo)(()=>({...Zt,...t||{}}),[t]),[ne,Q]=(0,Re.useAsyncFn)(async d=>await m(d),[m]);(0,Re.useDebounce)(async()=>{await Q({brand:y.brand,categories:y.categories,keyword:y.keyword,sort:y.sort,sortOrder:y.sortOrder,count:y.count})},250,[y]);let te=(0,H.useMemo)(()=>{let d=[];return r==null||r.forEach(b=>{let G=Yt(b,void 0);d.push(...G)}),d},[r]),N=(0,H.useMemo)(()=>[{value:"",label:"All categories"},...te.map(d=>({label:d.name,value:d.id}))],[te]),W=(0,H.useMemo)(()=>(o==null?void 0:o.map(d=>({id:d.id.toString(),name:d.name})))||[],[o]),he=d=>{if(!d)return;let b=(t==null?void 0:t.categories)||[];w({categories:[...b,d]})},ae=d=>{var b;w({categories:(b=t==null?void 0:t.categories)==null?void 0:b.filter(G=>G!==d)})},_=d=>{w({brand:d.target.value})},k=d=>{w({count:d||1})};return a?(0,e.jsx)("div",null,"Loading..."):(0,e.jsx)(Qe.Provider,{value:{categories:r,logoIcon:v}},(0,e.jsx)("div",{css:R.css`
|
|
24
24
|
> :not(:last-child) {
|
|
25
25
|
margin-bottom: var(--spacing-md);
|
|
26
26
|
}
|
|
27
|
-
`},K?(0,e.jsx)(
|
|
27
|
+
`},K?(0,e.jsx)(V.InputSelect,{id:"selection-field-product-category",label:f,disabled:a,value:(D=(p=y.categories)==null?void 0:p[0])!=null?D:"",options:N,onChange:d=>{w({categories:d.target.value===""?[]:[d.target.value]})}}):(0,e.jsx)(Ke,{loading:s||!1,id:"selection-field-product-category",label:f,onAdd:he,onRemove:ae,selectedValues:y.categories,values:te}),(0,e.jsx)("div",{css:R.css`
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-wrap: wrap;
|
|
30
30
|
column-gap: var(--spacing-lg);
|
|
31
31
|
row-gap: var(--spacing-md);
|
|
32
|
-
${(0,
|
|
32
|
+
${(0,V.mq)("md")} {
|
|
33
33
|
flex-wrap: nowrap;
|
|
34
34
|
}
|
|
35
|
-
`},
|
|
35
|
+
`},oe?null:(0,e.jsx)("div",{css:R.css`
|
|
36
36
|
width: 50%;
|
|
37
|
-
`},(0,e.jsx)(
|
|
37
|
+
`},(0,e.jsx)(V.InputSelect,{id:"brand",name:"brand",label:C,disabled:u,value:y.brand,onChange:_,options:[{value:"",label:"Choose..."},...W.map(d=>({value:d.id,label:d.name}))]})),(0,e.jsx)("div",{css:R.css`
|
|
38
38
|
flex-grow: 1;
|
|
39
39
|
position: relative;
|
|
40
|
-
`},(0,e.jsx)(
|
|
40
|
+
`},(0,e.jsx)(V.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:y.keyword,placeholder:"Enter keyword",onChange:d=>w({keyword:d.target.value})}))),(0,e.jsx)("div",{css:R.css`
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-wrap: wrap;
|
|
43
43
|
column-gap: var(--spacing-lg);
|
|
44
44
|
row-gap: var(--spacing-md);
|
|
45
|
-
${(0,
|
|
45
|
+
${(0,V.mq)("md")} {
|
|
46
46
|
flex-wrap: nowrap;
|
|
47
47
|
}
|
|
48
48
|
`},(0,e.jsx)("div",{css:R.css`
|
|
49
49
|
width: 100%;
|
|
50
|
-
${(0,
|
|
50
|
+
${(0,V.mq)("md")} {
|
|
51
51
|
width: 33.333333%;
|
|
52
52
|
}
|
|
53
53
|
position: relative;
|
|
54
|
-
`},(0,e.jsx)(
|
|
54
|
+
`},(0,e.jsx)(V.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:y.count,onChange:d=>k(d.target.valueAsNumber),label:"Count"}),(0,e.jsx)("div",{css:R.css`
|
|
55
55
|
position: absolute;
|
|
56
56
|
bottom: var(--spacing-sm);
|
|
57
57
|
right: var(--spacing-sm);
|
|
58
58
|
display: flex;
|
|
59
59
|
gap: var(--spacing-sm);
|
|
60
|
-
`},(0,e.jsx)(
|
|
60
|
+
`},(0,e.jsx)(Xt,{onCountChange:()=>k(y.count-1),countIcon:"decrement",disabled:y.count===1}),(0,e.jsx)(Xt,{onCountChange:()=>k(y.count+1),countIcon:"increment"}))),Array.isArray(h)&&h.length>0?(0,e.jsx)("div",{css:R.css`
|
|
61
61
|
flex-grow: 1;
|
|
62
|
-
${(0,
|
|
62
|
+
${(0,V.mq)("md")} {
|
|
63
63
|
width: 33.333333%;
|
|
64
64
|
}
|
|
65
|
-
`},(0,e.jsx)(
|
|
65
|
+
`},(0,e.jsx)(V.InputSelect,{id:"sort",name:"sort",label:"Sort",value:y.sort,onChange:d=>w({sort:d.target.value}),options:[{value:"",label:"Select a sort"},...h.map(d=>({value:d.sortKey,label:d.name}))]})):null,Array.isArray(i)&&i.length>0?(0,e.jsx)("div",{css:R.css`
|
|
66
66
|
flex-grow: 1;
|
|
67
|
-
`},(0,e.jsx)(
|
|
67
|
+
`},(0,e.jsx)(V.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:y.sortOrder,onChange:d=>w({sortOrder:d.target.value}),options:i.map(d=>({value:d.sortOrderKey,label:d.name}))})):null),(0,e.jsx)("div",null,(0,e.jsx)("h3",{css:R.css`
|
|
68
68
|
font-size: var(--fs-md);
|
|
69
69
|
line-height: var(--spacing-md);
|
|
70
70
|
font-weight: var(--fw-bold);
|
|
71
71
|
margin-bottom: var(--spacing-xs);
|
|
72
|
-
`},"Result Preview"),(0,e.jsx)(We,{products:(
|
|
72
|
+
`},"Result Preview"),(0,e.jsx)(We,{products:(B=ne.value)==null?void 0:B.products}))))};function Yt(t,n){var s;let o=[],r=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${r}${t.name}`};return o.push(a),(s=t.children)==null||s.forEach(u=>{let v=Yt(u,a);o.push(...v)}),o}function Xt({onCountChange:t,countIcon:n,disabled:o}){return(0,e.jsx)("button",{css:R.css`
|
|
73
73
|
width: 2.25rem;
|
|
74
74
|
height: 2.25rem;
|
|
75
75
|
border: 1px solid var(--gray-300);
|
|
@@ -91,72 +91,73 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
91
91
|
`}):(0,e.jsx)(Pe,{css:R.css`
|
|
92
92
|
width: 1rem;
|
|
93
93
|
height: 1rem;
|
|
94
|
-
`}))}var
|
|
94
|
+
`}))}var Qe=H.default.createContext(void 0),Ne=()=>{let t=(0,H.useContext)(Qe);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function Y({src:t,alt:n,className:o}){let r=t&&typeof t!="string"?t:null;return r?(0,e.jsx)(r,{className:o}):(0,e.jsx)("img",{src:t,alt:n,className:o})}var L=require("@emotion/react"),qt=require("@uniformdev/design-system"),We=({products:t})=>{let{categories:n,logoIcon:o}=Ne();return(0,e.jsx)(_e.default.Fragment,null,(0,e.jsx)("p",{css:L.css`
|
|
95
95
|
margin-bottom: var(--spacing-base);
|
|
96
|
-
`},"Matching ",(t==null?void 0:t.length)||0," products"),(0,e.jsx)("ul",{css:[
|
|
96
|
+
`},"Matching ",(t==null?void 0:t.length)||0," products"),(0,e.jsx)("ul",{css:[L.css`
|
|
97
97
|
max-height: 24rem;
|
|
98
98
|
overflow-x: auto;
|
|
99
|
-
`,
|
|
99
|
+
`,qt.scrollbarStyles]},t==null?void 0:t.map((r,a)=>{var v,m;let[s]=(r==null?void 0:r.categories)||[],u=typeof s=="undefined"||!n||(v=n.find(h=>h.id===s.id))==null?void 0:v.name;return(0,e.jsx)("li",{key:`product-${r.id}`,css:L.css`
|
|
100
100
|
border: 1px solid var(--gray-300);
|
|
101
101
|
border-radius: var(--rounded-md);
|
|
102
102
|
background-color: var(--gray-100);
|
|
103
103
|
margin: var(--spacing-base) 0;
|
|
104
|
-
`},(0,e.jsx)("div",{css:
|
|
104
|
+
`},(0,e.jsx)("div",{css:L.css`
|
|
105
105
|
padding: var(--spacing-sm);
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-grow: 1;
|
|
108
108
|
margin-right: var(--spacing-sm);
|
|
109
109
|
gap: var(--spacing-base);
|
|
110
110
|
align-items: center;
|
|
111
|
-
`},r.thumbnailUrl?(0,e.jsx)("img",{src:r.thumbnailUrl,alt:r.name||`Product ${a}`,css:
|
|
111
|
+
`},r.thumbnailUrl?(0,e.jsx)("img",{src:r.thumbnailUrl,alt:typeof r.title=="string"?r.title:r.name||`Product ${a}`,css:L.css`
|
|
112
112
|
background-color: var(--gray-200);
|
|
113
113
|
width: 3.5rem;
|
|
114
114
|
height: 3.5rem;
|
|
115
115
|
object-fit: cover;
|
|
116
|
-
`}):(0,e.jsx)("div",{css:
|
|
116
|
+
`}):(0,e.jsx)("div",{css:L.css`
|
|
117
117
|
height: 3.5rem;
|
|
118
118
|
width: 3.5rem;
|
|
119
119
|
background-color: var(--gray-100);
|
|
120
|
-
`}),(0,e.jsx)("h4",{css:
|
|
120
|
+
`}),(0,e.jsx)("h4",{css:L.css`
|
|
121
121
|
font-weight: var(--fw-bold);
|
|
122
122
|
width: 33.333333%;
|
|
123
123
|
font-size: var(--fs-sm);
|
|
124
|
-
|
|
124
|
+
margin-top: 0px;
|
|
125
|
+
`},r.title||r.name,u&&(0,e.jsx)("span",{css:L.css`
|
|
125
126
|
display: block;
|
|
126
127
|
font-weight: var(--fw-regular);
|
|
127
|
-
`},
|
|
128
|
+
`},u)),r&&(0,e.jsx)(_e.default.Fragment,null,(0,e.jsx)("p",{css:L.css`
|
|
128
129
|
margin-right: var(--spacing-lg);
|
|
129
130
|
font-size: var(--fs-sm);
|
|
130
|
-
`},"SKU: ",r.sku||r.id,(0,e.jsx)("br",null)),r.price!==void 0?(0,e.jsx)("p",{css:
|
|
131
|
+
`},"SKU: ",r.sku||r.id,(0,e.jsx)("br",null)),r.price!==void 0?(0,e.jsx)("p",{css:L.css`
|
|
131
132
|
margin-right: var(--spacing-lg);
|
|
132
133
|
font-size: var(--fs-sm);
|
|
133
|
-
`},(0,e.jsx)("span",{css:
|
|
134
|
+
`},(0,e.jsx)("span",{css:L.css`
|
|
134
135
|
display: block;
|
|
135
|
-
`},"Price: ",r.price)):null,(0,e.jsx)("a",{css:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
136
|
+
`},"Price: ",r.price)):null,r.editLink||r.url?(0,e.jsx)("a",{css:L.css`
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
align-items: center;
|
|
140
|
+
padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-base);
|
|
141
|
+
background-color: var(--white);
|
|
142
|
+
border-radius: var(--rounded-base);
|
|
143
|
+
border: 2px solid var(--gray-400);
|
|
144
|
+
margin-left: auto;
|
|
145
|
+
&:hover {
|
|
146
|
+
background-color: var(--gray-100);
|
|
147
|
+
}
|
|
148
|
+
`,href:(m=r.editLink)!=null?m:r.url,title:`Go to ${r.title||r.name}`,target:"_blank",rel:"noopener noreferrer"},(0,e.jsx)("span",{css:L.css`
|
|
149
|
+
font-size: var(--fs-sm);
|
|
150
|
+
margin-right: var(--spacing-sm);
|
|
151
|
+
`},"Edit"),o?(0,e.jsx)(Y,{src:o,alt:"Logo",css:L.css`
|
|
152
|
+
width: 2.25rem;
|
|
153
|
+
height: 2.25rem;
|
|
154
|
+
`}):null):null)))})))};var ee=X(require("react"));var I=X(require("react"));var xe={};Qt(xe,{Caution:()=>Jt,Checkmark:()=>Le,ChevronDown:()=>ke,Close:()=>ce,Danger:()=>jt,ExclamationPoint:()=>er,Info:()=>de,Lightbulb:()=>tr,MagnifyingGlass:()=>rr,MaximizeAlt:()=>or,Minus:()=>Pe,MoreVerticalAlt:()=>ge,Plus:()=>Ce});var Hr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},(0,e.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"})),Jt=Hr;var $r=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.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"})),Le=$r;var Fr=t=>(0,e.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},(0,e.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"})),ke=Fr;var Kr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},(0,e.jsx)("g",{fillRule:"evenodd"},(0,e.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,e.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"}))),ce=Kr;var Qr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.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"})),jt=Qr;var Nr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},(0,e.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"})),er=Nr;var Wr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.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,e.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"})),de=Wr;var _r=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.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"})),tr=_r;var Zr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("g",{clipPath:"url(#magnifying-glass_svg__a)"},(0,e.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,e.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,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"magnifying-glass_svg__a"},(0,e.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),rr=Zr;var Xr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.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"})),or=Xr;var Yr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.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"})),ge=Yr;var cr=require("react-use"),dr=require("uuid");var $=X(require("react"));function nr(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}var ir=require("timeago.js");var T=require("@emotion/react"),ar=require("@uniformdev/design-system"),Ze=T.css`
|
|
154
155
|
border: 1px solid var(--gray-200);
|
|
155
156
|
background: var(--gray-50);
|
|
156
157
|
border-radius: var(--rounded-base);
|
|
157
158
|
display: flex;
|
|
158
159
|
width: 100%;
|
|
159
|
-
`,
|
|
160
|
+
`,Xe=T.css`
|
|
160
161
|
align-items: center;
|
|
161
162
|
display: flex;
|
|
162
163
|
flex-grow: 1;
|
|
@@ -164,24 +165,25 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
164
165
|
margin-inline: 0 var(--spacing-sm);
|
|
165
166
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
166
167
|
position: relative;
|
|
167
|
-
`,
|
|
168
|
+
`,Ye=T.css`
|
|
168
169
|
flex-grow: 1;
|
|
169
|
-
`,
|
|
170
|
+
`,qe=T.css`
|
|
170
171
|
align-items: start;
|
|
171
172
|
display: inline-flex;
|
|
172
173
|
position: relative;
|
|
173
|
-
`,
|
|
174
|
+
`,Je=T.css`
|
|
174
175
|
color: var(--brand-secondary-1);
|
|
175
176
|
font-size: var(--fs-base);
|
|
176
177
|
font-weight: var(--fw-bold);
|
|
177
178
|
line-height: 1;
|
|
178
|
-
|
|
179
|
+
margin: 0;
|
|
180
|
+
`,je=T.css`
|
|
179
181
|
width: 1.5rem;
|
|
180
182
|
height: 1.5rem;
|
|
181
|
-
`,
|
|
183
|
+
`,et=T.css`
|
|
182
184
|
width: 1rem;
|
|
183
185
|
height: 1rem;
|
|
184
|
-
`,
|
|
186
|
+
`,tt=T.css`
|
|
185
187
|
background: var(--white);
|
|
186
188
|
border-radius: var(--rounded-base);
|
|
187
189
|
border-left: 4px solid var(--brand-secondary-3);
|
|
@@ -190,21 +192,22 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
190
192
|
padding: var(--spacing-base);
|
|
191
193
|
z-index: var(--z-10);
|
|
192
194
|
width: max-content;
|
|
193
|
-
`,q=
|
|
195
|
+
`,q=T.css`
|
|
194
196
|
font-size: var(--fs-sm);
|
|
195
|
-
`,
|
|
197
|
+
`,le=T.css`
|
|
196
198
|
font-weight: var(--fw-bold);
|
|
197
199
|
margin-right: var(--spacing-sm);
|
|
198
|
-
`,
|
|
200
|
+
`,rt=T.css`
|
|
199
201
|
display: flex;
|
|
200
202
|
flex-direction: column;
|
|
201
203
|
gap: var(--spacing-sm);
|
|
202
204
|
|
|
203
|
-
${(0,
|
|
205
|
+
${(0,ar.mq)("md")} {
|
|
204
206
|
flex-direction: row;
|
|
205
207
|
min-width: 200px;
|
|
208
|
+
justify-content: end;
|
|
206
209
|
}
|
|
207
|
-
`,
|
|
210
|
+
`,Ee=T.css`
|
|
208
211
|
align-items: center;
|
|
209
212
|
background: var(--white);
|
|
210
213
|
border-radius: var(--rounded-base);
|
|
@@ -217,42 +220,41 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
217
220
|
&:hover {
|
|
218
221
|
background: var(--gray-50);
|
|
219
222
|
}
|
|
220
|
-
`;var O=require("@emotion/react");var
|
|
223
|
+
`;var O=require("@emotion/react");var ot=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var h;let a=(0,$.useRef)(null),s=(0,$.useRef)(null),[u,v]=(0,$.useState)(!1);(0,$.useEffect)(()=>{let i=C=>{a.current&&!a.current.contains(C.target)&&s.current&&!s.current.contains(C.target)&&v(!1)},f=()=>{v(!1)};return window.addEventListener("resize",f,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",f,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[s]);let m=()=>{var i;if(v(!u),s.current&&a.current){let f=(i=a==null?void 0:a.current)==null?void 0:i.getBoundingClientRect(),C=s.current.offsetWidth;s.current.style.top=`${f.top+30}px`,s.current.style.left=`${f.left-C+30}px`}};return(0,e.jsx)("div",{css:Ze,key:t.id},(0,e.jsx)("div",{css:Xe},(0,e.jsx)("div",{css:Ye},(0,e.jsx)("div",{css:qe},(0,e.jsx)("h4",{css:[Je,t.popoverData?O.css`
|
|
221
224
|
margin-bottom: var(--spacing-sm);
|
|
222
|
-
`:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?(0,e.jsx)(
|
|
225
|
+
`:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?(0,e.jsx)($.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:a,css:O.css`
|
|
223
226
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
224
|
-
`,"aria-controls":"path-details","aria-expanded":
|
|
227
|
+
`,"aria-controls":"path-details","aria-expanded":u,onClick:m},(0,e.jsx)(de,{width:24,height:24,css:O.css`
|
|
225
228
|
color: var(--gray-400);
|
|
226
|
-
`})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!
|
|
229
|
+
`})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!u,ref:s,css:[tt,u?O.css`
|
|
227
230
|
visibility: visible;
|
|
228
231
|
`:O.css`
|
|
229
232
|
visibility: hidden;
|
|
230
|
-
`]},Object.entries(t.popoverData).map(([i,
|
|
231
|
-
display: flex;
|
|
232
|
-
gap: var(--spacing-base);
|
|
233
|
-
`},t.metadata?Object.entries(t.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,g])=>(0,e.jsx)("span",{css:q,key:i},g)):null),t.metadata?Object.entries(t.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,g])=>(0,e.jsx)("div",{css:[q,O.css`
|
|
233
|
+
`]},Object.entries(t.popoverData).map(([i,f],C)=>(0,e.jsx)("div",{css:q,key:C},(0,e.jsx)("span",{css:le},i,":"),f)))):null),t.createdDate&&(0,e.jsx)("div",{css:q},(0,e.jsx)("span",{css:le},"Created:"),(0,ir.format)((h=t.createdDate)!=null?h:0)),t.metadata?Object.entries(t.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,f])=>(0,e.jsx)("div",{css:[q,O.css`
|
|
234
234
|
order: 1;
|
|
235
|
-
`],key:i},(0,e.jsx)("span",{css:[
|
|
235
|
+
`],key:i},(0,e.jsx)("span",{css:le},i,":"),f)):null,t.metadata?Object.entries(t.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,f])=>(0,e.jsx)("div",{css:[q,O.css`
|
|
236
|
+
order: 1;
|
|
237
|
+
`],key:i},(0,e.jsx)("span",{css:[le,O.css`
|
|
236
238
|
order: 1;
|
|
237
|
-
`]},i,":"),
|
|
239
|
+
`]},i,":"),f)):null),(0,e.jsx)("div",{css:rt},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{r&&(nr(i.currentTarget.href,()=>r(t)),i.preventDefault())},css:Ee},(0,e.jsx)("span",{css:q},"Edit"),(0,e.jsx)(Y,{src:n,css:je,alt:"Logo"})):null,(0,e.jsx)("button",{type:"button",onClick:()=>{o(t)},css:Ee},(0,e.jsx)("span",{css:q},"Unlink"),(0,e.jsx)(ce,{css:[et,O.css`
|
|
238
240
|
color: var(--brand-secondary-5);
|
|
239
|
-
`]})))))};var
|
|
241
|
+
`]})))))};var F=X(require("react"));var J=require("@emotion/react"),nt=J.css`
|
|
240
242
|
cursor: pointer;
|
|
241
243
|
padding: var(--spacing-sm);
|
|
242
244
|
position: relative;
|
|
243
245
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
244
246
|
color var(--duration-fast) var(--timing-ease-out);
|
|
245
|
-
`,
|
|
247
|
+
`,at=J.css`
|
|
246
248
|
padding-right: var(--spacing-lg);
|
|
247
|
-
`,
|
|
249
|
+
`,it=J.css`
|
|
248
250
|
background: var(--brand-secondary-3);
|
|
249
251
|
color: var(--white);
|
|
250
|
-
`,
|
|
252
|
+
`,Me=J.css`
|
|
251
253
|
font-size: var(--fs-xs);
|
|
252
|
-
`,
|
|
254
|
+
`,Ve=J.css`
|
|
253
255
|
font-weight: var(--fw-bold);
|
|
254
256
|
margin-right: var(--spacing-sm);
|
|
255
|
-
`,
|
|
257
|
+
`,st=J.css`
|
|
256
258
|
background: var(--white);
|
|
257
259
|
border-left: 4px solid var(--brand-secondary-3);
|
|
258
260
|
border-radius: var(--rounded-base);
|
|
@@ -264,20 +266,20 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
264
266
|
right: var(--spacing-xl);
|
|
265
267
|
z-index: var(--z-10);
|
|
266
268
|
width: max-content;
|
|
267
|
-
`,
|
|
269
|
+
`,ct=J.css`
|
|
268
270
|
position: absolute;
|
|
269
271
|
inset: 0 var(--spacing-sm) 0 auto;
|
|
270
|
-
`;var
|
|
272
|
+
`;var dt=require("@emotion/react"),lt=({result:t,isSelected:n,triggerSelection:o})=>{let r=(0,F.useRef)(null),a=(0,F.useRef)(null),[s,u]=(0,F.useState)(!1);(0,F.useEffect)(()=>{function m(h){r.current&&!r.current.contains(h.target)&&a.current&&!a.current.contains(h.target)&&u(!1)}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[a]);let v=m=>{m.stopPropagation(),u(!s)};return(0,e.jsx)("div",{key:t.id,css:[nt,n?it:void 0,t.popoverData?at:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?(0,e.jsx)(F.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:r,css:ct,"aria-controls":"path-details",onClick:m=>v(m),"aria-expanded":s},(0,e.jsx)(de,{width:24,height:24})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!s,ref:a,css:[st,s?dt.css`
|
|
271
273
|
visibility: visible;
|
|
272
|
-
`:
|
|
274
|
+
`:dt.css`
|
|
273
275
|
visibility: hidden;
|
|
274
|
-
`]},t.metadata&&Object.entries(t.metadata).map(([h
|
|
276
|
+
`]},t.metadata&&Object.entries(t.metadata).map(([m,h],i)=>(0,e.jsx)("div",{css:Me,key:i},(0,e.jsx)("span",{css:Ve},m,":"),h)),Object.entries(t.popoverData).map(([m,h],i)=>(0,e.jsx)("div",{css:Me,key:i},(0,e.jsx)("span",{css:Ve},m,":"),h)))):null)};var pe=require("react-beautiful-dnd");var P=require("@emotion/react"),pt=P.css`
|
|
275
277
|
background: var(--white);
|
|
276
278
|
border: 1px solid var(--gray-300);
|
|
277
279
|
border-radius: var(--rounded-base);
|
|
278
280
|
padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
|
|
279
281
|
margin-bottom: var(--spacing-base);
|
|
280
|
-
`,
|
|
282
|
+
`,ut=P.css`
|
|
281
283
|
align-items: center;
|
|
282
284
|
display: flex;
|
|
283
285
|
position: relative;
|
|
@@ -285,7 +287,7 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
285
287
|
width: 100%;
|
|
286
288
|
background-color: transparent;
|
|
287
289
|
border: 0;
|
|
288
|
-
`,
|
|
290
|
+
`,mt=P.css`
|
|
289
291
|
color: var(--brand-secondary-1);
|
|
290
292
|
display: block;
|
|
291
293
|
font-weight: var(--fw-bold);
|
|
@@ -301,26 +303,27 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
301
303
|
background: var(--gray-100);
|
|
302
304
|
outline: none;
|
|
303
305
|
}
|
|
304
|
-
`,
|
|
306
|
+
`,gt=P.css`
|
|
305
307
|
background: var(--white);
|
|
306
308
|
border: 1px solid var(--gray-300);
|
|
307
309
|
border-radius: var(--rounded-base);
|
|
308
310
|
padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
|
|
309
311
|
display: block;
|
|
310
|
-
`,
|
|
312
|
+
`,ft=P.css`
|
|
311
313
|
display: none;
|
|
312
|
-
`,
|
|
314
|
+
`,vt=P.css`
|
|
313
315
|
overflow-y: auto;
|
|
314
|
-
|
|
316
|
+
height: 16rem;
|
|
315
317
|
margin-bottom: var(--spacing-base);
|
|
318
|
+
position: relative;
|
|
316
319
|
|
|
317
320
|
& > :not(:last-child) {
|
|
318
321
|
border-bottom: 1px solid var(--gray-200);
|
|
319
322
|
}
|
|
320
|
-
`,
|
|
323
|
+
`,qr=P.css`
|
|
321
324
|
background-color: var(--gray-50);
|
|
322
325
|
max-width: 33.33%;
|
|
323
|
-
`,
|
|
326
|
+
`,ht=P.css`
|
|
324
327
|
align-items: center;
|
|
325
328
|
display: flex;
|
|
326
329
|
position: absolute;
|
|
@@ -333,17 +336,17 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
333
336
|
height: 1.25rem;
|
|
334
337
|
transition: transform var(--duration-fast) var(--timing-ease-out);
|
|
335
338
|
transform: rotate(0);
|
|
336
|
-
`,
|
|
339
|
+
`,Jr=P.css`
|
|
337
340
|
background: var(--white);
|
|
338
341
|
color: var(--brand-secondary-1);
|
|
339
|
-
`,
|
|
342
|
+
`,bt=P.css`
|
|
340
343
|
position: relative;
|
|
341
344
|
margin-block: var(--spacing-sm) 0;
|
|
342
345
|
|
|
343
346
|
&:hover > span {
|
|
344
347
|
opacity: 0.3;
|
|
345
348
|
}
|
|
346
|
-
`,
|
|
349
|
+
`,St=P.css`
|
|
347
350
|
align-items: center;
|
|
348
351
|
display: flex;
|
|
349
352
|
position: absolute;
|
|
@@ -352,99 +355,95 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
352
355
|
opacity: 0;
|
|
353
356
|
`,Te=P.css`
|
|
354
357
|
color: var(--brand-secondary-1);
|
|
355
|
-
`,
|
|
358
|
+
`,wt=P.css`
|
|
356
359
|
position: absolute;
|
|
357
360
|
left: 0.375rem;
|
|
358
361
|
`,Ie=P.css`
|
|
359
362
|
width: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
360
363
|
height: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
361
|
-
`;var
|
|
364
|
+
`;var z=require("@emotion/react"),S=require("@uniformdev/design-system");var re=require("react");function sr(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=(0,re.useState)("IDLE"),s=(0,re.useRef)(void 0);return(0,re.useEffect)(()=>{t&&r==="IDLE"&&(clearTimeout(s.current),s.current=setTimeout(()=>{if(!t)return a("IDLE");s.current=setTimeout(()=>{a("EXPIRE")},o),a("DISPLAY")},n),a("DELAY")),!t&&r!=="DISPLAY"&&(clearTimeout(s.current),a("IDLE"))},[t,r,n,o]),(0,re.useEffect)(()=>()=>clearTimeout(s.current),[]),r==="DISPLAY"||r==="EXPIRE"}var jr=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&n!=="any"&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),(0,e.jsx)(S.Callout,{type:"info"},o)},Ct=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:s,multiSelect:u,multiSelectId:v,rowComponent:m,selectedItemComponent:h,totalResults:i,resultsLoading:f,requireContentType:C,onAddNew:oe,onEditClosed:K,onCancel:w,noResultsComponent:y,helpComponent:ne,onSort:Q,typeSelectorLabel:te="Content Type Select",typeSelectorAllTypesOptionText:N="All content types",loadingIndicatorDelay:W=1e3})=>{var $t,Ft,Kt;let ae=()=>C?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[_,k]=I.useState(""),[p,D]=I.useState(ae),[B,d]=I.useState(!1),[b,G]=I.useState([]),[mr,Ut]=I.useState(!1),ze=I.useRef(`x${(0,dr.v4)()}`),ye=(0,cr.useThrottle)(_,750);I.useEffect(()=>{t(ye,{count:5,offset:0,contentType:p==="any"?void 0:p})},[ye,p]);let gr=sr(f,{delay:W}),fr=c=>{b.some(g=>g.id===c.id)?G(g=>g.filter(Z=>Z.id!==c.id)):G(u?g=>[...g,c]:[c])},vr=r==null?void 0:r.map(c=>c.id+c.title).join(",");I.useEffect(()=>{Array.isArray(r)&&G(r)},[vr]);let hr=()=>{D(ae()),k(""),G(r!=null&&r.length?r:[])},yr=()=>{d(c=>!c),B||hr()},Ot=c=>{let g=(b==null?void 0:b.filter(Z=>Z.id!==c.id))||[];G(g),s(g,"")},br=c=>{c.preventDefault(),s(b,p),d(!1)},Sr=c=>{c.preventDefault(),d(!1),w&&w()},wr=()=>{t(ye,{count:5,offset:(n==null?void 0:n.length)||0,contentType:p==="any"?void 0:p}),Ut(!0);let c=setTimeout(()=>{Ut(!1)},750);return()=>clearTimeout(c)},Cr=!(r==null?void 0:r.length)||u,Pr=m||lt,Bt=h||ot,Rr=y||jr,Ht=a&&typeof a!="string"?a:null,Lr=Ht?(0,e.jsx)(Ht,{css:Ie}):(0,e.jsx)("img",{src:a,alt:"Logo",css:Ie}),kr=c=>{var g,Z;if(c.destination&&c.source.droppableId===((g=c.destination)==null?void 0:g.droppableId)){let E=[...r||[]],[ue]=(Z=E==null?void 0:E.splice(c.source.index,1))!=null?Z:[];return E==null||E.splice(c.destination.index,0,ue),Q&&(G(E),Q==null||Q(E)),E}};return(0,e.jsx)("div",{css:z.css`
|
|
362
365
|
width: 100%;
|
|
363
|
-
`},(0,e.jsx)("div",{css:
|
|
366
|
+
`},(0,e.jsx)("div",{css:z.css`
|
|
364
367
|
position: relative;
|
|
365
368
|
margin-block: var(--spacing-base);
|
|
366
|
-
`},
|
|
369
|
+
`},Cr?(0,e.jsx)(I.Fragment,null,(0,e.jsx)("div",{css:pt,"data-test-id":"component-search"},(0,e.jsx)("button",{css:ut,onClick:yr,type:"button","aria-haspopup":!0,"aria-expanded":B,"aria-controls":`entry-search-config-${ze.current}`},Lr,(0,e.jsx)("span",{css:z.css`
|
|
367
370
|
margin-left: var(--spacing-base);
|
|
368
|
-
`},"Select"),(0,e.jsx)("span",{css:
|
|
371
|
+
`},"Select"),(0,e.jsx)("span",{css:ht},(0,e.jsx)(ke,{css:[yt,B?z.css`
|
|
369
372
|
transform: rotate(180deg);
|
|
370
|
-
`:void 0]})))),(0,e.jsx)("div",{id:`entry-search-config-${
|
|
373
|
+
`:void 0]})))),(0,e.jsx)("div",{id:`entry-search-config-${ze.current}`,"aria-hidden":!B,css:[gt,B?void 0:ft]},ne||null,(0,e.jsx)("div",{css:z.css`
|
|
371
374
|
display: flex;
|
|
372
375
|
gap: calc(var(--spacing-base) - 0.25rem);
|
|
373
376
|
margin-bottom: var(--spacing-base);
|
|
374
|
-
`},(0,e.jsx)(S.InputSelect,{onChange:c=>
|
|
377
|
+
`},(0,e.jsx)(S.InputSelect,{onChange:c=>D(c.target.value),value:p,label:te,showLabel:!1,options:[...C?[]:[{value:"any",label:N}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),(0,e.jsx)("div",{css:z.css`
|
|
375
378
|
flex-grow: 1;
|
|
376
|
-
`},(0,e.jsx)(S.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:
|
|
377
|
-
padding: var(--spacing-base);
|
|
378
|
-
text-align: center;
|
|
379
|
-
width: 100%;
|
|
380
|
-
`},(0,e.jsx)(S.LoadingIndicator,null)):null),(0,e.jsx)("div",{css:D.css`
|
|
379
|
+
`},(0,e.jsx)(S.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:k,disabledFieldSubmission:!0,value:_}))),(0,e.jsx)("div",{css:[vt,S.scrollbarStyles],id:ze.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(0,e.jsx)(S.LoadingOverlay,{isActive:gr}),Array.isArray(n)&&n.length>0?n.map(c=>(0,e.jsx)(Pr,{key:c.id,isSelected:b.some(g=>g.id===c.id),result:c,triggerSelection:()=>fr(c)})):(0,e.jsx)(Rr,{searchText:ye||_,selectedContentType:(Ft=($t=o==null?void 0:o.find(c=>c.id===p))==null?void 0:$t.name)!=null?Ft:p}),!f&&typeof i!="undefined"&&n&&(n==null?void 0:n.length)<i&&(0,e.jsx)("button",{type:"button",css:mt,onClick:wr},mr?(0,e.jsx)(S.LoadingIndicator,null):"Load More")),(0,e.jsx)("div",{css:z.css`
|
|
381
380
|
display: flex;
|
|
382
381
|
justify-content: space-between;
|
|
383
|
-
`},(0,e.jsx)("div",null,
|
|
382
|
+
`},(0,e.jsx)("div",null,oe&&((Kt=o==null?void 0:o.length)!=null?Kt:0)>0?(0,e.jsx)(S.Menu,{menuLabel:"Add new menu",menuTrigger:(0,e.jsx)(S.Button,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>(0,e.jsx)(S.MenuItem,{key:c.id,css:z.css`
|
|
384
383
|
background: var(--white);
|
|
385
384
|
color: var(--brand-secondary-1);
|
|
386
|
-
`,onClick:()=>
|
|
385
|
+
`,onClick:()=>oe(c)},c.name))):null),(0,e.jsx)("div",{css:z.css`
|
|
387
386
|
display: flex;
|
|
388
387
|
gap: var(--spacing-base);
|
|
389
|
-
`},(0,e.jsx)(S.Button,{buttonType:"unimportant",onClick:
|
|
390
|
-
|
|
391
|
-
|
|
388
|
+
`},(0,e.jsx)(S.Button,{buttonType:"unimportant",onClick:Sr},"Cancel"),(0,e.jsx)(S.Button,{disabled:!b.length,onClick:br,"data-test-id":"entry-accept-button"},"Accept"))))):null,B?null:u?(0,e.jsx)(pe.DragDropContext,{onDragEnd:c=>kr(c)},(0,e.jsx)(pe.Droppable,{droppableId:v||"canvas-multi-select"},c=>(0,e.jsx)("div",{...c.droppableProps,ref:c.innerRef,css:z.css`
|
|
389
|
+
margin-block: var(--spacing-sm) 0;
|
|
390
|
+
`},b==null?void 0:b.map((g,Z)=>{if(g!=null&&g.id)return(0,e.jsx)(pe.Draggable,{key:g.id,draggableId:g.id,index:Z},E=>(0,e.jsx)("div",{css:bt,ref:E.innerRef,...E.draggableProps,...E.dragHandleProps},(0,e.jsx)("span",{css:St},(0,e.jsx)(ge,{css:[Te,wt],width:24,height:24}),(0,e.jsx)(ge,{css:Te,width:24,height:24})),(0,e.jsx)(Bt,{key:`selected-item-${g.id}`,logoIcon:a,selectedItem:g,onDeselect:ue=>Ot(ue),onEditClosed:K?ue=>K(ue):void 0})))}),c.placeholder))):b==null?void 0:b.map(c=>(0,e.jsx)(Bt,{key:`selected-item-${c.id}`,logoIcon:a,selectedItem:c,onDeselect:g=>Ot(g),onEditClosed:K?g=>K(g):void 0}))))};var j=require("@emotion/react"),Pt=j.css`
|
|
392
391
|
cursor: pointer;
|
|
393
392
|
padding: var(--spacing-sm) 0;
|
|
394
393
|
margin-right: var(--spacing-sm);
|
|
395
394
|
position: relative;
|
|
396
395
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
397
396
|
color var(--duration-fast) var(--timing-ease-out);
|
|
398
|
-
`,
|
|
397
|
+
`,Rt=j.css`
|
|
399
398
|
border: 2px solid transparent;
|
|
400
399
|
border-radius: var(--rounded-base);
|
|
401
400
|
display: flex;
|
|
402
401
|
align-items: center;
|
|
403
402
|
gap: var(--spacing-base);
|
|
404
403
|
padding: var(--spacing-sm) var(--spacing-xs);
|
|
405
|
-
`,
|
|
404
|
+
`,Lt=j.css`
|
|
406
405
|
background-color: var(--green-50);
|
|
407
|
-
`,
|
|
406
|
+
`,kt=j.css`
|
|
408
407
|
font-size: var(--fs-sm);
|
|
409
408
|
font-weight: var(--fw-bold);
|
|
410
409
|
width: 50%;
|
|
411
|
-
`,
|
|
410
|
+
`,xt=j.css`
|
|
412
411
|
font-weight: var(--fw-normal);
|
|
413
412
|
display: block;
|
|
414
|
-
`,
|
|
413
|
+
`,Et=j.css`
|
|
415
414
|
font-size: var(--fs-sm);
|
|
416
415
|
> * {
|
|
417
416
|
display: block;
|
|
418
417
|
}
|
|
419
|
-
`,
|
|
418
|
+
`,Mt=j.css`
|
|
420
419
|
display: block;
|
|
421
420
|
height: 1.5rem;
|
|
422
421
|
width: 1.5rem;
|
|
423
422
|
color: var(--brand-secondary-3);
|
|
424
423
|
margin-left: auto;
|
|
425
|
-
`;var
|
|
424
|
+
`;var Vt=require("@emotion/react");function Tt({result:t,isSelected:n,triggerSelection:o}){var v;let{categories:r,logoIcon:a}=fe(),[s]=t.categories||[{id:"",name:""}],u=typeof s=="undefined"||!r||(v=r.find(m=>m.id===s.id))==null?void 0:v.name;return(0,e.jsx)("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Pt]},(0,e.jsx)("div",{css:[Rt,n?Lt:void 0]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:Vt.css`
|
|
426
425
|
background-color: var(--gray-200);
|
|
427
426
|
width: 3rem;
|
|
428
427
|
height: 3rem;
|
|
429
428
|
object-fit: cover;
|
|
430
|
-
`}):(0,e.jsx)(
|
|
429
|
+
`}):(0,e.jsx)(Y,{src:a,alt:"Logo",css:Vt.css`
|
|
431
430
|
height: 2.25rem;
|
|
432
431
|
width: 2.25rem;
|
|
433
|
-
`}),(0,e.jsx)("h4",{css:[
|
|
432
|
+
`}),(0,e.jsx)("h4",{css:[kt]},t.title,u?(0,e.jsx)("span",{css:[xt]},u):null),(0,e.jsx)("p",{css:[Et]},"SKU: ",t.sku||t.id,t.price!==void 0?(0,e.jsx)("span",null,t.price):null),n?(0,e.jsx)(Le,{css:[Mt]}):null))}var ve=require("@emotion/react"),lr=require("@uniformdev/design-system"),It=ve.css`
|
|
434
433
|
display: flex;
|
|
435
434
|
width: 100%;
|
|
436
435
|
border: 1px solid var(--gray-300);
|
|
437
436
|
border-radius: var(--rounded-base);
|
|
438
437
|
background-color: var(--gray-100);
|
|
439
438
|
margin: var(--spacing-base) 0;
|
|
440
|
-
`,
|
|
439
|
+
`,Dt=ve.css`
|
|
441
440
|
padding: var(--spacing-base) 0 var(--spacing-base) var(--spacing-lg);
|
|
442
441
|
display: flex;
|
|
443
442
|
flex-grow: 1;
|
|
444
443
|
align-items: center;
|
|
445
444
|
margin-right: var(--spacing-sm);
|
|
446
445
|
gap: var(--spacing-base);
|
|
447
|
-
`,
|
|
446
|
+
`,Gt=ve.css`
|
|
448
447
|
display: flex;
|
|
449
448
|
align-items: center;
|
|
450
449
|
gap: var(--spacing-sm);
|
|
@@ -457,16 +456,17 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
457
456
|
width: 3.5rem;
|
|
458
457
|
height: 3.5rem;
|
|
459
458
|
object-fit: cover;
|
|
460
|
-
`;var x=require("@emotion/react"),pr=require("@uniformdev/design-system");function
|
|
459
|
+
`;var x=require("@emotion/react"),pr=require("@uniformdev/design-system");function zt({selectedItem:t,onDeselect:n}){var u;let{categories:o,logoIcon:r}=fe(),[a]=t.categories||[{id:"",name:""}],s=typeof a=="undefined"||!o||(u=o.find(v=>v.id===a.id))==null?void 0:u.name;return(0,e.jsx)("div",{css:[It],key:t.id},(0,e.jsx)("article",{css:[Dt]},(0,e.jsx)("div",{css:[Gt]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:s,css:[De],loading:"lazy"}):(0,e.jsx)("div",{css:[De]}),(0,e.jsx)("div",{css:x.css`
|
|
461
460
|
> :not(:last-child) {
|
|
462
461
|
margin-bottom: var(--spacing-xs);
|
|
463
462
|
}
|
|
464
463
|
`},(0,e.jsx)("h4",{css:x.css`
|
|
464
|
+
margin-top: 0px;
|
|
465
465
|
font-weight: var(--fw-bold);
|
|
466
|
-
`},t.title||t.id||"",
|
|
466
|
+
`},t.title||t.id||"",s&&(0,e.jsx)("span",{css:x.css`
|
|
467
467
|
display: block;
|
|
468
468
|
font-weight: var(--fw-regular);
|
|
469
|
-
`},
|
|
469
|
+
`},s)),(0,e.jsx)("ul",{css:x.css`
|
|
470
470
|
font-size: var(--fs-sm);
|
|
471
471
|
display: flex;
|
|
472
472
|
gap: var(--spacing-base);
|
|
@@ -483,7 +483,7 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
483
483
|
${(0,pr.mq)("md")} {
|
|
484
484
|
align-items: center;
|
|
485
485
|
}
|
|
486
|
-
`},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"
|
|
486
|
+
`},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:x.css`
|
|
487
487
|
display: inline-flex;
|
|
488
488
|
justify-content: space-between;
|
|
489
489
|
align-items: center;
|
|
@@ -497,11 +497,11 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
497
497
|
`},(0,e.jsx)("span",{css:x.css`
|
|
498
498
|
margin-right: var(--spacing-sm);
|
|
499
499
|
font-size: var(--fs-sm);
|
|
500
|
-
`},"Edit"),(0,e.jsx)(
|
|
500
|
+
`},"Edit"),(0,e.jsx)(Y,{src:r,alt:"Logo",css:x.css`
|
|
501
501
|
width: 1.75rem;
|
|
502
502
|
height: 1.75rem;
|
|
503
503
|
display: block;
|
|
504
|
-
`})):null,(0,e.jsx)("button",{type:"button",onClick:
|
|
504
|
+
`})):null,(0,e.jsx)("button",{type:"button",onClick:()=>{n==null||n(t)},css:x.css`
|
|
505
505
|
display: flex;
|
|
506
506
|
justify-content: space-between;
|
|
507
507
|
align-items: center;
|
|
@@ -516,6 +516,6 @@ var Pr=Object.create;var Se=Object.defineProperty;var Rr=Object.getOwnPropertyDe
|
|
|
516
516
|
}
|
|
517
517
|
`},(0,e.jsx)("span",{css:x.css`
|
|
518
518
|
font-size: var(--fs-sm);
|
|
519
|
-
`},"Unlink"),(0,e.jsx)(
|
|
519
|
+
`},"Unlink"),(0,e.jsx)(ce,{css:x.css`
|
|
520
520
|
color: var(--brand-secondary-5);
|
|
521
|
-
`})))))}var
|
|
521
|
+
`})))))}var ur=require("@uniformdev/design-system"),Ge=require("react-use");function eo({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:s,multiSelectId:u,selectedItemComponent:v,rowComponent:m,errorComponent:h,helpComponent:i,noResultsComponent:f,onSort:C,typeSelectorAllTypesOptionText:oe="All categories",typeSelectorLabel:K="Select Category"}){var _;let{value:w,loading:y,error:ne}=(0,Ge.useAsync)(async()=>await o(),[o]),Q=w==null?void 0:w.map(k=>k.id).join(","),te=(0,ee.useMemo)(()=>w?w.map(p=>({id:p.id,name:p.name})):void 0,[Q]),N=(0,ee.useRef)(),[W,he]=(0,Ge.useAsyncFn)(async(k,p)=>{let D=await r({text:k,options:{limit:p==null?void 0:p.count,offset:p==null?void 0:p.offset,categoryId:p==null?void 0:p.contentType}});return(p==null?void 0:p.offset)===0&&(N.current=[]),(N.current=N.current||[]).push(...D.products),D},[r]),ae=async k=>{await n(k)};return ne||W.error?(0,e.jsx)(h||(({categoriesError:p,searchError:D})=>(0,e.jsx)(ur.Callout,{type:"error"},"There was an error: ",(p==null?void 0:p.message)||(D==null?void 0:D.message))),{categoriesError:ne,searchError:W.error}):(0,e.jsx)(At.Provider,{value:{categories:w,logoIcon:a}},(0,e.jsx)(Ct,{search:he,results:N.current,logoIcon:a,selectedItems:t,select:ae,multiSelectId:u||"product-search-multi-select",multiSelect:s,contentTypes:te,selectedItemComponent:v||zt,rowComponent:m||Tt,totalResults:(_=W.value)==null?void 0:_.total,resultsLoading:W.loading||y,helpComponent:i,noResultsComponent:f,onSort:C,typeSelectorAllTypesOptionText:oe,typeSelectorLabel:K}))}var At=ee.default.createContext(void 0),fe=()=>{let t=(0,ee.useContext)(At);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};U(A,require("@uniformdev/mesh-sdk"),module.exports);var l=require("@uniformdev/design-system");0&&(module.exports={Button,Callout,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemImage,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemCloseIcon,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
|