@airtable/blocks 1.18.0 → 1.18.2
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/CHANGELOG.md +552 -0
- package/dist/cjs/color_utils.js +21 -23
- package/dist/cjs/colors.js +4 -60
- package/dist/cjs/error_utils.js +15 -25
- package/dist/cjs/event_tracker.js +5 -11
- package/dist/cjs/global_config.js +107 -188
- package/dist/cjs/index.js +16 -40
- package/dist/cjs/injected/airtable_interface.js +1 -6
- package/dist/cjs/models/abstract_model.js +50 -81
- package/dist/cjs/models/abstract_model_with_async_data.js +102 -177
- package/dist/cjs/models/base.js +211 -374
- package/dist/cjs/models/create_aggregators.js +53 -47
- package/dist/cjs/models/cursor.js +125 -201
- package/dist/cjs/models/field.js +256 -303
- package/dist/cjs/models/grouped_record_query_result.js +210 -286
- package/dist/cjs/models/linked_records_query_result.js +276 -454
- package/dist/cjs/models/models.js +36 -50
- package/dist/cjs/models/mutation_constants.js +5 -9
- package/dist/cjs/models/mutations.js +125 -338
- package/dist/cjs/models/object_pool.js +37 -94
- package/dist/cjs/models/record.js +132 -226
- package/dist/cjs/models/record_coloring.js +14 -19
- package/dist/cjs/models/record_query_result.js +323 -282
- package/dist/cjs/models/record_store.js +355 -688
- package/dist/cjs/models/session.js +99 -158
- package/dist/cjs/models/table.js +361 -549
- package/dist/cjs/models/table_or_view_query_result.js +410 -765
- package/dist/cjs/models/view.js +161 -204
- package/dist/cjs/models/view_data_store.js +177 -282
- package/dist/cjs/models/view_metadata_query_result.js +96 -127
- package/dist/cjs/perform_record_action.js +69 -103
- package/dist/cjs/private_utils.js +133 -223
- package/dist/cjs/sdk.js +97 -142
- package/dist/cjs/settings_button.js +30 -57
- package/dist/cjs/stats/block_stats.js +3 -15
- package/dist/cjs/testing/abstract_mock_airtable_interface.js +53 -97
- package/dist/cjs/types/airtable_interface.js +36 -8
- package/dist/cjs/types/field.js +66 -12
- package/dist/cjs/types/mutations.js +99 -6
- package/dist/cjs/types/permission_levels.js +2 -4
- package/dist/cjs/types/undo_redo.js +2 -3
- package/dist/cjs/types/view.js +16 -11
- package/dist/cjs/ui/base_provider.js +14 -9
- package/dist/cjs/ui/baymax_utils.js +107 -1102
- package/dist/cjs/ui/block_wrapper.js +30 -68
- package/dist/cjs/ui/box.js +52 -56
- package/dist/cjs/ui/button.js +60 -77
- package/dist/cjs/ui/cell_renderer.js +78 -139
- package/dist/cjs/ui/choice_token.js +45 -47
- package/dist/cjs/ui/collaborator_token.js +33 -54
- package/dist/cjs/ui/color_palette.js +58 -106
- package/dist/cjs/ui/color_palette_synced.js +41 -52
- package/dist/cjs/ui/confirmation_dialog.js +53 -69
- package/dist/cjs/ui/control_sizes.js +21 -46
- package/dist/cjs/ui/create_detect_element_resize.js +16 -50
- package/dist/cjs/ui/css_helpers.js +3 -10
- package/dist/cjs/ui/dialog.js +44 -71
- package/dist/cjs/ui/dialog_close_button.js +52 -72
- package/dist/cjs/ui/expand_record.js +4 -11
- package/dist/cjs/ui/expand_record_list.js +6 -11
- package/dist/cjs/ui/expand_record_picker_async.js +18 -35
- package/dist/cjs/ui/field_icon.js +25 -28
- package/dist/cjs/ui/field_picker.js +47 -81
- package/dist/cjs/ui/field_picker_synced.js +33 -44
- package/dist/cjs/ui/form_field.js +45 -64
- package/dist/cjs/ui/geometry/geometry.js +6 -10
- package/dist/cjs/ui/geometry/point.js +5 -13
- package/dist/cjs/ui/geometry/rect.js +7 -29
- package/dist/cjs/ui/geometry/size.js +5 -13
- package/dist/cjs/ui/global_alert.js +35 -61
- package/dist/cjs/ui/global_config_synced_component_helpers.js +4 -13
- package/dist/cjs/ui/heading.js +63 -92
- package/dist/cjs/ui/icon.js +44 -66
- package/dist/cjs/ui/icon_config.js +13 -24
- package/dist/cjs/ui/initialize_block.js +23 -36
- package/dist/cjs/ui/input.js +74 -87
- package/dist/cjs/ui/input_synced.js +34 -43
- package/dist/cjs/ui/key_codes.js +4 -9
- package/dist/cjs/ui/label.js +45 -50
- package/dist/cjs/ui/link.js +74 -89
- package/dist/cjs/ui/loader.js +26 -42
- package/dist/cjs/ui/modal.js +63 -89
- package/dist/cjs/ui/model_picker_select.js +29 -47
- package/dist/cjs/ui/popover.js +98 -180
- package/dist/cjs/ui/progress_bar.js +45 -51
- package/dist/cjs/ui/record_card.js +143 -278
- package/dist/cjs/ui/record_card_list.js +117 -165
- package/dist/cjs/ui/remote_utils.js +5 -13
- package/dist/cjs/ui/sdk_context.js +7 -9
- package/dist/cjs/ui/select.js +84 -118
- package/dist/cjs/ui/select_and_select_buttons_helpers.js +27 -45
- package/dist/cjs/ui/select_buttons.js +54 -90
- package/dist/cjs/ui/select_buttons_synced.js +32 -41
- package/dist/cjs/ui/select_synced.js +32 -42
- package/dist/cjs/ui/switch.js +66 -84
- package/dist/cjs/ui/switch_synced.js +32 -38
- package/dist/cjs/ui/synced.js +16 -43
- package/dist/cjs/ui/system/all_styles_set.js +89 -22
- package/dist/cjs/ui/system/appearance/appearance_set.js +15 -26
- package/dist/cjs/ui/system/appearance/background_color.js +6 -12
- package/dist/cjs/ui/system/appearance/border.js +6 -12
- package/dist/cjs/ui/system/appearance/border_radius.js +6 -12
- package/dist/cjs/ui/system/appearance/box_shadow.js +6 -12
- package/dist/cjs/ui/system/appearance/opacity.js +5 -11
- package/dist/cjs/ui/system/dimensions/dimensions_set.js +15 -27
- package/dist/cjs/ui/system/dimensions/height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/max_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_height.js +5 -11
- package/dist/cjs/ui/system/dimensions/min_width.js +5 -11
- package/dist/cjs/ui/system/dimensions/width.js +5 -11
- package/dist/cjs/ui/system/display.js +8 -9
- package/dist/cjs/ui/system/flex_container/align_content.js +6 -12
- package/dist/cjs/ui/system/flex_container/align_items.js +6 -12
- package/dist/cjs/ui/system/flex_container/flex_container_set.js +15 -27
- package/dist/cjs/ui/system/flex_container/flex_direction.js +5 -11
- package/dist/cjs/ui/system/flex_container/flex_wrap.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_content.js +5 -11
- package/dist/cjs/ui/system/flex_container/justify_items.js +5 -11
- package/dist/cjs/ui/system/flex_item/align_self.js +6 -12
- package/dist/cjs/ui/system/flex_item/flex.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_basis.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_grow.js +5 -11
- package/dist/cjs/ui/system/flex_item/flex_item_set.js +15 -28
- package/dist/cjs/ui/system/flex_item/flex_shrink.js +5 -11
- package/dist/cjs/ui/system/flex_item/justify_self.js +5 -11
- package/dist/cjs/ui/system/flex_item/order.js +5 -11
- package/dist/cjs/ui/system/index.js +310 -362
- package/dist/cjs/ui/system/overflow.js +8 -9
- package/dist/cjs/ui/system/position/bottom.js +6 -13
- package/dist/cjs/ui/system/position/left.js +5 -12
- package/dist/cjs/ui/system/position/position.js +5 -11
- package/dist/cjs/ui/system/position/position_set.js +15 -27
- package/dist/cjs/ui/system/position/right.js +5 -12
- package/dist/cjs/ui/system/position/top.js +5 -12
- package/dist/cjs/ui/system/position/z_index.js +5 -11
- package/dist/cjs/ui/system/spacing/margin.js +5 -12
- package/dist/cjs/ui/system/spacing/padding.js +5 -12
- package/dist/cjs/ui/system/spacing/spacing_set.js +15 -23
- package/dist/cjs/ui/system/typography/font_family.js +5 -11
- package/dist/cjs/ui/system/typography/font_size.js +5 -11
- package/dist/cjs/ui/system/typography/font_style.js +5 -11
- package/dist/cjs/ui/system/typography/font_weight.js +5 -11
- package/dist/cjs/ui/system/typography/letter_spacing.js +5 -11
- package/dist/cjs/ui/system/typography/line_height.js +5 -11
- package/dist/cjs/ui/system/typography/text_align.js +5 -11
- package/dist/cjs/ui/system/typography/text_color.js +5 -11
- package/dist/cjs/ui/system/typography/text_decoration.js +5 -11
- package/dist/cjs/ui/system/typography/text_transform.js +5 -11
- package/dist/cjs/ui/system/typography/typography_set.js +15 -31
- package/dist/cjs/ui/system/utils/create_responsive_prop_type.js +2 -4
- package/dist/cjs/ui/system/utils/create_style_prop_types.js +5 -13
- package/dist/cjs/ui/system/utils/ensure_numbers_are_within_scale.js +2 -14
- package/dist/cjs/ui/system/utils/get_style_props_for_responsive_prop.js +30 -70
- package/dist/cjs/ui/table_picker.js +26 -43
- package/dist/cjs/ui/table_picker_synced.js +33 -42
- package/dist/cjs/ui/text.js +59 -71
- package/dist/cjs/ui/text_button.js +80 -97
- package/dist/cjs/ui/theme/default_theme/button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/control_sizes.js +29 -42
- package/dist/cjs/ui/theme/default_theme/heading_styles.js +4 -5
- package/dist/cjs/ui/theme/default_theme/index.js +15 -32
- package/dist/cjs/ui/theme/default_theme/input_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/link_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_buttons_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/select_variants.js +10 -21
- package/dist/cjs/ui/theme/default_theme/switch_variants.js +8 -20
- package/dist/cjs/ui/theme/default_theme/text_button_variants.js +1 -5
- package/dist/cjs/ui/theme/default_theme/text_styles.js +1 -2
- package/dist/cjs/ui/theme/default_theme/tokens.js +33 -35
- package/dist/cjs/ui/theme/theme_context.js +3 -6
- package/dist/cjs/ui/theme/use_theme.js +1 -7
- package/dist/cjs/ui/tooltip.js +38 -79
- package/dist/cjs/ui/types/aria_props.js +3 -7
- package/dist/cjs/ui/types/data_attributes_prop.js +8 -6
- package/dist/cjs/ui/types/tooltip_anchor_props.js +4 -5
- package/dist/cjs/ui/ui.js +89 -130
- package/dist/cjs/ui/unstable_standalone_ui.js +18 -42
- package/dist/cjs/ui/use_array_identity.js +0 -4
- package/dist/cjs/ui/use_base.js +4 -13
- package/dist/cjs/ui/use_cursor.js +3 -12
- package/dist/cjs/ui/use_form_field.js +4 -6
- package/dist/cjs/ui/use_global_config.js +3 -10
- package/dist/cjs/ui/use_loadable.js +59 -132
- package/dist/cjs/ui/use_record_action_data.js +6 -12
- package/dist/cjs/ui/use_records.js +23 -24
- package/dist/cjs/ui/use_session.js +6 -15
- package/dist/cjs/ui/use_settings_button.js +4 -11
- package/dist/cjs/ui/use_styled_system.js +12 -21
- package/dist/cjs/ui/use_synced.js +0 -7
- package/dist/cjs/ui/use_text_color_for_background_color.js +1 -5
- package/dist/cjs/ui/use_view_metadata.js +5 -8
- package/dist/cjs/ui/use_viewport.js +1 -7
- package/dist/cjs/ui/use_watchable.js +36 -74
- package/dist/cjs/ui/view_picker.js +44 -78
- package/dist/cjs/ui/view_picker_synced.js +33 -44
- package/dist/cjs/ui/viewport_constraint.js +37 -64
- package/dist/cjs/ui/with_hooks.js +17 -22
- package/dist/cjs/ui/with_styled_system.js +33 -60
- package/dist/cjs/undo_redo.js +12 -32
- package/dist/cjs/unstable_private_utils.js +6 -8
- package/dist/cjs/unstable_testing_utils.js +44 -57
- package/dist/cjs/viewport.js +127 -189
- package/dist/cjs/warning.js +5 -6
- package/dist/cjs/watchable.js +66 -148
- package/dist/types/src/colors.d.ts +1 -1
- package/dist/types/src/colors.d.ts.map +1 -1
- package/dist/types/src/global_config.d.ts +1 -1
- package/dist/types/src/global_config.d.ts.map +1 -1
- package/dist/types/src/models/base.d.ts +1 -1
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +1 -1
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +1 -1
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/models.d.ts.map +1 -1
- package/dist/types/src/models/record.d.ts +1 -1
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_coloring.d.ts +2 -2
- package/dist/types/src/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -3
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/session.d.ts +1 -1
- package/dist/types/src/models/session.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +1 -1
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/view.d.ts +1 -1
- package/dist/types/src/models/view.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +2 -2
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/perform_record_action.d.ts +1 -1
- package/dist/types/src/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +8 -8
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/settings_button.d.ts +1 -1
- package/dist/types/src/settings_button.d.ts.map +1 -1
- package/dist/types/src/types/aggregators.d.ts +1 -1
- package/dist/types/src/types/aggregators.d.ts.map +1 -1
- package/dist/types/src/types/airtable_interface.d.ts +6 -6
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/attachment.d.ts +1 -1
- package/dist/types/src/types/attachment.d.ts.map +1 -1
- package/dist/types/src/types/base.d.ts +1 -1
- package/dist/types/src/types/base.d.ts.map +1 -1
- package/dist/types/src/types/block.d.ts +1 -1
- package/dist/types/src/types/block.d.ts.map +1 -1
- package/dist/types/src/types/collaborator.d.ts +1 -1
- package/dist/types/src/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/types/field.d.ts +5 -5
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/global_config.d.ts +6 -6
- package/dist/types/src/types/global_config.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +4 -4
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/permission_levels.d.ts +1 -1
- package/dist/types/src/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/types/record.d.ts +2 -2
- package/dist/types/src/types/record.d.ts.map +1 -1
- package/dist/types/src/types/record_action_data.d.ts +1 -1
- package/dist/types/src/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +3 -3
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/undo_redo.d.ts +1 -1
- package/dist/types/src/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +4 -4
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/base_provider.d.ts +1 -1
- package/dist/types/src/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/ui/block_wrapper.d.ts +2 -2
- package/dist/types/src/ui/button.d.ts +1 -1
- package/dist/types/src/ui/button.d.ts.map +1 -1
- package/dist/types/src/ui/cell_renderer.d.ts +2 -2
- package/dist/types/src/ui/choice_token.d.ts +3 -3
- package/dist/types/src/ui/choice_token.d.ts.map +1 -1
- package/dist/types/src/ui/collaborator_token.d.ts +5 -5
- package/dist/types/src/ui/collaborator_token.d.ts.map +1 -1
- package/dist/types/src/ui/color_palette.d.ts +2 -2
- package/dist/types/src/ui/color_palette_synced.d.ts +2 -2
- package/dist/types/src/ui/confirmation_dialog.d.ts +1 -1
- package/dist/types/src/ui/control_sizes.d.ts +2 -2
- package/dist/types/src/ui/control_sizes.d.ts.map +1 -1
- package/dist/types/src/ui/dialog.d.ts +2 -2
- package/dist/types/src/ui/dialog.d.ts.map +1 -1
- package/dist/types/src/ui/dialog_close_button.d.ts +1 -1
- package/dist/types/src/ui/field_icon.d.ts +3 -3
- package/dist/types/src/ui/field_icon.d.ts.map +1 -1
- package/dist/types/src/ui/field_picker.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts +1 -1
- package/dist/types/src/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/heading.d.ts +3 -3
- package/dist/types/src/ui/heading.d.ts.map +1 -1
- package/dist/types/src/ui/icon.d.ts +1 -1
- package/dist/types/src/ui/icon_config.d.ts +39 -39
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/ui/input.d.ts +15 -15
- package/dist/types/src/ui/input.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +1 -1
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/loader.d.ts +1 -1
- package/dist/types/src/ui/loader.d.ts.map +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts +1 -1
- package/dist/types/src/ui/model_picker_select.d.ts.map +1 -1
- package/dist/types/src/ui/popover.d.ts +5 -5
- package/dist/types/src/ui/popover.d.ts.map +1 -1
- package/dist/types/src/ui/progress_bar.d.ts +1 -1
- package/dist/types/src/ui/progress_bar.d.ts.map +1 -1
- package/dist/types/src/ui/record_card.d.ts +2 -2
- package/dist/types/src/ui/record_card.d.ts.map +1 -1
- package/dist/types/src/ui/record_card_list.d.ts +1 -1
- package/dist/types/src/ui/select.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts +4 -4
- package/dist/types/src/ui/select_and_select_buttons_helpers.d.ts.map +1 -1
- package/dist/types/src/ui/select_buttons.d.ts +4 -4
- package/dist/types/src/ui/switch.d.ts +1 -1
- package/dist/types/src/ui/switch.d.ts.map +1 -1
- package/dist/types/src/ui/synced.d.ts +3 -3
- package/dist/types/src/ui/system/all_styles_set.d.ts +0 -1
- package/dist/types/src/ui/system/all_styles_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/appearance_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/background_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/border_radius.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/box_shadow.d.ts.map +1 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts +0 -1
- package/dist/types/src/ui/system/appearance/opacity.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/dimensions_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/max_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/min_width.d.ts.map +1 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts +0 -1
- package/dist/types/src/ui/system/dimensions/width.d.ts.map +1 -1
- package/dist/types/src/ui/system/display.d.ts +0 -1
- package/dist/types/src/ui/system/display.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/align_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_container_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_direction.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/flex_wrap.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_content.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts +0 -1
- package/dist/types/src/ui/system/flex_container/justify_items.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/align_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_basis.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_grow.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_item_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/flex_shrink.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/justify_self.d.ts.map +1 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts +0 -1
- package/dist/types/src/ui/system/flex_item/order.d.ts.map +1 -1
- package/dist/types/src/ui/system/overflow.d.ts +0 -1
- package/dist/types/src/ui/system/overflow.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/bottom.d.ts +0 -1
- package/dist/types/src/ui/system/position/bottom.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/left.d.ts +0 -1
- package/dist/types/src/ui/system/position/left.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position.d.ts +0 -1
- package/dist/types/src/ui/system/position/position.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/position_set.d.ts +0 -1
- package/dist/types/src/ui/system/position/position_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/right.d.ts +0 -1
- package/dist/types/src/ui/system/position/right.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/top.d.ts +0 -1
- package/dist/types/src/ui/system/position/top.d.ts.map +1 -1
- package/dist/types/src/ui/system/position/z_index.d.ts +0 -1
- package/dist/types/src/ui/system/position/z_index.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/margin.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/padding.d.ts.map +1 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts +0 -1
- package/dist/types/src/ui/system/spacing/spacing_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_family.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_size.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_style.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts +0 -1
- package/dist/types/src/ui/system/typography/font_weight.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts +0 -1
- package/dist/types/src/ui/system/typography/letter_spacing.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts +0 -1
- package/dist/types/src/ui/system/typography/line_height.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_align.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_color.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_decoration.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts +0 -1
- package/dist/types/src/ui/system/typography/text_transform.d.ts.map +1 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts +0 -1
- package/dist/types/src/ui/system/typography/typography_set.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts +1 -1
- package/dist/types/src/ui/system/utils/create_style_prop_types.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/csstype.d.ts +578 -578
- package/dist/types/src/ui/system/utils/csstype.d.ts.map +1 -1
- package/dist/types/src/ui/system/utils/types.d.ts +4 -4
- package/dist/types/src/ui/system/utils/types.d.ts.map +1 -1
- package/dist/types/src/ui/text.d.ts +3 -3
- package/dist/types/src/ui/text.d.ts.map +1 -1
- package/dist/types/src/ui/text_button.d.ts +1 -1
- package/dist/types/src/ui/text_button.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts +2 -2
- package/dist/types/src/ui/theme/default_theme/heading_styles.d.ts.map +1 -1
- package/dist/types/src/ui/theme/default_theme/index.d.ts +1 -1
- package/dist/types/src/ui/theme/theme_context.d.ts +1 -3
- package/dist/types/src/ui/theme/theme_context.d.ts.map +1 -1
- package/dist/types/src/ui/theme/use_theme.d.ts +1 -1
- package/dist/types/src/ui/tooltip.d.ts +3 -3
- package/dist/types/src/ui/types/data_attributes_prop.d.ts.map +1 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts +0 -1
- package/dist/types/src/ui/types/tooltip_anchor_props.d.ts.map +1 -1
- package/dist/types/src/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/ui/use_form_field.d.ts.map +1 -1
- package/dist/types/src/ui/use_records.d.ts +2 -2
- package/dist/types/src/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/ui/view_picker.d.ts +2 -2
- package/dist/types/src/ui/view_picker.d.ts.map +1 -1
- package/dist/types/src/ui/viewport_constraint.d.ts +3 -3
- package/dist/types/src/ui/viewport_constraint.d.ts.map +1 -1
- package/dist/types/src/viewport.d.ts +2 -2
- package/dist/types/src/viewport.d.ts.map +1 -1
- package/dist/types/src/warning.d.ts +1 -1
- package/dist/types/src/warning.d.ts.map +1 -1
- package/dist/types/stories/helpers/code_block.d.ts +2 -2
- package/dist/types/stories/helpers/code_block.d.ts.map +1 -1
- package/dist/types/stories/helpers/example.d.ts +5 -5
- package/dist/types/stories/helpers/example.d.ts.map +1 -1
- package/dist/types/stories/helpers/example_code_panel.d.ts +2 -2
- package/dist/types/stories/helpers/example_code_panel.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts +2 -2
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts +1 -1
- package/dist/types/stories/helpers/fake_foreign_record.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_record_card.d.ts +2 -2
- package/dist/types/stories/helpers/fake_record_card.d.ts.map +1 -1
- package/dist/types/stories/helpers/style_prop_list.d.ts +2 -2
- package/dist/types/stories/helpers/style_prop_list.d.ts.map +1 -1
- package/dist/types/stories/icon_example.d.ts +2 -2
- package/dist/types/stories/icon_example.d.ts.map +1 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -1
- package/package.json +26 -25
|
@@ -1,78 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.array.concat");
|
|
6
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = void 0;
|
|
11
|
-
|
|
8
|
+
require("core-js/modules/es.array.concat.js");
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
|
-
|
|
16
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
-
|
|
18
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
-
|
|
20
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
|
|
24
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
15
|
var _error_utils = require("../error_utils");
|
|
27
|
-
|
|
28
16
|
var _watchable = _interopRequireDefault(require("../watchable"));
|
|
29
|
-
|
|
30
|
-
/** @module @airtable/blocks/models: Abstract models */
|
|
31
|
-
|
|
32
|
-
/** */
|
|
33
|
-
|
|
17
|
+
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)); }
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @module @airtable/blocks/models: Abstract models */ /** */
|
|
34
19
|
/**
|
|
35
20
|
* Abstract superclass for all models. You won't use this class directly.
|
|
36
21
|
*
|
|
37
22
|
* @docsPath models/advanced/AbstractModel
|
|
38
23
|
*/
|
|
39
|
-
var AbstractModel =
|
|
40
|
-
/*#__PURE__*/
|
|
41
|
-
function (_Watchable) {
|
|
42
|
-
(0, _inherits2.default)(AbstractModel, _Watchable);
|
|
43
|
-
(0, _createClass2.default)(AbstractModel, null, [{
|
|
44
|
-
key: "_isWatchableKey",
|
|
45
|
-
|
|
46
|
-
/** @internal */
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* This method is essentially abstract, but as of this writing, TypeScript
|
|
50
|
-
* does not support abstract static methods. This necessitates a concrete
|
|
51
|
-
* implementation which must be explicitly ignored by the test coverage
|
|
52
|
-
* tooling.
|
|
53
|
-
*
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
// istanbul ignore next
|
|
57
|
-
value: function _isWatchableKey(key) {
|
|
58
|
-
// Override to return whether `key` is a valid watchable key.
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
/** @internal */
|
|
62
|
-
|
|
63
|
-
}]);
|
|
64
|
-
|
|
24
|
+
var AbstractModel = /*#__PURE__*/function (_Watchable) {
|
|
65
25
|
/**
|
|
66
26
|
* @internal
|
|
67
27
|
*/
|
|
68
28
|
function AbstractModel(sdk, modelId) {
|
|
69
29
|
var _this;
|
|
70
|
-
|
|
71
30
|
(0, _classCallCheck2.default)(this, AbstractModel);
|
|
72
|
-
_this = (
|
|
73
|
-
|
|
74
|
-
(0, _defineProperty2.default)(
|
|
75
|
-
|
|
31
|
+
_this = _callSuper(this, AbstractModel);
|
|
32
|
+
/** @internal */
|
|
33
|
+
(0, _defineProperty2.default)(_this, "_baseData", void 0);
|
|
34
|
+
/** @internal */
|
|
35
|
+
(0, _defineProperty2.default)(_this, "_id", void 0);
|
|
36
|
+
/** @internal */
|
|
37
|
+
(0, _defineProperty2.default)(_this, "_sdk", void 0);
|
|
76
38
|
(0, _error_utils.invariant)(typeof modelId === 'string', '%s id should be a string', _this.constructor._className);
|
|
77
39
|
_this._sdk = sdk;
|
|
78
40
|
_this._baseData = sdk.__airtableInterface.sdkInitData.baseData;
|
|
@@ -82,27 +44,8 @@ function (_Watchable) {
|
|
|
82
44
|
/**
|
|
83
45
|
* The ID for this model.
|
|
84
46
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(0, _createClass2.default)(AbstractModel, [{
|
|
88
|
-
key: "_spawnErrorForDeletion",
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
value: function _spawnErrorForDeletion() {
|
|
94
|
-
return (0, _error_utils.spawnError)('%s has been deleted', this.constructor._className);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* A string representation of the model for use in debugging.
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
}, {
|
|
101
|
-
key: "toString",
|
|
102
|
-
value: function toString() {
|
|
103
|
-
return "[".concat(this.constructor._className, " ").concat(this.id, "]");
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
47
|
+
(0, _inherits2.default)(AbstractModel, _Watchable);
|
|
48
|
+
return (0, _createClass2.default)(AbstractModel, [{
|
|
106
49
|
key: "id",
|
|
107
50
|
get: function get() {
|
|
108
51
|
return this._id;
|
|
@@ -110,20 +53,17 @@ function (_Watchable) {
|
|
|
110
53
|
/**
|
|
111
54
|
* @internal
|
|
112
55
|
*/
|
|
113
|
-
|
|
114
56
|
}, {
|
|
115
57
|
key: "_data",
|
|
116
|
-
|
|
58
|
+
get:
|
|
117
59
|
/**
|
|
118
60
|
* @internal
|
|
119
61
|
*/
|
|
120
|
-
|
|
62
|
+
function get() {
|
|
121
63
|
var data = this._dataOrNullIfDeleted;
|
|
122
|
-
|
|
123
64
|
if (data === null) {
|
|
124
65
|
throw this._spawnErrorForDeletion();
|
|
125
66
|
}
|
|
126
|
-
|
|
127
67
|
return data;
|
|
128
68
|
}
|
|
129
69
|
/**
|
|
@@ -135,16 +75,45 @@ function (_Watchable) {
|
|
|
135
75
|
* reference, you can use `isDeleted` to check that it's safe to access the
|
|
136
76
|
* model's data.
|
|
137
77
|
*/
|
|
138
|
-
|
|
139
78
|
}, {
|
|
140
79
|
key: "isDeleted",
|
|
141
80
|
get: function get() {
|
|
142
81
|
return this._dataOrNullIfDeleted === null;
|
|
143
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
}, {
|
|
87
|
+
key: "_spawnErrorForDeletion",
|
|
88
|
+
value: function _spawnErrorForDeletion() {
|
|
89
|
+
return (0, _error_utils.spawnError)('%s has been deleted', this.constructor._className);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A string representation of the model for use in debugging.
|
|
93
|
+
*/
|
|
94
|
+
}, {
|
|
95
|
+
key: "toString",
|
|
96
|
+
value: function toString() {
|
|
97
|
+
return "[".concat(this.constructor._className, " ").concat(this.id, "]");
|
|
98
|
+
}
|
|
99
|
+
}], [{
|
|
100
|
+
key: "_isWatchableKey",
|
|
101
|
+
value:
|
|
102
|
+
/**
|
|
103
|
+
* This method is essentially abstract, but as of this writing, TypeScript
|
|
104
|
+
* does not support abstract static methods. This necessitates a concrete
|
|
105
|
+
* implementation which must be explicitly ignored by the test coverage
|
|
106
|
+
* tooling.
|
|
107
|
+
*
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
// istanbul ignore next
|
|
111
|
+
function _isWatchableKey(key) {
|
|
112
|
+
// Override to return whether `key` is a valid watchable key.
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
144
115
|
}]);
|
|
145
|
-
return AbstractModel;
|
|
146
116
|
}(_watchable.default);
|
|
147
|
-
|
|
117
|
+
/** @internal */
|
|
148
118
|
(0, _defineProperty2.default)(AbstractModel, "_className", 'AbstractModel');
|
|
149
|
-
var _default = AbstractModel;
|
|
150
|
-
exports.default = _default;
|
|
119
|
+
var _default = exports.default = AbstractModel;
|
|
@@ -1,89 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
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.iterator.js");
|
|
7
|
+
require("core-js/modules/es.array.slice.js");
|
|
8
|
+
require("core-js/modules/es.object.to-string.js");
|
|
9
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
10
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
12
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.iterator");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.to-string");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.promise");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
16
|
-
|
|
17
13
|
Object.defineProperty(exports, "__esModule", {
|
|
18
14
|
value: true
|
|
19
15
|
});
|
|
20
16
|
exports.default = void 0;
|
|
21
|
-
|
|
22
17
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
23
|
-
|
|
24
|
-
require("regenerator-runtime/runtime");
|
|
25
|
-
|
|
18
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
26
19
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
27
|
-
|
|
20
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
28
21
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
29
|
-
|
|
30
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
31
|
-
|
|
32
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
33
|
-
|
|
34
22
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
35
|
-
|
|
36
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
37
|
-
|
|
23
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
38
24
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
39
|
-
|
|
40
25
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
41
|
-
|
|
42
26
|
var _private_utils = require("../private_utils");
|
|
43
|
-
|
|
44
27
|
var _error_utils = require("../error_utils");
|
|
45
|
-
|
|
46
28
|
var _abstract_model = _interopRequireDefault(require("./abstract_model"));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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; })(); } /** @module @airtable/blocks/models: Abstract models */ /** */
|
|
52
34
|
/**
|
|
53
35
|
* Abstract superclass for all Blocks SDK models that need to fetch async data.
|
|
54
36
|
*
|
|
55
37
|
* @docsPath models/advanced/AbstractModelWithAsyncData
|
|
56
38
|
*/
|
|
57
|
-
var AbstractModelWithAsyncData =
|
|
58
|
-
/*#__PURE__*/
|
|
59
|
-
function (_AbstractModel) {
|
|
60
|
-
(0, _inherits2.default)(AbstractModelWithAsyncData, _AbstractModel);
|
|
61
|
-
(0, _createClass2.default)(AbstractModelWithAsyncData, null, [{
|
|
62
|
-
key: "_shouldLoadDataForKey",
|
|
63
|
-
|
|
64
|
-
/** @internal */
|
|
65
|
-
|
|
66
|
-
/** @internal */
|
|
67
|
-
value: function _shouldLoadDataForKey(key) {
|
|
68
|
-
// Override to return whether watching the key should trigger the
|
|
69
|
-
// data to be loaded for this model.
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
/** @internal */
|
|
73
|
-
|
|
74
|
-
}]);
|
|
75
|
-
|
|
39
|
+
var AbstractModelWithAsyncData = /*#__PURE__*/function (_AbstractModel) {
|
|
76
40
|
/** @hidden */
|
|
77
41
|
function AbstractModelWithAsyncData(sdk, modelId) {
|
|
78
42
|
var _this;
|
|
79
|
-
|
|
80
43
|
(0, _classCallCheck2.default)(this, AbstractModelWithAsyncData);
|
|
81
|
-
_this = (
|
|
82
|
-
|
|
83
|
-
(0, _defineProperty2.default)(
|
|
84
|
-
|
|
85
|
-
(0, _defineProperty2.default)(
|
|
86
|
-
|
|
44
|
+
_this = _callSuper(this, AbstractModelWithAsyncData, [sdk, modelId]);
|
|
45
|
+
/** @internal */
|
|
46
|
+
(0, _defineProperty2.default)(_this, "_isDataLoaded", void 0);
|
|
47
|
+
/** @internal */
|
|
48
|
+
(0, _defineProperty2.default)(_this, "_pendingDataLoadPromise", void 0);
|
|
49
|
+
/** @internal */
|
|
50
|
+
(0, _defineProperty2.default)(_this, "_dataRetainCount", void 0);
|
|
51
|
+
/** @internal */
|
|
52
|
+
(0, _defineProperty2.default)(_this, "_unloadDataTimeoutId", void 0);
|
|
53
|
+
/**
|
|
54
|
+
* This flag is used to keep track of models that have been
|
|
55
|
+
* forced to unload (regardless of the retain count). The force
|
|
56
|
+
* unload happens via _forceUnload method and the only proper use
|
|
57
|
+
* of that function is when the underlying data gets deleted while
|
|
58
|
+
* the model is still active. e.g. when a table is deleted in the
|
|
59
|
+
* main extension while an instance of record_store is still alive.
|
|
60
|
+
* NOTE: Once set to true, it never goes back to false.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
(0, _defineProperty2.default)(_this, "_isForceUnloaded", false);
|
|
87
65
|
_this._isDataLoaded = false;
|
|
88
66
|
_this._pendingDataLoadPromise = null;
|
|
89
67
|
_this._dataRetainCount = 0;
|
|
@@ -97,22 +75,17 @@ function (_AbstractModel) {
|
|
|
97
75
|
*
|
|
98
76
|
* @inheritdoc
|
|
99
77
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
(0, _createClass2.default)(AbstractModelWithAsyncData, [{
|
|
78
|
+
(0, _inherits2.default)(AbstractModelWithAsyncData, _AbstractModel);
|
|
79
|
+
return (0, _createClass2.default)(AbstractModelWithAsyncData, [{
|
|
103
80
|
key: "watch",
|
|
104
81
|
value: function watch(keys, callback, context) {
|
|
105
82
|
this._assertNotForceUnloaded();
|
|
106
|
-
|
|
107
83
|
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(AbstractModelWithAsyncData.prototype), "watch", this).call(this, keys, callback, context);
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
var _iteratorError = undefined;
|
|
111
|
-
|
|
84
|
+
var _iterator = _createForOfIteratorHelper(validKeys),
|
|
85
|
+
_step;
|
|
112
86
|
try {
|
|
113
|
-
for (
|
|
87
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
114
88
|
var key = _step.value;
|
|
115
|
-
|
|
116
89
|
if (this.constructor._shouldLoadDataForKey(key)) {
|
|
117
90
|
// Note: for simplicity, we will call loadData for every key that needs
|
|
118
91
|
// needs data, relying on the retain count to unload once all keys have
|
|
@@ -121,20 +94,10 @@ function (_AbstractModel) {
|
|
|
121
94
|
}
|
|
122
95
|
}
|
|
123
96
|
} catch (err) {
|
|
124
|
-
|
|
125
|
-
_iteratorError = err;
|
|
97
|
+
_iterator.e(err);
|
|
126
98
|
} finally {
|
|
127
|
-
|
|
128
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
129
|
-
_iterator.return();
|
|
130
|
-
}
|
|
131
|
-
} finally {
|
|
132
|
-
if (_didIteratorError) {
|
|
133
|
-
throw _iteratorError;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
99
|
+
_iterator.f();
|
|
136
100
|
}
|
|
137
|
-
|
|
138
101
|
return validKeys;
|
|
139
102
|
}
|
|
140
103
|
/**
|
|
@@ -144,19 +107,15 @@ function (_AbstractModel) {
|
|
|
144
107
|
*
|
|
145
108
|
* @inheritdoc
|
|
146
109
|
*/
|
|
147
|
-
|
|
148
110
|
}, {
|
|
149
111
|
key: "unwatch",
|
|
150
112
|
value: function unwatch(keys, callback, context) {
|
|
151
113
|
var validKeys = (0, _get2.default)((0, _getPrototypeOf2.default)(AbstractModelWithAsyncData.prototype), "unwatch", this).call(this, keys, callback, context);
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
var _iteratorError2 = undefined;
|
|
155
|
-
|
|
114
|
+
var _iterator2 = _createForOfIteratorHelper(validKeys),
|
|
115
|
+
_step2;
|
|
156
116
|
try {
|
|
157
|
-
for (
|
|
117
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
158
118
|
var key = _step2.value;
|
|
159
|
-
|
|
160
119
|
if (this.constructor._shouldLoadDataForKey(key)) {
|
|
161
120
|
// We called loadDataAsync for every key that needs data so call
|
|
162
121
|
// unloadData for every key to balance the retain count.
|
|
@@ -164,141 +123,124 @@ function (_AbstractModel) {
|
|
|
164
123
|
}
|
|
165
124
|
}
|
|
166
125
|
} catch (err) {
|
|
167
|
-
|
|
168
|
-
_iteratorError2 = err;
|
|
126
|
+
_iterator2.e(err);
|
|
169
127
|
} finally {
|
|
170
|
-
|
|
171
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
172
|
-
_iterator2.return();
|
|
173
|
-
}
|
|
174
|
-
} finally {
|
|
175
|
-
if (_didIteratorError2) {
|
|
176
|
-
throw _iteratorError2;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
128
|
+
_iterator2.f();
|
|
179
129
|
}
|
|
180
|
-
|
|
181
130
|
return validKeys;
|
|
182
131
|
}
|
|
183
132
|
/** @inheritdoc */
|
|
184
|
-
|
|
133
|
+
}, {
|
|
134
|
+
key: "isDeleted",
|
|
135
|
+
get: function get() {
|
|
136
|
+
if (this._isForceUnloaded) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
return (0, _get2.default)((0, _getPrototypeOf2.default)(AbstractModelWithAsyncData.prototype), "isDeleted", this);
|
|
140
|
+
}
|
|
141
|
+
/** */
|
|
142
|
+
}, {
|
|
143
|
+
key: "isDataLoaded",
|
|
144
|
+
get: function get() {
|
|
145
|
+
if (this.isDeleted) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return this._isDataLoaded;
|
|
149
|
+
}
|
|
150
|
+
/** @internal */
|
|
185
151
|
}, {
|
|
186
152
|
key: "loadDataAsync",
|
|
187
|
-
// Override this method if your model is dependent on other models.
|
|
153
|
+
value: // Override this method if your model is dependent on other models.
|
|
188
154
|
// Do NOT load other models' data from _loadDataAsync, since it can lead to
|
|
189
155
|
// unexpected behavior.
|
|
190
156
|
// IMPORTANT: always call super.loadDataAsync() from your override.
|
|
191
|
-
|
|
192
157
|
/**
|
|
193
158
|
* Will cause all the async data to be fetched and retained. Every call to
|
|
194
159
|
* `loadDataAsync` should have a matching call to `unloadData`.
|
|
195
160
|
*
|
|
196
161
|
* Returns a Promise that will resolve once the data is loaded.
|
|
197
162
|
*/
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
switch (_context.prev = _context.next) {
|
|
163
|
+
function () {
|
|
164
|
+
var _loadDataAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
165
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
166
|
+
while (1) switch (_context.prev = _context.next) {
|
|
202
167
|
case 0:
|
|
203
168
|
this._assertNotForceUnloaded();
|
|
204
|
-
|
|
205
169
|
if (this._unloadDataTimeoutId !== null) {
|
|
206
170
|
// If we set a timeout to unload data, clear it since we are incrementing
|
|
207
171
|
// the retain count and loading data.
|
|
208
172
|
clearTimeout(this._unloadDataTimeoutId);
|
|
209
173
|
this._unloadDataTimeoutId = null;
|
|
210
|
-
}
|
|
211
|
-
// actually unload the data until the retain count comes back down to zero.
|
|
212
|
-
|
|
174
|
+
}
|
|
213
175
|
|
|
176
|
+
// We keep a count of how many things have loaded the data so we don't
|
|
177
|
+
// actually unload the data until the retain count comes back down to zero.
|
|
214
178
|
this._dataRetainCount++;
|
|
215
|
-
|
|
216
179
|
if (!this._isDataLoaded) {
|
|
217
180
|
_context.next = 5;
|
|
218
181
|
break;
|
|
219
182
|
}
|
|
220
|
-
|
|
221
183
|
return _context.abrupt("return");
|
|
222
|
-
|
|
223
184
|
case 5:
|
|
224
185
|
if (!this._pendingDataLoadPromise) {
|
|
225
186
|
this._pendingDataLoadPromise = this._loadDataAsync().then(changedKeys => {
|
|
226
187
|
this._isDataLoaded = true;
|
|
227
188
|
this._pendingDataLoadPromise = null;
|
|
228
|
-
var
|
|
229
|
-
|
|
230
|
-
var _iteratorError3 = undefined;
|
|
231
|
-
|
|
189
|
+
var _iterator3 = _createForOfIteratorHelper(changedKeys),
|
|
190
|
+
_step3;
|
|
232
191
|
try {
|
|
233
|
-
for (
|
|
192
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
234
193
|
var key = _step3.value;
|
|
235
|
-
|
|
236
194
|
this._onChange(key);
|
|
237
195
|
}
|
|
238
196
|
} catch (err) {
|
|
239
|
-
|
|
240
|
-
_iteratorError3 = err;
|
|
197
|
+
_iterator3.e(err);
|
|
241
198
|
} finally {
|
|
242
|
-
|
|
243
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
244
|
-
_iterator3.return();
|
|
245
|
-
}
|
|
246
|
-
} finally {
|
|
247
|
-
if (_didIteratorError3) {
|
|
248
|
-
throw _iteratorError3;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
199
|
+
_iterator3.f();
|
|
251
200
|
}
|
|
252
|
-
|
|
253
201
|
this._onChangeIsDataLoaded();
|
|
254
|
-
|
|
255
202
|
return changedKeys;
|
|
256
203
|
});
|
|
257
204
|
}
|
|
258
|
-
|
|
259
205
|
_context.next = 8;
|
|
260
|
-
return
|
|
261
|
-
|
|
206
|
+
return this._pendingDataLoadPromise;
|
|
262
207
|
case 8:
|
|
263
208
|
case "end":
|
|
264
209
|
return _context.stop();
|
|
265
210
|
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
211
|
+
}, _callee, this);
|
|
212
|
+
}));
|
|
213
|
+
function loadDataAsync() {
|
|
214
|
+
return _loadDataAsync2.apply(this, arguments);
|
|
215
|
+
}
|
|
216
|
+
return loadDataAsync;
|
|
217
|
+
}() // Override this method if your model is dependent on other models.
|
|
269
218
|
// Do NOT unload other models' data from _unloadData, since it can lead to
|
|
270
219
|
// unexpected behavior.
|
|
271
220
|
// IMPORTANT: always call super.unloadData() from your override.
|
|
272
|
-
|
|
273
221
|
/** */
|
|
274
|
-
|
|
275
222
|
}, {
|
|
276
223
|
key: "unloadData",
|
|
277
224
|
value: function unloadData() {
|
|
278
225
|
if (this._isForceUnloaded) {
|
|
279
226
|
return;
|
|
280
227
|
}
|
|
281
|
-
|
|
282
228
|
this._dataRetainCount--;
|
|
283
|
-
|
|
284
229
|
if (this._dataRetainCount < 0) {
|
|
285
230
|
console.warn("Block ".concat(this.constructor._className, " data over-released")); // eslint-disable-line no-console
|
|
286
|
-
|
|
287
231
|
this._dataRetainCount = 0;
|
|
288
232
|
}
|
|
289
|
-
|
|
290
233
|
if (this._dataRetainCount === 0) {
|
|
291
234
|
// Don't unload immediately. Wait a while in case something else
|
|
292
235
|
// requests the data, so we can avoid going back to liveapp or
|
|
293
236
|
// the network.
|
|
294
237
|
this._unloadDataTimeoutId = setTimeout(() => {
|
|
295
|
-
(0, _error_utils.invariant)(this._dataRetainCount === 0, 'Unload data timeout fired with non-zero retain count');
|
|
296
|
-
// _unloadData reads from isDataLoaded.
|
|
238
|
+
(0, _error_utils.invariant)(this._dataRetainCount === 0, 'Unload data timeout fired with non-zero retain count');
|
|
297
239
|
|
|
240
|
+
// Set _isDataLoaded to false before calling _unloadData in case
|
|
241
|
+
// _unloadData reads from isDataLoaded.
|
|
298
242
|
this._isDataLoaded = false;
|
|
299
|
-
|
|
300
243
|
this._unloadData();
|
|
301
|
-
|
|
302
244
|
this._onChangeIsDataLoaded();
|
|
303
245
|
}, AbstractModelWithAsyncData.__DATA_UNLOAD_DELAY_MS);
|
|
304
246
|
}
|
|
@@ -309,7 +251,6 @@ function (_AbstractModel) {
|
|
|
309
251
|
while (this._dataRetainCount > 0) {
|
|
310
252
|
this.unloadData();
|
|
311
253
|
}
|
|
312
|
-
|
|
313
254
|
this._isForceUnloaded = true;
|
|
314
255
|
}
|
|
315
256
|
}, {
|
|
@@ -317,32 +258,16 @@ function (_AbstractModel) {
|
|
|
317
258
|
value: function _assertNotForceUnloaded() {
|
|
318
259
|
(0, _error_utils.invariant)(!this._isForceUnloaded, 'model (%s) permanently deleted', this.id);
|
|
319
260
|
}
|
|
320
|
-
}, {
|
|
321
|
-
key: "
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(AbstractModelWithAsyncData.prototype), "isDeleted", this);
|
|
328
|
-
}
|
|
329
|
-
/** */
|
|
330
|
-
|
|
331
|
-
}, {
|
|
332
|
-
key: "isDataLoaded",
|
|
333
|
-
get: function get() {
|
|
334
|
-
if (this.isDeleted) {
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
return this._isDataLoaded;
|
|
261
|
+
}], [{
|
|
262
|
+
key: "_shouldLoadDataForKey",
|
|
263
|
+
value: /** @internal */
|
|
264
|
+
function _shouldLoadDataForKey(key) {
|
|
265
|
+
// Override to return whether watching the key should trigger the
|
|
266
|
+
// data to be loaded for this model.
|
|
267
|
+
return false;
|
|
339
268
|
}
|
|
340
|
-
/** @internal */
|
|
341
|
-
|
|
342
269
|
}]);
|
|
343
|
-
return AbstractModelWithAsyncData;
|
|
344
270
|
}(_abstract_model.default);
|
|
345
|
-
|
|
271
|
+
/** @internal */
|
|
346
272
|
(0, _defineProperty2.default)(AbstractModelWithAsyncData, "__DATA_UNLOAD_DELAY_MS", 1000);
|
|
347
|
-
var _default = AbstractModelWithAsyncData;
|
|
348
|
-
exports.default = _default;
|
|
273
|
+
var _default = exports.default = AbstractModelWithAsyncData;
|