@symbiote-native/screen-orientation 1.0.0 → 3.0.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 +17 -15
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -18,6 +18,10 @@ depended on directly and never the `expo` meta-package, why the upstream JS is h
|
|
|
18
18
|
npm install @symbiote-native/screen-orientation
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Scaffolding or extending a SymbioteNative app? `npx @symbiote-native/cli new --screen-orientation`
|
|
22
|
+
(or `add --screen-orientation` in an existing app) installs and wires this for you — see
|
|
23
|
+
[`@symbiote-native/cli`](../cli).
|
|
24
|
+
|
|
21
25
|
Depends on `expo-screen-orientation` and `expo-modules-core` directly (regular dependencies,
|
|
22
26
|
pinned to exact versions — never a caret range, since this package's `core/` is hand-ported against
|
|
23
27
|
one specific native API shape and a newer resolve could silently drift the two apart). Never
|
|
@@ -86,9 +90,9 @@ function ScreenOrientationScreen() {
|
|
|
86
90
|
|
|
87
91
|
return (
|
|
88
92
|
<>
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
93
|
+
<text>Orientation: {orientation}</text>
|
|
94
|
+
<text>Lock: {orientationLock}</text>
|
|
95
|
+
<button
|
|
92
96
|
title="Lock landscape"
|
|
93
97
|
onPress={() => lockAsync(OrientationLock.LANDSCAPE)}
|
|
94
98
|
/>
|
|
@@ -100,7 +104,6 @@ function ScreenOrientationScreen() {
|
|
|
100
104
|
```vue
|
|
101
105
|
<!-- Vue — examples/expo-vue-sfc/screens/ScreenOrientationScreen.vue -->
|
|
102
106
|
<script setup lang="ts">
|
|
103
|
-
import { Text } from '@symbiote-native/vue';
|
|
104
107
|
import {
|
|
105
108
|
lockAsync,
|
|
106
109
|
OrientationLock,
|
|
@@ -110,8 +113,8 @@ import { useScreenOrientation } from '@symbiote-native/screen-orientation/vue';
|
|
|
110
113
|
const screenOrientation = useScreenOrientation(); // Ref<ScreenOrientationState>
|
|
111
114
|
</script>
|
|
112
115
|
<template>
|
|
113
|
-
<
|
|
114
|
-
<
|
|
116
|
+
<text>Orientation: {{ screenOrientation.orientation }}</text>
|
|
117
|
+
<text>Lock: {{ screenOrientation.orientationLock }}</text>
|
|
115
118
|
</template>
|
|
116
119
|
```
|
|
117
120
|
|
|
@@ -129,20 +132,20 @@ const screenOrientation = useScreenOrientation(); // Ref<ScreenOrientationState>
|
|
|
129
132
|
const screenOrientation = useScreenOrientation();
|
|
130
133
|
</script>
|
|
131
134
|
|
|
132
|
-
<
|
|
133
|
-
<
|
|
135
|
+
<text>Orientation: {screenOrientation.current.orientation}</text>
|
|
136
|
+
<text>Lock: {screenOrientation.current.orientationLock}</text>
|
|
134
137
|
```
|
|
135
138
|
|
|
136
139
|
```ts
|
|
137
140
|
// Angular — examples/expo-angular/src/screens/ScreenOrientationScreen.ts
|
|
138
141
|
import { Component, inject } from '@angular/core';
|
|
139
|
-
import {
|
|
142
|
+
import { SYMBIOTE_ELEMENTS } from '@symbiote-native/angular';
|
|
140
143
|
import { ScreenOrientationService } from '@symbiote-native/screen-orientation/angular';
|
|
141
144
|
|
|
142
145
|
@Component({
|
|
143
146
|
standalone: true,
|
|
144
|
-
imports: [
|
|
145
|
-
template: `<
|
|
147
|
+
imports: [SYMBIOTE_ELEMENTS],
|
|
148
|
+
template: `<text>Orientation: {{ screenOrientation().orientation }}</text>`,
|
|
146
149
|
})
|
|
147
150
|
export class ScreenOrientationScreen {
|
|
148
151
|
readonly screenOrientation = inject(ScreenOrientationService).connect(); // Signal<ScreenOrientationState>
|
|
@@ -151,7 +154,6 @@ export class ScreenOrientationScreen {
|
|
|
151
154
|
|
|
152
155
|
```tsx
|
|
153
156
|
// Solid — the accessor is CALLED; a Solid component body runs once, so a snapshot would freeze.
|
|
154
|
-
import { Text } from '@symbiote-native/solid';
|
|
155
157
|
import {
|
|
156
158
|
lockAsync,
|
|
157
159
|
OrientationLock,
|
|
@@ -163,9 +165,9 @@ function ScreenOrientationScreen() {
|
|
|
163
165
|
|
|
164
166
|
return (
|
|
165
167
|
<>
|
|
166
|
-
<
|
|
167
|
-
<
|
|
168
|
-
<
|
|
168
|
+
<text>Orientation: {screenOrientation().orientation}</text>
|
|
169
|
+
<text>Lock: {screenOrientation().orientationLock}</text>
|
|
170
|
+
<button
|
|
169
171
|
title="Lock landscape"
|
|
170
172
|
onPress={() => lockAsync(OrientationLock.LANDSCAPE)}
|
|
171
173
|
/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/screen-orientation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "expo-screen-orientation wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Orientation locking (lockAsync/lockPlatformAsync/unlockAsync), the current orientation and lock, and an auto-updating orientation-change hook/composable/service.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"solid-js": ">=1.9.0",
|
|
81
81
|
"svelte": ">=5.56.0",
|
|
82
82
|
"vue": ">=3.5.0",
|
|
83
|
-
"@symbiote-native/angular": "^
|
|
84
|
-
"@symbiote-native/engine": "^0.
|
|
85
|
-
"@symbiote-native/react": "^
|
|
86
|
-
"@symbiote-native/solid": "^
|
|
87
|
-
"@symbiote-native/svelte": "^
|
|
88
|
-
"@symbiote-native/vue": "^
|
|
83
|
+
"@symbiote-native/angular": "^3.0.0",
|
|
84
|
+
"@symbiote-native/engine": "^1.0.0",
|
|
85
|
+
"@symbiote-native/react": "^3.0.0",
|
|
86
|
+
"@symbiote-native/solid": "^3.0.0",
|
|
87
|
+
"@symbiote-native/svelte": "^3.0.0",
|
|
88
|
+
"@symbiote-native/vue": "^3.0.0"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"@symbiote-native/angular": {
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
"solid-js": "^1.9.14",
|
|
134
134
|
"svelte": "^5.56.0",
|
|
135
135
|
"typescript": "~6.0.0",
|
|
136
|
-
"@symbiote-native/angular": "
|
|
137
|
-
"@symbiote-native/engine": "0.
|
|
138
|
-
"@symbiote-native/react": "
|
|
139
|
-
"@symbiote-native/solid": "
|
|
140
|
-
"@symbiote-native/svelte": "
|
|
141
|
-
"@symbiote-native/test-utils": "0.3.
|
|
142
|
-
"@symbiote-native/vue": "
|
|
136
|
+
"@symbiote-native/angular": "3.0.0",
|
|
137
|
+
"@symbiote-native/engine": "1.0.0",
|
|
138
|
+
"@symbiote-native/react": "3.0.0",
|
|
139
|
+
"@symbiote-native/solid": "3.0.0",
|
|
140
|
+
"@symbiote-native/svelte": "3.0.0",
|
|
141
|
+
"@symbiote-native/test-utils": "0.3.1",
|
|
142
|
+
"@symbiote-native/vue": "3.0.0"
|
|
143
143
|
},
|
|
144
144
|
"scripts": {
|
|
145
145
|
"typecheck": "tsc --build",
|