@pixerate/editor-svelte 0.193.2 → 0.194.0
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.
|
@@ -25,9 +25,11 @@
|
|
|
25
25
|
void b.refresh();
|
|
26
26
|
return off;
|
|
27
27
|
});
|
|
28
|
+
/** A sticker's tooltip: name, ref, licence and credit, AI-generated, dark variant. */
|
|
29
|
+
const tooltip = (it: StickerBrowserItem) => `${it.name} (${it.ref}) · ${it.licence.name}${it.licence.attribution ? ` · ${it.licence.attribution}` : ''}${it.aiGenerated ? ' · AI-generated' : ''}${it.variants?.includes('dark') ? ' · light and dark' : ''}`;
|
|
28
30
|
</script>
|
|
29
31
|
|
|
30
|
-
<!-- Stickers from a sticker library: searchable, by category and a page at a time, each sticker's licence in its tooltip; clicking one calls onpick. -->
|
|
32
|
+
<!-- Stickers from a sticker library: searchable, by category or collection and a page at a time, each sticker's licence in its tooltip and an AI label on AI-generated art; clicking one calls onpick. -->
|
|
31
33
|
<div class={`flex flex-col gap-1 ${className}`} data-testid="sticker-picker">
|
|
32
34
|
{#if s}
|
|
33
35
|
<div class="flex items-center gap-1">
|
|
@@ -38,17 +40,23 @@
|
|
|
38
40
|
{#each s.categories as c (c.id)}<option value={c.id}>{c.name}</option>{/each}
|
|
39
41
|
</select>
|
|
40
42
|
{/if}
|
|
43
|
+
{#if s.collections.length > 0}
|
|
44
|
+
<select aria-label="Sticker collection" value={s.collection} onchange={(e) => void browser.setCollection(e.currentTarget.value)} class="rounded bg-slate-800 px-1 py-0.5">
|
|
45
|
+
<option value="">All collections</option>
|
|
46
|
+
{#each s.collections as c (c.id)}<option value={c.id} title={c.description}>{c.name} ({c.count})</option>{/each}
|
|
47
|
+
</select>
|
|
48
|
+
{/if}
|
|
41
49
|
</div>
|
|
42
50
|
<div class="flex max-h-32 flex-wrap gap-1 overflow-y-auto" role="group" aria-label={label}>
|
|
43
51
|
{#each s.items as it (it.ref)}
|
|
44
52
|
<button
|
|
45
53
|
type="button"
|
|
46
54
|
aria-pressed={selected.includes(it.ref)}
|
|
47
|
-
title={
|
|
55
|
+
title={tooltip(it)}
|
|
48
56
|
class={`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] ${selected.includes(it.ref) ? 'bg-indigo-600 text-white' : 'bg-slate-800 text-slate-300'}`}
|
|
49
57
|
onclick={() => onpick(it)}
|
|
50
58
|
>
|
|
51
|
-
{#if it.thumbnail}<img src={it.thumbnail} alt="" class="h-4 w-4" />{/if}{it.name}
|
|
59
|
+
{#if it.thumbnail}<img src={it.thumbnail} alt="" class="h-4 w-4" />{/if}{it.name}{#if it.aiGenerated}<span class="rounded bg-slate-700 px-0.5 text-[8px] text-slate-200" aria-label="AI-generated">AI</span>{/if}
|
|
52
60
|
</button>
|
|
53
61
|
{/each}
|
|
54
62
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.194.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"**/*.css"
|
|
176
176
|
],
|
|
177
177
|
"dependencies": {
|
|
178
|
-
"@pixerate/editor": "0.
|
|
178
|
+
"@pixerate/editor": "0.263.0"
|
|
179
179
|
},
|
|
180
180
|
"peerDependencies": {
|
|
181
181
|
"@dagrejs/dagre": "^1.1.4",
|