@uniformdev/context-devtools 12.2.1-alpha.177 → 13.0.1-alpha.96
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/check-BVHJYFC2.svg +12 -0
- package/dist/chevron-down-U4FYSTLW.svg +12 -0
- package/dist/esm/check-BVHJYFC2.svg +12 -0
- package/dist/esm/chevron-down-U4FYSTLW.svg +12 -0
- package/dist/esm/index.js +1086 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +1053 -4
- package/package.json +18 -33
- package/dist/index.mjs +0 -970
- package/dist/modules.d.ts +0 -9
- package/dist/src/components/Accordion/Accordion.d.ts +0 -7
- package/dist/src/components/Buttons/Button.d.ts +0 -5
- package/dist/src/components/Buttons/EmbedToggleButton.d.ts +0 -2
- package/dist/src/components/CallToAction/ConnectApiKey.d.ts +0 -3
- package/dist/src/components/CallToAction/NoActiveDimensions.d.ts +0 -8
- package/dist/src/components/CallToAction/index.d.ts +0 -2
- package/dist/src/components/ContextDevTools.d.ts +0 -22
- package/dist/src/components/EmbeddedContextDevTools.d.ts +0 -18
- package/dist/src/components/Inputs/InputText.d.ts +0 -7
- package/dist/src/components/Inputs/SelectInput.d.ts +0 -11
- package/dist/src/components/Inputs/SwitchInput.d.ts +0 -5
- package/dist/src/components/Navigation/Menu.d.ts +0 -4
- package/dist/src/components/NotFound/NotFound.d.ts +0 -2
- package/dist/src/components/Personalization/Dimensions.d.ts +0 -3
- package/dist/src/components/Personalization/Quirks.d.ts +0 -3
- package/dist/src/components/Personalization/Settings.d.ts +0 -3
- package/dist/src/components/Personalization/index.d.ts +0 -4
- package/dist/src/components/Table/Table.d.ts +0 -17
- package/dist/src/components/Table/index.d.ts +0 -2
- package/dist/src/hooks/useDimensionIndex.d.ts +0 -12
- package/dist/src/index.d.ts +0 -2
- package/dist/style.css +0 -1
|
@@ -0,0 +1,1086 @@
|
|
|
1
|
+
import{jsx as e}from"@emotion/react";import*as b from"react";import{css as H}from"@emotion/react";import{createContext as Ht,useContext as Vt}from"react";var Le=Ht({settings:{},saveSettings:()=>null}),W=()=>Vt(Le),Se=({children:t,settings:r,saveSettings:n})=>e(Le.Provider,{value:{settings:r,saveSettings:n}},t);var At=({route:t,children:r,className:n})=>{let{settings:o,saveSettings:i}=W();return e("a",{href:"",className:n,onClick:s=>{s.preventDefault(),i({...o,route:t})}},r)},M=At;var Et=[{title:"Dimensions",href:"/dimensions",icon:`<svg
|
|
2
|
+
width="24"
|
|
3
|
+
height="24"
|
|
4
|
+
viewBox="0 0 24 24"
|
|
5
|
+
fill="none"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<path d="M13 7H11V17H13V7Z" fill="currentColor" />
|
|
9
|
+
<path
|
|
10
|
+
d="M5.99996 7.75732L7.41418 9.17154L5.58572 11L9.99996 11V13L5.58579 13L7.41418 14.8284L5.99996 16.2426L1.75732 12L5.99996 7.75732Z"
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
d="M18 16.2427L16.5858 14.8285L18.4143 13H14V11L18.4142 11L16.5858 9.17161L18 7.75739L22.2427 12L18 16.2427Z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
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
|
+
`},{title:"Quirks",href:"/quirks",icon:`<svg
|
|
22
|
+
width="24"
|
|
23
|
+
height="24"
|
|
24
|
+
viewBox="0 0 24 24"
|
|
25
|
+
fill="none"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
+
>
|
|
28
|
+
<path d="M6 6H10V4H4V10H6V6Z" fill="currentColor" />
|
|
29
|
+
<path d="M10 18H6V14H4V20H10V18Z" fill="currentColor" />
|
|
30
|
+
<path d="M14 6H18V10H20V4H14V6Z" fill="currentColor" />
|
|
31
|
+
<path d="M14 18H18V14H20V20H14V18Z" fill="currentColor" />
|
|
32
|
+
<path
|
|
33
|
+
d="M12 8.5C10.067 8.5 8.5 10.067 8.5 12C8.5 13.933 10.067 15.5 12 15.5C13.933 15.5 15.5 13.933 15.5 12C15.5 10.067 13.933 8.5 12 8.5Z"
|
|
34
|
+
fill="currentColor"
|
|
35
|
+
/>
|
|
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
|
+
<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
|
+
</svg>
|
|
39
|
+
`}],De=({...t})=>{let r=n=>{var i;let o="active";return!((i=t.settings)!=null&&i.route)&&n==="/dimensions"||t.settings.route===n?o:""};return e("nav",{css:H`
|
|
40
|
+
background: var(--brand-secondary-1);
|
|
41
|
+
padding: var(--spacing-base);
|
|
42
|
+
min-width: 200px;
|
|
43
|
+
`},e(M,{css:H`
|
|
44
|
+
display: inline-block;
|
|
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:H`
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-flow: column nowrap;
|
|
49
|
+
padding: 0;
|
|
50
|
+
margin: 0;
|
|
51
|
+
list-style-type: none;
|
|
52
|
+
height: calc(100% - var(--spacing-base) * 2.5);
|
|
53
|
+
`},Et.map((n,o)=>{var s,c,v,m;let i=0;return n.href==="/overrides"&&Object.keys((s=t.settings.scoreOverrides)!=null?s:{}).length>0&&(i=Object.keys((c=t.settings.scoreOverrides)!=null?c:{}).length),n.href==="/quirks"&&Object.keys((v=t.settings.quirkOverrides)!=null?v:{}).length>0&&(i=Object.keys((m=t.settings.quirkOverrides)!=null?m:{}).length),e("li",{css:H`
|
|
54
|
+
padding: 0;
|
|
55
|
+
margin: 0;
|
|
56
|
+
list-style-type: none;
|
|
57
|
+
|
|
58
|
+
&:last-of-type {
|
|
59
|
+
margin-top: auto;
|
|
60
|
+
}
|
|
61
|
+
`,key:o},e(M,{css:H`
|
|
62
|
+
align-items: center;
|
|
63
|
+
border-radius: var(--rounded-base);
|
|
64
|
+
display: flex;
|
|
65
|
+
color: var(--white);
|
|
66
|
+
gap: var(--spacing-sm);
|
|
67
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
transition: background-color 0.25s ease-in-out;
|
|
70
|
+
|
|
71
|
+
&:hover,
|
|
72
|
+
&.active {
|
|
73
|
+
background: var(--gray-700);
|
|
74
|
+
}
|
|
75
|
+
`,className:r(n.href),route:n.href},e("i",{css:H`
|
|
76
|
+
align-items: center;
|
|
77
|
+
display: flex;
|
|
78
|
+
`,dangerouslySetInnerHTML:{__html:n.icon}}),n.title,i?e("span",{css:H`
|
|
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
|
+
line-height: 12px;
|
|
87
|
+
`},i):null))})))};var Oe=()=>e("article",null,e("h1",null,"Something when wrong"),e("p",null,"We could not find the page you're looking for."));import*as ce from"react";import{css as B}from"@emotion/react";import*as Y from"react";var Ie=B({willChange:"height"}),Bt=B`
|
|
88
|
+
border-bottom: 2px solid var(--brand-secondary-1);
|
|
89
|
+
font-size: var(--font-base);
|
|
90
|
+
margin: 0;
|
|
91
|
+
`,zt=B`
|
|
92
|
+
align-items: center;
|
|
93
|
+
border: none;
|
|
94
|
+
background: none;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
display: flex;
|
|
97
|
+
width: 100%;
|
|
98
|
+
padding: var(--spacing-sm) 0;
|
|
99
|
+
font-weight: var(--font-bold);
|
|
100
|
+
justify-content: space-between;
|
|
101
|
+
`,Ft=B`
|
|
102
|
+
align-self: center;
|
|
103
|
+
`,Nt=B`
|
|
104
|
+
transform: rotate(-180deg);
|
|
105
|
+
`,X=({children:t})=>e("div",{css:[Ie]},t),J=({title:t,children:r})=>{let[n,o]=Y.useState(!1),i=t.split(" ").join("-").toLocaleLowerCase();return e(Y.Fragment,null,e("h3",{css:Bt},e("button",{"aria-expanded":n,css:zt,title:t,id:i,"aria-controls":`${i}-section`,onClick:()=>o(s=>!s),type:"button"},t,e("i",{css:[Ft,n?Nt: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:[Ie,B`
|
|
106
|
+
padding: var(--spacing-sm) 0;
|
|
107
|
+
`],role:"region","aria-labelledby":i},n?r:null))};import{css as z}from"@emotion/react";var j=z`
|
|
108
|
+
background-color: var(--gray-100);
|
|
109
|
+
padding: var(--spacing-base) var(--spacing-md);
|
|
110
|
+
margin: var(--spacing-base) 0;
|
|
111
|
+
position: relative;
|
|
112
|
+
&:first-of-type {
|
|
113
|
+
margin: 0 0 var(--spacing-base);
|
|
114
|
+
}
|
|
115
|
+
`,Re=z`
|
|
116
|
+
background: var(--gray-100)
|
|
117
|
+
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")
|
|
118
|
+
no-repeat var(--spacing-sm) var(--spacing-base);
|
|
119
|
+
padding: var(--spacing-base) var(--spacing-xl);
|
|
120
|
+
`,ee=z`
|
|
121
|
+
color: var(--brand-secondary-1);
|
|
122
|
+
margin: 0;
|
|
123
|
+
font-size: var(--font-base);
|
|
124
|
+
font-weight: var(--font-bold);
|
|
125
|
+
`,te=z`
|
|
126
|
+
color: var(--brand-secondary-1);
|
|
127
|
+
margin: var(--spacing-xs) 0 0;
|
|
128
|
+
font-size: var(--font-sm);
|
|
129
|
+
`,Pe=z`
|
|
130
|
+
align-items: center;
|
|
131
|
+
border: none;
|
|
132
|
+
background: transparent
|
|
133
|
+
url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.2253 4.81108C5.83477 4.42056 5.20161 4.42056 4.81108 4.81108C4.42056 5.20161 4.42056 5.83477 4.81108 6.2253L10.5858 12L4.81114 17.7747C4.42062 18.1652 4.42062 18.7984 4.81114 19.1889C5.20167 19.5794 5.83483 19.5794 6.22535 19.1889L12 13.4142L17.7747 19.1889C18.1652 19.5794 18.7984 19.5794 19.1889 19.1889C19.5794 18.7984 19.5794 18.1652 19.1889 17.7747L13.4142 12L19.189 6.2253C19.5795 5.83477 19.5795 5.20161 19.189 4.81108C18.7985 4.42056 18.1653 4.42056 17.7748 4.81108L12 10.5858L6.2253 4.81108Z' fill='%232ecdb4' /%3E%3C/svg%3E")
|
|
134
|
+
no-repeat center center;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
color: var(--brand-secondary-3);
|
|
137
|
+
display: flex;
|
|
138
|
+
padding: 0;
|
|
139
|
+
position: absolute;
|
|
140
|
+
width: 24px;
|
|
141
|
+
height: 24px;
|
|
142
|
+
top: var(--spacing-base);
|
|
143
|
+
right: var(--spacing-sm);
|
|
144
|
+
transition: opacity 0.2s ease-in-out;
|
|
145
|
+
|
|
146
|
+
&:hover {
|
|
147
|
+
opacity: 0.6;
|
|
148
|
+
}
|
|
149
|
+
`,oe=z`
|
|
150
|
+
display: flex;
|
|
151
|
+
margin: var(--spacing-sm) 0 0;
|
|
152
|
+
gap: var(--spacing-base);
|
|
153
|
+
`;var F=({title:t,text:r,buttonGroup:n,children:o})=>e("div",{css:j},e("h2",{css:ee},t),e("p",{css:te},r),o,n?e("div",{css:oe},n):null);import{css as D,keyframes as Qt}from"@emotion/react";var Zt=Qt`from {
|
|
154
|
+
transform: scale(1);
|
|
155
|
+
}
|
|
156
|
+
to {
|
|
157
|
+
transform: scale(1.2);
|
|
158
|
+
}
|
|
159
|
+
`,h={page:D`
|
|
160
|
+
color: var(--brand-secondary-1);
|
|
161
|
+
`,text:D`
|
|
162
|
+
margin: var(--spacing-sm) 0;
|
|
163
|
+
`,reset:D`
|
|
164
|
+
margin: 0 var(--spacing-md);
|
|
165
|
+
font-size: var(--font-sm);
|
|
166
|
+
color: var(--gray-500);
|
|
167
|
+
`,title:D`
|
|
168
|
+
margin: 0 0 var(--spacing-sm);
|
|
169
|
+
font-size: var(--font-md);
|
|
170
|
+
& > small {
|
|
171
|
+
display: block;
|
|
172
|
+
font-size: var(--font-xs);
|
|
173
|
+
font-weight: var(--font-regular);
|
|
174
|
+
margin: var(--spacing-xxs) 0 0;
|
|
175
|
+
}
|
|
176
|
+
`,headingGroup:D`
|
|
177
|
+
align-items: baseline;
|
|
178
|
+
display: flex;
|
|
179
|
+
justify-content: space-between;
|
|
180
|
+
align-items: center;
|
|
181
|
+
`,divider:D`
|
|
182
|
+
background: var(--gray-300);
|
|
183
|
+
display: block;
|
|
184
|
+
width: 1px;
|
|
185
|
+
height: calc(100% - 1rem);
|
|
186
|
+
position: absolute;
|
|
187
|
+
inset: 0 auto 0 0;
|
|
188
|
+
margin: auto 0;
|
|
189
|
+
`,submitButton:D`
|
|
190
|
+
position: absolute;
|
|
191
|
+
right: var(--spacing-base);
|
|
192
|
+
bottom: var(--spacing-base);
|
|
193
|
+
animation: 0.5s 2 alternate ${Zt};
|
|
194
|
+
`,cancelButton:D`
|
|
195
|
+
position: absolute;
|
|
196
|
+
left: calc(200px + var(--spacing-base));
|
|
197
|
+
bottom: var(--spacing-base);
|
|
198
|
+
background: white;
|
|
199
|
+
padding: var(--spacing-sm);
|
|
200
|
+
border: 1px solid var(--gray-300);
|
|
201
|
+
`,error:D`
|
|
202
|
+
color: var(--brand-secondary-5);
|
|
203
|
+
font-size: var(--font-sm);
|
|
204
|
+
`,quirks:D`
|
|
205
|
+
.uniform-input-select,
|
|
206
|
+
input {
|
|
207
|
+
padding: var(--spacing-sm);
|
|
208
|
+
}
|
|
209
|
+
`};import{css as O}from"@emotion/react";var re=({children:t})=>e("table",{css:O`
|
|
210
|
+
border-collapse: collapse;
|
|
211
|
+
display: table;
|
|
212
|
+
width: 100%;
|
|
213
|
+
font-size: var(--font-sm);
|
|
214
|
+
`},t),Me=({children:t})=>e("thead",{css:O`
|
|
215
|
+
background: var(--gray-50);
|
|
216
|
+
text-align: left;
|
|
217
|
+
& tr {
|
|
218
|
+
border-bottom: 1px solid var(--gray-200);
|
|
219
|
+
}
|
|
220
|
+
`},t),ne=({children:t})=>e("tbody",null,t),U=({border:t,children:r})=>e("tr",{css:t?O`
|
|
221
|
+
border-bottom: 1px solid var(--gray-200);
|
|
222
|
+
&:where(:last-child) {
|
|
223
|
+
border: none;
|
|
224
|
+
}
|
|
225
|
+
`:void 0},r),ie=({children:t,width:r})=>e("th",{css:O`
|
|
226
|
+
outline: none;
|
|
227
|
+
padding: var(--spacing-sm);
|
|
228
|
+
width: ${r!=null?r:"auto"};
|
|
229
|
+
`},t);function qt(t){switch(t){case"light":return O`
|
|
230
|
+
color: var(--gray-400);
|
|
231
|
+
`;case"dark":return O`
|
|
232
|
+
color: var(--brand-secondary-1);
|
|
233
|
+
`}}function Ut(t){return O`
|
|
234
|
+
text-align: ${t};
|
|
235
|
+
`}var I=({alignment:t="left",border:r,color:n="dark",children:o})=>e("td",{css:[O`
|
|
236
|
+
padding: var(--spacing-base);
|
|
237
|
+
max-width: 180px;
|
|
238
|
+
overflow-wrap: break-word;
|
|
239
|
+
position: relative;
|
|
240
|
+
`,qt(n),Ut(t),r?O`
|
|
241
|
+
border-left: 1px solid var(--gray-200);
|
|
242
|
+
`:void 0]},o);import{css as ye}from"@emotion/react";var He=ye`
|
|
243
|
+
position: relative;
|
|
244
|
+
display: inline-block;
|
|
245
|
+
font-size: var(--font-base);
|
|
246
|
+
`,Ve=ye`
|
|
247
|
+
display: block;
|
|
248
|
+
`,Ae=ye`
|
|
249
|
+
position: absolute;
|
|
250
|
+
width: 6px;
|
|
251
|
+
height: 6px;
|
|
252
|
+
right: -10px;
|
|
253
|
+
top: 9px;
|
|
254
|
+
background: var(--red-tooltip);
|
|
255
|
+
border-radius: 3px;
|
|
256
|
+
`;import{css as _t}from"@emotion/react";var Gt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
257
|
+
<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"/>
|
|
258
|
+
<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"/>
|
|
259
|
+
<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"/>
|
|
260
|
+
</svg>`,$t=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
261
|
+
<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"/>
|
|
262
|
+
<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"/>
|
|
263
|
+
<path d="M11.9999 5.05762H8.3999V6.2576H11.9999V5.05762Z" fill="#828282"/>
|
|
264
|
+
<path d="M8.3999 7.45752H11.9999V8.6575H8.3999V7.45752Z" fill="#828282"/>
|
|
265
|
+
<path d="M11.9999 2.65771H8.3999V3.8577H11.9999V2.65771Z" fill="#828282"/>
|
|
266
|
+
</svg>`,Ee=`<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
267
|
+
<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"/>
|
|
268
|
+
<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"/>
|
|
269
|
+
<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"/>
|
|
270
|
+
<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"/>
|
|
271
|
+
<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"/>
|
|
272
|
+
</svg>`,Be=({type:t})=>{let r="";switch(t){case"Audience":r=Gt;break;case"Signal":r=Ee;break;case"Intent":r=Ee;break;case"Enrichment":r=$t;break}return e("i",{css:_t`
|
|
273
|
+
align-items: center;
|
|
274
|
+
display: inline-block;
|
|
275
|
+
`,dangerouslySetInnerHTML:{__html:r}})};var Kt=({dimensionIndex:t,dimensions:r,disableEditOverride:n,onClick:o,preemptiveOverrides:i})=>{var v;let{settings:s}=W(),c=(v=i!=null?i:s.scoreOverrides)!=null?v:{};return e(re,null,e(ne,null,Object.entries(r).sort(([m],[l])=>m.localeCompare(l)).map(([m,l])=>{var w;let{dim:a,name:p,type:d,category:f}=(w=t[m])!=null?w:{name:m,dim:m,type:void 0,category:void 0},y=c[a];return e(U,{key:a},e(I,null,y!==void 0?e("s",{css:Ve},y.initial):null,e("b",{css:He},l,y!==void 0&&e("i",{css:Ae}))),e(I,null,e("div",{onClick:()=>o==null?void 0:o(a),css:o?{cursor:"pointer"}:void 0},e("span",{css:h.divider,role:"presentation"}),e("div",null,e(Be,{type:d})," ",d),e("strong",null,f?`${f}:`:""," ",p))),e(I,{alignment:"right",color:"light"},y!==void 0&&!n?e(M,{route:`/overrides/${a}`},"Edit override"):null))})))},V=Kt;async function ae({actions:t,saveSettings:r,scores:n,settings:o}){var v,m;let i=(v=o.scoreOverrides)!=null?v:{},s={...i},c=[];for(let l of Object.keys(i)){let a=i==null?void 0:i[l];delete s[l],c.push({type:"modscoreS",data:{dimension:l,delta:a.initial-((m=n[l])!=null?m:0)}})}await r({...o,scoreOverrides:s}),await t.rawUpdate(c)}async function ze({quirk:t,settings:r,saveSettings:n,actions:o}){var c;let i=(c=r.quirkOverrides)==null?void 0:c[t];if(!i)return;let s={...r.quirkOverrides};delete s[t],await n({...r,quirkOverrides:s}),await o.rawUpdate([{type:"setquirk",data:{key:t,value:i.initial}}])}import*as _e from"react";import{Button as Wt}from"reakit/Button";import{css as N}from"@emotion/react";var Fe=N`
|
|
276
|
+
align-items: center;
|
|
277
|
+
border: 1px solid transparent;
|
|
278
|
+
cursor: pointer;
|
|
279
|
+
display: inline-flex;
|
|
280
|
+
font-weight: var(--font-medium);
|
|
281
|
+
transition: opacity var(--duration) var(--timing), color var(--duration) var(--timing),
|
|
282
|
+
border-color var(--duration) var(--timing);
|
|
283
|
+
|
|
284
|
+
&:focus {
|
|
285
|
+
outline: none;
|
|
286
|
+
border-color: var(--gray-700);
|
|
287
|
+
box-shadow: var(--ring);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:hover,
|
|
291
|
+
&:active {
|
|
292
|
+
opacity: var(--opacity-75);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
&:disabled {
|
|
296
|
+
cursor: not-allowed;
|
|
297
|
+
}
|
|
298
|
+
`,Ne=N`
|
|
299
|
+
background: var(--brand-secondary-1);
|
|
300
|
+
color: var(--white);
|
|
301
|
+
|
|
302
|
+
&:disabled {
|
|
303
|
+
background: var(--gray-500);
|
|
304
|
+
color: var(--white);
|
|
305
|
+
}
|
|
306
|
+
`,Qe=N`
|
|
307
|
+
background: var(--brand-secondary-5);
|
|
308
|
+
color: var(--white);
|
|
309
|
+
|
|
310
|
+
&:disabled {
|
|
311
|
+
background: var(--gray-500);
|
|
312
|
+
color: var(--white);
|
|
313
|
+
}
|
|
314
|
+
`,Ze=N`
|
|
315
|
+
background: var(--brand-secondary-2);
|
|
316
|
+
color: var(--brand-secondary-1);
|
|
317
|
+
|
|
318
|
+
&:disabled {
|
|
319
|
+
background: var(--brand-secondary-2);
|
|
320
|
+
color: var(--gray-400);
|
|
321
|
+
}
|
|
322
|
+
`,qe=N`
|
|
323
|
+
background: transparent;
|
|
324
|
+
color: var(--brand-secondary-3);
|
|
325
|
+
|
|
326
|
+
&:hover {
|
|
327
|
+
border-color: var(--brand-secondary-3);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
&:disabled {
|
|
331
|
+
background: transparent;
|
|
332
|
+
border-color: var(--gray-400);
|
|
333
|
+
color: var(--gray-400);
|
|
334
|
+
}
|
|
335
|
+
`,Ue=N`
|
|
336
|
+
background: var(--brand-secondary-3);
|
|
337
|
+
color: var(--white);
|
|
338
|
+
|
|
339
|
+
&:disabled {
|
|
340
|
+
background: var(--gray-500);
|
|
341
|
+
color: var(--white);
|
|
342
|
+
}
|
|
343
|
+
`;var C=_e.forwardRef(({buttonType:t="primary",size:r="md",children:n,...o},i)=>{let s={primary:Ne,secondary:Qe,ghost:qe,unimportant:Ze,tertiary:Ue},c={xs:"padding: 0.375rem 0.625rem; font-size: var(--font-xs);",sm:"padding: var(--spacing-sm) 0.75rem; font-size: var(--font-sm);",md:"padding: var(--spacing-sm) var(--spacing-base); font-size: var(--font-sm);",lg:"padding: var(--spacing-sm) var(--spacing-base)",xl:"padding: 0.75rem var(--spacing-md)"};return e(Wt,{"data-testid":"uniform-button",ref:i,css:[Fe,s[t],c[r]],...o},n)});import*as Ye from"react";import{css as _}from"@emotion/react";var Ge=_`
|
|
344
|
+
position: relative;
|
|
345
|
+
display: inline-block;
|
|
346
|
+
margin-right: var(--spacing-sm);
|
|
347
|
+
transition: var(--duration) var(--timing);
|
|
348
|
+
vertical-align: middle;
|
|
349
|
+
user-select: none;
|
|
350
|
+
width: var(--spacing-xl);
|
|
351
|
+
`,$e=_`
|
|
352
|
+
appearance: none;
|
|
353
|
+
border-radius: var(--rounded-full);
|
|
354
|
+
background-color: var(--white);
|
|
355
|
+
border: 2px solid var(--gray-400);
|
|
356
|
+
cursor: pointer;
|
|
357
|
+
position: absolute;
|
|
358
|
+
display: block;
|
|
359
|
+
width: var(--spacing-md);
|
|
360
|
+
height: var(--spacing-md);
|
|
361
|
+
transition: transform var(--duration) var(--timing), background-color var(--duration) var(--timing),
|
|
362
|
+
background-image var(--duration) var(--timing);
|
|
363
|
+
|
|
364
|
+
&:focus {
|
|
365
|
+
outline: 3px solid var(--brand-primary-1);
|
|
366
|
+
outline-offset: 2px;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
&:checked {
|
|
370
|
+
background-color: var(--brand-secondary-3);
|
|
371
|
+
background-image: 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 d='M10.5858 13.4142L7.75735 10.5858L6.34314 12L10.5858 16.2427L17.6568 9.1716L16.2426 7.75739L10.5858 13.4142Z' fill='%23fff' /%3E%3C/svg%3E");
|
|
372
|
+
background-position: center center;
|
|
373
|
+
border-color: var(--brand-secondary-3);
|
|
374
|
+
transform: translateX(var(--spacing-base));
|
|
375
|
+
|
|
376
|
+
&:hover,
|
|
377
|
+
&:focus {
|
|
378
|
+
border-color: var(--brand-primary-1);
|
|
379
|
+
background-color: var(--brand-primary-1);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
`,Ke=_`
|
|
383
|
+
border-radius: var(--rounded-full);
|
|
384
|
+
background-color: var(--gray-300);
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
display: block;
|
|
387
|
+
overflow: hidden;
|
|
388
|
+
width: var(--spacing-xl);
|
|
389
|
+
height: var(--spacing-md);
|
|
390
|
+
`,We=_`
|
|
391
|
+
color: var(--brand-secondary-1);
|
|
392
|
+
font-weight: var(--font-bold);
|
|
393
|
+
line-height: 1.25rem;
|
|
394
|
+
cursor: default;
|
|
395
|
+
`,se=_`
|
|
396
|
+
color: var(--gray-700);
|
|
397
|
+
font-size: var(--font-sm);
|
|
398
|
+
margin: var(--spacing-sm) 0;
|
|
399
|
+
`;var G=({label:t,infoText:r,toggleText:n,...o})=>{let i=()=>r&&n?o.checked?e("p",{css:se},n):e("p",{css:se},r):r?e("p",{css:se},r):null;return e(Ye.Fragment,null,e("div",{css:Ge},e("input",{type:"checkbox",css:$e,...o,className:o.className}),e("label",{htmlFor:o.id,css:Ke})),e("label",{htmlFor:o.id,css:We},t),i())};var Xe=({dimensionIndex:{index:t},state:{scores:r,data:n},actions:o,saveSettings:i,settings:s})=>{let c=ce.useMemo(()=>{let a={};return Object.keys(t).filter(p=>!r[p]).map(p=>{a[t[p].dim]=0}),a},[r,t]),v=Object.keys(r).length,m=v+Object.keys(c).length,l=()=>{o.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return e(ce.Fragment,null,e("article",{css:h.page},e("div",{css:h.headingGroup},e("h2",{css:h.title},"Dimensions",e("small",null,v," active of ",m)),e("div",{css:h.reset},e(C,{buttonType:"ghost",onClick:()=>ae({actions:o,saveSettings:i,scores:r,settings:s}).then(o.forget)},"clear all dimensions")),e(G,{label:"Control Group",onChange:l,checked:n.controlGroup})),v>0?e(V,{dimensionIndex:t,dimensions:r}):e(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?e(C,{buttonType:"secondary",onClick:l},"Exit control group"):null}),e(X,null,e(J,{title:`Inactive Dimensions (${Object.keys(c).length})`},e(V,{dimensionIndex:t,dimensions:c})))))};import*as Je from"react";import{css as Yt}from"@emotion/react";function Ce({onClick:t}){return e("button",{css:Yt`
|
|
400
|
+
width: 3.5rem;
|
|
401
|
+
height: 3.5rem;
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
border-radius: 9999px;
|
|
405
|
+
border: none;
|
|
406
|
+
cursor: pointer;
|
|
407
|
+
background-color: var(--red-button);
|
|
408
|
+
|
|
409
|
+
svg {
|
|
410
|
+
color: var(--red-button);
|
|
411
|
+
}
|
|
412
|
+
`,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 je=({dimensionIndex:{index:t},state:{data:r,scores:n},actions:o,settings:i,saveSettings:s})=>{var p;let c=(p=i.scoreOverrides)!=null?p:{},v=Object.keys(c).length,m=d=>(d.preventDefault(),s({...i,route:"/overrides/add"})),l=()=>{o.rawUpdate([{type:"setcontrol",data:!r.controlGroup}])},a={};return Object.entries(n).map(([d,f])=>{c[d]!==void 0&&(a[d]=f)}),e(Je.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(C,{buttonType:"ghost",onClick:()=>ae({actions:o,settings:i,saveSettings:s,scores:n})},"delete all overrides")),e(Ce,{onClick:m})),e("p",null,"Override dimension scores to test personalization"),v>0?e(V,{dimensionIndex:t,dimensions:a,onClick:d=>s({...i,route:`/overrides/${d}`})}):e(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?e(C,{buttonType:"secondary",onClick:l},"Exit control group"):null})))};import{Field as bt,Form as no,Formik as io}from"formik";import*as Z from"yup";import{css as A}from"@emotion/react";var et=A`
|
|
413
|
+
background: var(--white);
|
|
414
|
+
border: 1px solid var(--gray-500);
|
|
415
|
+
border-radius: var(--rounded-base);
|
|
416
|
+
color: var(--brand-secondary-1);
|
|
417
|
+
padding: var(--spacing-base);
|
|
418
|
+
|
|
419
|
+
&:disabled {
|
|
420
|
+
cursor: not-allowed;
|
|
421
|
+
color: var(--gray-200);
|
|
422
|
+
}
|
|
423
|
+
`,Nr=A`
|
|
424
|
+
margin: var(--spacing-base) 0;
|
|
425
|
+
`,tt=A`
|
|
426
|
+
color: var(--brand-secondary-1);
|
|
427
|
+
display: flex;
|
|
428
|
+
flex-direction: column;
|
|
429
|
+
margin: 0 0 var(--spacing-sm);
|
|
430
|
+
`,ot=A`
|
|
431
|
+
color: var(--brand-secondary-1);
|
|
432
|
+
display: block;
|
|
433
|
+
flex: 1 100%;
|
|
434
|
+
font-weight: var(--font-bold);
|
|
435
|
+
margin: 0 0 var(--spacing-sm);
|
|
436
|
+
`,Qr=A`
|
|
437
|
+
color: var(--gray-600);
|
|
438
|
+
font-size: var(--font-sm);
|
|
439
|
+
`,Zr=A`
|
|
440
|
+
color: var(--brand-secondary-5);
|
|
441
|
+
display: block;
|
|
442
|
+
`,rt=A`
|
|
443
|
+
flex-direction: row;
|
|
444
|
+
flex-wrap: wrap;
|
|
445
|
+
|
|
446
|
+
input[type='range'] {
|
|
447
|
+
height: 28px;
|
|
448
|
+
-webkit-appearance: none;
|
|
449
|
+
margin: 10px 0;
|
|
450
|
+
width: 100%;
|
|
451
|
+
flex: 1 0 80%;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
input[type='range']:focus {
|
|
455
|
+
outline: none;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
input[type='range']::-webkit-slider-runnable-track {
|
|
459
|
+
width: 100%;
|
|
460
|
+
height: 6px;
|
|
461
|
+
cursor: pointer;
|
|
462
|
+
animate: 0.2s;
|
|
463
|
+
box-shadow: 0 0 0 #000000;
|
|
464
|
+
background: #2ecdb4;
|
|
465
|
+
border-radius: 0;
|
|
466
|
+
border: 0 solid #000000;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
input[type='range']::-moz-range-track {
|
|
470
|
+
width: 100%;
|
|
471
|
+
height: 6px;
|
|
472
|
+
cursor: pointer;
|
|
473
|
+
animate: 0.2s;
|
|
474
|
+
box-shadow: 0 0 0 #000000;
|
|
475
|
+
background: #2ecdb4;
|
|
476
|
+
border-radius: 0;
|
|
477
|
+
border: 0 solid #000000;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
input[type='range']::-webkit-slider-thumb {
|
|
481
|
+
box-shadow: 1px 1px 2px #000000;
|
|
482
|
+
border: 1px solid #000000;
|
|
483
|
+
height: 20px;
|
|
484
|
+
width: 20px;
|
|
485
|
+
border-radius: 20px;
|
|
486
|
+
background: #ffffff;
|
|
487
|
+
cursor: pointer;
|
|
488
|
+
-webkit-appearance: none;
|
|
489
|
+
margin-top: -7.5px;
|
|
490
|
+
}
|
|
491
|
+
input[type='range']::-moz-range-thumb {
|
|
492
|
+
box-shadow: 1px 1px 2px #000000;
|
|
493
|
+
border: 1px solid #000000;
|
|
494
|
+
height: 20px;
|
|
495
|
+
width: 20px;
|
|
496
|
+
border-radius: 20px;
|
|
497
|
+
background: #ffffff;
|
|
498
|
+
cursor: pointer;
|
|
499
|
+
-webkit-appearance: none;
|
|
500
|
+
margin-top: -7.5px;
|
|
501
|
+
}
|
|
502
|
+
input[type='range']:focus::-webkit-slider-runnable-track {
|
|
503
|
+
background: #2ecdb4;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.value-display {
|
|
507
|
+
flex: 1 0 20%;
|
|
508
|
+
padding: 10px;
|
|
509
|
+
}
|
|
510
|
+
`;import{css as Xt}from"@emotion/react";var nt=Xt`
|
|
511
|
+
color: var(--gray-500);
|
|
512
|
+
display: block;
|
|
513
|
+
font-size: var(--font-base);
|
|
514
|
+
margin: var(--spacing-sm) 0;
|
|
515
|
+
max-width: var(--prose);
|
|
516
|
+
`;var Q=({children:t})=>e("small",{css:nt},t);import*as mt from"react";import{css as it}from"@emotion/react";var at=it`
|
|
517
|
+
align-items: center;
|
|
518
|
+
color: var(--brand-secondary-5);
|
|
519
|
+
display: flex;
|
|
520
|
+
gap: var(--spacing-sm);
|
|
521
|
+
margin: var(--spacing-xs) 0;
|
|
522
|
+
`,Wr=it`
|
|
523
|
+
display: block;
|
|
524
|
+
width: var(--spacing-base);
|
|
525
|
+
height: var(--spacing-base);
|
|
526
|
+
`;var R=({message:t})=>t?e("span",{css:at},e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{clipPath:"url(#clip0_137_61)"},e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.66982 1.125C6.53257 0.8925 6.27982 0.75 6.00457 0.75C5.72932 0.75 5.47732 0.8925 5.34007 1.125L0.103572 10.1242C0.0360984 10.2378 0.000488281 10.3675 0.000488281 10.4996C0.000488281 10.6317 0.0360984 10.7614 0.103572 10.875C0.248322 11.1075 0.501072 11.2508 0.768072 11.2508H11.2411C11.5163 11.2508 11.7691 11.1083 11.8988 10.8758C11.9639 10.7615 11.9988 10.6325 12.0001 10.501C12.0014 10.3695 11.9691 10.2398 11.9063 10.1242L6.66982 1.125ZM6.76957 9.74775H5.24032V8.2455H6.76957V9.74775ZM6.76957 7.49475H5.24032V4.49025H6.76957V7.49475Z",fill:"currentColor"})),e("defs",null,e("clipPath",{id:"clip0_137_61"},e("rect",{width:"12",height:"12",fill:"white"})))),t):null;import{css as T}from"@emotion/react";var st="./chevron-down-U4FYSTLW.svg";var ct="./check-BVHJYFC2.svg";var de=T`
|
|
527
|
+
position: relative;
|
|
528
|
+
`,le=T`
|
|
529
|
+
display: block;
|
|
530
|
+
font-weight: var(--font-bold);
|
|
531
|
+
margin: 0 0 var(--spacing-xs);
|
|
532
|
+
`,pe=T`
|
|
533
|
+
appearance: none;
|
|
534
|
+
background-color: var(--white);
|
|
535
|
+
border: 1px solid var(--gray-400);
|
|
536
|
+
border-radius: var(--rounded-md);
|
|
537
|
+
color: var(--gray-700);
|
|
538
|
+
padding: var(--spacing-base);
|
|
539
|
+
width: 100%;
|
|
540
|
+
position: relative;
|
|
541
|
+
transition: background var(--duration) var(--timing), border-color var(--duration) var(--timing),
|
|
542
|
+
color var(--duration) var(--timing);
|
|
543
|
+
|
|
544
|
+
&::placeholder {
|
|
545
|
+
color: var(--gray-400);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
&:focus,
|
|
549
|
+
&:focus-within {
|
|
550
|
+
border-color: var(--brand-secondary-1);
|
|
551
|
+
outline: 2px solid var(--brand-secondary-1);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
&:disabled,
|
|
555
|
+
&:disabled::placeholder {
|
|
556
|
+
cursor: not-allowed;
|
|
557
|
+
color: var(--gray-300);
|
|
558
|
+
border-color: var(--gray-300);
|
|
559
|
+
}
|
|
560
|
+
`,me=T`
|
|
561
|
+
border-color: var(--brand-secondary-5);
|
|
562
|
+
`,nn=T`
|
|
563
|
+
appearance: none;
|
|
564
|
+
background: var(--white);
|
|
565
|
+
border: 1px solid var(--gray-400);
|
|
566
|
+
border-radius: var(--rounded-md);
|
|
567
|
+
color: var(--gray-700);
|
|
568
|
+
padding: var(--spacing-base);
|
|
569
|
+
width: 100%;
|
|
570
|
+
position: relative;
|
|
571
|
+
resize: auto;
|
|
572
|
+
|
|
573
|
+
&::placeholder {
|
|
574
|
+
color: var(--gray-400);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
&:focus {
|
|
578
|
+
border-color: var(--brand-secondary-1);
|
|
579
|
+
outline: none;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
&:disabled,
|
|
583
|
+
&:disabled::placeholder {
|
|
584
|
+
cursor: not-allowed;
|
|
585
|
+
color: var(--gray-300);
|
|
586
|
+
border-color: var(--gray-300);
|
|
587
|
+
}
|
|
588
|
+
`,dt=T`
|
|
589
|
+
background-image: url(${st});
|
|
590
|
+
background-position: 98% 50%;
|
|
591
|
+
background-repeat: no-repeat;
|
|
592
|
+
background-size: 1rem;
|
|
593
|
+
`,an=T`
|
|
594
|
+
align-items: center;
|
|
595
|
+
cursor: pointer;
|
|
596
|
+
display: inline-flex;
|
|
597
|
+
gap: var(--spacing-sm);
|
|
598
|
+
margin: var(--spacing-sm) 0;
|
|
599
|
+
`,sn=T`
|
|
600
|
+
border: 1px solid var(--brand-secondary-1);
|
|
601
|
+
background: var(--white);
|
|
602
|
+
width: var(--spacing-md);
|
|
603
|
+
height: var(--spacing-md);
|
|
604
|
+
transition: background var(--duration) var(--timing), border-color var(--duration) var(--timing),
|
|
605
|
+
color var(--duration) var(--timing);
|
|
606
|
+
|
|
607
|
+
&[type='radio'] {
|
|
608
|
+
border-radius: var(--rounded-full);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
&[type='checkbox'] {
|
|
612
|
+
border-radius: var(--rounded-base);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
&:checked {
|
|
616
|
+
background: var(--brand-secondary-3) url(${ct}) no-repeat center center;
|
|
617
|
+
border-color: var(--brand-secondary-3);
|
|
618
|
+
color: var(--white);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
&:disabled {
|
|
622
|
+
cursor: not-allowed;
|
|
623
|
+
color: var(--gray-300);
|
|
624
|
+
border-color: var(--gray-300);
|
|
625
|
+
}
|
|
626
|
+
`,cn=T`
|
|
627
|
+
cursor: not-allowed;
|
|
628
|
+
color: var(--gray-400);
|
|
629
|
+
`,dn=T`
|
|
630
|
+
font-weight: var(--font-medium);
|
|
631
|
+
`,lt=T`
|
|
632
|
+
align-items: center;
|
|
633
|
+
display: flex;
|
|
634
|
+
position: absolute;
|
|
635
|
+
inset: 0 var(--spacing-base) 0 auto;
|
|
636
|
+
pointer-event: one;
|
|
637
|
+
`,pt=T`
|
|
638
|
+
padding-right: var(--spacing-xl);
|
|
639
|
+
`;var ue=({label:t,icon:r,id:n,disabled:o,caption:i,error:s,showLabel:c=!0,errorMessage:v,classNameContainer:m,classNameControl:l,classNameLabel:a,...p})=>e(mt.Fragment,null,c?e("label",{htmlFor:n,css:le},t):null,e("div",{css:de,className:m||""},e("input",{id:n,css:[pe,s?me:void 0,r?pt:""],"aria-label":c?void 0:t,className:l||"",disabled:o,...p}),r?e("div",{css:lt},r):null),i?e(Q,null,i):null,s?e(R,{message:v}):null);var ge=({label:t,defaultOption:r,options:n,caption:o,error:i,errorMessage:s,showLabel:c=!0,classNameContainer:v="uniform-input-container",classNameControl:m="uniform-input uniform-input-select",classNameLabel:l="uniform-input-label",...a})=>e("div",{css:de,className:v},c?e("label",{htmlFor:a.id,css:le,className:l},t):null,e("select",{title:t,"aria-label":c?void 0:t,css:[pe,dt,i?me:void 0],className:m,...a},r?e("option",{value:""},r):null,n.map((p,d)=>e("option",{key:d,value:p.label,...p}))),o?e(Q,null,o):null,i?e(R,{message:s}):null);var ut=({field:t,form:r,meta:n,...o})=>{var l,a;let{label:i,caption:s,min:c=0,max:v=100,step:m}=o;return e("div",null,e("label",{css:[tt,rt]},e("span",{css:ot},i),e("input",{type:"range",min:c,max:v,step:m,...t,value:(l=t.value)!=null?l:0}),e("span",{className:"value-display"},(a=t.value)!=null?a:0)),s?e(Q,null,s):null,r.touched[t.name]&&r.errors[t.name]?e(R,{message:r.errors[t.name]}):null)};import{css as eo}from"@emotion/react";var E=({children:t,...r})=>e("fieldset",{css:eo`
|
|
640
|
+
border: none;
|
|
641
|
+
padding: 0;
|
|
642
|
+
& legend {
|
|
643
|
+
margin-bottom: var(--spacing-base);
|
|
644
|
+
}
|
|
645
|
+
`,...r},t);import{css as to}from"@emotion/react";var $=({children:t})=>e("legend",{css:to`
|
|
646
|
+
font-size: var(--font-md);
|
|
647
|
+
font-weight: var(--font-bold);
|
|
648
|
+
border-bottom: 1px solid var(--gray-400);
|
|
649
|
+
width: 100%;
|
|
650
|
+
`},t);import{Context as oo,TransitionDataStore as ro}from"@uniformdev/context";function gt({manifest:t,visitor:r,override:n}){let o=new oo({manifest:t,transitionStore:new vt({initialData:r})}),i={...o.scores};o.storage.updateData([n]);let c={...{...o.scores}};return Object.entries(c).forEach(([v,m])=>{i[v]===m&&delete c[v]}),c}var vt=class extends ro{async handleDelete(){}async handleUpdateData(){}};function ve({scores:t,scoreOverrides:r}){let n=[];return r?(Object.entries(r).forEach(([o,i])=>{var v;let s=(v=t[o])!=null?v:0;if(s===i.override)return;let c=i.override-s;n.push({type:"modscoreS",data:{dimension:o,delta:c}})}),n):[]}function fe({quirks:t,quirkOverrides:r}){let n={};if(!!r)return Object.entries(r).forEach(([o,i])=>{t[o]!==i.override&&(n[o]=i.override)}),Object.keys(n).length>0?n:void 0}var ft=({field:t,form:r,meta:n,...o})=>e(ge,{...o,...t,error:Boolean(r.errors[t.name]),errorMessage:r.errors[t.name]});var ao=Z.object({dimension:Z.string(),score:Z.number()}),we=({settings:t,saveSettings:r,state:n,actions:o,dimensionIndex:{index:i}})=>{var m,l;let s=t.route?[...t.route.matchAll(/overrides\/(?!.*add)(\w+)?/g)]:[],c=s[0]?s[0][1]:"";if(!((m=n.manifest.project.pz)!=null&&m.sig))return e("p",null,"Error, manifest is broken or there is no signal to override.");let v=Object.entries(i).filter(([,a])=>a.type!=="Audience"&&a.type!=="Intent").map(([a,p])=>{let d=p.type?`${p.type}: `:"",f=p.category?`${p.category} - `:"",y=`${d}${f}${p.name}`;return{value:a,label:y}});return v.unshift({value:"",label:"Choose dimension to override"}),e(io,{initialValues:{dimension:c,score:(l=n.scores[c])!=null?l:0},validate:a=>{let p={};return(a.score===n.scores[a.dimension]||a.score===0&&!n.scores[c])&&(p.score="You have to modify current score value"),p},validationSchema:ao,enableReinitialize:!0,onSubmit:async a=>{var w,k,S,L,q,K;let p=(k=(w=i[a.dimension])==null?void 0:w.cap)!=null?k:0,d=Math.min(a.score,p),f={...t,scoreOverrides:{...t.scoreOverrides,[a.dimension]:{initial:(K=(q=(L=(S=t.scoreOverrides)==null?void 0:S[a.dimension])==null?void 0:L.initial)!=null?q:n.scores[a.dimension])!=null?K:0,override:d}},route:"/overrides"};await r(f);let y=ve({scores:n.scores,scoreOverrides:f.scoreOverrides});o.rawUpdate(y)}},({dirty:a,isValid:p,isSubmitting:d,values:f})=>{var L;let y=gt({manifest:n.manifest,visitor:n.data,override:{type:"modscore",data:{dimension:f.dimension,delta:f.score-((L=n.scores[f.dimension])!=null?L:0)}}}),w=Object.entries(n.scores).reduce((q,[K,xe])=>(q[K]={initial:xe,override:xe},q),{}),k={max:100,step:50};i[f.dimension]&&(k.max=i[f.dimension].cap,k.step=i[f.dimension].str);let S=f.score&&Object.keys(y).length>0;return e(no,{css:h.page},e("h1",{css:h.title},"Override Dimension"),e(bt,{component:ft,label:"Dimension",id:"dimension",name:"dimension",options:v,disabled:d}),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(bt,{component:ut,name:"score",label:"Score",disabled:d,caption:`Range: 0 - ${k.max} in increments of ${k.step}`}):null,e(E,{disabled:d,css:{marginBottom:"2rem"}},S?e(X,null,e(J,{title:`Impacted Dimensions (${Object.keys(y).length})`},e(V,{preemptiveOverrides:w,dimensionIndex:i,dimensions:y,disableEditOverride:!0}))):null,a?e(C,{type:"submit",css:h.submitButton,disabled:!p},"Save"):null,e(M,{route:"/overrides",css:h.cancelButton},"Cancel")))})};import{useState as po}from"react";import{useState as so,useEffect as co}from"react";var lo=({name:t,value:r,submit:n})=>{let[o,i]=so(r!=null?r:"");return co(()=>{i(r!=null?r:"")},[r]),e("div",{css:{display:"flex",gap:"var(--spacing-sm)"}},e("input",{type:"text",css:[et],name:t,value:o,onChange:c=>{i(c.target.value)}}),e(C,{buttonType:"primary",disabled:o===r,size:"sm",onClick:()=>n(t,o!=null?o:"")},"Save"))},ht=lo;var yt=({...t})=>{let{state:{data:{quirks:r}},quirksIndex:{index:n},settings:o,saveSettings:i,actions:s}=t,[c,v]=po(""),m;c&&(m=n[c]);let l=async(a,p)=>{var y,w,k;v("");let d={...o,quirkOverrides:{...o.quirkOverrides,[a]:{initial:(k=(w=(y=o.quirkOverrides)==null?void 0:y[a])==null?void 0:w.initial)!=null?k:r[a],override:p}}};await i(d);let f=fe({quirks:r,quirkOverrides:d.quirkOverrides});s.update({quirks:f})};return e(b.Fragment,null,e("article",{css:[h.page,h.quirks]},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(n).length?e(re,null,e(Me,null,e(U,null,e(ie,{width:"30%"},"Key"),e(ie,{width:"50%"},"Value"),e(ie,{width:"20%"},""))),e(ne,null,Object.values(n).map(({name:a,value:p,id:d})=>{var w,k,S;let f=(k=(w=o.quirkOverrides)==null?void 0:w[a])==null?void 0:k.initial,y=[];return m&&m.options&&(y=m.options.map(L=>({value:L.value,label:L.name}))),e(U,{key:d,border:"bottom"},e(I,null,e("strong",null,a)),e(I,null,c!==d?e("div",{onClick:()=>{v(d)}},f?e("div",null,e("s",null,f)):null,p):null,c===d&&m&&e(b.Fragment,null,m.options?e(ge,{showLabel:!1,label:`Change ${a}`,defaultOption:`Change ${a}`,name:d,onChange:L=>l(L.target.name,L.target.value),options:y}):e(ht,{name:d,value:p,submit:l}))),e(I,null,c?null:(S=o.quirkOverrides)!=null&&S[d]?e(C,{buttonType:"ghost",onClick:()=>{ze({quirk:d,settings:o,saveSettings:i,actions:s})}},e("small",null,"Clear Override")):e(C,{buttonType:"ghost",onClick:()=>{v(d)}},e("small",null,"Override"))))}))):e(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 Ct=({settings:t,saveSettings:r,actions:n,state:{data:o}})=>e("article",{css:[h.page,{display:"flex",flexDirection:"column",gap:"var(--spacing-base)"}]},e("h1",{css:h.title},"Settings"),e(E,null,e($,null,"Data Connection"),e(C,{buttonType:"tertiary",onClick:()=>{r({...t,route:"/connect"})}},"Manage Connection to Uniform")),e(E,null,e($,null,"Storage Consent"),e(G,{label:"Store visitor data",id:"consent-mode",name:"consentMode",checked:o.consent,onChange:i=>{n.rawUpdate([{type:"consent",data:i.currentTarget.checked}]),r({...t,consentMode:i.currentTarget.checked})}}),e("p",null,e("small",null,"Enabling storage consent allows 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(E,null,e($,null,"Logging"),e(G,{label:"Write Uniform Context diagnostic logs to browser console",id:"logging",name:"logging",checked:t.logLevel!=="none",onChange:i=>r({...t,logLevel:i.currentTarget.checked?"debug":"none"})})));var ke=({settings:t,saveSettings:r})=>{let n=()=>{r({...t,route:"/connect"})},o=()=>{r({...t,ignoreApiKeyPrompt:!0})},i=t.route==="/connect",s=!(t!=null&&t.apiKey);return!t.ignoreApiKeyPrompt&&s&&!i?e("div",{css:[j,Re]},e("h2",{css:ee},"Connect to Uniform Context"),e("p",{css:te},"Connect to your Uniform Context project with an API key to display complete data."),e("div",{css:oe},e(C,{buttonType:"secondary",onClick:n},"Connect this site"),e(C,{buttonType:"ghost",onClick:o},"Skip for now")),e("button",{type:"button",css:Pe,title:"close",onClick:o},e("span",{hidden:!0},"Close"))):null};import{computeDimensionDefinitionDisplayData as mo,computeDimensionDisplayData as wt,DimensionClient as uo}from"@uniformdev/context/api";import{useAsync as go}from"react-use";import*as kt from"react";function Tt({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:s,value:c}=go(async()=>{if(!r||!n)return v;let l=(await new uo({projectId:n,apiKey:r,apiHost:t||void 0}).get()).dimensions,a={};return l.map(p=>{var d,f,y,w;if(a[p.dim]={...mo(p),cap:p.cap,str:10},a[p.dim].type==="Enrichment"){let k=p.dim.split("_")[0];a[p.dim].cap=(w=(y=(f=(d=o==null?void 0:o.project.pz)==null?void 0:d.enr)==null?void 0:f[k])==null?void 0:y.cap)!=null?w:100}}),a},[t,r,n]),v=kt.useMemo(()=>{var l,a,p,d;let m={};return o&&(Object.entries((a=(l=o==null?void 0:o.project.pz)==null?void 0:l.sig)!=null?a:{}).map(([f,y])=>{let w=wt(f,o);w&&(m[f]={...y,...w})}),Object.entries((d=(p=o==null?void 0:o.project.pz)==null?void 0:p.enr)!=null?d:{}).map(([f,y])=>{var S;let w=wt(f,o),k={cap:(S=y.cap)!=null?S:100,str:10};w&&(m[f]={...w,cap:k.cap,str:k.str})}),c&&Object.entries(c).map(([f,y])=>{m[f]={...m[f],...y}})),m},[o,c]);return{loading:i,error:s,index:v}}import{useMemo as vo}from"react";import{QuirkClient as fo}from"@uniformdev/context/api";import{useAsync as bo}from"react-use";function xt({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:s,value:c}=bo(async()=>{if(!r||!n)return{};let l=await new fo({projectId:n,apiKey:r,apiHost:t||void 0}).get(),a={};return l.quirks.map(p=>{a[p.id]={...p,value:o[p.id]}}),a},[t,r,n]),v=vo(()=>{let m={};return Object.entries(o).map(([l,a])=>m[l]={value:a,id:l,name:l}),c&&Object.entries(c).map(([l,a])=>m[l]={...a,value:o[l]}),m},[o,c]);return{loading:i,error:s,index:v}}import{css as Ot}from"@emotion/react";function be(){return e("style",null,`
|
|
651
|
+
:root {
|
|
652
|
+
--brand-primary-1: #438fd5; /* bright blue */
|
|
653
|
+
--brand-primary-2: #f4220b; /* red */
|
|
654
|
+
--brand-primary-3: #83c6e1; /* slate blue */
|
|
655
|
+
|
|
656
|
+
/* secondary colours */
|
|
657
|
+
--brand-secondary-1: #1f2b34; /* carbon */
|
|
658
|
+
--brand-secondary-2: #ecf1f1; /* silver */
|
|
659
|
+
--brand-secondary-3: #2ecdb4; /* teal */
|
|
660
|
+
--brand-secondary-4: #f6f1c3; /* yellow */
|
|
661
|
+
--brand-secondary-5: #d9534f; /* brick red */
|
|
662
|
+
--brand-secondary-6: #dbf6f2; /* mint */
|
|
663
|
+
|
|
664
|
+
/* off brand */
|
|
665
|
+
--input-border: rgba(31, 43, 52, 0.5);
|
|
666
|
+
|
|
667
|
+
/* site settings */
|
|
668
|
+
--site-width: 700px;
|
|
669
|
+
--min-height: 450px;
|
|
670
|
+
|
|
671
|
+
--spacing-base: 1.15rem;
|
|
672
|
+
--spacing-xs: calc(var(--spacing-base) - 0.75rem);
|
|
673
|
+
--spacing-sm: calc(var(--spacing-base) - 0.5rem);
|
|
674
|
+
--spacing-md: calc(var(--spacing-base) * 1.5);
|
|
675
|
+
--spacing-lg: calc(var(--spacing-base) * 2);
|
|
676
|
+
--spacing-xl: calc(var(--spacing-base) * 2.5);
|
|
677
|
+
|
|
678
|
+
/* font sizes */
|
|
679
|
+
--font-base: 1rem; /* 16px */
|
|
680
|
+
--font-xxs: calc(var(--font-base) - 0.5rem);
|
|
681
|
+
--font-xs: calc(var(--font-base) - 0.25rem);
|
|
682
|
+
--font-sm: calc(var(--font-base) - 0.125rem); /* 14px */
|
|
683
|
+
--font-md: calc(var(--font-base) * 1.25);
|
|
684
|
+
--font-lg: calc(var(--font-base) * 1.5);
|
|
685
|
+
|
|
686
|
+
/* font-weight */
|
|
687
|
+
--font-regular: 400;
|
|
688
|
+
--font-bold: 700;
|
|
689
|
+
|
|
690
|
+
/* brand shadow styles */
|
|
691
|
+
--shadow-base: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
|
|
692
|
+
|
|
693
|
+
/* rounder corners */
|
|
694
|
+
--rounded-base: 6px;
|
|
695
|
+
--rounded-full: 99999px;
|
|
696
|
+
|
|
697
|
+
/* gray spectrum */
|
|
698
|
+
--white: #fff;
|
|
699
|
+
--gray-50: #f9fafb;
|
|
700
|
+
--gray-100: #f3f4f6;
|
|
701
|
+
--gray-200: #e5e7eb;
|
|
702
|
+
--gray-300: #d1d5db;
|
|
703
|
+
--gray-400: #9ca3af;
|
|
704
|
+
--gray-500: #6b7280;
|
|
705
|
+
--gray-600: #4b5563;
|
|
706
|
+
--gray-700: #374151;
|
|
707
|
+
--gray-800: #1f2937;
|
|
708
|
+
--gray-900: #111827;
|
|
709
|
+
|
|
710
|
+
/* Red CTA */
|
|
711
|
+
--red-button: rgb(217 83 79);
|
|
712
|
+
--red-tooltip: #D9534F;
|
|
713
|
+
|
|
714
|
+
/* z-indexs */
|
|
715
|
+
--z-10: 10;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
|
|
719
|
+
|
|
720
|
+
/*
|
|
721
|
+
Document
|
|
722
|
+
========
|
|
723
|
+
*/
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
Use a better box model (opinionated).
|
|
727
|
+
*/
|
|
728
|
+
|
|
729
|
+
*,
|
|
730
|
+
::before,
|
|
731
|
+
::after {
|
|
732
|
+
box-sizing: border-box;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
Use a more readable tab size (opinionated).
|
|
737
|
+
*/
|
|
738
|
+
|
|
739
|
+
html {
|
|
740
|
+
-moz-tab-size: 4;
|
|
741
|
+
tab-size: 4;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
1. Correct the line height in all browsers.
|
|
746
|
+
2. Prevent adjustments of font size after orientation changes in iOS.
|
|
747
|
+
*/
|
|
748
|
+
|
|
749
|
+
html {
|
|
750
|
+
line-height: 1.15; /* 1 */
|
|
751
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/*
|
|
755
|
+
Sections
|
|
756
|
+
========
|
|
757
|
+
*/
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
Remove the margin in all browsers.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
body {
|
|
764
|
+
margin: 0;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
|
|
769
|
+
*/
|
|
770
|
+
|
|
771
|
+
body {
|
|
772
|
+
font-family:
|
|
773
|
+
system-ui,
|
|
774
|
+
-apple-system, /* Firefox supports this but not yet system-ui */
|
|
775
|
+
'Segoe UI',
|
|
776
|
+
Roboto,
|
|
777
|
+
Helvetica,
|
|
778
|
+
Arial,
|
|
779
|
+
sans-serif,
|
|
780
|
+
'Apple Color Emoji',
|
|
781
|
+
'Segoe UI Emoji';
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/*
|
|
785
|
+
Grouping content
|
|
786
|
+
================
|
|
787
|
+
*/
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
1. Add the correct height in Firefox.
|
|
791
|
+
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
|
792
|
+
*/
|
|
793
|
+
|
|
794
|
+
hr {
|
|
795
|
+
height: 0; /* 1 */
|
|
796
|
+
color: inherit; /* 2 */
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/*
|
|
800
|
+
Text-level semantics
|
|
801
|
+
====================
|
|
802
|
+
*/
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
Add the correct text decoration in Chrome, Edge, and Safari.
|
|
806
|
+
*/
|
|
807
|
+
|
|
808
|
+
abbr[title] {
|
|
809
|
+
text-decoration: underline dotted;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
Add the correct font weight in Edge and Safari.
|
|
814
|
+
*/
|
|
815
|
+
|
|
816
|
+
b,
|
|
817
|
+
strong {
|
|
818
|
+
font-weight: bolder;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
|
|
823
|
+
2. Correct the odd 'em' font sizing in all browsers.
|
|
824
|
+
*/
|
|
825
|
+
|
|
826
|
+
code,
|
|
827
|
+
kbd,
|
|
828
|
+
samp,
|
|
829
|
+
pre {
|
|
830
|
+
font-family:
|
|
831
|
+
ui-monospace,
|
|
832
|
+
SFMono-Regular,
|
|
833
|
+
Consolas,
|
|
834
|
+
'Liberation Mono',
|
|
835
|
+
Menlo,
|
|
836
|
+
monospace; /* 1 */
|
|
837
|
+
font-size: 1em; /* 2 */
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
Add the correct font size in all browsers.
|
|
842
|
+
*/
|
|
843
|
+
|
|
844
|
+
small {
|
|
845
|
+
font-size: 80%;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
|
|
850
|
+
*/
|
|
851
|
+
|
|
852
|
+
sub,
|
|
853
|
+
sup {
|
|
854
|
+
font-size: 75%;
|
|
855
|
+
line-height: 0;
|
|
856
|
+
position: relative;
|
|
857
|
+
vertical-align: baseline;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
sub {
|
|
861
|
+
bottom: -0.25em;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
sup {
|
|
865
|
+
top: -0.5em;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/*
|
|
869
|
+
Tabular data
|
|
870
|
+
============
|
|
871
|
+
*/
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
|
875
|
+
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
|
876
|
+
*/
|
|
877
|
+
|
|
878
|
+
table {
|
|
879
|
+
text-indent: 0; /* 1 */
|
|
880
|
+
border-color: inherit; /* 2 */
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/*
|
|
884
|
+
Forms
|
|
885
|
+
=====
|
|
886
|
+
*/
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
1. Change the font styles in all browsers.
|
|
890
|
+
2. Remove the margin in Firefox and Safari.
|
|
891
|
+
*/
|
|
892
|
+
|
|
893
|
+
button,
|
|
894
|
+
input,
|
|
895
|
+
optgroup,
|
|
896
|
+
select,
|
|
897
|
+
textarea {
|
|
898
|
+
font-family: inherit; /* 1 */
|
|
899
|
+
font-size: 100%; /* 1 */
|
|
900
|
+
line-height: 1.15; /* 1 */
|
|
901
|
+
margin: 0; /* 2 */
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
Remove the inheritance of text transform in Edge and Firefox.
|
|
906
|
+
1. Remove the inheritance of text transform in Firefox.
|
|
907
|
+
*/
|
|
908
|
+
|
|
909
|
+
button,
|
|
910
|
+
select { /* 1 */
|
|
911
|
+
text-transform: none;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
Correct the inability to style clickable types in iOS and Safari.
|
|
916
|
+
*/
|
|
917
|
+
|
|
918
|
+
button,
|
|
919
|
+
[type='button'],
|
|
920
|
+
[type='reset'],
|
|
921
|
+
[type='submit'] {
|
|
922
|
+
-webkit-appearance: button;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
Remove the inner border and padding in Firefox.
|
|
927
|
+
*/
|
|
928
|
+
|
|
929
|
+
::-moz-focus-inner {
|
|
930
|
+
border-style: none;
|
|
931
|
+
padding: 0;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
Restore the focus styles unset by the previous rule.
|
|
936
|
+
*/
|
|
937
|
+
|
|
938
|
+
:-moz-focusring {
|
|
939
|
+
outline: 1px dotted ButtonText;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
Remove the additional ':invalid' styles in Firefox.
|
|
944
|
+
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
|
|
945
|
+
*/
|
|
946
|
+
|
|
947
|
+
:-moz-ui-invalid {
|
|
948
|
+
box-shadow: none;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
|
|
953
|
+
*/
|
|
954
|
+
|
|
955
|
+
legend {
|
|
956
|
+
padding: 0;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
Add the correct vertical alignment in Chrome and Firefox.
|
|
961
|
+
*/
|
|
962
|
+
|
|
963
|
+
progress {
|
|
964
|
+
vertical-align: baseline;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
Correct the cursor style of increment and decrement buttons in Safari.
|
|
969
|
+
*/
|
|
970
|
+
|
|
971
|
+
::-webkit-inner-spin-button,
|
|
972
|
+
::-webkit-outer-spin-button {
|
|
973
|
+
height: auto;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
1. Correct the odd appearance in Chrome and Safari.
|
|
978
|
+
2. Correct the outline style in Safari.
|
|
979
|
+
*/
|
|
980
|
+
|
|
981
|
+
[type='search'] {
|
|
982
|
+
-webkit-appearance: textfield; /* 1 */
|
|
983
|
+
outline-offset: -2px; /* 2 */
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
Remove the inner padding in Chrome and Safari on macOS.
|
|
988
|
+
*/
|
|
989
|
+
|
|
990
|
+
::-webkit-search-decoration {
|
|
991
|
+
-webkit-appearance: none;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
1. Correct the inability to style clickable types in iOS and Safari.
|
|
996
|
+
2. Change font properties to 'inherit' in Safari.
|
|
997
|
+
*/
|
|
998
|
+
|
|
999
|
+
::-webkit-file-upload-button {
|
|
1000
|
+
-webkit-appearance: button; /* 1 */
|
|
1001
|
+
font: inherit; /* 2 */
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/*
|
|
1005
|
+
Interactive
|
|
1006
|
+
===========
|
|
1007
|
+
*/
|
|
1008
|
+
|
|
1009
|
+
/*
|
|
1010
|
+
Add the correct display in Chrome and Safari.
|
|
1011
|
+
*/
|
|
1012
|
+
|
|
1013
|
+
summary {
|
|
1014
|
+
display: list-item;
|
|
1015
|
+
}`)}import{useEffect as ho,useState as yo}from"react";import{useMountedState as Co}from"react-use";var Lt=()=>{let[t,r]=yo(!1),n=Co();return ho(()=>{setTimeout(()=>{n()&&r(!0)},1e3)},[n]),t?e("article",{css:h.page},e("h1",null,"Loading..."),e("p",null,"Connecting to Uniform API for complete data.")):null};import{parseQuickConnect as wo}from"@uniformdev/context";import{ApiClientError as ko,ManifestClient as To}from"@uniformdev/context/api";import{Field as Te,Form as xo,Formik as Lo}from"formik";import*as x from"react";var he=({field:t,form:r,...n})=>e(ue,{...n,...t,error:Boolean(r.errors[t.name]),errorMessage:r.errors[t.name]});function St(t){let[r,n]=x.useState(t.currentData?"c":"qc"),[o,i]=x.useState(void 0),[s,c]=x.useState(void 0),v=x.useCallback(async a=>{let p=new To(a);i(void 0);try{let d=await p.get({preview:!0});return c({manifest:d,target:a}),d}catch(d){if(d instanceof ko){d.statusCode===403?i("API key is valid but does not have Context > Read Drafts permission, or the API key does not have permissions to the project, or the project does not exist."):i(d.errorMessage);return}if("message"in d){d.message==="Failed to fetch"?i("A network error occurred. Ensure the API host is valid."):i(d.message);return}i(JSON.stringify(d,null,2));return}},[]);x.useEffect(()=>{!t.currentData||v(t.currentData)},[v,t.currentData]);let m=async a=>{await v(a)&&(n("c"),await t.onConnect(a))},l=()=>{confirm("Disconnect from Uniform? Make sure to save your API key if you want to reconnect.")&&(n("qc"),c(void 0),i(void 0),t.onConnect(null))};return e("div",null,o?e(R,{message:o}):null,r==="qc"||r==="mc"?e(So,{...t,state:r,setState:n,onConnect:m}):e("div",null,s?e(x.Fragment,null,e("p",null,"Connected to"," ",e("a",{href:`${s==null?void 0:s.target.apiHost}/projects/${s==null?void 0:s.target.projectId}`,target:"_blank",rel:"noopener noreferrer",css:{textDecoration:"underline"}},e("strong",null,s==null?void 0:s.manifest.project.name))," ",e("small",null,"(",s==null?void 0:s.manifest.project.id,")")),e(C,{buttonType:"secondary",type:"button",onClick:l},"Disconnect")):null))}function So({setState:t,state:r,currentData:n,onConnect:o}){var i,s,c;return e("div",null,e(Lo,{initialValues:{apiHost:(i=n==null?void 0:n.apiHost)!=null?i:"https://uniform.dev",apiKey:(s=n==null?void 0:n.apiKey)!=null?s:"",projectId:(c=n==null?void 0:n.projectId)!=null?c:"",qc:""},onSubmit:o},({setFieldValue:v,setFieldError:m,errors:{qc:l},isSubmitting:a})=>e(xo,null,e("fieldset",{css:{display:"flex",flexDirection:"column",gap:"var(--spacing-base)"}},r==="qc"?e(x.Fragment,null,e("div",null,e(ue,{placeholder:"Paste Quick Connect Code Here",caption:"Copy the Quick Connect code after creating an API key in Uniform.",error:Boolean(l),errorMessage:l,onChange:p=>{try{let d=wo(p.currentTarget.value);v("apiHost",d.apiHost),v("apiKey",d.apiKey),v("projectId",d.projectId)}catch(d){m("qc",d.message)}}})),e("section",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(C,{type:"submit",buttonType:"primary",disabled:a},a?"Verifying...":"Connect"),e(C,{type:"button",buttonType:"ghost",onClick:()=>t("mc"),disabled:a},"Connect Manually"))):e(x.Fragment,null,e("div",null,e(Te,{component:he,label:"API Key",name:"apiKey",caption:"Generate an API key in your Uniform team settings."})),e("div",null,e(Te,{component:he,label:"Project ID",name:"projectId",caption:"Available to copy after generating an API key"})),e("div",null,e(Te,{component:he,label:"API Host",name:"apiHost",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option."})),e("section",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(C,{type:"submit",buttonType:"primary",disabled:a},a?"Verifying...":"Connect"),e(C,{type:"button",buttonType:"ghost",onClick:()=>t("qc"),disabled:a},"Use Quick Connect")))))))}var Dt=({settings:t,saveSettings:r})=>{let n=t.apiKey&&t.projectId?{apiKey:t.apiKey,projectId:t.projectId,apiHost:t.apiHost}:void 0;return e("article",{css:h.page},e("h1",{css:h.title},"Connect to Uniform Context"),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(St,{onConnect:async o=>{o?await r({...t,apiKey:o.apiKey,projectId:o.projectId,apiHost:o.apiHost}):await r({...t,apiKey:void 0,projectId:void 0,apiHost:void 0})},currentData:n}))};var Do=Ot`
|
|
1016
|
+
background: var(--white);
|
|
1017
|
+
padding: var(--spacing-base);
|
|
1018
|
+
overflow-y: auto;
|
|
1019
|
+
@supports ((scrollbar-color: #d1d5db transparent) and (scrollbar-width: thin)) {
|
|
1020
|
+
/*
|
|
1021
|
+
#d1d5db = bg-gray-300
|
|
1022
|
+
scrollbar-color first arg is the thumb, the second arg is the trackbar color
|
|
1023
|
+
hover state in firefox is controlled within the browser
|
|
1024
|
+
*/
|
|
1025
|
+
scrollbar-color: #d1d5db transparent;
|
|
1026
|
+
scrollbar-width: thin;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
&::-webkit-scrollbar {
|
|
1030
|
+
width: 8px;
|
|
1031
|
+
height: 8px;
|
|
1032
|
+
}
|
|
1033
|
+
&::-webkit-scrollbar-track {
|
|
1034
|
+
background: transparent;
|
|
1035
|
+
border-radius: var(--rounded-base);
|
|
1036
|
+
}
|
|
1037
|
+
&::-webkit-scrollbar-thumb {
|
|
1038
|
+
background: var(--gray-300);
|
|
1039
|
+
border-radius: var(--rounded-base);
|
|
1040
|
+
}
|
|
1041
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
1042
|
+
background: var(--gray-500);
|
|
1043
|
+
}
|
|
1044
|
+
`;function It(t){let r=Tt(t.settings,t.state.manifest),n=xt(t.settings,t.state.data.quirks),o={...t,dimensionIndex:r,quirksIndex:n},i=()=>{var s;if(r.loading||n.loading)return e(Lt,null);if(t.settings.route&&t.settings.route.match(/overrides\/\w+/))return e(we,{...o});switch((s=t.settings)==null?void 0:s.route){case void 0:case"/":case"/dimensions":return e(Xe,{...o});case"/overrides":return e(je,{...o});case"/overrides/add":return e(we,{...o});case"/quirks":return e(yt,{...o});case"/settings":return e(Ct,{...o});case"/connect":return e(Dt,{...o});default:return e(Oe,null)}};return e(Se,{settings:t.settings,saveSettings:t.saveSettings},e(be,null),e("div",{css:Ot`
|
|
1045
|
+
display: grid;
|
|
1046
|
+
grid-template-columns: 200px auto;
|
|
1047
|
+
font-weight: var(--font-regular);
|
|
1048
|
+
font-size: var(--base-font-size);
|
|
1049
|
+
font-family: var(--base-font-family);
|
|
1050
|
+
line-height: var(--base-line-height);
|
|
1051
|
+
height: var(--min-height);
|
|
1052
|
+
min-width: var(--site-width);
|
|
1053
|
+
`},e(De,{...t}),e("main",{css:Do},e(ke,{...t}),i())))}import{Context as Oo,createDebugConsoleLogDrain as Io}from"@uniformdev/context";import*as P from"react";function Rt({context:t,initialSettings:r}){let n=t!=null?t:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new Oo({manifest:{project:{}}}),[i,s]=P.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[c,v]=P.useState(r!=null?r:{});P.useEffect(()=>{var a;let l=Io((a=c.logLevel)!=null?a:"none");return o.events.on("log",l),()=>{o.events.off("log",l)}},[c,o]),P.useEffect(()=>{let l=()=>{let d=fe({quirks:o.storage.data.quirks,quirkOverrides:c.quirkOverrides});d&&(console.log("Applying overridden quirks:",d),o.update({quirks:d}));let f=ve({scores:o.scores,scoreOverrides:c.scoreOverrides});f.length&&(console.log("Applying overridden scores:",f),o.storage.updateData(f)),s(y=>({...y,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},a=d=>{!d.changed||s(f=>({...f,personalizations:[...f.personalizations,d]}))},p=d=>{!d.variantAssigned||s(f=>({...f,tests:[...f.tests,d]}))};return o.events.on("personalizationResult",a),o.events.on("testResult",p),o.storage.events.on("*",l),()=>{o.storage.events.off("*",l),o.events.off("personalizationResult",a),o.events.off("testResult",p)}},[o,c]);let m=P.useMemo(()=>({update:a=>o.update(a),forget:()=>o.forget(!1),rawUpdate:a=>o.storage.updateData(a)}),[o]);return n?e(It,{state:i,actions:m,settings:c,saveSettings:v}):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}import{css as Mo}from"@emotion/react";import*as Mt from"react";import{css as Ro}from"@emotion/react";var Po=Ro`
|
|
1054
|
+
align-items: center;
|
|
1055
|
+
border-radius: var(--rounded-full);
|
|
1056
|
+
background: var(--brand-secondary-5);
|
|
1057
|
+
border: none;
|
|
1058
|
+
box-shadow: var(--shadow-base);
|
|
1059
|
+
color: var(--white);
|
|
1060
|
+
cursor: pointer;
|
|
1061
|
+
display: flex;
|
|
1062
|
+
justify-content: center;
|
|
1063
|
+
position: fixed;
|
|
1064
|
+
bottom: var(--spacing-base);
|
|
1065
|
+
right: var(--spacing-base);
|
|
1066
|
+
z-index: 20;
|
|
1067
|
+
width: 52px;
|
|
1068
|
+
height: 52px;
|
|
1069
|
+
transform: scale(0.9);
|
|
1070
|
+
transition: transform 0.25s ease-in-out;
|
|
1071
|
+
&:hover {
|
|
1072
|
+
transform: scale(1);
|
|
1073
|
+
}
|
|
1074
|
+
& svg {
|
|
1075
|
+
display: block;
|
|
1076
|
+
max-width: 100%;
|
|
1077
|
+
height: auto;
|
|
1078
|
+
}
|
|
1079
|
+
`,Pt=({...t})=>e("button",{type:"button",css:Po,...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 La(t){var i;let[r,n]=Mt.useState(!1);return((i=t.context)!=null?i:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?e("div",null,e(be,null),e(Pt,{onClick:()=>n(s=>!s)}),r?e("div",{css:Mo`
|
|
1080
|
+
box-shadow: var(--shadow-base);
|
|
1081
|
+
position: fixed;
|
|
1082
|
+
bottom: 82px;
|
|
1083
|
+
right: var(--spacing-base);
|
|
1084
|
+
z-index: var(--z-10);
|
|
1085
|
+
max-width: var(--site-width);
|
|
1086
|
+
`},e(Rt,{...t})):null):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}export{It as ContextDevTools,Rt as EmbeddedContextDevTools,La as ToggleEmbeddedContextDevTools};
|