@@ -4,12 +4,13 @@ import { booleanConverter } from '../core/view-base';
44import { CoreTypes } from '../../core-types' ;
55import { ImageAsset } from '../../image-asset' ;
66import { ImageSource } from '../../image-source' ;
7- import { isDataURI , isFontIconURI , isFileOrResourcePath , RESOURCE_PREFIX } from '../../utils' ;
7+ import { isDataURI , isFontIconURI , isFileOrResourcePath , RESOURCE_PREFIX , SYSTEM_PREFIX } from '../../utils' ;
88import { Color } from '../../color' ;
99import { Style } from '../styling/style' ;
1010import { Length } from '../styling/style-properties' ;
1111import { Property , InheritedCssProperty } from '../core/properties' ;
1212import { Trace } from '../../trace' ;
13+ import { ImageSymbolEffect , ImageSymbolEffects } from './symbol-effects' ;
1314
1415@CSSType ( 'Image' )
1516export abstract class ImageBase extends View implements ImageDefinition {
@@ -75,13 +76,21 @@ export abstract class ImageBase extends View implements ImageDefinition {
7576 }
7677 } else if ( isFileOrResourcePath ( value ) ) {
7778 if ( value . indexOf ( RESOURCE_PREFIX ) === 0 ) {
78- const resPath = value . substr ( RESOURCE_PREFIX . length ) ;
79+ const resPath = value . slice ( RESOURCE_PREFIX . length ) ;
7980 if ( sync ) {
8081 imageLoaded ( ImageSource . fromResourceSync ( resPath ) ) ;
8182 } else {
8283 this . imageSource = null ;
8384 ImageSource . fromResource ( resPath ) . then ( imageLoaded ) ;
8485 }
86+ } else if ( value . indexOf ( SYSTEM_PREFIX ) === 0 ) {
87+ const sysPath = value . slice ( SYSTEM_PREFIX . length ) ;
88+ if ( sync ) {
89+ imageLoaded ( ImageSource . fromSystemImageSync ( sysPath ) ) ;
90+ } else {
91+ this . imageSource = null ;
92+ ImageSource . fromSystemImage ( sysPath ) . then ( imageLoaded ) ;
93+ }
8594 } else {
8695 if ( sync ) {
8796 imageLoaded ( ImageSource . fromFileSync ( value ) ) ;
@@ -178,3 +187,13 @@ export const decodeWidthProperty = new Property<ImageBase, CoreTypes.LengthType>
178187 valueConverter : Length . parse ,
179188} ) ;
180189decodeWidthProperty . register ( ImageBase ) ;
190+
191+ /**
192+ * iOS only
193+ */
194+ export const iosSymbolEffectProperty = new Property < ImageBase , ImageSymbolEffect | ImageSymbolEffects > ( {
195+ name : 'iosSymbolEffect' ,
196+ } ) ;
197+ iosSymbolEffectProperty . register ( ImageBase ) ;
198+
199+ export { ImageSymbolEffect , ImageSymbolEffects } ;
0 commit comments