Skip to content

Commit

Permalink
Merge branch 'main' into build-with-xcode15_3
Browse files Browse the repository at this point in the history
  • Loading branch information
aokj4ck authored Apr 19, 2024
2 parents 4c069e2 + 038508e commit cf27c54
Show file tree
Hide file tree
Showing 37 changed files with 98 additions and 49 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ workflows:
develop-build:
jobs:
- pre-check:
context: SDK Registry Token
filters:
tags:
only: /v.*/
- build:
context: SDK Registry Token
requires:
- pre-check
filters:
tags:
only: /v.*/
- spm-build:
context: SDK Registry Token
requires:
- pre-check
- release-pre-check:
context: SDK Registry Token
requires:
- pre-check
filters:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Guide: https://keepachangelog.com/en/1.0.0/

<!-- Add changes for active work here -->

- [SearchResult] Add support for `mapboxId` field when availalbe.
- [FavoriteRecord] Add support for `mapboxId` field when availalbe.
- [HistoryRecord] Add support for `mapboxId` field when availalbe.
- [Discover] Add more complete support for `mapboxId` field in Result subtype when availalbe.
- [Address Autofill] Add more complete support for `mapboxId` field in Result and Suggestion subtypes when availalbe.
- [Place Autocomplete] Add more complete support for `mapboxId` field in Result and Suggestion subtypes when availalbe.
- [Demo] Add `mapboxId` table view cell to PlaceAutocomplete detail view controller when available.

- [Offline] Remove `CoreOfflineIndexChangeEventType` extension previously used for development.
- [Core] Remove usages of `@_implementationOnly import` due to compilation issue.

- [Offline] Add optional `language` parameter to SearchOfflineManager.createTilesetDescriptor and SearchOfflineManager.createPlacesTilesetDescriptor functions.
- [Tests] Add Spanish language offline search test.

Expand Down
12 changes: 0 additions & 12 deletions MapboxSearch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
0477904E2B890F4E00A99528 /* search-box-retrieve-minsk.json in Resources */ = {isa = PBXBuildFile; fileRef = 0477904C2B890F4E00A99528 /* search-box-retrieve-minsk.json */; };
0477904F2B890F4E00A99528 /* search-box-retrieve-minsk.json in Resources */ = {isa = PBXBuildFile; fileRef = 0477904C2B890F4E00A99528 /* search-box-retrieve-minsk.json */; };
0484BCDF2BC4865C003CF408 /* OfflineIndexObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0484BCDE2BC4865C003CF408 /* OfflineIndexObserver.swift */; };
0484BCE22BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0484BCE12BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift */; };
048823482B6B0A9D00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
048823492B6B0A9D00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
0488234A2B6B0A9E00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
Expand Down Expand Up @@ -543,7 +542,6 @@
047790482B890A8500A99528 /* search-box-recursion.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "search-box-recursion.json"; sourceTree = "<group>"; };
0477904C2B890F4E00A99528 /* search-box-retrieve-minsk.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "search-box-retrieve-minsk.json"; sourceTree = "<group>"; };
0484BCDE2BC4865C003CF408 /* OfflineIndexObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OfflineIndexObserver.swift; sourceTree = "<group>"; };
0484BCE12BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreOfflineIndexChangeEventType.swift; sourceTree = "<group>"; };
04970F8C2B7A97C900213763 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
04AB0B4A2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = mapbox.places.san.francisco.json; sourceTree = "<group>"; };
04AB0B792B6AF37800FDE7D5 /* DiscoverIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoverIntegrationTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1056,14 +1054,6 @@
path = sbs;
sourceTree = "<group>";
};
0484BCE02BC49A18003CF408 /* Offline */ = {
isa = PBXGroup;
children = (
0484BCE12BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift */,
);
path = Offline;
sourceTree = "<group>";
};
04970F8B2B7A97C900213763 /* Resources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1744,7 +1734,6 @@
FEEDD2C12508DFE400DC0A98 /* InternalAPI */ = {
isa = PBXGroup;
children = (
0484BCE02BC49A18003CF408 /* Offline */,
04C127562B62FFD000884325 /* Engine */,
148DE66E285777050085684D /* Common */,
F98BECBB2577B9150081D3BC /* Telemetry */,
Expand Down Expand Up @@ -2677,7 +2666,6 @@
F9E8146225418E7D00F6378E /* EventsManager.swift in Sources */,
FEEDD3002508DFE400DC0A98 /* CLLocationCoordinate2DCodable.swift in Sources */,
FEEDD3042508DFE400DC0A98 /* SearchResultType.swift in Sources */,
0484BCE22BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift in Sources */,
F91FD66C258CCB41008CB8E1 /* CoreResultType+Extensions.swift in Sources */,
FEEDD3152508DFE400DC0A98 /* ServerSearchResult.swift in Sources */,
140E47A2298BC90E00677E30 /* Discover.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions Sources/Demo/PlaceAutocompleteDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ extension PlaceAutocomplete.Result {
)
}

if let mapboxId {
components.append(
(name: "Mapbox ID", value: mapboxId)
)
}

return components
}
}
10 changes: 4 additions & 6 deletions Sources/MapboxSearch/InternalAPI/CoreAliases.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@_implementationOnly import MapboxCommon_Private
import MapboxCommon_Private
import MapboxCoreSearch
import MapboxCoreSearch_Private

/// https://forums.swift.org/t/update-on-implementation-only-imports/26996
@_implementationOnly import MapboxCoreSearch
@_implementationOnly import MapboxCoreSearch_Private

// Note: This file included in MapboxSearch and MapboxSearchTests targets
// Note: This file is included in MapboxSearch and MapboxSearchTests targets

typealias CoreSearchEngine = MapboxCoreSearch.SearchEngine
typealias CoreSearchResponse = MapboxCoreSearch_Private.SearchResponse
Expand Down

This file was deleted.

6 changes: 6 additions & 0 deletions Sources/MapboxSearch/PublicAPI/FavoriteRecord.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ public struct FavoriteRecord: IndexableRecord, SearchResult, Codable, Equatable
/// Displayable name of the record.
public var name: String

/// A unique identifier for the geographic feature
public var mapboxId: String?

/**
The feature name, as matched by the search algorithm.

Expand Down Expand Up @@ -79,6 +82,7 @@ public struct FavoriteRecord: IndexableRecord, SearchResult, Codable, Equatable
/// - resultType: Favorite result type
public init(
id: String? = nil,
mapboxId: String? = nil,
name: String,
matchingName: String?,
coordinate: CLLocationCoordinate2D,
Expand All @@ -93,6 +97,7 @@ public struct FavoriteRecord: IndexableRecord, SearchResult, Codable, Equatable
metadata: SearchResultMetadata? = nil
) {
self.id = id ?? UUID().uuidString
self.mapboxId = mapboxId
self.name = name
self.matchingName = matchingName
self.coordinateCodable = .init(coordinate)
Expand All @@ -118,6 +123,7 @@ public struct FavoriteRecord: IndexableRecord, SearchResult, Codable, Equatable
) {
self.init(
id: id,
mapboxId: searchResult.mapboxId,
name: name,
matchingName: searchResult.matchingName,
coordinate: searchResult.coordinate,
Expand Down
5 changes: 5 additions & 0 deletions Sources/MapboxSearch/PublicAPI/HistoryRecord.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public struct HistoryRecord: IndexableRecord, SearchResult, Codable, Hashable {
/// Unique identifier
public private(set) var id: String

public private(set) var mapboxId: String?

/// Record's name
public private(set) var name: String

Expand Down Expand Up @@ -97,6 +99,7 @@ public struct HistoryRecord: IndexableRecord, SearchResult, Codable, Hashable {
/// - routablePoints: Coordinates of building entries
public init(
id: String = UUID().uuidString,
mapboxId: String?,
name: String,
matchingName: String?,
serverIndex: Int?,
Expand All @@ -112,6 +115,7 @@ public struct HistoryRecord: IndexableRecord, SearchResult, Codable, Hashable {
routablePoints: [RoutablePoint]? = nil
) {
self.id = id
self.mapboxId = mapboxId
self.name = name
self.matchingName = matchingName
self.serverIndex = serverIndex
Expand All @@ -138,6 +142,7 @@ public struct HistoryRecord: IndexableRecord, SearchResult, Codable, Hashable {
timestamp: Date = Date()
) {
self.id = searchResult.id
self.mapboxId = searchResult.mapboxId
self.name = searchResult.name
self.matchingName = searchResult.matchingName
self.serverIndex = searchResult.serverIndex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import CoreLocation
import Foundation

class ExternalRecordPlaceholder: SearchResultSuggestion, CoreResponseProvider {
var mapboxId: String?

var originalResponse: CoreSearchResultResponse

var dataLayerIdentifier: String

var id: String

var mapboxId: String?

var name: String

var address: Address?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import CoreLocation
import Foundation

class SearchCategorySuggestionImpl: SearchCategorySuggestion, CoreResponseProvider {
var mapboxId: String?

var originalResponse: CoreSearchResultResponse

var id: String

var mapboxId: String?

var name: String

var address: Address?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public protocol SearchResult {
/// Result name.
var name: String { get }

/// A unique identifier for the geographic feature
var mapboxId: String? { get }

/// Icon name according to [Mapbox Maki icon set](https://github.com/mapbox/maki/)
var iconName: String? { get }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import CoreLocation
import Foundation

class SearchResultSuggestionImpl: SearchResultSuggestion, CoreResponseProvider {
var mapboxId: String?

var originalResponse: CoreSearchResultResponse

let dataLayerIdentifier = SearchEngine.providerIdentifier

var id: String

var mapboxId: String?

var name: String

var address: Address?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public protocol SearchSuggestion {
/// - Attention: Mapbox backend may change the identifier of the object in the future.
var id: String { get }

/// A unique identifier for the geographic feature
var mapboxId: String? { get }

/// Suggestion name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import CoreLocation
import Foundation

class ServerSearchResult: SearchResult, SearchResultSuggestion, CoreResponseProvider {
var mapboxId: String?

var distance: CLLocationDistance?

var originalResponse: CoreSearchResultResponse
Expand Down Expand Up @@ -37,6 +35,8 @@ class ServerSearchResult: SearchResult, SearchResultSuggestion, CoreResponseProv

var id: String

var mapboxId: String?

var name: String

var matchingName: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ extension AddressAutofill {
}
let result = AddressAutofill.Result(
name: suggestion.name,
mapboxId: suggestion.mapboxId,
formattedAddress: suggestion.formattedAddress,
coordinate: coordinate,
addressComponents: suggestion.addressComponents
Expand Down Expand Up @@ -248,6 +249,7 @@ extension AddressAutofill {

return Suggestion(
name: name,
mapboxId: result.mapboxId,
formattedAddress: fullAddress,
coordinate: result.center?.value,
addressComponents: resultAddress,
Expand Down Expand Up @@ -287,6 +289,7 @@ extension AddressAutofill {

let autofillResult = AddressAutofill.Result(
name: result.name,
mapboxId: result.mapboxId,
formattedAddress: formattedAddress,
coordinate: result.coordinate,
addressComponents: addressComponents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ extension AddressAutofill {
/// Result name.
public let name: String

/// A unique identifier for the geographic feature
public let mapboxId: String?

/// Textual representation of the address.
public let formattedAddress: String

Expand All @@ -16,11 +19,13 @@ extension AddressAutofill {

init(
name: String,
mapboxId: String?,
formattedAddress: String,
coordinate: CLLocationCoordinate2D,
addressComponents: NonEmptyArray<AddressComponent>
) {
self.name = name
self.mapboxId = mapboxId
self.formattedAddress = formattedAddress
self.coordinate = coordinate
self.addressComponents = addressComponents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ extension AddressAutofill {
/// Suggestion name.
public let name: String

/// A unique identifier for the geographic feature
public let mapboxId: String?

/// Textual representation of the address.
public let formattedAddress: String

Expand All @@ -21,12 +24,14 @@ extension AddressAutofill {

init(
name: String,
mapboxId: String?,
formattedAddress: String,
coordinate: CLLocationCoordinate2D?,
addressComponents: NonEmptyArray<AddressComponent>,
underlying: Underlying
) {
self.name = name
self.mapboxId = mapboxId
self.formattedAddress = formattedAddress
self.coordinate = coordinate
self.addressComponents = addressComponents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extension AddressAutofill.Suggestion {

return try .init(
name: searchResult.name,
mapboxId: searchResult.mapboxId,
formattedAddress: formattedAddress,
coordinate: searchResult.coordinate,
addressComponents: address.toAutofillComponents(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ extension Discover {
/// Result's name
public let name: String

/// A unique identifier for the geographic feature
public let mapboxId: String?

/// Result's address
public let address: AddressComponents

Expand Down Expand Up @@ -34,6 +37,7 @@ extension Discover.Result {

return .init(
name: searchResult.name,
mapboxId: searchResult.mapboxId,
address: .init(searchResult: searchResult),
coordinate: searchResult.coordinate,
routablePoints: routablePointsArray,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ extension PlaceAutocomplete {
/// Result name.
public let name: String

/// A unique identifier for the geographic feature
public let mapboxId: String?

/// Contains formatted address.
public let description: String?

Expand Down
Loading

0 comments on commit cf27c54

Please sign in to comment.