diff --git a/src/data/bucket/symbol_bucket.js b/src/data/bucket/symbol_bucket.js index 2369e6029c5..1a64a3706b3 100644 --- a/src/data/bucket/symbol_bucket.js +++ b/src/data/bucket/symbol_bucket.js @@ -25,7 +25,7 @@ import {ProgramConfigurationSet} from '../program_configuration'; import {TriangleIndexArray, LineIndexArray} from '../index_array_type'; import transformText from '../../symbol/transform_text'; import mergeLines from '../../symbol/mergelines'; -import {allowsVerticalWritingMode} from '../../util/script_detection'; +import {allowsVerticalWritingMode, stringContainsRTLText} from '../../util/script_detection'; import {WritingMode} from '../../symbol/shaping'; import loadGeometry from '../load_geometry'; import mvt from '@mapbox/vector-tile'; @@ -131,6 +131,15 @@ function addDynamicAttributes(dynamicLayoutVertexArray: StructArray, p: Point, a dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle); } +function containsRTLText(formattedText: Formatted): boolean { + for (const section of formattedText.sections) { + if (stringContainsRTLText(section.text)) { + return true; + } + } + return false; +} + export class SymbolBuffers { layoutVertexArray: SymbolLayoutArray; layoutVertexBuffer: VertexBuffer; @@ -423,7 +432,7 @@ class SymbolBucket implements Bucket { // conversion here. const resolvedTokens = layer.getValueAndResolveTokens('text-field', feature, availableImages); const formattedText = Formatted.factory(resolvedTokens); - if (formattedText.containsRTLText()) { + if (containsRTLText(formattedText)) { this.hasRTLText = true; } if ( diff --git a/src/style-spec/CHANGELOG.md b/src/style-spec/CHANGELOG.md index 2bb7d464b32..b70a30c45c1 100644 --- a/src/style-spec/CHANGELOG.md +++ b/src/style-spec/CHANGELOG.md @@ -1,3 +1,8 @@ +## 13.10.1 + +### 🐛 Bug fixes +* Fix an incorrect import of the `script_detection` module which breaks projects that rely on importing submodules directly. + ## 13.10.0 ### ✨ Features and improvements diff --git a/src/style-spec/expression/types/formatted.js b/src/style-spec/expression/types/formatted.js index 726242ea30f..378a0a2bd5d 100644 --- a/src/style-spec/expression/types/formatted.js +++ b/src/style-spec/expression/types/formatted.js @@ -1,6 +1,4 @@ // @flow - -import {stringContainsRTLText} from "../../../util/script_detection"; import type Color from '../../util/color'; import type ResolvedImage from '../types/resolved_image'; @@ -50,15 +48,6 @@ export default class Formatted { return this.sections.map(section => section.text).join(''); } - containsRTLText(): boolean { - for (const section of this.sections) { - if (stringContainsRTLText(section.text)) { - return true; - } - } - return false; - } - serialize(): Array { const serialized: Array = ["format"]; for (const section of this.sections) { diff --git a/src/style-spec/package.json b/src/style-spec/package.json index 844cf4748b3..7c15772e95d 100644 --- a/src/style-spec/package.json +++ b/src/style-spec/package.json @@ -1,7 +1,7 @@ { "name": "@mapbox/mapbox-gl-style-spec", "description": "a specification for mapbox gl styles", - "version": "13.10.0", + "version": "13.10.1", "author": "Mapbox", "keywords": [ "mapbox",