@ohos-ports/html2canvas-pro 0.0.0-stage → 2.3.2-beta.0
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/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/html2canvas-pro.cjs +11191 -0
- package/dist/html2canvas-pro.cjs.map +1 -0
- package/dist/html2canvas-pro.esm.js +11182 -0
- package/dist/html2canvas-pro.esm.js.map +1 -0
- package/dist/html2canvas-pro.js +11196 -0
- package/dist/html2canvas-pro.js.map +1 -0
- package/dist/html2canvas-pro.min.js +10 -0
- package/dist/lib/config.js +49 -0
- package/dist/lib/core/abort-helper.js +20 -0
- package/dist/lib/core/background-parser.js +41 -0
- package/dist/lib/core/bitwise.js +5 -0
- package/dist/lib/core/cache-storage.js +268 -0
- package/dist/lib/core/config-assembler.js +88 -0
- package/dist/lib/core/constants.js +25 -0
- package/dist/lib/core/context.js +19 -0
- package/dist/lib/core/debugger.js +27 -0
- package/dist/lib/core/features.js +190 -0
- package/dist/lib/core/logger.js +56 -0
- package/dist/lib/core/lru-map.js +66 -0
- package/dist/lib/core/origin-checker.js +53 -0
- package/dist/lib/core/performance-monitor.js +185 -0
- package/dist/lib/core/render-element.js +132 -0
- package/dist/lib/core/util.js +4 -0
- package/dist/lib/core/validator.js +500 -0
- package/dist/lib/css/grouped/background-styles.js +36 -0
- package/dist/lib/css/grouped/border-styles.js +75 -0
- package/dist/lib/css/grouped/font-styles.js +93 -0
- package/dist/lib/css/grouped/layout-styles.js +127 -0
- package/dist/lib/css/index.js +330 -0
- package/dist/lib/css/layout/bounds.js +52 -0
- package/dist/lib/css/layout/text.js +133 -0
- package/dist/lib/css/property-descriptor.js +2 -0
- package/dist/lib/css/property-descriptors/background-blend-mode.js +41 -0
- package/dist/lib/css/property-descriptors/background-clip.js +23 -0
- package/dist/lib/css/property-descriptors/background-color.js +10 -0
- package/dist/lib/css/property-descriptors/background-image.js +24 -0
- package/dist/lib/css/property-descriptors/background-origin.js +23 -0
- package/dist/lib/css/property-descriptors/background-position.js +19 -0
- package/dist/lib/css/property-descriptors/background-repeat.js +33 -0
- package/dist/lib/css/property-descriptors/background-size.js +23 -0
- package/dist/lib/css/property-descriptors/border-color.js +14 -0
- package/dist/lib/css/property-descriptors/border-image-repeat.js +42 -0
- package/dist/lib/css/property-descriptors/border-image-slice.js +45 -0
- package/dist/lib/css/property-descriptors/border-image-source.js +22 -0
- package/dist/lib/css/property-descriptors/border-radius.js +15 -0
- package/dist/lib/css/property-descriptors/border-style.js +26 -0
- package/dist/lib/css/property-descriptors/border-width.js +20 -0
- package/dist/lib/css/property-descriptors/box-decoration-break.js +18 -0
- package/dist/lib/css/property-descriptors/box-shadow.js +54 -0
- package/dist/lib/css/property-descriptors/clip-path.js +189 -0
- package/dist/lib/css/property-descriptors/color.js +10 -0
- package/dist/lib/css/property-descriptors/content.js +19 -0
- package/dist/lib/css/property-descriptors/counter-increment.js +35 -0
- package/dist/lib/css/property-descriptors/counter-reset.js +18 -0
- package/dist/lib/css/property-descriptors/direction.js +18 -0
- package/dist/lib/css/property-descriptors/display.js +81 -0
- package/dist/lib/css/property-descriptors/duration.js +14 -0
- package/dist/lib/css/property-descriptors/filter.js +76 -0
- package/dist/lib/css/property-descriptors/float.js +22 -0
- package/dist/lib/css/property-descriptors/font-family.js +32 -0
- package/dist/lib/css/property-descriptors/font-size.js +10 -0
- package/dist/lib/css/property-descriptors/font-style.js +20 -0
- package/dist/lib/css/property-descriptors/font-variant-ligatures.js +34 -0
- package/dist/lib/css/property-descriptors/font-variant.js +13 -0
- package/dist/lib/css/property-descriptors/font-weight.js +25 -0
- package/dist/lib/css/property-descriptors/image-rendering.js +33 -0
- package/dist/lib/css/property-descriptors/letter-spacing.js +21 -0
- package/dist/lib/css/property-descriptors/line-break.js +23 -0
- package/dist/lib/css/property-descriptors/line-height.js +24 -0
- package/dist/lib/css/property-descriptors/list-style-image.js +17 -0
- package/dist/lib/css/property-descriptors/list-style-position.js +18 -0
- package/dist/lib/css/property-descriptors/list-style-type.js +122 -0
- package/dist/lib/css/property-descriptors/margin.js +13 -0
- package/dist/lib/css/property-descriptors/mix-blend-mode.js +31 -0
- package/dist/lib/css/property-descriptors/object-fit.js +28 -0
- package/dist/lib/css/property-descriptors/object-position.js +42 -0
- package/dist/lib/css/property-descriptors/opacity.js +16 -0
- package/dist/lib/css/property-descriptors/overflow-wrap.js +18 -0
- package/dist/lib/css/property-descriptors/overflow.js +27 -0
- package/dist/lib/css/property-descriptors/padding.js +14 -0
- package/dist/lib/css/property-descriptors/paint-order.js +33 -0
- package/dist/lib/css/property-descriptors/position.js +22 -0
- package/dist/lib/css/property-descriptors/quotes.js +41 -0
- package/dist/lib/css/property-descriptors/rotate.js +27 -0
- package/dist/lib/css/property-descriptors/text-align.js +21 -0
- package/dist/lib/css/property-descriptors/text-decoration-color.js +10 -0
- package/dist/lib/css/property-descriptors/text-decoration-line.js +28 -0
- package/dist/lib/css/property-descriptors/text-decoration-style.js +24 -0
- package/dist/lib/css/property-descriptors/text-decoration-thickness.js +26 -0
- package/dist/lib/css/property-descriptors/text-overflow.js +18 -0
- package/dist/lib/css/property-descriptors/text-shadow.js +46 -0
- package/dist/lib/css/property-descriptors/text-transform.js +20 -0
- package/dist/lib/css/property-descriptors/text-underline-offset.js +23 -0
- package/dist/lib/css/property-descriptors/transform-origin.js +24 -0
- package/dist/lib/css/property-descriptors/transform.js +57 -0
- package/dist/lib/css/property-descriptors/visibility.js +20 -0
- package/dist/lib/css/property-descriptors/webkit-line-clamp.js +26 -0
- package/dist/lib/css/property-descriptors/webkit-text-stroke-color.js +10 -0
- package/dist/lib/css/property-descriptors/webkit-text-stroke-width.js +16 -0
- package/dist/lib/css/property-descriptors/word-break.js +26 -0
- package/dist/lib/css/property-descriptors/writing-mode.js +28 -0
- package/dist/lib/css/property-descriptors/z-index.js +19 -0
- package/dist/lib/css/property-descriptors/zoom.js +18 -0
- package/dist/lib/css/syntax/parser.js +140 -0
- package/dist/lib/css/syntax/token-constants.js +214 -0
- package/dist/lib/css/syntax/token-singletons.js +36 -0
- package/dist/lib/css/syntax/token-types.js +10 -0
- package/dist/lib/css/syntax/tokenizer.js +502 -0
- package/dist/lib/css/type-descriptor.js +2 -0
- package/dist/lib/css/types/angle.js +80 -0
- package/dist/lib/css/types/color-math.js +25 -0
- package/dist/lib/css/types/color-spaces/a98.js +78 -0
- package/dist/lib/css/types/color-spaces/p3.js +86 -0
- package/dist/lib/css/types/color-spaces/pro-photo.js +83 -0
- package/dist/lib/css/types/color-spaces/rec2020.js +85 -0
- package/dist/lib/css/types/color-spaces/srgb.js +79 -0
- package/dist/lib/css/types/color-utilities.js +342 -0
- package/dist/lib/css/types/color.js +400 -0
- package/dist/lib/css/types/functions/-prefix-linear-gradient.js +32 -0
- package/dist/lib/css/types/functions/-prefix-radial-gradient.js +83 -0
- package/dist/lib/css/types/functions/-webkit-gradient.js +59 -0
- package/dist/lib/css/types/functions/counter.js +367 -0
- package/dist/lib/css/types/functions/gradient.js +163 -0
- package/dist/lib/css/types/functions/linear-gradient.js +27 -0
- package/dist/lib/css/types/functions/radial-gradient.js +90 -0
- package/dist/lib/css/types/functions/repeating-linear-gradient.js +9 -0
- package/dist/lib/css/types/image.js +62 -0
- package/dist/lib/css/types/index.js +2 -0
- package/dist/lib/css/types/length-percentage.js +197 -0
- package/dist/lib/css/types/length.js +5 -0
- package/dist/lib/css/types/safe-eval.js +80 -0
- package/dist/lib/css/types/time.js +17 -0
- package/dist/lib/dom/document-cloner.js +597 -0
- package/dist/lib/dom/dom-normalizer.js +115 -0
- package/dist/lib/dom/element-container.js +56 -0
- package/dist/lib/dom/elements/li-element-container.js +11 -0
- package/dist/lib/dom/elements/ol-element-container.js +12 -0
- package/dist/lib/dom/elements/select-element-container.js +12 -0
- package/dist/lib/dom/elements/textarea-element-container.js +11 -0
- package/dist/lib/dom/node-parser.js +112 -0
- package/dist/lib/dom/node-type-guards.js +81 -0
- package/dist/lib/dom/replaced-elements/canvas-element-container.js +13 -0
- package/dist/lib/dom/replaced-elements/iframe-element-container.js +38 -0
- package/dist/lib/dom/replaced-elements/image-element-container.js +14 -0
- package/dist/lib/dom/replaced-elements/index.js +2 -0
- package/dist/lib/dom/replaced-elements/input-element-container.js +89 -0
- package/dist/lib/dom/replaced-elements/svg-element-container.js +19 -0
- package/dist/lib/dom/slot-cloner.js +176 -0
- package/dist/lib/dom/text-container.js +35 -0
- package/dist/lib/index.js +49 -0
- package/dist/lib/options.js +2 -0
- package/dist/lib/render/background.js +188 -0
- package/dist/lib/render/bezier-curve.js +34 -0
- package/dist/lib/render/border.js +104 -0
- package/dist/lib/render/bound-curves.js +188 -0
- package/dist/lib/render/box-sizing.js +20 -0
- package/dist/lib/render/canvas/background-renderer.js +327 -0
- package/dist/lib/render/canvas/border-image-renderer.js +153 -0
- package/dist/lib/render/canvas/border-renderer.js +184 -0
- package/dist/lib/render/canvas/canvas-path.js +25 -0
- package/dist/lib/render/canvas/canvas-renderer.js +312 -0
- package/dist/lib/render/canvas/content-renderer.js +204 -0
- package/dist/lib/render/canvas/effects-renderer.js +171 -0
- package/dist/lib/render/canvas/font-utils.js +29 -0
- package/dist/lib/render/canvas/foreignobject-renderer.js +38 -0
- package/dist/lib/render/canvas/text/text-decoration-renderer.js +99 -0
- package/dist/lib/render/canvas/text-renderer.js +485 -0
- package/dist/lib/render/effects.js +231 -0
- package/dist/lib/render/font-metrics.js +53 -0
- package/dist/lib/render/object-fit.js +91 -0
- package/dist/lib/render/path.js +26 -0
- package/dist/lib/render/renderer-interface.js +2 -0
- package/dist/lib/render/stacking-context.js +340 -0
- package/dist/lib/render/vector.js +16 -0
- package/dist/types/config.d.ts +44 -0
- package/dist/types/core/abort-helper.d.ts +12 -0
- package/dist/types/core/background-parser.d.ts +16 -0
- package/dist/types/core/bitwise.d.ts +1 -0
- package/dist/types/core/cache-storage.d.ts +68 -0
- package/dist/types/core/config-assembler.d.ts +28 -0
- package/dist/types/core/constants.d.ts +22 -0
- package/dist/types/core/context.d.ts +22 -0
- package/dist/types/core/debugger.d.ts +8 -0
- package/dist/types/core/features.d.ts +12 -0
- package/dist/types/core/logger.d.ts +18 -0
- package/dist/types/core/lru-map.d.ts +37 -0
- package/dist/types/core/origin-checker.d.ts +33 -0
- package/dist/types/core/performance-monitor.d.ts +120 -0
- package/dist/types/core/render-element.d.ts +3 -0
- package/dist/types/core/util.d.ts +1 -0
- package/dist/types/core/validator.d.ts +130 -0
- package/dist/types/css/grouped/background-styles.d.ts +16 -0
- package/dist/types/css/grouped/border-styles.d.ts +31 -0
- package/dist/types/css/grouped/font-styles.d.ts +35 -0
- package/dist/types/css/grouped/layout-styles.d.ts +46 -0
- package/dist/types/css/index.d.ts +185 -0
- package/dist/types/css/layout/bounds.d.ts +14 -0
- package/dist/types/css/layout/text.d.ts +10 -0
- package/dist/types/css/property-descriptor.d.ts +40 -0
- package/dist/types/css/property-descriptors/background-blend-mode.d.ts +23 -0
- package/dist/types/css/property-descriptors/background-clip.d.ts +8 -0
- package/dist/types/css/property-descriptors/background-color.d.ts +2 -0
- package/dist/types/css/property-descriptors/background-image.d.ts +3 -0
- package/dist/types/css/property-descriptors/background-origin.d.ts +8 -0
- package/dist/types/css/property-descriptors/background-position.d.ts +5 -0
- package/dist/types/css/property-descriptors/background-repeat.d.ts +9 -0
- package/dist/types/css/property-descriptors/background-size.d.ts +11 -0
- package/dist/types/css/property-descriptors/border-color.d.ts +5 -0
- package/dist/types/css/property-descriptors/border-image-repeat.d.ts +12 -0
- package/dist/types/css/property-descriptors/border-image-slice.d.ts +10 -0
- package/dist/types/css/property-descriptors/border-image-source.d.ts +4 -0
- package/dist/types/css/property-descriptors/border-radius.d.ts +7 -0
- package/dist/types/css/property-descriptors/border-style.d.ts +12 -0
- package/dist/types/css/property-descriptors/border-width.d.ts +5 -0
- package/dist/types/css/property-descriptors/box-decoration-break.d.ts +6 -0
- package/dist/types/css/property-descriptors/box-shadow.d.ts +14 -0
- package/dist/types/css/property-descriptors/clip-path.d.ts +62 -0
- package/dist/types/css/property-descriptors/color.d.ts +2 -0
- package/dist/types/css/property-descriptors/content.d.ts +4 -0
- package/dist/types/css/property-descriptors/counter-increment.d.ts +10 -0
- package/dist/types/css/property-descriptors/counter-reset.d.ts +7 -0
- package/dist/types/css/property-descriptors/direction.d.ts +6 -0
- package/dist/types/css/property-descriptors/display.d.ts +35 -0
- package/dist/types/css/property-descriptors/duration.d.ts +2 -0
- package/dist/types/css/property-descriptors/filter.d.ts +3 -0
- package/dist/types/css/property-descriptors/float.d.ts +9 -0
- package/dist/types/css/property-descriptors/font-family.d.ts +4 -0
- package/dist/types/css/property-descriptors/font-size.d.ts +2 -0
- package/dist/types/css/property-descriptors/font-style.d.ts +7 -0
- package/dist/types/css/property-descriptors/font-variant-ligatures.d.ts +14 -0
- package/dist/types/css/property-descriptors/font-variant.d.ts +2 -0
- package/dist/types/css/property-descriptors/font-weight.d.ts +2 -0
- package/dist/types/css/property-descriptors/image-rendering.d.ts +8 -0
- package/dist/types/css/property-descriptors/letter-spacing.d.ts +2 -0
- package/dist/types/css/property-descriptors/line-break.d.ts +6 -0
- package/dist/types/css/property-descriptors/line-height.d.ts +4 -0
- package/dist/types/css/property-descriptors/list-style-image.d.ts +3 -0
- package/dist/types/css/property-descriptors/list-style-position.d.ts +6 -0
- package/dist/types/css/property-descriptors/list-style-type.d.ts +58 -0
- package/dist/types/css/property-descriptors/margin.d.ts +5 -0
- package/dist/types/css/property-descriptors/mix-blend-mode.d.ts +21 -0
- package/dist/types/css/property-descriptors/object-fit.d.ts +10 -0
- package/dist/types/css/property-descriptors/object-position.d.ts +4 -0
- package/dist/types/css/property-descriptors/opacity.d.ts +2 -0
- package/dist/types/css/property-descriptors/overflow-wrap.d.ts +6 -0
- package/dist/types/css/property-descriptors/overflow.d.ts +9 -0
- package/dist/types/css/property-descriptors/padding.d.ts +5 -0
- package/dist/types/css/property-descriptors/paint-order.d.ts +8 -0
- package/dist/types/css/property-descriptors/position.d.ts +9 -0
- package/dist/types/css/property-descriptors/quotes.d.ts +8 -0
- package/dist/types/css/property-descriptors/rotate.d.ts +3 -0
- package/dist/types/css/property-descriptors/text-align.d.ts +7 -0
- package/dist/types/css/property-descriptors/text-decoration-color.d.ts +2 -0
- package/dist/types/css/property-descriptors/text-decoration-line.d.ts +10 -0
- package/dist/types/css/property-descriptors/text-decoration-style.d.ts +9 -0
- package/dist/types/css/property-descriptors/text-decoration-thickness.d.ts +3 -0
- package/dist/types/css/property-descriptors/text-overflow.d.ts +6 -0
- package/dist/types/css/property-descriptors/text-shadow.d.ts +12 -0
- package/dist/types/css/property-descriptors/text-transform.d.ts +8 -0
- package/dist/types/css/property-descriptors/text-underline-offset.d.ts +3 -0
- package/dist/types/css/property-descriptors/transform-origin.d.ts +4 -0
- package/dist/types/css/property-descriptors/transform.d.ts +4 -0
- package/dist/types/css/property-descriptors/visibility.d.ts +7 -0
- package/dist/types/css/property-descriptors/webkit-line-clamp.d.ts +7 -0
- package/dist/types/css/property-descriptors/webkit-text-stroke-color.d.ts +2 -0
- package/dist/types/css/property-descriptors/webkit-text-stroke-width.d.ts +2 -0
- package/dist/types/css/property-descriptors/word-break.d.ts +7 -0
- package/dist/types/css/property-descriptors/writing-mode.d.ts +11 -0
- package/dist/types/css/property-descriptors/z-index.d.ts +7 -0
- package/dist/types/css/property-descriptors/zoom.d.ts +3 -0
- package/dist/types/css/syntax/parser.d.ts +34 -0
- package/dist/types/css/syntax/token-constants.d.ts +74 -0
- package/dist/types/css/syntax/token-singletons.d.ts +22 -0
- package/dist/types/css/syntax/token-types.d.ts +72 -0
- package/dist/types/css/syntax/tokenizer.d.ts +32 -0
- package/dist/types/css/type-descriptor.d.ts +6 -0
- package/dist/types/css/types/angle.d.ts +7 -0
- package/dist/types/css/types/color-math.d.ts +12 -0
- package/dist/types/css/types/color-spaces/a98.d.ts +39 -0
- package/dist/types/css/types/color-spaces/p3.d.ts +45 -0
- package/dist/types/css/types/color-spaces/pro-photo.d.ts +45 -0
- package/dist/types/css/types/color-spaces/rec2020.d.ts +45 -0
- package/dist/types/css/types/color-spaces/srgb.d.ts +38 -0
- package/dist/types/css/types/color-utilities.d.ts +107 -0
- package/dist/types/css/types/color.d.ts +8 -0
- package/dist/types/css/types/functions/-prefix-linear-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/-prefix-radial-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/-webkit-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/counter.d.ts +10 -0
- package/dist/types/css/types/functions/gradient.d.ts +7 -0
- package/dist/types/css/types/functions/linear-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/radial-gradient.d.ts +12 -0
- package/dist/types/css/types/functions/repeating-linear-gradient.d.ts +4 -0
- package/dist/types/css/types/image.d.ts +56 -0
- package/dist/types/css/types/index.d.ts +1 -0
- package/dist/types/css/types/length-percentage.d.ts +62 -0
- package/dist/types/css/types/length.d.ts +4 -0
- package/dist/types/css/types/safe-eval.d.ts +8 -0
- package/dist/types/css/types/time.d.ts +2 -0
- package/dist/types/dom/document-cloner.d.ts +57 -0
- package/dist/types/dom/dom-normalizer.d.ts +62 -0
- package/dist/types/dom/element-container.d.ts +31 -0
- package/dist/types/dom/elements/li-element-container.d.ts +6 -0
- package/dist/types/dom/elements/ol-element-container.d.ts +7 -0
- package/dist/types/dom/elements/select-element-container.d.ts +6 -0
- package/dist/types/dom/elements/textarea-element-container.d.ts +6 -0
- package/dist/types/dom/node-parser.d.ts +3 -0
- package/dist/types/dom/node-type-guards.d.ts +32 -0
- package/dist/types/dom/replaced-elements/canvas-element-container.d.ts +8 -0
- package/dist/types/dom/replaced-elements/iframe-element-container.d.ts +14 -0
- package/dist/types/dom/replaced-elements/image-element-container.d.ts +8 -0
- package/dist/types/dom/replaced-elements/index.d.ts +4 -0
- package/dist/types/dom/replaced-elements/input-element-container.d.ts +14 -0
- package/dist/types/dom/replaced-elements/svg-element-container.d.ts +8 -0
- package/dist/types/dom/slot-cloner.d.ts +66 -0
- package/dist/types/dom/text-container.d.ts +8 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/options.d.ts +62 -0
- package/dist/types/render/background.d.ts +16 -0
- package/dist/types/render/bezier-curve.d.ts +14 -0
- package/dist/types/render/border.d.ts +6 -0
- package/dist/types/render/bound-curves.d.ts +32 -0
- package/dist/types/render/box-sizing.d.ts +4 -0
- package/dist/types/render/canvas/background-renderer.d.ts +94 -0
- package/dist/types/render/canvas/border-image-renderer.d.ts +18 -0
- package/dist/types/render/canvas/border-renderer.d.ts +67 -0
- package/dist/types/render/canvas/canvas-path.d.ts +3 -0
- package/dist/types/render/canvas/canvas-renderer.d.ts +60 -0
- package/dist/types/render/canvas/content-renderer.d.ts +43 -0
- package/dist/types/render/canvas/effects-renderer.d.ts +90 -0
- package/dist/types/render/canvas/font-utils.d.ts +19 -0
- package/dist/types/render/canvas/foreignobject-renderer.d.ts +10 -0
- package/dist/types/render/canvas/text/text-decoration-renderer.d.ts +18 -0
- package/dist/types/render/canvas/text-renderer.d.ts +103 -0
- package/dist/types/render/effects.d.ts +112 -0
- package/dist/types/render/font-metrics.d.ts +11 -0
- package/dist/types/render/object-fit.d.ts +19 -0
- package/dist/types/render/path.d.ts +13 -0
- package/dist/types/render/renderer-interface.d.ts +28 -0
- package/dist/types/render/stacking-context.d.ts +49 -0
- package/dist/types/render/vector.d.ts +9 -0
- package/package.json +139 -4
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listStyleType = void 0;
|
|
4
|
+
exports.listStyleType = {
|
|
5
|
+
name: 'list-style-type',
|
|
6
|
+
initialValue: 'none',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, type) => {
|
|
10
|
+
switch (type) {
|
|
11
|
+
case 'disc':
|
|
12
|
+
return 0 /* LIST_STYLE_TYPE.DISC */;
|
|
13
|
+
case 'circle':
|
|
14
|
+
return 1 /* LIST_STYLE_TYPE.CIRCLE */;
|
|
15
|
+
case 'square':
|
|
16
|
+
return 2 /* LIST_STYLE_TYPE.SQUARE */;
|
|
17
|
+
case 'decimal':
|
|
18
|
+
return 3 /* LIST_STYLE_TYPE.DECIMAL */;
|
|
19
|
+
case 'cjk-decimal':
|
|
20
|
+
return 4 /* LIST_STYLE_TYPE.CJK_DECIMAL */;
|
|
21
|
+
case 'decimal-leading-zero':
|
|
22
|
+
return 5 /* LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO */;
|
|
23
|
+
case 'lower-roman':
|
|
24
|
+
return 6 /* LIST_STYLE_TYPE.LOWER_ROMAN */;
|
|
25
|
+
case 'upper-roman':
|
|
26
|
+
return 7 /* LIST_STYLE_TYPE.UPPER_ROMAN */;
|
|
27
|
+
case 'lower-greek':
|
|
28
|
+
return 8 /* LIST_STYLE_TYPE.LOWER_GREEK */;
|
|
29
|
+
case 'lower-alpha':
|
|
30
|
+
return 9 /* LIST_STYLE_TYPE.LOWER_ALPHA */;
|
|
31
|
+
case 'upper-alpha':
|
|
32
|
+
return 10 /* LIST_STYLE_TYPE.UPPER_ALPHA */;
|
|
33
|
+
case 'arabic-indic':
|
|
34
|
+
return 11 /* LIST_STYLE_TYPE.ARABIC_INDIC */;
|
|
35
|
+
case 'armenian':
|
|
36
|
+
return 12 /* LIST_STYLE_TYPE.ARMENIAN */;
|
|
37
|
+
case 'bengali':
|
|
38
|
+
return 13 /* LIST_STYLE_TYPE.BENGALI */;
|
|
39
|
+
case 'cambodian':
|
|
40
|
+
return 14 /* LIST_STYLE_TYPE.CAMBODIAN */;
|
|
41
|
+
case 'cjk-earthly-branch':
|
|
42
|
+
return 15 /* LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH */;
|
|
43
|
+
case 'cjk-heavenly-stem':
|
|
44
|
+
return 16 /* LIST_STYLE_TYPE.CJK_HEAVENLY_STEM */;
|
|
45
|
+
case 'cjk-ideographic':
|
|
46
|
+
return 17 /* LIST_STYLE_TYPE.CJK_IDEOGRAPHIC */;
|
|
47
|
+
case 'devanagari':
|
|
48
|
+
return 18 /* LIST_STYLE_TYPE.DEVANAGARI */;
|
|
49
|
+
case 'ethiopic-numeric':
|
|
50
|
+
return 19 /* LIST_STYLE_TYPE.ETHIOPIC_NUMERIC */;
|
|
51
|
+
case 'georgian':
|
|
52
|
+
return 20 /* LIST_STYLE_TYPE.GEORGIAN */;
|
|
53
|
+
case 'gujarati':
|
|
54
|
+
return 21 /* LIST_STYLE_TYPE.GUJARATI */;
|
|
55
|
+
case 'gurmukhi':
|
|
56
|
+
return 22 /* LIST_STYLE_TYPE.GURMUKHI */;
|
|
57
|
+
case 'hebrew':
|
|
58
|
+
return 52 /* LIST_STYLE_TYPE.HEBREW */;
|
|
59
|
+
case 'hiragana':
|
|
60
|
+
return 23 /* LIST_STYLE_TYPE.HIRAGANA */;
|
|
61
|
+
case 'hiragana-iroha':
|
|
62
|
+
return 24 /* LIST_STYLE_TYPE.HIRAGANA_IROHA */;
|
|
63
|
+
case 'japanese-formal':
|
|
64
|
+
return 25 /* LIST_STYLE_TYPE.JAPANESE_FORMAL */;
|
|
65
|
+
case 'japanese-informal':
|
|
66
|
+
return 26 /* LIST_STYLE_TYPE.JAPANESE_INFORMAL */;
|
|
67
|
+
case 'kannada':
|
|
68
|
+
return 27 /* LIST_STYLE_TYPE.KANNADA */;
|
|
69
|
+
case 'katakana':
|
|
70
|
+
return 28 /* LIST_STYLE_TYPE.KATAKANA */;
|
|
71
|
+
case 'katakana-iroha':
|
|
72
|
+
return 29 /* LIST_STYLE_TYPE.KATAKANA_IROHA */;
|
|
73
|
+
case 'khmer':
|
|
74
|
+
return 30 /* LIST_STYLE_TYPE.KHMER */;
|
|
75
|
+
case 'korean-hangul-formal':
|
|
76
|
+
return 31 /* LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL */;
|
|
77
|
+
case 'korean-hanja-formal':
|
|
78
|
+
return 32 /* LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL */;
|
|
79
|
+
case 'korean-hanja-informal':
|
|
80
|
+
return 33 /* LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL */;
|
|
81
|
+
case 'lao':
|
|
82
|
+
return 34 /* LIST_STYLE_TYPE.LAO */;
|
|
83
|
+
case 'lower-armenian':
|
|
84
|
+
return 35 /* LIST_STYLE_TYPE.LOWER_ARMENIAN */;
|
|
85
|
+
case 'malayalam':
|
|
86
|
+
return 36 /* LIST_STYLE_TYPE.MALAYALAM */;
|
|
87
|
+
case 'mongolian':
|
|
88
|
+
return 37 /* LIST_STYLE_TYPE.MONGOLIAN */;
|
|
89
|
+
case 'myanmar':
|
|
90
|
+
return 38 /* LIST_STYLE_TYPE.MYANMAR */;
|
|
91
|
+
case 'oriya':
|
|
92
|
+
return 39 /* LIST_STYLE_TYPE.ORIYA */;
|
|
93
|
+
case 'persian':
|
|
94
|
+
return 40 /* LIST_STYLE_TYPE.PERSIAN */;
|
|
95
|
+
case 'simp-chinese-formal':
|
|
96
|
+
return 41 /* LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL */;
|
|
97
|
+
case 'simp-chinese-informal':
|
|
98
|
+
return 42 /* LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL */;
|
|
99
|
+
case 'tamil':
|
|
100
|
+
return 43 /* LIST_STYLE_TYPE.TAMIL */;
|
|
101
|
+
case 'telugu':
|
|
102
|
+
return 44 /* LIST_STYLE_TYPE.TELUGU */;
|
|
103
|
+
case 'thai':
|
|
104
|
+
return 45 /* LIST_STYLE_TYPE.THAI */;
|
|
105
|
+
case 'tibetan':
|
|
106
|
+
return 46 /* LIST_STYLE_TYPE.TIBETAN */;
|
|
107
|
+
case 'trad-chinese-formal':
|
|
108
|
+
return 47 /* LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL */;
|
|
109
|
+
case 'trad-chinese-informal':
|
|
110
|
+
return 48 /* LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL */;
|
|
111
|
+
case 'upper-armenian':
|
|
112
|
+
return 49 /* LIST_STYLE_TYPE.UPPER_ARMENIAN */;
|
|
113
|
+
case 'disclosure-open':
|
|
114
|
+
return 50 /* LIST_STYLE_TYPE.DISCLOSURE_OPEN */;
|
|
115
|
+
case 'disclosure-closed':
|
|
116
|
+
return 51 /* LIST_STYLE_TYPE.DISCLOSURE_CLOSED */;
|
|
117
|
+
case 'none':
|
|
118
|
+
default:
|
|
119
|
+
return -1 /* LIST_STYLE_TYPE.NONE */;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.marginLeft = exports.marginBottom = exports.marginRight = exports.marginTop = void 0;
|
|
4
|
+
const marginForSide = (side) => ({
|
|
5
|
+
name: `margin-${side}`,
|
|
6
|
+
initialValue: '0',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 4 /* PropertyDescriptorParsingType.TOKEN_VALUE */
|
|
9
|
+
});
|
|
10
|
+
exports.marginTop = marginForSide('top');
|
|
11
|
+
exports.marginRight = marginForSide('right');
|
|
12
|
+
exports.marginBottom = marginForSide('bottom');
|
|
13
|
+
exports.marginLeft = marginForSide('left');
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mixBlendMode = exports.MIX_BLEND_MODE = void 0;
|
|
4
|
+
exports.MIX_BLEND_MODE = {
|
|
5
|
+
NORMAL: 'normal',
|
|
6
|
+
MULTIPLY: 'multiply',
|
|
7
|
+
SCREEN: 'screen',
|
|
8
|
+
OVERLAY: 'overlay',
|
|
9
|
+
DARKEN: 'darken',
|
|
10
|
+
LIGHTEN: 'lighten',
|
|
11
|
+
COLOR_DODGE: 'color-dodge',
|
|
12
|
+
COLOR_BURN: 'color-burn',
|
|
13
|
+
HARD_LIGHT: 'hard-light',
|
|
14
|
+
SOFT_LIGHT: 'soft-light',
|
|
15
|
+
DIFFERENCE: 'difference',
|
|
16
|
+
EXCLUSION: 'exclusion',
|
|
17
|
+
HUE: 'hue',
|
|
18
|
+
SATURATION: 'saturation',
|
|
19
|
+
COLOR: 'color',
|
|
20
|
+
LUMINOSITY: 'luminosity'
|
|
21
|
+
};
|
|
22
|
+
const VALID_VALUES = new Set(Object.values(exports.MIX_BLEND_MODE));
|
|
23
|
+
exports.mixBlendMode = {
|
|
24
|
+
name: 'mix-blend-mode',
|
|
25
|
+
initialValue: 'normal',
|
|
26
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
27
|
+
prefix: false,
|
|
28
|
+
parse: (_context, token) => {
|
|
29
|
+
return VALID_VALUES.has(token) ? token : exports.MIX_BLEND_MODE.NORMAL;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.objectFit = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.objectFit = {
|
|
6
|
+
name: 'object-fit',
|
|
7
|
+
initialValue: 'fill',
|
|
8
|
+
prefix: false,
|
|
9
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
10
|
+
parse: (_context, tokens) => {
|
|
11
|
+
return tokens.filter(parser_1.isIdentToken).reduce((bit, token) => {
|
|
12
|
+
return bit | parseDisplayValue(token.value);
|
|
13
|
+
}, 0 /* OBJECT_FIT.FILL */);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const parseDisplayValue = (display) => {
|
|
17
|
+
switch (display) {
|
|
18
|
+
case 'contain':
|
|
19
|
+
return 2 /* OBJECT_FIT.CONTAIN */;
|
|
20
|
+
case 'cover':
|
|
21
|
+
return 4 /* OBJECT_FIT.COVER */;
|
|
22
|
+
case 'none':
|
|
23
|
+
return 8 /* OBJECT_FIT.NONE */;
|
|
24
|
+
case 'scale-down':
|
|
25
|
+
return 16 /* OBJECT_FIT.SCALE_DOWN */;
|
|
26
|
+
}
|
|
27
|
+
return 0 /* OBJECT_FIT.FILL */;
|
|
28
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.objectPosition = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
const length_percentage_1 = require("../types/length-percentage");
|
|
6
|
+
exports.objectPosition = {
|
|
7
|
+
name: 'object-position',
|
|
8
|
+
initialValue: '50% 50%',
|
|
9
|
+
prefix: false,
|
|
10
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
11
|
+
parse: (_context, tokens) => {
|
|
12
|
+
const result = [];
|
|
13
|
+
let i = 0;
|
|
14
|
+
while (i < tokens.length && result.length < 2) {
|
|
15
|
+
const token = tokens[i];
|
|
16
|
+
if ((0, parser_1.isIdentToken)(token)) {
|
|
17
|
+
switch (token.value) {
|
|
18
|
+
case 'left':
|
|
19
|
+
case 'top':
|
|
20
|
+
result.push(length_percentage_1.ZERO_LENGTH);
|
|
21
|
+
break;
|
|
22
|
+
case 'center':
|
|
23
|
+
result.push(length_percentage_1.FIFTY_PERCENT);
|
|
24
|
+
break;
|
|
25
|
+
case 'right':
|
|
26
|
+
case 'bottom':
|
|
27
|
+
result.push(length_percentage_1.HUNDRED_PERCENT);
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else if ((0, length_percentage_1.isLengthPercentage)(token)) {
|
|
32
|
+
result.push(token);
|
|
33
|
+
}
|
|
34
|
+
i++;
|
|
35
|
+
}
|
|
36
|
+
// Fill to 2 values with defaults
|
|
37
|
+
while (result.length < 2) {
|
|
38
|
+
result.push(length_percentage_1.FIFTY_PERCENT);
|
|
39
|
+
}
|
|
40
|
+
return [result[0], result[1]];
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.opacity = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.opacity = {
|
|
6
|
+
name: 'opacity',
|
|
7
|
+
initialValue: '1',
|
|
8
|
+
type: 0 /* PropertyDescriptorParsingType.VALUE */,
|
|
9
|
+
prefix: false,
|
|
10
|
+
parse: (_context, token) => {
|
|
11
|
+
if ((0, parser_1.isNumberToken)(token)) {
|
|
12
|
+
return token.number;
|
|
13
|
+
}
|
|
14
|
+
return 1;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.overflowWrap = void 0;
|
|
4
|
+
exports.overflowWrap = {
|
|
5
|
+
name: 'overflow-wrap',
|
|
6
|
+
initialValue: 'normal',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, overflow) => {
|
|
10
|
+
switch (overflow) {
|
|
11
|
+
case 'break-word':
|
|
12
|
+
return "break-word" /* OVERFLOW_WRAP.BREAK_WORD */;
|
|
13
|
+
case 'normal':
|
|
14
|
+
default:
|
|
15
|
+
return "normal" /* OVERFLOW_WRAP.NORMAL */;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.overflow = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.overflow = {
|
|
6
|
+
name: 'overflow',
|
|
7
|
+
initialValue: 'visible',
|
|
8
|
+
prefix: false,
|
|
9
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
10
|
+
parse: (_context, tokens) => {
|
|
11
|
+
return tokens.filter(parser_1.isIdentToken).map((overflow) => {
|
|
12
|
+
switch (overflow.value) {
|
|
13
|
+
case 'hidden':
|
|
14
|
+
return 1 /* OVERFLOW.HIDDEN */;
|
|
15
|
+
case 'scroll':
|
|
16
|
+
return 2 /* OVERFLOW.SCROLL */;
|
|
17
|
+
case 'clip':
|
|
18
|
+
return 3 /* OVERFLOW.CLIP */;
|
|
19
|
+
case 'auto':
|
|
20
|
+
return 4 /* OVERFLOW.AUTO */;
|
|
21
|
+
case 'visible':
|
|
22
|
+
default:
|
|
23
|
+
return 0 /* OVERFLOW.VISIBLE */;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paddingLeft = exports.paddingBottom = exports.paddingRight = exports.paddingTop = void 0;
|
|
4
|
+
const paddingForSide = (side) => ({
|
|
5
|
+
name: `padding-${side}`,
|
|
6
|
+
initialValue: '0',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 3 /* PropertyDescriptorParsingType.TYPE_VALUE */,
|
|
9
|
+
format: 'length-percentage'
|
|
10
|
+
});
|
|
11
|
+
exports.paddingTop = paddingForSide('top');
|
|
12
|
+
exports.paddingRight = paddingForSide('right');
|
|
13
|
+
exports.paddingBottom = paddingForSide('bottom');
|
|
14
|
+
exports.paddingLeft = paddingForSide('left');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paintOrder = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.paintOrder = {
|
|
6
|
+
name: 'paint-order',
|
|
7
|
+
initialValue: 'normal',
|
|
8
|
+
prefix: false,
|
|
9
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
10
|
+
parse: (_context, tokens) => {
|
|
11
|
+
const DEFAULT_VALUE = [0 /* PAINT_ORDER_LAYER.FILL */, 1 /* PAINT_ORDER_LAYER.STROKE */, 2 /* PAINT_ORDER_LAYER.MARKERS */];
|
|
12
|
+
const layers = [];
|
|
13
|
+
tokens.filter(parser_1.isIdentToken).forEach((token) => {
|
|
14
|
+
switch (token.value) {
|
|
15
|
+
case 'stroke':
|
|
16
|
+
layers.push(1 /* PAINT_ORDER_LAYER.STROKE */);
|
|
17
|
+
break;
|
|
18
|
+
case 'fill':
|
|
19
|
+
layers.push(0 /* PAINT_ORDER_LAYER.FILL */);
|
|
20
|
+
break;
|
|
21
|
+
case 'markers':
|
|
22
|
+
layers.push(2 /* PAINT_ORDER_LAYER.MARKERS */);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
DEFAULT_VALUE.forEach((value) => {
|
|
27
|
+
if (layers.indexOf(value) === -1) {
|
|
28
|
+
layers.push(value);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return layers;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.position = void 0;
|
|
4
|
+
exports.position = {
|
|
5
|
+
name: 'position',
|
|
6
|
+
initialValue: 'static',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, position) => {
|
|
10
|
+
switch (position) {
|
|
11
|
+
case 'relative':
|
|
12
|
+
return 1 /* POSITION.RELATIVE */;
|
|
13
|
+
case 'absolute':
|
|
14
|
+
return 2 /* POSITION.ABSOLUTE */;
|
|
15
|
+
case 'fixed':
|
|
16
|
+
return 3 /* POSITION.FIXED */;
|
|
17
|
+
case 'sticky':
|
|
18
|
+
return 4 /* POSITION.STICKY */;
|
|
19
|
+
}
|
|
20
|
+
return 0 /* POSITION.STATIC */;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQuote = exports.quotes = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.quotes = {
|
|
6
|
+
name: 'quotes',
|
|
7
|
+
initialValue: 'none',
|
|
8
|
+
prefix: true,
|
|
9
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
10
|
+
parse: (_context, tokens) => {
|
|
11
|
+
if (tokens.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const first = tokens[0];
|
|
15
|
+
if (first.type === 20 /* TokenType.IDENT_TOKEN */ && first.value === 'none') {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const quotes = [];
|
|
19
|
+
const filtered = tokens.filter(parser_1.isStringToken);
|
|
20
|
+
if (filtered.length % 2 !== 0) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
for (let i = 0; i < filtered.length; i += 2) {
|
|
24
|
+
const open = filtered[i].value;
|
|
25
|
+
const close = filtered[i + 1].value;
|
|
26
|
+
quotes.push({ open, close });
|
|
27
|
+
}
|
|
28
|
+
return quotes;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const getQuote = (quotes, depth, open) => {
|
|
32
|
+
if (!quotes) {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
const quote = quotes[Math.min(depth, quotes.length - 1)];
|
|
36
|
+
if (!quote) {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
return open ? quote.open : quote.close;
|
|
40
|
+
};
|
|
41
|
+
exports.getQuote = getQuote;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rotate = void 0;
|
|
4
|
+
const angle_1 = require("../types/angle");
|
|
5
|
+
exports.rotate = {
|
|
6
|
+
name: 'rotate',
|
|
7
|
+
initialValue: 'none',
|
|
8
|
+
prefix: false,
|
|
9
|
+
type: 0 /* PropertyDescriptorParsingType.VALUE */,
|
|
10
|
+
parse: (_context, token) => {
|
|
11
|
+
if (token.type === 20 /* TokenType.IDENT_TOKEN */ && token.value === 'none') {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (token.type === 17 /* TokenType.NUMBER_TOKEN */) {
|
|
15
|
+
if (token.number === 0) {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (token.type === 15 /* TokenType.DIMENSION_TOKEN */) {
|
|
20
|
+
// Parse angle and convert to degrees for storage
|
|
21
|
+
const radians = angle_1.angle.parse(_context, token);
|
|
22
|
+
// Store as degrees for consistency
|
|
23
|
+
return (radians * 180) / Math.PI;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textAlign = void 0;
|
|
4
|
+
exports.textAlign = {
|
|
5
|
+
name: 'text-align',
|
|
6
|
+
initialValue: 'left',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, textAlign) => {
|
|
10
|
+
switch (textAlign) {
|
|
11
|
+
case 'right':
|
|
12
|
+
return 2 /* TEXT_ALIGN.RIGHT */;
|
|
13
|
+
case 'center':
|
|
14
|
+
case 'justify':
|
|
15
|
+
return 1 /* TEXT_ALIGN.CENTER */;
|
|
16
|
+
case 'left':
|
|
17
|
+
default:
|
|
18
|
+
return 0 /* TEXT_ALIGN.LEFT */;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textDecorationColor = void 0;
|
|
4
|
+
exports.textDecorationColor = {
|
|
5
|
+
name: `text-decoration-color`,
|
|
6
|
+
initialValue: 'transparent',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 3 /* PropertyDescriptorParsingType.TYPE_VALUE */,
|
|
9
|
+
format: 'color'
|
|
10
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textDecorationLine = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.textDecorationLine = {
|
|
6
|
+
name: 'text-decoration-line',
|
|
7
|
+
initialValue: 'none',
|
|
8
|
+
prefix: false,
|
|
9
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
10
|
+
parse: (_context, tokens) => {
|
|
11
|
+
return tokens
|
|
12
|
+
.filter(parser_1.isIdentToken)
|
|
13
|
+
.map((token) => {
|
|
14
|
+
switch (token.value) {
|
|
15
|
+
case 'underline':
|
|
16
|
+
return 1 /* TEXT_DECORATION_LINE.UNDERLINE */;
|
|
17
|
+
case 'overline':
|
|
18
|
+
return 2 /* TEXT_DECORATION_LINE.OVERLINE */;
|
|
19
|
+
case 'line-through':
|
|
20
|
+
return 3 /* TEXT_DECORATION_LINE.LINE_THROUGH */;
|
|
21
|
+
case 'none':
|
|
22
|
+
return 4 /* TEXT_DECORATION_LINE.BLINK */;
|
|
23
|
+
}
|
|
24
|
+
return 0 /* TEXT_DECORATION_LINE.NONE */;
|
|
25
|
+
})
|
|
26
|
+
.filter((line) => line !== 0 /* TEXT_DECORATION_LINE.NONE */);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textDecorationStyle = void 0;
|
|
4
|
+
exports.textDecorationStyle = {
|
|
5
|
+
name: 'text-decoration-style',
|
|
6
|
+
initialValue: 'solid',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, style) => {
|
|
10
|
+
switch (style) {
|
|
11
|
+
case 'double':
|
|
12
|
+
return 1 /* TEXT_DECORATION_STYLE.DOUBLE */;
|
|
13
|
+
case 'dotted':
|
|
14
|
+
return 2 /* TEXT_DECORATION_STYLE.DOTTED */;
|
|
15
|
+
case 'dashed':
|
|
16
|
+
return 3 /* TEXT_DECORATION_STYLE.DASHED */;
|
|
17
|
+
case 'wavy':
|
|
18
|
+
return 4 /* TEXT_DECORATION_STYLE.WAVY */;
|
|
19
|
+
case 'solid':
|
|
20
|
+
default:
|
|
21
|
+
return 0 /* TEXT_DECORATION_STYLE.SOLID */;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textDecorationThickness = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
exports.textDecorationThickness = {
|
|
6
|
+
name: 'text-decoration-thickness',
|
|
7
|
+
initialValue: 'auto',
|
|
8
|
+
prefix: false,
|
|
9
|
+
type: 0 /* PropertyDescriptorParsingType.VALUE */,
|
|
10
|
+
parse: (_context, token) => {
|
|
11
|
+
if ((0, parser_1.isIdentToken)(token)) {
|
|
12
|
+
switch (token.value) {
|
|
13
|
+
case 'auto':
|
|
14
|
+
return 'auto';
|
|
15
|
+
case 'from-font':
|
|
16
|
+
return 'from-font';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if ((0, parser_1.isDimensionToken)(token)) {
|
|
20
|
+
// Convert to pixels
|
|
21
|
+
return token.number;
|
|
22
|
+
}
|
|
23
|
+
// Default to auto
|
|
24
|
+
return 'auto';
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textOverflow = void 0;
|
|
4
|
+
exports.textOverflow = {
|
|
5
|
+
name: 'text-overflow',
|
|
6
|
+
initialValue: 'clip',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, textOverflow) => {
|
|
10
|
+
switch (textOverflow) {
|
|
11
|
+
case 'ellipsis':
|
|
12
|
+
return 1 /* TEXT_OVERFLOW.ELLIPSIS */;
|
|
13
|
+
case 'clip':
|
|
14
|
+
default:
|
|
15
|
+
return 0 /* TEXT_OVERFLOW.CLIP */;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textShadow = void 0;
|
|
4
|
+
const parser_1 = require("../syntax/parser");
|
|
5
|
+
const length_percentage_1 = require("../types/length-percentage");
|
|
6
|
+
const color_1 = require("../types/color");
|
|
7
|
+
const length_1 = require("../types/length");
|
|
8
|
+
exports.textShadow = {
|
|
9
|
+
name: 'text-shadow',
|
|
10
|
+
initialValue: 'none',
|
|
11
|
+
type: 1 /* PropertyDescriptorParsingType.LIST */,
|
|
12
|
+
prefix: false,
|
|
13
|
+
parse: (context, tokens) => {
|
|
14
|
+
if (tokens.length === 1 && (0, parser_1.isIdentWithValue)(tokens[0], 'none')) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
return (0, parser_1.parseFunctionArgs)(tokens).map((values) => {
|
|
18
|
+
const shadow = {
|
|
19
|
+
color: color_1.COLORS.TRANSPARENT,
|
|
20
|
+
offsetX: length_percentage_1.ZERO_LENGTH,
|
|
21
|
+
offsetY: length_percentage_1.ZERO_LENGTH,
|
|
22
|
+
blur: length_percentage_1.ZERO_LENGTH
|
|
23
|
+
};
|
|
24
|
+
let c = 0;
|
|
25
|
+
for (let i = 0; i < values.length; i++) {
|
|
26
|
+
const token = values[i];
|
|
27
|
+
if ((0, length_1.isLength)(token)) {
|
|
28
|
+
if (c === 0) {
|
|
29
|
+
shadow.offsetX = token;
|
|
30
|
+
}
|
|
31
|
+
else if (c === 1) {
|
|
32
|
+
shadow.offsetY = token;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
shadow.blur = token;
|
|
36
|
+
}
|
|
37
|
+
c++;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
shadow.color = color_1.color.parse(context, token);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return shadow;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textTransform = void 0;
|
|
4
|
+
exports.textTransform = {
|
|
5
|
+
name: 'text-transform',
|
|
6
|
+
initialValue: 'none',
|
|
7
|
+
prefix: false,
|
|
8
|
+
type: 2 /* PropertyDescriptorParsingType.IDENT_VALUE */,
|
|
9
|
+
parse: (_context, textTransform) => {
|
|
10
|
+
switch (textTransform) {
|
|
11
|
+
case 'uppercase':
|
|
12
|
+
return 2 /* TEXT_TRANSFORM.UPPERCASE */;
|
|
13
|
+
case 'lowercase':
|
|
14
|
+
return 1 /* TEXT_TRANSFORM.LOWERCASE */;
|
|
15
|
+
case 'capitalize':
|
|
16
|
+
return 3 /* TEXT_TRANSFORM.CAPITALIZE */;
|
|
17
|
+
}
|
|
18
|
+
return 0 /* TEXT_TRANSFORM.NONE */;
|
|
19
|
+
}
|
|
20
|
+
};
|