@ng-native/expo 0.0.1 → 0.1.1
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/LICENSE +21 -0
- package/README.md +413 -1
- package/dist/app-info.d.ts +58 -0
- package/dist/app-info.js +71 -0
- package/dist/app-info.js.map +1 -0
- package/dist/apple-sign-in-button.d.ts +16 -0
- package/dist/apple-sign-in-button.js +55 -0
- package/dist/apple-sign-in-button.js.map +1 -0
- package/dist/apple-sign-in.d.ts +68 -0
- package/dist/apple-sign-in.js +120 -0
- package/dist/apple-sign-in.js.map +1 -0
- package/dist/assets.d.ts +24 -0
- package/dist/assets.js +47 -0
- package/dist/assets.js.map +1 -0
- package/dist/background-task.d.ts +66 -0
- package/dist/background-task.js +82 -0
- package/dist/background-task.js.map +1 -0
- package/dist/battery.d.ts +46 -0
- package/dist/battery.js +76 -0
- package/dist/battery.js.map +1 -0
- package/dist/biometrics.d.ts +45 -0
- package/dist/biometrics.js +53 -0
- package/dist/biometrics.js.map +1 -0
- package/dist/brightness.d.ts +38 -0
- package/dist/brightness.js +81 -0
- package/dist/brightness.js.map +1 -0
- package/dist/browser.d.ts +42 -0
- package/dist/browser.js +42 -0
- package/dist/browser.js.map +1 -0
- package/dist/camera.d.ts +48 -0
- package/dist/camera.js +59 -0
- package/dist/camera.js.map +1 -0
- package/dist/clipboard.d.ts +43 -0
- package/dist/clipboard.js +60 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/community-views.d.ts +14 -0
- package/dist/community-views.js +76 -0
- package/dist/community-views.js.map +1 -0
- package/dist/crypto.d.ts +56 -0
- package/dist/crypto.js +84 -0
- package/dist/crypto.js.map +1 -0
- package/dist/database.d.ts +47 -0
- package/dist/database.js +108 -0
- package/dist/database.js.map +1 -0
- package/dist/document-picker.d.ts +34 -0
- package/dist/document-picker.js +40 -0
- package/dist/document-picker.js.map +1 -0
- package/dist/dom-component.d.ts +87 -0
- package/dist/dom-component.js +139 -0
- package/dist/dom-component.js.map +1 -0
- package/dist/expo-image.d.ts +33 -0
- package/dist/expo-image.js +57 -0
- package/dist/expo-image.js.map +1 -0
- package/dist/expo-ui-components.d.ts +327 -0
- package/dist/expo-ui-components.js +707 -0
- package/dist/expo-ui-components.js.map +1 -0
- package/dist/expo-ui.d.ts +46 -0
- package/dist/expo-ui.js +128 -0
- package/dist/expo-ui.js.map +1 -0
- package/dist/file-system.d.ts +63 -0
- package/dist/file-system.js +67 -0
- package/dist/file-system.js.map +1 -0
- package/dist/fonts.d.ts +90 -0
- package/dist/fonts.js +118 -0
- package/dist/fonts.js.map +1 -0
- package/dist/glass.d.ts +33 -0
- package/dist/glass.js +72 -0
- package/dist/glass.js.map +1 -0
- package/dist/haptics.d.ts +49 -0
- package/dist/haptics.js +64 -0
- package/dist/haptics.js.map +1 -0
- package/dist/image-editor.d.ts +62 -0
- package/dist/image-editor.js +101 -0
- package/dist/image-editor.js.map +1 -0
- package/dist/image-picker.d.ts +49 -0
- package/dist/image-picker.js +58 -0
- package/dist/image-picker.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/keep-awake.d.ts +39 -0
- package/dist/keep-awake.js +80 -0
- package/dist/keep-awake.js.map +1 -0
- package/dist/language-model.d.ts +129 -0
- package/dist/language-model.js +225 -0
- package/dist/language-model.js.map +1 -0
- package/dist/locale.d.ts +51 -0
- package/dist/locale.js +78 -0
- package/dist/locale.js.map +1 -0
- package/dist/location.d.ts +68 -0
- package/dist/location.js +83 -0
- package/dist/location.js.map +1 -0
- package/dist/map-view.d.ts +203 -0
- package/dist/map-view.js +184 -0
- package/dist/map-view.js.map +1 -0
- package/dist/media-library.d.ts +103 -0
- package/dist/media-library.js +160 -0
- package/dist/media-library.js.map +1 -0
- package/dist/native-state.d.ts +22 -0
- package/dist/native-state.js +43 -0
- package/dist/native-state.js.map +1 -0
- package/dist/native.d.ts +42 -0
- package/dist/native.js +73 -0
- package/dist/native.js.map +1 -0
- package/dist/network.d.ts +35 -0
- package/dist/network.js +60 -0
- package/dist/network.js.map +1 -0
- package/dist/notifications.d.ts +175 -0
- package/dist/notifications.js +296 -0
- package/dist/notifications.js.map +1 -0
- package/dist/observed.d.ts +37 -0
- package/dist/observed.js +55 -0
- package/dist/observed.js.map +1 -0
- package/dist/orientation.d.ts +35 -0
- package/dist/orientation.js +78 -0
- package/dist/orientation.js.map +1 -0
- package/dist/permissions.d.ts +54 -0
- package/dist/permissions.js +72 -0
- package/dist/permissions.js.map +1 -0
- package/dist/player.d.ts +92 -0
- package/dist/player.js +141 -0
- package/dist/player.js.map +1 -0
- package/dist/register-expo-view.d.ts +55 -0
- package/dist/register-expo-view.js +110 -0
- package/dist/register-expo-view.js.map +1 -0
- package/dist/screen-capture.d.ts +58 -0
- package/dist/screen-capture.js +78 -0
- package/dist/screen-capture.js.map +1 -0
- package/dist/segmented-control.d.ts +32 -0
- package/dist/segmented-control.js +55 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/sensors.d.ts +85 -0
- package/dist/sensors.js +115 -0
- package/dist/sensors.js.map +1 -0
- package/dist/splash-screen.d.ts +73 -0
- package/dist/splash-screen.js +115 -0
- package/dist/splash-screen.js.map +1 -0
- package/dist/store-review.d.ts +43 -0
- package/dist/store-review.js +52 -0
- package/dist/store-review.js.map +1 -0
- package/dist/store.d.ts +108 -0
- package/dist/store.js +247 -0
- package/dist/store.js.map +1 -0
- package/dist/symbol.d.ts +36 -0
- package/dist/symbol.js +69 -0
- package/dist/symbol.js.map +1 -0
- package/dist/tracking.d.ts +45 -0
- package/dist/tracking.js +54 -0
- package/dist/tracking.js.map +1 -0
- package/dist/transforms.d.ts +2 -0
- package/dist/transforms.js +13 -0
- package/dist/transforms.js.map +1 -0
- package/dist/updates.d.ts +61 -0
- package/dist/updates.js +97 -0
- package/dist/updates.js.map +1 -0
- package/package.json +397 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-ui-components.js","sour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AAI,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"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@expo/ui`: real SwiftUI and Jetpack Compose views, as elements.
|
|
3
|
+
*
|
|
4
|
+
* This is the closest thing in the ecosystem to what this project is for. Every one of these is a
|
|
5
|
+
* platform control - a real `Picker`, a real `BottomSheet`, a real `Gauge` - rather than something
|
|
6
|
+
* drawn to look like one, and `@expo/ui` reaches them through `requireNativeView('ExpoUI', ...)`,
|
|
7
|
+
* which is the same derivation `registerExpoView` already mirrors. So the whole surface is
|
|
8
|
+
* available here for the price of a table of names.
|
|
9
|
+
*
|
|
10
|
+
* The element names are platform-neutral where both platforms have the control, because an app
|
|
11
|
+
* should write `<ui-slider>` once. Where only one platform has it - a `Gauge` is SwiftUI's, a
|
|
12
|
+
* `SearchBar` is Compose's - the element exists only there, and registering for the wrong platform
|
|
13
|
+
* would be an element that commits as nothing.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* registerExpoUiViews(Platform.OS);
|
|
17
|
+
* ```
|
|
18
|
+
* ```html
|
|
19
|
+
* <ui-host style="height: 44">
|
|
20
|
+
* <ui-slider [value]="volume()" (valueChanged)="volume.set($event.value)" />
|
|
21
|
+
* </ui-host>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* **A `<ui-host>` is required around any of these.** SwiftUI and Compose lay out their own
|
|
25
|
+
* subtrees, and the host view is what bridges Yoga's layout to theirs; without one the control has
|
|
26
|
+
* no size and does not appear - which looks exactly like a module that failed to install.
|
|
27
|
+
*
|
|
28
|
+
* Names, not components. There are ninety-odd of these, each with its own props and its own
|
|
29
|
+
* modifier system, and a component per view prop-for-prop would be a second place for every one of
|
|
30
|
+
* them to be wrong. The module's own documentation describes the props; this makes them reachable.
|
|
31
|
+
*/
|
|
32
|
+
import type { PlatformOSType } from 'react-native';
|
|
33
|
+
/** Element name -> the `ExpoUI` view on iOS and on Android. Null where the platform has no such. */
|
|
34
|
+
export declare const EXPO_UI_VIEWS: Readonly<Record<string, readonly [string | null, string | null]>>;
|
|
35
|
+
/**
|
|
36
|
+
* Register every `@expo/ui` view the platform has.
|
|
37
|
+
*
|
|
38
|
+
* All of them at once, unlike the other registrations here, because they are all one module: an
|
|
39
|
+
* app that has `@expo/ui` installed has all of these, and an app that does not has none of them.
|
|
40
|
+
*
|
|
41
|
+
* Takes `Platform.OS` itself - `'ios' | 'android' | 'macos' | 'windows' | 'web'` - rather than the
|
|
42
|
+
* two platforms `@expo/ui` actually ships for, so a canary app can pass it straight through
|
|
43
|
+
* without narrowing. Anything other than iOS or Android registers nothing, the same "not
|
|
44
|
+
* installed" outcome as never calling this at all.
|
|
45
|
+
*/
|
|
46
|
+
export declare function registerExpoUiViews(platform: PlatformOSType): void;
|
package/dist/expo-ui.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { registerExpoView } from "./register-expo-view.js";
|
|
2
|
+
/** Element name -> the `ExpoUI` view on iOS and on Android. Null where the platform has no such. */
|
|
3
|
+
export const EXPO_UI_VIEWS = {
|
|
4
|
+
'accessory-widget-background': ['AccessoryWidgetBackgroundView', null],
|
|
5
|
+
alert: ['AlertView', 'AlertDialogView'],
|
|
6
|
+
'animated-visibility': [null, 'AnimatedVisibilityView'],
|
|
7
|
+
'assist-chip': [null, 'AssistChipView'],
|
|
8
|
+
background: ['BackgroundView', null],
|
|
9
|
+
badge: [null, 'BadgeView'],
|
|
10
|
+
'badged-box': [null, 'BadgedBoxView'],
|
|
11
|
+
'basic-alert-dialog': [null, 'BasicAlertDialogView'],
|
|
12
|
+
'bottom-sheet': ['BottomSheetView', 'ModalBottomSheetView'],
|
|
13
|
+
button: ['Button', null],
|
|
14
|
+
capsule: ['CapsuleView', null],
|
|
15
|
+
chart: ['ChartView', null],
|
|
16
|
+
checkbox: [null, 'CheckboxView'],
|
|
17
|
+
circle: ['CircleView', null],
|
|
18
|
+
'color-picker': ['ColorPickerView', null],
|
|
19
|
+
'confirmation-dialog': ['ConfirmationDialogView', null],
|
|
20
|
+
'content-unavailable': ['ContentUnavailableView', null],
|
|
21
|
+
'context-menu': ['ContextMenu', null],
|
|
22
|
+
'control-group': ['ControlGroupView', null],
|
|
23
|
+
'date-picker': ['DatePickerView', 'DateTimePickerView'],
|
|
24
|
+
'date-picker-dialog': [null, 'DatePickerDialogView'],
|
|
25
|
+
'disclosure-group': ['DisclosureGroupView', null],
|
|
26
|
+
divider: ['DividerView', null],
|
|
27
|
+
'docked-search-bar': [null, 'DockedSearchBarView'],
|
|
28
|
+
ellipse: ['EllipseView', null],
|
|
29
|
+
'exposed-dropdown-menu-box': [null, 'ExposedDropdownMenuBoxView'],
|
|
30
|
+
'filter-chip': [null, 'FilterChipView'],
|
|
31
|
+
'floating-action-button': [null, 'FloatingActionButtonView'],
|
|
32
|
+
'flow-row': [null, 'FlowRowView'],
|
|
33
|
+
form: ['FormView', null],
|
|
34
|
+
gauge: ['GaugeView', null],
|
|
35
|
+
'glass-effect-container': ['GlassEffectContainerView', null],
|
|
36
|
+
grid: ['GridView', null],
|
|
37
|
+
'grid-row': ['GridRowView', null],
|
|
38
|
+
group: ['GroupView', null],
|
|
39
|
+
'horizontal-floating-toolbar': [null, 'HorizontalFloatingToolbarView'],
|
|
40
|
+
host: ['HostView', 'RNHostView'],
|
|
41
|
+
hstack: ['HStackView', 'RowView'],
|
|
42
|
+
icon: [null, 'IconView'],
|
|
43
|
+
image: ['ImageView', 'ImageView'],
|
|
44
|
+
'input-chip': [null, 'InputChipView'],
|
|
45
|
+
label: ['LabelView', null],
|
|
46
|
+
list: ['ListView', null],
|
|
47
|
+
'labeled-content': ['LabeledContentView', null],
|
|
48
|
+
'lazy-hstack': ['LazyHStackView', 'LazyRowView'],
|
|
49
|
+
'lazy-vstack': ['LazyVStackView', 'LazyColumnView'],
|
|
50
|
+
link: ['LinkView', null],
|
|
51
|
+
'list-item': [null, 'ListItemView'],
|
|
52
|
+
mask: ['MaskView', null],
|
|
53
|
+
menu: ['MenuView', 'DropdownMenuView'],
|
|
54
|
+
'multi-choice-segmented-button-row': [null, 'MultiChoiceSegmentedButtonRowView'],
|
|
55
|
+
'navigation-bar': [null, 'NavigationBarView'],
|
|
56
|
+
'navigation-bar-item': [null, 'NavigationBarItemView'],
|
|
57
|
+
overlay: ['OverlayView', null],
|
|
58
|
+
pager: [null, 'HorizontalPagerView'],
|
|
59
|
+
picker: ['PickerView', null],
|
|
60
|
+
'plain-tooltip': [null, 'PlainTooltipView'],
|
|
61
|
+
popover: ['PopoverView', null],
|
|
62
|
+
progress: ['ProgressView', null],
|
|
63
|
+
'pull-to-refresh-box': [null, 'PullToRefreshBoxView'],
|
|
64
|
+
'radio-button': [null, 'RadioButtonView'],
|
|
65
|
+
rectangle: ['RectangleView', null],
|
|
66
|
+
'rich-tooltip': [null, 'RichTooltipView'],
|
|
67
|
+
'rounded-rectangle': ['RoundedRectangleView', null],
|
|
68
|
+
'scroll-view-component': ['ScrollViewComponent', null],
|
|
69
|
+
'search-bar': [null, 'SearchBarView'],
|
|
70
|
+
section: ['SectionView', null],
|
|
71
|
+
'secure-field': ['SecureFieldView', null],
|
|
72
|
+
'segmented-button': [null, 'SegmentedButtonView'],
|
|
73
|
+
shape: [null, 'ShapeView'],
|
|
74
|
+
'share-link': ['ShareLinkView', null],
|
|
75
|
+
'single-choice-segmented-button-row': [null, 'SingleChoiceSegmentedButtonRowView'],
|
|
76
|
+
slider: ['SliderView', 'SliderView'],
|
|
77
|
+
/**
|
|
78
|
+
* Both platforms, though it looks Android-only at a glance.
|
|
79
|
+
*
|
|
80
|
+
* SwiftUI's `SlotView` lives in a top-level `SlotView.tsx` rather than in a directory of its
|
|
81
|
+
* own, which is how it was missed. Twenty SwiftUI components put their children through one:
|
|
82
|
+
* a picker's options, a section's rows, a labelled content's value. Without it those children
|
|
83
|
+
* mount into a plain `UIView` and SwiftUI refuses them, which is a red screen on iOS and an
|
|
84
|
+
* empty control everywhere else.
|
|
85
|
+
*/
|
|
86
|
+
slot: ['SlotView', 'SlotView'],
|
|
87
|
+
snackbar: [null, 'SnackbarView'],
|
|
88
|
+
'snackbar-host': [null, 'SnackbarHostView'],
|
|
89
|
+
spacer: ['SpacerView', 'SpacerView'],
|
|
90
|
+
stepper: ['StepperView', null],
|
|
91
|
+
'suggestion-chip': [null, 'SuggestionChipView'],
|
|
92
|
+
surface: [null, 'SurfaceView'],
|
|
93
|
+
'swipe-actions': ['SwipeActionsView', null],
|
|
94
|
+
'sync-toggle': ['SyncToggleView', 'SyncSwitchView'],
|
|
95
|
+
tab: ['TabView', null],
|
|
96
|
+
text: ['TextView', 'TextView'],
|
|
97
|
+
'text-field': ['TextFieldView', null],
|
|
98
|
+
'time-picker-dialog': [null, 'TimePickerDialogView'],
|
|
99
|
+
toggle: ['ToggleView', 'SwitchView'],
|
|
100
|
+
'tooltip-box': [null, 'TooltipBoxView'],
|
|
101
|
+
'tri-state-checkbox': [null, 'TriStateCheckboxView'],
|
|
102
|
+
'uneven-rounded-rectangle': ['UnevenRoundedRectangleView', null],
|
|
103
|
+
'vertical-slider': [null, 'VerticalSliderView'],
|
|
104
|
+
vstack: ['VStackView', 'ColumnView'],
|
|
105
|
+
zstack: ['ZStackView', 'BoxView'],
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Register every `@expo/ui` view the platform has.
|
|
109
|
+
*
|
|
110
|
+
* All of them at once, unlike the other registrations here, because they are all one module: an
|
|
111
|
+
* app that has `@expo/ui` installed has all of these, and an app that does not has none of them.
|
|
112
|
+
*
|
|
113
|
+
* Takes `Platform.OS` itself - `'ios' | 'android' | 'macos' | 'windows' | 'web'` - rather than the
|
|
114
|
+
* two platforms `@expo/ui` actually ships for, so a canary app can pass it straight through
|
|
115
|
+
* without narrowing. Anything other than iOS or Android registers nothing, the same "not
|
|
116
|
+
* installed" outcome as never calling this at all.
|
|
117
|
+
*/
|
|
118
|
+
export function registerExpoUiViews(platform) {
|
|
119
|
+
if (platform !== 'ios' && platform !== 'android')
|
|
120
|
+
return;
|
|
121
|
+
const index = platform === 'ios' ? 0 : 1;
|
|
122
|
+
for (const [element, views] of Object.entries(EXPO_UI_VIEWS)) {
|
|
123
|
+
const viewName = views[index];
|
|
124
|
+
if (viewName)
|
|
125
|
+
registerExpoView(`ui-${element}`, 'ExpoUI', { viewName });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=expo-ui.js.map
|
|
@@ -0,0 +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,aAA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AAC,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', { viewName });\n }\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `FileSystem`, bound to `expo-file-system`.
|
|
3
|
+
*
|
|
4
|
+
* Files located by what they are for rather than by path. `File` and `Paths` are Expo's own
|
|
5
|
+
* classes over a native one, so they are used as published; this only decides which directory a
|
|
6
|
+
* name lands in and hands the file back.
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken } from '@angular/core';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
/**
|
|
11
|
+
* A file. Structural on purpose: this is Expo's `File`, described in terms a test can satisfy, so
|
|
12
|
+
* a fake needs no Expo. An app gets the real object back and may use the rest of its surface.
|
|
13
|
+
*/
|
|
14
|
+
export interface NativeFile {
|
|
15
|
+
readonly uri: string;
|
|
16
|
+
readonly exists: boolean;
|
|
17
|
+
readonly size: number;
|
|
18
|
+
create(options?: {
|
|
19
|
+
overwrite?: boolean;
|
|
20
|
+
intermediates?: boolean;
|
|
21
|
+
}): void;
|
|
22
|
+
write(content: string | Uint8Array): void;
|
|
23
|
+
text(): Promise<string>;
|
|
24
|
+
textSync(): string;
|
|
25
|
+
/** The contents as bytes: a PDF, an image, anything that is not text. */
|
|
26
|
+
bytes(): Promise<Uint8Array>;
|
|
27
|
+
delete(): void;
|
|
28
|
+
}
|
|
29
|
+
/** A directory, as far as this needs to know: something a file can be named inside. */
|
|
30
|
+
export type NativeDirectory = object;
|
|
31
|
+
/** The slice of `expo-file-system` this needs. */
|
|
32
|
+
export interface NativeFiles {
|
|
33
|
+
/** Cleared by the system under storage pressure. */
|
|
34
|
+
readonly cacheDirectory: NativeDirectory;
|
|
35
|
+
/** Survives, and is backed up. */
|
|
36
|
+
readonly documentDirectory: NativeDirectory;
|
|
37
|
+
file(directory: NativeDirectory, name: string): NativeFile;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The two directories an app actually chooses between, plus the create-then-write dance that
|
|
41
|
+
* writing a file for the first time needs.
|
|
42
|
+
*
|
|
43
|
+
* ponytail: a locator, not a file API. Everything else - moving, listing, downloading, streaming
|
|
44
|
+
* - is on the object this hands back, documented by Expo, and not worth restating here.
|
|
45
|
+
*/
|
|
46
|
+
export declare class FileSystem {
|
|
47
|
+
/** Overridden in a test to write files that are not on a disk. */
|
|
48
|
+
static readonly SOURCE: InjectionToken<NativeFiles | null>;
|
|
49
|
+
private readonly native;
|
|
50
|
+
/** A file the system may delete when the device runs low on storage. */
|
|
51
|
+
cache(name: string): NativeFile;
|
|
52
|
+
/** A file that survives, and is included in backups. */
|
|
53
|
+
document(name: string): NativeFile;
|
|
54
|
+
/**
|
|
55
|
+
* Write text, or bytes for anything that is not text, whether or not the file is there already.
|
|
56
|
+
* `write` alone throws on a file that has never been created, which is the first thing everyone
|
|
57
|
+
* hits. It replaces what was there.
|
|
58
|
+
*/
|
|
59
|
+
write(file: NativeFile, content: string | Uint8Array): void;
|
|
60
|
+
private file;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileSystem, never>;
|
|
62
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
63
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `FileSystem`, bound to `expo-file-system`.
|
|
3
|
+
*
|
|
4
|
+
* Files located by what they are for rather than by path. `File` and `Paths` are Expo's own
|
|
5
|
+
* classes over a native one, so they are used as published; this only decides which directory a
|
|
6
|
+
* name lands in and hands the file back.
|
|
7
|
+
*/
|
|
8
|
+
import { InjectionToken, Service, inject } from '@angular/core';
|
|
9
|
+
import { expoModule } from "./native.js";
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* The two directories an app actually chooses between, plus the create-then-write dance that
|
|
13
|
+
* writing a file for the first time needs.
|
|
14
|
+
*
|
|
15
|
+
* ponytail: a locator, not a file API. Everything else - moving, listing, downloading, streaming
|
|
16
|
+
* - is on the object this hands back, documented by Expo, and not worth restating here.
|
|
17
|
+
*/
|
|
18
|
+
export class FileSystem {
|
|
19
|
+
/** Overridden in a test to write files that are not on a disk. */
|
|
20
|
+
static SOURCE = new InjectionToken('angular-native.fileSystemSource', {
|
|
21
|
+
factory: () => {
|
|
22
|
+
const expo = expoModule('expo-file-system', () => require('expo-file-system'));
|
|
23
|
+
if (!expo)
|
|
24
|
+
return null;
|
|
25
|
+
return {
|
|
26
|
+
// Both are getters on Expo's side, handing back a fresh Directory each time.
|
|
27
|
+
get cacheDirectory() {
|
|
28
|
+
return expo.Paths.cache;
|
|
29
|
+
},
|
|
30
|
+
get documentDirectory() {
|
|
31
|
+
return expo.Paths.document;
|
|
32
|
+
},
|
|
33
|
+
file: (directory, name) => new expo.File(directory, name),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
native = inject(FileSystem.SOURCE);
|
|
38
|
+
/** A file the system may delete when the device runs low on storage. */
|
|
39
|
+
cache(name) {
|
|
40
|
+
return this.file(this.native.cacheDirectory, name);
|
|
41
|
+
}
|
|
42
|
+
/** A file that survives, and is included in backups. */
|
|
43
|
+
document(name) {
|
|
44
|
+
return this.file(this.native.documentDirectory, name);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Write text, or bytes for anything that is not text, whether or not the file is there already.
|
|
48
|
+
* `write` alone throws on a file that has never been created, which is the first thing everyone
|
|
49
|
+
* hits. It replaces what was there.
|
|
50
|
+
*/
|
|
51
|
+
write(file, content) {
|
|
52
|
+
if (!file.exists)
|
|
53
|
+
file.create({ intermediates: true });
|
|
54
|
+
file.write(content);
|
|
55
|
+
}
|
|
56
|
+
file(directory, name) {
|
|
57
|
+
if (!this.native)
|
|
58
|
+
throw new Error('[angular-native] expo-file-system is not installed');
|
|
59
|
+
return this.native.file(directory, name);
|
|
60
|
+
}
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: FileSystem, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
62
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: FileSystem });
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: FileSystem, decorators: [{
|
|
65
|
+
type: Service
|
|
66
|
+
}] });
|
|
67
|
+
//# sourceMappingURL=file-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.js","sourceRoot":"","sources":["../src/file-system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,E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AO,CAAC,CAAC;IACtB,CAAC;IAEO,IAAI,CAAC,SAA0B,EAAE,IAAY;QACnD,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;uGAnDU,UAAU;wGAAV,UAAU;;2FAAV,UAAU;kBADtB,OAAO","sourcesContent":["/**\n * `FileSystem`, bound to `expo-file-system`.\n *\n * Files located by what they are for rather than by path. `File` and `Paths` are Expo's own\n * classes over a native one, so they are used as published; this only decides which directory a\n * name lands in and hands the file back.\n */\nimport { InjectionToken, Service, inject } from '@angular/core';\nimport { expoModule } from './native.ts';\n\n/**\n * A file. Structural on purpose: this is Expo's `File`, described in terms a test can satisfy, so\n * a fake needs no Expo. An app gets the real object back and may use the rest of its surface.\n */\nexport interface NativeFile {\n readonly uri: string;\n readonly exists: boolean;\n readonly size: number;\n create(options?: { overwrite?: boolean; intermediates?: boolean }): void;\n write(content: string | Uint8Array): void;\n text(): Promise<string>;\n textSync(): string;\n /** The contents as bytes: a PDF, an image, anything that is not text. */\n bytes(): Promise<Uint8Array>;\n delete(): void;\n}\n\n/** A directory, as far as this needs to know: something a file can be named inside. */\nexport type NativeDirectory = object;\n\n/** The slice of `expo-file-system` this needs. */\nexport interface NativeFiles {\n /** Cleared by the system under storage pressure. */\n readonly cacheDirectory: NativeDirectory;\n /** Survives, and is backed up. */\n readonly documentDirectory: NativeDirectory;\n file(directory: NativeDirectory, name: string): NativeFile;\n}\n\n/**\n * The two directories an app actually chooses between, plus the create-then-write dance that\n * writing a file for the first time needs.\n *\n * ponytail: a locator, not a file API. Everything else - moving, listing, downloading, streaming\n * - is on the object this hands back, documented by Expo, and not worth restating here.\n */\n@Service()\nexport class FileSystem {\n /** Overridden in a test to write files that are not on a disk. */\n static readonly SOURCE = new InjectionToken<NativeFiles | null>(\n 'angular-native.fileSystemSource',\n {\n factory: () => {\n const expo = expoModule(\n 'expo-file-system',\n () => require('expo-file-system') as typeof import('expo-file-system'),\n );\n if (!expo) return null;\n return {\n // Both are getters on Expo's side, handing back a fresh Directory each time.\n get cacheDirectory() {\n return expo.Paths.cache;\n },\n get documentDirectory() {\n return expo.Paths.document;\n },\n file: (directory, name) =>\n new expo.File(directory as InstanceType<typeof expo.Directory>, name),\n };\n },\n },\n );\n\n private readonly native = inject(FileSystem.SOURCE);\n\n /** A file the system may delete when the device runs low on storage. */\n cache(name: string): NativeFile {\n return this.file(this.native!.cacheDirectory, name);\n }\n\n /** A file that survives, and is included in backups. */\n document(name: string): NativeFile {\n return this.file(this.native!.documentDirectory, name);\n }\n\n /**\n * Write text, or bytes for anything that is not text, whether or not the file is there already.\n * `write` alone throws on a file that has never been created, which is the first thing everyone\n * hits. It replaces what was there.\n */\n write(file: NativeFile, content: string | Uint8Array): void {\n if (!file.exists) file.create({ intermediates: true });\n file.write(content);\n }\n\n private file(directory: NativeDirectory, name: string): NativeFile {\n if (!this.native) throw new Error('[angular-native] expo-file-system is not installed');\n return this.native.file(directory, name);\n }\n}\n"]}
|
package/dist/fonts.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Fonts`, bound to `expo-font`.
|
|
3
|
+
*
|
|
4
|
+
* A font on a phone is not fetched when the text engine first needs it. It has to be registered
|
|
5
|
+
* with the platform up front, or the first paint is in the fallback face and reflows when the
|
|
6
|
+
* real one lands - which is why the interesting call here is the one an app makes *before* it
|
|
7
|
+
* mounts:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { loadFonts } from '@ng-native/expo/fonts';
|
|
11
|
+
*
|
|
12
|
+
* await loadFonts(styleSheetOf(GlobalStyles));
|
|
13
|
+
* mount(rootTag, App, getFabricUIManager(), { globalStyles: styleSheetOf(GlobalStyles) });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The class takes its platform rather than injecting it, because that call happens before there
|
|
17
|
+
* is an injector to inject from. `inject(Fonts)` is for a screen that wants to ask what loaded.
|
|
18
|
+
*
|
|
19
|
+
* Unlike the other services here this goes through `expo-font`'s JavaScript rather than its
|
|
20
|
+
* native module: the module takes descriptors the JS builds out of an asset, and rebuilding them
|
|
21
|
+
* here would be copying out its internals rather than using it.
|
|
22
|
+
*/
|
|
23
|
+
import { InjectionToken, type Signal } from '@angular/core';
|
|
24
|
+
/** A face a stylesheet declared, as the compiler collected it. */
|
|
25
|
+
export interface FontFace {
|
|
26
|
+
readonly family: string;
|
|
27
|
+
/** What `require('./Inter.ttf')` returned: an asset id, or a module the bundler resolved. */
|
|
28
|
+
readonly source: unknown;
|
|
29
|
+
readonly weight?: number;
|
|
30
|
+
readonly style?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Just enough of a compiled stylesheet to find the faces in it. */
|
|
33
|
+
export interface SheetWithFonts {
|
|
34
|
+
readonly fonts?: readonly FontFace[];
|
|
35
|
+
}
|
|
36
|
+
/** The slice of `expo-font` this needs. */
|
|
37
|
+
export interface NativeFonts {
|
|
38
|
+
loadAsync(map: Record<string, unknown>): Promise<void>;
|
|
39
|
+
isLoaded(family: string): boolean;
|
|
40
|
+
getLoadedFonts(): string[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Loading is by family name, which is also all native matches on.
|
|
44
|
+
*
|
|
45
|
+
* There is no weight matching on a device: `font-family: Inter` finds the face registered under
|
|
46
|
+
* exactly that name, and a bold cut is a family of its own. A face that declares a weight is
|
|
47
|
+
* therefore registered under a composed name as well as its own, so a stylesheet can say
|
|
48
|
+
* `font-family: Inter-700` and get the file it declared - and a sheet that only ever registers
|
|
49
|
+
* one weight per family needs to know none of this.
|
|
50
|
+
*/
|
|
51
|
+
export declare function registrationsFor(faces: readonly FontFace[]): Record<string, unknown>;
|
|
52
|
+
export declare function expoFonts(): NativeFonts | null;
|
|
53
|
+
export declare class FontRegistry {
|
|
54
|
+
private readonly native;
|
|
55
|
+
/**
|
|
56
|
+
* Bumped whenever faces are registered.
|
|
57
|
+
*
|
|
58
|
+
* The platform's own list is a plain array that changes underneath us, so a template binding to
|
|
59
|
+
* it would render once and never again - and the one moment it changes is exactly the moment a
|
|
60
|
+
* screen waiting on a font wants to hear about. This makes both readers reactive without
|
|
61
|
+
* mirroring the list.
|
|
62
|
+
*/
|
|
63
|
+
private readonly generation;
|
|
64
|
+
constructor(native: NativeFonts | null);
|
|
65
|
+
/** Whether `expo-font` is installed at all. Without it a custom face simply never appears. */
|
|
66
|
+
get available(): boolean;
|
|
67
|
+
/** Every family the platform can currently find, custom or bundled. */
|
|
68
|
+
readonly families: Signal<readonly string[]>;
|
|
69
|
+
/** Whether a family is registered. Reactive: re-read after a `load` that adds one. */
|
|
70
|
+
has(family: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Register every `@font-face` a compiled sheet declares.
|
|
73
|
+
*
|
|
74
|
+
* Awaited before `mount` in an app that uses one: text laid out before this resolves is laid
|
|
75
|
+
* out in the fallback face. Sheets with no faces resolve immediately, so calling it
|
|
76
|
+
* unconditionally at bootstrap costs nothing.
|
|
77
|
+
*/
|
|
78
|
+
loadSheet(...sheets: readonly (SheetWithFonts | null | undefined)[]): Promise<void>;
|
|
79
|
+
/** Register faces by name, for a font that did not come from a stylesheet. */
|
|
80
|
+
load(map: Record<string, unknown>): Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
/** Injected where an app wants to ask what is loaded. */
|
|
83
|
+
export declare const Fonts: InjectionToken<FontRegistry>;
|
|
84
|
+
export type Fonts = FontRegistry;
|
|
85
|
+
/**
|
|
86
|
+
* Register every face the given sheets declare, before the app mounts.
|
|
87
|
+
*
|
|
88
|
+
* A function rather than a service because that is when it is needed: there is no injector yet.
|
|
89
|
+
*/
|
|
90
|
+
export declare function loadFonts(...sheets: readonly (SheetWithFonts | null | undefined)[]): Promise<void>;
|