builder-settings-types 0.0.301 → 0.0.302
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/dist/Font.svg +3 -3
- package/dist/Opacity.svg +7 -7
- package/dist/Typography-Size.svg +3 -3
- package/dist/URL.svg +3 -3
- package/dist/Upload.svg +4 -4
- package/dist/Weight.svg +3 -3
- package/dist/align-centre.svg +4 -4
- package/dist/align-left.svg +4 -4
- package/dist/align-right.svg +4 -4
- package/dist/base/settings-group/settingsGroup.d.ts +1 -0
- package/dist/border-size.svg +3 -3
- package/dist/builder-settings-types.cjs.js +8 -8
- package/dist/builder-settings-types.es.js +55 -35
- package/dist/chevron-down.svg +5 -5
- package/dist/colors.svg +3 -3
- package/dist/margins-bottom.svg +3 -3
- package/dist/margins-left.svg +3 -3
- package/dist/margins-right.svg +3 -3
- package/dist/margins-top.svg +3 -3
- package/dist/radius.svg +3 -3
- package/dist/settings/select-api/select-api.d.ts +1 -0
- package/dist/spacing-height.svg +3 -3
- package/dist/spacing-width.svg +3 -3
- package/dist/transparency-pattern.svg +11 -11
- package/package.json +1 -1
package/dist/Font.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6.75 15.5H11.25M9 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6.75 15.5H11.25M9 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/Opacity.svg
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M3.69749 15.365C3.54749 15.365 3.40502 15.305 3.30002 15.2C1.77752 13.6775 0.9375 11.6525 0.9375 9.5C0.9375 5.0525 4.5525 1.4375 9 1.4375C11.1525 1.4375 13.1775 2.2775 14.7 3.8C14.805 3.905 14.865 4.0475 14.865 4.1975C14.865 4.3475 14.805 4.49 14.7 4.595L4.09502 15.2C3.99002 15.305 3.84749 15.365 3.69749 15.365ZM9 2.5625C5.175 2.5625 2.0625 5.675 2.0625 9.5C2.0625 11.165 2.64751 12.74 3.71251 13.9925L13.4925 4.2125C12.24 3.1475 10.665 2.5625 9 2.5625Z" fill="#667085"/>
|
|
3
|
-
<path d="M9.00014 17.5626C6.84764 17.5626 4.82266 16.7226 3.30016 15.2001C3.19516 15.0951 3.13513 14.9526 3.13513 14.8026C3.13513 14.6526 3.19516 14.5101 3.30016 14.4051L13.9051 3.80009C14.1226 3.58259 14.4826 3.58259 14.7001 3.80009C16.2226 5.32259 17.0626 7.34759 17.0626 9.50009C17.0626 13.9476 13.4476 17.5626 9.00014 17.5626ZM4.50764 14.7876C5.76014 15.8526 7.33514 16.4376 9.00014 16.4376C12.8251 16.4376 15.9376 13.3251 15.9376 9.50009C15.9376 7.83509 15.3526 6.26009 14.2876 5.00759L4.50764 14.7876Z" fill="#667085"/>
|
|
4
|
-
<path d="M10.0575 17.4875C9.91496 17.4875 9.77248 17.435 9.65998 17.3225L5.41496 13.0775C5.19746 12.86 5.19746 12.5 5.41496 12.2825C5.63246 12.065 5.9925 12.065 6.21 12.2825L10.455 16.5275C10.6725 16.745 10.6725 17.105 10.455 17.3225C10.35 17.435 10.2075 17.4875 10.0575 17.4875Z" fill="#667085"/>
|
|
5
|
-
<path d="M13.4025 15.5225C13.26 15.5225 13.1175 15.47 13.005 15.3575L8.06999 10.4225C7.85249 10.205 7.85249 9.84498 8.06999 9.62748C8.28749 9.40998 8.64748 9.40998 8.86498 9.62748L13.8 14.5625C14.0175 14.78 14.0175 15.14 13.8 15.3575C13.6875 15.47 13.545 15.5225 13.4025 15.5225Z" fill="#667085"/>
|
|
6
|
-
<path d="M15.84 12.6651C15.6975 12.6651 15.555 12.6126 15.4425 12.5001L10.725 7.78259C10.5075 7.56509 10.5075 7.20509 10.725 6.98759C10.9425 6.77009 11.3025 6.77009 11.52 6.98759L16.2375 11.7051C16.455 11.9226 16.455 12.2826 16.2375 12.5001C16.1325 12.6051 15.99 12.6651 15.84 12.6651Z" fill="#667085"/>
|
|
7
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3.69749 15.365C3.54749 15.365 3.40502 15.305 3.30002 15.2C1.77752 13.6775 0.9375 11.6525 0.9375 9.5C0.9375 5.0525 4.5525 1.4375 9 1.4375C11.1525 1.4375 13.1775 2.2775 14.7 3.8C14.805 3.905 14.865 4.0475 14.865 4.1975C14.865 4.3475 14.805 4.49 14.7 4.595L4.09502 15.2C3.99002 15.305 3.84749 15.365 3.69749 15.365ZM9 2.5625C5.175 2.5625 2.0625 5.675 2.0625 9.5C2.0625 11.165 2.64751 12.74 3.71251 13.9925L13.4925 4.2125C12.24 3.1475 10.665 2.5625 9 2.5625Z" fill="#667085"/>
|
|
3
|
+
<path d="M9.00014 17.5626C6.84764 17.5626 4.82266 16.7226 3.30016 15.2001C3.19516 15.0951 3.13513 14.9526 3.13513 14.8026C3.13513 14.6526 3.19516 14.5101 3.30016 14.4051L13.9051 3.80009C14.1226 3.58259 14.4826 3.58259 14.7001 3.80009C16.2226 5.32259 17.0626 7.34759 17.0626 9.50009C17.0626 13.9476 13.4476 17.5626 9.00014 17.5626ZM4.50764 14.7876C5.76014 15.8526 7.33514 16.4376 9.00014 16.4376C12.8251 16.4376 15.9376 13.3251 15.9376 9.50009C15.9376 7.83509 15.3526 6.26009 14.2876 5.00759L4.50764 14.7876Z" fill="#667085"/>
|
|
4
|
+
<path d="M10.0575 17.4875C9.91496 17.4875 9.77248 17.435 9.65998 17.3225L5.41496 13.0775C5.19746 12.86 5.19746 12.5 5.41496 12.2825C5.63246 12.065 5.9925 12.065 6.21 12.2825L10.455 16.5275C10.6725 16.745 10.6725 17.105 10.455 17.3225C10.35 17.435 10.2075 17.4875 10.0575 17.4875Z" fill="#667085"/>
|
|
5
|
+
<path d="M13.4025 15.5225C13.26 15.5225 13.1175 15.47 13.005 15.3575L8.06999 10.4225C7.85249 10.205 7.85249 9.84498 8.06999 9.62748C8.28749 9.40998 8.64748 9.40998 8.86498 9.62748L13.8 14.5625C14.0175 14.78 14.0175 15.14 13.8 15.3575C13.6875 15.47 13.545 15.5225 13.4025 15.5225Z" fill="#667085"/>
|
|
6
|
+
<path d="M15.84 12.6651C15.6975 12.6651 15.555 12.6126 15.4425 12.5001L10.725 7.78259C10.5075 7.56509 10.5075 7.20509 10.725 6.98759C10.9425 6.77009 11.3025 6.77009 11.52 6.98759L16.2375 11.7051C16.455 11.9226 16.455 12.2826 16.2375 12.5001C16.1325 12.6051 15.99 12.6651 15.84 12.6651Z" fill="#667085"/>
|
|
7
|
+
</svg>
|
package/dist/Typography-Size.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/URL.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M15.75 6.75L15.75 2.25M15.75 2.25H11.25M15.75 2.25L9.75 8.25M7.5 3.75H5.85C4.58988 3.75 3.95982 3.75 3.47852 3.99524C3.05516 4.21095 2.71095 4.55516 2.49524 4.97852C2.25 5.45982 2.25 6.08988 2.25 7.35V12.15C2.25 13.4101 2.25 14.0402 2.49524 14.5215C2.71095 14.9448 3.05516 15.289 3.47852 15.5048C3.95982 15.75 4.58988 15.75 5.85 15.75H10.65C11.9101 15.75 12.5402 15.75 13.0215 15.5048C13.4448 15.289 13.789 14.9448 14.0048 14.5215C14.25 14.0402 14.25 13.4101 14.25 12.15V10.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M15.75 6.75L15.75 2.25M15.75 2.25H11.25M15.75 2.25L9.75 8.25M7.5 3.75H5.85C4.58988 3.75 3.95982 3.75 3.47852 3.99524C3.05516 4.21095 2.71095 4.55516 2.49524 4.97852C2.25 5.45982 2.25 6.08988 2.25 7.35V12.15C2.25 13.4101 2.25 14.0402 2.49524 14.5215C2.71095 14.9448 3.05516 15.289 3.47852 15.5048C3.95982 15.75 4.58988 15.75 5.85 15.75H10.65C11.9101 15.75 12.5402 15.75 13.0215 15.5048C13.4448 15.289 13.789 14.9448 14.0048 14.5215C14.25 14.0402 14.25 13.4101 14.25 12.15V10.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/Upload.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect y="0.5" width="30" height="30" rx="15" fill="#F2F4F7"/>
|
|
3
|
-
<path d="M12 17.5L14.5 15M14.5 15L17 17.5M14.5 15V20.625M19.5 17.9643C20.2634 17.3338 20.75 16.38 20.75 15.3125C20.75 13.414 19.211 11.875 17.3125 11.875C17.1759 11.875 17.0482 11.8037 16.9788 11.6861C16.1638 10.303 14.659 9.375 12.9375 9.375C10.3487 9.375 8.25 11.4737 8.25 14.0625C8.25 15.3538 8.77215 16.5232 9.61684 17.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg width="30" height="31" viewBox="0 0 30 31" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect y="0.5" width="30" height="30" rx="15" fill="#F2F4F7"/>
|
|
3
|
+
<path d="M12 17.5L14.5 15M14.5 15L17 17.5M14.5 15V20.625M19.5 17.9643C20.2634 17.3338 20.75 16.38 20.75 15.3125C20.75 13.414 19.211 11.875 17.3125 11.875C17.1759 11.875 17.0482 11.8037 16.9788 11.6861C16.1638 10.303 14.659 9.375 12.9375 9.375C10.3487 9.375 8.25 11.4737 8.25 14.0625C8.25 15.3538 8.77215 16.5232 9.61684 17.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
package/dist/Weight.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/align-centre.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M12 7.5C12.6989 7.5 13.0484 7.5 13.324 7.38582C13.6916 7.23358 13.9836 6.94157 14.1358 6.57402C14.25 6.29837 14.25 5.94891 14.25 5.25C14.25 4.55109 14.25 4.20163 14.1358 3.92598C13.9836 3.55843 13.6916 3.26642 13.324 3.11418C13.0484 3 12.6989 3 12 3L6 3C5.30109 3 4.95163 3 4.67598 3.11418C4.30843 3.26642 4.01642 3.55843 3.86418 3.92597C3.75 4.20163 3.75 4.55109 3.75 5.25C3.75 5.94891 3.75 6.29837 3.86418 6.57402C4.01642 6.94157 4.30843 7.23358 4.67598 7.38582C4.95163 7.5 5.30109 7.5 6 7.5L12 7.5Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M12 7.5C12.6989 7.5 13.0484 7.5 13.324 7.38582C13.6916 7.23358 13.9836 6.94157 14.1358 6.57402C14.25 6.29837 14.25 5.94891 14.25 5.25C14.25 4.55109 14.25 4.20163 14.1358 3.92598C13.9836 3.55843 13.6916 3.26642 13.324 3.11418C13.0484 3 12.6989 3 12 3L6 3C5.30109 3 4.95163 3 4.67598 3.11418C4.30843 3.26642 4.01642 3.55843 3.86418 3.92597C3.75 4.20163 3.75 4.55109 3.75 5.25C3.75 5.94891 3.75 6.29837 3.86418 6.57402C4.01642 6.94157 4.30843 7.23358 4.67598 7.38582C4.95163 7.5 5.30109 7.5 6 7.5L12 7.5Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
package/dist/align-left.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M10.5 7.5C11.1989 7.5 11.5484 7.5 11.824 7.38582C12.1916 7.23358 12.4836 6.94157 12.6358 6.57402C12.75 6.29837 12.75 5.94891 12.75 5.25C12.75 4.55109 12.75 4.20163 12.6358 3.92598C12.4836 3.55843 12.1916 3.26642 11.824 3.11418C11.5484 3 11.1989 3 10.5 3L4.5 3C3.80109 3 3.45163 3 3.17598 3.11418C2.80843 3.26642 2.51642 3.55843 2.36418 3.92597C2.25 4.20163 2.25 4.55109 2.25 5.25C2.25 5.94891 2.25 6.29837 2.36418 6.57402C2.51642 6.94157 2.80843 7.23358 3.17597 7.38582C3.45163 7.5 3.80109 7.5 4.5 7.5L10.5 7.5Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M10.5 7.5C11.1989 7.5 11.5484 7.5 11.824 7.38582C12.1916 7.23358 12.4836 6.94157 12.6358 6.57402C12.75 6.29837 12.75 5.94891 12.75 5.25C12.75 4.55109 12.75 4.20163 12.6358 3.92598C12.4836 3.55843 12.1916 3.26642 11.824 3.11418C11.5484 3 11.1989 3 10.5 3L4.5 3C3.80109 3 3.45163 3 3.17598 3.11418C2.80843 3.26642 2.51642 3.55843 2.36418 3.92597C2.25 4.20163 2.25 4.55109 2.25 5.25C2.25 5.94891 2.25 6.29837 2.36418 6.57402C2.51642 6.94157 2.80843 7.23358 3.17597 7.38582C3.45163 7.5 3.80109 7.5 4.5 7.5L10.5 7.5Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
package/dist/align-right.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M13.5 7.5C14.1989 7.5 14.5484 7.5 14.824 7.38582C15.1916 7.23358 15.4836 6.94157 15.6358 6.57402C15.75 6.29837 15.75 5.94891 15.75 5.25C15.75 4.55109 15.75 4.20163 15.6358 3.92598C15.4836 3.55843 15.1916 3.26642 14.824 3.11418C14.5484 3 14.1989 3 13.5 3L7.5 3C6.80109 3 6.45163 3 6.17598 3.11418C5.80843 3.26642 5.51642 3.55843 5.36418 3.92597C5.25 4.20163 5.25 4.55109 5.25 5.25C5.25 5.94891 5.25 6.29837 5.36418 6.57402C5.51642 6.94157 5.80843 7.23358 6.17598 7.38582C6.45163 7.5 6.80109 7.5 7.5 7.5L13.5 7.5Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M13.5 7.5C14.1989 7.5 14.5484 7.5 14.824 7.38582C15.1916 7.23358 15.4836 6.94157 15.6358 6.57402C15.75 6.29837 15.75 5.94891 15.75 5.25C15.75 4.55109 15.75 4.20163 15.6358 3.92598C15.4836 3.55843 15.1916 3.26642 14.824 3.11418C14.5484 3 14.1989 3 13.5 3L7.5 3C6.80109 3 6.45163 3 6.17598 3.11418C5.80843 3.26642 5.51642 3.55843 5.36418 3.92597C5.25 4.20163 5.25 4.55109 5.25 5.25C5.25 5.94891 5.25 6.29837 5.36418 6.57402C5.51642 6.94157 5.80843 7.23358 6.17598 7.38582C6.45163 7.5 6.80109 7.5 7.5 7.5L13.5 7.5Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -65,6 +65,7 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
|
|
|
65
65
|
private forceChildUIRefresh;
|
|
66
66
|
removeSetting(key: string): void;
|
|
67
67
|
updateVisibility(): void;
|
|
68
|
+
updateSettings(newSettings: SettingsMap): void;
|
|
68
69
|
clone(): SettingGroupWithSettings<TSettings>;
|
|
69
70
|
resetDefault(): void;
|
|
70
71
|
setMobileValues(values: MobileSettingValues<TSettings>): void;
|
package/dist/border-size.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ct=(c=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(c|=0));for(;c--;)t+=yt[e[c]&63];return t};function Et(c){let t=0,e=c.parentElement;for(;e;)e.classList.contains("setting-group")&&e!==c&&t++,e=e.parentElement;return t}function _(c,t){const e=Math.min(Math.max(t,0),5);c.setAttribute("data-nesting-level",e.toString()),e>0?c.style.setProperty("--visual-indent",`${e*2}px`):(c.style.removeProperty("--visual-indent"),c.style.marginLeft="")}function tt(c,t=0){c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach(i=>{const s=i,n=t+1;_(s,n),tt(s,n)})}const bt={maxLevel:5,spacingMultiplier:1,visualIndentMultiplier:2,enableAutoDetection:!0};class wt{constructor(t={}){this.observedElements=new Set,this.config={...bt,...t},this.config.enableAutoDetection&&this.setupAutoDetection()}setupAutoDetection(){this.observer=new MutationObserver(t=>{let e=!1;t.forEach(i=>{i.type==="childList"&&i.addedNodes.forEach(s=>{s instanceof HTMLElement&&(s.classList.contains("setting-group")?[s]:Array.from(s.querySelectorAll(".setting-group"))).length>0&&(e=!0)})}),e&&this.updateAllNesting()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}trackElement(t){this.observedElements.add(t),this.updateElementNesting(t)}untrackElement(t){this.observedElements.delete(t)}updateElementNesting(t){const e=Et(t);this.applyNestingWithConfig(t,e)}updateAllNesting(){this.observedElements.forEach(t=>{t.isConnected?this.updateElementNesting(t):this.observedElements.delete(t)})}applyNestingWithConfig(t,e){const i=Math.min(Math.max(e,0),this.config.maxLevel);if(t.setAttribute("data-nesting-level",i.toString()),i>0){const s=i*this.config.visualIndentMultiplier;t.style.setProperty("--visual-indent",`${s}px`)}else t.style.removeProperty("--visual-indent"),t.style.marginLeft=""}recalculateNesting(t=document.body){t.querySelectorAll(".setting-group").forEach(i=>{const s=i;this.updateElementNesting(s),this.trackElement(s)})}getNestingStats(){const t={};return this.observedElements.forEach(e=>{const i=parseInt(e.getAttribute("data-nesting-level")||"0",10);t[i]=(t[i]||0)+1}),t}destroy(){this.observer&&(this.observer.disconnect(),this.observer=void 0),this.observedElements.clear()}}const ot=new wt;function X(c){if(c===null||typeof c!="object")return c;if(c instanceof Date)return new Date(c.getTime());if(c instanceof Array)return c.map(t=>X(t));if(typeof c=="object"){const t={};for(const e in c)Object.prototype.hasOwnProperty.call(c,e)&&(t[e]=X(c[e]));return t}return c}function xt(c){switch(c){case"number":return 0;case"text":return"";case"select":return null;case"color":return"#000000";case"date":return new Date().toISOString().split("T")[0];case"button":return"";default:return""}}class b{constructor(t={}){this.props=t,this.dataPropsPath="",this.id=t.id||ct(),this.value=this.props.default,this.desktop=this.props.default,this.title=t.title||"",this.includeGetJson=t.includeGetJson!==void 0?t.includeGetJson:!0}static SetUploadUrl(t){globalThis.DefaultUploadUrl=t,b.DefaultUploadUrl=t}static SetDefaultLanguage(t){globalThis.DefaultLanguage=t,b.DefaultLanguage=t}destroy(){throw new Error("Method not implemented.")}setOnChange(t){return this.onChange=t,this}setOnBlur(t){return this.onBlur=t,this}setDataPropsPath(t){this.dataPropsPath=t}getDataPropsPath(){return this.dataPropsPath}setValue(t){this.value=t,this.inputEl&&(this.inputEl.value=String(t)),this.onChange&&this.onChange(t),this.props.detectChange&&this.props.detectChange(t)}clone(){const t=this.constructor,e=X(this.props),i=new t(e);return i.value=X(this.value),i}createInput(t){t={...this.props.inputProps,...t};const e=document.createElement("div");if(e.className=t.wrapperClassName||"",t.title||t.icon){const a=document.createElement("div");if(a.className="icon-container",t.icon){const l=this.createIcon(t.icon,t.iconClassName);a.appendChild(l)}if(t.title){const l=this.createLabel(t.title,t.labelClassName);a.appendChild(l)}e.appendChild(a)}const i=document.createElement("div");i.className=t.wrapperClassName||"";const s=document.createElement("input");this.inputEl=s,s.value=String(t.value||xt(t.inputType)),s.type=t.inputType,s.placeholder=t.placeholder||"",s.className=t.inputClassName||"",this.dataPropsPath&&s.setAttribute("data-test-id",this.dataPropsPath);const n=a=>{const l=a.target;let r=l.value;switch(t.inputType){case"number":r=Number(l.value);break;case"color":r=l.value;break;case"date":r=l.value;break;case"select":r=l.value;break;case"text":r=l.value;break;case"button":r=l.value;break;default:r=l.value}this.value=r,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)},o=a=>{a.target,this.onBlur&&this.onBlur(this.value)};return s.addEventListener("input",n),s.addEventListener("change",n),s.addEventListener("blur",o),t.inputCustomizer&&t.inputCustomizer(s),i.appendChild(s),e.appendChild(i),e}createLabel(t,e){const i=document.createElement("span");return i.textContent=t,i.className="input-label "+(e||""),i}createIcon(t,e){const i=document.createElement("span");return i.className="input-icon "+(e||""),i.innerHTML=t,i}}function H(c){return c instanceof b}function w(c){return c instanceof I}function et(c){return H(c)||w(c)}function U(c,t){for(const e in c)if(Object.prototype.hasOwnProperty.call(c,e)){const i=c[e];t(e,i)}}const Y=class Y{constructor(t){this.elementRef=null,this.isHidden=!1,this.custom=!1,this.initialValues={},this.changeTimeout=null,this.isHandlingChange=!1,this.changeHandlers=new Set,this.blurTimeout=null,this.lastChangeTime=0,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.originalDefaultValues={},this.nestingLevel=0,this.dataPropsPath="",this.hide=!1,this.id=t.id||ct(),this.title=t.title,this.settings=t.settings,this.isCollapsed=t.collapsed??!1,this.isMain=t.main??!1,this.custom=t.custom??!1,this.nestingLevel=0,this.includeGetJson=t.includeGetJson??!0,this.addItemCfg=t.addItem,this.deleteItemCfg=t.deleteItem,this.dataProps=t.dataProps,this.dataPropsPath=t.dataProps||"",this.hide=t.hide??!1,Object.assign(this,t.settings),this.initialValues=this.getValues(),this.originalDefaultValues=this.getDefaultValues(),this.propagateNestingLevel(),this.propagateDataPropsPath()}propagateNestingLevel(){const t=this.nestingLevel+1;U(this.settings,(e,i)=>{w(i)&&(i.nestingLevel=t,i.propagateNestingLevel())})}getNestingLevel(){return this.nestingLevel}setNestingLevel(t){this.nestingLevel=t,this.propagateNestingLevel(),this.elementRef&&this.updateNestingStyles()}getDataPropsPath(){return this.dataPropsPath}setDataPropsPath(t){this.dataPropsPath=t,this.propagateDataPropsPath()}propagateDataPropsPath(){U(this.settings,(t,e)=>{const i=String(t),s=this.dataPropsPath?`${this.dataPropsPath}_${i}`:i;(w(e)||H(e)&&typeof e.setDataPropsPath=="function")&&e.setDataPropsPath(s)})}updateNestingStyles(){this.elementRef&&(_(this.elementRef,this.nestingLevel),tt(this.elementRef,this.nestingLevel))}forceChildUIRefresh(){Object.entries(this.settings).forEach(([t,e])=>{try{if(w(e)){const i=e.getValues();e.setValue(i)}else if(typeof e.setValue=="function"){const i=e.value;i!==void 0&&e.setValue(i)}}catch(i){console.warn(`Error refreshing UI for setting ${t}:`,i)}})}removeSetting(t){var s;const e=this.settings[t];if(!e)return;if(delete this.settings[t],this.elementRef){const n=this.elementRef.querySelector(".setting-group-content");if(n){const o=Array.from(n.querySelectorAll(".setting-group, .setting"));for(const a of o){const l=a.id;if(l&&"id"in e&&typeof e.id=="string"&&l.includes(e.id)){a.remove();break}}}}typeof e.cleanup=="function"&&e.cleanup(),this.updateNestingStyles();const i=this.getValues();this.initialValues=i,(s=this.onChange)==null||s.call(this,i)}updateVisibility(){this.elementRef}clone(){const t={};U(this.settings,(s,n)=>{const o=String(s);typeof n.clone=="function"?t[o]=n.clone():(console.warn(`Setting with key '${o}' does not have a clone method. Copying reference.`),t[o]=n)});const e={title:this.title,settings:t,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,includeGetJson:this.includeGetJson,addItem:this.addItemCfg,deleteItem:this.deleteItemCfg,dataProps:this.dataProps,hide:this.hide},i=ht(e);return i.initialValues=this.getValues(),i}resetDefault(){const t=this.originalDefaultValues;this.setValue(t),this.onChange&&this.onChange(this.getValues())}setMobileValues(t){!t||typeof t!="object"||(Object.entries(t).forEach(([e,i])=>{const s=this.settings[e];s&&(w(s)||H(s))&&typeof s.setMobileValue=="function"&&s.setMobileValue(i)}),this.setValue(t),this.onChange&&this.onChange(this.getValues()))}getMobileValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(w(s))e[i]=s.getMobileValues();else{const n=s;e[i]=n.mobileValue!==void 0?n.mobileValue:n.value}}return e}else{const e=this.settings[t];if(!e)return;if(w(e))return e.getMobileValues();const i=e;return i.mobileValue!==void 0?i.mobileValue:i.value}}setOnChange(t){this.onChange=t;const e=()=>{this.isHandlingChange||(this.isHandlingChange=!0,this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=setTimeout(()=>{const i=this.getValues(),s=this.calculateChanges(this.initialValues,i);Object.keys(s).length>0&&(this.lastChangeTime=Date.now(),this.initialValues=i,t(i),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),U(this.settings,(i,s)=>{var n;if(w(s))s.setOnChange(()=>{const o=this.getValues();this.initialValues=o,t(o)}),this.changeHandlers.add(()=>t(this.getValues()));else if(H(s)){const o=()=>e();this.changeHandlers.add(o),s.setOnChange(o)}else{const o=()=>e();this.changeHandlers.add(o),(n=s.setOnChange)==null||n.call(s,o)}}),this}cleanup(){this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null),this.blurTimeout&&(clearTimeout(this.blurTimeout),this.blurTimeout=null),this.elementRef&&this.elementRef.removeEventListener("focusout",this.handleBlur),this.changeHandlers.clear()}setValue(t){if(!t||typeof t!="object")return;Object.entries(t).forEach(([i,s])=>{let n=this.settings[i];if(!n&&this.addItemCfg&&i.startsWith(this.addItemCfg.keyPrefix)){const o=i.slice(this.addItemCfg.keyPrefix.length),a=Number(o);if(Number.isFinite(a)){const l=this.addItemCfg.createItem(a);et(l)&&(this.addSetting(i,l),n=l)}}n&&(w(n)||H(n))&&typeof n.setValue=="function"&&n.setValue(s)}),setTimeout(()=>{this.forceChildUIRefresh()},0);const e=this.getValues();this.initialValues=e,this.onChange&&this.onChange(e)}wireChild(t){var i;const e=()=>{var n;const s=this.getValues();this.initialValues=s,(n=this.onChange)==null||n.call(this,s),this.updateVisibility()};w(t)?t.setOnChange(()=>e()):H(t)?t.setOnChange(()=>e()):(i=t.setOnChange)==null||i.call(t,()=>e())}addSetting(t,e){var s,n;if(this.settings[t]=e,this.wireChild(e),this.elementRef){const o=this.elementRef.querySelector(".setting-group-content");if(o){w(e)&&typeof e.setNestingLevel=="function"&&e.setNestingLevel(this.nestingLevel+1);const a=e.draw(),l=this.deleteItemCfg??this.addItemCfg;if(l){const p=l.keyPrefix??((s=this.addItemCfg)==null?void 0:s.keyPrefix);p&&t.startsWith(p)&&this.addDeleteButtonToElement(a,t)}const r=o.querySelector(".sg-add-button-bottom");r?o.insertBefore(a,r):o.appendChild(a),ot.trackElement(a),_(a,this.nestingLevel+1),tt(a,this.nestingLevel+1);const h=a.style.display;a.style.display="none",a.offsetHeight,a.style.display=h,this.updateNestingStyles()}}const i=this.getValues();this.initialValues=i,(n=this.onChange)==null||n.call(this,i)}addDeleteButtonToElement(t,e,i){let s=null;try{s=t.querySelector(":scope > .setting-group-title")}catch{s=null}if(!s){const r=Array.from(t.querySelectorAll(".setting-group-title"));for(const h of r)if(h.closest(".setting-group")===t){s=h;break}s||(s=r[0]??null)}if(!s)return;const n=s.querySelector(".actions-section");if(!n)return;const o=document.createElement("button");o.type="button",o.className="sg-delete-button",i?i.deleteItemCfg:this.deleteItemCfg??this.addItemCfg,o.title="Delete",o.style.cssText=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ct=(c=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(c|=0));for(;c--;)t+=yt[e[c]&63];return t};function Et(c){let t=0,e=c.parentElement;for(;e;)e.classList.contains("setting-group")&&e!==c&&t++,e=e.parentElement;return t}function _(c,t){const e=Math.min(Math.max(t,0),5);c.setAttribute("data-nesting-level",e.toString()),e>0?c.style.setProperty("--visual-indent",`${e*2}px`):(c.style.removeProperty("--visual-indent"),c.style.marginLeft="")}function tt(c,t=0){c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach(i=>{const s=i,n=t+1;_(s,n),tt(s,n)})}const bt={maxLevel:5,spacingMultiplier:1,visualIndentMultiplier:2,enableAutoDetection:!0};class wt{constructor(t={}){this.observedElements=new Set,this.config={...bt,...t},this.config.enableAutoDetection&&this.setupAutoDetection()}setupAutoDetection(){this.observer=new MutationObserver(t=>{let e=!1;t.forEach(i=>{i.type==="childList"&&i.addedNodes.forEach(s=>{s instanceof HTMLElement&&(s.classList.contains("setting-group")?[s]:Array.from(s.querySelectorAll(".setting-group"))).length>0&&(e=!0)})}),e&&this.updateAllNesting()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}trackElement(t){this.observedElements.add(t),this.updateElementNesting(t)}untrackElement(t){this.observedElements.delete(t)}updateElementNesting(t){const e=Et(t);this.applyNestingWithConfig(t,e)}updateAllNesting(){this.observedElements.forEach(t=>{t.isConnected?this.updateElementNesting(t):this.observedElements.delete(t)})}applyNestingWithConfig(t,e){const i=Math.min(Math.max(e,0),this.config.maxLevel);if(t.setAttribute("data-nesting-level",i.toString()),i>0){const s=i*this.config.visualIndentMultiplier;t.style.setProperty("--visual-indent",`${s}px`)}else t.style.removeProperty("--visual-indent"),t.style.marginLeft=""}recalculateNesting(t=document.body){t.querySelectorAll(".setting-group").forEach(i=>{const s=i;this.updateElementNesting(s),this.trackElement(s)})}getNestingStats(){const t={};return this.observedElements.forEach(e=>{const i=parseInt(e.getAttribute("data-nesting-level")||"0",10);t[i]=(t[i]||0)+1}),t}destroy(){this.observer&&(this.observer.disconnect(),this.observer=void 0),this.observedElements.clear()}}const ot=new wt;function X(c){if(c===null||typeof c!="object")return c;if(c instanceof Date)return new Date(c.getTime());if(c instanceof Array)return c.map(t=>X(t));if(typeof c=="object"){const t={};for(const e in c)Object.prototype.hasOwnProperty.call(c,e)&&(t[e]=X(c[e]));return t}return c}function xt(c){switch(c){case"number":return 0;case"text":return"";case"select":return null;case"color":return"#000000";case"date":return new Date().toISOString().split("T")[0];case"button":return"";default:return""}}class b{constructor(t={}){this.props=t,this.dataPropsPath="",this.id=t.id||ct(),this.value=this.props.default,this.desktop=this.props.default,this.title=t.title||"",this.includeGetJson=t.includeGetJson!==void 0?t.includeGetJson:!0}static SetUploadUrl(t){globalThis.DefaultUploadUrl=t,b.DefaultUploadUrl=t}static SetDefaultLanguage(t){globalThis.DefaultLanguage=t,b.DefaultLanguage=t}destroy(){throw new Error("Method not implemented.")}setOnChange(t){return this.onChange=t,this}setOnBlur(t){return this.onBlur=t,this}setDataPropsPath(t){this.dataPropsPath=t}getDataPropsPath(){return this.dataPropsPath}setValue(t){this.value=t,this.inputEl&&(this.inputEl.value=String(t)),this.onChange&&this.onChange(t),this.props.detectChange&&this.props.detectChange(t)}clone(){const t=this.constructor,e=X(this.props),i=new t(e);return i.value=X(this.value),i}createInput(t){t={...this.props.inputProps,...t};const e=document.createElement("div");if(e.className=t.wrapperClassName||"",t.title||t.icon){const a=document.createElement("div");if(a.className="icon-container",t.icon){const l=this.createIcon(t.icon,t.iconClassName);a.appendChild(l)}if(t.title){const l=this.createLabel(t.title,t.labelClassName);a.appendChild(l)}e.appendChild(a)}const i=document.createElement("div");i.className=t.wrapperClassName||"";const s=document.createElement("input");this.inputEl=s,s.value=String(t.value||xt(t.inputType)),s.type=t.inputType,s.placeholder=t.placeholder||"",s.className=t.inputClassName||"",this.dataPropsPath&&s.setAttribute("data-test-id",this.dataPropsPath);const n=a=>{const l=a.target;let r=l.value;switch(t.inputType){case"number":r=Number(l.value);break;case"color":r=l.value;break;case"date":r=l.value;break;case"select":r=l.value;break;case"text":r=l.value;break;case"button":r=l.value;break;default:r=l.value}this.value=r,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)},o=a=>{a.target,this.onBlur&&this.onBlur(this.value)};return s.addEventListener("input",n),s.addEventListener("change",n),s.addEventListener("blur",o),t.inputCustomizer&&t.inputCustomizer(s),i.appendChild(s),e.appendChild(i),e}createLabel(t,e){const i=document.createElement("span");return i.textContent=t,i.className="input-label "+(e||""),i}createIcon(t,e){const i=document.createElement("span");return i.className="input-icon "+(e||""),i.innerHTML=t,i}}function H(c){return c instanceof b}function w(c){return c instanceof I}function et(c){return H(c)||w(c)}function U(c,t){for(const e in c)if(Object.prototype.hasOwnProperty.call(c,e)){const i=c[e];t(e,i)}}const Y=class Y{constructor(t){this.elementRef=null,this.isHidden=!1,this.custom=!1,this.initialValues={},this.changeTimeout=null,this.isHandlingChange=!1,this.changeHandlers=new Set,this.blurTimeout=null,this.lastChangeTime=0,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.originalDefaultValues={},this.nestingLevel=0,this.dataPropsPath="",this.hide=!1,this.id=t.id||ct(),this.title=t.title,this.settings=t.settings,this.isCollapsed=t.collapsed??!1,this.isMain=t.main??!1,this.custom=t.custom??!1,this.nestingLevel=0,this.includeGetJson=t.includeGetJson??!0,this.addItemCfg=t.addItem,this.deleteItemCfg=t.deleteItem,this.dataProps=t.dataProps,this.dataPropsPath=t.dataProps||"",this.hide=t.hide??!1,Object.assign(this,t.settings),this.initialValues=this.getValues(),this.originalDefaultValues=this.getDefaultValues(),this.propagateNestingLevel(),this.propagateDataPropsPath()}propagateNestingLevel(){const t=this.nestingLevel+1;U(this.settings,(e,i)=>{w(i)&&(i.nestingLevel=t,i.propagateNestingLevel())})}getNestingLevel(){return this.nestingLevel}setNestingLevel(t){this.nestingLevel=t,this.propagateNestingLevel(),this.elementRef&&this.updateNestingStyles()}getDataPropsPath(){return this.dataPropsPath}setDataPropsPath(t){this.dataPropsPath=t,this.propagateDataPropsPath()}propagateDataPropsPath(){U(this.settings,(t,e)=>{const i=String(t),s=this.dataPropsPath?`${this.dataPropsPath}_${i}`:i;(w(e)||H(e)&&typeof e.setDataPropsPath=="function")&&e.setDataPropsPath(s)})}updateNestingStyles(){this.elementRef&&(_(this.elementRef,this.nestingLevel),tt(this.elementRef,this.nestingLevel))}forceChildUIRefresh(){Object.entries(this.settings).forEach(([t,e])=>{try{if(w(e)){const i=e.getValues();e.setValue(i)}else if(typeof e.setValue=="function"){const i=e.value;i!==void 0&&e.setValue(i)}}catch(i){console.warn(`Error refreshing UI for setting ${t}:`,i)}})}removeSetting(t){var s;const e=this.settings[t];if(!e)return;if(delete this.settings[t],this.elementRef){const n=this.elementRef.querySelector(".setting-group-content");if(n){const o=Array.from(n.querySelectorAll(".setting-group, .setting, [data-setting-id]"));for(const a of o){const l=a.id,r=a.getAttribute("data-setting-id");if(l&&"id"in e&&typeof e.id=="string"&&l.includes(e.id)){a.remove();break}if(r&&"id"in e&&typeof e.id=="string"&&r===e.id){a.remove();break}}}}typeof e.cleanup=="function"&&e.cleanup(),this.updateNestingStyles();const i=this.getValues();this.initialValues=i,(s=this.onChange)==null||s.call(this,i)}updateVisibility(){this.elementRef}updateSettings(t){var n;const e=new Set(Object.keys(this.settings)),i=Object.keys(t);e.forEach(o=>{i.includes(o)||this.removeSetting(o)}),i.forEach(o=>{const a=t[o],l=this.settings[o];l!==a&&(l&&this.removeSetting(o),this.addSetting(o,a))}),this.settings=t,this.propagateNestingLevel(),this.propagateDataPropsPath();const s=this.getValues();this.initialValues=s,(n=this.onChange)==null||n.call(this,s)}clone(){const t={};U(this.settings,(s,n)=>{const o=String(s);typeof n.clone=="function"?t[o]=n.clone():(console.warn(`Setting with key '${o}' does not have a clone method. Copying reference.`),t[o]=n)});const e={title:this.title,settings:t,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,includeGetJson:this.includeGetJson,addItem:this.addItemCfg,deleteItem:this.deleteItemCfg,dataProps:this.dataProps,hide:this.hide},i=ht(e);return i.initialValues=this.getValues(),i}resetDefault(){const t=this.originalDefaultValues;this.setValue(t),this.onChange&&this.onChange(this.getValues())}setMobileValues(t){!t||typeof t!="object"||(Object.entries(t).forEach(([e,i])=>{const s=this.settings[e];s&&(w(s)||H(s))&&typeof s.setMobileValue=="function"&&s.setMobileValue(i)}),this.setValue(t),this.onChange&&this.onChange(this.getValues()))}getMobileValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(w(s))e[i]=s.getMobileValues();else{const n=s;e[i]=n.mobileValue!==void 0?n.mobileValue:n.value}}return e}else{const e=this.settings[t];if(!e)return;if(w(e))return e.getMobileValues();const i=e;return i.mobileValue!==void 0?i.mobileValue:i.value}}setOnChange(t){this.onChange=t;const e=()=>{this.isHandlingChange||(this.isHandlingChange=!0,this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=setTimeout(()=>{const i=this.getValues(),s=this.calculateChanges(this.initialValues,i);Object.keys(s).length>0&&(this.lastChangeTime=Date.now(),this.initialValues=i,t(i),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),U(this.settings,(i,s)=>{var n;if(w(s))s.setOnChange(()=>{const o=this.getValues();this.initialValues=o,t(o)}),this.changeHandlers.add(()=>t(this.getValues()));else if(H(s)){const o=()=>e();this.changeHandlers.add(o),s.setOnChange(o)}else{const o=()=>e();this.changeHandlers.add(o),(n=s.setOnChange)==null||n.call(s,o)}}),this}cleanup(){this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null),this.blurTimeout&&(clearTimeout(this.blurTimeout),this.blurTimeout=null),this.elementRef&&this.elementRef.removeEventListener("focusout",this.handleBlur),this.changeHandlers.clear()}setValue(t){if(!t||typeof t!="object")return;Object.entries(t).forEach(([i,s])=>{let n=this.settings[i];if(!n&&this.addItemCfg&&i.startsWith(this.addItemCfg.keyPrefix)){const o=i.slice(this.addItemCfg.keyPrefix.length),a=Number(o);if(Number.isFinite(a)){const l=this.addItemCfg.createItem(a);et(l)&&(this.addSetting(i,l),n=l)}}n&&(w(n)||H(n))&&typeof n.setValue=="function"&&n.setValue(s)}),setTimeout(()=>{this.forceChildUIRefresh()},0);const e=this.getValues();this.initialValues=e,this.onChange&&this.onChange(e)}wireChild(t){var i;const e=()=>{var n;const s=this.getValues();this.initialValues=s,(n=this.onChange)==null||n.call(this,s),this.updateVisibility()};w(t)?t.setOnChange(()=>e()):H(t)?t.setOnChange(()=>e()):(i=t.setOnChange)==null||i.call(t,()=>e())}addSetting(t,e){var s,n;if(this.settings[t]=e,this.wireChild(e),this.elementRef){const o=this.elementRef.querySelector(".setting-group-content");if(o){w(e)&&typeof e.setNestingLevel=="function"&&e.setNestingLevel(this.nestingLevel+1);const a=e.draw(),l=this.deleteItemCfg??this.addItemCfg;if(l){const p=l.keyPrefix??((s=this.addItemCfg)==null?void 0:s.keyPrefix);p&&t.startsWith(p)&&this.addDeleteButtonToElement(a,t)}const r=o.querySelector(".sg-add-button-bottom");r?o.insertBefore(a,r):o.appendChild(a),ot.trackElement(a),_(a,this.nestingLevel+1),tt(a,this.nestingLevel+1);const h=a.style.display;a.style.display="none",a.offsetHeight,a.style.display=h,this.updateNestingStyles()}}const i=this.getValues();this.initialValues=i,(n=this.onChange)==null||n.call(this,i)}addDeleteButtonToElement(t,e,i){let s=null;try{s=t.querySelector(":scope > .setting-group-title")}catch{s=null}if(!s){const r=Array.from(t.querySelectorAll(".setting-group-title"));for(const h of r)if(h.closest(".setting-group")===t){s=h;break}s||(s=r[0]??null)}if(!s)return;const n=s.querySelector(".actions-section");if(!n)return;const o=document.createElement("button");o.type="button",o.className="sg-delete-button",i?i.deleteItemCfg:this.deleteItemCfg??this.addItemCfg,o.title="Delete",o.style.cssText=`
|
|
2
2
|
background: none;
|
|
3
3
|
border: none;
|
|
4
4
|
cursor: pointer;
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
<path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z"
|
|
114
114
|
stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
115
115
|
</svg>
|
|
116
|
-
`}].forEach(n=>{const o=document.createElement("button");o.className="align-option-button",o.innerHTML=n.icon,this.getDataPropsPath()&&o.setAttribute("data-test-id",`${this.getDataPropsPath()}_${n.name}`),this.value===n.name&&o.classList.add("selected"),o.addEventListener("click",()=>{var a;i.querySelectorAll(".align-option-button").forEach(l=>l.classList.remove("selected")),o.classList.add("selected"),this.value=n.name,(a=this.onChange)==null||a.call(this,this.value)}),i.appendChild(o)}),t.appendChild(i),t}}class Tt extends b{constructor(t){super(t),this.inputType="button",this.bgWithAlpha="rgba(145, 158, 171, 0.08)"}draw(){const t=document.createElement("button");t.className="button-setting "+(this.props.className||""),t.textContent=this.props.label,t.style.borderColor=this.props.borderColor||"rgba(145, 158, 171, 0.32)",this.getDataPropsPath()&&t.setAttribute("data-test-id",this.getDataPropsPath());const e=this.props.backgroundColor||"rgba(0,0,0,0)",i=this.props.textColor||"black";t.style.backgroundColor=e,t.style.color=i;let s=e;const n=e.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i);if(n){let a=+n[1],l=+n[2],r=+n[3],h=+n[4];h>=1?(a=Math.round(a*.9),l=Math.round(l*.9),r=Math.round(r*.9)):h=Math.min(1,h+.12),s=`rgba(${a},${l},${r},${h})`}t.addEventListener("mouseenter",()=>{console.log("hoverBg",s),t.style.setProperty("background-color",s,"important")}),t.addEventListener("mouseleave",()=>{t.style.setProperty("background-color",e,"important")}),t.addEventListener("click",()=>{var a,l;return(l=(a=this.props).onClick)==null?void 0:l.call(a)});const o=document.createElement("div");return o.className="button-setting-wrapper "+(this.props.wrapperClassName||""),o.appendChild(t),o}}class
|
|
116
|
+
`}].forEach(n=>{const o=document.createElement("button");o.className="align-option-button",o.innerHTML=n.icon,this.getDataPropsPath()&&o.setAttribute("data-test-id",`${this.getDataPropsPath()}_${n.name}`),this.value===n.name&&o.classList.add("selected"),o.addEventListener("click",()=>{var a;i.querySelectorAll(".align-option-button").forEach(l=>l.classList.remove("selected")),o.classList.add("selected"),this.value=n.name,(a=this.onChange)==null||a.call(this,this.value)}),i.appendChild(o)}),t.appendChild(i),t}}class Tt extends b{constructor(t){super(t),this.inputType="button",this.bgWithAlpha="rgba(145, 158, 171, 0.08)"}draw(){const t=document.createElement("button");t.className="button-setting "+(this.props.className||""),t.textContent=this.props.label,t.style.borderColor=this.props.borderColor||"rgba(145, 158, 171, 0.32)",this.getDataPropsPath()&&t.setAttribute("data-test-id",this.getDataPropsPath());const e=this.props.backgroundColor||"rgba(0,0,0,0)",i=this.props.textColor||"black";t.style.backgroundColor=e,t.style.color=i;let s=e;const n=e.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i);if(n){let a=+n[1],l=+n[2],r=+n[3],h=+n[4];h>=1?(a=Math.round(a*.9),l=Math.round(l*.9),r=Math.round(r*.9)):h=Math.min(1,h+.12),s=`rgba(${a},${l},${r},${h})`}t.addEventListener("mouseenter",()=>{console.log("hoverBg",s),t.style.setProperty("background-color",s,"important")}),t.addEventListener("mouseleave",()=>{t.style.setProperty("background-color",e,"important")}),t.addEventListener("click",()=>{var a,l;return(l=(a=this.props).onClick)==null?void 0:l.call(a)});const o=document.createElement("div");return o.className="button-setting-wrapper "+(this.props.wrapperClassName||""),o.appendChild(t),o}}class Ot extends b{constructor(t={}){super(t),this.inputType={width:"number",height:"number"},this.aspectRatio=1,this.isUpdating=!1;const e=t.width||0,i=t.height||0;this.value||(this.value={width:e,height:i}),this.minWidth=t.minWidth??0,this.maxWidth=t.maxWidth,this.minHeight=t.minHeight??0,this.maxHeight=t.maxHeight,this.locked=t.locked??!1,this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.widthSetting=new S({title:"Width",default:this.value.width,suffix:"px",minValue:this.minWidth,maxValue:this.maxWidth,icon:Pt}),this.heightSetting=new S({title:"Height",default:this.value.height,suffix:"px",minValue:this.minHeight,maxValue:this.maxHeight,icon:Ht}),this.widthSetting.setOnChange(this.handleWidthChange.bind(this)),this.heightSetting.setOnChange(this.handleHeightChange.bind(this))}handleWidthChange(t){if(!this.isUpdating&&!(isNaN(t)||t<0)){t=Math.max(this.minWidth,t),this.maxWidth&&t>this.maxWidth&&(t=this.maxWidth),this.isUpdating=!0;try{let e=t,i=this.value.height;this.locked&&this.aspectRatio>0&&(i=Math.round(e/this.aspectRatio),this.maxHeight&&i>this.maxHeight&&(i=this.maxHeight,e=Math.round(i*this.aspectRatio),this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,i>0&&(this.aspectRatio=e/i)))),this.value={width:e,height:i},this.widthSetting.setValue(e),this.locked&&this.heightSetting.setValue(i),this.onChange&&this.onChange(this.value)}finally{this.isUpdating=!1}}}handleHeightChange(t){if(!this.isUpdating&&!(isNaN(t)||t<0)){t=Math.max(this.minHeight,t),this.maxHeight&&t>this.maxHeight&&(t=this.maxHeight),this.isUpdating=!0;try{let e=t,i=this.value.width;this.locked&&this.aspectRatio>0&&(i=Math.round(e*this.aspectRatio),this.maxWidth&&i>this.maxWidth&&(i=this.maxWidth,e=Math.round(i/this.aspectRatio),this.maxHeight&&e>this.maxHeight&&(e=this.maxHeight,e>0&&(this.aspectRatio=i/e)))),this.value={width:i,height:e},this.locked&&this.widthSetting.setValue(i),this.heightSetting.setValue(e),this.onChange&&this.onChange(this.value)}finally{this.isUpdating=!1}}}toggleLock(t){if(this.locked=!this.locked,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}t.innerHTML=this.getLockSVG(this.locked),t.setAttribute("aria-pressed",String(this.locked)),t.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const e=t.closest(".dimension-setting-container");e&&(this.locked?e.classList.add("aspect-locked"):e.classList.remove("aspect-locked")),t.style.transform="scale(0.9)",setTimeout(()=>{t.style.transform="scale(1)"},100)}getLockSVG(t){return t?`
|
|
117
117
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
|
|
118
118
|
<path d="M2.91663 4.58333V3.33333C2.91663 2.18274 3.84937 1.25 4.99996 1.25C6.00786 1.25 6.84859 1.96573 7.04162 2.91667M3.66663 8.75H6.33329C7.03336 8.75 7.38339 8.75 7.65078 8.61376C7.88598 8.49392 8.07721 8.30269 8.19705 8.06749C8.33329 7.8001 8.33329 7.45007 8.33329 6.75V6.58333C8.33329 5.88327 8.33329 5.53323 8.19705 5.26584C8.07721 5.03064 7.88598 4.83942 7.65078 4.71958C7.38339 4.58333 7.03336 4.58333 6.33329 4.58333H3.66663C2.96656 4.58333 2.61653 4.58333 2.34914 4.71958C2.11394 4.83942 1.92271 5.03064 1.80287 5.26584C1.66663 5.53323 1.66663 5.88327 1.66663 6.58333V6.75C1.66663 7.45007 1.66663 7.8001 1.80287 8.06749C1.92271 8.30269 2.11394 8.49392 2.34914 8.61376C2.61653 8.75 2.96656 8.75 3.66663 8.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
119
119
|
</svg>`:`
|
|
120
120
|
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
|
|
121
121
|
<path d="M2.91663 4.58333V3.33333C2.91663 2.18274 3.84937 1.25 4.99996 1.25M3.66663 8.75H6.33329C7.03336 8.75 7.38339 8.75 7.65078 8.61376C7.88598 8.49392 8.07721 8.30269 8.19705 8.06749C8.33329 7.8001 8.33329 7.45007 8.33329 6.75V6.58333C8.33329 5.88327 8.33329 5.53323 8.19705 5.26584C8.07721 5.03064 7.88598 4.83942 7.65078 4.71958C7.38339 4.58333 7.03336 4.58333 6.33329 4.58333H3.66663C2.96656 4.58333 2.61653 4.58333 2.34914 4.71958C2.11394 4.83942 1.92271 5.03064 1.80287 5.26584C1.66663 5.53323 1.66663 5.88327 1.66663 6.58333V6.75C1.66663 7.45007 1.66663 7.8001 1.80287 8.06749C1.92271 8.30269 2.11394 8.49392 2.34914 8.61376C2.61653 8.75 2.96656 8.75 3.66663 8.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
122
|
-
</svg>`}setValue(t){if(t&&typeof t.width=="number"&&typeof t.height=="number"){let e=Math.max(this.minWidth,t.width);this.maxWidth&&(e=Math.min(this.maxWidth,e));let i=Math.max(this.minHeight,t.height);this.maxHeight&&(i=Math.min(this.maxHeight,i)),this.value={width:e,height:i},this.locked&&this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.isUpdating=!0;try{this.widthSetting.setValue(this.value.width),this.heightSetting.setValue(this.value.height)}finally{this.isUpdating=!1}}}draw(){const t=document.createElement("div");t.className="dimension-setting-container",this.locked&&t.classList.add("aspect-locked");const e=this.widthSetting.draw(),i=this.heightSetting.draw(),s=document.createElement("div");s.className="dimension-bracket";const n=document.createElement("button");return n.className="dimension-lock-icon",n.setAttribute("type","button"),n.setAttribute("aria-pressed",String(this.locked)),n.setAttribute("aria-label",this.locked?"Unlock aspect ratio":"Lock aspect ratio"),n.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio",n.innerHTML=this.getLockSVG(this.locked),n.onclick=o=>{o.preventDefault(),this.toggleLock(n)},s.appendChild(n),t.appendChild(e),t.appendChild(s),t.appendChild(i),t}isLocked(){return this.locked}setLocked(t){if(this.locked!==t){if(this.locked=t,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}const e=document.querySelector(".dimension-setting-container .dimension-lock-icon");if(e instanceof HTMLElement){e.innerHTML=this.getLockSVG(this.locked),e.setAttribute("aria-pressed",String(this.locked)),e.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const i=e.closest(".dimension-setting-container");i&&(this.locked?i.classList.add("aspect-locked"):i.classList.remove("aspect-locked"))}}}}const
|
|
122
|
+
</svg>`}setValue(t){if(t&&typeof t.width=="number"&&typeof t.height=="number"){let e=Math.max(this.minWidth,t.width);this.maxWidth&&(e=Math.min(this.maxWidth,e));let i=Math.max(this.minHeight,t.height);this.maxHeight&&(i=Math.min(this.maxHeight,i)),this.value={width:e,height:i},this.locked&&this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.isUpdating=!0;try{this.widthSetting.setValue(this.value.width),this.heightSetting.setValue(this.value.height)}finally{this.isUpdating=!1}}}draw(){const t=document.createElement("div");t.className="dimension-setting-container",this.locked&&t.classList.add("aspect-locked");const e=this.widthSetting.draw(),i=this.heightSetting.draw(),s=document.createElement("div");s.className="dimension-bracket";const n=document.createElement("button");return n.className="dimension-lock-icon",n.setAttribute("type","button"),n.setAttribute("aria-pressed",String(this.locked)),n.setAttribute("aria-label",this.locked?"Unlock aspect ratio":"Lock aspect ratio"),n.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio",n.innerHTML=this.getLockSVG(this.locked),n.onclick=o=>{o.preventDefault(),this.toggleLock(n)},s.appendChild(n),t.appendChild(e),t.appendChild(s),t.appendChild(i),t}isLocked(){return this.locked}setLocked(t){if(this.locked!==t){if(this.locked=t,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}const e=document.querySelector(".dimension-setting-container .dimension-lock-icon");if(e instanceof HTMLElement){e.innerHTML=this.getLockSVG(this.locked),e.setAttribute("aria-pressed",String(this.locked)),e.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const i=e.closest(".dimension-setting-container");i&&(this.locked?i.classList.add("aspect-locked"):i.classList.remove("aspect-locked"))}}}}const Pt=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
123
123
|
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
124
124
|
</svg>`,Ht=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
125
125
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
<svg xmlns="http://www.w3.org/2000/svg" class="svg-select-api" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down">
|
|
173
173
|
<polyline points="6 9 12 15 18 9"></polyline>
|
|
174
174
|
</svg>
|
|
175
|
-
`;class zt extends b{constructor(t={}){if(super(t),this.inputType="select",this._options=[],this.isOpen=!1,this.selectedOptionIndex=null,this.optionsListEl=null,this.svgContainer=null,this.buttonEl=null,this.isLoading=!1,this.container=null,this.hasInitializedOptions=!1,this.selectedOptionIndex=null,t.default!==void 0&&(this.value=t.default),this.initializeOptions(t),!t.getOptionsAsync&&this.value!==void 0){const e=this._options.findIndex(i=>JSON.stringify(i.value)===JSON.stringify(this.value));e!==-1&&(this.selectedOptionIndex=e)}t.onChange&&this.setOnChange(t.onChange),t.detectChange&&(this.detectChangeCallback=t.detectChange)}initializeOptions(t){this.hasInitializedOptions&&!t.getOptionsAsync||(this._options=[],t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync?this.isLoading=!0:this.hasInitializedOptions=!0)}createOption(t,e){const i=document.createElement("li");i.classList.add("select-api-option"),i.textContent=t.name,i.dataset.index=String(e);const s=document.createElement("input");return s.type="radio",s.classList.add("select-api-radio"),s.name="select-api-radio-group",i.appendChild(s),this.selectedOptionIndex===e&&(s.checked=!0),i}draw(){const t=document.createElement("div");t.classList.add("select-api-container"),this.container=t;const e=document.createElement("div");if(e.classList.add("select-api-button"),this.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),this.props.title){e.classList.add("has-label");const n=document.createElement("div");n.className="select-label",n.textContent=this.props.title,e.appendChild(n);const o=document.createElement("span");if(o.className="select-value",this.isLoading)o.textContent=this.props.loadingText||"Loading options...";else{const a=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,l=a&&typeof a.name=="string"?a.name:"Select an option";o.textContent=l}e.appendChild(o)}else{const n=document.createElement("span");if(this.isLoading)n.textContent=this.props.loadingText||"Loading options...";else{const o=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,a=o&&typeof o.name=="string"?o.name:"Select an option";n.textContent=a}e.appendChild(n)}e.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.classList.toggle("open",this.isOpen))},t.appendChild(e),this.buttonEl=e;const i=document.createElement("ul");i.classList.add("select-api-options"),this._options.forEach((n,o)=>{const a=this.createOption(n,o);a.onclick=l=>this.selectApiOption(l,o,e),i.appendChild(a)}),t.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Ut,t.appendChild(s),s.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.classList.toggle("open",this.isOpen))},this.optionsListEl=i,this.svgContainer=s,this.props.getOptionsAsync&&!this.hasInitializedOptions?(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.hasInitializedOptions=!0,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})):this.props.getOptionsAsync&&this._options.length<=1&&(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})),t}getJson(t=!0){return JSON.stringify(t?{}:{value:this.value},null,2)}selectApiOption(t,e,i){var l,r
|
|
175
|
+
`;class zt extends b{constructor(t={}){if(super(t),this.inputType="select",this._options=[],this.isOpen=!1,this.selectedOptionIndex=null,this.optionsListEl=null,this.svgContainer=null,this.buttonEl=null,this.isLoading=!1,this.container=null,this.hasInitializedOptions=!1,this.selectedOptionIndex=null,t.default!==void 0&&(this.value=t.default),this.initializeOptions(t),!t.getOptionsAsync&&this.value!==void 0){const e=this._options.findIndex(i=>JSON.stringify(i.value)===JSON.stringify(this.value));e!==-1&&(this.selectedOptionIndex=e)}t.onChange&&this.setOnChange(t.onChange),t.detectChange&&(this.detectChangeCallback=t.detectChange)}initializeOptions(t){this.hasInitializedOptions&&!t.getOptionsAsync||(this._options=[],t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync?this.isLoading=!0:this.hasInitializedOptions=!0)}createOption(t,e){const i=document.createElement("li");i.classList.add("select-api-option"),i.textContent=t.name,i.dataset.index=String(e);const s=document.createElement("input");return s.type="radio",s.classList.add("select-api-radio"),s.name="select-api-radio-group",i.appendChild(s),this.selectedOptionIndex===e&&(s.checked=!0),i}draw(){const t=document.createElement("div");t.classList.add("select-api-container"),this.container=t;const e=document.createElement("div");if(e.classList.add("select-api-button"),this.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),this.props.title){e.classList.add("has-label");const n=document.createElement("div");n.className="select-label",n.textContent=this.props.title,e.appendChild(n);const o=document.createElement("span");if(o.className="select-value",this.isLoading)o.textContent=this.props.loadingText||"Loading options...";else{const a=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,l=a&&typeof a.name=="string"?a.name:"Select an option";o.textContent=l}e.appendChild(o)}else{const n=document.createElement("span");if(this.isLoading)n.textContent=this.props.loadingText||"Loading options...";else{const o=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,a=o&&typeof o.name=="string"?o.name:"Select an option";n.textContent=a}e.appendChild(n)}e.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.classList.toggle("open",this.isOpen))},t.appendChild(e),this.buttonEl=e;const i=document.createElement("ul");i.classList.add("select-api-options"),this._options.forEach((n,o)=>{const a=this.createOption(n,o);a.onclick=l=>this.selectApiOption(l,o,e),i.appendChild(a)}),t.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Ut,t.appendChild(s),s.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.classList.toggle("open",this.isOpen))},this.optionsListEl=i,this.svgContainer=s,this.props.getOptionsAsync&&!this.hasInitializedOptions?(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.hasInitializedOptions=!0,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})):this.props.getOptionsAsync&&this._options.length<=1&&(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{const o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.value)===JSON.stringify(this.value));this.selectedOptionIndex=l!==-1?l:null}else this.selectedOptionIndex=null;this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText(this.props.errorText||"Error: Could not load options",!0)})),t}getJson(t=!0){return JSON.stringify(t?{}:{value:this.value},null,2)}selectApiOption(t,e,i){var a,l,r;const s=t.target,n=s.querySelector(".select-api-radio")||((a=s.closest(".select-api-option"))==null?void 0:a.querySelector(".select-api-radio"));n&&(n.checked=!0);const o=this._options[e].value;this.setValue(o),this.isOpen=!1,(l=this.optionsListEl)==null||l.classList.remove("open"),(r=this.svgContainer)==null||r.classList.remove("open")}updateOptionsList(){!this.optionsListEl||!this.buttonEl||(this.optionsListEl.innerHTML="",this._options.forEach((t,e)=>{var s;const i=this.createOption(t,e);i.onclick=n=>{this.buttonEl&&this.selectApiOption(n,e,this.buttonEl)},(s=this.optionsListEl)==null||s.appendChild(i)}))}updateButtonText(t,e=!1){if(!this.buttonEl)return;const i=this.buttonEl.querySelector(".select-value")||this.buttonEl.firstChild;if(i)if(e)i.textContent=t||"Error",this.buttonEl.classList.add("error"),this.buttonEl.setAttribute("disabled","true"),this.optionsListEl&&this.optionsListEl.classList.remove("open"),this.svgContainer&&(this.svgContainer.style.display="none");else if(this.isLoading)i.textContent=this.props.loadingText||"Loading options...",this.buttonEl.classList.remove("error"),this.buttonEl.removeAttribute("disabled"),this.svgContainer&&(this.svgContainer.style.display="");else{const s=this.selectedOptionIndex!==null&&this._options&&this.selectedOptionIndex>=0&&this.selectedOptionIndex<this._options.length?this._options[this.selectedOptionIndex]:null,n=s&&typeof s.name=="string"?s.name:"Select an option";i.textContent=t||n,this.buttonEl.classList.remove("error"),this.buttonEl.removeAttribute("disabled"),this.svgContainer&&(this.svgContainer.style.display="")}}update(t=!1){var e;if(this.selectedOptionIndex=this.value!==void 0?this._options.findIndex(i=>JSON.stringify(i.value)===JSON.stringify(this.value)):null,this.updateOptionsList(),this.updateButtonText(),t&&this.value!==void 0){(e=this.onChange)==null||e.call(this,this.value);const i=this.props.detectChange||this.detectChangeCallback;i==null||i(this.value)}}setDetectChange(t){this.detectChangeCallback=t,this.props.detectChange=t}setValue(t){super.setValue(t),this.selectedOptionIndex=this._options.findIndex(e=>JSON.stringify(e.value)===JSON.stringify(t)),this.updateButtonText(),this.updateOptionsList(),this.detectChangeCallback&&this.detectChangeCallback!==this.props.detectChange&&this.detectChangeCallback(t)}}class Wt extends b{constructor(t){var e,i;super(t),this.inputType="text",this.value=t.default??((i=(e=t.options)==null?void 0:e[0])==null?void 0:i.value)??"",this.detectChangeCallback=t.detectChange}draw(){var o,a;const t=document.createElement("div");t.className="toggle-setting-container",this.props.icon&&t.classList.add("toggle-with-icon");const e=document.createElement("div");if(e.className="toggle-label",this.props.icon){const l=document.createElement("span");l.className="toggle-icon",l.innerHTML=this.props.icon,e.appendChild(l)}if(this.props.title){const l=document.createElement("span");l.textContent=this.props.title,e.appendChild(l)}t.appendChild(e);const i=document.createElement("label");i.className="toggle-switch";const s=document.createElement("input");s.type="checkbox",s.checked=((a=(o=this.props.options)==null?void 0:o.find(l=>l.value===this.value))==null?void 0:a.status)??!1,this.getDataPropsPath()&&s.setAttribute("data-test-id",this.getDataPropsPath()),s.addEventListener("change",()=>{var r,h;const l=((h=(r=this.props.options)==null?void 0:r.find(p=>p.status===s.checked))==null?void 0:h.value)??"";this.value=l,this.onChange&&this.onChange(this.value),this.detectChangeCallback&&this.detectChangeCallback(this.value)});const n=document.createElement("span");if(n.className="toggle-slider",this.props.activeColor||this.props.inactiveColor){const l=document.createElement("style"),r=this.props.activeColor||"#4CAF50",h=this.props.inactiveColor||"#ccc";l.textContent=`
|
|
176
176
|
.toggle-switch input:checked + .toggle-slider {
|
|
177
177
|
background-color: ${r};
|
|
178
178
|
}
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
</svg>`;class Jt extends S{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||_t,title:t.title||"Margin Bottom",default:t.default??20,wrapperClassName:"margin-bottom-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}const Xt=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
187
187
|
<path d="M15.75 7.25H2.25m9.9 9h-6.3c-1.26 0-1.89 0-2.371-.245a2.25 2.25 0 0 1-.984-.983c-.245-.482-.245-1.112-.245-2.372v-6.3c0-1.26 0-1.89.245-2.371a2.25 2.25 0 0 1 .984-.984c.48-.245 1.11-.245 2.371-.245h6.3c1.26 0 1.89 0 2.371.245.424.216.768.56.984.984.245.48.245 1.11.245 2.371v6.3c0 1.26 0 1.89-.245 2.371-.216.424-.56.768-.984.984-.48.245-1.11.245-2.371.245"
|
|
188
188
|
stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
189
|
-
</svg>`;class Zt extends S{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||Xt,title:t.title||"Margin Top",default:t.default??20,wrapperClassName:"margin-top-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}class Kt extends b{constructor(t){super(t),this.inputType={},this.container=null,this.defaultLanguage="",this.uploadSettings=new Map,t.default?this.value={...t.default}:this.value||(this.value={}),this.defaultLanguage=t.languages.includes(b.DefaultLanguage)?b.DefaultLanguage:t.languages[0];const e=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(i=>{var s,n;i in(this.value||{})||(this.value||(this.value={}),i===this.defaultLanguage&&e?this.value[i]=((s=t.default)==null?void 0:s[i])||e:this.value[i]=((n=t.default)==null?void 0:n[i])||"")})}capitalizeFirstLetter(t){return String(t).charAt(0).toUpperCase()+String(t).slice(1)}measureTextWidth(t,e){this.textMeasureCanvas||(this.textMeasureCanvas=document.createElement("canvas"));const i=this.textMeasureCanvas.getContext("2d");if(!i)return t.length*10;const s=`${e.fontStyle} ${e.fontWeight} ${e.fontSize} ${e.fontFamily}`.trim();return i.font=s,i.measureText(t).width}adaptPlaceholderToSingleLine(t,e){const i=window.getComputedStyle(t),s=parseFloat(i.paddingLeft)||0,n=parseFloat(i.paddingRight)||0,o=parseFloat(i.borderLeftWidth)||0,a=parseFloat(i.borderRightWidth)||0,l=Math.max(0,t.clientWidth-s-n-o-a);if(l<=0){t.placeholder=e;return}if(this.measureTextWidth(e,i)<=l){t.placeholder=e;return}const h="...";let p=0,d=e.length,u=0;for(;p<=d;){const f=Math.floor((p+d)/2),g=e.slice(0,f).trimEnd()+h;this.measureTextWidth(g,i)<=l?(u=f,p=f+1):d=f-1}const m=e.slice(0,u).trimEnd()+h;t.placeholder=m}autosizeTextarea(t,e=3){t.style.height="auto";const i=window.getComputedStyle(t),s=parseFloat(i.lineHeight)||20,n=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),a=s*e+n+o,l=Math.min(t.scrollHeight||44,a);t.style.height=`${l}px`,t.scrollHeight>a?t.style.overflowY="auto":t.style.overflowY="hidden"}createTextareaRow(t,e){const i=document.createElement("div");i.classList.add("simple-multi-language-row");const s=document.createElement("label");if(s.classList.add("simple-language-label"),s.textContent=t.toUpperCase(),s.setAttribute("for",`textarea-${t}`),i.appendChild(s),this.props.multiImg){const n=new st({defaultUrl:e||"",title:"",id:`${this.id}_upload_${t}`});n.setOnChange(a=>{this.updateLanguageValue(t,a),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(a)}),this.uploadSettings.set(t,n);const o=n.draw();o.classList.add("simple-language-upload"),i.appendChild(o)}else{const n=document.createElement("textarea");n.id=`textarea-${t}`,n.classList.add("simple-language-textarea"),n.value=e||"",n.rows=1,n.style.overflowY="hidden";let o=this.props.placeholder||"Enter text in {language}...";o.includes("{language}")&&(o=o.replace("{language}",t.toUpperCase())),n.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(n,o),this.getDataPropsPath()&&n.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),n.addEventListener("input",l=>{const r=l.target;this.updateLanguageValue(t,r.value),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(r.value),this.autosizeTextarea(r,3);const h=n.getAttribute("data-full-placeholder")||"";h&&this.adaptPlaceholderToSingleLine(n,h)}),i.appendChild(n),(l=>(typeof queueMicrotask=="function"?queueMicrotask:r=>setTimeout(r,0))(l))(()=>{this.autosizeTextarea(n,3);const l=n.getAttribute("data-full-placeholder")||"";l&&this.adaptPlaceholderToSingleLine(n,l)})}return i}updateLanguageValue(t,e){this.value||(this.value={});const i={...this.value,[t]:e};this.setValue(i)}updateOtherLanguagePlaceholders(t){this.container&&this.props.languages.forEach(e=>{var s,n;if(e===this.defaultLanguage)return;const i=(s=this.container)==null?void 0:s.querySelector(`#textarea-${e}`);if(i&&(!i.value||i.value.trim()==="")){const o=t||((n=this.props.placeholder)==null?void 0:n.replace("{language}",e.toUpperCase()))||`Enter text in ${e.toUpperCase()}...`;i.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(i,o)}})}draw(){const t=document.createElement("div");if(t.classList.add("simple-multi-language-wrapper"),this.props.title){const s=document.createElement("div");s.classList.add("simple-multi-language-title"),s.textContent=this.props.title,t.appendChild(s)}const e=document.createElement("div");e.classList.add("simple-multi-language-content"),this.props.languages.forEach(s=>{var a;const n=((a=this.value)==null?void 0:a[s])||"",o=this.createTextareaRow(s,n);e.appendChild(o)}),t.appendChild(e),this.container=t;const i=()=>{if(!this.container)return;this.container.querySelectorAll(".simple-language-textarea").forEach(n=>{const o=n.getAttribute("data-full-placeholder")||"";o&&this.adaptPlaceholderToSingleLine(n,o)})};return window.addEventListener("resize",i),t}setValue(t){super.setValue(t),this.container&&this.props.languages.forEach(e=>{var i;if(this.props.multiImg){const s=this.uploadSettings.get(e);s&&s.setValue((t==null?void 0:t[e])||"")}else{const s=(i=this.container)==null?void 0:i.querySelector(`#textarea-${e}`);if(s){s.value=(t==null?void 0:t[e])||"",this.autosizeTextarea(s,3);const n=s.getAttribute("data-full-placeholder")||"";n&&this.adaptPlaceholderToSingleLine(s,n)}}})}}class Yt extends b{constructor(t={}){super(t),this.inputType="select";const e=[{name:"None",value:"none"},{name:"Fade",value:"fade 1.5s ease-in-out infinite"},{name:"Slide",value:"slide 1.5s ease-in-out infinite"},{name:"Zoom",value:"zoom 1.5s ease-in-out infinite"},{name:"Bounce",value:"bounce 1.5s ease-in-out infinite"},{name:"Pulse",value:"pulse 1.5s ease-in-out infinite"}];this.selectSetting=new Z({title:this.title||"Animation",options:e,default:this.props.default||"none"}),this.selectSetting.onChange=i=>{var s;this.value=i,(s=this.onChange)==null||s.call(this,i)}}draw(){return this.selectSetting.draw()}destroy(){this.selectSetting.destroy(),super.destroy()}}const gt=(c,t,e)=>{let i=!1,s=0,n=0,o=0,a=0;const l=p=>{if(p.target.closest("button"))return;i=!0,s=p.clientX,n=p.clientY;const d=t.getBoundingClientRect();o=d.left,a=d.top,document.addEventListener("mousemove",r),document.addEventListener("mouseup",h),document.body.style.userSelect="none"},r=p=>{if(!i)return;const d=p.clientX-s,u=p.clientY-n,m=window.innerWidth,f=window.innerHeight,g=t.offsetWidth,C=t.offsetHeight;let y=o+d,L=a+u;y=Math.max(8,Math.min(m-g-8,y)),L=Math.max(8,Math.min(f-C-8,L)),t.style.left=`${y}px`,t.style.top=`${L}px`,e==null||e(y,L)},h=()=>{i=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",h),document.body.style.userSelect=""};c.addEventListener("mousedown",l)},D=c=>{if(!c)return null;let t=c.trim();return!t.startsWith("#")||(t=t.slice(1),t.length===3&&(t=t.split("").map(e=>e+e).join("")),!/^[0-9a-fA-F]{6}$/.test(t))?null:`#${t.toUpperCase()}`},F=(c,t,e)=>`#${[c,t,e].map(i=>Math.max(0,Math.min(255,i)).toString(16).padStart(2,"0")).join("")}`,M=c=>{const t=c.replace("#",""),e=t.length===3?t.split("").map(i=>i+i).join(""):t;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},A=c=>{const{r:t,g:e,b:i}=M(c),s=t/255,n=e/255,o=i/255,a=Math.max(s,n,o),l=Math.min(s,n,o),r=a-l;let h=0;r!==0&&(a===s?h=(n-o)/r%6:a===n?h=(o-s)/r+2:h=(s-n)/r+4),h<0&&(h+=6);const p=a===0?0:r/a,d=a;return{h:h*60,s:p,v:d}},z=(c,t,e)=>{const i=(c%360+360)%360,s=e*t,n=s*(1-Math.abs(i/60%2-1)),o=e-s;let a=0,l=0,r=0;return i<60?(a=s,l=n,r=0):i<120?(a=n,l=s,r=0):i<180?(a=0,l=s,r=n):i<240?(a=0,l=n,r=s):i<300?(a=n,l=0,r=s):(a=s,l=0,r=n),F(Math.round((a+o)*255),Math.round((l+o)*255),Math.round((r+o)*255))},Qt=(c,t,e)=>{const i=e*(1-t/2),s=i===0||i===1?0:(e-i)/Math.min(i,1-i);return{hue:c,sat:s,lightness:i}},K=(c,t,e)=>{const i=(1-Math.abs(2*e-1))*t,s=i*(1-Math.abs(c/60%2-1)),n=e-i/2;let o=0,a=0,l=0;return c<60?(o=i,a=s,l=0):c<120?(o=s,a=i,l=0):c<180?(o=0,a=i,l=s):c<240?(o=0,a=s,l=i):c<300?(o=s,a=0,l=i):(o=i,a=0,l=s),{r:Math.round((o+n)*255),g:Math.round((a+n)*255),b:Math.round((l+n)*255)}},mt=(c,t)=>{const e=Math.max(0,Math.min(100,t))/100;if(c.startsWith("#")){const{r:s,g:n,b:o}=M(c);return`rgba(${s}, ${n}, ${o}, ${e})`}if(c.startsWith("rgba("))return c.replace(/,\s*[\d.]+\)$/,`, ${e})`);if(c.startsWith("rgb("))return c.replace("rgb(","rgba(").replace(")",`, ${e})`);if(c.startsWith("hsl(")){const s=c.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const{r:n,g:o,b:a}=K(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}if(c.startsWith("hsla(")){const s=c.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);if(s){const{r:n,g:o,b:a}=K(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}const i=D(c);if(i){const{r:s,g:n,b:o}=M(i);return`rgba(${s}, ${n}, ${o}, ${e})`}return c},te=c=>["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy","maroon","olive","aqua","silver","teal","fuchsia","transparent"].includes(c.toLowerCase()),ft=c=>[/^#[0-9a-fA-F]{3,8}$/,/^rgba?\s*\([^)]+\)$/,/^hsla?\s*\([^)]+\)$/,/^[a-zA-Z]+$/].some(e=>e.test(c.trim())),ee=c=>{if(typeof document>"u")return ft(c)||!!D(c);const t=document.createElement("div");return t.style.color=c,t.style.color!==""},vt=c=>{const t=c.trim();if(/^#[0-9A-Fa-f]{8}$/.test(t)){const n=t.slice(1),o=parseInt(n.slice(0,2),16),a=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16),r=parseInt(n.slice(6,8),16);return{color:F(o,a,l),position:0,opacity:Math.round(r/255*100)}}const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);if(e){const n=parseInt(e[1]),o=parseInt(e[2]),a=parseInt(e[3]),l=e[4]?parseFloat(e[4]):1;return{color:F(n,o,a),position:0,opacity:Math.round(l*100)}}const i=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/);if(i){const{r:n,g:o,b:a}=K(parseFloat(i[1]),parseFloat(i[2])/100,parseFloat(i[3])/100),l=i[4]?parseFloat(i[4]):1;return{color:F(n,o,a),position:0,opacity:Math.round(l*100)}}return{color:D(t)||t,position:0,opacity:100}},at=c=>{const t=[];let e="",i=0;for(let s=0;s<c.length;s++){const n=c[s];if(n==="(")i++;else if(n===")")i--;else if(n===","&&i===0){t.push(e.trim()),e="";continue}e+=n}return e.trim()&&t.push(e.trim()),t},lt=(c,t)=>{const e=new RegExp(`${t}\\s*\\(`,"i"),i=c.match(e);if(!i)return null;const s=i.index+i[0].length;let n=1,o=s;for(let a=s;a<c.length&&n>0;a++)c[a]==="("?n++:c[a]===")"&&n--,o=a;return n===0?c.substring(s,o):null},ie=c=>{const t=c.split(" ")[0].toLowerCase();return["circle","ellipse","closest-side","closest-corner","farthest-side","farthest-corner","at","contain","cover"].includes(t)?!1:/^#[0-9a-f]{3,8}$/i.test(t)||/^rgb/i.test(c)||/^hsl/i.test(c)||te(t)},rt=c=>{const t=[];return c.forEach((e,i)=>{const s=e.trim();if(!s)return;let n="",o=0;const a=s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);a&&ft(a[1].trim())?(n=a[1].trim(),o=parseFloat(a[2])):(n=s,o=c.length===1?0:i/(c.length-1)*100);const l=vt(n);l.position=Math.max(0,Math.min(100,Math.round(o))),t.push(l)}),t},B=c=>{const t=c.stops&&c.stops.length?c.stops:[{color:"#000000",position:0,opacity:100}];return{type:c.type&&["linear","radial","solid"].includes(c.type)?c.type:"linear",angle:typeof c.angle=="number"?c.angle:90,stops:t.map((e,i)=>({color:e.color||"#000000",position:typeof e.position=="number"?e.position:t.length===1?0:Math.round(i/(t.length-1)*100),opacity:e.opacity===void 0||Number.isNaN(e.opacity)?100:e.opacity}))}},P=c=>{const t=c.replace(/;$/,"").trim();if(ee(t)){const s=vt(t);return B({type:"solid",angle:0,stops:[s]})}const e=lt(t,"linear-gradient");if(e){const s=at(e);let n=90,o=s;const a=s[0];if(a.includes("deg")){const r=a.match(/(-?\d+(?:\.\d+)?)deg/);r&&(n=parseFloat(r[1]),o=s.slice(1))}else a.includes("to ")&&(n={"to right":90,"to left":270,"to bottom":180,"to top":0,"to bottom right":135,"to bottom left":225,"to top right":45,"to top left":315}[a]??90,o=s.slice(1));const l=rt(o);return l.length?B({type:"linear",angle:n,stops:l}):null}const i=lt(t,"radial-gradient");if(i){const s=at(i),n=s[0]&&!ie(s[0])?s.slice(1):s,o=rt(n);return o.length?B({type:"radial",angle:0,stops:o}):null}return null},V=c=>{if(c.type==="solid"){const e=c.stops[0],i=e.opacity??100,s=e.color.replace("#",""),n=Math.round(i/100*255).toString(16).toUpperCase().padStart(2,"0");return`#${s}${n}`}const t=c.stops.map(e=>`${mt(e.color,e.opacity??100)} ${e.position}%`).join(", ");return c.type==="radial"?`radial-gradient(circle, ${t})`:`linear-gradient(${c.angle}deg, ${t})`},se=c=>Math.round(c/100*255).toString(16).toUpperCase().padStart(2,"0"),J=c=>{if(c.type==="solid"){const t=c.stops[0];if(t){const e=t.color.toUpperCase(),i=t.opacity??100;if(i===100)return e;{const s=se(i);return`${e}${s}`}}return"#000000"}return c.type==="linear"?`Linear ${c.angle}°`:"Radial Gradient"},W=class W{static defaults(){return{solid:[],gradient:[]}}static normalizeList(t){const e=new Set,i=[];return t.forEach(s=>{let n=D(s);n||P(s)&&(n=s),n&&(e.has(n)||(e.add(n),i.push(n)))}),i.slice(0,this.MAX_COLORS)}static ensureLoaded(){var t;if(!this.colors&&(this.colors=this.defaults(),!(typeof window>"u")))try{const e=(t=window.sessionStorage)==null?void 0:t.getItem(this.STORAGE_KEY);if(!e)return;const i=JSON.parse(e);if(Array.isArray(i))this.colors.solid=this.normalizeList(i);else if(i&&typeof i=="object"){const s=i;s.solid&&(this.colors.solid=this.normalizeList(s.solid)),s.gradient&&(this.colors.gradient=this.normalizeList(s.gradient))}}catch{this.colors=this.defaults()}}static persist(){var t;if(!(typeof window>"u"))try{(t=window.sessionStorage)==null||t.setItem(this.STORAGE_KEY,JSON.stringify(this.colors||this.defaults()))}catch{}}static list(t){return this.ensureLoaded(),this.colors||(this.colors=this.defaults()),this.colors[t]}static getColors(t){if(t==="all"){const e=this.list("solid"),i=this.list("gradient"),s=[...e,...i];return this.normalizeList(s)}return[...this.list(t)]}static addColor(t,e){if(!t)return;let i=D(t),s="solid";if(i)s="solid";else{const l=P(t);l&&(i=t,s=l.type==="solid"?"solid":"gradient")}if(!i)return;const n=e==="all"?s:e,o=this.list(n),a=o.indexOf(i);a!==-1&&o.splice(a,1),o.unshift(i),o.length>this.MAX_COLORS&&(o.length=this.MAX_COLORS),this.persist()}};W.STORAGE_KEY="settingsLib_recentColors",W.MAX_COLORS=12,W.colors=null;let R=W;const nt=(c,t)=>{const e=document.createElement("div");e.className="color-picker-recent-section";const i=document.createElement("div");i.className="color-picker-recent-title",i.textContent="Recently Used";const s=document.createElement("div");s.className="color-picker-recent-grid";const n=document.createElement("div");n.className="color-picker-recent-placeholder",n.textContent="No recent colors yet",e.appendChild(i),e.appendChild(s),e.appendChild(n);const o=()=>{s.innerHTML="";const a=R.getColors(t);if(a.length===0){s.style.display="none",n.style.display="block";return}s.style.display="grid",n.style.display="none",a.forEach(l=>{const r=document.createElement("button");r.type="button",r.className="color-picker-recent-swatch";const h=ne(l);r.title=h,r.setAttribute("aria-label",`Use color: ${h}`),r.style.background=l,r.style.borderColor=l;const p=document.createElement("div");p.className="color-picker-tooltip",p.textContent=h,p.style.display="none",document.body.appendChild(p),r.addEventListener("mouseenter",d=>{const u=r.getBoundingClientRect();p.style.display="block",p.style.left=`${u.left+u.width/2}px`,p.style.top=`${u.bottom+8}px`}),r.addEventListener("mouseleave",()=>{p.style.display="none",r.style.boxShadow=""}),r.addEventListener("mousedown",()=>{r.style.boxShadow="0px 0px 0px 2px var(--grey40)"}),r.addEventListener("mouseup",()=>{setTimeout(()=>{r.style.boxShadow=""},150)}),r.addEventListener("click",()=>c(l)),r.addEventListener("DOMNodeRemoved",()=>{p.parentNode&&p.parentNode.removeChild(p)}),s.appendChild(r)})};return o(),{container:e,refresh:o}},ne=c=>{const t=P(c);if(t)return J(t);const e=D(c);if(e){const i=M(e);return`${e} (RGB: ${i.r}, ${i.g}, ${i.b})`}return c},Ct=`<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
189
|
+
</svg>`;class Zt extends S{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||Xt,title:t.title||"Margin Top",default:t.default??20,wrapperClassName:"margin-top-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}class Kt extends b{constructor(t){super(t),this.inputType={},this.container=null,this.defaultLanguage="",this.uploadSettings=new Map,t.default?this.value={...t.default}:this.value||(this.value={}),this.defaultLanguage=t.languages.includes(b.DefaultLanguage)?b.DefaultLanguage:t.languages[0];const e=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(i=>{var s,n;i in(this.value||{})||(this.value||(this.value={}),i===this.defaultLanguage&&e?this.value[i]=((s=t.default)==null?void 0:s[i])||e:this.value[i]=((n=t.default)==null?void 0:n[i])||"")})}capitalizeFirstLetter(t){return String(t).charAt(0).toUpperCase()+String(t).slice(1)}measureTextWidth(t,e){this.textMeasureCanvas||(this.textMeasureCanvas=document.createElement("canvas"));const i=this.textMeasureCanvas.getContext("2d");if(!i)return t.length*10;const s=`${e.fontStyle} ${e.fontWeight} ${e.fontSize} ${e.fontFamily}`.trim();return i.font=s,i.measureText(t).width}adaptPlaceholderToSingleLine(t,e){const i=window.getComputedStyle(t),s=parseFloat(i.paddingLeft)||0,n=parseFloat(i.paddingRight)||0,o=parseFloat(i.borderLeftWidth)||0,a=parseFloat(i.borderRightWidth)||0,l=Math.max(0,t.clientWidth-s-n-o-a);if(l<=0){t.placeholder=e;return}if(this.measureTextWidth(e,i)<=l){t.placeholder=e;return}const h="...";let p=0,d=e.length,u=0;for(;p<=d;){const f=Math.floor((p+d)/2),g=e.slice(0,f).trimEnd()+h;this.measureTextWidth(g,i)<=l?(u=f,p=f+1):d=f-1}const m=e.slice(0,u).trimEnd()+h;t.placeholder=m}autosizeTextarea(t,e=3){t.style.height="auto";const i=window.getComputedStyle(t),s=parseFloat(i.lineHeight)||20,n=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),a=s*e+n+o,l=Math.min(t.scrollHeight||44,a);t.style.height=`${l}px`,t.scrollHeight>a?t.style.overflowY="auto":t.style.overflowY="hidden"}createTextareaRow(t,e){const i=document.createElement("div");i.classList.add("simple-multi-language-row");const s=document.createElement("label");if(s.classList.add("simple-language-label"),s.textContent=t.toUpperCase(),s.setAttribute("for",`textarea-${t}`),i.appendChild(s),this.props.multiImg){const n=new st({defaultUrl:e||"",title:"",id:`${this.id}_upload_${t}`});n.setOnChange(a=>{this.updateLanguageValue(t,a),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(a)}),this.uploadSettings.set(t,n);const o=n.draw();o.classList.add("simple-language-upload"),i.appendChild(o)}else{const n=document.createElement("textarea");n.id=`textarea-${t}`,n.classList.add("simple-language-textarea"),n.value=e||"",n.rows=1,n.style.overflowY="hidden";let o=this.props.placeholder||"Enter text in {language}...";o.includes("{language}")&&(o=o.replace("{language}",t.toUpperCase())),n.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(n,o),this.getDataPropsPath()&&n.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),n.addEventListener("input",l=>{const r=l.target;this.updateLanguageValue(t,r.value),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(r.value),this.autosizeTextarea(r,3);const h=n.getAttribute("data-full-placeholder")||"";h&&this.adaptPlaceholderToSingleLine(n,h)}),i.appendChild(n),(l=>(typeof queueMicrotask=="function"?queueMicrotask:r=>setTimeout(r,0))(l))(()=>{this.autosizeTextarea(n,3);const l=n.getAttribute("data-full-placeholder")||"";l&&this.adaptPlaceholderToSingleLine(n,l)})}return i}updateLanguageValue(t,e){this.value||(this.value={});const i={...this.value,[t]:e};this.setValue(i)}updateOtherLanguagePlaceholders(t){this.container&&this.props.languages.forEach(e=>{var s,n;if(e===this.defaultLanguage)return;const i=(s=this.container)==null?void 0:s.querySelector(`#textarea-${e}`);if(i&&(!i.value||i.value.trim()==="")){const o=t||((n=this.props.placeholder)==null?void 0:n.replace("{language}",e.toUpperCase()))||`Enter text in ${e.toUpperCase()}...`;i.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(i,o)}})}draw(){const t=document.createElement("div");if(t.classList.add("simple-multi-language-wrapper"),this.props.title){const s=document.createElement("div");s.classList.add("simple-multi-language-title"),s.textContent=this.props.title,t.appendChild(s)}const e=document.createElement("div");e.classList.add("simple-multi-language-content"),this.props.languages.forEach(s=>{var a;const n=((a=this.value)==null?void 0:a[s])||"",o=this.createTextareaRow(s,n);e.appendChild(o)}),t.appendChild(e),this.container=t;const i=()=>{if(!this.container)return;this.container.querySelectorAll(".simple-language-textarea").forEach(n=>{const o=n.getAttribute("data-full-placeholder")||"";o&&this.adaptPlaceholderToSingleLine(n,o)})};return window.addEventListener("resize",i),t}setValue(t){super.setValue(t),this.container&&this.props.languages.forEach(e=>{var i;if(this.props.multiImg){const s=this.uploadSettings.get(e);s&&s.setValue((t==null?void 0:t[e])||"")}else{const s=(i=this.container)==null?void 0:i.querySelector(`#textarea-${e}`);if(s){s.value=(t==null?void 0:t[e])||"",this.autosizeTextarea(s,3);const n=s.getAttribute("data-full-placeholder")||"";n&&this.adaptPlaceholderToSingleLine(s,n)}}})}}class Yt extends b{constructor(t={}){super(t),this.inputType="select";const e=[{name:"None",value:"none"},{name:"Fade",value:"fade 1.5s ease-in-out infinite"},{name:"Slide",value:"slide 1.5s ease-in-out infinite"},{name:"Zoom",value:"zoom 1.5s ease-in-out infinite"},{name:"Bounce",value:"bounce 1.5s ease-in-out infinite"},{name:"Pulse",value:"pulse 1.5s ease-in-out infinite"}];this.selectSetting=new Z({title:this.title||"Animation",options:e,default:this.props.default||"none"}),this.selectSetting.onChange=i=>{var s;this.value=i,(s=this.onChange)==null||s.call(this,i)}}draw(){return this.selectSetting.draw()}destroy(){this.selectSetting.destroy(),super.destroy()}}const gt=(c,t,e)=>{let i=!1,s=0,n=0,o=0,a=0;const l=p=>{if(p.target.closest("button"))return;i=!0,s=p.clientX,n=p.clientY;const d=t.getBoundingClientRect();o=d.left,a=d.top,document.addEventListener("mousemove",r),document.addEventListener("mouseup",h),document.body.style.userSelect="none"},r=p=>{if(!i)return;const d=p.clientX-s,u=p.clientY-n,m=window.innerWidth,f=window.innerHeight,g=t.offsetWidth,C=t.offsetHeight;let y=o+d,L=a+u;y=Math.max(8,Math.min(m-g-8,y)),L=Math.max(8,Math.min(f-C-8,L)),t.style.left=`${y}px`,t.style.top=`${L}px`,e==null||e(y,L)},h=()=>{i=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",h),document.body.style.userSelect=""};c.addEventListener("mousedown",l)},D=c=>{if(!c)return null;let t=c.trim();return!t.startsWith("#")||(t=t.slice(1),t.length===3&&(t=t.split("").map(e=>e+e).join("")),!/^[0-9a-fA-F]{6}$/.test(t))?null:`#${t.toUpperCase()}`},F=(c,t,e)=>`#${[c,t,e].map(i=>Math.max(0,Math.min(255,i)).toString(16).padStart(2,"0")).join("")}`,M=c=>{const t=c.replace("#",""),e=t.length===3?t.split("").map(i=>i+i).join(""):t;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},A=c=>{const{r:t,g:e,b:i}=M(c),s=t/255,n=e/255,o=i/255,a=Math.max(s,n,o),l=Math.min(s,n,o),r=a-l;let h=0;r!==0&&(a===s?h=(n-o)/r%6:a===n?h=(o-s)/r+2:h=(s-n)/r+4),h<0&&(h+=6);const p=a===0?0:r/a,d=a;return{h:h*60,s:p,v:d}},z=(c,t,e)=>{const i=(c%360+360)%360,s=e*t,n=s*(1-Math.abs(i/60%2-1)),o=e-s;let a=0,l=0,r=0;return i<60?(a=s,l=n,r=0):i<120?(a=n,l=s,r=0):i<180?(a=0,l=s,r=n):i<240?(a=0,l=n,r=s):i<300?(a=n,l=0,r=s):(a=s,l=0,r=n),F(Math.round((a+o)*255),Math.round((l+o)*255),Math.round((r+o)*255))},Qt=(c,t,e)=>{const i=e*(1-t/2),s=i===0||i===1?0:(e-i)/Math.min(i,1-i);return{hue:c,sat:s,lightness:i}},K=(c,t,e)=>{const i=(1-Math.abs(2*e-1))*t,s=i*(1-Math.abs(c/60%2-1)),n=e-i/2;let o=0,a=0,l=0;return c<60?(o=i,a=s,l=0):c<120?(o=s,a=i,l=0):c<180?(o=0,a=i,l=s):c<240?(o=0,a=s,l=i):c<300?(o=s,a=0,l=i):(o=i,a=0,l=s),{r:Math.round((o+n)*255),g:Math.round((a+n)*255),b:Math.round((l+n)*255)}},mt=(c,t)=>{const e=Math.max(0,Math.min(100,t))/100;if(c.startsWith("#")){const{r:s,g:n,b:o}=M(c);return`rgba(${s}, ${n}, ${o}, ${e})`}if(c.startsWith("rgba("))return c.replace(/,\s*[\d.]+\)$/,`, ${e})`);if(c.startsWith("rgb("))return c.replace("rgb(","rgba(").replace(")",`, ${e})`);if(c.startsWith("hsl(")){const s=c.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const{r:n,g:o,b:a}=K(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}if(c.startsWith("hsla(")){const s=c.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);if(s){const{r:n,g:o,b:a}=K(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}const i=D(c);if(i){const{r:s,g:n,b:o}=M(i);return`rgba(${s}, ${n}, ${o}, ${e})`}return c},te=c=>["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy","maroon","olive","aqua","silver","teal","fuchsia","transparent"].includes(c.toLowerCase()),ft=c=>[/^#[0-9a-fA-F]{3,8}$/,/^rgba?\s*\([^)]+\)$/,/^hsla?\s*\([^)]+\)$/,/^[a-zA-Z]+$/].some(e=>e.test(c.trim())),ee=c=>{if(typeof document>"u")return ft(c)||!!D(c);const t=document.createElement("div");return t.style.color=c,t.style.color!==""},vt=c=>{const t=c.trim();if(/^#[0-9A-Fa-f]{8}$/.test(t)){const n=t.slice(1),o=parseInt(n.slice(0,2),16),a=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16),r=parseInt(n.slice(6,8),16);return{color:F(o,a,l),position:0,opacity:Math.round(r/255*100)}}const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);if(e){const n=parseInt(e[1]),o=parseInt(e[2]),a=parseInt(e[3]),l=e[4]?parseFloat(e[4]):1;return{color:F(n,o,a),position:0,opacity:Math.round(l*100)}}const i=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/);if(i){const{r:n,g:o,b:a}=K(parseFloat(i[1]),parseFloat(i[2])/100,parseFloat(i[3])/100),l=i[4]?parseFloat(i[4]):1;return{color:F(n,o,a),position:0,opacity:Math.round(l*100)}}return{color:D(t)||t,position:0,opacity:100}},at=c=>{const t=[];let e="",i=0;for(let s=0;s<c.length;s++){const n=c[s];if(n==="(")i++;else if(n===")")i--;else if(n===","&&i===0){t.push(e.trim()),e="";continue}e+=n}return e.trim()&&t.push(e.trim()),t},lt=(c,t)=>{const e=new RegExp(`${t}\\s*\\(`,"i"),i=c.match(e);if(!i)return null;const s=i.index+i[0].length;let n=1,o=s;for(let a=s;a<c.length&&n>0;a++)c[a]==="("?n++:c[a]===")"&&n--,o=a;return n===0?c.substring(s,o):null},ie=c=>{const t=c.split(" ")[0].toLowerCase();return["circle","ellipse","closest-side","closest-corner","farthest-side","farthest-corner","at","contain","cover"].includes(t)?!1:/^#[0-9a-f]{3,8}$/i.test(t)||/^rgb/i.test(c)||/^hsl/i.test(c)||te(t)},rt=c=>{const t=[];return c.forEach((e,i)=>{const s=e.trim();if(!s)return;let n="",o=0;const a=s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);a&&ft(a[1].trim())?(n=a[1].trim(),o=parseFloat(a[2])):(n=s,o=c.length===1?0:i/(c.length-1)*100);const l=vt(n);l.position=Math.max(0,Math.min(100,Math.round(o))),t.push(l)}),t},B=c=>{const t=c.stops&&c.stops.length?c.stops:[{color:"#000000",position:0,opacity:100}];return{type:c.type&&["linear","radial","solid"].includes(c.type)?c.type:"linear",angle:typeof c.angle=="number"?c.angle:90,stops:t.map((e,i)=>({color:e.color||"#000000",position:typeof e.position=="number"?e.position:t.length===1?0:Math.round(i/(t.length-1)*100),opacity:e.opacity===void 0||Number.isNaN(e.opacity)?100:e.opacity}))}},O=c=>{const t=c.replace(/;$/,"").trim();if(ee(t)){const s=vt(t);return B({type:"solid",angle:0,stops:[s]})}const e=lt(t,"linear-gradient");if(e){const s=at(e);let n=90,o=s;const a=s[0];if(a.includes("deg")){const r=a.match(/(-?\d+(?:\.\d+)?)deg/);r&&(n=parseFloat(r[1]),o=s.slice(1))}else a.includes("to ")&&(n={"to right":90,"to left":270,"to bottom":180,"to top":0,"to bottom right":135,"to bottom left":225,"to top right":45,"to top left":315}[a]??90,o=s.slice(1));const l=rt(o);return l.length?B({type:"linear",angle:n,stops:l}):null}const i=lt(t,"radial-gradient");if(i){const s=at(i),n=s[0]&&!ie(s[0])?s.slice(1):s,o=rt(n);return o.length?B({type:"radial",angle:0,stops:o}):null}return null},V=c=>{if(c.type==="solid"){const e=c.stops[0],i=e.opacity??100,s=e.color.replace("#",""),n=Math.round(i/100*255).toString(16).toUpperCase().padStart(2,"0");return`#${s}${n}`}const t=c.stops.map(e=>`${mt(e.color,e.opacity??100)} ${e.position}%`).join(", ");return c.type==="radial"?`radial-gradient(circle, ${t})`:`linear-gradient(${c.angle}deg, ${t})`},se=c=>Math.round(c/100*255).toString(16).toUpperCase().padStart(2,"0"),J=c=>{if(c.type==="solid"){const t=c.stops[0];if(t){const e=t.color.toUpperCase(),i=t.opacity??100;if(i===100)return e;{const s=se(i);return`${e}${s}`}}return"#000000"}return c.type==="linear"?`Linear ${c.angle}°`:"Radial Gradient"},W=class W{static defaults(){return{solid:[],gradient:[]}}static normalizeList(t){const e=new Set,i=[];return t.forEach(s=>{let n=D(s);n||O(s)&&(n=s),n&&(e.has(n)||(e.add(n),i.push(n)))}),i.slice(0,this.MAX_COLORS)}static ensureLoaded(){var t;if(!this.colors&&(this.colors=this.defaults(),!(typeof window>"u")))try{const e=(t=window.sessionStorage)==null?void 0:t.getItem(this.STORAGE_KEY);if(!e)return;const i=JSON.parse(e);if(Array.isArray(i))this.colors.solid=this.normalizeList(i);else if(i&&typeof i=="object"){const s=i;s.solid&&(this.colors.solid=this.normalizeList(s.solid)),s.gradient&&(this.colors.gradient=this.normalizeList(s.gradient))}}catch{this.colors=this.defaults()}}static persist(){var t;if(!(typeof window>"u"))try{(t=window.sessionStorage)==null||t.setItem(this.STORAGE_KEY,JSON.stringify(this.colors||this.defaults()))}catch{}}static list(t){return this.ensureLoaded(),this.colors||(this.colors=this.defaults()),this.colors[t]}static getColors(t){if(t==="all"){const e=this.list("solid"),i=this.list("gradient"),s=[...e,...i];return this.normalizeList(s)}return[...this.list(t)]}static addColor(t,e){if(!t)return;let i=D(t),s="solid";if(i)s="solid";else{const l=O(t);l&&(i=t,s=l.type==="solid"?"solid":"gradient")}if(!i)return;const n=e==="all"?s:e,o=this.list(n),a=o.indexOf(i);a!==-1&&o.splice(a,1),o.unshift(i),o.length>this.MAX_COLORS&&(o.length=this.MAX_COLORS),this.persist()}};W.STORAGE_KEY="settingsLib_recentColors",W.MAX_COLORS=12,W.colors=null;let R=W;const nt=(c,t)=>{const e=document.createElement("div");e.className="color-picker-recent-section";const i=document.createElement("div");i.className="color-picker-recent-title",i.textContent="Recently Used";const s=document.createElement("div");s.className="color-picker-recent-grid";const n=document.createElement("div");n.className="color-picker-recent-placeholder",n.textContent="No recent colors yet",e.appendChild(i),e.appendChild(s),e.appendChild(n);const o=()=>{s.innerHTML="";const a=R.getColors(t);if(a.length===0){s.style.display="none",n.style.display="block";return}s.style.display="grid",n.style.display="none",a.forEach(l=>{const r=document.createElement("button");r.type="button",r.className="color-picker-recent-swatch";const h=ne(l);r.title=h,r.setAttribute("aria-label",`Use color: ${h}`),r.style.background=l,r.style.borderColor=l;const p=document.createElement("div");p.className="color-picker-tooltip",p.textContent=h,p.style.display="none",document.body.appendChild(p),r.addEventListener("mouseenter",d=>{const u=r.getBoundingClientRect();p.style.display="block",p.style.left=`${u.left+u.width/2}px`,p.style.top=`${u.bottom+8}px`}),r.addEventListener("mouseleave",()=>{p.style.display="none",r.style.boxShadow=""}),r.addEventListener("mousedown",()=>{r.style.boxShadow="0px 0px 0px 2px var(--grey40)"}),r.addEventListener("mouseup",()=>{setTimeout(()=>{r.style.boxShadow=""},150)}),r.addEventListener("click",()=>c(l)),r.addEventListener("DOMNodeRemoved",()=>{p.parentNode&&p.parentNode.removeChild(p)}),s.appendChild(r)})};return o(),{container:e,refresh:o}},ne=c=>{const t=O(c);if(t)return J(t);const e=D(c);if(e){const i=M(e);return`${e} (RGB: ${i.r}, ${i.g}, ${i.b})`}return c},Ct=`<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
190
190
|
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
191
191
|
d="M6.12347 4.96653L1.41158 0.254304C1.25449 0.102568 1.04409 0.0186071 0.825694 0.0205049C0.607302 0.0224037 0.398393 0.110007 0.24396 0.26445C0.0895282 0.418893 0.0019303 0.627818 3.24698e-05 0.846225C-0.00186536 1.06463 0.0820894 1.27505 0.233815 1.43215L4.9457 6.14438L0.233814 10.8566C0.0820886 11.0137 -0.00186625 11.2241 3.15434e-05 11.4425C0.00192934 11.6609 0.0895272 11.8699 0.243959 12.0243C0.398392 12.1787 0.607301 12.2663 0.825693 12.2682C1.04408 12.2701 1.25449 12.1862 1.41158 12.0344L6.12347 7.32222L10.8354 12.0344C10.9932 12.1824 11.2023 12.2632 11.4186 12.2597C11.6349 12.2562 11.8414 12.1687 11.9943 12.0156C12.1472 11.8626 12.2346 11.6561 12.2379 11.4398C12.2413 11.2234 12.1604 11.0143 12.0123 10.8566L7.30123 6.14438L12.0131 1.43215C12.0927 1.35531 12.1561 1.2634 12.1998 1.16177C12.2434 1.06014 12.2664 0.950833 12.2674 0.84023C12.2683 0.729626 12.2473 0.61994 12.2054 0.517568C12.1635 0.415196 12.1017 0.322191 12.0234 0.243979C11.9452 0.165768 11.8522 0.103916 11.7499 0.0620327C11.6475 0.0201492 11.5378 -0.000927989 11.4272 3.33052e-05C11.3166 0.000993646 11.2073 0.0239743 11.1057 0.0676297C11.0041 0.111286 10.9122 0.174745 10.8354 0.254305L6.12347 4.96653Z"
|
|
192
192
|
fill="#919EAB"/>
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
<path d="M14.1333 12.4667H0.8M0.8 12.4667L4.13333 9.13332M0.8 12.4667L4.13333 15.8M0.8 4.13332H14.1333M14.1333 4.13332L10.8 0.799988M14.1333 4.13332L10.8 7.46665" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
197
197
|
</svg>`,le=`<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
198
198
|
<path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
|
199
|
-
</svg>`;class re{constructor(t,e="gradient"){this.isOpen=!1,this.currentColor="#FF0000",this.currentOpacity=100,this.outsideClick=i=>{if(!this.isOpen)return;const s=i.target;if(this.element.contains(s))return;const n=document.querySelectorAll(".gstop-color-input");Array.from(n).some(a=>a.contains(s))||(i.preventDefault(),i.stopPropagation(),this.close(!0))},this.keyDown=i=>{if(this.isOpen){if(i.key==="Escape")i.preventDefault(),this.close(!0);else if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.close(!0)}}},this.onChange=t,this.recentScope=e,this.element=this.build(),this.backdrop=this.createBackdrop()}parsePercentage(t){const e=parseFloat(t);return isNaN(e)?0:e/100}build(){const t=document.createElement("div");t.className="custom-color-picker",t.style.display="none";const e=document.createElement("div");e.className="color-picker-header",e.style.cursor="move";const i=document.createElement("span");i.textContent="Color";const s=document.createElement("button");s.className="color-picker-close",s.innerHTML=Ct,s.addEventListener("click",()=>this.close(!0)),e.appendChild(i),e.appendChild(s),gt(e,t);const n=document.createElement("div");n.className="color-picker-area",this.colorArea=n;const o=document.createElement("div");o.className="color-picker-marker",this.colorMarker=o,n.appendChild(o);const a=document.createElement("div");a.className="color-picker-sliders-container";const l=document.createElement("button");l.className="color-picker-eyedropper",l.type="button",l.innerHTML=oe;const r=document.createElement("div");r.className="color-picker-sliders-group";const h=document.createElement("div");h.className="color-picker-hue",this.hueSlider=h;const p=document.createElement("div");p.className="color-picker-hue-marker",this.hueMarker=p,h.appendChild(p);const d=document.createElement("div");d.className="color-picker-opacity",this.opacitySlider=d;const u=document.createElement("div");u.className="color-picker-opacity-marker",this.opacityMarker=u,d.appendChild(u),r.appendChild(h),r.appendChild(d),a.appendChild(l),a.appendChild(r);const m=nt(E=>{var x;this.setColor(E),(x=this.onChange)==null||x.call(this,E,this.currentOpacity)},this.recentScope);this.recentSectionRefresh=m.refresh;const f=document.createElement("div");f.className="color-picker-format-section";const g=document.createElement("select");g.className="color-picker-format-select",this.select=g;const C=document.createElement("option");C.value="hex",C.textContent="HEX";const y=document.createElement("option");y.value="rgb",y.textContent="RGB";const L=document.createElement("option");L.value="hsl",L.textContent="HSL",g.appendChild(C),g.appendChild(y),g.appendChild(L);const N=document.createElement("input");N.type="text",N.className="color-picker-color-input",N.value=this.currentColor,this.input=N;const
|
|
199
|
+
</svg>`;class re{constructor(t,e="gradient"){this.isOpen=!1,this.currentColor="#FF0000",this.currentOpacity=100,this.outsideClick=i=>{if(!this.isOpen)return;const s=i.target;if(this.element.contains(s))return;const n=document.querySelectorAll(".gstop-color-input");Array.from(n).some(a=>a.contains(s))||(i.preventDefault(),i.stopPropagation(),this.close(!0))},this.keyDown=i=>{if(this.isOpen){if(i.key==="Escape")i.preventDefault(),this.close(!0);else if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.close(!0)}}},this.onChange=t,this.recentScope=e,this.element=this.build(),this.backdrop=this.createBackdrop()}parsePercentage(t){const e=parseFloat(t);return isNaN(e)?0:e/100}build(){const t=document.createElement("div");t.className="custom-color-picker",t.style.display="none";const e=document.createElement("div");e.className="color-picker-header",e.style.cursor="move";const i=document.createElement("span");i.textContent="Color";const s=document.createElement("button");s.className="color-picker-close",s.innerHTML=Ct,s.addEventListener("click",()=>this.close(!0)),e.appendChild(i),e.appendChild(s),gt(e,t);const n=document.createElement("div");n.className="color-picker-area",this.colorArea=n;const o=document.createElement("div");o.className="color-picker-marker",this.colorMarker=o,n.appendChild(o);const a=document.createElement("div");a.className="color-picker-sliders-container";const l=document.createElement("button");l.className="color-picker-eyedropper",l.type="button",l.innerHTML=oe;const r=document.createElement("div");r.className="color-picker-sliders-group";const h=document.createElement("div");h.className="color-picker-hue",this.hueSlider=h;const p=document.createElement("div");p.className="color-picker-hue-marker",this.hueMarker=p,h.appendChild(p);const d=document.createElement("div");d.className="color-picker-opacity",this.opacitySlider=d;const u=document.createElement("div");u.className="color-picker-opacity-marker",this.opacityMarker=u,d.appendChild(u),r.appendChild(h),r.appendChild(d),a.appendChild(l),a.appendChild(r);const m=nt(E=>{var x;this.setColor(E),(x=this.onChange)==null||x.call(this,E,this.currentOpacity)},this.recentScope);this.recentSectionRefresh=m.refresh;const f=document.createElement("div");f.className="color-picker-format-section";const g=document.createElement("select");g.className="color-picker-format-select",this.select=g;const C=document.createElement("option");C.value="hex",C.textContent="HEX";const y=document.createElement("option");y.value="rgb",y.textContent="RGB";const L=document.createElement("option");L.value="hsl",L.textContent="HSL",g.appendChild(C),g.appendChild(y),g.appendChild(L);const N=document.createElement("input");N.type="text",N.className="color-picker-color-input",N.value=this.currentColor,this.input=N;const P=document.createElement("div");P.className="color-picker-input-container";const v=document.createElement("button");return v.className="color-picker-copy-inside",v.textContent="Copy",P.appendChild(N),P.appendChild(v),f.appendChild(g),f.appendChild(P),t.appendChild(e),t.appendChild(n),t.appendChild(a),t.appendChild(m.container),t.appendChild(f),t.addEventListener("click",E=>E.stopPropagation()),this.bind(n,h,d,N,g,v,l),t}createBackdrop(){const t=document.createElement("div");return t.className="color-picker-backdrop",t.style.display="none",t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.close(!0)}),t}bind(t,e,i,s,n,o,a){const l=p=>{var y;const d=t.getBoundingClientRect(),u=Math.max(0,Math.min(1,(p.clientX-d.left)/d.width)),m=Math.max(0,Math.min(1,(p.clientY-d.top)/d.height));this.colorMarker.style.left=`${u*100}%`,this.colorMarker.style.top=`${m*100}%`;const g=this.parsePercentage(this.hueMarker.style.left||"0%")*360,C=z(g,u,1-m);this.currentColor=C,this.syncInput(),this.updateOpacityBg(),(y=this.onChange)==null||y.call(this,C,this.currentOpacity)},r=p=>{var y;const d=e.getBoundingClientRect();let u=Math.max(0,Math.min(1,(p.clientX-d.left)/d.width));this.hueMarker.style.left=`${u*100}%`;const m=u*360,f=this.parsePercentage(this.colorMarker.style.left||"0%"),g=this.parsePercentage(this.colorMarker.style.top||"0%"),C=z(m,f,1-g);this.currentColor=C,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${m}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(y=this.onChange)==null||y.call(this,C,this.currentOpacity)},h=p=>{var m;const d=i.getBoundingClientRect(),u=Math.max(0,Math.min(1,(p.clientX-d.left)/d.width));this.opacityMarker.style.left=`${u*100}%`,this.currentOpacity=Math.round(u*100),(m=this.onChange)==null||m.call(this,this.currentColor,this.currentOpacity)};t.addEventListener("mousedown",p=>{p.preventDefault(),l(p);const d=m=>l(m),u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),e.addEventListener("mousedown",p=>{p.preventDefault(),r(p);const d=m=>r(m),u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),i.addEventListener("mousedown",p=>{p.preventDefault(),h(p);const d=m=>h(m),u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),n.addEventListener("change",()=>this.syncInput()),s.addEventListener("input",()=>this.applyFromInput()),s.addEventListener("blur",()=>this.syncInput()),s.addEventListener("keydown",p=>{p.key==="Enter"&&(p.preventDefault(),this.syncInput(),s.blur())}),o.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(s.value)}catch{s.select(),document.execCommand("copy")}}),a.addEventListener("click",async()=>{var p;if(!("EyeDropper"in window)){alert("EyeDropper API is not supported in this browser.");return}try{const d=new window.EyeDropper,{sRGBHex:u}=await d.open();this.setColor(u),(p=this.onChange)==null||p.call(this,u,this.currentOpacity)}catch{}}),document.addEventListener("keydown",this.keyDown,!0),setTimeout(()=>document.addEventListener("click",this.outsideClick,!0),0)}setColor(t){var o;this.currentColor=t;const{h:e,s:i,v:s}=A(t),n=e>=360?e%360:e;this.hueMarker.style.left=`${n/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(o=this.onChange)==null||o.call(this,t,this.currentOpacity)}syncInput(){const t=this.select.value,{h:e,s:i,v:s}=A(this.currentColor);if(t==="hex")this.input.value=this.currentColor;else if(t==="rgb"){const{r:n,g:o,b:a}=M(this.currentColor);this.input.value=`rgb(${n}, ${o}, ${a})`}else{const{hue:n,sat:o,lightness:a}=Qt(e,i,s);this.input.value=`hsl(${Math.round(n)}, ${Math.round(o*100)}%, ${Math.round(a*100)}%)`}}applyFromInput(){const t=this.input.value.trim();let e="";if(/^#[0-9A-Fa-f]{6}$/.test(t))e=t;else{const i=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(i){const s=parseInt(i[1]),n=parseInt(i[2]),o=parseInt(i[3]);s<=255&&n<=255&&o<=255&&(e=`#${[s,n,o].map(a=>a.toString(16).padStart(2,"0")).join("")}`)}else{const s=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const n=parseInt(s[1]),o=parseInt(s[2])/100,a=parseInt(s[3])/100,l=a+o*Math.min(a,1-a),r=l===0?0:2*(1-a/l);e=z(n,r,l)}}}e&&this.setColor(e)}updateOpacityBg(){const{r:t,g:e,b:i}=M(this.currentColor);this.opacitySlider.style.setProperty("--base-color",`rgb(${t}, ${e}, ${i})`)}open(t,e,i){var L;this.currentColor=t,this.currentOpacity=i??100,this.syncInput();const{h:s,s:n,v:o}=A(t);this.hueMarker.style.left=`${s/360*100}%`,this.colorMarker.style.left=`${n*100}%`,this.colorMarker.style.top=`${(1-o)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`,this.updateOpacityBg(),this.opacityMarker.style.left=`${this.currentOpacity}%`,(L=this.recentSectionRefresh)==null||L.call(this),this.isOpen=!0,this.backdrop.style.display="block",this.backdrop.parentElement||document.body.appendChild(this.backdrop),this.element.style.display="block",this.element.style.position="fixed",this.element.style.zIndex="10002",this.element.style.left="-9999px",this.element.style.top="0px",this.element.parentElement||document.body.appendChild(this.element);const a=this.element.offsetWidth,l=this.element.offsetHeight,r=e.getBoundingClientRect(),h=window.innerWidth,p=window.innerHeight,d=16;let u=r.right+8,m=r.top;const f=h-r.right,g=r.left;f>=a+d?u=r.right+8:g>=a+d?u=r.left-a-8:u=Math.max(d,(h-a)/2);const C=p-r.bottom,y=r.top;C>=l+d?m=r.bottom+8:y>=l+d?m=r.top-l-8:C>y?(m=r.bottom+8,m+l>p-d&&(m=p-l-d)):(m=r.top-l-8,m<d&&(m=d)),this.element.style.left=`${u}px`,this.element.style.top=`${m}px`}close(t){var e;this.isOpen&&(this.isOpen=!1,this.backdrop.style.display="none",this.element.style.display="none",document.removeEventListener("click",this.outsideClick,!0),document.removeEventListener("keydown",this.keyDown,!0),t&&this.onChange&&this.recentScope==="solid"&&(R.addColor(this.currentColor,this.recentScope),(e=this.recentSectionRefresh)==null||e.call(this)))}getElement(){return this.element}}class ce{constructor(t){this.recentScope="all",this.currentColor=t.initialColor,this.currentOpacity=t.initialOpacity,this.onColorChange=t.onColorChange,t.scope&&(this.recentScope=t.scope),this.container=this.createContainer(),this.initializePicker()}createContainer(){const t=document.createElement("div");t.className="embedded-color-picker-content",t.innerHTML=`
|
|
200
200
|
<div class="color-picker-area embedded">
|
|
201
201
|
<div class="color-picker-marker"></div>
|
|
202
202
|
</div>
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
<button class="color-picker-copy-inside">Copy</button>
|
|
227
227
|
</div>
|
|
228
228
|
</div>
|
|
229
|
-
`;const e=nt(i=>{this.applyRecentColor(i)},this.recentScope);return this.recentSectionRefresh=e.refresh,t.appendChild(e.container),t}initializePicker(){this.colorArea=this.container.querySelector(".color-picker-area"),this.colorMarker=this.container.querySelector(".color-picker-marker"),this.hueSlider=this.container.querySelector(".color-picker-hue"),this.hueMarker=this.container.querySelector(".color-picker-hue-marker"),this.opacitySlider=this.container.querySelector(".color-picker-opacity"),this.opacityMarker=this.container.querySelector(".color-picker-opacity-marker"),this.formatSelect=this.container.querySelector(".color-picker-format-select"),this.colorInput=this.container.querySelector(".color-picker-color-input");const t=this.container.querySelector(".color-picker-copy-inside"),{h:e,s:i,v:s}=A(this.currentColor);this.hueMarker.style.left=`${e/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e}, 100%, 50%))`,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.updateOpacityBackground(this.opacitySlider),this.updateColorInput(this.formatSelect,this.colorInput),this.setupColorAreaEvents(),this.setupHueSliderEvents(),this.setupOpacitySliderEvents(),this.setupFormatEvents(t)}scheduleInputUpdate(){this.inputUpdateTimeout&&clearTimeout(this.inputUpdateTimeout),this.inputUpdateTimeout=window.setTimeout(()=>{this.updateColorInput(this.formatSelect,this.colorInput)},16)}updateOpacityBackground(t){const e=M(this.currentColor);t.style.setProperty("--base-color",`rgb(${e.r}, ${e.g}, ${e.b})`)}updateColorInput(t,e){switch(t.value){case"hex":e.value=this.currentColor;break;case"rgb":const s=M(this.currentColor);e.value=`rgb(${s.r}, ${s.g}, ${s.b})`;break;case"hsl":const{h:n,s:o,v:a}=A(this.currentColor),l=a*(1-o/2),r=l===0||l===1?0:(a-l)/Math.min(l,1-l);e.value=`hsl(${Math.round(n)}, ${Math.round(r*100)}%, ${Math.round(l*100)}%)`;break}}applyRecentColor(t){this.currentColor=t,t.includes("gradient")||t.includes("radial")||(this.updatePickerVisualState(),this.updateColorInput(this.formatSelect,this.colorInput)),this.triggerChange()}commitRecentColor(){var t;R.addColor(this.currentColor,this.recentScope),(t=this.recentSectionRefresh)==null||t.call(this)}setupColorAreaEvents(){const t=e=>{const i=this.colorArea.getBoundingClientRect(),s=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width)),n=Math.max(0,Math.min(1,(e.clientY-i.top)/i.height));this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${n*100}%`;const o=parseFloat(this.hueMarker.style.left||"0%"),a=Math.max(0,Math.min(360,o/100*360)),l=Math.max(0,Math.min(1,s)),r=Math.max(0,Math.min(1,1-n)),h=z(a,l,r);this.currentColor=h,this.updateOpacityBackground(this.opacitySlider),this.triggerChange()};this.colorArea.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),this.updateColorInput(this.formatSelect,this.colorInput),this.updateOpacityBackground(this.opacitySlider)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupHueSliderEvents(){const t=e=>{const i=this.hueSlider.getBoundingClientRect();let s=(e.clientX-i.left)/i.width;s=Math.max(0,Math.min(1,s)),this.hueMarker.style.left=`${s*100}%`;const n=Math.max(0,Math.min(360,s*360)),o=parseFloat(this.colorMarker.style.left||"50%"),a=parseFloat(this.colorMarker.style.top||"50%"),l=Math.max(0,Math.min(1,(isNaN(o)?50:o)/100)),r=Math.max(0,Math.min(1,(isNaN(a)?50:a)/100));this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`;const h=z(n,l,1-r);this.currentColor=h,this.updateOpacityBackground(this.opacitySlider),this.triggerChange()};this.hueSlider.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),this.inputUpdateTimeout&&clearTimeout(this.inputUpdateTimeout),this.updateColorInput(this.formatSelect,this.colorInput)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupOpacitySliderEvents(){const t=e=>{const i=this.opacitySlider.getBoundingClientRect(),s=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));this.opacityMarker.style.left=`${s*100}%`,this.currentOpacity=Math.round(s*100),this.triggerChange()};this.opacitySlider.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupFormatEvents(t){this.formatSelect.addEventListener("change",()=>{this.updateColorInput(this.formatSelect,this.colorInput)}),t.addEventListener("click",()=>{navigator.clipboard.writeText(this.colorInput.value).catch(()=>{this.colorInput.select(),document.execCommand("copy")})}),this.colorInput.addEventListener("input",()=>{this.handleManualColorInput(this.colorInput.value,this.formatSelect)}),this.colorInput.addEventListener("blur",()=>{this.updateColorInput(this.formatSelect,this.colorInput)})}handleManualColorInput(t,e){const i=t.trim();let s=null;switch(e.value){case"hex":s=this.parseHexInput(i);break;case"rgb":s=this.parseRgbInput(i);break;case"hsl":s=this.parseHslInput(i);break}s||(s=this.autoDetectColorFormat(i)),s&&(this.currentColor=s,this.updatePickerVisualState(),this.triggerChange())}parseHexInput(t){const e=t.startsWith("#")?t:`#${t}`;return D(e)}parseRgbInput(t){const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*[\d.]+)?\s*\)/);if(e){const i=parseInt(e[1]),s=parseInt(e[2]),n=parseInt(e[3]);if(i<=255&&s<=255&&n<=255)return F(i,s,n)}return null}parseHslInput(t){const e=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\s*\)/);if(e){const i=parseFloat(e[1]),s=parseFloat(e[2])/100,n=parseFloat(e[3])/100;if(i>=0&&i<=360&&s>=0&&s<=1&&n>=0&&n<=1){const o=K(i,s,n);return F(o.r,o.g,o.b)}}return null}autoDetectColorFormat(t){const e=this.parseHexInput(t);if(e)return e;const i=this.parseRgbInput(t);if(i)return i;const s=this.parseHslInput(t);return s||null}updatePickerVisualState(){const{h:t,s:e,v:i}=A(this.currentColor);this.hueMarker.style.left=`${t/360*100}%`,this.colorMarker.style.left=`${e*100}%`,this.colorMarker.style.top=`${(1-i)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${t}, 100%, 50%))`,this.updateOpacityBackground(this.opacitySlider)}triggerChange(){this.onColorChange(this.currentColor,this.currentOpacity)}getElement(){return this.container}updateColor(t,e){this.currentColor=t,this.currentOpacity=e;const{h:i,s,v:n}=A(t),o=i>=360?i%360:i;this.hueMarker.style.left=`${o/360*100}%`,this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${(1-n)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`,this.opacityMarker.style.left=`${e}%`,this.updateOpacityBackground(this.opacitySlider),this.updateColorInput(this.formatSelect,this.colorInput)}}const T=class T extends b{constructor(t={}){const e=typeof t.default=="string"?void 0:t.default;super({...t,title:t.title||"Color",default:e}),this.inputType={type:"text",angle:"number",stops:"text"},this.element=null,this.previewEl=null,this.inputEl=void 0,this.popoverEl=null,this.backdropEl=null,this.isPopoverOpen=!1,this.isEditing=!1,this.popoverPosition=null,this.previewUpdateTimeout=null,this.solidPicker=null,this.pendingSolidColor=null,this.onBackgroundClick=i=>{var d;if(!this.popoverEl||!this.isPopoverOpen)return;const s=i.target,n=this.popoverEl.contains(s),o=(d=this.element)==null?void 0:d.contains(s),a=document.querySelectorAll(".custom-color-picker"),l=Array.from(a).some(u=>u.contains(s)),r=s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"),h=s.classList.contains("color-picker-backdrop"),p=s.classList.contains("gradient-popover-backdrop");!n&&!o&&!l&&!r&&!h&&!p&&this.closePopover()},this.handlePopoverKeydown=i=>{if(this.isPopoverOpen){if(i.key==="Escape"){i.preventDefault(),this.closePopover();return}if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.closePopover()}}},this.detectChange=t.detectChange,this.originalDefault=t.default,this.value=this.defaultValue()}defaultValue(){const t=this.originalDefault;if(typeof t=="string"){const i=P(t);if(i)return B(i)}return B(t&&typeof t=="object"?t:{type:"linear",angle:90,stops:[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]})}setValue(t){var i,s;let e=null;typeof t=="string"?e=P(t):t&&typeof t=="object"&&(e=B(t)),e||(e=this.defaultValue()),this.value=e,this.updateUI(),this.isPopoverOpen&&this.refreshPopoverContent(),(i=this.onChange)==null||i.call(this,this.value),(s=this.detectChange)==null||s.call(this,this.value),this.pendingSolidColor=null}updateUI(){if(this.previewEl&&this.value)if(this.value.type==="solid"){const t=this.value.stops[0],e=t.opacity??100;this.previewEl.style.background=mt(t.color,e)}else this.previewEl.style.background=V(this.value);this.inputEl&&this.value&&!this.isEditing&&(this.inputEl.value=J(this.value))}cssForTextValue(){return this.value?{background:V(this.value),"-webkit-background-clip":"text","background-clip":"text",color:"transparent","-webkit-text-fill-color":"transparent"}:{}}draw(){const t=document.createElement("div");if(t.className="gradient-setting-wrapper",this.props.title){const i=document.createElement("div");i.className="icon-container";const s=document.createElement("span");s.className="input-label",s.textContent=this.props.title,i.appendChild(s),t.appendChild(i)}const e=document.createElement("div");return e.className="gradient-input-wrapper",this.previewEl=document.createElement("div"),this.previewEl.className="gradient-mini-preview",this.previewEl.style.background=this.value?V(this.value):"linear-gradient(90deg, #a84b4b 0%, #786666 100%)",this.previewEl.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.openPopover()}),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className="gradient-text-input",this.inputEl.placeholder="Enter gradient CSS or paste color...",this.inputEl.value=this.value?J(this.value):"",this.inputEl.readOnly=!1,this.inputEl.addEventListener("focus",()=>{if(this.isEditing=!0,this.value)if(this.value.type==="solid"){const i=this.value.stops[0];if(i){const s=i.color.toUpperCase(),n=i.opacity??100;if(n===100)this.inputEl.value=s;else{const a=Math.round(n/100*255).toString(16).toUpperCase().padStart(2,"0");this.inputEl.value=`${s}${a}`}}}else this.inputEl.value=V(this.value)}),this.inputEl.addEventListener("blur",()=>{this.isEditing=!1,this.value&&(this.inputEl.value=J(this.value))}),this.inputEl.addEventListener("paste",i=>this.handlePaste(i)),this.inputEl.addEventListener("input",i=>this.handleTextInput(i)),this.inputEl.addEventListener("keydown",i=>{i.key==="Enter"&&(this.handleTextInput(i),this.inputEl.blur()),i.key==="Escape"&&(this.value&&(this.inputEl.value=V(this.value)),this.inputEl.blur())}),e.appendChild(this.previewEl),e.appendChild(this.inputEl),t.appendChild(e),this.createPopover(),this.element=t,t}createPopover(){if(this.popoverEl)return;this.backdropEl=document.createElement("div"),this.backdropEl.className="gradient-popover-backdrop",this.backdropEl.style.display="none",this.backdropEl.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.closePopover()}),this.popoverEl=document.createElement("div"),this.popoverEl.className="gradient-popover",this.popoverEl.style.display="none",this.popoverEl.addEventListener("click",a=>{a.stopPropagation()});const t=document.createElement("div");t.className="gradient-popover-header",t.style.cursor="move";const e=document.createElement("span");e.textContent="Fill";const i=document.createElement("button");i.type="button",i.className="gradient-popover-close",i.innerHTML=Ct,i.addEventListener("click",()=>this.closePopover()),t.appendChild(e),t.appendChild(i),gt(t,this.popoverEl,(a,l)=>{this.popoverPosition={left:a,top:l}});const s=document.createElement("div");s.className="gradient-editor";const n=this.createTypeTabs();s.appendChild(n);const o=document.createElement("div");o.className="gradient-editor-content",this.updatePopoverContent(o),s.appendChild(o),this.popoverEl.appendChild(t),this.popoverEl.appendChild(s),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}createTypeTabs(){var s,n;const t=document.createElement("div");t.className="gradient-type-tabs";const e=document.createElement("button");e.type="button",e.className=`gradient-type-tab ${((s=this.value)==null?void 0:s.type)==="solid"?"active":""}`,e.textContent="Solid",e.addEventListener("click",()=>this.switchType("solid"));const i=document.createElement("button");return i.type="button",i.className=`gradient-type-tab ${((n=this.value)==null?void 0:n.type)!=="solid"?"active":""}`,i.textContent="Gradient",i.addEventListener("click",()=>{var a,l;const o=((a=this.value)==null?void 0:a.type)==="solid"?"linear":((l=this.value)==null?void 0:l.type)||"linear";this.switchType(o)}),t.appendChild(e),t.appendChild(i),t}switchType(t){var i;if(!this.value)return;if(this.value.type=t,t!=="solid"&&(!this.value.stops||this.value.stops.length===0)&&(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]),t!=="solid"&&this.value.stops.length<2&&(this.value.angle=90),this.popoverEl){const s=this.popoverEl.querySelectorAll(".gradient-type-tab");s.forEach(a=>a.classList.remove("active"));const n=s[0],o=s[1];t==="solid"?n==null||n.classList.add("active"):o==null||o.classList.add("active")}const e=(i=this.popoverEl)==null?void 0:i.querySelector(".gradient-editor-content");e&&this.updatePopoverContent(e),this.updateUI(),this.triggerChange()}updatePopoverContent(t){t.innerHTML="",this.value&&(this.value.type==="solid"?this.renderSolid(t):this.renderGradient(t))}renderSolid(t){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const e=this.value.stops[0],i=new ce({initialColor:e.color,initialOpacity:e.opacity??100,onColorChange:(s,n)=>{if(this.value){const o=P(s);if(o&&o.type!=="solid"){this.value=o,this.switchType(o.type);return}this.value.stops[0].color=s,this.value.stops[0].opacity=n,this.updateUI(),this.triggerChange(),this.pendingSolidColor=s}}});this.solidPicker=i,t.appendChild(i.getElement())}renderGradient(t){this.solidPicker=null;const e=document.createElement("div");e.className="gradient-subtype-inline";const i=document.createElement("select");i.className="gradient-subtype-select";const s=document.createElement("option");s.value="linear",s.textContent="Linear";const n=document.createElement("option");n.value="radial",n.textContent="Radial",i.appendChild(s),i.appendChild(n),i.value=this.value.type==="radial"?"radial":"linear";const o=document.createElement("input");o.type="text",o.inputMode="numeric",o.className="gradient-degree-input",o.value=`${this.value.angle??90}°`,o.style.width="75px",o.style.textAlign="center",(!this.value.angle||this.value.stops.length<2)&&(this.value.angle=90,o.value="90°");const a=document.createElement("button");a.type="button",a.className="gradient-flip-btn",a.innerHTML=ae,i.addEventListener("change",()=>{this.switchType(i.value==="radial"?"radial":"linear"),this.updateDegreeVisibility(o)}),o.addEventListener("focus",f=>{const g=f.target;g.value=g.value.replace(/[^0-9-]/g,""),setTimeout(()=>g.select(),0)}),o.addEventListener("input",f=>{const g=parseInt(f.target.value);!Number.isNaN(g)&&this.value&&(this.value.angle=Math.max(0,Math.min(360,g)),this.debouncedPreviewUpdate())}),o.addEventListener("blur",f=>{var y;this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const g=f.target;let C=parseInt(g.value);Number.isNaN(C)&&(C=((y=this.value)==null?void 0:y.angle)??0),C=Math.max(0,Math.min(360,C)),this.value&&(this.value.angle=C),g.value=`${C}°`,this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),a.addEventListener("click",()=>{!this.value||!this.value.stops||(this.value.stops.forEach(f=>{f.position=100-f.position}),this.value.stops.sort((f,g)=>f.position-g.position),this.updateGradientPreview(l),this.createHandles(r,l),this.updateStopsList(u),this.updateUI(),this.triggerChange())}),e.appendChild(i),e.appendChild(o),e.appendChild(a),t.appendChild(e),this.updateDegreeVisibility(o);const l=document.createElement("div");l.className="gradient-preview",this.updateGradientPreview(l);const r=document.createElement("div");r.className="gradient-handles",l.appendChild(r),t.appendChild(l),this.createHandles(r,l);const h=document.createElement("div");h.className="gradient-stops-header";const p=document.createElement("span");p.textContent="Stops";const d=document.createElement("button");d.type="button",d.className="gradient-add-stop",d.textContent="+",h.appendChild(p),h.appendChild(d);const u=document.createElement("div");u.className="gradient-stops",t.appendChild(h),t.appendChild(u),this.updateStopsList(u);const m=nt(f=>{const g=P(f);g&&(this.value=g,this.switchType(g.type),this.updateUI(),this.triggerChange())},"all");this.recentGradientRefresh=m.refresh,t.appendChild(m.container),d.addEventListener("click",()=>{var f;this.addStop(),this.updateStopsList(u),this.updateGradientPreview(l),this.createHandles(r,l),this.updateUI(),((f=document.activeElement)==null?void 0:f.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()})}updateDegreeVisibility(t){var e;((e=this.value)==null?void 0:e.type)==="radial"?(t.disabled=!0,t.style.opacity="0.5"):(t.disabled=!1,t.style.opacity="1")}updateGradientPreview(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-preview"));e&&this.value&&(e.style.background=V(this.value))}debouncedPreviewUpdate(t){this.previewUpdateTimeout&&clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=window.setTimeout(()=>{this.updateGradientPreview(t),this.previewUpdateTimeout=null},16)}createHandles(t,e){t.innerHTML="",!(!this.value||this.value.type==="solid"||!this.value.stops)&&this.value.stops.forEach((i,s)=>{const n=document.createElement("div");n.className="gstop-handle",n.style.left=`${Math.max(0,Math.min(100,i.position))}%`,n.style.top="0%";const o=document.createElement("div");o.className="gstop-chip",o.style.backgroundColor=i.color,n.appendChild(o);let a=!1,l=0,r=0;const h=u=>{a=!0,l=u.clientX,r=this.value.stops[s].position,n.classList.add("selected"),document.addEventListener("mousemove",p),document.addEventListener("mouseup",d),u.preventDefault(),u.stopPropagation()},p=u=>{if(!a||!this.value)return;const m=e.getBoundingClientRect(),f=u.clientX-l;let g=r+f/m.width*100;g=Math.max(0,Math.min(100,g)),this.value.stops[s].position=Math.round(g),n.style.left=`${g}%`,this.updateGradientPreview()},d=()=>{a&&(a=!1,n.classList.remove("selected"),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",d),this.value&&(this.value.stops.sort((u,m)=>u.position-m.position),this.createHandles(t,e),this.updateStopsList()),this.updateUI(),this.triggerChange())};n.addEventListener("mousedown",h),t.appendChild(n)})}updateStopsList(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-stops"));!e||!this.value||this.value.type==="solid"||!this.value.stops||(e.innerHTML="",this.value.stops.forEach((s,n)=>{var N,O;const o=document.createElement("div");o.className="gstop-row";const a=document.createElement("div");a.className="gstop-position-group";const l=document.createElement("input");l.type="text",l.className="gstop-position-input",l.value=`${s.position}%`,l.style.width="60px",a.appendChild(l);const r=document.createElement("div");r.className="gstop-color-container";const h=document.createElement("div");h.className="gstop-color-preview",h.style.backgroundColor=s.color;const p=document.createElement("input");p.type="text",p.className="gstop-color-input",p.value=s.color.replace("#","").toUpperCase();const d=document.createElement("button");d.type="button",d.className="gstop-color-copy",d.textContent="Copy",r.appendChild(h),r.appendChild(p),r.appendChild(d);const u=document.createElement("button");u.type="button",u.className="gstop-del",u.innerHTML=le,u.disabled=(((O=(N=this.value)==null?void 0:N.stops)==null?void 0:O.length)||0)<=2,o.appendChild(a),o.appendChild(r),o.appendChild(u),e.appendChild(o);const m=document.createElement("span");m.className="gstop-opacity-label",m.textContent="Opacity";const f=document.createElement("div");f.className="gstop-opacity-group";const g=document.createElement("input");g.type="range",g.className="gstop-opacity-slider",g.min="0",g.max="100",g.value=String(s.opacity??100);const C=M(s.color);g.style.setProperty("--slider-color",`rgb(${C.r}, ${C.g}, ${C.b})`);const y=document.createElement("span");y.className="gstop-opacity-value",y.textContent=`${s.opacity??100}%`,f.appendChild(g),f.appendChild(y);const L=new re((v,E)=>{p.value=v.replace("#","").toUpperCase(),h.style.backgroundColor=v,this.value.stops[n].color=v,E!==void 0&&(this.value.stops[n].opacity=E,g.value=String(E),y.textContent=`${E}%`);const x=M(v);g.style.setProperty("--slider-color",`rgb(${x.r}, ${x.g}, ${x.b})`),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()},"solid");p.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),L.open(s.color,p,s.opacity??100)}),p.addEventListener("input",()=>{const v=p.value.trim(),E=v.startsWith("#")?v:`#${v}`;if(/^#[0-9A-Fa-f]{6}$/.test(E)){this.value.stops[n].color=E,h.style.backgroundColor=E;const x=M(E);g.style.setProperty("--slider-color",`rgb(${x.r}, ${x.g}, ${x.b})`),this.debouncedPreviewUpdate()}}),p.addEventListener("blur",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),d.addEventListener("click",async v=>{v.stopPropagation();try{await navigator.clipboard.writeText(`#${p.value}`)}catch{}}),l.addEventListener("focus",v=>{const E=v.target;E.value=E.value.replace("%",""),E.select()}),l.addEventListener("input",v=>{const E=v.target,x=parseInt(E.value.replace(/[^\d]/g,""),10);if(!Number.isNaN(x)){const G=Math.max(0,Math.min(100,x));this.value.stops[n].position=G,E.value=`${G}%`,this.debouncedPreviewUpdate()}}),l.addEventListener("blur",v=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const E=v.target,x=parseInt(E.value.replace(/[^\d]/g,""),10);if(Number.isNaN(x))E.value=`${this.value.stops[n].position}%`;else{const G=Math.max(0,Math.min(100,x));this.value.stops[n].position=G,E.value=`${G}%`}this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateUI(),this.triggerChange()}),u.addEventListener("click",()=>{var v;(this.value.stops.length||0)<=2||(this.value.stops.splice(n,1),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateGradientPreview(),this.updateUI(),((v=document.activeElement)==null?void 0:v.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange())}),g.addEventListener("input",()=>{const v=parseInt(g.value,10);this.value.stops[n].opacity=Math.max(0,Math.min(100,v)),y.textContent=`${this.value.stops[n].opacity}%`,this.debouncedPreviewUpdate()}),g.addEventListener("change",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()})}))}addStop(){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const t=this.value.stops.map(o=>o.position).sort((o,a)=>o-a);let e=50,i=0;for(let o=0;o<t.length-1;o++){const a=t[o+1]-t[o];a>i&&(i=a,e=t[o]+a/2)}const s=this.value.stops.reduce((o,a)=>Math.abs(a.position-e)<Math.abs(o.position-e)?a:o),n={position:Math.round(e),color:s.color,opacity:s.opacity??100};this.value.stops.push(n),this.value.stops.sort((o,a)=>o.position-a.position)}openPopover(){if(this.popoverEl&&(T.openInstance&&T.openInstance!==this&&T.openInstance.closePopover(),!this.isPopoverOpen)){if(this.isPopoverOpen=!0,T.openInstance=this,this.backdropEl&&(this.backdropEl.style.display="block",this.backdropEl.parentElement||document.body.appendChild(this.backdropEl)),this.popoverEl.style.display="flex",this.refreshPopoverContent(),this.element){const t=this.element.getBoundingClientRect(),e=306,i=window.innerWidth,s=window.innerHeight,n=16;this.popoverEl.style.position="fixed",this.popoverEl.style.zIndex="10000",this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const o=this.popoverEl.offsetHeight;let a=t.right+8,l=t.top;const r=i-t.right,h=t.left,p=e+n;r<p&&h>r+100&&(a=t.left-e-8);const d=s-t.bottom,u=t.top;u>=o+n?l=t.top-o-8:d>=o+n?l=t.bottom+8:u>d?(l=t.top-o-8,l<n&&(l=n)):(l=t.bottom+8,l+o>s-n&&(l=s-o-n)),this.popoverEl.style.left=`${a}px`,this.popoverEl.style.top=`${l}px`,this.popoverPosition={left:a,top:l}}setTimeout(()=>document.addEventListener("click",this.onBackgroundClick,!0),200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}}repositionPopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen||!this.element)&&((t=document.activeElement)==null?void 0:t.tagName)!=="INPUT"){if(this.popoverPosition){this.popoverEl.style.left=`${this.popoverPosition.left}px`,this.popoverEl.style.top=`${this.popoverPosition.top}px`;return}requestAnimationFrame(()=>{if(!this.popoverEl||!this.element)return;const e=this.element.getBoundingClientRect(),i=306,s=window.innerWidth,n=window.innerHeight,o=16;this.popoverEl.style.left,this.popoverEl.style.top,this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const a=this.popoverEl.offsetHeight;let l=e.right+8,r=e.top;const h=s-e.right,p=e.left,d=i+o;h<d&&p>h+100&&(l=e.left-i-8);const u=n-e.bottom,m=e.top;m>=a+o?r=e.top-a-8:u>=a+o?r=e.bottom+8:m>u?(r=e.top-a-8,r<o&&(r=o)):(r=e.bottom+8,r+a>n-o&&(r=n-a-o)),this.popoverEl.style.left=`${l}px`,this.popoverEl.style.top=`${r}px`})}}refreshPopoverContent(){var n,o;if(!this.popoverEl)return;const t=this.popoverEl.querySelectorAll(".gradient-type-tab");t.forEach(a=>a.classList.remove("active"));const e=t[0],i=t[1];((n=this.value)==null?void 0:n.type)==="solid"?e.classList.add("active"):(i.classList.add("active"),(o=this.recentGradientRefresh)==null||o.call(this)),this.popoverEl.offsetHeight;const s=this.popoverEl.querySelector(".gradient-editor-content");s&&this.updatePopoverContent(s)}closePopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen)){if(this.isPopoverOpen=!1,this.popoverPosition=null,this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl.style.display="none",document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.commitPendingSolidColor(),this.value&&this.value.type!=="solid"){const e=V(this.value);R.addColor(e,"gradient"),(t=this.recentGradientRefresh)==null||t.call(this)}this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),T.openInstance===this&&(T.openInstance=null)}}commitPendingSolidColor(){this.pendingSolidColor&&(this.solidPicker?this.solidPicker.commitRecentColor():R.addColor(this.pendingSolidColor,"solid"),this.pendingSolidColor=null)}handlePaste(t){var i;t.preventDefault();const e=((i=t.clipboardData)==null?void 0:i.getData("text"))||"";this.parseAndSet(e)}handleTextInput(t){const e=t.target;this.parseAndSet(e.value)}parseAndSet(t){const e=P(t.trim());e&&this.setValue(e)}triggerChange(){var t,e;this.value&&((t=this.onChange)==null||t.call(this,this.value),(e=this.detectChange)==null||e.call(this,this.value))}getElement(){return this.element}getValue(){return this.value?V(this.value):""}getCSSValue(){return this.value?V(this.value):""}getCSSForText(){return this.value?this.cssForTextValue():{}}getRawValue(){return this.value}};T.openInstance=null;let j=T;const he=`
|
|
229
|
+
`;const e=nt(i=>{this.applyRecentColor(i)},this.recentScope);return this.recentSectionRefresh=e.refresh,t.appendChild(e.container),t}initializePicker(){this.colorArea=this.container.querySelector(".color-picker-area"),this.colorMarker=this.container.querySelector(".color-picker-marker"),this.hueSlider=this.container.querySelector(".color-picker-hue"),this.hueMarker=this.container.querySelector(".color-picker-hue-marker"),this.opacitySlider=this.container.querySelector(".color-picker-opacity"),this.opacityMarker=this.container.querySelector(".color-picker-opacity-marker"),this.formatSelect=this.container.querySelector(".color-picker-format-select"),this.colorInput=this.container.querySelector(".color-picker-color-input");const t=this.container.querySelector(".color-picker-copy-inside"),{h:e,s:i,v:s}=A(this.currentColor);this.hueMarker.style.left=`${e/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e}, 100%, 50%))`,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.updateOpacityBackground(this.opacitySlider),this.updateColorInput(this.formatSelect,this.colorInput),this.setupColorAreaEvents(),this.setupHueSliderEvents(),this.setupOpacitySliderEvents(),this.setupFormatEvents(t)}scheduleInputUpdate(){this.inputUpdateTimeout&&clearTimeout(this.inputUpdateTimeout),this.inputUpdateTimeout=window.setTimeout(()=>{this.updateColorInput(this.formatSelect,this.colorInput)},16)}updateOpacityBackground(t){const e=M(this.currentColor);t.style.setProperty("--base-color",`rgb(${e.r}, ${e.g}, ${e.b})`)}updateColorInput(t,e){switch(t.value){case"hex":e.value=this.currentColor;break;case"rgb":const s=M(this.currentColor);e.value=`rgb(${s.r}, ${s.g}, ${s.b})`;break;case"hsl":const{h:n,s:o,v:a}=A(this.currentColor),l=a*(1-o/2),r=l===0||l===1?0:(a-l)/Math.min(l,1-l);e.value=`hsl(${Math.round(n)}, ${Math.round(r*100)}%, ${Math.round(l*100)}%)`;break}}applyRecentColor(t){this.currentColor=t,t.includes("gradient")||t.includes("radial")||(this.updatePickerVisualState(),this.updateColorInput(this.formatSelect,this.colorInput)),this.triggerChange()}commitRecentColor(){var t;R.addColor(this.currentColor,this.recentScope),(t=this.recentSectionRefresh)==null||t.call(this)}setupColorAreaEvents(){const t=e=>{const i=this.colorArea.getBoundingClientRect(),s=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width)),n=Math.max(0,Math.min(1,(e.clientY-i.top)/i.height));this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${n*100}%`;const o=parseFloat(this.hueMarker.style.left||"0%"),a=Math.max(0,Math.min(360,o/100*360)),l=Math.max(0,Math.min(1,s)),r=Math.max(0,Math.min(1,1-n)),h=z(a,l,r);this.currentColor=h,this.updateOpacityBackground(this.opacitySlider),this.triggerChange()};this.colorArea.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),this.updateColorInput(this.formatSelect,this.colorInput),this.updateOpacityBackground(this.opacitySlider)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupHueSliderEvents(){const t=e=>{const i=this.hueSlider.getBoundingClientRect();let s=(e.clientX-i.left)/i.width;s=Math.max(0,Math.min(1,s)),this.hueMarker.style.left=`${s*100}%`;const n=Math.max(0,Math.min(360,s*360)),o=parseFloat(this.colorMarker.style.left||"50%"),a=parseFloat(this.colorMarker.style.top||"50%"),l=Math.max(0,Math.min(1,(isNaN(o)?50:o)/100)),r=Math.max(0,Math.min(1,(isNaN(a)?50:a)/100));this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`;const h=z(n,l,1-r);this.currentColor=h,this.updateOpacityBackground(this.opacitySlider),this.triggerChange()};this.hueSlider.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),this.inputUpdateTimeout&&clearTimeout(this.inputUpdateTimeout),this.updateColorInput(this.formatSelect,this.colorInput)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupOpacitySliderEvents(){const t=e=>{const i=this.opacitySlider.getBoundingClientRect(),s=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));this.opacityMarker.style.left=`${s*100}%`,this.currentOpacity=Math.round(s*100),this.triggerChange()};this.opacitySlider.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupFormatEvents(t){this.formatSelect.addEventListener("change",()=>{this.updateColorInput(this.formatSelect,this.colorInput)}),t.addEventListener("click",()=>{navigator.clipboard.writeText(this.colorInput.value).catch(()=>{this.colorInput.select(),document.execCommand("copy")})}),this.colorInput.addEventListener("input",()=>{this.handleManualColorInput(this.colorInput.value,this.formatSelect)}),this.colorInput.addEventListener("blur",()=>{this.updateColorInput(this.formatSelect,this.colorInput)})}handleManualColorInput(t,e){const i=t.trim();let s=null;switch(e.value){case"hex":s=this.parseHexInput(i);break;case"rgb":s=this.parseRgbInput(i);break;case"hsl":s=this.parseHslInput(i);break}s||(s=this.autoDetectColorFormat(i)),s&&(this.currentColor=s,this.updatePickerVisualState(),this.triggerChange())}parseHexInput(t){const e=t.startsWith("#")?t:`#${t}`;return D(e)}parseRgbInput(t){const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*[\d.]+)?\s*\)/);if(e){const i=parseInt(e[1]),s=parseInt(e[2]),n=parseInt(e[3]);if(i<=255&&s<=255&&n<=255)return F(i,s,n)}return null}parseHslInput(t){const e=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\s*\)/);if(e){const i=parseFloat(e[1]),s=parseFloat(e[2])/100,n=parseFloat(e[3])/100;if(i>=0&&i<=360&&s>=0&&s<=1&&n>=0&&n<=1){const o=K(i,s,n);return F(o.r,o.g,o.b)}}return null}autoDetectColorFormat(t){const e=this.parseHexInput(t);if(e)return e;const i=this.parseRgbInput(t);if(i)return i;const s=this.parseHslInput(t);return s||null}updatePickerVisualState(){const{h:t,s:e,v:i}=A(this.currentColor);this.hueMarker.style.left=`${t/360*100}%`,this.colorMarker.style.left=`${e*100}%`,this.colorMarker.style.top=`${(1-i)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${t}, 100%, 50%))`,this.updateOpacityBackground(this.opacitySlider)}triggerChange(){this.onColorChange(this.currentColor,this.currentOpacity)}getElement(){return this.container}updateColor(t,e){this.currentColor=t,this.currentOpacity=e;const{h:i,s,v:n}=A(t),o=i>=360?i%360:i;this.hueMarker.style.left=`${o/360*100}%`,this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${(1-n)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`,this.opacityMarker.style.left=`${e}%`,this.updateOpacityBackground(this.opacitySlider),this.updateColorInput(this.formatSelect,this.colorInput)}}const T=class T extends b{constructor(t={}){const e=typeof t.default=="string"?void 0:t.default;super({...t,title:t.title||"Color",default:e}),this.inputType={type:"text",angle:"number",stops:"text"},this.element=null,this.previewEl=null,this.inputEl=void 0,this.popoverEl=null,this.backdropEl=null,this.isPopoverOpen=!1,this.isEditing=!1,this.popoverPosition=null,this.previewUpdateTimeout=null,this.solidPicker=null,this.pendingSolidColor=null,this.onBackgroundClick=i=>{var d;if(!this.popoverEl||!this.isPopoverOpen)return;const s=i.target,n=this.popoverEl.contains(s),o=(d=this.element)==null?void 0:d.contains(s),a=document.querySelectorAll(".custom-color-picker"),l=Array.from(a).some(u=>u.contains(s)),r=s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"),h=s.classList.contains("color-picker-backdrop"),p=s.classList.contains("gradient-popover-backdrop");!n&&!o&&!l&&!r&&!h&&!p&&this.closePopover()},this.handlePopoverKeydown=i=>{if(this.isPopoverOpen){if(i.key==="Escape"){i.preventDefault(),this.closePopover();return}if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.closePopover()}}},this.detectChange=t.detectChange,this.originalDefault=t.default,this.value=this.defaultValue()}defaultValue(){const t=this.originalDefault;if(typeof t=="string"){const i=O(t);if(i)return B(i)}return B(t&&typeof t=="object"?t:{type:"linear",angle:90,stops:[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]})}setValue(t){var i,s;let e=null;typeof t=="string"?e=O(t):t&&typeof t=="object"&&(e=B(t)),e||(e=this.defaultValue()),this.value=e,this.updateUI(),this.isPopoverOpen&&this.refreshPopoverContent(),(i=this.onChange)==null||i.call(this,this.value),(s=this.detectChange)==null||s.call(this,this.value),this.pendingSolidColor=null}updateUI(){if(this.previewEl&&this.value)if(this.value.type==="solid"){const t=this.value.stops[0],e=t.opacity??100;this.previewEl.style.background=mt(t.color,e)}else this.previewEl.style.background=V(this.value);this.inputEl&&this.value&&!this.isEditing&&(this.inputEl.value=J(this.value))}cssForTextValue(){return this.value?{background:V(this.value),"-webkit-background-clip":"text","background-clip":"text",color:"transparent","-webkit-text-fill-color":"transparent"}:{}}draw(){const t=document.createElement("div");if(t.className="gradient-setting-wrapper",this.props.title){const i=document.createElement("div");i.className="icon-container";const s=document.createElement("span");s.className="input-label",s.textContent=this.props.title,i.appendChild(s),t.appendChild(i)}const e=document.createElement("div");return e.className="gradient-input-wrapper",this.previewEl=document.createElement("div"),this.previewEl.className="gradient-mini-preview",this.previewEl.style.background=this.value?V(this.value):"linear-gradient(90deg, #a84b4b 0%, #786666 100%)",this.previewEl.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.openPopover()}),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className="gradient-text-input",this.inputEl.placeholder="Enter gradient CSS or paste color...",this.inputEl.value=this.value?J(this.value):"",this.inputEl.readOnly=!1,this.inputEl.addEventListener("focus",()=>{if(this.isEditing=!0,this.value)if(this.value.type==="solid"){const i=this.value.stops[0];if(i){const s=i.color.toUpperCase(),n=i.opacity??100;if(n===100)this.inputEl.value=s;else{const a=Math.round(n/100*255).toString(16).toUpperCase().padStart(2,"0");this.inputEl.value=`${s}${a}`}}}else this.inputEl.value=V(this.value)}),this.inputEl.addEventListener("blur",()=>{this.isEditing=!1,this.value&&(this.inputEl.value=J(this.value))}),this.inputEl.addEventListener("paste",i=>this.handlePaste(i)),this.inputEl.addEventListener("input",i=>this.handleTextInput(i)),this.inputEl.addEventListener("keydown",i=>{i.key==="Enter"&&(this.handleTextInput(i),this.inputEl.blur()),i.key==="Escape"&&(this.value&&(this.inputEl.value=V(this.value)),this.inputEl.blur())}),e.appendChild(this.previewEl),e.appendChild(this.inputEl),t.appendChild(e),this.createPopover(),this.element=t,t}createPopover(){if(this.popoverEl)return;this.backdropEl=document.createElement("div"),this.backdropEl.className="gradient-popover-backdrop",this.backdropEl.style.display="none",this.backdropEl.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.closePopover()}),this.popoverEl=document.createElement("div"),this.popoverEl.className="gradient-popover",this.popoverEl.style.display="none",this.popoverEl.addEventListener("click",a=>{a.stopPropagation()});const t=document.createElement("div");t.className="gradient-popover-header",t.style.cursor="move";const e=document.createElement("span");e.textContent="Fill";const i=document.createElement("button");i.type="button",i.className="gradient-popover-close",i.innerHTML=Ct,i.addEventListener("click",()=>this.closePopover()),t.appendChild(e),t.appendChild(i),gt(t,this.popoverEl,(a,l)=>{this.popoverPosition={left:a,top:l}});const s=document.createElement("div");s.className="gradient-editor";const n=this.createTypeTabs();s.appendChild(n);const o=document.createElement("div");o.className="gradient-editor-content",this.updatePopoverContent(o),s.appendChild(o),this.popoverEl.appendChild(t),this.popoverEl.appendChild(s),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}createTypeTabs(){var s,n;const t=document.createElement("div");t.className="gradient-type-tabs";const e=document.createElement("button");e.type="button",e.className=`gradient-type-tab ${((s=this.value)==null?void 0:s.type)==="solid"?"active":""}`,e.textContent="Solid",e.addEventListener("click",()=>this.switchType("solid"));const i=document.createElement("button");return i.type="button",i.className=`gradient-type-tab ${((n=this.value)==null?void 0:n.type)!=="solid"?"active":""}`,i.textContent="Gradient",i.addEventListener("click",()=>{var a,l;const o=((a=this.value)==null?void 0:a.type)==="solid"?"linear":((l=this.value)==null?void 0:l.type)||"linear";this.switchType(o)}),t.appendChild(e),t.appendChild(i),t}switchType(t){var i;if(!this.value)return;if(this.value.type=t,t!=="solid"&&(!this.value.stops||this.value.stops.length===0)&&(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]),t!=="solid"&&this.value.stops.length<2&&(this.value.angle=90),this.popoverEl){const s=this.popoverEl.querySelectorAll(".gradient-type-tab");s.forEach(a=>a.classList.remove("active"));const n=s[0],o=s[1];t==="solid"?n==null||n.classList.add("active"):o==null||o.classList.add("active")}const e=(i=this.popoverEl)==null?void 0:i.querySelector(".gradient-editor-content");e&&this.updatePopoverContent(e),this.updateUI(),this.triggerChange()}updatePopoverContent(t){t.innerHTML="",this.value&&(this.value.type==="solid"?this.renderSolid(t):this.renderGradient(t))}renderSolid(t){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const e=this.value.stops[0],i=new ce({initialColor:e.color,initialOpacity:e.opacity??100,onColorChange:(s,n)=>{if(this.value){const o=O(s);if(o&&o.type!=="solid"){this.value=o,this.switchType(o.type);return}this.value.stops[0].color=s,this.value.stops[0].opacity=n,this.updateUI(),this.triggerChange(),this.pendingSolidColor=s}}});this.solidPicker=i,t.appendChild(i.getElement())}renderGradient(t){this.solidPicker=null;const e=document.createElement("div");e.className="gradient-subtype-inline";const i=document.createElement("select");i.className="gradient-subtype-select";const s=document.createElement("option");s.value="linear",s.textContent="Linear";const n=document.createElement("option");n.value="radial",n.textContent="Radial",i.appendChild(s),i.appendChild(n),i.value=this.value.type==="radial"?"radial":"linear";const o=document.createElement("input");o.type="text",o.inputMode="numeric",o.className="gradient-degree-input",o.value=`${this.value.angle??90}°`,o.style.width="75px",o.style.textAlign="center",(!this.value.angle||this.value.stops.length<2)&&(this.value.angle=90,o.value="90°");const a=document.createElement("button");a.type="button",a.className="gradient-flip-btn",a.innerHTML=ae,i.addEventListener("change",()=>{this.switchType(i.value==="radial"?"radial":"linear"),this.updateDegreeVisibility(o)}),o.addEventListener("focus",f=>{const g=f.target;g.value=g.value.replace(/[^0-9-]/g,""),setTimeout(()=>g.select(),0)}),o.addEventListener("input",f=>{const g=parseInt(f.target.value);!Number.isNaN(g)&&this.value&&(this.value.angle=Math.max(0,Math.min(360,g)),this.debouncedPreviewUpdate())}),o.addEventListener("blur",f=>{var y;this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const g=f.target;let C=parseInt(g.value);Number.isNaN(C)&&(C=((y=this.value)==null?void 0:y.angle)??0),C=Math.max(0,Math.min(360,C)),this.value&&(this.value.angle=C),g.value=`${C}°`,this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),a.addEventListener("click",()=>{!this.value||!this.value.stops||(this.value.stops.forEach(f=>{f.position=100-f.position}),this.value.stops.sort((f,g)=>f.position-g.position),this.updateGradientPreview(l),this.createHandles(r,l),this.updateStopsList(u),this.updateUI(),this.triggerChange())}),e.appendChild(i),e.appendChild(o),e.appendChild(a),t.appendChild(e),this.updateDegreeVisibility(o);const l=document.createElement("div");l.className="gradient-preview",this.updateGradientPreview(l);const r=document.createElement("div");r.className="gradient-handles",l.appendChild(r),t.appendChild(l),this.createHandles(r,l);const h=document.createElement("div");h.className="gradient-stops-header";const p=document.createElement("span");p.textContent="Stops";const d=document.createElement("button");d.type="button",d.className="gradient-add-stop",d.textContent="+",h.appendChild(p),h.appendChild(d);const u=document.createElement("div");u.className="gradient-stops",t.appendChild(h),t.appendChild(u),this.updateStopsList(u);const m=nt(f=>{const g=O(f);g&&(this.value=g,this.switchType(g.type),this.updateUI(),this.triggerChange())},"all");this.recentGradientRefresh=m.refresh,t.appendChild(m.container),d.addEventListener("click",()=>{var f;this.addStop(),this.updateStopsList(u),this.updateGradientPreview(l),this.createHandles(r,l),this.updateUI(),((f=document.activeElement)==null?void 0:f.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()})}updateDegreeVisibility(t){var e;((e=this.value)==null?void 0:e.type)==="radial"?(t.disabled=!0,t.style.opacity="0.5"):(t.disabled=!1,t.style.opacity="1")}updateGradientPreview(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-preview"));e&&this.value&&(e.style.background=V(this.value))}debouncedPreviewUpdate(t){this.previewUpdateTimeout&&clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=window.setTimeout(()=>{this.updateGradientPreview(t),this.previewUpdateTimeout=null},16)}createHandles(t,e){t.innerHTML="",!(!this.value||this.value.type==="solid"||!this.value.stops)&&this.value.stops.forEach((i,s)=>{const n=document.createElement("div");n.className="gstop-handle",n.style.left=`${Math.max(0,Math.min(100,i.position))}%`,n.style.top="0%";const o=document.createElement("div");o.className="gstop-chip",o.style.backgroundColor=i.color,n.appendChild(o);let a=!1,l=0,r=0;const h=u=>{a=!0,l=u.clientX,r=this.value.stops[s].position,n.classList.add("selected"),document.addEventListener("mousemove",p),document.addEventListener("mouseup",d),u.preventDefault(),u.stopPropagation()},p=u=>{if(!a||!this.value)return;const m=e.getBoundingClientRect(),f=u.clientX-l;let g=r+f/m.width*100;g=Math.max(0,Math.min(100,g)),this.value.stops[s].position=Math.round(g),n.style.left=`${g}%`,this.updateGradientPreview()},d=()=>{a&&(a=!1,n.classList.remove("selected"),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",d),this.value&&(this.value.stops.sort((u,m)=>u.position-m.position),this.createHandles(t,e),this.updateStopsList()),this.updateUI(),this.triggerChange())};n.addEventListener("mousedown",h),t.appendChild(n)})}updateStopsList(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-stops"));!e||!this.value||this.value.type==="solid"||!this.value.stops||(e.innerHTML="",this.value.stops.forEach((s,n)=>{var N,P;const o=document.createElement("div");o.className="gstop-row";const a=document.createElement("div");a.className="gstop-position-group";const l=document.createElement("input");l.type="text",l.className="gstop-position-input",l.value=`${s.position}%`,l.style.width="60px",a.appendChild(l);const r=document.createElement("div");r.className="gstop-color-container";const h=document.createElement("div");h.className="gstop-color-preview",h.style.backgroundColor=s.color;const p=document.createElement("input");p.type="text",p.className="gstop-color-input",p.value=s.color.replace("#","").toUpperCase();const d=document.createElement("button");d.type="button",d.className="gstop-color-copy",d.textContent="Copy",r.appendChild(h),r.appendChild(p),r.appendChild(d);const u=document.createElement("button");u.type="button",u.className="gstop-del",u.innerHTML=le,u.disabled=(((P=(N=this.value)==null?void 0:N.stops)==null?void 0:P.length)||0)<=2,o.appendChild(a),o.appendChild(r),o.appendChild(u),e.appendChild(o);const m=document.createElement("span");m.className="gstop-opacity-label",m.textContent="Opacity";const f=document.createElement("div");f.className="gstop-opacity-group";const g=document.createElement("input");g.type="range",g.className="gstop-opacity-slider",g.min="0",g.max="100",g.value=String(s.opacity??100);const C=M(s.color);g.style.setProperty("--slider-color",`rgb(${C.r}, ${C.g}, ${C.b})`);const y=document.createElement("span");y.className="gstop-opacity-value",y.textContent=`${s.opacity??100}%`,f.appendChild(g),f.appendChild(y);const L=new re((v,E)=>{p.value=v.replace("#","").toUpperCase(),h.style.backgroundColor=v,this.value.stops[n].color=v,E!==void 0&&(this.value.stops[n].opacity=E,g.value=String(E),y.textContent=`${E}%`);const x=M(v);g.style.setProperty("--slider-color",`rgb(${x.r}, ${x.g}, ${x.b})`),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()},"solid");p.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),L.open(s.color,p,s.opacity??100)}),p.addEventListener("input",()=>{const v=p.value.trim(),E=v.startsWith("#")?v:`#${v}`;if(/^#[0-9A-Fa-f]{6}$/.test(E)){this.value.stops[n].color=E,h.style.backgroundColor=E;const x=M(E);g.style.setProperty("--slider-color",`rgb(${x.r}, ${x.g}, ${x.b})`),this.debouncedPreviewUpdate()}}),p.addEventListener("blur",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),d.addEventListener("click",async v=>{v.stopPropagation();try{await navigator.clipboard.writeText(`#${p.value}`)}catch{}}),l.addEventListener("focus",v=>{const E=v.target;E.value=E.value.replace("%",""),E.select()}),l.addEventListener("input",v=>{const E=v.target,x=parseInt(E.value.replace(/[^\d]/g,""),10);if(!Number.isNaN(x)){const G=Math.max(0,Math.min(100,x));this.value.stops[n].position=G,E.value=`${G}%`,this.debouncedPreviewUpdate()}}),l.addEventListener("blur",v=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const E=v.target,x=parseInt(E.value.replace(/[^\d]/g,""),10);if(Number.isNaN(x))E.value=`${this.value.stops[n].position}%`;else{const G=Math.max(0,Math.min(100,x));this.value.stops[n].position=G,E.value=`${G}%`}this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateUI(),this.triggerChange()}),u.addEventListener("click",()=>{var v;(this.value.stops.length||0)<=2||(this.value.stops.splice(n,1),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateGradientPreview(),this.updateUI(),((v=document.activeElement)==null?void 0:v.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange())}),g.addEventListener("input",()=>{const v=parseInt(g.value,10);this.value.stops[n].opacity=Math.max(0,Math.min(100,v)),y.textContent=`${this.value.stops[n].opacity}%`,this.debouncedPreviewUpdate()}),g.addEventListener("change",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()})}))}addStop(){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const t=this.value.stops.map(o=>o.position).sort((o,a)=>o-a);let e=50,i=0;for(let o=0;o<t.length-1;o++){const a=t[o+1]-t[o];a>i&&(i=a,e=t[o]+a/2)}const s=this.value.stops.reduce((o,a)=>Math.abs(a.position-e)<Math.abs(o.position-e)?a:o),n={position:Math.round(e),color:s.color,opacity:s.opacity??100};this.value.stops.push(n),this.value.stops.sort((o,a)=>o.position-a.position)}openPopover(){if(this.popoverEl&&(T.openInstance&&T.openInstance!==this&&T.openInstance.closePopover(),!this.isPopoverOpen)){if(this.isPopoverOpen=!0,T.openInstance=this,this.backdropEl&&(this.backdropEl.style.display="block",this.backdropEl.parentElement||document.body.appendChild(this.backdropEl)),this.popoverEl.style.display="flex",this.refreshPopoverContent(),this.element){const t=this.element.getBoundingClientRect(),e=306,i=window.innerWidth,s=window.innerHeight,n=16;this.popoverEl.style.position="fixed",this.popoverEl.style.zIndex="10000",this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const o=this.popoverEl.offsetHeight;let a=t.right+8,l=t.top;const r=i-t.right,h=t.left,p=e+n;r<p&&h>r+100&&(a=t.left-e-8);const d=s-t.bottom,u=t.top;u>=o+n?l=t.top-o-8:d>=o+n?l=t.bottom+8:u>d?(l=t.top-o-8,l<n&&(l=n)):(l=t.bottom+8,l+o>s-n&&(l=s-o-n)),this.popoverEl.style.left=`${a}px`,this.popoverEl.style.top=`${l}px`,this.popoverPosition={left:a,top:l}}setTimeout(()=>document.addEventListener("click",this.onBackgroundClick,!0),200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}}repositionPopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen||!this.element)&&((t=document.activeElement)==null?void 0:t.tagName)!=="INPUT"){if(this.popoverPosition){this.popoverEl.style.left=`${this.popoverPosition.left}px`,this.popoverEl.style.top=`${this.popoverPosition.top}px`;return}requestAnimationFrame(()=>{if(!this.popoverEl||!this.element)return;const e=this.element.getBoundingClientRect(),i=306,s=window.innerWidth,n=window.innerHeight,o=16;this.popoverEl.style.left,this.popoverEl.style.top,this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const a=this.popoverEl.offsetHeight;let l=e.right+8,r=e.top;const h=s-e.right,p=e.left,d=i+o;h<d&&p>h+100&&(l=e.left-i-8);const u=n-e.bottom,m=e.top;m>=a+o?r=e.top-a-8:u>=a+o?r=e.bottom+8:m>u?(r=e.top-a-8,r<o&&(r=o)):(r=e.bottom+8,r+a>n-o&&(r=n-a-o)),this.popoverEl.style.left=`${l}px`,this.popoverEl.style.top=`${r}px`})}}refreshPopoverContent(){var n,o;if(!this.popoverEl)return;const t=this.popoverEl.querySelectorAll(".gradient-type-tab");t.forEach(a=>a.classList.remove("active"));const e=t[0],i=t[1];((n=this.value)==null?void 0:n.type)==="solid"?e.classList.add("active"):(i.classList.add("active"),(o=this.recentGradientRefresh)==null||o.call(this)),this.popoverEl.offsetHeight;const s=this.popoverEl.querySelector(".gradient-editor-content");s&&this.updatePopoverContent(s)}closePopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen)){if(this.isPopoverOpen=!1,this.popoverPosition=null,this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl.style.display="none",document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.commitPendingSolidColor(),this.value&&this.value.type!=="solid"){const e=V(this.value);R.addColor(e,"gradient"),(t=this.recentGradientRefresh)==null||t.call(this)}this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),T.openInstance===this&&(T.openInstance=null)}}commitPendingSolidColor(){this.pendingSolidColor&&(this.solidPicker?this.solidPicker.commitRecentColor():R.addColor(this.pendingSolidColor,"solid"),this.pendingSolidColor=null)}handlePaste(t){var i;t.preventDefault();const e=((i=t.clipboardData)==null?void 0:i.getData("text"))||"";this.parseAndSet(e)}handleTextInput(t){const e=t.target;this.parseAndSet(e.value)}parseAndSet(t){const e=O(t.trim());e&&this.setValue(e)}triggerChange(){var t,e;this.value&&((t=this.onChange)==null||t.call(this,this.value),(e=this.detectChange)==null||e.call(this,this.value))}getElement(){return this.element}getValue(){return this.value?V(this.value):""}getCSSValue(){return this.value?V(this.value):""}getCSSForText(){return this.value?this.cssForTextValue():{}}getRawValue(){return this.value}};T.openInstance=null;let j=T;const he=`
|
|
230
230
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
231
231
|
<path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
232
232
|
</svg>
|
|
@@ -284,4 +284,4 @@
|
|
|
284
284
|
opacity: ${e/100};
|
|
285
285
|
`:`
|
|
286
286
|
background-color: ${i};
|
|
287
|
-
`}}exports.AlignSetting=ut;exports.AnimationSetting=Yt;exports.BackgroundSettingSet=we;exports.BorderSettingSet=de;exports.ButtonSetting=Tt;exports.ColorSetting=k;exports.ColorWithOpacitySetting=$;exports.DimensionSetting=
|
|
287
|
+
`}}exports.AlignSetting=ut;exports.AnimationSetting=Yt;exports.BackgroundSettingSet=we;exports.BorderSettingSet=de;exports.ButtonSetting=Tt;exports.ColorSetting=k;exports.ColorWithOpacitySetting=$;exports.DimensionSetting=Ot;exports.GapSetting=qt;exports.GradientSetting=j;exports.HeaderTypographySettingSet=fe;exports.HeightSetting=Dt;exports.HtmlSetting=It;exports.MarginBottomSetting=Jt;exports.MarginSettingGroup=ve;exports.MarginTopSetting=Zt;exports.MultiLanguageSetting=Kt;exports.NumberSetting=S;exports.OpacitySetting=dt;exports.SelectApiSettings=zt;exports.SelectSetting=Z;exports.Setting=b;exports.SettingGroup=I;exports.StringSetting=pt;exports.TabSettingGroup=it;exports.TabsSettingGroup=it;exports.Toggle=Wt;exports.UploadSetting=st;exports.WidthSetting=Ft;exports.asSettingGroupWithSettings=kt;exports.createSettingGroup=ht;exports.createTabSettingGroup=Lt;exports.isSetting=H;exports.isSettingChild=et;exports.isSettingGroup=w;exports.iterateSettings=U;
|
|
@@ -308,14 +308,20 @@ const K = class K {
|
|
|
308
308
|
);
|
|
309
309
|
if (n) {
|
|
310
310
|
const o = Array.from(
|
|
311
|
-
n.querySelectorAll(".setting-group, .setting")
|
|
311
|
+
n.querySelectorAll(".setting-group, .setting, [data-setting-id]")
|
|
312
312
|
);
|
|
313
313
|
for (const a of o) {
|
|
314
|
-
const l = a.id
|
|
314
|
+
const l = a.id, r = a.getAttribute(
|
|
315
|
+
"data-setting-id"
|
|
316
|
+
);
|
|
315
317
|
if (l && "id" in e && typeof e.id == "string" && l.includes(e.id)) {
|
|
316
318
|
a.remove();
|
|
317
319
|
break;
|
|
318
320
|
}
|
|
321
|
+
if (r && "id" in e && typeof e.id == "string" && r === e.id) {
|
|
322
|
+
a.remove();
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
319
325
|
}
|
|
320
326
|
}
|
|
321
327
|
}
|
|
@@ -326,6 +332,18 @@ const K = class K {
|
|
|
326
332
|
updateVisibility() {
|
|
327
333
|
this.elementRef;
|
|
328
334
|
}
|
|
335
|
+
updateSettings(t) {
|
|
336
|
+
var n;
|
|
337
|
+
const e = new Set(Object.keys(this.settings)), i = Object.keys(t);
|
|
338
|
+
e.forEach((o) => {
|
|
339
|
+
i.includes(o) || this.removeSetting(o);
|
|
340
|
+
}), i.forEach((o) => {
|
|
341
|
+
const a = t[o], l = this.settings[o];
|
|
342
|
+
l !== a && (l && this.removeSetting(o), this.addSetting(o, a));
|
|
343
|
+
}), this.settings = t, this.propagateNestingLevel(), this.propagateDataPropsPath();
|
|
344
|
+
const s = this.getValues();
|
|
345
|
+
this.initialValues = s, (n = this.onChange) == null || n.call(this, s);
|
|
346
|
+
}
|
|
329
347
|
clone() {
|
|
330
348
|
const t = {};
|
|
331
349
|
W(this.settings, (s, n) => {
|
|
@@ -1568,7 +1586,7 @@ const It = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
|
|
|
1568
1586
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
|
|
1569
1587
|
<path d="M8 3V2.6C8 2.03995 8 1.75992 7.89101 1.54601C7.79513 1.35785 7.64215 1.20487 7.45399 1.10899C7.24008 1 6.96005 1 6.4 1H5.6C5.03995 1 4.75992 1 4.54601 1.10899C4.35785 1.20487 4.20487 1.35785 4.10899 1.54601C4 1.75992 4 2.03995 4 2.6V3M5 5.75V8.25M7 5.75V8.25M1.5 3H10.5M9.5 3V8.6C9.5 9.44008 9.5 9.86012 9.33651 10.181C9.1927 10.4632 8.96323 10.6927 8.68099 10.8365C8.36012 11 7.94008 11 7.1 11H4.9C4.05992 11 3.63988 11 3.31901 10.8365C3.03677 10.6927 2.8073 10.4632 2.66349 10.181C2.5 9.86012 2.5 9.44008 2.5 8.6V3" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1570
1588
|
</svg>
|
|
1571
|
-
`,
|
|
1589
|
+
`, Ot = `
|
|
1572
1590
|
<svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
|
|
1573
1591
|
<!-- Top dot -->
|
|
1574
1592
|
<circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
|
|
@@ -1685,7 +1703,7 @@ class rt extends b {
|
|
|
1685
1703
|
const s = this.value && this.value !== "";
|
|
1686
1704
|
s || i.classList.add("no-image");
|
|
1687
1705
|
const n = document.createElement("div");
|
|
1688
|
-
if (n.className = "preview-placeholder", n.innerHTML = Vt, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML =
|
|
1706
|
+
if (n.className = "preview-placeholder", n.innerHTML = Vt, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = Ot, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
|
|
1689
1707
|
const a = document.createElement("button");
|
|
1690
1708
|
a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Tt, this.previewWrapper.appendChild(a), a.onclick = (l) => {
|
|
1691
1709
|
var r;
|
|
@@ -1715,7 +1733,7 @@ class he extends S {
|
|
|
1715
1733
|
title: t.title || "Height",
|
|
1716
1734
|
suffix: t.suffix || "px",
|
|
1717
1735
|
minValue: t.minValue ?? 0,
|
|
1718
|
-
icon: t.icon ||
|
|
1736
|
+
icon: t.icon || Pt,
|
|
1719
1737
|
default: t.default ?? 100
|
|
1720
1738
|
}), this.inputType = "number", this.mobileValue = t.mobile;
|
|
1721
1739
|
}
|
|
@@ -1726,7 +1744,7 @@ class he extends S {
|
|
|
1726
1744
|
this.mobileValue = t, t !== void 0 && this.setValue(t);
|
|
1727
1745
|
}
|
|
1728
1746
|
}
|
|
1729
|
-
const
|
|
1747
|
+
const Pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
|
|
1730
1748
|
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1731
1749
|
</svg>`;
|
|
1732
1750
|
class pe extends S {
|
|
@@ -1856,19 +1874,11 @@ class de extends b {
|
|
|
1856
1874
|
return JSON.stringify(t ? {} : { value: this.value }, null, 2);
|
|
1857
1875
|
}
|
|
1858
1876
|
selectApiOption(t, e, i) {
|
|
1859
|
-
var l, r
|
|
1860
|
-
const s = t.target, n = s.querySelector(".select-api-radio") || ((
|
|
1861
|
-
n && (n.checked = !0)
|
|
1877
|
+
var a, l, r;
|
|
1878
|
+
const s = t.target, n = s.querySelector(".select-api-radio") || ((a = s.closest(".select-api-option")) == null ? void 0 : a.querySelector(".select-api-radio"));
|
|
1879
|
+
n && (n.checked = !0);
|
|
1862
1880
|
const o = this._options[e].value;
|
|
1863
|
-
this.
|
|
1864
|
-
const a = i.querySelector(".select-value");
|
|
1865
|
-
if (a)
|
|
1866
|
-
a.textContent = this._options[e].name;
|
|
1867
|
-
else {
|
|
1868
|
-
const d = i.firstChild;
|
|
1869
|
-
d && d.tagName === "SPAN" && (d.textContent = this._options[e].name);
|
|
1870
|
-
}
|
|
1871
|
-
this.isOpen = !1, (r = this.optionsListEl) == null || r.classList.remove("open"), (h = this.svgContainer) == null || h.classList.remove("open"), (p = this.onChange) == null || p.call(this, o), this.detectChangeCallback && this.detectChangeCallback(o);
|
|
1881
|
+
this.setValue(o), this.isOpen = !1, (l = this.optionsListEl) == null || l.classList.remove("open"), (r = this.svgContainer) == null || r.classList.remove("open");
|
|
1872
1882
|
}
|
|
1873
1883
|
updateOptionsList() {
|
|
1874
1884
|
!this.optionsListEl || !this.buttonEl || (this.optionsListEl.innerHTML = "", this._options.forEach((t, e) => {
|
|
@@ -1892,13 +1902,23 @@ class de extends b {
|
|
|
1892
1902
|
i.textContent = t || n, this.buttonEl.classList.remove("error"), this.buttonEl.removeAttribute("disabled"), this.svgContainer && (this.svgContainer.style.display = "");
|
|
1893
1903
|
}
|
|
1894
1904
|
}
|
|
1905
|
+
update(t = !1) {
|
|
1906
|
+
var e;
|
|
1907
|
+
if (this.selectedOptionIndex = this.value !== void 0 ? this._options.findIndex(
|
|
1908
|
+
(i) => JSON.stringify(i.value) === JSON.stringify(this.value)
|
|
1909
|
+
) : null, this.updateOptionsList(), this.updateButtonText(), t && this.value !== void 0) {
|
|
1910
|
+
(e = this.onChange) == null || e.call(this, this.value);
|
|
1911
|
+
const i = this.props.detectChange || this.detectChangeCallback;
|
|
1912
|
+
i == null || i(this.value);
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1895
1915
|
setDetectChange(t) {
|
|
1896
|
-
this.detectChangeCallback = t;
|
|
1916
|
+
this.detectChangeCallback = t, this.props.detectChange = t;
|
|
1897
1917
|
}
|
|
1898
1918
|
setValue(t) {
|
|
1899
|
-
|
|
1919
|
+
super.setValue(t), this.selectedOptionIndex = this._options.findIndex(
|
|
1900
1920
|
(e) => JSON.stringify(e.value) === JSON.stringify(t)
|
|
1901
|
-
), this.updateButtonText();
|
|
1921
|
+
), this.updateButtonText(), this.updateOptionsList(), this.detectChangeCallback && this.detectChangeCallback !== this.props.detectChange && this.detectChangeCallback(t);
|
|
1902
1922
|
}
|
|
1903
1923
|
}
|
|
1904
1924
|
class ue extends b {
|
|
@@ -2433,7 +2453,7 @@ const ct = (c, t, e) => {
|
|
|
2433
2453
|
opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
|
|
2434
2454
|
}))
|
|
2435
2455
|
};
|
|
2436
|
-
},
|
|
2456
|
+
}, O = (c) => {
|
|
2437
2457
|
const t = c.replace(/;$/, "").trim();
|
|
2438
2458
|
if (Ut(t)) {
|
|
2439
2459
|
const s = dt(t);
|
|
@@ -2501,7 +2521,7 @@ const ct = (c, t, e) => {
|
|
|
2501
2521
|
const e = /* @__PURE__ */ new Set(), i = [];
|
|
2502
2522
|
return t.forEach((s) => {
|
|
2503
2523
|
let n = A(s);
|
|
2504
|
-
n ||
|
|
2524
|
+
n || O(s) && (n = s), n && (e.has(n) || (e.add(n), i.push(n)));
|
|
2505
2525
|
}), i.slice(0, this.MAX_COLORS);
|
|
2506
2526
|
}
|
|
2507
2527
|
static ensureLoaded() {
|
|
@@ -2548,7 +2568,7 @@ const ct = (c, t, e) => {
|
|
|
2548
2568
|
if (i)
|
|
2549
2569
|
s = "solid";
|
|
2550
2570
|
else {
|
|
2551
|
-
const l =
|
|
2571
|
+
const l = O(t);
|
|
2552
2572
|
l && (i = t, s = l.type === "solid" ? "solid" : "gradient");
|
|
2553
2573
|
}
|
|
2554
2574
|
if (!i) return;
|
|
@@ -2598,7 +2618,7 @@ const et = (c, t) => {
|
|
|
2598
2618
|
};
|
|
2599
2619
|
return o(), { container: e, refresh: o };
|
|
2600
2620
|
}, Wt = (c) => {
|
|
2601
|
-
const t =
|
|
2621
|
+
const t = O(c);
|
|
2602
2622
|
if (t)
|
|
2603
2623
|
return _(t);
|
|
2604
2624
|
const e = A(c);
|
|
@@ -2688,10 +2708,10 @@ class Jt {
|
|
|
2688
2708
|
L.value = "hsl", L.textContent = "HSL", g.appendChild(C), g.appendChild(y), g.appendChild(L);
|
|
2689
2709
|
const I = document.createElement("input");
|
|
2690
2710
|
I.type = "text", I.className = "color-picker-color-input", I.value = this.currentColor, this.input = I;
|
|
2691
|
-
const
|
|
2692
|
-
|
|
2711
|
+
const P = document.createElement("div");
|
|
2712
|
+
P.className = "color-picker-input-container";
|
|
2693
2713
|
const v = document.createElement("button");
|
|
2694
|
-
return v.className = "color-picker-copy-inside", v.textContent = "Copy",
|
|
2714
|
+
return v.className = "color-picker-copy-inside", v.textContent = "Copy", P.appendChild(I), P.appendChild(v), f.appendChild(g), f.appendChild(P), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(m.container), t.appendChild(f), t.addEventListener("click", (E) => E.stopPropagation()), this.bind(n, h, d, I, g, v, l), t;
|
|
2695
2715
|
}
|
|
2696
2716
|
createBackdrop() {
|
|
2697
2717
|
const t = document.createElement("div");
|
|
@@ -3101,7 +3121,7 @@ const V = class V extends b {
|
|
|
3101
3121
|
defaultValue() {
|
|
3102
3122
|
const t = this.originalDefault;
|
|
3103
3123
|
if (typeof t == "string") {
|
|
3104
|
-
const i =
|
|
3124
|
+
const i = O(t);
|
|
3105
3125
|
if (i)
|
|
3106
3126
|
return $(i);
|
|
3107
3127
|
}
|
|
@@ -3117,7 +3137,7 @@ const V = class V extends b {
|
|
|
3117
3137
|
setValue(t) {
|
|
3118
3138
|
var i, s;
|
|
3119
3139
|
let e = null;
|
|
3120
|
-
typeof t == "string" ? e =
|
|
3140
|
+
typeof t == "string" ? e = O(t) : t && typeof t == "object" && (e = $(t)), e || (e = this.defaultValue()), this.value = e, this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent(), (i = this.onChange) == null || i.call(this, this.value), (s = this.detectChange) == null || s.call(this, this.value), this.pendingSolidColor = null;
|
|
3121
3141
|
}
|
|
3122
3142
|
updateUI() {
|
|
3123
3143
|
if (this.previewEl && this.value)
|
|
@@ -3232,7 +3252,7 @@ const V = class V extends b {
|
|
|
3232
3252
|
initialOpacity: e.opacity ?? 100,
|
|
3233
3253
|
onColorChange: (s, n) => {
|
|
3234
3254
|
if (this.value) {
|
|
3235
|
-
const o =
|
|
3255
|
+
const o = O(s);
|
|
3236
3256
|
if (o && o.type !== "solid") {
|
|
3237
3257
|
this.value = o, this.switchType(o.type);
|
|
3238
3258
|
return;
|
|
@@ -3288,7 +3308,7 @@ const V = class V extends b {
|
|
|
3288
3308
|
const u = document.createElement("div");
|
|
3289
3309
|
u.className = "gradient-stops", t.appendChild(h), t.appendChild(u), this.updateStopsList(u);
|
|
3290
3310
|
const m = et((f) => {
|
|
3291
|
-
const g =
|
|
3311
|
+
const g = O(f);
|
|
3292
3312
|
g && (this.value = g, this.switchType(g.type), this.updateUI(), this.triggerChange());
|
|
3293
3313
|
}, "all");
|
|
3294
3314
|
this.recentGradientRefresh = m.refresh, t.appendChild(m.container), d.addEventListener("click", () => {
|
|
@@ -3334,7 +3354,7 @@ const V = class V extends b {
|
|
|
3334
3354
|
var i;
|
|
3335
3355
|
const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-stops"));
|
|
3336
3356
|
!e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
|
|
3337
|
-
var I,
|
|
3357
|
+
var I, P;
|
|
3338
3358
|
const o = document.createElement("div");
|
|
3339
3359
|
o.className = "gstop-row";
|
|
3340
3360
|
const a = document.createElement("div");
|
|
@@ -3350,7 +3370,7 @@ const V = class V extends b {
|
|
|
3350
3370
|
const d = document.createElement("button");
|
|
3351
3371
|
d.type = "button", d.className = "gstop-color-copy", d.textContent = "Copy", r.appendChild(h), r.appendChild(p), r.appendChild(d);
|
|
3352
3372
|
const u = document.createElement("button");
|
|
3353
|
-
u.type = "button", u.className = "gstop-del", u.innerHTML = _t, u.disabled = (((
|
|
3373
|
+
u.type = "button", u.className = "gstop-del", u.innerHTML = _t, u.disabled = (((P = (I = this.value) == null ? void 0 : I.stops) == null ? void 0 : P.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(u), e.appendChild(o);
|
|
3354
3374
|
const m = document.createElement("span");
|
|
3355
3375
|
m.className = "gstop-opacity-label", m.textContent = "Opacity";
|
|
3356
3376
|
const f = document.createElement("div");
|
|
@@ -3520,7 +3540,7 @@ const V = class V extends b {
|
|
|
3520
3540
|
this.parseAndSet(e.value);
|
|
3521
3541
|
}
|
|
3522
3542
|
parseAndSet(t) {
|
|
3523
|
-
const e =
|
|
3543
|
+
const e = O(t.trim());
|
|
3524
3544
|
e && this.setValue(e);
|
|
3525
3545
|
}
|
|
3526
3546
|
triggerChange() {
|
package/dist/chevron-down.svg
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g id="chevron-down">
|
|
3
|
-
<path id="Icon" d="M4 6.5L8 10.5L12 6.5" stroke="#344054" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
-
</g>
|
|
5
|
-
</svg>
|
|
1
|
+
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id="chevron-down">
|
|
3
|
+
<path id="Icon" d="M4 6.5L8 10.5L12 6.5" stroke="#344054" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
package/dist/colors.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/margins-bottom.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/margins-left.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/margins-right.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/margins-top.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/radius.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -33,6 +33,7 @@ export declare class SelectApiSettings<T = SettingsMap> extends Setting<T, Selec
|
|
|
33
33
|
private selectApiOption;
|
|
34
34
|
private updateOptionsList;
|
|
35
35
|
private updateButtonText;
|
|
36
|
+
update(fireCallbacks?: boolean): void;
|
|
36
37
|
setDetectChange(callback: (value: T | undefined) => void): void;
|
|
37
38
|
setValue(value: T): void;
|
|
38
39
|
}
|
package/dist/spacing-height.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/dist/spacing-width.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<defs>
|
|
3
|
-
<pattern id="checkerboard" x="0" y="0" width="10" height="10" patternUnits="userSpaceOnUse">
|
|
4
|
-
<rect x="0" y="0" width="5" height="5" fill="rgba(0,0,0,0.1)"/>
|
|
5
|
-
<rect x="5" y="5" width="5" height="5" fill="rgba(0,0,0,0.1)"/>
|
|
6
|
-
<rect x="5" y="0" width="5" height="5" fill="transparent"/>
|
|
7
|
-
<rect x="0" y="5" width="5" height="5" fill="transparent"/>
|
|
8
|
-
</pattern>
|
|
9
|
-
</defs>
|
|
10
|
-
<rect width="20" height="20" fill="url(#checkerboard)"/>
|
|
11
|
-
</svg>
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<pattern id="checkerboard" x="0" y="0" width="10" height="10" patternUnits="userSpaceOnUse">
|
|
4
|
+
<rect x="0" y="0" width="5" height="5" fill="rgba(0,0,0,0.1)"/>
|
|
5
|
+
<rect x="5" y="5" width="5" height="5" fill="rgba(0,0,0,0.1)"/>
|
|
6
|
+
<rect x="5" y="0" width="5" height="5" fill="transparent"/>
|
|
7
|
+
<rect x="0" y="5" width="5" height="5" fill="transparent"/>
|
|
8
|
+
</pattern>
|
|
9
|
+
</defs>
|
|
10
|
+
<rect width="20" height="20" fill="url(#checkerboard)"/>
|
|
11
|
+
</svg>
|
package/package.json
CHANGED