@uniformdev/context-devtools 14.2.1-alpha.256 → 14.2.1-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +105 -263
- package/dist/index.d.ts +5 -32
- package/dist/index.js +102 -260
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ft=Object.create;var B=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var Nt=Object.getPrototypeOf,Ot=Object.prototype.hasOwnProperty;var ct=e=>B(e,"__esModule",{value:!0});var _t=(e,r)=>{for(var n in r)B(e,n,{get:r[n],enumerable:!0})},lt=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ut(r))!Ot.call(e,a)&&(n||a!=="default")&&B(e,a,{get:()=>r[a],enumerable:!(o=Zt(r,a))||o.enumerable});return e},T=(e,r)=>lt(ct(B(e!=null?Ft(Nt(e)):{},"default",!r&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Gt=(e=>(r,n)=>e&&e.get(r)||(n=lt(ct({}),r,1),e&&e.set(r,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var ae={};_t(ae,{ContextDevTools:()=>it,EmbeddedContextDevTools:()=>st,ToggleEmbeddedContextDevTools:()=>ne});var t=require("@emotion/react"),d=T(require("react"));var R=require("@emotion/react"),Kt=[{title:"Dimensions",href:"/dimensions",icon:`<svg
|
|
2
2
|
width="24"
|
|
3
3
|
height="24"
|
|
4
4
|
viewBox="0 0 24 24"
|
|
@@ -15,9 +15,6 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
15
15
|
fill="currentColor"
|
|
16
16
|
/>
|
|
17
17
|
</svg>
|
|
18
|
-
`},{title:"What if?",href:"/overrides",icon:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5123 7.91666L14.5804 8.4343L13.9179 5.96175L11.3371 10.0021L11.3575 10.0143C11.1348 10.3854 10.8997 10.7125 10.6556 11.0003H18.7603L16.9135 9.15347L18.3277 7.73926L22.5703 11.9819L18.3276 16.2245L16.9134 14.8103L18.7235 13.0003H6.65606C6.89995 13.2879 7.13495 13.6148 7.35749 13.9857L7.33713 13.9979L9.9179 18.0382L10.5804 15.5657L12.5123 16.0833L10.9594 21.8789L5.16384 20.326L5.68147 18.3941L8.20425 19.0701C8.20425 19.0701 6.17064 16.0325 5.21659 14.398C4.70173 13.7544 4.17055 13.4257 3.70352 13.2461C3.10532 13.016 2.54358 13.0011 2.06154 13.0003H2V13.0002V11.0003V11.0002L2.02253 11.0002C2.05059 11.0002 2.07985 11.0002 2.11025 11.0003H6V10.9998C6.49549 10.9998 7.07968 10.9939 7.70352 10.7539C8.17055 10.5743 8.70173 10.2456 9.21659 9.60198C10.1706 7.96745 12.2043 4.92988 12.2043 4.92988L9.68147 5.60586L9.16384 3.67401L14.9594 2.12109L16.5123 7.91666Z" fill="white"/>
|
|
20
|
-
</svg>
|
|
21
18
|
`},{title:"Quirks",href:"/quirks",icon:`<svg
|
|
22
19
|
width="24"
|
|
23
20
|
height="24"
|
|
@@ -36,21 +33,21 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
36
33
|
</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
34
|
<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
35
|
</svg>
|
|
39
|
-
`}],
|
|
36
|
+
`}],pt=({...e})=>{let r=o=>{if(o.preventDefault(),o.currentTarget.pathname)return e.saveSettings({...e.settings,route:o.currentTarget.pathname})},n=o=>{var i;let a="active";return!((i=e.settings)==null?void 0:i.route)&&o==="/dimensions"||e.settings.route===o?a:""};return(0,t.jsx)("nav",{css:R.css`
|
|
40
37
|
background: var(--brand-secondary-1);
|
|
41
38
|
padding: var(--spacing-base);
|
|
42
39
|
min-width: 200px;
|
|
43
|
-
`},(0,
|
|
40
|
+
`},(0,t.jsx)("a",{css:R.css`
|
|
44
41
|
display: inline-block;
|
|
45
42
|
margin: 0 var(--spacing-base);
|
|
46
|
-
`,
|
|
43
|
+
`,href:"/settings",onClick:o=>r(o)},(0,t.jsx)("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.jsx)("g",{clipPath:"url(#clip0_41_612)"},(0,t.jsx)("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),(0,t.jsx)("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),(0,t.jsx)("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),(0,t.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,t.jsx)("defs",null,(0,t.jsx)("clipPath",{id:"clip0_41_612"},(0,t.jsx)("rect",{width:"120",height:"38",fill:"white"}))))),(0,t.jsx)("ul",{css:R.css`
|
|
47
44
|
display: flex;
|
|
48
45
|
flex-flow: column nowrap;
|
|
49
46
|
padding: 0;
|
|
50
47
|
margin: 0;
|
|
51
48
|
list-style-type: none;
|
|
52
49
|
height: calc(100% - var(--spacing-base) * 2.5);
|
|
53
|
-
`},
|
|
50
|
+
`},Kt.map((o,a)=>(0,t.jsx)("li",{css:R.css`
|
|
54
51
|
padding: 0;
|
|
55
52
|
margin: 0;
|
|
56
53
|
list-style-type: none;
|
|
@@ -58,7 +55,7 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
58
55
|
&:last-of-type {
|
|
59
56
|
margin-top: auto;
|
|
60
57
|
}
|
|
61
|
-
`,key:
|
|
58
|
+
`,key:a},(0,t.jsx)("a",{css:R.css`
|
|
62
59
|
align-items: center;
|
|
63
60
|
border-radius: var(--rounded-base);
|
|
64
61
|
display: flex;
|
|
@@ -72,22 +69,14 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
72
69
|
&.active {
|
|
73
70
|
background: var(--gray-700);
|
|
74
71
|
}
|
|
75
|
-
`,className:
|
|
72
|
+
`,className:n(o.href),href:o.href,title:o.title,onClick:i=>r(i)},(0,t.jsx)("i",{css:R.css`
|
|
76
73
|
align-items: center;
|
|
77
74
|
display: flex;
|
|
78
|
-
`,dangerouslySetInnerHTML:{__html:
|
|
79
|
-
font-size: var(--font-xxs);
|
|
80
|
-
display: inline-block;
|
|
81
|
-
width: 12px;
|
|
82
|
-
height: 12px;
|
|
83
|
-
border-radius: 6px;
|
|
84
|
-
background-color: var(--red-tooltip);
|
|
85
|
-
text-align: center;
|
|
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`
|
|
75
|
+
`,dangerouslySetInnerHTML:{__html:o.icon}}),o.title)))))};var dt=()=>(0,t.jsx)("article",null,(0,t.jsx)("h1",null,"Something when wrong"),(0,t.jsx)("p",null,"We could not find the page you're looking for."));var $=T(require("react"));var S=require("@emotion/react"),F=T(require("react")),mt=(0,S.css)({willChange:"height"}),$t=S.css`
|
|
87
76
|
border-bottom: 2px solid var(--brand-secondary-1);
|
|
88
77
|
font-size: var(--font-base);
|
|
89
78
|
margin: 0;
|
|
90
|
-
`,
|
|
79
|
+
`,qt=S.css`
|
|
91
80
|
align-items: center;
|
|
92
81
|
border: none;
|
|
93
82
|
background: none;
|
|
@@ -97,13 +86,13 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
97
86
|
padding: var(--spacing-sm) 0;
|
|
98
87
|
font-weight: var(--font-bold);
|
|
99
88
|
justify-content: space-between;
|
|
100
|
-
`,
|
|
89
|
+
`,Wt=S.css`
|
|
101
90
|
align-self: center;
|
|
102
|
-
`,
|
|
91
|
+
`,Qt=S.css`
|
|
103
92
|
transform: rotate(-180deg);
|
|
104
|
-
`,
|
|
93
|
+
`,Z=({children:e})=>(0,t.jsx)("div",{css:[mt]},e),U=({title:e,children:r})=>{let[n,o]=F.useState(!1),a=e.split(" ").join("-").toLocaleLowerCase();return(0,t.jsx)(F.Fragment,null,(0,t.jsx)("h3",{css:$t},(0,t.jsx)("button",{"aria-expanded":n,css:qt,title:e,id:a,"aria-controls":`${a}-section`,onClick:()=>o(i=>!i),type:"button"},e,(0,t.jsx)("i",{css:[Wt,n?Qt:void 0]},(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.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,t.jsx)("div",{id:`${a}-section`,css:[mt,S.css`
|
|
105
94
|
padding: var(--spacing-sm) 0;
|
|
106
|
-
`],role:"region","aria-labelledby":
|
|
95
|
+
`],role:"region","aria-labelledby":a},n?r:null))};var k=require("@emotion/react"),ut=T(require("react")),Xt=k.css`
|
|
107
96
|
align-items: center;
|
|
108
97
|
border: 1px solid transparent;
|
|
109
98
|
cursor: pointer;
|
|
@@ -114,29 +103,29 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
114
103
|
&:hover {
|
|
115
104
|
opacity: 0.8;
|
|
116
105
|
}
|
|
117
|
-
`;function
|
|
106
|
+
`;function Yt(e){let r=k.css`
|
|
118
107
|
color: var(--white);
|
|
119
|
-
`,n=
|
|
108
|
+
`,n=k.css`
|
|
120
109
|
font-weight: var(--font-bold);
|
|
121
|
-
`;switch(
|
|
110
|
+
`;switch(e){case"primary":return k.css`
|
|
122
111
|
background: var(--brand-secondary-1);
|
|
123
112
|
${r}
|
|
124
113
|
${n}
|
|
125
|
-
`;case"secondary":return
|
|
114
|
+
`;case"secondary":return k.css`
|
|
126
115
|
background: var(--brand-secondary-5);
|
|
127
116
|
${r}
|
|
128
117
|
${n}
|
|
129
|
-
`;case"unimportant":return
|
|
118
|
+
`;case"unimportant":return k.css`
|
|
130
119
|
background: var(--brand-secondary-3);
|
|
131
120
|
color: var(--brand-secondary-1);
|
|
132
121
|
${n}
|
|
133
|
-
`;case"ghost":return
|
|
122
|
+
`;case"ghost":return k.css`
|
|
134
123
|
background: transparent;
|
|
135
124
|
color: var(--brand-secondary-5);
|
|
136
125
|
&:hover {
|
|
137
126
|
border: 1px solid var(--brand-secondary-5);
|
|
138
127
|
}
|
|
139
|
-
`}}var
|
|
128
|
+
`}}var H=({buttonType:e="primary",children:r,className:n,...o})=>(0,t.jsx)(ut.Fragment,null,(0,t.jsx)("button",{type:"button",css:[Xt,Yt(e)],className:n,...o},r));var V=require("@emotion/react"),N=V.css`
|
|
140
129
|
background-color: var(--gray-100);
|
|
141
130
|
padding: var(--spacing-base) var(--spacing-md);
|
|
142
131
|
margin: var(--spacing-base) 0;
|
|
@@ -144,21 +133,21 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
144
133
|
&:first-of-type {
|
|
145
134
|
margin: 0 0 var(--spacing-base);
|
|
146
135
|
}
|
|
147
|
-
`,
|
|
136
|
+
`,gt=V.css`
|
|
148
137
|
background: var(--gray-100)
|
|
149
138
|
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
139
|
no-repeat var(--spacing-sm) var(--spacing-base);
|
|
151
140
|
padding: var(--spacing-base) var(--spacing-xl);
|
|
152
|
-
`,
|
|
141
|
+
`,O=V.css`
|
|
153
142
|
color: var(--brand-secondary-1);
|
|
154
143
|
margin: 0;
|
|
155
144
|
font-size: var(--font-base);
|
|
156
145
|
font-weight: var(--font-bold);
|
|
157
|
-
`,
|
|
146
|
+
`,_=V.css`
|
|
158
147
|
color: var(--brand-secondary-1);
|
|
159
148
|
margin: var(--spacing-xs) 0 0;
|
|
160
149
|
font-size: var(--font-sm);
|
|
161
|
-
`,
|
|
150
|
+
`,ft=V.css`
|
|
162
151
|
align-items: center;
|
|
163
152
|
border: none;
|
|
164
153
|
background: transparent
|
|
@@ -178,22 +167,21 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
178
167
|
&:hover {
|
|
179
168
|
opacity: 0.6;
|
|
180
169
|
}
|
|
181
|
-
`,
|
|
170
|
+
`,G=V.css`
|
|
182
171
|
display: flex;
|
|
183
172
|
margin: var(--spacing-sm) 0 0;
|
|
184
173
|
gap: var(--spacing-base);
|
|
185
|
-
`;var
|
|
174
|
+
`;var K=({title:e,text:r,buttonGroup:n,children:o})=>(0,t.jsx)("div",{css:N},(0,t.jsx)("h2",{css:O},e),(0,t.jsx)("p",{css:_},r),o,n?(0,t.jsx)("div",{css:G},n):null);var M=require("@emotion/react"),bt=M.css`
|
|
186
175
|
align-items: center;
|
|
187
176
|
cursor: pointer;
|
|
188
177
|
display: flex;
|
|
189
178
|
gap: var(--spacing-xs);
|
|
190
|
-
|
|
191
|
-
`,ye=Z.css`
|
|
179
|
+
`,ht=M.css`
|
|
192
180
|
color: var(--gray-500);
|
|
193
181
|
font-size: var(--font-sm);
|
|
194
|
-
`,
|
|
182
|
+
`,fe=M.css`
|
|
195
183
|
background: var(--gray-600);
|
|
196
|
-
`,
|
|
184
|
+
`,vt=M.css`
|
|
197
185
|
display: block;
|
|
198
186
|
background: var(--gray-400);
|
|
199
187
|
border-radius: var(--rounded-full);
|
|
@@ -214,7 +202,7 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
214
202
|
transform: translateX(2px);
|
|
215
203
|
transition: transform 0.2s ease-in-out, background-color 0.3s ease-in-out;
|
|
216
204
|
}
|
|
217
|
-
`,
|
|
205
|
+
`,yt=M.css`
|
|
218
206
|
overflow: hidden;
|
|
219
207
|
clip: rect(0, 0, 0, 0);
|
|
220
208
|
height: 0;
|
|
@@ -228,21 +216,49 @@ var Rt=Object.create;var Y=Object.defineProperty;var Mt=Object.getOwnPropertyDes
|
|
|
228
216
|
&:checked ~ span {
|
|
229
217
|
background: var(--brand-secondary-5);
|
|
230
218
|
}
|
|
231
|
-
`;var
|
|
219
|
+
`;var wt=({label:e,...r})=>(0,t.jsx)("label",{css:bt},(0,t.jsx)("span",{css:ht},e),(0,t.jsx)("input",{type:"checkbox",css:yt,...r}),(0,t.jsx)("span",{css:vt}));var v=require("@emotion/react"),I=({children:e})=>(0,t.jsx)("table",{css:v.css`
|
|
220
|
+
border-collapse: collapse;
|
|
221
|
+
display: table;
|
|
222
|
+
width: 100%;
|
|
223
|
+
font-size: var(--font-sm);
|
|
224
|
+
`},e),Ct=({children:e})=>(0,t.jsx)("thead",{css:v.css`
|
|
225
|
+
background: var(--gray-50);
|
|
226
|
+
text-align: left;
|
|
227
|
+
& tr {
|
|
228
|
+
border-bottom: 1px solid var(--gray-200);
|
|
229
|
+
}
|
|
230
|
+
`},e),E=({children:e})=>(0,t.jsx)("tbody",null,e),z=({border:e,children:r})=>(0,t.jsx)("tr",{css:e?v.css`
|
|
231
|
+
border-bottom: 1px solid var(--gray-200);
|
|
232
|
+
&:where(:last-child) {
|
|
233
|
+
border: none;
|
|
234
|
+
}
|
|
235
|
+
`:void 0},r),ot=({children:e})=>(0,t.jsx)("th",{css:v.css`
|
|
236
|
+
outline: none;
|
|
237
|
+
padding: var(--spacing-sm);
|
|
238
|
+
`},e);function Jt(e){switch(e){case"light":return v.css`
|
|
239
|
+
color: var(--gray-400);
|
|
240
|
+
`;case"dark":return v.css`
|
|
241
|
+
color: var(--brand-secondary-1);
|
|
242
|
+
`}}function jt(e){return v.css`
|
|
243
|
+
text-align: ${e};
|
|
244
|
+
`}var w=({alignment:e="left",border:r,color:n="dark",children:o})=>(0,t.jsx)("td",{css:[v.css`
|
|
245
|
+
padding: var(--spacing-base);
|
|
246
|
+
max-width: 180px;
|
|
247
|
+
overflow-wrap: break-word;
|
|
248
|
+
position: relative;
|
|
249
|
+
`,Jt(n),jt(e),r?v.css`
|
|
250
|
+
border-left: 1px solid var(--gray-200);
|
|
251
|
+
`:void 0]},o);var y=require("@emotion/react"),te=y.keyframes`from {
|
|
232
252
|
transform: scale(1);
|
|
233
253
|
}
|
|
234
254
|
to {
|
|
235
255
|
transform: scale(1.2);
|
|
236
256
|
}
|
|
237
|
-
`,
|
|
257
|
+
`,u={page:y.css`
|
|
238
258
|
color: var(--brand-secondary-1);
|
|
239
|
-
`,text:
|
|
259
|
+
`,text:y.css`
|
|
240
260
|
margin: var(--spacing-sm) 0;
|
|
241
|
-
`,
|
|
242
|
-
margin: 0 var(--spacing-md);
|
|
243
|
-
font-size: var(--font-sm);
|
|
244
|
-
color: var(--gray-500);
|
|
245
|
-
`,title:w.css`
|
|
261
|
+
`,title:y.css`
|
|
246
262
|
margin: 0 0 var(--spacing-sm);
|
|
247
263
|
font-size: var(--font-md);
|
|
248
264
|
& > small {
|
|
@@ -251,12 +267,11 @@ to {
|
|
|
251
267
|
font-weight: var(--font-regular);
|
|
252
268
|
margin: var(--spacing-xxs) 0 0;
|
|
253
269
|
}
|
|
254
|
-
`,headingGroup:
|
|
270
|
+
`,headingGroup:y.css`
|
|
255
271
|
align-items: baseline;
|
|
256
272
|
display: flex;
|
|
257
273
|
justify-content: space-between;
|
|
258
|
-
|
|
259
|
-
`,divider:w.css`
|
|
274
|
+
`,divider:y.css`
|
|
260
275
|
background: var(--gray-300);
|
|
261
276
|
display: block;
|
|
262
277
|
width: 1px;
|
|
@@ -264,108 +279,15 @@ to {
|
|
|
264
279
|
position: absolute;
|
|
265
280
|
inset: 0 auto 0 0;
|
|
266
281
|
margin: auto 0;
|
|
267
|
-
`,submitButton:
|
|
282
|
+
`,submitButton:y.css`
|
|
268
283
|
position: absolute;
|
|
269
284
|
right: var(--spacing-base);
|
|
270
285
|
bottom: var(--spacing-base);
|
|
271
|
-
animation: 0.5s 2 alternate ${
|
|
272
|
-
`,
|
|
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:w.css`
|
|
286
|
+
animation: 0.5s 2 alternate ${te};
|
|
287
|
+
`,error:y.css`
|
|
279
288
|
color: var(--brand-secondary-5);
|
|
280
289
|
font-size: var(--font-sm);
|
|
281
|
-
`};var L=
|
|
282
|
-
border-collapse: collapse;
|
|
283
|
-
display: table;
|
|
284
|
-
width: 100%;
|
|
285
|
-
font-size: var(--font-sm);
|
|
286
|
-
`},t),Qe=({children:t})=>(0,e.jsx)("thead",{css:L.css`
|
|
287
|
-
background: var(--gray-50);
|
|
288
|
-
text-align: left;
|
|
289
|
-
& tr {
|
|
290
|
-
border-bottom: 1px solid var(--gray-200);
|
|
291
|
-
}
|
|
292
|
-
`},t),ne=({children:t})=>(0,e.jsx)("tbody",null,t),W=({border:t,children:r})=>(0,e.jsx)("tr",{css:t?L.css`
|
|
293
|
-
border-bottom: 1px solid var(--gray-200);
|
|
294
|
-
&:where(:last-child) {
|
|
295
|
-
border: none;
|
|
296
|
-
}
|
|
297
|
-
`:void 0},r),ke=({children:t})=>(0,e.jsx)("th",{css:L.css`
|
|
298
|
-
outline: none;
|
|
299
|
-
padding: var(--spacing-sm);
|
|
300
|
-
`},t);function $t(t){switch(t){case"light":return L.css`
|
|
301
|
-
color: var(--gray-400);
|
|
302
|
-
`;case"dark":return L.css`
|
|
303
|
-
color: var(--brand-secondary-1);
|
|
304
|
-
`}}function Kt(t){return L.css`
|
|
305
|
-
text-align: ${t};
|
|
306
|
-
`}var S=({alignment:t="left",border:r,color:n="dark",children:o})=>(0,e.jsx)("td",{css:[L.css`
|
|
307
|
-
padding: var(--spacing-base);
|
|
308
|
-
max-width: 180px;
|
|
309
|
-
overflow-wrap: break-word;
|
|
310
|
-
position: relative;
|
|
311
|
-
`,$t(n),Kt(t),r?L.css`
|
|
312
|
-
border-left: 1px solid var(--gray-200);
|
|
313
|
-
`:void 0]},o);var ie=require("@emotion/react"),_e=ie.css`
|
|
314
|
-
position: relative;
|
|
315
|
-
display: inline-block;
|
|
316
|
-
font-size: var(--font-base);
|
|
317
|
-
`,Ge=ie.css`
|
|
318
|
-
display: block;
|
|
319
|
-
`,$e=ie.css`
|
|
320
|
-
position: absolute;
|
|
321
|
-
width: 6px;
|
|
322
|
-
height: 6px;
|
|
323
|
-
right: -10px;
|
|
324
|
-
top: 9px;
|
|
325
|
-
background: var(--red-tooltip);
|
|
326
|
-
border-radius: 3px;
|
|
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">
|
|
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"/>
|
|
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"/>
|
|
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"/>
|
|
331
|
-
</svg>`,qt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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"/>
|
|
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"/>
|
|
334
|
-
<path d="M11.9999 5.05762H8.3999V6.2576H11.9999V5.05762Z" fill="#828282"/>
|
|
335
|
-
<path d="M8.3999 7.45752H11.9999V8.6575H8.3999V7.45752Z" fill="#828282"/>
|
|
336
|
-
<path d="M11.9999 2.65771H8.3999V3.8577H11.9999V2.65771Z" fill="#828282"/>
|
|
337
|
-
</svg>`,Ke=`<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
338
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.113 3.12646C8.16729 3.12646 9.02195 3.98113 9.02195 5.03541C9.02195 5.86658 8.49075 6.57368 7.74932 6.83573V10.1259H6.47669V6.83573C5.73526 6.57368 5.20405 5.86658 5.20405 5.03541C5.20405 3.98113 6.05872 3.12646 7.113 3.12646ZM7.113 4.39909C7.46443 4.39909 7.74932 4.68398 7.74932 5.03541C7.74932 5.38684 7.46443 5.67172 7.113 5.67172C6.76158 5.67172 6.47669 5.38684 6.47669 5.03541C6.47669 4.68398 6.76158 4.39909 7.113 4.39909Z" fill="#828282"/>
|
|
339
|
-
<path d="M3.96336 1.88578C3.15733 2.69183 2.65879 3.80537 2.65879 5.03535C2.65879 6.42093 3.29145 7.65875 4.28366 8.47569L5.1895 7.56984C4.42501 6.98876 3.93142 6.06969 3.93142 5.03535C3.93142 4.1568 4.28752 3.36142 4.86325 2.78567L3.96336 1.88578Z" fill="#828282"/>
|
|
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"/>
|
|
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"/>
|
|
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"/>
|
|
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`
|
|
344
|
-
align-items: center;
|
|
345
|
-
display: inline-block;
|
|
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`
|
|
347
|
-
background: none;
|
|
348
|
-
border: none;
|
|
349
|
-
color: var(--brand-secondary-3);
|
|
350
|
-
cursor: pointer;
|
|
351
|
-
padding: 0;
|
|
352
|
-
font-weight: var(--font-bold);
|
|
353
|
-
margin-left: auto;
|
|
354
|
-
font-size: var(--font-sm);
|
|
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`
|
|
356
|
-
width: 3.5rem;
|
|
357
|
-
height: 3.5rem;
|
|
358
|
-
display: flex;
|
|
359
|
-
align-items: center;
|
|
360
|
-
border-radius: 9999px;
|
|
361
|
-
border: none;
|
|
362
|
-
cursor: pointer;
|
|
363
|
-
background-color: var(--red-button);
|
|
364
|
-
|
|
365
|
-
svg {
|
|
366
|
-
color: var(--red-button);
|
|
367
|
-
}
|
|
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`
|
|
290
|
+
`};var Lt=({dimensionIndex:{index:e},state:{scores:r,data:n},actions:o})=>{let a=$.useMemo(()=>Object.keys(e).filter(c=>!r[c]).map(c=>{var l;return(l=e[c])!=null?l:{name:c,dim:c,type:"Unknown"}}),[r,e]),i=Object.keys(r).length,m=i+a.length,f=()=>{o.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return(0,t.jsx)($.Fragment,null,(0,t.jsx)("article",{css:u.page},(0,t.jsx)("div",{css:u.headingGroup},(0,t.jsx)("h2",{css:u.title},"Dimensions",(0,t.jsx)("small",null,i," active of ",m)),(0,t.jsx)(wt,{label:"Control Group",onChange:f,checked:n.controlGroup})),i>0?(0,t.jsx)(I,null,(0,t.jsx)(E,null,Object.entries(r).map(([c,l],p)=>{var L;let{name:b,type:h,category:g}=(L=e==null?void 0:e[c])!=null?L:{name:c,dim:c,type:"Unknown"};return(0,t.jsx)(z,{key:p},(0,t.jsx)(w,null,(0,t.jsx)("b",null,l)),(0,t.jsx)(w,null,(0,t.jsx)("span",{css:u.divider,role:"presentation"}),(0,t.jsx)("strong",null,g?`${g}:`:""," ",b)),(0,t.jsx)(w,{alignment:"right",color:"light"},h))}))):(0,t.jsx)(K,{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,t.jsx)(H,{buttonType:"secondary",onClick:f},"Exit control group"):null}),(0,t.jsx)(Z,null,(0,t.jsx)(U,{title:"Inactive Dimensions"},(0,t.jsx)(I,null,(0,t.jsx)(E,null,a.map(({dim:c,type:l,name:p,category:b})=>(0,t.jsx)(z,{key:c},(0,t.jsx)(w,null,(0,t.jsx)("strong",null,b?`${b}:`:""," ",p)),(0,t.jsx)(w,{alignment:"right",color:"light"},l)))))))))};var Tt=({...e})=>{let{state:{data:r}}=e;return(0,t.jsx)(d.Fragment,null,(0,t.jsx)("article",{css:u.page},(0,t.jsx)("h1",{css:u.title},"Quirks"),(0,t.jsx)("p",{css:u.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(r.quirks).length?(0,t.jsx)(I,null,(0,t.jsx)(Ct,null,(0,t.jsx)(z,null,(0,t.jsx)(ot,null,"Key"),(0,t.jsx)(ot,null,"Value"))),(0,t.jsx)(E,null,Object.entries(r.quirks).map(([n,o],a)=>(0,t.jsx)(z,{key:a,border:"bottom"},(0,t.jsx)(w,null,(0,t.jsx)("strong",null,n)),(0,t.jsx)(w,null,o))))):(0,t.jsx)(K,{title:"No quirks configured",text:"There are currently no quirks setup."})))};var C=require("formik");var Dt=require("formik");var x=require("@emotion/react"),kt=x.css`
|
|
369
291
|
background: var(--white);
|
|
370
292
|
border: 1px solid var(--gray-500);
|
|
371
293
|
border-radius: var(--rounded-base);
|
|
@@ -376,11 +298,9 @@ to {
|
|
|
376
298
|
cursor: not-allowed;
|
|
377
299
|
color: var(--gray-200);
|
|
378
300
|
}
|
|
379
|
-
`,
|
|
301
|
+
`,xt=x.css`
|
|
380
302
|
appearance: none;
|
|
381
|
-
background: var(--white)
|
|
382
|
-
url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNi4zNDMxNyA3Ljc1NzMyTDQuOTI4OTYgOS4xNzE1NEwxMiAxNi4yNDI2TDE5LjA3MTEgOS4xNzE1N0wxNy42NTY5IDcuNzU3MzVMMTIgMTMuNDE0Mkw2LjM0MzE3IDcuNzU3MzJaIgogICAgZmlsbD0iIzgyODI4MiIKICAvPgo8L3N2Zz4=')
|
|
383
|
-
no-repeat 98% 50%;
|
|
303
|
+
background: var(--white) url('./assets/chevon-down.svg') no-repeat 98% 50%;
|
|
384
304
|
border: 1px solid var(--gray-500);
|
|
385
305
|
border-radius: var(--rounded-base);
|
|
386
306
|
color: var(--brand-secondary-1);
|
|
@@ -389,105 +309,31 @@ to {
|
|
|
389
309
|
cursor: not-allowed;
|
|
390
310
|
color: var(--gray-200);
|
|
391
311
|
}
|
|
392
|
-
`,
|
|
393
|
-
padding: var(--spacing-sm);
|
|
394
|
-
max-width: 160px;
|
|
395
|
-
`,le=T.css`
|
|
312
|
+
`,q=x.css`
|
|
396
313
|
margin: var(--spacing-base) 0;
|
|
397
|
-
`,
|
|
314
|
+
`,W=x.css`
|
|
398
315
|
color: var(--brand-secondary-1);
|
|
399
316
|
display: flex;
|
|
400
317
|
flex-direction: column;
|
|
401
318
|
margin: 0 0 var(--spacing-sm);
|
|
402
|
-
`,
|
|
319
|
+
`,Q=x.css`
|
|
403
320
|
color: var(--brand-secondary-1);
|
|
404
321
|
display: block;
|
|
405
|
-
flex: 1 100%;
|
|
406
322
|
font-weight: var(--font-bold);
|
|
407
323
|
margin: 0 0 var(--spacing-sm);
|
|
408
|
-
`,
|
|
324
|
+
`,X=x.css`
|
|
409
325
|
color: var(--gray-600);
|
|
410
326
|
font-size: var(--font-sm);
|
|
411
|
-
`,
|
|
327
|
+
`,Y=x.css`
|
|
412
328
|
color: var(--brand-secondary-5);
|
|
413
329
|
display: block;
|
|
414
|
-
|
|
415
|
-
flex-direction: row;
|
|
416
|
-
flex-wrap: wrap;
|
|
417
|
-
|
|
418
|
-
input[type='range'] {
|
|
419
|
-
height: 28px;
|
|
420
|
-
-webkit-appearance: none;
|
|
421
|
-
margin: 10px 0;
|
|
422
|
-
width: 100%;
|
|
423
|
-
flex: 1 0 80%;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
input[type='range']:focus {
|
|
427
|
-
outline: none;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
input[type='range']::-webkit-slider-runnable-track {
|
|
431
|
-
width: 100%;
|
|
432
|
-
height: 6px;
|
|
433
|
-
cursor: pointer;
|
|
434
|
-
animate: 0.2s;
|
|
435
|
-
box-shadow: 0 0 0 #000000;
|
|
436
|
-
background: #2ecdb4;
|
|
437
|
-
border-radius: 0;
|
|
438
|
-
border: 0 solid #000000;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
input[type='range']::-moz-range-track {
|
|
442
|
-
width: 100%;
|
|
443
|
-
height: 6px;
|
|
444
|
-
cursor: pointer;
|
|
445
|
-
animate: 0.2s;
|
|
446
|
-
box-shadow: 0 0 0 #000000;
|
|
447
|
-
background: #2ecdb4;
|
|
448
|
-
border-radius: 0;
|
|
449
|
-
border: 0 solid #000000;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
input[type='range']::-webkit-slider-thumb {
|
|
453
|
-
box-shadow: 1px 1px 2px #000000;
|
|
454
|
-
border: 1px solid #000000;
|
|
455
|
-
height: 20px;
|
|
456
|
-
width: 20px;
|
|
457
|
-
border-radius: 20px;
|
|
458
|
-
background: #ffffff;
|
|
459
|
-
cursor: pointer;
|
|
460
|
-
-webkit-appearance: none;
|
|
461
|
-
margin-top: -7.5px;
|
|
462
|
-
}
|
|
463
|
-
input[type='range']::-moz-range-thumb {
|
|
464
|
-
box-shadow: 1px 1px 2px #000000;
|
|
465
|
-
border: 1px solid #000000;
|
|
466
|
-
height: 20px;
|
|
467
|
-
width: 20px;
|
|
468
|
-
border-radius: 20px;
|
|
469
|
-
background: #ffffff;
|
|
470
|
-
cursor: pointer;
|
|
471
|
-
-webkit-appearance: none;
|
|
472
|
-
margin-top: -7.5px;
|
|
473
|
-
}
|
|
474
|
-
input[type='range']:focus::-webkit-slider-runnable-track {
|
|
475
|
-
background: #2ecdb4;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
.value-display {
|
|
479
|
-
flex: 1 0 20%;
|
|
480
|
-
padding: 10px;
|
|
481
|
-
}
|
|
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`
|
|
330
|
+
`;var J=({field:e,form:r,meta:n,...o})=>{let{label:a,caption:i,...m}=o;return(0,t.jsx)("div",{css:q},(0,t.jsx)("label",{css:W},(0,t.jsx)("span",{css:Q},a),(0,t.jsx)("input",{type:"text",css:kt,...e,...m})),i?(0,t.jsx)("span",{css:X},i):null,(0,t.jsx)(Dt.ErrorMessage,{component:"div",css:Y,name:e.name}))};var Rt=require("formik");var St=({field:e,form:r,meta:n,...o})=>{let{label:a,options:i,caption:m,...f}=o;return(0,t.jsx)("div",{css:q},(0,t.jsx)("label",{css:W},(0,t.jsx)("span",{css:Q},a),(0,t.jsx)("select",{...e,...f,css:xt},i.map((c,l)=>(0,t.jsx)("option",{value:c.value,key:l},c.text)))),m?(0,t.jsx)("span",{css:X},m):null,(0,t.jsx)(Rt.ErrorMessage,{component:"div",css:Y,name:e.name}))};var P=T(require("yup"));var Ht=require("@emotion/react"),rt=({children:e,...r})=>(0,t.jsx)("fieldset",{css:Ht.css`
|
|
483
331
|
border: none;
|
|
484
332
|
padding: 0;
|
|
485
|
-
`,...r},
|
|
486
|
-
font-size: var(--font-
|
|
333
|
+
`,...r},e);var Vt=require("@emotion/react"),nt=({children:e})=>(0,t.jsx)("legend",{css:Vt.css`
|
|
334
|
+
font-size: var(--font-base);
|
|
487
335
|
font-weight: var(--font-bold);
|
|
488
|
-
|
|
489
|
-
width: 100%;
|
|
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,`
|
|
336
|
+
`},e);var ee=P.object({apiKey:P.string().matches(/^uf.+$/,"API keys start with `uf`, double check your API key"),apiHost:P.string().matches(/^https:\/\/(localhost:8889|([a-z]+\.)?uniform.app)$/,"API host must be a Uniform domain."),logLevel:P.string(),projectId:P.string().uuid()}),Pt=({settings:e,saveSettings:r,dimensionIndex:{error:n,loading:o}})=>{let a=[{value:"none",text:"Logging off"},{value:"info",text:"Log info, warnings, and errors"},{value:"warn",text:"Log warnings and errors"},{value:"error",text:"Log errors"},{value:"debug",text:"Verbose debug logging"}];return(0,t.jsx)(C.Formik,{initialValues:{apiHost:"",apiKey:"",projectId:"",logLevel:"none",...e},validationSchema:ee,enableReinitialize:!0,onSubmit:i=>{r({...e,apiHost:i.apiHost,apiKey:i.apiKey,projectId:i.projectId,logLevel:i.logLevel})}},({dirty:i,isValid:m,isSubmitting:f})=>(0,t.jsx)(C.Form,{css:u.page},(0,t.jsx)("h1",{css:u.title},"Settings"),(0,t.jsx)(C.Field,{component:St,label:"Logging",caption:"Logs can be viewed in the browser console",id:"logging",name:"logLevel",options:a,disabled:f}),(0,t.jsx)(rt,{disabled:f},(0,t.jsx)(nt,null,"Data Connection"),!o&&n?(0,t.jsx)("p",{css:u.error},"Unable to fetch data from Uniform",(0,t.jsx)("br",null),(0,t.jsx)("em",null,n.message)):null,(0,t.jsx)("p",{css:u.text},(0,t.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,t.jsx)(C.Field,{component:J,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,t.jsx)(C.Field,{component:J,label:"Uniform Project ID",caption:"Available after generating an API key ",id:"project-id",name:"projectId",autoComplete:"off"}),(0,t.jsx)(Z,null,(0,t.jsx)(U,{title:"Advanced"},(0,t.jsx)(C.Field,{component:J,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"}))),i?(0,t.jsx)(H,{type:"submit",css:u.submitButton,disabled:!m},"Save"):null)))};var at=({settings:e,saveSettings:r})=>{let n=()=>{r({...e,route:"/settings"})},o=()=>{r({...e,ignoreApiKeyPrompt:!0})},a=!(e==null?void 0:e.apiKey);return!e.ignoreApiKeyPrompt&&a?(0,t.jsx)("div",{css:[N,gt]},(0,t.jsx)("h2",{css:O},"Connect this site"),(0,t.jsx)("p",{css:_},"Add a Uniform API key to get better data."),(0,t.jsx)("div",{css:G},(0,t.jsx)(H,{buttonType:"secondary",onClick:n},"Connect this site"),(0,t.jsx)(H,{buttonType:"ghost",onClick:o},"Skip for now")),(0,t.jsx)("button",{type:"button",css:ft,title:"close",onClick:o},(0,t.jsx)("span",{hidden:!0},"Close"))):null};var A=require("@uniformdev/context/api"),At=require("react-use"),Mt=T(require("react"));function zt({apiHost:e,apiKey:r,projectId:n},o){let a=Mt.useMemo(()=>{var l,p,b,h;let c={};return o&&(Object.keys((p=(l=o==null?void 0:o.project.pz)==null?void 0:l.sig)!=null?p:{}).forEach(g=>{let L=(0,A.computeDimensionDisplayData)(g,o);L&&(c[g]=L)}),Object.keys((h=(b=o==null?void 0:o.project.pz)==null?void 0:b.agg)!=null?h:{}).forEach(g=>{let L=(0,A.computeDimensionDisplayData)(g,o);L&&(c[g]=L)})),c},[o]),{loading:i,error:m,value:f}=(0,At.useAsync)(async()=>{if(!r||!n)return a;let l=(await new A.DimensionClient({projectId:n,apiKey:r,apiHost:e||void 0}).get()).dimensions,p={...a};return l.forEach(b=>{p[b.dim]=(0,A.computeDimensionDefinitionDisplayData)(b)}),p},[e,r,n,a]);return{loading:i,error:m,index:f!=null?f:a}}var tt=require("@emotion/react");function j(){return(0,t.jsx)("style",null,`
|
|
491
337
|
:root {
|
|
492
338
|
--brand-primary-1: #438fd5; /* bright blue */
|
|
493
339
|
--brand-primary-2: #f4220b; /* red */
|
|
@@ -547,10 +393,6 @@ to {
|
|
|
547
393
|
--gray-800: #1f2937;
|
|
548
394
|
--gray-900: #111827;
|
|
549
395
|
|
|
550
|
-
/* Red CTA */
|
|
551
|
-
--red-button: rgb(217 83 79);
|
|
552
|
-
--red-tooltip: #D9534F;
|
|
553
|
-
|
|
554
396
|
/* z-indexs */
|
|
555
397
|
--z-10: 10;
|
|
556
398
|
}
|
|
@@ -852,7 +694,7 @@ Add the correct display in Chrome and Safari.
|
|
|
852
694
|
|
|
853
695
|
summary {
|
|
854
696
|
display: list-item;
|
|
855
|
-
}`)}var
|
|
697
|
+
}`)}var oe=tt.css`
|
|
856
698
|
background: var(--white);
|
|
857
699
|
padding: var(--spacing-base);
|
|
858
700
|
overflow-y: auto;
|
|
@@ -881,16 +723,23 @@ summary {
|
|
|
881
723
|
&::-webkit-scrollbar-thumb:hover {
|
|
882
724
|
background: var(--gray-500);
|
|
883
725
|
}
|
|
884
|
-
`;function
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
726
|
+
`;function it(e){let r=typeof chrome!="undefined"&&typeof chrome.storage!="undefined",n=zt(e.settings,e.state.manifest),o={...e,dimensionIndex:n},a=()=>{var i;switch((i=e.settings)==null?void 0:i.route){case void 0:case"/":case"/dimensions":return(0,t.jsx)(Lt,{...o});case"/quirks":return(0,t.jsx)(Tt,{...o});case"/settings":return(0,t.jsx)(Pt,{...o});default:return(0,t.jsx)(dt,null)}};return(0,t.jsx)(d.Fragment,null,(0,t.jsx)(j,null),(0,t.jsx)("div",{css:[tt.css`
|
|
727
|
+
display: grid;
|
|
728
|
+
grid-template-columns: 200px auto;
|
|
729
|
+
font-weight: var(--font-regular);
|
|
730
|
+
font-size: var(--base-font-size);
|
|
731
|
+
font-family: var(--base-font-family);
|
|
732
|
+
line-height: var(--base-line-height);
|
|
733
|
+
height: var(--min-height);
|
|
734
|
+
min-width: var(--site-width);
|
|
735
|
+
`,r?void 0:tt.css`
|
|
736
|
+
box-shadow: var(--shadow-base);
|
|
737
|
+
position: fixed;
|
|
738
|
+
bottom: 82px;
|
|
739
|
+
right: var(--spacing-base);
|
|
740
|
+
z-index: var(--z-10);
|
|
741
|
+
max-width: var(--site-width);
|
|
742
|
+
`]},(0,t.jsx)(pt,{...e}),(0,t.jsx)("main",{css:oe},(0,t.jsx)(at,{...e}),a())))}var et=require("@uniformdev/context"),D=T(require("react"));function st({context:e,initialSettings:r}){let n=e!=null?e:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new et.Context({manifest:{project:{}}}),[a,i]=D.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[m,f]=D.useState(r!=null?r:{});D.useEffect(()=>{var p;let l=(0,et.createDebugConsoleLogDrain)((p=m.logLevel)!=null?p:"none");return o.events.on("log",l),()=>{o.events.off("log",l)}},[m,o]),D.useEffect(()=>{let l=()=>{i(h=>({...h,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},p=h=>{!h.changed||i(g=>({...g,personalizations:[...g.personalizations,h]}))},b=h=>{!h.variantAssigned||i(g=>({...g,tests:[...g.tests,h]}))};return o.events.on("personalizationResult",p),o.events.on("testResult",b),o.storage.events.on("*",l),()=>{o.storage.events.off("*",l),o.events.off("personalizationResult",p),o.events.off("testResult",b)}},[o,m]);let c=D.useMemo(()=>({update:p=>o.update(p),forget:()=>o.forget(!1),rawUpdate:p=>o.storage.updateData(p)}),[o]);return n?(0,t.jsx)(it,{state:a,actions:c,settings:m,saveSettings:f}):(0,t.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}var Bt=T(require("react"));var It=require("@emotion/react"),re=It.css`
|
|
894
743
|
align-items: center;
|
|
895
744
|
border-radius: var(--rounded-full);
|
|
896
745
|
background: var(--brand-secondary-5);
|
|
@@ -916,11 +765,4 @@ summary {
|
|
|
916
765
|
max-width: 100%;
|
|
917
766
|
height: auto;
|
|
918
767
|
}
|
|
919
|
-
`,
|
|
920
|
-
box-shadow: var(--shadow-base);
|
|
921
|
-
position: fixed;
|
|
922
|
-
bottom: 82px;
|
|
923
|
-
right: var(--spacing-base);
|
|
924
|
-
z-index: var(--z-10);
|
|
925
|
-
max-width: var(--site-width);
|
|
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});
|
|
768
|
+
`,Et=({...e})=>(0,t.jsx)("button",{type:"button",css:re,...e},(0,t.jsx)("span",{hidden:!0},"Uniform devtools"),(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.jsx)("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),(0,t.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,t.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 ne(e){var a;let[r,n]=Bt.useState(!1);return((a=e.context)!=null?a:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?(0,t.jsx)("div",null,(0,t.jsx)(j,null),(0,t.jsx)(Et,{onClick:()=>n(i=>!i)}),r?(0,t.jsx)(st,{...e}):null):(0,t.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}module.exports=Gt(ae);0&&(module.exports={ContextDevTools,EmbeddedContextDevTools,ToggleEmbeddedContextDevTools});
|