@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
|
@@ -3,7 +3,7 @@ import '../../globals';
|
|
|
3
3
|
import { isCssVariable } from '../core/properties';
|
|
4
4
|
import { isNullOrUndefined } from '../../utils/types';
|
|
5
5
|
import { checkIfMediaQueryMatches } from '../../media-query-list';
|
|
6
|
-
export
|
|
6
|
+
export const MEDIA_QUERY_SEPARATOR = '&&';
|
|
7
7
|
var Combinator;
|
|
8
8
|
(function (Combinator) {
|
|
9
9
|
Combinator["descendant"] = " ";
|
|
@@ -39,14 +39,14 @@ function eachNodePreviousGeneralSibling(node, callback) {
|
|
|
39
39
|
if (!node.parent || !node.parent.getChildIndex || !node.parent.getChildAt || !node.parent.getChildrenCount) {
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
const nodeIndex = node.parent.getChildIndex(node);
|
|
43
43
|
if (nodeIndex === 0) {
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
for (
|
|
49
|
-
|
|
46
|
+
const count = node.parent.getChildrenCount();
|
|
47
|
+
let retVal = true;
|
|
48
|
+
for (let i = nodeIndex - 1; i >= 0 && retVal; i--) {
|
|
49
|
+
const sibling = node.parent.getChildAt(i);
|
|
50
50
|
retVal = callback(sibling);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -54,15 +54,14 @@ function getNodePreviousDirectSibling(node) {
|
|
|
54
54
|
if (!node.parent || !node.parent.getChildIndex || !node.parent.getChildAt) {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const nodeIndex = node.parent.getChildIndex(node);
|
|
58
58
|
if (nodeIndex === 0) {
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
61
|
return node.parent.getChildAt(nodeIndex - 1);
|
|
62
62
|
}
|
|
63
|
-
function SelectorProperties(specificity, rarity, dynamic) {
|
|
64
|
-
|
|
65
|
-
return function (cls) {
|
|
63
|
+
function SelectorProperties(specificity, rarity, dynamic = false) {
|
|
64
|
+
return (cls) => {
|
|
66
65
|
cls.prototype.specificity = specificity;
|
|
67
66
|
cls.prototype.rarity = rarity;
|
|
68
67
|
cls.prototype.combinator = undefined;
|
|
@@ -71,7 +70,7 @@ function SelectorProperties(specificity, rarity, dynamic) {
|
|
|
71
70
|
};
|
|
72
71
|
}
|
|
73
72
|
function FunctionalPseudoClassProperties(specificity, rarity, pseudoSelectorListType) {
|
|
74
|
-
return
|
|
73
|
+
return (cls) => {
|
|
75
74
|
cls.prototype.specificity = specificity;
|
|
76
75
|
cls.prototype.rarity = rarity;
|
|
77
76
|
cls.prototype.combinator = undefined;
|
|
@@ -80,32 +79,19 @@ function FunctionalPseudoClassProperties(specificity, rarity, pseudoSelectorList
|
|
|
80
79
|
return cls;
|
|
81
80
|
};
|
|
82
81
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}());
|
|
88
|
-
export { SelectorBase };
|
|
89
|
-
var SelectorCore = /** @class */ (function (_super) {
|
|
90
|
-
__extends(SelectorCore, _super);
|
|
91
|
-
function SelectorCore() {
|
|
92
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
93
|
-
}
|
|
94
|
-
SelectorCore.prototype.lookupSort = function (sorter, base) {
|
|
82
|
+
export class SelectorBase {
|
|
83
|
+
}
|
|
84
|
+
let SelectorCore = class SelectorCore extends SelectorBase {
|
|
85
|
+
lookupSort(sorter, base) {
|
|
95
86
|
sorter.sortAsUniversal(base || this);
|
|
96
|
-
};
|
|
97
|
-
SelectorCore = __decorate([
|
|
98
|
-
SelectorProperties(0 /* Specificity.Universal */, 0 /* Rarity.Universal */, Match.Static)
|
|
99
|
-
], SelectorCore);
|
|
100
|
-
return SelectorCore;
|
|
101
|
-
}(SelectorBase));
|
|
102
|
-
export { SelectorCore };
|
|
103
|
-
var SimpleSelector = /** @class */ (function (_super) {
|
|
104
|
-
__extends(SimpleSelector, _super);
|
|
105
|
-
function SimpleSelector() {
|
|
106
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
107
87
|
}
|
|
108
|
-
|
|
88
|
+
};
|
|
89
|
+
SelectorCore = __decorate([
|
|
90
|
+
SelectorProperties(0 /* Specificity.Universal */, 0 /* Rarity.Universal */, Match.Static)
|
|
91
|
+
], SelectorCore);
|
|
92
|
+
export { SelectorCore };
|
|
93
|
+
export class SimpleSelector extends SelectorCore {
|
|
94
|
+
accumulateChanges(node, map) {
|
|
109
95
|
if (!this.dynamic) {
|
|
110
96
|
return this.match(node);
|
|
111
97
|
}
|
|
@@ -114,147 +100,125 @@ var SimpleSelector = /** @class */ (function (_super) {
|
|
|
114
100
|
return true;
|
|
115
101
|
}
|
|
116
102
|
return false;
|
|
117
|
-
}
|
|
118
|
-
|
|
103
|
+
}
|
|
104
|
+
mayMatch(node) {
|
|
119
105
|
return this.match(node);
|
|
120
|
-
}
|
|
121
|
-
|
|
106
|
+
}
|
|
107
|
+
trackChanges(node, map) {
|
|
122
108
|
// No-op, silence the tslint 'block is empty'.
|
|
123
109
|
// Some derived classes (dynamic) will actually fill the map with stuff here, some (static) won't do anything.
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
}(SelectorCore));
|
|
127
|
-
export { SimpleSelector };
|
|
110
|
+
}
|
|
111
|
+
}
|
|
128
112
|
function wrap(text) {
|
|
129
|
-
return text ?
|
|
113
|
+
return text ? ` ${text} ` : '';
|
|
130
114
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
};
|
|
141
|
-
InvalidSelector.prototype.match = function (node) {
|
|
115
|
+
let InvalidSelector = class InvalidSelector extends SimpleSelector {
|
|
116
|
+
constructor(e) {
|
|
117
|
+
super();
|
|
118
|
+
this.e = e;
|
|
119
|
+
}
|
|
120
|
+
toString() {
|
|
121
|
+
return `<${this.e}>`;
|
|
122
|
+
}
|
|
123
|
+
match(node) {
|
|
142
124
|
return false;
|
|
143
|
-
}
|
|
144
|
-
|
|
125
|
+
}
|
|
126
|
+
lookupSort(sorter, base) {
|
|
145
127
|
// No-op, silence the tslint 'block is empty'.
|
|
146
128
|
// It feels like tslint has problems with simple polymorphism...
|
|
147
129
|
// This selector is invalid and will never match so we won't bother sorting it to further appear in queries.
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}(SimpleSelector));
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
InvalidSelector = __decorate([
|
|
133
|
+
SelectorProperties(0 /* Specificity.Invalid */, 4 /* Rarity.Invalid */, Match.Static),
|
|
134
|
+
__metadata("design:paramtypes", [Error])
|
|
135
|
+
], InvalidSelector);
|
|
155
136
|
export { InvalidSelector };
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
137
|
+
let UniversalSelector = class UniversalSelector extends SimpleSelector {
|
|
138
|
+
toString() {
|
|
139
|
+
return `*${wrap(this.combinator)}`;
|
|
160
140
|
}
|
|
161
|
-
|
|
162
|
-
return "*".concat(wrap(this.combinator));
|
|
163
|
-
};
|
|
164
|
-
UniversalSelector.prototype.match = function (node) {
|
|
141
|
+
match(node) {
|
|
165
142
|
return true;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}(SimpleSelector));
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
UniversalSelector = __decorate([
|
|
146
|
+
SelectorProperties(0 /* Specificity.Universal */, 0 /* Rarity.Universal */, Match.Static)
|
|
147
|
+
], UniversalSelector);
|
|
172
148
|
export { UniversalSelector };
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
};
|
|
183
|
-
IdSelector.prototype.match = function (node) {
|
|
149
|
+
let IdSelector = class IdSelector extends SimpleSelector {
|
|
150
|
+
constructor(id) {
|
|
151
|
+
super();
|
|
152
|
+
this.id = id;
|
|
153
|
+
}
|
|
154
|
+
toString() {
|
|
155
|
+
return `#${this.id}${wrap(this.combinator)}`;
|
|
156
|
+
}
|
|
157
|
+
match(node) {
|
|
184
158
|
return node.id === this.id;
|
|
185
|
-
}
|
|
186
|
-
|
|
159
|
+
}
|
|
160
|
+
lookupSort(sorter, base) {
|
|
187
161
|
sorter.sortById(this.id, base || this);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}(SimpleSelector));
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
IdSelector = __decorate([
|
|
165
|
+
SelectorProperties(100 /* Specificity.Id */, 3 /* Rarity.Id */, Match.Static),
|
|
166
|
+
__metadata("design:paramtypes", [String])
|
|
167
|
+
], IdSelector);
|
|
195
168
|
export { IdSelector };
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
};
|
|
206
|
-
TypeSelector.prototype.match = function (node) {
|
|
169
|
+
let TypeSelector = class TypeSelector extends SimpleSelector {
|
|
170
|
+
constructor(cssType) {
|
|
171
|
+
super();
|
|
172
|
+
this.cssType = cssType;
|
|
173
|
+
}
|
|
174
|
+
toString() {
|
|
175
|
+
return `${this.cssType}${wrap(this.combinator)}`;
|
|
176
|
+
}
|
|
177
|
+
match(node) {
|
|
207
178
|
return node.cssType === this.cssType;
|
|
208
|
-
}
|
|
209
|
-
|
|
179
|
+
}
|
|
180
|
+
lookupSort(sorter, base) {
|
|
210
181
|
sorter.sortByType(this.cssType, base || this);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}(SimpleSelector));
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
TypeSelector = __decorate([
|
|
185
|
+
SelectorProperties(1 /* Specificity.Type */, 1 /* Rarity.Type */, Match.Static),
|
|
186
|
+
__metadata("design:paramtypes", [String])
|
|
187
|
+
], TypeSelector);
|
|
218
188
|
export { TypeSelector };
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
};
|
|
229
|
-
ClassSelector.prototype.match = function (node) {
|
|
189
|
+
let ClassSelector = class ClassSelector extends SimpleSelector {
|
|
190
|
+
constructor(cssClass) {
|
|
191
|
+
super();
|
|
192
|
+
this.cssClass = cssClass;
|
|
193
|
+
}
|
|
194
|
+
toString() {
|
|
195
|
+
return `.${this.cssClass}${wrap(this.combinator)}`;
|
|
196
|
+
}
|
|
197
|
+
match(node) {
|
|
230
198
|
return node.cssClasses && node.cssClasses.has(this.cssClass);
|
|
231
|
-
}
|
|
232
|
-
|
|
199
|
+
}
|
|
200
|
+
lookupSort(sorter, base) {
|
|
233
201
|
sorter.sortByClass(this.cssClass, base || this);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}(SimpleSelector));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
ClassSelector = __decorate([
|
|
205
|
+
SelectorProperties(10 /* Specificity.Class */, 2 /* Rarity.Class */, Match.Static),
|
|
206
|
+
__metadata("design:paramtypes", [String])
|
|
207
|
+
], ClassSelector);
|
|
241
208
|
export { ClassSelector };
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
};
|
|
256
|
-
AttributeSelector.prototype.match = function (node) {
|
|
257
|
-
var attr = node[this.attribute];
|
|
209
|
+
let AttributeSelector = class AttributeSelector extends SimpleSelector {
|
|
210
|
+
constructor(attribute, test, value, ignoreCase) {
|
|
211
|
+
super();
|
|
212
|
+
this.attribute = attribute;
|
|
213
|
+
this.test = test;
|
|
214
|
+
this.value = value;
|
|
215
|
+
this.ignoreCase = ignoreCase;
|
|
216
|
+
}
|
|
217
|
+
toString() {
|
|
218
|
+
return `[${this.attribute}${wrap(AttributeSelectorOperator[this.test] ?? this.test)}${this.value || ''}]${wrap(this.combinator)}`;
|
|
219
|
+
}
|
|
220
|
+
match(node) {
|
|
221
|
+
let attr = node[this.attribute];
|
|
258
222
|
if (this.test === 'exists') {
|
|
259
223
|
return !isNullOrUndefined(attr);
|
|
260
224
|
}
|
|
@@ -285,7 +249,7 @@ var AttributeSelector = /** @class */ (function (_super) {
|
|
|
285
249
|
}
|
|
286
250
|
// ~=
|
|
287
251
|
if (this.test === 'element') {
|
|
288
|
-
|
|
252
|
+
const words = attr.split(' ');
|
|
289
253
|
return words && words.indexOf(this.value) !== -1;
|
|
290
254
|
}
|
|
291
255
|
// |=
|
|
@@ -293,60 +257,54 @@ var AttributeSelector = /** @class */ (function (_super) {
|
|
|
293
257
|
return attr === this.value || attr.startsWith(this.value + '-');
|
|
294
258
|
}
|
|
295
259
|
return false;
|
|
296
|
-
}
|
|
297
|
-
|
|
260
|
+
}
|
|
261
|
+
mayMatch(node) {
|
|
298
262
|
return true;
|
|
299
|
-
}
|
|
300
|
-
|
|
263
|
+
}
|
|
264
|
+
trackChanges(node, map) {
|
|
301
265
|
map.addAttribute(node, this.attribute);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}(SimpleSelector));
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
AttributeSelector = __decorate([
|
|
269
|
+
SelectorProperties(10 /* Specificity.Attribute */, 0 /* Rarity.Attribute */, Match.Dynamic),
|
|
270
|
+
__metadata("design:paramtypes", [String, String, String, Boolean])
|
|
271
|
+
], AttributeSelector);
|
|
309
272
|
export { AttributeSelector };
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
};
|
|
320
|
-
PseudoClassSelector.prototype.match = function (node) {
|
|
273
|
+
let PseudoClassSelector = class PseudoClassSelector extends SimpleSelector {
|
|
274
|
+
constructor(cssPseudoClass) {
|
|
275
|
+
super();
|
|
276
|
+
this.cssPseudoClass = cssPseudoClass;
|
|
277
|
+
}
|
|
278
|
+
toString() {
|
|
279
|
+
return `:${this.cssPseudoClass}${wrap(this.combinator)}`;
|
|
280
|
+
}
|
|
281
|
+
match(node) {
|
|
321
282
|
return node.cssPseudoClasses && node.cssPseudoClasses.has(this.cssPseudoClass);
|
|
322
|
-
}
|
|
323
|
-
|
|
283
|
+
}
|
|
284
|
+
mayMatch(node) {
|
|
324
285
|
return true;
|
|
325
|
-
}
|
|
326
|
-
|
|
286
|
+
}
|
|
287
|
+
trackChanges(node, map) {
|
|
327
288
|
map.addPseudoClass(node, this.cssPseudoClass);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}(SimpleSelector));
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
PseudoClassSelector = __decorate([
|
|
292
|
+
SelectorProperties(10 /* Specificity.PseudoClass */, 0 /* Rarity.PseudoClass */, Match.Dynamic),
|
|
293
|
+
__metadata("design:paramtypes", [String])
|
|
294
|
+
], PseudoClassSelector);
|
|
335
295
|
export { PseudoClassSelector };
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
var specificity = 0;
|
|
296
|
+
export class FunctionalPseudoClassSelector extends PseudoClassSelector {
|
|
297
|
+
constructor(cssPseudoClass, dataType) {
|
|
298
|
+
super(cssPseudoClass);
|
|
299
|
+
const selectors = [];
|
|
300
|
+
const needsHighestSpecificity = this.specificity === -1 /* Specificity.SelectorListHighest */;
|
|
301
|
+
let specificity = 0;
|
|
343
302
|
if (Array.isArray(dataType)) {
|
|
344
|
-
for (
|
|
345
|
-
|
|
346
|
-
var selector = createSelectorFromAst(asts);
|
|
303
|
+
for (const asts of dataType) {
|
|
304
|
+
const selector = createSelectorFromAst(asts);
|
|
347
305
|
if (selector instanceof InvalidSelector) {
|
|
348
306
|
// Only forgiving selector list can ignore invalid selectors
|
|
349
|
-
if (
|
|
307
|
+
if (this.selectorListType !== 1 /* PseudoClassSelectorList.Forgiving */) {
|
|
350
308
|
selectors.splice(0);
|
|
351
309
|
specificity = 0;
|
|
352
310
|
break;
|
|
@@ -360,127 +318,104 @@ var FunctionalPseudoClassSelector = /** @class */ (function (_super) {
|
|
|
360
318
|
selectors.push(selector);
|
|
361
319
|
}
|
|
362
320
|
}
|
|
363
|
-
|
|
364
|
-
|
|
321
|
+
this.selectors = selectors;
|
|
322
|
+
this.specificity = specificity;
|
|
365
323
|
// Functional pseudo-classes become dynamic based on selectors in selector list
|
|
366
|
-
|
|
367
|
-
return _this;
|
|
324
|
+
this.dynamic = this.selectors.some((sel) => sel.dynamic);
|
|
368
325
|
}
|
|
369
|
-
|
|
370
|
-
return
|
|
371
|
-
}
|
|
372
|
-
|
|
326
|
+
toString() {
|
|
327
|
+
return `:${this.cssPseudoClass}(${this.selectors.join(', ')})${wrap(this.combinator)}`;
|
|
328
|
+
}
|
|
329
|
+
match(node) {
|
|
373
330
|
return false;
|
|
374
|
-
}
|
|
375
|
-
|
|
331
|
+
}
|
|
332
|
+
mayMatch(node) {
|
|
376
333
|
return true;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
this.selectors.forEach(
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
return !this.selectors.some(function (sel) { return sel.match(node); });
|
|
391
|
-
};
|
|
392
|
-
NotFunctionalPseudoClassSelector = __decorate([
|
|
393
|
-
FunctionalPseudoClassProperties(-1 /* Specificity.SelectorListHighest */, 0 /* Rarity.PseudoClass */, 0 /* PseudoClassSelectorList.Regular */)
|
|
394
|
-
], NotFunctionalPseudoClassSelector);
|
|
395
|
-
return NotFunctionalPseudoClassSelector;
|
|
396
|
-
}(FunctionalPseudoClassSelector));
|
|
334
|
+
}
|
|
335
|
+
trackChanges(node, map) {
|
|
336
|
+
this.selectors.forEach((sel) => sel.trackChanges(node, map));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
let NotFunctionalPseudoClassSelector = class NotFunctionalPseudoClassSelector extends FunctionalPseudoClassSelector {
|
|
340
|
+
match(node) {
|
|
341
|
+
return !this.selectors.some((sel) => sel.match(node));
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
NotFunctionalPseudoClassSelector = __decorate([
|
|
345
|
+
FunctionalPseudoClassProperties(-1 /* Specificity.SelectorListHighest */, 0 /* Rarity.PseudoClass */, 0 /* PseudoClassSelectorList.Regular */)
|
|
346
|
+
], NotFunctionalPseudoClassSelector);
|
|
397
347
|
export { NotFunctionalPseudoClassSelector };
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
348
|
+
let IsFunctionalPseudoClassSelector = class IsFunctionalPseudoClassSelector extends FunctionalPseudoClassSelector {
|
|
349
|
+
match(node) {
|
|
350
|
+
return this.selectors.some((sel) => sel.match(node));
|
|
402
351
|
}
|
|
403
|
-
|
|
404
|
-
return this.selectors.some(function (sel) { return sel.match(node); });
|
|
405
|
-
};
|
|
406
|
-
IsFunctionalPseudoClassSelector.prototype.lookupSort = function (sorter, base) {
|
|
352
|
+
lookupSort(sorter, base) {
|
|
407
353
|
// A faster lookup can be performed when selector list contains just a single selector
|
|
408
354
|
if (this.selectors.length === 1) {
|
|
409
355
|
this.selectors[0].lookupSort(sorter, base || this);
|
|
410
356
|
}
|
|
411
357
|
else {
|
|
412
|
-
|
|
358
|
+
super.lookupSort(sorter, base || this);
|
|
413
359
|
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}(FunctionalPseudoClassSelector));
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
IsFunctionalPseudoClassSelector = __decorate([
|
|
363
|
+
FunctionalPseudoClassProperties(-1 /* Specificity.SelectorListHighest */, 0 /* Rarity.PseudoClass */, 1 /* PseudoClassSelectorList.Forgiving */)
|
|
364
|
+
], IsFunctionalPseudoClassSelector);
|
|
420
365
|
export { IsFunctionalPseudoClassSelector };
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
366
|
+
let WhereFunctionalPseudoClassSelector = class WhereFunctionalPseudoClassSelector extends FunctionalPseudoClassSelector {
|
|
367
|
+
match(node) {
|
|
368
|
+
return this.selectors.some((sel) => sel.match(node));
|
|
425
369
|
}
|
|
426
|
-
|
|
427
|
-
return this.selectors.some(function (sel) { return sel.match(node); });
|
|
428
|
-
};
|
|
429
|
-
WhereFunctionalPseudoClassSelector.prototype.lookupSort = function (sorter, base) {
|
|
370
|
+
lookupSort(sorter, base) {
|
|
430
371
|
// A faster lookup can be performed when selector list contains just a single selector
|
|
431
372
|
if (this.selectors.length === 1) {
|
|
432
373
|
this.selectors[0].lookupSort(sorter, base || this);
|
|
433
374
|
}
|
|
434
375
|
else {
|
|
435
|
-
|
|
376
|
+
super.lookupSort(sorter, base || this);
|
|
436
377
|
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}(FunctionalPseudoClassSelector));
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
WhereFunctionalPseudoClassSelector = __decorate([
|
|
381
|
+
FunctionalPseudoClassProperties(0 /* Specificity.Zero */, 0 /* Rarity.PseudoClass */, 1 /* PseudoClassSelectorList.Forgiving */)
|
|
382
|
+
], WhereFunctionalPseudoClassSelector);
|
|
443
383
|
export { WhereFunctionalPseudoClassSelector };
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
};
|
|
466
|
-
SimpleSelectorSequence.prototype.lookupSort = function (sorter, base) {
|
|
384
|
+
export class SimpleSelectorSequence extends SimpleSelector {
|
|
385
|
+
constructor(selectors) {
|
|
386
|
+
super();
|
|
387
|
+
this.selectors = selectors;
|
|
388
|
+
this.specificity = selectors.reduce((sum, sel) => sel.specificity + sum, 0);
|
|
389
|
+
this.head = selectors.reduce((prev, curr) => (!prev || curr.rarity > prev.rarity ? curr : prev), null);
|
|
390
|
+
this.dynamic = selectors.some((sel) => sel.dynamic);
|
|
391
|
+
}
|
|
392
|
+
toString() {
|
|
393
|
+
return `${this.selectors.join('')}${wrap(this.combinator)}`;
|
|
394
|
+
}
|
|
395
|
+
match(node) {
|
|
396
|
+
return this.selectors.every((sel) => sel.match(node));
|
|
397
|
+
}
|
|
398
|
+
mayMatch(node) {
|
|
399
|
+
return this.selectors.every((sel) => sel.mayMatch(node));
|
|
400
|
+
}
|
|
401
|
+
trackChanges(node, map) {
|
|
402
|
+
this.selectors.forEach((sel) => sel.trackChanges(node, map));
|
|
403
|
+
}
|
|
404
|
+
lookupSort(sorter, base) {
|
|
467
405
|
this.head.lookupSort(sorter, base || this);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
_this.dynamic = false;
|
|
482
|
-
for (var i = selectors.length - 1; i >= 0; i--) {
|
|
483
|
-
var sel = selectors[i];
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
export class ComplexSelector extends SelectorCore {
|
|
409
|
+
constructor(selectors) {
|
|
410
|
+
super();
|
|
411
|
+
this.selectors = selectors;
|
|
412
|
+
let siblingsToGroup;
|
|
413
|
+
let currentGroup;
|
|
414
|
+
const groups = [];
|
|
415
|
+
this.specificity = 0;
|
|
416
|
+
this.dynamic = false;
|
|
417
|
+
for (let i = selectors.length - 1; i >= 0; i--) {
|
|
418
|
+
const sel = selectors[i];
|
|
484
419
|
switch (sel.combinator) {
|
|
485
420
|
case undefined:
|
|
486
421
|
case Combinator.descendant:
|
|
@@ -496,31 +431,29 @@ var ComplexSelector = /** @class */ (function (_super) {
|
|
|
496
431
|
case Combinator.sibling:
|
|
497
432
|
break;
|
|
498
433
|
default:
|
|
499
|
-
throw new Error(
|
|
434
|
+
throw new Error(`Unsupported combinator "${sel.combinator}" for selector ${sel}.`);
|
|
500
435
|
}
|
|
501
|
-
|
|
436
|
+
this.specificity += sel.specificity;
|
|
502
437
|
if (sel.dynamic) {
|
|
503
|
-
|
|
438
|
+
this.dynamic = true;
|
|
504
439
|
}
|
|
505
440
|
siblingsToGroup.push(sel);
|
|
506
441
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
return _this;
|
|
442
|
+
this.groups = groups.map((g) => new Selector.ChildGroup(g.map((selectors) => (selectors.length > 1 ? new Selector.SiblingGroup(selectors) : selectors[0]))));
|
|
443
|
+
this.last = selectors[selectors.length - 1];
|
|
510
444
|
}
|
|
511
|
-
|
|
445
|
+
toString() {
|
|
512
446
|
return this.selectors.join('');
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
return this.groups.every(
|
|
516
|
-
var _a;
|
|
447
|
+
}
|
|
448
|
+
match(node) {
|
|
449
|
+
return this.groups.every((group, i) => {
|
|
517
450
|
if (i === 0) {
|
|
518
451
|
node = group.getMatchingNode(node, true);
|
|
519
452
|
return !!node;
|
|
520
453
|
}
|
|
521
454
|
else {
|
|
522
|
-
|
|
523
|
-
while ((ancestor =
|
|
455
|
+
let ancestor = node;
|
|
456
|
+
while ((ancestor = ancestor.parent ?? ancestor._modalParent)) {
|
|
524
457
|
if ((node = group.getMatchingNode(ancestor, true))) {
|
|
525
458
|
return true;
|
|
526
459
|
}
|
|
@@ -528,32 +461,32 @@ var ComplexSelector = /** @class */ (function (_super) {
|
|
|
528
461
|
return false;
|
|
529
462
|
}
|
|
530
463
|
});
|
|
531
|
-
}
|
|
532
|
-
|
|
464
|
+
}
|
|
465
|
+
mayMatch(node) {
|
|
533
466
|
return false;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
this.selectors.forEach(
|
|
537
|
-
}
|
|
538
|
-
|
|
467
|
+
}
|
|
468
|
+
trackChanges(node, map) {
|
|
469
|
+
this.selectors.forEach((sel) => sel.trackChanges(node, map));
|
|
470
|
+
}
|
|
471
|
+
lookupSort(sorter, base) {
|
|
539
472
|
this.last.lookupSort(sorter, base || this);
|
|
540
|
-
}
|
|
541
|
-
|
|
473
|
+
}
|
|
474
|
+
accumulateChanges(node, map) {
|
|
542
475
|
if (!this.dynamic) {
|
|
543
476
|
return this.match(node);
|
|
544
477
|
}
|
|
545
|
-
|
|
546
|
-
|
|
478
|
+
const bounds = [];
|
|
479
|
+
const mayMatch = this.groups.every((group, i) => {
|
|
547
480
|
if (i === 0) {
|
|
548
|
-
|
|
481
|
+
const nextNode = group.getMatchingNode(node, false);
|
|
549
482
|
bounds.push({ left: node, right: node });
|
|
550
483
|
node = nextNode;
|
|
551
484
|
return !!node;
|
|
552
485
|
}
|
|
553
486
|
else {
|
|
554
|
-
|
|
487
|
+
let ancestor = node;
|
|
555
488
|
while ((ancestor = ancestor.parent)) {
|
|
556
|
-
|
|
489
|
+
const nextNode = group.getMatchingNode(ancestor, false);
|
|
557
490
|
if (nextNode) {
|
|
558
491
|
bounds.push({ left: ancestor, right: null });
|
|
559
492
|
node = nextNode;
|
|
@@ -570,47 +503,43 @@ var ComplexSelector = /** @class */ (function (_super) {
|
|
|
570
503
|
if (!map) {
|
|
571
504
|
return mayMatch;
|
|
572
505
|
}
|
|
573
|
-
for (
|
|
574
|
-
|
|
575
|
-
if (!
|
|
506
|
+
for (let i = 0; i < this.groups.length; i++) {
|
|
507
|
+
const group = this.groups[i];
|
|
508
|
+
if (!group.dynamic) {
|
|
576
509
|
continue;
|
|
577
510
|
}
|
|
578
|
-
|
|
579
|
-
|
|
511
|
+
const bound = bounds[i];
|
|
512
|
+
let node = bound.left;
|
|
580
513
|
do {
|
|
581
|
-
if (
|
|
582
|
-
|
|
514
|
+
if (group.mayMatch(node)) {
|
|
515
|
+
group.trackChanges(node, map);
|
|
583
516
|
}
|
|
584
|
-
} while (
|
|
517
|
+
} while (node !== bound.right && (node = node.parent));
|
|
585
518
|
}
|
|
586
519
|
return mayMatch;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
}(SelectorCore));
|
|
590
|
-
export { ComplexSelector };
|
|
520
|
+
}
|
|
521
|
+
}
|
|
591
522
|
export var Selector;
|
|
592
523
|
(function (Selector) {
|
|
593
524
|
// Non-spec. Selector sequences are grouped by ancestor then by child combinators for easier backtracking.
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
525
|
+
class ChildGroup extends SelectorBase {
|
|
526
|
+
constructor(selectors) {
|
|
527
|
+
super();
|
|
528
|
+
this.selectors = selectors;
|
|
529
|
+
this.dynamic = selectors.some((sel) => sel.dynamic);
|
|
530
|
+
}
|
|
531
|
+
getMatchingNode(node, strict) {
|
|
532
|
+
const funcName = strict ? 'match' : 'mayMatch';
|
|
533
|
+
return this.selectors.every((sel, i) => (node = i === 0 ? node : node.parent) && sel[funcName](node)) ? node : null;
|
|
601
534
|
}
|
|
602
|
-
|
|
603
|
-
var funcName = strict ? 'match' : 'mayMatch';
|
|
604
|
-
return this.selectors.every(function (sel, i) { return (node = i === 0 ? node : node.parent) && sel[funcName](node); }) ? node : null;
|
|
605
|
-
};
|
|
606
|
-
ChildGroup.prototype.match = function (node) {
|
|
535
|
+
match(node) {
|
|
607
536
|
return this.getMatchingNode(node, true) != null;
|
|
608
|
-
}
|
|
609
|
-
|
|
537
|
+
}
|
|
538
|
+
mayMatch(node) {
|
|
610
539
|
return this.getMatchingNode(node, false) != null;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
this.selectors.forEach(
|
|
540
|
+
}
|
|
541
|
+
trackChanges(node, map) {
|
|
542
|
+
this.selectors.forEach((sel, i) => {
|
|
614
543
|
if (i === 0) {
|
|
615
544
|
node && sel.trackChanges(node, map);
|
|
616
545
|
}
|
|
@@ -621,20 +550,17 @@ export var Selector;
|
|
|
621
550
|
}
|
|
622
551
|
}
|
|
623
552
|
});
|
|
624
|
-
};
|
|
625
|
-
return ChildGroup;
|
|
626
|
-
}(SelectorBase));
|
|
627
|
-
Selector.ChildGroup = ChildGroup;
|
|
628
|
-
var SiblingGroup = /** @class */ (function (_super) {
|
|
629
|
-
__extends(SiblingGroup, _super);
|
|
630
|
-
function SiblingGroup(selectors) {
|
|
631
|
-
var _this = _super.call(this) || this;
|
|
632
|
-
_this.selectors = selectors;
|
|
633
|
-
_this.dynamic = selectors.some(function (sel) { return sel.dynamic; });
|
|
634
|
-
return _this;
|
|
635
553
|
}
|
|
636
|
-
|
|
637
|
-
|
|
554
|
+
}
|
|
555
|
+
Selector.ChildGroup = ChildGroup;
|
|
556
|
+
class SiblingGroup extends SelectorBase {
|
|
557
|
+
constructor(selectors) {
|
|
558
|
+
super();
|
|
559
|
+
this.selectors = selectors;
|
|
560
|
+
this.dynamic = selectors.some((sel) => sel.dynamic);
|
|
561
|
+
}
|
|
562
|
+
match(node) {
|
|
563
|
+
return this.selectors.every((sel, i) => {
|
|
638
564
|
if (i === 0) {
|
|
639
565
|
return node && sel.match(node);
|
|
640
566
|
}
|
|
@@ -643,16 +569,16 @@ export var Selector;
|
|
|
643
569
|
return node && sel.match(node);
|
|
644
570
|
}
|
|
645
571
|
// Sibling combinator
|
|
646
|
-
|
|
647
|
-
eachNodePreviousGeneralSibling(node,
|
|
572
|
+
let isMatching = false;
|
|
573
|
+
eachNodePreviousGeneralSibling(node, (sibling) => {
|
|
648
574
|
isMatching = sel.match(sibling);
|
|
649
575
|
return !isMatching;
|
|
650
576
|
});
|
|
651
577
|
return isMatching;
|
|
652
578
|
});
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
return this.selectors.every(
|
|
579
|
+
}
|
|
580
|
+
mayMatch(node) {
|
|
581
|
+
return this.selectors.every((sel, i) => {
|
|
656
582
|
if (i === 0) {
|
|
657
583
|
return node && sel.mayMatch(node);
|
|
658
584
|
}
|
|
@@ -661,16 +587,16 @@ export var Selector;
|
|
|
661
587
|
return node && sel.mayMatch(node);
|
|
662
588
|
}
|
|
663
589
|
// Sibling combinator
|
|
664
|
-
|
|
665
|
-
eachNodePreviousGeneralSibling(node,
|
|
590
|
+
let isMatching = false;
|
|
591
|
+
eachNodePreviousGeneralSibling(node, (sibling) => {
|
|
666
592
|
isMatching = sel.mayMatch(sibling);
|
|
667
593
|
return !isMatching;
|
|
668
594
|
});
|
|
669
595
|
return isMatching;
|
|
670
596
|
});
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
this.selectors.forEach(
|
|
597
|
+
}
|
|
598
|
+
trackChanges(node, map) {
|
|
599
|
+
this.selectors.forEach((sel, i) => {
|
|
674
600
|
if (i === 0) {
|
|
675
601
|
if (node) {
|
|
676
602
|
sel.trackChanges(node, map);
|
|
@@ -685,48 +611,44 @@ export var Selector;
|
|
|
685
611
|
}
|
|
686
612
|
else {
|
|
687
613
|
// Sibling combinator
|
|
688
|
-
|
|
689
|
-
eachNodePreviousGeneralSibling(node,
|
|
690
|
-
|
|
614
|
+
let matchingSibling;
|
|
615
|
+
eachNodePreviousGeneralSibling(node, (sibling) => {
|
|
616
|
+
const isMatching = sel.mayMatch(sibling);
|
|
691
617
|
if (isMatching) {
|
|
692
|
-
|
|
618
|
+
matchingSibling = sibling;
|
|
693
619
|
}
|
|
694
620
|
return !isMatching;
|
|
695
621
|
});
|
|
696
|
-
if (
|
|
697
|
-
sel.trackChanges(
|
|
622
|
+
if (matchingSibling) {
|
|
623
|
+
sel.trackChanges(matchingSibling, map);
|
|
698
624
|
}
|
|
699
625
|
}
|
|
700
626
|
}
|
|
701
627
|
});
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
}(SelectorBase));
|
|
628
|
+
}
|
|
629
|
+
}
|
|
705
630
|
Selector.SiblingGroup = SiblingGroup;
|
|
706
631
|
})(Selector || (Selector = {}));
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
var _this = this;
|
|
632
|
+
export class RuleSet {
|
|
633
|
+
constructor(selectors, declarations) {
|
|
710
634
|
this.selectors = selectors;
|
|
711
635
|
this.declarations = declarations;
|
|
712
|
-
this.selectors.forEach(
|
|
636
|
+
this.selectors.forEach((sel) => (sel.ruleset = this));
|
|
713
637
|
}
|
|
714
|
-
|
|
715
|
-
|
|
638
|
+
toString() {
|
|
639
|
+
let desc = `${this.selectors.join(', ')} {${this.declarations.map((d, i) => `${i === 0 ? ' ' : ''}${d.property}: ${d.value}`).join('; ')} }`;
|
|
716
640
|
if (this.mediaQueryString) {
|
|
717
|
-
desc =
|
|
641
|
+
desc = `@media ${this.mediaQueryString} { ${desc} }`;
|
|
718
642
|
}
|
|
719
643
|
return desc;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
this.selectors.forEach(
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
}());
|
|
726
|
-
export { RuleSet };
|
|
644
|
+
}
|
|
645
|
+
lookupSort(sorter) {
|
|
646
|
+
this.selectors.forEach((sel) => sel.lookupSort(sorter));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
727
649
|
export function fromAstNode(astRule) {
|
|
728
|
-
|
|
729
|
-
|
|
650
|
+
const declarations = astRule.declarations.filter(isDeclaration).map(createDeclaration);
|
|
651
|
+
const selectors = astRule.selectors.map(createSelector);
|
|
730
652
|
return new RuleSet(selectors, declarations);
|
|
731
653
|
}
|
|
732
654
|
function createDeclaration(decl) {
|
|
@@ -769,10 +691,9 @@ function createSimpleSelectorSequenceFromAst(asts) {
|
|
|
769
691
|
if (asts.length === 1) {
|
|
770
692
|
return createSimpleSelectorFromAst(asts[0]);
|
|
771
693
|
}
|
|
772
|
-
|
|
773
|
-
for (
|
|
774
|
-
|
|
775
|
-
var selector = createSimpleSelectorFromAst(ast);
|
|
694
|
+
const sequenceSelectors = [];
|
|
695
|
+
for (const ast of asts) {
|
|
696
|
+
const selector = createSimpleSelectorFromAst(ast);
|
|
776
697
|
if (selector instanceof InvalidSelector) {
|
|
777
698
|
return selector;
|
|
778
699
|
}
|
|
@@ -781,22 +702,21 @@ function createSimpleSelectorSequenceFromAst(asts) {
|
|
|
781
702
|
return new SimpleSelectorSequence(sequenceSelectors);
|
|
782
703
|
}
|
|
783
704
|
function createSelectorFromAst(asts) {
|
|
784
|
-
|
|
705
|
+
let result;
|
|
785
706
|
if (asts.length === 0) {
|
|
786
707
|
return new InvalidSelector(new Error('Empty selector.'));
|
|
787
708
|
}
|
|
788
709
|
if (asts.length === 1) {
|
|
789
710
|
return createSimpleSelectorFromAst(asts[0]);
|
|
790
711
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
for (
|
|
795
|
-
|
|
796
|
-
var combinator = Combinator[ast.type];
|
|
712
|
+
const simpleSelectorSequences = [];
|
|
713
|
+
let sequenceAsts = [];
|
|
714
|
+
let combinatorCount = 0;
|
|
715
|
+
for (const ast of asts) {
|
|
716
|
+
const combinator = Combinator[ast.type];
|
|
797
717
|
// Combinator means the end of a sequence
|
|
798
718
|
if (combinator != null) {
|
|
799
|
-
|
|
719
|
+
const selector = createSimpleSelectorSequenceFromAst(sequenceAsts);
|
|
800
720
|
if (selector instanceof InvalidSelector) {
|
|
801
721
|
return selector;
|
|
802
722
|
}
|
|
@@ -813,7 +733,7 @@ function createSelectorFromAst(asts) {
|
|
|
813
733
|
if (combinatorCount > 0) {
|
|
814
734
|
// Create a sequence using the remaining selectors after the last combinator
|
|
815
735
|
if (sequenceAsts.length) {
|
|
816
|
-
|
|
736
|
+
const selector = createSimpleSelectorSequenceFromAst(sequenceAsts);
|
|
817
737
|
if (selector instanceof InvalidSelector) {
|
|
818
738
|
return selector;
|
|
819
739
|
}
|
|
@@ -825,8 +745,8 @@ function createSelectorFromAst(asts) {
|
|
|
825
745
|
}
|
|
826
746
|
export function createSelector(sel) {
|
|
827
747
|
try {
|
|
828
|
-
|
|
829
|
-
if (!
|
|
748
|
+
const result = convertToCSSWhatSelector(sel);
|
|
749
|
+
if (!result?.length) {
|
|
830
750
|
return new InvalidSelector(new Error('Empty selector'));
|
|
831
751
|
}
|
|
832
752
|
return createSelectorFromAst(result[0]);
|
|
@@ -840,9 +760,9 @@ function isDeclaration(node) {
|
|
|
840
760
|
}
|
|
841
761
|
export function matchMediaQueryString(mediaQueryString, cachedQueries) {
|
|
842
762
|
// It can be a single or multiple queries in case of nested media queries
|
|
843
|
-
|
|
844
|
-
return mediaQueryStrings.every(
|
|
845
|
-
|
|
763
|
+
const mediaQueryStrings = mediaQueryString.split(MEDIA_QUERY_SEPARATOR);
|
|
764
|
+
return mediaQueryStrings.every((mq) => {
|
|
765
|
+
let isMatching;
|
|
846
766
|
// Query has already been validated
|
|
847
767
|
if (cachedQueries.includes(mq)) {
|
|
848
768
|
isMatching = true;
|
|
@@ -856,74 +776,61 @@ export function matchMediaQueryString(mediaQueryString, cachedQueries) {
|
|
|
856
776
|
return isMatching;
|
|
857
777
|
});
|
|
858
778
|
}
|
|
859
|
-
|
|
860
|
-
|
|
779
|
+
export class SelectorScope {
|
|
780
|
+
constructor() {
|
|
861
781
|
this.id = {};
|
|
862
782
|
this.class = {};
|
|
863
783
|
this.type = {};
|
|
864
784
|
this.universal = [];
|
|
865
785
|
this.position = 0;
|
|
866
786
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
var selectorClasses = [this.universal, this.id[id], this.type[cssType]];
|
|
787
|
+
getSelectorCandidates(node) {
|
|
788
|
+
const { cssClasses, id, cssType } = node;
|
|
789
|
+
const selectorClasses = [this.universal, this.id[id], this.type[cssType]];
|
|
871
790
|
if (cssClasses && cssClasses.size) {
|
|
872
|
-
cssClasses.forEach(
|
|
791
|
+
cssClasses.forEach((c) => selectorClasses.push(this.class[c]));
|
|
873
792
|
}
|
|
874
|
-
return selectorClasses.reduce(
|
|
875
|
-
}
|
|
876
|
-
|
|
793
|
+
return selectorClasses.reduce((cur, next) => cur.concat(next || []), []);
|
|
794
|
+
}
|
|
795
|
+
sortById(id, sel) {
|
|
877
796
|
this.addToMap(this.id, id, sel);
|
|
878
|
-
}
|
|
879
|
-
|
|
797
|
+
}
|
|
798
|
+
sortByClass(cssClass, sel) {
|
|
880
799
|
this.addToMap(this.class, cssClass, sel);
|
|
881
|
-
}
|
|
882
|
-
|
|
800
|
+
}
|
|
801
|
+
sortByType(cssType, sel) {
|
|
883
802
|
this.addToMap(this.type, cssType, sel);
|
|
884
|
-
}
|
|
885
|
-
|
|
803
|
+
}
|
|
804
|
+
sortAsUniversal(sel) {
|
|
886
805
|
this.universal.push(this.makeDocSelector(sel));
|
|
887
|
-
}
|
|
888
|
-
|
|
806
|
+
}
|
|
807
|
+
addToMap(map, head, sel) {
|
|
889
808
|
if (!map[head]) {
|
|
890
809
|
map[head] = [];
|
|
891
810
|
}
|
|
892
811
|
map[head].push(this.makeDocSelector(sel));
|
|
893
|
-
}
|
|
894
|
-
|
|
812
|
+
}
|
|
813
|
+
makeDocSelector(sel) {
|
|
895
814
|
sel.pos = this.position++;
|
|
896
815
|
return sel;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
return MediaQuerySelectorScope;
|
|
916
|
-
}(SelectorScope));
|
|
917
|
-
export { MediaQuerySelectorScope };
|
|
918
|
-
var StyleSheetSelectorScope = /** @class */ (function (_super) {
|
|
919
|
-
__extends(StyleSheetSelectorScope, _super);
|
|
920
|
-
function StyleSheetSelectorScope(rulesets) {
|
|
921
|
-
var _this = _super.call(this) || this;
|
|
922
|
-
_this.lookupRulesets(rulesets);
|
|
923
|
-
return _this;
|
|
924
|
-
}
|
|
925
|
-
StyleSheetSelectorScope.prototype.createMediaQuerySelectorScope = function (mediaQueryString) {
|
|
926
|
-
var selectorScope = new MediaQuerySelectorScope(mediaQueryString);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
export class MediaQuerySelectorScope extends SelectorScope {
|
|
819
|
+
constructor(mediaQueryString) {
|
|
820
|
+
super();
|
|
821
|
+
this._mediaQueryString = mediaQueryString;
|
|
822
|
+
}
|
|
823
|
+
get mediaQueryString() {
|
|
824
|
+
return this._mediaQueryString;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
export class StyleSheetSelectorScope extends SelectorScope {
|
|
828
|
+
constructor(rulesets) {
|
|
829
|
+
super();
|
|
830
|
+
this.lookupRulesets(rulesets);
|
|
831
|
+
}
|
|
832
|
+
createMediaQuerySelectorScope(mediaQueryString) {
|
|
833
|
+
const selectorScope = new MediaQuerySelectorScope(mediaQueryString);
|
|
927
834
|
selectorScope.position = this.position;
|
|
928
835
|
if (this.mediaQuerySelectorScopes) {
|
|
929
836
|
this.mediaQuerySelectorScopes.push(selectorScope);
|
|
@@ -932,11 +839,11 @@ var StyleSheetSelectorScope = /** @class */ (function (_super) {
|
|
|
932
839
|
this.mediaQuerySelectorScopes = [selectorScope];
|
|
933
840
|
}
|
|
934
841
|
return selectorScope;
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
for (
|
|
939
|
-
|
|
842
|
+
}
|
|
843
|
+
lookupRulesets(rulesets) {
|
|
844
|
+
let lastMediaSelectorScope;
|
|
845
|
+
for (let i = 0, length = rulesets.length; i < length; i++) {
|
|
846
|
+
const ruleset = rulesets[i];
|
|
940
847
|
if (lastMediaSelectorScope && lastMediaSelectorScope.mediaQueryString !== ruleset.mediaQueryString) {
|
|
941
848
|
// Once done with current media query scope, update stylesheet scope position
|
|
942
849
|
this.position = lastMediaSelectorScope.position;
|
|
@@ -958,74 +865,70 @@ var StyleSheetSelectorScope = /** @class */ (function (_super) {
|
|
|
958
865
|
this.position = lastMediaSelectorScope.position;
|
|
959
866
|
lastMediaSelectorScope = null;
|
|
960
867
|
}
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
868
|
+
}
|
|
869
|
+
query(node) {
|
|
870
|
+
const selectorsMatch = new SelectorsMatch();
|
|
871
|
+
const selectors = this.getSelectorCandidates(node);
|
|
965
872
|
// Validate media queries and include their selectors if needed
|
|
966
873
|
if (this.mediaQuerySelectorScopes) {
|
|
967
874
|
// Cache media query results to avoid validations of other identical queries
|
|
968
|
-
|
|
969
|
-
for (
|
|
970
|
-
|
|
971
|
-
|
|
875
|
+
const validatedMediaQueries = [];
|
|
876
|
+
for (let i = 0, length = this.mediaQuerySelectorScopes.length; i < length; i++) {
|
|
877
|
+
const selectorScope = this.mediaQuerySelectorScopes[i];
|
|
878
|
+
const isMatchingAllQueries = matchMediaQueryString(selectorScope.mediaQueryString, validatedMediaQueries);
|
|
972
879
|
if (isMatchingAllQueries) {
|
|
973
|
-
|
|
974
|
-
selectors.push
|
|
880
|
+
const mediaQuerySelectors = selectorScope.getSelectorCandidates(node);
|
|
881
|
+
selectors.push(...mediaQuerySelectors);
|
|
975
882
|
}
|
|
976
883
|
}
|
|
977
884
|
}
|
|
978
|
-
selectorsMatch.selectors = selectors.filter(
|
|
885
|
+
selectorsMatch.selectors = selectors.filter((sel) => sel.accumulateChanges(node, selectorsMatch)).sort((a, b) => a.specificity - b.specificity || a.pos - b.pos);
|
|
979
886
|
return selectorsMatch;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
var SelectorsMatch = /** @class */ (function () {
|
|
985
|
-
function SelectorsMatch() {
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
export class SelectorsMatch {
|
|
890
|
+
constructor() {
|
|
986
891
|
this.changeMap = new Map();
|
|
987
892
|
}
|
|
988
|
-
|
|
989
|
-
|
|
893
|
+
addAttribute(node, attribute) {
|
|
894
|
+
const deps = this.properties(node);
|
|
990
895
|
if (!deps.attributes) {
|
|
991
896
|
deps.attributes = new Set();
|
|
992
897
|
}
|
|
993
898
|
deps.attributes.add(attribute);
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
|
|
899
|
+
}
|
|
900
|
+
addPseudoClass(node, pseudoClass) {
|
|
901
|
+
const deps = this.properties(node);
|
|
997
902
|
if (!deps.pseudoClasses) {
|
|
998
903
|
deps.pseudoClasses = new Set();
|
|
999
904
|
}
|
|
1000
905
|
deps.pseudoClasses.add(pseudoClass);
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
|
|
906
|
+
}
|
|
907
|
+
properties(node) {
|
|
908
|
+
let set = this.changeMap.get(node);
|
|
1004
909
|
if (!set) {
|
|
1005
910
|
this.changeMap.set(node, (set = {}));
|
|
1006
911
|
}
|
|
1007
912
|
return set;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
fromAstNode: fromAstNode,
|
|
1029
|
-
SelectorsMatch: SelectorsMatch,
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
export const CSSHelper = {
|
|
916
|
+
createSelector,
|
|
917
|
+
SelectorCore,
|
|
918
|
+
SimpleSelector,
|
|
919
|
+
InvalidSelector,
|
|
920
|
+
UniversalSelector,
|
|
921
|
+
TypeSelector,
|
|
922
|
+
ClassSelector,
|
|
923
|
+
AttributeSelector,
|
|
924
|
+
PseudoClassSelector,
|
|
925
|
+
SimpleSelectorSequence,
|
|
926
|
+
Selector,
|
|
927
|
+
RuleSet,
|
|
928
|
+
SelectorScope,
|
|
929
|
+
MediaQuerySelectorScope,
|
|
930
|
+
StyleSheetSelectorScope,
|
|
931
|
+
fromAstNode,
|
|
932
|
+
SelectorsMatch,
|
|
1030
933
|
};
|
|
1031
934
|
//# sourceMappingURL=css-selector.js.map
|