@mapbox/search-js-web
Advanced tools
Comparing version 1.0.0-beta.15 to 1.0.0-beta.16
@@ -1,2 +0,2 @@ | ||
import { AutofillFeatureSuggestion, AutofillOptions, AutofillRetrieveResponse, AutofillSuggestion, AutofillSuggestionResponse, Evented, MapboxAutofill } from '@mapbox/search-js-core'; | ||
import { AddressAutofillFeatureSuggestion, AddressAutofillOptions, AddressAutofillRetrieveResponse, AddressAutofillSuggestion, AddressAutofillSuggestionResponse, Evented, AddressAutofillCore } from '@mapbox/search-js-core'; | ||
import { MapboxSearchListbox } from './components/MapboxSearchListbox'; | ||
@@ -8,18 +8,18 @@ import { MapboxHTMLEvent } from './MapboxHTMLEvent'; | ||
/** | ||
* @class AutofillInstance | ||
* @class AddressAutofillInstance | ||
*/ | ||
export declare class AutofillInstance { | ||
export declare class AddressAutofillInstance { | ||
#private; | ||
get input(): HTMLInputElement; | ||
options: Partial<AutofillOptions>; | ||
retrieveFeature: AutofillFeatureSuggestion; | ||
listbox: MapboxSearchListbox<AutofillSuggestion | import("@mapbox/search-js-core").Suggestion | import("@mapbox/search-js-core").GeocodeFeature>; | ||
constructor(collection: AutofillCollectionType, input: HTMLInputElement, autofillRef: MapboxAutofill); | ||
options: Partial<AddressAutofillOptions>; | ||
retrieveFeature: AddressAutofillFeatureSuggestion; | ||
listbox: MapboxSearchListbox<import("@mapbox/search-js-core").SearchBoxSuggestion | AddressAutofillSuggestion | import("@mapbox/search-js-core").GeocodingFeature>; | ||
constructor(collection: AddressAutofillCollectionType, input: HTMLInputElement, autofillRef: AddressAutofillCore); | ||
remove(): void; | ||
simulateRetrieve(feature: AutofillFeatureSuggestion): void; | ||
simulateRetrieve(feature: AddressAutofillFeatureSuggestion): void; | ||
} | ||
/** | ||
* @typedef AutofillCollectionOptions | ||
* @typedef AddressAutofillCollectionOptions | ||
*/ | ||
export interface AutofillCollectionOptions { | ||
export interface AddressAutofillCollectionOptions { | ||
/** | ||
@@ -30,5 +30,5 @@ * The [Mapbox access token](https://docs.mapbox.com/help/glossary/access-token/) to use for all requests. | ||
/** | ||
* Options to pass to the underlying {@link MapboxAutofill} interface. | ||
* Options to pass to the underlying {@link AddressAutofillCore} interface. | ||
*/ | ||
options?: Partial<AutofillOptions>; | ||
options?: Partial<AddressAutofillOptions>; | ||
/** | ||
@@ -57,7 +57,7 @@ * The {@link Theme} to use for styling the autofill component. | ||
} | ||
interface EventTypes<AutofillSuggestionResponse, AutofillRetrieveResponse> { | ||
interface EventTypes<AddressAutofillSuggestionResponse, AddressAutofillRetrieveResponse> { | ||
/** | ||
* Fired when the user is typing in the input and provides a list of suggestions. | ||
* | ||
* The underlying response from {@link MapboxAutofill} is passed as the event's detail, | ||
* The underlying response from {@link AddressAutofillCore} is passed as the event's detail, | ||
* while the responsible input is passed as the event's target. | ||
@@ -67,4 +67,4 @@ * | ||
* @instance | ||
* @memberof AutofillCollection | ||
* @type {AutofillSuggestionResponse} | ||
* @memberof AddressAutofillCollection | ||
* @type {AddressAutofillSuggestionResponse} | ||
* @example | ||
@@ -79,5 +79,5 @@ * ```typescript | ||
*/ | ||
suggest: MapboxHTMLEvent<AutofillSuggestionResponse>; | ||
suggest: MapboxHTMLEvent<AddressAutofillSuggestionResponse>; | ||
/** | ||
* Fired when {@link MapboxAutofill} has errored providing a list of suggestions. | ||
* Fired when {@link AddressAutofillCore} has errored providing a list of suggestions. | ||
* | ||
@@ -89,3 +89,3 @@ * The underlying error is passed as the event's detail, | ||
* @instance | ||
* @memberof AutofillCollection | ||
* @memberof AddressAutofillCollection | ||
* @type {Error} | ||
@@ -105,3 +105,3 @@ * @example | ||
* | ||
* The underlying response from {@link MapboxAutofill} is passed as the event's detail, | ||
* The underlying response from {@link AddressAutofillCore} is passed as the event's detail, | ||
* while the responsible input is passed as the event's target. | ||
@@ -111,4 +111,4 @@ * | ||
* @instance | ||
* @memberof AutofillCollection | ||
* @type {AutofillRetrieveResponse} | ||
* @memberof AddressAutofillCollection | ||
* @type {AddressAutofillRetrieveResponse} | ||
* @example | ||
@@ -123,14 +123,14 @@ * ```typescript | ||
*/ | ||
retrieve: MapboxHTMLEvent<AutofillRetrieveResponse>; | ||
retrieve: MapboxHTMLEvent<AddressAutofillRetrieveResponse>; | ||
} | ||
export declare type AutofillCollectionType = AutofillCollection<AutofillSuggestionResponse, AutofillRetrieveResponse>; | ||
export declare type AddressAutofillCollectionType = AddressAutofillCollection<AddressAutofillSuggestionResponse, AddressAutofillRetrieveResponse>; | ||
/** | ||
* Underlying collection object class returned by the {@link autofill} function. | ||
* | ||
* @class AutofillCollection | ||
* @class AddressAutofillCollection | ||
*/ | ||
export declare class AutofillCollection<AutofillSuggestionResponse, AutofillRetrieveResponse> extends Evented<EventTypes<AutofillSuggestionResponse, AutofillRetrieveResponse>> { | ||
export declare class AddressAutofillCollection<AddressAutofillSuggestionResponse, AddressAutofillRetrieveResponse> extends Evented<EventTypes<AddressAutofillSuggestionResponse, AddressAutofillRetrieveResponse>> { | ||
#private; | ||
instances: AutofillInstance[]; | ||
constructor({ accessToken, options, theme, popoverOptions, confirmOnBrowserAutofill, browserAutofillEnabled }: AutofillCollectionOptions); | ||
instances: AddressAutofillInstance[]; | ||
constructor({ accessToken, options, theme, popoverOptions, confirmOnBrowserAutofill, browserAutofillEnabled }: AddressAutofillCollectionOptions); | ||
/** | ||
@@ -147,3 +147,3 @@ * The [Mapbox access token](https://docs.mapbox.com/help/glossary/access-token/) to use for all requests. | ||
/** | ||
* Options to pass to the underlying {@link MapboxAutofill} interface. | ||
* Options to pass to the underlying {@link AddressAutofillCore} interface. | ||
* | ||
@@ -158,4 +158,4 @@ * @example | ||
*/ | ||
get options(): Partial<AutofillOptions>; | ||
set options(newOptions: Partial<AutofillOptions>); | ||
get options(): Partial<AddressAutofillOptions>; | ||
set options(newOptions: Partial<AddressAutofillOptions>); | ||
/** | ||
@@ -198,3 +198,3 @@ * The {@link Theme} to use for styling the autofill component. | ||
* @instance | ||
* @memberof AutofillCollection | ||
* @memberof AddressAutofillCollection | ||
* @type {boolean | AddressConfirmOptions} | ||
@@ -220,3 +220,3 @@ * @example | ||
* @instance | ||
* @memberof AutofillCollection | ||
* @memberof AddressAutofillCollection | ||
* @type {boolean} | ||
@@ -242,3 +242,3 @@ * @example | ||
* **IMPORTANT:** For performance reasons, it is recommended to carefully control | ||
* when this is called and to call {@link AutofillCollection#unobserve} when finished. | ||
* when this is called and to call {@link AddressAutofillCollection#unobserve} when finished. | ||
* | ||
@@ -253,3 +253,3 @@ * @example | ||
* Stop listening for changes to the DOM. This only has an effect if called | ||
* after {@link AutofillCollection#observe}. | ||
* after {@link AddressAutofillCollection#observe}. | ||
* | ||
@@ -287,3 +287,3 @@ * @example | ||
* | ||
* @param optionsArg - {@link AutofillCollectionOptions} Object defining options for Autofill search behavior and UI. | ||
* @param optionsArg - {@link AddressAutofillCollectionOptions} Object defining options for Address Autofill search behavior and UI. | ||
* @example | ||
@@ -307,3 +307,3 @@ * <input type="text" autocomplete="street-address" /> | ||
*/ | ||
export declare function autofill(optionsArg: AutofillCollectionOptions): AutofillCollectionType; | ||
export declare function autofill(optionsArg: AddressAutofillCollectionOptions): AddressAutofillCollectionType; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { AutofillFeatureSuggestion, AutofillOptions, AutofillRetrieveResponse, AutofillSuggestion, AutofillSuggestionResponse } from '@mapbox/search-js-core'; | ||
import { AddressAutofillFeatureSuggestion, AddressAutofillOptions, AddressAutofillRetrieveResponse, AddressAutofillSuggestion, AddressAutofillSuggestionResponse } from '@mapbox/search-js-core'; | ||
import { MapboxSearchListbox } from './MapboxSearchListbox'; | ||
@@ -8,8 +8,8 @@ import { HTMLScopedElement } from './HTMLScopedElement'; | ||
import { PopoverOptions } from '../utils/popover'; | ||
export declare type MapboxSearchListboxAutofillType = MapboxSearchListbox<AutofillSuggestion>; | ||
declare type AutofillEventTypes = { | ||
export declare type MapboxSearchListboxAutofillType = MapboxSearchListbox<AddressAutofillSuggestion>; | ||
declare type AddressAutofillEventTypes = { | ||
/** | ||
* Fired when the user is typing in the input and provides a list of suggestions. | ||
* | ||
* The underlying response from {@link MapboxAutofill} is passed as the event's detail. | ||
* The underlying response from {@link AddressAutofillCore} is passed as the event's detail. | ||
* | ||
@@ -19,3 +19,3 @@ * @event suggest | ||
* @memberof MapboxAddressAutofill | ||
* @type {AutofillSuggestionResponse} | ||
* @type {AddressAutofillSuggestionResponse} | ||
* @example | ||
@@ -29,5 +29,5 @@ * ```typescript | ||
*/ | ||
suggest: MapboxHTMLEvent<AutofillSuggestionResponse>; | ||
suggest: MapboxHTMLEvent<AddressAutofillSuggestionResponse>; | ||
/** | ||
* Fired when {@link MapboxAutofill} has errored providing a list of suggestions. | ||
* Fired when {@link AddressAutofillCore} has errored providing a list of suggestions. | ||
* | ||
@@ -52,3 +52,3 @@ * The underlying error is passed as the event's detail. | ||
* | ||
* The underlying response from {@link MapboxAutofill} is passed as the event's detail. | ||
* The underlying response from {@link AddressAutofillCore} is passed as the event's detail. | ||
* | ||
@@ -58,3 +58,3 @@ * @event retrieve | ||
* @memberof MapboxAddressAutofill | ||
* @type {AutofillRetrieveResponse} | ||
* @type {AddressAutofillRetrieveResponse} | ||
* @example | ||
@@ -68,3 +68,3 @@ * ```typescript | ||
*/ | ||
retrieve: MapboxHTMLEvent<AutofillRetrieveResponse>; | ||
retrieve: MapboxHTMLEvent<AddressAutofillRetrieveResponse>; | ||
/** | ||
@@ -111,3 +111,3 @@ * Fired when the user has changed the `<input>` text. | ||
*/ | ||
export declare class MapboxAddressAutofill extends HTMLScopedElement<AutofillEventTypes> { | ||
export declare class MapboxAddressAutofill extends HTMLScopedElement<AddressAutofillEventTypes> { | ||
#private; | ||
@@ -146,3 +146,3 @@ /** | ||
/** | ||
* Options to pass to the underlying {@link MapboxAutofill} interface. | ||
* Options to pass to the underlying {@link AddressAutofillCore} interface. | ||
* | ||
@@ -152,3 +152,3 @@ * @name options | ||
* @memberof MapboxAddressAutofill | ||
* @type {AutofillOptions} | ||
* @type {AddressAutofillOptions} | ||
* @example | ||
@@ -162,3 +162,3 @@ * ```typescript | ||
*/ | ||
options: Partial<AutofillOptions>; | ||
options: Partial<AddressAutofillOptions>; | ||
/** | ||
@@ -239,3 +239,3 @@ * The {@link Theme} to use for styling the autofill component. | ||
set browserAutofillEnabled(enable: boolean); | ||
retrieveFeature: AutofillFeatureSuggestion; | ||
retrieveFeature: AddressAutofillFeatureSuggestion; | ||
/** | ||
@@ -269,3 +269,3 @@ * A callback providing the opportunity to validate and/or manipulate the input text before it triggers a search, for example by using a regular expression. | ||
*/ | ||
simulateRetrieve(feature: AutofillFeatureSuggestion): void; | ||
simulateRetrieve(feature: AddressAutofillFeatureSuggestion): void; | ||
} | ||
@@ -272,0 +272,0 @@ declare global { |
@@ -1,2 +0,2 @@ | ||
import { ValidateOptions, AutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
import { ValidationOptions, AddressAutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
import { HTMLScopedElement } from './HTMLScopedElement'; | ||
@@ -31,3 +31,3 @@ import { AutofillValueMap } from '../utils/autofill'; | ||
/** | ||
* Mapbox access token used for the Autofill and Static Image APIs | ||
* Mapbox access token used for the Address Autofill and Static Image APIs | ||
*/ | ||
@@ -40,6 +40,6 @@ accessToken?: string; | ||
/** | ||
* Autofill API configuration options | ||
* {@link ValidateOptions} | ||
* Address Autofill API configuration options | ||
* {@link ValidationOptions} | ||
*/ | ||
options?: Partial<ValidateOptions>; | ||
options?: Partial<ValidationOptions>; | ||
/** | ||
@@ -66,3 +66,3 @@ * If true, a static minimap showing the suggested address location will be displayed in the modal dialog. | ||
*/ | ||
skipConfirmModal?: (feature: AutofillFeatureSuggestion) => boolean; | ||
skipConfirmModal?: (feature: AddressAutofillFeatureSuggestion) => boolean; | ||
/** | ||
@@ -82,3 +82,3 @@ * Custom footer text appearing at the bottom of the confirmation modal dialog. | ||
* enters an address that doesn't match any of the results | ||
* returned by the Mapbox Autofill API. | ||
* returned by the Mapbox Address Autofill API. | ||
* | ||
@@ -98,5 +98,5 @@ * This element is used by {@link MapboxAddressAutofill} and the {@link autofill} | ||
hide(): void; | ||
show(autofillValues: AutofillValueMap, optionsArg: AddressConfirmOptions, feature?: AutofillFeatureSuggestion): Promise<AddressConfirmShowResult>; | ||
show(autofillValues: AutofillValueMap, optionsArg: AddressConfirmOptions, feature?: AddressAutofillFeatureSuggestion): Promise<AddressConfirmShowResult>; | ||
/** | ||
* Attempts to show an address confirmation dialog by comparing form input values with the closest match via the Autofill API. | ||
* Attempts to show an address confirmation dialog by comparing form input values with the closest match via the Address Autofill API. | ||
* @param autofillValues - Map of form `<input>` values for each address component | ||
@@ -103,0 +103,0 @@ * @param optionsArg - Options object defining API options, UI controls, and callback defining when to bypass the dialog |
@@ -1,2 +0,2 @@ | ||
import { AutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
import { AddressAutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
import { HTMLScopedElement } from './HTMLScopedElement'; | ||
@@ -28,3 +28,3 @@ import { AddressConfirmationEventTypes, ConfirmationMinimapOptions } from './MapboxAddressConfirmation'; | ||
*/ | ||
update: (feature: AutofillFeatureSuggestion, autofillValues: AutofillValueMap) => void; | ||
update: (feature: AddressAutofillFeatureSuggestion, autofillValues: AutofillValueMap) => void; | ||
approve: () => void; | ||
@@ -31,0 +31,0 @@ reject: () => void; |
@@ -8,3 +8,3 @@ import { HTMLScopedElement } from './HTMLScopedElement'; | ||
* will display a notification when an address entered into an HTML form | ||
* does not return any features when queried against the Autofill API. | ||
* does not return any features when queried against the Address Autofill API. | ||
* | ||
@@ -11,0 +11,0 @@ * This element is hosted by {@link MapboxAddressConfirmation} and should not be exposed to the user. |
@@ -1,2 +0,2 @@ | ||
import { Options, RetrieveResponse, Suggestion, SuggestionResponse } from '@mapbox/search-js-core'; | ||
import { SearchBoxOptions, SearchBoxRetrieveResponse, SearchBoxSuggestion, SearchBoxSuggestionResponse } from '@mapbox/search-js-core'; | ||
import mapboxgl from 'mapbox-gl'; | ||
@@ -8,3 +8,3 @@ import { MapboxSearchListbox } from './MapboxSearchListbox'; | ||
import { PopoverOptions } from '../utils/popover'; | ||
export declare type MapboxSearchListboxSearchType = MapboxSearchListbox<Suggestion>; | ||
export declare type MapboxSearchListboxSearchType = MapboxSearchListbox<SearchBoxSuggestion>; | ||
declare type SearchEventTypes = { | ||
@@ -14,3 +14,3 @@ /** | ||
* | ||
* The underlying response from {@link MapboxSearch} is passed as the event's detail. | ||
* The underlying response from {@link SearchBoxCore} is passed as the event's detail. | ||
* | ||
@@ -20,3 +20,3 @@ * @event suggest | ||
* @memberof MapboxSearchBox | ||
* @type {SuggestionResponse} | ||
* @type {SearchBoxSuggestionResponse} | ||
* @example | ||
@@ -30,5 +30,5 @@ * ```typescript | ||
*/ | ||
suggest: MapboxHTMLEvent<SuggestionResponse>; | ||
suggest: MapboxHTMLEvent<SearchBoxSuggestionResponse>; | ||
/** | ||
* Fired when {@link MapboxSearch} has errored providing a list of suggestions. | ||
* Fired when {@link SearchBoxCore} has errored providing a list of suggestions. | ||
* | ||
@@ -53,3 +53,3 @@ * The underlying error is passed as the event's detail. | ||
* | ||
* The underlying response from {@link MapboxSearch} is passed as the event's detail. | ||
* The underlying response from {@link SearchBoxCore} is passed as the event's detail. | ||
* | ||
@@ -59,3 +59,3 @@ * @event retrieve | ||
* @memberof MapboxSearchBox | ||
* @type {RetrieveResponse} | ||
* @type {SearchBoxRetrieveResponse} | ||
* @example | ||
@@ -69,3 +69,3 @@ * ```typescript | ||
*/ | ||
retrieve: MapboxHTMLEvent<RetrieveResponse>; | ||
retrieve: MapboxHTMLEvent<SearchBoxRetrieveResponse>; | ||
/** | ||
@@ -94,3 +94,3 @@ * Fired when the user has changed the `<input>` text. | ||
* is an element that lets you search for places, addresses, and landmarks using | ||
* the [Mapbox Search API](https://docs.mapbox.com/api/search/search). | ||
* the [Mapbox Search Box API](https://docs.mapbox.com/api/search/search-box/). | ||
* | ||
@@ -161,3 +161,3 @@ * It can control a [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js/guides/) map | ||
* @instance | ||
* @memberof MapboxAddressAutofill | ||
* @memberof MapboxSearchBox | ||
* @type {HTMLInputElement} | ||
@@ -170,3 +170,3 @@ */ | ||
/** | ||
* Options to pass to the underlying {@link MapboxSearch} interface. | ||
* Options to pass to the underlying {@link SearchBoxCore} interface. | ||
* | ||
@@ -176,3 +176,3 @@ * @name options | ||
* @memberof MapboxSearchBox | ||
* @type {Options} | ||
* @type {SearchBoxOptions} | ||
* @example | ||
@@ -186,3 +186,3 @@ * ```typescript | ||
*/ | ||
options: Partial<Options>; | ||
options: Partial<SearchBoxOptions>; | ||
/** | ||
@@ -189,0 +189,0 @@ * The {@link Theme} to use for styling the suggestion box and search box. |
@@ -1,2 +0,2 @@ | ||
import { Suggestion as SearchSuggestion, AutofillSuggestion, GeocodeFeature } from '@mapbox/search-js-core'; | ||
import { SearchBoxSuggestion, AddressAutofillSuggestion, GeocodingFeature } from '@mapbox/search-js-core'; | ||
import { HTMLScopedElement } from './HTMLScopedElement'; | ||
@@ -7,3 +7,4 @@ import { Theme } from '../theme'; | ||
import { MapboxAddressAutofill } from './MapboxAddressAutofill'; | ||
import { AutofillInstance } from '../autofill'; | ||
import { AddressAutofillInstance } from '../autofill'; | ||
import { SEARCH_SERVICE } from '../utils/services'; | ||
declare type ListboxEventTypes<Suggestion> = { | ||
@@ -28,3 +29,3 @@ /** | ||
}; | ||
export declare class MapboxSearchListbox<Suggestion extends SearchSuggestion | AutofillSuggestion | GeocodeFeature> extends HTMLScopedElement<ListboxEventTypes<Suggestion>> { | ||
export declare class MapboxSearchListbox<Suggestion extends SearchBoxSuggestion | AddressAutofillSuggestion | GeocodingFeature> extends HTMLScopedElement<ListboxEventTypes<Suggestion>> { | ||
#private; | ||
@@ -39,8 +40,10 @@ protected get template(): HTMLTemplateElement; | ||
/** | ||
* The Autofill instance driving the listbox. | ||
* The Address Autofill instance driving the listbox. | ||
* Can be either the custom element or function. | ||
*/ | ||
autofillHost?: MapboxAddressAutofill | AutofillInstance; | ||
autofillHost?: MapboxAddressAutofill | AddressAutofillInstance; | ||
get input(): HTMLInputElement | null; | ||
set input(newInput: HTMLInputElement | null); | ||
get searchService(): SEARCH_SERVICE | null; | ||
set searchService(service: SEARCH_SERVICE); | ||
get selectedIndex(): number | undefined; | ||
@@ -47,0 +50,0 @@ set selectedIndex(newIndex: number); |
@@ -8,3 +8,3 @@ import { SessionToken } from '@mapbox/search-js-core'; | ||
/** | ||
* If true, Autofill address or marker location corrections will be submitted to the Mapbox Contribute API to help improve our data accuracy. Defaults to true. | ||
* If true, Address Autofill address or marker location corrections will be submitted to the Mapbox Contribute API to help improve our data accuracy. Defaults to true. | ||
*/ | ||
@@ -20,3 +20,3 @@ feedbackEnabled: boolean; | ||
* @property {string} accessToken - A [Mapbox access token](https://docs.mapbox.com/help/glossary/access-token/) used if one is not passed in explicitly to web components. | ||
* @property {boolean} feedbackEnabled - If true, Autofill address or marker location corrections will be submitted to the Mapbox Contribute API to help improve our data accuracy. Defaults to true. | ||
* @property {boolean} feedbackEnabled - If true, Address Autofill address or marker location corrections will be submitted to the Mapbox Contribute API to help improve our data accuracy. Defaults to true. | ||
* @example | ||
@@ -23,0 +23,0 @@ * ```typescript |
@@ -6,3 +6,3 @@ import { AddressConfirmOptions } from './components/MapboxAddressConfirmation'; | ||
* | ||
* This parses and compares an address entered into form fields with the closest address suggestion from the Mapbox Autofill API. | ||
* This parses and compares an address entered into form fields with the closest address suggestion from the Mapbox Address Autofill API. | ||
* Unless an exact match or a custom comparison callback evaluates to true, the user will be shown a modal dialog | ||
@@ -13,3 +13,3 @@ * asking if they would like to use the suggested address. | ||
* @param form - HTML form that includes the autocomplete-compliant input fields | ||
* @param optionsArg - {@link AddressConfirmOptions} Object defining options for Autofill API, UI, form parsing, and address comparison | ||
* @param optionsArg - {@link AddressConfirmOptions} Object defining options for Address Autofill API, UI, form parsing, and address comparison | ||
* @returns A promise resolving with a result object indicating the decision made by the user | ||
@@ -16,0 +16,0 @@ * @example |
@@ -12,3 +12,3 @@ /// <reference path="../src/types/custom_elements.d.ts" /> | ||
export { Theme } from './theme'; | ||
export { autofill, AutofillCollectionOptions } from './autofill'; | ||
export { autofill, AddressAutofillCollectionOptions, AddressAutofillCollectionOptions as AutofillCollectionOptions } from './autofill'; | ||
export { confirmAddress } from './confirmAddress'; | ||
@@ -15,0 +15,0 @@ export { MapStyleMode, Anchor } from './utils/minimap'; |
/** | ||
* `MapboxHTMLEvent` is an event dispatched by the Search Box and Autofill | ||
* `MapboxHTMLEvent` is an event dispatched by the Search Box and Address Autofill | ||
* components. | ||
@@ -4,0 +4,0 @@ * |
@@ -1,2 +0,2 @@ | ||
import { AutofillSuggestion, GeocodeFeature, Suggestion as SearchSuggestion } from '@mapbox/search-js-core'; | ||
import { AddressAutofillSuggestion, GeocodingFeature, SearchBoxSuggestion } from '@mapbox/search-js-core'; | ||
/** | ||
@@ -25,2 +25,2 @@ * This is to make sure our custom "buttons" have appropriate | ||
*/ | ||
export declare const getAriaMessage: (searchValue: string, suggestions: (SearchSuggestion | AutofillSuggestion | GeocodeFeature)[], selectedIndex: number | undefined) => string; | ||
export declare const getAriaMessage: (searchValue: string, suggestions: (SearchBoxSuggestion | AddressAutofillSuggestion | GeocodingFeature)[], selectedIndex: number | undefined) => string; |
@@ -1,2 +0,2 @@ | ||
import { AutofillFeatureSuggestion, AutofillSuggestion, GeocodeFeature, Suggestion as SearchSuggestion } from '@mapbox/search-js-core'; | ||
import { AddressAutofillFeatureSuggestion, AddressAutofillSuggestion } from '@mapbox/search-js-core'; | ||
import { InputFormElement } from './dom'; | ||
@@ -83,9 +83,9 @@ /** | ||
* | ||
* This does a mapping from {@link AdministrativeUnitTypes} to corresponding WHATWG autocomplete types. | ||
* This does a mapping from {@link SearchBoxAdministrativeUnitTypes} to corresponding WHATWG autocomplete types. | ||
* | ||
* Reference: | ||
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values | ||
* https://docs.mapbox.com/api/search/search/#administrative-unit-types | ||
* https://docs.mapbox.com/api/search/search-box/#administrative-unit-types | ||
*/ | ||
export declare function setFormAutofillValues(form: HTMLFormElement, ref: HTMLInputElement, suggestion: AutofillSuggestion): void; | ||
export declare function setFormAutofillValues(form: HTMLFormElement, ref: HTMLInputElement, suggestion: AddressAutofillSuggestion): void; | ||
/** | ||
@@ -134,10 +134,10 @@ * Gets the current input values for address fields given a form and a reference input. | ||
export declare function getAutofillSearchText(snapshot: AutofillValueMap): string; | ||
export declare function fillFormWithFeature(feature: AutofillFeatureSuggestion, input: HTMLInputElement): void; | ||
export declare function fillFormWithFeature(feature: AddressAutofillFeatureSuggestion, input: HTMLInputElement): void; | ||
/** | ||
* Gets address property values from an Autofill feature. | ||
* | ||
* @param feature - A {@link AutofillFeatureSuggestion} object. | ||
* @param feature - A {@link AddressAutofillFeatureSuggestion} object. | ||
* @returns A object mapping WHATWG autocomplete properties to their respective feature values | ||
*/ | ||
export declare function featureToAutofillValueMap(feature: AutofillFeatureSuggestion): AutofillValueMap; | ||
export declare function featureToAutofillValueMap(feature: AddressAutofillFeatureSuggestion): AutofillValueMap; | ||
/** | ||
@@ -155,16 +155,7 @@ * Checks if WHATWG address values from one object match those from another. | ||
/** | ||
* Returns the string from suggestions that meant to be used as first stroke | ||
* title in search results list for that particular suggestion. | ||
*/ | ||
export declare const getSuggestionTitle: (item: SearchSuggestion | AutofillSuggestion | GeocodeFeature) => string; | ||
/** | ||
* Takes the suggestions array and filters streets inside it to leave only unique ones | ||
*/ | ||
export declare const distinctExactStreetResults: (suggestions: (SearchSuggestion | AutofillSuggestion | GeocodeFeature)[]) => (SearchSuggestion | AutofillSuggestion | GeocodeFeature)[]; | ||
/** | ||
* Returns parsed/formatted description text to show in the second line of an autofill suggestion element | ||
*/ | ||
export declare const buildSuggestionDescription: (item: SearchSuggestion | AutofillSuggestion | GeocodeFeature) => string; | ||
export declare const distinctExactStreetResults: (suggestions: AddressAutofillSuggestion[]) => AddressAutofillSuggestion[]; | ||
export declare const toggleAutocompletion: (input: HTMLInputElement, initialAutocompleteValue: string, enableBrowserAutocomplete: boolean) => void; | ||
export declare const handleStreetSelection: (input: HTMLInputElement, initialAutocompleteValue: string, suggestion: AutofillSuggestion) => void; | ||
export declare const handleStreetSelection: (input: HTMLInputElement, initialAutocompleteValue: string, suggestion: AddressAutofillSuggestion) => void; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { AutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
import { AddressAutofillFeatureSuggestion } from '@mapbox/search-js-core'; | ||
import { AddressConfirmOptions } from '../components/MapboxAddressConfirmation'; | ||
@@ -9,3 +9,3 @@ import { AutofillValueMap } from './autofill'; | ||
type: 'change'; | ||
feature: AutofillFeatureSuggestion; | ||
feature: AddressAutofillFeatureSuggestion; | ||
} | { | ||
@@ -12,0 +12,0 @@ type: 'nochange'; |
@@ -20,9 +20,9 @@ /** | ||
/** | ||
* Sends feedback to the Mapbox Contribute API given an original Autofill API feature and a set of user-defined changes to the address or location. | ||
* Sends feedback to the Mapbox Contribute API given an original Address Autofill API feature and a set of user-defined changes to the address or location. | ||
* @param accessToken - Mapbox access token | ||
* @param {FeedbackArgs} feedbackArgs - Data detailing the original address and location and any changes requested | ||
* @param {[number, number]} feedbackArgs.originalCoordinate - Original coordinate from the Autofill API | ||
* @param {string} feedbackArgs.originalAddress - Original full_address or place_name from the Autofill API | ||
* @param {[number, number]} feedbackArgs.originalCoordinate - Original coordinate from the Address Autofill API | ||
* @param {string} feedbackArgs.originalAddress - Original full_address or place_name from the Address Autofill API | ||
* @param {ContributeChanges} feedbackArgs.changes - Address fields or location changed by a user | ||
*/ | ||
export declare function sendFeedback(accessToken: string, feedbackArgs: FeedbackArgs): void; |
@@ -16,3 +16,3 @@ import mapboxgl from 'mapbox-gl'; | ||
/** | ||
* Gets the maximum zoom level for a [Mapbox Search API](https://docs.mapbox.com/api/search/search/) | ||
* Gets the maximum zoom level for a [Mapbox Search Box API](https://docs.mapbox.com/api/search/search-box/) | ||
* or [Mapbox Geocoding API](https://docs.mapbox.com/api/search/geocoding/) place type. | ||
@@ -19,0 +19,0 @@ * |
{ | ||
"name": "@mapbox/search-js-web", | ||
"version": "1.0.0-beta.15", | ||
"version": "1.0.0-beta.16", | ||
"description": "Search web component with form autocomplete.", | ||
@@ -23,3 +23,3 @@ "main": "dist/index.js", | ||
"@floating-ui/dom": "^0.5.2", | ||
"@mapbox/search-js-core": "^1.0.0-beta.15", | ||
"@mapbox/search-js-core": "^1.0.0-beta.16", | ||
"@mapbox/sphericalmercator": "^1.2.0", | ||
@@ -26,0 +26,0 @@ "focus-trap": "^6.7.3", |
@@ -11,3 +11,3 @@ import mapboxgl from 'mapbox-gl'; | ||
} from '../src'; | ||
import { AutofillRetrieveResponse } from '@mapbox/search-js-core'; | ||
import { AddressAutofillRetrieveResponse } from '@mapbox/search-js-core'; | ||
import CUSTOM_MARKER from './assets/marker-custom.svg'; | ||
@@ -134,3 +134,3 @@ | ||
'retrieve', | ||
(e: MapboxHTMLEvent<AutofillRetrieveResponse>) => { | ||
(e: MapboxHTMLEvent<AddressAutofillRetrieveResponse>) => { | ||
minimap.feature = e.detail.features[0]; | ||
@@ -137,0 +137,0 @@ document.getElementById('minimap-container').style.display = 'block'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3170825
75
13308