@effectiveailabs/design-system 0.0.0-stage → 1.0.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 +7 -0
- package/README.md +120 -2
- package/dist/components/AdaptiveGrid/AdaptiveGrid.d.ts +38 -0
- package/dist/components/AdaptiveGrid/AdaptiveGrid.js +15 -0
- package/dist/components/AdaptiveGrid/AdaptiveGrid.stylex.d.ts +104 -0
- package/dist/components/AdaptiveGrid/AdaptiveGrid.stylex.js +62 -0
- package/dist/components/Anchor/Anchor.d.ts +29 -0
- package/dist/components/Anchor/Anchor.js +56 -0
- package/dist/components/AnimatedNumber/AnimatedNumber.d.ts +16 -0
- package/dist/components/AnimatedNumber/AnimatedNumber.js +45 -0
- package/dist/components/AnimatedNumber/AnimatedNumber.stylex.d.ts +6 -0
- package/dist/components/AnimatedNumber/AnimatedNumber.stylex.js +7 -0
- package/dist/components/AnnotationPin/AnnotationOutlet.d.ts +15 -0
- package/dist/components/AnnotationPin/AnnotationOutlet.js +15 -0
- package/dist/components/AnnotationPin/AnnotationPin.d.ts +31 -0
- package/dist/components/AnnotationPin/AnnotationPin.js +99 -0
- package/dist/components/AnnotationPin/AnnotationPin.layout.d.ts +19 -0
- package/dist/components/AnnotationPin/AnnotationPin.layout.js +56 -0
- package/dist/components/AnnotationPin/AnnotationPin.stylex.d.ts +48 -0
- package/dist/components/AnnotationPin/AnnotationPin.stylex.js +39 -0
- package/dist/components/AnnotationPin/AnnotationScope.d.ts +26 -0
- package/dist/components/AnnotationPin/AnnotationScope.js +59 -0
- package/dist/components/AnnotationPin/AnnotationScope.layout.d.ts +15 -0
- package/dist/components/AnnotationPin/AnnotationScope.layout.js +68 -0
- package/dist/components/AnnotationPin/useRangeAnchor.d.ts +9 -0
- package/dist/components/AnnotationPin/useRangeAnchor.js +35 -0
- package/dist/components/App/App.d.ts +85 -0
- package/dist/components/App/App.js +515 -0
- package/dist/components/App/App.layout.d.ts +25 -0
- package/dist/components/App/App.layout.js +42 -0
- package/dist/components/App/App.stylex.d.ts +373 -0
- package/dist/components/App/App.stylex.js +352 -0
- package/dist/components/App/AppNavigationHeader.context.d.ts +9 -0
- package/dist/components/App/AppNavigationHeader.context.js +13 -0
- package/dist/components/Article/Article.d.ts +16 -0
- package/dist/components/Article/Article.js +14 -0
- package/dist/components/Article/Article.stylex.d.ts +49 -0
- package/dist/components/Article/Article.stylex.js +66 -0
- package/dist/components/Article/ArticleSection.d.ts +23 -0
- package/dist/components/Article/ArticleSection.js +26 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts +13 -0
- package/dist/components/Autocomplete/Autocomplete.gridFocus.d.ts +9 -0
- package/dist/components/Autocomplete/Autocomplete.gridFocus.js +5 -0
- package/dist/components/Autocomplete/Autocomplete.js +68 -0
- package/dist/components/Avatar/Avatar.d.ts +30 -0
- package/dist/components/Avatar/Avatar.js +14 -0
- package/dist/components/Avatar/Avatar.stylex.d.ts +74 -0
- package/dist/components/Avatar/Avatar.stylex.js +71 -0
- package/dist/components/Avatar/Avatar.view.d.ts +7 -0
- package/dist/components/Avatar/Avatar.view.js +43 -0
- package/dist/components/Avatar/AvatarName.d.ts +7 -0
- package/dist/components/Avatar/AvatarName.js +17 -0
- package/dist/components/Avatar/avatarColor.d.ts +3 -0
- package/dist/components/Avatar/avatarColor.js +28 -0
- package/dist/components/Avatar/avatarInitials.d.ts +1 -0
- package/dist/components/Avatar/avatarInitials.js +37 -0
- package/dist/components/AvatarGroup/AvatarGroup.children.d.ts +11 -0
- package/dist/components/AvatarGroup/AvatarGroup.children.js +52 -0
- package/dist/components/AvatarGroup/AvatarGroup.context.d.ts +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.context.js +2 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +16 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +188 -0
- package/dist/components/AvatarGroup/AvatarGroup.stylex.d.ts +149 -0
- package/dist/components/AvatarGroup/AvatarGroup.stylex.js +132 -0
- package/dist/components/AvatarGroup/avatarGroupLayout.d.ts +14 -0
- package/dist/components/AvatarGroup/avatarGroupLayout.js +27 -0
- package/dist/components/Badge/Badge.d.ts +54 -0
- package/dist/components/Badge/Badge.js +149 -0
- package/dist/components/Badge/Badge.stylex.d.ts +278 -0
- package/dist/components/Badge/Badge.stylex.js +267 -0
- package/dist/components/BrandLogo/BrandLogo.d.ts +16 -0
- package/dist/components/BrandLogo/BrandLogo.js +19 -0
- package/dist/components/BrandLogo/BrandLogo.stylex.d.ts +23 -0
- package/dist/components/BrandLogo/BrandLogo.stylex.js +14 -0
- package/dist/components/BrandLogo/brandLogoArtwork.d.ts +10 -0
- package/dist/components/BrandLogo/brandLogoArtwork.js +30 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.children.d.ts +14 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.children.js +59 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +24 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.headerContext.d.ts +20 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.headerContext.js +14 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +284 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.layout.d.ts +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.layout.js +29 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.stylex.d.ts +200 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.stylex.js +166 -0
- package/dist/components/Button/Button.appearance.d.ts +323 -0
- package/dist/components/Button/Button.appearance.js +57 -0
- package/dist/components/Button/Button.d.ts +102 -0
- package/dist/components/Button/Button.js +176 -0
- package/dist/components/Button/Button.stylex.d.ts +577 -0
- package/dist/components/Button/Button.stylex.js +590 -0
- package/dist/components/Button/ButtonProgress.d.ts +1 -0
- package/dist/components/Button/ButtonProgress.js +8 -0
- package/dist/components/Button/ButtonProgress.stylex.d.ts +22 -0
- package/dist/components/Button/ButtonProgress.stylex.js +14 -0
- package/dist/components/ButtonGroup/ButtonGroup.context.d.ts +74 -0
- package/dist/components/ButtonGroup/ButtonGroup.context.js +25 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +35 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +49 -0
- package/dist/components/ButtonGroup/ButtonGroup.stylex.d.ts +111 -0
- package/dist/components/ButtonGroup/ButtonGroup.stylex.js +116 -0
- package/dist/components/CalculationSteps/CalculationSteps.d.ts +13 -0
- package/dist/components/CalculationSteps/CalculationSteps.format.d.ts +13 -0
- package/dist/components/CalculationSteps/CalculationSteps.format.js +44 -0
- package/dist/components/CalculationSteps/CalculationSteps.js +84 -0
- package/dist/components/CalculationSteps/CalculationSteps.stylex.d.ts +23 -0
- package/dist/components/CalculationSteps/CalculationSteps.stylex.js +22 -0
- package/dist/components/CalculationSteps/CalculationSteps.types.d.ts +131 -0
- package/dist/components/CalculationSteps/CalculationSteps.types.js +11 -0
- package/dist/components/Calendar/Calendar.d.ts +22 -0
- package/dist/components/Calendar/Calendar.js +119 -0
- package/dist/components/Calendar/Calendar.stylex.d.ts +196 -0
- package/dist/components/Calendar/Calendar.stylex.js +197 -0
- package/dist/components/Card/Card.context.d.ts +28 -0
- package/dist/components/Card/Card.context.js +40 -0
- package/dist/components/Card/Card.d.ts +39 -0
- package/dist/components/Card/Card.js +121 -0
- package/dist/components/Card/Card.stylex.d.ts +172 -0
- package/dist/components/Card/Card.stylex.js +185 -0
- package/dist/components/Chart/Chart.d.ts +24 -0
- package/dist/components/Chart/Chart.data.d.ts +119 -0
- package/dist/components/Chart/Chart.data.js +596 -0
- package/dist/components/Chart/Chart.describe.d.ts +46 -0
- package/dist/components/Chart/Chart.describe.js +359 -0
- package/dist/components/Chart/Chart.environment.d.ts +8 -0
- package/dist/components/Chart/Chart.environment.js +10 -0
- package/dist/components/Chart/Chart.format.d.ts +14 -0
- package/dist/components/Chart/Chart.format.js +108 -0
- package/dist/components/Chart/Chart.highcharts.d.ts +106 -0
- package/dist/components/Chart/Chart.highcharts.js +1001 -0
- package/dist/components/Chart/Chart.js +600 -0
- package/dist/components/Chart/Chart.load.d.ts +69 -0
- package/dist/components/Chart/Chart.load.js +136 -0
- package/dist/components/Chart/Chart.raw.d.ts +33 -0
- package/dist/components/Chart/Chart.raw.js +234 -0
- package/dist/components/Chart/Chart.rules.d.ts +31 -0
- package/dist/components/Chart/Chart.rules.js +72 -0
- package/dist/components/Chart/Chart.stylex.d.ts +260 -0
- package/dist/components/Chart/Chart.stylex.js +280 -0
- package/dist/components/Chart/Chart.types.d.ts +380 -0
- package/dist/components/Chart/Chart.types.js +23 -0
- package/dist/components/Chart/ChartDataTable.d.ts +9 -0
- package/dist/components/Chart/ChartDataTable.js +42 -0
- package/dist/components/Chart/ChartGhost.d.ts +17 -0
- package/dist/components/Chart/ChartGhost.js +13 -0
- package/dist/components/Chart/ChartHighcharts.d.ts +6 -0
- package/dist/components/Chart/ChartHighcharts.js +61 -0
- package/dist/components/Chart/ChartLegend.d.ts +23 -0
- package/dist/components/Chart/ChartLegend.js +111 -0
- package/dist/components/Chart/ChartMarks.d.ts +29 -0
- package/dist/components/Chart/ChartMarks.js +29 -0
- package/dist/components/Chart/ChartScrollbar.d.ts +13 -0
- package/dist/components/Chart/ChartScrollbar.js +63 -0
- package/dist/components/Chart/ChartTip.d.ts +5 -0
- package/dist/components/Chart/ChartTip.js +7 -0
- package/dist/components/Checkbox/Checkbox.d.ts +81 -0
- package/dist/components/Checkbox/Checkbox.js +52 -0
- package/dist/components/CodeBlock/CodeBlock.copy.d.ts +7 -0
- package/dist/components/CodeBlock/CodeBlock.copy.js +28 -0
- package/dist/components/CodeBlock/CodeBlock.copyButton.d.ts +20 -0
- package/dist/components/CodeBlock/CodeBlock.copyButton.js +40 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +88 -0
- package/dist/components/CodeBlock/CodeBlock.fence.d.ts +24 -0
- package/dist/components/CodeBlock/CodeBlock.fence.js +110 -0
- package/dist/components/CodeBlock/CodeBlock.js +148 -0
- package/dist/components/CodeBlock/CodeBlock.marks.d.ts +24 -0
- package/dist/components/CodeBlock/CodeBlock.marks.js +54 -0
- package/dist/components/CodeBlock/CodeBlock.ranges.d.ts +15 -0
- package/dist/components/CodeBlock/CodeBlock.ranges.js +30 -0
- package/dist/components/CodeBlock/CodeBlock.stylex.d.ts +221 -0
- package/dist/components/CodeBlock/CodeBlock.stylex.js +194 -0
- package/dist/components/CodeBlock/CodeBlock.tokens.d.ts +47 -0
- package/dist/components/CodeBlock/CodeBlock.tokens.js +103 -0
- package/dist/components/CodeBlock/CodeGroup.context.d.ts +5 -0
- package/dist/components/CodeBlock/CodeGroup.context.js +6 -0
- package/dist/components/CodeBlock/CodeGroup.d.ts +19 -0
- package/dist/components/CodeBlock/CodeGroup.js +39 -0
- package/dist/components/CodeBlock/CodeHighlightScope.d.ts +39 -0
- package/dist/components/CodeBlock/CodeHighlightScope.js +70 -0
- package/dist/components/CodeEntry/CodeEntry.d.ts +62 -0
- package/dist/components/CodeEntry/CodeEntry.js +86 -0
- package/dist/components/CodeField/CodeField.d.ts +32 -0
- package/dist/components/CodeField/CodeField.js +25 -0
- package/dist/components/CodeField/CodeField.stylex.d.ts +82 -0
- package/dist/components/CodeField/CodeField.stylex.js +88 -0
- package/dist/components/Collection/Collection.constants.d.ts +3 -0
- package/dist/components/Collection/Collection.constants.js +3 -0
- package/dist/components/Collection/Collection.context.d.ts +70 -0
- package/dist/components/Collection/Collection.context.js +39 -0
- package/dist/components/Collection/Collection.d.ts +119 -0
- package/dist/components/Collection/Collection.dnd.d.ts +19 -0
- package/dist/components/Collection/Collection.dnd.js +56 -0
- package/dist/components/Collection/Collection.dragScroll.d.ts +2 -0
- package/dist/components/Collection/Collection.dragScroll.js +93 -0
- package/dist/components/Collection/Collection.identity.d.ts +3 -0
- package/dist/components/Collection/Collection.identity.js +10 -0
- package/dist/components/Collection/Collection.js +479 -0
- package/dist/components/Collection/Collection.pageLoadMore.d.ts +2 -0
- package/dist/components/Collection/Collection.pageLoadMore.js +21 -0
- package/dist/components/Collection/Collection.stylex.d.ts +1033 -0
- package/dist/components/Collection/Collection.stylex.js +1095 -0
- package/dist/components/Collection/CollectionItemContent.d.ts +9 -0
- package/dist/components/Collection/CollectionItemContent.js +11 -0
- package/dist/components/Collection/CollectionVirtualizer.context.d.ts +9 -0
- package/dist/components/Collection/CollectionVirtualizer.context.js +2 -0
- package/dist/components/Collection/OutlinePreview.d.ts +12 -0
- package/dist/components/Collection/OutlinePreview.js +32 -0
- package/dist/components/CollectionViews/CollectionViews.context.d.ts +8 -0
- package/dist/components/CollectionViews/CollectionViews.context.js +9 -0
- package/dist/components/CollectionViews/CollectionViews.d.ts +42 -0
- package/dist/components/CollectionViews/CollectionViews.js +53 -0
- package/dist/components/ComboBox/ComboBox.collection.d.ts +5 -0
- package/dist/components/ComboBox/ComboBox.collection.js +40 -0
- package/dist/components/ComboBox/ComboBox.d.ts +50 -0
- package/dist/components/ComboBox/ComboBox.js +98 -0
- package/dist/components/ComboBox/ComboBox.stylex.d.ts +45 -0
- package/dist/components/ComboBox/ComboBox.stylex.js +34 -0
- package/dist/components/ContainerSize/ContainerSize.d.ts +27 -0
- package/dist/components/ContainerSize/ContainerSize.js +51 -0
- package/dist/components/ContainerSize/ContainerSize.stylex.d.ts +13 -0
- package/dist/components/ContainerSize/ContainerSize.stylex.js +16 -0
- package/dist/components/Content/Content.context.d.ts +3 -0
- package/dist/components/Content/Content.context.js +3 -0
- package/dist/components/Content/Content.d.ts +33 -0
- package/dist/components/Content/Content.js +36 -0
- package/dist/components/Content/Content.stylex.d.ts +65 -0
- package/dist/components/Content/Content.stylex.js +69 -0
- package/dist/components/Content/HeaderSlots.d.ts +9 -0
- package/dist/components/Content/HeaderSlots.js +22 -0
- package/dist/components/ContentOrientation/ContentOrientation.context.d.ts +2 -0
- package/dist/components/ContentOrientation/ContentOrientation.context.js +2 -0
- package/dist/components/ControlSize/ControlSize.context.d.ts +3 -0
- package/dist/components/ControlSize/ControlSize.context.js +6 -0
- package/dist/components/Countdown/Countdown.d.ts +16 -0
- package/dist/components/Countdown/Countdown.js +30 -0
- package/dist/components/Countdown/Countdown.stylex.d.ts +11 -0
- package/dist/components/Countdown/Countdown.stylex.js +10 -0
- package/dist/components/CoverageTower/CoverageTower.axis.d.ts +28 -0
- package/dist/components/CoverageTower/CoverageTower.axis.js +28 -0
- package/dist/components/CoverageTower/CoverageTower.block.d.ts +39 -0
- package/dist/components/CoverageTower/CoverageTower.block.js +112 -0
- package/dist/components/CoverageTower/CoverageTower.d.ts +14 -0
- package/dist/components/CoverageTower/CoverageTower.js +284 -0
- package/dist/components/CoverageTower/CoverageTower.layout.d.ts +158 -0
- package/dist/components/CoverageTower/CoverageTower.layout.js +243 -0
- package/dist/components/CoverageTower/CoverageTower.stylex.d.ts +404 -0
- package/dist/components/CoverageTower/CoverageTower.stylex.js +525 -0
- package/dist/components/CoverageTower/CoverageTower.types.d.ts +172 -0
- package/dist/components/CoverageTower/CoverageTower.types.js +3 -0
- package/dist/components/DateField/DateField.d.ts +61 -0
- package/dist/components/DateField/DateField.js +66 -0
- package/dist/components/DateRangeField/DateRangeField.d.ts +60 -0
- package/dist/components/DateRangeField/DateRangeField.js +68 -0
- package/dist/components/Dialog/Dialog.context.d.ts +6 -0
- package/dist/components/Dialog/Dialog.context.js +3 -0
- package/dist/components/Dialog/Dialog.d.ts +15 -0
- package/dist/components/Dialog/Dialog.js +25 -0
- package/dist/components/Dialog/Dialog.stylex.d.ts +23 -0
- package/dist/components/Dialog/Dialog.stylex.js +20 -0
- package/dist/components/Disclosure/Disclosure.d.ts +5 -0
- package/dist/components/Disclosure/Disclosure.js +119 -0
- package/dist/components/Disclosure/Disclosure.stylex.d.ts +161 -0
- package/dist/components/Disclosure/Disclosure.stylex.js +143 -0
- package/dist/components/Disclosure/Disclosure.types.d.ts +96 -0
- package/dist/components/Disclosure/Disclosure.types.js +4 -0
- package/dist/components/Disclosure/DisclosureGroup.context.d.ts +2 -0
- package/dist/components/Disclosure/DisclosureGroup.context.js +2 -0
- package/dist/components/Disclosure/DisclosureGroup.d.ts +5 -0
- package/dist/components/Disclosure/DisclosureGroup.js +10 -0
- package/dist/components/DismissButton/Dismiss.context.d.ts +3 -0
- package/dist/components/DismissButton/Dismiss.context.js +10 -0
- package/dist/components/DismissButton/DismissButton.d.ts +16 -0
- package/dist/components/DismissButton/DismissButton.js +9 -0
- package/dist/components/DropZone/DropZone.d.ts +10 -0
- package/dist/components/DropZone/DropZone.js +16 -0
- package/dist/components/DropZone/DropZone.stylex.d.ts +32 -0
- package/dist/components/DropZone/DropZone.stylex.js +27 -0
- package/dist/components/EditableText/EditableText.d.ts +21 -0
- package/dist/components/EditableText/EditableText.js +63 -0
- package/dist/components/EditableText/EditableText.stylex.d.ts +108 -0
- package/dist/components/EditableText/EditableText.stylex.js +95 -0
- package/dist/components/FieldRow/FieldRow.d.ts +20 -0
- package/dist/components/FieldRow/FieldRow.js +17 -0
- package/dist/components/FieldRow/FieldRow.stylex.d.ts +30 -0
- package/dist/components/FieldRow/FieldRow.stylex.js +52 -0
- package/dist/components/FileCollectionViewer/FileCollectionViewer.d.ts +74 -0
- package/dist/components/FileCollectionViewer/FileCollectionViewer.js +193 -0
- package/dist/components/FileCollectionViewer/FileCollectionViewer.stylex.d.ts +47 -0
- package/dist/components/FileCollectionViewer/FileCollectionViewer.stylex.js +53 -0
- package/dist/components/FileContent/FileContent.context.d.ts +51 -0
- package/dist/components/FileContent/FileContent.context.js +45 -0
- package/dist/components/FileContent/FileContent.d.ts +66 -0
- package/dist/components/FileContent/FileContent.js +80 -0
- package/dist/components/FileContent/FileContent.markers.d.ts +7 -0
- package/dist/components/FileContent/FileContent.markers.js +28 -0
- package/dist/components/FileContent/FileContent.stylex.d.ts +152 -0
- package/dist/components/FileContent/FileContent.stylex.js +155 -0
- package/dist/components/FileContent/FileContentViewport.d.ts +42 -0
- package/dist/components/FileContent/FileContentViewport.js +117 -0
- package/dist/components/FileContent/FileDetails.d.ts +11 -0
- package/dist/components/FileContent/FileDetails.js +53 -0
- package/dist/components/FileContent/FileOutline.previews.d.ts +70 -0
- package/dist/components/FileContent/FileOutline.previews.js +278 -0
- package/dist/components/FileContent/FileOutlineRows.d.ts +21 -0
- package/dist/components/FileContent/FileOutlineRows.js +166 -0
- package/dist/components/FileContent/FileSelectionToolbarLayer.d.ts +13 -0
- package/dist/components/FileContent/FileSelectionToolbarLayer.js +125 -0
- package/dist/components/FileContent/FileStructure.d.ts +51 -0
- package/dist/components/FileContent/FileStructure.js +37 -0
- package/dist/components/FileExplorer/FileExplorer.browser.d.ts +58 -0
- package/dist/components/FileExplorer/FileExplorer.browser.js +274 -0
- package/dist/components/FileExplorer/FileExplorer.columns.d.ts +37 -0
- package/dist/components/FileExplorer/FileExplorer.columns.js +144 -0
- package/dist/components/FileExplorer/FileExplorer.columns.stylex.d.ts +95 -0
- package/dist/components/FileExplorer/FileExplorer.columns.stylex.js +95 -0
- package/dist/components/FileExplorer/FileExplorer.d.ts +33 -0
- package/dist/components/FileExplorer/FileExplorer.groups.d.ts +14 -0
- package/dist/components/FileExplorer/FileExplorer.groups.js +129 -0
- package/dist/components/FileExplorer/FileExplorer.hits.d.ts +12 -0
- package/dist/components/FileExplorer/FileExplorer.hits.js +51 -0
- package/dist/components/FileExplorer/FileExplorer.js +180 -0
- package/dist/components/FileExplorer/FileExplorer.stylex.d.ts +141 -0
- package/dist/components/FileExplorer/FileExplorer.stylex.js +132 -0
- package/dist/components/FileField/FileField.d.ts +24 -0
- package/dist/components/FileField/FileField.js +37 -0
- package/dist/components/FileField/FileField.stylex.d.ts +17 -0
- package/dist/components/FileField/FileField.stylex.js +18 -0
- package/dist/components/FileIcon/FileIcon.d.ts +25 -0
- package/dist/components/FileIcon/FileIcon.js +33 -0
- package/dist/components/FilePicker/FilePicker.d.ts +40 -0
- package/dist/components/FilePicker/FilePicker.js +155 -0
- package/dist/components/FilePicker/MovePicker.d.ts +13 -0
- package/dist/components/FilePicker/MovePicker.js +19 -0
- package/dist/components/FileScope/FileHeader.stylex.d.ts +8 -0
- package/dist/components/FileScope/FileHeader.stylex.js +9 -0
- package/dist/components/FileScope/FileScope.actions.d.ts +45 -0
- package/dist/components/FileScope/FileScope.actions.js +240 -0
- package/dist/components/FileScope/FileScope.cache.d.ts +12 -0
- package/dist/components/FileScope/FileScope.cache.js +25 -0
- package/dist/components/FileScope/FileScope.d.ts +163 -0
- package/dist/components/FileScope/FileScope.drag.d.ts +27 -0
- package/dist/components/FileScope/FileScope.drag.js +88 -0
- package/dist/components/FileScope/FileScope.entryActions.d.ts +32 -0
- package/dist/components/FileScope/FileScope.entryActions.js +121 -0
- package/dist/components/FileScope/FileScope.entryActions.stylex.d.ts +9 -0
- package/dist/components/FileScope/FileScope.entryActions.stylex.js +24 -0
- package/dist/components/FileScope/FileScope.js +132 -0
- package/dist/components/FileScope/FileScope.match.d.ts +8 -0
- package/dist/components/FileScope/FileScope.match.js +76 -0
- package/dist/components/FileScope/FileScope.plainText.d.ts +6 -0
- package/dist/components/FileScope/FileScope.plainText.js +34 -0
- package/dist/components/FileScope/FileScope.plainText.stylex.d.ts +14 -0
- package/dist/components/FileScope/FileScope.plainText.stylex.js +15 -0
- package/dist/components/FileScope/FileScope.queue.d.ts +20 -0
- package/dist/components/FileScope/FileScope.queue.js +81 -0
- package/dist/components/FileScope/FileScope.relative.d.ts +7 -0
- package/dist/components/FileScope/FileScope.relative.js +32 -0
- package/dist/components/FileScope/FileScope.search.d.ts +33 -0
- package/dist/components/FileScope/FileScope.search.js +105 -0
- package/dist/components/FileScope/FileScope.search.stylex.d.ts +7 -0
- package/dist/components/FileScope/FileScope.search.stylex.js +8 -0
- package/dist/components/FileScope/FileScope.share.d.ts +13 -0
- package/dist/components/FileScope/FileScope.share.js +159 -0
- package/dist/components/FileScope/FileScope.share.stylex.d.ts +18 -0
- package/dist/components/FileScope/FileScope.share.stylex.js +21 -0
- package/dist/components/FileScope/FileScope.types.d.ts +586 -0
- package/dist/components/FileScope/FileScope.types.js +6 -0
- package/dist/components/FileScope/FileScope.utils.d.ts +20 -0
- package/dist/components/FileScope/FileScope.utils.js +157 -0
- package/dist/components/FileScope/FileSourceError.d.ts +17 -0
- package/dist/components/FileScope/FileSourceError.js +24 -0
- package/dist/components/FileScope/FileStore.d.ts +178 -0
- package/dist/components/FileScope/FileStore.js +849 -0
- package/dist/components/FileThumbnail/FileThumbnail.d.ts +25 -0
- package/dist/components/FileThumbnail/FileThumbnail.js +242 -0
- package/dist/components/FileThumbnail/FileThumbnail.stylex.d.ts +38 -0
- package/dist/components/FileThumbnail/FileThumbnail.stylex.js +44 -0
- package/dist/components/FileTree/FileTree.d.ts +77 -0
- package/dist/components/FileTree/FileTree.entries.d.ts +29 -0
- package/dist/components/FileTree/FileTree.entries.js +97 -0
- package/dist/components/FileTree/FileTree.js +800 -0
- package/dist/components/FileTree/FileTree.stylex.d.ts +46 -0
- package/dist/components/FileTree/FileTree.stylex.js +60 -0
- package/dist/components/FileTrigger/FileSelection.context.d.ts +2 -0
- package/dist/components/FileTrigger/FileSelection.context.js +2 -0
- package/dist/components/FileTrigger/FileSelection.d.ts +13 -0
- package/dist/components/FileTrigger/FileSelection.js +31 -0
- package/dist/components/FileTrigger/FileTrigger.d.ts +9 -0
- package/dist/components/FileTrigger/FileTrigger.js +22 -0
- package/dist/components/FileViewer/FileViewer.chrome.d.ts +66 -0
- package/dist/components/FileViewer/FileViewer.chrome.js +126 -0
- package/dist/components/FileViewer/FileViewer.compact.d.ts +90 -0
- package/dist/components/FileViewer/FileViewer.compact.js +124 -0
- package/dist/components/FileViewer/FileViewer.compact.stylex.d.ts +138 -0
- package/dist/components/FileViewer/FileViewer.compact.stylex.js +140 -0
- package/dist/components/FileViewer/FileViewer.controls.d.ts +66 -0
- package/dist/components/FileViewer/FileViewer.controls.js +27 -0
- package/dist/components/FileViewer/FileViewer.d.ts +79 -0
- package/dist/components/FileViewer/FileViewer.edit.d.ts +63 -0
- package/dist/components/FileViewer/FileViewer.edit.js +209 -0
- package/dist/components/FileViewer/FileViewer.embedded.d.ts +49 -0
- package/dist/components/FileViewer/FileViewer.embedded.js +107 -0
- package/dist/components/FileViewer/FileViewer.frame.d.ts +92 -0
- package/dist/components/FileViewer/FileViewer.frame.js +36 -0
- package/dist/components/FileViewer/FileViewer.goTo.d.ts +13 -0
- package/dist/components/FileViewer/FileViewer.goTo.js +30 -0
- package/dist/components/FileViewer/FileViewer.js +846 -0
- package/dist/components/FileViewer/FileViewer.links.d.ts +18 -0
- package/dist/components/FileViewer/FileViewer.links.js +10 -0
- package/dist/components/FileViewer/FileViewer.present.d.ts +10 -0
- package/dist/components/FileViewer/FileViewer.present.js +36 -0
- package/dist/components/FileViewer/FileViewer.selection.d.ts +15 -0
- package/dist/components/FileViewer/FileViewer.selection.js +26 -0
- package/dist/components/FileViewer/FileViewer.sidebar.d.ts +24 -0
- package/dist/components/FileViewer/FileViewer.sidebar.js +53 -0
- package/dist/components/FileViewer/FileViewer.sidebar.stylex.d.ts +87 -0
- package/dist/components/FileViewer/FileViewer.sidebar.stylex.js +95 -0
- package/dist/components/FileViewer/FileViewer.skeleton.d.ts +27 -0
- package/dist/components/FileViewer/FileViewer.skeleton.js +80 -0
- package/dist/components/FileViewer/FileViewer.skeleton.stylex.d.ts +86 -0
- package/dist/components/FileViewer/FileViewer.skeleton.stylex.js +70 -0
- package/dist/components/FileViewer/FileViewer.stylex.d.ts +309 -0
- package/dist/components/FileViewer/FileViewer.stylex.js +306 -0
- package/dist/components/FileViewer/FileViewer.view.d.ts +61 -0
- package/dist/components/FileViewer/FileViewer.view.js +205 -0
- package/dist/components/FileViewer/FileViewer.view.stylex.d.ts +105 -0
- package/dist/components/FileViewer/FileViewer.view.stylex.js +109 -0
- package/dist/components/FileViewer/FileViewerHeaderTarget.d.ts +12 -0
- package/dist/components/FileViewer/FileViewerHeaderTarget.js +21 -0
- package/dist/components/FilterForm/FilterForm.context.d.ts +3 -0
- package/dist/components/FilterForm/FilterForm.context.js +3 -0
- package/dist/components/FilterForm/FilterForm.d.ts +6 -0
- package/dist/components/FilterForm/FilterForm.editor.d.ts +12 -0
- package/dist/components/FilterForm/FilterForm.editor.js +119 -0
- package/dist/components/FilterForm/FilterForm.js +125 -0
- package/dist/components/FilterForm/FilterForm.model.d.ts +9 -0
- package/dist/components/FilterForm/FilterForm.model.js +84 -0
- package/dist/components/FilterForm/FilterForm.options.d.ts +19 -0
- package/dist/components/FilterForm/FilterForm.options.js +89 -0
- package/dist/components/FilterForm/FilterForm.stylex.d.ts +17 -0
- package/dist/components/FilterForm/FilterForm.stylex.js +18 -0
- package/dist/components/FilterForm/FilterForm.types.d.ts +70 -0
- package/dist/components/FilterForm/FilterForm.types.js +1 -0
- package/dist/components/FlowFrame/FlowFrame.d.ts +11 -0
- package/dist/components/FlowFrame/FlowFrame.js +26 -0
- package/dist/components/FlowFrame/FlowFrame.stylex.d.ts +8 -0
- package/dist/components/FlowFrame/FlowFrame.stylex.js +8 -0
- package/dist/components/FocusContinuity/FocusContinuity.d.ts +8 -0
- package/dist/components/FocusContinuity/FocusContinuity.js +162 -0
- package/dist/components/FolderIcon/FolderIcon.d.ts +31 -0
- package/dist/components/FolderIcon/FolderIcon.js +34 -0
- package/dist/components/FolderIcon/FolderIcon.stylex.d.ts +9 -0
- package/dist/components/FolderIcon/FolderIcon.stylex.js +11 -0
- package/dist/components/FolderLabel/FolderLabel.d.ts +11 -0
- package/dist/components/FolderLabel/FolderLabel.js +9 -0
- package/dist/components/FolderLabel/FolderLabel.stylex.d.ts +19 -0
- package/dist/components/FolderLabel/FolderLabel.stylex.js +20 -0
- package/dist/components/ForEach/ForEach.d.ts +30 -0
- package/dist/components/ForEach/ForEach.data.d.ts +17 -0
- package/dist/components/ForEach/ForEach.data.js +32 -0
- package/dist/components/ForEach/ForEach.js +26 -0
- package/dist/components/Form/Form.context.d.ts +2 -0
- package/dist/components/Form/Form.context.js +5 -0
- package/dist/components/Form/Form.d.ts +16 -0
- package/dist/components/Form/Form.js +16 -0
- package/dist/components/Form/Form.stylex.d.ts +11 -0
- package/dist/components/Form/Form.stylex.js +12 -0
- package/dist/components/FormField/FormField.d.ts +25 -0
- package/dist/components/FormField/FormField.js +27 -0
- package/dist/components/FormField/FormField.stylex.d.ts +986 -0
- package/dist/components/FormField/FormField.stylex.js +1012 -0
- package/dist/components/Grid/Grid.d.ts +44 -0
- package/dist/components/Grid/Grid.js +212 -0
- package/dist/components/Grid/Grid.sections.d.ts +16 -0
- package/dist/components/Grid/Grid.sections.js +34 -0
- package/dist/components/Grid/Grid.stylex.d.ts +231 -0
- package/dist/components/Grid/Grid.stylex.js +235 -0
- package/dist/components/Grid/Grid.template.d.ts +6 -0
- package/dist/components/Grid/Grid.template.js +6 -0
- package/dist/components/HStack/HStack.d.ts +21 -0
- package/dist/components/HStack/HStack.js +13 -0
- package/dist/components/HStack/HStack.stylex.d.ts +174 -0
- package/dist/components/HStack/HStack.stylex.js +122 -0
- package/dist/components/Heading/Heading.context.d.ts +6 -0
- package/dist/components/Heading/Heading.context.js +12 -0
- package/dist/components/Heading/Heading.d.ts +15 -0
- package/dist/components/Heading/Heading.js +70 -0
- package/dist/components/Icon/FilledIcon.d.ts +5 -0
- package/dist/components/Icon/FilledIcon.js +12 -0
- package/dist/components/Icon/FilledIcon.stylex.d.ts +6 -0
- package/dist/components/Icon/FilledIcon.stylex.js +5 -0
- package/dist/components/Icon/Icon.d.ts +47 -0
- package/dist/components/Icon/Icon.js +101 -0
- package/dist/components/Icon/Icon.registry.d.ts +147 -0
- package/dist/components/Icon/Icon.registry.js +98 -0
- package/dist/components/Icon/Icon.stylex.d.ts +74 -0
- package/dist/components/Icon/Icon.stylex.js +63 -0
- package/dist/components/Icon/IconSlot.d.ts +18 -0
- package/dist/components/Icon/IconSlot.js +84 -0
- package/dist/components/Icon/badgedGlyph.d.ts +14 -0
- package/dist/components/Icon/badgedGlyph.js +23 -0
- package/dist/components/Icon/custom/BrandMarks.d.ts +12 -0
- package/dist/components/Icon/custom/BrandMarks.js +46 -0
- package/dist/components/Icon/custom/FileIcons.d.ts +27 -0
- package/dist/components/Icon/custom/FileIcons.js +117 -0
- package/dist/components/Icon/custom/FolderSearchInput.d.ts +6 -0
- package/dist/components/Icon/custom/FolderSearchInput.js +20 -0
- package/dist/components/Icon/custom/HighlighterOff.d.ts +2 -0
- package/dist/components/Icon/custom/HighlighterOff.js +7 -0
- package/dist/components/Icon/custom/LinkMarks.d.ts +74 -0
- package/dist/components/Icon/custom/LinkMarks.js +112 -0
- package/dist/components/Icon/custom/MessageSquareSearch.d.ts +5 -0
- package/dist/components/Icon/custom/MessageSquareSearch.js +10 -0
- package/dist/components/Icon/custom/PageRegions.d.ts +2 -0
- package/dist/components/Icon/custom/PageRegions.js +12 -0
- package/dist/components/Icon/custom/PanelExpand.d.ts +5 -0
- package/dist/components/Icon/custom/PanelExpand.js +12 -0
- package/dist/components/Icon/custom/SquareDashedPlus.d.ts +2 -0
- package/dist/components/Icon/custom/SquareDashedPlus.js +6 -0
- package/dist/components/Icon/getFileIconName.d.ts +11 -0
- package/dist/components/Icon/getFileIconName.js +140 -0
- package/dist/components/Icon/getLinkIconName.d.ts +23 -0
- package/dist/components/Icon/getLinkIconName.js +142 -0
- package/dist/components/IconButton/IconButton.d.ts +53 -0
- package/dist/components/IconButton/IconButton.js +116 -0
- package/dist/components/IconButton/IconButton.stylex.d.ts +88 -0
- package/dist/components/IconButton/IconButton.stylex.js +85 -0
- package/dist/components/Image/Image.d.ts +20 -0
- package/dist/components/Image/Image.js +45 -0
- package/dist/components/Image/Image.stylex.d.ts +70 -0
- package/dist/components/Image/Image.stylex.js +71 -0
- package/dist/components/ImageRedactor/ImageRedactor.d.ts +26 -0
- package/dist/components/ImageRedactor/ImageRedactor.js +56 -0
- package/dist/components/ImageRedactor/ImageRedactor.stylex.d.ts +49 -0
- package/dist/components/ImageRedactor/ImageRedactor.stylex.js +51 -0
- package/dist/components/Indicator/Indicator.d.ts +23 -0
- package/dist/components/Indicator/Indicator.js +105 -0
- package/dist/components/Indicator/Indicator.stylex.d.ts +181 -0
- package/dist/components/Indicator/Indicator.stylex.js +176 -0
- package/dist/components/InlineAlert/InlineAlert.d.ts +23 -0
- package/dist/components/InlineAlert/InlineAlert.js +54 -0
- package/dist/components/InlineAlert/InlineAlert.stylex.d.ts +105 -0
- package/dist/components/InlineAlert/InlineAlert.stylex.js +104 -0
- package/dist/components/IntentScope/IntentScope.d.ts +17 -0
- package/dist/components/IntentScope/IntentScope.js +19 -0
- package/dist/components/IntentScope/intentCoordinator.d.ts +12 -0
- package/dist/components/IntentScope/intentCoordinator.js +64 -0
- package/dist/components/IntentScope/useIntent.d.ts +12 -0
- package/dist/components/IntentScope/useIntent.js +47 -0
- package/dist/components/JsonValueView/JsonBlock.d.ts +31 -0
- package/dist/components/JsonValueView/JsonBlock.js +25 -0
- package/dist/components/JsonValueView/JsonCopyButton.d.ts +20 -0
- package/dist/components/JsonValueView/JsonCopyButton.js +37 -0
- package/dist/components/JsonValueView/JsonValueControls.d.ts +17 -0
- package/dist/components/JsonValueView/JsonValueControls.js +16 -0
- package/dist/components/JsonValueView/JsonValueExpandedView.d.ts +21 -0
- package/dist/components/JsonValueView/JsonValueExpandedView.js +20 -0
- package/dist/components/JsonValueView/JsonValueView.d.ts +38 -0
- package/dist/components/JsonValueView/JsonValueView.frame.d.ts +12 -0
- package/dist/components/JsonValueView/JsonValueView.frame.js +13 -0
- package/dist/components/JsonValueView/JsonValueView.js +98 -0
- package/dist/components/JsonValueView/JsonValueView.stylex.d.ts +65 -0
- package/dist/components/JsonValueView/JsonValueView.stylex.js +49 -0
- package/dist/components/JsonValueView/JsonValueView.tokens.d.ts +22 -0
- package/dist/components/JsonValueView/JsonValueView.tokens.js +20 -0
- package/dist/components/JsonValueView/JsonValueView.value.d.ts +25 -0
- package/dist/components/JsonValueView/JsonValueView.value.js +107 -0
- package/dist/components/JsonValueView/useJsonValueViewState.d.ts +20 -0
- package/dist/components/JsonValueView/useJsonValueViewState.js +54 -0
- package/dist/components/Keyboard/Keyboard.d.ts +14 -0
- package/dist/components/Keyboard/Keyboard.js +72 -0
- package/dist/components/Keyboard/Keyboard.stylex.d.ts +63 -0
- package/dist/components/Keyboard/Keyboard.stylex.js +64 -0
- package/dist/components/LazyGrid/LazyGrid.d.ts +11 -0
- package/dist/components/LazyGrid/LazyGrid.js +23 -0
- package/dist/components/LazyHStack/LazyHStack.d.ts +18 -0
- package/dist/components/LazyHStack/LazyHStack.js +11 -0
- package/dist/components/LazyList/LazyList.d.ts +11 -0
- package/dist/components/LazyList/LazyList.js +10 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.d.ts +4 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.js +192 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.range.d.ts +28 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.range.js +42 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.scroll.d.ts +7 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.scroll.js +27 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.sticky.d.ts +27 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.sticky.js +64 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.stylex.d.ts +110 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.stylex.js +100 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.types.d.ts +38 -0
- package/dist/components/LazyStackRoot/LazyStackRoot.types.js +1 -0
- package/dist/components/LazyTable/LazyTable.d.ts +11 -0
- package/dist/components/LazyTable/LazyTable.js +28 -0
- package/dist/components/LazyTable/LazyTable.layout.d.ts +43 -0
- package/dist/components/LazyTable/LazyTable.layout.js +213 -0
- package/dist/components/LazyTable/LazyTable.viewport.d.ts +5 -0
- package/dist/components/LazyTable/LazyTable.viewport.js +83 -0
- package/dist/components/LazyTree/LazyTree.d.ts +11 -0
- package/dist/components/LazyTree/LazyTree.js +10 -0
- package/dist/components/LazyVStack/LazyVStack.d.ts +18 -0
- package/dist/components/LazyVStack/LazyVStack.js +15 -0
- package/dist/components/Link/Link.adapter.d.ts +19 -0
- package/dist/components/Link/Link.adapter.js +18 -0
- package/dist/components/Link/Link.d.ts +52 -0
- package/dist/components/Link/Link.js +137 -0
- package/dist/components/Link/Link.stylex.d.ts +200 -0
- package/dist/components/Link/Link.stylex.js +206 -0
- package/dist/components/List/List.d.ts +16 -0
- package/dist/components/List/List.js +90 -0
- package/dist/components/List/List.stylex.d.ts +116 -0
- package/dist/components/List/List.stylex.js +116 -0
- package/dist/components/List/flattenHelpers.d.ts +19 -0
- package/dist/components/List/flattenHelpers.js +88 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.d.ts +9 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.js +16 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.stylex.d.ts +23 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.stylex.js +25 -0
- package/dist/components/LockedPreview/LockedPreview.d.ts +19 -0
- package/dist/components/LockedPreview/LockedPreview.js +11 -0
- package/dist/components/LockedPreview/LockedPreview.stylex.d.ts +26 -0
- package/dist/components/LockedPreview/LockedPreview.stylex.js +27 -0
- package/dist/components/Menu/Menu.collection.d.ts +3 -0
- package/dist/components/Menu/Menu.collection.js +130 -0
- package/dist/components/Menu/Menu.context.d.ts +7 -0
- package/dist/components/Menu/Menu.context.js +16 -0
- package/dist/components/Menu/Menu.d.ts +89 -0
- package/dist/components/Menu/Menu.identity.d.ts +3 -0
- package/dist/components/Menu/Menu.identity.js +3 -0
- package/dist/components/Menu/Menu.inlineRoom.d.ts +15 -0
- package/dist/components/Menu/Menu.inlineRoom.js +64 -0
- package/dist/components/Menu/Menu.js +235 -0
- package/dist/components/Menu/Menu.popoverTrigger.d.ts +10 -0
- package/dist/components/Menu/Menu.popoverTrigger.js +103 -0
- package/dist/components/Menu/Menu.stylex.d.ts +232 -0
- package/dist/components/Menu/Menu.stylex.js +265 -0
- package/dist/components/Menu/MenuItem.children.d.ts +5 -0
- package/dist/components/Menu/MenuItem.children.js +23 -0
- package/dist/components/Meter/Meter.d.ts +25 -0
- package/dist/components/Meter/Meter.js +34 -0
- package/dist/components/Meter/Meter.stylex.d.ts +49 -0
- package/dist/components/Meter/Meter.stylex.js +47 -0
- package/dist/components/Modal/Modal.d.ts +6 -0
- package/dist/components/Modal/Modal.js +14 -0
- package/dist/components/Modal/Modal.types.d.ts +40 -0
- package/dist/components/Modal/Modal.types.js +1 -0
- package/dist/components/Modal/Overlay.d.ts +11 -0
- package/dist/components/Modal/Overlay.js +63 -0
- package/dist/components/Modal/Overlay.stylex.d.ts +190 -0
- package/dist/components/Modal/Overlay.stylex.js +128 -0
- package/dist/components/Modal/OverlayBoundary.d.ts +5 -0
- package/dist/components/Modal/OverlayBoundary.js +17 -0
- package/dist/components/NavigationItem/NavigationItem.d.ts +64 -0
- package/dist/components/NavigationItem/NavigationItem.js +116 -0
- package/dist/components/NavigationItem/NavigationItem.navigationContext.d.ts +15 -0
- package/dist/components/NavigationItem/NavigationItem.navigationContext.js +20 -0
- package/dist/components/NavigationItem/NavigationItem.stylex.d.ts +30 -0
- package/dist/components/NavigationItem/NavigationItem.stylex.js +37 -0
- package/dist/components/NavigationRail/NavigationRail.context.d.ts +5 -0
- package/dist/components/NavigationRail/NavigationRail.context.js +9 -0
- package/dist/components/NavigationRail/NavigationRail.d.ts +12 -0
- package/dist/components/NavigationRail/NavigationRail.js +72 -0
- package/dist/components/NavigationRail/NavigationRail.stylex.d.ts +57 -0
- package/dist/components/NavigationRail/NavigationRail.stylex.js +58 -0
- package/dist/components/NavigationTree/NavigationTree.activeSections.d.ts +7 -0
- package/dist/components/NavigationTree/NavigationTree.activeSections.js +75 -0
- package/dist/components/NavigationTree/NavigationTree.d.ts +21 -0
- package/dist/components/NavigationTree/NavigationTree.js +273 -0
- package/dist/components/NavigationTree/NavigationTree.stylex.d.ts +245 -0
- package/dist/components/NavigationTree/NavigationTree.stylex.js +262 -0
- package/dist/components/NumberField/NumberField.d.ts +73 -0
- package/dist/components/NumberField/NumberField.js +112 -0
- package/dist/components/Option/Option.d.ts +18 -0
- package/dist/components/Option/Option.js +44 -0
- package/dist/components/Option/Option.stylex.d.ts +75 -0
- package/dist/components/Option/Option.stylex.js +74 -0
- package/dist/components/Page/NestedPageAuxiliary.d.ts +3 -0
- package/dist/components/Page/NestedPageAuxiliary.js +44 -0
- package/dist/components/Page/Page.d.ts +59 -0
- package/dist/components/Page/Page.js +265 -0
- package/dist/components/Page/Page.stylex.d.ts +333 -0
- package/dist/components/Page/Page.stylex.js +310 -0
- package/dist/components/Page/PageAuxiliary.context.d.ts +7 -0
- package/dist/components/Page/PageAuxiliary.context.js +2 -0
- package/dist/components/Page/PageAuxiliaryPanel.d.ts +32 -0
- package/dist/components/Page/PageAuxiliaryPanel.js +50 -0
- package/dist/components/Page/PageLabel.d.ts +26 -0
- package/dist/components/Page/PageLabel.js +56 -0
- package/dist/components/Page/PageScrollMotion.d.ts +24 -0
- package/dist/components/Page/PageScrollMotion.js +186 -0
- package/dist/components/Page/PageTitleRow.d.ts +21 -0
- package/dist/components/Page/PageTitleRow.js +50 -0
- package/dist/components/Page/PageTitleRow.stylex.d.ts +16 -0
- package/dist/components/Page/PageTitleRow.stylex.js +17 -0
- package/dist/components/Page/PageToolbar.context.d.ts +35 -0
- package/dist/components/Page/PageToolbar.context.js +43 -0
- package/dist/components/Page/PageToolbar.d.ts +13 -0
- package/dist/components/Page/PageToolbar.js +150 -0
- package/dist/components/Page/PageToolbar.motion.d.ts +5 -0
- package/dist/components/Page/PageToolbar.motion.js +27 -0
- package/dist/components/Page/PageToolbar.stylex.d.ts +41 -0
- package/dist/components/Page/PageToolbar.stylex.js +37 -0
- package/dist/components/Page/revealAuxiliary.d.ts +2 -0
- package/dist/components/Page/revealAuxiliary.js +56 -0
- package/dist/components/PageToolbar/PageToolbar.d.ts +7 -0
- package/dist/components/PageToolbar/PageToolbar.js +12 -0
- package/dist/components/Popover/OverflowPickerSearch.d.ts +7 -0
- package/dist/components/Popover/OverflowPickerSearch.js +10 -0
- package/dist/components/Popover/Popover.anchor.d.ts +12 -0
- package/dist/components/Popover/Popover.anchor.js +87 -0
- package/dist/components/Popover/Popover.context.d.ts +11 -0
- package/dist/components/Popover/Popover.context.js +11 -0
- package/dist/components/Popover/Popover.d.ts +69 -0
- package/dist/components/Popover/Popover.js +253 -0
- package/dist/components/Popover/Popover.pressTrigger.d.ts +12 -0
- package/dist/components/Popover/Popover.pressTrigger.js +54 -0
- package/dist/components/Popover/Popover.stylex.d.ts +98 -0
- package/dist/components/Popover/Popover.stylex.js +109 -0
- package/dist/components/Popover/Popover.viewport.d.ts +10 -0
- package/dist/components/Popover/Popover.viewport.js +61 -0
- package/dist/components/Popover/useHoverOpen.d.ts +24 -0
- package/dist/components/Popover/useHoverOpen.js +132 -0
- package/dist/components/Progress/Progress.d.ts +21 -0
- package/dist/components/Progress/Progress.js +20 -0
- package/dist/components/Progress/Progress.stylex.d.ts +90 -0
- package/dist/components/Progress/Progress.stylex.js +83 -0
- package/dist/components/RadioGroup/RadioGroup.children.d.ts +8 -0
- package/dist/components/RadioGroup/RadioGroup.children.js +64 -0
- package/dist/components/RadioGroup/RadioGroup.colors.d.ts +13 -0
- package/dist/components/RadioGroup/RadioGroup.colors.js +11 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +73 -0
- package/dist/components/RadioGroup/RadioGroup.js +85 -0
- package/dist/components/RadioGroup/RadioGroup.stylex.d.ts +87 -0
- package/dist/components/RadioGroup/RadioGroup.stylex.js +57 -0
- package/dist/components/ReflowContainer/ReflowContainer.d.ts +30 -0
- package/dist/components/ReflowContainer/ReflowContainer.js +106 -0
- package/dist/components/Region/Region.d.ts +50 -0
- package/dist/components/Region/Region.js +29 -0
- package/dist/components/RenderingTreatment/RenderingTreatment.context.d.ts +34 -0
- package/dist/components/RenderingTreatment/RenderingTreatment.context.js +49 -0
- package/dist/components/ResourceList/ResourceList.d.ts +7 -0
- package/dist/components/ResourceList/ResourceList.js +89 -0
- package/dist/components/ResourceList/ResourceList.model.d.ts +65 -0
- package/dist/components/ResourceList/ResourceList.model.js +372 -0
- package/dist/components/ResourceList/ResourceList.rows.d.ts +18 -0
- package/dist/components/ResourceList/ResourceList.rows.js +86 -0
- package/dist/components/ResourceList/ResourceList.stylex.d.ts +338 -0
- package/dist/components/ResourceList/ResourceList.stylex.js +272 -0
- package/dist/components/ResourceList/ResourceList.table.d.ts +22 -0
- package/dist/components/ResourceList/ResourceList.table.js +149 -0
- package/dist/components/ResourceList/ResourceList.types.d.ts +120 -0
- package/dist/components/ResourceList/ResourceList.types.js +18 -0
- package/dist/components/Reveal/Reveal.d.ts +36 -0
- package/dist/components/Reveal/Reveal.js +18 -0
- package/dist/components/Reveal/Reveal.stylex.d.ts +125 -0
- package/dist/components/Reveal/Reveal.stylex.js +155 -0
- package/dist/components/RotatingStatus/RotatingStatus.d.ts +17 -0
- package/dist/components/RotatingStatus/RotatingStatus.js +43 -0
- package/dist/components/RotatingStatus/RotatingStatus.stylex.d.ts +27 -0
- package/dist/components/RotatingStatus/RotatingStatus.stylex.js +28 -0
- package/dist/components/RouterProvider/RouterProvider.d.ts +22 -0
- package/dist/components/RouterProvider/RouterProvider.js +12 -0
- package/dist/components/RowButton/RowButton.d.ts +21 -0
- package/dist/components/RowButton/RowButton.js +16 -0
- package/dist/components/RowButton/RowButton.stylex.d.ts +71 -0
- package/dist/components/RowButton/RowButton.stylex.js +80 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.context.d.ts +20 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.context.js +229 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.d.ts +10 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.edges.d.ts +16 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.edges.js +114 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.js +30 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.styles.d.ts +4 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.styles.js +44 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.stylex.d.ts +15 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.stylex.js +15 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.types.d.ts +71 -0
- package/dist/components/SafeInsetArea/SafeInsetArea.types.js +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +73 -0
- package/dist/components/ScrollArea/ScrollArea.js +176 -0
- package/dist/components/ScrollArea/ScrollArea.stylex.d.ts +222 -0
- package/dist/components/ScrollArea/ScrollArea.stylex.js +253 -0
- package/dist/components/ScrollArea/ScrollAreaEdgeEffect.d.ts +8 -0
- package/dist/components/ScrollArea/ScrollAreaEdgeEffect.js +13 -0
- package/dist/components/ScrollArea/ScrollAreaEdgeEffect.stylex.d.ts +60 -0
- package/dist/components/ScrollArea/ScrollAreaEdgeEffect.stylex.js +37 -0
- package/dist/components/ScrollArea/ScrollAreaMarker.d.ts +23 -0
- package/dist/components/ScrollArea/ScrollAreaMarker.js +14 -0
- package/dist/components/ScrollArea/ScrollAreaMarkers.d.ts +17 -0
- package/dist/components/ScrollArea/ScrollAreaMarkers.js +206 -0
- package/dist/components/ScrollArea/ScrollAreaMarkers.stylex.d.ts +166 -0
- package/dist/components/ScrollArea/ScrollAreaMarkers.stylex.js +194 -0
- package/dist/components/ScrollArea/ScrollAreaOutline.d.ts +20 -0
- package/dist/components/ScrollArea/ScrollAreaOutline.js +53 -0
- package/dist/components/ScrollArea/ScrollAreaScrollbar.d.ts +16 -0
- package/dist/components/ScrollArea/ScrollAreaScrollbar.js +137 -0
- package/dist/components/ScrollArea/navigateToScrollTarget.d.ts +5 -0
- package/dist/components/ScrollArea/navigateToScrollTarget.js +17 -0
- package/dist/components/ScrollArea/scrollbarGeometry.d.ts +6 -0
- package/dist/components/ScrollArea/scrollbarGeometry.js +7 -0
- package/dist/components/ScrollArea/useHasNoTabStops.d.ts +3 -0
- package/dist/components/ScrollArea/useHasNoTabStops.js +37 -0
- package/dist/components/ScrollArea/useHorizontalWheel.d.ts +3 -0
- package/dist/components/ScrollArea/useHorizontalWheel.js +40 -0
- package/dist/components/ScrollArea/useMarkerNavigation.d.ts +7 -0
- package/dist/components/ScrollArea/useMarkerNavigation.js +41 -0
- package/dist/components/ScrollArea/useMarkerRail.d.ts +16 -0
- package/dist/components/ScrollArea/useMarkerRail.js +37 -0
- package/dist/components/ScrollArea/useScrollArea.d.ts +22 -0
- package/dist/components/ScrollArea/useScrollArea.js +103 -0
- package/dist/components/ScrollArea/useScrollAreaMarkers.d.ts +38 -0
- package/dist/components/ScrollArea/useScrollAreaMarkers.js +154 -0
- package/dist/components/SearchField/SearchField.d.ts +29 -0
- package/dist/components/SearchField/SearchField.js +51 -0
- package/dist/components/SearchField/SearchField.stylex.d.ts +82 -0
- package/dist/components/SearchField/SearchField.stylex.js +60 -0
- package/dist/components/SecretField/SecretField.d.ts +66 -0
- package/dist/components/SecretField/SecretField.js +61 -0
- package/dist/components/Section/Section.d.ts +41 -0
- package/dist/components/Section/Section.data.d.ts +12 -0
- package/dist/components/Section/Section.data.js +16 -0
- package/dist/components/Section/Section.js +45 -0
- package/dist/components/Section/Section.stylex.d.ts +24 -0
- package/dist/components/Section/Section.stylex.js +26 -0
- package/dist/components/Select/Select.body.d.ts +14 -0
- package/dist/components/Select/Select.body.js +17 -0
- package/dist/components/Select/Select.collection.d.ts +7 -0
- package/dist/components/Select/Select.collection.js +67 -0
- package/dist/components/Select/Select.context.d.ts +1 -0
- package/dist/components/Select/Select.context.js +2 -0
- package/dist/components/Select/Select.d.ts +60 -0
- package/dist/components/Select/Select.js +118 -0
- package/dist/components/Select/Select.stylex.d.ts +131 -0
- package/dist/components/Select/Select.stylex.js +132 -0
- package/dist/components/Select/useSelectFormReset.d.ts +2 -0
- package/dist/components/Select/useSelectFormReset.js +25 -0
- package/dist/components/Separator/Separator.d.ts +26 -0
- package/dist/components/Separator/Separator.js +31 -0
- package/dist/components/Separator/Separator.stylex.d.ts +33 -0
- package/dist/components/Separator/Separator.stylex.js +34 -0
- package/dist/components/Sheet/Sheet.d.ts +24 -0
- package/dist/components/Sheet/Sheet.js +17 -0
- package/dist/components/Shortcuts/ShortcutIndicator.d.ts +5 -0
- package/dist/components/Shortcuts/ShortcutIndicator.js +10 -0
- package/dist/components/Shortcuts/Shortcuts.context.d.ts +9 -0
- package/dist/components/Shortcuts/Shortcuts.context.js +8 -0
- package/dist/components/Shortcuts/Shortcuts.d.ts +14 -0
- package/dist/components/Shortcuts/Shortcuts.js +50 -0
- package/dist/components/Shortcuts/Shortcuts.stylex.d.ts +29 -0
- package/dist/components/Shortcuts/Shortcuts.stylex.js +28 -0
- package/dist/components/Shortcuts/Shortcuts.types.d.ts +56 -0
- package/dist/components/Shortcuts/Shortcuts.types.js +1 -0
- package/dist/components/Shortcuts/ShortcutsHelp.d.ts +5 -0
- package/dist/components/Shortcuts/ShortcutsHelp.js +70 -0
- package/dist/components/Shortcuts/shortcutKeys.d.ts +6 -0
- package/dist/components/Shortcuts/shortcutKeys.js +61 -0
- package/dist/components/Shortcuts/shortcutRegistry.d.ts +36 -0
- package/dist/components/Shortcuts/shortcutRegistry.js +153 -0
- package/dist/components/Shortcuts/useShortcut.d.ts +12 -0
- package/dist/components/Shortcuts/useShortcut.js +127 -0
- package/dist/components/ShowMore/ShowMore.d.ts +18 -0
- package/dist/components/ShowMore/ShowMore.js +44 -0
- package/dist/components/ShowMore/ShowMore.lines.d.ts +23 -0
- package/dist/components/ShowMore/ShowMore.lines.js +49 -0
- package/dist/components/ShowMore/ShowMore.stylex.d.ts +24 -0
- package/dist/components/ShowMore/ShowMore.stylex.js +26 -0
- package/dist/components/Skeleton/Skeleton.d.ts +16 -0
- package/dist/components/Skeleton/Skeleton.js +8 -0
- package/dist/components/Skeleton/Skeleton.stylex.d.ts +68 -0
- package/dist/components/Skeleton/Skeleton.stylex.js +78 -0
- package/dist/components/Skeleton/useSkeleton.d.ts +87 -0
- package/dist/components/Skeleton/useSkeleton.js +34 -0
- package/dist/components/Slider/Slider.d.ts +44 -0
- package/dist/components/Slider/Slider.js +56 -0
- package/dist/components/Slider/Slider.stylex.d.ts +105 -0
- package/dist/components/Slider/Slider.stylex.js +70 -0
- package/dist/components/Slot/Slot.d.ts +17 -0
- package/dist/components/Slot/Slot.js +83 -0
- package/dist/components/Slot/Slot.resolve.d.ts +3 -0
- package/dist/components/Slot/Slot.resolve.js +22 -0
- package/dist/components/Slot/Slot.scope.d.ts +7 -0
- package/dist/components/Slot/Slot.scope.js +19 -0
- package/dist/components/Slot/Slot.types.d.ts +64 -0
- package/dist/components/Slot/Slot.types.js +1 -0
- package/dist/components/Spacer/Spacer.d.ts +5 -0
- package/dist/components/Spacer/Spacer.js +6 -0
- package/dist/components/Spacer/Spacer.stylex.d.ts +10 -0
- package/dist/components/Spacer/Spacer.stylex.js +10 -0
- package/dist/components/SplitLayout/SplitLayout.d.ts +43 -0
- package/dist/components/SplitLayout/SplitLayout.js +20 -0
- package/dist/components/SplitLayout/SplitLayout.stylex.d.ts +51 -0
- package/dist/components/SplitLayout/SplitLayout.stylex.js +77 -0
- package/dist/components/Stack/StackInsets.context.d.ts +14 -0
- package/dist/components/Stack/StackInsets.context.js +17 -0
- package/dist/components/Stack/StackPadding.stylex.d.ts +113 -0
- package/dist/components/Stack/StackPadding.stylex.js +154 -0
- package/dist/components/Stack/StackPropTypes.d.ts +30 -0
- package/dist/components/Stack/StackPropTypes.js +14 -0
- package/dist/components/StatCard/StatCard.d.ts +32 -0
- package/dist/components/StatCard/StatCard.js +15 -0
- package/dist/components/StatCard/StatCard.stylex.d.ts +101 -0
- package/dist/components/StatCard/StatCard.stylex.js +127 -0
- package/dist/components/StatCard/StatCard.vars.stylex.d.ts +22 -0
- package/dist/components/StatCard/StatCard.vars.stylex.js +26 -0
- package/dist/components/StepList/StepList.d.ts +52 -0
- package/dist/components/StepList/StepList.js +36 -0
- package/dist/components/StepList/StepList.stylex.d.ts +139 -0
- package/dist/components/StepList/StepList.stylex.js +134 -0
- package/dist/components/Stepper/Stepper.d.ts +49 -0
- package/dist/components/Stepper/Stepper.js +59 -0
- package/dist/components/Stepper/Stepper.stylex.d.ts +131 -0
- package/dist/components/Stepper/Stepper.stylex.js +147 -0
- package/dist/components/Stepper/useStepNamesFit.d.ts +12 -0
- package/dist/components/Stepper/useStepNamesFit.js +65 -0
- package/dist/components/Surface/Surface.colors.d.ts +4 -0
- package/dist/components/Surface/Surface.colors.js +34 -0
- package/dist/components/Surface/Surface.d.ts +41 -0
- package/dist/components/Surface/Surface.js +36 -0
- package/dist/components/Surface/Surface.stylex.d.ts +139 -0
- package/dist/components/Surface/Surface.stylex.js +121 -0
- package/dist/components/Switch/Switch.d.ts +50 -0
- package/dist/components/Switch/Switch.js +28 -0
- package/dist/components/TOC/TOC.activeEntry.d.ts +14 -0
- package/dist/components/TOC/TOC.activeEntry.js +89 -0
- package/dist/components/TOC/TOC.context.d.ts +33 -0
- package/dist/components/TOC/TOC.context.js +55 -0
- package/dist/components/TOC/TOC.d.ts +8 -0
- package/dist/components/TOC/TOC.js +49 -0
- package/dist/components/TOC/TOC.stylex.d.ts +60 -0
- package/dist/components/TOC/TOC.stylex.js +59 -0
- package/dist/components/Table/Table.d.ts +6 -0
- package/dist/components/Table/Table.data.d.ts +24 -0
- package/dist/components/Table/Table.data.js +224 -0
- package/dist/components/Table/Table.js +317 -0
- package/dist/components/Table/Table.layout.d.ts +33 -0
- package/dist/components/Table/Table.layout.js +246 -0
- package/dist/components/Table/Table.parts.d.ts +13 -0
- package/dist/components/Table/Table.parts.js +17 -0
- package/dist/components/Table/Table.stylex.d.ts +504 -0
- package/dist/components/Table/Table.stylex.js +468 -0
- package/dist/components/Table/Table.types.d.ts +114 -0
- package/dist/components/Table/Table.types.js +11 -0
- package/dist/components/Table/TableRowLink.d.ts +16 -0
- package/dist/components/Table/TableRowLink.js +39 -0
- package/dist/components/Tabs/NewTabAction.d.ts +7 -0
- package/dist/components/Tabs/NewTabAction.js +25 -0
- package/dist/components/Tabs/Tab.d.ts +11 -0
- package/dist/components/Tabs/Tab.js +10 -0
- package/dist/components/Tabs/TabActionButton.d.ts +14 -0
- package/dist/components/Tabs/TabActionButton.js +60 -0
- package/dist/components/Tabs/TabActions.d.ts +12 -0
- package/dist/components/Tabs/TabActions.js +119 -0
- package/dist/components/Tabs/TabOutlet.d.ts +9 -0
- package/dist/components/Tabs/TabOutlet.js +15 -0
- package/dist/components/Tabs/TabPanelTransition.d.ts +18 -0
- package/dist/components/Tabs/TabPanelTransition.js +20 -0
- package/dist/components/Tabs/Tabs.children.d.ts +16 -0
- package/dist/components/Tabs/Tabs.children.js +97 -0
- package/dist/components/Tabs/Tabs.d.ts +5 -0
- package/dist/components/Tabs/Tabs.js +270 -0
- package/dist/components/Tabs/Tabs.state.d.ts +19 -0
- package/dist/components/Tabs/Tabs.state.js +13 -0
- package/dist/components/Tabs/Tabs.stylex.d.ts +476 -0
- package/dist/components/Tabs/Tabs.stylex.js +376 -0
- package/dist/components/Tabs/Tabs.types.d.ts +99 -0
- package/dist/components/Tabs/Tabs.types.js +6 -0
- package/dist/components/Tabs/TabsPicker.d.ts +8 -0
- package/dist/components/Tabs/TabsPicker.js +21 -0
- package/dist/components/Tabs/useTabOverflow.d.ts +9 -0
- package/dist/components/Tabs/useTabOverflow.js +55 -0
- package/dist/components/Tabs/useTabReorder.d.ts +22 -0
- package/dist/components/Tabs/useTabReorder.js +133 -0
- package/dist/components/Tabs/useTabScrollRestoration.d.ts +4 -0
- package/dist/components/Tabs/useTabScrollRestoration.js +100 -0
- package/dist/components/Tabs/useTabs.d.ts +10 -0
- package/dist/components/Tabs/useTabs.js +43 -0
- package/dist/components/Tabs/useTabsPickerMotion.d.ts +6 -0
- package/dist/components/Tabs/useTabsPickerMotion.js +64 -0
- package/dist/components/TagGroup/CollapsedTagGroup.d.ts +13 -0
- package/dist/components/TagGroup/CollapsedTagGroup.js +205 -0
- package/dist/components/TagGroup/Tag.d.ts +22 -0
- package/dist/components/TagGroup/Tag.js +5 -0
- package/dist/components/TagGroup/TagCollection.d.ts +15 -0
- package/dist/components/TagGroup/TagCollection.js +30 -0
- package/dist/components/TagGroup/TagContents.d.ts +8 -0
- package/dist/components/TagGroup/TagContents.js +109 -0
- package/dist/components/TagGroup/TagGroup.children.d.ts +11 -0
- package/dist/components/TagGroup/TagGroup.children.js +59 -0
- package/dist/components/TagGroup/TagGroup.d.ts +29 -0
- package/dist/components/TagGroup/TagGroup.js +20 -0
- package/dist/components/TagGroup/TagGroup.stylex.d.ts +226 -0
- package/dist/components/TagGroup/TagGroup.stylex.js +162 -0
- package/dist/components/TagGroup/tagGroupLayout.d.ts +5 -0
- package/dist/components/TagGroup/tagGroupLayout.js +20 -0
- package/dist/components/Text/Text.d.ts +81 -0
- package/dist/components/Text/Text.js +124 -0
- package/dist/components/Text/Text.stylex.d.ts +239 -0
- package/dist/components/Text/Text.stylex.js +231 -0
- package/dist/components/Text/Text.truncation.d.ts +44 -0
- package/dist/components/Text/Text.truncation.js +365 -0
- package/dist/components/Text/Text.truncation.stylex.d.ts +42 -0
- package/dist/components/Text/Text.truncation.stylex.js +53 -0
- package/dist/components/TextArea/TextArea.d.ts +63 -0
- package/dist/components/TextArea/TextArea.js +43 -0
- package/dist/components/TextField/TextField.d.ts +67 -0
- package/dist/components/TextField/TextField.js +46 -0
- package/dist/components/TileButton/TileButton.d.ts +37 -0
- package/dist/components/TileButton/TileButton.js +23 -0
- package/dist/components/TileButton/TileButton.stylex.d.ts +68 -0
- package/dist/components/TileButton/TileButton.stylex.js +74 -0
- package/dist/components/TileButton/TileButton.vars.stylex.d.ts +10 -0
- package/dist/components/TileButton/TileButton.vars.stylex.js +13 -0
- package/dist/components/Time/Time.d.ts +25 -0
- package/dist/components/Time/Time.format.d.ts +22 -0
- package/dist/components/Time/Time.format.js +55 -0
- package/dist/components/Time/Time.js +31 -0
- package/dist/components/Time/Time.stylex.d.ts +14 -0
- package/dist/components/Time/Time.stylex.js +15 -0
- package/dist/components/TimeField/TimeField.d.ts +52 -0
- package/dist/components/TimeField/TimeField.js +53 -0
- package/dist/components/TimelineLanes/TimelineLanes.d.ts +71 -0
- package/dist/components/TimelineLanes/TimelineLanes.js +83 -0
- package/dist/components/TimelineLanes/TimelineLanes.scale.d.ts +14 -0
- package/dist/components/TimelineLanes/TimelineLanes.scale.js +35 -0
- package/dist/components/TimelineLanes/TimelineLanes.stylex.d.ts +280 -0
- package/dist/components/TimelineLanes/TimelineLanes.stylex.js +329 -0
- package/dist/components/Toast/Toast.context.d.ts +3 -0
- package/dist/components/Toast/Toast.context.js +8 -0
- package/dist/components/Toast/Toast.d.ts +5 -0
- package/dist/components/Toast/Toast.js +63 -0
- package/dist/components/Toast/Toast.stylex.d.ts +173 -0
- package/dist/components/Toast/Toast.stylex.js +137 -0
- package/dist/components/Toast/Toast.types.d.ts +31 -0
- package/dist/components/Toast/Toast.types.js +9 -0
- package/dist/components/Toast/ToastCountdown.d.ts +7 -0
- package/dist/components/Toast/ToastCountdown.js +48 -0
- package/dist/components/Toast/ToastView.d.ts +6 -0
- package/dist/components/Toast/ToastView.js +39 -0
- package/dist/components/Toast/createToastEntry.d.ts +9 -0
- package/dist/components/Toast/createToastEntry.js +33 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +45 -0
- package/dist/components/ToggleButton/ToggleButton.js +97 -0
- package/dist/components/ToggleButton/ToggleButton.stylex.d.ts +118 -0
- package/dist/components/ToggleButton/ToggleButton.stylex.js +109 -0
- package/dist/components/Toolbar/Toolbar.children.d.ts +19 -0
- package/dist/components/Toolbar/Toolbar.children.js +83 -0
- package/dist/components/Toolbar/Toolbar.d.ts +37 -0
- package/dist/components/Toolbar/Toolbar.js +180 -0
- package/dist/components/Toolbar/Toolbar.layout.d.ts +20 -0
- package/dist/components/Toolbar/Toolbar.layout.js +104 -0
- package/dist/components/Toolbar/Toolbar.menu.d.ts +27 -0
- package/dist/components/Toolbar/Toolbar.menu.js +213 -0
- package/dist/components/Toolbar/Toolbar.stylex.d.ts +69 -0
- package/dist/components/Toolbar/Toolbar.stylex.js +48 -0
- package/dist/components/Toolbar/ToolbarControl.context.d.ts +6 -0
- package/dist/components/Toolbar/ToolbarControl.context.js +9 -0
- package/dist/components/Toolbar/ToolbarControl.stylex.d.ts +42 -0
- package/dist/components/Toolbar/ToolbarControl.stylex.js +50 -0
- package/dist/components/Toolbar/ToolbarGroupLabel.d.ts +3 -0
- package/dist/components/Toolbar/ToolbarGroupLabel.js +22 -0
- package/dist/components/Toolbar/ToolbarMenuTrigger.d.ts +6 -0
- package/dist/components/Toolbar/ToolbarMenuTrigger.js +20 -0
- package/dist/components/Toolbar/ToolbarNote.d.ts +13 -0
- package/dist/components/Toolbar/ToolbarNote.js +8 -0
- package/dist/components/Tooltip/Tooltip.d.ts +43 -0
- package/dist/components/Tooltip/Tooltip.js +139 -0
- package/dist/components/Tooltip/Tooltip.stylex.d.ts +106 -0
- package/dist/components/Tooltip/Tooltip.stylex.js +105 -0
- package/dist/components/Tooltip/Tooltip.unavailableContext.d.ts +9 -0
- package/dist/components/Tooltip/Tooltip.unavailableContext.js +12 -0
- package/dist/components/TourLayer/TourLayer.d.ts +14 -0
- package/dist/components/TourLayer/TourLayer.js +17 -0
- package/dist/components/TourLayer/TourLayer.stylex.d.ts +10 -0
- package/dist/components/TourLayer/TourLayer.stylex.js +11 -0
- package/dist/components/Tree/Tree.d.ts +21 -0
- package/dist/components/Tree/Tree.js +88 -0
- package/dist/components/Tree/Tree.stylex.d.ts +101 -0
- package/dist/components/Tree/Tree.stylex.js +103 -0
- package/dist/components/Trigger/Trigger.d.ts +10 -0
- package/dist/components/Trigger/Trigger.js +23 -0
- package/dist/components/UnsavedChangesScope/UnsavedChangesScope.d.ts +44 -0
- package/dist/components/UnsavedChangesScope/UnsavedChangesScope.js +136 -0
- package/dist/components/VStack/VStack.d.ts +26 -0
- package/dist/components/VStack/VStack.js +11 -0
- package/dist/components/VStack/VStack.stylex.d.ts +174 -0
- package/dist/components/VStack/VStack.stylex.js +124 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +13 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +11 -0
- package/dist/components/WelcomeDialog/WelcomeDialog.d.ts +28 -0
- package/dist/components/WelcomeDialog/WelcomeDialog.js +45 -0
- package/dist/components/WelcomeDialog/WelcomeDialog.stylex.d.ts +88 -0
- package/dist/components/WelcomeDialog/WelcomeDialog.stylex.js +106 -0
- package/dist/components/WindowSplitter/WindowSplitter.d.ts +43 -0
- package/dist/components/WindowSplitter/WindowSplitter.detached.d.ts +6 -0
- package/dist/components/WindowSplitter/WindowSplitter.detached.js +7 -0
- package/dist/components/WindowSplitter/WindowSplitter.drawer.d.ts +70 -0
- package/dist/components/WindowSplitter/WindowSplitter.drawer.js +88 -0
- package/dist/components/WindowSplitter/WindowSplitter.js +613 -0
- package/dist/components/WindowSplitter/WindowSplitter.peek.d.ts +33 -0
- package/dist/components/WindowSplitter/WindowSplitter.peek.js +90 -0
- package/dist/components/WindowSplitter/WindowSplitter.sizing.d.ts +11 -0
- package/dist/components/WindowSplitter/WindowSplitter.sizing.js +50 -0
- package/dist/components/WindowSplitter/WindowSplitter.stylex.d.ts +180 -0
- package/dist/components/WindowSplitter/WindowSplitter.stylex.js +163 -0
- package/dist/components/ZStack/ZStack.d.ts +41 -0
- package/dist/components/ZStack/ZStack.js +43 -0
- package/dist/components/ZStack/ZStack.stylex.d.ts +78 -0
- package/dist/components/ZStack/ZStack.stylex.js +42 -0
- package/dist/experimental/index.d.ts +48 -0
- package/dist/experimental/index.js +45 -0
- package/dist/files/index.d.ts +22 -0
- package/dist/files/index.js +19 -0
- package/dist/foundations/Color.context.d.ts +29 -0
- package/dist/foundations/Color.context.js +58 -0
- package/dist/foundations/Color.core.d.ts +70 -0
- package/dist/foundations/Color.core.js +323 -0
- package/dist/foundations/Color.d.ts +1 -0
- package/dist/foundations/Color.js +1 -0
- package/dist/foundations/Color.styles.stylex.d.ts +21 -0
- package/dist/foundations/Color.styles.stylex.js +34 -0
- package/dist/foundations/constants.stylex.d.ts +18 -0
- package/dist/foundations/constants.stylex.js +20 -0
- package/dist/foundations/textStyles.stylex.d.ts +87 -0
- package/dist/foundations/textStyles.stylex.js +88 -0
- package/dist/foundations/viewport.d.ts +5 -0
- package/dist/foundations/viewport.js +17 -0
- package/dist/index.d.ts +171 -0
- package/dist/index.js +189 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +1 -0
- package/dist/theming/OverlayRegion.d.ts +15 -0
- package/dist/theming/OverlayRegion.js +36 -0
- package/dist/theming/ThemeRegion.d.ts +22 -0
- package/dist/theming/ThemeRegion.js +28 -0
- package/dist/theming/ThemeScope.context.d.ts +40 -0
- package/dist/theming/ThemeScope.context.js +76 -0
- package/dist/theming/ThemeScope.d.ts +35 -0
- package/dist/theming/ThemeScope.js +67 -0
- package/dist/theming/ThemeScope.stylex.d.ts +34 -0
- package/dist/theming/ThemeScope.stylex.js +54 -0
- package/dist/theming/color.d.ts +51 -0
- package/dist/theming/color.js +175 -0
- package/dist/theming/createTheme.d.ts +145 -0
- package/dist/theming/createTheme.js +1009 -0
- package/dist/theming/designTokens.d.ts +49 -0
- package/dist/theming/designTokens.js +138 -0
- package/dist/theming/effectiveTheme.d.ts +154 -0
- package/dist/theming/effectiveTheme.js +62 -0
- package/dist/theming/themeStylesheet.d.ts +20 -0
- package/dist/theming/themeStylesheet.js +106 -0
- package/dist/theming/tokens.d.ts +48 -0
- package/dist/theming/tokens.js +314 -0
- package/dist/theming/tokens.stylex.d.ts +592 -0
- package/dist/theming/tokens.stylex.js +1265 -0
- package/dist/utils/declarationError.d.ts +7 -0
- package/dist/utils/declarationError.js +16 -0
- package/dist/utils/deviceCache.d.ts +40 -0
- package/dist/utils/deviceCache.js +234 -0
- package/dist/utils/isSoftwareKeyboardLikely.d.ts +2 -0
- package/dist/utils/isSoftwareKeyboardLikely.js +12 -0
- package/dist/utils/performance.d.ts +3 -0
- package/dist/utils/performance.js +5 -0
- package/dist/utils/preferences.d.ts +35 -0
- package/dist/utils/preferences.js +77 -0
- package/dist/utils/preload.d.ts +10 -0
- package/dist/utils/preload.js +12 -0
- package/dist/utils/props.d.ts +5 -0
- package/dist/utils/props.js +10 -0
- package/dist/utils/resolveAutoFocus.d.ts +3 -0
- package/dist/utils/resolveAutoFocus.js +8 -0
- package/dist/utils/trackRegionActivity.d.ts +13 -0
- package/dist/utils/trackRegionActivity.js +72 -0
- package/dist/utils/useAutoFocus.d.ts +6 -0
- package/dist/utils/useAutoFocus.js +16 -0
- package/dist/utils/visuallyHidden.stylex.d.ts +15 -0
- package/dist/utils/visuallyHidden.stylex.js +15 -0
- package/package.json +144 -3
|
@@ -0,0 +1,846 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as stylex from '@stylexjs/stylex';
|
|
3
|
+
import { Component, Suspense, use, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
4
|
+
import { mergeRefs } from 'react-aria/mergeRefs';
|
|
5
|
+
import { Button } from "../Button/Button.js";
|
|
6
|
+
import { FileFrameContext, FileSelectionToolbarContext, FilePreviewCacheKeyContext, FileStructureReportContext, useIsCompact, } from "../FileContent/FileContent.context.js";
|
|
7
|
+
import { DismissContext } from "../DismissButton/Dismiss.context.js";
|
|
8
|
+
import { EmptyState } from "../Collection/Collection.js";
|
|
9
|
+
import { Modal } from "../Modal/Modal.js";
|
|
10
|
+
import { styles as revealStyles } from "../Reveal/Reveal.stylex.js";
|
|
11
|
+
import { trackRegionActivity } from "../../utils/trackRegionActivity.js";
|
|
12
|
+
import { RenderingTreatmentProvider } from "../RenderingTreatment/RenderingTreatment.context.js";
|
|
13
|
+
import { SourceScope, useFileScope, useResolvedFileSource } from "../FileScope/FileScope.js";
|
|
14
|
+
import { canPerform, downloadBlob, downloadEntry, RenameDialog, useDeleteEntries, } from "../FileScope/FileScope.actions.js";
|
|
15
|
+
import { fileCacheKey } from "../FileScope/FileScope.cache.js";
|
|
16
|
+
import { ToastContext } from "../Toast/Toast.context.js";
|
|
17
|
+
import { matchRenderers } from "../FileScope/FileScope.match.js";
|
|
18
|
+
import { resolveRelativeKey } from "../FileScope/FileScope.relative.js";
|
|
19
|
+
import { drawThumbnailOnOpen } from "../FileThumbnail/FileThumbnail.js";
|
|
20
|
+
import { useShareEntry } from "../FileScope/FileScope.share.js";
|
|
21
|
+
import { loadRenderer, usePreference } from "../FileScope/FileScope.utils.js";
|
|
22
|
+
import { fileSourceErrorKind, fileSourceErrorMessage } from "../FileScope/FileSourceError.js";
|
|
23
|
+
import { useFileEntry, useFileStore } from "../FileScope/FileStore.js";
|
|
24
|
+
import { FileChrome, SearchControls, StateChrome } from "./FileViewer.chrome.js";
|
|
25
|
+
import { GoToDialog } from "./FileViewer.goTo.js";
|
|
26
|
+
import { FileBodyLoading, FileViewerSkeleton, skeletonShape } from "./FileViewer.skeleton.js";
|
|
27
|
+
import { EMBED_TOP_INSET, EmbeddedChrome, EmbeddedSearch, ScrollShield, useScrollEngagement, } from "./FileViewer.embedded.js";
|
|
28
|
+
import { PresentingFrame } from "./FileViewer.present.js";
|
|
29
|
+
import { SelectionToolbar } from "./FileViewer.selection.js";
|
|
30
|
+
import { ViewerCollectionContext, ViewerFrameContext, useViewerFrame, } from "./FileViewer.frame.js";
|
|
31
|
+
import { ViewerSidebar } from "./FileViewer.sidebar.js";
|
|
32
|
+
import { WindowPane, WindowSplitter } from "../WindowSplitter/WindowSplitter.js";
|
|
33
|
+
import { ContentsOverlay, BottomRow, NextFileChip, PageBadge, PagePill, PagesOverlay, fileEndInset, useSafeEndInset, } from "./FileViewer.compact.js";
|
|
34
|
+
import { ViewOverlay, ZoomBadge, ZoomShortcuts, handleZoomKey, hasViewControl, } from "./FileViewer.view.js";
|
|
35
|
+
import { Shortcuts } from "../Shortcuts/Shortcuts.js";
|
|
36
|
+
import { useShortcut } from "../Shortcuts/useShortcut.js";
|
|
37
|
+
import { useFileEditing } from "./FileViewer.edit.js";
|
|
38
|
+
import { FileLinksContext } from "./FileViewer.links.js";
|
|
39
|
+
import { anchorRect, nodeAnchor } from "../Anchor/Anchor.js";
|
|
40
|
+
import { embedHeightStyles, styles } from "./FileViewer.stylex.js";
|
|
41
|
+
export const fileViewerVariants = ['standard', 'embedded'];
|
|
42
|
+
export const fileViewerEmbedHeights = ['container', 'renderer'];
|
|
43
|
+
/**
|
|
44
|
+
* Shows one file: its identity, search and file actions in the chrome, and its content drawn
|
|
45
|
+
* by the renderer that matches it.
|
|
46
|
+
*/
|
|
47
|
+
export function FileViewer({ source: ownSource, ...props }) {
|
|
48
|
+
const source = useResolvedFileSource(ownSource, 'FileViewer');
|
|
49
|
+
return (_jsx(SourceScope, { source: ownSource, children: _jsx(RenderingTreatmentProvider, { for: "EmptyState", treatment: "plain", children: _jsx(FileViewerFrame, { source: source, ...props }) }) }));
|
|
50
|
+
}
|
|
51
|
+
FileViewer.displayName = 'FileViewer';
|
|
52
|
+
function FileViewerFrame({ source, entry: requested, onEntryChange, headerTarget, ...props }) {
|
|
53
|
+
const store = useFileStore(source);
|
|
54
|
+
// A file renamed or moved anywhere that shares the source keeps showing under its new key,
|
|
55
|
+
// and the caller hears about it.
|
|
56
|
+
// Through the store's subscription, as `useFileEntry` reads, so a compiled frame sees a move.
|
|
57
|
+
const moved = useSyncExternalStore(store.subscribe, () => requested === null ? undefined : store.movedTo(requested));
|
|
58
|
+
const key = moved ?? requested;
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (moved !== undefined)
|
|
61
|
+
onEntryChange?.(moved);
|
|
62
|
+
}, [moved, onEntryChange]);
|
|
63
|
+
const isEmbedded = props.variant === 'embedded';
|
|
64
|
+
const frame = useFrame(isEmbedded, headerTarget);
|
|
65
|
+
// Until a renderer is known, an embed that sizes itself takes the middle height.
|
|
66
|
+
const rootStyle = stylex.props(styles.root, isEmbedded && styles.embedded, isEmbedded && props.embedHeight === 'renderer' && embedHeightStyles.medium);
|
|
67
|
+
const [deleted, setDeleted] = useState(null);
|
|
68
|
+
const { entry: loaded, error, isLoading } = useFileEntry(store, key);
|
|
69
|
+
// A source replaced by a newer one, as when the file changes elsewhere, loads the entry afresh;
|
|
70
|
+
// until it arrives the file stays open as it was, so an edit in progress isn't lost.
|
|
71
|
+
const [lastEntry, setLastEntry] = useState(loaded);
|
|
72
|
+
if (loaded !== undefined && loaded !== lastEntry)
|
|
73
|
+
setLastEntry(loaded);
|
|
74
|
+
const entry = loaded ?? (isLoading && lastEntry?.key === key ? lastEntry : undefined);
|
|
75
|
+
// Each file opens afresh, at its start and with its own state, as it would after loading; a
|
|
76
|
+
// file renamed or moved stays open where it was.
|
|
77
|
+
const [opened, setOpened] = useState({
|
|
78
|
+
key,
|
|
79
|
+
id: 0,
|
|
80
|
+
});
|
|
81
|
+
if (key !== opened.key)
|
|
82
|
+
setOpened({
|
|
83
|
+
key,
|
|
84
|
+
id: opened.key !== null && key !== null && store.movedTo(opened.key) === key
|
|
85
|
+
? opened.id
|
|
86
|
+
: opened.id + 1,
|
|
87
|
+
});
|
|
88
|
+
// Until a file opens the standard header keeps the app's controls and Close, as OpenFile's does.
|
|
89
|
+
const dismiss = useContext(DismissContext);
|
|
90
|
+
const stateRoot = {
|
|
91
|
+
...rootStyle,
|
|
92
|
+
...(props.variant === 'embedded' || dismiss === null
|
|
93
|
+
? {}
|
|
94
|
+
: {
|
|
95
|
+
onKeyDown: (event) => {
|
|
96
|
+
if (event.key !== 'Escape' || event.defaultPrevented)
|
|
97
|
+
return;
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
dismiss();
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
const stateChrome = isEmbedded ? null : (_jsx(StateChrome, { leading: props.leading, trailing: props.trailing }));
|
|
104
|
+
// A deleted file stays shown as deleted only until the caller opens something else.
|
|
105
|
+
const isDeleted = deleted !== null && (key === null || key === deleted.key);
|
|
106
|
+
let content;
|
|
107
|
+
if (key === null || isDeleted) {
|
|
108
|
+
content = (_jsxs("div", { ...stateRoot, children: [stateChrome, _jsx(ViewerState, { title: isDeleted ? 'This file was deleted' : 'No file open', ...(isDeleted && deleted !== null && store.source.restore !== undefined
|
|
109
|
+
? {
|
|
110
|
+
action: (_jsx(Button, { onPress: async () => {
|
|
111
|
+
await store.restore([deleted]);
|
|
112
|
+
setDeleted(null);
|
|
113
|
+
onEntryChange?.(deleted.key);
|
|
114
|
+
}, children: "Undo" })),
|
|
115
|
+
}
|
|
116
|
+
: {}) })] }));
|
|
117
|
+
}
|
|
118
|
+
else if (entry === undefined) {
|
|
119
|
+
content = (_jsxs("div", { ...stateRoot, children: [stateChrome, isLoading ? (_jsx(FileViewerSkeleton, {})) : (_jsx(EntryError, { error: error, onRetry: () => store.retryEntry(key) }))] }));
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
content = (_jsx(OpenFile, { store: store, entry: entry, onEntryChange: (next) => {
|
|
123
|
+
onEntryChange?.(next);
|
|
124
|
+
}, onDeleted: () => {
|
|
125
|
+
setDeleted(entry);
|
|
126
|
+
onEntryChange?.(null);
|
|
127
|
+
}, ...props }, opened.id));
|
|
128
|
+
}
|
|
129
|
+
// A viewer inside this one, such as an embed's full screen, has a frame of its own.
|
|
130
|
+
const framed = (_jsx(ViewerFrameContext, { value: frame.value, children: _jsx(ViewerCollectionContext, { value: null, children: content }) }));
|
|
131
|
+
// The viewer's own shortcuts work, and Keyboard shortcuts lists them, while focus is anywhere
|
|
132
|
+
// in it: the header too, which the open file portals into the header slot.
|
|
133
|
+
const label = entry?.name ?? 'File';
|
|
134
|
+
if (isEmbedded)
|
|
135
|
+
return _jsx(Shortcuts, { label: label, children: framed });
|
|
136
|
+
// The header spans the sidebar; the sidebar stays put as files open, load and fail.
|
|
137
|
+
return (_jsx(Shortcuts, { label: label, children: _jsxs("div", { ref: frame.ref, ...stylex.props(styles.frame), children: [_jsx("div", { ref: frame.onHeaderSlot, ...stylex.props(styles.headerSlot) }), _jsx("div", { ...stylex.props(styles.frameRow), children: _jsx(ResizableSidebar, { frame: frame.value, children: framed }) })] }) }));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The sidebar beside the file in a splitter: drag its edge, or use the arrow keys on it, to
|
|
141
|
+
* resize it; the scope's `preferences` remember the width. The sidebar button folds it away.
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* The sidebar beside the open file. The splitter stays whether or not the viewer has a sidebar,
|
|
145
|
+
* collapsed without one, so the open file keeps its place in the tree as the viewer narrows or
|
|
146
|
+
* widens, such as a pane going full screen, and keeps an edit, search and scroll position.
|
|
147
|
+
*/
|
|
148
|
+
function ResizableSidebar({ frame, children, }) {
|
|
149
|
+
const [width, setWidth] = usePreference('viewer.sidebarWidth', SIDEBAR_WIDTH);
|
|
150
|
+
return (_jsxs(WindowSplitter, { children: [_jsx(WindowPane, { id: "file-viewer-sidebar", "aria-label": "Sidebar", defaultSize: width, minSize: SIDEBAR_MIN_WIDTH, maxSize: "50%", isCollapsible: true, state: frame.isSidebarOpen ? 'normal' : 'collapsed',
|
|
151
|
+
// Collapsed for an empty sidebar isn't the reader's choice, so it isn't kept.
|
|
152
|
+
onStateChange: (state) => {
|
|
153
|
+
if (frame.hasSidebar && !frame.isSidebarEmpty)
|
|
154
|
+
frame.onSidebarOpenChange(state !== 'collapsed');
|
|
155
|
+
}, onResize: ({ size }) => {
|
|
156
|
+
if (size >= SIDEBAR_MIN_WIDTH)
|
|
157
|
+
setWidth(Math.round(size));
|
|
158
|
+
}, children: frame.hasSidebar ? _jsx(ViewerSidebar, { frame: frame }) : null }), _jsx(WindowPane, { id: "file-viewer-file", "aria-label": "File", children: _jsx("div", { ...stylex.props(styles.frameMain, styles.paneFill), children: children }) })] }));
|
|
159
|
+
}
|
|
160
|
+
const SIDEBAR_WIDTH = 240;
|
|
161
|
+
const SIDEBAR_MIN_WIDTH = 180;
|
|
162
|
+
/**
|
|
163
|
+
* The frame's state: whether it's compact, measured on its own box or the collection's, its
|
|
164
|
+
* sidebar, and the open file's structure as its body reports it.
|
|
165
|
+
*/
|
|
166
|
+
function useFrame(isEmbedded, headerTarget) {
|
|
167
|
+
const ref = useRef(null);
|
|
168
|
+
const measured = useIsCompact(ref);
|
|
169
|
+
const outer = useContext(ViewerCollectionContext);
|
|
170
|
+
const collection = isEmbedded ? null : outer;
|
|
171
|
+
const isCompact = !isEmbedded && (collection?.isCompact ?? measured);
|
|
172
|
+
const { renderers } = useFileScope();
|
|
173
|
+
// Pages stays while any renderer here can draw pages, so it doesn't come and go with the file.
|
|
174
|
+
const pagesKind = useMemo(() => renderers.find((renderer) => renderer.capabilities.pages !== undefined)?.capabilities.pages, [renderers]);
|
|
175
|
+
const hasSidebar = !isEmbedded && !isCompact && (pagesKind !== undefined || collection !== null);
|
|
176
|
+
const [isSidebarShown, setSidebarShown] = usePreference('viewer.sidebar', true);
|
|
177
|
+
const [structure, setStructure] = useState(undefined);
|
|
178
|
+
const navigate = useRef(ignore);
|
|
179
|
+
const [previewCacheKey, setPreviewCacheKey] = useState(undefined);
|
|
180
|
+
// The open file's renderer's pages; `null` for a renderer without them, `undefined` for none open.
|
|
181
|
+
const [openedPagesKind, setOpenedPagesKind] = useState(undefined);
|
|
182
|
+
const [headerSlot, setHeaderSlot] = useState(null);
|
|
183
|
+
const isSidebarEmpty = collection === null && openedPagesKind === null;
|
|
184
|
+
const value = useMemo(() => ({
|
|
185
|
+
isCompact,
|
|
186
|
+
hasSidebar,
|
|
187
|
+
isSidebarOpen: hasSidebar && !isSidebarEmpty && isSidebarShown,
|
|
188
|
+
isSidebarEmpty,
|
|
189
|
+
onSidebarOpenChange: setSidebarShown,
|
|
190
|
+
pagesKind: pagesKind === undefined ? undefined : (openedPagesKind ?? pagesKind),
|
|
191
|
+
isOpenFilePaged: openedPagesKind === undefined ? undefined : openedPagesKind !== null,
|
|
192
|
+
onOpenedPagesKindChange: setOpenedPagesKind,
|
|
193
|
+
structure,
|
|
194
|
+
reportStructure: setStructure,
|
|
195
|
+
navigate,
|
|
196
|
+
previewCacheKey,
|
|
197
|
+
onPreviewCacheKeyChange: setPreviewCacheKey,
|
|
198
|
+
headerSlot: isEmbedded ? null : headerTarget === undefined ? headerSlot : headerTarget,
|
|
199
|
+
isHeaderHosted: !isEmbedded && headerTarget !== undefined,
|
|
200
|
+
collection,
|
|
201
|
+
}), [
|
|
202
|
+
collection,
|
|
203
|
+
hasSidebar,
|
|
204
|
+
headerSlot,
|
|
205
|
+
headerTarget,
|
|
206
|
+
isCompact,
|
|
207
|
+
isEmbedded,
|
|
208
|
+
isSidebarEmpty,
|
|
209
|
+
isSidebarShown,
|
|
210
|
+
openedPagesKind,
|
|
211
|
+
pagesKind,
|
|
212
|
+
previewCacheKey,
|
|
213
|
+
setSidebarShown,
|
|
214
|
+
structure,
|
|
215
|
+
]);
|
|
216
|
+
return { ref, onHeaderSlot: setHeaderSlot, value };
|
|
217
|
+
}
|
|
218
|
+
function OpenFile({ store, entry, onEntryChange, onDeleted, variant = 'standard', embedHeight = 'container', location: locationProp, defaultLocation, onLocationChange, query: queryProp, defaultQuery, onQueryChange, annotations, activeAnnotation, onActiveAnnotationChange, leading, trailing, }) {
|
|
219
|
+
const { renderers, thumbnailCache, fileActions } = useFileScope();
|
|
220
|
+
const path = store.path(entry) ?? entry.name;
|
|
221
|
+
const matches = useMemo(() => matchRenderers(renderers, entry, path), [renderers, entry, path]);
|
|
222
|
+
// Its thumbnail is drawn now, from what the viewer reads, by the renderer that opens it by
|
|
223
|
+
// default: browsing never downloads a file to draw one.
|
|
224
|
+
const primary = matches[0];
|
|
225
|
+
useEffect(() => {
|
|
226
|
+
if (primary === undefined)
|
|
227
|
+
return;
|
|
228
|
+
if (primary.maxSize !== undefined && (entry.size ?? 0) > primary.maxSize)
|
|
229
|
+
return;
|
|
230
|
+
drawThumbnailOnOpen(store, entry, primary, thumbnailCache);
|
|
231
|
+
}, [store, entry, primary, thumbnailCache]);
|
|
232
|
+
const [openWithId, setOpenWithId] = usePreference(`openWith:${entry.mediaType ?? entry.name.split('.').pop()}`, undefined);
|
|
233
|
+
const renderer = matches.find((candidate) => candidate.id === openWithId) ?? matches[0];
|
|
234
|
+
const toast = useContext(ToastContext);
|
|
235
|
+
// In a path-keyed source, a file's relative references name the files beside it.
|
|
236
|
+
const readRelative = useMemo(() => {
|
|
237
|
+
if (store.source.keys !== 'path')
|
|
238
|
+
return undefined;
|
|
239
|
+
const fromKey = entry.key;
|
|
240
|
+
return async (href, options) => {
|
|
241
|
+
const base = options?.from === undefined ? fromKey : resolveRelativeKey(fromKey, options.from);
|
|
242
|
+
const key = base === null ? null : resolveRelativeKey(base, href);
|
|
243
|
+
if (key === null)
|
|
244
|
+
return null;
|
|
245
|
+
try {
|
|
246
|
+
const target = await store.source.get(key, { signal: new AbortController().signal });
|
|
247
|
+
return target.kind === 'file' ? await store.content(target).blob() : null;
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}, [store, entry.key]);
|
|
254
|
+
const [location, setLocation] = useControllable(locationProp, defaultLocation, onLocationChange);
|
|
255
|
+
const [query, setQuery] = useControllable(queryProp, defaultQuery ?? '', onQueryChange);
|
|
256
|
+
const [isSearching, setSearching] = useState(query !== '');
|
|
257
|
+
useEffect(() => {
|
|
258
|
+
if (queryProp !== undefined && queryProp !== '')
|
|
259
|
+
setSearching(true);
|
|
260
|
+
}, [queryProp]);
|
|
261
|
+
const [activeMatch, setActiveMatch] = useState(0);
|
|
262
|
+
const [matchCount, setMatchCount] = useState(undefined);
|
|
263
|
+
const [extent, setExtent] = useState(undefined);
|
|
264
|
+
const [selection, setSelection] = useState(null);
|
|
265
|
+
const rendererId = renderer?.id ?? 'none';
|
|
266
|
+
const [zoom, setZoom] = usePreference(`${rendererId}.zoom`, { kind: 'fitWidth' });
|
|
267
|
+
const [layout, setLayout] = usePreference(`${rendererId}.layout`, 'continuous');
|
|
268
|
+
const [arePropertiesShown, setPropertiesShown] = usePreference(`${rendererId}.properties`, true);
|
|
269
|
+
// The open file's properties, as its body counts them; another file or renderer starts at none.
|
|
270
|
+
const propertiesKey = `${rendererId}:${entry.key}`;
|
|
271
|
+
const [counted, setCounted] = useState({ key: propertiesKey, count: 0 });
|
|
272
|
+
const propertyCount = counted.key === propertiesKey ? counted.count : 0;
|
|
273
|
+
const countProperties = useCallback((count) => setCounted({ key: propertiesKey, count }), [propertiesKey]);
|
|
274
|
+
// Rotation belongs to the open file: another file, or this one opened again, starts upright.
|
|
275
|
+
const [turned, setTurned] = useState({
|
|
276
|
+
key: entry.key,
|
|
277
|
+
rotation: 0,
|
|
278
|
+
});
|
|
279
|
+
const rotation = turned.key === entry.key ? turned.rotation : 0;
|
|
280
|
+
const [isPresenting, setPresenting] = useState(false);
|
|
281
|
+
const rootRef = useRef(null);
|
|
282
|
+
const frame = useViewerFrame();
|
|
283
|
+
const isCompact = frame.isCompact;
|
|
284
|
+
const isEmbedded = variant === 'embedded';
|
|
285
|
+
const embeddedRootRef = useMemo(() => mergeRefs(rootRef, trackRegionActivity), []);
|
|
286
|
+
const engagement = useScrollEngagement(rootRef);
|
|
287
|
+
// An embed is never compact, as it has no frame of its own, but narrow its toolbar folds away.
|
|
288
|
+
const isNarrowEmbed = useIsCompact(rootRef) && isEmbedded;
|
|
289
|
+
// A narrow viewer has no room for a spread: it draws the pages one by one, as its View says,
|
|
290
|
+
// and keeps the reader's Spread for when it's wide again.
|
|
291
|
+
const shownLayout = (isCompact || isNarrowEmbed) && layout === 'spread' ? 'continuous' : layout;
|
|
292
|
+
const [isFullScreen, setFullScreen] = useState(false);
|
|
293
|
+
// The embed's search bar replaces its toolbar, so closing it puts focus back on Search.
|
|
294
|
+
const [hasSearched, setHasSearched] = useState(false);
|
|
295
|
+
if (isSearching && !hasSearched)
|
|
296
|
+
setHasSearched(true);
|
|
297
|
+
// What the body reports about the file, and what the frame draws from it: the sidebar's
|
|
298
|
+
// Pages, the marker rail, Contents and the page pill.
|
|
299
|
+
const structure = frame.structure;
|
|
300
|
+
const pages = structure?.pages;
|
|
301
|
+
const outline = structure?.outline ?? NO_OUTLINE;
|
|
302
|
+
// The title names the section being read once the reader is in one further in; at the file's
|
|
303
|
+
// top item, such as a PDF's first bookmark or the title heading over the rest, it names none.
|
|
304
|
+
const current = outline.find((item) => item.id === structure?.currentOutlineId);
|
|
305
|
+
const section = current === undefined || isTopItem(outline, current) ? undefined : current;
|
|
306
|
+
const previewCacheKey = renderer === undefined
|
|
307
|
+
? undefined
|
|
308
|
+
: `${fileCacheKey(store.source, entry)}preview/${encodeURIComponent(renderer.id)}/`;
|
|
309
|
+
const { onPreviewCacheKeyChange, onOpenedPagesKindChange, navigate } = frame;
|
|
310
|
+
const openedPagesKind = renderer?.capabilities.pages ?? null;
|
|
311
|
+
useLayoutEffect(() => {
|
|
312
|
+
onPreviewCacheKeyChange(previewCacheKey);
|
|
313
|
+
onOpenedPagesKindChange(openedPagesKind);
|
|
314
|
+
}, [onOpenedPagesKindChange, onPreviewCacheKeyChange, openedPagesKind, previewCacheKey]);
|
|
315
|
+
// Closed, or another file loading: Pages waits to know whether it has pages.
|
|
316
|
+
useLayoutEffect(() => () => onOpenedPagesKindChange(undefined), [onOpenedPagesKindChange]);
|
|
317
|
+
useLayoutEffect(() => {
|
|
318
|
+
navigate.current = setLocation;
|
|
319
|
+
});
|
|
320
|
+
// The end of the file scrolls clear of the app's chrome over the bottom of the screen, such as
|
|
321
|
+
// a composer, with a gap. On a narrow viewer, the bottom row holds the page pill and, in a
|
|
322
|
+
// collection, Next file, stacked above that chrome; the end keeps one row's room more whenever
|
|
323
|
+
// the row is there, so the last line scrolls clear of it too. An embed sits in the flow of its
|
|
324
|
+
// page instead.
|
|
325
|
+
const hasBottomRow = isCompact &&
|
|
326
|
+
!isEmbedded &&
|
|
327
|
+
(renderer?.capabilities.pages !== undefined || frame.collection?.next !== undefined);
|
|
328
|
+
const safeEnd = useSafeEndInset();
|
|
329
|
+
const endInset = isEmbedded ? undefined : fileEndInset(safeEnd, hasBottomRow);
|
|
330
|
+
// An embed's name and menu float over the top of the file at every width, so the file starts
|
|
331
|
+
// below them.
|
|
332
|
+
const startInset = isEmbedded ? EMBED_TOP_INSET : undefined;
|
|
333
|
+
const fileFrame = useMemo(() => ({
|
|
334
|
+
isCompact,
|
|
335
|
+
// An embed shows the file alone; a narrow viewer has Contents in the title instead.
|
|
336
|
+
hasMarkers: !isEmbedded && !isCompact && renderer?.capabilities.outline === true,
|
|
337
|
+
structure,
|
|
338
|
+
...(endInset === undefined ? {} : { endInset }),
|
|
339
|
+
...(startInset === undefined ? {} : { startInset }),
|
|
340
|
+
}), [endInset, isCompact, isEmbedded, renderer, startInset, structure]);
|
|
341
|
+
const [isContentsOpen, setContentsOpen] = useState(false);
|
|
342
|
+
// The title that opens Contents, where its popover opens.
|
|
343
|
+
const contentsTrigger = useRef(null);
|
|
344
|
+
const contentsAnchor = useMemo(() => nodeAnchor(() => contentsTrigger.current), []);
|
|
345
|
+
// The page pill's count opens Pages; View opens under the header's end, or an embed's, as its
|
|
346
|
+
// button may be in More actions.
|
|
347
|
+
const pagesTrigger = useRef(null);
|
|
348
|
+
const pagesAnchor = useMemo(() => nodeAnchor(() => pagesTrigger.current), []);
|
|
349
|
+
const headerSlot = frame.headerSlot;
|
|
350
|
+
const viewAnchor = useMemo(() => nodeAnchor(() => (isEmbedded ? rootRef.current : headerSlot)), [headerSlot, isEmbedded]);
|
|
351
|
+
const [isPagesOpen, setPagesOpen] = useState(false);
|
|
352
|
+
const [isViewOpen, setViewOpen] = useState(false);
|
|
353
|
+
// On a narrow viewer in a collection, Next file stays in the bottom row, like the page pill,
|
|
354
|
+
// until the last file.
|
|
355
|
+
const nextFile = isCompact && !isEmbedded ? frame.collection?.next : undefined;
|
|
356
|
+
const [isRenaming, setRenaming] = useState(false);
|
|
357
|
+
const [isGoingTo, setGoingTo] = useState(false);
|
|
358
|
+
const { requestDelete, confirmation } = useDeleteEntries(store);
|
|
359
|
+
const { copyLink, share, dialog: shareDialog } = useShareEntry(store);
|
|
360
|
+
const canLink = canPerform(store.source, entry, 'link');
|
|
361
|
+
const dismiss = useContext(DismissContext);
|
|
362
|
+
// In a Sheet or Modal, start inside the viewer so Escape reaches it: it closes search
|
|
363
|
+
// before the overlay.
|
|
364
|
+
const isInOverlay = dismiss !== null && !isEmbedded;
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
if (isInOverlay && !rootRef.current?.contains(document.activeElement))
|
|
367
|
+
rootRef.current?.focus();
|
|
368
|
+
}, [isInOverlay]);
|
|
369
|
+
useEffect(() => setActiveMatch(0), [query]);
|
|
370
|
+
// Opened at a place with a query, such as from a search hit, the match there is the active one
|
|
371
|
+
// once the body says where its matches are. A collection's text match can open another place
|
|
372
|
+
// in the open file, too.
|
|
373
|
+
const startAt = useRef(location !== undefined && query.trim() !== '' ? location : undefined);
|
|
374
|
+
const matchLocations = useRef(undefined);
|
|
375
|
+
const jump = frame.collection?.jump;
|
|
376
|
+
const jumpId = jump?.id;
|
|
377
|
+
useEffect(() => {
|
|
378
|
+
if (jump === undefined)
|
|
379
|
+
return;
|
|
380
|
+
// A file opened there already has it; its body reports where it lands.
|
|
381
|
+
if (!sameLocation(location, jump.location))
|
|
382
|
+
setLocation(jump.location);
|
|
383
|
+
if (query.trim() !== '')
|
|
384
|
+
setSearching(true);
|
|
385
|
+
const known = matchLocations.current;
|
|
386
|
+
if (known === undefined)
|
|
387
|
+
startAt.current = jump.location;
|
|
388
|
+
else
|
|
389
|
+
setActiveMatch(matchIndexAt(known, jump.location));
|
|
390
|
+
// Only another opening moves the file; the reader's own scrolling doesn't.
|
|
391
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
392
|
+
}, [jumpId]);
|
|
393
|
+
const reportMatches = useCallback((count, locations) => {
|
|
394
|
+
setMatchCount(count);
|
|
395
|
+
matchLocations.current = locations;
|
|
396
|
+
const target = startAt.current;
|
|
397
|
+
if (target === undefined || locations === undefined || count === 0)
|
|
398
|
+
return;
|
|
399
|
+
startAt.current = undefined;
|
|
400
|
+
setActiveMatch(matchIndexAt(locations, target));
|
|
401
|
+
}, []);
|
|
402
|
+
// Pages and lines are reached through Go to in the More menu; times will get a scrubber.
|
|
403
|
+
const goToUnit = extent?.kind === 'page' || extent?.kind === 'line' ? extent.kind : undefined;
|
|
404
|
+
const search = {
|
|
405
|
+
query,
|
|
406
|
+
matchCount,
|
|
407
|
+
activeMatch,
|
|
408
|
+
onQueryChange: setQuery,
|
|
409
|
+
onStep: (direction) => {
|
|
410
|
+
if (matchCount === undefined || matchCount === 0)
|
|
411
|
+
return;
|
|
412
|
+
setActiveMatch((current) => (current + direction + matchCount) % matchCount);
|
|
413
|
+
},
|
|
414
|
+
// Closing hides the bar and its matches; the words stay for when search opens again.
|
|
415
|
+
onDone: () => setSearching(false),
|
|
416
|
+
};
|
|
417
|
+
// The renderers whose editors can edit this file, such as Markdown's rich text and Code's
|
|
418
|
+
// source. Switching moves the edit, unsaved text included, to another one until it ends.
|
|
419
|
+
const editors = useMemo(() => matches.filter((candidate) => candidate.capabilities.edit === true), [matches]);
|
|
420
|
+
const [switched, setSwitched] = useState(null);
|
|
421
|
+
const switchedRenderer = switched === null
|
|
422
|
+
? undefined
|
|
423
|
+
: editors.find((candidate) => candidate.id === switched.rendererId);
|
|
424
|
+
// Editing the file's text, in the standard viewer; an embed opens full screen first.
|
|
425
|
+
const edit = useFileEditing({
|
|
426
|
+
store,
|
|
427
|
+
entry,
|
|
428
|
+
canEdit: !isEmbedded &&
|
|
429
|
+
renderer?.capabilities.edit === true &&
|
|
430
|
+
canPerform(store.source, entry, 'edit'),
|
|
431
|
+
search: renderer?.capabilities.search === true
|
|
432
|
+
? { ...search, isSearching, onOpen: () => setSearching(true) }
|
|
433
|
+
: undefined,
|
|
434
|
+
editors: renderer === undefined
|
|
435
|
+
? undefined
|
|
436
|
+
: {
|
|
437
|
+
others: editors.filter((candidate) => candidate.id !== (switchedRenderer ?? renderer).id),
|
|
438
|
+
onSwitch: (target) => switchEditor(target),
|
|
439
|
+
},
|
|
440
|
+
});
|
|
441
|
+
// Save and Cancel end the edit: the reader's own Open with choice shows the file again.
|
|
442
|
+
if (!edit.isEditing && switched !== null)
|
|
443
|
+
setSwitched(null);
|
|
444
|
+
/** The renderer drawing the file: while editing, the editor the reader switched to. */
|
|
445
|
+
const shown = edit.isEditing ? (switchedRenderer ?? renderer) : renderer;
|
|
446
|
+
const switchEditor = (target) => {
|
|
447
|
+
const draft = edit.readDraft() ?? undefined;
|
|
448
|
+
// The new editor reports its own changes; until then, the edit is this text.
|
|
449
|
+
if (draft !== undefined)
|
|
450
|
+
edit.keepDraft(draft);
|
|
451
|
+
setSelection(null);
|
|
452
|
+
setSwitched({ rendererId: target.id, draft: draft ?? switched?.draft });
|
|
453
|
+
};
|
|
454
|
+
const switchId = useId();
|
|
455
|
+
const nextEditor = shown === undefined || editors.length < 2
|
|
456
|
+
? undefined
|
|
457
|
+
: editors[(editors.findIndex((candidate) => candidate.id === shown.id) + 1) % editors.length];
|
|
458
|
+
useShortcut({
|
|
459
|
+
id: `${switchId}-switch-editor`,
|
|
460
|
+
label: 'Switch editor',
|
|
461
|
+
category: 'File',
|
|
462
|
+
keys: ['mod', 'shift', 'e'],
|
|
463
|
+
allowInEditable: true,
|
|
464
|
+
isDisabled: !edit.isEditing || edit.isSaving || nextEditor === undefined,
|
|
465
|
+
onAction: () => {
|
|
466
|
+
if (nextEditor !== undefined)
|
|
467
|
+
switchEditor(nextEditor);
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
// ⌘F searches the file, editing or not, while focus is in the viewer.
|
|
471
|
+
const findId = useId();
|
|
472
|
+
useShortcut({
|
|
473
|
+
id: `${findId}-find`,
|
|
474
|
+
label: 'Search in file',
|
|
475
|
+
category: 'File',
|
|
476
|
+
keys: ['mod', 'f'],
|
|
477
|
+
allowInEditable: true,
|
|
478
|
+
isDisabled: renderer?.capabilities.search !== true || isEmbedded,
|
|
479
|
+
onAction: () => setSearching(true),
|
|
480
|
+
});
|
|
481
|
+
// Annotations can be hidden to read the file as it is.
|
|
482
|
+
const [areAnnotationsShown, setAnnotationsShown] = useState(true);
|
|
483
|
+
const controls = {
|
|
484
|
+
renderer,
|
|
485
|
+
openWith: matches,
|
|
486
|
+
// Unsaved changes are asked about first: another renderer shows the saved file.
|
|
487
|
+
onOpenWith: (next) => edit.leave(() => setOpenWithId(next.id)),
|
|
488
|
+
location,
|
|
489
|
+
extent,
|
|
490
|
+
goToUnit,
|
|
491
|
+
onGoTo: goToUnit === undefined ? undefined : () => setGoingTo(true),
|
|
492
|
+
zoom,
|
|
493
|
+
onZoomChange: setZoom,
|
|
494
|
+
rotation,
|
|
495
|
+
onRotate: (direction) => setTurned({
|
|
496
|
+
key: entry.key,
|
|
497
|
+
rotation: ((rotation + direction * 90 + 360) % 360),
|
|
498
|
+
}),
|
|
499
|
+
layout: shownLayout,
|
|
500
|
+
onLayoutChange: setLayout,
|
|
501
|
+
hasProperties: propertyCount > 0,
|
|
502
|
+
arePropertiesShown,
|
|
503
|
+
onPropertiesShownChange: setPropertiesShown,
|
|
504
|
+
onPresent: () => setPresenting(true),
|
|
505
|
+
isSearching,
|
|
506
|
+
onSearch: isSearching ? search.onDone : () => setSearching(true),
|
|
507
|
+
// Search stays open and follows the draft; annotations, places in the saved text, step aside.
|
|
508
|
+
onEdit: edit.onEdit === undefined
|
|
509
|
+
? undefined
|
|
510
|
+
: () => {
|
|
511
|
+
setSelection(null);
|
|
512
|
+
edit.onEdit?.();
|
|
513
|
+
},
|
|
514
|
+
hasAnnotations: (annotations?.length ?? 0) > 0,
|
|
515
|
+
areAnnotationsShown,
|
|
516
|
+
onAnnotationsShownChange: setAnnotationsShown,
|
|
517
|
+
onDownload: canPerform(store.source, entry, 'download')
|
|
518
|
+
? () => void downloadEntry(store, entry)
|
|
519
|
+
: undefined,
|
|
520
|
+
// Links point at the page or passage being read.
|
|
521
|
+
onCopyLink: canLink ? () => copyLink(entry, location) : undefined,
|
|
522
|
+
onShare: canLink ? () => share(entry, location) : undefined,
|
|
523
|
+
onRename: canPerform(store.source, entry, 'rename') ? () => setRenaming(true) : undefined,
|
|
524
|
+
onDelete: canPerform(store.source, entry, 'delete')
|
|
525
|
+
? () => requestDelete({ entries: [entry], onDeleted })
|
|
526
|
+
: undefined,
|
|
527
|
+
file: { entry, source: store.source, location },
|
|
528
|
+
exports: (renderer?.exports ?? []).map((item) => ({
|
|
529
|
+
label: item.label,
|
|
530
|
+
icon: item.icon,
|
|
531
|
+
onExport: () => void item.render(store.content(entry), { entry }).then((blob) => downloadBlob(blob, item.fileName(entry)), (error) => toast?.({
|
|
532
|
+
title: `Couldn't ${item.label.toLowerCase()}`,
|
|
533
|
+
...descriptionOf(error),
|
|
534
|
+
tone: 'danger',
|
|
535
|
+
})),
|
|
536
|
+
})),
|
|
537
|
+
};
|
|
538
|
+
const clearSelection = useCallback(() => {
|
|
539
|
+
setSelection(null);
|
|
540
|
+
globalThis.getSelection?.()?.removeAllRanges();
|
|
541
|
+
}, []);
|
|
542
|
+
// A selection an action keeps, such as one being commented on, drawn as an accent highlight:
|
|
543
|
+
// the reader's own selection goes when focus moves into the action's popover.
|
|
544
|
+
const [heldRange, setHeldRange] = useState(null);
|
|
545
|
+
const shownAnnotations = useMemo(() => {
|
|
546
|
+
// Hidden, except the active one: the reader was sent there, such as by a citation.
|
|
547
|
+
const visible = areAnnotationsShown
|
|
548
|
+
? (annotations ?? [])
|
|
549
|
+
: (annotations ?? []).filter((annotation) => annotation.kind === activeAnnotation?.kind && annotation.id === activeAnnotation.id);
|
|
550
|
+
return heldRange === null
|
|
551
|
+
? visible
|
|
552
|
+
: [
|
|
553
|
+
...visible,
|
|
554
|
+
{ kind: 'highlight', id: HELD_SELECTION, range: heldRange, tone: 'accent' },
|
|
555
|
+
];
|
|
556
|
+
}, [activeAnnotation, annotations, areAnnotationsShown, heldRange]);
|
|
557
|
+
const pressPin = useMemo(() => onActiveAnnotationChange === undefined
|
|
558
|
+
? undefined
|
|
559
|
+
: (annotation) => onActiveAnnotationChange(annotation, nodeAnchor(() => document.querySelector(`[data-eds-annotation-pin="${CSS.escape(annotation.id)}"]`))), [onActiveAnnotationChange]);
|
|
560
|
+
// The toolbar for the reader's selection; FileContent places it. A presentation has none.
|
|
561
|
+
const selectionToolbar = useMemo(() =>
|
|
562
|
+
// A selection without words or the scope's actions has nothing to offer.
|
|
563
|
+
selection === null ||
|
|
564
|
+
renderer === undefined ||
|
|
565
|
+
((selection.text ?? '') === '' && fileActions.length === 0)
|
|
566
|
+
? null
|
|
567
|
+
: {
|
|
568
|
+
getRect: () => anchorRect(selection.anchor),
|
|
569
|
+
toolbar: (_jsx(SelectionToolbar, { selection: {
|
|
570
|
+
range: selection.range,
|
|
571
|
+
text: selection.text,
|
|
572
|
+
anchor: selection.anchor,
|
|
573
|
+
keepUntil: (done) => {
|
|
574
|
+
const range = selection.range;
|
|
575
|
+
setHeldRange(range);
|
|
576
|
+
clearSelection();
|
|
577
|
+
void done
|
|
578
|
+
.catch(() => undefined)
|
|
579
|
+
.finally(() => setHeldRange((held) => (held === range ? null : held)));
|
|
580
|
+
},
|
|
581
|
+
clear: clearSelection,
|
|
582
|
+
}, canSearch: renderer.capabilities.search === true, onSearch: (text) => {
|
|
583
|
+
setQuery(text);
|
|
584
|
+
setSearching(true);
|
|
585
|
+
clearSelection();
|
|
586
|
+
} })),
|
|
587
|
+
}, [clearSelection, fileActions, renderer, selection, setQuery]);
|
|
588
|
+
// Links inside the file to other entries open them here, through the source's `resolve`.
|
|
589
|
+
const openEntry = useRef(onEntryChange);
|
|
590
|
+
useLayoutEffect(() => {
|
|
591
|
+
openEntry.current = onEntryChange;
|
|
592
|
+
});
|
|
593
|
+
const source = store.source;
|
|
594
|
+
const links = useMemo(() => {
|
|
595
|
+
if (source.resolve === undefined)
|
|
596
|
+
return undefined;
|
|
597
|
+
return async (uri, options) => {
|
|
598
|
+
const target = await source.resolve?.(uri, options);
|
|
599
|
+
if (target === null || target === undefined)
|
|
600
|
+
return null;
|
|
601
|
+
return { entry: target, open: () => openEntry.current(target.key) };
|
|
602
|
+
};
|
|
603
|
+
}, [source]);
|
|
604
|
+
/** The renderer's body, in the viewer or, `presenting`, full screen. */
|
|
605
|
+
// While editing, the body stays on the file as editing found it; see `useFileEditing`.
|
|
606
|
+
const bodyEntry = edit.edited?.entry ?? entry;
|
|
607
|
+
const bodyContent = edit.edited?.content ?? store.content(entry);
|
|
608
|
+
const renderBody = (renderer, presenting) => (_jsx(BodyBoundary, { children: _jsx(Suspense, { fallback: _jsx(FileBodyLoading, { store: store, content: bodyContent, name: entry.name, shape: skeletonShape(renderer) }), children: _jsx(FileSelectionToolbarContext, { value: presenting ? null : selectionToolbar, children: _jsx(FileStructureReportContext, { value: presenting ? null : frame.reportStructure, children: _jsx(FileFrameContext, { value: presenting ? PRESENTING_FRAME : fileFrame, children: _jsx(FilePreviewCacheKeyContext, { value: previewCacheKey, children: _jsx(FileLinksContext, { value: links, children: _jsx(RendererBody, { renderer: renderer, props: bodyProps(renderer, {
|
|
609
|
+
entry: bodyEntry,
|
|
610
|
+
content: bodyContent,
|
|
611
|
+
readRelative,
|
|
612
|
+
location,
|
|
613
|
+
onLocationChange: setLocation,
|
|
614
|
+
onExtentChange: setExtent,
|
|
615
|
+
query: isSearching && !presenting ? query : '',
|
|
616
|
+
activeMatch,
|
|
617
|
+
// Search stays with the viewer behind the presentation.
|
|
618
|
+
onMatchCountChange: presenting ? ignore : reportMatches,
|
|
619
|
+
zoom,
|
|
620
|
+
onZoomChange: setZoom,
|
|
621
|
+
rotation,
|
|
622
|
+
layout: shownLayout,
|
|
623
|
+
arePropertiesShown,
|
|
624
|
+
onPropertyCountChange: presenting ? ignore : countProperties,
|
|
625
|
+
isPresenting: presenting,
|
|
626
|
+
onPresentingChange: setPresenting,
|
|
627
|
+
// The presentation shows the file as it is saved.
|
|
628
|
+
isEditing: !presenting && edit.bodyProps.isEditing,
|
|
629
|
+
onDraftChange: edit.bodyProps.onDraftChange,
|
|
630
|
+
draft: presenting ? undefined : switched?.draft,
|
|
631
|
+
replace: presenting ? undefined : edit.bodyProps.replace,
|
|
632
|
+
annotations: edit.isEditing && !presenting ? NO_ANNOTATIONS : shownAnnotations,
|
|
633
|
+
activeAnnotation,
|
|
634
|
+
onAnnotationPress: pressPin,
|
|
635
|
+
onSelect: (range, text, anchor) => {
|
|
636
|
+
if (presenting || edit.isEditing)
|
|
637
|
+
return;
|
|
638
|
+
setSelection(range === null || anchor === undefined ? null : { range, text, anchor });
|
|
639
|
+
},
|
|
640
|
+
}) }) }) }) }) }) }) }) }, `${renderer.id}:${bodyEntry.key}:${bodyEntry.version ?? ''}:${presenting}:${edit.bodyKey}`));
|
|
641
|
+
return (
|
|
642
|
+
// Inside FileViewerFrame's Shortcuts scope, which takes in the header it portals.
|
|
643
|
+
_jsxs(_Fragment, { children: [_jsx(ZoomShortcuts, { zoom: zoom, onZoomChange: setZoom, isDisabled: renderer?.capabilities.zoom !== true || isPresenting }), _jsxs("div", { ref: isEmbedded ? embeddedRootRef : rootRef, tabIndex: isInOverlay ? -1 : undefined, "data-eds-reveal-region": isEmbedded ? '' : undefined, ...(isEmbedded ? { role: 'group', 'aria-label': entry.name } : {}), ...stylex.props(styles.root, isEmbedded && styles.embedded, isEmbedded &&
|
|
644
|
+
embedHeight === 'renderer' &&
|
|
645
|
+
embedHeightStyles[renderer === undefined ? 'short' : (renderer.embedHeight ?? 'medium')], isEmbedded && revealStyles.regionBehavior), ...(isEmbedded ? engagement.rootProps : {}), onKeyDown: (event) => {
|
|
646
|
+
// ⌘= and ⌘_ zoom the file too; ZoomShortcuts has ⌘+, ⌘− and ⌘0.
|
|
647
|
+
if (renderer?.capabilities.zoom === true &&
|
|
648
|
+
!isPresenting &&
|
|
649
|
+
handleZoomKey(event, zoom, setZoom))
|
|
650
|
+
return;
|
|
651
|
+
if (event.key !== 'Escape' || event.defaultPrevented)
|
|
652
|
+
return;
|
|
653
|
+
if (isSearching)
|
|
654
|
+
setSearching(false);
|
|
655
|
+
else if (dismiss !== null)
|
|
656
|
+
dismiss();
|
|
657
|
+
else
|
|
658
|
+
return;
|
|
659
|
+
event.preventDefault();
|
|
660
|
+
}, children: [isEmbedded ? (isSearching ? (_jsx(EmbeddedSearch, { ...search })) : (_jsx(EmbeddedChrome, { entry: entry, controls: controls, isNarrow: isNarrowEmbed, onOpenView: () => setViewOpen(true), shouldFocusSearch: hasSearched, onFullScreen: () => setFullScreen(true) }))) : edit.isEditing ? (edit.chrome) : (_jsx(FileChrome, { entry: entry, controls: controls, leading: leading, trailing: trailing, section: section?.label, onOpenContents: isCompact && renderer?.capabilities.outline === true && outline.length > 0
|
|
661
|
+
? () => setContentsOpen(true)
|
|
662
|
+
: undefined, contentsTriggerRef: contentsTrigger, onOpenView: isCompact ? () => setViewOpen(true) : undefined })), !isEmbedded && isSearching ? (
|
|
663
|
+
// The header's Search toggle closes it, so the bar has no Done.
|
|
664
|
+
_jsx("div", { ...stylex.props(styles.chrome, styles.headerRow), children: _jsx(SearchControls, { ...search, onDone: undefined, leading: edit.replaceToggle }) })) : null, edit.replaceRow, edit.notice, _jsxs("div", { ...stylex.props(styles.body, isEmbedded && styles.embeddedBody), inert: edit.isSaving, children: [isEmbedded && !engagement.isEngaged ? (_jsx(ScrollShield, { onEngage: engagement.engage })) : null, renderer === undefined ? (_jsx(ViewerState, { title: `No preview for ${describeType(entry)}`, description: "Download the file to open it.", action: _jsx(Button, { onPress: () => void downloadEntry(store, entry), children: "Download" }) })) : renderer.maxSize !== undefined && (entry.size ?? 0) > renderer.maxSize ? (_jsx(ViewerState, { title: "Too large to preview", description: "Download the file to open it.", action: _jsx(Button, { onPress: () => void downloadEntry(store, entry), children: "Download" }) })) : (renderBody(shown ?? renderer, false)), !isEmbedded && pages !== undefined && !isCompact && !frame.isSidebarOpen ? (_jsx(PageBadge, { pages: pages }, entry.key)) : null, hasBottomRow && (pages !== undefined || nextFile !== undefined) ? (_jsx(BottomRow
|
|
665
|
+
// The reader moving through the file brings the row forward; so does a new file.
|
|
666
|
+
, {
|
|
667
|
+
// The reader moving through the file brings the row forward; so does a new file.
|
|
668
|
+
activity: `${entry.key}:${pages?.current ?? ''}`, pill: pages === undefined ? null : (_jsx(PagePill, { pages: pages, kind: renderer?.capabilities.pages, onGo: (page) => setLocation({ kind: 'page', page }), onOpenPages: () => setPagesOpen(true), pagesTriggerRef: pagesTrigger })), next: nextFile === undefined ? null : (_jsx(NextFileChip, { name: nextFile.name, mediaType: nextFile.mediaType, onOpen: nextFile.open })) })) : null, isCompact && !isEmbedded && renderer?.capabilities.zoom === true ? (_jsx(ZoomBadge, { zoom: zoom }, entry.key)) : null] }), isNarrowEmbed && hasViewControl(controls) ? (_jsx(ViewOverlay, { isOpen: isViewOpen, onOpenChange: setViewOpen, anchor: viewAnchor, controls: controls })) : null, isCompact && !isEmbedded ? (_jsxs(_Fragment, { children: [_jsx(ContentsOverlay, { isOpen: isContentsOpen, onOpenChange: setContentsOpen, anchor: contentsAnchor, outline: outline, currentId: structure?.currentOutlineId, onSelect: setLocation }), hasViewControl(controls) ? (_jsx(ViewOverlay, { isOpen: isViewOpen, onOpenChange: setViewOpen, anchor: viewAnchor, controls: controls })) : null, pages === undefined ? null : (_jsx(PagesOverlay, { isOpen: isPagesOpen, onOpenChange: setPagesOpen, anchor: pagesAnchor, pages: pages, kind: renderer?.capabilities.pages, previewCacheKey: previewCacheKey, onSelect: setLocation }))] })) : null, _jsx(Modal, { size: "small", isOpen: isGoingTo, onOpenChange: setGoingTo, children: extent?.kind === 'page' ? (_jsx(GoToDialog, { unit: "page", count: extent.page, current: location?.kind === 'page' ? location.page : undefined, onGo: (page) => setLocation({ kind: 'page', page }) })) : extent?.kind === 'line' ? (_jsx(GoToDialog, { unit: "line", count: extent.line, current: location?.kind === 'line' ? location.line : undefined, onGo: (line) => setLocation({ kind: 'line', line }) })) : null }), _jsx(Modal, { size: "small", isOpen: isRenaming, onOpenChange: setRenaming, children: _jsx(RenameDialog, { store: store, entry: entry, onRenamed: (renamed) => {
|
|
669
|
+
if (renamed.key !== entry.key)
|
|
670
|
+
onEntryChange(renamed.key);
|
|
671
|
+
} }) }), confirmation, edit.confirmation, shareDialog, renderer?.capabilities.present === true ? (
|
|
672
|
+
// The frame carries Exit and handles Escape, so the Modal adds no close icon. Focus returns
|
|
673
|
+
// to More actions, where Present is, when it closes; the viewer is at the page or slide the
|
|
674
|
+
// presentation reached.
|
|
675
|
+
_jsx(Modal, { size: "fullscreen", isDismissable: false, "aria-label": entry.name, isOpen: isPresenting, onOpenChange: setPresenting, children: _jsx(PresentingFrame, { onExit: () => setPresenting(false), children: renderBody(renderer, true) }) })) : null, isEmbedded ? (
|
|
676
|
+
// The viewer's chrome carries Close and handles Escape, so the Modal adds no close icon.
|
|
677
|
+
// Focus returns to Full screen when it closes.
|
|
678
|
+
_jsx(Modal, { size: "fullscreen", isDismissable: false, "aria-label": entry.name, isOpen: isFullScreen, onOpenChange: setFullScreen, children: _jsx(FileViewer, { entry: entry.key, onEntryChange: (next) => {
|
|
679
|
+
if (next !== null) {
|
|
680
|
+
onEntryChange(next);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
setFullScreen(false);
|
|
684
|
+
onDeleted();
|
|
685
|
+
}, ...(location === undefined ? {} : { location }), onLocationChange: setLocation, ...(annotations === undefined ? {} : { annotations }), ...(activeAnnotation === undefined ? {} : { activeAnnotation }), ...(onActiveAnnotationChange === undefined ? {} : { onActiveAnnotationChange }) }) })) : null] })] }));
|
|
686
|
+
}
|
|
687
|
+
function RendererBody({ renderer, props, }) {
|
|
688
|
+
const { Body } = use(loadRenderer(renderer));
|
|
689
|
+
return _jsx(Body, { ...props });
|
|
690
|
+
}
|
|
691
|
+
/** Keeps only the props the renderer's capabilities ask for. */
|
|
692
|
+
function bodyProps(renderer, all) {
|
|
693
|
+
const capabilities = renderer.capabilities;
|
|
694
|
+
const props = {
|
|
695
|
+
entry: all.entry,
|
|
696
|
+
content: all.content,
|
|
697
|
+
annotations: all.annotations,
|
|
698
|
+
};
|
|
699
|
+
if (all.readRelative !== undefined)
|
|
700
|
+
props.readRelative = all.readRelative;
|
|
701
|
+
if (all.activeAnnotation !== undefined)
|
|
702
|
+
props.activeAnnotation = all.activeAnnotation;
|
|
703
|
+
if (all.onAnnotationPress !== undefined)
|
|
704
|
+
props.onAnnotationPress = all.onAnnotationPress;
|
|
705
|
+
if (capabilities.locations !== undefined) {
|
|
706
|
+
if (all.location !== undefined)
|
|
707
|
+
props.location = all.location;
|
|
708
|
+
props.onLocationChange = all.onLocationChange;
|
|
709
|
+
props.onExtentChange = all.onExtentChange;
|
|
710
|
+
}
|
|
711
|
+
if (capabilities.search === true) {
|
|
712
|
+
props.query = all.query;
|
|
713
|
+
props.activeMatch = all.activeMatch;
|
|
714
|
+
props.onMatchCountChange = all.onMatchCountChange;
|
|
715
|
+
}
|
|
716
|
+
if (capabilities.zoom === true) {
|
|
717
|
+
props.zoom = all.zoom;
|
|
718
|
+
props.onZoomChange = all.onZoomChange;
|
|
719
|
+
}
|
|
720
|
+
if (capabilities.rotate === true)
|
|
721
|
+
props.rotation = all.rotation;
|
|
722
|
+
if (capabilities.layout === true)
|
|
723
|
+
props.layout = all.layout;
|
|
724
|
+
if (capabilities.properties === true) {
|
|
725
|
+
props.arePropertiesShown = all.arePropertiesShown;
|
|
726
|
+
props.onPropertyCountChange = all.onPropertyCountChange;
|
|
727
|
+
}
|
|
728
|
+
if (capabilities.present === true) {
|
|
729
|
+
props.isPresenting = all.isPresenting;
|
|
730
|
+
props.onPresentingChange = all.onPresentingChange;
|
|
731
|
+
}
|
|
732
|
+
if (capabilities.selection === true) {
|
|
733
|
+
props.onSelect = all.onSelect;
|
|
734
|
+
}
|
|
735
|
+
if (capabilities.edit === true) {
|
|
736
|
+
props.isEditing = all.isEditing;
|
|
737
|
+
props.onDraftChange = all.onDraftChange;
|
|
738
|
+
if (all.replace !== undefined)
|
|
739
|
+
props.replace = all.replace;
|
|
740
|
+
if (all.draft !== undefined)
|
|
741
|
+
props.draft = all.draft;
|
|
742
|
+
}
|
|
743
|
+
return props;
|
|
744
|
+
}
|
|
745
|
+
function ViewerState({ title, description, action, }) {
|
|
746
|
+
return (_jsx("div", { ...stylex.props(styles.state), children: _jsx(EmptyState, { title: title, ...(description === undefined ? {} : { description }), children: action }) }));
|
|
747
|
+
}
|
|
748
|
+
function EntryError({ error, onRetry }) {
|
|
749
|
+
const kind = fileSourceErrorKind(error);
|
|
750
|
+
if (kind === 'not-found') {
|
|
751
|
+
return (_jsx(ViewerState, { title: "This file doesn't exist", description: "It may have been moved or deleted." }));
|
|
752
|
+
}
|
|
753
|
+
if (kind === 'forbidden') {
|
|
754
|
+
return _jsx(ViewerState, { title: "You don't have access to this file" });
|
|
755
|
+
}
|
|
756
|
+
return (_jsx(ViewerState, { title: "Couldn't open this file", ...descriptionOf(error), action: _jsx(Button, { onPress: onRetry, children: "Retry" }) }));
|
|
757
|
+
}
|
|
758
|
+
/** A renderer that throws shows the error with Retry, which mounts the body again. */
|
|
759
|
+
class BodyBoundary extends Component {
|
|
760
|
+
state = { error: undefined };
|
|
761
|
+
static getDerivedStateFromError(error) {
|
|
762
|
+
return { error: error ?? new Error('Renderer failed') };
|
|
763
|
+
}
|
|
764
|
+
render() {
|
|
765
|
+
if (this.state.error === undefined)
|
|
766
|
+
return this.props.children;
|
|
767
|
+
return (_jsx(ViewerState, { title: "Couldn't show this file", ...descriptionOf(this.state.error), action: _jsx(Button, { onPress: () => this.setState({ error: undefined }), children: "Retry" }) }));
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
function descriptionOf(error) {
|
|
771
|
+
const message = fileSourceErrorMessage(error);
|
|
772
|
+
return message === undefined ? {} : { description: message };
|
|
773
|
+
}
|
|
774
|
+
function describeType(entry) {
|
|
775
|
+
const extension = entry.name.includes('.') ? entry.name.split('.').pop() : undefined;
|
|
776
|
+
return extension === undefined ? 'this file' : `.${extension} files`;
|
|
777
|
+
}
|
|
778
|
+
function ignore() { }
|
|
779
|
+
/**
|
|
780
|
+
* Whether an outline item is where the file starts rather than a section in it: the first item
|
|
781
|
+
* or one starting at the same place, such as a PDF's cover and contents bookmarks on its first
|
|
782
|
+
* page, or the one item at the outline's top level that the rest sit under, as a title.
|
|
783
|
+
*/
|
|
784
|
+
function isTopItem(outline, item) {
|
|
785
|
+
const first = outline[0];
|
|
786
|
+
if (first === undefined)
|
|
787
|
+
return false;
|
|
788
|
+
if (item === first || JSON.stringify(item.location) === JSON.stringify(first.location))
|
|
789
|
+
return true;
|
|
790
|
+
const top = Math.min(...outline.map((entry) => entry.level ?? 1));
|
|
791
|
+
const roots = outline.filter((entry) => (entry.level ?? 1) === top);
|
|
792
|
+
return roots.length === 1 && roots[0] === item;
|
|
793
|
+
}
|
|
794
|
+
const NO_OUTLINE = [];
|
|
795
|
+
/** A presentation's body: no rail, and no narrow-screen controls. */
|
|
796
|
+
const PRESENTING_FRAME = { isCompact: false, hasMarkers: false, structure: undefined };
|
|
797
|
+
/** The id of the highlight that shows a selection an action keeps. */
|
|
798
|
+
const HELD_SELECTION = 'eds-held-selection';
|
|
799
|
+
const NO_ANNOTATIONS = [];
|
|
800
|
+
function sameLocation(a, b) {
|
|
801
|
+
return a !== undefined && JSON.stringify(a) === JSON.stringify(b);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* The match at a place: the first at or after it, in the place's kind, or the first match when
|
|
805
|
+
* the matches are in another kind or all come before it.
|
|
806
|
+
*/
|
|
807
|
+
function matchIndexAt(locations, target) {
|
|
808
|
+
const position = (location) => {
|
|
809
|
+
if (location.kind !== target.kind)
|
|
810
|
+
return undefined;
|
|
811
|
+
switch (location.kind) {
|
|
812
|
+
case 'page':
|
|
813
|
+
return [location.page];
|
|
814
|
+
case 'line':
|
|
815
|
+
return [location.line, location.column ?? 0];
|
|
816
|
+
case 'time':
|
|
817
|
+
return [location.time];
|
|
818
|
+
case 'cell':
|
|
819
|
+
return [location.row, location.column ?? 0];
|
|
820
|
+
default:
|
|
821
|
+
return undefined;
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
const goal = position(target);
|
|
825
|
+
if (goal === undefined)
|
|
826
|
+
return 0;
|
|
827
|
+
const index = locations.findIndex((location) => {
|
|
828
|
+
const at = position(location);
|
|
829
|
+
if (at === undefined)
|
|
830
|
+
return false;
|
|
831
|
+
for (let i = 0; i < goal.length; i += 1) {
|
|
832
|
+
if ((at[i] ?? 0) !== (goal[i] ?? 0))
|
|
833
|
+
return (at[i] ?? 0) > (goal[i] ?? 0);
|
|
834
|
+
}
|
|
835
|
+
return true;
|
|
836
|
+
});
|
|
837
|
+
return index === -1 ? 0 : index;
|
|
838
|
+
}
|
|
839
|
+
function useControllable(value, defaultValue, onChange) {
|
|
840
|
+
const [local, setLocal] = useState(defaultValue);
|
|
841
|
+
const set = useCallback((next) => {
|
|
842
|
+
setLocal(next);
|
|
843
|
+
onChange?.(next);
|
|
844
|
+
}, [onChange]);
|
|
845
|
+
return [value ?? local, set];
|
|
846
|
+
}
|