@airtable/blocks 0.0.0-experimental-f52bc4e5e-20250709 → 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.
- package/dist/esm/base/assert_run_context.js +12 -0
- package/dist/{cjs → esm}/base/index.js +30 -32
- package/dist/esm/base/models/abstract_model_with_async_data.js +190 -0
- package/dist/esm/base/models/base.js +252 -0
- package/dist/esm/base/models/create_aggregators.js +90 -0
- package/dist/esm/base/models/cursor.js +305 -0
- package/dist/esm/base/models/field.js +338 -0
- package/dist/esm/base/models/grouped_record_query_result.js +280 -0
- package/dist/esm/base/models/linked_records_query_result.js +553 -0
- package/dist/{cjs → esm}/base/models/models.js +19 -40
- package/dist/esm/base/models/mutations.js +312 -0
- package/dist/esm/base/models/object_pool.js +145 -0
- package/dist/esm/base/models/record.js +239 -0
- package/dist/{cjs → esm}/base/models/record_coloring.js +6 -6
- package/dist/esm/base/models/record_query_result.js +657 -0
- package/dist/esm/base/models/record_store.js +475 -0
- package/dist/esm/base/models/session.js +154 -0
- package/dist/esm/base/models/table.js +520 -0
- package/dist/esm/base/models/table_or_view_query_result.js +749 -0
- package/dist/esm/base/models/view.js +326 -0
- package/dist/esm/base/models/view_data_store.js +265 -0
- package/dist/esm/base/models/view_metadata_query_result.js +176 -0
- package/dist/esm/base/perform_record_action.js +215 -0
- package/dist/esm/base/sdk.js +178 -0
- package/dist/esm/base/settings_button.js +118 -0
- package/dist/{cjs → esm}/base/types/airtable_interface.js +1 -1
- package/dist/{cjs → esm}/base/types/mutations.js +5 -11
- package/dist/{cjs → esm}/base/types/undo_redo.js +1 -1
- package/dist/{cjs → esm}/base/types/view.js +1 -1
- package/dist/{cjs → esm}/base/ui/base_provider.js +6 -8
- package/dist/esm/base/ui/baymax_utils.js +461 -0
- package/dist/esm/base/ui/block_wrapper.js +118 -0
- package/dist/esm/base/ui/box.js +84 -0
- package/dist/esm/base/ui/button.js +152 -0
- package/dist/esm/base/ui/cell_renderer.js +198 -0
- package/dist/esm/base/ui/choice_token.js +93 -0
- package/dist/esm/base/ui/collaborator_token.js +123 -0
- package/dist/esm/base/ui/color_palette.js +196 -0
- package/dist/esm/base/ui/color_palette_synced.js +69 -0
- package/dist/esm/base/ui/confirmation_dialog.js +103 -0
- package/dist/{cjs → esm}/base/ui/control_sizes.js +24 -22
- package/dist/{cjs → esm}/base/ui/create_detect_element_resize.js +6 -10
- package/dist/{cjs → esm}/base/ui/css_helpers.js +1 -1
- package/dist/esm/base/ui/dialog.js +101 -0
- package/dist/esm/base/ui/dialog_close_button.js +106 -0
- package/dist/{cjs → esm}/base/ui/expand_record.js +1 -2
- package/dist/{cjs → esm}/base/ui/expand_record_list.js +3 -4
- package/dist/esm/base/ui/expand_record_picker_async.js +71 -0
- package/dist/esm/base/ui/field_icon.js +44 -0
- package/dist/esm/base/ui/field_picker.js +98 -0
- package/dist/esm/base/ui/field_picker_synced.js +66 -0
- package/dist/esm/base/ui/form_field.js +109 -0
- package/dist/{cjs → esm}/base/ui/geometry/geometry.js +5 -5
- package/dist/esm/base/ui/geometry/point.js +19 -0
- package/dist/esm/base/ui/geometry/rect.js +51 -0
- package/dist/esm/base/ui/geometry/size.js +19 -0
- package/dist/esm/base/ui/global_alert.js +71 -0
- package/dist/esm/base/ui/heading.js +132 -0
- package/dist/esm/base/ui/icon.js +109 -0
- package/dist/{cjs → esm}/base/ui/icon_config.js +6 -12
- package/dist/{cjs → esm}/base/ui/initialize_block.js +16 -35
- package/dist/esm/base/ui/input.js +161 -0
- package/dist/esm/base/ui/input_synced.js +66 -0
- package/dist/{cjs → esm}/base/ui/key_codes.js +2 -3
- package/dist/esm/base/ui/label.js +80 -0
- package/dist/esm/base/ui/link.js +196 -0
- package/dist/esm/base/ui/loader.js +61 -0
- package/dist/esm/base/ui/modal.js +145 -0
- package/dist/esm/base/ui/model_picker_select.js +57 -0
- package/dist/esm/base/ui/popover.js +315 -0
- package/dist/esm/base/ui/progress_bar.js +115 -0
- package/dist/esm/base/ui/record_card.js +564 -0
- package/dist/esm/base/ui/record_card_list.js +303 -0
- package/dist/esm/base/ui/select.js +191 -0
- package/dist/esm/base/ui/select_and_select_buttons_helpers.js +63 -0
- package/dist/esm/base/ui/select_buttons.js +159 -0
- package/dist/esm/base/ui/select_buttons_synced.js +62 -0
- package/dist/esm/base/ui/select_synced.js +65 -0
- package/dist/esm/base/ui/switch.js +167 -0
- package/dist/esm/base/ui/switch_synced.js +53 -0
- package/dist/esm/base/ui/synced.js +49 -0
- package/dist/{cjs → esm}/base/ui/system/all_styles_set.js +4 -12
- package/dist/esm/base/ui/system/appearance/appearance_set.js +27 -0
- package/dist/esm/base/ui/system/appearance/background_color.js +18 -0
- package/dist/{cjs → esm}/base/ui/system/appearance/border.js +3 -6
- package/dist/esm/base/ui/system/appearance/border_radius.js +18 -0
- package/dist/esm/base/ui/system/appearance/box_shadow.js +18 -0
- package/dist/esm/base/ui/system/appearance/opacity.js +18 -0
- package/dist/esm/base/ui/system/dimensions/dimensions_set.js +29 -0
- package/dist/esm/base/ui/system/dimensions/height.js +18 -0
- package/dist/esm/base/ui/system/dimensions/max_height.js +18 -0
- package/dist/esm/base/ui/system/dimensions/max_width.js +18 -0
- package/dist/esm/base/ui/system/dimensions/min_height.js +18 -0
- package/dist/esm/base/ui/system/dimensions/min_width.js +18 -0
- package/dist/esm/base/ui/system/dimensions/width.js +18 -0
- package/dist/esm/base/ui/system/display.js +19 -0
- package/dist/esm/base/ui/system/flex_container/align_content.js +15 -0
- package/dist/esm/base/ui/system/flex_container/align_items.js +15 -0
- package/dist/esm/base/ui/system/flex_container/flex_container_set.js +29 -0
- package/dist/esm/base/ui/system/flex_container/flex_direction.js +15 -0
- package/dist/esm/base/ui/system/flex_container/flex_wrap.js +15 -0
- package/dist/esm/base/ui/system/flex_container/justify_content.js +15 -0
- package/dist/esm/base/ui/system/flex_container/justify_items.js +16 -0
- package/dist/esm/base/ui/system/flex_item/align_self.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex_basis.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex_grow.js +15 -0
- package/dist/esm/base/ui/system/flex_item/flex_item_set.js +31 -0
- package/dist/esm/base/ui/system/flex_item/flex_shrink.js +15 -0
- package/dist/esm/base/ui/system/flex_item/justify_self.js +16 -0
- package/dist/esm/base/ui/system/flex_item/order.js +15 -0
- package/dist/{cjs → esm}/base/ui/system/index.js +104 -416
- package/dist/esm/base/ui/system/overflow.js +21 -0
- package/dist/{cjs → esm}/base/ui/system/position/bottom.js +4 -6
- package/dist/{cjs → esm}/base/ui/system/position/left.js +4 -6
- package/dist/esm/base/ui/system/position/position.js +15 -0
- package/dist/esm/base/ui/system/position/position_set.js +29 -0
- package/dist/{cjs → esm}/base/ui/system/position/right.js +4 -6
- package/dist/{cjs → esm}/base/ui/system/position/top.js +4 -6
- package/dist/esm/base/ui/system/position/z_index.js +18 -0
- package/dist/{cjs → esm}/base/ui/system/spacing/margin.js +4 -6
- package/dist/{cjs → esm}/base/ui/system/spacing/padding.js +4 -6
- package/dist/esm/base/ui/system/spacing/spacing_set.js +21 -0
- package/dist/esm/base/ui/system/typography/font_family.js +18 -0
- package/dist/esm/base/ui/system/typography/font_size.js +18 -0
- package/dist/esm/base/ui/system/typography/font_style.js +15 -0
- package/dist/esm/base/ui/system/typography/font_weight.js +18 -0
- package/dist/esm/base/ui/system/typography/letter_spacing.js +18 -0
- package/dist/esm/base/ui/system/typography/line_height.js +15 -0
- package/dist/esm/base/ui/system/typography/text_align.js +15 -0
- package/dist/esm/base/ui/system/typography/text_color.js +18 -0
- package/dist/esm/base/ui/system/typography/text_decoration.js +15 -0
- package/dist/esm/base/ui/system/typography/text_transform.js +15 -0
- package/dist/esm/base/ui/system/typography/typography_set.js +37 -0
- package/dist/{cjs → esm}/base/ui/system/utils/ensure_numbers_are_within_scale.js +3 -4
- package/dist/esm/base/ui/system/utils/get_style_props_for_responsive_prop.js +73 -0
- package/dist/esm/base/ui/table_picker.js +71 -0
- package/dist/esm/base/ui/table_picker_synced.js +62 -0
- package/dist/esm/base/ui/text.js +117 -0
- package/dist/esm/base/ui/text_button.js +196 -0
- package/dist/{cjs → esm}/base/ui/theme/default_theme/button_variants.js +3 -3
- package/dist/esm/base/ui/theme/default_theme/control_sizes.js +102 -0
- package/dist/{cjs → esm}/base/ui/theme/default_theme/heading_styles.js +1 -1
- package/dist/{cjs → esm}/base/ui/theme/default_theme/index.js +9 -15
- package/dist/{cjs → esm}/base/ui/theme/default_theme/input_variants.js +3 -3
- package/dist/{cjs → esm}/base/ui/theme/default_theme/link_variants.js +3 -3
- package/dist/{cjs → esm}/base/ui/theme/default_theme/select_buttons_variants.js +4 -4
- package/dist/esm/base/ui/theme/default_theme/select_variants.js +50 -0
- package/dist/esm/base/ui/theme/default_theme/switch_variants.js +85 -0
- package/dist/{cjs → esm}/base/ui/theme/default_theme/text_button_variants.js +5 -5
- package/dist/{cjs → esm}/base/ui/theme/default_theme/text_styles.js +1 -1
- package/dist/{cjs → esm}/base/ui/theme/default_theme/tokens.js +14 -14
- package/dist/{cjs → esm}/base/ui/theme/theme_context.js +2 -2
- package/dist/{cjs → esm}/base/ui/theme/use_theme.js +2 -2
- package/dist/esm/base/ui/tooltip.js +175 -0
- package/dist/{cjs → esm}/base/ui/ui.js +48 -49
- package/dist/{cjs → esm}/base/ui/unstable_standalone_ui.js +27 -27
- package/dist/{cjs → esm}/base/ui/use_base.js +1 -1
- package/dist/{cjs → esm}/base/ui/use_cursor.js +5 -4
- package/dist/{cjs → esm}/base/ui/use_form_field.js +1 -1
- package/dist/{cjs → esm}/base/ui/use_loadable.js +25 -91
- package/dist/{cjs → esm}/base/ui/use_record_action_data.js +4 -3
- package/dist/{cjs → esm}/base/ui/use_records.js +9 -13
- package/dist/{cjs → esm}/base/ui/use_session.js +1 -1
- package/dist/{cjs → esm}/base/ui/use_settings_button.js +4 -3
- package/dist/esm/base/ui/use_styled_system.js +25 -0
- package/dist/{cjs → esm}/base/ui/use_text_color_for_background_color.js +4 -3
- package/dist/{cjs → esm}/base/ui/use_view_metadata.js +4 -4
- package/dist/{cjs → esm}/base/ui/use_viewport.js +2 -2
- package/dist/esm/base/ui/view_picker.js +89 -0
- package/dist/esm/base/ui/view_picker_synced.js +66 -0
- package/dist/esm/base/ui/viewport_constraint.js +129 -0
- package/dist/esm/base/ui/with_styled_system.js +129 -0
- package/dist/esm/base/undo_redo.js +37 -0
- package/dist/{cjs → esm}/base/unstable_testing_utils.js +27 -27
- package/dist/esm/base/viewport.js +353 -0
- package/dist/esm/injected/airtable_interface.js +22 -0
- package/dist/esm/interface/assert_run_context.js +12 -0
- package/dist/esm/interface/index.js +22 -0
- package/dist/esm/interface/models/base.js +35 -0
- package/dist/esm/interface/models/field.js +28 -0
- package/dist/{cjs → esm}/interface/models/models.js +8 -7
- package/dist/esm/interface/models/mutations.js +63 -0
- package/dist/esm/interface/models/record.js +51 -0
- package/dist/esm/interface/models/record_store.js +51 -0
- package/dist/esm/interface/models/session.js +28 -0
- package/dist/esm/interface/models/table.js +97 -0
- package/dist/esm/interface/sdk.js +78 -0
- package/dist/{cjs → esm}/interface/types/airtable_interface.js +2 -2
- package/dist/esm/interface/types/mutations.js +17 -0
- package/dist/esm/interface/ui/block_wrapper.js +69 -0
- package/dist/{cjs → esm}/interface/ui/initialize_block.js +13 -28
- package/dist/{cjs → esm}/interface/ui/ui.js +20 -19
- package/dist/{cjs → esm}/interface/ui/use_base.js +1 -1
- package/dist/{cjs → esm}/interface/ui/use_custom_properties.js +19 -35
- package/dist/{cjs → esm}/interface/ui/use_records.js +6 -5
- package/dist/{cjs → esm}/interface/ui/use_run_info.js +2 -2
- package/dist/{cjs → esm}/interface/ui/use_session.js +1 -1
- package/dist/{cjs → esm}/shared/color_utils.js +9 -16
- package/dist/{cjs → esm}/shared/colors.js +2 -2
- package/dist/{cjs → esm}/shared/error_utils.js +9 -11
- package/dist/{cjs → esm}/shared/event_tracker.js +3 -3
- package/dist/esm/shared/global_config.js +399 -0
- package/dist/esm/shared/models/abstract_model.js +94 -0
- package/dist/esm/shared/models/base_core.js +482 -0
- package/dist/esm/shared/models/field_core.js +288 -0
- package/dist/esm/shared/models/mutations_core.js +343 -0
- package/dist/esm/shared/models/record_core.js +215 -0
- package/dist/esm/shared/models/record_store_core.js +160 -0
- package/dist/esm/shared/models/session_core.js +160 -0
- package/dist/esm/shared/models/table_core.js +1318 -0
- package/dist/{cjs → esm}/shared/private_utils.js +54 -124
- package/dist/esm/shared/sdk_core.js +113 -0
- package/dist/{cjs → esm}/shared/types/field_core.js +1 -1
- package/dist/esm/shared/types/mutation_constants.js +11 -0
- package/dist/{cjs → esm}/shared/types/mutations_core.js +1 -1
- package/dist/{cjs → esm}/shared/types/permission_levels.js +1 -1
- package/dist/esm/shared/types/record.js +1 -0
- package/dist/esm/shared/types/stat.js +1 -0
- package/dist/esm/shared/types/table_core.js +1 -0
- package/dist/{cjs → esm}/shared/ui/global_config_synced_component_helpers.js +9 -9
- package/dist/esm/shared/ui/loader.js +47 -0
- package/dist/{cjs → esm}/shared/ui/remote_utils.js +5 -7
- package/dist/{cjs → esm}/shared/ui/sdk_context.js +4 -8
- package/dist/{cjs → esm}/shared/ui/use_array_identity.js +2 -2
- package/dist/{cjs → esm}/shared/ui/use_base.js +6 -5
- package/dist/{cjs → esm}/shared/ui/use_color_scheme.js +3 -8
- package/dist/{cjs → esm}/shared/ui/use_global_config.js +5 -4
- package/dist/{cjs → esm}/shared/ui/use_session.js +6 -5
- package/dist/{cjs → esm}/shared/ui/use_synced.js +7 -5
- package/dist/{cjs → esm}/shared/ui/use_watchable.js +13 -42
- package/dist/{cjs → esm}/shared/ui/with_hooks.js +6 -13
- package/dist/{cjs → esm}/shared/unstable_private_utils.js +4 -6
- package/dist/{cjs → esm}/shared/warning.js +5 -5
- package/dist/esm/shared/watchable.js +150 -0
- package/dist/esm/stats/block_stats.js +73 -0
- package/dist/esm/testing/base/abstract_mock_airtable_interface.js +208 -0
- package/dist/esm/testing/interface/abstract_mock_airtable_interface.js +124 -0
- package/dist/types/src/base/assert_run_context.d.ts +2 -0
- package/dist/types/src/base/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/base/index.d.ts +1 -0
- package/dist/types/src/base/index.d.ts.map +1 -1
- package/dist/types/src/base/models/base.d.ts +19 -0
- package/dist/types/src/base/models/base.d.ts.map +1 -1
- package/dist/types/src/base/models/create_aggregators.d.ts +3 -4
- package/dist/types/src/base/models/create_aggregators.d.ts.map +1 -1
- package/dist/types/src/base/models/field.d.ts +3 -2
- package/dist/types/src/base/models/field.d.ts.map +1 -1
- package/dist/types/src/base/models/models.d.ts +1 -2
- package/dist/types/src/base/models/models.d.ts.map +1 -1
- package/dist/types/src/base/models/mutations.d.ts.map +1 -1
- package/dist/types/src/base/sdk.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +1 -1
- package/dist/types/src/base/ui/box.d.ts.map +1 -1
- package/dist/types/src/base/ui/button.d.ts +0 -5
- package/dist/types/src/base/ui/button.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +1 -22
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/choice_token.d.ts +1 -21
- package/dist/types/src/base/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -20
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette.d.ts +1 -32
- package/dist/types/src/base/ui/color_palette.d.ts.map +1 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -14
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -17
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog.d.ts +1 -23
- package/dist/types/src/base/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +2 -24
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_icon.d.ts +1 -17
- package/dist/types/src/base/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -23
- package/dist/types/src/base/ui/field_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -4
- package/dist/types/src/base/ui/form_field.d.ts.map +1 -1
- package/dist/types/src/base/ui/heading.d.ts +1 -1
- package/dist/types/src/base/ui/heading.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -16
- package/dist/types/src/base/ui/icon.d.ts.map +1 -1
- package/dist/types/src/base/ui/icon_config.d.ts +50 -51
- package/dist/types/src/base/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/base/ui/input.d.ts +12 -46
- package/dist/types/src/base/ui/input.d.ts.map +1 -1
- package/dist/types/src/base/ui/input_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/label.d.ts.map +1 -1
- package/dist/types/src/base/ui/link.d.ts +1 -5
- package/dist/types/src/base/ui/link.d.ts.map +1 -1
- package/dist/types/src/base/ui/loader.d.ts +3 -20
- package/dist/types/src/base/ui/loader.d.ts.map +1 -1
- package/dist/types/src/base/ui/modal.d.ts +1 -14
- package/dist/types/src/base/ui/modal.d.ts.map +1 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/base/ui/popover.d.ts +1 -17
- package/dist/types/src/base/ui/popover.d.ts.map +1 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +1 -24
- package/dist/types/src/base/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card.d.ts +1 -23
- package/dist/types/src/base/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +1 -18
- package/dist/types/src/base/ui/record_card_list.d.ts.map +1 -1
- package/dist/types/src/base/ui/select.d.ts +0 -44
- package/dist/types/src/base/ui/select.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -2
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -22
- package/dist/types/src/base/ui/select_buttons.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/select_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -22
- package/dist/types/src/base/ui/switch.d.ts.map +1 -1
- package/dist/types/src/base/ui/switch_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/synced.d.ts +2 -8
- package/dist/types/src/base/ui/synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -3
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -1
- package/dist/types/src/base/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/index.d.ts +52 -52
- package/dist/types/src/base/ui/system/index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -21
- package/dist/types/src/base/ui/table_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/text.d.ts +0 -3
- package/dist/types/src/base/ui/text.d.ts.map +1 -1
- package/dist/types/src/base/ui/text_button.d.ts +1 -5
- package/dist/types/src/base/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +1 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -16
- package/dist/types/src/base/ui/tooltip.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -4
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -7
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/base/ui/ui.d.ts +1 -0
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -23
- package/dist/types/src/base/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +1 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +1 -14
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/interface/assert_run_context.d.ts +2 -0
- package/dist/types/src/interface/assert_run_context.d.ts.map +1 -0
- package/dist/types/src/interface/index.d.ts +1 -6
- package/dist/types/src/interface/index.d.ts.map +1 -1
- package/dist/types/src/interface/models/models.d.ts +1 -0
- package/dist/types/src/interface/models/models.d.ts.map +1 -1
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/interface/ui/ui.d.ts +1 -0
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +1 -1
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +0 -9
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +0 -2
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/shared/ui/loader.d.ts.map +1 -1
- package/dist/types/src/shared/ui/with_hooks.d.ts +2 -2
- package/dist/types/src/shared/ui/with_hooks.d.ts.map +1 -1
- package/dist/types/src/testing/{abstract_mock_airtable_interface.d.ts → base/abstract_mock_airtable_interface.d.ts} +13 -13
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +51 -0
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/models.js +1 -1
- package/package.json +24 -23
- package/types.js +1 -1
- package/dist/cjs/base/models/abstract_model_with_async_data.js +0 -273
- package/dist/cjs/base/models/base.js +0 -306
- package/dist/cjs/base/models/create_aggregators.js +0 -115
- package/dist/cjs/base/models/cursor.js +0 -393
- package/dist/cjs/base/models/field.js +0 -427
- package/dist/cjs/base/models/grouped_record_query_result.js +0 -399
- package/dist/cjs/base/models/linked_records_query_result.js +0 -728
- package/dist/cjs/base/models/mutations.js +0 -338
- package/dist/cjs/base/models/object_pool.js +0 -184
- package/dist/cjs/base/models/record.js +0 -304
- package/dist/cjs/base/models/record_query_result.js +0 -741
- package/dist/cjs/base/models/record_store.js +0 -825
- package/dist/cjs/base/models/session.js +0 -182
- package/dist/cjs/base/models/table.js +0 -668
- package/dist/cjs/base/models/table_or_view_query_result.js +0 -1013
- package/dist/cjs/base/models/view.js +0 -431
- package/dist/cjs/base/models/view_data_store.js +0 -403
- package/dist/cjs/base/models/view_metadata_query_result.js +0 -224
- package/dist/cjs/base/perform_record_action.js +0 -257
- package/dist/cjs/base/sdk.js +0 -233
- package/dist/cjs/base/settings_button.js +0 -138
- package/dist/cjs/base/ui/baymax_utils.js +0 -133
- package/dist/cjs/base/ui/block_wrapper.js +0 -143
- package/dist/cjs/base/ui/box.js +0 -110
- package/dist/cjs/base/ui/button.js +0 -182
- package/dist/cjs/base/ui/cell_renderer.js +0 -255
- package/dist/cjs/base/ui/choice_token.js +0 -110
- package/dist/cjs/base/ui/collaborator_token.js +0 -145
- package/dist/cjs/base/ui/color_palette.js +0 -239
- package/dist/cjs/base/ui/color_palette_synced.js +0 -98
- package/dist/cjs/base/ui/confirmation_dialog.js +0 -153
- package/dist/cjs/base/ui/dialog.js +0 -142
- package/dist/cjs/base/ui/dialog_close_button.js +0 -152
- package/dist/cjs/base/ui/expand_record_picker_async.js +0 -100
- package/dist/cjs/base/ui/field_icon.js +0 -62
- package/dist/cjs/base/ui/field_picker.js +0 -143
- package/dist/cjs/base/ui/field_picker_synced.js +0 -88
- package/dist/cjs/base/ui/form_field.js +0 -137
- package/dist/cjs/base/ui/geometry/point.js +0 -21
- package/dist/cjs/base/ui/geometry/rect.js +0 -67
- package/dist/cjs/base/ui/geometry/size.js +0 -21
- package/dist/cjs/base/ui/global_alert.js +0 -92
- package/dist/cjs/base/ui/heading.js +0 -181
- package/dist/cjs/base/ui/icon.js +0 -129
- package/dist/cjs/base/ui/input.js +0 -200
- package/dist/cjs/base/ui/input_synced.js +0 -89
- package/dist/cjs/base/ui/label.js +0 -105
- package/dist/cjs/base/ui/link.js +0 -229
- package/dist/cjs/base/ui/loader.js +0 -82
- package/dist/cjs/base/ui/modal.js +0 -184
- package/dist/cjs/base/ui/model_picker_select.js +0 -83
- package/dist/cjs/base/ui/popover.js +0 -407
- package/dist/cjs/base/ui/progress_bar.js +0 -128
- package/dist/cjs/base/ui/record_card.js +0 -653
- package/dist/cjs/base/ui/record_card_list.js +0 -377
- package/dist/cjs/base/ui/select.js +0 -247
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +0 -87
- package/dist/cjs/base/ui/select_buttons.js +0 -192
- package/dist/cjs/base/ui/select_buttons_synced.js +0 -84
- package/dist/cjs/base/ui/select_synced.js +0 -87
- package/dist/cjs/base/ui/switch.js +0 -196
- package/dist/cjs/base/ui/switch_synced.js +0 -75
- package/dist/cjs/base/ui/synced.js +0 -70
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +0 -30
- package/dist/cjs/base/ui/system/appearance/background_color.js +0 -21
- package/dist/cjs/base/ui/system/appearance/border_radius.js +0 -21
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +0 -21
- package/dist/cjs/base/ui/system/appearance/opacity.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +0 -31
- package/dist/cjs/base/ui/system/dimensions/height.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/max_height.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/max_width.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/min_height.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/min_width.js +0 -21
- package/dist/cjs/base/ui/system/dimensions/width.js +0 -21
- package/dist/cjs/base/ui/system/display.js +0 -22
- package/dist/cjs/base/ui/system/flex_container/align_content.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/align_items.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +0 -31
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +0 -18
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +0 -19
- package/dist/cjs/base/ui/system/flex_item/align_self.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +0 -32
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +0 -18
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +0 -19
- package/dist/cjs/base/ui/system/flex_item/order.js +0 -18
- package/dist/cjs/base/ui/system/overflow.js +0 -24
- package/dist/cjs/base/ui/system/position/position.js +0 -18
- package/dist/cjs/base/ui/system/position/position_set.js +0 -31
- package/dist/cjs/base/ui/system/position/z_index.js +0 -21
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +0 -27
- package/dist/cjs/base/ui/system/typography/font_family.js +0 -21
- package/dist/cjs/base/ui/system/typography/font_size.js +0 -21
- package/dist/cjs/base/ui/system/typography/font_style.js +0 -18
- package/dist/cjs/base/ui/system/typography/font_weight.js +0 -21
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +0 -21
- package/dist/cjs/base/ui/system/typography/line_height.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_align.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_color.js +0 -21
- package/dist/cjs/base/ui/system/typography/text_decoration.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_transform.js +0 -18
- package/dist/cjs/base/ui/system/typography/typography_set.js +0 -35
- package/dist/cjs/base/ui/system/utils/create_responsive_prop_type.js +0 -19
- package/dist/cjs/base/ui/system/utils/create_style_prop_types.js +0 -24
- package/dist/cjs/base/ui/system/utils/enum_prop_type_utils.js +0 -35
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -113
- package/dist/cjs/base/ui/table_picker.js +0 -95
- package/dist/cjs/base/ui/table_picker_synced.js +0 -84
- package/dist/cjs/base/ui/text.js +0 -150
- package/dist/cjs/base/ui/text_button.js +0 -228
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +0 -96
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +0 -59
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +0 -91
- package/dist/cjs/base/ui/tooltip.js +0 -215
- package/dist/cjs/base/ui/types/aria_props.js +0 -23
- package/dist/cjs/base/ui/types/data_attributes_prop.js +0 -18
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +0 -17
- package/dist/cjs/base/ui/use_styled_system.js +0 -32
- package/dist/cjs/base/ui/view_picker.js +0 -133
- package/dist/cjs/base/ui/view_picker_synced.js +0 -88
- package/dist/cjs/base/ui/viewport_constraint.js +0 -176
- package/dist/cjs/base/ui/with_styled_system.js +0 -165
- package/dist/cjs/base/undo_redo.js +0 -48
- package/dist/cjs/base/viewport.js +0 -397
- package/dist/cjs/injected/airtable_interface.js +0 -22
- package/dist/cjs/interface/index.js +0 -36
- package/dist/cjs/interface/models/base.js +0 -54
- package/dist/cjs/interface/models/field.js +0 -42
- package/dist/cjs/interface/models/mutations.js +0 -79
- package/dist/cjs/interface/models/record.js +0 -71
- package/dist/cjs/interface/models/record_store.js +0 -83
- package/dist/cjs/interface/models/session.js +0 -42
- package/dist/cjs/interface/models/table.js +0 -126
- package/dist/cjs/interface/sdk.js +0 -104
- package/dist/cjs/interface/types/mutations.js +0 -24
- package/dist/cjs/interface/ui/block_wrapper.js +0 -61
- package/dist/cjs/shared/global_config.js +0 -511
- package/dist/cjs/shared/models/abstract_model.js +0 -119
- package/dist/cjs/shared/models/base_core.js +0 -602
- package/dist/cjs/shared/models/field_core.js +0 -331
- package/dist/cjs/shared/models/mutations_core.js +0 -439
- package/dist/cjs/shared/models/record_core.js +0 -272
- package/dist/cjs/shared/models/record_store_core.js +0 -213
- package/dist/cjs/shared/models/session_core.js +0 -214
- package/dist/cjs/shared/models/table_core.js +0 -1561
- package/dist/cjs/shared/sdk_core.js +0 -115
- package/dist/cjs/shared/types/mutation_constants.js +0 -11
- package/dist/cjs/shared/ui/loader.js +0 -68
- package/dist/cjs/shared/watchable.js +0 -216
- package/dist/cjs/stats/block_stats.js +0 -96
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +0 -277
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/create_responsive_prop_type.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts +0 -4
- package/dist/types/src/base/ui/system/utils/create_style_prop_types.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts +0 -21
- package/dist/types/src/base/ui/system/utils/enum_prop_type_utils.d.ts.map +0 -1
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +0 -1
- /package/dist/{cjs → esm}/base/types/aggregators.js +0 -0
- /package/dist/{cjs → esm}/base/types/backend_fetch_types.js +0 -0
- /package/dist/{cjs → esm}/base/types/base.js +0 -0
- /package/dist/{cjs → esm}/base/types/cursor.js +0 -0
- /package/dist/{cjs → esm}/base/types/field.js +0 -0
- /package/dist/{cjs → esm}/base/types/record.js +0 -0
- /package/dist/{cjs → esm}/base/types/record_action_data.js +0 -0
- /package/dist/{cjs → esm}/base/types/table.js +0 -0
- /package/dist/{cjs → esm}/base/types/viewport.js +0 -0
- /package/dist/{cjs → esm}/base/ui/system/utils/csstype.js +0 -0
- /package/dist/{cjs → esm}/base/ui/system/utils/types.js +0 -0
- /package/dist/{cjs/interface/types/base.js → esm/base/ui/types/aria_props.js} +0 -0
- /package/dist/{cjs/interface/types/field.js → esm/base/ui/types/data_attributes_prop.js} +0 -0
- /package/dist/{cjs/interface/types/record.js → esm/base/ui/types/tooltip_anchor_props.js} +0 -0
- /package/dist/{cjs/interface/types/table.js → esm/interface/types/base.js} +0 -0
- /package/dist/{cjs/sdk_mode.js → esm/interface/types/field.js} +0 -0
- /package/dist/{cjs/shared → esm/interface}/types/record.js +0 -0
- /package/dist/{cjs/shared/types/airtable_interface_core.js → esm/interface/types/table.js} +0 -0
- /package/dist/{cjs → esm}/interface/ui/expand_record.js +0 -0
- /package/dist/{cjs/shared/types/attachment.js → esm/sdk_mode.js} +0 -0
- /package/dist/{cjs/shared/types/base_core.js → esm/shared/types/airtable_interface_core.js} +0 -0
- /package/dist/{cjs/shared/types/collaborator.js → esm/shared/types/attachment.js} +0 -0
- /package/dist/{cjs/shared/types/global_config.js → esm/shared/types/base_core.js} +0 -0
- /package/dist/{cjs/shared/types/hyper_ids.js → esm/shared/types/collaborator.js} +0 -0
- /package/dist/{cjs/shared/types/stat.js → esm/shared/types/global_config.js} +0 -0
- /package/dist/{cjs/shared/types/table_core.js → esm/shared/types/hyper_ids.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _airtable_interface = _interopRequireDefault(require("../injected/airtable_interface"));
|
|
4
|
+
var _error_utils = require("../shared/error_utils");
|
|
5
|
+
var _airtable_interface2 = require("./types/airtable_interface");
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
if (window.__getAirtableInterfaceAtVersion) {
|
|
8
|
+
const runContextType = (0, _airtable_interface.default)().sdkInitData.runContext.type;
|
|
9
|
+
if (runContextType !== _airtable_interface2.BlockRunContextType.DASHBOARD_APP && runContextType !== _airtable_interface2.BlockRunContextType.VIEW) {
|
|
10
|
+
throw (0, _error_utils.spawnError)('Unexpected import when running block in base');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,39 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.array.iterator.js");
|
|
4
|
-
require("core-js/modules/es.object.to-string.js");
|
|
5
|
-
require("core-js/modules/es.weak-map.js");
|
|
6
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
7
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
8
3
|
Object.defineProperty(exports, "__esModule", {
|
|
9
4
|
value: true
|
|
10
5
|
});
|
|
11
6
|
exports.__reset = __reset;
|
|
12
7
|
exports.viewport = exports.unstable_fetchAsync = exports.undoRedo = exports.settingsButton = exports.session = exports.runInfo = exports.reload = exports.installationId = exports.globalConfig = exports.cursor = exports.base = exports.__sdk = void 0;
|
|
8
|
+
require("./assert_run_context");
|
|
13
9
|
var _warning = _interopRequireWildcard(require("../shared/warning"));
|
|
14
10
|
var _airtable_interface = _interopRequireDefault(require("../injected/airtable_interface"));
|
|
15
11
|
var _perform_record_action = require("./perform_record_action");
|
|
16
|
-
var
|
|
17
|
-
var _create_aggregators = require("./models/create_aggregators");
|
|
12
|
+
var _sdk = _interopRequireDefault(require("./sdk"));
|
|
18
13
|
var _initialize_block = require("./ui/initialize_block");
|
|
19
|
-
function
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
17
|
/** @internal */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
let __sdk = exports.__sdk = void 0;
|
|
19
|
+
let base = exports.base = void 0;
|
|
20
|
+
let globalConfig = exports.globalConfig = void 0;
|
|
21
|
+
let installationId = exports.installationId = void 0;
|
|
22
|
+
let reload = exports.reload = void 0;
|
|
23
|
+
let runInfo = exports.runInfo = void 0;
|
|
24
|
+
let settingsButton = exports.settingsButton = void 0;
|
|
25
|
+
let undoRedo = exports.undoRedo = void 0;
|
|
26
|
+
let viewport = exports.viewport = void 0;
|
|
27
|
+
let unstable_fetchAsync = exports.unstable_fetchAsync = void 0;
|
|
32
28
|
|
|
33
29
|
// The `cursor` binding is declared on the following line solely as a signal to
|
|
34
30
|
// the TypeScript compiler. The exported value is actually controlled by the
|
|
35
31
|
// subsequent CommonJS module property descriptor.
|
|
36
|
-
|
|
32
|
+
let cursor = exports.cursor = void 0;
|
|
37
33
|
Object.defineProperty(module.exports, 'cursor', {
|
|
38
34
|
enumerable: true,
|
|
39
35
|
get() {
|
|
@@ -45,7 +41,7 @@ Object.defineProperty(module.exports, 'cursor', {
|
|
|
45
41
|
// The `session` binding is declared on the following line solely as a signal
|
|
46
42
|
// to the TypeScript compiler. The exported value is actually controlled by the
|
|
47
43
|
// subsequent CommonJS module property descriptor.
|
|
48
|
-
|
|
44
|
+
let session = exports.session = void 0;
|
|
49
45
|
Object.defineProperty(module.exports, 'session', {
|
|
50
46
|
enumerable: true,
|
|
51
47
|
get() {
|
|
@@ -74,21 +70,23 @@ Object.defineProperty(module.exports, 'UI', {
|
|
|
74
70
|
|
|
75
71
|
/** @internal */
|
|
76
72
|
function __reset() {
|
|
77
|
-
exports.__sdk = __sdk = new
|
|
73
|
+
exports.__sdk = __sdk = new _sdk.default((0, _airtable_interface.default)());
|
|
74
|
+
({
|
|
75
|
+
base,
|
|
76
|
+
globalConfig,
|
|
77
|
+
installationId,
|
|
78
|
+
reload,
|
|
79
|
+
runInfo,
|
|
80
|
+
settingsButton,
|
|
81
|
+
undoRedo,
|
|
82
|
+
viewport,
|
|
83
|
+
unstable_fetchAsync
|
|
84
|
+
} = __sdk);
|
|
85
|
+
|
|
78
86
|
// The following injections are necessary to allow the referenced modules
|
|
79
87
|
// to be imported directly by consumer code while also avoiding cycles in
|
|
80
88
|
// the module dependency graph.
|
|
81
|
-
|
|
82
|
-
exports.base = base = _sdk.base;
|
|
83
|
-
exports.globalConfig = globalConfig = _sdk.globalConfig;
|
|
84
|
-
exports.installationId = installationId = _sdk.installationId;
|
|
85
|
-
exports.reload = reload = _sdk.reload;
|
|
86
|
-
exports.runInfo = runInfo = _sdk.runInfo;
|
|
87
|
-
exports.settingsButton = settingsButton = _sdk.settingsButton;
|
|
88
|
-
exports.undoRedo = undoRedo = _sdk.undoRedo;
|
|
89
|
-
exports.viewport = viewport = _sdk.viewport;
|
|
90
|
-
exports.unstable_fetchAsync = unstable_fetchAsync = _sdk.unstable_fetchAsync;
|
|
91
|
-
(0, _create_aggregators.__injectSdkIntoCreateAggregators)(__sdk);
|
|
89
|
+
exports.base = base, exports.globalConfig = globalConfig, exports.installationId = installationId, exports.reload = reload, exports.runInfo = runInfo, exports.settingsButton = settingsButton, exports.undoRedo = undoRedo, exports.viewport = viewport, exports.unstable_fetchAsync = unstable_fetchAsync;
|
|
92
90
|
(0, _perform_record_action.__injectSdkIntoPerformRecordAction)(__sdk);
|
|
93
91
|
(0, _initialize_block.__injectSdkIntoInitializeBlock)(__sdk);
|
|
94
92
|
(0, _warning.__injectSdkIntoWarning)(__sdk);
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _private_utils = require("../../shared/private_utils");
|
|
8
|
+
var _error_utils = require("../../shared/error_utils");
|
|
9
|
+
var _abstract_model = _interopRequireDefault(require("../../shared/models/abstract_model"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/** @module @airtable/blocks/models: Abstract models */ /** */
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Abstract superclass for all Blocks SDK models that need to fetch async data.
|
|
15
|
+
*
|
|
16
|
+
* @docsPath models/advanced/AbstractModelWithAsyncData
|
|
17
|
+
*/
|
|
18
|
+
class AbstractModelWithAsyncData extends _abstract_model.default {
|
|
19
|
+
/** @internal */
|
|
20
|
+
static __DATA_UNLOAD_DELAY_MS = 1000;
|
|
21
|
+
/** @internal */
|
|
22
|
+
static _shouldLoadDataForKey(key) {
|
|
23
|
+
// Override to return whether watching the key should trigger the
|
|
24
|
+
// data to be loaded for this model.
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
/** @internal */
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* This flag is used to keep track of models that have been
|
|
37
|
+
* forced to unload (regardless of the retain count). The force
|
|
38
|
+
* unload happens via _forceUnload method and the only proper use
|
|
39
|
+
* of that function is when the underlying data gets deleted while
|
|
40
|
+
* the model is still active. e.g. when a table is deleted in the
|
|
41
|
+
* main extension while an instance of record_store is still alive.
|
|
42
|
+
* NOTE: Once set to true, it never goes back to false.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
_isForceUnloaded = false;
|
|
47
|
+
/** @hidden */
|
|
48
|
+
constructor(sdk, modelId) {
|
|
49
|
+
super(sdk, modelId);
|
|
50
|
+
this._isDataLoaded = false;
|
|
51
|
+
this._pendingDataLoadPromise = null;
|
|
52
|
+
this._dataRetainCount = 0;
|
|
53
|
+
this._unloadDataTimeoutId = null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Watching a key that needs to load data asynchronously will automatically
|
|
57
|
+
* cause the data to be fetched. Once the data is available, the callback
|
|
58
|
+
* will be called.
|
|
59
|
+
*
|
|
60
|
+
* @inheritdoc
|
|
61
|
+
*/
|
|
62
|
+
watch(keys, callback, context) {
|
|
63
|
+
this._assertNotForceUnloaded();
|
|
64
|
+
const validKeys = super.watch(keys, callback, context);
|
|
65
|
+
for (const key of validKeys) {
|
|
66
|
+
if (this.constructor._shouldLoadDataForKey(key)) {
|
|
67
|
+
// Note: for simplicity, we will call loadData for every key that needs
|
|
68
|
+
// needs data, relying on the retain count to unload once all keys have
|
|
69
|
+
// been unwatched.
|
|
70
|
+
(0, _private_utils.fireAndForgetPromise)(this.loadDataAsync.bind(this));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return validKeys;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Unwatching a key that needs to load data asynchronously will automatically
|
|
77
|
+
* cause the data to be released. Once the data is available, the callback
|
|
78
|
+
* will be called.
|
|
79
|
+
*
|
|
80
|
+
* @inheritdoc
|
|
81
|
+
*/
|
|
82
|
+
unwatch(keys, callback, context) {
|
|
83
|
+
const validKeys = super.unwatch(keys, callback, context);
|
|
84
|
+
for (const key of validKeys) {
|
|
85
|
+
if (this.constructor._shouldLoadDataForKey(key)) {
|
|
86
|
+
// We called loadDataAsync for every key that needs data so call
|
|
87
|
+
// unloadData for every key to balance the retain count.
|
|
88
|
+
this.unloadData();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return validKeys;
|
|
92
|
+
}
|
|
93
|
+
/** @inheritdoc */
|
|
94
|
+
get isDeleted() {
|
|
95
|
+
if (this._isForceUnloaded) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return super.isDeleted;
|
|
99
|
+
}
|
|
100
|
+
/** */
|
|
101
|
+
get isDataLoaded() {
|
|
102
|
+
if (this.isDeleted) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
return this._isDataLoaded;
|
|
106
|
+
}
|
|
107
|
+
/** @internal */
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
|
|
113
|
+
// Override this method if your model is dependent on other models.
|
|
114
|
+
// Do NOT load other models' data from _loadDataAsync, since it can lead to
|
|
115
|
+
// unexpected behavior.
|
|
116
|
+
// IMPORTANT: always call super.loadDataAsync() from your override.
|
|
117
|
+
/**
|
|
118
|
+
* Will cause all the async data to be fetched and retained. Every call to
|
|
119
|
+
* `loadDataAsync` should have a matching call to `unloadData`.
|
|
120
|
+
*
|
|
121
|
+
* Returns a Promise that will resolve once the data is loaded.
|
|
122
|
+
*/
|
|
123
|
+
async loadDataAsync() {
|
|
124
|
+
this._assertNotForceUnloaded();
|
|
125
|
+
if (this._unloadDataTimeoutId !== null) {
|
|
126
|
+
// If we set a timeout to unload data, clear it since we are incrementing
|
|
127
|
+
// the retain count and loading data.
|
|
128
|
+
clearTimeout(this._unloadDataTimeoutId);
|
|
129
|
+
this._unloadDataTimeoutId = null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// We keep a count of how many things have loaded the data so we don't
|
|
133
|
+
// actually unload the data until the retain count comes back down to zero.
|
|
134
|
+
this._dataRetainCount++;
|
|
135
|
+
if (this._isDataLoaded) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (!this._pendingDataLoadPromise) {
|
|
139
|
+
this._pendingDataLoadPromise = this._loadDataAsync().then(changedKeys => {
|
|
140
|
+
this._isDataLoaded = true;
|
|
141
|
+
this._pendingDataLoadPromise = null;
|
|
142
|
+
for (const key of changedKeys) {
|
|
143
|
+
this._onChange(key);
|
|
144
|
+
}
|
|
145
|
+
this._onChangeIsDataLoaded();
|
|
146
|
+
return changedKeys;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
await this._pendingDataLoadPromise;
|
|
150
|
+
}
|
|
151
|
+
// Override this method if your model is dependent on other models.
|
|
152
|
+
// Do NOT unload other models' data from _unloadData, since it can lead to
|
|
153
|
+
// unexpected behavior.
|
|
154
|
+
// IMPORTANT: always call super.unloadData() from your override.
|
|
155
|
+
/** */
|
|
156
|
+
unloadData() {
|
|
157
|
+
if (this._isForceUnloaded) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this._dataRetainCount--;
|
|
161
|
+
if (this._dataRetainCount < 0) {
|
|
162
|
+
console.warn(`Block ${this.constructor._className} data over-released`); // eslint-disable-line no-console
|
|
163
|
+
this._dataRetainCount = 0;
|
|
164
|
+
}
|
|
165
|
+
if (this._dataRetainCount === 0) {
|
|
166
|
+
// Don't unload immediately. Wait a while in case something else
|
|
167
|
+
// requests the data, so we can avoid going back to liveapp or
|
|
168
|
+
// the network.
|
|
169
|
+
this._unloadDataTimeoutId = setTimeout(() => {
|
|
170
|
+
(0, _error_utils.invariant)(this._dataRetainCount === 0, 'Unload data timeout fired with non-zero retain count');
|
|
171
|
+
|
|
172
|
+
// Set _isDataLoaded to false before calling _unloadData in case
|
|
173
|
+
// _unloadData reads from isDataLoaded.
|
|
174
|
+
this._isDataLoaded = false;
|
|
175
|
+
this._unloadData();
|
|
176
|
+
this._onChangeIsDataLoaded();
|
|
177
|
+
}, AbstractModelWithAsyncData.__DATA_UNLOAD_DELAY_MS);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
_forceUnload() {
|
|
181
|
+
while (this._dataRetainCount > 0) {
|
|
182
|
+
this.unloadData();
|
|
183
|
+
}
|
|
184
|
+
this._isForceUnloaded = true;
|
|
185
|
+
}
|
|
186
|
+
_assertNotForceUnloaded() {
|
|
187
|
+
(0, _error_utils.invariant)(!this._isForceUnloaded, 'model (%s) permanently deleted', this.id);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
var _default = exports.default = AbstractModelWithAsyncData;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _base_core = require("../../shared/models/base_core");
|
|
8
|
+
var _mutations = require("../types/mutations");
|
|
9
|
+
var _private_utils = require("../../shared/private_utils");
|
|
10
|
+
var _record_store = _interopRequireDefault(require("./record_store"));
|
|
11
|
+
var _table = _interopRequireDefault(require("./table"));
|
|
12
|
+
var _create_aggregators = _interopRequireDefault(require("./create_aggregators"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/** @module @airtable/blocks/models: Base */ /** */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Model class representing a base.
|
|
18
|
+
*
|
|
19
|
+
* If you want the base model to automatically recalculate whenever the base schema changes, try the
|
|
20
|
+
* {@link useBase} hook. Alternatively, you can manually subscribe to changes with
|
|
21
|
+
* {@link useWatchable} (recommended) or [Base#watch](/api/models/Base#watch).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```js
|
|
25
|
+
* import {base} from '@airtable/blocks/base';
|
|
26
|
+
*
|
|
27
|
+
* console.log('The name of your base is', base.name);
|
|
28
|
+
* ```
|
|
29
|
+
* @docsPath models/Base
|
|
30
|
+
*/
|
|
31
|
+
class Base extends _base_core.BaseCore {
|
|
32
|
+
/** @internal */
|
|
33
|
+
static _className = 'Base';
|
|
34
|
+
_aggregators = null;
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
_constructTable(tableId) {
|
|
38
|
+
const recordStore = this.__getRecordStore(tableId);
|
|
39
|
+
return new _table.default(this, recordStore, tableId, this._sdk);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
_constructRecordStore(sdk, tableId) {
|
|
44
|
+
return new _record_store.default(sdk, tableId);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
_iterateTableIds() {
|
|
49
|
+
return this._data.tableOrder;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Aggregators can be used to compute aggregates for cell values.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```js
|
|
57
|
+
* import {base} from '@airtable/blocks/base';
|
|
58
|
+
*
|
|
59
|
+
* // To get a list of aggregators supported for a specific field:
|
|
60
|
+
* const fieldAggregators = myField.availableAggregators;
|
|
61
|
+
*
|
|
62
|
+
* // To compute the total attachment size of an attachment field:
|
|
63
|
+
* const aggregator = base.aggregators.totalAttachmentSize;
|
|
64
|
+
* const value = aggregator.aggregate(myRecords, myAttachmentField);
|
|
65
|
+
* const valueAsString = aggregate.aggregateToString(myRecords, myAttachmentField);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
get aggregators() {
|
|
69
|
+
if (!this._aggregators) {
|
|
70
|
+
this._aggregators = (0, _create_aggregators.default)(this._sdk);
|
|
71
|
+
}
|
|
72
|
+
return this._aggregators;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Checks whether the current user has permission to create a table.
|
|
77
|
+
*
|
|
78
|
+
* Accepts partial input, in the same format as {@link createTableAsync}.
|
|
79
|
+
*
|
|
80
|
+
* Returns `{hasPermission: true}` if the current user can update the specified record,
|
|
81
|
+
* `{hasPermission: false, reasonDisplayString: string}` otherwise. `reasonDisplayString` may be
|
|
82
|
+
* used to display an error message to the user.
|
|
83
|
+
*
|
|
84
|
+
* @param name name for the table. must be case-insensitive unique
|
|
85
|
+
* @param fields array of fields to create in the table
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```js
|
|
89
|
+
* const createTableCheckResult = base.checkPermissionsForCreateTable();
|
|
90
|
+
*
|
|
91
|
+
* if (!createTableCheckResult.hasPermission) {
|
|
92
|
+
* alert(createTableCheckResult.reasonDisplayString);
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
checkPermissionsForCreateTable(name, fields) {
|
|
97
|
+
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
98
|
+
type: _mutations.MutationTypes.CREATE_SINGLE_TABLE,
|
|
99
|
+
id: undefined,
|
|
100
|
+
// Generated in createTableAsync.
|
|
101
|
+
name: name,
|
|
102
|
+
fields: fields?.map(field => {
|
|
103
|
+
return {
|
|
104
|
+
name: field.name,
|
|
105
|
+
config: field.type ? {
|
|
106
|
+
type: field.type,
|
|
107
|
+
// In field.options we translate options to null when it's undefined (no options),
|
|
108
|
+
// but the mutation expects config to match the PublicApiConfig, where it's
|
|
109
|
+
// not present at all (options: undefined will fail validation).
|
|
110
|
+
...(field.options ? {
|
|
111
|
+
options: field.options
|
|
112
|
+
} : null)
|
|
113
|
+
} : undefined,
|
|
114
|
+
description: field.description
|
|
115
|
+
};
|
|
116
|
+
})
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* An alias for `checkPermissionsForCreateTable(name, fields).hasPermission`.
|
|
122
|
+
*
|
|
123
|
+
* Checks whether the current user has permission to create a table.
|
|
124
|
+
*
|
|
125
|
+
* Accepts partial input, in the same format as {@link createTableAsync}.
|
|
126
|
+
*
|
|
127
|
+
* @param name name for the table. must be case-insensitive unique
|
|
128
|
+
* @param fields array of fields to create in the table
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```js
|
|
132
|
+
* const canCreateTable = table.hasPermissionToCreateTable();
|
|
133
|
+
*
|
|
134
|
+
* if (!canCreateTable) {
|
|
135
|
+
* alert('not allowed!');
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
hasPermissionToCreateTable(name, fields) {
|
|
140
|
+
return this.checkPermissionsForCreateTable(name, fields).hasPermission;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Creates a new table.
|
|
145
|
+
*
|
|
146
|
+
* Throws an error if the user does not have permission to create a table, if an invalid
|
|
147
|
+
* table name is provided, or if invalid fields are provided (invalid name, type, options or
|
|
148
|
+
* description).
|
|
149
|
+
*
|
|
150
|
+
* Refer to {@link FieldType} for supported field types, the write format for field options, and
|
|
151
|
+
* other specifics for certain field types.
|
|
152
|
+
*
|
|
153
|
+
* At least one field must be specified. The first field in the `fields` array will be used as
|
|
154
|
+
* the table's [primary field](https://support.airtable.com/hc/en-us/articles/202624179-The-Name-Field)
|
|
155
|
+
* and must be a supported primary field type. Fields must have case-insensitive unique names
|
|
156
|
+
* within the table.
|
|
157
|
+
*
|
|
158
|
+
* A default grid view will be created with all fields visible.
|
|
159
|
+
*
|
|
160
|
+
* This action is asynchronous. Unlike new records, new tables are **not** created
|
|
161
|
+
* optimistically locally. You must `await` the returned promise before using the new
|
|
162
|
+
* table in your extension.
|
|
163
|
+
*
|
|
164
|
+
* @param name name for the table. must be case-insensitive unique
|
|
165
|
+
* @param fields array of fields to create in the table: see below for an example. `name` and
|
|
166
|
+
* `type` must be specified for all fields, while `options` is only required for fields that
|
|
167
|
+
* have field options. `description` is optional and will be `''` if not specified or if
|
|
168
|
+
* specified as `null`.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```js
|
|
172
|
+
* async function createNewTable() {
|
|
173
|
+
* const name = 'My new table';
|
|
174
|
+
* const fields = [
|
|
175
|
+
* // Name will be the primary field of the table.
|
|
176
|
+
* {name: 'Name', type: FieldType.SINGLE_LINE_TEXT, description: 'This is the primary field'},
|
|
177
|
+
* {name: 'Notes', type: FieldType.RICH_TEXT},
|
|
178
|
+
* {name: 'Attachments', type: FieldType.MULTIPLE_ATTACHMENTS},
|
|
179
|
+
* {name: 'Number', type: FieldType.NUMBER, options: {
|
|
180
|
+
* precision: 8,
|
|
181
|
+
* }},
|
|
182
|
+
* {name: 'Select', type: FieldType.SINGLE_SELECT, options: {
|
|
183
|
+
* choices: [
|
|
184
|
+
* {name: 'A'},
|
|
185
|
+
* {name: 'B'},
|
|
186
|
+
* ],
|
|
187
|
+
* }},
|
|
188
|
+
* ];
|
|
189
|
+
*
|
|
190
|
+
* if (base.hasPermissionToCreateTable(name, fields)) {
|
|
191
|
+
* await base.createTableAsync(name, fields);
|
|
192
|
+
* }
|
|
193
|
+
* }
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
async createTableAsync(name, fields) {
|
|
197
|
+
const tableId = this._sdk.__airtableInterface.idGenerator.generateTableId();
|
|
198
|
+
await this._sdk.__mutations.applyMutationAsync({
|
|
199
|
+
id: tableId,
|
|
200
|
+
type: _mutations.MutationTypes.CREATE_SINGLE_TABLE,
|
|
201
|
+
name,
|
|
202
|
+
fields: fields.map(field => {
|
|
203
|
+
return {
|
|
204
|
+
name: field.name,
|
|
205
|
+
config: {
|
|
206
|
+
type: field.type,
|
|
207
|
+
// In field.options we translate options to null when it's undefined (no options),
|
|
208
|
+
// but the mutation expects config to match the PublicApiConfig, where it's
|
|
209
|
+
// not present at all (options: undefined will fail validation).
|
|
210
|
+
...(field.options ? {
|
|
211
|
+
options: field.options
|
|
212
|
+
} : null)
|
|
213
|
+
},
|
|
214
|
+
// Coerce undefined to null so that only old SDKs pass "undefined" for description
|
|
215
|
+
// '' is permitted, as we already set empty descriptions to '' when editing descriptions
|
|
216
|
+
// from the UI
|
|
217
|
+
description: field.description ?? null
|
|
218
|
+
};
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
return this.getTableById(tableId);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
__triggerOnChangeForChangedPaths(changedPaths) {
|
|
228
|
+
super.__triggerOnChangeForChangedPaths(changedPaths);
|
|
229
|
+
let didSchemaChange = false;
|
|
230
|
+
if (changedPaths.tableOrder) {
|
|
231
|
+
this._onChange(_base_core.WatchableBaseKeys.tables);
|
|
232
|
+
didSchemaChange = true;
|
|
233
|
+
|
|
234
|
+
// Clean up deleted tables
|
|
235
|
+
for (const [tableId, tableModel] of (0, _private_utils.entries)(this._tableModelsById)) {
|
|
236
|
+
if (tableModel.isDeleted) {
|
|
237
|
+
delete this._tableModelsById[tableId];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
for (const [tableId, recordStore] of (0, _private_utils.entries)(this._tableRecordStoresByTableId)) {
|
|
241
|
+
if (recordStore && recordStore.isDeleted) {
|
|
242
|
+
recordStore.__onDataDeletion();
|
|
243
|
+
delete this._tableRecordStoresByTableId[tableId];
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (didSchemaChange) {
|
|
248
|
+
this._onChange(_base_core.WatchableBaseKeys.schema);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
var _default = exports.default = Base;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = createAggregators;
|
|
7
|
+
var _error_utils = require("../../shared/error_utils");
|
|
8
|
+
// istanbul ignore file
|
|
9
|
+
/** @module @airtable/blocks/models: Aggregators */ /** */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Aggregators can be used to compute aggregates for cell values.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```js
|
|
16
|
+
* import {base} from '@airtable/blocks/base';
|
|
17
|
+
*
|
|
18
|
+
* // To get a list of aggregators supported for a specific field:
|
|
19
|
+
* const fieldAggregators = myField.availableAggregators;
|
|
20
|
+
*
|
|
21
|
+
* // To compute the total attachment size of an attachment field:
|
|
22
|
+
* const aggregator = base.aggregators.totalAttachmentSize;
|
|
23
|
+
* const value = aggregator.aggregate(myRecords, myAttachmentField);
|
|
24
|
+
* const valueAsString = aggregate.aggregateToString(myRecords, myAttachmentField);
|
|
25
|
+
* ```
|
|
26
|
+
* @docsPath models/Aggregator
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Note: this is hidden instead of internal as it is the type of the public models.aggregators.
|
|
31
|
+
*
|
|
32
|
+
* If its internal, typescript won't know about it since the types will be stripped, and typescript
|
|
33
|
+
* blocks will error due to incomplete type definitions.
|
|
34
|
+
*
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
const aggregate = (sdk, aggregatorKey, records, field) => {
|
|
39
|
+
if (!field.isAggregatorAvailable(aggregatorKey)) {
|
|
40
|
+
throw (0, _error_utils.spawnError)('The %s aggregator is not available for %s fields', aggregatorKey, field.type);
|
|
41
|
+
}
|
|
42
|
+
const {
|
|
43
|
+
__appInterface: appInterface,
|
|
44
|
+
__airtableInterface: airtableInterface
|
|
45
|
+
} = sdk;
|
|
46
|
+
const cellValues = records.map(record => record._getRawCellValue(field));
|
|
47
|
+
return airtableInterface.aggregators.aggregate(appInterface, aggregatorKey, cellValues, field._data);
|
|
48
|
+
};
|
|
49
|
+
const aggregateToString = (sdk, aggregatorKey, records, field) => {
|
|
50
|
+
if (!field.isAggregatorAvailable(aggregatorKey)) {
|
|
51
|
+
throw (0, _error_utils.spawnError)('The %s aggregator is not available for %s fields', aggregatorKey, field.type);
|
|
52
|
+
}
|
|
53
|
+
const {
|
|
54
|
+
__appInterface: appInterface,
|
|
55
|
+
__airtableInterface: airtableInterface
|
|
56
|
+
} = sdk;
|
|
57
|
+
const cellValues = records.map(record => record._getRawCellValue(field));
|
|
58
|
+
return airtableInterface.aggregators.aggregateToString(appInterface, aggregatorKey, cellValues, field._data);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Note: this is hidden instead of internal as it is used to determine the type of the public
|
|
63
|
+
* models.aggregators.
|
|
64
|
+
*
|
|
65
|
+
* If its internal, typescript won't know about it since the types will be stripped, and typescript
|
|
66
|
+
* blocks will error due to incomplete type definitions.
|
|
67
|
+
*
|
|
68
|
+
* TODO: this should be made less brittle.
|
|
69
|
+
*
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
function createAggregators(sdk) {
|
|
73
|
+
const {
|
|
74
|
+
__airtableInterface: airtableInterface
|
|
75
|
+
} = sdk;
|
|
76
|
+
const aggregators = {};
|
|
77
|
+
const aggregatorKeys = airtableInterface.aggregators.getAllAvailableAggregatorKeys();
|
|
78
|
+
for (const key of aggregatorKeys) {
|
|
79
|
+
const config = airtableInterface.aggregators.getAggregatorConfig(key);
|
|
80
|
+
aggregators[key] = Object.freeze({
|
|
81
|
+
key,
|
|
82
|
+
displayName: config.displayName,
|
|
83
|
+
shortDisplayName: config.shortDisplayName,
|
|
84
|
+
aggregate: aggregate.bind(null, sdk, key),
|
|
85
|
+
aggregateToString: aggregateToString.bind(null, sdk, key)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
Object.freeze(aggregators);
|
|
89
|
+
return aggregators;
|
|
90
|
+
}
|