@johly/vaul-svelte 1.0.0-next.8

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.
Files changed (53) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +58 -0
  3. package/dist/components/drawer/drawer-content.svelte +60 -0
  4. package/dist/components/drawer/drawer-content.svelte.d.ts +5 -0
  5. package/dist/components/drawer/drawer-handle.svelte +31 -0
  6. package/dist/components/drawer/drawer-handle.svelte.d.ts +4 -0
  7. package/dist/components/drawer/drawer-nested.svelte +37 -0
  8. package/dist/components/drawer/drawer-nested.svelte.d.ts +3 -0
  9. package/dist/components/drawer/drawer-overlay.svelte +32 -0
  10. package/dist/components/drawer/drawer-overlay.svelte.d.ts +5 -0
  11. package/dist/components/drawer/drawer-portal.svelte +10 -0
  12. package/dist/components/drawer/drawer-portal.svelte.d.ts +3 -0
  13. package/dist/components/drawer/drawer.svelte +383 -0
  14. package/dist/components/drawer/drawer.svelte.d.ts +3 -0
  15. package/dist/components/drawer/index.d.ts +12 -0
  16. package/dist/components/drawer/index.js +11 -0
  17. package/dist/components/drawer/types.d.ts +126 -0
  18. package/dist/components/drawer/types.js +1 -0
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.js +1 -0
  21. package/dist/components/utils/mounted.svelte +12 -0
  22. package/dist/components/utils/mounted.svelte.d.ts +6 -0
  23. package/dist/context.d.ts +42 -0
  24. package/dist/context.js +2 -0
  25. package/dist/helpers.d.ts +16 -0
  26. package/dist/helpers.js +95 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.js +2 -0
  29. package/dist/internal/browser.d.ts +8 -0
  30. package/dist/internal/browser.js +30 -0
  31. package/dist/internal/constants.d.ts +11 -0
  32. package/dist/internal/constants.js +11 -0
  33. package/dist/internal/noop.d.ts +1 -0
  34. package/dist/internal/noop.js +3 -0
  35. package/dist/internal/use-id.d.ts +4 -0
  36. package/dist/internal/use-id.js +8 -0
  37. package/dist/types.d.ts +12 -0
  38. package/dist/types.js +1 -0
  39. package/dist/use-drawer-content.svelte.js +187 -0
  40. package/dist/use-drawer-handle.svelte.d.ts +18 -0
  41. package/dist/use-drawer-handle.svelte.js +83 -0
  42. package/dist/use-drawer-overlay.svelte.d.ts +15 -0
  43. package/dist/use-drawer-overlay.svelte.js +40 -0
  44. package/dist/use-drawer-root.svelte.js +575 -0
  45. package/dist/use-position-fixed.svelte.d.ts +20 -0
  46. package/dist/use-position-fixed.svelte.js +114 -0
  47. package/dist/use-prevent-scroll.svelte.d.ts +15 -0
  48. package/dist/use-prevent-scroll.svelte.js +235 -0
  49. package/dist/use-scale-background.svelte.d.ts +1 -0
  50. package/dist/use-scale-background.svelte.js +57 -0
  51. package/dist/use-snap-points.svelte.d.ts +34 -0
  52. package/dist/use-snap-points.svelte.js +260 -0
  53. package/package.json +64 -0
@@ -0,0 +1,114 @@
1
+ import { isSafari } from "./internal/browser.js";
2
+ import { onMount } from "svelte";
3
+ import { on } from "svelte/events";
4
+ import { watch } from "runed";
5
+ let previousBodyPosition = null;
6
+ /**
7
+ * This hook is necessary to prevent buggy behavior on iOS devices (need to test on Android).
8
+ * I won't get into too much detail about what bugs it solves, but so far I've found that setting the body to `position: fixed` is the most reliable way to prevent those bugs.
9
+ * Issues that this hook solves:
10
+ * https://github.com/emilkowalski/vaul/issues/435
11
+ * https://github.com/emilkowalski/vaul/issues/433
12
+ * And more that I discovered, but were just not reported.
13
+ */
14
+ export function usePositionFixed({ open, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles, }) {
15
+ let activeUrl = $state(typeof window !== "undefined" ? window.location.href : "");
16
+ let scrollPos = 0;
17
+ function setPositionFixed() {
18
+ // All browsers on iOS will return true here.
19
+ if (!isSafari())
20
+ return;
21
+ // If previousBodyPosition is already set, don't set it again.
22
+ if (previousBodyPosition === null && open.current && !noBodyStyles.current) {
23
+ previousBodyPosition = {
24
+ position: document.body.style.position,
25
+ top: document.body.style.top,
26
+ left: document.body.style.left,
27
+ height: document.body.style.height,
28
+ right: "unset",
29
+ };
30
+ // Update the dom inside an animation frame
31
+ const { scrollX, innerHeight } = window;
32
+ document.body.style.setProperty("position", "fixed", "important");
33
+ Object.assign(document.body.style, {
34
+ top: `${-scrollPos}px`,
35
+ left: `${-scrollX}px`,
36
+ right: "0px",
37
+ height: "auto",
38
+ });
39
+ window.setTimeout(() => window.requestAnimationFrame(() => {
40
+ // Attempt to check if the bottom bar appeared due to the position change
41
+ const bottomBarHeight = innerHeight - window.innerHeight;
42
+ if (bottomBarHeight && scrollPos >= innerHeight) {
43
+ // Move the content further up so that the bottom bar doesn't hide it
44
+ document.body.style.top = `${-(scrollPos + bottomBarHeight)}px`;
45
+ }
46
+ }), 300);
47
+ }
48
+ }
49
+ function restorePositionSetting() {
50
+ // All browsers on iOS will return true here.
51
+ if (!isSafari())
52
+ return;
53
+ if (previousBodyPosition !== null && !noBodyStyles.current) {
54
+ // Convert the position from "px" to Int
55
+ const y = -parseInt(document.body.style.top, 10);
56
+ const x = -parseInt(document.body.style.left, 10);
57
+ // Restore styles
58
+ Object.assign(document.body.style, previousBodyPosition);
59
+ window.requestAnimationFrame(() => {
60
+ if (preventScrollRestoration.current && activeUrl !== window.location.href) {
61
+ activeUrl = window.location.href;
62
+ return;
63
+ }
64
+ window.scrollTo(x, y);
65
+ });
66
+ previousBodyPosition = null;
67
+ }
68
+ }
69
+ onMount(() => {
70
+ function onScroll() {
71
+ scrollPos = window.scrollY;
72
+ }
73
+ onScroll();
74
+ return on(window, "scroll", onScroll);
75
+ });
76
+ watch([() => modal.current, () => activeUrl], () => {
77
+ if (!modal.current)
78
+ return;
79
+ return () => {
80
+ if (typeof document === "undefined")
81
+ return;
82
+ // Another drawer is opened, safe to ignore the execution
83
+ const hasDrawerOpened = !!document.querySelector("[data-vaul-drawer]");
84
+ if (hasDrawerOpened)
85
+ return;
86
+ restorePositionSetting();
87
+ };
88
+ });
89
+ watch([
90
+ () => open.current,
91
+ () => hasBeenOpened(),
92
+ () => activeUrl,
93
+ () => modal.current,
94
+ () => nested.current,
95
+ ], () => {
96
+ if (nested.current || !hasBeenOpened())
97
+ return;
98
+ // This is needed to force Safari toolbar to show **before** the drawer starts animating to prevent a gnarly shift from happening
99
+ if (open.current) {
100
+ // avoid for standalone mode (PWA)
101
+ const isStandalone = window.matchMedia("(display-mode: standalone)").matches;
102
+ !isStandalone && setPositionFixed();
103
+ if (!modal.current) {
104
+ window.setTimeout(() => {
105
+ restorePositionSetting();
106
+ }, 500);
107
+ }
108
+ }
109
+ else {
110
+ restorePositionSetting();
111
+ }
112
+ });
113
+ return { restorePositionSetting };
114
+ }
@@ -0,0 +1,15 @@
1
+ interface PreventScrollOptions {
2
+ /** Whether the scroll lock is disabled. */
3
+ isDisabled: () => boolean;
4
+ focusCallback?: () => void;
5
+ }
6
+ export declare function isScrollable(node: Element): boolean;
7
+ export declare function getScrollParent(node: Element): Element;
8
+ /**
9
+ * Prevents scrolling on the document body on mount, and
10
+ * restores it on unmount. Also ensures that content does not
11
+ * shift due to the scrollbars disappearing.
12
+ */
13
+ export declare function usePreventScroll(opts: PreventScrollOptions): void;
14
+ export declare function isInput(target: Element): boolean;
15
+ export {};
@@ -0,0 +1,235 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ // This code comes from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/overlays/src/usePreventScroll.ts
3
+ import { watch } from "runed";
4
+ import { isBrowser, isIOS } from "./internal/browser.js";
5
+ import { on } from "svelte/events";
6
+ const KEYBOARD_BUFFER = 24;
7
+ function chain(...callbacks) {
8
+ return (...args) => {
9
+ for (let callback of callbacks) {
10
+ if (typeof callback === "function") {
11
+ callback(...args);
12
+ }
13
+ }
14
+ };
15
+ }
16
+ const visualViewport = isBrowser && window.visualViewport;
17
+ export function isScrollable(node) {
18
+ let style = window.getComputedStyle(node);
19
+ return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
20
+ }
21
+ export function getScrollParent(node) {
22
+ if (isScrollable(node)) {
23
+ node = node.parentElement;
24
+ }
25
+ while (node && !isScrollable(node)) {
26
+ node = node.parentElement;
27
+ }
28
+ return node || document.scrollingElement || document.documentElement;
29
+ }
30
+ // HTML input types that do not cause the software keyboard to appear.
31
+ const nonTextInputTypes = new Set([
32
+ "checkbox",
33
+ "radio",
34
+ "range",
35
+ "color",
36
+ "file",
37
+ "image",
38
+ "button",
39
+ "submit",
40
+ "reset",
41
+ ]);
42
+ // The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
43
+ let preventScrollCount = 0;
44
+ let restore;
45
+ /**
46
+ * Prevents scrolling on the document body on mount, and
47
+ * restores it on unmount. Also ensures that content does not
48
+ * shift due to the scrollbars disappearing.
49
+ */
50
+ export function usePreventScroll(opts) {
51
+ watch(opts.isDisabled, () => {
52
+ if (opts.isDisabled()) {
53
+ return;
54
+ }
55
+ preventScrollCount++;
56
+ if (preventScrollCount === 1) {
57
+ if (isIOS()) {
58
+ restore = preventScrollMobileSafari();
59
+ }
60
+ }
61
+ return () => {
62
+ preventScrollCount--;
63
+ if (preventScrollCount === 0) {
64
+ restore?.();
65
+ }
66
+ };
67
+ });
68
+ }
69
+ // Mobile Safari is a whole different beast. Even with overflow: hidden,
70
+ // it still scrolls the page in many situations:
71
+ //
72
+ // 1. When the bottom toolbar and address bar are collapsed, page scrolling is always allowed.
73
+ // 2. When the keyboard is visible, the viewport does not resize. Instead, the keyboard covers part of
74
+ // it, so it becomes scrollable.
75
+ // 3. When tapping on an input, the page always scrolls so that the input is centered in the visual viewport.
76
+ // This may cause even fixed position elements to scroll off the screen.
77
+ // 4. When using the next/previous buttons in the keyboard to navigate between inputs, the whole page always
78
+ // scrolls, even if the input is inside a nested scrollable element that could be scrolled instead.
79
+ //
80
+ // In order to work around these cases, and prevent scrolling without jankiness, we do a few things:
81
+ //
82
+ // 1. Prevent default on `touchmove` events that are not in a scrollable element. This prevents touch scrolling
83
+ // on the window.
84
+ // 2. Prevent default on `touchmove` events inside a scrollable element when the scroll position is at the
85
+ // top or bottom. This avoids the whole page scrolling instead, but does prevent overscrolling.
86
+ // 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
87
+ // 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top
88
+ // of the page, which prevents it from scrolling the page. After the input is focused, scroll the element
89
+ // into view ourselves, without scrolling the whole page.
90
+ // 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
91
+ // same visually, but makes the actual scroll position always zero. This is required to make all of the
92
+ // above work or Safari will still try to scroll the page when focusing an input.
93
+ // 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
94
+ // to navigate to an input with the next/previous buttons that's outside a modal.
95
+ function preventScrollMobileSafari() {
96
+ let scrollable;
97
+ let lastY = 0;
98
+ const onTouchStart = (e) => {
99
+ // Store the nearest scrollable parent element from the element that the user touched.
100
+ scrollable = getScrollParent(e.target);
101
+ if (scrollable === document.documentElement && scrollable === document.body) {
102
+ return;
103
+ }
104
+ lastY = e.changedTouches[0].pageY;
105
+ };
106
+ let onTouchMove = (e) => {
107
+ // Prevent scrolling the window.
108
+ if (!scrollable ||
109
+ scrollable === document.documentElement ||
110
+ scrollable === document.body) {
111
+ e.preventDefault();
112
+ return;
113
+ }
114
+ // Prevent scrolling up when at the top and scrolling down when at the bottom
115
+ // of a nested scrollable area, otherwise mobile Safari will start scrolling
116
+ // the window instead. Unfortunately, this disables bounce scrolling when at
117
+ // the top but it's the best we can do.
118
+ let y = e.changedTouches[0].pageY;
119
+ let scrollTop = scrollable.scrollTop;
120
+ let bottom = scrollable.scrollHeight - scrollable.clientHeight;
121
+ if (bottom === 0) {
122
+ return;
123
+ }
124
+ if ((scrollTop <= 0 && y > lastY) || (scrollTop >= bottom && y < lastY)) {
125
+ e.preventDefault();
126
+ }
127
+ lastY = y;
128
+ };
129
+ let onTouchEnd = (e) => {
130
+ let target = e.target;
131
+ // Apply this change if we're not already focused on the target element
132
+ if (isInput(target) && target !== document.activeElement) {
133
+ e.preventDefault();
134
+ // Apply a transform to trick Safari into thinking the input is at the top of the page
135
+ // so it doesn't try to scroll it into view. When tapping on an input, this needs to
136
+ // be done before the "focus" event, so we have to focus the element ourselves.
137
+ target.style.transform = "translateY(-2000px)";
138
+ target.focus();
139
+ requestAnimationFrame(() => {
140
+ target.style.transform = "";
141
+ });
142
+ }
143
+ };
144
+ const onFocus = (e) => {
145
+ let target = e.target;
146
+ if (isInput(target)) {
147
+ // Transform also needs to be applied in the focus event in cases where focus moves
148
+ // other than tapping on an input directly, e.g. the next/previous buttons in the
149
+ // software keyboard. In these cases, it seems applying the transform in the focus event
150
+ // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️
151
+ target.style.transform = "translateY(-2000px)";
152
+ requestAnimationFrame(() => {
153
+ target.style.transform = "";
154
+ // This will have prevented the browser from scrolling the focused element into view,
155
+ // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
156
+ if (visualViewport) {
157
+ if (visualViewport.height < window.innerHeight) {
158
+ // If the keyboard is already visible, do this after one additional frame
159
+ // to wait for the transform to be removed.
160
+ requestAnimationFrame(() => {
161
+ scrollIntoView(target);
162
+ });
163
+ }
164
+ else {
165
+ // Otherwise, wait for the visual viewport to resize before scrolling so we can
166
+ // measure the correct position to scroll to.
167
+ visualViewport.addEventListener("resize", () => scrollIntoView(target), {
168
+ once: true,
169
+ });
170
+ }
171
+ }
172
+ });
173
+ }
174
+ };
175
+ let onWindowScroll = () => {
176
+ // Last resort. If the window scrolled, scroll it back to the top.
177
+ // It should always be at the top because the body will have a negative margin (see below).
178
+ window.scrollTo(0, 0);
179
+ };
180
+ // Record the original scroll position so we can restore it.
181
+ // Then apply a negative margin to the body to offset it by the scroll position. This will
182
+ // enable us to scroll the window to the top, which is required for the rest of this to work.
183
+ let scrollX = window.pageXOffset;
184
+ let scrollY = window.pageYOffset;
185
+ let restoreStyles = chain(setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`)
186
+ // setStyle(document.documentElement, 'overflow', 'hidden'),
187
+ // setStyle(document.body, 'marginTop', `-${scrollY}px`),
188
+ );
189
+ // Scroll to the top. The negative margin on the body will make this appear the same.
190
+ window.scrollTo(0, 0);
191
+ let removeEvents = chain(on(document, "touchstart", onTouchStart, { passive: false, capture: true }), on(document, "touchmove", onTouchMove, { passive: false, capture: true }), on(document, "touchend", onTouchEnd, { passive: false, capture: true }), on(document, "focus", onFocus, { capture: true }), on(window, "scroll", onWindowScroll));
192
+ return () => {
193
+ // Restore styles and scroll the page back to where it was.
194
+ restoreStyles();
195
+ removeEvents();
196
+ window.scrollTo(scrollX, scrollY);
197
+ };
198
+ }
199
+ // Sets a CSS property on an element, and returns a function to revert it to the previous value.
200
+ function setStyle(element, style, value) {
201
+ // https://github.com/microsoft/TypeScript/issues/17827#issuecomment-391663310
202
+ let cur = element.style[style];
203
+ // @ts-expect-error - TS doesn't like dynamic keys on CSSStyleDeclaration
204
+ element.style[style] = value;
205
+ return () => {
206
+ // @ts-expect-error - TS doesn't like dynamic keys on CSSStyleDeclaration
207
+ element.style[style] = cur;
208
+ };
209
+ }
210
+ function scrollIntoView(target) {
211
+ let root = document.scrollingElement || document.documentElement;
212
+ while (target && target !== root) {
213
+ // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
214
+ let scrollable = getScrollParent(target);
215
+ if (scrollable !== document.documentElement &&
216
+ scrollable !== document.body &&
217
+ scrollable !== target) {
218
+ let scrollableTop = scrollable.getBoundingClientRect().top;
219
+ let targetTop = target.getBoundingClientRect().top;
220
+ let targetBottom = target.getBoundingClientRect().bottom;
221
+ // Buffer is needed for some edge cases
222
+ const keyboardHeight = scrollable.getBoundingClientRect().bottom + KEYBOARD_BUFFER;
223
+ if (targetBottom > keyboardHeight) {
224
+ scrollable.scrollTop += targetTop - scrollableTop;
225
+ }
226
+ }
227
+ // @ts-expect-error - sh
228
+ target = scrollable.parentElement;
229
+ }
230
+ }
231
+ export function isInput(target) {
232
+ return ((target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||
233
+ target instanceof HTMLTextAreaElement ||
234
+ (target instanceof HTMLElement && target.isContentEditable));
235
+ }
@@ -0,0 +1 @@
1
+ export declare function useScaleBackground(): void;
@@ -0,0 +1,57 @@
1
+ import { watch } from "runed";
2
+ import { BORDER_RADIUS, TRANSITIONS, WINDOW_TOP_OFFSET } from "./internal/constants.js";
3
+ import { assignStyle, chain, isVertical } from "./helpers.js";
4
+ import { noop } from "./internal/noop.js";
5
+ import { DrawerContext } from "./context.js";
6
+ export function useScaleBackground() {
7
+ const ctx = DrawerContext.get();
8
+ let timeoutId = null;
9
+ const initialBackgroundColor = typeof document !== "undefined" ? document.body.style.backgroundColor : "";
10
+ function getScale() {
11
+ return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
12
+ }
13
+ watch([
14
+ () => ctx.open.current,
15
+ () => ctx.shouldScaleBackground.current,
16
+ () => ctx.setBackgroundColorOnScale.current,
17
+ ], () => {
18
+ if (ctx.open.current && ctx.shouldScaleBackground.current) {
19
+ if (timeoutId)
20
+ clearTimeout(timeoutId);
21
+ const wrapper = document.querySelector("[data-vaul-drawer-wrapper]") ||
22
+ document.querySelector("[data-vaul-drawer-wrapper]");
23
+ if (!wrapper)
24
+ return;
25
+ chain(ctx.setBackgroundColorOnScale.current && !ctx.noBodyStyles.current
26
+ ? assignStyle(document.body, { background: "black" })
27
+ : noop, assignStyle(wrapper, {
28
+ transformOrigin: isVertical(ctx.direction.current) ? "top" : "left",
29
+ transitionProperty: "transform, border-radius",
30
+ transitionDuration: `${TRANSITIONS.DURATION}s`,
31
+ transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(",")})`,
32
+ }));
33
+ const wrapperStylesCleanup = assignStyle(wrapper, {
34
+ borderRadius: `${BORDER_RADIUS}px`,
35
+ overflow: "hidden",
36
+ ...(isVertical(ctx.direction.current)
37
+ ? {
38
+ transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
39
+ }
40
+ : {
41
+ transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
42
+ }),
43
+ });
44
+ return () => {
45
+ wrapperStylesCleanup();
46
+ timeoutId = window.setTimeout(() => {
47
+ if (initialBackgroundColor) {
48
+ document.body.style.background = initialBackgroundColor;
49
+ }
50
+ else {
51
+ document.body.style.removeProperty("background");
52
+ }
53
+ }, TRANSITIONS.DURATION * 1000);
54
+ };
55
+ }
56
+ });
57
+ }
@@ -0,0 +1,34 @@
1
+ import type { ReadableBoxedValues, WritableBoxedValues } from "svelte-toolbelt";
2
+ import type { DrawerDirection, Getters } from "./types.js";
3
+ export declare function useSnapPoints({ snapPoints, drawerNode: drawerNode, overlayNode: overlayNode, fadeFromIndex, setOpenTime, direction, container, snapToSequentialPoint, activeSnapPoint, open, isReleasing, }: Getters<{
4
+ drawerNode: HTMLElement | null;
5
+ overlayNode: HTMLElement | null;
6
+ isReleasing: boolean;
7
+ }> & {
8
+ setOpenTime: (time: Date) => void;
9
+ } & WritableBoxedValues<{
10
+ activeSnapPoint: number | string | null | undefined;
11
+ open: boolean;
12
+ }> & ReadableBoxedValues<{
13
+ direction: DrawerDirection;
14
+ container: HTMLElement | null | undefined;
15
+ snapToSequentialPoint: boolean;
16
+ fadeFromIndex: number | undefined;
17
+ snapPoints: (number | string)[] | undefined;
18
+ }>): {
19
+ readonly isLastSnapPoint: true | null;
20
+ readonly shouldFade: boolean;
21
+ readonly activeSnapPointIndex: number | undefined;
22
+ readonly snapPointsOffset: number[];
23
+ getPercentageDragged: (absDraggedDistance: number, isDraggingDown: boolean) => number | null;
24
+ onRelease: ({ draggedDistance, closeDrawer, velocity, dismissible, }: {
25
+ draggedDistance: number;
26
+ closeDrawer: () => void;
27
+ velocity: number;
28
+ dismissible: boolean;
29
+ }) => void;
30
+ onDrag: ({ draggedDistance }: {
31
+ draggedDistance: number;
32
+ }) => void;
33
+ };
34
+ export declare function isBottomOrRight(direction: DrawerDirection): boolean;