@akylas/nativescript 8.8.9 → 8.8.11

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.
Files changed (348) hide show
  1. package/application/application-interfaces.d.ts +1 -1
  2. package/config/config.interface.d.ts +9 -4
  3. package/core-types/index.d.ts +5 -4
  4. package/core-types/index.js +3 -3
  5. package/core-types/index.js.map +1 -1
  6. package/css/parser.js +2 -1
  7. package/css/parser.js.map +1 -1
  8. package/data/observable/index.d.ts +2 -1
  9. package/data/observable/index.js +1 -0
  10. package/data/observable/index.js.map +1 -1
  11. package/globals/index.js +5 -3
  12. package/globals/index.js.map +1 -1
  13. package/image-source/index.android.d.ts +3 -2
  14. package/image-source/index.android.js +13 -6
  15. package/image-source/index.android.js.map +1 -1
  16. package/image-source/index.d.ts +5 -0
  17. package/image-source/index.ios.d.ts +3 -2
  18. package/image-source/index.ios.js +10 -3
  19. package/image-source/index.ios.js.map +1 -1
  20. package/index.d.ts +1 -2
  21. package/index.js +1 -1
  22. package/index.js.map +1 -1
  23. package/package.json +2 -2
  24. package/platform/common.d.ts +1 -0
  25. package/platform/common.js +1 -0
  26. package/platform/common.js.map +1 -1
  27. package/platforms/android/widgets-release.aar +0 -0
  28. package/platforms/ios/src/NativeScriptMainWindow.swift +24 -7
  29. package/platforms/ios/src/UIView+NativeScript.m +2 -4
  30. package/ui/action-bar/index.android.d.ts +1 -0
  31. package/ui/action-bar/index.android.js +3 -0
  32. package/ui/action-bar/index.android.js.map +1 -1
  33. package/ui/action-bar/index.d.ts +33 -0
  34. package/ui/action-bar/index.ios.d.ts +7 -2
  35. package/ui/action-bar/index.ios.js +124 -24
  36. package/ui/action-bar/index.ios.js.map +1 -1
  37. package/ui/activity-indicator/index.d.ts +4 -0
  38. package/ui/animation/animation-common.d.ts +1 -8
  39. package/ui/animation/animation-common.js +0 -8
  40. package/ui/animation/animation-common.js.map +1 -1
  41. package/ui/animation/animation-interfaces.d.ts +20 -4
  42. package/ui/animation/animation-interfaces.js +12 -1
  43. package/ui/animation/animation-interfaces.js.map +1 -1
  44. package/ui/animation/index.android.d.ts +2 -2
  45. package/ui/animation/index.android.js +2 -2
  46. package/ui/animation/index.android.js.map +1 -1
  47. package/ui/animation/index.d.ts +1 -14
  48. package/ui/animation/index.ios.d.ts +2 -2
  49. package/ui/animation/index.ios.js +18 -34
  50. package/ui/animation/index.ios.js.map +1 -1
  51. package/ui/builder/index.d.ts +1 -0
  52. package/ui/builder/index.js +1 -0
  53. package/ui/builder/index.js.map +1 -1
  54. package/ui/builder/xml2ui.js +4 -3
  55. package/ui/builder/xml2ui.js.map +1 -1
  56. package/ui/button/index.android.d.ts +1 -1
  57. package/ui/button/index.android.js +18 -15
  58. package/ui/button/index.android.js.map +1 -1
  59. package/ui/button/index.d.ts +11 -0
  60. package/ui/button/index.ios.d.ts +2 -2
  61. package/ui/button/index.ios.js +28 -7
  62. package/ui/button/index.ios.js.map +1 -1
  63. package/ui/core/control-state-change/index.android.d.ts +2 -2
  64. package/ui/core/control-state-change/index.android.js +1 -1
  65. package/ui/core/control-state-change/index.android.js.map +1 -1
  66. package/ui/core/control-state-change/index.d.ts +4 -2
  67. package/ui/core/control-state-change/index.ios.d.ts +3 -7
  68. package/ui/core/control-state-change/index.ios.js +18 -36
  69. package/ui/core/control-state-change/index.ios.js.map +1 -1
  70. package/ui/core/properties/index.js +6 -1
  71. package/ui/core/properties/index.js.map +1 -1
  72. package/ui/core/view/index.android.d.ts +3 -9
  73. package/ui/core/view/index.android.js +7 -5
  74. package/ui/core/view/index.android.js.map +1 -1
  75. package/ui/core/view/index.d.ts +239 -15
  76. package/ui/core/view/index.ios.d.ts +4 -15
  77. package/ui/core/view/index.ios.js +22 -21
  78. package/ui/core/view/index.ios.js.map +1 -1
  79. package/ui/core/view/view-common.d.ts +12 -16
  80. package/ui/core/view/view-common.js +36 -27
  81. package/ui/core/view/view-common.js.map +1 -1
  82. package/ui/core/view/view-helper/index.d.ts +3 -3
  83. package/ui/core/view/view-helper/index.ios.d.ts +14 -18
  84. package/ui/core/view/view-helper/index.ios.js +21 -6
  85. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  86. package/ui/core/view-base/index.d.ts +107 -4
  87. package/ui/core/view-base/index.js +57 -9
  88. package/ui/core/view-base/index.js.map +1 -1
  89. package/ui/date-picker/date-picker-common.d.ts +1 -0
  90. package/ui/date-picker/date-picker-common.js +1 -0
  91. package/ui/date-picker/date-picker-common.js.map +1 -1
  92. package/ui/date-picker/index.d.ts +30 -0
  93. package/ui/date-picker/index.ios.js +3 -3
  94. package/ui/date-picker/index.ios.js.map +1 -1
  95. package/ui/editable-text-base/editable-text-base-common.d.ts +2 -3
  96. package/ui/editable-text-base/editable-text-base-common.js +21 -8
  97. package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
  98. package/ui/editable-text-base/index.android.d.ts +1 -1
  99. package/ui/editable-text-base/index.android.js +2 -0
  100. package/ui/editable-text-base/index.android.js.map +1 -1
  101. package/ui/editable-text-base/index.d.ts +42 -0
  102. package/ui/frame/fragment.transitions.android.js +2 -3
  103. package/ui/frame/fragment.transitions.android.js.map +1 -1
  104. package/ui/frame/frame-common.d.ts +7 -4
  105. package/ui/frame/frame-common.js +39 -14
  106. package/ui/frame/frame-common.js.map +1 -1
  107. package/ui/frame/index.android.d.ts +1 -0
  108. package/ui/frame/index.android.js +12 -15
  109. package/ui/frame/index.android.js.map +1 -1
  110. package/ui/frame/index.d.ts +46 -5
  111. package/ui/frame/index.ios.js +13 -0
  112. package/ui/frame/index.ios.js.map +1 -1
  113. package/ui/gestures/gestures-common.d.ts +22 -0
  114. package/ui/gestures/gestures-common.js +22 -0
  115. package/ui/gestures/gestures-common.js.map +1 -1
  116. package/ui/gestures/index.android.d.ts +1 -1
  117. package/ui/gestures/index.ios.d.ts +1 -1
  118. package/ui/gestures/touch-manager.d.ts +1 -1
  119. package/ui/gestures/touch-manager.js +1 -2
  120. package/ui/gestures/touch-manager.js.map +1 -1
  121. package/ui/html-view/html-view-common.d.ts +1 -0
  122. package/ui/html-view/html-view-common.js.map +1 -1
  123. package/ui/html-view/index.d.ts +16 -2
  124. package/ui/html-view/index.ios.js +1 -1
  125. package/ui/html-view/index.ios.js.map +1 -1
  126. package/ui/image/image-common.d.ts +2 -0
  127. package/ui/image/image-common.js +5 -1
  128. package/ui/image/image-common.js.map +1 -1
  129. package/ui/image/index.d.ts +43 -1
  130. package/ui/index.d.ts +2 -0
  131. package/ui/index.js.map +1 -1
  132. package/ui/label/index.d.ts +4 -0
  133. package/ui/label/index.ios.d.ts +2 -0
  134. package/ui/label/index.ios.js +5 -1
  135. package/ui/label/index.ios.js.map +1 -1
  136. package/ui/layouts/absolute-layout/absolute-layout-common.js +4 -2
  137. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  138. package/ui/layouts/absolute-layout/index.d.ts +2 -0
  139. package/ui/layouts/dock-layout/index.d.ts +5 -1
  140. package/ui/layouts/flexbox-layout/index.d.ts +32 -0
  141. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  142. package/ui/layouts/grid-layout/index.d.ts +14 -5
  143. package/ui/layouts/index.d.ts +1 -1
  144. package/ui/layouts/index.js +1 -1
  145. package/ui/layouts/index.js.map +1 -1
  146. package/ui/layouts/layout-base-common.d.ts +1 -1
  147. package/ui/layouts/layout-base-common.js +12 -9
  148. package/ui/layouts/layout-base-common.js.map +1 -1
  149. package/ui/layouts/layout-base.d.ts +15 -1
  150. package/ui/layouts/layout-base.ios.d.ts +1 -1
  151. package/ui/layouts/layout-base.ios.js +5 -2
  152. package/ui/layouts/layout-base.ios.js.map +1 -1
  153. package/ui/layouts/root-layout/index.android.d.ts +1 -2
  154. package/ui/layouts/root-layout/index.android.js +12 -12
  155. package/ui/layouts/root-layout/index.android.js.map +1 -1
  156. package/ui/layouts/root-layout/index.d.ts +4 -0
  157. package/ui/layouts/root-layout/index.ios.d.ts +2 -1
  158. package/ui/layouts/root-layout/index.ios.js +7 -2
  159. package/ui/layouts/root-layout/index.ios.js.map +1 -1
  160. package/ui/layouts/root-layout/root-layout-common.d.ts +12 -5
  161. package/ui/layouts/root-layout/root-layout-common.js +78 -50
  162. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  163. package/ui/layouts/root-layout/root-layout-stack.d.ts +5 -0
  164. package/ui/layouts/root-layout/root-layout-stack.js +19 -0
  165. package/ui/layouts/root-layout/root-layout-stack.js.map +1 -0
  166. package/ui/layouts/stack-layout/index.d.ts +3 -0
  167. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  168. package/ui/layouts/wrap-layout/index.d.ts +8 -0
  169. package/ui/layouts/wrap-layout/wrap-layout-common.js +4 -2
  170. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  171. package/ui/list-picker/index.d.ts +12 -1
  172. package/ui/list-picker/list-picker-common.d.ts +1 -0
  173. package/ui/list-picker/list-picker-common.js +1 -0
  174. package/ui/list-picker/list-picker-common.js.map +1 -1
  175. package/ui/list-view/index.d.ts +24 -0
  176. package/ui/list-view/index.ios.js +1 -1
  177. package/ui/list-view/index.ios.js.map +1 -1
  178. package/ui/list-view/list-view-common.js +2 -1
  179. package/ui/list-view/list-view-common.js.map +1 -1
  180. package/ui/page/index.d.ts +31 -2
  181. package/ui/page/index.ios.js +2 -7
  182. package/ui/page/index.ios.js.map +1 -1
  183. package/ui/placeholder/index.android.d.ts +1 -1
  184. package/ui/progress/index.d.ts +13 -0
  185. package/ui/proxy-view-container/index.d.ts +2 -0
  186. package/ui/proxy-view-container/index.js +2 -0
  187. package/ui/proxy-view-container/index.js.map +1 -1
  188. package/ui/repeater/index.d.ts +2 -0
  189. package/ui/repeater/index.js +2 -0
  190. package/ui/repeater/index.js.map +1 -1
  191. package/ui/scroll-view/index.android.d.ts +0 -1
  192. package/ui/scroll-view/index.android.js.map +1 -1
  193. package/ui/scroll-view/index.d.ts +10 -0
  194. package/ui/search-bar/index.android.js +7 -1
  195. package/ui/search-bar/index.android.js.map +1 -1
  196. package/ui/search-bar/index.d.ts +14 -0
  197. package/ui/search-bar/index.ios.d.ts +2 -2
  198. package/ui/search-bar/index.ios.js +15 -14
  199. package/ui/search-bar/index.ios.js.map +1 -1
  200. package/ui/search-bar/search-bar-common.js.map +1 -1
  201. package/ui/segmented-bar/index.d.ts +21 -5
  202. package/ui/slider/index.d.ts +27 -0
  203. package/ui/slider/slider-common.d.ts +1 -0
  204. package/ui/slider/slider-common.js +1 -0
  205. package/ui/slider/slider-common.js.map +1 -1
  206. package/ui/styling/background-common.d.ts +3 -3
  207. package/ui/styling/background-common.js +15 -8
  208. package/ui/styling/background-common.js.map +1 -1
  209. package/ui/styling/background.android.js +2 -1
  210. package/ui/styling/background.android.js.map +1 -1
  211. package/ui/styling/background.d.ts +11 -8
  212. package/ui/styling/background.ios.d.ts +1 -15
  213. package/ui/styling/background.ios.js +75 -72
  214. package/ui/styling/background.ios.js.map +1 -1
  215. package/ui/styling/clip-path-function.d.ts +16 -0
  216. package/ui/styling/clip-path-function.js +25 -0
  217. package/ui/styling/clip-path-function.js.map +1 -0
  218. package/ui/styling/css-animation-parser.js +1 -1
  219. package/ui/styling/css-animation-parser.js.map +1 -1
  220. package/ui/styling/css-transform.d.ts +2 -0
  221. package/ui/styling/css-transform.js +110 -0
  222. package/ui/styling/css-transform.js.map +1 -0
  223. package/ui/styling/font-common.d.ts +2 -0
  224. package/ui/styling/font-common.js +9 -7
  225. package/ui/styling/font-common.js.map +1 -1
  226. package/ui/styling/font.android.d.ts +1 -1
  227. package/ui/styling/font.android.js +83 -21
  228. package/ui/styling/font.android.js.map +1 -1
  229. package/ui/styling/font.d.ts +3 -0
  230. package/ui/styling/font.ios.d.ts +1 -1
  231. package/ui/styling/font.ios.js +5 -7
  232. package/ui/styling/font.ios.js.map +1 -1
  233. package/ui/styling/style/index.d.ts +5 -2
  234. package/ui/styling/style/index.js.map +1 -1
  235. package/ui/styling/style-properties.d.ts +16 -5
  236. package/ui/styling/style-properties.js +238 -369
  237. package/ui/styling/style-properties.js.map +1 -1
  238. package/ui/styling/style-scope.js +2 -2
  239. package/ui/styling/style-scope.js.map +1 -1
  240. package/ui/switch/index.d.ts +11 -0
  241. package/ui/switch/switch-common.js +4 -4
  242. package/ui/switch/switch-common.js.map +1 -1
  243. package/ui/tab-view/index.d.ts +43 -5
  244. package/ui/text-base/index.android.d.ts +9 -2
  245. package/ui/text-base/index.android.js +65 -44
  246. package/ui/text-base/index.android.js.map +1 -1
  247. package/ui/text-base/index.d.ts +53 -0
  248. package/ui/text-base/index.ios.d.ts +4 -2
  249. package/ui/text-base/index.ios.js +31 -13
  250. package/ui/text-base/index.ios.js.map +1 -1
  251. package/ui/text-base/text-base-common.d.ts +2 -0
  252. package/ui/text-base/text-base-common.js +7 -0
  253. package/ui/text-base/text-base-common.js.map +1 -1
  254. package/ui/text-field/index.d.ts +13 -0
  255. package/ui/text-field/index.ios.d.ts +1 -1
  256. package/ui/text-field/index.ios.js +5 -4
  257. package/ui/text-field/index.ios.js.map +1 -1
  258. package/ui/text-field/text-field-common.js.map +1 -1
  259. package/ui/text-view/index.d.ts +11 -0
  260. package/ui/text-view/index.ios.d.ts +1 -1
  261. package/ui/text-view/index.ios.js.map +1 -1
  262. package/ui/text-view/text-view-common.d.ts +0 -1
  263. package/ui/time-picker/index.d.ts +27 -0
  264. package/ui/time-picker/index.ios.js +3 -3
  265. package/ui/time-picker/index.ios.js.map +1 -1
  266. package/ui/time-picker/time-picker-common.d.ts +1 -0
  267. package/ui/time-picker/time-picker-common.js +1 -0
  268. package/ui/time-picker/time-picker-common.js.map +1 -1
  269. package/ui/utils.d.ts +1 -1
  270. package/ui/utils.ios.d.ts +1 -2
  271. package/ui/utils.ios.js.map +1 -1
  272. package/ui/web-view/index.d.ts +12 -0
  273. package/ui/web-view/web-view-common.d.ts +1 -1
  274. package/utils/index.android.d.ts +1 -0
  275. package/utils/index.android.js +16 -0
  276. package/utils/index.android.js.map +1 -1
  277. package/utils/index.d.ts +6 -0
  278. package/utils/index.ios.d.ts +1 -0
  279. package/utils/index.ios.js +22 -2
  280. package/utils/index.ios.js.map +1 -1
  281. package/utils/native-helper.ios.js +1 -0
  282. package/utils/native-helper.ios.js.map +1 -1
  283. package/wgc/atob.js +1 -1
  284. package/wgc/btoa.js +1 -1
  285. package/wgc/crypto/SubtleCrypto.js +8 -8
  286. package/wgc/crypto/index.d.ts +1 -1
  287. package/wgc/crypto/index.js +3 -2
  288. package/wgc/crypto/index.js.map +1 -1
  289. package/xml/index.js +1 -1
  290. package/xml/index.js.map +1 -1
  291. package/platforms/ios/NSCWinterCG.xcframework/Info.plist +0 -102
  292. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Headers/NSCCrypto.h +0 -79
  293. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Headers/NSCWinterCG.h +0 -20
  294. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Headers/NSString+WinterCG.h +0 -21
  295. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Info.plist +0 -0
  296. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/Modules/module.modulemap +0 -6
  297. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/NSCWinterCG.framework/NSCWinterCG +0 -0
  298. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +0 -20
  299. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
  300. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +0 -40
  301. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Headers/NSCCrypto.h +0 -79
  302. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Headers/NSCWinterCG.h +0 -20
  303. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Headers/NSString+WinterCG.h +0 -21
  304. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Modules/module.modulemap +0 -6
  305. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/NSCWinterCG +0 -0
  306. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Resources/Info.plist +0 -52
  307. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Headers/NSCCrypto.h +0 -79
  308. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Headers/NSCWinterCG.h +0 -20
  309. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Headers/NSString+WinterCG.h +0 -21
  310. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Modules/module.modulemap +0 -6
  311. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/NSCWinterCG +0 -0
  312. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/A/Resources/Info.plist +0 -52
  313. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/NSCWinterCG.framework/Versions/Current/NSCWinterCG +0 -0
  314. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +0 -20
  315. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
  316. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +0 -40
  317. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterCG.yml +0 -40
  318. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCCrypto.h +0 -79
  319. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCWinterCG.h +0 -20
  320. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSString+WinterCG.h +0 -21
  321. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Info.plist +0 -0
  322. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/Modules/module.modulemap +0 -6
  323. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/NSCWinterCG +0 -0
  324. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/NSCWinterCG.framework/_CodeSignature/CodeResources +0 -146
  325. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +0 -20
  326. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
  327. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +0 -40
  328. package/platforms/ios/NSCWinterCG.xcframework/ios-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterCG.yml +0 -40
  329. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Headers/NSCCrypto.h +0 -79
  330. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Headers/NSCWinterCG.h +0 -20
  331. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Headers/NSString+WinterCG.h +0 -21
  332. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Info.plist +0 -0
  333. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/Modules/module.modulemap +0 -6
  334. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/NSCWinterCG.framework/NSCWinterCG +0 -0
  335. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +0 -20
  336. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
  337. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +0 -40
  338. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCCrypto.h +0 -79
  339. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSCWinterCG.h +0 -20
  340. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Headers/NSString+WinterCG.h +0 -21
  341. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Info.plist +0 -0
  342. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/Modules/module.modulemap +0 -6
  343. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/NSCWinterCG +0 -0
  344. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/NSCWinterCG.framework/_CodeSignature/CodeResources +0 -146
  345. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Info.plist +0 -20
  346. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/DWARF/NSCWinterCG +0 -0
  347. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/aarch64/NSCWinterCG.yml +0 -40
  348. package/platforms/ios/NSCWinterCG.xcframework/xros-arm64_x86_64-simulator/dSYMs/NSCWinterCG.framework.dSYM/Contents/Resources/Relocations/x86_64/NSCWinterCG.yml +0 -40
@@ -1,50 +1,42 @@
1
- // Types
2
1
  import { unsetValue, CssProperty, CssAnimationProperty, ShorthandProperty, InheritedCssProperty } from '../core/properties';
3
2
  import { Style } from './style';
4
3
  import { Color } from '../../color';
5
4
  import { Font, parseFont, FontStyle, FontWeight, FontVariationSettings } from './font';
6
5
  import { Background } from './background';
7
- import { layout, hasDuplicates } from '../../utils';
8
- import { radiansToDegrees } from '../../utils/number-utils';
9
- import { decompose2DTransformMatrix, getTransformMatrix, matrixArrayToCssMatrix, multiplyAffine2d } from '../../matrix';
6
+ import { layout } from '../../utils';
10
7
  import { Trace } from '../../trace';
11
8
  import { CoreTypes } from '../../core-types';
12
9
  import { parseBackground } from '../../css/parser';
13
10
  import { LinearGradient } from './linear-gradient';
14
11
  import { parseCSSShadow } from './css-shadow';
12
+ import { transformConverter } from './css-transform';
13
+ import { ClipPathFunction } from './clip-path-function';
15
14
  function equalsCommon(a, b) {
16
15
  if (a == 'auto') {
17
- // tslint:disable-line
18
- return b == 'auto'; // tslint:disable-line
16
+ return b == 'auto';
17
+ }
18
+ if (b == 'auto') {
19
+ return false;
19
20
  }
20
21
  if (typeof a === 'number') {
21
- if (b == 'auto') {
22
- // tslint:disable-line
23
- return false;
24
- }
25
22
  if (typeof b === 'number') {
26
- return a == b; // tslint:disable-line
23
+ return a == b;
27
24
  }
28
25
  if (!b) {
29
26
  return false;
30
27
  }
31
- return b.unit == 'dip' && a == b.value; // tslint:disable-line
32
- }
33
- if (b == 'auto') {
34
- // tslint:disable-line
35
- return false;
28
+ return b.unit == 'dip' && a == b.value;
36
29
  }
37
30
  if (typeof b === 'number') {
38
- return a ? a.unit == 'dip' && a.value == b : false; // tslint:disable-line
31
+ return a ? a.unit == 'dip' && a.value == b : false;
39
32
  }
40
33
  if (!a || !b) {
41
34
  return false;
42
35
  }
43
- return a.value == b.value && a.unit == b.unit; // tslint:disable-line
36
+ return a.value == b.value && a.unit == b.unit;
44
37
  }
45
38
  function convertToStringCommon(length) {
46
39
  if (length == 'auto' || length === null || length === undefined) {
47
- // tslint:disable-line
48
40
  return 'auto';
49
41
  }
50
42
  if (typeof length === 'number') {
@@ -83,11 +75,10 @@ export var PercentLength;
83
75
  (function (PercentLength) {
84
76
  function parse(fromValue) {
85
77
  if (fromValue == 'auto') {
86
- // tslint:disable-line
87
78
  return 'auto';
88
79
  }
89
80
  if (typeof fromValue === 'string') {
90
- let stringValue = fromValue.trim();
81
+ const stringValue = fromValue.trim();
91
82
  if (stringValue.endsWith('%')) {
92
83
  // Normalize result to values between -1 and 1
93
84
  const value = parseFloat(stringValue.substring(0, stringValue.length - 1).trim()) / 100;
@@ -120,13 +111,10 @@ export var PercentLength;
120
111
  PercentLength.toDevicePixels = toDevicePixelsCommon;
121
112
  PercentLength.convertToString = convertToStringCommon;
122
113
  })(PercentLength || (PercentLength = {}));
123
- export var Length;
124
- (function (Length) {
114
+ export var FixedLength;
115
+ (function (FixedLength) {
125
116
  function parse(fromValue) {
126
117
  if (typeof fromValue === 'string') {
127
- if (fromValue === 'auto') {
128
- return 'auto';
129
- }
130
118
  let stringValue = fromValue.trim();
131
119
  if (stringValue.endsWith('px')) {
132
120
  stringValue = stringValue.slice(0, -2).trim();
@@ -148,11 +136,188 @@ export var Length;
148
136
  return fromValue;
149
137
  }
150
138
  }
139
+ FixedLength.parse = parse;
140
+ FixedLength.equals = equalsCommon;
141
+ FixedLength.toDevicePixels = toDevicePixelsCommon;
142
+ FixedLength.convertToString = convertToStringCommon;
143
+ })(FixedLength || (FixedLength = {}));
144
+ export var Length;
145
+ (function (Length) {
146
+ function parse(fromValue) {
147
+ if (fromValue == 'auto') {
148
+ return 'auto';
149
+ }
150
+ return FixedLength.parse(fromValue);
151
+ }
151
152
  Length.parse = parse;
152
153
  Length.equals = equalsCommon;
153
154
  Length.toDevicePixels = toDevicePixelsCommon;
154
155
  Length.convertToString = convertToStringCommon;
155
156
  })(Length || (Length = {}));
157
+ function isNonNegativeFiniteNumber(value) {
158
+ return isFinite(value) && !isNaN(value) && value >= 0;
159
+ }
160
+ function parseClipPath(value) {
161
+ const functionStartIndex = value.indexOf('(');
162
+ if (functionStartIndex > -1) {
163
+ const functionName = value.substring(0, functionStartIndex).trim();
164
+ switch (functionName) {
165
+ case 'rect':
166
+ case 'circle':
167
+ case 'ellipse':
168
+ case 'polygon':
169
+ case 'inset': {
170
+ const rule = value.replace(`${functionName}(`, '').replace(')', '');
171
+ return new ClipPathFunction(functionName, rule);
172
+ }
173
+ default:
174
+ throw new Error(`Clip-path function ${functionName} is not valid.`);
175
+ }
176
+ }
177
+ else {
178
+ if (value === 'none') {
179
+ return null;
180
+ }
181
+ // Only shape functions and none are supported for now
182
+ throw new Error(`Clip-path value ${value} is not valid.`);
183
+ }
184
+ }
185
+ function parseShorthandPositioning(value) {
186
+ const arr = value.split(/[ ,]+/);
187
+ let top;
188
+ let right;
189
+ let bottom;
190
+ let left;
191
+ if (arr.length === 1) {
192
+ top = arr[0];
193
+ right = arr[0];
194
+ bottom = arr[0];
195
+ left = arr[0];
196
+ }
197
+ else if (arr.length === 2) {
198
+ top = arr[0];
199
+ bottom = arr[0];
200
+ right = arr[1];
201
+ left = arr[1];
202
+ }
203
+ else if (arr.length === 3) {
204
+ top = arr[0];
205
+ right = arr[1];
206
+ left = arr[1];
207
+ bottom = arr[2];
208
+ }
209
+ else if (arr.length === 4) {
210
+ top = arr[0];
211
+ right = arr[1];
212
+ bottom = arr[2];
213
+ left = arr[3];
214
+ }
215
+ else {
216
+ throw new Error('Expected 1, 2, 3 or 4 parameters. Actual: ' + value);
217
+ }
218
+ return {
219
+ top: top,
220
+ right: right,
221
+ bottom: bottom,
222
+ left: left,
223
+ };
224
+ }
225
+ function parseBorderColorPositioning(value) {
226
+ if (value.indexOf('rgb') === 0 || value.indexOf('hsl') === 0) {
227
+ return {
228
+ top: value,
229
+ right: value,
230
+ bottom: value,
231
+ left: value,
232
+ };
233
+ }
234
+ return parseShorthandPositioning(value);
235
+ }
236
+ function convertToBackgrounds(value) {
237
+ if (typeof value === 'string') {
238
+ const backgrounds = parseBackground(value).value;
239
+ let backgroundColor = unsetValue;
240
+ if (backgrounds.color) {
241
+ backgroundColor = backgrounds.color instanceof Color ? backgrounds.color : new Color(backgrounds.color);
242
+ }
243
+ let backgroundImage;
244
+ if (typeof backgrounds.image === 'object' && backgrounds.image) {
245
+ backgroundImage = LinearGradient.parse(backgrounds.image);
246
+ }
247
+ else {
248
+ backgroundImage = backgrounds.image || unsetValue;
249
+ }
250
+ const backgroundRepeat = backgrounds.repeat || unsetValue;
251
+ const backgroundPosition = backgrounds.position ? backgrounds.position.text : unsetValue;
252
+ return [
253
+ [backgroundColorProperty, backgroundColor],
254
+ [backgroundImageProperty, backgroundImage],
255
+ [backgroundRepeatProperty, backgroundRepeat],
256
+ [backgroundPositionProperty, backgroundPosition],
257
+ ];
258
+ }
259
+ else {
260
+ return [
261
+ [backgroundColorProperty, unsetValue],
262
+ [backgroundImageProperty, unsetValue],
263
+ [backgroundRepeatProperty, unsetValue],
264
+ [backgroundPositionProperty, unsetValue],
265
+ ];
266
+ }
267
+ }
268
+ function convertToMargins(value) {
269
+ if (typeof value === 'string' && value !== 'auto') {
270
+ const thickness = parseShorthandPositioning(value);
271
+ return [
272
+ [marginTopProperty, PercentLength.parse(thickness.top)],
273
+ [marginRightProperty, PercentLength.parse(thickness.right)],
274
+ [marginBottomProperty, PercentLength.parse(thickness.bottom)],
275
+ [marginLeftProperty, PercentLength.parse(thickness.left)],
276
+ ];
277
+ }
278
+ else {
279
+ return [
280
+ [marginTopProperty, value],
281
+ [marginRightProperty, value],
282
+ [marginBottomProperty, value],
283
+ [marginLeftProperty, value],
284
+ ];
285
+ }
286
+ }
287
+ function convertToPaddings(value) {
288
+ if (typeof value === 'string' && value !== 'auto') {
289
+ const thickness = parseShorthandPositioning(value);
290
+ return [
291
+ [paddingTopProperty, Length.parse(thickness.top)],
292
+ [paddingRightProperty, Length.parse(thickness.right)],
293
+ [paddingBottomProperty, Length.parse(thickness.bottom)],
294
+ [paddingLeftProperty, Length.parse(thickness.left)],
295
+ ];
296
+ }
297
+ else {
298
+ return [
299
+ [paddingTopProperty, value],
300
+ [paddingRightProperty, value],
301
+ [paddingBottomProperty, value],
302
+ [paddingLeftProperty, value],
303
+ ];
304
+ }
305
+ }
306
+ function convertToTransform(value) {
307
+ if (value === unsetValue) {
308
+ value = 'none';
309
+ }
310
+ const { translate, rotate, scale } = transformConverter(value);
311
+ return [
312
+ [translateXProperty, translate.x],
313
+ [translateYProperty, translate.y],
314
+ [scaleXProperty, scale.x],
315
+ [scaleYProperty, scale.y],
316
+ [rotateProperty, rotate.z],
317
+ [rotateXProperty, rotate.x],
318
+ [rotateYProperty, rotate.y],
319
+ ];
320
+ }
156
321
  export const minWidthProperty = new CssProperty({
157
322
  name: 'minWidth',
158
323
  cssName: 'min-width',
@@ -355,89 +520,6 @@ export const verticalAlignmentProperty = new CssProperty({
355
520
  valueConverter: CoreTypes.VerticalAlignment.parse,
356
521
  });
357
522
  verticalAlignmentProperty.register(Style);
358
- function parseThickness(value) {
359
- if (typeof value === 'string') {
360
- const arr = value.split(' ');
361
- let top;
362
- let right;
363
- let bottom;
364
- let left;
365
- if (arr.length === 1) {
366
- top = arr[0];
367
- right = arr[0];
368
- bottom = arr[0];
369
- left = arr[0];
370
- }
371
- else if (arr.length === 2) {
372
- top = arr[0];
373
- bottom = arr[0];
374
- right = arr[1];
375
- left = arr[1];
376
- }
377
- else if (arr.length === 3) {
378
- top = arr[0];
379
- right = arr[1];
380
- left = arr[1];
381
- bottom = arr[2];
382
- }
383
- else if (arr.length === 4) {
384
- top = arr[0];
385
- right = arr[1];
386
- bottom = arr[2];
387
- left = arr[3];
388
- }
389
- else {
390
- throw new Error('Expected 1, 2, 3 or 4 parameters. Actual: ' + value);
391
- }
392
- return {
393
- top: top,
394
- right: right,
395
- bottom: bottom,
396
- left: left,
397
- };
398
- }
399
- else {
400
- return value;
401
- }
402
- }
403
- function convertToMargins(value) {
404
- if (typeof value === 'string' && value !== 'auto') {
405
- const thickness = parseThickness(value);
406
- return [
407
- [marginTopProperty, PercentLength.parse(thickness.top)],
408
- [marginRightProperty, PercentLength.parse(thickness.right)],
409
- [marginBottomProperty, PercentLength.parse(thickness.bottom)],
410
- [marginLeftProperty, PercentLength.parse(thickness.left)],
411
- ];
412
- }
413
- else {
414
- return [
415
- [marginTopProperty, value],
416
- [marginRightProperty, value],
417
- [marginBottomProperty, value],
418
- [marginLeftProperty, value],
419
- ];
420
- }
421
- }
422
- function convertToPaddings(value) {
423
- if (typeof value === 'string' && value !== 'auto') {
424
- const thickness = parseThickness(value);
425
- return [
426
- [paddingTopProperty, Length.parse(thickness.top)],
427
- [paddingRightProperty, Length.parse(thickness.right)],
428
- [paddingBottomProperty, Length.parse(thickness.bottom)],
429
- [paddingLeftProperty, Length.parse(thickness.left)],
430
- ];
431
- }
432
- else {
433
- return [
434
- [paddingTopProperty, value],
435
- [paddingRightProperty, value],
436
- [paddingBottomProperty, value],
437
- [paddingLeftProperty, value],
438
- ];
439
- }
440
- }
441
523
  export const rotateProperty = new CssAnimationProperty({
442
524
  name: 'rotate',
443
525
  cssName: 'rotate',
@@ -480,26 +562,20 @@ export const scaleYProperty = new CssAnimationProperty({
480
562
  valueConverter: parseFloat,
481
563
  });
482
564
  scaleYProperty.register(Style);
483
- function parseDIPs(value) {
484
- if (value.endsWith('px')) {
485
- return layout.toDeviceIndependentPixels(parseFloat(value.trim().slice(-2).trim()));
486
- }
487
- else {
488
- return parseFloat(value.slice(-3).trim());
489
- }
490
- }
491
565
  export const translateXProperty = new CssAnimationProperty({
492
566
  name: 'translateX',
493
567
  cssName: 'translateX',
494
568
  defaultValue: 0,
495
- valueConverter: parseDIPs,
569
+ equalityComparer: FixedLength.equals,
570
+ valueConverter: FixedLength.parse,
496
571
  });
497
572
  translateXProperty.register(Style);
498
573
  export const translateYProperty = new CssAnimationProperty({
499
574
  name: 'translateY',
500
575
  cssName: 'translateY',
501
576
  defaultValue: 0,
502
- valueConverter: parseDIPs,
577
+ equalityComparer: FixedLength.equals,
578
+ valueConverter: FixedLength.parse,
503
579
  });
504
580
  translateYProperty.register(Style);
505
581
  const transformProperty = new ShorthandProperty({
@@ -529,125 +605,6 @@ const transformProperty = new ShorthandProperty({
529
605
  converter: convertToTransform,
530
606
  });
531
607
  transformProperty.register(Style);
532
- const IDENTITY_TRANSFORMATION = {
533
- translate: { x: 0, y: 0 },
534
- rotate: { x: 0, y: 0, z: 0 },
535
- scale: { x: 1, y: 1 },
536
- };
537
- const TRANSFORM_SPLITTER = new RegExp(/\s*(.+?)\((.*?)\)/g);
538
- const TRANSFORMATIONS = Object.freeze(['rotate', 'rotateX', 'rotateY', 'rotate3d', 'translate', 'translate3d', 'translateX', 'translateY', 'scale', 'scale3d', 'scaleX', 'scaleY']);
539
- const STYLE_TRANSFORMATION_MAP = Object.freeze({
540
- scale: (value) => ({ property: 'scale', value }),
541
- scale3d: (value) => ({ property: 'scale', value }),
542
- scaleX: ({ x }) => ({
543
- property: 'scale',
544
- value: { x, y: IDENTITY_TRANSFORMATION.scale.y },
545
- }),
546
- scaleY: ({ y }) => ({
547
- property: 'scale',
548
- value: { y, x: IDENTITY_TRANSFORMATION.scale.x },
549
- }),
550
- translate: (value) => ({ property: 'translate', value }),
551
- translate3d: (value) => ({ property: 'translate', value }),
552
- translateX: ({ x }) => ({
553
- property: 'translate',
554
- value: { x, y: IDENTITY_TRANSFORMATION.translate.y },
555
- }),
556
- translateY: ({ y }) => ({
557
- property: 'translate',
558
- value: { y, x: IDENTITY_TRANSFORMATION.translate.x },
559
- }),
560
- rotate3d: (value) => ({ property: 'rotate', value }),
561
- rotateX: (x) => ({
562
- property: 'rotate',
563
- value: {
564
- x,
565
- y: IDENTITY_TRANSFORMATION.rotate.y,
566
- z: IDENTITY_TRANSFORMATION.rotate.z,
567
- },
568
- }),
569
- rotateY: (y) => ({
570
- property: 'rotate',
571
- value: {
572
- x: IDENTITY_TRANSFORMATION.rotate.x,
573
- y,
574
- z: IDENTITY_TRANSFORMATION.rotate.z,
575
- },
576
- }),
577
- rotate: (z) => ({
578
- property: 'rotate',
579
- value: {
580
- x: IDENTITY_TRANSFORMATION.rotate.x,
581
- y: IDENTITY_TRANSFORMATION.rotate.y,
582
- z,
583
- },
584
- }),
585
- });
586
- function convertToTransform(value) {
587
- if (value === unsetValue) {
588
- value = 'none';
589
- }
590
- const { translate, rotate, scale } = transformConverter(value);
591
- return [
592
- [translateXProperty, translate.x],
593
- [translateYProperty, translate.y],
594
- [scaleXProperty, scale.x],
595
- [scaleYProperty, scale.y],
596
- [rotateProperty, rotate.z],
597
- [rotateXProperty, rotate.x],
598
- [rotateYProperty, rotate.y],
599
- ];
600
- }
601
- export function transformConverter(text) {
602
- const transformations = parseTransformString(text);
603
- if (text === 'none' || text === '' || !transformations.length) {
604
- return IDENTITY_TRANSFORMATION;
605
- }
606
- const usedTransforms = transformations.map((t) => t.property);
607
- if (!hasDuplicates(usedTransforms)) {
608
- const fullTransformations = { ...IDENTITY_TRANSFORMATION };
609
- transformations.forEach((transform) => {
610
- fullTransformations[transform.property] = transform.value;
611
- });
612
- return fullTransformations;
613
- }
614
- const affineMatrix = transformations.map(getTransformMatrix).reduce(multiplyAffine2d);
615
- const cssMatrix = matrixArrayToCssMatrix(affineMatrix);
616
- return decompose2DTransformMatrix(cssMatrix);
617
- }
618
- // using general regex and manually checking the matched
619
- // properties is faster than using more specific regex
620
- // https://jsperf.com/cssparse
621
- function parseTransformString(text) {
622
- const matches = [];
623
- let match;
624
- while ((match = TRANSFORM_SPLITTER.exec(text)) !== null) {
625
- const property = match[1];
626
- const value = convertTransformValue(property, match[2]);
627
- if (TRANSFORMATIONS.indexOf(property) !== -1) {
628
- matches.push(normalizeTransformation({ property, value }));
629
- }
630
- }
631
- return matches;
632
- }
633
- function normalizeTransformation({ property, value }) {
634
- return STYLE_TRANSFORMATION_MAP[property](value);
635
- }
636
- function convertTransformValue(property, stringValue) {
637
- // eslint-disable-next-line prefer-const
638
- let [x, y, z] = stringValue.split(',').map(parseFloat);
639
- if (property === 'translate') {
640
- y ?? (y = IDENTITY_TRANSFORMATION.translate.y);
641
- }
642
- else {
643
- y ?? (y = x);
644
- z ?? (z = y);
645
- }
646
- if (property === 'rotate' || property === 'rotateX' || property === 'rotateY') {
647
- return stringValue.slice(-3) === 'rad' ? radiansToDegrees(x) : x;
648
- }
649
- return { x, y, z };
650
- }
651
608
  // Background properties.
652
609
  const backgroundProperty = new ShorthandProperty({
653
610
  name: 'background',
@@ -689,7 +646,6 @@ function backgroundInternalSubPropertyValueChanged(block) {
689
646
  }
690
647
  };
691
648
  }
692
- // const pattern: RegExp = /url\(('|")(.*?)\1\)/;
693
649
  export const backgroundImageProperty = new CssProperty({
694
650
  name: 'backgroundImage',
695
651
  cssName: 'background-image',
@@ -740,89 +696,6 @@ export const backgroundPositionProperty = new CssProperty({
740
696
  valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => target.backgroundInternal.withPosition(newValue)),
741
697
  });
742
698
  backgroundPositionProperty.register(Style);
743
- function convertToBackgrounds(value) {
744
- if (typeof value === 'string') {
745
- const backgrounds = parseBackground(value).value;
746
- let backgroundColor = unsetValue;
747
- if (backgrounds.color) {
748
- backgroundColor = backgrounds.color instanceof Color ? backgrounds.color : new Color(backgrounds.color);
749
- }
750
- let backgroundImage;
751
- if (typeof backgrounds.image === 'object' && backgrounds.image) {
752
- backgroundImage = LinearGradient.parse(backgrounds.image);
753
- }
754
- else {
755
- backgroundImage = backgrounds.image || unsetValue;
756
- }
757
- const backgroundRepeat = backgrounds.repeat || unsetValue;
758
- const backgroundPosition = backgrounds.position ? backgrounds.position.text : unsetValue;
759
- return [
760
- [backgroundColorProperty, backgroundColor],
761
- [backgroundImageProperty, backgroundImage],
762
- [backgroundRepeatProperty, backgroundRepeat],
763
- [backgroundPositionProperty, backgroundPosition],
764
- ];
765
- }
766
- else {
767
- return [
768
- [backgroundColorProperty, unsetValue],
769
- [backgroundImageProperty, unsetValue],
770
- [backgroundRepeatProperty, unsetValue],
771
- [backgroundPositionProperty, unsetValue],
772
- ];
773
- }
774
- }
775
- function parseBorderColor(value) {
776
- const result = {
777
- top: undefined,
778
- right: undefined,
779
- bottom: undefined,
780
- left: undefined,
781
- };
782
- if (value.indexOf('rgb') === 0 || value.indexOf('hsl') === 0) {
783
- result.top = result.right = result.bottom = result.left = new Color(value);
784
- return result;
785
- }
786
- const arr = value.split(/[ ,]+/);
787
- if (arr.length === 1) {
788
- const arr0 = new Color(arr[0]);
789
- result.top = arr0;
790
- result.right = arr0;
791
- result.bottom = arr0;
792
- result.left = arr0;
793
- }
794
- else if (arr.length === 2) {
795
- const arr0 = new Color(arr[0]);
796
- const arr1 = new Color(arr[1]);
797
- result.top = arr0;
798
- result.right = arr1;
799
- result.bottom = arr0;
800
- result.left = arr1;
801
- }
802
- else if (arr.length === 3) {
803
- const arr0 = new Color(arr[0]);
804
- const arr1 = new Color(arr[1]);
805
- const arr2 = new Color(arr[2]);
806
- result.top = arr0;
807
- result.right = arr1;
808
- result.bottom = arr2;
809
- result.left = arr1;
810
- }
811
- else if (arr.length === 4) {
812
- const arr0 = new Color(arr[0]);
813
- const arr1 = new Color(arr[1]);
814
- const arr2 = new Color(arr[2]);
815
- const arr3 = new Color(arr[3]);
816
- result.top = arr0;
817
- result.right = arr1;
818
- result.bottom = arr2;
819
- result.left = arr3;
820
- }
821
- else {
822
- throw new Error(`Expected 1, 2, 3 or 4 parameters. Actual: ${value}`);
823
- }
824
- return result;
825
- }
826
699
  // Border Color properties.
827
700
  const borderColorProperty = new ShorthandProperty({
828
701
  name: 'borderColor',
@@ -837,12 +710,12 @@ const borderColorProperty = new ShorthandProperty({
837
710
  },
838
711
  converter: function (value) {
839
712
  if (typeof value === 'string') {
840
- const fourColors = parseBorderColor(value);
713
+ const colors = parseBorderColorPositioning(value);
841
714
  return [
842
- [borderTopColorProperty, fourColors.top],
843
- [borderRightColorProperty, fourColors.right],
844
- [borderBottomColorProperty, fourColors.bottom],
845
- [borderLeftColorProperty, fourColors.left],
715
+ [borderTopColorProperty, new Color(colors.top)],
716
+ [borderRightColorProperty, new Color(colors.right)],
717
+ [borderBottomColorProperty, new Color(colors.bottom)],
718
+ [borderLeftColorProperty, new Color(colors.left)],
846
719
  ];
847
720
  }
848
721
  else {
@@ -902,12 +775,12 @@ const borderWidthProperty = new ShorthandProperty({
902
775
  },
903
776
  converter: function (value) {
904
777
  if (typeof value === 'string' && value !== 'auto') {
905
- const borderWidths = parseThickness(value);
778
+ const borderWidths = parseShorthandPositioning(value);
906
779
  return [
907
- [borderTopWidthProperty, borderWidths.top],
908
- [borderRightWidthProperty, borderWidths.right],
909
- [borderBottomWidthProperty, borderWidths.bottom],
910
- [borderLeftWidthProperty, borderWidths.left],
780
+ [borderTopWidthProperty, Length.parse(borderWidths.top)],
781
+ [borderRightWidthProperty, Length.parse(borderWidths.right)],
782
+ [borderBottomWidthProperty, Length.parse(borderWidths.bottom)],
783
+ [borderLeftWidthProperty, Length.parse(borderWidths.left)],
911
784
  ];
912
785
  }
913
786
  else {
@@ -1025,12 +898,12 @@ const borderRadiusProperty = new ShorthandProperty({
1025
898
  },
1026
899
  converter: function (value) {
1027
900
  if (typeof value === 'string') {
1028
- const borderRadius = parseThickness(value);
901
+ const borderRadius = parseShorthandPositioning(value);
1029
902
  return [
1030
- [borderTopLeftRadiusProperty, borderRadius.top],
1031
- [borderTopRightRadiusProperty, borderRadius.right],
1032
- [borderBottomRightRadiusProperty, borderRadius.bottom],
1033
- [borderBottomLeftRadiusProperty, borderRadius.left],
903
+ [borderTopLeftRadiusProperty, Length.parse(borderRadius.top)],
904
+ [borderTopRightRadiusProperty, Length.parse(borderRadius.right)],
905
+ [borderBottomRightRadiusProperty, Length.parse(borderRadius.bottom)],
906
+ [borderBottomLeftRadiusProperty, Length.parse(borderRadius.left)],
1034
907
  ];
1035
908
  }
1036
909
  else {
@@ -1128,53 +1001,49 @@ const boxShadowProperty = new CssProperty({
1128
1001
  },
1129
1002
  });
1130
1003
  boxShadowProperty.register(Style);
1131
- function isNonNegativeFiniteNumber(value) {
1132
- return isFinite(value) && value >= 0;
1133
- }
1134
- const supportedPaths = ['rect', 'circle', 'ellipse', 'polygon', 'inset'];
1135
- function isClipPathValid(value) {
1136
- if (!value) {
1137
- return true;
1138
- }
1139
- const functionName = value.substring(0, value.indexOf('(')).trim();
1140
- return supportedPaths.indexOf(functionName) !== -1;
1141
- }
1142
1004
  export const clipPathProperty = new CssProperty({
1143
1005
  name: 'clipPath',
1144
1006
  cssName: 'clip-path',
1145
- valueChanged: backgroundInternalSubPropertyValueChanged((target, oldValue, newValue) => {
1146
- if (!isClipPathValid(newValue)) {
1147
- throw new Error('clip-path is not valid.');
1007
+ valueChanged: (target, oldValue, newValue) => {
1008
+ target.backgroundInternal = target.backgroundInternal.withClipPath(newValue);
1009
+ },
1010
+ equalityComparer: (value1, value2) => {
1011
+ if (value1 instanceof ClipPathFunction && value2 instanceof ClipPathFunction) {
1012
+ return ClipPathFunction.equals(value1, value2);
1148
1013
  }
1149
- return target.backgroundInternal.withClipPath(newValue);
1150
- }),
1014
+ return value1 === value2;
1015
+ },
1016
+ valueConverter(value) {
1017
+ if (typeof value === 'string') {
1018
+ return parseClipPath(value);
1019
+ }
1020
+ return value;
1021
+ },
1151
1022
  });
1152
1023
  clipPathProperty.register(Style);
1153
- function isFloatValueConverter(value) {
1154
- const newValue = parseFloat(value);
1155
- if (isNaN(newValue)) {
1156
- throw new Error(`Invalid value: ${newValue}`);
1157
- }
1158
- return newValue;
1159
- }
1160
1024
  export const zIndexProperty = new CssProperty({
1161
1025
  name: 'zIndex',
1162
1026
  cssName: 'z-index',
1163
- valueConverter: isFloatValueConverter,
1027
+ valueConverter: (value) => {
1028
+ const newValue = parseFloat(value);
1029
+ if (isNaN(newValue)) {
1030
+ throw new Error(`Invalid value: ${newValue}`);
1031
+ }
1032
+ return newValue;
1033
+ },
1164
1034
  });
1165
1035
  zIndexProperty.register(Style);
1166
- function opacityConverter(value) {
1167
- const newValue = parseFloat(value);
1168
- if (!isNaN(newValue) && 0 <= newValue && newValue <= 1) {
1169
- return newValue;
1170
- }
1171
- throw new Error(`Opacity should be between [0, 1]. Value: ${newValue}`);
1172
- }
1173
1036
  export const opacityProperty = new CssAnimationProperty({
1174
1037
  name: 'opacity',
1175
1038
  cssName: 'opacity',
1176
1039
  defaultValue: 1,
1177
- valueConverter: opacityConverter,
1040
+ valueConverter: (value) => {
1041
+ const newValue = parseFloat(value);
1042
+ if (!isNonNegativeFiniteNumber(newValue) || newValue > 1) {
1043
+ throw new Error(`Opacity should be between [0, 1]. Value: ${newValue}`);
1044
+ }
1045
+ return newValue;
1046
+ },
1178
1047
  });
1179
1048
  opacityProperty.register(Style);
1180
1049
  export const colorProperty = new InheritedCssProperty({