@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,602 +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.array.slice.js");
|
|
7
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
8
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
9
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
10
|
-
Object.defineProperty(exports, "__esModule", {
|
|
11
|
-
value: true
|
|
12
|
-
});
|
|
13
|
-
exports.WatchableBaseKeys = exports.BaseCore = void 0;
|
|
14
|
-
require("core-js/modules/es.array.iterator.js");
|
|
15
|
-
require("core-js/modules/es.array.map.js");
|
|
16
|
-
require("core-js/modules/es.map.js");
|
|
17
|
-
require("core-js/modules/es.object.to-string.js");
|
|
18
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
19
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
20
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
22
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
24
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
26
|
-
var _private_utils = require("../private_utils");
|
|
27
|
-
var _error_utils = require("../error_utils");
|
|
28
|
-
var _abstract_model = _interopRequireDefault(require("./abstract_model"));
|
|
29
|
-
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; } } }; }
|
|
30
|
-
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; } }
|
|
31
|
-
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; }
|
|
32
|
-
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)); }
|
|
33
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
34
|
-
// How these model classes work:
|
|
35
|
-
//
|
|
36
|
-
// The single instance of the Base class maintains a reference to a plain JS
|
|
37
|
-
// object that contains all the data (baseData). All the other model classes
|
|
38
|
-
// receive a reference to baseData and traverse it to expose the data.
|
|
39
|
-
//
|
|
40
|
-
// As changes come in from liveapp, Base will apply them to the plain JS object.
|
|
41
|
-
// Since the other model classes have a reference to the same object, they'll
|
|
42
|
-
// always be accessing the most up-to-date values.
|
|
43
|
-
//
|
|
44
|
-
// Be careful not to return a reference to any non-primitive subtree of baseData,
|
|
45
|
-
// since the block developer could mutate it and we'll end up out of sync with
|
|
46
|
-
// liveapp.
|
|
47
|
-
|
|
48
|
-
var WatchableBaseKeys = exports.WatchableBaseKeys = Object.freeze({
|
|
49
|
-
name: 'name',
|
|
50
|
-
tables: 'tables',
|
|
51
|
-
collaborators: 'collaborators',
|
|
52
|
-
schema: 'schema',
|
|
53
|
-
color: 'color'
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Any key in base that can be watched:
|
|
58
|
-
* - `name`: the name of the base
|
|
59
|
-
* - `tables`: the order of tables in the base
|
|
60
|
-
* - `collaborators`: all the collaborators in the base
|
|
61
|
-
* - `schema`: the base schema (essentially everything except for record data)
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
/** @internal */
|
|
65
|
-
|
|
66
|
-
/** @internal */
|
|
67
|
-
/** @hidden */
|
|
68
|
-
var BaseCore = exports.BaseCore = /*#__PURE__*/function (_AbstractModel) {
|
|
69
|
-
/**
|
|
70
|
-
* @internal
|
|
71
|
-
*/
|
|
72
|
-
function BaseCore(sdk) {
|
|
73
|
-
var _this;
|
|
74
|
-
(0, _classCallCheck2.default)(this, BaseCore);
|
|
75
|
-
_this = _callSuper(this, BaseCore, [sdk, sdk.__airtableInterface.sdkInitData.baseData.id]);
|
|
76
|
-
/** @internal */
|
|
77
|
-
(0, _defineProperty2.default)(_this, "_tableModelsById", void 0);
|
|
78
|
-
/** @internal */
|
|
79
|
-
(0, _defineProperty2.default)(_this, "_tableRecordStoresByTableId", {});
|
|
80
|
-
/** @internal */
|
|
81
|
-
(0, _defineProperty2.default)(_this, "__billingPlanGrouping", void 0);
|
|
82
|
-
/** @internal */
|
|
83
|
-
(0, _defineProperty2.default)(_this, "_collaboratorIdsByNameAndEmail", null);
|
|
84
|
-
_this._tableModelsById = {}; // Table instances are lazily created by getTableById.
|
|
85
|
-
_this.__billingPlanGrouping = sdk.__airtableInterface.sdkInitData.baseData.billingPlanGrouping;
|
|
86
|
-
return _this;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Aliased to communicate stability for internal use by Sdk code.
|
|
91
|
-
*
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
(0, _inherits2.default)(BaseCore, _AbstractModel);
|
|
95
|
-
return (0, _createClass2.default)(BaseCore, [{
|
|
96
|
-
key: "__sdk",
|
|
97
|
-
get: function get() {
|
|
98
|
-
return this._sdk;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @internal
|
|
103
|
-
*/
|
|
104
|
-
}, {
|
|
105
|
-
key: "_dataOrNullIfDeleted",
|
|
106
|
-
get: function get() {
|
|
107
|
-
return this._baseData;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* The name of the base.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```js
|
|
114
|
-
* import {useBase} from '@airtable/blocks/[placeholder-path]/ui';
|
|
115
|
-
*
|
|
116
|
-
* function MyApp() {
|
|
117
|
-
* const base = useBase();
|
|
118
|
-
* console.log('The name of your base is', base.name);
|
|
119
|
-
* }
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
}, {
|
|
123
|
-
key: "name",
|
|
124
|
-
get: function get() {
|
|
125
|
-
return this._data.name;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* The workspace id of the base.
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```js
|
|
133
|
-
* import {useBase} from '@airtable/blocks/[placeholder-path]/ui';
|
|
134
|
-
*
|
|
135
|
-
* function MyApp() {
|
|
136
|
-
* const base = useBase();
|
|
137
|
-
* console.log('The workspace id of your base is', base.workspaceId);
|
|
138
|
-
* }
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
}, {
|
|
142
|
-
key: "workspaceId",
|
|
143
|
-
get: function get() {
|
|
144
|
-
return this._data.workspaceId;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* The color of the base.
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```js
|
|
152
|
-
* import {colorUtils, useBase} from '@airtable/blocks/[placeholder-path]/ui';
|
|
153
|
-
*
|
|
154
|
-
* function MyApp() {
|
|
155
|
-
* const base = useBase();
|
|
156
|
-
* return (
|
|
157
|
-
* <div style={{backgroundColor: colorUtils.getHexForColor(base.color)}}>
|
|
158
|
-
* This div's background is the same color as the base background
|
|
159
|
-
* </div>
|
|
160
|
-
* );
|
|
161
|
-
* }
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
}, {
|
|
165
|
-
key: "color",
|
|
166
|
-
get: function get() {
|
|
167
|
-
return this._data.color;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The tables in this base. Can be watched to know when tables are created, deleted, or reordered in the base.
|
|
172
|
-
*
|
|
173
|
-
* @example
|
|
174
|
-
* ```js
|
|
175
|
-
* import {useBase} from '@airtable/blocks/[placeholder-path]/ui';
|
|
176
|
-
*
|
|
177
|
-
* function MyApp() {
|
|
178
|
-
* const base = useBase();
|
|
179
|
-
* console.log(`You have ${base.tables.length} tables`);
|
|
180
|
-
* }
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
}, {
|
|
184
|
-
key: "tables",
|
|
185
|
-
get: function get() {
|
|
186
|
-
// TODO(kasra): cache and freeze this so it isn't O(n)
|
|
187
|
-
var tables = [];
|
|
188
|
-
var _iterator = _createForOfIteratorHelper(this._iterateTableIds()),
|
|
189
|
-
_step;
|
|
190
|
-
try {
|
|
191
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
192
|
-
var _tableId = _step.value;
|
|
193
|
-
var table = this.getTableByIdIfExists(_tableId);
|
|
194
|
-
// NOTE: A table's ID may be in tableOrder without the table appearing
|
|
195
|
-
// in tablesById, in which case getTableById will return null. This
|
|
196
|
-
// happens if table was just created by the user, since we
|
|
197
|
-
// wait for the push payload to deliver the table schema.
|
|
198
|
-
if (table) {
|
|
199
|
-
tables.push(table);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
} catch (err) {
|
|
203
|
-
_iterator.e(err);
|
|
204
|
-
} finally {
|
|
205
|
-
_iterator.f();
|
|
206
|
-
}
|
|
207
|
-
return tables;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/** @internal */
|
|
211
|
-
}, {
|
|
212
|
-
key: "activeCollaborators",
|
|
213
|
-
get:
|
|
214
|
-
/**
|
|
215
|
-
* The users who have access to this base.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* ```js
|
|
219
|
-
* import {useBase} from '@airtable/blocks/[placeholder-path]/ui';
|
|
220
|
-
*
|
|
221
|
-
* function MyApp() {
|
|
222
|
-
* const base = useBase();
|
|
223
|
-
* console.log(base.activeCollaborators[0].email);
|
|
224
|
-
* }
|
|
225
|
-
* ```
|
|
226
|
-
*/
|
|
227
|
-
function get() {
|
|
228
|
-
return this._data.activeCollaboratorIds.map(collaboratorId => this.getCollaboratorById(collaboratorId));
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* The user matching the given ID, or `null` if that user does not exist or does not have access
|
|
232
|
-
* to this base.
|
|
233
|
-
*
|
|
234
|
-
* @param collaboratorId The ID of the user.
|
|
235
|
-
*/
|
|
236
|
-
}, {
|
|
237
|
-
key: "getCollaboratorByIdIfExists",
|
|
238
|
-
value: function getCollaboratorByIdIfExists(collaboratorId) {
|
|
239
|
-
var collaboratorsById = this._data.collaboratorsById;
|
|
240
|
-
return (0, _private_utils.has)(collaboratorsById, collaboratorId) ? collaboratorsById[collaboratorId] : null;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* The user matching the given ID. Throws if that user does not exist
|
|
244
|
-
* or does not have access to this base. Use {@link getCollaboratorByIdIfExists}
|
|
245
|
-
* instead if you are unsure whether a collaborator with the given ID exists
|
|
246
|
-
* and has access to this base.
|
|
247
|
-
*
|
|
248
|
-
* @param collaboratorId The ID of the user.
|
|
249
|
-
*/
|
|
250
|
-
}, {
|
|
251
|
-
key: "getCollaboratorById",
|
|
252
|
-
value: function getCollaboratorById(collaboratorId) {
|
|
253
|
-
var collaborator = this.getCollaboratorByIdIfExists(collaboratorId);
|
|
254
|
-
if (!collaborator) {
|
|
255
|
-
throw (0, _error_utils.spawnError)("No collaborator with ID %s has access to base '%s'", collaboratorId, this.name);
|
|
256
|
-
}
|
|
257
|
-
return collaborator;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* The user matching the given ID, name, or email address. Returns null if that user does not
|
|
261
|
-
* exist or does not have access to this base.
|
|
262
|
-
*
|
|
263
|
-
* This method is convenient when building an extension for a specific base, but for more generic
|
|
264
|
-
* extensions the best practice is to use the {@link getCollaboratorByIdIfExists} method instead.
|
|
265
|
-
*
|
|
266
|
-
* @param collaboratorIdOrNameOrEmail The ID of the user.
|
|
267
|
-
*/
|
|
268
|
-
}, {
|
|
269
|
-
key: "getCollaboratorIfExists",
|
|
270
|
-
value: function getCollaboratorIfExists(idOrNameOrEmail) {
|
|
271
|
-
var collaboratorById = this.getCollaboratorByIdIfExists(idOrNameOrEmail);
|
|
272
|
-
if (collaboratorById) {
|
|
273
|
-
return collaboratorById;
|
|
274
|
-
}
|
|
275
|
-
if (!this._collaboratorIdsByNameAndEmail) {
|
|
276
|
-
this._collaboratorIdsByNameAndEmail = new Map();
|
|
277
|
-
var _iterator2 = _createForOfIteratorHelper((0, _private_utils.entries)(this._data.collaboratorsById)),
|
|
278
|
-
_step2;
|
|
279
|
-
try {
|
|
280
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
281
|
-
var _step2$value = (0, _slicedToArray2.default)(_step2.value, 2),
|
|
282
|
-
id = _step2$value[0],
|
|
283
|
-
_step2$value$ = _step2$value[1],
|
|
284
|
-
email = _step2$value$.email,
|
|
285
|
-
name = _step2$value$.name;
|
|
286
|
-
this._collaboratorIdsByNameAndEmail.set(email, id);
|
|
287
|
-
// we prevent `@` in names so theoretically we shouldn't encounter any collisions
|
|
288
|
-
// between names and emails, but names themselves may not be unique. as we build the
|
|
289
|
-
// name hash, we only add new values rather than overwrite existing ones. this means
|
|
290
|
-
// that we'll prefer emails to names in the event of a collision.
|
|
291
|
-
if (name && !this._collaboratorIdsByNameAndEmail.has(name)) {
|
|
292
|
-
this._collaboratorIdsByNameAndEmail.set(name, id);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
} catch (err) {
|
|
296
|
-
_iterator2.e(err);
|
|
297
|
-
} finally {
|
|
298
|
-
_iterator2.f();
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
var idForNameOrEmail = this._collaboratorIdsByNameAndEmail.get(idOrNameOrEmail);
|
|
302
|
-
if (idForNameOrEmail !== undefined) {
|
|
303
|
-
return this.getCollaboratorById(idForNameOrEmail);
|
|
304
|
-
}
|
|
305
|
-
return null;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* The user matching the given ID, name, or email address. Throws if that user does not exist
|
|
309
|
-
* or does not have access to this base. Use {@link getCollaboratorIfExists} instead if you are
|
|
310
|
-
* unsure whether a collaborator with the given ID exists and has access to this base.
|
|
311
|
-
*
|
|
312
|
-
* This method is convenient when building an extension for a specific base, but for more generic
|
|
313
|
-
* extensions the best practice is to use the {@link getCollaboratorById} method instead.
|
|
314
|
-
*
|
|
315
|
-
* @param collaboratorIdOrNameOrEmail The ID of the user.
|
|
316
|
-
*/
|
|
317
|
-
}, {
|
|
318
|
-
key: "getCollaborator",
|
|
319
|
-
value: function getCollaborator(idOrNameOrEmail) {
|
|
320
|
-
var collaborator = this.getCollaboratorIfExists(idOrNameOrEmail);
|
|
321
|
-
if (!collaborator) {
|
|
322
|
-
throw (0, _error_utils.spawnError)("No collaborator with ID, name, or email of '%s' is in base '%s'", idOrNameOrEmail, this.name);
|
|
323
|
-
}
|
|
324
|
-
return collaborator;
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* @internal
|
|
328
|
-
*/
|
|
329
|
-
}, {
|
|
330
|
-
key: "__getBaseData",
|
|
331
|
-
value: function __getBaseData() {
|
|
332
|
-
return this._data;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* The table matching the given ID, or `null` if that table does not exist in this base.
|
|
336
|
-
*
|
|
337
|
-
* @param tableId The ID of the table.
|
|
338
|
-
*/
|
|
339
|
-
}, {
|
|
340
|
-
key: "getTableByIdIfExists",
|
|
341
|
-
value: function getTableByIdIfExists(tableId) {
|
|
342
|
-
if (!this._data.tablesById[tableId]) {
|
|
343
|
-
return null;
|
|
344
|
-
} else {
|
|
345
|
-
if (!this._tableModelsById[tableId]) {
|
|
346
|
-
this._tableModelsById[tableId] = this._constructTable(tableId);
|
|
347
|
-
}
|
|
348
|
-
return this._tableModelsById[tableId];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* The table matching the given ID. Throws if that table does not exist in this base. Use
|
|
353
|
-
* {@link getTableByIdIfExists} instead if you are unsure whether a table exists with the given
|
|
354
|
-
* ID.
|
|
355
|
-
*
|
|
356
|
-
* @param tableId The ID of the table.
|
|
357
|
-
*/
|
|
358
|
-
}, {
|
|
359
|
-
key: "getTableById",
|
|
360
|
-
value: function getTableById(tableId) {
|
|
361
|
-
var table = this.getTableByIdIfExists(tableId);
|
|
362
|
-
if (!table) {
|
|
363
|
-
throw (0, _error_utils.spawnError)("No table with ID %s in base '%s'", tableId, this.name);
|
|
364
|
-
}
|
|
365
|
-
return table;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* The table matching the given name, or `null` if no table exists with that name in this base.
|
|
369
|
-
*
|
|
370
|
-
* @param tableName The name of the table you're looking for.
|
|
371
|
-
*/
|
|
372
|
-
}, {
|
|
373
|
-
key: "getTableByNameIfExists",
|
|
374
|
-
value: function getTableByNameIfExists(tableName) {
|
|
375
|
-
var _iterator3 = _createForOfIteratorHelper((0, _private_utils.entries)(this._data.tablesById)),
|
|
376
|
-
_step3;
|
|
377
|
-
try {
|
|
378
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
379
|
-
var _step3$value = (0, _slicedToArray2.default)(_step3.value, 2),
|
|
380
|
-
_tableId2 = _step3$value[0],
|
|
381
|
-
tableData = _step3$value[1];
|
|
382
|
-
if (tableData.name === tableName) {
|
|
383
|
-
return this.getTableByIdIfExists(_tableId2);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
} catch (err) {
|
|
387
|
-
_iterator3.e(err);
|
|
388
|
-
} finally {
|
|
389
|
-
_iterator3.f();
|
|
390
|
-
}
|
|
391
|
-
return null;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* The table matching the given name. Throws if no table exists with that name in this base. Use
|
|
395
|
-
* {@link getTableByNameIfExists} instead if you are unsure whether a table exists with the
|
|
396
|
-
* given name.
|
|
397
|
-
*
|
|
398
|
-
* @param tableName The name of the table you're looking for.
|
|
399
|
-
*/
|
|
400
|
-
}, {
|
|
401
|
-
key: "getTableByName",
|
|
402
|
-
value: function getTableByName(tableName) {
|
|
403
|
-
var table = this.getTableByNameIfExists(tableName);
|
|
404
|
-
if (!table) {
|
|
405
|
-
throw (0, _error_utils.spawnError)("No table named '%s' in base '%s'", tableName, this.name);
|
|
406
|
-
}
|
|
407
|
-
return table;
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* The table matching the given ID or name. Returns `null` if no matching table exists within
|
|
411
|
-
* this base.
|
|
412
|
-
*
|
|
413
|
-
* This method is convenient when building an extension for a specific base, but for more generic
|
|
414
|
-
* extensions the best practice is to use the {@link getTableByIdIfExists} or
|
|
415
|
-
* {@link getTableByNameIfExists} methods instead.
|
|
416
|
-
*
|
|
417
|
-
* @param tableIdOrName The ID or name of the table you're looking for.
|
|
418
|
-
*/
|
|
419
|
-
}, {
|
|
420
|
-
key: "getTableIfExists",
|
|
421
|
-
value: function getTableIfExists(tableIdOrName) {
|
|
422
|
-
var _this$getTableByIdIfE;
|
|
423
|
-
return (_this$getTableByIdIfE = this.getTableByIdIfExists(tableIdOrName)) !== null && _this$getTableByIdIfE !== void 0 ? _this$getTableByIdIfE : this.getTableByNameIfExists(tableIdOrName);
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* The table matching the given ID or name. Throws if no matching table exists within this base.
|
|
427
|
-
* Use {@link getTableIfExists} instead if you are unsure whether a table exists with the given
|
|
428
|
-
* name/ID.
|
|
429
|
-
*
|
|
430
|
-
* This method is convenient when building an extension for a specific base, but for more generic
|
|
431
|
-
* extensions the best practice is to use the {@link getTableById} or {@link getTableByName} methods
|
|
432
|
-
* instead.
|
|
433
|
-
*
|
|
434
|
-
* @param tableIdOrName The ID or name of the table you're looking for.
|
|
435
|
-
*/
|
|
436
|
-
}, {
|
|
437
|
-
key: "getTable",
|
|
438
|
-
value: function getTable(tableIdOrName) {
|
|
439
|
-
var table = this.getTableIfExists(tableIdOrName);
|
|
440
|
-
if (!table) {
|
|
441
|
-
throw (0, _error_utils.spawnError)("No table with ID or name '%s' in base '%s'", tableIdOrName, this.name);
|
|
442
|
-
}
|
|
443
|
-
return table;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Returns the maximum number of records allowed in each table of this base.
|
|
448
|
-
*/
|
|
449
|
-
}, {
|
|
450
|
-
key: "getMaxRecordsPerTable",
|
|
451
|
-
value: function getMaxRecordsPerTable() {
|
|
452
|
-
var _this$_data$maxRowsPe;
|
|
453
|
-
return (_this$_data$maxRowsPe = this._data.maxRowsPerTable) !== null && _this$_data$maxRowsPe !== void 0 ? _this$_data$maxRowsPe : 100000;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* @internal
|
|
458
|
-
*/
|
|
459
|
-
}, {
|
|
460
|
-
key: "__getRecordStore",
|
|
461
|
-
value: function __getRecordStore(tableId) {
|
|
462
|
-
if ((0, _private_utils.has)(this._tableRecordStoresByTableId, tableId)) {
|
|
463
|
-
return this._tableRecordStoresByTableId[tableId];
|
|
464
|
-
}
|
|
465
|
-
(0, _error_utils.invariant)(this._data.tablesById[tableId], 'table must exist');
|
|
466
|
-
var newRecordStore = this._constructRecordStore(this._sdk, tableId);
|
|
467
|
-
this._tableRecordStoresByTableId[tableId] = newRecordStore;
|
|
468
|
-
return newRecordStore;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* @internal
|
|
473
|
-
*/
|
|
474
|
-
}, {
|
|
475
|
-
key: "__triggerOnChangeForChangedPaths",
|
|
476
|
-
value: function __triggerOnChangeForChangedPaths(changedPaths) {
|
|
477
|
-
var didSchemaChange = false;
|
|
478
|
-
if (changedPaths.name) {
|
|
479
|
-
this._onChange(WatchableBaseKeys.name);
|
|
480
|
-
didSchemaChange = true;
|
|
481
|
-
}
|
|
482
|
-
if (changedPaths.color) {
|
|
483
|
-
this._onChange(WatchableBaseKeys.color);
|
|
484
|
-
didSchemaChange = true;
|
|
485
|
-
}
|
|
486
|
-
var tablesById = changedPaths.tablesById;
|
|
487
|
-
if (tablesById) {
|
|
488
|
-
if ((0, _private_utils.isDeepEqual)(tablesById, {
|
|
489
|
-
_isDirty: true
|
|
490
|
-
})) {
|
|
491
|
-
// If the changedPath is that tablesById is dirty in general, we need to
|
|
492
|
-
// trigger a schema change event. This happens in interface blocks
|
|
493
|
-
// when we reinitialize the tablesById as a whole due to the QueryModels
|
|
494
|
-
// changing. See https://github.com/Hyperbase/hyperbase/blob/b50a8992d333bcef3c906d61886fc69727a8e94b/client/components/blocks/block_frame.tsx#L645
|
|
495
|
-
didSchemaChange = true;
|
|
496
|
-
} else {
|
|
497
|
-
var _iterator4 = _createForOfIteratorHelper((0, _private_utils.entries)(tablesById)),
|
|
498
|
-
_step4;
|
|
499
|
-
try {
|
|
500
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
501
|
-
var _step4$value = (0, _slicedToArray2.default)(_step4.value, 2),
|
|
502
|
-
_tableId3 = _step4$value[0],
|
|
503
|
-
dirtyTablePaths = _step4$value[1];
|
|
504
|
-
var table = this.getTableByIdIfExists(_tableId3);
|
|
505
|
-
if (table && dirtyTablePaths) {
|
|
506
|
-
var didTableSchemaChange = table.__triggerOnChangeForDirtyPaths(dirtyTablePaths);
|
|
507
|
-
if (didTableSchemaChange) {
|
|
508
|
-
didSchemaChange = true;
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
} catch (err) {
|
|
513
|
-
_iterator4.e(err);
|
|
514
|
-
} finally {
|
|
515
|
-
_iterator4.f();
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
if (changedPaths.collaboratorsById || changedPaths.activeCollaboratorIds) {
|
|
520
|
-
this._onChange(WatchableBaseKeys.collaborators);
|
|
521
|
-
}
|
|
522
|
-
if (changedPaths.appInterface) {
|
|
523
|
-
didSchemaChange = true;
|
|
524
|
-
}
|
|
525
|
-
if (didSchemaChange) {
|
|
526
|
-
this._onChange(WatchableBaseKeys.schema);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* @internal
|
|
531
|
-
*/
|
|
532
|
-
}, {
|
|
533
|
-
key: "__applyChangesWithoutTriggeringEvents",
|
|
534
|
-
value: function __applyChangesWithoutTriggeringEvents(changes) {
|
|
535
|
-
// Internal method.
|
|
536
|
-
// After applying all changes, changedPaths will have the same shape as
|
|
537
|
-
// the subset of this._data that changed. For example, if some table's
|
|
538
|
-
// name changes, changedPaths will be {tablesById: {tbl123: name: {_isDirty: true}}}.
|
|
539
|
-
// Use it to call __triggerOnChangeForChangedPaths to trigger change events for
|
|
540
|
-
// effected models
|
|
541
|
-
var changedPaths = {};
|
|
542
|
-
var _iterator5 = _createForOfIteratorHelper(changes),
|
|
543
|
-
_step5;
|
|
544
|
-
try {
|
|
545
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
546
|
-
var change = _step5.value;
|
|
547
|
-
this._applyChange(change.path, change.value, changedPaths);
|
|
548
|
-
}
|
|
549
|
-
} catch (err) {
|
|
550
|
-
_iterator5.e(err);
|
|
551
|
-
} finally {
|
|
552
|
-
_iterator5.f();
|
|
553
|
-
}
|
|
554
|
-
return changedPaths;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* @internal
|
|
558
|
-
*/
|
|
559
|
-
}, {
|
|
560
|
-
key: "_applyChange",
|
|
561
|
-
value: function _applyChange(path, value, changedPathsByRef) {
|
|
562
|
-
var dataSubtree = this._data;
|
|
563
|
-
var dirtySubtree = changedPathsByRef;
|
|
564
|
-
for (var i = 0; i < path.length - 1; i++) {
|
|
565
|
-
var part = path[i];
|
|
566
|
-
if (!dataSubtree[part]) {
|
|
567
|
-
// Certain fields are stored sparsely (e.g. cellValuesByFieldId),
|
|
568
|
-
// so create an object on demand if needed.
|
|
569
|
-
dataSubtree[part] = {};
|
|
570
|
-
}
|
|
571
|
-
dataSubtree = dataSubtree[part];
|
|
572
|
-
if (!dirtySubtree[part]) {
|
|
573
|
-
dirtySubtree[part] = {};
|
|
574
|
-
}
|
|
575
|
-
(0, _error_utils.invariant)(dirtySubtree[part], 'dirtySubtree');
|
|
576
|
-
dirtySubtree = dirtySubtree[part];
|
|
577
|
-
}
|
|
578
|
-
var lastPathPart = path[path.length - 1];
|
|
579
|
-
var didChange = !(0, _private_utils.isDeepEqual)(dataSubtree[lastPathPart], value);
|
|
580
|
-
if (value === undefined) {
|
|
581
|
-
delete dataSubtree[lastPathPart];
|
|
582
|
-
} else {
|
|
583
|
-
dataSubtree[lastPathPart] = value;
|
|
584
|
-
}
|
|
585
|
-
if (didChange) {
|
|
586
|
-
if (!dirtySubtree[lastPathPart]) {
|
|
587
|
-
dirtySubtree[lastPathPart] = {};
|
|
588
|
-
}
|
|
589
|
-
(0, _error_utils.invariant)(dirtySubtree[lastPathPart], 'dirtySubtree');
|
|
590
|
-
dirtySubtree[lastPathPart]._isDirty = true;
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
}], [{
|
|
594
|
-
key: "_isWatchableKey",
|
|
595
|
-
value: /** @internal */
|
|
596
|
-
function _isWatchableKey(key) {
|
|
597
|
-
return (0, _private_utils.isEnumValue)(WatchableBaseKeys, key);
|
|
598
|
-
}
|
|
599
|
-
}]);
|
|
600
|
-
}(_abstract_model.default);
|
|
601
|
-
/** @internal */
|
|
602
|
-
(0, _defineProperty2.default)(BaseCore, "_className", 'BaseCore');
|