@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,59 +1,41 @@
|
|
|
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.regexp.exec.js");
|
|
7
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
3
8
|
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.filter");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.map");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.slice");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.to-string");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.promise");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
22
|
-
|
|
23
9
|
Object.defineProperty(exports, "__esModule", {
|
|
24
10
|
value: true
|
|
25
11
|
});
|
|
26
12
|
exports.default = exports.WatchableViewDataStoreKeys = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
require("core-js/modules/es.array.filter.js");
|
|
14
|
+
require("core-js/modules/es.array.iterator.js");
|
|
15
|
+
require("core-js/modules/es.array.map.js");
|
|
16
|
+
require("core-js/modules/es.array.slice.js");
|
|
17
|
+
require("core-js/modules/es.object.to-string.js");
|
|
18
|
+
require("core-js/modules/es.promise.js");
|
|
19
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
30
20
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
31
|
-
|
|
32
|
-
require("
|
|
33
|
-
|
|
21
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
22
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
34
23
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
35
|
-
|
|
24
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
36
25
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
37
|
-
|
|
38
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
39
|
-
|
|
40
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
41
|
-
|
|
42
26
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
43
|
-
|
|
44
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
45
|
-
|
|
27
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
46
28
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
47
|
-
|
|
48
29
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
49
|
-
|
|
50
30
|
var _private_utils = require("../private_utils");
|
|
51
|
-
|
|
52
31
|
var _error_utils = require("../error_utils");
|
|
53
|
-
|
|
54
32
|
var _abstract_model_with_async_data = _interopRequireDefault(require("./abstract_model_with_async_data"));
|
|
55
|
-
|
|
56
|
-
var
|
|
33
|
+
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; } } }; }
|
|
34
|
+
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; } }
|
|
35
|
+
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; }
|
|
36
|
+
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)); }
|
|
37
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
38
|
+
var WatchableViewDataStoreKeys = exports.WatchableViewDataStoreKeys = Object.freeze({
|
|
57
39
|
visibleRecords: 'visibleRecords',
|
|
58
40
|
visibleRecordIds: 'visibleRecordIds',
|
|
59
41
|
groups: 'groups',
|
|
@@ -62,50 +44,44 @@ var WatchableViewDataStoreKeys = Object.freeze({
|
|
|
62
44
|
allFieldIds: 'allFieldIds',
|
|
63
45
|
visibleFieldIds: 'visibleFieldIds'
|
|
64
46
|
});
|
|
65
|
-
/** @internal */
|
|
66
|
-
|
|
67
|
-
exports.WatchableViewDataStoreKeys = WatchableViewDataStoreKeys;
|
|
68
47
|
|
|
48
|
+
/** @internal */
|
|
69
49
|
// ViewDataStore contains loadable data for a specific view. That means the set of visible records,
|
|
70
50
|
// and field order/visibility information. View itself only contains core schema information. The
|
|
71
51
|
// data here doesn't belong in View as it's record data or conditionally loaded.
|
|
72
|
-
|
|
73
52
|
/** @internal */
|
|
74
|
-
var ViewDataStore =
|
|
75
|
-
/*#__PURE__*/
|
|
76
|
-
function (_AbstractModelWithAsy) {
|
|
77
|
-
(0, _inherits2.default)(ViewDataStore, _AbstractModelWithAsy);
|
|
78
|
-
(0, _createClass2.default)(ViewDataStore, null, [{
|
|
79
|
-
key: "_isWatchableKey",
|
|
80
|
-
value: function _isWatchableKey(key) {
|
|
81
|
-
return (0, _private_utils.isEnumValue)(WatchableViewDataStoreKeys, key);
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "_shouldLoadDataForKey",
|
|
85
|
-
value: function _shouldLoadDataForKey(key) {
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
}]);
|
|
89
|
-
|
|
53
|
+
var ViewDataStore = /*#__PURE__*/function (_AbstractModelWithAsy) {
|
|
90
54
|
function ViewDataStore(sdk, parentRecordStore, viewId) {
|
|
91
55
|
var _this;
|
|
92
|
-
|
|
93
56
|
(0, _classCallCheck2.default)(this, ViewDataStore);
|
|
94
|
-
_this = (
|
|
95
|
-
(0, _defineProperty2.default)(
|
|
96
|
-
(0, _defineProperty2.default)(
|
|
97
|
-
(0, _defineProperty2.default)(
|
|
98
|
-
(0, _defineProperty2.default)(
|
|
57
|
+
_this = _callSuper(this, ViewDataStore, [sdk, "".concat(viewId, "-ViewDataStore")]);
|
|
58
|
+
(0, _defineProperty2.default)(_this, "viewId", void 0);
|
|
59
|
+
(0, _defineProperty2.default)(_this, "parentRecordStore", void 0);
|
|
60
|
+
(0, _defineProperty2.default)(_this, "_mostRecentTableLoadPromise", void 0);
|
|
61
|
+
(0, _defineProperty2.default)(_this, "_airtableInterface", void 0);
|
|
99
62
|
_this.parentRecordStore = parentRecordStore;
|
|
100
63
|
_this._airtableInterface = sdk.__airtableInterface;
|
|
101
64
|
_this._mostRecentTableLoadPromise = null;
|
|
102
65
|
_this.viewId = viewId;
|
|
103
66
|
return _this;
|
|
104
67
|
}
|
|
105
|
-
|
|
106
|
-
(0, _createClass2.default)(ViewDataStore, [{
|
|
68
|
+
(0, _inherits2.default)(ViewDataStore, _AbstractModelWithAsy);
|
|
69
|
+
return (0, _createClass2.default)(ViewDataStore, [{
|
|
70
|
+
key: "_dataOrNullIfDeleted",
|
|
71
|
+
get: function get() {
|
|
72
|
+
var _tableData$viewsById$;
|
|
73
|
+
var tableData = this._baseData.tablesById[this.parentRecordStore.tableId];
|
|
74
|
+
return (_tableData$viewsById$ = tableData === null || tableData === void 0 ? void 0 : tableData.viewsById[this.viewId]) !== null && _tableData$viewsById$ !== void 0 ? _tableData$viewsById$ : null;
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
107
77
|
key: "_onChangeIsDataLoaded",
|
|
108
|
-
value: function _onChangeIsDataLoaded() {
|
|
78
|
+
value: function _onChangeIsDataLoaded() {
|
|
79
|
+
// noop
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "isDataLoaded",
|
|
83
|
+
get: function get() {
|
|
84
|
+
return this._isDataLoaded && this.parentRecordStore.isRecordMetadataLoaded;
|
|
109
85
|
}
|
|
110
86
|
}, {
|
|
111
87
|
key: "__onDataDeletion",
|
|
@@ -114,11 +90,11 @@ function (_AbstractModelWithAsy) {
|
|
|
114
90
|
}
|
|
115
91
|
}, {
|
|
116
92
|
key: "loadDataAsync",
|
|
117
|
-
value: function
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
switch (_context.prev = _context.next) {
|
|
93
|
+
value: function () {
|
|
94
|
+
var _loadDataAsync2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
95
|
+
var tableLoadPromise;
|
|
96
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
97
|
+
while (1) switch (_context.prev = _context.next) {
|
|
122
98
|
case 0:
|
|
123
99
|
// Override this method to also load table data.
|
|
124
100
|
// NOTE: it's important that we call loadDataAsync on the table here and not in
|
|
@@ -128,102 +104,68 @@ function (_AbstractModelWithAsy) {
|
|
|
128
104
|
tableLoadPromise = this.parentRecordStore.loadRecordMetadataAsync();
|
|
129
105
|
this._mostRecentTableLoadPromise = tableLoadPromise;
|
|
130
106
|
_context.next = 4;
|
|
131
|
-
return
|
|
132
|
-
|
|
107
|
+
return (0, _get2.default)((0, _getPrototypeOf2.default)(ViewDataStore.prototype), "loadDataAsync", this).call(this);
|
|
133
108
|
case 4:
|
|
134
109
|
case "end":
|
|
135
110
|
return _context.stop();
|
|
136
111
|
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
112
|
+
}, _callee, this);
|
|
113
|
+
}));
|
|
114
|
+
function loadDataAsync() {
|
|
115
|
+
return _loadDataAsync2.apply(this, arguments);
|
|
116
|
+
}
|
|
117
|
+
return loadDataAsync;
|
|
118
|
+
}()
|
|
140
119
|
}, {
|
|
141
120
|
key: "_loadDataAsync",
|
|
142
|
-
value: function
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
switch (_context2.prev = _context2.next) {
|
|
121
|
+
value: function () {
|
|
122
|
+
var _loadDataAsync3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
123
|
+
var tableLoadPromise, _yield$Promise$all, _yield$Promise$all2, viewData, _iterator, _step, record;
|
|
124
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
125
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
148
126
|
case 0:
|
|
149
127
|
// We need to be sure that the table data is loaded *before* we return
|
|
150
128
|
// from this method.
|
|
151
129
|
(0, _error_utils.invariant)(this._mostRecentTableLoadPromise, 'No table load promise');
|
|
152
130
|
tableLoadPromise = this._mostRecentTableLoadPromise;
|
|
153
131
|
_context2.next = 4;
|
|
154
|
-
return
|
|
155
|
-
|
|
132
|
+
return Promise.all([this._airtableInterface.fetchAndSubscribeToViewDataAsync(this.parentRecordStore.tableId, this.viewId), tableLoadPromise]);
|
|
156
133
|
case 4:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
viewData =
|
|
134
|
+
_yield$Promise$all = _context2.sent;
|
|
135
|
+
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 1);
|
|
136
|
+
viewData = _yield$Promise$all2[0];
|
|
160
137
|
this._data.visibleRecordIds = viewData.visibleRecordIds;
|
|
161
138
|
this._data.fieldOrder = viewData.fieldOrder;
|
|
162
139
|
this._data.groups = viewData.groups;
|
|
163
140
|
this._data.groupLevels = viewData.groupLevels;
|
|
164
141
|
this._data.colorsByRecordId = viewData.colorsByRecordId;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if ((0, _private_utils.has)(this._data.colorsByRecordId, record.id)) {
|
|
180
|
-
record.__triggerOnChangeForRecordColorInViewId(this.viewId);
|
|
142
|
+
if (this._data.colorsByRecordId) {
|
|
143
|
+
_iterator = _createForOfIteratorHelper(this.visibleRecords);
|
|
144
|
+
try {
|
|
145
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
146
|
+
record = _step.value;
|
|
147
|
+
if ((0, _private_utils.has)(this._data.colorsByRecordId, record.id)) {
|
|
148
|
+
record.__triggerOnChangeForRecordColorInViewId(this.viewId);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
} catch (err) {
|
|
152
|
+
_iterator.e(err);
|
|
153
|
+
} finally {
|
|
154
|
+
_iterator.f();
|
|
181
155
|
}
|
|
182
156
|
}
|
|
183
|
-
|
|
184
|
-
_context2.next = 24;
|
|
185
|
-
break;
|
|
186
|
-
|
|
187
|
-
case 20:
|
|
188
|
-
_context2.prev = 20;
|
|
189
|
-
_context2.t0 = _context2["catch"](16);
|
|
190
|
-
_didIteratorError = true;
|
|
191
|
-
_iteratorError = _context2.t0;
|
|
192
|
-
|
|
193
|
-
case 24:
|
|
194
|
-
_context2.prev = 24;
|
|
195
|
-
_context2.prev = 25;
|
|
196
|
-
|
|
197
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
198
|
-
_iterator.return();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
case 27:
|
|
202
|
-
_context2.prev = 27;
|
|
203
|
-
|
|
204
|
-
if (!_didIteratorError) {
|
|
205
|
-
_context2.next = 30;
|
|
206
|
-
break;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
throw _iteratorError;
|
|
210
|
-
|
|
211
|
-
case 30:
|
|
212
|
-
return _context2.finish(27);
|
|
213
|
-
|
|
214
|
-
case 31:
|
|
215
|
-
return _context2.finish(24);
|
|
216
|
-
|
|
217
|
-
case 32:
|
|
218
157
|
return _context2.abrupt("return", [WatchableViewDataStoreKeys.visibleRecords, WatchableViewDataStoreKeys.visibleRecordIds, WatchableViewDataStoreKeys.allFieldIds, WatchableViewDataStoreKeys.groups, WatchableViewDataStoreKeys.groupLevels, WatchableViewDataStoreKeys.visibleFieldIds, WatchableViewDataStoreKeys.recordColors]);
|
|
219
|
-
|
|
220
|
-
case 33:
|
|
158
|
+
case 14:
|
|
221
159
|
case "end":
|
|
222
160
|
return _context2.stop();
|
|
223
161
|
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
162
|
+
}, _callee2, this);
|
|
163
|
+
}));
|
|
164
|
+
function _loadDataAsync() {
|
|
165
|
+
return _loadDataAsync3.apply(this, arguments);
|
|
166
|
+
}
|
|
167
|
+
return _loadDataAsync;
|
|
168
|
+
}()
|
|
227
169
|
}, {
|
|
228
170
|
key: "unloadData",
|
|
229
171
|
value: function unloadData() {
|
|
@@ -238,9 +180,7 @@ function (_AbstractModelWithAsy) {
|
|
|
238
180
|
key: "_unloadData",
|
|
239
181
|
value: function _unloadData() {
|
|
240
182
|
this._mostRecentTableLoadPromise = null;
|
|
241
|
-
|
|
242
183
|
this._airtableInterface.unsubscribeFromViewData(this.parentRecordStore.tableId, this.viewId);
|
|
243
|
-
|
|
244
184
|
if (!this.isDeleted) {
|
|
245
185
|
this._data.visibleRecordIds = undefined;
|
|
246
186
|
this._data.groups = undefined;
|
|
@@ -260,45 +200,30 @@ function (_AbstractModelWithAsy) {
|
|
|
260
200
|
key: "__generateChangesForParentTableDeleteMultipleRecords",
|
|
261
201
|
value: function __generateChangesForParentTableDeleteMultipleRecords(recordIds) {
|
|
262
202
|
var recordIdsToDeleteSet = {};
|
|
263
|
-
var
|
|
264
|
-
|
|
265
|
-
var _iteratorError2 = undefined;
|
|
266
|
-
|
|
203
|
+
var _iterator2 = _createForOfIteratorHelper(recordIds),
|
|
204
|
+
_step2;
|
|
267
205
|
try {
|
|
268
|
-
for (
|
|
206
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
269
207
|
var recordId = _step2.value;
|
|
270
208
|
recordIdsToDeleteSet[recordId] = true;
|
|
271
209
|
}
|
|
272
210
|
} catch (err) {
|
|
273
|
-
|
|
274
|
-
_iteratorError2 = err;
|
|
211
|
+
_iterator2.e(err);
|
|
275
212
|
} finally {
|
|
276
|
-
|
|
277
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
278
|
-
_iterator2.return();
|
|
279
|
-
}
|
|
280
|
-
} finally {
|
|
281
|
-
if (_didIteratorError2) {
|
|
282
|
-
throw _iteratorError2;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
213
|
+
_iterator2.f();
|
|
285
214
|
}
|
|
286
|
-
|
|
287
215
|
var newVisibleRecordIds = this.visibleRecordIds.filter(recordId => !recordIdsToDeleteSet[recordId]);
|
|
288
216
|
var changePayload = [{
|
|
289
217
|
path: ['tablesById', this.parentRecordStore.tableId, 'viewsById', this.viewId, 'visibleRecordIds'],
|
|
290
218
|
value: newVisibleRecordIds
|
|
291
219
|
}];
|
|
292
|
-
|
|
293
220
|
if (this._data.groups) {
|
|
294
221
|
var newGroups = this.__recursivelyRemoveRecordsFromGroupsInPlace((0, _private_utils.cloneDeep)(this._data.groups), recordIdsToDeleteSet);
|
|
295
|
-
|
|
296
222
|
changePayload.push({
|
|
297
223
|
path: ['tablesById', this.parentRecordStore.tableId, 'viewsById', this.viewId, 'groups'],
|
|
298
224
|
value: newGroups
|
|
299
225
|
});
|
|
300
226
|
}
|
|
301
|
-
|
|
302
227
|
return changePayload;
|
|
303
228
|
}
|
|
304
229
|
}, {
|
|
@@ -307,142 +232,40 @@ function (_AbstractModelWithAsy) {
|
|
|
307
232
|
if (!groups || groups.length === 0) {
|
|
308
233
|
return groups;
|
|
309
234
|
}
|
|
310
|
-
|
|
311
235
|
return groups.map(group => {
|
|
312
236
|
if (group.visibleRecordIds) {
|
|
313
237
|
group.visibleRecordIds = group.visibleRecordIds.filter(id => !recordIdsToDeleteSet[id]);
|
|
314
238
|
}
|
|
315
|
-
|
|
316
239
|
this.__recursivelyRemoveRecordsFromGroupsInPlace(group.groups, recordIdsToDeleteSet);
|
|
317
|
-
|
|
318
240
|
return group;
|
|
319
241
|
});
|
|
320
242
|
}
|
|
243
|
+
|
|
321
244
|
/**
|
|
322
245
|
* The record IDs that are not filtered out of this view.
|
|
323
246
|
* Can be watched to know when records are created, deleted, reordered, or
|
|
324
247
|
* filtered in and out of this view.
|
|
325
248
|
*/
|
|
326
|
-
|
|
327
|
-
}, {
|
|
328
|
-
key: "getRecordColor",
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Get the color name for the specified record in this view, or null if no
|
|
332
|
-
* color is available. Watch with 'recordColors'
|
|
333
|
-
*
|
|
334
|
-
* @param recordOrRecordId the record/record id to get the color for
|
|
335
|
-
*/
|
|
336
|
-
value: function getRecordColor(record) {
|
|
337
|
-
var _ref3, _this$_data$colorsByR;
|
|
338
|
-
|
|
339
|
-
(0, _error_utils.invariant)(this.isDataLoaded, 'View data is not loaded');
|
|
340
|
-
return (_ref3 = (_this$_data$colorsByR = this._data.colorsByRecordId) === null || _this$_data$colorsByR === void 0 ? void 0 : _this$_data$colorsByR[record.id]) !== null && _ref3 !== void 0 ? _ref3 : null;
|
|
341
|
-
}
|
|
342
|
-
}, {
|
|
343
|
-
key: "triggerOnChangeForDirtyPaths",
|
|
344
|
-
value: function triggerOnChangeForDirtyPaths(dirtyPaths) {
|
|
345
|
-
if (dirtyPaths.visibleRecordIds) {
|
|
346
|
-
this._onChange(WatchableViewDataStoreKeys.visibleRecords);
|
|
347
|
-
|
|
348
|
-
this._onChange(WatchableViewDataStoreKeys.visibleRecordIds);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (dirtyPaths.fieldOrder) {
|
|
352
|
-
this._onChange(WatchableViewDataStoreKeys.allFieldIds); // TODO(kasra): only trigger visibleFields if the *visible* field ids changed.
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
this._onChange(WatchableViewDataStoreKeys.visibleFieldIds);
|
|
356
|
-
} // Technically it's possible for groupLevels changing to cause a groups
|
|
357
|
-
// change since we derive group information from the groupLevels (fieldId)
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
if (dirtyPaths.groups || dirtyPaths.groupLevels) {
|
|
361
|
-
this._onChange(WatchableViewDataStoreKeys.groups);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
if (dirtyPaths.groupLevels) {
|
|
365
|
-
this._onChange(WatchableViewDataStoreKeys.groupLevels);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
if (dirtyPaths.colorsByRecordId) {
|
|
369
|
-
var changedRecordIds = dirtyPaths.colorsByRecordId._isDirty ? null : Object.keys(dirtyPaths.colorsByRecordId);
|
|
370
|
-
|
|
371
|
-
if (changedRecordIds) {
|
|
372
|
-
// Checking isRecordMetadataLoaded fixes a timing issue:
|
|
373
|
-
// When a new table loads in liveapp, we'll receive the record
|
|
374
|
-
// colors before getting the response to our loadData call.
|
|
375
|
-
// This is a temporary fix: we need a more general solution to
|
|
376
|
-
// avoid processing events associated with subscriptions whose
|
|
377
|
-
// data we haven't received yet.
|
|
378
|
-
if (this.parentRecordStore.isRecordMetadataLoaded) {
|
|
379
|
-
var _iteratorNormalCompletion3 = true;
|
|
380
|
-
var _didIteratorError3 = false;
|
|
381
|
-
var _iteratorError3 = undefined;
|
|
382
|
-
|
|
383
|
-
try {
|
|
384
|
-
for (var _iterator3 = changedRecordIds[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
385
|
-
var recordId = _step3.value;
|
|
386
|
-
var record = this.parentRecordStore.getRecordByIdIfExists(recordId); // Similar to above, we could be receiving the change notification
|
|
387
|
-
// for a record color before receiving the new record itself.
|
|
388
|
-
|
|
389
|
-
if (record) {
|
|
390
|
-
record.__triggerOnChangeForRecordColorInViewId(this.viewId);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
} catch (err) {
|
|
394
|
-
_didIteratorError3 = true;
|
|
395
|
-
_iteratorError3 = err;
|
|
396
|
-
} finally {
|
|
397
|
-
try {
|
|
398
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
399
|
-
_iterator3.return();
|
|
400
|
-
}
|
|
401
|
-
} finally {
|
|
402
|
-
if (_didIteratorError3) {
|
|
403
|
-
throw _iteratorError3;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
this._onChange(WatchableViewDataStoreKeys.recordColors, changedRecordIds);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}, {
|
|
414
|
-
key: "_dataOrNullIfDeleted",
|
|
415
|
-
get: function get() {
|
|
416
|
-
var _ref4;
|
|
417
|
-
|
|
418
|
-
var tableData = this._baseData.tablesById[this.parentRecordStore.tableId];
|
|
419
|
-
return (_ref4 = tableData === null || tableData === void 0 ? void 0 : tableData.viewsById[this.viewId]) !== null && _ref4 !== void 0 ? _ref4 : null;
|
|
420
|
-
}
|
|
421
|
-
}, {
|
|
422
|
-
key: "isDataLoaded",
|
|
423
|
-
get: function get() {
|
|
424
|
-
return this._isDataLoaded && this.parentRecordStore.isRecordMetadataLoaded;
|
|
425
|
-
}
|
|
426
249
|
}, {
|
|
427
250
|
key: "visibleRecordIds",
|
|
428
251
|
get: function get() {
|
|
429
252
|
var visibleRecordIds = this._data.visibleRecordIds;
|
|
430
|
-
(0, _error_utils.invariant)(visibleRecordIds, 'View data is not loaded');
|
|
253
|
+
(0, _error_utils.invariant)(visibleRecordIds, 'View data is not loaded');
|
|
254
|
+
|
|
255
|
+
// Freeze visibleRecordIds so users can't mutate it.
|
|
431
256
|
// If it changes from liveapp, we get an entire new array which will
|
|
432
257
|
// replace this one, so it's okay to freeze it.
|
|
433
|
-
|
|
434
258
|
if (!Object.isFrozen(visibleRecordIds)) {
|
|
435
259
|
Object.freeze(visibleRecordIds);
|
|
436
260
|
}
|
|
437
|
-
|
|
438
261
|
return visibleRecordIds;
|
|
439
262
|
}
|
|
263
|
+
|
|
440
264
|
/**
|
|
441
265
|
* The records that are not filtered out of this view.
|
|
442
266
|
* Can be watched to know when records are created, deleted, reordered, or
|
|
443
267
|
* filtered in and out of this view.
|
|
444
268
|
*/
|
|
445
|
-
|
|
446
269
|
}, {
|
|
447
270
|
key: "visibleRecords",
|
|
448
271
|
get: function get() {
|
|
@@ -455,6 +278,7 @@ function (_AbstractModelWithAsy) {
|
|
|
455
278
|
return record;
|
|
456
279
|
});
|
|
457
280
|
}
|
|
281
|
+
|
|
458
282
|
/**
|
|
459
283
|
* Gets the groups in a view, can be watched to be notified if a record changes groups,
|
|
460
284
|
* if a record is changed/deleted/created, if sort order of groups changes, grouping
|
|
@@ -462,7 +286,6 @@ function (_AbstractModelWithAsy) {
|
|
|
462
286
|
*
|
|
463
287
|
* @hidden
|
|
464
288
|
*/
|
|
465
|
-
|
|
466
289
|
}, {
|
|
467
290
|
key: "groups",
|
|
468
291
|
get: function get() {
|
|
@@ -470,11 +293,11 @@ function (_AbstractModelWithAsy) {
|
|
|
470
293
|
var groups = this._data.groups;
|
|
471
294
|
return groups !== null && groups !== void 0 ? groups : null;
|
|
472
295
|
}
|
|
296
|
+
|
|
473
297
|
/**
|
|
474
298
|
* Gets the group config for this view, can be watched to know when groupLevels
|
|
475
299
|
* changes (reorder, groups deleted, groups changed, grouped field changes)
|
|
476
300
|
*/
|
|
477
|
-
|
|
478
301
|
}, {
|
|
479
302
|
key: "groupLevels",
|
|
480
303
|
get: function get() {
|
|
@@ -482,6 +305,20 @@ function (_AbstractModelWithAsy) {
|
|
|
482
305
|
var groupLevels = this._data.groupLevels;
|
|
483
306
|
return groupLevels !== null && groupLevels !== void 0 ? groupLevels : null;
|
|
484
307
|
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Get the color name for the specified record in this view, or null if no
|
|
311
|
+
* color is available. Watch with 'recordColors'
|
|
312
|
+
*
|
|
313
|
+
* @param recordOrRecordId the record/record id to get the color for
|
|
314
|
+
*/
|
|
315
|
+
}, {
|
|
316
|
+
key: "getRecordColor",
|
|
317
|
+
value: function getRecordColor(record) {
|
|
318
|
+
var _this$_data$colorsByR, _this$_data$colorsByR2;
|
|
319
|
+
(0, _error_utils.invariant)(this.isDataLoaded, 'View data is not loaded');
|
|
320
|
+
return (_this$_data$colorsByR = (_this$_data$colorsByR2 = this._data.colorsByRecordId) === null || _this$_data$colorsByR2 === void 0 ? void 0 : _this$_data$colorsByR2[record.id]) !== null && _this$_data$colorsByR !== void 0 ? _this$_data$colorsByR : null;
|
|
321
|
+
}
|
|
485
322
|
}, {
|
|
486
323
|
key: "allFieldIds",
|
|
487
324
|
get: function get() {
|
|
@@ -497,12 +334,70 @@ function (_AbstractModelWithAsy) {
|
|
|
497
334
|
var fieldIds = fieldOrder.fieldIds;
|
|
498
335
|
return fieldIds.slice(0, fieldOrder.visibleFieldCount);
|
|
499
336
|
}
|
|
337
|
+
}, {
|
|
338
|
+
key: "triggerOnChangeForDirtyPaths",
|
|
339
|
+
value: function triggerOnChangeForDirtyPaths(dirtyPaths) {
|
|
340
|
+
if (dirtyPaths.visibleRecordIds) {
|
|
341
|
+
this._onChange(WatchableViewDataStoreKeys.visibleRecords);
|
|
342
|
+
this._onChange(WatchableViewDataStoreKeys.visibleRecordIds);
|
|
343
|
+
}
|
|
344
|
+
if (dirtyPaths.fieldOrder) {
|
|
345
|
+
this._onChange(WatchableViewDataStoreKeys.allFieldIds);
|
|
346
|
+
// TODO(kasra): only trigger visibleFields if the *visible* field ids changed.
|
|
347
|
+
this._onChange(WatchableViewDataStoreKeys.visibleFieldIds);
|
|
348
|
+
}
|
|
349
|
+
// Technically it's possible for groupLevels changing to cause a groups
|
|
350
|
+
// change since we derive group information from the groupLevels (fieldId)
|
|
351
|
+
if (dirtyPaths.groups || dirtyPaths.groupLevels) {
|
|
352
|
+
this._onChange(WatchableViewDataStoreKeys.groups);
|
|
353
|
+
}
|
|
354
|
+
if (dirtyPaths.groupLevels) {
|
|
355
|
+
this._onChange(WatchableViewDataStoreKeys.groupLevels);
|
|
356
|
+
}
|
|
357
|
+
if (dirtyPaths.colorsByRecordId) {
|
|
358
|
+
var changedRecordIds = dirtyPaths.colorsByRecordId._isDirty ? null : Object.keys(dirtyPaths.colorsByRecordId);
|
|
359
|
+
if (changedRecordIds) {
|
|
360
|
+
// Checking isRecordMetadataLoaded fixes a timing issue:
|
|
361
|
+
// When a new table loads in liveapp, we'll receive the record
|
|
362
|
+
// colors before getting the response to our loadData call.
|
|
363
|
+
// This is a temporary fix: we need a more general solution to
|
|
364
|
+
// avoid processing events associated with subscriptions whose
|
|
365
|
+
// data we haven't received yet.
|
|
366
|
+
if (this.parentRecordStore.isRecordMetadataLoaded) {
|
|
367
|
+
var _iterator3 = _createForOfIteratorHelper(changedRecordIds),
|
|
368
|
+
_step3;
|
|
369
|
+
try {
|
|
370
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
371
|
+
var recordId = _step3.value;
|
|
372
|
+
var record = this.parentRecordStore.getRecordByIdIfExists(recordId);
|
|
373
|
+
// Similar to above, we could be receiving the change notification
|
|
374
|
+
// for a record color before receiving the new record itself.
|
|
375
|
+
if (record) {
|
|
376
|
+
record.__triggerOnChangeForRecordColorInViewId(this.viewId);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
} catch (err) {
|
|
380
|
+
_iterator3.e(err);
|
|
381
|
+
} finally {
|
|
382
|
+
_iterator3.f();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
this._onChange(WatchableViewDataStoreKeys.recordColors, changedRecordIds);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}], [{
|
|
390
|
+
key: "_isWatchableKey",
|
|
391
|
+
value: function _isWatchableKey(key) {
|
|
392
|
+
return (0, _private_utils.isEnumValue)(WatchableViewDataStoreKeys, key);
|
|
393
|
+
}
|
|
394
|
+
}, {
|
|
395
|
+
key: "_shouldLoadDataForKey",
|
|
396
|
+
value: function _shouldLoadDataForKey(key) {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
500
399
|
}]);
|
|
501
|
-
return ViewDataStore;
|
|
502
400
|
}(_abstract_model_with_async_data.default);
|
|
503
401
|
/** @internal */
|
|
504
|
-
|
|
505
|
-
|
|
506
402
|
(0, _defineProperty2.default)(ViewDataStore, "_className", 'ViewDataStore');
|
|
507
|
-
var _default = ViewDataStore;
|
|
508
|
-
exports.default = _default;
|
|
403
|
+
var _default = exports.default = ViewDataStore;
|