@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
|
@@ -1,728 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.symbol.description.js");
|
|
5
|
-
require("core-js/modules/es.array.from.js");
|
|
6
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
7
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
8
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
exports.getLinkedTableId = exports.default = void 0;
|
|
13
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
14
|
-
require("core-js/modules/es.array.concat.js");
|
|
15
|
-
require("core-js/modules/es.array.filter.js");
|
|
16
|
-
require("core-js/modules/es.array.iterator.js");
|
|
17
|
-
require("core-js/modules/es.array.map.js");
|
|
18
|
-
require("core-js/modules/es.array.slice.js");
|
|
19
|
-
require("core-js/modules/es.object.to-string.js");
|
|
20
|
-
require("core-js/modules/es.promise.js");
|
|
21
|
-
require("core-js/modules/es.string.starts-with.js");
|
|
22
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
24
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
25
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
26
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
27
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
28
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
29
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
-
var _field_core = require("../../shared/types/field_core");
|
|
32
|
-
var _error_utils = require("../../shared/error_utils");
|
|
33
|
-
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
34
|
-
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; } } }; }
|
|
35
|
-
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; } }
|
|
36
|
-
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; }
|
|
37
|
-
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)); }
|
|
38
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @module @airtable/blocks/models: RecordQueryResult */ /** */
|
|
39
|
-
var getLinkedTableId = field => {
|
|
40
|
-
var options = field.options;
|
|
41
|
-
var linkedTableId = options && options.linkedTableId;
|
|
42
|
-
(0, _error_utils.invariant)(typeof linkedTableId === 'string', 'linkedTableId must exist');
|
|
43
|
-
return linkedTableId;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/** internal */
|
|
47
|
-
exports.getLinkedTableId = getLinkedTableId;
|
|
48
|
-
/**
|
|
49
|
-
* Represents a set of records from a LinkedRecord cell value. See {@link RecordQueryResult} for main
|
|
50
|
-
* documentation.
|
|
51
|
-
*
|
|
52
|
-
* Do not instantiate. You can get instances of this class by calling
|
|
53
|
-
* `record.selectLinkedRecordsFromCell`.
|
|
54
|
-
*
|
|
55
|
-
* @docsPath models/query results/LinkedRecordsQueryResult
|
|
56
|
-
*/
|
|
57
|
-
var LinkedRecordsQueryResult = /*#__PURE__*/function (_RecordQueryResult) {
|
|
58
|
-
/** @internal */
|
|
59
|
-
function LinkedRecordsQueryResult(record, field, normalizedOpts, sdk) {
|
|
60
|
-
var _this;
|
|
61
|
-
(0, _classCallCheck2.default)(this, LinkedRecordsQueryResult);
|
|
62
|
-
_this = _callSuper(this, LinkedRecordsQueryResult, [sdk, normalizedOpts]);
|
|
63
|
-
// the record containing the linked-record cell this is a query of.
|
|
64
|
-
/** @internal */
|
|
65
|
-
(0, _defineProperty2.default)(_this, "_record", void 0);
|
|
66
|
-
// the cell's field in the record
|
|
67
|
-
/** @internal */
|
|
68
|
-
(0, _defineProperty2.default)(_this, "_field", void 0);
|
|
69
|
-
// the table we're linking to
|
|
70
|
-
/** @internal */
|
|
71
|
-
(0, _defineProperty2.default)(_this, "_linkedTable", void 0);
|
|
72
|
-
// the records store for the origin table
|
|
73
|
-
/** @internal */
|
|
74
|
-
(0, _defineProperty2.default)(_this, "_originRecordStore", void 0);
|
|
75
|
-
// the records store for the linked table
|
|
76
|
-
/** @internal */
|
|
77
|
-
(0, _defineProperty2.default)(_this, "_linkedRecordStore", void 0);
|
|
78
|
-
// a RecordQueryResult containing all the rows in the linked table
|
|
79
|
-
/** @internal */
|
|
80
|
-
(0, _defineProperty2.default)(_this, "_linkedQueryResult", void 0);
|
|
81
|
-
// is the query result currently valid. if the field config changes to link
|
|
82
|
-
// to another table or not be a linked record field at all, isValid will
|
|
83
|
-
// become false. once a LinkedRecordsQueryResult has become invalid, it will
|
|
84
|
-
// not become valid again.
|
|
85
|
-
/** @internal */
|
|
86
|
-
(0, _defineProperty2.default)(_this, "_isValid", true);
|
|
87
|
-
// a lazily-generated set of the record ids in the result set.
|
|
88
|
-
/** @internal */
|
|
89
|
-
(0, _defineProperty2.default)(_this, "_computedRecordIdsSet", null);
|
|
90
|
-
// a lazily-generated array of the record ids in the query result.
|
|
91
|
-
/** @internal */
|
|
92
|
-
(0, _defineProperty2.default)(_this, "_computedFilteredSortedRecordIds", null);
|
|
93
|
-
// how many times has each 'cellValuesInField:$FieldId' been watched?
|
|
94
|
-
/** @internal */
|
|
95
|
-
(0, _defineProperty2.default)(_this, "_cellValueChangeHandlerByFieldId", {});
|
|
96
|
-
(0, _error_utils.invariant)(record.parentTable === field.parentTable, 'record and field must belong to the same table');
|
|
97
|
-
_this._record = record;
|
|
98
|
-
_this._field = field;
|
|
99
|
-
_this._linkedTable = normalizedOpts.table;
|
|
100
|
-
_this._originRecordStore = _this._sdk.base.__getRecordStore(_this._record.parentTable.id);
|
|
101
|
-
_this._linkedRecordStore = normalizedOpts.recordStore;
|
|
102
|
-
|
|
103
|
-
// we could rely on RecordQueryResult's reuse pool to make sure we get back
|
|
104
|
-
// the same RecordQueryResult every time, but that would make it much harder
|
|
105
|
-
// to make sure we unwatch everything from the old RecordQueryResult if e.g.
|
|
106
|
-
// the field config changes to point at a different table
|
|
107
|
-
_this._linkedQueryResult = _this._linkedTable.__tableOrViewQueryResultPool.getObjectForReuse(_this._sdk, _this._linkedTable, normalizedOpts);
|
|
108
|
-
return _this;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Is the query result currently valid? This value always starts as 'true',
|
|
113
|
-
* but can become false if the record from which this result was created is
|
|
114
|
-
* deleted, if the field is deleted, if the field config changes to link to
|
|
115
|
-
* a different table, or if the field config changes to link to a type
|
|
116
|
-
* other than MULTIPLE_RECORD_LINKS. Once `isValid` has become false, it
|
|
117
|
-
* will never become true again. Many fields will throw on attempting to
|
|
118
|
-
* access them, and watches will no longer fire.
|
|
119
|
-
*/
|
|
120
|
-
(0, _inherits2.default)(LinkedRecordsQueryResult, _RecordQueryResult);
|
|
121
|
-
return (0, _createClass2.default)(LinkedRecordsQueryResult, [{
|
|
122
|
-
key: "isValid",
|
|
123
|
-
get: function get() {
|
|
124
|
-
return this._isValid;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The table that records in this RecordQueryResult are part of
|
|
129
|
-
*
|
|
130
|
-
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
131
|
-
*/
|
|
132
|
-
}, {
|
|
133
|
-
key: "parentTable",
|
|
134
|
-
get: function get() {
|
|
135
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
136
|
-
return this._linkedTable;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Ordered array of all the linked record ids. Watchable.
|
|
141
|
-
*/
|
|
142
|
-
}, {
|
|
143
|
-
key: "recordIds",
|
|
144
|
-
get: function get() {
|
|
145
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
146
|
-
(0, _error_utils.invariant)(this.isDataLoaded, 'LinkedRecordsQueryResult data is not loaded');
|
|
147
|
-
|
|
148
|
-
// record ids are lazily generated
|
|
149
|
-
this._generateComputedDataIfNeeded();
|
|
150
|
-
(0, _error_utils.invariant)(this._computedFilteredSortedRecordIds, 'no recordIds');
|
|
151
|
-
return this._computedFilteredSortedRecordIds;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Ordered array of all the linked records. Watchable.
|
|
156
|
-
*/
|
|
157
|
-
}, {
|
|
158
|
-
key: "records",
|
|
159
|
-
get: function get() {
|
|
160
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
161
|
-
return this.recordIds.map(recordId => {
|
|
162
|
-
var record = this._linkedRecordStore.getRecordByIdIfExists(recordId);
|
|
163
|
-
(0, _error_utils.invariant)(record, 'No record for id: %s', recordId);
|
|
164
|
-
return record;
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* The fields that were used to create this LinkedRecordsQueryResult.
|
|
170
|
-
*/
|
|
171
|
-
}, {
|
|
172
|
-
key: "fields",
|
|
173
|
-
get: function get() {
|
|
174
|
-
(0, _error_utils.invariant)(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
175
|
-
return this._linkedQueryResult.fields;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/** @inheritdoc */
|
|
179
|
-
}, {
|
|
180
|
-
key: "watch",
|
|
181
|
-
value: function watch(keys, callback, context) {
|
|
182
|
-
(0, _error_utils.invariant)(this.isValid, 'cannot watch an invalid LinkedRecordsQueryResult');
|
|
183
|
-
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(LinkedRecordsQueryResult.prototype), "watch", this).call(this, keys, callback, context);
|
|
184
|
-
var _iterator = _createForOfIteratorHelper(validKeys),
|
|
185
|
-
_step;
|
|
186
|
-
try {
|
|
187
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
188
|
-
var key = _step.value;
|
|
189
|
-
if (key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
190
|
-
this._watchLinkedQueryCellValuesIfNeededAfterWatch();
|
|
191
|
-
}
|
|
192
|
-
if (key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
|
|
193
|
-
var fieldId = key.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
194
|
-
this._watchLinkedQueryCellValuesInFieldIfNeededAfterWatch(fieldId);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
} catch (err) {
|
|
198
|
-
_iterator.e(err);
|
|
199
|
-
} finally {
|
|
200
|
-
_iterator.f();
|
|
201
|
-
}
|
|
202
|
-
return validKeys;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/** @inheritdoc */
|
|
206
|
-
}, {
|
|
207
|
-
key: "unwatch",
|
|
208
|
-
value: function unwatch(keys, callback, context) {
|
|
209
|
-
var arrayKeys = Array.isArray(keys) ? keys : [keys];
|
|
210
|
-
var _iterator2 = _createForOfIteratorHelper(arrayKeys),
|
|
211
|
-
_step2;
|
|
212
|
-
try {
|
|
213
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
214
|
-
var key = _step2.value;
|
|
215
|
-
if (key === _record_query_result.default.WatchableKeys.cellValues) {
|
|
216
|
-
this._unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch();
|
|
217
|
-
}
|
|
218
|
-
if (key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix)) {
|
|
219
|
-
var fieldId = key.substring(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
220
|
-
this._unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch(fieldId);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
} catch (err) {
|
|
224
|
-
_iterator2.e(err);
|
|
225
|
-
} finally {
|
|
226
|
-
_iterator2.f();
|
|
227
|
-
}
|
|
228
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(LinkedRecordsQueryResult.prototype), "unwatch", this).call(this, arrayKeys, callback, context);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/** @inheritdoc */
|
|
232
|
-
}, {
|
|
233
|
-
key: "loadDataAsync",
|
|
234
|
-
value: (function () {
|
|
235
|
-
var _loadDataAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
236
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
237
|
-
while (1) switch (_context.prev = _context.next) {
|
|
238
|
-
case 0:
|
|
239
|
-
_context.next = 2;
|
|
240
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(LinkedRecordsQueryResult.prototype), "loadDataAsync", this).call(this);
|
|
241
|
-
case 2:
|
|
242
|
-
if (this.isDataLoaded) {
|
|
243
|
-
_context.next = 6;
|
|
244
|
-
break;
|
|
245
|
-
}
|
|
246
|
-
_context.next = 5;
|
|
247
|
-
return this.loadDataAsync();
|
|
248
|
-
case 5:
|
|
249
|
-
// there has to be an unloadData call for every loadDataAsync call.
|
|
250
|
-
// call it here to offset calling loadDataAsync a second time
|
|
251
|
-
this.unloadData();
|
|
252
|
-
case 6:
|
|
253
|
-
case "end":
|
|
254
|
-
return _context.stop();
|
|
255
|
-
}
|
|
256
|
-
}, _callee, this);
|
|
257
|
-
}));
|
|
258
|
-
function loadDataAsync() {
|
|
259
|
-
return _loadDataAsync2.apply(this, arguments);
|
|
260
|
-
}
|
|
261
|
-
return loadDataAsync;
|
|
262
|
-
}() /** @internal */)
|
|
263
|
-
}, {
|
|
264
|
-
key: "_loadDataAsync",
|
|
265
|
-
value: (function () {
|
|
266
|
-
var _loadDataAsync3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
267
|
-
var initiallyLoaded, changedKeys, fieldIds, _iterator3, _step3, fieldId;
|
|
268
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
269
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
270
|
-
case 0:
|
|
271
|
-
this._record.__linkedRecordsQueryResultPool.registerObjectForReuseStrong(this);
|
|
272
|
-
this._watchOrigin();
|
|
273
|
-
this._watchLinkedQueryResult();
|
|
274
|
-
initiallyLoaded = this._linkedQueryResult.isDataLoaded;
|
|
275
|
-
_context2.next = 6;
|
|
276
|
-
return Promise.all([this._sdk.base.__getRecordStore(this._record.parentTable.id).loadCellValuesInFieldIdsAsync([this._field.id]), this._linkedQueryResult.loadDataAsync(), this._loadRecordColorsAsync()]);
|
|
277
|
-
case 6:
|
|
278
|
-
this._invalidateComputedData();
|
|
279
|
-
changedKeys = ['records', 'recordIds', 'recordColors']; // If the linked query result was not initially loaded, then the
|
|
280
|
-
// `cellValues` event will be emitted via `_onLinkedCellValuesChange`.
|
|
281
|
-
// Otherwise, it must be explicitly included here in order to promote
|
|
282
|
-
// consistency.
|
|
283
|
-
if (initiallyLoaded) {
|
|
284
|
-
changedKeys.push('cellValues');
|
|
285
|
-
}
|
|
286
|
-
fieldIds = this._normalizedOpts.fieldIdsOrNullIfAllFields || this.parentTable.fields.map(field => field.id);
|
|
287
|
-
_iterator3 = _createForOfIteratorHelper(fieldIds);
|
|
288
|
-
try {
|
|
289
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
290
|
-
fieldId = _step3.value;
|
|
291
|
-
changedKeys.push(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
292
|
-
}
|
|
293
|
-
} catch (err) {
|
|
294
|
-
_iterator3.e(err);
|
|
295
|
-
} finally {
|
|
296
|
-
_iterator3.f();
|
|
297
|
-
}
|
|
298
|
-
return _context2.abrupt("return", changedKeys);
|
|
299
|
-
case 13:
|
|
300
|
-
case "end":
|
|
301
|
-
return _context2.stop();
|
|
302
|
-
}
|
|
303
|
-
}, _callee2, this);
|
|
304
|
-
}));
|
|
305
|
-
function _loadDataAsync() {
|
|
306
|
-
return _loadDataAsync3.apply(this, arguments);
|
|
307
|
-
}
|
|
308
|
-
return _loadDataAsync;
|
|
309
|
-
}() /** @internal */)
|
|
310
|
-
}, {
|
|
311
|
-
key: "_unloadData",
|
|
312
|
-
value: function _unloadData() {
|
|
313
|
-
// The inverse of this condition cannot be deterministically reproduced
|
|
314
|
-
// in the testing environment.
|
|
315
|
-
// istanbul ignore else
|
|
316
|
-
if (this.isValid) {
|
|
317
|
-
this._record.__linkedRecordsQueryResultPool.unregisterObjectForReuseStrong(this);
|
|
318
|
-
this._unwatchOrigin();
|
|
319
|
-
this._unwatchLinkedQueryResult();
|
|
320
|
-
this._originRecordStore.unloadCellValuesInFieldIds([this._field.id]);
|
|
321
|
-
this._linkedQueryResult.unloadData();
|
|
322
|
-
this._unloadRecordColors();
|
|
323
|
-
this._invalidateComputedData();
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* the key used to identify this query result in ObjectPool
|
|
329
|
-
*
|
|
330
|
-
* @hidden
|
|
331
|
-
*/
|
|
332
|
-
}, {
|
|
333
|
-
key: "__poolKey",
|
|
334
|
-
get: function get() {
|
|
335
|
-
return "".concat(this._serializedOpts, "::").concat(this._field.id, "::").concat(this._linkedTable.id, "::").concat(this.isValid);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/** @internal */
|
|
339
|
-
}, {
|
|
340
|
-
key: "_cellValuesWatchCount",
|
|
341
|
-
get: function get() {
|
|
342
|
-
return (this._changeWatchersByKey[_record_query_result.default.WatchableKeys.cellValues] || []).length;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/** @internal */
|
|
346
|
-
}, {
|
|
347
|
-
key: "_watchLinkedQueryCellValuesIfNeededAfterWatch",
|
|
348
|
-
value: function _watchLinkedQueryCellValuesIfNeededAfterWatch() {
|
|
349
|
-
if (this._cellValuesWatchCount === 1) {
|
|
350
|
-
this._watchLinkedQueryCellValues();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/** @internal */
|
|
355
|
-
}, {
|
|
356
|
-
key: "_unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch",
|
|
357
|
-
value: function _unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch() {
|
|
358
|
-
if (this._cellValuesWatchCount === 1 && this.isValid) {
|
|
359
|
-
this._unwatchLinkedQueryCellValues();
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/** @internal */
|
|
364
|
-
}, {
|
|
365
|
-
key: "_cellValueWatchCountByFieldId",
|
|
366
|
-
get: function get() {
|
|
367
|
-
var countByFieldId = {};
|
|
368
|
-
var watchKeys = Object.keys(this._changeWatchersByKey).filter(key => {
|
|
369
|
-
return key.startsWith(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix);
|
|
370
|
-
});
|
|
371
|
-
var _iterator4 = _createForOfIteratorHelper(watchKeys),
|
|
372
|
-
_step4;
|
|
373
|
-
try {
|
|
374
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
375
|
-
var watchKey = _step4.value;
|
|
376
|
-
var fieldId = watchKey.slice(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix.length);
|
|
377
|
-
countByFieldId[fieldId] = this._changeWatchersByKey[watchKey].length;
|
|
378
|
-
}
|
|
379
|
-
} catch (err) {
|
|
380
|
-
_iterator4.e(err);
|
|
381
|
-
} finally {
|
|
382
|
-
_iterator4.f();
|
|
383
|
-
}
|
|
384
|
-
return countByFieldId;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/** @internal */
|
|
388
|
-
}, {
|
|
389
|
-
key: "_watchLinkedQueryCellValuesInFieldIfNeededAfterWatch",
|
|
390
|
-
value: function _watchLinkedQueryCellValuesInFieldIfNeededAfterWatch(fieldId) {
|
|
391
|
-
if (this._cellValueWatchCountByFieldId[fieldId] === 1 && this.isValid) {
|
|
392
|
-
this._watchLinkedQueryCellValuesInField(fieldId);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/** @internal */
|
|
397
|
-
}, {
|
|
398
|
-
key: "_unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch",
|
|
399
|
-
value: function _unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch(fieldId) {
|
|
400
|
-
(0, _error_utils.invariant)(this._cellValueWatchCountByFieldId[fieldId], "cellValuesInField:%s over-free'd", fieldId);
|
|
401
|
-
if (this._cellValueWatchCountByFieldId[fieldId] === 1 && this.isValid) {
|
|
402
|
-
this._unwatchLinkedQueryCellValuesInField(fieldId);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/** @internal */
|
|
407
|
-
}, {
|
|
408
|
-
key: "_watchOrigin",
|
|
409
|
-
value: function _watchOrigin() {
|
|
410
|
-
// if the cell values in the record change, we need to invalidate our
|
|
411
|
-
// cached data and notify watchers
|
|
412
|
-
this._record.watch("cellValueInField:".concat(this._field.id), this._onOriginCellValueChange, this);
|
|
413
|
-
// if the field config changes, we need to invalidate cached data,
|
|
414
|
-
// and potentially start watching a different table
|
|
415
|
-
this._field.watch('type', this._onOriginFieldConfigChange, this);
|
|
416
|
-
this._field.watch('options', this._onOriginFieldConfigChange, this);
|
|
417
|
-
// if the underlying record is deleted, we need to invalidate this
|
|
418
|
-
// result
|
|
419
|
-
this._originRecordStore.watch('recordIds', this._onOriginRecordsChange, this);
|
|
420
|
-
// if the linked field in the origin table is deleted, we need to
|
|
421
|
-
// invalidate this result
|
|
422
|
-
this._record.parentTable.watch('fields', this._onOriginFieldsChange, this);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/** @internal */
|
|
426
|
-
}, {
|
|
427
|
-
key: "_unwatchOrigin",
|
|
428
|
-
value: function _unwatchOrigin() {
|
|
429
|
-
this._record.unwatch("cellValueInField:".concat(this._field.id), this._onOriginCellValueChange, this);
|
|
430
|
-
this._field.unwatch('type', this._onOriginFieldConfigChange, this);
|
|
431
|
-
this._field.unwatch('options', this._onOriginFieldConfigChange, this);
|
|
432
|
-
this._originRecordStore.unwatch('recordIds', this._onOriginRecordsChange, this);
|
|
433
|
-
this._record.parentTable.unwatch('fields', this._onOriginFieldsChange, this);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/** @internal */
|
|
437
|
-
}, {
|
|
438
|
-
key: "_watchLinkedQueryResult",
|
|
439
|
-
value: function _watchLinkedQueryResult() {
|
|
440
|
-
// in the linked table, all we care about is the set of recordIds.
|
|
441
|
-
// this watch fire when they're added/removed and when they change
|
|
442
|
-
// order. we only care about order, because add/remove is handled by
|
|
443
|
-
// watching the origin record
|
|
444
|
-
this._linkedQueryResult.watch('recordIds', this._onLinkedRecordIdsChange, this);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/** @internal */
|
|
448
|
-
}, {
|
|
449
|
-
key: "_unwatchLinkedQueryResult",
|
|
450
|
-
value: function _unwatchLinkedQueryResult() {
|
|
451
|
-
this._linkedQueryResult.unwatch('recordIds', this._onLinkedRecordIdsChange, this);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/** @internal */
|
|
455
|
-
}, {
|
|
456
|
-
key: "_watchLinkedQueryCellValues",
|
|
457
|
-
value: function _watchLinkedQueryCellValues() {
|
|
458
|
-
this._linkedQueryResult.watch('cellValues', this._onLinkedCellValuesChange, this);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/** @internal */
|
|
462
|
-
}, {
|
|
463
|
-
key: "_unwatchLinkedQueryCellValues",
|
|
464
|
-
value: function _unwatchLinkedQueryCellValues() {
|
|
465
|
-
this._linkedQueryResult.unwatch('cellValues', this._onLinkedCellValuesChange, this);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/** @internal */
|
|
469
|
-
}, {
|
|
470
|
-
key: "_watchLinkedQueryCellValuesInField",
|
|
471
|
-
value: function _watchLinkedQueryCellValuesInField(fieldId) {
|
|
472
|
-
this._linkedQueryResult.watch(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, this._getOnLinkedCellValuesInFieldChange(fieldId), this);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/** @internal */
|
|
476
|
-
}, {
|
|
477
|
-
key: "_unwatchLinkedQueryCellValuesInField",
|
|
478
|
-
value: function _unwatchLinkedQueryCellValuesInField(fieldId) {
|
|
479
|
-
this._linkedQueryResult.unwatch(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, this._getOnLinkedCellValuesInFieldChange(fieldId), this);
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/** @internal */
|
|
483
|
-
}, {
|
|
484
|
-
key: "_onLinkedRecordIdsChange",
|
|
485
|
-
value: function _onLinkedRecordIdsChange() {
|
|
486
|
-
if (!this.isDataLoaded || this._record.isDeleted) {
|
|
487
|
-
//TODO(jamesmoody-at): Adding this._dataOrNullIfDeleted as an exit condition here is a temporary fix to address an issue where
|
|
488
|
-
// we are not reseting isValid to true while restoring deleted records that contain linked record fields. It seems the only way
|
|
489
|
-
// to do this is by creating a new LinkRecordsQueryResult instance but it seems like we might be reusing the original instance
|
|
490
|
-
// that we've already set isValid to false with. We'll need to do more investigating to figure out the right way to restore these
|
|
491
|
-
// records while keeping the behavior of isValid consistent
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
495
|
-
this._invalidateComputedData();
|
|
496
|
-
|
|
497
|
-
// we don't actually know at this stage whether anything changed or
|
|
498
|
-
// not. it may have done though, so notify watchers
|
|
499
|
-
this._onChange('records');
|
|
500
|
-
this._onChange('recordIds');
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* This model doesn't use the `_data` computed property it inherits from
|
|
505
|
-
* AbstractModel. It implements the following method only so that internal
|
|
506
|
-
* checks for model deletion behave appropriately (the data itself is
|
|
507
|
-
* inconsequential).
|
|
508
|
-
*
|
|
509
|
-
* @internal
|
|
510
|
-
*/
|
|
511
|
-
}, {
|
|
512
|
-
key: "_dataOrNullIfDeleted",
|
|
513
|
-
get: function get() {
|
|
514
|
-
if (this._record.isDeleted || this._linkedRecordStore.isDeleted) {
|
|
515
|
-
return null;
|
|
516
|
-
}
|
|
517
|
-
return {};
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
/** @internal */
|
|
521
|
-
}, {
|
|
522
|
-
key: "_onLinkedCellValuesChange",
|
|
523
|
-
value: function _onLinkedCellValuesChange(queryResult, key, changes) {
|
|
524
|
-
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
525
|
-
if (changes && changes.fieldIds && changes.recordIds) {
|
|
526
|
-
var recordIdsSet = this._getOrGenerateRecordIdsSet();
|
|
527
|
-
var recordIds = changes.recordIds.filter(id => recordIdsSet[id] === true);
|
|
528
|
-
if (recordIds.length) {
|
|
529
|
-
this._onChange('cellValues', {
|
|
530
|
-
fieldIds: changes.fieldIds,
|
|
531
|
-
recordIds
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
} else {
|
|
535
|
-
this._onChange('cellValues');
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
/** @internal */
|
|
540
|
-
}, {
|
|
541
|
-
key: "_getOnLinkedCellValuesInFieldChange",
|
|
542
|
-
value: function _getOnLinkedCellValuesInFieldChange(fieldId) {
|
|
543
|
-
if (!this._cellValueChangeHandlerByFieldId[fieldId]) {
|
|
544
|
-
this._cellValueChangeHandlerByFieldId[fieldId] = (queryResult, key, recordIds) => {
|
|
545
|
-
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
546
|
-
|
|
547
|
-
// The linked record may finish loading before its parent. In
|
|
548
|
-
// that case, the appropriate events will be triggered by the
|
|
549
|
-
// `_loadDataAsync` method.
|
|
550
|
-
if (!this.isDataLoaded) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
// The `else` branch will only be reached when the underlying
|
|
555
|
-
// `RecordOrViewQueryResult` is loaded, unloaded, and then
|
|
556
|
-
// loaded again. Because that query result is not directly
|
|
557
|
-
// exposed to consumers, the condition can only be met when the
|
|
558
|
-
// SDK is misused (e.g. repeatedly freeing related query
|
|
559
|
-
// results). The `else` branch attempts to handle that
|
|
560
|
-
// situation in a logical way, but it is not tested because it
|
|
561
|
-
// is fundamentally invalid.
|
|
562
|
-
// istanbul ignore else
|
|
563
|
-
if (Array.isArray(recordIds)) {
|
|
564
|
-
var recordIdsSet = this._getOrGenerateRecordIdsSet();
|
|
565
|
-
var filteredRecordIds = recordIds.filter(id => typeof id === 'string' && recordIdsSet[id] === true);
|
|
566
|
-
if (filteredRecordIds.length) {
|
|
567
|
-
this._onChange(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId, filteredRecordIds);
|
|
568
|
-
}
|
|
569
|
-
} else {
|
|
570
|
-
this._onChange(_record_query_result.default.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
return this._cellValueChangeHandlerByFieldId[fieldId];
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/** @internal */
|
|
578
|
-
}, {
|
|
579
|
-
key: "_onOriginCellValueChange",
|
|
580
|
-
value: function _onOriginCellValueChange() {
|
|
581
|
-
if (!this.isDataLoaded || this._field.isDeleted) {
|
|
582
|
-
//TODO(jamesmoody-at): Adding this._dataOrNullIfDeleted as an exit condition here is a temporary fix to address an issue where
|
|
583
|
-
// we are not resetting isValid to true while restoring deleted records that contain linked record fields. It seems the only way
|
|
584
|
-
// to do this is by creating a new LinkRecordsQueryResult instance but it seems like we might be reusing the original instance
|
|
585
|
-
// that we've already set isValid to false with. We'll need to do more investigating to figure out the right way to restore these
|
|
586
|
-
// records while keeping the behavior of isValid consistent
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
590
|
-
|
|
591
|
-
// when the origin cell value (listing all the linked records) changes,
|
|
592
|
-
// invalidate all the data we have stored - we need to completely
|
|
593
|
-
// regenerate it
|
|
594
|
-
this._invalidateComputedData();
|
|
595
|
-
|
|
596
|
-
// notify watchers that our set of linked records has changed
|
|
597
|
-
this._onChange('records');
|
|
598
|
-
this._onChange('recordIds');
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
/** @internal */
|
|
602
|
-
}, {
|
|
603
|
-
key: "_onOriginRecordsChange",
|
|
604
|
-
value: function _onOriginRecordsChange() {
|
|
605
|
-
if (this._record.isDeleted) {
|
|
606
|
-
this._isValid = false;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/** @internal */
|
|
611
|
-
}, {
|
|
612
|
-
key: "_onOriginFieldsChange",
|
|
613
|
-
value: function _onOriginFieldsChange() {
|
|
614
|
-
if (this._field.isDeleted) {
|
|
615
|
-
this._isValid = false;
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
/** @internal */
|
|
620
|
-
}, {
|
|
621
|
-
key: "_onOriginFieldConfigChange",
|
|
622
|
-
value: function _onOriginFieldConfigChange() {
|
|
623
|
-
(0, _error_utils.invariant)(this.isValid, 'watch key change event whilst invalid');
|
|
624
|
-
var type = this._field.type;
|
|
625
|
-
if (type !== _field_core.FieldType.MULTIPLE_RECORD_LINKS) {
|
|
626
|
-
this._invalidateQueryResult();
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
var linkedTableId = getLinkedTableId(this._field);
|
|
630
|
-
if (linkedTableId !== this._linkedTable.id) {
|
|
631
|
-
this._invalidateQueryResult();
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
/** @internal */
|
|
637
|
-
}, {
|
|
638
|
-
key: "_invalidateQueryResult",
|
|
639
|
-
value: function _invalidateQueryResult() {
|
|
640
|
-
if (this.isDataLoaded) {
|
|
641
|
-
this._unloadData();
|
|
642
|
-
}
|
|
643
|
-
if (this._cellValuesWatchCount > 0) {
|
|
644
|
-
this._unwatchLinkedQueryCellValues();
|
|
645
|
-
}
|
|
646
|
-
for (var _i = 0, _Object$keys = Object.keys(this._cellValueWatchCountByFieldId); _i < _Object$keys.length; _i++) {
|
|
647
|
-
var fieldId = _Object$keys[_i];
|
|
648
|
-
this._unwatchLinkedQueryCellValuesInField(fieldId);
|
|
649
|
-
}
|
|
650
|
-
this._isValid = false;
|
|
651
|
-
this._onChange('records');
|
|
652
|
-
this._onChange('recordIds');
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
/** @internal */
|
|
656
|
-
}, {
|
|
657
|
-
key: "_invalidateComputedData",
|
|
658
|
-
value: function _invalidateComputedData() {
|
|
659
|
-
this._computedRecordIdsSet = null;
|
|
660
|
-
this._computedFilteredSortedRecordIds = null;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
/** @internal */
|
|
664
|
-
}, {
|
|
665
|
-
key: "_generateComputedDataIfNeeded",
|
|
666
|
-
value: function _generateComputedDataIfNeeded() {
|
|
667
|
-
if (!this._computedRecordIdsSet) {
|
|
668
|
-
this._generateComputedData();
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
/** @internal */
|
|
673
|
-
}, {
|
|
674
|
-
key: "_generateComputedData",
|
|
675
|
-
value: function _generateComputedData() {
|
|
676
|
-
var recordIdsSet = {};
|
|
677
|
-
var rawCellValue = this._record.getCellValue(this._field);
|
|
678
|
-
var cellValue = rawCellValue === null ? [] : rawCellValue;
|
|
679
|
-
(0, _error_utils.invariant)(Array.isArray(cellValue), 'cellValue should be array');
|
|
680
|
-
var _iterator5 = _createForOfIteratorHelper(cellValue),
|
|
681
|
-
_step5;
|
|
682
|
-
try {
|
|
683
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
684
|
-
var linkedRecord = _step5.value;
|
|
685
|
-
(0, _error_utils.invariant)(linkedRecord && typeof linkedRecord === 'object', 'linked record should be object');
|
|
686
|
-
var recordId = linkedRecord.id;
|
|
687
|
-
(0, _error_utils.invariant)(typeof recordId === 'string', 'id should be present');
|
|
688
|
-
|
|
689
|
-
// We need to use the query result as the source of truth for
|
|
690
|
-
// recordIds, since when the client deletes a record from the linked
|
|
691
|
-
// table, we update it optimistically but the origin cell value
|
|
692
|
-
// doesn't update until receiving the push payload.
|
|
693
|
-
if (this._linkedQueryResult.hasRecord(recordId)) {
|
|
694
|
-
recordIdsSet[recordId] = true;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
} catch (err) {
|
|
698
|
-
_iterator5.e(err);
|
|
699
|
-
} finally {
|
|
700
|
-
_iterator5.f();
|
|
701
|
-
}
|
|
702
|
-
this._computedRecordIdsSet = recordIdsSet;
|
|
703
|
-
if (this._normalizedOpts.sorts && this._normalizedOpts.sorts.length) {
|
|
704
|
-
// when sorts are present, record order comes from the query result
|
|
705
|
-
this._computedFilteredSortedRecordIds = this._linkedQueryResult.recordIds.filter(recordId => recordIdsSet[recordId] === true);
|
|
706
|
-
} else {
|
|
707
|
-
// with no sorts, record order is the same as in the cell in the
|
|
708
|
-
// main Airtable UI. Since we generated recordIdsSet by iterating
|
|
709
|
-
// over the cell value, we're guaranteed that the key order matches
|
|
710
|
-
// the linked record order in the cell.
|
|
711
|
-
this._computedFilteredSortedRecordIds = Object.keys(recordIdsSet);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
/** @internal */
|
|
716
|
-
}, {
|
|
717
|
-
key: "_getOrGenerateRecordIdsSet",
|
|
718
|
-
value: function _getOrGenerateRecordIdsSet() {
|
|
719
|
-
this._generateComputedDataIfNeeded();
|
|
720
|
-
var recordIdsSet = this._computedRecordIdsSet;
|
|
721
|
-
(0, _error_utils.invariant)(recordIdsSet, 'recordIdsSet must exist');
|
|
722
|
-
return recordIdsSet;
|
|
723
|
-
}
|
|
724
|
-
}]);
|
|
725
|
-
}(_record_query_result.default);
|
|
726
|
-
/** @internal */
|
|
727
|
-
(0, _defineProperty2.default)(LinkedRecordsQueryResult, "_className", 'LinkedRecordsQueryResult');
|
|
728
|
-
var _default = exports.default = LinkedRecordsQueryResult;
|