@uniformdev/mesh-sdk-react 17.4.0 → 17.4.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.esm.js +124 -124
- package/dist/index.js +121 -121
- package/dist/index.mjs +124 -124
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Io=Object.defineProperty;var To=(e,r)=>{for(var o in r)Io(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as x from"react";import{createContext as zo,useContext as Uo,useEffect as Ao,useState as Go}from"react";import{createContext as Eo,useContext as Mo}from"react";import{Theme as Vo}from"@uniformdev/design-system";import{jsx as it,jsxs as Do}from"@emotion/react/jsx-runtime";var xe=Eo(void 0),va=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),Do(xe.Provider,{value:r,children:[it(Vo,{}),it(we,{children:e})]})},st=()=>{let e=Mo(xe);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function ct(){let{sdk:e}=st();return e}import{jsx as Bo}from"@emotion/react/jsx-runtime";var dt=zo(void 0),we=({children:e})=>{let r=ct(),[o,t]=Go(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return Ao(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),Bo(dt.Provider,{value:{location:o},children:e})},Ce=()=>{let e=Uo(dt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ea(){let{location:e}=Ce();return e}import{initializeUniformMeshSDK as Oo}from"@uniformdev/mesh-sdk";import{useEffect as Ho,useRef as $o,useState as lt}from"react";var pt=({autoResizingDisabled:e}={})=>{let[r,o]=lt(),[t,n]=lt(),a=$o(!1);return Ho(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,Oo({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function Oa(e){let{location:r}=Ce();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import Zo,{useMemo as Re,useContext as Xo}from"react";import{css as Fo}from"@emotion/react";import{Icon as Ko,InputSelect as No}from"@uniformdev/design-system";import{CgClose as Qo}from"react-icons/cg";import{Fragment as mt,jsxs as ut}from"@emotion/react/jsx-runtime";var gt=({value:e,text:r,loading:o})=>ut(mt,{children:[!!r&&r,!r&&ut(mt,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ae}from"@emotion/react";var ft=Ae`
|
|
2
2
|
align-items: center;
|
|
3
3
|
background: var(--gray-100);
|
|
4
4
|
border: 1px solid var(--gray-300);
|
|
@@ -7,66 +7,66 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
margin-bottom: var(--spacing-sm);
|
|
9
9
|
margin-right: var(--spacing-sm);
|
|
10
|
-
`,
|
|
10
|
+
`,vt=Ae`
|
|
11
11
|
color: var(--gray-800);
|
|
12
12
|
padding: var(--spacing-3);
|
|
13
|
-
`,
|
|
13
|
+
`,ht=Ae`
|
|
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
|
-
`;import{jsx as fe,jsxs as
|
|
18
|
+
`;import{jsx as fe,jsxs as yt}from"@emotion/react/jsx-runtime";var bt=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var v;let f=(v=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?v:[],u=(i,p)=>{i.preventDefault(),d(p)};return yt("div",{children:[fe(No,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Fo`
|
|
19
19
|
margin-bottom: var(--spacing-base);
|
|
20
|
-
`:""}),t==null?void 0:t.map(i=>{var p;return
|
|
20
|
+
`:""}),t==null?void 0:t.map(i=>{var p;return yt("div",{css:ft,children:[fe("span",{css:vt,children:fe(gt,{value:i,loading:o,text:(p=n.find(h=>h.id===i))==null?void 0:p.name})}),fe("button",{css:ht,title:"remove",onClick:h=>u(h,i),children:fe(Ko,{icon:Qo,iconColor:"currentColor",size:20})})]},i)})]})};import{jsx as St}from"@emotion/react/jsx-runtime";var Wo=e=>St("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:St("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"})}),Pe=Wo;import{jsx as xt}from"@emotion/react/jsx-runtime";var _o=e=>xt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:xt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Le=_o;import{useAsyncFn as qo,useDebounce as Yo}from"react-use";import{Input as wt,InputSelect as ke,mq as Ie}from"@uniformdev/design-system";import{css as L}from"@emotion/react";import{jsx as w,jsxs as se}from"@emotion/react/jsx-runtime";var Ct={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},yi=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:f,onGetProducts:u,sortOptions:v,sortOrderOptions:i,categoryLabel:p="Product Category",brandLabel:h="Brand",disableBrands:z,restrictToSingleCategory:ae=!1})=>{var M,m,D;let S=async s=>{r({...Ct,...e||{},...s})},b=Re(()=>({...Ct,...e||{}}),[e]),[ie,me]=qo(async s=>await u(s),[u]);Yo(async()=>{await me({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let O=Re(()=>{let s=[];return t==null||t.forEach(U=>{let C=Lt(U,void 0);s.push(...C)}),s},[t]),_=Re(()=>[{value:"",label:"All categories"},...O.map(s=>({label:s.name,value:s.id}))],[O]),W=Re(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),ue=s=>{if(!s)return;let U=(e==null?void 0:e.categories)||[];S({categories:[...U,s]})},Se=s=>{var U;S({categories:(U=e==null?void 0:e.categories)==null?void 0:U.filter(C=>C!==s)})},j=s=>{S({brand:s.target.value})},E=s=>{S({count:s||1})};return n?w("div",{children:"Loading..."}):w(Rt.Provider,{value:{categories:t,logoIcon:f},children:se("div",{css:L`
|
|
21
21
|
> :not(:last-child) {
|
|
22
22
|
margin-bottom: var(--spacing-md);
|
|
23
23
|
}
|
|
24
|
-
`,children:[ae?w(
|
|
24
|
+
`,children:[ae?w(ke,{id:"selection-field-product-category",label:p,disabled:n,value:(m=(M=b.categories)==null?void 0:M[0])!=null?m:"",options:_,onChange:s=>{S({categories:s.target.value===""?[]:[s.target.value]})}}):w(bt,{loading:a||!1,id:"selection-field-product-category",label:p,onAdd:ue,onRemove:Se,selectedValues:b.categories,values:O}),se("div",{css:L`
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-wrap: wrap;
|
|
27
27
|
column-gap: var(--spacing-lg);
|
|
28
28
|
row-gap: var(--spacing-md);
|
|
29
|
-
${
|
|
29
|
+
${Ie("md")} {
|
|
30
30
|
flex-wrap: nowrap;
|
|
31
31
|
}
|
|
32
|
-
`,children:[
|
|
32
|
+
`,children:[z?null:w("div",{css:L`
|
|
33
33
|
width: 50%;
|
|
34
|
-
`,children:w(
|
|
34
|
+
`,children:w(ke,{id:"brand",name:"brand",label:h,disabled:d,value:b.brand,onChange:j,options:[{value:"",label:"Choose..."},...W.map(s=>({value:s.id,label:s.name}))]})}),w("div",{css:L`
|
|
35
35
|
flex-grow: 1;
|
|
36
36
|
position: relative;
|
|
37
|
-
`,children:w(
|
|
37
|
+
`,children:w(wt,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:b.keyword,placeholder:"Enter keyword",onChange:s=>S({keyword:s.target.value})})})]}),se("div",{css:L`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-wrap: wrap;
|
|
40
40
|
column-gap: var(--spacing-lg);
|
|
41
41
|
row-gap: var(--spacing-md);
|
|
42
|
-
${
|
|
42
|
+
${Ie("md")} {
|
|
43
43
|
flex-wrap: nowrap;
|
|
44
44
|
}
|
|
45
45
|
`,children:[se("div",{css:L`
|
|
46
46
|
width: 100%;
|
|
47
|
-
${
|
|
47
|
+
${Ie("md")} {
|
|
48
48
|
width: 33.333333%;
|
|
49
49
|
}
|
|
50
50
|
position: relative;
|
|
51
|
-
`,children:[w(
|
|
51
|
+
`,children:[w(wt,{id:"count",name:"count",type:"number",min:1,step:1,value:b.count,onChange:s=>E(s.target.valueAsNumber),label:"Count"}),se("div",{css:L`
|
|
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:[w(
|
|
57
|
+
`,children:[w(Pt,{onCountChange:()=>E(b.count-1),countIcon:"decrement",disabled:b.count===1}),w(Pt,{onCountChange:()=>E(b.count+1),countIcon:"increment"})]})]}),Array.isArray(v)&&v.length>0?w("div",{css:L`
|
|
58
58
|
flex-grow: 1;
|
|
59
|
-
${
|
|
59
|
+
${Ie("md")} {
|
|
60
60
|
width: 33.333333%;
|
|
61
61
|
}
|
|
62
|
-
`,children:w(
|
|
62
|
+
`,children:w(ke,{id:"sort",name:"sort",label:"Sort",value:b.sort,onChange:s=>S({sort:s.target.value}),options:[{value:"",label:"Select a sort"},...v.map(s=>({value:s.sortKey,label:s.name}))]})}):null,Array.isArray(i)&&i.length>0?w("div",{css:L`
|
|
63
63
|
flex-grow: 1;
|
|
64
|
-
`,children:w(
|
|
64
|
+
`,children:w(ke,{id:"sort-order",name:"sort-order",label:"Sort Order",value:b.sortOrder,onChange:s=>S({sortOrder:s.target.value}),options:i.map(s=>({value:s.sortOrderKey,label:s.name}))})}):null]}),se("div",{children:[w("h3",{css:L`
|
|
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"}),w(
|
|
69
|
+
`,children:"Result Preview"}),w(It,{products:(D=ie.value)==null?void 0:D.products})]})]})})};function Lt(e,r){var a;let o=[],t=r?`${r.name} > `:"",n={id:e.id.toString(),name:`${t}${e.name}`};return o.push(n),(a=e.children)==null||a.forEach(d=>{let f=Lt(d,n);o.push(...f)}),o}function Pt({onCountChange:e,countIcon:r,disabled:o}){return w("button",{css:L`
|
|
70
70
|
width: 2.25rem;
|
|
71
71
|
height: 2.25rem;
|
|
72
72
|
border: 1px solid var(--gray-300);
|
|
@@ -82,13 +82,13 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
82
82
|
cursor: not-allowed;
|
|
83
83
|
opacity: 0.3;
|
|
84
84
|
`:""}
|
|
85
|
-
`,onClick:e,disabled:o,children:r==="increment"?w(
|
|
85
|
+
`,onClick:e,disabled:o,children:r==="increment"?w(Pe,{css:L`
|
|
86
86
|
width: 1rem;
|
|
87
87
|
height: 1rem;
|
|
88
|
-
`}):w(
|
|
88
|
+
`}):w(Le,{css:L`
|
|
89
89
|
width: 1rem;
|
|
90
90
|
height: 1rem;
|
|
91
|
-
`})})}var
|
|
91
|
+
`})})}var Rt=Zo.createContext(void 0),kt=()=>{let e=Xo(Rt);if(!e)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return e};import{jsx as Tt}from"@emotion/react/jsx-runtime";function H({src:e,alt:r,className:o}){let t=e&&typeof e!="string"?e:null;return t?Tt(t,{className:o}):Tt("img",{src:e,alt:r,className:o})}import{css as Ot}from"@emotion/react";import{scrollbarStyles as Jo}from"@uniformdev/design-system";import{css as $}from"@emotion/react";var Et=$`
|
|
92
92
|
align-items: center;
|
|
93
93
|
background: var(--white);
|
|
94
94
|
border-radius: var(--rounded-base);
|
|
@@ -103,55 +103,55 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
103
103
|
&:hover {
|
|
104
104
|
background: var(--gray-50);
|
|
105
105
|
}
|
|
106
|
-
`,
|
|
106
|
+
`,Mt=$`
|
|
107
107
|
font-size: var(--fs-sm);
|
|
108
|
-
`,
|
|
108
|
+
`,Vt=$`
|
|
109
109
|
width: 1rem;
|
|
110
110
|
height: 1rem;
|
|
111
|
-
`,
|
|
111
|
+
`,Ge=$`
|
|
112
112
|
margin-right: var(--spacing-lg);
|
|
113
113
|
font-size: var(--fs-sm);
|
|
114
|
-
`,
|
|
114
|
+
`,Dt=$`
|
|
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
|
+
`,zt=$`
|
|
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
|
+
`,Ut=$`
|
|
127
127
|
background: var(--gray-200);
|
|
128
128
|
width: 3.5rem;
|
|
129
129
|
height: 3.5rem;
|
|
130
130
|
object-fit: cover;
|
|
131
|
-
`,
|
|
131
|
+
`,At=$`
|
|
132
132
|
background: var(--gray-100);
|
|
133
133
|
height: 3.5rem;
|
|
134
134
|
width: 3.5rem;
|
|
135
|
-
`,
|
|
135
|
+
`,Gt=$`
|
|
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
|
+
`,Bt=$`
|
|
141
141
|
display: block;
|
|
142
142
|
font-weight: var(--fw-regular);
|
|
143
|
-
`;import{Fragment as
|
|
143
|
+
`;import{Fragment as Ht,jsx as q,jsxs as X}from"@emotion/react/jsx-runtime";var It=({products:e})=>{let{categories:r,logoIcon:o}=kt();return X(Ht,{children:[X("p",{css:Ot`
|
|
144
144
|
margin-bottom: var(--spacing-base);
|
|
145
|
-
`,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),q("ul",{css:[
|
|
145
|
+
`,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),q("ul",{css:[Ot`
|
|
146
146
|
max-height: 24rem;
|
|
147
147
|
overflow-x: auto;
|
|
148
|
-
`,
|
|
148
|
+
`,Jo],children:e==null?void 0:e.map((t,n)=>{var f,u;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(f=r.find(v=>v.id===a.id))==null?void 0:f.name;return q("li",{css:Dt,children:X("div",{css:zt,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?q("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:Ut,"data-test-id":"product-image"}):q("div",{css:At}),X("h4",{css:Gt,"data-test-id":"product-name",children:[t.title||t.name,d&&q("span",{css:Bt,children:d})]}),t&&X(Ht,{children:[X("p",{css:Ge,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,q("br",{})]}),t.price!==void 0?X("p",{css:Ge,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?X("a",{css:Et,href:(u=t.editLink)!=null?u:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[q("span",{css:Mt,children:"Edit"}),o?q(H,{src:o,alt:"Logo",css:Vt}):null]}):null]})]})},`product-${t.id}`)})})]})};import Kn,{useContext as Nn,useMemo as Qn,useRef as Wn}from"react";import*as N from"react";var Oe={};To(Oe,{Caution:()=>Ft,Checkmark:()=>Te,ChevronDown:()=>Ee,Close:()=>Qt,Danger:()=>_t,ExclamationPoint:()=>Xt,Info:()=>Me,Lightbulb:()=>Jt,MagnifyingGlass:()=>er,MaximizeAlt:()=>rr,Minus:()=>Le,MoreVerticalAlt:()=>he,Plus:()=>Pe});import{jsx as $t}from"@emotion/react/jsx-runtime";var jo=e=>$t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",role:"img",...e,children:$t("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"})}),Ft=jo;import{jsx as Kt}from"@emotion/react/jsx-runtime";var en=e=>Kt("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:Kt("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"})}),Te=en;import{jsx as Nt}from"@emotion/react/jsx-runtime";var tn=e=>Nt("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",role:"img",...e,children:Nt("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"})}),Ee=tn;import{jsx as Be,jsxs as on}from"@emotion/react/jsx-runtime";var rn=e=>Be("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",role:"img",...e,children:on("g",{fillRule:"evenodd",children:[Be("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"}),Be("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"})]})}),Qt=rn;import{jsx as Wt}from"@emotion/react/jsx-runtime";var nn=e=>Wt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:Wt("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"})}),_t=nn;import{jsx as Zt}from"@emotion/react/jsx-runtime";var an=e=>Zt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",role:"img",...e,children:Zt("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"})}),Xt=an;import{jsx as qt,jsxs as cn}from"@emotion/react/jsx-runtime";var sn=e=>cn("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:[qt("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"}),qt("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"})]}),Me=sn;import{jsx as Yt}from"@emotion/react/jsx-runtime";var dn=e=>Yt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",role:"img",...e,children:Yt("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"})}),Jt=dn;import{jsx as ve,jsxs as jt}from"@emotion/react/jsx-runtime";var ln=e=>jt("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",role:"img",...e,children:[jt("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[ve("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"}),ve("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"})]}),ve("defs",{children:ve("clipPath",{id:"magnifying-glass_svg__a",children:ve("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),er=ln;import{jsx as tr}from"@emotion/react/jsx-runtime";var pn=e=>tr("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:tr("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"})}),rr=pn;import{jsx as or}from"@emotion/react/jsx-runtime";var mn=e=>or("svg",{width:"1em",height:"1em",fill:"currentColor",role:"img",...e,children:or("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"})}),he=mn;import{useDebounce as Ln}from"react-use";import{v4 as Rn}from"uuid";import{useState as gn,useRef as mr,useEffect as fn}from"react";function Ve(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}import{format as vn}from"timeago.js";import{css as A}from"@emotion/react";import{mq as un}from"@uniformdev/design-system";var nr=A`
|
|
149
149
|
border: 1px solid var(--gray-200);
|
|
150
150
|
background: var(--gray-50);
|
|
151
151
|
border-radius: var(--rounded-base);
|
|
152
152
|
display: flex;
|
|
153
153
|
width: 100%;
|
|
154
|
-
`,
|
|
154
|
+
`,ar=A`
|
|
155
155
|
align-items: center;
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-grow: 1;
|
|
@@ -159,22 +159,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
159
159
|
margin-inline: 0 var(--spacing-sm);
|
|
160
160
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
161
161
|
position: relative;
|
|
162
|
-
`,
|
|
162
|
+
`,ir=A`
|
|
163
163
|
flex-grow: 1;
|
|
164
|
-
`,
|
|
164
|
+
`,sr=A`
|
|
165
165
|
align-items: start;
|
|
166
166
|
display: inline-flex;
|
|
167
167
|
position: relative;
|
|
168
|
-
`,
|
|
168
|
+
`,cr=A`
|
|
169
169
|
color: var(--brand-secondary-1);
|
|
170
170
|
font-size: var(--fs-base);
|
|
171
171
|
font-weight: var(--fw-bold);
|
|
172
172
|
line-height: 1;
|
|
173
173
|
margin: 0;
|
|
174
|
-
`,
|
|
174
|
+
`,dr=A`
|
|
175
175
|
width: 1.5rem;
|
|
176
176
|
height: 1.5rem;
|
|
177
|
-
`,
|
|
177
|
+
`,lr=A`
|
|
178
178
|
background: var(--white);
|
|
179
179
|
border-radius: var(--rounded-base);
|
|
180
180
|
border-left: 4px solid var(--brand-secondary-3);
|
|
@@ -183,22 +183,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
183
183
|
padding: var(--spacing-base);
|
|
184
184
|
z-index: var(--z-10);
|
|
185
185
|
width: max-content;
|
|
186
|
-
`,te=
|
|
186
|
+
`,te=A`
|
|
187
187
|
font-size: var(--fs-sm);
|
|
188
|
-
`,ye=
|
|
188
|
+
`,ye=A`
|
|
189
189
|
font-weight: var(--fw-bold);
|
|
190
190
|
margin-right: var(--spacing-sm);
|
|
191
|
-
`,
|
|
191
|
+
`,pr=A`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: var(--spacing-sm);
|
|
195
195
|
|
|
196
|
-
${
|
|
196
|
+
${un("md")} {
|
|
197
197
|
flex-direction: row;
|
|
198
198
|
min-width: 200px;
|
|
199
199
|
justify-content: end;
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
`,He=A`
|
|
202
202
|
align-items: center;
|
|
203
203
|
background: var(--white);
|
|
204
204
|
border-radius: var(--rounded-base);
|
|
@@ -213,39 +213,39 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
213
213
|
&:hover {
|
|
214
214
|
background: var(--gray-50);
|
|
215
215
|
}
|
|
216
|
-
`;import{css as Y}from"@emotion/react";import{Icon as
|
|
216
|
+
`;import{css as Y}from"@emotion/react";import{Icon as ur}from"@uniformdev/design-system";import{CgClose as hn,CgInfo as yn}from"react-icons/cg";import{Fragment as bn,jsx as F,jsxs as R}from"@emotion/react/jsx-runtime";var gr=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var v;let n=mr(null),a=mr(null),[d,f]=gn(!1);fn(()=>{let i=h=>{n.current&&!n.current.contains(h.target)&&a.current&&!a.current.contains(h.target)&&f(!1)},p=()=>{f(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let u=()=>{var i;if(f(!d),a.current&&n.current){let p=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),h=a.current.offsetWidth;a.current.style.top=`${p.top+30}px`,a.current.style.left=`${p.left-h+30}px`}};return F("div",{css:nr,children:R("div",{css:ar,children:[R("div",{css:ir,children:[R("div",{css:sr,children:[F("h4",{css:[cr,e.popoverData?Y`
|
|
217
217
|
margin-bottom: var(--spacing-sm);
|
|
218
|
-
`:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?R(
|
|
218
|
+
`:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?R(bn,{children:[F("button",{type:"button",ref:n,css:Y`
|
|
219
219
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
220
|
-
`,"aria-controls":"path-details","aria-expanded":d,onClick:u,children:
|
|
220
|
+
`,"aria-controls":"path-details","aria-expanded":d,onClick:u,children:F(ur,{icon:yn,iconColor:"gray",size:24,css:Y`
|
|
221
221
|
opacity: var(--opacity-75);
|
|
222
|
-
`})}),
|
|
222
|
+
`})}),F("div",{id:"path-details","aria-hidden":!d,ref:a,css:[lr,d?Y`
|
|
223
223
|
visibility: visible;
|
|
224
224
|
`:Y`
|
|
225
225
|
visibility: hidden;
|
|
226
|
-
`],children:Object.entries(e.popoverData).map(([i,p],
|
|
226
|
+
`],children:Object.entries(e.popoverData).map(([i,p],h)=>R("div",{css:te,children:[R("span",{css:ye,children:[i,":"]}),p]},h))})]}):null]}),e.createdDate&&R("div",{css:te,children:[F("span",{css:ye,children:"Created:"}),vn((v=e.createdDate)!=null?v:0)]}),e.metadata?Object.entries(e.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,p])=>R("div",{css:[te,Y`
|
|
227
227
|
order: 1;
|
|
228
228
|
`],children:[R("span",{css:ye,children:[i,":"]}),p]},i)):null,e.metadata?Object.entries(e.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,p])=>R("div",{css:[te,Y`
|
|
229
229
|
order: 1;
|
|
230
230
|
`],children:[R("span",{css:[ye,Y`
|
|
231
231
|
order: 1;
|
|
232
|
-
`],children:[i,":"]}),p]},i)):null]}),R("div",{css:
|
|
232
|
+
`],children:[i,":"]}),p]},i)):null]}),R("div",{css:pr,children:[e.editLink?R("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(Ve(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:He,children:[F("span",{css:te,children:"Edit"}),F(H,{src:r,css:dr,alt:"Logo"})]}):null,R("button",{type:"button",onClick:()=>{o(e)},css:He,children:[F("span",{css:te,children:"Unlink"}),F(ur,{icon:hn,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as Sn,useRef as Sr,useEffect as xn}from"react";import{css as re}from"@emotion/react";var fr=re`
|
|
233
233
|
cursor: pointer;
|
|
234
234
|
padding: var(--spacing-sm);
|
|
235
235
|
position: relative;
|
|
236
236
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
237
237
|
color var(--duration-fast) var(--timing-ease-out);
|
|
238
|
-
`,
|
|
238
|
+
`,vr=re`
|
|
239
239
|
padding-right: var(--spacing-lg);
|
|
240
|
-
`,
|
|
240
|
+
`,hr=re`
|
|
241
241
|
background: var(--brand-secondary-3);
|
|
242
242
|
color: var(--white);
|
|
243
|
-
|
|
243
|
+
`,$e=re`
|
|
244
244
|
font-size: var(--fs-xs);
|
|
245
|
-
`,
|
|
245
|
+
`,Fe=re`
|
|
246
246
|
font-weight: var(--fw-bold);
|
|
247
247
|
margin-right: var(--spacing-sm);
|
|
248
|
-
`,
|
|
248
|
+
`,yr=re`
|
|
249
249
|
background: var(--white);
|
|
250
250
|
border-left: 4px solid var(--brand-secondary-3);
|
|
251
251
|
border-radius: var(--rounded-base);
|
|
@@ -257,20 +257,20 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
257
257
|
right: var(--spacing-xl);
|
|
258
258
|
z-index: var(--z-10);
|
|
259
259
|
width: max-content;
|
|
260
|
-
`,
|
|
260
|
+
`,br=re`
|
|
261
261
|
position: absolute;
|
|
262
262
|
inset: 0 var(--spacing-sm) 0 auto;
|
|
263
|
-
`;import{css as
|
|
263
|
+
`;import{css as xr}from"@emotion/react";import{Fragment as wn,jsx as wr,jsxs as oe}from"@emotion/react/jsx-runtime";var Cr=({result:e,isSelected:r,triggerSelection:o})=>{let t=Sr(null),n=Sr(null),[a,d]=Sn(!1);xn(()=>{function u(v){t.current&&!t.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&d(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[n]);let f=u=>{u.stopPropagation(),d(!a)};return oe("div",{css:[fr,r?hr:void 0,e.popoverData?vr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?oe(wn,{children:[wr("button",{type:"button",ref:t,css:br,"aria-controls":"path-details",onClick:u=>f(u),"aria-expanded":a,children:wr(Me,{width:24,height:24})}),oe("div",{id:"path-details","aria-hidden":!a,ref:n,css:[yr,a?xr`
|
|
264
264
|
visibility: visible;
|
|
265
|
-
`:
|
|
265
|
+
`:xr`
|
|
266
266
|
visibility: hidden;
|
|
267
|
-
`],children:[e.metadata&&Object.entries(e.metadata).map(([u,v],i)=>oe("div",{css
|
|
267
|
+
`],children:[e.metadata&&Object.entries(e.metadata).map(([u,v],i)=>oe("div",{css:$e,children:[oe("span",{css:Fe,children:[u,":"]}),v]},i)),Object.entries(e.popoverData).map(([u,v],i)=>oe("div",{css:$e,children:[oe("span",{css:Fe,children:[u,":"]}),v]},i))]})]}):null]},e.id)};import{Droppable as kn,DragDropContext as In,Draggable as Tn}from"react-beautiful-dnd";import{css as P}from"@emotion/react";var Pr=P`
|
|
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
|
+
`,Lr=P`
|
|
274
274
|
align-items: center;
|
|
275
275
|
display: flex;
|
|
276
276
|
position: relative;
|
|
@@ -278,7 +278,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
278
278
|
width: 100%;
|
|
279
279
|
background-color: transparent;
|
|
280
280
|
border: 0;
|
|
281
|
-
`,
|
|
281
|
+
`,Rr=P`
|
|
282
282
|
color: var(--brand-secondary-1);
|
|
283
283
|
display: block;
|
|
284
284
|
font-weight: var(--fw-bold);
|
|
@@ -294,15 +294,15 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
294
294
|
background: var(--gray-100);
|
|
295
295
|
outline: none;
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`,kr=P`
|
|
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
|
+
`,Ir=P`
|
|
304
304
|
display: none;
|
|
305
|
-
`,
|
|
305
|
+
`,Tr=P`
|
|
306
306
|
overflow-y: auto;
|
|
307
307
|
height: 16rem;
|
|
308
308
|
margin-bottom: var(--spacing-base);
|
|
@@ -311,122 +311,122 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
311
311
|
& > :not(:last-child) {
|
|
312
312
|
border-bottom: 1px solid var(--gray-200);
|
|
313
313
|
}
|
|
314
|
-
`,
|
|
314
|
+
`,ac=P`
|
|
315
315
|
background-color: var(--gray-50);
|
|
316
316
|
max-width: 33.33%;
|
|
317
|
-
`,
|
|
317
|
+
`,Er=P`
|
|
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
|
+
`,Mr=P`
|
|
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
|
+
`,ic=P`
|
|
331
331
|
background: var(--white);
|
|
332
332
|
color: var(--brand-secondary-1);
|
|
333
|
-
`,
|
|
333
|
+
`,Vr=P`
|
|
334
334
|
position: relative;
|
|
335
335
|
margin-block: var(--spacing-sm) 0;
|
|
336
336
|
|
|
337
337
|
&:hover > span {
|
|
338
338
|
opacity: 0.3;
|
|
339
339
|
}
|
|
340
|
-
`,
|
|
340
|
+
`,Dr=P`
|
|
341
341
|
align-items: center;
|
|
342
342
|
display: flex;
|
|
343
343
|
position: absolute;
|
|
344
344
|
inset: 0 auto 0 0;
|
|
345
345
|
margin-block: auto;
|
|
346
346
|
opacity: 0;
|
|
347
|
-
`,
|
|
347
|
+
`,Ke=P`
|
|
348
348
|
color: var(--brand-secondary-1);
|
|
349
|
-
`,
|
|
349
|
+
`,zr=P`
|
|
350
350
|
position: absolute;
|
|
351
351
|
left: 0.375rem;
|
|
352
|
-
`,
|
|
352
|
+
`,Ne=P`
|
|
353
353
|
width: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
354
354
|
height: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
355
|
-
`;import{css as
|
|
355
|
+
`;import{css as K}from"@emotion/react";import{InputSelect as En,scrollbarStyles as Mn,Button as Qe,Callout as Vn,InputKeywordSearch as Dn,LoadingIndicator as zn,Menu as Un,MenuItem as An,LoadingOverlay as Gn}from"@uniformdev/design-system";import{useState as Cn,useEffect as Ur,useRef as Pn}from"react";function Ar(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=Cn("IDLE"),a=Pn(void 0);return Ur(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),Ur(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}import{Fragment as On,jsx as g,jsxs as G}from"@emotion/react/jsx-runtime";var Bn=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),g(Vn,{type:"info",children:o})},Gr=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:f,rowComponent:u,selectedItemComponent:v,totalResults:i,cursor:p,resultsLoading:h,requireContentType:z,onAddNew:ae,onEditClosed:S,onCancel:b,noResultsComponent:ie,helpComponent:me,onSort:O,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:W="All content types",loadingIndicatorDelay:ue=1e3})=>{var ot,nt,at;let j=()=>z?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[E,M]=N.useState(""),[m,D]=N.useState(j),[s,U]=N.useState(!1),[C,ee]=N.useState([]),[go,je]=N.useState(!1),Ue=N.useRef(`x${Rn()}`);Ln(()=>{e(E,{count:5,offset:0,contentType:m==="any"?void 0:m})},300,[E]);let fo=Ar(h,{delay:ue}),vo=c=>{C.some(y=>y.id===c.id)?ee(y=>y.filter(Z=>Z.id!==c.id)):ee(d?y=>[...y,c]:[c])},ho=t==null?void 0:t.map(c=>c.id+c.title).join(",");N.useEffect(()=>{Array.isArray(t)&&ee(t)},[ho]);let yo=()=>{D(j()),M(""),ee(t!=null&&t.length?t:[])},bo=()=>{U(c=>!c),s||yo()},et=c=>{let y=(C==null?void 0:C.filter(Z=>Z.id!==c.id))||[];ee(y),a(y,"")},So=c=>{c.preventDefault(),a(C,m),U(!1)},xo=c=>{c.preventDefault(),U(!1),b&&b()},wo=()=>{e(E,{count:5,offset:(r==null?void 0:r.length)||0,contentType:m==="any"?void 0:m,cursor:p}),je(!0);let c=setTimeout(()=>{je(!1)},750);return()=>clearTimeout(c)},Co=!(t==null?void 0:t.length)||d,Po=u||Cr,tt=v||gr,Lo=ie||Bn,rt=n&&typeof n!="string"?n:null,Ro=rt?g(rt,{css:Ne}):g("img",{src:n,alt:"Logo",css:Ne}),ko=c=>{var y,Z;if(c.destination&&c.source.droppableId===((y=c.destination)==null?void 0:y.droppableId)){let V=[...t||[]],[ge]=(Z=V==null?void 0:V.splice(c.source.index,1))!=null?Z:[];return V==null||V.splice(c.destination.index,0,ge),O&&(ee(V),O==null||O(V)),V}};return g("div",{css:K`
|
|
356
356
|
width: 100%;
|
|
357
|
-
`,children:
|
|
357
|
+
`,children:G("div",{css:K`
|
|
358
358
|
position: relative;
|
|
359
359
|
margin-block: var(--spacing-base);
|
|
360
|
-
`,children:[
|
|
360
|
+
`,children:[Co?G(On,{children:[g("div",{css:Pr,"data-test-id":"component-search",children:G("button",{css:Lr,onClick:bo,type:"button","aria-haspopup":!0,"aria-expanded":s,"aria-controls":`entry-search-config-${Ue.current}`,children:[Ro,g("span",{css:K`
|
|
361
361
|
margin-left: var(--spacing-base);
|
|
362
|
-
`,children:"Select"}),g("span",{css:
|
|
362
|
+
`,children:"Select"}),g("span",{css:Er,children:g(Ee,{css:[Mr,s?K`
|
|
363
363
|
transform: rotate(180deg);
|
|
364
|
-
`:void 0]})})]})}),
|
|
364
|
+
`:void 0]})})]})}),G("div",{id:`entry-search-config-${Ue.current}`,"aria-hidden":!s,css:[kr,s?void 0:Ir],children:[me||null,G("div",{css:K`
|
|
365
365
|
display: flex;
|
|
366
366
|
gap: calc(var(--spacing-base) - 0.25rem);
|
|
367
367
|
margin-bottom: var(--spacing-base);
|
|
368
|
-
`,children:[g(
|
|
368
|
+
`,children:[g(En,{onChange:c=>D(c.target.value),value:m,label:_,showLabel:!1,options:[...z?[]:[{value:"any",label:W}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),g("div",{css:K`
|
|
369
369
|
flex-grow: 1;
|
|
370
|
-
`,children:g(
|
|
370
|
+
`,children:g(Dn,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:M,disabledFieldSubmission:!0,value:E})})]}),G("div",{css:[Tr,Mn],id:Ue.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[g(Gn,{isActive:fo}),Array.isArray(r)&&r.length>0?r.map(c=>g(Po,{isSelected:C.some(y=>y.id===c.id),result:c,triggerSelection:()=>vo(c)},c.id)):h?null:g(Lo,{searchText:E||E,selectedContentType:(nt=(ot=o==null?void 0:o.find(c=>c.id===m))==null?void 0:ot.name)!=null?nt:m}),!h&&typeof i!="undefined"&&r&&(r==null?void 0:r.length)<i&&g("button",{type:"button",css:Rr,onClick:wo,children:go?g(zn,{}):"Load More"})]}),G("div",{css:K`
|
|
371
371
|
display: flex;
|
|
372
372
|
justify-content: space-between;
|
|
373
|
-
`,children:[g("div",{children:ae&&((
|
|
373
|
+
`,children:[g("div",{children:ae&&((at=o==null?void 0:o.length)!=null?at:0)>0?g(Un,{menuLabel:"Add new menu",menuTrigger:g(Qe,{buttonType:"secondary",children:"Add New"}),children:o==null?void 0:o.map(c=>g(An,{css:K`
|
|
374
374
|
background: var(--white);
|
|
375
375
|
color: var(--brand-secondary-1);
|
|
376
|
-
`,onClick:()=>ae(c),children:c.name},c.id))}):null}),
|
|
376
|
+
`,onClick:()=>ae(c),children:c.name},c.id))}):null}),G("div",{css:K`
|
|
377
377
|
display: flex;
|
|
378
378
|
gap: var(--spacing-base);
|
|
379
|
-
`,children:[g(
|
|
379
|
+
`,children:[g(Qe,{buttonType:"unimportant",onClick:xo,children:"Cancel"}),g(Qe,{disabled:!C.length,onClick:So,"data-test-id":"entry-accept-button",children:"Accept"})]})]})]})]}):null,s?null:d&&C.length>1?g(In,{onDragEnd:c=>ko(c),children:g(kn,{droppableId:f||"canvas-multi-select",children:c=>G("div",{...c.droppableProps,ref:c.innerRef,css:K`
|
|
380
380
|
margin-block: var(--spacing-sm) 0;
|
|
381
|
-
`,children:[C==null?void 0:C.map((
|
|
381
|
+
`,children:[C==null?void 0:C.map((y,Z)=>{if(y!=null&&y.id)return g(Tn,{draggableId:y.id,index:Z,children:V=>G("div",{css:Vr,ref:V.innerRef,...V.draggableProps,...V.dragHandleProps,children:[G("span",{css:Dr,children:[g(he,{css:[Ke,zr],width:24,height:24}),g(he,{css:Ke,width:24,height:24})]}),g(tt,{logoIcon:n,selectedItem:y,onDeselect:ge=>et(ge),onEditClosed:S?ge=>S(ge):void 0},`selected-item-${y.id}`)]})},y.id)}),c.placeholder]})})}):C==null?void 0:C.map(c=>g(tt,{logoIcon:n,selectedItem:c,onDeselect:y=>et(y),onEditClosed:S?y=>S(y):void 0},`selected-item-${c.id}`))]})})};import{css as ne}from"@emotion/react";var Br=ne`
|
|
382
382
|
cursor: pointer;
|
|
383
383
|
padding: var(--spacing-sm) 0;
|
|
384
384
|
margin-right: var(--spacing-sm);
|
|
385
385
|
position: relative;
|
|
386
386
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
387
387
|
color var(--duration-fast) var(--timing-ease-out);
|
|
388
|
-
`,
|
|
388
|
+
`,Or=ne`
|
|
389
389
|
border: 2px solid transparent;
|
|
390
390
|
border-radius: var(--rounded-base);
|
|
391
391
|
display: flex;
|
|
392
392
|
align-items: center;
|
|
393
393
|
gap: var(--spacing-base);
|
|
394
394
|
padding: var(--spacing-sm) var(--spacing-xs);
|
|
395
|
-
|
|
395
|
+
`,Hr=ne`
|
|
396
396
|
background-color: var(--green-50);
|
|
397
|
-
|
|
397
|
+
`,$r=ne`
|
|
398
398
|
font-size: var(--fs-sm);
|
|
399
399
|
font-weight: var(--fw-bold);
|
|
400
400
|
width: 50%;
|
|
401
|
-
`,
|
|
401
|
+
`,Fr=ne`
|
|
402
402
|
font-weight: var(--fw-normal);
|
|
403
403
|
display: block;
|
|
404
|
-
`,
|
|
404
|
+
`,Kr=ne`
|
|
405
405
|
font-size: var(--fs-sm);
|
|
406
406
|
> * {
|
|
407
407
|
display: block;
|
|
408
408
|
}
|
|
409
|
-
`,
|
|
409
|
+
`,Nr=ne`
|
|
410
410
|
display: block;
|
|
411
411
|
height: 1.5rem;
|
|
412
412
|
width: 1.5rem;
|
|
413
413
|
color: var(--brand-secondary-3);
|
|
414
414
|
margin-left: auto;
|
|
415
|
-
`;import{css as
|
|
415
|
+
`;import{css as Qr}from"@emotion/react";import{jsx as ce,jsxs as We}from"@emotion/react/jsx-runtime";function Wr({result:e,isSelected:r,triggerSelection:o}){var f;let{categories:t,logoIcon:n}=De(),[a]=e.categories||[{id:"",name:""}],d=typeof a=="undefined"||!t||(f=t.find(u=>u.id===a.id))==null?void 0:f.name;return ce("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Br],children:We("div",{css:[Or,r?Hr:void 0],children:[e.thumbnailUrl?ce("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Qr`
|
|
416
416
|
background-color: var(--gray-200);
|
|
417
417
|
width: 3rem;
|
|
418
418
|
height: 3rem;
|
|
419
419
|
object-fit: cover;
|
|
420
|
-
`}):ce(
|
|
420
|
+
`}):ce(H,{src:n,alt:"Logo",css:Qr`
|
|
421
421
|
height: 2.25rem;
|
|
422
422
|
width: 2.25rem;
|
|
423
|
-
`}),
|
|
423
|
+
`}),We("h4",{css:[$r],children:[e.title,d?ce("span",{css:[Fr],children:d}):null]}),We("p",{css:[Kr],children:["SKU: ",e.sku||e.id,e.price!==void 0?ce("span",{children:e.price}):null]}),r?ce(Te,{css:[Nr]}):null]})},e.id)}import{css as J}from"@emotion/react";import{mq as _r}from"@uniformdev/design-system";var Zr=J`
|
|
424
424
|
border: 1px solid var(--gray-200);
|
|
425
425
|
border-radius: var(--rounded-base);
|
|
426
426
|
background: var(--gray-50);
|
|
427
427
|
display: flex;
|
|
428
428
|
width: 100%;
|
|
429
|
-
`,
|
|
429
|
+
`,Xr=J`
|
|
430
430
|
align-items: center;
|
|
431
431
|
display: flex;
|
|
432
432
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
@@ -434,22 +434,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
434
434
|
flex-grow: 1;
|
|
435
435
|
gap: var(--spacing-sm);
|
|
436
436
|
margin-inline: 0 var(--spacing-sm);
|
|
437
|
-
`,
|
|
437
|
+
`,qr=J`
|
|
438
438
|
display: flex;
|
|
439
439
|
align-items: center;
|
|
440
440
|
gap: var(--spacing-sm);
|
|
441
441
|
flex-grow: 1;
|
|
442
442
|
|
|
443
|
-
${
|
|
443
|
+
${_r("lg")} {
|
|
444
444
|
width: 50%;
|
|
445
445
|
margin-bottom: 0;
|
|
446
446
|
}
|
|
447
|
-
`,
|
|
447
|
+
`,_e=J`
|
|
448
448
|
background-color: var(--gray-200);
|
|
449
449
|
width: 3.5rem;
|
|
450
450
|
height: 3.5rem;
|
|
451
451
|
object-fit: cover;
|
|
452
|
-
`,
|
|
452
|
+
`,Ze=J`
|
|
453
453
|
align-items: center;
|
|
454
454
|
background: var(--white);
|
|
455
455
|
border-radius: var(--rounded-base);
|
|
@@ -464,23 +464,23 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
464
464
|
&:hover {
|
|
465
465
|
background: var(--gray-50);
|
|
466
466
|
}
|
|
467
|
-
`,
|
|
467
|
+
`,Xe=J`
|
|
468
468
|
font-size: var(--fs-sm);
|
|
469
|
-
`,
|
|
469
|
+
`,Yr=J`
|
|
470
470
|
display: block;
|
|
471
471
|
width: 1rem;
|
|
472
472
|
height: 1rem;
|
|
473
|
-
`,
|
|
473
|
+
`,Jr=J`
|
|
474
474
|
display: flex;
|
|
475
475
|
flex-direction: column;
|
|
476
476
|
gap: var(--spacing-sm);
|
|
477
477
|
|
|
478
|
-
${
|
|
478
|
+
${_r("md")} {
|
|
479
479
|
flex-direction: row;
|
|
480
480
|
min-width: 200px;
|
|
481
481
|
justify-content: end;
|
|
482
482
|
}
|
|
483
|
-
`;import{css as de}from"@emotion/react";import{Icon as
|
|
483
|
+
`;import{css as de}from"@emotion/react";import{Icon as Hn,mq as $n}from"@uniformdev/design-system";import{CgClose as Fn}from"react-icons/cg";import{jsx as B,jsxs as Q}from"@emotion/react/jsx-runtime";function jr({selectedItem:e,onDeselect:r}){var d;let{categories:o,logoIcon:t}=De(),[n]=e.categories||[{id:"",name:""}],a=typeof n=="undefined"||!o||(d=o.find(f=>f.id===n.id))==null?void 0:d.name;return B("div",{css:[Zr],children:Q("article",{css:[Xr],children:[Q("div",{css:[qr],children:[e.thumbnailUrl?B("img",{src:e.thumbnailUrl,alt:a,css:[_e],loading:"lazy"}):B("div",{css:[_e]}),Q("div",{css:de`
|
|
484
484
|
> :not(:last-child) {
|
|
485
485
|
margin-bottom: var(--spacing-xs);
|
|
486
486
|
}
|
|
@@ -493,7 +493,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
493
493
|
`,children:a})]}),Q("ul",{css:de`
|
|
494
494
|
font-size: var(--fs-sm);
|
|
495
495
|
|
|
496
|
-
${
|
|
496
|
+
${$n("sm")} {
|
|
497
497
|
display: flex;
|
|
498
498
|
gap: var(--spacing-base);
|
|
499
499
|
}
|
|
@@ -501,13 +501,13 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
501
501
|
margin-right: var(--spacing-xs);
|
|
502
502
|
`,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?Q("li",{children:[B("span",{css:de`
|
|
503
503
|
margin-right: var(--spacing-xs);
|
|
504
|
-
`,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:
|
|
504
|
+
`,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:Jr,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Ze,children:[B("span",{css:Xe,children:"Edit"}),B(H,{src:t,alt:"Logo",css:Yr})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:Ze,children:[B("span",{css:Xe,children:"Unlink"}),B(Hn,{icon:Fn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as _n}from"@uniformdev/design-system";import{useAsync as Zn,useAsyncFn as Xn}from"react-use";import{jsx as qe,jsxs as qn}from"@emotion/react/jsx-runtime";function sd({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:f,rowComponent:u,errorComponent:v,helpComponent:i,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:z="All categories",typeSelectorLabel:ae="Select Category"}){var j,E;let{value:S,loading:b,error:ie}=Zn(async()=>await o(),[o]),me=S==null?void 0:S.map(M=>M.id).join(","),O=Qn(()=>S?S.map(m=>({id:m.id,name:m.name})):void 0,[me]),_=Wn(),[W,ue]=Xn(async(M,m)=>{let D=await t({text:M,options:{limit:m==null?void 0:m.count,offset:m==null?void 0:m.offset,categoryId:m==null?void 0:m.contentType,cursor:m==null?void 0:m.cursor}});return(m==null?void 0:m.offset)===0&&(_.current=[]),(_.current=_.current||[]).push(...D.products),D},[t]),Se=async M=>{await r(M)};return ie||W.error?qe(v||(({categoriesError:m,searchError:D})=>qn(_n,{type:"error",children:["There was an error: ",(m==null?void 0:m.message)||(D==null?void 0:D.message)]})),{categoriesError:ie,searchError:W.error}):qe(eo.Provider,{value:{categories:S,logoIcon:n},children:qe(Gr,{search:ue,results:_.current,logoIcon:n,selectedItems:e,select:Se,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:O,selectedItemComponent:f||jr,rowComponent:u||Wr,totalResults:(j=W.value)==null?void 0:j.total,cursor:(E=W.value)==null?void 0:E.cursor,resultsLoading:W.loading||b,helpComponent:i,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:z,typeSelectorLabel:ae})})}var eo=Kn.createContext(void 0),De=()=>{let e=Nn(eo);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as k}from"@emotion/react";import{mq as Yn}from"@uniformdev/design-system";var to=k`
|
|
505
505
|
border: 1px solid var(--gray-200);
|
|
506
506
|
background: var(--gray-50);
|
|
507
507
|
border-radius: var(--rounded-base);
|
|
508
508
|
display: flex;
|
|
509
509
|
width: 100%;
|
|
510
|
-
`,
|
|
510
|
+
`,ro=k`
|
|
511
511
|
align-items: center;
|
|
512
512
|
display: flex;
|
|
513
513
|
flex-grow: 1;
|
|
@@ -515,23 +515,23 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
515
515
|
margin-inline: 0 var(--spacing-sm);
|
|
516
516
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
517
517
|
position: relative;
|
|
518
|
-
`,
|
|
518
|
+
`,oo=k`
|
|
519
519
|
flex-grow: 1;
|
|
520
|
-
`,
|
|
520
|
+
`,no=k`
|
|
521
521
|
align-items: center;
|
|
522
522
|
display: flex;
|
|
523
523
|
position: relative;
|
|
524
|
-
`,
|
|
524
|
+
`,ao=k`
|
|
525
525
|
color: var(--brand-secondary-1);
|
|
526
526
|
font-size: var(--fs-base);
|
|
527
527
|
font-weight: var(--fw-bold);
|
|
528
528
|
line-height: 1;
|
|
529
529
|
margin: 0;
|
|
530
530
|
word-break: break-word;
|
|
531
|
-
`,
|
|
531
|
+
`,io=k`
|
|
532
532
|
width: 1.5rem;
|
|
533
533
|
height: 1.5rem;
|
|
534
|
-
`,
|
|
534
|
+
`,so=k`
|
|
535
535
|
background: var(--white);
|
|
536
536
|
border-radius: var(--rounded-base);
|
|
537
537
|
border-left: 4px solid var(--brand-secondary-3);
|
|
@@ -542,20 +542,20 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
542
542
|
width: max-content;
|
|
543
543
|
`,le=k`
|
|
544
544
|
font-size: var(--fs-sm);
|
|
545
|
-
`,
|
|
545
|
+
`,ze=k`
|
|
546
546
|
font-weight: var(--fw-bold);
|
|
547
547
|
margin-right: var(--spacing-sm);
|
|
548
|
-
`,
|
|
548
|
+
`,co=k`
|
|
549
549
|
display: flex;
|
|
550
550
|
flex-direction: column;
|
|
551
551
|
gap: var(--spacing-sm);
|
|
552
552
|
|
|
553
|
-
${
|
|
553
|
+
${Yn("md")} {
|
|
554
554
|
flex-direction: row;
|
|
555
555
|
justify-content: end;
|
|
556
556
|
min-width: 200px;
|
|
557
557
|
}
|
|
558
|
-
`,
|
|
558
|
+
`,Ye=k`
|
|
559
559
|
align-items: center;
|
|
560
560
|
background: var(--white);
|
|
561
561
|
border-radius: var(--rounded-base);
|
|
@@ -570,30 +570,30 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
|
|
|
570
570
|
&:hover {
|
|
571
571
|
background: var(--gray-50);
|
|
572
572
|
}
|
|
573
|
-
`,
|
|
573
|
+
`,lo=k`
|
|
574
574
|
display: flex;
|
|
575
575
|
margin-top: var(--spacing-sm);
|
|
576
576
|
gap: var(--spacing-sm);
|
|
577
|
-
`,
|
|
577
|
+
`,po=k`
|
|
578
578
|
background: none;
|
|
579
579
|
outline: none;
|
|
580
580
|
border: none;
|
|
581
581
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
582
|
-
`,
|
|
582
|
+
`,Je=k`
|
|
583
583
|
display: block;
|
|
584
584
|
max-width: 100%;
|
|
585
585
|
min-width: 100px;
|
|
586
586
|
height: auto;
|
|
587
|
-
`;import{useState as
|
|
587
|
+
`;import{useState as Jn,useRef as mo,useEffect as jn}from"react";import{CgInfo as ea,CgClose as ta}from"react-icons/cg";import{format as ra}from"timeago.js";import{css as pe}from"@emotion/react";import{Icon as uo}from"@uniformdev/design-system";import{Fragment as na,jsx as I,jsxs as T}from"@emotion/react/jsx-runtime";function Pd({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=mo(null),d=mo(null),[f,u]=Jn(!1);jn(()=>{let p=z=>{a.current&&!a.current.contains(z.target)&&d.current&&!d.current.contains(z.target)&&u(!1)},h=()=>{u(!1)};return window.addEventListener("resize",h,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",h,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[d]);let v=()=>{var p;if(u(!f),d.current&&a.current){let h=(p=a==null?void 0:a.current)==null?void 0:p.getBoundingClientRect();d.current.style.top=`${h.top+30}px`}},i=n!=null?n:oa;return I("div",{css:[to,pe`
|
|
588
588
|
margin: 0 0 1rem 0;
|
|
589
|
-
`],children:T("div",{css:
|
|
589
|
+
`],children:T("div",{css:ro,children:[T("div",{css:oo,children:[T("div",{css:no,children:[I("h4",{css:[ao],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?T(na,{children:[I("button",{type:"button",ref:a,css:po,"aria-controls":"path-details","aria-expanded":f,onClick:v,children:I(uo,{icon:ea,iconColor:"gray",size:24,css:pe`
|
|
590
590
|
opacity: var(--opacity-75);
|
|
591
|
-
`})}),I("div",{id:"path-details","aria-hidden":!f,ref:d,css:[
|
|
591
|
+
`})}),I("div",{id:"path-details","aria-hidden":!f,ref:d,css:[so,f?pe`
|
|
592
592
|
visibility: visible;
|
|
593
593
|
`:pe`
|
|
594
594
|
visibility: hidden;
|
|
595
|
-
`],children:Object.entries(e.popoverData).map(([p,
|
|
595
|
+
`],children:Object.entries(e.popoverData).map(([p,h],z)=>T("div",{css:le,children:[T("span",{css:ze,children:[p,":"]}),h]},z))})]}):null]}),I(i,{item:e})]}),T("div",{css:co,children:[e.editLink?typeof e.editLink=="string"?T("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:p=>{o&&(Ve(p.currentTarget.href,()=>o(e)),p.preventDefault())},css:Ye,children:[I("span",{css:le,children:"Edit"}),t?I(H,{src:t,css:io,alt:"Logo"}):null]}):e.editLink:null,T("button",{type:"button",onClick:()=>{r(e)},css:Ye,children:[I("span",{css:le,children:"Unlink"}),I(uo,{icon:ta,iconColor:"red",size:16})]})]})]})},e.id)}function oa({item:e}){let r=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?r=I("img",{src:e.previewUrl,alt:e.id,width:"200",css:Je}):e.type==="video"&&(r=I("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:Je})):e.previewUrl&&typeof e.previewUrl!="string"&&(r=e.previewUrl),r||e.metadata?T("div",{css:lo,children:[r?I("div",{children:r}):null,T("ul",{children:[e.metadata?Object.entries(e.metadata).map(([o,t])=>T("li",{css:[le,pe`
|
|
596
596
|
order: 1;
|
|
597
|
-
`],children:[T("span",{css:[
|
|
597
|
+
`],children:[T("span",{css:[ze,pe`
|
|
598
598
|
order: 1;
|
|
599
|
-
`],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:
|
|
599
|
+
`],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:ze,children:"Date:"}),ra(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as aa,Theme as ia}from"@uniformdev/design-system";import{jsx as be,jsxs as sa}from"@emotion/react/jsx-runtime";var Vd=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=pt();if(t||!a){let d=r;return d?be(d,{}):be(aa,{})}if(n){let d=o;if(d)return be(d,{error:n});throw n}return sa(xe.Provider,{value:{sdk:a},children:[be(ia,{}),be(we,{children:e})]})};export*from"@uniformdev/mesh-sdk";import{Button as Qd,Callout as Wd,LoadingIndicator as _d,LoadingOverlay as Zd,Menu as Xd,MenuItem as qd,Input as Yd,InputSelect as Jd,InputToggle as jd,Theme as el,InputKeywordSearch as tl,Heading as rl,ScrollableList as ol,ScrollableListItem as nl,Textarea as al,Switch as il,Label as sl,AddListButton as cl}from"@uniformdev/design-system";export{cl as AddListButton,Qd as Button,Wd as Callout,Pd as DamSelectedItem,Cr as DefaultSearchRow,gr as DefaultSelectedItem,Gr as EntrySearch,rl as Heading,Oe as Icons,Yd as Input,Jd as InputSelect,jd as InputToggle,tl as KeywordSearchInput,sl as Label,_d as LoadingIndicator,Zd as LoadingOverlay,Xd as Menu,qd as MenuItem,Vd as MeshApp,It as ProductPreviewList,yi as ProductQuery,Rt as ProductQueryContext,sd as ProductSearch,eo as ProductSearchContext,Wr as ProductSearchRow,jr as ProductSelectedItem,gt as ResolvableLoadingValue,ol as ScrollableList,nl as ScrollableListItem,bt as SelectionField,il as Switch,al as Textarea,el as Theme,dt as UniformMeshLocationContext,we as UniformMeshLocationContextProvider,xe as UniformMeshSdkContext,va as UniformMeshSdkContextProvider,Ne as badgeIcon,Je as damSelectItemImage,to as damSelectedItemContainer,no as damSelectedItemCopy,oo as damSelectedItemDetails,io as damSelectedItemIcon,po as damSelectedItemInfoBtn,ro as damSelectedItemInner,Ye as damSelectedItemLinkBtn,co as damSelectedItemLinkContainer,lo as damSelectedItemMediaContainer,so as damSelectedItemPopover,ze as damSelectedItemPopoverLabel,le as damSelectedItemSmallText,ao as damSelectedItemTitle,Vr as draggableContainer,Ke as draggableIcon,zr as draggableIconOffset,Dr as draggableIconWrapper,Lr as entrySearchBtn,kr as entrySearchConfig,Ir as entrySearchConfigHidden,Rr as entrySearchLoadMoreBtn,Tr as entrySearchResultList,Er as entrySearchSelectIcon,Mr as entrySearchSelectImg,ac as entrySearchSelectInput,ic as entrySearchSelectOption,Pr as entrySearchWrapper,Nr as productSearchRowActiveIcon,Fr as productSearchRowCategory,Br as productSearchRowContainer,Or as productSearchRowContent,Hr as productSearchRowContentActive,Kr as productSearchRowDetails,$r as productSearchRowTitle,Zr as productSelectedItemContainer,qr as productSelectedItemContent,Xr as productSelectedItemDetails,Yr as productSelectedItemIcon,_e as productSelectedItemImage,Jr as productSelectedItemLinkContainer,Ze as productedSelectedItemLinkBtn,Xe as productedSelectedItemSmallText,br as searchRowBtn,fr as searchRowContainer,hr as searchRowContainerActive,vr as searchRowContainerWithPopover,yr as searchRowPopover,Fe as searchRowText,$e as searchRowTextSmall,He as selectItemLinkBtn,pr as selectItemLinkContainer,lr as selectItemPopover,ye as selectItemPopoverLabel,te as selectItemSmallText,nr as selectedItemContainer,sr as selectedItemCopy,ir as selectedItemDetails,dr as selectedItemIcon,ar as selectedItemInner,cr as selectedItemTitle,pt as useInitializeUniformMeshSdk,Oa as useMeshLocation,kt as useProductQueryContext,De as useProductSearchContext,Ea as useUniformMeshLocation,Ce as useUniformMeshLocationContext,ct as useUniformMeshSdk,st as useUniformMeshSdkContext};
|