@saasquatch/squatch-js 2.8.2-23 → 2.8.2-25

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.
@@ -1860,6 +1860,348 @@ function _getAutoConfig() {
1860
1860
  }
1861
1861
  };
1862
1862
  }
1863
+ const getSkeleton = ({
1864
+ height = "500px",
1865
+ skeletonBackgroundColor = "#e0e0e0",
1866
+ skeletonShimmerColor = "#f5f5f5",
1867
+ borderColor = "#ccc"
1868
+ }) => {
1869
+ return `
1870
+ <style>
1871
+ * {
1872
+ box-sizing: border-box;
1873
+ padding: 0;
1874
+ margin: 0;
1875
+ }
1876
+
1877
+ .widget-container {
1878
+ background: white;
1879
+ width: 100%;
1880
+ padding: 40px;
1881
+ box-sizing: border-box;
1882
+ }
1883
+
1884
+ @keyframes shimmer {
1885
+ 0% {
1886
+ background-position: -100% 0;
1887
+ }
1888
+ 100% {
1889
+ background-position: 100% 0;
1890
+ }
1891
+ }
1892
+
1893
+ .skeleton {
1894
+ background: ${skeletonBackgroundColor};
1895
+ background: linear-gradient(
1896
+ 90deg,
1897
+ ${skeletonBackgroundColor} 25%,
1898
+ ${skeletonShimmerColor} 50%,
1899
+ ${skeletonBackgroundColor} 75%
1900
+ );
1901
+ background-size: 200% 100%;
1902
+ animation: shimmer 1.5s infinite linear;
1903
+ border-radius: 6px;
1904
+ margin-bottom: 12px;
1905
+ }
1906
+
1907
+ .sk-title-lg {
1908
+ height: 36px;
1909
+ width: 50%;
1910
+ margin-bottom: 16px;
1911
+ }
1912
+ .sk-title-md {
1913
+ height: 28px;
1914
+ width: 30%;
1915
+ margin-bottom: 20px;
1916
+ margin-top: 40px;
1917
+ }
1918
+ .sk-text {
1919
+ height: 16px;
1920
+ width: 80%;
1921
+ margin-bottom: 8px;
1922
+ }
1923
+ .sk-text-short {
1924
+ width: 40%;
1925
+ }
1926
+ .sk-label {
1927
+ height: 14px;
1928
+ width: 25%;
1929
+ margin-bottom: 10px;
1930
+ }
1931
+
1932
+ .hero-section {
1933
+ display: flex;
1934
+ gap: 40px;
1935
+ margin-bottom: 40px;
1936
+ border-bottom: 1px solid ${borderColor};
1937
+ padding-bottom: 40px;
1938
+ flex-direction: row;
1939
+ }
1940
+ .hero-content {
1941
+ flex: 1;
1942
+ display: flex;
1943
+ flex-direction: column;
1944
+ justify-content: center;
1945
+ }
1946
+ .hero-image {
1947
+ flex: 1;
1948
+ height: 300px;
1949
+ border-radius: 12px;
1950
+ }
1951
+
1952
+ .share-section {
1953
+ margin-bottom: 40px;
1954
+ }
1955
+ .sk-input {
1956
+ height: 50px;
1957
+ width: 100%;
1958
+ border-radius: 8px;
1959
+ margin-bottom: 16px;
1960
+ }
1961
+ .social-buttons {
1962
+ display: flex;
1963
+ gap: 12px;
1964
+ }
1965
+ .sk-btn-social {
1966
+ flex: 1;
1967
+ height: 50px;
1968
+ border-radius: 8px;
1969
+ }
1970
+
1971
+ .stats-section {
1972
+ display: flex;
1973
+ gap: 24px;
1974
+ margin-bottom: 40px;
1975
+ padding: 30px 0;
1976
+ border-top: 1px solid ${borderColor};
1977
+ border-bottom: 1px solid ${borderColor};
1978
+ }
1979
+ .stat-card {
1980
+ flex: 1;
1981
+ display: flex;
1982
+ flex-direction: column;
1983
+ align-items: center;
1984
+ }
1985
+ .stat-divider {
1986
+ padding-left: 24px;
1987
+ }
1988
+
1989
+ .sk-stat-num {
1990
+ height: 48px;
1991
+ width: 120px;
1992
+ margin-bottom: 8px;
1993
+ }
1994
+ .sk-stat-label {
1995
+ height: 18px;
1996
+ width: 80px;
1997
+ }
1998
+
1999
+ .table-header {
2000
+ display: flex;
2001
+ gap: 16px;
2002
+ margin-bottom: 16px;
2003
+ }
2004
+ .sk-th {
2005
+ height: 16px;
2006
+ }
2007
+ .table-row {
2008
+ display: flex;
2009
+ align-items: center;
2010
+ gap: 16px;
2011
+ padding: 16px 0;
2012
+ border-bottom: 1px solid ${borderColor};
2013
+ }
2014
+
2015
+ .col-user {
2016
+ flex: 2;
2017
+ }
2018
+ .col-status {
2019
+ flex: 1;
2020
+ }
2021
+ .col-reward {
2022
+ flex: 2;
2023
+ }
2024
+ .col-date {
2025
+ flex: 1;
2026
+ }
2027
+
2028
+ .sk-badge {
2029
+ height: 28px;
2030
+ width: 90px;
2031
+ border-radius: 14px;
2032
+ }
2033
+ .sk-reward-block {
2034
+ height: 36px;
2035
+ width: 100%;
2036
+ border-radius: 6px;
2037
+ }
2038
+
2039
+ .pagination {
2040
+ display: flex;
2041
+ justify-content: flex-end;
2042
+ gap: 8px;
2043
+ margin-top: 24px;
2044
+ }
2045
+ .sk-btn-page {
2046
+ height: 36px;
2047
+ width: 64px;
2048
+ border-radius: 6px;
2049
+ margin-bottom: 0;
2050
+ }
2051
+
2052
+ @media (max-width: 768px) {
2053
+ body {
2054
+ padding: 20px;
2055
+ }
2056
+ .widget-container {
2057
+ padding: 24px;
2058
+ }
2059
+
2060
+ .hero-section {
2061
+ flex-direction: column-reverse;
2062
+ gap: 24px;
2063
+ }
2064
+ .hero-image {
2065
+ height: 220px;
2066
+ width: 100%;
2067
+ }
2068
+ .sk-title-lg {
2069
+ width: 80%;
2070
+ }
2071
+
2072
+ .col-date {
2073
+ display: none;
2074
+ }
2075
+ }
2076
+
2077
+ @media (max-width: 480px) {
2078
+ body {
2079
+ padding: 10px;
2080
+ }
2081
+ .widget-container {
2082
+ padding: 16px;
2083
+ }
2084
+
2085
+ .sk-stat-num {
2086
+ width: 80px;
2087
+ height: 40px;
2088
+ }
2089
+
2090
+ .col-reward {
2091
+ display: none;
2092
+ }
2093
+
2094
+ .col-user {
2095
+ flex: 3;
2096
+ }
2097
+ .col-status {
2098
+ flex: 2;
2099
+ display: flex;
2100
+ justify-content: flex-end;
2101
+ }
2102
+ }
2103
+ </style>
2104
+
2105
+ <div class="widget-container">
2106
+ <div class="hero-section">
2107
+ <div class="hero-content">
2108
+ <div class="skeleton sk-title-lg"></div>
2109
+ <div class="skeleton sk-text"></div>
2110
+ <div class="skeleton sk-text sk-text-short"></div>
2111
+ </div>
2112
+ <div class="skeleton hero-image"></div>
2113
+ </div>
2114
+
2115
+ <div class="share-section">
2116
+ <div class="skeleton sk-label"></div>
2117
+ <div class="skeleton sk-input"></div>
2118
+ <div class="social-buttons">
2119
+ <div class="skeleton sk-btn-social"></div>
2120
+ <div class="skeleton sk-btn-social"></div>
2121
+ <div class="skeleton sk-btn-social"></div>
2122
+ <div class="skeleton sk-btn-social"></div>
2123
+ </div>
2124
+ </div>
2125
+
2126
+ <div
2127
+ class="skeleton sk-title-md"
2128
+ style="margin-top: 0; width: 30%; margin-left: auto; margin-right: auto"
2129
+ ></div>
2130
+ <div
2131
+ class="skeleton sk-text"
2132
+ style="width: 60%; margin-left: auto; margin-right: auto"
2133
+ ></div>
2134
+
2135
+ <div class="stats-section">
2136
+ <div class="stat-card">
2137
+ <div class="skeleton sk-stat-num"></div>
2138
+ <div class="skeleton sk-stat-label"></div>
2139
+ </div>
2140
+ <div class="stat-card stat-divider">
2141
+ <div class="skeleton sk-stat-num"></div>
2142
+ <div class="skeleton sk-stat-label"></div>
2143
+ </div>
2144
+ </div>
2145
+
2146
+ <div class="skeleton sk-title-md"></div>
2147
+
2148
+ <div class="table-header">
2149
+ <div class="skeleton sk-th col-user"></div>
2150
+ <div class="skeleton sk-th col-status"></div>
2151
+ <div class="skeleton sk-th col-reward"></div>
2152
+ <div class="skeleton sk-th col-date"></div>
2153
+ </div>
2154
+
2155
+ <div class="table-row">
2156
+ <div class="col-user">
2157
+ <div class="skeleton sk-text" style="width: 70%; margin: 0"></div>
2158
+ </div>
2159
+ <div class="col-status">
2160
+ <div class="skeleton sk-badge" style="margin: 0"></div>
2161
+ </div>
2162
+ <div class="col-reward">
2163
+ <div class="skeleton sk-reward-block" style="margin: 0"></div>
2164
+ </div>
2165
+ <div class="col-date">
2166
+ <div class="skeleton sk-text" style="width: 80%; margin: 0"></div>
2167
+ </div>
2168
+ </div>
2169
+ <div class="table-row">
2170
+ <div class="col-user">
2171
+ <div class="skeleton sk-text" style="width: 60%; margin: 0"></div>
2172
+ </div>
2173
+ <div class="col-status">
2174
+ <div class="skeleton sk-badge" style="margin: 0"></div>
2175
+ </div>
2176
+ <div class="col-reward">
2177
+ <div class="skeleton sk-reward-block" style="margin: 0"></div>
2178
+ </div>
2179
+ <div class="col-date">
2180
+ <div class="skeleton sk-text" style="width: 80%; margin: 0"></div>
2181
+ </div>
2182
+ </div>
2183
+ <div class="table-row">
2184
+ <div class="col-user">
2185
+ <div class="skeleton sk-text" style="width: 75%; margin: 0"></div>
2186
+ </div>
2187
+ <div class="col-status">
2188
+ <div class="skeleton sk-badge" style="margin: 0"></div>
2189
+ </div>
2190
+ <div class="col-reward">
2191
+ <div class="skeleton sk-reward-block" style="margin: 0"></div>
2192
+ </div>
2193
+ <div class="col-date">
2194
+ <div class="skeleton sk-text" style="width: 80%; margin: 0"></div>
2195
+ </div>
2196
+ </div>
2197
+
2198
+ <div class="pagination">
2199
+ <div class="skeleton sk-btn-page"></div>
2200
+ <div class="skeleton sk-btn-page"></div>
2201
+ </div>
2202
+ </div>
2203
+ `;
2204
+ };
1863
2205
  const _log$2 = browserExports.debug("squatch-js:decodeUserJwt");
1864
2206
  function decodeUserJwt(tokenStr) {
1865
2207
  var _a2;
@@ -2095,11 +2437,7 @@ class DeclarativeEmbedWidget extends DeclarativeWidget {
2095
2437
  async connectedCallback() {
2096
2438
  this.loaded = true;
2097
2439
  this.container = this.getAttribute("container");
2098
- const skeletonHTML = `
2099
- <div>
2100
- <h1>Do I see this text ????</h1>
2101
- </div>
2102
- `;
2440
+ const skeletonHTML = getSkeleton({ height: "100%" });
2103
2441
  const skeletonContainer = document.createElement("div");
2104
2442
  skeletonContainer.id = "loading-skeleton";
2105
2443
  skeletonContainer.innerHTML = skeletonHTML;