@mindees/atlas 0.25.0 → 0.27.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/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/primitives.d.ts +40 -1
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +55 -1
- package/dist/primitives.js.map +1 -1
- package/dist/web-environment.d.ts +60 -0
- package/dist/web-environment.d.ts.map +1 -0
- package/dist/web-environment.js +98 -0
- package/dist/web-environment.js.map +1 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -12,13 +12,14 @@ import { animateTo, motion } from "./motion.js";
|
|
|
12
12
|
import { FocusScope, FocusScopeProps, Modal, ModalProps, Toast, ToastProps } from "./overlay.js";
|
|
13
13
|
import { Button, ButtonProps, Column, Image, ImageProps, InteractionState, Pressable, PressableProps, Row, ScrollView, ScrollViewProps, Spacer, SpacerProps, Stack, StackProps, Text, TextInput, TextInputProps, TextProps, View, ViewProps, usePressable } from "./primitives.js";
|
|
14
14
|
import { Show, ShowProps } from "./show.js";
|
|
15
|
+
import { WebEnvWindow, connectWebEnvironment } from "./web-environment.js";
|
|
15
16
|
import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@mindees/core";
|
|
16
17
|
|
|
17
18
|
//#region src/index.d.ts
|
|
18
19
|
/** The npm package name. */
|
|
19
20
|
declare const name = "@mindees/atlas";
|
|
20
21
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
21
|
-
declare const VERSION = "0.
|
|
22
|
+
declare const VERSION = "0.27.0";
|
|
22
23
|
/** Current maturity of this package. See the repository `STATUS.md`. */
|
|
23
24
|
declare const maturity: Maturity;
|
|
24
25
|
/**
|
|
@@ -28,5 +29,5 @@ declare const maturity: Maturity;
|
|
|
28
29
|
*/
|
|
29
30
|
declare const info: PackageInfo;
|
|
30
31
|
//#endregion
|
|
31
|
-
export { type A11yProps, type A11yState, Accordion, type AccordionProps, type AccordionSection, ActivityIndicator, type ActivityIndicatorProps, type AsyncState, type AttachableGesture, Avatar, type AvatarProps, Badge, type BadgeProps, type BaseProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, type ColorScheme, Column, type Counter, Divider, type DividerProps, ErrorBoundary, type ErrorBoundaryProps, type Field, FocusScope, type FocusScopeProps, type FormApi, GestureView, type GestureViewProps, Image, type ImageProps, type InteractionState, KeyboardAvoidingView, type KeyboardAvoidingViewProps, type KeyboardState, type Maturity, Modal, type ModalProps, NotImplementedError, type PackageInfo, type PersistentSignalOptions, type PlatformEnvironment, Pressable, type PressableProps, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, type RadioOption, type Reactive, type Role, Row, type SafeAreaInsets, SafeAreaView, type SafeAreaViewProps, ScrollView, type ScrollViewProps, type Segment, SegmentedControl, type SegmentedControlProps, Show, type ShowProps, type SignalStorage, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Stack, type StackProps, Stepper, type StepperProps, type StyleInput, type StyleObject, type StyleValue, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextInput, type TextInputProps, type TextProps, type Theme, type ThemeColors, Toast, type ToastProps, type Toggle, type UseFormOptions, VERSION, View, type ViewProps, type WindowDimensions, animateTo, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
32
|
+
export { type A11yProps, type A11yState, Accordion, type AccordionProps, type AccordionSection, ActivityIndicator, type ActivityIndicatorProps, type AsyncState, type AttachableGesture, Avatar, type AvatarProps, Badge, type BadgeProps, type BaseProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, type ColorScheme, Column, type Counter, Divider, type DividerProps, ErrorBoundary, type ErrorBoundaryProps, type Field, FocusScope, type FocusScopeProps, type FormApi, GestureView, type GestureViewProps, Image, type ImageProps, type InteractionState, KeyboardAvoidingView, type KeyboardAvoidingViewProps, type KeyboardState, type Maturity, Modal, type ModalProps, NotImplementedError, type PackageInfo, type PersistentSignalOptions, type PlatformEnvironment, Pressable, type PressableProps, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, type RadioOption, type Reactive, type Role, Row, type SafeAreaInsets, SafeAreaView, type SafeAreaViewProps, ScrollView, type ScrollViewProps, type Segment, SegmentedControl, type SegmentedControlProps, Show, type ShowProps, type SignalStorage, Skeleton, type SkeletonProps, Spacer, type SpacerProps, Stack, type StackProps, Stepper, type StepperProps, type StyleInput, type StyleObject, type StyleValue, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextInput, type TextInputProps, type TextProps, type Theme, type ThemeColors, Toast, type ToastProps, type Toggle, type UseFormOptions, VERSION, View, type ViewProps, type WebEnvWindow, type WindowDimensions, animateTo, connectWebEnvironment, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;cAea,IAAA;;cAGA,OAAA;;cAGA,QAAA,EAAU,QAAyB;AANhD;;;;AAAiB;AAAjB,cAaa,IAAA,EAAM,WAAiE"}
|
package/dist/index.js
CHANGED
|
@@ -12,12 +12,13 @@ import { useAsync, useCounter, useDebounce, useInterval, usePersistentSignal, us
|
|
|
12
12
|
import { animateTo, motion } from "./motion.js";
|
|
13
13
|
import { FocusScope, Modal, Toast } from "./overlay.js";
|
|
14
14
|
import { Show } from "./show.js";
|
|
15
|
+
import { connectWebEnvironment } from "./web-environment.js";
|
|
15
16
|
import { NotImplementedError, notImplemented } from "@mindees/core";
|
|
16
17
|
//#region src/index.ts
|
|
17
18
|
/** The npm package name. */
|
|
18
19
|
const name = "@mindees/atlas";
|
|
19
20
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
20
|
-
const VERSION = "0.
|
|
21
|
+
const VERSION = "0.27.0";
|
|
21
22
|
/** Current maturity of this package. See the repository `STATUS.md`. */
|
|
22
23
|
const maturity = "experimental";
|
|
23
24
|
/**
|
|
@@ -31,6 +32,6 @@ const info = Object.freeze({
|
|
|
31
32
|
maturity
|
|
32
33
|
});
|
|
33
34
|
//#endregion
|
|
34
|
-
export { Accordion, ActivityIndicator, Avatar, Badge, Button, Card, Checkbox, Chip, Column, Divider, ErrorBoundary, FocusScope, GestureView, Image, KeyboardAvoidingView, Modal, NotImplementedError, Pressable, ProgressBar, RadioGroup, Row, SafeAreaView, ScrollView, SegmentedControl, Show, Skeleton, Spacer, Stack, Stepper, Switch, Tabs, Text, TextInput, Toast, VERSION, View, animateTo, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
35
|
+
export { Accordion, ActivityIndicator, Avatar, Badge, Button, Card, Checkbox, Chip, Column, Divider, ErrorBoundary, FocusScope, GestureView, Image, KeyboardAvoidingView, Modal, NotImplementedError, Pressable, ProgressBar, RadioGroup, Row, SafeAreaView, ScrollView, SegmentedControl, Show, Skeleton, Spacer, Stack, Stepper, Switch, Tabs, Text, TextInput, Toast, VERSION, View, animateTo, connectWebEnvironment, duration, easing, flattenStyle, fontSize, fontWeight, getEnvironment, getTheme, info, lineHeight, maturity, motion, name, notImplemented, palette, radius, resolveStyle, setEnvironment, space, toA11yProps, toHostProps, tokens, useAsync, useColorScheme, useCounter, useDebounce, useForm, useInterval, useKeyboard, usePersistentSignal, usePressable, usePrevious, useReducedMotion, useReducer, useSafeAreaInsets, useTheme, useTimeout, useToggle, useWindowDimensions };
|
|
35
36
|
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/atlas` (Atlas) — accessible, signals-native UI primitives. Function components\n * over `@mindees/core`'s `createElement` that return renderer-agnostic `MindeesNode` trees:\n * web rendering is real via the Helix DOM backend; native is a labeled 🔬 research track (the\n * same serializable tree, interpreted by a native host later). A curated cross-platform\n * `StyleObject`, typed accessibility, and design-token theming (`useTheme`/`tokens`, on the main entry).\n * The virtualized recycling `List` is on the `@mindees/atlas/list` subpath.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** The npm package name. */\nexport const name = '@mindees/atlas'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/atlas` (Atlas) — accessible, signals-native UI primitives. Function components\n * over `@mindees/core`'s `createElement` that return renderer-agnostic `MindeesNode` trees:\n * web rendering is real via the Helix DOM backend; native is a labeled 🔬 research track (the\n * same serializable tree, interpreted by a native host later). A curated cross-platform\n * `StyleObject`, typed accessibility, and design-token theming (`useTheme`/`tokens`, on the main entry).\n * The virtualized recycling `List` is on the `@mindees/atlas/list` subpath.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** The npm package name. */\nexport const name = '@mindees/atlas'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.27.0'\n\n/** Current maturity of this package. See the repository `STATUS.md`. */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n\nexport { type A11yProps, type A11yState, type Role, toA11yProps } from './a11y'\nexport {\n Accordion,\n type AccordionProps,\n type AccordionSection,\n ActivityIndicator,\n type ActivityIndicatorProps,\n Avatar,\n type AvatarProps,\n Badge,\n type BadgeProps,\n Card,\n type CardProps,\n Checkbox,\n type CheckboxProps,\n Chip,\n type ChipProps,\n Divider,\n type DividerProps,\n KeyboardAvoidingView,\n type KeyboardAvoidingViewProps,\n ProgressBar,\n type ProgressBarProps,\n RadioGroup,\n type RadioGroupProps,\n type RadioOption,\n SafeAreaView,\n type SafeAreaViewProps,\n type Segment,\n SegmentedControl,\n type SegmentedControlProps,\n Skeleton,\n type SkeletonProps,\n Stepper,\n type StepperProps,\n Switch,\n type SwitchProps,\n type TabItem,\n Tabs,\n type TabsProps,\n} from './components'\nexport {\n type ColorScheme,\n getEnvironment,\n type KeyboardState,\n type PlatformEnvironment,\n type SafeAreaInsets,\n setEnvironment,\n useColorScheme,\n useKeyboard,\n useReducedMotion,\n useSafeAreaInsets,\n useWindowDimensions,\n type WindowDimensions,\n} from './environment'\nexport { ErrorBoundary, type ErrorBoundaryProps } from './error-boundary'\nexport { type Field, type FormApi, type UseFormOptions, useForm } from './form'\nexport { type AttachableGesture, GestureView, type GestureViewProps } from './gesture'\nexport {\n type AsyncState,\n type Counter,\n type PersistentSignalOptions,\n type SignalStorage,\n type Toggle,\n useAsync,\n useCounter,\n useDebounce,\n useInterval,\n usePersistentSignal,\n usePrevious,\n useReducer,\n useTimeout,\n useToggle,\n} from './hooks'\nexport { type BaseProps, type Reactive, resolveStyle, toHostProps } from './host'\nexport { animateTo, motion } from './motion'\nexport {\n FocusScope,\n type FocusScopeProps,\n Modal,\n type ModalProps,\n Toast,\n type ToastProps,\n} from './overlay'\nexport {\n Button,\n type ButtonProps,\n Column,\n Image,\n type ImageProps,\n type InteractionState,\n Pressable,\n type PressableProps,\n Row,\n ScrollView,\n type ScrollViewProps,\n Spacer,\n type SpacerProps,\n Stack,\n type StackProps,\n Text,\n TextInput,\n type TextInputProps,\n type TextProps,\n usePressable,\n View,\n type ViewProps,\n} from './primitives'\nexport { Show, type ShowProps } from './show'\nexport { flattenStyle, type StyleInput, type StyleObject, type StyleValue } from './style'\nexport {\n duration,\n easing,\n fontSize,\n fontWeight,\n getTheme,\n lineHeight,\n palette,\n radius,\n space,\n type Theme,\n type ThemeColors,\n tokens,\n useTheme,\n} from './tokens'\nexport { connectWebEnvironment, type WebEnvWindow } from './web-environment'\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;;;;;;;;;;;AAeA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;AAGvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
|
package/dist/primitives.d.ts
CHANGED
|
@@ -18,18 +18,57 @@ interface ImageProps extends BaseProps {
|
|
|
18
18
|
readonly src: string;
|
|
19
19
|
/** Mark purely-decorative images so screen readers skip them (alt="" + aria-hidden). */
|
|
20
20
|
readonly decorative?: boolean;
|
|
21
|
+
/** How the image fills its box (→ CSS `object-fit`). */
|
|
22
|
+
readonly resizeMode?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
23
|
+
/** Native lazy-loading (→ `loading`). */
|
|
24
|
+
readonly loading?: 'lazy' | 'eager';
|
|
25
|
+
/** Decode hint (→ `decoding`). */
|
|
26
|
+
readonly decoding?: 'async' | 'sync' | 'auto';
|
|
27
|
+
/** Fetch-priority hint (→ `fetchpriority`). */
|
|
28
|
+
readonly fetchPriority?: 'high' | 'low' | 'auto';
|
|
29
|
+
/** Intrinsic width/height (px) — reserve layout space to avoid reflow on load. */
|
|
30
|
+
readonly width?: number;
|
|
31
|
+
readonly height?: number;
|
|
32
|
+
/** Swapped in if `src` fails to load (sets the element's `src` on the `error` event). */
|
|
33
|
+
readonly fallbackSrc?: string;
|
|
34
|
+
/** Fires when the image finishes loading. */
|
|
35
|
+
readonly onLoad?: () => void;
|
|
36
|
+
/** Fires when the image fails to load (after any `fallbackSrc` swap). */
|
|
37
|
+
readonly onError?: () => void;
|
|
21
38
|
}
|
|
22
39
|
declare const Image: Component<ImageProps>;
|
|
23
|
-
/** A text field (→ `textinput`/`input`). `value` may be reactive
|
|
40
|
+
/** A text field (→ `textinput`/`input`, or `textarea` when `multiline`). `value` may be reactive. */
|
|
24
41
|
interface TextInputProps extends BaseProps {
|
|
25
42
|
readonly value?: Reactive<string>;
|
|
26
43
|
readonly placeholder?: string;
|
|
27
44
|
readonly type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url';
|
|
28
45
|
readonly disabled?: boolean;
|
|
46
|
+
/** Render a multi-line field (→ `textarea`). */
|
|
47
|
+
readonly multiline?: boolean;
|
|
48
|
+
/** Visible rows when `multiline` (→ textarea `rows`). */
|
|
49
|
+
readonly rows?: number;
|
|
50
|
+
/** Mask the input (→ `type="password"`); overrides `type`. */
|
|
51
|
+
readonly secureTextEntry?: boolean;
|
|
52
|
+
/** On-screen keyboard hint (→ `inputmode`). */
|
|
53
|
+
readonly keyboardType?: 'default' | 'numeric' | 'decimal' | 'email' | 'tel' | 'url' | 'search';
|
|
54
|
+
/** Enter-key label hint (→ `enterkeyhint`). */
|
|
55
|
+
readonly returnKeyType?: 'enter' | 'done' | 'go' | 'next' | 'search' | 'send';
|
|
56
|
+
/** Auto-capitalization (→ `autocapitalize`). */
|
|
57
|
+
readonly autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
|
|
58
|
+
/** Autofill hint (→ `autocomplete`, e.g. `"email"`, `"current-password"`). */
|
|
59
|
+
readonly autoComplete?: string;
|
|
60
|
+
/** Maximum length (→ `maxlength`). */
|
|
61
|
+
readonly maxLength?: number;
|
|
62
|
+
/** Focus on mount (→ `autofocus`). */
|
|
63
|
+
readonly autoFocus?: boolean;
|
|
29
64
|
/** Fires on every keystroke with the current value (`input` event). */
|
|
30
65
|
readonly onInput?: (value: string) => void;
|
|
31
66
|
/** Fires on commit/blur with the current value (`change` event). */
|
|
32
67
|
readonly onChange?: (value: string) => void;
|
|
68
|
+
readonly onFocus?: () => void;
|
|
69
|
+
readonly onBlur?: () => void;
|
|
70
|
+
/** Fires when the user presses Enter (single-line submit). */
|
|
71
|
+
readonly onSubmitEditing?: (value: string) => void;
|
|
33
72
|
}
|
|
34
73
|
declare const TextInput: Component<TextInputProps>;
|
|
35
74
|
/** Interaction state exposed to a Pressable style function. */
|
package/dist/primitives.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","names":[],"sources":["../src/primitives.ts"],"mappings":";;;;;;UA+CiB,SAAA,SAAkB,SAAS;EAAA,SACjC,QAAA,GAAW,WAAA;AAAA;AAAA,cAET,IAAA,EAAM,SAAS,CAAC,SAAA;;UAIZ,SAAA,SAAkB,SAAS;EAAA,SACjC,QAAA,GAAW,WAAA;AAAA;AAAA,cAET,IAAA,EAAM,SAAS,CAAC,SAAA;;
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","names":[],"sources":["../src/primitives.ts"],"mappings":";;;;;;UA+Ci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A;;WAEA,KAAA,GAAQ,QAAA,CAAS,UAAA,MAAgB,KAAA,EAAO,gBAAA,KAAqB,UAAA;AAAA;;;;AAVtD;AAIlB;iBAcgB,YAAA,CAAa,OAAA;EAAW,OAAA;EAAsB,QAAA;AAAA;EAC5D,KAAA,QAAa,gBAAA;EACb,QAAA,EAAU,MAAM,UAAU,KAAA;AAAA;AAAA,cAgDf,SAAA,EAAW,SAAS,CAAC,cAAA;;UA2BjB,WAAA,SAAoB,cAAc;EA3FP;EAAA,SA6FjC,KAAK;AAAA;AAAA,cAEH,MAAA,EAAQ,SAAS,CAAC,WAAA;AAAA,KAe1B,SAAA;AAAA,KACA,WAAA;;UASY,UAAA,SAAmB,SAAA;EAAA,SACzB,SAAA;EAAA,SACA,GAAA;EAAA,SACA,KAAA,GAAQ,SAAA;EAAA,SACR,OAAA,GAAU,WAAA;AAAA;AAAA,cAER,KAAA,EAAO,SAAS,CAAC,UAAA;AAxHoD;AAAA,cAqIrE,GAAA,EAAK,SAAA,CAAU,IAAA,CAAK,UAAA;;cAIpB,MAAA,EAAQ,SAAA,CAAU,IAAA,CAAK,UAAA;;UAInB,WAAA;EArI6C;EAAA,SAuInD,IAAI;AAAA;AAAA,cAEF,MAAA,EAAQ,SAAS,CAAC,WAAA;;UAMd,eAAA,SAAwB,SAAS;EAAA,SACvC,UAAA;EA9I+B;EAAA,SAgJ/B,QAAA,IAAY,KAAA;AAAA;AAAA,cAEV,UAAA,EAAY,SAAS,CAAC,eAAA"}
|
package/dist/primitives.js
CHANGED
|
@@ -30,9 +30,37 @@ function eventValue(event) {
|
|
|
30
30
|
}
|
|
31
31
|
const View = (props) => createElement("view", toHostProps(props), props.children);
|
|
32
32
|
const Text = (props) => createElement("text", toHostProps(props), props.children);
|
|
33
|
+
/** Merge extra style keys into a host prop bag, preserving a reactive (accessor) style. */
|
|
34
|
+
function mergeHostStyle(host, extra) {
|
|
35
|
+
const cur = host.style;
|
|
36
|
+
if (cur === void 0) host.style = extra;
|
|
37
|
+
else if (typeof cur === "function") {
|
|
38
|
+
const acc = cur;
|
|
39
|
+
host.style = () => ({
|
|
40
|
+
...acc(),
|
|
41
|
+
...extra
|
|
42
|
+
});
|
|
43
|
+
} else host.style = {
|
|
44
|
+
...cur,
|
|
45
|
+
...extra
|
|
46
|
+
};
|
|
47
|
+
}
|
|
33
48
|
const Image = (props) => {
|
|
34
49
|
const host = toHostProps(props);
|
|
35
50
|
host.src = props.src;
|
|
51
|
+
if (props.resizeMode) mergeHostStyle(host, { objectFit: props.resizeMode });
|
|
52
|
+
if (props.loading) host.loading = props.loading;
|
|
53
|
+
if (props.decoding) host.decoding = props.decoding;
|
|
54
|
+
if (props.fetchPriority) host.fetchpriority = props.fetchPriority;
|
|
55
|
+
if (props.width !== void 0) host.width = props.width;
|
|
56
|
+
if (props.height !== void 0) host.height = props.height;
|
|
57
|
+
if (props.onLoad) host.onLoad = () => props.onLoad?.();
|
|
58
|
+
const fallback = props.fallbackSrc;
|
|
59
|
+
if (fallback !== void 0 || props.onError) host.onError = (e) => {
|
|
60
|
+
const target = e?.target;
|
|
61
|
+
if (fallback !== void 0 && target && target.src !== fallback) target.src = fallback;
|
|
62
|
+
props.onError?.();
|
|
63
|
+
};
|
|
36
64
|
if (props.decorative) {
|
|
37
65
|
host.alt = "";
|
|
38
66
|
host["aria-hidden"] = "true";
|
|
@@ -44,15 +72,41 @@ const Image = (props) => {
|
|
|
44
72
|
}
|
|
45
73
|
return createElement("image", host);
|
|
46
74
|
};
|
|
75
|
+
/** Map a logical keyboard type to the HTML `inputmode` attribute. */
|
|
76
|
+
const KEYBOARD_INPUTMODE = {
|
|
77
|
+
default: "text",
|
|
78
|
+
numeric: "numeric",
|
|
79
|
+
decimal: "decimal",
|
|
80
|
+
email: "email",
|
|
81
|
+
tel: "tel",
|
|
82
|
+
url: "url",
|
|
83
|
+
search: "search"
|
|
84
|
+
};
|
|
47
85
|
const TextInput = (props) => {
|
|
48
86
|
const host = toHostProps(props);
|
|
49
87
|
if (!host.role) host.role = "textbox";
|
|
50
88
|
if (props.value !== void 0) host.value = props.value;
|
|
51
89
|
if (props.placeholder !== void 0) host.placeholder = props.placeholder;
|
|
52
|
-
|
|
90
|
+
const type = props.secureTextEntry ? "password" : props.type;
|
|
91
|
+
if (type !== void 0) host.type = type;
|
|
53
92
|
if (props.disabled) host.disabled = true;
|
|
93
|
+
if (props.keyboardType) host.inputmode = KEYBOARD_INPUTMODE[props.keyboardType];
|
|
94
|
+
if (props.returnKeyType) host.enterkeyhint = props.returnKeyType;
|
|
95
|
+
if (props.autoCapitalize) host.autocapitalize = props.autoCapitalize;
|
|
96
|
+
if (props.autoComplete !== void 0) host.autocomplete = props.autoComplete;
|
|
97
|
+
if (props.maxLength !== void 0) host.maxlength = props.maxLength;
|
|
98
|
+
if (props.autoFocus) host.autofocus = true;
|
|
54
99
|
if (props.onInput) host.onInput = (e) => props.onInput?.(eventValue(e));
|
|
55
100
|
if (props.onChange) host.onChange = (e) => props.onChange?.(eventValue(e));
|
|
101
|
+
if (props.onFocus) host.onFocus = () => props.onFocus?.();
|
|
102
|
+
if (props.onBlur) host.onBlur = () => props.onBlur?.();
|
|
103
|
+
if (props.onSubmitEditing) host.onKeyDown = (e) => {
|
|
104
|
+
if (e?.key === "Enter") props.onSubmitEditing?.(eventValue(e));
|
|
105
|
+
};
|
|
106
|
+
if (props.multiline) {
|
|
107
|
+
if (props.rows !== void 0) host.rows = props.rows;
|
|
108
|
+
return createElement("textarea", host);
|
|
109
|
+
}
|
|
56
110
|
return createElement("textinput", host);
|
|
57
111
|
};
|
|
58
112
|
/**
|
package/dist/primitives.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","names":[],"sources":["../src/primitives.ts"],"sourcesContent":["/**\n * Atlas primitives — accessible, signals-native UI building blocks. Each is a\n * `Component<P>` over `@mindees/core`'s `createElement`, returning a renderer-agnostic\n * `MindeesNode`. Web rendering is real (via the Helix DOM backend); native is a labeled 🔬\n * research track (the same serializable tree, interpreted by a native host later). See\n * `docs/adr/0022-atlas-primitives.md`.\n *\n * @module\n */\n\nimport {\n type Accessor,\n type Component,\n createElement,\n type MindeesNode,\n signal,\n} from '@mindees/core'\nimport { type BaseProps, type Reactive, resolveStyle, toHostProps } from './host'\nimport { flattenStyle, type StyleInput } from './style'\n\n/** Merge a base layout style with a caller's (possibly reactive) style, staying reactive if it is. */\nfunction withBaseStyle(\n base: StyleInput,\n style: Reactive<StyleInput> | undefined,\n): Reactive<StyleInput> {\n if (typeof style === 'function') {\n const accessor = style as Accessor<StyleInput>\n return () => flattenStyle([base, accessor()])\n }\n return flattenStyle([base, style])\n}\n\n/** Dev-only warning (silent in production). Structural global access — no DOM/Node lib needed. */\nfunction warnDev(message: string): void {\n const g = globalThis as {\n process?: { env?: Record<string, string | undefined> }\n console?: { warn?: (message: string) => void }\n }\n if (g.process?.env?.NODE_ENV === 'production') return\n g.console?.warn?.(`[atlas] ${message}`)\n}\n\nfunction eventValue(event: unknown): string {\n return (event as { target?: { value?: string } })?.target?.value ?? ''\n}\n\n/** A generic container (→ `view`/`div`). */\nexport interface ViewProps extends BaseProps {\n readonly children?: MindeesNode\n}\nexport const View: Component<ViewProps> = (props) =>\n createElement('view', toHostProps(props), props.children)\n\n/** Text content (→ `text`/`span`). No default `role` (a bare span is correct; pass `role` to opt in). */\nexport interface TextProps extends BaseProps {\n readonly children?: MindeesNode\n}\nexport const Text: Component<TextProps> = (props) =>\n createElement('text', toHostProps(props), props.children)\n\n/** An image (→ `image`/`img`). Requires `label` (alt) unless `decorative`. */\nexport interface ImageProps extends BaseProps {\n readonly src: string\n /** Mark purely-decorative images so screen readers skip them (alt=\"\" + aria-hidden). */\n readonly decorative?: boolean\n}\nexport const Image: Component<ImageProps> = (props) => {\n const host = toHostProps(props)\n host.src = props.src\n if (props.decorative) {\n host.alt = ''\n host['aria-hidden'] = 'true'\n // A decorative image must expose NO accessible name; drop any label lowered by\n // toHostProps so we don't emit a contradictory aria-label on a hidden element.\n delete host['aria-label']\n delete host['aria-labelledby']\n } else {\n if (props.label === undefined) {\n warnDev('Image without a `label` (alt text); pass `label` or set `decorative`.')\n }\n host.alt = props.label ?? ''\n }\n return createElement('image', host)\n}\n\n/** A text field (→ `textinput`/`input`). `value` may be reactive (controlled). */\nexport interface TextInputProps extends BaseProps {\n readonly value?: Reactive<string>\n readonly placeholder?: string\n readonly type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url'\n readonly disabled?: boolean\n /** Fires on every keystroke with the current value (`input` event). */\n readonly onInput?: (value: string) => void\n /** Fires on commit/blur with the current value (`change` event). */\n readonly onChange?: (value: string) => void\n}\nexport const TextInput: Component<TextInputProps> = (props) => {\n const host = toHostProps(props)\n if (!host.role) host.role = 'textbox'\n if (props.value !== undefined) host.value = props.value\n if (props.placeholder !== undefined) host.placeholder = props.placeholder\n if (props.type !== undefined) host.type = props.type\n if (props.disabled) host.disabled = true\n if (props.onInput) host.onInput = (e: unknown) => props.onInput?.(eventValue(e))\n if (props.onChange) host.onChange = (e: unknown) => props.onChange?.(eventValue(e))\n return createElement('textinput', host)\n}\n\n/** Interaction state exposed to a Pressable style function. */\nexport interface InteractionState {\n readonly hovered: boolean\n readonly pressed: boolean\n readonly focused: boolean\n}\n\n/** A pressable surface with built-in hover/press/focus state. Web-real via DOM events. */\nexport interface PressableProps extends Omit<BaseProps, 'style'> {\n readonly children?: MindeesNode\n /** Called when activated (click / Enter / Space) — skipped while `disabled`. */\n readonly onPress?: () => void\n readonly disabled?: boolean\n /** Static/reactive style, or a function of the live interaction state. */\n readonly style?: Reactive<StyleInput> | ((state: InteractionState) => StyleInput)\n}\n\n/**\n * Create the interaction signals + host handlers a pressable surface needs. Reusable so other\n * primitives can compose interaction state. Web wires REAL DOM events (`click`, `pointer*`,\n * `focus`/`blur`, `keydown`) — never a fake cross-platform `press` event that no-ops on web.\n */\nexport function usePressable(options: { onPress?: () => void; disabled?: boolean } = {}): {\n state: () => InteractionState\n handlers: Record<string, (event: unknown) => void>\n} {\n const hovered = signal(false)\n const pressed = signal(false)\n const focused = signal(false)\n const enabled = (): boolean => !options.disabled\n const fire = (): void => {\n if (enabled()) options.onPress?.()\n }\n // A disabled control is inert: its interaction signals don't update, so a state-driven style\n // shows no hover/press/focus feedback (and `fire` blocks onPress / keyboard activation).\n const handlers: Record<string, (event: unknown) => void> = {\n onClick: () => fire(),\n onPointerEnter: () => {\n if (enabled()) hovered.set(true)\n },\n onPointerLeave: () => {\n if (enabled()) {\n hovered.set(false)\n pressed.set(false)\n }\n },\n onPointerDown: () => {\n if (enabled()) pressed.set(true)\n },\n onPointerUp: () => {\n if (enabled()) pressed.set(false)\n },\n onFocus: () => {\n if (enabled()) focused.set(true)\n },\n onBlur: () => {\n if (enabled()) focused.set(false)\n },\n onKeyDown: (e: unknown) => {\n const ev = e as { key?: string; preventDefault?: () => void }\n if (ev.key === 'Enter' || ev.key === ' ') {\n ev.preventDefault?.() // stop Space from page-scrolling a div[role=button]\n fire()\n }\n },\n }\n return {\n state: () => ({ hovered: hovered(), pressed: pressed(), focused: focused() }),\n handlers,\n }\n}\n\nexport const Pressable: Component<PressableProps> = (props) => {\n const { state, handlers } = usePressable({\n ...(props.onPress ? { onPress: props.onPress } : {}),\n ...(props.disabled ? { disabled: true } : {}),\n })\n // Base host props WITHOUT style (Pressable resolves style itself, supporting a state fn).\n const { style, ...rest } = props\n const host: Record<string, unknown> = { ...toHostProps(rest), ...handlers }\n if (!host.role) host.role = 'button'\n if (props.disabled) host['aria-disabled'] = 'true'\n else host.tabindex = 0\n if (style !== undefined) {\n // Distinguish a state-fn `(state) => StyleInput` from a plain reactive style accessor\n // `() => StyleInput` by ARITY: both are functions, but only the state-fn declares a\n // parameter. Treating every function as a state-fn would subscribe an ordinary\n // reactive style to hover/press/focus, re-running it on every interaction.\n const isStateFn = typeof style === 'function' && style.length >= 1\n host.style = isStateFn\n ? () => flattenStyle((style as (s: InteractionState) => StyleInput)(state()))\n : // Arity ruled the state-fn out, so the remainder is a plain `Reactive<StyleInput>`.\n // TS can't narrow on `.length`, so assert it (mirrors the state-fn cast above).\n resolveStyle(style as Reactive<StyleInput>)\n }\n return createElement('view', host, props.children)\n}\n\n/** A labelled button = {@link Pressable} wrapping a {@link Text}. */\nexport interface ButtonProps extends PressableProps {\n /** Convenience text label (alternative to `children`). */\n readonly title?: string\n}\nexport const Button: Component<ButtonProps> = (props) => {\n const { title, children, ...rest } = props\n // The renderer always passes `children` as an array (`[]` when empty), so `??` wouldn't\n // trigger the title fallback — treat an empty array as \"no children\".\n const hasChildren = Array.isArray(children) ? children.length > 0 : children != null\n const content = hasChildren\n ? children\n : title !== undefined\n ? createElement(Text, null, title)\n : null\n return createElement(Pressable, rest, content)\n}\n\n// --- Layout composition (pure View + style, no new host concepts) ---\n\ntype FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'\ntype FlexJustify =\n | 'flex-start'\n | 'flex-end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly'\n\n/** A flex container. `direction` defaults to `column`. */\nexport interface StackProps extends ViewProps {\n readonly direction?: 'row' | 'column'\n readonly gap?: number | string\n readonly align?: FlexAlign\n readonly justify?: FlexJustify\n}\nexport const Stack: Component<StackProps> = (props) => {\n const { direction = 'column', gap, align, justify, style, children, ...rest } = props\n const layout: StyleInput = {\n display: 'flex',\n flexDirection: direction,\n ...(gap !== undefined ? { gap } : {}),\n ...(align !== undefined ? { alignItems: align } : {}),\n ...(justify !== undefined ? { justifyContent: justify } : {}),\n }\n return createElement(View, { ...rest, style: withBaseStyle(layout, style) }, children)\n}\n\n/** A horizontal {@link Stack}. */\nexport const Row: Component<Omit<StackProps, 'direction'>> = (props) =>\n createElement(Stack, { ...props, direction: 'row' }, props.children)\n\n/** A vertical {@link Stack}. */\nexport const Column: Component<Omit<StackProps, 'direction'>> = (props) =>\n createElement(Stack, { ...props, direction: 'column' }, props.children)\n\n/** Flexible (or fixed) empty space. */\nexport interface SpacerProps {\n /** Fixed size (px) instead of flexible fill. */\n readonly size?: number | string\n}\nexport const Spacer: Component<SpacerProps> = (props) =>\n createElement(View, {\n style: props.size !== undefined ? { width: props.size, height: props.size } : { flex: 1 },\n })\n\n/** A scrollable container (→ `scrollview`/`div` with `overflow:auto`). */\nexport interface ScrollViewProps extends ViewProps {\n readonly horizontal?: boolean\n /** Fires on scroll with the host scroll event. */\n readonly onScroll?: (event: unknown) => void\n}\nexport const ScrollView: Component<ScrollViewProps> = (props) => {\n const { horizontal, onScroll, style, children, ...rest } = props\n // A horizontal scroller lays its children out in a row and scrolls along x; a vertical\n // one stacks and scrolls along y. Drive real layout through the curated cross-platform\n // style subset (flexDirection + overflow), not an inert `data-orientation` attribute that\n // no backend reads.\n const host = toHostProps({\n ...rest,\n style: withBaseStyle(\n horizontal\n ? // `display: 'flex'` is required for `flexDirection`/`flexWrap` to take effect —\n // without it the row layout is inert (the element keeps the default block flow).\n { display: 'flex', overflow: 'auto', flexDirection: 'row', flexWrap: 'nowrap' }\n : { overflow: 'auto' },\n style,\n ),\n })\n if (onScroll) host.onScroll = onScroll\n if (horizontal) host['data-orientation'] = 'horizontal' // extra hint for native hosts\n // Orientation is fixed at creation, so emit a distinct tag a native host can branch on in\n // makeElement (a vertical ScrollView and a HorizontalScrollView are different widgets). Web\n // maps both to <div> and derives orientation from the style above.\n return createElement(horizontal ? 'horizontalscrollview' : 'scrollview', host, children)\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,SAAS,cACP,MACA,OACsB;CACtB,IAAI,OAAO,UAAU,YAAY;EAC/B,MAAM,WAAW;EACjB,aAAa,aAAa,CAAC,MAAM,SAAS,CAAC,CAAC;CAC9C;CACA,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC;AACnC;;AAGA,SAAS,QAAQ,SAAuB;CACtC,MAAM,IAAI;CAIV,IAAI,EAAE,SAAS,KAAK,aAAa,cAAc;CAC/C,EAAE,SAAS,OAAO,WAAW,SAAS;AACxC;AAEA,SAAS,WAA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CACD,IAAI,UAAU,KAAK,WAAW;CAC9B,IAAI,YAAY,KAAK,sBAAsB;CAI3C,OAAO,cAAc,aAAa,yBAAyB,cAAc,MAAM,QAAQ;AACzF"}
|
|
1
|
+
{"version":3,"file":"primitives.js","names":[],"sources":["../src/primitives.ts"],"sourcesContent":["/**\n * Atlas primitives — accessible, signals-native UI building blocks. Each is a\n * `Component<P>` over `@mindees/core`'s `createElement`, returning a renderer-agnostic\n * `MindeesNode`. Web rendering is real (via the Helix DOM backend); native is a labeled 🔬\n * research track (the same serializable tree, interpreted by a native host later). See\n * `docs/adr/0022-atlas-primitives.md`.\n *\n * @module\n */\n\nimport {\n type Accessor,\n type Component,\n createElement,\n type MindeesNode,\n signal,\n} from '@mindees/core'\nimport { type BaseProps, type Reactive, resolveStyle, toHostProps } from './host'\nimport { flattenStyle, type StyleInput } from './style'\n\n/** Merge a base layout style with a caller's (possibly reactive) style, staying reactive if it is. */\nfunction withBaseStyle(\n base: StyleInput,\n style: Reactive<StyleInput> | undefined,\n): Reactive<StyleInput> {\n if (typeof style === 'function') {\n const accessor = style as Accessor<StyleInput>\n return () => flattenStyle([base, accessor()])\n }\n return flattenStyle([base, style])\n}\n\n/** Dev-only warning (silent in production). Structural global access — no DOM/Node lib needed. */\nfunction warnDev(message: string): void {\n const g = globalThis as {\n process?: { env?: Record<string, string | undefined> }\n console?: { warn?: (message: string) => void }\n }\n if (g.process?.env?.NODE_ENV === 'production') return\n g.console?.warn?.(`[atlas] ${message}`)\n}\n\nfunction eventValue(event: unknown): string {\n return (event as { target?: { value?: string } })?.target?.value ?? ''\n}\n\n/** A generic container (→ `view`/`div`). */\nexport interface ViewProps extends BaseProps {\n readonly children?: MindeesNode\n}\nexport const View: Component<ViewProps> = (props) =>\n createElement('view', toHostProps(props), props.children)\n\n/** Text content (→ `text`/`span`). No default `role` (a bare span is correct; pass `role` to opt in). */\nexport interface TextProps extends BaseProps {\n readonly children?: MindeesNode\n}\nexport const Text: Component<TextProps> = (props) =>\n createElement('text', toHostProps(props), props.children)\n\n/** Merge extra style keys into a host prop bag, preserving a reactive (accessor) style. */\nfunction mergeHostStyle(host: Record<string, unknown>, extra: Record<string, unknown>): void {\n const cur = host.style\n if (cur === undefined) host.style = extra\n else if (typeof cur === 'function') {\n const acc = cur as () => Record<string, unknown>\n host.style = () => ({ ...acc(), ...extra })\n } else host.style = { ...(cur as Record<string, unknown>), ...extra }\n}\n\n/** An image (→ `image`/`img`). Requires `label` (alt) unless `decorative`. */\nexport interface ImageProps extends BaseProps {\n readonly src: string\n /** Mark purely-decorative images so screen readers skip them (alt=\"\" + aria-hidden). */\n readonly decorative?: boolean\n /** How the image fills its box (→ CSS `object-fit`). */\n readonly resizeMode?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'\n /** Native lazy-loading (→ `loading`). */\n readonly loading?: 'lazy' | 'eager'\n /** Decode hint (→ `decoding`). */\n readonly decoding?: 'async' | 'sync' | 'auto'\n /** Fetch-priority hint (→ `fetchpriority`). */\n readonly fetchPriority?: 'high' | 'low' | 'auto'\n /** Intrinsic width/height (px) — reserve layout space to avoid reflow on load. */\n readonly width?: number\n readonly height?: number\n /** Swapped in if `src` fails to load (sets the element's `src` on the `error` event). */\n readonly fallbackSrc?: string\n /** Fires when the image finishes loading. */\n readonly onLoad?: () => void\n /** Fires when the image fails to load (after any `fallbackSrc` swap). */\n readonly onError?: () => void\n}\nexport const Image: Component<ImageProps> = (props) => {\n const host = toHostProps(props)\n host.src = props.src\n if (props.resizeMode) mergeHostStyle(host, { objectFit: props.resizeMode })\n if (props.loading) host.loading = props.loading\n if (props.decoding) host.decoding = props.decoding\n if (props.fetchPriority) host.fetchpriority = props.fetchPriority\n if (props.width !== undefined) host.width = props.width\n if (props.height !== undefined) host.height = props.height\n if (props.onLoad) host.onLoad = () => props.onLoad?.()\n const fallback = props.fallbackSrc\n if (fallback !== undefined || props.onError) {\n host.onError = (e: unknown): void => {\n const target = (e as { target?: { src?: string } } | null)?.target\n if (fallback !== undefined && target && target.src !== fallback) target.src = fallback\n props.onError?.()\n }\n }\n if (props.decorative) {\n host.alt = ''\n host['aria-hidden'] = 'true'\n // A decorative image must expose NO accessible name; drop any label lowered by\n // toHostProps so we don't emit a contradictory aria-label on a hidden element.\n delete host['aria-label']\n delete host['aria-labelledby']\n } else {\n if (props.label === undefined) {\n warnDev('Image without a `label` (alt text); pass `label` or set `decorative`.')\n }\n host.alt = props.label ?? ''\n }\n return createElement('image', host)\n}\n\n/** Map a logical keyboard type to the HTML `inputmode` attribute. */\nconst KEYBOARD_INPUTMODE: Record<string, string> = {\n default: 'text',\n numeric: 'numeric',\n decimal: 'decimal',\n email: 'email',\n tel: 'tel',\n url: 'url',\n search: 'search',\n}\n\n/** A text field (→ `textinput`/`input`, or `textarea` when `multiline`). `value` may be reactive. */\nexport interface TextInputProps extends BaseProps {\n readonly value?: Reactive<string>\n readonly placeholder?: string\n readonly type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'tel' | 'url'\n readonly disabled?: boolean\n /** Render a multi-line field (→ `textarea`). */\n readonly multiline?: boolean\n /** Visible rows when `multiline` (→ textarea `rows`). */\n readonly rows?: number\n /** Mask the input (→ `type=\"password\"`); overrides `type`. */\n readonly secureTextEntry?: boolean\n /** On-screen keyboard hint (→ `inputmode`). */\n readonly keyboardType?: 'default' | 'numeric' | 'decimal' | 'email' | 'tel' | 'url' | 'search'\n /** Enter-key label hint (→ `enterkeyhint`). */\n readonly returnKeyType?: 'enter' | 'done' | 'go' | 'next' | 'search' | 'send'\n /** Auto-capitalization (→ `autocapitalize`). */\n readonly autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters'\n /** Autofill hint (→ `autocomplete`, e.g. `\"email\"`, `\"current-password\"`). */\n readonly autoComplete?: string\n /** Maximum length (→ `maxlength`). */\n readonly maxLength?: number\n /** Focus on mount (→ `autofocus`). */\n readonly autoFocus?: boolean\n /** Fires on every keystroke with the current value (`input` event). */\n readonly onInput?: (value: string) => void\n /** Fires on commit/blur with the current value (`change` event). */\n readonly onChange?: (value: string) => void\n readonly onFocus?: () => void\n readonly onBlur?: () => void\n /** Fires when the user presses Enter (single-line submit). */\n readonly onSubmitEditing?: (value: string) => void\n}\nexport const TextInput: Component<TextInputProps> = (props) => {\n const host = toHostProps(props)\n if (!host.role) host.role = 'textbox'\n if (props.value !== undefined) host.value = props.value\n if (props.placeholder !== undefined) host.placeholder = props.placeholder\n const type = props.secureTextEntry ? 'password' : props.type\n if (type !== undefined) host.type = type\n if (props.disabled) host.disabled = true\n if (props.keyboardType) host.inputmode = KEYBOARD_INPUTMODE[props.keyboardType]\n if (props.returnKeyType) host.enterkeyhint = props.returnKeyType\n if (props.autoCapitalize) host.autocapitalize = props.autoCapitalize\n if (props.autoComplete !== undefined) host.autocomplete = props.autoComplete\n if (props.maxLength !== undefined) host.maxlength = props.maxLength\n if (props.autoFocus) host.autofocus = true\n if (props.onInput) host.onInput = (e: unknown) => props.onInput?.(eventValue(e))\n if (props.onChange) host.onChange = (e: unknown) => props.onChange?.(eventValue(e))\n if (props.onFocus) host.onFocus = () => props.onFocus?.()\n if (props.onBlur) host.onBlur = () => props.onBlur?.()\n if (props.onSubmitEditing) {\n host.onKeyDown = (e: unknown): void => {\n if ((e as { key?: string } | null)?.key === 'Enter') props.onSubmitEditing?.(eventValue(e))\n }\n }\n if (props.multiline) {\n if (props.rows !== undefined) host.rows = props.rows\n return createElement('textarea', host) // multi-line → real <textarea>\n }\n return createElement('textinput', host)\n}\n\n/** Interaction state exposed to a Pressable style function. */\nexport interface InteractionState {\n readonly hovered: boolean\n readonly pressed: boolean\n readonly focused: boolean\n}\n\n/** A pressable surface with built-in hover/press/focus state. Web-real via DOM events. */\nexport interface PressableProps extends Omit<BaseProps, 'style'> {\n readonly children?: MindeesNode\n /** Called when activated (click / Enter / Space) — skipped while `disabled`. */\n readonly onPress?: () => void\n readonly disabled?: boolean\n /** Static/reactive style, or a function of the live interaction state. */\n readonly style?: Reactive<StyleInput> | ((state: InteractionState) => StyleInput)\n}\n\n/**\n * Create the interaction signals + host handlers a pressable surface needs. Reusable so other\n * primitives can compose interaction state. Web wires REAL DOM events (`click`, `pointer*`,\n * `focus`/`blur`, `keydown`) — never a fake cross-platform `press` event that no-ops on web.\n */\nexport function usePressable(options: { onPress?: () => void; disabled?: boolean } = {}): {\n state: () => InteractionState\n handlers: Record<string, (event: unknown) => void>\n} {\n const hovered = signal(false)\n const pressed = signal(false)\n const focused = signal(false)\n const enabled = (): boolean => !options.disabled\n const fire = (): void => {\n if (enabled()) options.onPress?.()\n }\n // A disabled control is inert: its interaction signals don't update, so a state-driven style\n // shows no hover/press/focus feedback (and `fire` blocks onPress / keyboard activation).\n const handlers: Record<string, (event: unknown) => void> = {\n onClick: () => fire(),\n onPointerEnter: () => {\n if (enabled()) hovered.set(true)\n },\n onPointerLeave: () => {\n if (enabled()) {\n hovered.set(false)\n pressed.set(false)\n }\n },\n onPointerDown: () => {\n if (enabled()) pressed.set(true)\n },\n onPointerUp: () => {\n if (enabled()) pressed.set(false)\n },\n onFocus: () => {\n if (enabled()) focused.set(true)\n },\n onBlur: () => {\n if (enabled()) focused.set(false)\n },\n onKeyDown: (e: unknown) => {\n const ev = e as { key?: string; preventDefault?: () => void }\n if (ev.key === 'Enter' || ev.key === ' ') {\n ev.preventDefault?.() // stop Space from page-scrolling a div[role=button]\n fire()\n }\n },\n }\n return {\n state: () => ({ hovered: hovered(), pressed: pressed(), focused: focused() }),\n handlers,\n }\n}\n\nexport const Pressable: Component<PressableProps> = (props) => {\n const { state, handlers } = usePressable({\n ...(props.onPress ? { onPress: props.onPress } : {}),\n ...(props.disabled ? { disabled: true } : {}),\n })\n // Base host props WITHOUT style (Pressable resolves style itself, supporting a state fn).\n const { style, ...rest } = props\n const host: Record<string, unknown> = { ...toHostProps(rest), ...handlers }\n if (!host.role) host.role = 'button'\n if (props.disabled) host['aria-disabled'] = 'true'\n else host.tabindex = 0\n if (style !== undefined) {\n // Distinguish a state-fn `(state) => StyleInput` from a plain reactive style accessor\n // `() => StyleInput` by ARITY: both are functions, but only the state-fn declares a\n // parameter. Treating every function as a state-fn would subscribe an ordinary\n // reactive style to hover/press/focus, re-running it on every interaction.\n const isStateFn = typeof style === 'function' && style.length >= 1\n host.style = isStateFn\n ? () => flattenStyle((style as (s: InteractionState) => StyleInput)(state()))\n : // Arity ruled the state-fn out, so the remainder is a plain `Reactive<StyleInput>`.\n // TS can't narrow on `.length`, so assert it (mirrors the state-fn cast above).\n resolveStyle(style as Reactive<StyleInput>)\n }\n return createElement('view', host, props.children)\n}\n\n/** A labelled button = {@link Pressable} wrapping a {@link Text}. */\nexport interface ButtonProps extends PressableProps {\n /** Convenience text label (alternative to `children`). */\n readonly title?: string\n}\nexport const Button: Component<ButtonProps> = (props) => {\n const { title, children, ...rest } = props\n // The renderer always passes `children` as an array (`[]` when empty), so `??` wouldn't\n // trigger the title fallback — treat an empty array as \"no children\".\n const hasChildren = Array.isArray(children) ? children.length > 0 : children != null\n const content = hasChildren\n ? children\n : title !== undefined\n ? createElement(Text, null, title)\n : null\n return createElement(Pressable, rest, content)\n}\n\n// --- Layout composition (pure View + style, no new host concepts) ---\n\ntype FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline'\ntype FlexJustify =\n | 'flex-start'\n | 'flex-end'\n | 'center'\n | 'space-between'\n | 'space-around'\n | 'space-evenly'\n\n/** A flex container. `direction` defaults to `column`. */\nexport interface StackProps extends ViewProps {\n readonly direction?: 'row' | 'column'\n readonly gap?: number | string\n readonly align?: FlexAlign\n readonly justify?: FlexJustify\n}\nexport const Stack: Component<StackProps> = (props) => {\n const { direction = 'column', gap, align, justify, style, children, ...rest } = props\n const layout: StyleInput = {\n display: 'flex',\n flexDirection: direction,\n ...(gap !== undefined ? { gap } : {}),\n ...(align !== undefined ? { alignItems: align } : {}),\n ...(justify !== undefined ? { justifyContent: justify } : {}),\n }\n return createElement(View, { ...rest, style: withBaseStyle(layout, style) }, children)\n}\n\n/** A horizontal {@link Stack}. */\nexport const Row: Component<Omit<StackProps, 'direction'>> = (props) =>\n createElement(Stack, { ...props, direction: 'row' }, props.children)\n\n/** A vertical {@link Stack}. */\nexport const Column: Component<Omit<StackProps, 'direction'>> = (props) =>\n createElement(Stack, { ...props, direction: 'column' }, props.children)\n\n/** Flexible (or fixed) empty space. */\nexport interface SpacerProps {\n /** Fixed size (px) instead of flexible fill. */\n readonly size?: number | string\n}\nexport const Spacer: Component<SpacerProps> = (props) =>\n createElement(View, {\n style: props.size !== undefined ? { width: props.size, height: props.size } : { flex: 1 },\n })\n\n/** A scrollable container (→ `scrollview`/`div` with `overflow:auto`). */\nexport interface ScrollViewProps extends ViewProps {\n readonly horizontal?: boolean\n /** Fires on scroll with the host scroll event. */\n readonly onScroll?: (event: unknown) => void\n}\nexport const ScrollView: Component<ScrollViewProps> = (props) => {\n const { horizontal, onScroll, style, children, ...rest } = props\n // A horizontal scroller lays its children out in a row and scrolls along x; a vertical\n // one stacks and scrolls along y. Drive real layout through the curated cross-platform\n // style subset (flexDirection + overflow), not an inert `data-orientation` attribute that\n // no backend reads.\n const host = toHostProps({\n ...rest,\n style: withBaseStyle(\n horizontal\n ? // `display: 'flex'` is required for `flexDirection`/`flexWrap` to take effect —\n // without it the row layout is inert (the element keeps the default block flow).\n { display: 'flex', overflow: 'auto', flexDirection: 'row', flexWrap: 'nowrap' }\n : { overflow: 'auto' },\n style,\n ),\n })\n if (onScroll) host.onScroll = onScroll\n if (horizontal) host['data-orientation'] = 'horizontal' // extra hint for native hosts\n // Orientation is fixed at creation, so emit a distinct tag a native host can branch on in\n // makeElement (a vertical ScrollView and a HorizontalScrollView are different widgets). Web\n // maps both to <div> and derives orientation from the style above.\n return createElement(horizontal ? 'horizontalscrollview' : 'scrollview', host, children)\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,SAAS,cACP,MACA,OACsB;CACtB,IAAI,OAAO,UAAU,YAAY;EAC/B,MAAM,WAAW;EACjB,aAAa,aAAa,CAAC,MAAM,SAAS,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a,OAAiD,UAC5D,cAAc,OAAO;CAAE,GAAG;CAAO,WAAW;AAAM,GAAG,MAAM,QAAQ;;AAGrE,MAAa,UAAoD,UAC/D,cAAc,OAAO;CAAE,GAAG;CAAO,WAAW;AAAS,GAAG,MAAM,QAAQ;AAOxE,MAAa,UAAkC,UAC7C,cAAc,MAAM,EAClB,OAAO,MAAM,SAAS,KAAA,IAAY;CAAE,OAAO,MAAM;CAAM,QAAQ,MAAM;AAAK,IAAI,EAAE,MAAM,EAAE,EAC1F,CAAC;AAQH,MAAa,cAA0C,UAAU;CAC/D,MAAM,EAAE,YAAY,UAAU,OAAO,UAAU,GAAG,SAAS;CAK3D,MAAM,OAAO,YAAY;EACvB,GAAG;EACH,OAAO,cACL,aAGI;GAAE,SAAS;GAAQ,UAAU;GAAQ,eAAe;GAAO,UAAU;EAAS,IAC9E,EAAE,UAAU,OAAO,GACvB,KACF;CACF,CAAC;CACD,IAAI,UAAU,KAAK,WAAW;CAC9B,IAAI,YAAY,KAAK,sBAAsB;CAI3C,OAAO,cAAc,aAAa,yBAAyB,cAAc,MAAM,QAAQ;AACzF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//#region src/web-environment.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Web adapter for the platform environment.
|
|
4
|
+
*
|
|
5
|
+
* Wires the browser's live signals — color scheme, reduced motion, window size, the soft keyboard (via
|
|
6
|
+
* `visualViewport`), and CSS `env(safe-area-inset-*)` — into {@link setEnvironment}, so the device hooks
|
|
7
|
+
* (`useColorScheme`, `useWindowDimensions`, `useSafeAreaInsets`, `useKeyboard`, `useReducedMotion`) are
|
|
8
|
+
* LIVE on the web target with zero configuration. Without this, those signals keep their inert defaults
|
|
9
|
+
* (0×0, light, no insets, keyboard hidden) on web.
|
|
10
|
+
*
|
|
11
|
+
* SSR-safe: a no-op when there is no DOM. Call once at startup — the `create` template wires it into
|
|
12
|
+
* `main.tsx`. Returns a `disconnect()` that removes every listener and the probe element.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
interface MediaQueryLike {
|
|
17
|
+
readonly matches: boolean;
|
|
18
|
+
addEventListener(type: 'change', listener: () => void): void;
|
|
19
|
+
removeEventListener(type: 'change', listener: () => void): void;
|
|
20
|
+
}
|
|
21
|
+
interface VisualViewportLike {
|
|
22
|
+
readonly height: number;
|
|
23
|
+
readonly offsetTop: number;
|
|
24
|
+
addEventListener(type: string, listener: () => void): void;
|
|
25
|
+
removeEventListener(type: string, listener: () => void): void;
|
|
26
|
+
}
|
|
27
|
+
interface ProbeLike {
|
|
28
|
+
style: {
|
|
29
|
+
cssText: string;
|
|
30
|
+
};
|
|
31
|
+
remove(): void;
|
|
32
|
+
}
|
|
33
|
+
interface DocumentLike {
|
|
34
|
+
body: {
|
|
35
|
+
appendChild(node: ProbeLike): void;
|
|
36
|
+
} | null;
|
|
37
|
+
createElement(tag: string): ProbeLike;
|
|
38
|
+
}
|
|
39
|
+
/** The subset of `Window` the adapter uses. */
|
|
40
|
+
interface WebEnvWindow {
|
|
41
|
+
readonly innerWidth: number;
|
|
42
|
+
readonly innerHeight: number;
|
|
43
|
+
readonly devicePixelRatio?: number;
|
|
44
|
+
readonly visualViewport?: VisualViewportLike | null;
|
|
45
|
+
readonly document?: DocumentLike;
|
|
46
|
+
matchMedia(query: string): MediaQueryLike;
|
|
47
|
+
getComputedStyle?(el: ProbeLike): {
|
|
48
|
+
getPropertyValue(prop: string): string;
|
|
49
|
+
};
|
|
50
|
+
addEventListener(type: string, listener: () => void): void;
|
|
51
|
+
removeEventListener(type: string, listener: () => void): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Connect the browser environment to the reactive device hooks. Pass a `window` (defaults to the global).
|
|
55
|
+
* Returns a `disconnect()`.
|
|
56
|
+
*/
|
|
57
|
+
declare function connectWebEnvironment(win?: WebEnvWindow): () => void;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { WebEnvWindow, connectWebEnvironment };
|
|
60
|
+
//# sourceMappingURL=web-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-environment.d.ts","names":[],"sources":["../src/web-environment.ts"],"mappings":";;;;;;;;;;;;;;AAsB0D;UAHhD,cAAA;EAAA,SACC,OAAA;EACT,gBAAA,CAAiB,IAAA,YAAgB,QAAA;EACjC,mBAAA,CAAoB,IAAA,YAAgB,QAAA;AAAA;AAAA,UAE5B,kBAAA;EAAA,SACC,MAAA;EAAA,SACA,SAAA;EACT,gBAAA,CAAiB,IAAA,UAAc,QAAA;EAC/B,mBAAA,CAAoB,IAAA,UAAc,QAAA;AAAA;AAAA,UAE1B,SAAA;EACR,KAAA;IAAS,OAAA;EAAA;EACT,MAAA;AAAA;AAAA,UAEQ,YAAA;EACR,IAAA;IAAQ,WAAA,CAAY,IAAA,EAAM,SAAA;EAAA;EAC1B,aAAA,CAAc,GAAA,WAAc,SAAS;AAAA;AAJ/B;AAAA,UAOS,YAAA;EAAA,SACN,UAAA;EAAA,SACA,WAAA;EAAA,SACA,gBAAA;EAAA,SACA,cAAA,GAAiB,kBAAA;EAAA,SACjB,QAAA,GAAW,YAAA;EACpB,UAAA,CAAW,KAAA,WAAgB,cAAA;EAC3B,gBAAA,EAAkB,EAAA,EAAI,SAAA;IAAc,gBAAA,CAAiB,IAAA;EAAA;EACrD,gBAAA,CAAiB,IAAA,UAAc,QAAA;EAC/B,mBAAA,CAAoB,IAAA,UAAc,QAAA;AAAA;;;;;iBAUpB,qBAAA,CAAsB,GAAkB,GAAZ,YAAY"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { setEnvironment } from "./environment.js";
|
|
2
|
+
//#region src/web-environment.ts
|
|
3
|
+
/**
|
|
4
|
+
* Web adapter for the platform environment.
|
|
5
|
+
*
|
|
6
|
+
* Wires the browser's live signals — color scheme, reduced motion, window size, the soft keyboard (via
|
|
7
|
+
* `visualViewport`), and CSS `env(safe-area-inset-*)` — into {@link setEnvironment}, so the device hooks
|
|
8
|
+
* (`useColorScheme`, `useWindowDimensions`, `useSafeAreaInsets`, `useKeyboard`, `useReducedMotion`) are
|
|
9
|
+
* LIVE on the web target with zero configuration. Without this, those signals keep their inert defaults
|
|
10
|
+
* (0×0, light, no insets, keyboard hidden) on web.
|
|
11
|
+
*
|
|
12
|
+
* SSR-safe: a no-op when there is no DOM. Call once at startup — the `create` template wires it into
|
|
13
|
+
* `main.tsx`. Returns a `disconnect()` that removes every listener and the probe element.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
const KEYBOARD_THRESHOLD = 80;
|
|
18
|
+
/**
|
|
19
|
+
* Connect the browser environment to the reactive device hooks. Pass a `window` (defaults to the global).
|
|
20
|
+
* Returns a `disconnect()`.
|
|
21
|
+
*/
|
|
22
|
+
function connectWebEnvironment(win) {
|
|
23
|
+
const w = win ?? globalThis.window;
|
|
24
|
+
if (!w || typeof w.matchMedia !== "function") return () => {};
|
|
25
|
+
const cleanups = [];
|
|
26
|
+
const bindMedia = (query, apply) => {
|
|
27
|
+
const mq = w.matchMedia(query);
|
|
28
|
+
const on = () => apply(mq.matches);
|
|
29
|
+
on();
|
|
30
|
+
mq.addEventListener("change", on);
|
|
31
|
+
cleanups.push(() => mq.removeEventListener("change", on));
|
|
32
|
+
};
|
|
33
|
+
bindMedia("(prefers-color-scheme: dark)", (m) => setEnvironment({ colorScheme: m ? "dark" : "light" }));
|
|
34
|
+
bindMedia("(prefers-reduced-motion: reduce)", (m) => setEnvironment({ reducedMotion: m }));
|
|
35
|
+
const readWindow = () => setEnvironment({ window: {
|
|
36
|
+
width: w.innerWidth,
|
|
37
|
+
height: w.innerHeight,
|
|
38
|
+
scale: w.devicePixelRatio ?? 1,
|
|
39
|
+
fontScale: 1
|
|
40
|
+
} });
|
|
41
|
+
const doc = w.document;
|
|
42
|
+
let probe = null;
|
|
43
|
+
if (doc?.body && typeof doc.createElement === "function" && typeof w.getComputedStyle === "function") {
|
|
44
|
+
probe = doc.createElement("div");
|
|
45
|
+
probe.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";
|
|
46
|
+
doc.body.appendChild(probe);
|
|
47
|
+
cleanups.push(() => probe?.remove());
|
|
48
|
+
}
|
|
49
|
+
const readSafeArea = () => {
|
|
50
|
+
if (!probe || typeof w.getComputedStyle !== "function") return;
|
|
51
|
+
const cs = w.getComputedStyle(probe);
|
|
52
|
+
const px = (v) => Number.parseFloat(v) || 0;
|
|
53
|
+
setEnvironment({ safeAreaInsets: {
|
|
54
|
+
top: px(cs.getPropertyValue("padding-top")),
|
|
55
|
+
right: px(cs.getPropertyValue("padding-right")),
|
|
56
|
+
bottom: px(cs.getPropertyValue("padding-bottom")),
|
|
57
|
+
left: px(cs.getPropertyValue("padding-left"))
|
|
58
|
+
} });
|
|
59
|
+
};
|
|
60
|
+
const vv = w.visualViewport;
|
|
61
|
+
const readKeyboard = () => {
|
|
62
|
+
if (!vv) return;
|
|
63
|
+
const h = Math.max(0, w.innerHeight - vv.height - vv.offsetTop);
|
|
64
|
+
const visible = h > KEYBOARD_THRESHOLD;
|
|
65
|
+
setEnvironment({ keyboard: {
|
|
66
|
+
visible,
|
|
67
|
+
height: visible ? h : 0
|
|
68
|
+
} });
|
|
69
|
+
};
|
|
70
|
+
const onResize = () => {
|
|
71
|
+
readWindow();
|
|
72
|
+
readSafeArea();
|
|
73
|
+
readKeyboard();
|
|
74
|
+
};
|
|
75
|
+
onResize();
|
|
76
|
+
w.addEventListener("resize", onResize);
|
|
77
|
+
cleanups.push(() => w.removeEventListener("resize", onResize));
|
|
78
|
+
if (vv) {
|
|
79
|
+
const onViewport = () => {
|
|
80
|
+
readKeyboard();
|
|
81
|
+
readSafeArea();
|
|
82
|
+
};
|
|
83
|
+
vv.addEventListener("resize", onViewport);
|
|
84
|
+
vv.addEventListener("scroll", onViewport);
|
|
85
|
+
cleanups.push(() => {
|
|
86
|
+
vv.removeEventListener("resize", onViewport);
|
|
87
|
+
vv.removeEventListener("scroll", onViewport);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return () => {
|
|
91
|
+
for (const c of cleanups) c();
|
|
92
|
+
cleanups.length = 0;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { connectWebEnvironment };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=web-environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-environment.js","names":[],"sources":["../src/web-environment.ts"],"sourcesContent":["/**\n * Web adapter for the platform environment.\n *\n * Wires the browser's live signals — color scheme, reduced motion, window size, the soft keyboard (via\n * `visualViewport`), and CSS `env(safe-area-inset-*)` — into {@link setEnvironment}, so the device hooks\n * (`useColorScheme`, `useWindowDimensions`, `useSafeAreaInsets`, `useKeyboard`, `useReducedMotion`) are\n * LIVE on the web target with zero configuration. Without this, those signals keep their inert defaults\n * (0×0, light, no insets, keyboard hidden) on web.\n *\n * SSR-safe: a no-op when there is no DOM. Call once at startup — the `create` template wires it into\n * `main.tsx`. Returns a `disconnect()` that removes every listener and the probe element.\n *\n * @module\n */\n\nimport { setEnvironment } from './environment'\n\n// Minimal STRUCTURAL views of the DOM we touch — so this package needs no `lib.dom` in its types and\n// stays platform-neutral. A real `Window` satisfies these shapes.\ninterface MediaQueryLike {\n readonly matches: boolean\n addEventListener(type: 'change', listener: () => void): void\n removeEventListener(type: 'change', listener: () => void): void\n}\ninterface VisualViewportLike {\n readonly height: number\n readonly offsetTop: number\n addEventListener(type: string, listener: () => void): void\n removeEventListener(type: string, listener: () => void): void\n}\ninterface ProbeLike {\n style: { cssText: string }\n remove(): void\n}\ninterface DocumentLike {\n body: { appendChild(node: ProbeLike): void } | null\n createElement(tag: string): ProbeLike\n}\n/** The subset of `Window` the adapter uses. */\nexport interface WebEnvWindow {\n readonly innerWidth: number\n readonly innerHeight: number\n readonly devicePixelRatio?: number\n readonly visualViewport?: VisualViewportLike | null\n readonly document?: DocumentLike\n matchMedia(query: string): MediaQueryLike\n getComputedStyle?(el: ProbeLike): { getPropertyValue(prop: string): string }\n addEventListener(type: string, listener: () => void): void\n removeEventListener(type: string, listener: () => void): void\n}\n\n// Below this the viewport-height delta is browser chrome (URL bar), not a soft keyboard.\nconst KEYBOARD_THRESHOLD = 80\n\n/**\n * Connect the browser environment to the reactive device hooks. Pass a `window` (defaults to the global).\n * Returns a `disconnect()`.\n */\nexport function connectWebEnvironment(win?: WebEnvWindow): () => void {\n const w = win ?? (globalThis as unknown as { window?: WebEnvWindow }).window\n if (!w || typeof w.matchMedia !== 'function') return () => {} // SSR / non-DOM → inert\n\n const cleanups: Array<() => void> = []\n\n const bindMedia = (query: string, apply: (matches: boolean) => void): void => {\n const mq = w.matchMedia(query)\n const on = (): void => apply(mq.matches)\n on()\n mq.addEventListener('change', on)\n cleanups.push(() => mq.removeEventListener('change', on))\n }\n bindMedia('(prefers-color-scheme: dark)', (m) =>\n setEnvironment({ colorScheme: m ? 'dark' : 'light' }),\n )\n bindMedia('(prefers-reduced-motion: reduce)', (m) => setEnvironment({ reducedMotion: m }))\n\n const readWindow = (): void =>\n setEnvironment({\n window: {\n width: w.innerWidth,\n height: w.innerHeight,\n scale: w.devicePixelRatio ?? 1,\n fontScale: 1,\n },\n })\n\n // Safe-area insets: a hidden probe whose padding is `env(safe-area-inset-*)`; read its computed style.\n const doc = w.document\n let probe: ProbeLike | null = null\n if (\n doc?.body &&\n typeof doc.createElement === 'function' &&\n typeof w.getComputedStyle === 'function'\n ) {\n probe = doc.createElement('div')\n probe.style.cssText =\n 'position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)'\n doc.body.appendChild(probe)\n cleanups.push(() => probe?.remove())\n }\n const readSafeArea = (): void => {\n if (!probe || typeof w.getComputedStyle !== 'function') return\n const cs = w.getComputedStyle(probe)\n const px = (v: string): number => Number.parseFloat(v) || 0\n setEnvironment({\n safeAreaInsets: {\n top: px(cs.getPropertyValue('padding-top')),\n right: px(cs.getPropertyValue('padding-right')),\n bottom: px(cs.getPropertyValue('padding-bottom')),\n left: px(cs.getPropertyValue('padding-left')),\n },\n })\n }\n\n const vv = w.visualViewport\n const readKeyboard = (): void => {\n if (!vv) return\n const h = Math.max(0, w.innerHeight - vv.height - vv.offsetTop)\n const visible = h > KEYBOARD_THRESHOLD\n setEnvironment({ keyboard: { visible, height: visible ? h : 0 } })\n }\n\n const onResize = (): void => {\n readWindow()\n readSafeArea()\n readKeyboard()\n }\n onResize() // seed immediately\n w.addEventListener('resize', onResize)\n cleanups.push(() => w.removeEventListener('resize', onResize))\n\n if (vv) {\n const onViewport = (): void => {\n readKeyboard()\n readSafeArea()\n }\n vv.addEventListener('resize', onViewport)\n vv.addEventListener('scroll', onViewport)\n cleanups.push(() => {\n vv.removeEventListener('resize', onViewport)\n vv.removeEventListener('scroll', onViewport)\n })\n }\n\n return () => {\n for (const c of cleanups) c()\n cleanups.length = 0\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,MAAM,qBAAqB;;;;;AAM3B,SAAgB,sBAAsB,KAAgC;CACpE,MAAM,IAAI,OAAQ,WAAoD;CACtE,IAAI,CAAC,KAAK,OAAO,EAAE,eAAe,YAAY,aAAa,CAAC;CAE5D,MAAM,WAA8B,CAAC;CAErC,MAAM,aAAa,OAAe,UAA4C;EAC5E,MAAM,KAAK,EAAE,WAAW,KAAK;EAC7B,MAAM,WAAiB,MAAM,GAAG,OAAO;EACvC,GAAG;EACH,GAAG,iBAAiB,UAAU,EAAE;EAChC,SAAS,WAAW,GAAG,oBAAoB,UAAU,EAAE,CAAC;CAC1D;CACA,UAAU,iCAAiC,MACzC,eAAe,EAAE,aAAa,IAAI,SAAS,QAAQ,CAAC,CACtD;CACA,UAAU,qCAAqC,MAAM,eAAe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B;GAC7B,aAAa;GACb,aAAa;EACf;EACA,GAAG,iBAAiB,UAAU,UAAU;EACxC,GAAG,iBAAiB,UAAU,UAAU;EACxC,SAAS,WAAW;GAClB,GAAG,oBAAoB,UAAU,UAAU;GAC3C,GAAG,oBAAoB,UAAU,UAAU;EAC7C,CAAC;CACH;CAEA,aAAa;EACX,KAAK,MAAM,KAAK,UAAU,EAAE;EAC5B,SAAS,SAAS;CACpB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindees/atlas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "MindeesNative Atlas - accessible, signals-native UI primitives + a virtualized recycling list. Renderer-agnostic (web real, native research track).",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"directory": "packages/atlas"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@mindees/core": "0.
|
|
39
|
-
"@mindees/router": "0.
|
|
38
|
+
"@mindees/core": "0.27.0",
|
|
39
|
+
"@mindees/router": "0.27.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"happy-dom": "20.9.0",
|
|
43
|
-
"@mindees/renderer": "0.
|
|
43
|
+
"@mindees/renderer": "0.27.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsdown",
|