@uniformdev/context-ui 16.1.0 → 16.1.1-alpha.139
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 +2 -2
- package/dist/index.esm.js +11 -11
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare function useContextConfig(): ContextConfig;
|
|
|
86
86
|
declare function useManifest(): ManifestGetResponse;
|
|
87
87
|
declare function useDimensionsDataContext(): DimensionsData;
|
|
88
88
|
|
|
89
|
-
declare const validateContextConfig: (contextConfig?: ContextConfig
|
|
89
|
+
declare const validateContextConfig: (contextConfig?: ContextConfig) => Promise<{
|
|
90
90
|
valid: boolean;
|
|
91
91
|
error?: Error;
|
|
92
92
|
result?: ManifestGetResponse;
|
|
@@ -97,7 +97,7 @@ interface UseValidateContextConfigResult {
|
|
|
97
97
|
error?: Error;
|
|
98
98
|
result?: ManifestGetResponse;
|
|
99
99
|
}
|
|
100
|
-
declare const useValidateContextConfig: (contextConfig?: ContextConfig
|
|
100
|
+
declare const useValidateContextConfig: (contextConfig?: ContextConfig) => UseValidateContextConfigResult;
|
|
101
101
|
|
|
102
102
|
declare function isEnrichmentTagData(obj: any): obj is EnrichmentData[];
|
|
103
103
|
declare function isPersonalizationCriteriaData(obj: any): obj is VariantMatchCriteria;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e}from"@emotion/react";import*as
|
|
1
|
+
import{jsx as e}from"@emotion/react";import*as h from"react";import{Icon as re}from"@uniformdev/design-system";import{CgChevronRight as oe}from"react-icons/cg";import{css as te}from"@emotion/react";var z=te`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
font-weight: var(--fw-bold);
|
|
@@ -9,7 +9,7 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
9
9
|
&:focus {
|
|
10
10
|
text-decoration-line: underline;
|
|
11
11
|
}
|
|
12
|
-
`;var
|
|
12
|
+
`;var U=({linkTo:t,name:n,linkText:r=`Edit ${n} Component`})=>e("a",{css:z,title:`Edit ${n} component definition`,rel:"noopener noreferrer",target:"_blank",href:t},r,e(re,{icon:oe,iconColor:"currentColor",size:"1.5rem"}));import W,{useMemo as B,useState as T}from"react";import{useEffect as ie,useState as ae}from"react";import{DimensionClient as se,computeDimensionDisplayName as le,ApiClientError as ce}from"@uniformdev/context/api";function A(t,n,r){return t.reduce((s,a)=>{let o=n(a);if(typeof o=="undefined"||o===null)throw new Error("Objectify key selector returned undefined or null.");return s[n(a)]=r?r(a):a,s},{})}function k({apiHost:t,apiKey:n,projectId:r}){let[s,a]=ae({loading:!1,notConfigured:!1,error:null,result:null});return ie(()=>{if(!r||!n||!t){a({notConfigured:!0,loading:!1,error:null,result:null});return}(async()=>{a({notConfigured:!1,loading:!0,error:null,result:null});try{let i=(await new se({projectId:r,apiKey:n,apiHost:t}).get()).dimensions.map(c=>({...c,displayName:le(c)})),d={dimensions:i,dimIndex:A(i,c=>c.dim,c=>c)};a({notConfigured:!1,loading:!1,error:null,result:d})}catch(l){let i;l instanceof ce?i=l.message:i=l.toString(),a({notConfigured:!1,loading:!1,error:i,result:null});return}})()},[t,n,r]),{result:s.result,error:s.error,loading:s.loading,notConfigured:s.notConfigured}}import{getEnrichmentVectorKey as S}from"@uniformdev/context";import{Input as G,Button as ue,InputSelect as de,Callout as N,Icon as x,LoadingIndicator as me}from"@uniformdev/design-system";import{CgMathPlus as H,CgMathMinus as pe,CgCloseO as fe}from"react-icons/cg";import O from"immer";import{css as P}from"@emotion/react";var ge=P`
|
|
13
13
|
flex: 2;
|
|
14
14
|
display: flex;
|
|
15
15
|
width: 50%;
|
|
@@ -20,7 +20,7 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
20
20
|
&:focus {
|
|
21
21
|
text-decoration-line: underline;
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,st=({value:t,setValue:n,contextConfig:r,displayTitle:s=!0})=>{let{loading:a,result:o,error:l}=k(r),i=B(()=>{if(o)return o.dimensions.filter(f=>f.category==="ENR")},[o]),d=B(()=>{if(!t)return i;if(i)return i.filter(f=>!t.some(v=>S(v.cat,v.key)===f.dim))},[i,t]),[c,D]=T(""),[u,g]=T(50),[b,m]=T(!1),p=i==null?void 0:i.find(f=>f.dim===c),y=()=>{let[f,v]=c.split("_");w([...t!=null?t:[],{cat:f,key:v,str:u}]),D(""),g(50),m(!1)},w=f=>{let v=[];o?v=f.filter(E=>{let ee=o.dimIndex[S(E.cat,E.key)];return Boolean(ee)}):v=f;let C=v.length===0?null:v;n(C)};return l?e(N,{type:"danger"},l):a||o===null?e(me,null):e("fieldset",{className:"enrichment-tag"},s?e("div",{css:{display:"flex",justifyContent:"space-between",marginBottom:"var(--spacing-base)"}},e("legend",{css:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-bold)"}},"Enrichment Tags")):null,i!=null&&i.length?!b&&!t?e(N,{title:"No enrichment tags assigned.",type:"info",css:{marginBlock:"var(--spacing-base)"}},e("p",null,"Click"," ",e("a",{onClick:()=>m(!0),target:"_blank",rel:"noopener noreferrer",css:{textDecorationLine:"underline"}},"here")," ","to assign your first enrichment tag.")):e(W.Fragment,null,o&&e(be,{list:t!=null?t:[],setList:w,dimIndex:o.dimIndex}),b&&d&&d.length>0?e("div",{className:"add-enrichment-tag",css:{display:"flex",flexWrap:"wrap",gap:"var(--spacing-lg)",marginTop:"var(--spacing-md)",alignItems:"center"}},e("div",{css:{flexGrow:1}},e(de,{name:"enrichment-type",label:"Enrichment Tag",showLabel:!0,value:c,options:[{label:"Select",value:""},...d.map(f=>({label:f.displayName,value:f.dim}))],onChange:f=>D(f.currentTarget.value)})),e(he,{score:u,setValue:g,cap:p?p.cap:100,css:{flexBasis:"9rem"}}),e(ue,{buttonType:"tertiary",size:"xl",css:{marginBottom:"var(--spacing-xs)",height:"3.5rem",margin:0,alignSelf:"flex-end"},onClick:y,disabled:!c},"Add")):null,e("div",{className:"enrichment-cta",style:{paddingTop:"10px",display:"flex",justifyContent:"space-between"}},!b&&d&&d.length>0&&t?e("button",{type:"button",className:"add-more",onClick:()=>m(!0),css:{color:"var(--brand-secondary-3)",display:"flex",gap:"var(--spacing-sm)",fontWeight:"var(--fw-bold)",marginTop:"var(--spacing-md)",alignItems:"center",backgroundColor:"transparent",backgroundImage:"none",borderWidth:0,width:"50%",flex:2}},e("div",{css:{color:"white",backgroundColor:"var(--brand-secondary-3)",borderRadius:"var(--rounded-full)",padding:"var(--spacing-xs)"}},e(x,{icon:H,iconColor:"currentColor",size:"1.25rem"})),"Add More"):e("a",{css:ge,title:"none",href:"#"}),e(U,{name:"Enrichments",linkText:"Manage Enrichments",linkTo:`${r.apiHost}/projects/${encodeURIComponent(r.projectId)}/personalization/enrichments`}))):e(Ce,{contextConfig:r}))},Ce=({contextConfig:t})=>e(N,{title:"No enrichments found.",type:"caution",css:{marginBlock:"var(--spacing-base)"}},e("p",null,"Looks like you do not have any enrichment created in your connected Uniform project. Start by creating your first enrichment"," ",e("a",{href:`${t.apiHost}/projects/${encodeURIComponent(t.projectId)}/personalization/enrichments`,target:"_blank",rel:"noopener noreferrer",css:{":hover":{textDecorationLine:"underline"}}},"here"),".")),_=(t,n=100,r=0)=>Math.max(Math.min(t,n),r),q=P`
|
|
24
24
|
position: absolute;
|
|
25
25
|
bottom: 0.875rem;
|
|
26
26
|
left: var(--spacing-sm);
|
|
@@ -32,27 +32,27 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
32
32
|
background-color: var(--gray-100);
|
|
33
33
|
border: 1px solid var(--gray-300);
|
|
34
34
|
border-radius: var(--rounded-full);
|
|
35
|
-
`,
|
|
36
|
-
${
|
|
35
|
+
`,ve=P`
|
|
36
|
+
${q}
|
|
37
37
|
left: auto;
|
|
38
38
|
right: var(--spacing-sm);
|
|
39
|
-
`,
|
|
39
|
+
`,he=({score:t,setValue:n,cap:r=100,...s})=>{let a=o=>{let l=o==="increment"?t+10:t-10;l<0&&(l=0),l>r&&(l=r),n(l)};return e("div",{css:{position:"relative"},...s},e(G,{label:"Strength",id:"enrichment-score",type:"number",min:0,max:r,value:t,onChange:o=>n(_(Number(o.currentTarget.value)||0,r)),css:{textAlign:"center",boxSizing:"border-box"}}),e("button",{type:"button",title:"Reduce enrichment count",onClick:()=>a("decrement"),disabled:t===0,className:"scoreCounterButton",css:q},e(x,{icon:pe,iconColor:"gray",size:"1.5rem"})),e("button",{type:"button",title:"Increase enrichment count",onClick:()=>a("increment"),className:"scoreCounterButton",css:ve},e(x,{icon:H,iconColor:"gray",size:"1.5rem"})))},be=({list:t,setList:n,dimIndex:r})=>{let s=o=>{n(O(t,l=>{l.splice(o,1)}))},a=(o,l)=>{var d;let i=(d=r[`${t[o].cat}_${t[o].key}`])==null?void 0:d.cap;n(O(t,c=>{c[o].str=_(Number(l)||0,i)}))};return e(W.Fragment,null,t.map((o,l)=>{let i=r[S(o.cat,o.key)];if(!!i)return e("div",{css:{display:"flex",alignItems:"center",gap:"var(--spacing-base)",backgroundColor:"var(--brand-secondary-2)",boxShadow:"var(--shadow-base)",borderRadius:"var(--rounded-base)",paddingInline:"var(--spacing-base)",marginBlock:"var(--spacing-base)"},className:"selected-enrichments",key:`${o.cat}-${o.key}`},e("span",{css:{fontWeight:"var(--fw-bold)",color:i?void 0:"var(--brand-secondary-5)"}},i?i.displayName:`Enrichment '${o.cat}_${o.key}' is unknown`),e("div",{css:{marginLeft:"auto",display:"flex",alignItems:"center",border:"0 solid var(--gray-400)",borderLeftWidth:"1px",borderRightWidth:"1px",padding:"var(--spacing-sm) var(--spacing-base)",flexBasis:"9rem"}},e(G,{type:"text",min:0,max:i.cap||100,title:"score",value:o.str,css:{textAlign:"center",width:"100px"},onChange:d=>a(l,d.currentTarget.value)})),e("button",{type:"button",title:"Delete enrichment",onClick:()=>s(l),css:{border:0}},e(x,{icon:fe,iconColor:"red",size:"1.5rem"})))}))};import{useState as De}from"react";import{LoadingIndicator as we,Callout as L,InputSelect as Y,InputComboBox as Ee,InputInlineSelect as ke,Icon as J}from"@uniformdev/design-system";import Q from"immer";import{CgCloseO as xe,CgMathPlus as Re}from"react-icons/cg";import{css as F}from"@emotion/react";var V="6rem",K=F`
|
|
40
40
|
position: relative;
|
|
41
41
|
padding: var(--spacing-base);
|
|
42
42
|
border: 1px solid var(--gray-300);
|
|
43
43
|
box-shadow: var(--shadow-base);
|
|
44
44
|
background-color: white;
|
|
45
45
|
border-radius: var(--rounded-base);
|
|
46
|
-
margin-top: ${
|
|
46
|
+
margin-top: ${V};
|
|
47
47
|
display: flex;
|
|
48
48
|
&:before {
|
|
49
49
|
content: '';
|
|
50
50
|
display: block;
|
|
51
51
|
width: 1px;
|
|
52
|
-
height: ${
|
|
52
|
+
height: ${V};
|
|
53
53
|
background-color: var(--gray-300);
|
|
54
54
|
position: absolute;
|
|
55
|
-
top: -${
|
|
55
|
+
top: -${V};
|
|
56
56
|
left: var(--spacing-lg);
|
|
57
57
|
}
|
|
58
58
|
&:first-of-type {
|
|
@@ -61,9 +61,9 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
61
61
|
display: none;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,X=F`
|
|
65
65
|
display: grid;
|
|
66
66
|
gap: var(--spacing-base);
|
|
67
67
|
flex-grow: 1;
|
|
68
68
|
margin-right: var(--spacing-base);
|
|
69
|
-
`;var
|
|
69
|
+
`;var Ie=[{name:"=",value:"="},{name:"!=",value:"!="},{name:">",value:">"},{name:">=",value:">="},{name:"<",value:"<"},{name:"<=",value:"<="},{name:"is strongest",value:"+"},{name:"is weakest",value:"-"}],Ct=({value:t,setValue:n,contextConfig:r,onMenuOpen:s,onMenuClose:a,displayTitle:o=!0})=>{let{loading:l,result:i,error:d}=k(r),c=t||{crit:[]},D=m=>{n({...c,op:m==="&"?void 0:m})},u=()=>{n({...c,crit:[...c.crit,{l:"",op:">",r:50}]})},g=(m,p)=>{n(Q(c,y=>{y.crit[p]=m}))},b=m=>{let p=Q(c,w=>{w.crit.splice(m,1)}),y=p.crit.length===0?null:p;n(y)};return d?e(L,{type:"danger"},d):l||i===null?e(we,null):e("fieldset",{className:"personalization-criteria"},o?e("legend",{css:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-bold)"}},"Personalize This"):null,c.crit.length?c.crit.map((m,p)=>{var f,v;let y=((f=m.l)==null?void 0:f.length)>0,w=m.op!=="+"&&m.op!=="-";return e("div",{css:K,key:p},e("div",{css:X,style:{gridTemplateColumns:`repeat(${w?3:2}, minmax(0, 1fr))`},className:"criteriaItemInner"},e(Y,{name:`lhs-${p}`,label:"Match Dimension",showLabel:!1,value:m.l,options:[{label:"Select",value:""},...i.dimensions.map(C=>({label:C.displayName,value:C.dim}))],onChange:C=>{g({...m,l:C.target.value},p)}}),e("div",{css:{display:"flex",alignItems:"center",gap:"var(--spacing-base)",justifyContent:"space-around"}},e("span",{css:{color:"var(--gray-700)"}},"score"),e(Y,{css:{width:"100%"},name:`op-${p}`,label:"Operator",showLabel:!1,value:m.op,options:Ie.map(C=>({label:C.name,value:C.value})),onChange:C=>{let E=C.target.value;g(E==="+"||E==="-"?{...m,op:E,r:void 0,rDim:void 0}:{...m,op:C.target.value},p)},disabled:!y})),w?e(Me,{critHasLhs:y,currentCriteria:m,dimensions:i,update:g,index:p,onMenuOpen:s,onMenuClose:a}):null),e("button",{type:"button",onClick:()=>b(p),title:"Delete Personalization",css:{backgroundColor:"transparent",backgroundImage:"none",borderWidth:0}},e(J,{icon:xe,iconColor:"red",size:"1.5rem"})),p>0?e("div",{className:"criteria-group-operation",css:{position:"absolute",top:"-4rem",transform:"translateX(calc(1.5rem - 50%))"}},e(ke,{disabled:p>1,value:(v=c.op)!=null?v:"&",options:[{label:"AND",value:"&"},{label:"OR",value:"|"}],onChange:C=>{D(C.value)}})):null)}):e(L,{title:"Default variant",type:"info",css:{marginBlock:"var(--spacing-base)"}},e("p",null,'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.')),i.dimensions.length===0?e(L,{title:"Dimensions",type:"info",css:{marginBlock:"var(--spacing-base)"}},e("p",null,"You do not have any dimensions configured. Create your first"," ",e("a",{href:`${r.apiHost}/projects/${encodeURIComponent(r.projectId)}/personalization/signals`,target:"_blank",rel:"noopener noreferrer",css:{":hover":{textDecorationLine:"underline"}}},"Dimension"))):e("button",{type:"button",className:"add-more",onClick:u,css:{color:"var(--brand-secondary-3)",display:"flex",gap:"var(--spacing-sm)",fontWeight:"var(--fw-bold)",marginTop:"var(--spacing-md)",alignItems:"center",backgroundColor:"transparent",backgroundImage:"none",borderWidth:0}},e("div",{css:{color:"white",backgroundColor:"var(--brand-secondary-3)",borderRadius:"var(--rounded-full)",padding:"var(--spacing-xs)"}},e(J,{icon:Re,iconColor:"currentColor",size:"1.25rem"})),"Add Criteria"))};function Me({update:t,currentCriteria:n,index:r,dimensions:s,critHasLhs:a,onMenuOpen:o,onMenuClose:l}){var c,D;let[i,d]=De(n.r&&R(n.r)!==null?n.r.toString(10):"");return e(Ee,{name:`rhs-${r}`,className:"input-combobox",inputValue:i,value:{label:n.rDim?(D=(c=s.dimIndex[n.rDim])==null?void 0:c.displayName)!=null?D:n.r:"",value:n.r,isDisabled:!1},styles:{option:(u,{isDisabled:g})=>({...u,background:g?"transparent":void 0,fontSize:g?"0.8rem":void 0})},options:[{label:"Enter numeric score or choose another dimension score",value:"",isDisabled:!0},...s.dimensions.map(u=>({label:u.displayName,value:u.dim,isDisabled:!1}))],onChange:u=>{var g;u&&t({...n,rDim:(g=u.value)==null?void 0:g.toString(),r:void 0},r)},onInputChange:(u,g)=>{let b=R(u);g.action==="input-change"||g.action==="set-value"?(d(u),(b||u==="")&&t({...n,r:u,rDim:void 0},r)):!b&&!R(g.prevInputValue)&&d(u)},isDisabled:!a,noOptionsMessage:({inputValue:u})=>R(u)?`${u}`:"No options match",onMenuOpen:o,onMenuClose:l})}function R(t){return/^\d+$/.test(t.toString(10))}import Ve from"react";import{useEffect as Te,useState as Se}from"react";import{ManifestClient as Ne,ApiClientError as Pe}from"@uniformdev/context/api";function I({apiHost:t,apiKey:n,projectId:r}){let[s,a]=Se({loading:!1,notConfigured:!1,error:null,result:null});return Te(()=>{if(!r||!n||!t){a({notConfigured:!0,loading:!1,error:null,result:null});return}(async()=>{a({notConfigured:!1,loading:!0,error:null,result:null});try{let i=await new Ne({projectId:r,apiKey:n,apiHost:t}).get({preview:!0});a({notConfigured:!1,loading:!1,error:null,result:i})}catch(l){let i;l instanceof Pe?(l.statusCode===403&&(i=`The API key ${n} did not have permissions to fetch the manifest. Ensure Context > Read Drafts permissions are granted.`),i=l.message):i=l.toString(),a({notConfigured:!1,loading:!1,error:i,result:null});return}})()},[t,n,r]),{result:s.result,error:s.error,loading:s.loading,notConfigured:s.notConfigured}}import{LoadingIndicator as Le}from"@uniformdev/design-system";function Rt({children:t,versionMap:n,contextConfig:r}){let{loading:s,result:a}=I(r);if(s)return e(Le,null);if(a){let o=n[a.project.ui_version];if(o)return e(o,null)}return e(Ve.Fragment,null,t)}import Z,{createContext as $e,useContext as $}from"react";import{LoadingIndicator as ze}from"@uniformdev/design-system";var M=$e(null),$t=({loadingComponent:t,errorComponent:n,contextConfig:r,children:s})=>{let a=I(r),o=k(r);return a.error||a.notConfigured?n?e(n,{contextConfig:r,result:a}):e(Z.Fragment,null,"ErrorComponent is not configured"):o.error||o.notConfigured?n?e(n,{contextConfig:r,result:o}):e(Z.Fragment,null,"ErrorComponent is not configured"):a.loading||o.loading?t?e(t,null):e(ze,null):e(M.Provider,{value:{manifest:a.result,dimensions:o.result,contextConfig:r}},s)};function zt(){let t=$(M);if(!(t!=null&&t.contextConfig))throw new Error("Not within DataContext! Configuration data is not exist.");return t.contextConfig}function Ut(){let t=$(M);if(!(t!=null&&t.manifest))throw new Error("Not within DataContext! Manifest data is not exist.");return t.manifest}function At(){let t=$(M);if(!(t!=null&&t.dimensions))throw new Error("Not within DataContext! Dimensions data is not exist.");return t.dimensions}import{validate as Ue}from"uuid";import{ManifestClient as Ae}from"@uniformdev/context/api";var j=async t=>{if(!t)return{valid:!1,error:new Error("contextConfig was not defined.")};if(!t.apiHost)return{valid:!1,error:new Error("apiHost was not defined.")};if(!t.apiKey)return{valid:!1,error:new Error("apiKey was not defined.")};if(!Ue(t.apiKey)&&!t.projectId)return{valid:!1,error:new Error("projectId is required when using a modern API key.")};let n=new Ae({projectId:t.projectId,apiKey:t.apiKey,apiHost:t.apiHost});try{let r=await n.get({preview:!0});return{valid:!0,result:r}}catch(r){return{valid:!1,error:r}}};import{useEffect as Be,useState as Oe}from"react";var Ft=t=>{let[n,r]=Oe({validating:!1,error:void 0}),{apiKey:s,apiHost:a,projectId:o}=t||{};return Be(()=>{if(!s||!a)return;(async()=>{r({validating:!0,error:void 0});let{error:i,result:d}=await j({apiHost:a,apiKey:s,projectId:o});r(i?{error:i,validating:!1}:{error:void 0,validating:!1,result:d})})()},[a,s,o]),{validating:n.validating,error:n.error,result:n.result}};function Xt(t){return Array.isArray(t)&&t.length>0&&t[0].cat!==void 0}function Yt(t){return t.crit!==void 0}export*from"@uniformdev/design-system";export{$t as ContextData,U as EditLink,st as EnrichmentTag,Ct as PersonalizationCriteria,Rt as ProjectUIVersion,ge as addEnrichmentLink,Ie as equality,Xt as isEnrichmentTagData,Yt as isPersonalizationCriteriaData,zt as useContextConfig,I as useContextData,k as useDimensions,At as useDimensionsDataContext,Ut as useManifest,Ft as useValidateContextConfig,j as validateContextConfig};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ce=Object.create;var z=Object.defineProperty;var ve=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty;var De=(e,n)=>{for(var r in n)z(e,r,{get:n[r],enumerable:!0})},$=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of he(n))!ye.call(e,i)&&i!==r&&z(e,i,{get:()=>n[i],enumerable:!(s=ve(n,i))||s.enumerable});return e},D=(e,n,r)=>($(e,n,"default"),r&&$(r,n,"default")),P=(e,n,r)=>(r=e!=null?Ce(be(e)):{},$(n||!e||!e.__esModule?z(r,"default",{value:e,enumerable:!0}):r,e)),we=e=>$(z({},"__esModule",{value:!0}),e);var y={};De(y,{ContextData:()=>Ve,EditLink:()=>F,EnrichmentTag:()=>ke,PersonalizationCriteria:()=>Se,ProjectUIVersion:()=>Pe,addEnrichmentLink:()=>re,equality:()=>ce,isEnrichmentTagData:()=>Ae,isPersonalizationCriteriaData:()=>Be,useContextConfig:()=>Le,useContextData:()=>L,useDimensions:()=>T,useDimensionsDataContext:()=>ze,useManifest:()=>$e,useValidateContextConfig:()=>Ue,validateContextConfig:()=>Q});module.exports=we(y);var t=require("@emotion/react"),E=P(require("react"));var ee=require("@uniformdev/design-system"),te=require("react-icons/cg");var Z=require("@emotion/react"),j=Z.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
font-weight: var(--fw-bold);
|
|
@@ -9,7 +9,7 @@ var ve=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDes
|
|
|
9
9
|
&:focus {
|
|
10
10
|
text-decoration-line: underline;
|
|
11
11
|
}
|
|
12
|
-
`;var
|
|
12
|
+
`;var F=({linkTo:e,name:n,linkText:r=`Edit ${n} Component`})=>(0,t.jsx)("a",{css:j,title:`Edit ${n} component definition`,rel:"noopener noreferrer",target:"_blank",href:e},r,(0,t.jsx)(ee.Icon,{icon:te.CgChevronRight,iconColor:"currentColor",size:"1.5rem"}));var w=P(require("react"));var U=require("react"),V=require("@uniformdev/context/api");function ne(e,n,r){return e.reduce((s,i)=>{let o=n(i);if(typeof o=="undefined"||o===null)throw new Error("Objectify key selector returned undefined or null.");return s[n(i)]=r?r(i):i,s},{})}function T({apiHost:e,apiKey:n,projectId:r}){let[s,i]=(0,U.useState)({loading:!1,notConfigured:!1,error:null,result:null});return(0,U.useEffect)(()=>{if(!r||!n||!e){i({notConfigured:!0,loading:!1,error:null,result:null});return}(async()=>{i({notConfigured:!1,loading:!0,error:null,result:null});try{let a=(await new V.DimensionClient({projectId:r,apiKey:n,apiHost:e}).get()).dimensions.map(c=>({...c,displayName:(0,V.computeDimensionDisplayName)(c)})),d={dimensions:a,dimIndex:ne(a,c=>c.dim,c=>c)};i({notConfigured:!1,loading:!1,error:null,result:d})}catch(l){let a;l instanceof V.ApiClientError?a=l.message:a=l.toString(),i({notConfigured:!1,loading:!1,error:a,result:null});return}})()},[e,n,r]),{result:s.result,error:s.error,loading:s.loading,notConfigured:s.notConfigured}}var A=require("@uniformdev/context"),g=require("@uniformdev/design-system"),S=require("react-icons/cg"),K=P(require("immer")),B=require("@emotion/react"),re=B.css`
|
|
13
13
|
flex: 2;
|
|
14
14
|
display: flex;
|
|
15
15
|
width: 50%;
|
|
@@ -20,7 +20,7 @@ var ve=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDes
|
|
|
20
20
|
&:focus {
|
|
21
21
|
text-decoration-line: underline;
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,ke=({value:e,setValue:n,contextConfig:r,displayTitle:s=!0})=>{let{loading:i,result:o,error:l}=T(r),a=(0,w.useMemo)(()=>{if(o)return o.dimensions.filter(f=>f.category==="ENR")},[o]),d=(0,w.useMemo)(()=>{if(!e)return a;if(a)return a.filter(f=>!e.some(b=>(0,A.getEnrichmentVectorKey)(b.cat,b.key)===f.dim))},[a,e]),[c,I]=(0,w.useState)(""),[u,C]=(0,w.useState)(50),[x,m]=(0,w.useState)(!1),p=a==null?void 0:a.find(f=>f.dim===c),R=()=>{let[f,b]=c.split("_");M([...e!=null?e:[],{cat:f,key:b,str:u}]),I(""),C(50),m(!1)},M=f=>{let b=[];o?b=f.filter(N=>{let ge=o.dimIndex[(0,A.getEnrichmentVectorKey)(N.cat,N.key)];return Boolean(ge)}):b=f;let h=b.length===0?null:b;n(h)};return l?(0,t.jsx)(g.Callout,{type:"danger"},l):i||o===null?(0,t.jsx)(g.LoadingIndicator,null):(0,t.jsx)("fieldset",{className:"enrichment-tag"},s?(0,t.jsx)("div",{css:{display:"flex",justifyContent:"space-between",marginBottom:"var(--spacing-base)"}},(0,t.jsx)("legend",{css:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-bold)"}},"Enrichment Tags")):null,a!=null&&a.length?!x&&!e?(0,t.jsx)(g.Callout,{title:"No enrichment tags assigned.",type:"info",css:{marginBlock:"var(--spacing-base)"}},(0,t.jsx)("p",null,"Click"," ",(0,t.jsx)("a",{onClick:()=>m(!0),target:"_blank",rel:"noopener noreferrer",css:{textDecorationLine:"underline"}},"here")," ","to assign your first enrichment tag.")):(0,t.jsx)(w.default.Fragment,null,o&&(0,t.jsx)(Me,{list:e!=null?e:[],setList:M,dimIndex:o.dimIndex}),x&&d&&d.length>0?(0,t.jsx)("div",{className:"add-enrichment-tag",css:{display:"flex",flexWrap:"wrap",gap:"var(--spacing-lg)",marginTop:"var(--spacing-md)",alignItems:"center"}},(0,t.jsx)("div",{css:{flexGrow:1}},(0,t.jsx)(g.InputSelect,{name:"enrichment-type",label:"Enrichment Tag",showLabel:!0,value:c,options:[{label:"Select",value:""},...d.map(f=>({label:f.displayName,value:f.dim}))],onChange:f=>I(f.currentTarget.value)})),(0,t.jsx)(Ie,{score:u,setValue:C,cap:p?p.cap:100,css:{flexBasis:"9rem"}}),(0,t.jsx)(g.Button,{buttonType:"tertiary",size:"xl",css:{marginBottom:"var(--spacing-xs)",height:"3.5rem",margin:0,alignSelf:"flex-end"},onClick:R,disabled:!c},"Add")):null,(0,t.jsx)("div",{className:"enrichment-cta",style:{paddingTop:"10px",display:"flex",justifyContent:"space-between"}},!x&&d&&d.length>0&&e?(0,t.jsx)("button",{type:"button",className:"add-more",onClick:()=>m(!0),css:{color:"var(--brand-secondary-3)",display:"flex",gap:"var(--spacing-sm)",fontWeight:"var(--fw-bold)",marginTop:"var(--spacing-md)",alignItems:"center",backgroundColor:"transparent",backgroundImage:"none",borderWidth:0,width:"50%",flex:2}},(0,t.jsx)("div",{css:{color:"white",backgroundColor:"var(--brand-secondary-3)",borderRadius:"var(--rounded-full)",padding:"var(--spacing-xs)"}},(0,t.jsx)(g.Icon,{icon:S.CgMathPlus,iconColor:"currentColor",size:"1.25rem"})),"Add More"):(0,t.jsx)("a",{css:re,title:"none",href:"#"}),(0,t.jsx)(F,{name:"Enrichments",linkText:"Manage Enrichments",linkTo:`${r.apiHost}/projects/${encodeURIComponent(r.projectId)}/personalization/enrichments`}))):(0,t.jsx)(xe,{contextConfig:r}))},xe=({contextConfig:e})=>(0,t.jsx)(g.Callout,{title:"No enrichments found.",type:"caution",css:{marginBlock:"var(--spacing-base)"}},(0,t.jsx)("p",null,"Looks like you do not have any enrichment created in your connected Uniform project. Start by creating your first enrichment"," ",(0,t.jsx)("a",{href:`${e.apiHost}/projects/${encodeURIComponent(e.projectId)}/personalization/enrichments`,target:"_blank",rel:"noopener noreferrer",css:{":hover":{textDecorationLine:"underline"}}},"here"),".")),oe=(e,n=100,r=0)=>Math.max(Math.min(e,n),r),ie=B.css`
|
|
24
24
|
position: absolute;
|
|
25
25
|
bottom: 0.875rem;
|
|
26
26
|
left: var(--spacing-sm);
|
|
@@ -32,27 +32,27 @@ var ve=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDes
|
|
|
32
32
|
background-color: var(--gray-100);
|
|
33
33
|
border: 1px solid var(--gray-300);
|
|
34
34
|
border-radius: var(--rounded-full);
|
|
35
|
-
`,
|
|
36
|
-
${
|
|
35
|
+
`,Re=B.css`
|
|
36
|
+
${ie}
|
|
37
37
|
left: auto;
|
|
38
38
|
right: var(--spacing-sm);
|
|
39
|
-
`,
|
|
39
|
+
`,Ie=({score:e,setValue:n,cap:r=100,...s})=>{let i=o=>{let l=o==="increment"?e+10:e-10;l<0&&(l=0),l>r&&(l=r),n(l)};return(0,t.jsx)("div",{css:{position:"relative"},...s},(0,t.jsx)(g.Input,{label:"Strength",id:"enrichment-score",type:"number",min:0,max:r,value:e,onChange:o=>n(oe(Number(o.currentTarget.value)||0,r)),css:{textAlign:"center",boxSizing:"border-box"}}),(0,t.jsx)("button",{type:"button",title:"Reduce enrichment count",onClick:()=>i("decrement"),disabled:e===0,className:"scoreCounterButton",css:ie},(0,t.jsx)(g.Icon,{icon:S.CgMathMinus,iconColor:"gray",size:"1.5rem"})),(0,t.jsx)("button",{type:"button",title:"Increase enrichment count",onClick:()=>i("increment"),className:"scoreCounterButton",css:Re},(0,t.jsx)(g.Icon,{icon:S.CgMathPlus,iconColor:"gray",size:"1.5rem"})))},Me=({list:e,setList:n,dimIndex:r})=>{let s=o=>{n((0,K.default)(e,l=>{l.splice(o,1)}))},i=(o,l)=>{var d;let a=(d=r[`${e[o].cat}_${e[o].key}`])==null?void 0:d.cap;n((0,K.default)(e,c=>{c[o].str=oe(Number(l)||0,a)}))};return(0,t.jsx)(w.default.Fragment,null,e.map((o,l)=>{let a=r[(0,A.getEnrichmentVectorKey)(o.cat,o.key)];if(!!a)return(0,t.jsx)("div",{css:{display:"flex",alignItems:"center",gap:"var(--spacing-base)",backgroundColor:"var(--brand-secondary-2)",boxShadow:"var(--shadow-base)",borderRadius:"var(--rounded-base)",paddingInline:"var(--spacing-base)",marginBlock:"var(--spacing-base)"},className:"selected-enrichments",key:`${o.cat}-${o.key}`},(0,t.jsx)("span",{css:{fontWeight:"var(--fw-bold)",color:a?void 0:"var(--brand-secondary-5)"}},a?a.displayName:`Enrichment '${o.cat}_${o.key}' is unknown`),(0,t.jsx)("div",{css:{marginLeft:"auto",display:"flex",alignItems:"center",border:"0 solid var(--gray-400)",borderLeftWidth:"1px",borderRightWidth:"1px",padding:"var(--spacing-sm) var(--spacing-base)",flexBasis:"9rem"}},(0,t.jsx)(g.Input,{type:"text",min:0,max:a.cap||100,title:"score",value:o.str,css:{textAlign:"center",width:"100px"},onChange:d=>i(l,d.currentTarget.value)})),(0,t.jsx)("button",{type:"button",title:"Delete enrichment",onClick:()=>s(l),css:{border:0}},(0,t.jsx)(g.Icon,{icon:S.CgCloseO,iconColor:"red",size:"1.5rem"})))}))};var le=require("react");var v=require("@uniformdev/design-system"),J=P(require("immer")),W=require("react-icons/cg");var Y=require("@emotion/react"),X="6rem",ae=Y.css`
|
|
40
40
|
position: relative;
|
|
41
41
|
padding: var(--spacing-base);
|
|
42
42
|
border: 1px solid var(--gray-300);
|
|
43
43
|
box-shadow: var(--shadow-base);
|
|
44
44
|
background-color: white;
|
|
45
45
|
border-radius: var(--rounded-base);
|
|
46
|
-
margin-top: ${
|
|
46
|
+
margin-top: ${X};
|
|
47
47
|
display: flex;
|
|
48
48
|
&:before {
|
|
49
49
|
content: '';
|
|
50
50
|
display: block;
|
|
51
51
|
width: 1px;
|
|
52
|
-
height: ${
|
|
52
|
+
height: ${X};
|
|
53
53
|
background-color: var(--gray-300);
|
|
54
54
|
position: absolute;
|
|
55
|
-
top: -${
|
|
55
|
+
top: -${X};
|
|
56
56
|
left: var(--spacing-lg);
|
|
57
57
|
}
|
|
58
58
|
&:first-of-type {
|
|
@@ -61,9 +61,9 @@ var ve=Object.create;var U=Object.defineProperty;var he=Object.getOwnPropertyDes
|
|
|
61
61
|
display: none;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,se=Y.css`
|
|
65
65
|
display: grid;
|
|
66
66
|
gap: var(--spacing-base);
|
|
67
67
|
flex-grow: 1;
|
|
68
68
|
margin-right: var(--spacing-base);
|
|
69
|
-
`;var
|
|
69
|
+
`;var ce=[{name:"=",value:"="},{name:"!=",value:"!="},{name:">",value:">"},{name:">=",value:">="},{name:"<",value:"<"},{name:"<=",value:"<="},{name:"is strongest",value:"+"},{name:"is weakest",value:"-"}],Se=({value:e,setValue:n,contextConfig:r,onMenuOpen:s,onMenuClose:i,displayTitle:o=!0})=>{let{loading:l,result:a,error:d}=T(r),c=e||{crit:[]},I=m=>{n({...c,op:m==="&"?void 0:m})},u=()=>{n({...c,crit:[...c.crit,{l:"",op:">",r:50}]})},C=(m,p)=>{n((0,J.default)(c,R=>{R.crit[p]=m}))},x=m=>{let p=(0,J.default)(c,M=>{M.crit.splice(m,1)}),R=p.crit.length===0?null:p;n(R)};return d?(0,t.jsx)(v.Callout,{type:"danger"},d):l||a===null?(0,t.jsx)(v.LoadingIndicator,null):(0,t.jsx)("fieldset",{className:"personalization-criteria"},o?(0,t.jsx)("legend",{css:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-bold)"}},"Personalize This"):null,c.crit.length?c.crit.map((m,p)=>{var f,b;let R=((f=m.l)==null?void 0:f.length)>0,M=m.op!=="+"&&m.op!=="-";return(0,t.jsx)("div",{css:ae,key:p},(0,t.jsx)("div",{css:se,style:{gridTemplateColumns:`repeat(${M?3:2}, minmax(0, 1fr))`},className:"criteriaItemInner"},(0,t.jsx)(v.InputSelect,{name:`lhs-${p}`,label:"Match Dimension",showLabel:!1,value:m.l,options:[{label:"Select",value:""},...a.dimensions.map(h=>({label:h.displayName,value:h.dim}))],onChange:h=>{C({...m,l:h.target.value},p)}}),(0,t.jsx)("div",{css:{display:"flex",alignItems:"center",gap:"var(--spacing-base)",justifyContent:"space-around"}},(0,t.jsx)("span",{css:{color:"var(--gray-700)"}},"score"),(0,t.jsx)(v.InputSelect,{css:{width:"100%"},name:`op-${p}`,label:"Operator",showLabel:!1,value:m.op,options:ce.map(h=>({label:h.name,value:h.value})),onChange:h=>{let N=h.target.value;C(N==="+"||N==="-"?{...m,op:N,r:void 0,rDim:void 0}:{...m,op:h.target.value},p)},disabled:!R})),M?(0,t.jsx)(Ne,{critHasLhs:R,currentCriteria:m,dimensions:a,update:C,index:p,onMenuOpen:s,onMenuClose:i}):null),(0,t.jsx)("button",{type:"button",onClick:()=>x(p),title:"Delete Personalization",css:{backgroundColor:"transparent",backgroundImage:"none",borderWidth:0}},(0,t.jsx)(v.Icon,{icon:W.CgCloseO,iconColor:"red",size:"1.5rem"})),p>0?(0,t.jsx)("div",{className:"criteria-group-operation",css:{position:"absolute",top:"-4rem",transform:"translateX(calc(1.5rem - 50%))"}},(0,t.jsx)(v.InputInlineSelect,{disabled:p>1,value:(b=c.op)!=null?b:"&",options:[{label:"AND",value:"&"},{label:"OR",value:"|"}],onChange:h=>{I(h.value)}})):null)}):(0,t.jsx)(v.Callout,{title:"Default variant",type:"info",css:{marginBlock:"var(--spacing-base)"}},(0,t.jsx)("p",null,'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.')),a.dimensions.length===0?(0,t.jsx)(v.Callout,{title:"Dimensions",type:"info",css:{marginBlock:"var(--spacing-base)"}},(0,t.jsx)("p",null,"You do not have any dimensions configured. Create your first"," ",(0,t.jsx)("a",{href:`${r.apiHost}/projects/${encodeURIComponent(r.projectId)}/personalization/signals`,target:"_blank",rel:"noopener noreferrer",css:{":hover":{textDecorationLine:"underline"}}},"Dimension"))):(0,t.jsx)("button",{type:"button",className:"add-more",onClick:u,css:{color:"var(--brand-secondary-3)",display:"flex",gap:"var(--spacing-sm)",fontWeight:"var(--fw-bold)",marginTop:"var(--spacing-md)",alignItems:"center",backgroundColor:"transparent",backgroundImage:"none",borderWidth:0}},(0,t.jsx)("div",{css:{color:"white",backgroundColor:"var(--brand-secondary-3)",borderRadius:"var(--rounded-full)",padding:"var(--spacing-xs)"}},(0,t.jsx)(v.Icon,{icon:W.CgMathPlus,iconColor:"currentColor",size:"1.25rem"})),"Add Criteria"))};function Ne({update:e,currentCriteria:n,index:r,dimensions:s,critHasLhs:i,onMenuOpen:o,onMenuClose:l}){var c,I;let[a,d]=(0,le.useState)(n.r&&O(n.r)!==null?n.r.toString(10):"");return(0,t.jsx)(v.InputComboBox,{name:`rhs-${r}`,className:"input-combobox",inputValue:a,value:{label:n.rDim?(I=(c=s.dimIndex[n.rDim])==null?void 0:c.displayName)!=null?I:n.r:"",value:n.r,isDisabled:!1},styles:{option:(u,{isDisabled:C})=>({...u,background:C?"transparent":void 0,fontSize:C?"0.8rem":void 0})},options:[{label:"Enter numeric score or choose another dimension score",value:"",isDisabled:!0},...s.dimensions.map(u=>({label:u.displayName,value:u.dim,isDisabled:!1}))],onChange:u=>{var C;u&&e({...n,rDim:(C=u.value)==null?void 0:C.toString(),r:void 0},r)},onInputChange:(u,C)=>{let x=O(u);C.action==="input-change"||C.action==="set-value"?(d(u),(x||u==="")&&e({...n,r:u,rDim:void 0},r)):!x&&!O(C.prevInputValue)&&d(u)},isDisabled:!i,noOptionsMessage:({inputValue:u})=>O(u)?`${u}`:"No options match",onMenuOpen:o,onMenuClose:l})}function O(e){return/^\d+$/.test(e.toString(10))}var ue=P(require("react"));var G=require("react"),H=require("@uniformdev/context/api");function L({apiHost:e,apiKey:n,projectId:r}){let[s,i]=(0,G.useState)({loading:!1,notConfigured:!1,error:null,result:null});return(0,G.useEffect)(()=>{if(!r||!n||!e){i({notConfigured:!0,loading:!1,error:null,result:null});return}(async()=>{i({notConfigured:!1,loading:!0,error:null,result:null});try{let a=await new H.ManifestClient({projectId:r,apiKey:n,apiHost:e}).get({preview:!0});i({notConfigured:!1,loading:!1,error:null,result:a})}catch(l){let a;l instanceof H.ApiClientError?(l.statusCode===403&&(a=`The API key ${n} did not have permissions to fetch the manifest. Ensure Context > Read Drafts permissions are granted.`),a=l.message):a=l.toString(),i({notConfigured:!1,loading:!1,error:a,result:null});return}})()},[e,n,r]),{result:s.result,error:s.error,loading:s.loading,notConfigured:s.notConfigured}}var de=require("@uniformdev/design-system");function Pe({children:e,versionMap:n,contextConfig:r}){let{loading:s,result:i}=L(r);if(s)return(0,t.jsx)(de.LoadingIndicator,null);if(i){let o=n[i.project.ui_version];if(o)return(0,t.jsx)(o,null)}return(0,t.jsx)(ue.default.Fragment,null,e)}var k=P(require("react"));var me=require("@uniformdev/design-system"),_=(0,k.createContext)(null),Ve=({loadingComponent:e,errorComponent:n,contextConfig:r,children:s})=>{let i=L(r),o=T(r);return i.error||i.notConfigured?n?(0,t.jsx)(n,{contextConfig:r,result:i}):(0,t.jsx)(k.default.Fragment,null,"ErrorComponent is not configured"):o.error||o.notConfigured?n?(0,t.jsx)(n,{contextConfig:r,result:o}):(0,t.jsx)(k.default.Fragment,null,"ErrorComponent is not configured"):i.loading||o.loading?e?(0,t.jsx)(e,null):(0,t.jsx)(me.LoadingIndicator,null):(0,t.jsx)(_.Provider,{value:{manifest:i.result,dimensions:o.result,contextConfig:r}},s)};function Le(){let e=(0,k.useContext)(_);if(!(e!=null&&e.contextConfig))throw new Error("Not within DataContext! Configuration data is not exist.");return e.contextConfig}function $e(){let e=(0,k.useContext)(_);if(!(e!=null&&e.manifest))throw new Error("Not within DataContext! Manifest data is not exist.");return e.manifest}function ze(){let e=(0,k.useContext)(_);if(!(e!=null&&e.dimensions))throw new Error("Not within DataContext! Dimensions data is not exist.");return e.dimensions}var pe=require("uuid"),fe=require("@uniformdev/context/api"),Q=async e=>{if(!e)return{valid:!1,error:new Error("contextConfig was not defined.")};if(!e.apiHost)return{valid:!1,error:new Error("apiHost was not defined.")};if(!e.apiKey)return{valid:!1,error:new Error("apiKey was not defined.")};if(!(0,pe.validate)(e.apiKey)&&!e.projectId)return{valid:!1,error:new Error("projectId is required when using a modern API key.")};let n=new fe.ManifestClient({projectId:e.projectId,apiKey:e.apiKey,apiHost:e.apiHost});try{let r=await n.get({preview:!0});return{valid:!0,result:r}}catch(r){return{valid:!1,error:r}}};var q=require("react");var Ue=e=>{let[n,r]=(0,q.useState)({validating:!1,error:void 0}),{apiKey:s,apiHost:i,projectId:o}=e||{};return(0,q.useEffect)(()=>{if(!s||!i)return;(async()=>{r({validating:!0,error:void 0});let{error:a,result:d}=await Q({apiHost:i,apiKey:s,projectId:o});r(a?{error:a,validating:!1}:{error:void 0,validating:!1,result:d})})()},[i,s,o]),{validating:n.validating,error:n.error,result:n.result}};function Ae(e){return Array.isArray(e)&&e.length>0&&e[0].cat!==void 0}function Be(e){return e.crit!==void 0}D(y,require("@uniformdev/design-system"),module.exports);0&&(module.exports={ContextData,EditLink,EnrichmentTag,PersonalizationCriteria,ProjectUIVersion,addEnrichmentLink,equality,isEnrichmentTagData,isPersonalizationCriteriaData,useContextConfig,useContextData,useDimensions,useDimensionsDataContext,useManifest,useValidateContextConfig,validateContextConfig});
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e}from"@emotion/react";import*as
|
|
1
|
+
import{jsx as e}from"@emotion/react";import*as h from"react";import{Icon as re}from"@uniformdev/design-system";import{CgChevronRight as oe}from"react-icons/cg";import{css as te}from"@emotion/react";var z=te`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
font-weight: var(--fw-bold);
|
|
@@ -9,7 +9,7 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
9
9
|
&:focus {
|
|
10
10
|
text-decoration-line: underline;
|
|
11
11
|
}
|
|
12
|
-
`;var
|
|
12
|
+
`;var U=({linkTo:t,name:n,linkText:r=`Edit ${n} Component`})=>e("a",{css:z,title:`Edit ${n} component definition`,rel:"noopener noreferrer",target:"_blank",href:t},r,e(re,{icon:oe,iconColor:"currentColor",size:"1.5rem"}));import W,{useMemo as B,useState as T}from"react";import{useEffect as ie,useState as ae}from"react";import{DimensionClient as se,computeDimensionDisplayName as le,ApiClientError as ce}from"@uniformdev/context/api";function A(t,n,r){return t.reduce((s,a)=>{let o=n(a);if(typeof o=="undefined"||o===null)throw new Error("Objectify key selector returned undefined or null.");return s[n(a)]=r?r(a):a,s},{})}function k({apiHost:t,apiKey:n,projectId:r}){let[s,a]=ae({loading:!1,notConfigured:!1,error:null,result:null});return ie(()=>{if(!r||!n||!t){a({notConfigured:!0,loading:!1,error:null,result:null});return}(async()=>{a({notConfigured:!1,loading:!0,error:null,result:null});try{let i=(await new se({projectId:r,apiKey:n,apiHost:t}).get()).dimensions.map(c=>({...c,displayName:le(c)})),d={dimensions:i,dimIndex:A(i,c=>c.dim,c=>c)};a({notConfigured:!1,loading:!1,error:null,result:d})}catch(l){let i;l instanceof ce?i=l.message:i=l.toString(),a({notConfigured:!1,loading:!1,error:i,result:null});return}})()},[t,n,r]),{result:s.result,error:s.error,loading:s.loading,notConfigured:s.notConfigured}}import{getEnrichmentVectorKey as S}from"@uniformdev/context";import{Input as G,Button as ue,InputSelect as de,Callout as N,Icon as x,LoadingIndicator as me}from"@uniformdev/design-system";import{CgMathPlus as H,CgMathMinus as pe,CgCloseO as fe}from"react-icons/cg";import O from"immer";import{css as P}from"@emotion/react";var ge=P`
|
|
13
13
|
flex: 2;
|
|
14
14
|
display: flex;
|
|
15
15
|
width: 50%;
|
|
@@ -20,7 +20,7 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
20
20
|
&:focus {
|
|
21
21
|
text-decoration-line: underline;
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,st=({value:t,setValue:n,contextConfig:r,displayTitle:s=!0})=>{let{loading:a,result:o,error:l}=k(r),i=B(()=>{if(o)return o.dimensions.filter(f=>f.category==="ENR")},[o]),d=B(()=>{if(!t)return i;if(i)return i.filter(f=>!t.some(v=>S(v.cat,v.key)===f.dim))},[i,t]),[c,D]=T(""),[u,g]=T(50),[b,m]=T(!1),p=i==null?void 0:i.find(f=>f.dim===c),y=()=>{let[f,v]=c.split("_");w([...t!=null?t:[],{cat:f,key:v,str:u}]),D(""),g(50),m(!1)},w=f=>{let v=[];o?v=f.filter(E=>{let ee=o.dimIndex[S(E.cat,E.key)];return Boolean(ee)}):v=f;let C=v.length===0?null:v;n(C)};return l?e(N,{type:"danger"},l):a||o===null?e(me,null):e("fieldset",{className:"enrichment-tag"},s?e("div",{css:{display:"flex",justifyContent:"space-between",marginBottom:"var(--spacing-base)"}},e("legend",{css:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-bold)"}},"Enrichment Tags")):null,i!=null&&i.length?!b&&!t?e(N,{title:"No enrichment tags assigned.",type:"info",css:{marginBlock:"var(--spacing-base)"}},e("p",null,"Click"," ",e("a",{onClick:()=>m(!0),target:"_blank",rel:"noopener noreferrer",css:{textDecorationLine:"underline"}},"here")," ","to assign your first enrichment tag.")):e(W.Fragment,null,o&&e(be,{list:t!=null?t:[],setList:w,dimIndex:o.dimIndex}),b&&d&&d.length>0?e("div",{className:"add-enrichment-tag",css:{display:"flex",flexWrap:"wrap",gap:"var(--spacing-lg)",marginTop:"var(--spacing-md)",alignItems:"center"}},e("div",{css:{flexGrow:1}},e(de,{name:"enrichment-type",label:"Enrichment Tag",showLabel:!0,value:c,options:[{label:"Select",value:""},...d.map(f=>({label:f.displayName,value:f.dim}))],onChange:f=>D(f.currentTarget.value)})),e(he,{score:u,setValue:g,cap:p?p.cap:100,css:{flexBasis:"9rem"}}),e(ue,{buttonType:"tertiary",size:"xl",css:{marginBottom:"var(--spacing-xs)",height:"3.5rem",margin:0,alignSelf:"flex-end"},onClick:y,disabled:!c},"Add")):null,e("div",{className:"enrichment-cta",style:{paddingTop:"10px",display:"flex",justifyContent:"space-between"}},!b&&d&&d.length>0&&t?e("button",{type:"button",className:"add-more",onClick:()=>m(!0),css:{color:"var(--brand-secondary-3)",display:"flex",gap:"var(--spacing-sm)",fontWeight:"var(--fw-bold)",marginTop:"var(--spacing-md)",alignItems:"center",backgroundColor:"transparent",backgroundImage:"none",borderWidth:0,width:"50%",flex:2}},e("div",{css:{color:"white",backgroundColor:"var(--brand-secondary-3)",borderRadius:"var(--rounded-full)",padding:"var(--spacing-xs)"}},e(x,{icon:H,iconColor:"currentColor",size:"1.25rem"})),"Add More"):e("a",{css:ge,title:"none",href:"#"}),e(U,{name:"Enrichments",linkText:"Manage Enrichments",linkTo:`${r.apiHost}/projects/${encodeURIComponent(r.projectId)}/personalization/enrichments`}))):e(Ce,{contextConfig:r}))},Ce=({contextConfig:t})=>e(N,{title:"No enrichments found.",type:"caution",css:{marginBlock:"var(--spacing-base)"}},e("p",null,"Looks like you do not have any enrichment created in your connected Uniform project. Start by creating your first enrichment"," ",e("a",{href:`${t.apiHost}/projects/${encodeURIComponent(t.projectId)}/personalization/enrichments`,target:"_blank",rel:"noopener noreferrer",css:{":hover":{textDecorationLine:"underline"}}},"here"),".")),_=(t,n=100,r=0)=>Math.max(Math.min(t,n),r),q=P`
|
|
24
24
|
position: absolute;
|
|
25
25
|
bottom: 0.875rem;
|
|
26
26
|
left: var(--spacing-sm);
|
|
@@ -32,27 +32,27 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
32
32
|
background-color: var(--gray-100);
|
|
33
33
|
border: 1px solid var(--gray-300);
|
|
34
34
|
border-radius: var(--rounded-full);
|
|
35
|
-
`,
|
|
36
|
-
${
|
|
35
|
+
`,ve=P`
|
|
36
|
+
${q}
|
|
37
37
|
left: auto;
|
|
38
38
|
right: var(--spacing-sm);
|
|
39
|
-
`,
|
|
39
|
+
`,he=({score:t,setValue:n,cap:r=100,...s})=>{let a=o=>{let l=o==="increment"?t+10:t-10;l<0&&(l=0),l>r&&(l=r),n(l)};return e("div",{css:{position:"relative"},...s},e(G,{label:"Strength",id:"enrichment-score",type:"number",min:0,max:r,value:t,onChange:o=>n(_(Number(o.currentTarget.value)||0,r)),css:{textAlign:"center",boxSizing:"border-box"}}),e("button",{type:"button",title:"Reduce enrichment count",onClick:()=>a("decrement"),disabled:t===0,className:"scoreCounterButton",css:q},e(x,{icon:pe,iconColor:"gray",size:"1.5rem"})),e("button",{type:"button",title:"Increase enrichment count",onClick:()=>a("increment"),className:"scoreCounterButton",css:ve},e(x,{icon:H,iconColor:"gray",size:"1.5rem"})))},be=({list:t,setList:n,dimIndex:r})=>{let s=o=>{n(O(t,l=>{l.splice(o,1)}))},a=(o,l)=>{var d;let i=(d=r[`${t[o].cat}_${t[o].key}`])==null?void 0:d.cap;n(O(t,c=>{c[o].str=_(Number(l)||0,i)}))};return e(W.Fragment,null,t.map((o,l)=>{let i=r[S(o.cat,o.key)];if(!!i)return e("div",{css:{display:"flex",alignItems:"center",gap:"var(--spacing-base)",backgroundColor:"var(--brand-secondary-2)",boxShadow:"var(--shadow-base)",borderRadius:"var(--rounded-base)",paddingInline:"var(--spacing-base)",marginBlock:"var(--spacing-base)"},className:"selected-enrichments",key:`${o.cat}-${o.key}`},e("span",{css:{fontWeight:"var(--fw-bold)",color:i?void 0:"var(--brand-secondary-5)"}},i?i.displayName:`Enrichment '${o.cat}_${o.key}' is unknown`),e("div",{css:{marginLeft:"auto",display:"flex",alignItems:"center",border:"0 solid var(--gray-400)",borderLeftWidth:"1px",borderRightWidth:"1px",padding:"var(--spacing-sm) var(--spacing-base)",flexBasis:"9rem"}},e(G,{type:"text",min:0,max:i.cap||100,title:"score",value:o.str,css:{textAlign:"center",width:"100px"},onChange:d=>a(l,d.currentTarget.value)})),e("button",{type:"button",title:"Delete enrichment",onClick:()=>s(l),css:{border:0}},e(x,{icon:fe,iconColor:"red",size:"1.5rem"})))}))};import{useState as De}from"react";import{LoadingIndicator as we,Callout as L,InputSelect as Y,InputComboBox as Ee,InputInlineSelect as ke,Icon as J}from"@uniformdev/design-system";import Q from"immer";import{CgCloseO as xe,CgMathPlus as Re}from"react-icons/cg";import{css as F}from"@emotion/react";var V="6rem",K=F`
|
|
40
40
|
position: relative;
|
|
41
41
|
padding: var(--spacing-base);
|
|
42
42
|
border: 1px solid var(--gray-300);
|
|
43
43
|
box-shadow: var(--shadow-base);
|
|
44
44
|
background-color: white;
|
|
45
45
|
border-radius: var(--rounded-base);
|
|
46
|
-
margin-top: ${
|
|
46
|
+
margin-top: ${V};
|
|
47
47
|
display: flex;
|
|
48
48
|
&:before {
|
|
49
49
|
content: '';
|
|
50
50
|
display: block;
|
|
51
51
|
width: 1px;
|
|
52
|
-
height: ${
|
|
52
|
+
height: ${V};
|
|
53
53
|
background-color: var(--gray-300);
|
|
54
54
|
position: absolute;
|
|
55
|
-
top: -${
|
|
55
|
+
top: -${V};
|
|
56
56
|
left: var(--spacing-lg);
|
|
57
57
|
}
|
|
58
58
|
&:first-of-type {
|
|
@@ -61,9 +61,9 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{Icon as ie}f
|
|
|
61
61
|
display: none;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,X=F`
|
|
65
65
|
display: grid;
|
|
66
66
|
gap: var(--spacing-base);
|
|
67
67
|
flex-grow: 1;
|
|
68
68
|
margin-right: var(--spacing-base);
|
|
69
|
-
`;var
|
|
69
|
+
`;var Ie=[{name:"=",value:"="},{name:"!=",value:"!="},{name:">",value:">"},{name:">=",value:">="},{name:"<",value:"<"},{name:"<=",value:"<="},{name:"is strongest",value:"+"},{name:"is weakest",value:"-"}],Ct=({value:t,setValue:n,contextConfig:r,onMenuOpen:s,onMenuClose:a,displayTitle:o=!0})=>{let{loading:l,result:i,error:d}=k(r),c=t||{crit:[]},D=m=>{n({...c,op:m==="&"?void 0:m})},u=()=>{n({...c,crit:[...c.crit,{l:"",op:">",r:50}]})},g=(m,p)=>{n(Q(c,y=>{y.crit[p]=m}))},b=m=>{let p=Q(c,w=>{w.crit.splice(m,1)}),y=p.crit.length===0?null:p;n(y)};return d?e(L,{type:"danger"},d):l||i===null?e(we,null):e("fieldset",{className:"personalization-criteria"},o?e("legend",{css:{fontSize:"var(--fs-md)",fontWeight:"var(--fw-bold)"}},"Personalize This"):null,c.crit.length?c.crit.map((m,p)=>{var f,v;let y=((f=m.l)==null?void 0:f.length)>0,w=m.op!=="+"&&m.op!=="-";return e("div",{css:K,key:p},e("div",{css:X,style:{gridTemplateColumns:`repeat(${w?3:2}, minmax(0, 1fr))`},className:"criteriaItemInner"},e(Y,{name:`lhs-${p}`,label:"Match Dimension",showLabel:!1,value:m.l,options:[{label:"Select",value:""},...i.dimensions.map(C=>({label:C.displayName,value:C.dim}))],onChange:C=>{g({...m,l:C.target.value},p)}}),e("div",{css:{display:"flex",alignItems:"center",gap:"var(--spacing-base)",justifyContent:"space-around"}},e("span",{css:{color:"var(--gray-700)"}},"score"),e(Y,{css:{width:"100%"},name:`op-${p}`,label:"Operator",showLabel:!1,value:m.op,options:Ie.map(C=>({label:C.name,value:C.value})),onChange:C=>{let E=C.target.value;g(E==="+"||E==="-"?{...m,op:E,r:void 0,rDim:void 0}:{...m,op:C.target.value},p)},disabled:!y})),w?e(Me,{critHasLhs:y,currentCriteria:m,dimensions:i,update:g,index:p,onMenuOpen:s,onMenuClose:a}):null),e("button",{type:"button",onClick:()=>b(p),title:"Delete Personalization",css:{backgroundColor:"transparent",backgroundImage:"none",borderWidth:0}},e(J,{icon:xe,iconColor:"red",size:"1.5rem"})),p>0?e("div",{className:"criteria-group-operation",css:{position:"absolute",top:"-4rem",transform:"translateX(calc(1.5rem - 50%))"}},e(ke,{disabled:p>1,value:(v=c.op)!=null?v:"&",options:[{label:"AND",value:"&"},{label:"OR",value:"|"}],onChange:C=>{D(C.value)}})):null)}):e(L,{title:"Default variant",type:"info",css:{marginBlock:"var(--spacing-base)"}},e("p",null,'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.')),i.dimensions.length===0?e(L,{title:"Dimensions",type:"info",css:{marginBlock:"var(--spacing-base)"}},e("p",null,"You do not have any dimensions configured. Create your first"," ",e("a",{href:`${r.apiHost}/projects/${encodeURIComponent(r.projectId)}/personalization/signals`,target:"_blank",rel:"noopener noreferrer",css:{":hover":{textDecorationLine:"underline"}}},"Dimension"))):e("button",{type:"button",className:"add-more",onClick:u,css:{color:"var(--brand-secondary-3)",display:"flex",gap:"var(--spacing-sm)",fontWeight:"var(--fw-bold)",marginTop:"var(--spacing-md)",alignItems:"center",backgroundColor:"transparent",backgroundImage:"none",borderWidth:0}},e("div",{css:{color:"white",backgroundColor:"var(--brand-secondary-3)",borderRadius:"var(--rounded-full)",padding:"var(--spacing-xs)"}},e(J,{icon:Re,iconColor:"currentColor",size:"1.25rem"})),"Add Criteria"))};function Me({update:t,currentCriteria:n,index:r,dimensions:s,critHasLhs:a,onMenuOpen:o,onMenuClose:l}){var c,D;let[i,d]=De(n.r&&R(n.r)!==null?n.r.toString(10):"");return e(Ee,{name:`rhs-${r}`,className:"input-combobox",inputValue:i,value:{label:n.rDim?(D=(c=s.dimIndex[n.rDim])==null?void 0:c.displayName)!=null?D:n.r:"",value:n.r,isDisabled:!1},styles:{option:(u,{isDisabled:g})=>({...u,background:g?"transparent":void 0,fontSize:g?"0.8rem":void 0})},options:[{label:"Enter numeric score or choose another dimension score",value:"",isDisabled:!0},...s.dimensions.map(u=>({label:u.displayName,value:u.dim,isDisabled:!1}))],onChange:u=>{var g;u&&t({...n,rDim:(g=u.value)==null?void 0:g.toString(),r:void 0},r)},onInputChange:(u,g)=>{let b=R(u);g.action==="input-change"||g.action==="set-value"?(d(u),(b||u==="")&&t({...n,r:u,rDim:void 0},r)):!b&&!R(g.prevInputValue)&&d(u)},isDisabled:!a,noOptionsMessage:({inputValue:u})=>R(u)?`${u}`:"No options match",onMenuOpen:o,onMenuClose:l})}function R(t){return/^\d+$/.test(t.toString(10))}import Ve from"react";import{useEffect as Te,useState as Se}from"react";import{ManifestClient as Ne,ApiClientError as Pe}from"@uniformdev/context/api";function I({apiHost:t,apiKey:n,projectId:r}){let[s,a]=Se({loading:!1,notConfigured:!1,error:null,result:null});return Te(()=>{if(!r||!n||!t){a({notConfigured:!0,loading:!1,error:null,result:null});return}(async()=>{a({notConfigured:!1,loading:!0,error:null,result:null});try{let i=await new Ne({projectId:r,apiKey:n,apiHost:t}).get({preview:!0});a({notConfigured:!1,loading:!1,error:null,result:i})}catch(l){let i;l instanceof Pe?(l.statusCode===403&&(i=`The API key ${n} did not have permissions to fetch the manifest. Ensure Context > Read Drafts permissions are granted.`),i=l.message):i=l.toString(),a({notConfigured:!1,loading:!1,error:i,result:null});return}})()},[t,n,r]),{result:s.result,error:s.error,loading:s.loading,notConfigured:s.notConfigured}}import{LoadingIndicator as Le}from"@uniformdev/design-system";function Rt({children:t,versionMap:n,contextConfig:r}){let{loading:s,result:a}=I(r);if(s)return e(Le,null);if(a){let o=n[a.project.ui_version];if(o)return e(o,null)}return e(Ve.Fragment,null,t)}import Z,{createContext as $e,useContext as $}from"react";import{LoadingIndicator as ze}from"@uniformdev/design-system";var M=$e(null),$t=({loadingComponent:t,errorComponent:n,contextConfig:r,children:s})=>{let a=I(r),o=k(r);return a.error||a.notConfigured?n?e(n,{contextConfig:r,result:a}):e(Z.Fragment,null,"ErrorComponent is not configured"):o.error||o.notConfigured?n?e(n,{contextConfig:r,result:o}):e(Z.Fragment,null,"ErrorComponent is not configured"):a.loading||o.loading?t?e(t,null):e(ze,null):e(M.Provider,{value:{manifest:a.result,dimensions:o.result,contextConfig:r}},s)};function zt(){let t=$(M);if(!(t!=null&&t.contextConfig))throw new Error("Not within DataContext! Configuration data is not exist.");return t.contextConfig}function Ut(){let t=$(M);if(!(t!=null&&t.manifest))throw new Error("Not within DataContext! Manifest data is not exist.");return t.manifest}function At(){let t=$(M);if(!(t!=null&&t.dimensions))throw new Error("Not within DataContext! Dimensions data is not exist.");return t.dimensions}import{validate as Ue}from"uuid";import{ManifestClient as Ae}from"@uniformdev/context/api";var j=async t=>{if(!t)return{valid:!1,error:new Error("contextConfig was not defined.")};if(!t.apiHost)return{valid:!1,error:new Error("apiHost was not defined.")};if(!t.apiKey)return{valid:!1,error:new Error("apiKey was not defined.")};if(!Ue(t.apiKey)&&!t.projectId)return{valid:!1,error:new Error("projectId is required when using a modern API key.")};let n=new Ae({projectId:t.projectId,apiKey:t.apiKey,apiHost:t.apiHost});try{let r=await n.get({preview:!0});return{valid:!0,result:r}}catch(r){return{valid:!1,error:r}}};import{useEffect as Be,useState as Oe}from"react";var Ft=t=>{let[n,r]=Oe({validating:!1,error:void 0}),{apiKey:s,apiHost:a,projectId:o}=t||{};return Be(()=>{if(!s||!a)return;(async()=>{r({validating:!0,error:void 0});let{error:i,result:d}=await j({apiHost:a,apiKey:s,projectId:o});r(i?{error:i,validating:!1}:{error:void 0,validating:!1,result:d})})()},[a,s,o]),{validating:n.validating,error:n.error,result:n.result}};function Xt(t){return Array.isArray(t)&&t.length>0&&t[0].cat!==void 0}function Yt(t){return t.crit!==void 0}export*from"@uniformdev/design-system";export{$t as ContextData,U as EditLink,st as EnrichmentTag,Ct as PersonalizationCriteria,Rt as ProjectUIVersion,ge as addEnrichmentLink,Ie as equality,Xt as isEnrichmentTagData,Yt as isPersonalizationCriteriaData,zt as useContextConfig,I as useContextData,k as useDimensions,At as useDimensionsDataContext,Ut as useManifest,Ft as useValidateContextConfig,j as validateContextConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/context-ui",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.1-alpha.139+190bc76f4",
|
|
4
4
|
"description": "React-based functionality and components for Uniform Context",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"storybook:publish": "pnpm build && pnpm build-storybook -o ./out"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@emotion/react": "11.9.
|
|
38
|
-
"@uniformdev/context": "^16.1.
|
|
39
|
-
"@uniformdev/design-system": "^16.1.
|
|
40
|
-
"immer": "9.0.
|
|
37
|
+
"@emotion/react": "11.9.3",
|
|
38
|
+
"@uniformdev/context": "^16.1.1-alpha.139+190bc76f4",
|
|
39
|
+
"@uniformdev/design-system": "^16.1.1-alpha.139+190bc76f4",
|
|
40
|
+
"immer": "9.0.15",
|
|
41
41
|
"react-beautiful-dnd": "13.1.0",
|
|
42
42
|
"react-icons": "^4.3.1",
|
|
43
43
|
"react-select": "5.3.2",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"react-dom": ">=16.8"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@babel/core": "7.18.
|
|
55
|
-
"@babel/preset-env": "7.18.
|
|
54
|
+
"@babel/core": "7.18.5",
|
|
55
|
+
"@babel/preset-env": "7.18.2",
|
|
56
56
|
"@babel/preset-react": "7.17.12",
|
|
57
57
|
"@emotion/babel-preset-css-prop": "11.2.0",
|
|
58
|
-
"@storybook/addon-controls": "6.5.
|
|
59
|
-
"@storybook/addon-essentials": "6.5.
|
|
58
|
+
"@storybook/addon-controls": "6.5.9",
|
|
59
|
+
"@storybook/addon-essentials": "6.5.9",
|
|
60
60
|
"@storybook/addon-postcss": "2.0.0",
|
|
61
|
-
"@storybook/builder-webpack5": "6.5.
|
|
62
|
-
"@storybook/manager-webpack5": "6.5.
|
|
63
|
-
"@storybook/react": "6.5.
|
|
64
|
-
"@types/react": "18.0.
|
|
61
|
+
"@storybook/builder-webpack5": "6.5.9",
|
|
62
|
+
"@storybook/manager-webpack5": "6.5.9",
|
|
63
|
+
"@storybook/react": "6.5.9",
|
|
64
|
+
"@types/react": "18.0.12",
|
|
65
65
|
"@types/react-beautiful-dnd": "13.1.2",
|
|
66
66
|
"@types/uuid": "8.3.4",
|
|
67
67
|
"autoprefixer": "10.4.7",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "190bc76f4f0d6e3c1a61fbbd8e9abe8a0571f85a"
|
|
81
81
|
}
|