@ng-native/expo 0.2.0 → 0.3.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/README.md +32 -382
- package/dist/async-storage.d.ts +15 -0
- package/dist/async-storage.js +29 -0
- package/dist/async-storage.js.map +1 -0
- package/dist/audio.d.ts +10 -0
- package/dist/audio.js +26 -0
- package/dist/audio.js.map +1 -0
- package/dist/expo-ui-components.d.ts +142 -10
- package/dist/expo-ui-components.js +362 -39
- package/dist/expo-ui-components.js.map +1 -1
- package/dist/expo-ui.js +9 -6
- package/dist/expo-ui.js.map +1 -1
- package/dist/foldable.d.ts +78 -0
- package/dist/foldable.js +87 -0
- package/dist/foldable.js.map +1 -0
- package/dist/fonts.d.ts +3 -0
- package/dist/fonts.js +7 -2
- package/dist/fonts.js.map +1 -1
- package/dist/image-picker.js +3 -9
- package/dist/image-picker.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/live-activity.d.ts +88 -0
- package/dist/live-activity.js +150 -0
- package/dist/live-activity.js.map +1 -0
- package/dist/location.js +2 -7
- package/dist/location.js.map +1 -1
- package/dist/media-library.js +1 -3
- package/dist/media-library.js.map +1 -1
- package/dist/native.d.ts +4 -1
- package/dist/native.js +60 -4
- package/dist/native.js.map +1 -1
- package/dist/notifications.js +2 -4
- package/dist/notifications.js.map +1 -1
- package/dist/permissions.d.ts +2 -0
- package/dist/permissions.js +6 -0
- package/dist/permissions.js.map +1 -1
- package/dist/player.d.ts +24 -11
- package/dist/player.js +7 -26
- package/dist/player.js.map +1 -1
- package/dist/register-expo-view.d.ts +5 -0
- package/dist/register-expo-view.js +5 -1
- package/dist/register-expo-view.js.map +1 -1
- package/dist/screen-capture.js +2 -4
- package/dist/screen-capture.js.map +1 -1
- package/dist/secure-store.d.ts +15 -0
- package/dist/secure-store.js +30 -0
- package/dist/secure-store.js.map +1 -0
- package/dist/store.d.ts +5 -10
- package/dist/store.js +5 -36
- package/dist/store.js.map +1 -1
- package/dist/tracking.d.ts +1 -1
- package/dist/tracking.js +3 -5
- package/dist/tracking.js.map +1 -1
- package/dist/video.d.ts +5 -0
- package/dist/video.js +21 -0
- package/dist/video.js.map +1 -0
- package/dist/watch.d.ts +103 -0
- package/dist/watch.js +228 -0
- package/dist/watch.js.map +1 -0
- package/package.json +49 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-ui-components.js","sourceRoot":"","sources":["../src/expo-ui-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,UAAU,EAGV,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;;AAQlE;;;;;;GAMG;AAWH,MAAM,OAAO,MAAM;IACR,aAAa,GAAG,KAAK;iGAE3B,CAAC;IACe,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5D,CAAC;sFAAC,CAAC;IACgB,eAAe,GAAG,QAAQ,CAAC,GAAG,EAAE;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IAC9D,CAAC;wFAAC,CAAC;IACM,cAAc,GAAG,KAAK;kGAAoC,CAAC;IAC3D,0BAA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a,EAAE,aAAa,EAAE;iBACvC;;AAKD,sEAAsE;AAMtE,MAAM,OAAO,gBAAgB;IAClB,KAAK,GAAG,KAAK;yFAAU,CAAC;IACxB,SAAS,GAAG,KAAK;6FAAyB,CAAC;uGAFzC,gBAAgB;2FAAhB,gBAAgB,gaAHjB,gBAAgB;;2FAGf,gBAAgB;kBAL5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,oBAAoB;oBAC9B,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE;iBAC7D;;AAMD,qDAAqD;AAMrD,MAAM,OAAO,MAAM;IACR,SAAS,GAAG,KAAK;6FAAyB,CAAC;uGADzC,MAAM;2FAAN,MAAM,yQAHP,gBAAgB;;2FAGf,MAAM;kBALlB,SAAS;mBAAC;oBACT,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE;iBACvC;;AAKD,8DAA8D;AAM9D,MAAM,OAAO,SAAS;IACX,KAAK,GAAG,KAAK;yFAAU,CAAC;IACxB,SAAS,GAAG,KAAK;6FAAyB,CAAC;uGAFzC,SAAS;2FAAT,SAAS,wZAHV,gBAAgB;;2FAGf,SAAS;kBALrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE;iBAC7D","sourcesContent":["/**\n * Typed components for the `@expo/ui` SwiftUI views an app reaches for most.\n *\n * `EXPO_UI_VIEWS` makes every view reachable by name, and a name is all the renderer needs. What a\n * name cannot give is a type: under strict templates an unknown element is an error, and so is\n * each prop on it. These are the same elements, claimed by a component whose inputs carry the\n * props' types and whose host bindings pass each one straight to the node, so nothing changes at\n * runtime. An unset input stays `undefined` and never reaches native.\n *\n * Events are declared as outputs so that `$event` is typed, and are never emitted. Angular binds a\n * template's `(dateChange)` to the output *and* to the element, and it is the element's own event\n * that arrives, once. Emitting from a host listener as well would deliver it twice; a host listener\n * of the same name as the output listens to the output itself and recurses. So subscribe in a\n * template, not to the output in code.\n *\n * Only the views and props an app has needed are here; the rest stay names, as before. Add a view\n * when a template wants it typed, from `@expo/ui`'s own props for it.\n *\n * Still register the names with `registerExpoUiViews`: the component types the element, the\n * registration is what makes it commit as the SwiftUI view.\n */\nimport {\n Component,\n DestroyRef,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n} from '@angular/core';\nimport type { NativeState } from './native-state.ts';\nimport {\n HostEngine,\n type HostNode,\n type NativeSyntheticEvent,\n nativePlatform,\n} from '@ng-native/fabric';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\n\n/** One SwiftUI modifier, as `@expo/ui`'s modifier functions build them: `{ $type: 'frame', ... }`. */\nexport interface UiModifier {\n readonly $type: string;\n readonly [key: string]: unknown;\n}\n\n/**\n * The bridge from Yoga's layout to SwiftUI's; every other `ui-*` view goes inside one.\n * `matchContents` sizes the host to the SwiftUI content rather than the other way round, on both\n * axes or on the ones named. Native reads a flag per axis, which is what this splits it into, as\n * `@expo/ui`'s own `Host` does: without them the host has no size of its own, and the control\n * drawn in it spills outside it, where it can be seen but not touched or read by VoiceOver.\n */\n@Component({\n selector: 'ui-host',\n template: '<ng-content />',\n host: {\n '[matchContentsVertical]': 'matchVertical()',\n '[matchContentsHorizontal]': 'matchHorizontal()',\n '[ignoreSafeArea]': 'ignoreSafeArea()',\n '[useViewportSizeMeasurement]': 'useViewportSizeMeasurement()',\n },\n})\nexport class UiHost {\n readonly matchContents = input<\n boolean | { readonly vertical?: boolean; readonly horizontal?: boolean }\n >();\n protected readonly matchVertical = computed(() => {\n const match = this.matchContents();\n return typeof match === 'object' ? match.vertical : match;\n });\n protected readonly matchHorizontal = computed(() => {\n const match = this.matchContents();\n return typeof match === 'object' ? match.horizontal : match;\n });\n readonly ignoreSafeArea = input<'all' | 'keyboard' | 'container'>();\n readonly useViewportSizeMeasurement = input<boolean>(undefined, { transform: optionalBoolean });\n}\n\n/** A SwiftUI `Menu`. Its trigger is the `label` or a `<ui-slot name=\"label\">`; its items are children. */\n@Component({\n selector: 'ui-menu',\n template: '<ng-content />',\n host: {\n '[label]': 'label()',\n '[systemImage]': 'systemImage()',\n '[accessibilityLabel]': 'accessibilityLabel()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiMenu {\n readonly label = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly accessibilityLabel = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Button`, as a menu item or on its own. */\n@Component({\n selector: 'ui-button',\n template: '<ng-content />',\n host: {\n '[label]': 'label()',\n '[systemImage]': 'systemImage()',\n '[role]': 'role()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiButton {\n readonly label = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly role = input<'default' | 'cancel' | 'destructive'>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly buttonPress = output<NativeSyntheticEvent<Record<string, never>>>();\n}\n\n/** A SwiftUI `Divider`: a separator between groups of menu items. */\n@Component({\n selector: 'ui-divider',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiDivider {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * Content for a named slot of its parent view, such as a menu's `label`. `extraProps` is what\n * the slot tells its parent about itself: a `ui-swipe-actions` group's `edge` and\n * `allowsFullSwipe`.\n */\n@Component({\n selector: 'ui-slot',\n template: '<ng-content />',\n host: { '[name]': 'name()', '[extraProps]': 'extraProps()' },\n})\nexport class UiSlot {\n readonly name = input.required<string>();\n readonly extraProps = input<Readonly<Record<string, unknown>>>();\n}\n\n/**\n * A SwiftUI `List`: rows as SwiftUI lays them out, which is what lets a row take the system's own\n * swipe actions through `ui-swipe-actions`.\n */\n@Component({\n selector: 'ui-list',\n template: '<ng-content />',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiList {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * The system's swipe actions on a list row, iOS only. The first child is the row; the actions go\n * in `<ui-slot name=\"actions\" [extraProps]=\"{ edge: 'trailing', allowsFullSwipe: true }\">`, one\n * slot per edge, as `ui-button`s.\n */\n@Component({\n selector: 'ui-swipe-actions',\n template: '<ng-content />',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiSwipeActions {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** What `ui-slider` sends as the thumb moves: its new value. */\nexport type UiSliderChangeEvent = NativeSyntheticEvent<{ readonly value: number }>;\n\n/**\n * A SwiftUI `Slider`, iOS only. `valueChanged` reports each new value as the thumb moves; note the\n * d, which the native event has and `@expo/ui`'s React prop does not.\n */\n@Component({\n selector: 'ui-slider',\n template: '',\n host: {\n '[value]': 'value()',\n '[min]': 'min()',\n '[max]': 'max()',\n '[steps]': 'steps()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiSlider {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly min = input<number>(undefined, { transform: optionalNumber });\n readonly max = input<number>(undefined, { transform: optionalNumber });\n /** How many steps the range is divided into; none moves the thumb continuously. */\n readonly steps = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n readonly valueChanged = output<UiSliderChangeEvent>();\n}\n\n/** A SwiftUI `VStack`. */\n@Component({\n selector: 'ui-vstack',\n template: '<ng-content />',\n host: {\n '[alignment]': 'alignment()',\n '[spacing]': 'spacing()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiVStack {\n readonly alignment = input<'leading' | 'center' | 'trailing'>();\n readonly spacing = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Image`: an SF Symbol by `systemName`, or a picture by `uiImage` URL. */\n@Component({\n selector: 'ui-image',\n template: '',\n host: {\n '[systemName]': 'systemName()',\n '[uiImage]': 'uiImage()',\n '[size]': 'size()',\n '[color]': 'color()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiImage {\n readonly systemName = input<string>();\n readonly uiImage = input<string>();\n readonly size = input<number>(undefined, { transform: optionalNumber });\n readonly color = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Text`. */\n@Component({\n selector: 'ui-text',\n template: '',\n host: { '[text]': 'text()', '[modifiers]': 'modifiers()' },\n})\nexport class UiText {\n readonly text = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * What `ui-date-picker` sends when the user picks: the chosen moment, which SwiftUI reports in\n * milliseconds since the epoch.\n */\nexport type UiDateChangeEvent = NativeSyntheticEvent<{ readonly date: number | string }>;\n\n/**\n * Listen for one of a `ui-*` view's own events from inside its component. Not a host listener:\n * one named as an output listens to the output itself, and see the note at the top of this file\n * for why the outputs are never emitted.\n */\nfunction listen(event: string, handle: (payload: Record<string, unknown>) => void): void {\n const node = inject(ElementRef).nativeElement as HostNode;\n const engine = node.host ?? inject(HostEngine);\n const stop = engine.setEventListener(node, event, (raw) =>\n handle((raw as NativeSyntheticEvent<Record<string, unknown>>)?.nativeEvent ?? {}),\n );\n inject(DestroyRef).onDestroy(stop);\n}\n\n/** The caller's modifiers, with SwiftUI's `disabled` added while the field is. */\nfunction withDisabled(\n modifiers: readonly UiModifier[] | undefined,\n disabled: boolean,\n): readonly UiModifier[] | undefined {\n return disabled ? [...(modifiers ?? []), { $type: 'disabled', disabled: true }] : modifiers;\n}\n\n/**\n * A date picker: SwiftUI's `DatePicker` on iOS, Compose's on Android.\n *\n * A Signal Forms field as it stands - `<ui-date-picker [formField]=\"f.arrival\" />` - through its\n * `value` model, a `Date` (or null). The two platforms take and report a date differently, and\n * this is where that difference ends: SwiftUI is handed `selection` as ISO text and reports\n * `dateChange`; Compose is handed `initialDate` in milliseconds and reports `dateSelected`. Either\n * way the model gets a `Date`. A `disabled` field adds SwiftUI's `disabled` modifier. SwiftUI's\n * picker always shows a date, today when the field is empty, and the date it reports as it appears\n * is not taken as the user's; an optional date is best asked for behind a button that shows the\n * picker once the user wants to give one.\n *\n * `selection` is still accepted as ISO text, for a picker bound without a form.\n */\n@Component({\n selector: 'ui-date-picker',\n template: '',\n host: {\n '[title]': 'title()',\n '[selection]': 'resolvedSelection()',\n '[initialDate]': 'initialDate()',\n '[displayedComponents]': 'displayedComponents()',\n '[range]': 'range()',\n '[accessibilityLabel]': 'accessibilityLabel()',\n '[modifiers]': 'resolvedModifiers()',\n },\n})\nexport class UiDatePicker {\n readonly title = input<string>();\n readonly selection = input<string>();\n readonly displayedComponents = input<readonly ('date' | 'hourAndMinute')[]>();\n readonly range = input<{ readonly start?: string; readonly end?: string }>();\n readonly accessibilityLabel = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n /** The picked date: what `[formField]` binds. */\n readonly value = model<Date | null>(null);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** The user picked, which is when a form shows a field's errors: a picker has no blur. */\n readonly touch = output<void>();\n readonly dateChange = output<UiDateChangeEvent>();\n\n private readonly android = nativePlatform() === 'android';\n\n protected readonly resolvedSelection = computed(() =>\n this.android ? undefined : (this.selection() ?? this.value()?.toISOString()),\n );\n protected readonly initialDate = computed(() =>\n this.android ? (this.value()?.getTime() ?? null) : undefined,\n );\n protected readonly resolvedModifiers = computed(() =>\n this.android ? this.modifiers() : withDisabled(this.modifiers(), this.disabled()),\n );\n\n /**\n * SwiftUI's picker cannot be empty: it shows today, and reports that as a change the moment it\n * appears. Taken as the user's choice, an empty date field would fill itself in, pass\n * `required` and mark the form dirty before anyone touched it. So the first report, while the\n * field is empty and the picker has only just appeared, is the picker describing itself.\n */\n private readonly appeared = Date.now();\n private settled = false;\n\n constructor() {\n listen(this.android ? 'topDateSelected' : 'topDateChange', ({ date }) => {\n if (typeof date !== 'string' && typeof date !== 'number') return;\n const describingItself =\n !this.settled && this.value() === null && Date.now() - this.appeared < APPEARING_MS;\n this.settled = true;\n if (describingItself) return;\n this.value.set(new Date(date));\n this.touch.emit();\n });\n }\n}\n\n/** How long after a date picker appears its first report is taken to be about itself. */\nconst APPEARING_MS = 1000;\n\n/** One choice in a `ui-picker`: what the field is set to, and what the user reads. */\nexport interface UiPickerOption {\n readonly value: string | number;\n readonly label: string;\n}\n\n/**\n * A SwiftUI `Picker`, iOS only, as a Signal Forms field: `<ui-picker [options]=\"rooms\"\n * [formField]=\"f.room\" />`. `options` draws the choices, each tagged with its value, which is the\n * content slot and `tag` modifiers `@expo/ui` otherwise wants written out by hand; children still\n * work for anything richer. `pickerStyle` is SwiftUI's (`menu`, `segmented`, `wheel`, `inline`).\n */\n@Component({\n selector: 'ui-picker',\n imports: [UiSlot, UiText],\n template: `\n @if (options(); as options) {\n <ui-slot name=\"content\">\n @for (option of options; track option.value) {\n <ui-text [text]=\"option.label\" [modifiers]=\"tags().get(option.value)\" />\n }\n </ui-slot>\n }\n <ng-content />\n `,\n host: {\n '[label]': 'label()',\n '[systemImage]': 'systemImage()',\n '[selection]': 'value()',\n '[modifiers]': 'resolvedModifiers()',\n },\n})\nexport class UiPicker {\n readonly label = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly options = input<readonly UiPickerOption[]>();\n readonly pickerStyle = input<\n 'automatic' | 'menu' | 'segmented' | 'wheel' | 'inline' | 'palette'\n >();\n readonly modifiers = input<readonly UiModifier[]>();\n /** The chosen option's value: what `[formField]` binds. */\n readonly value = model<string | number | null>(null);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** The user picked, which is when a form shows a field's errors: a picker has no blur. */\n readonly touch = output<void>();\n readonly selectionChange =\n output<NativeSyntheticEvent<{ readonly selection: string | number }>>();\n\n /** Each option's `tag`, one array per value, so a pass hands native the same objects. */\n protected readonly tags = computed(\n () =>\n new Map(\n (this.options() ?? []).map((option) => [\n option.value,\n [{ $type: 'tag', tag: option.value }] as readonly UiModifier[],\n ]),\n ),\n );\n\n protected readonly resolvedModifiers = computed(() => {\n const style = this.pickerStyle();\n const own = style\n ? [{ $type: 'pickerStyle', style }, ...(this.modifiers() ?? [])]\n : this.modifiers();\n return withDisabled(own, this.disabled());\n });\n\n constructor() {\n listen('topSelectionChange', ({ selection }) => {\n if (typeof selection !== 'string' && typeof selection !== 'number') return;\n this.value.set(selection);\n this.touch.emit();\n });\n }\n}\n\n/** What `ui-toggle` sends when it is switched: whether it is now on. */\nexport type UiToggleChangeEvent = NativeSyntheticEvent<{ readonly isOn: boolean }>;\n\n/** A SwiftUI `Toggle`. `isOnChange` reports each flip. */\n@Component({\n selector: 'ui-toggle',\n template: '<ng-content />',\n host: { '[isOn]': 'isOn()', '[label]': 'label()', '[modifiers]': 'modifiers()' },\n})\nexport class UiToggle {\n readonly isOn = input<boolean>(undefined, { transform: optionalBoolean });\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly isOnChange = output<UiToggleChangeEvent>();\n}\n\n/** What `ui-stepper` sends as it is stepped: its new value. */\nexport type UiStepperChangeEvent = NativeSyntheticEvent<{ readonly value: number }>;\n\n/** A SwiftUI `Stepper`, between `min` and `max` by `step`. */\n@Component({\n selector: 'ui-stepper',\n template: '<ng-content />',\n host: {\n '[value]': 'value()',\n '[min]': 'min()',\n '[max]': 'max()',\n '[step]': 'step()',\n '[label]': 'label()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiStepper {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly min = input<number>(undefined, { transform: optionalNumber });\n readonly max = input<number>(undefined, { transform: optionalNumber });\n readonly step = input<number>(undefined, { transform: optionalNumber });\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly valueChange = output<UiStepperChangeEvent>();\n}\n\n/** What `ui-text-field` sends as it is typed into: the text so far. */\nexport type UiTextFieldChangeEvent = NativeSyntheticEvent<{ readonly value: string }>;\n\n/**\n * A SwiftUI `TextField`. `text` is where it keeps what is typed, a `nativeState('')`: the field\n * writes to it on the UI thread, and `textChange` reports each change.\n */\n@Component({\n selector: 'ui-text-field',\n template: '',\n host: {\n '[text]': 'text()?.id',\n '[placeholder]': 'placeholder()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiTextField {\n readonly text = input<NativeState<string> | null>();\n readonly placeholder = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly textChange = output<UiTextFieldChangeEvent>();\n}\n\n/** What `ui-color-picker` sends when a colour is picked: the colour, as hex. */\nexport type UiColorChangeEvent = NativeSyntheticEvent<{ readonly value: string }>;\n\n/** A SwiftUI `ColorPicker`. `selection` is a colour as hex. */\n@Component({\n selector: 'ui-color-picker',\n template: '',\n host: {\n '[selection]': 'selection()',\n '[label]': 'label()',\n '[supportsOpacity]': 'supportsOpacity()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiColorPicker {\n readonly selection = input<string>();\n readonly label = input<string>();\n readonly supportsOpacity = input<boolean>(undefined, { transform: optionalBoolean });\n readonly modifiers = input<readonly UiModifier[]>();\n readonly selectionChange = output<UiColorChangeEvent>();\n}\n\n/** A SwiftUI `Gauge`: `value` between `min` and `max`, drawn as `type` says. */\n@Component({\n selector: 'ui-gauge',\n template: '<ng-content />',\n host: {\n '[value]': 'value()',\n '[min]': 'min()',\n '[max]': 'max()',\n '[type]': 'type()',\n '[currentValueLabel]': 'currentValueLabel()',\n '[minimumValueLabel]': 'minimumValueLabel()',\n '[maximumValueLabel]': 'maximumValueLabel()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiGauge {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly min = input<number>(undefined, { transform: optionalNumber });\n readonly max = input<number>(undefined, { transform: optionalNumber });\n readonly type = input<string>();\n readonly currentValueLabel = input<string>();\n readonly minimumValueLabel = input<string>();\n readonly maximumValueLabel = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `ProgressView`: a bar filled to `value`, from 0 to 1, or a spinner without one. */\n@Component({\n selector: 'ui-progress',\n template: '',\n host: { '[value]': 'value()', '[modifiers]': 'modifiers()' },\n})\nexport class UiProgress {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `HStack`. */\n@Component({\n selector: 'ui-hstack',\n template: '<ng-content />',\n host: {\n '[alignment]': 'alignment()',\n '[spacing]': 'spacing()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiHStack {\n readonly alignment = input<'top' | 'center' | 'bottom' | 'firstTextBaseline'>();\n readonly spacing = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Spacer`: the room left over in its stack. */\n@Component({\n selector: 'ui-spacer',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiSpacer {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `LabeledContent`: a label, and its content beside it. */\n@Component({\n selector: 'ui-labeled-content',\n template: '<ng-content />',\n host: { '[label]': 'label()', '[modifiers]': 'modifiers()' },\n})\nexport class UiLabeledContent {\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Form`: settings-style grouped rows. */\n@Component({\n selector: 'ui-form',\n template: '<ng-content />',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiForm {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Section` of a form or a list, under `title`. */\n@Component({\n selector: 'ui-section',\n template: '<ng-content />',\n host: { '[title]': 'title()', '[modifiers]': 'modifiers()' },\n})\nexport class UiSection {\n readonly title = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"expo-ui-components.js","sourceRoot":"","sources":["../src/expo-ui-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,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AHV,kDAAkD,4DAxtBjD,MAAM;;2FA2tBN,SAAS;kBANrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,YAAY;oBACtB,OAAO,EAAE,CAAC,MAAM,CAAC;oBACjB,QAAQ,EAAE,kDAAkD;oBAC5D,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE;iBAC7D","sourcesContent":["/**\n * Typed components for the `@expo/ui` views an app reaches for most, named and shaped as SwiftUI's.\n *\n * `EXPO_UI_VIEWS` makes every view reachable by name, and a name is all the renderer needs. What a\n * name cannot give is a type: under strict templates an unknown element is an error, and so is\n * each prop on it. These are the same elements, claimed by a component whose inputs carry the\n * props' types and whose host bindings pass each one straight to the node, so nothing changes at\n * runtime. An unset input stays `undefined` and never reaches native.\n *\n * Events are declared as outputs so that `$event` is typed. SwiftUI's events are never emitted:\n * Angular binds a template's `(dateChange)` to the output *and* to the element, and it is the\n * element's own event that arrives, once. Emitting from a host listener as well would deliver it\n * twice; a host listener of the same name as the output listens to the output itself and recurses.\n * So subscribe in a template, not to the output in code.\n *\n * Where Compose names a prop or an event differently, a component sends Android its own names and\n * emits the output from a host listener for Compose's event, which SwiftUI never sends. Only a few\n * do: the toggle, slider, button, progress, stacks and slot, and the date picker.\n *\n * Only the views and props an app has needed are here; the rest stay names, as before. Add a view\n * when a template wants it typed, from `@expo/ui`'s own props for it.\n *\n * Still register the names with `registerExpoUiViews`: the component types the element, the\n * registration is what makes it commit as the SwiftUI or Compose view.\n */\nimport {\n Component,\n DestroyRef,\n forwardRef,\n ElementRef,\n booleanAttribute,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport type { NativeState } from './native-state.ts';\nimport {\n HostEngine,\n type HostNode,\n type NativeSyntheticEvent,\n nativePlatform,\n} from '@ng-native/fabric';\nimport { optionalBoolean, optionalNumber } from './transforms.ts';\n\n/** One SwiftUI modifier, as `@expo/ui`'s modifier functions build them: `{ $type: 'frame', ... }`. */\nexport interface UiModifier {\n readonly $type: string;\n readonly [key: string]: unknown;\n}\n\n/**\n * The bridge from Yoga's layout to SwiftUI's; every other `ui-*` view goes inside one.\n * `matchContents` sizes the host to the SwiftUI content rather than the other way round, on both\n * axes or on the ones named. Native reads a flag per axis, which is what this splits it into, as\n * `@expo/ui`'s own `Host` does: without them the host has no size of its own, and the control\n * drawn in it spills outside it, where it can be seen but not touched or read by VoiceOver.\n */\n@Component({\n selector: 'ui-host',\n template: '<ng-content />',\n host: {\n '[matchContentsVertical]': 'matchVertical()',\n '[matchContentsHorizontal]': 'matchHorizontal()',\n '[ignoreSafeArea]': 'ignoreSafeArea()',\n '[useViewportSizeMeasurement]': 'useViewportSizeMeasurement()',\n },\n})\nexport class UiHost {\n readonly matchContents = input<\n boolean | { readonly vertical?: boolean; readonly horizontal?: boolean }\n >();\n protected readonly matchVertical = computed(() => {\n const match = this.matchContents();\n return typeof match === 'object' ? match.vertical : match;\n });\n protected readonly matchHorizontal = computed(() => {\n const match = this.matchContents();\n return typeof match === 'object' ? match.horizontal : match;\n });\n readonly ignoreSafeArea = input<'all' | 'keyboard' | 'container'>();\n readonly useViewportSizeMeasurement = input<boolean>(undefined, { transform: optionalBoolean });\n}\n\n/** A SwiftUI `Menu`. Its trigger is the `label` or a `<ui-slot name=\"label\">`; its items are children. */\n@Component({\n selector: 'ui-menu',\n template: '<ng-content />',\n host: {\n '[label]': 'label()',\n '[systemImage]': 'systemImage()',\n '[accessibilityLabel]': 'accessibilityLabel()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiMenu {\n readonly label = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly accessibilityLabel = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * A SwiftUI `Button`, as a menu item or on its own, or Compose's on Android, which draws `label` as\n * text inside it. `systemImage` and `role` are SwiftUI's alone.\n */\n@Component({\n selector: 'ui-button',\n imports: [forwardRef(() => UiText)],\n template: `@if (android && label()) {\n <ui-text [text]=\"label()\" />\n }\n <ng-content />`,\n host: {\n '(buttonPressed)': 'android && buttonPress.emit($event)',\n '[label]': 'label()',\n '[systemImage]': 'systemImage()',\n '[role]': 'role()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiButton {\n protected readonly android = nativePlatform() === 'android';\n readonly label = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly role = input<'default' | 'cancel' | 'destructive'>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly buttonPress = output<NativeSyntheticEvent<Record<string, never>>>();\n}\n\n/** A SwiftUI `Divider`, or Compose's `HorizontalDivider`: a separator between groups of items. */\n@Component({\n selector: 'ui-divider',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiDivider {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * Content for a named slot of its parent view, such as a menu's `label`. `extraProps` is what\n * the slot tells its parent about itself: a `ui-swipe-actions` group's `edge` and\n * `allowsFullSwipe`.\n */\n@Component({\n selector: 'ui-slot',\n template: '<ng-content />',\n host: {\n '[name]': 'android ? undefined : name()',\n '[slotName]': 'android ? name() : undefined',\n '[extraProps]': 'extraProps()',\n },\n})\nexport class UiSlot {\n protected readonly android = nativePlatform() === 'android';\n readonly name = input.required<string>();\n readonly extraProps = input<Readonly<Record<string, unknown>>>();\n}\n\n/**\n * A SwiftUI `List`: rows as SwiftUI lays them out, which is what lets a row take the system's own\n * swipe actions through `ui-swipe-actions`.\n */\n@Component({\n selector: 'ui-list',\n template: '<ng-content />',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiList {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * The system's swipe actions on a list row, iOS only. The first child is the row; the actions go\n * in `<ui-slot name=\"actions\" [extraProps]=\"{ edge: 'trailing', allowsFullSwipe: true }\">`, one\n * slot per edge, as `ui-button`s.\n */\n@Component({\n selector: 'ui-swipe-actions',\n template: '<ng-content />',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiSwipeActions {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** What `ui-slider` sends as the thumb moves: its new value. */\nexport type UiSliderChangeEvent = NativeSyntheticEvent<{ readonly value: number }>;\n\n/**\n * A SwiftUI `Slider`, or Compose's on Android. `valueChanged` reports each new value as the thumb\n * moves; note the d, which SwiftUI's event has and `@expo/ui`'s React prop does not.\n */\n@Component({\n selector: 'ui-slider',\n template: '',\n host: {\n '[value]': 'value()',\n '[min]': 'min()',\n '[max]': 'max()',\n '[step]': 'android ? undefined : stepSize()',\n '[steps]': 'android ? stepsBetween() : undefined',\n '[modifiers]': 'modifiers()',\n '(valueChange)': 'android && valueChanged.emit($event)',\n },\n})\nexport class UiSlider {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly min = input<number>(undefined, { transform: optionalNumber });\n readonly max = input<number>(undefined, { transform: optionalNumber });\n /** How many steps the range is divided into; none moves the thumb continuously. */\n readonly steps = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n readonly valueChanged = output<UiSliderChangeEvent>();\n\n protected readonly android = nativePlatform() === 'android';\n /** A whole number of steps, which is all Compose can draw. */\n private readonly wholeSteps = computed(() => {\n const steps = Math.round(this.steps() ?? 0);\n return steps > 0 ? steps : undefined;\n });\n /** SwiftUI takes a step size, and draws 0 to 1 unless it has both ends. */\n protected readonly stepSize = computed(() => {\n const steps = this.wholeSteps();\n const min = this.min();\n const max = this.max();\n return steps && (min !== undefined && max !== undefined ? max - min : 1) / steps;\n });\n /** Compose takes the number of points between the ends. */\n protected readonly stepsBetween = computed(() => {\n const steps = this.wholeSteps();\n return steps && steps - 1;\n });\n}\n\n/**\n * A SwiftUI `VStack`, or Compose's `Column` on Android, centred, as SwiftUI's is, unless `alignment`\n * says otherwise. Without `spacing`, SwiftUI puts its own default spacing between children and Compose\n * puts none.\n */\n@Component({\n selector: 'ui-vstack',\n template: '<ng-content />',\n host: {\n '[alignment]': 'android ? undefined : alignment()',\n '[spacing]': 'android ? undefined : spacing()',\n '[verticalArrangement]': 'android ? spacedBy(spacing()) : undefined',\n '[horizontalAlignment]': 'android ? composeAlignment(alignment()) : undefined',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiVStack {\n readonly alignment = input<'leading' | 'center' | 'trailing'>();\n readonly spacing = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n\n protected readonly android = nativePlatform() === 'android';\n protected readonly spacedBy = spacedBy;\n protected composeAlignment(alignment: 'leading' | 'center' | 'trailing' | undefined) {\n return alignment === 'leading' ? 'start' : alignment === 'trailing' ? 'end' : 'center';\n }\n}\n\n/** A SwiftUI `Image`: an SF Symbol by `systemName`, or a picture by `uiImage` URL. */\n@Component({\n selector: 'ui-image',\n template: '',\n host: {\n '[systemName]': 'systemName()',\n '[uiImage]': 'uiImage()',\n '[size]': 'size()',\n '[color]': 'color()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiImage {\n readonly systemName = input<string>();\n readonly uiImage = input<string>();\n readonly size = input<number>(undefined, { transform: optionalNumber });\n readonly color = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * A SwiftUI `Text`, or Compose's on Android. Its text is what is written inside it,\n * `<ui-text>Us {{ score }}</ui-text>`, as `<text>` takes its own, or `text`, which wins over it.\n */\n@Component({\n selector: 'ui-text',\n template: '<ng-content />',\n host: { '[text]': 'text()', '[modifiers]': 'modifiers()' },\n})\nexport class UiText {\n readonly text = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * What `ui-date-picker` sends when the user picks: the chosen moment, which SwiftUI reports in\n * milliseconds since the epoch.\n */\nexport type UiDateChangeEvent = NativeSyntheticEvent<{ readonly date: number | string }>;\n\n/**\n * Listen for one of a `ui-*` view's own events from inside its component. Not a host listener:\n * one named as an output listens to the output itself, and see the note at the top of this file\n * for why the outputs are never emitted.\n */\nfunction listen(event: string, handle: (payload: Record<string, unknown>) => void): void {\n const node = inject(ElementRef).nativeElement as HostNode;\n const engine = node.host ?? inject(HostEngine);\n const stop = engine.setEventListener(node, event, (raw) =>\n handle((raw as NativeSyntheticEvent<Record<string, unknown>>)?.nativeEvent ?? {}),\n );\n inject(DestroyRef).onDestroy(stop);\n}\n\n/**\n * A Compose event as the SwiftUI one it stands in for: its payload renamed, and stopping it stops the\n * event it came from.\n */\nfunction withNativeEvent<T>(event: NativeSyntheticEvent, nativeEvent: T): NativeSyntheticEvent<T> {\n return {\n nativeEvent,\n target: event.target,\n stopPropagation: () => event.stopPropagation(),\n isPropagationStopped: () => event.isPropagationStopped(),\n };\n}\n\n/** The caller's modifiers, with SwiftUI's `disabled` added while the field is. */\nfunction withDisabled(\n modifiers: readonly UiModifier[] | undefined,\n disabled: boolean,\n): readonly UiModifier[] | undefined {\n return disabled ? [...(modifiers ?? []), { $type: 'disabled', disabled: true }] : modifiers;\n}\n\n/**\n * A date picker: SwiftUI's `DatePicker` on iOS, Compose's on Android.\n *\n * A Signal Forms field as it stands - `<ui-date-picker [formField]=\"f.arrival\" />` - through its\n * `value` model, a `Date` (or null). The two platforms take and report a date differently, and\n * this is where that difference ends: SwiftUI is handed `selection` as ISO text and reports\n * `dateChange`; Compose is handed `initialDate` in milliseconds and reports `dateSelected`. Either\n * way the model gets a `Date`. A `disabled` field adds SwiftUI's `disabled` modifier. SwiftUI's\n * picker always shows a date, today when the field is empty, and the date it reports as it appears\n * is not taken as the user's; an optional date is best asked for behind a button that shows the\n * picker once the user wants to give one.\n *\n * `selection` is still accepted as ISO text, for a picker bound without a form.\n */\n@Component({\n selector: 'ui-date-picker',\n template: '',\n host: {\n '[title]': 'title()',\n '[selection]': 'resolvedSelection()',\n '[initialDate]': 'initialDate()',\n '[displayedComponents]': 'displayedComponents()',\n '[range]': 'range()',\n '[accessibilityLabel]': 'accessibilityLabel()',\n '[modifiers]': 'resolvedModifiers()',\n },\n})\nexport class UiDatePicker {\n readonly title = input<string>();\n readonly selection = input<string>();\n readonly displayedComponents = input<readonly ('date' | 'hourAndMinute')[]>();\n readonly range = input<{ readonly start?: string; readonly end?: string }>();\n readonly accessibilityLabel = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n /** The picked date: what `[formField]` binds. */\n readonly value = model<Date | null>(null);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** The user picked, which is when a form shows a field's errors: a picker has no blur. */\n readonly touch = output<void>();\n readonly dateChange = output<UiDateChangeEvent>();\n\n private readonly android = nativePlatform() === 'android';\n\n protected readonly resolvedSelection = computed(() =>\n this.android ? undefined : (this.selection() ?? this.value()?.toISOString()),\n );\n protected readonly initialDate = computed(() =>\n this.android ? (this.value()?.getTime() ?? null) : undefined,\n );\n protected readonly resolvedModifiers = computed(() =>\n this.android ? this.modifiers() : withDisabled(this.modifiers(), this.disabled()),\n );\n\n /**\n * SwiftUI's picker cannot be empty: it shows today, and reports that as a change the moment it\n * appears. Taken as the user's choice, an empty date field would fill itself in, pass\n * `required` and mark the form dirty before anyone touched it. So the first report, while the\n * field is empty and the picker has only just appeared, is the picker describing itself.\n */\n private readonly appeared = Date.now();\n private settled = false;\n\n constructor() {\n listen(this.android ? 'topDateSelected' : 'topDateChange', ({ date }) => {\n if (typeof date !== 'string' && typeof date !== 'number') return;\n const describingItself =\n !this.settled && this.value() === null && Date.now() - this.appeared < APPEARING_MS;\n this.settled = true;\n if (describingItself) return;\n this.value.set(new Date(date));\n this.touch.emit();\n });\n }\n}\n\n/** How long after a date picker appears its first report is taken to be about itself. */\nconst APPEARING_MS = 1000;\n\n/** One choice in a `ui-picker`: what the field is set to, and what the user reads. */\nexport interface UiPickerOption {\n readonly value: string | number;\n readonly label: string;\n}\n\n/**\n * A SwiftUI `Picker`, iOS only, as a Signal Forms field: `<ui-picker [options]=\"rooms\"\n * [formField]=\"f.room\" />`. `options` draws the choices, each tagged with its value, which is the\n * content slot and `tag` modifiers `@expo/ui` otherwise wants written out by hand; children still\n * work for anything richer. `pickerStyle` is SwiftUI's (`menu`, `segmented`, `wheel`, `inline`).\n */\n@Component({\n selector: 'ui-picker',\n imports: [UiSlot, UiText],\n template: `\n @if (options(); as options) {\n <ui-slot name=\"content\">\n @for (option of options; track option.value) {\n <ui-text [text]=\"option.label\" [modifiers]=\"tags().get(option.value)\" />\n }\n </ui-slot>\n }\n <ng-content />\n `,\n host: {\n '[label]': 'label()',\n '[systemImage]': 'systemImage()',\n '[selection]': 'value()',\n '[modifiers]': 'resolvedModifiers()',\n },\n})\nexport class UiPicker {\n readonly label = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly options = input<readonly UiPickerOption[]>();\n readonly pickerStyle = input<\n 'automatic' | 'menu' | 'segmented' | 'wheel' | 'inline' | 'palette'\n >();\n readonly modifiers = input<readonly UiModifier[]>();\n /** The chosen option's value: what `[formField]` binds. */\n readonly value = model<string | number | null>(null);\n readonly disabled = input(false, { transform: booleanAttribute });\n /** The user picked, which is when a form shows a field's errors: a picker has no blur. */\n readonly touch = output<void>();\n readonly selectionChange =\n output<NativeSyntheticEvent<{ readonly selection: string | number }>>();\n\n /** Each option's `tag`, one array per value, so a pass hands native the same objects. */\n protected readonly tags = computed(\n () =>\n new Map(\n (this.options() ?? []).map((option) => [\n option.value,\n [{ $type: 'tag', tag: option.value }] as readonly UiModifier[],\n ]),\n ),\n );\n\n protected readonly resolvedModifiers = computed(() => {\n const style = this.pickerStyle();\n const own = style\n ? [{ $type: 'pickerStyle', style }, ...(this.modifiers() ?? [])]\n : this.modifiers();\n return withDisabled(own, this.disabled());\n });\n\n constructor() {\n listen('topSelectionChange', ({ selection }) => {\n if (typeof selection !== 'string' && typeof selection !== 'number') return;\n this.value.set(selection);\n this.touch.emit();\n });\n }\n}\n\n/** What `ui-toggle` sends when it is switched: whether it is now on. */\nexport type UiToggleChangeEvent = NativeSyntheticEvent<{ readonly isOn: boolean }>;\n\n/**\n * A SwiftUI `Toggle`, or Compose's `Switch` on Android. `isOnChange` reports each flip. Bound to\n * `isOn`, it shows what `isOn` says; without it, it switches itself. `label` is SwiftUI's alone.\n */\n@Component({\n selector: 'ui-toggle',\n template: '<ng-content />',\n host: {\n '[isOn]': 'android ? undefined : isOn()',\n '[value]': 'android ? (isOn() ?? switchedOn()) : undefined',\n '[label]': 'label()',\n '[modifiers]': 'modifiers()',\n '(checkedChange)': 'android && checked($event)',\n },\n})\nexport class UiToggle {\n readonly isOn = input<boolean>(undefined, { transform: optionalBoolean });\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly isOnChange = output<UiToggleChangeEvent>();\n\n protected readonly android = nativePlatform() === 'android';\n /** What Compose's switch shows without `isOn`: SwiftUI's keeps this itself, Compose's does not. */\n protected readonly switchedOn = signal(false);\n protected checked(event: NativeSyntheticEvent<{ readonly value: boolean }>): void {\n this.switchedOn.set(event.nativeEvent.value);\n this.isOnChange.emit(withNativeEvent(event, { isOn: event.nativeEvent.value }));\n }\n}\n\n/** What `ui-stepper` sends as it is stepped: its new value. */\nexport type UiStepperChangeEvent = NativeSyntheticEvent<{ readonly value: number }>;\n\n/** A SwiftUI `Stepper`, between `min` and `max` by `step`. */\n@Component({\n selector: 'ui-stepper',\n template: '<ng-content />',\n host: {\n '[value]': 'value()',\n '[min]': 'min()',\n '[max]': 'max()',\n '[step]': 'step()',\n '[label]': 'label()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiStepper {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly min = input<number>(undefined, { transform: optionalNumber });\n readonly max = input<number>(undefined, { transform: optionalNumber });\n readonly step = input<number>(undefined, { transform: optionalNumber });\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly valueChange = output<UiStepperChangeEvent>();\n}\n\n/** What `ui-text-field` sends as it is typed into: the text so far. */\nexport type UiTextFieldChangeEvent = NativeSyntheticEvent<{ readonly value: string }>;\n\n/**\n * A SwiftUI `TextField`. `text` is where it keeps what is typed, a `nativeState('')`: the field\n * writes to it on the UI thread, and `textChange` reports each change.\n */\n@Component({\n selector: 'ui-text-field',\n template: '',\n host: {\n '[text]': 'text()?.id',\n '[placeholder]': 'placeholder()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiTextField {\n readonly text = input<NativeState<string> | null>();\n readonly placeholder = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n readonly textChange = output<UiTextFieldChangeEvent>();\n}\n\n/** What `ui-color-picker` sends when a colour is picked: the colour, as hex. */\nexport type UiColorChangeEvent = NativeSyntheticEvent<{ readonly value: string }>;\n\n/** A SwiftUI `ColorPicker`. `selection` is a colour as hex. */\n@Component({\n selector: 'ui-color-picker',\n template: '',\n host: {\n '[selection]': 'selection()',\n '[label]': 'label()',\n '[supportsOpacity]': 'supportsOpacity()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiColorPicker {\n readonly selection = input<string>();\n readonly label = input<string>();\n readonly supportsOpacity = input<boolean>(undefined, { transform: optionalBoolean });\n readonly modifiers = input<readonly UiModifier[]>();\n readonly selectionChange = output<UiColorChangeEvent>();\n}\n\n/** A SwiftUI `Gauge`: `value` between `min` and `max`, drawn as `type` says. */\n@Component({\n selector: 'ui-gauge',\n template: '<ng-content />',\n host: {\n '[value]': 'value()',\n '[min]': 'min()',\n '[max]': 'max()',\n '[type]': 'type()',\n '[currentValueLabel]': 'currentValueLabel()',\n '[minimumValueLabel]': 'minimumValueLabel()',\n '[maximumValueLabel]': 'maximumValueLabel()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiGauge {\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly min = input<number>(undefined, { transform: optionalNumber });\n readonly max = input<number>(undefined, { transform: optionalNumber });\n readonly type = input<string>();\n readonly currentValueLabel = input<string>();\n readonly minimumValueLabel = input<string>();\n readonly maximumValueLabel = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * A SwiftUI `ProgressView`: a bar filled to `value`, from 0 to 1, or a spinner without one. On\n * Android, Compose's `LinearProgressIndicator`, a moving bar rather than a spinner without a value.\n */\n@Component({\n selector: 'ui-progress',\n template: '',\n host: {\n '[value]': 'android ? undefined : value()',\n '[progress]': 'android ? value() : undefined',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiProgress {\n protected readonly android = nativePlatform() === 'android';\n readonly value = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * A SwiftUI `HStack`, or Compose's `Row` on Android, centred, as SwiftUI's is, unless `alignment`\n * says otherwise. Compose has no `firstTextBaseline`, and centres instead. Without `spacing`, SwiftUI\n * puts its own default spacing between children and Compose puts none.\n */\n@Component({\n selector: 'ui-hstack',\n template: '<ng-content />',\n host: {\n '[alignment]': 'android ? undefined : alignment()',\n '[spacing]': 'android ? undefined : spacing()',\n '[horizontalArrangement]': 'android ? spacedBy(spacing()) : undefined',\n '[verticalAlignment]': 'android ? composeAlignment(alignment()) : undefined',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiHStack {\n readonly alignment = input<'top' | 'center' | 'bottom' | 'firstTextBaseline'>();\n readonly spacing = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n\n protected readonly android = nativePlatform() === 'android';\n protected readonly spacedBy = spacedBy;\n protected composeAlignment(\n alignment: 'top' | 'center' | 'bottom' | 'firstTextBaseline' | undefined,\n ) {\n return alignment === 'top' || alignment === 'bottom' ? alignment : 'center';\n }\n}\n\nfunction spacedBy(spacing: number | undefined) {\n return spacing === undefined ? undefined : { spacedBy: Math.round(spacing) };\n}\n\n/** A SwiftUI `Spacer`: the room left over in its stack. */\n@Component({\n selector: 'ui-spacer',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiSpacer {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** Where `ui-zstack` puts its layers, as SwiftUI names it. */\nexport type UiZStackAlignment =\n | 'center'\n | 'leading'\n | 'trailing'\n | 'top'\n | 'bottom'\n | 'topLeading'\n | 'topTrailing'\n | 'bottomLeading'\n | 'bottomTrailing';\n\n/** The same place, as Compose's `Box` names it. */\nconst CONTENT_ALIGNMENT: Record<UiZStackAlignment, string> = {\n center: 'center',\n leading: 'centerStart',\n trailing: 'centerEnd',\n top: 'topCenter',\n bottom: 'bottomCenter',\n topLeading: 'topStart',\n topTrailing: 'topEnd',\n bottomLeading: 'bottomStart',\n bottomTrailing: 'bottomEnd',\n};\n\n/**\n * A SwiftUI `ZStack`: its children drawn over one another, the first at the back. On Android,\n * Compose's `Box`, centred, as SwiftUI's is, unless `alignment` says otherwise.\n */\n@Component({\n selector: 'ui-zstack',\n template: '<ng-content />',\n host: {\n '[alignment]': 'android ? undefined : alignment()',\n '[contentAlignment]': 'android ? contentAlignment[alignment() ?? \"center\"] : undefined',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiZStack {\n readonly alignment = input<UiZStackAlignment>();\n readonly modifiers = input<readonly UiModifier[]>();\n\n protected readonly android = nativePlatform() === 'android';\n protected readonly contentAlignment = CONTENT_ALIGNMENT;\n}\n\n/** A SwiftUI `Rectangle`, filling the space it is given. Colour it with `foregroundStyle`. */\n@Component({\n selector: 'ui-rectangle',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiRectangle {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `RoundedRectangle`, its corners rounded by `cornerRadius`. */\n@Component({\n selector: 'ui-rounded-rectangle',\n template: '',\n host: { '[cornerRadius]': 'cornerRadius()', '[modifiers]': 'modifiers()' },\n})\nexport class UiRoundedRectangle {\n readonly cornerRadius = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `UnevenRoundedRectangle`: a rectangle with a radius of its own for each corner. */\n@Component({\n selector: 'ui-uneven-rounded-rectangle',\n template: '',\n host: {\n '[topLeadingRadius]': 'topLeadingRadius()',\n '[topTrailingRadius]': 'topTrailingRadius()',\n '[bottomLeadingRadius]': 'bottomLeadingRadius()',\n '[bottomTrailingRadius]': 'bottomTrailingRadius()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiUnevenRoundedRectangle {\n readonly topLeadingRadius = input<number>(undefined, { transform: optionalNumber });\n readonly topTrailingRadius = input<number>(undefined, { transform: optionalNumber });\n readonly bottomLeadingRadius = input<number>(undefined, { transform: optionalNumber });\n readonly bottomTrailingRadius = input<number>(undefined, { transform: optionalNumber });\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Capsule`: a rectangle with fully rounded ends. */\n@Component({\n selector: 'ui-capsule',\n template: '',\n host: { '[cornerStyle]': 'cornerStyle()', '[modifiers]': 'modifiers()' },\n})\nexport class UiCapsule {\n readonly cornerStyle = input<'continuous' | 'circular'>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Circle`, as large as fits the space it is given. */\n@Component({\n selector: 'ui-circle',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiCircle {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Ellipse`, filling the space it is given. */\n@Component({\n selector: 'ui-ellipse',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiEllipse {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * WidgetKit's `AccessoryWidgetBackground`: the system's backdrop for a lock screen widget, the\n * translucent disc or panel behind its content.\n */\n@Component({\n selector: 'ui-accessory-widget-background',\n template: '',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiAccessoryWidgetBackground {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Label`: a title beside an SF Symbol. */\n@Component({\n selector: 'ui-label',\n template: '',\n host: {\n '[title]': 'title()',\n '[systemImage]': 'systemImage()',\n '[color]': 'color()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiLabel {\n readonly title = input<string>();\n /** An SF Symbol name. */\n readonly systemImage = input<string>();\n readonly color = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/**\n * A SwiftUI `Link`: opens `destination`, a URL, when tapped. It shows `label`, or the views\n * written inside it. In a widget, a link is how a tap opens the app at a deep link.\n */\n@Component({\n selector: 'ui-link',\n template: '<ng-content />',\n host: {\n '[destination]': 'destination()',\n '[label]': 'label()',\n '[modifiers]': 'modifiers()',\n },\n})\nexport class UiLink {\n readonly destination = input.required<string>();\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `LabeledContent`: a label, and its content beside it. */\n@Component({\n selector: 'ui-labeled-content',\n imports: [UiSlot],\n template: '<ui-slot name=\"content\"><ng-content /></ui-slot>',\n host: { '[label]': 'label()', '[modifiers]': 'modifiers()' },\n})\nexport class UiLabeledContent {\n readonly label = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Form`: settings-style grouped rows. */\n@Component({\n selector: 'ui-form',\n template: '<ng-content />',\n host: { '[modifiers]': 'modifiers()' },\n})\nexport class UiForm {\n readonly modifiers = input<readonly UiModifier[]>();\n}\n\n/** A SwiftUI `Section` of a form or a list, under `title`. */\n@Component({\n selector: 'ui-section',\n imports: [UiSlot],\n template: '<ui-slot name=\"content\"><ng-content /></ui-slot>',\n host: { '[title]': 'title()', '[modifiers]': 'modifiers()' },\n})\nexport class UiSection {\n readonly title = input<string>();\n readonly modifiers = input<readonly UiModifier[]>();\n}\n"]}
|
package/dist/expo-ui.js
CHANGED
|
@@ -10,7 +10,7 @@ export const EXPO_UI_VIEWS = {
|
|
|
10
10
|
'badged-box': [null, 'BadgedBoxView'],
|
|
11
11
|
'basic-alert-dialog': [null, 'BasicAlertDialogView'],
|
|
12
12
|
'bottom-sheet': ['BottomSheetView', 'ModalBottomSheetView'],
|
|
13
|
-
button: ['Button',
|
|
13
|
+
button: ['Button', 'Button'],
|
|
14
14
|
capsule: ['CapsuleView', null],
|
|
15
15
|
chart: ['ChartView', null],
|
|
16
16
|
checkbox: [null, 'CheckboxView'],
|
|
@@ -23,7 +23,7 @@ export const EXPO_UI_VIEWS = {
|
|
|
23
23
|
'date-picker': ['DatePickerView', 'DateTimePickerView'],
|
|
24
24
|
'date-picker-dialog': [null, 'DatePickerDialogView'],
|
|
25
25
|
'disclosure-group': ['DisclosureGroupView', null],
|
|
26
|
-
divider: ['DividerView',
|
|
26
|
+
divider: ['DividerView', 'HorizontalDividerView'],
|
|
27
27
|
'docked-search-bar': [null, 'DockedSearchBarView'],
|
|
28
28
|
ellipse: ['EllipseView', null],
|
|
29
29
|
'exposed-dropdown-menu-box': [null, 'ExposedDropdownMenuBoxView'],
|
|
@@ -37,7 +37,7 @@ export const EXPO_UI_VIEWS = {
|
|
|
37
37
|
'grid-row': ['GridRowView', null],
|
|
38
38
|
group: ['GroupView', null],
|
|
39
39
|
'horizontal-floating-toolbar': [null, 'HorizontalFloatingToolbarView'],
|
|
40
|
-
host: ['HostView', '
|
|
40
|
+
host: ['HostView', 'HostView'],
|
|
41
41
|
hstack: ['HStackView', 'RowView'],
|
|
42
42
|
icon: [null, 'IconView'],
|
|
43
43
|
image: ['ImageView', 'ImageView'],
|
|
@@ -59,7 +59,7 @@ export const EXPO_UI_VIEWS = {
|
|
|
59
59
|
picker: ['PickerView', null],
|
|
60
60
|
'plain-tooltip': [null, 'PlainTooltipView'],
|
|
61
61
|
popover: ['PopoverView', null],
|
|
62
|
-
progress: ['ProgressView',
|
|
62
|
+
progress: ['ProgressView', 'LinearProgressIndicatorView'],
|
|
63
63
|
'pull-to-refresh-box': [null, 'PullToRefreshBoxView'],
|
|
64
64
|
'radio-button': [null, 'RadioButtonView'],
|
|
65
65
|
rectangle: ['RectangleView', null],
|
|
@@ -121,8 +121,11 @@ export function registerExpoUiViews(platform) {
|
|
|
121
121
|
const index = platform === 'ios' ? 0 : 1;
|
|
122
122
|
for (const [element, views] of Object.entries(EXPO_UI_VIEWS)) {
|
|
123
123
|
const viewName = views[index];
|
|
124
|
-
if (viewName)
|
|
125
|
-
|
|
124
|
+
if (!viewName)
|
|
125
|
+
continue;
|
|
126
|
+
// SwiftUI's and Compose's `Text` read their text from `text`, and take no child views.
|
|
127
|
+
const textContent = element === 'text' ? 'text' : undefined;
|
|
128
|
+
registerExpoView(`ui-${element}`, 'ExpoUI', { viewName, textContent });
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
131
|
//# sourceMappingURL=expo-ui.js.map
|
package/dist/expo-ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-ui.js","sourceRoot":"","sources":["../src/expo-ui.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,oGAAoG;AACpG,MAAM,CAAC,MAAM,aAAa,GAAsE;IAC9F,6BAA6B,EAAE,CAAC,+BAA+B,EAAE,IAAI,CAAC;IACtE,KAAK,EAAE,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACvC,qBAAqB,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACvD,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC;IACvC,UAAU,EAAE,CAAC,gBAAgB,EAAE,IAAI,CAAC;IACpC,KAAK,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC;IACrC,oBAAoB,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACpD,cAAc,EAAE,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IAC3D,MAAM,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,OAAO,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC;IAC9B,KAAK,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC;IAChC,MAAM,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IAC5B,cAAc,EAAE,CAAC,iBAAiB,EAAE,IA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,gBAAgB,CAAC;IACvC,oBAAoB,EAAE,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACpD,0BAA0B,EAAE,CAAC,4BAA4B,EAAE,IAAI,CAAC;IAChE,iBAAiB,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC;IAC/C,MAAM,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,MAAM,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAwB;IAC1D,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO;IACzD,MAAM,KAAK,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,QAAQ;YAAE,gBAAgB,CAAC,MAAM,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC","sourcesContent":["/**\n * `@expo/ui`: real SwiftUI and Jetpack Compose views, as elements.\n *\n * This is the closest thing in the ecosystem to what this project is for. Every one of these is a\n * platform control - a real `Picker`, a real `BottomSheet`, a real `Gauge` - rather than something\n * drawn to look like one, and `@expo/ui` reaches them through `requireNativeView('ExpoUI', ...)`,\n * which is the same derivation `registerExpoView` already mirrors. So the whole surface is\n * available here for the price of a table of names.\n *\n * The element names are platform-neutral where both platforms have the control, because an app\n * should write `<ui-slider>` once. Where only one platform has it - a `Gauge` is SwiftUI's, a\n * `SearchBar` is Compose's - the element exists only there, and registering for the wrong platform\n * would be an element that commits as nothing.\n *\n * ```ts\n * registerExpoUiViews(Platform.OS);\n * ```\n * ```html\n * <ui-host style=\"height: 44\">\n * <ui-slider [value]=\"volume()\" (valueChanged)=\"volume.set($event.value)\" />\n * </ui-host>\n * ```\n *\n * **A `<ui-host>` is required around any of these.** SwiftUI and Compose lay out their own\n * subtrees, and the host view is what bridges Yoga's layout to theirs; without one the control has\n * no size and does not appear - which looks exactly like a module that failed to install.\n *\n * Names, not components. There are ninety-odd of these, each with its own props and its own\n * modifier system, and a component per view prop-for-prop would be a second place for every one of\n * them to be wrong. The module's own documentation describes the props; this makes them reachable.\n */\nimport type { PlatformOSType } from 'react-native';\nimport { registerExpoView } from './register-expo-view.ts';\n\n/** Element name -> the `ExpoUI` view on iOS and on Android. Null where the platform has no such. */\nexport const EXPO_UI_VIEWS: Readonly<Record<string, readonly [string | null, string | null]>> = {\n 'accessory-widget-background': ['AccessoryWidgetBackgroundView', null],\n alert: ['AlertView', 'AlertDialogView'],\n 'animated-visibility': [null, 'AnimatedVisibilityView'],\n 'assist-chip': [null, 'AssistChipView'],\n background: ['BackgroundView', null],\n badge: [null, 'BadgeView'],\n 'badged-box': [null, 'BadgedBoxView'],\n 'basic-alert-dialog': [null, 'BasicAlertDialogView'],\n 'bottom-sheet': ['BottomSheetView', 'ModalBottomSheetView'],\n button: ['Button', null],\n capsule: ['CapsuleView', null],\n chart: ['ChartView', null],\n checkbox: [null, 'CheckboxView'],\n circle: ['CircleView', null],\n 'color-picker': ['ColorPickerView', null],\n 'confirmation-dialog': ['ConfirmationDialogView', null],\n 'content-unavailable': ['ContentUnavailableView', null],\n 'context-menu': ['ContextMenu', null],\n 'control-group': ['ControlGroupView', null],\n 'date-picker': ['DatePickerView', 'DateTimePickerView'],\n 'date-picker-dialog': [null, 'DatePickerDialogView'],\n 'disclosure-group': ['DisclosureGroupView', null],\n divider: ['DividerView', null],\n 'docked-search-bar': [null, 'DockedSearchBarView'],\n ellipse: ['EllipseView', null],\n 'exposed-dropdown-menu-box': [null, 'ExposedDropdownMenuBoxView'],\n 'filter-chip': [null, 'FilterChipView'],\n 'floating-action-button': [null, 'FloatingActionButtonView'],\n 'flow-row': [null, 'FlowRowView'],\n form: ['FormView', null],\n gauge: ['GaugeView', null],\n 'glass-effect-container': ['GlassEffectContainerView', null],\n grid: ['GridView', null],\n 'grid-row': ['GridRowView', null],\n group: ['GroupView', null],\n 'horizontal-floating-toolbar': [null, 'HorizontalFloatingToolbarView'],\n host: ['HostView', 'RNHostView'],\n hstack: ['HStackView', 'RowView'],\n icon: [null, 'IconView'],\n image: ['ImageView', 'ImageView'],\n 'input-chip': [null, 'InputChipView'],\n label: ['LabelView', null],\n list: ['ListView', null],\n 'labeled-content': ['LabeledContentView', null],\n 'lazy-hstack': ['LazyHStackView', 'LazyRowView'],\n 'lazy-vstack': ['LazyVStackView', 'LazyColumnView'],\n link: ['LinkView', null],\n 'list-item': [null, 'ListItemView'],\n mask: ['MaskView', null],\n menu: ['MenuView', 'DropdownMenuView'],\n 'multi-choice-segmented-button-row': [null, 'MultiChoiceSegmentedButtonRowView'],\n 'navigation-bar': [null, 'NavigationBarView'],\n 'navigation-bar-item': [null, 'NavigationBarItemView'],\n overlay: ['OverlayView', null],\n pager: [null, 'HorizontalPagerView'],\n picker: ['PickerView', null],\n 'plain-tooltip': [null, 'PlainTooltipView'],\n popover: ['PopoverView', null],\n progress: ['ProgressView', null],\n 'pull-to-refresh-box': [null, 'PullToRefreshBoxView'],\n 'radio-button': [null, 'RadioButtonView'],\n rectangle: ['RectangleView', null],\n 'rich-tooltip': [null, 'RichTooltipView'],\n 'rounded-rectangle': ['RoundedRectangleView', null],\n 'scroll-view-component': ['ScrollViewComponent', null],\n 'search-bar': [null, 'SearchBarView'],\n section: ['SectionView', null],\n 'secure-field': ['SecureFieldView', null],\n 'segmented-button': [null, 'SegmentedButtonView'],\n shape: [null, 'ShapeView'],\n 'share-link': ['ShareLinkView', null],\n 'single-choice-segmented-button-row': [null, 'SingleChoiceSegmentedButtonRowView'],\n slider: ['SliderView', 'SliderView'],\n /**\n * Both platforms, though it looks Android-only at a glance.\n *\n * SwiftUI's `SlotView` lives in a top-level `SlotView.tsx` rather than in a directory of its\n * own, which is how it was missed. Twenty SwiftUI components put their children through one:\n * a picker's options, a section's rows, a labelled content's value. Without it those children\n * mount into a plain `UIView` and SwiftUI refuses them, which is a red screen on iOS and an\n * empty control everywhere else.\n */\n slot: ['SlotView', 'SlotView'],\n snackbar: [null, 'SnackbarView'],\n 'snackbar-host': [null, 'SnackbarHostView'],\n spacer: ['SpacerView', 'SpacerView'],\n stepper: ['StepperView', null],\n 'suggestion-chip': [null, 'SuggestionChipView'],\n surface: [null, 'SurfaceView'],\n 'swipe-actions': ['SwipeActionsView', null],\n 'sync-toggle': ['SyncToggleView', 'SyncSwitchView'],\n tab: ['TabView', null],\n text: ['TextView', 'TextView'],\n 'text-field': ['TextFieldView', null],\n 'time-picker-dialog': [null, 'TimePickerDialogView'],\n toggle: ['ToggleView', 'SwitchView'],\n 'tooltip-box': [null, 'TooltipBoxView'],\n 'tri-state-checkbox': [null, 'TriStateCheckboxView'],\n 'uneven-rounded-rectangle': ['UnevenRoundedRectangleView', null],\n 'vertical-slider': [null, 'VerticalSliderView'],\n vstack: ['VStackView', 'ColumnView'],\n zstack: ['ZStackView', 'BoxView'],\n};\n\n/**\n * Register every `@expo/ui` view the platform has.\n *\n * All of them at once, unlike the other registrations here, because they are all one module: an\n * app that has `@expo/ui` installed has all of these, and an app that does not has none of them.\n *\n * Takes `Platform.OS` itself - `'ios' | 'android' | 'macos' | 'windows' | 'web'` - rather than the\n * two platforms `@expo/ui` actually ships for, so a canary app can pass it straight through\n * without narrowing. Anything other than iOS or Android registers nothing, the same \"not\n * installed\" outcome as never calling this at all.\n */\nexport function registerExpoUiViews(platform: PlatformOSType): void {\n if (platform !== 'ios' && platform !== 'android') return;\n const index = platform === 'ios' ? 0 : 1;\n for (const [element, views] of Object.entries(EXPO_UI_VIEWS)) {\n const viewName = views[index];\n if (viewName) registerExpoView(`ui-${element}`, 'ExpoUI', { view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CAClC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAwB;IAC1D,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO;IACzD,MAAM,KAAK,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,uFAAuF;QACvF,MAAM,WAAW,GAAG,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,gBAAgB,CAAC,MAAM,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC","sourcesContent":["/**\n * `@expo/ui`: real SwiftUI and Jetpack Compose views, as elements.\n *\n * This is the closest thing in the ecosystem to what this project is for. Every one of these is a\n * platform control - a real `Picker`, a real `BottomSheet`, a real `Gauge` - rather than something\n * drawn to look like one, and `@expo/ui` reaches them through `requireNativeView('ExpoUI', ...)`,\n * which is the same derivation `registerExpoView` already mirrors. So the whole surface is\n * available here for the price of a table of names.\n *\n * The element names are platform-neutral where both platforms have the control, because an app\n * should write `<ui-slider>` once. Where only one platform has it - a `Gauge` is SwiftUI's, a\n * `SearchBar` is Compose's - the element exists only there, and registering for the wrong platform\n * would be an element that commits as nothing.\n *\n * ```ts\n * registerExpoUiViews(Platform.OS);\n * ```\n * ```html\n * <ui-host style=\"height: 44\">\n * <ui-slider [value]=\"volume()\" (valueChanged)=\"volume.set($event.value)\" />\n * </ui-host>\n * ```\n *\n * **A `<ui-host>` is required around any of these.** SwiftUI and Compose lay out their own\n * subtrees, and the host view is what bridges Yoga's layout to theirs; without one the control has\n * no size and does not appear - which looks exactly like a module that failed to install.\n *\n * Names, not components. There are ninety-odd of these, each with its own props and its own\n * modifier system, and a component per view prop-for-prop would be a second place for every one of\n * them to be wrong. The module's own documentation describes the props; this makes them reachable.\n */\nimport type { PlatformOSType } from 'react-native';\nimport { registerExpoView } from './register-expo-view.ts';\n\n/** Element name -> the `ExpoUI` view on iOS and on Android. Null where the platform has no such. */\nexport const EXPO_UI_VIEWS: Readonly<Record<string, readonly [string | null, string | null]>> = {\n 'accessory-widget-background': ['AccessoryWidgetBackgroundView', null],\n alert: ['AlertView', 'AlertDialogView'],\n 'animated-visibility': [null, 'AnimatedVisibilityView'],\n 'assist-chip': [null, 'AssistChipView'],\n background: ['BackgroundView', null],\n badge: [null, 'BadgeView'],\n 'badged-box': [null, 'BadgedBoxView'],\n 'basic-alert-dialog': [null, 'BasicAlertDialogView'],\n 'bottom-sheet': ['BottomSheetView', 'ModalBottomSheetView'],\n button: ['Button', 'Button'],\n capsule: ['CapsuleView', null],\n chart: ['ChartView', null],\n checkbox: [null, 'CheckboxView'],\n circle: ['CircleView', null],\n 'color-picker': ['ColorPickerView', null],\n 'confirmation-dialog': ['ConfirmationDialogView', null],\n 'content-unavailable': ['ContentUnavailableView', null],\n 'context-menu': ['ContextMenu', null],\n 'control-group': ['ControlGroupView', null],\n 'date-picker': ['DatePickerView', 'DateTimePickerView'],\n 'date-picker-dialog': [null, 'DatePickerDialogView'],\n 'disclosure-group': ['DisclosureGroupView', null],\n divider: ['DividerView', 'HorizontalDividerView'],\n 'docked-search-bar': [null, 'DockedSearchBarView'],\n ellipse: ['EllipseView', null],\n 'exposed-dropdown-menu-box': [null, 'ExposedDropdownMenuBoxView'],\n 'filter-chip': [null, 'FilterChipView'],\n 'floating-action-button': [null, 'FloatingActionButtonView'],\n 'flow-row': [null, 'FlowRowView'],\n form: ['FormView', null],\n gauge: ['GaugeView', null],\n 'glass-effect-container': ['GlassEffectContainerView', null],\n grid: ['GridView', null],\n 'grid-row': ['GridRowView', null],\n group: ['GroupView', null],\n 'horizontal-floating-toolbar': [null, 'HorizontalFloatingToolbarView'],\n host: ['HostView', 'HostView'],\n hstack: ['HStackView', 'RowView'],\n icon: [null, 'IconView'],\n image: ['ImageView', 'ImageView'],\n 'input-chip': [null, 'InputChipView'],\n label: ['LabelView', null],\n list: ['ListView', null],\n 'labeled-content': ['LabeledContentView', null],\n 'lazy-hstack': ['LazyHStackView', 'LazyRowView'],\n 'lazy-vstack': ['LazyVStackView', 'LazyColumnView'],\n link: ['LinkView', null],\n 'list-item': [null, 'ListItemView'],\n mask: ['MaskView', null],\n menu: ['MenuView', 'DropdownMenuView'],\n 'multi-choice-segmented-button-row': [null, 'MultiChoiceSegmentedButtonRowView'],\n 'navigation-bar': [null, 'NavigationBarView'],\n 'navigation-bar-item': [null, 'NavigationBarItemView'],\n overlay: ['OverlayView', null],\n pager: [null, 'HorizontalPagerView'],\n picker: ['PickerView', null],\n 'plain-tooltip': [null, 'PlainTooltipView'],\n popover: ['PopoverView', null],\n progress: ['ProgressView', 'LinearProgressIndicatorView'],\n 'pull-to-refresh-box': [null, 'PullToRefreshBoxView'],\n 'radio-button': [null, 'RadioButtonView'],\n rectangle: ['RectangleView', null],\n 'rich-tooltip': [null, 'RichTooltipView'],\n 'rounded-rectangle': ['RoundedRectangleView', null],\n 'scroll-view-component': ['ScrollViewComponent', null],\n 'search-bar': [null, 'SearchBarView'],\n section: ['SectionView', null],\n 'secure-field': ['SecureFieldView', null],\n 'segmented-button': [null, 'SegmentedButtonView'],\n shape: [null, 'ShapeView'],\n 'share-link': ['ShareLinkView', null],\n 'single-choice-segmented-button-row': [null, 'SingleChoiceSegmentedButtonRowView'],\n slider: ['SliderView', 'SliderView'],\n /**\n * Both platforms, though it looks Android-only at a glance.\n *\n * SwiftUI's `SlotView` lives in a top-level `SlotView.tsx` rather than in a directory of its\n * own, which is how it was missed. Twenty SwiftUI components put their children through one:\n * a picker's options, a section's rows, a labelled content's value. Without it those children\n * mount into a plain `UIView` and SwiftUI refuses them, which is a red screen on iOS and an\n * empty control everywhere else.\n */\n slot: ['SlotView', 'SlotView'],\n snackbar: [null, 'SnackbarView'],\n 'snackbar-host': [null, 'SnackbarHostView'],\n spacer: ['SpacerView', 'SpacerView'],\n stepper: ['StepperView', null],\n 'suggestion-chip': [null, 'SuggestionChipView'],\n surface: [null, 'SurfaceView'],\n 'swipe-actions': ['SwipeActionsView', null],\n 'sync-toggle': ['SyncToggleView', 'SyncSwitchView'],\n tab: ['TabView', null],\n text: ['TextView', 'TextView'],\n 'text-field': ['TextFieldView', null],\n 'time-picker-dialog': [null, 'TimePickerDialogView'],\n toggle: ['ToggleView', 'SwitchView'],\n 'tooltip-box': [null, 'TooltipBoxView'],\n 'tri-state-checkbox': [null, 'TriStateCheckboxView'],\n 'uneven-rounded-rectangle': ['UnevenRoundedRectangleView', null],\n 'vertical-slider': [null, 'VerticalSliderView'],\n vstack: ['VStackView', 'ColumnView'],\n zstack: ['ZStackView', 'BoxView'],\n};\n\n/**\n * Register every `@expo/ui` view the platform has.\n *\n * All of them at once, unlike the other registrations here, because they are all one module: an\n * app that has `@expo/ui` installed has all of these, and an app that does not has none of them.\n *\n * Takes `Platform.OS` itself - `'ios' | 'android' | 'macos' | 'windows' | 'web'` - rather than the\n * two platforms `@expo/ui` actually ships for, so a canary app can pass it straight through\n * without narrowing. Anything other than iOS or Android registers nothing, the same \"not\n * installed\" outcome as never calling this at all.\n */\nexport function registerExpoUiViews(platform: PlatformOSType): void {\n if (platform !== 'ios' && platform !== 'android') return;\n const index = platform === 'ios' ? 0 : 1;\n for (const [element, views] of Object.entries(EXPO_UI_VIEWS)) {\n const viewName = views[index];\n if (!viewName) continue;\n // SwiftUI's and Compose's `Text` read their text from `text`, and take no child views.\n const textContent = element === 'text' ? 'text' : undefined;\n registerExpoView(`ui-${element}`, 'ExpoUI', { viewName, textContent });\n }\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Foldable`, bound to `expo-foldables`: the hinge of a foldable device, an iPhone Duo or an
|
|
3
|
+
* Android foldable.
|
|
4
|
+
*
|
|
5
|
+
* On a phone that does not fold, on the web and in a test, it answers like a phone: not available,
|
|
6
|
+
* `'unknown'`, no fold and no angle.
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken, type Signal } from '@angular/core';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/** How far the hinge is open. `'unknown'` without a hinge, or while the platform cannot say. */
|
|
11
|
+
export type HingePosture = 'closed' | 'partially-open' | 'fully-open' | 'unknown';
|
|
12
|
+
/** A rectangle in window coordinates, in points: measured from the window's top left corner. */
|
|
13
|
+
export interface FoldRect {
|
|
14
|
+
readonly x: number;
|
|
15
|
+
readonly y: number;
|
|
16
|
+
readonly width: number;
|
|
17
|
+
readonly height: number;
|
|
18
|
+
}
|
|
19
|
+
/** Where the fold crosses the app's window. */
|
|
20
|
+
export interface Fold {
|
|
21
|
+
/** The fold's area, in window coordinates. Zero wide or tall where the fold is a line. */
|
|
22
|
+
readonly bounds: FoldRect;
|
|
23
|
+
readonly orientation: 'horizontal' | 'vertical';
|
|
24
|
+
/** Whether the fold splits the window in two, so content should stay off it. */
|
|
25
|
+
readonly isSeparating: boolean;
|
|
26
|
+
/** `'full'` where the fold area shows nothing, as with a physical gap between two screens. */
|
|
27
|
+
readonly occlusion: 'none' | 'full';
|
|
28
|
+
}
|
|
29
|
+
/** What `expo-foldables` reports: the posture, and the fold while it crosses the window. */
|
|
30
|
+
export interface HingeState {
|
|
31
|
+
readonly posture: HingePosture;
|
|
32
|
+
readonly fold?: Fold;
|
|
33
|
+
}
|
|
34
|
+
interface Subscription {
|
|
35
|
+
remove(): void;
|
|
36
|
+
}
|
|
37
|
+
/** `expo-foldables`' `Hinge`, as `Foldable.SOURCE` provides it. A test passes a stand-in. */
|
|
38
|
+
export interface NativeHinge {
|
|
39
|
+
readonly isAvailable: boolean;
|
|
40
|
+
readonly isAngleAvailable: boolean;
|
|
41
|
+
getState(): HingeState | undefined;
|
|
42
|
+
addOnStateChangeListener(listener: (state: HingeState | undefined) => void): Subscription;
|
|
43
|
+
addOnAngleChangeListener(listener: (angle: number) => void, options?: {
|
|
44
|
+
minDeltaDegrees?: number;
|
|
45
|
+
}): Subscription;
|
|
46
|
+
}
|
|
47
|
+
export declare class Foldable {
|
|
48
|
+
static readonly SOURCE: InjectionToken<NativeHinge | null>;
|
|
49
|
+
private readonly native;
|
|
50
|
+
private readonly state;
|
|
51
|
+
private readonly angleState;
|
|
52
|
+
private angleSubscription;
|
|
53
|
+
/** Whether the device reports a hinge. It can turn true shortly after launch. */
|
|
54
|
+
readonly available: Signal<boolean>;
|
|
55
|
+
readonly posture: Signal<HingePosture>;
|
|
56
|
+
/**
|
|
57
|
+
* Where the fold crosses the window, in window coordinates: a view that does not start at the
|
|
58
|
+
* window's left edge subtracts its own offset. Null while it crosses no window, as on a closed
|
|
59
|
+
* phone's cover display.
|
|
60
|
+
*/
|
|
61
|
+
readonly fold: Signal<Fold | null>;
|
|
62
|
+
/** The hinge angle in degrees, 0 shut and 180 flat. Null without an angle sensor. */
|
|
63
|
+
readonly angle: Signal<number | null>;
|
|
64
|
+
/** Whether the fold splits the window, so content should stay off it. */
|
|
65
|
+
readonly separating: Signal<boolean>;
|
|
66
|
+
/** Half open with the fold running down the middle, like a book. */
|
|
67
|
+
readonly book: Signal<boolean>;
|
|
68
|
+
/** Half open with the fold running across, like a laptop. */
|
|
69
|
+
readonly tabletop: Signal<boolean>;
|
|
70
|
+
constructor();
|
|
71
|
+
private update;
|
|
72
|
+
private stopFollowingAngle;
|
|
73
|
+
private followAngle;
|
|
74
|
+
private halfOpen;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Foldable, never>;
|
|
76
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
package/dist/foldable.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Foldable`, bound to `expo-foldables`: the hinge of a foldable device, an iPhone Duo or an
|
|
3
|
+
* Android foldable.
|
|
4
|
+
*
|
|
5
|
+
* On a phone that does not fold, on the web and in a test, it answers like a phone: not available,
|
|
6
|
+
* `'unknown'`, no fold and no angle.
|
|
7
|
+
*/
|
|
8
|
+
import { DestroyRef, InjectionToken, Service, computed, inject, signal, } from '@angular/core';
|
|
9
|
+
import { expoModule } from "./native.js";
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export class Foldable {
|
|
12
|
+
static SOURCE = new InjectionToken('angular-native.hingeSource', {
|
|
13
|
+
factory: () => expoModule('expo-foldables', () => require('expo-foldables').Hinge),
|
|
14
|
+
});
|
|
15
|
+
native = inject(Foldable.SOURCE);
|
|
16
|
+
state = signal(undefined, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
18
|
+
angleState = signal(null, /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "angleState" }] : /* istanbul ignore next */ []));
|
|
20
|
+
angleSubscription = null;
|
|
21
|
+
/** Whether the device reports a hinge. It can turn true shortly after launch. */
|
|
22
|
+
available = computed(() => this.state() !== undefined, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "available" }] : /* istanbul ignore next */ []));
|
|
24
|
+
posture = computed(() => this.state()?.posture ?? 'unknown', /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "posture" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/**
|
|
27
|
+
* Where the fold crosses the window, in window coordinates: a view that does not start at the
|
|
28
|
+
* window's left edge subtracts its own offset. Null while it crosses no window, as on a closed
|
|
29
|
+
* phone's cover display.
|
|
30
|
+
*/
|
|
31
|
+
fold = computed(() => this.state()?.fold ?? null, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "fold" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/** The hinge angle in degrees, 0 shut and 180 flat. Null without an angle sensor. */
|
|
34
|
+
angle = this.angleState.asReadonly();
|
|
35
|
+
/** Whether the fold splits the window, so content should stay off it. */
|
|
36
|
+
separating = computed(() => this.fold()?.isSeparating ?? false, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "separating" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** Half open with the fold running down the middle, like a book. */
|
|
39
|
+
book = computed(() => this.halfOpen('vertical'), /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "book" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Half open with the fold running across, like a laptop. */
|
|
42
|
+
tabletop = computed(() => this.halfOpen('horizontal'), /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "tabletop" }] : /* istanbul ignore next */ []));
|
|
44
|
+
constructor() {
|
|
45
|
+
const native = this.native;
|
|
46
|
+
if (!native)
|
|
47
|
+
return;
|
|
48
|
+
const stateSubscription = native.addOnStateChangeListener((state) => this.update(state));
|
|
49
|
+
this.update(native.getState());
|
|
50
|
+
inject(DestroyRef).onDestroy(() => {
|
|
51
|
+
stateSubscription.remove();
|
|
52
|
+
this.angleSubscription?.remove();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
update(state) {
|
|
56
|
+
this.state.set(state);
|
|
57
|
+
if (state === undefined) {
|
|
58
|
+
this.stopFollowingAngle();
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.followAngle();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
stopFollowingAngle() {
|
|
65
|
+
this.angleSubscription?.remove();
|
|
66
|
+
this.angleSubscription = null;
|
|
67
|
+
this.angleState.set(null);
|
|
68
|
+
}
|
|
69
|
+
followAngle() {
|
|
70
|
+
const native = this.native;
|
|
71
|
+
if (!native || this.angleSubscription || !native.isAngleAvailable)
|
|
72
|
+
return;
|
|
73
|
+
this.angleSubscription = native.addOnAngleChangeListener((angle) => this.angleState.set(angle), { minDeltaDegrees: 0.5 });
|
|
74
|
+
}
|
|
75
|
+
halfOpen(orientation) {
|
|
76
|
+
const fold = this.fold();
|
|
77
|
+
return (this.posture() === 'partially-open' &&
|
|
78
|
+
fold?.isSeparating === true &&
|
|
79
|
+
fold.orientation === orientation);
|
|
80
|
+
}
|
|
81
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Foldable, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
82
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: Foldable });
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Foldable, decorators: [{
|
|
85
|
+
type: Service
|
|
86
|
+
}], ctorParameters: () => [] });
|
|
87
|
+
//# sourceMappingURL=foldable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foldable.js","sourceRoot":"","sources":["../src/foldable.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,MAAM,EACN,MAAM,GAEP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;;AA+CzC,MAAM,OAAO,QAAQ;IACnB,MAAM,CAAU,MAAM,GAAG,IAAI,cAAc,CAAqB,4BAA4B,EAAE;QAC5F,OAAO,EAAE,GAAG,EAAE,CACZ,UAAU,CACR,gBAAgB,EAChB,GAAG,EAAE,CAAE,OAAO,CAAC,gBAAgB,CAA4B,CAAC,KAAK,CAClE;KACJ,CAAC,CAAC;IAEc,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,KAAK,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BADpB,OAAO","sourcesContent":["/**\n * `Foldable`, bound to `expo-foldables`: the hinge of a foldable device, an iPhone Duo or an\n * Android foldable.\n *\n * On a phone that does not fold, on the web and in a test, it answers like a phone: not available,\n * `'unknown'`, no fold and no angle.\n */\nimport {\n DestroyRef,\n InjectionToken,\n Service,\n computed,\n inject,\n signal,\n type Signal,\n} from '@angular/core';\nimport { expoModule } from './native.ts';\n\n/** How far the hinge is open. `'unknown'` without a hinge, or while the platform cannot say. */\nexport type HingePosture = 'closed' | 'partially-open' | 'fully-open' | 'unknown';\n\n/** A rectangle in window coordinates, in points: measured from the window's top left corner. */\nexport interface FoldRect {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** Where the fold crosses the app's window. */\nexport interface Fold {\n /** The fold's area, in window coordinates. Zero wide or tall where the fold is a line. */\n readonly bounds: FoldRect;\n readonly orientation: 'horizontal' | 'vertical';\n /** Whether the fold splits the window in two, so content should stay off it. */\n readonly isSeparating: boolean;\n /** `'full'` where the fold area shows nothing, as with a physical gap between two screens. */\n readonly occlusion: 'none' | 'full';\n}\n\n/** What `expo-foldables` reports: the posture, and the fold while it crosses the window. */\nexport interface HingeState {\n readonly posture: HingePosture;\n readonly fold?: Fold;\n}\n\ninterface Subscription {\n remove(): void;\n}\n\n/** `expo-foldables`' `Hinge`, as `Foldable.SOURCE` provides it. A test passes a stand-in. */\nexport interface NativeHinge {\n readonly isAvailable: boolean;\n readonly isAngleAvailable: boolean;\n getState(): HingeState | undefined;\n addOnStateChangeListener(listener: (state: HingeState | undefined) => void): Subscription;\n addOnAngleChangeListener(\n listener: (angle: number) => void,\n options?: { minDeltaDegrees?: number },\n ): Subscription;\n}\n\n@Service()\nexport class Foldable {\n static readonly SOURCE = new InjectionToken<NativeHinge | null>('angular-native.hingeSource', {\n factory: () =>\n expoModule(\n 'expo-foldables',\n () => (require('expo-foldables') as { Hinge: NativeHinge }).Hinge,\n ),\n });\n\n private readonly native = inject(Foldable.SOURCE);\n private readonly state = signal<HingeState | undefined>(undefined);\n private readonly angleState = signal<number | null>(null);\n private angleSubscription: Subscription | null = null;\n\n /** Whether the device reports a hinge. It can turn true shortly after launch. */\n readonly available: Signal<boolean> = computed(() => this.state() !== undefined);\n readonly posture: Signal<HingePosture> = computed(() => this.state()?.posture ?? 'unknown');\n /**\n * Where the fold crosses the window, in window coordinates: a view that does not start at the\n * window's left edge subtracts its own offset. Null while it crosses no window, as on a closed\n * phone's cover display.\n */\n readonly fold: Signal<Fold | null> = computed(() => this.state()?.fold ?? null);\n /** The hinge angle in degrees, 0 shut and 180 flat. Null without an angle sensor. */\n readonly angle: Signal<number | null> = this.angleState.asReadonly();\n /** Whether the fold splits the window, so content should stay off it. */\n readonly separating: Signal<boolean> = computed(() => this.fold()?.isSeparating ?? false);\n /** Half open with the fold running down the middle, like a book. */\n readonly book: Signal<boolean> = computed(() => this.halfOpen('vertical'));\n /** Half open with the fold running across, like a laptop. */\n readonly tabletop: Signal<boolean> = computed(() => this.halfOpen('horizontal'));\n\n constructor() {\n const native = this.native;\n if (!native) return;\n const stateSubscription = native.addOnStateChangeListener((state) => this.update(state));\n this.update(native.getState());\n inject(DestroyRef).onDestroy(() => {\n stateSubscription.remove();\n this.angleSubscription?.remove();\n });\n }\n\n private update(state: HingeState | undefined): void {\n this.state.set(state);\n if (state === undefined) {\n this.stopFollowingAngle();\n } else {\n this.followAngle();\n }\n }\n\n private stopFollowingAngle(): void {\n this.angleSubscription?.remove();\n this.angleSubscription = null;\n this.angleState.set(null);\n }\n\n private followAngle(): void {\n const native = this.native;\n if (!native || this.angleSubscription || !native.isAngleAvailable) return;\n this.angleSubscription = native.addOnAngleChangeListener(\n (angle) => this.angleState.set(angle),\n { minDeltaDegrees: 0.5 },\n );\n }\n\n private halfOpen(orientation: Fold['orientation']): boolean {\n const fold = this.fold();\n return (\n this.posture() === 'partially-open' &&\n fold?.isSeparating === true &&\n fold.orientation === orientation\n );\n }\n}\n"]}
|
package/dist/fonts.d.ts
CHANGED
|
@@ -88,5 +88,8 @@ export type Fonts = FontRegistry;
|
|
|
88
88
|
* Register every face the given sheets declare, before the app mounts.
|
|
89
89
|
*
|
|
90
90
|
* A function rather than a service because that is when it is needed: there is no injector yet.
|
|
91
|
+
*
|
|
92
|
+
* A missing `expo-font` rejects the promise rather than throwing, so a caller's `.catch` can mount
|
|
93
|
+
* the app in the fallback face. Sheets that declare no face resolve without reaching for it.
|
|
91
94
|
*/
|
|
92
95
|
export declare function loadFonts(...sheets: readonly (SheetWithFonts | null | undefined)[]): Promise<void>;
|
package/dist/fonts.js
CHANGED
|
@@ -125,8 +125,13 @@ export const Fonts = new InjectionToken('angular-native.fonts', {
|
|
|
125
125
|
* Register every face the given sheets declare, before the app mounts.
|
|
126
126
|
*
|
|
127
127
|
* A function rather than a service because that is when it is needed: there is no injector yet.
|
|
128
|
+
*
|
|
129
|
+
* A missing `expo-font` rejects the promise rather than throwing, so a caller's `.catch` can mount
|
|
130
|
+
* the app in the fallback face. Sheets that declare no face resolve without reaching for it.
|
|
128
131
|
*/
|
|
129
|
-
export function loadFonts(...sheets) {
|
|
130
|
-
|
|
132
|
+
export async function loadFonts(...sheets) {
|
|
133
|
+
if (!sheets.some((sheet) => sheet?.fonts?.length))
|
|
134
|
+
return;
|
|
135
|
+
await new FontRegistry(expoFonts()).loadSheet(...sheets);
|
|
131
136
|
}
|
|
132
137
|
//# sourceMappingURL=fonts.js.map
|
package/dist/fonts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../src/fonts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuBzC;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,EAAE,KAAK,EAAE,MAAM,CAAC;QAAE,OAAO;IAC1D,MAAM,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["/**\n * `Fonts`, bound to `expo-font`.\n *\n * A font on a phone is not fetched when the text engine first needs it. It has to be registered\n * with the platform up front, or the first paint is in the fallback face and reflows when the\n * real one lands - which is why the interesting call here is the one an app makes *before* it\n * mounts:\n *\n * ```ts\n * import { loadFonts } from '@ng-native/expo/fonts';\n *\n * await loadFonts(styleSheetOf(GlobalStyles));\n * mount(rootTag, App, getFabricUIManager(), { globalStyles: styleSheetOf(GlobalStyles) });\n * ```\n *\n * The class takes its platform rather than injecting it, because that call happens before there\n * is an injector to inject from. `inject(Fonts)` is for a screen that wants to ask what loaded.\n *\n * Unlike the other services here this goes through `expo-font`'s JavaScript rather than its\n * native module: the module takes descriptors the JS builds out of an asset, and rebuilding them\n * here would be copying out its internals rather than using it.\n */\nimport { InjectionToken, computed, signal, type Signal } from '@angular/core';\nimport { faceName, fontsRegistered } from '@ng-native/fabric';\nimport { expoModule } from './native.ts';\n\n/** A face a stylesheet declared, as the compiler collected it. */\nexport interface FontFace {\n readonly family: string;\n /** What `require('./Inter.ttf')` returned: an asset id, or a module the bundler resolved. */\n readonly source: unknown;\n readonly weight?: number;\n readonly style?: string;\n}\n\n/** Just enough of a compiled stylesheet to find the faces in it. */\nexport interface SheetWithFonts {\n readonly fonts?: readonly FontFace[];\n}\n\n/** The slice of `expo-font` this needs. */\nexport interface NativeFonts {\n loadAsync(map: Record<string, unknown>): Promise<void>;\n isLoaded(family: string): boolean;\n getLoadedFonts(): string[];\n}\n\n/**\n * Loading is by family name, which is also all native matches on.\n *\n * There is no weight matching on a device: `font-family: Inter` finds the face registered under\n * exactly that name, and a bold cut is a family of its own. A face that declares a weight or a\n * style is therefore registered under a composed name as well (`Inter-700`, `Inter-italic`,\n * `Inter-700-italic`), which is the name the engine points a matching text at.\n *\n * A face with both a weight and a style also answers to each alone, as it did before it had a\n * name of its own, but only where no face declared exactly that.\n */\nexport function registrationsFor(faces: readonly FontFace[]): Record<string, unknown> {\n const map: Record<string, unknown> = {};\n for (const face of faces) {\n map[face.family] ??= face.source;\n map[faceName(face)] = face.source;\n }\n for (const face of faces) {\n if (face.weight === undefined || !face.style) continue;\n map[`${face.family}-${face.weight}`] ??= face.source;\n map[`${face.family}-${face.style}`] ??= face.source;\n }\n return map;\n}\n\nexport function expoFonts(): NativeFonts | null {\n const expo = expoModule('expo-font', () => require('expo-font') as typeof import('expo-font'));\n if (!expo) return null;\n return {\n loadAsync: (map) => expo.loadAsync(map as Parameters<typeof expo.loadAsync>[0]),\n isLoaded: (family) => expo.isLoaded(family),\n getLoadedFonts: () => expo.getLoadedFonts(),\n };\n}\n\nexport class FontRegistry {\n private readonly native: NativeFonts | null;\n /**\n * Bumped whenever faces are registered.\n *\n * The platform's own list is a plain array that changes underneath us, so a template binding to\n * it would render once and never again - and the one moment it changes is exactly the moment a\n * screen waiting on a font wants to hear about. This makes both readers reactive without\n * mirroring the list.\n */\n private readonly generation = signal(0);\n\n constructor(native: NativeFonts | null) {\n this.native = native;\n }\n\n /** Whether `expo-font` is installed at all. Without it a custom face simply never appears. */\n get available(): boolean {\n return this.native !== null;\n }\n\n /** Every family the platform can currently find, custom or bundled. */\n readonly families: Signal<readonly string[]> = computed(() => {\n this.generation();\n return this.native?.getLoadedFonts() ?? [];\n });\n\n /** Whether a family is registered. Reactive: re-read after a `load` that adds one. */\n has(family: string): boolean {\n this.generation();\n return this.native?.isLoaded(family) ?? false;\n }\n\n /**\n * Register every `@font-face` a compiled sheet declares.\n *\n * Called before `mount` in an app that uses one. Text laid out before a face registers is in\n * the fallback face until it does, and is laid out again then. Sheets with no faces resolve\n * immediately, so calling it unconditionally at bootstrap costs nothing.\n */\n async loadSheet(...sheets: readonly (SheetWithFonts | null | undefined)[]): Promise<void> {\n const faces = sheets.flatMap((sheet) => [...(sheet?.fonts ?? [])]);\n if (!faces.length) return;\n await this.load(registrationsFor(faces));\n }\n\n /** Register faces by name, for a font that did not come from a stylesheet. */\n async load(map: Record<string, unknown>): Promise<void> {\n const native = this.native;\n if (!native) return;\n try {\n await native.loadAsync(map);\n } finally {\n // Text already laid out in the fallback face keeps it until it is laid out again. Only the\n // faces that registered: one failing fails the whole load, not the others in it.\n fontsRegistered(Object.keys(map).filter((family) => native.isLoaded(family)));\n }\n this.generation.update((n) => n + 1);\n }\n}\n\n/** Injected where an app wants to ask what is loaded. */\nexport const Fonts = new InjectionToken<FontRegistry>('angular-native.fonts', {\n factory: () => new FontRegistry(expoFonts()),\n});\nexport type Fonts = FontRegistry;\n\n/**\n * Register every face the given sheets declare, before the app mounts.\n *\n * A function rather than a service because that is when it is needed: there is no injector yet.\n *\n * A missing `expo-font` rejects the promise rather than throwing, so a caller's `.catch` can mount\n * the app in the fallback face. Sheets that declare no face resolve without reaching for it.\n */\nexport async function loadFonts(\n ...sheets: readonly (SheetWithFonts | null | undefined)[]\n): Promise<void> {\n if (!sheets.some((sheet) => sheet?.fonts?.length)) return;\n await new FontRegistry(expoFonts()).loadSheet(...sheets);\n}\n"]}
|