@uniformdev/context-devtools 14.2.1-alpha.249 → 14.2.1-alpha.256
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/esm/index.js +78 -72
- package/dist/index.js +70 -64
- package/package.json +3 -3
package/dist/esm/index.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 y from"react";import{css as R}from"@emotion/react";import{createContext as it,useContext as at}from"react";var Ce=it({settings:{},saveSettings:()=>null}),we=()=>at(Ce),xe=({children:t,settings:n,saveSettings:r})=>e(Ce.Provider,{value:{settings:n,saveSettings:r}},t);var st=({route:t,children:n,className:r})=>{let{settings:o,saveSettings:i}=we();return e("a",{href:"",className:r,onClick:a=>{a.preventDefault(),i({...o,route:t})}},n)},P=st;var ct=[{title:"Dimensions",href:"/dimensions",icon:`<svg
|
|
2
2
|
width="24"
|
|
3
3
|
height="24"
|
|
4
4
|
viewBox="0 0 24 24"
|
|
@@ -36,21 +36,21 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
36
36
|
</svg>`},{title:"Settings",href:"/settings",icon:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
37
37
|
<path d="M19.1469 12.716C19.1986 12.2636 19.201 11.8069 19.1539 11.354L21.7429 9.474C21.8681 9.3822 21.9548 9.24723 21.9862 9.0952C22.0176 8.94316 21.9915 8.78489 21.9129 8.651L19.9939 5.399C19.9182 5.26986 19.7985 5.17231 19.6568 5.1242C19.515 5.07608 19.3606 5.08063 19.2219 5.137L16.3599 6.292C15.9237 5.9578 15.4502 5.67525 14.9489 5.45L14.5739 2.545C14.5547 2.39441 14.4813 2.25598 14.3673 2.15566C14.2534 2.05534 14.1068 1.99999 13.9549 2H10.0859C9.93402 1.99997 9.78728 2.05527 9.67317 2.15558C9.55906 2.25588 9.48539 2.39432 9.46595 2.545L9.09395 5.433C8.63957 5.63249 8.20723 5.87882 7.80395 6.168L5.00895 4.954C4.87173 4.89484 4.71787 4.88672 4.57519 4.9311C4.4325 4.97549 4.3104 5.06945 4.23095 5.196L2.22195 8.398C2.1396 8.52998 2.10934 8.68789 2.13707 8.84096C2.1648 8.99403 2.24854 9.1313 2.37195 9.226L4.86795 11.142C4.83172 11.4266 4.81302 11.7131 4.81195 12C4.81195 12.18 4.82095 12.362 4.83795 12.558L2.26495 14.375C2.13766 14.4647 2.04844 14.5987 2.01478 14.7508C1.98112 14.9028 2.00543 15.0619 2.08295 15.197L3.95695 18.474C4.11095 18.742 4.43695 18.857 4.72595 18.746L7.56095 17.644C8.00795 17.997 8.49195 18.294 9.00795 18.53L9.33795 21.396C9.37495 21.709 9.63795 21.946 9.95195 21.95L13.8169 22H13.8249C14.1349 22 14.3989 21.771 14.4439 21.463L14.8549 18.59C15.3703 18.3674 15.8579 18.0855 16.3079 17.75L19.1279 18.93C19.4129 19.05 19.7419 18.944 19.9029 18.679L21.8669 15.452C21.9477 15.319 21.976 15.1608 21.9464 15.0081C21.9168 14.8554 21.8315 14.7192 21.7069 14.626L19.1469 12.716ZM11.9999 15C10.3459 15 8.99995 13.655 8.99995 12C8.99995 10.346 10.3449 9 11.9999 9C13.6539 9 14.9999 10.345 14.9999 12C14.9999 13.654 13.6539 15 11.9999 15Z" fill="white"/>
|
|
38
38
|
</svg>
|
|
39
|
-
`}],ke=({...t})=>{let n=r=>{var i;let o="active";return!((i=t.settings)!=null&&i.route)&&r==="/dimensions"||t.settings.route===r?o:""};return e("nav",{css:
|
|
39
|
+
`}],ke=({...t})=>{let n=r=>{var i;let o="active";return!((i=t.settings)!=null&&i.route)&&r==="/dimensions"||t.settings.route===r?o:""};return e("nav",{css:R`
|
|
40
40
|
background: var(--brand-secondary-1);
|
|
41
41
|
padding: var(--spacing-base);
|
|
42
42
|
min-width: 200px;
|
|
43
|
-
`},e(
|
|
43
|
+
`},e(P,{css:R`
|
|
44
44
|
display: inline-block;
|
|
45
45
|
margin: 0 var(--spacing-base);
|
|
46
|
-
`,route:"/settings"},e("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{clipPath:"url(#clip0_41_612)"},e("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),e("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),e("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),e("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),e("defs",null,e("clipPath",{id:"clip0_41_612"},e("rect",{width:"120",height:"38",fill:"white"}))))),e("ul",{css:
|
|
46
|
+
`,route:"/settings"},e("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{clipPath:"url(#clip0_41_612)"},e("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),e("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),e("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),e("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),e("defs",null,e("clipPath",{id:"clip0_41_612"},e("rect",{width:"120",height:"38",fill:"white"}))))),e("ul",{css:R`
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-flow: column nowrap;
|
|
49
49
|
padding: 0;
|
|
50
50
|
margin: 0;
|
|
51
51
|
list-style-type: none;
|
|
52
52
|
height: calc(100% - var(--spacing-base) * 2.5);
|
|
53
|
-
`},
|
|
53
|
+
`},ct.map((r,o)=>e("li",{css:R`
|
|
54
54
|
padding: 0;
|
|
55
55
|
margin: 0;
|
|
56
56
|
list-style-type: none;
|
|
@@ -58,7 +58,7 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
58
58
|
&:last-of-type {
|
|
59
59
|
margin-top: auto;
|
|
60
60
|
}
|
|
61
|
-
`,key:o},e(
|
|
61
|
+
`,key:o},e(P,{css:R`
|
|
62
62
|
align-items: center;
|
|
63
63
|
border-radius: var(--rounded-base);
|
|
64
64
|
display: flex;
|
|
@@ -72,10 +72,10 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
72
72
|
&.active {
|
|
73
73
|
background: var(--gray-700);
|
|
74
74
|
}
|
|
75
|
-
`,className:n(r.href),route:r.href},e("i",{css:
|
|
75
|
+
`,className:n(r.href),route:r.href},e("i",{css:R`
|
|
76
76
|
align-items: center;
|
|
77
77
|
display: flex;
|
|
78
|
-
`,dangerouslySetInnerHTML:{__html:r.icon}}),r.title,r.href==="/overrides"&&Object.keys(t.overrides.scores).length>0&&e("span",{css:
|
|
78
|
+
`,dangerouslySetInnerHTML:{__html:r.icon}}),r.title,r.href==="/overrides"&&Object.keys(t.overrides.scores).length>0&&e("span",{css:R`
|
|
79
79
|
font-size: var(--font-xxs);
|
|
80
80
|
display: inline-block;
|
|
81
81
|
width: 12px;
|
|
@@ -83,11 +83,11 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
83
83
|
border-radius: 6px;
|
|
84
84
|
background-color: var(--red-tooltip);
|
|
85
85
|
text-align: center;
|
|
86
|
-
`},Object.keys(t.overrides.scores).length))))))};var Le=()=>e("article",null,e("h1",null,"Something when wrong"),e("p",null,"We could not find the page you're looking for."));import*as te from"react";import{css as
|
|
86
|
+
`},Object.keys(t.overrides.scores).length))))))};var Le=()=>e("article",null,e("h1",null,"Something when wrong"),e("p",null,"We could not find the page you're looking for."));import*as te from"react";import{css as A}from"@emotion/react";import*as W from"react";var Te=A({willChange:"height"}),dt=A`
|
|
87
87
|
border-bottom: 2px solid var(--brand-secondary-1);
|
|
88
88
|
font-size: var(--font-base);
|
|
89
89
|
margin: 0;
|
|
90
|
-
`,lt=
|
|
90
|
+
`,lt=A`
|
|
91
91
|
align-items: center;
|
|
92
92
|
border: none;
|
|
93
93
|
background: none;
|
|
@@ -97,13 +97,13 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
97
97
|
padding: var(--spacing-sm) 0;
|
|
98
98
|
font-weight: var(--font-bold);
|
|
99
99
|
justify-content: space-between;
|
|
100
|
-
`,
|
|
100
|
+
`,pt=A`
|
|
101
101
|
align-self: center;
|
|
102
|
-
`,
|
|
102
|
+
`,mt=A`
|
|
103
103
|
transform: rotate(-180deg);
|
|
104
|
-
`,
|
|
104
|
+
`,E=({children:t})=>e("div",{css:[Te]},t),O=({title:t,children:n})=>{let[r,o]=W.useState(!1),i=t.split(" ").join("-").toLocaleLowerCase();return e(W.Fragment,null,e("h3",{css:dt},e("button",{"aria-expanded":r,css:lt,title:t,id:i,"aria-controls":`${i}-section`,onClick:()=>o(a=>!a),type:"button"},t,e("i",{css:[pt,r?mt:void 0]},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"}))))),e("div",{id:`${i}-section`,css:[Te,A`
|
|
105
105
|
padding: var(--spacing-sm) 0;
|
|
106
|
-
`],role:"region","aria-labelledby":i},r?n:null))};import{css as
|
|
106
|
+
`],role:"region","aria-labelledby":i},r?n:null))};import{css as M}from"@emotion/react";import*as De from"react";var ut=M`
|
|
107
107
|
align-items: center;
|
|
108
108
|
border: 1px solid transparent;
|
|
109
109
|
cursor: pointer;
|
|
@@ -114,29 +114,29 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
114
114
|
&:hover {
|
|
115
115
|
opacity: 0.8;
|
|
116
116
|
}
|
|
117
|
-
`;function
|
|
117
|
+
`;function gt(t){let n=M`
|
|
118
118
|
color: var(--white);
|
|
119
|
-
`,r=
|
|
119
|
+
`,r=M`
|
|
120
120
|
font-weight: var(--font-bold);
|
|
121
|
-
`;switch(t){case"primary":return
|
|
121
|
+
`;switch(t){case"primary":return M`
|
|
122
122
|
background: var(--brand-secondary-1);
|
|
123
123
|
${n}
|
|
124
124
|
${r}
|
|
125
|
-
`;case"secondary":return
|
|
125
|
+
`;case"secondary":return M`
|
|
126
126
|
background: var(--brand-secondary-5);
|
|
127
127
|
${n}
|
|
128
128
|
${r}
|
|
129
|
-
`;case"unimportant":return
|
|
129
|
+
`;case"unimportant":return M`
|
|
130
130
|
background: var(--brand-secondary-3);
|
|
131
131
|
color: var(--brand-secondary-1);
|
|
132
132
|
${r}
|
|
133
|
-
`;case"ghost":return
|
|
133
|
+
`;case"ghost":return M`
|
|
134
134
|
background: transparent;
|
|
135
135
|
color: var(--brand-secondary-5);
|
|
136
136
|
&:hover {
|
|
137
137
|
border: 1px solid var(--brand-secondary-5);
|
|
138
138
|
}
|
|
139
|
-
`}}var w=({buttonType:t="primary",children:n,className:r,...o})=>e(De.Fragment,null,e("button",{type:"button",css:[
|
|
139
|
+
`}}var w=({buttonType:t="primary",children:n,className:r,...o})=>e(De.Fragment,null,e("button",{type:"button",css:[ut,gt(t)],className:r,...o},n));import{css as z}from"@emotion/react";var q=z`
|
|
140
140
|
background-color: var(--gray-100);
|
|
141
141
|
padding: var(--spacing-base) var(--spacing-md);
|
|
142
142
|
margin: var(--spacing-base) 0;
|
|
@@ -144,21 +144,21 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
144
144
|
&:first-of-type {
|
|
145
145
|
margin: 0 0 var(--spacing-base);
|
|
146
146
|
}
|
|
147
|
-
`,Se=
|
|
147
|
+
`,Se=z`
|
|
148
148
|
background: var(--gray-100)
|
|
149
149
|
url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%0A%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 2C8.44771 2 8 2.44772 8 3V5C8 5.55228 8.44771 6 9 6C9.55229 6 10 5.55228 10 5V3C10 2.44772 9.55229 2 9 2ZM8 9H16V11C16 13.2091 14.2091 15 12 15C9.79086 15 8 13.2091 8 11V9ZM13 16.917C15.8377 16.441 18 13.973 18 11V7H6V11C6 13.973 8.16229 16.441 11 16.917V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V16.917ZM14 3C14 2.44772 14.4477 2 15 2C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6C14.4477 6 14 5.55228 14 5V3Z' fill='%232ecdb4' /%3E%3C/svg%3E")
|
|
150
150
|
no-repeat var(--spacing-sm) var(--spacing-base);
|
|
151
151
|
padding: var(--spacing-base) var(--spacing-xl);
|
|
152
|
-
`,
|
|
152
|
+
`,Y=z`
|
|
153
153
|
color: var(--brand-secondary-1);
|
|
154
154
|
margin: 0;
|
|
155
155
|
font-size: var(--font-base);
|
|
156
156
|
font-weight: var(--font-bold);
|
|
157
|
-
`,
|
|
157
|
+
`,X=z`
|
|
158
158
|
color: var(--brand-secondary-1);
|
|
159
159
|
margin: var(--spacing-xs) 0 0;
|
|
160
160
|
font-size: var(--font-sm);
|
|
161
|
-
`,Ie=
|
|
161
|
+
`,Ie=z`
|
|
162
162
|
align-items: center;
|
|
163
163
|
border: none;
|
|
164
164
|
background: transparent
|
|
@@ -178,22 +178,22 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
178
178
|
&:hover {
|
|
179
179
|
opacity: 0.6;
|
|
180
180
|
}
|
|
181
|
-
`,
|
|
181
|
+
`,J=z`
|
|
182
182
|
display: flex;
|
|
183
183
|
margin: var(--spacing-sm) 0 0;
|
|
184
184
|
gap: var(--spacing-base);
|
|
185
|
-
`;var B=({title:t,text:n,buttonGroup:r,children:o})=>e("div",{css:
|
|
185
|
+
`;var B=({title:t,text:n,buttonGroup:r,children:o})=>e("div",{css:q},e("h2",{css:Y},t),e("p",{css:X},n),o,r?e("div",{css:J},r):null);import{css as _}from"@emotion/react";var de=_`
|
|
186
186
|
align-items: center;
|
|
187
187
|
cursor: pointer;
|
|
188
188
|
display: flex;
|
|
189
189
|
gap: var(--spacing-xs);
|
|
190
190
|
margin-top: var(--spacing-base);
|
|
191
|
-
`,
|
|
191
|
+
`,le=_`
|
|
192
192
|
color: var(--gray-500);
|
|
193
193
|
font-size: var(--font-sm);
|
|
194
|
-
`,
|
|
194
|
+
`,Po=_`
|
|
195
195
|
background: var(--gray-600);
|
|
196
|
-
`,pe=
|
|
196
|
+
`,pe=_`
|
|
197
197
|
display: block;
|
|
198
198
|
background: var(--gray-400);
|
|
199
199
|
border-radius: var(--rounded-full);
|
|
@@ -214,7 +214,7 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
214
214
|
transform: translateX(2px);
|
|
215
215
|
transition: transform 0.2s ease-in-out, background-color 0.3s ease-in-out;
|
|
216
216
|
}
|
|
217
|
-
`,me=
|
|
217
|
+
`,me=_`
|
|
218
218
|
overflow: hidden;
|
|
219
219
|
clip: rect(0, 0, 0, 0);
|
|
220
220
|
height: 0;
|
|
@@ -228,21 +228,21 @@ import{jsx as e}from"@emotion/react";import*as v from"react";import{css as P}fro
|
|
|
228
228
|
&:checked ~ span {
|
|
229
229
|
background: var(--brand-secondary-5);
|
|
230
230
|
}
|
|
231
|
-
`;var Pe=({label:t,...n})=>e("label",{css:
|
|
231
|
+
`;var Pe=({label:t,...n})=>e("label",{css:de},e("span",{css:le},t),e("input",{type:"checkbox",css:me,...n}),e("span",{css:pe})),ue=({field:t,form:n,meta:r,...o})=>{let{label:i}=o;return e("label",{css:de},e("span",{css:le},i),e("input",{type:"checkbox",css:me,checked:t.value,...t}),e("span",{css:pe}))};import{css as k,keyframes as ft}from"@emotion/react";var bt=ft`from {
|
|
232
232
|
transform: scale(1);
|
|
233
233
|
}
|
|
234
234
|
to {
|
|
235
235
|
transform: scale(1.2);
|
|
236
236
|
}
|
|
237
|
-
`,h={page:
|
|
237
|
+
`,h={page:k`
|
|
238
238
|
color: var(--brand-secondary-1);
|
|
239
|
-
`,text:
|
|
239
|
+
`,text:k`
|
|
240
240
|
margin: var(--spacing-sm) 0;
|
|
241
|
-
`,reset:
|
|
241
|
+
`,reset:k`
|
|
242
242
|
margin: 0 var(--spacing-md);
|
|
243
243
|
font-size: var(--font-sm);
|
|
244
244
|
color: var(--gray-500);
|
|
245
|
-
`,title:
|
|
245
|
+
`,title:k`
|
|
246
246
|
margin: 0 0 var(--spacing-sm);
|
|
247
247
|
font-size: var(--font-md);
|
|
248
248
|
& > small {
|
|
@@ -251,12 +251,12 @@ to {
|
|
|
251
251
|
font-weight: var(--font-regular);
|
|
252
252
|
margin: var(--spacing-xxs) 0 0;
|
|
253
253
|
}
|
|
254
|
-
`,headingGroup:
|
|
254
|
+
`,headingGroup:k`
|
|
255
255
|
align-items: baseline;
|
|
256
256
|
display: flex;
|
|
257
257
|
justify-content: space-between;
|
|
258
258
|
align-items: center;
|
|
259
|
-
`,divider:
|
|
259
|
+
`,divider:k`
|
|
260
260
|
background: var(--gray-300);
|
|
261
261
|
display: block;
|
|
262
262
|
width: 1px;
|
|
@@ -264,45 +264,51 @@ to {
|
|
|
264
264
|
position: absolute;
|
|
265
265
|
inset: 0 auto 0 0;
|
|
266
266
|
margin: auto 0;
|
|
267
|
-
`,submitButton:
|
|
267
|
+
`,submitButton:k`
|
|
268
268
|
position: absolute;
|
|
269
269
|
right: var(--spacing-base);
|
|
270
270
|
bottom: var(--spacing-base);
|
|
271
|
-
animation: 0.5s 2 alternate ${
|
|
272
|
-
`,
|
|
271
|
+
animation: 0.5s 2 alternate ${bt};
|
|
272
|
+
`,cancelButton:k`
|
|
273
|
+
position: absolute;
|
|
274
|
+
left: calc(200px + var(--spacing-base));
|
|
275
|
+
bottom: var(--spacing-base);
|
|
276
|
+
background: white;
|
|
277
|
+
padding: var(--spacing-sm);
|
|
278
|
+
`,error:k`
|
|
273
279
|
color: var(--brand-secondary-5);
|
|
274
280
|
font-size: var(--font-sm);
|
|
275
|
-
`};import{css as
|
|
281
|
+
`};import{css as L}from"@emotion/react";var j=({children:t})=>e("table",{css:L`
|
|
276
282
|
border-collapse: collapse;
|
|
277
283
|
display: table;
|
|
278
284
|
width: 100%;
|
|
279
285
|
font-size: var(--font-sm);
|
|
280
|
-
`},t),Re=({children:t})=>e("thead",{css:
|
|
286
|
+
`},t),Re=({children:t})=>e("thead",{css:L`
|
|
281
287
|
background: var(--gray-50);
|
|
282
288
|
text-align: left;
|
|
283
289
|
& tr {
|
|
284
290
|
border-bottom: 1px solid var(--gray-200);
|
|
285
291
|
}
|
|
286
|
-
`},t),
|
|
292
|
+
`},t),ee=({children:t})=>e("tbody",null,t),G=({border:t,children:n})=>e("tr",{css:t?L`
|
|
287
293
|
border-bottom: 1px solid var(--gray-200);
|
|
288
294
|
&:where(:last-child) {
|
|
289
295
|
border: none;
|
|
290
296
|
}
|
|
291
|
-
`:void 0},n),ge=({children:t})=>e("th",{css:
|
|
297
|
+
`:void 0},n),ge=({children:t})=>e("th",{css:L`
|
|
292
298
|
outline: none;
|
|
293
299
|
padding: var(--spacing-sm);
|
|
294
|
-
`},t);function
|
|
300
|
+
`},t);function vt(t){switch(t){case"light":return L`
|
|
295
301
|
color: var(--gray-400);
|
|
296
|
-
`;case"dark":return
|
|
302
|
+
`;case"dark":return L`
|
|
297
303
|
color: var(--brand-secondary-1);
|
|
298
|
-
`}}function
|
|
304
|
+
`}}function ht(t){return L`
|
|
299
305
|
text-align: ${t};
|
|
300
|
-
`}var
|
|
306
|
+
`}var T=({alignment:t="left",border:n,color:r="dark",children:o})=>e("td",{css:[L`
|
|
301
307
|
padding: var(--spacing-base);
|
|
302
308
|
max-width: 180px;
|
|
303
309
|
overflow-wrap: break-word;
|
|
304
310
|
position: relative;
|
|
305
|
-
`,
|
|
311
|
+
`,vt(r),ht(t),n?L`
|
|
306
312
|
border-left: 1px solid var(--gray-200);
|
|
307
313
|
`:void 0]},o);import{css as fe}from"@emotion/react";var Me=fe`
|
|
308
314
|
position: relative;
|
|
@@ -318,11 +324,11 @@ to {
|
|
|
318
324
|
top: 9px;
|
|
319
325
|
background: var(--red-tooltip);
|
|
320
326
|
border-radius: 3px;
|
|
321
|
-
`;import{css as
|
|
327
|
+
`;import{css as yt}from"@emotion/react";var Ct=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
322
328
|
<path d="M4.2 7.2C4.53137 7.2 4.8 6.93137 4.8 6.6C4.8 6.26863 4.53137 6 4.2 6C3.86863 6 3.6 6.26863 3.6 6.6C3.6 6.93137 3.86863 7.2 4.2 7.2Z" fill="#828282"/>
|
|
323
329
|
<path d="M8.4 6.6C8.4 6.93137 8.13137 7.2 7.8 7.2C7.46863 7.2 7.2 6.93137 7.2 6.6C7.2 6.26863 7.46863 6 7.8 6C8.13137 6 8.4 6.26863 8.4 6.6Z" fill="#828282"/>
|
|
324
330
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM6 10.8C8.65097 10.8 10.8 8.65097 10.8 6C10.8 5.49824 10.723 5.01447 10.5802 4.55984C10.0795 4.69533 9.55274 4.76763 9.00913 4.76763C6.77526 4.76763 4.82652 3.54683 3.79366 1.73601C2.25282 2.53492 1.2 4.14451 1.2 6C1.2 8.65097 3.34903 10.8 6 10.8Z" fill="#828282"/>
|
|
325
|
-
</svg>`,
|
|
331
|
+
</svg>`,wt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
326
332
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.59995 5.05775C4.9254 5.05775 5.99992 3.98325 5.99992 2.65778C5.99992 1.33232 4.9254 0.257812 3.59995 0.257812C2.27448 0.257812 1.19998 1.33232 1.19998 2.65778C1.19998 3.98325 2.27448 5.05775 3.59995 5.05775ZM3.59999 3.85777C4.26272 3.85777 4.79997 3.32052 4.79997 2.65778C4.79997 1.99505 4.26272 1.4578 3.59999 1.4578C2.93725 1.4578 2.4 1.99505 2.4 2.65778C2.4 3.32052 2.93725 3.85777 3.59999 3.85777Z" fill="#828282"/>
|
|
327
333
|
<path d="M5.39993 6.8577C5.73131 6.8577 5.99993 7.12632 5.99993 7.45769V11.0576H7.19991V7.45769C7.19991 6.46356 6.39406 5.65771 5.39993 5.65771H1.79998C0.80588 5.65771 0 6.46356 0 7.45769V11.0576H1.19999V7.45769C1.19999 7.12632 1.46861 6.8577 1.79998 6.8577H5.39993Z" fill="#828282"/>
|
|
328
334
|
<path d="M11.9999 5.05762H8.3999V6.2576H11.9999V5.05762Z" fill="#828282"/>
|
|
@@ -334,10 +340,10 @@ to {
|
|
|
334
340
|
<path d="M9.36269 2.7856C9.93846 3.36136 10.2946 4.15676 10.2946 5.03535C10.2946 6.06973 9.80096 6.98882 9.03643 7.5699L9.94228 8.47575C10.9345 7.65881 11.5672 6.42096 11.5672 5.03535C11.5672 3.80533 11.0687 2.69177 10.2626 1.88571L9.36269 2.7856Z" fill="#828282"/>
|
|
335
341
|
<path d="M0.113525 5.03534C0.113525 3.10251 0.896953 1.35266 2.16359 0.0860049L3.06347 0.985892C2.02714 2.02224 1.38616 3.45394 1.38616 5.03534C1.38616 6.61674 2.02714 8.04844 3.06347 9.08479L2.16358 9.98468C0.89695 8.71802 0.113525 6.96817 0.113525 5.03534Z" fill="#828282"/>
|
|
336
342
|
<path d="M12.0624 9.98474C13.329 8.71809 14.1125 6.96821 14.1125 5.03534C14.1125 3.10248 13.329 1.3526 12.0624 0.0859375L11.1625 0.985824C12.1988 2.02218 12.8398 3.4539 12.8398 5.03534C12.8398 6.61678 12.1988 8.0485 11.1625 9.08486L12.0624 9.98474Z" fill="#828282"/>
|
|
337
|
-
</svg>`,
|
|
343
|
+
</svg>`,Ee=({type:t})=>{let n="";switch(t){case"Audience":n=Ct;break;case"Signal":n=Ae;break;case"Intent":n=Ae;break;case"Enrichment":n=wt;break}return e("i",{css:yt`
|
|
338
344
|
align-items: center;
|
|
339
345
|
display: inline-block;
|
|
340
|
-
`,dangerouslySetInnerHTML:{__html:n}})};var
|
|
346
|
+
`,dangerouslySetInnerHTML:{__html:n}})};var xt=({dimensionIndex:t,dimensions:n,overrides:r,disableEditOverride:o,onClick:i})=>e(j,null,e(ee,null,Object.entries(n).map(([a,u])=>{var m;let{dim:g,name:c,type:s,category:d}=(m=t[a])!=null?m:{name:a,dim:a,type:void 0,category:void 0};return e(G,{key:g},e(T,null,r.scores[g]!==void 0&&e("s",{css:Ve},u-r.scores[g]),e("b",{css:Me},u,r.scores[g]!==void 0&&e("i",{css:He}))),e(T,null,e("div",{onClick:()=>i==null?void 0:i(g),css:i?{cursor:"pointer"}:void 0},e("span",{css:h.divider,role:"presentation"}),e("div",null,e(Ee,{type:s})," ",s),e("strong",null,d?`${d}:`:""," ",c))),e(T,{alignment:"right",color:"light"},r.scores[g]!==void 0&&!o?e(P,{route:`/overrides/${g}`},"Edit override"):null))}))),V=xt;import{css as kt}from"@emotion/react";var Lt=kt`
|
|
341
347
|
background: none;
|
|
342
348
|
border: none;
|
|
343
349
|
color: var(--brand-secondary-3);
|
|
@@ -346,7 +352,7 @@ to {
|
|
|
346
352
|
font-weight: var(--font-bold);
|
|
347
353
|
margin-left: auto;
|
|
348
354
|
font-size: var(--font-sm);
|
|
349
|
-
`,
|
|
355
|
+
`,N=({children:t,...n})=>e("button",{type:"button",css:Lt,...n},t);var Oe=({dimensionIndex:{index:t},state:{scores:n,data:r},overrides:o,actions:i})=>{let a=te.useMemo(()=>{let s={};return Object.keys(t).filter(d=>!n[d]).map(d=>{s[t[d].dim]=0}),s},[n,t]),u=Object.keys(n).length,g=u+Object.keys(a).length,c=()=>{i.rawUpdate([{type:"setcontrol",data:!r.controlGroup}])};return e(te.Fragment,null,e("article",{css:h.page},e("div",{css:h.headingGroup},e("h2",{css:h.title},"Dimensions",e("small",null,u," active of ",g)),e("div",{css:h.reset},e(N,{onClick:()=>i.resetOverrides().then(i.forget)},"clear all dimensions")),e(Pe,{label:"Control Group",onChange:c,checked:r.controlGroup})),u>0?e(V,{dimensionIndex:t,dimensions:n,overrides:o}):e(B,{title:r.controlGroup?"In control group":"No active dimensions",text:r.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have score in any dimensions yet.",buttonGroup:r.controlGroup?e(w,{buttonType:"secondary",onClick:c},"Exit control group"):null}),e(E,null,e(O,{title:`Inactive Dimensions (${Object.keys(a).length})`},e(V,{dimensionIndex:t,dimensions:a,overrides:o})))))};import*as ze from"react";import{css as Tt}from"@emotion/react";function be({onClick:t}){return e("button",{css:Tt`
|
|
350
356
|
width: 3.5rem;
|
|
351
357
|
height: 3.5rem;
|
|
352
358
|
display: flex;
|
|
@@ -359,7 +365,7 @@ to {
|
|
|
359
365
|
svg {
|
|
360
366
|
color: var(--red-button);
|
|
361
367
|
}
|
|
362
|
-
`,onClick:t,"aria-label":"Add new override",className:"text-secondary shadow-xl rounded-full flex items-center bg-secondary","data-test-id":"add-new-overrides-button"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66"},e("g",{fill:"none",fillRule:"evenodd"},e("circle",{cx:"33",cy:"33",r:"33",fill:"currentColor"}),e("g",{fill:"#FFF",transform:"translate(19 19)"},e("rect",{width:"4",height:"28",x:"12",rx:"2"}),e("path",{d:"M14,0 C15.1045695,-2.02906125e-16 16,0.8954305 16,2 L16,26 C16,27.1045695 15.1045695,28 14,28 C12.8954305,28 12,27.1045695 12,26 L12,2 C12,0.8954305 12.8954305,2.02906125e-16 14,0 Z",transform:"rotate(90 14 14)"})))))}var
|
|
368
|
+
`,onClick:t,"aria-label":"Add new override",className:"text-secondary shadow-xl rounded-full flex items-center bg-secondary","data-test-id":"add-new-overrides-button"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66"},e("g",{fill:"none",fillRule:"evenodd"},e("circle",{cx:"33",cy:"33",r:"33",fill:"currentColor"}),e("g",{fill:"#FFF",transform:"translate(19 19)"},e("rect",{width:"4",height:"28",x:"12",rx:"2"}),e("path",{d:"M14,0 C15.1045695,-2.02906125e-16 16,0.8954305 16,2 L16,26 C16,27.1045695 15.1045695,28 14,28 C12.8954305,28 12,27.1045695 12,26 L12,2 C12,0.8954305 12.8954305,2.02906125e-16 14,0 Z",transform:"rotate(90 14 14)"})))))}var Be=({dimensionIndex:{index:t},state:{data:n,scores:r},overrides:o,actions:i,settings:a,saveSettings:u})=>{let g=o.scores?Object.keys(o.scores).length:0,c=m=>(m.preventDefault(),u({...a,route:"/overrides/add"})),s=()=>{i.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])},d={};return Object.entries(r).map(([m,b])=>{o.scores[m]!==void 0&&(d[m]=b)}),e(ze.Fragment,null,e("article",{css:h.page},e("div",{css:h.headingGroup},e("h2",{css:h.title},"What if?"),e("div",{css:h.reset},e(N,{onClick:i.resetOverrides},"delete all overrides")),e(be,{onClick:c})),e("p",null,"Override dimension scores to test personalization"),g>0?e(V,{dimensionIndex:t,dimensions:d,overrides:o,onClick:m=>u({...a,route:`/overrides/${m}`})}):e(B,{title:n.controlGroup?"In control group":"No overrides",text:n.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have any dimension overrides yet.",buttonGroup:n.controlGroup?e(w,{buttonType:"secondary",onClick:s},"Exit control group"):null})))};import{Field as At,Form as Et,Formik as Ot}from"formik";import*as Q from"yup";import{ErrorMessage as Dt}from"formik";import{css as D}from"@emotion/react";var oe=D`
|
|
363
369
|
background: var(--white);
|
|
364
370
|
border: 1px solid var(--gray-500);
|
|
365
371
|
border-radius: var(--rounded-base);
|
|
@@ -370,7 +376,7 @@ to {
|
|
|
370
376
|
cursor: not-allowed;
|
|
371
377
|
color: var(--gray-200);
|
|
372
378
|
}
|
|
373
|
-
`,re=
|
|
379
|
+
`,re=D`
|
|
374
380
|
appearance: none;
|
|
375
381
|
background: var(--white)
|
|
376
382
|
url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNi4zNDMxNyA3Ljc1NzMyTDQuOTI4OTYgOS4xNzE1NEwxMiAxNi4yNDI2TDE5LjA3MTEgOS4xNzE1N0wxNy42NTY5IDcuNzU3MzVMMTIgMTMuNDE0Mkw2LjM0MzE3IDcuNzU3MzJaIgogICAgZmlsbD0iIzgyODI4MiIKICAvPgo8L3N2Zz4=')
|
|
@@ -383,29 +389,29 @@ to {
|
|
|
383
389
|
cursor: not-allowed;
|
|
384
390
|
color: var(--gray-200);
|
|
385
391
|
}
|
|
386
|
-
`,ne=
|
|
392
|
+
`,ne=D`
|
|
387
393
|
padding: var(--spacing-sm);
|
|
388
394
|
max-width: 160px;
|
|
389
|
-
`,ie=
|
|
395
|
+
`,ie=D`
|
|
390
396
|
margin: var(--spacing-base) 0;
|
|
391
|
-
`,
|
|
397
|
+
`,F=D`
|
|
392
398
|
color: var(--brand-secondary-1);
|
|
393
399
|
display: flex;
|
|
394
400
|
flex-direction: column;
|
|
395
401
|
margin: 0 0 var(--spacing-sm);
|
|
396
|
-
`,
|
|
402
|
+
`,Z=D`
|
|
397
403
|
color: var(--brand-secondary-1);
|
|
398
404
|
display: block;
|
|
399
405
|
flex: 1 100%;
|
|
400
406
|
font-weight: var(--font-bold);
|
|
401
407
|
margin: 0 0 var(--spacing-sm);
|
|
402
|
-
`,
|
|
408
|
+
`,U=D`
|
|
403
409
|
color: var(--gray-600);
|
|
404
410
|
font-size: var(--font-sm);
|
|
405
|
-
`,ae=
|
|
411
|
+
`,ae=D`
|
|
406
412
|
color: var(--brand-secondary-5);
|
|
407
413
|
display: block;
|
|
408
|
-
`,Ne=
|
|
414
|
+
`,Ne=D`
|
|
409
415
|
flex-direction: row;
|
|
410
416
|
flex-wrap: wrap;
|
|
411
417
|
|
|
@@ -473,15 +479,15 @@ to {
|
|
|
473
479
|
flex: 1 0 20%;
|
|
474
480
|
padding: 10px;
|
|
475
481
|
}
|
|
476
|
-
`;var Fe=({field:t,form:n,meta:r,...o})=>{let{label:i,options:a,caption:u,...g}=o;return e("div",{css:ie},e("label",{css:
|
|
482
|
+
`;var Fe=({field:t,form:n,meta:r,...o})=>{let{label:i,options:a,caption:u,...g}=o;return e("div",{css:ie},e("label",{css:F},e("span",{css:Z},i),e("select",{...t,...g,css:re},a.map((c,s)=>e("option",{value:c.value,key:s},c.text)))),u?e("span",{css:U},u):null,e(Dt,{component:"div",css:ae,name:t.name}))};import{Field as It}from"formik";var St=({field:t,form:n,meta:r,...o})=>{var s,d;let{label:i,caption:a,min:u=0,max:g=100,step:c}=o;return e("div",null,e("label",{css:[F,Ne]},e("span",{css:Z},i),e("input",{type:"range",min:u,max:g,step:c,...t,value:(s=t.value)!=null?s:0}),e("span",{className:"value-display"},(d=t.value)!=null?d:0)),e("p",{css:U},a))},Ze=St;var Pt=({name:t,label:n,dimensionToOverride:r,isSubmitting:o})=>{let i={max:100,step:20};return r&&(i.max=r.cap,i.step=r.str),e(It,{component:Ze,label:n,caption:`Range: 0 - ${i.max} in increments of ${i.step}`,id:t,name:t,disabled:o,...i})},Ue=Pt;import{css as Rt}from"@emotion/react";var H=({children:t,...n})=>e("fieldset",{css:Rt`
|
|
477
483
|
border: none;
|
|
478
484
|
padding: 0;
|
|
479
|
-
`,...n},t);import{css as
|
|
485
|
+
`,...n},t);import{css as Mt}from"@emotion/react";var $=({children:t})=>e("legend",{css:Mt`
|
|
480
486
|
font-size: var(--font-md);
|
|
481
487
|
font-weight: var(--font-bold);
|
|
482
488
|
border-bottom: 1px solid var(--gray-400);
|
|
483
489
|
width: 100%;
|
|
484
|
-
`},t);var
|
|
490
|
+
`},t);import{Context as Vt,TransitionDataStore as Ht}from"@uniformdev/context";function Qe({manifest:t,visitor:n,override:r}){let o=new Vt({manifest:t,transitionStore:new _e({initialData:n})}),i={...o.scores};o.storage.updateData([r]);let u={...{...o.scores}};return Object.entries(u).forEach(([g,c])=>{i[g]===c&&delete u[g]}),u}var _e=class extends Ht{async handleDelete(){}async handleUpdateData(){}};var zt=Q.object({dimension:Q.string(),score:Q.number()}),ve=({settings:t,saveSettings:n,state:r,actions:o,dimensionIndex:{index:i}})=>{var c,s;let a=t.route?[...t.route.matchAll(/overrides\/(?!.*add)(\w+)?/g)]:[],u=a[0]?a[0][1]:"";if(!((c=r.manifest.project.pz)!=null&&c.sig))return e("p",null,"Error, manifest is broken or there is no signal to override.");let g=Object.entries(i).filter(([,d])=>d.type!=="Audience"&&d.type!=="Intent").map(([d,m])=>{let b=m.type?`${m.type}: `:"",f=m.category?`${m.category} - `:"",v=`${b}${f}${m.name}`;return{value:d,text:v}});return g.unshift({value:"_none",text:"Choose dimension to override"}),e(Ot,{initialValues:{dimension:u,score:(s=r.scores[u])!=null?s:0},validationSchema:zt,enableReinitialize:!0,onSubmit:d=>{var v,C,x;let m=(C=(v=i[d.dimension])==null?void 0:v.cap)!=null?C:0,f=Math.min(d.score,m)-((x=r.scores[d.dimension])!=null?x:0);o.override([{type:"modscore",data:{dimension:d.dimension,delta:f}}]),n({...t,route:"/overrides"})}},({dirty:d,isValid:m,isSubmitting:b,values:f})=>{var x;let v=Qe({manifest:r.manifest,visitor:r.data,override:{type:"modscore",data:{dimension:f.dimension,delta:f.score-((x=r.scores[f.dimension])!=null?x:0)}}}),C=f.score&&Object.keys(v).length>0;return e(Et,{css:h.page},e("h1",{css:h.title},"Override Dimension"),e(At,{component:Fe,label:"Dimension",id:"dimension",name:"dimension",options:g,disabled:b}),e("p",{css:h.text},e("small",null,"Audiences and Intents are aggregated from other dimension scores and cannot be overridden directly.")),f.dimension?e(Ue,{name:"score",label:"Score",dimensionToOverride:i[f.dimension],isSubmitting:b}):null,e(H,{disabled:b},C?e(E,null,e(O,{title:`Impacted Dimensions (${Object.keys(v).length})`},e(V,{dimensionIndex:i,dimensions:v,overrides:{quirks:{},scores:{[f.dimension]:f.score}},disableEditOverride:!0}))):null,d?e(w,{type:"submit",css:h.submitButton,disabled:!m},"Save"):null,e(P,{route:"/overrides",css:h.cancelButton},"Cancel")))})};import{useState as Ut}from"react";import{useState as Bt,useEffect as Nt}from"react";var Ft=({name:t,value:n,submit:r})=>{let[o,i]=Bt(n!=null?n:"");return Nt(()=>{i(n!=null?n:"")},[n]),e("div",{css:{display:"flex",gap:"var(--spacing-sm)"}},e("input",{type:"text",css:[oe,ne],name:t,value:o,onChange:u=>{i(u.target.value)}}),e(w,{buttonType:"primary",onClick:()=>r(t,o!=null?o:"")},"Save"))},Ge=Ft;var Zt=({name:t,value:n,submit:r,options:o})=>e("select",{name:t,defaultValue:n,onChange:a=>r(a.target.name,a.target.value),css:[re,ne]},e("option",{key:"_none",value:"_none"},"None"),(o!=null?o:[]).map(a=>e("option",{key:a.value,value:a.value},a.name))),$e=Zt;var Ke=({...t})=>{let{actions:n,quirksIndex:{index:r}}=t,[o,i]=Ut(""),a;o&&(a=r[o]);let u=(g,c)=>{i(""),n.override([{type:"setquirk",data:{key:g,value:c}}])};return e(y.Fragment,null,e("article",{css:h.page},e("h1",{css:h.title},"Quirks"),e("p",{css:h.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(r).length?e(j,null,e(Re,null,e(G,null,e(ge,null,"Key"),e(ge,null,"Value"),e(T,null,""))),e(ee,null,Object.values(r).map(({name:g,value:c,id:s})=>e(G,{key:s,border:"bottom"},e(T,null,e("strong",null,g)),e(T,null,o!==s&&e("span",{onClick:()=>{i(s)}},c),o===s&&a&&e(y.Fragment,null,a.options?e($e,{name:s,value:c,submit:u,options:a.options}):e(Ge,{name:s,value:c,submit:u}))),e(T,null,o?null:e(N,{onClick:()=>{i(s)}},e("small",null,"Override"))))))):e(B,{title:"No quirks configured",text:"There are currently no quirks setup. Try to connect to Uniform API to load additional information about Quirks and Quirks without defined value."})))};import{Field as K,Form as _t,Formik as Gt}from"formik";import{ErrorMessage as Qt}from"formik";var se=({field:t,form:n,meta:r,...o})=>{let{label:i,caption:a,...u}=o;return e("div",{css:ie},e("label",{css:F},e("span",{css:Z},i),e("input",{type:"text",css:oe,...t,...u})),a?e("span",{css:U},a):null,e(Qt,{component:"div",css:ae,name:t.name}))};import*as S from"yup";var $t=S.object({apiKey:S.string().matches(/^uf.+$/,"API keys start with `uf`, double check your API key"),apiHost:S.string().matches(/^https:\/\/(localhost:8889|([a-z]+\.)?uniform.app)$/,"API host must be a Uniform domain."),logging:S.boolean(),projectId:S.string().uuid(),consentMode:S.boolean()}),We=({settings:t,saveSettings:n,actions:r,state:{data:o},dimensionIndex:{error:i,loading:a}})=>{var u,g,c;return e(Gt,{initialValues:{apiHost:(u=t.apiHost)!=null?u:"",apiKey:(g=t.apiKey)!=null?g:"",projectId:(c=t.projectId)!=null?c:"",consentMode:!!o.consent,logging:t.logLevel!=="none"&&Boolean(t.logLevel)},validationSchema:$t,enableReinitialize:!0,onSubmit:s=>{n({...t,apiHost:s.apiHost,apiKey:s.apiKey,projectId:s.projectId,logLevel:s.logging?"debug":"none",consentMode:s.consentMode}),r.rawUpdate([{type:"consent",data:s.consentMode}])}},({dirty:s,isValid:d,isSubmitting:m})=>e(_t,{css:h.page},e("h1",{css:h.title},"Settings"),e(H,{disabled:m},e($,null,"Data Connection"),!a&&i?e("p",{css:h.error},"Unable to fetch data from Uniform",e("br",null),e("em",null,i.message)):null,e("p",{css:h.text},e("small",null,"Adding an API key and project ID enables richer dimension data to be shown. You must have access to the Uniform project to do this.")),e(K,{component:se,label:"Uniform API key",caption:"Generate an API key in your Uniform team settings. Grant only Context: Read Drafts permission.",id:"api-key",name:"apiKey",autoComplete:"off"}),e(K,{component:se,label:"Uniform Project ID",caption:"Available to copy after generating an API key",id:"project-id",name:"projectId",autoComplete:"off"}),e(E,null,e(O,{title:"Advanced"},e(K,{component:se,label:"Alternative API Host",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option.",id:"api-host",name:"apiHost",autoComplete:"off"}))),e(H,null,e($,null,"Storage Consent"),e(K,{component:ue,label:"Store visitor data",id:"consent-mode",name:"consentMode"}),e("p",null,e("small",null,"Turning on consents to storing behavior in this browser for personalization across sessions. Only affects this browser. Personalization works with this disabled, but dimension scores are lost on refresh."))),e(H,null,e($,null,"Logging"),e(K,{component:ue,label:"Write Uniform Context diagnostic logs to browser console",id:"logging",name:"logging"})),s?e(w,{type:"submit",css:h.submitButton,disabled:!d},"Save"):null)))};var he=({settings:t,saveSettings:n})=>{let r=()=>{n({...t,route:"/settings"})},o=()=>{n({...t,ignoreApiKeyPrompt:!0})},i=!(t!=null&&t.apiKey);return!t.ignoreApiKeyPrompt&&i?e("div",{css:[q,Se]},e("h2",{css:Y},"Connect this site"),e("p",{css:X},"Add a Uniform API key to get better data."),e("div",{css:J},e(w,{buttonType:"secondary",onClick:r},"Connect this site"),e(w,{buttonType:"ghost",onClick:o},"Skip for now")),e("button",{type:"button",css:Ie,title:"close",onClick:o},e("span",{hidden:!0},"Close"))):null};import{computeDimensionDefinitionDisplayData as Kt,computeDimensionDisplayData as qe,DimensionClient as Wt}from"@uniformdev/context/api";import{useAsync as qt}from"react-use";import*as Ye from"react";function Xe({apiHost:t,apiKey:n,projectId:r},o){let{loading:i,error:a,value:u}=qt(async()=>{if(!n||!r)return g;let s=(await new Wt({projectId:r,apiKey:n,apiHost:t||void 0}).get()).dimensions,d={};return s.map(m=>{var b,f,v,C;if(d[m.dim]={...Kt(m),cap:m.cap,str:10},d[m.dim].type==="Enrichment"){let x=m.dim.split("_")[0];d[m.dim].cap=(C=(v=(f=(b=o==null?void 0:o.project.pz)==null?void 0:b.enr)==null?void 0:f[x])==null?void 0:v.cap)!=null?C:100}}),d},[t,n,r]),g=Ye.useMemo(()=>{var s,d,m,b;let c={};return o&&(Object.entries((d=(s=o==null?void 0:o.project.pz)==null?void 0:s.sig)!=null?d:{}).map(([f,v])=>{let C=qe(f,o);C&&(c[f]={...v,...C})}),Object.entries((b=(m=o==null?void 0:o.project.pz)==null?void 0:m.enr)!=null?b:{}).map(([f,v])=>{var ye;let C=qe(f,o),x={cap:(ye=v.cap)!=null?ye:100,str:10};C&&(c[f]={...C,cap:x.cap,str:x.str})}),u&&Object.entries(u).map(([f,v])=>{c[f]={...c[f],...v}})),c},[o,u]);return{loading:i,error:a,index:g}}import{useMemo as Yt}from"react";import{QuirkClient as Xt}from"@uniformdev/context/api";import{useAsync as Jt}from"react-use";function Je({apiHost:t,apiKey:n,projectId:r},o){let{loading:i,error:a,value:u}=Jt(async()=>{if(!n||!r)return{};let s=await new Xt({projectId:r,apiKey:n,apiHost:t||void 0}).get(),d={};return s.quirks.map(m=>{d[m.id]={...m,value:o[m.id]}}),d},[t,n,r]),g=Yt(()=>{let c={};return Object.entries(o).map(([s,d])=>c[s]={value:d,id:s,name:s}),u&&Object.entries(u).map(([s,d])=>c[s]={...d,value:o[s]}),c},[o,u]);return{loading:i,error:a,index:g}}import{css as et}from"@emotion/react";function ce(){return e("style",null,`
|
|
485
491
|
:root {
|
|
486
492
|
--brand-primary-1: #438fd5; /* bright blue */
|
|
487
493
|
--brand-primary-2: #f4220b; /* red */
|
|
@@ -846,7 +852,7 @@ Add the correct display in Chrome and Safari.
|
|
|
846
852
|
|
|
847
853
|
summary {
|
|
848
854
|
display: list-item;
|
|
849
|
-
}`)}import{useEffect as
|
|
855
|
+
}`)}import{useEffect as jt,useState as eo}from"react";import{useMountedState as to}from"react-use";var je=()=>{let[t,n]=eo(!1),r=to();return jt(()=>{setTimeout(()=>{r()&&n(!0)},1e3)},[r]),t?e("article",{css:h.page},e("h1",null,"Loading..."),e("p",null,"Connecting to Uniform API for complete data.")):null};var oo=et`
|
|
850
856
|
background: var(--white);
|
|
851
857
|
padding: var(--spacing-base);
|
|
852
858
|
overflow-y: auto;
|
|
@@ -875,7 +881,7 @@ summary {
|
|
|
875
881
|
&::-webkit-scrollbar-thumb:hover {
|
|
876
882
|
background: var(--gray-500);
|
|
877
883
|
}
|
|
878
|
-
`;function
|
|
884
|
+
`;function tt(t){let n=Xe(t.settings,t.state.manifest),r=Je(t.settings,t.state.data.quirks),o={...t,dimensionIndex:n,quirksIndex:r},i=()=>{var a;if(n.loading||r.loading)return e(je,null);if(t.settings.route&&t.settings.route.match(/overrides\/\w+/))return e(ve,{...o});switch((a=t.settings)==null?void 0:a.route){case void 0:case"/":case"/dimensions":return e(Oe,{...o});case"/overrides":return e(Be,{...o});case"/overrides/add":return e(ve,{...o});case"/quirks":return e(Ke,{...o});case"/settings":return e(We,{...o});default:return e(Le,null)}};return e(xe,{settings:t.settings,saveSettings:t.saveSettings},e(ce,null),e("div",{css:et`
|
|
879
885
|
display: grid;
|
|
880
886
|
grid-template-columns: 200px auto;
|
|
881
887
|
font-weight: var(--font-regular);
|
|
@@ -884,7 +890,7 @@ summary {
|
|
|
884
890
|
line-height: var(--base-line-height);
|
|
885
891
|
height: var(--min-height);
|
|
886
892
|
min-width: var(--site-width);
|
|
887
|
-
`},e(ke,{...t}),e("main",{css:
|
|
893
|
+
`},e(ke,{...t}),e("main",{css:oo},e(he,{...t}),i())))}import{Context as ro,createDebugConsoleLogDrain as no}from"@uniformdev/context";import*as I from"react";function ot({context:t,initialSettings:n}){let r=t!=null?t:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=r!=null?r:new ro({manifest:{project:{}}}),[i,a]=I.useState({scores:{},quirks:{}}),[u,g]=I.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[c,s]=I.useState(n!=null?n:{});I.useEffect(()=>{var b;let m=no((b=c.logLevel)!=null?b:"none");return o.events.on("log",m),()=>{o.events.off("log",m)}},[c,o]),I.useEffect(()=>{let m=()=>{g(v=>({...v,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},b=v=>{!v.changed||g(C=>({...C,personalizations:[...C.personalizations,v]}))},f=v=>{!v.variantAssigned||g(C=>({...C,tests:[...C.tests,v]}))};return o.events.on("personalizationResult",b),o.events.on("testResult",f),o.storage.events.on("*",m),()=>{o.storage.events.off("*",m),o.events.off("personalizationResult",b),o.events.off("testResult",f)}},[o,c]);let d=I.useMemo(()=>({update:b=>o.update(b),forget:()=>o.forget(!1),rawUpdate:b=>o.storage.updateData(b),resetOverrides:()=>{let b=[];return Object.entries(i.scores).map(([f,v])=>{b.push({type:"modscore",data:{dimension:f,delta:-v}})}),a({...i,scores:{}}),o.storage.updateData(b)},override:b=>{let f={},v={};return b.map(C=>{C.type==="modscore"&&(f[C.data.dimension]=C.data.delta),C.type==="setquirk"&&(v[C.data.key]=C.data.value)}),a({scores:{...i.scores,...f},quirks:{...i.quirks,...v}}),o.storage.updateData(b)}}),[o,i]);return r?e(tt,{state:u,actions:d,overrides:i,settings:c,saveSettings:s}):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}import{css as so}from"@emotion/react";import*as nt from"react";import{css as io}from"@emotion/react";var ao=io`
|
|
888
894
|
align-items: center;
|
|
889
895
|
border-radius: var(--rounded-full);
|
|
890
896
|
background: var(--brand-secondary-5);
|
|
@@ -910,11 +916,11 @@ summary {
|
|
|
910
916
|
max-width: 100%;
|
|
911
917
|
height: auto;
|
|
912
918
|
}
|
|
913
|
-
`,
|
|
919
|
+
`,rt=({...t})=>e("button",{type:"button",css:ao,...t},e("span",{hidden:!0},"Uniform devtools"),e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),e("path",{d:"M7.61197 18.3608L8.97136 16.9124L8.97086 16.8933L3.87657 12.1121L8.66699 7.00798L7.20868 5.63928L1.04956 12.2017L7.61197 18.3608Z",fill:"currentColor"}),e("path",{d:"M16.388 18.3608L15.0286 16.9124L15.0291 16.8933L20.1234 12.1121L15.333 7.00798L16.7913 5.63928L22.9504 12.2017L16.388 18.3608Z",fill:"currentColor"})));function li(t){var i;let[n,r]=nt.useState(!1);return((i=t.context)!=null?i:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?e("div",null,e(ce,null),e(rt,{onClick:()=>r(a=>!a)}),n?e("div",{css:so`
|
|
914
920
|
box-shadow: var(--shadow-base);
|
|
915
921
|
position: fixed;
|
|
916
922
|
bottom: 82px;
|
|
917
923
|
right: var(--spacing-base);
|
|
918
924
|
z-index: var(--z-10);
|
|
919
925
|
max-width: var(--site-width);
|
|
920
|
-
`},e(
|
|
926
|
+
`},e(ot,{...t})):null):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}export{tt as ContextDevTools,ot as EmbeddedContextDevTools,li as ToggleEmbeddedContextDevTools};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Ht=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var Me=t=>Y(t,"__esModule",{value:!0});var Et=(t,r)=>{for(var n in r)Y(t,n,{get:r[n],enumerable:!0})},Ve=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Vt(r))!At.call(t,i)&&(n||i!=="default")&&Y(t,i,{get:()=>r[i],enumerable:!(o=Mt(r,i))||o.enumerable});return t},k=(t,r)=>Ve(Me(Y(t!=null?Rt(Ht(t)):{},"default",!r&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Ot=(t=>(r,n)=>t&&t.get(r)||(n=Ve(Me({}),r,1),t&&t.set(r,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var so={};Et(so,{ContextDevTools:()=>Ie,EmbeddedContextDevTools:()=>Pe,ToggleEmbeddedContextDevTools:()=>ao});var e=require("@emotion/react"),h=k(require("react"));var R=require("@emotion/react");var X=require("react"),He=(0,X.createContext)({settings:{},saveSettings:()=>null}),Ae=()=>(0,X.useContext)(He),Ee=({children:t,settings:r,saveSettings:n})=>(0,e.jsx)(He.Provider,{value:{settings:r,saveSettings:n}},t);var zt=({route:t,children:r,className:n})=>{let{settings:o,saveSettings:i}=Ae();return(0,e.jsx)("a",{href:"",className:n,onClick:a=>{a.preventDefault(),i({...o,route:t})}},r)},V=zt;var Bt=[{title:"Dimensions",href:"/dimensions",icon:`<svg
|
|
2
2
|
width="24"
|
|
3
3
|
height="24"
|
|
4
4
|
viewBox="0 0 24 24"
|
|
@@ -36,21 +36,21 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
36
36
|
</svg>`},{title:"Settings",href:"/settings",icon:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
37
37
|
<path d="M19.1469 12.716C19.1986 12.2636 19.201 11.8069 19.1539 11.354L21.7429 9.474C21.8681 9.3822 21.9548 9.24723 21.9862 9.0952C22.0176 8.94316 21.9915 8.78489 21.9129 8.651L19.9939 5.399C19.9182 5.26986 19.7985 5.17231 19.6568 5.1242C19.515 5.07608 19.3606 5.08063 19.2219 5.137L16.3599 6.292C15.9237 5.9578 15.4502 5.67525 14.9489 5.45L14.5739 2.545C14.5547 2.39441 14.4813 2.25598 14.3673 2.15566C14.2534 2.05534 14.1068 1.99999 13.9549 2H10.0859C9.93402 1.99997 9.78728 2.05527 9.67317 2.15558C9.55906 2.25588 9.48539 2.39432 9.46595 2.545L9.09395 5.433C8.63957 5.63249 8.20723 5.87882 7.80395 6.168L5.00895 4.954C4.87173 4.89484 4.71787 4.88672 4.57519 4.9311C4.4325 4.97549 4.3104 5.06945 4.23095 5.196L2.22195 8.398C2.1396 8.52998 2.10934 8.68789 2.13707 8.84096C2.1648 8.99403 2.24854 9.1313 2.37195 9.226L4.86795 11.142C4.83172 11.4266 4.81302 11.7131 4.81195 12C4.81195 12.18 4.82095 12.362 4.83795 12.558L2.26495 14.375C2.13766 14.4647 2.04844 14.5987 2.01478 14.7508C1.98112 14.9028 2.00543 15.0619 2.08295 15.197L3.95695 18.474C4.11095 18.742 4.43695 18.857 4.72595 18.746L7.56095 17.644C8.00795 17.997 8.49195 18.294 9.00795 18.53L9.33795 21.396C9.37495 21.709 9.63795 21.946 9.95195 21.95L13.8169 22H13.8249C14.1349 22 14.3989 21.771 14.4439 21.463L14.8549 18.59C15.3703 18.3674 15.8579 18.0855 16.3079 17.75L19.1279 18.93C19.4129 19.05 19.7419 18.944 19.9029 18.679L21.8669 15.452C21.9477 15.319 21.976 15.1608 21.9464 15.0081C21.9168 14.8554 21.8315 14.7192 21.7069 14.626L19.1469 12.716ZM11.9999 15C10.3459 15 8.99995 13.655 8.99995 12C8.99995 10.346 10.3449 9 11.9999 9C13.6539 9 14.9999 10.345 14.9999 12C14.9999 13.654 13.6539 15 11.9999 15Z" fill="white"/>
|
|
38
38
|
</svg>
|
|
39
|
-
`}],
|
|
39
|
+
`}],Oe=({...t})=>{let r=n=>{var i;let o="active";return!((i=t.settings)!=null&&i.route)&&n==="/dimensions"||t.settings.route===n?o:""};return(0,e.jsx)("nav",{css:R.css`
|
|
40
40
|
background: var(--brand-secondary-1);
|
|
41
41
|
padding: var(--spacing-base);
|
|
42
42
|
min-width: 200px;
|
|
43
|
-
`},(0,e.jsx)(
|
|
43
|
+
`},(0,e.jsx)(V,{css:R.css`
|
|
44
44
|
display: inline-block;
|
|
45
45
|
margin: 0 var(--spacing-base);
|
|
46
|
-
`,route:"/settings"},(0,e.jsx)("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("g",{clipPath:"url(#clip0_41_612)"},(0,e.jsx)("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),(0,e.jsx)("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),(0,e.jsx)("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),(0,e.jsx)("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"clip0_41_612"},(0,e.jsx)("rect",{width:"120",height:"38",fill:"white"}))))),(0,e.jsx)("ul",{css:
|
|
46
|
+
`,route:"/settings"},(0,e.jsx)("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("g",{clipPath:"url(#clip0_41_612)"},(0,e.jsx)("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),(0,e.jsx)("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),(0,e.jsx)("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),(0,e.jsx)("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"clip0_41_612"},(0,e.jsx)("rect",{width:"120",height:"38",fill:"white"}))))),(0,e.jsx)("ul",{css:R.css`
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-flow: column nowrap;
|
|
49
49
|
padding: 0;
|
|
50
50
|
margin: 0;
|
|
51
51
|
list-style-type: none;
|
|
52
52
|
height: calc(100% - var(--spacing-base) * 2.5);
|
|
53
|
-
`},Bt.map((n,o)=>(0,e.jsx)("li",{css:
|
|
53
|
+
`},Bt.map((n,o)=>(0,e.jsx)("li",{css:R.css`
|
|
54
54
|
padding: 0;
|
|
55
55
|
margin: 0;
|
|
56
56
|
list-style-type: none;
|
|
@@ -58,7 +58,7 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
58
58
|
&:last-of-type {
|
|
59
59
|
margin-top: auto;
|
|
60
60
|
}
|
|
61
|
-
`,key:o},(0,e.jsx)(
|
|
61
|
+
`,key:o},(0,e.jsx)(V,{css:R.css`
|
|
62
62
|
align-items: center;
|
|
63
63
|
border-radius: var(--rounded-base);
|
|
64
64
|
display: flex;
|
|
@@ -72,10 +72,10 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
72
72
|
&.active {
|
|
73
73
|
background: var(--gray-700);
|
|
74
74
|
}
|
|
75
|
-
`,className:r(n.href),route:n.href},(0,e.jsx)("i",{css:
|
|
75
|
+
`,className:r(n.href),route:n.href},(0,e.jsx)("i",{css:R.css`
|
|
76
76
|
align-items: center;
|
|
77
77
|
display: flex;
|
|
78
|
-
`,dangerouslySetInnerHTML:{__html:n.icon}}),n.title,n.href==="/overrides"&&Object.keys(t.overrides.scores).length>0&&(0,e.jsx)("span",{css:
|
|
78
|
+
`,dangerouslySetInnerHTML:{__html:n.icon}}),n.title,n.href==="/overrides"&&Object.keys(t.overrides.scores).length>0&&(0,e.jsx)("span",{css:R.css`
|
|
79
79
|
font-size: var(--font-xxs);
|
|
80
80
|
display: inline-block;
|
|
81
81
|
width: 12px;
|
|
@@ -83,11 +83,11 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
83
83
|
border-radius: 6px;
|
|
84
84
|
background-color: var(--red-tooltip);
|
|
85
85
|
text-align: center;
|
|
86
|
-
`},Object.keys(t.overrides.scores).length))))))};var
|
|
86
|
+
`},Object.keys(t.overrides.scores).length))))))};var ze=()=>(0,e.jsx)("article",null,(0,e.jsx)("h1",null,"Something when wrong"),(0,e.jsx)("p",null,"We could not find the page you're looking for."));var ae=k(require("react"));var H=require("@emotion/react"),J=k(require("react")),Be=(0,H.css)({willChange:"height"}),Nt=H.css`
|
|
87
87
|
border-bottom: 2px solid var(--brand-secondary-1);
|
|
88
88
|
font-size: var(--font-base);
|
|
89
89
|
margin: 0;
|
|
90
|
-
`,
|
|
90
|
+
`,Ft=H.css`
|
|
91
91
|
align-items: center;
|
|
92
92
|
border: none;
|
|
93
93
|
background: none;
|
|
@@ -97,13 +97,13 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
97
97
|
padding: var(--spacing-sm) 0;
|
|
98
98
|
font-weight: var(--font-bold);
|
|
99
99
|
justify-content: space-between;
|
|
100
|
-
`,
|
|
100
|
+
`,Zt=H.css`
|
|
101
101
|
align-self: center;
|
|
102
|
-
`,
|
|
102
|
+
`,Ut=H.css`
|
|
103
103
|
transform: rotate(-180deg);
|
|
104
|
-
`,B=({children:t})=>(0,e.jsx)("div",{css:[
|
|
104
|
+
`,B=({children:t})=>(0,e.jsx)("div",{css:[Be]},t),N=({title:t,children:r})=>{let[n,o]=J.useState(!1),i=t.split(" ").join("-").toLocaleLowerCase();return(0,e.jsx)(J.Fragment,null,(0,e.jsx)("h3",{css:Nt},(0,e.jsx)("button",{"aria-expanded":n,css:Ft,title:t,id:i,"aria-controls":`${i}-section`,onClick:()=>o(a=>!a),type:"button"},t,(0,e.jsx)("i",{css:[Zt,n?Ut:void 0]},(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("path",{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"}))))),(0,e.jsx)("div",{id:`${i}-section`,css:[Be,H.css`
|
|
105
105
|
padding: var(--spacing-sm) 0;
|
|
106
|
-
`],role:"region","aria-labelledby":i},n?r:null))};var
|
|
106
|
+
`],role:"region","aria-labelledby":i},n?r:null))};var M=require("@emotion/react"),Ne=k(require("react")),Qt=M.css`
|
|
107
107
|
align-items: center;
|
|
108
108
|
border: 1px solid transparent;
|
|
109
109
|
cursor: pointer;
|
|
@@ -114,29 +114,29 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
114
114
|
&:hover {
|
|
115
115
|
opacity: 0.8;
|
|
116
116
|
}
|
|
117
|
-
`;function
|
|
117
|
+
`;function _t(t){let r=M.css`
|
|
118
118
|
color: var(--white);
|
|
119
|
-
`,n=
|
|
119
|
+
`,n=M.css`
|
|
120
120
|
font-weight: var(--font-bold);
|
|
121
|
-
`;switch(t){case"primary":return
|
|
121
|
+
`;switch(t){case"primary":return M.css`
|
|
122
122
|
background: var(--brand-secondary-1);
|
|
123
123
|
${r}
|
|
124
124
|
${n}
|
|
125
|
-
`;case"secondary":return
|
|
125
|
+
`;case"secondary":return M.css`
|
|
126
126
|
background: var(--brand-secondary-5);
|
|
127
127
|
${r}
|
|
128
128
|
${n}
|
|
129
|
-
`;case"unimportant":return
|
|
129
|
+
`;case"unimportant":return M.css`
|
|
130
130
|
background: var(--brand-secondary-3);
|
|
131
131
|
color: var(--brand-secondary-1);
|
|
132
132
|
${n}
|
|
133
|
-
`;case"ghost":return
|
|
133
|
+
`;case"ghost":return M.css`
|
|
134
134
|
background: transparent;
|
|
135
135
|
color: var(--brand-secondary-5);
|
|
136
136
|
&:hover {
|
|
137
137
|
border: 1px solid var(--brand-secondary-5);
|
|
138
138
|
}
|
|
139
|
-
`}}var C=({buttonType:t="primary",children:r,className:n,...o})=>(0,e.jsx)(Ne.Fragment,null,(0,e.jsx)("button",{type:"button",css:[Qt,
|
|
139
|
+
`}}var C=({buttonType:t="primary",children:r,className:n,...o})=>(0,e.jsx)(Ne.Fragment,null,(0,e.jsx)("button",{type:"button",css:[Qt,_t(t)],className:n,...o},r));var A=require("@emotion/react"),j=A.css`
|
|
140
140
|
background-color: var(--gray-100);
|
|
141
141
|
padding: var(--spacing-base) var(--spacing-md);
|
|
142
142
|
margin: var(--spacing-base) 0;
|
|
@@ -144,21 +144,21 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
144
144
|
&:first-of-type {
|
|
145
145
|
margin: 0 0 var(--spacing-base);
|
|
146
146
|
}
|
|
147
|
-
`,Fe=
|
|
147
|
+
`,Fe=A.css`
|
|
148
148
|
background: var(--gray-100)
|
|
149
149
|
url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%0A%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 2C8.44771 2 8 2.44772 8 3V5C8 5.55228 8.44771 6 9 6C9.55229 6 10 5.55228 10 5V3C10 2.44772 9.55229 2 9 2ZM8 9H16V11C16 13.2091 14.2091 15 12 15C9.79086 15 8 13.2091 8 11V9ZM13 16.917C15.8377 16.441 18 13.973 18 11V7H6V11C6 13.973 8.16229 16.441 11 16.917V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V16.917ZM14 3C14 2.44772 14.4477 2 15 2C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6C14.4477 6 14 5.55228 14 5V3Z' fill='%232ecdb4' /%3E%3C/svg%3E")
|
|
150
150
|
no-repeat var(--spacing-sm) var(--spacing-base);
|
|
151
151
|
padding: var(--spacing-base) var(--spacing-xl);
|
|
152
|
-
`,ee=
|
|
152
|
+
`,ee=A.css`
|
|
153
153
|
color: var(--brand-secondary-1);
|
|
154
154
|
margin: 0;
|
|
155
155
|
font-size: var(--font-base);
|
|
156
156
|
font-weight: var(--font-bold);
|
|
157
|
-
`,te=
|
|
157
|
+
`,te=A.css`
|
|
158
158
|
color: var(--brand-secondary-1);
|
|
159
159
|
margin: var(--spacing-xs) 0 0;
|
|
160
160
|
font-size: var(--font-sm);
|
|
161
|
-
`,Ze=
|
|
161
|
+
`,Ze=A.css`
|
|
162
162
|
align-items: center;
|
|
163
163
|
border: none;
|
|
164
164
|
background: transparent
|
|
@@ -178,22 +178,22 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
178
178
|
&:hover {
|
|
179
179
|
opacity: 0.6;
|
|
180
180
|
}
|
|
181
|
-
`,oe=
|
|
181
|
+
`,oe=A.css`
|
|
182
182
|
display: flex;
|
|
183
183
|
margin: var(--spacing-sm) 0 0;
|
|
184
184
|
gap: var(--spacing-base);
|
|
185
|
-
`;var
|
|
185
|
+
`;var F=({title:t,text:r,buttonGroup:n,children:o})=>(0,e.jsx)("div",{css:j},(0,e.jsx)("h2",{css:ee},t),(0,e.jsx)("p",{css:te},r),o,n?(0,e.jsx)("div",{css:oe},n):null);var Z=require("@emotion/react"),he=Z.css`
|
|
186
186
|
align-items: center;
|
|
187
187
|
cursor: pointer;
|
|
188
188
|
display: flex;
|
|
189
189
|
gap: var(--spacing-xs);
|
|
190
190
|
margin-top: var(--spacing-base);
|
|
191
|
-
`,ye=
|
|
191
|
+
`,ye=Z.css`
|
|
192
192
|
color: var(--gray-500);
|
|
193
193
|
font-size: var(--font-sm);
|
|
194
|
-
`,
|
|
194
|
+
`,ko=Z.css`
|
|
195
195
|
background: var(--gray-600);
|
|
196
|
-
`,Ce=
|
|
196
|
+
`,Ce=Z.css`
|
|
197
197
|
display: block;
|
|
198
198
|
background: var(--gray-400);
|
|
199
199
|
border-radius: var(--rounded-full);
|
|
@@ -214,7 +214,7 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
214
214
|
transform: translateX(2px);
|
|
215
215
|
transition: transform 0.2s ease-in-out, background-color 0.3s ease-in-out;
|
|
216
216
|
}
|
|
217
|
-
`,we=
|
|
217
|
+
`,we=Z.css`
|
|
218
218
|
overflow: hidden;
|
|
219
219
|
clip: rect(0, 0, 0, 0);
|
|
220
220
|
height: 0;
|
|
@@ -228,7 +228,7 @@ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDes
|
|
|
228
228
|
&:checked ~ span {
|
|
229
229
|
background: var(--brand-secondary-5);
|
|
230
230
|
}
|
|
231
|
-
`;var
|
|
231
|
+
`;var Ue=({label:t,...r})=>(0,e.jsx)("label",{css:he},(0,e.jsx)("span",{css:ye},t),(0,e.jsx)("input",{type:"checkbox",css:we,...r}),(0,e.jsx)("span",{css:Ce})),xe=({field:t,form:r,meta:n,...o})=>{let{label:i}=o;return(0,e.jsx)("label",{css:he},(0,e.jsx)("span",{css:ye},i),(0,e.jsx)("input",{type:"checkbox",css:we,checked:t.value,...t}),(0,e.jsx)("span",{css:Ce}))};var w=require("@emotion/react"),Gt=w.keyframes`from {
|
|
232
232
|
transform: scale(1);
|
|
233
233
|
}
|
|
234
234
|
to {
|
|
@@ -268,41 +268,47 @@ to {
|
|
|
268
268
|
position: absolute;
|
|
269
269
|
right: var(--spacing-base);
|
|
270
270
|
bottom: var(--spacing-base);
|
|
271
|
-
animation: 0.5s 2 alternate ${
|
|
271
|
+
animation: 0.5s 2 alternate ${Gt};
|
|
272
|
+
`,cancelButton:w.css`
|
|
273
|
+
position: absolute;
|
|
274
|
+
left: calc(200px + var(--spacing-base));
|
|
275
|
+
bottom: var(--spacing-base);
|
|
276
|
+
background: white;
|
|
277
|
+
padding: var(--spacing-sm);
|
|
272
278
|
`,error:w.css`
|
|
273
279
|
color: var(--brand-secondary-5);
|
|
274
280
|
font-size: var(--font-sm);
|
|
275
|
-
`};var
|
|
281
|
+
`};var L=require("@emotion/react"),re=({children:t})=>(0,e.jsx)("table",{css:L.css`
|
|
276
282
|
border-collapse: collapse;
|
|
277
283
|
display: table;
|
|
278
284
|
width: 100%;
|
|
279
285
|
font-size: var(--font-sm);
|
|
280
|
-
`},t),
|
|
286
|
+
`},t),Qe=({children:t})=>(0,e.jsx)("thead",{css:L.css`
|
|
281
287
|
background: var(--gray-50);
|
|
282
288
|
text-align: left;
|
|
283
289
|
& tr {
|
|
284
290
|
border-bottom: 1px solid var(--gray-200);
|
|
285
291
|
}
|
|
286
|
-
`},t),ne=({children:t})=>(0,e.jsx)("tbody",null,t)
|
|
292
|
+
`},t),ne=({children:t})=>(0,e.jsx)("tbody",null,t),W=({border:t,children:r})=>(0,e.jsx)("tr",{css:t?L.css`
|
|
287
293
|
border-bottom: 1px solid var(--gray-200);
|
|
288
294
|
&:where(:last-child) {
|
|
289
295
|
border: none;
|
|
290
296
|
}
|
|
291
|
-
`:void 0},r),ke=({children:t})=>(0,e.jsx)("th",{css:
|
|
297
|
+
`:void 0},r),ke=({children:t})=>(0,e.jsx)("th",{css:L.css`
|
|
292
298
|
outline: none;
|
|
293
299
|
padding: var(--spacing-sm);
|
|
294
|
-
`},t);function
|
|
300
|
+
`},t);function $t(t){switch(t){case"light":return L.css`
|
|
295
301
|
color: var(--gray-400);
|
|
296
|
-
`;case"dark":return
|
|
302
|
+
`;case"dark":return L.css`
|
|
297
303
|
color: var(--brand-secondary-1);
|
|
298
|
-
`}}function
|
|
304
|
+
`}}function Kt(t){return L.css`
|
|
299
305
|
text-align: ${t};
|
|
300
|
-
`}var
|
|
306
|
+
`}var S=({alignment:t="left",border:r,color:n="dark",children:o})=>(0,e.jsx)("td",{css:[L.css`
|
|
301
307
|
padding: var(--spacing-base);
|
|
302
308
|
max-width: 180px;
|
|
303
309
|
overflow-wrap: break-word;
|
|
304
310
|
position: relative;
|
|
305
|
-
|
|
311
|
+
`,$t(n),Kt(t),r?L.css`
|
|
306
312
|
border-left: 1px solid var(--gray-200);
|
|
307
313
|
`:void 0]},o);var ie=require("@emotion/react"),_e=ie.css`
|
|
308
314
|
position: relative;
|
|
@@ -318,11 +324,11 @@ to {
|
|
|
318
324
|
top: 9px;
|
|
319
325
|
background: var(--red-tooltip);
|
|
320
326
|
border-radius: 3px;
|
|
321
|
-
`;var We=require("@emotion/react"),
|
|
327
|
+
`;var We=require("@emotion/react"),Wt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
322
328
|
<path d="M4.2 7.2C4.53137 7.2 4.8 6.93137 4.8 6.6C4.8 6.26863 4.53137 6 4.2 6C3.86863 6 3.6 6.26863 3.6 6.6C3.6 6.93137 3.86863 7.2 4.2 7.2Z" fill="#828282"/>
|
|
323
329
|
<path d="M8.4 6.6C8.4 6.93137 8.13137 7.2 7.8 7.2C7.46863 7.2 7.2 6.93137 7.2 6.6C7.2 6.26863 7.46863 6 7.8 6C8.13137 6 8.4 6.26863 8.4 6.6Z" fill="#828282"/>
|
|
324
330
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM6 10.8C8.65097 10.8 10.8 8.65097 10.8 6C10.8 5.49824 10.723 5.01447 10.5802 4.55984C10.0795 4.69533 9.55274 4.76763 9.00913 4.76763C6.77526 4.76763 4.82652 3.54683 3.79366 1.73601C2.25282 2.53492 1.2 4.14451 1.2 6C1.2 8.65097 3.34903 10.8 6 10.8Z" fill="#828282"/>
|
|
325
|
-
</svg>`,
|
|
331
|
+
</svg>`,qt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
326
332
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.59995 5.05775C4.9254 5.05775 5.99992 3.98325 5.99992 2.65778C5.99992 1.33232 4.9254 0.257812 3.59995 0.257812C2.27448 0.257812 1.19998 1.33232 1.19998 2.65778C1.19998 3.98325 2.27448 5.05775 3.59995 5.05775ZM3.59999 3.85777C4.26272 3.85777 4.79997 3.32052 4.79997 2.65778C4.79997 1.99505 4.26272 1.4578 3.59999 1.4578C2.93725 1.4578 2.4 1.99505 2.4 2.65778C2.4 3.32052 2.93725 3.85777 3.59999 3.85777Z" fill="#828282"/>
|
|
327
333
|
<path d="M5.39993 6.8577C5.73131 6.8577 5.99993 7.12632 5.99993 7.45769V11.0576H7.19991V7.45769C7.19991 6.46356 6.39406 5.65771 5.39993 5.65771H1.79998C0.80588 5.65771 0 6.46356 0 7.45769V11.0576H1.19999V7.45769C1.19999 7.12632 1.46861 6.8577 1.79998 6.8577H5.39993Z" fill="#828282"/>
|
|
328
334
|
<path d="M11.9999 5.05762H8.3999V6.2576H11.9999V5.05762Z" fill="#828282"/>
|
|
@@ -334,10 +340,10 @@ to {
|
|
|
334
340
|
<path d="M9.36269 2.7856C9.93846 3.36136 10.2946 4.15676 10.2946 5.03535C10.2946 6.06973 9.80096 6.98882 9.03643 7.5699L9.94228 8.47575C10.9345 7.65881 11.5672 6.42096 11.5672 5.03535C11.5672 3.80533 11.0687 2.69177 10.2626 1.88571L9.36269 2.7856Z" fill="#828282"/>
|
|
335
341
|
<path d="M0.113525 5.03534C0.113525 3.10251 0.896953 1.35266 2.16359 0.0860049L3.06347 0.985892C2.02714 2.02224 1.38616 3.45394 1.38616 5.03534C1.38616 6.61674 2.02714 8.04844 3.06347 9.08479L2.16358 9.98468C0.89695 8.71802 0.113525 6.96817 0.113525 5.03534Z" fill="#828282"/>
|
|
336
342
|
<path d="M12.0624 9.98474C13.329 8.71809 14.1125 6.96821 14.1125 5.03534C14.1125 3.10248 13.329 1.3526 12.0624 0.0859375L11.1625 0.985824C12.1988 2.02218 12.8398 3.4539 12.8398 5.03534C12.8398 6.61678 12.1988 8.0485 11.1625 9.08486L12.0624 9.98474Z" fill="#828282"/>
|
|
337
|
-
</svg>`,qe=({type:t})=>{let r="";switch(t){case"Audience":r=
|
|
343
|
+
</svg>`,qe=({type:t})=>{let r="";switch(t){case"Audience":r=Wt;break;case"Signal":r=Ke;break;case"Intent":r=Ke;break;case"Enrichment":r=qt;break}return(0,e.jsx)("i",{css:We.css`
|
|
338
344
|
align-items: center;
|
|
339
345
|
display: inline-block;
|
|
340
|
-
`,dangerouslySetInnerHTML:{__html:r}})};var
|
|
346
|
+
`,dangerouslySetInnerHTML:{__html:r}})};var Yt=({dimensionIndex:t,dimensions:r,overrides:n,disableEditOverride:o,onClick:i})=>(0,e.jsx)(re,null,(0,e.jsx)(ne,null,Object.entries(r).map(([a,m])=>{var p;let{dim:u,name:c,type:s,category:d}=(p=t[a])!=null?p:{name:a,dim:a,type:void 0,category:void 0};return(0,e.jsx)(W,{key:u},(0,e.jsx)(S,null,n.scores[u]!==void 0&&(0,e.jsx)("s",{css:Ge},m-n.scores[u]),(0,e.jsx)("b",{css:_e},m,n.scores[u]!==void 0&&(0,e.jsx)("i",{css:$e}))),(0,e.jsx)(S,null,(0,e.jsx)("div",{onClick:()=>i==null?void 0:i(u),css:i?{cursor:"pointer"}:void 0},(0,e.jsx)("span",{css:v.divider,role:"presentation"}),(0,e.jsx)("div",null,(0,e.jsx)(qe,{type:s})," ",s),(0,e.jsx)("strong",null,d?`${d}:`:""," ",c))),(0,e.jsx)(S,{alignment:"right",color:"light"},n.scores[u]!==void 0&&!o?(0,e.jsx)(V,{route:`/overrides/${u}`},"Edit override"):null))}))),E=Yt;var Ye=require("@emotion/react"),Xt=Ye.css`
|
|
341
347
|
background: none;
|
|
342
348
|
border: none;
|
|
343
349
|
color: var(--brand-secondary-3);
|
|
@@ -346,7 +352,7 @@ to {
|
|
|
346
352
|
font-weight: var(--font-bold);
|
|
347
353
|
margin-left: auto;
|
|
348
354
|
font-size: var(--font-sm);
|
|
349
|
-
`,
|
|
355
|
+
`,U=({children:t,...r})=>(0,e.jsx)("button",{type:"button",css:Xt,...r},t);var Xe=({dimensionIndex:{index:t},state:{scores:r,data:n},overrides:o,actions:i})=>{let a=ae.useMemo(()=>{let s={};return Object.keys(t).filter(d=>!r[d]).map(d=>{s[t[d].dim]=0}),s},[r,t]),m=Object.keys(r).length,u=m+Object.keys(a).length,c=()=>{i.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return(0,e.jsx)(ae.Fragment,null,(0,e.jsx)("article",{css:v.page},(0,e.jsx)("div",{css:v.headingGroup},(0,e.jsx)("h2",{css:v.title},"Dimensions",(0,e.jsx)("small",null,m," active of ",u)),(0,e.jsx)("div",{css:v.reset},(0,e.jsx)(U,{onClick:()=>i.resetOverrides().then(i.forget)},"clear all dimensions")),(0,e.jsx)(Ue,{label:"Control Group",onChange:c,checked:n.controlGroup})),m>0?(0,e.jsx)(E,{dimensionIndex:t,dimensions:r,overrides:o}):(0,e.jsx)(F,{title:n.controlGroup?"In control group":"No active dimensions",text:n.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have score in any dimensions yet.",buttonGroup:n.controlGroup?(0,e.jsx)(C,{buttonType:"secondary",onClick:c},"Exit control group"):null}),(0,e.jsx)(B,null,(0,e.jsx)(N,{title:`Inactive Dimensions (${Object.keys(a).length})`},(0,e.jsx)(E,{dimensionIndex:t,dimensions:a,overrides:o})))))};var je=k(require("react"));var Je=require("@emotion/react");function Le({onClick:t}){return(0,e.jsx)("button",{css:Je.css`
|
|
350
356
|
width: 3.5rem;
|
|
351
357
|
height: 3.5rem;
|
|
352
358
|
display: flex;
|
|
@@ -359,7 +365,7 @@ to {
|
|
|
359
365
|
svg {
|
|
360
366
|
color: var(--red-button);
|
|
361
367
|
}
|
|
362
|
-
`,onClick:t,"aria-label":"Add new override",className:"text-secondary shadow-xl rounded-full flex items-center bg-secondary","data-test-id":"add-new-overrides-button"},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66"},(0,e.jsx)("g",{fill:"none",fillRule:"evenodd"},(0,e.jsx)("circle",{cx:"33",cy:"33",r:"33",fill:"currentColor"}),(0,e.jsx)("g",{fill:"#FFF",transform:"translate(19 19)"},(0,e.jsx)("rect",{width:"4",height:"28",x:"12",rx:"2"}),(0,e.jsx)("path",{d:"M14,0 C15.1045695,-2.02906125e-16 16,0.8954305 16,2 L16,26 C16,27.1045695 15.1045695,28 14,28 C12.8954305,28 12,27.1045695 12,26 L12,2 C12,0.8954305 12.8954305,2.02906125e-16 14,0 Z",transform:"rotate(90 14 14)"})))))}var et=({dimensionIndex:{index:t},state:{data:r,scores:n},overrides:o,actions:i,settings:a,saveSettings:m})=>{let u=o.scores?Object.keys(o.scores).length:0,
|
|
368
|
+
`,onClick:t,"aria-label":"Add new override",className:"text-secondary shadow-xl rounded-full flex items-center bg-secondary","data-test-id":"add-new-overrides-button"},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66"},(0,e.jsx)("g",{fill:"none",fillRule:"evenodd"},(0,e.jsx)("circle",{cx:"33",cy:"33",r:"33",fill:"currentColor"}),(0,e.jsx)("g",{fill:"#FFF",transform:"translate(19 19)"},(0,e.jsx)("rect",{width:"4",height:"28",x:"12",rx:"2"}),(0,e.jsx)("path",{d:"M14,0 C15.1045695,-2.02906125e-16 16,0.8954305 16,2 L16,26 C16,27.1045695 15.1045695,28 14,28 C12.8954305,28 12,27.1045695 12,26 L12,2 C12,0.8954305 12.8954305,2.02906125e-16 14,0 Z",transform:"rotate(90 14 14)"})))))}var et=({dimensionIndex:{index:t},state:{data:r,scores:n},overrides:o,actions:i,settings:a,saveSettings:m})=>{let u=o.scores?Object.keys(o.scores).length:0,c=p=>(p.preventDefault(),m({...a,route:"/overrides/add"})),s=()=>{i.rawUpdate([{type:"setcontrol",data:!r.controlGroup}])},d={};return Object.entries(n).map(([p,f])=>{o.scores[p]!==void 0&&(d[p]=f)}),(0,e.jsx)(je.Fragment,null,(0,e.jsx)("article",{css:v.page},(0,e.jsx)("div",{css:v.headingGroup},(0,e.jsx)("h2",{css:v.title},"What if?"),(0,e.jsx)("div",{css:v.reset},(0,e.jsx)(U,{onClick:i.resetOverrides},"delete all overrides")),(0,e.jsx)(Le,{onClick:c})),(0,e.jsx)("p",null,"Override dimension scores to test personalization"),u>0?(0,e.jsx)(E,{dimensionIndex:t,dimensions:d,overrides:o,onClick:p=>m({...a,route:`/overrides/${p}`})}):(0,e.jsx)(F,{title:r.controlGroup?"In control group":"No overrides",text:r.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have any dimension overrides yet.",buttonGroup:r.controlGroup?(0,e.jsx)(C,{buttonType:"secondary",onClick:s},"Exit control group"):null})))};var $=require("formik");var K=k(require("yup"));var ot=require("formik");var T=require("@emotion/react"),se=T.css`
|
|
363
369
|
background: var(--white);
|
|
364
370
|
border: 1px solid var(--gray-500);
|
|
365
371
|
border-radius: var(--rounded-base);
|
|
@@ -370,7 +376,7 @@ to {
|
|
|
370
376
|
cursor: not-allowed;
|
|
371
377
|
color: var(--gray-200);
|
|
372
378
|
}
|
|
373
|
-
`,
|
|
379
|
+
`,ce=T.css`
|
|
374
380
|
appearance: none;
|
|
375
381
|
background: var(--white)
|
|
376
382
|
url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNi4zNDMxNyA3Ljc1NzMyTDQuOTI4OTYgOS4xNzE1NEwxMiAxNi4yNDI2TDE5LjA3MTEgOS4xNzE1N0wxNy42NTY5IDcuNzU3MzVMMTIgMTMuNDE0Mkw2LjM0MzE3IDcuNzU3MzJaIgogICAgZmlsbD0iIzgyODI4MiIKICAvPgo8L3N2Zz4=')
|
|
@@ -383,29 +389,29 @@ to {
|
|
|
383
389
|
cursor: not-allowed;
|
|
384
390
|
color: var(--gray-200);
|
|
385
391
|
}
|
|
386
|
-
`,de=
|
|
392
|
+
`,de=T.css`
|
|
387
393
|
padding: var(--spacing-sm);
|
|
388
394
|
max-width: 160px;
|
|
389
|
-
`,
|
|
395
|
+
`,le=T.css`
|
|
390
396
|
margin: var(--spacing-base) 0;
|
|
391
|
-
`,
|
|
397
|
+
`,Q=T.css`
|
|
392
398
|
color: var(--brand-secondary-1);
|
|
393
399
|
display: flex;
|
|
394
400
|
flex-direction: column;
|
|
395
401
|
margin: 0 0 var(--spacing-sm);
|
|
396
|
-
`,
|
|
402
|
+
`,_=T.css`
|
|
397
403
|
color: var(--brand-secondary-1);
|
|
398
404
|
display: block;
|
|
399
405
|
flex: 1 100%;
|
|
400
406
|
font-weight: var(--font-bold);
|
|
401
407
|
margin: 0 0 var(--spacing-sm);
|
|
402
|
-
`,
|
|
408
|
+
`,G=T.css`
|
|
403
409
|
color: var(--gray-600);
|
|
404
410
|
font-size: var(--font-sm);
|
|
405
|
-
`,
|
|
411
|
+
`,pe=T.css`
|
|
406
412
|
color: var(--brand-secondary-5);
|
|
407
413
|
display: block;
|
|
408
|
-
`,tt=
|
|
414
|
+
`,tt=T.css`
|
|
409
415
|
flex-direction: row;
|
|
410
416
|
flex-wrap: wrap;
|
|
411
417
|
|
|
@@ -473,15 +479,15 @@ to {
|
|
|
473
479
|
flex: 1 0 20%;
|
|
474
480
|
padding: 10px;
|
|
475
481
|
}
|
|
476
|
-
`;var rt=({field:t,form:r,meta:n,...o})=>{let{label:i,options:a,caption:m,...u}=o;return(0,e.jsx)("div",{css:
|
|
482
|
+
`;var rt=({field:t,form:r,meta:n,...o})=>{let{label:i,options:a,caption:m,...u}=o;return(0,e.jsx)("div",{css:le},(0,e.jsx)("label",{css:Q},(0,e.jsx)("span",{css:_},i),(0,e.jsx)("select",{...t,...u,css:ce},a.map((c,s)=>(0,e.jsx)("option",{value:c.value,key:s},c.text)))),m?(0,e.jsx)("span",{css:G},m):null,(0,e.jsx)(ot.ErrorMessage,{component:"div",css:pe,name:t.name}))};var it=require("formik");var Jt=({field:t,form:r,meta:n,...o})=>{var s,d;let{label:i,caption:a,min:m=0,max:u=100,step:c}=o;return(0,e.jsx)("div",null,(0,e.jsx)("label",{css:[Q,tt]},(0,e.jsx)("span",{css:_},i),(0,e.jsx)("input",{type:"range",min:m,max:u,step:c,...t,value:(s=t.value)!=null?s:0}),(0,e.jsx)("span",{className:"value-display"},(d=t.value)!=null?d:0)),(0,e.jsx)("p",{css:G},a))},nt=Jt;var jt=({name:t,label:r,dimensionToOverride:n,isSubmitting:o})=>{let i={max:100,step:20};return n&&(i.max=n.cap,i.step=n.str),(0,e.jsx)(it.Field,{component:nt,label:r,caption:`Range: 0 - ${i.max} in increments of ${i.step}`,id:t,name:t,disabled:o,...i})},at=jt;var st=require("@emotion/react"),O=({children:t,...r})=>(0,e.jsx)("fieldset",{css:st.css`
|
|
477
483
|
border: none;
|
|
478
484
|
padding: 0;
|
|
479
|
-
`,...r},t);var ct=require("@emotion/react"),
|
|
485
|
+
`,...r},t);var ct=require("@emotion/react"),q=({children:t})=>(0,e.jsx)("legend",{css:ct.css`
|
|
480
486
|
font-size: var(--font-md);
|
|
481
487
|
font-weight: var(--font-bold);
|
|
482
488
|
border-bottom: 1px solid var(--gray-400);
|
|
483
489
|
width: 100%;
|
|
484
|
-
`},t);var
|
|
490
|
+
`},t);var me=require("@uniformdev/context");function dt({manifest:t,visitor:r,override:n}){let o=new me.Context({manifest:t,transitionStore:new lt({initialData:r})}),i={...o.scores};o.storage.updateData([n]);let m={...{...o.scores}};return Object.entries(m).forEach(([u,c])=>{i[u]===c&&delete m[u]}),m}var lt=class extends me.TransitionDataStore{async handleDelete(){}async handleUpdateData(){}};var eo=K.object({dimension:K.string(),score:K.number()}),Te=({settings:t,saveSettings:r,state:n,actions:o,dimensionIndex:{index:i}})=>{var c,s;let a=t.route?[...t.route.matchAll(/overrides\/(?!.*add)(\w+)?/g)]:[],m=a[0]?a[0][1]:"";if(!((c=n.manifest.project.pz)!=null&&c.sig))return(0,e.jsx)("p",null,"Error, manifest is broken or there is no signal to override.");let u=Object.entries(i).filter(([,d])=>d.type!=="Audience"&&d.type!=="Intent").map(([d,p])=>{let f=p.type?`${p.type}: `:"",g=p.category?`${p.category} - `:"",b=`${f}${g}${p.name}`;return{value:d,text:b}});return u.unshift({value:"_none",text:"Choose dimension to override"}),(0,e.jsx)($.Formik,{initialValues:{dimension:m,score:(s=n.scores[m])!=null?s:0},validationSchema:eo,enableReinitialize:!0,onSubmit:d=>{var b,y,x;let p=(y=(b=i[d.dimension])==null?void 0:b.cap)!=null?y:0,g=Math.min(d.score,p)-((x=n.scores[d.dimension])!=null?x:0);o.override([{type:"modscore",data:{dimension:d.dimension,delta:g}}]),r({...t,route:"/overrides"})}},({dirty:d,isValid:p,isSubmitting:f,values:g})=>{var x;let b=dt({manifest:n.manifest,visitor:n.data,override:{type:"modscore",data:{dimension:g.dimension,delta:g.score-((x=n.scores[g.dimension])!=null?x:0)}}}),y=g.score&&Object.keys(b).length>0;return(0,e.jsx)($.Form,{css:v.page},(0,e.jsx)("h1",{css:v.title},"Override Dimension"),(0,e.jsx)($.Field,{component:rt,label:"Dimension",id:"dimension",name:"dimension",options:u,disabled:f}),(0,e.jsx)("p",{css:v.text},(0,e.jsx)("small",null,"Audiences and Intents are aggregated from other dimension scores and cannot be overridden directly.")),g.dimension?(0,e.jsx)(at,{name:"score",label:"Score",dimensionToOverride:i[g.dimension],isSubmitting:f}):null,(0,e.jsx)(O,{disabled:f},y?(0,e.jsx)(B,null,(0,e.jsx)(N,{title:`Impacted Dimensions (${Object.keys(b).length})`},(0,e.jsx)(E,{dimensionIndex:i,dimensions:b,overrides:{quirks:{},scores:{[g.dimension]:g.score}},disableEditOverride:!0}))):null,d?(0,e.jsx)(C,{type:"submit",css:v.submitButton,disabled:!p},"Save"):null,(0,e.jsx)(V,{route:"/overrides",css:v.cancelButton},"Cancel")))})};var ut=require("react");var ue=require("react");var to=({name:t,value:r,submit:n})=>{let[o,i]=(0,ue.useState)(r!=null?r:"");return(0,ue.useEffect)(()=>{i(r!=null?r:"")},[r]),(0,e.jsx)("div",{css:{display:"flex",gap:"var(--spacing-sm)"}},(0,e.jsx)("input",{type:"text",css:[se,de],name:t,value:o,onChange:m=>{i(m.target.value)}}),(0,e.jsx)(C,{buttonType:"primary",onClick:()=>n(t,o!=null?o:"")},"Save"))},pt=to;var oo=({name:t,value:r,submit:n,options:o})=>(0,e.jsx)("select",{name:t,defaultValue:r,onChange:a=>n(a.target.name,a.target.value),css:[ce,de]},(0,e.jsx)("option",{key:"_none",value:"_none"},"None"),(o!=null?o:[]).map(a=>(0,e.jsx)("option",{key:a.value,value:a.value},a.name))),mt=oo;var gt=({...t})=>{let{actions:r,quirksIndex:{index:n}}=t,[o,i]=(0,ut.useState)(""),a;o&&(a=n[o]);let m=(u,c)=>{i(""),r.override([{type:"setquirk",data:{key:u,value:c}}])};return(0,e.jsx)(h.Fragment,null,(0,e.jsx)("article",{css:v.page},(0,e.jsx)("h1",{css:v.title},"Quirks"),(0,e.jsx)("p",{css:v.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(n).length?(0,e.jsx)(re,null,(0,e.jsx)(Qe,null,(0,e.jsx)(W,null,(0,e.jsx)(ke,null,"Key"),(0,e.jsx)(ke,null,"Value"),(0,e.jsx)(S,null,""))),(0,e.jsx)(ne,null,Object.values(n).map(({name:u,value:c,id:s})=>(0,e.jsx)(W,{key:s,border:"bottom"},(0,e.jsx)(S,null,(0,e.jsx)("strong",null,u)),(0,e.jsx)(S,null,o!==s&&(0,e.jsx)("span",{onClick:()=>{i(s)}},c),o===s&&a&&(0,e.jsx)(h.Fragment,null,a.options?(0,e.jsx)(mt,{name:s,value:c,submit:m,options:a.options}):(0,e.jsx)(pt,{name:s,value:c,submit:m}))),(0,e.jsx)(S,null,o?null:(0,e.jsx)(U,{onClick:()=>{i(s)}},(0,e.jsx)("small",null,"Override"))))))):(0,e.jsx)(F,{title:"No quirks configured",text:"There are currently no quirks setup. Try to connect to Uniform API to load additional information about Quirks and Quirks without defined value."})))};var D=require("formik");var ft=require("formik");var ge=({field:t,form:r,meta:n,...o})=>{let{label:i,caption:a,...m}=o;return(0,e.jsx)("div",{css:le},(0,e.jsx)("label",{css:Q},(0,e.jsx)("span",{css:_},i),(0,e.jsx)("input",{type:"text",css:se,...t,...m})),a?(0,e.jsx)("span",{css:G},a):null,(0,e.jsx)(ft.ErrorMessage,{component:"div",css:pe,name:t.name}))};var I=k(require("yup"));var ro=I.object({apiKey:I.string().matches(/^uf.+$/,"API keys start with `uf`, double check your API key"),apiHost:I.string().matches(/^https:\/\/(localhost:8889|([a-z]+\.)?uniform.app)$/,"API host must be a Uniform domain."),logging:I.boolean(),projectId:I.string().uuid(),consentMode:I.boolean()}),bt=({settings:t,saveSettings:r,actions:n,state:{data:o},dimensionIndex:{error:i,loading:a}})=>{var m,u,c;return(0,e.jsx)(D.Formik,{initialValues:{apiHost:(m=t.apiHost)!=null?m:"",apiKey:(u=t.apiKey)!=null?u:"",projectId:(c=t.projectId)!=null?c:"",consentMode:!!o.consent,logging:t.logLevel!=="none"&&Boolean(t.logLevel)},validationSchema:ro,enableReinitialize:!0,onSubmit:s=>{r({...t,apiHost:s.apiHost,apiKey:s.apiKey,projectId:s.projectId,logLevel:s.logging?"debug":"none",consentMode:s.consentMode}),n.rawUpdate([{type:"consent",data:s.consentMode}])}},({dirty:s,isValid:d,isSubmitting:p})=>(0,e.jsx)(D.Form,{css:v.page},(0,e.jsx)("h1",{css:v.title},"Settings"),(0,e.jsx)(O,{disabled:p},(0,e.jsx)(q,null,"Data Connection"),!a&&i?(0,e.jsx)("p",{css:v.error},"Unable to fetch data from Uniform",(0,e.jsx)("br",null),(0,e.jsx)("em",null,i.message)):null,(0,e.jsx)("p",{css:v.text},(0,e.jsx)("small",null,"Adding an API key and project ID enables richer dimension data to be shown. You must have access to the Uniform project to do this.")),(0,e.jsx)(D.Field,{component:ge,label:"Uniform API key",caption:"Generate an API key in your Uniform team settings. Grant only Context: Read Drafts permission.",id:"api-key",name:"apiKey",autoComplete:"off"}),(0,e.jsx)(D.Field,{component:ge,label:"Uniform Project ID",caption:"Available to copy after generating an API key",id:"project-id",name:"projectId",autoComplete:"off"}),(0,e.jsx)(B,null,(0,e.jsx)(N,{title:"Advanced"},(0,e.jsx)(D.Field,{component:ge,label:"Alternative API Host",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option.",id:"api-host",name:"apiHost",autoComplete:"off"}))),(0,e.jsx)(O,null,(0,e.jsx)(q,null,"Storage Consent"),(0,e.jsx)(D.Field,{component:xe,label:"Store visitor data",id:"consent-mode",name:"consentMode"}),(0,e.jsx)("p",null,(0,e.jsx)("small",null,"Turning on consents to storing behavior in this browser for personalization across sessions. Only affects this browser. Personalization works with this disabled, but dimension scores are lost on refresh."))),(0,e.jsx)(O,null,(0,e.jsx)(q,null,"Logging"),(0,e.jsx)(D.Field,{component:xe,label:"Write Uniform Context diagnostic logs to browser console",id:"logging",name:"logging"})),s?(0,e.jsx)(C,{type:"submit",css:v.submitButton,disabled:!d},"Save"):null)))};var De=({settings:t,saveSettings:r})=>{let n=()=>{r({...t,route:"/settings"})},o=()=>{r({...t,ignoreApiKeyPrompt:!0})},i=!(t!=null&&t.apiKey);return!t.ignoreApiKeyPrompt&&i?(0,e.jsx)("div",{css:[j,Fe]},(0,e.jsx)("h2",{css:ee},"Connect this site"),(0,e.jsx)("p",{css:te},"Add a Uniform API key to get better data."),(0,e.jsx)("div",{css:oe},(0,e.jsx)(C,{buttonType:"secondary",onClick:n},"Connect this site"),(0,e.jsx)(C,{buttonType:"ghost",onClick:o},"Skip for now")),(0,e.jsx)("button",{type:"button",css:Ze,title:"close",onClick:o},(0,e.jsx)("span",{hidden:!0},"Close"))):null};var z=require("@uniformdev/context/api"),vt=require("react-use"),ht=k(require("react"));function yt({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:a,value:m}=(0,vt.useAsync)(async()=>{if(!r||!n)return u;let s=(await new z.DimensionClient({projectId:n,apiKey:r,apiHost:t||void 0}).get()).dimensions,d={};return s.map(p=>{var f,g,b,y;if(d[p.dim]={...(0,z.computeDimensionDefinitionDisplayData)(p),cap:p.cap,str:10},d[p.dim].type==="Enrichment"){let x=p.dim.split("_")[0];d[p.dim].cap=(y=(b=(g=(f=o==null?void 0:o.project.pz)==null?void 0:f.enr)==null?void 0:g[x])==null?void 0:b.cap)!=null?y:100}}),d},[t,r,n]),u=ht.useMemo(()=>{var s,d,p,f;let c={};return o&&(Object.entries((d=(s=o==null?void 0:o.project.pz)==null?void 0:s.sig)!=null?d:{}).map(([g,b])=>{let y=(0,z.computeDimensionDisplayData)(g,o);y&&(c[g]={...b,...y})}),Object.entries((f=(p=o==null?void 0:o.project.pz)==null?void 0:p.enr)!=null?f:{}).map(([g,b])=>{var Re;let y=(0,z.computeDimensionDisplayData)(g,o),x={cap:(Re=b.cap)!=null?Re:100,str:10};y&&(c[g]={...y,cap:x.cap,str:x.str})}),m&&Object.entries(m).map(([g,b])=>{c[g]={...c[g],...b}})),c},[o,m]);return{loading:i,error:a,index:u}}var Ct=require("react"),wt=require("@uniformdev/context/api"),xt=require("react-use");function kt({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:a,value:m}=(0,xt.useAsync)(async()=>{if(!r||!n)return{};let s=await new wt.QuirkClient({projectId:n,apiKey:r,apiHost:t||void 0}).get(),d={};return s.quirks.map(p=>{d[p.id]={...p,value:o[p.id]}}),d},[t,r,n]),u=(0,Ct.useMemo)(()=>{let c={};return Object.entries(o).map(([s,d])=>c[s]={value:d,id:s,name:s}),m&&Object.entries(m).map(([s,d])=>c[s]={...d,value:o[s]}),c},[o,m]);return{loading:i,error:a,index:u}}var Se=require("@emotion/react");function fe(){return(0,e.jsx)("style",null,`
|
|
485
491
|
:root {
|
|
486
492
|
--brand-primary-1: #438fd5; /* bright blue */
|
|
487
493
|
--brand-primary-2: #f4220b; /* red */
|
|
@@ -846,7 +852,7 @@ Add the correct display in Chrome and Safari.
|
|
|
846
852
|
|
|
847
853
|
summary {
|
|
848
854
|
display: list-item;
|
|
849
|
-
}`)}var be=require("react"),
|
|
855
|
+
}`)}var be=require("react"),Lt=require("react-use");var Tt=()=>{let[t,r]=(0,be.useState)(!1),n=(0,Lt.useMountedState)();return(0,be.useEffect)(()=>{setTimeout(()=>{n()&&r(!0)},1e3)},[n]),t?(0,e.jsx)("article",{css:v.page},(0,e.jsx)("h1",null,"Loading..."),(0,e.jsx)("p",null,"Connecting to Uniform API for complete data.")):null};var no=Se.css`
|
|
850
856
|
background: var(--white);
|
|
851
857
|
padding: var(--spacing-base);
|
|
852
858
|
overflow-y: auto;
|
|
@@ -875,7 +881,7 @@ summary {
|
|
|
875
881
|
&::-webkit-scrollbar-thumb:hover {
|
|
876
882
|
background: var(--gray-500);
|
|
877
883
|
}
|
|
878
|
-
`;function Ie(t){let r=
|
|
884
|
+
`;function Ie(t){let r=yt(t.settings,t.state.manifest),n=kt(t.settings,t.state.data.quirks),o={...t,dimensionIndex:r,quirksIndex:n},i=()=>{var a;if(r.loading||n.loading)return(0,e.jsx)(Tt,null);if(t.settings.route&&t.settings.route.match(/overrides\/\w+/))return(0,e.jsx)(Te,{...o});switch((a=t.settings)==null?void 0:a.route){case void 0:case"/":case"/dimensions":return(0,e.jsx)(Xe,{...o});case"/overrides":return(0,e.jsx)(et,{...o});case"/overrides/add":return(0,e.jsx)(Te,{...o});case"/quirks":return(0,e.jsx)(gt,{...o});case"/settings":return(0,e.jsx)(bt,{...o});default:return(0,e.jsx)(ze,null)}};return(0,e.jsx)(Ee,{settings:t.settings,saveSettings:t.saveSettings},(0,e.jsx)(fe,null),(0,e.jsx)("div",{css:Se.css`
|
|
879
885
|
display: grid;
|
|
880
886
|
grid-template-columns: 200px auto;
|
|
881
887
|
font-weight: var(--font-regular);
|
|
@@ -884,7 +890,7 @@ summary {
|
|
|
884
890
|
line-height: var(--base-line-height);
|
|
885
891
|
height: var(--min-height);
|
|
886
892
|
min-width: var(--site-width);
|
|
887
|
-
`},(0,e.jsx)(
|
|
893
|
+
`},(0,e.jsx)(Oe,{...t}),(0,e.jsx)("main",{css:no},(0,e.jsx)(De,{...t}),i())))}var ve=require("@uniformdev/context"),P=k(require("react"));function Pe({context:t,initialSettings:r}){let n=t!=null?t:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new ve.Context({manifest:{project:{}}}),[i,a]=P.useState({scores:{},quirks:{}}),[m,u]=P.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[c,s]=P.useState(r!=null?r:{});P.useEffect(()=>{var f;let p=(0,ve.createDebugConsoleLogDrain)((f=c.logLevel)!=null?f:"none");return o.events.on("log",p),()=>{o.events.off("log",p)}},[c,o]),P.useEffect(()=>{let p=()=>{u(b=>({...b,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},f=b=>{!b.changed||u(y=>({...y,personalizations:[...y.personalizations,b]}))},g=b=>{!b.variantAssigned||u(y=>({...y,tests:[...y.tests,b]}))};return o.events.on("personalizationResult",f),o.events.on("testResult",g),o.storage.events.on("*",p),()=>{o.storage.events.off("*",p),o.events.off("personalizationResult",f),o.events.off("testResult",g)}},[o,c]);let d=P.useMemo(()=>({update:f=>o.update(f),forget:()=>o.forget(!1),rawUpdate:f=>o.storage.updateData(f),resetOverrides:()=>{let f=[];return Object.entries(i.scores).map(([g,b])=>{f.push({type:"modscore",data:{dimension:g,delta:-b}})}),a({...i,scores:{}}),o.storage.updateData(f)},override:f=>{let g={},b={};return f.map(y=>{y.type==="modscore"&&(g[y.data.dimension]=y.data.delta),y.type==="setquirk"&&(b[y.data.key]=y.data.value)}),a({scores:{...i.scores,...g},quirks:{...i.quirks,...b}}),o.storage.updateData(f)}}),[o,i]);return n?(0,e.jsx)(Ie,{state:m,actions:d,overrides:i,settings:c,saveSettings:s}):(0,e.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}var It=require("@emotion/react"),Pt=k(require("react"));var Dt=require("@emotion/react"),io=Dt.css`
|
|
888
894
|
align-items: center;
|
|
889
895
|
border-radius: var(--rounded-full);
|
|
890
896
|
background: var(--brand-secondary-5);
|
|
@@ -910,11 +916,11 @@ summary {
|
|
|
910
916
|
max-width: 100%;
|
|
911
917
|
height: auto;
|
|
912
918
|
}
|
|
913
|
-
`,
|
|
919
|
+
`,St=({...t})=>(0,e.jsx)("button",{type:"button",css:io,...t},(0,e.jsx)("span",{hidden:!0},"Uniform devtools"),(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),(0,e.jsx)("path",{d:"M7.61197 18.3608L8.97136 16.9124L8.97086 16.8933L3.87657 12.1121L8.66699 7.00798L7.20868 5.63928L1.04956 12.2017L7.61197 18.3608Z",fill:"currentColor"}),(0,e.jsx)("path",{d:"M16.388 18.3608L15.0286 16.9124L15.0291 16.8933L20.1234 12.1121L15.333 7.00798L16.7913 5.63928L22.9504 12.2017L16.388 18.3608Z",fill:"currentColor"})));function ao(t){var i;let[r,n]=Pt.useState(!1);return((i=t.context)!=null?i:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?(0,e.jsx)("div",null,(0,e.jsx)(fe,null),(0,e.jsx)(St,{onClick:()=>n(a=>!a)}),r?(0,e.jsx)("div",{css:It.css`
|
|
914
920
|
box-shadow: var(--shadow-base);
|
|
915
921
|
position: fixed;
|
|
916
922
|
bottom: 82px;
|
|
917
923
|
right: var(--spacing-base);
|
|
918
924
|
z-index: var(--z-10);
|
|
919
925
|
max-width: var(--site-width);
|
|
920
|
-
`},(0,e.jsx)(Pe,{...t})):null):(0,e.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}module.exports=
|
|
926
|
+
`},(0,e.jsx)(Pe,{...t})):null):(0,e.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}module.exports=Ot(so);0&&(module.exports={ContextDevTools,EmbeddedContextDevTools,ToggleEmbeddedContextDevTools});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/context-devtools",
|
|
3
|
-
"version": "14.2.1-alpha.
|
|
3
|
+
"version": "14.2.1-alpha.256+3b08eaee2",
|
|
4
4
|
"description": "Uniform Context developer tools components",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@emotion/react": "^11.8.1",
|
|
27
|
-
"@uniformdev/context": "^14.2.1-alpha.
|
|
27
|
+
"@uniformdev/context": "^14.2.1-alpha.256+3b08eaee2",
|
|
28
28
|
"formik": "2.2.9",
|
|
29
29
|
"react": "^17.0.2",
|
|
30
30
|
"react-dom": "^17.0.2",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"/dist"
|
|
36
36
|
],
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "3b08eaee27018fbfe1ac4b2bc7e1d6cefb4b9bdf"
|
|
38
38
|
}
|