@reuters-graphics/graphics-components 0.0.14 → 0.0.15
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.
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
let activeEmbed = getDefaultEmbed();
|
|
26
|
+
let activeEmbedIndex = embeds.indexOf(activeEmbed);
|
|
26
27
|
|
|
27
28
|
$: embedTitles = getUniqNames(embeds);
|
|
28
29
|
|
|
@@ -30,11 +31,17 @@
|
|
|
30
31
|
let pymParent;
|
|
31
32
|
|
|
32
33
|
const reframe = (embed) => {
|
|
34
|
+
// Bit of hack for handling adding query strings dynamically to embeds.
|
|
35
|
+
// cf. also the value prop on the Typeahead component...
|
|
36
|
+
const activeEmbed =
|
|
37
|
+
embeds.indexOf(embed) > -1
|
|
38
|
+
? embed
|
|
39
|
+
: embeds[activeEmbedIndex] || embeds[0];
|
|
33
40
|
pymParent = new pym.Parent(
|
|
34
41
|
'frame-parent',
|
|
35
|
-
/^http/.test(
|
|
36
|
-
?
|
|
37
|
-
: urljoin(window.location.origin,
|
|
42
|
+
/^http/.test(activeEmbed)
|
|
43
|
+
? activeEmbed
|
|
44
|
+
: urljoin(window.location.origin, activeEmbed, { trailingSlash: true })
|
|
38
45
|
);
|
|
39
46
|
};
|
|
40
47
|
|
|
@@ -68,7 +75,9 @@
|
|
|
68
75
|
</div>
|
|
69
76
|
<Typeahead
|
|
70
77
|
label="Select an embed"
|
|
71
|
-
value="{embedTitles[embeds.indexOf(activeEmbed)]
|
|
78
|
+
value="{embedTitles[embeds.indexOf(activeEmbed)] ||
|
|
79
|
+
embedTitles[activeEmbedIndex] ||
|
|
80
|
+
embedTitles[0]}"
|
|
72
81
|
extract="{(d) => embedTitles[d.index]}"
|
|
73
82
|
data="{embeds.map((embed, index) => ({ index, embed }))}"
|
|
74
83
|
placeholder="{'Search'}"
|
|
@@ -81,6 +90,7 @@
|
|
|
81
90
|
);
|
|
82
91
|
}
|
|
83
92
|
activeEmbed = detail.original.embed;
|
|
93
|
+
activeEmbedIndex = detail.original.index;
|
|
84
94
|
}}"
|
|
85
95
|
/>
|
|
86
96
|
</div>
|
|
@@ -103,62 +113,63 @@
|
|
|
103
113
|
maxFrameWidth="{maxFrameWidth}"
|
|
104
114
|
/>
|
|
105
115
|
|
|
106
|
-
<style>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
116
|
+
<style>
|
|
117
|
+
header {
|
|
118
|
+
font-family: 'Knowledge', 'Source Sans Pro', Arial, sans-serif;
|
|
119
|
+
font-size: 50px;
|
|
120
|
+
text-align: center;
|
|
121
|
+
text-transform: uppercase;
|
|
122
|
+
font-weight: 700;
|
|
123
|
+
margin: 20px 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
div#typeahead-container {
|
|
127
|
+
max-width: 660px;
|
|
128
|
+
margin: 0 auto 15px;
|
|
129
|
+
position: relative;
|
|
130
|
+
}
|
|
131
|
+
div#typeahead-container div.embed-link {
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0;
|
|
134
|
+
right: 0;
|
|
135
|
+
display: inline-block;
|
|
136
|
+
z-index: 2;
|
|
137
|
+
}
|
|
138
|
+
div#typeahead-container div.embed-link a {
|
|
139
|
+
font-family: 'Knowledge', 'Source Sans Pro', Arial, sans-serif;
|
|
140
|
+
color: #bbb;
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
text-decoration: none !important;
|
|
143
|
+
}
|
|
144
|
+
div#typeahead-container div.embed-link a:hover {
|
|
145
|
+
color: #666;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
div#preview-label {
|
|
149
|
+
margin: 0 auto;
|
|
150
|
+
}
|
|
151
|
+
div#preview-label p {
|
|
152
|
+
font-family: 'Knowledge', 'Source Sans Pro', Arial, sans-serif;
|
|
153
|
+
color: #aaa;
|
|
154
|
+
font-size: 0.75rem;
|
|
155
|
+
margin: 0 0 0.25rem;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
#frame-parent {
|
|
159
|
+
border: 1px solid #ddd;
|
|
160
|
+
margin: 0 auto;
|
|
161
|
+
width: var(--width);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
div#home-link {
|
|
165
|
+
position: fixed;
|
|
166
|
+
bottom: 5px;
|
|
167
|
+
left: 10px;
|
|
168
|
+
font-size: 18px;
|
|
169
|
+
}
|
|
170
|
+
div#home-link a {
|
|
171
|
+
color: #ccc;
|
|
172
|
+
}
|
|
173
|
+
div#home-link a:hover {
|
|
174
|
+
color: #666;
|
|
175
|
+
}</style>
|