@rogieking/figui3 1.5.7 → 1.5.9
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/components.css +2 -0
- package/fig.js +24 -2
- package/package.json +1 -1
package/components.css
CHANGED
|
@@ -547,6 +547,7 @@ input[type="text"][list] {
|
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
+
/* Not enough support for this yet
|
|
550
551
|
@supports (appearance: base-select) {
|
|
551
552
|
select {
|
|
552
553
|
appearance: base-select;
|
|
@@ -648,6 +649,7 @@ input[type="text"][list] {
|
|
|
648
649
|
box-shadow: var(--figma-elevation-400-menu-panel);
|
|
649
650
|
}
|
|
650
651
|
}
|
|
652
|
+
*/
|
|
651
653
|
input[type="text"][list]:hover,
|
|
652
654
|
input[type="text"][list]:active,
|
|
653
655
|
input[type="text"][list]:focus,
|
package/fig.js
CHANGED
|
@@ -1925,8 +1925,30 @@ class FigImage extends HTMLElement {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
});
|
|
1927
1927
|
}
|
|
1928
|
-
handleFileInput(e) {
|
|
1929
|
-
this.
|
|
1928
|
+
async handleFileInput(e) {
|
|
1929
|
+
this.blob = URL.createObjectURL(e.target.files[0]);
|
|
1930
|
+
//set base64 url
|
|
1931
|
+
const reader = new FileReader();
|
|
1932
|
+
reader.readAsDataURL(e.target.files[0]);
|
|
1933
|
+
//await this data url to be set
|
|
1934
|
+
await new Promise((resolve) => {
|
|
1935
|
+
reader.onload = (e) => {
|
|
1936
|
+
this.base64 = e.target.result;
|
|
1937
|
+
resolve();
|
|
1938
|
+
};
|
|
1939
|
+
});
|
|
1940
|
+
//emit event for loaded
|
|
1941
|
+
this.dispatchEvent(
|
|
1942
|
+
new CustomEvent("load", {
|
|
1943
|
+
bubbles: true,
|
|
1944
|
+
cancelable: true,
|
|
1945
|
+
detail: {
|
|
1946
|
+
blob: this.blob,
|
|
1947
|
+
base64: this.base64,
|
|
1948
|
+
},
|
|
1949
|
+
})
|
|
1950
|
+
);
|
|
1951
|
+
this.src = this.blob;
|
|
1930
1952
|
this.setAttribute("src", this.src);
|
|
1931
1953
|
this.chit.setAttribute("src", this.src);
|
|
1932
1954
|
}
|