@ankhorage/zora 27.5.3 → 27.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/capabilities/index.js +13 -1
- package/dist/capabilities/index.js.map +5 -4
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts +5 -0
- package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -0
- package/dist/features/calendar/adapters/inbound/Calendar.js +126 -0
- package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -0
- package/dist/features/calendar/application/createCalendarMonth.d.ts +9 -0
- package/dist/features/calendar/application/createCalendarMonth.d.ts.map +1 -0
- package/dist/features/calendar/application/createCalendarMonth.js +25 -0
- package/dist/features/calendar/application/createCalendarMonth.js.map +1 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.d.ts +10 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.d.ts.map +1 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.js +23 -0
- package/dist/features/calendar/application/isCalendarDateDisabled.js.map +1 -0
- package/dist/features/calendar/calendarMeta.d.ts +10 -0
- package/dist/features/calendar/calendarMeta.d.ts.map +1 -0
- package/dist/features/calendar/calendarMeta.js +10 -0
- package/dist/features/calendar/calendarMeta.js.map +1 -0
- package/dist/features/calendar/public.d.ts +2 -0
- package/dist/features/calendar/public.d.ts.map +1 -1
- package/dist/features/calendar/public.js +1 -1
- package/dist/features/calendar/public.js.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +82 -23
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.d.ts +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.d.ts.map +1 -1
- package/dist/features/date-picker/composition/DatePickerContent.js +5 -104
- package/dist/features/date-picker/composition/DatePickerContent.js.map +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 +19 -0
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
- package/dist/features/grid-view/adapters/inbound/GridView.js +6 -5
- package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -1
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +2 -0
- package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -1
- package/dist/features/registry/componentMeta.d.ts.map +1 -1
- package/dist/features/registry/componentMeta.js +2 -0
- package/dist/features/registry/componentMeta.js.map +1 -1
- package/dist/features/timeline/adapters/inbound/Timeline.d.ts.map +1 -1
- package/dist/features/timeline/adapters/inbound/Timeline.js +17 -11
- package/dist/features/timeline/adapters/inbound/Timeline.js.map +1 -1
- package/dist/readerFree.d.ts +1 -0
- package/dist/readerFree.d.ts.map +1 -1
- package/dist/readerFree.js +1 -0
- package/dist/readerFree.js.map +1 -1
- package/dist/types/calendar.d.ts +24 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +2 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/data-table.d.ts +4 -0
- package/dist/types/data-table.d.ts.map +1 -1
- package/dist/types/data-table.js.map +1 -1
- package/dist/types/grid-view.d.ts +2 -0
- package/dist/types/grid-view.d.ts.map +1 -1
- package/dist/types/grid-view.js.map +1 -1
- package/dist/types/timeline.d.ts +3 -0
- package/dist/types/timeline.d.ts.map +1 -1
- package/dist/types/timeline.js.map +1 -1
- package/package.json +2 -2
- package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +115 -0
- package/src/features/calendar/adapters/inbound/Calendar.tsx +219 -0
- package/src/features/calendar/application/createCalendarMonth.test.ts +23 -0
- package/src/features/calendar/application/createCalendarMonth.ts +38 -0
- package/src/features/calendar/application/isCalendarDateDisabled.test.ts +49 -0
- package/src/features/calendar/application/isCalendarDateDisabled.ts +41 -0
- package/src/features/calendar/calendarMeta.ts +11 -0
- package/src/features/calendar/public.test.ts +14 -0
- package/src/features/calendar/public.ts +7 -0
- package/src/features/data-table/adapters/inbound/DataTable.test.tsx +242 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +162 -38
- package/src/features/date-picker/composition/DatePickerContent.tsx +8 -192
- package/src/features/date-picker/public.test.ts +2 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.test.ts +102 -3
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +25 -0
- package/src/features/grid-view/adapters/inbound/GridView.tsx +6 -4
- package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +2 -0
- package/src/features/registry/componentMeta.ts +2 -0
- package/src/features/timeline/adapters/inbound/Timeline.test.tsx +175 -0
- package/src/features/timeline/adapters/inbound/Timeline.tsx +47 -26
- package/src/readerFree.ts +7 -0
- package/src/types/calendar.ts +25 -0
- package/src/types/data-table.ts +4 -0
- package/src/types/grid-view.ts +2 -0
- package/src/types/timeline.ts +3 -0
- package/web-dist/chunks/{Accordion-k81eyekh.js → Accordion-0j4xzcwz.js} +2 -2
- package/web-dist/chunks/{Accordion-5f9e10c6.js → Accordion-252dr90x.js} +1 -1
- package/web-dist/chunks/{Accordion-0pryvztw.js → Accordion-260pyaxy.js} +1 -1
- package/web-dist/chunks/{Accordion-g9hn7fht.js → Accordion-4c7hqeg3.js} +1 -1
- package/web-dist/chunks/{Accordion-0z8nry94.js → Accordion-4kmh6s2k.js} +1 -1
- package/web-dist/chunks/{Accordion-g758dqfc.js → Accordion-5pbvgvqc.js} +1 -1
- package/web-dist/chunks/{Accordion-jp5xt2kz.js → Accordion-5z8pbn4z.js} +1 -1
- package/web-dist/chunks/{Accordion-qzx53csd.js → Accordion-6jsea4e0.js} +4 -4
- package/web-dist/chunks/{Accordion-yd025qec.js → Accordion-7788ybcs.js} +2 -2
- package/web-dist/chunks/{Accordion-ppksc4jh.js → Accordion-7mnan4q4.js} +4 -4
- package/web-dist/chunks/{Accordion-0pm8dvcy.js → Accordion-8j7t77tf.js} +2 -2
- package/web-dist/chunks/{Accordion-6tesp7jr.js → Accordion-c44m1q0m.js} +1 -1
- package/web-dist/chunks/{Accordion-a6h4ff7g.js → Accordion-f2n2zz1x.js} +2 -2
- package/web-dist/chunks/{Accordion-ep9xpmbw.js → Accordion-fbehwpr1.js} +3 -3
- package/web-dist/chunks/{Accordion-j09h3pg1.js → Accordion-hf4nfkn0.js} +7 -7
- package/web-dist/chunks/{Accordion-xr81ntxh.js → Accordion-hh48jjhk.js} +4 -4
- package/web-dist/chunks/{Accordion-3qz6s2z9.js → Accordion-j6bs1yfn.js} +1 -1
- package/web-dist/chunks/{Accordion-dnpfe329.js → Accordion-jh94mg56.js} +3 -3
- package/web-dist/chunks/{Accordion-6c2ykyad.js → Accordion-jx9tc6p1.js} +2 -2
- package/web-dist/chunks/{Accordion-8xgdw6ry.js → Accordion-kcca65d8.js} +1 -1
- package/web-dist/chunks/{Accordion-g009pehq.js → Accordion-m3xb7z7j.js} +3 -3
- package/web-dist/chunks/{Accordion-eqkmzs33.js → Accordion-mpebzjby.js} +1 -1
- package/web-dist/chunks/{Accordion-n29svm40.js → Accordion-ms1y70gq.js} +1 -1
- package/web-dist/chunks/{Accordion-t0k1cjca.js → Accordion-neg1cgeh.js} +7 -5
- package/web-dist/chunks/{Accordion-wfrt39d2.js → Accordion-nnhznqgf.js} +1 -1
- package/web-dist/chunks/{Accordion-cqdfhyr9.js → Accordion-np16p9mh.js} +1 -1
- package/web-dist/chunks/{Accordion-zjygy6n2.js → Accordion-p2f0e4pn.js} +3 -3
- package/web-dist/chunks/{Accordion-q1vqpaw6.js → Accordion-p7mxkxhs.js} +4 -4
- package/web-dist/chunks/{Accordion-d6f4vr6s.js → Accordion-r6zvzrkd.js} +1 -1
- package/web-dist/chunks/Accordion-r86ce0wj.js +237 -0
- package/web-dist/chunks/{Accordion-b8659jt9.js → Accordion-rwc34cn2.js} +1 -1
- package/web-dist/chunks/{Accordion-rcff84ws.js → Accordion-s9nbkzky.js} +1 -1
- package/web-dist/chunks/{Accordion-01s50nga.js → Accordion-sxzts6bj.js} +1 -1
- package/web-dist/chunks/{Accordion-36nt5xmp.js → Accordion-t2cvrn0r.js} +4 -4
- package/web-dist/chunks/{Accordion-y5kdx80m.js → Accordion-tnt1txfq.js} +3 -3
- package/web-dist/chunks/{Accordion-bj7hv2dq.js → Accordion-vq8zrnwh.js} +1 -1
- package/web-dist/chunks/{Accordion-hh6jrz1e.js → Accordion-w0prbwy0.js} +4 -4
- package/web-dist/chunks/{Accordion-zqzqg9yc.js → Accordion-wvghkwxx.js} +6 -6
- package/web-dist/chunks/{Accordion-cp82h5jx.js → Accordion-wx0jp5cn.js} +4 -4
- package/web-dist/chunks/{Accordion-bwp6m0zd.js → Accordion-yb4as6wc.js} +2 -2
- package/web-dist/chunks/{Accordion-e9c80kn7.js → Accordion-yrzm02g2.js} +2 -2
- package/web-dist/components/accordion/Accordion.js +3 -3
- package/web-dist/components/accordion-item/AccordionItem.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +8 -8
- package/web-dist/components/app-header/AppHeader.js +8 -8
- package/web-dist/components/app-shell/AppShell.js +2 -2
- package/web-dist/components/auth-screen/AuthScreen.js +12 -12
- package/web-dist/components/avatar/Avatar.js +3 -3
- package/web-dist/components/avatar-group/AvatarGroup.js +3 -3
- package/web-dist/components/badge/Badge.js +2 -2
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -11
- package/web-dist/components/bottom-sheet/BottomSheet.js +3 -3
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +3 -3
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +3 -3
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +3 -3
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +3 -3
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +3 -3
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +5 -5
- package/web-dist/components/button/Button.js +5 -5
- package/web-dist/components/button-group/ButtonGroup.js +5 -5
- package/web-dist/components/calendar/Calendar.d.ts +8 -0
- package/web-dist/components/calendar/Calendar.dependency-0.d.ts +27 -0
- package/web-dist/components/calendar/Calendar.dependency-1.d.ts +3 -0
- package/web-dist/components/calendar/Calendar.js +25 -0
- package/web-dist/components/calendar/Calendar.types-0.d.ts +27 -0
- package/web-dist/components/calendar/Calendar.types-1.d.ts +146 -0
- package/web-dist/components/calendar/index.d.ts +2 -0
- package/web-dist/components/calendar/index.js +2 -0
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -11
- package/web-dist/components/card/Card.js +10 -10
- package/web-dist/components/chat-list-item/ChatListItem.js +6 -6
- package/web-dist/components/checkbox/Checkbox.js +4 -4
- package/web-dist/components/checkbox-group/CheckboxGroup.js +4 -4
- package/web-dist/components/chess-board/ChessBoard.js +2 -2
- package/web-dist/components/chip/Chip.js +4 -4
- package/web-dist/components/chip-group/ChipGroup.js +4 -4
- package/web-dist/components/collection-editor/CollectionEditor.js +10 -10
- package/web-dist/components/color-hue-scale/ColorHueScale.js +6 -6
- package/web-dist/components/color-picker/ColorPicker.js +6 -6
- package/web-dist/components/color-tone/ColorTone.js +6 -6
- package/web-dist/components/color-wheel/ColorWheel.js +6 -6
- package/web-dist/components/content-rail/ContentRail.js +5 -5
- package/web-dist/components/data-table/DataTable.d.ts +1 -1
- package/web-dist/components/data-table/DataTable.js +149 -64
- package/web-dist/components/data-table/DataTable.types-0.d.ts +4 -0
- package/web-dist/components/date-picker/DatePicker.js +19 -160
- package/web-dist/components/dialog/Dialog.js +4 -4
- package/web-dist/components/divider/Divider.js +2 -2
- package/web-dist/components/empty-state/EmptyState.js +11 -11
- package/web-dist/components/explorer/Explorer.js +5 -5
- package/web-dist/components/field/Field.js +4 -4
- package/web-dist/components/file-explorer/FileExplorer.js +5 -5
- package/web-dist/components/flat-list/FlatList.js +5 -5
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +12 -12
- package/web-dist/components/form/Form.js +8 -8
- package/web-dist/components/form-actions/FormActions.js +8 -8
- package/web-dist/components/form-error/FormError.js +8 -8
- package/web-dist/components/game/Game.js +3 -3
- package/web-dist/components/game-entity/GameEntity.js +3 -3
- package/web-dist/components/game-field/GameField.js +3 -3
- package/web-dist/components/game-input-zone/GameInputZone.js +3 -3
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +3 -3
- package/web-dist/components/game-overlay/GameOverlay.js +3 -3
- package/web-dist/components/gradient/Gradient.js +3 -3
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +3 -3
- package/web-dist/components/graph-view/GraphView.js +13 -0
- package/web-dist/components/grid/Grid.js +2 -2
- package/web-dist/components/grid-view/GridView.d.ts +1 -1
- package/web-dist/components/grid-view/GridView.js +1 -1
- package/web-dist/components/grid-view/GridView.types-0.d.ts +2 -0
- package/web-dist/components/hero/Hero.js +10 -10
- package/web-dist/components/icon-button/IconButton.js +5 -5
- package/web-dist/components/image/Image.js +3 -3
- package/web-dist/components/list/List.js +5 -5
- package/web-dist/components/list-item/ListItem.js +5 -5
- package/web-dist/components/list-section/ListSection.js +5 -5
- package/web-dist/components/matrix-grid/MatrixGrid.js +1 -1
- package/web-dist/components/media-card/MediaCard.js +10 -10
- package/web-dist/components/media-explorer/MediaExplorer.js +5 -5
- package/web-dist/components/message-bubble/MessageBubble.js +6 -6
- package/web-dist/components/metric-card/MetricCard.js +10 -10
- package/web-dist/components/missing-element/MissingElement.js +3 -3
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +12 -12
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +12 -12
- package/web-dist/components/opening-book/OpeningBook.js +2 -2
- package/web-dist/components/otp-form/OtpForm.js +12 -12
- package/web-dist/components/pagination/Pagination.js +5 -5
- package/web-dist/components/palette-item/PaletteItem.js +10 -10
- package/web-dist/components/popover-menu/PopoverMenu.js +4 -4
- package/web-dist/components/post-card/PostCard.js +10 -10
- package/web-dist/components/product-card/ProductCard.js +10 -10
- package/web-dist/components/progress/Progress.js +3 -3
- package/web-dist/components/progress-ring/ProgressRing.js +3 -3
- package/web-dist/components/radio/Radio.js +4 -4
- package/web-dist/components/radio-group/RadioGroup.js +4 -4
- package/web-dist/components/rating/Rating.js +2 -2
- package/web-dist/components/reader/Reader.js +11 -11
- package/web-dist/components/scan-overlay/ScanOverlay.js +11 -11
- package/web-dist/components/screen/Screen.js +2 -2
- package/web-dist/components/screen-section/ScreenSection.js +3 -3
- package/web-dist/components/scroll-view/ScrollView.js +2 -2
- package/web-dist/components/search-input/SearchInput.js +6 -6
- package/web-dist/components/section-header/SectionHeader.js +3 -3
- package/web-dist/components/section-list/SectionList.js +5 -5
- package/web-dist/components/select/Select.js +8 -8
- package/web-dist/components/sign-in-form/SignInForm.js +12 -12
- package/web-dist/components/sign-up-form/SignUpForm.js +12 -12
- package/web-dist/components/skeleton/Skeleton.js +13 -13
- package/web-dist/components/skeleton-card/SkeletonCard.js +13 -13
- package/web-dist/components/skeleton-list/SkeletonList.js +13 -13
- package/web-dist/components/skeleton-text/SkeletonText.js +13 -13
- package/web-dist/components/spatial-grid/SpatialGrid.js +1 -1
- package/web-dist/components/surface/Surface.js +3 -3
- package/web-dist/components/switch/Switch.js +2 -2
- package/web-dist/components/tab/Tab.js +2 -2
- package/web-dist/components/tab-list/TabList.js +2 -2
- package/web-dist/components/tab-panel/TabPanel.js +2 -2
- package/web-dist/components/tabs/Tabs.js +2 -2
- package/web-dist/components/text-input/TextInput.js +6 -6
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +5 -5
- package/web-dist/components/tile-grid/TileGrid.js +1 -1
- package/web-dist/components/time-grid/TimeGrid.js +1 -1
- package/web-dist/components/time-picker/TimePicker.js +9 -9
- package/web-dist/components/timeline/Timeline.dependency-2.d.ts +8 -2
- package/web-dist/components/timeline/Timeline.dependency-3.d.ts +23 -0
- package/web-dist/components/timeline/Timeline.dependency-4.d.ts +3 -0
- package/web-dist/components/timeline/Timeline.js +30 -11
- package/web-dist/components/timeline/Timeline.types-0.d.ts +5 -1
- package/web-dist/components/toast/Toast.js +4 -4
- package/web-dist/components/toast-provider/ToastProvider.js +4 -4
- package/web-dist/components/toolbar/Toolbar.js +10 -10
- package/web-dist/components/tree-item/TreeItem.js +7 -7
- package/web-dist/components/uploader/Uploader.js +14 -14
- package/web-dist/components/view/View.js +2 -2
- package/web-dist/manifest.json +720 -673
- package/web-dist/runtime/ZoraProvider.js +3 -3
- /package/web-dist/chunks/{Accordion-kpk964z0.js → Accordion-a8k3cvj0.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../../../../../src/features/data-table/adapters/inbound/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAW1D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAA0B,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC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CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAG,CAAC;IAC5E,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,EAAG,CAAC;IAC1E,CAAC;IAED,MAAM,UAAU,GAAyB;QACvC,GAAG,KAAK;QACR,OAAO;QACP,gBAAgB;QAChB,UAAU;QACV,iBAAiB;QACjB,OAAO;QACP,WAAW;QACX,IAAI;QACJ,MAAM;KACP,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACnB;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAG,CAAC,CACnF;QAAA,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,EACnC;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import type { InteractionPolicy } from '@ankhorage/surface';\nimport { Show } from '@ankhorage/surface';\nimport React from 'react';\nimport { ScrollView, type ViewStyle } from 'react-native';\n\nimport type {\n DataTableCellContext,\n DataTableColumn,\n DataTableColumnAlign,\n DataTableDensity,\n DataTableProps,\n DataTableRowAction,\n DataTableSortDirection,\n} from '../../../../types/data-table';\nimport { Button } from '../../../button/public';\nimport { IconButton } from '../../../button/public';\nimport { Card } from '../../../card/public';\nimport { EmptyState } from '../../../empty-state/public';\nimport { View } from '../../../layout/public';\nimport { PopoverMenu, type PopoverMenuAction } from '../../../popover-menu/public';\nimport { SkeletonList } from '../../../skeleton/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { Text, type TextAlign } from '../../../typography/public';\nimport { resolveDataTableRowKey } from '../../utils/resolveDataTableRowKey';\n/***\n * Displays structured tabular data with responsive desktop/mobile layouts.\n */\nexport const DataTable = withZoraThemeScope(DataTableInner);\n\nfunction resolveTextAlign(align: DataTableColumnAlign | undefined): TextAlign {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'right';\n case 'start':\n default:\n return 'left';\n }\n}\n\nfunction resolveCellJustify(align: DataTableColumnAlign | undefined): ViewStyle['alignItems'] {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'flex-end';\n case 'start':\n default:\n return 'flex-start';\n }\n}\n\nfunction resolveCellStyle<TRow extends object>(column: DataTableColumn<TRow>): ViewStyle {\n return {\n alignItems: resolveCellJustify(column.align),\n flexGrow: column.width === undefined ? 1 : 0,\n flexShrink: 0,\n minWidth: column.minWidth ?? 140,\n width: column.width,\n };\n}\n\nfunction resolveRowPadding(density: DataTableDensity) {\n return density === 'compact'\n ? { px: 'm' as const, py: 's' as const }\n : { px: 'm' as const, py: 'm' as const };\n}\n\nfunction resolveAccessorValue<TRow extends object>(row: TRow, column: DataTableColumn<TRow>) {\n if (column.accessor === undefined) {\n return undefined;\n }\n\n return row[column.accessor];\n}\n\nfunction renderDefaultCell(value: unknown): React.ReactNode {\n if (value === null || value === undefined) {\n return '—';\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n\n return '—';\n}\n\nfunction createCellContext<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n): DataTableCellContext<TRow> {\n return {\n column,\n row,\n rowIndex,\n value: resolveAccessorValue(row, column),\n };\n}\n\nfunction renderCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n const context = createCellContext(column, row, rowIndex);\n return column.renderCell ? column.renderCell(context) : renderDefaultCell(context.value);\n}\n\nfunction renderTableCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n if (column.renderCell) {\n return column.renderCell(createCellContext(column, row, rowIndex));\n }\n\n return (\n <Text align={resolveTextAlign(column.align)} variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n );\n}\n\nfunction resolveNextSortDirection(\n current: DataTableSortDirection | undefined,\n): DataTableSortDirection {\n return current === 'asc' ? 'desc' : 'asc';\n}\n\n/*** Maps row-scoped DataTable actions into the shared PopoverMenu action contract. */\nfunction mapRowActions<TRow extends object>(\n row: TRow,\n actions: readonly DataTableRowAction<TRow>[],\n): readonly PopoverMenuAction[] {\n return actions.map((action) => ({\n description: action.description,\n disabled: action.disabled,\n icon: action.icon,\n id: action.id,\n intent: action.intent,\n onPress: action.onPress ? () => action.onPress?.(row) : undefined,\n title: action.title,\n }));\n}\n\n/*** Renders the row action trigger and anchored PopoverMenu when actions exist. */\nfunction renderRowActions<TRow extends object>({\n row,\n rowIndex,\n rowActions,\n testID,\n interactionPolicy,\n}: {\n row: TRow;\n rowIndex: number;\n rowActions: DataTableProps<TRow>['rowActions'];\n testID?: string;\n interactionPolicy?: InteractionPolicy;\n}): React.ReactNode {\n const actions = rowActions?.(row, rowIndex) ?? [];\n\n if (actions.length === 0) {\n return null;\n }\n\n return (\n <PopoverMenu\n actions={mapRowActions(row, actions)}\n interactionPolicy={interactionPolicy}\n testID={testID ? `${testID}-row-actions-${rowIndex}` : undefined}\n trigger={({ toggle }) => (\n <IconButton\n icon={{ name: 'ellipsis-horizontal' }}\n interactionPolicy={interactionPolicy}\n label=\"Row actions\"\n onPress={toggle}\n size=\"s\"\n variant=\"ghost\"\n />\n )}\n />\n );\n}\n\nfunction DataTableHeader<TRow extends object>({\n columns,\n sort,\n onSortChange,\n density,\n interactionPolicy,\n}: Pick<DataTableProps<TRow>, 'columns' | 'density' | 'onSortChange' | 'sort'> & {\n interactionPolicy?: InteractionPolicy;\n}) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n const passive = interactionPolicy === 'passive';\n\n return (\n <View bg=\"subtle\" borderColor=\"border\" borderWidth={1} radius=\"m\">\n <View direction=\"row\" align=\"center\">\n {columns.map((column) => {\n const currentDirection = sort?.columnId === column.id ? sort.direction : undefined;\n const sortable = Boolean(column.sortable && onSortChange);\n const directionLabel =\n currentDirection === undefined ? '' : currentDirection === 'asc' ? ' ↑' : ' ↓';\n\n return (\n <View key={column.id} px={padding.px} py={padding.py} style={resolveCellStyle(column)}>\n {sortable ? (\n <Button\n color=\"primary\"\n interactionPolicy={interactionPolicy}\n onPress={() => {\n if (passive) return;\n\n onSortChange?.({\n columnId: column.id,\n direction: resolveNextSortDirection(currentDirection),\n });\n }}\n size=\"s\"\n variant=\"ghost\"\n >\n {column.header}\n {directionLabel}\n </Button>\n ) : (\n <Text\n align={resolveTextAlign(column.align)}\n emphasis=\"muted\"\n variant=\"caption\"\n weight=\"semiBold\"\n >\n {column.header}\n </Text>\n )}\n </View>\n );\n })}\n <View px={padding.px} py={padding.py} style={{ minWidth: 56, width: 56 }}>\n <Text align=\"right\" emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n Actions\n </Text>\n </View>\n </View>\n </View>\n );\n}\n\nfunction DataTableDesktop<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n sort,\n onSortChange,\n density,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n\n return (\n <ScrollView horizontal showsHorizontalScrollIndicator={false}>\n <View minWidth={720} style={{ width: '100%' }}>\n <View gap=\"xs\">\n <DataTableHeader\n columns={columns}\n density={density}\n interactionPolicy={interactionPolicy}\n onSortChange={onSortChange}\n sort={sort}\n />\n <View gap=\"xs\">\n {rows.map((row, rowIndex) => (\n <View\n bg=\"surface\"\n borderColor=\"border\"\n borderWidth={1}\n key={resolveDataTableRowKey(row, rowIndex, rowKey, rowId)}\n radius=\"m\"\n testID={testID ? `${testID}-row-${rowIndex}` : undefined}\n >\n <View direction=\"row\" align=\"center\">\n {columns.map((column) => (\n <View\n key={column.id}\n px={padding.px}\n py={padding.py}\n style={resolveCellStyle(column)}\n >\n {renderTableCell(column, row, rowIndex)}\n </View>\n ))}\n <View\n px={padding.px}\n py={padding.py}\n style={{ alignItems: 'flex-end', minWidth: 56, width: 56 }}\n >\n {renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy })}\n </View>\n </View>\n </View>\n ))}\n </View>\n </View>\n </View>\n </ScrollView>\n );\n}\n\nfunction DataTableMobile<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const [primaryColumn, ...detailColumns] = columns;\n\n return (\n <View gap=\"s\">\n {rows.map((row, rowIndex) => {\n const title = primaryColumn\n ? renderCell(primaryColumn, row, rowIndex)\n : `Row ${rowIndex + 1}`;\n const actions = renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy });\n\n return (\n <Card\n actions={actions}\n compact\n interactionPolicy={interactionPolicy}\n key={resolveDataTableRowKey(row, rowIndex, rowKey, rowId)}\n testID={testID ? `${testID}-card-${rowIndex}` : undefined}\n title={title}\n >\n <View gap=\"s\">\n {detailColumns.map((column) => (\n <View gap=\"xxs\" key={column.id}>\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {column.header}\n </Text>\n {column.renderCell ? (\n renderCell(column, row, rowIndex)\n ) : (\n <Text variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n )}\n </View>\n ))}\n </View>\n </Card>\n );\n })}\n </View>\n );\n}\n\nfunction DataTableInner<TRow extends object>({\n themeId: _themeId,\n mode: _mode,\n rows,\n loading = false,\n loadingRows = 5,\n emptyTitle = 'No data',\n emptyDescription = 'There are no rows to display.',\n testID,\n density = 'comfortable',\n interactionPolicy,\n ...props\n}: DataTableProps<TRow>) {\n if (loading) {\n return <SkeletonList rows={loadingRows} variant=\"card\" testID={testID} />;\n }\n\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} />;\n }\n\n const tableProps: DataTableProps<TRow> = {\n ...props,\n density,\n emptyDescription,\n emptyTitle,\n interactionPolicy,\n loading,\n loadingRows,\n rows,\n testID,\n };\n\n return (\n <View testID={testID}>\n <Show when={{ base: false, md: true }} fallback={<DataTableMobile {...tableProps} />}>\n <DataTableDesktop {...tableProps} />\n </Show>\n </View>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../../../../../src/features/data-table/adapters/inbound/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAW1D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAA0B,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,IAAI,EAAkB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAA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C;AAED,SAAS,cAAc,CAAsB,EAC3C,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,EACJ,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,SAAS,EACtB,gBAAgB,GAAG,+BAA+B,EAClD,MAAM,EACN,OAAO,GAAG,aAAa,EACvB,iBAAiB,EACjB,GAAG,KAAK,EACa;IACrB,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAG,CAAC;IAC5E,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,EAAG,CAAC;IAC1E,CAAC;IAED,MAAM,UAAU,GAAyB;QACvC,GAAG,KAAK;QACR,OAAO;QACP,gBAAgB;QAChB,UAAU;QACV,iBAAiB;QACjB,OAAO;QACP,WAAW;QACX,IAAI;QACJ,MAAM;KACP,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CACnB;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAG,CAAC,CACnF;QAAA,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,EACnC;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import type { InteractionPolicy } from '@ankhorage/surface';\nimport { Show } from '@ankhorage/surface';\nimport React from 'react';\nimport { ScrollView, type ViewStyle } from 'react-native';\n\nimport type {\n DataTableCellContext,\n DataTableColumn,\n DataTableColumnAlign,\n DataTableDensity,\n DataTableProps,\n DataTableRowAction,\n DataTableSortDirection,\n} from '../../../../types/data-table';\nimport { Button } from '../../../button/public';\nimport { IconButton } from '../../../button/public';\nimport { Card } from '../../../card/public';\nimport { EmptyState } from '../../../empty-state/public';\nimport { Checkbox } from '../../../form/checkbox/public';\nimport { View } from '../../../layout/public';\nimport { PopoverMenu, type PopoverMenuAction } from '../../../popover-menu/public';\nimport { SkeletonList } from '../../../skeleton/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { Text, type TextAlign } from '../../../typography/public';\nimport { resolveDataTableRowKey } from '../../utils/resolveDataTableRowKey';\n/***\n * Displays structured tabular data with responsive columns and optional controlled row selection.\n */\nexport const DataTable = withZoraThemeScope(DataTableInner);\n\nfunction resolveTextAlign(align: DataTableColumnAlign | undefined): TextAlign {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'right';\n case 'start':\n default:\n return 'left';\n }\n}\n\nfunction resolveCellJustify(align: DataTableColumnAlign | undefined): ViewStyle['alignItems'] {\n switch (align) {\n case 'center':\n return 'center';\n case 'end':\n return 'flex-end';\n case 'start':\n default:\n return 'flex-start';\n }\n}\n\nfunction resolveCellStyle<TRow extends object>(column: DataTableColumn<TRow>): ViewStyle {\n return {\n alignItems: resolveCellJustify(column.align),\n flexGrow: column.width === undefined ? 1 : 0,\n flexShrink: column.width === undefined && column.minWidth === undefined ? 1 : 0,\n minWidth: column.minWidth,\n width: column.width,\n };\n}\n\n/*** Resolves the compact, fixed width reserved for the optional selection control. */\nfunction resolveSelectionColumnStyle(): ViewStyle {\n return { alignItems: 'center', flexShrink: 0, width: 40 };\n}\n\nfunction resolveRowPadding(density: DataTableDensity) {\n return density === 'compact'\n ? { px: 'm' as const, py: 's' as const }\n : { px: 'm' as const, py: 'm' as const };\n}\n\nfunction resolveAccessorValue<TRow extends object>(row: TRow, column: DataTableColumn<TRow>) {\n if (column.accessor === undefined) {\n return undefined;\n }\n\n return row[column.accessor];\n}\n\nfunction renderDefaultCell(value: unknown): React.ReactNode {\n if (value === null || value === undefined) {\n return '—';\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return String(value);\n }\n\n if (typeof value === 'bigint') {\n return value.toString();\n }\n\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n\n return '—';\n}\n\nfunction createCellContext<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n): DataTableCellContext<TRow> {\n return {\n column,\n row,\n rowIndex,\n value: resolveAccessorValue(row, column),\n };\n}\n\nfunction renderCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n const context = createCellContext(column, row, rowIndex);\n return column.renderCell ? column.renderCell(context) : renderDefaultCell(context.value);\n}\n\nfunction renderTableCell<TRow extends object>(\n column: DataTableColumn<TRow>,\n row: TRow,\n rowIndex: number,\n) {\n if (column.renderCell) {\n return column.renderCell(createCellContext(column, row, rowIndex));\n }\n\n return (\n <Text align={resolveTextAlign(column.align)} variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n );\n}\n\nfunction resolveNextSortDirection(\n current: DataTableSortDirection | undefined,\n): DataTableSortDirection {\n return current === 'asc' ? 'desc' : 'asc';\n}\n\n/*** Applies a single row checkbox change to controlled DataTable selection. */\nfunction resolveNextSelectedRowIds(\n selectedRowIds: readonly string[],\n rowId: string,\n selected: boolean,\n): readonly string[] {\n return selected\n ? [...new Set([...selectedRowIds, rowId])]\n : selectedRowIds.filter((selectedRowId) => selectedRowId !== rowId);\n}\n\n/*** Applies the header checkbox change to the currently visible DataTable rows. */\nfunction resolveNextVisibleSelection(\n selectedRowIds: readonly string[],\n visibleRowIds: readonly string[],\n selected: boolean,\n): readonly string[] {\n const visibleRowIdSet = new Set(visibleRowIds);\n return selected\n ? [...new Set([...selectedRowIds, ...visibleRowIds])]\n : selectedRowIds.filter((selectedRowId) => !visibleRowIdSet.has(selectedRowId));\n}\n\n/*** Maps row-scoped DataTable actions into the shared PopoverMenu action contract. */\nfunction mapRowActions<TRow extends object>(\n row: TRow,\n actions: readonly DataTableRowAction<TRow>[],\n): readonly PopoverMenuAction[] {\n return actions.map((action) => ({\n description: action.description,\n disabled: action.disabled,\n icon: action.icon,\n id: action.id,\n intent: action.intent,\n onPress: action.onPress ? () => action.onPress?.(row) : undefined,\n title: action.title,\n }));\n}\n\n/*** Renders the row action trigger and anchored PopoverMenu when actions exist. */\nfunction renderRowActions<TRow extends object>({\n row,\n rowIndex,\n rowActions,\n testID,\n interactionPolicy,\n}: {\n row: TRow;\n rowIndex: number;\n rowActions: DataTableProps<TRow>['rowActions'];\n testID?: string;\n interactionPolicy?: InteractionPolicy;\n}): React.ReactNode {\n const actions = rowActions?.(row, rowIndex) ?? [];\n\n if (actions.length === 0) {\n return null;\n }\n\n return (\n <PopoverMenu\n actions={mapRowActions(row, actions)}\n interactionPolicy={interactionPolicy}\n testID={testID ? `${testID}-row-actions-${rowIndex}` : undefined}\n trigger={({ toggle }) => (\n <IconButton\n icon={{ name: 'ellipsis-horizontal' }}\n interactionPolicy={interactionPolicy}\n label=\"Row actions\"\n onPress={toggle}\n size=\"s\"\n variant=\"ghost\"\n />\n )}\n />\n );\n}\n\nfunction DataTableHeader<TRow extends object>({\n columns,\n sort,\n onSortChange,\n density,\n interactionPolicy,\n selection,\n hasRowActions,\n}: Pick<DataTableProps<TRow>, 'columns' | 'density' | 'onSortChange' | 'sort'> & {\n interactionPolicy?: InteractionPolicy;\n selection?: {\n allVisibleSelected: boolean;\n disabled: boolean;\n onAllVisibleSelectedChange: (selected: boolean) => void;\n };\n hasRowActions: boolean;\n}) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n const passive = interactionPolicy === 'passive';\n\n return (\n <View bg=\"subtle\" borderColor=\"border\" borderWidth={1} radius=\"m\">\n <View direction=\"row\" align=\"center\">\n {selection ? (\n <View px={padding.px} py={padding.py} style={resolveSelectionColumnStyle()}>\n <Checkbox\n accessibilityLabel=\"Select all visible rows\"\n checked={selection.allVisibleSelected}\n disabled={selection.disabled}\n interactionPolicy={interactionPolicy}\n onCheckedChange={selection.onAllVisibleSelectedChange}\n />\n </View>\n ) : null}\n {columns.map((column) => {\n const currentDirection = sort?.columnId === column.id ? sort.direction : undefined;\n const sortable = Boolean(column.sortable && onSortChange);\n const directionLabel =\n currentDirection === undefined ? '' : currentDirection === 'asc' ? ' ↑' : ' ↓';\n\n return (\n <View key={column.id} px={padding.px} py={padding.py} style={resolveCellStyle(column)}>\n {sortable ? (\n <Button\n color=\"primary\"\n interactionPolicy={interactionPolicy}\n onPress={() => {\n if (passive) return;\n\n onSortChange?.({\n columnId: column.id,\n direction: resolveNextSortDirection(currentDirection),\n });\n }}\n size=\"s\"\n variant=\"ghost\"\n >\n {column.header}\n {directionLabel}\n </Button>\n ) : (\n <Text\n align={resolveTextAlign(column.align)}\n emphasis=\"muted\"\n variant=\"caption\"\n weight=\"semiBold\"\n >\n {column.header}\n </Text>\n )}\n </View>\n );\n })}\n {hasRowActions ? (\n <View px={padding.px} py={padding.py} style={{ minWidth: 56, width: 56 }}>\n <Text align=\"right\" emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n Actions\n </Text>\n </View>\n ) : null}\n </View>\n </View>\n );\n}\n\nfunction DataTableDesktop<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n selectedRowIds,\n onSelectedRowIdsChange,\n sort,\n onSortChange,\n density,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const padding = resolveRowPadding(density ?? 'comfortable');\n const rowIds = rows.map((row, rowIndex) => resolveDataTableRowKey(row, rowIndex, rowKey, rowId));\n const controlledSelectedRowIds = selectedRowIds ?? [];\n const selectedRowIdSet = new Set(controlledSelectedRowIds);\n const selectionEnabled = selectedRowIds !== undefined;\n const selectionDisabled = interactionPolicy === 'passive' || onSelectedRowIdsChange === undefined;\n const hasRowActions = rows.some((row, rowIndex) => (rowActions?.(row, rowIndex).length ?? 0) > 0);\n const selection = selectionEnabled\n ? {\n allVisibleSelected: rowIds.every((currentRowId) => selectedRowIdSet.has(currentRowId)),\n disabled: selectionDisabled,\n onAllVisibleSelectedChange: (selected: boolean) => {\n if (selectionDisabled) return;\n onSelectedRowIdsChange(\n resolveNextVisibleSelection(controlledSelectedRowIds, rowIds, selected),\n );\n },\n }\n : undefined;\n\n return (\n <ScrollView horizontal showsHorizontalScrollIndicator={false}>\n <View style={{ width: '100%' }}>\n <View gap=\"xs\">\n <DataTableHeader\n columns={columns}\n density={density}\n hasRowActions={hasRowActions}\n interactionPolicy={interactionPolicy}\n onSortChange={onSortChange}\n selection={selection}\n sort={sort}\n />\n <View gap=\"xs\">\n {rows.map((row, rowIndex) => {\n const currentRowId = resolveDataTableRowKey(row, rowIndex, rowKey, rowId);\n const selected = selectedRowIdSet.has(currentRowId);\n\n return (\n <View\n bg=\"surface\"\n borderColor=\"border\"\n borderWidth={1}\n key={currentRowId}\n radius=\"m\"\n testID={testID ? `${testID}-row-${rowIndex}` : undefined}\n >\n <View direction=\"row\" align=\"center\">\n {selectionEnabled ? (\n <View px={padding.px} py={padding.py} style={resolveSelectionColumnStyle()}>\n <Checkbox\n accessibilityLabel={`Select row ${currentRowId}`}\n checked={selected}\n disabled={selectionDisabled}\n interactionPolicy={interactionPolicy}\n onCheckedChange={(nextSelected) => {\n if (selectionDisabled) return;\n onSelectedRowIdsChange(\n resolveNextSelectedRowIds(\n controlledSelectedRowIds,\n currentRowId,\n nextSelected,\n ),\n );\n }}\n />\n </View>\n ) : null}\n {columns.map((column) => (\n <View\n key={column.id}\n px={padding.px}\n py={padding.py}\n style={resolveCellStyle(column)}\n >\n {renderTableCell(column, row, rowIndex)}\n </View>\n ))}\n {hasRowActions ? (\n <View\n px={padding.px}\n py={padding.py}\n style={{ alignItems: 'flex-end', minWidth: 56, width: 56 }}\n >\n {renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy })}\n </View>\n ) : null}\n </View>\n </View>\n );\n })}\n </View>\n </View>\n </View>\n </ScrollView>\n );\n}\n\nfunction DataTableMobile<TRow extends object>({\n columns,\n rows,\n rowActions,\n rowId,\n rowKey,\n selectedRowIds,\n onSelectedRowIdsChange,\n testID,\n interactionPolicy,\n}: DataTableProps<TRow>) {\n const [primaryColumn, ...detailColumns] = columns;\n const controlledSelectedRowIds = selectedRowIds ?? [];\n const selectedRowIdSet = new Set(controlledSelectedRowIds);\n const selectionEnabled = selectedRowIds !== undefined;\n const selectionDisabled = interactionPolicy === 'passive' || onSelectedRowIdsChange === undefined;\n\n return (\n <View gap=\"s\">\n {rows.map((row, rowIndex) => {\n const currentRowId = resolveDataTableRowKey(row, rowIndex, rowKey, rowId);\n const title = primaryColumn\n ? renderCell(primaryColumn, row, rowIndex)\n : `Row ${rowIndex + 1}`;\n const actions = renderRowActions({ row, rowActions, rowIndex, testID, interactionPolicy });\n\n return (\n <Card\n actions={actions}\n compact\n interactionPolicy={interactionPolicy}\n key={currentRowId}\n testID={testID ? `${testID}-card-${rowIndex}` : undefined}\n title={title}\n >\n <View gap=\"s\">\n {selectionEnabled ? (\n <Checkbox\n accessibilityLabel={`Select row ${currentRowId}`}\n checked={selectedRowIdSet.has(currentRowId)}\n disabled={selectionDisabled}\n interactionPolicy={interactionPolicy}\n onCheckedChange={(nextSelected) => {\n if (selectionDisabled) return;\n onSelectedRowIdsChange(\n resolveNextSelectedRowIds(\n controlledSelectedRowIds,\n currentRowId,\n nextSelected,\n ),\n );\n }}\n />\n ) : null}\n {detailColumns.map((column) => (\n <View gap=\"xxs\" key={column.id}>\n <Text emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {column.header}\n </Text>\n {column.renderCell ? (\n renderCell(column, row, rowIndex)\n ) : (\n <Text variant=\"bodySmall\">\n {renderDefaultCell(resolveAccessorValue(row, column))}\n </Text>\n )}\n </View>\n ))}\n </View>\n </Card>\n );\n })}\n </View>\n );\n}\n\nfunction DataTableInner<TRow extends object>({\n themeId: _themeId,\n mode: _mode,\n rows,\n loading = false,\n loadingRows = 5,\n emptyTitle = 'No data',\n emptyDescription = 'There are no rows to display.',\n testID,\n density = 'comfortable',\n interactionPolicy,\n ...props\n}: DataTableProps<TRow>) {\n if (loading) {\n return <SkeletonList rows={loadingRows} variant=\"card\" testID={testID} />;\n }\n\n if (rows.length === 0) {\n return <EmptyState title={emptyTitle} description={emptyDescription} />;\n }\n\n const tableProps: DataTableProps<TRow> = {\n ...props,\n density,\n emptyDescription,\n emptyTitle,\n interactionPolicy,\n loading,\n loadingRows,\n rows,\n testID,\n };\n\n return (\n <View testID={testID}>\n <Show when={{ base: false, md: true }} fallback={<DataTableMobile {...tableProps} />}>\n <DataTableDesktop {...tableProps} />\n </Show>\n </View>\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DatePickerProps } from '../../../types/date-picker';
|
|
3
|
-
/***
|
|
3
|
+
/*** Hosts the shared compact Calendar inside the existing DatePicker overlay surfaces. */
|
|
4
4
|
export declare function DatePickerContent({ description, interactionPolicy, label, maxDate, minDate, onDismiss, onSelect, testID, value, }: DatePickerContentProps): React.JSX.Element;
|
|
5
5
|
interface DatePickerContentProps extends Pick<DatePickerProps, 'description' | 'interactionPolicy' | 'label' | 'maxDate' | 'minDate' | 'testID' | 'value'> {
|
|
6
6
|
onDismiss: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/features/date-picker/composition/DatePickerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/features/date-picker/composition/DatePickerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAOlE,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,GACN,EAAE,sBAAsB,qBAsBxB;AAED,UAAU,sBAAuB,SAAQ,IAAI,CAC3C,eAAe,EACf,aAAa,GAAG,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAC3F;IACC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;CACjC"}
|
|
@@ -1,119 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '../../button/public';
|
|
3
|
+
import { Calendar } from '../../calendar/public';
|
|
3
4
|
import { View } from '../../layout/public';
|
|
4
5
|
import { PickerHeader } from '../../picker/composition/PickerHeader';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const WEEKDAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
8
|
-
const DAY_CELL_WIDTH = 42;
|
|
9
|
-
/*** Renders the shared calendar content used by native BottomSheet and web Popover hosts. */
|
|
6
|
+
import { parseLocalDate } from '../utils/localDate';
|
|
7
|
+
/*** Hosts the shared compact Calendar inside the existing DatePicker overlay surfaces. */
|
|
10
8
|
export function DatePickerContent({ description, interactionPolicy, label, maxDate, minDate, onDismiss, onSelect, testID, value, }) {
|
|
11
|
-
const [displayMonth, setDisplayMonth] = React.useState(() => resolveInitialMonth(value, minDate));
|
|
12
|
-
const monthDays = React.useMemo(() => createMonthDays(displayMonth), [displayMonth]);
|
|
13
9
|
const resolvedMaxDate = React.useMemo(() => parseLocalDate(maxDate), [maxDate]);
|
|
14
10
|
const resolvedMinDate = React.useMemo(() => parseLocalDate(minDate), [minDate]);
|
|
11
|
+
const selectedDate = React.useMemo(() => parseLocalDate(value), [value]);
|
|
15
12
|
return (<View gap="m" p="m" testID={testID ? `${testID}-content` : undefined}>
|
|
16
13
|
<PickerHeader description={description} title={label ?? 'Choose date'}/>
|
|
17
|
-
<
|
|
18
|
-
<DatePickerWeekdays />
|
|
19
|
-
<DatePickerCalendar interactionPolicy={interactionPolicy} maxDate={resolvedMaxDate} minDate={resolvedMinDate} monthDays={monthDays} onSelect={onSelect} testID={testID} value={value}/>
|
|
14
|
+
<Calendar density="compact" interactionPolicy={interactionPolicy} maxDate={resolvedMaxDate} minDate={resolvedMinDate} onSelectedDateChange={onSelect} selectedDate={selectedDate ?? null} testID={testID}/>
|
|
20
15
|
<Button fullWidth interactionPolicy={interactionPolicy} onPress={onDismiss} variant="ghost">
|
|
21
16
|
Cancel
|
|
22
17
|
</Button>
|
|
23
18
|
</View>);
|
|
24
19
|
}
|
|
25
|
-
/*** Renders previous and next month controls for the calendar. */
|
|
26
|
-
function DatePickerMonthNavigation({ displayMonth, interactionPolicy, maxDate, minDate, onMonthChange, }) {
|
|
27
|
-
const previousMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() - 1, 1);
|
|
28
|
-
const nextMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() + 1, 1);
|
|
29
|
-
return (<View align="center" direction="row" justify="space-between">
|
|
30
|
-
<Button disabled={!canNavigateToMonth(previousMonth, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => onMonthChange(previousMonth)} size="s" variant="ghost">
|
|
31
|
-
Previous
|
|
32
|
-
</Button>
|
|
33
|
-
<Text align="center" variant="label" weight="semiBold">
|
|
34
|
-
{formatMonthLabel(displayMonth)}
|
|
35
|
-
</Text>
|
|
36
|
-
<Button disabled={!canNavigateToMonth(nextMonth, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => onMonthChange(nextMonth)} size="s" variant="ghost">
|
|
37
|
-
Next
|
|
38
|
-
</Button>
|
|
39
|
-
</View>);
|
|
40
|
-
}
|
|
41
|
-
/*** Renders weekday headings for the calendar grid. */
|
|
42
|
-
function DatePickerWeekdays() {
|
|
43
|
-
return (<View direction="row" justify="space-between">
|
|
44
|
-
{WEEKDAY_LABELS.map((weekday) => (<View key={weekday} width={DAY_CELL_WIDTH}>
|
|
45
|
-
<Text align="center" emphasis="muted" variant="caption" weight="semiBold">
|
|
46
|
-
{weekday}
|
|
47
|
-
</Text>
|
|
48
|
-
</View>))}
|
|
49
|
-
</View>);
|
|
50
|
-
}
|
|
51
|
-
/*** Renders selectable day cells for the current calendar month. */
|
|
52
|
-
function DatePickerCalendar({ interactionPolicy, maxDate, minDate, monthDays, onSelect, testID, value, }) {
|
|
53
|
-
return (<View direction="row" gap="xs" wrap="wrap">
|
|
54
|
-
{monthDays.map((day, index) => {
|
|
55
|
-
if (!day)
|
|
56
|
-
return <View key={`empty-${index}`} width={DAY_CELL_WIDTH}/>;
|
|
57
|
-
const selected = isSameLocalDay(value, day);
|
|
58
|
-
return (<View key={day.toISOString()} width={DAY_CELL_WIDTH}>
|
|
59
|
-
<Button color={selected ? 'primary' : 'neutral'} disabled={isDateDisabled(day, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => onSelect(day)} size="s" testID={testID ? `${testID}-day-${day.getDate()}` : undefined} variant={selected ? 'solid' : 'ghost'}>
|
|
60
|
-
{day.getDate()}
|
|
61
|
-
</Button>
|
|
62
|
-
</View>);
|
|
63
|
-
})}
|
|
64
|
-
</View>);
|
|
65
|
-
}
|
|
66
|
-
/*** Compares a serialized date to one local calendar day. */
|
|
67
|
-
function isSameLocalDay(left, right) {
|
|
68
|
-
return left === formatLocalDate(right);
|
|
69
|
-
}
|
|
70
|
-
/*** Normalizes a Date to the start of its local calendar day. */
|
|
71
|
-
function startOfLocalDay(value) {
|
|
72
|
-
return new Date(value.getFullYear(), value.getMonth(), value.getDate());
|
|
73
|
-
}
|
|
74
|
-
/*** Reports whether one local calendar day precedes another. */
|
|
75
|
-
function isBeforeLocalDay(left, right) {
|
|
76
|
-
return startOfLocalDay(left).getTime() < startOfLocalDay(right).getTime();
|
|
77
|
-
}
|
|
78
|
-
/*** Reports whether one local calendar day follows another. */
|
|
79
|
-
function isAfterLocalDay(left, right) {
|
|
80
|
-
return startOfLocalDay(left).getTime() > startOfLocalDay(right).getTime();
|
|
81
|
-
}
|
|
82
|
-
/*** Reports whether a date falls outside the configured picker range. */
|
|
83
|
-
function isDateDisabled(value, minDate, maxDate) {
|
|
84
|
-
if (minDate && isBeforeLocalDay(value, minDate))
|
|
85
|
-
return true;
|
|
86
|
-
if (maxDate && isAfterLocalDay(value, maxDate))
|
|
87
|
-
return true;
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
/*** Formats the current calendar month for the picker heading. */
|
|
91
|
-
function formatMonthLabel(value) {
|
|
92
|
-
return value.toLocaleDateString(undefined, { month: 'long', year: 'numeric' });
|
|
93
|
-
}
|
|
94
|
-
/*** Builds the padded calendar grid for one month. */
|
|
95
|
-
function createMonthDays(month) {
|
|
96
|
-
const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
97
|
-
const dayCount = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();
|
|
98
|
-
const populatedLength = firstDay.getDay() + dayCount;
|
|
99
|
-
const paddedLength = Math.ceil(populatedLength / 7) * 7;
|
|
100
|
-
return Array.from({ length: paddedLength }, (_, index) => index < firstDay.getDay()
|
|
101
|
-
? null
|
|
102
|
-
: new Date(month.getFullYear(), month.getMonth(), index - firstDay.getDay() + 1));
|
|
103
|
-
}
|
|
104
|
-
/*** Resolves the month initially shown by the calendar. */
|
|
105
|
-
function resolveInitialMonth(value, minDate) {
|
|
106
|
-
const base = parseLocalDate(value) ?? parseLocalDate(minDate) ?? new Date();
|
|
107
|
-
return new Date(base.getFullYear(), base.getMonth(), 1);
|
|
108
|
-
}
|
|
109
|
-
/*** Reports whether the configured range intersects a candidate month. */
|
|
110
|
-
function canNavigateToMonth(month, minDate, maxDate) {
|
|
111
|
-
const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
112
|
-
const lastDay = new Date(month.getFullYear(), month.getMonth() + 1, 0);
|
|
113
|
-
if (maxDate && isAfterLocalDay(firstDay, maxDate))
|
|
114
|
-
return false;
|
|
115
|
-
if (minDate && isBeforeLocalDay(lastDay, minDate))
|
|
116
|
-
return false;
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
20
|
//# sourceMappingURL=DatePickerContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerContent.js","sourceRoot":"","sources":["../../../../src/features/date-picker/composition/DatePickerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAClF,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,6FAA6F;AAC7F,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,GACkB;IACvB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,mBAAmB,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AAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import React from 'react';\n\nimport type { DatePickerProps } from '../../../types/date-picker';\nimport { Button } from '../../button/public';\nimport { View } from '../../layout/public';\nimport { PickerHeader } from '../../picker/composition/PickerHeader';\nimport { Text } from '../../typography/public';\nimport { formatLocalDate, parseLocalDate } from '../utils/localDate';\n\nconst WEEKDAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] as const;\nconst DAY_CELL_WIDTH = 42;\n\n/*** Renders the shared calendar content used by native BottomSheet and web Popover hosts. */\nexport function DatePickerContent({\n description,\n interactionPolicy,\n label,\n maxDate,\n minDate,\n onDismiss,\n onSelect,\n testID,\n value,\n}: DatePickerContentProps) {\n const [displayMonth, setDisplayMonth] = React.useState(() => resolveInitialMonth(value, minDate));\n const monthDays = React.useMemo(() => createMonthDays(displayMonth), [displayMonth]);\n const resolvedMaxDate = React.useMemo(() => parseLocalDate(maxDate), [maxDate]);\n const resolvedMinDate = React.useMemo(() => parseLocalDate(minDate), [minDate]);\n\n return (\n <View gap=\"m\" p=\"m\" testID={testID ? `${testID}-content` : undefined}>\n <PickerHeader description={description} title={label ?? 'Choose date'} />\n <DatePickerMonthNavigation\n displayMonth={displayMonth}\n interactionPolicy={interactionPolicy}\n maxDate={resolvedMaxDate}\n minDate={resolvedMinDate}\n onMonthChange={setDisplayMonth}\n />\n <DatePickerWeekdays />\n <DatePickerCalendar\n interactionPolicy={interactionPolicy}\n maxDate={resolvedMaxDate}\n minDate={resolvedMinDate}\n monthDays={monthDays}\n onSelect={onSelect}\n testID={testID}\n value={value}\n />\n <Button fullWidth interactionPolicy={interactionPolicy} onPress={onDismiss} variant=\"ghost\">\n Cancel\n </Button>\n </View>\n );\n}\n\ninterface DatePickerContentProps extends Pick<\n DatePickerProps,\n 'description' | 'interactionPolicy' | 'label' | 'maxDate' | 'minDate' | 'testID' | 'value'\n> {\n onDismiss: () => void;\n onSelect: (value: Date) => void;\n}\n\n/*** Renders previous and next month controls for the calendar. */\nfunction DatePickerMonthNavigation({\n displayMonth,\n interactionPolicy,\n maxDate,\n minDate,\n onMonthChange,\n}: {\n displayMonth: Date;\n interactionPolicy: DatePickerProps['interactionPolicy'];\n maxDate: Date | undefined;\n minDate: Date | undefined;\n onMonthChange: (month: Date) => void;\n}) {\n const previousMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() - 1, 1);\n const nextMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() + 1, 1);\n\n return (\n <View align=\"center\" direction=\"row\" justify=\"space-between\">\n <Button\n disabled={!canNavigateToMonth(previousMonth, minDate, maxDate)}\n interactionPolicy={interactionPolicy}\n onPress={() => onMonthChange(previousMonth)}\n size=\"s\"\n variant=\"ghost\"\n >\n Previous\n </Button>\n <Text align=\"center\" variant=\"label\" weight=\"semiBold\">\n {formatMonthLabel(displayMonth)}\n </Text>\n <Button\n disabled={!canNavigateToMonth(nextMonth, minDate, maxDate)}\n interactionPolicy={interactionPolicy}\n onPress={() => onMonthChange(nextMonth)}\n size=\"s\"\n variant=\"ghost\"\n >\n Next\n </Button>\n </View>\n );\n}\n\n/*** Renders weekday headings for the calendar grid. */\nfunction DatePickerWeekdays() {\n return (\n <View direction=\"row\" justify=\"space-between\">\n {WEEKDAY_LABELS.map((weekday) => (\n <View key={weekday} width={DAY_CELL_WIDTH}>\n <Text align=\"center\" emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {weekday}\n </Text>\n </View>\n ))}\n </View>\n );\n}\n\n/*** Renders selectable day cells for the current calendar month. */\nfunction DatePickerCalendar({\n interactionPolicy,\n maxDate,\n minDate,\n monthDays,\n onSelect,\n testID,\n value,\n}: {\n interactionPolicy: DatePickerProps['interactionPolicy'];\n maxDate: Date | undefined;\n minDate: Date | undefined;\n monthDays: readonly (Date | null)[];\n onSelect: (value: Date) => void;\n testID: string | undefined;\n value: DatePickerProps['value'];\n}) {\n return (\n <View direction=\"row\" gap=\"xs\" wrap=\"wrap\">\n {monthDays.map((day, index) => {\n if (!day) return <View key={`empty-${index}`} width={DAY_CELL_WIDTH} />;\n const selected = isSameLocalDay(value, day);\n return (\n <View key={day.toISOString()} width={DAY_CELL_WIDTH}>\n <Button\n color={selected ? 'primary' : 'neutral'}\n disabled={isDateDisabled(day, minDate, maxDate)}\n interactionPolicy={interactionPolicy}\n onPress={() => onSelect(day)}\n size=\"s\"\n testID={testID ? `${testID}-day-${day.getDate()}` : undefined}\n variant={selected ? 'solid' : 'ghost'}\n >\n {day.getDate()}\n </Button>\n </View>\n );\n })}\n </View>\n );\n}\n\n/*** Compares a serialized date to one local calendar day. */\nfunction isSameLocalDay(left: string | null, right: Date): boolean {\n return left === formatLocalDate(right);\n}\n\n/*** Normalizes a Date to the start of its local calendar day. */\nfunction startOfLocalDay(value: Date): Date {\n return new Date(value.getFullYear(), value.getMonth(), value.getDate());\n}\n\n/*** Reports whether one local calendar day precedes another. */\nfunction isBeforeLocalDay(left: Date, right: Date): boolean {\n return startOfLocalDay(left).getTime() < startOfLocalDay(right).getTime();\n}\n\n/*** Reports whether one local calendar day follows another. */\nfunction isAfterLocalDay(left: Date, right: Date): boolean {\n return startOfLocalDay(left).getTime() > startOfLocalDay(right).getTime();\n}\n\n/*** Reports whether a date falls outside the configured picker range. */\nfunction isDateDisabled(\n value: Date,\n minDate: Date | undefined,\n maxDate: Date | undefined,\n): boolean {\n if (minDate && isBeforeLocalDay(value, minDate)) return true;\n if (maxDate && isAfterLocalDay(value, maxDate)) return true;\n return false;\n}\n\n/*** Formats the current calendar month for the picker heading. */\nfunction formatMonthLabel(value: Date): string {\n return value.toLocaleDateString(undefined, { month: 'long', year: 'numeric' });\n}\n\n/*** Builds the padded calendar grid for one month. */\nfunction createMonthDays(month: Date): (Date | null)[] {\n const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);\n const dayCount = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();\n const populatedLength = firstDay.getDay() + dayCount;\n const paddedLength = Math.ceil(populatedLength / 7) * 7;\n\n return Array.from({ length: paddedLength }, (_, index) =>\n index < firstDay.getDay()\n ? null\n : new Date(month.getFullYear(), month.getMonth(), index - firstDay.getDay() + 1),\n );\n}\n\n/*** Resolves the month initially shown by the calendar. */\nfunction resolveInitialMonth(value: string | null, minDate: string | undefined): Date {\n const base = parseLocalDate(value) ?? parseLocalDate(minDate) ?? new Date();\n return new Date(base.getFullYear(), base.getMonth(), 1);\n}\n\n/*** Reports whether the configured range intersects a candidate month. */\nfunction canNavigateToMonth(\n month: Date,\n minDate: Date | undefined,\n maxDate: Date | undefined,\n): boolean {\n const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);\n const lastDay = new Date(month.getFullYear(), month.getMonth() + 1, 0);\n\n if (maxDate && isAfterLocalDay(firstDay, maxDate)) return false;\n if (minDate && isBeforeLocalDay(lastDay, minDate)) return false;\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DatePickerContent.js","sourceRoot":"","sources":["../../../../src/features/date-picker/composition/DatePickerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,GACkB;IACvB,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAChF,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEzE,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CACnE;MAAA,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,aAAa,CAAC,EACtE;MAAA,CAAC,QAAQ,CACP,OAAO,CAAC,SAAS,CACjB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,eAAe,CAAC,CACzB,OAAO,CAAC,CAAC,eAAe,CAAC,CACzB,oBAAoB,CAAC,CAAC,QAAQ,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,CACnC,MAAM,CAAC,CAAC,MAAM,CAAC,EAEjB;MAAA,CAAC,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,CACzF;;MACF,EAAE,MAAM,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { DatePickerProps } from '../../../types/date-picker';\nimport { Button } from '../../button/public';\nimport { Calendar } from '../../calendar/public';\nimport { View } from '../../layout/public';\nimport { PickerHeader } from '../../picker/composition/PickerHeader';\nimport { parseLocalDate } from '../utils/localDate';\n\n/*** Hosts the shared compact Calendar inside the existing DatePicker overlay surfaces. */\nexport function DatePickerContent({\n description,\n interactionPolicy,\n label,\n maxDate,\n minDate,\n onDismiss,\n onSelect,\n testID,\n value,\n}: DatePickerContentProps) {\n const resolvedMaxDate = React.useMemo(() => parseLocalDate(maxDate), [maxDate]);\n const resolvedMinDate = React.useMemo(() => parseLocalDate(minDate), [minDate]);\n const selectedDate = React.useMemo(() => parseLocalDate(value), [value]);\n\n return (\n <View gap=\"m\" p=\"m\" testID={testID ? `${testID}-content` : undefined}>\n <PickerHeader description={description} title={label ?? 'Choose date'} />\n <Calendar\n density=\"compact\"\n interactionPolicy={interactionPolicy}\n maxDate={resolvedMaxDate}\n minDate={resolvedMinDate}\n onSelectedDateChange={onSelect}\n selectedDate={selectedDate ?? null}\n testID={testID}\n />\n <Button fullWidth interactionPolicy={interactionPolicy} onPress={onDismiss} variant=\"ghost\">\n Cancel\n </Button>\n </View>\n );\n}\n\ninterface DatePickerContentProps extends Pick<\n DatePickerProps,\n 'description' | 'interactionPolicy' | 'label' | 'maxDate' | 'minDate' | 'testID' | 'value'\n> {\n onDismiss: () => void;\n onSelect: (value: Date) => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphRuntime.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAkB,EAAa,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAEzB,qBAAqB,EACrB,aAAa,EAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAkBhF,KAAK,cAAc,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACpD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,KAAK,IAAI,CAAC;AAE9E,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,IAAI,CAAC;IAChB,sBAAsB,CACpB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,yBAAyB,EAC/B,eAAe,CAAC,EAAE,eAAe,GAChC,IAAI,CAAC;IACR,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IACnD,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;IACjE,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"createGraphRuntime.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAkB,EAAa,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAEzB,qBAAqB,EACrB,aAAa,EAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAkBhF,KAAK,cAAc,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACpD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,KAAK,IAAI,CAAC;AAE9E,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,IAAI,CAAC;IAChB,sBAAsB,CACpB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,yBAAyB,EAC/B,eAAe,CAAC,EAAE,eAAe,GAChC,IAAI,CAAC;IACR,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IACnD,kBAAkB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;IACjE,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzC;AA+BD,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,cAAc,EACzB,YAAY,EAAE;IAAE,OAAO,EAAE,kBAAkB,CAAA;CAAE,EAC7C,qBAAqB,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAoB,GAC9D,YAAY,CAoBd"}
|
|
@@ -62,6 +62,7 @@ function createRuntimeState(cy, container, callbacksRef, readLatestPointerDown)
|
|
|
62
62
|
labelSizedNodeIds: new Set(),
|
|
63
63
|
loopSizer: createGraphLoopSizer(cy),
|
|
64
64
|
pendingInitialFitRef: { current: false },
|
|
65
|
+
preservedTopologyMeasurementRef: { current: false },
|
|
65
66
|
readyRef,
|
|
66
67
|
settledLayoutRef: { current: null },
|
|
67
68
|
settledTopologyRef: { current: null },
|
|
@@ -106,6 +107,7 @@ function updateRuntime(state, input) {
|
|
|
106
107
|
state.fitPaddingRef.current = input.fitPadding ?? 50;
|
|
107
108
|
state.viewport.configure(input);
|
|
108
109
|
const preservesTopology = shouldPreserveTopology(state, previous, input);
|
|
110
|
+
beginPreservedTopologyMeasurementWindow(state, previous, input, preservesTopology);
|
|
109
111
|
const retainedNodeIds = getRetainedNodeIds(previous, input, preservesTopology);
|
|
110
112
|
const retainedGeometry = retainedNodeIds === null ? null : getGraphGeometryKey(state.cy, retainedNodeIds);
|
|
111
113
|
state.cy.batch(() => {
|
|
@@ -155,6 +157,21 @@ function shouldPreserveTopology(state, previous, input) {
|
|
|
155
157
|
!state.pendingInitialFitRef.current &&
|
|
156
158
|
input.topologyUpdatePolicy === 'preserve-positions');
|
|
157
159
|
}
|
|
160
|
+
/***
|
|
161
|
+
* Retain measurements emitted by the overlay commit that follows one controlled topology update.
|
|
162
|
+
* A later resize remains geometry input and therefore schedules its normal relayout.
|
|
163
|
+
*/
|
|
164
|
+
function beginPreservedTopologyMeasurementWindow(state, previous, input, preservesTopology) {
|
|
165
|
+
const topologyChanged = previous !== null &&
|
|
166
|
+
getGraphTopologyKey(previous.nodes, previous.edges) !==
|
|
167
|
+
getGraphTopologyKey(input.nodes, input.edges);
|
|
168
|
+
state.preservedTopologyMeasurementRef.current = preservesTopology && topologyChanged;
|
|
169
|
+
if (!state.preservedTopologyMeasurementRef.current)
|
|
170
|
+
return;
|
|
171
|
+
scheduleGraphFrame(() => {
|
|
172
|
+
state.preservedTopologyMeasurementRef.current = false;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
158
175
|
/*** Limit stable-update geometry checks to nodes that existed before reconciliation. */
|
|
159
176
|
function getRetainedNodeIds(previous, input, preservesTopology) {
|
|
160
177
|
if (!preservesTopology || previous === null)
|
|
@@ -317,6 +334,8 @@ function setNodeSize(state, id, size) {
|
|
|
317
334
|
return;
|
|
318
335
|
state.nodeSizes.set(id, size);
|
|
319
336
|
applyNodeSize(state.cy, id, size);
|
|
337
|
+
if (state.preservedTopologyMeasurementRef.current)
|
|
338
|
+
return;
|
|
320
339
|
scheduleMeasuredNodeRelayout(state);
|
|
321
340
|
}
|
|
322
341
|
/*** Apply every known rich-node size after Cytoscape elements are replaced. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphRuntime.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAoC,MAAM,WAAW,CAAC;AAWxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAA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;QAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;AACtE,CAAC;AAED,wFAAwF;AACxF,SAAS,sBAAsB,CAC7B,KAAwB,EACxB,EAAU,EACV,IAA+B,EAC/B,eAAiC;IAEjC,IAAI,IAAI,KAAK,eAAe;QAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC3D,IAAI,IAAI,KAAK,eAAe;QAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC9D,IAAI,IAAI,KAAK,OAAO;QAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3D,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IACxE,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,+EAA+E;AAC/E,SAAS,iBAAiB,CAAC,EAAQ;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,8EAA8E;AAC9E,SAAS,cAAc,CAAC,KAAwB;IAC9C,KAAK,CAAC,cAAc,EAAE,UAAU,EAAE,CAAC;IACnC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACzB,KAAK,CAAC,YAAY,EAAE,CAAC;IACrB,KAAK,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;IACpC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE;QAAE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;AAChD,CAAC;AAED,oBAAoB,EAAE,CAAC","sourcesContent":["import type { SelectionIntent } from '@ankhorage/utility/selection';\nimport cytoscape, { type Core, type CytoscapeOptions } from 'cytoscape';\n\nimport type {\n GraphViewCallbacks,\n GraphViewElementEventType,\n GraphViewFitOptions,\n GraphViewRenderedNode,\n GraphViewSize,\n GraphViewStyleRule,\n} from '../../../../../types/graph-view';\nimport type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';\nimport { bindGraphEvents } from './bindGraphEvents';\nimport { compactGraphSpacing } from './compactGraphSpacing';\nimport { createGraphController } from './createGraphController';\nimport { createGraphLoopSizer } from './createGraphLoopSizer';\nimport { createGraphResizeObserver, type GraphResizeObserver } from './createGraphResizeObserver';\nimport { getGraphGeometryKey } from './getGraphGeometryKey';\nimport { getGraphTopologyKey } from './getGraphTopologyKey';\nimport { hasGraphLayoutChanged } from './hasGraphLayoutChanged';\nimport { placeAddedGraphNodes } from './placeAddedGraphNodes';\nimport { readGraphRenderedNodes } from './readGraphRenderedNodes';\nimport { registerGraphLayouts } from './registerGraphLayouts';\nimport { runGraphLayout } from './runGraphLayout';\nimport { scheduleGraphFrame } from './scheduleGraphFrame';\nimport { shouldFitGraphAfterLayout } from './shouldFitGraphAfterLayout';\nimport { sizeGraphNodesToLabels } from './sizeGraphNodesToLabels';\nimport { syncGraphElements } from './syncGraphElements';\n\ntype GraphContainer = CytoscapeOptions['container'];\ntype RenderedNodeListener = (nodes: readonly GraphViewRenderedNode[]) => void;\n\nexport interface GraphRuntime {\n destroy(): void;\n handleOverlayNodeEvent(\n id: string,\n type: GraphViewElementEventType,\n selectionIntent?: SelectionIntent,\n ): void;\n setNodeSize(id: string, size: GraphViewSize): void;\n setSelectedNodeIds(nodeIds: readonly string[] | undefined): void;\n subscribeRenderedNodes(listener: RenderedNodeListener): () => void;\n update(input: GraphRuntimeUpdate): void;\n}\n\ninterface GraphRuntimeState {\n readonly fitRequestRef: { current: GraphViewFitOptions | null };\n readonly optimizedSpacingRef: { current: number | null };\n readonly callbacksRef: { current: GraphViewCallbacks };\n readonly controller: ReturnType<typeof createGraphController>['controller'];\n readonly viewport: ReturnType<typeof createGraphController>;\n readonly cy: Core;\n readonly fitPaddingRef: { current: number };\n readonly generationRef: { current: number };\n readonly geometryRef: { current: string | null };\n readonly hoveredNodeIds: Set<string>;\n readonly initialLayoutScheduledRef: { current: boolean };\n readonly latestUpdateRef: { current: GraphRuntimeUpdate | null };\n readonly layoutRef: { current: ReturnType<typeof runGraphLayout> | null };\n readonly layoutRunningRef: { current: boolean };\n readonly nodeSizes: Map<string, GraphViewSize>;\n readonly labelSizedNodeIds: Set<string>;\n readonly loopSizer: ReturnType<typeof createGraphLoopSizer>;\n readonly pendingInitialFitRef: { current: boolean };\n readonly readyRef: { current: boolean };\n readonly settledLayoutRef: { current: GraphRuntimeUpdate['layout'] | null };\n readonly settledTopologyRef: { current: string | null };\n readonly relayoutScheduledRef: { current: boolean };\n readonly renderedNodeListeners: Set<RenderedNodeListener>;\n readonly resizeObserver: GraphResizeObserver | null;\n readonly unbindEvents: () => void;\n}\n\n/*** Create one Cytoscape runtime that exclusively owns layout, fit, resize, and disposal. */\nexport function createGraphRuntime(\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n readLatestPointerDown: (event: unknown) => unknown = () => null,\n): GraphRuntime {\n const cy = cytoscape({\n container,\n elements: [],\n minZoom: 0.05,\n maxZoom: 2,\n selectionType: 'additive',\n userPanningEnabled: true,\n });\n const state = createRuntimeState(cy, container, callbacksRef, readLatestPointerDown);\n\n return {\n destroy: () => destroyRuntime(state),\n handleOverlayNodeEvent: (id, type, selectionIntent) =>\n handleOverlayNodeEvent(state, id, type, selectionIntent),\n setNodeSize: (id, size) => setNodeSize(state, id, size),\n setSelectedNodeIds: (nodeIds) => setSelectedNodeIds(state, nodeIds),\n subscribeRenderedNodes: (listener) => subscribeRenderedNodes(state, listener),\n update: (input) => updateRuntime(state, input),\n };\n}\n\n/*** Build the mutable state shared by the single graph-runtime owner. */\nfunction createRuntimeState(\n cy: Core,\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n readLatestPointerDown: (event: unknown) => unknown,\n): GraphRuntimeState {\n const fitPaddingRef = { current: 50 };\n const viewport = createGraphController(cy, fitPaddingRef, (options) =>\n requestOptimizedFit(state, options),\n );\n const { controller } = viewport;\n const layoutRunningRef = { current: false };\n const readyRef = { current: false };\n const renderedNodeListeners = new Set<RenderedNodeListener>();\n const stateBase = {\n fitRequestRef: { current: null as GraphViewFitOptions | null },\n optimizedSpacingRef: { current: null as number | null },\n callbacksRef,\n controller,\n viewport,\n cy,\n fitPaddingRef,\n generationRef: { current: 0 },\n geometryRef: { current: null as string | null },\n hoveredNodeIds: new Set<string>(),\n initialLayoutScheduledRef: { current: false },\n latestUpdateRef: { current: null as GraphRuntimeUpdate | null },\n layoutRef: { current: null as ReturnType<typeof runGraphLayout> | null },\n layoutRunningRef,\n nodeSizes: new Map<string, GraphViewSize>(),\n labelSizedNodeIds: new Set<string>(),\n loopSizer: createGraphLoopSizer(cy),\n pendingInitialFitRef: { current: false },\n readyRef,\n settledLayoutRef: { current: null as GraphRuntimeUpdate['layout'] | null },\n settledTopologyRef: { current: null as string | null },\n relayoutScheduledRef: { current: false },\n renderedNodeListeners,\n };\n const unbindEvents = bindGraphEvents(\n cy,\n callbacksRef,\n controller,\n () => emitRenderedNodes(stateBase),\n readLatestPointerDown,\n );\n const resizeObserver = createGraphResizeObserver({\n container,\n cy,\n beginViewportResize: () => viewport.beginResize(),\n settleViewport: (fit) => viewport.settle(fit),\n layoutRunningRef,\n pendingInitialFitRef: stateBase.pendingInitialFitRef,\n onViewportSettled: (completedPendingInitialFit) => {\n emitRenderedNodes(stateBase);\n if (!completedPendingInitialFit || readyRef.current) return;\n readyRef.current = true;\n callbacksRef.current.onReady?.(controller);\n callbacksRef.current.onLayoutComplete?.(controller);\n },\n readyRef,\n });\n\n const state = { ...stateBase, resizeObserver, unbindEvents };\n return state;\n}\n\n/***\n * Reconcile presentation in place and relayout only when graph geometry or layout policy changes.\n * Batch reconciliation and skip layout for presentation-only updates.\n */\nfunction updateRuntime(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n if (state.cy.destroyed()) return;\n const last = state.latestUpdateRef.current;\n const acceptsSpacing =\n state.optimizedSpacingRef.current !== null &&\n state.optimizedSpacingRef.current === input.spacingFactor;\n const previous = acceptsSpacing && last ? { ...last, spacingFactor: input.spacingFactor } : last;\n if (acceptsSpacing) state.optimizedSpacingRef.current = null;\n state.latestUpdateRef.current = input;\n state.fitPaddingRef.current = input.fitPadding ?? 50;\n state.viewport.configure(input);\n const preservesTopology = shouldPreserveTopology(state, previous, input);\n const retainedNodeIds = getRetainedNodeIds(previous, input, preservesTopology);\n const retainedGeometry =\n retainedNodeIds === null ? null : getGraphGeometryKey(state.cy, retainedNodeIds);\n state.cy.batch(() => {\n if (previous?.nodes !== input.nodes || previous.edges !== input.edges) {\n syncGraphElements(state.cy, input.nodes, input.edges);\n if (preservesTopology) placeAddedGraphNodes(state.cy, previous?.nodes ?? [], input.nodes);\n }\n if (\n previous?.styleRules !== input.styleRules ||\n previous?.richNodeRendering !== input.richNodeRendering\n ) {\n state.loopSizer.reset();\n applyGraphStyles(state.cy, input.styleRules, input.richNodeRendering);\n }\n });\n sizeGraphNodesToLabels(\n state.cy,\n state.labelSizedNodeIds,\n input.sizeNodesToLabels === true && !input.richNodeRendering,\n );\n applyKnownNodeSizes(state);\n state.loopSizer.update();\n const geometry = getGraphGeometryKey(state.cy);\n // Keep native double-press targets stable for paint-only class changes. A class that changes\n // measured node dimensions remains a geometry change and must relayout.\n const geometryChanged =\n retainedGeometry === null\n ? geometry !== state.geometryRef.current\n : retainedGeometry !== getGraphGeometryKey(state.cy, retainedNodeIds ?? undefined);\n const relayout = hasGraphLayoutChanged(previous, input, preservesTopology) || geometryChanged;\n state.geometryRef.current = geometry;\n if (!relayout) {\n if (\n previous?.zoomMode !== input.zoomMode ||\n previous?.fitPadding !== input.fitPadding ||\n previous?.minZoom !== input.minZoom ||\n previous?.maxZoom !== input.maxZoom ||\n previous?.minReadableLabelSize !== input.minReadableLabelSize ||\n previous?.maxFitLabelSize !== input.maxFitLabelSize\n ) {\n state.viewport.settle(previous?.zoomMode !== input.zoomMode);\n }\n emitRenderedNodes(state);\n return;\n }\n stopCurrentLayout(state);\n state.fitRequestRef.current = null;\n state.optimizedSpacingRef.current = null;\n startCurrentLayout(state, input);\n}\n\n/*** Preserve only opt-in topology updates after the initial layout and fit have settled. */\nfunction shouldPreserveTopology(\n state: GraphRuntimeState,\n previous: GraphRuntimeUpdate | null,\n input: GraphRuntimeUpdate,\n): boolean {\n return (\n previous !== null &&\n state.readyRef.current &&\n !state.pendingInitialFitRef.current &&\n input.topologyUpdatePolicy === 'preserve-positions'\n );\n}\n\n/*** Limit stable-update geometry checks to nodes that existed before reconciliation. */\nfunction getRetainedNodeIds(\n previous: GraphRuntimeUpdate | null,\n input: GraphRuntimeUpdate,\n preservesTopology: boolean,\n): ReadonlySet<string> | null {\n if (!preservesTopology || previous === null) return null;\n const nextNodeIds = new Set(input.nodes.map((node) => node.id));\n return new Set(previous.nodes.map((node) => node.id).filter((id) => nextNodeIds.has(id)));\n}\n\n/*** Start a generation-safe layout whose completion is the only normal automatic fit trigger. */\nfunction startCurrentLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n if (!state.readyRef.current) {\n scheduleInitialLayout(state);\n return;\n }\n startGraphLayout(state, input);\n}\n\n/*** Coalesce progressive pre-ready topology updates before the initial layout can complete. */\nfunction scheduleInitialLayout(state: GraphRuntimeState) {\n if (state.initialLayoutScheduledRef.current) return;\n state.initialLayoutScheduledRef.current = true;\n scheduleGraphFrame(() => {\n scheduleGraphFrame(() => {\n state.initialLayoutScheduledRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null || state.cy.destroyed() || state.readyRef.current) return;\n startGraphLayout(state, input);\n });\n });\n}\n\n/*** Start one layout generation after its input has reached the runtime owner. */\nfunction startGraphLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n state.pendingInitialFitRef.current = false;\n const generation = state.generationRef.current + 1;\n state.generationRef.current = generation;\n state.layoutRunningRef.current = true;\n state.cy.resize();\n state.layoutRef.current = runGraphLayout(\n state.cy,\n {\n layout: input.layout ?? 'concentric',\n layoutOptions: input.layoutOptions,\n spacingFactor: input.spacingFactor ?? 1,\n },\n () => completeCurrentLayout(state, generation),\n );\n}\n\n/***\n * Settle only the latest layout generation and fit once from node bounds.\n * Discard stale completions and avoid repeated automatic fits.\n */\nfunction completeCurrentLayout(state: GraphRuntimeState, generation: number) {\n scheduleGraphFrame(() => {\n if (state.cy.destroyed() || generation !== state.generationRef.current) return;\n state.loopSizer.update();\n state.layoutRef.current = null;\n state.cy.resize();\n state.layoutRunningRef.current = false;\n state.resizeObserver?.flushAfterLayout();\n if (!hasUsableViewport(state.cy)) {\n if (!state.readyRef.current) state.pendingInitialFitRef.current = true;\n return;\n }\n state.pendingInitialFitRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null) return;\n const topology = getGraphTopologyKey(input.nodes, input.edges);\n const shouldFit = shouldFitGraphAfterLayout(\n state.readyRef.current,\n topology !== state.settledTopologyRef.current,\n input.layout !== state.settledLayoutRef.current,\n );\n state.viewport.settle(shouldFit);\n state.settledLayoutRef.current = input.layout;\n state.settledTopologyRef.current = topology;\n const fitRequest = state.fitRequestRef.current;\n state.fitRequestRef.current = null;\n if (fitRequest) requestOptimizedFit(state, fitRequest);\n emitRenderedNodes(state);\n\n if (!state.readyRef.current) {\n state.readyRef.current = true;\n state.callbacksRef.current.onReady?.(state.controller);\n }\n state.callbacksRef.current.onLayoutComplete?.(state.controller);\n });\n}\n\n/***\n * Handle explicit readable-fit intent in the runtime owner, never from zoom or React effects.\n * Bounded spacing optimization preserves the settled algorithm instead of repeatedly running it.\n */\nfunction requestOptimizedFit(state: GraphRuntimeState, options: GraphViewFitOptions) {\n if (state.cy.destroyed()) return;\n if (state.layoutRunningRef.current) {\n state.fitRequestRef.current = options;\n return;\n }\n const input = state.latestUpdateRef.current;\n if (!input) return;\n const previous = state.optimizedSpacingRef.current ?? input.spacingFactor ?? 1;\n const spacing = compactGraphSpacing(state.cy, previous, {\n fitPadding: options.padding ?? state.fitPaddingRef.current,\n maxFitZoom: state.viewport.getFitZoomLimit(),\n minReadableZoom: state.viewport.getReadableZoomTarget(),\n });\n state.geometryRef.current = getGraphGeometryKey(state.cy);\n state.loopSizer.update();\n state.viewport.settle(false);\n state.controller.fit({ ...options, optimizeSpacing: false });\n if (spacing !== previous) {\n state.optimizedSpacingRef.current = spacing;\n state.callbacksRef.current.onSpacingFactorChange?.(spacing);\n }\n emitRenderedNodes(state);\n}\n\n/*** Stop the current layout and invalidate every stale completion callback. */\nfunction stopCurrentLayout(state: GraphRuntimeState) {\n state.generationRef.current += 1;\n state.layoutRunningRef.current = false;\n state.layoutRef.current?.stop();\n state.layoutRef.current = null;\n}\n\n/*** Apply consumer styles and hide native node paint only when React rich nodes are active. */\nfunction applyGraphStyles(\n cy: Core,\n rules: readonly GraphViewStyleRule[] | undefined,\n richNodeRendering: boolean,\n) {\n const styles = [...(rules ?? [])];\n if (richNodeRendering) {\n styles.push({\n selector: 'node',\n style: {\n 'background-opacity': 0,\n 'border-width': 0,\n label: '',\n 'overlay-opacity': 0,\n },\n });\n }\n if (styles.length > 0) cy.style(styles).update();\n}\n\n/***\n * Synchronize controlled selection without rerunning layout.\n * Selection updates must not trigger graph reconstruction or layout.\n */\nfunction setSelectedNodeIds(state: GraphRuntimeState, nodeIds: readonly string[] | undefined) {\n if (state.cy.destroyed() || nodeIds === undefined) return;\n const selectedIds = new Set(nodeIds);\n state.cy.nodes().forEach((node) => {\n if (selectedIds.has(node.id())) node.select();\n else node.unselect();\n });\n emitRenderedNodes(state);\n}\n\n/***\n * Persist one rich-node size and schedule at most one relayout for changed geometry.\n * Ignore unchanged measurements before scheduling layout work.\n */\nfunction setNodeSize(state: GraphRuntimeState, id: string, size: GraphViewSize) {\n const previous = state.nodeSizes.get(id);\n if (previous?.width === size.width && previous.height === size.height) return;\n state.nodeSizes.set(id, size);\n applyNodeSize(state.cy, id, size);\n scheduleMeasuredNodeRelayout(state);\n}\n\n/*** Apply every known rich-node size after Cytoscape elements are replaced. */\nfunction applyKnownNodeSizes(state: GraphRuntimeState) {\n for (const [id, size] of state.nodeSizes) applyNodeSize(state.cy, id, size);\n}\n\n/*** Apply one measured model-space size as a Cytoscape per-node style bypass. */\nfunction applyNodeSize(cy: Core, id: string, size: GraphViewSize) {\n const node = cy.getElementById(id);\n if (node.empty()) return;\n node.style({ height: size.height, width: size.width });\n}\n\n/***\n * Coalesce DOM measurements into one follow-up layout generation.\n * Keep one scheduled layout per frame instead of one per measured node.\n */\nfunction scheduleMeasuredNodeRelayout(state: GraphRuntimeState) {\n if (state.relayoutScheduledRef.current) return;\n state.relayoutScheduledRef.current = true;\n scheduleGraphFrame(() => {\n state.relayoutScheduledRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null || state.cy.destroyed()) return;\n stopCurrentLayout(state);\n startCurrentLayout(state, input);\n });\n}\n\n/*** Subscribe one React overlay to rendered node state without exposing the Cytoscape core. */\nfunction subscribeRenderedNodes(state: GraphRuntimeState, listener: RenderedNodeListener) {\n state.renderedNodeListeners.add(listener);\n listener(readGraphRenderedNodes(state.cy, state.hoveredNodeIds));\n return () => {\n state.renderedNodeListeners.delete(listener);\n };\n}\n\n/***\n * Publish current rendered node positions only to active rich-node subscribers.\n * Skip snapshot preparation when no overlay is subscribed.\n */\nfunction emitRenderedNodes(\n state: Pick<GraphRuntimeState, 'cy' | 'hoveredNodeIds' | 'renderedNodeListeners'>,\n) {\n if (state.renderedNodeListeners.size === 0) return;\n const nodes = readGraphRenderedNodes(state.cy, state.hoveredNodeIds);\n for (const listener of state.renderedNodeListeners) listener(nodes);\n}\n\n/*** Translate one rich-overlay event back into normal graph selection and callbacks. */\nfunction handleOverlayNodeEvent(\n state: GraphRuntimeState,\n id: string,\n type: GraphViewElementEventType,\n selectionIntent?: SelectionIntent,\n) {\n if (type === 'pointer-enter') state.hoveredNodeIds.add(id);\n if (type === 'pointer-leave') state.hoveredNodeIds.delete(id);\n if (type === 'press') state.cy.getElementById(id).select();\n state.callbacksRef.current.onNodeEvent?.({ id, type, selectionIntent });\n emitRenderedNodes(state);\n}\n\n/*** Return whether Cytoscape currently has dimensions suitable for fitting. */\nfunction hasUsableViewport(cy: Core): boolean {\n return cy.width() > 0 && cy.height() > 0;\n}\n\n/*** Dispose all runtime resources in the reverse order they were acquired. */\nfunction destroyRuntime(state: GraphRuntimeState) {\n state.resizeObserver?.disconnect();\n stopCurrentLayout(state);\n state.unbindEvents();\n state.renderedNodeListeners.clear();\n if (!state.cy.destroyed()) state.cy.destroy();\n}\n\nregisterGraphLayouts();\n"]}
|
|
1
|
+
{"version":3,"file":"createGraphRuntime.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,EAAE,EAAoC,MAAM,WAAW,CAAC;AAWxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAA4B,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OA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;AAChD,CAAC;AAED,oBAAoB,EAAE,CAAC","sourcesContent":["import type { SelectionIntent } from '@ankhorage/utility/selection';\nimport cytoscape, { type Core, type CytoscapeOptions } from 'cytoscape';\n\nimport type {\n GraphViewCallbacks,\n GraphViewElementEventType,\n GraphViewFitOptions,\n GraphViewRenderedNode,\n GraphViewSize,\n GraphViewStyleRule,\n} from '../../../../../types/graph-view';\nimport type { GraphRuntimeUpdate } from '../../../../../types/graphViewRuntime';\nimport { bindGraphEvents } from './bindGraphEvents';\nimport { compactGraphSpacing } from './compactGraphSpacing';\nimport { createGraphController } from './createGraphController';\nimport { createGraphLoopSizer } from './createGraphLoopSizer';\nimport { createGraphResizeObserver, type GraphResizeObserver } from './createGraphResizeObserver';\nimport { getGraphGeometryKey } from './getGraphGeometryKey';\nimport { getGraphTopologyKey } from './getGraphTopologyKey';\nimport { hasGraphLayoutChanged } from './hasGraphLayoutChanged';\nimport { placeAddedGraphNodes } from './placeAddedGraphNodes';\nimport { readGraphRenderedNodes } from './readGraphRenderedNodes';\nimport { registerGraphLayouts } from './registerGraphLayouts';\nimport { runGraphLayout } from './runGraphLayout';\nimport { scheduleGraphFrame } from './scheduleGraphFrame';\nimport { shouldFitGraphAfterLayout } from './shouldFitGraphAfterLayout';\nimport { sizeGraphNodesToLabels } from './sizeGraphNodesToLabels';\nimport { syncGraphElements } from './syncGraphElements';\n\ntype GraphContainer = CytoscapeOptions['container'];\ntype RenderedNodeListener = (nodes: readonly GraphViewRenderedNode[]) => void;\n\nexport interface GraphRuntime {\n destroy(): void;\n handleOverlayNodeEvent(\n id: string,\n type: GraphViewElementEventType,\n selectionIntent?: SelectionIntent,\n ): void;\n setNodeSize(id: string, size: GraphViewSize): void;\n setSelectedNodeIds(nodeIds: readonly string[] | undefined): void;\n subscribeRenderedNodes(listener: RenderedNodeListener): () => void;\n update(input: GraphRuntimeUpdate): void;\n}\n\ninterface GraphRuntimeState {\n readonly fitRequestRef: { current: GraphViewFitOptions | null };\n readonly optimizedSpacingRef: { current: number | null };\n readonly callbacksRef: { current: GraphViewCallbacks };\n readonly controller: ReturnType<typeof createGraphController>['controller'];\n readonly viewport: ReturnType<typeof createGraphController>;\n readonly cy: Core;\n readonly fitPaddingRef: { current: number };\n readonly generationRef: { current: number };\n readonly geometryRef: { current: string | null };\n readonly hoveredNodeIds: Set<string>;\n readonly initialLayoutScheduledRef: { current: boolean };\n readonly latestUpdateRef: { current: GraphRuntimeUpdate | null };\n readonly layoutRef: { current: ReturnType<typeof runGraphLayout> | null };\n readonly layoutRunningRef: { current: boolean };\n readonly nodeSizes: Map<string, GraphViewSize>;\n readonly labelSizedNodeIds: Set<string>;\n readonly loopSizer: ReturnType<typeof createGraphLoopSizer>;\n readonly pendingInitialFitRef: { current: boolean };\n readonly preservedTopologyMeasurementRef: { current: boolean };\n readonly readyRef: { current: boolean };\n readonly settledLayoutRef: { current: GraphRuntimeUpdate['layout'] | null };\n readonly settledTopologyRef: { current: string | null };\n readonly relayoutScheduledRef: { current: boolean };\n readonly renderedNodeListeners: Set<RenderedNodeListener>;\n readonly resizeObserver: GraphResizeObserver | null;\n readonly unbindEvents: () => void;\n}\n\n/*** Create one Cytoscape runtime that exclusively owns layout, fit, resize, and disposal. */\nexport function createGraphRuntime(\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n readLatestPointerDown: (event: unknown) => unknown = () => null,\n): GraphRuntime {\n const cy = cytoscape({\n container,\n elements: [],\n minZoom: 0.05,\n maxZoom: 2,\n selectionType: 'additive',\n userPanningEnabled: true,\n });\n const state = createRuntimeState(cy, container, callbacksRef, readLatestPointerDown);\n\n return {\n destroy: () => destroyRuntime(state),\n handleOverlayNodeEvent: (id, type, selectionIntent) =>\n handleOverlayNodeEvent(state, id, type, selectionIntent),\n setNodeSize: (id, size) => setNodeSize(state, id, size),\n setSelectedNodeIds: (nodeIds) => setSelectedNodeIds(state, nodeIds),\n subscribeRenderedNodes: (listener) => subscribeRenderedNodes(state, listener),\n update: (input) => updateRuntime(state, input),\n };\n}\n\n/*** Build the mutable state shared by the single graph-runtime owner. */\nfunction createRuntimeState(\n cy: Core,\n container: GraphContainer,\n callbacksRef: { current: GraphViewCallbacks },\n readLatestPointerDown: (event: unknown) => unknown,\n): GraphRuntimeState {\n const fitPaddingRef = { current: 50 };\n const viewport = createGraphController(cy, fitPaddingRef, (options) =>\n requestOptimizedFit(state, options),\n );\n const { controller } = viewport;\n const layoutRunningRef = { current: false };\n const readyRef = { current: false };\n const renderedNodeListeners = new Set<RenderedNodeListener>();\n const stateBase = {\n fitRequestRef: { current: null as GraphViewFitOptions | null },\n optimizedSpacingRef: { current: null as number | null },\n callbacksRef,\n controller,\n viewport,\n cy,\n fitPaddingRef,\n generationRef: { current: 0 },\n geometryRef: { current: null as string | null },\n hoveredNodeIds: new Set<string>(),\n initialLayoutScheduledRef: { current: false },\n latestUpdateRef: { current: null as GraphRuntimeUpdate | null },\n layoutRef: { current: null as ReturnType<typeof runGraphLayout> | null },\n layoutRunningRef,\n nodeSizes: new Map<string, GraphViewSize>(),\n labelSizedNodeIds: new Set<string>(),\n loopSizer: createGraphLoopSizer(cy),\n pendingInitialFitRef: { current: false },\n preservedTopologyMeasurementRef: { current: false },\n readyRef,\n settledLayoutRef: { current: null as GraphRuntimeUpdate['layout'] | null },\n settledTopologyRef: { current: null as string | null },\n relayoutScheduledRef: { current: false },\n renderedNodeListeners,\n };\n const unbindEvents = bindGraphEvents(\n cy,\n callbacksRef,\n controller,\n () => emitRenderedNodes(stateBase),\n readLatestPointerDown,\n );\n const resizeObserver = createGraphResizeObserver({\n container,\n cy,\n beginViewportResize: () => viewport.beginResize(),\n settleViewport: (fit) => viewport.settle(fit),\n layoutRunningRef,\n pendingInitialFitRef: stateBase.pendingInitialFitRef,\n onViewportSettled: (completedPendingInitialFit) => {\n emitRenderedNodes(stateBase);\n if (!completedPendingInitialFit || readyRef.current) return;\n readyRef.current = true;\n callbacksRef.current.onReady?.(controller);\n callbacksRef.current.onLayoutComplete?.(controller);\n },\n readyRef,\n });\n\n const state = { ...stateBase, resizeObserver, unbindEvents };\n return state;\n}\n\n/***\n * Reconcile presentation in place and relayout only when graph geometry or layout policy changes.\n * Batch reconciliation and skip layout for presentation-only updates.\n */\nfunction updateRuntime(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n if (state.cy.destroyed()) return;\n const last = state.latestUpdateRef.current;\n const acceptsSpacing =\n state.optimizedSpacingRef.current !== null &&\n state.optimizedSpacingRef.current === input.spacingFactor;\n const previous = acceptsSpacing && last ? { ...last, spacingFactor: input.spacingFactor } : last;\n if (acceptsSpacing) state.optimizedSpacingRef.current = null;\n state.latestUpdateRef.current = input;\n state.fitPaddingRef.current = input.fitPadding ?? 50;\n state.viewport.configure(input);\n const preservesTopology = shouldPreserveTopology(state, previous, input);\n beginPreservedTopologyMeasurementWindow(state, previous, input, preservesTopology);\n const retainedNodeIds = getRetainedNodeIds(previous, input, preservesTopology);\n const retainedGeometry =\n retainedNodeIds === null ? null : getGraphGeometryKey(state.cy, retainedNodeIds);\n state.cy.batch(() => {\n if (previous?.nodes !== input.nodes || previous.edges !== input.edges) {\n syncGraphElements(state.cy, input.nodes, input.edges);\n if (preservesTopology) placeAddedGraphNodes(state.cy, previous?.nodes ?? [], input.nodes);\n }\n if (\n previous?.styleRules !== input.styleRules ||\n previous?.richNodeRendering !== input.richNodeRendering\n ) {\n state.loopSizer.reset();\n applyGraphStyles(state.cy, input.styleRules, input.richNodeRendering);\n }\n });\n sizeGraphNodesToLabels(\n state.cy,\n state.labelSizedNodeIds,\n input.sizeNodesToLabels === true && !input.richNodeRendering,\n );\n applyKnownNodeSizes(state);\n state.loopSizer.update();\n const geometry = getGraphGeometryKey(state.cy);\n // Keep native double-press targets stable for paint-only class changes. A class that changes\n // measured node dimensions remains a geometry change and must relayout.\n const geometryChanged =\n retainedGeometry === null\n ? geometry !== state.geometryRef.current\n : retainedGeometry !== getGraphGeometryKey(state.cy, retainedNodeIds ?? undefined);\n const relayout = hasGraphLayoutChanged(previous, input, preservesTopology) || geometryChanged;\n state.geometryRef.current = geometry;\n if (!relayout) {\n if (\n previous?.zoomMode !== input.zoomMode ||\n previous?.fitPadding !== input.fitPadding ||\n previous?.minZoom !== input.minZoom ||\n previous?.maxZoom !== input.maxZoom ||\n previous?.minReadableLabelSize !== input.minReadableLabelSize ||\n previous?.maxFitLabelSize !== input.maxFitLabelSize\n ) {\n state.viewport.settle(previous?.zoomMode !== input.zoomMode);\n }\n emitRenderedNodes(state);\n return;\n }\n stopCurrentLayout(state);\n state.fitRequestRef.current = null;\n state.optimizedSpacingRef.current = null;\n startCurrentLayout(state, input);\n}\n\n/*** Preserve only opt-in topology updates after the initial layout and fit have settled. */\nfunction shouldPreserveTopology(\n state: GraphRuntimeState,\n previous: GraphRuntimeUpdate | null,\n input: GraphRuntimeUpdate,\n): boolean {\n return (\n previous !== null &&\n state.readyRef.current &&\n !state.pendingInitialFitRef.current &&\n input.topologyUpdatePolicy === 'preserve-positions'\n );\n}\n\n/***\n * Retain measurements emitted by the overlay commit that follows one controlled topology update.\n * A later resize remains geometry input and therefore schedules its normal relayout.\n */\nfunction beginPreservedTopologyMeasurementWindow(\n state: GraphRuntimeState,\n previous: GraphRuntimeUpdate | null,\n input: GraphRuntimeUpdate,\n preservesTopology: boolean,\n) {\n const topologyChanged =\n previous !== null &&\n getGraphTopologyKey(previous.nodes, previous.edges) !==\n getGraphTopologyKey(input.nodes, input.edges);\n state.preservedTopologyMeasurementRef.current = preservesTopology && topologyChanged;\n if (!state.preservedTopologyMeasurementRef.current) return;\n scheduleGraphFrame(() => {\n state.preservedTopologyMeasurementRef.current = false;\n });\n}\n\n/*** Limit stable-update geometry checks to nodes that existed before reconciliation. */\nfunction getRetainedNodeIds(\n previous: GraphRuntimeUpdate | null,\n input: GraphRuntimeUpdate,\n preservesTopology: boolean,\n): ReadonlySet<string> | null {\n if (!preservesTopology || previous === null) return null;\n const nextNodeIds = new Set(input.nodes.map((node) => node.id));\n return new Set(previous.nodes.map((node) => node.id).filter((id) => nextNodeIds.has(id)));\n}\n\n/*** Start a generation-safe layout whose completion is the only normal automatic fit trigger. */\nfunction startCurrentLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n if (!state.readyRef.current) {\n scheduleInitialLayout(state);\n return;\n }\n startGraphLayout(state, input);\n}\n\n/*** Coalesce progressive pre-ready topology updates before the initial layout can complete. */\nfunction scheduleInitialLayout(state: GraphRuntimeState) {\n if (state.initialLayoutScheduledRef.current) return;\n state.initialLayoutScheduledRef.current = true;\n scheduleGraphFrame(() => {\n scheduleGraphFrame(() => {\n state.initialLayoutScheduledRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null || state.cy.destroyed() || state.readyRef.current) return;\n startGraphLayout(state, input);\n });\n });\n}\n\n/*** Start one layout generation after its input has reached the runtime owner. */\nfunction startGraphLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate) {\n state.pendingInitialFitRef.current = false;\n const generation = state.generationRef.current + 1;\n state.generationRef.current = generation;\n state.layoutRunningRef.current = true;\n state.cy.resize();\n state.layoutRef.current = runGraphLayout(\n state.cy,\n {\n layout: input.layout ?? 'concentric',\n layoutOptions: input.layoutOptions,\n spacingFactor: input.spacingFactor ?? 1,\n },\n () => completeCurrentLayout(state, generation),\n );\n}\n\n/***\n * Settle only the latest layout generation and fit once from node bounds.\n * Discard stale completions and avoid repeated automatic fits.\n */\nfunction completeCurrentLayout(state: GraphRuntimeState, generation: number) {\n scheduleGraphFrame(() => {\n if (state.cy.destroyed() || generation !== state.generationRef.current) return;\n state.loopSizer.update();\n state.layoutRef.current = null;\n state.cy.resize();\n state.layoutRunningRef.current = false;\n state.resizeObserver?.flushAfterLayout();\n if (!hasUsableViewport(state.cy)) {\n if (!state.readyRef.current) state.pendingInitialFitRef.current = true;\n return;\n }\n state.pendingInitialFitRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null) return;\n const topology = getGraphTopologyKey(input.nodes, input.edges);\n const shouldFit = shouldFitGraphAfterLayout(\n state.readyRef.current,\n topology !== state.settledTopologyRef.current,\n input.layout !== state.settledLayoutRef.current,\n );\n state.viewport.settle(shouldFit);\n state.settledLayoutRef.current = input.layout;\n state.settledTopologyRef.current = topology;\n const fitRequest = state.fitRequestRef.current;\n state.fitRequestRef.current = null;\n if (fitRequest) requestOptimizedFit(state, fitRequest);\n emitRenderedNodes(state);\n\n if (!state.readyRef.current) {\n state.readyRef.current = true;\n state.callbacksRef.current.onReady?.(state.controller);\n }\n state.callbacksRef.current.onLayoutComplete?.(state.controller);\n });\n}\n\n/***\n * Handle explicit readable-fit intent in the runtime owner, never from zoom or React effects.\n * Bounded spacing optimization preserves the settled algorithm instead of repeatedly running it.\n */\nfunction requestOptimizedFit(state: GraphRuntimeState, options: GraphViewFitOptions) {\n if (state.cy.destroyed()) return;\n if (state.layoutRunningRef.current) {\n state.fitRequestRef.current = options;\n return;\n }\n const input = state.latestUpdateRef.current;\n if (!input) return;\n const previous = state.optimizedSpacingRef.current ?? input.spacingFactor ?? 1;\n const spacing = compactGraphSpacing(state.cy, previous, {\n fitPadding: options.padding ?? state.fitPaddingRef.current,\n maxFitZoom: state.viewport.getFitZoomLimit(),\n minReadableZoom: state.viewport.getReadableZoomTarget(),\n });\n state.geometryRef.current = getGraphGeometryKey(state.cy);\n state.loopSizer.update();\n state.viewport.settle(false);\n state.controller.fit({ ...options, optimizeSpacing: false });\n if (spacing !== previous) {\n state.optimizedSpacingRef.current = spacing;\n state.callbacksRef.current.onSpacingFactorChange?.(spacing);\n }\n emitRenderedNodes(state);\n}\n\n/*** Stop the current layout and invalidate every stale completion callback. */\nfunction stopCurrentLayout(state: GraphRuntimeState) {\n state.generationRef.current += 1;\n state.layoutRunningRef.current = false;\n state.layoutRef.current?.stop();\n state.layoutRef.current = null;\n}\n\n/*** Apply consumer styles and hide native node paint only when React rich nodes are active. */\nfunction applyGraphStyles(\n cy: Core,\n rules: readonly GraphViewStyleRule[] | undefined,\n richNodeRendering: boolean,\n) {\n const styles = [...(rules ?? [])];\n if (richNodeRendering) {\n styles.push({\n selector: 'node',\n style: {\n 'background-opacity': 0,\n 'border-width': 0,\n label: '',\n 'overlay-opacity': 0,\n },\n });\n }\n if (styles.length > 0) cy.style(styles).update();\n}\n\n/***\n * Synchronize controlled selection without rerunning layout.\n * Selection updates must not trigger graph reconstruction or layout.\n */\nfunction setSelectedNodeIds(state: GraphRuntimeState, nodeIds: readonly string[] | undefined) {\n if (state.cy.destroyed() || nodeIds === undefined) return;\n const selectedIds = new Set(nodeIds);\n state.cy.nodes().forEach((node) => {\n if (selectedIds.has(node.id())) node.select();\n else node.unselect();\n });\n emitRenderedNodes(state);\n}\n\n/***\n * Persist one rich-node size and schedule at most one relayout for changed geometry.\n * Ignore unchanged measurements before scheduling layout work.\n */\nfunction setNodeSize(state: GraphRuntimeState, id: string, size: GraphViewSize) {\n const previous = state.nodeSizes.get(id);\n if (previous?.width === size.width && previous.height === size.height) return;\n state.nodeSizes.set(id, size);\n applyNodeSize(state.cy, id, size);\n if (state.preservedTopologyMeasurementRef.current) return;\n scheduleMeasuredNodeRelayout(state);\n}\n\n/*** Apply every known rich-node size after Cytoscape elements are replaced. */\nfunction applyKnownNodeSizes(state: GraphRuntimeState) {\n for (const [id, size] of state.nodeSizes) applyNodeSize(state.cy, id, size);\n}\n\n/*** Apply one measured model-space size as a Cytoscape per-node style bypass. */\nfunction applyNodeSize(cy: Core, id: string, size: GraphViewSize) {\n const node = cy.getElementById(id);\n if (node.empty()) return;\n node.style({ height: size.height, width: size.width });\n}\n\n/***\n * Coalesce DOM measurements into one follow-up layout generation.\n * Keep one scheduled layout per frame instead of one per measured node.\n */\nfunction scheduleMeasuredNodeRelayout(state: GraphRuntimeState) {\n if (state.relayoutScheduledRef.current) return;\n state.relayoutScheduledRef.current = true;\n scheduleGraphFrame(() => {\n state.relayoutScheduledRef.current = false;\n const input = state.latestUpdateRef.current;\n if (input === null || state.cy.destroyed()) return;\n stopCurrentLayout(state);\n startCurrentLayout(state, input);\n });\n}\n\n/*** Subscribe one React overlay to rendered node state without exposing the Cytoscape core. */\nfunction subscribeRenderedNodes(state: GraphRuntimeState, listener: RenderedNodeListener) {\n state.renderedNodeListeners.add(listener);\n listener(readGraphRenderedNodes(state.cy, state.hoveredNodeIds));\n return () => {\n state.renderedNodeListeners.delete(listener);\n };\n}\n\n/***\n * Publish current rendered node positions only to active rich-node subscribers.\n * Skip snapshot preparation when no overlay is subscribed.\n */\nfunction emitRenderedNodes(\n state: Pick<GraphRuntimeState, 'cy' | 'hoveredNodeIds' | 'renderedNodeListeners'>,\n) {\n if (state.renderedNodeListeners.size === 0) return;\n const nodes = readGraphRenderedNodes(state.cy, state.hoveredNodeIds);\n for (const listener of state.renderedNodeListeners) listener(nodes);\n}\n\n/*** Translate one rich-overlay event back into normal graph selection and callbacks. */\nfunction handleOverlayNodeEvent(\n state: GraphRuntimeState,\n id: string,\n type: GraphViewElementEventType,\n selectionIntent?: SelectionIntent,\n) {\n if (type === 'pointer-enter') state.hoveredNodeIds.add(id);\n if (type === 'pointer-leave') state.hoveredNodeIds.delete(id);\n if (type === 'press') state.cy.getElementById(id).select();\n state.callbacksRef.current.onNodeEvent?.({ id, type, selectionIntent });\n emitRenderedNodes(state);\n}\n\n/*** Return whether Cytoscape currently has dimensions suitable for fitting. */\nfunction hasUsableViewport(cy: Core): boolean {\n return cy.width() > 0 && cy.height() > 0;\n}\n\n/*** Dispose all runtime resources in the reverse order they were acquired. */\nfunction destroyRuntime(state: GraphRuntimeState) {\n state.resizeObserver?.disconnect();\n stopCurrentLayout(state);\n state.unbindEvents();\n state.renderedNodeListeners.clear();\n if (!state.cy.destroyed()) state.cy.destroy();\n}\n\nregisterGraphLayouts();\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GridViewProps } from '../../../../types/grid-view';
|
|
3
3
|
/*** Renders a controlled or uncontrolled, virtualized 2D world through the canonical grid viewport engine. */
|
|
4
|
-
export declare function GridView({ items, contentWidth, contentHeight, width, height, viewport: controlledViewport, defaultViewport, viewportConstraints, zoomLimits, zoom, overscanPixels, focusedItemId, revealPaddingPixels, interactionPolicy, onViewportChange, onVisibleItemIdsChange, renderItem, testID, }: GridViewProps): React.JSX.Element;
|
|
4
|
+
export declare function GridView({ items, contentWidth, contentHeight, width, height, viewport: controlledViewport, defaultViewport, viewportConstraints, zoomLimits, zoom, overscanPixels, focusedItemId, revealPaddingPixels, interactionPolicy, onViewportChange, onVisibleItemIdsChange, renderItem, testID, viewportInteraction, }: GridViewProps): React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=GridView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridView.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-view/adapters/inbound/GridView.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAkC,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAkBjG,8GAA8G;AAC9G,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,KAAK,EACL,MAAM,EACN,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,IAAQ,EACR,cAAoB,EACpB,aAAa,EACb,mBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"GridView.d.ts","sourceRoot":"","sources":["../../../../../src/features/grid-view/adapters/inbound/GridView.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAkC,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAkBjG,8GAA8G;AAC9G,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,KAAK,EACL,MAAM,EACN,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,IAAQ,EACR,cAAoB,EACpB,aAAa,EACb,mBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,MAAM,EACN,mBAA+B,GAChC,EAAE,aAAa,qBAoYf"}
|