@reuters-graphics/graphics-components 0.0.7 → 0.0.10
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.
|
@@ -62,9 +62,6 @@ export default class Index extends SvelteComponentTyped<{
|
|
|
62
62
|
index: any;
|
|
63
63
|
value: string;
|
|
64
64
|
};
|
|
65
|
-
'no-results': {
|
|
66
|
-
value: string;
|
|
67
|
-
};
|
|
68
65
|
}> {
|
|
69
66
|
}
|
|
70
67
|
export type IndexProps = typeof __propDef.props;
|
|
@@ -135,9 +132,6 @@ declare const __propDef: {
|
|
|
135
132
|
index: any;
|
|
136
133
|
value: string;
|
|
137
134
|
};
|
|
138
|
-
'no-results': {
|
|
139
|
-
value: string;
|
|
140
|
-
};
|
|
141
135
|
};
|
|
142
136
|
};
|
|
143
137
|
export {};
|
|
@@ -14,7 +14,15 @@
|
|
|
14
14
|
export let minFrameWidth = 320;
|
|
15
15
|
export let maxFrameWidth = 1200;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const getDefaultEmbed = () => {
|
|
18
|
+
if (typeof window === 'undefined') return embeds[0];
|
|
19
|
+
const lastActiveEmbed = window.localStorage.getItem('framer-active-embed');
|
|
20
|
+
if (!lastActiveEmbed) return embeds[0];
|
|
21
|
+
if (embeds.indexOf(lastActiveEmbed) > -1) return lastActiveEmbed;
|
|
22
|
+
return embeds[0];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
let activeEmbed = getDefaultEmbed();
|
|
18
26
|
|
|
19
27
|
$: embedTitles = getUniqNames(embeds);
|
|
20
28
|
|
|
@@ -66,6 +74,11 @@
|
|
|
66
74
|
placeholder="{'Search'}"
|
|
67
75
|
showDropdownOnFocus="{true}"
|
|
68
76
|
on:select="{({ detail }) => {
|
|
77
|
+
if (typeof window !== 'undefined')
|
|
78
|
+
window.localStorage.setItem(
|
|
79
|
+
'framer-active-embed',
|
|
80
|
+
detail.original.embed
|
|
81
|
+
);
|
|
69
82
|
activeEmbed = detail.original.embed;
|
|
70
83
|
}}"
|
|
71
84
|
/>
|
|
@@ -171,7 +171,8 @@
|
|
|
171
171
|
aria-haspopup="listbox"
|
|
172
172
|
aria-owns="{id}-listbox"
|
|
173
173
|
class:dropdown="{results.length > 0}"
|
|
174
|
-
aria-expanded="{showResults
|
|
174
|
+
aria-expanded="{showResults ||
|
|
175
|
+
(isFocused && value.length > 0 && results.length === 0)}"
|
|
175
176
|
id="{id}-typeahead"
|
|
176
177
|
>
|
|
177
178
|
<Search
|
|
@@ -257,10 +258,8 @@
|
|
|
257
258
|
</li>
|
|
258
259
|
{/each}
|
|
259
260
|
{/if}
|
|
260
|
-
{#if
|
|
261
|
-
<
|
|
262
|
-
<slot name="no-results" value="{value}" />
|
|
263
|
-
</div>
|
|
261
|
+
{#if value.length > 0 && results.length === 0}
|
|
262
|
+
<li class="no-results disabled">No embeds found...</li>
|
|
264
263
|
{/if}
|
|
265
264
|
</ul>
|
|
266
265
|
</div>
|
|
@@ -273,11 +272,11 @@ ul {
|
|
|
273
272
|
position: absolute;
|
|
274
273
|
top: 100%;
|
|
275
274
|
left: 0;
|
|
276
|
-
width:
|
|
275
|
+
width: 100%;
|
|
277
276
|
padding: 0;
|
|
278
277
|
margin: 0;
|
|
279
278
|
list-style: none;
|
|
280
|
-
background-color:
|
|
279
|
+
background-color: #fff;
|
|
281
280
|
}
|
|
282
281
|
|
|
283
282
|
[aria-expanded=true] ul {
|
|
@@ -288,12 +287,18 @@ ul {
|
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
li,
|
|
291
|
-
.no-results {
|
|
290
|
+
li.no-results {
|
|
292
291
|
padding: 0.25rem 1rem;
|
|
293
292
|
font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
|
|
294
293
|
color: #333;
|
|
295
294
|
}
|
|
296
295
|
|
|
296
|
+
li.no-results {
|
|
297
|
+
color: #333;
|
|
298
|
+
font-size: 0.85rem;
|
|
299
|
+
font-style: italic;
|
|
300
|
+
}
|
|
301
|
+
|
|
297
302
|
li {
|
|
298
303
|
cursor: pointer;
|
|
299
304
|
}
|