react-native-readium 1.2.0 → 2.0.0-rc.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.
Files changed (190) hide show
  1. package/README.md +28 -23
  2. package/android/build.gradle +25 -34
  3. package/android/src/main/java/com/reactnativereadium/ReadiumView.kt +3 -0
  4. package/android/src/main/res/layout/fragment_fxllayout_double.xml +58 -0
  5. package/android/src/main/res/layout/fragment_fxllayout_single.xml +52 -0
  6. package/android/src/main/res/layout/viewpager_fragment_epub.xml +27 -0
  7. package/android/src/main/res/values/strings.xml +1 -0
  8. package/lib/src/components/BaseReadiumView.d.ts +2 -0
  9. package/lib/src/components/BaseReadiumView.js +7 -0
  10. package/lib/src/components/BaseReadiumView.web.d.ts +1 -0
  11. package/lib/src/components/BaseReadiumView.web.js +1 -0
  12. package/lib/src/components/ReadiumView.d.ts +4 -0
  13. package/lib/src/components/ReadiumView.js +43 -0
  14. package/lib/src/components/ReadiumView.web.d.ts +5 -0
  15. package/lib/src/components/ReadiumView.web.js +61 -0
  16. package/lib/src/enums/Appearance.js +13 -0
  17. package/lib/src/enums/ColumnCount.js +7 -0
  18. package/lib/src/enums/FontFamily.js +12 -0
  19. package/lib/src/enums/TextAlignment.js +6 -0
  20. package/lib/{module → src}/enums/index.js +0 -1
  21. package/lib/{module → src}/index.js +0 -1
  22. package/lib/src/interfaces/BaseReadiumViewProps.d.ts +16 -0
  23. package/lib/src/interfaces/BaseReadiumViewProps.js +1 -0
  24. package/lib/src/interfaces/Dimensions.js +1 -0
  25. package/lib/src/interfaces/File.js +1 -0
  26. package/lib/src/interfaces/Link.js +1 -0
  27. package/lib/src/interfaces/Locator.js +1 -0
  28. package/lib/src/interfaces/Settings.js +61 -0
  29. package/lib/{typescript → src}/interfaces/index.d.ts +1 -0
  30. package/lib/{module → src}/interfaces/index.js +1 -1
  31. package/lib/{module → src}/utils/COMPONENT_NAME.js +0 -1
  32. package/lib/src/utils/LINKING_ERROR.js +5 -0
  33. package/lib/src/utils/RANGES.js +8 -0
  34. package/lib/src/utils/clamp.js +7 -0
  35. package/lib/src/utils/createFragment.js +10 -0
  36. package/lib/src/utils/getWidthOrHeightValue.js +4 -0
  37. package/lib/{module → src}/utils/index.js +0 -1
  38. package/lib/src/utils/indexOfObjectValue.js +3 -0
  39. package/lib/web/hooks/useLocationObserver.d.ts +2 -0
  40. package/lib/web/hooks/useLocationObserver.js +13 -0
  41. package/lib/web/hooks/useReaderRef.d.ts +3 -0
  42. package/lib/web/hooks/useReaderRef.js +48 -0
  43. package/lib/web/hooks/useSettingsObserver.d.ts +2 -0
  44. package/lib/web/hooks/useSettingsObserver.js +13 -0
  45. package/package.json +32 -38
  46. package/src/components/BaseReadiumView.tsx +1 -14
  47. package/src/components/BaseReadiumView.web.tsx +1 -0
  48. package/src/components/ReadiumView.tsx +1 -2
  49. package/src/{web/ReadiumView.tsx → components/ReadiumView.web.tsx} +11 -16
  50. package/src/interfaces/BaseReadiumViewProps.ts +18 -0
  51. package/src/interfaces/index.ts +1 -0
  52. package/{lib/module/web/hooks/index.js → web/hooks/index.ts} +0 -1
  53. package/{src/web → web}/hooks/useLocationObserver.ts +1 -3
  54. package/{src/web → web}/hooks/useReaderRef.ts +20 -17
  55. package/{src/web → web}/hooks/useSettingsObserver.ts +2 -4
  56. package/lib/commonjs/components/BaseReadiumView.js +0 -16
  57. package/lib/commonjs/components/BaseReadiumView.js.map +0 -1
  58. package/lib/commonjs/components/ReadiumView.js +0 -94
  59. package/lib/commonjs/components/ReadiumView.js.map +0 -1
  60. package/lib/commonjs/enums/Appearance.js +0 -16
  61. package/lib/commonjs/enums/Appearance.js.map +0 -1
  62. package/lib/commonjs/enums/ColumnCount.js +0 -16
  63. package/lib/commonjs/enums/ColumnCount.js.map +0 -1
  64. package/lib/commonjs/enums/FontFamily.js +0 -21
  65. package/lib/commonjs/enums/FontFamily.js.map +0 -1
  66. package/lib/commonjs/enums/TextAlignment.js +0 -15
  67. package/lib/commonjs/enums/TextAlignment.js.map +0 -1
  68. package/lib/commonjs/enums/index.js +0 -58
  69. package/lib/commonjs/enums/index.js.map +0 -1
  70. package/lib/commonjs/index.js +0 -59
  71. package/lib/commonjs/index.js.map +0 -1
  72. package/lib/commonjs/index.web.js +0 -54
  73. package/lib/commonjs/index.web.js.map +0 -1
  74. package/lib/commonjs/interfaces/Dimensions.js +0 -2
  75. package/lib/commonjs/interfaces/Dimensions.js.map +0 -1
  76. package/lib/commonjs/interfaces/File.js +0 -6
  77. package/lib/commonjs/interfaces/File.js.map +0 -1
  78. package/lib/commonjs/interfaces/Link.js +0 -2
  79. package/lib/commonjs/interfaces/Link.js.map +0 -1
  80. package/lib/commonjs/interfaces/Locator.js +0 -2
  81. package/lib/commonjs/interfaces/Locator.js.map +0 -1
  82. package/lib/commonjs/interfaces/Settings.js +0 -71
  83. package/lib/commonjs/interfaces/Settings.js.map +0 -1
  84. package/lib/commonjs/interfaces/index.js +0 -71
  85. package/lib/commonjs/interfaces/index.js.map +0 -1
  86. package/lib/commonjs/utils/COMPONENT_NAME.js +0 -9
  87. package/lib/commonjs/utils/COMPONENT_NAME.js.map +0 -1
  88. package/lib/commonjs/utils/LINKING_ERROR.js +0 -15
  89. package/lib/commonjs/utils/LINKING_ERROR.js.map +0 -1
  90. package/lib/commonjs/utils/RANGES.js +0 -16
  91. package/lib/commonjs/utils/RANGES.js.map +0 -1
  92. package/lib/commonjs/utils/clamp.js +0 -15
  93. package/lib/commonjs/utils/clamp.js.map +0 -1
  94. package/lib/commonjs/utils/createFragment.js +0 -21
  95. package/lib/commonjs/utils/createFragment.js.map +0 -1
  96. package/lib/commonjs/utils/getWidthOrHeightValue.js +0 -15
  97. package/lib/commonjs/utils/getWidthOrHeightValue.js.map +0 -1
  98. package/lib/commonjs/utils/index.js +0 -97
  99. package/lib/commonjs/utils/index.js.map +0 -1
  100. package/lib/commonjs/utils/indexOfObjectValue.js +0 -13
  101. package/lib/commonjs/utils/indexOfObjectValue.js.map +0 -1
  102. package/lib/commonjs/web/ReadiumView.js +0 -106
  103. package/lib/commonjs/web/ReadiumView.js.map +0 -1
  104. package/lib/commonjs/web/hooks/index.js +0 -45
  105. package/lib/commonjs/web/hooks/index.js.map +0 -1
  106. package/lib/commonjs/web/hooks/useLocationObserver.js +0 -21
  107. package/lib/commonjs/web/hooks/useLocationObserver.js.map +0 -1
  108. package/lib/commonjs/web/hooks/useReaderRef.js +0 -63
  109. package/lib/commonjs/web/hooks/useReaderRef.js.map +0 -1
  110. package/lib/commonjs/web/hooks/useSettingsObserver.js +0 -21
  111. package/lib/commonjs/web/hooks/useSettingsObserver.js.map +0 -1
  112. package/lib/module/components/BaseReadiumView.js +0 -6
  113. package/lib/module/components/BaseReadiumView.js.map +0 -1
  114. package/lib/module/components/ReadiumView.js +0 -75
  115. package/lib/module/components/ReadiumView.js.map +0 -1
  116. package/lib/module/enums/Appearance.js +0 -9
  117. package/lib/module/enums/Appearance.js.map +0 -1
  118. package/lib/module/enums/ColumnCount.js +0 -9
  119. package/lib/module/enums/ColumnCount.js.map +0 -1
  120. package/lib/module/enums/FontFamily.js +0 -14
  121. package/lib/module/enums/FontFamily.js.map +0 -1
  122. package/lib/module/enums/TextAlignment.js +0 -8
  123. package/lib/module/enums/TextAlignment.js.map +0 -1
  124. package/lib/module/enums/index.js.map +0 -1
  125. package/lib/module/index.js.map +0 -1
  126. package/lib/module/index.web.js +0 -5
  127. package/lib/module/index.web.js.map +0 -1
  128. package/lib/module/interfaces/Dimensions.js +0 -2
  129. package/lib/module/interfaces/Dimensions.js.map +0 -1
  130. package/lib/module/interfaces/File.js +0 -2
  131. package/lib/module/interfaces/File.js.map +0 -1
  132. package/lib/module/interfaces/Link.js +0 -2
  133. package/lib/module/interfaces/Link.js.map +0 -1
  134. package/lib/module/interfaces/Locator.js +0 -2
  135. package/lib/module/interfaces/Locator.js.map +0 -1
  136. package/lib/module/interfaces/Settings.js +0 -61
  137. package/lib/module/interfaces/Settings.js.map +0 -1
  138. package/lib/module/interfaces/index.js.map +0 -1
  139. package/lib/module/utils/COMPONENT_NAME.js.map +0 -1
  140. package/lib/module/utils/LINKING_ERROR.js +0 -6
  141. package/lib/module/utils/LINKING_ERROR.js.map +0 -1
  142. package/lib/module/utils/RANGES.js +0 -9
  143. package/lib/module/utils/RANGES.js.map +0 -1
  144. package/lib/module/utils/clamp.js +0 -6
  145. package/lib/module/utils/clamp.js.map +0 -1
  146. package/lib/module/utils/createFragment.js +0 -10
  147. package/lib/module/utils/createFragment.js.map +0 -1
  148. package/lib/module/utils/getWidthOrHeightValue.js +0 -5
  149. package/lib/module/utils/getWidthOrHeightValue.js.map +0 -1
  150. package/lib/module/utils/index.js.map +0 -1
  151. package/lib/module/utils/indexOfObjectValue.js +0 -4
  152. package/lib/module/utils/indexOfObjectValue.js.map +0 -1
  153. package/lib/module/web/ReadiumView.js +0 -89
  154. package/lib/module/web/ReadiumView.js.map +0 -1
  155. package/lib/module/web/hooks/index.js.map +0 -1
  156. package/lib/module/web/hooks/useLocationObserver.js +0 -11
  157. package/lib/module/web/hooks/useLocationObserver.js.map +0 -1
  158. package/lib/module/web/hooks/useReaderRef.js +0 -50
  159. package/lib/module/web/hooks/useReaderRef.js.map +0 -1
  160. package/lib/module/web/hooks/useSettingsObserver.js +0 -11
  161. package/lib/module/web/hooks/useSettingsObserver.js.map +0 -1
  162. package/lib/typescript/components/BaseReadiumView.d.ts +0 -14
  163. package/lib/typescript/components/ReadiumView.d.ts +0 -4
  164. package/lib/typescript/index.web.d.ts +0 -4
  165. package/lib/typescript/web/ReadiumView.d.ts +0 -5
  166. package/lib/typescript/web/hooks/useLocationObserver.d.ts +0 -3
  167. package/lib/typescript/web/hooks/useReaderRef.d.ts +0 -4
  168. package/lib/typescript/web/hooks/useSettingsObserver.d.ts +0 -3
  169. package/src/index.web.tsx +0 -5
  170. /package/lib/{typescript → src}/enums/Appearance.d.ts +0 -0
  171. /package/lib/{typescript → src}/enums/ColumnCount.d.ts +0 -0
  172. /package/lib/{typescript → src}/enums/FontFamily.d.ts +0 -0
  173. /package/lib/{typescript → src}/enums/TextAlignment.d.ts +0 -0
  174. /package/lib/{typescript → src}/enums/index.d.ts +0 -0
  175. /package/lib/{typescript → src}/index.d.ts +0 -0
  176. /package/lib/{typescript → src}/interfaces/Dimensions.d.ts +0 -0
  177. /package/lib/{typescript → src}/interfaces/File.d.ts +0 -0
  178. /package/lib/{typescript → src}/interfaces/Link.d.ts +0 -0
  179. /package/lib/{typescript → src}/interfaces/Locator.d.ts +0 -0
  180. /package/lib/{typescript → src}/interfaces/Settings.d.ts +0 -0
  181. /package/lib/{typescript → src}/utils/COMPONENT_NAME.d.ts +0 -0
  182. /package/lib/{typescript → src}/utils/LINKING_ERROR.d.ts +0 -0
  183. /package/lib/{typescript → src}/utils/RANGES.d.ts +0 -0
  184. /package/lib/{typescript → src}/utils/clamp.d.ts +0 -0
  185. /package/lib/{typescript → src}/utils/createFragment.d.ts +0 -0
  186. /package/lib/{typescript → src}/utils/getWidthOrHeightValue.d.ts +0 -0
  187. /package/lib/{typescript → src}/utils/index.d.ts +0 -0
  188. /package/lib/{typescript → src}/utils/indexOfObjectValue.d.ts +0 -0
  189. /package/lib/{typescript/web → web}/hooks/index.d.ts +0 -0
  190. /package/{src/web/hooks/index.ts → lib/web/hooks/index.js} +0 -0
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ColumnCount = void 0;
7
- // NOTE: readium uses an index so the order is very important here
8
- let ColumnCount;
9
- exports.ColumnCount = ColumnCount;
10
-
11
- (function (ColumnCount) {
12
- ColumnCount["AUTO"] = "auto";
13
- ColumnCount["ONE"] = "1";
14
- ColumnCount["TWO"] = "2";
15
- })(ColumnCount || (exports.ColumnCount = ColumnCount = {}));
16
- //# sourceMappingURL=ColumnCount.js.map
@@ -1 +0,0 @@
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,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FontFamily = void 0;
7
- // NOTE: readium uses an index so the order is very important here
8
- let FontFamily;
9
- exports.FontFamily = FontFamily;
10
-
11
- (function (FontFamily) {
12
- FontFamily["ORIGINAL"] = "Original";
13
- FontFamily["HELVETICA_NEUE"] = "Helvetica Neue";
14
- FontFamily["IOWAN_OLD_STYLE"] = "Iowan Old Style";
15
- FontFamily["ATHELAS"] = "Athelas";
16
- FontFamily["SERAVEK"] = "Seravek";
17
- FontFamily["OPEN_DYSLEXIC"] = "OpenDyslexic";
18
- FontFamily["ACCESSIBLE_DFA"] = "AccessibleDfA";
19
- FontFamily["IA_WRITER_DUOSPACE"] = "IA Writer Duospace";
20
- })(FontFamily || (exports.FontFamily = FontFamily = {}));
21
- //# sourceMappingURL=FontFamily.js.map
@@ -1 +0,0 @@
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,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TextAlignment = void 0;
7
- // NOTE: readium uses an index so the order is very important here
8
- let TextAlignment;
9
- exports.TextAlignment = TextAlignment;
10
-
11
- (function (TextAlignment) {
12
- TextAlignment["JUSTIFY"] = "justify";
13
- TextAlignment["START"] = "start";
14
- })(TextAlignment || (exports.TextAlignment = TextAlignment = {}));
15
- //# sourceMappingURL=TextAlignment.js.map
@@ -1 +0,0 @@
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,58 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _Appearance = require("./Appearance");
8
-
9
- Object.keys(_Appearance).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _Appearance[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _Appearance[key];
16
- }
17
- });
18
- });
19
-
20
- var _ColumnCount = require("./ColumnCount");
21
-
22
- Object.keys(_ColumnCount).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _ColumnCount[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function () {
28
- return _ColumnCount[key];
29
- }
30
- });
31
- });
32
-
33
- var _FontFamily = require("./FontFamily");
34
-
35
- Object.keys(_FontFamily).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _FontFamily[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function () {
41
- return _FontFamily[key];
42
- }
43
- });
44
- });
45
-
46
- var _TextAlignment = require("./TextAlignment");
47
-
48
- Object.keys(_TextAlignment).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (key in exports && exports[key] === _TextAlignment[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function () {
54
- return _TextAlignment[key];
55
- }
56
- });
57
- });
58
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,59 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- RANGES: true
8
- };
9
- Object.defineProperty(exports, "RANGES", {
10
- enumerable: true,
11
- get: function () {
12
- return _utils.RANGES;
13
- }
14
- });
15
-
16
- var _enums = require("./enums");
17
-
18
- Object.keys(_enums).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
- if (key in exports && exports[key] === _enums[key]) return;
22
- Object.defineProperty(exports, key, {
23
- enumerable: true,
24
- get: function () {
25
- return _enums[key];
26
- }
27
- });
28
- });
29
-
30
- var _interfaces = require("./interfaces");
31
-
32
- Object.keys(_interfaces).forEach(function (key) {
33
- if (key === "default" || key === "__esModule") return;
34
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
35
- if (key in exports && exports[key] === _interfaces[key]) return;
36
- Object.defineProperty(exports, key, {
37
- enumerable: true,
38
- get: function () {
39
- return _interfaces[key];
40
- }
41
- });
42
- });
43
-
44
- var _utils = require("./utils");
45
-
46
- var _ReadiumView = require("./components/ReadiumView");
47
-
48
- Object.keys(_ReadiumView).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
51
- if (key in exports && exports[key] === _ReadiumView[key]) return;
52
- Object.defineProperty(exports, key, {
53
- enumerable: true,
54
- get: function () {
55
- return _ReadiumView[key];
56
- }
57
- });
58
- });
59
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- RANGES: true,
8
- ReadiumView: true
9
- };
10
- Object.defineProperty(exports, "RANGES", {
11
- enumerable: true,
12
- get: function () {
13
- return _utils.RANGES;
14
- }
15
- });
16
- Object.defineProperty(exports, "ReadiumView", {
17
- enumerable: true,
18
- get: function () {
19
- return _ReadiumView.ReadiumView;
20
- }
21
- });
22
-
23
- var _enums = require("./enums");
24
-
25
- Object.keys(_enums).forEach(function (key) {
26
- if (key === "default" || key === "__esModule") return;
27
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
28
- if (key in exports && exports[key] === _enums[key]) return;
29
- Object.defineProperty(exports, key, {
30
- enumerable: true,
31
- get: function () {
32
- return _enums[key];
33
- }
34
- });
35
- });
36
-
37
- var _interfaces = require("./interfaces");
38
-
39
- Object.keys(_interfaces).forEach(function (key) {
40
- if (key === "default" || key === "__esModule") return;
41
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
42
- if (key in exports && exports[key] === _interfaces[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _interfaces[key];
47
- }
48
- });
49
- });
50
-
51
- var _utils = require("./utils");
52
-
53
- var _ReadiumView = require("./web/ReadiumView");
54
- //# sourceMappingURL=index.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.web.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;;AAEA","sourcesContent":["export * from './enums';\nexport * from './interfaces';\nexport { RANGES } from './utils';\n\nexport { ReadiumView } from './web/ReadiumView';\n"]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Dimensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=File.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Locator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Settings = void 0;
7
-
8
- var _enums = require("../enums");
9
-
10
- var _utils = require("../utils");
11
-
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
14
- /**
15
- * A reader settings object with sensible defaults.
16
- */
17
- class Settings {
18
- constructor() {
19
- _defineProperty(this, "appearance", _enums.Appearance.DEFAULT);
20
-
21
- _defineProperty(this, "fontFamily", _enums.FontFamily.ORIGINAL);
22
-
23
- _defineProperty(this, "textAlign", _enums.TextAlignment.JUSTIFY);
24
-
25
- _defineProperty(this, "colCount", _enums.ColumnCount.AUTO);
26
-
27
- _defineProperty(this, "scroll", false);
28
-
29
- _defineProperty(this, "fontOverride", false);
30
-
31
- _defineProperty(this, "verticalScroll", false);
32
-
33
- _defineProperty(this, "bodyHyphens", false);
34
-
35
- _defineProperty(this, "advancedSettings", true);
36
-
37
- _defineProperty(this, "fontSize", 100);
38
-
39
- _defineProperty(this, "wordSpacing", 0);
40
-
41
- _defineProperty(this, "letterSpacing", 0);
42
-
43
- _defineProperty(this, "pageMargins", 0);
44
-
45
- _defineProperty(this, "lineHeight", 1);
46
-
47
- _defineProperty(this, "paragraphMargins", 0);
48
- }
49
-
50
- static map(settings) {
51
- const defaultValues = new Settings();
52
- const mapped = {};
53
- Object.keys(defaultValues).forEach(key => {
54
- // @ts-ignore
55
- mapped[key] = settings[key] !== undefined ? settings[key] : defaultValues[key];
56
- });
57
- mapped.appearance = (0, _utils.indexOfObjectValue)(_enums.Appearance, mapped.appearance);
58
- mapped.fontFamily = (0, _utils.indexOfObjectValue)(_enums.FontFamily, mapped.fontFamily);
59
- mapped.textAlign = (0, _utils.indexOfObjectValue)(_enums.TextAlignment, mapped.textAlign);
60
- mapped.colCount = (0, _utils.indexOfObjectValue)(_enums.ColumnCount, mapped.colCount);
61
- Object.keys(_utils.RANGES).forEach(key => {
62
- // @ts-ignore
63
- mapped[key] = (0, _utils.clamp)(mapped[key], _utils.RANGES[key][0], _utils.RANGES[key][1]);
64
- });
65
- return mapped;
66
- }
67
-
68
- }
69
-
70
- exports.Settings = Settings;
71
- //# sourceMappingURL=Settings.js.map
@@ -1 +0,0 @@
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,CAvBF;;AAAA,2CA4BI,CA5BJ;;AAAA,yCAiCE,CAjCF;;AAAA,wCAsCC,CAtCD;;AAAA,8CA2CQ,CA3CR;AAAA;;AA6CV,SAAHC,GAAG,CAACC,QAAD,EAAmC;AAC3C,UAAMC,aAAa,GAAG,IAAIX,QAAJ,EAAtB;AACA,UAAMY,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,GAAoB,+BAAmBjB,iBAAnB,EAA+BW,MAAM,CAACM,UAAtC,CAApB;AACAN,IAAAA,MAAM,CAACO,UAAP,GAAoB,+BAAmBhB,iBAAnB,EAA+BS,MAAM,CAACO,UAAtC,CAApB;AACAP,IAAAA,MAAM,CAACQ,SAAP,GAAmB,+BAAmBf,oBAAnB,EAAkCO,MAAM,CAACQ,SAAzC,CAAnB;AACAR,IAAAA,MAAM,CAACS,QAAP,GAAkB,+BAAmBd,kBAAnB,EAAgCK,MAAM,CAACS,QAAvC,CAAlB;AAEAR,IAAAA,MAAM,CAACC,IAAP,CAAYQ,aAAZ,EAAoBP,OAApB,CAA6BC,GAAD,IAAiB;AAC3C;AACAJ,MAAAA,MAAM,CAACI,GAAD,CAAN,GAAc,kBAAMJ,MAAM,CAACI,GAAD,CAAZ,EAAmBM,cAAON,GAAP,EAAY,CAAZ,CAAnB,EAAmCM,cAAON,GAAP,EAAY,CAAZ,CAAnC,CAAd;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,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _Dimensions = require("./Dimensions");
8
-
9
- Object.keys(_Dimensions).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _Dimensions[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _Dimensions[key];
16
- }
17
- });
18
- });
19
-
20
- var _File = require("./File");
21
-
22
- Object.keys(_File).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _File[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function () {
28
- return _File[key];
29
- }
30
- });
31
- });
32
-
33
- var _Link = require("./Link");
34
-
35
- Object.keys(_Link).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _Link[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function () {
41
- return _Link[key];
42
- }
43
- });
44
- });
45
-
46
- var _Locator = require("./Locator");
47
-
48
- Object.keys(_Locator).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (key in exports && exports[key] === _Locator[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function () {
54
- return _Locator[key];
55
- }
56
- });
57
- });
58
-
59
- var _Settings = require("./Settings");
60
-
61
- Object.keys(_Settings).forEach(function (key) {
62
- if (key === "default" || key === "__esModule") return;
63
- if (key in exports && exports[key] === _Settings[key]) return;
64
- Object.defineProperty(exports, key, {
65
- enumerable: true,
66
- get: function () {
67
- return _Settings[key];
68
- }
69
- });
70
- });
71
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,9 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.COMPONENT_NAME = void 0;
7
- const COMPONENT_NAME = 'ReadiumView';
8
- exports.COMPONENT_NAME = COMPONENT_NAME;
9
- //# sourceMappingURL=COMPONENT_NAME.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["COMPONENT_NAME.ts"],"names":["COMPONENT_NAME"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAG,aAAvB","sourcesContent":["export const COMPONENT_NAME = 'ReadiumView';\n"]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.LINKING_ERROR = void 0;
7
-
8
- var _reactNative = require("react-native");
9
-
10
- const LINKING_ERROR = `The package 'react-native-readium' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
11
- ios: "- You have run 'pod install'\n",
12
- default: ''
13
- }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
14
- exports.LINKING_ERROR = LINKING_ERROR;
15
- //# sourceMappingURL=LINKING_ERROR.js.map
@@ -1 +0,0 @@
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,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.RANGES = void 0;
7
- const RANGES = {
8
- fontSize: [100.0, 300.0],
9
- wordSpacing: [0.0, 0.5],
10
- letterSpacing: [0.0, 0.5],
11
- pageMargins: [0.5, 4.0],
12
- lineHeight: [1.0, 2.0],
13
- paragraphMargins: [0.0, 2.0]
14
- };
15
- exports.RANGES = RANGES;
16
- //# sourceMappingURL=RANGES.js.map
@@ -1 +0,0 @@
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,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.clamp = void 0;
7
-
8
- const clamp = (val, lower, upper) => {
9
- if (val < lower) return lower;
10
- if (val > upper) return upper;
11
- return val;
12
- };
13
-
14
- exports.clamp = clamp;
15
- //# sourceMappingURL=clamp.js.map
@@ -1 +0,0 @@
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,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFragment = void 0;
7
-
8
- var _reactNative = require("react-native");
9
-
10
- var _COMPONENT_NAME = require("./COMPONENT_NAME");
11
-
12
- const createFragment = viewId => {
13
- if (viewId !== null) {
14
- _reactNative.UIManager.dispatchViewManagerCommand(viewId, // we are calling the 'create' command
15
- // @ts-ignore
16
- _reactNative.UIManager.getViewManagerConfig(_COMPONENT_NAME.COMPONENT_NAME).Commands.create.toString(), [viewId]);
17
- }
18
- };
19
-
20
- exports.createFragment = createFragment;
21
- //# sourceMappingURL=createFragment.js.map
@@ -1 +0,0 @@
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,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getWidthOrHeightValue = void 0;
7
-
8
- var _reactNative = require("react-native");
9
-
10
- const getWidthOrHeightValue = val => {
11
- return _reactNative.Platform.OS === 'android' ? _reactNative.PixelRatio.getPixelSizeForLayoutSize(val) : val;
12
- };
13
-
14
- exports.getWidthOrHeightValue = getWidthOrHeightValue;
15
- //# sourceMappingURL=getWidthOrHeightValue.js.map
@@ -1 +0,0 @@
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"]}