@airtable/blocks 1.18.1 → 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 +6 -1
- 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,55 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.array.from.js");
|
|
6
|
+
require("core-js/modules/es.array.iterator.js");
|
|
7
|
+
require("core-js/modules/es.array.slice.js");
|
|
8
|
+
require("core-js/modules/es.object.to-string.js");
|
|
9
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
10
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
12
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.iterator");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.map");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.object.to-string");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.promise");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
18
|
-
|
|
19
13
|
Object.defineProperty(exports, "__esModule", {
|
|
20
14
|
value: true
|
|
21
15
|
});
|
|
22
16
|
exports.default = void 0;
|
|
23
|
-
|
|
17
|
+
require("core-js/modules/es.array.map.js");
|
|
24
18
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
25
|
-
|
|
26
|
-
require("regenerator-runtime/runtime");
|
|
27
|
-
|
|
19
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
28
20
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
29
|
-
|
|
21
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
30
22
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
31
|
-
|
|
32
23
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
33
|
-
|
|
34
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
35
|
-
|
|
36
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
37
|
-
|
|
38
24
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
39
|
-
|
|
40
25
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
41
|
-
|
|
42
26
|
var _watchable = _interopRequireDefault(require("./watchable"));
|
|
43
|
-
|
|
44
27
|
var _error_utils = require("./error_utils");
|
|
45
|
-
|
|
46
28
|
var _mutations = require("./types/mutations");
|
|
47
|
-
|
|
48
29
|
var _private_utils = require("./private_utils");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
30
|
+
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; } } }; }
|
|
31
|
+
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; } }
|
|
32
|
+
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; }
|
|
33
|
+
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)); }
|
|
34
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @module @airtable/blocks: globalConfig */ /** */
|
|
35
|
+
/**
|
|
36
|
+
* You can watch any top-level key in global config. Use '*' to watch every change.
|
|
37
|
+
*/
|
|
53
38
|
// NOTE: GlobalConfig is essentially a wrapper around a generic key-value store.
|
|
54
39
|
// It's called GlobalConfig in order to convey two main points about its intended
|
|
55
40
|
// usage:
|
|
@@ -57,7 +42,6 @@ var _private_utils = require("./private_utils");
|
|
|
57
42
|
// a UserConfig which would be scoped to an individual user), and
|
|
58
43
|
// 2) that is should be used mainly for configuration of the block (kv store
|
|
59
44
|
// as a name seems a bit too vague in terms of intended usage).
|
|
60
|
-
|
|
61
45
|
/**
|
|
62
46
|
* A key-value store for persisting configuration options for an extension installation.
|
|
63
47
|
*
|
|
@@ -80,88 +64,66 @@ var _private_utils = require("./private_utils");
|
|
|
80
64
|
* ```
|
|
81
65
|
* @docsPath models/GlobalConfig
|
|
82
66
|
*/
|
|
83
|
-
var GlobalConfig =
|
|
84
|
-
/*#__PURE__*/
|
|
85
|
-
function (_Watchable) {
|
|
86
|
-
(0, _inherits2.default)(GlobalConfig, _Watchable);
|
|
87
|
-
(0, _createClass2.default)(GlobalConfig, null, [{
|
|
88
|
-
key: "_isWatchableKey",
|
|
89
|
-
|
|
90
|
-
/** @internal */
|
|
91
|
-
|
|
92
|
-
/** @internal */
|
|
93
|
-
value: function _isWatchableKey(key) {
|
|
94
|
-
// The user can store any arbitrary key in the global config, so there's
|
|
95
|
-
// not much we can do here to check if a key is valid.
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
/** @internal */
|
|
99
|
-
|
|
100
|
-
}]);
|
|
101
|
-
|
|
67
|
+
var GlobalConfig = /*#__PURE__*/function (_Watchable) {
|
|
102
68
|
/**
|
|
103
69
|
* @internal
|
|
104
70
|
*/
|
|
105
71
|
function GlobalConfig(initialKvValuesByKey, sdk) {
|
|
106
72
|
var _this;
|
|
107
|
-
|
|
108
73
|
(0, _classCallCheck2.default)(this, GlobalConfig);
|
|
109
|
-
_this = (
|
|
110
|
-
|
|
111
|
-
(0, _defineProperty2.default)(
|
|
112
|
-
|
|
74
|
+
_this = _callSuper(this, GlobalConfig);
|
|
75
|
+
/** @internal */
|
|
76
|
+
(0, _defineProperty2.default)(_this, "_sdk", void 0);
|
|
77
|
+
/** @internal */
|
|
78
|
+
(0, _defineProperty2.default)(_this, "_kvStore", void 0);
|
|
79
|
+
/** @internal */
|
|
80
|
+
(0, _defineProperty2.default)(_this, "_airtableInterface", void 0);
|
|
113
81
|
_this._kvStore = initialKvValuesByKey;
|
|
114
82
|
_this._sdk = sdk;
|
|
115
83
|
_this._airtableInterface = sdk.__airtableInterface;
|
|
116
84
|
return _this;
|
|
117
85
|
}
|
|
86
|
+
|
|
118
87
|
/**
|
|
119
88
|
* @internal
|
|
120
89
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
(0, _createClass2.default)(GlobalConfig, [{
|
|
90
|
+
(0, _inherits2.default)(GlobalConfig, _Watchable);
|
|
91
|
+
return (0, _createClass2.default)(GlobalConfig, [{
|
|
124
92
|
key: "__getTopLevelKey",
|
|
125
93
|
value: function __getTopLevelKey(key) {
|
|
126
94
|
if (Array.isArray(key)) {
|
|
127
95
|
return key[0];
|
|
128
96
|
}
|
|
129
|
-
|
|
130
97
|
return key;
|
|
131
98
|
}
|
|
132
99
|
/**
|
|
133
100
|
* @internal
|
|
134
101
|
*/
|
|
135
|
-
|
|
136
102
|
}, {
|
|
137
103
|
key: "_formatKeyAsPath",
|
|
138
104
|
value: function _formatKeyAsPath(key) {
|
|
139
105
|
if (!Array.isArray(key)) {
|
|
140
106
|
return [key];
|
|
141
107
|
}
|
|
142
|
-
|
|
143
108
|
return key;
|
|
144
109
|
}
|
|
110
|
+
|
|
145
111
|
/**
|
|
146
112
|
* @internal
|
|
147
113
|
*/
|
|
148
|
-
|
|
149
114
|
}, {
|
|
150
115
|
key: "_validatePath",
|
|
151
116
|
value: function _validatePath(path, store) {
|
|
152
117
|
var validation = this._airtableInterface.globalConfigHelpers.validatePath(path, store);
|
|
153
|
-
|
|
154
118
|
if (!validation.isValid) {
|
|
155
119
|
return validation;
|
|
156
120
|
}
|
|
157
|
-
|
|
158
121
|
if (path[0] === '*') {
|
|
159
122
|
return {
|
|
160
123
|
isValid: false,
|
|
161
124
|
reason: "cannot use '*' as a top-level key"
|
|
162
125
|
};
|
|
163
126
|
}
|
|
164
|
-
|
|
165
127
|
return {
|
|
166
128
|
isValid: true
|
|
167
129
|
};
|
|
@@ -180,22 +142,19 @@ function (_Watchable) {
|
|
|
180
142
|
* const nestedValue = globalConfig.get(['topLevelKey', 'nested', 'deeply']);
|
|
181
143
|
* ```
|
|
182
144
|
*/
|
|
183
|
-
|
|
184
145
|
}, {
|
|
185
146
|
key: "get",
|
|
186
147
|
value: function get(key) {
|
|
187
148
|
var path = this._formatKeyAsPath(key);
|
|
188
|
-
|
|
189
149
|
var pathValidationResult = this._validatePath(path, this._kvStore);
|
|
190
|
-
|
|
191
150
|
if (!pathValidationResult.isValid) {
|
|
192
151
|
throw (0, _error_utils.spawnError)('Invalid globalConfig path: %s', pathValidationResult.reason);
|
|
193
152
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
153
|
+
var value = (0, _private_utils.getValueAtOwnPath)(this._kvStore, path);
|
|
154
|
+
// value is returned as `unknown` from getValueAtOwnPath, but we know it must be a `GlobalConfigValue | void`
|
|
197
155
|
return value;
|
|
198
156
|
}
|
|
157
|
+
|
|
199
158
|
/**
|
|
200
159
|
* Checks whether the current user has permission to set the given global config key.
|
|
201
160
|
*
|
|
@@ -226,7 +185,6 @@ function (_Watchable) {
|
|
|
226
185
|
* const setUnknownKeyCheckResult = globalConfig.checkPermissionsForSet();
|
|
227
186
|
* ```
|
|
228
187
|
*/
|
|
229
|
-
|
|
230
188
|
}, {
|
|
231
189
|
key: "checkPermissionsForSet",
|
|
232
190
|
value: function checkPermissionsForSet(key, value) {
|
|
@@ -262,7 +220,6 @@ function (_Watchable) {
|
|
|
262
220
|
* const canSetGlobalConfig = globalConfig.hasPermissionToSet();
|
|
263
221
|
* ```
|
|
264
222
|
*/
|
|
265
|
-
|
|
266
223
|
}, {
|
|
267
224
|
key: "hasPermissionToSet",
|
|
268
225
|
value: function hasPermissionToSet(key, value) {
|
|
@@ -301,29 +258,31 @@ function (_Watchable) {
|
|
|
301
258
|
* }
|
|
302
259
|
* ```
|
|
303
260
|
*/
|
|
304
|
-
|
|
305
261
|
}, {
|
|
306
262
|
key: "setAsync",
|
|
307
|
-
value: function
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
switch (_context.prev = _context.next) {
|
|
263
|
+
value: (function () {
|
|
264
|
+
var _setAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(key, value) {
|
|
265
|
+
var path;
|
|
266
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
267
|
+
while (1) switch (_context.prev = _context.next) {
|
|
312
268
|
case 0:
|
|
313
269
|
path = this._formatKeyAsPath(key);
|
|
314
270
|
_context.next = 3;
|
|
315
|
-
return
|
|
271
|
+
return this.setPathsAsync([{
|
|
316
272
|
path,
|
|
317
273
|
value
|
|
318
|
-
}])
|
|
319
|
-
|
|
274
|
+
}]);
|
|
320
275
|
case 3:
|
|
321
276
|
case "end":
|
|
322
277
|
return _context.stop();
|
|
323
278
|
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
279
|
+
}, _callee, this);
|
|
280
|
+
}));
|
|
281
|
+
function setAsync(_x, _x2) {
|
|
282
|
+
return _setAsync.apply(this, arguments);
|
|
283
|
+
}
|
|
284
|
+
return setAsync;
|
|
285
|
+
}()
|
|
327
286
|
/**
|
|
328
287
|
* Checks whether the current user has permission to perform the specified updates to global config.
|
|
329
288
|
*
|
|
@@ -352,15 +311,15 @@ function (_Watchable) {
|
|
|
352
311
|
* globalConfig.checkPermissionsForSetPaths();
|
|
353
312
|
* ```
|
|
354
313
|
*/
|
|
355
|
-
|
|
314
|
+
)
|
|
356
315
|
}, {
|
|
357
316
|
key: "checkPermissionsForSetPaths",
|
|
358
317
|
value: function checkPermissionsForSetPaths(updates) {
|
|
359
318
|
return this._sdk.__mutations.checkPermissionsForMutation({
|
|
360
319
|
type: _mutations.MutationTypes.SET_MULTIPLE_GLOBAL_CONFIG_PATHS,
|
|
361
|
-
updates: updates ? updates.map(
|
|
320
|
+
updates: updates ? updates.map(_ref => {
|
|
362
321
|
var path = _ref.path,
|
|
363
|
-
|
|
322
|
+
value = _ref.value;
|
|
364
323
|
return {
|
|
365
324
|
path: path || undefined,
|
|
366
325
|
value
|
|
@@ -395,7 +354,6 @@ function (_Watchable) {
|
|
|
395
354
|
* const canSetAnyPaths = globalConfig.hasPermissionToSetPaths();
|
|
396
355
|
* ```
|
|
397
356
|
*/
|
|
398
|
-
|
|
399
357
|
}, {
|
|
400
358
|
key: "hasPermissionToSetPaths",
|
|
401
359
|
value: function hasPermissionToSetPaths(updates) {
|
|
@@ -437,104 +395,71 @@ function (_Watchable) {
|
|
|
437
395
|
* }
|
|
438
396
|
* ```
|
|
439
397
|
*/
|
|
440
|
-
|
|
441
398
|
}, {
|
|
442
399
|
key: "setPathsAsync",
|
|
443
|
-
value: function
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
switch (_context2.prev = _context2.next) {
|
|
400
|
+
value: (function () {
|
|
401
|
+
var _setPathsAsync = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(updates) {
|
|
402
|
+
var _iterator, _step, update, pathValidation;
|
|
403
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
404
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
449
405
|
case 0:
|
|
450
406
|
if (this.hasPermissionToSetPaths(updates)) {
|
|
451
407
|
_context2.next = 2;
|
|
452
408
|
break;
|
|
453
409
|
}
|
|
454
|
-
|
|
455
410
|
throw (0, _error_utils.spawnError)('Your permission level does not allow setting globalConfig values');
|
|
456
|
-
|
|
457
411
|
case 2:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
case 7:
|
|
465
|
-
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
|
|
466
|
-
_context2.next = 15;
|
|
412
|
+
_iterator = _createForOfIteratorHelper(updates);
|
|
413
|
+
_context2.prev = 3;
|
|
414
|
+
_iterator.s();
|
|
415
|
+
case 5:
|
|
416
|
+
if ((_step = _iterator.n()).done) {
|
|
417
|
+
_context2.next = 12;
|
|
467
418
|
break;
|
|
468
419
|
}
|
|
469
|
-
|
|
470
420
|
update = _step.value;
|
|
471
421
|
pathValidation = this._validatePath(update.path, this._kvStore);
|
|
472
|
-
|
|
473
422
|
if (pathValidation.isValid) {
|
|
474
|
-
_context2.next =
|
|
423
|
+
_context2.next = 10;
|
|
475
424
|
break;
|
|
476
425
|
}
|
|
477
|
-
|
|
478
426
|
throw (0, _error_utils.spawnError)('Invalid globalConfig path: %s', pathValidation.reason);
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
_iteratorNormalCompletion = true;
|
|
482
|
-
_context2.next = 7;
|
|
427
|
+
case 10:
|
|
428
|
+
_context2.next = 5;
|
|
483
429
|
break;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
_context2.next = 21;
|
|
430
|
+
case 12:
|
|
431
|
+
_context2.next = 17;
|
|
487
432
|
break;
|
|
488
|
-
|
|
433
|
+
case 14:
|
|
434
|
+
_context2.prev = 14;
|
|
435
|
+
_context2.t0 = _context2["catch"](3);
|
|
436
|
+
_iterator.e(_context2.t0);
|
|
489
437
|
case 17:
|
|
490
438
|
_context2.prev = 17;
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
_context2.prev = 21;
|
|
497
|
-
_context2.prev = 22;
|
|
498
|
-
|
|
499
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
500
|
-
_iterator.return();
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
case 24:
|
|
504
|
-
_context2.prev = 24;
|
|
505
|
-
|
|
506
|
-
if (!_didIteratorError) {
|
|
507
|
-
_context2.next = 27;
|
|
508
|
-
break;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
throw _iteratorError;
|
|
512
|
-
|
|
513
|
-
case 27:
|
|
514
|
-
return _context2.finish(24);
|
|
515
|
-
|
|
516
|
-
case 28:
|
|
517
|
-
return _context2.finish(21);
|
|
518
|
-
|
|
519
|
-
case 29:
|
|
520
|
-
_context2.next = 31;
|
|
521
|
-
return _regenerator.default.awrap(this._sdk.__mutations.applyMutationAsync({
|
|
439
|
+
_iterator.f();
|
|
440
|
+
return _context2.finish(17);
|
|
441
|
+
case 20:
|
|
442
|
+
_context2.next = 22;
|
|
443
|
+
return this._sdk.__mutations.applyMutationAsync({
|
|
522
444
|
type: _mutations.MutationTypes.SET_MULTIPLE_GLOBAL_CONFIG_PATHS,
|
|
523
445
|
updates
|
|
524
|
-
})
|
|
525
|
-
|
|
526
|
-
case 31:
|
|
446
|
+
});
|
|
447
|
+
case 22:
|
|
527
448
|
case "end":
|
|
528
449
|
return _context2.stop();
|
|
529
450
|
}
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
|
|
451
|
+
}, _callee2, this, [[3, 14, 17, 20]]);
|
|
452
|
+
}));
|
|
453
|
+
function setPathsAsync(_x3) {
|
|
454
|
+
return _setPathsAsync.apply(this, arguments);
|
|
455
|
+
}
|
|
456
|
+
return setPathsAsync;
|
|
457
|
+
}()
|
|
533
458
|
/**
|
|
534
459
|
* @internal
|
|
535
460
|
* this shouldn't be called directly - instead, use this._sdk.__applyGlobalConfigUpdates()
|
|
536
461
|
*/
|
|
537
|
-
|
|
462
|
+
)
|
|
538
463
|
}, {
|
|
539
464
|
key: "__setMultipleKvPaths",
|
|
540
465
|
value: function __setMultipleKvPaths(updates) {
|
|
@@ -543,45 +468,39 @@ function (_Watchable) {
|
|
|
543
468
|
// applied (where we'd have to crash the block instead of letting the developer catch the
|
|
544
469
|
// error), it doesn't mutate the current store: it returns newKvStore with changes applied.
|
|
545
470
|
var _this$_airtableInterf = this._airtableInterface.globalConfigHelpers.validateAndApplyUpdates(updates, this._kvStore),
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
471
|
+
newKvStore = _this$_airtableInterf.newKvStore,
|
|
472
|
+
changedTopLevelKeys = _this$_airtableInterf.changedTopLevelKeys;
|
|
549
473
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
var _iteratorNormalCompletion2 = true;
|
|
553
|
-
var _didIteratorError2 = false;
|
|
554
|
-
var _iteratorError2 = undefined;
|
|
474
|
+
// The updates are all good! Replace our kvStore with the new version.
|
|
475
|
+
this._kvStore = newKvStore;
|
|
555
476
|
|
|
477
|
+
// Now loop over the top level keys to fire change events.
|
|
478
|
+
var _iterator2 = _createForOfIteratorHelper(changedTopLevelKeys),
|
|
479
|
+
_step2;
|
|
556
480
|
try {
|
|
557
|
-
for (
|
|
481
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
558
482
|
var key = _step2.value;
|
|
559
|
-
|
|
560
483
|
this._onChange(key);
|
|
561
484
|
}
|
|
562
485
|
} catch (err) {
|
|
563
|
-
|
|
564
|
-
_iteratorError2 = err;
|
|
486
|
+
_iterator2.e(err);
|
|
565
487
|
} finally {
|
|
566
|
-
|
|
567
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
568
|
-
_iterator2.return();
|
|
569
|
-
}
|
|
570
|
-
} finally {
|
|
571
|
-
if (_didIteratorError2) {
|
|
572
|
-
throw _iteratorError2;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
488
|
+
_iterator2.f();
|
|
575
489
|
}
|
|
576
|
-
|
|
577
490
|
if (changedTopLevelKeys.length) {
|
|
578
491
|
this._onChange('*');
|
|
579
492
|
}
|
|
580
493
|
}
|
|
494
|
+
}], [{
|
|
495
|
+
key: "_isWatchableKey",
|
|
496
|
+
value: /** @internal */
|
|
497
|
+
function _isWatchableKey(key) {
|
|
498
|
+
// The user can store any arbitrary key in the global config, so there's
|
|
499
|
+
// not much we can do here to check if a key is valid.
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
581
502
|
}]);
|
|
582
|
-
return GlobalConfig;
|
|
583
503
|
}(_watchable.default);
|
|
584
|
-
|
|
504
|
+
/** @internal */
|
|
585
505
|
(0, _defineProperty2.default)(GlobalConfig, "_className", 'GlobalConfig');
|
|
586
|
-
var _default = GlobalConfig;
|
|
587
|
-
exports.default = _default;
|
|
506
|
+
var _default = exports.default = GlobalConfig;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,99 +1,79 @@
|
|
|
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/es.weak-map.js");
|
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
3
7
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
8
|
Object.defineProperty(exports, "__esModule", {
|
|
8
9
|
value: true
|
|
9
10
|
});
|
|
10
11
|
exports.__reset = __reset;
|
|
11
|
-
exports.
|
|
12
|
-
|
|
12
|
+
exports.viewport = exports.unstable_fetchAsync = exports.undoRedo = exports.settingsButton = exports.session = exports.runInfo = exports.reload = exports.installationId = exports.globalConfig = exports.cursor = exports.base = exports.__sdk = void 0;
|
|
13
13
|
var _perform_record_action = require("./perform_record_action");
|
|
14
|
-
|
|
15
14
|
var _warning = _interopRequireWildcard(require("./warning"));
|
|
16
|
-
|
|
17
15
|
var _airtable_interface = _interopRequireDefault(require("./injected/airtable_interface"));
|
|
18
|
-
|
|
19
16
|
var _sdk2 = _interopRequireDefault(require("./sdk"));
|
|
20
|
-
|
|
21
17
|
var _create_aggregators = require("./models/create_aggregators");
|
|
22
|
-
|
|
23
18
|
var _initialize_block = require("./ui/initialize_block");
|
|
24
|
-
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
25
21
|
/** @internal */
|
|
26
22
|
var __sdk;
|
|
27
|
-
|
|
28
|
-
exports.__sdk = __sdk;
|
|
29
23
|
var base;
|
|
30
|
-
exports.base = base;
|
|
31
24
|
var globalConfig;
|
|
32
|
-
exports.globalConfig = globalConfig;
|
|
33
25
|
var installationId;
|
|
34
|
-
exports.installationId = installationId;
|
|
35
26
|
var reload;
|
|
36
|
-
exports.reload = reload;
|
|
37
27
|
var runInfo;
|
|
38
|
-
exports.runInfo = runInfo;
|
|
39
28
|
var settingsButton;
|
|
40
|
-
exports.settingsButton = settingsButton;
|
|
41
29
|
var undoRedo;
|
|
42
|
-
exports.undoRedo = undoRedo;
|
|
43
30
|
var viewport;
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
var unstable_fetchAsync;
|
|
32
|
+
|
|
33
|
+
// The `cursor` binding is declared on the following line solely as a signal to
|
|
46
34
|
// the TypeScript compiler. The exported value is actually controlled by the
|
|
47
35
|
// subsequent CommonJS module property descriptor.
|
|
48
|
-
|
|
49
|
-
exports.unstable_fetchAsync = unstable_fetchAsync;
|
|
50
36
|
var cursor;
|
|
51
|
-
exports.cursor = cursor;
|
|
52
37
|
Object.defineProperty(module.exports, 'cursor', {
|
|
53
38
|
enumerable: true,
|
|
54
|
-
|
|
55
39
|
get() {
|
|
56
40
|
(0, _warning.default)('`import {cursor} from "@airtable/blocks"` is deprecated. Use `import {useCursor} from "@airtable/blocks/ui"` instead.');
|
|
57
41
|
return __sdk.cursor;
|
|
58
42
|
}
|
|
43
|
+
});
|
|
59
44
|
|
|
60
|
-
|
|
45
|
+
// The `session` binding is declared on the following line solely as a signal
|
|
61
46
|
// to the TypeScript compiler. The exported value is actually controlled by the
|
|
62
47
|
// subsequent CommonJS module property descriptor.
|
|
63
|
-
|
|
64
48
|
var session;
|
|
65
|
-
exports.session = session;
|
|
66
49
|
Object.defineProperty(module.exports, 'session', {
|
|
67
50
|
enumerable: true,
|
|
68
|
-
|
|
69
51
|
get() {
|
|
70
52
|
(0, _warning.default)('`import {session} from "@airtable/blocks"` is deprecated. Use `import {useSession} from "@airtable/blocks/ui"` instead.');
|
|
71
53
|
return __sdk.session;
|
|
72
54
|
}
|
|
73
|
-
|
|
74
55
|
});
|
|
75
56
|
Object.defineProperty(module.exports, 'UI', {
|
|
76
57
|
enumerable: true,
|
|
77
|
-
|
|
78
58
|
get() {
|
|
79
59
|
(0, _warning.default)('`import {UI} from "@airtable/blocks"` is deprecated. Use `import * as UI from "@airtable/blocks/ui/ui"` instead.');
|
|
80
60
|
return require('./ui/ui');
|
|
81
61
|
}
|
|
82
|
-
|
|
83
62
|
});
|
|
84
63
|
Object.defineProperty(module.exports, 'models', {
|
|
85
64
|
enumerable: true,
|
|
86
|
-
|
|
87
65
|
get() {
|
|
88
66
|
(0, _warning.default)('`import {models} from "@airtable/blocks"` is deprecated. Use `import * as models from "@airtable/blocks/models/models"` instead.');
|
|
89
67
|
return require('./models/models');
|
|
90
68
|
}
|
|
91
|
-
|
|
92
69
|
});
|
|
93
|
-
/** @internal */
|
|
94
70
|
|
|
71
|
+
/** @internal */
|
|
95
72
|
function __reset() {
|
|
96
73
|
exports.__sdk = __sdk = new _sdk2.default((0, _airtable_interface.default)());
|
|
74
|
+
// The following injections are necessary to allow the referenced modules
|
|
75
|
+
// to be imported directly by consumer code while also avoiding cycles in
|
|
76
|
+
// the module dependency graph.
|
|
97
77
|
var _sdk = __sdk;
|
|
98
78
|
exports.base = base = _sdk.base;
|
|
99
79
|
exports.globalConfig = globalConfig = _sdk.globalConfig;
|
|
@@ -104,13 +84,9 @@ function __reset() {
|
|
|
104
84
|
exports.undoRedo = undoRedo = _sdk.undoRedo;
|
|
105
85
|
exports.viewport = viewport = _sdk.viewport;
|
|
106
86
|
exports.unstable_fetchAsync = unstable_fetchAsync = _sdk.unstable_fetchAsync;
|
|
107
|
-
// The following injections are necessary to allow the referenced modules
|
|
108
|
-
// to be imported directly by consumer code while also avoiding cycles in
|
|
109
|
-
// the module dependency graph.
|
|
110
87
|
(0, _create_aggregators.__injectSdkIntoCreateAggregators)(__sdk);
|
|
111
88
|
(0, _perform_record_action.__injectSdkIntoPerformRecordAction)(__sdk);
|
|
112
89
|
(0, _initialize_block.__injectSdkIntoInitializeBlock)(__sdk);
|
|
113
90
|
(0, _warning.__injectSdkIntoWarning)(__sdk);
|
|
114
91
|
}
|
|
115
|
-
|
|
116
92
|
__reset();
|
|
@@ -4,24 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = getAirtableInterface;
|
|
7
|
-
|
|
8
7
|
var _error_utils = require("../error_utils");
|
|
9
|
-
|
|
10
8
|
var AIRTABLE_INTERFACE_VERSION = 0;
|
|
11
9
|
var airtableInterface = null;
|
|
12
10
|
var missingAirtableInterfaceErrorMessage = ['Error: Extension environment misconfigured', '\n\n', 'Airtable Extensions can only run in the presence of an Airtable Base. If you ', 'are trying to run your Extension with a Base hosted on airtable.com, then be ', 'sure you are using the Airtable CLI to serve your code and accessing it ', 'through a Custom Extension installed inside a Base on airtable.com.', '\n\n', 'If you are trying to run automated tests for your Extension, then make sure ', 'you have loaded the `@airtable/testing-library` module *before* the ', '`@airtable/blocks` module.'].join('');
|
|
13
|
-
/** @hidden */
|
|
14
11
|
|
|
12
|
+
/** @hidden */
|
|
15
13
|
function getAirtableInterface() {
|
|
16
14
|
var getAirtableInterfaceAtVersion = window.__getAirtableInterfaceAtVersion;
|
|
17
|
-
|
|
18
15
|
if (!airtableInterface) {
|
|
19
16
|
if (!getAirtableInterfaceAtVersion) {
|
|
20
17
|
throw (0, _error_utils.spawnError)(missingAirtableInterfaceErrorMessage);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
airtableInterface = getAirtableInterfaceAtVersion(AIRTABLE_INTERFACE_VERSION);
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
return airtableInterface;
|
|
27
22
|
}
|