@nativescript/core 8.9.0-napi-es5.0 → 8.9.0-napi.1
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/abortcontroller/abortsignal.js +16 -23
- package/abortcontroller/abortsignal.js.map +1 -1
- package/abortcontroller/index.js +14 -20
- package/abortcontroller/index.js.map +1 -1
- package/accessibility/accessibility-common.js +8 -8
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js +27 -27
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.js +22 -23
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.js +12 -22
- package/accessibility/accessibility-service-common.js.map +1 -1
- package/accessibility/accessibility-service.android.js +27 -39
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js +14 -17
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/font-scale-common.js +2 -2
- package/accessibility/font-scale-common.js.map +1 -1
- package/accessibility/font-scale.android.js +7 -8
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js +9 -10
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.js +77 -83
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.ios.js +34 -36
- package/accessibility/index.ios.js.map +1 -1
- package/animation-frame/animation-native.ios.js +1 -1
- package/animation-frame/animation-native.ios.js.map +1 -1
- package/animation-frame/index.js +16 -16
- package/animation-frame/index.js.map +1 -1
- package/application/application-common.js +196 -214
- package/application/application-common.js.map +1 -1
- package/application/application-shims.js +39 -39
- package/application/application-shims.js.map +1 -1
- package/application/application.android.js +110 -149
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +162 -197
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.js +11 -11
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js +1 -1
- package/application-settings/index.ios.js.map +1 -1
- package/bundle-entry-points.js +1 -1
- package/bundle-entry-points.js.map +1 -1
- package/color/color-common.js +157 -200
- package/color/color-common.js.map +1 -1
- package/color/index.android.js +4 -14
- package/color/index.android.js.map +1 -1
- package/color/index.ios.js +14 -24
- package/color/index.ios.js.map +1 -1
- package/color/known-colors.js +144 -144
- package/color/known-colors.js.map +1 -1
- package/connectivity/index.android.js +23 -23
- package/connectivity/index.android.js.map +1 -1
- package/connectivity/index.ios.js +25 -25
- package/connectivity/index.ios.js.map +1 -1
- package/console/index.js +20 -24
- package/console/index.js.map +1 -1
- package/core-types/index.js +38 -38
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js +104 -106
- package/css/CSS3Parser.js.map +1 -1
- package/css/CSSNativeScript.js +29 -34
- package/css/CSSNativeScript.js.map +1 -1
- package/css/css-tree-parser.js.map +1 -1
- package/css/parser.js +158 -178
- package/css/parser.js.map +1 -1
- package/css/system-classes.js +9 -9
- package/css/system-classes.js.map +1 -1
- package/css-mediaquery/index.js +27 -29
- package/css-mediaquery/index.js.map +1 -1
- package/data/observable/index.js +115 -124
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.js +119 -176
- package/data/observable-array/index.js.map +1 -1
- package/data/virtual-array/index.js +61 -74
- package/data/virtual-array/index.js.map +1 -1
- package/debugger/InspectorBackendCommands.js +137 -161
- package/debugger/InspectorBackendCommands.js.map +1 -1
- package/debugger/devtools-elements.common.js +20 -20
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +2 -2
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-node.js +61 -73
- package/debugger/dom-node.js.map +1 -1
- package/debugger/index.js +19 -19
- package/debugger/index.js.map +1 -1
- package/debugger/webinspector-css.js +25 -30
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.js +38 -43
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.js +103 -132
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.js +100 -128
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/file-system/file-system-access.android.js +414 -421
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +203 -213
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +294 -372
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.js +15 -18
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.js +9 -11
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/fps-meter/index.js +11 -11
- package/fps-meter/index.js.map +1 -1
- package/globals/index.js +88 -112
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js +5 -5
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.js +53 -54
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js +56 -58
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.js +19 -19
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.js +25 -37
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.js +17 -25
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.ios.js +25 -35
- package/image-asset/index.ios.js.map +1 -1
- package/image-source/image-source-common.js +2 -2
- package/image-source/image-source-common.js.map +1 -1
- package/image-source/index.android.js +152 -178
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +177 -203
- package/image-source/index.ios.js.map +1 -1
- package/index.js +4 -8
- package/index.js.map +1 -1
- package/matrix/index.js +17 -27
- package/matrix/index.js.map +1 -1
- package/media-query-list/index.js +61 -87
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/index.js +21 -24
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +24 -24
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.js +46 -46
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +1 -1
- package/platform/common.js +5 -5
- package/platform/common.js.map +1 -1
- package/platform/device/index.android.js +68 -107
- package/platform/device/index.android.js.map +1 -1
- package/platform/device/index.ios.js +62 -101
- package/platform/device/index.ios.js.map +1 -1
- package/platform/screen/index.android.js +32 -63
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +29 -60
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +40 -47
- package/profiling/index.js.map +1 -1
- package/text/text-common.js +36 -49
- package/text/text-common.js.map +1 -1
- package/timer/index.android.js +20 -30
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js +12 -22
- package/timer/index.ios.js.map +1 -1
- package/trace/index.js +26 -36
- package/trace/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +193 -252
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +170 -212
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +208 -251
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/activity-indicator-common.js +6 -11
- package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
- package/ui/activity-indicator/index.android.js +20 -26
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +23 -31
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.js +43 -50
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.js +3 -5
- package/ui/animation/animation-interfaces.js.map +1 -1
- package/ui/animation/index.android.js +90 -94
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.js +225 -191
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.js +67 -89
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.js +31 -31
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.js +37 -37
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +54 -59
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js +128 -158
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/button-common.js +18 -25
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.js +69 -80
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js +103 -114
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js +60 -78
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-expressions.js +93 -101
- package/ui/core/bindable/bindable-expressions.js.map +1 -1
- package/ui/core/bindable/bindable-resources.js +1 -1
- package/ui/core/bindable/index.js +136 -141
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.android.js +5 -7
- package/ui/core/control-state-change/index.android.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +9 -13
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.js +440 -489
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.js +348 -384
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.ios.js +364 -400
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.js +655 -944
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.android.js +15 -19
- package/ui/core/view/view-helper/index.android.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.js +81 -85
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +44 -49
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.js +371 -426
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/weak-event-listener/index.js +25 -26
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/date-picker/date-picker-common.js +30 -35
- package/ui/date-picker/date-picker-common.js.map +1 -1
- package/ui/date-picker/index.android.js +43 -51
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +51 -61
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +18 -18
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +86 -98
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +67 -80
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +29 -35
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +106 -112
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.js +47 -53
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/embedding/index.android.js +2 -3
- package/ui/embedding/index.android.js.map +1 -1
- package/ui/frame/activity.android.js +44 -44
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/callbacks/activity-callbacks.js +118 -123
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -1
- package/ui/frame/callbacks/fragment-callbacks.js +139 -141
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -1
- package/ui/frame/fragment.android.js +21 -21
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.ios.js +1 -1
- package/ui/frame/fragment.transitions.android.js +105 -114
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +1 -1
- package/ui/frame/frame-common.js +249 -285
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-helpers.js +1 -1
- package/ui/frame/frame-helpers.js.map +1 -1
- package/ui/frame/frame-stack.js +4 -4
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.js +239 -291
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.js +133 -167
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.js +15 -29
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js +108 -124
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +108 -121
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +42 -48
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/html-view-common.js +9 -14
- package/ui/html-view/html-view-common.js.map +1 -1
- package/ui/html-view/index.android.js +37 -43
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/html-view/index.ios.js +62 -73
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +47 -57
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +54 -59
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.js +65 -72
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image/symbol-effects-common.js +2 -6
- package/ui/image/symbol-effects-common.js.map +1 -1
- package/ui/image/symbol-effects.android.js +4 -10
- package/ui/image/symbol-effects.android.js.map +1 -1
- package/ui/image/symbol-effects.ios.js +7 -11
- package/ui/image/symbol-effects.ios.js.map +1 -1
- package/ui/image-cache/image-cache-common.js +57 -61
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.android.js +23 -27
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +24 -29
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/label/index.android.js +29 -38
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.js +89 -102
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +25 -30
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +6 -12
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +32 -40
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js +16 -21
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.js +11 -17
- package/ui/layouts/dock-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +45 -53
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +90 -115
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +92 -97
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +366 -427
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.js +159 -211
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.js +49 -55
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +340 -348
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.js +78 -106
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.js +25 -31
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +21 -27
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/root-layout/index.android.js +47 -46
- package/ui/layouts/root-layout/index.android.js.map +1 -1
- package/ui/layouts/root-layout/index.ios.js +54 -53
- package/ui/layouts/root-layout/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js +186 -190
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/layouts/stack-layout/index.android.js +6 -12
- package/ui/layouts/stack-layout/index.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +62 -69
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js +7 -12
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +10 -16
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +70 -76
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +13 -18
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js +42 -48
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +26 -36
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-picker/list-picker-common.js +27 -32
- package/ui/list-picker/list-picker-common.js.map +1 -1
- package/ui/list-view/index.android.js +98 -110
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.ios.js +121 -137
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +100 -116
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js +57 -65
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.ios.js +98 -107
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.js +113 -145
- package/ui/page/page-common.js.map +1 -1
- package/ui/placeholder/index.android.js +10 -16
- package/ui/placeholder/index.android.js.map +1 -1
- package/ui/placeholder/index.js +6 -12
- package/ui/placeholder/index.js.map +1 -1
- package/ui/progress/index.android.js +28 -34
- package/ui/progress/index.android.js.map +1 -1
- package/ui/progress/index.ios.js +29 -39
- package/ui/progress/index.ios.js.map +1 -1
- package/ui/progress/progress-common.js +11 -16
- package/ui/progress/progress-common.js.map +1 -1
- package/ui/proxy-view-container/index.js +90 -111
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/repeater/index.js +100 -112
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.android.d.ts +1 -1
- package/ui/scroll-view/index.android.js +75 -95
- package/ui/scroll-view/index.android.js.map +1 -1
- package/ui/scroll-view/index.ios.js +72 -92
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.js +45 -65
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +88 -94
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +74 -88
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.js +13 -18
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.js +98 -112
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +63 -80
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.js +61 -81
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.js +43 -49
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +49 -59
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/slider/slider-common.js +28 -35
- package/ui/slider/slider-common.js.map +1 -1
- package/ui/styling/background-common.js +98 -100
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.js +35 -38
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +252 -258
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/box-shadow.js +2 -6
- package/ui/styling/box-shadow.js.map +1 -1
- package/ui/styling/converters.js +7 -7
- package/ui/styling/converters.js.map +1 -1
- package/ui/styling/css-animation-parser.js +56 -69
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/css-selector.js +425 -522
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js +3 -3
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-utils.js +22 -22
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.js +44 -59
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font.android.js +34 -42
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +49 -54
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/linear-gradient.js +13 -17
- package/ui/styling/linear-gradient.js.map +1 -1
- package/ui/styling/style/index.js +36 -47
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.js +291 -306
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +377 -416
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +41 -47
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +57 -66
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/switch/switch-common.js +11 -16
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.android.js +187 -206
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +161 -177
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.js +143 -197
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/formatted-string.js +105 -158
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.js +130 -136
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +112 -120
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.js +102 -158
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-base/text-base-common.js +181 -268
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.js +18 -24
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-field/index.ios.js +70 -80
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-field/text-field-common.js +8 -13
- package/ui/text-field/text-field-common.js.map +1 -1
- package/ui/text-view/index.android.js +13 -19
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js +116 -124
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/text-view/text-view-common.js +3 -9
- package/ui/text-view/text-view-common.js.map +1 -1
- package/ui/time-picker/index.android.js +18 -24
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +61 -69
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/time-picker/time-picker-common.js +37 -42
- package/ui/time-picker/time-picker-common.js.map +1 -1
- package/ui/transition/fade-transition.android.js +8 -14
- package/ui/transition/fade-transition.android.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +4 -10
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/flip-transition.android.js +14 -18
- package/ui/transition/flip-transition.android.js.map +1 -1
- package/ui/transition/index.android.js +24 -27
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.ios.js +18 -22
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.js +4 -10
- package/ui/transition/modal-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +18 -25
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +57 -71
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +19 -27
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.js +8 -12
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +442 -539
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +77 -76
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.js +17 -22
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +7 -11
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/utils.ios.js +13 -13
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js +50 -64
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +50 -73
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js +29 -43
- package/ui/web-view/web-view-common.js.map +1 -1
- package/utils/android/index.js +26 -27
- package/utils/android/index.js.map +1 -1
- package/utils/common.js +49 -65
- package/utils/common.js.map +1 -1
- package/utils/constants.android.js +1 -1
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.ios.js +1 -1
- package/utils/constants.ios.js.map +1 -1
- package/utils/debug.js +32 -54
- package/utils/debug.js.map +1 -1
- package/utils/index.android.js +40 -36
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js +9 -9
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.js +45 -42
- package/utils/ios/index.js.map +1 -1
- package/utils/layout-helper/index.android.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.ios.js +2 -2
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.js +13 -13
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/lazy.js +2 -2
- package/utils/lazy.js.map +1 -1
- package/utils/macrotask-scheduler.js +6 -6
- package/utils/macrotask-scheduler.js.map +1 -1
- package/utils/mainthread-helper.android.js +4 -4
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.ios.js +1 -1
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/module-merge.js +1 -1
- package/utils/module-merge.js.map +1 -1
- package/utils/native-helper.android.js +19 -19
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.ios.js +16 -23
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/number-utils.js +3 -3
- package/utils/number-utils.js.map +1 -1
- package/utils/platform-check.js +6 -6
- package/utils/platform-check.js.map +1 -1
- package/utils/types.js +33 -43
- package/utils/types.js.map +1 -1
- package/wgc/crypto/SubtleCrypto.js +132 -167
- package/wgc/crypto/SubtleCrypto.js.map +1 -1
- package/wgc/crypto/index.d.ts +1 -1
- package/wgc/crypto/index.js +10 -18
- package/wgc/crypto/index.js.map +1 -1
- package/xhr/index.js +226 -308
- package/xhr/index.js.map +1 -1
- package/xml/index.js +78 -118
- package/xml/index.js.map +1 -1
|
@@ -2,8 +2,8 @@ import { encoding as textEncoding } from '../text';
|
|
|
2
2
|
import { iOSNativeHelper } from '../utils';
|
|
3
3
|
// TODO: Implement all the APIs receiving callback using async blocks
|
|
4
4
|
// TODO: Check whether we need try/catch blocks for the iOS implementation
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export class FileSystemAccess {
|
|
6
|
+
constructor() {
|
|
7
7
|
this.copy = this.copySync.bind(this);
|
|
8
8
|
this.readText = this.readTextSync.bind(this);
|
|
9
9
|
this.readBuffer = this.readBufferSync.bind(this);
|
|
@@ -15,35 +15,35 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
15
15
|
this.writeBuffer = this.writeBufferSync.bind(this);
|
|
16
16
|
this.write = this.writeSync.bind(this);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
getLastModified(path) {
|
|
19
|
+
const fileManager = NSFileManager.defaultManager;
|
|
20
|
+
const attributes = fileManager.attributesOfItemAtPathError(path);
|
|
21
21
|
if (attributes) {
|
|
22
22
|
return attributes.objectForKey('NSFileModificationDate');
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
return new Date();
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
}
|
|
28
|
+
getFileSize(path) {
|
|
29
|
+
const fileManager = NSFileManager.defaultManager;
|
|
30
|
+
const attributes = fileManager.attributesOfItemAtPathError(path);
|
|
31
31
|
if (attributes) {
|
|
32
32
|
return attributes.objectForKey('NSFileSize');
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
return 0;
|
|
36
36
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
37
|
+
}
|
|
38
|
+
getParent(path, onError) {
|
|
39
39
|
try {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const fileManager = NSFileManager.defaultManager;
|
|
41
|
+
const nsString = NSString.stringWithString(path);
|
|
42
|
+
const parentPath = nsString.stringByDeletingLastPathComponent;
|
|
43
|
+
const name = fileManager.displayNameAtPath(parentPath);
|
|
44
44
|
return {
|
|
45
45
|
path: parentPath.toString(),
|
|
46
|
-
name:
|
|
46
|
+
name: name,
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
catch (exception) {
|
|
@@ -52,13 +52,13 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
52
52
|
}
|
|
53
53
|
return undefined;
|
|
54
54
|
}
|
|
55
|
-
}
|
|
56
|
-
|
|
55
|
+
}
|
|
56
|
+
getFile(path, onError) {
|
|
57
57
|
try {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const fileManager = NSFileManager.defaultManager;
|
|
59
|
+
const exists = fileManager.fileExistsAtPath(path);
|
|
60
60
|
if (!exists) {
|
|
61
|
-
|
|
61
|
+
const parentPath = this.getParent(path, onError).path;
|
|
62
62
|
if (!fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(parentPath, true, null) || !fileManager.createFileAtPathContentsAttributes(path, null, null)) {
|
|
63
63
|
if (onError) {
|
|
64
64
|
onError(new Error("Failed to create file at path '" + path + "'"));
|
|
@@ -66,7 +66,7 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
66
66
|
return undefined;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
const fileName = fileManager.displayNameAtPath(path);
|
|
70
70
|
return {
|
|
71
71
|
path: path,
|
|
72
72
|
name: fileName,
|
|
@@ -79,11 +79,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
79
79
|
}
|
|
80
80
|
return undefined;
|
|
81
81
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
82
|
+
}
|
|
83
|
+
getFolder(path, onError) {
|
|
84
84
|
try {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const fileManager = NSFileManager.defaultManager;
|
|
86
|
+
const exists = this.folderExists(path);
|
|
87
87
|
if (!exists) {
|
|
88
88
|
try {
|
|
89
89
|
fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(path, true, null);
|
|
@@ -95,7 +95,7 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
95
95
|
return undefined;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
const dirName = fileManager.displayNameAtPath(path);
|
|
99
99
|
return {
|
|
100
100
|
path: path,
|
|
101
101
|
name: dirName,
|
|
@@ -107,13 +107,13 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
107
107
|
}
|
|
108
108
|
return undefined;
|
|
109
109
|
}
|
|
110
|
-
}
|
|
111
|
-
|
|
110
|
+
}
|
|
111
|
+
getExistingFolder(path, onError) {
|
|
112
112
|
try {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
const fileManager = NSFileManager.defaultManager;
|
|
114
|
+
const exists = this.folderExists(path);
|
|
115
115
|
if (exists) {
|
|
116
|
-
|
|
116
|
+
const dirName = fileManager.displayNameAtPath(path);
|
|
117
117
|
return {
|
|
118
118
|
path: path,
|
|
119
119
|
name: dirName,
|
|
@@ -127,21 +127,21 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
127
127
|
}
|
|
128
128
|
return undefined;
|
|
129
129
|
}
|
|
130
|
-
}
|
|
131
|
-
|
|
130
|
+
}
|
|
131
|
+
eachEntity(path, onEntity, onError) {
|
|
132
132
|
if (!onEntity) {
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
this.enumEntities(path, onEntity, onError);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
}
|
|
137
|
+
getEntities(path, onError) {
|
|
138
|
+
const fileInfos = new Array();
|
|
139
|
+
const onEntity = function (entity) {
|
|
140
140
|
fileInfos.push(entity);
|
|
141
141
|
return true;
|
|
142
142
|
};
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
let errorOccurred;
|
|
144
|
+
const localError = function (error) {
|
|
145
145
|
if (onError) {
|
|
146
146
|
onError(error);
|
|
147
147
|
}
|
|
@@ -152,37 +152,37 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
152
152
|
return fileInfos;
|
|
153
153
|
}
|
|
154
154
|
return null;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
}
|
|
156
|
+
fileExists(path) {
|
|
157
|
+
const result = this.exists(path);
|
|
158
158
|
return result.exists;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
}
|
|
160
|
+
folderExists(path) {
|
|
161
|
+
const result = this.exists(path);
|
|
162
162
|
return result.exists && result.isDirectory;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
}
|
|
164
|
+
exists(path) {
|
|
165
|
+
const fileManager = NSFileManager.defaultManager;
|
|
166
|
+
const isDirectory = new interop.Reference(interop.types.bool, false);
|
|
167
|
+
const exists = fileManager.fileExistsAtPathIsDirectory(path, isDirectory);
|
|
168
168
|
return { exists: exists, isDirectory: isDirectory.value };
|
|
169
|
-
}
|
|
170
|
-
|
|
169
|
+
}
|
|
170
|
+
concatPath(left, right) {
|
|
171
171
|
return NSString.pathWithComponents([left, right]).toString();
|
|
172
|
-
}
|
|
173
|
-
|
|
172
|
+
}
|
|
173
|
+
deleteFile(path, onError) {
|
|
174
174
|
this.deleteEntity(path, onError);
|
|
175
|
-
}
|
|
176
|
-
|
|
175
|
+
}
|
|
176
|
+
deleteFolder(path, onError) {
|
|
177
177
|
this.deleteEntity(path, onError);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
}
|
|
179
|
+
emptyFolder(path, onError) {
|
|
180
|
+
const fileManager = NSFileManager.defaultManager;
|
|
181
|
+
const entities = this.getEntities(path, onError);
|
|
182
182
|
if (!entities) {
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
for (
|
|
185
|
+
for (let i = 0; i < entities.length; i++) {
|
|
186
186
|
try {
|
|
187
187
|
fileManager.removeItemAtPathError(entities[i].path);
|
|
188
188
|
}
|
|
@@ -193,9 +193,9 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
}
|
|
197
|
+
rename(path, newPath, onError) {
|
|
198
|
+
const fileManager = NSFileManager.defaultManager;
|
|
199
199
|
try {
|
|
200
200
|
fileManager.moveItemAtPathToPathError(path, newPath);
|
|
201
201
|
}
|
|
@@ -204,26 +204,26 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
204
204
|
onError(new Error("Failed to rename '" + path + "' to '" + newPath + "': " + ex));
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
}
|
|
208
|
+
getLogicalRootPath() {
|
|
209
|
+
const mainBundlePath = NSBundle.mainBundle.bundlePath;
|
|
210
|
+
const resolvedPath = NSString.stringWithString(mainBundlePath).stringByResolvingSymlinksInPath;
|
|
211
211
|
return resolvedPath;
|
|
212
|
-
}
|
|
213
|
-
|
|
212
|
+
}
|
|
213
|
+
getDocumentsFolderPath() {
|
|
214
214
|
return this.getKnownPath(9 /* NSSearchPathDirectory.DocumentDirectory */);
|
|
215
|
-
}
|
|
216
|
-
|
|
215
|
+
}
|
|
216
|
+
getExternalDocumentsFolderPath() {
|
|
217
217
|
return this.getDocumentsFolderPath();
|
|
218
|
-
}
|
|
219
|
-
|
|
218
|
+
}
|
|
219
|
+
getTempFolderPath() {
|
|
220
220
|
return this.getKnownPath(13 /* NSSearchPathDirectory.CachesDirectory */);
|
|
221
|
-
}
|
|
222
|
-
|
|
221
|
+
}
|
|
222
|
+
getCurrentAppPath() {
|
|
223
223
|
return iOSNativeHelper.getCurrentAppPath();
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
}
|
|
225
|
+
copySync(src, dest, onError) {
|
|
226
|
+
const fileManager = NSFileManager.defaultManager;
|
|
227
227
|
try {
|
|
228
228
|
return fileManager.copyItemAtPathToPathError(src, dest);
|
|
229
229
|
}
|
|
@@ -231,7 +231,7 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
231
231
|
if (error.message.indexOf('exists') > -1) {
|
|
232
232
|
// check the size of file if empty remove then try copying again
|
|
233
233
|
// this could be zero due to using File.fromPath passing in a new file
|
|
234
|
-
|
|
234
|
+
let didRemove = false;
|
|
235
235
|
try {
|
|
236
236
|
didRemove = fileManager.removeItemAtPathError(dest);
|
|
237
237
|
return fileManager.copyItemAtPathToPathError(src, dest);
|
|
@@ -252,19 +252,18 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
return false;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return new Promise(function (resolve, reject) {
|
|
255
|
+
}
|
|
256
|
+
copyAsync(src, dest) {
|
|
257
|
+
return new Promise((resolve, reject) => {
|
|
259
258
|
try {
|
|
260
|
-
NSData.dataWithContentsOfFileCompletion(src,
|
|
259
|
+
NSData.dataWithContentsOfFileCompletion(src, (data) => {
|
|
261
260
|
if (!data) {
|
|
262
261
|
reject(new Error("Failed to read file at path '" + src));
|
|
263
262
|
}
|
|
264
263
|
else {
|
|
265
|
-
data.writeToFileAtomicallyCompletion(dest, true,
|
|
266
|
-
if (
|
|
267
|
-
|
|
264
|
+
data.writeToFileAtomicallyCompletion(dest, true, () => {
|
|
265
|
+
if (this.fileExists(dest)) {
|
|
266
|
+
const size = this.getFileSize(dest);
|
|
268
267
|
if (size === data.length) {
|
|
269
268
|
resolve(true);
|
|
270
269
|
}
|
|
@@ -283,12 +282,12 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
283
282
|
reject(ex);
|
|
284
283
|
}
|
|
285
284
|
});
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return new Promise(
|
|
285
|
+
}
|
|
286
|
+
readTextAsync(path, encoding) {
|
|
287
|
+
const actualEncoding = encoding || textEncoding.UTF_8;
|
|
288
|
+
return new Promise((resolve, reject) => {
|
|
290
289
|
try {
|
|
291
|
-
NSString.stringWithContentsOfFileEncodingCompletion(path, actualEncoding,
|
|
290
|
+
NSString.stringWithContentsOfFileEncodingCompletion(path, actualEncoding, (result, error) => {
|
|
292
291
|
if (error) {
|
|
293
292
|
reject(error);
|
|
294
293
|
}
|
|
@@ -301,11 +300,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
301
300
|
reject(new Error("Failed to read file at path '" + path + "': " + ex));
|
|
302
301
|
}
|
|
303
302
|
});
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
303
|
+
}
|
|
304
|
+
readTextSync(path, onError, encoding) {
|
|
305
|
+
const actualEncoding = encoding || textEncoding.UTF_8;
|
|
307
306
|
try {
|
|
308
|
-
|
|
307
|
+
const nsString = NSString.stringWithContentsOfFileEncodingError(path, actualEncoding);
|
|
309
308
|
return nsString.toString();
|
|
310
309
|
}
|
|
311
310
|
catch (ex) {
|
|
@@ -313,11 +312,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
313
312
|
onError(new Error("Failed to read file at path '" + path + "': " + ex));
|
|
314
313
|
}
|
|
315
314
|
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return new Promise(
|
|
315
|
+
}
|
|
316
|
+
readBufferAsync(path) {
|
|
317
|
+
return new Promise((resolve, reject) => {
|
|
319
318
|
try {
|
|
320
|
-
NSData.dataWithContentsOfFileCompletion(path,
|
|
319
|
+
NSData.dataWithContentsOfFileCompletion(path, (data) => {
|
|
321
320
|
resolve(interop.bufferFromData(data));
|
|
322
321
|
});
|
|
323
322
|
}
|
|
@@ -325,8 +324,8 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
325
324
|
reject(new Error("Failed to read file at path '" + path + "': " + ex));
|
|
326
325
|
}
|
|
327
326
|
});
|
|
328
|
-
}
|
|
329
|
-
|
|
327
|
+
}
|
|
328
|
+
readBufferSync(path, onError) {
|
|
330
329
|
try {
|
|
331
330
|
return interop.bufferFromData(NSData.dataWithContentsOfFile(path));
|
|
332
331
|
}
|
|
@@ -335,9 +334,9 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
335
334
|
onError(new Error("Failed to read file at path '" + path + "': " + ex));
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
return new Promise(
|
|
337
|
+
}
|
|
338
|
+
readAsync(path) {
|
|
339
|
+
return new Promise((resolve, reject) => {
|
|
341
340
|
try {
|
|
342
341
|
NSData.dataWithContentsOfFileCompletion(path, resolve);
|
|
343
342
|
}
|
|
@@ -345,8 +344,8 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
345
344
|
reject(new Error("Failed to read file at path '" + path + "': " + ex));
|
|
346
345
|
}
|
|
347
346
|
});
|
|
348
|
-
}
|
|
349
|
-
|
|
347
|
+
}
|
|
348
|
+
readSync(path, onError) {
|
|
350
349
|
try {
|
|
351
350
|
return NSData.dataWithContentsOfFile(path);
|
|
352
351
|
}
|
|
@@ -355,13 +354,13 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
355
354
|
onError(new Error("Failed to read file at path '" + path + "': " + ex));
|
|
356
355
|
}
|
|
357
356
|
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
return new Promise(
|
|
357
|
+
}
|
|
358
|
+
writeTextAsync(path, content, encoding) {
|
|
359
|
+
const nsString = NSString.stringWithString(content);
|
|
360
|
+
const actualEncoding = encoding || textEncoding.UTF_8;
|
|
361
|
+
return new Promise((resolve, reject) => {
|
|
363
362
|
try {
|
|
364
|
-
nsString.writeToFileAtomicallyEncodingCompletion(path, true, actualEncoding,
|
|
363
|
+
nsString.writeToFileAtomicallyEncodingCompletion(path, true, actualEncoding, (error) => {
|
|
365
364
|
if (error) {
|
|
366
365
|
reject(error);
|
|
367
366
|
}
|
|
@@ -374,10 +373,10 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
374
373
|
reject(new Error("Failed to write file at path '" + path + "': " + ex));
|
|
375
374
|
}
|
|
376
375
|
});
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
376
|
+
}
|
|
377
|
+
writeTextSync(path, content, onError, encoding) {
|
|
378
|
+
const nsString = NSString.stringWithString(content);
|
|
379
|
+
const actualEncoding = encoding || textEncoding.UTF_8;
|
|
381
380
|
// TODO: verify the useAuxiliaryFile parameter should be false
|
|
382
381
|
try {
|
|
383
382
|
nsString.writeToFileAtomicallyEncodingError(path, false, actualEncoding);
|
|
@@ -387,40 +386,39 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
387
386
|
onError(new Error("Failed to write to file '" + path + "': " + ex));
|
|
388
387
|
}
|
|
389
388
|
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
var _a;
|
|
389
|
+
}
|
|
390
|
+
static getBuffer(buffer) {
|
|
393
391
|
if (buffer instanceof ArrayBuffer) {
|
|
394
392
|
return NSData.dataWithData(buffer);
|
|
395
393
|
}
|
|
396
394
|
else {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
return NSData.dataWithBytesNoCopyLength(buf.bytes.add(
|
|
395
|
+
const buf = NSData.dataWithData(buffer?.buffer);
|
|
396
|
+
const len = buffer.byteLength;
|
|
397
|
+
return NSData.dataWithBytesNoCopyLength(buf.bytes.add(buffer?.byteOffset ?? 0), len);
|
|
400
398
|
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
return new Promise(
|
|
399
|
+
}
|
|
400
|
+
appendBufferAsync(path, content) {
|
|
401
|
+
return new Promise((resolve, reject) => {
|
|
404
402
|
try {
|
|
405
|
-
|
|
406
|
-
|
|
403
|
+
const handle = NSFileHandle.fileHandleForWritingAtPath(path);
|
|
404
|
+
handle.appendDataCompletion(FileSystemAccess.getBuffer(content), (error) => {
|
|
407
405
|
if (error) {
|
|
408
406
|
reject(error);
|
|
409
407
|
}
|
|
410
408
|
else {
|
|
411
409
|
resolve();
|
|
412
410
|
}
|
|
413
|
-
|
|
411
|
+
handle.closeFile();
|
|
414
412
|
});
|
|
415
413
|
}
|
|
416
414
|
catch (ex) {
|
|
417
415
|
reject(new Error("Failed to write file at path '" + path + "': " + ex));
|
|
418
416
|
}
|
|
419
417
|
});
|
|
420
|
-
}
|
|
421
|
-
|
|
418
|
+
}
|
|
419
|
+
appendBufferSync(path, content, onError) {
|
|
422
420
|
try {
|
|
423
|
-
|
|
421
|
+
const handle = NSFileHandle.fileHandleForWritingAtPath(path);
|
|
424
422
|
handle.seekToEndOfFile();
|
|
425
423
|
handle.writeData(FileSystemAccess.getBuffer(content));
|
|
426
424
|
handle.closeFile();
|
|
@@ -430,29 +428,29 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
430
428
|
onError(new Error("Failed to write to file '" + path + "': " + ex));
|
|
431
429
|
}
|
|
432
430
|
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
return new Promise(
|
|
431
|
+
}
|
|
432
|
+
appendAsync(path, content) {
|
|
433
|
+
return new Promise((resolve, reject) => {
|
|
436
434
|
try {
|
|
437
|
-
|
|
438
|
-
|
|
435
|
+
const handle = NSFileHandle.fileHandleForWritingAtPath(path);
|
|
436
|
+
handle.appendDataCompletion(content, (error) => {
|
|
439
437
|
if (error) {
|
|
440
438
|
reject(error);
|
|
441
439
|
}
|
|
442
440
|
else {
|
|
443
441
|
resolve();
|
|
444
442
|
}
|
|
445
|
-
|
|
443
|
+
handle.closeFile();
|
|
446
444
|
});
|
|
447
445
|
}
|
|
448
446
|
catch (ex) {
|
|
449
447
|
reject(new Error("Failed to write file at path '" + path + "': " + ex));
|
|
450
448
|
}
|
|
451
449
|
});
|
|
452
|
-
}
|
|
453
|
-
|
|
450
|
+
}
|
|
451
|
+
appendSync(path, content, onError) {
|
|
454
452
|
try {
|
|
455
|
-
|
|
453
|
+
const handle = NSFileHandle.fileHandleForWritingAtPath(path);
|
|
456
454
|
handle.seekToEndOfFile();
|
|
457
455
|
handle.writeData(content);
|
|
458
456
|
handle.closeFile();
|
|
@@ -462,36 +460,36 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
462
460
|
onError(new Error("Failed to write to file '" + path + "': " + ex));
|
|
463
461
|
}
|
|
464
462
|
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
return new Promise(
|
|
463
|
+
}
|
|
464
|
+
appendTextAsync(path, content, encoding) {
|
|
465
|
+
const nsString = NSString.stringWithString(content);
|
|
466
|
+
const actualEncoding = encoding || textEncoding.UTF_8;
|
|
467
|
+
return new Promise((resolve, reject) => {
|
|
470
468
|
try {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
469
|
+
const data = nsString.dataUsingEncoding(actualEncoding);
|
|
470
|
+
const handle = NSFileHandle.fileHandleForWritingAtPath(path);
|
|
471
|
+
handle.appendDataCompletion(data, (error) => {
|
|
474
472
|
if (error) {
|
|
475
473
|
reject(error);
|
|
476
474
|
}
|
|
477
475
|
else {
|
|
478
476
|
resolve();
|
|
479
477
|
}
|
|
480
|
-
|
|
478
|
+
handle.closeFile();
|
|
481
479
|
});
|
|
482
480
|
}
|
|
483
481
|
catch (ex) {
|
|
484
482
|
reject(new Error("Failed to append file at path '" + path + "': " + ex));
|
|
485
483
|
}
|
|
486
484
|
});
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
485
|
+
}
|
|
486
|
+
appendTextSync(path, content, onError, encoding) {
|
|
487
|
+
const nsString = NSString.stringWithString(content);
|
|
488
|
+
const actualEncoding = encoding || textEncoding.UTF_8;
|
|
491
489
|
// TODO: verify the useAuxiliaryFile parameter should be false
|
|
492
490
|
try {
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
const data = nsString.dataUsingEncoding(actualEncoding);
|
|
492
|
+
const handle = NSFileHandle.fileHandleForWritingAtPath(path);
|
|
495
493
|
handle.seekToEndOfFile();
|
|
496
494
|
handle.writeData(data);
|
|
497
495
|
handle.closeFile();
|
|
@@ -501,11 +499,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
501
499
|
onError(new Error("Failed to append to file '" + path + "': " + ex));
|
|
502
500
|
}
|
|
503
501
|
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return new Promise(
|
|
502
|
+
}
|
|
503
|
+
writeBufferAsync(path, content) {
|
|
504
|
+
return new Promise((resolve, reject) => {
|
|
507
505
|
try {
|
|
508
|
-
FileSystemAccess.getBuffer(content).writeToFileAtomicallyCompletion(path, true,
|
|
506
|
+
FileSystemAccess.getBuffer(content).writeToFileAtomicallyCompletion(path, true, () => {
|
|
509
507
|
resolve();
|
|
510
508
|
});
|
|
511
509
|
}
|
|
@@ -513,8 +511,8 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
513
511
|
reject(new Error("Failed to write file at path '" + path + "': " + ex));
|
|
514
512
|
}
|
|
515
513
|
});
|
|
516
|
-
}
|
|
517
|
-
|
|
514
|
+
}
|
|
515
|
+
writeBufferSync(path, content, onError) {
|
|
518
516
|
try {
|
|
519
517
|
FileSystemAccess.getBuffer(content).writeToFileAtomically(path, true);
|
|
520
518
|
}
|
|
@@ -523,11 +521,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
523
521
|
onError(new Error("Failed to write to file '" + path + "': " + ex));
|
|
524
522
|
}
|
|
525
523
|
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
return new Promise(
|
|
524
|
+
}
|
|
525
|
+
writeAsync(path, content) {
|
|
526
|
+
return new Promise((resolve, reject) => {
|
|
529
527
|
try {
|
|
530
|
-
content.writeToFileAtomicallyCompletion(path, true,
|
|
528
|
+
content.writeToFileAtomicallyCompletion(path, true, () => {
|
|
531
529
|
resolve();
|
|
532
530
|
});
|
|
533
531
|
}
|
|
@@ -535,8 +533,8 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
535
533
|
reject(new Error("Failed to write file at path '" + path + "': " + ex));
|
|
536
534
|
}
|
|
537
535
|
});
|
|
538
|
-
}
|
|
539
|
-
|
|
536
|
+
}
|
|
537
|
+
writeSync(path, content, onError) {
|
|
540
538
|
try {
|
|
541
539
|
content.writeToFileAtomically(path, true);
|
|
542
540
|
}
|
|
@@ -545,16 +543,16 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
545
543
|
onError(new Error("Failed to write to file '" + path + "': " + ex));
|
|
546
544
|
}
|
|
547
545
|
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
546
|
+
}
|
|
547
|
+
getKnownPath(folderType) {
|
|
548
|
+
const fileManager = NSFileManager.defaultManager;
|
|
549
|
+
const paths = fileManager.URLsForDirectoryInDomains(folderType, 1 /* NSSearchPathDomainMask.UserDomainMask */);
|
|
550
|
+
const url = paths.objectAtIndex(0);
|
|
553
551
|
return url.path;
|
|
554
|
-
}
|
|
552
|
+
}
|
|
555
553
|
// TODO: This method is the same as in the iOS implementation.
|
|
556
554
|
// Make it in a separate file / module so it can be reused from both implementations.
|
|
557
|
-
|
|
555
|
+
getFileExtension(path) {
|
|
558
556
|
// TODO [For Panata]: The definitions currently specify "any" as a return value of this method
|
|
559
557
|
//const nsString = Foundation.NSString.stringWithString(path);
|
|
560
558
|
//const extension = nsString.pathExtension();
|
|
@@ -562,14 +560,14 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
562
560
|
// extension = extension.concat(".", extension);
|
|
563
561
|
//}
|
|
564
562
|
//return extension;
|
|
565
|
-
|
|
563
|
+
const dotIndex = path.lastIndexOf('.');
|
|
566
564
|
if (dotIndex && dotIndex >= 0 && dotIndex < path.length) {
|
|
567
565
|
return path.substring(dotIndex);
|
|
568
566
|
}
|
|
569
567
|
return '';
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
|
|
568
|
+
}
|
|
569
|
+
deleteEntity(path, onError) {
|
|
570
|
+
const fileManager = NSFileManager.defaultManager;
|
|
573
571
|
try {
|
|
574
572
|
fileManager.removeItemAtPathError(path);
|
|
575
573
|
}
|
|
@@ -578,11 +576,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
578
576
|
onError(new Error("Failed to delete file at path '" + path + "': " + ex));
|
|
579
577
|
}
|
|
580
578
|
}
|
|
581
|
-
}
|
|
582
|
-
|
|
579
|
+
}
|
|
580
|
+
enumEntities(path, callback, onError) {
|
|
583
581
|
try {
|
|
584
|
-
|
|
585
|
-
|
|
582
|
+
const fileManager = NSFileManager.defaultManager;
|
|
583
|
+
let files;
|
|
586
584
|
try {
|
|
587
585
|
files = fileManager.contentsOfDirectoryAtPathError(path);
|
|
588
586
|
}
|
|
@@ -592,9 +590,9 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
592
590
|
}
|
|
593
591
|
return;
|
|
594
592
|
}
|
|
595
|
-
for (
|
|
596
|
-
|
|
597
|
-
|
|
593
|
+
for (let i = 0; i < files.count; i++) {
|
|
594
|
+
const file = files.objectAtIndex(i);
|
|
595
|
+
const info = {
|
|
598
596
|
path: this.concatPath(path, file),
|
|
599
597
|
name: file,
|
|
600
598
|
extension: '',
|
|
@@ -602,7 +600,7 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
602
600
|
if (!this.folderExists(this.joinPath(path, file))) {
|
|
603
601
|
info.extension = this.getFileExtension(info.path);
|
|
604
602
|
}
|
|
605
|
-
|
|
603
|
+
const retVal = callback(info);
|
|
606
604
|
if (retVal === false) {
|
|
607
605
|
// the callback returned false meaning we should stop the iteration
|
|
608
606
|
break;
|
|
@@ -614,32 +612,24 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
614
612
|
onError(ex);
|
|
615
613
|
}
|
|
616
614
|
}
|
|
617
|
-
}
|
|
618
|
-
|
|
615
|
+
}
|
|
616
|
+
getPathSeparator() {
|
|
619
617
|
return '/';
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
618
|
+
}
|
|
619
|
+
normalizePath(path) {
|
|
620
|
+
const nsString = NSString.stringWithString(path);
|
|
621
|
+
const normalized = nsString.stringByStandardizingPath;
|
|
624
622
|
return normalized;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
|
|
623
|
+
}
|
|
624
|
+
joinPath(left, right) {
|
|
625
|
+
const nsString = NSString.stringWithString(left);
|
|
628
626
|
return nsString.stringByAppendingPathComponent(right);
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
return iOSNativeHelper.joinPaths
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
}());
|
|
635
|
-
export { FileSystemAccess };
|
|
627
|
+
}
|
|
628
|
+
joinPaths(paths) {
|
|
629
|
+
return iOSNativeHelper.joinPaths(...paths);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
636
632
|
// stub to avoid cross platform warning
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
function FileSystemAccess29() {
|
|
640
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
641
|
-
}
|
|
642
|
-
return FileSystemAccess29;
|
|
643
|
-
}(FileSystemAccess));
|
|
644
|
-
export { FileSystemAccess29 };
|
|
633
|
+
export class FileSystemAccess29 extends FileSystemAccess {
|
|
634
|
+
}
|
|
645
635
|
//# sourceMappingURL=file-system-access.ios.js.map
|