@airtable/blocks 0.0.0-experimental-c4b2228f4-20250630 → 0.0.0-experimental-3649c7162-20250904

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 (679) hide show
  1. package/dist/esm/base/assert_run_context.js +12 -0
  2. package/dist/{cjs → esm}/base/index.js +30 -32
  3. package/dist/esm/base/models/abstract_model_with_async_data.js +190 -0
  4. package/dist/esm/base/models/base.js +252 -0
  5. package/dist/esm/base/models/create_aggregators.js +90 -0
  6. package/dist/esm/base/models/cursor.js +305 -0
  7. package/dist/esm/base/models/field.js +338 -0
  8. package/dist/esm/base/models/grouped_record_query_result.js +280 -0
  9. package/dist/esm/base/models/linked_records_query_result.js +553 -0
  10. package/dist/{cjs → esm}/base/models/models.js +19 -40
  11. package/dist/esm/base/models/mutations.js +312 -0
  12. package/dist/esm/base/models/object_pool.js +145 -0
  13. package/dist/esm/base/models/record.js +239 -0
  14. package/dist/{cjs → esm}/base/models/record_coloring.js +6 -6
  15. package/dist/esm/base/models/record_query_result.js +657 -0
  16. package/dist/esm/base/models/record_store.js +475 -0
  17. package/dist/esm/base/models/session.js +154 -0
  18. package/dist/esm/base/models/table.js +520 -0
  19. package/dist/esm/base/models/table_or_view_query_result.js +749 -0
  20. package/dist/esm/base/models/view.js +326 -0
  21. package/dist/esm/base/models/view_data_store.js +265 -0
  22. package/dist/esm/base/models/view_metadata_query_result.js +176 -0
  23. package/dist/esm/base/perform_record_action.js +215 -0
  24. package/dist/esm/base/sdk.js +178 -0
  25. package/dist/esm/base/settings_button.js +118 -0
  26. package/dist/{cjs → esm}/base/types/airtable_interface.js +1 -1
  27. package/dist/{cjs → esm}/base/types/mutations.js +5 -11
  28. package/dist/{cjs → esm}/base/types/undo_redo.js +1 -1
  29. package/dist/{cjs → esm}/base/types/view.js +1 -1
  30. package/dist/{cjs → esm}/base/ui/base_provider.js +6 -8
  31. package/dist/esm/base/ui/baymax_utils.js +461 -0
  32. package/dist/esm/base/ui/block_wrapper.js +118 -0
  33. package/dist/esm/base/ui/box.js +84 -0
  34. package/dist/esm/base/ui/button.js +152 -0
  35. package/dist/esm/base/ui/cell_renderer.js +198 -0
  36. package/dist/esm/base/ui/choice_token.js +93 -0
  37. package/dist/esm/base/ui/collaborator_token.js +123 -0
  38. package/dist/esm/base/ui/color_palette.js +196 -0
  39. package/dist/esm/base/ui/color_palette_synced.js +69 -0
  40. package/dist/esm/base/ui/confirmation_dialog.js +103 -0
  41. package/dist/{cjs → esm}/base/ui/control_sizes.js +24 -22
  42. package/dist/{cjs → esm}/base/ui/create_detect_element_resize.js +6 -10
  43. package/dist/{cjs → esm}/base/ui/css_helpers.js +1 -1
  44. package/dist/esm/base/ui/dialog.js +101 -0
  45. package/dist/esm/base/ui/dialog_close_button.js +106 -0
  46. package/dist/{cjs → esm}/base/ui/expand_record.js +1 -2
  47. package/dist/{cjs → esm}/base/ui/expand_record_list.js +3 -4
  48. package/dist/esm/base/ui/expand_record_picker_async.js +71 -0
  49. package/dist/esm/base/ui/field_icon.js +44 -0
  50. package/dist/esm/base/ui/field_picker.js +98 -0
  51. package/dist/esm/base/ui/field_picker_synced.js +66 -0
  52. package/dist/esm/base/ui/form_field.js +109 -0
  53. package/dist/{cjs → esm}/base/ui/geometry/geometry.js +5 -5
  54. package/dist/esm/base/ui/geometry/point.js +19 -0
  55. package/dist/esm/base/ui/geometry/rect.js +51 -0
  56. package/dist/esm/base/ui/geometry/size.js +19 -0
  57. package/dist/esm/base/ui/global_alert.js +71 -0
  58. package/dist/esm/base/ui/heading.js +132 -0
  59. package/dist/esm/base/ui/icon.js +109 -0
  60. package/dist/{cjs → esm}/base/ui/icon_config.js +6 -12
  61. package/dist/{cjs → esm}/base/ui/initialize_block.js +16 -35
  62. package/dist/esm/base/ui/input.js +161 -0
  63. package/dist/esm/base/ui/input_synced.js +66 -0
  64. package/dist/{cjs → esm}/base/ui/key_codes.js +2 -3
  65. package/dist/esm/base/ui/label.js +80 -0
  66. package/dist/esm/base/ui/link.js +196 -0
  67. package/dist/esm/base/ui/loader.js +61 -0
  68. package/dist/esm/base/ui/modal.js +145 -0
  69. package/dist/esm/base/ui/model_picker_select.js +57 -0
  70. package/dist/esm/base/ui/popover.js +315 -0
  71. package/dist/esm/base/ui/progress_bar.js +115 -0
  72. package/dist/esm/base/ui/record_card.js +564 -0
  73. package/dist/esm/base/ui/record_card_list.js +303 -0
  74. package/dist/esm/base/ui/select.js +191 -0
  75. package/dist/esm/base/ui/select_and_select_buttons_helpers.js +63 -0
  76. package/dist/esm/base/ui/select_buttons.js +159 -0
  77. package/dist/esm/base/ui/select_buttons_synced.js +62 -0
  78. package/dist/esm/base/ui/select_synced.js +65 -0
  79. package/dist/esm/base/ui/switch.js +167 -0
  80. package/dist/esm/base/ui/switch_synced.js +53 -0
  81. package/dist/esm/base/ui/synced.js +49 -0
  82. package/dist/{cjs → esm}/base/ui/system/all_styles_set.js +4 -12
  83. package/dist/esm/base/ui/system/appearance/appearance_set.js +27 -0
  84. package/dist/esm/base/ui/system/appearance/background_color.js +18 -0
  85. package/dist/{cjs → esm}/base/ui/system/appearance/border.js +3 -6
  86. package/dist/esm/base/ui/system/appearance/border_radius.js +18 -0
  87. package/dist/esm/base/ui/system/appearance/box_shadow.js +18 -0
  88. package/dist/esm/base/ui/system/appearance/opacity.js +18 -0
  89. package/dist/esm/base/ui/system/dimensions/dimensions_set.js +29 -0
  90. package/dist/esm/base/ui/system/dimensions/height.js +18 -0
  91. package/dist/esm/base/ui/system/dimensions/max_height.js +18 -0
  92. package/dist/esm/base/ui/system/dimensions/max_width.js +18 -0
  93. package/dist/esm/base/ui/system/dimensions/min_height.js +18 -0
  94. package/dist/esm/base/ui/system/dimensions/min_width.js +18 -0
  95. package/dist/esm/base/ui/system/dimensions/width.js +18 -0
  96. package/dist/esm/base/ui/system/display.js +19 -0
  97. package/dist/esm/base/ui/system/flex_container/align_content.js +15 -0
  98. package/dist/esm/base/ui/system/flex_container/align_items.js +15 -0
  99. package/dist/esm/base/ui/system/flex_container/flex_container_set.js +29 -0
  100. package/dist/esm/base/ui/system/flex_container/flex_direction.js +15 -0
  101. package/dist/esm/base/ui/system/flex_container/flex_wrap.js +15 -0
  102. package/dist/esm/base/ui/system/flex_container/justify_content.js +15 -0
  103. package/dist/esm/base/ui/system/flex_container/justify_items.js +16 -0
  104. package/dist/esm/base/ui/system/flex_item/align_self.js +15 -0
  105. package/dist/esm/base/ui/system/flex_item/flex.js +15 -0
  106. package/dist/esm/base/ui/system/flex_item/flex_basis.js +15 -0
  107. package/dist/esm/base/ui/system/flex_item/flex_grow.js +15 -0
  108. package/dist/esm/base/ui/system/flex_item/flex_item_set.js +31 -0
  109. package/dist/esm/base/ui/system/flex_item/flex_shrink.js +15 -0
  110. package/dist/esm/base/ui/system/flex_item/justify_self.js +16 -0
  111. package/dist/esm/base/ui/system/flex_item/order.js +15 -0
  112. package/dist/{cjs → esm}/base/ui/system/index.js +104 -416
  113. package/dist/esm/base/ui/system/overflow.js +21 -0
  114. package/dist/{cjs → esm}/base/ui/system/position/bottom.js +4 -6
  115. package/dist/{cjs → esm}/base/ui/system/position/left.js +4 -6
  116. package/dist/esm/base/ui/system/position/position.js +15 -0
  117. package/dist/esm/base/ui/system/position/position_set.js +29 -0
  118. package/dist/{cjs → esm}/base/ui/system/position/right.js +4 -6
  119. package/dist/{cjs → esm}/base/ui/system/position/top.js +4 -6
  120. package/dist/esm/base/ui/system/position/z_index.js +18 -0
  121. package/dist/{cjs → esm}/base/ui/system/spacing/margin.js +4 -6
  122. package/dist/{cjs → esm}/base/ui/system/spacing/padding.js +4 -6
  123. package/dist/esm/base/ui/system/spacing/spacing_set.js +21 -0
  124. package/dist/esm/base/ui/system/typography/font_family.js +18 -0
  125. package/dist/esm/base/ui/system/typography/font_size.js +18 -0
  126. package/dist/esm/base/ui/system/typography/font_style.js +15 -0
  127. package/dist/esm/base/ui/system/typography/font_weight.js +18 -0
  128. package/dist/esm/base/ui/system/typography/letter_spacing.js +18 -0
  129. package/dist/esm/base/ui/system/typography/line_height.js +15 -0
  130. package/dist/esm/base/ui/system/typography/text_align.js +15 -0
  131. package/dist/esm/base/ui/system/typography/text_color.js +18 -0
  132. package/dist/esm/base/ui/system/typography/text_decoration.js +15 -0
  133. package/dist/esm/base/ui/system/typography/text_transform.js +15 -0
  134. package/dist/esm/base/ui/system/typography/typography_set.js +37 -0
  135. package/dist/{cjs → esm}/base/ui/system/utils/ensure_numbers_are_within_scale.js +3 -4
  136. package/dist/esm/base/ui/system/utils/get_style_props_for_responsive_prop.js +73 -0
  137. package/dist/esm/base/ui/table_picker.js +71 -0
  138. package/dist/esm/base/ui/table_picker_synced.js +62 -0
  139. package/dist/esm/base/ui/text.js +117 -0
  140. package/dist/esm/base/ui/text_button.js +196 -0
  141. package/dist/{cjs → esm}/base/ui/theme/default_theme/button_variants.js +3 -3
  142. package/dist/esm/base/ui/theme/default_theme/control_sizes.js +102 -0
  143. package/dist/{cjs → esm}/base/ui/theme/default_theme/heading_styles.js +1 -1
  144. package/dist/{cjs → esm}/base/ui/theme/default_theme/index.js +9 -15
  145. package/dist/{cjs → esm}/base/ui/theme/default_theme/input_variants.js +3 -3
  146. package/dist/{cjs → esm}/base/ui/theme/default_theme/link_variants.js +3 -3
  147. package/dist/{cjs → esm}/base/ui/theme/default_theme/select_buttons_variants.js +4 -4
  148. package/dist/esm/base/ui/theme/default_theme/select_variants.js +50 -0
  149. package/dist/esm/base/ui/theme/default_theme/switch_variants.js +85 -0
  150. package/dist/{cjs → esm}/base/ui/theme/default_theme/text_button_variants.js +5 -5
  151. package/dist/{cjs → esm}/base/ui/theme/default_theme/text_styles.js +1 -1
  152. package/dist/{cjs → esm}/base/ui/theme/default_theme/tokens.js +14 -14
  153. package/dist/{cjs → esm}/base/ui/theme/theme_context.js +2 -2
  154. package/dist/{cjs → esm}/base/ui/theme/use_theme.js +2 -2
  155. package/dist/esm/base/ui/tooltip.js +175 -0
  156. package/dist/{cjs → esm}/base/ui/ui.js +48 -49
  157. package/dist/{cjs → esm}/base/ui/unstable_standalone_ui.js +27 -27
  158. package/dist/{cjs → esm}/base/ui/use_base.js +1 -1
  159. package/dist/{cjs → esm}/base/ui/use_cursor.js +5 -4
  160. package/dist/{cjs → esm}/base/ui/use_form_field.js +1 -1
  161. package/dist/{cjs → esm}/base/ui/use_loadable.js +25 -91
  162. package/dist/{cjs → esm}/base/ui/use_record_action_data.js +4 -3
  163. package/dist/{cjs → esm}/base/ui/use_records.js +9 -13
  164. package/dist/{cjs → esm}/base/ui/use_session.js +1 -1
  165. package/dist/{cjs → esm}/base/ui/use_settings_button.js +4 -3
  166. package/dist/esm/base/ui/use_styled_system.js +25 -0
  167. package/dist/{cjs → esm}/base/ui/use_text_color_for_background_color.js +4 -3
  168. package/dist/{cjs → esm}/base/ui/use_view_metadata.js +4 -4
  169. package/dist/{cjs → esm}/base/ui/use_viewport.js +2 -2
  170. package/dist/esm/base/ui/view_picker.js +89 -0
  171. package/dist/esm/base/ui/view_picker_synced.js +66 -0
  172. package/dist/esm/base/ui/viewport_constraint.js +129 -0
  173. package/dist/esm/base/ui/with_styled_system.js +129 -0
  174. package/dist/esm/base/undo_redo.js +37 -0
  175. package/dist/{cjs → esm}/base/unstable_testing_utils.js +27 -27
  176. package/dist/esm/base/viewport.js +353 -0
  177. package/dist/esm/injected/airtable_interface.js +22 -0
  178. package/dist/esm/interface/assert_run_context.js +12 -0
  179. package/dist/esm/interface/index.js +22 -0
  180. package/dist/esm/interface/models/base.js +35 -0
  181. package/dist/esm/interface/models/field.js +28 -0
  182. package/dist/{cjs → esm}/interface/models/models.js +8 -7
  183. package/dist/esm/interface/models/mutations.js +63 -0
  184. package/dist/esm/interface/models/record.js +51 -0
  185. package/dist/esm/interface/models/record_store.js +51 -0
  186. package/dist/esm/interface/models/session.js +28 -0
  187. package/dist/esm/interface/models/table.js +97 -0
  188. package/dist/esm/interface/sdk.js +78 -0
  189. package/dist/{cjs → esm}/interface/types/airtable_interface.js +2 -2
  190. package/dist/esm/interface/types/mutations.js +17 -0
  191. package/dist/esm/interface/ui/block_wrapper.js +69 -0
  192. package/dist/{cjs → esm}/interface/ui/initialize_block.js +13 -28
  193. package/dist/{cjs → esm}/interface/ui/ui.js +20 -19
  194. package/dist/{cjs → esm}/interface/ui/use_base.js +1 -1
  195. package/dist/{cjs → esm}/interface/ui/use_custom_properties.js +19 -35
  196. package/dist/{cjs → esm}/interface/ui/use_records.js +6 -5
  197. package/dist/{cjs → esm}/interface/ui/use_run_info.js +2 -2
  198. package/dist/{cjs → esm}/interface/ui/use_session.js +1 -1
  199. package/dist/{cjs → esm}/shared/color_utils.js +9 -16
  200. package/dist/{cjs → esm}/shared/colors.js +2 -2
  201. package/dist/{cjs → esm}/shared/error_utils.js +9 -11
  202. package/dist/{cjs → esm}/shared/event_tracker.js +3 -3
  203. package/dist/esm/shared/global_config.js +399 -0
  204. package/dist/esm/shared/models/abstract_model.js +94 -0
  205. package/dist/esm/shared/models/base_core.js +482 -0
  206. package/dist/esm/shared/models/field_core.js +288 -0
  207. package/dist/esm/shared/models/mutations_core.js +343 -0
  208. package/dist/esm/shared/models/record_core.js +215 -0
  209. package/dist/esm/shared/models/record_store_core.js +160 -0
  210. package/dist/esm/shared/models/session_core.js +160 -0
  211. package/dist/esm/shared/models/table_core.js +1318 -0
  212. package/dist/{cjs → esm}/shared/private_utils.js +54 -124
  213. package/dist/esm/shared/sdk_core.js +113 -0
  214. package/dist/{cjs → esm}/shared/types/field_core.js +1 -1
  215. package/dist/esm/shared/types/mutation_constants.js +11 -0
  216. package/dist/{cjs → esm}/shared/types/mutations_core.js +1 -1
  217. package/dist/{cjs → esm}/shared/types/permission_levels.js +1 -1
  218. package/dist/esm/shared/types/record.js +1 -0
  219. package/dist/esm/shared/types/stat.js +1 -0
  220. package/dist/esm/shared/types/table_core.js +1 -0
  221. package/dist/{cjs → esm}/shared/ui/global_config_synced_component_helpers.js +9 -9
  222. package/dist/esm/shared/ui/loader.js +47 -0
  223. package/dist/{cjs → esm}/shared/ui/remote_utils.js +5 -7
  224. package/dist/{cjs → esm}/shared/ui/sdk_context.js +4 -8
  225. package/dist/{cjs → esm}/shared/ui/use_array_identity.js +2 -2
  226. package/dist/{cjs → esm}/shared/ui/use_base.js +6 -5
  227. package/dist/{cjs → esm}/shared/ui/use_color_scheme.js +3 -8
  228. package/dist/{cjs → esm}/shared/ui/use_global_config.js +5 -4
  229. package/dist/{cjs → esm}/shared/ui/use_session.js +6 -5
  230. package/dist/{cjs → esm}/shared/ui/use_synced.js +7 -5
  231. package/dist/{cjs → esm}/shared/ui/use_watchable.js +17 -44
  232. package/dist/{cjs → esm}/shared/ui/with_hooks.js +6 -13
  233. package/dist/{cjs → esm}/shared/unstable_private_utils.js +4 -6
  234. package/dist/{cjs → esm}/shared/warning.js +5 -5
  235. package/dist/esm/shared/watchable.js +150 -0
  236. package/dist/esm/stats/block_stats.js +73 -0
  237. package/dist/esm/testing/base/abstract_mock_airtable_interface.js +208 -0
  238. package/dist/esm/testing/interface/abstract_mock_airtable_interface.js +124 -0
  239. package/dist/types/src/base/assert_run_context.d.ts +2 -0
  240. package/dist/types/src/base/assert_run_context.d.ts.map +1 -0
  241. package/dist/types/src/base/index.d.ts +1 -0
  242. package/dist/types/src/base/index.d.ts.map +1 -1
  243. package/dist/types/src/base/models/base.d.ts +19 -0
  244. package/dist/types/src/base/models/base.d.ts.map +1 -1
  245. package/dist/types/src/base/models/create_aggregators.d.ts +3 -4
  246. package/dist/types/src/base/models/create_aggregators.d.ts.map +1 -1
  247. package/dist/types/src/base/models/field.d.ts +3 -2
  248. package/dist/types/src/base/models/field.d.ts.map +1 -1
  249. package/dist/types/src/base/models/models.d.ts +1 -2
  250. package/dist/types/src/base/models/models.d.ts.map +1 -1
  251. package/dist/types/src/base/models/mutations.d.ts.map +1 -1
  252. package/dist/types/src/base/sdk.d.ts.map +1 -1
  253. package/dist/types/src/base/ui/block_wrapper.d.ts +1 -1
  254. package/dist/types/src/base/ui/box.d.ts.map +1 -1
  255. package/dist/types/src/base/ui/button.d.ts +0 -5
  256. package/dist/types/src/base/ui/button.d.ts.map +1 -1
  257. package/dist/types/src/base/ui/cell_renderer.d.ts +1 -22
  258. package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
  259. package/dist/types/src/base/ui/choice_token.d.ts +1 -21
  260. package/dist/types/src/base/ui/choice_token.d.ts.map +1 -1
  261. package/dist/types/src/base/ui/collaborator_token.d.ts +0 -20
  262. package/dist/types/src/base/ui/collaborator_token.d.ts.map +1 -1
  263. package/dist/types/src/base/ui/color_palette.d.ts +1 -32
  264. package/dist/types/src/base/ui/color_palette.d.ts.map +1 -1
  265. package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -14
  266. package/dist/types/src/base/ui/color_palette_synced.d.ts.map +1 -1
  267. package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -17
  268. package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +1 -1
  269. package/dist/types/src/base/ui/control_sizes.d.ts +0 -1
  270. package/dist/types/src/base/ui/control_sizes.d.ts.map +1 -1
  271. package/dist/types/src/base/ui/dialog.d.ts +1 -23
  272. package/dist/types/src/base/ui/dialog.d.ts.map +1 -1
  273. package/dist/types/src/base/ui/dialog_close_button.d.ts +2 -24
  274. package/dist/types/src/base/ui/dialog_close_button.d.ts.map +1 -1
  275. package/dist/types/src/base/ui/field_icon.d.ts +1 -17
  276. package/dist/types/src/base/ui/field_icon.d.ts.map +1 -1
  277. package/dist/types/src/base/ui/field_picker.d.ts +0 -23
  278. package/dist/types/src/base/ui/field_picker.d.ts.map +1 -1
  279. package/dist/types/src/base/ui/field_picker_synced.d.ts.map +1 -1
  280. package/dist/types/src/base/ui/form_field.d.ts +0 -4
  281. package/dist/types/src/base/ui/form_field.d.ts.map +1 -1
  282. package/dist/types/src/base/ui/heading.d.ts +1 -1
  283. package/dist/types/src/base/ui/heading.d.ts.map +1 -1
  284. package/dist/types/src/base/ui/icon.d.ts +0 -16
  285. package/dist/types/src/base/ui/icon.d.ts.map +1 -1
  286. package/dist/types/src/base/ui/icon_config.d.ts +50 -51
  287. package/dist/types/src/base/ui/icon_config.d.ts.map +1 -1
  288. package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
  289. package/dist/types/src/base/ui/input.d.ts +12 -46
  290. package/dist/types/src/base/ui/input.d.ts.map +1 -1
  291. package/dist/types/src/base/ui/input_synced.d.ts.map +1 -1
  292. package/dist/types/src/base/ui/label.d.ts.map +1 -1
  293. package/dist/types/src/base/ui/link.d.ts +1 -5
  294. package/dist/types/src/base/ui/link.d.ts.map +1 -1
  295. package/dist/types/src/base/ui/loader.d.ts +3 -20
  296. package/dist/types/src/base/ui/loader.d.ts.map +1 -1
  297. package/dist/types/src/base/ui/modal.d.ts +1 -14
  298. package/dist/types/src/base/ui/modal.d.ts.map +1 -1
  299. package/dist/types/src/base/ui/model_picker_select.d.ts.map +1 -1
  300. package/dist/types/src/base/ui/popover.d.ts +1 -17
  301. package/dist/types/src/base/ui/popover.d.ts.map +1 -1
  302. package/dist/types/src/base/ui/progress_bar.d.ts +1 -24
  303. package/dist/types/src/base/ui/progress_bar.d.ts.map +1 -1
  304. package/dist/types/src/base/ui/record_card.d.ts +1 -23
  305. package/dist/types/src/base/ui/record_card.d.ts.map +1 -1
  306. package/dist/types/src/base/ui/record_card_list.d.ts +1 -18
  307. package/dist/types/src/base/ui/record_card_list.d.ts.map +1 -1
  308. package/dist/types/src/base/ui/select.d.ts +0 -44
  309. package/dist/types/src/base/ui/select.d.ts.map +1 -1
  310. package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -2
  311. package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
  312. package/dist/types/src/base/ui/select_buttons.d.ts +0 -22
  313. package/dist/types/src/base/ui/select_buttons.d.ts.map +1 -1
  314. package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +1 -1
  315. package/dist/types/src/base/ui/select_synced.d.ts.map +1 -1
  316. package/dist/types/src/base/ui/switch.d.ts +0 -22
  317. package/dist/types/src/base/ui/switch.d.ts.map +1 -1
  318. package/dist/types/src/base/ui/switch_synced.d.ts.map +1 -1
  319. package/dist/types/src/base/ui/synced.d.ts +2 -8
  320. package/dist/types/src/base/ui/synced.d.ts.map +1 -1
  321. package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -3
  322. package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +1 -1
  323. package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -1
  324. package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +1 -1
  325. package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -1
  326. package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +1 -1
  327. package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -1
  328. package/dist/types/src/base/ui/system/appearance/border.d.ts.map +1 -1
  329. package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -1
  330. package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +1 -1
  331. package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -1
  332. package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +1 -1
  333. package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -1
  334. package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +1 -1
  335. package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -1
  336. package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
  337. package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -1
  338. package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +1 -1
  339. package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -1
  340. package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +1 -1
  341. package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -1
  342. package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +1 -1
  343. package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -1
  344. package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +1 -1
  345. package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -1
  346. package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +1 -1
  347. package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -1
  348. package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +1 -1
  349. package/dist/types/src/base/ui/system/display.d.ts +0 -1
  350. package/dist/types/src/base/ui/system/display.d.ts.map +1 -1
  351. package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -1
  352. package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +1 -1
  353. package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -1
  354. package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +1 -1
  355. package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -1
  356. package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
  357. package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -1
  358. package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +1 -1
  359. package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -1
  360. package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
  361. package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -1
  362. package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +1 -1
  363. package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -1
  364. package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +1 -1
  365. package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -1
  366. package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +1 -1
  367. package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -1
  368. package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +1 -1
  369. package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -1
  370. package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +1 -1
  371. package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -1
  372. package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +1 -1
  373. package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -1
  374. package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
  375. package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -1
  376. package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
  377. package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -1
  378. package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +1 -1
  379. package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -1
  380. package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +1 -1
  381. package/dist/types/src/base/ui/system/index.d.ts +52 -52
  382. package/dist/types/src/base/ui/system/index.d.ts.map +1 -1
  383. package/dist/types/src/base/ui/system/overflow.d.ts +0 -1
  384. package/dist/types/src/base/ui/system/overflow.d.ts.map +1 -1
  385. package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -1
  386. package/dist/types/src/base/ui/system/position/bottom.d.ts.map +1 -1
  387. package/dist/types/src/base/ui/system/position/left.d.ts +0 -1
  388. package/dist/types/src/base/ui/system/position/left.d.ts.map +1 -1
  389. package/dist/types/src/base/ui/system/position/position.d.ts +0 -1
  390. package/dist/types/src/base/ui/system/position/position.d.ts.map +1 -1
  391. package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -1
  392. package/dist/types/src/base/ui/system/position/position_set.d.ts.map +1 -1
  393. package/dist/types/src/base/ui/system/position/right.d.ts +0 -1
  394. package/dist/types/src/base/ui/system/position/right.d.ts.map +1 -1
  395. package/dist/types/src/base/ui/system/position/top.d.ts +0 -1
  396. package/dist/types/src/base/ui/system/position/top.d.ts.map +1 -1
  397. package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -1
  398. package/dist/types/src/base/ui/system/position/z_index.d.ts.map +1 -1
  399. package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -1
  400. package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +1 -1
  401. package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -1
  402. package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +1 -1
  403. package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -1
  404. package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +1 -1
  405. package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -1
  406. package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +1 -1
  407. package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -1
  408. package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +1 -1
  409. package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -1
  410. package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +1 -1
  411. package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -1
  412. package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +1 -1
  413. package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -1
  414. package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +1 -1
  415. package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -1
  416. package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +1 -1
  417. package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -1
  418. package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +1 -1
  419. package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -1
  420. package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +1 -1
  421. package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -1
  422. package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +1 -1
  423. package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -1
  424. package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +1 -1
  425. package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -1
  426. package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +1 -1
  427. package/dist/types/src/base/ui/table_picker.d.ts +0 -21
  428. package/dist/types/src/base/ui/table_picker.d.ts.map +1 -1
  429. package/dist/types/src/base/ui/table_picker_synced.d.ts.map +1 -1
  430. package/dist/types/src/base/ui/text.d.ts +0 -3
  431. package/dist/types/src/base/ui/text.d.ts.map +1 -1
  432. package/dist/types/src/base/ui/text_button.d.ts +1 -5
  433. package/dist/types/src/base/ui/text_button.d.ts.map +1 -1
  434. package/dist/types/src/base/ui/theme/default_theme/index.d.ts +1 -1
  435. package/dist/types/src/base/ui/theme/theme_context.d.ts +1 -1
  436. package/dist/types/src/base/ui/theme/use_theme.d.ts +1 -1
  437. package/dist/types/src/base/ui/tooltip.d.ts +0 -16
  438. package/dist/types/src/base/ui/tooltip.d.ts.map +1 -1
  439. package/dist/types/src/base/ui/types/aria_props.d.ts.map +1 -1
  440. package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -4
  441. package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +1 -1
  442. package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -7
  443. package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +1 -1
  444. package/dist/types/src/base/ui/ui.d.ts +1 -0
  445. package/dist/types/src/base/ui/ui.d.ts.map +1 -1
  446. package/dist/types/src/base/ui/view_picker.d.ts +0 -23
  447. package/dist/types/src/base/ui/view_picker.d.ts.map +1 -1
  448. package/dist/types/src/base/ui/view_picker_synced.d.ts.map +1 -1
  449. package/dist/types/src/base/ui/viewport_constraint.d.ts +1 -14
  450. package/dist/types/src/base/ui/viewport_constraint.d.ts.map +1 -1
  451. package/dist/types/src/base/unstable_testing_utils.d.ts +1 -1
  452. package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
  453. package/dist/types/src/interface/assert_run_context.d.ts +2 -0
  454. package/dist/types/src/interface/assert_run_context.d.ts.map +1 -0
  455. package/dist/types/src/interface/index.d.ts +1 -6
  456. package/dist/types/src/interface/index.d.ts.map +1 -1
  457. package/dist/types/src/interface/models/models.d.ts +1 -0
  458. package/dist/types/src/interface/models/models.d.ts.map +1 -1
  459. package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
  460. package/dist/types/src/interface/models/table.d.ts.map +1 -1
  461. package/dist/types/src/interface/types/field.d.ts +6 -0
  462. package/dist/types/src/interface/types/field.d.ts.map +1 -1
  463. package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -1
  464. package/dist/types/src/interface/ui/ui.d.ts +1 -0
  465. package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
  466. package/dist/types/src/interface/ui/use_custom_properties.d.ts +1 -1
  467. package/dist/types/src/shared/models/field_core.d.ts +3 -1
  468. package/dist/types/src/shared/models/field_core.d.ts.map +1 -1
  469. package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
  470. package/dist/types/src/shared/models/table_core.d.ts.map +1 -1
  471. package/dist/types/src/shared/private_utils.d.ts +0 -9
  472. package/dist/types/src/shared/private_utils.d.ts.map +1 -1
  473. package/dist/types/src/shared/types/field_core.d.ts +19 -1
  474. package/dist/types/src/shared/types/field_core.d.ts.map +1 -1
  475. package/dist/types/src/shared/types/mutations_core.d.ts +8 -4
  476. package/dist/types/src/shared/types/mutations_core.d.ts.map +1 -1
  477. package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +0 -2
  478. package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
  479. package/dist/types/src/shared/ui/loader.d.ts.map +1 -1
  480. package/dist/types/src/shared/ui/use_watchable.d.ts +4 -2
  481. package/dist/types/src/shared/ui/use_watchable.d.ts.map +1 -1
  482. package/dist/types/src/shared/ui/with_hooks.d.ts +2 -2
  483. package/dist/types/src/shared/ui/with_hooks.d.ts.map +1 -1
  484. package/dist/types/src/testing/{abstract_mock_airtable_interface.d.ts → base/abstract_mock_airtable_interface.d.ts} +13 -13
  485. package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -0
  486. package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +51 -0
  487. package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -0
  488. package/models.js +1 -1
  489. package/package.json +24 -23
  490. package/types.js +1 -1
  491. package/dist/cjs/base/models/abstract_model_with_async_data.js +0 -273
  492. package/dist/cjs/base/models/base.js +0 -306
  493. package/dist/cjs/base/models/create_aggregators.js +0 -115
  494. package/dist/cjs/base/models/cursor.js +0 -393
  495. package/dist/cjs/base/models/field.js +0 -427
  496. package/dist/cjs/base/models/grouped_record_query_result.js +0 -399
  497. package/dist/cjs/base/models/linked_records_query_result.js +0 -728
  498. package/dist/cjs/base/models/mutations.js +0 -338
  499. package/dist/cjs/base/models/object_pool.js +0 -184
  500. package/dist/cjs/base/models/record.js +0 -304
  501. package/dist/cjs/base/models/record_query_result.js +0 -741
  502. package/dist/cjs/base/models/record_store.js +0 -825
  503. package/dist/cjs/base/models/session.js +0 -182
  504. package/dist/cjs/base/models/table.js +0 -668
  505. package/dist/cjs/base/models/table_or_view_query_result.js +0 -1013
  506. package/dist/cjs/base/models/view.js +0 -431
  507. package/dist/cjs/base/models/view_data_store.js +0 -403
  508. package/dist/cjs/base/models/view_metadata_query_result.js +0 -224
  509. package/dist/cjs/base/perform_record_action.js +0 -257
  510. package/dist/cjs/base/sdk.js +0 -233
  511. package/dist/cjs/base/settings_button.js +0 -138
  512. package/dist/cjs/base/ui/baymax_utils.js +0 -133
  513. package/dist/cjs/base/ui/block_wrapper.js +0 -143
  514. package/dist/cjs/base/ui/box.js +0 -110
  515. package/dist/cjs/base/ui/button.js +0 -182
  516. package/dist/cjs/base/ui/cell_renderer.js +0 -255
  517. package/dist/cjs/base/ui/choice_token.js +0 -110
  518. package/dist/cjs/base/ui/collaborator_token.js +0 -145
  519. package/dist/cjs/base/ui/color_palette.js +0 -239
  520. package/dist/cjs/base/ui/color_palette_synced.js +0 -98
  521. package/dist/cjs/base/ui/confirmation_dialog.js +0 -153
  522. package/dist/cjs/base/ui/dialog.js +0 -142
  523. package/dist/cjs/base/ui/dialog_close_button.js +0 -152
  524. package/dist/cjs/base/ui/expand_record_picker_async.js +0 -100
  525. package/dist/cjs/base/ui/field_icon.js +0 -62
  526. package/dist/cjs/base/ui/field_picker.js +0 -143
  527. package/dist/cjs/base/ui/field_picker_synced.js +0 -88
  528. package/dist/cjs/base/ui/form_field.js +0 -137
  529. package/dist/cjs/base/ui/geometry/point.js +0 -21
  530. package/dist/cjs/base/ui/geometry/rect.js +0 -67
  531. package/dist/cjs/base/ui/geometry/size.js +0 -21
  532. package/dist/cjs/base/ui/global_alert.js +0 -92
  533. package/dist/cjs/base/ui/heading.js +0 -181
  534. package/dist/cjs/base/ui/icon.js +0 -129
  535. package/dist/cjs/base/ui/input.js +0 -200
  536. package/dist/cjs/base/ui/input_synced.js +0 -89
  537. package/dist/cjs/base/ui/label.js +0 -105
  538. package/dist/cjs/base/ui/link.js +0 -229
  539. package/dist/cjs/base/ui/loader.js +0 -82
  540. package/dist/cjs/base/ui/modal.js +0 -184
  541. package/dist/cjs/base/ui/model_picker_select.js +0 -83
  542. package/dist/cjs/base/ui/popover.js +0 -407
  543. package/dist/cjs/base/ui/progress_bar.js +0 -128
  544. package/dist/cjs/base/ui/record_card.js +0 -653
  545. package/dist/cjs/base/ui/record_card_list.js +0 -377
  546. package/dist/cjs/base/ui/select.js +0 -247
  547. package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +0 -87
  548. package/dist/cjs/base/ui/select_buttons.js +0 -192
  549. package/dist/cjs/base/ui/select_buttons_synced.js +0 -84
  550. package/dist/cjs/base/ui/select_synced.js +0 -87
  551. package/dist/cjs/base/ui/switch.js +0 -196
  552. package/dist/cjs/base/ui/switch_synced.js +0 -75
  553. package/dist/cjs/base/ui/synced.js +0 -70
  554. package/dist/cjs/base/ui/system/appearance/appearance_set.js +0 -30
  555. package/dist/cjs/base/ui/system/appearance/background_color.js +0 -21
  556. package/dist/cjs/base/ui/system/appearance/border_radius.js +0 -21
  557. package/dist/cjs/base/ui/system/appearance/box_shadow.js +0 -21
  558. package/dist/cjs/base/ui/system/appearance/opacity.js +0 -21
  559. package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +0 -31
  560. package/dist/cjs/base/ui/system/dimensions/height.js +0 -21
  561. package/dist/cjs/base/ui/system/dimensions/max_height.js +0 -21
  562. package/dist/cjs/base/ui/system/dimensions/max_width.js +0 -21
  563. package/dist/cjs/base/ui/system/dimensions/min_height.js +0 -21
  564. package/dist/cjs/base/ui/system/dimensions/min_width.js +0 -21
  565. package/dist/cjs/base/ui/system/dimensions/width.js +0 -21
  566. package/dist/cjs/base/ui/system/display.js +0 -22
  567. package/dist/cjs/base/ui/system/flex_container/align_content.js +0 -18
  568. package/dist/cjs/base/ui/system/flex_container/align_items.js +0 -18
  569. package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +0 -31
  570. package/dist/cjs/base/ui/system/flex_container/flex_direction.js +0 -18
  571. package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +0 -18
  572. package/dist/cjs/base/ui/system/flex_container/justify_content.js +0 -18
  573. package/dist/cjs/base/ui/system/flex_container/justify_items.js +0 -19
  574. package/dist/cjs/base/ui/system/flex_item/align_self.js +0 -18
  575. package/dist/cjs/base/ui/system/flex_item/flex.js +0 -18
  576. package/dist/cjs/base/ui/system/flex_item/flex_basis.js +0 -18
  577. package/dist/cjs/base/ui/system/flex_item/flex_grow.js +0 -18
  578. package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +0 -32
  579. package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +0 -18
  580. package/dist/cjs/base/ui/system/flex_item/justify_self.js +0 -19
  581. package/dist/cjs/base/ui/system/flex_item/order.js +0 -18
  582. package/dist/cjs/base/ui/system/overflow.js +0 -24
  583. package/dist/cjs/base/ui/system/position/position.js +0 -18
  584. package/dist/cjs/base/ui/system/position/position_set.js +0 -31
  585. package/dist/cjs/base/ui/system/position/z_index.js +0 -21
  586. package/dist/cjs/base/ui/system/spacing/spacing_set.js +0 -27
  587. package/dist/cjs/base/ui/system/typography/font_family.js +0 -21
  588. package/dist/cjs/base/ui/system/typography/font_size.js +0 -21
  589. package/dist/cjs/base/ui/system/typography/font_style.js +0 -18
  590. package/dist/cjs/base/ui/system/typography/font_weight.js +0 -21
  591. package/dist/cjs/base/ui/system/typography/letter_spacing.js +0 -21
  592. package/dist/cjs/base/ui/system/typography/line_height.js +0 -18
  593. package/dist/cjs/base/ui/system/typography/text_align.js +0 -18
  594. package/dist/cjs/base/ui/system/typography/text_color.js +0 -21
  595. package/dist/cjs/base/ui/system/typography/text_decoration.js +0 -18
  596. package/dist/cjs/base/ui/system/typography/text_transform.js +0 -18
  597. package/dist/cjs/base/ui/system/typography/typography_set.js +0 -35
  598. package/dist/cjs/base/ui/system/utils/create_responsive_prop_type.js +0 -19
  599. package/dist/cjs/base/ui/system/utils/create_style_prop_types.js +0 -24
  600. package/dist/cjs/base/ui/system/utils/enum_prop_type_utils.js +0 -35
  601. package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -113
  602. package/dist/cjs/base/ui/table_picker.js +0 -95
  603. package/dist/cjs/base/ui/table_picker_synced.js +0 -84
  604. package/dist/cjs/base/ui/text.js +0 -150
  605. package/dist/cjs/base/ui/text_button.js +0 -228
  606. package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +0 -96
  607. package/dist/cjs/base/ui/theme/default_theme/select_variants.js +0 -59
  608. package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +0 -91
  609. package/dist/cjs/base/ui/tooltip.js +0 -215
  610. package/dist/cjs/base/ui/types/aria_props.js +0 -23
  611. package/dist/cjs/base/ui/types/data_attributes_prop.js +0 -18
  612. package/dist/cjs/base/ui/types/tooltip_anchor_props.js +0 -17
  613. package/dist/cjs/base/ui/use_styled_system.js +0 -32
  614. package/dist/cjs/base/ui/view_picker.js +0 -133
  615. package/dist/cjs/base/ui/view_picker_synced.js +0 -88
  616. package/dist/cjs/base/ui/viewport_constraint.js +0 -176
  617. package/dist/cjs/base/ui/with_styled_system.js +0 -165
  618. package/dist/cjs/base/undo_redo.js +0 -48
  619. package/dist/cjs/base/viewport.js +0 -397
  620. package/dist/cjs/injected/airtable_interface.js +0 -22
  621. package/dist/cjs/interface/index.js +0 -36
  622. package/dist/cjs/interface/models/base.js +0 -54
  623. package/dist/cjs/interface/models/field.js +0 -42
  624. package/dist/cjs/interface/models/mutations.js +0 -79
  625. package/dist/cjs/interface/models/record.js +0 -71
  626. package/dist/cjs/interface/models/record_store.js +0 -83
  627. package/dist/cjs/interface/models/session.js +0 -42
  628. package/dist/cjs/interface/models/table.js +0 -92
  629. package/dist/cjs/interface/sdk.js +0 -104
  630. package/dist/cjs/interface/types/mutations.js +0 -24
  631. package/dist/cjs/interface/ui/block_wrapper.js +0 -61
  632. package/dist/cjs/shared/global_config.js +0 -511
  633. package/dist/cjs/shared/models/abstract_model.js +0 -119
  634. package/dist/cjs/shared/models/base_core.js +0 -602
  635. package/dist/cjs/shared/models/field_core.js +0 -329
  636. package/dist/cjs/shared/models/mutations_core.js +0 -439
  637. package/dist/cjs/shared/models/record_core.js +0 -272
  638. package/dist/cjs/shared/models/record_store_core.js +0 -213
  639. package/dist/cjs/shared/models/session_core.js +0 -214
  640. package/dist/cjs/shared/models/table_core.js +0 -1530
  641. package/dist/cjs/shared/sdk_core.js +0 -115
  642. package/dist/cjs/shared/types/mutation_constants.js +0 -11
  643. package/dist/cjs/shared/ui/loader.js +0 -68
  644. package/dist/cjs/shared/watchable.js +0 -216
  645. package/dist/cjs/stats/block_stats.js +0 -96
  646. package/dist/cjs/testing/abstract_mock_airtable_interface.js +0 -277
  647. package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts +0 -2
  648. package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts.map +0 -1
  649. package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts +0 -4
  650. package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts.map +0 -1
  651. package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts +0 -21
  652. package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts.map +0 -1
  653. package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +0 -1
  654. /package/dist/{cjs → esm}/base/types/aggregators.js +0 -0
  655. /package/dist/{cjs → esm}/base/types/backend_fetch_types.js +0 -0
  656. /package/dist/{cjs → esm}/base/types/base.js +0 -0
  657. /package/dist/{cjs → esm}/base/types/cursor.js +0 -0
  658. /package/dist/{cjs → esm}/base/types/field.js +0 -0
  659. /package/dist/{cjs → esm}/base/types/record.js +0 -0
  660. /package/dist/{cjs → esm}/base/types/record_action_data.js +0 -0
  661. /package/dist/{cjs → esm}/base/types/table.js +0 -0
  662. /package/dist/{cjs → esm}/base/types/viewport.js +0 -0
  663. /package/dist/{cjs → esm}/base/ui/system/utils/csstype.js +0 -0
  664. /package/dist/{cjs → esm}/base/ui/system/utils/types.js +0 -0
  665. /package/dist/{cjs/interface/types/base.js → esm/base/ui/types/aria_props.js} +0 -0
  666. /package/dist/{cjs/interface/types/field.js → esm/base/ui/types/data_attributes_prop.js} +0 -0
  667. /package/dist/{cjs/interface/types/record.js → esm/base/ui/types/tooltip_anchor_props.js} +0 -0
  668. /package/dist/{cjs/interface/types/table.js → esm/interface/types/base.js} +0 -0
  669. /package/dist/{cjs/sdk_mode.js → esm/interface/types/field.js} +0 -0
  670. /package/dist/{cjs/shared → esm/interface}/types/record.js +0 -0
  671. /package/dist/{cjs/shared/types/airtable_interface_core.js → esm/interface/types/table.js} +0 -0
  672. /package/dist/{cjs → esm}/interface/ui/expand_record.js +0 -0
  673. /package/dist/{cjs/shared/types/attachment.js → esm/sdk_mode.js} +0 -0
  674. /package/dist/{cjs/shared/types/base_core.js → esm/shared/types/airtable_interface_core.js} +0 -0
  675. /package/dist/{cjs/shared/types/collaborator.js → esm/shared/types/attachment.js} +0 -0
  676. /package/dist/{cjs/shared/types/global_config.js → esm/shared/types/base_core.js} +0 -0
  677. /package/dist/{cjs/shared/types/hyper_ids.js → esm/shared/types/collaborator.js} +0 -0
  678. /package/dist/{cjs/shared/types/stat.js → esm/shared/types/global_config.js} +0 -0
  679. /package/dist/{cjs/shared/types/table_core.js → esm/shared/types/hyper_ids.js} +0 -0
@@ -1,1530 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.array.from.js");
4
- require("core-js/modules/es.array.slice.js");
5
- require("core-js/modules/es.object.to-string.js");
6
- require("core-js/modules/es.regexp.exec.js");
7
- require("core-js/modules/es.regexp.to-string.js");
8
- require("core-js/modules/web.dom-collections.iterator.js");
9
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
10
- Object.defineProperty(exports, "__esModule", {
11
- value: true
12
- });
13
- exports.WatchableTableKeysCore = exports.TableCore = void 0;
14
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
15
- require("core-js/modules/es.symbol.js");
16
- require("core-js/modules/es.symbol.description.js");
17
- require("core-js/modules/es.array.iterator.js");
18
- require("core-js/modules/es.array.map.js");
19
- require("core-js/modules/es.object.from-entries.js");
20
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
21
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
22
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
23
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
24
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
25
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
26
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
27
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
28
- var _private_utils = require("../private_utils");
29
- var _error_utils = require("../error_utils");
30
- var _mutations_core = require("../types/mutations_core");
31
- var _abstract_model = _interopRequireDefault(require("./abstract_model"));
32
- var _field_core = require("./field_core");
33
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
34
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
35
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
36
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
37
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
38
- // This doesn't follow our enum naming conventions because we want the keys
39
- // to mirror the method/getter names on the model class.
40
- var WatchableTableKeysCore = exports.WatchableTableKeysCore = Object.freeze({
41
- name: 'name',
42
- description: 'description',
43
- fields: 'fields'
44
- });
45
-
46
- /** @hidden */
47
- /** @hidden */
48
- var TableCore = exports.TableCore = /*#__PURE__*/function (_AbstractModel) {
49
- /**
50
- * @internal
51
- */
52
- function TableCore(parentBase, recordStore, tableId, sdk) {
53
- var _this;
54
- (0, _classCallCheck2.default)(this, TableCore);
55
- _this = _callSuper(this, TableCore, [sdk, tableId]);
56
- /** @internal */
57
- (0, _defineProperty2.default)(_this, "_parentBase", void 0);
58
- /** @internal */
59
- (0, _defineProperty2.default)(_this, "_recordStore", void 0);
60
- /** @internal */
61
- (0, _defineProperty2.default)(_this, "_fieldModelsById", void 0);
62
- /** @internal */
63
- (0, _defineProperty2.default)(_this, "_cachedFieldNamesById", void 0);
64
- _this._parentBase = parentBase;
65
- _this._recordStore = recordStore;
66
- _this._fieldModelsById = {}; // Field instances are lazily created by getFieldById.
67
- _this._cachedFieldNamesById = null;
68
- return _this;
69
- }
70
-
71
- /**
72
- * @internal
73
- */
74
- (0, _inherits2.default)(TableCore, _AbstractModel);
75
- return (0, _createClass2.default)(TableCore, [{
76
- key: "_dataOrNullIfDeleted",
77
- get: function get() {
78
- var _this$_baseData$table;
79
- return (_this$_baseData$table = this._baseData.tablesById[this._id]) !== null && _this$_baseData$table !== void 0 ? _this$_baseData$table : null;
80
- }
81
- /**
82
- * The base that this table belongs to.
83
- *
84
- * @internal (since we may not be able to return parent model instances in the immutable models world)
85
- * @example
86
- * ```js
87
- * import {base} from '@airtable/blocks/base';
88
- * const table = base.getTableByName('Table 1');
89
- * console.log(table.parentBase.id === base.id);
90
- * // => true
91
- * ```
92
- */
93
- }, {
94
- key: "parentBase",
95
- get: function get() {
96
- return this._parentBase;
97
- }
98
- /**
99
- * The name of the table. Can be watched.
100
- *
101
- * @example
102
- * ```js
103
- * console.log(myTable.name);
104
- * // => 'Table 1'
105
- * ```
106
- */
107
- }, {
108
- key: "name",
109
- get: function get() {
110
- return this._data.name;
111
- }
112
- /**
113
- * The description of the table, if it has one. Can be watched.
114
- *
115
- * @example
116
- * ```js
117
- * console.log(myTable.description);
118
- * // => 'This is my table'
119
- * ```
120
- */
121
- }, {
122
- key: "description",
123
- get: function get() {
124
- return this._data.description;
125
- }
126
- /**
127
- * The table's primary field. Every table has exactly one primary
128
- * field. The primary field of a table will not change.
129
- *
130
- * @example
131
- * ```js
132
- * console.log(myTable.primaryField.name);
133
- * // => 'Name'
134
- * ```
135
- */
136
- }, {
137
- key: "primaryField",
138
- get: function get() {
139
- var primaryField = this.getFieldById(this._data.primaryFieldId);
140
- return primaryField;
141
- }
142
- /**
143
- * The fields in this table. The order is arbitrary, since fields are
144
- * only ordered in the context of a specific view.
145
- *
146
- * Can be watched to know when fields are created or deleted.
147
- *
148
- * @example
149
- * ```js
150
- * console.log(`This table has ${myTable.fields.length} fields`);
151
- * ```
152
- */
153
- }, {
154
- key: "fields",
155
- get: function get() {
156
- // TODO(kasra): is it confusing that this returns an array, since the order
157
- // is arbitrary?
158
- // TODO(kasra): cache and freeze this so it isn't O(n)
159
- var fields = [];
160
- for (var _i = 0, _Object$keys = Object.keys(this._data.fieldsById); _i < _Object$keys.length; _i++) {
161
- var _fieldId = _Object$keys[_i];
162
- var field = this.getFieldById(_fieldId);
163
- fields.push(field);
164
- }
165
- return fields;
166
- }
167
- /**
168
- * Gets the field matching the given ID, or `null` if that field does not exist in this table.
169
- * @param fieldId The ID of the field.
170
- * @example
171
- * ```js
172
- * const fieldId = 'fldxxxxxxxxxxxxxx';
173
- * const field = myTable.getFieldByIdIfExists(fieldId);
174
- * if (field !== null) {
175
- * console.log(field.name);
176
- * } else {
177
- * console.log('No field exists with that ID');
178
- * }
179
- * ```
180
- */
181
- }, {
182
- key: "getFieldByIdIfExists",
183
- value: function getFieldByIdIfExists(fieldId) {
184
- if (!this._data.fieldsById[fieldId]) {
185
- return null;
186
- } else {
187
- if (!this._fieldModelsById[fieldId]) {
188
- this._fieldModelsById[fieldId] = this._constructField(fieldId);
189
- }
190
- return this._fieldModelsById[fieldId];
191
- }
192
- }
193
- /** @internal */
194
- }, {
195
- key: "getFieldById",
196
- value:
197
- /**
198
- * Gets the field matching the given ID. Throws if that field does not exist in this table. Use
199
- * {@link getFieldByIdIfExists} instead if you are unsure whether a field exists with the given
200
- * ID.
201
- *
202
- * @param fieldId The ID of the field.
203
- * @example
204
- * ```js
205
- * const fieldId = 'fldxxxxxxxxxxxxxx';
206
- * const field = myTable.getFieldById(fieldId);
207
- * console.log(field.name);
208
- * // => 'Name'
209
- * ```
210
- */
211
- function getFieldById(fieldId) {
212
- var field = this.getFieldByIdIfExists(fieldId);
213
- if (!field) {
214
- throw (0, _error_utils.spawnError)("No field with ID %s in table '%s'", fieldId, this.name);
215
- }
216
- return field;
217
- }
218
- /**
219
- * Gets the field matching the given name, or `null` if no field exists with that name in this
220
- * table.
221
- *
222
- * @param fieldName The name of the field you're looking for.
223
- * @example
224
- * ```js
225
- * const field = myTable.getFieldByNameIfExists('Name');
226
- * if (field !== null) {
227
- * console.log(field.id);
228
- * } else {
229
- * console.log('No field exists with that name');
230
- * }
231
- * ```
232
- */
233
- }, {
234
- key: "getFieldByNameIfExists",
235
- value: function getFieldByNameIfExists(fieldName) {
236
- var _iterator = _createForOfIteratorHelper((0, _private_utils.entries)(this._data.fieldsById)),
237
- _step;
238
- try {
239
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
240
- var _step$value = (0, _slicedToArray2.default)(_step.value, 2),
241
- _fieldId2 = _step$value[0],
242
- fieldData = _step$value[1];
243
- if (fieldData.name === fieldName) {
244
- return this.getFieldByIdIfExists(_fieldId2);
245
- }
246
- }
247
- } catch (err) {
248
- _iterator.e(err);
249
- } finally {
250
- _iterator.f();
251
- }
252
- return null;
253
- }
254
- /**
255
- * Gets the field matching the given name. Throws if no field exists with that name in this
256
- * table. Use {@link getFieldByNameIfExists} instead if you are unsure whether a field exists
257
- * with the given name.
258
- *
259
- * @param fieldName The name of the field you're looking for.
260
- * @example
261
- * ```js
262
- * const field = myTable.getFieldByName('Name');
263
- * console.log(field.id);
264
- * // => 'fldxxxxxxxxxxxxxx'
265
- * ```
266
- */
267
- }, {
268
- key: "getFieldByName",
269
- value: function getFieldByName(fieldName) {
270
- var field = this.getFieldByNameIfExists(fieldName);
271
- if (!field) {
272
- throw (0, _error_utils.spawnError)("No field named '%s' in table '%s'", fieldName, this.name);
273
- }
274
- return field;
275
- }
276
- /**
277
- * The field matching the given ID or name. Returns `null` if no matching field exists within
278
- * this table.
279
- *
280
- * This method is convenient when building an extension for a specific base, but for more generic
281
- * extensions the best practice is to use the {@link getFieldByIdIfExists} or
282
- * {@link getFieldByNameIfExists} methods instead.
283
- *
284
- * @param fieldIdOrName The ID or name of the field you're looking for.
285
- */
286
- }, {
287
- key: "getFieldIfExists",
288
- value: function getFieldIfExists(fieldIdOrName) {
289
- var _this$getFieldByIdIfE;
290
- return (_this$getFieldByIdIfE = this.getFieldByIdIfExists(fieldIdOrName)) !== null && _this$getFieldByIdIfE !== void 0 ? _this$getFieldByIdIfE : this.getFieldByNameIfExists(fieldIdOrName);
291
- }
292
- /**
293
- * The field matching the given ID or name. Throws if no matching field exists within this table.
294
- * Use {@link getFieldIfExists} instead if you are unsure whether a field exists with the given
295
- * name/ID.
296
- *
297
- * This method is convenient when building an extension for a specific base, but for more generic
298
- * extensions the best practice is to use the {@link getFieldById} or {@link getFieldByName} methods
299
- * instead.
300
- *
301
- * @param fieldIdOrName The ID or name of the field you're looking for.
302
- */
303
- }, {
304
- key: "getField",
305
- value: function getField(fieldIdOrName) {
306
- var field = this.getFieldIfExists(fieldIdOrName);
307
- if (!field) {
308
- throw (0, _error_utils.spawnError)("No field with ID or name '%s' in table '%s'", fieldIdOrName, this.name);
309
- }
310
- return field;
311
- }
312
- /** @internal */
313
- }, {
314
- key: "_cellValuesByFieldIdOrNameToCellValuesByFieldId",
315
- value: function _cellValuesByFieldIdOrNameToCellValuesByFieldId(cellValuesByFieldIdOrName) {
316
- return Object.fromEntries((0, _private_utils.entries)(cellValuesByFieldIdOrName).map(_ref => {
317
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
318
- fieldIdOrName = _ref2[0],
319
- cellValue = _ref2[1];
320
- var field = this.__getFieldMatching(fieldIdOrName);
321
- return [field.id, cellValue];
322
- }));
323
- }
324
- /**
325
- * @internal
326
- */
327
- }, {
328
- key: "__getFieldMatching",
329
- value: function __getFieldMatching(fieldOrFieldIdOrFieldName) {
330
- var field;
331
- if (fieldOrFieldIdOrFieldName instanceof _field_core.FieldCore) {
332
- if (fieldOrFieldIdOrFieldName.parentTable.id !== this.id) {
333
- throw (0, _error_utils.spawnError)("Field '%s' is from a different table than table '%s'", fieldOrFieldIdOrFieldName.name, this.name);
334
- }
335
- field = fieldOrFieldIdOrFieldName;
336
- } else {
337
- field = this.getFieldByIdIfExists(fieldOrFieldIdOrFieldName) || this.getFieldByNameIfExists(fieldOrFieldIdOrFieldName);
338
- if (field === null) {
339
- throw (0, _error_utils.spawnError)("Field '%s' does not exist in table '%s'", fieldOrFieldIdOrFieldName, this.name);
340
- }
341
- }
342
- if (field.isDeleted) {
343
- throw (0, _error_utils.spawnError)("Field '%s' was deleted from table '%s'", field.name, this.name);
344
- }
345
- return field;
346
- }
347
-
348
- /**
349
- * Updates cell values for a record.
350
- *
351
- * Throws an error if the user does not have permission to update the given cell values in
352
- * the record, or if invalid input is provided (eg. invalid cell values).
353
- *
354
- * Refer to {@link FieldType} for cell value write formats.
355
- *
356
- * This action is asynchronous: `await` the returned promise if you wish to wait for the updated
357
- * cell values to be persisted to Airtable servers.
358
- * Updates are applied optimistically locally, so your changes will be reflected in your extension
359
- * before the promise resolves.
360
- *
361
- * @param recordOrRecordId the record to update
362
- * @param fields cell values to update in that record, specified as object mapping `FieldId` or field name to value for that field.
363
- * @example
364
- * ```js
365
- * function updateRecord(record, recordFields) {
366
- * if (table.hasPermissionToUpdateRecord(record, recordFields)) {
367
- * table.updateRecordAsync(record, recordFields);
368
- * }
369
- * // The updated values will now show in your extension (eg in
370
- * // `table.selectRecords()` result) but are still being saved to Airtable
371
- * // servers (e.g. other users may not be able to see them yet).
372
- * }
373
- *
374
- * async function updateRecordAsync(record, recordFields) {
375
- * if (table.hasPermissionToUpdateRecord(record, recordFields)) {
376
- * await table.updateRecordAsync(record, recordFields);
377
- * }
378
- * // New record has been saved to Airtable servers.
379
- * alert(`record with ID ${record.id} has been updated`);
380
- * }
381
- *
382
- * // Fields can be specified by name or ID
383
- * updateRecord(record1, {
384
- * 'Post Title': 'How to make: orange-mango pound cake',
385
- * 'Publication Date': '2020-01-01',
386
- * });
387
- * updateRecord(record2, {
388
- * [postTitleField.id]: 'Cake decorating tips & tricks',
389
- * [publicationDateField.id]: '2020-02-02',
390
- * });
391
- *
392
- * // Cell values should generally have format matching the output of
393
- * // record.getCellValue() for the field being updated
394
- * updateRecord(record1, {
395
- * 'Category (single select)': {name: 'Recipe'},
396
- * 'Tags (multiple select)': [{name: 'Desserts'}, {id: 'someChoiceId'}],
397
- * 'Images (attachment)': [{url: 'http://mywebsite.com/cake.png'}],
398
- * 'Related posts (linked records)': [{id: 'someRecordId'}],
399
- * });
400
- * ```
401
- */
402
- }, {
403
- key: "updateRecordAsync",
404
- value: (function () {
405
- var _updateRecordAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(recordOrRecordId, fields) {
406
- var recordId;
407
- return _regenerator.default.wrap(function _callee$(_context) {
408
- while (1) switch (_context.prev = _context.next) {
409
- case 0:
410
- recordId = typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id;
411
- _context.next = 3;
412
- return this.updateRecordsAsync([{
413
- id: recordId,
414
- fields
415
- }]);
416
- case 3:
417
- case "end":
418
- return _context.stop();
419
- }
420
- }, _callee, this);
421
- }));
422
- function updateRecordAsync(_x, _x2) {
423
- return _updateRecordAsync.apply(this, arguments);
424
- }
425
- return updateRecordAsync;
426
- }()
427
- /**
428
- * Checks whether the current user has permission to perform the given record update.
429
- *
430
- * Accepts partial input, in the same format as {@link updateRecordAsync}.
431
- * The more information provided, the more accurate the permissions check will be.
432
- *
433
- * Returns `{hasPermission: true}` if the current user can update the specified record,
434
- * `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
435
- * used to display an error message to the user.
436
- *
437
- * @param recordOrRecordId the record to update
438
- * @param fields cell values to update in that record, specified as object mapping `FieldId` or field name to value for that field.
439
- * @example
440
- * ```js
441
- * // Check if user can update specific fields for a specific record.
442
- * const updateRecordCheckResult =
443
- * table.checkPermissionsForUpdateRecord(record, {
444
- * 'Post Title': 'How to make: orange-mango pound cake',
445
- * 'Publication Date': '2020-01-01',
446
- * });
447
- * if (!updateRecordCheckResult.hasPermission) {
448
- * alert(updateRecordCheckResult.reasonDisplayString);
449
- * }
450
- *
451
- * // Like updateRecordAsync, you can use either field names or field IDs.
452
- * const updateRecordCheckResultWithFieldIds =
453
- * table.checkPermissionsForUpdateRecord(record, {
454
- * [postTitleField.id]: 'Cake decorating tips & tricks',
455
- * [publicationDateField.id]: '2020-02-02',
456
- * });
457
- *
458
- * // Check if user could update a given record, when you don't know the
459
- * // specific fields that will be updated yet (e.g. to check whether you should
460
- * // allow a user to select a certain record to update).
461
- * const updateUnknownFieldsCheckResult =
462
- * table.checkPermissionsForUpdateRecord(record);
463
- *
464
- * // Check if user could update specific fields, when you don't know the
465
- * // specific record that will be updated yet. (for example, if the field is
466
- * // selected by the user and you want to check if your extension can write to it).
467
- * const updateUnknownRecordCheckResult =
468
- * table.checkPermissionsForUpdateRecord(undefined, {
469
- * 'My field name': 'updated value',
470
- * // You can use undefined if you know you're going to update a field,
471
- * // but don't know the new cell value yet.
472
- * 'Another field name': undefined,
473
- * });
474
- *
475
- * // Check if user could perform updates within the table, without knowing the
476
- * // specific record or fields that will be updated yet (e.g., to render your
477
- * // extension in "read only" mode).
478
- * const updateUnknownRecordAndFieldsCheckResult =
479
- * table.checkPermissionsForUpdateRecord();
480
- * ```
481
- */
482
- )
483
- }, {
484
- key: "checkPermissionsForUpdateRecord",
485
- value: function checkPermissionsForUpdateRecord(recordOrRecordId, fields) {
486
- var recordId = typeof recordOrRecordId === 'object' && recordOrRecordId !== null ? recordOrRecordId.id : recordOrRecordId;
487
- return this.checkPermissionsForUpdateRecords([{
488
- id: recordId,
489
- fields
490
- }]);
491
- }
492
- /**
493
- * An alias for `checkPermissionsForUpdateRecord(recordOrRecordId, fields).hasPermission`.
494
- *
495
- * Checks whether the current user has permission to perform the given record update.
496
- *
497
- * Accepts partial input, in the same format as {@link updateRecordAsync}.
498
- * The more information provided, the more accurate the permissions check will be.
499
- *
500
- * @param recordOrRecordId the record to update
501
- * @param fields cell values to update in that record, specified as object mapping `FieldId` or field name to value for that field.
502
- * @example
503
- * ```js
504
- * // Check if user can update specific fields for a specific record.
505
- * const canUpdateRecord = table.hasPermissionToUpdateRecord(record, {
506
- * 'Post Title': 'How to make: orange-mango pound cake',
507
- * 'Publication Date': '2020-01-01',
508
- * });
509
- * if (!canUpdateRecord) {
510
- * alert('not allowed!');
511
- * }
512
- *
513
- * // Like updateRecordAsync, you can use either field names or field IDs.
514
- * const canUpdateRecordWithFieldIds =
515
- * table.hasPermissionToUpdateRecord(record, {
516
- * [postTitleField.id]: 'Cake decorating tips & tricks',
517
- * [publicationDateField.id]: '2020-02-02',
518
- * });
519
- *
520
- * // Check if user could update a given record, when you don't know the
521
- * // specific fields that will be updated yet (e.g. to check whether you should
522
- * // allow a user to select a certain record to update).
523
- * const canUpdateUnknownFields = table.hasPermissionToUpdateRecord(record);
524
- *
525
- * // Check if user could update specific fields, when you don't know the
526
- * // specific record that will be updated yet (e.g. if the field is selected
527
- * // by the user and you want to check if your extension can write to it).
528
- * const canUpdateUnknownRecord =
529
- * table.hasPermissionToUpdateRecord(undefined, {
530
- * 'My field name': 'updated value',
531
- * // You can use undefined if you know you're going to update a field,
532
- * // but don't know the new cell value yet.
533
- * 'Another field name': undefined,
534
- * });
535
- *
536
- * // Check if user could perform updates within the table, without knowing the
537
- * // specific record or fields that will be updated yet. (for example, to
538
- * // render your extension in "read only" mode)
539
- * const canUpdateUnknownRecordAndFields = table.hasPermissionToUpdateRecord();
540
- * ```
541
- */
542
- }, {
543
- key: "hasPermissionToUpdateRecord",
544
- value: function hasPermissionToUpdateRecord(recordOrRecordId, fields) {
545
- return this.checkPermissionsForUpdateRecord(recordOrRecordId, fields).hasPermission;
546
- }
547
- /**
548
- * Updates cell values for records.
549
- *
550
- * Throws an error if the user does not have permission to update the given cell values in
551
- * the records, or if invalid input is provided (eg. invalid cell values).
552
- *
553
- * Refer to {@link FieldType} for cell value write formats.
554
- *
555
- * You may only update up to 50 records in one call to `updateRecordsAsync`.
556
- * See [Write back to Airtable](/guides/write-back-to-airtable) for more information
557
- * about write limits.
558
- *
559
- * This action is asynchronous: `await` the returned promise if you wish to wait for the
560
- * updates to be persisted to Airtable servers.
561
- * Updates are applied optimistically locally, so your changes will be reflected in your extension
562
- * before the promise resolves.
563
- *
564
- * @param records Array of objects containing recordId and fields/cellValues to update for that record (specified as an object mapping `FieldId` or field name to cell value)
565
- * @example
566
- * ```js
567
- * const recordsToUpdate = [
568
- * // Fields can be specified by name or ID
569
- * {
570
- * id: record1.id,
571
- * fields: {
572
- * 'Post Title': 'How to make: orange-mango pound cake',
573
- * 'Publication Date': '2020-01-01',
574
- * },
575
- * },
576
- * {
577
- * id: record2.id,
578
- * fields: {
579
- * // Sets the cell values to be empty.
580
- * 'Post Title': '',
581
- * 'Publication Date': '',
582
- * },
583
- * },
584
- * {
585
- * id: record3.id,
586
- * fields: {
587
- * [postTitleField.id]: 'Cake decorating tips & tricks',
588
- * [publicationDateField.id]: '2020-02-02',
589
- * },
590
- * },
591
- * // Cell values should generally have format matching the output of
592
- * // record.getCellValue() for the field being updated
593
- * {
594
- * id: record4.id,
595
- * fields: {
596
- * 'Category (single select)': {name: 'Recipe'},
597
- * 'Tags (multiple select)': [{name: 'Desserts'}, {id: 'choiceId'}],
598
- * 'Images (attachment)': [{url: 'http://mywebsite.com/cake.png'}],
599
- * 'Related posts (linked records)': [{id: 'someRecordId'}],
600
- * },
601
- * },
602
- * ];
603
- *
604
- * function updateRecords() {
605
- * if (table.hasPermissionToUpdateRecords(recordsToUpdate)) {
606
- * table.updateRecordsAsync(recordsToUpdate);
607
- * }
608
- * // The records are now updated within your extension (eg will be reflected in
609
- * // `table.selectRecords()`) but are still being saved to Airtable servers
610
- * // (e.g. they may not be updated for other users yet).
611
- * }
612
- *
613
- * async function updateRecordsAsync() {
614
- * if (table.hasPermissionToUpdateRecords(recordsToUpdate)) {
615
- * await table.updateRecordsAsync(recordsToUpdate);
616
- * }
617
- * // Record updates have been saved to Airtable servers.
618
- * alert('records have been updated');
619
- * }
620
- * ```
621
- */
622
- }, {
623
- key: "updateRecordsAsync",
624
- value: (function () {
625
- var _updateRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(records) {
626
- var recordsWithCellValuesByFieldId;
627
- return _regenerator.default.wrap(function _callee2$(_context2) {
628
- while (1) switch (_context2.prev = _context2.next) {
629
- case 0:
630
- recordsWithCellValuesByFieldId = records.map(record => ({
631
- id: record.id,
632
- cellValuesByFieldId: this._cellValuesByFieldIdOrNameToCellValuesByFieldId(record.fields)
633
- }));
634
- _context2.next = 3;
635
- return this._sdk.__mutations.applyMutationAsync({
636
- type: _mutations_core.MutationTypesCore.SET_MULTIPLE_RECORDS_CELL_VALUES,
637
- tableId: this.id,
638
- records: recordsWithCellValuesByFieldId,
639
- opts: {
640
- parseDateCellValueInColumnTimeZone: true
641
- }
642
- });
643
- case 3:
644
- case "end":
645
- return _context2.stop();
646
- }
647
- }, _callee2, this);
648
- }));
649
- function updateRecordsAsync(_x3) {
650
- return _updateRecordsAsync.apply(this, arguments);
651
- }
652
- return updateRecordsAsync;
653
- }()
654
- /**
655
- * Checks whether the current user has permission to perform the given record updates.
656
- *
657
- * Accepts partial input, in the same format as {@link updateRecordsAsync}.
658
- * The more information provided, the more accurate the permissions check will be.
659
- *
660
- * Returns `{hasPermission: true}` if the current user can update the specified records,
661
- * `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
662
- * used to display an error message to the user.
663
- *
664
- * @param records Array of objects containing recordId and fields/cellValues to update for that record (specified as an object mapping `FieldId` or field name to cell value)
665
- * @example
666
- * ```js
667
- * const recordsToUpdate = [
668
- * {
669
- * // Validating a complete record update
670
- * id: record1.id,
671
- * fields: {
672
- * 'Post Title': 'How to make: orange-mango pound cake',
673
- * 'Publication Date': '2020-01-01',
674
- * },
675
- * },
676
- * {
677
- * // Like updateRecordsAsync, fields can be specified by name or ID
678
- * id: record2.id,
679
- * fields: {
680
- * [postTitleField.id]: 'Cake decorating tips & tricks',
681
- * [publicationDateField.id]: '2020-02-02',
682
- * },
683
- * },
684
- * {
685
- * // Validating an update to a specific record, not knowing what
686
- * // fields will be updated
687
- * id: record3.id,
688
- * },
689
- * {
690
- * // Validating an update to specific cell values, not knowing what
691
- * // record will be updated
692
- * fields: {
693
- * 'My field name': 'updated value for unknown record',
694
- * // You can use undefined if you know you're going to update a
695
- * // field, but don't know the new cell value yet.
696
- * 'Another field name': undefined,
697
- * },
698
- * },
699
- * ];
700
- *
701
- * const updateRecordsCheckResult =
702
- * table.checkPermissionsForUpdateRecords(recordsToUpdate);
703
- * if (!updateRecordsCheckResult.hasPermission) {
704
- * alert(updateRecordsCheckResult.reasonDisplayString);
705
- * }
706
- *
707
- * // Check if user could potentially update records.
708
- * // Equivalent to table.checkPermissionsForUpdateRecord()
709
- * const updateUnknownRecordAndFieldsCheckResult =
710
- * table.checkPermissionsForUpdateRecords();
711
- * ```
712
- */
713
- )
714
- }, {
715
- key: "checkPermissionsForUpdateRecords",
716
- value: function checkPermissionsForUpdateRecords(records) {
717
- return this._sdk.__mutations.checkPermissionsForMutation({
718
- type: _mutations_core.MutationTypesCore.SET_MULTIPLE_RECORDS_CELL_VALUES,
719
- tableId: this.id,
720
- records: records ? records.map(record => ({
721
- id: record.id || undefined,
722
- cellValuesByFieldId: record.fields ? this._cellValuesByFieldIdOrNameToCellValuesByFieldId(record.fields) : undefined
723
- })) : undefined
724
- });
725
- }
726
- /**
727
- * An alias for `checkPermissionsForUpdateRecords(records).hasPermission`.
728
- *
729
- * Checks whether the current user has permission to perform the given record updates.
730
- *
731
- * Accepts partial input, in the same format as {@link updateRecordsAsync}.
732
- * The more information provided, the more accurate the permissions check will be.
733
- *
734
- * @param records Array of objects containing recordId and fields/cellValues to update for that record (specified as an object mapping `FieldId` or field name to cell value)
735
- * @example
736
- * ```js
737
- * const recordsToUpdate = [
738
- * {
739
- * // Validating a complete record update
740
- * id: record1.id,
741
- * fields: {
742
- * 'Post Title': 'How to make: orange-mango pound cake',
743
- * 'Publication Date': '2020-01-01',
744
- * },
745
- * },
746
- * {
747
- * // Like updateRecordsAsync, fields can be specified by name or ID
748
- * id: record2.id,
749
- * fields: {
750
- * [postTitleField.id]: 'Cake decorating tips & tricks',
751
- * [publicationDateField.id]: '2020-02-02',
752
- * },
753
- * },
754
- * {
755
- * // Validating an update to a specific record, not knowing what
756
- * // fields will be updated
757
- * id: record3.id,
758
- * },
759
- * {
760
- * // Validating an update to specific cell values, not knowing what
761
- * // record will be updated
762
- * fields: {
763
- * 'My field name': 'updated value for unknown record',
764
- * // You can use undefined if you know you're going to update a
765
- * // field, but don't know the new cell value yet.
766
- * 'Another field name': undefined,
767
- * },
768
- * },
769
- * ];
770
- *
771
- * const canUpdateRecords = table.hasPermissionToUpdateRecords(recordsToUpdate);
772
- * if (!canUpdateRecords) {
773
- * alert('not allowed');
774
- * }
775
- *
776
- * // Check if user could potentially update records.
777
- * // Equivalent to table.hasPermissionToUpdateRecord()
778
- * const canUpdateUnknownRecordsAndFields =
779
- * table.hasPermissionToUpdateRecords();
780
- * ```
781
- */
782
- }, {
783
- key: "hasPermissionToUpdateRecords",
784
- value: function hasPermissionToUpdateRecords(records) {
785
- return this.checkPermissionsForUpdateRecords(records).hasPermission;
786
- }
787
- /**
788
- * Delete the given record.
789
- *
790
- * Throws an error if the user does not have permission to delete the given record.
791
- *
792
- * This action is asynchronous: `await` the returned promise if you wish to wait for the
793
- * delete to be persisted to Airtable servers.
794
- * Updates are applied optimistically locally, so your changes will be reflected in your extension
795
- * before the promise resolves.
796
- *
797
- * @param recordOrRecordId the record to be deleted
798
- * @example
799
- * ```js
800
- * function deleteRecord(record) {
801
- * if (table.hasPermissionToDeleteRecord(record)) {
802
- * table.deleteRecordAsync(record);
803
- * }
804
- * // The record is now deleted within your extension (eg will not be returned
805
- * // in `table.selectRecords`) but it is still being saved to Airtable
806
- * // servers (e.g. it may not look deleted to other users yet).
807
- * }
808
- *
809
- * async function deleteRecordAsync(record) {
810
- * if (table.hasPermissionToDeleteRecord(record)) {
811
- * await table.deleteRecordAsync(record);
812
- * }
813
- * // Record deletion has been saved to Airtable servers.
814
- * alert('record has been deleted');
815
- * }
816
- * ```
817
- */
818
- }, {
819
- key: "deleteRecordAsync",
820
- value: (function () {
821
- var _deleteRecordAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(recordOrRecordId) {
822
- return _regenerator.default.wrap(function _callee3$(_context3) {
823
- while (1) switch (_context3.prev = _context3.next) {
824
- case 0:
825
- _context3.next = 2;
826
- return this.deleteRecordsAsync([recordOrRecordId]);
827
- case 2:
828
- case "end":
829
- return _context3.stop();
830
- }
831
- }, _callee3, this);
832
- }));
833
- function deleteRecordAsync(_x4) {
834
- return _deleteRecordAsync.apply(this, arguments);
835
- }
836
- return deleteRecordAsync;
837
- }()
838
- /**
839
- * Checks whether the current user has permission to delete the specified record.
840
- *
841
- * Accepts optional input, in the same format as {@link deleteRecordAsync}.
842
- * The more information provided, the more accurate the permissions check will be.
843
- *
844
- * Returns `{hasPermission: true}` if the current user can delete the specified record,
845
- * `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
846
- * used to display an error message to the user.
847
- *
848
- * @param recordOrRecordId the record to be deleted
849
- * @example
850
- * ```js
851
- * // Check if user can delete a specific record
852
- * const deleteRecordCheckResult =
853
- * table.checkPermissionsForDeleteRecord(record);
854
- * if (!deleteRecordCheckResult.hasPermission) {
855
- * alert(deleteRecordCheckResult.reasonDisplayString);
856
- * }
857
- *
858
- * // Check if user could potentially delete a record.
859
- * // Use when you don't know the specific record you want to delete yet (for
860
- * // example, to show/hide UI controls that let you select a record to delete).
861
- * const deleteUnknownRecordCheckResult =
862
- * table.checkPermissionsForDeleteRecord();
863
- * ```
864
- */
865
- )
866
- }, {
867
- key: "checkPermissionsForDeleteRecord",
868
- value: function checkPermissionsForDeleteRecord(recordOrRecordId) {
869
- return this.checkPermissionsForDeleteRecords(recordOrRecordId ? [recordOrRecordId] : undefined);
870
- }
871
- /**
872
- * An alias for `checkPermissionsForDeleteRecord(recordOrRecordId).hasPermission`.
873
- *
874
- * Checks whether the current user has permission to delete the specified record.
875
- *
876
- * Accepts optional input, in the same format as {@link deleteRecordAsync}.
877
- * The more information provided, the more accurate the permissions check will be.
878
- *
879
- * @param recordOrRecordId the record to be deleted
880
- * @example
881
- * ```js
882
- * // Check if user can delete a specific record
883
- * const canDeleteRecord = table.hasPermissionToDeleteRecord(record);
884
- * if (!canDeleteRecord) {
885
- * alert('not allowed');
886
- * }
887
- *
888
- * // Check if user could potentially delete a record.
889
- * // Use when you don't know the specific record you want to delete yet (for
890
- * // example, to show/hide UI controls that let you select a record to delete).
891
- * const canDeleteUnknownRecord = table.hasPermissionToDeleteRecord();
892
- * ```
893
- */
894
- }, {
895
- key: "hasPermissionToDeleteRecord",
896
- value: function hasPermissionToDeleteRecord(recordOrRecordId) {
897
- return this.checkPermissionsForDeleteRecord(recordOrRecordId).hasPermission;
898
- }
899
- /**
900
- * Delete the given records.
901
- *
902
- * Throws an error if the user does not have permission to delete the given records.
903
- *
904
- * You may only delete up to 50 records in one call to `deleteRecordsAsync`.
905
- * See [Write back to Airtable](/guides/write-back-to-airtable#size-limits-rate-limits) for
906
- * more information about write limits.
907
- *
908
- * This action is asynchronous: `await` the returned promise if you wish to wait for the
909
- * delete to be persisted to Airtable servers.
910
- * Updates are applied optimistically locally, so your changes will be reflected in your extension
911
- * before the promise resolves.
912
- *
913
- * @param recordsOrRecordIds Array of Records and RecordIds
914
- * @example
915
- * ```js
916
- *
917
- * function deleteRecords(records) {
918
- * if (table.hasPermissionToDeleteRecords(records)) {
919
- * table.deleteRecordsAsync(records);
920
- * }
921
- * // The records are now deleted within your extension (eg will not be
922
- * // returned in `table.selectRecords()`) but are still being saved to
923
- * // Airtable servers (e.g. they may not look deleted to other users yet).
924
- * }
925
- *
926
- * async function deleteRecordsAsync(records) {
927
- * if (table.hasPermissionToDeleteRecords(records)) {
928
- * await table.deleteRecordsAsync(records);
929
- * }
930
- * // Record deletions have been saved to Airtable servers.
931
- * alert('records have been deleted');
932
- * }
933
- * ```
934
- */
935
- }, {
936
- key: "deleteRecordsAsync",
937
- value: (function () {
938
- var _deleteRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(recordsOrRecordIds) {
939
- var recordIds;
940
- return _regenerator.default.wrap(function _callee4$(_context4) {
941
- while (1) switch (_context4.prev = _context4.next) {
942
- case 0:
943
- recordIds = recordsOrRecordIds.map(recordOrRecordId => typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id);
944
- _context4.next = 3;
945
- return this._sdk.__mutations.applyMutationAsync({
946
- type: _mutations_core.MutationTypesCore.DELETE_MULTIPLE_RECORDS,
947
- tableId: this.id,
948
- recordIds
949
- });
950
- case 3:
951
- case "end":
952
- return _context4.stop();
953
- }
954
- }, _callee4, this);
955
- }));
956
- function deleteRecordsAsync(_x5) {
957
- return _deleteRecordsAsync.apply(this, arguments);
958
- }
959
- return deleteRecordsAsync;
960
- }()
961
- /**
962
- * Checks whether the current user has permission to delete the specified records.
963
- *
964
- * Accepts optional input, in the same format as {@link deleteRecordsAsync}.
965
- * The more information provided, the more accurate the permissions check will be.
966
- *
967
- * Returns `{hasPermission: true}` if the current user can delete the specified records,
968
- * `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
969
- * used to display an error message to the user.
970
- *
971
- * @param recordsOrRecordIds the records to be deleted
972
- * @example
973
- * ```js
974
- * // Check if user can delete specific records
975
- * const deleteRecordsCheckResult =
976
- * table.checkPermissionsForDeleteRecords([record1, record2]);
977
- * if (!deleteRecordsCheckResult.hasPermission) {
978
- * alert(deleteRecordsCheckResult.reasonDisplayString);
979
- * }
980
- *
981
- * // Check if user could potentially delete records.
982
- * // Use when you don't know the specific records you want to delete yet (for
983
- * // example, to show/hide UI controls that let you select records to delete).
984
- * // Equivalent to table.hasPermissionToDeleteRecord()
985
- * const deleteUnknownRecordsCheckResult =
986
- * table.checkPermissionsForDeleteRecords();
987
- * ```
988
- */
989
- )
990
- }, {
991
- key: "checkPermissionsForDeleteRecords",
992
- value: function checkPermissionsForDeleteRecords(recordsOrRecordIds) {
993
- return this._sdk.__mutations.checkPermissionsForMutation({
994
- type: _mutations_core.MutationTypesCore.DELETE_MULTIPLE_RECORDS,
995
- tableId: this.id,
996
- recordIds: recordsOrRecordIds ? recordsOrRecordIds.map(recordOrRecordId => typeof recordOrRecordId === 'string' ? recordOrRecordId : recordOrRecordId.id) : undefined
997
- });
998
- }
999
- /**
1000
- * An alias for `checkPermissionsForDeleteRecords(recordsOrRecordIds).hasPermission`.
1001
- *
1002
- * Checks whether the current user has permission to delete the specified records.
1003
- *
1004
- * Accepts optional input, in the same format as {@link deleteRecordsAsync}.
1005
- * The more information provided, the more accurate the permissions check will be.
1006
- *
1007
- * @param recordsOrRecordIds the records to be deleted
1008
- * @example
1009
- * ```js
1010
- * // Check if user can delete specific records
1011
- * const canDeleteRecords =
1012
- * table.hasPermissionToDeleteRecords([record1, record2]);
1013
- * if (!canDeleteRecords) {
1014
- * alert('not allowed!');
1015
- * }
1016
- *
1017
- * // Check if user could potentially delete records.
1018
- * // Use when you don't know the specific records you want to delete yet (for
1019
- * // example, to show/hide UI controls that let you select records to delete).
1020
- * // Equivalent to table.hasPermissionToDeleteRecord()
1021
- * const canDeleteUnknownRecords = table.hasPermissionToDeleteRecords();
1022
- * ```
1023
- */
1024
- }, {
1025
- key: "hasPermissionToDeleteRecords",
1026
- value: function hasPermissionToDeleteRecords(recordsOrRecordIds) {
1027
- return this.checkPermissionsForDeleteRecords(recordsOrRecordIds).hasPermission;
1028
- }
1029
-
1030
- /**
1031
- * Creates a new record with the specified cell values.
1032
- *
1033
- * Throws an error if the user does not have permission to create the given records, or
1034
- * if invalid input is provided (eg. invalid cell values).
1035
- *
1036
- * Refer to {@link FieldType} for cell value write formats.
1037
- *
1038
- * This action is asynchronous: `await` the returned promise if you wish to wait for the new
1039
- * record to be persisted to Airtable servers.
1040
- * Updates are applied optimistically locally, so your changes will be reflected in your extension
1041
- * before the promise resolves.
1042
- *
1043
- * The returned promise will resolve to the RecordId of the new record once it is persisted.
1044
- *
1045
- * @param fields object mapping `FieldId` or field name to value for that field.
1046
- * @example
1047
- * ```js
1048
- * function createNewRecord(recordFields) {
1049
- * if (table.hasPermissionToCreateRecord(recordFields)) {
1050
- * table.createRecordAsync(recordFields);
1051
- * }
1052
- * // You can now access the new record in your extension (eg
1053
- * // `table.selectRecords()`) but it is still being saved to Airtable
1054
- * // servers (e.g. other users may not be able to see it yet).
1055
- * }
1056
- *
1057
- * async function createNewRecordAsync(recordFields) {
1058
- * if (table.hasPermissionToCreateRecord(recordFields)) {
1059
- * const newRecordId = await table.createRecordAsync(recordFields);
1060
- * }
1061
- * // New record has been saved to Airtable servers.
1062
- * alert(`new record with ID ${newRecordId} has been created`);
1063
- * }
1064
- *
1065
- * // Fields can be specified by name or ID
1066
- * createNewRecord({
1067
- * 'Project Name': 'Advertising campaign',
1068
- * 'Budget': 100,
1069
- * });
1070
- * createNewRecord({
1071
- * [projectNameField.id]: 'Cat video',
1072
- * [budgetField.id]: 200,
1073
- * });
1074
- *
1075
- * // Cell values should generally have format matching the output of
1076
- * // record.getCellValue() for the field being updated
1077
- * createNewRecord({
1078
- * 'Project Name': 'Cat video 2'
1079
- * 'Category (single select)': {name: 'Video'},
1080
- * 'Tags (multiple select)': [{name: 'Cats'}, {id: 'someChoiceId'}],
1081
- * 'Assets (attachment)': [{url: 'http://mywebsite.com/cats.mp4'}],
1082
- * 'Related projects (linked records)': [{id: 'someRecordId'}],
1083
- * });
1084
- * ```
1085
- */
1086
- }, {
1087
- key: "createRecordAsync",
1088
- value: (function () {
1089
- var _createRecordAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
1090
- var fields,
1091
- recordIds,
1092
- _args5 = arguments;
1093
- return _regenerator.default.wrap(function _callee5$(_context5) {
1094
- while (1) switch (_context5.prev = _context5.next) {
1095
- case 0:
1096
- fields = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
1097
- _context5.next = 3;
1098
- return this.createRecordsAsync([{
1099
- fields
1100
- }]);
1101
- case 3:
1102
- recordIds = _context5.sent;
1103
- return _context5.abrupt("return", recordIds[0]);
1104
- case 5:
1105
- case "end":
1106
- return _context5.stop();
1107
- }
1108
- }, _callee5, this);
1109
- }));
1110
- function createRecordAsync() {
1111
- return _createRecordAsync.apply(this, arguments);
1112
- }
1113
- return createRecordAsync;
1114
- }()
1115
- /**
1116
- * Checks whether the current user has permission to create the specified record.
1117
- *
1118
- * Accepts partial input, in the same format as {@link createRecordAsync}.
1119
- * The more information provided, the more accurate the permissions check will be.
1120
- *
1121
- * Returns `{hasPermission: true}` if the current user can create the specified record,
1122
- * `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
1123
- * used to display an error message to the user.
1124
- *
1125
- * @param fields object mapping `FieldId` or field name to value for that field.
1126
- * @example
1127
- * ```js
1128
- * // Check if user can create a specific record, when you already know what
1129
- * // fields/cell values will be set for the record.
1130
- * const createRecordCheckResult = table.checkPermissionsForCreateRecord({
1131
- * 'Project Name': 'Advertising campaign',
1132
- * 'Budget': 100,
1133
- * });
1134
- * if (!createRecordCheckResult.hasPermission) {
1135
- * alert(createRecordCheckResult.reasonDisplayString);
1136
- * }
1137
- *
1138
- * // Like createRecordAsync, you can use either field names or field IDs.
1139
- * const checkResultWithFieldIds = table.checkPermissionsForCreateRecord({
1140
- * [projectNameField.id]: 'Cat video',
1141
- * [budgetField.id]: 200,
1142
- * });
1143
- *
1144
- * // Check if user could potentially create a record.
1145
- * // Use when you don't know the specific fields/cell values yet (for example,
1146
- * // to show or hide UI controls that let you start creating a record.)
1147
- * const createUnknownRecordCheckResult =
1148
- * table.checkPermissionsForCreateRecord();
1149
- * ```
1150
- */
1151
- )
1152
- }, {
1153
- key: "checkPermissionsForCreateRecord",
1154
- value: function checkPermissionsForCreateRecord(fields) {
1155
- return this.checkPermissionsForCreateRecords([{
1156
- fields: fields || undefined
1157
- }]);
1158
- }
1159
- /**
1160
- * An alias for `checkPermissionsForCreateRecord(fields).hasPermission`.
1161
- *
1162
- * Checks whether the current user has permission to create the specified record.
1163
- *
1164
- * Accepts partial input, in the same format as {@link createRecordAsync}.
1165
- * The more information provided, the more accurate the permissions check will be.
1166
- *
1167
- * @param fields object mapping `FieldId` or field name to value for that field.
1168
- * @example
1169
- * ```js
1170
- * // Check if user can create a specific record, when you already know what
1171
- * // fields/cell values will be set for the record.
1172
- * const canCreateRecord = table.hasPermissionToCreateRecord({
1173
- * 'Project Name': 'Advertising campaign',
1174
- * 'Budget': 100,
1175
- * });
1176
- * if (!canCreateRecord) {
1177
- * alert('not allowed!');
1178
- * }
1179
- *
1180
- * // Like createRecordAsync, you can use either field names or field IDs.
1181
- * const canCreateRecordWithFieldIds = table.hasPermissionToCreateRecord({
1182
- * [projectNameField.id]: 'Cat video',
1183
- * [budgetField.id]: 200,
1184
- * });
1185
- *
1186
- * // Check if user could potentially create a record.
1187
- * // Use when you don't know the specific fields/cell values yet (for example,
1188
- * // to show or hide UI controls that let you start creating a record.)
1189
- * const canCreateUnknownRecord = table.hasPermissionToCreateRecord();
1190
- * ```
1191
- */
1192
- }, {
1193
- key: "hasPermissionToCreateRecord",
1194
- value: function hasPermissionToCreateRecord(fields) {
1195
- return this.checkPermissionsForCreateRecord(fields).hasPermission;
1196
- }
1197
- /**
1198
- * Creates new records with the specified cell values.
1199
- *
1200
- * Throws an error if the user does not have permission to create the given records, or
1201
- * if invalid input is provided (eg. invalid cell values).
1202
- *
1203
- * Refer to {@link FieldType} for cell value write formats.
1204
- *
1205
- * You may only create up to 50 records in one call to `createRecordsAsync`.
1206
- * See [Write back to Airtable](/guides/write-back-to-airtable#size-limits-rate-limits) for
1207
- * more information about write limits.
1208
- *
1209
- * This action is asynchronous: `await` the returned promise if you wish to wait for the new
1210
- * record to be persisted to Airtable servers.
1211
- * Updates are applied optimistically locally, so your changes will be reflected in your extension
1212
- * before the promise resolves.
1213
- *
1214
- * The returned promise will resolve to an array of RecordIds of the new records once the new
1215
- * records are persisted.
1216
- *
1217
- * @param records Array of objects with a `fields` key mapping `FieldId` or field name to value for that field.
1218
- * @example
1219
- * ```js
1220
- * const recordDefs = [
1221
- * // Fields can be specified by name or ID
1222
- * {
1223
- * fields: {
1224
- * 'Project Name': 'Advertising campaign',
1225
- * 'Budget': 100,
1226
- * },
1227
- * },
1228
- * {
1229
- * fields: {
1230
- * [projectNameField.id]: 'Cat video',
1231
- * [budgetField.id]: 200,
1232
- * },
1233
- * },
1234
- * // Specifying no fields will create a new record with no cell values set
1235
- * {
1236
- * fields: {},
1237
- * },
1238
- * // Cell values should generally have format matching the output of
1239
- * // record.getCellValue() for the field being updated
1240
- * {
1241
- * fields: {
1242
- * 'Project Name': 'Cat video 2'
1243
- * 'Category (single select)': {name: 'Video'},
1244
- * 'Tags (multiple select)': [{name: 'Cats'}, {id: 'choiceId'}],
1245
- * 'Assets (attachment)': [{url: 'http://mywebsite.com/cats.mp4'}],
1246
- * 'Related projects (linked records)': [{id: 'someRecordId'}],
1247
- * },
1248
- * },
1249
- * ];
1250
- *
1251
- * function createNewRecords() {
1252
- * if (table.hasPermissionToCreateRecords(recordDefs)) {
1253
- * table.createRecordsAsync(recordDefs);
1254
- * }
1255
- * // You can now access the new records in your extension (e.g.
1256
- * // `table.selectRecords()`) but they are still being saved to Airtable
1257
- * // servers (e.g. other users may not be able to see them yet.)
1258
- * }
1259
- *
1260
- * async function createNewRecordsAsync() {
1261
- * if (table.hasPermissionToCreateRecords(recordDefs)) {
1262
- * const newRecordIds = await table.createRecordsAsync(recordDefs);
1263
- * }
1264
- * // New records have been saved to Airtable servers.
1265
- * alert(`new records with IDs ${newRecordIds} have been created`);
1266
- * }
1267
- * ```
1268
- */
1269
- }, {
1270
- key: "createRecordsAsync",
1271
- value: (function () {
1272
- var _createRecordsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(records) {
1273
- var recordsToCreate;
1274
- return _regenerator.default.wrap(function _callee6$(_context6) {
1275
- while (1) switch (_context6.prev = _context6.next) {
1276
- case 0:
1277
- recordsToCreate = records.map(recordDef => {
1278
- var recordDefKeys = (0, _private_utils.keys)(recordDef);
1279
- var fields;
1280
- if (recordDefKeys.length === 1 && recordDefKeys[0] === 'fields') {
1281
- fields = recordDef.fields;
1282
- } else {
1283
- throw (0, _error_utils.spawnError)('Invalid record format. Please define field mappings using a `fields` key for each record definition object');
1284
- }
1285
- return {
1286
- id: this._sdk.__airtableInterface.idGenerator.generateRecordId(),
1287
- cellValuesByFieldId: this._cellValuesByFieldIdOrNameToCellValuesByFieldId(fields)
1288
- };
1289
- });
1290
- _context6.next = 3;
1291
- return this._sdk.__mutations.applyMutationAsync({
1292
- type: _mutations_core.MutationTypesCore.CREATE_MULTIPLE_RECORDS,
1293
- tableId: this.id,
1294
- records: recordsToCreate,
1295
- opts: {
1296
- parseDateCellValueInColumnTimeZone: true
1297
- }
1298
- });
1299
- case 3:
1300
- return _context6.abrupt("return", recordsToCreate.map(record => record.id));
1301
- case 4:
1302
- case "end":
1303
- return _context6.stop();
1304
- }
1305
- }, _callee6, this);
1306
- }));
1307
- function createRecordsAsync(_x6) {
1308
- return _createRecordsAsync.apply(this, arguments);
1309
- }
1310
- return createRecordsAsync;
1311
- }()
1312
- /**
1313
- * Checks whether the current user has permission to create the specified records.
1314
- *
1315
- * Accepts partial input, in the same format as {@link createRecordsAsync}.
1316
- * The more information provided, the more accurate the permissions check will be.
1317
- *
1318
- * Returns `{hasPermission: true}` if the current user can create the specified records,
1319
- * `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
1320
- * used to display an error message to the user.
1321
- *
1322
- * @param records Array of objects mapping `FieldId` or field name to value for that field.
1323
- * @example
1324
- * ```js
1325
- * // Check if user can create specific records, when you already know what
1326
- * // fields/cell values will be set for the records.
1327
- * const createRecordsCheckResult = table.checkPermissionsForCreateRecords([
1328
- * // Like createRecordsAsync, fields can be specified by name or ID
1329
- * {
1330
- * fields: {
1331
- * 'Project Name': 'Advertising campaign',
1332
- * 'Budget': 100,
1333
- * },
1334
- * },
1335
- * {
1336
- * fields: {
1337
- * [projectNameField.id]: 'Cat video',
1338
- * [budgetField.id]: 200,
1339
- * },
1340
- * },
1341
- * {},
1342
- * ]);
1343
- * if (!createRecordsCheckResult.hasPermission) {
1344
- * alert(createRecordsCheckResult.reasonDisplayString);
1345
- * }
1346
- *
1347
- * // Check if user could potentially create records.
1348
- * // Use when you don't know the specific fields/cell values yet (for example,
1349
- * // to show or hide UI controls that let you start creating records.)
1350
- * // Equivalent to table.checkPermissionsForCreateRecord()
1351
- * const createUnknownRecordCheckResult =
1352
- * table.checkPermissionsForCreateRecords();
1353
- * ```
1354
- */
1355
- )
1356
- }, {
1357
- key: "checkPermissionsForCreateRecords",
1358
- value: function checkPermissionsForCreateRecords(records) {
1359
- return this._sdk.__mutations.checkPermissionsForMutation({
1360
- type: _mutations_core.MutationTypesCore.CREATE_MULTIPLE_RECORDS,
1361
- tableId: this.id,
1362
- records: records ? records.map(record => ({
1363
- id: undefined,
1364
- cellValuesByFieldId: record.fields ? this._cellValuesByFieldIdOrNameToCellValuesByFieldId(record.fields) : undefined
1365
- })) : undefined
1366
- });
1367
- }
1368
- /**
1369
- * An alias for `checkPermissionsForCreateRecords(records).hasPermission`.
1370
- *
1371
- * Checks whether the current user has permission to create the specified records.
1372
- *
1373
- * Accepts partial input, in the same format as {@link createRecordsAsync}.
1374
- * The more information provided, the more accurate the permissions check will be.
1375
- *
1376
- * @param records Array of objects mapping `FieldId` or field name to value for that field.
1377
- * @example
1378
- * ```js
1379
- * // Check if user can create specific records, when you already know what fields/cell values
1380
- * // will be set for the records.
1381
- * const canCreateRecords = table.hasPermissionToCreateRecords([
1382
- * // Like createRecordsAsync, fields can be specified by name or ID
1383
- * {
1384
- * fields: {
1385
- * 'Project Name': 'Advertising campaign',
1386
- * 'Budget': 100,
1387
- * }
1388
- * },
1389
- * {
1390
- * fields: {
1391
- * [projectNameField.id]: 'Cat video',
1392
- * [budgetField.id]: 200,
1393
- * }
1394
- * },
1395
- * {},
1396
- * ]);
1397
- * if (!canCreateRecords) {
1398
- * alert('not allowed');
1399
- * }
1400
- *
1401
- * // Check if user could potentially create records.
1402
- * // Use when you don't know the specific fields/cell values yet (for example,
1403
- * // to show or hide UI controls that let you start creating records).
1404
- * // Equivalent to table.hasPermissionToCreateRecord()
1405
- * const canCreateUnknownRecords = table.hasPermissionToCreateRecords();
1406
- * ```
1407
- */
1408
- }, {
1409
- key: "hasPermissionToCreateRecords",
1410
- value: function hasPermissionToCreateRecords(records) {
1411
- return this.checkPermissionsForCreateRecords(records).hasPermission;
1412
- }
1413
-
1414
- /**
1415
- * @internal
1416
- */
1417
- }, {
1418
- key: "__triggerOnChangeForDirtyPaths",
1419
- value: function __triggerOnChangeForDirtyPaths(dirtyPaths) {
1420
- var didTableSchemaChange = false;
1421
- if (dirtyPaths.name) {
1422
- this._onChange(WatchableTableKeysCore.name);
1423
- didTableSchemaChange = true;
1424
- }
1425
- if (dirtyPaths.lock) {
1426
- didTableSchemaChange = true;
1427
- }
1428
- if (dirtyPaths.externalSyncById) {
1429
- didTableSchemaChange = true;
1430
- }
1431
- if (dirtyPaths.description) {
1432
- this._onChange(WatchableTableKeysCore.description);
1433
- didTableSchemaChange = true;
1434
- }
1435
- if (dirtyPaths.fieldsById) {
1436
- // TODO: don't trigger schema change when autonumber typeOptions change.
1437
- // That currently happens every time you create a row in a table with an
1438
- // autonumber field.
1439
- didTableSchemaChange = true;
1440
-
1441
- // Since tables don't have a field order, need to detect if a field
1442
- // was created or deleted and trigger onChange for fields.
1443
- var addedFieldIds = [];
1444
- var removedFieldIds = [];
1445
- var _iterator2 = _createForOfIteratorHelper((0, _private_utils.entries)(dirtyPaths.fieldsById)),
1446
- _step2;
1447
- try {
1448
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1449
- var _step2$value = (0, _slicedToArray2.default)(_step2.value, 2),
1450
- _fieldId3 = _step2$value[0],
1451
- dirtyFieldPaths = _step2$value[1];
1452
- if (dirtyFieldPaths && dirtyFieldPaths._isDirty) {
1453
- // If the entire field is dirty, it was either created or deleted.
1454
- if ((0, _private_utils.has)(this._data.fieldsById, _fieldId3)) {
1455
- addedFieldIds.push(_fieldId3);
1456
- } else {
1457
- removedFieldIds.push(_fieldId3);
1458
- var fieldModel = this._fieldModelsById[_fieldId3];
1459
- if (fieldModel) {
1460
- // Remove the Field model if it was deleted.
1461
- delete this._fieldModelsById[_fieldId3];
1462
- }
1463
- }
1464
- } else {
1465
- // Directly access from _fieldModelsById to avoid creating
1466
- // a field model if it doesn't already exist. If it doesn't exist,
1467
- // nothing can be subscribed to any events on it.
1468
- var field = this._fieldModelsById[_fieldId3];
1469
- if (field) {
1470
- field.__triggerOnChangeForDirtyPaths(dirtyFieldPaths);
1471
- }
1472
- }
1473
- }
1474
- } catch (err) {
1475
- _iterator2.e(err);
1476
- } finally {
1477
- _iterator2.f();
1478
- }
1479
- if (addedFieldIds.length > 0 || removedFieldIds.length > 0) {
1480
- this._onChange(WatchableTableKeysCore.fields, {
1481
- addedFieldIds,
1482
- removedFieldIds
1483
- });
1484
- }
1485
-
1486
- // Clear out cached field names in case a field was added/removed/renamed.
1487
- this._cachedFieldNamesById = null;
1488
- }
1489
-
1490
- // NOTE: Record store onChange triggers must be performed AFTER field onChange triggers to
1491
- // ensure the column type providers are not stale.
1492
- this._recordStore.triggerOnChangeForDirtyPaths(dirtyPaths);
1493
- return didTableSchemaChange;
1494
- }
1495
- /**
1496
- * @internal
1497
- */
1498
- }, {
1499
- key: "__getFieldNamesById",
1500
- value: function __getFieldNamesById() {
1501
- if (!this._cachedFieldNamesById) {
1502
- var fieldNamesById = {};
1503
- var _iterator3 = _createForOfIteratorHelper((0, _private_utils.entries)(this._data.fieldsById)),
1504
- _step3;
1505
- try {
1506
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1507
- var _step3$value = (0, _slicedToArray2.default)(_step3.value, 2),
1508
- _fieldId4 = _step3$value[0],
1509
- fieldData = _step3$value[1];
1510
- fieldNamesById[_fieldId4] = fieldData.name;
1511
- }
1512
- } catch (err) {
1513
- _iterator3.e(err);
1514
- } finally {
1515
- _iterator3.f();
1516
- }
1517
- this._cachedFieldNamesById = fieldNamesById;
1518
- }
1519
- return this._cachedFieldNamesById;
1520
- }
1521
- }], [{
1522
- key: "_isWatchableKey",
1523
- value: /** @internal */
1524
- function _isWatchableKey(key) {
1525
- return (0, _private_utils.isEnumValue)(WatchableTableKeysCore, key);
1526
- }
1527
- }]);
1528
- }(_abstract_model.default);
1529
- /** @internal */
1530
- (0, _defineProperty2.default)(TableCore, "_className", 'TableCore');