@max-ts/svelte 1.8.5 → 1.9.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/dist/_virtual/_rolldown/runtime.js +25 -10
- package/dist/components/Accordion/Accordion.js +1 -3
- package/dist/components/Accordion/Content/Content.js +4 -6
- package/dist/components/Accordion/Content/styles.css.js +27 -8
- package/dist/components/Accordion/Item/Item.js +1 -3
- package/dist/components/Accordion/Trigger/Trigger.js +5 -7
- package/dist/components/Accordion/Trigger/styles.css.js +47 -9
- package/dist/components/Accordion/index.js +1 -3
- package/dist/components/Alert/Alert.js +1 -3
- package/dist/components/Alert/Description/Description.js +3 -5
- package/dist/components/Alert/Description/styles.css.js +16 -6
- package/dist/components/Alert/Title/Title.js +3 -5
- package/dist/components/Alert/Title/styles.css.js +15 -6
- package/dist/components/Alert/index.js +2 -4
- package/dist/components/Alert/styles.css.js +55 -12
- package/dist/components/Badge/Badge.js +4 -6
- package/dist/components/Badge/styles.css.js +55 -13
- package/dist/components/Button/Button.js +7 -9
- package/dist/components/Button/styles.css.js +195 -21
- package/dist/components/ButtonGroup/ButtonGroup.js +4 -6
- package/dist/components/ButtonGroup/Separator/Separator.js +3 -5
- package/dist/components/ButtonGroup/Separator/styles.css.js +13 -6
- package/dist/components/ButtonGroup/Text/Text.js +4 -6
- package/dist/components/ButtonGroup/Text/styles.css.js +26 -6
- package/dist/components/ButtonGroup/index.js +1 -3
- package/dist/components/ButtonGroup/styles.css.js +44 -11
- package/dist/components/Calendar/Calendar.js +6 -8
- package/dist/components/Calendar/Caption/Caption.js +2 -4
- package/dist/components/Calendar/Cell/Cell.js +3 -5
- package/dist/components/Calendar/Cell/styles.css.js +24 -6
- package/dist/components/Calendar/Day/Day.js +3 -5
- package/dist/components/Calendar/Day/styles.css.js +47 -6
- package/dist/components/Calendar/Grid/Grid.js +3 -5
- package/dist/components/Calendar/Grid/styles.css.js +14 -6
- package/dist/components/Calendar/GridBody/GridBody.js +1 -3
- package/dist/components/Calendar/GridHead/GridHead.js +1 -3
- package/dist/components/Calendar/GridRow/GridRow.js +3 -5
- package/dist/components/Calendar/GridRow/styles.css.js +10 -6
- package/dist/components/Calendar/HeadCell/HeadCell.js +3 -5
- package/dist/components/Calendar/HeadCell/styles.css.js +13 -6
- package/dist/components/Calendar/Header/Header.js +3 -5
- package/dist/components/Calendar/Header/styles.css.js +16 -6
- package/dist/components/Calendar/Month/Month.js +1 -3
- package/dist/components/Calendar/MonthSelect/MonthSelect.js +5 -7
- package/dist/components/Calendar/MonthSelect/styles.css.js +43 -9
- package/dist/components/Calendar/Months/Months.js +3 -5
- package/dist/components/Calendar/Months/styles.css.js +13 -6
- package/dist/components/Calendar/Nav/Nav.js +3 -5
- package/dist/components/Calendar/Nav/styles.css.js +17 -6
- package/dist/components/Calendar/NextButton/NextButton.js +3 -5
- package/dist/components/Calendar/NextButton/styles.css.js +16 -5
- package/dist/components/Calendar/PrevButton/PrevButton.js +3 -5
- package/dist/components/Calendar/PrevButton/styles.css.js +16 -5
- package/dist/components/Calendar/YearSelect/YearSelect.js +5 -7
- package/dist/components/Calendar/YearSelect/styles.css.js +43 -9
- package/dist/components/Calendar/styles.css.js +22 -9
- package/dist/components/Card/Action/Action.js +3 -5
- package/dist/components/Card/Action/styles.css.js +12 -5
- package/dist/components/Card/Card.js +3 -5
- package/dist/components/Card/Content/Content.js +3 -5
- package/dist/components/Card/Content/styles.css.js +10 -6
- package/dist/components/Card/Description/Description.js +3 -5
- package/dist/components/Card/Description/styles.css.js +10 -6
- package/dist/components/Card/Footer/Footer.js +3 -5
- package/dist/components/Card/Footer/styles.css.js +14 -6
- package/dist/components/Card/Header/Header.js +3 -5
- package/dist/components/Card/Header/styles.css.js +23 -6
- package/dist/components/Card/Title/Title.js +3 -5
- package/dist/components/Card/Title/styles.css.js +11 -6
- package/dist/components/Card/index.js +1 -3
- package/dist/components/Card/styles.css.js +17 -6
- package/dist/components/Carousel/Arrows/Arrows.js +6 -8
- package/dist/components/Carousel/Arrows/styles.css.js +68 -15
- package/dist/components/Carousel/Carousel.js +3 -5
- package/dist/components/Carousel/Content/Content.js +4 -6
- package/dist/components/Carousel/Content/styles.css.js +37 -11
- package/dist/components/Carousel/Dots/Dots.js +4 -6
- package/dist/components/Carousel/Dots/styles.css.js +64 -15
- package/dist/components/Carousel/Item/Item.js +4 -6
- package/dist/components/Carousel/Item/styles.css.js +22 -10
- package/dist/components/Carousel/context.js +1 -3
- package/dist/components/Carousel/index.js +1 -3
- package/dist/components/Carousel/store.svelte.js +1 -2
- package/dist/components/Carousel/styles.css.js +6 -5
- package/dist/components/Checkbox/Checkbox.js +5 -7
- package/dist/components/Checkbox/styles.css.js +55 -8
- package/dist/components/CircularProgress/CircularProgress.js +7 -9
- package/dist/components/CircularProgress/styles.css.js +55 -18
- package/dist/components/ContentState/ContentState.js +5 -7
- package/dist/components/ContentState/styles.css.js +13 -5
- package/dist/components/DataGrid/Body/Body.js +5 -7
- package/dist/components/DataGrid/Body/styles.css.js +12 -5
- package/dist/components/DataGrid/Cell/Cell.js +4 -6
- package/dist/components/DataGrid/Cell/styles.css.js +17 -8
- package/dist/components/DataGrid/DataGrid.js +9 -12
- package/dist/components/DataGrid/Footer/Footer.js +3 -5
- package/dist/components/DataGrid/Footer/styles.css.js +20 -6
- package/dist/components/DataGrid/Header/Header.js +3 -5
- package/dist/components/DataGrid/Header/styles.css.js +10 -5
- package/dist/components/DataGrid/HeaderCell/HeaderCell.js +4 -6
- package/dist/components/DataGrid/HeaderCell/styles.css.js +16 -6
- package/dist/components/DataGrid/Row/Row.js +3 -5
- package/dist/components/DataGrid/Row/styles.css.js +17 -8
- package/dist/components/DataGrid/State/State.js +7 -9
- package/dist/components/DataGrid/State/styles.css.js +17 -7
- package/dist/components/DataGrid/styles.css.js +40 -12
- package/dist/components/DataGridSortHeader/DataGridSortHeader.js +6 -8
- package/dist/components/DataGridSortHeader/styles.css.js +34 -14
- package/dist/components/Dialog/Close/Close.js +1 -3
- package/dist/components/Dialog/Content/Content.js +1 -3
- package/dist/components/Dialog/Description/Description.js +1 -3
- package/dist/components/Dialog/Dialog.js +1 -3
- package/dist/components/Dialog/Footer/Footer.js +1 -3
- package/dist/components/Dialog/Header/Header.js +1 -3
- package/dist/components/Dialog/Overlay/Overlay.js +1 -3
- package/dist/components/Dialog/Portal/Portal.js +1 -3
- package/dist/components/Dialog/Title/Title.js +1 -3
- package/dist/components/Dialog/Trigger/Trigger.js +1 -3
- package/dist/components/Dialog/index.js +1 -3
- package/dist/components/Dialog/styles.css.js +130 -13
- package/dist/components/Drawer/Close/Close.js +1 -3
- package/dist/components/Drawer/Content/Content.js +7 -9
- package/dist/components/Drawer/Description/Description.js +3 -5
- package/dist/components/Drawer/Drawer.js +1 -3
- package/dist/components/Drawer/Footer/Footer.js +3 -5
- package/dist/components/Drawer/Header/Header.js +3 -5
- package/dist/components/Drawer/Overlay/Overlay.js +3 -5
- package/dist/components/Drawer/Portal/Portal.js +1 -3
- package/dist/components/Drawer/Title/Title.js +3 -5
- package/dist/components/Drawer/Trigger/Trigger.js +1 -3
- package/dist/components/Drawer/context.js +1 -3
- package/dist/components/Drawer/index.js +1 -3
- package/dist/components/Drawer/styles.css.js +128 -16
- package/dist/components/DropdownMenu/CheckboxGroup/CheckboxGroup.js +1 -3
- package/dist/components/DropdownMenu/CheckboxItem/CheckboxItem.js +6 -8
- package/dist/components/DropdownMenu/CheckboxItem/styles.css.js +51 -9
- package/dist/components/DropdownMenu/Content/Content.js +3 -5
- package/dist/components/DropdownMenu/Content/styles.css.js +61 -6
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -3
- package/dist/components/DropdownMenu/Group/Group.js +1 -3
- package/dist/components/DropdownMenu/GroupHeading/GroupHeading.js +3 -5
- package/dist/components/DropdownMenu/GroupHeading/styles.css.js +15 -6
- package/dist/components/DropdownMenu/Item/Item.js +3 -5
- package/dist/components/DropdownMenu/Item/styles.css.js +38 -6
- package/dist/components/DropdownMenu/Label/Label.js +1 -3
- package/dist/components/DropdownMenu/Label/styles.css.js +16 -6
- package/dist/components/DropdownMenu/Portal/Portal.js +1 -3
- package/dist/components/DropdownMenu/RadioGroup/RadioGroup.js +1 -3
- package/dist/components/DropdownMenu/RadioItem/RadioItem.js +5 -7
- package/dist/components/DropdownMenu/RadioItem/styles.css.js +48 -9
- package/dist/components/DropdownMenu/Separator/Separator.js +3 -5
- package/dist/components/DropdownMenu/Separator/styles.css.js +15 -6
- package/dist/components/DropdownMenu/Shortcut/Shortcut.js +3 -5
- package/dist/components/DropdownMenu/Shortcut/styles.css.js +12 -6
- package/dist/components/DropdownMenu/Sub/Sub.js +1 -3
- package/dist/components/DropdownMenu/SubContent/SubContent.js +3 -5
- package/dist/components/DropdownMenu/SubContent/styles.css.js +69 -6
- package/dist/components/DropdownMenu/SubTrigger/SubTrigger.js +4 -6
- package/dist/components/DropdownMenu/SubTrigger/styles.css.js +44 -8
- package/dist/components/DropdownMenu/Trigger/Trigger.js +1 -3
- package/dist/components/DropdownMenu/index.js +1 -3
- package/dist/components/Empty/Content/Content.js +3 -5
- package/dist/components/Empty/Description/Description.js +3 -5
- package/dist/components/Empty/Empty.js +3 -5
- package/dist/components/Empty/Header/Header.js +3 -5
- package/dist/components/Empty/Media/Media.js +4 -6
- package/dist/components/Empty/Title/Title.js +3 -5
- package/dist/components/Empty/index.js +1 -3
- package/dist/components/Empty/styles.css.js +91 -16
- package/dist/components/Field/Content/Content.js +3 -5
- package/dist/components/Field/Content/styles.css.js +13 -6
- package/dist/components/Field/Description/Description.js +3 -5
- package/dist/components/Field/Description/styles.css.js +24 -6
- package/dist/components/Field/Field.js +1 -3
- package/dist/components/Field/FieldError/FieldError.js +3 -5
- package/dist/components/Field/FieldError/styles.css.js +20 -6
- package/dist/components/Field/FieldSet/FieldSet.js +3 -5
- package/dist/components/Field/FieldSet/styles.css.js +14 -6
- package/dist/components/Field/Group/Group.js +3 -5
- package/dist/components/Field/Group/styles.css.js +17 -6
- package/dist/components/Field/Label/Label.js +3 -5
- package/dist/components/Field/Label/styles.css.js +33 -6
- package/dist/components/Field/Legend/Legend.js +3 -5
- package/dist/components/Field/Legend/styles.css.js +14 -6
- package/dist/components/Field/Separator/Separator.js +5 -7
- package/dist/components/Field/Separator/styles.css.js +28 -9
- package/dist/components/Field/Title/Title.js +3 -5
- package/dist/components/Field/Title/styles.css.js +16 -6
- package/dist/components/Field/index.js +1 -3
- package/dist/components/Field/styles.css.js +49 -10
- package/dist/components/Input/Input.js +7 -9
- package/dist/components/Input/styles.css.js +105 -12
- package/dist/components/InputGroup/Addon/Addon.js +4 -6
- package/dist/components/InputGroup/Addon/styles.css.js +59 -13
- package/dist/components/InputGroup/Button/Button.js +4 -6
- package/dist/components/InputGroup/Button/styles.css.js +45 -13
- package/dist/components/InputGroup/Input/Input.js +3 -5
- package/dist/components/InputGroup/Input/styles.css.js +33 -6
- package/dist/components/InputGroup/InputGroup.js +3 -5
- package/dist/components/InputGroup/Text/Text.js +3 -5
- package/dist/components/InputGroup/Text/styles.css.js +19 -6
- package/dist/components/InputGroup/Textarea/Textarea.js +3 -5
- package/dist/components/InputGroup/Textarea/styles.css.js +34 -6
- package/dist/components/InputGroup/index.js +1 -3
- package/dist/components/InputGroup/styles.css.js +62 -6
- package/dist/components/Item/Actions/Actions.js +3 -5
- package/dist/components/Item/Content/Content.js +3 -5
- package/dist/components/Item/Description/Description.js +3 -5
- package/dist/components/Item/Footer/Footer.js +3 -5
- package/dist/components/Item/Group/Group.js +3 -5
- package/dist/components/Item/Header/Header.js +3 -5
- package/dist/components/Item/Item.js +6 -8
- package/dist/components/Item/Media/Media.js +4 -6
- package/dist/components/Item/Separator/Separator.js +1 -3
- package/dist/components/Item/Title/Title.js +3 -5
- package/dist/components/Item/index.js +1 -3
- package/dist/components/Item/styles.css.js +134 -29
- package/dist/components/Label/Label.js +3 -5
- package/dist/components/Label/styles.css.js +30 -6
- package/dist/components/Placeholder/Image/Image.js +4 -6
- package/dist/components/Placeholder/Image/styles.css.js +19 -12
- package/dist/components/Placeholder/Placeholder.js +7 -9
- package/dist/components/Placeholder/constants.js +1 -2
- package/dist/components/Placeholder/styles.css.js +41 -15
- package/dist/components/Popover/Close/PopoverClose.js +3 -5
- package/dist/components/Popover/Content/PopoverContent.js +3 -5
- package/dist/components/Popover/Popover.js +1 -3
- package/dist/components/Popover/Portal/PopoverPortal.js +1 -3
- package/dist/components/Popover/Trigger/PopoverTrigger.js +3 -5
- package/dist/components/Popover/index.js +1 -3
- package/dist/components/Popover/styles.css.js +45 -9
- package/dist/components/RangeInput/RangeInput.js +66 -80
- package/dist/components/RangeInput/styles.css.js +62 -18
- package/dist/components/RangeInput/utils.js +1 -2
- package/dist/components/ScalableContainer/ScalableContainer.js +6 -8
- package/dist/components/ScalableContainer/store.svelte.d.ts +0 -3
- package/dist/components/ScalableContainer/store.svelte.js +7 -18
- package/dist/components/ScalableContainer/styles.css.js +53 -10
- package/dist/components/Select/Content/Content.js +4 -6
- package/dist/components/Select/Content/styles.css.js +60 -8
- package/dist/components/Select/Group/Group.js +1 -3
- package/dist/components/Select/GroupHeading/GroupHeading.js +3 -5
- package/dist/components/Select/GroupHeading/styles.css.js +14 -6
- package/dist/components/Select/Item/Item.js +5 -7
- package/dist/components/Select/Item/styles.css.js +55 -8
- package/dist/components/Select/Label/Label.js +3 -5
- package/dist/components/Select/Label/styles.css.js +14 -6
- package/dist/components/Select/Portal/Portal.js +1 -3
- package/dist/components/Select/ScrollDownButton/ScrollDownButton.js +3 -5
- package/dist/components/Select/ScrollDownButton/styles.css.js +14 -6
- package/dist/components/Select/ScrollUpButton/ScrollUpButton.js +4 -6
- package/dist/components/Select/ScrollUpButton/styles.css.js +19 -8
- package/dist/components/Select/Select.js +1 -3
- package/dist/components/Select/Separator/Separator.js +3 -5
- package/dist/components/Select/Separator/styles.css.js +16 -6
- package/dist/components/Select/Trigger/Trigger.js +4 -6
- package/dist/components/Select/Trigger/styles.css.js +67 -8
- package/dist/components/Select/index.js +1 -3
- package/dist/components/Separator/Separator.js +3 -5
- package/dist/components/Separator/styles.css.js +20 -6
- package/dist/components/Slider/Slider.js +8 -10
- package/dist/components/Slider/styles.css.js +86 -19
- package/dist/components/SliderInput/SliderInput.js +131 -0
- package/dist/components/SliderInput/SliderInput.svelte.d.ts +4 -0
- package/dist/components/SliderInput/index.d.ts +2 -0
- package/dist/components/SliderInput/styles.css.d.ts +12 -0
- package/dist/components/SliderInput/styles.css.js +67 -0
- package/dist/components/SliderInput/types.d.ts +16 -0
- package/dist/components/SliderInput/utils.d.ts +2 -0
- package/dist/components/SliderInput/utils.js +9 -0
- package/dist/components/Spinner/Spinner.js +4 -6
- package/dist/components/Spinner/styles.css.js +28 -13
- package/dist/components/Tabs/Content/Content.js +3 -5
- package/dist/components/Tabs/List/List.js +3 -5
- package/dist/components/Tabs/Tabs.js +3 -5
- package/dist/components/Tabs/Trigger/Trigger.js +3 -5
- package/dist/components/Tabs/index.js +1 -3
- package/dist/components/Tabs/styles.css.js +75 -10
- package/dist/components/Tooltip/Content/Content.js +4 -6
- package/dist/components/Tooltip/Content/styles.css.js +113 -8
- package/dist/components/Tooltip/Portal/Portal.js +1 -3
- package/dist/components/Tooltip/Provider/Provider.js +1 -3
- package/dist/components/Tooltip/Tooltip.js +2 -4
- package/dist/components/Tooltip/Trigger/Trigger.js +1 -3
- package/dist/components/Typography/Typography.js +1 -3
- package/dist/components/Typography/styles.css.js +115 -56
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -2
- package/dist/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js +23 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/css/adapter/dist/vanilla-extract-css-adapter.browser.esm.js +48 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/css/dist/taggedTemplateLiteral-8e47dbd7.browser.esm.js +7 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/css/dist/transformCss-20240126.browser.esm.js +765 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.browser.esm.js +290 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/css/fileScope/dist/vanilla-extract-css-fileScope.browser.esm.js +30 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_css@1.18.0/node_modules/@vanilla-extract/css/injectStyles/dist/vanilla-extract-css-injectStyles.browser.esm.js +18 -0
- package/dist/node_modules/.pnpm/@vanilla-extract_private@1.0.9/node_modules/@vanilla-extract/private/dist/vanilla-extract-private.esm.js +28 -0
- package/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/es/parse.js +312 -0
- package/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/es/types.js +28 -0
- package/dist/node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js +64 -0
- package/dist/node_modules/.pnpm/dedent@1.7.1/node_modules/dedent/dist/dedent.js +102 -0
- package/dist/node_modules/.pnpm/deep-object-diff@1.1.9/node_modules/deep-object-diff/mjs/diff.js +26 -0
- package/dist/node_modules/.pnpm/deep-object-diff@1.1.9/node_modules/deep-object-diff/mjs/utils.js +9 -0
- package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +84 -0
- package/dist/node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.js +1154 -0
- package/dist/node_modules/.pnpm/media-query-parser@2.0.2/node_modules/media-query-parser/dist/media-query-parser.esm.js +939 -0
- package/dist/node_modules/.pnpm/modern-ahocorasick@1.1.0/node_modules/modern-ahocorasick/dist/index.js +80 -0
- package/dist/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.browser.js +56 -0
- package/dist/stories/SliderInput.stories.svelte.d.ts +19 -0
- package/dist/theme.js +155 -68
- package/dist/utils.js +1 -3
- package/package.json +16 -16
- package/dist/assets/src/components/Accordion/Content/styles.css.ts.vanilla-CRgv-0Oa.css +0 -30
- package/dist/assets/src/components/Accordion/Trigger/styles.css.ts.vanilla-Cy15wtKZ.css +0 -39
- package/dist/assets/src/components/Alert/Description/styles.css.ts.vanilla-aIFKt78Y.css +0 -11
- package/dist/assets/src/components/Alert/Title/styles.css.ts.vanilla-BaybB7G2.css +0 -9
- package/dist/assets/src/components/Alert/styles.css.ts.vanilla-iD1pgdZ8.css +0 -46
- package/dist/assets/src/components/Badge/styles.css.ts.vanilla-Bjel8_Kw.css +0 -55
- package/dist/assets/src/components/Button/styles.css.ts.vanilla-Ct9mSifU.css +0 -208
- package/dist/assets/src/components/ButtonGroup/Separator/styles.css.ts.vanilla-EvTZBBDg.css +0 -9
- package/dist/assets/src/components/ButtonGroup/Text/styles.css.ts.vanilla-IWUf3WT6.css +0 -20
- package/dist/assets/src/components/ButtonGroup/styles.css.ts.vanilla-C1HKTlBo.css +0 -48
- package/dist/assets/src/components/Calendar/Cell/styles.css.ts.vanilla-Cbks2GU9.css +0 -19
- package/dist/assets/src/components/Calendar/Day/styles.css.ts.vanilla-CfL5V7LV.css +0 -46
- package/dist/assets/src/components/Calendar/Grid/styles.css.ts.vanilla-CoC90GwV.css +0 -8
- package/dist/assets/src/components/Calendar/GridRow/styles.css.ts.vanilla-U6mvCZYf.css +0 -4
- package/dist/assets/src/components/Calendar/HeadCell/styles.css.ts.vanilla-uZVFT3sf.css +0 -7
- package/dist/assets/src/components/Calendar/Header/styles.css.ts.vanilla-HzvDukx2.css +0 -10
- package/dist/assets/src/components/Calendar/MonthSelect/styles.css.ts.vanilla-CAhi6mgx.css +0 -35
- package/dist/assets/src/components/Calendar/Months/styles.css.ts.vanilla-D8F5R8Jq.css +0 -11
- package/dist/assets/src/components/Calendar/Nav/styles.css.ts.vanilla-hgUZ58vD.css +0 -11
- package/dist/assets/src/components/Calendar/NextButton/styles.css.ts.vanilla-Cuf73VQC.css +0 -13
- package/dist/assets/src/components/Calendar/PrevButton/styles.css.ts.vanilla-CesYCmjG.css +0 -13
- package/dist/assets/src/components/Calendar/YearSelect/styles.css.ts.vanilla-BMmaovdo.css +0 -35
- package/dist/assets/src/components/Calendar/styles.css.ts.vanilla-CkQD0ryE.css +0 -19
- package/dist/assets/src/components/Card/Action/styles.css.ts.vanilla-BzUjqk_g.css +0 -7
- package/dist/assets/src/components/Card/Content/styles.css.ts.vanilla-BDTd_O_q.css +0 -4
- package/dist/assets/src/components/Card/Description/styles.css.ts.vanilla-DkrZCqiD.css +0 -4
- package/dist/assets/src/components/Card/Footer/styles.css.ts.vanilla-BsuS8s-a.css +0 -9
- package/dist/assets/src/components/Card/Header/styles.css.ts.vanilla-Ck0IW2si.css +0 -18
- package/dist/assets/src/components/Card/Title/styles.css.ts.vanilla-CrIgH8US.css +0 -5
- package/dist/assets/src/components/Card/styles.css.ts.vanilla-C1gWeVmb.css +0 -11
- package/dist/assets/src/components/Carousel/Arrows/styles.css.ts.vanilla-CFc3t0Nn.css +0 -58
- package/dist/assets/src/components/Carousel/Content/styles.css.ts.vanilla-C9hep06R.css +0 -30
- package/dist/assets/src/components/Carousel/Dots/styles.css.ts.vanilla-GOQJy88x.css +0 -56
- package/dist/assets/src/components/Carousel/Item/styles.css.ts.vanilla-DH1QYb6c.css +0 -14
- package/dist/assets/src/components/Carousel/styles.css.ts.vanilla-Dy8E8h1L.css +0 -3
- package/dist/assets/src/components/Checkbox/styles.css.ts.vanilla-BKlsXQk6.css +0 -62
- package/dist/assets/src/components/CircularProgress/styles.css.ts.vanilla-HSziDJBb.css +0 -58
- package/dist/assets/src/components/ContentState/styles.css.ts.vanilla-DxRTguX7.css +0 -8
- package/dist/assets/src/components/DataGrid/Body/styles.css.ts.vanilla-DW-VMEZn.css +0 -7
- package/dist/assets/src/components/DataGrid/Cell/styles.css.ts.vanilla-BxWJsext.css +0 -11
- package/dist/assets/src/components/DataGrid/Footer/styles.css.ts.vanilla-B6yhzE26.css +0 -16
- package/dist/assets/src/components/DataGrid/Header/styles.css.ts.vanilla-B6cv8XDg.css +0 -5
- package/dist/assets/src/components/DataGrid/HeaderCell/styles.css.ts.vanilla-dV_weZXd.css +0 -9
- package/dist/assets/src/components/DataGrid/Row/styles.css.ts.vanilla-CKwydkes.css +0 -13
- package/dist/assets/src/components/DataGrid/State/styles.css.ts.vanilla-Cfm5Y8YC.css +0 -11
- package/dist/assets/src/components/DataGrid/styles.css.ts.vanilla-e28yFL_V.css +0 -35
- package/dist/assets/src/components/DataGridSortHeader/styles.css.ts.vanilla-DDAuz1H0.css +0 -32
- package/dist/assets/src/components/Dialog/styles.css.ts.vanilla-Bkz7TIeD.css +0 -142
- package/dist/assets/src/components/Drawer/styles.css.ts.vanilla-cJ-WZT2j.css +0 -130
- package/dist/assets/src/components/DropdownMenu/CheckboxItem/styles.css.ts.vanilla-Dl0yxRWI.css +0 -42
- package/dist/assets/src/components/DropdownMenu/Content/styles.css.ts.vanilla-r7oF9Kc9.css +0 -97
- package/dist/assets/src/components/DropdownMenu/GroupHeading/styles.css.ts.vanilla-iAFIxJU_.css +0 -11
- package/dist/assets/src/components/DropdownMenu/Item/styles.css.ts.vanilla-CmdyolmW.css +0 -31
- package/dist/assets/src/components/DropdownMenu/Label/styles.css.ts.vanilla-B2rB2ShR.css +0 -12
- package/dist/assets/src/components/DropdownMenu/RadioItem/styles.css.ts.vanilla-B0rQ4UF6.css +0 -39
- package/dist/assets/src/components/DropdownMenu/Separator/styles.css.ts.vanilla-DYvNTpF0.css +0 -8
- package/dist/assets/src/components/DropdownMenu/Shortcut/styles.css.ts.vanilla-D3fXpLgb.css +0 -6
- package/dist/assets/src/components/DropdownMenu/SubContent/styles.css.ts.vanilla-WDOSQgkQ.css +0 -97
- package/dist/assets/src/components/DropdownMenu/SubTrigger/styles.css.ts.vanilla-DXkXt8DK.css +0 -36
- package/dist/assets/src/components/Empty/styles.css.ts.vanilla-YAGWQaIZ.css +0 -84
- package/dist/assets/src/components/Field/Content/styles.css.ts.vanilla-Cl5QFTz5.css +0 -7
- package/dist/assets/src/components/Field/Description/styles.css.ts.vanilla-BMtEi35G.css +0 -25
- package/dist/assets/src/components/Field/FieldError/styles.css.ts.vanilla-DJjGKV20.css +0 -15
- package/dist/assets/src/components/Field/FieldSet/styles.css.ts.vanilla-Bp8cZwZK.css +0 -10
- package/dist/assets/src/components/Field/Group/styles.css.ts.vanilla-DmOIH8vN.css +0 -14
- package/dist/assets/src/components/Field/Label/styles.css.ts.vanilla-Dg5c3RRL.css +0 -30
- package/dist/assets/src/components/Field/Legend/styles.css.ts.vanilla-Z0EOdgnf.css +0 -10
- package/dist/assets/src/components/Field/Separator/styles.css.ts.vanilla-DdVu6Yid.css +0 -23
- package/dist/assets/src/components/Field/Title/styles.css.ts.vanilla-ClIiAxyc.css +0 -12
- package/dist/assets/src/components/Field/styles.css.ts.vanilla-pJeVGP3o.css +0 -60
- package/dist/assets/src/components/Input/styles.css.ts.vanilla-OTgWCLQT.css +0 -97
- package/dist/assets/src/components/InputGroup/Addon/styles.css.ts.vanilla-BZlnHdwv.css +0 -55
- package/dist/assets/src/components/InputGroup/Button/styles.css.ts.vanilla-CyEiw7bW.css +0 -37
- package/dist/assets/src/components/InputGroup/Input/styles.css.ts.vanilla-Dkc417RX.css +0 -27
- package/dist/assets/src/components/InputGroup/Text/styles.css.ts.vanilla-Bu6aVU98.css +0 -14
- package/dist/assets/src/components/InputGroup/Textarea/styles.css.ts.vanilla-DIqtGbwz.css +0 -28
- package/dist/assets/src/components/InputGroup/styles.css.ts.vanilla-DNARUupj.css +0 -63
- package/dist/assets/src/components/Item/styles.css.ts.vanilla-CvQd4vT5.css +0 -125
- package/dist/assets/src/components/Label/styles.css.ts.vanilla-QYh88Z8m.css +0 -21
- package/dist/assets/src/components/Placeholder/Image/styles.css.ts.vanilla-BTheqLgl.css +0 -20
- package/dist/assets/src/components/Placeholder/styles.css.ts.vanilla-D0kFn6PA.css +0 -42
- package/dist/assets/src/components/Popover/styles.css.ts.vanilla-Bx7MQlFx.css +0 -44
- package/dist/assets/src/components/RangeInput/styles.css.ts.vanilla-CoGxbKI0.css +0 -66
- package/dist/assets/src/components/ScalableContainer/styles.css.ts.vanilla-DW9CH1mT.css +0 -51
- package/dist/assets/src/components/Select/Content/styles.css.ts.vanilla-D599WG_l.css +0 -63
- package/dist/assets/src/components/Select/GroupHeading/styles.css.ts.vanilla-DUgk9xF8.css +0 -8
- package/dist/assets/src/components/Select/Item/styles.css.ts.vanilla-DNSfggBD.css +0 -45
- package/dist/assets/src/components/Select/Label/styles.css.ts.vanilla-BdQq5WOs.css +0 -8
- package/dist/assets/src/components/Select/ScrollDownButton/styles.css.ts.vanilla-7S9gQjlF.css +0 -8
- package/dist/assets/src/components/Select/ScrollUpButton/styles.css.ts.vanilla-DLYWl4UM.css +0 -12
- package/dist/assets/src/components/Select/Separator/styles.css.ts.vanilla-DikOvXhH.css +0 -9
- package/dist/assets/src/components/Select/Trigger/styles.css.ts.vanilla-BCDIWDu9.css +0 -63
- package/dist/assets/src/components/Separator/styles.css.ts.vanilla-KsA3TZd5.css +0 -12
- package/dist/assets/src/components/Slider/styles.css.ts.vanilla-BwosySl4.css +0 -85
- package/dist/assets/src/components/Spinner/styles.css.ts.vanilla-DRCCYbMQ.css +0 -24
- package/dist/assets/src/components/Tabs/styles.css.ts.vanilla-CZnsdQXL.css +0 -62
- package/dist/assets/src/components/Tooltip/Content/styles.css.ts.vanilla-TIsrH3sQ.css +0 -135
- package/dist/assets/src/components/Typography/styles.css.ts.vanilla-RejbDOhi.css +0 -145
- package/dist/assets/src/theme.css.ts.vanilla-DlH7Hr_5.css +0 -64
- package/dist/components/DataGrid/constants.js +0 -5
|
@@ -0,0 +1,939 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/media-query-parser@2.0.2/node_modules/media-query-parser/dist/media-query-parser.esm.js
|
|
2
|
+
/*! @license MediaQueryParser - MIT License - Tom Golden (github@tbjgolden.com) */
|
|
3
|
+
/*! *****************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
var __assign = function() {
|
|
18
|
+
__assign = Object.assign || function __assign(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
function __rest(s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
30
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") {
|
|
31
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
32
|
+
}
|
|
33
|
+
return t;
|
|
34
|
+
}
|
|
35
|
+
function __values(o) {
|
|
36
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
37
|
+
if (m) return m.call(o);
|
|
38
|
+
if (o && typeof o.length === "number") return { next: function() {
|
|
39
|
+
if (o && i >= o.length) o = void 0;
|
|
40
|
+
return {
|
|
41
|
+
value: o && o[i++],
|
|
42
|
+
done: !o
|
|
43
|
+
};
|
|
44
|
+
} };
|
|
45
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
46
|
+
}
|
|
47
|
+
function __read(o, n) {
|
|
48
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
49
|
+
if (!m) return o;
|
|
50
|
+
var i = m.call(o), r, ar = [], e;
|
|
51
|
+
try {
|
|
52
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
e = { error };
|
|
55
|
+
} finally {
|
|
56
|
+
try {
|
|
57
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
58
|
+
} finally {
|
|
59
|
+
if (e) throw e.error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return ar;
|
|
63
|
+
}
|
|
64
|
+
var weirdNewlines = /(\u000D|\u000C|\u000D\u000A)/g;
|
|
65
|
+
var nullOrSurrogates = /[\u0000\uD800-\uDFFF]/g;
|
|
66
|
+
var commentRegex = /(\/\*)[\s\S]*?(\*\/)/g;
|
|
67
|
+
var lexicalAnalysis = function lexicalAnalysis(str, index) {
|
|
68
|
+
if (index === void 0) index = 0;
|
|
69
|
+
str = str.replace(weirdNewlines, "\n").replace(nullOrSurrogates, "�");
|
|
70
|
+
str = str.replace(commentRegex, "");
|
|
71
|
+
var tokens = [];
|
|
72
|
+
for (; index < str.length; index += 1) {
|
|
73
|
+
var code = str.charCodeAt(index);
|
|
74
|
+
if (code === 9 || code === 32 || code === 10) {
|
|
75
|
+
var code_1 = str.charCodeAt(++index);
|
|
76
|
+
while (code_1 === 9 || code_1 === 32 || code_1 === 10) code_1 = str.charCodeAt(++index);
|
|
77
|
+
index -= 1;
|
|
78
|
+
tokens.push({ type: "<whitespace-token>" });
|
|
79
|
+
} else if (code === 34) {
|
|
80
|
+
var result = consumeString(str, index);
|
|
81
|
+
if (result === null) return null;
|
|
82
|
+
var _a = __read(result, 2), lastIndex = _a[0], value = _a[1];
|
|
83
|
+
tokens.push({
|
|
84
|
+
type: "<string-token>",
|
|
85
|
+
value
|
|
86
|
+
});
|
|
87
|
+
index = lastIndex;
|
|
88
|
+
} else if (code === 35) {
|
|
89
|
+
if (index + 1 < str.length) {
|
|
90
|
+
var nextCode = str.charCodeAt(index + 1);
|
|
91
|
+
if (nextCode === 95 || nextCode >= 65 && nextCode <= 90 || nextCode >= 97 && nextCode <= 122 || nextCode >= 128 || nextCode >= 48 && nextCode <= 57 || nextCode === 92 && index + 2 < str.length && str.charCodeAt(index + 2) !== 10) {
|
|
92
|
+
var flag = wouldStartIdentifier(str, index + 1) ? "id" : "unrestricted";
|
|
93
|
+
var result = consumeIdentUnsafe(str, index + 1);
|
|
94
|
+
if (result !== null) {
|
|
95
|
+
var _b = __read(result, 2), lastIndex = _b[0], value = _b[1];
|
|
96
|
+
tokens.push({
|
|
97
|
+
type: "<hash-token>",
|
|
98
|
+
value: value.toLowerCase(),
|
|
99
|
+
flag
|
|
100
|
+
});
|
|
101
|
+
index = lastIndex;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
tokens.push({
|
|
107
|
+
type: "<delim-token>",
|
|
108
|
+
value: code
|
|
109
|
+
});
|
|
110
|
+
} else if (code === 39) {
|
|
111
|
+
var result = consumeString(str, index);
|
|
112
|
+
if (result === null) return null;
|
|
113
|
+
var _c = __read(result, 2), lastIndex = _c[0], value = _c[1];
|
|
114
|
+
tokens.push({
|
|
115
|
+
type: "<string-token>",
|
|
116
|
+
value
|
|
117
|
+
});
|
|
118
|
+
index = lastIndex;
|
|
119
|
+
} else if (code === 40) tokens.push({ type: "<(-token>" });
|
|
120
|
+
else if (code === 41) tokens.push({ type: "<)-token>" });
|
|
121
|
+
else if (code === 43) {
|
|
122
|
+
var plusNumeric = consumeNumeric(str, index);
|
|
123
|
+
if (plusNumeric === null) tokens.push({
|
|
124
|
+
type: "<delim-token>",
|
|
125
|
+
value: code
|
|
126
|
+
});
|
|
127
|
+
else {
|
|
128
|
+
var _d = __read(plusNumeric, 2), lastIndex = _d[0], tokenTuple = _d[1];
|
|
129
|
+
if (tokenTuple[0] === "<dimension-token>") tokens.push({
|
|
130
|
+
type: "<dimension-token>",
|
|
131
|
+
value: tokenTuple[1],
|
|
132
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
133
|
+
flag: "number"
|
|
134
|
+
});
|
|
135
|
+
else if (tokenTuple[0] === "<number-token>") tokens.push({
|
|
136
|
+
type: tokenTuple[0],
|
|
137
|
+
value: tokenTuple[1],
|
|
138
|
+
flag: tokenTuple[2]
|
|
139
|
+
});
|
|
140
|
+
else tokens.push({
|
|
141
|
+
type: tokenTuple[0],
|
|
142
|
+
value: tokenTuple[1],
|
|
143
|
+
flag: "number"
|
|
144
|
+
});
|
|
145
|
+
index = lastIndex;
|
|
146
|
+
}
|
|
147
|
+
} else if (code === 44) tokens.push({ type: "<comma-token>" });
|
|
148
|
+
else if (code === 45) {
|
|
149
|
+
var minusNumeric = consumeNumeric(str, index);
|
|
150
|
+
if (minusNumeric !== null) {
|
|
151
|
+
var _e = __read(minusNumeric, 2), lastIndex = _e[0], tokenTuple = _e[1];
|
|
152
|
+
if (tokenTuple[0] === "<dimension-token>") tokens.push({
|
|
153
|
+
type: "<dimension-token>",
|
|
154
|
+
value: tokenTuple[1],
|
|
155
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
156
|
+
flag: "number"
|
|
157
|
+
});
|
|
158
|
+
else if (tokenTuple[0] === "<number-token>") tokens.push({
|
|
159
|
+
type: tokenTuple[0],
|
|
160
|
+
value: tokenTuple[1],
|
|
161
|
+
flag: tokenTuple[2]
|
|
162
|
+
});
|
|
163
|
+
else tokens.push({
|
|
164
|
+
type: tokenTuple[0],
|
|
165
|
+
value: tokenTuple[1],
|
|
166
|
+
flag: "number"
|
|
167
|
+
});
|
|
168
|
+
index = lastIndex;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (index + 2 < str.length) {
|
|
172
|
+
var nextCode = str.charCodeAt(index + 1);
|
|
173
|
+
var nextNextCode = str.charCodeAt(index + 2);
|
|
174
|
+
if (nextCode === 45 && nextNextCode === 62) {
|
|
175
|
+
tokens.push({ type: "<CDC-token>" });
|
|
176
|
+
index += 2;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
var result = consumeIdentLike(str, index);
|
|
181
|
+
if (result !== null) {
|
|
182
|
+
var _f = __read(result, 3), lastIndex = _f[0], value = _f[1], type = _f[2];
|
|
183
|
+
tokens.push({
|
|
184
|
+
type,
|
|
185
|
+
value
|
|
186
|
+
});
|
|
187
|
+
index = lastIndex;
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
tokens.push({
|
|
191
|
+
type: "<delim-token>",
|
|
192
|
+
value: code
|
|
193
|
+
});
|
|
194
|
+
} else if (code === 46) {
|
|
195
|
+
var minusNumeric = consumeNumeric(str, index);
|
|
196
|
+
if (minusNumeric === null) tokens.push({
|
|
197
|
+
type: "<delim-token>",
|
|
198
|
+
value: code
|
|
199
|
+
});
|
|
200
|
+
else {
|
|
201
|
+
var _g = __read(minusNumeric, 2), lastIndex = _g[0], tokenTuple = _g[1];
|
|
202
|
+
if (tokenTuple[0] === "<dimension-token>") tokens.push({
|
|
203
|
+
type: "<dimension-token>",
|
|
204
|
+
value: tokenTuple[1],
|
|
205
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
206
|
+
flag: "number"
|
|
207
|
+
});
|
|
208
|
+
else if (tokenTuple[0] === "<number-token>") tokens.push({
|
|
209
|
+
type: tokenTuple[0],
|
|
210
|
+
value: tokenTuple[1],
|
|
211
|
+
flag: tokenTuple[2]
|
|
212
|
+
});
|
|
213
|
+
else tokens.push({
|
|
214
|
+
type: tokenTuple[0],
|
|
215
|
+
value: tokenTuple[1],
|
|
216
|
+
flag: "number"
|
|
217
|
+
});
|
|
218
|
+
index = lastIndex;
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
} else if (code === 58) tokens.push({ type: "<colon-token>" });
|
|
222
|
+
else if (code === 59) tokens.push({ type: "<semicolon-token>" });
|
|
223
|
+
else if (code === 60) {
|
|
224
|
+
if (index + 3 < str.length) {
|
|
225
|
+
var nextCode = str.charCodeAt(index + 1);
|
|
226
|
+
var nextNextCode = str.charCodeAt(index + 2);
|
|
227
|
+
var nextNextNextCode = str.charCodeAt(index + 3);
|
|
228
|
+
if (nextCode === 33 && nextNextCode === 45 && nextNextNextCode === 45) {
|
|
229
|
+
tokens.push({ type: "<CDO-token>" });
|
|
230
|
+
index += 3;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
tokens.push({
|
|
235
|
+
type: "<delim-token>",
|
|
236
|
+
value: code
|
|
237
|
+
});
|
|
238
|
+
} else if (code === 64) {
|
|
239
|
+
var result = consumeIdent(str, index + 1);
|
|
240
|
+
if (result !== null) {
|
|
241
|
+
var _h = __read(result, 2), lastIndex = _h[0], value = _h[1];
|
|
242
|
+
tokens.push({
|
|
243
|
+
type: "<at-keyword-token>",
|
|
244
|
+
value: value.toLowerCase()
|
|
245
|
+
});
|
|
246
|
+
index = lastIndex;
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
tokens.push({
|
|
250
|
+
type: "<delim-token>",
|
|
251
|
+
value: code
|
|
252
|
+
});
|
|
253
|
+
} else if (code === 91) tokens.push({ type: "<[-token>" });
|
|
254
|
+
else if (code === 92) {
|
|
255
|
+
var result = consumeEscape(str, index);
|
|
256
|
+
if (result === null) return null;
|
|
257
|
+
var _j = __read(result, 2), lastIndex = _j[0], value = _j[1];
|
|
258
|
+
str = str.slice(0, index) + value + str.slice(lastIndex + 1);
|
|
259
|
+
index -= 1;
|
|
260
|
+
} else if (code === 93) tokens.push({ type: "<]-token>" });
|
|
261
|
+
else if (code === 123) tokens.push({ type: "<{-token>" });
|
|
262
|
+
else if (code === 125) tokens.push({ type: "<}-token>" });
|
|
263
|
+
else if (code >= 48 && code <= 57) {
|
|
264
|
+
var result = consumeNumeric(str, index);
|
|
265
|
+
var _k = __read(result, 2), lastIndex = _k[0], tokenTuple = _k[1];
|
|
266
|
+
if (tokenTuple[0] === "<dimension-token>") tokens.push({
|
|
267
|
+
type: "<dimension-token>",
|
|
268
|
+
value: tokenTuple[1],
|
|
269
|
+
unit: tokenTuple[2].toLowerCase(),
|
|
270
|
+
flag: "number"
|
|
271
|
+
});
|
|
272
|
+
else if (tokenTuple[0] === "<number-token>") tokens.push({
|
|
273
|
+
type: tokenTuple[0],
|
|
274
|
+
value: tokenTuple[1],
|
|
275
|
+
flag: tokenTuple[2]
|
|
276
|
+
});
|
|
277
|
+
else tokens.push({
|
|
278
|
+
type: tokenTuple[0],
|
|
279
|
+
value: tokenTuple[1],
|
|
280
|
+
flag: "number"
|
|
281
|
+
});
|
|
282
|
+
index = lastIndex;
|
|
283
|
+
} else if (code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128) {
|
|
284
|
+
var result = consumeIdentLike(str, index);
|
|
285
|
+
if (result === null) return null;
|
|
286
|
+
var _l = __read(result, 3), lastIndex = _l[0], value = _l[1], type = _l[2];
|
|
287
|
+
tokens.push({
|
|
288
|
+
type,
|
|
289
|
+
value
|
|
290
|
+
});
|
|
291
|
+
index = lastIndex;
|
|
292
|
+
} else tokens.push({
|
|
293
|
+
type: "<delim-token>",
|
|
294
|
+
value: code
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
tokens.push({ type: "<EOF-token>" });
|
|
298
|
+
return tokens;
|
|
299
|
+
};
|
|
300
|
+
var consumeString = function consumeString(str, index) {
|
|
301
|
+
if (str.length <= index + 1) return null;
|
|
302
|
+
var firstCode = str.charCodeAt(index);
|
|
303
|
+
var charCodes = [];
|
|
304
|
+
for (var i = index + 1; i < str.length; i += 1) {
|
|
305
|
+
var code = str.charCodeAt(i);
|
|
306
|
+
if (code === firstCode) return [i, String.fromCharCode.apply(null, charCodes)];
|
|
307
|
+
else if (code === 92) {
|
|
308
|
+
var result = consumeEscape(str, i);
|
|
309
|
+
if (result === null) return null;
|
|
310
|
+
var _a = __read(result, 2), lastIndex = _a[0], charCode = _a[1];
|
|
311
|
+
charCodes.push(charCode);
|
|
312
|
+
i = lastIndex;
|
|
313
|
+
} else if (code === 10) return null;
|
|
314
|
+
else charCodes.push(code);
|
|
315
|
+
}
|
|
316
|
+
return null;
|
|
317
|
+
};
|
|
318
|
+
var wouldStartIdentifier = function wouldStartIdentifier(str, index) {
|
|
319
|
+
if (str.length <= index) return false;
|
|
320
|
+
var code = str.charCodeAt(index);
|
|
321
|
+
if (code === 45) {
|
|
322
|
+
if (str.length <= index + 1) return false;
|
|
323
|
+
var nextCode = str.charCodeAt(index + 1);
|
|
324
|
+
if (nextCode === 45 || nextCode === 95 || nextCode >= 65 && nextCode <= 90 || nextCode >= 97 && nextCode <= 122 || nextCode >= 128) return true;
|
|
325
|
+
else if (nextCode === 92) {
|
|
326
|
+
if (str.length <= index + 2) return false;
|
|
327
|
+
return str.charCodeAt(index + 2) !== 10;
|
|
328
|
+
} else return false;
|
|
329
|
+
} else if (code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128) return true;
|
|
330
|
+
else if (code === 92) {
|
|
331
|
+
if (str.length <= index + 1) return false;
|
|
332
|
+
var nextCode = str.charCodeAt(index + 1);
|
|
333
|
+
return nextCode !== 10;
|
|
334
|
+
} else return false;
|
|
335
|
+
};
|
|
336
|
+
var consumeEscape = function consumeEscape(str, index) {
|
|
337
|
+
if (str.length <= index + 1) return null;
|
|
338
|
+
if (str.charCodeAt(index) !== 92) return null;
|
|
339
|
+
var code = str.charCodeAt(index + 1);
|
|
340
|
+
if (code === 10) return null;
|
|
341
|
+
else if (code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102) {
|
|
342
|
+
var hexCharCodes = [code];
|
|
343
|
+
var min = Math.min(index + 7, str.length);
|
|
344
|
+
var i = index + 2;
|
|
345
|
+
for (; i < min; i += 1) {
|
|
346
|
+
var code_2 = str.charCodeAt(i);
|
|
347
|
+
if (code_2 >= 48 && code_2 <= 57 || code_2 >= 65 && code_2 <= 70 || code_2 >= 97 && code_2 <= 102) hexCharCodes.push(code_2);
|
|
348
|
+
else break;
|
|
349
|
+
}
|
|
350
|
+
if (i < str.length) {
|
|
351
|
+
var code_3 = str.charCodeAt(i);
|
|
352
|
+
if (code_3 === 9 || code_3 === 32 || code_3 === 10) i += 1;
|
|
353
|
+
}
|
|
354
|
+
return [i - 1, parseInt(String.fromCharCode.apply(null, hexCharCodes), 16)];
|
|
355
|
+
} else return [index + 1, code];
|
|
356
|
+
};
|
|
357
|
+
var consumeNumeric = function consumeNumeric(str, index) {
|
|
358
|
+
var numberResult = consumeNumber(str, index);
|
|
359
|
+
if (numberResult === null) return null;
|
|
360
|
+
var _a = __read(numberResult, 3), numberEndIndex = _a[0], numberValue = _a[1], numberFlag = _a[2];
|
|
361
|
+
var identResult = consumeIdent(str, numberEndIndex + 1);
|
|
362
|
+
if (identResult !== null) {
|
|
363
|
+
var _b = __read(identResult, 2);
|
|
364
|
+
return [_b[0], [
|
|
365
|
+
"<dimension-token>",
|
|
366
|
+
numberValue,
|
|
367
|
+
_b[1]
|
|
368
|
+
]];
|
|
369
|
+
}
|
|
370
|
+
if (numberEndIndex + 1 < str.length && str.charCodeAt(numberEndIndex + 1) === 37) return [numberEndIndex + 1, ["<percentage-token>", numberValue]];
|
|
371
|
+
return [numberEndIndex, [
|
|
372
|
+
"<number-token>",
|
|
373
|
+
numberValue,
|
|
374
|
+
numberFlag
|
|
375
|
+
]];
|
|
376
|
+
};
|
|
377
|
+
var consumeNumber = function consumeNumber(str, index) {
|
|
378
|
+
if (str.length <= index) return null;
|
|
379
|
+
var flag = "integer";
|
|
380
|
+
var numberChars = [];
|
|
381
|
+
var firstCode = str.charCodeAt(index);
|
|
382
|
+
if (firstCode === 43 || firstCode === 45) {
|
|
383
|
+
index += 1;
|
|
384
|
+
if (firstCode === 45) numberChars.push(45);
|
|
385
|
+
}
|
|
386
|
+
while (index < str.length) {
|
|
387
|
+
var code = str.charCodeAt(index);
|
|
388
|
+
if (code >= 48 && code <= 57) {
|
|
389
|
+
numberChars.push(code);
|
|
390
|
+
index += 1;
|
|
391
|
+
} else break;
|
|
392
|
+
}
|
|
393
|
+
if (index + 1 < str.length) {
|
|
394
|
+
var nextCode = str.charCodeAt(index);
|
|
395
|
+
var nextNextCode = str.charCodeAt(index + 1);
|
|
396
|
+
if (nextCode === 46 && nextNextCode >= 48 && nextNextCode <= 57) {
|
|
397
|
+
numberChars.push(nextCode, nextNextCode);
|
|
398
|
+
flag = "number";
|
|
399
|
+
index += 2;
|
|
400
|
+
while (index < str.length) {
|
|
401
|
+
var code = str.charCodeAt(index);
|
|
402
|
+
if (code >= 48 && code <= 57) {
|
|
403
|
+
numberChars.push(code);
|
|
404
|
+
index += 1;
|
|
405
|
+
} else break;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (index + 1 < str.length) {
|
|
410
|
+
var nextCode = str.charCodeAt(index);
|
|
411
|
+
var nextNextCode = str.charCodeAt(index + 1);
|
|
412
|
+
var nextNextNextCode = str.charCodeAt(index + 2);
|
|
413
|
+
if (nextCode === 69 || nextCode === 101) {
|
|
414
|
+
var nextNextIsDigit = nextNextCode >= 48 && nextNextCode <= 57;
|
|
415
|
+
if (nextNextIsDigit || (nextNextCode === 43 || nextNextCode === 45) && nextNextNextCode >= 48 && nextNextNextCode <= 57) {
|
|
416
|
+
flag = "number";
|
|
417
|
+
if (nextNextIsDigit) {
|
|
418
|
+
numberChars.push(69, nextNextCode);
|
|
419
|
+
index += 2;
|
|
420
|
+
} else if (nextNextCode === 45) {
|
|
421
|
+
numberChars.push(69, 45, nextNextNextCode);
|
|
422
|
+
index += 3;
|
|
423
|
+
} else {
|
|
424
|
+
numberChars.push(69, nextNextNextCode);
|
|
425
|
+
index += 3;
|
|
426
|
+
}
|
|
427
|
+
while (index < str.length) {
|
|
428
|
+
var code = str.charCodeAt(index);
|
|
429
|
+
if (code >= 48 && code <= 57) {
|
|
430
|
+
numberChars.push(code);
|
|
431
|
+
index += 1;
|
|
432
|
+
} else break;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
var numberString = String.fromCharCode.apply(null, numberChars);
|
|
438
|
+
var value = flag === "number" ? parseFloat(numberString) : parseInt(numberString);
|
|
439
|
+
if (value === -0) value = 0;
|
|
440
|
+
return Number.isNaN(value) ? null : [
|
|
441
|
+
index - 1,
|
|
442
|
+
value,
|
|
443
|
+
flag
|
|
444
|
+
];
|
|
445
|
+
};
|
|
446
|
+
var consumeIdentUnsafe = function consumeIdentUnsafe(str, index) {
|
|
447
|
+
if (str.length <= index) return null;
|
|
448
|
+
var identChars = [];
|
|
449
|
+
for (var code = str.charCodeAt(index); index < str.length; code = str.charCodeAt(++index)) {
|
|
450
|
+
if (code === 45 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128 || code >= 48 && code <= 57) {
|
|
451
|
+
identChars.push(code);
|
|
452
|
+
continue;
|
|
453
|
+
} else {
|
|
454
|
+
var result = consumeEscape(str, index);
|
|
455
|
+
if (result !== null) {
|
|
456
|
+
var _a = __read(result, 2), lastIndex = _a[0], code_4 = _a[1];
|
|
457
|
+
identChars.push(code_4);
|
|
458
|
+
index = lastIndex;
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
return index === 0 ? null : [index - 1, String.fromCharCode.apply(null, identChars)];
|
|
465
|
+
};
|
|
466
|
+
var consumeIdent = function consumeIdent(str, index) {
|
|
467
|
+
if (str.length <= index || !wouldStartIdentifier(str, index)) return null;
|
|
468
|
+
var identChars = [];
|
|
469
|
+
for (var code = str.charCodeAt(index); index < str.length; code = str.charCodeAt(++index)) {
|
|
470
|
+
if (code === 45 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 128 || code >= 48 && code <= 57) {
|
|
471
|
+
identChars.push(code);
|
|
472
|
+
continue;
|
|
473
|
+
} else {
|
|
474
|
+
var result = consumeEscape(str, index);
|
|
475
|
+
if (result !== null) {
|
|
476
|
+
var _a = __read(result, 2), lastIndex = _a[0], code_5 = _a[1];
|
|
477
|
+
identChars.push(code_5);
|
|
478
|
+
index = lastIndex;
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
return [index - 1, String.fromCharCode.apply(null, identChars)];
|
|
485
|
+
};
|
|
486
|
+
var consumeUrl = function consumeUrl(str, index) {
|
|
487
|
+
var code = str.charCodeAt(index);
|
|
488
|
+
while (code === 9 || code === 32 || code === 10) code = str.charCodeAt(++index);
|
|
489
|
+
var urlChars = [];
|
|
490
|
+
var hasFinishedWord = false;
|
|
491
|
+
while (index < str.length) {
|
|
492
|
+
if (code === 41) return [index, String.fromCharCode.apply(null, urlChars)];
|
|
493
|
+
else if (code === 34 || code === 39 || code === 40) return null;
|
|
494
|
+
else if (code === 9 || code === 32 || code === 10) {
|
|
495
|
+
if (!hasFinishedWord && urlChars.length !== 0) hasFinishedWord = true;
|
|
496
|
+
} else if (code === 92) {
|
|
497
|
+
var result = consumeEscape(str, index);
|
|
498
|
+
if (result === null || hasFinishedWord) return null;
|
|
499
|
+
var _a = __read(result, 2), lastIndex = _a[0], value = _a[1];
|
|
500
|
+
urlChars.push(value);
|
|
501
|
+
index = lastIndex;
|
|
502
|
+
} else {
|
|
503
|
+
if (hasFinishedWord) return null;
|
|
504
|
+
urlChars.push(code);
|
|
505
|
+
}
|
|
506
|
+
code = str.charCodeAt(++index);
|
|
507
|
+
}
|
|
508
|
+
return null;
|
|
509
|
+
};
|
|
510
|
+
var consumeIdentLike = function consumeIdentLike(str, index) {
|
|
511
|
+
var result = consumeIdent(str, index);
|
|
512
|
+
if (result === null) return null;
|
|
513
|
+
var _a = __read(result, 2), lastIndex = _a[0], value = _a[1];
|
|
514
|
+
if (value.toLowerCase() === "url") {
|
|
515
|
+
if (str.length > lastIndex + 1) {
|
|
516
|
+
var nextCode = str.charCodeAt(lastIndex + 1);
|
|
517
|
+
if (nextCode === 40) {
|
|
518
|
+
for (var offset = 2; lastIndex + offset < str.length; offset += 1) {
|
|
519
|
+
var nextNextCode = str.charCodeAt(lastIndex + offset);
|
|
520
|
+
if (nextNextCode === 34 || nextNextCode === 39) return [
|
|
521
|
+
lastIndex + 1,
|
|
522
|
+
value.toLowerCase(),
|
|
523
|
+
"<function-token>"
|
|
524
|
+
];
|
|
525
|
+
else if (nextNextCode !== 9 && nextNextCode !== 32 && nextNextCode !== 10) {
|
|
526
|
+
var result_1 = consumeUrl(str, lastIndex + offset);
|
|
527
|
+
if (result_1 === null) return null;
|
|
528
|
+
var _b = __read(result_1, 2);
|
|
529
|
+
return [
|
|
530
|
+
_b[0],
|
|
531
|
+
_b[1],
|
|
532
|
+
"<url-token>"
|
|
533
|
+
];
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return [
|
|
537
|
+
lastIndex + 1,
|
|
538
|
+
value.toLowerCase(),
|
|
539
|
+
"<function-token>"
|
|
540
|
+
];
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
} else if (str.length > lastIndex + 1) {
|
|
544
|
+
var nextCode = str.charCodeAt(lastIndex + 1);
|
|
545
|
+
if (nextCode === 40) return [
|
|
546
|
+
lastIndex + 1,
|
|
547
|
+
value.toLowerCase(),
|
|
548
|
+
"<function-token>"
|
|
549
|
+
];
|
|
550
|
+
}
|
|
551
|
+
return [
|
|
552
|
+
lastIndex,
|
|
553
|
+
value.toLowerCase(),
|
|
554
|
+
"<ident-token>"
|
|
555
|
+
];
|
|
556
|
+
};
|
|
557
|
+
var simplifyAST = function simplifyAST(ast) {
|
|
558
|
+
for (var i = ast.length - 1; i >= 0; i--) ast[i] = simplifyMediaQuery(ast[i]);
|
|
559
|
+
return ast;
|
|
560
|
+
};
|
|
561
|
+
var simplifyMediaQuery = function simplifyMediaQuery(mediaQuery) {
|
|
562
|
+
if (mediaQuery.mediaCondition === null) return mediaQuery;
|
|
563
|
+
var mediaCondition = simplifyMediaCondition(mediaQuery.mediaCondition);
|
|
564
|
+
if (mediaCondition.operator === null && mediaCondition.children.length === 1 && "children" in mediaCondition.children[0]) mediaCondition = mediaCondition.children[0];
|
|
565
|
+
return {
|
|
566
|
+
mediaPrefix: mediaQuery.mediaPrefix,
|
|
567
|
+
mediaType: mediaQuery.mediaType,
|
|
568
|
+
mediaCondition
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
var simplifyMediaCondition = function simplifyMediaCondition(mediaCondition) {
|
|
572
|
+
for (var i = mediaCondition.children.length - 1; i >= 0; i--) {
|
|
573
|
+
var unsimplifiedChild = mediaCondition.children[i];
|
|
574
|
+
if (!("context" in unsimplifiedChild)) {
|
|
575
|
+
var child = simplifyMediaCondition(unsimplifiedChild);
|
|
576
|
+
if (child.operator === null && child.children.length === 1) mediaCondition.children[i] = child.children[0];
|
|
577
|
+
else if (child.operator === mediaCondition.operator && (child.operator === "and" || child.operator === "or")) {
|
|
578
|
+
var spliceArgs = [i, 1];
|
|
579
|
+
for (var i_1 = 0; i_1 < child.children.length; i_1++) spliceArgs.push(child.children[i_1]);
|
|
580
|
+
mediaCondition.children.splice.apply(mediaCondition.children, spliceArgs);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return mediaCondition;
|
|
585
|
+
};
|
|
586
|
+
var createError = function createError(message, err) {
|
|
587
|
+
if (err instanceof Error) return new Error("".concat(err.message.trim(), "\n").concat(message.trim()));
|
|
588
|
+
else return new Error(message.trim());
|
|
589
|
+
};
|
|
590
|
+
var toAST = function toAST(str) {
|
|
591
|
+
return simplifyAST(toUnflattenedAST(str));
|
|
592
|
+
};
|
|
593
|
+
var toUnflattenedAST = function toUnflattenedAST(str) {
|
|
594
|
+
var tokenList = lexicalAnalysis(str.trim());
|
|
595
|
+
if (tokenList === null) throw createError("Failed tokenizing");
|
|
596
|
+
var startIndex = 0;
|
|
597
|
+
var endIndex = tokenList.length - 1;
|
|
598
|
+
if (tokenList[0].type === "<at-keyword-token>" && tokenList[0].value === "media") {
|
|
599
|
+
if (tokenList[1].type !== "<whitespace-token>") throw createError("Expected whitespace after media");
|
|
600
|
+
startIndex = 2;
|
|
601
|
+
for (var i = 2; i < tokenList.length - 1; i++) {
|
|
602
|
+
var token = tokenList[i];
|
|
603
|
+
if (token.type === "<{-token>") {
|
|
604
|
+
endIndex = i;
|
|
605
|
+
break;
|
|
606
|
+
} else if (token.type === "<semicolon-token>") throw createError("Expected '{' in media query but found ';'");
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
tokenList = tokenList.slice(startIndex, endIndex);
|
|
610
|
+
return syntacticAnalysis(tokenList);
|
|
611
|
+
};
|
|
612
|
+
var removeWhitespace = function removeWhitespace(tokenList) {
|
|
613
|
+
var newTokenList = [];
|
|
614
|
+
var before = false;
|
|
615
|
+
for (var i = 0; i < tokenList.length; i++) if (tokenList[i].type === "<whitespace-token>") {
|
|
616
|
+
before = true;
|
|
617
|
+
if (newTokenList.length > 0) newTokenList[newTokenList.length - 1].wsAfter = true;
|
|
618
|
+
} else {
|
|
619
|
+
newTokenList.push(__assign(__assign({}, tokenList[i]), {
|
|
620
|
+
wsBefore: before,
|
|
621
|
+
wsAfter: false
|
|
622
|
+
}));
|
|
623
|
+
before = false;
|
|
624
|
+
}
|
|
625
|
+
return newTokenList;
|
|
626
|
+
};
|
|
627
|
+
var syntacticAnalysis = function syntacticAnalysis(tokenList) {
|
|
628
|
+
var e_1, _a;
|
|
629
|
+
var mediaQueryList = [[]];
|
|
630
|
+
for (var i = 0; i < tokenList.length; i++) {
|
|
631
|
+
var token = tokenList[i];
|
|
632
|
+
if (token.type === "<comma-token>") mediaQueryList.push([]);
|
|
633
|
+
else mediaQueryList[mediaQueryList.length - 1].push(token);
|
|
634
|
+
}
|
|
635
|
+
var mediaQueries = mediaQueryList.map(removeWhitespace);
|
|
636
|
+
if (mediaQueries.length === 1 && mediaQueries[0].length === 0) return [{
|
|
637
|
+
mediaCondition: null,
|
|
638
|
+
mediaPrefix: null,
|
|
639
|
+
mediaType: "all"
|
|
640
|
+
}];
|
|
641
|
+
else {
|
|
642
|
+
var mediaQueryTokens = mediaQueries.map(function(mediaQueryTokens) {
|
|
643
|
+
if (mediaQueryTokens.length === 0) return null;
|
|
644
|
+
else return tokenizeMediaQuery(mediaQueryTokens);
|
|
645
|
+
});
|
|
646
|
+
var nonNullMediaQueryTokens = [];
|
|
647
|
+
try {
|
|
648
|
+
for (var mediaQueryTokens_1 = __values(mediaQueryTokens), mediaQueryTokens_1_1 = mediaQueryTokens_1.next(); !mediaQueryTokens_1_1.done; mediaQueryTokens_1_1 = mediaQueryTokens_1.next()) {
|
|
649
|
+
var mediaQueryToken = mediaQueryTokens_1_1.value;
|
|
650
|
+
if (mediaQueryToken !== null) nonNullMediaQueryTokens.push(mediaQueryToken);
|
|
651
|
+
}
|
|
652
|
+
} catch (e_1_1) {
|
|
653
|
+
e_1 = { error: e_1_1 };
|
|
654
|
+
} finally {
|
|
655
|
+
try {
|
|
656
|
+
if (mediaQueryTokens_1_1 && !mediaQueryTokens_1_1.done && (_a = mediaQueryTokens_1["return"])) _a.call(mediaQueryTokens_1);
|
|
657
|
+
} finally {
|
|
658
|
+
if (e_1) throw e_1.error;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if (nonNullMediaQueryTokens.length === 0) throw createError("No valid media queries");
|
|
662
|
+
return nonNullMediaQueryTokens;
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
var tokenizeMediaQuery = function tokenizeMediaQuery(tokens) {
|
|
666
|
+
var firstToken = tokens[0];
|
|
667
|
+
if (firstToken.type === "<(-token>") try {
|
|
668
|
+
return {
|
|
669
|
+
mediaPrefix: null,
|
|
670
|
+
mediaType: "all",
|
|
671
|
+
mediaCondition: tokenizeMediaCondition(tokens, true)
|
|
672
|
+
};
|
|
673
|
+
} catch (err) {
|
|
674
|
+
throw createError("Expected media condition after '('", err);
|
|
675
|
+
}
|
|
676
|
+
else if (firstToken.type === "<ident-token>") {
|
|
677
|
+
var mediaPrefix = null;
|
|
678
|
+
var mediaType = void 0;
|
|
679
|
+
var value = firstToken.value;
|
|
680
|
+
if (value === "only" || value === "not") mediaPrefix = value;
|
|
681
|
+
var firstIndex = mediaPrefix === null ? 0 : 1;
|
|
682
|
+
if (tokens.length <= firstIndex) throw createError("Expected extra token in media query");
|
|
683
|
+
var firstNonUnaryToken = tokens[firstIndex];
|
|
684
|
+
if (firstNonUnaryToken.type === "<ident-token>") {
|
|
685
|
+
var value_1 = firstNonUnaryToken.value;
|
|
686
|
+
if (value_1 === "all") mediaType = "all";
|
|
687
|
+
else if (value_1 === "print" || value_1 === "screen") mediaType = value_1;
|
|
688
|
+
else if (value_1 === "tty" || value_1 === "tv" || value_1 === "projection" || value_1 === "handheld" || value_1 === "braille" || value_1 === "embossed" || value_1 === "aural" || value_1 === "speech") {
|
|
689
|
+
mediaPrefix = mediaPrefix === "not" ? null : "not";
|
|
690
|
+
mediaType = "all";
|
|
691
|
+
} else throw createError("Unknown ident '".concat(value_1, "' in media query"));
|
|
692
|
+
} else if (mediaPrefix === "not" && firstNonUnaryToken.type === "<(-token>") {
|
|
693
|
+
var tokensWithParens = [{
|
|
694
|
+
type: "<(-token>",
|
|
695
|
+
wsBefore: false,
|
|
696
|
+
wsAfter: false
|
|
697
|
+
}];
|
|
698
|
+
tokensWithParens.push.apply(tokensWithParens, tokens);
|
|
699
|
+
tokensWithParens.push({
|
|
700
|
+
type: "<)-token>",
|
|
701
|
+
wsBefore: false,
|
|
702
|
+
wsAfter: false
|
|
703
|
+
});
|
|
704
|
+
try {
|
|
705
|
+
return {
|
|
706
|
+
mediaPrefix: null,
|
|
707
|
+
mediaType: "all",
|
|
708
|
+
mediaCondition: tokenizeMediaCondition(tokensWithParens, true)
|
|
709
|
+
};
|
|
710
|
+
} catch (err) {
|
|
711
|
+
throw createError("Expected media condition after '('", err);
|
|
712
|
+
}
|
|
713
|
+
} else throw createError("Invalid media query");
|
|
714
|
+
if (firstIndex + 1 === tokens.length) return {
|
|
715
|
+
mediaPrefix,
|
|
716
|
+
mediaType,
|
|
717
|
+
mediaCondition: null
|
|
718
|
+
};
|
|
719
|
+
else if (firstIndex + 4 < tokens.length) {
|
|
720
|
+
var secondNonUnaryToken = tokens[firstIndex + 1];
|
|
721
|
+
if (secondNonUnaryToken.type === "<ident-token>" && secondNonUnaryToken.value === "and") try {
|
|
722
|
+
return {
|
|
723
|
+
mediaPrefix,
|
|
724
|
+
mediaType,
|
|
725
|
+
mediaCondition: tokenizeMediaCondition(tokens.slice(firstIndex + 2), false)
|
|
726
|
+
};
|
|
727
|
+
} catch (err) {
|
|
728
|
+
throw createError("Expected media condition after 'and'", err);
|
|
729
|
+
}
|
|
730
|
+
else throw createError("Expected 'and' after media prefix");
|
|
731
|
+
} else throw createError("Expected media condition after media prefix");
|
|
732
|
+
} else throw createError("Expected media condition or media prefix");
|
|
733
|
+
};
|
|
734
|
+
var tokenizeMediaCondition = function tokenizeMediaCondition(tokens, mayContainOr, previousOperator) {
|
|
735
|
+
if (previousOperator === void 0) previousOperator = null;
|
|
736
|
+
if (tokens.length < 3 || tokens[0].type !== "<(-token>" || tokens[tokens.length - 1].type !== "<)-token>") throw new Error("Invalid media condition");
|
|
737
|
+
var endIndexOfFirstFeature = tokens.length - 1;
|
|
738
|
+
var maxDepth = 0;
|
|
739
|
+
var count = 0;
|
|
740
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
741
|
+
var token = tokens[i];
|
|
742
|
+
if (token.type === "<(-token>") {
|
|
743
|
+
count += 1;
|
|
744
|
+
maxDepth = Math.max(maxDepth, count);
|
|
745
|
+
} else if (token.type === "<)-token>") count -= 1;
|
|
746
|
+
if (count === 0) {
|
|
747
|
+
endIndexOfFirstFeature = i;
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if (count !== 0) throw new Error("Mismatched parens\nInvalid media condition");
|
|
752
|
+
var child;
|
|
753
|
+
var featureTokens = tokens.slice(0, endIndexOfFirstFeature + 1);
|
|
754
|
+
if (maxDepth === 1) child = tokenizeMediaFeature(featureTokens);
|
|
755
|
+
else if (featureTokens[1].type === "<ident-token>" && featureTokens[1].value === "not") child = tokenizeMediaCondition(featureTokens.slice(2, -1), true, "not");
|
|
756
|
+
else child = tokenizeMediaCondition(featureTokens.slice(1, -1), true);
|
|
757
|
+
if (endIndexOfFirstFeature === tokens.length - 1) return {
|
|
758
|
+
operator: previousOperator,
|
|
759
|
+
children: [child]
|
|
760
|
+
};
|
|
761
|
+
else {
|
|
762
|
+
var nextToken = tokens[endIndexOfFirstFeature + 1];
|
|
763
|
+
if (nextToken.type !== "<ident-token>") throw new Error("Invalid operator\nInvalid media condition");
|
|
764
|
+
else if (previousOperator !== null && previousOperator !== nextToken.value) throw new Error("'".concat(nextToken.value, "' and '").concat(previousOperator, "' must not be at same level\nInvalid media condition"));
|
|
765
|
+
else if (nextToken.value === "or" && !mayContainOr) throw new Error("Cannot use 'or' at top level of a media query\nInvalid media condition");
|
|
766
|
+
else if (nextToken.value !== "and" && nextToken.value !== "or") throw new Error("Invalid operator: '".concat(nextToken.value, "'\nInvalid media condition"));
|
|
767
|
+
var siblings = tokenizeMediaCondition(tokens.slice(endIndexOfFirstFeature + 2), mayContainOr, nextToken.value);
|
|
768
|
+
return {
|
|
769
|
+
operator: nextToken.value,
|
|
770
|
+
children: [child].concat(siblings.children)
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
var tokenizeMediaFeature = function tokenizeMediaFeature(rawTokens) {
|
|
775
|
+
if (rawTokens.length < 3 || rawTokens[0].type !== "<(-token>" || rawTokens[rawTokens.length - 1].type !== "<)-token>") throw new Error("Invalid media feature");
|
|
776
|
+
var tokens = [rawTokens[0]];
|
|
777
|
+
for (var i = 1; i < rawTokens.length; i++) {
|
|
778
|
+
if (i < rawTokens.length - 2) {
|
|
779
|
+
var a = rawTokens[i];
|
|
780
|
+
var b = rawTokens[i + 1];
|
|
781
|
+
var c = rawTokens[i + 2];
|
|
782
|
+
if (a.type === "<number-token>" && a.value > 0 && b.type === "<delim-token>" && b.value === 47 && c.type === "<number-token>" && c.value > 0) {
|
|
783
|
+
tokens.push({
|
|
784
|
+
type: "<ratio-token>",
|
|
785
|
+
numerator: a.value,
|
|
786
|
+
denominator: c.value,
|
|
787
|
+
wsBefore: a.wsBefore,
|
|
788
|
+
wsAfter: c.wsAfter
|
|
789
|
+
});
|
|
790
|
+
i += 2;
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
tokens.push(rawTokens[i]);
|
|
795
|
+
}
|
|
796
|
+
var nextToken = tokens[1];
|
|
797
|
+
if (nextToken.type === "<ident-token>" && tokens.length === 3) return {
|
|
798
|
+
context: "boolean",
|
|
799
|
+
feature: nextToken.value
|
|
800
|
+
};
|
|
801
|
+
else if (tokens.length === 5 && tokens[1].type === "<ident-token>" && tokens[2].type === "<colon-token>") {
|
|
802
|
+
var valueToken = tokens[3];
|
|
803
|
+
if (valueToken.type === "<number-token>" || valueToken.type === "<dimension-token>" || valueToken.type === "<ratio-token>" || valueToken.type === "<ident-token>") {
|
|
804
|
+
var feature = tokens[1].value;
|
|
805
|
+
var prefix = null;
|
|
806
|
+
var slice = feature.slice(0, 4);
|
|
807
|
+
if (slice === "min-") {
|
|
808
|
+
prefix = "min";
|
|
809
|
+
feature = feature.slice(4);
|
|
810
|
+
} else if (slice === "max-") {
|
|
811
|
+
prefix = "max";
|
|
812
|
+
feature = feature.slice(4);
|
|
813
|
+
}
|
|
814
|
+
valueToken.wsBefore;
|
|
815
|
+
valueToken.wsAfter;
|
|
816
|
+
var value = __rest(valueToken, ["wsBefore", "wsAfter"]);
|
|
817
|
+
return {
|
|
818
|
+
context: "value",
|
|
819
|
+
prefix,
|
|
820
|
+
feature,
|
|
821
|
+
value
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
} else if (tokens.length >= 5) try {
|
|
825
|
+
var range = tokenizeRange(tokens);
|
|
826
|
+
return {
|
|
827
|
+
context: "range",
|
|
828
|
+
feature: range.featureName,
|
|
829
|
+
range
|
|
830
|
+
};
|
|
831
|
+
} catch (err) {
|
|
832
|
+
throw createError("Invalid media feature", err);
|
|
833
|
+
}
|
|
834
|
+
throw new Error("Invalid media feature");
|
|
835
|
+
};
|
|
836
|
+
var tokenizeRange = function tokenizeRange(tokens) {
|
|
837
|
+
var _a, _b, _c, _d;
|
|
838
|
+
if (tokens.length < 5 || tokens[0].type !== "<(-token>" || tokens[tokens.length - 1].type !== "<)-token>") throw new Error("Invalid range");
|
|
839
|
+
var range = {
|
|
840
|
+
leftToken: null,
|
|
841
|
+
leftOp: null,
|
|
842
|
+
featureName: "",
|
|
843
|
+
rightOp: null,
|
|
844
|
+
rightToken: null
|
|
845
|
+
};
|
|
846
|
+
var hasLeft = tokens[1].type === "<number-token>" || tokens[1].type === "<dimension-token>" || tokens[1].type === "<ratio-token>" || tokens[1].type === "<ident-token>" && tokens[1].value === "infinite";
|
|
847
|
+
if (tokens[2].type === "<delim-token>") {
|
|
848
|
+
if (tokens[2].value === 60) if (tokens[3].type === "<delim-token>" && tokens[3].value === 61 && !tokens[3].wsBefore) range[hasLeft ? "leftOp" : "rightOp"] = "<=";
|
|
849
|
+
else range[hasLeft ? "leftOp" : "rightOp"] = "<";
|
|
850
|
+
else if (tokens[2].value === 62) if (tokens[3].type === "<delim-token>" && tokens[3].value === 61 && !tokens[3].wsBefore) range[hasLeft ? "leftOp" : "rightOp"] = ">=";
|
|
851
|
+
else range[hasLeft ? "leftOp" : "rightOp"] = ">";
|
|
852
|
+
else if (tokens[2].value === 61) range[hasLeft ? "leftOp" : "rightOp"] = "=";
|
|
853
|
+
else throw new Error("Invalid range");
|
|
854
|
+
if (hasLeft) range.leftToken = tokens[1];
|
|
855
|
+
else if (tokens[1].type === "<ident-token>") range.featureName = tokens[1].value;
|
|
856
|
+
else throw new Error("Invalid range");
|
|
857
|
+
var tokenIndexAfterFirstOp = 2 + ((_b = (_a = range[hasLeft ? "leftOp" : "rightOp"]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0);
|
|
858
|
+
var tokenAfterFirstOp = tokens[tokenIndexAfterFirstOp];
|
|
859
|
+
if (hasLeft) if (tokenAfterFirstOp.type === "<ident-token>") {
|
|
860
|
+
range.featureName = tokenAfterFirstOp.value;
|
|
861
|
+
if (tokens.length >= 7) {
|
|
862
|
+
var secondOpToken = tokens[tokenIndexAfterFirstOp + 1];
|
|
863
|
+
var followingToken = tokens[tokenIndexAfterFirstOp + 2];
|
|
864
|
+
if (secondOpToken.type === "<delim-token>") {
|
|
865
|
+
var charCode = secondOpToken.value;
|
|
866
|
+
if (charCode === 60) if (followingToken.type === "<delim-token>" && followingToken.value === 61 && !followingToken.wsBefore) range.rightOp = "<=";
|
|
867
|
+
else range.rightOp = "<";
|
|
868
|
+
else if (charCode === 62) if (followingToken.type === "<delim-token>" && followingToken.value === 61 && !followingToken.wsBefore) range.rightOp = ">=";
|
|
869
|
+
else range.rightOp = ">";
|
|
870
|
+
else throw new Error("Invalid range");
|
|
871
|
+
range.rightToken = tokens[tokenIndexAfterFirstOp + 1 + ((_d = (_c = range.rightOp) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0)];
|
|
872
|
+
} else throw new Error("Invalid range");
|
|
873
|
+
} else if (tokenIndexAfterFirstOp + 2 !== tokens.length) throw new Error("Invalid range");
|
|
874
|
+
} else throw new Error("Invalid range");
|
|
875
|
+
else range.rightToken = tokenAfterFirstOp;
|
|
876
|
+
var validRange = null;
|
|
877
|
+
var lt = range.leftToken, leftOp = range.leftOp, featureName = range.featureName, rightOp = range.rightOp, rt = range.rightToken;
|
|
878
|
+
var leftToken = null;
|
|
879
|
+
if (lt !== null) {
|
|
880
|
+
if (lt.type === "<ident-token>") {
|
|
881
|
+
var type = lt.type, value = lt.value;
|
|
882
|
+
if (value === "infinite") leftToken = {
|
|
883
|
+
type,
|
|
884
|
+
value
|
|
885
|
+
};
|
|
886
|
+
} else if (lt.type === "<number-token>" || lt.type === "<dimension-token>" || lt.type === "<ratio-token>") {
|
|
887
|
+
lt.wsBefore;
|
|
888
|
+
lt.wsAfter;
|
|
889
|
+
leftToken = __rest(lt, ["wsBefore", "wsAfter"]);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
var rightToken = null;
|
|
893
|
+
if (rt !== null) {
|
|
894
|
+
if (rt.type === "<ident-token>") {
|
|
895
|
+
var type = rt.type, value = rt.value;
|
|
896
|
+
if (value === "infinite") rightToken = {
|
|
897
|
+
type,
|
|
898
|
+
value
|
|
899
|
+
};
|
|
900
|
+
} else if (rt.type === "<number-token>" || rt.type === "<dimension-token>" || rt.type === "<ratio-token>") {
|
|
901
|
+
rt.wsBefore;
|
|
902
|
+
rt.wsAfter;
|
|
903
|
+
rightToken = __rest(rt, ["wsBefore", "wsAfter"]);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if (leftToken !== null && rightToken !== null) if ((leftOp === "<" || leftOp === "<=") && (rightOp === "<" || rightOp === "<=")) validRange = {
|
|
907
|
+
leftToken,
|
|
908
|
+
leftOp,
|
|
909
|
+
featureName,
|
|
910
|
+
rightOp,
|
|
911
|
+
rightToken
|
|
912
|
+
};
|
|
913
|
+
else if ((leftOp === ">" || leftOp === ">=") && (rightOp === ">" || rightOp === ">=")) validRange = {
|
|
914
|
+
leftToken,
|
|
915
|
+
leftOp,
|
|
916
|
+
featureName,
|
|
917
|
+
rightOp,
|
|
918
|
+
rightToken
|
|
919
|
+
};
|
|
920
|
+
else throw new Error("Invalid range");
|
|
921
|
+
else if (leftToken === null && leftOp === null && rightOp !== null && rightToken !== null) validRange = {
|
|
922
|
+
leftToken,
|
|
923
|
+
leftOp,
|
|
924
|
+
featureName,
|
|
925
|
+
rightOp,
|
|
926
|
+
rightToken
|
|
927
|
+
};
|
|
928
|
+
else if (leftToken !== null && leftOp !== null && rightOp === null && rightToken === null) validRange = {
|
|
929
|
+
leftToken,
|
|
930
|
+
leftOp,
|
|
931
|
+
featureName,
|
|
932
|
+
rightOp,
|
|
933
|
+
rightToken
|
|
934
|
+
};
|
|
935
|
+
return validRange;
|
|
936
|
+
} else throw new Error("Invalid range");
|
|
937
|
+
};
|
|
938
|
+
//#endregion
|
|
939
|
+
export { toAST };
|