react-native-readium 1.0.1 → 1.0.2

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.
Files changed (49) hide show
  1. package/android/src/main/AndroidManifest.xml +4 -2
  2. package/android/src/main/res/xml/network_security_config.xml +11 -0
  3. package/lib/commonjs/components/BaseReadiumView.js.map +1 -1
  4. package/lib/commonjs/components/ReadiumView.js +1 -1
  5. package/lib/commonjs/components/ReadiumView.js.map +1 -1
  6. package/lib/commonjs/enums/Appearance.js.map +1 -1
  7. package/lib/commonjs/enums/ColumnCount.js.map +1 -1
  8. package/lib/commonjs/enums/FontFamily.js.map +1 -1
  9. package/lib/commonjs/enums/TextAlignment.js.map +1 -1
  10. package/lib/commonjs/enums/index.js.map +1 -1
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/interfaces/Dimensions.js.map +1 -1
  13. package/lib/commonjs/interfaces/File.js.map +1 -1
  14. package/lib/commonjs/interfaces/Link.js.map +1 -1
  15. package/lib/commonjs/interfaces/Locator.js.map +1 -1
  16. package/lib/commonjs/interfaces/Settings.js.map +1 -1
  17. package/lib/commonjs/interfaces/index.js.map +1 -1
  18. package/lib/commonjs/utils/COMPONENT_NAME.js.map +1 -1
  19. package/lib/commonjs/utils/LINKING_ERROR.js.map +1 -1
  20. package/lib/commonjs/utils/RANGES.js.map +1 -1
  21. package/lib/commonjs/utils/clamp.js.map +1 -1
  22. package/lib/commonjs/utils/createFragment.js.map +1 -1
  23. package/lib/commonjs/utils/getWidthOrHeightValue.js.map +1 -1
  24. package/lib/commonjs/utils/index.js.map +1 -1
  25. package/lib/commonjs/utils/indexOfObjectValue.js.map +1 -1
  26. package/lib/module/components/BaseReadiumView.js.map +1 -1
  27. package/lib/module/components/ReadiumView.js +1 -1
  28. package/lib/module/components/ReadiumView.js.map +1 -1
  29. package/lib/module/enums/Appearance.js.map +1 -1
  30. package/lib/module/enums/ColumnCount.js.map +1 -1
  31. package/lib/module/enums/FontFamily.js.map +1 -1
  32. package/lib/module/enums/TextAlignment.js.map +1 -1
  33. package/lib/module/enums/index.js.map +1 -1
  34. package/lib/module/index.js.map +1 -1
  35. package/lib/module/interfaces/Dimensions.js.map +1 -1
  36. package/lib/module/interfaces/File.js.map +1 -1
  37. package/lib/module/interfaces/Link.js.map +1 -1
  38. package/lib/module/interfaces/Locator.js.map +1 -1
  39. package/lib/module/interfaces/Settings.js.map +1 -1
  40. package/lib/module/interfaces/index.js.map +1 -1
  41. package/lib/module/utils/COMPONENT_NAME.js.map +1 -1
  42. package/lib/module/utils/LINKING_ERROR.js.map +1 -1
  43. package/lib/module/utils/RANGES.js.map +1 -1
  44. package/lib/module/utils/clamp.js.map +1 -1
  45. package/lib/module/utils/createFragment.js.map +1 -1
  46. package/lib/module/utils/getWidthOrHeightValue.js.map +1 -1
  47. package/lib/module/utils/index.js.map +1 -1
  48. package/lib/module/utils/indexOfObjectValue.js.map +1 -1
  49. package/package.json +1 -1
@@ -1,4 +1,6 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.reactnativereadium">
3
-
2
+ package="com.reactnativereadium">
3
+ <application
4
+ android:networkSecurityConfig="@xml/network_security_config">
5
+ </application>
4
6
  </manifest>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <network-security-config>
3
+ <domain-config cleartextTrafficPermitted="true">
4
+ <!--
5
+ Required with r2-navigator-kotlin
6
+ Used to serve a publication's resources from the local HTTP server
7
+ -->
8
+ <domain includeSubdomains="false">127.0.0.1</domain>
9
+ <domain includeSubdomains="false">localhost</domain>
10
+ </domain-config>
11
+ </network-security-config>
@@ -1 +1 @@
1
- {"version":3,"names":["BaseReadiumView","UIManager","getViewManagerConfig","COMPONENT_NAME","requireNativeComponent","Error","LINKING_ERROR"],"sources":["BaseReadiumView.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport type { Settings, Link, Locator, File, } from '../interfaces';\nimport { COMPONENT_NAME, LINKING_ERROR } from '../utils';\n\nexport type BaseReadiumViewProps = {\n file: File;\n location?: Locator;\n settings?: Partial<Settings>;\n style?: ViewStyle;\n onLocationChange?: (locator: Locator) => void;\n onTableOfContents?: (toc: Link[] | null) => void;\n ref?: any;\n height?: number;\n width?: number;\n};\n\nexport const BaseReadiumView =\n UIManager.getViewManagerConfig(COMPONENT_NAME) != null\n ? requireNativeComponent<BaseReadiumViewProps>(COMPONENT_NAME)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"],"mappings":";;;;;;;AAAA;;AAOA;;AAcO,MAAMA,eAAe,GAC1BC,sBAAA,CAAUC,oBAAV,CAA+BC,qBAA/B,KAAkD,IAAlD,GACI,IAAAC,mCAAA,EAA6CD,qBAA7C,CADJ,GAEI,MAAM;EACJ,MAAM,IAAIE,KAAJ,CAAUC,oBAAV,CAAN;AACD,CALA"}
1
+ {"version":3,"sources":["BaseReadiumView.tsx"],"names":["BaseReadiumView","UIManager","getViewManagerConfig","COMPONENT_NAME","Error","LINKING_ERROR"],"mappings":";;;;;;;AAAA;;AAOA;;AAcO,MAAMA,eAAe,GAC1BC,uBAAUC,oBAAV,CAA+BC,qBAA/B,KAAkD,IAAlD,GACI,yCAA6CA,qBAA7C,CADJ,GAEI,MAAM;AACJ,QAAM,IAAIC,KAAJ,CAAUC,oBAAV,CAAN;AACD,CALA","sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport type { Settings, Link, Locator, File, } from '../interfaces';\nimport { COMPONENT_NAME, LINKING_ERROR } from '../utils';\n\nexport type BaseReadiumViewProps = {\n file: File;\n location?: Locator;\n settings?: Partial<Settings>;\n style?: ViewStyle;\n onLocationChange?: (locator: Locator) => void;\n onTableOfContents?: (toc: Link[] | null) => void;\n ref?: any;\n height?: number;\n width?: number;\n};\n\nexport const BaseReadiumView =\n UIManager.getViewManagerConfig(COMPONENT_NAME) != null\n ? requireNativeComponent<BaseReadiumViewProps>(COMPONENT_NAME)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"]}
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
 
22
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
24
  const ReadiumView = _ref => {
25
25
  let {
@@ -1 +1 @@
1
- {"version":3,"names":["ReadiumView","onLocationChange","wrappedOnLocationChange","onTableOfContents","wrappedOnTableOfContents","settings","unmappedSettings","props","ref","useRef","height","width","setDimensions","useState","onLayout","useCallback","nativeEvent","layout","dimension","event","toc","useEffect","Platform","OS","viewId","findNodeHandle","current","createFragment","styles","container","Settings","map","undefined","StyleSheet","create"],"sources":["ReadiumView.tsx"],"sourcesContent":["import React, { useCallback, useState, useRef, useEffect } from 'react';\nimport { View, Platform, findNodeHandle, StyleSheet } from 'react-native';\n\nimport type { Dimensions } from '../interfaces';\nimport { Settings } from '../interfaces';\nimport { createFragment, getWidthOrHeightValue as dimension } from '../utils';\nimport type { BaseReadiumViewProps } from './BaseReadiumView';\nimport { BaseReadiumView } from './BaseReadiumView';\n\ntype ReadiumProps = BaseReadiumViewProps;\n\nexport const ReadiumView: React.FC<ReadiumProps> = ({\n onLocationChange: wrappedOnLocationChange,\n onTableOfContents: wrappedOnTableOfContents,\n settings: unmappedSettings,\n ...props\n}) => {\n const ref = useRef(null);\n const [{ height, width }, setDimensions] = useState<Dimensions>({\n width: 0,\n height: 0,\n });\n // set the view dimensions on layout\n const onLayout = useCallback(({ nativeEvent: { layout: { width, height } }}) => {\n setDimensions({\n width: dimension(width),\n height: dimension(height),\n });\n }, []);\n // wrap the native onLocationChange and extract the raw event value\n const onLocationChange = useCallback((event: any) => {\n if (wrappedOnLocationChange) {\n wrappedOnLocationChange(event.nativeEvent);\n }\n }, [wrappedOnLocationChange]);\n\n const onTableOfContents = useCallback((event: any) => {\n if (wrappedOnTableOfContents) {\n const toc = event.nativeEvent.toc || null;\n wrappedOnTableOfContents(toc);\n }\n }, [wrappedOnTableOfContents]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const viewId = findNodeHandle(ref.current);\n createFragment(viewId);\n }\n }, [])\n\n return (\n <View\n style={styles.container}\n onLayout={onLayout}\n >\n <BaseReadiumView\n height={height}\n width={width}\n {...props}\n onLocationChange={onLocationChange}\n onTableOfContents={onTableOfContents}\n settings={unmappedSettings ? Settings.map(unmappedSettings) : undefined}\n ref={ref}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { width: '100%', height: '100%' },\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AAEA;;;;;;;;AAIO,MAAMA,WAAmC,GAAG,QAK7C;EAAA,IAL8C;IAClDC,gBAAgB,EAAEC,uBADgC;IAElDC,iBAAiB,EAAEC,wBAF+B;I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AAAC,qBAAA,EAAeH,MAAf;IACD;EACF,CALD,EAKG,EALH;EAOA,oBACE,6BAAC,iBAAD;IACE,KAAK,EAAEI,MAAM,CAACC,SADhB;IAEE,QAAQ,EAAEf;EAFZ,gBAIE,6BAAC,gCAAD;IACE,MAAM,EAAEJ,MADV;IAEE,KAAK,EAAEC;EAFT,GAGMJ,KAHN;IAIE,gBAAgB,EAAEN,gBAJpB;IAKE,iBAAiB,EAAEE,iBALrB;IAME,QAAQ,EAAEG,gBAAgB,GAAGwB,oBAAA,CAASC,GAAT,CAAazB,gBAAb,CAAH,GAAoC0B,SANhE;IAOE,GAAG,EAAExB;EAPP,GAJF,CADF;AAgBD,CAvDM;;;;AAyDP,MAAMoB,MAAM,GAAGK,uBAAA,CAAWC,MAAX,CAAkB;EAC/BL,SAAS,EAAE;IAAElB,KAAK,EAAE,MAAT;IAAiBD,MAAM,EAAE;EAAzB;AADoB,CAAlB,CAAf"}
1
+ {"version":3,"sources":["ReadiumView.tsx"],"names":["ReadiumView","onLocationChange","wrappedOnLocationChange","onTableOfContents","wrappedOnTableOfContents","settings","unmappedSettings","props","ref","height","width","setDimensions","onLayout","nativeEvent","layout","event","toc","Platform","OS","viewId","current","styles","container","Settings","map","undefined","StyleSheet","create"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;AACA;;AAEA;;;;;;;;AAIO,MAAMA,WAAmC,GAAG,QAK7C;AAAA,MAL8C;AAClDC,IAAAA,gBAAgB,EAAEC,uBADgC;AAElDC,IAAAA,iBAAiB,EAAEC,wBAF+B;AAGlDC,IAAAA,QAAQ,EAAEC,gBAHwC;AAIlD,OAAGC;AAJ+C,GAK9C;AACJ,QAAMC,GAAG,GAAG,mBAAO,IAAP,CAAZ;AACA,QAAM,CAAC;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAD,EAAoBC,aAApB,IAAqC,qBAAqB;AAC9DD,IAAAA,KAAK,EAAE,CADuD;AAE9DD,IAAAA,MAAM,EAAE;AAFsD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B;AAME,IAAA,QAAQ,EAAEG,gBAAgB,GAAGiB,qBAASC,GAAT,CAAalB,gBAAb,CAAH,GAAoCmB,SANhE;AAOE,IAAA,GAAG,EAAEjB;AAPP,KAJF,CADF;AAgBD,CAvDM;;;;AAyDP,MAAMa,MAAM,GAAGK,wBAAWC,MAAX,CAAkB;AAC/BL,EAAAA,SAAS,EAAE;AAAEZ,IAAAA,KAAK,EAAE,MAAT;AAAiBD,IAAAA,MAAM,EAAE;AAAzB;AADoB,CAAlB,CAAf","sourcesContent":["import React, { useCallback, useState, useRef, useEffect } from 'react';\nimport { View, Platform, findNodeHandle, StyleSheet } from 'react-native';\n\nimport type { Dimensions } from '../interfaces';\nimport { Settings } from '../interfaces';\nimport { createFragment, getWidthOrHeightValue as dimension } from '../utils';\nimport type { BaseReadiumViewProps } from './BaseReadiumView';\nimport { BaseReadiumView } from './BaseReadiumView';\n\ntype ReadiumProps = BaseReadiumViewProps;\n\nexport const ReadiumView: React.FC<ReadiumProps> = ({\n onLocationChange: wrappedOnLocationChange,\n onTableOfContents: wrappedOnTableOfContents,\n settings: unmappedSettings,\n ...props\n}) => {\n const ref = useRef(null);\n const [{ height, width }, setDimensions] = useState<Dimensions>({\n width: 0,\n height: 0,\n });\n // set the view dimensions on layout\n const onLayout = useCallback(({ nativeEvent: { layout: { width, height } }}) => {\n setDimensions({\n width: dimension(width),\n height: dimension(height),\n });\n }, []);\n // wrap the native onLocationChange and extract the raw event value\n const onLocationChange = useCallback((event: any) => {\n if (wrappedOnLocationChange) {\n wrappedOnLocationChange(event.nativeEvent);\n }\n }, [wrappedOnLocationChange]);\n\n const onTableOfContents = useCallback((event: any) => {\n if (wrappedOnTableOfContents) {\n const toc = event.nativeEvent.toc || null;\n wrappedOnTableOfContents(toc);\n }\n }, [wrappedOnTableOfContents]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const viewId = findNodeHandle(ref.current);\n createFragment(viewId);\n }\n }, [])\n\n return (\n <View\n style={styles.container}\n onLayout={onLayout}\n >\n <BaseReadiumView\n height={height}\n width={width}\n {...props}\n onLocationChange={onLocationChange}\n onTableOfContents={onTableOfContents}\n settings={unmappedSettings ? Settings.map(unmappedSettings) : undefined}\n ref={ref}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { width: '100%', height: '100%' },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["Appearance"],"sources":["Appearance.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum Appearance {\n /**\n * A traditional \"light\" mode\n */\n DEFAULT = 'readium-default-on',\n\n SEPIA = 'readium-sepia-on',\n\n /**\n * A traditional \"dark\" mode\n */\n NIGHT = 'readium-night-on',\n}\n"],"mappings":";;;;;;AAAA;IACYA,U;;;WAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,0BAAAA,U"}
1
+ {"version":3,"sources":["Appearance.ts"],"names":["Appearance"],"mappings":";;;;;;AAAA;IACYA,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum Appearance {\n /**\n * A traditional \"light\" mode\n */\n DEFAULT = 'readium-default-on',\n\n SEPIA = 'readium-sepia-on',\n\n /**\n * A traditional \"dark\" mode\n */\n NIGHT = 'readium-night-on',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["ColumnCount"],"sources":["ColumnCount.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum ColumnCount {\n AUTO = 'auto',\n ONE = '1',\n TWO = '2',\n}\n"],"mappings":";;;;;;AAAA;IACYA,W;;;WAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,W"}
1
+ {"version":3,"sources":["ColumnCount.ts"],"names":["ColumnCount"],"mappings":";;;;;;AAAA;IACYA,W;;;WAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,2BAAAA,W","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum ColumnCount {\n AUTO = 'auto',\n ONE = '1',\n TWO = '2',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["FontFamily"],"sources":["FontFamily.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum FontFamily {\n ORIGINAL = 'Original',\n HELVETICA_NEUE = 'Helvetica Neue',\n IOWAN_OLD_STYLE = 'Iowan Old Style',\n ATHELAS = 'Athelas',\n SERAVEK = 'Seravek',\n OPEN_DYSLEXIC = 'OpenDyslexic',\n ACCESSIBLE_DFA = 'AccessibleDfA',\n IA_WRITER_DUOSPACE = 'IA Writer Duospace',\n}\n"],"mappings":";;;;;;AAAA;IACYA,U;;;WAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,0BAAAA,U"}
1
+ {"version":3,"sources":["FontFamily.ts"],"names":["FontFamily"],"mappings":";;;;;;AAAA;IACYA,U;;;WAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,0BAAAA,U","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum FontFamily {\n ORIGINAL = 'Original',\n HELVETICA_NEUE = 'Helvetica Neue',\n IOWAN_OLD_STYLE = 'Iowan Old Style',\n ATHELAS = 'Athelas',\n SERAVEK = 'Seravek',\n OPEN_DYSLEXIC = 'OpenDyslexic',\n ACCESSIBLE_DFA = 'AccessibleDfA',\n IA_WRITER_DUOSPACE = 'IA Writer Duospace',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["TextAlignment"],"sources":["TextAlignment.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum TextAlignment {\n JUSTIFY = 'justify',\n START = 'start',\n}\n"],"mappings":";;;;;;AAAA;IACYA,a;;;WAAAA,a;EAAAA,a;EAAAA,a;GAAAA,a,6BAAAA,a"}
1
+ {"version":3,"sources":["TextAlignment.ts"],"names":["TextAlignment"],"mappings":";;;;;;AAAA;IACYA,a;;;WAAAA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;GAAAA,a,6BAAAA,a","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum TextAlignment {\n JUSTIFY = 'justify',\n START = 'start',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Appearance';\nexport * from './ColumnCount';\nexport * from './FontFamily';\nexport * from './TextAlignment';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './Appearance';\nexport * from './ColumnCount';\nexport * from './FontFamily';\nexport * from './TextAlignment';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\nexport * from './components/ReadiumView';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\nexport * from './components/ReadiumView';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Dimensions.ts"],"sourcesContent":["export interface Dimensions {\n width: number;\n height: number;\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["File.ts"],"sourcesContent":["import type { Locator } from './Locator';\n\n\nexport interface File {\n /**\n * A string path to an eBook on disk.\n */\n url: string;\n\n /**\n * An optional location that the eBook will be opened at.\n */\n initialLocation?: Locator;\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Link.ts"],"sourcesContent":["/**\n * An interface representing the Readium Link object.\n */\nexport interface Link {\n href: string;\n templated: boolean;\n type?: string | null;\n title?: string | null;\n rels?: Set<string>;\n properties?: any;\n height?: number | null;\n width?: number | null;\n bitrate?: number | null;\n duration?: number | null;\n languages?: string[];\n alternates?: Link[];\n children?: Link[];\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Locator.ts"],"sourcesContent":["/**\n * An interface representing the Readium Locator object.\n */\nexport interface Locator {\n href: string;\n type: string;\n target?: number;\n title?: string;\n locations?: {\n progression: number;\n position?: number;\n totalProgression?: number;\n };\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Settings","Appearance","DEFAULT","FontFamily","ORIGINAL","TextAlignment","JUSTIFY","ColumnCount","AUTO","map","settings","defaultValues","mapped","Object","keys","forEach","key","undefined","appearance","indexOfObjectValue","fontFamily","textAlign","colCount","RANGES","clamp"],"sources":["Settings.ts"],"sourcesContent":["import {\n Appearance,\n FontFamily,\n TextAlignment,\n ColumnCount,\n} from '../enums';\n\nimport {\n RANGES,\n indexOfObjectValue,\n clamp,\n} from '../utils';\n\n/**\n * A reader settings object with sensible defaults.\n */\nexport class Settings {\n // TODO:\n // - ligatures\n // - paraIndent\n appearance: Appearance = Appearance.DEFAULT;\n fontFamily: FontFamily = FontFamily.ORIGINAL;\n textAlign: TextAlignment = TextAlignment.JUSTIFY;\n colCount: ColumnCount = ColumnCount.AUTO;\n\n scroll: boolean = false;\n fontOverride: boolean = false;\n verticalScroll: boolean = false;\n bodyHyphens: boolean = false;\n advancedSettings: boolean = true;\n\n /**\n * Range: 100.0 - 300.0\n */\n fontSize: number = 100;\n\n /**\n * Range: 0.0 - 0.5\n */\n wordSpacing: number = 0;\n\n /**\n * Range: 0.0 - 0.5\n */\n letterSpacing: number = 0;\n\n /**\n * Range: 0.5 - 4.0\n */\n pageMargins: number = 0;\n\n /**\n * Range: 1.0 - 2.0\n */\n lineHeight: number = 1;\n\n /**\n * Range: 0.0 - 2.0\n */\n paragraphMargins?: number = 0;\n\n static map(settings: Partial<Settings>): any {\n const defaultValues = new Settings();\n const mapped: Record<string, any> = {};\n\n Object.keys(defaultValues)\n .forEach((key: string) => {\n // @ts-ignore\n mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];\n })\n ;\n\n mapped.appearance = indexOfObjectValue(Appearance, mapped.appearance);\n mapped.fontFamily = indexOfObjectValue(FontFamily, mapped.fontFamily);\n mapped.textAlign = indexOfObjectValue(TextAlignment, mapped.textAlign);\n mapped.colCount = indexOfObjectValue(ColumnCount, mapped.colCount);\n\n Object.keys(RANGES).forEach((key: string) => {\n // @ts-ignore\n mapped[key] = clamp(mapped[key], RANGES[key][0], RANGES[key][1]);\n });\n\n return mapped;\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAOA;;;;AAMA;AACA;AACA;AACO,MAAMA,QAAN,CAAe;EAAA;IAAA,oCAIKC,iBAAA,CAAWC,OAJhB;;IAAA,oCAKKC,iBAAA,CAAWC,QALhB;;IAAA,mCAMOC,oBAAA,CAAcC,OANrB;;IAAA,kCAOIC,kBAAA,CAAYC,IAPhB;;IAAA,gCASF,KATE;;IAAA,sCAUI,KAVJ;;IAAA,wCAWM,KAXN;;IAAA,qCAYG,KAZH;;IAAA,0CAaQ,IAbR;;IAAA,kCAkBD,GAlBC;;IAAA,qCAuBE,CAvBF;;IAAA,uCA4BI,CA5BJ;;IAAA,qCAiCE,CAjCF;;IAAA,oCAsCC,CAtCD;;IAAA,0CA2CQ,CA3CR;EAAA;;EA6CV,OAAHC,GAAG,CAACC,QAAD,EAAmC;IAC3C,MAAMC,aAAa,GAAG,IAAIX,QAAJ,EAAtB;IACA,MAAMY,MAA2B,GAAG,EAApC;IAEAC,MAAM,CAACC,IAAP,CAAYH,aAAZ,EACGI,OADH,CACYC,GAAD,IAAiB;MACxB;MACAJ,MAAM,CAACI,GAAD,CAAN,GAAcN,QAAQ,CAACM,GAAD,CAAR,KAAkBC,SAAlB,GAA8BP,QAAQ,CAACM,GAAD,CAAtC,GAA8CL,aAAa,CAACK,GAAD,CAAzE;IACD,CAJH;IAOAJ,MAAM,CAACM,UAAP,GAAoB,IAAAC,yBAAA,EAAmBlB,iBAAnB,EAA+BW,MAAM,CAACM,UAAtC,CAApB;IACAN,MAAM,CAACQ,UAAP,GAAoB,IAAAD,yBAAA,EAAmBhB,iBAAnB,EAA+BS,MAAM,CAACQ,UAAtC,CAApB;IACAR,MAAM,CAACS,SAAP,GAAmB,IAAAF,yBAAA,EAAmBd,oBAAnB,EAAkCO,MAAM,CAACS,SAAzC,CAAnB;IACAT,MAAM,CAACU,QAAP,GAAkB,IAAAH,yBAAA,EAAmBZ,kBAAnB,EAAgCK,MAAM,CAACU,QAAvC,CAAlB;IAEAT,MAAM,CAACC,IAAP,CAAYS,aAAZ,EAAoBR,OAApB,CAA6BC,GAAD,IAAiB;MAC3C;MACAJ,MAAM,CAACI,GAAD,CAAN,GAAc,IAAAQ,YAAA,EAAMZ,MAAM,CAACI,GAAD,CAAZ,EAAmBO,aAAA,CAAOP,GAAP,EAAY,CAAZ,CAAnB,EAAmCO,aAAA,CAAOP,GAAP,EAAY,CAAZ,CAAnC,CAAd;IACD,CAHD;IAKA,OAAOJ,MAAP;EACD;;AAnEmB"}
1
+ {"version":3,"sources":["Settings.ts"],"names":["Settings","Appearance","DEFAULT","FontFamily","ORIGINAL","TextAlignment","JUSTIFY","ColumnCount","AUTO","map","settings","defaultValues","mapped","Object","keys","forEach","key","undefined","appearance","fontFamily","textAlign","colCount","RANGES"],"mappings":";;;;;;;AAAA;;AAOA;;;;AAMA;AACA;AACA;AACO,MAAMA,QAAN,CAAe;AAAA;AAAA,wCAIKC,kBAAWC,OAJhB;;AAAA,wCAKKC,kBAAWC,QALhB;;AAAA,uCAMOC,qBAAcC,OANrB;;AAAA,sCAOIC,mBAAYC,IAPhB;;AAAA,oCASF,KATE;;AAAA,0CAUI,KAVJ;;AAAA,4CAWM,KAXN;;AAAA,yCAYG,KAZH;;AAAA,8CAaQ,IAbR;;AAAA,sCAkBD,GAlBC;;AAAA,yCAuBE,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n indexOfObjectValue,\n clamp,\n} from '../utils';\n\n/**\n * A reader settings object with sensible defaults.\n */\nexport class Settings {\n // TODO:\n // - ligatures\n // - paraIndent\n appearance: Appearance = Appearance.DEFAULT;\n fontFamily: FontFamily = FontFamily.ORIGINAL;\n textAlign: TextAlignment = TextAlignment.JUSTIFY;\n colCount: ColumnCount = ColumnCount.AUTO;\n\n scroll: boolean = false;\n fontOverride: boolean = false;\n verticalScroll: boolean = false;\n bodyHyphens: boolean = false;\n advancedSettings: boolean = true;\n\n /**\n * Range: 100.0 - 300.0\n */\n fontSize: number = 100;\n\n /**\n * Range: 0.0 - 0.5\n */\n wordSpacing: number = 0;\n\n /**\n * Range: 0.0 - 0.5\n */\n letterSpacing: number = 0;\n\n /**\n * Range: 0.5 - 4.0\n */\n pageMargins: number = 0;\n\n /**\n * Range: 1.0 - 2.0\n */\n lineHeight: number = 1;\n\n /**\n * Range: 0.0 - 2.0\n */\n paragraphMargins?: number = 0;\n\n static map(settings: Partial<Settings>): any {\n const defaultValues = new Settings();\n const mapped: Record<string, any> = {};\n\n Object.keys(defaultValues)\n .forEach((key: string) => {\n // @ts-ignore\n mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];\n })\n ;\n\n mapped.appearance = indexOfObjectValue(Appearance, mapped.appearance);\n mapped.fontFamily = indexOfObjectValue(FontFamily, mapped.fontFamily);\n mapped.textAlign = indexOfObjectValue(TextAlignment, mapped.textAlign);\n mapped.colCount = indexOfObjectValue(ColumnCount, mapped.colCount);\n\n Object.keys(RANGES).forEach((key: string) => {\n // @ts-ignore\n mapped[key] = clamp(mapped[key], RANGES[key][0], RANGES[key][1]);\n });\n\n return mapped;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Dimensions';\nexport * from './File';\nexport * from './Link';\nexport * from './Locator';\nexport * from './Settings';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './Dimensions';\nexport * from './File';\nexport * from './Link';\nexport * from './Locator';\nexport * from './Settings';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["COMPONENT_NAME"],"sources":["COMPONENT_NAME.ts"],"sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAG,aAAvB"}
1
+ {"version":3,"sources":["COMPONENT_NAME.ts"],"names":["COMPONENT_NAME"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAG,aAAvB","sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default"],"sources":["LINKING_ERROR.ts"],"sourcesContent":["import { Platform } from 'react-native';\n\nexport const LINKING_ERROR =\n `The package 'react-native-readium' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,aAAa,GACvB,+EAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK"}
1
+ {"version":3,"sources":["LINKING_ERROR.ts"],"names":["LINKING_ERROR","Platform","select","ios","default"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,aAAa,GACvB,+EAAD,GACAC,sBAASC,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK","sourcesContent":["import { Platform } from 'react-native';\n\nexport const LINKING_ERROR =\n `The package 'react-native-readium' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["RANGES","fontSize","wordSpacing","letterSpacing","pageMargins","lineHeight","paragraphMargins"],"sources":["RANGES.ts"],"sourcesContent":["export const RANGES = {\n fontSize: [100.0, 300.0],\n wordSpacing: [0.0, 0.5],\n letterSpacing: [0.0, 0.5],\n pageMargins: [0.5, 4.0],\n lineHeight: [1.0, 2.0],\n paragraphMargins: [0.0, 2.0],\n};\n"],"mappings":";;;;;;AAAO,MAAMA,MAAM,GAAG;EACpBC,QAAQ,EAAU,CAAC,KAAD,EAAQ,KAAR,CADE;EAEpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAFE;EAGpBC,aAAa,EAAK,CAAC,GAAD,EAAM,GAAN,CAHE;EAIpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAJE;EAKpBC,UAAU,EAAQ,CAAC,GAAD,EAAM,GAAN,CALE;EAMpBC,gBAAgB,EAAE,CAAC,GAAD,EAAM,GAAN;AANE,CAAf"}
1
+ {"version":3,"sources":["RANGES.ts"],"names":["RANGES","fontSize","wordSpacing","letterSpacing","pageMargins","lineHeight","paragraphMargins"],"mappings":";;;;;;AAAO,MAAMA,MAAM,GAAG;AACpBC,EAAAA,QAAQ,EAAU,CAAC,KAAD,EAAQ,KAAR,CADE;AAEpBC,EAAAA,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAFE;AAGpBC,EAAAA,aAAa,EAAK,CAAC,GAAD,EAAM,GAAN,CAHE;AAIpBC,EAAAA,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAJE;AAKpBC,EAAAA,UAAU,EAAQ,CAAC,GAAD,EAAM,GAAN,CALE;AAMpBC,EAAAA,gBAAgB,EAAE,CAAC,GAAD,EAAM,GAAN;AANE,CAAf","sourcesContent":["export const RANGES = {\n fontSize: [100.0, 300.0],\n wordSpacing: [0.0, 0.5],\n letterSpacing: [0.0, 0.5],\n pageMargins: [0.5, 4.0],\n lineHeight: [1.0, 2.0],\n paragraphMargins: [0.0, 2.0],\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["clamp","val","lower","upper"],"sources":["clamp.ts"],"sourcesContent":["export const clamp = (val: number, lower: number, upper: number): number => {\n if (val < lower) return lower;\n if (val > upper) return upper;\n return val;\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,KAAK,GAAG,CAACC,GAAD,EAAcC,KAAd,EAA6BC,KAA7B,KAAuD;EAC1E,IAAIF,GAAG,GAAGC,KAAV,EAAiB,OAAOA,KAAP;EACjB,IAAID,GAAG,GAAGE,KAAV,EAAiB,OAAOA,KAAP;EACjB,OAAOF,GAAP;AACD,CAJM"}
1
+ {"version":3,"sources":["clamp.ts"],"names":["clamp","val","lower","upper"],"mappings":";;;;;;;AAAO,MAAMA,KAAK,GAAG,CAACC,GAAD,EAAcC,KAAd,EAA6BC,KAA7B,KAAuD;AAC1E,MAAIF,GAAG,GAAGC,KAAV,EAAiB,OAAOA,KAAP;AACjB,MAAID,GAAG,GAAGE,KAAV,EAAiB,OAAOA,KAAP;AACjB,SAAOF,GAAP;AACD,CAJM","sourcesContent":["export const clamp = (val: number, lower: number, upper: number): number => {\n if (val < lower) return lower;\n if (val > upper) return upper;\n return val;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["createFragment","viewId","UIManager","dispatchViewManagerCommand","getViewManagerConfig","COMPONENT_NAME","Commands","create","toString"],"sources":["createFragment.ts"],"sourcesContent":["import { UIManager } from 'react-native';\n\nimport { COMPONENT_NAME } from './COMPONENT_NAME';\n\nexport const createFragment = (viewId: number | null) => {\n if (viewId !== null) {\n UIManager.dispatchViewManagerCommand(\n viewId,\n // we are calling the 'create' command\n // @ts-ignore\n UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.create.toString(),\n [viewId],\n );\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,cAAc,GAAIC,MAAD,IAA2B;EACvD,IAAIA,MAAM,KAAK,IAAf,EAAqB;IACnBC,sBAAA,CAAUC,0BAAV,CACEF,MADF,EAEE;IACA;IACAC,sBAAA,CAAUE,oBAAV,CAA+BC,8BAA/B,EAA+CC,QAA/C,CAAwDC,MAAxD,CAA+DC,QAA/D,EAJF,EAKE,CAACP,MAAD,CALF;EAOD;AACF,CAVM"}
1
+ {"version":3,"sources":["createFragment.ts"],"names":["createFragment","viewId","UIManager","dispatchViewManagerCommand","getViewManagerConfig","COMPONENT_NAME","Commands","create","toString"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,cAAc,GAAIC,MAAD,IAA2B;AACvD,MAAIA,MAAM,KAAK,IAAf,EAAqB;AACnBC,2BAAUC,0BAAV,CACEF,MADF,EAEE;AACA;AACAC,2BAAUE,oBAAV,CAA+BC,8BAA/B,EAA+CC,QAA/C,CAAwDC,MAAxD,CAA+DC,QAA/D,EAJF,EAKE,CAACP,MAAD,CALF;AAOD;AACF,CAVM","sourcesContent":["import { UIManager } from 'react-native';\n\nimport { COMPONENT_NAME } from './COMPONENT_NAME';\n\nexport const createFragment = (viewId: number | null) => {\n if (viewId !== null) {\n UIManager.dispatchViewManagerCommand(\n viewId,\n // we are calling the 'create' command\n // @ts-ignore\n UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.create.toString(),\n [viewId],\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["getWidthOrHeightValue","val","Platform","OS","PixelRatio","getPixelSizeForLayoutSize"],"sources":["getWidthOrHeightValue.ts"],"sourcesContent":["import { Platform, PixelRatio } from 'react-native';\n\nexport const getWidthOrHeightValue = (val: number) => {\n return Platform.OS === 'android' ? PixelRatio.getPixelSizeForLayoutSize(val) : val;\n}\n"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,qBAAqB,GAAIC,GAAD,IAAiB;EACpD,OAAOC,qBAAA,CAASC,EAAT,KAAgB,SAAhB,GAA4BC,uBAAA,CAAWC,yBAAX,CAAqCJ,GAArC,CAA5B,GAAwEA,GAA/E;AACD,CAFM"}
1
+ {"version":3,"sources":["getWidthOrHeightValue.ts"],"names":["getWidthOrHeightValue","val","Platform","OS","PixelRatio","getPixelSizeForLayoutSize"],"mappings":";;;;;;;AAAA;;AAEO,MAAMA,qBAAqB,GAAIC,GAAD,IAAiB;AACpD,SAAOC,sBAASC,EAAT,KAAgB,SAAhB,GAA4BC,wBAAWC,yBAAX,CAAqCJ,GAArC,CAA5B,GAAwEA,GAA/E;AACD,CAFM","sourcesContent":["import { Platform, PixelRatio } from 'react-native';\n\nexport const getWidthOrHeightValue = (val: number) => {\n return Platform.OS === 'android' ? PixelRatio.getPixelSizeForLayoutSize(val) : val;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './clamp';\nexport * from './COMPONENT_NAME';\nexport * from './createFragment';\nexport * from './getWidthOrHeightValue';\nexport * from './indexOfObjectValue';\nexport * from './LINKING_ERROR';\nexport * from './RANGES';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './clamp';\nexport * from './COMPONENT_NAME';\nexport * from './createFragment';\nexport * from './getWidthOrHeightValue';\nexport * from './indexOfObjectValue';\nexport * from './LINKING_ERROR';\nexport * from './RANGES';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["indexOfObjectValue","obj","val","Object","values","indexOf"],"sources":["indexOfObjectValue.ts"],"sourcesContent":["export const indexOfObjectValue = (obj: any, val: any): number => {\n return Object.values(obj).indexOf(val);\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,kBAAkB,GAAG,CAACC,GAAD,EAAWC,GAAX,KAAgC;EAChE,OAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBI,OAAnB,CAA2BH,GAA3B,CAAP;AACD,CAFM"}
1
+ {"version":3,"sources":["indexOfObjectValue.ts"],"names":["indexOfObjectValue","obj","val","Object","values","indexOf"],"mappings":";;;;;;;AAAO,MAAMA,kBAAkB,GAAG,CAACC,GAAD,EAAWC,GAAX,KAAgC;AAChE,SAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBI,OAAnB,CAA2BH,GAA3B,CAAP;AACD,CAFM","sourcesContent":["export const indexOfObjectValue = (obj: any, val: any): number => {\n return Object.values(obj).indexOf(val);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["requireNativeComponent","UIManager","COMPONENT_NAME","LINKING_ERROR","BaseReadiumView","getViewManagerConfig","Error"],"sources":["BaseReadiumView.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport type { Settings, Link, Locator, File, } from '../interfaces';\nimport { COMPONENT_NAME, LINKING_ERROR } from '../utils';\n\nexport type BaseReadiumViewProps = {\n file: File;\n location?: Locator;\n settings?: Partial<Settings>;\n style?: ViewStyle;\n onLocationChange?: (locator: Locator) => void;\n onTableOfContents?: (toc: Link[] | null) => void;\n ref?: any;\n height?: number;\n width?: number;\n};\n\nexport const BaseReadiumView =\n UIManager.getViewManagerConfig(COMPONENT_NAME) != null\n ? requireNativeComponent<BaseReadiumViewProps>(COMPONENT_NAME)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"],"mappings":"AAAA,SACEA,sBADF,EAEEC,SAFF,QAIO,cAJP;AAOA,SAASC,cAAT,EAAyBC,aAAzB,QAA8C,UAA9C;AAcA,OAAO,MAAMC,eAAe,GAC1BH,SAAS,CAACI,oBAAV,CAA+BH,cAA/B,KAAkD,IAAlD,GACIF,sBAAsB,CAAuBE,cAAvB,CAD1B,GAEI,MAAM;EACJ,MAAM,IAAII,KAAJ,CAAUH,aAAV,CAAN;AACD,CALA"}
1
+ {"version":3,"sources":["BaseReadiumView.tsx"],"names":["requireNativeComponent","UIManager","COMPONENT_NAME","LINKING_ERROR","BaseReadiumView","getViewManagerConfig","Error"],"mappings":"AAAA,SACEA,sBADF,EAEEC,SAFF,QAIO,cAJP;AAOA,SAASC,cAAT,EAAyBC,aAAzB,QAA8C,UAA9C;AAcA,OAAO,MAAMC,eAAe,GAC1BH,SAAS,CAACI,oBAAV,CAA+BH,cAA/B,KAAkD,IAAlD,GACIF,sBAAsB,CAAuBE,cAAvB,CAD1B,GAEI,MAAM;AACJ,QAAM,IAAII,KAAJ,CAAUH,aAAV,CAAN;AACD,CALA","sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport type { Settings, Link, Locator, File, } from '../interfaces';\nimport { COMPONENT_NAME, LINKING_ERROR } from '../utils';\n\nexport type BaseReadiumViewProps = {\n file: File;\n location?: Locator;\n settings?: Partial<Settings>;\n style?: ViewStyle;\n onLocationChange?: (locator: Locator) => void;\n onTableOfContents?: (toc: Link[] | null) => void;\n ref?: any;\n height?: number;\n width?: number;\n};\n\nexport const BaseReadiumView =\n UIManager.getViewManagerConfig(COMPONENT_NAME) != null\n ? requireNativeComponent<BaseReadiumViewProps>(COMPONENT_NAME)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"]}
@@ -1,4 +1,4 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React, { useCallback, useState, useRef, useEffect } from 'react';
4
4
  import { View, Platform, findNodeHandle, StyleSheet } from 'react-native';
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useState","useRef","useEffect","View","Platform","findNodeHandle","StyleSheet","Settings","createFragment","getWidthOrHeightValue","dimension","BaseReadiumView","ReadiumView","onLocationChange","wrappedOnLocationChange","onTableOfContents","wrappedOnTableOfContents","settings","unmappedSettings","props","ref","height","width","setDimensions","onLayout","nativeEvent","layout","event","toc","OS","viewId","current","styles","container","map","undefined","create"],"sources":["ReadiumView.tsx"],"sourcesContent":["import React, { useCallback, useState, useRef, useEffect } from 'react';\nimport { View, Platform, findNodeHandle, StyleSheet } from 'react-native';\n\nimport type { Dimensions } from '../interfaces';\nimport { Settings } from '../interfaces';\nimport { createFragment, getWidthOrHeightValue as dimension } from '../utils';\nimport type { BaseReadiumViewProps } from './BaseReadiumView';\nimport { BaseReadiumView } from './BaseReadiumView';\n\ntype ReadiumProps = BaseReadiumViewProps;\n\nexport const ReadiumView: React.FC<ReadiumProps> = ({\n onLocationChange: wrappedOnLocationChange,\n onTableOfContents: wrappedOnTableOfContents,\n settings: unmappedSettings,\n ...props\n}) => {\n const ref = useRef(null);\n const [{ height, width }, setDimensions] = useState<Dimensions>({\n width: 0,\n height: 0,\n });\n // set the view dimensions on layout\n const onLayout = useCallback(({ nativeEvent: { layout: { width, height } }}) => {\n setDimensions({\n width: dimension(width),\n height: dimension(height),\n });\n }, []);\n // wrap the native onLocationChange and extract the raw event value\n const onLocationChange = useCallback((event: any) => {\n if (wrappedOnLocationChange) {\n wrappedOnLocationChange(event.nativeEvent);\n }\n }, [wrappedOnLocationChange]);\n\n const onTableOfContents = useCallback((event: any) => {\n if (wrappedOnTableOfContents) {\n const toc = event.nativeEvent.toc || null;\n wrappedOnTableOfContents(toc);\n }\n }, [wrappedOnTableOfContents]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const viewId = findNodeHandle(ref.current);\n createFragment(viewId);\n }\n }, [])\n\n return (\n <View\n style={styles.container}\n onLayout={onLayout}\n >\n <BaseReadiumView\n height={height}\n width={width}\n {...props}\n onLocationChange={onLocationChange}\n onTableOfContents={onTableOfContents}\n settings={unmappedSettings ? Settings.map(unmappedSettings) : undefined}\n ref={ref}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { width: '100%', height: '100%' },\n});\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,QAA7B,EAAuCC,MAAvC,EAA+CC,SAA/C,QAAgE,OAAhE;AACA,SAASC,IAAT,EAAeC,QAAf,EAAyBC,cAAzB,EAAyCC,UAAzC,QAA2D,cAA3D;AAGA,SAASC,QAAT,QAAyB,eAAzB;AACA,SAASC,cAAT,EAAyBC,qBAAqB,IAAIC,SAAlD,QAAmE,UAAnE;AAEA,SAASC,eAAT,QAAgC,mBAAhC;AAIA,OAAO,MAAMC,WAAmC,GAAG,QAK7C;EAAA,IAL8C;IAClDC,gBAAgB,EAAEC,uBADgC;IAElDC,iBAAiB,EAAEC,wBAF+B;IAGlDC,QAAQ,EAAEC,gBAHwC;IAIlD,GAAGC;EAJ+C,CAK9C;EACJ,MAAMC,GAAG,GAAGnB,MAAM,CAAC,IAAD,CAAlB;EACA,MAAM,CAAC;IAAEoB,MAAF;IAAUC;EAAV,CAAD,EAAoBC,aAApB,IAAqCvB,QAAQ,CAAa;IAC9DsB,KAAK,EAAE,CADuD;IAE9DD,MAAM,EAAE;EAFsD,CAAb,CAAnD,CAFI,CAMJ;;EACA,MAAMG,QAAQ,GAAGzB,WAAW,CAAC,SAAmD;IAAA,IAAlD;MAAE0B,WAAW,EAAE;QAAEC,MAAM,EAAE;UAAEJ,KAAF;UAASD;QAAT;M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AAC8B,MAAX,CAAkB;EAC/BH,SAAS,EAAE;IAAEX,KAAK,EAAE,MAAT;IAAiBD,MAAM,EAAE;EAAzB;AADoB,CAAlB,CAAf"}
1
+ {"version":3,"sources":["ReadiumView.tsx"],"names":["React","useCallback","useState","useRef","useEffect","View","Platform","findNodeHandle","StyleSheet","Settings","createFragment","getWidthOrHeightValue","dimension","BaseReadiumView","ReadiumView","onLocationChange","wrappedOnLocationChange","onTableOfContents","wrappedOnTableOfContents","settings","unmappedSettings","props","ref","height","width","setDimensions","onLayout","nativeEvent","layout","event","toc","OS","viewId","current","styles","container","map","undefined","create"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,QAA7B,EAAuCC,MAAvC,EAA+CC,SAA/C,QAAgE,OAAhE;AACA,SAASC,IAAT,EAAeC,QAAf,EAAyBC,cAAzB,EAAyCC,UAAzC,QAA2D,cAA3D;AAGA,SAASC,QAAT,QAAyB,eAAzB;AACA,SAASC,cAAT,EAAyBC,qBAAqB,IAAIC,SAAlD,QAAmE,UAAnE;AAEA,SAASC,eAAT,QAAgC,mBAAhC;AAIA,OAAO,MAAMC,WAAmC,GAAG,QAK7C;AAAA,MAL8C;AAClDC,IAAAA,gBAAgB,EAAEC,uBADgC;AAElDC,IAAAA,iBAAiB,EAAEC,wBAF+B;AAGlDC,IAAAA,QAAQ,EAAEC,gBAHwC;AAIlD,OAAGC;AAJ+C,GAK9C;AACJ,QAAMC,GAAG,GAAGnB,MAAM,CAAC,IAAD,CAAlB;AACA,QAAM,CAAC;AAAEoB,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAAD,EAAoBC,aAApB,IAAqCvB,QAAQ,CAAa;AAC9DsB,IAAAA,KAAK,EAAE,CADuD;AAE9DD,IAAAA,MAAM,EAAE;AAFsD,GAAb,CAAnD,CAFI,CAMJ;;AACA,QAAMG,QAAQ,GAAGzB,WAAW,CAAC,SAAmD;AAAA,QAAlD;AAAE0B,MAAAA,WAAW,EAAE;AAA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AAgB,GAAGX,QAAQ,CAAC2B,GAAT,CAAahB,gBAAb,CAAH,GAAoCiB,SANhE;AAOE,IAAA,GAAG,EAAEf;AAPP,KAJF,CADF;AAgBD,CAvDM;AAyDP,MAAMY,MAAM,GAAG1B,UAAU,CAAC8B,MAAX,CAAkB;AAC/BH,EAAAA,SAAS,EAAE;AAAEX,IAAAA,KAAK,EAAE,MAAT;AAAiBD,IAAAA,MAAM,EAAE;AAAzB;AADoB,CAAlB,CAAf","sourcesContent":["import React, { useCallback, useState, useRef, useEffect } from 'react';\nimport { View, Platform, findNodeHandle, StyleSheet } from 'react-native';\n\nimport type { Dimensions } from '../interfaces';\nimport { Settings } from '../interfaces';\nimport { createFragment, getWidthOrHeightValue as dimension } from '../utils';\nimport type { BaseReadiumViewProps } from './BaseReadiumView';\nimport { BaseReadiumView } from './BaseReadiumView';\n\ntype ReadiumProps = BaseReadiumViewProps;\n\nexport const ReadiumView: React.FC<ReadiumProps> = ({\n onLocationChange: wrappedOnLocationChange,\n onTableOfContents: wrappedOnTableOfContents,\n settings: unmappedSettings,\n ...props\n}) => {\n const ref = useRef(null);\n const [{ height, width }, setDimensions] = useState<Dimensions>({\n width: 0,\n height: 0,\n });\n // set the view dimensions on layout\n const onLayout = useCallback(({ nativeEvent: { layout: { width, height } }}) => {\n setDimensions({\n width: dimension(width),\n height: dimension(height),\n });\n }, []);\n // wrap the native onLocationChange and extract the raw event value\n const onLocationChange = useCallback((event: any) => {\n if (wrappedOnLocationChange) {\n wrappedOnLocationChange(event.nativeEvent);\n }\n }, [wrappedOnLocationChange]);\n\n const onTableOfContents = useCallback((event: any) => {\n if (wrappedOnTableOfContents) {\n const toc = event.nativeEvent.toc || null;\n wrappedOnTableOfContents(toc);\n }\n }, [wrappedOnTableOfContents]);\n\n useEffect(() => {\n if (Platform.OS === 'android') {\n const viewId = findNodeHandle(ref.current);\n createFragment(viewId);\n }\n }, [])\n\n return (\n <View\n style={styles.container}\n onLayout={onLayout}\n >\n <BaseReadiumView\n height={height}\n width={width}\n {...props}\n onLocationChange={onLocationChange}\n onTableOfContents={onTableOfContents}\n settings={unmappedSettings ? Settings.map(unmappedSettings) : undefined}\n ref={ref}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { width: '100%', height: '100%' },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["Appearance"],"sources":["Appearance.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum Appearance {\n /**\n * A traditional \"light\" mode\n */\n DEFAULT = 'readium-default-on',\n\n SEPIA = 'readium-sepia-on',\n\n /**\n * A traditional \"dark\" mode\n */\n NIGHT = 'readium-night-on',\n}\n"],"mappings":"AAAA;AACA,WAAYA,UAAZ;;WAAYA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,KAAAA,U"}
1
+ {"version":3,"sources":["Appearance.ts"],"names":["Appearance"],"mappings":"AAAA;AACA,WAAYA,UAAZ;;WAAYA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,KAAAA,U","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum Appearance {\n /**\n * A traditional \"light\" mode\n */\n DEFAULT = 'readium-default-on',\n\n SEPIA = 'readium-sepia-on',\n\n /**\n * A traditional \"dark\" mode\n */\n NIGHT = 'readium-night-on',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["ColumnCount"],"sources":["ColumnCount.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum ColumnCount {\n AUTO = 'auto',\n ONE = '1',\n TWO = '2',\n}\n"],"mappings":"AAAA;AACA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W"}
1
+ {"version":3,"sources":["ColumnCount.ts"],"names":["ColumnCount"],"mappings":"AAAA;AACA,WAAYA,WAAZ;;WAAYA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;AAAAA,EAAAA,W;GAAAA,W,KAAAA,W","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum ColumnCount {\n AUTO = 'auto',\n ONE = '1',\n TWO = '2',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["FontFamily"],"sources":["FontFamily.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum FontFamily {\n ORIGINAL = 'Original',\n HELVETICA_NEUE = 'Helvetica Neue',\n IOWAN_OLD_STYLE = 'Iowan Old Style',\n ATHELAS = 'Athelas',\n SERAVEK = 'Seravek',\n OPEN_DYSLEXIC = 'OpenDyslexic',\n ACCESSIBLE_DFA = 'AccessibleDfA',\n IA_WRITER_DUOSPACE = 'IA Writer Duospace',\n}\n"],"mappings":"AAAA;AACA,WAAYA,UAAZ;;WAAYA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,KAAAA,U"}
1
+ {"version":3,"sources":["FontFamily.ts"],"names":["FontFamily"],"mappings":"AAAA;AACA,WAAYA,UAAZ;;WAAYA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;AAAAA,EAAAA,U;GAAAA,U,KAAAA,U","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum FontFamily {\n ORIGINAL = 'Original',\n HELVETICA_NEUE = 'Helvetica Neue',\n IOWAN_OLD_STYLE = 'Iowan Old Style',\n ATHELAS = 'Athelas',\n SERAVEK = 'Seravek',\n OPEN_DYSLEXIC = 'OpenDyslexic',\n ACCESSIBLE_DFA = 'AccessibleDfA',\n IA_WRITER_DUOSPACE = 'IA Writer Duospace',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["TextAlignment"],"sources":["TextAlignment.ts"],"sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum TextAlignment {\n JUSTIFY = 'justify',\n START = 'start',\n}\n"],"mappings":"AAAA;AACA,WAAYA,aAAZ;;WAAYA,a;EAAAA,a;EAAAA,a;GAAAA,a,KAAAA,a"}
1
+ {"version":3,"sources":["TextAlignment.ts"],"names":["TextAlignment"],"mappings":"AAAA;AACA,WAAYA,aAAZ;;WAAYA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;GAAAA,a,KAAAA,a","sourcesContent":["// NOTE: readium uses an index so the order is very important here\nexport enum TextAlignment {\n JUSTIFY = 'justify',\n START = 'start',\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Appearance';\nexport * from './ColumnCount';\nexport * from './FontFamily';\nexport * from './TextAlignment';\n"],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,eAAd;AACA,cAAc,cAAd;AACA,cAAc,iBAAd"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,eAAd;AACA,cAAc,cAAd;AACA,cAAc,iBAAd","sourcesContent":["export * from './Appearance';\nexport * from './ColumnCount';\nexport * from './FontFamily';\nexport * from './TextAlignment';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["RANGES"],"sources":["index.tsx"],"sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\nexport * from './components/ReadiumView';\n"],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,cAAd;AACA,SAASA,MAAT,QAAuB,SAAvB;AACA,cAAc,0BAAd"}
1
+ {"version":3,"sources":["index.tsx"],"names":["RANGES"],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,cAAd;AACA,SAASA,MAAT,QAAuB,SAAvB;AACA,cAAc,0BAAd","sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\nexport * from './components/ReadiumView';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Dimensions.ts"],"sourcesContent":["export interface Dimensions {\n width: number;\n height: number;\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["File.ts"],"sourcesContent":["import type { Locator } from './Locator';\n\n\nexport interface File {\n /**\n * A string path to an eBook on disk.\n */\n url: string;\n\n /**\n * An optional location that the eBook will be opened at.\n */\n initialLocation?: Locator;\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Link.ts"],"sourcesContent":["/**\n * An interface representing the Readium Link object.\n */\nexport interface Link {\n href: string;\n templated: boolean;\n type?: string | null;\n title?: string | null;\n rels?: Set<string>;\n properties?: any;\n height?: number | null;\n width?: number | null;\n bitrate?: number | null;\n duration?: number | null;\n languages?: string[];\n alternates?: Link[];\n children?: Link[];\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Locator.ts"],"sourcesContent":["/**\n * An interface representing the Readium Locator object.\n */\nexport interface Locator {\n href: string;\n type: string;\n target?: number;\n title?: string;\n locations?: {\n progression: number;\n position?: number;\n totalProgression?: number;\n };\n}\n"],"mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Appearance","FontFamily","TextAlignment","ColumnCount","RANGES","indexOfObjectValue","clamp","Settings","DEFAULT","ORIGINAL","JUSTIFY","AUTO","map","settings","defaultValues","mapped","Object","keys","forEach","key","undefined","appearance","fontFamily","textAlign","colCount"],"sources":["Settings.ts"],"sourcesContent":["import {\n Appearance,\n FontFamily,\n TextAlignment,\n ColumnCount,\n} from '../enums';\n\nimport {\n RANGES,\n indexOfObjectValue,\n clamp,\n} from '../utils';\n\n/**\n * A reader settings object with sensible defaults.\n */\nexport class Settings {\n // TODO:\n // - ligatures\n // - paraIndent\n appearance: Appearance = Appearance.DEFAULT;\n fontFamily: FontFamily = FontFamily.ORIGINAL;\n textAlign: TextAlignment = TextAlignment.JUSTIFY;\n colCount: ColumnCount = ColumnCount.AUTO;\n\n scroll: boolean = false;\n fontOverride: boolean = false;\n verticalScroll: boolean = false;\n bodyHyphens: boolean = false;\n advancedSettings: boolean = true;\n\n /**\n * Range: 100.0 - 300.0\n */\n fontSize: number = 100;\n\n /**\n * Range: 0.0 - 0.5\n */\n wordSpacing: number = 0;\n\n /**\n * Range: 0.0 - 0.5\n */\n letterSpacing: number = 0;\n\n /**\n * Range: 0.5 - 4.0\n */\n pageMargins: number = 0;\n\n /**\n * Range: 1.0 - 2.0\n */\n lineHeight: number = 1;\n\n /**\n * Range: 0.0 - 2.0\n */\n paragraphMargins?: number = 0;\n\n static map(settings: Partial<Settings>): any {\n const defaultValues = new Settings();\n const mapped: Record<string, any> = {};\n\n Object.keys(defaultValues)\n .forEach((key: string) => {\n // @ts-ignore\n mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];\n })\n ;\n\n mapped.appearance = indexOfObjectValue(Appearance, mapped.appearance);\n mapped.fontFamily = indexOfObjectValue(FontFamily, mapped.fontFamily);\n mapped.textAlign = indexOfObjectValue(TextAlignment, mapped.textAlign);\n mapped.colCount = indexOfObjectValue(ColumnCount, mapped.colCount);\n\n Object.keys(RANGES).forEach((key: string) => {\n // @ts-ignore\n mapped[key] = clamp(mapped[key], RANGES[key][0], RANGES[key][1]);\n });\n\n return mapped;\n }\n}\n"],"mappings":";;AAAA,SACEA,UADF,EAEEC,UAFF,EAGEC,aAHF,EAIEC,WAJF,QAKO,UALP;AAOA,SACEC,MADF,EAEEC,kBAFF,EAGEC,KAHF,QAIO,UAJP;AAMA;AACA;AACA;;AACA,OAAO,MAAMC,QAAN,CAAe;EAAA;IAAA,oCAIKP,UAAU,CAACQ,OAJhB;;IAAA,oCAKKP,UAAU,CAACQ,QALhB;;IAAA,mCAMOP,aAAa,CAACQ,OANrB;;IAAA,kCAOI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CAA9B,CAAnB;IACD,CAHD;IAKA,OAAOJ,MAAP;EACD;;AAnEmB"}
1
+ {"version":3,"sources":["Settings.ts"],"names":["Appearance","FontFamily","TextAlignment","ColumnCount","RANGES","indexOfObjectValue","clamp","Settings","DEFAULT","ORIGINAL","JUSTIFY","AUTO","map","settings","defaultValues","mapped","Object","keys","forEach","key","undefined","appearance","fontFamily","textAlign","colCount"],"mappings":";;AAAA,SACEA,UADF,EAEEC,UAFF,EAGEC,aAHF,EAIEC,WAJF,QAKO,UALP;AAOA,SACEC,MADF,EAEEC,kBAFF,EAGEC,KAHF,QAIO,UAJP;AAMA;AACA;AACA;;AACA,OAAO,MAAMC,QAAN,CAAe;AAAA;AAAA,wCAIKP,UAAU,CAACQ,OAJhB;;AAAA,wCAKKP,UAAU,CAACQ,QALhB;;AAAA,uCAMOP,aAAa,CAACQ,OANrB;;AAAA,sCAOIP,WAAW,CAACQ,IAPhB;;AAAA,oCASF,KATE;;AAAA,0CAUI,KAVJ;;AAAA,4CAWM,KAXN;;AAAA,yCAYG,KAZH;;AAAA,8CAaQ,IAbR;;AAAA,sCAkBD,GAlBC;;AAAA,yCAuBE,CAvBF;;AAAA,2CA4BI,CA5BJ;;AAAA,yCAiCE,CAjCF;;AAAA,wCAsCC,CAtCD;;AAAA,8CA2CQ,CA3CR;AAAA;;AA6CV,SAAHC,GAAG,CAACC,QAAD,EAAmC;AAC3C,UAAMC,aAAa,GAAG,IAAIP,QAAJ,EAAtB;AACA,UAAMQ,MAA2B,GAAG,EAApC;AAEAC,IAAAA,MAAM,CAACC,IAAP,CAAYH,aAAZ,EACGI,OADH,CACYC,GAAD,IAAiB;AACxB;AACAJ,MAAAA,MAAM,CAACI,GAAD,CAAN,GAAcN,QAAQ,CAACM,GAAD,CAAR,KAAkBC,SAAlB,GAA8BP,QAAQ,CAACM,GAAD,CAAtC,GAA8CL,aAAa,CAACK,GAAD,CAAzE;AACD,KAJH;AAOAJ,IAAAA,MAAM,CAACM,UAAP,GAAoBhB,kBAAkB,CAACL,UAAD,EAAae,MAAM,CAACM,UAApB,CAAtC;AACAN,IAAAA,MAAM,CAACO,UAAP,GAAoBjB,kBAAkB,CAACJ,UAAD,EAAac,MAAM,CAACO,UAApB,CAAtC;AACAP,IAAAA,MAAM,CAACQ,SAAP,GAAmBlB,kBAAkB,CAACH,aAAD,EAAgBa,MAAM,CAACQ,SAAvB,CAArC;AACAR,IAAAA,MAAM,CAACS,QAAP,GAAkBnB,kBAAkB,CAACF,WAAD,EAAcY,MAAM,CAACS,QAArB,CAApC;AAEAR,IAAAA,MAAM,CAACC,IAAP,CAAYb,MAAZ,EAAoBc,OAApB,CAA6BC,GAAD,IAAiB;AAC3C;AACAJ,MAAAA,MAAM,CAACI,GAAD,CAAN,GAAcb,KAAK,CAACS,MAAM,CAACI,GAAD,CAAP,EAAcf,MAAM,CAACe,GAAD,CAAN,CAAY,CAAZ,CAAd,EAA8Bf,MAAM,CAACe,GAAD,CAAN,CAAY,CAAZ,CAA9B,CAAnB;AACD,KAHD;AAKA,WAAOJ,MAAP;AACD;;AAnEmB","sourcesContent":["import {\n Appearance,\n FontFamily,\n TextAlignment,\n ColumnCount,\n} from '../enums';\n\nimport {\n RANGES,\n indexOfObjectValue,\n clamp,\n} from '../utils';\n\n/**\n * A reader settings object with sensible defaults.\n */\nexport class Settings {\n // TODO:\n // - ligatures\n // - paraIndent\n appearance: Appearance = Appearance.DEFAULT;\n fontFamily: FontFamily = FontFamily.ORIGINAL;\n textAlign: TextAlignment = TextAlignment.JUSTIFY;\n colCount: ColumnCount = ColumnCount.AUTO;\n\n scroll: boolean = false;\n fontOverride: boolean = false;\n verticalScroll: boolean = false;\n bodyHyphens: boolean = false;\n advancedSettings: boolean = true;\n\n /**\n * Range: 100.0 - 300.0\n */\n fontSize: number = 100;\n\n /**\n * Range: 0.0 - 0.5\n */\n wordSpacing: number = 0;\n\n /**\n * Range: 0.0 - 0.5\n */\n letterSpacing: number = 0;\n\n /**\n * Range: 0.5 - 4.0\n */\n pageMargins: number = 0;\n\n /**\n * Range: 1.0 - 2.0\n */\n lineHeight: number = 1;\n\n /**\n * Range: 0.0 - 2.0\n */\n paragraphMargins?: number = 0;\n\n static map(settings: Partial<Settings>): any {\n const defaultValues = new Settings();\n const mapped: Record<string, any> = {};\n\n Object.keys(defaultValues)\n .forEach((key: string) => {\n // @ts-ignore\n mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];\n })\n ;\n\n mapped.appearance = indexOfObjectValue(Appearance, mapped.appearance);\n mapped.fontFamily = indexOfObjectValue(FontFamily, mapped.fontFamily);\n mapped.textAlign = indexOfObjectValue(TextAlignment, mapped.textAlign);\n mapped.colCount = indexOfObjectValue(ColumnCount, mapped.colCount);\n\n Object.keys(RANGES).forEach((key: string) => {\n // @ts-ignore\n mapped[key] = clamp(mapped[key], RANGES[key][0], RANGES[key][1]);\n });\n\n return mapped;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './Dimensions';\nexport * from './File';\nexport * from './Link';\nexport * from './Locator';\nexport * from './Settings';\n"],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,QAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd;AACA,cAAc,QAAd;AACA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,YAAd","sourcesContent":["export * from './Dimensions';\nexport * from './File';\nexport * from './Link';\nexport * from './Locator';\nexport * from './Settings';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["COMPONENT_NAME"],"sources":["COMPONENT_NAME.ts"],"sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG,aAAvB"}
1
+ {"version":3,"sources":["COMPONENT_NAME.ts"],"names":["COMPONENT_NAME"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAG,aAAvB","sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","LINKING_ERROR","select","ios","default"],"sources":["LINKING_ERROR.ts"],"sourcesContent":["import { Platform } from 'react-native';\n\nexport const LINKING_ERROR =\n `The package 'react-native-readium' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,OAAO,MAAMC,aAAa,GACvB,+EAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK"}
1
+ {"version":3,"sources":["LINKING_ERROR.ts"],"names":["Platform","LINKING_ERROR","select","ios","default"],"mappings":"AAAA,SAASA,QAAT,QAAyB,cAAzB;AAEA,OAAO,MAAMC,aAAa,GACvB,+EAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;AAAEC,EAAAA,GAAG,EAAE,gCAAP;AAAyCC,EAAAA,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJK","sourcesContent":["import { Platform } from 'react-native';\n\nexport const LINKING_ERROR =\n `The package 'react-native-readium' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["RANGES","fontSize","wordSpacing","letterSpacing","pageMargins","lineHeight","paragraphMargins"],"sources":["RANGES.ts"],"sourcesContent":["export const RANGES = {\n fontSize: [100.0, 300.0],\n wordSpacing: [0.0, 0.5],\n letterSpacing: [0.0, 0.5],\n pageMargins: [0.5, 4.0],\n lineHeight: [1.0, 2.0],\n paragraphMargins: [0.0, 2.0],\n};\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,QAAQ,EAAU,CAAC,KAAD,EAAQ,KAAR,CADE;EAEpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAFE;EAGpBC,aAAa,EAAK,CAAC,GAAD,EAAM,GAAN,CAHE;EAIpBC,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAJE;EAKpBC,UAAU,EAAQ,CAAC,GAAD,EAAM,GAAN,CALE;EAMpBC,gBAAgB,EAAE,CAAC,GAAD,EAAM,GAAN;AANE,CAAf"}
1
+ {"version":3,"sources":["RANGES.ts"],"names":["RANGES","fontSize","wordSpacing","letterSpacing","pageMargins","lineHeight","paragraphMargins"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;AACpBC,EAAAA,QAAQ,EAAU,CAAC,KAAD,EAAQ,KAAR,CADE;AAEpBC,EAAAA,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAFE;AAGpBC,EAAAA,aAAa,EAAK,CAAC,GAAD,EAAM,GAAN,CAHE;AAIpBC,EAAAA,WAAW,EAAO,CAAC,GAAD,EAAM,GAAN,CAJE;AAKpBC,EAAAA,UAAU,EAAQ,CAAC,GAAD,EAAM,GAAN,CALE;AAMpBC,EAAAA,gBAAgB,EAAE,CAAC,GAAD,EAAM,GAAN;AANE,CAAf","sourcesContent":["export const RANGES = {\n fontSize: [100.0, 300.0],\n wordSpacing: [0.0, 0.5],\n letterSpacing: [0.0, 0.5],\n pageMargins: [0.5, 4.0],\n lineHeight: [1.0, 2.0],\n paragraphMargins: [0.0, 2.0],\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["clamp","val","lower","upper"],"sources":["clamp.ts"],"sourcesContent":["export const clamp = (val: number, lower: number, upper: number): number => {\n if (val < lower) return lower;\n if (val > upper) return upper;\n return val;\n}\n"],"mappings":"AAAA,OAAO,MAAMA,KAAK,GAAG,CAACC,GAAD,EAAcC,KAAd,EAA6BC,KAA7B,KAAuD;EAC1E,IAAIF,GAAG,GAAGC,KAAV,EAAiB,OAAOA,KAAP;EACjB,IAAID,GAAG,GAAGE,KAAV,EAAiB,OAAOA,KAAP;EACjB,OAAOF,GAAP;AACD,CAJM"}
1
+ {"version":3,"sources":["clamp.ts"],"names":["clamp","val","lower","upper"],"mappings":"AAAA,OAAO,MAAMA,KAAK,GAAG,CAACC,GAAD,EAAcC,KAAd,EAA6BC,KAA7B,KAAuD;AAC1E,MAAIF,GAAG,GAAGC,KAAV,EAAiB,OAAOA,KAAP;AACjB,MAAID,GAAG,GAAGE,KAAV,EAAiB,OAAOA,KAAP;AACjB,SAAOF,GAAP;AACD,CAJM","sourcesContent":["export const clamp = (val: number, lower: number, upper: number): number => {\n if (val < lower) return lower;\n if (val > upper) return upper;\n return val;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["UIManager","COMPONENT_NAME","createFragment","viewId","dispatchViewManagerCommand","getViewManagerConfig","Commands","create","toString"],"sources":["createFragment.ts"],"sourcesContent":["import { UIManager } from 'react-native';\n\nimport { COMPONENT_NAME } from './COMPONENT_NAME';\n\nexport const createFragment = (viewId: number | null) => {\n if (viewId !== null) {\n UIManager.dispatchViewManagerCommand(\n viewId,\n // we are calling the 'create' command\n // @ts-ignore\n UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.create.toString(),\n [viewId],\n );\n }\n}\n"],"mappings":"AAAA,SAASA,SAAT,QAA0B,cAA1B;AAEA,SAASC,cAAT,QAA+B,kBAA/B;AAEA,OAAO,MAAMC,cAAc,GAAIC,MAAD,IAA2B;EACvD,IAAIA,MAAM,KAAK,IAAf,EAAqB;IACnBH,SAAS,CAACI,0BAAV,CACED,MADF,EAEE;IACA;IACAH,SAAS,CAACK,oBAAV,CAA+BJ,cAA/B,EAA+CK,QAA/C,CAAwDC,MAAxD,CAA+DC,QAA/D,EAJF,EAKE,CAACL,MAAD,CALF;EAOD;AACF,CAVM"}
1
+ {"version":3,"sources":["createFragment.ts"],"names":["UIManager","COMPONENT_NAME","createFragment","viewId","dispatchViewManagerCommand","getViewManagerConfig","Commands","create","toString"],"mappings":"AAAA,SAASA,SAAT,QAA0B,cAA1B;AAEA,SAASC,cAAT,QAA+B,kBAA/B;AAEA,OAAO,MAAMC,cAAc,GAAIC,MAAD,IAA2B;AACvD,MAAIA,MAAM,KAAK,IAAf,EAAqB;AACnBH,IAAAA,SAAS,CAACI,0BAAV,CACED,MADF,EAEE;AACA;AACAH,IAAAA,SAAS,CAACK,oBAAV,CAA+BJ,cAA/B,EAA+CK,QAA/C,CAAwDC,MAAxD,CAA+DC,QAA/D,EAJF,EAKE,CAACL,MAAD,CALF;AAOD;AACF,CAVM","sourcesContent":["import { UIManager } from 'react-native';\n\nimport { COMPONENT_NAME } from './COMPONENT_NAME';\n\nexport const createFragment = (viewId: number | null) => {\n if (viewId !== null) {\n UIManager.dispatchViewManagerCommand(\n viewId,\n // we are calling the 'create' command\n // @ts-ignore\n UIManager.getViewManagerConfig(COMPONENT_NAME).Commands.create.toString(),\n [viewId],\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","PixelRatio","getWidthOrHeightValue","val","OS","getPixelSizeForLayoutSize"],"sources":["getWidthOrHeightValue.ts"],"sourcesContent":["import { Platform, PixelRatio } from 'react-native';\n\nexport const getWidthOrHeightValue = (val: number) => {\n return Platform.OS === 'android' ? PixelRatio.getPixelSizeForLayoutSize(val) : val;\n}\n"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,UAAnB,QAAqC,cAArC;AAEA,OAAO,MAAMC,qBAAqB,GAAIC,GAAD,IAAiB;EACpD,OAAOH,QAAQ,CAACI,EAAT,KAAgB,SAAhB,GAA4BH,UAAU,CAACI,yBAAX,CAAqCF,GAArC,CAA5B,GAAwEA,GAA/E;AACD,CAFM"}
1
+ {"version":3,"sources":["getWidthOrHeightValue.ts"],"names":["Platform","PixelRatio","getWidthOrHeightValue","val","OS","getPixelSizeForLayoutSize"],"mappings":"AAAA,SAASA,QAAT,EAAmBC,UAAnB,QAAqC,cAArC;AAEA,OAAO,MAAMC,qBAAqB,GAAIC,GAAD,IAAiB;AACpD,SAAOH,QAAQ,CAACI,EAAT,KAAgB,SAAhB,GAA4BH,UAAU,CAACI,yBAAX,CAAqCF,GAArC,CAA5B,GAAwEA,GAA/E;AACD,CAFM","sourcesContent":["import { Platform, PixelRatio } from 'react-native';\n\nexport const getWidthOrHeightValue = (val: number) => {\n return Platform.OS === 'android' ? PixelRatio.getPixelSizeForLayoutSize(val) : val;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './clamp';\nexport * from './COMPONENT_NAME';\nexport * from './createFragment';\nexport * from './getWidthOrHeightValue';\nexport * from './indexOfObjectValue';\nexport * from './LINKING_ERROR';\nexport * from './RANGES';\n"],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,kBAAd;AACA,cAAc,kBAAd;AACA,cAAc,yBAAd;AACA,cAAc,sBAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAd;AACA,cAAc,kBAAd;AACA,cAAc,kBAAd;AACA,cAAc,yBAAd;AACA,cAAc,sBAAd;AACA,cAAc,iBAAd;AACA,cAAc,UAAd","sourcesContent":["export * from './clamp';\nexport * from './COMPONENT_NAME';\nexport * from './createFragment';\nexport * from './getWidthOrHeightValue';\nexport * from './indexOfObjectValue';\nexport * from './LINKING_ERROR';\nexport * from './RANGES';\n"]}
@@ -1 +1 @@
1
- {"version":3,"names":["indexOfObjectValue","obj","val","Object","values","indexOf"],"sources":["indexOfObjectValue.ts"],"sourcesContent":["export const indexOfObjectValue = (obj: any, val: any): number => {\n return Object.values(obj).indexOf(val);\n}\n"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,CAACC,GAAD,EAAWC,GAAX,KAAgC;EAChE,OAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBI,OAAnB,CAA2BH,GAA3B,CAAP;AACD,CAFM"}
1
+ {"version":3,"sources":["indexOfObjectValue.ts"],"names":["indexOfObjectValue","obj","val","Object","values","indexOf"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,CAACC,GAAD,EAAWC,GAAX,KAAgC;AAChE,SAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBI,OAAnB,CAA2BH,GAA3B,CAAP;AACD,CAFM","sourcesContent":["export const indexOfObjectValue = (obj: any, val: any): number => {\n return Object.values(obj).indexOf(val);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-readium",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A react-native wrapper for https://readium.org/",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",