2023-05-12 20:22:16 +01:00
|
|
|
[package]
|
|
|
|
name = "leptos-use"
|
2024-08-14 03:43:00 +01:00
|
|
|
version = "0.12.0"
|
2023-05-12 20:22:16 +01:00
|
|
|
edition = "2021"
|
|
|
|
authors = ["Marc-Stefan Cassola"]
|
|
|
|
categories = ["gui", "web-programming"]
|
2024-07-28 20:46:28 +01:00
|
|
|
description = "Collection of essential Leptos utilities inspired by React-Use / VueUse / SolidJS-USE"
|
2023-05-12 20:22:16 +01:00
|
|
|
exclude = ["examples/", "tests/"]
|
|
|
|
keywords = ["leptos", "utilities"]
|
|
|
|
license = "MIT OR Apache-2.0"
|
2023-05-13 23:05:08 +01:00
|
|
|
readme = "README.md"
|
2023-05-12 20:22:16 +01:00
|
|
|
repository = "https://github.com/Synphonyte/leptos-use"
|
2023-06-05 00:02:13 +01:00
|
|
|
homepage = "https://leptos-use.rs"
|
2023-05-12 20:22:16 +01:00
|
|
|
|
|
|
|
[dependencies]
|
2024-01-21 17:41:14 +05:30
|
|
|
actix-web = { version = "4", optional = true, default-features = false }
|
2024-08-22 13:37:32 +01:00
|
|
|
async-trait = { version = "0.1", optional = true }
|
2023-10-23 20:15:05 -05:00
|
|
|
cfg-if = "1"
|
2024-08-22 13:37:32 +01:00
|
|
|
codee = { version = "0.1", optional = true }
|
|
|
|
cookie = { version = "0.18", features = ["percent-encode"], optional = true }
|
2023-08-04 15:58:03 +01:00
|
|
|
default-struct-builder = "0.5"
|
2024-08-22 13:37:32 +01:00
|
|
|
futures-util = { version = "0.3", optional = true }
|
2024-08-22 13:45:56 +01:00
|
|
|
gloo-timers = { version = "0.3", optional = true, features = ["futures"] }
|
|
|
|
gloo-utils = { version = "0.2", optional = true }
|
2024-01-27 03:29:14 +05:30
|
|
|
http1 = { version = "1", optional = true, package = "http" }
|
|
|
|
http0_2 = { version = "0.2", optional = true, package = "http" }
|
2023-10-23 20:15:05 -05:00
|
|
|
js-sys = "0.3"
|
|
|
|
lazy_static = "1"
|
2024-08-12 21:59:10 +01:00
|
|
|
leptos = { git = "https://github.com/leptos-rs/leptos" }
|
|
|
|
leptos_axum = { optional = true, git = "https://github.com/leptos-rs/leptos" }
|
|
|
|
leptos_actix = { optional = true, git = "https://github.com/leptos-rs/leptos" }
|
2024-05-07 12:41:44 +01:00
|
|
|
leptos-spin = { version = "0.2", optional = true }
|
2023-06-21 18:14:43 +02:00
|
|
|
num = { version = "0.4", optional = true }
|
2023-10-23 20:15:05 -05:00
|
|
|
paste = "1"
|
2024-07-19 20:22:27 -06:00
|
|
|
send_wrapper = "0.6.0"
|
2024-01-23 15:55:12 +00:00
|
|
|
thiserror = "1"
|
2024-08-22 13:37:32 +01:00
|
|
|
unic-langid = { version = "0.9", optional = true }
|
2024-08-13 16:19:19 +01:00
|
|
|
wasm-bindgen = "=0.2.93"
|
2023-10-23 23:49:11 -05:00
|
|
|
wasm-bindgen-futures = "0.4"
|
2024-08-22 13:37:32 +01:00
|
|
|
web-sys = { version = "=0.3.70", optional = true }
|
2023-05-29 01:52:03 +01:00
|
|
|
|
2024-01-31 16:54:25 +00:00
|
|
|
[dev-dependencies]
|
2024-08-22 17:47:06 +01:00
|
|
|
codee = { version = "0.1", features = [
|
|
|
|
"json_serde",
|
|
|
|
"msgpack_serde",
|
|
|
|
"base64",
|
|
|
|
"prost",
|
|
|
|
] }
|
2024-01-31 16:54:25 +00:00
|
|
|
getrandom = { version = "0.2", features = ["js"] }
|
2024-08-12 21:59:10 +01:00
|
|
|
leptos_meta = { git = "https://github.com/leptos-rs/leptos" }
|
2024-04-10 22:51:01 +01:00
|
|
|
rand = "0.8"
|
2024-07-08 17:10:29 +01:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
2024-08-13 13:45:36 +01:00
|
|
|
unic-langid = { version = "0.9", features = ["macros"] }
|
2024-01-31 16:54:25 +00:00
|
|
|
|
2023-05-28 17:42:16 +01:00
|
|
|
[features]
|
2024-08-22 13:37:32 +01:00
|
|
|
default = [
|
|
|
|
"is_err",
|
|
|
|
"is_none",
|
|
|
|
"is_ok",
|
|
|
|
"is_some",
|
|
|
|
"on_click_outside",
|
|
|
|
"signal_debounced",
|
|
|
|
"signal_throttled",
|
|
|
|
"storage",
|
|
|
|
"sync_signal",
|
|
|
|
"use_active_element",
|
|
|
|
"use_breakpoints",
|
|
|
|
"use_broadcast_channel",
|
|
|
|
"use_clipboard",
|
|
|
|
"use_color_mode",
|
|
|
|
"use_cookie",
|
|
|
|
"use_css_var",
|
|
|
|
"use_cycle_list",
|
|
|
|
"use_debounce_fn",
|
|
|
|
"use_device_orientation",
|
|
|
|
"use_device_pixel_ratio",
|
|
|
|
"use_display_media",
|
|
|
|
"use_document",
|
|
|
|
"use_document_visibility",
|
|
|
|
"use_draggable",
|
|
|
|
"use_drop_zone",
|
|
|
|
"use_element_bounding",
|
|
|
|
"use_element_hover",
|
|
|
|
"use_element_size",
|
|
|
|
"use_element_visibility",
|
|
|
|
"use_event_listener",
|
|
|
|
"use_event_source",
|
|
|
|
"use_favicon",
|
|
|
|
"use_geolocation",
|
|
|
|
"use_idle",
|
|
|
|
"use_infinite_scroll",
|
|
|
|
"use_intersection_observer",
|
|
|
|
"use_interval",
|
|
|
|
"use_interval_fn",
|
|
|
|
"use_intl_number_format",
|
|
|
|
"use_locale",
|
|
|
|
"use_locales",
|
|
|
|
"use_media_query",
|
|
|
|
"use_mouse",
|
|
|
|
"use_mouse_in_element",
|
|
|
|
"use_mutation_observer",
|
|
|
|
"use_permission",
|
|
|
|
"use_preferred_contrast",
|
|
|
|
"use_preferred_dark",
|
|
|
|
"use_prefers_reduced_motion",
|
|
|
|
"use_raf_fn",
|
|
|
|
"use_resize_observer",
|
|
|
|
"use_scroll",
|
|
|
|
"use_service_worker",
|
|
|
|
"use_sorted",
|
|
|
|
"use_supported",
|
|
|
|
"use_throttle_fn",
|
|
|
|
"use_timeout_fn",
|
|
|
|
"use_timestamp",
|
|
|
|
"use_to_string",
|
|
|
|
"use_user_media",
|
|
|
|
"use_web_notification",
|
|
|
|
"use_websocket",
|
|
|
|
"use_window",
|
|
|
|
"use_window_focus",
|
|
|
|
"use_window_scroll",
|
|
|
|
"watch_debounced",
|
|
|
|
"watch_pausable",
|
|
|
|
"watch_throttled",
|
|
|
|
"watch_with_options",
|
|
|
|
"whenever"
|
|
|
|
]
|
2024-01-31 16:54:25 +00:00
|
|
|
actix = ["dep:actix-web", "dep:leptos_actix", "dep:http0_2"]
|
2024-01-27 03:29:14 +05:30
|
|
|
axum = ["dep:leptos_axum", "dep:http1"]
|
2024-08-22 13:37:32 +01:00
|
|
|
docs = ["dep:web-sys"]
|
|
|
|
element = ["use_document", "use_window", "dep:web-sys", "web-sys/EventTarget"]
|
|
|
|
is = ["use_window"]
|
|
|
|
is_err = []
|
|
|
|
is_none = []
|
|
|
|
is_ok = []
|
|
|
|
is_some = []
|
2023-06-10 19:15:41 +01:00
|
|
|
math = ["num"]
|
2024-08-22 13:37:32 +01:00
|
|
|
on_click_outside = ["use_event_listener", "is"]
|
|
|
|
signal_debounced = ["use_debounce_fn"]
|
|
|
|
signal_throttled = ["use_throttle_fn"]
|
2024-04-18 18:09:09 -03:00
|
|
|
spin = ["dep:leptos-spin", "dep:http1"]
|
2023-07-14 22:43:19 +01:00
|
|
|
ssr = []
|
2024-08-22 13:37:32 +01:00
|
|
|
storage = [
|
|
|
|
"use_event_listener",
|
|
|
|
"use_window",
|
|
|
|
"watch_with_options",
|
|
|
|
"dep:web-sys",
|
|
|
|
"dep:codee",
|
|
|
|
"web-sys/CustomEventInit",
|
|
|
|
"web-sys/Storage"
|
|
|
|
]
|
|
|
|
sync_signal = []
|
|
|
|
use_active_element = ["use_event_listener"]
|
|
|
|
use_breakpoints = ["use_media_query"]
|
|
|
|
use_broadcast_channel = [
|
|
|
|
"use_event_listener",
|
|
|
|
"use_supported",
|
|
|
|
"dep:codee",
|
|
|
|
"web-sys/BroadcastChannel",
|
|
|
|
]
|
|
|
|
use_clipboard = [
|
|
|
|
"use_event_listener",
|
|
|
|
"use_permission",
|
|
|
|
"use_supported",
|
|
|
|
"use_timeout_fn",
|
|
|
|
"web-sys/Clipboard",
|
|
|
|
]
|
|
|
|
use_color_mode = [
|
|
|
|
"use_cookie",
|
|
|
|
"use_cycle_list",
|
|
|
|
"use_preferred_dark",
|
|
|
|
"storage",
|
|
|
|
"sync_signal"
|
|
|
|
]
|
|
|
|
use_cookie = [
|
|
|
|
"use_broadcast_channel",
|
|
|
|
"watch_pausable",
|
|
|
|
"dep:cookie",
|
|
|
|
"web-sys/HtmlDocument",
|
|
|
|
]
|
|
|
|
use_css_var = [
|
|
|
|
"use_mutation_observer",
|
|
|
|
"watch_with_options",
|
|
|
|
]
|
|
|
|
use_cycle_list = []
|
|
|
|
use_debounce_fn = []
|
|
|
|
use_device_orientation = ["use_event_listener", "use_supported"]
|
|
|
|
use_device_pixel_ratio = ["use_event_listener", "web-sys/MediaQueryList"]
|
|
|
|
use_display_media = [
|
|
|
|
"use_window",
|
|
|
|
"web-sys/DisplayMediaStreamConstraints",
|
|
|
|
"web-sys/MediaDevices",
|
|
|
|
"web-sys/MediaStream",
|
|
|
|
"web-sys/MediaStreamTrack",
|
|
|
|
]
|
|
|
|
use_document = [
|
|
|
|
"dep:web-sys",
|
2024-08-22 17:08:21 +01:00
|
|
|
"web-sys/NodeList",
|
2024-08-22 13:37:32 +01:00
|
|
|
"web-sys/VisibilityState",
|
|
|
|
]
|
|
|
|
use_document_visibility = ["use_event_listener", "web-sys/VisibilityState"]
|
|
|
|
use_draggable = ["use_event_listener", "web-sys/DomRect"]
|
|
|
|
use_drop_zone = [
|
|
|
|
"use_event_listener",
|
|
|
|
"web-sys/DataTransfer",
|
|
|
|
"web-sys/File",
|
|
|
|
"web-sys/FileList"
|
|
|
|
]
|
|
|
|
use_element_bounding = [
|
|
|
|
"use_event_listener",
|
|
|
|
"use_resize_observer",
|
|
|
|
"web-sys/DomRect",
|
|
|
|
]
|
|
|
|
use_element_hover = ["use_event_listener"]
|
|
|
|
use_element_size = [
|
|
|
|
"use_resize_observer",
|
|
|
|
"watch_with_options",
|
|
|
|
"web-sys/ResizeObserverSize",
|
|
|
|
]
|
|
|
|
use_element_visibility = [
|
|
|
|
"use_intersection_observer",
|
|
|
|
"web-sys/DomRect",
|
|
|
|
]
|
|
|
|
use_event_listener = [
|
|
|
|
"element",
|
|
|
|
"watch_with_options",
|
|
|
|
"dep:web-sys",
|
|
|
|
"web-sys/EventTarget",
|
|
|
|
"web-sys/EventListenerOptions"
|
|
|
|
]
|
|
|
|
use_event_source = [
|
|
|
|
"use_event_listener",
|
|
|
|
"web-sys/EventSource",
|
|
|
|
"web-sys/EventSourceInit",
|
|
|
|
"dep:codee",
|
|
|
|
]
|
|
|
|
use_favicon = []
|
|
|
|
use_geolocation = [
|
|
|
|
"use_window",
|
|
|
|
"web-sys/Coordinates",
|
|
|
|
"web-sys/Geolocation",
|
|
|
|
"web-sys/Position",
|
|
|
|
"web-sys/PositionError",
|
|
|
|
"web-sys/PositionOptions",
|
|
|
|
]
|
|
|
|
use_idle = [
|
|
|
|
"use_event_listener",
|
|
|
|
"use_document",
|
|
|
|
"use_timestamp",
|
|
|
|
]
|
|
|
|
use_infinite_scroll = [
|
|
|
|
"use_element_visibility",
|
|
|
|
"use_scroll",
|
|
|
|
"dep:gloo-timers",
|
|
|
|
"dep:futures-util",
|
|
|
|
]
|
|
|
|
use_intersection_observer = [
|
|
|
|
"element",
|
|
|
|
"watch_with_options",
|
|
|
|
"web-sys/IntersectionObserver",
|
|
|
|
"web-sys/IntersectionObserverEntry",
|
|
|
|
"web-sys/IntersectionObserverInit",
|
|
|
|
]
|
|
|
|
use_interval = ["use_interval_fn"]
|
|
|
|
use_interval_fn = []
|
|
|
|
use_intl_number_format = []
|
|
|
|
use_locale = ["use_locales", "dep:unic-langid"]
|
|
|
|
use_locales = ["use_event_listener", "use_window"]
|
|
|
|
use_media_query = ["use_event_listener"]
|
|
|
|
use_mouse = [
|
|
|
|
"element",
|
|
|
|
"use_event_listener",
|
|
|
|
"use_window",
|
|
|
|
"web-sys/Touch",
|
|
|
|
"web-sys/TouchList",
|
|
|
|
]
|
|
|
|
use_mouse_in_element = [
|
|
|
|
"use_mouse",
|
|
|
|
"web-sys/DomRect",
|
|
|
|
]
|
|
|
|
use_mutation_observer = [
|
|
|
|
"element",
|
|
|
|
"use_supported",
|
|
|
|
"web-sys/MutationObserver",
|
|
|
|
"web-sys/MutationObserverInit",
|
|
|
|
"web-sys/MutationRecord",
|
|
|
|
]
|
|
|
|
use_permission = [
|
|
|
|
"use_event_listener",
|
|
|
|
"web-sys/Permissions",
|
|
|
|
"web-sys/PermissionState",
|
|
|
|
"web-sys/PermissionStatus",
|
|
|
|
]
|
|
|
|
use_preferred_contrast = ["use_media_query"]
|
|
|
|
use_preferred_dark = ["use_media_query"]
|
|
|
|
use_prefers_reduced_motion = ["use_media_query"]
|
|
|
|
use_raf_fn = []
|
|
|
|
use_resize_observer = [
|
|
|
|
"element",
|
|
|
|
"use_supported",
|
|
|
|
"web-sys/DomRectReadOnly",
|
|
|
|
"web-sys/ResizeObserver",
|
|
|
|
"web-sys/ResizeObserverBoxOptions",
|
|
|
|
"web-sys/ResizeObserverEntry",
|
|
|
|
"web-sys/ResizeObserverOptions",
|
|
|
|
]
|
|
|
|
use_scroll = [
|
|
|
|
"element",
|
|
|
|
"use_event_listener",
|
|
|
|
"use_debounce_fn",
|
|
|
|
"use_throttle_fn",
|
|
|
|
"web-sys/ScrollBehavior",
|
|
|
|
"web-sys/ScrollToOptions",
|
|
|
|
]
|
|
|
|
use_service_worker = [
|
|
|
|
"use_window",
|
|
|
|
"web-sys/ServiceWorker",
|
|
|
|
"web-sys/ServiceWorkerContainer",
|
|
|
|
"web-sys/ServiceWorkerRegistration"
|
|
|
|
]
|
|
|
|
use_sorted = []
|
|
|
|
use_supported = []
|
|
|
|
use_throttle_fn = []
|
|
|
|
use_timeout_fn = []
|
|
|
|
use_timestamp = ["use_interval_fn", "use_raf_fn"]
|
|
|
|
use_to_string = []
|
|
|
|
use_user_media = [
|
|
|
|
"use_window",
|
|
|
|
"web-sys/MediaDevices",
|
|
|
|
"web-sys/MediaStream",
|
|
|
|
"web-sys/MediaStreamConstraints",
|
|
|
|
"web-sys/MediaStreamTrack",
|
|
|
|
]
|
|
|
|
use_web_notification = [
|
|
|
|
"use_supported",
|
|
|
|
"use_window",
|
|
|
|
"use_event_listener",
|
|
|
|
"web-sys/Notification",
|
|
|
|
"web-sys/NotificationOptions",
|
|
|
|
"web-sys/NotificationPermission",
|
|
|
|
"web-sys/NotificationDirection",
|
|
|
|
"web-sys/VisibilityState"
|
|
|
|
]
|
|
|
|
use_websocket = ["dep:codee"]
|
|
|
|
use_window = ["use_document", "dep:web-sys", "web-sys/Navigator", "web-sys/MediaQueryList"]
|
|
|
|
use_window_focus = ["use_event_listener"]
|
|
|
|
use_window_scroll = ["use_event_listener", "use_window"]
|
2024-05-10 14:15:59 -05:00
|
|
|
wasm_ssr = []
|
2024-08-22 13:37:32 +01:00
|
|
|
watch_debounced = ["watch_with_options"]
|
|
|
|
watch_pausable = ["watch_with_options"]
|
|
|
|
watch_throttled = ["watch_with_options"]
|
|
|
|
watch_with_options = []
|
|
|
|
whenever = []
|
2023-06-03 16:23:58 +01:00
|
|
|
|
2023-06-24 01:12:43 +01:00
|
|
|
[package.metadata.docs.rs]
|
2024-07-08 17:10:29 +01:00
|
|
|
features = ["math", "docs", "ssr"]
|
|
|
|
rustdoc-args = ["--cfg=web_sys_unstable_apis"]
|
2024-07-13 16:28:27 -04:00
|
|
|
rustc-args = ["--cfg=web_sys_unstable_apis"]
|