@airtable/blocks 0.0.0-experimental-f52bc4e5e-20250709 → 0.0.0-experimental-75d011284-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/cjs/base/assert_run_context.js +12 -0
- package/dist/cjs/base/index.js +30 -30
- package/dist/cjs/base/models/abstract_model_with_async_data.js +154 -237
- package/dist/cjs/base/models/base.js +188 -267
- package/dist/cjs/base/models/create_aggregators.js +29 -46
- package/dist/cjs/base/models/cursor.js +206 -294
- package/dist/cjs/base/models/field.js +307 -395
- package/dist/cjs/base/models/grouped_record_query_result.js +219 -338
- package/dist/cjs/base/models/linked_records_query_result.js +450 -625
- package/dist/cjs/base/models/models.js +19 -22
- package/dist/cjs/base/models/mutations.js +267 -293
- package/dist/cjs/base/models/object_pool.js +117 -156
- package/dist/cjs/base/models/record.js +191 -256
- package/dist/cjs/base/models/record_coloring.js +6 -6
- package/dist/cjs/base/models/record_query_result.js +351 -435
- package/dist/cjs/base/models/record_store.js +403 -753
- package/dist/cjs/base/models/session.js +125 -153
- package/dist/cjs/base/models/table.js +457 -605
- package/dist/cjs/base/models/table_or_view_query_result.js +656 -920
- package/dist/cjs/base/models/view.js +284 -389
- package/dist/cjs/base/models/view_data_store.js +218 -356
- package/dist/cjs/base/models/view_metadata_query_result.js +109 -157
- package/dist/cjs/base/perform_record_action.js +89 -131
- package/dist/cjs/base/sdk.js +129 -184
- package/dist/cjs/base/settings_button.js +54 -74
- package/dist/cjs/base/types/airtable_interface.js +1 -1
- package/dist/cjs/base/types/mutations.js +5 -11
- package/dist/cjs/base/types/undo_redo.js +1 -1
- package/dist/cjs/base/types/view.js +1 -1
- package/dist/cjs/base/ui/base_provider.js +6 -8
- package/dist/cjs/base/ui/baymax_utils.js +436 -108
- package/dist/cjs/base/ui/block_wrapper.js +81 -106
- package/dist/cjs/base/ui/box.js +34 -60
- package/dist/cjs/base/ui/button.js +44 -74
- package/dist/cjs/base/ui/cell_renderer.js +132 -189
- package/dist/cjs/base/ui/choice_token.js +25 -42
- package/dist/cjs/base/ui/collaborator_token.js +31 -53
- package/dist/cjs/base/ui/color_palette.js +130 -173
- package/dist/cjs/base/ui/color_palette_synced.js +41 -70
- package/dist/cjs/base/ui/confirmation_dialog.js +70 -120
- package/dist/cjs/base/ui/control_sizes.js +24 -22
- package/dist/cjs/base/ui/create_detect_element_resize.js +6 -10
- package/dist/cjs/base/ui/css_helpers.js +1 -1
- package/dist/cjs/base/ui/dialog.js +57 -98
- package/dist/cjs/base/ui/dialog_close_button.js +52 -98
- package/dist/cjs/base/ui/expand_record.js +1 -2
- package/dist/cjs/base/ui/expand_record_list.js +3 -4
- package/dist/cjs/base/ui/expand_record_picker_async.js +28 -57
- package/dist/cjs/base/ui/field_icon.js +15 -33
- package/dist/cjs/base/ui/field_picker.js +25 -70
- package/dist/cjs/base/ui/field_picker_synced.js +18 -40
- package/dist/cjs/base/ui/form_field.js +27 -55
- package/dist/cjs/base/ui/geometry/geometry.js +5 -5
- package/dist/cjs/base/ui/geometry/point.js +10 -12
- package/dist/cjs/base/ui/geometry/rect.js +36 -52
- package/dist/cjs/base/ui/geometry/size.js +10 -12
- package/dist/cjs/base/ui/global_alert.js +31 -52
- package/dist/cjs/base/ui/heading.js +45 -94
- package/dist/cjs/base/ui/icon.js +39 -59
- package/dist/cjs/base/ui/icon_config.js +6 -12
- package/dist/cjs/base/ui/initialize_block.js +16 -35
- package/dist/cjs/base/ui/input.js +62 -101
- package/dist/cjs/base/ui/input_synced.js +17 -40
- package/dist/cjs/base/ui/key_codes.js +2 -3
- package/dist/cjs/base/ui/label.js +30 -55
- package/dist/cjs/base/ui/link.js +54 -87
- package/dist/cjs/base/ui/loader.js +15 -36
- package/dist/cjs/base/ui/modal.js +88 -127
- package/dist/cjs/base/ui/model_picker_select.js +18 -44
- package/dist/cjs/base/ui/popover.js +236 -328
- package/dist/cjs/base/ui/progress_bar.js +34 -47
- package/dist/cjs/base/ui/record_card.js +389 -478
- package/dist/cjs/base/ui/record_card_list.js +150 -224
- package/dist/cjs/base/ui/select.js +60 -116
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +15 -39
- package/dist/cjs/base/ui/select_buttons.js +50 -83
- package/dist/cjs/base/ui/select_buttons_synced.js +17 -39
- package/dist/cjs/base/ui/select_synced.js +17 -39
- package/dist/cjs/base/ui/switch.js +42 -71
- package/dist/cjs/base/ui/switch_synced.js +16 -38
- package/dist/cjs/base/ui/synced.js +27 -48
- package/dist/cjs/base/ui/system/all_styles_set.js +4 -12
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +10 -13
- package/dist/cjs/base/ui/system/appearance/background_color.js +3 -6
- package/dist/cjs/base/ui/system/appearance/border.js +3 -6
- package/dist/cjs/base/ui/system/appearance/border_radius.js +3 -6
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +3 -6
- package/dist/cjs/base/ui/system/appearance/opacity.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +11 -13
- package/dist/cjs/base/ui/system/dimensions/height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/max_height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/max_width.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/min_height.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/min_width.js +3 -6
- package/dist/cjs/base/ui/system/dimensions/width.js +3 -6
- package/dist/cjs/base/ui/system/display.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/align_content.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/align_items.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +11 -13
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +3 -6
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/align_self.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +12 -13
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +3 -6
- package/dist/cjs/base/ui/system/flex_item/order.js +3 -6
- package/dist/cjs/base/ui/system/index.js +104 -416
- package/dist/cjs/base/ui/system/overflow.js +3 -6
- package/dist/cjs/base/ui/system/position/bottom.js +4 -6
- package/dist/cjs/base/ui/system/position/left.js +4 -6
- package/dist/cjs/base/ui/system/position/position.js +3 -6
- package/dist/cjs/base/ui/system/position/position_set.js +11 -13
- package/dist/cjs/base/ui/system/position/right.js +4 -6
- package/dist/cjs/base/ui/system/position/top.js +4 -6
- package/dist/cjs/base/ui/system/position/z_index.js +3 -6
- package/dist/cjs/base/ui/system/spacing/margin.js +4 -6
- package/dist/cjs/base/ui/system/spacing/padding.js +4 -6
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +7 -13
- package/dist/cjs/base/ui/system/typography/font_family.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_size.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_style.js +3 -6
- package/dist/cjs/base/ui/system/typography/font_weight.js +3 -6
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +3 -6
- package/dist/cjs/base/ui/system/typography/line_height.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_align.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_color.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_decoration.js +3 -6
- package/dist/cjs/base/ui/system/typography/text_transform.js +3 -6
- package/dist/cjs/base/ui/system/typography/typography_set.js +15 -13
- package/dist/cjs/base/ui/system/utils/ensure_numbers_are_within_scale.js +3 -4
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +47 -87
- package/dist/cjs/base/ui/table_picker.js +18 -42
- package/dist/cjs/base/ui/table_picker_synced.js +17 -39
- package/dist/cjs/base/ui/text.js +40 -73
- package/dist/cjs/base/ui/text_button.js +51 -83
- package/dist/cjs/base/ui/theme/default_theme/button_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +51 -45
- package/dist/cjs/base/ui/theme/default_theme/heading_styles.js +1 -1
- package/dist/cjs/base/ui/theme/default_theme/index.js +9 -15
- package/dist/cjs/base/ui/theme/default_theme/input_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/link_variants.js +3 -3
- package/dist/cjs/base/ui/theme/default_theme/select_buttons_variants.js +4 -4
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +8 -17
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +23 -29
- package/dist/cjs/base/ui/theme/default_theme/text_button_variants.js +5 -5
- package/dist/cjs/base/ui/theme/default_theme/text_styles.js +1 -1
- package/dist/cjs/base/ui/theme/default_theme/tokens.js +14 -14
- package/dist/cjs/base/ui/theme/theme_context.js +2 -2
- package/dist/cjs/base/ui/theme/use_theme.js +2 -2
- package/dist/cjs/base/ui/tooltip.js +134 -174
- package/dist/cjs/base/ui/types/aria_props.js +1 -23
- package/dist/cjs/base/ui/types/data_attributes_prop.js +1 -18
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +1 -17
- package/dist/cjs/base/ui/ui.js +48 -49
- package/dist/cjs/base/ui/unstable_standalone_ui.js +27 -27
- package/dist/cjs/base/ui/use_base.js +1 -1
- package/dist/cjs/base/ui/use_cursor.js +5 -4
- package/dist/cjs/base/ui/use_form_field.js +1 -1
- package/dist/cjs/base/ui/use_loadable.js +25 -91
- package/dist/cjs/base/ui/use_record_action_data.js +4 -3
- package/dist/cjs/base/ui/use_records.js +9 -13
- package/dist/cjs/base/ui/use_session.js +1 -1
- package/dist/cjs/base/ui/use_settings_button.js +4 -3
- package/dist/cjs/base/ui/use_styled_system.js +7 -14
- package/dist/cjs/base/ui/use_text_color_for_background_color.js +4 -3
- package/dist/cjs/base/ui/use_view_metadata.js +4 -4
- package/dist/cjs/base/ui/use_viewport.js +2 -2
- package/dist/cjs/base/ui/view_picker.js +26 -70
- package/dist/cjs/base/ui/view_picker_synced.js +18 -40
- package/dist/cjs/base/ui/viewport_constraint.js +67 -114
- package/dist/cjs/base/ui/with_styled_system.js +25 -61
- package/dist/cjs/base/undo_redo.js +21 -32
- package/dist/cjs/base/unstable_testing_utils.js +27 -27
- package/dist/cjs/base/viewport.js +268 -312
- package/dist/cjs/injected/airtable_interface.js +4 -4
- package/dist/cjs/interface/assert_run_context.js +12 -0
- package/dist/cjs/interface/index.js +4 -18
- package/dist/cjs/interface/models/base.js +15 -34
- package/dist/cjs/interface/models/field.js +5 -19
- package/dist/cjs/interface/models/models.js +8 -7
- package/dist/cjs/interface/models/mutations.js +50 -66
- package/dist/cjs/interface/models/record.js +29 -49
- package/dist/cjs/interface/models/record_store.js +25 -57
- package/dist/cjs/interface/models/session.js +2 -16
- package/dist/cjs/interface/models/table.js +66 -95
- package/dist/cjs/interface/sdk.js +61 -87
- package/dist/cjs/interface/types/airtable_interface.js +2 -2
- package/dist/cjs/interface/types/mutations.js +3 -10
- package/dist/cjs/interface/ui/block_wrapper.js +56 -48
- package/dist/cjs/interface/ui/initialize_block.js +13 -28
- package/dist/cjs/interface/ui/ui.js +20 -19
- package/dist/cjs/interface/ui/use_base.js +1 -1
- package/dist/cjs/interface/ui/use_custom_properties.js +19 -35
- package/dist/cjs/interface/ui/use_records.js +6 -5
- package/dist/cjs/interface/ui/use_run_info.js +2 -2
- package/dist/cjs/interface/ui/use_session.js +1 -1
- package/dist/cjs/shared/color_utils.js +9 -16
- package/dist/cjs/shared/colors.js +2 -2
- package/dist/cjs/shared/error_utils.js +9 -11
- package/dist/cjs/shared/event_tracker.js +3 -3
- package/dist/cjs/shared/global_config.js +337 -449
- package/dist/cjs/shared/models/abstract_model.js +72 -97
- package/dist/cjs/shared/models/base_core.js +394 -514
- package/dist/cjs/shared/models/field_core.js +236 -279
- package/dist/cjs/shared/models/mutations_core.js +283 -379
- package/dist/cjs/shared/models/record_core.js +174 -231
- package/dist/cjs/shared/models/record_store_core.js +119 -172
- package/dist/cjs/shared/models/session_core.js +116 -170
- package/dist/cjs/shared/models/table_core.js +1258 -1501
- package/dist/cjs/shared/private_utils.js +54 -124
- package/dist/cjs/shared/sdk_core.js +68 -70
- package/dist/cjs/shared/types/field_core.js +1 -1
- package/dist/cjs/shared/types/mutation_constants.js +4 -4
- package/dist/cjs/shared/types/mutations_core.js +1 -1
- package/dist/cjs/shared/types/permission_levels.js +1 -1
- package/dist/cjs/shared/ui/global_config_synced_component_helpers.js +9 -9
- package/dist/cjs/shared/ui/loader.js +14 -35
- package/dist/cjs/shared/ui/remote_utils.js +5 -7
- package/dist/cjs/shared/ui/sdk_context.js +4 -8
- package/dist/cjs/shared/ui/use_array_identity.js +2 -2
- package/dist/cjs/shared/ui/use_base.js +6 -5
- package/dist/cjs/shared/ui/use_color_scheme.js +3 -8
- package/dist/cjs/shared/ui/use_global_config.js +5 -4
- package/dist/cjs/shared/ui/use_session.js +6 -5
- package/dist/cjs/shared/ui/use_synced.js +7 -5
- package/dist/cjs/shared/ui/use_watchable.js +13 -42
- package/dist/cjs/shared/ui/with_hooks.js +6 -13
- package/dist/cjs/shared/unstable_private_utils.js +4 -6
- package/dist/cjs/shared/warning.js +5 -5
- package/dist/cjs/shared/watchable.js +110 -176
- package/dist/cjs/stats/block_stats.js +62 -85
- package/dist/cjs/testing/base/abstract_mock_airtable_interface.js +208 -0
- package/dist/cjs/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/models.d.ts +1 -0
- 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/package.json +13 -13
- 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/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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _airtable_interface = _interopRequireDefault(require("../injected/airtable_interface"));
|
|
4
|
+
var _error_utils = require("../shared/error_utils");
|
|
5
|
+
var _airtable_interface2 = require("./types/airtable_interface");
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
if (window.__getAirtableInterfaceAtVersion) {
|
|
8
|
+
const runContextType = (0, _airtable_interface.default)().sdkInitData.runContext.type;
|
|
9
|
+
if (runContextType !== _airtable_interface2.BlockRunContextType.PAGE_ELEMENT_IN_QUERY_CONTAINER) {
|
|
10
|
+
throw (0, _error_utils.spawnError)('Unexpected import when running block in interface');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.__reset = __reset;
|
|
8
|
-
exports.runInfo = exports.reload = exports.installationId = exports.globalConfig = exports.base = exports.__sdk = void 0;
|
|
9
7
|
var _warning = require("../shared/warning");
|
|
10
8
|
var _airtable_interface = _interopRequireDefault(require("../injected/airtable_interface"));
|
|
11
|
-
var
|
|
9
|
+
var _sdk = require("./sdk");
|
|
12
10
|
var _initialize_block = require("./ui/initialize_block");
|
|
13
|
-
|
|
14
|
-
var __sdk;
|
|
15
|
-
var base;
|
|
16
|
-
var globalConfig;
|
|
17
|
-
var installationId;
|
|
18
|
-
var reload;
|
|
19
|
-
var runInfo;
|
|
20
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
12
|
/** @internal */
|
|
22
13
|
function __reset() {
|
|
23
|
-
|
|
14
|
+
const __sdk = new _sdk.InterfaceBlockSdk((0, _airtable_interface.default)());
|
|
15
|
+
|
|
24
16
|
// The following injections are necessary to allow the referenced modules
|
|
25
17
|
// to be imported directly by consumer code while also avoiding cycles in
|
|
26
18
|
// the module dependency graph.
|
|
27
|
-
var _sdk = __sdk;
|
|
28
|
-
exports.base = base = _sdk.base;
|
|
29
|
-
exports.globalConfig = globalConfig = _sdk.globalConfig;
|
|
30
|
-
exports.installationId = installationId = _sdk.installationId;
|
|
31
|
-
exports.reload = reload = _sdk.reload;
|
|
32
|
-
exports.runInfo = runInfo = _sdk.runInfo;
|
|
33
19
|
(0, _initialize_block.__injectSdkIntoInitializeBlock)(__sdk);
|
|
34
20
|
(0, _warning.__injectSdkIntoWarning)(__sdk);
|
|
35
21
|
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.Base = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
7
|
var _base_core = require("../../shared/models/base_core");
|
|
14
8
|
var _table = require("./table");
|
|
15
9
|
var _record_store = require("./record_store");
|
|
16
|
-
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)); }
|
|
17
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
10
|
/**
|
|
19
11
|
* Model class representing a base.
|
|
20
12
|
*
|
|
@@ -23,32 +15,21 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
15
|
*
|
|
24
16
|
* @docsPath models/Base
|
|
25
17
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
class Base extends _base_core.BaseCore {
|
|
19
|
+
/** @internal */
|
|
20
|
+
_constructTable(tableId) {
|
|
21
|
+
const recordStore = this.__getRecordStore(tableId);
|
|
22
|
+
return new _table.Table(this, recordStore, tableId, this._sdk);
|
|
30
23
|
}
|
|
31
|
-
(0, _inherits2.default)(Base, _BaseCore);
|
|
32
|
-
return (0, _createClass2.default)(Base, [{
|
|
33
|
-
key: "_constructTable",
|
|
34
|
-
value: /** @internal */
|
|
35
|
-
function _constructTable(tableId) {
|
|
36
|
-
var recordStore = this.__getRecordStore(tableId);
|
|
37
|
-
return new _table.Table(this, recordStore, tableId, this._sdk);
|
|
38
|
-
}
|
|
39
24
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return new _record_store.RecordStore(sdk, tableId);
|
|
45
|
-
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
_constructRecordStore(sdk, tableId) {
|
|
27
|
+
return new _record_store.RecordStore(sdk, tableId);
|
|
28
|
+
}
|
|
46
29
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}]);
|
|
54
|
-
}(_base_core.BaseCore);
|
|
30
|
+
/** @internal */
|
|
31
|
+
_iterateTableIds() {
|
|
32
|
+
return Object.keys(this._data.tablesById);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.Base = Base;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.Field = void 0;
|
|
8
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
7
|
var _field_core = require("../../shared/models/field_core");
|
|
15
|
-
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)); }
|
|
16
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
8
|
/**
|
|
18
9
|
* Model class representing a field in a table.
|
|
19
10
|
*
|
|
@@ -30,13 +21,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
30
21
|
* ```
|
|
31
22
|
* @docsPath models/Field
|
|
32
23
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(0, _inherits2.default)(Field, _FieldCore);
|
|
39
|
-
return (0, _createClass2.default)(Field);
|
|
40
|
-
}(_field_core.FieldCore);
|
|
41
|
-
/** @internal */
|
|
42
|
-
(0, _defineProperty2.default)(Field, "_className", 'Field');
|
|
24
|
+
class Field extends _field_core.FieldCore {
|
|
25
|
+
/** @internal */
|
|
26
|
+
static _className = 'Field';
|
|
27
|
+
}
|
|
28
|
+
exports.Field = Field;
|
|
@@ -5,46 +5,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "Base", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _base.Base;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "Field", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _field.Field;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "FieldConfig", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _field_core.FieldConfig;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "FieldType", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _field_core.FieldType;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "Record", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function
|
|
32
|
+
get: function () {
|
|
33
33
|
return _record.Record;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "Session", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function
|
|
38
|
+
get: function () {
|
|
39
39
|
return _session.Session;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "Table", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function
|
|
44
|
+
get: function () {
|
|
45
45
|
return _table.Table;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
require("../assert_run_context");
|
|
48
49
|
var _field_core = require("../../shared/types/field_core");
|
|
49
50
|
var _base = require("./base");
|
|
50
51
|
var _table = require("./table");
|
|
@@ -1,79 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.Mutations = void 0;
|
|
8
|
-
require("core-js/modules/es.array.filter.js");
|
|
9
|
-
require("core-js/modules/es.array.iterator.js");
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
11
|
-
require("core-js/modules/es.set.js");
|
|
12
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
17
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
7
|
var _mutations_core = require("../../shared/models/mutations_core");
|
|
20
8
|
var _mutations = require("../types/mutations");
|
|
21
|
-
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)); }
|
|
22
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
9
|
/** @hidden */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
10
|
+
class Mutations extends _mutations_core.MutationsCore {
|
|
11
|
+
/** @internal */
|
|
12
|
+
_isRecordStoreReadyForMutations() {
|
|
13
|
+
return true;
|
|
28
14
|
}
|
|
29
|
-
(0, _inherits2.default)(Mutations, _MutationsCore);
|
|
30
|
-
return (0, _createClass2.default)(Mutations, [{
|
|
31
|
-
key: "_isRecordStoreReadyForMutations",
|
|
32
|
-
value: /** @internal */
|
|
33
|
-
function _isRecordStoreReadyForMutations() {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
15
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
_isFieldAvailableForMutation() {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
43
20
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
21
|
+
/** @internal */
|
|
22
|
+
_getDefaultRecordProperties() {
|
|
23
|
+
return {
|
|
24
|
+
createdTime: new Date().toJSON()
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
_getOptimisticModelChangesForMutation(mutation) {
|
|
30
|
+
switch (mutation.type) {
|
|
31
|
+
case _mutations.MutationTypes.CREATE_MULTIPLE_RECORDS:
|
|
32
|
+
{
|
|
33
|
+
// Ideally, we'd add the recordIds to the `recordOrder` of the Table (see
|
|
34
|
+
// how we optimistically remove from this in the DELETE_MULTIPLE_RECORDS
|
|
35
|
+
// case below). But we can't really do that because we don't know how to
|
|
36
|
+
// sort the records. As a result, we'll just optimistically add the records
|
|
37
|
+
// to the store, so if the developer calls `getRecordById` for a recordId
|
|
38
|
+
// that was just created, it will exist. But if they are iterating over
|
|
39
|
+
// all records, they will only get the new records once the mutation is
|
|
40
|
+
// applied and liveapp sends an update to the recordOrder.
|
|
41
|
+
return super._getOptimisticModelChangesForMutation(mutation);
|
|
42
|
+
}
|
|
43
|
+
case _mutations.MutationTypes.DELETE_MULTIPLE_RECORDS:
|
|
44
|
+
{
|
|
45
|
+
const {
|
|
46
|
+
tableId,
|
|
47
|
+
recordIds: deletedRecordIds
|
|
48
|
+
} = mutation;
|
|
49
|
+
const recordStore = this._base.__getRecordStore(tableId);
|
|
50
|
+
const deletedRecordIdsSet = new Set(deletedRecordIds);
|
|
51
|
+
return [{
|
|
52
|
+
path: ['tablesById', tableId, 'recordOrder'],
|
|
53
|
+
value: recordStore.recordIds.filter(recordId => !deletedRecordIdsSet.has(recordId))
|
|
54
|
+
}, ...super._getOptimisticModelChangesForMutation(mutation)];
|
|
55
|
+
}
|
|
56
|
+
default:
|
|
57
|
+
{
|
|
58
|
+
return super._getOptimisticModelChangesForMutation(mutation);
|
|
59
|
+
}
|
|
77
60
|
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.Mutations = Mutations;
|
|
@@ -1,34 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.array.filter.js");
|
|
5
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
6
|
-
require("core-js/modules/es.object.to-string.js");
|
|
7
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
8
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
9
3
|
Object.defineProperty(exports, "__esModule", {
|
|
10
4
|
value: true
|
|
11
5
|
});
|
|
12
6
|
exports.Record = void 0;
|
|
13
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
7
|
var _error_utils = require("../../shared/error_utils");
|
|
20
8
|
var _record_core = require("../../shared/models/record_core");
|
|
21
9
|
var _field_core = require("../../shared/types/field_core");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
-
var WatchableRecordKeys = Object.freeze(_objectSpread({}, _record_core.WatchableRecordKeysCore));
|
|
10
|
+
const WatchableRecordKeys = Object.freeze({
|
|
11
|
+
..._record_core.WatchableRecordKeysCore
|
|
12
|
+
});
|
|
27
13
|
/**
|
|
28
14
|
* Any key within record that can be watched:
|
|
29
15
|
* - `'name'`
|
|
30
16
|
* - `'cellValues'`
|
|
31
17
|
*/
|
|
18
|
+
|
|
32
19
|
/**
|
|
33
20
|
* Model class representing a record in a table.
|
|
34
21
|
*
|
|
@@ -36,36 +23,29 @@ var WatchableRecordKeys = Object.freeze(_objectSpread({}, _record_core.Watchable
|
|
|
36
23
|
*
|
|
37
24
|
* @docsPath models/Record
|
|
38
25
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (field.parentTable !== parentTable) {
|
|
60
|
-
throw (0, _error_utils.spawnError)('Field %s is not in the same table as the record', field.name);
|
|
61
|
-
}
|
|
62
|
-
if (field.type !== _field_core.FieldType.MULTIPLE_RECORD_LINKS) {
|
|
63
|
-
throw (0, _error_utils.spawnError)('Field %s is not a multiple record links field', field.name);
|
|
64
|
-
}
|
|
65
|
-
var airtableInterface = this.parentTable.parentBase.__sdk.__airtableInterface;
|
|
66
|
-
return airtableInterface.fetchForeignRecordsAsync(parentTable.id, this.id, field.id, filterString);
|
|
26
|
+
class Record extends _record_core.RecordCore {
|
|
27
|
+
/** @internal */
|
|
28
|
+
static _className = 'Record';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Fetch foreign records for a field. Subsequent calls to this method will
|
|
32
|
+
* override previous calls that are still pending. The previous call(s)
|
|
33
|
+
* will immediately resolve with an empty `records` array.
|
|
34
|
+
*
|
|
35
|
+
* @param fieldId - The ID of the field to fetch foreign records for.
|
|
36
|
+
* @param filterString - The filter string to use to filter the records.
|
|
37
|
+
* @returns A promise that resolves to the foreign records.
|
|
38
|
+
*/
|
|
39
|
+
fetchForeignRecordsAsync(field, filterString) {
|
|
40
|
+
const parentTable = this.parentTable;
|
|
41
|
+
if (field.parentTable !== parentTable) {
|
|
42
|
+
throw (0, _error_utils.spawnError)('Field %s is not in the same table as the record', field.name);
|
|
43
|
+
}
|
|
44
|
+
if (field.type !== _field_core.FieldType.MULTIPLE_RECORD_LINKS) {
|
|
45
|
+
throw (0, _error_utils.spawnError)('Field %s is not a multiple record links field', field.name);
|
|
67
46
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
const airtableInterface = this.parentTable.parentBase.__sdk.__airtableInterface;
|
|
48
|
+
return airtableInterface.fetchForeignRecordsAsync(parentTable.id, this.id, field.id, filterString);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.Record = Record;
|
|
@@ -1,83 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
|
4
|
-
require("core-js/modules/es.array.filter.js");
|
|
5
|
-
require("core-js/modules/es.array.iterator.js");
|
|
6
|
-
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
7
|
-
require("core-js/modules/es.object.to-string.js");
|
|
8
|
-
require("core-js/modules/es.weak-map.js");
|
|
9
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
10
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
12
3
|
Object.defineProperty(exports, "__esModule", {
|
|
13
4
|
value: true
|
|
14
5
|
});
|
|
15
6
|
exports.RecordStore = void 0;
|
|
16
|
-
require("core-js/modules/es.string.starts-with.js");
|
|
17
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
18
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
20
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
21
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
22
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
24
7
|
var _record_store_core = _interopRequireWildcard(require("../../shared/models/record_store_core"));
|
|
25
8
|
var _private_utils = require("../../shared/private_utils");
|
|
26
9
|
var _record = require("./record");
|
|
27
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
|
-
var WatchableRecordStoreKeys = Object.freeze(_objectSpread(_objectSpread({}, _record_store_core.WatchableRecordStoreKeysCore), {}, {
|
|
12
|
+
const WatchableRecordStoreKeys = Object.freeze({
|
|
13
|
+
..._record_store_core.WatchableRecordStoreKeysCore,
|
|
34
14
|
recordOrder: 'recordOrder'
|
|
35
|
-
})
|
|
15
|
+
});
|
|
36
16
|
|
|
37
17
|
/**
|
|
38
18
|
* The string case is to accommodate prefix keys
|
|
39
19
|
*
|
|
40
20
|
* @internal
|
|
41
21
|
*/
|
|
22
|
+
|
|
42
23
|
/**
|
|
43
24
|
* One RecordStore exists per table, and contains all the record data associated with that table.
|
|
44
25
|
* Table itself is for schema information only, so isn't the appropriate place for this data.
|
|
45
26
|
*
|
|
46
27
|
* @internal
|
|
47
28
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return
|
|
29
|
+
class RecordStore extends _record_store_core.default {
|
|
30
|
+
static _className = 'RecordStore';
|
|
31
|
+
static _isWatchableKey(key) {
|
|
32
|
+
return (0, _private_utils.isEnumValue)(WatchableRecordStoreKeys, key) || key.startsWith(_record_store_core.WatchableCellValuesInFieldKeyPrefix);
|
|
33
|
+
}
|
|
34
|
+
_constructRecord(recordId, parentTable) {
|
|
35
|
+
return new _record.Record(this._sdk, this, parentTable, recordId);
|
|
52
36
|
}
|
|
53
|
-
(0, _inherits2.default)(RecordStore, _RecordStoreCore);
|
|
54
|
-
return (0, _createClass2.default)(RecordStore, [{
|
|
55
|
-
key: "_constructRecord",
|
|
56
|
-
value: function _constructRecord(recordId, parentTable) {
|
|
57
|
-
return new _record.Record(this._sdk, this, parentTable, recordId);
|
|
58
|
-
}
|
|
59
37
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
value: function triggerOnChangeForDirtyPaths(dirtyPaths) {
|
|
71
|
-
(0, _get2.default)((0, _getPrototypeOf2.default)(RecordStore.prototype), "triggerOnChangeForDirtyPaths", this).call(this, dirtyPaths);
|
|
72
|
-
if (dirtyPaths.recordOrder) {
|
|
73
|
-
this._onChange(WatchableRecordStoreKeys.recordOrder);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}], [{
|
|
77
|
-
key: "_isWatchableKey",
|
|
78
|
-
value: function _isWatchableKey(key) {
|
|
79
|
-
return (0, _private_utils.isEnumValue)(WatchableRecordStoreKeys, key) || key.startsWith(_record_store_core.WatchableCellValuesInFieldKeyPrefix);
|
|
38
|
+
/**
|
|
39
|
+
* The record Ids in this table.
|
|
40
|
+
*/
|
|
41
|
+
get recordIds() {
|
|
42
|
+
return this._data.recordOrder;
|
|
43
|
+
}
|
|
44
|
+
triggerOnChangeForDirtyPaths(dirtyPaths) {
|
|
45
|
+
super.triggerOnChangeForDirtyPaths(dirtyPaths);
|
|
46
|
+
if (dirtyPaths.recordOrder) {
|
|
47
|
+
this._onChange(WatchableRecordStoreKeys.recordOrder);
|
|
80
48
|
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.RecordStore = RecordStore;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.Session = void 0;
|
|
8
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
7
|
var _session_core = require("../../shared/models/session_core");
|
|
14
|
-
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)); }
|
|
15
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
8
|
/**
|
|
17
9
|
* Model class representing the current user's session.
|
|
18
10
|
*
|
|
@@ -32,11 +24,5 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
32
24
|
* ```
|
|
33
25
|
* @docsPath models/Session
|
|
34
26
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(0, _classCallCheck2.default)(this, Session);
|
|
38
|
-
return _callSuper(this, Session, arguments);
|
|
39
|
-
}
|
|
40
|
-
(0, _inherits2.default)(Session, _SessionCore);
|
|
41
|
-
return (0, _createClass2.default)(Session);
|
|
42
|
-
}(_session_core.SessionCore);
|
|
27
|
+
class Session extends _session_core.SessionCore {}
|
|
28
|
+
exports.Session = Session;
|