@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
package/dist/cjs/sdk.js
CHANGED
|
@@ -1,63 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
require("core-js/modules/es.object.to-string.js");
|
|
5
|
+
require("core-js/modules/es.weak-map.js");
|
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
7
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.object.to-string");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.promise");
|
|
10
|
-
|
|
11
8
|
Object.defineProperty(exports, "__esModule", {
|
|
12
9
|
value: true
|
|
13
10
|
});
|
|
14
11
|
exports.default = void 0;
|
|
15
|
-
|
|
16
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
|
-
|
|
18
|
-
require("regenerator-runtime/runtime");
|
|
19
|
-
|
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
20
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
-
|
|
22
15
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
-
|
|
24
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
17
|
var React = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
-
|
|
30
19
|
var _global_config = _interopRequireDefault(require("./global_config"));
|
|
31
|
-
|
|
32
20
|
var _base = _interopRequireDefault(require("./models/base"));
|
|
33
|
-
|
|
34
21
|
var _session = _interopRequireDefault(require("./models/session"));
|
|
35
|
-
|
|
36
22
|
var _mutations = _interopRequireDefault(require("./models/mutations"));
|
|
37
|
-
|
|
38
23
|
var _cursor = _interopRequireDefault(require("./models/cursor"));
|
|
39
|
-
|
|
40
24
|
var _viewport = _interopRequireDefault(require("./viewport"));
|
|
41
|
-
|
|
42
25
|
var _settings_button = _interopRequireDefault(require("./settings_button"));
|
|
43
|
-
|
|
44
26
|
var _undo_redo = _interopRequireDefault(require("./undo_redo"));
|
|
45
|
-
|
|
46
27
|
var _perform_record_action = require("./perform_record_action");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/** */
|
|
28
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
29
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
|
+
/** @hidden */ /** */
|
|
51
31
|
// NOTE: The version of React running in the Block SDK is controlled by the block.
|
|
52
32
|
// The SDK should not make too many assumptions about which version of React or
|
|
53
33
|
// ReactDOM is running.
|
|
34
|
+
|
|
54
35
|
// HACK: make sure React.PropTypes is defined. If the block is using a newer
|
|
55
36
|
// version of React, PropTypes won't be available, but a few SDK components
|
|
56
37
|
// try to reference it. Once grepping React.PropTypes in hyperbase doesn't
|
|
57
38
|
// return any matches, we can remove this hack.
|
|
39
|
+
|
|
58
40
|
if (!React.PropTypes) {
|
|
59
41
|
React.PropTypes = _propTypes.default;
|
|
60
42
|
}
|
|
43
|
+
|
|
61
44
|
/**
|
|
62
45
|
* @hidden
|
|
63
46
|
* @example
|
|
@@ -73,104 +56,84 @@ if (!React.PropTypes) {
|
|
|
73
56
|
* ```
|
|
74
57
|
*/
|
|
75
58
|
|
|
59
|
+
/** @hidden */
|
|
76
60
|
|
|
77
61
|
/** @internal */
|
|
78
62
|
function defaultUpdateBatcher(applyUpdates) {
|
|
79
63
|
applyUpdates();
|
|
80
64
|
}
|
|
65
|
+
|
|
81
66
|
/**
|
|
82
67
|
* We document this manually.
|
|
83
68
|
*
|
|
84
69
|
* @hidden
|
|
85
70
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var BlockSdk =
|
|
89
|
-
/*#__PURE__*/
|
|
90
|
-
function () {
|
|
91
|
-
/**
|
|
92
|
-
* This value is used by the blocks-testing library to verify
|
|
93
|
-
* compatibility.
|
|
94
|
-
*
|
|
95
|
-
* @hidden
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
/** @internal */
|
|
99
|
-
|
|
100
|
-
/** Storage for this block installation's configuration. */
|
|
101
|
-
|
|
102
|
-
/** Represents the current Airtable {@link Base}. */
|
|
103
|
-
|
|
104
|
-
/** Contains information about the current session. */
|
|
105
|
-
|
|
106
|
-
/** @internal */
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Returns the ID for the current block installation.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```js
|
|
113
|
-
* import {installationId} from '@airtable/blocks';
|
|
114
|
-
* console.log(installationId);
|
|
115
|
-
* // => 'blifDutUr92OKwnUn'
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
/** Controls the block's viewport. You can fullscreen the block and add size
|
|
120
|
-
* constrains using `viewport`.
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
/** @hidden */
|
|
124
|
-
|
|
125
|
-
/** Returns information about the active table, active view, and selected records. */
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Controls the block's {@link settingsButton settings button}.
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
/** @hidden */
|
|
132
|
-
|
|
133
|
-
/** @internal */
|
|
134
|
-
// When models are updated on the frontend, we want to batch them together and have React do a
|
|
135
|
-
// single render.
|
|
136
|
-
//
|
|
137
|
-
// Without this, in sync-mode React (the current default), anything that triggers an update
|
|
138
|
-
// (like .setState or .forceUpdate) will instantly, synchronously re-render. So if you have an
|
|
139
|
-
// update that triggers multiple updates across your tree, you get multiple renders in an
|
|
140
|
-
// unpredictable order. This is bad because it's unnecessary work and the update order can
|
|
141
|
-
// contradict react's normal top-down data flow which can cause subtle bugs.
|
|
142
|
-
//
|
|
143
|
-
// We set _runWithUpdateBatching to ReactDOM.unstable_batchedUpdates to facilitate this. We
|
|
144
|
-
// don't know for sure though that React is in use on the page, so we leave actually setting
|
|
145
|
-
// this when the developer sets up their block with React, in UI.initializeBlock.
|
|
146
|
-
|
|
147
|
-
/** @internal */
|
|
148
|
-
|
|
71
|
+
var BlockSdk = exports.default = /*#__PURE__*/function () {
|
|
149
72
|
/** @hidden */
|
|
150
73
|
function BlockSdk(airtableInterface) {
|
|
151
74
|
(0, _classCallCheck2.default)(this, BlockSdk);
|
|
75
|
+
/** @internal */
|
|
152
76
|
(0, _defineProperty2.default)(this, "__airtableInterface", void 0);
|
|
77
|
+
/** Storage for this block installation's configuration. */
|
|
153
78
|
(0, _defineProperty2.default)(this, "globalConfig", void 0);
|
|
79
|
+
/** Represents the current Airtable {@link Base}. */
|
|
154
80
|
(0, _defineProperty2.default)(this, "base", void 0);
|
|
81
|
+
/** Contains information about the current session. */
|
|
155
82
|
(0, _defineProperty2.default)(this, "session", void 0);
|
|
83
|
+
/** @internal */
|
|
156
84
|
(0, _defineProperty2.default)(this, "__mutations", void 0);
|
|
85
|
+
/**
|
|
86
|
+
* Returns the ID for the current block installation.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```js
|
|
90
|
+
* import {installationId} from '@airtable/blocks';
|
|
91
|
+
* console.log(installationId);
|
|
92
|
+
* // => 'blifDutUr92OKwnUn'
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
157
95
|
(0, _defineProperty2.default)(this, "installationId", void 0);
|
|
96
|
+
/** Controls the block's viewport. You can fullscreen the block and add size
|
|
97
|
+
* constrains using `viewport`.
|
|
98
|
+
*/
|
|
158
99
|
(0, _defineProperty2.default)(this, "viewport", void 0);
|
|
100
|
+
/** @hidden */
|
|
159
101
|
(0, _defineProperty2.default)(this, "runInfo", void 0);
|
|
102
|
+
/** Returns information about the active table, active view, and selected records. */
|
|
160
103
|
(0, _defineProperty2.default)(this, "cursor", void 0);
|
|
104
|
+
/**
|
|
105
|
+
* Controls the block's {@link settingsButton settings button}.
|
|
106
|
+
*/
|
|
161
107
|
(0, _defineProperty2.default)(this, "settingsButton", void 0);
|
|
108
|
+
/** @hidden */
|
|
162
109
|
(0, _defineProperty2.default)(this, "undoRedo", void 0);
|
|
110
|
+
/** @internal */
|
|
163
111
|
(0, _defineProperty2.default)(this, "performRecordAction", void 0);
|
|
112
|
+
// When models are updated on the frontend, we want to batch them together and have React do a
|
|
113
|
+
// single render.
|
|
114
|
+
//
|
|
115
|
+
// Without this, in sync-mode React (the current default), anything that triggers an update
|
|
116
|
+
// (like .setState or .forceUpdate) will instantly, synchronously re-render. So if you have an
|
|
117
|
+
// update that triggers multiple updates across your tree, you get multiple renders in an
|
|
118
|
+
// unpredictable order. This is bad because it's unnecessary work and the update order can
|
|
119
|
+
// contradict react's normal top-down data flow which can cause subtle bugs.
|
|
120
|
+
//
|
|
121
|
+
// We set _runWithUpdateBatching to ReactDOM.unstable_batchedUpdates to facilitate this. We
|
|
122
|
+
// don't know for sure though that React is in use on the page, so we leave actually setting
|
|
123
|
+
// this when the developer sets up their block with React, in UI.initializeBlock.
|
|
124
|
+
/** @internal */
|
|
164
125
|
(0, _defineProperty2.default)(this, "_runWithUpdateBatching", defaultUpdateBatcher);
|
|
165
126
|
this.__airtableInterface = airtableInterface;
|
|
127
|
+
// @ts-ignore
|
|
166
128
|
airtableInterface.assertAllowedSdkPackageVersion("@airtable/blocks", BlockSdk.VERSION);
|
|
167
129
|
var sdkInitData = airtableInterface.sdkInitData;
|
|
168
130
|
this.globalConfig = new _global_config.default(sdkInitData.initialKvValuesByKey, this);
|
|
169
131
|
this.base = new _base.default(this);
|
|
170
|
-
this.installationId = sdkInitData.blockInstallationId;
|
|
132
|
+
this.installationId = sdkInitData.blockInstallationId;
|
|
133
|
+
|
|
134
|
+
// Bind the public methods on this class so users can import
|
|
171
135
|
// just the method, e.g.
|
|
172
136
|
// import {reload} from '@airtable/blocks';
|
|
173
|
-
|
|
174
137
|
this.reload = this.reload.bind(this);
|
|
175
138
|
this.unstable_fetchAsync = this.unstable_fetchAsync.bind(this);
|
|
176
139
|
this.viewport = new _viewport.default(sdkInitData.isFullscreen, airtableInterface);
|
|
@@ -184,33 +147,27 @@ function () {
|
|
|
184
147
|
isFirstRun: sdkInitData.isFirstRun,
|
|
185
148
|
isDevelopmentMode: sdkInitData.isDevelopmentMode,
|
|
186
149
|
intentData: sdkInitData.intentData
|
|
187
|
-
});
|
|
150
|
+
});
|
|
188
151
|
|
|
189
|
-
|
|
152
|
+
// Now that we've constructed our models, let's hook them up to realtime changes.
|
|
153
|
+
this._registerHandlers();
|
|
190
154
|
|
|
155
|
+
// TODO: freeze this object before we ship the code editor.
|
|
191
156
|
}
|
|
192
157
|
/** @internal */
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
(0, _createClass2.default)(BlockSdk, [{
|
|
158
|
+
return (0, _createClass2.default)(BlockSdk, [{
|
|
196
159
|
key: "__applyModelChanges",
|
|
197
160
|
value: function __applyModelChanges(changes) {
|
|
198
161
|
this._runWithUpdateBatching(() => {
|
|
199
162
|
var changedBasePaths = this.base.__applyChangesWithoutTriggeringEvents(changes);
|
|
200
|
-
|
|
201
163
|
var changedCursorKeys = this.cursor.__applyChangesWithoutTriggeringEvents(changes);
|
|
202
|
-
|
|
203
164
|
var changedSessionKeys = this.session.__applyChangesWithoutTriggeringEvents(changes);
|
|
204
|
-
|
|
205
165
|
this.base.__triggerOnChangeForChangedPaths(changedBasePaths);
|
|
206
|
-
|
|
207
166
|
this.cursor.__triggerOnChangeForChangedKeys(changedCursorKeys);
|
|
208
|
-
|
|
209
167
|
this.session.__triggerOnChangeForChangedKeys(changedSessionKeys);
|
|
210
168
|
});
|
|
211
169
|
}
|
|
212
170
|
/** @internal */
|
|
213
|
-
|
|
214
171
|
}, {
|
|
215
172
|
key: "__applyGlobalConfigUpdates",
|
|
216
173
|
value: function __applyGlobalConfigUpdates(updates) {
|
|
@@ -219,25 +176,23 @@ function () {
|
|
|
219
176
|
});
|
|
220
177
|
}
|
|
221
178
|
/** @internal */
|
|
222
|
-
|
|
223
179
|
}, {
|
|
224
180
|
key: "_registerHandlers",
|
|
225
181
|
value: function _registerHandlers() {
|
|
226
182
|
// base
|
|
227
|
-
this.__airtableInterface.subscribeToModelUpdates((_ref) => {
|
|
228
|
-
var changes = _ref.changes;
|
|
229
183
|
|
|
184
|
+
this.__airtableInterface.subscribeToModelUpdates(_ref => {
|
|
185
|
+
var changes = _ref.changes;
|
|
230
186
|
this.__applyModelChanges(changes);
|
|
231
|
-
});
|
|
232
|
-
|
|
187
|
+
});
|
|
233
188
|
|
|
234
|
-
|
|
189
|
+
// global config
|
|
190
|
+
this.__airtableInterface.subscribeToGlobalConfigUpdates(_ref2 => {
|
|
235
191
|
var updates = _ref2.updates;
|
|
236
|
-
|
|
237
192
|
this.__applyGlobalConfigUpdates(updates);
|
|
238
|
-
});
|
|
239
|
-
|
|
193
|
+
});
|
|
240
194
|
|
|
195
|
+
// settings button
|
|
241
196
|
this.__airtableInterface.subscribeToSettingsButtonClick(() => {
|
|
242
197
|
if (this.settingsButton.isVisible) {
|
|
243
198
|
this._runWithUpdateBatching(() => {
|
|
@@ -246,21 +201,19 @@ function () {
|
|
|
246
201
|
this.settingsButton.__onClick();
|
|
247
202
|
});
|
|
248
203
|
}
|
|
249
|
-
});
|
|
250
|
-
|
|
204
|
+
});
|
|
251
205
|
|
|
206
|
+
// viewport
|
|
252
207
|
this.__airtableInterface.subscribeToEnterFullScreen(() => {
|
|
253
208
|
this._runWithUpdateBatching(() => {
|
|
254
209
|
this.viewport.__onEnterFullscreen();
|
|
255
210
|
});
|
|
256
211
|
});
|
|
257
|
-
|
|
258
212
|
this.__airtableInterface.subscribeToExitFullScreen(() => {
|
|
259
213
|
this._runWithUpdateBatching(() => {
|
|
260
214
|
this.viewport.__onExitFullscreen();
|
|
261
215
|
});
|
|
262
216
|
});
|
|
263
|
-
|
|
264
217
|
this.__airtableInterface.subscribeToFocus(() => {
|
|
265
218
|
this._runWithUpdateBatching(() => {
|
|
266
219
|
this.viewport.__focus();
|
|
@@ -281,60 +234,62 @@ function () {
|
|
|
281
234
|
* initializeBlock(() => <MyBlock />);
|
|
282
235
|
* ```
|
|
283
236
|
*/
|
|
284
|
-
|
|
285
237
|
}, {
|
|
286
238
|
key: "reload",
|
|
287
239
|
value: function reload() {
|
|
288
240
|
this.__airtableInterface.reloadFrame();
|
|
289
241
|
}
|
|
290
242
|
/** @internal */
|
|
291
|
-
|
|
292
243
|
}, {
|
|
293
244
|
key: "__setBatchedUpdatesFn",
|
|
294
245
|
value: function __setBatchedUpdatesFn(newUpdateBatcher) {
|
|
295
246
|
this._runWithUpdateBatching = newUpdateBatcher;
|
|
296
247
|
}
|
|
248
|
+
|
|
297
249
|
/**
|
|
298
250
|
* @internal
|
|
299
251
|
*/
|
|
300
|
-
|
|
301
252
|
}, {
|
|
302
|
-
key: "
|
|
253
|
+
key: "__appInterface",
|
|
254
|
+
get: function get() {
|
|
255
|
+
return this.base._baseData.appInterface;
|
|
256
|
+
}
|
|
303
257
|
|
|
304
258
|
/** @hidden */
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
259
|
+
}, {
|
|
260
|
+
key: "unstable_fetchAsync",
|
|
261
|
+
value: (function () {
|
|
262
|
+
var _unstable_fetchAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(requestJson) {
|
|
263
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
264
|
+
while (1) switch (_context.prev = _context.next) {
|
|
309
265
|
case 0:
|
|
310
266
|
_context.next = 2;
|
|
311
|
-
return
|
|
312
|
-
|
|
267
|
+
return this.__airtableInterface.performBackendFetchAsync(requestJson);
|
|
313
268
|
case 2:
|
|
314
269
|
return _context.abrupt("return", _context.sent);
|
|
315
|
-
|
|
316
270
|
case 3:
|
|
317
271
|
case "end":
|
|
318
272
|
return _context.stop();
|
|
319
273
|
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
274
|
+
}, _callee, this);
|
|
275
|
+
}));
|
|
276
|
+
function unstable_fetchAsync(_x) {
|
|
277
|
+
return _unstable_fetchAsync.apply(this, arguments);
|
|
278
|
+
}
|
|
279
|
+
return unstable_fetchAsync;
|
|
280
|
+
}() /** @hidden */)
|
|
325
281
|
}, {
|
|
326
282
|
key: "getBlockRunContext",
|
|
327
283
|
value: function getBlockRunContext() {
|
|
328
284
|
return this.__airtableInterface.sdkInitData.runContext;
|
|
329
285
|
}
|
|
330
|
-
}, {
|
|
331
|
-
key: "__appInterface",
|
|
332
|
-
get: function get() {
|
|
333
|
-
return this.base._baseData.appInterface;
|
|
334
|
-
}
|
|
335
286
|
}]);
|
|
336
|
-
return BlockSdk;
|
|
337
287
|
}();
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
288
|
+
/**
|
|
289
|
+
* This value is used by the blocks-testing library to verify
|
|
290
|
+
* compatibility.
|
|
291
|
+
*
|
|
292
|
+
* @hidden
|
|
293
|
+
*/
|
|
294
|
+
// @ts-ignore
|
|
295
|
+
(0, _defineProperty2.default)(BlockSdk, "VERSION", "1.18.2");
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
|
|
14
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
14
|
var _watchable = _interopRequireDefault(require("./watchable"));
|
|
25
|
-
|
|
26
15
|
var _private_utils = require("./private_utils");
|
|
27
|
-
|
|
28
|
-
/** @module @airtable/blocks: settingsButton */
|
|
29
|
-
|
|
30
|
-
/** */
|
|
16
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @module @airtable/blocks: settingsButton */ /** */
|
|
31
18
|
var WatchableSettingsButtonKeys = Object.freeze({
|
|
32
19
|
isVisible: 'isVisible',
|
|
33
20
|
click: 'click'
|
|
34
21
|
});
|
|
22
|
+
|
|
35
23
|
/**
|
|
36
24
|
* A watchable key in {@link SettingsButton}.
|
|
37
25
|
* - `isVisible`
|
|
38
26
|
* - `click`
|
|
39
27
|
*/
|
|
40
|
-
|
|
41
28
|
/**
|
|
42
29
|
* Interface to the settings button that lives outside the extension's viewport.
|
|
43
30
|
*
|
|
@@ -71,95 +58,81 @@ var WatchableSettingsButtonKeys = Object.freeze({
|
|
|
71
58
|
* ```
|
|
72
59
|
* @docsPath models/SettingsButton
|
|
73
60
|
*/
|
|
74
|
-
var SettingsButton =
|
|
75
|
-
/*#__PURE__*/
|
|
76
|
-
function (_Watchable) {
|
|
77
|
-
(0, _inherits2.default)(SettingsButton, _Watchable);
|
|
78
|
-
(0, _createClass2.default)(SettingsButton, null, [{
|
|
79
|
-
key: "_isWatchableKey",
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
|
|
83
|
-
/** @internal */
|
|
84
|
-
value: function _isWatchableKey(key) {
|
|
85
|
-
return (0, _private_utils.isEnumValue)(WatchableSettingsButtonKeys, key);
|
|
86
|
-
}
|
|
87
|
-
/** @internal */
|
|
88
|
-
|
|
89
|
-
}]);
|
|
90
|
-
|
|
61
|
+
var SettingsButton = /*#__PURE__*/function (_Watchable) {
|
|
91
62
|
/** @internal */
|
|
92
63
|
function SettingsButton(airtableInterface) {
|
|
93
64
|
var _this;
|
|
94
|
-
|
|
95
65
|
(0, _classCallCheck2.default)(this, SettingsButton);
|
|
96
|
-
_this = (
|
|
97
|
-
|
|
98
|
-
(0, _defineProperty2.default)(
|
|
66
|
+
_this = _callSuper(this, SettingsButton);
|
|
67
|
+
/** @internal */
|
|
68
|
+
(0, _defineProperty2.default)(_this, "_refCount", void 0);
|
|
69
|
+
/** @internal */
|
|
70
|
+
(0, _defineProperty2.default)(_this, "_airtableInterface", void 0);
|
|
99
71
|
_this._refCount = 0;
|
|
100
72
|
_this._airtableInterface = airtableInterface;
|
|
101
73
|
return _this;
|
|
102
74
|
}
|
|
75
|
+
|
|
103
76
|
/**
|
|
104
77
|
* Whether the settings button is being shown.
|
|
105
78
|
* Can be watched.
|
|
106
79
|
*/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
80
|
+
(0, _inherits2.default)(SettingsButton, _Watchable);
|
|
81
|
+
return (0, _createClass2.default)(SettingsButton, [{
|
|
82
|
+
key: "isVisible",
|
|
83
|
+
get: function get() {
|
|
84
|
+
return this._refCount > 0;
|
|
85
|
+
}
|
|
111
86
|
|
|
112
87
|
/**
|
|
113
88
|
* Show the settings button.
|
|
114
89
|
*/
|
|
90
|
+
}, {
|
|
91
|
+
key: "show",
|
|
115
92
|
value: function show() {
|
|
116
93
|
// Is now visible: trigger change watches and set it to be visible
|
|
117
94
|
if (this._refCount === 0) {
|
|
118
95
|
this._onChange(WatchableSettingsButtonKeys.isVisible, true);
|
|
119
|
-
|
|
120
96
|
this._airtableInterface.setSettingsButtonVisibility(true);
|
|
121
97
|
}
|
|
122
|
-
|
|
123
98
|
this._refCount += 1;
|
|
124
99
|
}
|
|
100
|
+
|
|
125
101
|
/**
|
|
126
102
|
* Hide the settings button.
|
|
127
103
|
*
|
|
128
104
|
* Note: A count of calls to `show()` and `hide()` is maintained internally. The button will
|
|
129
105
|
* stay visible if there are more calls to `show()` than `hide()`.
|
|
130
106
|
*/
|
|
131
|
-
|
|
132
107
|
}, {
|
|
133
108
|
key: "hide",
|
|
134
109
|
value: function hide() {
|
|
135
110
|
// Be forgiving if hide() is called too many times, since we don't expose the count
|
|
136
111
|
if (this._refCount > 0) {
|
|
137
112
|
this._refCount -= 1;
|
|
138
|
-
}
|
|
139
|
-
|
|
113
|
+
}
|
|
140
114
|
|
|
115
|
+
// Should no longer be visible: trigger change watches and set it to be not visible
|
|
141
116
|
if (this._refCount === 0) {
|
|
142
117
|
this._onChange(WatchableSettingsButtonKeys.isVisible, false);
|
|
143
|
-
|
|
144
118
|
this._airtableInterface.setSettingsButtonVisibility(false);
|
|
145
119
|
}
|
|
146
120
|
}
|
|
147
|
-
/** @internal */
|
|
148
121
|
|
|
122
|
+
/** @internal */
|
|
149
123
|
}, {
|
|
150
124
|
key: "__onClick",
|
|
151
125
|
value: function __onClick() {
|
|
152
126
|
this._onChange(WatchableSettingsButtonKeys.click);
|
|
153
127
|
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "
|
|
156
|
-
|
|
157
|
-
|
|
128
|
+
}], [{
|
|
129
|
+
key: "_isWatchableKey",
|
|
130
|
+
value: /** @internal */
|
|
131
|
+
function _isWatchableKey(key) {
|
|
132
|
+
return (0, _private_utils.isEnumValue)(WatchableSettingsButtonKeys, key);
|
|
158
133
|
}
|
|
159
134
|
}]);
|
|
160
|
-
return SettingsButton;
|
|
161
135
|
}(_watchable.default);
|
|
162
|
-
|
|
136
|
+
/** @internal */
|
|
163
137
|
(0, _defineProperty2.default)(SettingsButton, "_className", 'SettingsButton');
|
|
164
|
-
var _default = SettingsButton;
|
|
165
|
-
exports.default = _default;
|
|
138
|
+
var _default = exports.default = SettingsButton;
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.blockStats = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _airtable_interface = _interopRequireDefault(require("../injected/airtable_interface"));
|
|
15
|
-
|
|
16
11
|
// NOTE(richsinn): this client is effectively an implementation of the StatsClient interface
|
|
17
12
|
// for Datadog. For example, see https://github.com/Hyperbase/hyperbase/blob/development/client_server_shared/stats/stats_client.tsx
|
|
18
|
-
|
|
19
13
|
/** @hidden */
|
|
20
|
-
var BlockStats =
|
|
21
|
-
/*#__PURE__*/
|
|
22
|
-
function () {
|
|
14
|
+
var BlockStats = /*#__PURE__*/function () {
|
|
23
15
|
function BlockStats() {
|
|
24
16
|
(0, _classCallCheck2.default)(this, BlockStats);
|
|
25
17
|
}
|
|
26
|
-
|
|
27
|
-
(0, _createClass2.default)(BlockStats, [{
|
|
18
|
+
return (0, _createClass2.default)(BlockStats, [{
|
|
28
19
|
key: "increment",
|
|
29
20
|
value: function increment(stat, tags) {
|
|
30
21
|
this.incrementBy(stat, 1, tags);
|
|
@@ -101,8 +92,5 @@ function () {
|
|
|
101
92
|
this.incrementBy(stat + '.sum', time, tags);
|
|
102
93
|
}
|
|
103
94
|
}]);
|
|
104
|
-
return BlockStats;
|
|
105
95
|
}();
|
|
106
|
-
|
|
107
|
-
var blockStats = new BlockStats();
|
|
108
|
-
exports.blockStats = blockStats;
|
|
96
|
+
var blockStats = exports.blockStats = new BlockStats();
|