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