@nativescript/core 9.0.0-alpha.5 → 9.0.0-next-07-20-2025-16403500407
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.
- package/accessibility/accessibility-common.d.ts +0 -264
- package/accessibility/accessibility-common.js +0 -352
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.d.ts +1 -0
- package/accessibility/accessibility-css-helper.js +101 -0
- package/accessibility/accessibility-css-helper.js.map +1 -0
- package/accessibility/accessibility-properties.d.ts +1 -1
- package/accessibility/accessibility-properties.js +2 -2
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.d.ts +8 -0
- package/accessibility/accessibility-service-common.js +26 -0
- package/accessibility/accessibility-service-common.js.map +1 -0
- package/accessibility/accessibility-service.android.d.ts +6 -0
- package/accessibility/accessibility-service.android.js +103 -0
- package/accessibility/accessibility-service.android.js.map +1 -0
- package/accessibility/accessibility-service.d.ts +10 -0
- package/accessibility/accessibility-service.ios.d.ts +6 -0
- package/accessibility/accessibility-service.ios.js +61 -0
- package/accessibility/accessibility-service.ios.js.map +1 -0
- package/accessibility/accessibility-types.d.ts +224 -0
- package/accessibility/accessibility-types.js +222 -0
- package/accessibility/accessibility-types.js.map +1 -0
- package/accessibility/font-scale-common.d.ts +7 -0
- package/accessibility/font-scale-common.js +14 -0
- package/accessibility/font-scale-common.js.map +1 -0
- package/accessibility/font-scale.android.d.ts +5 -0
- package/accessibility/font-scale.android.js +55 -0
- package/accessibility/font-scale.android.js.map +1 -0
- package/accessibility/font-scale.d.ts +9 -0
- package/accessibility/font-scale.ios.d.ts +5 -0
- package/accessibility/font-scale.ios.js +89 -0
- package/accessibility/font-scale.ios.js.map +1 -0
- package/accessibility/index.android.d.ts +10 -0
- package/accessibility/index.android.js +577 -0
- package/accessibility/index.android.js.map +1 -0
- package/accessibility/index.d.ts +36 -0
- package/accessibility/index.ios.d.ts +9 -0
- package/accessibility/index.ios.js +229 -0
- package/accessibility/index.ios.js.map +1 -0
- package/application/application-common.d.ts +8 -6
- package/application/application-common.js +14 -21
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +3 -2
- package/application/application.android.d.ts +7 -14
- package/application/application.android.js +75 -754
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +0 -25
- package/application/application.ios.d.ts +18 -16
- package/application/application.ios.js +45 -455
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.js +2 -2
- package/application-settings/index.android.js.map +1 -1
- package/cli-hooks/{before-checkForChanges.mjs → before-checkForChanges.js} +6 -6
- package/cli-hooks/postinstall.js +2 -0
- package/cli-hooks/preuninstall.js +2 -0
- package/color/color-common.d.ts +19 -18
- package/color/color-common.js +14 -13
- package/color/color-common.js.map +1 -1
- package/color/index.ios.d.ts +1 -2
- package/color/index.ios.js.map +1 -1
- package/connectivity/index.android.js +4 -5
- package/connectivity/index.android.js.map +1 -1
- package/core-types/index.d.ts +1 -1
- package/core-types/index.js +2 -2
- package/core-types/index.js.map +1 -1
- package/css/css-tree-parser.js +21 -17
- package/css/css-tree-parser.js.map +1 -1
- package/css/lib/parse/index.js +577 -475
- package/css/package.json +36 -0
- package/css/reworkcss.d.ts +28 -25
- package/css/reworkcss.js +1 -5
- package/css-mediaquery/index.js +1 -1
- package/css-mediaquery/index.js.map +1 -1
- package/css-value/package.json +23 -0
- package/css-value/reworkcss-value.d.ts +8 -31
- package/css-value/reworkcss-value.js +111 -89
- package/debugger/devtools-elements-interfaces.d.ts +1 -1
- package/debugger/devtools-elements.common.js +8 -17
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +1 -1
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-node.d.ts +27 -0
- package/debugger/{dom-types.js → dom-node.js} +9 -11
- package/debugger/dom-node.js.map +1 -0
- package/debugger/webinspector-css.d.ts +18 -18
- package/debugger/webinspector-css.js +1 -1
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.d.ts +15 -15
- package/debugger/webinspector-dom.js +1 -1
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.d.ts +9 -9
- package/debugger/webinspector-network.android.js +3 -3
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.d.ts +9 -9
- package/debugger/webinspector-network.ios.js +1 -1
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/fetch/index.js +458 -448
- package/file-system/file-system-access.android.js +39 -32
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/index.d.ts +2 -2
- package/file-system/index.js +11 -4
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.d.ts +2 -1
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.d.ts +2 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/global-types.d.ts +1 -1
- package/globals/index.js +288 -254
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js +2 -2
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.d.ts +7 -3
- package/http/http-request/index.android.js +22 -6
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.d.ts +1 -5
- package/http/http-request/index.ios.d.ts +7 -3
- package/http/http-request/index.ios.js +22 -6
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.d.ts +105 -6
- package/http/index.js +12 -10
- package/http/index.js.map +1 -1
- package/image-asset/index.android.js +3 -3
- package/image-asset/index.android.js.map +1 -1
- package/image-source/index.android.d.ts +1 -1
- package/image-source/index.android.js +23 -5
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +9 -2
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +8 -12
- package/index.js +3 -6
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +0 -3
- package/inspector_modules.js +3 -6
- package/inspector_modules.js.map +1 -1
- package/js-libs/easysax/easysax.js +3 -5
- package/media-query-list/index.js +17 -7
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/index.d.ts +11 -2
- package/module-name-resolver/index.js +18 -6
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +23 -32
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/package.json +5 -8
- package/platform/device/index.android.js +2 -2
- package/platform/device/index.android.js.map +1 -1
- package/platform/screen/index.android.js +2 -2
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +2 -2
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +1 -2
- package/profiling/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +2 -4
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +6 -7
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +11 -10
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +4 -3
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.d.ts +4 -4
- package/ui/animation/animation-common.js +3 -2
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/{animation-shared.d.ts → animation-interfaces.d.ts} +31 -39
- package/{core-types/animation-types.js → ui/animation/animation-interfaces.js} +1 -1
- package/ui/animation/animation-interfaces.js.map +1 -0
- package/ui/animation/index.android.d.ts +2 -1
- package/ui/animation/index.android.js +5 -5
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.d.ts +138 -2
- package/ui/animation/index.ios.d.ts +2 -1
- package/ui/animation/index.ios.js +3 -3
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +118 -67
- package/ui/animation/keyframe-animation.js +2 -2
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/component-builder/index.js +2 -2
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +3 -415
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.d.ts +134 -0
- package/ui/builder/xml2ui.js +397 -0
- package/ui/builder/xml2ui.js.map +1 -0
- package/ui/button/index.android.js +1 -2
- package/ui/button/index.android.js.map +1 -1
- package/ui/core/bindable/index.d.ts +38 -2
- package/ui/core/bindable/index.js +2 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.d.ts +37 -4
- package/ui/core/properties/index.js +35 -6
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +2 -2
- package/ui/core/view/index.android.js +10 -13
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +61 -1
- package/ui/core/view/index.ios.d.ts +3 -3
- package/ui/core/view/index.ios.js +13 -21
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +16 -19
- package/ui/core/view/view-common.js +14 -12
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +1 -2
- package/ui/core/view/view-helper/index.ios.js +4 -3
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +3 -1
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +25 -23
- package/ui/core/view-base/index.js +30 -9
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +3 -3
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +7 -8
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +2 -2
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/embedding/index.android.d.ts +1 -1
- package/ui/embedding/index.d.ts +1 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +19 -0
- package/ui/frame/callbacks/activity-callbacks.js +301 -0
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -0
- package/ui/frame/{frame-helper-for-android.d.ts → callbacks/fragment-callbacks.d.ts} +1 -20
- package/ui/frame/{frame-helper-for-android.js → callbacks/fragment-callbacks.js} +38 -52
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -0
- package/ui/frame/fragment.android.js +2 -3
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +2 -2
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +4 -4
- package/ui/frame/frame-interfaces.js.map +1 -1
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +5 -20
- package/ui/frame/index.android.js +19 -296
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +19 -18
- package/ui/frame/index.ios.d.ts +1 -1
- package/ui/frame/index.ios.js +4 -5
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +273 -4
- package/ui/gestures/gestures-common.js +146 -3
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.d.ts +1 -29
- package/ui/gestures/index.android.js +2 -4
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +0 -35
- package/ui/gestures/index.ios.d.ts +1 -35
- package/ui/gestures/index.ios.js +3 -3
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +1 -1
- package/ui/html-view/index.ios.js +3 -3
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +1 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +1 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +11 -5
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +5 -10
- package/ui/index.js +3 -11
- package/ui/index.js.map +1 -1
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +1 -1
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.d.ts +1 -1
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +1 -2
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +1 -1
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base.android.js +1 -2
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +1 -1
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.d.ts +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-view/index.android.js +1 -1
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +1 -1
- package/ui/list-view/index.ios.js +1 -1
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +1 -1
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js +1 -2
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.js +5 -4
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +2 -3
- package/ui/page/page-common.js +4 -5
- package/ui/page/page-common.js.map +1 -1
- package/ui/scroll-view/index.ios.js +3 -3
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/styling/background-common.js +1 -0
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.d.ts +6 -0
- package/ui/styling/background.android.js +53 -1
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +1 -2
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/converters.d.ts +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-transform.d.ts +1 -1
- package/ui/styling/css-utils.js +1 -1
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font.android.js +2 -2
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +10 -10
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/style/index.d.ts +1 -1
- package/ui/styling/style-properties.d.ts +113 -58
- package/ui/styling/style-properties.js +93 -7
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +48 -85
- package/ui/styling/style-scope.js +36 -30
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.ios.js +5 -5
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +6 -6
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/text-base/index.android.d.ts +1 -1
- package/ui/text-base/index.android.js +4 -4
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +1 -1
- package/ui/text-base/index.ios.js +4 -5
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +1 -1
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/index.ios.js +1 -1
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +1 -1
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.d.ts +1 -1
- package/ui/transition/page-transition.android.js +4 -4
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +1 -1
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +1 -1
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +1 -2
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +2 -2
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/utils/{native-helper-for-android.d.ts → android/index.d.ts} +2 -4
- package/utils/android/index.js +160 -0
- package/utils/android/index.js.map +1 -0
- package/utils/common.d.ts +38 -1
- package/utils/common.js +111 -1
- package/utils/common.js.map +1 -1
- package/utils/debug.js +59 -1
- package/utils/debug.js.map +1 -1
- package/utils/index.android.d.ts +1 -3
- package/utils/index.android.js +11 -37
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +14 -2
- package/utils/index.ios.d.ts +1 -4
- package/utils/index.ios.js +5 -32
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.d.ts +39 -0
- package/utils/ios/index.js +229 -0
- package/utils/ios/index.js.map +1 -0
- package/utils/layout-helper/index.android.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +4 -6
- package/utils/layout-helper/index.ios.js +5 -5
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.d.ts +9 -0
- package/utils/layout-helper/layout-helper-common.js +9 -1
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/native-helper.android.d.ts +5 -29
- package/utils/native-helper.android.js +131 -18
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +258 -206
- package/utils/native-helper.ios.d.ts +3 -72
- package/utils/native-helper.ios.js +3 -250
- package/utils/native-helper.ios.js.map +1 -1
- package/xhr/index.js +13 -12
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +98 -94
- package/xml/index.js +2 -58
- package/xml/index.js.map +1 -1
- package/accessibility/index.js +0 -2
- package/accessibility/index.js.map +0 -1
- package/application/helpers-common.d.ts +0 -50
- package/application/helpers-common.js +0 -153
- package/application/helpers-common.js.map +0 -1
- package/application/helpers.android.d.ts +0 -17
- package/application/helpers.android.js +0 -173
- package/application/helpers.android.js.map +0 -1
- package/application/helpers.d.ts +0 -25
- package/application/helpers.ios.d.ts +0 -27
- package/application/helpers.ios.js +0 -62
- package/application/helpers.ios.js.map +0 -1
- package/cli-hooks/postinstall.mjs +0 -7
- package/cli-hooks/preuninstall.mjs +0 -7
- package/color/color-types.d.ts +0 -49
- package/color/color-types.js +0 -3
- package/color/color-types.js.map +0 -1
- package/core-types/animation-types.d.ts +0 -11
- package/core-types/animation-types.js.map +0 -1
- package/core-types/validators.d.ts +0 -2
- package/core-types/validators.js +0 -18
- package/core-types/validators.js.map +0 -1
- package/css/lib/parse/index.d.ts +0 -1
- package/css/lib/parse/index.js.map +0 -1
- package/css/reworkcss.js.map +0 -1
- package/css-value/reworkcss-value.js.map +0 -1
- package/debugger/dom-types.d.ts +0 -24
- package/debugger/dom-types.js.map +0 -1
- package/fetch/index.d.ts +0 -72
- package/fetch/index.js.map +0 -1
- package/globals/global-utils.d.ts +0 -27
- package/globals/global-utils.js +0 -67
- package/globals/global-utils.js.map +0 -1
- package/http/http-interfaces.d.ts +0 -84
- package/http/http-interfaces.js +0 -6
- package/http/http-interfaces.js.map +0 -1
- package/http/http-shared.d.ts +0 -5
- package/http/http-shared.js +0 -14
- package/http/http-shared.js.map +0 -1
- package/module-name-resolver/helpers.d.ts +0 -14
- package/module-name-resolver/helpers.js +0 -27
- package/module-name-resolver/helpers.js.map +0 -1
- package/ui/animation/animation-shared.js +0 -4
- package/ui/animation/animation-shared.js.map +0 -1
- package/ui/animation/animation-types.d.ts +0 -1
- package/ui/animation/animation-types.js +0 -3
- package/ui/animation/animation-types.js.map +0 -1
- package/ui/core/bindable/bindable-types.d.ts +0 -37
- package/ui/core/bindable/bindable-types.js +0 -3
- package/ui/core/bindable/bindable-types.js.map +0 -1
- package/ui/core/properties/property-shared.d.ts +0 -35
- package/ui/core/properties/property-shared.js +0 -16
- package/ui/core/properties/property-shared.js.map +0 -1
- package/ui/core/view/view-helper/view-helper-shared.d.ts +0 -5
- package/ui/core/view/view-helper/view-helper-shared.js +0 -6
- package/ui/core/view/view-helper/view-helper-shared.js.map +0 -1
- package/ui/core/view/view-interfaces.d.ts +0 -54
- package/ui/core/view/view-interfaces.js +0 -2
- package/ui/core/view/view-interfaces.js.map +0 -1
- package/ui/core/view-base/utils.d.ts +0 -1
- package/ui/core/view-base/utils.js +0 -9
- package/ui/core/view-base/utils.js.map +0 -1
- package/ui/frame/frame-helper-for-android.js.map +0 -1
- package/ui/gestures/gestures-types.d.ts +0 -108
- package/ui/gestures/gestures-types.js +0 -40
- package/ui/gestures/gestures-types.js.map +0 -1
- package/ui/page/events.d.ts +0 -6
- package/ui/page/events.js +0 -7
- package/ui/page/events.js.map +0 -1
- package/ui/styling/length-shared.d.ts +0 -52
- package/ui/styling/length-shared.js +0 -173
- package/ui/styling/length-shared.js.map +0 -1
- package/ui/styling/styling-profile.d.ts +0 -1
- package/ui/styling/styling-profile.js +0 -4
- package/ui/styling/styling-profile.js.map +0 -1
- package/ui/styling/styling-shared.d.ts +0 -3
- package/ui/styling/styling-shared.js +0 -6
- package/ui/styling/styling-shared.js.map +0 -1
- package/utils/animation-helpers.d.ts +0 -27
- package/utils/animation-helpers.js +0 -48
- package/utils/animation-helpers.js.map +0 -1
- package/utils/debug-source.d.ts +0 -19
- package/utils/debug-source.js +0 -78
- package/utils/debug-source.js.map +0 -1
- package/utils/layout-helper/layout-helper-shared.d.ts +0 -9
- package/utils/layout-helper/layout-helper-shared.js +0 -13
- package/utils/layout-helper/layout-helper-shared.js.map +0 -1
- package/utils/native-helper-for-android.js +0 -273
- package/utils/native-helper-for-android.js.map +0 -1
- package/utils/shared.d.ts +0 -17
- package/utils/shared.js +0 -40
- package/utils/shared.js.map +0 -1
- package/utils/utils-shared.d.ts +0 -1
- package/utils/utils-shared.js +0 -8
- package/utils/utils-shared.js.map +0 -1
package/fetch/index.js
CHANGED
|
@@ -1,301 +1,335 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
(function () {
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var support = {
|
|
5
|
+
searchParams: "URLSearchParams" in global,
|
|
6
|
+
iterable: "Symbol" in global && "iterator" in Symbol,
|
|
7
|
+
blob:
|
|
8
|
+
"FileReader" in global &&
|
|
9
|
+
"Blob" in global &&
|
|
10
|
+
(function () {
|
|
11
|
+
try {
|
|
12
|
+
new Blob();
|
|
13
|
+
return true;
|
|
14
|
+
} catch (e) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
})(),
|
|
18
|
+
formData: "FormData" in global,
|
|
19
|
+
arrayBuffer: "ArrayBuffer" in global
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function isDataView(obj) {
|
|
23
|
+
return obj && DataView.prototype.isPrototypeOf(obj);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (support.arrayBuffer) {
|
|
27
|
+
var viewClasses = [
|
|
28
|
+
"[object Int8Array]",
|
|
29
|
+
"[object Uint8Array]",
|
|
30
|
+
"[object Uint8ClampedArray]",
|
|
31
|
+
"[object Int16Array]",
|
|
32
|
+
"[object Uint16Array]",
|
|
33
|
+
"[object Int32Array]",
|
|
34
|
+
"[object Uint32Array]",
|
|
35
|
+
"[object Float32Array]",
|
|
36
|
+
"[object Float64Array]"
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
var isArrayBufferView =
|
|
40
|
+
ArrayBuffer.isView ||
|
|
41
|
+
function (obj) {
|
|
42
|
+
return (
|
|
43
|
+
obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
|
44
|
+
);
|
|
45
|
+
};
|
|
34
46
|
}
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
|
|
48
|
+
function normalizeName(name) {
|
|
49
|
+
if (typeof name !== "string") {
|
|
50
|
+
name = String(name);
|
|
51
|
+
}
|
|
52
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
|
53
|
+
throw new TypeError("Invalid character in header field name");
|
|
54
|
+
}
|
|
55
|
+
return name.toLowerCase();
|
|
37
56
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
57
|
+
|
|
58
|
+
function normalizeValue(value) {
|
|
59
|
+
if (typeof value !== "string") {
|
|
60
|
+
value = String(value);
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
43
63
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
|
|
65
|
+
// Build a destructive iterator for the value list
|
|
66
|
+
function iteratorFor(items) {
|
|
67
|
+
var iterator = {
|
|
68
|
+
next: function () {
|
|
69
|
+
var value = items.shift();
|
|
70
|
+
return { done: value === undefined, value: value };
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (support.iterable) {
|
|
75
|
+
iterator[Symbol.iterator] = function () {
|
|
76
|
+
return iterator;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return iterator;
|
|
56
81
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
export class Headers {
|
|
60
|
-
constructor(headers) {
|
|
82
|
+
|
|
83
|
+
function Headers(headers) {
|
|
61
84
|
this.map = {};
|
|
85
|
+
|
|
62
86
|
if (headers instanceof Headers) {
|
|
63
|
-
headers.forEach((value, name)
|
|
87
|
+
headers.forEach(function (value, name) {
|
|
64
88
|
this.append(name, value);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
headers.forEach((header) => {
|
|
69
|
-
if (header.length !== 2) {
|
|
70
|
-
throw new TypeError('Headers constructor: expected name/value pair to be length 2, found ' + header.length);
|
|
71
|
-
}
|
|
89
|
+
}, this);
|
|
90
|
+
} else if (Array.isArray(headers)) {
|
|
91
|
+
headers.forEach(function (header) {
|
|
72
92
|
this.append(header[0], header[1]);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
Object.getOwnPropertyNames(headers).forEach((name) => {
|
|
93
|
+
}, this);
|
|
94
|
+
} else if (headers) {
|
|
95
|
+
Object.getOwnPropertyNames(headers).forEach(function (name) {
|
|
77
96
|
this.append(name, headers[name]);
|
|
78
|
-
});
|
|
97
|
+
}, this);
|
|
79
98
|
}
|
|
80
99
|
}
|
|
81
|
-
|
|
100
|
+
|
|
101
|
+
Headers.prototype.append = function (name, value) {
|
|
82
102
|
name = normalizeName(name);
|
|
83
103
|
value = normalizeValue(value);
|
|
84
|
-
|
|
85
|
-
this.map[name] = oldValue ? oldValue +
|
|
86
|
-
}
|
|
87
|
-
|
|
104
|
+
var oldValue = this.map[name];
|
|
105
|
+
this.map[name] = oldValue ? oldValue + ", " + value : value;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
Headers.prototype["delete"] = function (name) {
|
|
88
109
|
delete this.map[normalizeName(name)];
|
|
89
|
-
}
|
|
90
|
-
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
Headers.prototype.get = function (name) {
|
|
91
113
|
name = normalizeName(name);
|
|
92
114
|
return this.has(name) ? this.map[name] : null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
Headers.prototype.has = function (name) {
|
|
118
|
+
return this.map.hasOwnProperty(normalizeName(name));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Headers.prototype.set = function (name, value) {
|
|
98
122
|
this.map[normalizeName(name)] = normalizeValue(value);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
Headers.prototype.forEach = function (callback, thisArg) {
|
|
126
|
+
for (var name in this.map) {
|
|
127
|
+
if (this.map.hasOwnProperty(name)) {
|
|
103
128
|
callback.call(thisArg, this.map[name], name, this);
|
|
104
129
|
}
|
|
105
130
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
Headers.prototype.keys = function () {
|
|
134
|
+
var items = [];
|
|
135
|
+
this.forEach(function (value, name) {
|
|
136
|
+
items.push(name);
|
|
137
|
+
});
|
|
110
138
|
return iteratorFor(items);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
Headers.prototype.values = function () {
|
|
142
|
+
var items = [];
|
|
143
|
+
this.forEach(function (value) {
|
|
144
|
+
items.push(value);
|
|
145
|
+
});
|
|
115
146
|
return iteratorFor(items);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
Headers.prototype.entries = function () {
|
|
150
|
+
var items = [];
|
|
151
|
+
this.forEach(function (value, name) {
|
|
152
|
+
items.push([name, value]);
|
|
153
|
+
});
|
|
120
154
|
return iteratorFor(items);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
if (support.iterable) {
|
|
158
|
+
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
|
121
159
|
}
|
|
122
|
-
|
|
123
|
-
|
|
160
|
+
|
|
161
|
+
function consumed(body) {
|
|
162
|
+
if (body.bodyUsed) {
|
|
163
|
+
return Promise.reject(new TypeError("Already read"));
|
|
164
|
+
}
|
|
165
|
+
body.bodyUsed = true;
|
|
124
166
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
167
|
+
|
|
168
|
+
function fileReaderReady(reader) {
|
|
169
|
+
return new Promise(function (resolve, reject) {
|
|
170
|
+
reader.onload = function () {
|
|
171
|
+
resolve(reader.result);
|
|
172
|
+
};
|
|
173
|
+
reader.onerror = function () {
|
|
174
|
+
reject(reader.error);
|
|
175
|
+
};
|
|
176
|
+
});
|
|
130
177
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
else {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
178
|
+
|
|
179
|
+
function readBlobAsArrayBuffer(blob) {
|
|
180
|
+
var reader = new FileReader();
|
|
181
|
+
var promise = fileReaderReady(reader);
|
|
182
|
+
reader.readAsArrayBuffer(blob);
|
|
183
|
+
return promise;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function readBlobAsText(blob) {
|
|
187
|
+
var reader = new FileReader();
|
|
188
|
+
var promise = fileReaderReady(reader);
|
|
189
|
+
reader.readAsText(blob);
|
|
190
|
+
return promise;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function readArrayBufferAsText(buf) {
|
|
194
|
+
var view = new Uint8Array(buf);
|
|
195
|
+
var chars = new Array(view.length);
|
|
196
|
+
|
|
197
|
+
for (var i = 0; i < view.length; i++) {
|
|
198
|
+
chars[i] = String.fromCharCode(view[i]);
|
|
199
|
+
}
|
|
200
|
+
return chars.join("");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function bufferClone(buf) {
|
|
204
|
+
if (buf.slice) {
|
|
205
|
+
return buf.slice(0);
|
|
206
|
+
} else {
|
|
207
|
+
var view = new Uint8Array(buf.byteLength);
|
|
208
|
+
view.set(new Uint8Array(buf));
|
|
209
|
+
return view.buffer;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function Body() {
|
|
214
|
+
this.bodyUsed = false;
|
|
215
|
+
|
|
216
|
+
this._initBody = function (body) {
|
|
217
|
+
this._bodyInit = body;
|
|
218
|
+
if (!body) {
|
|
219
|
+
this._bodyText = "";
|
|
220
|
+
} else if (typeof body === "string") {
|
|
221
|
+
this._bodyText = body;
|
|
222
|
+
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
|
223
|
+
this._bodyBlob = body;
|
|
224
|
+
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
|
225
|
+
this._bodyFormData = body;
|
|
226
|
+
} else if (
|
|
227
|
+
support.searchParams &&
|
|
228
|
+
URLSearchParams.prototype.isPrototypeOf(body)
|
|
229
|
+
) {
|
|
230
|
+
this._bodyText = body.toString();
|
|
231
|
+
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
|
232
|
+
this._bodyArrayBuffer = bufferClone(body.buffer);
|
|
233
|
+
// IE 10-11 can't handle a DataView body.
|
|
234
|
+
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
|
235
|
+
} else if (
|
|
236
|
+
support.arrayBuffer &&
|
|
237
|
+
(ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))
|
|
238
|
+
) {
|
|
239
|
+
this._bodyArrayBuffer = bufferClone(body);
|
|
240
|
+
} else {
|
|
241
|
+
this._bodyText = body = Object.prototype.toString.call(body);
|
|
169
242
|
}
|
|
170
|
-
|
|
171
|
-
|
|
243
|
+
|
|
244
|
+
if (!this.headers.get("content-type")) {
|
|
245
|
+
if (typeof body === "string") {
|
|
246
|
+
this.headers.set("content-type", "text/plain;charset=UTF-8");
|
|
247
|
+
} else if (this._bodyBlob && this._bodyBlob.type) {
|
|
248
|
+
this.headers.set("content-type", this._bodyBlob.type);
|
|
249
|
+
} else if (
|
|
250
|
+
support.searchParams &&
|
|
251
|
+
URLSearchParams.prototype.isPrototypeOf(body)
|
|
252
|
+
) {
|
|
253
|
+
this.headers.set(
|
|
254
|
+
"content-type",
|
|
255
|
+
"application/x-www-form-urlencoded;charset=UTF-8"
|
|
256
|
+
);
|
|
257
|
+
}
|
|
172
258
|
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
if (support.blob) {
|
|
262
|
+
this.blob = function () {
|
|
263
|
+
var rejected = consumed(this);
|
|
264
|
+
if (rejected) {
|
|
265
|
+
return rejected;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (this._bodyBlob) {
|
|
269
|
+
return Promise.resolve(this._bodyBlob);
|
|
270
|
+
} else if (this._bodyArrayBuffer) {
|
|
271
|
+
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
272
|
+
} else if (this._bodyFormData) {
|
|
273
|
+
throw new Error("could not read FormData body as blob");
|
|
274
|
+
} else {
|
|
275
|
+
return Promise.resolve(new Blob([this._bodyText]));
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
this.arrayBuffer = function () {
|
|
280
|
+
if (this._bodyArrayBuffer) {
|
|
281
|
+
return consumed(this) || Promise.resolve(this._bodyArrayBuffer);
|
|
282
|
+
} else {
|
|
283
|
+
return this.blob().then(readBlobAsArrayBuffer);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
173
286
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
if (this._bodyBlob) {
|
|
181
|
-
return Promise.resolve(this._bodyBlob);
|
|
182
|
-
}
|
|
183
|
-
else if (this._bodyArrayBuffer) {
|
|
184
|
-
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
185
|
-
}
|
|
186
|
-
else if (this._bodyFormData) {
|
|
187
|
-
throw new Error('could not read FormData body as blob');
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
return Promise.resolve(new Blob([this._bodyText]));
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
arrayBuffer() {
|
|
194
|
-
if (this._bodyArrayBuffer) {
|
|
195
|
-
const consumedResult = consumed(this);
|
|
196
|
-
if (consumedResult) {
|
|
197
|
-
return consumedResult;
|
|
198
|
-
}
|
|
199
|
-
else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
|
|
200
|
-
return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
|
|
287
|
+
|
|
288
|
+
this.text = function () {
|
|
289
|
+
var rejected = consumed(this);
|
|
290
|
+
if (rejected) {
|
|
291
|
+
return rejected;
|
|
201
292
|
}
|
|
202
|
-
|
|
203
|
-
|
|
293
|
+
|
|
294
|
+
if (this._bodyBlob) {
|
|
295
|
+
return readBlobAsText(this._bodyBlob);
|
|
296
|
+
} else if (this._bodyArrayBuffer) {
|
|
297
|
+
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
|
|
298
|
+
} else if (this._bodyFormData) {
|
|
299
|
+
throw new Error("could not read FormData body as text");
|
|
300
|
+
} else {
|
|
301
|
+
return Promise.resolve(this._bodyText);
|
|
204
302
|
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
if (support.formData) {
|
|
306
|
+
this.formData = function () {
|
|
307
|
+
return this.text().then(decode);
|
|
308
|
+
};
|
|
205
309
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return this.
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
throw new Error('could not read FormData body as text');
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
return Promise.resolve(this._bodyText);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
formData() {
|
|
233
|
-
return this.text().then(decode);
|
|
234
|
-
}
|
|
235
|
-
json() {
|
|
236
|
-
return this.text().then(JSON.parse);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
// Helper functions for Body
|
|
240
|
-
function consumed(body) {
|
|
241
|
-
if (body._noBody)
|
|
242
|
-
return;
|
|
243
|
-
if (body.bodyUsed) {
|
|
244
|
-
return Promise.reject(new TypeError('Already read'));
|
|
245
|
-
}
|
|
246
|
-
body.bodyUsed = true;
|
|
247
|
-
}
|
|
248
|
-
function fileReaderReady(reader) {
|
|
249
|
-
return new Promise((resolve, reject) => {
|
|
250
|
-
reader.onload = () => resolve(reader.result);
|
|
251
|
-
reader.onerror = () => reject(reader.error);
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
function readBlobAsArrayBuffer(blob) {
|
|
255
|
-
const reader = new FileReader();
|
|
256
|
-
const promise = fileReaderReady(reader);
|
|
257
|
-
reader.readAsArrayBuffer(blob);
|
|
258
|
-
return promise;
|
|
259
|
-
}
|
|
260
|
-
function readBlobAsText(blob) {
|
|
261
|
-
const reader = new FileReader();
|
|
262
|
-
const promise = fileReaderReady(reader);
|
|
263
|
-
const match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
|
|
264
|
-
const encoding = match ? match[1] : 'utf-8';
|
|
265
|
-
reader.readAsText(blob, encoding);
|
|
266
|
-
return promise;
|
|
267
|
-
}
|
|
268
|
-
function readArrayBufferAsText(buf) {
|
|
269
|
-
const view = new Uint8Array(buf);
|
|
270
|
-
const chars = new Array(view.length);
|
|
271
|
-
for (let i = 0; i < view.length; i++) {
|
|
272
|
-
chars[i] = String.fromCharCode(view[i]);
|
|
273
|
-
}
|
|
274
|
-
return chars.join('');
|
|
275
|
-
}
|
|
276
|
-
function bufferClone(buf) {
|
|
277
|
-
if (buf.slice) {
|
|
278
|
-
return buf.slice(0);
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
const view = new Uint8Array(buf.byteLength);
|
|
282
|
-
view.set(new Uint8Array(buf));
|
|
283
|
-
return view.buffer;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
// HTTP methods whose capitalization should be normalized
|
|
287
|
-
const methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
|
|
288
|
-
function normalizeMethod(method) {
|
|
289
|
-
const upcased = method.toUpperCase();
|
|
290
|
-
return methods.indexOf(upcased) > -1 ? upcased : method;
|
|
291
|
-
}
|
|
292
|
-
export class Request extends Body {
|
|
293
|
-
constructor(input, options = {}) {
|
|
294
|
-
super();
|
|
295
|
-
let body = options.body;
|
|
310
|
+
|
|
311
|
+
this.json = function () {
|
|
312
|
+
return this.text().then(JSON.parse);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
return this;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// HTTP methods whose capitalization should be normalized
|
|
319
|
+
var methods = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
320
|
+
|
|
321
|
+
function normalizeMethod(method) {
|
|
322
|
+
var upcased = method.toUpperCase();
|
|
323
|
+
return methods.indexOf(upcased) > -1 ? upcased : method;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function Request(input, options) {
|
|
327
|
+
options = options || {};
|
|
328
|
+
var body = options.body;
|
|
329
|
+
|
|
296
330
|
if (input instanceof Request) {
|
|
297
331
|
if (input.bodyUsed) {
|
|
298
|
-
throw new TypeError(
|
|
332
|
+
throw new TypeError("Already read");
|
|
299
333
|
}
|
|
300
334
|
this.url = input.url;
|
|
301
335
|
this.credentials = input.credentials;
|
|
@@ -309,221 +343,197 @@ export class Request extends Body {
|
|
|
309
343
|
body = input._bodyInit;
|
|
310
344
|
input.bodyUsed = true;
|
|
311
345
|
}
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
346
|
+
} else {
|
|
314
347
|
this.url = String(input);
|
|
315
348
|
}
|
|
316
|
-
|
|
349
|
+
|
|
350
|
+
this.credentials = options.credentials || this.credentials || "same-origin";
|
|
317
351
|
if (options.headers || !this.headers) {
|
|
318
352
|
this.headers = new Headers(options.headers);
|
|
319
353
|
}
|
|
320
|
-
this.method = normalizeMethod(options.method || this.method ||
|
|
354
|
+
this.method = normalizeMethod(options.method || this.method || "GET");
|
|
321
355
|
this.mode = options.mode || this.mode || null;
|
|
322
|
-
this.signal = options.signal || this.signal
|
|
356
|
+
this.signal = options.signal || this.signal;
|
|
323
357
|
this.referrer = null;
|
|
324
|
-
|
|
325
|
-
|
|
358
|
+
|
|
359
|
+
if ((this.method === "GET" || this.method === "HEAD") && body) {
|
|
360
|
+
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
326
361
|
}
|
|
327
362
|
this._initBody(body);
|
|
328
|
-
if (this.method === 'GET' || this.method === 'HEAD') {
|
|
329
|
-
if (options.cache === 'no-store' || options.cache === 'no-cache') {
|
|
330
|
-
const reParamSearch = /([?&])_=[^&]*/;
|
|
331
|
-
if (reParamSearch.test(this.url)) {
|
|
332
|
-
this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
|
|
333
|
-
}
|
|
334
|
-
else {
|
|
335
|
-
const reQueryString = /\?/;
|
|
336
|
-
this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
363
|
}
|
|
341
|
-
|
|
364
|
+
|
|
365
|
+
Request.prototype.clone = function () {
|
|
342
366
|
return new Request(this, { body: this._bodyInit });
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
.split(
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
if (key) {
|
|
372
|
-
const value = parts.join(':').trim();
|
|
373
|
-
try {
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
function decode(body) {
|
|
370
|
+
var form = new FormData();
|
|
371
|
+
body
|
|
372
|
+
.trim()
|
|
373
|
+
.split("&")
|
|
374
|
+
.forEach(function (bytes) {
|
|
375
|
+
if (bytes) {
|
|
376
|
+
var split = bytes.split("=");
|
|
377
|
+
var name = split.shift().replace(/\+/g, " ");
|
|
378
|
+
var value = split.join("=").replace(/\+/g, " ");
|
|
379
|
+
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
return form;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function parseHeaders(rawHeaders) {
|
|
386
|
+
var headers = new Headers();
|
|
387
|
+
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
|
388
|
+
// https://tools.ietf.org/html/rfc7230#section-3.2
|
|
389
|
+
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
|
|
390
|
+
preProcessedHeaders.split(/\r?\n/).forEach(function (line) {
|
|
391
|
+
var parts = line.split(":");
|
|
392
|
+
var key = parts.shift().trim();
|
|
393
|
+
if (key) {
|
|
394
|
+
var value = parts.join(":").trim();
|
|
374
395
|
headers.append(key, value);
|
|
375
396
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
397
|
+
});
|
|
398
|
+
return headers;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
Body.call(Request.prototype);
|
|
402
|
+
|
|
403
|
+
function Response(bodyInit, options) {
|
|
404
|
+
if (!options) {
|
|
405
|
+
options = {};
|
|
379
406
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
const redirectStatuses = [301, 302, 303, 307, 308];
|
|
384
|
-
export class Response extends Body {
|
|
385
|
-
constructor(bodyInit, options = {}) {
|
|
386
|
-
super();
|
|
387
|
-
this.type = 'default';
|
|
407
|
+
|
|
408
|
+
this.type = "default";
|
|
388
409
|
this.status = options.status === undefined ? 200 : options.status;
|
|
389
|
-
if (this.status < 200 || this.status > 599) {
|
|
390
|
-
throw new RangeError(`Failed to construct 'Response': The status provided (${this.status}) is outside the range [200, 599].`);
|
|
391
|
-
}
|
|
392
410
|
this.ok = this.status >= 200 && this.status < 300;
|
|
393
|
-
this.statusText =
|
|
411
|
+
this.statusText = "statusText" in options ? options.statusText : "OK";
|
|
394
412
|
this.headers = new Headers(options.headers);
|
|
395
|
-
this.url = options.url ||
|
|
413
|
+
this.url = options.url || "";
|
|
396
414
|
this._initBody(bodyInit);
|
|
397
415
|
}
|
|
398
|
-
|
|
416
|
+
|
|
417
|
+
Body.call(Response.prototype);
|
|
418
|
+
|
|
419
|
+
Response.prototype.clone = function () {
|
|
399
420
|
return new Response(this._bodyInit, {
|
|
400
421
|
status: this.status,
|
|
401
422
|
statusText: this.statusText,
|
|
402
423
|
headers: new Headers(this.headers),
|
|
403
|
-
url: this.url
|
|
424
|
+
url: this.url
|
|
404
425
|
});
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
response
|
|
409
|
-
response.
|
|
410
|
-
response.type = 'error';
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
Response.error = function () {
|
|
429
|
+
var response = new Response(null, { status: 0, statusText: "" });
|
|
430
|
+
response.type = "error";
|
|
411
431
|
return response;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
var redirectStatuses = [301, 302, 303, 307, 308];
|
|
435
|
+
|
|
436
|
+
Response.redirect = function (url, status) {
|
|
437
|
+
if (redirectStatuses.indexOf(status) === -1) {
|
|
438
|
+
throw new RangeError("Invalid status code");
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
return new Response(null, { status: status, headers: { location: url } });
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
exports.DOMException = global.DOMException;
|
|
445
|
+
try {
|
|
446
|
+
new exports.DOMException();
|
|
447
|
+
} catch (err) {
|
|
448
|
+
exports.DOMException = function (message, name) {
|
|
428
449
|
this.message = message;
|
|
429
450
|
this.name = name;
|
|
430
|
-
|
|
451
|
+
var error = Error(message);
|
|
431
452
|
this.stack = error.stack;
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
// fetch function
|
|
436
|
-
export function fetch(input, init) {
|
|
437
|
-
return new Promise((resolve, reject) => {
|
|
438
|
-
const request = new Request(input, init);
|
|
439
|
-
if (request.signal && request.signal.aborted) {
|
|
440
|
-
return reject(new DOMException('Aborted', 'AbortError'));
|
|
441
|
-
}
|
|
442
|
-
const xhr = new XMLHttpRequest();
|
|
443
|
-
function abortXhr() {
|
|
444
|
-
xhr.abort();
|
|
445
|
-
}
|
|
446
|
-
xhr.onload = function () {
|
|
447
|
-
const options = {
|
|
448
|
-
statusText: xhr.statusText,
|
|
449
|
-
headers: parseHeaders(xhr.getAllResponseHeaders() || ''),
|
|
450
|
-
};
|
|
451
|
-
// Local file handling
|
|
452
|
-
if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
|
|
453
|
-
options.status = 200;
|
|
454
|
-
}
|
|
455
|
-
else {
|
|
456
|
-
options.status = xhr.status;
|
|
457
|
-
}
|
|
458
|
-
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
|
459
|
-
// @ts-ignore
|
|
460
|
-
const body = 'response' in xhr ? xhr.response : xhr.responseText;
|
|
461
|
-
setTimeout(() => resolve(new Response(body, options)), 0);
|
|
462
453
|
};
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
try {
|
|
474
|
-
return url === '' && g.location.href ? g.location.href : url;
|
|
454
|
+
exports.DOMException.prototype = Object.create(Error.prototype);
|
|
455
|
+
exports.DOMException.prototype.constructor = exports.DOMException;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function fetch(input, init) {
|
|
459
|
+
return new Promise(function (resolve, reject) {
|
|
460
|
+
var request = new Request(input, init);
|
|
461
|
+
|
|
462
|
+
if (request.signal && request.signal.aborted) {
|
|
463
|
+
return reject(new exports.DOMException("Aborted", "AbortError"));
|
|
475
464
|
}
|
|
476
|
-
|
|
477
|
-
|
|
465
|
+
|
|
466
|
+
var xhr = new XMLHttpRequest();
|
|
467
|
+
|
|
468
|
+
function abortXhr() {
|
|
469
|
+
xhr.abort();
|
|
478
470
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
471
|
+
|
|
472
|
+
xhr.onload = function () {
|
|
473
|
+
var options = {
|
|
474
|
+
status: xhr.status,
|
|
475
|
+
statusText: xhr.statusText,
|
|
476
|
+
headers: parseHeaders(xhr.getAllResponseHeaders() || "")
|
|
477
|
+
};
|
|
478
|
+
options.url =
|
|
479
|
+
"responseURL" in xhr
|
|
480
|
+
? xhr.responseURL
|
|
481
|
+
: options.headers.get("X-Request-URL");
|
|
482
|
+
var body = "response" in xhr ? xhr.response : xhr.responseText;
|
|
483
|
+
resolve(new Response(body, options));
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
xhr.onerror = function () {
|
|
487
|
+
reject(new TypeError("Network request failed"));
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
xhr.ontimeout = function () {
|
|
491
|
+
reject(new TypeError("Network request failed"));
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
xhr.onabort = function () {
|
|
495
|
+
reject(new exports.DOMException("Aborted", "AbortError"));
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
xhr.open(request.method, request.url, true);
|
|
499
|
+
|
|
500
|
+
if (request.credentials === "include") {
|
|
501
|
+
xhr.withCredentials = true;
|
|
502
|
+
} else if (request.credentials === "omit") {
|
|
503
|
+
xhr.withCredentials = false;
|
|
490
504
|
}
|
|
491
|
-
|
|
492
|
-
|
|
505
|
+
|
|
506
|
+
if ("responseType" in xhr && support.blob) {
|
|
507
|
+
xhr.responseType = "blob";
|
|
493
508
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
Object.getOwnPropertyNames(init.headers).forEach((name) => {
|
|
498
|
-
names.push(normalizeName(name));
|
|
499
|
-
xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
|
|
500
|
-
});
|
|
501
|
-
request.headers.forEach((value, name) => {
|
|
502
|
-
if (!names.includes(name)) {
|
|
503
|
-
xhr.setRequestHeader(name, value);
|
|
504
|
-
}
|
|
509
|
+
|
|
510
|
+
request.headers.forEach(function (value, name) {
|
|
511
|
+
xhr.setRequestHeader(name, value);
|
|
505
512
|
});
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
513
|
+
|
|
514
|
+
if (request.signal) {
|
|
515
|
+
request.signal.addEventListener("abort", abortXhr);
|
|
516
|
+
|
|
517
|
+
xhr.onreadystatechange = function () {
|
|
518
|
+
// DONE (success or failure)
|
|
519
|
+
if (xhr.readyState === 4) {
|
|
520
|
+
request.signal.removeEventListener("abort", abortXhr);
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
xhr.send(
|
|
526
|
+
typeof request._bodyInit === "undefined" ? null : request._bodyInit
|
|
527
|
+
);
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
fetch.polyfill = true;
|
|
532
|
+
|
|
533
|
+
exports.Headers = Headers;
|
|
534
|
+
exports.Request = Request;
|
|
535
|
+
exports.Response = Response;
|
|
536
|
+
exports.fetch = fetch;
|
|
537
|
+
|
|
538
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
539
|
+
})();
|