@akylas/nativescript 9.0.25 → 9.1.5

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 (633) hide show
  1. package/abortcontroller/abortsignal.js.map +1 -1
  2. package/abortcontroller/index.js.map +1 -1
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-css-helper.js.map +1 -1
  5. package/accessibility/accessibility-properties.js.map +1 -1
  6. package/accessibility/accessibility-service-common.js.map +1 -1
  7. package/accessibility/accessibility-service.android.js.map +1 -1
  8. package/accessibility/accessibility-service.ios.js.map +1 -1
  9. package/accessibility/accessibility-types.js.map +1 -1
  10. package/accessibility/font-scale-common.js.map +1 -1
  11. package/accessibility/font-scale.android.js.map +1 -1
  12. package/accessibility/font-scale.ios.js.map +1 -1
  13. package/accessibility/index.android.js.map +1 -1
  14. package/accessibility/index.ios.js.map +1 -1
  15. package/animation-frame/animation-native.android.js.map +1 -1
  16. package/animation-frame/animation-native.ios.js.map +1 -1
  17. package/animation-frame/index.js.map +1 -1
  18. package/application/application-common.d.ts +205 -3
  19. package/application/application-common.js +438 -55
  20. package/application/application-common.js.map +1 -1
  21. package/application/application-interfaces.d.ts +67 -1
  22. package/application/application-interfaces.js.map +1 -1
  23. package/application/application-shims.js.map +1 -1
  24. package/application/application.android.d.ts +39 -0
  25. package/application/application.android.js +239 -18
  26. package/application/application.android.js.map +1 -1
  27. package/application/application.d.ts +161 -54
  28. package/application/application.ios.d.ts +189 -28
  29. package/application/application.ios.js +892 -390
  30. package/application/application.ios.js.map +1 -1
  31. package/application/helpers-common.d.ts +7 -0
  32. package/application/helpers-common.js +46 -1
  33. package/application/helpers-common.js.map +1 -1
  34. package/application/helpers.android.js.map +1 -1
  35. package/application/helpers.ios.js.map +1 -1
  36. package/application/index.android.js.map +1 -1
  37. package/application/index.ios.js.map +1 -1
  38. package/application/scene-delegate-bridge.d.ts +60 -0
  39. package/application/scene-delegate-bridge.js +138 -0
  40. package/application/scene-delegate-bridge.js.map +1 -0
  41. package/application-settings/application-settings-common.js.map +1 -1
  42. package/application-settings/index.android.js.map +1 -1
  43. package/application-settings/index.ios.js.map +1 -1
  44. package/bundle-entry-points.js.map +1 -1
  45. package/cli-hooks/before-checkForChanges.mjs +0 -11
  46. package/color/color-common.js +16 -5
  47. package/color/color-common.js.map +1 -1
  48. package/color/color-types.js.map +1 -1
  49. package/color/color-utils.d.ts +4 -1
  50. package/color/color-utils.js +14 -9
  51. package/color/color-utils.js.map +1 -1
  52. package/color/index.android.js.map +1 -1
  53. package/color/index.ios.js.map +1 -1
  54. package/color/known-colors.js.map +1 -1
  55. package/config/config.interface.d.ts +45 -3
  56. package/config/config.interface.js.map +1 -1
  57. package/config/index.js.map +1 -1
  58. package/connectivity/index.android.js.map +1 -1
  59. package/connectivity/index.ios.js.map +1 -1
  60. package/console/index.js.map +1 -1
  61. package/core-types/animation-types.js.map +1 -1
  62. package/core-types/index.d.ts +25 -2
  63. package/core-types/index.js +23 -0
  64. package/core-types/index.js.map +1 -1
  65. package/core-types/validators.js.map +1 -1
  66. package/css/CSS3Parser.js +3 -2
  67. package/css/CSS3Parser.js.map +1 -1
  68. package/css/CSSNativeScript.js.map +1 -1
  69. package/css/css-tree-parser.js +5 -1
  70. package/css/css-tree-parser.js.map +1 -1
  71. package/css/lib/parse/index.js +5 -1
  72. package/css/lib/parse/index.js.map +1 -1
  73. package/css/parser.js +20 -3
  74. package/css/parser.js.map +1 -1
  75. package/css/reworkcss.js.map +1 -1
  76. package/css/system-classes.d.ts +9 -0
  77. package/css/system-classes.js +23 -0
  78. package/css/system-classes.js.map +1 -1
  79. package/css-mediaquery/index.d.ts +6 -1
  80. package/css-mediaquery/index.js +35 -6
  81. package/css-mediaquery/index.js.map +1 -1
  82. package/css-value/reworkcss-value.js.map +1 -1
  83. package/data/observable/index.d.ts +23 -0
  84. package/data/observable/index.js +50 -9
  85. package/data/observable/index.js.map +1 -1
  86. package/data/observable-array/index.js.map +1 -1
  87. package/data/virtual-array/index.js.map +1 -1
  88. package/debugger/InspectorBackendCommands.js.map +1 -1
  89. package/debugger/devtools-elements-interfaces.js.map +1 -1
  90. package/debugger/devtools-elements.common.js.map +1 -1
  91. package/debugger/devtools-elements.js.map +1 -1
  92. package/debugger/dom-types.js +31 -1
  93. package/debugger/dom-types.js.map +1 -1
  94. package/debugger/index.js.map +1 -1
  95. package/debugger/webinspector-css.js.map +1 -1
  96. package/debugger/webinspector-dom.js.map +1 -1
  97. package/debugger/webinspector-network.android.js.map +1 -1
  98. package/debugger/webinspector-network.d.ts +29 -0
  99. package/debugger/webinspector-network.ios.js.map +1 -1
  100. package/fetch/index.d.ts +79 -0
  101. package/fetch/index.js +408 -0
  102. package/fetch/index.js.map +1 -0
  103. package/file-system/file-system-access.android.d.ts +1 -0
  104. package/file-system/file-system-access.android.js +18 -21
  105. package/file-system/file-system-access.android.js.map +1 -1
  106. package/file-system/file-system-access.ios.js +21 -13
  107. package/file-system/file-system-access.ios.js.map +1 -1
  108. package/file-system/index.d.ts +3 -3
  109. package/file-system/index.js.map +1 -1
  110. package/fps-meter/fps-native.android.js.map +1 -1
  111. package/fps-meter/fps-native.ios.js.map +1 -1
  112. package/fps-meter/index.js.map +1 -1
  113. package/global-types.d.ts +40 -34
  114. package/globals/global-utils.d.ts +6 -1
  115. package/globals/global-utils.js +10 -5
  116. package/globals/global-utils.js.map +1 -1
  117. package/globals/index.js +22 -9
  118. package/globals/index.js.map +1 -1
  119. package/globals/polyfills/polyfill-xhr.js.map +1 -1
  120. package/globals/polyfills/utils.js +2 -0
  121. package/globals/polyfills/utils.js.map +1 -1
  122. package/http/http-interfaces.js.map +1 -1
  123. package/http/http-request/http-request-common.js.map +1 -1
  124. package/http/http-request/index.android.js +5 -1
  125. package/http/http-request/index.android.js.map +1 -1
  126. package/http/http-request/index.ios.js.map +1 -1
  127. package/http/http-request-internal/http-request-internal-common.d.ts +6 -1
  128. package/http/http-request-internal/http-request-internal-common.js +19 -0
  129. package/http/http-request-internal/http-request-internal-common.js.map +1 -1
  130. package/http/http-request-internal/index.android.d.ts +7 -1
  131. package/http/http-request-internal/index.android.js +8 -6
  132. package/http/http-request-internal/index.android.js.map +1 -1
  133. package/http/http-request-internal/index.ios.d.ts +7 -1
  134. package/http/http-request-internal/index.ios.js +34 -17
  135. package/http/http-request-internal/index.ios.js.map +1 -1
  136. package/http/index.js.map +1 -1
  137. package/image-asset/image-asset-common.js.map +1 -1
  138. package/image-asset/index.android.js.map +1 -1
  139. package/image-asset/index.ios.js.map +1 -1
  140. package/image-source/image-source-common.js.map +1 -1
  141. package/image-source/index.android.js.map +1 -1
  142. package/image-source/index.ios.js +7 -6
  143. package/image-source/index.ios.js.map +1 -1
  144. package/index.d.ts +3 -1
  145. package/index.js +1 -0
  146. package/index.js.map +1 -1
  147. package/inspector_modules.js +1 -1
  148. package/inspector_modules.js.map +1 -1
  149. package/js-libs/easysax/easysax.d.ts +49 -7
  150. package/js-libs/easysax/easysax.js +631 -747
  151. package/js-libs/easysax/easysax.js.map +1 -0
  152. package/matrix/index.js.map +1 -1
  153. package/media-query-list/index.js +57 -15
  154. package/media-query-list/index.js.map +1 -1
  155. package/module-name-resolver/helpers.d.ts +1 -1
  156. package/module-name-resolver/helpers.js.map +1 -1
  157. package/module-name-resolver/index.d.ts +2 -2
  158. package/module-name-resolver/index.js.map +1 -1
  159. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  160. package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
  161. package/native-window/index.d.ts +426 -0
  162. package/native-window/index.js +4 -0
  163. package/native-window/index.js.map +1 -0
  164. package/native-window/native-window-common.d.ts +153 -0
  165. package/native-window/native-window-common.js +340 -0
  166. package/native-window/native-window-common.js.map +1 -0
  167. package/native-window/native-window-interfaces.d.ts +186 -0
  168. package/native-window/native-window-interfaces.js +90 -0
  169. package/native-window/native-window-interfaces.js.map +1 -0
  170. package/native-window/native-window.android.d.ts +59 -0
  171. package/native-window/native-window.android.js +175 -0
  172. package/native-window/native-window.android.js.map +1 -0
  173. package/native-window/native-window.ios.d.ts +61 -0
  174. package/native-window/native-window.ios.js +218 -0
  175. package/native-window/native-window.ios.js.map +1 -0
  176. package/native-window/window-base.d.ts +111 -0
  177. package/native-window/window-base.js +91 -0
  178. package/native-window/window-base.js.map +1 -0
  179. package/package.json +3 -3
  180. package/platform/common.js.map +1 -1
  181. package/platform/device/index.android.js.map +1 -1
  182. package/platform/device/index.ios.js.map +1 -1
  183. package/platform/index.js.map +1 -1
  184. package/platform/screen/index.android.js.map +1 -1
  185. package/platform/screen/index.ios.d.ts +1 -0
  186. package/platform/screen/index.ios.js +6 -2
  187. package/platform/screen/index.ios.js.map +1 -1
  188. package/platforms/android/java/org/nativescript/widgets/BorderDrawable.java +5 -6
  189. package/platforms/android/java/org/nativescript/widgets/BoxShadowDrawable.java +0 -6
  190. package/platforms/android/java/org/nativescript/widgets/CommonLayoutParams.java +56 -0
  191. package/platforms/android/java/org/nativescript/widgets/ContentLayout.java +20 -4
  192. package/platforms/android/java/org/nativescript/widgets/CustomTransition.java +26 -9
  193. package/platforms/android/java/org/nativescript/widgets/FlexLine.java +3 -3
  194. package/platforms/android/java/org/nativescript/widgets/FlexboxLayout.java +194 -731
  195. package/platforms/android/java/org/nativescript/widgets/ImageView.java +2 -2
  196. package/platforms/android/java/org/nativescript/widgets/Utils.java +37 -9
  197. package/platforms/android/java/org/nativescript/widgets/ViewHelper.java +78 -0
  198. package/platforms/android/java/org/nativescript/widgets/image/BitmapOwner.java +1 -4
  199. package/platforms/android/java/org/nativescript/widgets/image/Worker.java +99 -76
  200. package/platforms/android/native-api-usage.json +11 -0
  201. package/platforms/ios/src/NativeScriptMainWindow.swift +72 -39
  202. package/profiling/index.js.map +1 -1
  203. package/references.d.ts +5 -2
  204. package/text/formatted-string.js.map +1 -1
  205. package/text/index.android.js.map +1 -1
  206. package/text/index.ios.js.map +1 -1
  207. package/text/span.js.map +1 -1
  208. package/text/text-common.js +1 -1
  209. package/text/text-common.js.map +1 -1
  210. package/timer/index.android.js +2 -1
  211. package/timer/index.android.js.map +1 -1
  212. package/timer/index.ios.js.map +1 -1
  213. package/trace/index.d.ts +2 -2
  214. package/trace/index.js.map +1 -1
  215. package/ui/action-bar/action-bar-common.js.map +1 -1
  216. package/ui/action-bar/index.android.js +7 -11
  217. package/ui/action-bar/index.android.js.map +1 -1
  218. package/ui/action-bar/index.d.ts +13 -1
  219. package/ui/action-bar/index.ios.js +26 -0
  220. package/ui/action-bar/index.ios.js.map +1 -1
  221. package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
  222. package/ui/activity-indicator/index.android.js.map +1 -1
  223. package/ui/activity-indicator/index.ios.js.map +1 -1
  224. package/ui/animation/animation-common.js.map +1 -1
  225. package/ui/animation/animation-interfaces.js.map +1 -1
  226. package/ui/animation/animation-shared.js.map +1 -1
  227. package/ui/animation/animation-types.js.map +1 -1
  228. package/ui/animation/index.android.js.map +1 -1
  229. package/ui/animation/index.ios.js +6 -1
  230. package/ui/animation/index.ios.js.map +1 -1
  231. package/ui/animation/keyframe-animation.d.ts +3 -1
  232. package/ui/animation/keyframe-animation.js +72 -3
  233. package/ui/animation/keyframe-animation.js.map +1 -1
  234. package/ui/builder/binding-builder.d.ts +8 -0
  235. package/ui/builder/binding-builder.js +12 -0
  236. package/ui/builder/binding-builder.js.map +1 -1
  237. package/ui/builder/component-builder/index.d.ts +7 -4
  238. package/ui/builder/component-builder/index.js +13 -7
  239. package/ui/builder/component-builder/index.js.map +1 -1
  240. package/ui/builder/index.d.ts +16 -2
  241. package/ui/builder/index.js +61 -13
  242. package/ui/builder/index.js.map +1 -1
  243. package/ui/button/button-common.js.map +1 -1
  244. package/ui/button/index.android.js +4 -3
  245. package/ui/button/index.android.js.map +1 -1
  246. package/ui/button/index.ios.js.map +1 -1
  247. package/ui/content-view/index.js +2 -0
  248. package/ui/content-view/index.js.map +1 -1
  249. package/ui/core/bindable/bindable-expressions.js.map +1 -1
  250. package/ui/core/bindable/bindable-resources.js.map +1 -1
  251. package/ui/core/bindable/bindable-types.d.ts +15 -0
  252. package/ui/core/bindable/bindable-types.js.map +1 -1
  253. package/ui/core/bindable/index.d.ts +1 -1
  254. package/ui/core/bindable/index.js +14 -8
  255. package/ui/core/bindable/index.js.map +1 -1
  256. package/ui/core/control-state-change/index.android.js.map +1 -1
  257. package/ui/core/control-state-change/index.ios.js.map +1 -1
  258. package/ui/core/properties/index.d.ts +37 -2
  259. package/ui/core/properties/index.js +205 -29
  260. package/ui/core/properties/index.js.map +1 -1
  261. package/ui/core/properties/property-shared.js +11 -2
  262. package/ui/core/properties/property-shared.js.map +1 -1
  263. package/ui/core/view/index.android.d.ts +5 -0
  264. package/ui/core/view/index.android.js +89 -15
  265. package/ui/core/view/index.android.js.map +1 -1
  266. package/ui/core/view/index.d.ts +58 -1
  267. package/ui/core/view/index.ios.d.ts +1 -0
  268. package/ui/core/view/index.ios.js +48 -11
  269. package/ui/core/view/index.ios.js.map +1 -1
  270. package/ui/core/view/view-common.d.ts +37 -0
  271. package/ui/core/view/view-common.js +81 -0
  272. package/ui/core/view/view-common.js.map +1 -1
  273. package/ui/core/view/view-helper/index.android.d.ts +1 -0
  274. package/ui/core/view/view-helper/index.android.js +8 -0
  275. package/ui/core/view/view-helper/index.android.js.map +1 -1
  276. package/ui/core/view/view-helper/index.d.ts +46 -0
  277. package/ui/core/view/view-helper/index.ios.d.ts +42 -0
  278. package/ui/core/view/view-helper/index.ios.js +170 -5
  279. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  280. package/ui/core/view/view-helper/view-helper-common.js +21 -3
  281. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  282. package/ui/core/view/view-helper/view-helper-shared.js.map +1 -1
  283. package/ui/core/view/view-interfaces.js.map +1 -1
  284. package/ui/core/view-base/index.js +75 -36
  285. package/ui/core/view-base/index.js.map +1 -1
  286. package/ui/core/view-base/utils.js.map +1 -1
  287. package/ui/core/weak-event-listener/index.js.map +1 -1
  288. package/ui/date-picker/date-picker-common.js.map +1 -1
  289. package/ui/date-picker/index.android.js +1 -1
  290. package/ui/date-picker/index.android.js.map +1 -1
  291. package/ui/date-picker/index.ios.js.map +1 -1
  292. package/ui/dialogs/dialogs-common.js.map +1 -1
  293. package/ui/dialogs/index.android.js +5 -5
  294. package/ui/dialogs/index.android.js.map +1 -1
  295. package/ui/dialogs/index.ios.js.map +1 -1
  296. package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
  297. package/ui/editable-text-base/index.android.d.ts +2 -0
  298. package/ui/editable-text-base/index.android.js +17 -7
  299. package/ui/editable-text-base/index.android.js.map +1 -1
  300. package/ui/editable-text-base/index.d.ts +8 -0
  301. package/ui/editable-text-base/index.ios.js.map +1 -1
  302. package/ui/embedding/index.android.js.map +1 -1
  303. package/ui/embedding/index.ios.js.map +1 -1
  304. package/ui/enums/enums.js.map +1 -1
  305. package/ui/enums/index.js.map +1 -1
  306. package/ui/frame/activity.android.js.map +1 -1
  307. package/ui/frame/fragment.android.js.map +1 -1
  308. package/ui/frame/fragment.ios.js.map +1 -1
  309. package/ui/frame/fragment.transitions.android.d.ts +12 -9
  310. package/ui/frame/fragment.transitions.android.js +105 -90
  311. package/ui/frame/fragment.transitions.android.js.map +1 -1
  312. package/ui/frame/fragment.transitions.types.js.map +1 -1
  313. package/ui/frame/frame-common.d.ts +14 -2
  314. package/ui/frame/frame-common.js +51 -24
  315. package/ui/frame/frame-common.js.map +1 -1
  316. package/ui/frame/frame-constants.d.ts +9 -0
  317. package/ui/frame/frame-constants.js +10 -0
  318. package/ui/frame/frame-constants.js.map +1 -0
  319. package/ui/frame/frame-helper-for-android.d.ts +2 -2
  320. package/ui/frame/frame-helper-for-android.js +14 -5
  321. package/ui/frame/frame-helper-for-android.js.map +1 -1
  322. package/ui/frame/frame-helpers.js.map +1 -1
  323. package/ui/frame/frame-interfaces.d.ts +1 -1
  324. package/ui/frame/frame-interfaces.js.map +1 -1
  325. package/ui/frame/frame-stack.d.ts +22 -1
  326. package/ui/frame/frame-stack.js +43 -5
  327. package/ui/frame/frame-stack.js.map +1 -1
  328. package/ui/frame/index.android.d.ts +2 -2
  329. package/ui/frame/index.android.js +161 -56
  330. package/ui/frame/index.android.js.map +1 -1
  331. package/ui/frame/index.d.ts +15 -5
  332. package/ui/frame/index.ios.d.ts +1 -1
  333. package/ui/frame/index.ios.js +86 -26
  334. package/ui/frame/index.ios.js.map +1 -1
  335. package/ui/gestures/gestures-common.js.map +1 -1
  336. package/ui/gestures/gestures-types.d.ts +2 -0
  337. package/ui/gestures/gestures-types.js.map +1 -1
  338. package/ui/gestures/index.android.d.ts +1 -1
  339. package/ui/gestures/index.android.js +177 -133
  340. package/ui/gestures/index.android.js.map +1 -1
  341. package/ui/gestures/index.ios.js +36 -7
  342. package/ui/gestures/index.ios.js.map +1 -1
  343. package/ui/gestures/touch-manager.d.ts +1 -2
  344. package/ui/gestures/touch-manager.js +79 -50
  345. package/ui/gestures/touch-manager.js.map +1 -1
  346. package/ui/html-view/html-view-common.js.map +1 -1
  347. package/ui/html-view/index.android.js.map +1 -1
  348. package/ui/html-view/index.ios.js.map +1 -1
  349. package/ui/image/image-common.js +1 -1
  350. package/ui/image/image-common.js.map +1 -1
  351. package/ui/image/index.android.js +14 -2
  352. package/ui/image/index.android.js.map +1 -1
  353. package/ui/image/index.ios.js.map +1 -1
  354. package/ui/image/symbol-effects-common.js.map +1 -1
  355. package/ui/image/symbol-effects.android.js.map +1 -1
  356. package/ui/image/symbol-effects.ios.js.map +1 -1
  357. package/ui/image-cache/image-cache-common.js.map +1 -1
  358. package/ui/image-cache/index.android.js +1 -2
  359. package/ui/image-cache/index.android.js.map +1 -1
  360. package/ui/image-cache/index.ios.js.map +1 -1
  361. package/ui/index.d.ts +2 -2
  362. package/ui/index.js.map +1 -1
  363. package/ui/label/index.android.js.map +1 -1
  364. package/ui/label/index.ios.js.map +1 -1
  365. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  366. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  367. package/ui/layouts/absolute-layout/index.ios.js +3 -0
  368. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  369. package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
  370. package/ui/layouts/dock-layout/index.android.js.map +1 -1
  371. package/ui/layouts/dock-layout/index.ios.js +3 -0
  372. package/ui/layouts/dock-layout/index.ios.js.map +1 -1
  373. package/ui/layouts/flexbox-layout/flexbox-layout-common.d.ts +7 -0
  374. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +18 -0
  375. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  376. package/ui/layouts/flexbox-layout/index.android.d.ts +5 -0
  377. package/ui/layouts/flexbox-layout/index.android.js +15 -0
  378. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  379. package/ui/layouts/flexbox-layout/index.d.ts +19 -1
  380. package/ui/layouts/flexbox-layout/index.ios.d.ts +2 -0
  381. package/ui/layouts/flexbox-layout/index.ios.js +246 -195
  382. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  383. package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
  384. package/ui/layouts/grid-layout/index.android.js.map +1 -1
  385. package/ui/layouts/grid-layout/index.ios.js +3 -0
  386. package/ui/layouts/grid-layout/index.ios.js.map +1 -1
  387. package/ui/layouts/index.js.map +1 -1
  388. package/ui/layouts/layout-base-common.d.ts +1 -0
  389. package/ui/layouts/layout-base-common.js +23 -1
  390. package/ui/layouts/layout-base-common.js.map +1 -1
  391. package/ui/layouts/layout-base.android.js.map +1 -1
  392. package/ui/layouts/layout-base.ios.js.map +1 -1
  393. package/ui/layouts/liquid-glass/index.android.js.map +1 -1
  394. package/ui/layouts/liquid-glass/index.ios.d.ts +0 -1
  395. package/ui/layouts/liquid-glass/index.ios.js +2 -43
  396. package/ui/layouts/liquid-glass/index.ios.js.map +1 -1
  397. package/ui/layouts/liquid-glass/liquid-glass-common.js.map +1 -1
  398. package/ui/layouts/liquid-glass-container/index.android.js.map +1 -1
  399. package/ui/layouts/liquid-glass-container/index.ios.d.ts +0 -1
  400. package/ui/layouts/liquid-glass-container/index.ios.js +2 -43
  401. package/ui/layouts/liquid-glass-container/index.ios.js.map +1 -1
  402. package/ui/layouts/liquid-glass-container/liquid-glass-container-common.js.map +1 -1
  403. package/ui/layouts/root-layout/index.android.js.map +1 -1
  404. package/ui/layouts/root-layout/index.ios.js.map +1 -1
  405. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  406. package/ui/layouts/root-layout/root-layout-stack.js.map +1 -1
  407. package/ui/layouts/stack-layout/index.android.js.map +1 -1
  408. package/ui/layouts/stack-layout/index.ios.js +3 -0
  409. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  410. package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
  411. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  412. package/ui/layouts/wrap-layout/index.ios.js +3 -0
  413. package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
  414. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  415. package/ui/list-picker/index.android.d.ts +1 -0
  416. package/ui/list-picker/index.android.js +6 -5
  417. package/ui/list-picker/index.android.js.map +1 -1
  418. package/ui/list-picker/index.ios.js.map +1 -1
  419. package/ui/list-picker/list-picker-common.js.map +1 -1
  420. package/ui/list-view/index.android.js +19 -11
  421. package/ui/list-view/index.android.js.map +1 -1
  422. package/ui/list-view/index.d.ts +47 -3
  423. package/ui/list-view/index.ios.d.ts +13 -3
  424. package/ui/list-view/index.ios.js +132 -41
  425. package/ui/list-view/index.ios.js.map +1 -1
  426. package/ui/list-view/list-view-common.d.ts +19 -0
  427. package/ui/list-view/list-view-common.js +30 -0
  428. package/ui/list-view/list-view-common.js.map +1 -1
  429. package/ui/page/events.js.map +1 -1
  430. package/ui/page/index.android.js.map +1 -1
  431. package/ui/page/index.d.ts +1 -1
  432. package/ui/page/index.ios.d.ts +3 -1
  433. package/ui/page/index.ios.js +33 -20
  434. package/ui/page/index.ios.js.map +1 -1
  435. package/ui/page/page-common.d.ts +5 -1
  436. package/ui/page/page-common.js.map +1 -1
  437. package/ui/placeholder/index.android.js.map +1 -1
  438. package/ui/placeholder/index.js.map +1 -1
  439. package/ui/placeholder/placeholder-common.js.map +1 -1
  440. package/ui/progress/index.android.js.map +1 -1
  441. package/ui/progress/index.ios.js.map +1 -1
  442. package/ui/progress/progress-common.js.map +1 -1
  443. package/ui/proxy-view-container/index.js.map +1 -1
  444. package/ui/repeater/index.d.ts +2 -1
  445. package/ui/repeater/index.js.map +1 -1
  446. package/ui/scroll-view/index.android.d.ts +2 -1
  447. package/ui/scroll-view/index.android.js +4 -1
  448. package/ui/scroll-view/index.android.js.map +1 -1
  449. package/ui/scroll-view/index.d.ts +53 -0
  450. package/ui/scroll-view/index.ios.d.ts +13 -1
  451. package/ui/scroll-view/index.ios.js +100 -20
  452. package/ui/scroll-view/index.ios.js.map +1 -1
  453. package/ui/scroll-view/scroll-view-common.d.ts +13 -0
  454. package/ui/scroll-view/scroll-view-common.js +27 -0
  455. package/ui/scroll-view/scroll-view-common.js.map +1 -1
  456. package/ui/search-bar/index.android.js +2 -2
  457. package/ui/search-bar/index.android.js.map +1 -1
  458. package/ui/search-bar/index.ios.js.map +1 -1
  459. package/ui/search-bar/search-bar-common.js.map +1 -1
  460. package/ui/segmented-bar/index.android.js +8 -8
  461. package/ui/segmented-bar/index.android.js.map +1 -1
  462. package/ui/segmented-bar/index.ios.js.map +1 -1
  463. package/ui/segmented-bar/segmented-bar-common.d.ts +5 -1
  464. package/ui/segmented-bar/segmented-bar-common.js +6 -1
  465. package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
  466. package/ui/slider/index.android.js +1 -2
  467. package/ui/slider/index.android.js.map +1 -1
  468. package/ui/slider/index.ios.js.map +1 -1
  469. package/ui/slider/slider-common.js.map +1 -1
  470. package/ui/split-view/index.android.js.map +1 -1
  471. package/ui/split-view/index.ios.js.map +1 -1
  472. package/ui/split-view/split-view-common.js.map +1 -1
  473. package/ui/styling/background-common.d.ts +2 -0
  474. package/ui/styling/background-common.js +10 -2
  475. package/ui/styling/background-common.js.map +1 -1
  476. package/ui/styling/background.android.d.ts +4 -1
  477. package/ui/styling/background.android.js +5 -2
  478. package/ui/styling/background.android.js.map +1 -1
  479. package/ui/styling/background.d.ts +2 -2
  480. package/ui/styling/background.ios.d.ts +1 -1
  481. package/ui/styling/background.ios.js +10 -3
  482. package/ui/styling/background.ios.js.map +1 -1
  483. package/ui/styling/box-shadow.js.map +1 -1
  484. package/ui/styling/clip-path-function.js.map +1 -1
  485. package/ui/styling/converters.js.map +1 -1
  486. package/ui/styling/css-animation-parser.js.map +1 -1
  487. package/ui/styling/css-selector.d.ts +60 -13
  488. package/ui/styling/css-selector.js +311 -50
  489. package/ui/styling/css-selector.js.map +1 -1
  490. package/ui/styling/css-shadow.js.map +1 -1
  491. package/ui/styling/css-stroke.js.map +1 -1
  492. package/ui/styling/css-transform.js.map +1 -1
  493. package/ui/styling/css-utils.d.ts +16 -0
  494. package/ui/styling/css-utils.js +121 -7
  495. package/ui/styling/css-utils.js.map +1 -1
  496. package/ui/styling/font-common.js.map +1 -1
  497. package/ui/styling/font-interfaces.js.map +1 -1
  498. package/ui/styling/font.android.js.map +1 -1
  499. package/ui/styling/font.ios.js.map +1 -1
  500. package/ui/styling/length-shared.d.ts +2 -0
  501. package/ui/styling/length-shared.js +29 -2
  502. package/ui/styling/length-shared.js.map +1 -1
  503. package/ui/styling/linear-gradient.js.map +1 -1
  504. package/ui/styling/style/index.d.ts +29 -2
  505. package/ui/styling/style/index.js +1 -0
  506. package/ui/styling/style/index.js.map +1 -1
  507. package/ui/styling/style-properties.d.ts +5 -0
  508. package/ui/styling/style-properties.js +172 -101
  509. package/ui/styling/style-properties.js.map +1 -1
  510. package/ui/styling/style-scope.d.ts +24 -3
  511. package/ui/styling/style-scope.js +461 -63
  512. package/ui/styling/style-scope.js.map +1 -1
  513. package/ui/styling/styling-profile.js.map +1 -1
  514. package/ui/styling/styling-shared.js.map +1 -1
  515. package/ui/switch/index.android.js +1 -1
  516. package/ui/switch/index.android.js.map +1 -1
  517. package/ui/switch/index.ios.js +5 -1
  518. package/ui/switch/index.ios.js.map +1 -1
  519. package/ui/switch/switch-common.js.map +1 -1
  520. package/ui/tab-view/index.android.js +13 -17
  521. package/ui/tab-view/index.android.js.map +1 -1
  522. package/ui/tab-view/index.d.ts +5 -3
  523. package/ui/tab-view/index.ios.d.ts +2 -1
  524. package/ui/tab-view/index.ios.js +83 -20
  525. package/ui/tab-view/index.ios.js.map +1 -1
  526. package/ui/tab-view/tab-view-common.d.ts +6 -1
  527. package/ui/tab-view/tab-view-common.js +17 -1
  528. package/ui/tab-view/tab-view-common.js.map +1 -1
  529. package/ui/text-base/formatted-string.js.map +1 -1
  530. package/ui/text-base/index.android.js +6 -9
  531. package/ui/text-base/index.android.js.map +1 -1
  532. package/ui/text-base/index.ios.d.ts +3 -0
  533. package/ui/text-base/index.ios.js +26 -4
  534. package/ui/text-base/index.ios.js.map +1 -1
  535. package/ui/text-base/span.js.map +1 -1
  536. package/ui/text-base/text-base-common.js.map +1 -1
  537. package/ui/text-field/index.android.js.map +1 -1
  538. package/ui/text-field/index.ios.js +13 -5
  539. package/ui/text-field/index.ios.js.map +1 -1
  540. package/ui/text-field/text-field-common.js.map +1 -1
  541. package/ui/text-view/index.android.js.map +1 -1
  542. package/ui/text-view/index.ios.js.map +1 -1
  543. package/ui/text-view/text-view-common.js.map +1 -1
  544. package/ui/time-picker/index.android.js +1 -1
  545. package/ui/time-picker/index.android.js.map +1 -1
  546. package/ui/time-picker/index.ios.js.map +1 -1
  547. package/ui/time-picker/time-picker-common.js.map +1 -1
  548. package/ui/transition/fade-transition.android.js.map +1 -1
  549. package/ui/transition/fade-transition.ios.js.map +1 -1
  550. package/ui/transition/flip-transition.android.js.map +1 -1
  551. package/ui/transition/index.android.js.map +1 -1
  552. package/ui/transition/index.d.ts +2 -1
  553. package/ui/transition/index.ios.js.map +1 -1
  554. package/ui/transition/modal-transition.android.js.map +1 -1
  555. package/ui/transition/modal-transition.ios.js +33 -5
  556. package/ui/transition/modal-transition.ios.js.map +1 -1
  557. package/ui/transition/page-transition.android.d.ts +4 -0
  558. package/ui/transition/page-transition.android.js +171 -86
  559. package/ui/transition/page-transition.android.js.map +1 -1
  560. package/ui/transition/page-transition.ios.d.ts +5 -0
  561. package/ui/transition/page-transition.ios.js +298 -36
  562. package/ui/transition/page-transition.ios.js.map +1 -1
  563. package/ui/transition/shared-transition-helper.android.d.ts +3 -0
  564. package/ui/transition/shared-transition-helper.android.js +9 -0
  565. package/ui/transition/shared-transition-helper.android.js.map +1 -1
  566. package/ui/transition/shared-transition-helper.d.ts +7 -0
  567. package/ui/transition/shared-transition-helper.ios.d.ts +48 -0
  568. package/ui/transition/shared-transition-helper.ios.js +977 -95
  569. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  570. package/ui/transition/shared-transition.d.ts +134 -0
  571. package/ui/transition/shared-transition.js +90 -2
  572. package/ui/transition/shared-transition.js.map +1 -1
  573. package/ui/transition/slide-transition.android.js.map +1 -1
  574. package/ui/transition/slide-transition.ios.js.map +1 -1
  575. package/ui/utils.android.js.map +1 -1
  576. package/ui/utils.d.ts +2 -0
  577. package/ui/utils.ios.js.map +1 -1
  578. package/ui/web-view/index.android.js +1 -1
  579. package/ui/web-view/index.android.js.map +1 -1
  580. package/ui/web-view/index.ios.js.map +1 -1
  581. package/ui/web-view/web-view-common.js.map +1 -1
  582. package/ui/web-view/web-view-interfaces.js.map +1 -1
  583. package/utils/android-runtime-version.d.ts +12 -0
  584. package/utils/android-runtime-version.js +36 -0
  585. package/utils/android-runtime-version.js.map +1 -0
  586. package/utils/animation-helpers.js.map +1 -1
  587. package/utils/common.js.map +1 -1
  588. package/utils/constants.android.js.map +1 -1
  589. package/utils/constants.ios.js.map +1 -1
  590. package/utils/debug-source.js.map +1 -1
  591. package/utils/debug.js.map +1 -1
  592. package/utils/index.android.js.map +1 -1
  593. package/utils/index.ios.js.map +1 -1
  594. package/utils/layout-helper/index.android.js.map +1 -1
  595. package/utils/layout-helper/index.ios.js +11 -3
  596. package/utils/layout-helper/index.ios.js.map +1 -1
  597. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  598. package/utils/layout-helper/layout-helper-shared.js.map +1 -1
  599. package/utils/lazy.js.map +1 -1
  600. package/utils/macrotask-scheduler.js.map +1 -1
  601. package/utils/mainthread-helper.android.js.map +1 -1
  602. package/utils/mainthread-helper.ios.js.map +1 -1
  603. package/utils/module-merge.js.map +1 -1
  604. package/utils/native-helper-for-android.js +9 -3
  605. package/utils/native-helper-for-android.js.map +1 -1
  606. package/utils/native-helper.android.d.ts +66 -2
  607. package/utils/native-helper.android.js.map +1 -1
  608. package/utils/native-helper.d.ts +2 -2
  609. package/utils/native-helper.ios.d.ts +52 -2
  610. package/utils/native-helper.ios.js +35 -5
  611. package/utils/native-helper.ios.js.map +1 -1
  612. package/utils/native-helper.types.d.ts +2 -0
  613. package/utils/number-utils.js.map +1 -1
  614. package/utils/platform-check.d.ts +1 -1
  615. package/utils/platform-check.js.map +1 -1
  616. package/utils/shared.js.map +1 -1
  617. package/utils/types.js.map +1 -1
  618. package/utils/utils-shared.js.map +1 -1
  619. package/wgc/atob.js.map +1 -1
  620. package/wgc/btoa.js.map +1 -1
  621. package/wgc/crypto/SubtleCrypto.js.map +1 -1
  622. package/wgc/crypto/index.d.ts +1 -1
  623. package/wgc/crypto/index.js +12 -8
  624. package/wgc/crypto/index.js.map +1 -1
  625. package/wgc/index.js.map +1 -1
  626. package/xhr/index.d.ts +5 -4
  627. package/xhr/index.js +18 -18
  628. package/xhr/index.js.map +1 -1
  629. package/xml/index.d.ts +2 -2
  630. package/xml/index.js +1 -1
  631. package/xml/index.js.map +1 -1
  632. package/LICENSE +0 -19
  633. package/fetch/index.mjs +0 -535
@@ -1,784 +1,668 @@
1
-  /*
2
- new function() {
3
- var parser = new EasySAXParser();
4
-
5
- parser.ns('rss', { // or false
6
- rss: 'http://purl.org/rss/1.0/',
7
- atom: 'http://www.w3.org/2005/Atom',
8
- xhtml: 'http://www.w3.org/1999/xhtml',
9
- media: 'http://search.yahoo.com/mrss/'
10
- });
11
-
12
-
13
- parser.on('error', function(msg) {
14
- //console.log(msg)
15
- });
16
-
17
- parser.on('startNode', function(elem, attr, uq, tagend, getStrNode) {
18
- attr();
19
- return;
20
- if (tagend) {
21
- console.log(' '+str)
22
- } else {
23
- console.log('+ '+str)
24
- };
25
- });
26
-
27
- parser.on('endNode', function(elem, uq, tagstart, str) {
28
- return;
29
- if (!tagstart) console.log('- ' + str)
30
- });
31
-
32
- parser.on('textNode', function(s, uq) {
33
- uq(s);
34
- return
35
- console.log(' '+s)
36
- });
37
-
38
- parser.on('cdata', function(data) {
39
- });
40
-
41
-
42
- parser.on('comment', function(text) {
43
- //console.log('--'+text+'--')
44
- });
45
-
46
- //parser.on('question', function() {}); // <? ... ?>
47
- //parser.on('attention', function() {}); // <!XXXXX zzzz="eeee">
48
-
49
- console.time('easysax');
50
- for(var z=1000;z--;) {
51
- parser.parse(xml)
52
- };
53
- console.timeEnd('easysax');
54
- };
55
-
56
-
57
- */
58
-
59
- // << ------------------------------------------------------------------------ >> //
60
-
61
-
62
- // if (typeof exports === 'object' /*&& this == exports*/) {
63
- // module.exports.EasySAXParser = EasySAXParser;
64
- // };
65
-
66
- function EasySAXParser() {
67
- 'use strict';
68
-
69
- if (!this) return null;
70
-
71
- this.angularSyntax = false;
72
-
73
- function nullFunc() {};
74
-
75
- this.onTextNode = nullFunc;
76
- this.onStartNode = nullFunc;
77
- this.onEndNode = nullFunc;
78
- this.onCDATA = nullFunc;
79
- this.onError = nullFunc;
80
- this.onComment = null;
81
- this.onQuestion = null;
82
- this.onAttention = null;
83
- this.is_onComment = this.is_onQuestion = this.is_onAttention = false;
84
-
85
- this.isNamespace = false;
86
- this.useNS = null;
87
- this.default_xmlns = null;
88
- this.xmlns = null;
89
- this.nsmatrix = {xmlns: this.xmlns};
90
- this.hasSurmiseNS = false;
91
- ;
92
-
93
-
94
- this.attr_string = ''; // строка атрибутов
95
- this.attr_posstart = 0; //
96
- this.attr_res; // закешированный результат разбора атрибутов , null - разбор не проводился, object - хеш атрибутов, true - нет атрибутов, false - невалидный xml
1
+ // easysax 0.1.14, https://github.com/vflash/easysax
2
+ // Copyright (c) 2012 Vopilovskii Constantine, MIT License (see LICENSE in this folder).
3
+ function nullFunc() { }
4
+ // Clearing these handlers with `null` throws in easysax 0.1.14 (its fallback is out of scope there).
5
+ function handlerOrThrow(cb) {
6
+ if (!cb) {
7
+ throw new ReferenceError('nullFunc is not defined');
8
+ }
9
+ return cb;
97
10
  }
98
-
99
- EasySAXParser.prototype.on = function(name, cb) {
100
- if (typeof cb !== 'function') {
101
- if (cb !== null) return;
102
- };
103
-
104
- switch(name) {
105
- case 'error': this.onError = cb || nullFunc; break;
106
- case 'startNode': this.onStartNode = cb || nullFunc; break;
107
- case 'endNode': this.onEndNode = cb || nullFunc; break;
108
- case 'textNode': this.onTextNode = cb || nullFunc; break;
109
- case 'cdata': this.onCDATA = cb || nullFunc; break;
110
-
111
- case 'comment': this.onComment = cb; this.is_onComment = !!cb; break;
112
- case 'question': this.onQuestion = cb; this.is_onQuestion = !!cb; break; // <? .... ?>
113
- case 'attention': this.onAttention = cb; this.is_onAttention = !!cb; break; // <!XXXXX zzzz="eeee">
114
- };
115
- };
116
-
117
- EasySAXParser.prototype.ns = function(root, ns) {
118
- if (!root || typeof root !== 'string' || !ns) {
119
- return;
120
- };
121
-
122
- var u, x = {}, ok, v, i;
123
-
124
- for(i in ns) {
125
- v = ns[i];
126
- if (typeof v === 'string') {
127
- if (root === v) ok = true;
128
- x[i] = v;
129
- };
130
- };
131
-
132
- if (ok) {
133
- this.isNamespace = true;
134
- this.default_xmlns = root;
135
- this.useNS = x;
136
- };
11
+ // Shadows Object.prototype's names so `&constructor;` and friends decode to '\x01' instead of a builtin.
12
+ const xharsQuot = {
13
+ constructor: '',
14
+ hasOwnProperty: '',
15
+ isPrototypeOf: '',
16
+ propertyIsEnumerable: '',
17
+ toLocaleString: '',
18
+ toString: '',
19
+ valueOf: '',
20
+ quot: '"',
21
+ QUOT: '"',
22
+ amp: '&',
23
+ AMP: '&',
24
+ nbsp: '\u00A0',
25
+ apos: "'",
26
+ lt: '<',
27
+ LT: '<',
28
+ gt: '>',
29
+ GT: '>',
30
+ copy: '\u00A9',
31
+ laquo: '\u00AB',
32
+ raquo: '\u00BB',
33
+ reg: '\u00AE',
34
+ deg: '\u00B0',
35
+ plusmn: '\u00B1',
36
+ sup2: '\u00B2',
37
+ sup3: '\u00B3',
38
+ micro: '\u00B5',
39
+ para: '\u00B6',
137
40
  };
138
-
139
-
140
- EasySAXParser.prototype.parse = function(xml) {
141
- if (typeof xml !== 'string') {
142
- return;
143
- };
144
-
145
- if (this.isNamespace) {
146
- this.nsmatrix = {xmlns: this.default_xmlns};
147
-
148
- parse(xml);
149
-
150
- this.nsmatrix = false;
151
-
152
- } else {
153
- parse(xml);
154
- };
155
-
156
- this.attr_res = true;
157
- };
158
-
159
- // -----------------------------------------------------
160
-
161
- var xharsQuot={constructor: false, hasOwnProperty: false, isPrototypeOf: false, propertyIsEnumerable: false, toLocaleString: false, toString: false, valueOf: false
162
- , quot: '"'
163
- , QUOT: '"'
164
- , amp: '&'
165
- , AMP: '&'
166
- , nbsp: '\u00A0'
167
- , apos: '\''
168
- , lt: '<'
169
- , LT: '<'
170
- , gt: '>'
171
- , GT: '>'
172
- , copy: '\u00A9'
173
- , laquo: '\u00AB'
174
- , raquo: '\u00BB'
175
- , reg: '\u00AE'
176
- , deg: '\u00B0'
177
- , plusmn: '\u00B1'
178
- , sup2: '\u00B2'
179
- , sup3: '\u00B3'
180
- , micro: '\u00B5'
181
- , para: '\u00B6'
182
- };
183
-
184
-
185
41
  function rpEntities(s, d, x, z) {
186
42
  if (z) {
187
43
  return xharsQuot[z] || '\x01';
188
- };
189
-
44
+ }
190
45
  if (d) {
191
- return String.fromCodePoint(d);
192
- };
193
-
46
+ return String.fromCodePoint(Number(d));
47
+ }
194
48
  return String.fromCodePoint(parseInt(x, 16));
195
- };
196
-
197
- function unEntities(s, i) {
198
- s = String(s);
49
+ }
50
+ function unEntities(value) {
51
+ let s = String(value);
199
52
  if (s.length > 3 && s.indexOf('&') !== -1) {
200
- if (s.indexOf('&gt;') !== -1) s = s.replace(/&gt;/g, '>');
201
- if (s.indexOf('&lt;') !== -1) s = s.replace(/&lt;/g, '<');
202
- if (s.indexOf('&quot;') !== -1) s = s.replace(/&quot;/g, '"');
203
-
53
+ if (s.indexOf('&gt;') !== -1)
54
+ s = s.replace(/&gt;/g, '>');
55
+ if (s.indexOf('&lt;') !== -1)
56
+ s = s.replace(/&lt;/g, '<');
57
+ if (s.indexOf('&quot;') !== -1)
58
+ s = s.replace(/&quot;/g, '"');
204
59
  if (s.indexOf('&') !== -1) {
205
- s = s.replace(/&#(\d+);|&#x([0123456789abcdef]+);|&(\w+);/ig, rpEntities);
206
- };
207
- };
208
-
60
+ s = s.replace(/&#(\d+);|&#x([0123456789abcdef]+);|&(\w+);/gi, rpEntities);
61
+ }
62
+ }
209
63
  return s;
210
- };
211
-
212
-
213
- EasySAXParser.prototype.allowedAngularAttributeChars = function(w) {
214
- if (!this.angularSyntax) {
215
- return false;
216
- } else {
217
- return (
218
- w === 40 || // (
219
- w === 41 || // )
220
- w === 91 || // [
221
- w === 93 || // ]
222
- w === 94 || // ^
223
- w === 35 // #
224
- );
64
+ }
65
+ export class EasySAXParser {
66
+ constructor() {
67
+ this.angularSyntax = false;
68
+ this.onTextNode = nullFunc;
69
+ this.onStartNode = nullFunc;
70
+ this.onEndNode = nullFunc;
71
+ this.onCDATA = nullFunc;
72
+ this.onError = nullFunc;
73
+ this.onComment = null;
74
+ this.onQuestion = null;
75
+ this.onAttention = null;
76
+ this.is_onComment = false;
77
+ this.is_onQuestion = false;
78
+ this.is_onAttention = false;
79
+ this.isNamespace = false;
80
+ this.useNS = null;
81
+ this.default_xmlns = null;
82
+ this.xmlns = null;
83
+ // Not reset between parse() calls: a parse that stops inside a namespaced element leaves its scope behind.
84
+ this.nsmatrix = { xmlns: this.xmlns };
85
+ // Set while the start tag is pre-scanned for xmlns declarations, so getAttrs() applies them first.
86
+ this.hasSurmiseNS = false;
87
+ this.attr_string = '';
88
+ this.attr_posstart = 0;
225
89
  }
226
- };
227
-
228
- /*
229
- парсит атрибуты по требованию. Важно! - функция не генерирует исключения.
230
-
231
- если была ошибка разбора возврашается false
232
- если атрибутов нет и разбор удачен то возврашается true
233
- если есть атрибуты то возврашается обьект(хеш)
234
- */
235
-
236
- EasySAXParser.prototype.getAttrs = function() {
237
- if (this.attr_res !== null) {
238
- return this.attr_res;
239
- };
240
-
241
- /*
242
- if (xxtest !== u && attr_string.indexOf(xxtest) === -1) {
243
- / *
244
- // для ускорения
245
- if (getAttrs('html').type == 'html') {
246
- ...
247
- };
248
- * /
249
- return true;
250
- };
251
- */
252
-
253
- var u
254
- , res = {}
255
- , s = this.attr_string
256
- , i = this.attr_posstart
257
- , l = s.length
258
- , attr_list = this.hasSurmiseNS ? [] : false
259
- , name, value = ''
260
- , ok = false
261
- , noValueAttribute = false
262
- , j, w, nn, n
263
- , hasNewMatrix
264
- , alias, newalias
265
- ;
266
-
267
- aa:
268
- for(; i < l; i++) {
269
- w = s.charCodeAt(i);
270
-
271
- if (w===32 || (w<14 && w > 8) ) { // \f\n\r\t\v
272
- continue
273
- };
274
-
275
- // Check for valid attribute start char
276
- if ((w < 65 && !this.allowedAngularAttributeChars(w)) ||
277
- w > 122 || (w > 90 && w < 97 && !this.allowedAngularAttributeChars(w)) ) { // ожидаем символ
278
- return this.attr_res = false; // error. invalid char
279
- };
280
-
281
- for(j = i + 1; j < l; j++) { // проверяем все символы имени атрибута
282
- w = s.charCodeAt(j);
283
-
284
- if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
285
- if (noValueAttribute) {
286
- j--; //Started next attribute. Get back and break out of the loop.
287
- break;
288
- } else {
289
- continue;
290
- }
291
- };
292
-
293
- if (this.allowedAngularAttributeChars(w)) {
294
- continue;
295
- }
296
-
297
- if (w === 32 || (w > 8 && w < 14) ) { // \f\n\r\t\v пробел
298
- noValueAttribute = true;
299
- continue;
300
- } else if (w === 61) { // "=" == 61
301
- noValueAttribute = false;
90
+ on(name, cb) {
91
+ if (typeof cb !== 'function') {
92
+ if (cb !== null)
93
+ return;
94
+ }
95
+ switch (name) {
96
+ case 'error':
97
+ this.onError = handlerOrThrow(cb);
302
98
  break;
303
- } else {
304
- //console.log('error 2');
305
- if (!noValueAttribute)
306
- return this.attr_res = false; // error. invalid char
307
- };
308
-
309
- break;
310
- };
311
-
312
- name = s.substring(i, j).trim();
313
- ok = true;
314
-
315
- if (name === 'xmlns:xmlns') {
316
- //console.log('error 6')
317
- return this.attr_res = false; // error. invalid name
318
- };
319
-
320
- w = s.charCodeAt(j+1);
321
-
322
- while (w = s.charCodeAt(j+1)) {
323
- if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
324
- j++;
325
- } else {
99
+ case 'startNode':
100
+ this.onStartNode = handlerOrThrow(cb);
101
+ break;
102
+ case 'endNode':
103
+ this.onEndNode = handlerOrThrow(cb);
104
+ break;
105
+ case 'textNode':
106
+ this.onTextNode = handlerOrThrow(cb);
107
+ break;
108
+ case 'cdata':
109
+ this.onCDATA = handlerOrThrow(cb);
110
+ break;
111
+ case 'comment':
112
+ this.onComment = cb;
113
+ this.is_onComment = !!cb;
114
+ break;
115
+ // <? ... ?>
116
+ case 'question':
117
+ this.onQuestion = cb;
118
+ this.is_onQuestion = !!cb;
119
+ break;
120
+ // <!XXXXX zzzz="eeee">
121
+ case 'attention':
122
+ this.onAttention = cb;
123
+ this.is_onAttention = !!cb;
326
124
  break;
125
+ }
126
+ }
127
+ /**
128
+ * Enables namespace resolution. `ns` maps namespace URIs to aliases; `root` must be one of the aliases.
129
+ * Elements outside a known namespace, and everything inside them, emit no events.
130
+ */
131
+ ns(root, ns) {
132
+ if (!root || typeof root !== 'string' || !ns) {
133
+ return;
134
+ }
135
+ const x = {};
136
+ let ok = false;
137
+ for (const i in ns) {
138
+ const v = ns[i];
139
+ if (typeof v === 'string') {
140
+ if (root === v)
141
+ ok = true;
142
+ x[i] = v;
327
143
  }
328
144
  }
329
-
330
- if (!noValueAttribute) {
331
- if (w === 34) { // '"'
332
- j = s.indexOf('"', i = j+2 );
333
-
334
- } else {
335
- if (w === 39) {
336
- j = s.indexOf('\'', i = j+2 );
337
-
338
- } else { // "'"
339
- return this.attr_res = false; // error. invalid char
340
- };
341
- };
145
+ if (ok) {
146
+ this.isNamespace = true;
147
+ this.default_xmlns = root;
148
+ this.useNS = x;
342
149
  }
343
-
344
- if (j === -1) {
345
- //console.log('error 4')
346
- return this.attr_res = false; // error. invalid char
347
- };
348
-
349
-
350
- if (j+1 < l && !noValueAttribute) {
351
- w = s.charCodeAt(j+1);
352
-
353
- if (w > 32 || w < 9 || (w < 32 && w > 13)) {
354
- // error. invalid char
355
- //console.log('error 5')
356
- return this.attr_res = false;
357
- };
358
- };
359
-
360
-
361
- if (noValueAttribute) {
362
- value = '';
363
- } else {
364
- value = s.substring(i, j);
150
+ }
151
+ allowedAngularAttributeChars(w) {
152
+ if (!this.angularSyntax) {
153
+ return false;
365
154
  }
366
-
367
- //i = j + 1; // след. семвол уже проверен потому проверять нужно следуюший
368
- i = j; // след. семвол уже проверен потому проверять нужно следуюший
369
-
370
- if (this.isNamespace) { //
371
- if (this.hasSurmiseNS) {
372
- // есть подозрение что в атрибутах присутствует xmlns
373
-
374
- if (newalias = name === 'xmlns' ? 'xmlns' : name.charCodeAt(0) === 120 && name.substr(0, 6) === 'xmlns:' && name.substr(6) ) {
375
- alias = this.useNS[unEntities(value)];
376
-
377
- if (alias) {
378
- if (this.nsmatrix[newalias] !== alias) {
379
- if (!hasNewMatrix) {
380
- hasNewMatrix = true;
381
- nn = {}; for (n in this.nsmatrix) nn[n] = this.nsmatrix[n];
382
- this.nsmatrix = nn;
383
- };
384
-
385
- this.nsmatrix[newalias] = alias;
386
- };
387
- } else {
388
- if (this.nsmatrix[newalias]) {
389
- if (!hasNewMatrix) {
390
- hasNewMatrix = true;
391
- nn = {}; for (n in this.nsmatrix) nn[n] = this.nsmatrix[n];
392
- this.nsmatrix = nn;
393
- };
394
-
395
- this.nsmatrix[newalias] = false;
396
- };
397
- };
398
-
399
- res[name] = value;
400
- continue;
401
- };
402
-
403
- attr_list.push(name, value);
404
- continue;
405
- };
406
-
407
- w = name.length;
408
- while(--w) {
409
- if (name.charCodeAt(w) === 58) { // ':'
410
- if (w = this.nsmatrix[name.substring(0, w)] ) {
411
- res[w + name.substr(w)] = value;
412
- };
413
- continue aa;
414
-
415
- // 'xml:base' ???
416
- };
417
- };
418
- };
419
-
420
- res[name] = value;
421
- noValueAttribute = false;
422
- };
423
-
424
-
425
- if (!ok) {
426
- return this.attr_res = true; // атрибутов нет, ошибок тоже нет
427
- };
428
-
429
-
430
- if (this.hasSurmiseNS) {
431
- bb:
432
-
433
- for (i = 0, l = attr_list.length; i < l; i++) {
434
- name = attr_list[i++];
435
-
436
- w = name.length;
437
- while(--w) { // name.indexOf(':')
438
- if (name.charCodeAt(w) === 58) { // ':'
439
- if (w = this.nsmatrix[name.substring(0, w)]) {
440
- res[w + name.substr(w)] = attr_list[i];
441
- };
442
- continue bb;
443
- break;
444
- };
445
- };
446
-
447
- res[name] = attr_list[i];
448
- };
449
- };
450
-
451
- return this.attr_res = res;
452
- };
453
-
454
-
455
- // xml - string
456
- EasySAXParser.prototype.parse = function(xml) {
457
- var u
458
- , xml = String(xml)
459
- , nodestack = []
460
- , stacknsmatrix = []
461
- //, string_node
462
- , elem
463
- , tagend = false
464
- , tagstart = false
465
- , j = 0, i = 0, k = 0, len
466
- , x, y, q, w
467
- , xmlns
468
- , stopIndex = 0
469
- , stop // используется при разборе "namespace" . если встретился неизвестное пространство то события не генерируются
470
- , _nsmatrix
471
- , ok
472
- , pos = 0, ln = 0, lnStart = -2, lnEnd = -1
473
- ;
474
-
475
- len = xml.length;
476
- function getStringNode() {
477
- return xml.substring(i, j+1)
478
- };
479
- function findLineAndColumnFromPos() {
480
- while (lnStart < lnEnd && lnEnd < pos) {
481
- lnStart = lnEnd;
482
- lnEnd = xml.indexOf("\n", lnEnd + 1);
483
- ++ln;
155
+ else {
156
+ return (w === 40 || // (
157
+ w === 41 || // )
158
+ w === 91 || // [
159
+ w === 93 || // ]
160
+ w === 94 || // ^
161
+ w === 35 // #
162
+ );
484
163
  }
485
- return { line: ln, column: pos - lnStart };
486
164
  }
487
- function position(p) {
488
- pos = p;
489
- return findLineAndColumnFromPos;
165
+ copyNsMatrix() {
166
+ const nn = {};
167
+ for (const n in this.nsmatrix)
168
+ nn[n] = this.nsmatrix[n];
169
+ return nn;
490
170
  }
491
-
492
- while(j !== -1) {
493
- stop = stopIndex > 0;
494
-
495
- if (xml.charCodeAt(j) === 60) { // "<"
171
+ /**
172
+ * Parses the current tag's attributes on demand, caching the result. Never throws:
173
+ * returns false on a parse error, true when there are no attributes, otherwise the hash.
174
+ */
175
+ getAttrs() {
176
+ if (this.attr_res !== null) {
177
+ return this.attr_res;
178
+ }
179
+ const res = {};
180
+ const s = this.attr_string;
181
+ let i = this.attr_posstart;
182
+ const l = s.length;
183
+ const attr_list = [];
184
+ let name = '';
185
+ let value = '';
186
+ let ok = false;
187
+ let noValueAttribute = false;
188
+ let j = 0;
189
+ let w = 0;
190
+ let c = 0;
191
+ let prefixed = false;
192
+ let hasNewMatrix = false;
193
+ let alias = null;
194
+ let newalias = '';
195
+ for (; i < l; i++) {
196
+ w = s.charCodeAt(i);
197
+ if (w === 32 || (w < 14 && w > 8)) {
198
+ // \f\n\r\t\v
199
+ continue;
200
+ }
201
+ if ((w < 65 && !this.allowedAngularAttributeChars(w)) || w > 122 || (w > 90 && w < 97 && !this.allowedAngularAttributeChars(w))) {
202
+ this.attr_res = false;
203
+ return false;
204
+ }
205
+ for (j = i + 1; j < l; j++) {
206
+ w = s.charCodeAt(j);
207
+ if ((w > 96 && w < 123) || (w > 64 && w < 91) || (w > 47 && w < 59) || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
208
+ if (noValueAttribute) {
209
+ // The next attribute has started: step back so the outer loop picks it up.
210
+ j--;
211
+ break;
212
+ }
213
+ else {
214
+ continue;
215
+ }
216
+ }
217
+ if (this.allowedAngularAttributeChars(w)) {
218
+ continue;
219
+ }
220
+ if (w === 32 || (w > 8 && w < 14)) {
221
+ noValueAttribute = true;
222
+ continue;
223
+ }
224
+ else if (w === 61) {
225
+ // "="
226
+ noValueAttribute = false;
227
+ break;
228
+ }
229
+ else {
230
+ if (!noValueAttribute) {
231
+ this.attr_res = false;
232
+ return false;
233
+ }
234
+ }
235
+ break;
236
+ }
237
+ name = s.substring(i, j).trim();
238
+ ok = true;
239
+ if (name === 'xmlns:xmlns') {
240
+ this.attr_res = false;
241
+ return false;
242
+ }
243
+ w = s.charCodeAt(j + 1);
244
+ while (w === 32 || (w > 8 && w < 14)) {
245
+ j++;
246
+ w = s.charCodeAt(j + 1);
247
+ }
248
+ if (!noValueAttribute) {
249
+ if (w === 34) {
250
+ // '"'
251
+ i = j + 2;
252
+ j = s.indexOf('"', i);
253
+ }
254
+ else if (w === 39) {
255
+ // "'"
256
+ i = j + 2;
257
+ j = s.indexOf("'", i);
258
+ }
259
+ else {
260
+ this.attr_res = false;
261
+ return false;
262
+ }
263
+ }
264
+ if (j === -1) {
265
+ this.attr_res = false;
266
+ return false;
267
+ }
268
+ if (j + 1 < l && !noValueAttribute) {
269
+ w = s.charCodeAt(j + 1);
270
+ if (w > 32 || w < 9 || (w < 32 && w > 13)) {
271
+ this.attr_res = false;
272
+ return false;
273
+ }
274
+ }
275
+ if (noValueAttribute) {
276
+ value = '';
277
+ }
278
+ else {
279
+ value = s.substring(i, j);
280
+ }
281
+ // The character after j was checked above, so the loop's i++ resumes past it.
496
282
  i = j;
497
- } else {
498
- i = xml.indexOf('<', j);
283
+ if (this.isNamespace) {
284
+ if (this.hasSurmiseNS) {
285
+ // Pre-scan: apply xmlns declarations first, resolve the other names after the loop.
286
+ newalias = '';
287
+ if (name === 'xmlns') {
288
+ newalias = 'xmlns';
289
+ }
290
+ else if (name.charCodeAt(0) === 120 && name.substr(0, 6) === 'xmlns:') {
291
+ newalias = name.substr(6);
292
+ }
293
+ if (newalias) {
294
+ alias = this.useNS[unEntities(value)];
295
+ if (alias) {
296
+ if (this.nsmatrix[newalias] !== alias) {
297
+ if (!hasNewMatrix) {
298
+ hasNewMatrix = true;
299
+ this.nsmatrix = this.copyNsMatrix();
300
+ }
301
+ this.nsmatrix[newalias] = alias;
302
+ }
303
+ }
304
+ else {
305
+ if (this.nsmatrix[newalias]) {
306
+ if (!hasNewMatrix) {
307
+ hasNewMatrix = true;
308
+ this.nsmatrix = this.copyNsMatrix();
309
+ }
310
+ this.nsmatrix[newalias] = false;
311
+ }
312
+ }
313
+ res[name] = value;
314
+ continue;
315
+ }
316
+ attr_list.push(name, value);
317
+ continue;
318
+ }
319
+ // Kept as `--c !== 0`: an empty name (possible only with ns()) never ends this loop, as in easysax 0.1.14.
320
+ prefixed = false;
321
+ c = name.length;
322
+ while (--c !== 0) {
323
+ if (name.charCodeAt(c) === 58) {
324
+ // ':'
325
+ alias = this.nsmatrix[name.substring(0, c)];
326
+ if (alias) {
327
+ // substr() coerces the alias to a number (NaN -> 0), so the key keeps the prefixed name.
328
+ res[alias + name.substr(Number(alias))] = value;
329
+ }
330
+ prefixed = true;
331
+ break;
332
+ }
333
+ }
334
+ if (prefixed) {
335
+ continue;
336
+ }
337
+ }
338
+ res[name] = value;
339
+ noValueAttribute = false;
340
+ }
341
+ if (!ok) {
342
+ this.attr_res = true;
343
+ return true;
344
+ }
345
+ if (this.hasSurmiseNS) {
346
+ for (let k = 0, kl = attr_list.length; k < kl; k++) {
347
+ name = attr_list[k++];
348
+ prefixed = false;
349
+ c = name.length;
350
+ while (--c !== 0) {
351
+ if (name.charCodeAt(c) === 58) {
352
+ // ':'
353
+ alias = this.nsmatrix[name.substring(0, c)];
354
+ if (alias) {
355
+ res[alias + name.substr(Number(alias))] = attr_list[k];
356
+ }
357
+ prefixed = true;
358
+ break;
359
+ }
360
+ }
361
+ if (prefixed) {
362
+ continue;
363
+ }
364
+ res[name] = attr_list[k];
365
+ }
366
+ }
367
+ this.attr_res = res;
368
+ return res;
369
+ }
370
+ parse(input) {
371
+ const xml = String(input);
372
+ const nodestack = [];
373
+ const stacknsmatrix = [];
374
+ let elem = '';
375
+ let tagend = false;
376
+ let tagstart = false;
377
+ let j = 0;
378
+ let i = 0;
379
+ let k = 0;
380
+ let x = '';
381
+ let y = 0;
382
+ let q = 0;
383
+ let w = 0;
384
+ let c = 0;
385
+ let inside = 0;
386
+ let xmlns = null;
387
+ let stopIndex = 0;
388
+ // Inside an element of an unknown namespace: no events until it closes.
389
+ let stop = false;
390
+ let _nsmatrix = this.nsmatrix;
391
+ let ok = undefined;
392
+ let pos = 0;
393
+ let ln = 0;
394
+ let lnStart = -2;
395
+ let lnEnd = -1;
396
+ const len = xml.length;
397
+ // Handlers may call these later; they read the parser's state at call time.
398
+ const getStringNode = () => {
399
+ return xml.substring(i, j + 1);
499
400
  };
500
-
501
- if (i === -1) { // конец разбора
502
-
503
- if (nodestack.length) {
504
- this.onError('end file', position(j));
505
- return;
506
- };
507
-
508
- return;
401
+ const findLineAndColumnFromPos = () => {
402
+ while (lnStart < lnEnd && lnEnd < pos) {
403
+ lnStart = lnEnd;
404
+ lnEnd = xml.indexOf('\n', lnEnd + 1);
405
+ ++ln;
406
+ }
407
+ return { line: ln, column: pos - lnStart };
509
408
  };
510
-
511
- if (j !== i && !stop) {
512
- ok = this.onTextNode(xml.substring(j, i), unEntities, position(j));
513
- if (ok === false) return;
409
+ const position = (p) => {
410
+ pos = p;
411
+ return findLineAndColumnFromPos;
514
412
  };
515
-
516
- w = xml.charCodeAt(i+1);
517
-
518
- if (w === 33) { // "!"
519
- w = xml.charCodeAt(i+2);
520
- if (w === 91 && xml.substr(i+3, 6) === 'CDATA[') { // 91 == "["
521
- j = xml.indexOf(']]>', i);
522
- if (j === -1) {
523
- this.onError('cdata', position(i));
524
- return;
525
- };
526
-
527
- //x = xml.substring(i+9, j);
528
- if (!stop) {
529
- ok = this.onCDATA(xml.substring(i+9, j), false, position(i));
530
- if (ok === false) return;
531
- };
532
-
533
- j += 3;
534
- continue;
535
- };
536
-
537
- if (w === 45 && xml.charCodeAt(i+3) === 45) { // 45 == "-"
538
- j = xml.indexOf('-->', i);
539
- if (j === -1) {
540
- this.onError('expected -->', position(i));
413
+ while (j !== -1) {
414
+ stop = stopIndex > 0;
415
+ if (xml.charCodeAt(j) === 60) {
416
+ // "<"
417
+ i = j;
418
+ }
419
+ else {
420
+ i = xml.indexOf('<', j);
421
+ }
422
+ if (i === -1) {
423
+ if (nodestack.length) {
424
+ this.onError('end file', position(j));
541
425
  return;
542
- };
543
-
544
-
545
- if (this.is_onComment && !stop) {
546
- ok = this.onComment(xml.substring(i+4, j), unEntities, position(i));
547
- if (ok === false) return;
548
- };
549
-
550
- j += 3;
551
- continue;
552
- };
553
-
554
- j = xml.indexOf('>', i+1);
555
- if (j === -1) {
556
- this.onError('expected ">"', position(i + 1));
426
+ }
557
427
  return;
558
- };
559
-
560
- if (this.is_onAttention && !stop) {
561
- ok = this.onAttention(xml.substring(i, j+1), unEntities, position(i));
562
- if (ok === false) return;
563
- };
564
-
565
- j += 1;
566
- continue;
567
-
568
- } else {
569
- if (w === 63) { // "?"
570
- j = xml.indexOf('?>', i);
571
- if (j === -1) { // error
572
- this.onError('...?>', position(i));
428
+ }
429
+ if (j !== i && !stop) {
430
+ ok = this.onTextNode(xml.substring(j, i), unEntities, position(j));
431
+ if (ok === false)
573
432
  return;
574
- };
575
-
576
- if (this.is_onQuestion) {
577
- ok = this.onQuestion(xml.substring(i, j+2), position(i));
578
- if (ok === false) return;
579
- };
580
-
581
- j += 2;
433
+ }
434
+ w = xml.charCodeAt(i + 1);
435
+ if (w === 33) {
436
+ // "!"
437
+ w = xml.charCodeAt(i + 2);
438
+ if (w === 91 && xml.substr(i + 3, 6) === 'CDATA[') {
439
+ // "["
440
+ j = xml.indexOf(']]>', i);
441
+ if (j === -1) {
442
+ this.onError('cdata', position(i));
443
+ return;
444
+ }
445
+ if (!stop) {
446
+ ok = this.onCDATA(xml.substring(i + 9, j), false, position(i));
447
+ if (ok === false)
448
+ return;
449
+ }
450
+ j += 3;
451
+ continue;
452
+ }
453
+ if (w === 45 && xml.charCodeAt(i + 3) === 45) {
454
+ // "-"
455
+ j = xml.indexOf('-->', i);
456
+ if (j === -1) {
457
+ this.onError('expected -->', position(i));
458
+ return;
459
+ }
460
+ if (this.is_onComment && !stop) {
461
+ ok = this.onComment(xml.substring(i + 4, j), unEntities, position(i));
462
+ if (ok === false)
463
+ return;
464
+ }
465
+ j += 3;
466
+ continue;
467
+ }
468
+ j = xml.indexOf('>', i + 1);
469
+ if (j === -1) {
470
+ this.onError('expected ">"', position(i + 1));
471
+ return;
472
+ }
473
+ if (this.is_onAttention && !stop) {
474
+ ok = this.onAttention(xml.substring(i, j + 1), unEntities, position(i));
475
+ if (ok === false)
476
+ return;
477
+ }
478
+ j += 1;
582
479
  continue;
583
- };
584
- };
585
-
586
- var inside=false;
587
- for (k=i,j=-1;k<len;k++) {
588
- var c = xml.charCodeAt(k);
589
- if (!inside) {
590
-
591
- if (c === 34) { // '"'
592
- inside = c;
593
- }
594
- else if (c === 39) { // "'"
595
- inside = c;
596
- }
597
- else if (c === 62) { // <
598
- j = k; break;
599
- }
600
- } else {
601
- if (c === inside) { inside = false; }
602
480
  }
603
- }
604
-
605
- if (j == -1) { // error
606
- this.onError('...>', position(i + 1));
607
- return;
608
- };
609
-
610
- this.attr_res = true; // атрибутов нет
611
-
612
- //if (xml.charCodeAt(i+1) === 47) { // </...
613
- if (w === 47) { // </...
614
- tagstart = false;
615
- tagend = true;
616
-
617
- // проверяем что должен быть закрыт тотже тег что и открывался
618
- x = elem = nodestack.pop();
619
- q = i + 2 + x.length;
620
-
621
- //console.log()
622
- if (xml.substring(i+2, q) !== x) {
623
- this.onError('close tagname', position(i + 2));
624
- return;
625
- };
626
-
627
- // проверим что в закрываюшем теге нет лишнего
628
- for(; q < j; q++) {
629
- w = xml.charCodeAt(q);
630
-
631
- if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
481
+ else {
482
+ if (w === 63) {
483
+ // "?"
484
+ j = xml.indexOf('?>', i);
485
+ if (j === -1) {
486
+ this.onError('...?>', position(i));
487
+ return;
488
+ }
489
+ if (this.is_onQuestion) {
490
+ ok = this.onQuestion(xml.substring(i, j + 2), position(i));
491
+ if (ok === false)
492
+ return;
493
+ }
494
+ j += 2;
632
495
  continue;
633
- };
634
-
635
- this.onError('close tag', position(i + 2));
496
+ }
497
+ }
498
+ // The tag ends at the first '>' outside a quoted attribute value.
499
+ inside = 0;
500
+ for (k = i, j = -1; k < len; k++) {
501
+ c = xml.charCodeAt(k);
502
+ if (inside === 0) {
503
+ if (c === 34) {
504
+ // '"'
505
+ inside = c;
506
+ }
507
+ else if (c === 39) {
508
+ // "'"
509
+ inside = c;
510
+ }
511
+ else if (c === 62) {
512
+ // ">"
513
+ j = k;
514
+ break;
515
+ }
516
+ }
517
+ else {
518
+ if (c === inside) {
519
+ inside = 0;
520
+ }
521
+ }
522
+ }
523
+ if (j === -1) {
524
+ this.onError('...>', position(i + 1));
636
525
  return;
637
- };
638
-
639
- } else {
640
- if (xml.charCodeAt(j-1) === 47) { // .../>
641
- x = elem = xml.substring(i+1, j-1);
642
-
643
- tagstart = true;
526
+ }
527
+ this.attr_res = true;
528
+ if (w === 47) {
529
+ // </...
530
+ tagstart = false;
644
531
  tagend = true;
645
- } else {
646
- x = elem = xml.substring(i+1, j);
647
-
648
- tagstart = true;
649
- tagend = false;
650
- };
651
-
652
- if ( !(w > 96 && w < 123 || w > 64 && w <91) ) {
653
- this.onError('first char nodeName', position(i + 1));
654
- return;
655
- };
656
-
657
- for(q = 1, y = x.length; q < y; q++) {
658
- w = x.charCodeAt(q);
659
-
660
- if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
532
+ const opened = nodestack.pop();
533
+ if (opened === undefined) {
534
+ // A close tag with nothing open throws in easysax 0.1.14.
535
+ throw new TypeError("Cannot read properties of undefined (reading 'length')");
536
+ }
537
+ x = elem = opened;
538
+ q = i + 2 + x.length;
539
+ if (xml.substring(i + 2, q) !== x) {
540
+ this.onError('close tagname', position(i + 2));
541
+ return;
542
+ }
543
+ for (; q < j; q++) {
544
+ w = xml.charCodeAt(q);
545
+ if (w === 32 || (w > 8 && w < 14)) {
546
+ continue;
547
+ }
548
+ this.onError('close tag', position(i + 2));
549
+ return;
550
+ }
551
+ }
552
+ else {
553
+ if (xml.charCodeAt(j - 1) === 47) {
554
+ // .../>
555
+ x = elem = xml.substring(i + 1, j - 1);
556
+ tagstart = true;
557
+ tagend = true;
558
+ }
559
+ else {
560
+ x = elem = xml.substring(i + 1, j);
561
+ tagstart = true;
562
+ tagend = false;
563
+ }
564
+ if (!((w > 96 && w < 123) || (w > 64 && w < 91))) {
565
+ this.onError('first char nodeName', position(i + 1));
566
+ return;
567
+ }
568
+ for (q = 1, y = x.length; q < y; q++) {
569
+ w = x.charCodeAt(q);
570
+ if ((w > 96 && w < 123) || (w > 64 && w < 91) || (w > 47 && w < 59) || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
571
+ continue;
572
+ }
573
+ if (w === 32 || (w < 14 && w > 8)) {
574
+ elem = x.substring(0, q);
575
+ // The tag may have attributes.
576
+ this.attr_res = null;
577
+ break;
578
+ }
579
+ this.onError('invalid nodeName', position(i + 1));
580
+ return;
581
+ }
582
+ if (!tagend) {
583
+ nodestack.push(elem);
584
+ }
585
+ }
586
+ if (this.isNamespace) {
587
+ if (stop) {
588
+ if (tagend) {
589
+ if (!tagstart) {
590
+ if (--stopIndex === 0) {
591
+ this.nsmatrix = stacknsmatrix.pop();
592
+ }
593
+ }
594
+ }
595
+ else {
596
+ stopIndex += 1;
597
+ }
598
+ j += 1;
661
599
  continue;
662
- };
663
-
664
- if (w===32 || (w<14 && w > 8)) { // \f\n\r\t\v пробел
665
- elem = x.substring(0, q)
666
- this.attr_res = null; // возможно есть атирибуты
667
- break;
668
- };
669
-
670
- this.onError('invalid nodeName', position(i + 1));
671
- return;
672
- };
673
-
674
- if (!tagend) {
675
- nodestack.push(elem);
676
- };
677
- };
678
-
679
-
680
- if (this.isNamespace) {
681
- if (stop) {
682
- if (tagend) {
683
- if (!tagstart) {
684
- if (--stopIndex === 0) {
600
+ }
601
+ _nsmatrix = this.nsmatrix;
602
+ if (!tagend) {
603
+ stacknsmatrix.push(this.nsmatrix);
604
+ if (this.attr_res !== true) {
605
+ this.hasSurmiseNS = x.indexOf('xmlns', q) !== -1;
606
+ if (this.hasSurmiseNS) {
607
+ this.attr_string = x;
608
+ this.attr_posstart = q;
609
+ this.getAttrs();
610
+ this.hasSurmiseNS = false;
611
+ }
612
+ }
613
+ }
614
+ w = elem.indexOf(':');
615
+ if (w !== -1) {
616
+ xmlns = this.nsmatrix[elem.substring(0, w)];
617
+ elem = elem.substr(w + 1);
618
+ }
619
+ else {
620
+ xmlns = this.nsmatrix.xmlns;
621
+ }
622
+ if (!xmlns) {
623
+ if (tagend) {
624
+ if (tagstart) {
625
+ this.nsmatrix = _nsmatrix;
626
+ }
627
+ else {
685
628
  this.nsmatrix = stacknsmatrix.pop();
686
- };
687
- };
688
-
689
- } else {
690
- stopIndex += 1;
691
- };
692
-
693
-
694
- j += 1;
695
- continue;
696
- };
697
-
698
- _nsmatrix = this.nsmatrix;
699
-
700
- if (!tagend) {
701
- stacknsmatrix.push(this.nsmatrix);
702
-
703
- if (this.attr_res !== true) {
704
- if (this.hasSurmiseNS = x.indexOf('xmlns', q) !== -1) {
705
- this.attr_string = x;
706
- this.attr_posstart = q;
707
-
708
- this.getAttrs();
709
-
710
- this.hasSurmiseNS = false;
711
- };
712
- };
713
- };
714
-
715
-
716
- w = elem.indexOf(':');
717
- if (w !== -1) {
718
- xmlns = this.nsmatrix[elem.substring(0, w)];
719
- elem = elem.substr(w+1);
720
-
721
- } else {
722
- xmlns = this.nsmatrix.xmlns;
723
- };
724
-
725
- if (!xmlns) {
726
- if (tagend) {
629
+ }
630
+ }
631
+ else {
632
+ // The first element whose namespace is unknown.
633
+ stopIndex = 1;
634
+ this.attr_res = true;
635
+ }
636
+ j += 1;
637
+ continue;
638
+ }
639
+ elem = xmlns + ':' + elem;
640
+ }
641
+ if (tagstart) {
642
+ this.attr_string = x;
643
+ this.attr_posstart = q;
644
+ ok = this.onStartNode(elem, () => this.getAttrs(), unEntities, tagend, getStringNode, position(i));
645
+ if (ok === false) {
646
+ return;
647
+ }
648
+ this.attr_res = true;
649
+ }
650
+ if (tagend) {
651
+ ok = this.onEndNode(elem, unEntities, tagstart, getStringNode, position(i));
652
+ if (ok === false) {
653
+ return;
654
+ }
655
+ if (this.isNamespace) {
727
656
  if (tagstart) {
728
657
  this.nsmatrix = _nsmatrix;
729
- } else {
658
+ }
659
+ else {
730
660
  this.nsmatrix = stacknsmatrix.pop();
731
- };
732
- } else {
733
- stopIndex = 1; // первый элемент для которого не определено пространство имен
734
- this.attr_res = true;
735
- };
736
-
737
- j += 1;
738
- continue;
739
- };
740
-
741
- elem = xmlns + ':' + elem;
742
- };
743
-
744
- //string_node = xml.substring(i, j+1); // текст ноды как есть
745
-
746
- if (tagstart) { // is_onStartNode
747
- this.attr_string = x;
748
- this.attr_posstart = q;
749
-
750
- var that = this;
751
- ok = this.onStartNode(elem, function() { return that.getAttrs() }, unEntities, tagend
752
- , getStringNode, position(i)
753
- );
754
-
755
- if (ok === false) {
756
- return;
757
- };
758
-
759
- this.attr_res = true;
760
- };
761
-
762
- if (tagend) {
763
- ok = this.onEndNode(elem, unEntities, tagstart
764
- , getStringNode, position(i)
765
- );
766
-
767
- if (ok === false) {
768
- return;
769
- };
770
-
771
- if (this.isNamespace) {
772
- if (tagstart) {
773
- this.nsmatrix = _nsmatrix;
774
- } else {
775
- this.nsmatrix = stacknsmatrix.pop();
776
- };
777
- };
778
- };
779
-
780
- j += 1;
781
- };
782
- };
783
-
784
- export { EasySAXParser };
661
+ }
662
+ }
663
+ }
664
+ j += 1;
665
+ }
666
+ }
667
+ }
668
+ //# sourceMappingURL=easysax.js.map