@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,47 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.object.to-string.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.array.iterator");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
10
|
-
|
|
11
6
|
Object.defineProperty(exports, "__esModule", {
|
|
12
7
|
value: true
|
|
13
8
|
});
|
|
14
9
|
exports.default = void 0;
|
|
15
|
-
|
|
10
|
+
require("core-js/modules/es.array.iterator.js");
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
25
|
-
|
|
26
16
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
27
|
-
|
|
28
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
-
|
|
30
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
|
-
|
|
32
19
|
var React = _interopRequireWildcard(require("react"));
|
|
33
|
-
|
|
34
20
|
var _sdk_context = require("./sdk_context");
|
|
35
|
-
|
|
36
21
|
var _with_hooks = _interopRequireDefault(require("./with_hooks"));
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
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)); }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
26
|
+
* @module @airtable/blocks/ui: ViewportConstraint
|
|
27
|
+
* @docsPath UI/components/ViewportConstraint
|
|
28
|
+
*/ /** */
|
|
29
|
+
/** An object specifying a width and/or height for the block's viewport. */
|
|
37
30
|
|
|
38
31
|
/**
|
|
39
|
-
*
|
|
32
|
+
* Props for the {@link ViewportConstraint} component.
|
|
33
|
+
*
|
|
40
34
|
* @docsPath UI/components/ViewportConstraint
|
|
41
35
|
*/
|
|
42
36
|
|
|
43
|
-
/** */
|
|
44
37
|
var didSizeChange = (prev, next) => (prev && prev.width) !== (next && next.width) || (prev && prev.height) !== (next && next.height);
|
|
38
|
+
|
|
45
39
|
/**
|
|
46
40
|
* When mounted, this wrapper component applies size constraints to the {@link Viewport}.
|
|
47
41
|
* Like {@link addMinSize}, this will fullscreen the extension if necessary and possible when
|
|
@@ -63,125 +57,107 @@ var didSizeChange = (prev, next) => (prev && prev.width) !== (next && next.width
|
|
|
63
57
|
* @docsPath UI/components/ViewportConstraint
|
|
64
58
|
* @component
|
|
65
59
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var ViewportConstraint =
|
|
69
|
-
/*#__PURE__*/
|
|
70
|
-
function (_React$Component) {
|
|
71
|
-
(0, _inherits2.default)(ViewportConstraint, _React$Component);
|
|
72
|
-
|
|
60
|
+
var ViewportConstraint = /*#__PURE__*/function (_React$Component) {
|
|
73
61
|
function ViewportConstraint() {
|
|
74
62
|
var _this;
|
|
75
|
-
|
|
76
63
|
(0, _classCallCheck2.default)(this, ViewportConstraint);
|
|
77
|
-
|
|
78
64
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
65
|
args[_key] = arguments[_key];
|
|
80
66
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(0, _defineProperty2.default)(
|
|
84
|
-
|
|
67
|
+
_this = _callSuper(this, ViewportConstraint, [...args]);
|
|
68
|
+
/** @internal */
|
|
69
|
+
(0, _defineProperty2.default)(_this, "_removeMinSizeConstraintFn", null);
|
|
70
|
+
/** @internal */
|
|
71
|
+
(0, _defineProperty2.default)(_this, "_removeMaxFullscreenSizeConstrainFn", null);
|
|
85
72
|
return _this;
|
|
86
73
|
}
|
|
87
|
-
|
|
88
|
-
(0, _createClass2.default)(ViewportConstraint, [{
|
|
74
|
+
(0, _inherits2.default)(ViewportConstraint, _React$Component);
|
|
75
|
+
return (0, _createClass2.default)(ViewportConstraint, [{
|
|
89
76
|
key: "componentDidMount",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
value: function componentDidMount() {
|
|
77
|
+
value: /** @hidden */
|
|
78
|
+
function componentDidMount() {
|
|
93
79
|
this._setMinSizeConstraint();
|
|
94
|
-
|
|
95
80
|
this._setMaxFullscreenSizeConstraint();
|
|
96
81
|
}
|
|
97
|
-
/** @hidden */
|
|
98
82
|
|
|
83
|
+
/** @hidden */
|
|
99
84
|
}, {
|
|
100
85
|
key: "shouldComponentUpdate",
|
|
101
86
|
value: function shouldComponentUpdate(nextProps) {
|
|
102
87
|
return this.props.children !== nextProps.children || didSizeChange(this.props.minSize, nextProps.minSize) || didSizeChange(this.props.maxFullscreenSize, nextProps.maxFullscreenSize);
|
|
103
88
|
}
|
|
104
|
-
/** @hidden */
|
|
105
89
|
|
|
90
|
+
/** @hidden */
|
|
106
91
|
}, {
|
|
107
92
|
key: "componentDidUpdate",
|
|
108
93
|
value: function componentDidUpdate(prevProps) {
|
|
109
94
|
if (didSizeChange(prevProps.minSize, this.props.minSize)) {
|
|
110
95
|
this._setMinSizeConstraint();
|
|
111
96
|
}
|
|
112
|
-
|
|
113
97
|
if (didSizeChange(prevProps.maxFullscreenSize, this.props.maxFullscreenSize)) {
|
|
114
98
|
this._setMaxFullscreenSizeConstraint();
|
|
115
99
|
}
|
|
116
100
|
}
|
|
117
|
-
/** @hidden */
|
|
118
101
|
|
|
102
|
+
/** @hidden */
|
|
119
103
|
}, {
|
|
120
104
|
key: "componentWillUnmount",
|
|
121
105
|
value: function componentWillUnmount() {
|
|
122
106
|
this._removeMinSizeConstraint();
|
|
123
|
-
|
|
124
107
|
this._removeMaxFullscreenSizeConstraint();
|
|
125
108
|
}
|
|
126
|
-
/** @internal */
|
|
127
109
|
|
|
110
|
+
/** @internal */
|
|
128
111
|
}, {
|
|
129
112
|
key: "_removeMinSizeConstraint",
|
|
130
113
|
value: function _removeMinSizeConstraint() {
|
|
131
114
|
if (this._removeMinSizeConstraintFn) {
|
|
132
115
|
this._removeMinSizeConstraintFn();
|
|
133
|
-
|
|
134
116
|
this._removeMinSizeConstraintFn = null;
|
|
135
117
|
}
|
|
136
118
|
}
|
|
137
|
-
/** @internal */
|
|
138
119
|
|
|
120
|
+
/** @internal */
|
|
139
121
|
}, {
|
|
140
122
|
key: "_removeMaxFullscreenSizeConstraint",
|
|
141
123
|
value: function _removeMaxFullscreenSizeConstraint() {
|
|
142
124
|
if (this._removeMaxFullscreenSizeConstrainFn) {
|
|
143
125
|
this._removeMaxFullscreenSizeConstrainFn();
|
|
144
|
-
|
|
145
126
|
this._removeMaxFullscreenSizeConstrainFn = null;
|
|
146
127
|
}
|
|
147
128
|
}
|
|
148
|
-
/** @internal */
|
|
149
129
|
|
|
130
|
+
/** @internal */
|
|
150
131
|
}, {
|
|
151
132
|
key: "_setMinSizeConstraint",
|
|
152
133
|
value: function _setMinSizeConstraint() {
|
|
153
134
|
this._removeMinSizeConstraint();
|
|
154
|
-
|
|
155
135
|
var minSize = this.props.minSize;
|
|
156
|
-
|
|
157
136
|
if (minSize) {
|
|
158
137
|
this._removeMinSizeConstraintFn = this.props.sdk.viewport.addMinSize(minSize);
|
|
159
138
|
}
|
|
160
139
|
}
|
|
161
|
-
/** @internal */
|
|
162
140
|
|
|
141
|
+
/** @internal */
|
|
163
142
|
}, {
|
|
164
143
|
key: "_setMaxFullscreenSizeConstraint",
|
|
165
144
|
value: function _setMaxFullscreenSizeConstraint() {
|
|
166
145
|
this._removeMaxFullscreenSizeConstraint();
|
|
167
|
-
|
|
168
146
|
var maxFullscreenSize = this.props.maxFullscreenSize;
|
|
169
|
-
|
|
170
147
|
if (maxFullscreenSize) {
|
|
171
148
|
this._removeMaxFullscreenSizeConstrainFn = this.props.sdk.viewport.addMaxFullscreenSize(maxFullscreenSize);
|
|
172
149
|
}
|
|
173
150
|
}
|
|
174
|
-
/** @hidden */
|
|
175
151
|
|
|
152
|
+
/** @hidden */
|
|
176
153
|
}, {
|
|
177
154
|
key: "render",
|
|
178
155
|
value: function render() {
|
|
179
|
-
return React.createElement(React.Fragment, null, this.props.children);
|
|
156
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.children);
|
|
180
157
|
}
|
|
181
158
|
}]);
|
|
182
|
-
return ViewportConstraint;
|
|
183
159
|
}(React.Component);
|
|
184
|
-
|
|
160
|
+
/** @hidden */
|
|
185
161
|
(0, _defineProperty2.default)(ViewportConstraint, "propTypes", {
|
|
186
162
|
minSize: _propTypes.default.shape({
|
|
187
163
|
width: _propTypes.default.number,
|
|
@@ -193,11 +169,8 @@ function (_React$Component) {
|
|
|
193
169
|
}),
|
|
194
170
|
children: _propTypes.default.node
|
|
195
171
|
});
|
|
196
|
-
|
|
197
|
-
var _default = (0, _with_hooks.default)(ViewportConstraint, props => {
|
|
172
|
+
var _default = exports.default = (0, _with_hooks.default)(ViewportConstraint, props => {
|
|
198
173
|
return {
|
|
199
174
|
sdk: (0, _sdk_context.useSdk)()
|
|
200
175
|
};
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
exports.default = _default;
|
|
176
|
+
});
|
|
@@ -1,23 +1,20 @@
|
|
|
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
8
|
Object.defineProperty(exports, "__esModule", {
|
|
8
9
|
value: true
|
|
9
10
|
});
|
|
10
11
|
exports.default = withHooks;
|
|
11
|
-
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
13
|
var React = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
14
|
var _error_utils = require("../error_utils");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/** */
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
/** @module @airtable/blocks/ui: withHooks */ /** */
|
|
21
18
|
|
|
22
19
|
/**
|
|
23
20
|
* @hidden
|
|
@@ -112,44 +109,42 @@ function withHooks(Component, getAdditionalPropsToInject) {
|
|
|
112
109
|
if (!getAdditionalPropsToInject) {
|
|
113
110
|
throw (0, _error_utils.spawnError)('withHooks: getAdditionalPropsToInject is required');
|
|
114
111
|
}
|
|
115
|
-
|
|
116
|
-
return React.forwardRef((props, forwardedRef) => {
|
|
112
|
+
return /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
117
113
|
var propsToInject = getAdditionalPropsToInject(props);
|
|
118
|
-
|
|
119
114
|
if (propsToInject === null || typeof propsToInject !== 'object') {
|
|
120
115
|
throw (0, _error_utils.spawnError)('withHooks: getAdditionalPropsToInject must return an object');
|
|
121
|
-
}
|
|
122
|
-
// with the component instance, so we need to pass it down to the component we're wrapping.
|
|
116
|
+
}
|
|
123
117
|
|
|
118
|
+
// getAdditionalPropsToInject may return a ref. We want to make sure this ref gets populated
|
|
119
|
+
// with the component instance, so we need to pass it down to the component we're wrapping.
|
|
120
|
+
var injectedRef = propsToInject.ref;
|
|
124
121
|
|
|
125
|
-
|
|
122
|
+
// we might have a second ref passed in from the parent though - a consumer trying to use
|
|
126
123
|
// the wrapped component who also wants a reference to the component instance. in order to
|
|
127
124
|
// support both these use-cases, we need to set both refs. to do this, we create a function
|
|
128
125
|
// ref that sets both the injectedRef and forwardedRef. Each ref can be either a function
|
|
129
126
|
// ref or object ref, so we handle both these cases.
|
|
130
|
-
|
|
131
127
|
var mergedRef = React.useMemo(() => {
|
|
132
128
|
if (!injectedRef && !forwardedRef) {
|
|
133
129
|
return undefined;
|
|
134
130
|
}
|
|
135
|
-
|
|
136
131
|
return instance => {
|
|
137
132
|
if (injectedRef && typeof injectedRef === 'object') {
|
|
138
133
|
injectedRef.current = instance;
|
|
139
134
|
} else if (typeof injectedRef === 'function') {
|
|
140
135
|
injectedRef(instance);
|
|
141
136
|
}
|
|
142
|
-
|
|
143
137
|
if (forwardedRef && typeof forwardedRef === 'object') {
|
|
144
138
|
forwardedRef.current = instance;
|
|
145
139
|
} else if (typeof forwardedRef === 'function') {
|
|
146
140
|
forwardedRef(instance);
|
|
147
141
|
}
|
|
148
142
|
};
|
|
149
|
-
}, [injectedRef, forwardedRef]);
|
|
150
|
-
// any 'ref's in props or propsToInject.
|
|
143
|
+
}, [injectedRef, forwardedRef]);
|
|
151
144
|
|
|
152
|
-
|
|
145
|
+
// It's important that the ref prop comes at the end, so it overrides
|
|
146
|
+
// any 'ref's in props or propsToInject.
|
|
147
|
+
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({}, props, propsToInject, {
|
|
153
148
|
ref: mergedRef
|
|
154
149
|
}));
|
|
155
150
|
});
|
|
@@ -1,51 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.array.filter.js");
|
|
6
|
+
require("core-js/modules/es.array.from.js");
|
|
7
|
+
require("core-js/modules/es.array.slice.js");
|
|
8
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
9
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
10
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
11
|
+
require("core-js/modules/es.weak-map.js");
|
|
12
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
5
13
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.description");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.filter");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.iterator");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.to-string");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.set");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
24
|
-
|
|
25
14
|
Object.defineProperty(exports, "__esModule", {
|
|
26
15
|
value: true
|
|
27
16
|
});
|
|
28
17
|
exports.default = withStyledSystem;
|
|
29
18
|
exports.splitStyleProps = splitStyleProps;
|
|
30
|
-
|
|
19
|
+
require("core-js/modules/es.array.iterator.js");
|
|
20
|
+
require("core-js/modules/es.object.to-string.js");
|
|
21
|
+
require("core-js/modules/es.set.js");
|
|
22
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
31
23
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
32
|
-
|
|
33
24
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
34
|
-
|
|
35
25
|
var React = _interopRequireWildcard(require("react"));
|
|
36
|
-
|
|
37
26
|
var _emotion = require("emotion");
|
|
38
|
-
|
|
39
27
|
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
40
|
-
|
|
41
28
|
var _private_utils = require("../private_utils");
|
|
42
|
-
|
|
43
29
|
var _use_styled_system = _interopRequireDefault(require("./use_styled_system"));
|
|
44
|
-
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
|
|
30
|
+
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); }
|
|
31
|
+
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; }
|
|
32
|
+
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; } } }; }
|
|
33
|
+
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; } }
|
|
34
|
+
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; }
|
|
35
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
49
37
|
/**
|
|
50
38
|
* @internal
|
|
51
39
|
* A higher-order component for working with the `useStyledSystem` hook in class-based components.
|
|
@@ -118,24 +106,24 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
118
106
|
* ```
|
|
119
107
|
*/
|
|
120
108
|
function withStyledSystem(Component, styleParser, stylePropTypes, defaultStyleProps) {
|
|
121
|
-
var WithStyledSystem = React.forwardRef((props, ref) => {
|
|
109
|
+
var WithStyledSystem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
122
110
|
var _splitStyleProps = splitStyleProps(props, styleParser.propNames, defaultStyleProps),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
styleProps = _splitStyleProps.styleProps,
|
|
112
|
+
nonStyleProps = _splitStyleProps.nonStyleProps;
|
|
126
113
|
var classNameForStyleProps = (0, _use_styled_system.default)((0, _private_utils.cast)(styleProps), styleParser);
|
|
127
|
-
return React.createElement(Component, (0, _extends2.default)({
|
|
114
|
+
return /*#__PURE__*/React.createElement(Component, (0, _extends2.default)({
|
|
128
115
|
ref: ref
|
|
129
116
|
}, nonStyleProps, {
|
|
130
117
|
className: (0, _emotion.cx)(classNameForStyleProps, nonStyleProps.className)
|
|
131
118
|
}));
|
|
132
119
|
});
|
|
133
|
-
WithStyledSystem.propTypes = _objectSpread({}, Component.propTypes,
|
|
120
|
+
WithStyledSystem.propTypes = _objectSpread(_objectSpread({}, Component.propTypes), stylePropTypes);
|
|
134
121
|
var componentName = Component.displayName || Component.name || 'Component';
|
|
135
122
|
WithStyledSystem.displayName = "WithStyledSystem(".concat(componentName, ")");
|
|
136
123
|
(0, _hoistNonReactStatics.default)(WithStyledSystem, Component);
|
|
137
124
|
return WithStyledSystem;
|
|
138
125
|
}
|
|
126
|
+
|
|
139
127
|
/**
|
|
140
128
|
* @internal
|
|
141
129
|
* A helper method to split props into style props (for use with styled system) and
|
|
@@ -148,22 +136,17 @@ function withStyledSystem(Component, styleParser, stylePropTypes, defaultStylePr
|
|
|
148
136
|
* @param stylePropNames The list of allowed style prop names.
|
|
149
137
|
* @param defaultStyleProps Default values for style props.
|
|
150
138
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
139
|
function splitStyleProps(props) {
|
|
154
140
|
var stylePropNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
155
141
|
var defaultStyleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
156
142
|
var stylePropNamesSet = new Set(stylePropNames);
|
|
157
|
-
var styleProps = _objectSpread({}, defaultStyleProps)
|
|
143
|
+
var styleProps = _objectSpread({}, defaultStyleProps);
|
|
158
144
|
var nonStyleProps = {};
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
var _iteratorError = undefined;
|
|
162
|
-
|
|
145
|
+
var _iterator = _createForOfIteratorHelper((0, _private_utils.keys)(props)),
|
|
146
|
+
_step;
|
|
163
147
|
try {
|
|
164
|
-
for (
|
|
148
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
165
149
|
var propName = _step.value;
|
|
166
|
-
|
|
167
150
|
if (stylePropNamesSet.has(propName)) {
|
|
168
151
|
styleProps[propName] = props[propName];
|
|
169
152
|
} else {
|
|
@@ -171,20 +154,10 @@ function splitStyleProps(props) {
|
|
|
171
154
|
}
|
|
172
155
|
}
|
|
173
156
|
} catch (err) {
|
|
174
|
-
|
|
175
|
-
_iteratorError = err;
|
|
157
|
+
_iterator.e(err);
|
|
176
158
|
} finally {
|
|
177
|
-
|
|
178
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
179
|
-
_iterator.return();
|
|
180
|
-
}
|
|
181
|
-
} finally {
|
|
182
|
-
if (_didIteratorError) {
|
|
183
|
-
throw _iteratorError;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
159
|
+
_iterator.f();
|
|
186
160
|
}
|
|
187
|
-
|
|
188
161
|
return {
|
|
189
162
|
styleProps,
|
|
190
163
|
nonStyleProps
|
package/dist/cjs/undo_redo.js
CHANGED
|
@@ -1,68 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
require("core-js/modules/es.object.to-string.js");
|
|
5
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
6
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.array.includes");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.string.includes");
|
|
8
|
-
|
|
9
7
|
Object.defineProperty(exports, "__esModule", {
|
|
10
8
|
value: true
|
|
11
9
|
});
|
|
12
10
|
exports.default = void 0;
|
|
13
|
-
|
|
11
|
+
require("core-js/modules/es.array.includes.js");
|
|
12
|
+
require("core-js/modules/es.string.includes.js");
|
|
14
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
|
-
|
|
20
16
|
var _private_utils = require("./private_utils");
|
|
21
|
-
|
|
22
17
|
var _error_utils = require("./error_utils");
|
|
23
|
-
|
|
24
18
|
var _undo_redo = require("./types/undo_redo");
|
|
25
|
-
|
|
26
19
|
/** @hidden */
|
|
27
|
-
var UndoRedo =
|
|
28
|
-
/*#__PURE__*/
|
|
29
|
-
function () {
|
|
30
|
-
/** @hidden */
|
|
31
|
-
|
|
32
|
-
/** @internal */
|
|
33
|
-
|
|
34
|
-
/** @internal */
|
|
35
|
-
|
|
20
|
+
var UndoRedo = /*#__PURE__*/function () {
|
|
36
21
|
/** @hidden */
|
|
37
22
|
function UndoRedo(airtableInterface) {
|
|
38
23
|
(0, _classCallCheck2.default)(this, UndoRedo);
|
|
24
|
+
/** @hidden */
|
|
39
25
|
(0, _defineProperty2.default)(this, "modes", _undo_redo.UndoRedoModes);
|
|
26
|
+
/** @internal */
|
|
40
27
|
(0, _defineProperty2.default)(this, "_airtableInterface", void 0);
|
|
28
|
+
/** @internal */
|
|
41
29
|
(0, _defineProperty2.default)(this, "_mode", _undo_redo.UndoRedoModes.NONE);
|
|
42
30
|
this._airtableInterface = airtableInterface;
|
|
43
31
|
}
|
|
44
32
|
/** @hidden */
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
(0, _createClass2.default)(UndoRedo, [{
|
|
33
|
+
return (0, _createClass2.default)(UndoRedo, [{
|
|
48
34
|
key: "mode",
|
|
49
35
|
get: function get() {
|
|
50
36
|
return this._mode;
|
|
51
37
|
}
|
|
52
|
-
/** @hidden
|
|
53
|
-
,
|
|
38
|
+
/** @hidden */,
|
|
54
39
|
set: function set(mode) {
|
|
55
40
|
if (!(0, _private_utils.values)(_undo_redo.UndoRedoModes).includes(mode)) {
|
|
56
41
|
throw (0, _error_utils.spawnError)('Unexpected UndoRedo mode');
|
|
57
42
|
}
|
|
58
|
-
|
|
59
43
|
this._mode = mode;
|
|
60
|
-
|
|
61
44
|
this._airtableInterface.setUndoRedoMode(mode);
|
|
62
45
|
}
|
|
63
46
|
}]);
|
|
64
|
-
return UndoRedo;
|
|
65
47
|
}();
|
|
66
|
-
|
|
67
|
-
var _default = UndoRedo;
|
|
68
|
-
exports.default = _default;
|
|
48
|
+
var _default = exports.default = UndoRedo;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.object.to-string.js");
|
|
4
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
|
|
7
8
|
var _private_utils = require("./private_utils");
|
|
8
|
-
|
|
9
9
|
Object.keys(_private_utils).forEach(function (key) {
|
|
10
10
|
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _private_utils[key]) return;
|
|
11
12
|
Object.defineProperty(exports, key, {
|
|
12
13
|
enumerable: true,
|
|
13
14
|
get: function get() {
|
|
@@ -15,11 +16,10 @@ Object.keys(_private_utils).forEach(function (key) {
|
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
18
|
});
|
|
18
|
-
|
|
19
19
|
var _error_utils = require("./error_utils");
|
|
20
|
-
|
|
21
20
|
Object.keys(_error_utils).forEach(function (key) {
|
|
22
21
|
if (key === "default" || key === "__esModule") return;
|
|
22
|
+
if (key in exports && exports[key] === _error_utils[key]) return;
|
|
23
23
|
Object.defineProperty(exports, key, {
|
|
24
24
|
enumerable: true,
|
|
25
25
|
get: function get() {
|
|
@@ -27,11 +27,10 @@ Object.keys(_error_utils).forEach(function (key) {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
var _event_tracker = require("./event_tracker");
|
|
32
|
-
|
|
33
31
|
Object.keys(_event_tracker).forEach(function (key) {
|
|
34
32
|
if (key === "default" || key === "__esModule") return;
|
|
33
|
+
if (key in exports && exports[key] === _event_tracker[key]) return;
|
|
35
34
|
Object.defineProperty(exports, key, {
|
|
36
35
|
enumerable: true,
|
|
37
36
|
get: function get() {
|
|
@@ -39,11 +38,10 @@ Object.keys(_event_tracker).forEach(function (key) {
|
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
|
-
|
|
43
41
|
var _block_stats = require("./stats/block_stats");
|
|
44
|
-
|
|
45
42
|
Object.keys(_block_stats).forEach(function (key) {
|
|
46
43
|
if (key === "default" || key === "__esModule") return;
|
|
44
|
+
if (key in exports && exports[key] === _block_stats[key]) return;
|
|
47
45
|
Object.defineProperty(exports, key, {
|
|
48
46
|
enumerable: true,
|
|
49
47
|
get: function get() {
|