@ankhorage/zora 28.7.2 → 28.7.3
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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/features/carousel/Carousel.d.ts.map +1 -1
- package/dist/features/carousel/Carousel.js +22 -4
- package/dist/features/carousel/Carousel.js.map +1 -1
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -1
- package/dist/features/form/select/adapters/inbound/Select.web.js +4 -1
- package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -1
- package/dist/features/form/select/composition/SelectOptionsList.d.ts +9 -0
- package/dist/features/form/select/composition/SelectOptionsList.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectOptionsList.js +17 -0
- package/dist/features/form/select/composition/SelectOptionsList.js.map +1 -0
- package/package.json +1 -1
- package/src/features/carousel/Carousel.tsx +27 -5
- package/src/features/form/select/adapters/inbound/Select.web.tsx +13 -10
- package/src/features/form/select/composition/SelectOptionsList.tsx +29 -0
- package/src/webPackageExports.test.ts +40 -0
- package/web-dist/authoring/index.d.ts +2 -2
- package/web-dist/authoring/index.js +132 -23545
- package/web-dist/chunks/{Accordion-nh0cs9hq.js → Accordion-0g45tq8n.js} +1 -43
- package/web-dist/chunks/{Accordion-rhjddvkh.js → Accordion-0zk0xp73.js} +26 -27
- package/web-dist/chunks/Accordion-2ej7s27r.js +18 -0
- package/web-dist/chunks/{Accordion-0spfxhpg.js → Accordion-2gvv7h5p.js} +22 -28
- package/web-dist/chunks/{Accordion-mpb070cf.js → Accordion-4gfrfgh5.js} +27 -33
- package/web-dist/chunks/{Accordion-3cpkxpdg.js → Accordion-53c30cqa.js} +5 -5
- package/web-dist/chunks/{Accordion-8skz71ct.js → Accordion-6gc0jw1n.js} +25 -30
- package/web-dist/chunks/Accordion-6n2r35qh.js +103 -0
- package/web-dist/chunks/Accordion-6sa9z92t.js +99 -0
- package/web-dist/chunks/{Accordion-gs838h0n.js → Accordion-772gn1m6.js} +8 -10
- package/web-dist/chunks/Accordion-7ayxbm7k.js +20 -0
- package/web-dist/chunks/{Accordion-arr9ayv0.js → Accordion-92py9m3m.js} +12 -18
- package/web-dist/chunks/{Accordion-zd15byha.js → Accordion-a6a0za8s.js} +2 -2
- package/web-dist/chunks/Accordion-c781654t.js +171 -0
- package/web-dist/chunks/{Accordion-516n2cx4.js → Accordion-ce2r66e1.js} +43 -168
- package/web-dist/chunks/{Accordion-9d38cgqj.js → Accordion-cwx73cjc.js} +4 -1426
- package/web-dist/chunks/{Accordion-1fz55hk4.js → Accordion-d15mjc4n.js} +5 -4
- package/web-dist/chunks/Accordion-ddzm7pnp.js +4721 -0
- package/web-dist/chunks/{Accordion-htvmkx8s.js → Accordion-dv5c27w4.js} +105 -41
- package/web-dist/chunks/Accordion-e8tapf5a.js +22 -0
- package/web-dist/chunks/{Accordion-78astqx3.js → Accordion-enfevvwv.js} +100 -170
- package/web-dist/chunks/{Accordion-1g91we37.js → Accordion-f7czh00h.js} +48 -205
- package/web-dist/chunks/{Accordion-2ad57stc.js → Accordion-f8dj4gbw.js} +12 -12
- package/web-dist/chunks/{Accordion-yrac5a7m.js → Accordion-fkftnxgw.js} +7 -17
- package/web-dist/chunks/Accordion-fsdgssfq.js +20 -0
- package/web-dist/chunks/Accordion-gnkzvj03.js +40 -0
- package/web-dist/chunks/{Accordion-jtgh2tep.js → Accordion-gtsxpnxf.js} +24 -30
- package/web-dist/chunks/Accordion-h7ae9ybw.js +70 -0
- package/web-dist/chunks/Accordion-hadw5304.js +78 -0
- package/web-dist/chunks/Accordion-jf0vrgw4.js +219 -0
- package/web-dist/chunks/{Accordion-agt9vt85.js → Accordion-jn70wf9s.js} +13 -13
- package/web-dist/chunks/{Accordion-9m5asd8r.js → Accordion-jqk96gt9.js} +9 -15
- package/web-dist/chunks/Accordion-kgfw6vj3.js +117 -0
- package/web-dist/chunks/Accordion-kjv0pfyp.js +136 -0
- package/web-dist/chunks/{Accordion-19aegsx2.js → Accordion-knd9nb8v.js} +21 -22
- package/web-dist/chunks/Accordion-nkv2pzj8.js +203 -0
- package/web-dist/chunks/{Accordion-5mga7hty.js → Accordion-pr1tv6jx.js} +3 -5
- package/web-dist/chunks/{Accordion-d5sz8vaq.js → Accordion-r8swmfjm.js} +5 -7
- package/web-dist/chunks/{Accordion-bexwrnfh.js → Accordion-rp9cjtpg.js} +28 -34
- package/web-dist/chunks/{Accordion-9dk62zn9.js → Accordion-sam71gw6.js} +66 -48
- package/web-dist/chunks/Accordion-se0pee16.js +213 -0
- package/web-dist/chunks/{Accordion-tdrk9cyn.js → Accordion-t9v6kw4n.js} +8 -8
- package/web-dist/chunks/{Accordion-3zzzw7a8.js → Accordion-t9w365ke.js} +3 -5
- package/web-dist/chunks/{Accordion-ar8qe05j.js → Accordion-vhr7js3e.js} +4 -4
- package/web-dist/chunks/{Accordion-ytf9ba8v.js → Accordion-w35n9p3n.js} +10 -10
- package/web-dist/chunks/{Accordion-0egwarcs.js → Accordion-wcref68q.js} +8 -8
- package/web-dist/chunks/Accordion-wf6pk2j9.js +61 -0
- package/web-dist/chunks/{Accordion-b1y5mjac.js → Accordion-x1ze1wvk.js} +1 -4
- package/web-dist/chunks/Accordion-xfwdh07r.js +235 -0
- package/web-dist/chunks/{Accordion-8t6vh482.js → Accordion-xhkphta6.js} +15 -21
- package/web-dist/chunks/{Accordion-77514sk9.js → Accordion-ycatfb1v.js} +6 -6
- package/web-dist/chunks/{Accordion-kcspvk6q.js → Accordion-ysy3ezf0.js} +9 -11
- package/web-dist/chunks/{Accordion-qjxx43r1.js → Accordion-zdwbxeq1.js} +40 -48
- package/web-dist/chunks/{Accordion-tk8zf9ff.js → Accordion-zhgty1ae.js} +10 -35
- package/web-dist/chunks/{RichTextClient-7qqj2dpw.js → RichTextClient-tsah5t7v.js} +19 -31
- package/web-dist/chunks/{Video.native-6142s9f7.js → Video.native-y947mrfb.js} +22 -32
- package/web-dist/chunks/{index-n6p0wdvg.js → index-m1y984nz.js} +547 -241
- package/web-dist/components/accordion/Accordion.dependency-0.d.ts +1 -1
- package/web-dist/components/accordion/Accordion.js +8 -14
- package/web-dist/components/accordion/Accordion.types-0.d.ts +1 -1
- package/web-dist/components/accordion-item/AccordionItem.dependency-0.d.ts +1 -1
- package/web-dist/components/accordion-item/AccordionItem.js +8 -14
- package/web-dist/components/accordion-item/AccordionItem.types-0.d.ts +1 -1
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -4
- package/web-dist/components/app-bar/AppBar.dependency-0.d.ts +1 -1
- package/web-dist/components/app-bar/AppBar.dependency-2.d.ts +1 -1
- package/web-dist/components/app-bar/AppBar.js +10 -27
- package/web-dist/components/app-bar/AppBar.types-0.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.dependency-0.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.dependency-1.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.dependency-3.d.ts +1 -1
- package/web-dist/components/app-header/AppHeader.js +10 -27
- package/web-dist/components/app-shell/AppShell.dependency-0.d.ts +1 -1
- package/web-dist/components/app-shell/AppShell.js +3 -8
- package/web-dist/components/audio/Audio.dependency-0.d.ts +1 -1
- package/web-dist/components/audio/Audio.js +17 -28
- package/web-dist/components/auth-screen/AuthScreen.dependency-0.d.ts +1 -1
- package/web-dist/components/auth-screen/AuthScreen.dependency-3.d.ts +1 -1
- package/web-dist/components/auth-screen/AuthScreen.dependency-4.d.ts +1 -1
- package/web-dist/components/auth-screen/AuthScreen.js +13 -25
- package/web-dist/components/auth-screen/AuthScreen.types-0.d.ts +1 -1
- package/web-dist/components/avatar/Avatar.dependency-0.d.ts +1 -1
- package/web-dist/components/avatar/Avatar.dependency-2.d.ts +1 -1
- package/web-dist/components/avatar/Avatar.js +8 -14
- package/web-dist/components/avatar/Avatar.types-0.d.ts +1 -1
- package/web-dist/components/avatar-group/AvatarGroup.dependency-1.d.ts +1 -1
- package/web-dist/components/avatar-group/AvatarGroup.dependency-3.d.ts +1 -1
- package/web-dist/components/avatar-group/AvatarGroup.js +8 -14
- package/web-dist/components/avatar-group/AvatarGroup.types-0.d.ts +1 -1
- package/web-dist/components/badge/Badge.dependency-0.d.ts +1 -1
- package/web-dist/components/badge/Badge.dependency-2.d.ts +1 -1
- package/web-dist/components/badge/Badge.dependency-3.d.ts +1 -1
- package/web-dist/components/badge/Badge.js +3 -10
- package/web-dist/components/badge/Badge.types-0.d.ts +1 -1
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.dependency-0.d.ts +1 -1
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +13 -25
- package/web-dist/components/bottom-sheet/BottomSheet.dependency-0.d.ts +1 -1
- package/web-dist/components/bottom-sheet/BottomSheet.js +5 -13
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.d.ts +1 -1
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +5 -13
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.d.ts +1 -1
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +5 -13
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.d.ts +1 -1
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +5 -13
- package/web-dist/components/bottom-sheet-view/BottomSheetView.d.ts +1 -1
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +5 -13
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.d.ts +1 -1
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +5 -13
- package/web-dist/components/breadcrumbs/Breadcrumbs.dependency-0.d.ts +1 -1
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +17 -27
- package/web-dist/components/breadcrumbs/Breadcrumbs.types-0.d.ts +1 -1
- package/web-dist/components/button/Button.dependency-0.d.ts +1 -1
- package/web-dist/components/button/Button.dependency-2.d.ts +1 -1
- package/web-dist/components/button/Button.dependency-3.d.ts +1 -1
- package/web-dist/components/button/Button.js +8 -18
- package/web-dist/components/button/Button.types-0.d.ts +1 -1
- package/web-dist/components/button-group/ButtonGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/button-group/ButtonGroup.dependency-2.d.ts +1 -1
- package/web-dist/components/button-group/ButtonGroup.js +6 -16
- package/web-dist/components/calendar/Calendar.dependency-0.d.ts +1 -1
- package/web-dist/components/calendar/Calendar.js +9 -19
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-0.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-2.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-3.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.dependency-4.d.ts +1 -1
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +13 -25
- package/web-dist/components/card/Card.dependency-0.d.ts +1 -1
- package/web-dist/components/card/Card.js +12 -24
- package/web-dist/components/card/Card.types-0.d.ts +1 -1
- package/web-dist/components/card-back/CardBack.dependency-0.d.ts +1 -1
- package/web-dist/components/card-back/CardBack.js +5 -6
- package/web-dist/components/card-hand/CardHand.dependency-0.d.ts +1 -1
- package/web-dist/components/card-hand/CardHand.js +5 -6
- package/web-dist/components/carousel/Carousel.js +58 -49
- package/web-dist/components/chat-list-item/ChatListItem.dependency-1.d.ts +1 -1
- package/web-dist/components/chat-list-item/ChatListItem.dependency-3.d.ts +1 -1
- package/web-dist/components/chat-list-item/ChatListItem.js +10 -19
- package/web-dist/components/checkbox/Checkbox.dependency-0.d.ts +1 -1
- package/web-dist/components/checkbox/Checkbox.js +7 -17
- package/web-dist/components/checkbox/Checkbox.types-0.d.ts +1 -1
- package/web-dist/components/checkbox-group/CheckboxGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/checkbox-group/CheckboxGroup.js +7 -17
- package/web-dist/components/checkbox-group/CheckboxGroup.types-0.d.ts +1 -1
- package/web-dist/components/chess-board/ChessBoard.dependency-0.d.ts +1 -1
- package/web-dist/components/chess-board/ChessBoard.js +5 -7
- package/web-dist/components/chip/Chip.dependency-0.d.ts +1 -1
- package/web-dist/components/chip/Chip.dependency-2.d.ts +1 -1
- package/web-dist/components/chip/Chip.dependency-3.d.ts +1 -1
- package/web-dist/components/chip/Chip.js +8 -15
- package/web-dist/components/chip/Chip.types-0.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.dependency-2.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.dependency-3.d.ts +1 -1
- package/web-dist/components/chip-group/ChipGroup.js +8 -15
- package/web-dist/components/chip-group/ChipGroup.types-0.d.ts +1 -1
- package/web-dist/components/collection-editor/CollectionEditor.dependency-0.d.ts +1 -1
- package/web-dist/components/collection-editor/CollectionEditor.js +19 -31
- package/web-dist/components/color-hue-scale/ColorHueScale.dependency-0.d.ts +1 -1
- package/web-dist/components/color-hue-scale/ColorHueScale.js +19 -35
- package/web-dist/components/color-picker/ColorPicker.dependency-0.d.ts +1 -1
- package/web-dist/components/color-picker/ColorPicker.js +19 -35
- package/web-dist/components/color-tone/ColorTone.dependency-0.d.ts +1 -1
- package/web-dist/components/color-tone/ColorTone.js +19 -35
- package/web-dist/components/color-wheel/ColorWheel.dependency-0.d.ts +1 -1
- package/web-dist/components/color-wheel/ColorWheel.js +19 -35
- package/web-dist/components/content-rail/ContentRail.dependency-0.d.ts +1 -1
- package/web-dist/components/content-rail/ContentRail.js +23 -35
- package/web-dist/components/data-table/DataTable.dependency-0.d.ts +1 -1
- package/web-dist/components/data-table/DataTable.dependency-2.d.ts +1 -1
- package/web-dist/components/data-table/DataTable.js +67 -101
- package/web-dist/components/data-table/DataTable.types-0.d.ts +1 -1
- package/web-dist/components/date-picker/DatePicker.dependency-0.d.ts +1 -1
- package/web-dist/components/date-picker/DatePicker.js +16 -32
- package/web-dist/components/dialog/Dialog.dependency-0.d.ts +1 -1
- package/web-dist/components/dialog/Dialog.js +7 -18
- package/web-dist/components/divider/Divider.dependency-0.d.ts +1 -1
- package/web-dist/components/divider/Divider.js +3 -8
- package/web-dist/components/divider/Divider.types-0.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.dependency-0.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.dependency-2.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.dependency-3.d.ts +1 -1
- package/web-dist/components/empty-state/EmptyState.js +13 -25
- package/web-dist/components/explorer/Explorer.dependency-0.d.ts +1 -1
- package/web-dist/components/explorer/Explorer.js +10 -16
- package/web-dist/components/field/Field.dependency-0.d.ts +1 -1
- package/web-dist/components/field/Field.dependency-1.d.ts +1 -1
- package/web-dist/components/field/Field.js +7 -15
- package/web-dist/components/file-explorer/FileExplorer.dependency-0.d.ts +1 -1
- package/web-dist/components/file-explorer/FileExplorer.js +10 -16
- package/web-dist/components/flat-list/FlatList.dependency-0.d.ts +1 -1
- package/web-dist/components/flat-list/FlatList.js +8 -17
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.dependency-0.d.ts +1 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.dependency-3.d.ts +1 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.dependency-4.d.ts +1 -1
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +13 -25
- package/web-dist/components/form/Form.dependency-0.d.ts +1 -1
- package/web-dist/components/form/Form.js +9 -20
- package/web-dist/components/form-actions/FormActions.dependency-0.d.ts +1 -1
- package/web-dist/components/form-actions/FormActions.js +9 -20
- package/web-dist/components/form-error/FormError.dependency-0.d.ts +1 -1
- package/web-dist/components/form-error/FormError.js +9 -20
- package/web-dist/components/game/Game.dependency-0.d.ts +1 -1
- package/web-dist/components/game/Game.js +4 -10
- package/web-dist/components/game-entity/GameEntity.dependency-0.d.ts +1 -1
- package/web-dist/components/game-entity/GameEntity.js +4 -10
- package/web-dist/components/game-field/GameField.dependency-0.d.ts +1 -1
- package/web-dist/components/game-field/GameField.js +4 -10
- package/web-dist/components/game-input-zone/GameInputZone.dependency-0.d.ts +1 -1
- package/web-dist/components/game-input-zone/GameInputZone.js +4 -10
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.dependency-0.d.ts +1 -1
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -10
- package/web-dist/components/game-overlay/GameOverlay.dependency-0.d.ts +1 -1
- package/web-dist/components/game-overlay/GameOverlay.js +4 -10
- package/web-dist/components/gradient/Gradient.dependency-0.d.ts +1 -1
- package/web-dist/components/gradient/Gradient.dependency-2.d.ts +1 -1
- package/web-dist/components/gradient/Gradient.js +4 -9
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -9
- package/web-dist/components/graph-view/GraphView.js +3 -5
- package/web-dist/components/grid/Grid.dependency-0.d.ts +1 -1
- package/web-dist/components/grid/Grid.js +3 -8
- package/web-dist/components/grid/Grid.types-0.d.ts +1 -1
- package/web-dist/components/grid-interactions/GridInteractions.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-interactions/GridInteractions.js +2 -8
- package/web-dist/components/grid-line-overlay/GridLineOverlay.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -6
- package/web-dist/components/grid-ruler/GridRuler.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-ruler/GridRuler.js +4 -6
- package/web-dist/components/grid-view/GridView.dependency-0.d.ts +1 -1
- package/web-dist/components/grid-view/GridView.js +1 -2
- package/web-dist/components/heading/Heading.dependency-0.d.ts +1 -1
- package/web-dist/components/heading/Heading.dependency-2.d.ts +1 -1
- package/web-dist/components/heading/Heading.js +5 -8
- package/web-dist/components/heading/Heading.types-0.d.ts +1 -1
- package/web-dist/components/hero/Hero.dependency-0.d.ts +1 -1
- package/web-dist/components/hero/Hero.dependency-2.d.ts +1 -1
- package/web-dist/components/hero/Hero.dependency-3.d.ts +1 -1
- package/web-dist/components/hero/Hero.js +20 -32
- package/web-dist/components/icon/Icon.dependency-0.d.ts +1 -1
- package/web-dist/components/icon/Icon.js +3 -7
- package/web-dist/components/icon/Icon.types-0.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-0.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-2.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-3.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.dependency-4.d.ts +1 -1
- package/web-dist/components/icon-button/IconButton.js +6 -16
- package/web-dist/components/icon-button/IconButton.types-0.d.ts +1 -1
- package/web-dist/components/image/Image.dependency-0.d.ts +1 -1
- package/web-dist/components/image/Image.js +6 -12
- package/web-dist/components/image/Image.types-0.d.ts +1 -1
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.dependency-0.d.ts +1 -1
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -5
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.types-0.d.ts +1 -1
- package/web-dist/components/link/Link.dependency-0.d.ts +1 -1
- package/web-dist/components/link/Link.dependency-3.d.ts +1 -1
- package/web-dist/components/link/Link.js +9 -12
- package/web-dist/components/link/Link.types-0.d.ts +1 -1
- package/web-dist/components/list/List.dependency-0.d.ts +1 -1
- package/web-dist/components/list/List.js +8 -17
- package/web-dist/components/list/List.types-0.d.ts +1 -1
- package/web-dist/components/list-item/ListItem.dependency-0.d.ts +1 -1
- package/web-dist/components/list-item/ListItem.js +8 -17
- package/web-dist/components/list-item/ListItem.types-0.d.ts +1 -1
- package/web-dist/components/list-section/ListSection.dependency-0.d.ts +1 -1
- package/web-dist/components/list-section/ListSection.js +8 -17
- package/web-dist/components/list-section/ListSection.types-0.d.ts +1 -1
- package/web-dist/components/master-detail/MasterDetail.dependency-0.d.ts +1 -1
- package/web-dist/components/master-detail/MasterDetail.js +4 -17
- package/web-dist/components/matrix-grid/MatrixGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/matrix-grid/MatrixGrid.js +14 -23
- package/web-dist/components/media-card/MediaCard.dependency-0.d.ts +1 -1
- package/web-dist/components/media-card/MediaCard.js +12 -24
- package/web-dist/components/media-explorer/MediaExplorer.dependency-0.d.ts +1 -1
- package/web-dist/components/media-explorer/MediaExplorer.js +10 -16
- package/web-dist/components/message-bubble/MessageBubble.dependency-1.d.ts +1 -1
- package/web-dist/components/message-bubble/MessageBubble.dependency-3.d.ts +1 -1
- package/web-dist/components/message-bubble/MessageBubble.js +10 -19
- package/web-dist/components/metric-card/MetricCard.dependency-0.d.ts +1 -1
- package/web-dist/components/metric-card/MetricCard.dependency-3.d.ts +1 -1
- package/web-dist/components/metric-card/MetricCard.js +12 -24
- package/web-dist/components/metric-card/MetricCard.types-0.d.ts +1 -1
- package/web-dist/components/missing-element/MissingElement.dependency-0.d.ts +1 -1
- package/web-dist/components/missing-element/MissingElement.js +15 -27
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-0.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-2.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-3.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.dependency-4.d.ts +1 -1
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +13 -25
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.types-0.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-0.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-2.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-3.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.dependency-4.d.ts +1 -1
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +13 -25
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.types-0.d.ts +1 -1
- package/web-dist/components/opening-book/OpeningBook.dependency-0.d.ts +1 -1
- package/web-dist/components/opening-book/OpeningBook.js +5 -7
- package/web-dist/components/otp-form/OtpForm.dependency-0.d.ts +1 -1
- package/web-dist/components/otp-form/OtpForm.dependency-3.d.ts +1 -1
- package/web-dist/components/otp-form/OtpForm.dependency-4.d.ts +1 -1
- package/web-dist/components/otp-form/OtpForm.js +13 -25
- package/web-dist/components/pagination/Pagination.dependency-0.d.ts +1 -1
- package/web-dist/components/pagination/Pagination.js +16 -26
- package/web-dist/components/palette-item/PaletteItem.dependency-0.d.ts +1 -1
- package/web-dist/components/palette-item/PaletteItem.js +17 -29
- package/web-dist/components/palette-item/PaletteItem.types-0.d.ts +1 -1
- package/web-dist/components/playing-card/PlayingCard.dependency-0.d.ts +1 -1
- package/web-dist/components/playing-card/PlayingCard.js +5 -6
- package/web-dist/components/poker-training-table/PokerTrainingTable.dependency-0.d.ts +1 -1
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +5 -6
- package/web-dist/components/popover/Popover.dependency-0.d.ts +1 -1
- package/web-dist/components/popover/Popover.js +4 -10
- package/web-dist/components/popover/Popover.types-0.d.ts +1 -1
- package/web-dist/components/popover-menu/PopoverMenu.dependency-0.d.ts +1 -1
- package/web-dist/components/popover-menu/PopoverMenu.js +6 -21
- package/web-dist/components/popover-menu/PopoverMenu.types-0.d.ts +1 -1
- package/web-dist/components/post-card/PostCard.dependency-1.d.ts +1 -1
- package/web-dist/components/post-card/PostCard.dependency-4.d.ts +1 -1
- package/web-dist/components/post-card/PostCard.js +12 -24
- package/web-dist/components/post-card/PostCard.types-0.d.ts +1 -1
- package/web-dist/components/product-card/ProductCard.dependency-0.d.ts +1 -1
- package/web-dist/components/product-card/ProductCard.js +12 -24
- package/web-dist/components/progress/Progress.dependency-0.d.ts +1 -1
- package/web-dist/components/progress/Progress.dependency-2.d.ts +1 -1
- package/web-dist/components/progress/Progress.dependency-3.d.ts +1 -1
- package/web-dist/components/progress/Progress.js +7 -12
- package/web-dist/components/progress-ring/ProgressRing.dependency-0.d.ts +1 -1
- package/web-dist/components/progress-ring/ProgressRing.dependency-2.d.ts +1 -1
- package/web-dist/components/progress-ring/ProgressRing.js +7 -12
- package/web-dist/components/radio/Radio.dependency-0.d.ts +1 -1
- package/web-dist/components/radio/Radio.js +8 -19
- package/web-dist/components/radio/Radio.types-0.d.ts +1 -1
- package/web-dist/components/radio-group/RadioGroup.dependency-0.d.ts +1 -1
- package/web-dist/components/radio-group/RadioGroup.dependency-2.d.ts +1 -1
- package/web-dist/components/radio-group/RadioGroup.js +8 -19
- package/web-dist/components/radio-group/RadioGroup.types-0.d.ts +1 -1
- package/web-dist/components/rating/Rating.dependency-0.d.ts +1 -1
- package/web-dist/components/rating/Rating.dependency-2.d.ts +1 -1
- package/web-dist/components/rating/Rating.dependency-3.d.ts +1 -1
- package/web-dist/components/rating/Rating.js +7 -13
- package/web-dist/components/reader/Reader.dependency-0.d.ts +1 -1
- package/web-dist/components/reader/Reader.js +25 -45
- package/web-dist/components/rich-text/RichText.dependency-0.d.ts +1 -1
- package/web-dist/components/rich-text/RichText.js +5 -6
- package/web-dist/components/scan-overlay/ScanOverlay.dependency-0.d.ts +1 -1
- package/web-dist/components/scan-overlay/ScanOverlay.js +13 -25
- package/web-dist/components/screen/Screen.dependency-0.d.ts +1 -1
- package/web-dist/components/screen/Screen.js +3 -8
- package/web-dist/components/screen-section/ScreenSection.dependency-0.d.ts +1 -1
- package/web-dist/components/screen-section/ScreenSection.js +7 -12
- package/web-dist/components/scroll-view/ScrollView.dependency-0.d.ts +1 -1
- package/web-dist/components/scroll-view/ScrollView.js +3 -8
- package/web-dist/components/scroll-view/ScrollView.types-0.d.ts +1 -1
- package/web-dist/components/search-input/SearchInput.dependency-0.d.ts +1 -1
- package/web-dist/components/search-input/SearchInput.dependency-2.d.ts +1 -1
- package/web-dist/components/search-input/SearchInput.js +8 -18
- package/web-dist/components/section-header/SectionHeader.dependency-0.d.ts +1 -1
- package/web-dist/components/section-header/SectionHeader.js +7 -12
- package/web-dist/components/section-list/SectionList.dependency-0.d.ts +1 -1
- package/web-dist/components/section-list/SectionList.js +8 -17
- package/web-dist/components/select/Select.dependency-0.d.ts +1 -1
- package/web-dist/components/select/Select.dependency-2.d.ts +1 -1
- package/web-dist/components/select/Select.js +13 -28
- package/web-dist/components/select/Select.types-0.d.ts +1 -1
- package/web-dist/components/selectable-item/SelectableItem.dependency-0.d.ts +1 -1
- package/web-dist/components/selectable-item/SelectableItem.js +3 -5
- package/web-dist/components/selectable-item/SelectableItem.types-0.d.ts +1 -1
- package/web-dist/components/selection-provider/SelectionProvider.js +3 -5
- package/web-dist/components/selection-provider/SelectionProvider.types-0.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.dependency-0.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.dependency-3.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.dependency-4.d.ts +1 -1
- package/web-dist/components/sign-in-form/SignInForm.js +13 -25
- package/web-dist/components/sign-up-form/SignUpForm.dependency-0.d.ts +1 -1
- package/web-dist/components/sign-up-form/SignUpForm.dependency-3.d.ts +1 -1
- package/web-dist/components/sign-up-form/SignUpForm.dependency-4.d.ts +1 -1
- package/web-dist/components/sign-up-form/SignUpForm.js +13 -25
- package/web-dist/components/skeleton/Skeleton.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton/Skeleton.dependency-2.d.ts +1 -1
- package/web-dist/components/skeleton/Skeleton.js +15 -27
- package/web-dist/components/skeleton-card/SkeletonCard.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton-card/SkeletonCard.js +15 -27
- package/web-dist/components/skeleton-list/SkeletonList.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton-list/SkeletonList.js +15 -27
- package/web-dist/components/skeleton-text/SkeletonText.dependency-0.d.ts +1 -1
- package/web-dist/components/skeleton-text/SkeletonText.dependency-2.d.ts +1 -1
- package/web-dist/components/skeleton-text/SkeletonText.js +15 -27
- package/web-dist/components/spatial-grid/SpatialGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/spatial-grid/SpatialGrid.js +4 -10
- package/web-dist/components/surface/Surface.dependency-0.d.ts +1 -1
- package/web-dist/components/surface/Surface.js +3 -10
- package/web-dist/components/surface/Surface.types-0.d.ts +1 -1
- package/web-dist/components/switch/Switch.dependency-0.d.ts +1 -1
- package/web-dist/components/switch/Switch.js +7 -121
- package/web-dist/components/switch/Switch.types-0.d.ts +1 -1
- package/web-dist/components/tab/Tab.dependency-0.d.ts +1 -1
- package/web-dist/components/tab/Tab.js +3 -12
- package/web-dist/components/tab/Tab.types-0.d.ts +1 -1
- package/web-dist/components/tab-list/TabList.dependency-0.d.ts +1 -1
- package/web-dist/components/tab-list/TabList.js +3 -12
- package/web-dist/components/tab-list/TabList.types-0.d.ts +1 -1
- package/web-dist/components/tab-panel/TabPanel.dependency-0.d.ts +1 -1
- package/web-dist/components/tab-panel/TabPanel.js +3 -12
- package/web-dist/components/tab-panel/TabPanel.types-0.d.ts +1 -1
- package/web-dist/components/tabletop-table/TabletopTable.dependency-0.d.ts +1 -1
- package/web-dist/components/tabletop-table/TabletopTable.js +5 -6
- package/web-dist/components/tabs/Tabs.dependency-0.d.ts +1 -1
- package/web-dist/components/tabs/Tabs.js +3 -12
- package/web-dist/components/tabs/Tabs.types-0.d.ts +1 -1
- package/web-dist/components/text/Text.dependency-0.d.ts +1 -1
- package/web-dist/components/text/Text.dependency-2.d.ts +1 -1
- package/web-dist/components/text/Text.js +7 -10
- package/web-dist/components/text/Text.types-0.d.ts +1 -1
- package/web-dist/components/text-input/TextInput.dependency-0.d.ts +1 -1
- package/web-dist/components/text-input/TextInput.dependency-2.d.ts +1 -1
- package/web-dist/components/text-input/TextInput.js +9 -19
- package/web-dist/components/text-input/TextInput.types-0.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-0.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-2.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-3.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-4.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.dependency-5.d.ts +1 -1
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +8 -18
- package/web-dist/components/tile-grid/TileGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/tile-grid/TileGrid.js +1 -2
- package/web-dist/components/time-grid/TimeGrid.dependency-0.d.ts +1 -1
- package/web-dist/components/time-grid/TimeGrid.js +6 -12
- package/web-dist/components/time-picker/TimePicker.dependency-0.d.ts +1 -1
- package/web-dist/components/time-picker/TimePicker.js +18 -39
- package/web-dist/components/timeline/Timeline.dependency-0.d.ts +1 -1
- package/web-dist/components/timeline/Timeline.dependency-2.d.ts +1 -1
- package/web-dist/components/timeline/Timeline.dependency-4.d.ts +1 -1
- package/web-dist/components/timeline/Timeline.js +15 -21
- package/web-dist/components/timeline/Timeline.types-0.d.ts +1 -1
- package/web-dist/components/toast/Toast.dependency-0.d.ts +1 -1
- package/web-dist/components/toast/Toast.js +3 -14
- package/web-dist/components/toast/Toast.types-0.d.ts +1 -1
- package/web-dist/components/toast-provider/ToastProvider.js +3 -14
- package/web-dist/components/toast-provider/ToastProvider.types-0.d.ts +1 -1
- package/web-dist/components/toolbar/Toolbar.dependency-0.d.ts +1 -1
- package/web-dist/components/toolbar/Toolbar.js +13 -25
- package/web-dist/components/tree-item/TreeItem.dependency-0.d.ts +1 -1
- package/web-dist/components/tree-item/TreeItem.js +16 -32
- package/web-dist/components/tree-item/TreeItem.types-0.d.ts +1 -1
- package/web-dist/components/tree-view/TreeView.js +1 -1
- package/web-dist/components/uploader/Uploader.dependency-0.d.ts +1 -1
- package/web-dist/components/uploader/Uploader.js +28 -44
- package/web-dist/components/video/Video.dependency-0.d.ts +1 -1
- package/web-dist/components/video/Video.dependency-2.d.ts +1 -1
- package/web-dist/components/video/Video.js +11 -17
- package/web-dist/components/view/View.dependency-0.d.ts +1 -1
- package/web-dist/components/view/View.js +3 -8
- package/web-dist/components/view/View.types-0.d.ts +1 -1
- package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -8
- package/web-dist/manifest.json +1104 -2714
- package/web-dist/runtime/ZoraProvider.js +19 -178
- package/web-dist/chunks/Accordion-0dj1r7w3.js +0 -13528
- package/web-dist/chunks/Accordion-224snqz3.js +0 -89
- package/web-dist/chunks/Accordion-23k6n6zk.js +0 -278
- package/web-dist/chunks/Accordion-2yat0x6x.js +0 -188
- package/web-dist/chunks/Accordion-4mg3epm9.js +0 -405
- package/web-dist/chunks/Accordion-4qrva6ye.js +0 -15
- package/web-dist/chunks/Accordion-4yrszsvs.js +0 -273
- package/web-dist/chunks/Accordion-5z75befg.js +0 -69
- package/web-dist/chunks/Accordion-61e19g3e.js +0 -1
- package/web-dist/chunks/Accordion-6a2hscrx.js +0 -50
- package/web-dist/chunks/Accordion-6zb9d92y.js +0 -87
- package/web-dist/chunks/Accordion-76b0qz8y.js +0 -41
- package/web-dist/chunks/Accordion-7nn4r909.js +0 -81
- package/web-dist/chunks/Accordion-7v6mrp8n.js +0 -311
- package/web-dist/chunks/Accordion-9b4bsxwe.js +0 -46
- package/web-dist/chunks/Accordion-9tgvr155.js +0 -9575
- package/web-dist/chunks/Accordion-a5fsrv3x.js +0 -198
- package/web-dist/chunks/Accordion-akwd4brm.js +0 -397
- package/web-dist/chunks/Accordion-c6edgxay.js +0 -1
- package/web-dist/chunks/Accordion-chdbfcm6.js +0 -93
- package/web-dist/chunks/Accordion-eqvdv7tt.js +0 -1
- package/web-dist/chunks/Accordion-fre84yaq.js +0 -12
- package/web-dist/chunks/Accordion-j1zerr6z.js +0 -389
- package/web-dist/chunks/Accordion-khfjh10v.js +0 -82
- package/web-dist/chunks/Accordion-ktscjwa2.js +0 -213
- package/web-dist/chunks/Accordion-mnac2z83.js +0 -21
- package/web-dist/chunks/Accordion-mnxf855g.js +0 -121
- package/web-dist/chunks/Accordion-mrstcjcm.js +0 -28
- package/web-dist/chunks/Accordion-mx7nkg85.js +0 -34
- package/web-dist/chunks/Accordion-pdjhezmz.js +0 -43
- package/web-dist/chunks/Accordion-q8a423pk.js +0 -379
- package/web-dist/chunks/Accordion-qjxbf8nt.js +0 -150
- package/web-dist/chunks/Accordion-sfvqf4fz.js +0 -1299
- package/web-dist/chunks/Accordion-sj30964p.js +0 -1350
- package/web-dist/chunks/Accordion-vx8bjm5k.js +0 -263
- package/web-dist/chunks/Accordion-wgc67k1g.js +0 -93
- package/web-dist/chunks/Accordion-ww4f12ty.js +0 -200
- package/web-dist/chunks/Accordion-xgpzh4wq.js +0 -18061
- package/web-dist/chunks/Accordion-xhxv2v0g.js +0 -196
|
@@ -0,0 +1,4721 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
converter_default,
|
|
4
|
+
formatHex,
|
|
5
|
+
normalizeHueDegrees,
|
|
6
|
+
parseHexToOklch,
|
|
7
|
+
oklchToHex,
|
|
8
|
+
deltaEoklch
|
|
9
|
+
} from "./Accordion-cwx73cjc.js";
|
|
10
|
+
import {
|
|
11
|
+
withZoraThemeScope
|
|
12
|
+
} from "./Accordion-zhgty1ae.js";
|
|
13
|
+
import {
|
|
14
|
+
View2,
|
|
15
|
+
Divider2
|
|
16
|
+
} from "./Accordion-xfwdh07r.js";
|
|
17
|
+
import {
|
|
18
|
+
useZoraTheme2
|
|
19
|
+
} from "./Accordion-x1ze1wvk.js";
|
|
20
|
+
import {
|
|
21
|
+
Heading2,
|
|
22
|
+
Text2
|
|
23
|
+
} from "./Accordion-6gc0jw1n.js";
|
|
24
|
+
import {
|
|
25
|
+
IconButton2
|
|
26
|
+
} from "./Accordion-jf0vrgw4.js";
|
|
27
|
+
import {
|
|
28
|
+
Card2
|
|
29
|
+
} from "./Accordion-enfevvwv.js";
|
|
30
|
+
import {
|
|
31
|
+
Icon2
|
|
32
|
+
} from "./Accordion-t9w365ke.js";
|
|
33
|
+
import {
|
|
34
|
+
Select2
|
|
35
|
+
} from "./Accordion-sam71gw6.js";
|
|
36
|
+
import {
|
|
37
|
+
Gradient2
|
|
38
|
+
} from "./Accordion-a6a0za8s.js";
|
|
39
|
+
import {
|
|
40
|
+
require_registry
|
|
41
|
+
} from "./Accordion-2ej7s27r.js";
|
|
42
|
+
import {
|
|
43
|
+
isHexColor,
|
|
44
|
+
parseHexColorOrThrow
|
|
45
|
+
} from "./Accordion-fsdgssfq.js";
|
|
46
|
+
import {
|
|
47
|
+
__toESM,
|
|
48
|
+
__commonJS
|
|
49
|
+
} from "./Accordion-0g45tq8n.js";
|
|
50
|
+
|
|
51
|
+
// node_modules/react-native-svg/lib/module/lib/extract/transform.js
|
|
52
|
+
var require_transform = __commonJS(function(exports, module) {
|
|
53
|
+
function peg$subclass(child, parent) {
|
|
54
|
+
function ctor() {
|
|
55
|
+
this.constructor = child;
|
|
56
|
+
}
|
|
57
|
+
ctor.prototype = parent.prototype;
|
|
58
|
+
child.prototype = new ctor;
|
|
59
|
+
}
|
|
60
|
+
function peg$SyntaxError(message, expected, found, location) {
|
|
61
|
+
this.message = message;
|
|
62
|
+
this.expected = expected;
|
|
63
|
+
this.found = found;
|
|
64
|
+
this.location = location;
|
|
65
|
+
this.name = "SyntaxError";
|
|
66
|
+
if (typeof Error.captureStackTrace === "function") {
|
|
67
|
+
Error.captureStackTrace(this, peg$SyntaxError);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
peg$subclass(peg$SyntaxError, Error);
|
|
71
|
+
peg$SyntaxError.buildMessage = function(expected, found) {
|
|
72
|
+
var DESCRIBE_EXPECTATION_FNS = {
|
|
73
|
+
literal: function(expectation) {
|
|
74
|
+
return '"' + literalEscape(expectation.text) + '"';
|
|
75
|
+
},
|
|
76
|
+
class: function(expectation) {
|
|
77
|
+
var escapedParts = "", i;
|
|
78
|
+
for (i = 0;i < expectation.parts.length; i++) {
|
|
79
|
+
escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
|
|
80
|
+
}
|
|
81
|
+
return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
|
|
82
|
+
},
|
|
83
|
+
any: function(expectation) {
|
|
84
|
+
return "any character";
|
|
85
|
+
},
|
|
86
|
+
end: function(expectation) {
|
|
87
|
+
return "end of input";
|
|
88
|
+
},
|
|
89
|
+
other: function(expectation) {
|
|
90
|
+
return expectation.description;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
function hex(ch) {
|
|
94
|
+
return ch.charCodeAt(0).toString(16).toUpperCase();
|
|
95
|
+
}
|
|
96
|
+
function literalEscape(s) {
|
|
97
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
|
|
98
|
+
return "\\x0" + hex(ch);
|
|
99
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
|
|
100
|
+
return "\\x" + hex(ch);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function classEscape(s) {
|
|
104
|
+
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
|
|
105
|
+
return "\\x0" + hex(ch);
|
|
106
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
|
|
107
|
+
return "\\x" + hex(ch);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function describeExpectation(expectation) {
|
|
111
|
+
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
|
|
112
|
+
}
|
|
113
|
+
function describeExpected(expected) {
|
|
114
|
+
var descriptions = new Array(expected.length), i, j;
|
|
115
|
+
for (i = 0;i < expected.length; i++) {
|
|
116
|
+
descriptions[i] = describeExpectation(expected[i]);
|
|
117
|
+
}
|
|
118
|
+
descriptions.sort();
|
|
119
|
+
if (descriptions.length > 0) {
|
|
120
|
+
for (i = 1, j = 1;i < descriptions.length; i++) {
|
|
121
|
+
if (descriptions[i - 1] !== descriptions[i]) {
|
|
122
|
+
descriptions[j] = descriptions[i];
|
|
123
|
+
j++;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
descriptions.length = j;
|
|
127
|
+
}
|
|
128
|
+
switch (descriptions.length) {
|
|
129
|
+
case 1:
|
|
130
|
+
return descriptions[0];
|
|
131
|
+
case 2:
|
|
132
|
+
return descriptions[0] + " or " + descriptions[1];
|
|
133
|
+
default:
|
|
134
|
+
return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function describeFound(found) {
|
|
138
|
+
return found ? '"' + literalEscape(found) + '"' : "end of input";
|
|
139
|
+
}
|
|
140
|
+
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|
141
|
+
};
|
|
142
|
+
function peg$parse(input, options) {
|
|
143
|
+
options = options !== undefined ? options : {};
|
|
144
|
+
var peg$FAILED = {}, peg$startRuleFunctions = {
|
|
145
|
+
transformList: peg$parsetransformList
|
|
146
|
+
}, peg$startRuleFunction = peg$parsetransformList, peg$c0 = function(ts) {
|
|
147
|
+
return ts;
|
|
148
|
+
}, peg$c1 = function(t, ts) {
|
|
149
|
+
return multiply_matrices(t, ts);
|
|
150
|
+
}, peg$c2 = "matrix", peg$c3 = peg$literalExpectation("matrix", false), peg$c4 = "(", peg$c5 = peg$literalExpectation("(", false), peg$c6 = ")", peg$c7 = peg$literalExpectation(")", false), peg$c8 = function(a, b, c, d, e, f) {
|
|
151
|
+
return [a, c, e, b, d, f];
|
|
152
|
+
}, peg$c9 = "translate", peg$c10 = peg$literalExpectation("translate", false), peg$c11 = function(tx, ty) {
|
|
153
|
+
return [1, 0, tx, 0, 1, ty || 0];
|
|
154
|
+
}, peg$c12 = "scale", peg$c13 = peg$literalExpectation("scale", false), peg$c14 = function(sx, sy) {
|
|
155
|
+
return [sx, 0, 0, 0, sy === null ? sx : sy, 0];
|
|
156
|
+
}, peg$c15 = "rotate", peg$c16 = peg$literalExpectation("rotate", false), peg$c17 = function(angle, c) {
|
|
157
|
+
var cos = Math.cos(deg2rad * angle);
|
|
158
|
+
var sin = Math.sin(deg2rad * angle);
|
|
159
|
+
if (c !== null) {
|
|
160
|
+
var x = c[0];
|
|
161
|
+
var y = c[1];
|
|
162
|
+
return [cos, -sin, cos * -x + -sin * -y + x, sin, cos, sin * -x + cos * -y + y];
|
|
163
|
+
}
|
|
164
|
+
return [cos, -sin, 0, sin, cos, 0];
|
|
165
|
+
}, peg$c18 = "skewX", peg$c19 = peg$literalExpectation("skewX", false), peg$c20 = function(angle) {
|
|
166
|
+
return [1, Math.tan(deg2rad * angle), 0, 0, 1, 0];
|
|
167
|
+
}, peg$c21 = "skewY", peg$c22 = peg$literalExpectation("skewY", false), peg$c23 = function(angle) {
|
|
168
|
+
return [1, 0, 0, Math.tan(deg2rad * angle), 1, 0];
|
|
169
|
+
}, peg$c24 = function(f) {
|
|
170
|
+
return parseFloat(f.join(""));
|
|
171
|
+
}, peg$c25 = function(i) {
|
|
172
|
+
return parseInt(i.join(""));
|
|
173
|
+
}, peg$c26 = function(n) {
|
|
174
|
+
return n;
|
|
175
|
+
}, peg$c27 = function(n1, n2) {
|
|
176
|
+
return [n1, n2];
|
|
177
|
+
}, peg$c28 = ",", peg$c29 = peg$literalExpectation(",", false), peg$c30 = function(ds) {
|
|
178
|
+
return ds.join("");
|
|
179
|
+
}, peg$c31 = function(f) {
|
|
180
|
+
return f.join("");
|
|
181
|
+
}, peg$c32 = function(d) {
|
|
182
|
+
return d.join("");
|
|
183
|
+
}, peg$c33 = peg$otherExpectation("fractionalConstant"), peg$c34 = ".", peg$c35 = peg$literalExpectation(".", false), peg$c36 = function(d1, d2) {
|
|
184
|
+
return [d1 ? d1.join("") : null, ".", d2.join("")].join("");
|
|
185
|
+
}, peg$c37 = /^[eE]/, peg$c38 = peg$classExpectation(["e", "E"], false, false), peg$c39 = function(e) {
|
|
186
|
+
return [e[0], e[1], e[2].join("")].join("");
|
|
187
|
+
}, peg$c40 = /^[+\-]/, peg$c41 = peg$classExpectation(["+", "-"], false, false), peg$c42 = /^[0-9]/, peg$c43 = peg$classExpectation([["0", "9"]], false, false), peg$c44 = /^[ \t\r\n]/, peg$c45 = peg$classExpectation([" ", "\t", "\r", `
|
|
188
|
+
`], false, false), peg$currPos = 0, peg$savedPos = 0, peg$posDetailsCache = [{
|
|
189
|
+
line: 1,
|
|
190
|
+
column: 1
|
|
191
|
+
}], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result;
|
|
192
|
+
if ("startRule" in options) {
|
|
193
|
+
if (!(options.startRule in peg$startRuleFunctions)) {
|
|
194
|
+
throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
|
|
195
|
+
}
|
|
196
|
+
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
197
|
+
}
|
|
198
|
+
function text() {
|
|
199
|
+
return input.substring(peg$savedPos, peg$currPos);
|
|
200
|
+
}
|
|
201
|
+
function location() {
|
|
202
|
+
return peg$computeLocation(peg$savedPos, peg$currPos);
|
|
203
|
+
}
|
|
204
|
+
function expected(description, location) {
|
|
205
|
+
location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
|
|
206
|
+
throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
|
|
207
|
+
}
|
|
208
|
+
function error(message, location) {
|
|
209
|
+
location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
|
|
210
|
+
throw peg$buildSimpleError(message, location);
|
|
211
|
+
}
|
|
212
|
+
function peg$literalExpectation(text, ignoreCase) {
|
|
213
|
+
return {
|
|
214
|
+
type: "literal",
|
|
215
|
+
text,
|
|
216
|
+
ignoreCase
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function peg$classExpectation(parts, inverted, ignoreCase) {
|
|
220
|
+
return {
|
|
221
|
+
type: "class",
|
|
222
|
+
parts,
|
|
223
|
+
inverted,
|
|
224
|
+
ignoreCase
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function peg$anyExpectation() {
|
|
228
|
+
return {
|
|
229
|
+
type: "any"
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function peg$endExpectation() {
|
|
233
|
+
return {
|
|
234
|
+
type: "end"
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function peg$otherExpectation(description) {
|
|
238
|
+
return {
|
|
239
|
+
type: "other",
|
|
240
|
+
description
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function peg$computePosDetails(pos) {
|
|
244
|
+
var details = peg$posDetailsCache[pos], p;
|
|
245
|
+
if (details) {
|
|
246
|
+
return details;
|
|
247
|
+
} else {
|
|
248
|
+
p = pos - 1;
|
|
249
|
+
while (!peg$posDetailsCache[p]) {
|
|
250
|
+
p--;
|
|
251
|
+
}
|
|
252
|
+
details = peg$posDetailsCache[p];
|
|
253
|
+
details = {
|
|
254
|
+
line: details.line,
|
|
255
|
+
column: details.column
|
|
256
|
+
};
|
|
257
|
+
while (p < pos) {
|
|
258
|
+
if (input.charCodeAt(p) === 10) {
|
|
259
|
+
details.line++;
|
|
260
|
+
details.column = 1;
|
|
261
|
+
} else {
|
|
262
|
+
details.column++;
|
|
263
|
+
}
|
|
264
|
+
p++;
|
|
265
|
+
}
|
|
266
|
+
peg$posDetailsCache[pos] = details;
|
|
267
|
+
return details;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function peg$computeLocation(startPos, endPos) {
|
|
271
|
+
var startPosDetails = peg$computePosDetails(startPos), endPosDetails = peg$computePosDetails(endPos);
|
|
272
|
+
return {
|
|
273
|
+
start: {
|
|
274
|
+
offset: startPos,
|
|
275
|
+
line: startPosDetails.line,
|
|
276
|
+
column: startPosDetails.column
|
|
277
|
+
},
|
|
278
|
+
end: {
|
|
279
|
+
offset: endPos,
|
|
280
|
+
line: endPosDetails.line,
|
|
281
|
+
column: endPosDetails.column
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function peg$fail(expected) {
|
|
286
|
+
if (peg$currPos < peg$maxFailPos) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (peg$currPos > peg$maxFailPos) {
|
|
290
|
+
peg$maxFailPos = peg$currPos;
|
|
291
|
+
peg$maxFailExpected = [];
|
|
292
|
+
}
|
|
293
|
+
peg$maxFailExpected.push(expected);
|
|
294
|
+
}
|
|
295
|
+
function peg$buildSimpleError(message, location) {
|
|
296
|
+
return new peg$SyntaxError(message, null, null, location);
|
|
297
|
+
}
|
|
298
|
+
function peg$buildStructuredError(expected, found, location) {
|
|
299
|
+
return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
|
|
300
|
+
}
|
|
301
|
+
function peg$parsetransformList() {
|
|
302
|
+
var s0, s1, s2, s3, s4;
|
|
303
|
+
s0 = peg$currPos;
|
|
304
|
+
s1 = [];
|
|
305
|
+
s2 = peg$parsewsp();
|
|
306
|
+
while (s2 !== peg$FAILED) {
|
|
307
|
+
s1.push(s2);
|
|
308
|
+
s2 = peg$parsewsp();
|
|
309
|
+
}
|
|
310
|
+
if (s1 !== peg$FAILED) {
|
|
311
|
+
s2 = peg$parsetransforms();
|
|
312
|
+
if (s2 === peg$FAILED) {
|
|
313
|
+
s2 = null;
|
|
314
|
+
}
|
|
315
|
+
if (s2 !== peg$FAILED) {
|
|
316
|
+
s3 = [];
|
|
317
|
+
s4 = peg$parsewsp();
|
|
318
|
+
while (s4 !== peg$FAILED) {
|
|
319
|
+
s3.push(s4);
|
|
320
|
+
s4 = peg$parsewsp();
|
|
321
|
+
}
|
|
322
|
+
if (s3 !== peg$FAILED) {
|
|
323
|
+
peg$savedPos = s0;
|
|
324
|
+
s1 = peg$c0(s2);
|
|
325
|
+
s0 = s1;
|
|
326
|
+
} else {
|
|
327
|
+
peg$currPos = s0;
|
|
328
|
+
s0 = peg$FAILED;
|
|
329
|
+
}
|
|
330
|
+
} else {
|
|
331
|
+
peg$currPos = s0;
|
|
332
|
+
s0 = peg$FAILED;
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
peg$currPos = s0;
|
|
336
|
+
s0 = peg$FAILED;
|
|
337
|
+
}
|
|
338
|
+
return s0;
|
|
339
|
+
}
|
|
340
|
+
function peg$parsetransforms() {
|
|
341
|
+
var s0, s1, s2, s3;
|
|
342
|
+
s0 = peg$currPos;
|
|
343
|
+
s1 = peg$parsetransform();
|
|
344
|
+
if (s1 !== peg$FAILED) {
|
|
345
|
+
s2 = [];
|
|
346
|
+
s3 = peg$parsecommaWsp();
|
|
347
|
+
while (s3 !== peg$FAILED) {
|
|
348
|
+
s2.push(s3);
|
|
349
|
+
s3 = peg$parsecommaWsp();
|
|
350
|
+
}
|
|
351
|
+
if (s2 !== peg$FAILED) {
|
|
352
|
+
s3 = peg$parsetransforms();
|
|
353
|
+
if (s3 !== peg$FAILED) {
|
|
354
|
+
peg$savedPos = s0;
|
|
355
|
+
s1 = peg$c1(s1, s3);
|
|
356
|
+
s0 = s1;
|
|
357
|
+
} else {
|
|
358
|
+
peg$currPos = s0;
|
|
359
|
+
s0 = peg$FAILED;
|
|
360
|
+
}
|
|
361
|
+
} else {
|
|
362
|
+
peg$currPos = s0;
|
|
363
|
+
s0 = peg$FAILED;
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
peg$currPos = s0;
|
|
367
|
+
s0 = peg$FAILED;
|
|
368
|
+
}
|
|
369
|
+
if (s0 === peg$FAILED) {
|
|
370
|
+
s0 = peg$parsetransform();
|
|
371
|
+
}
|
|
372
|
+
return s0;
|
|
373
|
+
}
|
|
374
|
+
function peg$parsetransform() {
|
|
375
|
+
var s0;
|
|
376
|
+
s0 = peg$parsematrix();
|
|
377
|
+
if (s0 === peg$FAILED) {
|
|
378
|
+
s0 = peg$parsetranslate();
|
|
379
|
+
if (s0 === peg$FAILED) {
|
|
380
|
+
s0 = peg$parsescale();
|
|
381
|
+
if (s0 === peg$FAILED) {
|
|
382
|
+
s0 = peg$parserotate();
|
|
383
|
+
if (s0 === peg$FAILED) {
|
|
384
|
+
s0 = peg$parseskewX();
|
|
385
|
+
if (s0 === peg$FAILED) {
|
|
386
|
+
s0 = peg$parseskewY();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return s0;
|
|
393
|
+
}
|
|
394
|
+
function peg$parsematrix() {
|
|
395
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17;
|
|
396
|
+
s0 = peg$currPos;
|
|
397
|
+
if (input.substr(peg$currPos, 6) === peg$c2) {
|
|
398
|
+
s1 = peg$c2;
|
|
399
|
+
peg$currPos += 6;
|
|
400
|
+
} else {
|
|
401
|
+
s1 = peg$FAILED;
|
|
402
|
+
if (peg$silentFails === 0) {
|
|
403
|
+
peg$fail(peg$c3);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (s1 !== peg$FAILED) {
|
|
407
|
+
s2 = [];
|
|
408
|
+
s3 = peg$parsewsp();
|
|
409
|
+
while (s3 !== peg$FAILED) {
|
|
410
|
+
s2.push(s3);
|
|
411
|
+
s3 = peg$parsewsp();
|
|
412
|
+
}
|
|
413
|
+
if (s2 !== peg$FAILED) {
|
|
414
|
+
if (input.charCodeAt(peg$currPos) === 40) {
|
|
415
|
+
s3 = peg$c4;
|
|
416
|
+
peg$currPos++;
|
|
417
|
+
} else {
|
|
418
|
+
s3 = peg$FAILED;
|
|
419
|
+
if (peg$silentFails === 0) {
|
|
420
|
+
peg$fail(peg$c5);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (s3 !== peg$FAILED) {
|
|
424
|
+
s4 = [];
|
|
425
|
+
s5 = peg$parsewsp();
|
|
426
|
+
while (s5 !== peg$FAILED) {
|
|
427
|
+
s4.push(s5);
|
|
428
|
+
s5 = peg$parsewsp();
|
|
429
|
+
}
|
|
430
|
+
if (s4 !== peg$FAILED) {
|
|
431
|
+
s5 = peg$parsenumber();
|
|
432
|
+
if (s5 !== peg$FAILED) {
|
|
433
|
+
s6 = peg$parsecommaWsp();
|
|
434
|
+
if (s6 !== peg$FAILED) {
|
|
435
|
+
s7 = peg$parsenumber();
|
|
436
|
+
if (s7 !== peg$FAILED) {
|
|
437
|
+
s8 = peg$parsecommaWsp();
|
|
438
|
+
if (s8 !== peg$FAILED) {
|
|
439
|
+
s9 = peg$parsenumber();
|
|
440
|
+
if (s9 !== peg$FAILED) {
|
|
441
|
+
s10 = peg$parsecommaWsp();
|
|
442
|
+
if (s10 !== peg$FAILED) {
|
|
443
|
+
s11 = peg$parsenumber();
|
|
444
|
+
if (s11 !== peg$FAILED) {
|
|
445
|
+
s12 = peg$parsecommaWsp();
|
|
446
|
+
if (s12 !== peg$FAILED) {
|
|
447
|
+
s13 = peg$parsenumber();
|
|
448
|
+
if (s13 !== peg$FAILED) {
|
|
449
|
+
s14 = peg$parsecommaWsp();
|
|
450
|
+
if (s14 !== peg$FAILED) {
|
|
451
|
+
s15 = peg$parsenumber();
|
|
452
|
+
if (s15 !== peg$FAILED) {
|
|
453
|
+
s16 = [];
|
|
454
|
+
s17 = peg$parsewsp();
|
|
455
|
+
while (s17 !== peg$FAILED) {
|
|
456
|
+
s16.push(s17);
|
|
457
|
+
s17 = peg$parsewsp();
|
|
458
|
+
}
|
|
459
|
+
if (s16 !== peg$FAILED) {
|
|
460
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
461
|
+
s17 = peg$c6;
|
|
462
|
+
peg$currPos++;
|
|
463
|
+
} else {
|
|
464
|
+
s17 = peg$FAILED;
|
|
465
|
+
if (peg$silentFails === 0) {
|
|
466
|
+
peg$fail(peg$c7);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (s17 !== peg$FAILED) {
|
|
470
|
+
peg$savedPos = s0;
|
|
471
|
+
s1 = peg$c8(s5, s7, s9, s11, s13, s15);
|
|
472
|
+
s0 = s1;
|
|
473
|
+
} else {
|
|
474
|
+
peg$currPos = s0;
|
|
475
|
+
s0 = peg$FAILED;
|
|
476
|
+
}
|
|
477
|
+
} else {
|
|
478
|
+
peg$currPos = s0;
|
|
479
|
+
s0 = peg$FAILED;
|
|
480
|
+
}
|
|
481
|
+
} else {
|
|
482
|
+
peg$currPos = s0;
|
|
483
|
+
s0 = peg$FAILED;
|
|
484
|
+
}
|
|
485
|
+
} else {
|
|
486
|
+
peg$currPos = s0;
|
|
487
|
+
s0 = peg$FAILED;
|
|
488
|
+
}
|
|
489
|
+
} else {
|
|
490
|
+
peg$currPos = s0;
|
|
491
|
+
s0 = peg$FAILED;
|
|
492
|
+
}
|
|
493
|
+
} else {
|
|
494
|
+
peg$currPos = s0;
|
|
495
|
+
s0 = peg$FAILED;
|
|
496
|
+
}
|
|
497
|
+
} else {
|
|
498
|
+
peg$currPos = s0;
|
|
499
|
+
s0 = peg$FAILED;
|
|
500
|
+
}
|
|
501
|
+
} else {
|
|
502
|
+
peg$currPos = s0;
|
|
503
|
+
s0 = peg$FAILED;
|
|
504
|
+
}
|
|
505
|
+
} else {
|
|
506
|
+
peg$currPos = s0;
|
|
507
|
+
s0 = peg$FAILED;
|
|
508
|
+
}
|
|
509
|
+
} else {
|
|
510
|
+
peg$currPos = s0;
|
|
511
|
+
s0 = peg$FAILED;
|
|
512
|
+
}
|
|
513
|
+
} else {
|
|
514
|
+
peg$currPos = s0;
|
|
515
|
+
s0 = peg$FAILED;
|
|
516
|
+
}
|
|
517
|
+
} else {
|
|
518
|
+
peg$currPos = s0;
|
|
519
|
+
s0 = peg$FAILED;
|
|
520
|
+
}
|
|
521
|
+
} else {
|
|
522
|
+
peg$currPos = s0;
|
|
523
|
+
s0 = peg$FAILED;
|
|
524
|
+
}
|
|
525
|
+
} else {
|
|
526
|
+
peg$currPos = s0;
|
|
527
|
+
s0 = peg$FAILED;
|
|
528
|
+
}
|
|
529
|
+
} else {
|
|
530
|
+
peg$currPos = s0;
|
|
531
|
+
s0 = peg$FAILED;
|
|
532
|
+
}
|
|
533
|
+
} else {
|
|
534
|
+
peg$currPos = s0;
|
|
535
|
+
s0 = peg$FAILED;
|
|
536
|
+
}
|
|
537
|
+
} else {
|
|
538
|
+
peg$currPos = s0;
|
|
539
|
+
s0 = peg$FAILED;
|
|
540
|
+
}
|
|
541
|
+
return s0;
|
|
542
|
+
}
|
|
543
|
+
function peg$parsetranslate() {
|
|
544
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
|
545
|
+
s0 = peg$currPos;
|
|
546
|
+
if (input.substr(peg$currPos, 9) === peg$c9) {
|
|
547
|
+
s1 = peg$c9;
|
|
548
|
+
peg$currPos += 9;
|
|
549
|
+
} else {
|
|
550
|
+
s1 = peg$FAILED;
|
|
551
|
+
if (peg$silentFails === 0) {
|
|
552
|
+
peg$fail(peg$c10);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
if (s1 !== peg$FAILED) {
|
|
556
|
+
s2 = [];
|
|
557
|
+
s3 = peg$parsewsp();
|
|
558
|
+
while (s3 !== peg$FAILED) {
|
|
559
|
+
s2.push(s3);
|
|
560
|
+
s3 = peg$parsewsp();
|
|
561
|
+
}
|
|
562
|
+
if (s2 !== peg$FAILED) {
|
|
563
|
+
if (input.charCodeAt(peg$currPos) === 40) {
|
|
564
|
+
s3 = peg$c4;
|
|
565
|
+
peg$currPos++;
|
|
566
|
+
} else {
|
|
567
|
+
s3 = peg$FAILED;
|
|
568
|
+
if (peg$silentFails === 0) {
|
|
569
|
+
peg$fail(peg$c5);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (s3 !== peg$FAILED) {
|
|
573
|
+
s4 = [];
|
|
574
|
+
s5 = peg$parsewsp();
|
|
575
|
+
while (s5 !== peg$FAILED) {
|
|
576
|
+
s4.push(s5);
|
|
577
|
+
s5 = peg$parsewsp();
|
|
578
|
+
}
|
|
579
|
+
if (s4 !== peg$FAILED) {
|
|
580
|
+
s5 = peg$parsenumber();
|
|
581
|
+
if (s5 !== peg$FAILED) {
|
|
582
|
+
s6 = peg$parsecommaWspNumber();
|
|
583
|
+
if (s6 === peg$FAILED) {
|
|
584
|
+
s6 = null;
|
|
585
|
+
}
|
|
586
|
+
if (s6 !== peg$FAILED) {
|
|
587
|
+
s7 = [];
|
|
588
|
+
s8 = peg$parsewsp();
|
|
589
|
+
while (s8 !== peg$FAILED) {
|
|
590
|
+
s7.push(s8);
|
|
591
|
+
s8 = peg$parsewsp();
|
|
592
|
+
}
|
|
593
|
+
if (s7 !== peg$FAILED) {
|
|
594
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
595
|
+
s8 = peg$c6;
|
|
596
|
+
peg$currPos++;
|
|
597
|
+
} else {
|
|
598
|
+
s8 = peg$FAILED;
|
|
599
|
+
if (peg$silentFails === 0) {
|
|
600
|
+
peg$fail(peg$c7);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (s8 !== peg$FAILED) {
|
|
604
|
+
peg$savedPos = s0;
|
|
605
|
+
s1 = peg$c11(s5, s6);
|
|
606
|
+
s0 = s1;
|
|
607
|
+
} else {
|
|
608
|
+
peg$currPos = s0;
|
|
609
|
+
s0 = peg$FAILED;
|
|
610
|
+
}
|
|
611
|
+
} else {
|
|
612
|
+
peg$currPos = s0;
|
|
613
|
+
s0 = peg$FAILED;
|
|
614
|
+
}
|
|
615
|
+
} else {
|
|
616
|
+
peg$currPos = s0;
|
|
617
|
+
s0 = peg$FAILED;
|
|
618
|
+
}
|
|
619
|
+
} else {
|
|
620
|
+
peg$currPos = s0;
|
|
621
|
+
s0 = peg$FAILED;
|
|
622
|
+
}
|
|
623
|
+
} else {
|
|
624
|
+
peg$currPos = s0;
|
|
625
|
+
s0 = peg$FAILED;
|
|
626
|
+
}
|
|
627
|
+
} else {
|
|
628
|
+
peg$currPos = s0;
|
|
629
|
+
s0 = peg$FAILED;
|
|
630
|
+
}
|
|
631
|
+
} else {
|
|
632
|
+
peg$currPos = s0;
|
|
633
|
+
s0 = peg$FAILED;
|
|
634
|
+
}
|
|
635
|
+
} else {
|
|
636
|
+
peg$currPos = s0;
|
|
637
|
+
s0 = peg$FAILED;
|
|
638
|
+
}
|
|
639
|
+
return s0;
|
|
640
|
+
}
|
|
641
|
+
function peg$parsescale() {
|
|
642
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
|
643
|
+
s0 = peg$currPos;
|
|
644
|
+
if (input.substr(peg$currPos, 5) === peg$c12) {
|
|
645
|
+
s1 = peg$c12;
|
|
646
|
+
peg$currPos += 5;
|
|
647
|
+
} else {
|
|
648
|
+
s1 = peg$FAILED;
|
|
649
|
+
if (peg$silentFails === 0) {
|
|
650
|
+
peg$fail(peg$c13);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
if (s1 !== peg$FAILED) {
|
|
654
|
+
s2 = [];
|
|
655
|
+
s3 = peg$parsewsp();
|
|
656
|
+
while (s3 !== peg$FAILED) {
|
|
657
|
+
s2.push(s3);
|
|
658
|
+
s3 = peg$parsewsp();
|
|
659
|
+
}
|
|
660
|
+
if (s2 !== peg$FAILED) {
|
|
661
|
+
if (input.charCodeAt(peg$currPos) === 40) {
|
|
662
|
+
s3 = peg$c4;
|
|
663
|
+
peg$currPos++;
|
|
664
|
+
} else {
|
|
665
|
+
s3 = peg$FAILED;
|
|
666
|
+
if (peg$silentFails === 0) {
|
|
667
|
+
peg$fail(peg$c5);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (s3 !== peg$FAILED) {
|
|
671
|
+
s4 = [];
|
|
672
|
+
s5 = peg$parsewsp();
|
|
673
|
+
while (s5 !== peg$FAILED) {
|
|
674
|
+
s4.push(s5);
|
|
675
|
+
s5 = peg$parsewsp();
|
|
676
|
+
}
|
|
677
|
+
if (s4 !== peg$FAILED) {
|
|
678
|
+
s5 = peg$parsenumber();
|
|
679
|
+
if (s5 !== peg$FAILED) {
|
|
680
|
+
s6 = peg$parsecommaWspNumber();
|
|
681
|
+
if (s6 === peg$FAILED) {
|
|
682
|
+
s6 = null;
|
|
683
|
+
}
|
|
684
|
+
if (s6 !== peg$FAILED) {
|
|
685
|
+
s7 = [];
|
|
686
|
+
s8 = peg$parsewsp();
|
|
687
|
+
while (s8 !== peg$FAILED) {
|
|
688
|
+
s7.push(s8);
|
|
689
|
+
s8 = peg$parsewsp();
|
|
690
|
+
}
|
|
691
|
+
if (s7 !== peg$FAILED) {
|
|
692
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
693
|
+
s8 = peg$c6;
|
|
694
|
+
peg$currPos++;
|
|
695
|
+
} else {
|
|
696
|
+
s8 = peg$FAILED;
|
|
697
|
+
if (peg$silentFails === 0) {
|
|
698
|
+
peg$fail(peg$c7);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
if (s8 !== peg$FAILED) {
|
|
702
|
+
peg$savedPos = s0;
|
|
703
|
+
s1 = peg$c14(s5, s6);
|
|
704
|
+
s0 = s1;
|
|
705
|
+
} else {
|
|
706
|
+
peg$currPos = s0;
|
|
707
|
+
s0 = peg$FAILED;
|
|
708
|
+
}
|
|
709
|
+
} else {
|
|
710
|
+
peg$currPos = s0;
|
|
711
|
+
s0 = peg$FAILED;
|
|
712
|
+
}
|
|
713
|
+
} else {
|
|
714
|
+
peg$currPos = s0;
|
|
715
|
+
s0 = peg$FAILED;
|
|
716
|
+
}
|
|
717
|
+
} else {
|
|
718
|
+
peg$currPos = s0;
|
|
719
|
+
s0 = peg$FAILED;
|
|
720
|
+
}
|
|
721
|
+
} else {
|
|
722
|
+
peg$currPos = s0;
|
|
723
|
+
s0 = peg$FAILED;
|
|
724
|
+
}
|
|
725
|
+
} else {
|
|
726
|
+
peg$currPos = s0;
|
|
727
|
+
s0 = peg$FAILED;
|
|
728
|
+
}
|
|
729
|
+
} else {
|
|
730
|
+
peg$currPos = s0;
|
|
731
|
+
s0 = peg$FAILED;
|
|
732
|
+
}
|
|
733
|
+
} else {
|
|
734
|
+
peg$currPos = s0;
|
|
735
|
+
s0 = peg$FAILED;
|
|
736
|
+
}
|
|
737
|
+
return s0;
|
|
738
|
+
}
|
|
739
|
+
function peg$parserotate() {
|
|
740
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
|
741
|
+
s0 = peg$currPos;
|
|
742
|
+
if (input.substr(peg$currPos, 6) === peg$c15) {
|
|
743
|
+
s1 = peg$c15;
|
|
744
|
+
peg$currPos += 6;
|
|
745
|
+
} else {
|
|
746
|
+
s1 = peg$FAILED;
|
|
747
|
+
if (peg$silentFails === 0) {
|
|
748
|
+
peg$fail(peg$c16);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if (s1 !== peg$FAILED) {
|
|
752
|
+
s2 = [];
|
|
753
|
+
s3 = peg$parsewsp();
|
|
754
|
+
while (s3 !== peg$FAILED) {
|
|
755
|
+
s2.push(s3);
|
|
756
|
+
s3 = peg$parsewsp();
|
|
757
|
+
}
|
|
758
|
+
if (s2 !== peg$FAILED) {
|
|
759
|
+
if (input.charCodeAt(peg$currPos) === 40) {
|
|
760
|
+
s3 = peg$c4;
|
|
761
|
+
peg$currPos++;
|
|
762
|
+
} else {
|
|
763
|
+
s3 = peg$FAILED;
|
|
764
|
+
if (peg$silentFails === 0) {
|
|
765
|
+
peg$fail(peg$c5);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
if (s3 !== peg$FAILED) {
|
|
769
|
+
s4 = [];
|
|
770
|
+
s5 = peg$parsewsp();
|
|
771
|
+
while (s5 !== peg$FAILED) {
|
|
772
|
+
s4.push(s5);
|
|
773
|
+
s5 = peg$parsewsp();
|
|
774
|
+
}
|
|
775
|
+
if (s4 !== peg$FAILED) {
|
|
776
|
+
s5 = peg$parsenumber();
|
|
777
|
+
if (s5 !== peg$FAILED) {
|
|
778
|
+
s6 = peg$parsecommaWspTwoNumbers();
|
|
779
|
+
if (s6 === peg$FAILED) {
|
|
780
|
+
s6 = null;
|
|
781
|
+
}
|
|
782
|
+
if (s6 !== peg$FAILED) {
|
|
783
|
+
s7 = [];
|
|
784
|
+
s8 = peg$parsewsp();
|
|
785
|
+
while (s8 !== peg$FAILED) {
|
|
786
|
+
s7.push(s8);
|
|
787
|
+
s8 = peg$parsewsp();
|
|
788
|
+
}
|
|
789
|
+
if (s7 !== peg$FAILED) {
|
|
790
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
791
|
+
s8 = peg$c6;
|
|
792
|
+
peg$currPos++;
|
|
793
|
+
} else {
|
|
794
|
+
s8 = peg$FAILED;
|
|
795
|
+
if (peg$silentFails === 0) {
|
|
796
|
+
peg$fail(peg$c7);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
if (s8 !== peg$FAILED) {
|
|
800
|
+
peg$savedPos = s0;
|
|
801
|
+
s1 = peg$c17(s5, s6);
|
|
802
|
+
s0 = s1;
|
|
803
|
+
} else {
|
|
804
|
+
peg$currPos = s0;
|
|
805
|
+
s0 = peg$FAILED;
|
|
806
|
+
}
|
|
807
|
+
} else {
|
|
808
|
+
peg$currPos = s0;
|
|
809
|
+
s0 = peg$FAILED;
|
|
810
|
+
}
|
|
811
|
+
} else {
|
|
812
|
+
peg$currPos = s0;
|
|
813
|
+
s0 = peg$FAILED;
|
|
814
|
+
}
|
|
815
|
+
} else {
|
|
816
|
+
peg$currPos = s0;
|
|
817
|
+
s0 = peg$FAILED;
|
|
818
|
+
}
|
|
819
|
+
} else {
|
|
820
|
+
peg$currPos = s0;
|
|
821
|
+
s0 = peg$FAILED;
|
|
822
|
+
}
|
|
823
|
+
} else {
|
|
824
|
+
peg$currPos = s0;
|
|
825
|
+
s0 = peg$FAILED;
|
|
826
|
+
}
|
|
827
|
+
} else {
|
|
828
|
+
peg$currPos = s0;
|
|
829
|
+
s0 = peg$FAILED;
|
|
830
|
+
}
|
|
831
|
+
} else {
|
|
832
|
+
peg$currPos = s0;
|
|
833
|
+
s0 = peg$FAILED;
|
|
834
|
+
}
|
|
835
|
+
return s0;
|
|
836
|
+
}
|
|
837
|
+
function peg$parseskewX() {
|
|
838
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
839
|
+
s0 = peg$currPos;
|
|
840
|
+
if (input.substr(peg$currPos, 5) === peg$c18) {
|
|
841
|
+
s1 = peg$c18;
|
|
842
|
+
peg$currPos += 5;
|
|
843
|
+
} else {
|
|
844
|
+
s1 = peg$FAILED;
|
|
845
|
+
if (peg$silentFails === 0) {
|
|
846
|
+
peg$fail(peg$c19);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
if (s1 !== peg$FAILED) {
|
|
850
|
+
s2 = [];
|
|
851
|
+
s3 = peg$parsewsp();
|
|
852
|
+
while (s3 !== peg$FAILED) {
|
|
853
|
+
s2.push(s3);
|
|
854
|
+
s3 = peg$parsewsp();
|
|
855
|
+
}
|
|
856
|
+
if (s2 !== peg$FAILED) {
|
|
857
|
+
if (input.charCodeAt(peg$currPos) === 40) {
|
|
858
|
+
s3 = peg$c4;
|
|
859
|
+
peg$currPos++;
|
|
860
|
+
} else {
|
|
861
|
+
s3 = peg$FAILED;
|
|
862
|
+
if (peg$silentFails === 0) {
|
|
863
|
+
peg$fail(peg$c5);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
if (s3 !== peg$FAILED) {
|
|
867
|
+
s4 = [];
|
|
868
|
+
s5 = peg$parsewsp();
|
|
869
|
+
while (s5 !== peg$FAILED) {
|
|
870
|
+
s4.push(s5);
|
|
871
|
+
s5 = peg$parsewsp();
|
|
872
|
+
}
|
|
873
|
+
if (s4 !== peg$FAILED) {
|
|
874
|
+
s5 = peg$parsenumber();
|
|
875
|
+
if (s5 !== peg$FAILED) {
|
|
876
|
+
s6 = [];
|
|
877
|
+
s7 = peg$parsewsp();
|
|
878
|
+
while (s7 !== peg$FAILED) {
|
|
879
|
+
s6.push(s7);
|
|
880
|
+
s7 = peg$parsewsp();
|
|
881
|
+
}
|
|
882
|
+
if (s6 !== peg$FAILED) {
|
|
883
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
884
|
+
s7 = peg$c6;
|
|
885
|
+
peg$currPos++;
|
|
886
|
+
} else {
|
|
887
|
+
s7 = peg$FAILED;
|
|
888
|
+
if (peg$silentFails === 0) {
|
|
889
|
+
peg$fail(peg$c7);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (s7 !== peg$FAILED) {
|
|
893
|
+
peg$savedPos = s0;
|
|
894
|
+
s1 = peg$c20(s5);
|
|
895
|
+
s0 = s1;
|
|
896
|
+
} else {
|
|
897
|
+
peg$currPos = s0;
|
|
898
|
+
s0 = peg$FAILED;
|
|
899
|
+
}
|
|
900
|
+
} else {
|
|
901
|
+
peg$currPos = s0;
|
|
902
|
+
s0 = peg$FAILED;
|
|
903
|
+
}
|
|
904
|
+
} else {
|
|
905
|
+
peg$currPos = s0;
|
|
906
|
+
s0 = peg$FAILED;
|
|
907
|
+
}
|
|
908
|
+
} else {
|
|
909
|
+
peg$currPos = s0;
|
|
910
|
+
s0 = peg$FAILED;
|
|
911
|
+
}
|
|
912
|
+
} else {
|
|
913
|
+
peg$currPos = s0;
|
|
914
|
+
s0 = peg$FAILED;
|
|
915
|
+
}
|
|
916
|
+
} else {
|
|
917
|
+
peg$currPos = s0;
|
|
918
|
+
s0 = peg$FAILED;
|
|
919
|
+
}
|
|
920
|
+
} else {
|
|
921
|
+
peg$currPos = s0;
|
|
922
|
+
s0 = peg$FAILED;
|
|
923
|
+
}
|
|
924
|
+
return s0;
|
|
925
|
+
}
|
|
926
|
+
function peg$parseskewY() {
|
|
927
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
928
|
+
s0 = peg$currPos;
|
|
929
|
+
if (input.substr(peg$currPos, 5) === peg$c21) {
|
|
930
|
+
s1 = peg$c21;
|
|
931
|
+
peg$currPos += 5;
|
|
932
|
+
} else {
|
|
933
|
+
s1 = peg$FAILED;
|
|
934
|
+
if (peg$silentFails === 0) {
|
|
935
|
+
peg$fail(peg$c22);
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
if (s1 !== peg$FAILED) {
|
|
939
|
+
s2 = [];
|
|
940
|
+
s3 = peg$parsewsp();
|
|
941
|
+
while (s3 !== peg$FAILED) {
|
|
942
|
+
s2.push(s3);
|
|
943
|
+
s3 = peg$parsewsp();
|
|
944
|
+
}
|
|
945
|
+
if (s2 !== peg$FAILED) {
|
|
946
|
+
if (input.charCodeAt(peg$currPos) === 40) {
|
|
947
|
+
s3 = peg$c4;
|
|
948
|
+
peg$currPos++;
|
|
949
|
+
} else {
|
|
950
|
+
s3 = peg$FAILED;
|
|
951
|
+
if (peg$silentFails === 0) {
|
|
952
|
+
peg$fail(peg$c5);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
if (s3 !== peg$FAILED) {
|
|
956
|
+
s4 = [];
|
|
957
|
+
s5 = peg$parsewsp();
|
|
958
|
+
while (s5 !== peg$FAILED) {
|
|
959
|
+
s4.push(s5);
|
|
960
|
+
s5 = peg$parsewsp();
|
|
961
|
+
}
|
|
962
|
+
if (s4 !== peg$FAILED) {
|
|
963
|
+
s5 = peg$parsenumber();
|
|
964
|
+
if (s5 !== peg$FAILED) {
|
|
965
|
+
s6 = [];
|
|
966
|
+
s7 = peg$parsewsp();
|
|
967
|
+
while (s7 !== peg$FAILED) {
|
|
968
|
+
s6.push(s7);
|
|
969
|
+
s7 = peg$parsewsp();
|
|
970
|
+
}
|
|
971
|
+
if (s6 !== peg$FAILED) {
|
|
972
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
973
|
+
s7 = peg$c6;
|
|
974
|
+
peg$currPos++;
|
|
975
|
+
} else {
|
|
976
|
+
s7 = peg$FAILED;
|
|
977
|
+
if (peg$silentFails === 0) {
|
|
978
|
+
peg$fail(peg$c7);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
if (s7 !== peg$FAILED) {
|
|
982
|
+
peg$savedPos = s0;
|
|
983
|
+
s1 = peg$c23(s5);
|
|
984
|
+
s0 = s1;
|
|
985
|
+
} else {
|
|
986
|
+
peg$currPos = s0;
|
|
987
|
+
s0 = peg$FAILED;
|
|
988
|
+
}
|
|
989
|
+
} else {
|
|
990
|
+
peg$currPos = s0;
|
|
991
|
+
s0 = peg$FAILED;
|
|
992
|
+
}
|
|
993
|
+
} else {
|
|
994
|
+
peg$currPos = s0;
|
|
995
|
+
s0 = peg$FAILED;
|
|
996
|
+
}
|
|
997
|
+
} else {
|
|
998
|
+
peg$currPos = s0;
|
|
999
|
+
s0 = peg$FAILED;
|
|
1000
|
+
}
|
|
1001
|
+
} else {
|
|
1002
|
+
peg$currPos = s0;
|
|
1003
|
+
s0 = peg$FAILED;
|
|
1004
|
+
}
|
|
1005
|
+
} else {
|
|
1006
|
+
peg$currPos = s0;
|
|
1007
|
+
s0 = peg$FAILED;
|
|
1008
|
+
}
|
|
1009
|
+
} else {
|
|
1010
|
+
peg$currPos = s0;
|
|
1011
|
+
s0 = peg$FAILED;
|
|
1012
|
+
}
|
|
1013
|
+
return s0;
|
|
1014
|
+
}
|
|
1015
|
+
function peg$parsenumber() {
|
|
1016
|
+
var s0, s1, s2, s3;
|
|
1017
|
+
s0 = peg$currPos;
|
|
1018
|
+
s1 = peg$currPos;
|
|
1019
|
+
s2 = peg$parsesign();
|
|
1020
|
+
if (s2 === peg$FAILED) {
|
|
1021
|
+
s2 = null;
|
|
1022
|
+
}
|
|
1023
|
+
if (s2 !== peg$FAILED) {
|
|
1024
|
+
s3 = peg$parsefloatingPointConstant();
|
|
1025
|
+
if (s3 !== peg$FAILED) {
|
|
1026
|
+
s2 = [s2, s3];
|
|
1027
|
+
s1 = s2;
|
|
1028
|
+
} else {
|
|
1029
|
+
peg$currPos = s1;
|
|
1030
|
+
s1 = peg$FAILED;
|
|
1031
|
+
}
|
|
1032
|
+
} else {
|
|
1033
|
+
peg$currPos = s1;
|
|
1034
|
+
s1 = peg$FAILED;
|
|
1035
|
+
}
|
|
1036
|
+
if (s1 !== peg$FAILED) {
|
|
1037
|
+
peg$savedPos = s0;
|
|
1038
|
+
s1 = peg$c24(s1);
|
|
1039
|
+
}
|
|
1040
|
+
s0 = s1;
|
|
1041
|
+
if (s0 === peg$FAILED) {
|
|
1042
|
+
s0 = peg$currPos;
|
|
1043
|
+
s1 = peg$currPos;
|
|
1044
|
+
s2 = peg$parsesign();
|
|
1045
|
+
if (s2 === peg$FAILED) {
|
|
1046
|
+
s2 = null;
|
|
1047
|
+
}
|
|
1048
|
+
if (s2 !== peg$FAILED) {
|
|
1049
|
+
s3 = peg$parseintegerConstant();
|
|
1050
|
+
if (s3 !== peg$FAILED) {
|
|
1051
|
+
s2 = [s2, s3];
|
|
1052
|
+
s1 = s2;
|
|
1053
|
+
} else {
|
|
1054
|
+
peg$currPos = s1;
|
|
1055
|
+
s1 = peg$FAILED;
|
|
1056
|
+
}
|
|
1057
|
+
} else {
|
|
1058
|
+
peg$currPos = s1;
|
|
1059
|
+
s1 = peg$FAILED;
|
|
1060
|
+
}
|
|
1061
|
+
if (s1 !== peg$FAILED) {
|
|
1062
|
+
peg$savedPos = s0;
|
|
1063
|
+
s1 = peg$c25(s1);
|
|
1064
|
+
}
|
|
1065
|
+
s0 = s1;
|
|
1066
|
+
}
|
|
1067
|
+
return s0;
|
|
1068
|
+
}
|
|
1069
|
+
function peg$parsecommaWspNumber() {
|
|
1070
|
+
var s0, s1, s2;
|
|
1071
|
+
s0 = peg$currPos;
|
|
1072
|
+
s1 = peg$parsecommaWsp();
|
|
1073
|
+
if (s1 !== peg$FAILED) {
|
|
1074
|
+
s2 = peg$parsenumber();
|
|
1075
|
+
if (s2 !== peg$FAILED) {
|
|
1076
|
+
peg$savedPos = s0;
|
|
1077
|
+
s1 = peg$c26(s2);
|
|
1078
|
+
s0 = s1;
|
|
1079
|
+
} else {
|
|
1080
|
+
peg$currPos = s0;
|
|
1081
|
+
s0 = peg$FAILED;
|
|
1082
|
+
}
|
|
1083
|
+
} else {
|
|
1084
|
+
peg$currPos = s0;
|
|
1085
|
+
s0 = peg$FAILED;
|
|
1086
|
+
}
|
|
1087
|
+
return s0;
|
|
1088
|
+
}
|
|
1089
|
+
function peg$parsecommaWspTwoNumbers() {
|
|
1090
|
+
var s0, s1, s2, s3, s4;
|
|
1091
|
+
s0 = peg$currPos;
|
|
1092
|
+
s1 = peg$parsecommaWsp();
|
|
1093
|
+
if (s1 !== peg$FAILED) {
|
|
1094
|
+
s2 = peg$parsenumber();
|
|
1095
|
+
if (s2 !== peg$FAILED) {
|
|
1096
|
+
s3 = peg$parsecommaWsp();
|
|
1097
|
+
if (s3 !== peg$FAILED) {
|
|
1098
|
+
s4 = peg$parsenumber();
|
|
1099
|
+
if (s4 !== peg$FAILED) {
|
|
1100
|
+
peg$savedPos = s0;
|
|
1101
|
+
s1 = peg$c27(s2, s4);
|
|
1102
|
+
s0 = s1;
|
|
1103
|
+
} else {
|
|
1104
|
+
peg$currPos = s0;
|
|
1105
|
+
s0 = peg$FAILED;
|
|
1106
|
+
}
|
|
1107
|
+
} else {
|
|
1108
|
+
peg$currPos = s0;
|
|
1109
|
+
s0 = peg$FAILED;
|
|
1110
|
+
}
|
|
1111
|
+
} else {
|
|
1112
|
+
peg$currPos = s0;
|
|
1113
|
+
s0 = peg$FAILED;
|
|
1114
|
+
}
|
|
1115
|
+
} else {
|
|
1116
|
+
peg$currPos = s0;
|
|
1117
|
+
s0 = peg$FAILED;
|
|
1118
|
+
}
|
|
1119
|
+
return s0;
|
|
1120
|
+
}
|
|
1121
|
+
function peg$parsecommaWsp() {
|
|
1122
|
+
var s0, s1, s2, s3, s4;
|
|
1123
|
+
s0 = peg$currPos;
|
|
1124
|
+
s1 = [];
|
|
1125
|
+
s2 = peg$parsewsp();
|
|
1126
|
+
if (s2 !== peg$FAILED) {
|
|
1127
|
+
while (s2 !== peg$FAILED) {
|
|
1128
|
+
s1.push(s2);
|
|
1129
|
+
s2 = peg$parsewsp();
|
|
1130
|
+
}
|
|
1131
|
+
} else {
|
|
1132
|
+
s1 = peg$FAILED;
|
|
1133
|
+
}
|
|
1134
|
+
if (s1 !== peg$FAILED) {
|
|
1135
|
+
s2 = peg$parsecomma();
|
|
1136
|
+
if (s2 === peg$FAILED) {
|
|
1137
|
+
s2 = null;
|
|
1138
|
+
}
|
|
1139
|
+
if (s2 !== peg$FAILED) {
|
|
1140
|
+
s3 = [];
|
|
1141
|
+
s4 = peg$parsewsp();
|
|
1142
|
+
while (s4 !== peg$FAILED) {
|
|
1143
|
+
s3.push(s4);
|
|
1144
|
+
s4 = peg$parsewsp();
|
|
1145
|
+
}
|
|
1146
|
+
if (s3 !== peg$FAILED) {
|
|
1147
|
+
s1 = [s1, s2, s3];
|
|
1148
|
+
s0 = s1;
|
|
1149
|
+
} else {
|
|
1150
|
+
peg$currPos = s0;
|
|
1151
|
+
s0 = peg$FAILED;
|
|
1152
|
+
}
|
|
1153
|
+
} else {
|
|
1154
|
+
peg$currPos = s0;
|
|
1155
|
+
s0 = peg$FAILED;
|
|
1156
|
+
}
|
|
1157
|
+
} else {
|
|
1158
|
+
peg$currPos = s0;
|
|
1159
|
+
s0 = peg$FAILED;
|
|
1160
|
+
}
|
|
1161
|
+
if (s0 === peg$FAILED) {
|
|
1162
|
+
s0 = peg$currPos;
|
|
1163
|
+
s1 = peg$parsecomma();
|
|
1164
|
+
if (s1 !== peg$FAILED) {
|
|
1165
|
+
s2 = [];
|
|
1166
|
+
s3 = peg$parsewsp();
|
|
1167
|
+
while (s3 !== peg$FAILED) {
|
|
1168
|
+
s2.push(s3);
|
|
1169
|
+
s3 = peg$parsewsp();
|
|
1170
|
+
}
|
|
1171
|
+
if (s2 !== peg$FAILED) {
|
|
1172
|
+
s1 = [s1, s2];
|
|
1173
|
+
s0 = s1;
|
|
1174
|
+
} else {
|
|
1175
|
+
peg$currPos = s0;
|
|
1176
|
+
s0 = peg$FAILED;
|
|
1177
|
+
}
|
|
1178
|
+
} else {
|
|
1179
|
+
peg$currPos = s0;
|
|
1180
|
+
s0 = peg$FAILED;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
return s0;
|
|
1184
|
+
}
|
|
1185
|
+
function peg$parsecomma() {
|
|
1186
|
+
var s0;
|
|
1187
|
+
if (input.charCodeAt(peg$currPos) === 44) {
|
|
1188
|
+
s0 = peg$c28;
|
|
1189
|
+
peg$currPos++;
|
|
1190
|
+
} else {
|
|
1191
|
+
s0 = peg$FAILED;
|
|
1192
|
+
if (peg$silentFails === 0) {
|
|
1193
|
+
peg$fail(peg$c29);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
return s0;
|
|
1197
|
+
}
|
|
1198
|
+
function peg$parseintegerConstant() {
|
|
1199
|
+
var s0, s1;
|
|
1200
|
+
s0 = peg$currPos;
|
|
1201
|
+
s1 = peg$parsedigitSequence();
|
|
1202
|
+
if (s1 !== peg$FAILED) {
|
|
1203
|
+
peg$savedPos = s0;
|
|
1204
|
+
s1 = peg$c30(s1);
|
|
1205
|
+
}
|
|
1206
|
+
s0 = s1;
|
|
1207
|
+
return s0;
|
|
1208
|
+
}
|
|
1209
|
+
function peg$parsefloatingPointConstant() {
|
|
1210
|
+
var s0, s1, s2, s3;
|
|
1211
|
+
s0 = peg$currPos;
|
|
1212
|
+
s1 = peg$currPos;
|
|
1213
|
+
s2 = peg$parsefractionalConstant();
|
|
1214
|
+
if (s2 !== peg$FAILED) {
|
|
1215
|
+
s3 = peg$parseexponent();
|
|
1216
|
+
if (s3 === peg$FAILED) {
|
|
1217
|
+
s3 = null;
|
|
1218
|
+
}
|
|
1219
|
+
if (s3 !== peg$FAILED) {
|
|
1220
|
+
s2 = [s2, s3];
|
|
1221
|
+
s1 = s2;
|
|
1222
|
+
} else {
|
|
1223
|
+
peg$currPos = s1;
|
|
1224
|
+
s1 = peg$FAILED;
|
|
1225
|
+
}
|
|
1226
|
+
} else {
|
|
1227
|
+
peg$currPos = s1;
|
|
1228
|
+
s1 = peg$FAILED;
|
|
1229
|
+
}
|
|
1230
|
+
if (s1 !== peg$FAILED) {
|
|
1231
|
+
peg$savedPos = s0;
|
|
1232
|
+
s1 = peg$c31(s1);
|
|
1233
|
+
}
|
|
1234
|
+
s0 = s1;
|
|
1235
|
+
if (s0 === peg$FAILED) {
|
|
1236
|
+
s0 = peg$currPos;
|
|
1237
|
+
s1 = peg$currPos;
|
|
1238
|
+
s2 = peg$parsedigitSequence();
|
|
1239
|
+
if (s2 !== peg$FAILED) {
|
|
1240
|
+
s3 = peg$parseexponent();
|
|
1241
|
+
if (s3 !== peg$FAILED) {
|
|
1242
|
+
s2 = [s2, s3];
|
|
1243
|
+
s1 = s2;
|
|
1244
|
+
} else {
|
|
1245
|
+
peg$currPos = s1;
|
|
1246
|
+
s1 = peg$FAILED;
|
|
1247
|
+
}
|
|
1248
|
+
} else {
|
|
1249
|
+
peg$currPos = s1;
|
|
1250
|
+
s1 = peg$FAILED;
|
|
1251
|
+
}
|
|
1252
|
+
if (s1 !== peg$FAILED) {
|
|
1253
|
+
peg$savedPos = s0;
|
|
1254
|
+
s1 = peg$c32(s1);
|
|
1255
|
+
}
|
|
1256
|
+
s0 = s1;
|
|
1257
|
+
}
|
|
1258
|
+
return s0;
|
|
1259
|
+
}
|
|
1260
|
+
function peg$parsefractionalConstant() {
|
|
1261
|
+
var s0, s1, s2, s3;
|
|
1262
|
+
peg$silentFails++;
|
|
1263
|
+
s0 = peg$currPos;
|
|
1264
|
+
s1 = peg$parsedigitSequence();
|
|
1265
|
+
if (s1 === peg$FAILED) {
|
|
1266
|
+
s1 = null;
|
|
1267
|
+
}
|
|
1268
|
+
if (s1 !== peg$FAILED) {
|
|
1269
|
+
if (input.charCodeAt(peg$currPos) === 46) {
|
|
1270
|
+
s2 = peg$c34;
|
|
1271
|
+
peg$currPos++;
|
|
1272
|
+
} else {
|
|
1273
|
+
s2 = peg$FAILED;
|
|
1274
|
+
if (peg$silentFails === 0) {
|
|
1275
|
+
peg$fail(peg$c35);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
if (s2 !== peg$FAILED) {
|
|
1279
|
+
s3 = peg$parsedigitSequence();
|
|
1280
|
+
if (s3 !== peg$FAILED) {
|
|
1281
|
+
peg$savedPos = s0;
|
|
1282
|
+
s1 = peg$c36(s1, s3);
|
|
1283
|
+
s0 = s1;
|
|
1284
|
+
} else {
|
|
1285
|
+
peg$currPos = s0;
|
|
1286
|
+
s0 = peg$FAILED;
|
|
1287
|
+
}
|
|
1288
|
+
} else {
|
|
1289
|
+
peg$currPos = s0;
|
|
1290
|
+
s0 = peg$FAILED;
|
|
1291
|
+
}
|
|
1292
|
+
} else {
|
|
1293
|
+
peg$currPos = s0;
|
|
1294
|
+
s0 = peg$FAILED;
|
|
1295
|
+
}
|
|
1296
|
+
if (s0 === peg$FAILED) {
|
|
1297
|
+
s0 = peg$currPos;
|
|
1298
|
+
s1 = peg$parsedigitSequence();
|
|
1299
|
+
if (s1 !== peg$FAILED) {
|
|
1300
|
+
if (input.charCodeAt(peg$currPos) === 46) {
|
|
1301
|
+
s2 = peg$c34;
|
|
1302
|
+
peg$currPos++;
|
|
1303
|
+
} else {
|
|
1304
|
+
s2 = peg$FAILED;
|
|
1305
|
+
if (peg$silentFails === 0) {
|
|
1306
|
+
peg$fail(peg$c35);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
if (s2 !== peg$FAILED) {
|
|
1310
|
+
peg$savedPos = s0;
|
|
1311
|
+
s1 = peg$c32(s1);
|
|
1312
|
+
s0 = s1;
|
|
1313
|
+
} else {
|
|
1314
|
+
peg$currPos = s0;
|
|
1315
|
+
s0 = peg$FAILED;
|
|
1316
|
+
}
|
|
1317
|
+
} else {
|
|
1318
|
+
peg$currPos = s0;
|
|
1319
|
+
s0 = peg$FAILED;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
peg$silentFails--;
|
|
1323
|
+
if (s0 === peg$FAILED) {
|
|
1324
|
+
s1 = peg$FAILED;
|
|
1325
|
+
if (peg$silentFails === 0) {
|
|
1326
|
+
peg$fail(peg$c33);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
return s0;
|
|
1330
|
+
}
|
|
1331
|
+
function peg$parseexponent() {
|
|
1332
|
+
var s0, s1, s2, s3, s4;
|
|
1333
|
+
s0 = peg$currPos;
|
|
1334
|
+
s1 = peg$currPos;
|
|
1335
|
+
if (peg$c37.test(input.charAt(peg$currPos))) {
|
|
1336
|
+
s2 = input.charAt(peg$currPos);
|
|
1337
|
+
peg$currPos++;
|
|
1338
|
+
} else {
|
|
1339
|
+
s2 = peg$FAILED;
|
|
1340
|
+
if (peg$silentFails === 0) {
|
|
1341
|
+
peg$fail(peg$c38);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
if (s2 !== peg$FAILED) {
|
|
1345
|
+
s3 = peg$parsesign();
|
|
1346
|
+
if (s3 === peg$FAILED) {
|
|
1347
|
+
s3 = null;
|
|
1348
|
+
}
|
|
1349
|
+
if (s3 !== peg$FAILED) {
|
|
1350
|
+
s4 = peg$parsedigitSequence();
|
|
1351
|
+
if (s4 !== peg$FAILED) {
|
|
1352
|
+
s2 = [s2, s3, s4];
|
|
1353
|
+
s1 = s2;
|
|
1354
|
+
} else {
|
|
1355
|
+
peg$currPos = s1;
|
|
1356
|
+
s1 = peg$FAILED;
|
|
1357
|
+
}
|
|
1358
|
+
} else {
|
|
1359
|
+
peg$currPos = s1;
|
|
1360
|
+
s1 = peg$FAILED;
|
|
1361
|
+
}
|
|
1362
|
+
} else {
|
|
1363
|
+
peg$currPos = s1;
|
|
1364
|
+
s1 = peg$FAILED;
|
|
1365
|
+
}
|
|
1366
|
+
if (s1 !== peg$FAILED) {
|
|
1367
|
+
peg$savedPos = s0;
|
|
1368
|
+
s1 = peg$c39(s1);
|
|
1369
|
+
}
|
|
1370
|
+
s0 = s1;
|
|
1371
|
+
return s0;
|
|
1372
|
+
}
|
|
1373
|
+
function peg$parsesign() {
|
|
1374
|
+
var s0;
|
|
1375
|
+
if (peg$c40.test(input.charAt(peg$currPos))) {
|
|
1376
|
+
s0 = input.charAt(peg$currPos);
|
|
1377
|
+
peg$currPos++;
|
|
1378
|
+
} else {
|
|
1379
|
+
s0 = peg$FAILED;
|
|
1380
|
+
if (peg$silentFails === 0) {
|
|
1381
|
+
peg$fail(peg$c41);
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return s0;
|
|
1385
|
+
}
|
|
1386
|
+
function peg$parsedigitSequence() {
|
|
1387
|
+
var s0, s1;
|
|
1388
|
+
s0 = [];
|
|
1389
|
+
s1 = peg$parsedigit();
|
|
1390
|
+
if (s1 !== peg$FAILED) {
|
|
1391
|
+
while (s1 !== peg$FAILED) {
|
|
1392
|
+
s0.push(s1);
|
|
1393
|
+
s1 = peg$parsedigit();
|
|
1394
|
+
}
|
|
1395
|
+
} else {
|
|
1396
|
+
s0 = peg$FAILED;
|
|
1397
|
+
}
|
|
1398
|
+
return s0;
|
|
1399
|
+
}
|
|
1400
|
+
function peg$parsedigit() {
|
|
1401
|
+
var s0;
|
|
1402
|
+
if (peg$c42.test(input.charAt(peg$currPos))) {
|
|
1403
|
+
s0 = input.charAt(peg$currPos);
|
|
1404
|
+
peg$currPos++;
|
|
1405
|
+
} else {
|
|
1406
|
+
s0 = peg$FAILED;
|
|
1407
|
+
if (peg$silentFails === 0) {
|
|
1408
|
+
peg$fail(peg$c43);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
return s0;
|
|
1412
|
+
}
|
|
1413
|
+
function peg$parsewsp() {
|
|
1414
|
+
var s0;
|
|
1415
|
+
if (peg$c44.test(input.charAt(peg$currPos))) {
|
|
1416
|
+
s0 = input.charAt(peg$currPos);
|
|
1417
|
+
peg$currPos++;
|
|
1418
|
+
} else {
|
|
1419
|
+
s0 = peg$FAILED;
|
|
1420
|
+
if (peg$silentFails === 0) {
|
|
1421
|
+
peg$fail(peg$c45);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
return s0;
|
|
1425
|
+
}
|
|
1426
|
+
var deg2rad = Math.PI / 180;
|
|
1427
|
+
function multiply_matrices(l, r) {
|
|
1428
|
+
var al = l[0];
|
|
1429
|
+
var cl = l[1];
|
|
1430
|
+
var el = l[2];
|
|
1431
|
+
var bl = l[3];
|
|
1432
|
+
var dl = l[4];
|
|
1433
|
+
var fl = l[5];
|
|
1434
|
+
var ar = r[0];
|
|
1435
|
+
var cr = r[1];
|
|
1436
|
+
var er = r[2];
|
|
1437
|
+
var br = r[3];
|
|
1438
|
+
var dr = r[4];
|
|
1439
|
+
var fr = r[5];
|
|
1440
|
+
var a = al * ar + cl * br;
|
|
1441
|
+
var c = al * cr + cl * dr;
|
|
1442
|
+
var e = al * er + cl * fr + el;
|
|
1443
|
+
var b = bl * ar + dl * br;
|
|
1444
|
+
var d = bl * cr + dl * dr;
|
|
1445
|
+
var f = bl * er + dl * fr + fl;
|
|
1446
|
+
return [a, c, e, b, d, f];
|
|
1447
|
+
}
|
|
1448
|
+
peg$result = peg$startRuleFunction();
|
|
1449
|
+
if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|
1450
|
+
return peg$result;
|
|
1451
|
+
} else {
|
|
1452
|
+
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|
1453
|
+
peg$fail(peg$endExpectation());
|
|
1454
|
+
}
|
|
1455
|
+
throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
module.exports = {
|
|
1459
|
+
SyntaxError: peg$SyntaxError,
|
|
1460
|
+
parse: peg$parse
|
|
1461
|
+
};
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
// node_modules/react-native-svg/lib/module/lib/extract/transformToRn.js
|
|
1465
|
+
var require_transformToRn = __commonJS(function(exports, module) {
|
|
1466
|
+
function peg$subclass(child, parent) {
|
|
1467
|
+
function C() {
|
|
1468
|
+
this.constructor = child;
|
|
1469
|
+
}
|
|
1470
|
+
C.prototype = parent.prototype;
|
|
1471
|
+
child.prototype = new C;
|
|
1472
|
+
}
|
|
1473
|
+
function peg$SyntaxError(message, expected, found, location) {
|
|
1474
|
+
var self = Error.call(this, message);
|
|
1475
|
+
if (Object.setPrototypeOf) {
|
|
1476
|
+
Object.setPrototypeOf(self, peg$SyntaxError.prototype);
|
|
1477
|
+
}
|
|
1478
|
+
self.expected = expected;
|
|
1479
|
+
self.found = found;
|
|
1480
|
+
self.location = location;
|
|
1481
|
+
self.name = "SyntaxError";
|
|
1482
|
+
return self;
|
|
1483
|
+
}
|
|
1484
|
+
peg$subclass(peg$SyntaxError, Error);
|
|
1485
|
+
function peg$padEnd(str, targetLength, padString) {
|
|
1486
|
+
padString = padString || " ";
|
|
1487
|
+
if (str.length > targetLength) {
|
|
1488
|
+
return str;
|
|
1489
|
+
}
|
|
1490
|
+
targetLength -= str.length;
|
|
1491
|
+
padString += padString.repeat(targetLength);
|
|
1492
|
+
return str + padString.slice(0, targetLength);
|
|
1493
|
+
}
|
|
1494
|
+
peg$SyntaxError.prototype.format = function(sources) {
|
|
1495
|
+
var str = "Error: " + this.message;
|
|
1496
|
+
if (this.location) {
|
|
1497
|
+
var src = null;
|
|
1498
|
+
var k;
|
|
1499
|
+
for (k = 0;k < sources.length; k++) {
|
|
1500
|
+
if (sources[k].source === this.location.source) {
|
|
1501
|
+
src = sources[k].text.split(/\r\n|\n|\r/g);
|
|
1502
|
+
break;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
var s = this.location.start;
|
|
1506
|
+
var offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
|
|
1507
|
+
var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
|
|
1508
|
+
if (src) {
|
|
1509
|
+
var e = this.location.end;
|
|
1510
|
+
var filler = peg$padEnd("", offset_s.line.toString().length, " ");
|
|
1511
|
+
var line = src[s.line - 1];
|
|
1512
|
+
var last = s.line === e.line ? e.column : line.length + 1;
|
|
1513
|
+
var hatLen = last - s.column || 1;
|
|
1514
|
+
str += `
|
|
1515
|
+
--> ` + loc + `
|
|
1516
|
+
` + filler + ` |
|
|
1517
|
+
` + offset_s.line + " | " + line + `
|
|
1518
|
+
` + filler + " | " + peg$padEnd("", s.column - 1, " ") + peg$padEnd("", hatLen, "^");
|
|
1519
|
+
} else {
|
|
1520
|
+
str += `
|
|
1521
|
+
at ` + loc;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
return str;
|
|
1525
|
+
};
|
|
1526
|
+
peg$SyntaxError.buildMessage = function(expected, found) {
|
|
1527
|
+
var DESCRIBE_EXPECTATION_FNS = {
|
|
1528
|
+
literal: function(expectation) {
|
|
1529
|
+
return '"' + literalEscape(expectation.text) + '"';
|
|
1530
|
+
},
|
|
1531
|
+
class: function(expectation) {
|
|
1532
|
+
var escapedParts = expectation.parts.map(function(part) {
|
|
1533
|
+
return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
|
|
1534
|
+
});
|
|
1535
|
+
return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
|
|
1536
|
+
},
|
|
1537
|
+
any: function() {
|
|
1538
|
+
return "any character";
|
|
1539
|
+
},
|
|
1540
|
+
end: function() {
|
|
1541
|
+
return "end of input";
|
|
1542
|
+
},
|
|
1543
|
+
other: function(expectation) {
|
|
1544
|
+
return expectation.description;
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
function hex(ch) {
|
|
1548
|
+
return ch.charCodeAt(0).toString(16).toUpperCase();
|
|
1549
|
+
}
|
|
1550
|
+
function literalEscape(s) {
|
|
1551
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
|
|
1552
|
+
return "\\x0" + hex(ch);
|
|
1553
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
|
|
1554
|
+
return "\\x" + hex(ch);
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
function classEscape(s) {
|
|
1558
|
+
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) {
|
|
1559
|
+
return "\\x0" + hex(ch);
|
|
1560
|
+
}).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) {
|
|
1561
|
+
return "\\x" + hex(ch);
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
function describeExpectation(expectation) {
|
|
1565
|
+
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
|
|
1566
|
+
}
|
|
1567
|
+
function describeExpected(expected) {
|
|
1568
|
+
var descriptions = expected.map(describeExpectation);
|
|
1569
|
+
var i, j;
|
|
1570
|
+
descriptions.sort();
|
|
1571
|
+
if (descriptions.length > 0) {
|
|
1572
|
+
for (i = 1, j = 1;i < descriptions.length; i++) {
|
|
1573
|
+
if (descriptions[i - 1] !== descriptions[i]) {
|
|
1574
|
+
descriptions[j] = descriptions[i];
|
|
1575
|
+
j++;
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
descriptions.length = j;
|
|
1579
|
+
}
|
|
1580
|
+
switch (descriptions.length) {
|
|
1581
|
+
case 1:
|
|
1582
|
+
return descriptions[0];
|
|
1583
|
+
case 2:
|
|
1584
|
+
return descriptions[0] + " or " + descriptions[1];
|
|
1585
|
+
default:
|
|
1586
|
+
return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
function describeFound(found) {
|
|
1590
|
+
return found ? '"' + literalEscape(found) + '"' : "end of input";
|
|
1591
|
+
}
|
|
1592
|
+
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|
1593
|
+
};
|
|
1594
|
+
function peg$parse(input, options) {
|
|
1595
|
+
options = options !== undefined ? options : {};
|
|
1596
|
+
var peg$FAILED = {};
|
|
1597
|
+
var peg$source = options.grammarSource;
|
|
1598
|
+
var peg$startRuleFunctions = {
|
|
1599
|
+
start: peg$parsestart
|
|
1600
|
+
};
|
|
1601
|
+
var peg$startRuleFunction = peg$parsestart;
|
|
1602
|
+
var peg$c0 = "matrix(";
|
|
1603
|
+
var peg$c1 = ")";
|
|
1604
|
+
var peg$c2 = "translate(";
|
|
1605
|
+
var peg$c3 = "scale(";
|
|
1606
|
+
var peg$c4 = "rotate(";
|
|
1607
|
+
var peg$c5 = "skewX(";
|
|
1608
|
+
var peg$c6 = "skewY(";
|
|
1609
|
+
var peg$c7 = ".";
|
|
1610
|
+
var peg$c8 = "e";
|
|
1611
|
+
var peg$r0 = /^[ \t\n\r,]/;
|
|
1612
|
+
var peg$r1 = /^[ \t\n\r]/;
|
|
1613
|
+
var peg$r2 = /^[+\-]/;
|
|
1614
|
+
var peg$r3 = /^[0-9]/;
|
|
1615
|
+
var peg$e0 = peg$otherExpectation("transform functions");
|
|
1616
|
+
var peg$e1 = peg$otherExpectation("transformFunctions");
|
|
1617
|
+
var peg$e2 = peg$otherExpectation("transform function");
|
|
1618
|
+
var peg$e3 = peg$otherExpectation("matrix");
|
|
1619
|
+
var peg$e4 = peg$literalExpectation("matrix(", false);
|
|
1620
|
+
var peg$e5 = peg$literalExpectation(")", false);
|
|
1621
|
+
var peg$e6 = peg$otherExpectation("translate");
|
|
1622
|
+
var peg$e7 = peg$literalExpectation("translate(", false);
|
|
1623
|
+
var peg$e8 = peg$otherExpectation("scale");
|
|
1624
|
+
var peg$e9 = peg$literalExpectation("scale(", false);
|
|
1625
|
+
var peg$e10 = peg$otherExpectation("rotate");
|
|
1626
|
+
var peg$e11 = peg$literalExpectation("rotate(", false);
|
|
1627
|
+
var peg$e12 = peg$otherExpectation("x, y");
|
|
1628
|
+
var peg$e13 = peg$otherExpectation("skewX");
|
|
1629
|
+
var peg$e14 = peg$literalExpectation("skewX(", false);
|
|
1630
|
+
var peg$e15 = peg$otherExpectation("skewY");
|
|
1631
|
+
var peg$e16 = peg$literalExpectation("skewY(", false);
|
|
1632
|
+
var peg$e17 = peg$otherExpectation("space or comma");
|
|
1633
|
+
var peg$e18 = peg$classExpectation([" ", "\t", `
|
|
1634
|
+
`, "\r", ","], false, false);
|
|
1635
|
+
var peg$e19 = peg$otherExpectation("whitespace");
|
|
1636
|
+
var peg$e20 = peg$classExpectation([" ", "\t", `
|
|
1637
|
+
`, "\r"], false, false);
|
|
1638
|
+
var peg$e21 = peg$classExpectation(["+", "-"], false, false);
|
|
1639
|
+
var peg$e22 = peg$classExpectation([["0", "9"]], false, false);
|
|
1640
|
+
var peg$e23 = peg$literalExpectation(".", false);
|
|
1641
|
+
var peg$e24 = peg$literalExpectation("e", false);
|
|
1642
|
+
var peg$f0 = function(head, tail) {
|
|
1643
|
+
const results = Array.isArray(head) ? head : [head];
|
|
1644
|
+
tail.forEach((element) => {
|
|
1645
|
+
if (Array.isArray(element[1])) {
|
|
1646
|
+
results.push(...element[1]);
|
|
1647
|
+
} else {
|
|
1648
|
+
results.push(element[1]);
|
|
1649
|
+
}
|
|
1650
|
+
});
|
|
1651
|
+
return results;
|
|
1652
|
+
};
|
|
1653
|
+
var peg$f1 = function(a, b, c, d, e, f, g, h, i) {
|
|
1654
|
+
return {
|
|
1655
|
+
matrix: [a, b, c, d, e, f, g, h, i]
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
var peg$f2 = function(x, y) {
|
|
1659
|
+
if (y == undefined) {
|
|
1660
|
+
return {
|
|
1661
|
+
translate: x
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
return {
|
|
1665
|
+
translate: [x, y]
|
|
1666
|
+
};
|
|
1667
|
+
};
|
|
1668
|
+
var peg$f3 = function(x, y) {
|
|
1669
|
+
if (y == undefined) {
|
|
1670
|
+
return {
|
|
1671
|
+
scale: x
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
return [{
|
|
1675
|
+
scaleX: x
|
|
1676
|
+
}, {
|
|
1677
|
+
scaleY: y
|
|
1678
|
+
}];
|
|
1679
|
+
};
|
|
1680
|
+
var peg$f4 = function(x, yz) {
|
|
1681
|
+
if (yz !== null) {
|
|
1682
|
+
return {
|
|
1683
|
+
rotate: `${x}deg`
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
return [{
|
|
1687
|
+
rotate: `${x}deg`
|
|
1688
|
+
}];
|
|
1689
|
+
};
|
|
1690
|
+
var peg$f5 = function(y, z) {
|
|
1691
|
+
return [y, z];
|
|
1692
|
+
};
|
|
1693
|
+
var peg$f6 = function(x) {
|
|
1694
|
+
return [{
|
|
1695
|
+
skewX: `${x}deg`
|
|
1696
|
+
}];
|
|
1697
|
+
};
|
|
1698
|
+
var peg$f7 = function(y) {
|
|
1699
|
+
return [{
|
|
1700
|
+
skewY: `${y}deg`
|
|
1701
|
+
}];
|
|
1702
|
+
};
|
|
1703
|
+
var peg$f8 = function() {
|
|
1704
|
+
return parseFloat(text());
|
|
1705
|
+
};
|
|
1706
|
+
var peg$currPos = options.peg$currPos | 0;
|
|
1707
|
+
var peg$savedPos = peg$currPos;
|
|
1708
|
+
var peg$posDetailsCache = [{
|
|
1709
|
+
line: 1,
|
|
1710
|
+
column: 1
|
|
1711
|
+
}];
|
|
1712
|
+
var peg$maxFailPos = peg$currPos;
|
|
1713
|
+
var peg$maxFailExpected = options.peg$maxFailExpected || [];
|
|
1714
|
+
var peg$silentFails = options.peg$silentFails | 0;
|
|
1715
|
+
var peg$result;
|
|
1716
|
+
if (options.startRule) {
|
|
1717
|
+
if (!(options.startRule in peg$startRuleFunctions)) {
|
|
1718
|
+
throw new Error(`Can't start parsing from rule "` + options.startRule + '".');
|
|
1719
|
+
}
|
|
1720
|
+
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
1721
|
+
}
|
|
1722
|
+
function text() {
|
|
1723
|
+
return input.substring(peg$savedPos, peg$currPos);
|
|
1724
|
+
}
|
|
1725
|
+
function offset() {
|
|
1726
|
+
return peg$savedPos;
|
|
1727
|
+
}
|
|
1728
|
+
function range() {
|
|
1729
|
+
return {
|
|
1730
|
+
source: peg$source,
|
|
1731
|
+
start: peg$savedPos,
|
|
1732
|
+
end: peg$currPos
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
function location() {
|
|
1736
|
+
return peg$computeLocation(peg$savedPos, peg$currPos);
|
|
1737
|
+
}
|
|
1738
|
+
function expected(description, location) {
|
|
1739
|
+
location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
|
|
1740
|
+
throw peg$buildStructuredError([peg$otherExpectation(description)], input.substring(peg$savedPos, peg$currPos), location);
|
|
1741
|
+
}
|
|
1742
|
+
function error(message, location) {
|
|
1743
|
+
location = location !== undefined ? location : peg$computeLocation(peg$savedPos, peg$currPos);
|
|
1744
|
+
throw peg$buildSimpleError(message, location);
|
|
1745
|
+
}
|
|
1746
|
+
function peg$literalExpectation(text, ignoreCase) {
|
|
1747
|
+
return {
|
|
1748
|
+
type: "literal",
|
|
1749
|
+
text,
|
|
1750
|
+
ignoreCase
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
function peg$classExpectation(parts, inverted, ignoreCase) {
|
|
1754
|
+
return {
|
|
1755
|
+
type: "class",
|
|
1756
|
+
parts,
|
|
1757
|
+
inverted,
|
|
1758
|
+
ignoreCase
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
function peg$anyExpectation() {
|
|
1762
|
+
return {
|
|
1763
|
+
type: "any"
|
|
1764
|
+
};
|
|
1765
|
+
}
|
|
1766
|
+
function peg$endExpectation() {
|
|
1767
|
+
return {
|
|
1768
|
+
type: "end"
|
|
1769
|
+
};
|
|
1770
|
+
}
|
|
1771
|
+
function peg$otherExpectation(description) {
|
|
1772
|
+
return {
|
|
1773
|
+
type: "other",
|
|
1774
|
+
description
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
function peg$computePosDetails(pos) {
|
|
1778
|
+
var details = peg$posDetailsCache[pos];
|
|
1779
|
+
var p;
|
|
1780
|
+
if (details) {
|
|
1781
|
+
return details;
|
|
1782
|
+
} else {
|
|
1783
|
+
if (pos >= peg$posDetailsCache.length) {
|
|
1784
|
+
p = peg$posDetailsCache.length - 1;
|
|
1785
|
+
} else {
|
|
1786
|
+
p = pos;
|
|
1787
|
+
while (!peg$posDetailsCache[--p]) {}
|
|
1788
|
+
}
|
|
1789
|
+
details = peg$posDetailsCache[p];
|
|
1790
|
+
details = {
|
|
1791
|
+
line: details.line,
|
|
1792
|
+
column: details.column
|
|
1793
|
+
};
|
|
1794
|
+
while (p < pos) {
|
|
1795
|
+
if (input.charCodeAt(p) === 10) {
|
|
1796
|
+
details.line++;
|
|
1797
|
+
details.column = 1;
|
|
1798
|
+
} else {
|
|
1799
|
+
details.column++;
|
|
1800
|
+
}
|
|
1801
|
+
p++;
|
|
1802
|
+
}
|
|
1803
|
+
peg$posDetailsCache[pos] = details;
|
|
1804
|
+
return details;
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
function peg$computeLocation(startPos, endPos, offset) {
|
|
1808
|
+
var startPosDetails = peg$computePosDetails(startPos);
|
|
1809
|
+
var endPosDetails = peg$computePosDetails(endPos);
|
|
1810
|
+
var res = {
|
|
1811
|
+
source: peg$source,
|
|
1812
|
+
start: {
|
|
1813
|
+
offset: startPos,
|
|
1814
|
+
line: startPosDetails.line,
|
|
1815
|
+
column: startPosDetails.column
|
|
1816
|
+
},
|
|
1817
|
+
end: {
|
|
1818
|
+
offset: endPos,
|
|
1819
|
+
line: endPosDetails.line,
|
|
1820
|
+
column: endPosDetails.column
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1823
|
+
if (offset && peg$source && typeof peg$source.offset === "function") {
|
|
1824
|
+
res.start = peg$source.offset(res.start);
|
|
1825
|
+
res.end = peg$source.offset(res.end);
|
|
1826
|
+
}
|
|
1827
|
+
return res;
|
|
1828
|
+
}
|
|
1829
|
+
function peg$fail(expected) {
|
|
1830
|
+
if (peg$currPos < peg$maxFailPos) {
|
|
1831
|
+
return;
|
|
1832
|
+
}
|
|
1833
|
+
if (peg$currPos > peg$maxFailPos) {
|
|
1834
|
+
peg$maxFailPos = peg$currPos;
|
|
1835
|
+
peg$maxFailExpected = [];
|
|
1836
|
+
}
|
|
1837
|
+
peg$maxFailExpected.push(expected);
|
|
1838
|
+
}
|
|
1839
|
+
function peg$buildSimpleError(message, location) {
|
|
1840
|
+
return new peg$SyntaxError(message, null, null, location);
|
|
1841
|
+
}
|
|
1842
|
+
function peg$buildStructuredError(expected, found, location) {
|
|
1843
|
+
return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
|
|
1844
|
+
}
|
|
1845
|
+
function peg$parsestart() {
|
|
1846
|
+
var s0, s1;
|
|
1847
|
+
peg$silentFails++;
|
|
1848
|
+
s0 = peg$parsetransformFunctions();
|
|
1849
|
+
peg$silentFails--;
|
|
1850
|
+
if (s0 === peg$FAILED) {
|
|
1851
|
+
s1 = peg$FAILED;
|
|
1852
|
+
if (peg$silentFails === 0) {
|
|
1853
|
+
peg$fail(peg$e0);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
return s0;
|
|
1857
|
+
}
|
|
1858
|
+
function peg$parsetransformFunctions() {
|
|
1859
|
+
var s0, s1, s2, s3, s4, s5;
|
|
1860
|
+
peg$silentFails++;
|
|
1861
|
+
s0 = peg$currPos;
|
|
1862
|
+
s1 = peg$parsefunction();
|
|
1863
|
+
if (s1 !== peg$FAILED) {
|
|
1864
|
+
s2 = [];
|
|
1865
|
+
s3 = peg$currPos;
|
|
1866
|
+
s4 = peg$parse_();
|
|
1867
|
+
s5 = peg$parsefunction();
|
|
1868
|
+
if (s5 !== peg$FAILED) {
|
|
1869
|
+
s4 = [s4, s5];
|
|
1870
|
+
s3 = s4;
|
|
1871
|
+
} else {
|
|
1872
|
+
peg$currPos = s3;
|
|
1873
|
+
s3 = peg$FAILED;
|
|
1874
|
+
}
|
|
1875
|
+
while (s3 !== peg$FAILED) {
|
|
1876
|
+
s2.push(s3);
|
|
1877
|
+
s3 = peg$currPos;
|
|
1878
|
+
s4 = peg$parse_();
|
|
1879
|
+
s5 = peg$parsefunction();
|
|
1880
|
+
if (s5 !== peg$FAILED) {
|
|
1881
|
+
s4 = [s4, s5];
|
|
1882
|
+
s3 = s4;
|
|
1883
|
+
} else {
|
|
1884
|
+
peg$currPos = s3;
|
|
1885
|
+
s3 = peg$FAILED;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
peg$savedPos = s0;
|
|
1889
|
+
s0 = peg$f0(s1, s2);
|
|
1890
|
+
} else {
|
|
1891
|
+
peg$currPos = s0;
|
|
1892
|
+
s0 = peg$FAILED;
|
|
1893
|
+
}
|
|
1894
|
+
peg$silentFails--;
|
|
1895
|
+
if (s0 === peg$FAILED) {
|
|
1896
|
+
s1 = peg$FAILED;
|
|
1897
|
+
if (peg$silentFails === 0) {
|
|
1898
|
+
peg$fail(peg$e1);
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
return s0;
|
|
1902
|
+
}
|
|
1903
|
+
function peg$parsefunction() {
|
|
1904
|
+
var s0, s1;
|
|
1905
|
+
peg$silentFails++;
|
|
1906
|
+
s0 = peg$parsematrix();
|
|
1907
|
+
if (s0 === peg$FAILED) {
|
|
1908
|
+
s0 = peg$parsetranslate();
|
|
1909
|
+
if (s0 === peg$FAILED) {
|
|
1910
|
+
s0 = peg$parsescale();
|
|
1911
|
+
if (s0 === peg$FAILED) {
|
|
1912
|
+
s0 = peg$parserotate();
|
|
1913
|
+
if (s0 === peg$FAILED) {
|
|
1914
|
+
s0 = peg$parseskewX();
|
|
1915
|
+
if (s0 === peg$FAILED) {
|
|
1916
|
+
s0 = peg$parseskewY();
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
peg$silentFails--;
|
|
1923
|
+
if (s0 === peg$FAILED) {
|
|
1924
|
+
s1 = peg$FAILED;
|
|
1925
|
+
if (peg$silentFails === 0) {
|
|
1926
|
+
peg$fail(peg$e2);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
return s0;
|
|
1930
|
+
}
|
|
1931
|
+
function peg$parsematrix() {
|
|
1932
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23;
|
|
1933
|
+
peg$silentFails++;
|
|
1934
|
+
s0 = peg$currPos;
|
|
1935
|
+
s1 = peg$parse_();
|
|
1936
|
+
if (input.substr(peg$currPos, 7) === peg$c0) {
|
|
1937
|
+
s2 = peg$c0;
|
|
1938
|
+
peg$currPos += 7;
|
|
1939
|
+
} else {
|
|
1940
|
+
s2 = peg$FAILED;
|
|
1941
|
+
if (peg$silentFails === 0) {
|
|
1942
|
+
peg$fail(peg$e4);
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
if (s2 !== peg$FAILED) {
|
|
1946
|
+
s3 = peg$parse_();
|
|
1947
|
+
s4 = peg$parseNUM();
|
|
1948
|
+
if (s4 !== peg$FAILED) {
|
|
1949
|
+
s5 = peg$parsespaceOrComma();
|
|
1950
|
+
s6 = peg$parseNUM();
|
|
1951
|
+
if (s6 !== peg$FAILED) {
|
|
1952
|
+
s7 = peg$parsespaceOrComma();
|
|
1953
|
+
s8 = peg$parseNUM();
|
|
1954
|
+
if (s8 !== peg$FAILED) {
|
|
1955
|
+
s9 = peg$parsespaceOrComma();
|
|
1956
|
+
s10 = peg$parseNUM();
|
|
1957
|
+
if (s10 !== peg$FAILED) {
|
|
1958
|
+
s11 = peg$parsespaceOrComma();
|
|
1959
|
+
s12 = peg$parseNUM();
|
|
1960
|
+
if (s12 !== peg$FAILED) {
|
|
1961
|
+
s13 = peg$parsespaceOrComma();
|
|
1962
|
+
s14 = peg$parseNUM();
|
|
1963
|
+
if (s14 !== peg$FAILED) {
|
|
1964
|
+
s15 = peg$parsespaceOrComma();
|
|
1965
|
+
s16 = peg$parseNUM();
|
|
1966
|
+
if (s16 !== peg$FAILED) {
|
|
1967
|
+
s17 = peg$parsespaceOrComma();
|
|
1968
|
+
s18 = peg$parseNUM();
|
|
1969
|
+
if (s18 !== peg$FAILED) {
|
|
1970
|
+
s19 = peg$parsespaceOrComma();
|
|
1971
|
+
s20 = peg$parseNUM();
|
|
1972
|
+
if (s20 !== peg$FAILED) {
|
|
1973
|
+
s21 = peg$parse_();
|
|
1974
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
1975
|
+
s22 = peg$c1;
|
|
1976
|
+
peg$currPos++;
|
|
1977
|
+
} else {
|
|
1978
|
+
s22 = peg$FAILED;
|
|
1979
|
+
if (peg$silentFails === 0) {
|
|
1980
|
+
peg$fail(peg$e5);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
if (s22 !== peg$FAILED) {
|
|
1984
|
+
s23 = peg$parse_();
|
|
1985
|
+
peg$savedPos = s0;
|
|
1986
|
+
s0 = peg$f1(s4, s6, s8, s10, s12, s14, s16, s18, s20);
|
|
1987
|
+
} else {
|
|
1988
|
+
peg$currPos = s0;
|
|
1989
|
+
s0 = peg$FAILED;
|
|
1990
|
+
}
|
|
1991
|
+
} else {
|
|
1992
|
+
peg$currPos = s0;
|
|
1993
|
+
s0 = peg$FAILED;
|
|
1994
|
+
}
|
|
1995
|
+
} else {
|
|
1996
|
+
peg$currPos = s0;
|
|
1997
|
+
s0 = peg$FAILED;
|
|
1998
|
+
}
|
|
1999
|
+
} else {
|
|
2000
|
+
peg$currPos = s0;
|
|
2001
|
+
s0 = peg$FAILED;
|
|
2002
|
+
}
|
|
2003
|
+
} else {
|
|
2004
|
+
peg$currPos = s0;
|
|
2005
|
+
s0 = peg$FAILED;
|
|
2006
|
+
}
|
|
2007
|
+
} else {
|
|
2008
|
+
peg$currPos = s0;
|
|
2009
|
+
s0 = peg$FAILED;
|
|
2010
|
+
}
|
|
2011
|
+
} else {
|
|
2012
|
+
peg$currPos = s0;
|
|
2013
|
+
s0 = peg$FAILED;
|
|
2014
|
+
}
|
|
2015
|
+
} else {
|
|
2016
|
+
peg$currPos = s0;
|
|
2017
|
+
s0 = peg$FAILED;
|
|
2018
|
+
}
|
|
2019
|
+
} else {
|
|
2020
|
+
peg$currPos = s0;
|
|
2021
|
+
s0 = peg$FAILED;
|
|
2022
|
+
}
|
|
2023
|
+
} else {
|
|
2024
|
+
peg$currPos = s0;
|
|
2025
|
+
s0 = peg$FAILED;
|
|
2026
|
+
}
|
|
2027
|
+
} else {
|
|
2028
|
+
peg$currPos = s0;
|
|
2029
|
+
s0 = peg$FAILED;
|
|
2030
|
+
}
|
|
2031
|
+
peg$silentFails--;
|
|
2032
|
+
if (s0 === peg$FAILED) {
|
|
2033
|
+
s1 = peg$FAILED;
|
|
2034
|
+
if (peg$silentFails === 0) {
|
|
2035
|
+
peg$fail(peg$e3);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
return s0;
|
|
2039
|
+
}
|
|
2040
|
+
function peg$parsetranslate() {
|
|
2041
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
|
2042
|
+
peg$silentFails++;
|
|
2043
|
+
s0 = peg$currPos;
|
|
2044
|
+
s1 = peg$parse_();
|
|
2045
|
+
if (input.substr(peg$currPos, 10) === peg$c2) {
|
|
2046
|
+
s2 = peg$c2;
|
|
2047
|
+
peg$currPos += 10;
|
|
2048
|
+
} else {
|
|
2049
|
+
s2 = peg$FAILED;
|
|
2050
|
+
if (peg$silentFails === 0) {
|
|
2051
|
+
peg$fail(peg$e7);
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
if (s2 !== peg$FAILED) {
|
|
2055
|
+
s3 = peg$parse_();
|
|
2056
|
+
s4 = peg$parseNUM();
|
|
2057
|
+
if (s4 !== peg$FAILED) {
|
|
2058
|
+
s5 = peg$parsespaceOrComma();
|
|
2059
|
+
s6 = peg$parseNUM();
|
|
2060
|
+
if (s6 === peg$FAILED) {
|
|
2061
|
+
s6 = null;
|
|
2062
|
+
}
|
|
2063
|
+
s7 = peg$parse_();
|
|
2064
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
2065
|
+
s8 = peg$c1;
|
|
2066
|
+
peg$currPos++;
|
|
2067
|
+
} else {
|
|
2068
|
+
s8 = peg$FAILED;
|
|
2069
|
+
if (peg$silentFails === 0) {
|
|
2070
|
+
peg$fail(peg$e5);
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
if (s8 !== peg$FAILED) {
|
|
2074
|
+
s9 = peg$parse_();
|
|
2075
|
+
peg$savedPos = s0;
|
|
2076
|
+
s0 = peg$f2(s4, s6);
|
|
2077
|
+
} else {
|
|
2078
|
+
peg$currPos = s0;
|
|
2079
|
+
s0 = peg$FAILED;
|
|
2080
|
+
}
|
|
2081
|
+
} else {
|
|
2082
|
+
peg$currPos = s0;
|
|
2083
|
+
s0 = peg$FAILED;
|
|
2084
|
+
}
|
|
2085
|
+
} else {
|
|
2086
|
+
peg$currPos = s0;
|
|
2087
|
+
s0 = peg$FAILED;
|
|
2088
|
+
}
|
|
2089
|
+
peg$silentFails--;
|
|
2090
|
+
if (s0 === peg$FAILED) {
|
|
2091
|
+
s1 = peg$FAILED;
|
|
2092
|
+
if (peg$silentFails === 0) {
|
|
2093
|
+
peg$fail(peg$e6);
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
return s0;
|
|
2097
|
+
}
|
|
2098
|
+
function peg$parsescale() {
|
|
2099
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
|
2100
|
+
peg$silentFails++;
|
|
2101
|
+
s0 = peg$currPos;
|
|
2102
|
+
s1 = peg$parse_();
|
|
2103
|
+
if (input.substr(peg$currPos, 6) === peg$c3) {
|
|
2104
|
+
s2 = peg$c3;
|
|
2105
|
+
peg$currPos += 6;
|
|
2106
|
+
} else {
|
|
2107
|
+
s2 = peg$FAILED;
|
|
2108
|
+
if (peg$silentFails === 0) {
|
|
2109
|
+
peg$fail(peg$e9);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
if (s2 !== peg$FAILED) {
|
|
2113
|
+
s3 = peg$parse_();
|
|
2114
|
+
s4 = peg$parseNUM();
|
|
2115
|
+
if (s4 !== peg$FAILED) {
|
|
2116
|
+
s5 = peg$parsespaceOrComma();
|
|
2117
|
+
s6 = peg$parseNUM();
|
|
2118
|
+
if (s6 === peg$FAILED) {
|
|
2119
|
+
s6 = null;
|
|
2120
|
+
}
|
|
2121
|
+
s7 = peg$parse_();
|
|
2122
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
2123
|
+
s8 = peg$c1;
|
|
2124
|
+
peg$currPos++;
|
|
2125
|
+
} else {
|
|
2126
|
+
s8 = peg$FAILED;
|
|
2127
|
+
if (peg$silentFails === 0) {
|
|
2128
|
+
peg$fail(peg$e5);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
if (s8 !== peg$FAILED) {
|
|
2132
|
+
s9 = peg$parse_();
|
|
2133
|
+
peg$savedPos = s0;
|
|
2134
|
+
s0 = peg$f3(s4, s6);
|
|
2135
|
+
} else {
|
|
2136
|
+
peg$currPos = s0;
|
|
2137
|
+
s0 = peg$FAILED;
|
|
2138
|
+
}
|
|
2139
|
+
} else {
|
|
2140
|
+
peg$currPos = s0;
|
|
2141
|
+
s0 = peg$FAILED;
|
|
2142
|
+
}
|
|
2143
|
+
} else {
|
|
2144
|
+
peg$currPos = s0;
|
|
2145
|
+
s0 = peg$FAILED;
|
|
2146
|
+
}
|
|
2147
|
+
peg$silentFails--;
|
|
2148
|
+
if (s0 === peg$FAILED) {
|
|
2149
|
+
s1 = peg$FAILED;
|
|
2150
|
+
if (peg$silentFails === 0) {
|
|
2151
|
+
peg$fail(peg$e8);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
return s0;
|
|
2155
|
+
}
|
|
2156
|
+
function peg$parserotate() {
|
|
2157
|
+
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
|
2158
|
+
peg$silentFails++;
|
|
2159
|
+
s0 = peg$currPos;
|
|
2160
|
+
s1 = peg$parse_();
|
|
2161
|
+
if (input.substr(peg$currPos, 7) === peg$c4) {
|
|
2162
|
+
s2 = peg$c4;
|
|
2163
|
+
peg$currPos += 7;
|
|
2164
|
+
} else {
|
|
2165
|
+
s2 = peg$FAILED;
|
|
2166
|
+
if (peg$silentFails === 0) {
|
|
2167
|
+
peg$fail(peg$e11);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
if (s2 !== peg$FAILED) {
|
|
2171
|
+
s3 = peg$parse_();
|
|
2172
|
+
s4 = peg$parseNUM();
|
|
2173
|
+
if (s4 !== peg$FAILED) {
|
|
2174
|
+
s5 = peg$parsetwoNumbers();
|
|
2175
|
+
if (s5 === peg$FAILED) {
|
|
2176
|
+
s5 = null;
|
|
2177
|
+
}
|
|
2178
|
+
s6 = peg$parse_();
|
|
2179
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
2180
|
+
s7 = peg$c1;
|
|
2181
|
+
peg$currPos++;
|
|
2182
|
+
} else {
|
|
2183
|
+
s7 = peg$FAILED;
|
|
2184
|
+
if (peg$silentFails === 0) {
|
|
2185
|
+
peg$fail(peg$e5);
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
if (s7 !== peg$FAILED) {
|
|
2189
|
+
s8 = peg$parse_();
|
|
2190
|
+
peg$savedPos = s0;
|
|
2191
|
+
s0 = peg$f4(s4, s5);
|
|
2192
|
+
} else {
|
|
2193
|
+
peg$currPos = s0;
|
|
2194
|
+
s0 = peg$FAILED;
|
|
2195
|
+
}
|
|
2196
|
+
} else {
|
|
2197
|
+
peg$currPos = s0;
|
|
2198
|
+
s0 = peg$FAILED;
|
|
2199
|
+
}
|
|
2200
|
+
} else {
|
|
2201
|
+
peg$currPos = s0;
|
|
2202
|
+
s0 = peg$FAILED;
|
|
2203
|
+
}
|
|
2204
|
+
peg$silentFails--;
|
|
2205
|
+
if (s0 === peg$FAILED) {
|
|
2206
|
+
s1 = peg$FAILED;
|
|
2207
|
+
if (peg$silentFails === 0) {
|
|
2208
|
+
peg$fail(peg$e10);
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
return s0;
|
|
2212
|
+
}
|
|
2213
|
+
function peg$parsetwoNumbers() {
|
|
2214
|
+
var s0, s1, s2, s3, s4;
|
|
2215
|
+
peg$silentFails++;
|
|
2216
|
+
s0 = peg$currPos;
|
|
2217
|
+
s1 = peg$parsespaceOrComma();
|
|
2218
|
+
s2 = peg$parseNUM();
|
|
2219
|
+
if (s2 !== peg$FAILED) {
|
|
2220
|
+
s3 = peg$parsespaceOrComma();
|
|
2221
|
+
s4 = peg$parseNUM();
|
|
2222
|
+
if (s4 !== peg$FAILED) {
|
|
2223
|
+
peg$savedPos = s0;
|
|
2224
|
+
s0 = peg$f5(s2, s4);
|
|
2225
|
+
} else {
|
|
2226
|
+
peg$currPos = s0;
|
|
2227
|
+
s0 = peg$FAILED;
|
|
2228
|
+
}
|
|
2229
|
+
} else {
|
|
2230
|
+
peg$currPos = s0;
|
|
2231
|
+
s0 = peg$FAILED;
|
|
2232
|
+
}
|
|
2233
|
+
peg$silentFails--;
|
|
2234
|
+
if (s0 === peg$FAILED) {
|
|
2235
|
+
s1 = peg$FAILED;
|
|
2236
|
+
if (peg$silentFails === 0) {
|
|
2237
|
+
peg$fail(peg$e12);
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
return s0;
|
|
2241
|
+
}
|
|
2242
|
+
function peg$parseskewX() {
|
|
2243
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2244
|
+
peg$silentFails++;
|
|
2245
|
+
s0 = peg$currPos;
|
|
2246
|
+
s1 = peg$parse_();
|
|
2247
|
+
if (input.substr(peg$currPos, 6) === peg$c5) {
|
|
2248
|
+
s2 = peg$c5;
|
|
2249
|
+
peg$currPos += 6;
|
|
2250
|
+
} else {
|
|
2251
|
+
s2 = peg$FAILED;
|
|
2252
|
+
if (peg$silentFails === 0) {
|
|
2253
|
+
peg$fail(peg$e14);
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
if (s2 !== peg$FAILED) {
|
|
2257
|
+
s3 = peg$parse_();
|
|
2258
|
+
s4 = peg$parseNUM();
|
|
2259
|
+
if (s4 !== peg$FAILED) {
|
|
2260
|
+
s5 = peg$parse_();
|
|
2261
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
2262
|
+
s6 = peg$c1;
|
|
2263
|
+
peg$currPos++;
|
|
2264
|
+
} else {
|
|
2265
|
+
s6 = peg$FAILED;
|
|
2266
|
+
if (peg$silentFails === 0) {
|
|
2267
|
+
peg$fail(peg$e5);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
if (s6 !== peg$FAILED) {
|
|
2271
|
+
s7 = peg$parse_();
|
|
2272
|
+
peg$savedPos = s0;
|
|
2273
|
+
s0 = peg$f6(s4);
|
|
2274
|
+
} else {
|
|
2275
|
+
peg$currPos = s0;
|
|
2276
|
+
s0 = peg$FAILED;
|
|
2277
|
+
}
|
|
2278
|
+
} else {
|
|
2279
|
+
peg$currPos = s0;
|
|
2280
|
+
s0 = peg$FAILED;
|
|
2281
|
+
}
|
|
2282
|
+
} else {
|
|
2283
|
+
peg$currPos = s0;
|
|
2284
|
+
s0 = peg$FAILED;
|
|
2285
|
+
}
|
|
2286
|
+
peg$silentFails--;
|
|
2287
|
+
if (s0 === peg$FAILED) {
|
|
2288
|
+
s1 = peg$FAILED;
|
|
2289
|
+
if (peg$silentFails === 0) {
|
|
2290
|
+
peg$fail(peg$e13);
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
return s0;
|
|
2294
|
+
}
|
|
2295
|
+
function peg$parseskewY() {
|
|
2296
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2297
|
+
peg$silentFails++;
|
|
2298
|
+
s0 = peg$currPos;
|
|
2299
|
+
s1 = peg$parse_();
|
|
2300
|
+
if (input.substr(peg$currPos, 6) === peg$c6) {
|
|
2301
|
+
s2 = peg$c6;
|
|
2302
|
+
peg$currPos += 6;
|
|
2303
|
+
} else {
|
|
2304
|
+
s2 = peg$FAILED;
|
|
2305
|
+
if (peg$silentFails === 0) {
|
|
2306
|
+
peg$fail(peg$e16);
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
if (s2 !== peg$FAILED) {
|
|
2310
|
+
s3 = peg$parse_();
|
|
2311
|
+
s4 = peg$parseNUM();
|
|
2312
|
+
if (s4 !== peg$FAILED) {
|
|
2313
|
+
s5 = peg$parse_();
|
|
2314
|
+
if (input.charCodeAt(peg$currPos) === 41) {
|
|
2315
|
+
s6 = peg$c1;
|
|
2316
|
+
peg$currPos++;
|
|
2317
|
+
} else {
|
|
2318
|
+
s6 = peg$FAILED;
|
|
2319
|
+
if (peg$silentFails === 0) {
|
|
2320
|
+
peg$fail(peg$e5);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
if (s6 !== peg$FAILED) {
|
|
2324
|
+
s7 = peg$parse_();
|
|
2325
|
+
peg$savedPos = s0;
|
|
2326
|
+
s0 = peg$f7(s4);
|
|
2327
|
+
} else {
|
|
2328
|
+
peg$currPos = s0;
|
|
2329
|
+
s0 = peg$FAILED;
|
|
2330
|
+
}
|
|
2331
|
+
} else {
|
|
2332
|
+
peg$currPos = s0;
|
|
2333
|
+
s0 = peg$FAILED;
|
|
2334
|
+
}
|
|
2335
|
+
} else {
|
|
2336
|
+
peg$currPos = s0;
|
|
2337
|
+
s0 = peg$FAILED;
|
|
2338
|
+
}
|
|
2339
|
+
peg$silentFails--;
|
|
2340
|
+
if (s0 === peg$FAILED) {
|
|
2341
|
+
s1 = peg$FAILED;
|
|
2342
|
+
if (peg$silentFails === 0) {
|
|
2343
|
+
peg$fail(peg$e15);
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
return s0;
|
|
2347
|
+
}
|
|
2348
|
+
function peg$parsespaceOrComma() {
|
|
2349
|
+
var s0, s1;
|
|
2350
|
+
peg$silentFails++;
|
|
2351
|
+
s0 = [];
|
|
2352
|
+
s1 = input.charAt(peg$currPos);
|
|
2353
|
+
if (peg$r0.test(s1)) {
|
|
2354
|
+
peg$currPos++;
|
|
2355
|
+
} else {
|
|
2356
|
+
s1 = peg$FAILED;
|
|
2357
|
+
if (peg$silentFails === 0) {
|
|
2358
|
+
peg$fail(peg$e18);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
while (s1 !== peg$FAILED) {
|
|
2362
|
+
s0.push(s1);
|
|
2363
|
+
s1 = input.charAt(peg$currPos);
|
|
2364
|
+
if (peg$r0.test(s1)) {
|
|
2365
|
+
peg$currPos++;
|
|
2366
|
+
} else {
|
|
2367
|
+
s1 = peg$FAILED;
|
|
2368
|
+
if (peg$silentFails === 0) {
|
|
2369
|
+
peg$fail(peg$e18);
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
peg$silentFails--;
|
|
2374
|
+
s1 = peg$FAILED;
|
|
2375
|
+
if (peg$silentFails === 0) {
|
|
2376
|
+
peg$fail(peg$e17);
|
|
2377
|
+
}
|
|
2378
|
+
return s0;
|
|
2379
|
+
}
|
|
2380
|
+
function peg$parse_() {
|
|
2381
|
+
var s0, s1;
|
|
2382
|
+
peg$silentFails++;
|
|
2383
|
+
s0 = [];
|
|
2384
|
+
s1 = input.charAt(peg$currPos);
|
|
2385
|
+
if (peg$r1.test(s1)) {
|
|
2386
|
+
peg$currPos++;
|
|
2387
|
+
} else {
|
|
2388
|
+
s1 = peg$FAILED;
|
|
2389
|
+
if (peg$silentFails === 0) {
|
|
2390
|
+
peg$fail(peg$e20);
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
while (s1 !== peg$FAILED) {
|
|
2394
|
+
s0.push(s1);
|
|
2395
|
+
s1 = input.charAt(peg$currPos);
|
|
2396
|
+
if (peg$r1.test(s1)) {
|
|
2397
|
+
peg$currPos++;
|
|
2398
|
+
} else {
|
|
2399
|
+
s1 = peg$FAILED;
|
|
2400
|
+
if (peg$silentFails === 0) {
|
|
2401
|
+
peg$fail(peg$e20);
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
peg$silentFails--;
|
|
2406
|
+
s1 = peg$FAILED;
|
|
2407
|
+
if (peg$silentFails === 0) {
|
|
2408
|
+
peg$fail(peg$e19);
|
|
2409
|
+
}
|
|
2410
|
+
return s0;
|
|
2411
|
+
}
|
|
2412
|
+
function peg$parseNUM() {
|
|
2413
|
+
var s0, s1, s2, s3, s4, s5, s6, s7;
|
|
2414
|
+
s0 = peg$currPos;
|
|
2415
|
+
s1 = input.charAt(peg$currPos);
|
|
2416
|
+
if (peg$r2.test(s1)) {
|
|
2417
|
+
peg$currPos++;
|
|
2418
|
+
} else {
|
|
2419
|
+
s1 = peg$FAILED;
|
|
2420
|
+
if (peg$silentFails === 0) {
|
|
2421
|
+
peg$fail(peg$e21);
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
if (s1 === peg$FAILED) {
|
|
2425
|
+
s1 = null;
|
|
2426
|
+
}
|
|
2427
|
+
s2 = peg$currPos;
|
|
2428
|
+
s3 = [];
|
|
2429
|
+
s4 = input.charAt(peg$currPos);
|
|
2430
|
+
if (peg$r3.test(s4)) {
|
|
2431
|
+
peg$currPos++;
|
|
2432
|
+
} else {
|
|
2433
|
+
s4 = peg$FAILED;
|
|
2434
|
+
if (peg$silentFails === 0) {
|
|
2435
|
+
peg$fail(peg$e22);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
while (s4 !== peg$FAILED) {
|
|
2439
|
+
s3.push(s4);
|
|
2440
|
+
s4 = input.charAt(peg$currPos);
|
|
2441
|
+
if (peg$r3.test(s4)) {
|
|
2442
|
+
peg$currPos++;
|
|
2443
|
+
} else {
|
|
2444
|
+
s4 = peg$FAILED;
|
|
2445
|
+
if (peg$silentFails === 0) {
|
|
2446
|
+
peg$fail(peg$e22);
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
if (input.charCodeAt(peg$currPos) === 46) {
|
|
2451
|
+
s4 = peg$c7;
|
|
2452
|
+
peg$currPos++;
|
|
2453
|
+
} else {
|
|
2454
|
+
s4 = peg$FAILED;
|
|
2455
|
+
if (peg$silentFails === 0) {
|
|
2456
|
+
peg$fail(peg$e23);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
if (s4 !== peg$FAILED) {
|
|
2460
|
+
s5 = [];
|
|
2461
|
+
s6 = input.charAt(peg$currPos);
|
|
2462
|
+
if (peg$r3.test(s6)) {
|
|
2463
|
+
peg$currPos++;
|
|
2464
|
+
} else {
|
|
2465
|
+
s6 = peg$FAILED;
|
|
2466
|
+
if (peg$silentFails === 0) {
|
|
2467
|
+
peg$fail(peg$e22);
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
if (s6 !== peg$FAILED) {
|
|
2471
|
+
while (s6 !== peg$FAILED) {
|
|
2472
|
+
s5.push(s6);
|
|
2473
|
+
s6 = input.charAt(peg$currPos);
|
|
2474
|
+
if (peg$r3.test(s6)) {
|
|
2475
|
+
peg$currPos++;
|
|
2476
|
+
} else {
|
|
2477
|
+
s6 = peg$FAILED;
|
|
2478
|
+
if (peg$silentFails === 0) {
|
|
2479
|
+
peg$fail(peg$e22);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
} else {
|
|
2484
|
+
s5 = peg$FAILED;
|
|
2485
|
+
}
|
|
2486
|
+
if (s5 !== peg$FAILED) {
|
|
2487
|
+
s3 = [s3, s4, s5];
|
|
2488
|
+
s2 = s3;
|
|
2489
|
+
} else {
|
|
2490
|
+
peg$currPos = s2;
|
|
2491
|
+
s2 = peg$FAILED;
|
|
2492
|
+
}
|
|
2493
|
+
} else {
|
|
2494
|
+
peg$currPos = s2;
|
|
2495
|
+
s2 = peg$FAILED;
|
|
2496
|
+
}
|
|
2497
|
+
if (s2 === peg$FAILED) {
|
|
2498
|
+
s2 = [];
|
|
2499
|
+
s3 = input.charAt(peg$currPos);
|
|
2500
|
+
if (peg$r3.test(s3)) {
|
|
2501
|
+
peg$currPos++;
|
|
2502
|
+
} else {
|
|
2503
|
+
s3 = peg$FAILED;
|
|
2504
|
+
if (peg$silentFails === 0) {
|
|
2505
|
+
peg$fail(peg$e22);
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
if (s3 !== peg$FAILED) {
|
|
2509
|
+
while (s3 !== peg$FAILED) {
|
|
2510
|
+
s2.push(s3);
|
|
2511
|
+
s3 = input.charAt(peg$currPos);
|
|
2512
|
+
if (peg$r3.test(s3)) {
|
|
2513
|
+
peg$currPos++;
|
|
2514
|
+
} else {
|
|
2515
|
+
s3 = peg$FAILED;
|
|
2516
|
+
if (peg$silentFails === 0) {
|
|
2517
|
+
peg$fail(peg$e22);
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
} else {
|
|
2522
|
+
s2 = peg$FAILED;
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
if (s2 !== peg$FAILED) {
|
|
2526
|
+
s3 = peg$currPos;
|
|
2527
|
+
if (input.charCodeAt(peg$currPos) === 101) {
|
|
2528
|
+
s4 = peg$c8;
|
|
2529
|
+
peg$currPos++;
|
|
2530
|
+
} else {
|
|
2531
|
+
s4 = peg$FAILED;
|
|
2532
|
+
if (peg$silentFails === 0) {
|
|
2533
|
+
peg$fail(peg$e24);
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
if (s4 !== peg$FAILED) {
|
|
2537
|
+
s5 = input.charAt(peg$currPos);
|
|
2538
|
+
if (peg$r2.test(s5)) {
|
|
2539
|
+
peg$currPos++;
|
|
2540
|
+
} else {
|
|
2541
|
+
s5 = peg$FAILED;
|
|
2542
|
+
if (peg$silentFails === 0) {
|
|
2543
|
+
peg$fail(peg$e21);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
if (s5 === peg$FAILED) {
|
|
2547
|
+
s5 = null;
|
|
2548
|
+
}
|
|
2549
|
+
s6 = [];
|
|
2550
|
+
s7 = input.charAt(peg$currPos);
|
|
2551
|
+
if (peg$r3.test(s7)) {
|
|
2552
|
+
peg$currPos++;
|
|
2553
|
+
} else {
|
|
2554
|
+
s7 = peg$FAILED;
|
|
2555
|
+
if (peg$silentFails === 0) {
|
|
2556
|
+
peg$fail(peg$e22);
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
if (s7 !== peg$FAILED) {
|
|
2560
|
+
while (s7 !== peg$FAILED) {
|
|
2561
|
+
s6.push(s7);
|
|
2562
|
+
s7 = input.charAt(peg$currPos);
|
|
2563
|
+
if (peg$r3.test(s7)) {
|
|
2564
|
+
peg$currPos++;
|
|
2565
|
+
} else {
|
|
2566
|
+
s7 = peg$FAILED;
|
|
2567
|
+
if (peg$silentFails === 0) {
|
|
2568
|
+
peg$fail(peg$e22);
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
} else {
|
|
2573
|
+
s6 = peg$FAILED;
|
|
2574
|
+
}
|
|
2575
|
+
if (s6 !== peg$FAILED) {
|
|
2576
|
+
s4 = [s4, s5, s6];
|
|
2577
|
+
s3 = s4;
|
|
2578
|
+
} else {
|
|
2579
|
+
peg$currPos = s3;
|
|
2580
|
+
s3 = peg$FAILED;
|
|
2581
|
+
}
|
|
2582
|
+
} else {
|
|
2583
|
+
peg$currPos = s3;
|
|
2584
|
+
s3 = peg$FAILED;
|
|
2585
|
+
}
|
|
2586
|
+
if (s3 === peg$FAILED) {
|
|
2587
|
+
s3 = null;
|
|
2588
|
+
}
|
|
2589
|
+
peg$savedPos = s0;
|
|
2590
|
+
s0 = peg$f8();
|
|
2591
|
+
} else {
|
|
2592
|
+
peg$currPos = s0;
|
|
2593
|
+
s0 = peg$FAILED;
|
|
2594
|
+
}
|
|
2595
|
+
return s0;
|
|
2596
|
+
}
|
|
2597
|
+
peg$result = peg$startRuleFunction();
|
|
2598
|
+
if (options.peg$library) {
|
|
2599
|
+
return {
|
|
2600
|
+
peg$result,
|
|
2601
|
+
peg$currPos,
|
|
2602
|
+
peg$FAILED,
|
|
2603
|
+
peg$maxFailExpected,
|
|
2604
|
+
peg$maxFailPos
|
|
2605
|
+
};
|
|
2606
|
+
}
|
|
2607
|
+
if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
|
2608
|
+
return peg$result;
|
|
2609
|
+
} else {
|
|
2610
|
+
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
|
2611
|
+
peg$fail(peg$endExpectation());
|
|
2612
|
+
}
|
|
2613
|
+
throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
module.exports = {
|
|
2617
|
+
StartRules: ["start"],
|
|
2618
|
+
SyntaxError: peg$SyntaxError,
|
|
2619
|
+
parse: peg$parse
|
|
2620
|
+
};
|
|
2621
|
+
});
|
|
2622
|
+
|
|
2623
|
+
// node_modules/@ankhorage/color-theory/dist/harmony.js
|
|
2624
|
+
var COLOR_HARMONY_CATALOG = [
|
|
2625
|
+
{
|
|
2626
|
+
id: "monochromatic",
|
|
2627
|
+
label: "Monochromatic",
|
|
2628
|
+
description: "Uses one hue with ramp variation.",
|
|
2629
|
+
offsets: [0],
|
|
2630
|
+
roles: ["primary"],
|
|
2631
|
+
roleCount: 1
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
id: "analogous",
|
|
2635
|
+
label: "Analogous",
|
|
2636
|
+
description: "Uses the primary hue and its two neighboring hues at minus and plus 30 degrees.",
|
|
2637
|
+
offsets: [0, -30, 30],
|
|
2638
|
+
roles: ["primary", "secondary", "tertiary"],
|
|
2639
|
+
roleCount: 3
|
|
2640
|
+
},
|
|
2641
|
+
{
|
|
2642
|
+
id: "complementary",
|
|
2643
|
+
label: "Complementary",
|
|
2644
|
+
description: "Pairs the primary hue with its opposite hue at 180 degrees.",
|
|
2645
|
+
offsets: [0, 180],
|
|
2646
|
+
roles: ["primary", "secondary"],
|
|
2647
|
+
roleCount: 2
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
id: "splitComplementary",
|
|
2651
|
+
label: "Split complementary",
|
|
2652
|
+
description: "Uses the primary hue with hues at 150 and 210 degrees.",
|
|
2653
|
+
offsets: [0, 150, 210],
|
|
2654
|
+
roles: ["primary", "secondary", "tertiary"],
|
|
2655
|
+
roleCount: 3
|
|
2656
|
+
},
|
|
2657
|
+
{
|
|
2658
|
+
id: "triadic",
|
|
2659
|
+
label: "Triadic",
|
|
2660
|
+
description: "Uses three evenly spaced hues at 120-degree intervals.",
|
|
2661
|
+
offsets: [0, 120, 240],
|
|
2662
|
+
roles: ["primary", "secondary", "tertiary"],
|
|
2663
|
+
roleCount: 3
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
id: "tetradic",
|
|
2667
|
+
label: "Tetradic",
|
|
2668
|
+
description: "Uses a rectangular tetrad at 0, 60, 180, and 240 degrees.",
|
|
2669
|
+
offsets: [0, 60, 180, 240],
|
|
2670
|
+
roles: ["primary", "secondary", "tertiary", "quaternary"],
|
|
2671
|
+
roleCount: 4
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
id: "square",
|
|
2675
|
+
label: "Square",
|
|
2676
|
+
description: "Uses four evenly spaced hues at 90-degree intervals.",
|
|
2677
|
+
offsets: [0, 90, 180, 270],
|
|
2678
|
+
roles: ["primary", "secondary", "tertiary", "quaternary"],
|
|
2679
|
+
roleCount: 4
|
|
2680
|
+
}
|
|
2681
|
+
];
|
|
2682
|
+
var COLOR_HARMONIES = COLOR_HARMONY_CATALOG.map(({ id }) => id);
|
|
2683
|
+
var MIN_HUEFUL_CHROMA = 0.015;
|
|
2684
|
+
function createHarmonyGenerationDiagnostics(primaryChroma) {
|
|
2685
|
+
const warnings = [];
|
|
2686
|
+
if (primaryChroma === 0) {
|
|
2687
|
+
warnings.push({
|
|
2688
|
+
code: "achromatic_primary",
|
|
2689
|
+
message: "The selected primary is achromatic, so generated hue relationships are not visible."
|
|
2690
|
+
});
|
|
2691
|
+
} else if (primaryChroma < MIN_HUEFUL_CHROMA) {
|
|
2692
|
+
warnings.push({
|
|
2693
|
+
code: "low_chroma_primary",
|
|
2694
|
+
message: "The selected primary has low chroma, so generated hue relationships may be weak."
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
return {
|
|
2698
|
+
isHueReliable: primaryChroma >= MIN_HUEFUL_CHROMA,
|
|
2699
|
+
primaryChroma,
|
|
2700
|
+
warnings
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
function getHarmonyDefinition(harmony) {
|
|
2704
|
+
const definition = COLOR_HARMONY_CATALOG.find(({ id }) => id === harmony);
|
|
2705
|
+
if (!definition) {
|
|
2706
|
+
throw new Error(`[color-theory] Missing definition for harmony ${harmony}.`);
|
|
2707
|
+
}
|
|
2708
|
+
return definition;
|
|
2709
|
+
}
|
|
2710
|
+
function generateHarmonyRoleColors(primaryColor, harmony) {
|
|
2711
|
+
const base = parseHexToOklch(primaryColor);
|
|
2712
|
+
const definition = getHarmonyDefinition(harmony);
|
|
2713
|
+
const baseHue = normalizeHueDegrees(base.h);
|
|
2714
|
+
const colors = definition.roles.map((role, index) => {
|
|
2715
|
+
const hueDegrees = normalizeHueDegrees(baseHue + (definition.offsets.at(index) ?? 0));
|
|
2716
|
+
return {
|
|
2717
|
+
role,
|
|
2718
|
+
hex: role === "primary" ? primaryColor : oklchToHex({ ...base, h: hueDegrees }),
|
|
2719
|
+
hueDegrees,
|
|
2720
|
+
source: role === "primary" ? "selected" : "generated"
|
|
2721
|
+
};
|
|
2722
|
+
});
|
|
2723
|
+
const primary = colors.find((color) => color.role === "primary");
|
|
2724
|
+
if (!primary) {
|
|
2725
|
+
throw new Error("[color-theory] Expected generated harmony role colors to include primary.");
|
|
2726
|
+
}
|
|
2727
|
+
const secondary = colors.find((color) => color.role === "secondary");
|
|
2728
|
+
const tertiary = colors.find((color) => color.role === "tertiary");
|
|
2729
|
+
const quaternary = colors.find((color) => color.role === "quaternary");
|
|
2730
|
+
return {
|
|
2731
|
+
harmony,
|
|
2732
|
+
colors,
|
|
2733
|
+
primary,
|
|
2734
|
+
...secondary ? { secondary } : {},
|
|
2735
|
+
...tertiary ? { tertiary } : {},
|
|
2736
|
+
...quaternary ? { quaternary } : {},
|
|
2737
|
+
diagnostics: createHarmonyGenerationDiagnostics(base.c)
|
|
2738
|
+
};
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
// node_modules/@ankhorage/color-theory/dist/swatches.js
|
|
2742
|
+
var COLOR_SWATCH_STEPS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
2743
|
+
var COLOR_SWATCH_BASE_STEP = 500;
|
|
2744
|
+
var COLOR_SWATCH_BASE_LIGHTNESS = 0.551;
|
|
2745
|
+
var BASELINE_LIGHTNESS_BY_STEP = new Map([
|
|
2746
|
+
[50, 0.985],
|
|
2747
|
+
[100, 0.967],
|
|
2748
|
+
[200, 0.928],
|
|
2749
|
+
[300, 0.872],
|
|
2750
|
+
[400, 0.707],
|
|
2751
|
+
[COLOR_SWATCH_BASE_STEP, COLOR_SWATCH_BASE_LIGHTNESS],
|
|
2752
|
+
[600, 0.446],
|
|
2753
|
+
[700, 0.373],
|
|
2754
|
+
[800, 0.278],
|
|
2755
|
+
[900, 0.21],
|
|
2756
|
+
[950, 0.13]
|
|
2757
|
+
]);
|
|
2758
|
+
var MIN_USABLE_ADJACENT_DELTA = 0.012;
|
|
2759
|
+
var MIN_USABLE_LIGHTNESS_RANGE = 0.35;
|
|
2760
|
+
function clamp01(value) {
|
|
2761
|
+
if (!Number.isFinite(value))
|
|
2762
|
+
return 0;
|
|
2763
|
+
return Math.min(1, Math.max(0, value));
|
|
2764
|
+
}
|
|
2765
|
+
function chromaMultiplierForStep(step) {
|
|
2766
|
+
if (step <= 200)
|
|
2767
|
+
return 0.55;
|
|
2768
|
+
if (step <= 400)
|
|
2769
|
+
return 0.75;
|
|
2770
|
+
if (step === COLOR_SWATCH_BASE_STEP)
|
|
2771
|
+
return 1;
|
|
2772
|
+
if (step <= 700)
|
|
2773
|
+
return 0.9;
|
|
2774
|
+
return 0.8;
|
|
2775
|
+
}
|
|
2776
|
+
function getBaselineLightness(step) {
|
|
2777
|
+
const lightness = BASELINE_LIGHTNESS_BY_STEP.get(step);
|
|
2778
|
+
if (lightness === undefined) {
|
|
2779
|
+
throw new Error(`[color-theory] Missing baseline lightness for swatch step ${step}.`);
|
|
2780
|
+
}
|
|
2781
|
+
return lightness;
|
|
2782
|
+
}
|
|
2783
|
+
function createSwatchSample(baseColor, step, baseOffset) {
|
|
2784
|
+
const base = parseHexToOklch(baseColor);
|
|
2785
|
+
if (step === COLOR_SWATCH_BASE_STEP) {
|
|
2786
|
+
return { hex: baseColor, lightness: base.l, step };
|
|
2787
|
+
}
|
|
2788
|
+
const target = {
|
|
2789
|
+
...base,
|
|
2790
|
+
l: clamp01(getBaselineLightness(step) + baseOffset),
|
|
2791
|
+
c: clamp01(base.c * chromaMultiplierForStep(step))
|
|
2792
|
+
};
|
|
2793
|
+
const hex = oklchToHex(target);
|
|
2794
|
+
return { hex, lightness: parseHexToOklch(hex).l, step };
|
|
2795
|
+
}
|
|
2796
|
+
function createWeakStepWarning(baseColor, sample) {
|
|
2797
|
+
if (sample.step === COLOR_SWATCH_BASE_STEP)
|
|
2798
|
+
return;
|
|
2799
|
+
const deltaEFromBase = deltaEoklch(parseHexToOklch(baseColor), parseHexToOklch(sample.hex));
|
|
2800
|
+
if (deltaEFromBase >= 0.02)
|
|
2801
|
+
return;
|
|
2802
|
+
return {
|
|
2803
|
+
code: "weak_step",
|
|
2804
|
+
step: sample.step,
|
|
2805
|
+
deltaEFromBase,
|
|
2806
|
+
message: `Swatch step ${sample.step} is visually close to the base color.`
|
|
2807
|
+
};
|
|
2808
|
+
}
|
|
2809
|
+
function generateSwatchSamples(baseColor) {
|
|
2810
|
+
const baseOffset = parseHexToOklch(baseColor).l - COLOR_SWATCH_BASE_LIGHTNESS;
|
|
2811
|
+
const samples = COLOR_SWATCH_STEPS.map((step) => createSwatchSample(baseColor, step, baseOffset));
|
|
2812
|
+
const warnings = samples.map((sample) => createWeakStepWarning(baseColor, sample)).filter((warning) => warning !== undefined);
|
|
2813
|
+
return { samples, warnings };
|
|
2814
|
+
}
|
|
2815
|
+
function measureAdjacentSamples(samples) {
|
|
2816
|
+
const pairs = samples.slice(1).map((current, index) => ({ current, previous: samples.at(index) }));
|
|
2817
|
+
const measured = pairs.flatMap(({ current, previous }) => {
|
|
2818
|
+
if (!previous)
|
|
2819
|
+
return [];
|
|
2820
|
+
const delta = deltaEoklch(parseHexToOklch(previous.hex), parseHexToOklch(current.hex));
|
|
2821
|
+
const warning = delta < MIN_USABLE_ADJACENT_DELTA ? {
|
|
2822
|
+
code: "weak_adjacent_delta",
|
|
2823
|
+
step: current.step,
|
|
2824
|
+
deltaEFromBase: delta,
|
|
2825
|
+
message: `Swatch step ${current.step} is visually close to adjacent step ${previous.step}.`
|
|
2826
|
+
} : undefined;
|
|
2827
|
+
return [{ delta, warning }];
|
|
2828
|
+
});
|
|
2829
|
+
return {
|
|
2830
|
+
deltas: measured.map(({ delta }) => delta),
|
|
2831
|
+
warnings: measured.map(({ warning }) => warning).filter((warning) => warning !== undefined)
|
|
2832
|
+
};
|
|
2833
|
+
}
|
|
2834
|
+
function createSwatchDiagnostics(samples, adjacentDeltas, warnings) {
|
|
2835
|
+
const minAdjacentDelta = Math.min(...adjacentDeltas);
|
|
2836
|
+
const maxAdjacentDelta = Math.max(...adjacentDeltas);
|
|
2837
|
+
const lightnessEntries = samples.map(({ lightness }) => lightness);
|
|
2838
|
+
const minLightness = Math.min(...lightnessEntries);
|
|
2839
|
+
const maxLightness = Math.max(...lightnessEntries);
|
|
2840
|
+
const lightnessRange = maxLightness - minLightness;
|
|
2841
|
+
const rangeWarnings = lightnessRange < MIN_USABLE_LIGHTNESS_RANGE ? [
|
|
2842
|
+
{
|
|
2843
|
+
code: "limited_lightness_range",
|
|
2844
|
+
message: "Generated swatch has a limited lightness range."
|
|
2845
|
+
}
|
|
2846
|
+
] : [];
|
|
2847
|
+
return {
|
|
2848
|
+
isUsable: minAdjacentDelta >= MIN_USABLE_ADJACENT_DELTA && lightnessRange >= MIN_USABLE_LIGHTNESS_RANGE,
|
|
2849
|
+
warnings: [...warnings, ...rangeWarnings],
|
|
2850
|
+
minAdjacentDelta,
|
|
2851
|
+
maxAdjacentDelta,
|
|
2852
|
+
lightnessRange: { min: minLightness, max: maxLightness }
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
function generateColorSwatch(baseColor) {
|
|
2856
|
+
const generated = generateSwatchSamples(baseColor);
|
|
2857
|
+
const adjacent = measureAdjacentSamples(generated.samples);
|
|
2858
|
+
const swatch = Object.fromEntries(generated.samples.map(({ hex, step }) => [step, hex]));
|
|
2859
|
+
return {
|
|
2860
|
+
swatch,
|
|
2861
|
+
diagnostics: createSwatchDiagnostics(generated.samples, adjacent.deltas, [
|
|
2862
|
+
...generated.warnings,
|
|
2863
|
+
...adjacent.warnings
|
|
2864
|
+
])
|
|
2865
|
+
};
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
// src/features/color/ColorHueScale.tsx
|
|
2869
|
+
import { Pressable } from "@ankhorage/surface/web";
|
|
2870
|
+
|
|
2871
|
+
// src/features/color/ColorHexField.tsx
|
|
2872
|
+
import { useClipboardWriter, writeClipboardTextAsync } from "@ankhorage/runtime";
|
|
2873
|
+
import { TextInput } from "@ankhorage/surface/web";
|
|
2874
|
+
import React from "react";
|
|
2875
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2876
|
+
function ColorHexField({
|
|
2877
|
+
disabled,
|
|
2878
|
+
onChange,
|
|
2879
|
+
value
|
|
2880
|
+
}) {
|
|
2881
|
+
const [input, setInput] = React.useState(value);
|
|
2882
|
+
const [previousValue, setPreviousValue] = React.useState(value);
|
|
2883
|
+
const [copyFeedback, setCopyFeedback] = React.useState();
|
|
2884
|
+
const clipboardWriter = useClipboardWriter();
|
|
2885
|
+
const { theme } = useZoraTheme2();
|
|
2886
|
+
if (value !== previousValue) {
|
|
2887
|
+
setPreviousValue(value);
|
|
2888
|
+
setInput(value);
|
|
2889
|
+
}
|
|
2890
|
+
return /* @__PURE__ */ jsxs(View2, {
|
|
2891
|
+
children: [
|
|
2892
|
+
/* @__PURE__ */ jsx(TextInput, {
|
|
2893
|
+
accessibilityLabel: "Color hex value",
|
|
2894
|
+
disabled,
|
|
2895
|
+
leadingAccessory: /* @__PURE__ */ jsx(View2, {
|
|
2896
|
+
bg: value,
|
|
2897
|
+
borderColor: theme.semantics.border.default,
|
|
2898
|
+
borderWidth: 1,
|
|
2899
|
+
height: 30,
|
|
2900
|
+
radius: "s",
|
|
2901
|
+
width: 30
|
|
2902
|
+
}),
|
|
2903
|
+
onChangeText: (nextValue) => {
|
|
2904
|
+
setInput(nextValue);
|
|
2905
|
+
if (isHexColor(nextValue))
|
|
2906
|
+
onChange(nextValue);
|
|
2907
|
+
},
|
|
2908
|
+
trailingAccessory: /* @__PURE__ */ jsx(IconButton2, {
|
|
2909
|
+
iconName: copyFeedback === "Color hex copied." ? "checkmark" : copyFeedback ? "warning" : "copy-outline",
|
|
2910
|
+
label: copyFeedback ?? "Copy color hex value",
|
|
2911
|
+
disabled,
|
|
2912
|
+
onPress: () => {
|
|
2913
|
+
writeClipboardTextAsync(clipboardWriter, value).then((result) => {
|
|
2914
|
+
setCopyFeedback(result === "written" ? "Color hex copied." : result === "denied" ? "Clipboard access was denied." : "Clipboard is unavailable.");
|
|
2915
|
+
});
|
|
2916
|
+
},
|
|
2917
|
+
variant: "ghost"
|
|
2918
|
+
}),
|
|
2919
|
+
value: input
|
|
2920
|
+
}),
|
|
2921
|
+
copyFeedback ? /* @__PURE__ */ jsx(Text2, {
|
|
2922
|
+
accessibilityLiveRegion: "polite",
|
|
2923
|
+
emphasis: "muted",
|
|
2924
|
+
style: { position: "absolute", opacity: 0 },
|
|
2925
|
+
variant: "caption",
|
|
2926
|
+
children: copyFeedback
|
|
2927
|
+
}) : null
|
|
2928
|
+
]
|
|
2929
|
+
});
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
// src/features/color/ColorSpectrumSlider.tsx
|
|
2933
|
+
import React5 from "react";
|
|
2934
|
+
|
|
2935
|
+
// node_modules/react-native-svg/lib/module/xml.js
|
|
2936
|
+
import * as React3 from "react";
|
|
2937
|
+
import { Component, useEffect, useMemo, useState } from "react";
|
|
2938
|
+
|
|
2939
|
+
// node_modules/react-native-svg/lib/module/utils/fetchData.js
|
|
2940
|
+
import { Platform } from "react-native-web";
|
|
2941
|
+
|
|
2942
|
+
// node_modules/react-native-svg/lib/module/web/utils/index.js
|
|
2943
|
+
var camelCaseToDashed = (camelCase) => {
|
|
2944
|
+
return camelCase.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
|
|
2945
|
+
};
|
|
2946
|
+
var getBoundingClientRect = (node) => {
|
|
2947
|
+
if (node) {
|
|
2948
|
+
const isElement = node.nodeType === 1;
|
|
2949
|
+
if (isElement && typeof node.getBoundingClientRect === "function") {
|
|
2950
|
+
return node.getBoundingClientRect();
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
throw new Error("Can not get boundingClientRect of " + node || "undefined");
|
|
2954
|
+
};
|
|
2955
|
+
var measureLayout = (node, callback) => {
|
|
2956
|
+
const relativeNode = node === null || node === undefined ? undefined : node.parentNode;
|
|
2957
|
+
if (relativeNode) {
|
|
2958
|
+
setTimeout(() => {
|
|
2959
|
+
const relativeRect = getBoundingClientRect(relativeNode);
|
|
2960
|
+
const {
|
|
2961
|
+
height,
|
|
2962
|
+
left,
|
|
2963
|
+
top,
|
|
2964
|
+
width
|
|
2965
|
+
} = getBoundingClientRect(node);
|
|
2966
|
+
const x = left - relativeRect.left;
|
|
2967
|
+
const y = top - relativeRect.top;
|
|
2968
|
+
callback(x, y, width, height, left, top);
|
|
2969
|
+
}, 0);
|
|
2970
|
+
}
|
|
2971
|
+
};
|
|
2972
|
+
function remeasure() {
|
|
2973
|
+
const tag = this.state.touchable.responderID;
|
|
2974
|
+
if (tag === null) {
|
|
2975
|
+
return;
|
|
2976
|
+
}
|
|
2977
|
+
measureLayout(tag, this._handleQueryLayout);
|
|
2978
|
+
}
|
|
2979
|
+
function encodeSvg(svgString) {
|
|
2980
|
+
return svgString.replace("<svg", ~svgString.indexOf("xmlns") ? "<svg" : '<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/{/g, "%7B").replace(/}/g, "%7D").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
2981
|
+
}
|
|
2982
|
+
var KEEP_CAMEL_CASE = new Set(["stdDeviation", "edgeMode", "kernelMatrix", "kernelUnitLength", "preserveAlpha", "baseFrequency", "targetX", "targetY", "numOctaves", "stitchTiles", "filterUnits", "primitiveUnits", "pathLength", "gradientUnits", "gradientTransform", "spreadMethod", "markerHeight", "markerUnits", "markerWidth", "viewBox", "refX", "refY", "maskContentUnits", "maskUnits", "patternContentUnits", "patternTransform", "patternUnits", "textLength", "lengthAdjust", "startOffset", "clipPathUnits"]);
|
|
2983
|
+
var getAttributeName = (attr) => {
|
|
2984
|
+
return KEEP_CAMEL_CASE.has(attr) ? attr : camelCaseToDashed(attr);
|
|
2985
|
+
};
|
|
2986
|
+
|
|
2987
|
+
// node_modules/react-native-svg/lib/module/web/WebShape.js
|
|
2988
|
+
import React2 from "react";
|
|
2989
|
+
import {
|
|
2990
|
+
unstable_createElement as createElement
|
|
2991
|
+
} from "react-native-web";
|
|
2992
|
+
|
|
2993
|
+
// node_modules/react-native-svg/lib/module/web/utils/hasProperty.js
|
|
2994
|
+
function hasTouchableProperty(props) {
|
|
2995
|
+
return !!(props.onPress || props.onPressIn || props.onPressOut || props.onLongPress);
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
// node_modules/react-native-svg/lib/module/lib/Matrix2D.js
|
|
2999
|
+
var DEG_TO_RAD = Math.PI / 180;
|
|
3000
|
+
|
|
3001
|
+
// node_modules/react-native-svg/lib/module/lib/extract/extractTransform.js
|
|
3002
|
+
var import_transform = __toESM(require_transform());
|
|
3003
|
+
var import_transformToRn = __toESM(require_transformToRn());
|
|
3004
|
+
var getAngleValueInDeg = (angle) => {
|
|
3005
|
+
if (angle.endsWith("rad")) {
|
|
3006
|
+
return parseFloat(angle) * (180 / Math.PI);
|
|
3007
|
+
}
|
|
3008
|
+
if (angle.endsWith("deg")) {
|
|
3009
|
+
return parseFloat(angle);
|
|
3010
|
+
}
|
|
3011
|
+
};
|
|
3012
|
+
function stringifyTransformArrayProps(transformArray) {
|
|
3013
|
+
if (!transformArray) {
|
|
3014
|
+
return "";
|
|
3015
|
+
}
|
|
3016
|
+
return transformArray.map((transform) => {
|
|
3017
|
+
const [key, value] = Object.entries(transform)[0];
|
|
3018
|
+
switch (key) {
|
|
3019
|
+
case "translateX":
|
|
3020
|
+
return `translate(${value}, 0)`;
|
|
3021
|
+
case "translateY":
|
|
3022
|
+
return `translate(0, ${value})`;
|
|
3023
|
+
case "rotate":
|
|
3024
|
+
return `rotate(${getAngleValueInDeg(value)})`;
|
|
3025
|
+
case "scale":
|
|
3026
|
+
return `scale(${value})`;
|
|
3027
|
+
case "scaleX":
|
|
3028
|
+
return `scale(${value}, 1)`;
|
|
3029
|
+
case "scaleY":
|
|
3030
|
+
return `scale(1, ${value})`;
|
|
3031
|
+
case "skewX":
|
|
3032
|
+
return `skewX(${getAngleValueInDeg(value)})`;
|
|
3033
|
+
case "skewY":
|
|
3034
|
+
return `skewY(${getAngleValueInDeg(value)})`;
|
|
3035
|
+
case "matrix":
|
|
3036
|
+
return `matrix(${value.join(", ")})`;
|
|
3037
|
+
default:
|
|
3038
|
+
return "";
|
|
3039
|
+
}
|
|
3040
|
+
}).join(" ");
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
// node_modules/react-native-svg/lib/module/web/utils/parseTransform.js
|
|
3044
|
+
function parseTransformProp(transform, props) {
|
|
3045
|
+
const transformArray = [];
|
|
3046
|
+
props && transformArray.push(...stringifyTransformProps(props));
|
|
3047
|
+
if (Array.isArray(transform)) {
|
|
3048
|
+
if (typeof transform[0] === "number") {
|
|
3049
|
+
transformArray.push(`matrix(${transform.join(" ")})`);
|
|
3050
|
+
} else {
|
|
3051
|
+
const stringifiedProps = stringifyTransformArrayProps(transform).split(" ");
|
|
3052
|
+
transformArray.push(...stringifiedProps);
|
|
3053
|
+
}
|
|
3054
|
+
} else if (typeof transform === "string") {
|
|
3055
|
+
transformArray.push(transform);
|
|
3056
|
+
}
|
|
3057
|
+
return transformArray.length ? transformArray.join(" ") : undefined;
|
|
3058
|
+
}
|
|
3059
|
+
function stringifyTransformProps(transformProps) {
|
|
3060
|
+
const transformArray = [];
|
|
3061
|
+
if (transformProps.translate != null) {
|
|
3062
|
+
transformArray.push(`translate(${transformProps.translate})`);
|
|
3063
|
+
}
|
|
3064
|
+
if (transformProps.translateX != null || transformProps.translateY != null) {
|
|
3065
|
+
transformArray.push(`translate(${transformProps.translateX || 0}, ${transformProps.translateY || 0})`);
|
|
3066
|
+
}
|
|
3067
|
+
if (transformProps.scale != null) {
|
|
3068
|
+
transformArray.push(`scale(${transformProps.scale})`);
|
|
3069
|
+
}
|
|
3070
|
+
if (transformProps.scaleX != null || transformProps.scaleY != null) {
|
|
3071
|
+
transformArray.push(`scale(${transformProps.scaleX || 1}, ${transformProps.scaleY || 1})`);
|
|
3072
|
+
}
|
|
3073
|
+
if (transformProps.rotation != null) {
|
|
3074
|
+
transformArray.push(`rotate(${transformProps.rotation})`);
|
|
3075
|
+
}
|
|
3076
|
+
if (transformProps.skewX != null) {
|
|
3077
|
+
transformArray.push(`skewX(${transformProps.skewX})`);
|
|
3078
|
+
}
|
|
3079
|
+
if (transformProps.skewY != null) {
|
|
3080
|
+
transformArray.push(`skewY(${transformProps.skewY})`);
|
|
3081
|
+
}
|
|
3082
|
+
return transformArray;
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
// node_modules/react-native-svg/lib/module/lib/resolve.js
|
|
3086
|
+
import { StyleSheet } from "react-native-web";
|
|
3087
|
+
function resolve(styleProp, cleanedProps) {
|
|
3088
|
+
if (styleProp) {
|
|
3089
|
+
return StyleSheet ? [styleProp, cleanedProps] : styleProp[Symbol.iterator] ? Object.assign({}, ...styleProp, cleanedProps) : Object.assign({}, styleProp, cleanedProps);
|
|
3090
|
+
} else {
|
|
3091
|
+
return cleanedProps;
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
// node_modules/react-native-svg/lib/module/lib/resolveAssetUri.js
|
|
3096
|
+
var import_registry = __toESM(require_registry());
|
|
3097
|
+
import { PixelRatio } from "react-native-web";
|
|
3098
|
+
var svgDataUriPattern = /^(data:image\/svg\+xml;utf8,)(.*)/;
|
|
3099
|
+
function resolveAssetUri(source) {
|
|
3100
|
+
let src = {};
|
|
3101
|
+
if (typeof source === "number") {
|
|
3102
|
+
const asset = import_registry.getAssetByID(source);
|
|
3103
|
+
if (asset == null) {
|
|
3104
|
+
throw new Error(`Image: asset with ID "${source}" could not be found. Please check the image source or packager.`);
|
|
3105
|
+
}
|
|
3106
|
+
src = {
|
|
3107
|
+
width: asset.width,
|
|
3108
|
+
height: asset.height,
|
|
3109
|
+
scale: asset.scales[0]
|
|
3110
|
+
};
|
|
3111
|
+
if (asset.scales.length > 1) {
|
|
3112
|
+
const preferredScale = PixelRatio.get();
|
|
3113
|
+
src.scale = asset.scales.reduce((prev, curr) => Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale) ? curr : prev);
|
|
3114
|
+
}
|
|
3115
|
+
const scaleSuffix = src.scale !== 1 ? `@${src.scale}x` : "";
|
|
3116
|
+
src.uri = asset ? `${asset.httpServerLocation}/${asset.name}${scaleSuffix}.${asset.type}` : "";
|
|
3117
|
+
} else if (typeof source === "string") {
|
|
3118
|
+
src.uri = source;
|
|
3119
|
+
} else if (source && !Array.isArray(source) && typeof source.uri === "string") {
|
|
3120
|
+
src.uri = source.uri;
|
|
3121
|
+
}
|
|
3122
|
+
if (src.uri) {
|
|
3123
|
+
var _src;
|
|
3124
|
+
const match = (_src = src) === null || _src === undefined || (_src = _src.uri) === null || _src === undefined ? undefined : _src.match(svgDataUriPattern);
|
|
3125
|
+
if (match) {
|
|
3126
|
+
const [, prefix, svg] = match;
|
|
3127
|
+
const encodedSvg = encodeURIComponent(svg);
|
|
3128
|
+
src.uri = `${prefix}${encodedSvg}`;
|
|
3129
|
+
return src;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
return src;
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
// node_modules/react-native-svg/lib/module/web/utils/prepare.js
|
|
3136
|
+
var prepare = (self, props = self.props) => {
|
|
3137
|
+
const {
|
|
3138
|
+
transform,
|
|
3139
|
+
origin,
|
|
3140
|
+
originX,
|
|
3141
|
+
originY,
|
|
3142
|
+
fontFamily,
|
|
3143
|
+
fontSize,
|
|
3144
|
+
fontWeight,
|
|
3145
|
+
fontStyle,
|
|
3146
|
+
style,
|
|
3147
|
+
forwardedRef,
|
|
3148
|
+
gradientTransform,
|
|
3149
|
+
patternTransform,
|
|
3150
|
+
onPress,
|
|
3151
|
+
...rest
|
|
3152
|
+
} = props;
|
|
3153
|
+
const clean = {
|
|
3154
|
+
...hasTouchableProperty(props) ? {
|
|
3155
|
+
onStartShouldSetResponder: self.touchableHandleStartShouldSetResponder,
|
|
3156
|
+
onResponderTerminationRequest: self.touchableHandleResponderTerminationRequest,
|
|
3157
|
+
onResponderGrant: self.touchableHandleResponderGrant,
|
|
3158
|
+
onResponderMove: self.touchableHandleResponderMove,
|
|
3159
|
+
onResponderRelease: self.touchableHandleResponderRelease,
|
|
3160
|
+
onResponderTerminate: self.touchableHandleResponderTerminate
|
|
3161
|
+
} : null,
|
|
3162
|
+
...rest
|
|
3163
|
+
};
|
|
3164
|
+
if (origin != null) {
|
|
3165
|
+
clean["transform-origin"] = origin.toString().replace(",", " ");
|
|
3166
|
+
} else if (originX != null || originY != null) {
|
|
3167
|
+
clean["transform-origin"] = `${originX || 0} ${originY || 0}`;
|
|
3168
|
+
}
|
|
3169
|
+
const parsedTransform = parseTransformProp(transform, props);
|
|
3170
|
+
if (parsedTransform) {
|
|
3171
|
+
clean.transform = parsedTransform;
|
|
3172
|
+
}
|
|
3173
|
+
const parsedGradientTransform = parseTransformProp(gradientTransform);
|
|
3174
|
+
if (parsedGradientTransform) {
|
|
3175
|
+
clean.gradientTransform = parsedGradientTransform;
|
|
3176
|
+
}
|
|
3177
|
+
const parsedPatternTransform = parseTransformProp(patternTransform);
|
|
3178
|
+
if (parsedPatternTransform) {
|
|
3179
|
+
clean.patternTransform = parsedPatternTransform;
|
|
3180
|
+
}
|
|
3181
|
+
clean.ref = (el) => {
|
|
3182
|
+
self.elementRef.current = el;
|
|
3183
|
+
if (typeof forwardedRef === "function") {
|
|
3184
|
+
forwardedRef(el);
|
|
3185
|
+
} else if (forwardedRef) {
|
|
3186
|
+
forwardedRef.current = el;
|
|
3187
|
+
}
|
|
3188
|
+
};
|
|
3189
|
+
const styles = {};
|
|
3190
|
+
if (fontFamily != null) {
|
|
3191
|
+
styles.fontFamily = fontFamily;
|
|
3192
|
+
}
|
|
3193
|
+
if (fontSize != null) {
|
|
3194
|
+
styles.fontSize = fontSize;
|
|
3195
|
+
}
|
|
3196
|
+
if (fontWeight != null) {
|
|
3197
|
+
styles.fontWeight = fontWeight;
|
|
3198
|
+
}
|
|
3199
|
+
if (fontStyle != null) {
|
|
3200
|
+
styles.fontStyle = fontStyle;
|
|
3201
|
+
}
|
|
3202
|
+
clean.style = resolve(style, styles);
|
|
3203
|
+
if (onPress !== null) {
|
|
3204
|
+
clean.onClick = props.onPress;
|
|
3205
|
+
}
|
|
3206
|
+
if (props.href !== null && props.href !== undefined) {
|
|
3207
|
+
var _resolveAssetUri;
|
|
3208
|
+
clean.href = (_resolveAssetUri = resolveAssetUri(props.href)) === null || _resolveAssetUri === undefined ? undefined : _resolveAssetUri.uri;
|
|
3209
|
+
}
|
|
3210
|
+
return clean;
|
|
3211
|
+
};
|
|
3212
|
+
|
|
3213
|
+
// node_modules/react-native-svg/lib/module/web/utils/convertInt32Color.js
|
|
3214
|
+
function convertInt32ColorToRGBA(color) {
|
|
3215
|
+
const r = color >> 16 & 255;
|
|
3216
|
+
const g = color >> 8 & 255;
|
|
3217
|
+
const b = color & 255;
|
|
3218
|
+
const a = (color >> 24 & 255) / 255;
|
|
3219
|
+
const alpha = a.toFixed(2);
|
|
3220
|
+
return `rgba(${r},${g},${b},${alpha})`;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
// node_modules/react-native-svg/lib/module/lib/SvgTouchableMixin.js
|
|
3224
|
+
import { Touchable } from "react-native-web";
|
|
3225
|
+
var PRESS_RETENTION_OFFSET = {
|
|
3226
|
+
top: 20,
|
|
3227
|
+
left: 20,
|
|
3228
|
+
right: 20,
|
|
3229
|
+
bottom: 30
|
|
3230
|
+
};
|
|
3231
|
+
var {
|
|
3232
|
+
Mixin
|
|
3233
|
+
} = Touchable;
|
|
3234
|
+
var {
|
|
3235
|
+
touchableHandleStartShouldSetResponder,
|
|
3236
|
+
touchableHandleResponderTerminationRequest,
|
|
3237
|
+
touchableHandleResponderGrant,
|
|
3238
|
+
touchableHandleResponderMove,
|
|
3239
|
+
touchableHandleResponderRelease,
|
|
3240
|
+
touchableHandleResponderTerminate,
|
|
3241
|
+
touchableGetInitialState
|
|
3242
|
+
} = Mixin;
|
|
3243
|
+
var SvgTouchableMixin = {
|
|
3244
|
+
...Mixin,
|
|
3245
|
+
touchableHandleStartShouldSetResponder(e) {
|
|
3246
|
+
const {
|
|
3247
|
+
onStartShouldSetResponder
|
|
3248
|
+
} = this.props;
|
|
3249
|
+
if (onStartShouldSetResponder) {
|
|
3250
|
+
return onStartShouldSetResponder(e);
|
|
3251
|
+
} else {
|
|
3252
|
+
return touchableHandleStartShouldSetResponder.call(this, e);
|
|
3253
|
+
}
|
|
3254
|
+
},
|
|
3255
|
+
touchableHandleResponderTerminationRequest(e) {
|
|
3256
|
+
const {
|
|
3257
|
+
onResponderTerminationRequest
|
|
3258
|
+
} = this.props;
|
|
3259
|
+
if (onResponderTerminationRequest) {
|
|
3260
|
+
return onResponderTerminationRequest(e);
|
|
3261
|
+
} else {
|
|
3262
|
+
return touchableHandleResponderTerminationRequest.call(this, e);
|
|
3263
|
+
}
|
|
3264
|
+
},
|
|
3265
|
+
touchableHandleResponderGrant(e) {
|
|
3266
|
+
const {
|
|
3267
|
+
onResponderGrant
|
|
3268
|
+
} = this.props;
|
|
3269
|
+
if (onResponderGrant) {
|
|
3270
|
+
return onResponderGrant(e);
|
|
3271
|
+
} else {
|
|
3272
|
+
return touchableHandleResponderGrant.call(this, e);
|
|
3273
|
+
}
|
|
3274
|
+
},
|
|
3275
|
+
touchableHandleResponderMove(e) {
|
|
3276
|
+
const {
|
|
3277
|
+
onResponderMove
|
|
3278
|
+
} = this.props;
|
|
3279
|
+
if (onResponderMove) {
|
|
3280
|
+
return onResponderMove(e);
|
|
3281
|
+
} else {
|
|
3282
|
+
return touchableHandleResponderMove.call(this, e);
|
|
3283
|
+
}
|
|
3284
|
+
},
|
|
3285
|
+
touchableHandleResponderRelease(e) {
|
|
3286
|
+
const {
|
|
3287
|
+
onResponderRelease
|
|
3288
|
+
} = this.props;
|
|
3289
|
+
if (onResponderRelease) {
|
|
3290
|
+
return onResponderRelease(e);
|
|
3291
|
+
} else {
|
|
3292
|
+
return touchableHandleResponderRelease.call(this, e);
|
|
3293
|
+
}
|
|
3294
|
+
},
|
|
3295
|
+
touchableHandleResponderTerminate(e) {
|
|
3296
|
+
const {
|
|
3297
|
+
onResponderTerminate
|
|
3298
|
+
} = this.props;
|
|
3299
|
+
if (onResponderTerminate) {
|
|
3300
|
+
return onResponderTerminate(e);
|
|
3301
|
+
} else {
|
|
3302
|
+
return touchableHandleResponderTerminate.call(this, e);
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
touchableHandlePress(e) {
|
|
3306
|
+
const {
|
|
3307
|
+
onPress
|
|
3308
|
+
} = this.props;
|
|
3309
|
+
onPress && onPress(e);
|
|
3310
|
+
},
|
|
3311
|
+
touchableHandleActivePressIn(e) {
|
|
3312
|
+
const {
|
|
3313
|
+
onPressIn
|
|
3314
|
+
} = this.props;
|
|
3315
|
+
onPressIn && onPressIn(e);
|
|
3316
|
+
},
|
|
3317
|
+
touchableHandleActivePressOut(e) {
|
|
3318
|
+
const {
|
|
3319
|
+
onPressOut
|
|
3320
|
+
} = this.props;
|
|
3321
|
+
onPressOut && onPressOut(e);
|
|
3322
|
+
},
|
|
3323
|
+
touchableHandleLongPress(e) {
|
|
3324
|
+
const {
|
|
3325
|
+
onLongPress
|
|
3326
|
+
} = this.props;
|
|
3327
|
+
onLongPress && onLongPress(e);
|
|
3328
|
+
},
|
|
3329
|
+
touchableGetPressRectOffset() {
|
|
3330
|
+
const {
|
|
3331
|
+
pressRetentionOffset
|
|
3332
|
+
} = this.props;
|
|
3333
|
+
return pressRetentionOffset || PRESS_RETENTION_OFFSET;
|
|
3334
|
+
},
|
|
3335
|
+
touchableGetHitSlop() {
|
|
3336
|
+
const {
|
|
3337
|
+
hitSlop
|
|
3338
|
+
} = this.props;
|
|
3339
|
+
return hitSlop;
|
|
3340
|
+
},
|
|
3341
|
+
touchableGetHighlightDelayMS() {
|
|
3342
|
+
const {
|
|
3343
|
+
delayPressIn
|
|
3344
|
+
} = this.props;
|
|
3345
|
+
return delayPressIn || 0;
|
|
3346
|
+
},
|
|
3347
|
+
touchableGetLongPressDelayMS() {
|
|
3348
|
+
const {
|
|
3349
|
+
delayLongPress
|
|
3350
|
+
} = this.props;
|
|
3351
|
+
return delayLongPress === 0 ? 0 : delayLongPress || 500;
|
|
3352
|
+
},
|
|
3353
|
+
touchableGetPressOutDelayMS() {
|
|
3354
|
+
const {
|
|
3355
|
+
delayPressOut
|
|
3356
|
+
} = this.props;
|
|
3357
|
+
return delayPressOut || 0;
|
|
3358
|
+
}
|
|
3359
|
+
};
|
|
3360
|
+
var touchKeys = Object.keys(SvgTouchableMixin);
|
|
3361
|
+
var touchVals = touchKeys.map((key) => SvgTouchableMixin[key]);
|
|
3362
|
+
var numTouchKeys = touchKeys.length;
|
|
3363
|
+
var SvgTouchableMixin_default = (target) => {
|
|
3364
|
+
for (let i = 0;i < numTouchKeys; i++) {
|
|
3365
|
+
const key = touchKeys[i];
|
|
3366
|
+
const val = touchVals[i];
|
|
3367
|
+
if (typeof val === "function") {
|
|
3368
|
+
target[key] = val.bind(target);
|
|
3369
|
+
} else {
|
|
3370
|
+
target[key] = val;
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
target.state = touchableGetInitialState();
|
|
3374
|
+
};
|
|
3375
|
+
|
|
3376
|
+
// node_modules/react-native-svg/lib/module/web/WebShape.js
|
|
3377
|
+
class WebShape extends React2.Component {
|
|
3378
|
+
prepareProps(props) {
|
|
3379
|
+
return props;
|
|
3380
|
+
}
|
|
3381
|
+
elementRef = /* @__PURE__ */ React2.createRef();
|
|
3382
|
+
lastMergedProps = {};
|
|
3383
|
+
setNativeProps(props) {
|
|
3384
|
+
const merged = Object.assign({}, this.props, this.lastMergedProps, props.style);
|
|
3385
|
+
this.lastMergedProps = merged;
|
|
3386
|
+
const clean = prepare(this, this.prepareProps(merged));
|
|
3387
|
+
const current = this.elementRef.current;
|
|
3388
|
+
if (current) {
|
|
3389
|
+
for (const cleanAttribute of Object.keys(clean)) {
|
|
3390
|
+
const cleanValue = clean[cleanAttribute];
|
|
3391
|
+
switch (cleanAttribute) {
|
|
3392
|
+
case "ref":
|
|
3393
|
+
case "children":
|
|
3394
|
+
break;
|
|
3395
|
+
case "style":
|
|
3396
|
+
for (const partialStyle of [].concat(clean.style ?? [])) {
|
|
3397
|
+
Object.assign(current.style, partialStyle);
|
|
3398
|
+
}
|
|
3399
|
+
break;
|
|
3400
|
+
case "fill":
|
|
3401
|
+
if (cleanValue && typeof cleanValue === "object") {
|
|
3402
|
+
const value = cleanValue;
|
|
3403
|
+
current.setAttribute("fill", convertInt32ColorToRGBA(value.payload));
|
|
3404
|
+
}
|
|
3405
|
+
break;
|
|
3406
|
+
case "stroke":
|
|
3407
|
+
if (cleanValue && typeof cleanValue === "object") {
|
|
3408
|
+
const value = cleanValue;
|
|
3409
|
+
current.setAttribute("stroke", convertInt32ColorToRGBA(value.payload));
|
|
3410
|
+
}
|
|
3411
|
+
break;
|
|
3412
|
+
default:
|
|
3413
|
+
current.setAttribute(getAttributeName(cleanAttribute), cleanValue);
|
|
3414
|
+
break;
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
constructor(props) {
|
|
3420
|
+
super(props);
|
|
3421
|
+
if (hasTouchableProperty(props)) {
|
|
3422
|
+
SvgTouchableMixin_default(this);
|
|
3423
|
+
}
|
|
3424
|
+
this._remeasureMetricsOnActivation = remeasure.bind(this);
|
|
3425
|
+
}
|
|
3426
|
+
render() {
|
|
3427
|
+
if (!this.tag) {
|
|
3428
|
+
throw new Error("When extending `WebShape` you need to overwrite either `tag` or `render`!");
|
|
3429
|
+
}
|
|
3430
|
+
this.lastMergedProps = {};
|
|
3431
|
+
return createElement(this.tag, prepare(this, this.prepareProps(this.props)));
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
// node_modules/react-native-svg/lib/module/elements.web.js
|
|
3436
|
+
class Circle extends WebShape {
|
|
3437
|
+
tag = "circle";
|
|
3438
|
+
}
|
|
3439
|
+
class Defs extends WebShape {
|
|
3440
|
+
tag = "defs";
|
|
3441
|
+
}
|
|
3442
|
+
class Line extends WebShape {
|
|
3443
|
+
tag = "line";
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3446
|
+
class LinearGradient extends WebShape {
|
|
3447
|
+
tag = "linearGradient";
|
|
3448
|
+
}
|
|
3449
|
+
class Path extends WebShape {
|
|
3450
|
+
tag = "path";
|
|
3451
|
+
}
|
|
3452
|
+
class Polygon extends WebShape {
|
|
3453
|
+
tag = "polygon";
|
|
3454
|
+
}
|
|
3455
|
+
class RadialGradient extends WebShape {
|
|
3456
|
+
tag = "radialGradient";
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
class Rect extends WebShape {
|
|
3460
|
+
tag = "rect";
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
class Stop extends WebShape {
|
|
3464
|
+
tag = "stop";
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
class Svg extends WebShape {
|
|
3468
|
+
tag = "svg";
|
|
3469
|
+
toDataURL(callback, options = {}) {
|
|
3470
|
+
const ref = this.elementRef.current;
|
|
3471
|
+
if (ref === null) {
|
|
3472
|
+
return;
|
|
3473
|
+
}
|
|
3474
|
+
const rect = getBoundingClientRect(ref);
|
|
3475
|
+
const width = Number(options.width) || rect.width;
|
|
3476
|
+
const height = Number(options.height) || rect.height;
|
|
3477
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3478
|
+
svg.setAttribute("viewBox", `0 0 ${rect.width} ${rect.height}`);
|
|
3479
|
+
svg.setAttribute("width", String(width));
|
|
3480
|
+
svg.setAttribute("height", String(height));
|
|
3481
|
+
svg.appendChild(ref.cloneNode(true));
|
|
3482
|
+
const img = new window.Image;
|
|
3483
|
+
img.onload = () => {
|
|
3484
|
+
const canvas = document.createElement("canvas");
|
|
3485
|
+
canvas.width = width;
|
|
3486
|
+
canvas.height = height;
|
|
3487
|
+
const context = canvas.getContext("2d");
|
|
3488
|
+
context === null || context === undefined || context.drawImage(img, 0, 0);
|
|
3489
|
+
callback(canvas.toDataURL().replace("data:image/png;base64,", ""));
|
|
3490
|
+
};
|
|
3491
|
+
img.src = `data:image/svg+xml;utf8,${encodeSvg(new window.XMLSerializer().serializeToString(svg))}`;
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
// node_modules/react-native-svg/lib/module/xml.js
|
|
3496
|
+
var err = console.error.bind(console);
|
|
3497
|
+
// node_modules/react-native-svg/lib/module/index.js
|
|
3498
|
+
|
|
3499
|
+
// src/features/color/ColorHorizontalPointerProxy.web.tsx
|
|
3500
|
+
import React4 from "react";
|
|
3501
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3502
|
+
function ColorHorizontalPointerProxy({
|
|
3503
|
+
children,
|
|
3504
|
+
disabled,
|
|
3505
|
+
onChange,
|
|
3506
|
+
width
|
|
3507
|
+
}) {
|
|
3508
|
+
const dragging = React4.useRef(false);
|
|
3509
|
+
const changeAt = (event) => {
|
|
3510
|
+
const target = event.currentTarget;
|
|
3511
|
+
const rect = target.getBoundingClientRect();
|
|
3512
|
+
onChange((event.clientX - rect.left) / rect.width * width);
|
|
3513
|
+
};
|
|
3514
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
3515
|
+
onMouseDown: (event) => {
|
|
3516
|
+
if (disabled)
|
|
3517
|
+
return;
|
|
3518
|
+
dragging.current = true;
|
|
3519
|
+
changeAt(event);
|
|
3520
|
+
},
|
|
3521
|
+
onMouseMove: (event) => {
|
|
3522
|
+
if (!disabled && dragging.current)
|
|
3523
|
+
changeAt(event);
|
|
3524
|
+
},
|
|
3525
|
+
onMouseUp: (event) => {
|
|
3526
|
+
if (!disabled && dragging.current)
|
|
3527
|
+
changeAt(event);
|
|
3528
|
+
dragging.current = false;
|
|
3529
|
+
},
|
|
3530
|
+
style: { touchAction: "none" },
|
|
3531
|
+
children
|
|
3532
|
+
});
|
|
3533
|
+
}
|
|
3534
|
+
// src/features/color/utils/resolveOklchColor.ts
|
|
3535
|
+
function resolveOklchColor(target, hue) {
|
|
3536
|
+
const formatted = formatHex({ mode: "oklch", l: target.lightness, c: target.chroma, h: hue });
|
|
3537
|
+
if (!formatted)
|
|
3538
|
+
throw new Error("The supplied OKLCH target cannot be represented as a hex color.");
|
|
3539
|
+
return parseHexColorOrThrow(formatted);
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
// src/features/color/ColorSpectrumSlider.tsx
|
|
3543
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3544
|
+
var SPECTRUM_WIDTH = 280;
|
|
3545
|
+
var SPECTRUM_HUES = [0, 60, 120, 180, 240, 300, 360];
|
|
3546
|
+
function ColorSpectrumSlider({
|
|
3547
|
+
disabled,
|
|
3548
|
+
hue,
|
|
3549
|
+
label = "Hue",
|
|
3550
|
+
onChange
|
|
3551
|
+
}) {
|
|
3552
|
+
const { theme } = useZoraTheme2();
|
|
3553
|
+
const [trackWidth, setTrackWidth] = React5.useState(SPECTRUM_WIDTH);
|
|
3554
|
+
const gradientId = `color-spectrum-${React5.useId().replaceAll(":", "")}`;
|
|
3555
|
+
const changeAt = (locationX) => {
|
|
3556
|
+
if (!disabled)
|
|
3557
|
+
onChange(Math.max(0, Math.min(360, locationX / trackWidth * 360)));
|
|
3558
|
+
};
|
|
3559
|
+
return /* @__PURE__ */ jsxs2(View2, {
|
|
3560
|
+
gap: "xxs",
|
|
3561
|
+
width: "100%",
|
|
3562
|
+
children: [
|
|
3563
|
+
/* @__PURE__ */ jsxs2(View2, {
|
|
3564
|
+
direction: "row",
|
|
3565
|
+
justify: "space-between",
|
|
3566
|
+
children: [
|
|
3567
|
+
/* @__PURE__ */ jsx3(Text2, {
|
|
3568
|
+
variant: "label",
|
|
3569
|
+
children: label
|
|
3570
|
+
}),
|
|
3571
|
+
/* @__PURE__ */ jsx3(Text2, {
|
|
3572
|
+
variant: "label",
|
|
3573
|
+
children: `${Math.round(hue)}°`
|
|
3574
|
+
})
|
|
3575
|
+
]
|
|
3576
|
+
}),
|
|
3577
|
+
/* @__PURE__ */ jsx3(ColorHorizontalPointerProxy, {
|
|
3578
|
+
disabled,
|
|
3579
|
+
onChange: changeAt,
|
|
3580
|
+
width: SPECTRUM_WIDTH,
|
|
3581
|
+
children: /* @__PURE__ */ jsxs2(Svg, {
|
|
3582
|
+
accessibilityLabel: `${label} spectrum`,
|
|
3583
|
+
height: 36,
|
|
3584
|
+
onLayout: (event) => setTrackWidth(Math.max(1, event.nativeEvent.layout.width)),
|
|
3585
|
+
viewBox: `0 0 ${SPECTRUM_WIDTH} 36`,
|
|
3586
|
+
width: "100%",
|
|
3587
|
+
children: [
|
|
3588
|
+
/* @__PURE__ */ jsx3(Defs, {
|
|
3589
|
+
children: /* @__PURE__ */ jsx3(LinearGradient, {
|
|
3590
|
+
id: gradientId,
|
|
3591
|
+
x1: "0",
|
|
3592
|
+
x2: "1",
|
|
3593
|
+
y1: "0",
|
|
3594
|
+
y2: "0",
|
|
3595
|
+
children: SPECTRUM_HUES.map((stopHue, index) => /* @__PURE__ */ jsx3(Stop, {
|
|
3596
|
+
offset: String(index / (SPECTRUM_HUES.length - 1)),
|
|
3597
|
+
stopColor: resolveOklchColor({ lightness: 0.65, chroma: 0.2 }, stopHue)
|
|
3598
|
+
}, stopHue))
|
|
3599
|
+
})
|
|
3600
|
+
}),
|
|
3601
|
+
/* @__PURE__ */ jsx3(Rect, {
|
|
3602
|
+
fill: `url(#${gradientId})`,
|
|
3603
|
+
height: 12,
|
|
3604
|
+
rx: 6,
|
|
3605
|
+
width: SPECTRUM_WIDTH,
|
|
3606
|
+
y: 12
|
|
3607
|
+
}),
|
|
3608
|
+
/* @__PURE__ */ jsx3(Circle, {
|
|
3609
|
+
cx: hue / 360 * SPECTRUM_WIDTH,
|
|
3610
|
+
cy: 18,
|
|
3611
|
+
fill: "white",
|
|
3612
|
+
r: 10,
|
|
3613
|
+
stroke: theme.semantics.content.default,
|
|
3614
|
+
strokeWidth: 2
|
|
3615
|
+
}),
|
|
3616
|
+
/* @__PURE__ */ jsx3(Rect, {
|
|
3617
|
+
fill: "transparent",
|
|
3618
|
+
height: 36,
|
|
3619
|
+
onResponderGrant: (event) => changeAt(event.nativeEvent.locationX),
|
|
3620
|
+
onResponderMove: (event) => changeAt(event.nativeEvent.locationX),
|
|
3621
|
+
onResponderRelease: (event) => changeAt(event.nativeEvent.locationX),
|
|
3622
|
+
onStartShouldSetResponder: () => !disabled,
|
|
3623
|
+
width: SPECTRUM_WIDTH
|
|
3624
|
+
})
|
|
3625
|
+
]
|
|
3626
|
+
})
|
|
3627
|
+
})
|
|
3628
|
+
]
|
|
3629
|
+
});
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
// src/features/color/utils/resolveColorAtHue.ts
|
|
3633
|
+
var toOklch = converter_default("oklch");
|
|
3634
|
+
function resolveColorAtHue(color, hue) {
|
|
3635
|
+
const parsed = toOklch(color);
|
|
3636
|
+
if (!parsed || typeof parsed.l !== "number" || typeof parsed.c !== "number")
|
|
3637
|
+
return color;
|
|
3638
|
+
const formatted = formatHex({ mode: "oklch", l: parsed.l, c: parsed.c, h: hue });
|
|
3639
|
+
return formatted ? parseHexColorOrThrow(formatted) : color;
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3642
|
+
// src/features/color/utils/resolveColorHue.ts
|
|
3643
|
+
var toOklch2 = converter_default("oklch");
|
|
3644
|
+
function resolveColorHue(color) {
|
|
3645
|
+
const parsed = toOklch2(color);
|
|
3646
|
+
return typeof parsed?.h === "number" ? parsed.h : 0;
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3649
|
+
// src/features/color/ColorHueScale.tsx
|
|
3650
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3651
|
+
var ColorHueScale2 = withZoraThemeScope(ColorHueScaleInner);
|
|
3652
|
+
function ColorHueScaleInner({
|
|
3653
|
+
themeId: _themeId,
|
|
3654
|
+
mode: _mode,
|
|
3655
|
+
inverted: _inverted,
|
|
3656
|
+
interactionPolicy,
|
|
3657
|
+
value,
|
|
3658
|
+
onChange,
|
|
3659
|
+
testID
|
|
3660
|
+
}) {
|
|
3661
|
+
const { theme } = useZoraTheme2();
|
|
3662
|
+
const { swatch } = generateColorSwatch(value);
|
|
3663
|
+
const swatches = Object.entries(swatch);
|
|
3664
|
+
return /* @__PURE__ */ jsxs3(View2, {
|
|
3665
|
+
gap: "m",
|
|
3666
|
+
testID,
|
|
3667
|
+
children: [
|
|
3668
|
+
/* @__PURE__ */ jsx4(ColorSpectrumSlider, {
|
|
3669
|
+
disabled: interactionPolicy === "passive",
|
|
3670
|
+
hue: resolveColorHue(value),
|
|
3671
|
+
onChange: (nextHue) => onChange(resolveColorAtHue(value, nextHue))
|
|
3672
|
+
}),
|
|
3673
|
+
/* @__PURE__ */ jsx4(Text2, {
|
|
3674
|
+
variant: "label",
|
|
3675
|
+
children: "Intensity"
|
|
3676
|
+
}),
|
|
3677
|
+
/* @__PURE__ */ jsx4(View2, {
|
|
3678
|
+
accessibilityLabel: "Color scale previews; choose a preview as the next 500 base color",
|
|
3679
|
+
direction: "row",
|
|
3680
|
+
gap: "xs",
|
|
3681
|
+
wrap: "wrap",
|
|
3682
|
+
children: swatches.map(([step, color]) => /* @__PURE__ */ jsx4(Pressable, {
|
|
3683
|
+
accessibilityLabel: Number(step) === 500 ? `Current editable base color 500: ${color}` : `Use generated ${step} preview ${color} as the next base color 500`,
|
|
3684
|
+
bg: color,
|
|
3685
|
+
borderColor: theme.semantics.border.default,
|
|
3686
|
+
borderWidth: Number(step) === 500 ? 3 : 1,
|
|
3687
|
+
disabled: interactionPolicy === "passive",
|
|
3688
|
+
height: 48,
|
|
3689
|
+
onPress: () => onChange(color),
|
|
3690
|
+
radius: "s",
|
|
3691
|
+
width: "18%",
|
|
3692
|
+
children: /* @__PURE__ */ jsx4(Text2, {
|
|
3693
|
+
align: "center",
|
|
3694
|
+
variant: "caption",
|
|
3695
|
+
children: step
|
|
3696
|
+
})
|
|
3697
|
+
}, step))
|
|
3698
|
+
}),
|
|
3699
|
+
/* @__PURE__ */ jsx4(ColorHexField, {
|
|
3700
|
+
disabled: interactionPolicy === "passive",
|
|
3701
|
+
onChange,
|
|
3702
|
+
value
|
|
3703
|
+
}, value)
|
|
3704
|
+
]
|
|
3705
|
+
});
|
|
3706
|
+
}
|
|
3707
|
+
// src/features/color/ColorPicker.tsx
|
|
3708
|
+
import { Pressable as Pressable2 } from "@ankhorage/surface/web";
|
|
3709
|
+
import React8 from "react";
|
|
3710
|
+
import { View as NativeView } from "react-native-web";
|
|
3711
|
+
|
|
3712
|
+
// src/features/color/ColorWheel.tsx
|
|
3713
|
+
import React7 from "react";
|
|
3714
|
+
|
|
3715
|
+
// src/features/color/ColorWheelKeyboardProxy.web.tsx
|
|
3716
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
3717
|
+
function ColorWheelKeyboardProxy({
|
|
3718
|
+
children,
|
|
3719
|
+
chroma,
|
|
3720
|
+
disabled,
|
|
3721
|
+
hue,
|
|
3722
|
+
maxChroma = 0.2,
|
|
3723
|
+
onChange
|
|
3724
|
+
}) {
|
|
3725
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
3726
|
+
"aria-label": `Color wheel, hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
|
|
3727
|
+
"aria-valuemax": 360,
|
|
3728
|
+
"aria-valuemin": 0,
|
|
3729
|
+
"aria-valuenow": Math.round(hue),
|
|
3730
|
+
"aria-valuetext": `Hue ${Math.round(hue)}, chroma ${chroma.toFixed(2)}`,
|
|
3731
|
+
"aria-disabled": disabled,
|
|
3732
|
+
onKeyDown: (event) => {
|
|
3733
|
+
const nextValue = resolveKeyboardWheelValue(event.key, hue, chroma, maxChroma);
|
|
3734
|
+
if (!nextValue || disabled)
|
|
3735
|
+
return;
|
|
3736
|
+
event.preventDefault();
|
|
3737
|
+
onChange(nextValue.hue, nextValue.chroma);
|
|
3738
|
+
},
|
|
3739
|
+
role: "slider",
|
|
3740
|
+
tabIndex: disabled ? -1 : 0,
|
|
3741
|
+
children
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
function resolveKeyboardWheelValue(key, hue, chroma, maxChroma) {
|
|
3745
|
+
if (key === "ArrowLeft")
|
|
3746
|
+
return { chroma, hue: normalizeHue(hue - 5) };
|
|
3747
|
+
if (key === "ArrowRight")
|
|
3748
|
+
return { chroma, hue: normalizeHue(hue + 5) };
|
|
3749
|
+
if (key === "ArrowDown")
|
|
3750
|
+
return { chroma: Math.max(0, chroma - 0.02), hue };
|
|
3751
|
+
if (key === "ArrowUp")
|
|
3752
|
+
return { chroma: Math.min(maxChroma, chroma + 0.02), hue };
|
|
3753
|
+
return;
|
|
3754
|
+
}
|
|
3755
|
+
function normalizeHue(hue) {
|
|
3756
|
+
return hue < 0 ? hue + 360 : hue >= 360 ? hue - 360 : hue;
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
// src/features/color/ColorWheelPointerProxy.web.tsx
|
|
3760
|
+
import React6 from "react";
|
|
3761
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
3762
|
+
function ColorWheelPointerProxy({
|
|
3763
|
+
children,
|
|
3764
|
+
disabled,
|
|
3765
|
+
height,
|
|
3766
|
+
onChange,
|
|
3767
|
+
renderedSize: _renderedSize,
|
|
3768
|
+
width
|
|
3769
|
+
}) {
|
|
3770
|
+
const dragging = React6.useRef(false);
|
|
3771
|
+
const changeAt = (event) => {
|
|
3772
|
+
const target = event.currentTarget;
|
|
3773
|
+
const rect = target.getBoundingClientRect();
|
|
3774
|
+
onChange((event.clientX - rect.left) / rect.width * width, (event.clientY - rect.top) / rect.height * height);
|
|
3775
|
+
};
|
|
3776
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
3777
|
+
onPointerDown: (event) => {
|
|
3778
|
+
if (disabled)
|
|
3779
|
+
return;
|
|
3780
|
+
dragging.current = true;
|
|
3781
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
3782
|
+
changeAt(event);
|
|
3783
|
+
},
|
|
3784
|
+
onPointerMove: (event) => {
|
|
3785
|
+
if (!disabled && dragging.current)
|
|
3786
|
+
changeAt(event);
|
|
3787
|
+
},
|
|
3788
|
+
onPointerUp: (event) => {
|
|
3789
|
+
if (!disabled && dragging.current)
|
|
3790
|
+
changeAt(event);
|
|
3791
|
+
dragging.current = false;
|
|
3792
|
+
},
|
|
3793
|
+
onPointerCancel: () => {
|
|
3794
|
+
dragging.current = false;
|
|
3795
|
+
},
|
|
3796
|
+
style: { touchAction: "none" },
|
|
3797
|
+
children
|
|
3798
|
+
});
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
// src/features/color/utils/resolveWheelColorComponents.ts
|
|
3802
|
+
var toOklch3 = converter_default("oklch");
|
|
3803
|
+
function resolveWheelColorComponents(color) {
|
|
3804
|
+
const parsed = toOklch3(color);
|
|
3805
|
+
return {
|
|
3806
|
+
chroma: typeof parsed?.c === "number" ? parsed.c : 0,
|
|
3807
|
+
lightness: typeof parsed?.l === "number" ? parsed.l : 0.65
|
|
3808
|
+
};
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3811
|
+
// src/features/color/utils/resolveWheelColor.ts
|
|
3812
|
+
function resolveWheelColor(color, x, y, center, radius, maxChroma, lightness = resolveWheelColorComponents(color).lightness) {
|
|
3813
|
+
const deltaX = x - center;
|
|
3814
|
+
const deltaY = y - center;
|
|
3815
|
+
const distance = Math.min(Math.hypot(deltaX, deltaY), radius);
|
|
3816
|
+
const hue = normalizeHue2(Math.atan2(deltaY, deltaX) * 180 / Math.PI + 90);
|
|
3817
|
+
const chroma = distance / radius * maxChroma;
|
|
3818
|
+
return resolveOklchColor({ lightness, chroma }, hue);
|
|
3819
|
+
}
|
|
3820
|
+
function normalizeHue2(hue) {
|
|
3821
|
+
return hue < 0 ? hue + 360 : hue;
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
// src/features/color/ColorWheel.tsx
|
|
3825
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3826
|
+
var VIEWBOX = 1000;
|
|
3827
|
+
var CENTER = VIEWBOX / 2;
|
|
3828
|
+
var RADIUS = 480;
|
|
3829
|
+
var SEGMENTS = 720;
|
|
3830
|
+
var MAX_CHROMA = 0.2;
|
|
3831
|
+
var ColorWheel2 = withZoraThemeScope(ColorWheelInner);
|
|
3832
|
+
function ColorWheelInner({
|
|
3833
|
+
themeId: _themeId,
|
|
3834
|
+
mode: _mode,
|
|
3835
|
+
inverted: _inverted,
|
|
3836
|
+
interactionPolicy,
|
|
3837
|
+
value,
|
|
3838
|
+
harmony = null,
|
|
3839
|
+
toneTarget,
|
|
3840
|
+
onChange,
|
|
3841
|
+
size = 340,
|
|
3842
|
+
testID
|
|
3843
|
+
}) {
|
|
3844
|
+
const hue = resolveColorHue(value);
|
|
3845
|
+
const { chroma, lightness } = resolveWheelColorComponents(value);
|
|
3846
|
+
const targetLightness = toneTarget?.lightness ?? lightness;
|
|
3847
|
+
const maximumChroma = toneTarget?.chroma ?? MAX_CHROMA;
|
|
3848
|
+
const primaryPoint = pointFor(hue, Math.min(1, chroma / maximumChroma));
|
|
3849
|
+
const harmonyRoles = harmony ? generateHarmonyRoleColors(value, harmony).colors : [];
|
|
3850
|
+
const harmonyPoints = harmonyRoles.map((role) => ({
|
|
3851
|
+
color: role.hex,
|
|
3852
|
+
...pointFor(role.hueDegrees, Math.min(1, resolveWheelColorComponents(role.hex).chroma / maximumChroma))
|
|
3853
|
+
}));
|
|
3854
|
+
const gradientId = `color-wheel-${React7.useId().replaceAll(":", "")}`;
|
|
3855
|
+
const changeAt = (x, y) => {
|
|
3856
|
+
if (interactionPolicy !== "passive")
|
|
3857
|
+
onChange({
|
|
3858
|
+
color: resolveWheelColor(value, x, y, CENTER, RADIUS, maximumChroma, targetLightness),
|
|
3859
|
+
harmony
|
|
3860
|
+
});
|
|
3861
|
+
};
|
|
3862
|
+
return /* @__PURE__ */ jsx7(ColorWheelKeyboardProxy, {
|
|
3863
|
+
chroma,
|
|
3864
|
+
disabled: interactionPolicy === "passive",
|
|
3865
|
+
hue,
|
|
3866
|
+
maxChroma: maximumChroma,
|
|
3867
|
+
onChange: (nextHue, nextChroma) => onChange({
|
|
3868
|
+
color: resolveOklchColor({ chroma: nextChroma, lightness: targetLightness }, nextHue),
|
|
3869
|
+
harmony
|
|
3870
|
+
}),
|
|
3871
|
+
children: /* @__PURE__ */ jsx7(ColorWheelPointerProxy, {
|
|
3872
|
+
disabled: interactionPolicy === "passive",
|
|
3873
|
+
height: VIEWBOX,
|
|
3874
|
+
onChange: changeAt,
|
|
3875
|
+
renderedSize: size,
|
|
3876
|
+
width: VIEWBOX,
|
|
3877
|
+
children: /* @__PURE__ */ jsxs4(Svg, {
|
|
3878
|
+
accessibilityLabel: "Color wheel",
|
|
3879
|
+
height: size,
|
|
3880
|
+
testID,
|
|
3881
|
+
viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}`,
|
|
3882
|
+
width: size,
|
|
3883
|
+
children: [
|
|
3884
|
+
/* @__PURE__ */ jsx7(Defs, {
|
|
3885
|
+
children: segments(targetLightness, maximumChroma).map((segment) => /* @__PURE__ */ jsxs4(RadialGradient, {
|
|
3886
|
+
cx: CENTER,
|
|
3887
|
+
cy: CENTER,
|
|
3888
|
+
gradientUnits: "userSpaceOnUse",
|
|
3889
|
+
id: `${gradientId}-${segment.hue}`,
|
|
3890
|
+
r: RADIUS,
|
|
3891
|
+
children: [
|
|
3892
|
+
/* @__PURE__ */ jsx7(Stop, {
|
|
3893
|
+
offset: "0",
|
|
3894
|
+
stopColor: segment.centerColor
|
|
3895
|
+
}),
|
|
3896
|
+
/* @__PURE__ */ jsx7(Stop, {
|
|
3897
|
+
offset: "1",
|
|
3898
|
+
stopColor: segment.color
|
|
3899
|
+
})
|
|
3900
|
+
]
|
|
3901
|
+
}, segment.hue))
|
|
3902
|
+
}),
|
|
3903
|
+
segments(targetLightness, maximumChroma).map((segment) => /* @__PURE__ */ jsx7(Path, {
|
|
3904
|
+
d: segment.path,
|
|
3905
|
+
fill: `url(#${gradientId}-${segment.hue})`
|
|
3906
|
+
}, segment.hue)),
|
|
3907
|
+
harmonyPoints.length >= 3 ? /* @__PURE__ */ jsx7(Polygon, {
|
|
3908
|
+
fill: "none",
|
|
3909
|
+
points: harmonyPoints.map((point) => `${point.x},${point.y}`).join(" "),
|
|
3910
|
+
stroke: "white",
|
|
3911
|
+
strokeWidth: 6
|
|
3912
|
+
}) : linesFor(harmonyPoints, primaryPoint, "white"),
|
|
3913
|
+
harmonyPoints.filter((point) => point.color !== value).map((point) => /* @__PURE__ */ jsx7(Circle, {
|
|
3914
|
+
cx: point.x,
|
|
3915
|
+
cy: point.y,
|
|
3916
|
+
fill: point.color,
|
|
3917
|
+
stroke: "white",
|
|
3918
|
+
strokeWidth: 6,
|
|
3919
|
+
r: 26
|
|
3920
|
+
}, `${point.x}-${point.y}`)),
|
|
3921
|
+
/* @__PURE__ */ jsx7(Circle, {
|
|
3922
|
+
cx: primaryPoint.x,
|
|
3923
|
+
cy: primaryPoint.y,
|
|
3924
|
+
fill: value,
|
|
3925
|
+
r: 36,
|
|
3926
|
+
stroke: "white",
|
|
3927
|
+
strokeWidth: 12
|
|
3928
|
+
}),
|
|
3929
|
+
/* @__PURE__ */ jsx7(Circle, {
|
|
3930
|
+
cx: primaryPoint.x,
|
|
3931
|
+
cy: primaryPoint.y,
|
|
3932
|
+
fill: "none",
|
|
3933
|
+
r: 42,
|
|
3934
|
+
stroke: "white",
|
|
3935
|
+
strokeWidth: 6
|
|
3936
|
+
})
|
|
3937
|
+
]
|
|
3938
|
+
})
|
|
3939
|
+
})
|
|
3940
|
+
});
|
|
3941
|
+
}
|
|
3942
|
+
function segments(lightness, maximumChroma) {
|
|
3943
|
+
return Array.from({ length: SEGMENTS }, (_, index) => {
|
|
3944
|
+
const hue = index * 360 / SEGMENTS;
|
|
3945
|
+
return {
|
|
3946
|
+
centerColor: resolveOklchColor({ chroma: 0, lightness }, hue),
|
|
3947
|
+
color: resolveOklchColor({ chroma: maximumChroma, lightness }, hue),
|
|
3948
|
+
hue,
|
|
3949
|
+
path: segmentPath(hue, hue + 360 / SEGMENTS)
|
|
3950
|
+
};
|
|
3951
|
+
});
|
|
3952
|
+
}
|
|
3953
|
+
function segmentPath(start, end) {
|
|
3954
|
+
const startPoint = pointFor(start);
|
|
3955
|
+
const endPoint = pointFor(end);
|
|
3956
|
+
return `M ${CENTER} ${CENTER} L ${startPoint.x} ${startPoint.y} A ${RADIUS} ${RADIUS} 0 0 1 ${endPoint.x} ${endPoint.y} Z`;
|
|
3957
|
+
}
|
|
3958
|
+
function pointFor(hue, ratio = 1) {
|
|
3959
|
+
const radians = (hue - 90) * Math.PI / 180;
|
|
3960
|
+
return {
|
|
3961
|
+
x: CENTER + RADIUS * ratio * Math.cos(radians),
|
|
3962
|
+
y: CENTER + RADIUS * ratio * Math.sin(radians)
|
|
3963
|
+
};
|
|
3964
|
+
}
|
|
3965
|
+
function linesFor(points, primary, stroke) {
|
|
3966
|
+
return points.slice(1).reduce(({ lines, previous }, point) => ({
|
|
3967
|
+
lines: [
|
|
3968
|
+
...lines,
|
|
3969
|
+
/* @__PURE__ */ jsx7(Line, {
|
|
3970
|
+
stroke,
|
|
3971
|
+
strokeWidth: 6,
|
|
3972
|
+
x1: previous.x,
|
|
3973
|
+
x2: point.x,
|
|
3974
|
+
y1: previous.y,
|
|
3975
|
+
y2: point.y
|
|
3976
|
+
}, `${previous.x}-${previous.y}-${point.x}-${point.y}`)
|
|
3977
|
+
],
|
|
3978
|
+
previous: point
|
|
3979
|
+
}), { lines: [], previous: points.at(0) ?? primary }).lines;
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3982
|
+
// src/features/color/resolveColorPickerGeometry.ts
|
|
3983
|
+
var MINIMUM_WIDTH = 360;
|
|
3984
|
+
var REFERENCE_WIDTH = 560;
|
|
3985
|
+
function resolveColorPickerGeometry(input) {
|
|
3986
|
+
const availableWidth = Math.min(input.width ?? REFERENCE_WIDTH, input.hostWidth ?? REFERENCE_WIDTH);
|
|
3987
|
+
const availableHeight = Math.min(input.height ?? Number.POSITIVE_INFINITY, input.hostHeight ?? Number.POSITIVE_INFINITY);
|
|
3988
|
+
const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, input.showTabs);
|
|
3989
|
+
const maximum = resolveGeometryAtWidth(Math.max(MINIMUM_WIDTH, availableWidth), input.showTabs);
|
|
3990
|
+
const resolved = resolveLargestGeometry(maximum, availableHeight, input.showTabs);
|
|
3991
|
+
return {
|
|
3992
|
+
...resolved,
|
|
3993
|
+
insufficientSpace: availableWidth < MINIMUM_WIDTH || availableHeight < minimum.height,
|
|
3994
|
+
minimumHeight: minimum.height,
|
|
3995
|
+
minimumWidth: MINIMUM_WIDTH
|
|
3996
|
+
};
|
|
3997
|
+
}
|
|
3998
|
+
function resolveGeometryAtWidth(width, showTabs) {
|
|
3999
|
+
const progress = Math.max(0, Math.min(1, (width - MINIMUM_WIDTH) / (REFERENCE_WIDTH - MINIMUM_WIDTH)));
|
|
4000
|
+
const padding = interpolate(12, 24, progress);
|
|
4001
|
+
const rail = interpolate(104, 150, progress);
|
|
4002
|
+
const gap = interpolate(12, 20, progress);
|
|
4003
|
+
const scale = interpolate(0.75, 1, progress);
|
|
4004
|
+
const border = 1;
|
|
4005
|
+
const stage = width - border * 2 - padding * 2 - rail - gap;
|
|
4006
|
+
const headerHeight = 48 * scale;
|
|
4007
|
+
const tabHeight = showTabs ? 48 * scale : 0;
|
|
4008
|
+
const cardGap = 16 * scale;
|
|
4009
|
+
const cardHeight = 52 * scale;
|
|
4010
|
+
const settingsHeight = cardHeight * 2 + cardGap;
|
|
4011
|
+
const mainHeight = Math.max(stage, settingsHeight);
|
|
4012
|
+
const infoLineHeight = 20 * scale;
|
|
4013
|
+
const mainGap = 16 * scale;
|
|
4014
|
+
const footerGap = 10 * scale;
|
|
4015
|
+
const footerHeight = 52 * scale;
|
|
4016
|
+
const footerInset = 12 * scale;
|
|
4017
|
+
const height = border * 2 + padding + headerHeight + mainGap + tabHeight + (showTabs ? mainGap : 0) + mainHeight + mainGap + infoLineHeight + footerGap + 1 + footerGap + footerHeight + footerInset;
|
|
4018
|
+
return {
|
|
4019
|
+
border,
|
|
4020
|
+
cardGap,
|
|
4021
|
+
cardHeight,
|
|
4022
|
+
footerGap,
|
|
4023
|
+
footerHeight,
|
|
4024
|
+
footerInset,
|
|
4025
|
+
gap,
|
|
4026
|
+
headerHeight,
|
|
4027
|
+
height,
|
|
4028
|
+
infoLineHeight,
|
|
4029
|
+
mainGap,
|
|
4030
|
+
padding,
|
|
4031
|
+
rail,
|
|
4032
|
+
scale,
|
|
4033
|
+
settingsHeight,
|
|
4034
|
+
stage,
|
|
4035
|
+
tabHeight,
|
|
4036
|
+
width
|
|
4037
|
+
};
|
|
4038
|
+
}
|
|
4039
|
+
function resolveLargestGeometry(maximum, height, showTabs) {
|
|
4040
|
+
if (!Number.isFinite(height) || maximum.height <= height)
|
|
4041
|
+
return maximum;
|
|
4042
|
+
const minimum = resolveGeometryAtWidth(MINIMUM_WIDTH, showTabs);
|
|
4043
|
+
if (height < minimum.height)
|
|
4044
|
+
return minimum;
|
|
4045
|
+
let lower = MINIMUM_WIDTH;
|
|
4046
|
+
let upper = maximum.width;
|
|
4047
|
+
for (let iteration = 0;iteration < 20; iteration += 1) {
|
|
4048
|
+
const midpoint = (lower + upper) / 2;
|
|
4049
|
+
if (resolveGeometryAtWidth(midpoint, showTabs).height <= height)
|
|
4050
|
+
lower = midpoint;
|
|
4051
|
+
else
|
|
4052
|
+
upper = midpoint;
|
|
4053
|
+
}
|
|
4054
|
+
return resolveGeometryAtWidth(lower, showTabs);
|
|
4055
|
+
}
|
|
4056
|
+
function interpolate(minimum, reference, progress) {
|
|
4057
|
+
return minimum + (reference - minimum) * progress;
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
// src/features/color/ColorPicker.tsx
|
|
4061
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
4062
|
+
var DEFAULT_TABS = ["grid", "wheel"];
|
|
4063
|
+
var ColorPicker2 = withZoraThemeScope(ColorPickerInner);
|
|
4064
|
+
function ColorPickerInner({
|
|
4065
|
+
themeId: _themeId,
|
|
4066
|
+
mode: _mode,
|
|
4067
|
+
inverted: _inverted,
|
|
4068
|
+
tabs = DEFAULT_TABS,
|
|
4069
|
+
primaryColor,
|
|
4070
|
+
harmony,
|
|
4071
|
+
tone,
|
|
4072
|
+
tones = [],
|
|
4073
|
+
width = 560,
|
|
4074
|
+
height,
|
|
4075
|
+
infoLine,
|
|
4076
|
+
onInsufficientSpaceChange,
|
|
4077
|
+
activeTab,
|
|
4078
|
+
onValueChange,
|
|
4079
|
+
onActiveTabChange,
|
|
4080
|
+
onDismiss,
|
|
4081
|
+
hideTabListWhenSingle = true,
|
|
4082
|
+
wheel,
|
|
4083
|
+
interactionPolicy,
|
|
4084
|
+
testID
|
|
4085
|
+
}) {
|
|
4086
|
+
const { theme } = useZoraTheme2();
|
|
4087
|
+
const [hostBounds, setHostBounds] = React8.useState();
|
|
4088
|
+
const enabledTabs = resolveEnabledTabs(tabs);
|
|
4089
|
+
const firstTab = enabledTabs.at(0);
|
|
4090
|
+
if (!firstTab)
|
|
4091
|
+
throw new Error("ColorPicker requires at least one tab.");
|
|
4092
|
+
const [uncontrolledTab, setUncontrolledTab] = React8.useState(firstTab);
|
|
4093
|
+
const resolvedTab = activeTab && enabledTabs.includes(activeTab) ? activeTab : enabledTabs.includes(uncontrolledTab) ? uncontrolledTab : firstTab;
|
|
4094
|
+
const geometry = resolveColorPickerGeometry({
|
|
4095
|
+
height,
|
|
4096
|
+
hostHeight: hostBounds && hostBounds.height > 0 ? hostBounds.height : undefined,
|
|
4097
|
+
hostWidth: hostBounds && hostBounds.width > 0 ? hostBounds.width : undefined,
|
|
4098
|
+
showTabs: enabledTabs.length > 1 || !hideTabListWhenSingle,
|
|
4099
|
+
width
|
|
4100
|
+
});
|
|
4101
|
+
const selectedTone = tones.find((entry) => entry.id === tone);
|
|
4102
|
+
const emit = (next) => onValueChange({
|
|
4103
|
+
primaryColor: next.primaryColor ?? primaryColor,
|
|
4104
|
+
...Object.hasOwn(next, "harmony") ? { harmony: next.harmony } : harmony ? { harmony } : {},
|
|
4105
|
+
...Object.hasOwn(next, "tone") ? { tone: next.tone } : tone ? { tone } : {}
|
|
4106
|
+
});
|
|
4107
|
+
const settings = (children) => /* @__PURE__ */ jsx8(PickerRow, {
|
|
4108
|
+
geometry,
|
|
4109
|
+
tone,
|
|
4110
|
+
tones,
|
|
4111
|
+
harmony,
|
|
4112
|
+
interactionPolicy,
|
|
4113
|
+
onHarmonyChange: (next) => emit({ harmony: next }),
|
|
4114
|
+
onToneChange: (next) => emit({ tone: next }),
|
|
4115
|
+
children
|
|
4116
|
+
});
|
|
4117
|
+
React8.useEffect(() => {
|
|
4118
|
+
if (activeTab && activeTab !== resolvedTab)
|
|
4119
|
+
onActiveTabChange?.(resolvedTab);
|
|
4120
|
+
}, [activeTab, onActiveTabChange, resolvedTab]);
|
|
4121
|
+
React8.useEffect(() => {
|
|
4122
|
+
onInsufficientSpaceChange?.(geometry.insufficientSpace);
|
|
4123
|
+
}, [geometry.insufficientSpace, onInsufficientSpaceChange]);
|
|
4124
|
+
return /* @__PURE__ */ jsx8(NativeView, {
|
|
4125
|
+
onLayout: (event) => setHostBounds({
|
|
4126
|
+
height: event.nativeEvent.layout.height,
|
|
4127
|
+
width: event.nativeEvent.layout.width
|
|
4128
|
+
}),
|
|
4129
|
+
style: {
|
|
4130
|
+
alignSelf: "stretch",
|
|
4131
|
+
flexShrink: 1,
|
|
4132
|
+
height: height ?? "100%",
|
|
4133
|
+
maxHeight: "100%",
|
|
4134
|
+
maxWidth: "100%",
|
|
4135
|
+
width: "100%"
|
|
4136
|
+
},
|
|
4137
|
+
children: !geometry.insufficientSpace ? /* @__PURE__ */ jsx8(View2, {
|
|
4138
|
+
alignSelf: "center",
|
|
4139
|
+
borderColor: theme.semantics.action.primary.base,
|
|
4140
|
+
borderWidth: geometry.border,
|
|
4141
|
+
radius: "l",
|
|
4142
|
+
testID,
|
|
4143
|
+
width: geometry.width,
|
|
4144
|
+
children: /* @__PURE__ */ jsx8(Gradient2, {
|
|
4145
|
+
colors: [theme.semantics.surface.raised, theme.semantics.neutral.surface],
|
|
4146
|
+
end: { x: 0, y: 1 },
|
|
4147
|
+
radius: "l",
|
|
4148
|
+
start: { x: 0, y: 0 },
|
|
4149
|
+
children: /* @__PURE__ */ jsxs5(View2, {
|
|
4150
|
+
gap: geometry.footerGap,
|
|
4151
|
+
pb: geometry.footerInset,
|
|
4152
|
+
pt: geometry.padding,
|
|
4153
|
+
px: geometry.padding,
|
|
4154
|
+
children: [
|
|
4155
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4156
|
+
gap: geometry.mainGap,
|
|
4157
|
+
children: [
|
|
4158
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4159
|
+
align: "center",
|
|
4160
|
+
direction: "row",
|
|
4161
|
+
justify: "space-between",
|
|
4162
|
+
minHeight: geometry.headerHeight,
|
|
4163
|
+
children: [
|
|
4164
|
+
/* @__PURE__ */ jsx8(Heading2, {
|
|
4165
|
+
level: 2,
|
|
4166
|
+
children: "Color"
|
|
4167
|
+
}),
|
|
4168
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4169
|
+
align: "center",
|
|
4170
|
+
direction: "row",
|
|
4171
|
+
gap: "s",
|
|
4172
|
+
children: [
|
|
4173
|
+
/* @__PURE__ */ jsx8(View2, {
|
|
4174
|
+
bg: primaryColor,
|
|
4175
|
+
borderColor: theme.semantics.border.default,
|
|
4176
|
+
borderWidth: 1,
|
|
4177
|
+
height: 36 * geometry.scale,
|
|
4178
|
+
radius: "s",
|
|
4179
|
+
width: 52 * geometry.scale
|
|
4180
|
+
}),
|
|
4181
|
+
onDismiss ? /* @__PURE__ */ jsx8(IconButton2, {
|
|
4182
|
+
iconName: "close",
|
|
4183
|
+
label: "Close color picker",
|
|
4184
|
+
onPress: onDismiss
|
|
4185
|
+
}) : null
|
|
4186
|
+
]
|
|
4187
|
+
})
|
|
4188
|
+
]
|
|
4189
|
+
}),
|
|
4190
|
+
enabledTabs.length > 1 || !hideTabListWhenSingle ? /* @__PURE__ */ jsx8(ColorPickerTabSelector, {
|
|
4191
|
+
activeTab: resolvedTab,
|
|
4192
|
+
geometry,
|
|
4193
|
+
interactionPolicy,
|
|
4194
|
+
tabs: enabledTabs,
|
|
4195
|
+
onChange: (next) => {
|
|
4196
|
+
setUncontrolledTab(next);
|
|
4197
|
+
onActiveTabChange?.(next);
|
|
4198
|
+
}
|
|
4199
|
+
}) : null,
|
|
4200
|
+
resolvedTab === "grid" ? settings(/* @__PURE__ */ jsx8(ColorGrid, {
|
|
4201
|
+
disabled: interactionPolicy === "passive",
|
|
4202
|
+
harmony,
|
|
4203
|
+
onSelect: (color) => emit({ primaryColor: color }),
|
|
4204
|
+
palette: resolvePalette(selectedTone, primaryColor, harmony),
|
|
4205
|
+
primaryIndicatorColor: theme.semantics.action.primary.base,
|
|
4206
|
+
selectionBorderColor: theme.semantics.content.default,
|
|
4207
|
+
selected: primaryColor,
|
|
4208
|
+
size: geometry.stage
|
|
4209
|
+
})) : settings(/* @__PURE__ */ jsx8(ColorWheel2, {
|
|
4210
|
+
...wheel,
|
|
4211
|
+
harmony: harmony ?? null,
|
|
4212
|
+
interactionPolicy,
|
|
4213
|
+
onChange: (next) => emit({ primaryColor: next.color, harmony: next.harmony ?? undefined }),
|
|
4214
|
+
size: geometry.stage,
|
|
4215
|
+
toneTarget: selectedTone?.accentTarget,
|
|
4216
|
+
value: primaryColor
|
|
4217
|
+
})),
|
|
4218
|
+
/* @__PURE__ */ jsx8(View2, {
|
|
4219
|
+
height: geometry.infoLineHeight,
|
|
4220
|
+
justify: "center",
|
|
4221
|
+
children: infoLine ? /* @__PURE__ */ jsx8(Text2, {
|
|
4222
|
+
accessibilityLabel: infoLine,
|
|
4223
|
+
numberOfLines: 1,
|
|
4224
|
+
variant: "caption",
|
|
4225
|
+
children: infoLine
|
|
4226
|
+
}) : null
|
|
4227
|
+
})
|
|
4228
|
+
]
|
|
4229
|
+
}),
|
|
4230
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4231
|
+
gap: geometry.footerGap,
|
|
4232
|
+
children: [
|
|
4233
|
+
/* @__PURE__ */ jsx8(Divider2, {}),
|
|
4234
|
+
/* @__PURE__ */ jsx8(View2, {
|
|
4235
|
+
height: geometry.footerHeight,
|
|
4236
|
+
justify: "center",
|
|
4237
|
+
children: /* @__PURE__ */ jsx8(ColorHexField, {
|
|
4238
|
+
disabled: interactionPolicy === "passive",
|
|
4239
|
+
onChange: (color) => emit({ primaryColor: color }),
|
|
4240
|
+
value: primaryColor
|
|
4241
|
+
})
|
|
4242
|
+
})
|
|
4243
|
+
]
|
|
4244
|
+
})
|
|
4245
|
+
]
|
|
4246
|
+
})
|
|
4247
|
+
})
|
|
4248
|
+
}) : /* @__PURE__ */ jsx8(View2, {
|
|
4249
|
+
accessibilityLabel: "Color picker needs more space",
|
|
4250
|
+
testID: testID ? `${testID}-insufficient-space` : undefined
|
|
4251
|
+
})
|
|
4252
|
+
});
|
|
4253
|
+
}
|
|
4254
|
+
function ColorPickerTabSelector({
|
|
4255
|
+
activeTab,
|
|
4256
|
+
geometry,
|
|
4257
|
+
interactionPolicy,
|
|
4258
|
+
tabs,
|
|
4259
|
+
onChange
|
|
4260
|
+
}) {
|
|
4261
|
+
const { theme } = useZoraTheme2();
|
|
4262
|
+
return /* @__PURE__ */ jsx8(View2, {
|
|
4263
|
+
borderColor: theme.semantics.border.default,
|
|
4264
|
+
borderWidth: 1,
|
|
4265
|
+
direction: "row",
|
|
4266
|
+
overflow: "hidden",
|
|
4267
|
+
radius: "m",
|
|
4268
|
+
children: tabs.map((tab) => {
|
|
4269
|
+
const selected = tab === activeTab;
|
|
4270
|
+
return /* @__PURE__ */ jsx8(Pressable2, {
|
|
4271
|
+
accessibilityLabel: `${tab === "grid" ? "Grid" : "Wheel"} color picker tab`,
|
|
4272
|
+
accessibilityRole: "tab",
|
|
4273
|
+
accessibilityState: { selected },
|
|
4274
|
+
disabled: interactionPolicy === "passive",
|
|
4275
|
+
onPress: () => onChange(tab),
|
|
4276
|
+
style: { flex: 1 },
|
|
4277
|
+
children: /* @__PURE__ */ jsxs5(View2, {
|
|
4278
|
+
align: "center",
|
|
4279
|
+
bg: selected ? theme.semantics.action.primary.base : "transparent",
|
|
4280
|
+
direction: "row",
|
|
4281
|
+
gap: "xs",
|
|
4282
|
+
height: geometry.tabHeight - geometry.border * 2,
|
|
4283
|
+
justify: "center",
|
|
4284
|
+
radius: "s",
|
|
4285
|
+
children: [
|
|
4286
|
+
/* @__PURE__ */ jsx8(Icon2, {
|
|
4287
|
+
color: selected ? theme.semantics.action.primary.onSolidText : undefined,
|
|
4288
|
+
name: tab === "grid" ? "grid" : "color-palette",
|
|
4289
|
+
size: 16 * geometry.scale
|
|
4290
|
+
}),
|
|
4291
|
+
/* @__PURE__ */ jsx8(Text2, {
|
|
4292
|
+
style: selected ? { color: theme.semantics.action.primary.onSolidText } : undefined,
|
|
4293
|
+
variant: "label",
|
|
4294
|
+
weight: "medium",
|
|
4295
|
+
children: tab === "grid" ? "Grid" : "Wheel"
|
|
4296
|
+
})
|
|
4297
|
+
]
|
|
4298
|
+
})
|
|
4299
|
+
}, tab);
|
|
4300
|
+
})
|
|
4301
|
+
});
|
|
4302
|
+
}
|
|
4303
|
+
function PickerRow({
|
|
4304
|
+
children,
|
|
4305
|
+
geometry,
|
|
4306
|
+
tone,
|
|
4307
|
+
tones,
|
|
4308
|
+
harmony,
|
|
4309
|
+
interactionPolicy,
|
|
4310
|
+
onToneChange,
|
|
4311
|
+
onHarmonyChange
|
|
4312
|
+
}) {
|
|
4313
|
+
return /* @__PURE__ */ jsxs5(View2, {
|
|
4314
|
+
align: "flex-start",
|
|
4315
|
+
direction: "row",
|
|
4316
|
+
gap: geometry.gap,
|
|
4317
|
+
children: [
|
|
4318
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4319
|
+
gap: geometry.cardGap,
|
|
4320
|
+
width: geometry.rail,
|
|
4321
|
+
children: [
|
|
4322
|
+
/* @__PURE__ */ jsx8(SettingCard, {
|
|
4323
|
+
geometry,
|
|
4324
|
+
icon: "diamond",
|
|
4325
|
+
interactionPolicy,
|
|
4326
|
+
label: "Tone",
|
|
4327
|
+
onClear: tone ? () => onToneChange(undefined) : undefined,
|
|
4328
|
+
children: /* @__PURE__ */ jsx8(Select2, {
|
|
4329
|
+
compact: true,
|
|
4330
|
+
interactionPolicy,
|
|
4331
|
+
onValueChange: onToneChange,
|
|
4332
|
+
options: resolveToneOptions(tones),
|
|
4333
|
+
placeholder: "Any tone",
|
|
4334
|
+
value: tone
|
|
4335
|
+
})
|
|
4336
|
+
}),
|
|
4337
|
+
/* @__PURE__ */ jsx8(SettingCard, {
|
|
4338
|
+
geometry,
|
|
4339
|
+
icon: "color-palette",
|
|
4340
|
+
interactionPolicy,
|
|
4341
|
+
label: "Harmony",
|
|
4342
|
+
onClear: harmony ? () => onHarmonyChange(undefined) : undefined,
|
|
4343
|
+
children: /* @__PURE__ */ jsx8(Select2, {
|
|
4344
|
+
compact: true,
|
|
4345
|
+
interactionPolicy,
|
|
4346
|
+
onValueChange: onHarmonyChange,
|
|
4347
|
+
options: COLOR_HARMONY_CATALOG.map((entry) => ({
|
|
4348
|
+
label: entry.label,
|
|
4349
|
+
value: entry.id
|
|
4350
|
+
})),
|
|
4351
|
+
placeholder: "None",
|
|
4352
|
+
value: harmony
|
|
4353
|
+
})
|
|
4354
|
+
})
|
|
4355
|
+
]
|
|
4356
|
+
}),
|
|
4357
|
+
children
|
|
4358
|
+
]
|
|
4359
|
+
});
|
|
4360
|
+
}
|
|
4361
|
+
function SettingCard({
|
|
4362
|
+
children,
|
|
4363
|
+
geometry,
|
|
4364
|
+
icon,
|
|
4365
|
+
interactionPolicy,
|
|
4366
|
+
label,
|
|
4367
|
+
onClear
|
|
4368
|
+
}) {
|
|
4369
|
+
return /* @__PURE__ */ jsxs5(Card2, {
|
|
4370
|
+
compact: true,
|
|
4371
|
+
minHeight: geometry.cardHeight,
|
|
4372
|
+
padding: "s",
|
|
4373
|
+
radius: "m",
|
|
4374
|
+
tone: "subtle",
|
|
4375
|
+
children: [
|
|
4376
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4377
|
+
align: "center",
|
|
4378
|
+
direction: "row",
|
|
4379
|
+
gap: "xs",
|
|
4380
|
+
justify: "space-between",
|
|
4381
|
+
children: [
|
|
4382
|
+
/* @__PURE__ */ jsxs5(View2, {
|
|
4383
|
+
align: "center",
|
|
4384
|
+
direction: "row",
|
|
4385
|
+
gap: "xs",
|
|
4386
|
+
children: [
|
|
4387
|
+
/* @__PURE__ */ jsx8(Icon2, {
|
|
4388
|
+
name: icon,
|
|
4389
|
+
size: 20 * geometry.scale
|
|
4390
|
+
}),
|
|
4391
|
+
/* @__PURE__ */ jsx8(Text2, {
|
|
4392
|
+
numberOfLines: 1,
|
|
4393
|
+
variant: "label",
|
|
4394
|
+
weight: "medium",
|
|
4395
|
+
children: label
|
|
4396
|
+
})
|
|
4397
|
+
]
|
|
4398
|
+
}),
|
|
4399
|
+
onClear ? /* @__PURE__ */ jsx8(IconButton2, {
|
|
4400
|
+
disabled: interactionPolicy === "passive",
|
|
4401
|
+
iconName: "close",
|
|
4402
|
+
label: `Clear ${label}`,
|
|
4403
|
+
onPress: onClear,
|
|
4404
|
+
size: "s"
|
|
4405
|
+
}) : null
|
|
4406
|
+
]
|
|
4407
|
+
}),
|
|
4408
|
+
children
|
|
4409
|
+
]
|
|
4410
|
+
});
|
|
4411
|
+
}
|
|
4412
|
+
function ColorGrid({
|
|
4413
|
+
palette,
|
|
4414
|
+
primaryIndicatorColor,
|
|
4415
|
+
selectionBorderColor,
|
|
4416
|
+
selected,
|
|
4417
|
+
size,
|
|
4418
|
+
onSelect,
|
|
4419
|
+
disabled = false,
|
|
4420
|
+
harmony
|
|
4421
|
+
}) {
|
|
4422
|
+
const gap = Math.max(3, Math.round(size / 68));
|
|
4423
|
+
const cell = (size - 7 * gap) / 8;
|
|
4424
|
+
const harmonyColors = new Set(harmony ? generateHarmonyRoleColors(selected, harmony).colors.map((role) => role.hex) : []);
|
|
4425
|
+
return /* @__PURE__ */ jsx8(View2, {
|
|
4426
|
+
accessibilityLabel: "Color grid",
|
|
4427
|
+
direction: "row",
|
|
4428
|
+
gap,
|
|
4429
|
+
width: size,
|
|
4430
|
+
wrap: "wrap",
|
|
4431
|
+
children: palette.map((color) => /* @__PURE__ */ jsx8(Pressable2, {
|
|
4432
|
+
accessibilityLabel: `Select ${color}`,
|
|
4433
|
+
bg: color,
|
|
4434
|
+
borderColor: color === selected ? selectionBorderColor : harmonyColors.has(color) ? primaryIndicatorColor : "transparent",
|
|
4435
|
+
borderWidth: color === selected ? 3 : harmonyColors.has(color) ? 1 : 0,
|
|
4436
|
+
disabled,
|
|
4437
|
+
height: cell,
|
|
4438
|
+
onPress: () => onSelect(color),
|
|
4439
|
+
radius: "s",
|
|
4440
|
+
width: cell
|
|
4441
|
+
}, color))
|
|
4442
|
+
});
|
|
4443
|
+
}
|
|
4444
|
+
function resolvePalette(tone, primaryColor, harmony) {
|
|
4445
|
+
const target = tone?.accentTarget;
|
|
4446
|
+
const candidates = Array.from({ length: 64 }, (_, index) => resolveOklchColor({
|
|
4447
|
+
chroma: target?.chroma ?? 0.08 + index % 8 * 0.018,
|
|
4448
|
+
lightness: target?.lightness ?? 0.35 + Math.floor(index / 8) * 0.065
|
|
4449
|
+
}, index * 137.508 % 360));
|
|
4450
|
+
const roleColors = harmony ? generateHarmonyRoleColors(primaryColor, harmony).colors.map((role) => role.hex) : [];
|
|
4451
|
+
return Array.from(new Set([primaryColor, ...roleColors, ...candidates])).slice(0, 64);
|
|
4452
|
+
}
|
|
4453
|
+
function resolveToneOptions(tones) {
|
|
4454
|
+
const accentCounts = new Map;
|
|
4455
|
+
for (const tone of tones) {
|
|
4456
|
+
const accent = tone.accent.trim().toLocaleLowerCase();
|
|
4457
|
+
accentCounts.set(accent, (accentCounts.get(accent) ?? 0) + 1);
|
|
4458
|
+
}
|
|
4459
|
+
return tones.map((tone) => ({
|
|
4460
|
+
label: (accentCounts.get(tone.accent.trim().toLocaleLowerCase()) ?? 0) > 1 ? `${tone.accent} · ${resolveToneQualifier(tone)}` : tone.accent,
|
|
4461
|
+
value: tone.id
|
|
4462
|
+
}));
|
|
4463
|
+
}
|
|
4464
|
+
function resolveToneQualifier(tone) {
|
|
4465
|
+
const normalizedAccent = tone.accent.trim().toLocaleLowerCase().replaceAll(" ", "-");
|
|
4466
|
+
const qualifier = tone.id.replace(new RegExp(`^${escapeRegExp(normalizedAccent)}-on-`, "i"), "").replaceAll("-", " ");
|
|
4467
|
+
return qualifier.replace(/\b\w/g, (character) => character.toLocaleUpperCase());
|
|
4468
|
+
}
|
|
4469
|
+
function escapeRegExp(value) {
|
|
4470
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4471
|
+
}
|
|
4472
|
+
function resolveEnabledTabs(tabs) {
|
|
4473
|
+
if (tabs.length === 0)
|
|
4474
|
+
throw new Error("ColorPicker requires at least one tab.");
|
|
4475
|
+
if (tabs.some((tab) => !isColorPickerTab(tab)))
|
|
4476
|
+
throw new Error("ColorPicker supports only Grid and Wheel tabs.");
|
|
4477
|
+
return tabs;
|
|
4478
|
+
}
|
|
4479
|
+
function isColorPickerTab(value) {
|
|
4480
|
+
return value === "grid" || value === "wheel";
|
|
4481
|
+
}
|
|
4482
|
+
// src/features/color/ColorTone.tsx
|
|
4483
|
+
import { Button, Pressable as Pressable3 } from "@ankhorage/surface/web";
|
|
4484
|
+
import React9 from "react";
|
|
4485
|
+
import { jsx as jsx9, jsxs as jsxs6, Fragment } from "react/jsx-runtime";
|
|
4486
|
+
var MAX_TONE_COLORS = 4;
|
|
4487
|
+
var TONE_MAP_WIDTH = 280;
|
|
4488
|
+
var TONE_MAP_HEIGHT = 220;
|
|
4489
|
+
var TONE_MAX_CHROMA = 0.2;
|
|
4490
|
+
var ColorTone2 = withZoraThemeScope(ColorToneInner);
|
|
4491
|
+
function ColorToneInner({
|
|
4492
|
+
themeId: _themeId,
|
|
4493
|
+
mode: _mode,
|
|
4494
|
+
inverted: _inverted,
|
|
4495
|
+
interactionPolicy,
|
|
4496
|
+
tones,
|
|
4497
|
+
selectionMode = "single",
|
|
4498
|
+
value,
|
|
4499
|
+
onChange,
|
|
4500
|
+
testID
|
|
4501
|
+
}) {
|
|
4502
|
+
const { theme } = useZoraTheme2();
|
|
4503
|
+
const [editingColorIndex, setEditingColorIndex] = React9.useState(0);
|
|
4504
|
+
const selectedTone = tones.find((tone) => tone.id === value?.toneId);
|
|
4505
|
+
const colors = value ? selectionMode === "single" ? value.colors.slice(0, 1) : value.colors.slice(0, MAX_TONE_COLORS) : [];
|
|
4506
|
+
const currentEditingColorIndex = Math.min(editingColorIndex, Math.max(0, colors.length - 1));
|
|
4507
|
+
const selectedColor = colors.at(currentEditingColorIndex);
|
|
4508
|
+
const selectTone = (tone) => {
|
|
4509
|
+
const hue = selectedColor ? resolveColorHue(selectedColor) : 0;
|
|
4510
|
+
setEditingColorIndex(0);
|
|
4511
|
+
onChange({ toneId: tone.id, colors: [resolveOklchColor(tone.accentTarget, hue)] });
|
|
4512
|
+
};
|
|
4513
|
+
return /* @__PURE__ */ jsxs6(View2, {
|
|
4514
|
+
gap: "m",
|
|
4515
|
+
testID,
|
|
4516
|
+
children: [
|
|
4517
|
+
/* @__PURE__ */ jsxs6(View2, {
|
|
4518
|
+
gap: "xs",
|
|
4519
|
+
children: [
|
|
4520
|
+
/* @__PURE__ */ jsx9(Text2, {
|
|
4521
|
+
variant: "label",
|
|
4522
|
+
children: "Tone"
|
|
4523
|
+
}),
|
|
4524
|
+
/* @__PURE__ */ jsx9(Text2, {
|
|
4525
|
+
emphasis: "muted",
|
|
4526
|
+
variant: "caption",
|
|
4527
|
+
children: "Choose a catalog tone"
|
|
4528
|
+
})
|
|
4529
|
+
]
|
|
4530
|
+
}),
|
|
4531
|
+
/* @__PURE__ */ jsx9(View2, {
|
|
4532
|
+
direction: "row",
|
|
4533
|
+
gap: "s",
|
|
4534
|
+
wrap: "wrap",
|
|
4535
|
+
children: tones.map((tone) => {
|
|
4536
|
+
const selected = value?.toneId === tone.id;
|
|
4537
|
+
const color = selected && selectedColor ? selectedColor : resolveOklchColor(tone.accentTarget, 0);
|
|
4538
|
+
return /* @__PURE__ */ jsx9(Pressable3, {
|
|
4539
|
+
accessibilityLabel: tone.accent,
|
|
4540
|
+
accessibilityRole: "radio",
|
|
4541
|
+
accessibilityState: { checked: selected },
|
|
4542
|
+
bg: color,
|
|
4543
|
+
borderColor: theme.semantics.border.default,
|
|
4544
|
+
borderWidth: selected ? 3 : 1,
|
|
4545
|
+
disabled: interactionPolicy === "passive",
|
|
4546
|
+
height: 56,
|
|
4547
|
+
onPress: () => selectTone(tone),
|
|
4548
|
+
radius: "m",
|
|
4549
|
+
width: 56,
|
|
4550
|
+
children: /* @__PURE__ */ jsx9(Text2, {
|
|
4551
|
+
align: "center",
|
|
4552
|
+
variant: "caption",
|
|
4553
|
+
children: tone.accent
|
|
4554
|
+
})
|
|
4555
|
+
}, tone.id);
|
|
4556
|
+
})
|
|
4557
|
+
}),
|
|
4558
|
+
selectedTone && selectedColor && value ? /* @__PURE__ */ jsxs6(Fragment, {
|
|
4559
|
+
children: [
|
|
4560
|
+
/* @__PURE__ */ jsx9(ColorToneMap, {
|
|
4561
|
+
color: selectedColor,
|
|
4562
|
+
disabled: interactionPolicy === "passive",
|
|
4563
|
+
onChange: (lightness, chroma) => onChange({
|
|
4564
|
+
toneId: selectedTone.id,
|
|
4565
|
+
colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor({ chroma, lightness }, resolveColorHue(entry)) : entry)
|
|
4566
|
+
})
|
|
4567
|
+
}),
|
|
4568
|
+
/* @__PURE__ */ jsxs6(View2, {
|
|
4569
|
+
direction: "row",
|
|
4570
|
+
gap: "xs",
|
|
4571
|
+
wrap: "wrap",
|
|
4572
|
+
children: [
|
|
4573
|
+
colors.map((color, index) => /* @__PURE__ */ jsx9(Pressable3, {
|
|
4574
|
+
accessibilityLabel: `Selected ${selectedTone.accent} color ${index + 1}: ${color}`,
|
|
4575
|
+
accessibilityRole: "radio",
|
|
4576
|
+
accessibilityState: { checked: currentEditingColorIndex === index },
|
|
4577
|
+
bg: color,
|
|
4578
|
+
borderColor: theme.semantics.border.default,
|
|
4579
|
+
borderWidth: currentEditingColorIndex === index ? 3 : 1,
|
|
4580
|
+
disabled: interactionPolicy === "passive",
|
|
4581
|
+
height: 44,
|
|
4582
|
+
onPress: () => setEditingColorIndex(index),
|
|
4583
|
+
radius: "m",
|
|
4584
|
+
width: 44
|
|
4585
|
+
}, `${color}-${index}`)),
|
|
4586
|
+
selectionMode === "multiple" ? /* @__PURE__ */ jsx9(Button, {
|
|
4587
|
+
disabled: interactionPolicy === "passive" || colors.length >= MAX_TONE_COLORS,
|
|
4588
|
+
onPress: () => {
|
|
4589
|
+
setEditingColorIndex(colors.length);
|
|
4590
|
+
onChange({
|
|
4591
|
+
toneId: selectedTone.id,
|
|
4592
|
+
colors: [...colors, resolveOklchColor(selectedTone.accentTarget, 0)]
|
|
4593
|
+
});
|
|
4594
|
+
},
|
|
4595
|
+
children: "Add color"
|
|
4596
|
+
}) : null,
|
|
4597
|
+
selectionMode === "multiple" && colors.length > 1 ? /* @__PURE__ */ jsx9(Button, {
|
|
4598
|
+
disabled: interactionPolicy === "passive",
|
|
4599
|
+
onPress: () => {
|
|
4600
|
+
const nextColors = colors.filter((_, index) => index !== currentEditingColorIndex);
|
|
4601
|
+
setEditingColorIndex(Math.min(currentEditingColorIndex, nextColors.length - 1));
|
|
4602
|
+
onChange({ toneId: selectedTone.id, colors: nextColors });
|
|
4603
|
+
},
|
|
4604
|
+
children: "Remove color"
|
|
4605
|
+
}) : null
|
|
4606
|
+
]
|
|
4607
|
+
}),
|
|
4608
|
+
/* @__PURE__ */ jsx9(ColorSpectrumSlider, {
|
|
4609
|
+
disabled: interactionPolicy === "passive",
|
|
4610
|
+
hue: resolveColorHue(selectedColor),
|
|
4611
|
+
onChange: (nextHue) => onChange({
|
|
4612
|
+
toneId: selectedTone.id,
|
|
4613
|
+
colors: colors.map((entry, index) => index === currentEditingColorIndex ? resolveOklchColor(selectedTone.accentTarget, nextHue) : entry)
|
|
4614
|
+
})
|
|
4615
|
+
}),
|
|
4616
|
+
/* @__PURE__ */ jsx9(ColorHexField, {
|
|
4617
|
+
disabled: interactionPolicy === "passive",
|
|
4618
|
+
onChange: (color) => onChange({
|
|
4619
|
+
toneId: selectedTone.id,
|
|
4620
|
+
colors: colors.map((entry, index) => index === currentEditingColorIndex ? color : entry)
|
|
4621
|
+
}),
|
|
4622
|
+
value: selectedColor
|
|
4623
|
+
}, selectedColor)
|
|
4624
|
+
]
|
|
4625
|
+
}) : null
|
|
4626
|
+
]
|
|
4627
|
+
});
|
|
4628
|
+
}
|
|
4629
|
+
function ColorToneMap({
|
|
4630
|
+
color,
|
|
4631
|
+
disabled,
|
|
4632
|
+
onChange
|
|
4633
|
+
}) {
|
|
4634
|
+
const hue = resolveColorHue(color);
|
|
4635
|
+
const { chroma, lightness } = resolveWheelColorComponents(color);
|
|
4636
|
+
const gradientId = `color-tone-${React9.useId().replaceAll(":", "")}`;
|
|
4637
|
+
const changeAt = (x, y) => {
|
|
4638
|
+
if (disabled)
|
|
4639
|
+
return;
|
|
4640
|
+
onChange(Math.max(0, Math.min(1, 1 - y / TONE_MAP_HEIGHT)), Math.max(0, Math.min(TONE_MAX_CHROMA, x / TONE_MAP_WIDTH * TONE_MAX_CHROMA)));
|
|
4641
|
+
};
|
|
4642
|
+
return /* @__PURE__ */ jsx9(ColorWheelPointerProxy, {
|
|
4643
|
+
disabled,
|
|
4644
|
+
height: TONE_MAP_HEIGHT,
|
|
4645
|
+
onChange: changeAt,
|
|
4646
|
+
width: TONE_MAP_WIDTH,
|
|
4647
|
+
children: /* @__PURE__ */ jsxs6(Svg, {
|
|
4648
|
+
accessibilityLabel: "Tone color plane",
|
|
4649
|
+
height: TONE_MAP_HEIGHT,
|
|
4650
|
+
width: TONE_MAP_WIDTH,
|
|
4651
|
+
children: [
|
|
4652
|
+
/* @__PURE__ */ jsxs6(Defs, {
|
|
4653
|
+
children: [
|
|
4654
|
+
/* @__PURE__ */ jsxs6(LinearGradient, {
|
|
4655
|
+
id: `${gradientId}-white`,
|
|
4656
|
+
x1: "0",
|
|
4657
|
+
x2: "1",
|
|
4658
|
+
y1: "0",
|
|
4659
|
+
y2: "0",
|
|
4660
|
+
children: [
|
|
4661
|
+
/* @__PURE__ */ jsx9(Stop, {
|
|
4662
|
+
offset: "0",
|
|
4663
|
+
stopColor: "white"
|
|
4664
|
+
}),
|
|
4665
|
+
/* @__PURE__ */ jsx9(Stop, {
|
|
4666
|
+
offset: "1",
|
|
4667
|
+
stopColor: resolveOklchColor({ chroma: TONE_MAX_CHROMA, lightness: 0.65 }, hue)
|
|
4668
|
+
})
|
|
4669
|
+
]
|
|
4670
|
+
}),
|
|
4671
|
+
/* @__PURE__ */ jsxs6(LinearGradient, {
|
|
4672
|
+
id: `${gradientId}-black`,
|
|
4673
|
+
x1: "0",
|
|
4674
|
+
x2: "0",
|
|
4675
|
+
y1: "0",
|
|
4676
|
+
y2: "1",
|
|
4677
|
+
children: [
|
|
4678
|
+
/* @__PURE__ */ jsx9(Stop, {
|
|
4679
|
+
offset: "0",
|
|
4680
|
+
stopColor: "transparent"
|
|
4681
|
+
}),
|
|
4682
|
+
/* @__PURE__ */ jsx9(Stop, {
|
|
4683
|
+
offset: "1",
|
|
4684
|
+
stopColor: "black"
|
|
4685
|
+
})
|
|
4686
|
+
]
|
|
4687
|
+
})
|
|
4688
|
+
]
|
|
4689
|
+
}),
|
|
4690
|
+
/* @__PURE__ */ jsx9(Rect, {
|
|
4691
|
+
fill: `url(#${gradientId}-white)`,
|
|
4692
|
+
height: TONE_MAP_HEIGHT,
|
|
4693
|
+
width: TONE_MAP_WIDTH
|
|
4694
|
+
}),
|
|
4695
|
+
/* @__PURE__ */ jsx9(Rect, {
|
|
4696
|
+
fill: `url(#${gradientId}-black)`,
|
|
4697
|
+
height: TONE_MAP_HEIGHT,
|
|
4698
|
+
width: TONE_MAP_WIDTH
|
|
4699
|
+
}),
|
|
4700
|
+
/* @__PURE__ */ jsx9(Circle, {
|
|
4701
|
+
cx: chroma / TONE_MAX_CHROMA * TONE_MAP_WIDTH,
|
|
4702
|
+
cy: (1 - lightness) * TONE_MAP_HEIGHT,
|
|
4703
|
+
fill: "none",
|
|
4704
|
+
r: 10,
|
|
4705
|
+
stroke: "white",
|
|
4706
|
+
strokeWidth: 3
|
|
4707
|
+
}),
|
|
4708
|
+
/* @__PURE__ */ jsx9(Rect, {
|
|
4709
|
+
fill: "transparent",
|
|
4710
|
+
height: TONE_MAP_HEIGHT,
|
|
4711
|
+
onResponderGrant: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
4712
|
+
onResponderMove: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
4713
|
+
onResponderRelease: (event) => changeAt(event.nativeEvent.locationX, event.nativeEvent.locationY),
|
|
4714
|
+
onStartShouldSetResponder: () => !disabled,
|
|
4715
|
+
width: TONE_MAP_WIDTH
|
|
4716
|
+
})
|
|
4717
|
+
]
|
|
4718
|
+
})
|
|
4719
|
+
});
|
|
4720
|
+
}
|
|
4721
|
+
export { ColorHueScale2, ColorWheel2, ColorPicker2, ColorTone2 };
|