@uniformdev/mesh-sdk-react 17.4.1-alpha.1 → 17.4.1-alpha.230
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 +130 -1
- package/dist/index.esm.js +664 -136
- package/dist/index.js +664 -136
- package/dist/index.mjs +664 -136
- package/package.json +15 -10
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Go=Object.create;var rt=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var qo=Object.getOwnPropertyNames;var $o=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var Sa=(e,t)=>{for(var o in t)rt(e,o,{get:t[o],enumerable:!0})},tt=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qo(t))!Fo.call(e,r)&&r!==o&&rt(e,r,{get:()=>t[r],enumerable:!(a=Oo(t,r))||a.enumerable});return e},X=(e,t,o)=>(tt(e,t,"default"),o&&tt(o,t,"default")),se=(e,t,o)=>(o=e!=null?Go($o(e)):{},tt(t||!e||!e.__esModule?rt(o,"default",{value:e,enumerable:!0}):o,e)),No=e=>tt(rt({},"__esModule",{value:!0}),e);var Y={};Sa(Y,{AddListButton:()=>h.AddListButton,Button:()=>h.Button,Callout:()=>h.Callout,DamSelectedItem:()=>mn,DefaultSearchRow:()=>xr,DefaultSelectedItem:()=>gr,EntrySearch:()=>Er,Heading:()=>h.Heading,Icons:()=>ut,Input:()=>h.Input,InputSelect:()=>h.InputSelect,InputToggle:()=>h.InputToggle,InputVariables:()=>ca,KeywordSearchInput:()=>h.InputKeywordSearch,Label:()=>h.Label,LoadingIndicator:()=>h.LoadingIndicator,LoadingOverlay:()=>h.LoadingOverlay,Menu:()=>h.Menu,MenuItem:()=>h.MenuItem,MeshApp:()=>vn,ProductPreviewList:()=>Wt,ProductQuery:()=>Xo,ProductQueryContext:()=>Ft,ProductSearch:()=>gn,ProductSearchContext:()=>Yr,ProductSearchRow:()=>Or,ProductSelectedItem:()=>Qr,RequestBody:()=>wn,RequestHeaders:()=>Sn,RequestMethodSelect:()=>Cn,RequestParameters:()=>Rn,RequestProvider:()=>bn,RequestTypeContainer:()=>ga,RequestUrlInput:()=>Pn,ResolvableLoadingValue:()=>Gt,ScrollableList:()=>h.ScrollableList,ScrollableListItem:()=>h.ScrollableListItem,SelectionField:()=>Ot,Switch:()=>h.Switch,Textarea:()=>h.Textarea,Theme:()=>h.Theme,UniformMeshLocationContext:()=>At,UniformMeshLocationContextProvider:()=>Qe,UniformMeshSdkContext:()=>Ke,UniformMeshSdkContextProvider:()=>Wo,VariableEditor:()=>la,VariablesList:()=>yn,VariablesProvider:()=>hn,badgeIcon:()=>bt,damSelectItemImage:()=>Tt,damSelectedItemContainer:()=>Zr,damSelectedItemCopy:()=>jr,damSelectedItemDetails:()=>Jr,damSelectedItemIcon:()=>ta,damSelectedItemInfoBtn:()=>na,damSelectedItemInner:()=>Xr,damSelectedItemLinkBtn:()=>Pt,damSelectedItemLinkContainer:()=>aa,damSelectedItemMediaContainer:()=>oa,damSelectedItemPopover:()=>ra,damSelectedItemPopoverLabel:()=>je,damSelectedItemSmallText:()=>_e,damSelectedItemTitle:()=>ea,decomposeRelativeUrl:()=>xn,draggableContainer:()=>_r,draggableIcon:()=>yt,draggableIconOffset:()=>Vr,draggableIconWrapper:()=>Ir,entrySearchBtn:()=>Sr,entrySearchConfig:()=>Rr,entrySearchConfigHidden:()=>Pr,entrySearchLoadMoreBtn:()=>Cr,entrySearchResultList:()=>Tr,entrySearchSelectIcon:()=>kr,entrySearchSelectImg:()=>Lr,entrySearchSelectInput:()=>cn,entrySearchSelectOption:()=>pn,entrySearchWrapper:()=>wr,productSearchRowActiveIcon:()=>Hr,productSearchRowCategory:()=>Br,productSearchRowContainer:()=>Dr,productSearchRowContent:()=>Mr,productSearchRowContentActive:()=>Ur,productSearchRowDetails:()=>Ar,productSearchRowTitle:()=>zr,productSelectedItemContainer:()=>$r,productSelectedItemContent:()=>Nr,productSelectedItemDetails:()=>Fr,productSelectedItemIcon:()=>Wr,productSelectedItemImage:()=>xt,productSelectedItemLinkContainer:()=>Kr,productedSelectedItemLinkBtn:()=>wt,productedSelectedItemSmallText:()=>St,searchRowBtn:()=>yr,searchRowContainer:()=>mr,searchRowContainerActive:()=>vr,searchRowContainerWithPopover:()=>fr,searchRowPopover:()=>hr,searchRowText:()=>ht,searchRowTextSmall:()=>vt,selectItemLinkBtn:()=>mt,selectItemLinkContainer:()=>pr,selectItemPopover:()=>cr,selectItemPopoverLabel:()=>Ae,selectItemSmallText:()=>he,selectedItemContainer:()=>or,selectedItemCopy:()=>sr,selectedItemDetails:()=>ir,selectedItemIcon:()=>dr,selectedItemInner:()=>nr,selectedItemTitle:()=>lr,useInitializeUniformMeshSdk:()=>Ht,useMeshLocation:()=>Qo,useProductQueryContext:()=>Nt,useProductSearchContext:()=>Je,useRequest:()=>te,useUniformMeshLocation:()=>Ko,useUniformMeshLocationContext:()=>Ye,useUniformMeshSdk:()=>Bt,useUniformMeshSdkContext:()=>zt,useVariables:()=>De,variablesToList:()=>sa});module.exports=No(Y);var l=require("@emotion/react"),w=se(require("react"));var ve=require("react");var at=require("react");var Ca=require("@uniformdev/design-system"),We=require("@emotion/react/jsx-runtime"),Ke=(0,at.createContext)(void 0),Wo=({children:e})=>{let t;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(t={sdk:window.UniformMeshSDK}),(0,We.jsxs)(Ke.Provider,{value:t,children:[(0,We.jsx)(Ca.Theme,{}),(0,We.jsx)(Qe,{children:e})]})},zt=()=>{let e=(0,at.useContext)(Ke);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function Bt(){let{sdk:e}=zt();return e}var Ra=require("@emotion/react/jsx-runtime"),At=(0,ve.createContext)(void 0),Qe=({children:e})=>{let t=Bt(),[o,a]=(0,ve.useState)(t.getCurrentLocation()),r=n=>{a(i=>({...i,value:n.newValue}))};return(0,ve.useEffect)(()=>(t.events.on("onValueChanged",r),()=>{t.events.off("onValueChanged",r)}),[t]),(0,Ra.jsx)(At.Provider,{value:{location:o},children:e})},Ye=()=>{let e=(0,ve.useContext)(At);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ko(){let{location:e}=Ye();return e}var Pa=require("@uniformdev/mesh-sdk"),Re=require("react"),Ht=({autoResizingDisabled:e}={})=>{let[t,o]=(0,Re.useState)(),[a,r]=(0,Re.useState)(),n=(0,Re.useRef)(!1);return(0,Re.useEffect)(()=>{typeof window=="undefined"||a||(typeof window.UniformMeshSDK=="undefined"&&!n.current?(n.current=!0,(0,Pa.initializeUniformMeshSDK)({autoResizingDisabled:e}).then(i=>{r(i)}).catch(i=>{o(i)}).finally(()=>{n.current=!1})):r(window.UniformMeshSDK))},[e]),{initializing:!a&&!t,error:t,sdk:a}};function Qo(e){let{location:t}=Ye();if(e&&t.type!==e)throw new Error(`Expected location type ${e} but got ${t.type}`);return t}var de=se(require("react"));var _a=require("@emotion/react"),nt=require("@uniformdev/design-system"),Ia=require("react-icons/cg");var ze=require("@emotion/react/jsx-runtime"),Gt=({value:e,text:t,loading:o})=>(0,ze.jsxs)(ze.Fragment,{children:[!!t&&t,!t&&(0,ze.jsxs)(ze.Fragment,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});var ot=require("@emotion/react"),Ta=ot.css`
|
|
2
2
|
align-items: center;
|
|
3
3
|
background: var(--gray-100);
|
|
4
4
|
border: 1px solid var(--gray-300);
|
|
@@ -7,66 +7,66 @@
|
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
margin-bottom: var(--spacing-sm);
|
|
9
9
|
margin-right: var(--spacing-sm);
|
|
10
|
-
`,
|
|
10
|
+
`,ka=ot.css`
|
|
11
11
|
color: var(--gray-800);
|
|
12
12
|
padding: var(--spacing-3);
|
|
13
|
-
`,
|
|
13
|
+
`,La=ot.css`
|
|
14
14
|
border: none;
|
|
15
15
|
border-left: 1px solid var(--gray-300);
|
|
16
16
|
background: var(--gray-100);
|
|
17
17
|
padding: var(--spacing-3);
|
|
18
|
-
`;var
|
|
18
|
+
`;var le=require("@emotion/react/jsx-runtime"),Ot=({id:e,label:t,loading:o,selectedValues:a,values:r,onAdd:n,onRemove:i})=>{var v;let m=(v=r==null?void 0:r.filter(s=>!(a!=null&&a.includes(s.id.toString()))))!=null?v:[],d=(s,f)=>{s.preventDefault(),i(f)};return(0,le.jsxs)("div",{children:[(0,le.jsx)(nt.InputSelect,{id:e,name:e,label:t,onChange:s=>n(s.target.value),disabled:o,options:[{value:"",label:"Add..."},...m.map(s=>({value:s.id,label:s.name||s.id}))],value:"",css:Array.isArray(a)&&a.length>0?_a.css`
|
|
19
19
|
margin-bottom: var(--spacing-base);
|
|
20
|
-
`:""}),
|
|
20
|
+
`:""}),a==null?void 0:a.map(s=>{var f;return(0,le.jsxs)("div",{css:Ta,children:[(0,le.jsx)("span",{css:ka,children:(0,le.jsx)(Gt,{value:s,loading:o,text:(f=r.find(c=>c.id===s))==null?void 0:f.name})}),(0,le.jsx)("button",{css:La,title:"remove",onClick:c=>d(c,s),children:(0,le.jsx)(nt.Icon,{icon:Ia.CgClose,iconColor:"currentColor",size:20})})]},s)})]})};var qt=require("@emotion/react/jsx-runtime"),Yo=e=>(0,qt.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,qt.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"})}),it=Yo;var $t=require("@emotion/react/jsx-runtime"),Zo=e=>(0,$t.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,$t.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"})}),st=Zo;var lt=require("react-use"),F=require("@uniformdev/design-system"),B=require("@emotion/react"),S=require("@emotion/react/jsx-runtime"),Va={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Xo=({value:e,setValue:t,brands:o,categories:a,loading:r,categoriesLoading:n,brandsLoading:i,logoIcon:m,onGetProducts:d,sortOptions:v,sortOrderOptions:s,categoryLabel:f="Product Category",brandLabel:c="Brand",disableBrands:x,restrictToSingleCategory:U=!1})=>{var q,y,K;let P=async p=>{t({...Va,...e||{},...p})},L=(0,de.useMemo)(()=>({...Va,...e||{}}),[e]),[Ue,Fe]=(0,lt.useAsyncFn)(async p=>await d(p),[d]);(0,lt.useDebounce)(async()=>{await Fe({brand:L.brand,categories:L.categories,keyword:L.keyword,sort:L.sort,sortOrder:L.sortOrder,count:L.count})},250,[L]);let re=(0,de.useMemo)(()=>{let p=[];return a==null||a.forEach(Z=>{let E=Da(Z,void 0);p.push(...E)}),p},[a]),me=(0,de.useMemo)(()=>[{value:"",label:"All categories"},...re.map(p=>({label:p.name,value:p.id}))],[re]),ie=(0,de.useMemo)(()=>(o==null?void 0:o.map(p=>({id:p.id.toString(),name:p.name})))||[],[o]),Ne=p=>{if(!p)return;let Z=(e==null?void 0:e.categories)||[];P({categories:[...Z,p]})},et=p=>{var Z;P({categories:(Z=e==null?void 0:e.categories)==null?void 0:Z.filter(E=>E!==p)})},Se=p=>{P({brand:p.target.value})},O=p=>{P({count:p||1})};return r?(0,S.jsx)("div",{children:"Loading..."}):(0,S.jsx)(Ft.Provider,{value:{categories:a,logoIcon:m},children:(0,S.jsxs)("div",{css:B.css`
|
|
21
21
|
> :not(:last-child) {
|
|
22
22
|
margin-bottom: var(--spacing-md);
|
|
23
23
|
}
|
|
24
|
-
`,children:[
|
|
24
|
+
`,children:[U?(0,S.jsx)(F.InputSelect,{id:"selection-field-product-category",label:f,disabled:r,value:(y=(q=L.categories)==null?void 0:q[0])!=null?y:"",options:me,onChange:p=>{P({categories:p.target.value===""?[]:[p.target.value]})}}):(0,S.jsx)(Ot,{loading:n||!1,id:"selection-field-product-category",label:f,onAdd:Ne,onRemove:et,selectedValues:L.categories,values:re}),(0,S.jsxs)("div",{css:B.css`
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-wrap: wrap;
|
|
27
27
|
column-gap: var(--spacing-lg);
|
|
28
28
|
row-gap: var(--spacing-md);
|
|
29
|
-
${(0,
|
|
29
|
+
${(0,F.mq)("md")} {
|
|
30
30
|
flex-wrap: nowrap;
|
|
31
31
|
}
|
|
32
|
-
`,children:[
|
|
32
|
+
`,children:[x?null:(0,S.jsx)("div",{css:B.css`
|
|
33
33
|
width: 50%;
|
|
34
|
-
`,children:(0,
|
|
34
|
+
`,children:(0,S.jsx)(F.InputSelect,{id:"brand",name:"brand",label:c,disabled:i,value:L.brand,onChange:Se,options:[{value:"",label:"Choose..."},...ie.map(p=>({value:p.id,label:p.name}))]})}),(0,S.jsx)("div",{css:B.css`
|
|
35
35
|
flex-grow: 1;
|
|
36
36
|
position: relative;
|
|
37
|
-
`,children:(0,
|
|
37
|
+
`,children:(0,S.jsx)(F.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:L.keyword,placeholder:"Enter keyword",onChange:p=>P({keyword:p.target.value})})})]}),(0,S.jsxs)("div",{css:B.css`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-wrap: wrap;
|
|
40
40
|
column-gap: var(--spacing-lg);
|
|
41
41
|
row-gap: var(--spacing-md);
|
|
42
|
-
${(0,
|
|
42
|
+
${(0,F.mq)("md")} {
|
|
43
43
|
flex-wrap: nowrap;
|
|
44
44
|
}
|
|
45
|
-
`,children:[(0,
|
|
45
|
+
`,children:[(0,S.jsxs)("div",{css:B.css`
|
|
46
46
|
width: 100%;
|
|
47
|
-
${(0,
|
|
47
|
+
${(0,F.mq)("md")} {
|
|
48
48
|
width: 33.333333%;
|
|
49
49
|
}
|
|
50
50
|
position: relative;
|
|
51
|
-
`,children:[(0,
|
|
51
|
+
`,children:[(0,S.jsx)(F.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:L.count,onChange:p=>O(p.target.valueAsNumber),label:"Count"}),(0,S.jsxs)("div",{css:B.css`
|
|
52
52
|
position: absolute;
|
|
53
53
|
bottom: var(--spacing-sm);
|
|
54
54
|
right: var(--spacing-sm);
|
|
55
55
|
display: flex;
|
|
56
56
|
gap: var(--spacing-sm);
|
|
57
|
-
`,children:[(0,
|
|
57
|
+
`,children:[(0,S.jsx)(Ea,{onCountChange:()=>O(L.count-1),countIcon:"decrement",disabled:L.count===1}),(0,S.jsx)(Ea,{onCountChange:()=>O(L.count+1),countIcon:"increment"})]})]}),Array.isArray(v)&&v.length>0?(0,S.jsx)("div",{css:B.css`
|
|
58
58
|
flex-grow: 1;
|
|
59
|
-
${(0,
|
|
59
|
+
${(0,F.mq)("md")} {
|
|
60
60
|
width: 33.333333%;
|
|
61
61
|
}
|
|
62
|
-
`,children:(0,
|
|
62
|
+
`,children:(0,S.jsx)(F.InputSelect,{id:"sort",name:"sort",label:"Sort",value:L.sort,onChange:p=>P({sort:p.target.value}),options:[{value:"",label:"Select a sort"},...v.map(p=>({value:p.sortKey,label:p.name}))]})}):null,Array.isArray(s)&&s.length>0?(0,S.jsx)("div",{css:B.css`
|
|
63
63
|
flex-grow: 1;
|
|
64
|
-
`,children:(0,
|
|
64
|
+
`,children:(0,S.jsx)(F.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:L.sortOrder,onChange:p=>P({sortOrder:p.target.value}),options:s.map(p=>({value:p.sortOrderKey,label:p.name}))})}):null]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("h3",{css:B.css`
|
|
65
65
|
font-size: var(--fs-md);
|
|
66
66
|
line-height: var(--spacing-md);
|
|
67
67
|
font-weight: var(--fw-bold);
|
|
68
68
|
margin-bottom: var(--spacing-xs);
|
|
69
|
-
`,children:"Result Preview"}),(0,
|
|
69
|
+
`,children:"Result Preview"}),(0,S.jsx)(Wt,{products:(K=Ue.value)==null?void 0:K.products})]})]})})};function Da(e,t){var n;let o=[],a=t?`${t.name} > `:"",r={id:e.id.toString(),name:`${a}${e.name}`};return o.push(r),(n=e.children)==null||n.forEach(i=>{let m=Da(i,r);o.push(...m)}),o}function Ea({onCountChange:e,countIcon:t,disabled:o}){return(0,S.jsx)("button",{css:B.css`
|
|
70
70
|
width: 2.25rem;
|
|
71
71
|
height: 2.25rem;
|
|
72
72
|
border: 1px solid var(--gray-300);
|
|
@@ -78,17 +78,17 @@
|
|
|
78
78
|
&:hover {
|
|
79
79
|
background-color: var(--gray-200);
|
|
80
80
|
}
|
|
81
|
-
${o?
|
|
81
|
+
${o?B.css`
|
|
82
82
|
cursor: not-allowed;
|
|
83
83
|
opacity: 0.3;
|
|
84
84
|
`:""}
|
|
85
|
-
`,onClick:e,disabled:o,children:
|
|
85
|
+
`,onClick:e,disabled:o,children:t==="increment"?(0,S.jsx)(it,{css:B.css`
|
|
86
86
|
width: 1rem;
|
|
87
87
|
height: 1rem;
|
|
88
|
-
`}):(0,
|
|
88
|
+
`}):(0,S.jsx)(st,{css:B.css`
|
|
89
89
|
width: 1rem;
|
|
90
90
|
height: 1rem;
|
|
91
|
-
`})})}var
|
|
91
|
+
`})})}var Ft=de.default.createContext(void 0),Nt=()=>{let e=(0,de.useContext)(Ft);if(!e)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return e};var Kt=require("@emotion/react/jsx-runtime");function ae({src:e,alt:t,className:o}){let a=e&&typeof e!="string"?e:null;return a?(0,Kt.jsx)(a,{className:o}):(0,Kt.jsx)("img",{src:e,alt:t,className:o})}var Yt=require("@emotion/react"),$a=require("@uniformdev/design-system");var J=require("@emotion/react"),Ma=J.css`
|
|
92
92
|
align-items: center;
|
|
93
93
|
background: var(--white);
|
|
94
94
|
border-radius: var(--rounded-base);
|
|
@@ -103,55 +103,55 @@
|
|
|
103
103
|
&:hover {
|
|
104
104
|
background: var(--gray-50);
|
|
105
105
|
}
|
|
106
|
-
`,
|
|
106
|
+
`,Ua=J.css`
|
|
107
107
|
font-size: var(--fs-sm);
|
|
108
|
-
`,
|
|
108
|
+
`,za=J.css`
|
|
109
109
|
width: 1rem;
|
|
110
110
|
height: 1rem;
|
|
111
|
-
`,
|
|
111
|
+
`,Qt=J.css`
|
|
112
112
|
margin-right: var(--spacing-lg);
|
|
113
113
|
font-size: var(--fs-sm);
|
|
114
|
-
`,
|
|
114
|
+
`,Ba=J.css`
|
|
115
115
|
border: 1px solid var(--gray-200);
|
|
116
116
|
border-radius: var(--rounded-md);
|
|
117
117
|
background: var(--gray-50);
|
|
118
118
|
margin: var(--spacing-base) 0;
|
|
119
|
-
`,
|
|
119
|
+
`,Aa=J.css`
|
|
120
120
|
align-items: center;
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-grow: 1;
|
|
123
123
|
gap: var(--spacing-base);
|
|
124
124
|
padding: var(--spacing-sm);
|
|
125
125
|
margin-right: var(--spacing-sm);
|
|
126
|
-
`,
|
|
126
|
+
`,Ha=J.css`
|
|
127
127
|
background: var(--gray-200);
|
|
128
128
|
width: 3.5rem;
|
|
129
129
|
height: 3.5rem;
|
|
130
130
|
object-fit: cover;
|
|
131
|
-
`,
|
|
131
|
+
`,Ga=J.css`
|
|
132
132
|
background: var(--gray-100);
|
|
133
133
|
height: 3.5rem;
|
|
134
134
|
width: 3.5rem;
|
|
135
|
-
`,
|
|
135
|
+
`,Oa=J.css`
|
|
136
136
|
margin-top: 0;
|
|
137
137
|
font-weight: var(--fw-bold);
|
|
138
138
|
font-size: var(--fs-sm);
|
|
139
139
|
width: calc(100% / 3);
|
|
140
|
-
`,
|
|
140
|
+
`,qa=J.css`
|
|
141
141
|
display: block;
|
|
142
142
|
font-weight: var(--fw-regular);
|
|
143
|
-
`;var
|
|
143
|
+
`;var _=require("@emotion/react/jsx-runtime"),Wt=({products:e})=>{let{categories:t,logoIcon:o}=Nt();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{css:Yt.css`
|
|
144
144
|
margin-bottom: var(--spacing-base);
|
|
145
|
-
`,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),(0,
|
|
145
|
+
`,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),(0,_.jsx)("ul",{css:[Yt.css`
|
|
146
146
|
max-height: 24rem;
|
|
147
147
|
overflow-x: auto;
|
|
148
|
-
|
|
148
|
+
`,$a.scrollbarStyles],children:e==null?void 0:e.map((a,r)=>{var m,d;let[n]=(a==null?void 0:a.categories)||[],i=typeof n=="undefined"||!t||(m=t.find(v=>v.id===n.id))==null?void 0:m.name;return(0,_.jsx)("li",{css:Ba,children:(0,_.jsxs)("div",{css:Aa,"data-test-id":`product-item-${a.sku||a.id}`,children:[a.thumbnailUrl?(0,_.jsx)("img",{src:a.thumbnailUrl,alt:typeof a.title=="string"?a.title:a.name||`Product ${r}`,css:Ha,"data-test-id":"product-image"}):(0,_.jsx)("div",{css:Ga}),(0,_.jsxs)("h4",{css:Oa,"data-test-id":"product-name",children:[a.title||a.name,i&&(0,_.jsx)("span",{css:qa,children:i})]}),a&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("p",{css:Qt,"data-test-id":"product-sku",children:["SKU: ",a.sku||a.id,(0,_.jsx)("br",{})]}),a.price!==void 0?(0,_.jsxs)("p",{css:Qt,"data-test-id":"product-price",children:["Price: ",a.price]}):null,a.editLink||a.url?(0,_.jsxs)("a",{css:Ma,href:(d=a.editLink)!=null?d:a.url,title:`Go to ${a.title||a.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[(0,_.jsx)("span",{css:Ua,children:"Edit"}),o?(0,_.jsx)(ae,{src:o,alt:"Logo",css:za}):null]}):null]})]})},`product-${a.id}`)})})]})};var xe=se(require("react"));var oe=se(require("react"));var ut={};Sa(ut,{Caution:()=>Fa,Checkmark:()=>dt,ChevronDown:()=>ct,Close:()=>Na,Danger:()=>Wa,ExclamationPoint:()=>Ka,Info:()=>pt,Lightbulb:()=>Qa,MagnifyingGlass:()=>Ya,MaximizeAlt:()=>Za,Minus:()=>st,MoreVerticalAlt:()=>Xe,Plus:()=>it});var Zt=require("@emotion/react/jsx-runtime"),Jo=e=>(0,Zt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:(0,Zt.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})}),Fa=Jo;var Xt=require("@emotion/react/jsx-runtime"),jo=e=>(0,Xt.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Xt.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"})}),dt=jo;var Jt=require("@emotion/react/jsx-runtime"),en=e=>(0,Jt.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:(0,Jt.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"})}),ct=en;var Be=require("@emotion/react/jsx-runtime"),tn=e=>(0,Be.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:(0,Be.jsxs)("g",{fillRule:"evenodd",children:[(0,Be.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,Be.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"})]})}),Na=tn;var jt=require("@emotion/react/jsx-runtime"),rn=e=>(0,jt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,jt.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"})}),Wa=rn;var er=require("@emotion/react/jsx-runtime"),an=e=>(0,er.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:(0,er.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"})}),Ka=an;var Ze=require("@emotion/react/jsx-runtime"),on=e=>(0,Ze.jsxs)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[(0,Ze.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,Ze.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"})]}),pt=on;var tr=require("@emotion/react/jsx-runtime"),nn=e=>(0,tr.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:(0,tr.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"})}),Qa=nn;var ce=require("@emotion/react/jsx-runtime"),sn=e=>(0,ce.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,ce.jsxs)("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[(0,ce.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,ce.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,ce.jsx)("defs",{children:(0,ce.jsx)("clipPath",{id:"magnifying-glass_svg__a",children:(0,ce.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),Ya=sn;var rr=require("@emotion/react/jsx-runtime"),ln=e=>(0,rr.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,rr.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"})}),Za=ln;var ar=require("@emotion/react/jsx-runtime"),dn=e=>(0,ar.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:(0,ar.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"})}),Xe=dn;var eo=require("react-use"),to=require("uuid");var Pe=require("react");function gt(e,t){let o=window.open(e,"_blank"),a=setInterval(()=>{o!=null&&o.closed&&(clearInterval(a),t())},500)}var Ja=require("timeago.js");var Q=require("@emotion/react"),Xa=require("@uniformdev/design-system"),or=Q.css`
|
|
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
|
+
`,nr=Q.css`
|
|
155
155
|
align-items: center;
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-grow: 1;
|
|
@@ -159,22 +159,22 @@
|
|
|
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=Q.css`
|
|
163
163
|
flex-grow: 1;
|
|
164
|
-
`,
|
|
164
|
+
`,sr=Q.css`
|
|
165
165
|
align-items: start;
|
|
166
166
|
display: inline-flex;
|
|
167
167
|
position: relative;
|
|
168
|
-
|
|
168
|
+
`,lr=Q.css`
|
|
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=Q.css`
|
|
175
175
|
width: 1.5rem;
|
|
176
176
|
height: 1.5rem;
|
|
177
|
-
`,
|
|
177
|
+
`,cr=Q.css`
|
|
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 @@
|
|
|
183
183
|
padding: var(--spacing-base);
|
|
184
184
|
z-index: var(--z-10);
|
|
185
185
|
width: max-content;
|
|
186
|
-
`,
|
|
186
|
+
`,he=Q.css`
|
|
187
187
|
font-size: var(--fs-sm);
|
|
188
|
-
`,
|
|
188
|
+
`,Ae=Q.css`
|
|
189
189
|
font-weight: var(--fw-bold);
|
|
190
190
|
margin-right: var(--spacing-sm);
|
|
191
|
-
`,
|
|
191
|
+
`,pr=Q.css`
|
|
192
192
|
display: flex;
|
|
193
193
|
flex-direction: column;
|
|
194
194
|
gap: var(--spacing-sm);
|
|
195
195
|
|
|
196
|
-
${(0,
|
|
196
|
+
${(0,Xa.mq)("md")} {
|
|
197
197
|
flex-direction: row;
|
|
198
198
|
min-width: 200px;
|
|
199
199
|
justify-content: end;
|
|
200
200
|
}
|
|
201
|
-
`,
|
|
201
|
+
`,mt=Q.css`
|
|
202
202
|
align-items: center;
|
|
203
203
|
background: var(--white);
|
|
204
204
|
border-radius: var(--rounded-base);
|
|
@@ -213,39 +213,39 @@
|
|
|
213
213
|
&:hover {
|
|
214
214
|
background: var(--gray-50);
|
|
215
215
|
}
|
|
216
|
-
`;var
|
|
216
|
+
`;var pe=require("@emotion/react");var ur=require("@uniformdev/design-system"),ft=require("react-icons/cg"),C=require("@emotion/react/jsx-runtime"),gr=({selectedItem:e,logoIcon:t,onDeselect:o,onEditClosed:a})=>{var v;let r=(0,Pe.useRef)(null),n=(0,Pe.useRef)(null),[i,m]=(0,Pe.useState)(!1);(0,Pe.useEffect)(()=>{let s=c=>{r.current&&!r.current.contains(c.target)&&n.current&&!n.current.contains(c.target)&&m(!1)},f=()=>{m(!1)};return window.addEventListener("resize",f,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",f,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[n]);let d=()=>{var s;if(m(!i),n.current&&r.current){let f=(s=r==null?void 0:r.current)==null?void 0:s.getBoundingClientRect(),c=n.current.offsetWidth;n.current.style.top=`${f.top+30}px`,n.current.style.left=`${f.left-c+30}px`}};return(0,C.jsx)("div",{css:or,children:(0,C.jsxs)("div",{css:nr,children:[(0,C.jsxs)("div",{css:ir,children:[(0,C.jsxs)("div",{css:sr,children:[(0,C.jsx)("h4",{css:[lr,e.popoverData?pe.css`
|
|
217
217
|
margin-bottom: var(--spacing-sm);
|
|
218
|
-
`:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?(0,
|
|
218
|
+
`:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("button",{type:"button",ref:r,css:pe.css`
|
|
219
219
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
220
|
-
`,"aria-controls":"path-details","aria-expanded":
|
|
220
|
+
`,"aria-controls":"path-details","aria-expanded":i,onClick:d,children:(0,C.jsx)(ur.Icon,{icon:ft.CgInfo,iconColor:"gray",size:24,css:pe.css`
|
|
221
221
|
opacity: var(--opacity-75);
|
|
222
|
-
`})}),(0,
|
|
222
|
+
`})}),(0,C.jsx)("div",{id:"path-details","aria-hidden":!i,ref:n,css:[cr,i?pe.css`
|
|
223
223
|
visibility: visible;
|
|
224
|
-
`:
|
|
224
|
+
`:pe.css`
|
|
225
225
|
visibility: hidden;
|
|
226
|
-
`],children:Object.entries(e.popoverData).map(([
|
|
226
|
+
`],children:Object.entries(e.popoverData).map(([s,f],c)=>(0,C.jsxs)("div",{css:he,children:[(0,C.jsxs)("span",{css:Ae,children:[s,":"]}),f]},c))})]}):null]}),e.createdDate&&(0,C.jsxs)("div",{css:he,children:[(0,C.jsx)("span",{css:Ae,children:"Created:"}),(0,Ja.format)((v=e.createdDate)!=null?v:0)]}),e.metadata?Object.entries(e.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,f])=>(0,C.jsxs)("div",{css:[he,pe.css`
|
|
227
227
|
order: 1;
|
|
228
|
-
`],children:[(0,
|
|
228
|
+
`],children:[(0,C.jsxs)("span",{css:Ae,children:[s,":"]}),f]},s)):null,e.metadata?Object.entries(e.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,f])=>(0,C.jsxs)("div",{css:[he,pe.css`
|
|
229
229
|
order: 1;
|
|
230
|
-
`],children:[(0,
|
|
230
|
+
`],children:[(0,C.jsxs)("span",{css:[Ae,pe.css`
|
|
231
231
|
order: 1;
|
|
232
|
-
`],children:[
|
|
232
|
+
`],children:[s,":"]}),f]},s)):null]}),(0,C.jsxs)("div",{css:pr,children:[e.editLink?(0,C.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:s=>{a&&(gt(s.currentTarget.href,()=>a(e)),s.preventDefault())},css:mt,children:[(0,C.jsx)("span",{css:he,children:"Edit"}),(0,C.jsx)(ae,{src:t,css:dr,alt:"Logo"})]}):null,(0,C.jsxs)("button",{type:"button",onClick:()=>{o(e)},css:mt,children:[(0,C.jsx)("span",{css:he,children:"Unlink"}),(0,C.jsx)(ur.Icon,{icon:ft.CgClose,iconColor:"red",size:16})]})]})]})},e.id)};var Te=require("react");var ye=require("@emotion/react"),mr=ye.css`
|
|
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
|
+
`,fr=ye.css`
|
|
239
239
|
padding-right: var(--spacing-lg);
|
|
240
|
-
`,
|
|
240
|
+
`,vr=ye.css`
|
|
241
241
|
background: var(--brand-secondary-3);
|
|
242
242
|
color: var(--white);
|
|
243
|
-
`,
|
|
243
|
+
`,vt=ye.css`
|
|
244
244
|
font-size: var(--fs-xs);
|
|
245
|
-
`,
|
|
245
|
+
`,ht=ye.css`
|
|
246
246
|
font-weight: var(--fw-bold);
|
|
247
247
|
margin-right: var(--spacing-sm);
|
|
248
|
-
`,
|
|
248
|
+
`,hr=ye.css`
|
|
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 @@
|
|
|
257
257
|
right: var(--spacing-xl);
|
|
258
258
|
z-index: var(--z-10);
|
|
259
259
|
width: max-content;
|
|
260
|
-
`,
|
|
260
|
+
`,yr=ye.css`
|
|
261
261
|
position: absolute;
|
|
262
262
|
inset: 0 var(--spacing-sm) 0 auto;
|
|
263
|
-
`;var
|
|
263
|
+
`;var br=require("@emotion/react"),N=require("@emotion/react/jsx-runtime"),xr=({result:e,isSelected:t,triggerSelection:o})=>{let a=(0,Te.useRef)(null),r=(0,Te.useRef)(null),[n,i]=(0,Te.useState)(!1);(0,Te.useEffect)(()=>{function d(v){a.current&&!a.current.contains(v.target)&&r.current&&!r.current.contains(v.target)&&i(!1)}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[r]);let m=d=>{d.stopPropagation(),i(!n)};return(0,N.jsxs)("div",{css:[mr,t?vr:void 0,e.popoverData?fr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&t?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("button",{type:"button",ref:a,css:yr,"aria-controls":"path-details",onClick:d=>m(d),"aria-expanded":n,children:(0,N.jsx)(pt,{width:24,height:24})}),(0,N.jsxs)("div",{id:"path-details","aria-hidden":!n,ref:r,css:[hr,n?br.css`
|
|
264
264
|
visibility: visible;
|
|
265
|
-
`:
|
|
265
|
+
`:br.css`
|
|
266
266
|
visibility: hidden;
|
|
267
|
-
`],children:[e.metadata&&Object.entries(e.metadata).map(([v
|
|
267
|
+
`],children:[e.metadata&&Object.entries(e.metadata).map(([d,v],s)=>(0,N.jsxs)("div",{css:vt,children:[(0,N.jsxs)("span",{css:ht,children:[d,":"]}),v]},s)),Object.entries(e.popoverData).map(([d,v],s)=>(0,N.jsxs)("div",{css:vt,children:[(0,N.jsxs)("span",{css:ht,children:[d,":"]}),v]},s))]})]}):null]},e.id)};var He=require("react-beautiful-dnd");var z=require("@emotion/react"),wr=z.css`
|
|
268
268
|
background: var(--white);
|
|
269
269
|
border: 1px solid var(--gray-300);
|
|
270
270
|
border-radius: var(--rounded-base);
|
|
271
271
|
padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
|
|
272
272
|
margin-bottom: var(--spacing-base);
|
|
273
|
-
`,
|
|
273
|
+
`,Sr=z.css`
|
|
274
274
|
align-items: center;
|
|
275
275
|
display: flex;
|
|
276
276
|
position: relative;
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
width: 100%;
|
|
279
279
|
background-color: transparent;
|
|
280
280
|
border: 0;
|
|
281
|
-
`,
|
|
281
|
+
`,Cr=z.css`
|
|
282
282
|
color: var(--brand-secondary-1);
|
|
283
283
|
display: block;
|
|
284
284
|
font-weight: var(--fw-bold);
|
|
@@ -294,15 +294,15 @@
|
|
|
294
294
|
background: var(--gray-100);
|
|
295
295
|
outline: none;
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`,Rr=z.css`
|
|
298
298
|
background: var(--white);
|
|
299
299
|
border: 1px solid var(--gray-300);
|
|
300
300
|
border-radius: var(--rounded-base);
|
|
301
301
|
padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
|
|
302
302
|
display: block;
|
|
303
|
-
`,
|
|
303
|
+
`,Pr=z.css`
|
|
304
304
|
display: none;
|
|
305
|
-
`,
|
|
305
|
+
`,Tr=z.css`
|
|
306
306
|
overflow-y: auto;
|
|
307
307
|
height: 16rem;
|
|
308
308
|
margin-bottom: var(--spacing-base);
|
|
@@ -311,122 +311,127 @@
|
|
|
311
311
|
& > :not(:last-child) {
|
|
312
312
|
border-bottom: 1px solid var(--gray-200);
|
|
313
313
|
}
|
|
314
|
-
`,
|
|
314
|
+
`,cn=z.css`
|
|
315
315
|
background-color: var(--gray-50);
|
|
316
316
|
max-width: 33.33%;
|
|
317
|
-
`,
|
|
317
|
+
`,kr=z.css`
|
|
318
318
|
align-items: center;
|
|
319
319
|
display: flex;
|
|
320
320
|
position: absolute;
|
|
321
321
|
inset: 0 0 0 auto;
|
|
322
322
|
pointer-events: none;
|
|
323
323
|
padding-right: var(--spacing-sm);
|
|
324
|
-
`,
|
|
324
|
+
`,Lr=z.css`
|
|
325
325
|
color: var(--brand-secondary-1);
|
|
326
326
|
width: 1.25rem;
|
|
327
327
|
height: 1.25rem;
|
|
328
328
|
transition: transform var(--duration-fast) var(--timing-ease-out);
|
|
329
329
|
transform: rotate(0);
|
|
330
|
-
`,
|
|
330
|
+
`,pn=z.css`
|
|
331
331
|
background: var(--white);
|
|
332
332
|
color: var(--brand-secondary-1);
|
|
333
|
-
`,
|
|
333
|
+
`,_r=z.css`
|
|
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
|
+
|
|
341
|
+
&[data-dragging='true'] {
|
|
342
|
+
left: auto !important;
|
|
343
|
+
top: auto !important;
|
|
344
|
+
}
|
|
345
|
+
`,Ir=z.css`
|
|
341
346
|
align-items: center;
|
|
342
347
|
display: flex;
|
|
343
348
|
position: absolute;
|
|
344
349
|
inset: 0 auto 0 0;
|
|
345
350
|
margin-block: auto;
|
|
346
351
|
opacity: 0;
|
|
347
|
-
`,
|
|
352
|
+
`,yt=z.css`
|
|
348
353
|
color: var(--brand-secondary-1);
|
|
349
|
-
`,
|
|
354
|
+
`,Vr=z.css`
|
|
350
355
|
position: absolute;
|
|
351
356
|
left: 0.375rem;
|
|
352
|
-
`,
|
|
357
|
+
`,bt=z.css`
|
|
353
358
|
width: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
354
359
|
height: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
355
|
-
`;var
|
|
360
|
+
`;var j=require("@emotion/react"),I=require("@uniformdev/design-system");var ke=require("react");function ja(e,{delay:t=500,minDuration:o=200}={delay:500,minDuration:200}){let[a,r]=(0,ke.useState)("IDLE"),n=(0,ke.useRef)(void 0);return(0,ke.useEffect)(()=>{e&&a==="IDLE"&&(clearTimeout(n.current),n.current=setTimeout(()=>{if(!e)return r("IDLE");n.current=setTimeout(()=>{r("EXPIRE")},o),r("DISPLAY")},t),r("DELAY")),!e&&a!=="DISPLAY"&&(clearTimeout(n.current),r("IDLE"))},[e,a,t,o]),(0,ke.useEffect)(()=>()=>clearTimeout(n.current),[]),a==="DISPLAY"||a==="EXPIRE"}var g=require("@emotion/react/jsx-runtime"),un=({searchText:e,selectedContentType:t})=>{let o="No content found";return t&&t!=="any"&&(o=`No ${t} content was found`),e&&(o=`${o} for keyword '${e}'.`),(0,g.jsx)(I.Callout,{type:"info",children:o})},Er=({search:e,results:t,contentTypes:o,selectedItems:a,logoIcon:r,select:n,multiSelect:i,multiSelectId:m,rowComponent:d,selectedItemComponent:v,totalResults:s,cursor:f,resultsLoading:c,requireContentType:x,onAddNew:U,onEditClosed:P,onCancel:L,noResultsComponent:Ue,helpComponent:Fe,onSort:re,typeSelectorLabel:me="Content Type Select",typeSelectorAllTypesOptionText:ie="All content types",loadingIndicatorDelay:Ne=1e3})=>{var ba,xa,wa;let Se=()=>x?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[O,q]=oe.useState(""),[y,K]=oe.useState(Se),[p,Z]=oe.useState(!1),[E,Ce]=oe.useState([]),[To,fa]=oe.useState(!1),Dt=oe.useRef(`x${(0,to.v4)()}`);(0,eo.useDebounce)(()=>{e(O,{count:5,offset:0,contentType:y==="any"?void 0:y})},300,[O,y]);let ko=ja(c,{delay:Ne}),Lo=u=>{E.some(R=>R.id===u.id)?Ce(R=>R.filter(fe=>fe.id!==u.id)):Ce(i?R=>[...R,u]:[u])},_o=a==null?void 0:a.map(u=>u.id+u.title).join(",");oe.useEffect(()=>{Array.isArray(a)&&Ce(a)},[_o]);let Io=()=>{K(Se()),q(""),Ce(a!=null&&a.length?a:[])},Vo=()=>{Z(u=>!u),p||Io()},va=u=>{let R=(E==null?void 0:E.filter(fe=>fe.id!==u.id))||[];Ce(R),n(R,"")},Eo=u=>{u.preventDefault(),n(E,y),Z(!1)},Do=u=>{u.preventDefault(),Z(!1),L&&L()},Mo=()=>{e(O,{count:5,offset:(t==null?void 0:t.length)||0,contentType:y==="any"?void 0:y,cursor:f}),fa(!0);let u=setTimeout(()=>{fa(!1)},750);return()=>clearTimeout(u)},Uo=!(a==null?void 0:a.length)||i,zo=d||xr,ha=v||gr,Bo=Ue||un,ya=r&&typeof r!="string"?r:null,Ao=ya?(0,g.jsx)(ya,{css:bt}):(0,g.jsx)("img",{src:r,alt:"Logo",css:bt}),Ho=u=>{var R,fe;if(u.destination&&u.source.droppableId===((R=u.destination)==null?void 0:R.droppableId)){let $=[...a||[]],[Mt]=(fe=$==null?void 0:$.splice(u.source.index,1))!=null?fe:[];return $==null||$.splice(u.destination.index,0,Mt),re&&(Ce($),re==null||re($)),$}};return(0,g.jsx)("div",{css:j.css`
|
|
356
361
|
width: 100%;
|
|
357
|
-
`,children:(0,
|
|
362
|
+
`,children:(0,g.jsxs)("div",{css:j.css`
|
|
358
363
|
position: relative;
|
|
359
364
|
margin-block: var(--spacing-base);
|
|
360
|
-
`,children:[
|
|
365
|
+
`,children:[Uo?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{css:wr,"data-test-id":"component-search",children:(0,g.jsxs)("button",{css:Sr,onClick:Vo,type:"button","aria-haspopup":!0,"aria-expanded":p,"aria-controls":`entry-search-config-${Dt.current}`,children:[Ao,(0,g.jsx)("span",{css:j.css`
|
|
361
366
|
margin-left: var(--spacing-base);
|
|
362
|
-
`,children:"Select"}),(0,
|
|
367
|
+
`,children:"Select"}),(0,g.jsx)("span",{css:kr,children:(0,g.jsx)(ct,{css:[Lr,p?j.css`
|
|
363
368
|
transform: rotate(180deg);
|
|
364
|
-
`:void 0]})})]})}),(0,
|
|
369
|
+
`:void 0]})})]})}),(0,g.jsxs)("div",{id:`entry-search-config-${Dt.current}`,"aria-hidden":!p,css:[Rr,p?void 0:Pr],children:[Fe||null,(0,g.jsxs)("div",{css:j.css`
|
|
365
370
|
display: flex;
|
|
366
371
|
gap: calc(var(--spacing-base) - 0.25rem);
|
|
367
372
|
margin-bottom: var(--spacing-base);
|
|
368
|
-
`,children:[(0,
|
|
373
|
+
`,children:[(0,g.jsx)(I.InputSelect,{onChange:u=>K(u.target.value),value:y,label:me,showLabel:!1,options:[...x?[]:[{value:"any",label:ie}],...o?o.map(u=>({value:u.id,label:u.name})):[]]}),(0,g.jsx)("div",{css:j.css`
|
|
369
374
|
flex-grow: 1;
|
|
370
|
-
`,children:(0,
|
|
375
|
+
`,children:(0,g.jsx)(I.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:q,disabledFieldSubmission:!0,value:O})})]}),(0,g.jsxs)("div",{css:[Tr,I.scrollbarStyles],id:Dt.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[(0,g.jsx)(I.LoadingOverlay,{isActive:ko}),Array.isArray(t)&&t.length>0?t.map(u=>(0,g.jsx)(zo,{isSelected:E.some(R=>R.id===u.id),result:u,triggerSelection:()=>Lo(u)},u.id)):c?null:(0,g.jsx)(Bo,{searchText:O||O,selectedContentType:(xa=(ba=o==null?void 0:o.find(u=>u.id===y))==null?void 0:ba.name)!=null?xa:y}),!c&&typeof s!="undefined"&&t&&(t==null?void 0:t.length)<s&&(0,g.jsx)("button",{type:"button",css:Cr,onClick:Mo,children:To?(0,g.jsx)(I.LoadingIndicator,{}):"Load More"})]}),(0,g.jsxs)("div",{css:j.css`
|
|
371
376
|
display: flex;
|
|
372
377
|
justify-content: space-between;
|
|
373
|
-
`,children:[(0,
|
|
378
|
+
`,children:[(0,g.jsx)("div",{children:U&&((wa=o==null?void 0:o.length)!=null?wa:0)>0?(0,g.jsx)(I.Menu,{menuLabel:"Add new menu",menuTrigger:(0,g.jsx)(I.Button,{buttonType:"secondary",children:"Add New"}),children:o==null?void 0:o.map(u=>(0,g.jsx)(I.MenuItem,{css:j.css`
|
|
374
379
|
background: var(--white);
|
|
375
380
|
color: var(--brand-secondary-1);
|
|
376
|
-
`,onClick:()=>
|
|
381
|
+
`,onClick:()=>U(u),children:u.name},u.id))}):null}),(0,g.jsxs)("div",{css:j.css`
|
|
377
382
|
display: flex;
|
|
378
383
|
gap: var(--spacing-base);
|
|
379
|
-
`,children:[(0,
|
|
384
|
+
`,children:[(0,g.jsx)(I.Button,{buttonType:"unimportant",onClick:Do,children:"Cancel"}),(0,g.jsx)(I.Button,{disabled:!E.length,onClick:Eo,"data-test-id":"entry-accept-button",children:"Accept"})]})]})]})]}):null,p?null:i&&E.length>1?(0,g.jsx)(He.DragDropContext,{onDragEnd:u=>Ho(u),children:(0,g.jsx)(He.Droppable,{droppableId:m||"canvas-multi-select",children:u=>(0,g.jsxs)("div",{...u.droppableProps,ref:u.innerRef,css:j.css`
|
|
380
385
|
margin-block: var(--spacing-sm) 0;
|
|
381
|
-
`,children:[
|
|
386
|
+
`,children:[E==null?void 0:E.map((R,fe)=>{if(R!=null&&R.id)return(0,g.jsx)(He.Draggable,{draggableId:R.id,index:fe,children:($,Mt)=>(0,g.jsxs)("div",{css:_r,ref:$.innerRef,"data-dragging":Mt.isDragging,...$.draggableProps,...$.dragHandleProps,children:[(0,g.jsxs)("span",{css:Ir,children:[(0,g.jsx)(Xe,{css:[yt,Vr],width:24,height:24}),(0,g.jsx)(Xe,{css:yt,width:24,height:24})]}),(0,g.jsx)(ha,{logoIcon:r,selectedItem:R,onDeselect:Ut=>va(Ut),onEditClosed:P?Ut=>P(Ut):void 0},`selected-item-${R.id}`)]})},R.id)}),u.placeholder]})})}):E==null?void 0:E.map(u=>(0,g.jsx)(ha,{logoIcon:r,selectedItem:u,onDeselect:R=>va(R),onEditClosed:P?R=>P(R):void 0},`selected-item-${u.id}`))]})})};var be=require("@emotion/react"),Dr=be.css`
|
|
382
387
|
cursor: pointer;
|
|
383
388
|
padding: var(--spacing-sm) 0;
|
|
384
389
|
margin-right: var(--spacing-sm);
|
|
385
390
|
position: relative;
|
|
386
391
|
transition: background-color var(--duration-fast) var(--timing-ease-out),
|
|
387
392
|
color var(--duration-fast) var(--timing-ease-out);
|
|
388
|
-
`,
|
|
393
|
+
`,Mr=be.css`
|
|
389
394
|
border: 2px solid transparent;
|
|
390
395
|
border-radius: var(--rounded-base);
|
|
391
396
|
display: flex;
|
|
392
397
|
align-items: center;
|
|
393
398
|
gap: var(--spacing-base);
|
|
394
399
|
padding: var(--spacing-sm) var(--spacing-xs);
|
|
395
|
-
`,
|
|
400
|
+
`,Ur=be.css`
|
|
396
401
|
background-color: var(--green-50);
|
|
397
|
-
`,
|
|
402
|
+
`,zr=be.css`
|
|
398
403
|
font-size: var(--fs-sm);
|
|
399
404
|
font-weight: var(--fw-bold);
|
|
400
405
|
width: 50%;
|
|
401
|
-
`,
|
|
406
|
+
`,Br=be.css`
|
|
402
407
|
font-weight: var(--fw-normal);
|
|
403
408
|
display: block;
|
|
404
|
-
`,
|
|
409
|
+
`,Ar=be.css`
|
|
405
410
|
font-size: var(--fs-sm);
|
|
406
411
|
> * {
|
|
407
412
|
display: block;
|
|
408
413
|
}
|
|
409
|
-
`,
|
|
414
|
+
`,Hr=be.css`
|
|
410
415
|
display: block;
|
|
411
416
|
height: 1.5rem;
|
|
412
417
|
width: 1.5rem;
|
|
413
418
|
color: var(--brand-secondary-3);
|
|
414
419
|
margin-left: auto;
|
|
415
|
-
`;var
|
|
420
|
+
`;var Gr=require("@emotion/react");var ee=require("@emotion/react/jsx-runtime");function Or({result:e,isSelected:t,triggerSelection:o}){var m;let{categories:a,logoIcon:r}=Je(),[n]=e.categories||[{id:"",name:""}],i=typeof n=="undefined"||!a||(m=a.find(d=>d.id===n.id))==null?void 0:m.name;return(0,ee.jsx)("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Dr],children:(0,ee.jsxs)("div",{css:[Mr,t?Ur:void 0],children:[e.thumbnailUrl?(0,ee.jsx)("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Gr.css`
|
|
416
421
|
background-color: var(--gray-200);
|
|
417
422
|
width: 3rem;
|
|
418
423
|
height: 3rem;
|
|
419
424
|
object-fit: cover;
|
|
420
|
-
`}):(0,
|
|
425
|
+
`}):(0,ee.jsx)(ae,{src:r,alt:"Logo",css:Gr.css`
|
|
421
426
|
height: 2.25rem;
|
|
422
427
|
width: 2.25rem;
|
|
423
|
-
`}),(0,
|
|
428
|
+
`}),(0,ee.jsxs)("h4",{css:[zr],children:[e.title,i?(0,ee.jsx)("span",{css:[Br],children:i}):null]}),(0,ee.jsxs)("p",{css:[Ar],children:["SKU: ",e.sku||e.id,e.price!==void 0?(0,ee.jsx)("span",{children:e.price}):null]}),t?(0,ee.jsx)(dt,{css:[Hr]}):null]})},e.id)}var ue=require("@emotion/react"),qr=require("@uniformdev/design-system"),$r=ue.css`
|
|
424
429
|
border: 1px solid var(--gray-200);
|
|
425
430
|
border-radius: var(--rounded-base);
|
|
426
431
|
background: var(--gray-50);
|
|
427
432
|
display: flex;
|
|
428
433
|
width: 100%;
|
|
429
|
-
`,
|
|
434
|
+
`,Fr=ue.css`
|
|
430
435
|
align-items: center;
|
|
431
436
|
display: flex;
|
|
432
437
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
@@ -434,22 +439,22 @@
|
|
|
434
439
|
flex-grow: 1;
|
|
435
440
|
gap: var(--spacing-sm);
|
|
436
441
|
margin-inline: 0 var(--spacing-sm);
|
|
437
|
-
`,
|
|
442
|
+
`,Nr=ue.css`
|
|
438
443
|
display: flex;
|
|
439
444
|
align-items: center;
|
|
440
445
|
gap: var(--spacing-sm);
|
|
441
446
|
flex-grow: 1;
|
|
442
447
|
|
|
443
|
-
${(0,
|
|
448
|
+
${(0,qr.mq)("lg")} {
|
|
444
449
|
width: 50%;
|
|
445
450
|
margin-bottom: 0;
|
|
446
451
|
}
|
|
447
|
-
`,
|
|
452
|
+
`,xt=ue.css`
|
|
448
453
|
background-color: var(--gray-200);
|
|
449
454
|
width: 3.5rem;
|
|
450
455
|
height: 3.5rem;
|
|
451
456
|
object-fit: cover;
|
|
452
|
-
`,
|
|
457
|
+
`,wt=ue.css`
|
|
453
458
|
align-items: center;
|
|
454
459
|
background: var(--white);
|
|
455
460
|
border-radius: var(--rounded-base);
|
|
@@ -464,50 +469,50 @@
|
|
|
464
469
|
&:hover {
|
|
465
470
|
background: var(--gray-50);
|
|
466
471
|
}
|
|
467
|
-
`,
|
|
472
|
+
`,St=ue.css`
|
|
468
473
|
font-size: var(--fs-sm);
|
|
469
|
-
`,
|
|
474
|
+
`,Wr=ue.css`
|
|
470
475
|
display: block;
|
|
471
476
|
width: 1rem;
|
|
472
477
|
height: 1rem;
|
|
473
|
-
`,
|
|
478
|
+
`,Kr=ue.css`
|
|
474
479
|
display: flex;
|
|
475
480
|
flex-direction: column;
|
|
476
481
|
gap: var(--spacing-sm);
|
|
477
482
|
|
|
478
|
-
${(0,
|
|
483
|
+
${(0,qr.mq)("md")} {
|
|
479
484
|
flex-direction: row;
|
|
480
485
|
min-width: 200px;
|
|
481
486
|
justify-content: end;
|
|
482
487
|
}
|
|
483
|
-
`;var
|
|
488
|
+
`;var Le=require("@emotion/react"),Ct=require("@uniformdev/design-system"),ro=require("react-icons/cg"),T=require("@emotion/react/jsx-runtime");function Qr({selectedItem:e,onDeselect:t}){var i;let{categories:o,logoIcon:a}=Je(),[r]=e.categories||[{id:"",name:""}],n=typeof r=="undefined"||!o||(i=o.find(m=>m.id===r.id))==null?void 0:i.name;return(0,T.jsx)("div",{css:[$r],children:(0,T.jsxs)("article",{css:[Fr],children:[(0,T.jsxs)("div",{css:[Nr],children:[e.thumbnailUrl?(0,T.jsx)("img",{src:e.thumbnailUrl,alt:n,css:[xt],loading:"lazy"}):(0,T.jsx)("div",{css:[xt]}),(0,T.jsxs)("div",{css:Le.css`
|
|
484
489
|
> :not(:last-child) {
|
|
485
490
|
margin-bottom: var(--spacing-xs);
|
|
486
491
|
}
|
|
487
|
-
`,children:[(0,
|
|
492
|
+
`,children:[(0,T.jsxs)("h4",{css:Le.css`
|
|
488
493
|
margin-top: 0px;
|
|
489
494
|
font-weight: var(--fw-bold);
|
|
490
|
-
`,children:[e.title||e.id||"",
|
|
495
|
+
`,children:[e.title||e.id||"",n&&(0,T.jsx)("span",{css:Le.css`
|
|
491
496
|
display: block;
|
|
492
497
|
font-weight: var(--fw-regular);
|
|
493
|
-
`,children:
|
|
498
|
+
`,children:n})]}),(0,T.jsxs)("ul",{css:Le.css`
|
|
494
499
|
font-size: var(--fs-sm);
|
|
495
500
|
|
|
496
|
-
${(0,
|
|
501
|
+
${(0,Ct.mq)("sm")} {
|
|
497
502
|
display: flex;
|
|
498
503
|
gap: var(--spacing-base);
|
|
499
504
|
}
|
|
500
|
-
`,children:[(0,
|
|
505
|
+
`,children:[(0,T.jsxs)("li",{children:[(0,T.jsx)("span",{css:Le.css`
|
|
501
506
|
margin-right: var(--spacing-xs);
|
|
502
|
-
`,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?(0,
|
|
507
|
+
`,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?(0,T.jsxs)("li",{children:[(0,T.jsx)("span",{css:Le.css`
|
|
503
508
|
margin-right: var(--spacing-xs);
|
|
504
|
-
`,children:"Price:"}),(0,
|
|
509
|
+
`,children:"Price:"}),(0,T.jsx)("span",{children:e.price})]}):null]})]})]}),(0,T.jsxs)("div",{css:Kr,children:[e.editLink?(0,T.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:wt,children:[(0,T.jsx)("span",{css:St,children:"Edit"}),(0,T.jsx)(ae,{src:a,alt:"Logo",css:Wr})]}):null,(0,T.jsxs)("button",{type:"button",onClick:()=>{t==null||t(e)},css:wt,children:[(0,T.jsx)("span",{css:St,children:"Unlink"}),(0,T.jsx)(Ct.Icon,{icon:ro.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}var ao=require("@uniformdev/design-system"),Rt=require("react-use"),Ge=require("@emotion/react/jsx-runtime");function gn({selectedProducts:e,setSelectedProducts:t,onGetCategories:o,onSearchProducts:a,logoIcon:r,multiSelect:n,multiSelectId:i,selectedItemComponent:m,rowComponent:d,errorComponent:v,helpComponent:s,noResultsComponent:f,onSort:c,typeSelectorAllTypesOptionText:x="All categories",typeSelectorLabel:U="Select Category"}){var Se,O;let{value:P,loading:L,error:Ue}=(0,Rt.useAsync)(async()=>await o(),[o]),Fe=P==null?void 0:P.map(q=>q.id).join(","),re=(0,xe.useMemo)(()=>P?P.map(y=>({id:y.id,name:y.name})):void 0,[Fe]),me=(0,xe.useRef)(),[ie,Ne]=(0,Rt.useAsyncFn)(async(q,y)=>{let K=await a({text:q,options:{limit:y==null?void 0:y.count,offset:y==null?void 0:y.offset,categoryId:y==null?void 0:y.contentType,cursor:y==null?void 0:y.cursor}});return(y==null?void 0:y.offset)===0&&(me.current=[]),(me.current=me.current||[]).push(...K.products),K},[a]),et=async q=>{await t(q)};return Ue||ie.error?(0,Ge.jsx)(v||(({categoriesError:y,searchError:K})=>(0,Ge.jsxs)(ao.Callout,{type:"error",children:["There was an error: ",(y==null?void 0:y.message)||(K==null?void 0:K.message)]})),{categoriesError:Ue,searchError:ie.error}):(0,Ge.jsx)(Yr.Provider,{value:{categories:P,logoIcon:r},children:(0,Ge.jsx)(Er,{search:Ne,results:me.current,logoIcon:r,selectedItems:e,select:et,multiSelectId:i||"product-search-multi-select",multiSelect:n,contentTypes:re,selectedItemComponent:m||Qr,rowComponent:d||Or,totalResults:(Se=ie.value)==null?void 0:Se.total,cursor:(O=ie.value)==null?void 0:O.cursor,resultsLoading:ie.loading||L,helpComponent:s,noResultsComponent:f,onSort:c,typeSelectorAllTypesOptionText:x,typeSelectorLabel:U})})}var Yr=xe.default.createContext(void 0),Je=()=>{let e=(0,xe.useContext)(Yr);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};var A=require("@emotion/react"),oo=require("@uniformdev/design-system"),Zr=A.css`
|
|
505
510
|
border: 1px solid var(--gray-200);
|
|
506
511
|
background: var(--gray-50);
|
|
507
512
|
border-radius: var(--rounded-base);
|
|
508
513
|
display: flex;
|
|
509
514
|
width: 100%;
|
|
510
|
-
`,
|
|
515
|
+
`,Xr=A.css`
|
|
511
516
|
align-items: center;
|
|
512
517
|
display: flex;
|
|
513
518
|
flex-grow: 1;
|
|
@@ -515,23 +520,23 @@
|
|
|
515
520
|
margin-inline: 0 var(--spacing-sm);
|
|
516
521
|
padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
|
|
517
522
|
position: relative;
|
|
518
|
-
`,
|
|
523
|
+
`,Jr=A.css`
|
|
519
524
|
flex-grow: 1;
|
|
520
|
-
`,
|
|
525
|
+
`,jr=A.css`
|
|
521
526
|
align-items: center;
|
|
522
527
|
display: flex;
|
|
523
528
|
position: relative;
|
|
524
|
-
`,
|
|
529
|
+
`,ea=A.css`
|
|
525
530
|
color: var(--brand-secondary-1);
|
|
526
531
|
font-size: var(--fs-base);
|
|
527
532
|
font-weight: var(--fw-bold);
|
|
528
533
|
line-height: 1;
|
|
529
534
|
margin: 0;
|
|
530
535
|
word-break: break-word;
|
|
531
|
-
`,
|
|
536
|
+
`,ta=A.css`
|
|
532
537
|
width: 1.5rem;
|
|
533
538
|
height: 1.5rem;
|
|
534
|
-
`,
|
|
539
|
+
`,ra=A.css`
|
|
535
540
|
background: var(--white);
|
|
536
541
|
border-radius: var(--rounded-base);
|
|
537
542
|
border-left: 4px solid var(--brand-secondary-3);
|
|
@@ -540,22 +545,22 @@
|
|
|
540
545
|
padding: var(--spacing-base);
|
|
541
546
|
z-index: var(--z-10);
|
|
542
547
|
width: max-content;
|
|
543
|
-
`,
|
|
548
|
+
`,_e=A.css`
|
|
544
549
|
font-size: var(--fs-sm);
|
|
545
|
-
`,
|
|
550
|
+
`,je=A.css`
|
|
546
551
|
font-weight: var(--fw-bold);
|
|
547
552
|
margin-right: var(--spacing-sm);
|
|
548
|
-
`,
|
|
553
|
+
`,aa=A.css`
|
|
549
554
|
display: flex;
|
|
550
555
|
flex-direction: column;
|
|
551
556
|
gap: var(--spacing-sm);
|
|
552
557
|
|
|
553
|
-
${(0,
|
|
558
|
+
${(0,oo.mq)("md")} {
|
|
554
559
|
flex-direction: row;
|
|
555
560
|
justify-content: end;
|
|
556
561
|
min-width: 200px;
|
|
557
562
|
}
|
|
558
|
-
`,
|
|
563
|
+
`,Pt=A.css`
|
|
559
564
|
align-items: center;
|
|
560
565
|
background: var(--white);
|
|
561
566
|
border-radius: var(--rounded-base);
|
|
@@ -570,30 +575,553 @@
|
|
|
570
575
|
&:hover {
|
|
571
576
|
background: var(--gray-50);
|
|
572
577
|
}
|
|
573
|
-
`,
|
|
578
|
+
`,oa=A.css`
|
|
574
579
|
display: flex;
|
|
575
580
|
margin-top: var(--spacing-sm);
|
|
576
581
|
gap: var(--spacing-sm);
|
|
577
|
-
`,
|
|
582
|
+
`,na=A.css`
|
|
578
583
|
background: none;
|
|
579
584
|
outline: none;
|
|
580
585
|
border: none;
|
|
581
586
|
margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
|
|
582
|
-
`,
|
|
587
|
+
`,Tt=A.css`
|
|
583
588
|
display: block;
|
|
584
589
|
max-width: 100%;
|
|
585
590
|
min-width: 100px;
|
|
586
591
|
height: auto;
|
|
587
|
-
`;var
|
|
592
|
+
`;var Ve=require("react");var kt=require("react-icons/cg"),no=require("timeago.js");var Ie=require("@emotion/react");var ia=require("@uniformdev/design-system"),b=require("@emotion/react/jsx-runtime");function mn({selectedItem:e,onDeselect:t,onEditClosed:o,logoIcon:a,itemDetailsRendererComponent:r}){let n=(0,Ve.useRef)(null),i=(0,Ve.useRef)(null),[m,d]=(0,Ve.useState)(!1);(0,Ve.useEffect)(()=>{let f=x=>{n.current&&!n.current.contains(x.target)&&i.current&&!i.current.contains(x.target)&&d(!1)},c=()=>{d(!1)};return window.addEventListener("resize",c,!0),document.addEventListener("scroll",f,!0),document.addEventListener("mousedown",f),()=>{window.removeEventListener("resize",c,!0),document.removeEventListener("scroll",f,!0),document.removeEventListener("mousedown",f)}},[i]);let v=()=>{var f;if(d(!m),i.current&&n.current){let c=(f=n==null?void 0:n.current)==null?void 0:f.getBoundingClientRect();i.current.style.top=`${c.top+30}px`}},s=r!=null?r:fn;return(0,b.jsx)("div",{css:[Zr,Ie.css`
|
|
588
593
|
margin: 0 0 1rem 0;
|
|
589
|
-
`],children:(0,
|
|
594
|
+
`],children:(0,b.jsxs)("div",{css:Xr,children:[(0,b.jsxs)("div",{css:Jr,children:[(0,b.jsxs)("div",{css:jr,children:[(0,b.jsx)("h4",{css:[ea],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{type:"button",ref:n,css:na,"aria-controls":"path-details","aria-expanded":m,onClick:v,children:(0,b.jsx)(ia.Icon,{icon:kt.CgInfo,iconColor:"gray",size:24,css:Ie.css`
|
|
590
595
|
opacity: var(--opacity-75);
|
|
591
|
-
`})}),(0,
|
|
596
|
+
`})}),(0,b.jsx)("div",{id:"path-details","aria-hidden":!m,ref:i,css:[ra,m?Ie.css`
|
|
592
597
|
visibility: visible;
|
|
593
|
-
`:
|
|
598
|
+
`:Ie.css`
|
|
594
599
|
visibility: hidden;
|
|
595
|
-
`],children:Object.entries(e.popoverData).map(([
|
|
600
|
+
`],children:Object.entries(e.popoverData).map(([f,c],x)=>(0,b.jsxs)("div",{css:_e,children:[(0,b.jsxs)("span",{css:je,children:[f,":"]}),c]},x))})]}):null]}),(0,b.jsx)(s,{item:e})]}),(0,b.jsxs)("div",{css:aa,children:[e.editLink?typeof e.editLink=="string"?(0,b.jsxs)("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:f=>{o&&(gt(f.currentTarget.href,()=>o(e)),f.preventDefault())},css:Pt,children:[(0,b.jsx)("span",{css:_e,children:"Edit"}),a?(0,b.jsx)(ae,{src:a,css:ta,alt:"Logo"}):null]}):e.editLink:null,(0,b.jsxs)("button",{type:"button",onClick:()=>{t(e)},css:Pt,children:[(0,b.jsx)("span",{css:_e,children:"Unlink"}),(0,b.jsx)(ia.Icon,{icon:kt.CgClose,iconColor:"red",size:16})]})]})]})},e.id)}function fn({item:e}){let t=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?t=(0,b.jsx)("img",{src:e.previewUrl,alt:e.id,width:"200",css:Tt}):e.type==="video"&&(t=(0,b.jsx)("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:Tt})):e.previewUrl&&typeof e.previewUrl!="string"&&(t=e.previewUrl),t||e.metadata?(0,b.jsxs)("div",{css:oa,children:[t?(0,b.jsx)("div",{children:t}):null,(0,b.jsxs)("ul",{children:[e.metadata?Object.entries(e.metadata).map(([o,a])=>(0,b.jsxs)("li",{css:[_e,Ie.css`
|
|
596
601
|
order: 1;
|
|
597
|
-
`],children:[(0,
|
|
602
|
+
`],children:[(0,b.jsxs)("span",{css:[je,Ie.css`
|
|
598
603
|
order: 1;
|
|
599
|
-
`],children:[o,":"]}),
|
|
604
|
+
`],children:[o,":"]}),a]},o)):null,e.createdDate?(0,b.jsxs)("li",{css:_e,children:[(0,b.jsx)("span",{css:je,children:"Date:"}),(0,no.format)(e.createdDate)]}):null]})]}):null}var Lt=require("@uniformdev/design-system");var we=require("@emotion/react/jsx-runtime"),vn=({children:e,loadingComponent:t,errorComponent:o})=>{let{initializing:a,error:r,sdk:n}=Ht();if(a||!n){let i=t;return i?(0,we.jsx)(i,{}):(0,we.jsx)(Lt.LoadingIndicator,{})}if(r){let i=o;if(i)return(0,we.jsx)(i,{error:r});throw r}return(0,we.jsxs)(Ke.Provider,{value:{sdk:n},children:[(0,we.jsx)(Lt.Theme,{}),(0,we.jsx)(Qe,{children:e})]})};function sa(e){return Object.entries(e||{}).sort(([t,o],[a,r])=>{var n,i;return o.order&&r.order?o.order-r.order:o.order?1:r.order?-1:((n=o.displayName)!=null?n:t).localeCompare((i=r.displayName)!=null?i:a)}).map(([t,o])=>({name:t,...o}))}var Oe=se(require("react"));var Ee=require("@uniformdev/design-system"),It=require("formik");var _t=require("@emotion/react"),io=_t.css`
|
|
605
|
+
> * {
|
|
606
|
+
margin: var(--spacing-base) 0 0;
|
|
607
|
+
}
|
|
608
|
+
`,so=_t.css`
|
|
609
|
+
display: flex;
|
|
610
|
+
gap: var(--spacing-sm);
|
|
611
|
+
`,lo=_t.css`
|
|
612
|
+
:root {
|
|
613
|
+
--tagify-dd-color-primary: rgb(53, 149, 246);
|
|
614
|
+
--tagify-dd-bg-color: var(--white);
|
|
615
|
+
--tagify-dd-item-pad: var(--spacing-xs) var(--spacing-sm);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.tagify {
|
|
619
|
+
--tags-disabled-bg: #f1f1f1;
|
|
620
|
+
--tags-border-color: var(--gray-400);
|
|
621
|
+
--tags-hover-border-color: var(--gray-300);
|
|
622
|
+
--tags-focus-border-color: var(--brand-secondary-1);
|
|
623
|
+
--tag-border-radius: var(--rounded-md);
|
|
624
|
+
--tag-bg: var(--gray-100);
|
|
625
|
+
--tag-hover: var(--gray-200);
|
|
626
|
+
--tag-text-color: var(--brand-secondary-1);
|
|
627
|
+
--tag-text-color--edit: var(--brand-secondary-1);
|
|
628
|
+
--tag-pad: var(--spacing-2xs) var(--spacing-sm);
|
|
629
|
+
--tag-inset-shadow-size: 1rem;
|
|
630
|
+
--tag-invalid-color: #d39494;
|
|
631
|
+
--tag-invalid-bg: rgba(211, 148, 148, 0.5);
|
|
632
|
+
--tag-remove-bg: rgba(211, 148, 148, 0.3);
|
|
633
|
+
--tag-remove-btn-color: black;
|
|
634
|
+
--tag-remove-btn-bg: none;
|
|
635
|
+
--tag-remove-btn-bg--hover: #c77777;
|
|
636
|
+
--input-color: inherit;
|
|
637
|
+
--tag--min-width: 1ch;
|
|
638
|
+
--tag--max-width: auto;
|
|
639
|
+
--tag-hide-transition: 0.3s;
|
|
640
|
+
--placeholder-color: rgba(0, 0, 0, 0.4);
|
|
641
|
+
--placeholder-color-focus: rgba(0, 0, 0, 0.25);
|
|
642
|
+
--loader-size: 0.8em;
|
|
643
|
+
--readonly-striped: 1;
|
|
644
|
+
|
|
645
|
+
background: var(--white);
|
|
646
|
+
display: inline-flex;
|
|
647
|
+
align-items: flex-start;
|
|
648
|
+
flex-wrap: wrap;
|
|
649
|
+
border-radius: var(--rounded-md);
|
|
650
|
+
outline: 1px solid var(--gray-400);
|
|
651
|
+
padding: 0;
|
|
652
|
+
line-height: 0;
|
|
653
|
+
cursor: text;
|
|
654
|
+
position: relative;
|
|
655
|
+
box-sizing: border-box;
|
|
656
|
+
transition: 0.1s;
|
|
657
|
+
}
|
|
658
|
+
.tagify:hover:not(.tagify--focus):not(.tagify--invalid) {
|
|
659
|
+
--tags-border-color: var(--tags-hover-border-color);
|
|
660
|
+
}
|
|
661
|
+
.tagify[disabled] {
|
|
662
|
+
background: var(--tags-disabled-bg);
|
|
663
|
+
filter: saturate(0);
|
|
664
|
+
opacity: 0.5;
|
|
665
|
+
pointer-events: none;
|
|
666
|
+
}
|
|
667
|
+
.tagify[disabled].tagify--select,
|
|
668
|
+
.tagify[readonly].tagify--select {
|
|
669
|
+
pointer-events: none;
|
|
670
|
+
}
|
|
671
|
+
.tagify[disabled]:not(.tagify--mix):not(.tagify--select),
|
|
672
|
+
.tagify[readonly]:not(.tagify--mix):not(.tagify--select) {
|
|
673
|
+
cursor: default;
|
|
674
|
+
}
|
|
675
|
+
.tagify[disabled]:not(.tagify--mix):not(.tagify--select) > .tagify__input,
|
|
676
|
+
.tagify[readonly]:not(.tagify--mix):not(.tagify--select) > .tagify__input {
|
|
677
|
+
visibility: hidden;
|
|
678
|
+
width: 0;
|
|
679
|
+
margin: 5px 0;
|
|
680
|
+
}
|
|
681
|
+
.tagify[disabled]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div,
|
|
682
|
+
.tagify[readonly]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div {
|
|
683
|
+
padding: var(--tag-pad);
|
|
684
|
+
}
|
|
685
|
+
.tagify[disabled]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div::before,
|
|
686
|
+
.tagify[readonly]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div::before {
|
|
687
|
+
animation: readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.tagify[disabled] .tagify__tag__removeBtn,
|
|
691
|
+
.tagify[readonly] .tagify__tag__removeBtn {
|
|
692
|
+
display: none;
|
|
693
|
+
}
|
|
694
|
+
.tagify--loading .tagify__input > br:last-child {
|
|
695
|
+
display: none;
|
|
696
|
+
}
|
|
697
|
+
.tagify--loading .tagify__input::before {
|
|
698
|
+
content: none;
|
|
699
|
+
}
|
|
700
|
+
.tagify--loading .tagify__input::after {
|
|
701
|
+
content: '';
|
|
702
|
+
vertical-align: middle;
|
|
703
|
+
opacity: 1;
|
|
704
|
+
width: 0.7em;
|
|
705
|
+
height: 0.7em;
|
|
706
|
+
width: var(--loader-size);
|
|
707
|
+
height: var(--loader-size);
|
|
708
|
+
min-width: 0;
|
|
709
|
+
border: 3px solid;
|
|
710
|
+
border-color: #eee #bbb #888 transparent;
|
|
711
|
+
border-radius: 50%;
|
|
712
|
+
animation: rotateLoader 0.4s infinite linear;
|
|
713
|
+
content: '' !important;
|
|
714
|
+
margin: -2px 0 -2px 0.5em;
|
|
715
|
+
}
|
|
716
|
+
.tagify--loading .tagify__input:empty::after {
|
|
717
|
+
margin-left: 0;
|
|
718
|
+
}
|
|
719
|
+
.tagify + input,
|
|
720
|
+
.tagify + textarea {
|
|
721
|
+
position: absolute !important;
|
|
722
|
+
left: -9999em !important;
|
|
723
|
+
transform: scale(0) !important;
|
|
724
|
+
}
|
|
725
|
+
.tagify__tag {
|
|
726
|
+
display: inline-flex;
|
|
727
|
+
align-items: center;
|
|
728
|
+
margin: 5px 0 5px 5px;
|
|
729
|
+
position: relative;
|
|
730
|
+
z-index: 1;
|
|
731
|
+
outline: 0;
|
|
732
|
+
line-height: normal;
|
|
733
|
+
cursor: default;
|
|
734
|
+
transition: 0.13s ease-out;
|
|
735
|
+
}
|
|
736
|
+
.tagify__tag > div {
|
|
737
|
+
vertical-align: top;
|
|
738
|
+
box-sizing: border-box;
|
|
739
|
+
max-width: 100%;
|
|
740
|
+
padding: var(--tag-pad);
|
|
741
|
+
color: var(--tag-text-color);
|
|
742
|
+
line-height: inherit;
|
|
743
|
+
border-radius: var(--tag-border-radius);
|
|
744
|
+
white-space: nowrap;
|
|
745
|
+
transition: 0.13s ease-out;
|
|
746
|
+
}
|
|
747
|
+
.tagify__tag > div > * {
|
|
748
|
+
white-space: pre-wrap;
|
|
749
|
+
overflow: hidden;
|
|
750
|
+
text-overflow: ellipsis;
|
|
751
|
+
display: inline-block;
|
|
752
|
+
vertical-align: top;
|
|
753
|
+
min-width: var(--tag--min-width);
|
|
754
|
+
max-width: var(--tag--max-width);
|
|
755
|
+
transition: 0.8s ease, 0.1s color;
|
|
756
|
+
}
|
|
757
|
+
.tagify__tag > div > [contenteditable] {
|
|
758
|
+
outline: 0;
|
|
759
|
+
-webkit-user-select: text;
|
|
760
|
+
user-select: text;
|
|
761
|
+
cursor: text;
|
|
762
|
+
margin: -2px;
|
|
763
|
+
padding: 2px;
|
|
764
|
+
max-width: 350px;
|
|
765
|
+
}
|
|
766
|
+
.tagify__tag > div::before {
|
|
767
|
+
content: '';
|
|
768
|
+
position: absolute;
|
|
769
|
+
border-radius: inherit;
|
|
770
|
+
inset: var(--tag-bg-inset, 0);
|
|
771
|
+
z-index: -1;
|
|
772
|
+
pointer-events: none;
|
|
773
|
+
transition: 120ms ease;
|
|
774
|
+
animation: tags--bump 0.3s ease-out 1;
|
|
775
|
+
box-shadow: 0 0 0 var(--tag-inset-shadow-size) var(--tag-bg) inset;
|
|
776
|
+
}
|
|
777
|
+
.tagify__tag:focus div::before,
|
|
778
|
+
.tagify__tag:hover:not([readonly]) div::before {
|
|
779
|
+
--tag-bg-inset: -2.5px;
|
|
780
|
+
--tag-bg: var(--tag-hover);
|
|
781
|
+
}
|
|
782
|
+
.tagify__tag--loading {
|
|
783
|
+
pointer-events: none;
|
|
784
|
+
}
|
|
785
|
+
.tagify__tag--loading .tagify__tag__removeBtn {
|
|
786
|
+
display: none;
|
|
787
|
+
}
|
|
788
|
+
.tagify__tag--loading::after {
|
|
789
|
+
--loader-size: 0.4em;
|
|
790
|
+
content: '';
|
|
791
|
+
vertical-align: middle;
|
|
792
|
+
opacity: 1;
|
|
793
|
+
width: 0.7em;
|
|
794
|
+
height: 0.7em;
|
|
795
|
+
width: var(--loader-size);
|
|
796
|
+
height: var(--loader-size);
|
|
797
|
+
min-width: 0;
|
|
798
|
+
border: 3px solid;
|
|
799
|
+
border-color: #eee #bbb #888 transparent;
|
|
800
|
+
border-radius: 50%;
|
|
801
|
+
animation: rotateLoader 0.4s infinite linear;
|
|
802
|
+
margin: 0 0.5em 0 -0.1em;
|
|
803
|
+
}
|
|
804
|
+
.tagify__tag--flash div::before {
|
|
805
|
+
animation: none;
|
|
806
|
+
}
|
|
807
|
+
.tagify__tag--hide {
|
|
808
|
+
width: 0 !important;
|
|
809
|
+
padding-left: 0;
|
|
810
|
+
padding-right: 0;
|
|
811
|
+
margin-left: 0;
|
|
812
|
+
margin-right: 0;
|
|
813
|
+
opacity: 0;
|
|
814
|
+
transform: scale(0);
|
|
815
|
+
transition: var(--tag-hide-transition);
|
|
816
|
+
pointer-events: none;
|
|
817
|
+
}
|
|
818
|
+
.tagify__tag--hide > div > * {
|
|
819
|
+
white-space: nowrap;
|
|
820
|
+
}
|
|
821
|
+
.tagify__tag.tagify--noAnim > div::before {
|
|
822
|
+
animation: none;
|
|
823
|
+
}
|
|
824
|
+
.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div > span {
|
|
825
|
+
opacity: 0.5;
|
|
826
|
+
}
|
|
827
|
+
.tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div::before {
|
|
828
|
+
--tag-bg: var(--tag-invalid-bg);
|
|
829
|
+
transition: 0.2s;
|
|
830
|
+
}
|
|
831
|
+
.tagify__tag[readonly] .tagify__tag__removeBtn {
|
|
832
|
+
display: none;
|
|
833
|
+
}
|
|
834
|
+
.tagify__tag[readonly] > div::before {
|
|
835
|
+
animation: readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.tagify__tag--editable > div {
|
|
839
|
+
color: var(--tag-text-color--edit);
|
|
840
|
+
}
|
|
841
|
+
.tagify__tag--editable > div::before {
|
|
842
|
+
box-shadow: 0 0 0 2px var(--tag-hover) inset !important;
|
|
843
|
+
}
|
|
844
|
+
.tagify__tag--editable > .tagify__tag__removeBtn {
|
|
845
|
+
pointer-events: none;
|
|
846
|
+
}
|
|
847
|
+
.tagify__tag--editable > .tagify__tag__removeBtn::after {
|
|
848
|
+
opacity: 0;
|
|
849
|
+
transform: translateX(100%) translateX(5px);
|
|
850
|
+
}
|
|
851
|
+
.tagify__tag--editable.tagify--invalid > div::before {
|
|
852
|
+
box-shadow: 0 0 0 2px var(--tag-invalid-color) inset !important;
|
|
853
|
+
}
|
|
854
|
+
.tagify__tag__removeBtn {
|
|
855
|
+
order: 5;
|
|
856
|
+
display: inline-flex;
|
|
857
|
+
align-items: center;
|
|
858
|
+
justify-content: center;
|
|
859
|
+
border-radius: 50px;
|
|
860
|
+
cursor: pointer;
|
|
861
|
+
font: 14px/1 Arial;
|
|
862
|
+
background: var(--tag-remove-btn-bg);
|
|
863
|
+
color: var(--tag-remove-btn-color);
|
|
864
|
+
width: 14px;
|
|
865
|
+
height: 14px;
|
|
866
|
+
margin-right: 4.6666666667px;
|
|
867
|
+
margin-left: auto;
|
|
868
|
+
overflow: hidden;
|
|
869
|
+
transition: 0.2s ease-out;
|
|
870
|
+
}
|
|
871
|
+
.tagify__tag__removeBtn::after {
|
|
872
|
+
content: '×';
|
|
873
|
+
transition: 0.3s, color 0s;
|
|
874
|
+
}
|
|
875
|
+
.tagify__tag__removeBtn:hover {
|
|
876
|
+
color: var(--white);
|
|
877
|
+
background: var(--tag-remove-btn-bg--hover);
|
|
878
|
+
}
|
|
879
|
+
.tagify__tag__removeBtn:hover + div > span {
|
|
880
|
+
opacity: 0.5;
|
|
881
|
+
}
|
|
882
|
+
.tagify__tag__removeBtn:hover + div::before {
|
|
883
|
+
box-shadow: 0 0 0 var(--tag-inset-shadow-size) var(--tag-remove-bg, rgba(211, 148, 148, 0.3)) inset !important;
|
|
884
|
+
transition: box-shadow 0.2s;
|
|
885
|
+
}
|
|
886
|
+
.tagify:not(.tagify--mix) .tagify__input br {
|
|
887
|
+
display: none;
|
|
888
|
+
}
|
|
889
|
+
.tagify:not(.tagify--mix) .tagify__input * {
|
|
890
|
+
display: inline;
|
|
891
|
+
white-space: nowrap;
|
|
892
|
+
}
|
|
893
|
+
.tagify__input {
|
|
894
|
+
border-radius: var(--rounded-md);
|
|
895
|
+
flex-grow: 1;
|
|
896
|
+
display: inline-block;
|
|
897
|
+
min-width: 110px;
|
|
898
|
+
margin: 5px;
|
|
899
|
+
padding: var(--spacing-base) var(--spacing-md) var(--spacing-base) var(--spacing-base);
|
|
900
|
+
line-height: normal;
|
|
901
|
+
position: relative;
|
|
902
|
+
white-space: pre-wrap;
|
|
903
|
+
color: var(--input-color);
|
|
904
|
+
box-sizing: inherit;
|
|
905
|
+
}
|
|
906
|
+
.tagify__input:empty::before {
|
|
907
|
+
position: static;
|
|
908
|
+
}
|
|
909
|
+
.tagify__input:focus {
|
|
910
|
+
outline: 0;
|
|
911
|
+
}
|
|
912
|
+
.tagify__input:focus::before {
|
|
913
|
+
transition: 0.2s ease-out;
|
|
914
|
+
opacity: 0;
|
|
915
|
+
transform: translatex(6px);
|
|
916
|
+
}
|
|
917
|
+
.tagify__input:focus:empty::before {
|
|
918
|
+
transition: 0.2s ease-out;
|
|
919
|
+
opacity: 1;
|
|
920
|
+
transform: none;
|
|
921
|
+
color: rgba(0, 0, 0, 0.25);
|
|
922
|
+
color: var(--placeholder-color-focus);
|
|
923
|
+
}
|
|
924
|
+
.tagify__input::before {
|
|
925
|
+
content: attr(data-placeholder);
|
|
926
|
+
height: 1em;
|
|
927
|
+
line-height: 1em;
|
|
928
|
+
margin: auto 0;
|
|
929
|
+
z-index: 1;
|
|
930
|
+
color: var(--placeholder-color);
|
|
931
|
+
white-space: nowrap;
|
|
932
|
+
pointer-events: none;
|
|
933
|
+
opacity: 0;
|
|
934
|
+
position: absolute;
|
|
935
|
+
}
|
|
936
|
+
.tagify__input::after {
|
|
937
|
+
content: attr(data-suggest);
|
|
938
|
+
display: inline-block;
|
|
939
|
+
vertical-align: middle;
|
|
940
|
+
position: absolute;
|
|
941
|
+
min-width: calc(100% - 1.5em);
|
|
942
|
+
text-overflow: ellipsis;
|
|
943
|
+
overflow: hidden;
|
|
944
|
+
white-space: pre;
|
|
945
|
+
color: var(--tag-text-color);
|
|
946
|
+
opacity: 0.3;
|
|
947
|
+
pointer-events: none;
|
|
948
|
+
max-width: 100px;
|
|
949
|
+
}
|
|
950
|
+
.tagify__input .tagify__tag {
|
|
951
|
+
margin: 0 1px;
|
|
952
|
+
}
|
|
953
|
+
.tagify--mix {
|
|
954
|
+
display: block;
|
|
955
|
+
}
|
|
956
|
+
.tagify--mix .tagify__input {
|
|
957
|
+
background-image: url("data:image/svg+xml,%3Csvg width='18' height='10' viewBox='0 0 18 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 6C13.5523 6 14 5.55228 14 5C14 4.44772 13.5523 4 13 4L5 4C4.44771 4 4 4.44772 4 5C4 5.55228 4.44772 6 5 6L13 6Z' fill='%23D1D5DB'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18 5C18 7.76142 15.7614 10 13 10L5 10C2.23858 10 0 7.76142 0 5C0 2.23858 2.23858 0 5 0L13 0C15.7614 0 18 2.23858 18 5ZM13 8L5 8C3.34315 8 2 6.65685 2 5C2 3.34315 3.34315 2 5 2L13 2C14.6569 2 16 3.34315 16 5C16 6.65685 14.6569 8 13 8Z' fill='%23D1D5DB'/%3E%3C/svg%3E%0A");
|
|
958
|
+
background-repeat: no-repeat;
|
|
959
|
+
background-position: right var(--spacing-sm) center;
|
|
960
|
+
padding: var(--spacing-base) var(--spacing-xl) var(--spacing-base) var(--spacing-base);
|
|
961
|
+
margin: 0;
|
|
962
|
+
width: 100%;
|
|
963
|
+
height: 100%;
|
|
964
|
+
display: block;
|
|
965
|
+
min-height: 54px;
|
|
966
|
+
}
|
|
967
|
+
.tagify--mix .tagify__input::before {
|
|
968
|
+
height: auto;
|
|
969
|
+
display: none;
|
|
970
|
+
line-height: inherit;
|
|
971
|
+
}
|
|
972
|
+
.tagify--mix .tagify__input::after {
|
|
973
|
+
content: none;
|
|
974
|
+
}
|
|
975
|
+
.tagify--select::after {
|
|
976
|
+
content: '>';
|
|
977
|
+
opacity: 0.5;
|
|
978
|
+
position: absolute;
|
|
979
|
+
top: 50%;
|
|
980
|
+
right: 0;
|
|
981
|
+
bottom: 0;
|
|
982
|
+
font: 16px monospace;
|
|
983
|
+
line-height: 8px;
|
|
984
|
+
height: 8px;
|
|
985
|
+
pointer-events: none;
|
|
986
|
+
transform: translate(-150%, -50%) scaleX(1.2) rotate(90deg);
|
|
987
|
+
transition: 0.2s ease-in-out;
|
|
988
|
+
}
|
|
989
|
+
.tagify--select[aria-expanded='true']::after {
|
|
990
|
+
transform: translate(-150%, -50%) rotate(270deg) scaleY(1.2);
|
|
991
|
+
}
|
|
992
|
+
.tagify--select .tagify__tag {
|
|
993
|
+
position: absolute;
|
|
994
|
+
top: 0;
|
|
995
|
+
right: 1.8em;
|
|
996
|
+
bottom: 0;
|
|
997
|
+
}
|
|
998
|
+
.tagify--select .tagify__tag div {
|
|
999
|
+
display: none;
|
|
1000
|
+
}
|
|
1001
|
+
.tagify--select .tagify__input {
|
|
1002
|
+
width: 100%;
|
|
1003
|
+
}
|
|
1004
|
+
.tagify--empty .tagify__input::before {
|
|
1005
|
+
transition: 0.2s ease-out;
|
|
1006
|
+
opacity: 1;
|
|
1007
|
+
transform: none;
|
|
1008
|
+
display: inline-block;
|
|
1009
|
+
width: auto;
|
|
1010
|
+
}
|
|
1011
|
+
.tagify--mix .tagify--empty .tagify__input::before {
|
|
1012
|
+
display: inline-block;
|
|
1013
|
+
}
|
|
1014
|
+
.tagify--focus {
|
|
1015
|
+
--tags-border-color: var(--tags-focus-border-color);
|
|
1016
|
+
transition: 0s;
|
|
1017
|
+
}
|
|
1018
|
+
.tagify--invalid {
|
|
1019
|
+
--tags-border-color: #d39494;
|
|
1020
|
+
}
|
|
1021
|
+
.tagify__dropdown {
|
|
1022
|
+
position: absolute;
|
|
1023
|
+
z-index: 9999;
|
|
1024
|
+
transform: translateY(1px);
|
|
1025
|
+
overflow: hidden;
|
|
1026
|
+
}
|
|
1027
|
+
.tagify__dropdown[placement='top'] {
|
|
1028
|
+
margin-top: 0;
|
|
1029
|
+
transform: translateY(-100%);
|
|
1030
|
+
}
|
|
1031
|
+
.tagify__dropdown[placement='top'] .tagify__dropdown__wrapper {
|
|
1032
|
+
border-top-width: 1.1px;
|
|
1033
|
+
border-bottom-width: 0;
|
|
1034
|
+
}
|
|
1035
|
+
.tagify__dropdown[position='text'] {
|
|
1036
|
+
box-shadow: 0 0 0 3px rgba(var(--tagify-dd-color-primary), 0.1);
|
|
1037
|
+
font-size: 0.9em;
|
|
1038
|
+
}
|
|
1039
|
+
.tagify__dropdown[position='text'] .tagify__dropdown__wrapper {
|
|
1040
|
+
border-width: 1px;
|
|
1041
|
+
}
|
|
1042
|
+
.tagify__dropdown__wrapper {
|
|
1043
|
+
max-height: 300px;
|
|
1044
|
+
overflow: auto;
|
|
1045
|
+
overflow-x: hidden;
|
|
1046
|
+
background: var(--tagify-dd-bg-color);
|
|
1047
|
+
border: 1px solid;
|
|
1048
|
+
border-color: var(--tagify-dd-color-primary);
|
|
1049
|
+
border-bottom-width: 1.5px;
|
|
1050
|
+
border-top-width: 0;
|
|
1051
|
+
box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.2);
|
|
1052
|
+
transition: 0.25s cubic-bezier(0, 1, 0.5, 1);
|
|
1053
|
+
}
|
|
1054
|
+
.tagify__dropdown__header:empty {
|
|
1055
|
+
display: none;
|
|
1056
|
+
}
|
|
1057
|
+
.tagify__dropdown__footer {
|
|
1058
|
+
display: inline-block;
|
|
1059
|
+
margin-top: 0.5em;
|
|
1060
|
+
padding: var(--tagify-dd-item-pad);
|
|
1061
|
+
font-size: 0.7em;
|
|
1062
|
+
font-style: italic;
|
|
1063
|
+
opacity: 0.5;
|
|
1064
|
+
}
|
|
1065
|
+
.tagify__dropdown__footer:empty {
|
|
1066
|
+
display: none;
|
|
1067
|
+
}
|
|
1068
|
+
.tagify__dropdown--initial .tagify__dropdown__wrapper {
|
|
1069
|
+
max-height: 20px;
|
|
1070
|
+
transform: translateY(-1em);
|
|
1071
|
+
}
|
|
1072
|
+
.tagify__dropdown--initial[placement='top'] .tagify__dropdown__wrapper {
|
|
1073
|
+
transform: translateY(2em);
|
|
1074
|
+
}
|
|
1075
|
+
.tagify__dropdown__item {
|
|
1076
|
+
box-sizing: border-box;
|
|
1077
|
+
padding: var(--tagify-dd-item-pad);
|
|
1078
|
+
margin: 1px;
|
|
1079
|
+
cursor: pointer;
|
|
1080
|
+
border-radius: 2px;
|
|
1081
|
+
position: relative;
|
|
1082
|
+
outline: 0;
|
|
1083
|
+
max-height: 60px;
|
|
1084
|
+
max-width: 100%;
|
|
1085
|
+
}
|
|
1086
|
+
.tagify__dropdown__item--active {
|
|
1087
|
+
background: var(--tagify-dd-color-primary);
|
|
1088
|
+
color: #fff;
|
|
1089
|
+
}
|
|
1090
|
+
.tagify__dropdown__item:active {
|
|
1091
|
+
filter: brightness(105%);
|
|
1092
|
+
}
|
|
1093
|
+
.tagify__dropdown__item--hidden {
|
|
1094
|
+
padding-top: 0;
|
|
1095
|
+
padding-bottom: 0;
|
|
1096
|
+
margin: 0 1px;
|
|
1097
|
+
pointer-events: none;
|
|
1098
|
+
overflow: hidden;
|
|
1099
|
+
max-height: 0;
|
|
1100
|
+
transition: var(--tagify-dd-item--hidden-duration, 0.3s) !important;
|
|
1101
|
+
}
|
|
1102
|
+
.tagify__dropdown__item--hidden > * {
|
|
1103
|
+
transform: translateY(-100%);
|
|
1104
|
+
opacity: 0;
|
|
1105
|
+
transition: inherit;
|
|
1106
|
+
}
|
|
1107
|
+
`;var ne=require("@emotion/react/jsx-runtime");function la({variable:e,onSubmit:t,onCancel:o}){var r,n,i,m,d,v,s,f,c;let{variables:a}=De();return(0,ne.jsx)(It.Formik,{initialValues:{name:e,default:(n=(r=a[e])==null?void 0:r.default)!=null?n:"",displayName:(m=(i=a[e])==null?void 0:i.displayName)!=null?m:"",helpText:(v=(d=a[e])==null?void 0:d.helpText)!=null?v:"",order:(s=a[e])==null?void 0:s.order,type:(c=(f=a[e])==null?void 0:f.type)!=null?c:""},onSubmit:x=>{let U={...x,helpText:x.helpText||void 0,type:x.type||void 0,displayName:x.displayName||void 0};return t(U)},children:({getFieldProps:x})=>(0,ne.jsxs)(It.Form,{css:io,children:[(0,ne.jsx)(Ee.Input,{...x("name"),label:"Name"}),(0,ne.jsx)(Ee.Input,{...x("helpText"),label:"Help Text",caption:"Appears in the composition data resource when entering a value for this variable.",autoComplete:"off"}),(0,ne.jsx)(Ee.Input,{...x("default"),label:"Default Value",autoComplete:"off"}),(0,ne.jsxs)("div",{css:so,children:[(0,ne.jsx)(Ee.Button,{type:"submit",children:"Save"}),(0,ne.jsx)(Ee.Button,{type:"button",buttonType:"ghost",onClick:o,children:"cancel"})]})]})})}var Vt=require("@emotion/react/jsx-runtime"),po=Oe.createContext(null);function hn({value:e,onChange:t,editVariableComponent:o,children:a}){let[r,n]=Oe.useState(),i=o!=null?o:la,m={dispatch:d=>{if(d.type==="set"){let{name:v,...s}=d.variable;t({...m.variables,[d.variable.name]:s}),d.openEditor&&n(d.variable.name)}else if(d.type==="edit")n(d.variable);else if(d.type==="remove"){let v={...e};delete v[d.variable],t(v)}else throw new Error(`Unknown event ${JSON.stringify(d)}`)},variables:e};return(0,Vt.jsxs)(po.Provider,{value:m,children:[a,typeof r!="undefined"?(0,Vt.jsx)(i,{onSubmit:d=>{n(void 0);let{name:v,...s}=d;t({...e,[v]:s})},onCancel:()=>n(void 0),variable:r}):null]})}function De(){let e=Oe.useContext(po);if(!e)throw new Error("No VariablesProvider present");return e}var k=require("@uniformdev/design-system");var da=require("@emotion/react"),V=require("@emotion/react/jsx-runtime");function yn(){let{variables:e,dispatch:t}=De(),o=sa(e);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(k.Table,{children:[(0,V.jsx)(k.TableHead,{children:(0,V.jsxs)(k.TableRow,{children:[(0,V.jsx)(k.TableCellHead,{children:"Name"}),(0,V.jsx)(k.TableCellHead,{children:"Default Value"}),(0,V.jsx)(k.TableCellHead,{})]})}),(0,V.jsx)(k.TableBody,{children:o.map(({name:a,displayName:r,default:n})=>{let i=r!=null?r:a;return(0,V.jsxs)(k.TableRow,{id:i,children:[(0,V.jsx)(k.TableCellData,{children:(0,V.jsx)("button",{css:da.css`
|
|
1108
|
+
border: none;
|
|
1109
|
+
color: var(--brand-secondary-5);
|
|
1110
|
+
font-weight: var(--fw-medium);
|
|
1111
|
+
padding: 0;
|
|
1112
|
+
background: none;
|
|
1113
|
+
`,type:"button",onClick:m=>{m.preventDefault(),t({type:"edit",variable:a})},children:i})}),(0,V.jsx)(k.TableCellData,{children:n}),(0,V.jsx)(k.TableCellData,{align:"right",children:(0,V.jsx)("button",{type:"button",title:`delete ${i}`,css:[k.button,da.css`
|
|
1114
|
+
background: transparent;
|
|
1115
|
+
`],"aria-controls":i,onClick:()=>t({type:"remove",variable:a}),children:(0,V.jsx)(k.Icon,{icon:"trash",iconColor:"red"})})})]},a)})})]}),(0,V.jsx)(k.AddListButton,{onButtonClick:()=>t({type:"edit",variable:""}),"aria-label":"Add variable",buttonText:"add variable",icon:"math-plus",css:{marginLeft:"var(--spacing-md)"}})]})}var W=se(require("react")),go=se(require("@yaireo/tagify/dist/react.tagify"));var mo=require("@emotion/react"),Me=require("@emotion/react/jsx-runtime");function uo(e){return e.replace(/\${{.*?"value":"([^"]+)".*?}}/g,"${$1}").replace(/[\r\n]+/g,"")}function ca({label:e,value:t,disableVariables:o,onChange:a}){let{variables:r,dispatch:n}=De(),i=W.useRef(r),m=W.useRef(n),d=W.useRef(a),v=W.useRef();W.useEffect(()=>{i.current=r},[r]),W.useEffect(()=>{m.current=n},[n]),W.useEffect(()=>{d.current=a},[a]),W.useEffect(()=>{var x,U,P;let c=uo((U=(x=v.current)==null?void 0:x.getInputValue())!=null?U:"");t!==c&&((P=v.current)==null||P.loadOriginalValues(t))},[t]);let s=W.useCallback(c=>{d.current(uo(c))},[]),f=W.useCallback(c=>{i.current[c]||m.current({type:"set",variable:{name:c,default:""},openEditor:!0})},[]);return(0,Me.jsxs)(Me.Fragment,{children:[(0,Me.jsx)(mo.Global,{styles:lo}),(0,Me.jsx)(go.default,{tagifyRef:v,"aria-label":e,defaultValue:t,autoFocus:!1,whitelist:Object.entries(r).map(([c,x])=>{var U;return{name:(U=x.displayName)!=null?U:c,value:c}}),settings:{pattern:o?null:/\$/,enforceWhitelist:o,mixTagsInterpolator:["${","}"],duplicates:!0,tagTextProp:"name",dropdown:{position:"text",enabled:0,mapValueTo:c=>c.name,includeSelectedTags:!0,searchKeys:["name","value"],highlightFirst:!0}},InputMode:"textarea",onAdd:c=>{var U;let x=(U=c.detail.data)==null?void 0:U.value;x&&f(x)},onRemove:c=>{s(c.detail.tagify.getInputValue())},onChange:c=>{s(c.detail.value)},onInput:c=>{s(c.detail.tagify.getInputValue())}})]})}var xo=se(require("@monaco-editor/react")),wo=require("@uniformdev/design-system"),So=require("react");var qe=se(require("react")),ho=require("@emotion/react/jsx-runtime"),vo=qe.createContext(null);function bn({value:e,onChange:t,children:o}){let a=qe.useMemo(()=>({dispatch:r=>{if(r.type==="setRelativeUrl")t({...e,relativeUrl:r.relativeUrl,parameters:ge(r.relativeUrl)});else if(r.type==="updateParameter"){let n=fo(e.relativeUrl,i=>{let m=`${r.parameter.key}=${r.parameter.value}`;typeof r.index!="undefined"?i[r.index]=m:i.push(m)});t({...e,relativeUrl:n,parameters:ge(n)})}else if(r.type==="removeParameter"){let n=fo(e.relativeUrl,i=>{i.splice(r.index,1)});t({...e,relativeUrl:n,parameters:ge(n)})}else if(r.type==="updateHeader"){let n=[...e.headers];typeof r.index!="undefined"?n[r.index]=r.header:n.push(r.header),t({...e,headers:n,parameters:ge(e.relativeUrl)})}else if(r.type==="removeHeader"){let n=[...e.headers];n.splice(r.index,1),t({...e,headers:n,parameters:ge(e.relativeUrl)})}else if(r.type==="setMethod")t({...e,method:r.method,parameters:ge(e.relativeUrl)});else if(r.type==="setBody")t({...e,body:r.body,parameters:ge(e.relativeUrl)});else throw new Error(`Unknown event ${JSON.stringify(r)}`)},request:{...e,parameters:ge(e.relativeUrl)}}),[t,e]);return(0,ho.jsx)(vo.Provider,{value:a,children:o})}function te(){let e=qe.useContext(vo);if(!e)throw new Error("No RequestProvider present");return e}function fo(e,t){let[o,a]=e.split("?"),r=o,n=(a!=null?a:"").split("&");return t(n),r+=`?${n.join("&")}`,r}function ge(e){var t,o;return((o=(t=e.split("?")[1])==null?void 0:t.split("&").map(a=>{let[r,n]=a.split("=");return{key:r,value:n!=null?n:""}}))!=null?o:[]).filter(a=>a.key)}function xn(e){let[t]=e.split("?");return[t,ge(e)]}var pa=require("@emotion/react"),Et=pa.css`
|
|
1116
|
+
background: var(--white);
|
|
1117
|
+
`,yo=e=>pa.css`
|
|
1118
|
+
align-items: end;
|
|
1119
|
+
background: ${e};
|
|
1120
|
+
display: grid;
|
|
1121
|
+
grid-template-columns: 12ch 1fr;
|
|
1122
|
+
gap: var(--spacing-sm);
|
|
1123
|
+
`;var bo=require("@emotion/react/jsx-runtime"),ga=({bgColor:e="transparent",children:t,...o})=>(0,bo.jsx)("div",{css:yo(e),...o,children:t});var ma=require("@emotion/react"),$e=require("@emotion/react/jsx-runtime");function wn(){let{request:e,dispatch:t}=te(),[o,a]=(0,So.useState)("json");return(0,$e.jsxs)("div",{css:ma.css`
|
|
1124
|
+
background: var(--white);
|
|
1125
|
+
`,children:[(0,$e.jsx)(ga,{bgColor:"var(--gray-100)",css:ma.css`
|
|
1126
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
1127
|
+
`,children:(0,$e.jsx)(wo.InputSelect,{label:"Language",showLabel:!1,options:[{label:"Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"},{label:"JavaScript",value:"javascript"},{label:"XML",value:"xml"},{label:"HTML",value:"html"}],value:o,onChange:r=>{a(r.currentTarget.value)}})}),(0,$e.jsx)(xo.default,{height:200,value:e.body,language:o,options:{language:o,minimap:{enabled:!1},folding:!1},onChange:r=>{!r||t({type:"setBody",body:r})}})]})}var D=require("@uniformdev/design-system");var H=require("@emotion/react/jsx-runtime");function Sn({disableVariables:e}){let{dispatch:t,request:o}=te(),a=[...o.headers,{key:"",value:""}];return(0,H.jsx)("div",{css:Et,children:(0,H.jsxs)(D.Table,{children:[(0,H.jsx)(D.TableHead,{children:(0,H.jsxs)(D.TableRow,{children:[(0,H.jsx)(D.TableCellHead,{children:"Name"}),(0,H.jsx)(D.TableCellHead,{children:"Value"})]})}),(0,H.jsx)(D.TableBody,{children:a.map((r,n)=>(0,H.jsxs)(D.TableRow,{children:[(0,H.jsx)(D.TableCellData,{width:"50%",children:(0,H.jsx)(D.Input,{label:r.key,value:r.key,showLabel:!1,onChange:i=>{i.currentTarget.value?t({type:"updateHeader",header:{key:i.currentTarget.value,value:r.value},index:n}):t({type:"removeHeader",index:n})}})}),(0,H.jsx)(D.TableCellData,{width:"50%",children:r.key?(0,H.jsx)(D.Input,{showLabel:!1,label:r.value,value:r.value,onChange:i=>t({type:"updateHeader",header:{key:r.key,value:i.currentTarget.value},index:n})}):null})]},n))})]})})}var Co=require("@uniformdev/design-system");var Ro=require("@emotion/react/jsx-runtime");function Cn(e){var a;let{request:t,dispatch:o}=te();return(0,Ro.jsx)(Co.InputSelect,{...e,options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"HEAD",value:"HEAD"}],value:(a=t.method)!=null?a:"GET",onChange:r=>o({type:"setMethod",method:r.currentTarget.value})})}var M=require("@uniformdev/design-system");var G=require("@emotion/react/jsx-runtime");function Rn({disableVariables:e}){let{dispatch:t,request:o}=te(),a=[...o.parameters,{key:"",value:""}];return(0,G.jsx)("div",{css:Et,children:(0,G.jsxs)(M.Table,{children:[(0,G.jsx)(M.TableHead,{children:(0,G.jsxs)(M.TableRow,{children:[(0,G.jsx)(M.TableCellHead,{children:"Name"}),(0,G.jsx)(M.TableCellHead,{children:"Value"})]})}),(0,G.jsx)(M.TableBody,{children:a.map((r,n)=>(0,G.jsxs)(M.TableRow,{children:[(0,G.jsx)(M.TableCellData,{width:"50%",children:(0,G.jsx)(M.Input,{label:r.key,value:r.key,showLabel:!1,onChange:i=>{i.currentTarget.value?t({type:"updateParameter",parameter:{key:i.currentTarget.value,value:r.value},index:n}):t({type:"removeParameter",index:n})}})}),(0,G.jsx)(M.TableCellData,{width:"50%",children:r.key?(0,G.jsx)(M.Input,{showLabel:!1,label:r.value,value:r.value,onChange:i=>t({type:"updateParameter",parameter:{key:r.key,value:i.currentTarget.value},index:n})}):null})]},n))})]})})}var Po=require("@emotion/react/jsx-runtime");function Pn(e){let{request:t,dispatch:o}=te();return(0,Po.jsx)(ca,{...e,value:t.relativeUrl,onChange:a=>{let r=a;t.baseUrl&&r.startsWith(t.baseUrl)&&(r=r.substring(t.baseUrl.length)),o({type:"setRelativeUrl",relativeUrl:r})}})}X(Y,require("@uniformdev/mesh-sdk"),module.exports);var h=require("@uniformdev/design-system");0&&(module.exports={AddListButton,Button,Callout,DamSelectedItem,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,InputVariables,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,MeshApp,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,RequestBody,RequestHeaders,RequestMethodSelect,RequestParameters,RequestProvider,RequestTypeContainer,RequestUrlInput,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,VariableEditor,VariablesList,VariablesProvider,badgeIcon,damSelectItemImage,damSelectedItemContainer,damSelectedItemCopy,damSelectedItemDetails,damSelectedItemIcon,damSelectedItemInfoBtn,damSelectedItemInner,damSelectedItemLinkBtn,damSelectedItemLinkContainer,damSelectedItemMediaContainer,damSelectedItemPopover,damSelectedItemPopoverLabel,damSelectedItemSmallText,damSelectedItemTitle,decomposeRelativeUrl,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemIcon,productSelectedItemImage,productSelectedItemLinkContainer,productedSelectedItemLinkBtn,productedSelectedItemSmallText,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useMeshLocation,useProductQueryContext,useProductSearchContext,useRequest,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext,useVariables,variablesToList});
|