react-native-orientation-director 2.1.0 → 2.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 +40 -6
- package/android/build.gradle +7 -12
- package/android/gradle.properties +5 -5
- package/android/src/main/java/com/orientationdirector/OrientationDirectorPackage.kt +2 -3
- package/android/src/main/java/com/orientationdirector/implementation/Orientation.kt +1 -0
- package/android/src/main/java/com/orientationdirector/implementation/OrientationDirectorModuleImpl.kt +32 -2
- package/android/src/main/java/com/orientationdirector/implementation/Utils.kt +10 -0
- package/android/src/test/java/com/orientationdirector/implementation/OrientationDirectorModuleImplTest.kt +11 -0
- package/app.plugin.js +1 -0
- package/ios/implementation/EventManager.swift +7 -7
- package/ios/implementation/Orientation.swift +1 -1
- package/ios/implementation/OrientationDirectorImpl.swift +27 -12
- package/ios/implementation/SensorListener.swift +1 -1
- package/ios/implementation/Utils.swift +9 -5
- package/lib/commonjs/RNOrientationDirector.js +1 -0
- package/lib/commonjs/RNOrientationDirector.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types/Orientation.enum.js +3 -2
- package/lib/commonjs/types/Orientation.enum.js.map +1 -1
- package/lib/module/EventEmitter.js +2 -0
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/NativeOrientationDirector.js +2 -0
- package/lib/module/NativeOrientationDirector.js.map +1 -1
- package/lib/module/RNOrientationDirector.js +3 -0
- package/lib/module/RNOrientationDirector.js.map +1 -1
- package/lib/module/hooks/useDeviceOrientation.hook.js +2 -0
- package/lib/module/hooks/useDeviceOrientation.hook.js.map +1 -1
- package/lib/module/hooks/useInterfaceOrientation.hook.js +2 -0
- package/lib/module/hooks/useInterfaceOrientation.hook.js.map +1 -1
- package/lib/module/hooks/useIsInterfaceOrientationLocked.hook.js +2 -0
- package/lib/module/hooks/useIsInterfaceOrientationLocked.hook.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/module.js +2 -0
- package/lib/module/module.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/types/AutoRotation.enum.js +2 -0
- package/lib/module/types/AutoRotation.enum.js.map +1 -1
- package/lib/module/types/Event.enum.js +2 -0
- package/lib/module/types/Event.enum.js.map +1 -1
- package/lib/module/types/HumanReadableAutoRotationsResource.type.js +2 -0
- package/lib/module/types/HumanReadableOrientationsResource.type.js +2 -0
- package/lib/module/types/LockableOrientation.type.js +2 -0
- package/lib/module/types/LockedEvent.interface.js +1 -1
- package/lib/module/types/Orientation.enum.js +5 -2
- package/lib/module/types/Orientation.enum.js.map +1 -1
- package/lib/module/types/OrientationEvent.interface.js +2 -0
- package/lib/module/types/OrientationType.enum.js +2 -0
- package/lib/module/types/OrientationType.enum.js.map +1 -1
- package/lib/typescript/plugin/src/custom-mod/withBridgingHeader.d.ts +13 -0
- package/lib/typescript/plugin/src/custom-mod/withBridgingHeader.d.ts.map +1 -0
- package/lib/typescript/plugin/src/index.d.ts +4 -0
- package/lib/typescript/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/plugin/src/withRNOrientationAppDelegate.d.ts +5 -0
- package/lib/typescript/plugin/src/withRNOrientationAppDelegate.d.ts.map +1 -0
- package/lib/typescript/plugin/src/withRNOrientationBridgingHeader.d.ts +4 -0
- package/lib/typescript/plugin/src/withRNOrientationBridgingHeader.d.ts.map +1 -0
- package/lib/typescript/src/RNOrientationDirector.d.ts.map +1 -1
- package/lib/typescript/src/types/LockableOrientation.type.d.ts +1 -1
- package/lib/typescript/src/types/LockableOrientation.type.d.ts.map +1 -1
- package/lib/typescript/src/types/Orientation.enum.d.ts +3 -2
- package/lib/typescript/src/types/Orientation.enum.d.ts.map +1 -1
- package/package.json +35 -9
- package/plugin/build/custom-mod/withBridgingHeader.d.ts +12 -0
- package/plugin/build/custom-mod/withBridgingHeader.js +107 -0
- package/plugin/build/index.d.ts +3 -0
- package/plugin/build/index.js +25 -0
- package/plugin/build/withRNOrientationAppDelegate.d.ts +4 -0
- package/plugin/build/withRNOrientationAppDelegate.js +71 -0
- package/plugin/build/withRNOrientationBridgingHeader.d.ts +3 -0
- package/plugin/build/withRNOrientationBridgingHeader.js +27 -0
- package/plugin/tsconfig.json +9 -0
- package/react-native-orientation-director.podspec +2 -1
- package/src/RNOrientationDirector.ts +1 -0
- package/src/types/LockableOrientation.type.ts +2 -1
- package/src/types/Orientation.enum.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","RNOrientationDirector","Orientation","useDeviceOrientation","initialRender","orientation","setOrientation","useState","unknown","useEffect","current","getDeviceOrientation","then","onChange","event","subscription","listenForDeviceOrientationChanges","remove"],"sourceRoot":"../../../src","sources":["hooks/useDeviceOrientation.hook.ts"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,qBAAqB,MAAM,0BAA0B;AAE5D,SAASC,WAAW,QAAQ,2BAA2B;;AAEvD;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACjC,MAAMC,aAAa,GAAGJ,MAAM,CAAC,KAAK,CAAC;EACnC,MAAM,CAACK,WAAW,EAAEC,cAAc,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAClDL,WAAW,CAACM,OACd,CAAC;EAEDT,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,IAAIL,aAAa,CAACM,OAAO,EAAE;MACzB;IACF;IAEAN,aAAa,CAACM,OAAO,GAAG,IAAI;IAC5BT,qBAAqB,CAACU,oBAAoB,CAAC,CAAC,CAACC,IAAI,CAACN,cAAc,CAAC;EACnE,CAAC,EAAE,EAAE,CAAC;EAENP,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,MAAMI,QAAQ,GAAIC,KAAuB,IAAK;MAC5CR,cAAc,CAACQ,KAAK,CAACT,WAAW,CAAC;IACnC,CAAC;IAED,MAAMU,YAAY,GAChBd,qBAAqB,CAACe,iCAAiC,CAACH,QAAQ,CAAC;IACnE,OAAO,MAAM;MACXE,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOZ,WAAW;AACpB,CAAC;AAED,eAAeF,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useRef","RNOrientationDirector","Orientation","useDeviceOrientation","initialRender","orientation","setOrientation","useState","unknown","useEffect","current","getDeviceOrientation","then","onChange","event","subscription","listenForDeviceOrientationChanges","remove"],"sourceRoot":"../../../src","sources":["hooks/useDeviceOrientation.hook.ts"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,qBAAqB,MAAM,0BAA0B;AAE5D,SAASC,WAAW,QAAQ,2BAA2B;;AAEvD;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACjC,MAAMC,aAAa,GAAGJ,MAAM,CAAC,KAAK,CAAC;EACnC,MAAM,CAACK,WAAW,EAAEC,cAAc,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAClDL,WAAW,CAACM,OACd,CAAC;EAEDT,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,IAAIL,aAAa,CAACM,OAAO,EAAE;MACzB;IACF;IAEAN,aAAa,CAACM,OAAO,GAAG,IAAI;IAC5BT,qBAAqB,CAACU,oBAAoB,CAAC,CAAC,CAACC,IAAI,CAACN,cAAc,CAAC;EACnE,CAAC,EAAE,EAAE,CAAC;EAENP,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,MAAMI,QAAQ,GAAIC,KAAuB,IAAK;MAC5CR,cAAc,CAACQ,KAAK,CAACT,WAAW,CAAC;IACnC,CAAC;IAED,MAAMU,YAAY,GAChBd,qBAAqB,CAACe,iCAAiC,CAACH,QAAQ,CAAC;IACnE,OAAO,MAAM;MACXE,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOZ,WAAW;AACpB,CAAC;AAED,eAAeF,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","RNOrientationDirector","Orientation","useInterfaceOrientation","initialRender","orientation","setOrientation","useState","unknown","useEffect","current","getInterfaceOrientation","then","onChange","event","subscription","listenForInterfaceOrientationChanges","remove"],"sourceRoot":"../../../src","sources":["hooks/useInterfaceOrientation.hook.ts"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,qBAAqB,MAAM,0BAA0B;AAE5D,SAASC,WAAW,QAAQ,2BAA2B;;AAEvD;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,MAAMC,aAAa,GAAGJ,MAAM,CAAC,KAAK,CAAC;EACnC,MAAM,CAACK,WAAW,EAAEC,cAAc,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAClDL,WAAW,CAACM,OACd,CAAC;EAEDT,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,IAAIL,aAAa,CAACM,OAAO,EAAE;MACzB;IACF;IAEAN,aAAa,CAACM,OAAO,GAAG,IAAI;IAC5BT,qBAAqB,CAACU,uBAAuB,CAAC,CAAC,CAACC,IAAI,CAACN,cAAc,CAAC;EACtE,CAAC,EAAE,EAAE,CAAC;EAENP,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,MAAMI,QAAQ,GAAIC,KAAuB,IAAK;MAC5CR,cAAc,CAACQ,KAAK,CAACT,WAAW,CAAC;IACnC,CAAC;IAED,MAAMU,YAAY,GAChBd,qBAAqB,CAACe,oCAAoC,CAACH,QAAQ,CAAC;IACtE,OAAO,MAAM;MACXE,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOZ,WAAW;AACpB,CAAC;AAED,eAAeF,uBAAuB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useRef","RNOrientationDirector","Orientation","useInterfaceOrientation","initialRender","orientation","setOrientation","useState","unknown","useEffect","current","getInterfaceOrientation","then","onChange","event","subscription","listenForInterfaceOrientationChanges","remove"],"sourceRoot":"../../../src","sources":["hooks/useInterfaceOrientation.hook.ts"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,qBAAqB,MAAM,0BAA0B;AAE5D,SAASC,WAAW,QAAQ,2BAA2B;;AAEvD;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,GAAGA,CAAA,KAAM;EACpC,MAAMC,aAAa,GAAGJ,MAAM,CAAC,KAAK,CAAC;EACnC,MAAM,CAACK,WAAW,EAAEC,cAAc,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAClDL,WAAW,CAACM,OACd,CAAC;EAEDT,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,IAAIL,aAAa,CAACM,OAAO,EAAE;MACzB;IACF;IAEAN,aAAa,CAACM,OAAO,GAAG,IAAI;IAC5BT,qBAAqB,CAACU,uBAAuB,CAAC,CAAC,CAACC,IAAI,CAACN,cAAc,CAAC;EACtE,CAAC,EAAE,EAAE,CAAC;EAENP,KAAK,CAACU,SAAS,CAAC,MAAM;IACpB,MAAMI,QAAQ,GAAIC,KAAuB,IAAK;MAC5CR,cAAc,CAACQ,KAAK,CAACT,WAAW,CAAC;IACnC,CAAC;IAED,MAAMU,YAAY,GAChBd,qBAAqB,CAACe,oCAAoC,CAACH,QAAQ,CAAC;IACtE,OAAO,MAAM;MACXE,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOZ,WAAW;AACpB,CAAC;AAED,eAAeF,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","RNOrientationDirector","useIsInterfaceOrientationLocked","orientation","setOrientation","useState","isLocked","useEffect","onChange","event","locked","subscription","listenForLockChanges","remove"],"sourceRoot":"../../../src","sources":["hooks/useIsInterfaceOrientationLocked.hook.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,qBAAqB,MAAM,0BAA0B;AAG5D;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,GAAGA,CAAA,KAAM;EAC5C,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGJ,KAAK,CAACK,QAAQ,CAAU,MAC5DJ,qBAAqB,CAACK,QAAQ,CAAC,CACjC,CAAC;EAEDN,KAAK,CAACO,SAAS,CAAC,MAAM;IACpB,MAAMC,QAAQ,GAAIC,KAAkB,IAAK;MACvCL,cAAc,CAACK,KAAK,CAACC,MAAM,CAAC;IAC9B,CAAC;IAED,MAAMC,YAAY,GAAGV,qBAAqB,CAACW,oBAAoB,CAACJ,QAAQ,CAAC;IACzE,OAAO,MAAM;MACXG,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOV,WAAW;AACpB,CAAC;AAED,eAAeD,+BAA+B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","RNOrientationDirector","useIsInterfaceOrientationLocked","orientation","setOrientation","useState","isLocked","useEffect","onChange","event","locked","subscription","listenForLockChanges","remove"],"sourceRoot":"../../../src","sources":["hooks/useIsInterfaceOrientationLocked.hook.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,qBAAqB,MAAM,0BAA0B;AAG5D;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,GAAGA,CAAA,KAAM;EAC5C,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGJ,KAAK,CAACK,QAAQ,CAAU,MAC5DJ,qBAAqB,CAACK,QAAQ,CAAC,CACjC,CAAC;EAEDN,KAAK,CAACO,SAAS,CAAC,MAAM;IACpB,MAAMC,QAAQ,GAAIC,KAAkB,IAAK;MACvCL,cAAc,CAACK,KAAK,CAACC,MAAM,CAAC;IAC9B,CAAC;IAED,MAAMC,YAAY,GAAGV,qBAAqB,CAACW,oBAAoB,CAACJ,QAAQ,CAAC;IACzE,OAAO,MAAM;MACXG,YAAY,CAACE,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOV,WAAW;AACpB,CAAC;AAED,eAAeD,+BAA+B","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Orientation","AutoRotation","OrientationType","useDeviceOrientation","useInterfaceOrientation","useIsInterfaceOrientationLocked","RNOrientationDirector"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0BAA0B;AACtD,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,OAAOC,oBAAoB,MAAM,mCAAmC;AACpE,SAASA,oBAAoB;AAE7B,OAAOC,uBAAuB,MAAM,sCAAsC;AAC1E,SAASA,uBAAuB;AAEhC,OAAOC,+BAA+B,MAAM,8CAA8C;AAC1F,SAASA,+BAA+B;AAExC,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,eAAeA,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Orientation","AutoRotation","OrientationType","useDeviceOrientation","useInterfaceOrientation","useIsInterfaceOrientationLocked","RNOrientationDirector"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,0BAA0B;AACtD,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,OAAOC,oBAAoB,MAAM,mCAAmC;AACpE,SAASA,oBAAoB;AAE7B,OAAOC,uBAAuB,MAAM,sCAAsC;AAC1E,SAASA,uBAAuB;AAEhC,OAAOC,+BAA+B,MAAM,8CAA8C;AAC1F,SAASA,+BAA+B;AAExC,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,eAAeA,qBAAqB","ignoreList":[]}
|
package/lib/module/module.js
CHANGED
package/lib/module/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","NativeModules","Platform","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","Module","require","OrientationDirector","OrientationDirectorModule","Proxy","get","Error","ModuleEventEmitter"],"sourceRoot":"../../src","sources":["module.ts"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAG1E,MAAMC,aAAa,GACjB,4FAA4F,GAC5FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,MAAM,GAAGH,oBAAoB,GAC/BI,OAAO,CAAC,6BAA6B,CAAC,CAACL,OAAO,GAC9CL,aAAa,CAACW,mBAAmB;AAErC,MAAMC,yBAAyB,GAAGH,MAAM,GACpCA,MAAM,GACN,IAAII,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACb,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,MAAMc,kBAAkB,GAAG,IAAIjB,kBAAkB,CAACU,MAAM,CAAC;AAEhE,eAAeG,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeModules","Platform","LINKING_ERROR","select","ios","default","isTurboModuleEnabled","global","__turboModuleProxy","Module","require","OrientationDirector","OrientationDirectorModule","Proxy","get","Error","ModuleEventEmitter"],"sourceRoot":"../../src","sources":["module.ts"],"mappings":";;AAAA,SAASA,kBAAkB,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAG1E,MAAMC,aAAa,GACjB,4FAA4F,GAC5FD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;;AAEjC;AACA,MAAMC,oBAAoB,GAAGC,MAAM,CAACC,kBAAkB,IAAI,IAAI;AAE9D,MAAMC,MAAM,GAAGH,oBAAoB,GAC/BI,OAAO,CAAC,6BAA6B,CAAC,CAACL,OAAO,GAC9CL,aAAa,CAACW,mBAAmB;AAErC,MAAMC,yBAAyB,GAAGH,MAAM,GACpCA,MAAM,GACN,IAAII,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACb,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,MAAMc,kBAAkB,GAAG,IAAIjB,kBAAkB,CAACU,MAAM,CAAC;AAEhE,eAAeG,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AutoRotation"],"sourceRoot":"../../../src","sources":["types/AutoRotation.enum.ts"],"mappings":"AAAA,WAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["AutoRotation"],"sourceRoot":"../../../src","sources":["types/AutoRotation.enum.ts"],"mappings":";;AAAA,WAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Event"],"sourceRoot":"../../../src","sources":["types/Event.enum.ts"],"mappings":"IAAKA,KAAK,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA,EAALA,KAAK;AAMV,eAAeA,KAAK","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Event"],"sourceRoot":"../../../src","sources":["types/Event.enum.ts"],"mappings":";;IAAKA,KAAK,0BAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAALA,KAAK;EAAA,OAALA,KAAK;AAAA,EAALA,KAAK;AAMV,eAAeA,KAAK","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=LockedEvent.interface.js.map
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
export let Orientation = /*#__PURE__*/function (Orientation) {
|
|
2
4
|
Orientation[Orientation["unknown"] = 0] = "unknown";
|
|
3
5
|
Orientation[Orientation["portrait"] = 1] = "portrait";
|
|
4
6
|
Orientation[Orientation["landscapeRight"] = 2] = "landscapeRight";
|
|
5
7
|
Orientation[Orientation["portraitUpsideDown"] = 3] = "portraitUpsideDown";
|
|
6
8
|
Orientation[Orientation["landscapeLeft"] = 4] = "landscapeLeft";
|
|
7
|
-
Orientation[Orientation["
|
|
8
|
-
Orientation[Orientation["
|
|
9
|
+
Orientation[Orientation["landscape"] = 5] = "landscape";
|
|
10
|
+
Orientation[Orientation["faceUp"] = 6] = "faceUp";
|
|
11
|
+
Orientation[Orientation["faceDown"] = 7] = "faceDown";
|
|
9
12
|
return Orientation;
|
|
10
13
|
}({});
|
|
11
14
|
//# sourceMappingURL=Orientation.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Orientation"],"sourceRoot":"../../../src","sources":["types/Orientation.enum.ts"],"mappings":"AAAA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Orientation"],"sourceRoot":"../../../src","sources":["types/Orientation.enum.ts"],"mappings":";;AAAA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OrientationType"],"sourceRoot":"../../../src","sources":["types/OrientationType.enum.ts"],"mappings":"AAAA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["OrientationType"],"sourceRoot":"../../../src","sources":["types/OrientationType.enum.ts"],"mappings":";;AAAA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ConfigPlugin, IOSConfig, type Mod, type ExportedConfig } from '@expo/config-plugins';
|
|
2
|
+
/**
|
|
3
|
+
* This plugin adds a new mod to the prebuild that is the appBridgingHeader.
|
|
4
|
+
* This allows us to update it when the user launches the prebuild script.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withAppBridgingHeaderMod(config: ExportedConfig): ExportedConfig;
|
|
7
|
+
/**
|
|
8
|
+
* This mod provides the app bridging header for modifications
|
|
9
|
+
* @param config
|
|
10
|
+
* @param action
|
|
11
|
+
*/
|
|
12
|
+
export declare const withAppBridgingHeader: ConfigPlugin<Mod<IOSConfig.Paths.AppDelegateProjectFile>>;
|
|
13
|
+
//# sourceMappingURL=withBridgingHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withBridgingHeader.d.ts","sourceRoot":"","sources":["../../../../../plugin/src/custom-mod/withBridgingHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,SAAS,EACT,KAAK,GAAG,EAGR,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAS9B;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,kBAsB9D;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAC9C,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAO5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../plugin/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,sBAAsB,CAAC;;AAyB9B,wBAIE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
export declare const withRNOrientationAppDelegate: ConfigPlugin;
|
|
3
|
+
export declare function swiftFileUpdater(originalContents: string): string;
|
|
4
|
+
export declare function objCFileUpdater(originalContents: string): string;
|
|
5
|
+
//# sourceMappingURL=withRNOrientationAppDelegate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withRNOrientationAppDelegate.d.ts","sourceRoot":"","sources":["../../../../plugin/src/withRNOrientationAppDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,4BAA4B,EAAE,YAE1C,CAAC;AA8BF,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAkBjE;AAED,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CA6BhE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
export declare const withRNOrientationBridgingHeader: ConfigPlugin;
|
|
3
|
+
export declare function bridgingHeaderUpdater(originalContents: string): string;
|
|
4
|
+
//# sourceMappingURL=withRNOrientationBridgingHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withRNOrientationBridgingHeader.d.ts","sourceRoot":"","sources":["../../../../plugin/src/withRNOrientationBridgingHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,sBAAsB,CAAC;AAK9B,eAAO,MAAM,+BAA+B,EAAE,YAE7C,CAAC;AAmBF,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,UAI7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNOrientationDirector.d.ts","sourceRoot":"","sources":["../../../src/RNOrientationDirector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AAG1G,cAAM,qBAAqB;IACzB,OAAO,CAAC,MAAM,CAAC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"RNOrientationDirector.d.ts","sourceRoot":"","sources":["../../../src/RNOrientationDirector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AAG1G,cAAM,qBAAqB;IACzB,OAAO,CAAC,MAAM,CAAC,kCAAkC,CAU7C;IAEJ,OAAO,CAAC,MAAM,CAAC,mCAAmC,CAK9C;IAEJ,4BAA4B,CAAC,QAAQ,EAAE,iCAAiC;IAIxE,6BAA6B,CAAC,QAAQ,EAAE,kCAAkC;IAI1E,MAAM,CAAC,uBAAuB,IAAI,OAAO,CAAC,WAAW,CAAC;IAItD,MAAM,CAAC,oBAAoB,IAAI,OAAO,CAAC,WAAW,CAAC;IAInD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,MAAM,CACX,WAAW,EAAE,mBAAmB,EAChC,eAAe,GAAE,eAA2C;IAoB9D,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,QAAQ;IAIf,MAAM,CAAC,qBAAqB;IAS5B,MAAM,CAAC,mCAAmC;IAI1C,MAAM,CAAC,iCAAiC,CACtC,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,KAAK,IAAI;IAKnD,MAAM,CAAC,oCAAoC,CACzC,QAAQ,EAAE,CAAC,WAAW,EAAE,gBAAgB,KAAK,IAAI;IAKnD,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI;IAIlE,MAAM,CAAC,uCAAuC,CAAC,WAAW,EAAE,WAAW;IAMvE,MAAM,CAAC,wCAAwC,CAAC,YAAY,EAAE,YAAY;IAM1E;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,qBAAqB,CAC1B,WAAW,EAAE,WAAW,GACvB,WAAW,IAAI,mBAAmB;CAOtC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Orientation } from './Orientation.enum';
|
|
2
|
-
export type LockableOrientation = Orientation.portrait | Orientation.portraitUpsideDown | Orientation.landscapeLeft | Orientation.landscapeRight;
|
|
2
|
+
export type LockableOrientation = Orientation.portrait | Orientation.portraitUpsideDown | Orientation.landscapeLeft | Orientation.landscapeRight | Orientation.landscape;
|
|
3
3
|
//# sourceMappingURL=LockableOrientation.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LockableOrientation.type.d.ts","sourceRoot":"","sources":["../../../../src/types/LockableOrientation.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAC3B,WAAW,CAAC,QAAQ,GACpB,WAAW,CAAC,kBAAkB,GAC9B,WAAW,CAAC,aAAa,GACzB,WAAW,CAAC,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"LockableOrientation.type.d.ts","sourceRoot":"","sources":["../../../../src/types/LockableOrientation.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAC3B,WAAW,CAAC,QAAQ,GACpB,WAAW,CAAC,kBAAkB,GAC9B,WAAW,CAAC,aAAa,GACzB,WAAW,CAAC,cAAc,GAC1B,WAAW,CAAC,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Orientation.enum.d.ts","sourceRoot":"","sources":["../../../../src/types/Orientation.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,kBAAkB,IAAI;IACtB,aAAa,IAAI;IACjB,MAAM,IAAI;IACV,QAAQ,IAAI;CACb"}
|
|
1
|
+
{"version":3,"file":"Orientation.enum.d.ts","sourceRoot":"","sources":["../../../../src/types/Orientation.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,kBAAkB,IAAI;IACtB,aAAa,IAAI;IACjB,SAAS,IAAI;IACb,MAAM,IAAI;IACV,QAAQ,IAAI;CACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-orientation-director",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A Modern React Native library that allows you to access orientation",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"android",
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
|
+
"plugin/build",
|
|
17
|
+
"plugin/tsconfig.json",
|
|
18
|
+
"app.plugin.js",
|
|
16
19
|
"*.podspec",
|
|
17
20
|
"!ios/build",
|
|
18
21
|
"!android/build",
|
|
@@ -27,9 +30,10 @@
|
|
|
27
30
|
],
|
|
28
31
|
"scripts": {
|
|
29
32
|
"example": "yarn workspace react-native-orientation-director-example",
|
|
33
|
+
"expo-plugin": "yarn workspace react-native-orientation-director-expo-plugin",
|
|
30
34
|
"test": "jest",
|
|
31
|
-
"typecheck": "tsc
|
|
32
|
-
"lint": "eslint \"
|
|
35
|
+
"typecheck": "tsc",
|
|
36
|
+
"lint": "eslint \"src/**/*.{js,ts,tsx}\" \"example/**/*.{js,ts,tsx}\"",
|
|
33
37
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
34
38
|
"prepare": "bob build",
|
|
35
39
|
"release": "release-it"
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
"devDependencies": {
|
|
56
60
|
"@commitlint/config-conventional": "^17.0.2",
|
|
57
61
|
"@evilmartians/lefthook": "^1.5.0",
|
|
58
|
-
"@react-native/eslint-config": "
|
|
62
|
+
"@react-native/eslint-config": "0.77.0",
|
|
59
63
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
60
64
|
"@types/jest": "^29.5.5",
|
|
61
65
|
"@types/react": "^18.2.44",
|
|
@@ -64,24 +68,34 @@
|
|
|
64
68
|
"eslint": "^8.51.0",
|
|
65
69
|
"eslint-config-prettier": "^9.0.0",
|
|
66
70
|
"eslint-plugin-prettier": "^5.0.1",
|
|
71
|
+
"expo": "^52.0.35",
|
|
67
72
|
"jest": "^29.7.0",
|
|
68
73
|
"prettier": "^3.0.3",
|
|
69
74
|
"react": "18.3.1",
|
|
70
|
-
"react-native": "0.
|
|
71
|
-
"react-native-builder-bob": "^0.
|
|
75
|
+
"react-native": "0.77.0",
|
|
76
|
+
"react-native-builder-bob": "^0.36.0",
|
|
72
77
|
"release-it": "^15.0.0",
|
|
73
78
|
"turbo": "^1.10.7",
|
|
74
79
|
"typescript": "^5.2.2"
|
|
75
80
|
},
|
|
76
81
|
"resolutions": {
|
|
77
|
-
"@types/react": "^18.2.44"
|
|
82
|
+
"@types/react": "^18.2.44",
|
|
83
|
+
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
|
84
|
+
"@typescript-eslint/parser": "^7.1.1"
|
|
78
85
|
},
|
|
79
86
|
"peerDependencies": {
|
|
87
|
+
"expo": ">=47.0.0",
|
|
80
88
|
"react": "*",
|
|
81
89
|
"react-native": "*"
|
|
82
90
|
},
|
|
91
|
+
"peerDependenciesMeta": {
|
|
92
|
+
"expo": {
|
|
93
|
+
"optional": true
|
|
94
|
+
}
|
|
95
|
+
},
|
|
83
96
|
"workspaces": [
|
|
84
|
-
"example"
|
|
97
|
+
"example",
|
|
98
|
+
"plugin"
|
|
85
99
|
],
|
|
86
100
|
"packageManager": "yarn@3.6.1",
|
|
87
101
|
"jest": {
|
|
@@ -132,7 +146,11 @@
|
|
|
132
146
|
"@react-native",
|
|
133
147
|
"prettier"
|
|
134
148
|
],
|
|
149
|
+
"plugins": [
|
|
150
|
+
"prettier"
|
|
151
|
+
],
|
|
135
152
|
"rules": {
|
|
153
|
+
"react/react-in-jsx-scope": "off",
|
|
136
154
|
"prettier/prettier": [
|
|
137
155
|
"error",
|
|
138
156
|
{
|
|
@@ -173,6 +191,14 @@
|
|
|
173
191
|
"codegenConfig": {
|
|
174
192
|
"name": "RNOrientationDirectorSpec",
|
|
175
193
|
"type": "modules",
|
|
176
|
-
"jsSrcsDir": "src"
|
|
194
|
+
"jsSrcsDir": "src",
|
|
195
|
+
"android": {
|
|
196
|
+
"javaPackageName": "com.orientationdirector"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"create-react-native-library": {
|
|
200
|
+
"type": "turbo-module",
|
|
201
|
+
"languages": "kotlin-objc",
|
|
202
|
+
"version": "0.48.0"
|
|
177
203
|
}
|
|
178
204
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ConfigPlugin, IOSConfig, type Mod, type ExportedConfig } from '@expo/config-plugins';
|
|
2
|
+
/**
|
|
3
|
+
* This plugin adds a new mod to the prebuild that is the appBridgingHeader.
|
|
4
|
+
* This allows us to update it when the user launches the prebuild script.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withAppBridgingHeaderMod(config: ExportedConfig): ExportedConfig;
|
|
7
|
+
/**
|
|
8
|
+
* This mod provides the app bridging header for modifications
|
|
9
|
+
* @param config
|
|
10
|
+
* @param action
|
|
11
|
+
*/
|
|
12
|
+
export declare const withAppBridgingHeader: ConfigPlugin<Mod<IOSConfig.Paths.AppDelegateProjectFile>>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.withAppBridgingHeader = void 0;
|
|
37
|
+
exports.withAppBridgingHeaderMod = withAppBridgingHeaderMod;
|
|
38
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
39
|
+
const glob_1 = require("glob");
|
|
40
|
+
const fs = __importStar(require("node:fs"));
|
|
41
|
+
/**
|
|
42
|
+
* Reference: https://github.com/expo/expo/blob/cb38337d37c35a26ac9a39eac2268c4735f488ad/packages/%40expo/config-plugins/src/ios/Paths.ts#L10C1-L10C69
|
|
43
|
+
*/
|
|
44
|
+
const ignoredPaths = ['**/@(Carthage|Pods|vendor|node_modules)/**'];
|
|
45
|
+
/**
|
|
46
|
+
* This plugin adds a new mod to the prebuild that is the appBridgingHeader.
|
|
47
|
+
* This allows us to update it when the user launches the prebuild script.
|
|
48
|
+
*/
|
|
49
|
+
function withAppBridgingHeaderMod(config) {
|
|
50
|
+
return config_plugins_1.BaseMods.withGeneratedBaseMods(config, {
|
|
51
|
+
platform: 'ios',
|
|
52
|
+
providers: {
|
|
53
|
+
// Append a custom rule to supply AppDelegate header data to mods on `mods.ios.appBridgingHeader`
|
|
54
|
+
appBridgingHeader: config_plugins_1.BaseMods.provider({
|
|
55
|
+
// Get the local filepath that should be passed to the `read` method.
|
|
56
|
+
getFilePath({ modRequest: { projectRoot } }) {
|
|
57
|
+
return getBridgingHeaderFilePath(projectRoot);
|
|
58
|
+
},
|
|
59
|
+
// Read the input file from the filesystem.
|
|
60
|
+
async read(filePath) {
|
|
61
|
+
return config_plugins_1.IOSConfig.Paths.getFileInfo(filePath);
|
|
62
|
+
},
|
|
63
|
+
// Write the resulting output to the filesystem.
|
|
64
|
+
async write(filePath, { modResults: { contents } }) {
|
|
65
|
+
await fs.promises.writeFile(filePath, contents);
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* This mod provides the app bridging header for modifications
|
|
73
|
+
* @param config
|
|
74
|
+
* @param action
|
|
75
|
+
*/
|
|
76
|
+
const withAppBridgingHeader = (config, action) => {
|
|
77
|
+
return (0, config_plugins_1.withMod)(config, {
|
|
78
|
+
platform: 'ios',
|
|
79
|
+
mod: 'appBridgingHeader',
|
|
80
|
+
action,
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
exports.withAppBridgingHeader = withAppBridgingHeader;
|
|
84
|
+
/**
|
|
85
|
+
* Reference: https://github.com/expo/expo/blob/cb38337d37c35a26ac9a39eac2268c4735f488ad/packages/%40expo/config-plugins/src/ios/Paths.ts#L23
|
|
86
|
+
* @param projectRoot
|
|
87
|
+
*/
|
|
88
|
+
function getBridgingHeaderFilePath(projectRoot) {
|
|
89
|
+
const [using, ...extra] = withSortedGlobResult((0, glob_1.globSync)('ios/*/*-Bridging-Header.h', {
|
|
90
|
+
absolute: true,
|
|
91
|
+
cwd: projectRoot,
|
|
92
|
+
ignore: ignoredPaths,
|
|
93
|
+
}));
|
|
94
|
+
if (!using) {
|
|
95
|
+
throw new Error(`Could not locate a valid Bridging-Header at root: "${projectRoot}"`);
|
|
96
|
+
}
|
|
97
|
+
if (extra.length) {
|
|
98
|
+
throw new Error(`Multiple Bridging-Header found at root: "${projectRoot}"`);
|
|
99
|
+
}
|
|
100
|
+
return using;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Reference: https://github.com/expo/expo/blob/main/packages/%40expo/config-plugins/src/utils/glob.ts
|
|
104
|
+
*/
|
|
105
|
+
function withSortedGlobResult(glob) {
|
|
106
|
+
return glob.sort((a, b) => a.localeCompare(b));
|
|
107
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
+
const withBridgingHeader_1 = require("./custom-mod/withBridgingHeader");
|
|
5
|
+
const withRNOrientationAppDelegate_1 = require("./withRNOrientationAppDelegate");
|
|
6
|
+
const withRNOrientationBridgingHeader_1 = require("./withRNOrientationBridgingHeader");
|
|
7
|
+
/**
|
|
8
|
+
* So, expo config plugin are awesome and the documentation is well written, but I still needed to look around to see
|
|
9
|
+
* how other projects actually modify the AppDelegate. I've found react-native-firebase to implement a plugin config
|
|
10
|
+
* that changes the AppDelegate, so I'll leave their link as reference:
|
|
11
|
+
* https://github.com/invertase/react-native-firebase/blob/main/packages/app/plugin/src/ios/appDelegate.ts
|
|
12
|
+
*
|
|
13
|
+
* Kudos to them, because this stuff is hard!
|
|
14
|
+
*
|
|
15
|
+
* @param config
|
|
16
|
+
*/
|
|
17
|
+
const withRNOrientationDirector = (config) => {
|
|
18
|
+
return (0, config_plugins_1.withPlugins)(config, [
|
|
19
|
+
withRNOrientationAppDelegate_1.withRNOrientationAppDelegate,
|
|
20
|
+
withRNOrientationBridgingHeader_1.withRNOrientationBridgingHeader,
|
|
21
|
+
withBridgingHeader_1.withAppBridgingHeaderMod,
|
|
22
|
+
]);
|
|
23
|
+
};
|
|
24
|
+
const pak = require('react-native-orientation-director/package.json');
|
|
25
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withRNOrientationDirector, pak.name, pak.version);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
export declare const withRNOrientationAppDelegate: ConfigPlugin;
|
|
3
|
+
export declare function swiftFileUpdater(originalContents: string): string;
|
|
4
|
+
export declare function objCFileUpdater(originalContents: string): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withRNOrientationAppDelegate = void 0;
|
|
4
|
+
exports.swiftFileUpdater = swiftFileUpdater;
|
|
5
|
+
exports.objCFileUpdater = objCFileUpdater;
|
|
6
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
7
|
+
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
8
|
+
const withRNOrientationAppDelegate = (config) => {
|
|
9
|
+
return (0, config_plugins_1.withAppDelegate)(config, readAppDelegateFileAndUpdateContents);
|
|
10
|
+
};
|
|
11
|
+
exports.withRNOrientationAppDelegate = withRNOrientationAppDelegate;
|
|
12
|
+
async function readAppDelegateFileAndUpdateContents(config) {
|
|
13
|
+
const { modResults: appDelegateFile } = config;
|
|
14
|
+
const worker = getCompatibleFileUpdater(appDelegateFile.language);
|
|
15
|
+
appDelegateFile.contents = worker(appDelegateFile.contents);
|
|
16
|
+
return config;
|
|
17
|
+
}
|
|
18
|
+
function getCompatibleFileUpdater(language) {
|
|
19
|
+
switch (language) {
|
|
20
|
+
case 'objc':
|
|
21
|
+
case 'objcpp': {
|
|
22
|
+
return objCFileUpdater;
|
|
23
|
+
}
|
|
24
|
+
case 'swift':
|
|
25
|
+
return swiftFileUpdater;
|
|
26
|
+
default:
|
|
27
|
+
throw new Error(`Cannot add React Native Orientation Director code to AppDelegate of language "${language}"`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function swiftFileUpdater(originalContents) {
|
|
31
|
+
const supportedInterfaceOrientationsForCodeBlock = `\n override func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
|
32
|
+
return OrientationDirector.getSupportedInterfaceOrientationsForWindow()
|
|
33
|
+
}\n`;
|
|
34
|
+
const rightBeforeLastClosingBrace = /didFinishLaunchingWithOptions:\s*launchOptions\)/g;
|
|
35
|
+
const pasteInTheListJustAfterTheClosingBracket = 2;
|
|
36
|
+
const results = (0, generateCode_1.mergeContents)({
|
|
37
|
+
tag: '@react-native-orientation-director/supportedInterfaceOrientationsFor-implementation',
|
|
38
|
+
src: originalContents,
|
|
39
|
+
newSrc: supportedInterfaceOrientationsForCodeBlock,
|
|
40
|
+
anchor: rightBeforeLastClosingBrace,
|
|
41
|
+
offset: pasteInTheListJustAfterTheClosingBracket,
|
|
42
|
+
comment: '// React Native Orientation Director',
|
|
43
|
+
});
|
|
44
|
+
return results.contents;
|
|
45
|
+
}
|
|
46
|
+
function objCFileUpdater(originalContents) {
|
|
47
|
+
const libraryHeaderImportCodeBlock = '#import "OrientationDirector.h"\n';
|
|
48
|
+
const rightBeforeAppDelegateImplementation = /@implementation\s+\w+/g;
|
|
49
|
+
const headerImportMergeResults = (0, generateCode_1.mergeContents)({
|
|
50
|
+
tag: '@react-native-orientation-director/library-header-import',
|
|
51
|
+
src: originalContents,
|
|
52
|
+
newSrc: libraryHeaderImportCodeBlock,
|
|
53
|
+
anchor: rightBeforeAppDelegateImplementation,
|
|
54
|
+
offset: 0,
|
|
55
|
+
comment: '// React Native Orientation Director',
|
|
56
|
+
});
|
|
57
|
+
const supportedInterfaceOrientationsForCodeBlock = `- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
|
|
58
|
+
{
|
|
59
|
+
return [OrientationDirector getSupportedInterfaceOrientationsForWindow];
|
|
60
|
+
}\n`;
|
|
61
|
+
const rightBeforeLastClosingEnd = /@end[^@]*$/g;
|
|
62
|
+
const implementationMergeResults = (0, generateCode_1.mergeContents)({
|
|
63
|
+
tag: '@react-native-orientation-director/supportedInterfaceOrientationsFor-implementation',
|
|
64
|
+
src: headerImportMergeResults.contents,
|
|
65
|
+
newSrc: supportedInterfaceOrientationsForCodeBlock,
|
|
66
|
+
anchor: rightBeforeLastClosingEnd,
|
|
67
|
+
offset: 0,
|
|
68
|
+
comment: '// React Native Orientation Director',
|
|
69
|
+
});
|
|
70
|
+
return implementationMergeResults.contents;
|
|
71
|
+
}
|