@rainlanguage/ui-components 0.0.1-alpha.87 → 0.0.1-alpha.89
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.
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
import { PenSolid } from "flowbite-svelte-icons";
|
|
2
3
|
export let displayValue;
|
|
3
|
-
let focussed = false;
|
|
4
4
|
let textContent;
|
|
5
5
|
let editableSpan;
|
|
6
6
|
let dispatch = createEventDispatcher();
|
|
7
|
-
const inputFocussed = () => {
|
|
8
|
-
focussed = true;
|
|
9
|
-
dispatch("focus");
|
|
10
|
-
};
|
|
11
7
|
const inputBlurred = () => {
|
|
12
|
-
focussed = false;
|
|
13
8
|
displayValue = textContent;
|
|
14
9
|
dispatch("blur", { value: textContent });
|
|
15
10
|
};
|
|
@@ -20,27 +15,21 @@ const handleKeyDown = (event) => {
|
|
|
20
15
|
};
|
|
21
16
|
</script>
|
|
22
17
|
|
|
23
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
24
18
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
25
19
|
<div
|
|
26
20
|
data-testid="editableSpanWrapper"
|
|
27
|
-
|
|
28
|
-
class="flex gap-x-1 border-b-2 border-dotted text-sm text-gray-400 dark:text-gray-400"
|
|
21
|
+
class="flex items-center gap-x-1 border-b-2 border-dotted text-sm text-gray-400 dark:text-gray-400"
|
|
29
22
|
>
|
|
23
|
+
<PenSolid class="h-3 w-3 cursor-pointer" />
|
|
30
24
|
<span>Block:</span>
|
|
31
25
|
<div class="relative">
|
|
32
26
|
<span
|
|
33
27
|
data-testid="editableSpan"
|
|
34
|
-
class="absolute"
|
|
35
|
-
class:opacity-0={!focussed}
|
|
36
28
|
bind:this={editableSpan}
|
|
37
29
|
bind:textContent
|
|
38
30
|
contenteditable="true"
|
|
39
31
|
on:keydown={handleKeyDown}
|
|
40
32
|
on:blur={inputBlurred}>{displayValue}</span
|
|
41
33
|
>
|
|
42
|
-
<span data-testid="displayElement" class="pointer-events-none" class:opacity-0={focussed}
|
|
43
|
-
>{displayValue}</span
|
|
44
|
-
>
|
|
45
34
|
</div>
|
|
46
35
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainlanguage/ui-components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.89",
|
|
4
4
|
"description": "A component library for building Svelte applications to be used with Raindex.",
|
|
5
5
|
"license": "LicenseRef-DCL-1.0",
|
|
6
6
|
"author": "Rain Open Source Software Ltd",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@fontsource/dm-sans": "5.1.0",
|
|
54
54
|
"@imask/svelte": "7.6.1",
|
|
55
55
|
"@observablehq/plot": "0.6.16",
|
|
56
|
-
"@rainlanguage/orderbook": "0.0.1-alpha.
|
|
56
|
+
"@rainlanguage/orderbook": "0.0.1-alpha.89",
|
|
57
57
|
"@reown/appkit": "1.6.4",
|
|
58
58
|
"@reown/appkit-adapter-wagmi": "1.6.4",
|
|
59
59
|
"@sentry/sveltekit": "7.120.0",
|