@ankhorage/zora 27.3.9 → 27.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/features/color/ColorHueScale.d.ts +4 -0
- package/dist/features/color/ColorHueScale.d.ts.map +1 -0
- package/dist/features/color/ColorHueScale.js +22 -0
- package/dist/features/color/ColorHueScale.js.map +1 -0
- package/dist/features/color/ColorPicker.d.ts +5 -0
- package/dist/features/color/ColorPicker.d.ts.map +1 -0
- package/dist/features/color/ColorPicker.js +48 -0
- package/dist/features/color/ColorPicker.js.map +1 -0
- package/dist/features/color/ColorTone.d.ts +5 -0
- package/dist/features/color/ColorTone.d.ts.map +1 -0
- package/dist/features/color/ColorTone.js +65 -0
- package/dist/features/color/ColorTone.js.map +1 -0
- package/dist/features/color/ColorWheel.d.ts +5 -0
- package/dist/features/color/ColorWheel.d.ts.map +1 -0
- package/dist/features/color/ColorWheel.js +125 -0
- package/dist/features/color/ColorWheel.js.map +1 -0
- package/dist/features/color/ColorWheelKeyboardProxy.d.ts +10 -0
- package/dist/features/color/ColorWheelKeyboardProxy.d.ts.map +1 -0
- package/dist/features/color/ColorWheelKeyboardProxy.js +2 -0
- package/dist/features/color/ColorWheelKeyboardProxy.js.map +1 -0
- package/dist/features/color/ColorWheelKeyboardProxy.native.d.ts +4 -0
- package/dist/features/color/ColorWheelKeyboardProxy.native.d.ts.map +1 -0
- package/dist/features/color/ColorWheelKeyboardProxy.native.js +17 -0
- package/dist/features/color/ColorWheelKeyboardProxy.native.js.map +1 -0
- package/dist/features/color/ColorWheelKeyboardProxy.web.d.ts +5 -0
- package/dist/features/color/ColorWheelKeyboardProxy.web.d.ts.map +1 -0
- package/dist/features/color/ColorWheelKeyboardProxy.web.js +29 -0
- package/dist/features/color/ColorWheelKeyboardProxy.web.js.map +1 -0
- package/dist/features/color/public.d.ts +6 -0
- package/dist/features/color/public.d.ts.map +1 -0
- package/dist/features/color/public.js +5 -0
- package/dist/features/color/public.js.map +1 -0
- package/dist/features/color/utils/resolveColorAtHue.d.ts +4 -0
- package/dist/features/color/utils/resolveColorAtHue.d.ts.map +1 -0
- package/dist/features/color/utils/resolveColorAtHue.js +12 -0
- package/dist/features/color/utils/resolveColorAtHue.js.map +1 -0
- package/dist/features/color/utils/resolveColorHue.d.ts +4 -0
- package/dist/features/color/utils/resolveColorHue.d.ts.map +1 -0
- package/dist/features/color/utils/resolveColorHue.js +8 -0
- package/dist/features/color/utils/resolveColorHue.js.map +1 -0
- package/dist/features/color/utils/resolveOklchColor.d.ts +5 -0
- package/dist/features/color/utils/resolveOklchColor.d.ts.map +1 -0
- package/dist/features/color/utils/resolveOklchColor.js +10 -0
- package/dist/features/color/utils/resolveOklchColor.js.map +1 -0
- package/dist/features/color/utils/resolveWheelColor.d.ts +4 -0
- package/dist/features/color/utils/resolveWheelColor.d.ts.map +1 -0
- package/dist/features/color/utils/resolveWheelColor.js +17 -0
- package/dist/features/color/utils/resolveWheelColor.js.map +1 -0
- package/dist/features/color/utils/resolveWheelColorComponents.d.ts +7 -0
- package/dist/features/color/utils/resolveWheelColorComponents.d.ts.map +1 -0
- package/dist/features/color/utils/resolveWheelColorComponents.js +11 -0
- package/dist/features/color/utils/resolveWheelColorComponents.js.map +1 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js +11 -7
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.d.ts +2 -2
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.js +7 -7
- package/dist/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.d.ts +7 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.d.ts.map +1 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.js +40 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.js.map +1 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +28 -4
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/selection/application/resolveSelectionEventIntent.d.ts +1 -1
- package/dist/features/selection/application/resolveSelectionEventIntent.d.ts.map +1 -1
- package/dist/features/selection/application/resolveSelectionEventIntent.js +14 -5
- package/dist/features/selection/application/resolveSelectionEventIntent.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/color.d.ts +70 -0
- package/dist/types/color.d.ts.map +1 -0
- package/dist/types/color.js +2 -0
- package/dist/types/color.js.map +1 -0
- package/package.json +3 -1
- package/src/audit.test.ts +3 -3
- package/src/features/color/ColorHueScale.tsx +57 -0
- package/src/features/color/ColorPicker.tsx +105 -0
- package/src/features/color/ColorTone.tsx +137 -0
- package/src/features/color/ColorWheel.tsx +251 -0
- package/src/features/color/ColorWheelKeyboardProxy.native.tsx +34 -0
- package/src/features/color/ColorWheelKeyboardProxy.tsx +11 -0
- package/src/features/color/ColorWheelKeyboardProxy.web.tsx +47 -0
- package/src/features/color/public.ts +17 -0
- package/src/features/color/utils/colorMath.test.ts +37 -0
- package/src/features/color/utils/resolveColorAtHue.ts +14 -0
- package/src/features/color/utils/resolveColorHue.ts +10 -0
- package/src/features/color/utils/resolveOklchColor.ts +13 -0
- package/src/features/color/utils/resolveWheelColor.ts +28 -0
- package/src/features/color/utils/resolveWheelColorComponents.ts +16 -0
- package/src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx +16 -4
- package/src/features/graph-view/adapters/inbound/web-artifact/bindGraphEvents.ts +24 -4
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.test.ts +28 -0
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.ts +48 -0
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +16 -6
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +34 -3
- package/src/features/selection/application/resolveSelectionEventIntent.test.ts +1 -0
- package/src/features/selection/application/resolveSelectionEventIntent.ts +18 -4
- package/src/index.ts +14 -0
- package/src/types/color.ts +75 -0
- package/src/webPackageExports.test.ts +15 -0
- package/web-dist/authoring/index.js +6 -5
- package/web-dist/chunks/{Accordion-5w8chhxm.js → Accordion-001ymezm.js} +3 -63
- package/web-dist/chunks/{Accordion-2d5jdxeg.js → Accordion-01s50nga.js} +2 -2
- package/web-dist/chunks/{Accordion-dhnd347t.js → Accordion-09jkcm1x.js} +695 -4591
- package/web-dist/chunks/Accordion-0z2t95zw.js +548 -0
- package/web-dist/chunks/{Accordion-z1k4wg10.js → Accordion-120nmpbe.js} +3 -3
- package/web-dist/chunks/{Accordion-zrn4dy6s.js → Accordion-401452az.js} +6 -6
- package/web-dist/chunks/{Accordion-yy6qy5y2.js → Accordion-44bcsg35.js} +6 -6
- package/web-dist/chunks/{Accordion-5hvq2r84.js → Accordion-49m38edd.js} +4 -4
- package/web-dist/chunks/{Accordion-x4bpna1q.js → Accordion-49mzcav8.js} +4 -4
- package/web-dist/chunks/{Accordion-h3r90b65.js → Accordion-52a3dpsm.js} +4 -4
- package/web-dist/chunks/{Accordion-bhr3r525.js → Accordion-549akrjn.js} +4 -4
- package/web-dist/chunks/{Accordion-7atd70rg.js → Accordion-64px84rh.js} +10 -10
- package/web-dist/chunks/{Accordion-enracgev.js → Accordion-6ec9bfd8.js} +4 -4
- package/web-dist/chunks/Accordion-6jb7b67v.js +66 -0
- package/web-dist/chunks/{Accordion-5gbd0wzf.js → Accordion-8ac6dkcs.js} +1 -1
- package/web-dist/chunks/{Accordion-w18jbs39.js → Accordion-8q7hn9aj.js} +1 -1
- package/web-dist/chunks/{Accordion-825x4t0z.js → Accordion-8vcs6nz6.js} +1 -1
- package/web-dist/chunks/{Accordion-qqv9mak2.js → Accordion-9d3rd7ne.js} +1 -1
- package/web-dist/chunks/{Accordion-zfsnh03k.js → Accordion-9hcbf56f.js} +2 -2
- package/web-dist/chunks/{Accordion-rrmy3736.js → Accordion-a6xxvydp.js} +2 -2
- package/web-dist/chunks/{Accordion-dv281jw0.js → Accordion-b4yr6yq3.js} +2 -2
- package/web-dist/chunks/{Accordion-c1x8bqnr.js → Accordion-b8t2gq8g.js} +9 -9
- package/web-dist/chunks/{Accordion-25xjvp3t.js → Accordion-dk40hsc0.js} +2 -2
- package/web-dist/chunks/{Accordion-1dr6ktbf.js → Accordion-dxhs3xwx.js} +7 -7
- package/web-dist/chunks/{Accordion-q5swmcwm.js → Accordion-e1krqvc4.js} +3 -3
- package/web-dist/chunks/{Accordion-md1g54wg.js → Accordion-eq27a9ms.js} +6 -5
- package/web-dist/chunks/{Accordion-b7jgtnvm.js → Accordion-ew2cebyd.js} +3 -3
- package/web-dist/chunks/{Accordion-j3twwxyt.js → Accordion-g9m813fh.js} +2 -2
- package/web-dist/chunks/{Accordion-b36h9a7g.js → Accordion-gysa24fk.js} +1 -1
- package/web-dist/chunks/{Accordion-2xdwc579.js → Accordion-h21ah8w3.js} +6 -6
- package/web-dist/chunks/{Accordion-2rtkfs9t.js → Accordion-hfb983jm.js} +3 -3
- package/web-dist/chunks/{Accordion-5p0pc8wp.js → Accordion-j61qh3rb.js} +2 -2
- package/web-dist/chunks/{Accordion-tf459afq.js → Accordion-kexh248h.js} +2 -2
- package/web-dist/chunks/{Accordion-gbe84kyw.js → Accordion-kx6695j5.js} +2 -2
- package/web-dist/chunks/{Accordion-w42y21pt.js → Accordion-mrhkw8n6.js} +1 -1
- package/web-dist/chunks/{Accordion-vyr0wyp9.js → Accordion-ng9pnz9r.js} +9 -9
- package/web-dist/chunks/{Accordion-x3shxr1k.js → Accordion-p43psvv8.js} +6 -6
- package/web-dist/chunks/{Accordion-6y9ac3ad.js → Accordion-rcs75kj4.js} +3 -3
- package/web-dist/chunks/Accordion-rj3ayvn5.js +3925 -0
- package/web-dist/chunks/{Accordion-4d12nnq0.js → Accordion-sheqvs8c.js} +11 -11
- package/web-dist/chunks/{Accordion-j77vvja1.js → Accordion-ss57gqjb.js} +5 -5
- package/web-dist/chunks/{Accordion-hsnh2dgt.js → Accordion-sttjd4rs.js} +7 -7
- package/web-dist/chunks/{Accordion-n95zwem8.js → Accordion-sz17szqm.js} +8 -8
- package/web-dist/chunks/{Accordion-0ecj6p6b.js → Accordion-tchccn9f.js} +5 -5
- package/web-dist/chunks/{Accordion-4d4xahgg.js → Accordion-tpd1vvy9.js} +77 -74
- package/web-dist/chunks/{Accordion-bm75sm6d.js → Accordion-vzgpdtr2.js} +1 -1
- package/web-dist/chunks/{Accordion-4hthnyjj.js → Accordion-wdefxczv.js} +9 -9
- package/web-dist/chunks/{Accordion-2pq8kbaq.js → Accordion-wtqev4qa.js} +7 -7
- package/web-dist/chunks/{Accordion-s6n61fx6.js → Accordion-x33am5bc.js} +3 -3
- package/web-dist/chunks/{Accordion-5zx8d19h.js → Accordion-xfdp8w37.js} +13 -13
- package/web-dist/chunks/{Accordion-st7rj6hc.js → Accordion-xs9aspze.js} +4 -4
- package/web-dist/chunks/{Accordion-nf16vayy.js → Accordion-z4m47w0b.js} +2 -2
- package/web-dist/chunks/{Accordion-x2d68rrj.js → Accordion-z5kr43w5.js} +4 -4
- package/web-dist/chunks/{Accordion-nks69epp.js → Accordion-z8c7y6d8.js} +5 -5
- package/web-dist/components/accordion/Accordion.js +10 -10
- package/web-dist/components/accordion-item/AccordionItem.js +10 -10
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +16 -15
- package/web-dist/components/app-header/AppHeader.js +16 -15
- package/web-dist/components/app-shell/AppShell.js +4 -4
- package/web-dist/components/auth-screen/AuthScreen.js +21 -19
- package/web-dist/components/avatar/Avatar.js +10 -10
- package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
- package/web-dist/components/badge/Badge.js +5 -5
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +19 -18
- package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +15 -14
- package/web-dist/components/button/Button.js +11 -10
- package/web-dist/components/button-group/ButtonGroup.js +11 -10
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +19 -18
- package/web-dist/components/card/Card.js +18 -17
- package/web-dist/components/card-back/CardBack.js +4 -4
- package/web-dist/components/card-hand/CardHand.js +4 -4
- package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
- package/web-dist/components/checkbox/Checkbox.js +10 -10
- package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
- package/web-dist/components/chess-board/ChessBoard.js +4 -4
- package/web-dist/components/chip/Chip.js +11 -11
- package/web-dist/components/chip-group/ChipGroup.js +11 -11
- package/web-dist/components/collection-editor/CollectionEditor.js +20 -19
- package/web-dist/components/color-hue-scale/ColorHueScale.d.ts +6 -0
- package/web-dist/components/color-hue-scale/ColorHueScale.js +33 -0
- package/web-dist/components/color-hue-scale/index.d.ts +1 -0
- package/web-dist/components/color-hue-scale/index.js +2 -0
- package/web-dist/components/color-picker/ColorPicker.d.ts +6 -0
- package/web-dist/components/color-picker/ColorPicker.js +33 -0
- package/web-dist/components/color-picker/index.d.ts +1 -0
- package/web-dist/components/color-picker/index.js +2 -0
- package/web-dist/components/color-tone/ColorTone.d.ts +6 -0
- package/web-dist/components/color-tone/ColorTone.js +33 -0
- package/web-dist/components/color-tone/index.d.ts +1 -0
- package/web-dist/components/color-tone/index.js +2 -0
- package/web-dist/components/color-wheel/ColorWheel.d.ts +6 -0
- package/web-dist/components/color-wheel/ColorWheel.js +33 -0
- package/web-dist/components/color-wheel/index.d.ts +1 -0
- package/web-dist/components/color-wheel/index.js +2 -0
- package/web-dist/components/content-rail/ContentRail.js +14 -13
- package/web-dist/components/data-table/DataTable.js +25 -24
- package/web-dist/components/date-picker/DatePicker.js +16 -15
- package/web-dist/components/dialog/Dialog.js +9 -9
- package/web-dist/components/divider/Divider.js +4 -4
- package/web-dist/components/empty-state/EmptyState.js +19 -18
- package/web-dist/components/explorer/Explorer.js +11 -11
- package/web-dist/components/field/Field.js +10 -10
- package/web-dist/components/file-explorer/FileExplorer.js +11 -11
- package/web-dist/components/flat-list/FlatList.js +11 -11
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +21 -19
- package/web-dist/components/form/Form.js +15 -14
- package/web-dist/components/form-actions/FormActions.js +15 -14
- package/web-dist/components/form-error/FormError.js +15 -14
- package/web-dist/components/game/Game.js +5 -5
- package/web-dist/components/game-entity/GameEntity.js +5 -5
- package/web-dist/components/game-field/GameField.js +5 -5
- package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
- package/web-dist/components/game-overlay/GameOverlay.js +5 -5
- package/web-dist/components/gradient/Gradient.js +5 -5
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
- package/web-dist/components/graph-view/GraphView.js +81 -18
- package/web-dist/components/grid/Grid.js +4 -4
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
- package/web-dist/components/grid-ruler/GridRuler.js +4 -4
- package/web-dist/components/heading/Heading.js +5 -5
- package/web-dist/components/hero/Hero.js +20 -19
- package/web-dist/components/icon/Icon.js +4 -4
- package/web-dist/components/icon-button/IconButton.js +11 -10
- package/web-dist/components/image/Image.js +8 -8
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
- package/web-dist/components/list/List.js +11 -11
- package/web-dist/components/list-item/ListItem.js +11 -11
- package/web-dist/components/list-section/ListSection.js +11 -11
- package/web-dist/components/matrix-grid/MatrixGrid.js +5 -5
- package/web-dist/components/media-card/MediaCard.js +18 -17
- package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
- package/web-dist/components/message-bubble/MessageBubble.js +14 -14
- package/web-dist/components/metric-card/MetricCard.js +18 -17
- package/web-dist/components/missing-element/MissingElement.js +9 -9
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +21 -19
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +21 -19
- package/web-dist/components/opening-book/OpeningBook.js +4 -4
- package/web-dist/components/otp-form/OtpForm.js +21 -19
- package/web-dist/components/pagination/Pagination.js +14 -13
- package/web-dist/components/palette-item/PaletteItem.js +18 -17
- package/web-dist/components/playing-card/PlayingCard.js +4 -4
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
- package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
- package/web-dist/components/post-card/PostCard.js +18 -17
- package/web-dist/components/product-card/ProductCard.js +18 -17
- package/web-dist/components/progress/Progress.js +8 -8
- package/web-dist/components/progress-ring/ProgressRing.js +8 -8
- package/web-dist/components/radio/Radio.js +12 -12
- package/web-dist/components/radio-group/RadioGroup.js +12 -12
- package/web-dist/components/rating/Rating.js +7 -7
- package/web-dist/components/reader/Reader.js +21 -20
- package/web-dist/components/scan-overlay/ScanOverlay.js +19 -18
- package/web-dist/components/screen/Screen.js +4 -4
- package/web-dist/components/screen-section/ScreenSection.js +8 -8
- package/web-dist/components/scroll-view/ScrollView.js +4 -4
- package/web-dist/components/search-input/SearchInput.js +14 -12
- package/web-dist/components/section-header/SectionHeader.js +8 -8
- package/web-dist/components/section-list/SectionList.js +11 -11
- package/web-dist/components/select/Select.js +14 -13
- package/web-dist/components/selectable-item/SelectableItem.js +3 -3
- package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
- package/web-dist/components/sign-in-form/SignInForm.js +21 -19
- package/web-dist/components/sign-up-form/SignUpForm.js +21 -19
- package/web-dist/components/skeleton/Skeleton.js +21 -20
- package/web-dist/components/skeleton-card/SkeletonCard.js +21 -20
- package/web-dist/components/skeleton-list/SkeletonList.js +21 -20
- package/web-dist/components/skeleton-text/SkeletonText.js +21 -20
- package/web-dist/components/surface/Surface.js +5 -5
- package/web-dist/components/switch/Switch.js +5 -5
- package/web-dist/components/tab/Tab.js +5 -5
- package/web-dist/components/tab-list/TabList.js +5 -5
- package/web-dist/components/tab-panel/TabPanel.js +5 -5
- package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
- package/web-dist/components/tabs/Tabs.js +5 -5
- package/web-dist/components/text/Text.js +5 -5
- package/web-dist/components/text-input/TextInput.js +14 -12
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +13 -12
- package/web-dist/components/time-picker/TimePicker.js +16 -15
- package/web-dist/components/timeline/Timeline.js +9 -9
- package/web-dist/components/toast/Toast.js +7 -7
- package/web-dist/components/toast-provider/ToastProvider.js +7 -7
- package/web-dist/components/toolbar/Toolbar.js +18 -17
- package/web-dist/components/tree-item/TreeItem.js +19 -18
- package/web-dist/components/tree-view/TreeView.js +1 -1
- package/web-dist/components/uploader/Uploader.js +23 -22
- package/web-dist/components/view/View.js +4 -4
- package/web-dist/manifest.json +1473 -1271
- package/web-dist/runtime/ZoraProvider.js +6 -6
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
GraphViewRenderedNode,
|
|
9
9
|
} from '../../../../../types/graph-view';
|
|
10
10
|
import { GRAPH_VIEW_EVENTS } from '../../../constants/events';
|
|
11
|
+
import { createGraphPointerDownReader } from './createGraphPointerDownReader';
|
|
11
12
|
import { createGraphRuntime, type GraphRuntime } from './createGraphRuntime';
|
|
12
13
|
import { createGraphViewDomCallbacks } from './createGraphViewDomCallbacks';
|
|
13
14
|
import { GraphNodeOverlay } from './GraphNodeOverlay';
|
|
@@ -37,11 +38,20 @@ type GraphContainer = NonNullable<CytoscapeOptions['container']>;
|
|
|
37
38
|
*/
|
|
38
39
|
export function GraphView(props: GraphViewProps) {
|
|
39
40
|
const hostRef = React.useRef<HTMLDivElement | null>(null);
|
|
40
|
-
const
|
|
41
|
+
const pointerDownReader = React.useMemo(createGraphPointerDownReader, []);
|
|
42
|
+
const { containerRef, renderedNodes, runtimeRef } = useGraphViewRuntime(
|
|
43
|
+
props,
|
|
44
|
+
hostRef,
|
|
45
|
+
pointerDownReader,
|
|
46
|
+
);
|
|
41
47
|
|
|
42
48
|
return (
|
|
43
49
|
<div
|
|
44
50
|
ref={hostRef}
|
|
51
|
+
onPointerDown={(event) => {
|
|
52
|
+
pointerDownReader.write(event.nativeEvent);
|
|
53
|
+
}}
|
|
54
|
+
onPointerCancel={pointerDownReader.clear}
|
|
45
55
|
aria-label={props.ariaLabel ?? 'Graph'}
|
|
46
56
|
className={props.className}
|
|
47
57
|
role="application"
|
|
@@ -77,13 +87,14 @@ GraphView.events = GRAPH_VIEW_EVENTS;
|
|
|
77
87
|
function useGraphViewRuntime(
|
|
78
88
|
props: GraphViewProps,
|
|
79
89
|
hostRef: React.RefObject<HTMLDivElement | null>,
|
|
90
|
+
pointerDownReader: ReturnType<typeof createGraphPointerDownReader>,
|
|
80
91
|
) {
|
|
81
92
|
const containerRef = React.useRef<GraphContainer | null>(null);
|
|
82
93
|
const runtimeRef = React.useRef<GraphRuntime | null>(null);
|
|
83
94
|
const callbacksRef = useGraphCallbacksRef(props, hostRef);
|
|
84
95
|
const [renderedNodes, setRenderedNodes] = React.useState<readonly GraphViewRenderedNode[]>([]);
|
|
85
96
|
|
|
86
|
-
useRuntimeLifecycle(containerRef, runtimeRef, callbacksRef);
|
|
97
|
+
useRuntimeLifecycle(containerRef, runtimeRef, callbacksRef, pointerDownReader);
|
|
87
98
|
useRuntimeGraphUpdate(runtimeRef, props);
|
|
88
99
|
useRuntimeSelection(runtimeRef, props.selectedNodeIds);
|
|
89
100
|
useRenderedNodeSubscription(runtimeRef, props.renderNode, setRenderedNodes);
|
|
@@ -139,17 +150,18 @@ function useRuntimeLifecycle(
|
|
|
139
150
|
containerRef: { current: GraphContainer | null },
|
|
140
151
|
runtimeRef: { current: GraphRuntime | null },
|
|
141
152
|
callbacksRef: { current: GraphViewCallbacks },
|
|
153
|
+
pointerDownReader: ReturnType<typeof createGraphPointerDownReader>,
|
|
142
154
|
) {
|
|
143
155
|
React.useEffect(() => {
|
|
144
156
|
const container = containerRef.current;
|
|
145
157
|
if (container === null) return;
|
|
146
|
-
const runtime = createGraphRuntime(container, callbacksRef);
|
|
158
|
+
const runtime = createGraphRuntime(container, callbacksRef, pointerDownReader.read);
|
|
147
159
|
runtimeRef.current = runtime;
|
|
148
160
|
return () => {
|
|
149
161
|
runtime.destroy();
|
|
150
162
|
runtimeRef.current = null;
|
|
151
163
|
};
|
|
152
|
-
}, [callbacksRef, containerRef, runtimeRef]);
|
|
164
|
+
}, [callbacksRef, containerRef, pointerDownReader, runtimeRef]);
|
|
153
165
|
}
|
|
154
166
|
|
|
155
167
|
/*** Synchronize graph data and layout policy without exposing Cytoscape to React. */
|
|
@@ -14,9 +14,22 @@ export function bindGraphEvents(
|
|
|
14
14
|
callbacksRef: { current: GraphViewCallbacks },
|
|
15
15
|
controller: GraphViewController,
|
|
16
16
|
onRuntimeChange: () => void,
|
|
17
|
+
readLatestPointerDown: (event: EventObject) => unknown = () => null,
|
|
17
18
|
) {
|
|
18
|
-
const nodeHandlers = bindElementEvents(
|
|
19
|
-
|
|
19
|
+
const nodeHandlers = bindElementEvents(
|
|
20
|
+
cy,
|
|
21
|
+
'node',
|
|
22
|
+
callbacksRef,
|
|
23
|
+
onRuntimeChange,
|
|
24
|
+
readLatestPointerDown,
|
|
25
|
+
);
|
|
26
|
+
const edgeHandlers = bindElementEvents(
|
|
27
|
+
cy,
|
|
28
|
+
'edge',
|
|
29
|
+
callbacksRef,
|
|
30
|
+
onRuntimeChange,
|
|
31
|
+
readLatestPointerDown,
|
|
32
|
+
);
|
|
20
33
|
const viewportHandler = () => {
|
|
21
34
|
callbacksRef.current.onViewportChange?.(controller.getViewport());
|
|
22
35
|
onRuntimeChange();
|
|
@@ -43,6 +56,7 @@ function bindElementEvents(
|
|
|
43
56
|
selector: ElementSelector,
|
|
44
57
|
callbacksRef: { current: GraphViewCallbacks },
|
|
45
58
|
onRuntimeChange: () => void,
|
|
59
|
+
readLatestPointerDown: (event: EventObject) => unknown,
|
|
46
60
|
): readonly BoundElementHandler[] {
|
|
47
61
|
return EVENT_TYPES.map(([cytoscapeEvent, type]) => {
|
|
48
62
|
const handler = (event: EventObject) => {
|
|
@@ -51,7 +65,12 @@ function bindElementEvents(
|
|
|
51
65
|
emitElementEvent(
|
|
52
66
|
callbacksRef.current,
|
|
53
67
|
selector,
|
|
54
|
-
createElementEvent(
|
|
68
|
+
createElementEvent(
|
|
69
|
+
event,
|
|
70
|
+
target.id(),
|
|
71
|
+
type,
|
|
72
|
+
type === 'press' ? readLatestPointerDown(event) : null,
|
|
73
|
+
),
|
|
55
74
|
);
|
|
56
75
|
onRuntimeChange();
|
|
57
76
|
};
|
|
@@ -65,12 +84,13 @@ function createElementEvent(
|
|
|
65
84
|
event: EventObject,
|
|
66
85
|
id: string,
|
|
67
86
|
type: GraphViewElementEventType,
|
|
87
|
+
nativeEvent: unknown,
|
|
68
88
|
): GraphViewElementEvent {
|
|
69
89
|
if (type !== 'press') return { id, type };
|
|
70
90
|
return {
|
|
71
91
|
id,
|
|
72
92
|
type,
|
|
73
|
-
selectionIntent: resolveSelectionEventIntent(event, 'pointer'),
|
|
93
|
+
selectionIntent: resolveSelectionEventIntent(event, 'pointer', nativeEvent),
|
|
74
94
|
};
|
|
75
95
|
}
|
|
76
96
|
|
package/src/features/graph-view/adapters/inbound/web-artifact/createGraphPointerDownReader.test.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { createGraphPointerDownReader } from './createGraphPointerDownReader';
|
|
4
|
+
|
|
5
|
+
test('uses a Ctrl pointer snapshot only for its matching renderer pointer activation', () => {
|
|
6
|
+
const reader = createGraphPointerDownReader();
|
|
7
|
+
const pointerDown = { ctrlKey: true, pointerId: 7 };
|
|
8
|
+
|
|
9
|
+
reader.write(pointerDown);
|
|
10
|
+
|
|
11
|
+
expect(reader.read({ originalEvent: { pointerId: 7 } })).toBe(pointerDown);
|
|
12
|
+
expect(reader.read({ originalEvent: { pointerId: 7 } })).toBeNull();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('discards a Meta pointer snapshot for unrelated touch, keyboard, programmatic, and mouse events', () => {
|
|
16
|
+
const unrelatedEvents = [
|
|
17
|
+
{ originalEvent: { pointerId: 8, pointerType: 'touch' } },
|
|
18
|
+
{ originalEvent: { key: 'Enter', type: 'keydown' } },
|
|
19
|
+
{},
|
|
20
|
+
{ originalEvent: { pointerId: 9, pointerType: 'mouse' } },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
for (const event of unrelatedEvents) {
|
|
24
|
+
const reader = createGraphPointerDownReader();
|
|
25
|
+
reader.write({ metaKey: true, pointerId: 7 });
|
|
26
|
+
expect(reader.read(event)).toBeNull();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { isRecord } from '@ankhorage/utility/object';
|
|
2
|
+
|
|
3
|
+
/*** Correlate one native pointer-down snapshot with its renderer activation without retaining stale modifiers. */
|
|
4
|
+
export function createGraphPointerDownReader() {
|
|
5
|
+
let latestPointerDown: GraphPointerDownSnapshot | null = null;
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
clear: () => {
|
|
9
|
+
latestPointerDown = null;
|
|
10
|
+
},
|
|
11
|
+
read: (rendererEvent: unknown): unknown => {
|
|
12
|
+
const pointerDown = latestPointerDown;
|
|
13
|
+
latestPointerDown = null;
|
|
14
|
+
if (pointerDown === null) return null;
|
|
15
|
+
return matchesPointerActivation(pointerDown, rendererEvent) ? pointerDown.event : null;
|
|
16
|
+
},
|
|
17
|
+
write: (event: unknown) => {
|
|
18
|
+
latestPointerDown = createPointerDownSnapshot(event);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/*** Match only the same browser pointer so unrelated renderer events cannot inherit modifiers. */
|
|
24
|
+
function matchesPointerActivation(
|
|
25
|
+
pointerDown: GraphPointerDownSnapshot,
|
|
26
|
+
rendererEvent: unknown,
|
|
27
|
+
): boolean {
|
|
28
|
+
return readRendererPointerId(rendererEvent) === pointerDown.pointerId;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*** Retain a browser pointer event only when it provides a stable pointer identity. */
|
|
32
|
+
function createPointerDownSnapshot(event: unknown): GraphPointerDownSnapshot | null {
|
|
33
|
+
if (!isRecord(event) || typeof event.pointerId !== 'number') return null;
|
|
34
|
+
return { event, pointerId: event.pointerId };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*** Read Cytoscape's underlying browser event without trusting programmatic event shapes. */
|
|
38
|
+
function readRendererPointerId(value: unknown): number | null {
|
|
39
|
+
if (!isRecord(value)) return null;
|
|
40
|
+
const { originalEvent } = value;
|
|
41
|
+
if (!isRecord(originalEvent) || typeof originalEvent.pointerId !== 'number') return null;
|
|
42
|
+
return originalEvent.pointerId;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface GraphPointerDownSnapshot {
|
|
46
|
+
readonly event: unknown;
|
|
47
|
+
readonly pointerId: number;
|
|
48
|
+
}
|
|
@@ -328,9 +328,12 @@ test('forwards semantic selection intent from rich-node press events', async ()
|
|
|
328
328
|
|
|
329
329
|
test('settles the pending initial layout when presentation changes before readiness', async () => {
|
|
330
330
|
const ready = Promise.withResolvers<GraphViewController>();
|
|
331
|
-
const calls = { ready: 0, sort: 0 };
|
|
331
|
+
const calls = { completed: 0, ready: 0, sort: 0 };
|
|
332
332
|
const runtime = createGraphRuntime(undefined, {
|
|
333
333
|
current: {
|
|
334
|
+
onLayoutComplete: () => {
|
|
335
|
+
calls.completed += 1;
|
|
336
|
+
},
|
|
334
337
|
onReady: (controller) => {
|
|
335
338
|
calls.ready += 1;
|
|
336
339
|
ready.resolve(controller);
|
|
@@ -351,11 +354,11 @@ test('settles the pending initial layout when presentation changes before readin
|
|
|
351
354
|
};
|
|
352
355
|
try {
|
|
353
356
|
runtime.update(input);
|
|
354
|
-
const sortCount = calls.sort;
|
|
355
357
|
runtime.update({ ...input, nodes: [{ id: 'a', classes: 'hovered' }, { id: 'b' }] });
|
|
356
358
|
await ready.promise;
|
|
357
359
|
expect(calls.ready).toBe(1);
|
|
358
|
-
expect(calls.
|
|
360
|
+
expect(calls.completed).toBe(1);
|
|
361
|
+
expect(calls.sort).toBeGreaterThan(0);
|
|
359
362
|
} finally {
|
|
360
363
|
runtime.destroy();
|
|
361
364
|
}
|
|
@@ -363,8 +366,15 @@ test('settles the pending initial layout when presentation changes before readin
|
|
|
363
366
|
|
|
364
367
|
test('lays out 0 → 1 → 5 topology updates before preserve-positions becomes active', async () => {
|
|
365
368
|
const ready = Promise.withResolvers<GraphViewController>();
|
|
366
|
-
const calls = { sort: 0 };
|
|
367
|
-
const runtime = createGraphRuntime(undefined, {
|
|
369
|
+
const calls = { completed: 0, sort: 0 };
|
|
370
|
+
const runtime = createGraphRuntime(undefined, {
|
|
371
|
+
current: {
|
|
372
|
+
onLayoutComplete: () => {
|
|
373
|
+
calls.completed += 1;
|
|
374
|
+
},
|
|
375
|
+
onReady: ready.resolve,
|
|
376
|
+
},
|
|
377
|
+
});
|
|
368
378
|
const layoutOptions = {
|
|
369
379
|
sort: () => {
|
|
370
380
|
calls.sort += 1;
|
|
@@ -385,7 +395,7 @@ test('lays out 0 → 1 → 5 topology updates before preserve-positions becomes
|
|
|
385
395
|
runtime.update({ ...input, nodes: fiveNodes });
|
|
386
396
|
const controller = await ready.promise;
|
|
387
397
|
|
|
388
|
-
expect(calls.
|
|
398
|
+
expect(calls.completed).toBe(1);
|
|
389
399
|
expect(controller.measureNodes?.(fiveNodes.map((node) => node.id))?.nodes).toHaveLength(5);
|
|
390
400
|
} finally {
|
|
391
401
|
runtime.destroy();
|
|
@@ -54,6 +54,7 @@ interface GraphRuntimeState {
|
|
|
54
54
|
readonly generationRef: { current: number };
|
|
55
55
|
readonly geometryRef: { current: string | null };
|
|
56
56
|
readonly hoveredNodeIds: Set<string>;
|
|
57
|
+
readonly initialLayoutScheduledRef: { current: boolean };
|
|
57
58
|
readonly latestUpdateRef: { current: GraphRuntimeUpdate | null };
|
|
58
59
|
readonly layoutRef: { current: ReturnType<typeof runGraphLayout> | null };
|
|
59
60
|
readonly layoutRunningRef: { current: boolean };
|
|
@@ -74,6 +75,7 @@ interface GraphRuntimeState {
|
|
|
74
75
|
export function createGraphRuntime(
|
|
75
76
|
container: GraphContainer,
|
|
76
77
|
callbacksRef: { current: GraphViewCallbacks },
|
|
78
|
+
readLatestPointerDown: (event: unknown) => unknown = () => null,
|
|
77
79
|
): GraphRuntime {
|
|
78
80
|
const cy = cytoscape({
|
|
79
81
|
container,
|
|
@@ -83,7 +85,7 @@ export function createGraphRuntime(
|
|
|
83
85
|
selectionType: 'additive',
|
|
84
86
|
userPanningEnabled: true,
|
|
85
87
|
});
|
|
86
|
-
const state = createRuntimeState(cy, container, callbacksRef);
|
|
88
|
+
const state = createRuntimeState(cy, container, callbacksRef, readLatestPointerDown);
|
|
87
89
|
|
|
88
90
|
return {
|
|
89
91
|
destroy: () => destroyRuntime(state),
|
|
@@ -101,6 +103,7 @@ function createRuntimeState(
|
|
|
101
103
|
cy: Core,
|
|
102
104
|
container: GraphContainer,
|
|
103
105
|
callbacksRef: { current: GraphViewCallbacks },
|
|
106
|
+
readLatestPointerDown: (event: unknown) => unknown,
|
|
104
107
|
): GraphRuntimeState {
|
|
105
108
|
const fitPaddingRef = { current: 50 };
|
|
106
109
|
const viewport = createGraphController(cy, fitPaddingRef, (options) =>
|
|
@@ -121,6 +124,7 @@ function createRuntimeState(
|
|
|
121
124
|
generationRef: { current: 0 },
|
|
122
125
|
geometryRef: { current: null as string | null },
|
|
123
126
|
hoveredNodeIds: new Set<string>(),
|
|
127
|
+
initialLayoutScheduledRef: { current: false },
|
|
124
128
|
latestUpdateRef: { current: null as GraphRuntimeUpdate | null },
|
|
125
129
|
layoutRef: { current: null as ReturnType<typeof runGraphLayout> | null },
|
|
126
130
|
layoutRunningRef,
|
|
@@ -134,8 +138,12 @@ function createRuntimeState(
|
|
|
134
138
|
relayoutScheduledRef: { current: false },
|
|
135
139
|
renderedNodeListeners,
|
|
136
140
|
};
|
|
137
|
-
const unbindEvents = bindGraphEvents(
|
|
138
|
-
|
|
141
|
+
const unbindEvents = bindGraphEvents(
|
|
142
|
+
cy,
|
|
143
|
+
callbacksRef,
|
|
144
|
+
controller,
|
|
145
|
+
() => emitRenderedNodes(stateBase),
|
|
146
|
+
readLatestPointerDown,
|
|
139
147
|
);
|
|
140
148
|
const resizeObserver = createGraphResizeObserver({
|
|
141
149
|
container,
|
|
@@ -253,6 +261,29 @@ function getRetainedNodeIds(
|
|
|
253
261
|
|
|
254
262
|
/*** Start a generation-safe layout whose completion is the only normal automatic fit trigger. */
|
|
255
263
|
function startCurrentLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {
|
|
264
|
+
if (!state.readyRef.current) {
|
|
265
|
+
scheduleInitialLayout(state);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
startGraphLayout(state, input);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/*** Coalesce progressive pre-ready topology updates before the initial layout can complete. */
|
|
272
|
+
function scheduleInitialLayout(state: GraphRuntimeState) {
|
|
273
|
+
if (state.initialLayoutScheduledRef.current) return;
|
|
274
|
+
state.initialLayoutScheduledRef.current = true;
|
|
275
|
+
scheduleGraphFrame(() => {
|
|
276
|
+
scheduleGraphFrame(() => {
|
|
277
|
+
state.initialLayoutScheduledRef.current = false;
|
|
278
|
+
const input = state.latestUpdateRef.current;
|
|
279
|
+
if (input === null || state.cy.destroyed() || state.readyRef.current) return;
|
|
280
|
+
startGraphLayout(state, input);
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/*** Start one layout generation after its input has reached the runtime owner. */
|
|
286
|
+
function startGraphLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {
|
|
256
287
|
state.pendingInitialFitRef.current = false;
|
|
257
288
|
const generation = state.generationRef.current + 1;
|
|
258
289
|
state.generationRef.current = generation;
|
|
@@ -12,6 +12,7 @@ describe('resolveSelectionEventIntent', () => {
|
|
|
12
12
|
expect(resolveSelectionEventIntent({ nativeEvent: { ctrlKey: true } }, 'pointer')).toBe(
|
|
13
13
|
'toggle',
|
|
14
14
|
);
|
|
15
|
+
expect(resolveSelectionEventIntent({}, 'pointer', { ctrlKey: true })).toBe('toggle');
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
test('toggles pointer events reported as touch', () => {
|
|
@@ -11,18 +11,32 @@ import type { SelectionIntent } from '@ankhorage/utility/selection';
|
|
|
11
11
|
export function resolveSelectionEventIntent(
|
|
12
12
|
event: unknown,
|
|
13
13
|
fallbackKind: SelectionActivationKind,
|
|
14
|
+
nativeEvent: unknown = {},
|
|
14
15
|
): SelectionIntent {
|
|
15
16
|
const source = readEventSource(event);
|
|
16
17
|
const kind: SelectionActivationKind = isTouchActivation(source) ? 'touch' : fallbackKind;
|
|
17
18
|
const sourceModifiers = readInteractionModifiers(source);
|
|
18
19
|
const wrapperModifiers = readInteractionModifiers(event);
|
|
20
|
+
const nativeModifiers = readInteractionModifiers(nativeEvent);
|
|
19
21
|
const input: SelectionInteractionInput = {
|
|
20
22
|
kind,
|
|
21
23
|
modifiers: {
|
|
22
|
-
altKey:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
altKey:
|
|
25
|
+
sourceModifiers.altKey === true ||
|
|
26
|
+
wrapperModifiers.altKey === true ||
|
|
27
|
+
nativeModifiers.altKey === true,
|
|
28
|
+
ctrlKey:
|
|
29
|
+
sourceModifiers.ctrlKey === true ||
|
|
30
|
+
wrapperModifiers.ctrlKey === true ||
|
|
31
|
+
nativeModifiers.ctrlKey === true,
|
|
32
|
+
metaKey:
|
|
33
|
+
sourceModifiers.metaKey === true ||
|
|
34
|
+
wrapperModifiers.metaKey === true ||
|
|
35
|
+
nativeModifiers.metaKey === true,
|
|
36
|
+
shiftKey:
|
|
37
|
+
sourceModifiers.shiftKey === true ||
|
|
38
|
+
wrapperModifiers.shiftKey === true ||
|
|
39
|
+
nativeModifiers.shiftKey === true,
|
|
26
40
|
},
|
|
27
41
|
};
|
|
28
42
|
return resolveSelectionIntent(input);
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,20 @@ export {
|
|
|
14
14
|
AuthoringSelectionAdapter,
|
|
15
15
|
ThemeEditorAdapter,
|
|
16
16
|
} from './authoring';
|
|
17
|
+
export type {
|
|
18
|
+
ColorHueScaleProps,
|
|
19
|
+
ColorPickerProps,
|
|
20
|
+
ColorPickerSelection,
|
|
21
|
+
ColorPickerTab,
|
|
22
|
+
ColorPickerValue,
|
|
23
|
+
ColorToneDefinition,
|
|
24
|
+
ColorToneProps,
|
|
25
|
+
ColorToneSelection,
|
|
26
|
+
ColorToneTarget,
|
|
27
|
+
ColorWheelProps,
|
|
28
|
+
ColorWheelSelection,
|
|
29
|
+
} from './features/color/public';
|
|
30
|
+
export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
|
|
17
31
|
export type {
|
|
18
32
|
ReaderColorScheme,
|
|
19
33
|
ReaderDocumentFormat,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';
|
|
2
|
+
|
|
3
|
+
import type { ZoraBaseProps } from './base';
|
|
4
|
+
|
|
5
|
+
export type ColorPickerTab = 'wheel' | 'tone' | 'hue';
|
|
6
|
+
|
|
7
|
+
/** A consumer-owned OKLCH target from the published Templates tone catalog. */
|
|
8
|
+
export interface ColorToneTarget {
|
|
9
|
+
readonly lightness: number;
|
|
10
|
+
readonly chroma: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Structural boundary for a Templates tone-pair entry. ZORA intentionally owns
|
|
15
|
+
* neither the catalog nor its classifications.
|
|
16
|
+
*/
|
|
17
|
+
export interface ColorToneDefinition {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly accent: string;
|
|
20
|
+
readonly accentTarget: ColorToneTarget;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ColorWheelSelection {
|
|
24
|
+
readonly color: HexColor;
|
|
25
|
+
readonly harmony: ColorHarmony | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ColorToneSelection {
|
|
29
|
+
readonly toneId: string;
|
|
30
|
+
readonly colors: readonly HexColor[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The persistent, controlled state for every independently selectable picker mode. */
|
|
34
|
+
export interface ColorPickerValue {
|
|
35
|
+
readonly tab: ColorPickerTab;
|
|
36
|
+
readonly wheel: ColorWheelSelection;
|
|
37
|
+
readonly tone: ColorToneSelection | null;
|
|
38
|
+
readonly hue: HexColor;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A single mode-specific update emitted by the composed picker. */
|
|
42
|
+
export type ColorPickerSelection =
|
|
43
|
+
| { readonly mode: 'wheel'; readonly value: ColorWheelSelection }
|
|
44
|
+
| { readonly mode: 'tone'; readonly value: ColorToneSelection }
|
|
45
|
+
| { readonly mode: 'hue'; readonly value: HexColor };
|
|
46
|
+
|
|
47
|
+
export interface ColorWheelProps extends ZoraBaseProps {
|
|
48
|
+
readonly value: HexColor;
|
|
49
|
+
readonly harmony?: ColorHarmony | null;
|
|
50
|
+
readonly harmonies?: readonly ColorHarmony[];
|
|
51
|
+
readonly onChange: (selection: ColorWheelSelection) => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ColorToneProps extends ZoraBaseProps {
|
|
55
|
+
readonly tones: readonly ColorToneDefinition[];
|
|
56
|
+
readonly selectionMode?: 'single' | 'multiple';
|
|
57
|
+
readonly value: ColorToneSelection | null;
|
|
58
|
+
readonly onChange: (selection: ColorToneSelection) => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ColorHueScaleProps extends ZoraBaseProps {
|
|
62
|
+
readonly value: HexColor;
|
|
63
|
+
readonly onChange: (color: HexColor) => void;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ColorPickerProps extends ZoraBaseProps {
|
|
67
|
+
readonly tabs: readonly ColorPickerTab[];
|
|
68
|
+
readonly value: ColorPickerValue;
|
|
69
|
+
readonly onValueChange: (value: ColorPickerValue) => void;
|
|
70
|
+
readonly onSelectionChange?: (selection: ColorPickerSelection) => void;
|
|
71
|
+
readonly hideTabListWhenSingle?: boolean;
|
|
72
|
+
readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value'>;
|
|
73
|
+
readonly tone?: Omit<ColorToneProps, 'onChange' | 'value'>;
|
|
74
|
+
readonly hue?: Omit<ColorHueScaleProps, 'onChange' | 'value'>;
|
|
75
|
+
}
|
|
@@ -118,6 +118,21 @@ test('SSR-renders ordinary UI from its public web subpaths', async () => {
|
|
|
118
118
|
expect(markup).toContain('Continue');
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
+
/** Verifies that the color controls are available through their generated public web entrypoints. */
|
|
122
|
+
test('publishes the independent color controls through canonical web subpaths', async () => {
|
|
123
|
+
const [{ ColorPicker }, { ColorWheel }, { ColorTone }, { ColorHueScale }] = await Promise.all([
|
|
124
|
+
import('@ankhorage/zora/web/color-picker'),
|
|
125
|
+
import('@ankhorage/zora/web/color-wheel'),
|
|
126
|
+
import('@ankhorage/zora/web/color-tone'),
|
|
127
|
+
import('@ankhorage/zora/web/color-hue-scale'),
|
|
128
|
+
]);
|
|
129
|
+
|
|
130
|
+
expect(ColorPicker).toBeDefined();
|
|
131
|
+
expect(ColorWheel).toBeDefined();
|
|
132
|
+
expect(ColorTone).toBeDefined();
|
|
133
|
+
expect(ColorHueScale).toBeDefined();
|
|
134
|
+
});
|
|
135
|
+
|
|
121
136
|
/** Verifies that the authoring boundary delegates its portable controls to released Surface. */
|
|
122
137
|
test('publishes browser-safe authoring controls through the released Surface boundary', async () => {
|
|
123
138
|
const entrypoint = await Bun.file(join('src', 'authoring.ts')).text();
|
|
@@ -23600,18 +23600,19 @@ function resolveSelectionIntent(input) {
|
|
|
23600
23600
|
return input.modifiers?.metaKey === true || input.modifiers?.ctrlKey === true ? "toggle" : "replace";
|
|
23601
23601
|
}
|
|
23602
23602
|
// src/features/selection/application/resolveSelectionEventIntent.ts
|
|
23603
|
-
function resolveSelectionEventIntent(event, fallbackKind) {
|
|
23603
|
+
function resolveSelectionEventIntent(event, fallbackKind, nativeEvent = {}) {
|
|
23604
23604
|
const source = readEventSource(event);
|
|
23605
23605
|
const kind = isTouchActivation(source) ? "touch" : fallbackKind;
|
|
23606
23606
|
const sourceModifiers = readInteractionModifiers(source);
|
|
23607
23607
|
const wrapperModifiers = readInteractionModifiers(event);
|
|
23608
|
+
const nativeModifiers = readInteractionModifiers(nativeEvent);
|
|
23608
23609
|
const input = {
|
|
23609
23610
|
kind,
|
|
23610
23611
|
modifiers: {
|
|
23611
|
-
altKey: sourceModifiers.altKey === true || wrapperModifiers.altKey === true,
|
|
23612
|
-
ctrlKey: sourceModifiers.ctrlKey === true || wrapperModifiers.ctrlKey === true,
|
|
23613
|
-
metaKey: sourceModifiers.metaKey === true || wrapperModifiers.metaKey === true,
|
|
23614
|
-
shiftKey: sourceModifiers.shiftKey === true || wrapperModifiers.shiftKey === true
|
|
23612
|
+
altKey: sourceModifiers.altKey === true || wrapperModifiers.altKey === true || nativeModifiers.altKey === true,
|
|
23613
|
+
ctrlKey: sourceModifiers.ctrlKey === true || wrapperModifiers.ctrlKey === true || nativeModifiers.ctrlKey === true,
|
|
23614
|
+
metaKey: sourceModifiers.metaKey === true || wrapperModifiers.metaKey === true || nativeModifiers.metaKey === true,
|
|
23615
|
+
shiftKey: sourceModifiers.shiftKey === true || wrapperModifiers.shiftKey === true || nativeModifiers.shiftKey === true
|
|
23615
23616
|
}
|
|
23616
23617
|
};
|
|
23617
23618
|
return resolveSelectionIntent(input);
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
Icon3
|
|
4
|
-
} from "./Accordion-bm75sm6d.js";
|
|
5
2
|
import {
|
|
6
3
|
useTheme
|
|
7
|
-
} from "./Accordion-
|
|
8
|
-
import {
|
|
9
|
-
IconButton2
|
|
10
|
-
} from "./Accordion-dhnd347t.js";
|
|
11
|
-
import {
|
|
12
|
-
withZoraThemeScope
|
|
13
|
-
} from "./Accordion-w42y21pt.js";
|
|
14
|
-
import {
|
|
15
|
-
resolveIconSize
|
|
16
|
-
} from "./Accordion-961ncx4e.js";
|
|
4
|
+
} from "./Accordion-tpd1vvy9.js";
|
|
17
5
|
import {
|
|
18
6
|
resolveControlSize,
|
|
19
7
|
resolveFieldState,
|
|
@@ -21,9 +9,6 @@ import {
|
|
|
21
9
|
resolveInputColors,
|
|
22
10
|
resolveTextStyles
|
|
23
11
|
} from "./Accordion-6ec4gxv2.js";
|
|
24
|
-
import {
|
|
25
|
-
useZoraTheme2
|
|
26
|
-
} from "./Accordion-b36h9a7g.js";
|
|
27
12
|
import {
|
|
28
13
|
require_cjs
|
|
29
14
|
} from "./Accordion-xgpzh4wq.js";
|
|
@@ -87,7 +72,7 @@ function resolveTextInputHeights(controlSize, multiline, numberOfLines, lineHeig
|
|
|
87
72
|
|
|
88
73
|
// node_modules/@ankhorage/surface/src/features/form/text-input/adapters/inbound/TextInput.tsx
|
|
89
74
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
90
|
-
function
|
|
75
|
+
function TextInput3(props) {
|
|
91
76
|
const { theme } = useTheme();
|
|
92
77
|
const [focused, setFocused] = React.useState(false);
|
|
93
78
|
const {
|
|
@@ -148,49 +133,4 @@ function resolveAccessoryStyle(spacing, position) {
|
|
|
148
133
|
return position === "leading" ? { marginRight: spacing } : { marginLeft: spacing };
|
|
149
134
|
}
|
|
150
135
|
|
|
151
|
-
|
|
152
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
153
|
-
function TextInputInner({
|
|
154
|
-
themeId: _themeId,
|
|
155
|
-
mode: _mode,
|
|
156
|
-
size = "l",
|
|
157
|
-
leadingIcon,
|
|
158
|
-
trailingIcon,
|
|
159
|
-
trailingAction,
|
|
160
|
-
disabled,
|
|
161
|
-
readOnly,
|
|
162
|
-
interactionPolicy,
|
|
163
|
-
...props
|
|
164
|
-
}) {
|
|
165
|
-
const { theme } = useZoraTheme2();
|
|
166
|
-
const iconSize = resolveIconSize(size);
|
|
167
|
-
const iconColor = theme.semantics.content.muted;
|
|
168
|
-
return /* @__PURE__ */ jsx2(TextInput, {
|
|
169
|
-
...props,
|
|
170
|
-
disabled,
|
|
171
|
-
interactionPolicy,
|
|
172
|
-
leadingAccessory: leadingIcon ? /* @__PURE__ */ jsx2(Icon3, {
|
|
173
|
-
...leadingIcon,
|
|
174
|
-
color: iconColor,
|
|
175
|
-
size: iconSize
|
|
176
|
-
}) : undefined,
|
|
177
|
-
readOnly,
|
|
178
|
-
size,
|
|
179
|
-
trailingAccessory: trailingAction ? /* @__PURE__ */ jsx2(IconButton2, {
|
|
180
|
-
icon: trailingAction.icon,
|
|
181
|
-
interactionPolicy,
|
|
182
|
-
label: trailingAction.label,
|
|
183
|
-
disabled: disabled ?? readOnly,
|
|
184
|
-
variant: "ghost",
|
|
185
|
-
size: size === "l" ? "m" : size,
|
|
186
|
-
color: "neutral",
|
|
187
|
-
onPress: trailingAction.onPress
|
|
188
|
-
}) : trailingIcon ? /* @__PURE__ */ jsx2(Icon3, {
|
|
189
|
-
...trailingIcon,
|
|
190
|
-
color: iconColor,
|
|
191
|
-
size: iconSize
|
|
192
|
-
}) : undefined
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
var TextInput2 = withZoraThemeScope(TextInputInner);
|
|
196
|
-
export { TextInput2 };
|
|
136
|
+
export { TextInput3 };
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./Accordion-t0k1cjca.js";
|
|
5
5
|
import {
|
|
6
6
|
withZoraThemeScope
|
|
7
|
-
} from "./Accordion-
|
|
7
|
+
} from "./Accordion-mrhkw8n6.js";
|
|
8
8
|
import {
|
|
9
9
|
useZoraTheme2
|
|
10
|
-
} from "./Accordion-
|
|
10
|
+
} from "./Accordion-gysa24fk.js";
|
|
11
11
|
import {
|
|
12
12
|
require_cjs
|
|
13
13
|
} from "./Accordion-xgpzh4wq.js";
|