@airtable/blocks 1.18.0 → 1.18.2

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 (481) hide show
  1. package/CHANGELOG.md +552 -0
  2. package/dist/cjs/color_utils.js +21 -23
  3. package/dist/cjs/colors.js +4 -60
  4. package/dist/cjs/error_utils.js +15 -25
  5. package/dist/cjs/event_tracker.js +5 -11
  6. package/dist/cjs/global_config.js +107 -188
  7. package/dist/cjs/index.js +16 -40
  8. package/dist/cjs/injected/airtable_interface.js +1 -6
  9. package/dist/cjs/models/abstract_model.js +50 -81
  10. package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
  11. package/dist/cjs/models/base.js +211 -374
  12. package/dist/cjs/models/create_aggregators.js +53 -47
  13. package/dist/cjs/models/cursor.js +125 -201
  14. package/dist/cjs/models/field.js +256 -303
  15. package/dist/cjs/models/grouped_record_query_result.js +210 -286
  16. package/dist/cjs/models/linked_records_query_result.js +276 -454
  17. package/dist/cjs/models/models.js +36 -50
  18. package/dist/cjs/models/mutation_constants.js +5 -9
  19. package/dist/cjs/models/mutations.js +125 -338
  20. package/dist/cjs/models/object_pool.js +37 -94
  21. package/dist/cjs/models/record.js +132 -226
  22. package/dist/cjs/models/record_coloring.js +14 -19
  23. package/dist/cjs/models/record_query_result.js +323 -282
  24. package/dist/cjs/models/record_store.js +355 -688
  25. package/dist/cjs/models/session.js +99 -158
  26. package/dist/cjs/models/table.js +361 -549
  27. package/dist/cjs/models/table_or_view_query_result.js +410 -765
  28. package/dist/cjs/models/view.js +161 -204
  29. package/dist/cjs/models/view_data_store.js +177 -282
  30. package/dist/cjs/models/view_metadata_query_result.js +96 -127
  31. package/dist/cjs/perform_record_action.js +69 -103
  32. package/dist/cjs/private_utils.js +133 -223
  33. package/dist/cjs/sdk.js +97 -142
  34. package/dist/cjs/settings_button.js +30 -57
  35. package/dist/cjs/stats/block_stats.js +3 -15
  36. package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
  37. package/dist/cjs/types/airtable_interface.js +36 -8
  38. package/dist/cjs/types/field.js +66 -12
  39. package/dist/cjs/types/mutations.js +99 -6
  40. package/dist/cjs/types/permission_levels.js +2 -4
  41. package/dist/cjs/types/undo_redo.js +2 -3
  42. package/dist/cjs/types/view.js +16 -11
  43. package/dist/cjs/ui/base_provider.js +14 -9
  44. package/dist/cjs/ui/baymax_utils.js +107 -1102
  45. package/dist/cjs/ui/block_wrapper.js +30 -68
  46. package/dist/cjs/ui/box.js +52 -56
  47. package/dist/cjs/ui/button.js +60 -77
  48. package/dist/cjs/ui/cell_renderer.js +78 -139
  49. package/dist/cjs/ui/choice_token.js +45 -47
  50. package/dist/cjs/ui/collaborator_token.js +33 -54
  51. package/dist/cjs/ui/color_palette.js +58 -106
  52. package/dist/cjs/ui/color_palette_synced.js +41 -52
  53. package/dist/cjs/ui/confirmation_dialog.js +53 -69
  54. package/dist/cjs/ui/control_sizes.js +21 -46
  55. package/dist/cjs/ui/create_detect_element_resize.js +16 -50
  56. package/dist/cjs/ui/css_helpers.js +3 -10
  57. package/dist/cjs/ui/dialog.js +44 -71
  58. package/dist/cjs/ui/dialog_close_button.js +52 -72
  59. package/dist/cjs/ui/expand_record.js +4 -11
  60. package/dist/cjs/ui/expand_record_list.js +6 -11
  61. package/dist/cjs/ui/expand_record_picker_async.js +18 -35
  62. package/dist/cjs/ui/field_icon.js +25 -28
  63. package/dist/cjs/ui/field_picker.js +47 -81
  64. package/dist/cjs/ui/field_picker_synced.js +33 -44
  65. package/dist/cjs/ui/form_field.js +45 -64
  66. package/dist/cjs/ui/geometry/geometry.js +6 -10
  67. package/dist/cjs/ui/geometry/point.js +5 -13
  68. package/dist/cjs/ui/geometry/rect.js +7 -29
  69. package/dist/cjs/ui/geometry/size.js +5 -13
  70. package/dist/cjs/ui/global_alert.js +35 -61
  71. package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
  72. package/dist/cjs/ui/heading.js +63 -92
  73. package/dist/cjs/ui/icon.js +44 -66
  74. package/dist/cjs/ui/icon_config.js +13 -24
  75. package/dist/cjs/ui/initialize_block.js +23 -36
  76. package/dist/cjs/ui/input.js +74 -87
  77. package/dist/cjs/ui/input_synced.js +34 -43
  78. package/dist/cjs/ui/key_codes.js +4 -9
  79. package/dist/cjs/ui/label.js +45 -50
  80. package/dist/cjs/ui/link.js +74 -89
  81. package/dist/cjs/ui/loader.js +26 -42
  82. package/dist/cjs/ui/modal.js +63 -89
  83. package/dist/cjs/ui/model_picker_select.js +29 -47
  84. package/dist/cjs/ui/popover.js +98 -180
  85. package/dist/cjs/ui/progress_bar.js +45 -51
  86. package/dist/cjs/ui/record_card.js +143 -278
  87. package/dist/cjs/ui/record_card_list.js +117 -165
  88. package/dist/cjs/ui/remote_utils.js +5 -13
  89. package/dist/cjs/ui/sdk_context.js +7 -9
  90. package/dist/cjs/ui/select.js +84 -118
  91. package/dist/cjs/ui/select_and_select_buttons_helpers.js +27 -45
  92. package/dist/cjs/ui/select_buttons.js +54 -90
  93. package/dist/cjs/ui/select_buttons_synced.js +32 -41
  94. package/dist/cjs/ui/select_synced.js +32 -42
  95. package/dist/cjs/ui/switch.js +66 -84
  96. package/dist/cjs/ui/switch_synced.js +32 -38
  97. package/dist/cjs/ui/synced.js +16 -43
  98. package/dist/cjs/ui/system/all_styles_set.js +89 -22
  99. package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
  100. package/dist/cjs/ui/system/appearance/background_color.js +6 -12
  101. package/dist/cjs/ui/system/appearance/border.js +6 -12
  102. package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
  103. package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
  104. package/dist/cjs/ui/system/appearance/opacity.js +5 -11
  105. package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
  106. package/dist/cjs/ui/system/dimensions/height.js +5 -11
  107. package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
  108. package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
  109. package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
  110. package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
  111. package/dist/cjs/ui/system/dimensions/width.js +5 -11
  112. package/dist/cjs/ui/system/display.js +8 -9
  113. package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
  114. package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
  115. package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
  116. package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
  117. package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
  118. package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
  119. package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
  120. package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
  121. package/dist/cjs/ui/system/flex_item/flex.js +5 -11
  122. package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
  123. package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
  124. package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
  125. package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
  126. package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
  127. package/dist/cjs/ui/system/flex_item/order.js +5 -11
  128. package/dist/cjs/ui/system/index.js +310 -362
  129. package/dist/cjs/ui/system/overflow.js +8 -9
  130. package/dist/cjs/ui/system/position/bottom.js +6 -13
  131. package/dist/cjs/ui/system/position/left.js +5 -12
  132. package/dist/cjs/ui/system/position/position.js +5 -11
  133. package/dist/cjs/ui/system/position/position_set.js +15 -27
  134. package/dist/cjs/ui/system/position/right.js +5 -12
  135. package/dist/cjs/ui/system/position/top.js +5 -12
  136. package/dist/cjs/ui/system/position/z_index.js +5 -11
  137. package/dist/cjs/ui/system/spacing/margin.js +5 -12
  138. package/dist/cjs/ui/system/spacing/padding.js +5 -12
  139. package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
  140. package/dist/cjs/ui/system/typography/font_family.js +5 -11
  141. package/dist/cjs/ui/system/typography/font_size.js +5 -11
  142. package/dist/cjs/ui/system/typography/font_style.js +5 -11
  143. package/dist/cjs/ui/system/typography/font_weight.js +5 -11
  144. package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
  145. package/dist/cjs/ui/system/typography/line_height.js +5 -11
  146. package/dist/cjs/ui/system/typography/text_align.js +5 -11
  147. package/dist/cjs/ui/system/typography/text_color.js +5 -11
  148. package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
  149. package/dist/cjs/ui/system/typography/text_transform.js +5 -11
  150. package/dist/cjs/ui/system/typography/typography_set.js +15 -31
  151. package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
  152. package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
  153. package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +2 -14
  154. package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
  155. package/dist/cjs/ui/table_picker.js +26 -43
  156. package/dist/cjs/ui/table_picker_synced.js +33 -42
  157. package/dist/cjs/ui/text.js +59 -71
  158. package/dist/cjs/ui/text_button.js +80 -97
  159. package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
  160. package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
  161. package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
  162. package/dist/cjs/ui/theme/default_theme/index.js +15 -32
  163. package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
  164. package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
  165. package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
  166. package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
  167. package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
  168. package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
  169. package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
  170. package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
  171. package/dist/cjs/ui/theme/theme_context.js +3 -6
  172. package/dist/cjs/ui/theme/use_theme.js +1 -7
  173. package/dist/cjs/ui/tooltip.js +38 -79
  174. package/dist/cjs/ui/types/aria_props.js +3 -7
  175. package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
  176. package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
  177. package/dist/cjs/ui/ui.js +89 -130
  178. package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
  179. package/dist/cjs/ui/use_array_identity.js +0 -4
  180. package/dist/cjs/ui/use_base.js +4 -13
  181. package/dist/cjs/ui/use_cursor.js +3 -12
  182. package/dist/cjs/ui/use_form_field.js +4 -6
  183. package/dist/cjs/ui/use_global_config.js +3 -10
  184. package/dist/cjs/ui/use_loadable.js +59 -132
  185. package/dist/cjs/ui/use_record_action_data.js +6 -12
  186. package/dist/cjs/ui/use_records.js +23 -24
  187. package/dist/cjs/ui/use_session.js +6 -15
  188. package/dist/cjs/ui/use_settings_button.js +4 -11
  189. package/dist/cjs/ui/use_styled_system.js +12 -21
  190. package/dist/cjs/ui/use_synced.js +0 -7
  191. package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
  192. package/dist/cjs/ui/use_view_metadata.js +5 -8
  193. package/dist/cjs/ui/use_viewport.js +1 -7
  194. package/dist/cjs/ui/use_watchable.js +36 -74
  195. package/dist/cjs/ui/view_picker.js +44 -78
  196. package/dist/cjs/ui/view_picker_synced.js +33 -44
  197. package/dist/cjs/ui/viewport_constraint.js +37 -64
  198. package/dist/cjs/ui/with_hooks.js +17 -22
  199. package/dist/cjs/ui/with_styled_system.js +33 -60
  200. package/dist/cjs/undo_redo.js +12 -32
  201. package/dist/cjs/unstable_private_utils.js +6 -8
  202. package/dist/cjs/unstable_testing_utils.js +44 -57
  203. package/dist/cjs/viewport.js +127 -189
  204. package/dist/cjs/warning.js +5 -6
  205. package/dist/cjs/watchable.js +66 -148
  206. package/dist/types/src/colors.d.ts +1 -1
  207. package/dist/types/src/colors.d.ts.map +1 -1
  208. package/dist/types/src/global_config.d.ts +1 -1
  209. package/dist/types/src/global_config.d.ts.map +1 -1
  210. package/dist/types/src/models/base.d.ts +1 -1
  211. package/dist/types/src/models/base.d.ts.map +1 -1
  212. package/dist/types/src/models/cursor.d.ts +1 -1
  213. package/dist/types/src/models/cursor.d.ts.map +1 -1
  214. package/dist/types/src/models/field.d.ts +1 -1
  215. package/dist/types/src/models/field.d.ts.map +1 -1
  216. package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
  217. package/dist/types/src/models/models.d.ts.map +1 -1
  218. package/dist/types/src/models/record.d.ts +1 -1
  219. package/dist/types/src/models/record.d.ts.map +1 -1
  220. package/dist/types/src/models/record_coloring.d.ts +2 -2
  221. package/dist/types/src/models/record_coloring.d.ts.map +1 -1
  222. package/dist/types/src/models/record_query_result.d.ts +3 -3
  223. package/dist/types/src/models/record_query_result.d.ts.map +1 -1
  224. package/dist/types/src/models/session.d.ts +1 -1
  225. package/dist/types/src/models/session.d.ts.map +1 -1
  226. package/dist/types/src/models/table.d.ts +1 -1
  227. package/dist/types/src/models/table.d.ts.map +1 -1
  228. package/dist/types/src/models/view.d.ts +1 -1
  229. package/dist/types/src/models/view.d.ts.map +1 -1
  230. package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
  231. package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
  232. package/dist/types/src/perform_record_action.d.ts +1 -1
  233. package/dist/types/src/perform_record_action.d.ts.map +1 -1
  234. package/dist/types/src/private_utils.d.ts +8 -8
  235. package/dist/types/src/private_utils.d.ts.map +1 -1
  236. package/dist/types/src/sdk.d.ts +1 -1
  237. package/dist/types/src/sdk.d.ts.map +1 -1
  238. package/dist/types/src/settings_button.d.ts +1 -1
  239. package/dist/types/src/settings_button.d.ts.map +1 -1
  240. package/dist/types/src/types/aggregators.d.ts +1 -1
  241. package/dist/types/src/types/aggregators.d.ts.map +1 -1
  242. package/dist/types/src/types/airtable_interface.d.ts +6 -6
  243. package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
  244. package/dist/types/src/types/attachment.d.ts +1 -1
  245. package/dist/types/src/types/attachment.d.ts.map +1 -1
  246. package/dist/types/src/types/base.d.ts +1 -1
  247. package/dist/types/src/types/base.d.ts.map +1 -1
  248. package/dist/types/src/types/block.d.ts +1 -1
  249. package/dist/types/src/types/block.d.ts.map +1 -1
  250. package/dist/types/src/types/collaborator.d.ts +1 -1
  251. package/dist/types/src/types/collaborator.d.ts.map +1 -1
  252. package/dist/types/src/types/field.d.ts +5 -5
  253. package/dist/types/src/types/field.d.ts.map +1 -1
  254. package/dist/types/src/types/global_config.d.ts +6 -6
  255. package/dist/types/src/types/global_config.d.ts.map +1 -1
  256. package/dist/types/src/types/mutations.d.ts +4 -4
  257. package/dist/types/src/types/mutations.d.ts.map +1 -1
  258. package/dist/types/src/types/permission_levels.d.ts +1 -1
  259. package/dist/types/src/types/permission_levels.d.ts.map +1 -1
  260. package/dist/types/src/types/record.d.ts +2 -2
  261. package/dist/types/src/types/record.d.ts.map +1 -1
  262. package/dist/types/src/types/record_action_data.d.ts +1 -1
  263. package/dist/types/src/types/record_action_data.d.ts.map +1 -1
  264. package/dist/types/src/types/table.d.ts +3 -3
  265. package/dist/types/src/types/table.d.ts.map +1 -1
  266. package/dist/types/src/types/undo_redo.d.ts +1 -1
  267. package/dist/types/src/types/undo_redo.d.ts.map +1 -1
  268. package/dist/types/src/types/view.d.ts +4 -4
  269. package/dist/types/src/types/view.d.ts.map +1 -1
  270. package/dist/types/src/ui/base_provider.d.ts +1 -1
  271. package/dist/types/src/ui/base_provider.d.ts.map +1 -1
  272. package/dist/types/src/ui/block_wrapper.d.ts +2 -2
  273. package/dist/types/src/ui/button.d.ts +1 -1
  274. package/dist/types/src/ui/button.d.ts.map +1 -1
  275. package/dist/types/src/ui/cell_renderer.d.ts +2 -2
  276. package/dist/types/src/ui/choice_token.d.ts +3 -3
  277. package/dist/types/src/ui/choice_token.d.ts.map +1 -1
  278. package/dist/types/src/ui/collaborator_token.d.ts +5 -5
  279. package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
  280. package/dist/types/src/ui/color_palette.d.ts +2 -2
  281. package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
  282. package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
  283. package/dist/types/src/ui/control_sizes.d.ts +2 -2
  284. package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
  285. package/dist/types/src/ui/dialog.d.ts +2 -2
  286. package/dist/types/src/ui/dialog.d.ts.map +1 -1
  287. package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
  288. package/dist/types/src/ui/field_icon.d.ts +3 -3
  289. package/dist/types/src/ui/field_icon.d.ts.map +1 -1
  290. package/dist/types/src/ui/field_picker.d.ts +1 -1
  291. package/dist/types/src/ui/global_alert.d.ts +1 -1
  292. package/dist/types/src/ui/global_alert.d.ts.map +1 -1
  293. package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
  294. package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
  295. package/dist/types/src/ui/heading.d.ts +3 -3
  296. package/dist/types/src/ui/heading.d.ts.map +1 -1
  297. package/dist/types/src/ui/icon.d.ts +1 -1
  298. package/dist/types/src/ui/icon_config.d.ts +39 -39
  299. package/dist/types/src/ui/icon_config.d.ts.map +1 -1
  300. package/dist/types/src/ui/initialize_block.d.ts +3 -3
  301. package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
  302. package/dist/types/src/ui/input.d.ts +15 -15
  303. package/dist/types/src/ui/input.d.ts.map +1 -1
  304. package/dist/types/src/ui/link.d.ts +1 -1
  305. package/dist/types/src/ui/link.d.ts.map +1 -1
  306. package/dist/types/src/ui/loader.d.ts +1 -1
  307. package/dist/types/src/ui/loader.d.ts.map +1 -1
  308. package/dist/types/src/ui/model_picker_select.d.ts +1 -1
  309. package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
  310. package/dist/types/src/ui/popover.d.ts +5 -5
  311. package/dist/types/src/ui/popover.d.ts.map +1 -1
  312. package/dist/types/src/ui/progress_bar.d.ts +1 -1
  313. package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
  314. package/dist/types/src/ui/record_card.d.ts +2 -2
  315. package/dist/types/src/ui/record_card.d.ts.map +1 -1
  316. package/dist/types/src/ui/record_card_list.d.ts +1 -1
  317. package/dist/types/src/ui/select.d.ts +4 -4
  318. package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
  319. package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
  320. package/dist/types/src/ui/select_buttons.d.ts +4 -4
  321. package/dist/types/src/ui/switch.d.ts +1 -1
  322. package/dist/types/src/ui/switch.d.ts.map +1 -1
  323. package/dist/types/src/ui/synced.d.ts +3 -3
  324. package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
  325. package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
  326. package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
  327. package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
  328. package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
  329. package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
  330. package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
  331. package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
  332. package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
  333. package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
  334. package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
  335. package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
  336. package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
  337. package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
  338. package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
  339. package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
  340. package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
  341. package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
  342. package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
  343. package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
  344. package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
  345. package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
  346. package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
  347. package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
  348. package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
  349. package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
  350. package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
  351. package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
  352. package/dist/types/src/ui/system/display.d.ts +0 -1
  353. package/dist/types/src/ui/system/display.d.ts.map +1 -1
  354. package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
  355. package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
  356. package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
  357. package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
  358. package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
  359. package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
  360. package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
  361. package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
  362. package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
  363. package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
  364. package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
  365. package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
  366. package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
  367. package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
  368. package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
  369. package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
  370. package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
  371. package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
  372. package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
  373. package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
  374. package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
  375. package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
  376. package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
  377. package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
  378. package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
  379. package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
  380. package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
  381. package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
  382. package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
  383. package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
  384. package/dist/types/src/ui/system/overflow.d.ts +0 -1
  385. package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
  386. package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
  387. package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
  388. package/dist/types/src/ui/system/position/left.d.ts +0 -1
  389. package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
  390. package/dist/types/src/ui/system/position/position.d.ts +0 -1
  391. package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
  392. package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
  393. package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
  394. package/dist/types/src/ui/system/position/right.d.ts +0 -1
  395. package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
  396. package/dist/types/src/ui/system/position/top.d.ts +0 -1
  397. package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
  398. package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
  399. package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
  400. package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
  401. package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
  402. package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
  403. package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
  404. package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
  405. package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
  406. package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
  407. package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
  408. package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
  409. package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
  410. package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
  411. package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
  412. package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
  413. package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
  414. package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
  415. package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
  416. package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
  417. package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
  418. package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
  419. package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
  420. package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
  421. package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
  422. package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
  423. package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
  424. package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
  425. package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
  426. package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
  427. package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
  428. package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
  429. package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
  430. package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
  431. package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
  432. package/dist/types/src/ui/system/utils/types.d.ts +4 -4
  433. package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
  434. package/dist/types/src/ui/text.d.ts +3 -3
  435. package/dist/types/src/ui/text.d.ts.map +1 -1
  436. package/dist/types/src/ui/text_button.d.ts +1 -1
  437. package/dist/types/src/ui/text_button.d.ts.map +1 -1
  438. package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
  439. package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
  440. package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
  441. package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
  442. package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
  443. package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
  444. package/dist/types/src/ui/tooltip.d.ts +3 -3
  445. package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
  446. package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
  447. package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
  448. package/dist/types/src/ui/use_base.d.ts.map +1 -1
  449. package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
  450. package/dist/types/src/ui/use_form_field.d.ts +0 -2
  451. package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
  452. package/dist/types/src/ui/use_records.d.ts +2 -2
  453. package/dist/types/src/ui/use_records.d.ts.map +1 -1
  454. package/dist/types/src/ui/use_session.d.ts.map +1 -1
  455. package/dist/types/src/ui/view_picker.d.ts +2 -2
  456. package/dist/types/src/ui/view_picker.d.ts.map +1 -1
  457. package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
  458. package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
  459. package/dist/types/src/viewport.d.ts +2 -2
  460. package/dist/types/src/viewport.d.ts.map +1 -1
  461. package/dist/types/src/warning.d.ts +1 -1
  462. package/dist/types/src/warning.d.ts.map +1 -1
  463. package/dist/types/stories/helpers/code_block.d.ts +2 -2
  464. package/dist/types/stories/helpers/code_block.d.ts.map +1 -1
  465. package/dist/types/stories/helpers/example.d.ts +5 -5
  466. package/dist/types/stories/helpers/example.d.ts.map +1 -1
  467. package/dist/types/stories/helpers/example_code_panel.d.ts +2 -2
  468. package/dist/types/stories/helpers/example_code_panel.d.ts.map +1 -1
  469. package/dist/types/stories/helpers/fake_cell_renderer.d.ts +2 -2
  470. package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -1
  471. package/dist/types/stories/helpers/fake_foreign_record.d.ts +1 -1
  472. package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +1 -1
  473. package/dist/types/stories/helpers/fake_record_card.d.ts +2 -2
  474. package/dist/types/stories/helpers/fake_record_card.d.ts.map +1 -1
  475. package/dist/types/stories/helpers/style_prop_list.d.ts +2 -2
  476. package/dist/types/stories/helpers/style_prop_list.d.ts.map +1 -1
  477. package/dist/types/stories/icon_example.d.ts +2 -2
  478. package/dist/types/stories/icon_example.d.ts.map +1 -1
  479. package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -1
  480. package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -1
  481. package/package.json +26 -25
package/CHANGELOG.md ADDED
@@ -0,0 +1,552 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project
6
+ started to follow semantic versioning as of version 1.0.0.
7
+
8
+ Not every commit needs to result in a change to this file (e.g. docs and chore commits). Every
9
+ commit that affects the code in a way that consumers might care about should include edits to the
10
+ 'Unreleased' section though. Breaking changes should be prefixed with `**BREAKING:**`.
11
+
12
+ ## [Unreleased](https://github.com/airtable/blocks/compare/@airtable/blocks@1.18.2...HEAD)
13
+
14
+ No changes.
15
+
16
+ ## [1.18.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.18.1...@airtable/blocks@1.18.2) - 2024-09-25
17
+
18
+ - Upgrade Typescript version to 5.4.5
19
+ - Perform routine version upgrade to various packages, including `react` and `eslint`
20
+
21
+ ## [1.18.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.18.0...@airtable/blocks@1.18.1) - 2023-11-29
22
+
23
+ - Support React 17 as a peer dependency.
24
+
25
+ ## [1.18.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.17.0...@airtable/blocks@1.18.0) - 2023-09-15
26
+
27
+ - Add `FieldType.AI_TEXT`.
28
+
29
+ ## [1.17.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.16.0...@airtable/blocks@1.17.0) - 2023-04-14
30
+
31
+ No changes.
32
+
33
+ ## [1.16.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.15.0...@airtable/blocks@1.16.0) - 2023-03-08
34
+
35
+ - Update `FieldType.DATE_TIME` documentation to add additional time zones and clarify the write
36
+ behavior.
37
+ - Visually refresh all icons
38
+
39
+ ## [1.15.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.14.0...@airtable/blocks@1.15.0) - 2022-09-23
40
+
41
+ - Add `applyRowTemplate` icon
42
+ - Update `FieldType.DATE_TIME` documentation to pre-announce write behavior for field level time
43
+ zones
44
+ - Modify `createRecordsAsync`, `updateRecordsAsync`, `convertStringToCellValue` so that date
45
+ string inputs to date time fields are interpreted correctly for utc or client time zone, fixing
46
+ previously incorrect behaviors. In this new version, ambiguous strings like
47
+ "2020-09-05T07:00:00" and "2020-09-08" will be interpreted according to the `timeZone` of the
48
+ field, and nonambiguous string inputs with zone offset like "2020-09-05T07:00:00.000Z" and
49
+ "2020-09-08T00:00:00-07:00" will be interpreted correctly as the underlying timestamp.
50
+
51
+ ## [1.14.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.13.0...@airtable/blocks@1.14.0) - 2022-07-26
52
+
53
+ - Add `personalCloseup` icon
54
+ - Add `xCheckbox` icon
55
+
56
+ ## [1.13.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.12.0...@airtable/blocks@1.13.0) - 2022-06-28
57
+
58
+ - Add ability to read (and watch) if a view is locked
59
+ - Update `FieldType.MULTIPLE_COLLABORATOR` documentation to include user group collaborator
60
+ information
61
+
62
+ ## [1.12.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.11.1...@airtable/blocks@1.12.0) - 2022-06-22
63
+
64
+ - Update fallback value in `Base.getMaxRecordsPerTable`
65
+ - Add `overlay` icon
66
+ - Update `cursor.setActiveTable` and `cursor.setActiveView` documentation to describe fullscreen
67
+ exit behavior correctly
68
+ - Fix an issue where rapidly subscribing and unsubscribing to a single field could cause a
69
+ queryResult to be to incorrectly marked as loaded.
70
+ - Update API reference documentation to reflect 'extensions' in place of 'apps'
71
+ - Update examples in documentation to reflect 'extensions' in place of 'apps'
72
+
73
+ ## [1.11.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.11.0...@airtable/blocks@1.11.1) - 2022-04-13
74
+
75
+ - Update internal utilities for error reporting
76
+
77
+ ## [1.11.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.10.2...@airtable/blocks@1.11.0) - 2022-03-10
78
+
79
+ - Add workspace id to base object.
80
+ - Add `Field.updateNameAsync`
81
+ - Fixes a crash when a linked record is deleted
82
+ - Fixes a crash when a record containing a linked record is deleted and restored
83
+
84
+ ## [1.10.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.10.1...@airtable/blocks@1.10.2) - 2022-01-25
85
+
86
+ - Rare invariant failure addressed
87
+
88
+ ## [1.10.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.10.0...@airtable/blocks@1.10.1) - 2021-12-22
89
+
90
+ - Update examples for table, view and field URLs.
91
+ - Use `keyof any` instead of `PropertyKey` in type definition to avoid incompatibility with the
92
+ "[keyofStringsOnly](https://www.typescriptlang.org/tsconfig#keyofStringsOnly)" tsconfig option
93
+
94
+ ## [1.10.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.9.0...@airtable/blocks@1.10.0) - 2021-11-03
95
+
96
+ - Fix typo in cursor.ts documentation - thanks @m2creates!
97
+ - Add new `calendarDay` icon (and micro variant)
98
+ - Update documentation to include attachment url guidance
99
+ - Update field metadata writes documentation to mention that `null` will be coerced to `''`
100
+ - Fix a bug when unloading data from a `linkedRecordQueryResult` after a table deletion
101
+ - Update `children` prop of `Link` component to be optional
102
+
103
+ ## [1.9.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.8.0...@airtable/blocks@1.9.0) - 2021-09-15
104
+
105
+ - Update documentation for `FieldType.CHECKBOX` cell read & write types to be more accurate.
106
+ - Fetching field types & configs is now cached, making it more performant.
107
+ - Field descriptions can now be edited and specified when creating a new field:
108
+ - Added `field.updateDescriptionAsync`.
109
+ - Added optional `description` argument to `table.createFieldAsync`.
110
+ - Added optional `description` property to `field` objects accepted by
111
+ `base.createTableAsync`.
112
+
113
+ ## [1.8.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.7.2...@airtable/blocks@1.8.0) - 2021-07-12
114
+
115
+ - Add `opts` argument to `Field.updateOptionsAsync` with `enableSelectFieldChoiceDeletion` opt.
116
+ - Add `prefersSingleRecordLink` to `field.options` for `MULTIPLE_RECORD_LINKS` type fields.
117
+ - Add new timeline icon (and micro variant).
118
+
119
+ ## [1.7.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.7.1...@airtable/blocks@1.7.2) - 2021-05-26
120
+
121
+ - Add `FieldType.EXTERNAL_SYNC_SOURCE`.
122
+
123
+ ## [1.7.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.7.0...@airtable/blocks@1.7.1) - 2021-05-21
124
+
125
+ No changes.
126
+
127
+ ## [1.7.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.6.0...@airtable/blocks@1.7.0) - 2021-05-13
128
+
129
+ - Add `onBlur` and `onFocus` support to `Input` and `InputSynced` UI components.
130
+
131
+ ## [1.6.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.5.1...@airtable/blocks@1.6.0) - 2021-05-12
132
+
133
+ - Add `color` property to `base` to access the background color of the base, as well as the
134
+ `color` watch key
135
+ - Update documentation text for `GlobalConfig` with increased 150kb limit.
136
+ - Add `getMaxRecordsPerTable` to `base`
137
+
138
+ ## [1.5.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.5.0...@airtable/blocks@1.5.1) - 2021-03-04
139
+
140
+ No changes.
141
+
142
+ ## [1.5.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.4.1...@airtable/blocks@1.5.0) - 2021-02-25
143
+
144
+ - Add type exports for `Cursor` & `Session` to `@airtable/blocks/models`.
145
+ - Add type exports for `GlobalConfig`, `Watchable`, & `Viewport` to `@airtable/blocks/types`.
146
+ - Add `boltList`, `boltListMicro`, `contacts`, `contactsMicro`, `megaphone`, `megaphoneMicro`,
147
+ `shareWithBolt` and `shareWithBoltMicro` icons.
148
+ - Increase spacing between `label` and `description` nodes in `FormField`.
149
+ - Support creating (but not updating) `MULTIPLE_RECORD_LINKS` fields using
150
+ `table.createFieldAsync`.
151
+ - Add `isCancelButtonDisabled` and `isConfirmButtonDisabled` props to `ConfirmationDialog`.
152
+ - Add `config` property to `Field`, which is a new `FieldConfig` discriminated union type that
153
+ provides easier access to field options.
154
+ - Improve type definitions for `getHexForColor` and `getRgbForColor`.
155
+
156
+ ## [1.4.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.4.0...@airtable/blocks@1.4.1) - 2021-01-21
157
+
158
+ No changes.
159
+
160
+ ## [1.4.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.3.0...@airtable/blocks@1.4.0) - 2021-01-19
161
+
162
+ - **DEPRECATED:** importing the Base's Cursor instance from the main entrypoint, e.g.
163
+ `import {cursor} from '@airtable/blocks';`. Use the `useCursor` React Hook instead.
164
+ - **DEPRECATED:** importing the Base's Session instance from the main entrypoint, e.g.
165
+ `import {session} from '@airtable/blocks';`. Use the `useSession` React Hook instead.
166
+
167
+ ## [1.3.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.5...@airtable/blocks@1.3.0) - 2021-01-07
168
+
169
+ - Fix crash when deleting views.
170
+ - Add BaseProvider to allow rendering Components outside of the App's React tree
171
+
172
+ ## [1.2.5](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.4...@airtable/blocks@1.2.5) - 2020-12-10
173
+
174
+ No changes.
175
+
176
+ ## [1.2.4](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.3...@airtable/blocks@1.2.4) - 2020-12-10
177
+
178
+ No changes.
179
+
180
+ ## [1.2.3](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.2...@airtable/blocks@1.2.3) - 2020-12-09
181
+
182
+ - Stopped exporting an internal class that was causing typescript checking to fail on version
183
+ 1.2.2
184
+
185
+ ## [1.2.2](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.1...@airtable/blocks@1.2.2) - 2020-12-08
186
+
187
+ - Fixed a bug in useRecordActionData that caused it to crash on version 1.2.1
188
+
189
+ ## [1.2.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.2.0...@airtable/blocks@1.2.1) - 2020-11-23
190
+
191
+ - Fixed a bug that prevented TableOrViewQueryResult from notifying watchers about the
192
+ creation/deletion of sorted fields.
193
+ - Fixed a bug where deleting and undeleting a table that was already loaded caused the App to
194
+ crash.
195
+ - **DEPRECATED:** importing the UI namespace from the main entrypoint, e.g.
196
+ `import {UI} from '@airtable/blocks';`. Use `import * as UI from '@airtable/blocks/ui/ui';`
197
+ instead.
198
+ - **DEPRECATED:** importing the models namespace from the main entrypoint, e.g.
199
+ `import {models} from '@airtable/blocks';`. Use
200
+ `import * as models from '@airtable/blocks/models/models';` instead.
201
+
202
+ ## [1.2.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.1.0...@airtable/blocks@1.2.0) - 2020-10-23
203
+
204
+ - Added `automations` and fixed the SVG path for `personalAuto` in `Icon`.
205
+ - Fixed a bug that caused an App to crash when creating a new table before the App has loaded.
206
+ - Fixed a bug in watching/unwatching keys of LinkedRecordQueryResult models. Watching/unwatching
207
+ `isDataLoaded` no longer affects the model's "loaded" state.
208
+ - Fixed a bug introduced in v1.0.0 in `RecordCard` when rendering a record that has a lookup field
209
+ of an attachment field.
210
+
211
+ ## [1.1.0](https://github.com/airtable/blocks/compare/@airtable/blocks@1.0.1...@airtable/blocks@1.1.0) - 2020-09-29
212
+
213
+ - **DEPRECATED:** "blocks" as an icon name. Use `<Icon name="apps" .../>` instead.
214
+ - Fixed bugs introduced in v1.0.0 that broke using lookup cell values with
215
+ `Record.getCellValueAsString`, `aggregator.aggregate` and `aggregator.aggregateToString`
216
+
217
+ ## [1.0.1](https://github.com/airtable/blocks/compare/@airtable/blocks@1.0.0...@airtable/blocks@1.0.1) - 2020-09-24
218
+
219
+ - Fixed bug where `Select`, `SelectButtons`, and `Synced` variants behaved incorrectly when there
220
+ were multiple items with the same value.
221
+ - Fix a bug using lookup cell values with `<CellRenderer />` introduced in v1.0.0
222
+
223
+ ## [1.0.0](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.55...@airtable/blocks@1.0.0) - 2020-09-14
224
+
225
+ - **BREAKING:** The cell value format for lookup fields (`FieldType.MULTIPLE_LOOKUP_VALUES`) is
226
+ now `Array<{linkedRecordId: RecordId, value: CellValue}>`
227
+ - **BREAKING:** Remove `Record.primaryCellValue` and `Record.primaryCellValueAsString`, as well as
228
+ the `primaryCellValue` watchable key on Record. These APIs were deprecated in v0.0.45
229
+ - **BREAKING:** Remove legacy record creation format. All calls to `Table.createRecordAsync` /
230
+ `Table.createRecordsAsync` must define record field mappings under a `fields` key. These APIs
231
+ were deprecated in v0.0.41.
232
+
233
+ ## [0.0.55](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.54...@airtable/blocks@0.0.55) - 2020-09-02
234
+
235
+ No changes.
236
+
237
+ ## [0.0.54](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.53...@airtable/blocks@0.0.54) - 2020-08-12
238
+
239
+ - Remove `unstable_` prefix from `Field.updateOptionsAsync`, `Table.createFieldAsync`, and
240
+ `Base.createTableAsync`. See
241
+ [Changing base schema](https://airtable.com/developers/blocks/guides/changing-base-schema) for
242
+ full details.
243
+
244
+ ## [0.0.53](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.52...@airtable/blocks@0.0.53) - 2020-06-24
245
+
246
+ - Fix a typo in the docs for `globalConfig.setAsync`.
247
+ - Added an explicit `box-sizing: border-box;` to the inner div of ChoiceToken, to prevent
248
+ accidentally inheriting different box-sizing values.
249
+
250
+ ## [0.0.52](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.51...@airtable/blocks@0.0.52) - 2020-06-08
251
+
252
+ - Add `FieldType.CREATED_BY`, `FieldType.LAST_MODIFIED_BY`, and `FieldType.BUTTON`.
253
+ - Add record action APIs! Use one in your block to handle "open block" requests from a button
254
+ field.
255
+ - `useRecordActionData`
256
+ - `registerRecordActionDataCallback`
257
+
258
+ ## [0.0.51](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.50...@airtable/blocks@0.0.51) - 2020-05-28
259
+
260
+ - Fix a bug introduced in 0.0.48 that caused typechecking errors for blocks using TypeScript.
261
+
262
+ ## [0.0.50](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.49...@airtable/blocks@0.0.50) - 2020-05-28
263
+
264
+ No changes.
265
+
266
+ ## [0.0.49](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.48...@airtable/blocks@0.0.49) - 2020-05-21
267
+
268
+ - Adds optional `renderInvalidCellValue` prop to `RecordCard` and `CellRenderer` to render a
269
+ component if validation fails.
270
+
271
+ ## [0.0.48](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.47...@airtable/blocks@0.0.48) - 2020-04-30
272
+
273
+ No changes.
274
+
275
+ ## [0.0.47](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.46...@airtable/blocks@0.0.47) - 2020-04-23
276
+
277
+ - UI components that don't depend on base data can now be used outside of the blocks environment.
278
+
279
+ ## [0.0.46](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.45...@airtable/blocks@0.0.46) - 2020-04-16
280
+
281
+ - `FieldType.RICH_TEXT` has been added, which encompasses long text fields with the new rich text
282
+ formatting option enabled. (See Airtable's announcement regarding
283
+ [rich text formatting in long text fields](https://blog.airtable.com/4-workflows-for-rich-text-formatting/))
284
+ - `Switch` and `SwitchSynced` now truncate the label.
285
+ - Fix a bug where `RecordCard` performs the default expand record behavior, even if an `onClick`
286
+ override is supplied. It now properly handles overrides as described in the documentation. This
287
+ fix also applies to `onRecordClick` in `RecordCardList`.
288
+ - Beta: New field and table writes API! You can now create tables and fields and update field
289
+ options.
290
+ - `base.unstable_createTableAsync`
291
+ - `table.unstable_createFieldAsync`
292
+ - `field.unstable_updateOptionsAsync`
293
+ - These APIs are unstable and may have breaking changes in the future.
294
+ - Not all field types are supported at this time. Refer to `FieldType` documentation for
295
+ details.
296
+
297
+ ## [0.0.45](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.44...@airtable/blocks@0.0.45) - 2020-03-31
298
+
299
+ - **DEPRECATED:** `record.primaryCellValue` and `record.primaryCellValueAsString`.
300
+ - The `primaryCellValue` watch key on `record` is also deprecated - use the `name` watch key
301
+ instead.
302
+ - Add the following APIs to match the new scripting block:
303
+ - **Convenience model getters.** These are useful when you're working on a block for a
304
+ specific base, but best-practice for more generic blocks is to prefer the existing
305
+ `ById`/`ByName` methods.
306
+ - `base.getCollaboratorIfExists`
307
+ - `base.getCollaborator`
308
+ - `base.getTableIfExists`
309
+ - `base.getTable`
310
+ - `table.getFieldIdExists`
311
+ - `table.getField`
312
+ - `table.getViewIfExists`
313
+ - `table.getView`
314
+ - **Async `select` queries.** For creating UIs from a query, the best practice is still to use
315
+ `useRecords` etc. Directly querying data is useful for one-off data processing though.
316
+ - `table.selectRecordsAsync`
317
+ - `view.selectRecordsAsync`
318
+ - `view.selectMetadataAsync`
319
+ - `record.selectLinkedRecordsFromCellAsync`
320
+ - **`record.name`** replaces `record.primaryCellValueAsString`.
321
+ - Fix some incorrectly redacted internal typescript types
322
+
323
+ ## [0.0.44](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.43...@airtable/blocks@0.0.44) - 2020-03-27
324
+
325
+ - `TextButton` now supports including an icon without a label.
326
+ - Properly export the `useSynced` hook.
327
+ - Errors now output model names instead of IDs when available.
328
+ - Fix a positioning bug with `SelectButtons` where unwanted empty space could appear when the
329
+ component is used in a scrollable list.
330
+
331
+ ## [0.0.43](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.42...@airtable/blocks@0.0.43) - 2020-02-28
332
+
333
+ - Export the `useSynced` hook for syncing a component to `GlobalConfig`.
334
+
335
+ ## [0.0.42](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.41...@airtable/blocks@0.0.42) - 2020-02-10
336
+
337
+ - **BREAKING**: Field type and view type enums are now exported from '@airtable/blocks/models' as
338
+ `FieldType` and `ViewType` (previously `fieldTypes` and `viewTypes`). Relatedly, these types are
339
+ no longer exported from '@airtable/blocks/types', as they can now be referenced from the model
340
+ exports.
341
+ - Updates to record convenience hooks
342
+ - `useRecords` now accepts a `Table` or `View` and optional `RecordQueryResultOpts`. Passing a
343
+ `RecordQueryResult` is still supported.
344
+ - `useRecordIds` now accepts a `Table` or `View` and optional `RecordIdQueryResultOpts`.
345
+ Passing a `RecordQueryResult` is still supported.
346
+ - `useRecordById` now accepts a `Table` or `View` and optional `SingleRecordQueryResultOpts`.
347
+ Passing a `RecordQueryResult` is still supported.
348
+ - Added `cursor.selectedFieldIds` which returns the field IDs that are selected in grid view
349
+
350
+ ## [0.0.41](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.40...@airtable/blocks@0.0.41) - 2020-01-27
351
+
352
+ - **BREAKING**: `useWatchable` will now throw an error if the second argument `keys` is
353
+ `undefined`. Previously, this would no-op.
354
+ - Added support for `setActiveTable` and `setActiveView` to the `cursor` API. These can be used to
355
+ manipulate the current table and/or view on the main Airtable page from inside a block.
356
+ - Table.createRecordsAsync now accepts an array of objects containing a `fields` object of field
357
+ \-> cell value mappings, rather an accepting field -> cell value mappings directly. This brings
358
+ its API in line with `updateRecordsAsync` and other Airtable APIs. The old behavior is still
359
+ supported but has been deprecated and will be removed in a future version.
360
+ - Fixed issue where blocks would crash in MS Edge due to a browser bug with `super` method calls.
361
+ - Changed default Tooltip `placementOffsetX` and `placementOffsetY` to `8` pixels. `undefined`.
362
+ Previously, this would no-op.
363
+ - Added default blue `barColor` to `ProgressBar`.
364
+
365
+ ## [0.0.40](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.39...@airtable/blocks@0.0.40) - 2020-01-09
366
+
367
+ - Added permission checks that don't require specifying a table to `session`:
368
+ - `session.checkPermissionsForUpdateRecords()`
369
+ - `session.hasPermissionToUpdateRecords()`
370
+ - `session.checkPermissionsForCreateRecords()`
371
+ - `session.hasPermissionToCreateRecords()`
372
+ - `session.checkPermissionsForDeleteRecords()`
373
+ - `session.hasPermissionToDeleteRecords()`
374
+
375
+ ## [0.0.39](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.38...@airtable/blocks@0.0.39) - 2019-12-12
376
+
377
+ - Changed the font sizes for the `size` variants of `Select` and `Button`.
378
+ - `useWatchable` now supports single string watch keys being passed in (as well as the existing
379
+ array support)
380
+ - Fixed bug where `shouldAllowPickingNone` didn't work in `FieldPicker` and `FieldPickerSynced`.
381
+ - Updated `fullscreen` and `fullscreenMicro` icons.
382
+ - Updated UI.Button component to better support icon buttons containing no text. An error is now
383
+ logged to the console if you attempt to use a UI.Button component with no text/children and no
384
+ aria-label.
385
+
386
+ ## [0.0.36](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.35...@airtable/blocks@0.0.36) - 2019-11-18
387
+
388
+ - Added `table.description` and `field.description`, and `description` watch key on `table` and
389
+ `field`.
390
+
391
+ ## [0.0.35](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.34...@airtable/blocks@0.0.35) - 2019-11-11
392
+
393
+ - UI library
394
+ - New API for styling UI components. Each component now exposes a certain set of CSS
395
+ properties as React props. Styling via the `className` and `style` props is still supported
396
+ but is no longer recommended. For more information, see the documentation for
397
+ [style props](https://github.com/Airtable/blocks/blob/master/packages/sdk/docs/api/modules/_airtable_blocks_ui_system__all_style_props.md#allstylesprops).
398
+ - New components:
399
+ - `Text` and `Heading` for typography.
400
+ - `Label` and `FormField` for labeling controls or form fields.
401
+ - `TextButton` for buttons that can be rendered inline with text.
402
+ - **BREAKING**: `Toggle` has been renamed to `Switch`.
403
+ - **BREAKING**: `Button` and `Switch` no longer accept the `theme` prop. Instead, you can
404
+ specify the colors for these components with the `variant` prop.
405
+ - `Link` also supports the `variant` prop, which determines the text color of the link.
406
+ - `Button`, `Input`, `Link`, `SelectButtons`, `Select`, `Switch`, and the model picker
407
+ components can now be resized via the `size` prop (one of `small`, `default`, or `large`).
408
+ - `Button`, `Icon`, `Input`, `Link`, `SelectButtons`, `Select`, `Switch`, and the model picker
409
+ components are now functional components that use the
410
+ [`React.forwardRef`](https://reactjs.org/docs/forwarding-refs.html) API.
411
+ - `SelectButtons` is now keyboard/screenreader accessible.
412
+ - Typescript
413
+ - **BREAKING** The SDK has been migrated from Flow to TypeScript. We no longer provide flow
414
+ type definitions with the release of the SDK. TypeScript definitions are provided instead.
415
+
416
+ ## [0.0.34](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.33...@airtable/blocks@0.0.34) - 2019-10-04
417
+
418
+ - Fix a regression where `UI.ConfirmationDialog` would crash the block.
419
+ - Allow passing an array of models to `useWatchable` to watch several models at once.
420
+ - **BREAKING**: `fieldTypes.LOOKUP` is now `fieldTypes.MULTIPLE_LOOKUP_VALUES`. The underlying
421
+ string has also changed from `lookup` to `multipleLookupValues`.
422
+ - Fix a regression where cover images in `UI.RecordCard` would render as `[Object object]`.
423
+
424
+ ## [0.0.33](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.32...@airtable/blocks@0.0.33) - 2019-09-26
425
+
426
+ - New settings button helpers: `useSettingsButton`, `settingsButton.show()` and
427
+ `settingsButton.hide()`.
428
+ - **BREAKING**: `settingsButton.isVisible` is no longer settable. Use `settingsButton.show()` and
429
+ `settingsButton.hide()` instead.
430
+
431
+ ## [0.0.32](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.31...@airtable/blocks@0.0.32) - 2019-09-20
432
+
433
+ - **BREAKING:** Removed `localStorage` and `sessionStorage` wrappers.
434
+ - Fix a bug where the `value` prop wouldn't get correctly passed through to `Input`
435
+
436
+ ## [0.0.31](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.30...@airtable/blocks@0.0.31) - 2019-09-18
437
+
438
+ - New record writes API! You can now create, update, and delete records directly from your block.
439
+ Check out the new
440
+ [writes guide](https://github.com/Airtable/blocks/blob/master/packages/sdk/docs/guide_writes.md)
441
+ for more information.
442
+ - **BREAKING**: several `globalConfig` APIs have changed to be consistent with the new record
443
+ writes & permissions APIs:
444
+ - `globalConfig.set()` has been removed - use the new `globalConfig.setAsync()` method
445
+ instead.
446
+ - `globalConfig.canSet()` has been renamed to `globalConfig.hasPermissionToSet()`.
447
+ - `globalConfig.setPaths()` has been removed - use the new `globalConfig.setPathsAsync()`
448
+ method instead.
449
+ - `globalConfig.canSetPaths()` has been renamed to `globalConfig.hasPermissionToSetPaths()`.
450
+ - **BREAKING:** Remove `models.generateGuid()`. Use an ID generator like
451
+ [`uuid`](https://www.npmjs.com/package/uuid) instead.
452
+ - **BREAKING:** Deprecated `UI.AutocompletePopover`.
453
+ - Upgrade flow to 0.106.3
454
+ - Fix a flow error with `react-window`.
455
+ - `view.selectRecords()` now colors records according to that view by default.
456
+ - Allow passing an array of models to `useLoadable` to load several things at once.
457
+
458
+ ## [0.0.30](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.29...@airtable/blocks@0.0.30) - 2019-08-26
459
+
460
+ No changes.
461
+
462
+ ## [0.0.29](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.28...@airtable/blocks@0.0.29) - 2019-08-22
463
+
464
+ No changes.
465
+
466
+ ## [0.0.28](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.27...@airtable/blocks@0.0.28) - 2019-08-21
467
+
468
+ No changes.
469
+
470
+ ## [0.0.27](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.26...@airtable/blocks@0.0.27) - 2019-08-21
471
+
472
+ No changes.
473
+
474
+ ## [0.0.26](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.25...@airtable/blocks@0.0.26) - 2019-08-19
475
+
476
+ - UI.RecordCardList: fixed a bug where records weren't expanded by default when clicked.
477
+
478
+ ## [0.0.25](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.24...@airtable/blocks@0.0.25) - 2019-08-19
479
+
480
+ - Add Print Records block docs example block
481
+
482
+ ## [0.0.24](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.23...@airtable/blocks@0.0.24) - 2019-08-14
483
+
484
+ No changes.
485
+
486
+ ## [0.0.23](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.22...@airtable/blocks@0.0.23) - 2019-08-09
487
+
488
+ ### Fixed
489
+
490
+ - The `disabled` attribute on `<Select>` components (including model pickers and synced model
491
+ pickers) now correctly disables the element
492
+
493
+ ## [0.0.22](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.21...@airtable/blocks@0.0.22) - 2019-07-18
494
+
495
+ No changes.
496
+
497
+ ## [0.0.21](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.20...@airtable/blocks@0.0.21) - 2019-07-18
498
+
499
+ No changes.
500
+
501
+ ## [0.0.20](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.19...@airtable/blocks@0.0.20) - 2019-07-15
502
+
503
+ ### Fixed
504
+
505
+ - A bug with UI.Toggle that made it difficult to style
506
+
507
+ ## [0.0.19](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.18...@airtable/blocks@0.0.19) - 2019-07-11
508
+
509
+ No changes.
510
+
511
+ ## [0.0.18](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.17...@airtable/blocks@0.0.18) - 2019-07-10
512
+
513
+ - Update documentation links & eslint-plugin-blocks
514
+
515
+ ## [0.0.17](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.16...@airtable/blocks@0.0.17) - 2019-07-09
516
+
517
+ No changes.
518
+
519
+ ## [0.0.16](https://github.com/airtable/blocks/compare/@airtable/blocks@0.0.15...@airtable/blocks@0.0.16) - 2019-07-05
520
+
521
+ - **BREAKING:** Removed view.visibleFields and view.allFields - use view.selectMetadata instead
522
+ - Added view.selectMetadata() for querying a view's field order and list of visible fields
523
+
524
+ ## [0.0.15](https://github.com/airtable/blocks/compare/v0.0.14...@airtable/blocks@0.0.15) - 2019-07-03
525
+
526
+ No changes.
527
+
528
+ ## [0.0.14](https://github.com/airtable/blocks/compare/v0.0.13...v0.0.14) - 2019-07-02
529
+
530
+ - **BREAKING:** Removed `currentUser` from `Base` since it is now accessible through `Session`.
531
+ - **BREAKING:** Renamed QueryResult to RecordQueryResult
532
+ - Added base.watch('schema') to get notified when base schema changes.
533
+ - Added Session to expose data about the current user's session.
534
+ - Added globalConfig.watch('\*') to get notified of any global config key change.
535
+ - Added useGlobalConfig() to subscribe to global config changes from a react component.
536
+
537
+ ## [0.0.13](https://github.com/airtable/blocks/releases/tag/v0.0.13) - 2019-06-21
538
+
539
+ ### Removed
540
+
541
+ - **BREAKING:** Removed `createDataContainer`. Use `useWatchable` or other hooks instead.
542
+ - **BREAKING:** FieldIcon no longer accepts arbitrary props - only those in it's propTypes can be
543
+ used.
544
+
545
+ ### Added
546
+
547
+ - This changelog!
548
+
549
+ ### Fixed
550
+
551
+ - FieldPicker placeholder typo
552
+ - SVGElement flow error
@@ -1,46 +1,45 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- require("core-js/modules/es.object.to-string");
6
-
7
- require("core-js/modules/es.regexp.to-string");
8
-
9
- require("core-js/modules/es.string.ends-with");
10
-
11
- require("core-js/modules/es.string.pad-start");
12
-
3
+ require("core-js/modules/es.array.iterator.js");
4
+ require("core-js/modules/es.weak-map.js");
5
+ require("core-js/modules/web.dom-collections.iterator.js");
13
6
  Object.defineProperty(exports, "__esModule", {
14
7
  value: true
15
8
  });
16
9
  exports.default = void 0;
17
-
10
+ require("core-js/modules/es.object.to-string.js");
11
+ require("core-js/modules/es.regexp.to-string.js");
12
+ require("core-js/modules/es.string.ends-with.js");
13
+ require("core-js/modules/es.string.pad-start.js");
18
14
  var _private_utils = require("./private_utils");
19
-
20
15
  var _colors = _interopRequireWildcard(require("./colors"));
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ /** @module @airtable/blocks/ui: colorUtils */ /** */
19
+
20
+ /** A red/green/blue color object. Each property is a number from 0 to 255. */
21
21
 
22
- /** @module @airtable/blocks/ui: colorUtils */
22
+ /**
23
+ * Utilities for working with {@link Color} names from the {@link colors} enum.
24
+ *
25
+ * @docsPath UI/utils/colorUtils
26
+ */
23
27
 
24
- /** */
25
28
  var colorUtils = {
26
29
  getHexForColor: colorString => {
27
30
  var color = (0, _private_utils.getEnumValueIfExists)(_colors.default, colorString);
28
-
29
31
  if (!color) {
30
32
  return null;
31
33
  }
32
-
33
34
  var rgbTuple = _colors.rgbTuplesByColor[color];
34
35
  var hexNumber = rgbTuple[0] << 16 | rgbTuple[1] << 8 | rgbTuple[2];
35
36
  return "#".concat(hexNumber.toString(16).padStart(6, '0'));
36
37
  },
37
38
  getRgbForColor: colorString => {
38
39
  var color = (0, _private_utils.getEnumValueIfExists)(_colors.default, colorString);
39
-
40
40
  if (!color) {
41
41
  return null;
42
42
  }
43
-
44
43
  var rgbTuple = _colors.rgbTuplesByColor[color];
45
44
  return {
46
45
  r: rgbTuple[0],
@@ -53,15 +52,14 @@ var colorUtils = {
53
52
  // Don't have a color for this. Let's just return false as a default
54
53
  // instead of throwing.
55
54
  return false;
56
- } // Light1 and Light2 colors use dark text.
55
+ }
56
+
57
+ // Light1 and Light2 colors use dark text.
57
58
  // Bright, Dark1 and no suffix colors use light text.
58
59
  // NOTE: use shouldUseDarkText instead of shouldUseLightText just to make
59
60
  // checking the suffix easier, since no suffix uses light text.
60
-
61
-
62
61
  var shouldUseDarkText = colorString.endsWith('Light1') || colorString.endsWith('Light2');
63
62
  return !shouldUseDarkText;
64
63
  }
65
64
  };
66
- var _default = colorUtils;
67
- exports.default = _default;
65
+ var _default = exports.default = colorUtils;