@airtable/blocks 0.0.0-experimental-e5ab33b68-20250905 → 0.0.0-experimental-e625869e5-20251002
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/dist/esm/base/assert_run_context.js +9 -0
- package/dist/esm/base/index.js +42 -0
- package/dist/{cjs → esm}/base/models/abstract_model_with_async_data.js +8 -15
- package/dist/{cjs → esm}/base/models/base.js +42 -22
- package/dist/{cjs → esm}/base/models/create_aggregators.js +11 -24
- package/dist/{cjs → esm}/base/models/cursor.js +21 -28
- package/dist/{cjs → esm}/base/models/field.js +16 -24
- package/dist/{cjs → esm}/base/models/grouped_record_query_result.js +9 -15
- package/dist/{cjs → esm}/base/models/linked_records_query_result.js +42 -50
- package/dist/esm/base/models/models.js +19 -0
- package/dist/{cjs → esm}/base/models/mutations.js +68 -74
- package/dist/{cjs → esm}/base/models/object_pool.js +4 -11
- package/dist/{cjs → esm}/base/models/record.js +18 -25
- package/dist/{cjs → esm}/base/models/record_coloring.js +3 -10
- package/dist/{cjs → esm}/base/models/record_query_result.js +52 -61
- package/dist/{cjs → esm}/base/models/record_store.js +33 -42
- package/dist/{cjs → esm}/base/models/session.js +7 -12
- package/dist/{cjs → esm}/base/models/table.js +31 -39
- package/dist/{cjs → esm}/base/models/table_or_view_query_result.js +74 -82
- package/dist/{cjs → esm}/base/models/view.js +17 -25
- package/dist/{cjs → esm}/base/models/view_data_store.js +19 -26
- package/dist/{cjs → esm}/base/models/view_metadata_query_result.js +9 -16
- package/dist/{cjs → esm}/base/perform_record_action.js +9 -19
- package/dist/{cjs → esm}/base/sdk.js +20 -27
- package/dist/{cjs → esm}/base/settings_button.js +5 -13
- package/dist/esm/base/types/aggregators.js +1 -0
- package/dist/{cjs → esm}/base/types/airtable_interface.js +18 -10
- package/dist/esm/base/types/backend_fetch_types.js +1 -0
- package/dist/esm/base/types/base.js +1 -0
- package/dist/esm/base/types/cursor.js +1 -0
- package/dist/esm/base/types/field.js +1 -0
- package/dist/{cjs → esm}/base/types/mutations.js +3 -9
- package/dist/esm/base/types/record.js +1 -0
- package/dist/esm/base/types/record_action_data.js +1 -0
- package/dist/esm/base/types/table.js +1 -0
- package/dist/esm/base/types/undo_redo.js +6 -0
- package/dist/{cjs → esm}/base/types/view.js +7 -8
- package/dist/esm/base/types/viewport.js +1 -0
- package/dist/esm/base/ui/base_provider.js +41 -0
- package/dist/esm/base/ui/block_wrapper.js +143 -0
- package/dist/esm/base/ui/cell_renderer.js +19 -0
- package/dist/{cjs → esm}/base/ui/expand_record.js +1 -7
- package/dist/{cjs → esm}/base/ui/expand_record_list.js +4 -10
- package/dist/{cjs → esm}/base/ui/expand_record_picker_async.js +4 -10
- package/dist/esm/base/ui/global_alert.js +65 -0
- package/dist/esm/base/ui/global_css_helpers.js +28 -0
- package/dist/esm/base/ui/initialize_block.js +110 -0
- package/dist/esm/base/ui/ui.js +32 -0
- package/dist/esm/base/ui/unstable_standalone_ui.js +29 -0
- package/dist/{cjs → esm}/base/ui/use_base.js +4 -10
- package/dist/{cjs → esm}/base/ui/use_cursor.js +5 -12
- package/dist/{cjs → esm}/base/ui/use_loadable.js +13 -21
- package/dist/{cjs → esm}/base/ui/use_record_action_data.js +9 -15
- package/dist/{cjs → esm}/base/ui/use_records.js +21 -33
- package/dist/{cjs → esm}/base/ui/use_session.js +4 -10
- package/dist/{cjs → esm}/base/ui/use_settings_button.js +7 -15
- package/dist/{cjs → esm}/base/ui/use_view_metadata.js +8 -14
- package/dist/{cjs → esm}/base/ui/use_viewport.js +5 -12
- package/dist/esm/base/undo_redo.js +31 -0
- package/dist/esm/base/unstable_testing_utils.js +6 -0
- package/dist/{cjs → esm}/base/viewport.js +9 -17
- package/dist/{cjs → esm}/injected/airtable_interface.js +3 -9
- package/dist/esm/interface/assert_run_context.js +9 -0
- package/dist/esm/interface/index.js +16 -0
- package/dist/{cjs → esm}/interface/models/base.js +7 -13
- package/dist/{cjs → esm}/interface/models/field.js +3 -9
- package/dist/esm/interface/models/models.js +9 -0
- package/dist/{cjs → esm}/interface/models/mutations.js +6 -13
- package/dist/{cjs → esm}/interface/models/record.js +9 -16
- package/dist/esm/interface/models/record_store.js +42 -0
- package/dist/{cjs → esm}/interface/models/session.js +2 -8
- package/dist/{cjs → esm}/interface/models/table.js +7 -13
- package/dist/{cjs → esm}/interface/sdk.js +9 -16
- package/dist/{cjs → esm}/interface/types/airtable_interface.js +13 -12
- package/dist/esm/interface/types/base.js +1 -0
- package/dist/esm/interface/types/field.js +1 -0
- package/dist/esm/interface/types/mutations.js +12 -0
- package/dist/esm/interface/types/record.js +1 -0
- package/dist/esm/interface/types/table.js +1 -0
- package/dist/esm/interface/ui/block_wrapper.js +49 -0
- package/dist/esm/interface/ui/cell_renderer.js +19 -0
- package/dist/{cjs → esm}/interface/ui/expand_record.js +1 -7
- package/dist/esm/interface/ui/global_css_helpers.js +17 -0
- package/dist/esm/interface/ui/initialize_block.js +83 -0
- package/dist/esm/interface/ui/ui.js +20 -0
- package/dist/{cjs → esm}/interface/ui/use_base.js +3 -10
- package/dist/{cjs → esm}/interface/ui/use_custom_properties.js +61 -39
- package/dist/{cjs → esm}/interface/ui/use_records.js +5 -12
- package/dist/{cjs → esm}/interface/ui/use_run_info.js +4 -9
- package/dist/{cjs → esm}/interface/ui/use_session.js +3 -10
- package/dist/esm/sdk_mode.js +1 -0
- package/dist/esm/shared/color_utils.js +50 -0
- package/dist/{cjs → esm}/shared/colors.js +4 -8
- package/dist/{cjs → esm}/shared/error_utils.js +5 -15
- package/dist/esm/shared/event_tracker.js +20 -0
- package/dist/{cjs → esm}/shared/global_config.js +13 -19
- package/dist/{cjs → esm}/shared/models/abstract_model.js +6 -14
- package/dist/{cjs → esm}/shared/models/base_core.js +22 -29
- package/dist/{cjs → esm}/shared/models/field_core.js +9 -16
- package/dist/{cjs → esm}/shared/models/mutations_core.js +36 -43
- package/dist/{cjs → esm}/shared/models/record_core.js +17 -25
- package/dist/{cjs → esm}/shared/models/record_store_core.js +15 -22
- package/dist/{cjs → esm}/shared/models/session_core.js +9 -17
- package/dist/{cjs → esm}/shared/models/table_core.js +29 -36
- package/dist/{cjs → esm}/shared/private_utils.js +85 -71
- package/dist/{cjs → esm}/shared/sdk_core.js +6 -13
- package/dist/esm/shared/types/airtable_interface_core.js +1 -0
- package/dist/esm/shared/types/attachment.js +1 -0
- package/dist/esm/shared/types/base_core.js +1 -0
- package/dist/esm/shared/types/collaborator.js +1 -0
- package/dist/{cjs → esm}/shared/types/field_core.js +51 -8
- package/dist/esm/shared/types/global_config.js +1 -0
- package/dist/esm/shared/types/hyper_ids.js +1 -0
- package/dist/esm/shared/types/mutation_constants.js +5 -0
- package/dist/{cjs → esm}/shared/types/mutations_core.js +1 -7
- package/dist/esm/shared/types/permission_levels.js +11 -0
- package/dist/esm/shared/types/record.js +1 -0
- package/dist/esm/shared/types/stat.js +1 -0
- package/dist/esm/shared/types/table_core.js +1 -0
- package/dist/esm/shared/ui/cell_renderer.js +137 -0
- package/dist/esm/shared/ui/global_config_synced_component_helpers.js +21 -0
- package/dist/{cjs → esm}/shared/ui/loader.js +2 -10
- package/dist/{cjs → esm}/shared/ui/remote_utils.js +7 -15
- package/dist/esm/shared/ui/sdk_context.js +8 -0
- package/dist/{cjs → esm}/shared/ui/use_array_identity.js +3 -8
- package/dist/esm/shared/ui/use_base.js +16 -0
- package/dist/{cjs → esm}/shared/ui/use_color_scheme.js +4 -10
- package/dist/{cjs → esm}/shared/ui/use_global_config.js +7 -13
- package/dist/esm/shared/ui/use_session.js +15 -0
- package/dist/{cjs → esm}/shared/ui/use_synced.js +5 -11
- package/dist/{cjs → esm}/shared/ui/use_watchable.js +11 -19
- package/dist/{cjs → esm}/shared/ui/with_hooks.js +7 -13
- package/dist/esm/shared/unstable_private_utils.js +4 -0
- package/dist/{cjs → esm}/shared/warning.js +3 -11
- package/dist/{cjs → esm}/shared/watchable.js +5 -11
- package/dist/{cjs → esm}/stats/block_stats.js +8 -14
- package/dist/{cjs → esm}/testing/base/abstract_mock_airtable_interface.js +8 -17
- package/dist/{cjs → esm}/testing/interface/abstract_mock_airtable_interface.js +8 -17
- package/dist/types/src/base/index.d.ts +0 -2
- package/dist/types/src/base/index.d.ts.map +1 -1
- package/dist/types/src/base/models/abstract_model_with_async_data.d.ts +3 -3
- package/dist/types/src/base/models/abstract_model_with_async_data.d.ts.map +1 -1
- package/dist/types/src/base/models/base.d.ts +21 -3
- package/dist/types/src/base/models/base.d.ts.map +1 -1
- package/dist/types/src/base/models/create_aggregators.d.ts +7 -8
- package/dist/types/src/base/models/create_aggregators.d.ts.map +1 -1
- package/dist/types/src/base/models/cursor.d.ts +2 -2
- package/dist/types/src/base/models/cursor.d.ts.map +1 -1
- package/dist/types/src/base/models/field.d.ts +9 -8
- package/dist/types/src/base/models/field.d.ts.map +1 -1
- package/dist/types/src/base/models/grouped_record_query_result.d.ts +6 -6
- package/dist/types/src/base/models/grouped_record_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/linked_records_query_result.d.ts +4 -4
- package/dist/types/src/base/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/models.d.ts +2 -3
- package/dist/types/src/base/models/models.d.ts.map +1 -1
- package/dist/types/src/base/models/mutations.d.ts +1 -1
- package/dist/types/src/base/models/mutations.d.ts.map +1 -1
- package/dist/types/src/base/models/record.d.ts +8 -8
- package/dist/types/src/base/models/record.d.ts.map +1 -1
- package/dist/types/src/base/models/record_coloring.d.ts +3 -3
- package/dist/types/src/base/models/record_coloring.d.ts.map +1 -1
- package/dist/types/src/base/models/record_query_result.d.ts +5 -5
- package/dist/types/src/base/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/session.d.ts +2 -2
- package/dist/types/src/base/models/session.d.ts.map +1 -1
- package/dist/types/src/base/models/table.d.ts +7 -7
- package/dist/types/src/base/models/table.d.ts.map +1 -1
- package/dist/types/src/base/models/table_or_view_query_result.d.ts +5 -5
- package/dist/types/src/base/models/table_or_view_query_result.d.ts.map +1 -1
- package/dist/types/src/base/models/view.d.ts +6 -6
- package/dist/types/src/base/models/view.d.ts.map +1 -1
- package/dist/types/src/base/models/view_metadata_query_result.d.ts +5 -5
- package/dist/types/src/base/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/base/perform_record_action.d.ts +2 -2
- package/dist/types/src/base/perform_record_action.d.ts.map +1 -1
- package/dist/types/src/base/sdk.d.ts +3 -3
- package/dist/types/src/base/sdk.d.ts.map +1 -1
- package/dist/types/src/base/settings_button.d.ts +1 -1
- package/dist/types/src/base/settings_button.d.ts.map +1 -1
- package/dist/types/src/base/types/airtable_interface.d.ts +16 -18
- package/dist/types/src/base/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/base/types/base.d.ts +4 -4
- package/dist/types/src/base/types/base.d.ts.map +1 -1
- package/dist/types/src/base/types/cursor.d.ts +2 -2
- package/dist/types/src/base/types/cursor.d.ts.map +1 -1
- package/dist/types/src/base/types/field.d.ts +1 -1
- package/dist/types/src/base/types/field.d.ts.map +1 -1
- package/dist/types/src/base/types/mutations.d.ts +5 -5
- package/dist/types/src/base/types/mutations.d.ts.map +1 -1
- package/dist/types/src/base/types/record.d.ts +1 -1
- package/dist/types/src/base/types/record.d.ts.map +1 -1
- package/dist/types/src/base/types/record_action_data.d.ts +1 -1
- package/dist/types/src/base/types/record_action_data.d.ts.map +1 -1
- package/dist/types/src/base/types/table.d.ts +6 -6
- package/dist/types/src/base/types/table.d.ts.map +1 -1
- package/dist/types/src/base/types/undo_redo.d.ts +1 -1
- package/dist/types/src/base/types/undo_redo.d.ts.map +1 -1
- package/dist/types/src/base/types/view.d.ts +3 -3
- package/dist/types/src/base/types/view.d.ts.map +1 -1
- package/dist/types/src/base/ui/base_provider.d.ts +1 -1
- package/dist/types/src/base/ui/base_provider.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +3 -17
- package/dist/types/src/base/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +6 -58
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/expand_record.d.ts +1 -1
- package/dist/types/src/base/ui/expand_record.d.ts.map +1 -1
- package/dist/types/src/base/ui/expand_record_list.d.ts +2 -2
- package/dist/types/src/base/ui/expand_record_list.d.ts.map +1 -1
- package/dist/types/src/base/ui/expand_record_picker_async.d.ts +2 -2
- package/dist/types/src/base/ui/expand_record_picker_async.d.ts.map +1 -1
- package/dist/types/src/base/ui/global_alert.d.ts +1 -1
- package/dist/types/src/base/ui/global_alert.d.ts.map +1 -1
- package/dist/types/src/base/ui/global_css_helpers.d.ts +4 -0
- package/dist/types/src/base/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/base/ui/initialize_block.d.ts +3 -3
- package/dist/types/src/base/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/base/ui/ui.d.ts +1 -21
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts +2 -22
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_cursor.d.ts +1 -1
- package/dist/types/src/base/ui/use_cursor.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_loadable.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_record_action_data.d.ts +1 -1
- package/dist/types/src/base/ui/use_record_action_data.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_records.d.ts +5 -5
- package/dist/types/src/base/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_settings_button.d.ts +1 -1
- package/dist/types/src/base/ui/use_settings_button.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_view_metadata.d.ts +1 -1
- package/dist/types/src/base/ui/use_view_metadata.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_viewport.d.ts +1 -1
- package/dist/types/src/base/ui/use_viewport.d.ts.map +1 -1
- package/dist/types/src/base/undo_redo.d.ts +2 -2
- package/dist/types/src/base/undo_redo.d.ts.map +1 -1
- package/dist/types/src/base/unstable_testing_utils.d.ts +13 -11
- package/dist/types/src/base/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/base/viewport.d.ts +2 -2
- package/dist/types/src/base/viewport.d.ts.map +1 -1
- package/dist/types/src/injected/airtable_interface.d.ts +1 -1
- package/dist/types/src/injected/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/interface/models/base.d.ts +1 -1
- package/dist/types/src/interface/models/base.d.ts.map +1 -1
- package/dist/types/src/interface/models/field.d.ts +1 -1
- package/dist/types/src/interface/models/field.d.ts.map +1 -1
- package/dist/types/src/interface/models/models.d.ts +2 -1
- package/dist/types/src/interface/models/models.d.ts.map +1 -1
- package/dist/types/src/interface/models/mutations.d.ts +1 -1
- package/dist/types/src/interface/models/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/models/record.d.ts +4 -4
- package/dist/types/src/interface/models/record.d.ts.map +1 -1
- package/dist/types/src/interface/models/session.d.ts +1 -1
- package/dist/types/src/interface/models/session.d.ts.map +1 -1
- package/dist/types/src/interface/models/table.d.ts +2 -2
- package/dist/types/src/interface/models/table.d.ts.map +1 -1
- package/dist/types/src/interface/sdk.d.ts +2 -2
- package/dist/types/src/interface/sdk.d.ts.map +1 -1
- package/dist/types/src/interface/types/airtable_interface.d.ts +11 -9
- package/dist/types/src/interface/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/interface/types/base.d.ts +2 -2
- package/dist/types/src/interface/types/base.d.ts.map +1 -1
- package/dist/types/src/interface/types/field.d.ts +1 -1
- package/dist/types/src/interface/types/field.d.ts.map +1 -1
- package/dist/types/src/interface/types/mutations.d.ts +2 -2
- package/dist/types/src/interface/types/mutations.d.ts.map +1 -1
- package/dist/types/src/interface/types/record.d.ts +1 -1
- package/dist/types/src/interface/types/record.d.ts.map +1 -1
- package/dist/types/src/interface/types/table.d.ts +5 -5
- package/dist/types/src/interface/types/table.d.ts.map +1 -1
- package/dist/types/src/interface/ui/block_wrapper.d.ts +2 -5
- package/dist/types/src/interface/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/interface/ui/cell_renderer.d.ts +19 -0
- package/dist/types/src/interface/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/interface/ui/expand_record.d.ts +1 -1
- package/dist/types/src/interface/ui/expand_record.d.ts.map +1 -1
- package/dist/types/src/interface/ui/global_css_helpers.d.ts +3 -0
- package/dist/types/src/interface/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/interface/ui/initialize_block.d.ts +1 -1
- package/dist/types/src/interface/ui/initialize_block.d.ts.map +1 -1
- package/dist/types/src/interface/ui/ui.d.ts +1 -1
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_base.d.ts +1 -1
- package/dist/types/src/interface/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +10 -3
- package/dist/types/src/interface/ui/use_custom_properties.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_records.d.ts +2 -2
- package/dist/types/src/interface/ui/use_records.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_session.d.ts +1 -1
- package/dist/types/src/interface/ui/use_session.d.ts.map +1 -1
- package/dist/types/src/sdk_mode.d.ts +26 -26
- package/dist/types/src/sdk_mode.d.ts.map +1 -1
- package/dist/types/src/shared/color_utils.d.ts +1 -1
- package/dist/types/src/shared/color_utils.d.ts.map +1 -1
- package/dist/types/src/shared/colors.d.ts +1 -1
- package/dist/types/src/shared/colors.d.ts.map +1 -1
- package/dist/types/src/shared/global_config.d.ts +2 -2
- package/dist/types/src/shared/global_config.d.ts.map +1 -1
- package/dist/types/src/shared/models/abstract_model.d.ts +1 -1
- package/dist/types/src/shared/models/abstract_model.d.ts.map +1 -1
- package/dist/types/src/shared/models/base_core.d.ts +4 -4
- package/dist/types/src/shared/models/base_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/field_core.d.ts +4 -4
- package/dist/types/src/shared/models/field_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/mutations_core.d.ts +4 -4
- package/dist/types/src/shared/models/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/record_core.d.ts +3 -3
- package/dist/types/src/shared/models/record_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/session_core.d.ts +5 -5
- package/dist/types/src/shared/models/session_core.d.ts.map +1 -1
- package/dist/types/src/shared/models/table_core.d.ts +4 -4
- package/dist/types/src/shared/models/table_core.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +9 -1
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/sdk_core.d.ts +2 -2
- package/dist/types/src/shared/sdk_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/airtable_interface_core.d.ts +9 -9
- package/dist/types/src/shared/types/airtable_interface_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/attachment.d.ts +1 -1
- package/dist/types/src/shared/types/attachment.d.ts.map +1 -1
- package/dist/types/src/shared/types/base_core.d.ts +6 -6
- package/dist/types/src/shared/types/base_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/collaborator.d.ts +1 -1
- package/dist/types/src/shared/types/collaborator.d.ts.map +1 -1
- package/dist/types/src/shared/types/field_core.d.ts +2 -2
- package/dist/types/src/shared/types/field_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/mutations_core.d.ts +3 -3
- package/dist/types/src/shared/types/mutations_core.d.ts.map +1 -1
- package/dist/types/src/shared/types/permission_levels.d.ts +1 -1
- package/dist/types/src/shared/types/permission_levels.d.ts.map +1 -1
- package/dist/types/src/shared/types/record.d.ts +2 -2
- package/dist/types/src/shared/types/record.d.ts.map +1 -1
- package/dist/types/src/shared/types/table_core.d.ts +1 -1
- package/dist/types/src/shared/types/table_core.d.ts.map +1 -1
- package/dist/types/src/shared/ui/cell_renderer.d.ts +32 -0
- package/dist/types/src/shared/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts +1 -1
- package/dist/types/src/shared/ui/global_config_synced_component_helpers.d.ts.map +1 -1
- package/dist/types/src/shared/ui/sdk_context.d.ts +1 -1
- package/dist/types/src/shared/ui/sdk_context.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_base.d.ts +1 -1
- package/dist/types/src/shared/ui/use_base.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_global_config.d.ts +1 -1
- package/dist/types/src/shared/ui/use_global_config.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_synced.d.ts +1 -1
- package/dist/types/src/shared/ui/use_synced.d.ts.map +1 -1
- package/dist/types/src/shared/ui/use_watchable.d.ts +1 -1
- package/dist/types/src/shared/ui/use_watchable.d.ts.map +1 -1
- package/dist/types/src/shared/warning.d.ts +2 -2
- package/dist/types/src/shared/warning.d.ts.map +1 -1
- package/dist/types/src/shared/watchable.d.ts +1 -1
- package/dist/types/src/shared/watchable.d.ts.map +1 -1
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts +15 -16
- package/dist/types/src/testing/base/abstract_mock_airtable_interface.d.ts.map +1 -1
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts +8 -9
- package/dist/types/src/testing/interface/abstract_mock_airtable_interface.d.ts.map +1 -1
- package/models.js +1 -1
- package/package.json +23 -55
- package/types.js +1 -1
- package/dist/cjs/base/assert_run_context.js +0 -12
- package/dist/cjs/base/index.js +0 -96
- package/dist/cjs/base/models/models.js +0 -134
- package/dist/cjs/base/types/aggregators.js +0 -1
- package/dist/cjs/base/types/backend_fetch_types.js +0 -1
- package/dist/cjs/base/types/base.js +0 -1
- package/dist/cjs/base/types/cursor.js +0 -1
- package/dist/cjs/base/types/field.js +0 -1
- package/dist/cjs/base/types/record.js +0 -1
- package/dist/cjs/base/types/record_action_data.js +0 -1
- package/dist/cjs/base/types/table.js +0 -1
- package/dist/cjs/base/types/undo_redo.js +0 -12
- package/dist/cjs/base/types/viewport.js +0 -1
- package/dist/cjs/base/ui/base_provider.js +0 -48
- package/dist/cjs/base/ui/baymax_utils.js +0 -461
- package/dist/cjs/base/ui/block_wrapper.js +0 -118
- package/dist/cjs/base/ui/box.js +0 -84
- package/dist/cjs/base/ui/button.js +0 -152
- package/dist/cjs/base/ui/cell_renderer.js +0 -198
- package/dist/cjs/base/ui/choice_token.js +0 -93
- package/dist/cjs/base/ui/collaborator_token.js +0 -123
- package/dist/cjs/base/ui/color_palette.js +0 -196
- package/dist/cjs/base/ui/color_palette_synced.js +0 -69
- package/dist/cjs/base/ui/confirmation_dialog.js +0 -103
- package/dist/cjs/base/ui/control_sizes.js +0 -104
- package/dist/cjs/base/ui/create_detect_element_resize.js +0 -203
- package/dist/cjs/base/ui/css_helpers.js +0 -23
- package/dist/cjs/base/ui/dialog.js +0 -101
- package/dist/cjs/base/ui/dialog_close_button.js +0 -106
- package/dist/cjs/base/ui/field_icon.js +0 -44
- package/dist/cjs/base/ui/field_picker.js +0 -98
- package/dist/cjs/base/ui/field_picker_synced.js +0 -66
- package/dist/cjs/base/ui/form_field.js +0 -109
- package/dist/cjs/base/ui/geometry/geometry.js +0 -27
- package/dist/cjs/base/ui/geometry/point.js +0 -19
- package/dist/cjs/base/ui/geometry/rect.js +0 -51
- package/dist/cjs/base/ui/geometry/size.js +0 -19
- package/dist/cjs/base/ui/global_alert.js +0 -71
- package/dist/cjs/base/ui/heading.js +0 -132
- package/dist/cjs/base/ui/icon.js +0 -109
- package/dist/cjs/base/ui/icon_config.js +0 -428
- package/dist/cjs/base/ui/initialize_block.js +0 -122
- package/dist/cjs/base/ui/input.js +0 -161
- package/dist/cjs/base/ui/input_synced.js +0 -66
- package/dist/cjs/base/ui/key_codes.js +0 -73
- package/dist/cjs/base/ui/label.js +0 -80
- package/dist/cjs/base/ui/link.js +0 -196
- package/dist/cjs/base/ui/loader.js +0 -61
- package/dist/cjs/base/ui/modal.js +0 -145
- package/dist/cjs/base/ui/model_picker_select.js +0 -57
- package/dist/cjs/base/ui/popover.js +0 -315
- package/dist/cjs/base/ui/progress_bar.js +0 -115
- package/dist/cjs/base/ui/record_card.js +0 -564
- package/dist/cjs/base/ui/record_card_list.js +0 -303
- package/dist/cjs/base/ui/select.js +0 -191
- package/dist/cjs/base/ui/select_and_select_buttons_helpers.js +0 -63
- package/dist/cjs/base/ui/select_buttons.js +0 -159
- package/dist/cjs/base/ui/select_buttons_synced.js +0 -62
- package/dist/cjs/base/ui/select_synced.js +0 -65
- package/dist/cjs/base/ui/switch.js +0 -167
- package/dist/cjs/base/ui/switch_synced.js +0 -53
- package/dist/cjs/base/ui/synced.js +0 -49
- package/dist/cjs/base/ui/system/all_styles_set.js +0 -92
- package/dist/cjs/base/ui/system/appearance/appearance_set.js +0 -27
- package/dist/cjs/base/ui/system/appearance/background_color.js +0 -18
- package/dist/cjs/base/ui/system/appearance/border.js +0 -54
- package/dist/cjs/base/ui/system/appearance/border_radius.js +0 -18
- package/dist/cjs/base/ui/system/appearance/box_shadow.js +0 -18
- package/dist/cjs/base/ui/system/appearance/opacity.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/dimensions_set.js +0 -29
- package/dist/cjs/base/ui/system/dimensions/height.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/max_height.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/max_width.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/min_height.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/min_width.js +0 -18
- package/dist/cjs/base/ui/system/dimensions/width.js +0 -18
- package/dist/cjs/base/ui/system/display.js +0 -19
- package/dist/cjs/base/ui/system/flex_container/align_content.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/align_items.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/flex_container_set.js +0 -29
- package/dist/cjs/base/ui/system/flex_container/flex_direction.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/flex_wrap.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/justify_content.js +0 -15
- package/dist/cjs/base/ui/system/flex_container/justify_items.js +0 -16
- package/dist/cjs/base/ui/system/flex_item/align_self.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex_basis.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex_grow.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/flex_item_set.js +0 -31
- package/dist/cjs/base/ui/system/flex_item/flex_shrink.js +0 -15
- package/dist/cjs/base/ui/system/flex_item/justify_self.js +0 -16
- package/dist/cjs/base/ui/system/flex_item/order.js +0 -15
- package/dist/cjs/base/ui/system/index.js +0 -681
- package/dist/cjs/base/ui/system/overflow.js +0 -21
- package/dist/cjs/base/ui/system/position/bottom.js +0 -24
- package/dist/cjs/base/ui/system/position/left.js +0 -24
- package/dist/cjs/base/ui/system/position/position.js +0 -15
- package/dist/cjs/base/ui/system/position/position_set.js +0 -29
- package/dist/cjs/base/ui/system/position/right.js +0 -24
- package/dist/cjs/base/ui/system/position/top.js +0 -24
- package/dist/cjs/base/ui/system/position/z_index.js +0 -18
- package/dist/cjs/base/ui/system/spacing/margin.js +0 -72
- package/dist/cjs/base/ui/system/spacing/padding.js +0 -65
- package/dist/cjs/base/ui/system/spacing/spacing_set.js +0 -21
- package/dist/cjs/base/ui/system/typography/font_family.js +0 -18
- package/dist/cjs/base/ui/system/typography/font_size.js +0 -18
- package/dist/cjs/base/ui/system/typography/font_style.js +0 -15
- package/dist/cjs/base/ui/system/typography/font_weight.js +0 -18
- package/dist/cjs/base/ui/system/typography/letter_spacing.js +0 -18
- package/dist/cjs/base/ui/system/typography/line_height.js +0 -15
- package/dist/cjs/base/ui/system/typography/text_align.js +0 -15
- package/dist/cjs/base/ui/system/typography/text_color.js +0 -18
- package/dist/cjs/base/ui/system/typography/text_decoration.js +0 -15
- package/dist/cjs/base/ui/system/typography/text_transform.js +0 -15
- package/dist/cjs/base/ui/system/typography/typography_set.js +0 -37
- package/dist/cjs/base/ui/system/utils/csstype.js +0 -1
- package/dist/cjs/base/ui/system/utils/ensure_numbers_are_within_scale.js +0 -41
- package/dist/cjs/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -73
- package/dist/cjs/base/ui/system/utils/types.js +0 -1
- package/dist/cjs/base/ui/table_picker.js +0 -71
- package/dist/cjs/base/ui/table_picker_synced.js +0 -62
- package/dist/cjs/base/ui/text.js +0 -117
- package/dist/cjs/base/ui/text_button.js +0 -196
- package/dist/cjs/base/ui/theme/default_theme/button_variants.js +0 -59
- package/dist/cjs/base/ui/theme/default_theme/control_sizes.js +0 -102
- package/dist/cjs/base/ui/theme/default_theme/heading_styles.js +0 -99
- package/dist/cjs/base/ui/theme/default_theme/index.js +0 -42
- package/dist/cjs/base/ui/theme/default_theme/input_variants.js +0 -38
- package/dist/cjs/base/ui/theme/default_theme/link_variants.js +0 -35
- package/dist/cjs/base/ui/theme/default_theme/select_buttons_variants.js +0 -72
- package/dist/cjs/base/ui/theme/default_theme/select_variants.js +0 -50
- package/dist/cjs/base/ui/theme/default_theme/switch_variants.js +0 -85
- package/dist/cjs/base/ui/theme/default_theme/text_button_variants.js +0 -44
- package/dist/cjs/base/ui/theme/default_theme/text_styles.js +0 -81
- package/dist/cjs/base/ui/theme/default_theme/tokens.js +0 -211
- package/dist/cjs/base/ui/theme/theme_context.js +0 -13
- package/dist/cjs/base/ui/theme/use_theme.js +0 -11
- package/dist/cjs/base/ui/tooltip.js +0 -175
- package/dist/cjs/base/ui/types/aria_props.js +0 -1
- package/dist/cjs/base/ui/types/data_attributes_prop.js +0 -1
- package/dist/cjs/base/ui/types/tooltip_anchor_props.js +0 -1
- package/dist/cjs/base/ui/ui.js +0 -382
- package/dist/cjs/base/ui/unstable_standalone_ui.js +0 -179
- package/dist/cjs/base/ui/use_form_field.js +0 -20
- package/dist/cjs/base/ui/use_styled_system.js +0 -25
- package/dist/cjs/base/ui/use_text_color_for_background_color.js +0 -15
- package/dist/cjs/base/ui/view_picker.js +0 -89
- package/dist/cjs/base/ui/view_picker_synced.js +0 -66
- package/dist/cjs/base/ui/viewport_constraint.js +0 -129
- package/dist/cjs/base/ui/with_styled_system.js +0 -129
- package/dist/cjs/base/undo_redo.js +0 -37
- package/dist/cjs/base/unstable_testing_utils.js +0 -171
- package/dist/cjs/interface/assert_run_context.js +0 -12
- package/dist/cjs/interface/index.js +0 -22
- package/dist/cjs/interface/models/models.js +0 -54
- package/dist/cjs/interface/models/record_store.js +0 -51
- package/dist/cjs/interface/types/base.js +0 -1
- package/dist/cjs/interface/types/field.js +0 -1
- package/dist/cjs/interface/types/mutations.js +0 -17
- package/dist/cjs/interface/types/record.js +0 -1
- package/dist/cjs/interface/types/table.js +0 -1
- package/dist/cjs/interface/ui/block_wrapper.js +0 -69
- package/dist/cjs/interface/ui/initialize_block.js +0 -95
- package/dist/cjs/interface/ui/ui.js +0 -125
- package/dist/cjs/sdk_mode.js +0 -1
- package/dist/cjs/shared/color_utils.js +0 -58
- package/dist/cjs/shared/event_tracker.js +0 -28
- package/dist/cjs/shared/types/airtable_interface_core.js +0 -1
- package/dist/cjs/shared/types/attachment.js +0 -1
- package/dist/cjs/shared/types/base_core.js +0 -1
- package/dist/cjs/shared/types/collaborator.js +0 -1
- package/dist/cjs/shared/types/global_config.js +0 -1
- package/dist/cjs/shared/types/hyper_ids.js +0 -1
- package/dist/cjs/shared/types/mutation_constants.js +0 -11
- package/dist/cjs/shared/types/permission_levels.js +0 -17
- package/dist/cjs/shared/types/record.js +0 -1
- package/dist/cjs/shared/types/stat.js +0 -1
- package/dist/cjs/shared/types/table_core.js +0 -1
- package/dist/cjs/shared/ui/global_config_synced_component_helpers.js +0 -27
- package/dist/cjs/shared/ui/sdk_context.js +0 -17
- package/dist/cjs/shared/ui/use_base.js +0 -22
- package/dist/cjs/shared/ui/use_session.js +0 -21
- package/dist/cjs/shared/unstable_private_utils.js +0 -49
- package/dist/types/src/base/ui/baymax_utils.d.ts +0 -2
- package/dist/types/src/base/ui/baymax_utils.d.ts.map +0 -1
- package/dist/types/src/base/ui/box.d.ts +0 -35
- package/dist/types/src/base/ui/box.d.ts.map +0 -1
- package/dist/types/src/base/ui/button.d.ts +0 -86
- package/dist/types/src/base/ui/button.d.ts.map +0 -1
- package/dist/types/src/base/ui/choice_token.d.ts +0 -49
- package/dist/types/src/base/ui/choice_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -45
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette.d.ts +0 -77
- package/dist/types/src/base/ui/color_palette.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -30
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -66
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -16
- package/dist/types/src/base/ui/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/css_helpers.d.ts +0 -6
- package/dist/types/src/base/ui/css_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog.d.ts +0 -58
- package/dist/types/src/base/ui/dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +0 -40
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_icon.d.ts +0 -25
- package/dist/types/src/base/ui/field_icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -34
- package/dist/types/src/base/ui/field_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -42
- package/dist/types/src/base/ui/form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/geometry.d.ts +0 -3
- package/dist/types/src/base/ui/geometry/geometry.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/point.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/point.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/rect.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/rect.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/size.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/size.d.ts.map +0 -1
- package/dist/types/src/base/ui/heading.d.ts +0 -64
- package/dist/types/src/base/ui/heading.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -45
- package/dist/types/src/base/ui/icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon_config.d.ts +0 -424
- package/dist/types/src/base/ui/icon_config.d.ts.map +0 -1
- package/dist/types/src/base/ui/input.d.ts +0 -120
- package/dist/types/src/base/ui/input.d.ts.map +0 -1
- package/dist/types/src/base/ui/input_synced.d.ts +0 -18
- package/dist/types/src/base/ui/input_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/key_codes.d.ts +0 -2
- package/dist/types/src/base/ui/key_codes.d.ts.map +0 -1
- package/dist/types/src/base/ui/label.d.ts +0 -35
- package/dist/types/src/base/ui/label.d.ts.map +0 -1
- package/dist/types/src/base/ui/link.d.ts +0 -84
- package/dist/types/src/base/ui/link.d.ts.map +0 -1
- package/dist/types/src/base/ui/loader.d.ts +0 -38
- package/dist/types/src/base/ui/loader.d.ts.map +0 -1
- package/dist/types/src/base/ui/modal.d.ts +0 -54
- package/dist/types/src/base/ui/modal.d.ts.map +0 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts +0 -19
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +0 -1
- package/dist/types/src/base/ui/popover.d.ts +0 -106
- package/dist/types/src/base/ui/popover.d.ts.map +0 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +0 -60
- package/dist/types/src/base/ui/progress_bar.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card.d.ts +0 -80
- package/dist/types/src/base/ui/record_card.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +0 -88
- package/dist/types/src/base/ui/record_card_list.d.ts.map +0 -1
- package/dist/types/src/base/ui/select.d.ts +0 -82
- package/dist/types/src/base/ui/select.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -25
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -56
- package/dist/types/src/base/ui/select_buttons.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -82
- package/dist/types/src/base/ui/switch.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch_synced.d.ts +0 -18
- package/dist/types/src/base/ui/switch_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/synced.d.ts +0 -23
- package/dist/types/src/base/ui/synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -85
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -14
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -30
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -13
- package/dist/types/src/base/ui/system/display.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -16
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/index.d.ts +0 -54
- package/dist/types/src/base/ui/system/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -17
- package/dist/types/src/base/ui/system/overflow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/left.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/position.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/right.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/top.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -11
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -16
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -14
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -19
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/csstype.d.ts +0 -3977
- package/dist/types/src/base/ui/system/utils/csstype.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/types.d.ts +0 -31
- package/dist/types/src/base/ui/system/utils/types.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -28
- package/dist/types/src/base/ui/table_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/text.d.ts +0 -66
- package/dist/types/src/base/ui/text.d.ts.map +0 -1
- package/dist/types/src/base/ui/text_button.d.ts +0 -83
- package/dist/types/src/base/ui/text_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts +0 -107
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts +0 -11
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +0 -342
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts +0 -16
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts +0 -76
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts +0 -111
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +0 -342
- package/dist/types/src/base/ui/theme/theme_context.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +0 -342
- package/dist/types/src/base/ui/theme/use_theme.d.ts.map +0 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -64
- package/dist/types/src/base/ui/tooltip.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts +0 -22
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -10
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -13
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/base/ui/use_form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/use_styled_system.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts +0 -2
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -34
- package/dist/types/src/base/ui/view_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +0 -57
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +0 -1
- package/dist/types/src/base/ui/with_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/with_styled_system.d.ts.map +0 -1
- package/types/styled-system__core.d.ts +0 -41
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getLinkedTableId = exports.default = void 0;
|
|
7
|
-
var _field_core = require("../../shared/types/field_core");
|
|
8
|
-
var _error_utils = require("../../shared/error_utils");
|
|
9
|
-
var _record_query_result = _interopRequireDefault(require("./record_query_result"));
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
1
|
/** @module @airtable/blocks/models: RecordQueryResult */ /** */
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { FieldType } from '../../shared/types/field_core';
|
|
3
|
+
import { invariant } from '../../shared/error_utils';
|
|
4
|
+
import RecordQueryResult from './record_query_result';
|
|
5
|
+
export const getLinkedTableId = field => {
|
|
14
6
|
const options = field.options;
|
|
15
7
|
const linkedTableId = options && options.linkedTableId;
|
|
16
|
-
|
|
8
|
+
invariant(typeof linkedTableId === 'string', 'linkedTableId must exist');
|
|
17
9
|
return linkedTableId;
|
|
18
10
|
};
|
|
19
11
|
|
|
20
12
|
/** internal */
|
|
21
|
-
|
|
13
|
+
|
|
22
14
|
/**
|
|
23
15
|
* Represents a set of records from a LinkedRecord cell value. See {@link RecordQueryResult} for main
|
|
24
16
|
* documentation.
|
|
@@ -28,7 +20,7 @@ exports.getLinkedTableId = getLinkedTableId;
|
|
|
28
20
|
*
|
|
29
21
|
* @docsPath models/query results/LinkedRecordsQueryResult
|
|
30
22
|
*/
|
|
31
|
-
class LinkedRecordsQueryResult extends
|
|
23
|
+
class LinkedRecordsQueryResult extends RecordQueryResult {
|
|
32
24
|
/** @internal */
|
|
33
25
|
static _className = 'LinkedRecordsQueryResult';
|
|
34
26
|
|
|
@@ -69,7 +61,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
69
61
|
/** @internal */
|
|
70
62
|
constructor(record, field, normalizedOpts, sdk) {
|
|
71
63
|
super(sdk, normalizedOpts);
|
|
72
|
-
|
|
64
|
+
invariant(record.parentTable === field.parentTable, 'record and field must belong to the same table');
|
|
73
65
|
this._record = record;
|
|
74
66
|
this._field = field;
|
|
75
67
|
this._linkedTable = normalizedOpts.table;
|
|
@@ -102,7 +94,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
102
94
|
* @internal (since we may not be able to return parent model instances in the immutable models world)
|
|
103
95
|
*/
|
|
104
96
|
get parentTable() {
|
|
105
|
-
|
|
97
|
+
invariant(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
106
98
|
return this._linkedTable;
|
|
107
99
|
}
|
|
108
100
|
|
|
@@ -110,12 +102,12 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
110
102
|
* Ordered array of all the linked record ids. Watchable.
|
|
111
103
|
*/
|
|
112
104
|
get recordIds() {
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
invariant(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
106
|
+
invariant(this.isDataLoaded, 'LinkedRecordsQueryResult data is not loaded');
|
|
115
107
|
|
|
116
108
|
// record ids are lazily generated
|
|
117
109
|
this._generateComputedDataIfNeeded();
|
|
118
|
-
|
|
110
|
+
invariant(this._computedFilteredSortedRecordIds, 'no recordIds');
|
|
119
111
|
return this._computedFilteredSortedRecordIds;
|
|
120
112
|
}
|
|
121
113
|
|
|
@@ -123,10 +115,10 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
123
115
|
* Ordered array of all the linked records. Watchable.
|
|
124
116
|
*/
|
|
125
117
|
get records() {
|
|
126
|
-
|
|
118
|
+
invariant(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
127
119
|
return this.recordIds.map(recordId => {
|
|
128
120
|
const record = this._linkedRecordStore.getRecordByIdIfExists(recordId);
|
|
129
|
-
|
|
121
|
+
invariant(record, 'No record for id: %s', recordId);
|
|
130
122
|
return record;
|
|
131
123
|
});
|
|
132
124
|
}
|
|
@@ -135,20 +127,20 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
135
127
|
* The fields that were used to create this LinkedRecordsQueryResult.
|
|
136
128
|
*/
|
|
137
129
|
get fields() {
|
|
138
|
-
|
|
130
|
+
invariant(this.isValid, 'LinkedRecordsQueryResult is no longer valid');
|
|
139
131
|
return this._linkedQueryResult.fields;
|
|
140
132
|
}
|
|
141
133
|
|
|
142
134
|
/** @inheritdoc */
|
|
143
135
|
watch(keys, callback, context) {
|
|
144
|
-
|
|
136
|
+
invariant(this.isValid, 'cannot watch an invalid LinkedRecordsQueryResult');
|
|
145
137
|
const validKeys = super.watch(keys, callback, context);
|
|
146
138
|
for (const key of validKeys) {
|
|
147
|
-
if (key ===
|
|
139
|
+
if (key === RecordQueryResult.WatchableKeys.cellValues) {
|
|
148
140
|
this._watchLinkedQueryCellValuesIfNeededAfterWatch();
|
|
149
141
|
}
|
|
150
|
-
if (key.startsWith(
|
|
151
|
-
const fieldId = key.substring(
|
|
142
|
+
if (key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix)) {
|
|
143
|
+
const fieldId = key.substring(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix.length);
|
|
152
144
|
this._watchLinkedQueryCellValuesInFieldIfNeededAfterWatch(fieldId);
|
|
153
145
|
}
|
|
154
146
|
}
|
|
@@ -159,11 +151,11 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
159
151
|
unwatch(keys, callback, context) {
|
|
160
152
|
const arrayKeys = Array.isArray(keys) ? keys : [keys];
|
|
161
153
|
for (const key of arrayKeys) {
|
|
162
|
-
if (key ===
|
|
154
|
+
if (key === RecordQueryResult.WatchableKeys.cellValues) {
|
|
163
155
|
this._unwatchLinkedQueryCellValuesIfPossibleBeforeUnwatch();
|
|
164
156
|
}
|
|
165
|
-
if (key.startsWith(
|
|
166
|
-
const fieldId = key.substring(
|
|
157
|
+
if (key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix)) {
|
|
158
|
+
const fieldId = key.substring(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix.length);
|
|
167
159
|
this._unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch(fieldId);
|
|
168
160
|
}
|
|
169
161
|
}
|
|
@@ -206,7 +198,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
206
198
|
}
|
|
207
199
|
const fieldIds = this._normalizedOpts.fieldIdsOrNullIfAllFields || this.parentTable.fields.map(field => field.id);
|
|
208
200
|
for (const fieldId of fieldIds) {
|
|
209
|
-
changedKeys.push(
|
|
201
|
+
changedKeys.push(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
210
202
|
}
|
|
211
203
|
return changedKeys;
|
|
212
204
|
}
|
|
@@ -238,7 +230,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
238
230
|
|
|
239
231
|
/** @internal */
|
|
240
232
|
get _cellValuesWatchCount() {
|
|
241
|
-
return (this._changeWatchersByKey[
|
|
233
|
+
return (this._changeWatchersByKey[RecordQueryResult.WatchableKeys.cellValues] || []).length;
|
|
242
234
|
}
|
|
243
235
|
|
|
244
236
|
/** @internal */
|
|
@@ -259,10 +251,10 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
259
251
|
get _cellValueWatchCountByFieldId() {
|
|
260
252
|
const countByFieldId = {};
|
|
261
253
|
const watchKeys = Object.keys(this._changeWatchersByKey).filter(key => {
|
|
262
|
-
return key.startsWith(
|
|
254
|
+
return key.startsWith(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix);
|
|
263
255
|
});
|
|
264
256
|
for (const watchKey of watchKeys) {
|
|
265
|
-
const fieldId = watchKey.slice(
|
|
257
|
+
const fieldId = watchKey.slice(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix.length);
|
|
266
258
|
countByFieldId[fieldId] = this._changeWatchersByKey[watchKey].length;
|
|
267
259
|
}
|
|
268
260
|
return countByFieldId;
|
|
@@ -277,7 +269,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
277
269
|
|
|
278
270
|
/** @internal */
|
|
279
271
|
_unwatchLinkedQueryCellValuesInFieldIfPossibleBeforeUnwatch(fieldId) {
|
|
280
|
-
|
|
272
|
+
invariant(this._cellValueWatchCountByFieldId[fieldId], "cellValuesInField:%s over-free'd", fieldId);
|
|
281
273
|
if (this._cellValueWatchCountByFieldId[fieldId] === 1 && this.isValid) {
|
|
282
274
|
this._unwatchLinkedQueryCellValuesInField(fieldId);
|
|
283
275
|
}
|
|
@@ -335,12 +327,12 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
335
327
|
|
|
336
328
|
/** @internal */
|
|
337
329
|
_watchLinkedQueryCellValuesInField(fieldId) {
|
|
338
|
-
this._linkedQueryResult.watch(
|
|
330
|
+
this._linkedQueryResult.watch(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId, this._getOnLinkedCellValuesInFieldChange(fieldId), this);
|
|
339
331
|
}
|
|
340
332
|
|
|
341
333
|
/** @internal */
|
|
342
334
|
_unwatchLinkedQueryCellValuesInField(fieldId) {
|
|
343
|
-
this._linkedQueryResult.unwatch(
|
|
335
|
+
this._linkedQueryResult.unwatch(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId, this._getOnLinkedCellValuesInFieldChange(fieldId), this);
|
|
344
336
|
}
|
|
345
337
|
|
|
346
338
|
/** @internal */
|
|
@@ -353,7 +345,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
353
345
|
// records while keeping the behavior of isValid consistent
|
|
354
346
|
return;
|
|
355
347
|
}
|
|
356
|
-
|
|
348
|
+
invariant(this.isValid, 'watch key change event whilst invalid');
|
|
357
349
|
this._invalidateComputedData();
|
|
358
350
|
|
|
359
351
|
// we don't actually know at this stage whether anything changed or
|
|
@@ -379,7 +371,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
379
371
|
|
|
380
372
|
/** @internal */
|
|
381
373
|
_onLinkedCellValuesChange(queryResult, key, changes) {
|
|
382
|
-
|
|
374
|
+
invariant(this.isValid, 'watch key change event whilst invalid');
|
|
383
375
|
if (changes && changes.fieldIds && changes.recordIds) {
|
|
384
376
|
const recordIdsSet = this._getOrGenerateRecordIdsSet();
|
|
385
377
|
const recordIds = changes.recordIds.filter(id => recordIdsSet[id] === true);
|
|
@@ -398,7 +390,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
398
390
|
_getOnLinkedCellValuesInFieldChange(fieldId) {
|
|
399
391
|
if (!this._cellValueChangeHandlerByFieldId[fieldId]) {
|
|
400
392
|
this._cellValueChangeHandlerByFieldId[fieldId] = (queryResult, key, recordIds) => {
|
|
401
|
-
|
|
393
|
+
invariant(this.isValid, 'watch key change event whilst invalid');
|
|
402
394
|
|
|
403
395
|
// The linked record may finish loading before its parent. In
|
|
404
396
|
// that case, the appropriate events will be triggered by the
|
|
@@ -420,10 +412,10 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
420
412
|
const recordIdsSet = this._getOrGenerateRecordIdsSet();
|
|
421
413
|
const filteredRecordIds = recordIds.filter(id => typeof id === 'string' && recordIdsSet[id] === true);
|
|
422
414
|
if (filteredRecordIds.length) {
|
|
423
|
-
this._onChange(
|
|
415
|
+
this._onChange(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId, filteredRecordIds);
|
|
424
416
|
}
|
|
425
417
|
} else {
|
|
426
|
-
this._onChange(
|
|
418
|
+
this._onChange(RecordQueryResult.WatchableCellValuesInFieldKeyPrefix + fieldId);
|
|
427
419
|
}
|
|
428
420
|
};
|
|
429
421
|
}
|
|
@@ -440,7 +432,7 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
440
432
|
// records while keeping the behavior of isValid consistent
|
|
441
433
|
return;
|
|
442
434
|
}
|
|
443
|
-
|
|
435
|
+
invariant(this.isValid, 'watch key change event whilst invalid');
|
|
444
436
|
|
|
445
437
|
// when the origin cell value (listing all the linked records) changes,
|
|
446
438
|
// invalidate all the data we have stored - we need to completely
|
|
@@ -468,9 +460,9 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
468
460
|
|
|
469
461
|
/** @internal */
|
|
470
462
|
_onOriginFieldConfigChange() {
|
|
471
|
-
|
|
463
|
+
invariant(this.isValid, 'watch key change event whilst invalid');
|
|
472
464
|
const type = this._field.type;
|
|
473
|
-
if (type !==
|
|
465
|
+
if (type !== FieldType.MULTIPLE_RECORD_LINKS) {
|
|
474
466
|
this._invalidateQueryResult();
|
|
475
467
|
return;
|
|
476
468
|
}
|
|
@@ -515,11 +507,11 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
515
507
|
const recordIdsSet = {};
|
|
516
508
|
const rawCellValue = this._record.getCellValue(this._field);
|
|
517
509
|
const cellValue = rawCellValue === null ? [] : rawCellValue;
|
|
518
|
-
|
|
510
|
+
invariant(Array.isArray(cellValue), 'cellValue should be array');
|
|
519
511
|
for (const linkedRecord of cellValue) {
|
|
520
|
-
|
|
512
|
+
invariant(linkedRecord && typeof linkedRecord === 'object', 'linked record should be object');
|
|
521
513
|
const recordId = linkedRecord.id;
|
|
522
|
-
|
|
514
|
+
invariant(typeof recordId === 'string', 'id should be present');
|
|
523
515
|
|
|
524
516
|
// We need to use the query result as the source of truth for
|
|
525
517
|
// recordIds, since when the client deletes a record from the linked
|
|
@@ -546,8 +538,8 @@ class LinkedRecordsQueryResult extends _record_query_result.default {
|
|
|
546
538
|
_getOrGenerateRecordIdsSet() {
|
|
547
539
|
this._generateComputedDataIfNeeded();
|
|
548
540
|
const recordIdsSet = this._computedRecordIdsSet;
|
|
549
|
-
|
|
541
|
+
invariant(recordIdsSet, 'recordIdsSet must exist');
|
|
550
542
|
return recordIdsSet;
|
|
551
543
|
}
|
|
552
544
|
}
|
|
553
|
-
|
|
545
|
+
export default LinkedRecordsQueryResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// istanbul ignore file
|
|
2
|
+
/** @ignore */ /** */
|
|
3
|
+
import '../assert_run_context';
|
|
4
|
+
import * as recordColoring from './record_coloring';
|
|
5
|
+
export { FieldType } from '../../shared/types/field_core';
|
|
6
|
+
export { ViewType } from '../types/view';
|
|
7
|
+
export { default as Base } from './base';
|
|
8
|
+
export { default as Table } from './table';
|
|
9
|
+
export { default as Field } from './field';
|
|
10
|
+
export { default as View } from './view';
|
|
11
|
+
export { default as Record } from './record';
|
|
12
|
+
export { default as RecordQueryResult } from './record_query_result';
|
|
13
|
+
export { default as TableOrViewQueryResult } from './table_or_view_query_result';
|
|
14
|
+
export { default as GroupedRecordQueryResult } from './grouped_record_query_result';
|
|
15
|
+
export { default as LinkedRecordsQueryResult } from './linked_records_query_result';
|
|
16
|
+
export { default as ViewMetadataQueryResult } from './view_metadata_query_result';
|
|
17
|
+
export { default as Session } from './session';
|
|
18
|
+
export { default as Cursor } from './cursor';
|
|
19
|
+
export { recordColoring };
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _airtable_interface = require("../types/airtable_interface");
|
|
8
|
-
var _mutations = require("../types/mutations");
|
|
9
|
-
var _error_utils = require("../../shared/error_utils");
|
|
10
|
-
var _mutation_constants = require("../../shared/types/mutation_constants");
|
|
11
|
-
var _mutations_core = require("../../shared/models/mutations_core");
|
|
1
|
+
import { BlockRunContextType } from '../types/airtable_interface';
|
|
2
|
+
import { MutationTypes } from '../types/mutations';
|
|
3
|
+
import { spawnError, spawnUnknownSwitchCaseError } from '../../shared/error_utils';
|
|
4
|
+
import { MAX_FIELD_NAME_LENGTH, MAX_FIELD_DESCRIPTION_LENGTH, MAX_TABLE_NAME_LENGTH, MAX_NUM_FIELDS_PER_TABLE } from '../../shared/types/mutation_constants';
|
|
5
|
+
import { MutationsCore } from '../../shared/models/mutations_core';
|
|
12
6
|
/** @hidden */
|
|
13
|
-
class Mutations extends
|
|
7
|
+
class Mutations extends MutationsCore {
|
|
14
8
|
/** @internal */
|
|
15
9
|
_isRecordStoreReadyForMutations(recordStore) {
|
|
16
10
|
return recordStore.isRecordMetadataLoaded;
|
|
@@ -43,15 +37,15 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
43
37
|
const appInterface = this._sdk.__appInterface;
|
|
44
38
|
const billingPlanGrouping = this._base.__billingPlanGrouping;
|
|
45
39
|
switch (mutation.type) {
|
|
46
|
-
case
|
|
47
|
-
case
|
|
48
|
-
case
|
|
49
|
-
case
|
|
40
|
+
case MutationTypes.SET_MULTIPLE_GLOBAL_CONFIG_PATHS:
|
|
41
|
+
case MutationTypes.SET_MULTIPLE_RECORDS_CELL_VALUES:
|
|
42
|
+
case MutationTypes.CREATE_MULTIPLE_RECORDS:
|
|
43
|
+
case MutationTypes.DELETE_MULTIPLE_RECORDS:
|
|
50
44
|
{
|
|
51
45
|
super._assertMutationIsValid(mutation);
|
|
52
46
|
return;
|
|
53
47
|
}
|
|
54
|
-
case
|
|
48
|
+
case MutationTypes.CREATE_SINGLE_FIELD:
|
|
55
49
|
{
|
|
56
50
|
const {
|
|
57
51
|
tableId,
|
|
@@ -61,24 +55,24 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
61
55
|
} = mutation;
|
|
62
56
|
const table = this._base.getTableByIdIfExists(tableId);
|
|
63
57
|
if (!table) {
|
|
64
|
-
throw
|
|
58
|
+
throw spawnError("Can't create field: No table with id %s exists", tableId);
|
|
65
59
|
}
|
|
66
|
-
if (table.fields.length >=
|
|
67
|
-
throw
|
|
60
|
+
if (table.fields.length >= MAX_NUM_FIELDS_PER_TABLE) {
|
|
61
|
+
throw spawnError("Can't create field: table already has the maximum of %s fields", MAX_NUM_FIELDS_PER_TABLE);
|
|
68
62
|
}
|
|
69
63
|
this._assertFieldNameIsValidForMutation(name, table);
|
|
70
64
|
|
|
71
65
|
// Current config / field data is null since the field doesn't exist.
|
|
72
66
|
const validationResult = this._airtableInterface.fieldTypeProvider.validateConfigForUpdate(appInterface, config, null, null, billingPlanGrouping);
|
|
73
67
|
if (!validationResult.isValid) {
|
|
74
|
-
throw
|
|
68
|
+
throw spawnError("Can't create field: invalid field config.\n%s", validationResult.reason);
|
|
75
69
|
}
|
|
76
|
-
if (description && description.length >
|
|
77
|
-
throw
|
|
70
|
+
if (description && description.length > MAX_FIELD_DESCRIPTION_LENGTH) {
|
|
71
|
+
throw spawnError("Can't create field: description exceeds maximum length of %s characters", MAX_FIELD_DESCRIPTION_LENGTH);
|
|
78
72
|
}
|
|
79
73
|
return;
|
|
80
74
|
}
|
|
81
|
-
case
|
|
75
|
+
case MutationTypes.UPDATE_SINGLE_FIELD_CONFIG:
|
|
82
76
|
{
|
|
83
77
|
const {
|
|
84
78
|
tableId,
|
|
@@ -88,11 +82,11 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
88
82
|
} = mutation;
|
|
89
83
|
const table = this._base.getTableByIdIfExists(tableId);
|
|
90
84
|
if (!table) {
|
|
91
|
-
throw
|
|
85
|
+
throw spawnError("Can't update field: No table with id %s exists", tableId);
|
|
92
86
|
}
|
|
93
87
|
const field = table.getFieldByIdIfExists(id);
|
|
94
88
|
if (!field) {
|
|
95
|
-
throw
|
|
89
|
+
throw spawnError("Can't update field: No field with id %s exists", id);
|
|
96
90
|
}
|
|
97
91
|
|
|
98
92
|
// we get the config directly instead of using field.type/field.options to get it
|
|
@@ -101,11 +95,11 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
101
95
|
const currentConfig = this._airtableInterface.fieldTypeProvider.getConfig(appInterface, field._data, field.parentTable.__getFieldNamesById());
|
|
102
96
|
const validationResult = this._airtableInterface.fieldTypeProvider.validateConfigForUpdate(appInterface, config, currentConfig, field._data, billingPlanGrouping, opts);
|
|
103
97
|
if (!validationResult.isValid) {
|
|
104
|
-
throw
|
|
98
|
+
throw spawnError("Can't update field: invalid field config.\n%s", validationResult.reason);
|
|
105
99
|
}
|
|
106
100
|
return;
|
|
107
101
|
}
|
|
108
|
-
case
|
|
102
|
+
case MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION:
|
|
109
103
|
{
|
|
110
104
|
const {
|
|
111
105
|
tableId,
|
|
@@ -114,18 +108,18 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
114
108
|
} = mutation;
|
|
115
109
|
const table = this._base.getTableByIdIfExists(tableId);
|
|
116
110
|
if (!table) {
|
|
117
|
-
throw
|
|
111
|
+
throw spawnError("Can't update field: No table with id %s exists", tableId);
|
|
118
112
|
}
|
|
119
113
|
const field = table.getFieldByIdIfExists(id);
|
|
120
114
|
if (!field) {
|
|
121
|
-
throw
|
|
115
|
+
throw spawnError("Can't update field: No field with id %s exists", id);
|
|
122
116
|
}
|
|
123
|
-
if (description && description.length >
|
|
124
|
-
throw
|
|
117
|
+
if (description && description.length > MAX_FIELD_DESCRIPTION_LENGTH) {
|
|
118
|
+
throw spawnError("Can't update field: description exceeds maximum length of %s characters", MAX_FIELD_DESCRIPTION_LENGTH);
|
|
125
119
|
}
|
|
126
120
|
return;
|
|
127
121
|
}
|
|
128
|
-
case
|
|
122
|
+
case MutationTypes.UPDATE_SINGLE_FIELD_NAME:
|
|
129
123
|
{
|
|
130
124
|
const {
|
|
131
125
|
tableId,
|
|
@@ -134,11 +128,11 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
134
128
|
} = mutation;
|
|
135
129
|
const table = this._base.getTableByIdIfExists(tableId);
|
|
136
130
|
if (!table) {
|
|
137
|
-
throw
|
|
131
|
+
throw spawnError("Can't update field: No table with id %s exists", tableId);
|
|
138
132
|
}
|
|
139
133
|
const field = table.getFieldByIdIfExists(id);
|
|
140
134
|
if (!field) {
|
|
141
|
-
throw
|
|
135
|
+
throw spawnError("Can't update field: No field with id %s exists", id);
|
|
142
136
|
}
|
|
143
137
|
|
|
144
138
|
// We skip name validation if it's the same name:
|
|
@@ -149,58 +143,58 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
149
143
|
}
|
|
150
144
|
return;
|
|
151
145
|
}
|
|
152
|
-
case
|
|
146
|
+
case MutationTypes.CREATE_SINGLE_TABLE:
|
|
153
147
|
{
|
|
154
148
|
const {
|
|
155
149
|
name,
|
|
156
150
|
fields
|
|
157
151
|
} = mutation;
|
|
158
152
|
if (!name) {
|
|
159
|
-
throw
|
|
153
|
+
throw spawnError("Can't create table: must provide non-empty name");
|
|
160
154
|
}
|
|
161
|
-
if (name.length >
|
|
162
|
-
throw
|
|
155
|
+
if (name.length > MAX_TABLE_NAME_LENGTH) {
|
|
156
|
+
throw spawnError("Can't create table: name '%s' exceeds maximum length of %s characters", name, MAX_TABLE_NAME_LENGTH);
|
|
163
157
|
}
|
|
164
158
|
const existingLowercaseTableNames = this._base.tables.map(table => table.name.toLowerCase());
|
|
165
159
|
if (existingLowercaseTableNames.includes(name.toLowerCase())) {
|
|
166
|
-
throw
|
|
160
|
+
throw spawnError("Can't create table: table with name '%s' already exists", name);
|
|
167
161
|
}
|
|
168
162
|
if (fields.length === 0) {
|
|
169
|
-
throw
|
|
163
|
+
throw spawnError("Can't create table: must specify at least one field");
|
|
170
164
|
}
|
|
171
|
-
if (fields.length >
|
|
172
|
-
throw
|
|
165
|
+
if (fields.length > MAX_NUM_FIELDS_PER_TABLE) {
|
|
166
|
+
throw spawnError("Can't create table: number of fields exceeds maximum of %s", MAX_NUM_FIELDS_PER_TABLE);
|
|
173
167
|
}
|
|
174
168
|
const lowercaseFieldNames = new Set();
|
|
175
169
|
for (const field of fields) {
|
|
176
170
|
if (!field.name) {
|
|
177
|
-
throw
|
|
171
|
+
throw spawnError("Can't create table: must provide non-empty name for every field");
|
|
178
172
|
}
|
|
179
|
-
if (field.name.length >
|
|
180
|
-
throw
|
|
173
|
+
if (field.name.length > MAX_FIELD_NAME_LENGTH) {
|
|
174
|
+
throw spawnError("Can't create table: field name '%s' exceeds maximum length of %s characters", field.name, MAX_FIELD_NAME_LENGTH);
|
|
181
175
|
}
|
|
182
176
|
const lowercaseFieldName = field.name.toLowerCase();
|
|
183
177
|
if (lowercaseFieldNames.has(lowercaseFieldName)) {
|
|
184
|
-
throw
|
|
178
|
+
throw spawnError("Can't create table: duplicate field name '%s'", field.name);
|
|
185
179
|
}
|
|
186
180
|
lowercaseFieldNames.add(lowercaseFieldName);
|
|
187
181
|
|
|
188
182
|
// Current config / field data is null since the field doesn't exist.
|
|
189
183
|
const validationResult = this._airtableInterface.fieldTypeProvider.validateConfigForUpdate(appInterface, field.config, null, null, billingPlanGrouping);
|
|
190
184
|
if (!validationResult.isValid) {
|
|
191
|
-
throw
|
|
185
|
+
throw spawnError("Can't create table: invalid field config for field '%s'.\n%s", field.name, validationResult.reason);
|
|
192
186
|
}
|
|
193
|
-
if (field.description && field.description.length >
|
|
194
|
-
throw
|
|
187
|
+
if (field.description && field.description.length > MAX_FIELD_DESCRIPTION_LENGTH) {
|
|
188
|
+
throw spawnError("Can't create table: description for field '%s' exceeds maximum length of %s characters", field.name, MAX_FIELD_DESCRIPTION_LENGTH);
|
|
195
189
|
}
|
|
196
190
|
}
|
|
197
191
|
const primaryField = fields[0];
|
|
198
192
|
if (!this._airtableInterface.fieldTypeProvider.canBePrimary(appInterface, primaryField.config, billingPlanGrouping)) {
|
|
199
|
-
throw
|
|
193
|
+
throw spawnError("Can't create table: first field '%s' has type '%s' which cannot be a primary field", primaryField.name, primaryField.config.type);
|
|
200
194
|
}
|
|
201
195
|
return;
|
|
202
196
|
}
|
|
203
|
-
case
|
|
197
|
+
case MutationTypes.UPDATE_VIEW_METADATA:
|
|
204
198
|
{
|
|
205
199
|
const {
|
|
206
200
|
tableId,
|
|
@@ -209,50 +203,50 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
209
203
|
const {
|
|
210
204
|
runContext
|
|
211
205
|
} = this._airtableInterface.sdkInitData;
|
|
212
|
-
if (runContext.type !==
|
|
213
|
-
throw
|
|
206
|
+
if (runContext.type !== BlockRunContextType.VIEW) {
|
|
207
|
+
throw spawnError('Setting view metadata is only valid for views');
|
|
214
208
|
}
|
|
215
209
|
if (runContext.viewId !== viewId || runContext.tableId !== tableId) {
|
|
216
|
-
throw
|
|
210
|
+
throw spawnError('Custom views can only set view metadata on themselves');
|
|
217
211
|
}
|
|
218
212
|
const table = this._base.getTableByIdIfExists(tableId);
|
|
219
213
|
if (!table) {
|
|
220
|
-
throw
|
|
214
|
+
throw spawnError("Can't update metadata: No table with id %s exists", tableId);
|
|
221
215
|
}
|
|
222
216
|
const view = table.getViewByIdIfExists(viewId);
|
|
223
217
|
if (!view) {
|
|
224
|
-
throw
|
|
218
|
+
throw spawnError("Can't update metadata: No view with id %s exists", viewId);
|
|
225
219
|
}
|
|
226
220
|
return;
|
|
227
221
|
}
|
|
228
222
|
default:
|
|
229
|
-
throw
|
|
223
|
+
throw spawnUnknownSwitchCaseError('mutation type', mutation, 'type');
|
|
230
224
|
}
|
|
231
225
|
}
|
|
232
226
|
|
|
233
227
|
/** @internal */
|
|
234
228
|
_assertFieldNameIsValidForMutation(name, table) {
|
|
235
229
|
if (!name) {
|
|
236
|
-
throw
|
|
230
|
+
throw spawnError("Can't create or update field: must provide non-empty name");
|
|
237
231
|
}
|
|
238
|
-
if (name.length >
|
|
239
|
-
throw
|
|
232
|
+
if (name.length > MAX_FIELD_NAME_LENGTH) {
|
|
233
|
+
throw spawnError("Can't create or update field: name '%s' exceeds maximum length of %s characters", name, MAX_FIELD_NAME_LENGTH);
|
|
240
234
|
}
|
|
241
235
|
|
|
242
236
|
// Verify the new name doesn't collide with any existing field name.
|
|
243
237
|
const existingLowercaseFieldNames = table.fields.map(field => field.name.toLowerCase());
|
|
244
238
|
if (existingLowercaseFieldNames.includes(name.toLowerCase())) {
|
|
245
|
-
throw
|
|
239
|
+
throw spawnError("Can't create or update field: field with name '%s' already exists", name);
|
|
246
240
|
}
|
|
247
241
|
}
|
|
248
242
|
|
|
249
243
|
/** @internal */
|
|
250
244
|
_getOptimisticModelChangesForMutation(mutation) {
|
|
251
245
|
switch (mutation.type) {
|
|
252
|
-
case
|
|
253
|
-
case
|
|
246
|
+
case MutationTypes.SET_MULTIPLE_GLOBAL_CONFIG_PATHS:
|
|
247
|
+
case MutationTypes.SET_MULTIPLE_RECORDS_CELL_VALUES:
|
|
254
248
|
return super._getOptimisticModelChangesForMutation(mutation);
|
|
255
|
-
case
|
|
249
|
+
case MutationTypes.CREATE_MULTIPLE_RECORDS:
|
|
256
250
|
{
|
|
257
251
|
const {
|
|
258
252
|
tableId,
|
|
@@ -271,7 +265,7 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
271
265
|
return viewDataStore.__generateChangesForParentTableAddMultipleRecords(records.map(record => record.id));
|
|
272
266
|
})];
|
|
273
267
|
}
|
|
274
|
-
case
|
|
268
|
+
case MutationTypes.DELETE_MULTIPLE_RECORDS:
|
|
275
269
|
{
|
|
276
270
|
const {
|
|
277
271
|
tableId,
|
|
@@ -290,12 +284,12 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
290
284
|
return viewDataStore.__generateChangesForParentTableDeleteMultipleRecords(recordIds);
|
|
291
285
|
})];
|
|
292
286
|
}
|
|
293
|
-
case
|
|
294
|
-
case
|
|
295
|
-
case
|
|
296
|
-
case
|
|
297
|
-
case
|
|
298
|
-
case
|
|
287
|
+
case MutationTypes.CREATE_SINGLE_FIELD:
|
|
288
|
+
case MutationTypes.UPDATE_SINGLE_FIELD_CONFIG:
|
|
289
|
+
case MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION:
|
|
290
|
+
case MutationTypes.UPDATE_SINGLE_FIELD_NAME:
|
|
291
|
+
case MutationTypes.UPDATE_VIEW_METADATA:
|
|
292
|
+
case MutationTypes.CREATE_SINGLE_TABLE:
|
|
299
293
|
{
|
|
300
294
|
// No optimistic updates for field, view metadata, or table mutations.
|
|
301
295
|
return [];
|
|
@@ -305,8 +299,8 @@ class Mutations extends _mutations_core.MutationsCore {
|
|
|
305
299
|
// call site is preceded by an explicit guard for this condition.
|
|
306
300
|
// istanbul ignore next
|
|
307
301
|
default:
|
|
308
|
-
throw
|
|
302
|
+
throw spawnUnknownSwitchCaseError('mutation type', mutation, 'type');
|
|
309
303
|
}
|
|
310
304
|
}
|
|
311
305
|
}
|
|
312
|
-
|
|
306
|
+
export default Mutations;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _error_utils = require("../../shared/error_utils");
|
|
8
1
|
/** @hidden */ /** */
|
|
9
|
-
|
|
2
|
+
import { invariant } from '../../shared/error_utils';
|
|
10
3
|
const WEAK_RETAIN_TIME_MS = 10000;
|
|
11
4
|
class ObjectPool {
|
|
12
5
|
/** @internal */
|
|
@@ -37,9 +30,9 @@ class ObjectPool {
|
|
|
37
30
|
unregisterObjectForReuseStrong(object) {
|
|
38
31
|
const objectKey = object.__poolKey;
|
|
39
32
|
const pooledObjects = this._objectsByKey[objectKey];
|
|
40
|
-
|
|
33
|
+
invariant(pooledObjects, 'pooledObjects');
|
|
41
34
|
const index = pooledObjects.indexOf(object);
|
|
42
|
-
|
|
35
|
+
invariant(index !== -1, 'object not registered');
|
|
43
36
|
pooledObjects.splice(index, 1);
|
|
44
37
|
if (pooledObjects.length === 0) {
|
|
45
38
|
// `delete` causes de-opts, which slows down subsequent reads,
|
|
@@ -142,4 +135,4 @@ class ObjectPool {
|
|
|
142
135
|
return newObject;
|
|
143
136
|
}
|
|
144
137
|
}
|
|
145
|
-
|
|
138
|
+
export default ObjectPool;
|