@drawbridge/components 0.1.36 → 0.1.37

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 (338) hide show
  1. package/components/styles.css +355 -68
  2. package/dist/advertisement.js +20 -15
  3. package/dist/advertisement.mjs +20 -15
  4. package/dist/bridge/advertisements.js +2 -4
  5. package/dist/bridge/advertisements.mjs +3 -5
  6. package/dist/bridge/fields.js +6 -89
  7. package/dist/bridge/fields.mjs +7 -89
  8. package/dist/bridge/form-subdomain-embed.js +1 -5
  9. package/dist/bridge/form-subdomain-embed.mjs +1 -5
  10. package/dist/bridge/form-subdomain-header.js +14 -21
  11. package/dist/bridge/form-subdomain-header.mjs +14 -20
  12. package/dist/bridge/form-subdomain-issue.js +8 -17
  13. package/dist/bridge/form-subdomain-issue.mjs +8 -17
  14. package/dist/bridge/form-subdomain-missions.js +52 -58
  15. package/dist/bridge/form-subdomain-missions.mjs +54 -60
  16. package/dist/bridge/form-subdomain.js +94 -223
  17. package/dist/bridge/form-subdomain.mjs +96 -222
  18. package/dist/bridge/lib/entry.js +6 -61
  19. package/dist/bridge/lib/entry.mjs +5 -51
  20. package/dist/bridge/lib/order.js +0 -23
  21. package/dist/bridge/lib/order.mjs +0 -20
  22. package/dist/bridge/template-layout.js +2 -5
  23. package/dist/bridge/template-layout.mjs +3 -6
  24. package/dist/bridge/template-modal.js +15 -82
  25. package/dist/bridge/template-modal.mjs +16 -83
  26. package/dist/bridge/template-preview.js +208 -0
  27. package/dist/bridge/template-preview.mjs +173 -0
  28. package/dist/bridge/template-subdomain-gallery.js +75 -126
  29. package/dist/bridge/template-subdomain-gallery.mjs +75 -122
  30. package/dist/bridge/template-subdomain.js +14 -16
  31. package/dist/bridge/template-subdomain.mjs +15 -17
  32. package/dist/dashboard/avatar.js +0 -5
  33. package/dist/dashboard/avatar.mjs +0 -5
  34. package/dist/dashboard/card-affiliate.js +2 -3
  35. package/dist/dashboard/card-affiliate.mjs +2 -3
  36. package/dist/dashboard/card-campaign-switch.js +9 -34
  37. package/dist/dashboard/card-campaign-switch.mjs +8 -32
  38. package/dist/dashboard/card-connection.js +91 -51
  39. package/dist/dashboard/card-connection.mjs +89 -50
  40. package/dist/dashboard/card-order.js +14 -6
  41. package/dist/dashboard/card-order.mjs +14 -6
  42. package/dist/dashboard/card-section.js +26 -69
  43. package/dist/dashboard/card-section.mjs +26 -65
  44. package/dist/dashboard/card-tile.js +35 -3
  45. package/dist/dashboard/card-tile.mjs +34 -3
  46. package/dist/dashboard/device.js +95 -0
  47. package/dist/dashboard/device.mjs +72 -0
  48. package/dist/dashboard/drawer-subscription.js +14 -52
  49. package/dist/dashboard/drawer-subscription.mjs +14 -52
  50. package/dist/dashboard/drawer.js +3 -20
  51. package/dist/dashboard/drawer.mjs +4 -21
  52. package/dist/dashboard/dropdown.js +2 -6
  53. package/dist/dashboard/dropdown.mjs +2 -6
  54. package/dist/dashboard/form-admin-subscription-custom.js +8 -72
  55. package/dist/dashboard/form-admin-subscription-custom.mjs +8 -72
  56. package/dist/dashboard/form-ai.js +148 -0
  57. package/dist/dashboard/form-ai.mjs +148 -1
  58. package/dist/dashboard/form-filters-analytics.js +62 -85
  59. package/dist/dashboard/form-filters-analytics.mjs +61 -85
  60. package/dist/dashboard/form-organization-brand.js +13 -30
  61. package/dist/dashboard/form-organization-brand.mjs +13 -30
  62. package/dist/dashboard/form-organization-campaign-advertisement.js +112 -38
  63. package/dist/dashboard/form-organization-campaign-advertisement.mjs +112 -38
  64. package/dist/dashboard/form-organization-campaign-agreement.js +210 -402
  65. package/dist/dashboard/form-organization-campaign-agreement.mjs +211 -398
  66. package/dist/dashboard/form-organization-campaign-field-list.js +425 -0
  67. package/dist/dashboard/form-organization-campaign-field-list.mjs +396 -0
  68. package/dist/dashboard/form-organization-campaign-field-number.js +7 -48
  69. package/dist/dashboard/form-organization-campaign-field-number.mjs +7 -48
  70. package/dist/dashboard/form-organization-campaign-field-select.js +4 -15
  71. package/dist/dashboard/form-organization-campaign-field-select.mjs +4 -15
  72. package/dist/dashboard/form-organization-campaign-field-text.js +6 -46
  73. package/dist/dashboard/form-organization-campaign-field-text.mjs +6 -46
  74. package/dist/dashboard/form-organization-campaign-field-textarea.js +13 -22
  75. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +13 -22
  76. package/dist/dashboard/form-organization-campaign-integration-age.js +35 -2
  77. package/dist/dashboard/form-organization-campaign-integration-age.mjs +35 -2
  78. package/dist/dashboard/form-organization-campaign-integration-geocode.js +1 -4
  79. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +1 -4
  80. package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
  81. package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
  82. package/dist/dashboard/form-organization-campaign-page-preview.js +2 -1
  83. package/dist/dashboard/form-organization-campaign-page-preview.mjs +2 -1
  84. package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
  85. package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
  86. package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
  87. package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
  88. package/dist/dashboard/form-organization-campaign-page-slug.js +3 -2
  89. package/dist/dashboard/form-organization-campaign-page-slug.mjs +3 -2
  90. package/dist/dashboard/form-organization-campaign-page.js +265 -168
  91. package/dist/dashboard/form-organization-campaign-page.mjs +266 -170
  92. package/dist/dashboard/form-organization-campaign-section.js +107 -125
  93. package/dist/dashboard/form-organization-campaign-section.mjs +107 -121
  94. package/dist/dashboard/form-organization-campaign.js +9 -119
  95. package/dist/dashboard/form-organization-campaign.mjs +9 -118
  96. package/dist/dashboard/form-organization-file-frame.js +1 -7
  97. package/dist/dashboard/form-organization-file-frame.mjs +1 -7
  98. package/dist/dashboard/form-organization-workflow.js +545 -589
  99. package/dist/dashboard/form-organization-workflow.mjs +545 -590
  100. package/dist/dashboard/form-organization.js +0 -22
  101. package/dist/dashboard/form-organization.mjs +0 -22
  102. package/dist/dashboard/form-verify-prize.js +34 -114
  103. package/dist/dashboard/form-verify-prize.mjs +34 -111
  104. package/dist/dashboard/google.js +1 -8
  105. package/dist/dashboard/google.mjs +1 -8
  106. package/dist/dashboard/input-array.js +0 -2
  107. package/dist/dashboard/input-array.mjs +0 -2
  108. package/dist/dashboard/input-combobox.js +9 -0
  109. package/dist/dashboard/input-combobox.mjs +9 -0
  110. package/dist/dashboard/input-date.js +8 -3
  111. package/dist/dashboard/input-date.mjs +8 -3
  112. package/dist/dashboard/input-editor.js +6 -17
  113. package/dist/dashboard/input-editor.mjs +6 -17
  114. package/dist/dashboard/input-fields.js +437 -287
  115. package/dist/dashboard/input-fields.mjs +436 -287
  116. package/dist/dashboard/input-file.js +2 -70
  117. package/dist/dashboard/input-file.mjs +2 -70
  118. package/dist/dashboard/input-font.js +55 -64
  119. package/dist/dashboard/input-font.mjs +55 -64
  120. package/dist/dashboard/input-resource.js +1 -4
  121. package/dist/dashboard/input-resource.mjs +1 -4
  122. package/dist/dashboard/item-row.js +92 -0
  123. package/dist/dashboard/item-row.mjs +63 -0
  124. package/dist/dashboard/lib/features.js +1 -1
  125. package/dist/dashboard/lib/features.mjs +1 -1
  126. package/dist/dashboard/lib/item-list.js +15 -0
  127. package/dist/dashboard/lib/item-list.mjs +14 -0
  128. package/dist/dashboard/lib/rail.js +17 -16
  129. package/dist/dashboard/lib/rail.mjs +16 -15
  130. package/dist/dashboard/lib/sms.js +2 -8
  131. package/dist/dashboard/lib/sms.mjs +1 -6
  132. package/dist/dashboard/list-resource.js +0 -2
  133. package/dist/dashboard/list-resource.mjs +0 -2
  134. package/dist/dashboard/menu.js +5 -54
  135. package/dist/dashboard/menu.mjs +5 -53
  136. package/dist/dashboard/modal.js +4 -19
  137. package/dist/dashboard/modal.mjs +5 -20
  138. package/dist/dashboard/order-sections.js +0 -4
  139. package/dist/dashboard/order-sections.mjs +0 -4
  140. package/dist/dashboard/preview.js +324 -838
  141. package/dist/dashboard/preview.mjs +324 -826
  142. package/dist/dashboard/provider-ui.js +12 -20
  143. package/dist/dashboard/provider-ui.mjs +13 -21
  144. package/dist/dashboard/recharts.js +28 -53
  145. package/dist/dashboard/recharts.mjs +28 -53
  146. package/dist/dashboard/swatch.js +0 -35
  147. package/dist/dashboard/swatch.mjs +0 -31
  148. package/dist/dashboard/table-contacts.js +10 -6
  149. package/dist/dashboard/table-contacts.mjs +10 -6
  150. package/dist/dashboard/table.js +3 -10
  151. package/dist/dashboard/table.mjs +3 -9
  152. package/dist/dashboard/template-dashboard.js +21 -13
  153. package/dist/dashboard/template-dashboard.mjs +21 -12
  154. package/dist/dashboard/template-rail.js +126 -198
  155. package/dist/dashboard/template-rail.mjs +125 -196
  156. package/dist/dashboard/template-socket.js +12 -0
  157. package/dist/dashboard/template-socket.mjs +12 -0
  158. package/dist/dashboard/template-ui.js +11 -20
  159. package/dist/dashboard/template-ui.mjs +13 -22
  160. package/dist/input-checkbox.js +1 -7
  161. package/dist/input-checkbox.mjs +1 -7
  162. package/dist/input-name.js +3 -3
  163. package/dist/input-name.mjs +3 -3
  164. package/dist/input-select.js +1 -3
  165. package/dist/input-select.mjs +1 -3
  166. package/dist/provider-font.js +3 -4
  167. package/dist/provider-font.mjs +3 -4
  168. package/dist/shared/badge.js +0 -15
  169. package/dist/shared/badge.mjs +0 -11
  170. package/dist/shared/carousel.js +7 -11
  171. package/dist/shared/carousel.mjs +7 -11
  172. package/dist/shared/lib/campaign.js +9 -3
  173. package/dist/shared/lib/campaign.mjs +9 -3
  174. package/dist/shared/lib/helpers.js +0 -24
  175. package/dist/shared/lib/helpers.mjs +0 -22
  176. package/dist/shared/lib/video.js +0 -6
  177. package/dist/shared/lib/video.mjs +0 -5
  178. package/dist/shared/sortable.js +10 -27
  179. package/dist/shared/sortable.mjs +10 -27
  180. package/dist/shared/tabs.js +1 -1
  181. package/dist/shared/tabs.mjs +1 -1
  182. package/dist/video.js +9 -127
  183. package/dist/video.mjs +11 -125
  184. package/package.json +20 -176
  185. package/types/bridge/fields.d.ts +1 -6
  186. package/types/bridge/form-subdomain-missions.d.ts +0 -2
  187. package/types/bridge/form-subdomain.d.ts +3 -62
  188. package/types/bridge/lib/entry.d.ts +7 -44
  189. package/types/bridge/lib/order.d.ts +2 -13
  190. package/types/bridge/subdomain-content.d.ts +0 -1
  191. package/types/bridge/template-preview.d.ts +10 -0
  192. package/types/bridge/template-subdomain-gallery.d.ts +1 -13
  193. package/types/dashboard/card-campaign-switch.d.ts +1 -20
  194. package/types/dashboard/card-connection.d.ts +8 -0
  195. package/types/dashboard/card-order.d.ts +2 -2
  196. package/types/dashboard/card-section.d.ts +1 -9
  197. package/types/dashboard/card-tile.d.ts +9 -4
  198. package/types/dashboard/device.d.ts +12 -0
  199. package/types/dashboard/drawer.d.ts +0 -3
  200. package/types/dashboard/form-ai.d.ts +17 -0
  201. package/types/dashboard/form-filters-analytics.d.ts +14 -0
  202. package/types/dashboard/form-organization-brand.d.ts +0 -3
  203. package/types/dashboard/form-organization-campaign-agreement.d.ts +10 -53
  204. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  205. package/types/dashboard/form-organization-campaign-field-number.d.ts +1 -4
  206. package/types/dashboard/form-organization-campaign-field-select.d.ts +1 -6
  207. package/types/dashboard/form-organization-campaign-field-text.d.ts +1 -5
  208. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +1 -4
  209. package/types/dashboard/form-organization-campaign-integration-age.d.ts +1 -2
  210. package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +0 -2
  211. package/types/dashboard/form-organization-campaign-page.d.ts +15 -9
  212. package/types/dashboard/form-organization-campaign-section.d.ts +8 -24
  213. package/types/dashboard/form-organization-campaign.d.ts +0 -3
  214. package/types/dashboard/form-organization-workflow.d.ts +4 -3
  215. package/types/dashboard/form-organization.d.ts +2 -2
  216. package/types/dashboard/form-verify-prize.d.ts +3 -30
  217. package/types/dashboard/input-combobox.d.ts +2 -0
  218. package/types/dashboard/input-date.d.ts +2 -0
  219. package/types/dashboard/input-editor.d.ts +0 -9
  220. package/types/dashboard/input-fields.d.ts +5 -8
  221. package/types/dashboard/input-file.d.ts +0 -4
  222. package/types/dashboard/input-resource.d.ts +0 -1
  223. package/types/dashboard/item-row.d.ts +25 -0
  224. package/types/dashboard/lib/item-list.d.ts +5 -10
  225. package/types/dashboard/lib/rail.d.ts +1 -0
  226. package/types/dashboard/lib/sms.d.ts +0 -7
  227. package/types/dashboard/modal.d.ts +1 -3
  228. package/types/dashboard/preview.d.ts +10 -65
  229. package/types/dashboard/recharts.d.ts +0 -3
  230. package/types/dashboard/swatch.d.ts +0 -4
  231. package/types/dashboard/template-dashboard.d.ts +2 -3
  232. package/types/input-select.d.ts +0 -2
  233. package/types/shared/button.d.ts +1 -1
  234. package/types/shared/lib/helpers.d.ts +1 -22
  235. package/types/shared/lib/video.d.ts +0 -3
  236. package/types/shared/sortable.d.ts +0 -6
  237. package/types/video.d.ts +2 -18
  238. package/dist/bridge/form-subdomain-agreement.js +0 -165
  239. package/dist/bridge/form-subdomain-agreement.mjs +0 -132
  240. package/dist/dashboard/campaign-form.js +0 -1798
  241. package/dist/dashboard/campaign-form.mjs +0 -1769
  242. package/dist/dashboard/card-campaign-agreement.js +0 -172
  243. package/dist/dashboard/card-campaign-agreement.mjs +0 -139
  244. package/dist/dashboard/card-shortcut.js +0 -181
  245. package/dist/dashboard/card-shortcut.mjs +0 -152
  246. package/dist/dashboard/document-blocks.js +0 -305
  247. package/dist/dashboard/document-blocks.mjs +0 -270
  248. package/dist/dashboard/form-organization-campaign-advertisements.js +0 -374
  249. package/dist/dashboard/form-organization-campaign-advertisements.mjs +0 -345
  250. package/dist/dashboard/form-organization-campaign-design.js +0 -258
  251. package/dist/dashboard/form-organization-campaign-design.mjs +0 -223
  252. package/dist/dashboard/form-organization-campaign-field-item.js +0 -585
  253. package/dist/dashboard/form-organization-campaign-field-item.mjs +0 -552
  254. package/dist/dashboard/form-organization-campaign-field-skill.js +0 -359
  255. package/dist/dashboard/form-organization-campaign-field-skill.mjs +0 -330
  256. package/dist/dashboard/form-organization-campaign-footer.js +0 -178
  257. package/dist/dashboard/form-organization-campaign-footer.mjs +0 -149
  258. package/dist/dashboard/form-reposition.js +0 -396
  259. package/dist/dashboard/form-reposition.mjs +0 -359
  260. package/dist/dashboard/form-support.js +0 -189
  261. package/dist/dashboard/form-support.mjs +0 -160
  262. package/dist/dashboard/form-tests.js +0 -683
  263. package/dist/dashboard/form-tests.mjs +0 -646
  264. package/dist/dashboard/lib/ab-tests.js +0 -130
  265. package/dist/dashboard/lib/ab-tests.mjs +0 -94
  266. package/dist/dashboard/lib/focus.js +0 -93
  267. package/dist/dashboard/lib/focus.mjs +0 -69
  268. package/dist/dashboard/lib/form-page.js +0 -203
  269. package/dist/dashboard/lib/form-page.mjs +0 -155
  270. package/dist/dashboard/template-design.js +0 -564
  271. package/dist/dashboard/template-design.mjs +0 -531
  272. package/dist/dashboard/template-test-page.js +0 -436
  273. package/dist/dashboard/template-test-page.mjs +0 -407
  274. package/dist/dashboard/template-tests.js +0 -141
  275. package/dist/dashboard/template-tests.mjs +0 -112
  276. package/dist/dashboard/template-variant.js +0 -185
  277. package/dist/dashboard/template-variant.mjs +0 -156
  278. package/dist/icons/arrow-down-long.js +0 -47
  279. package/dist/icons/arrow-down-long.mjs +0 -28
  280. package/dist/icons/arrows-pointing-out.js +0 -46
  281. package/dist/icons/arrows-pointing-out.mjs +0 -27
  282. package/dist/icons/beaker.js +0 -46
  283. package/dist/icons/beaker.mjs +0 -27
  284. package/dist/icons/identification.js +0 -46
  285. package/dist/icons/identification.mjs +0 -27
  286. package/dist/icons/lifebuoy.js +0 -46
  287. package/dist/icons/lifebuoy.mjs +0 -27
  288. package/dist/icons/rectangle-group.js +0 -46
  289. package/dist/icons/rectangle-group.mjs +0 -27
  290. package/dist/icons/rectangle-stack.js +0 -46
  291. package/dist/icons/rectangle-stack.mjs +0 -27
  292. package/dist/icons/shopping-bag.js +0 -46
  293. package/dist/icons/shopping-bag.mjs +0 -27
  294. package/dist/icons/swatch.js +0 -46
  295. package/dist/icons/swatch.mjs +0 -27
  296. package/dist/icons/window.js +0 -46
  297. package/dist/icons/window.mjs +0 -27
  298. package/dist/icons/zoom-in.js +0 -46
  299. package/dist/icons/zoom-in.mjs +0 -27
  300. package/dist/input-answer.js +0 -60
  301. package/dist/input-answer.mjs +0 -27
  302. package/dist/shared/document-pieces.js +0 -295
  303. package/dist/shared/document-pieces.mjs +0 -260
  304. package/types/bridge/form-subdomain-agreement.d.ts +0 -27
  305. package/types/dashboard/campaign-form.d.ts +0 -42
  306. package/types/dashboard/card-campaign-agreement.d.ts +0 -26
  307. package/types/dashboard/card-shortcut.d.ts +0 -38
  308. package/types/dashboard/document-blocks.d.ts +0 -14
  309. package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -15
  310. package/types/dashboard/form-organization-campaign-design.d.ts +0 -46
  311. package/types/dashboard/form-organization-campaign-field-item.d.ts +0 -36
  312. package/types/dashboard/form-organization-campaign-field-skill.d.ts +0 -36
  313. package/types/dashboard/form-organization-campaign-footer.d.ts +0 -23
  314. package/types/dashboard/form-reposition.d.ts +0 -29
  315. package/types/dashboard/form-support.d.ts +0 -14
  316. package/types/dashboard/form-tests.d.ts +0 -78
  317. package/types/dashboard/lib/ab-tests.d.ts +0 -50
  318. package/types/dashboard/lib/escape.d.ts +0 -4
  319. package/types/dashboard/lib/focus.d.ts +0 -16
  320. package/types/dashboard/lib/form-page.d.ts +0 -25
  321. package/types/dashboard/template-design.d.ts +0 -30
  322. package/types/dashboard/template-test-page.d.ts +0 -69
  323. package/types/dashboard/template-tests.d.ts +0 -30
  324. package/types/dashboard/template-variant.d.ts +0 -18
  325. package/types/icons/arrow-down-long.d.ts +0 -5
  326. package/types/icons/arrows-pointing-out.d.ts +0 -5
  327. package/types/icons/beaker.d.ts +0 -5
  328. package/types/icons/identification.d.ts +0 -5
  329. package/types/icons/lifebuoy.d.ts +0 -5
  330. package/types/icons/rectangle-group.d.ts +0 -5
  331. package/types/icons/rectangle-stack.d.ts +0 -5
  332. package/types/icons/shopping-bag.d.ts +0 -5
  333. package/types/icons/swatch.d.ts +0 -5
  334. package/types/icons/window.d.ts +0 -5
  335. package/types/icons/zoom-in.d.ts +0 -5
  336. package/types/input-answer.d.ts +0 -15
  337. package/types/shared/document-pieces.d.ts +0 -34
  338. package/types/shared/lib/motion.d.ts +0 -2
@@ -51,24 +51,11 @@ const ProviderUi = ({
51
51
  const queryClient = (0, import_react_query.useQueryClient)();
52
52
  queryClient.setQueryDefaults(["socket"], { structuralSharing: false });
53
53
  const tokenRef = (0, import_react.useRef)(token);
54
- (0, import_fetch.setMemoryToken)(token);
55
54
  (0, import_react.useEffect)(
56
55
  () => {
57
- (0, import_fetch.setTokenRefresher)(async () => {
58
- var _a2;
59
- const response = await fetch(
60
- "/api/auth/refresh",
61
- {
62
- method: "POST"
63
- }
64
- );
65
- const fresh = response.ok ? ((_a2 = await response.json()) == null ? void 0 : _a2.token) || null : null;
66
- if (fresh) tokenRef.current = fresh;
67
- return fresh;
68
- });
69
- return () => (0, import_fetch.setTokenRefresher)(null);
56
+ (0, import_fetch.setMemoryToken)(token);
70
57
  },
71
- []
58
+ [token]
72
59
  );
73
60
  (0, import_react.useEffect)(
74
61
  () => {
@@ -100,7 +87,8 @@ const ProviderUi = ({
100
87
  queryKey: ["account"],
101
88
  queryFn: async () => {
102
89
  const { result } = await (0, import_fetch.request)({
103
- endpoint: "/account"
90
+ endpoint: "/account",
91
+ token
104
92
  });
105
93
  return result || {};
106
94
  },
@@ -110,7 +98,8 @@ const ProviderUi = ({
110
98
  queryKey: ["app"],
111
99
  queryFn: async () => {
112
100
  const { result } = await (0, import_fetch.request)({
113
- endpoint: "/app"
101
+ endpoint: "/app",
102
+ token
114
103
  });
115
104
  return result || {};
116
105
  }
@@ -119,7 +108,8 @@ const ProviderUi = ({
119
108
  queryKey: ["countries"],
120
109
  queryFn: async () => {
121
110
  const { result } = await (0, import_fetch.request)({
122
- endpoint: "/app/countries"
111
+ endpoint: "/app/countries",
112
+ token
123
113
  });
124
114
  return result || {};
125
115
  }
@@ -128,7 +118,8 @@ const ProviderUi = ({
128
118
  queryKey: ["currencies"],
129
119
  queryFn: async () => {
130
120
  const { result } = await (0, import_fetch.request)({
131
- endpoint: "/app/currencies"
121
+ endpoint: "/app/currencies",
122
+ token
132
123
  });
133
124
  return result || {};
134
125
  }
@@ -173,7 +164,8 @@ const ProviderUi = ({
173
164
  queryKey: ["account", "balance"],
174
165
  queryFn: async () => {
175
166
  const { result } = await (0, import_fetch.request)({
176
- endpoint: "/account/balance"
167
+ endpoint: "/account/balance",
168
+ token
177
169
  });
178
170
  return result || {};
179
171
  },
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Fragment, useEffect, useRef } from "react";
4
4
  import { useQueries, useQueryClient } from "@tanstack/react-query";
5
- import { isTransientError, request, setMemoryToken, setTokenRefresher } from "@drawbridge/drawbridge-utils/fetch";
5
+ import { isTransientError, request, setMemoryToken } from "@drawbridge/drawbridge-utils/fetch";
6
6
  import { io } from "socket.io-client";
7
7
  import TemplateNotFound from "./template-not-found.mjs";
8
8
  import { expiredSessionHref, retrySession, sessionRetryKey } from "./lib/navigation.mjs";
@@ -19,24 +19,11 @@ const ProviderUi = ({
19
19
  const queryClient = useQueryClient();
20
20
  queryClient.setQueryDefaults(["socket"], { structuralSharing: false });
21
21
  const tokenRef = useRef(token);
22
- setMemoryToken(token);
23
22
  useEffect(
24
23
  () => {
25
- setTokenRefresher(async () => {
26
- var _a2;
27
- const response = await fetch(
28
- "/api/auth/refresh",
29
- {
30
- method: "POST"
31
- }
32
- );
33
- const fresh = response.ok ? ((_a2 = await response.json()) == null ? void 0 : _a2.token) || null : null;
34
- if (fresh) tokenRef.current = fresh;
35
- return fresh;
36
- });
37
- return () => setTokenRefresher(null);
24
+ setMemoryToken(token);
38
25
  },
39
- []
26
+ [token]
40
27
  );
41
28
  useEffect(
42
29
  () => {
@@ -68,7 +55,8 @@ const ProviderUi = ({
68
55
  queryKey: ["account"],
69
56
  queryFn: async () => {
70
57
  const { result } = await request({
71
- endpoint: "/account"
58
+ endpoint: "/account",
59
+ token
72
60
  });
73
61
  return result || {};
74
62
  },
@@ -78,7 +66,8 @@ const ProviderUi = ({
78
66
  queryKey: ["app"],
79
67
  queryFn: async () => {
80
68
  const { result } = await request({
81
- endpoint: "/app"
69
+ endpoint: "/app",
70
+ token
82
71
  });
83
72
  return result || {};
84
73
  }
@@ -87,7 +76,8 @@ const ProviderUi = ({
87
76
  queryKey: ["countries"],
88
77
  queryFn: async () => {
89
78
  const { result } = await request({
90
- endpoint: "/app/countries"
79
+ endpoint: "/app/countries",
80
+ token
91
81
  });
92
82
  return result || {};
93
83
  }
@@ -96,7 +86,8 @@ const ProviderUi = ({
96
86
  queryKey: ["currencies"],
97
87
  queryFn: async () => {
98
88
  const { result } = await request({
99
- endpoint: "/app/currencies"
89
+ endpoint: "/app/currencies",
90
+ token
100
91
  });
101
92
  return result || {};
102
93
  }
@@ -141,7 +132,8 @@ const ProviderUi = ({
141
132
  queryKey: ["account", "balance"],
142
133
  queryFn: async () => {
143
134
  const { result } = await request({
144
- endpoint: "/account/balance"
135
+ endpoint: "/account/balance",
136
+ token
145
137
  });
146
138
  return result || {};
147
139
  },
@@ -147,7 +147,7 @@ const area = (props, color) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
147
147
  }
148
148
  }
149
149
  );
150
- const gradient = (props, color, opacity = 0.4) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
150
+ const gradient = (props, color) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
151
151
  "linearGradient",
152
152
  {
153
153
  ...{
@@ -161,7 +161,7 @@ const gradient = (props, color, opacity = 0.4) => /* @__PURE__ */ (0, import_jsx
161
161
  ...{
162
162
  offset: "5%",
163
163
  stopColor: color,
164
- stopOpacity: opacity
164
+ stopOpacity: 0.4
165
165
  }
166
166
  }
167
167
  ),
@@ -257,14 +257,10 @@ const ChartLine = ({
257
257
  ],
258
258
  empty,
259
259
  format = (value) => value,
260
- labels: given = {},
261
- legend = true,
262
- zeros = false
260
+ legend = true
263
261
  }) => {
264
- const name = (key) => given[key] || label(key);
265
- const fade = datasets.length > 3 ? 0.06 : 0.4;
266
262
  const [active, setActive] = (0, import_react.useState)(datasets);
267
- if (!(data == null ? void 0 : data.length) || !zeros && !data.some((point) => datasets.some((key) => Number(point == null ? void 0 : point[key])))) {
263
+ if (!(data == null ? void 0 : data.some((point) => datasets.some((key) => Number(point == null ? void 0 : point[key]))))) {
268
264
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartEmpty, { ...empty });
269
265
  }
270
266
  ;
@@ -292,148 +288,127 @@ const ChartLine = ({
292
288
  {
293
289
  id: "color-actions"
294
290
  },
295
- options.colors.actions,
296
- fade
291
+ options.colors.actions
297
292
  ),
298
293
  datasets.includes("affiliates") && gradient(
299
294
  {
300
295
  id: "color-affiliates"
301
296
  },
302
- options.colors.affiliates,
303
- fade
297
+ options.colors.affiliates
304
298
  ),
305
299
  datasets.includes("brands") && gradient(
306
300
  {
307
301
  id: "color-brands"
308
302
  },
309
- options.colors.brands,
310
- fade
303
+ options.colors.brands
311
304
  ),
312
305
  datasets.includes("campaigns") && gradient(
313
306
  {
314
307
  id: "color-campaigns"
315
308
  },
316
- options.colors.campaigns,
317
- fade
309
+ options.colors.campaigns
318
310
  ),
319
311
  datasets.includes("connections") && gradient(
320
312
  {
321
313
  id: "color-connections"
322
314
  },
323
- options.colors.connections,
324
- fade
315
+ options.colors.connections
325
316
  ),
326
317
  datasets.includes("count") && gradient(
327
318
  {
328
319
  id: "color-count"
329
320
  },
330
- options.colors.count,
331
- fade
321
+ options.colors.count
332
322
  ),
333
323
  datasets.includes("discount") && gradient(
334
324
  {
335
325
  id: "color-discount"
336
326
  },
337
- options.colors.discount,
338
- fade
327
+ options.colors.discount
339
328
  ),
340
329
  datasets.includes("entries") && gradient(
341
330
  {
342
331
  id: "color-entries"
343
332
  },
344
- options.colors.entries,
345
- fade
333
+ options.colors.entries
346
334
  ),
347
335
  datasets.includes("events") && gradient(
348
336
  {
349
337
  id: "color-events"
350
338
  },
351
- options.colors.events,
352
- fade
339
+ options.colors.events
353
340
  ),
354
341
  datasets.includes("fee") && gradient(
355
342
  {
356
343
  id: "color-fee"
357
344
  },
358
- options.colors.fee,
359
- fade
345
+ options.colors.fee
360
346
  ),
361
347
  datasets.includes("files") && gradient(
362
348
  {
363
349
  id: "color-files"
364
350
  },
365
- options.colors.files,
366
- fade
351
+ options.colors.files
367
352
  ),
368
353
  datasets.includes("gross") && gradient(
369
354
  {
370
355
  id: "color-gross"
371
356
  },
372
- options.colors.gross,
373
- fade
357
+ options.colors.gross
374
358
  ),
375
359
  datasets.includes("members") && gradient(
376
360
  {
377
361
  id: "color-members"
378
362
  },
379
- options.colors.members,
380
- fade
363
+ options.colors.members
381
364
  ),
382
365
  datasets.includes("net") && gradient(
383
366
  {
384
367
  id: "color-net"
385
368
  },
386
- options.colors.net,
387
- fade
369
+ options.colors.net
388
370
  ),
389
371
  datasets.includes("orders") && gradient(
390
372
  {
391
373
  id: "color-orders"
392
374
  },
393
- options.colors.orders,
394
- fade
375
+ options.colors.orders
395
376
  ),
396
377
  datasets.includes("pages") && gradient(
397
378
  {
398
379
  id: "color-pages"
399
380
  },
400
- options.colors.pages,
401
- fade
381
+ options.colors.pages
402
382
  ),
403
383
  datasets.includes("pageviews") && gradient(
404
384
  {
405
385
  id: "color-pageviews"
406
386
  },
407
- options.colors.pageviews,
408
- fade
387
+ options.colors.pageviews
409
388
  ),
410
389
  datasets.includes("qrcodes") && gradient(
411
390
  {
412
391
  id: "color-qrcodes"
413
392
  },
414
- options.colors.qrcodes,
415
- fade
393
+ options.colors.qrcodes
416
394
  ),
417
395
  datasets.includes("shortcodes") && gradient(
418
396
  {
419
397
  id: "color-shortcodes"
420
398
  },
421
- options.colors.shortcodes,
422
- fade
399
+ options.colors.shortcodes
423
400
  ),
424
401
  datasets.includes("storage") && gradient(
425
402
  {
426
403
  id: "color-storage"
427
404
  },
428
- options.colors.storage,
429
- fade
405
+ options.colors.storage
430
406
  ),
431
407
  datasets.includes("workflows") && gradient(
432
408
  {
433
409
  id: "color-workflows"
434
410
  },
435
- options.colors.workflows,
436
- fade
411
+ options.colors.workflows
437
412
  )
438
413
  ] }),
439
414
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -461,9 +436,9 @@ const ChartLine = ({
461
436
  // @story redemptions/overview
462
437
  // A money chart passes `format` so a day's summed gross reads
463
438
  // "$12.50", not 12.500000000000002; counts pass nothing.
464
- formatter: (value, key) => [
439
+ formatter: (value, name) => [
465
440
  format(value),
466
- name(key)
441
+ label(name)
467
442
  ]
468
443
  }
469
444
  }
@@ -472,7 +447,7 @@ const ChartLine = ({
472
447
  import_recharts.Legend,
473
448
  {
474
449
  ...{
475
- formatter: (key) => name(key),
450
+ formatter: (name) => label(name),
476
451
  onClick: ({ dataKey }) => handleLegendClick(dataKey),
477
452
  ...options.legend
478
453
  }
@@ -114,7 +114,7 @@ const area = (props, color) => /* @__PURE__ */ jsx(
114
114
  }
115
115
  }
116
116
  );
117
- const gradient = (props, color, opacity = 0.4) => /* @__PURE__ */ jsxs(
117
+ const gradient = (props, color) => /* @__PURE__ */ jsxs(
118
118
  "linearGradient",
119
119
  {
120
120
  ...{
@@ -128,7 +128,7 @@ const gradient = (props, color, opacity = 0.4) => /* @__PURE__ */ jsxs(
128
128
  ...{
129
129
  offset: "5%",
130
130
  stopColor: color,
131
- stopOpacity: opacity
131
+ stopOpacity: 0.4
132
132
  }
133
133
  }
134
134
  ),
@@ -224,14 +224,10 @@ const ChartLine = ({
224
224
  ],
225
225
  empty,
226
226
  format = (value) => value,
227
- labels: given = {},
228
- legend = true,
229
- zeros = false
227
+ legend = true
230
228
  }) => {
231
- const name = (key) => given[key] || label(key);
232
- const fade = datasets.length > 3 ? 0.06 : 0.4;
233
229
  const [active, setActive] = useState(datasets);
234
- if (!(data == null ? void 0 : data.length) || !zeros && !data.some((point) => datasets.some((key) => Number(point == null ? void 0 : point[key])))) {
230
+ if (!(data == null ? void 0 : data.some((point) => datasets.some((key) => Number(point == null ? void 0 : point[key]))))) {
235
231
  return /* @__PURE__ */ jsx(ChartEmpty, { ...empty });
236
232
  }
237
233
  ;
@@ -259,148 +255,127 @@ const ChartLine = ({
259
255
  {
260
256
  id: "color-actions"
261
257
  },
262
- options.colors.actions,
263
- fade
258
+ options.colors.actions
264
259
  ),
265
260
  datasets.includes("affiliates") && gradient(
266
261
  {
267
262
  id: "color-affiliates"
268
263
  },
269
- options.colors.affiliates,
270
- fade
264
+ options.colors.affiliates
271
265
  ),
272
266
  datasets.includes("brands") && gradient(
273
267
  {
274
268
  id: "color-brands"
275
269
  },
276
- options.colors.brands,
277
- fade
270
+ options.colors.brands
278
271
  ),
279
272
  datasets.includes("campaigns") && gradient(
280
273
  {
281
274
  id: "color-campaigns"
282
275
  },
283
- options.colors.campaigns,
284
- fade
276
+ options.colors.campaigns
285
277
  ),
286
278
  datasets.includes("connections") && gradient(
287
279
  {
288
280
  id: "color-connections"
289
281
  },
290
- options.colors.connections,
291
- fade
282
+ options.colors.connections
292
283
  ),
293
284
  datasets.includes("count") && gradient(
294
285
  {
295
286
  id: "color-count"
296
287
  },
297
- options.colors.count,
298
- fade
288
+ options.colors.count
299
289
  ),
300
290
  datasets.includes("discount") && gradient(
301
291
  {
302
292
  id: "color-discount"
303
293
  },
304
- options.colors.discount,
305
- fade
294
+ options.colors.discount
306
295
  ),
307
296
  datasets.includes("entries") && gradient(
308
297
  {
309
298
  id: "color-entries"
310
299
  },
311
- options.colors.entries,
312
- fade
300
+ options.colors.entries
313
301
  ),
314
302
  datasets.includes("events") && gradient(
315
303
  {
316
304
  id: "color-events"
317
305
  },
318
- options.colors.events,
319
- fade
306
+ options.colors.events
320
307
  ),
321
308
  datasets.includes("fee") && gradient(
322
309
  {
323
310
  id: "color-fee"
324
311
  },
325
- options.colors.fee,
326
- fade
312
+ options.colors.fee
327
313
  ),
328
314
  datasets.includes("files") && gradient(
329
315
  {
330
316
  id: "color-files"
331
317
  },
332
- options.colors.files,
333
- fade
318
+ options.colors.files
334
319
  ),
335
320
  datasets.includes("gross") && gradient(
336
321
  {
337
322
  id: "color-gross"
338
323
  },
339
- options.colors.gross,
340
- fade
324
+ options.colors.gross
341
325
  ),
342
326
  datasets.includes("members") && gradient(
343
327
  {
344
328
  id: "color-members"
345
329
  },
346
- options.colors.members,
347
- fade
330
+ options.colors.members
348
331
  ),
349
332
  datasets.includes("net") && gradient(
350
333
  {
351
334
  id: "color-net"
352
335
  },
353
- options.colors.net,
354
- fade
336
+ options.colors.net
355
337
  ),
356
338
  datasets.includes("orders") && gradient(
357
339
  {
358
340
  id: "color-orders"
359
341
  },
360
- options.colors.orders,
361
- fade
342
+ options.colors.orders
362
343
  ),
363
344
  datasets.includes("pages") && gradient(
364
345
  {
365
346
  id: "color-pages"
366
347
  },
367
- options.colors.pages,
368
- fade
348
+ options.colors.pages
369
349
  ),
370
350
  datasets.includes("pageviews") && gradient(
371
351
  {
372
352
  id: "color-pageviews"
373
353
  },
374
- options.colors.pageviews,
375
- fade
354
+ options.colors.pageviews
376
355
  ),
377
356
  datasets.includes("qrcodes") && gradient(
378
357
  {
379
358
  id: "color-qrcodes"
380
359
  },
381
- options.colors.qrcodes,
382
- fade
360
+ options.colors.qrcodes
383
361
  ),
384
362
  datasets.includes("shortcodes") && gradient(
385
363
  {
386
364
  id: "color-shortcodes"
387
365
  },
388
- options.colors.shortcodes,
389
- fade
366
+ options.colors.shortcodes
390
367
  ),
391
368
  datasets.includes("storage") && gradient(
392
369
  {
393
370
  id: "color-storage"
394
371
  },
395
- options.colors.storage,
396
- fade
372
+ options.colors.storage
397
373
  ),
398
374
  datasets.includes("workflows") && gradient(
399
375
  {
400
376
  id: "color-workflows"
401
377
  },
402
- options.colors.workflows,
403
- fade
378
+ options.colors.workflows
404
379
  )
405
380
  ] }),
406
381
  /* @__PURE__ */ jsx(
@@ -428,9 +403,9 @@ const ChartLine = ({
428
403
  // @story redemptions/overview
429
404
  // A money chart passes `format` so a day's summed gross reads
430
405
  // "$12.50", not 12.500000000000002; counts pass nothing.
431
- formatter: (value, key) => [
406
+ formatter: (value, name) => [
432
407
  format(value),
433
- name(key)
408
+ label(name)
434
409
  ]
435
410
  }
436
411
  }
@@ -439,7 +414,7 @@ const ChartLine = ({
439
414
  Legend,
440
415
  {
441
416
  ...{
442
- formatter: (key) => name(key),
417
+ formatter: (name) => label(name),
443
418
  onClick: ({ dataKey }) => handleLegendClick(dataKey),
444
419
  ...options.legend
445
420
  }
@@ -28,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var swatch_exports = {};
30
30
  __export(swatch_exports, {
31
- Swatches: () => Swatches,
32
31
  default: () => swatch_default
33
32
  });
34
33
  module.exports = __toCommonJS(swatch_exports);
@@ -79,38 +78,4 @@ const Swatch = ({
79
78
  }
80
79
  );
81
80
  };
82
- const Swatches = ({ style }) => {
83
- var _a, _b, _c, _d, _e, _f;
84
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
- "span",
86
- {
87
- ...{
88
- className: "flex items-center space-x-1 shrink-0"
89
- },
90
- children: [
91
- ["Background color", (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color],
92
- ["Text color", (_b = style == null ? void 0 : style.text) == null ? void 0 : _b.color],
93
- ["Button color", (_d = (_c = style == null ? void 0 : style.button) == null ? void 0 : _c.background) == null ? void 0 : _d.color],
94
- ["Button text color", (_f = (_e = style == null ? void 0 : style.button) == null ? void 0 : _e.text) == null ? void 0 : _f.color]
95
- ].map(([label, color]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
96
- "span",
97
- {
98
- ...{
99
- "aria-label": label + " " + ((color == null ? void 0 : color.hex) || ""),
100
- className: "w-6 h-6 block rounded border shrink-0",
101
- role: "img",
102
- style: {
103
- backgroundColor: color == null ? void 0 : color.hex
104
- }
105
- }
106
- },
107
- label
108
- ))
109
- }
110
- );
111
- };
112
81
  var swatch_default = Swatch;
113
- // Annotate the CommonJS export names for ESM import in node:
114
- 0 && (module.exports = {
115
- Swatches
116
- });