@mrpelz/uikit-ish 7.13.1 → 7.29.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/dist/components/accordion/style.css +0 -3
- package/dist/components/action-sheet/main.d.ts.map +1 -1
- package/dist/components/action-sheet/main.js +9 -6
- package/dist/components/action-sheet/main.js.map +1 -1
- package/dist/components/action-sheet/props.d.ts +2 -1
- package/dist/components/action-sheet/props.d.ts.map +1 -1
- package/dist/components/activity-view/style.css +17 -17
- package/dist/components/alert/main.d.ts.map +1 -1
- package/dist/components/alert/main.js +12 -4
- package/dist/components/alert/main.js.map +1 -1
- package/dist/components/alert/props.d.ts +2 -1
- package/dist/components/alert/props.d.ts.map +1 -1
- package/dist/components/alert/style.css +39 -15
- package/dist/components/avatar/style.css +2 -2
- package/dist/components/badge/style.css +1 -1
- package/dist/components/button/main.js +1 -1
- package/dist/components/button/main.js.map +1 -1
- package/dist/components/button/props.d.ts +3 -2
- package/dist/components/button/props.d.ts.map +1 -1
- package/dist/components/button/style.css +18 -29
- package/dist/components/card/buttons.d.ts +35 -0
- package/dist/components/card/buttons.d.ts.map +1 -0
- package/dist/components/card/buttons.js +60 -0
- package/dist/components/card/buttons.js.map +1 -0
- package/dist/components/card/channels.d.ts +43 -0
- package/dist/components/card/channels.d.ts.map +1 -0
- package/dist/components/card/channels.js +321 -0
- package/dist/components/card/channels.js.map +1 -0
- package/dist/components/card/color.d.ts +21 -0
- package/dist/components/card/color.d.ts.map +1 -0
- package/dist/components/card/color.js +100 -0
- package/dist/components/card/color.js.map +1 -0
- package/dist/components/card/main.d.ts +81 -0
- package/dist/components/card/main.d.ts.map +1 -0
- package/dist/components/card/main.js +91 -0
- package/dist/components/card/main.js.map +1 -0
- package/dist/components/card/parts.css +769 -0
- package/dist/components/card/press.d.ts +25 -0
- package/dist/components/card/press.d.ts.map +1 -0
- package/dist/components/card/press.js +111 -0
- package/dist/components/card/press.js.map +1 -0
- package/dist/components/card/progress.d.ts +43 -0
- package/dist/components/card/progress.d.ts.map +1 -0
- package/dist/components/card/progress.js +122 -0
- package/dist/components/card/progress.js.map +1 -0
- package/dist/components/card/props.d.ts +393 -0
- package/dist/components/card/props.d.ts.map +1 -0
- package/dist/components/card/props.js +2 -0
- package/dist/components/card/props.js.map +1 -0
- package/dist/components/card/root.d.ts +100 -0
- package/dist/components/card/root.d.ts.map +1 -0
- package/dist/components/card/root.js +388 -0
- package/dist/components/card/root.js.map +1 -0
- package/dist/components/card/rows.d.ts +19 -0
- package/dist/components/card/rows.d.ts.map +1 -0
- package/dist/components/card/rows.js +185 -0
- package/dist/components/card/rows.js.map +1 -0
- package/dist/components/card/segmented.d.ts +61 -0
- package/dist/components/card/segmented.d.ts.map +1 -0
- package/dist/components/card/segmented.js +289 -0
- package/dist/components/card/segmented.js.map +1 -0
- package/dist/components/card/shared.d.ts +55 -0
- package/dist/components/card/shared.d.ts.map +1 -0
- package/dist/components/card/shared.js +80 -0
- package/dist/components/card/shared.js.map +1 -0
- package/dist/components/card/slider.d.ts +16 -0
- package/dist/components/card/slider.d.ts.map +1 -0
- package/dist/components/card/slider.js +48 -0
- package/dist/components/card/slider.js.map +1 -0
- package/dist/components/card/stages.d.ts +18 -0
- package/dist/components/card/stages.d.ts.map +1 -0
- package/dist/components/card/stages.js +37 -0
- package/dist/components/card/stages.js.map +1 -0
- package/dist/components/card/style.css +959 -0
- package/dist/components/checkbox/style.css +10 -5
- package/dist/components/collapsible/style.css +0 -3
- package/dist/components/color-picker/color.d.ts +2 -2
- package/dist/components/color-picker/color.d.ts.map +1 -1
- package/dist/components/color-picker/color.js +7 -7
- package/dist/components/color-picker/color.js.map +1 -1
- package/dist/components/color-picker/main.d.ts +11 -5
- package/dist/components/color-picker/main.d.ts.map +1 -1
- package/dist/components/color-picker/main.js +147 -89
- package/dist/components/color-picker/main.js.map +1 -1
- package/dist/components/color-picker/props.d.ts +216 -6
- package/dist/components/color-picker/props.d.ts.map +1 -1
- package/dist/components/color-picker/style.css +12 -31
- package/dist/components/contextual-menu/main.d.ts +6 -2
- package/dist/components/contextual-menu/main.d.ts.map +1 -1
- package/dist/components/contextual-menu/main.js +67 -43
- package/dist/components/contextual-menu/main.js.map +1 -1
- package/dist/components/contextual-menu/props.d.ts +2 -1
- package/dist/components/contextual-menu/props.d.ts.map +1 -1
- package/dist/components/contextual-menu/style.css +64 -2
- package/dist/components/control-cards/main.d.ts +38 -0
- package/dist/components/control-cards/main.d.ts.map +1 -0
- package/dist/components/control-cards/main.js +196 -0
- package/dist/components/control-cards/main.js.map +1 -0
- package/dist/components/control-cards/props.d.ts +238 -0
- package/dist/components/control-cards/props.d.ts.map +1 -0
- package/dist/components/control-cards/props.js +2 -0
- package/dist/components/control-cards/props.js.map +1 -0
- package/dist/components/control-cards/style.css +2 -0
- package/dist/components/date-picker/main.d.ts +8 -3
- package/dist/components/date-picker/main.d.ts.map +1 -1
- package/dist/components/date-picker/main.js +73 -30
- package/dist/components/date-picker/main.js.map +1 -1
- package/dist/components/date-picker/pager.d.ts.map +1 -1
- package/dist/components/date-picker/pager.js +9 -2
- package/dist/components/date-picker/pager.js.map +1 -1
- package/dist/components/date-picker/props.d.ts +81 -5
- package/dist/components/date-picker/props.d.ts.map +1 -1
- package/dist/components/date-picker/style.css +25 -17
- package/dist/components/drawer/style.css +6 -0
- package/dist/components/edit-menu/main.d.ts +2 -1
- package/dist/components/edit-menu/main.d.ts.map +1 -1
- package/dist/components/edit-menu/main.js +8 -4
- package/dist/components/edit-menu/main.js.map +1 -1
- package/dist/components/edit-menu/style.css +2 -2
- package/dist/components/glass/backdrop.d.ts +75 -0
- package/dist/components/glass/backdrop.d.ts.map +1 -0
- package/dist/components/glass/backdrop.js +608 -0
- package/dist/components/glass/backdrop.js.map +1 -0
- package/dist/components/glass/gradient.d.ts +17 -0
- package/dist/components/glass/gradient.d.ts.map +1 -0
- package/dist/components/glass/gradient.js +233 -0
- package/dist/components/glass/gradient.js.map +1 -0
- package/dist/components/glass/main.d.ts +60 -6
- package/dist/components/glass/main.d.ts.map +1 -1
- package/dist/components/glass/main.js +100 -122
- package/dist/components/glass/main.js.map +1 -1
- package/dist/components/glass/marker.d.ts +66 -0
- package/dist/components/glass/marker.d.ts.map +1 -0
- package/dist/components/glass/marker.js +268 -0
- package/dist/components/glass/marker.js.map +1 -0
- package/dist/components/glass/props.d.ts +33 -7
- package/dist/components/glass/props.d.ts.map +1 -1
- package/dist/components/glass/style.css +172 -75
- package/dist/components/grid/dashes.d.ts +15 -0
- package/dist/components/grid/dashes.d.ts.map +1 -0
- package/dist/components/grid/dashes.js +37 -0
- package/dist/components/grid/dashes.js.map +1 -0
- package/dist/components/grid/edit.d.ts +11 -0
- package/dist/components/grid/edit.d.ts.map +1 -0
- package/dist/components/grid/edit.js +1066 -0
- package/dist/components/grid/edit.js.map +1 -0
- package/dist/components/grid/handle.d.ts +123 -0
- package/dist/components/grid/handle.d.ts.map +1 -0
- package/dist/components/grid/handle.js +194 -0
- package/dist/components/grid/handle.js.map +1 -0
- package/dist/components/grid/icons.d.ts +40 -0
- package/dist/components/grid/icons.d.ts.map +1 -0
- package/dist/components/grid/icons.js +140 -0
- package/dist/components/grid/icons.js.map +1 -0
- package/dist/components/grid/layout.d.ts +111 -0
- package/dist/components/grid/layout.d.ts.map +1 -0
- package/dist/components/grid/layout.js +1257 -0
- package/dist/components/grid/layout.js.map +1 -0
- package/dist/components/grid/main.d.ts +63 -0
- package/dist/components/grid/main.d.ts.map +1 -0
- package/dist/components/grid/main.js +1977 -0
- package/dist/components/grid/main.js.map +1 -0
- package/dist/components/grid/overlay.d.ts +24 -0
- package/dist/components/grid/overlay.d.ts.map +1 -0
- package/dist/components/grid/overlay.js +312 -0
- package/dist/components/grid/overlay.js.map +1 -0
- package/dist/components/grid/plan.d.ts +78 -0
- package/dist/components/grid/plan.d.ts.map +1 -0
- package/dist/components/grid/plan.js +249 -0
- package/dist/components/grid/plan.js.map +1 -0
- package/dist/components/grid/props.d.ts +579 -0
- package/dist/components/grid/props.d.ts.map +1 -0
- package/dist/components/grid/props.js +2 -0
- package/dist/components/grid/props.js.map +1 -0
- package/dist/components/grid/reshape.d.ts +60 -0
- package/dist/components/grid/reshape.d.ts.map +1 -0
- package/dist/components/grid/reshape.js +214 -0
- package/dist/components/grid/reshape.js.map +1 -0
- package/dist/components/grid/style.css +1323 -0
- package/dist/components/header/main.d.ts.map +1 -1
- package/dist/components/header/main.js +97 -10
- package/dist/components/header/main.js.map +1 -1
- package/dist/components/header/props.d.ts +2 -2
- package/dist/components/header/props.d.ts.map +1 -1
- package/dist/components/header/style.css +40 -49
- package/dist/components/index.d.ts +16 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +11 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/island/main.d.ts +2 -2
- package/dist/components/island/main.d.ts.map +1 -1
- package/dist/components/island/main.js +193 -41
- package/dist/components/island/main.js.map +1 -1
- package/dist/components/island/props.d.ts +4 -2
- package/dist/components/island/props.d.ts.map +1 -1
- package/dist/components/island/style.css +50 -3
- package/dist/components/layout/main.d.ts +3 -6
- package/dist/components/layout/main.d.ts.map +1 -1
- package/dist/components/layout/main.js +225 -56
- package/dist/components/layout/main.js.map +1 -1
- package/dist/components/layout/props.d.ts +43 -2
- package/dist/components/layout/props.d.ts.map +1 -1
- package/dist/components/layout/style.css +81 -23
- package/dist/components/list/main.d.ts +8 -6
- package/dist/components/list/main.d.ts.map +1 -1
- package/dist/components/list/main.js +132 -24
- package/dist/components/list/main.js.map +1 -1
- package/dist/components/list/props.d.ts +25 -0
- package/dist/components/list/props.d.ts.map +1 -1
- package/dist/components/list/reorder.d.ts +50 -2
- package/dist/components/list/reorder.d.ts.map +1 -1
- package/dist/components/list/reorder.js +40 -17
- package/dist/components/list/reorder.js.map +1 -1
- package/dist/components/list/style.css +160 -75
- package/dist/components/menu/main.d.ts +9 -5
- package/dist/components/menu/main.d.ts.map +1 -1
- package/dist/components/menu/main.js +87 -9
- package/dist/components/menu/main.js.map +1 -1
- package/dist/components/menu/props.d.ts +14 -0
- package/dist/components/menu/props.d.ts.map +1 -1
- package/dist/components/menu/style.css +41 -31
- package/dist/components/navigation/main.d.ts.map +1 -1
- package/dist/components/navigation/main.js +35 -13
- package/dist/components/navigation/main.js.map +1 -1
- package/dist/components/navigation/style.css +7 -0
- package/dist/components/page/main.d.ts.map +1 -1
- package/dist/components/page/main.js +6 -3
- package/dist/components/page/main.js.map +1 -1
- package/dist/components/page/props.d.ts +3 -2
- package/dist/components/page/props.d.ts.map +1 -1
- package/dist/components/page/style.css +8 -4
- package/dist/components/page-control/main.d.ts.map +1 -1
- package/dist/components/page-control/main.js +32 -15
- package/dist/components/page-control/main.js.map +1 -1
- package/dist/components/page-control/props.d.ts +9 -3
- package/dist/components/page-control/props.d.ts.map +1 -1
- package/dist/components/page-control/style.css +36 -0
- package/dist/components/pager/main.d.ts +12 -0
- package/dist/components/pager/main.d.ts.map +1 -0
- package/dist/components/pager/main.js +368 -0
- package/dist/components/pager/main.js.map +1 -0
- package/dist/components/pager/props.d.ts +36 -0
- package/dist/components/pager/props.d.ts.map +1 -0
- package/dist/components/pager/props.js +2 -0
- package/dist/components/pager/props.js.map +1 -0
- package/dist/components/pager/style.css +42 -0
- package/dist/components/popover/main.d.ts +10 -4
- package/dist/components/popover/main.d.ts.map +1 -1
- package/dist/components/popover/main.js +30 -19
- package/dist/components/popover/main.js.map +1 -1
- package/dist/components/popover/props.d.ts +2 -0
- package/dist/components/popover/props.d.ts.map +1 -1
- package/dist/components/popover/style.css +6 -2
- package/dist/components/progress/main.d.ts.map +1 -1
- package/dist/components/progress/main.js +3 -2
- package/dist/components/progress/main.js.map +1 -1
- package/dist/components/progress/style.css +4 -10
- package/dist/components/roll/main.d.ts.map +1 -1
- package/dist/components/roll/main.js +5 -3
- package/dist/components/roll/main.js.map +1 -1
- package/dist/components/roll/style.css +2 -2
- package/dist/components/segmented/main.d.ts.map +1 -1
- package/dist/components/segmented/main.js +4 -4
- package/dist/components/segmented/main.js.map +1 -1
- package/dist/components/segmented/props.d.ts +5 -2
- package/dist/components/segmented/props.d.ts.map +1 -1
- package/dist/components/segmented/style.css +17 -8
- package/dist/components/settings/main.d.ts +48 -1
- package/dist/components/settings/main.d.ts.map +1 -1
- package/dist/components/settings/main.js +311 -66
- package/dist/components/settings/main.js.map +1 -1
- package/dist/components/settings/props.d.ts +46 -4
- package/dist/components/settings/props.d.ts.map +1 -1
- package/dist/components/settings/region.d.ts +3 -0
- package/dist/components/settings/region.d.ts.map +1 -0
- package/dist/components/settings/region.js +120 -0
- package/dist/components/settings/region.js.map +1 -0
- package/dist/components/settings/style.css +2 -2
- package/dist/components/sheet/main.d.ts.map +1 -1
- package/dist/components/sheet/main.js +156 -45
- package/dist/components/sheet/main.js.map +1 -1
- package/dist/components/sheet/props.d.ts +4 -2
- package/dist/components/sheet/props.d.ts.map +1 -1
- package/dist/components/sheet/snap.d.ts +54 -0
- package/dist/components/sheet/snap.d.ts.map +1 -1
- package/dist/components/sheet/snap.js +261 -23
- package/dist/components/sheet/snap.js.map +1 -1
- package/dist/components/sheet/style.css +171 -20
- package/dist/components/sidebar/main.d.ts +2 -1
- package/dist/components/sidebar/main.d.ts.map +1 -1
- package/dist/components/sidebar/main.js +18 -6
- package/dist/components/sidebar/main.js.map +1 -1
- package/dist/components/sidebar/props.d.ts +2 -1
- package/dist/components/sidebar/props.d.ts.map +1 -1
- package/dist/components/sidebar/style.css +78 -0
- package/dist/components/slider/main.d.ts.map +1 -1
- package/dist/components/slider/main.js +55 -10
- package/dist/components/slider/main.js.map +1 -1
- package/dist/components/slider/props.d.ts +1 -0
- package/dist/components/slider/props.d.ts.map +1 -1
- package/dist/components/slider/style.css +15 -6
- package/dist/components/stack/main.d.ts +8 -0
- package/dist/components/stack/main.d.ts.map +1 -0
- package/dist/components/stack/main.js +25 -0
- package/dist/components/stack/main.js.map +1 -0
- package/dist/components/stack/props.d.ts +42 -0
- package/dist/components/stack/props.d.ts.map +1 -0
- package/dist/components/stack/props.js +2 -0
- package/dist/components/stack/props.js.map +1 -0
- package/dist/components/stack/style.css +68 -0
- package/dist/components/stepper/main.d.ts +3 -1
- package/dist/components/stepper/main.d.ts.map +1 -1
- package/dist/components/stepper/main.js +4 -0
- package/dist/components/stepper/main.js.map +1 -1
- package/dist/components/stepper/style.css +2 -2
- package/dist/components/switch/main.d.ts.map +1 -1
- package/dist/components/switch/main.js +9 -3
- package/dist/components/switch/main.js.map +1 -1
- package/dist/components/switch/props.d.ts +4 -1
- package/dist/components/switch/props.d.ts.map +1 -1
- package/dist/components/symbol/main.d.ts.map +1 -1
- package/dist/components/symbol/main.js +5 -1
- package/dist/components/symbol/main.js.map +1 -1
- package/dist/components/symbol/props.d.ts +10 -0
- package/dist/components/symbol/props.d.ts.map +1 -1
- package/dist/components/symbol/style.css +21 -3
- package/dist/components/tab-bar/main.d.ts.map +1 -1
- package/dist/components/tab-bar/main.js +8 -5
- package/dist/components/tab-bar/main.js.map +1 -1
- package/dist/components/tab-bar/props.d.ts +16 -12
- package/dist/components/tab-bar/props.d.ts.map +1 -1
- package/dist/components/tab-bar/style.css +38 -21
- package/dist/components/text-field/main.d.ts.map +1 -1
- package/dist/components/text-field/main.js +6 -3
- package/dist/components/text-field/main.js.map +1 -1
- package/dist/components/text-field/style.css +28 -17
- package/dist/components/toolbar/main.d.ts +5 -2
- package/dist/components/toolbar/main.d.ts.map +1 -1
- package/dist/components/toolbar/main.js +19 -1
- package/dist/components/toolbar/main.js.map +1 -1
- package/dist/components/toolbar/props.d.ts +18 -3
- package/dist/components/toolbar/props.d.ts.map +1 -1
- package/dist/components/toolbar/style.css +127 -11
- package/dist/components/tooltip/main.d.ts +6 -1
- package/dist/components/tooltip/main.d.ts.map +1 -1
- package/dist/components/tooltip/main.js +13 -7
- package/dist/components/tooltip/main.js.map +1 -1
- package/dist/components/tooltip/style.css +2 -2
- package/dist/components/typography/main.d.ts +1 -0
- package/dist/components/typography/main.d.ts.map +1 -1
- package/dist/components/typography/main.js +1 -0
- package/dist/components/typography/main.js.map +1 -1
- package/dist/components/typography/sizes.css +456 -0
- package/dist/components/typography/style.css +24 -456
- package/dist/components/utils/main.d.ts +50 -4
- package/dist/components/utils/main.d.ts.map +1 -1
- package/dist/components/utils/main.js +113 -3
- package/dist/components/utils/main.js.map +1 -1
- package/dist/components/viewport/current.d.ts +15 -0
- package/dist/components/viewport/current.d.ts.map +1 -0
- package/dist/components/viewport/current.js +74 -0
- package/dist/components/viewport/current.js.map +1 -0
- package/dist/components/viewport/edge-effect.d.ts.map +1 -1
- package/dist/components/viewport/edge-effect.js +58 -26
- package/dist/components/viewport/edge-effect.js.map +1 -1
- package/dist/components/viewport/edge.d.ts +7 -4
- package/dist/components/viewport/edge.d.ts.map +1 -1
- package/dist/components/viewport/edge.js +21 -7
- package/dist/components/viewport/edge.js.map +1 -1
- package/dist/components/viewport/focus-scroll.d.ts +21 -0
- package/dist/components/viewport/focus-scroll.d.ts.map +1 -0
- package/dist/components/viewport/focus-scroll.js +273 -0
- package/dist/components/viewport/focus-scroll.js.map +1 -0
- package/dist/components/viewport/input.d.ts +39 -1
- package/dist/components/viewport/input.d.ts.map +1 -1
- package/dist/components/viewport/input.js +122 -13
- package/dist/components/viewport/input.js.map +1 -1
- package/dist/components/viewport/main.d.ts +16 -1
- package/dist/components/viewport/main.d.ts.map +1 -1
- package/dist/components/viewport/main.js +276 -50
- package/dist/components/viewport/main.js.map +1 -1
- package/dist/components/viewport/padding.d.ts +1 -1
- package/dist/components/viewport/padding.d.ts.map +1 -1
- package/dist/components/viewport/padding.js +2 -2
- package/dist/components/viewport/props.d.ts +12 -2
- package/dist/components/viewport/props.d.ts.map +1 -1
- package/dist/components/viewport/status-bar.d.ts +9 -0
- package/dist/components/viewport/status-bar.d.ts.map +1 -0
- package/dist/components/viewport/status-bar.js +131 -0
- package/dist/components/viewport/status-bar.js.map +1 -0
- package/dist/components/viewport/style.css +67 -16
- package/dist/styles.css +371 -279
- package/package.json +5 -4
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
import { useLayoutEffect, useState } from 'react';
|
|
2
|
+
import { parseCssColor } from '../color-picker/color.js';
|
|
3
|
+
import { backgroundColorAt } from './gradient.js';
|
|
4
|
+
// Its luminance below this, the tone turns dim; above the other, bright;
|
|
5
|
+
// between, it stays, so it doesn't flicker between them. Around 0.18, black
|
|
6
|
+
// and white text read equally well (their contrast ratios meet), so the
|
|
7
|
+
// thresholds sit on either side of it: e.g. a vivid orange (about 0.45)
|
|
8
|
+
// bright, dark text reading on it at 10:1.
|
|
9
|
+
const toDim = 0.14;
|
|
10
|
+
const toBright = 0.24;
|
|
11
|
+
/** The tone for what's behind (its luminance), from the last one. */
|
|
12
|
+
const nextTone = (luminance, last) => {
|
|
13
|
+
if (luminance < toDim)
|
|
14
|
+
return 'dim';
|
|
15
|
+
if (luminance > toBright)
|
|
16
|
+
return 'bright';
|
|
17
|
+
return last ?? (luminance < (toDim + toBright) / 2 ? 'dim' : 'bright');
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A color's tone (e.g. a slider's fill, opaque: see Card), from the last
|
|
21
|
+
* one (see `nextTone`); none, unreadable or nearly transparent.
|
|
22
|
+
*/
|
|
23
|
+
export const toneOfColor = (color, last) => {
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- hoisted helpers below
|
|
25
|
+
const rgba = parseColor(color);
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- hoisted helpers below
|
|
27
|
+
return rgba && rgba[3] >= 0.3 ? nextTone(luminanceOf(rgba), last) : undefined;
|
|
28
|
+
};
|
|
29
|
+
/** A luminance's tone, without one before it (e.g. an image's area). */
|
|
30
|
+
export const toneOf = (luminance) => nextTone(luminance, undefined);
|
|
31
|
+
const parsedColors = new Map();
|
|
32
|
+
// An sRGB channel (0 to 255), linear.
|
|
33
|
+
const linear = (channel) => {
|
|
34
|
+
const value = channel / 255;
|
|
35
|
+
return value <= 0.040_45 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A CSS color's channels (sRGB, 0 to 255) and alpha (0 to 1): any computed
|
|
39
|
+
* color's (e.g. a `color-mix()`'s, as `color(srgb …)`, its channels 0 to 1;
|
|
40
|
+
* see the color picker's `parseCssColor`), cached.
|
|
41
|
+
*/
|
|
42
|
+
const parseColor = (color) => {
|
|
43
|
+
if (parsedColors.has(color))
|
|
44
|
+
return parsedColors.get(color);
|
|
45
|
+
const parsed = parseCssColor(color);
|
|
46
|
+
const rgba = parsed && [
|
|
47
|
+
parsed.r,
|
|
48
|
+
parsed.g,
|
|
49
|
+
parsed.b,
|
|
50
|
+
parsed.a,
|
|
51
|
+
];
|
|
52
|
+
// (Few colors on a page; bounded all the same.)
|
|
53
|
+
if (parsedColors.size > 256)
|
|
54
|
+
parsedColors.clear();
|
|
55
|
+
parsedColors.set(color, rgba);
|
|
56
|
+
return rgba;
|
|
57
|
+
};
|
|
58
|
+
/** A color's relative luminance (0 to 1). */
|
|
59
|
+
export const luminanceOf = ([red, green, blue]) => 0.2126 * linear(red) + 0.7152 * linear(green) + 0.0722 * linear(blue);
|
|
60
|
+
/**
|
|
61
|
+
* The luminance an element's background shows at a point (see
|
|
62
|
+
* gradient.ts; undefined: unknown, e.g. an image; null: none, nearly
|
|
63
|
+
* transparent there).
|
|
64
|
+
*/
|
|
65
|
+
const backgroundLuminanceAt = (element, x, y) => {
|
|
66
|
+
const { backgroundColor, backgroundImage } = getComputedStyle(element);
|
|
67
|
+
// (Most have none: no box to read.)
|
|
68
|
+
if (backgroundImage === 'none') {
|
|
69
|
+
const color = parseColor(backgroundColor);
|
|
70
|
+
return color && color[3] >= 0.3 ? luminanceOf(color) : null;
|
|
71
|
+
}
|
|
72
|
+
const { height, left, top, width } = element.getBoundingClientRect();
|
|
73
|
+
const color = backgroundColorAt(backgroundImage, backgroundColor, { height, width, x: x - left, y: y - top }, parseColor);
|
|
74
|
+
return color ? luminanceOf(color) : color;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The luminance at a point behind an element: the first element below it
|
|
78
|
+
* there (in paint order, the page's layers, not only its ancestors) with a
|
|
79
|
+
* background (undefined: unknown, or none).
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* A backdrop marked by the app (see marker.ts): its element's attribute,
|
|
83
|
+
* a luminance (0 to 1), or a grid of them across its box (`g`, then
|
|
84
|
+
* `gridSize` by `gridSize` cells, row by row, two hex digits each, 00 to fe;
|
|
85
|
+
* `__` unknown, e.g. a transparent part of an image).
|
|
86
|
+
*/
|
|
87
|
+
export const markerAttribute = 'data-uikit-backdrop';
|
|
88
|
+
/** A marker's grid's cells across and down (see `markerAttribute`). */
|
|
89
|
+
export const gridSize = 8;
|
|
90
|
+
/**
|
|
91
|
+
* A marker's luminance at a point (null: none there, e.g. a transparent
|
|
92
|
+
* cell, what's behind it showing; undefined: unreadable).
|
|
93
|
+
*/
|
|
94
|
+
const markerLuminanceAt = (marked, x, y) => {
|
|
95
|
+
const value = marked.getAttribute(markerAttribute) ?? '';
|
|
96
|
+
if (!value.startsWith('g')) {
|
|
97
|
+
const luminance = Number.parseFloat(value);
|
|
98
|
+
return Number.isFinite(luminance) ? luminance : undefined;
|
|
99
|
+
}
|
|
100
|
+
const { height, left, top, width } = marked.getBoundingClientRect();
|
|
101
|
+
if (width <= 0 || height <= 0)
|
|
102
|
+
return undefined;
|
|
103
|
+
const cell = (offset, size) => Math.min(Math.max(Math.floor((offset / size) * gridSize), 0), gridSize - 1);
|
|
104
|
+
const index = cell(y - top, height) * gridSize + cell(x - left, width);
|
|
105
|
+
const digits = value.slice(1 + index * 2, 3 + index * 2);
|
|
106
|
+
if (digits === '__')
|
|
107
|
+
return null;
|
|
108
|
+
const luminance = Number.parseInt(digits, 16) / 254;
|
|
109
|
+
return Number.isFinite(luminance) ? luminance : undefined;
|
|
110
|
+
};
|
|
111
|
+
const luminanceAt = (element, within, x, y) => {
|
|
112
|
+
const stack = document.elementsFromPoint(x, y);
|
|
113
|
+
// (Below it: not what's over it, nor it or what's in it; its ancestors
|
|
114
|
+
// count, e.g. the page it's on, painting the background behind it; within
|
|
115
|
+
// an ancestor, nothing past it.)
|
|
116
|
+
const at = stack.findIndex((candidate) => element.contains(candidate));
|
|
117
|
+
for (const candidate of stack.slice(Math.max(at, 0))) {
|
|
118
|
+
if (element.contains(candidate))
|
|
119
|
+
continue;
|
|
120
|
+
if (within && !within.contains(candidate))
|
|
121
|
+
return undefined;
|
|
122
|
+
// (Marked by the app, it or what it's in (e.g. a map's tiles, in its
|
|
123
|
+
// marked container): its luminance; else its background's.)
|
|
124
|
+
const marked = candidate.closest(`[${CSS.escape(markerAttribute)}]`);
|
|
125
|
+
const value = marked && !element.contains(marked)
|
|
126
|
+
? markerLuminanceAt(marked, x, y)
|
|
127
|
+
: backgroundLuminanceAt(candidate, x, y);
|
|
128
|
+
if (value !== null)
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
133
|
+
/** The points read on an element (see `pointOf`): 3 by 3. */
|
|
134
|
+
const pointCount = 9;
|
|
135
|
+
/**
|
|
136
|
+
* One of the points read on an element, of a 3 by 3 grid on it (inset
|
|
137
|
+
* from its edges), row by row; none while it has no box.
|
|
138
|
+
*/
|
|
139
|
+
const pointOf = (box, index) => {
|
|
140
|
+
const { bottom, left, right, top } = box;
|
|
141
|
+
if (right <= left || bottom <= top)
|
|
142
|
+
return undefined;
|
|
143
|
+
const inset = 4;
|
|
144
|
+
const xs = [left + inset, (left + right) / 2, right - inset];
|
|
145
|
+
const ys = [top + inset, (top + bottom) / 2, bottom - inset];
|
|
146
|
+
return [xs[index % 3] ?? left, ys[Math.floor(index / 3)] ?? top];
|
|
147
|
+
};
|
|
148
|
+
/** The luminance behind an element at one of its points (see `pointOf`). */
|
|
149
|
+
const luminanceAtPoint = (element, within, box, index) => {
|
|
150
|
+
const point = pointOf(box, index);
|
|
151
|
+
return point ? luminanceAt(element, within, ...point) : undefined;
|
|
152
|
+
};
|
|
153
|
+
/** The luminance at every point behind an element (see `pointOf`). */
|
|
154
|
+
const readingsBehind = (element, within) => {
|
|
155
|
+
const box = element.getBoundingClientRect();
|
|
156
|
+
return Array.from({ length: pointCount }, (_, index) => luminanceAtPoint(element, within, box, index));
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* The luminance of what's behind an element: its points' average (see
|
|
160
|
+
* `readingsBehind`), those unknown left out.
|
|
161
|
+
*/
|
|
162
|
+
const averageOf = (readings) => {
|
|
163
|
+
const values = readings.filter((value) => value !== undefined);
|
|
164
|
+
return values.length === 0
|
|
165
|
+
? undefined
|
|
166
|
+
: values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Until when something's transitioning or animating (see `sample`): a
|
|
170
|
+
* while past the latest start (its end may never come, e.g. its element
|
|
171
|
+
* removed; its end samples again anyway).
|
|
172
|
+
*/
|
|
173
|
+
let movingUntil = 0;
|
|
174
|
+
const movingFor = 1000;
|
|
175
|
+
/** What's transitioning or animating, until when (see `movingUntil`). */
|
|
176
|
+
const moving = new Map();
|
|
177
|
+
const entries = new Map();
|
|
178
|
+
let frame = 0;
|
|
179
|
+
let timer = 0;
|
|
180
|
+
// What's to be sampled next frame: everything (e.g. the color scheme
|
|
181
|
+
// changed), what's on the page (it scrolled: not those within an ancestor),
|
|
182
|
+
// or those over what changed (`touched`, e.g. a card's slider's fill; those
|
|
183
|
+
// within an ancestor, within it), or what scrolled in their ancestor
|
|
184
|
+
// (`scrolled`, e.g. a list in a card).
|
|
185
|
+
let isEverything = false;
|
|
186
|
+
let isPage = false;
|
|
187
|
+
/** Changes in a frame past which everything's sampled (not each looked at). */
|
|
188
|
+
const touchedLimit = 64;
|
|
189
|
+
/** Some element's points still to be read, one a frame (see `readingOf`). */
|
|
190
|
+
let isReading = false;
|
|
191
|
+
const touched = new Set();
|
|
192
|
+
const scrolled = new Set();
|
|
193
|
+
/** Its sampling (see `sample`), at the next frame. */
|
|
194
|
+
const request = () => {
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- each schedules the other
|
|
196
|
+
frame ||= requestAnimationFrame(sample);
|
|
197
|
+
};
|
|
198
|
+
/** Every element sampled next frame (see `sample`). */
|
|
199
|
+
const schedule = () => {
|
|
200
|
+
isEverything = true;
|
|
201
|
+
request();
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Those not within an ancestor sampled next frame, as something scrolled;
|
|
205
|
+
* those within one, if it's in it.
|
|
206
|
+
*/
|
|
207
|
+
const scheduleScrolled = ({ target }) => {
|
|
208
|
+
isPage = true;
|
|
209
|
+
if (target instanceof Node)
|
|
210
|
+
scrolled.add(target);
|
|
211
|
+
request();
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Those over what changed sampled next frame: those not within an
|
|
215
|
+
* ancestor, over it, and those within one it's in, or that's in it.
|
|
216
|
+
*/
|
|
217
|
+
const scheduleTouched = (node) => {
|
|
218
|
+
touched.add(node);
|
|
219
|
+
request();
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* A node's box: its element's, or its nearest ancestor's with one (e.g. as
|
|
223
|
+
* it's hidden, what it was in); none, unknown (e.g. removed).
|
|
224
|
+
*/
|
|
225
|
+
const boxOfNode = (node) => {
|
|
226
|
+
for (let element = node instanceof Element ? node : node.parentElement; element; element = element.parentElement) {
|
|
227
|
+
const box = element.getBoundingClientRect();
|
|
228
|
+
if (box.width > 0 || box.height > 0)
|
|
229
|
+
return box;
|
|
230
|
+
}
|
|
231
|
+
return undefined;
|
|
232
|
+
};
|
|
233
|
+
/** Whether a node is over a box, or might be (its own unknown). */
|
|
234
|
+
const isOver = (node, box) => {
|
|
235
|
+
const other = boxOfNode(node);
|
|
236
|
+
return (!other ||
|
|
237
|
+
(other.left < box.right &&
|
|
238
|
+
box.left < other.right &&
|
|
239
|
+
other.top < box.bottom &&
|
|
240
|
+
box.top < other.bottom));
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* How an element's to be sampled, if it is (see above): all its points
|
|
244
|
+
* (e.g. something over it, or in what it's within, changed: once), or one
|
|
245
|
+
* more (it, or what's behind it, moving: one a frame, see `readingOf`; a
|
|
246
|
+
* change meanwhile too, its points all read again that way). Those not
|
|
247
|
+
* within an ancestor as the page scrolls, or as what's over them changes or
|
|
248
|
+
* moves; those within one as something in it (or what it's in) changes,
|
|
249
|
+
* moves or scrolls.
|
|
250
|
+
*/
|
|
251
|
+
const dueOf = (entry, within, box, now) => {
|
|
252
|
+
if (isEverything || !entry.readings)
|
|
253
|
+
return 'all';
|
|
254
|
+
const isRelated = within
|
|
255
|
+
? (node) => within.contains(node) || node.contains(within)
|
|
256
|
+
: (node) => isOver(node, box);
|
|
257
|
+
const isMoving = () => {
|
|
258
|
+
if (within) {
|
|
259
|
+
for (const node of scrolled)
|
|
260
|
+
if (within.contains(node))
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
else if (isPage) {
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
for (const [node, until] of moving) {
|
|
267
|
+
if (until > now && isRelated(node))
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
return false;
|
|
271
|
+
};
|
|
272
|
+
const isTouched = () => {
|
|
273
|
+
if (touched.size > touchedLimit)
|
|
274
|
+
return true;
|
|
275
|
+
for (const node of touched)
|
|
276
|
+
if (isRelated(node))
|
|
277
|
+
return true;
|
|
278
|
+
return false;
|
|
279
|
+
};
|
|
280
|
+
if (isMoving())
|
|
281
|
+
return 'one';
|
|
282
|
+
return isTouched() ? 'all' : undefined;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* The points read one a frame left in this frame (see `readingOf`): one,
|
|
286
|
+
* however many elements are moving, each in turn (see `sample`).
|
|
287
|
+
*/
|
|
288
|
+
let pointsLeft = 0;
|
|
289
|
+
/** Who read a point this frame (see `pointsLeft`), last in line after it. */
|
|
290
|
+
let turnTaken;
|
|
291
|
+
/**
|
|
292
|
+
* An entry's luminance, if it's due (see above): none off-screen, or within
|
|
293
|
+
* an ancestor not there yet. Moving, one point a frame (each a hit test of
|
|
294
|
+
* the page, costly on a large one), the others' latest kept; then the rest,
|
|
295
|
+
* one a frame, so all are read once it's stopped.
|
|
296
|
+
*/
|
|
297
|
+
const readingOf = (entry, now) => {
|
|
298
|
+
if (!entry.isVisible)
|
|
299
|
+
return undefined;
|
|
300
|
+
const within = entry.within?.current ?? undefined;
|
|
301
|
+
if (entry.within && !within)
|
|
302
|
+
return undefined;
|
|
303
|
+
const { element } = entry;
|
|
304
|
+
const box = element.getBoundingClientRect();
|
|
305
|
+
const due = dueOf(entry, within, box, now);
|
|
306
|
+
if (!due && entry.unread === 0)
|
|
307
|
+
return undefined;
|
|
308
|
+
// (Inert or hidden (e.g. a Navigation stack's pages as they move, or
|
|
309
|
+
// under its top one): not sampled, its tone kept. What's behind it is
|
|
310
|
+
// passed by too (ignoring the pointer, as a moving page does; hidden),
|
|
311
|
+
// so it can't be read right; and it's not taking part, for now.)
|
|
312
|
+
if (element.closest('[inert]') ||
|
|
313
|
+
!element.checkVisibility({ visibilityProperty: true })) {
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
if (due === 'all' || !entry.readings) {
|
|
317
|
+
entry.readings = Array.from({ length: pointCount }, (_, index) => luminanceAtPoint(element, within, box, index));
|
|
318
|
+
entry.unread = 0;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
if (due === 'one')
|
|
322
|
+
entry.unread = pointCount;
|
|
323
|
+
// (Another's turn this frame: its points left for the next.)
|
|
324
|
+
if (pointsLeft === 0) {
|
|
325
|
+
isReading = true;
|
|
326
|
+
return undefined;
|
|
327
|
+
}
|
|
328
|
+
pointsLeft -= 1;
|
|
329
|
+
turnTaken = entry;
|
|
330
|
+
entry.readings[entry.cursor] = luminanceAtPoint(element, within, box, entry.cursor);
|
|
331
|
+
entry.cursor = (entry.cursor + 1) % pointCount;
|
|
332
|
+
entry.unread -= 1;
|
|
333
|
+
if (entry.unread > 0)
|
|
334
|
+
isReading = true;
|
|
335
|
+
}
|
|
336
|
+
return averageOf(entry.readings);
|
|
337
|
+
};
|
|
338
|
+
/** Each entry's tone sampled (reads), then those changed told (writes). */
|
|
339
|
+
const sample = () => {
|
|
340
|
+
frame = 0;
|
|
341
|
+
const now = performance.now();
|
|
342
|
+
isReading = false;
|
|
343
|
+
pointsLeft = 1;
|
|
344
|
+
turnTaken = undefined;
|
|
345
|
+
const readings = [];
|
|
346
|
+
for (const entry of entries.values()) {
|
|
347
|
+
const luminance = readingOf(entry, now);
|
|
348
|
+
if (luminance !== undefined)
|
|
349
|
+
readings.push([entry, luminance]);
|
|
350
|
+
}
|
|
351
|
+
// (Its turn taken: the others' first next frame. Set by `readingOf`.)
|
|
352
|
+
const taken = turnTaken;
|
|
353
|
+
if (taken) {
|
|
354
|
+
entries.delete(taken.element);
|
|
355
|
+
entries.set(taken.element, taken);
|
|
356
|
+
}
|
|
357
|
+
isEverything = false;
|
|
358
|
+
isPage = false;
|
|
359
|
+
touched.clear();
|
|
360
|
+
scrolled.clear();
|
|
361
|
+
for (const [node, until] of moving)
|
|
362
|
+
if (until <= now)
|
|
363
|
+
moving.delete(node);
|
|
364
|
+
let wait = Infinity;
|
|
365
|
+
for (const [entry, luminance] of readings) {
|
|
366
|
+
const next = nextTone(luminance, entry.last);
|
|
367
|
+
if (next === entry.last) {
|
|
368
|
+
entry.pending = undefined;
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
// (A first one at once; else held for its dwell.)
|
|
372
|
+
if (entry.last !== undefined && entry.dwell > 0) {
|
|
373
|
+
if (entry.pending?.tone !== next) {
|
|
374
|
+
entry.pending = { since: now, tone: next };
|
|
375
|
+
}
|
|
376
|
+
const left = entry.pending.since + entry.dwell - now;
|
|
377
|
+
if (left > 0) {
|
|
378
|
+
wait = Math.min(wait, left);
|
|
379
|
+
continue;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
entry.last = next;
|
|
383
|
+
entry.pending = undefined;
|
|
384
|
+
entry.onChange(next);
|
|
385
|
+
}
|
|
386
|
+
// (While something transitions or animates (e.g. a card's background
|
|
387
|
+
// as it's switched on): every frame, its colors read as they go.)
|
|
388
|
+
// (Points still to be read: next frame.)
|
|
389
|
+
if (now < movingUntil || isReading)
|
|
390
|
+
request();
|
|
391
|
+
// (Held ones looked at again once their dwell's over.)
|
|
392
|
+
if (wait !== Infinity) {
|
|
393
|
+
clearTimeout(timer);
|
|
394
|
+
timer = window.setTimeout(schedule, wait);
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
/** What else is told to read again (see `resampleBackdrops`). */
|
|
398
|
+
const rereaders = new Set();
|
|
399
|
+
/**
|
|
400
|
+
* Told to read again by `resampleBackdrops` (e.g. an image marker, its
|
|
401
|
+
* source), until unsubscribed (the returned function).
|
|
402
|
+
*/
|
|
403
|
+
export const onResample = (reread) => {
|
|
404
|
+
rereaders.add(reread);
|
|
405
|
+
return () => rereaders.delete(reread);
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Every element's backdrop sampled again (see `useBackdropTone`), and
|
|
409
|
+
* image markers' sources read again (see `useImageBackdropMarker`): after
|
|
410
|
+
* a change the sampling can't see, e.g. a class switching a background's
|
|
411
|
+
* color, a transform or an animation moving what's behind (it follows
|
|
412
|
+
* scrolls, resizes and markers by itself).
|
|
413
|
+
*/
|
|
414
|
+
export const resampleBackdrops = () => {
|
|
415
|
+
for (const reread of rereaders)
|
|
416
|
+
reread();
|
|
417
|
+
schedule();
|
|
418
|
+
};
|
|
419
|
+
let resizeObserver;
|
|
420
|
+
let intersectionObserver;
|
|
421
|
+
let pageObserver;
|
|
422
|
+
/**
|
|
423
|
+
* Whether something moving is a sampled element's concern: in what it's
|
|
424
|
+
* within (or around it), or over it, or in it or around it (e.g. a sheet
|
|
425
|
+
* with its toolbar), as it starts.
|
|
426
|
+
*/
|
|
427
|
+
const concernsAny = (node) => {
|
|
428
|
+
for (const { element, within } of entries.values()) {
|
|
429
|
+
const ancestor = within?.current;
|
|
430
|
+
if (ancestor) {
|
|
431
|
+
if (ancestor.contains(node) || node.contains(ancestor))
|
|
432
|
+
return true;
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
const isNear = element.contains(node) || node.contains(element);
|
|
436
|
+
if (isNear || isOver(node, element.getBoundingClientRect()))
|
|
437
|
+
return true;
|
|
438
|
+
}
|
|
439
|
+
return false;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* Something started moving (see `movingStarts`): sampled every frame for a
|
|
443
|
+
* while (see `movingFor`), if it's any element's concern (see
|
|
444
|
+
* `concernsAny`); else nothing (e.g. a live value's arrow turning far
|
|
445
|
+
* below: no frames). Its end samples what's over it all the same.
|
|
446
|
+
*/
|
|
447
|
+
const onMoving = ({ target }) => {
|
|
448
|
+
if (!(target instanceof Node) || !concernsAny(target))
|
|
449
|
+
return;
|
|
450
|
+
movingUntil = performance.now() + movingFor;
|
|
451
|
+
moving.set(target, movingUntil);
|
|
452
|
+
request();
|
|
453
|
+
};
|
|
454
|
+
/** Something's moving ended (see `onMoving`): what's over it sampled. */
|
|
455
|
+
const onMoved = ({ target }) => {
|
|
456
|
+
if (target instanceof Node)
|
|
457
|
+
scheduleTouched(target);
|
|
458
|
+
else
|
|
459
|
+
schedule();
|
|
460
|
+
};
|
|
461
|
+
const movingStarts = ['transitionrun', 'animationstart'];
|
|
462
|
+
const movingEnds = [
|
|
463
|
+
'transitionend',
|
|
464
|
+
'transitioncancel',
|
|
465
|
+
'animationend',
|
|
466
|
+
'animationcancel',
|
|
467
|
+
];
|
|
468
|
+
/** The system's color scheme and contrast (what `light-dark()` follows). */
|
|
469
|
+
const schemeQueries = [
|
|
470
|
+
'(prefers-color-scheme: dark)',
|
|
471
|
+
'(prefers-contrast: more)',
|
|
472
|
+
];
|
|
473
|
+
const listen = () => {
|
|
474
|
+
addEventListener('scroll', scheduleScrolled, {
|
|
475
|
+
capture: true,
|
|
476
|
+
passive: true,
|
|
477
|
+
});
|
|
478
|
+
addEventListener('resize', schedule);
|
|
479
|
+
resizeObserver = new ResizeObserver((records) => {
|
|
480
|
+
for (const { target } of records)
|
|
481
|
+
scheduleTouched(target);
|
|
482
|
+
});
|
|
483
|
+
intersectionObserver = new IntersectionObserver((records) => {
|
|
484
|
+
for (const { isIntersecting, target } of records) {
|
|
485
|
+
const entry = entries.get(target);
|
|
486
|
+
if (entry)
|
|
487
|
+
entry.isVisible = isIntersecting;
|
|
488
|
+
// (Scrolled in: sampled, e.g. after its card changed off-screen.)
|
|
489
|
+
scheduleTouched(target);
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
// (The page changed: a class or a style switching a background (e.g. a
|
|
493
|
+
// card switched on), an element added or removed, a marker (see
|
|
494
|
+
// marker.ts): sampled again, nothing scrolled; once per frame however
|
|
495
|
+
// much changed.)
|
|
496
|
+
pageObserver = new MutationObserver((records) => {
|
|
497
|
+
for (const { target } of records)
|
|
498
|
+
scheduleTouched(target);
|
|
499
|
+
});
|
|
500
|
+
pageObserver.observe(document.documentElement, {
|
|
501
|
+
attributes: true,
|
|
502
|
+
childList: true,
|
|
503
|
+
subtree: true,
|
|
504
|
+
});
|
|
505
|
+
for (const type of movingStarts) {
|
|
506
|
+
addEventListener(type, onMoving, { capture: true, passive: true });
|
|
507
|
+
}
|
|
508
|
+
for (const type of movingEnds) {
|
|
509
|
+
addEventListener(type, onMoved, { capture: true, passive: true });
|
|
510
|
+
}
|
|
511
|
+
for (const query of schemeQueries) {
|
|
512
|
+
matchMedia(query).addEventListener('change', schedule);
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
const unlisten = () => {
|
|
516
|
+
removeEventListener('scroll', scheduleScrolled, { capture: true });
|
|
517
|
+
removeEventListener('resize', schedule);
|
|
518
|
+
resizeObserver?.disconnect();
|
|
519
|
+
intersectionObserver?.disconnect();
|
|
520
|
+
pageObserver?.disconnect();
|
|
521
|
+
resizeObserver = undefined;
|
|
522
|
+
intersectionObserver = undefined;
|
|
523
|
+
pageObserver = undefined;
|
|
524
|
+
for (const type of movingStarts) {
|
|
525
|
+
removeEventListener(type, onMoving, { capture: true });
|
|
526
|
+
}
|
|
527
|
+
for (const type of movingEnds) {
|
|
528
|
+
removeEventListener(type, onMoved, { capture: true });
|
|
529
|
+
}
|
|
530
|
+
for (const query of schemeQueries) {
|
|
531
|
+
matchMedia(query).removeEventListener('change', schedule);
|
|
532
|
+
}
|
|
533
|
+
movingUntil = 0;
|
|
534
|
+
moving.clear();
|
|
535
|
+
touched.clear();
|
|
536
|
+
scrolled.clear();
|
|
537
|
+
cancelAnimationFrame(frame);
|
|
538
|
+
clearTimeout(timer);
|
|
539
|
+
frame = 0;
|
|
540
|
+
};
|
|
541
|
+
/**
|
|
542
|
+
* An element's backdrop sampled (see above), `onChange` told its tone as
|
|
543
|
+
* it changes; sampled once at once (its first, before it paints, when
|
|
544
|
+
* called before then). Returns its unregistering.
|
|
545
|
+
*/
|
|
546
|
+
const register = (element, within, dwell, onChange) => {
|
|
547
|
+
if (entries.size === 0)
|
|
548
|
+
listen();
|
|
549
|
+
const entry = {
|
|
550
|
+
cursor: 0,
|
|
551
|
+
dwell,
|
|
552
|
+
element,
|
|
553
|
+
isVisible: true,
|
|
554
|
+
last: undefined,
|
|
555
|
+
onChange,
|
|
556
|
+
pending: undefined,
|
|
557
|
+
readings: undefined,
|
|
558
|
+
unread: 0,
|
|
559
|
+
within,
|
|
560
|
+
};
|
|
561
|
+
entries.set(element, entry);
|
|
562
|
+
resizeObserver?.observe(element);
|
|
563
|
+
intersectionObserver?.observe(element);
|
|
564
|
+
entry.readings =
|
|
565
|
+
within && !within.current
|
|
566
|
+
? undefined
|
|
567
|
+
: readingsBehind(element, within?.current ?? undefined);
|
|
568
|
+
const luminance = entry.readings && averageOf(entry.readings);
|
|
569
|
+
if (luminance !== undefined) {
|
|
570
|
+
entry.last = nextTone(luminance, undefined);
|
|
571
|
+
onChange(entry.last);
|
|
572
|
+
}
|
|
573
|
+
// (Again once placed: e.g. a popup, positioned after it's mounted, by a
|
|
574
|
+
// transform no observer sees, transitioning in.)
|
|
575
|
+
scheduleTouched(element);
|
|
576
|
+
const settled = window.setTimeout(() => scheduleTouched(element), 300);
|
|
577
|
+
return () => {
|
|
578
|
+
clearTimeout(settled);
|
|
579
|
+
entries.delete(element);
|
|
580
|
+
resizeObserver?.unobserve(element);
|
|
581
|
+
intersectionObserver?.unobserve(element);
|
|
582
|
+
if (entries.size === 0)
|
|
583
|
+
unlisten();
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* The tone of what's behind an element (`ref`'s): bright or dim, sampled as
|
|
588
|
+
* the page or the element scrolls or resizes (see above); `undefined` until
|
|
589
|
+
* known (e.g. an image behind it), or while not `enabled`. For glass of the
|
|
590
|
+
* library's (its `context` `adaptive`), and the app's own (e.g. symbols over
|
|
591
|
+
* whatever is behind them); `within` an ancestor, what's painted in it
|
|
592
|
+
* (e.g. a card's text, on its card).
|
|
593
|
+
*/
|
|
594
|
+
export const useBackdropTone = (ref, { dwell = 0, enabled = true, within } = {}) => {
|
|
595
|
+
const [tone, setTone] = useState(undefined);
|
|
596
|
+
useLayoutEffect(() => {
|
|
597
|
+
const { current: element } = ref;
|
|
598
|
+
if (!enabled || !element)
|
|
599
|
+
return undefined;
|
|
600
|
+
const unregister = register(element, within, dwell, setTone);
|
|
601
|
+
return () => {
|
|
602
|
+
unregister();
|
|
603
|
+
setTone(undefined);
|
|
604
|
+
};
|
|
605
|
+
}, [dwell, enabled, ref, within]);
|
|
606
|
+
return enabled ? tone : undefined;
|
|
607
|
+
};
|
|
608
|
+
//# sourceMappingURL=backdrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backdrop.js","sourceRoot":"","sources":["../../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
3
|
+
/** A box's point: its size, and the point's offset in it (px). */
|
|
4
|
+
type At = {
|
|
5
|
+
height: number;
|
|
6
|
+
width: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A background's color at a point (see the top): its topmost layer there
|
|
12
|
+
* at least 30% opaque, else its color (null: none that opaque; undefined:
|
|
13
|
+
* a layer unknown, e.g. an image).
|
|
14
|
+
*/
|
|
15
|
+
export declare const backgroundColorAt: (backgroundImage: string, backgroundColor: string, at: At, parse: (color: string) => Rgba | undefined) => Rgba | null | undefined;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=gradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradient.d.ts","sourceRoot":"","sources":["../../../src/components/glass/gradient.ts"],"names":[],"mappings":"AAQA,4DAA4D;AAC5D,MAAM,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAE7E,kEAAkE;AAClE,KAAK,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAuOlE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,iBAAiB,MAAM,EACvB,iBAAiB,MAAM,EACvB,IAAI,EAAE,EACN,OAAO,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,KACzC,IAAI,GAAG,IAAI,GAAG,SAUhB,CAAC"}
|