@mjhls/mjh-framework 1.0.99-0.next12 → 1.0.100

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 (356) hide show
  1. package/README.md +172 -168
  2. package/dist/index.es.js +12801 -0
  3. package/dist/index.es.js.map +1 -0
  4. package/dist/index.js +12836 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +84 -115
  7. package/dist/cjs/AD.js +0 -32
  8. package/dist/cjs/AD300x250.js +0 -95
  9. package/dist/cjs/AD300x250x600.js +0 -112
  10. package/dist/cjs/AD728x90.js +0 -109
  11. package/dist/cjs/ADFloatingFooter.js +0 -143
  12. package/dist/cjs/ADFooter.js +0 -53
  13. package/dist/cjs/ADGutter.js +0 -115
  14. package/dist/cjs/ADInfeed-cf54cb8a.js +0 -66
  15. package/dist/cjs/ADSkyscraper.js +0 -117
  16. package/dist/cjs/ADSponsoredResources.js +0 -114
  17. package/dist/cjs/ADWebcast.js +0 -119
  18. package/dist/cjs/ADWelcome.js +0 -166
  19. package/dist/cjs/ADlgInfeed-d06624d8.js +0 -60
  20. package/dist/cjs/AccordionPanel.js +0 -94
  21. package/dist/cjs/AdSlot.js +0 -251
  22. package/dist/cjs/AdSlotsProvider.js +0 -183
  23. package/dist/cjs/AlgoliaSearch.js +0 -195
  24. package/dist/cjs/AlphabeticList.js +0 -135
  25. package/dist/cjs/ArticleCarousel.js +0 -46
  26. package/dist/cjs/ArticleProgramLandingPage.js +0 -184
  27. package/dist/cjs/ArticleSeriesLandingPage.js +0 -162
  28. package/dist/cjs/ArticleSeriesListing.js +0 -315
  29. package/dist/cjs/AuthWrapper.js +0 -720
  30. package/dist/cjs/AuthorComponent-39b37d84.js +0 -96
  31. package/dist/cjs/Beam.js +0 -350
  32. package/dist/cjs/BlockContent-36e54d77.js +0 -916
  33. package/dist/cjs/Breadcrumbs.js +0 -107
  34. package/dist/cjs/CMEDeck.js +0 -443
  35. package/dist/cjs/Column1.js +0 -39
  36. package/dist/cjs/Column2.js +0 -75
  37. package/dist/cjs/Column3.js +0 -144
  38. package/dist/cjs/ConferenceArticleCard.js +0 -93
  39. package/dist/cjs/ConferenceBanner-6c9e718a.js +0 -24
  40. package/dist/cjs/ContentCardPaginated.js +0 -417
  41. package/dist/cjs/DeckContent.js +0 -507
  42. package/dist/cjs/DeckQueue.js +0 -403
  43. package/dist/cjs/DeckQueuePaginated.js +0 -348
  44. package/dist/cjs/Dfp-94f8ccdf.js +0 -103
  45. package/dist/cjs/EventsDeck.js +0 -857
  46. package/dist/cjs/ExternalResources.js +0 -217
  47. package/dist/cjs/Feature.js +0 -129
  48. package/dist/cjs/ForbesHero.js +0 -137
  49. package/dist/cjs/GridContent.js +0 -828
  50. package/dist/cjs/GridContentPaginated.js +0 -704
  51. package/dist/cjs/GridHero.js +0 -147
  52. package/dist/cjs/GroupDeck.js +0 -314
  53. package/dist/cjs/HamMagazine.js +0 -602
  54. package/dist/cjs/Header.js +0 -39
  55. package/dist/cjs/HealthCareProfessionalModal.js +0 -78
  56. package/dist/cjs/Hero.js +0 -48
  57. package/dist/cjs/HighlightenVideo.js +0 -69
  58. package/dist/cjs/HorizontalArticleListing.js +0 -165
  59. package/dist/cjs/HorizontalHero.js +0 -111
  60. package/dist/cjs/ImageSlider-a7fb6218.js +0 -182
  61. package/dist/cjs/IssueContentDeck.js +0 -241
  62. package/dist/cjs/IssueDeck.js +0 -268
  63. package/dist/cjs/IssueLanding.js +0 -172
  64. package/dist/cjs/KMTracker.js +0 -27
  65. package/dist/cjs/LeftNav.js +0 -145
  66. package/dist/cjs/MasterDeck.js +0 -555
  67. package/dist/cjs/MasterDeckPaginated.js +0 -469
  68. package/dist/cjs/MediaSeriesCard-36eab8b7.js +0 -9502
  69. package/dist/cjs/MediaSeriesLanding.js +0 -503
  70. package/dist/cjs/MediaSeriesLandingPaginated.js +0 -529
  71. package/dist/cjs/NavDvm.js +0 -245
  72. package/dist/cjs/NavFooter-3dcd99a8.js +0 -66
  73. package/dist/cjs/NavMagazine.js +0 -595
  74. package/dist/cjs/NavNative.js +0 -861
  75. package/dist/cjs/OncliveHero.js +0 -79
  76. package/dist/cjs/OncliveLargeHero.js +0 -241
  77. package/dist/cjs/PageFilter.js +0 -72
  78. package/dist/cjs/Pagination-1e0d5f1d.js +0 -90
  79. package/dist/cjs/PartnerDetailListing.js +0 -326
  80. package/dist/cjs/PartnerDetailListingPaginated.js +0 -318
  81. package/dist/cjs/PdfDownload.js +0 -28
  82. package/dist/cjs/PixelTracking.js +0 -165
  83. package/dist/cjs/PopUpModal.js +0 -58
  84. package/dist/cjs/PtceDeck.js +0 -149
  85. package/dist/cjs/PubSection.js +0 -120
  86. package/dist/cjs/PubToc.js +0 -87
  87. package/dist/cjs/PublicationDeck.js +0 -183
  88. package/dist/cjs/PublicationFeature-be5f3503.js +0 -130
  89. package/dist/cjs/PublicationLanding.js +0 -853
  90. package/dist/cjs/QueueDeckExpanded.js +0 -1540
  91. package/dist/cjs/QueueDeckExpandedPaginated.js +0 -1388
  92. package/dist/cjs/RecentNews.js +0 -91
  93. package/dist/cjs/RelatedContent.js +0 -114
  94. package/dist/cjs/RelatedTopicsDropdown.js +0 -90
  95. package/dist/cjs/RolesDeck.js +0 -94
  96. package/dist/cjs/Schema.js +0 -101
  97. package/dist/cjs/Search.js +0 -66
  98. package/dist/cjs/Segment.js +0 -403
  99. package/dist/cjs/SeriesListingDeck.js +0 -248
  100. package/dist/cjs/SeriesSlider-b94f1dd5.js +0 -332
  101. package/dist/cjs/SetCookie.js +0 -10
  102. package/dist/cjs/SideFooter.js +0 -151
  103. package/dist/cjs/SocialIcons.js +0 -103
  104. package/dist/cjs/SocialSearchComponent-b7faaedc.js +0 -213
  105. package/dist/cjs/SocialShare.js +0 -74
  106. package/dist/cjs/TaxonomyCard.js +0 -253
  107. package/dist/cjs/TaxonomyDescription.js +0 -205
  108. package/dist/cjs/TemplateNormal.js +0 -204
  109. package/dist/cjs/ThumbnailCard.js +0 -59
  110. package/dist/cjs/Ustream.js +0 -156
  111. package/dist/cjs/VerticalHero.js +0 -74
  112. package/dist/cjs/VideoProgramLandingPage.js +0 -260
  113. package/dist/cjs/VideoSeriesCard.js +0 -88
  114. package/dist/cjs/VideoSeriesFilter.js +0 -128
  115. package/dist/cjs/VideoSeriesLandingPage.js +0 -178
  116. package/dist/cjs/VideoSeriesListing.js +0 -422
  117. package/dist/cjs/View.js +0 -2601
  118. package/dist/cjs/YahooHero.js +0 -126
  119. package/dist/cjs/YoutubeGroup.js +0 -371
  120. package/dist/cjs/_commonjsHelpers-06173234.js +0 -25
  121. package/dist/cjs/_is-array-54228b29.js +0 -74
  122. package/dist/cjs/_iter-detect-b1df62f0.js +0 -52
  123. package/dist/cjs/_library-dd23b178.js +0 -5
  124. package/dist/cjs/_object-pie-083f2dd6.js +0 -16
  125. package/dist/cjs/_object-sap-d1978572.js +0 -16
  126. package/dist/cjs/_object-to-array-ce86cae7.js +0 -25
  127. package/dist/cjs/asyncToGenerator-77821af0.js +0 -1395
  128. package/dist/cjs/brightcove-react-player-loader.es-a195642e.js +0 -2232
  129. package/dist/cjs/core.get-iterator-method-5643aa10.js +0 -584
  130. package/dist/cjs/debounce-d4a2369b.js +0 -216
  131. package/dist/cjs/define-property-e8404b64.js +0 -20
  132. package/dist/cjs/defineProperty-9673846a.js +0 -34
  133. package/dist/cjs/entities-3f9d0f2f.js +0 -506
  134. package/dist/cjs/eq-5fc26c07.js +0 -79
  135. package/dist/cjs/extends-7c86182f.js +0 -87
  136. package/dist/cjs/faundadb.js +0 -644
  137. package/dist/cjs/get-5839e5b5.js +0 -920
  138. package/dist/cjs/getContentCategory-f38a4c00.js +0 -11
  139. package/dist/cjs/getKeywords.js +0 -46
  140. package/dist/cjs/getPtceActivities.js +0 -89
  141. package/dist/cjs/getQuery.js +0 -28
  142. package/dist/cjs/getRelatedArticle.js +0 -747
  143. package/dist/cjs/getRootDocGroup.js +0 -62
  144. package/dist/cjs/getSerializers.js +0 -64
  145. package/dist/cjs/getSeriesDetail.js +0 -40
  146. package/dist/cjs/getTargeting-4439c99d.js +0 -164
  147. package/dist/cjs/getTargeting.js +0 -13
  148. package/dist/cjs/iconBase-be4097c0.js +0 -106
  149. package/dist/cjs/index-0e4427c8.js +0 -1683
  150. package/dist/cjs/index-187c967e.js +0 -54
  151. package/dist/cjs/index-7361fa72.js +0 -11305
  152. package/dist/cjs/index-eadd5035.js +0 -613
  153. package/dist/cjs/index-efca863c.js +0 -556
  154. package/dist/cjs/index-f86bb269.js +0 -1571
  155. package/dist/cjs/index.es-f3e47207.js +0 -445
  156. package/dist/cjs/index.esm-2bb721c8.js +0 -96
  157. package/dist/cjs/index.esm-c1e16606.js +0 -13
  158. package/dist/cjs/index.esm-d51c9ac6.js +0 -25
  159. package/dist/cjs/index.esm-d81454e7.js +0 -19
  160. package/dist/cjs/index.js +0 -635
  161. package/dist/cjs/inherits-de66ea16.js +0 -188
  162. package/dist/cjs/isSymbol-03abbdf0.js +0 -209
  163. package/dist/cjs/js.cookie-a511c430.js +0 -160
  164. package/dist/cjs/keys-e982b3fa.js +0 -25
  165. package/dist/cjs/lodash-f0783643.js +0 -17195
  166. package/dist/cjs/main-f1c77adb.js +0 -973
  167. package/dist/cjs/moment-aca40de1.js +0 -5669
  168. package/dist/cjs/react-social-icons-af932527.js +0 -616
  169. package/dist/cjs/slicedToArray-067dd3bc.js +0 -95
  170. package/dist/cjs/smoothscroll-99df7f93.js +0 -438
  171. package/dist/cjs/stringify-f7a37a8d.js +0 -17
  172. package/dist/cjs/style-inject.es-dcee06b6.js +0 -30
  173. package/dist/cjs/timeDifferenceCalc.js +0 -39
  174. package/dist/cjs/toConsumableArray-d7797c2b.js +0 -74
  175. package/dist/cjs/toNumber-5e1fac58.js +0 -104
  176. package/dist/cjs/typeof-567e31ff.js +0 -382
  177. package/dist/cjs/urlFor.js +0 -65
  178. package/dist/cjs/urlForFile-29d3815a.js +0 -24
  179. package/dist/cjs/ustream-api-3819e4aa.js +0 -106
  180. package/dist/cjs/visibility-sensor-eb2c5b69.js +0 -597
  181. package/dist/cjs/web.dom.iterable-d98303e0.js +0 -50
  182. package/dist/esm/AD.js +0 -26
  183. package/dist/esm/AD300x250.js +0 -89
  184. package/dist/esm/AD300x250x600.js +0 -106
  185. package/dist/esm/AD728x90.js +0 -103
  186. package/dist/esm/ADFloatingFooter.js +0 -137
  187. package/dist/esm/ADFooter.js +0 -47
  188. package/dist/esm/ADGutter.js +0 -109
  189. package/dist/esm/ADInfeed-f684cac9.js +0 -59
  190. package/dist/esm/ADSkyscraper.js +0 -111
  191. package/dist/esm/ADSponsoredResources.js +0 -108
  192. package/dist/esm/ADWebcast.js +0 -113
  193. package/dist/esm/ADWelcome.js +0 -160
  194. package/dist/esm/ADlgInfeed-8c438cee.js +0 -54
  195. package/dist/esm/AccordionPanel.js +0 -87
  196. package/dist/esm/AdSlot.js +0 -244
  197. package/dist/esm/AdSlotsProvider.js +0 -176
  198. package/dist/esm/AlgoliaSearch.js +0 -188
  199. package/dist/esm/AlphabeticList.js +0 -129
  200. package/dist/esm/ArticleCarousel.js +0 -40
  201. package/dist/esm/ArticleProgramLandingPage.js +0 -178
  202. package/dist/esm/ArticleSeriesLandingPage.js +0 -156
  203. package/dist/esm/ArticleSeriesListing.js +0 -308
  204. package/dist/esm/AuthWrapper.js +0 -714
  205. package/dist/esm/AuthorComponent-defe68b6.js +0 -90
  206. package/dist/esm/Beam.js +0 -348
  207. package/dist/esm/BlockContent-c99c9a8d.js +0 -909
  208. package/dist/esm/Breadcrumbs.js +0 -100
  209. package/dist/esm/CMEDeck.js +0 -437
  210. package/dist/esm/Column1.js +0 -29
  211. package/dist/esm/Column2.js +0 -65
  212. package/dist/esm/Column3.js +0 -134
  213. package/dist/esm/ConferenceArticleCard.js +0 -87
  214. package/dist/esm/ConferenceBanner-8792ebd2.js +0 -18
  215. package/dist/esm/ContentCardPaginated.js +0 -406
  216. package/dist/esm/DeckContent.js +0 -497
  217. package/dist/esm/DeckQueue.js +0 -393
  218. package/dist/esm/DeckQueuePaginated.js +0 -337
  219. package/dist/esm/Dfp-4b99f79d.js +0 -96
  220. package/dist/esm/EventsDeck.js +0 -844
  221. package/dist/esm/ExternalResources.js +0 -210
  222. package/dist/esm/Feature.js +0 -122
  223. package/dist/esm/ForbesHero.js +0 -131
  224. package/dist/esm/GridContent.js +0 -818
  225. package/dist/esm/GridContentPaginated.js +0 -693
  226. package/dist/esm/GridHero.js +0 -141
  227. package/dist/esm/GroupDeck.js +0 -308
  228. package/dist/esm/HamMagazine.js +0 -590
  229. package/dist/esm/Header.js +0 -30
  230. package/dist/esm/HealthCareProfessionalModal.js +0 -70
  231. package/dist/esm/Hero.js +0 -42
  232. package/dist/esm/HighlightenVideo.js +0 -63
  233. package/dist/esm/HorizontalArticleListing.js +0 -159
  234. package/dist/esm/HorizontalHero.js +0 -105
  235. package/dist/esm/ImageSlider-eab2fe41.js +0 -176
  236. package/dist/esm/IssueContentDeck.js +0 -231
  237. package/dist/esm/IssueDeck.js +0 -258
  238. package/dist/esm/IssueLanding.js +0 -166
  239. package/dist/esm/KMTracker.js +0 -25
  240. package/dist/esm/LeftNav.js +0 -136
  241. package/dist/esm/MasterDeck.js +0 -548
  242. package/dist/esm/MasterDeckPaginated.js +0 -461
  243. package/dist/esm/MediaSeriesCard-99048e65.js +0 -9492
  244. package/dist/esm/MediaSeriesLanding.js +0 -496
  245. package/dist/esm/MediaSeriesLandingPaginated.js +0 -522
  246. package/dist/esm/NavDvm.js +0 -233
  247. package/dist/esm/NavFooter-e27bd93b.js +0 -60
  248. package/dist/esm/NavMagazine.js +0 -583
  249. package/dist/esm/NavNative.js +0 -846
  250. package/dist/esm/OncliveHero.js +0 -73
  251. package/dist/esm/OncliveLargeHero.js +0 -235
  252. package/dist/esm/PageFilter.js +0 -66
  253. package/dist/esm/Pagination-cd21f8c2.js +0 -82
  254. package/dist/esm/PartnerDetailListing.js +0 -320
  255. package/dist/esm/PartnerDetailListingPaginated.js +0 -312
  256. package/dist/esm/PdfDownload.js +0 -22
  257. package/dist/esm/PixelTracking.js +0 -156
  258. package/dist/esm/PopUpModal.js +0 -51
  259. package/dist/esm/PtceDeck.js +0 -143
  260. package/dist/esm/PubSection.js +0 -114
  261. package/dist/esm/PubToc.js +0 -81
  262. package/dist/esm/PublicationDeck.js +0 -173
  263. package/dist/esm/PublicationFeature-03500094.js +0 -121
  264. package/dist/esm/PublicationLanding.js +0 -843
  265. package/dist/esm/QueueDeckExpanded.js +0 -1534
  266. package/dist/esm/QueueDeckExpandedPaginated.js +0 -1382
  267. package/dist/esm/RecentNews.js +0 -85
  268. package/dist/esm/RelatedContent.js +0 -108
  269. package/dist/esm/RelatedTopicsDropdown.js +0 -82
  270. package/dist/esm/RolesDeck.js +0 -84
  271. package/dist/esm/Schema.js +0 -95
  272. package/dist/esm/Search.js +0 -57
  273. package/dist/esm/Segment.js +0 -401
  274. package/dist/esm/SeriesListingDeck.js +0 -242
  275. package/dist/esm/SeriesSlider-609f9d94.js +0 -326
  276. package/dist/esm/SetCookie.js +0 -8
  277. package/dist/esm/SideFooter.js +0 -145
  278. package/dist/esm/SocialIcons.js +0 -97
  279. package/dist/esm/SocialSearchComponent-1d8a9f59.js +0 -204
  280. package/dist/esm/SocialShare.js +0 -67
  281. package/dist/esm/TaxonomyCard.js +0 -243
  282. package/dist/esm/TaxonomyDescription.js +0 -198
  283. package/dist/esm/TemplateNormal.js +0 -197
  284. package/dist/esm/ThumbnailCard.js +0 -52
  285. package/dist/esm/Ustream.js +0 -150
  286. package/dist/esm/VerticalHero.js +0 -68
  287. package/dist/esm/VideoProgramLandingPage.js +0 -251
  288. package/dist/esm/VideoSeriesCard.js +0 -82
  289. package/dist/esm/VideoSeriesFilter.js +0 -122
  290. package/dist/esm/VideoSeriesLandingPage.js +0 -172
  291. package/dist/esm/VideoSeriesListing.js +0 -415
  292. package/dist/esm/View.js +0 -2590
  293. package/dist/esm/YahooHero.js +0 -120
  294. package/dist/esm/YoutubeGroup.js +0 -365
  295. package/dist/esm/_commonjsHelpers-0c4b6f40.js +0 -19
  296. package/dist/esm/_is-array-893ab020.js +0 -71
  297. package/dist/esm/_iter-detect-f089461c.js +0 -48
  298. package/dist/esm/_library-528f1934.js +0 -3
  299. package/dist/esm/_object-pie-133f504a.js +0 -13
  300. package/dist/esm/_object-sap-169d6272.js +0 -14
  301. package/dist/esm/_object-to-array-50a6b9a3.js +0 -23
  302. package/dist/esm/asyncToGenerator-9716ae8d.js +0 -1387
  303. package/dist/esm/brightcove-react-player-loader.es-57a70a56.js +0 -2226
  304. package/dist/esm/core.get-iterator-method-e903ff31.js +0 -547
  305. package/dist/esm/debounce-533d9748.js +0 -214
  306. package/dist/esm/define-property-99e66838.js +0 -18
  307. package/dist/esm/defineProperty-8fa0bc8d.js +0 -32
  308. package/dist/esm/entities-932b50cf.js +0 -503
  309. package/dist/esm/eq-bdcbf886.js +0 -76
  310. package/dist/esm/extends-dc6a71fd.js +0 -83
  311. package/dist/esm/faundadb.js +0 -636
  312. package/dist/esm/get-3c308da4.js +0 -918
  313. package/dist/esm/getContentCategory-15dcc413.js +0 -9
  314. package/dist/esm/getKeywords.js +0 -44
  315. package/dist/esm/getPtceActivities.js +0 -87
  316. package/dist/esm/getQuery.js +0 -26
  317. package/dist/esm/getRelatedArticle.js +0 -745
  318. package/dist/esm/getRootDocGroup.js +0 -60
  319. package/dist/esm/getSerializers.js +0 -58
  320. package/dist/esm/getSeriesDetail.js +0 -38
  321. package/dist/esm/getTargeting-db566006.js +0 -161
  322. package/dist/esm/getTargeting.js +0 -7
  323. package/dist/esm/iconBase-ccc56b97.js +0 -81
  324. package/dist/esm/index-0dbff1d1.js +0 -553
  325. package/dist/esm/index-5cc7b406.js +0 -1674
  326. package/dist/esm/index-755f2cc2.js +0 -605
  327. package/dist/esm/index-79cfd25c.js +0 -1569
  328. package/dist/esm/index-c60f3bb6.js +0 -11284
  329. package/dist/esm/index-c7e2ac95.js +0 -52
  330. package/dist/esm/index.es-a6137319.js +0 -439
  331. package/dist/esm/index.esm-1bd8a0a8.js +0 -18
  332. package/dist/esm/index.esm-37268dca.js +0 -89
  333. package/dist/esm/index.esm-9b042655.js +0 -10
  334. package/dist/esm/index.esm-eb1e8e80.js +0 -14
  335. package/dist/esm/index.js +0 -529
  336. package/dist/esm/inherits-8a801a18.js +0 -179
  337. package/dist/esm/isSymbol-a7e9aafe.js +0 -203
  338. package/dist/esm/js.cookie-6874175c.js +0 -158
  339. package/dist/esm/keys-425c8ab0.js +0 -23
  340. package/dist/esm/lodash-f97fd99a.js +0 -17193
  341. package/dist/esm/main-1894c974.js +0 -961
  342. package/dist/esm/moment-bc12cb97.js +0 -5667
  343. package/dist/esm/react-social-icons-9be47857.js +0 -609
  344. package/dist/esm/slicedToArray-ca2c8b8d.js +0 -92
  345. package/dist/esm/smoothscroll-fa4e3f8c.js +0 -436
  346. package/dist/esm/stringify-c21932b3.js +0 -15
  347. package/dist/esm/style-inject.es-1f59c1d0.js +0 -28
  348. package/dist/esm/timeDifferenceCalc.js +0 -37
  349. package/dist/esm/toConsumableArray-7b1c0e23.js +0 -71
  350. package/dist/esm/toNumber-5aeba6e7.js +0 -102
  351. package/dist/esm/typeof-83d9eb10.js +0 -378
  352. package/dist/esm/urlFor.js +0 -63
  353. package/dist/esm/urlForFile-413f5ddb.js +0 -22
  354. package/dist/esm/ustream-api-41166338.js +0 -104
  355. package/dist/esm/visibility-sensor-72fd8f8b.js +0 -590
  356. package/dist/esm/web.dom.iterable-fdf034f5.js +0 -48
@@ -1,556 +0,0 @@
1
- 'use strict';
2
-
3
- var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
4
-
5
- var parseAssetId_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var example = 'image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg';
8
- function parseAssetId(ref) {
9
- var _a = ref.split('-'), id = _a[1], dimensionString = _a[2], format = _a[3];
10
- if (!id || !dimensionString || !format) {
11
- throw new Error("Malformed asset _ref '" + ref + "'. Expected an id like \"" + example + "\".");
12
- }
13
- var _b = dimensionString.split('x'), imgWidthStr = _b[0], imgHeightStr = _b[1];
14
- var width = +imgWidthStr;
15
- var height = +imgHeightStr;
16
- var isValidAssetId = isFinite(width) && isFinite(height);
17
- if (!isValidAssetId) {
18
- throw new Error("Malformed asset _ref '" + ref + "'. Expected an id like \"" + example + "\".");
19
- }
20
- return { id: id, width: width, height: height, format: format };
21
- }
22
- exports.default = parseAssetId;
23
- //# sourceMappingURL=parseAssetId.js.map
24
- });
25
-
26
- _commonjsHelpers.unwrapExports(parseAssetId_1);
27
-
28
- var parseSource_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
29
- var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
30
- __assign = Object.assign || function(t) {
31
- for (var s, i = 1, n = arguments.length; i < n; i++) {
32
- s = arguments[i];
33
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
34
- t[p] = s[p];
35
- }
36
- return t;
37
- };
38
- return __assign.apply(this, arguments);
39
- };
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- var isRef = function (src) {
42
- var source = src;
43
- return source ? typeof source._ref === 'string' : false;
44
- };
45
- var isAsset = function (src) {
46
- var source = src;
47
- return source ? typeof source._id === 'string' : false;
48
- };
49
- var isAssetStub = function (src) {
50
- var source = src;
51
- return source && source.asset ? typeof source.asset.url === 'string' : false;
52
- };
53
- // Convert an asset-id, asset or image to an image record suitable for processing
54
- // eslint-disable-next-line complexity
55
- function parseSource(source) {
56
- if (!source) {
57
- return null;
58
- }
59
- var image;
60
- if (typeof source === 'string' && isUrl(source)) {
61
- // Someone passed an existing image url?
62
- image = {
63
- asset: { _ref: urlToId(source) },
64
- };
65
- }
66
- else if (typeof source === 'string') {
67
- // Just an asset id
68
- image = {
69
- asset: { _ref: source },
70
- };
71
- }
72
- else if (isRef(source)) {
73
- // We just got passed an asset directly
74
- image = {
75
- asset: source,
76
- };
77
- }
78
- else if (isAsset(source)) {
79
- // If we were passed an image asset document
80
- image = {
81
- asset: {
82
- _ref: source._id || '',
83
- },
84
- };
85
- }
86
- else if (isAssetStub(source)) {
87
- // If we were passed a partial asset (`url`, but no `_id`)
88
- image = {
89
- asset: {
90
- _ref: urlToId(source.asset.url),
91
- },
92
- };
93
- }
94
- else if (typeof source.asset === 'object') {
95
- // Probably an actual image with materialized asset
96
- image = source;
97
- }
98
- else {
99
- // We got something that does not look like an image, or it is an image
100
- // that currently isn't sporting an asset.
101
- return null;
102
- }
103
- var img = source;
104
- if (img.crop) {
105
- image.crop = img.crop;
106
- }
107
- if (img.hotspot) {
108
- image.hotspot = img.hotspot;
109
- }
110
- return applyDefaults(image);
111
- }
112
- exports.default = parseSource;
113
- function isUrl(url) {
114
- return /^https?:\/\//.test("" + url);
115
- }
116
- function urlToId(url) {
117
- var parts = url.split('/').slice(-1);
118
- return ("image-" + parts[0]).replace(/\.([a-z]+)$/, '-$1');
119
- }
120
- // Mock crop and hotspot if image lacks it
121
- function applyDefaults(image) {
122
- if (image.crop && image.hotspot) {
123
- return image;
124
- }
125
- // We need to pad in default values for crop or hotspot
126
- var result = __assign({}, image);
127
- if (!result.crop) {
128
- result.crop = {
129
- left: 0,
130
- top: 0,
131
- bottom: 0,
132
- right: 0,
133
- };
134
- }
135
- if (!result.hotspot) {
136
- result.hotspot = {
137
- x: 0.5,
138
- y: 0.5,
139
- height: 1.0,
140
- width: 1.0,
141
- };
142
- }
143
- return result;
144
- }
145
- //# sourceMappingURL=parseSource.js.map
146
- });
147
-
148
- _commonjsHelpers.unwrapExports(parseSource_1);
149
-
150
- var urlForImage_1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
151
- var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
152
- __assign = Object.assign || function(t) {
153
- for (var s, i = 1, n = arguments.length; i < n; i++) {
154
- s = arguments[i];
155
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
156
- t[p] = s[p];
157
- }
158
- return t;
159
- };
160
- return __assign.apply(this, arguments);
161
- };
162
- var __importDefault = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__importDefault) || function (mod) {
163
- return (mod && mod.__esModule) ? mod : { "default": mod };
164
- };
165
- Object.defineProperty(exports, "__esModule", { value: true });
166
- var parseAssetId_1$1 = __importDefault(parseAssetId_1);
167
- var parseSource_1$1 = __importDefault(parseSource_1);
168
- exports.parseSource = parseSource_1$1.default;
169
- exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
170
- ['width', 'w'],
171
- ['height', 'h'],
172
- ['format', 'fm'],
173
- ['download', 'dl'],
174
- ['blur', 'blur'],
175
- ['sharpen', 'sharp'],
176
- ['invert', 'invert'],
177
- ['orientation', 'or'],
178
- ['minHeight', 'min-h'],
179
- ['maxHeight', 'max-h'],
180
- ['minWidth', 'min-w'],
181
- ['maxWidth', 'max-w'],
182
- ['quality', 'q'],
183
- ['fit', 'fit'],
184
- ['crop', 'crop'],
185
- ['saturation', 'sat'],
186
- ['auto', 'auto'],
187
- ['dpr', 'dpr'],
188
- ['pad', 'pad'],
189
- ];
190
- function urlForImage(options) {
191
- var spec = __assign({}, (options || {}));
192
- var source = spec.source;
193
- delete spec.source;
194
- var image = parseSource_1$1.default(source);
195
- if (!image) {
196
- return null;
197
- }
198
- var id = image.asset._ref || image.asset._id || '';
199
- var asset = parseAssetId_1$1.default(id);
200
- // Compute crop rect in terms of pixel coordinates in the raw source image
201
- var cropLeft = Math.round(image.crop.left * asset.width);
202
- var cropTop = Math.round(image.crop.top * asset.height);
203
- var crop = {
204
- left: cropLeft,
205
- top: cropTop,
206
- width: Math.round(asset.width - image.crop.right * asset.width - cropLeft),
207
- height: Math.round(asset.height - image.crop.bottom * asset.height - cropTop),
208
- };
209
- // Compute hot spot rect in terms of pixel coordinates
210
- var hotSpotVerticalRadius = (image.hotspot.height * asset.height) / 2;
211
- var hotSpotHorizontalRadius = (image.hotspot.width * asset.width) / 2;
212
- var hotSpotCenterX = image.hotspot.x * asset.width;
213
- var hotSpotCenterY = image.hotspot.y * asset.height;
214
- var hotspot = {
215
- left: hotSpotCenterX - hotSpotHorizontalRadius,
216
- top: hotSpotCenterY - hotSpotVerticalRadius,
217
- right: hotSpotCenterX + hotSpotHorizontalRadius,
218
- bottom: hotSpotCenterY + hotSpotVerticalRadius,
219
- };
220
- // If irrelevant, or if we are requested to: don't perform crop/fit based on
221
- // the crop/hotspot.
222
- if (!(spec.rect || spec.focalPoint || spec.ignoreImageParams || spec.crop)) {
223
- spec = __assign(__assign({}, spec), fit({ crop: crop, hotspot: hotspot }, spec));
224
- }
225
- return specToImageUrl(__assign(__assign({}, spec), { asset: asset }));
226
- }
227
- exports.default = urlForImage;
228
- // eslint-disable-next-line complexity
229
- function specToImageUrl(spec) {
230
- var cdnUrl = spec.baseUrl || 'https://cdn.sanity.io';
231
- var filename = spec.asset.id + "-" + spec.asset.width + "x" + spec.asset.height + "." + spec.asset.format;
232
- var baseUrl = cdnUrl + "/images/" + spec.projectId + "/" + spec.dataset + "/" + filename;
233
- var params = [];
234
- if (spec.rect) {
235
- // Only bother url with a crop if it actually crops anything
236
- var _a = spec.rect, left = _a.left, top_1 = _a.top, width = _a.width, height = _a.height;
237
- var isEffectiveCrop = left !== 0 || top_1 !== 0 || height !== spec.asset.height || width !== spec.asset.width;
238
- if (isEffectiveCrop) {
239
- params.push("rect=" + left + "," + top_1 + "," + width + "," + height);
240
- }
241
- }
242
- if (spec.bg) {
243
- params.push("bg=" + spec.bg);
244
- }
245
- if (spec.focalPoint) {
246
- params.push("fp-x=" + spec.focalPoint.x);
247
- params.push("fp-y=" + spec.focalPoint.y);
248
- }
249
- var flip = [spec.flipHorizontal && 'h', spec.flipVertical && 'v'].filter(Boolean).join('');
250
- if (flip) {
251
- params.push("flip=" + flip);
252
- }
253
- // Map from spec name to url param name, and allow using the actual param name as an alternative
254
- exports.SPEC_NAME_TO_URL_NAME_MAPPINGS.forEach(function (mapping) {
255
- var specName = mapping[0], param = mapping[1];
256
- if (typeof spec[specName] !== 'undefined') {
257
- params.push(param + "=" + encodeURIComponent(spec[specName]));
258
- }
259
- else if (typeof spec[param] !== 'undefined') {
260
- params.push(param + "=" + encodeURIComponent(spec[param]));
261
- }
262
- });
263
- if (params.length === 0) {
264
- return baseUrl;
265
- }
266
- return baseUrl + "?" + params.join('&');
267
- }
268
- function fit(source, spec) {
269
- var cropRect;
270
- var imgWidth = spec.width;
271
- var imgHeight = spec.height;
272
- // If we are not constraining the aspect ratio, we'll just use the whole crop
273
- if (!(imgWidth && imgHeight)) {
274
- return { width: imgWidth, height: imgHeight, rect: source.crop };
275
- }
276
- var crop = source.crop;
277
- var hotspot = source.hotspot;
278
- // If we are here, that means aspect ratio is locked and fitting will be a bit harder
279
- var desiredAspectRatio = imgWidth / imgHeight;
280
- var cropAspectRatio = crop.width / crop.height;
281
- if (cropAspectRatio > desiredAspectRatio) {
282
- // The crop is wider than the desired aspect ratio. That means we are cutting from the sides
283
- var height = crop.height;
284
- var width = height * desiredAspectRatio;
285
- var top_2 = crop.top;
286
- // Center output horizontally over hotspot
287
- var hotspotXCenter = (hotspot.right - hotspot.left) / 2 + hotspot.left;
288
- var left = hotspotXCenter - width / 2;
289
- // Keep output within crop
290
- if (left < crop.left) {
291
- left = crop.left;
292
- }
293
- else if (left + width > crop.left + crop.width) {
294
- left = crop.left + crop.width - width;
295
- }
296
- cropRect = {
297
- left: Math.round(left),
298
- top: Math.round(top_2),
299
- width: Math.round(width),
300
- height: Math.round(height),
301
- };
302
- }
303
- else {
304
- // The crop is taller than the desired ratio, we are cutting from top and bottom
305
- var width = crop.width;
306
- var height = width / desiredAspectRatio;
307
- var left = crop.left;
308
- // Center output vertically over hotspot
309
- var hotspotYCenter = (hotspot.bottom - hotspot.top) / 2 + hotspot.top;
310
- var top_3 = hotspotYCenter - height / 2;
311
- // Keep output rect within crop
312
- if (top_3 < crop.top) {
313
- top_3 = crop.top;
314
- }
315
- else if (top_3 + height > crop.top + crop.height) {
316
- top_3 = crop.top + crop.height - height;
317
- }
318
- cropRect = {
319
- left: Math.max(0, Math.floor(left)),
320
- top: Math.max(0, Math.floor(top_3)),
321
- width: Math.round(width),
322
- height: Math.round(height),
323
- };
324
- }
325
- return {
326
- width: imgWidth,
327
- height: imgHeight,
328
- rect: cropRect,
329
- };
330
- }
331
- //# sourceMappingURL=urlForImage.js.map
332
- });
333
-
334
- _commonjsHelpers.unwrapExports(urlForImage_1);
335
- urlForImage_1.parseSource;
336
- urlForImage_1.SPEC_NAME_TO_URL_NAME_MAPPINGS;
337
-
338
- var builder = _commonjsHelpers.createCommonjsModule(function (module, exports) {
339
- var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
340
- __assign = Object.assign || function(t) {
341
- for (var s, i = 1, n = arguments.length; i < n; i++) {
342
- s = arguments[i];
343
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
344
- t[p] = s[p];
345
- }
346
- return t;
347
- };
348
- return __assign.apply(this, arguments);
349
- };
350
- var __importStar = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__importStar) || function (mod) {
351
- if (mod && mod.__esModule) return mod;
352
- var result = {};
353
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
354
- result["default"] = mod;
355
- return result;
356
- };
357
- Object.defineProperty(exports, "__esModule", { value: true });
358
- var urlForImage_1$1 = __importStar(urlForImage_1);
359
- var validFits = ['clip', 'crop', 'fill', 'fillmax', 'max', 'scale', 'min'];
360
- var validCrops = ['top', 'bottom', 'left', 'right', 'center', 'focalpoint', 'entropy'];
361
- var validAutoModes = ['format'];
362
- function isSanityClientLike(client) {
363
- return client ? typeof client.clientConfig === 'object' : false;
364
- }
365
- function rewriteSpecName(key) {
366
- var specs = urlForImage_1$1.SPEC_NAME_TO_URL_NAME_MAPPINGS;
367
- for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) {
368
- var entry = specs_1[_i];
369
- var specName = entry[0], param = entry[1];
370
- if (key === specName || key === param) {
371
- return specName;
372
- }
373
- }
374
- return key;
375
- }
376
- function urlBuilder(options) {
377
- // Did we get a SanityClient?
378
- var client = options;
379
- if (isSanityClientLike(client)) {
380
- // Inherit config from client
381
- var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
382
- var apiHost = apiUrl || 'https://api.sanity.io';
383
- return new ImageUrlBuilder(null, {
384
- baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
385
- projectId: projectId,
386
- dataset: dataset,
387
- });
388
- }
389
- // Or just accept the options as given
390
- return new ImageUrlBuilder(null, options);
391
- }
392
- exports.default = urlBuilder;
393
- var ImageUrlBuilder = /** @class */ (function () {
394
- function ImageUrlBuilder(parent, options) {
395
- this.options = parent
396
- ? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
397
- }
398
- ImageUrlBuilder.prototype.withOptions = function (options) {
399
- var baseUrl = options.baseUrl || this.options.baseUrl;
400
- var newOptions = { baseUrl: baseUrl };
401
- for (var key in options) {
402
- if (options.hasOwnProperty(key)) {
403
- var specKey = rewriteSpecName(key);
404
- newOptions[specKey] = options[key];
405
- }
406
- }
407
- return new ImageUrlBuilder(this, __assign({ baseUrl: baseUrl }, newOptions));
408
- };
409
- // The image to be represented. Accepts a Sanity 'image'-document, 'asset'-document or
410
- // _id of asset. To get the benefit of automatic hot-spot/crop integration with the content
411
- // studio, the 'image'-document must be provided.
412
- ImageUrlBuilder.prototype.image = function (source) {
413
- return this.withOptions({ source: source });
414
- };
415
- // Specify the dataset
416
- ImageUrlBuilder.prototype.dataset = function (dataset) {
417
- return this.withOptions({ dataset: dataset });
418
- };
419
- // Specify the projectId
420
- ImageUrlBuilder.prototype.projectId = function (projectId) {
421
- return this.withOptions({ projectId: projectId });
422
- };
423
- // Specify background color
424
- ImageUrlBuilder.prototype.bg = function (bg) {
425
- return this.withOptions({ bg: bg });
426
- };
427
- // Set DPR scaling factor
428
- ImageUrlBuilder.prototype.dpr = function (dpr) {
429
- return this.withOptions({ dpr: dpr });
430
- };
431
- // Specify the width of the image in pixels
432
- ImageUrlBuilder.prototype.width = function (width) {
433
- return this.withOptions({ width: width });
434
- };
435
- // Specify the height of the image in pixels
436
- ImageUrlBuilder.prototype.height = function (height) {
437
- return this.withOptions({ height: height });
438
- };
439
- // Specify focal point in fraction of image dimensions. Each component 0.0-1.0
440
- ImageUrlBuilder.prototype.focalPoint = function (x, y) {
441
- return this.withOptions({ focalPoint: { x: x, y: y } });
442
- };
443
- ImageUrlBuilder.prototype.maxWidth = function (maxWidth) {
444
- return this.withOptions({ maxWidth: maxWidth });
445
- };
446
- ImageUrlBuilder.prototype.minWidth = function (minWidth) {
447
- return this.withOptions({ minWidth: minWidth });
448
- };
449
- ImageUrlBuilder.prototype.maxHeight = function (maxHeight) {
450
- return this.withOptions({ maxHeight: maxHeight });
451
- };
452
- ImageUrlBuilder.prototype.minHeight = function (minHeight) {
453
- return this.withOptions({ minHeight: minHeight });
454
- };
455
- // Specify width and height in pixels
456
- ImageUrlBuilder.prototype.size = function (width, height) {
457
- return this.withOptions({ width: width, height: height });
458
- };
459
- // Specify blur between 0 and 100
460
- ImageUrlBuilder.prototype.blur = function (blur) {
461
- return this.withOptions({ blur: blur });
462
- };
463
- ImageUrlBuilder.prototype.sharpen = function (sharpen) {
464
- return this.withOptions({ sharpen: sharpen });
465
- };
466
- // Specify the desired rectangle of the image
467
- ImageUrlBuilder.prototype.rect = function (left, top, width, height) {
468
- return this.withOptions({ rect: { left: left, top: top, width: width, height: height } });
469
- };
470
- // Specify the image format of the image. 'jpg', 'pjpg', 'png', 'webp'
471
- ImageUrlBuilder.prototype.format = function (format) {
472
- return this.withOptions({ format: format });
473
- };
474
- ImageUrlBuilder.prototype.invert = function (invert) {
475
- return this.withOptions({ invert: invert });
476
- };
477
- // Rotation in degrees 0, 90, 180, 270
478
- ImageUrlBuilder.prototype.orientation = function (orientation) {
479
- return this.withOptions({ orientation: orientation });
480
- };
481
- // Compression quality 0-100
482
- ImageUrlBuilder.prototype.quality = function (quality) {
483
- return this.withOptions({ quality: quality });
484
- };
485
- // Make it a download link. Parameter is default filename.
486
- ImageUrlBuilder.prototype.forceDownload = function (download) {
487
- return this.withOptions({ download: download });
488
- };
489
- // Flip image horizontally
490
- ImageUrlBuilder.prototype.flipHorizontal = function () {
491
- return this.withOptions({ flipHorizontal: true });
492
- };
493
- // Flip image vertically
494
- ImageUrlBuilder.prototype.flipVertical = function () {
495
- return this.withOptions({ flipVertical: true });
496
- };
497
- // Ignore crop/hotspot from image record, even when present
498
- ImageUrlBuilder.prototype.ignoreImageParams = function () {
499
- return this.withOptions({ ignoreImageParams: true });
500
- };
501
- ImageUrlBuilder.prototype.fit = function (value) {
502
- if (validFits.indexOf(value) === -1) {
503
- throw new Error("Invalid fit mode \"" + value + "\"");
504
- }
505
- return this.withOptions({ fit: value });
506
- };
507
- ImageUrlBuilder.prototype.crop = function (value) {
508
- if (validCrops.indexOf(value) === -1) {
509
- throw new Error("Invalid crop mode \"" + value + "\"");
510
- }
511
- return this.withOptions({ crop: value });
512
- };
513
- // Saturation
514
- ImageUrlBuilder.prototype.saturation = function (saturation) {
515
- return this.withOptions({ saturation: saturation });
516
- };
517
- ImageUrlBuilder.prototype.auto = function (value) {
518
- if (validAutoModes.indexOf(value) === -1) {
519
- throw new Error("Invalid auto mode \"" + value + "\"");
520
- }
521
- return this.withOptions({ auto: value });
522
- };
523
- // Specify the number of pixels to pad the image
524
- ImageUrlBuilder.prototype.pad = function (pad) {
525
- return this.withOptions({ pad: pad });
526
- };
527
- // Gets the url based on the submitted parameters
528
- ImageUrlBuilder.prototype.url = function () {
529
- return urlForImage_1$1.default(this.options);
530
- };
531
- // Alias for url()
532
- ImageUrlBuilder.prototype.toString = function () {
533
- return this.url();
534
- };
535
- return ImageUrlBuilder;
536
- }());
537
- exports.ImageUrlBuilder = ImageUrlBuilder;
538
- //# sourceMappingURL=builder.js.map
539
- });
540
-
541
- _commonjsHelpers.unwrapExports(builder);
542
- builder.ImageUrlBuilder;
543
-
544
- var node = _commonjsHelpers.createCommonjsModule(function (module) {
545
- var __importDefault = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__importDefault) || function (mod) {
546
- return (mod && mod.__esModule) ? mod : { "default": mod };
547
- };
548
- var builder_1 = __importDefault(builder);
549
- module.exports = builder_1.default;
550
- //# sourceMappingURL=index.js.map
551
- });
552
-
553
- var imageUrlBuilder = _commonjsHelpers.unwrapExports(node);
554
-
555
- exports.imageUrlBuilder = imageUrlBuilder;
556
- exports.node = node;