@bynder/compact-view 5.2.3 → 5.2.4

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.
Files changed (253) hide show
  1. package/AccessToken2.js +1 -1
  2. package/ActiveFilters.js +49 -50
  3. package/AddMedia.js +19 -18
  4. package/Advanced.js +13 -13
  5. package/App.js +60 -59
  6. package/Arrow.js +1 -1
  7. package/AssetFilter.js +38 -38
  8. package/AssetItem.js +10 -17
  9. package/AssetList.js +5 -5
  10. package/AssetTypeItem.js +21 -21
  11. package/AssetsView.js +13 -13
  12. package/Axios2.js +82 -76
  13. package/AxiosError.js +36 -35
  14. package/ButtonAction.js +1 -1
  15. package/CanceledError.js +15 -8
  16. package/Card.js +1 -1
  17. package/Chip.js +1 -1
  18. package/CollectionCard.js +22 -22
  19. package/CollectionItem.js +9 -9
  20. package/CollectionList.js +5 -5
  21. package/CollectionView.js +11 -11
  22. package/ColorPicker.js +1 -1
  23. package/ColorPickerSolid.js +3 -3
  24. package/ColorPickerWithOpacity.js +3 -3
  25. package/Component.js +158 -0
  26. package/Component2.js +4 -0
  27. package/ConfigContext.js +7 -8
  28. package/Container.js +1 -1
  29. package/ContextAction.js +1 -1
  30. package/ControlGroup.js +6 -6
  31. package/Dat.js +33 -32
  32. package/DatDropdownItem.js +1 -1
  33. package/DesignSystemProvider.js +7 -7
  34. package/DirectionSelect.js +11 -10
  35. package/DomainInput.js +19 -11
  36. package/Draggable.js +337 -0
  37. package/Draggable2.js +4 -0
  38. package/DraggableCore.js +312 -0
  39. package/DraggableCore2.js +4 -0
  40. package/Dropdown.js +37 -37
  41. package/Dropdown2.js +1 -1
  42. package/DropdownListItem.js +1 -1
  43. package/FieldSelect.js +19 -17
  44. package/FileSelector.js +38 -37
  45. package/FontPicker.js +1 -1
  46. package/Form.js +1 -1
  47. package/Header.js +5 -4
  48. package/HttpStatusCode.js +7 -1
  49. package/InfiniteScroll.js +1 -1
  50. package/InlineBanner.js +1 -1
  51. package/Input.js +1 -1
  52. package/InterceptorManager.js +2 -1
  53. package/Item.js +8 -8
  54. package/Item4.js +2 -2
  55. package/LeftArrow.js +1 -1
  56. package/ListItem2.js +1 -1
  57. package/ModalBase.js +15 -15
  58. package/NoResults.js +1 -1
  59. package/Option_new.js +36 -29
  60. package/ReactPropTypesSecret.js +10 -0
  61. package/RightArrow.js +1 -1
  62. package/SearchInput.js +1 -1
  63. package/SearchInput2.js +1 -1
  64. package/SelectionFooter.js +41 -31
  65. package/Shield.js +2 -2
  66. package/Smartfilters_new.js +107 -98
  67. package/StatefulAssetList.js +50 -50
  68. package/StoreInitializer.js +32 -16
  69. package/SwitchNLS.js +1 -1
  70. package/TagItem.js +15 -15
  71. package/Tags.js +1 -1
  72. package/Toolbar.js +23 -20
  73. package/Tooltip2.js +1 -1
  74. package/ViewSwitch.js +17 -15
  75. package/_commonjsHelpers.js +28 -3
  76. package/adapters.js +54 -42
  77. package/api/filterAssets.d.ts +1 -1
  78. package/api/getAssets.d.ts +1 -1
  79. package/api/getFilters.d.ts +1 -1
  80. package/api/rest/index.d.ts +1 -1
  81. package/api/rest/types.d.ts +1 -1
  82. package/api2.js +1 -1
  83. package/asset.type.js +1 -1
  84. package/autocomplete.js +1 -1
  85. package/axios.js +1 -1
  86. package/bodyScrollLock.esm.js +68 -0
  87. package/buildURL.js +13 -15
  88. package/checkGlobals.js +1 -1
  89. package/cjs.js +7 -0
  90. package/cjs2.js +15 -0
  91. package/cjs3.js +4 -0
  92. package/clsx.m.js +6 -0
  93. package/clsx.m2.js +15 -0
  94. package/combineMetaproperties.js +3 -1
  95. package/composeSignals.js +1 -1
  96. package/cookieStore.js +1 -1
  97. package/cookies.js +13 -11
  98. package/currentScopes.js +1 -1
  99. package/data.js +1 -1
  100. package/devUtils.js +1 -1
  101. package/dispatchRequest.js +5 -5
  102. package/domFns.js +151 -0
  103. package/domFns2.js +4 -0
  104. package/factoryWithThrowingShims.js +52 -0
  105. package/fetch2.js +156 -128
  106. package/filter/AssetFilterContext.d.ts +3 -3
  107. package/filterAssets.js +1 -1
  108. package/getAsset.js +1 -1
  109. package/getAssetCounts.js +1 -1
  110. package/getAssets.js +1 -1
  111. package/getCollections.js +1 -1
  112. package/getFilterOptions.js +1 -1
  113. package/getFilters.js +1 -1
  114. package/getFilters_new.js +1 -1
  115. package/getPrefix.js +35 -0
  116. package/getPrefix2.js +4 -0
  117. package/getSimilarityAssets.js +1 -1
  118. package/goober.modern.js +75 -0
  119. package/handlers.js +1 -1
  120. package/iconBase.js +56 -0
  121. package/iconContext.js +12 -0
  122. package/iconsManifest.js +222 -0
  123. package/index-esm.js +1 -4
  124. package/index.browser.js +1 -1
  125. package/index.m.js +9 -0
  126. package/index.m2.js +17 -0
  127. package/index10.js +18 -2
  128. package/index11.js +181 -15
  129. package/index112.js +1 -1
  130. package/index12.js +313 -36
  131. package/index13.js +5 -2430
  132. package/index14.js +3 -557
  133. package/index15.js +15 -55
  134. package/index16.js +3 -2
  135. package/index17.js +3 -87
  136. package/index18.js +36 -60
  137. package/index19.js +3 -7
  138. package/index20.js +2429 -12
  139. package/index21.js +557 -10
  140. package/index22.js +1 -1
  141. package/index23.js +119 -6
  142. package/index24.js +39 -7
  143. package/index25.js +2 -5
  144. package/index26.js +86 -9
  145. package/index27.js +55 -8
  146. package/index28.js +6 -636
  147. package/index29.js +8692 -74
  148. package/index3.js +1684 -5
  149. package/index30.js +2 -5
  150. package/index31.js +4 -20
  151. package/index310.js +2 -0
  152. package/index32.js +11 -2
  153. package/index33.js +5083 -4
  154. package/index34.js +2 -18
  155. package/index35.js +59 -5
  156. package/index36.js +2 -2
  157. package/index37.js +13 -11
  158. package/index38.js +46 -10
  159. package/index39.js +6 -12
  160. package/index4.js +5 -1684
  161. package/index40.js +8 -11
  162. package/index41.js +26 -18
  163. package/index42.js +2 -64
  164. package/index43.js +63 -5
  165. package/index44.js +9 -55
  166. package/index45.js +7 -67
  167. package/index46.js +8 -31
  168. package/index47.js +5 -11
  169. package/index48.js +10 -121
  170. package/index49.js +9 -86
  171. package/index5.js +215 -23
  172. package/index50.js +636 -7
  173. package/index51.js +74 -11
  174. package/index52.js +4 -13
  175. package/index53.js +19 -13
  176. package/index54.js +4 -6
  177. package/index55.js +18 -7
  178. package/index56.js +5 -14
  179. package/index57.js +10 -28
  180. package/index58.js +10 -15
  181. package/index59.js +15 -0
  182. package/index6.js +250 -299
  183. package/index60.js +13 -0
  184. package/index61.js +21 -0
  185. package/index62.js +8 -0
  186. package/index63.js +57 -0
  187. package/index64.js +4 -0
  188. package/index65.js +69 -0
  189. package/index66.js +33 -0
  190. package/index67.js +13 -0
  191. package/index68.js +123 -0
  192. package/index69.js +88 -0
  193. package/index7.js +22 -5047
  194. package/index70.js +10 -0
  195. package/index71.js +13 -0
  196. package/index72.js +13 -225
  197. package/index73.js +16 -0
  198. package/index74.js +9 -0
  199. package/index75.js +228 -0
  200. package/index76.js +9 -0
  201. package/index77.js +17 -0
  202. package/index78.js +31 -0
  203. package/index79.js +18 -0
  204. package/index8.js +5044 -47
  205. package/index9.js +50 -15
  206. package/isAbsoluteURL.js +1 -1
  207. package/isURLSameOrigin.js +1 -1
  208. package/localization.js +15 -15
  209. package/log.js +14 -0
  210. package/log2.js +4 -0
  211. package/matchRequestUrl.js +1 -1
  212. package/mergeConfig.js +37 -32
  213. package/notify.js +2 -2
  214. package/package.json +1 -1
  215. package/positionFns.js +101 -0
  216. package/positionFns2.js +4 -0
  217. package/react-laag.esm.js +957 -0
  218. package/react.js +8 -8
  219. package/react2.js +9 -9
  220. package/resolveConfig.js +23 -23
  221. package/select/add-media/AddMedia.d.ts +3 -1
  222. package/select/current-selection/SelectedItems.d.ts +1 -1
  223. package/shims.js +29 -0
  224. package/shims2.js +4 -0
  225. package/store/StoreInitializer.d.ts +5 -1
  226. package/store/useAssetFilterStore.d.ts +55 -0
  227. package/store/useSelectionStore.d.ts +47 -0
  228. package/styled-components.browser.esm.js +2 -2
  229. package/throttle.js +1 -1
  230. package/toURLEncodedForm.js +11 -10
  231. package/tokenExpirationHelper.js +1 -1
  232. package/transformData.js +1 -1
  233. package/transitional.js +4 -3
  234. package/useAssetFilterStore.js +152 -0
  235. package/useDatStore.js +1 -1
  236. package/useEffectEvent.js +7 -7
  237. package/useFonts.js +2 -2
  238. package/useOrderingStore.js +1 -1
  239. package/useRouterStore.js +1 -1
  240. package/useSearchStore.js +1 -1
  241. package/useSelectionStore.js +131 -0
  242. package/useSimilaritySearchStore.js +1 -1
  243. package/useTranslate.js +1 -1
  244. package/utils/combineMetaproperties.d.ts +2 -0
  245. package/utils6.js +160 -118
  246. package/utils7.js +7 -68
  247. package/utils8.js +68 -7
  248. package/xhr.js +47 -46
  249. package/AssetFilterContext.js +0 -161
  250. package/SelectionContext.js +0 -143
  251. package/select/SelectionContext.d.ts +0 -30
  252. /package/{Middleware.js → Middleware2.js} +0 -0
  253. /package/{middleware2.js → middleware.js} +0 -0
package/index12.js CHANGED
@@ -1,38 +1,315 @@
1
- import o from "./axios.js";
2
- const {
3
- Axios: e,
4
- AxiosError: a,
5
- CanceledError: s,
6
- isCancel: t,
7
- CancelToken: i,
8
- VERSION: l,
9
- all: n,
10
- Cancel: d,
11
- isAxiosError: x,
12
- spread: C,
13
- toFormData: c,
14
- AxiosHeaders: m,
15
- HttpStatusCode: p,
16
- formToJSON: A,
17
- getAdapter: f,
18
- mergeConfig: E
19
- } = o;
1
+ import { A as w } from "./AccessToken.js";
2
+ import c, { useState as g, useEffect as x, useContext as E } from "react";
3
+ class v {
4
+ constructor(e) {
5
+ this.input = e, this.index = 0, this.done = !1, this.value = "", this.value = this.input.charAt(0);
6
+ }
7
+ next() {
8
+ return ++this.index >= this.input.length && (this.done = !0), this.value = this.input.charAt(this.index);
9
+ }
10
+ croak() {
11
+ throw new Error(`[${this.input}]. Unexpected character "${this.value}" on position ${this.index}.`);
12
+ }
13
+ }
14
+ var u;
15
+ (function(t) {
16
+ t[t.Plural = 0] = "Plural", t[t.Select = 1] = "Select", t[t.Text = 2] = "Text", t[t.Variable = 3] = "Variable";
17
+ })(u || (u = {}));
18
+ const f = "{", l = "}", p = ",", y = [f, l, p], L = "plural", C = "select";
19
+ class P {
20
+ constructor(e) {
21
+ this.input = new v(e);
22
+ }
23
+ next() {
24
+ return this.input.value === f ? this.readVariable() : this.readText();
25
+ }
26
+ skip(e) {
27
+ e !== this.input.value && this.input.croak(), this.input.next();
28
+ }
29
+ readWhile(e) {
30
+ let n = "";
31
+ for (; !this.input.done && e(this.input.value); )
32
+ n += this.input.value, this.input.next();
33
+ return n;
34
+ }
35
+ readVariable() {
36
+ this.skip(f);
37
+ const e = this.readWhile((r) => !S(r)).trim();
38
+ if (e.length === 0 && this.input.croak(), this.input.value === l)
39
+ return this.skip(l), {
40
+ type: u.Variable,
41
+ value: e
42
+ };
43
+ this.skip(p);
44
+ const n = this.readVariableType();
45
+ return {
46
+ options: this.readVariableOptions(),
47
+ type: n,
48
+ value: e
49
+ };
50
+ }
51
+ readText() {
52
+ return {
53
+ type: u.Text,
54
+ value: this.readWhile((e) => e !== f && e !== l)
55
+ };
56
+ }
57
+ readVariableType() {
58
+ const e = this.readWhile((n) => n !== p).trim();
59
+ if (e === L)
60
+ return u.Plural;
61
+ if (e === C)
62
+ return u.Select;
63
+ this.input.croak();
64
+ }
65
+ readVariableOptions() {
66
+ this.skip(p);
67
+ const e = {};
68
+ for (; this.input.value !== l; )
69
+ e[this.readText().value.trim()] = this.readExpression();
70
+ return this.skip(l), e;
71
+ }
72
+ readExpression() {
73
+ const e = [];
74
+ for (this.skip(f); this.input.value !== l; )
75
+ e.push(this.next());
76
+ return this.skip(l), e;
77
+ }
78
+ }
79
+ function S(t) {
80
+ return y.includes(t);
81
+ }
82
+ const R = [
83
+ "campaigns",
84
+ "Campaigns",
85
+ "Campaign",
86
+ "campaign",
87
+ "Collection",
88
+ "collections",
89
+ "collection",
90
+ "Collections",
91
+ "limitedUsage",
92
+ "LIMITED",
93
+ "jobs",
94
+ "Jobs",
95
+ "job",
96
+ "Job",
97
+ "Guidelines",
98
+ "WorkflowCalendar",
99
+ "AssetBank",
100
+ "Brandstore",
101
+ "Reporter",
102
+ "Brand",
103
+ "brands",
104
+ "categories",
105
+ "Brands",
106
+ "brand",
107
+ "Asset",
108
+ "Subbrand",
109
+ "subbrands",
110
+ "Assets",
111
+ "assets",
112
+ "asset",
113
+ "subbrand",
114
+ "Subbrands",
115
+ "category",
116
+ "task",
117
+ "Stage",
118
+ "accountable",
119
+ "tasks",
120
+ "stage",
121
+ "Categories",
122
+ "Category",
123
+ "stages",
124
+ "Task",
125
+ "Stages",
126
+ "Tasks",
127
+ "Accountable"
128
+ ];
129
+ function I({ locale: t, translation: e, values: n, wordReplacements: r }) {
130
+ const s = new P(e), a = [];
131
+ for (; !s.input.done; )
132
+ o(s.next());
133
+ return a;
134
+ function o({ options: h, type: d, value: i }) {
135
+ if (d === u.Variable) {
136
+ if (R.includes(i)) {
137
+ r[i] ? a.push(r[i]) : a.push(i);
138
+ return;
139
+ }
140
+ a.push(n[i]);
141
+ return;
142
+ }
143
+ if (!h) {
144
+ a.push(i);
145
+ return;
146
+ }
147
+ if (d === u.Select) {
148
+ h[n[i]].map(o);
149
+ return;
150
+ }
151
+ const m = t.replace("_", "-");
152
+ h[new Intl.PluralRules(m).select(n[i])].map(o);
153
+ }
154
+ }
155
+ function k(t) {
156
+ return t || "en_US";
157
+ }
158
+ class z {
159
+ constructor(e, n, r) {
160
+ this.memo = {}, this.onError = console.error, this.translateParts = (s, a) => {
161
+ const o = this.getTranslationById(s);
162
+ try {
163
+ return I({
164
+ locale: this.locale,
165
+ translation: o,
166
+ values: a,
167
+ wordReplacements: this.wordReplacements
168
+ });
169
+ } catch (h) {
170
+ return this.onError(h), [o];
171
+ }
172
+ }, this.translate = (s, a = {}) => this.translateParts(s, a).join(""), this.getTranslationById = (s) => {
173
+ if (!this.memo[s]) {
174
+ let a = this.translations[s];
175
+ typeof a != "string" && (this.onError(new Error(`Localization: Missing translation with ID "${s}"`)), a = s), this.memo[s] = a;
176
+ }
177
+ return this.memo[s];
178
+ }, this.locale = k(n), r ? (this.translations = {
179
+ ...e,
180
+ ...r.translations
181
+ }, this.wordReplacements = r.wordReplacements) : (this.translations = {
182
+ ...e
183
+ }, this.wordReplacements = {});
184
+ }
185
+ }
186
+ const _ = (t) => Object.entries(t);
187
+ async function j(t) {
188
+ const e = {
189
+ translations: {},
190
+ wordReplacements: {}
191
+ };
192
+ if (!t.addCustomTranslations)
193
+ return e;
194
+ try {
195
+ const n = await V(), r = F(n), s = await fetch(r, {
196
+ method: "GET",
197
+ headers: {
198
+ "Content-Type": "application/json"
199
+ }
200
+ });
201
+ if (s.ok) {
202
+ const o = await s.json();
203
+ return U(o, k(t.locale));
204
+ }
205
+ const a = await s.text();
206
+ throw new Error(a);
207
+ } catch (n) {
208
+ return console.error("Localization: Failed to fetch custom translations.", n), e;
209
+ }
210
+ }
211
+ function F(t) {
212
+ return `/v7/portal/portals/${t}/custom-translations`;
213
+ }
214
+ async function V() {
215
+ try {
216
+ const t = await w.getJWT();
217
+ return w.decodeJWT(t).account_id;
218
+ } catch {
219
+ const e = await fetch("/v7/idp/access-tokens/userless-by-session").then((r) => r.json()).then((r) => r.access_token);
220
+ return w.decodeJWT(e).account_id;
221
+ }
222
+ }
223
+ function U(t, e) {
224
+ var n;
225
+ const r = {
226
+ translations: ((n = t.customTranslations) === null || n === void 0 ? void 0 : n[e]) || {},
227
+ wordReplacements: {}
228
+ };
229
+ for (const [s, a] of _(t.wordReplacements))
230
+ typeof a == "string" && a.trim().length > 0 && (r.wordReplacements[s] = a);
231
+ return r;
232
+ }
233
+ async function A(t) {
234
+ if (!t.forceFallback) {
235
+ if (t.locale === "en_US")
236
+ return b(t.fetchFallback);
237
+ const [e, n] = await Promise.all([
238
+ b(t.fetchFallback),
239
+ W(t)
240
+ ]);
241
+ return {
242
+ ...e,
243
+ ...n
244
+ };
245
+ }
246
+ return b(t.fetchFallback);
247
+ }
248
+ function b(t) {
249
+ try {
250
+ return t();
251
+ } catch (e) {
252
+ return console.error("Localization: Failed to fetch fallback.", e), Promise.resolve({});
253
+ }
254
+ }
255
+ async function W(t) {
256
+ try {
257
+ const e = B(t), r = await fetch(e, {
258
+ method: "GET",
259
+ headers: {
260
+ "Content-Type": "application/json"
261
+ }
262
+ });
263
+ if (r.ok)
264
+ return r.json();
265
+ const s = await r.text();
266
+ throw new Error(s);
267
+ } catch (e) {
268
+ return console.error("Localization: Failed to fetch from the service.", e), {};
269
+ }
270
+ }
271
+ function B(t) {
272
+ var e;
273
+ const n = new URLSearchParams({
274
+ module: t.project,
275
+ locale: k(t.locale)
276
+ });
277
+ return !((e = t.features) === null || e === void 0) && e.length && n.append("features", t.features.join(",")), "/v7/localization/keys/?" + n;
278
+ }
279
+ const T = c.createContext(void 0);
280
+ function O({ children: t, translations: e, onError: n, ...r }) {
281
+ const [s, a] = g(e), [o, h] = g({
282
+ translations: {},
283
+ wordReplacements: {}
284
+ });
285
+ if (x(() => {
286
+ s || Promise.all([A(r), j(r)]).then(([i, m]) => {
287
+ a(i), h(m);
288
+ });
289
+ }, [s, r]), !s)
290
+ return null;
291
+ const d = new z(s, r.locale, o);
292
+ return n && (d.onError = n), c.createElement(T.Provider, { value: d }, t);
293
+ }
294
+ function D({ id: t, ...e }) {
295
+ const n = E(T);
296
+ if (!n)
297
+ throw new Error("Localization: <Translate /> cannot be used without <LocalizationProvider />");
298
+ return c.createElement(c.Fragment, null, n.translateParts(t, e).map((r, s) => c.isValidElement(r) ? c.cloneElement(r, {
299
+ key: s
300
+ }) : c.createElement(c.Fragment, { key: s }, r)));
301
+ }
302
+ function N() {
303
+ const t = E(T);
304
+ if (!t)
305
+ throw new Error("Localization: useTranslate() cannot be used without <LocalizationProvider />");
306
+ return {
307
+ translate: t.translate
308
+ };
309
+ }
20
310
  export {
21
- e as Axios,
22
- a as AxiosError,
23
- m as AxiosHeaders,
24
- d as Cancel,
25
- i as CancelToken,
26
- s as CanceledError,
27
- p as HttpStatusCode,
28
- l as VERSION,
29
- n as all,
30
- o as default,
31
- A as formToJSON,
32
- f as getAdapter,
33
- x as isAxiosError,
34
- t as isCancel,
35
- E as mergeConfig,
36
- C as spread,
37
- c as toFormData
311
+ z as Localization,
312
+ O as LocalizationProvider,
313
+ D as Translate,
314
+ N as useTranslate
38
315
  };