@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
package/css/parser.js
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
import { Color } from '../color';
|
|
2
2
|
import { getKnownColor } from '../color/known-colors';
|
|
3
|
-
|
|
3
|
+
const urlRegEx = /\s*url\((?:(['"])(.*?)\1|([^)]*))\)\s*/gy;
|
|
4
4
|
// const urlRegEx = /(?:^|\s*#[a-fA-F0-9]{3,6}\s*|^\s*)url\((['"]?)(.*?)\1\)\s*/gi;
|
|
5
|
-
export function parseURL(text, start) {
|
|
6
|
-
if (start === void 0) { start = 0; }
|
|
5
|
+
export function parseURL(text, start = 0) {
|
|
7
6
|
urlRegEx.lastIndex = start;
|
|
8
|
-
|
|
7
|
+
const result = urlRegEx.exec(text);
|
|
9
8
|
if (!result) {
|
|
10
9
|
return null;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return { start
|
|
11
|
+
const end = urlRegEx.lastIndex;
|
|
12
|
+
const value = result[2] || result[3];
|
|
13
|
+
return { start, end, value };
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
export function parseHexColor(text, start) {
|
|
18
|
-
if (start === void 0) { start = 0; }
|
|
15
|
+
const hexColorRegEx = /\s*#((?:[0-9A-F]{8})|(?:[0-9A-F]{6})|(?:[0-9A-F]{4})|(?:[0-9A-F]{3}))\s*/giy;
|
|
16
|
+
export function parseHexColor(text, start = 0) {
|
|
19
17
|
hexColorRegEx.lastIndex = start;
|
|
20
|
-
|
|
18
|
+
const result = hexColorRegEx.exec(text);
|
|
21
19
|
if (!result) {
|
|
22
20
|
return null;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
return { start
|
|
22
|
+
const end = hexColorRegEx.lastIndex;
|
|
23
|
+
return { start, end, value: new Color('#' + result[1]) };
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
export function parseCssColor(text, start) {
|
|
29
|
-
if (start === void 0) { start = 0; }
|
|
25
|
+
const cssColorRegEx = /\s*((?:rgb|rgba|hsl|hsla|hsv|hsva)\([^\(\)]*\))/gy;
|
|
26
|
+
export function parseCssColor(text, start = 0) {
|
|
30
27
|
cssColorRegEx.lastIndex = start;
|
|
31
|
-
|
|
28
|
+
const result = cssColorRegEx.exec(text);
|
|
32
29
|
if (!result) {
|
|
33
30
|
return null;
|
|
34
31
|
}
|
|
35
|
-
|
|
32
|
+
const end = cssColorRegEx.lastIndex;
|
|
36
33
|
try {
|
|
37
|
-
return { start
|
|
34
|
+
return { start, end, value: new Color(result[1]) };
|
|
38
35
|
}
|
|
39
|
-
catch
|
|
36
|
+
catch {
|
|
40
37
|
return null;
|
|
41
38
|
}
|
|
42
39
|
}
|
|
@@ -45,9 +42,9 @@ export function convertHSLToRGBColor(hue, saturation, lightness) {
|
|
|
45
42
|
// https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB
|
|
46
43
|
hue /= 60;
|
|
47
44
|
lightness /= 100;
|
|
48
|
-
|
|
45
|
+
const chroma = ((1 - Math.abs(2 * lightness - 1)) * saturation) / 100, X = chroma * (1 - Math.abs((hue % 2) - 1));
|
|
49
46
|
// Add lightness match to all RGB components beforehand
|
|
50
|
-
|
|
47
|
+
let { m: r, m: g, m: b } = { m: lightness - chroma / 2 };
|
|
51
48
|
if (0 <= hue && hue < 1) {
|
|
52
49
|
r += chroma;
|
|
53
50
|
g += X;
|
|
@@ -78,62 +75,54 @@ export function convertHSLToRGBColor(hue, saturation, lightness) {
|
|
|
78
75
|
b: Math.round(b * 0xff),
|
|
79
76
|
};
|
|
80
77
|
}
|
|
81
|
-
export function parseColorKeyword(value, start, keyword) {
|
|
82
|
-
|
|
83
|
-
var parseColor = keyword && getKnownColor(keyword.value);
|
|
78
|
+
export function parseColorKeyword(value, start, keyword = parseKeyword(value, start)) {
|
|
79
|
+
const parseColor = keyword && getKnownColor(keyword.value);
|
|
84
80
|
if (parseColor != null) {
|
|
85
|
-
|
|
86
|
-
return { start
|
|
81
|
+
const end = keyword.end;
|
|
82
|
+
return { start, end, value: new Color(parseColor) };
|
|
87
83
|
}
|
|
88
84
|
return null;
|
|
89
85
|
}
|
|
90
|
-
export function parseColor(value, start, keyword) {
|
|
91
|
-
if (start === void 0) { start = 0; }
|
|
92
|
-
if (keyword === void 0) { keyword = parseKeyword(value, start); }
|
|
86
|
+
export function parseColor(value, start = 0, keyword = parseKeyword(value, start)) {
|
|
93
87
|
return parseHexColor(value, start) || parseColorKeyword(value, start, keyword) || parseCssColor(value, start);
|
|
94
88
|
}
|
|
95
|
-
|
|
96
|
-
function parseKeyword(text, start) {
|
|
97
|
-
if (start === void 0) { start = 0; }
|
|
89
|
+
const keywordRegEx = /\s*([a-z][\w\-]*)\s*/giy;
|
|
90
|
+
function parseKeyword(text, start = 0) {
|
|
98
91
|
keywordRegEx.lastIndex = start;
|
|
99
|
-
|
|
92
|
+
const result = keywordRegEx.exec(text);
|
|
100
93
|
if (!result) {
|
|
101
94
|
return null;
|
|
102
95
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return { start
|
|
96
|
+
const end = keywordRegEx.lastIndex;
|
|
97
|
+
const value = result[1];
|
|
98
|
+
return { start, end, value };
|
|
106
99
|
}
|
|
107
|
-
|
|
108
|
-
export function parseRepeat(value, start, keyword) {
|
|
109
|
-
if (start === void 0) { start = 0; }
|
|
110
|
-
if (keyword === void 0) { keyword = parseKeyword(value, start); }
|
|
100
|
+
const backgroundRepeatKeywords = new Set(['repeat', 'repeat-x', 'repeat-y', 'no-repeat']);
|
|
101
|
+
export function parseRepeat(value, start = 0, keyword = parseKeyword(value, start)) {
|
|
111
102
|
if (keyword && backgroundRepeatKeywords.has(keyword.value)) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return { start
|
|
103
|
+
const end = keyword.end;
|
|
104
|
+
const value = keyword.value;
|
|
105
|
+
return { start, end, value };
|
|
115
106
|
}
|
|
116
107
|
return null;
|
|
117
108
|
}
|
|
118
|
-
|
|
119
|
-
export function parseUnit(text, start) {
|
|
120
|
-
if (start === void 0) { start = 0; }
|
|
109
|
+
const unitRegEx = /\s*([+\-]?(?:\d+\.\d+|\d+|\.\d+)(?:[eE][+\-]?\d+)?)([a-zA-Z]+|%)?\s*/gy;
|
|
110
|
+
export function parseUnit(text, start = 0) {
|
|
121
111
|
unitRegEx.lastIndex = start;
|
|
122
|
-
|
|
112
|
+
const result = unitRegEx.exec(text);
|
|
123
113
|
if (!result) {
|
|
124
114
|
return null;
|
|
125
115
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return { start
|
|
116
|
+
const end = unitRegEx.lastIndex;
|
|
117
|
+
const value = parseFloat(result[1]);
|
|
118
|
+
const unit = result[2] || 'dip';
|
|
119
|
+
return { start, end, value: { value, unit } };
|
|
130
120
|
}
|
|
131
|
-
export function parsePercentageOrLength(text, start) {
|
|
132
|
-
|
|
133
|
-
var unitResult = parseUnit(text, start);
|
|
121
|
+
export function parsePercentageOrLength(text, start = 0) {
|
|
122
|
+
const unitResult = parseUnit(text, start);
|
|
134
123
|
if (unitResult) {
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
const { start, end } = unitResult;
|
|
125
|
+
const value = unitResult.value;
|
|
137
126
|
if (value.unit === '%') {
|
|
138
127
|
value.value /= 100;
|
|
139
128
|
}
|
|
@@ -146,81 +135,76 @@ export function parsePercentageOrLength(text, start) {
|
|
|
146
135
|
else {
|
|
147
136
|
return null;
|
|
148
137
|
}
|
|
149
|
-
return { start
|
|
138
|
+
return { start, end, value };
|
|
150
139
|
}
|
|
151
140
|
return null;
|
|
152
141
|
}
|
|
153
|
-
|
|
154
|
-
deg:
|
|
155
|
-
start
|
|
156
|
-
end
|
|
142
|
+
const angleUnitsToRadMap = {
|
|
143
|
+
deg: (start, end, deg) => ({
|
|
144
|
+
start,
|
|
145
|
+
end,
|
|
157
146
|
value: (deg / 180) * Math.PI,
|
|
158
|
-
})
|
|
159
|
-
rad:
|
|
160
|
-
start
|
|
161
|
-
end
|
|
147
|
+
}),
|
|
148
|
+
rad: (start, end, rad) => ({
|
|
149
|
+
start,
|
|
150
|
+
end,
|
|
162
151
|
value: rad,
|
|
163
|
-
})
|
|
164
|
-
grad:
|
|
165
|
-
start
|
|
166
|
-
end
|
|
152
|
+
}),
|
|
153
|
+
grad: (start, end, grad) => ({
|
|
154
|
+
start,
|
|
155
|
+
end,
|
|
167
156
|
value: (grad / 200) * Math.PI,
|
|
168
|
-
})
|
|
169
|
-
turn:
|
|
170
|
-
start
|
|
171
|
-
end
|
|
157
|
+
}),
|
|
158
|
+
turn: (start, end, turn) => ({
|
|
159
|
+
start,
|
|
160
|
+
end,
|
|
172
161
|
value: turn * Math.PI * 2,
|
|
173
|
-
})
|
|
162
|
+
}),
|
|
174
163
|
};
|
|
175
|
-
export function parseAngle(value, start) {
|
|
176
|
-
|
|
177
|
-
var angleResult = parseUnit(value, start);
|
|
164
|
+
export function parseAngle(value, start = 0) {
|
|
165
|
+
const angleResult = parseUnit(value, start);
|
|
178
166
|
if (angleResult) {
|
|
179
|
-
|
|
180
|
-
return (angleUnitsToRadMap[
|
|
167
|
+
const { start, end, value } = angleResult;
|
|
168
|
+
return (angleUnitsToRadMap[value.unit] || ((_, __, ___) => null))(start, end, value.value);
|
|
181
169
|
}
|
|
182
170
|
return null;
|
|
183
171
|
}
|
|
184
|
-
|
|
185
|
-
export function parseBackgroundSize(value, start, keyword) {
|
|
186
|
-
|
|
187
|
-
if (keyword === void 0) { keyword = parseKeyword(value, start); }
|
|
188
|
-
var end = start;
|
|
172
|
+
const backgroundSizeKeywords = new Set(['auto', 'contain', 'cover']);
|
|
173
|
+
export function parseBackgroundSize(value, start = 0, keyword = parseKeyword(value, start)) {
|
|
174
|
+
let end = start;
|
|
189
175
|
if (keyword && backgroundSizeKeywords.has(keyword.value)) {
|
|
190
176
|
end = keyword.end;
|
|
191
|
-
|
|
192
|
-
return { start
|
|
177
|
+
const value = keyword.value;
|
|
178
|
+
return { start, end, value };
|
|
193
179
|
}
|
|
194
180
|
// Parse one or two lengths... the other will be "auto"
|
|
195
|
-
|
|
181
|
+
const firstLength = parsePercentageOrLength(value, end);
|
|
196
182
|
if (firstLength) {
|
|
197
183
|
end = firstLength.end;
|
|
198
|
-
|
|
184
|
+
const secondLength = parsePercentageOrLength(value, firstLength.end);
|
|
199
185
|
if (secondLength) {
|
|
200
186
|
end = secondLength.end;
|
|
201
187
|
return {
|
|
202
|
-
start
|
|
203
|
-
end
|
|
188
|
+
start,
|
|
189
|
+
end,
|
|
204
190
|
value: { x: firstLength.value, y: secondLength.value },
|
|
205
191
|
};
|
|
206
192
|
}
|
|
207
193
|
else {
|
|
208
|
-
return { start
|
|
194
|
+
return { start, end, value: { x: firstLength.value, y: 'auto' } };
|
|
209
195
|
}
|
|
210
196
|
}
|
|
211
197
|
return null;
|
|
212
198
|
}
|
|
213
|
-
|
|
214
|
-
|
|
199
|
+
const backgroundPositionKeywords = Object.freeze(new Set(['left', 'right', 'top', 'bottom', 'center']));
|
|
200
|
+
const backgroundPositionKeywordsDirection = {
|
|
215
201
|
left: 'x',
|
|
216
202
|
right: 'x',
|
|
217
203
|
center: 'center',
|
|
218
204
|
top: 'y',
|
|
219
205
|
bottom: 'y',
|
|
220
206
|
};
|
|
221
|
-
export function parseBackgroundPosition(text, start, keyword) {
|
|
222
|
-
if (start === void 0) { start = 0; }
|
|
223
|
-
if (keyword === void 0) { keyword = parseKeyword(text, start); }
|
|
207
|
+
export function parseBackgroundPosition(text, start = 0, keyword = parseKeyword(text, start)) {
|
|
224
208
|
function formatH(align, offset) {
|
|
225
209
|
if (align.value === 'center') {
|
|
226
210
|
return 'center';
|
|
@@ -239,29 +223,29 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
239
223
|
}
|
|
240
224
|
return align.value;
|
|
241
225
|
}
|
|
242
|
-
|
|
226
|
+
let end = start;
|
|
243
227
|
if (keyword && backgroundPositionKeywords.has(keyword.value)) {
|
|
244
228
|
end = keyword.end;
|
|
245
|
-
|
|
246
|
-
|
|
229
|
+
const firstDirection = backgroundPositionKeywordsDirection[keyword.value];
|
|
230
|
+
const firstLength = firstDirection !== 'center' && parsePercentageOrLength(text, end);
|
|
247
231
|
if (firstLength) {
|
|
248
232
|
end = firstLength.end;
|
|
249
233
|
}
|
|
250
|
-
|
|
234
|
+
const secondKeyword = parseKeyword(text, end);
|
|
251
235
|
if (secondKeyword && backgroundPositionKeywords.has(secondKeyword.value)) {
|
|
252
236
|
end = secondKeyword.end;
|
|
253
|
-
|
|
237
|
+
const secondDirection = backgroundPositionKeywordsDirection[secondKeyword.end];
|
|
254
238
|
if (firstDirection === secondDirection && firstDirection !== 'center') {
|
|
255
239
|
return null; // Reject pair of both horizontal or both vertical alignments.
|
|
256
240
|
}
|
|
257
|
-
|
|
241
|
+
const secondLength = secondDirection !== 'center' && parsePercentageOrLength(text, end);
|
|
258
242
|
if (secondLength) {
|
|
259
243
|
end = secondLength.end;
|
|
260
244
|
}
|
|
261
245
|
if ((firstDirection === secondDirection && secondDirection === 'center') || firstDirection === 'x' || secondDirection === 'y') {
|
|
262
246
|
return {
|
|
263
|
-
start
|
|
264
|
-
end
|
|
247
|
+
start,
|
|
248
|
+
end,
|
|
265
249
|
value: {
|
|
266
250
|
x: formatH(keyword, firstLength),
|
|
267
251
|
y: formatV(secondKeyword, secondLength),
|
|
@@ -270,8 +254,8 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
270
254
|
}
|
|
271
255
|
else {
|
|
272
256
|
return {
|
|
273
|
-
start
|
|
274
|
-
end
|
|
257
|
+
start,
|
|
258
|
+
end,
|
|
275
259
|
value: {
|
|
276
260
|
x: formatH(secondKeyword, secondLength),
|
|
277
261
|
y: formatV(keyword, firstLength),
|
|
@@ -281,12 +265,12 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
281
265
|
}
|
|
282
266
|
else {
|
|
283
267
|
if (firstDirection === 'center') {
|
|
284
|
-
return { start
|
|
268
|
+
return { start, end, value: { x: 'center', y: 'center' } };
|
|
285
269
|
}
|
|
286
270
|
else if (firstDirection === 'x') {
|
|
287
271
|
return {
|
|
288
|
-
start
|
|
289
|
-
end
|
|
272
|
+
start,
|
|
273
|
+
end,
|
|
290
274
|
value: {
|
|
291
275
|
x: formatH(keyword, firstLength),
|
|
292
276
|
y: 'center',
|
|
@@ -295,8 +279,8 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
295
279
|
}
|
|
296
280
|
else {
|
|
297
281
|
return {
|
|
298
|
-
start
|
|
299
|
-
end
|
|
282
|
+
start,
|
|
283
|
+
end,
|
|
300
284
|
value: {
|
|
301
285
|
x: 'center',
|
|
302
286
|
y: formatV(keyword, firstLength),
|
|
@@ -306,15 +290,15 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
306
290
|
}
|
|
307
291
|
}
|
|
308
292
|
else {
|
|
309
|
-
|
|
293
|
+
const firstLength = parsePercentageOrLength(text, end);
|
|
310
294
|
if (firstLength) {
|
|
311
295
|
end = firstLength.end;
|
|
312
|
-
|
|
296
|
+
const secondLength = parsePercentageOrLength(text, end);
|
|
313
297
|
if (secondLength) {
|
|
314
298
|
end = secondLength.end;
|
|
315
299
|
return {
|
|
316
|
-
start
|
|
317
|
-
end
|
|
300
|
+
start,
|
|
301
|
+
end,
|
|
318
302
|
value: {
|
|
319
303
|
x: { align: 'left', offset: firstLength.value },
|
|
320
304
|
y: { align: 'top', offset: secondLength.value },
|
|
@@ -323,8 +307,8 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
323
307
|
}
|
|
324
308
|
else {
|
|
325
309
|
return {
|
|
326
|
-
start
|
|
327
|
-
end
|
|
310
|
+
start,
|
|
311
|
+
end,
|
|
328
312
|
value: {
|
|
329
313
|
x: { align: 'left', offset: firstLength.value },
|
|
330
314
|
y: 'center',
|
|
@@ -337,14 +321,14 @@ export function parseBackgroundPosition(text, start, keyword) {
|
|
|
337
321
|
}
|
|
338
322
|
}
|
|
339
323
|
}
|
|
340
|
-
|
|
341
|
-
|
|
324
|
+
const directionRegEx = /\s*to\s*(left|right|top|bottom)\s*(left|right|top|bottom)?\s*/gy;
|
|
325
|
+
const sideDirections = {
|
|
342
326
|
top: (Math.PI * 0) / 2,
|
|
343
327
|
right: (Math.PI * 1) / 2,
|
|
344
328
|
bottom: (Math.PI * 2) / 2,
|
|
345
329
|
left: (Math.PI * 3) / 2,
|
|
346
330
|
};
|
|
347
|
-
|
|
331
|
+
const cornerDirections = {
|
|
348
332
|
top: {
|
|
349
333
|
right: (Math.PI * 1) / 4,
|
|
350
334
|
left: (Math.PI * 7) / 4,
|
|
@@ -362,50 +346,49 @@ var cornerDirections = {
|
|
|
362
346
|
bottom: (Math.PI * 5) / 4,
|
|
363
347
|
},
|
|
364
348
|
};
|
|
365
|
-
function parseDirection(text, start) {
|
|
366
|
-
if (start === void 0) { start = 0; }
|
|
349
|
+
function parseDirection(text, start = 0) {
|
|
367
350
|
directionRegEx.lastIndex = start;
|
|
368
|
-
|
|
351
|
+
const result = directionRegEx.exec(text);
|
|
369
352
|
if (!result) {
|
|
370
353
|
return null;
|
|
371
354
|
}
|
|
372
|
-
|
|
373
|
-
|
|
355
|
+
const end = directionRegEx.lastIndex;
|
|
356
|
+
const firstDirection = result[1];
|
|
374
357
|
if (result[2]) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
return value === undefined ? null : { start
|
|
358
|
+
const secondDirection = result[2];
|
|
359
|
+
const value = cornerDirections[firstDirection][secondDirection];
|
|
360
|
+
return value === undefined ? null : { start, end, value };
|
|
378
361
|
}
|
|
379
362
|
else {
|
|
380
|
-
return { start
|
|
363
|
+
return { start, end, value: sideDirections[firstDirection] };
|
|
381
364
|
}
|
|
382
365
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
366
|
+
const openingBracketRegEx = /\s*\(\s*/gy;
|
|
367
|
+
const closingBracketRegEx = /\s*\)\s*/gy;
|
|
368
|
+
const closingBracketOrCommaRegEx = /\s*([),])\s*/gy;
|
|
386
369
|
function parseArgumentsList(text, start, argument) {
|
|
387
370
|
openingBracketRegEx.lastIndex = start;
|
|
388
|
-
|
|
371
|
+
const openingBracket = openingBracketRegEx.exec(text);
|
|
389
372
|
if (!openingBracket) {
|
|
390
373
|
return null;
|
|
391
374
|
}
|
|
392
|
-
|
|
393
|
-
|
|
375
|
+
let end = openingBracketRegEx.lastIndex;
|
|
376
|
+
const value = [];
|
|
394
377
|
closingBracketRegEx.lastIndex = end;
|
|
395
|
-
|
|
378
|
+
const closingBracket = closingBracketRegEx.exec(text);
|
|
396
379
|
if (closingBracket) {
|
|
397
|
-
return { start
|
|
380
|
+
return { start, end, value };
|
|
398
381
|
}
|
|
399
382
|
// eslint-disable-next-line no-constant-condition
|
|
400
|
-
for (
|
|
401
|
-
|
|
383
|
+
for (let index = 0; true; index++) {
|
|
384
|
+
const arg = argument(text, end, index);
|
|
402
385
|
if (!arg) {
|
|
403
386
|
return null;
|
|
404
387
|
}
|
|
405
388
|
end = arg.end;
|
|
406
389
|
value.push(arg);
|
|
407
390
|
closingBracketOrCommaRegEx.lastIndex = end;
|
|
408
|
-
|
|
391
|
+
const closingBracketOrComma = closingBracketOrCommaRegEx.exec(text);
|
|
409
392
|
if (closingBracketOrComma) {
|
|
410
393
|
end = closingBracketOrCommaRegEx.lastIndex;
|
|
411
394
|
if (closingBracketOrComma[1] === ',') {
|
|
@@ -413,7 +396,7 @@ function parseArgumentsList(text, start, argument) {
|
|
|
413
396
|
continue;
|
|
414
397
|
}
|
|
415
398
|
else if (closingBracketOrComma[1] === ')') {
|
|
416
|
-
return { start
|
|
399
|
+
return { start, end, value };
|
|
417
400
|
}
|
|
418
401
|
}
|
|
419
402
|
else {
|
|
@@ -421,45 +404,43 @@ function parseArgumentsList(text, start, argument) {
|
|
|
421
404
|
}
|
|
422
405
|
}
|
|
423
406
|
}
|
|
424
|
-
export function parseColorStop(text, start) {
|
|
425
|
-
|
|
426
|
-
var color = parseColor(text, start);
|
|
407
|
+
export function parseColorStop(text, start = 0) {
|
|
408
|
+
const color = parseColor(text, start);
|
|
427
409
|
if (!color) {
|
|
428
410
|
return null;
|
|
429
411
|
}
|
|
430
|
-
|
|
431
|
-
|
|
412
|
+
let end = color.end;
|
|
413
|
+
const offset = parsePercentageOrLength(text, end);
|
|
432
414
|
if (offset) {
|
|
433
415
|
end = offset.end;
|
|
434
416
|
return {
|
|
435
|
-
start
|
|
436
|
-
end
|
|
417
|
+
start,
|
|
418
|
+
end,
|
|
437
419
|
value: { color: color.value, offset: offset.value },
|
|
438
420
|
};
|
|
439
421
|
}
|
|
440
|
-
return { start
|
|
422
|
+
return { start, end, value: { color: color.value } };
|
|
441
423
|
}
|
|
442
|
-
|
|
443
|
-
export function parseLinearGradient(text, start) {
|
|
444
|
-
if (start === void 0) { start = 0; }
|
|
424
|
+
const linearGradientStartRegEx = /\s*linear-gradient\s*/gy;
|
|
425
|
+
export function parseLinearGradient(text, start = 0) {
|
|
445
426
|
linearGradientStartRegEx.lastIndex = start;
|
|
446
|
-
|
|
427
|
+
const lgs = linearGradientStartRegEx.exec(text);
|
|
447
428
|
if (!lgs) {
|
|
448
429
|
return null;
|
|
449
430
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
431
|
+
let end = linearGradientStartRegEx.lastIndex;
|
|
432
|
+
let angle = Math.PI;
|
|
433
|
+
const colors = [];
|
|
434
|
+
const parsedArgs = parseArgumentsList(text, end, (text, start, index) => {
|
|
454
435
|
if (index === 0) {
|
|
455
436
|
// First arg can be gradient direction
|
|
456
|
-
|
|
437
|
+
const angleArg = parseAngle(text, start) || parseDirection(text, start);
|
|
457
438
|
if (angleArg) {
|
|
458
439
|
angle = angleArg.value;
|
|
459
440
|
return angleArg;
|
|
460
441
|
}
|
|
461
442
|
}
|
|
462
|
-
|
|
443
|
+
const colorStop = parseColorStop(text, start);
|
|
463
444
|
if (colorStop) {
|
|
464
445
|
colors.push(colorStop.value);
|
|
465
446
|
return colorStop;
|
|
@@ -470,45 +451,44 @@ export function parseLinearGradient(text, start) {
|
|
|
470
451
|
return null;
|
|
471
452
|
}
|
|
472
453
|
end = parsedArgs.end;
|
|
473
|
-
return { start
|
|
454
|
+
return { start, end, value: { angle, colors } };
|
|
474
455
|
}
|
|
475
|
-
|
|
456
|
+
const slashRegEx = /\s*(\/)\s*/gy;
|
|
476
457
|
function parseSlash(text, start) {
|
|
477
458
|
slashRegEx.lastIndex = start;
|
|
478
|
-
|
|
459
|
+
const slash = slashRegEx.exec(text);
|
|
479
460
|
if (!slash) {
|
|
480
461
|
return null;
|
|
481
462
|
}
|
|
482
|
-
|
|
483
|
-
return { start
|
|
463
|
+
const end = slashRegEx.lastIndex;
|
|
464
|
+
return { start, end, value: '/' };
|
|
484
465
|
}
|
|
485
|
-
export function parseBackground(text, start) {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
var end = start;
|
|
466
|
+
export function parseBackground(text, start = 0) {
|
|
467
|
+
const value = {};
|
|
468
|
+
let end = start;
|
|
489
469
|
while (end < text.length) {
|
|
490
|
-
|
|
491
|
-
|
|
470
|
+
const keyword = parseKeyword(text, end);
|
|
471
|
+
const color = parseColor(text, end, keyword);
|
|
492
472
|
if (color) {
|
|
493
473
|
value.color = color.value;
|
|
494
474
|
end = color.end;
|
|
495
475
|
continue;
|
|
496
476
|
}
|
|
497
|
-
|
|
477
|
+
const repeat = parseRepeat(text, end, keyword);
|
|
498
478
|
if (repeat) {
|
|
499
479
|
value.repeat = repeat.value;
|
|
500
480
|
end = repeat.end;
|
|
501
481
|
continue;
|
|
502
482
|
}
|
|
503
|
-
|
|
483
|
+
const position = parseBackgroundPosition(text, end, keyword);
|
|
504
484
|
if (position) {
|
|
505
485
|
position.value.text = text.substring(position.start, position.end);
|
|
506
486
|
value.position = position.value;
|
|
507
487
|
end = position.end;
|
|
508
|
-
|
|
488
|
+
const slash = parseSlash(text, end);
|
|
509
489
|
if (slash) {
|
|
510
490
|
end = slash.end;
|
|
511
|
-
|
|
491
|
+
const size = parseBackgroundSize(text, end);
|
|
512
492
|
if (!size) {
|
|
513
493
|
// Found / but no proper size following
|
|
514
494
|
return null;
|
|
@@ -518,13 +498,13 @@ export function parseBackground(text, start) {
|
|
|
518
498
|
}
|
|
519
499
|
continue;
|
|
520
500
|
}
|
|
521
|
-
|
|
501
|
+
const url = parseURL(text, end);
|
|
522
502
|
if (url) {
|
|
523
503
|
value.image = url.value;
|
|
524
504
|
end = url.end;
|
|
525
505
|
continue;
|
|
526
506
|
}
|
|
527
|
-
|
|
507
|
+
const gradient = parseLinearGradient(text, end);
|
|
528
508
|
if (gradient) {
|
|
529
509
|
value.image = gradient.value;
|
|
530
510
|
end = gradient.end;
|
|
@@ -532,6 +512,6 @@ export function parseBackground(text, start) {
|
|
|
532
512
|
}
|
|
533
513
|
return null;
|
|
534
514
|
}
|
|
535
|
-
return { start
|
|
515
|
+
return { start, end, value };
|
|
536
516
|
}
|
|
537
517
|
//# sourceMappingURL=parser.js.map
|