@selfcommunity/react-ui 0.1.4 → 0.1.5-alpha.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 (211) hide show
  1. package/lib/cjs/components/AccountSignIn/AccountSignIn.js +3 -1
  2. package/lib/cjs/components/BroadcastMessages/BroadcastMessages.js +3 -1
  3. package/lib/cjs/components/BroadcastMessages/Message.js +3 -1
  4. package/lib/cjs/components/CategoriesFollowed/CategoriesFollowed.js +3 -1
  5. package/lib/cjs/components/CategoriesPopular/CategoriesPopular.js +2 -2
  6. package/lib/cjs/components/ChangeCover/ChangeCover.js +2 -2
  7. package/lib/cjs/components/CommentObject/CommentObject.js +5 -3
  8. package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js +3 -1
  9. package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +3 -1
  10. package/lib/cjs/components/CommentsObject/CommentsObject.js +3 -3
  11. package/lib/cjs/components/Composer/Composer.js +4 -4
  12. package/lib/cjs/components/Feed/Feed.js +4 -4
  13. package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +3 -1
  14. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +3 -1
  15. package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +3 -1
  16. package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js +4 -2
  17. package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +3 -1
  18. package/lib/cjs/components/FeedObject/Contributors/Contributors.js +3 -1
  19. package/lib/cjs/components/FeedObject/FeedObject.js +3 -1
  20. package/lib/cjs/components/FeedObject/Poll/Poll.js +2 -2
  21. package/lib/cjs/components/FollowCategoryButton/FollowCategoryButton.js +3 -1
  22. package/lib/cjs/components/FollowUserButton/FollowUserButton.js +3 -1
  23. package/lib/cjs/components/Footer/Footer.js +4 -2
  24. package/lib/cjs/components/Incubator/SubscribeButton/SubscribeButton.js +3 -1
  25. package/lib/cjs/components/IncubatorDetail/IncubatorDetail.js +3 -1
  26. package/lib/cjs/components/IncubatorSuggestion/IncubatorSuggestion.js +3 -1
  27. package/lib/cjs/components/IncubatorsList/CreateIncubatorDialog/CreateIncubatorDialog.js +3 -1
  28. package/lib/cjs/components/IncubatorsList/IncubatorsList.js +2 -2
  29. package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.js +5 -3
  30. package/lib/cjs/components/Notification/DeletedFor/DeletedFor.js +5 -3
  31. package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +3 -1
  32. package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +5 -3
  33. package/lib/cjs/components/Notification/Notification.js +4 -2
  34. package/lib/cjs/components/PollSuggestion/PollSuggestion.js +3 -1
  35. package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.js +4 -2
  36. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +3 -1
  37. package/lib/cjs/components/TrendingFeed/TrendingFeed.js +2 -2
  38. package/lib/cjs/components/UserFollowers/UserFollowers.js +3 -1
  39. package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +6 -5
  40. package/lib/cjs/components/UserProfileInfo/UserProfileInfo.js +3 -1
  41. package/lib/cjs/components/UsersFollowed/UsersFollowed.js +3 -1
  42. package/lib/cjs/shared/ContributionActionsMenu/index.js +10 -10
  43. package/lib/cjs/shared/Lightbox/Lightbox.js +5 -5
  44. package/lib/cjs/shared/Media/Link/UrlTextField/index.js +3 -3
  45. package/lib/esm/api-services/src/constants/Endpoints.d.ts.map +1 -1
  46. package/lib/esm/api-services/src/index.d.ts +26 -3
  47. package/lib/esm/api-services/src/index.d.ts.map +1 -1
  48. package/lib/esm/api-services/src/services/category/index.d.ts +42 -0
  49. package/lib/esm/api-services/src/services/category/index.d.ts.map +1 -1
  50. package/lib/esm/api-services/src/services/comment/index.d.ts +40 -0
  51. package/lib/esm/api-services/src/services/comment/index.d.ts.map +1 -0
  52. package/lib/esm/api-services/src/services/custom_adv/index.d.ts +16 -0
  53. package/lib/esm/api-services/src/services/custom_adv/index.d.ts.map +1 -0
  54. package/lib/esm/api-services/src/services/custom_page/index.d.ts +16 -0
  55. package/lib/esm/api-services/src/services/custom_page/index.d.ts.map +1 -0
  56. package/lib/esm/api-services/src/services/data_portability/index.d.ts +16 -0
  57. package/lib/esm/api-services/src/services/data_portability/index.d.ts.map +1 -0
  58. package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts +16 -0
  59. package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts.map +1 -0
  60. package/lib/esm/api-services/src/services/embed/index.d.ts +31 -0
  61. package/lib/esm/api-services/src/services/embed/index.d.ts.map +1 -0
  62. package/lib/esm/api-services/src/services/feed/index.d.ts +22 -0
  63. package/lib/esm/api-services/src/services/feed/index.d.ts.map +1 -0
  64. package/lib/esm/api-services/src/services/feed_object/index.d.ts +88 -0
  65. package/lib/esm/api-services/src/services/feed_object/index.d.ts.map +1 -0
  66. package/lib/esm/api-services/src/services/incubator/index.d.ts +28 -0
  67. package/lib/esm/api-services/src/services/incubator/index.d.ts.map +1 -0
  68. package/lib/esm/api-services/src/services/insight/index.d.ts +25 -0
  69. package/lib/esm/api-services/src/services/insight/index.d.ts.map +1 -0
  70. package/lib/esm/api-services/src/services/legal_page/index.d.ts +25 -0
  71. package/lib/esm/api-services/src/services/legal_page/index.d.ts.map +1 -0
  72. package/lib/esm/api-services/src/services/locality/index.d.ts +13 -0
  73. package/lib/esm/api-services/src/services/locality/index.d.ts.map +1 -0
  74. package/lib/esm/api-services/src/services/loyalty/index.d.ts +34 -0
  75. package/lib/esm/api-services/src/services/loyalty/index.d.ts.map +1 -0
  76. package/lib/esm/api-services/src/services/media/index.d.ts +28 -0
  77. package/lib/esm/api-services/src/services/media/index.d.ts.map +1 -0
  78. package/lib/esm/api-services/src/services/moderation/index.d.ts +25 -0
  79. package/lib/esm/api-services/src/services/moderation/index.d.ts.map +1 -0
  80. package/lib/esm/api-services/src/services/notification/index.d.ts +34 -0
  81. package/lib/esm/api-services/src/services/notification/index.d.ts.map +1 -0
  82. package/lib/esm/api-services/src/services/private_message/index.d.ts +37 -0
  83. package/lib/esm/api-services/src/services/private_message/index.d.ts.map +1 -0
  84. package/lib/esm/api-services/src/services/score/index.d.ts +16 -0
  85. package/lib/esm/api-services/src/services/score/index.d.ts.map +1 -0
  86. package/lib/esm/api-services/src/services/sso/index.d.ts +13 -0
  87. package/lib/esm/api-services/src/services/sso/index.d.ts.map +1 -0
  88. package/lib/esm/api-services/src/services/suggestion/index.d.ts +19 -0
  89. package/lib/esm/api-services/src/services/suggestion/index.d.ts.map +1 -0
  90. package/lib/esm/api-services/src/services/tag/index.d.ts +28 -0
  91. package/lib/esm/api-services/src/services/tag/index.d.ts.map +1 -0
  92. package/lib/esm/api-services/src/services/user/index.d.ts +132 -0
  93. package/lib/esm/api-services/src/services/user/index.d.ts.map +1 -1
  94. package/lib/esm/api-services/src/services/webhook/index.d.ts +43 -0
  95. package/lib/esm/api-services/src/services/webhook/index.d.ts.map +1 -0
  96. package/lib/esm/api-services/src/utils/token.d.ts +5 -0
  97. package/lib/esm/api-services/src/utils/token.d.ts.map +1 -1
  98. package/lib/esm/components/AccountSignIn/AccountSignIn.js +3 -1
  99. package/lib/esm/components/BroadcastMessages/BroadcastMessages.js +3 -1
  100. package/lib/esm/components/BroadcastMessages/Message.js +3 -1
  101. package/lib/esm/components/CategoriesFollowed/CategoriesFollowed.js +3 -1
  102. package/lib/esm/components/CategoriesPopular/CategoriesPopular.js +2 -2
  103. package/lib/esm/components/ChangeCover/ChangeCover.js +2 -2
  104. package/lib/esm/components/CommentObject/CommentObject.js +5 -3
  105. package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js +3 -1
  106. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +3 -1
  107. package/lib/esm/components/CommentsObject/CommentsObject.js +3 -3
  108. package/lib/esm/components/Composer/Composer.js +4 -4
  109. package/lib/esm/components/Feed/Feed.js +4 -4
  110. package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +3 -1
  111. package/lib/esm/components/FeedObject/Actions/Share/Share.js +3 -1
  112. package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +3 -1
  113. package/lib/esm/components/FeedObject/Actions/Vote/Vote.js +4 -2
  114. package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +3 -1
  115. package/lib/esm/components/FeedObject/Contributors/Contributors.js +3 -1
  116. package/lib/esm/components/FeedObject/FeedObject.js +3 -1
  117. package/lib/esm/components/FeedObject/Poll/Poll.js +2 -2
  118. package/lib/esm/components/FollowCategoryButton/FollowCategoryButton.js +3 -1
  119. package/lib/esm/components/FollowUserButton/FollowUserButton.js +3 -1
  120. package/lib/esm/components/Footer/Footer.js +4 -2
  121. package/lib/esm/components/Incubator/SubscribeButton/SubscribeButton.js +3 -1
  122. package/lib/esm/components/IncubatorDetail/IncubatorDetail.js +3 -1
  123. package/lib/esm/components/IncubatorSuggestion/IncubatorSuggestion.js +3 -1
  124. package/lib/esm/components/IncubatorsList/CreateIncubatorDialog/CreateIncubatorDialog.js +3 -1
  125. package/lib/esm/components/IncubatorsList/IncubatorsList.js +2 -2
  126. package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.js +5 -3
  127. package/lib/esm/components/Notification/DeletedFor/DeletedFor.js +5 -3
  128. package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +3 -1
  129. package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +5 -3
  130. package/lib/esm/components/Notification/Notification.js +4 -2
  131. package/lib/esm/components/PollSuggestion/PollSuggestion.js +3 -1
  132. package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.js +4 -2
  133. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +3 -1
  134. package/lib/esm/components/TrendingFeed/TrendingFeed.js +2 -2
  135. package/lib/esm/components/UserFollowers/UserFollowers.js +3 -1
  136. package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +6 -5
  137. package/lib/esm/components/UserProfileInfo/UserProfileInfo.js +3 -1
  138. package/lib/esm/components/UsersFollowed/UsersFollowed.js +3 -1
  139. package/lib/esm/react-core/src/hooks/useSCFetchAddressingTagList.d.ts.map +1 -1
  140. package/lib/esm/react-core/src/hooks/useSCFetchCommentObjects.d.ts +1 -2
  141. package/lib/esm/react-core/src/hooks/useSCFetchCommentObjects.d.ts.map +1 -1
  142. package/lib/esm/react-core/src/hooks/useSCWebSocket.d.ts +1 -1
  143. package/lib/esm/react-core/src/hooks/useSCWebSocket.d.ts.map +1 -1
  144. package/lib/esm/react-core/src/index.d.ts +2 -7
  145. package/lib/esm/react-core/src/index.d.ts.map +1 -1
  146. package/lib/esm/react-core/src/utils/validator.d.ts.map +1 -1
  147. package/lib/esm/react-ui/src/components/AccountSignIn/AccountSignIn.d.ts.map +1 -1
  148. package/lib/esm/react-ui/src/components/BroadcastMessages/BroadcastMessages.d.ts.map +1 -1
  149. package/lib/esm/react-ui/src/components/CategoriesFollowed/CategoriesFollowed.d.ts.map +1 -1
  150. package/lib/esm/react-ui/src/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +1 -1
  151. package/lib/esm/react-ui/src/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
  152. package/lib/esm/react-ui/src/components/Feed/Feed.d.ts.map +1 -1
  153. package/lib/esm/react-ui/src/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
  154. package/lib/esm/react-ui/src/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
  155. package/lib/esm/react-ui/src/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
  156. package/lib/esm/react-ui/src/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.d.ts.map +1 -1
  157. package/lib/esm/react-ui/src/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
  158. package/lib/esm/react-ui/src/components/IncubatorSuggestion/IncubatorSuggestion.d.ts.map +1 -1
  159. package/lib/esm/react-ui/src/components/IncubatorsList/CreateIncubatorDialog/CreateIncubatorDialog.d.ts.map +1 -1
  160. package/lib/esm/react-ui/src/components/Notification/CollapsedFor/CollapsedFor.d.ts.map +1 -1
  161. package/lib/esm/react-ui/src/components/Notification/DeletedFor/DeletedFor.d.ts.map +1 -1
  162. package/lib/esm/react-ui/src/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.d.ts.map +1 -1
  163. package/lib/esm/react-ui/src/components/Notification/KindlyNoticeFor/KindlyNoticeFor.d.ts.map +1 -1
  164. package/lib/esm/react-ui/src/components/Notification/Notification.d.ts.map +1 -1
  165. package/lib/esm/react-ui/src/components/PollSuggestion/PollSuggestion.d.ts.map +1 -1
  166. package/lib/esm/react-ui/src/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
  167. package/lib/esm/react-ui/src/components/SnippetNotifications/SnippetNotifications.d.ts.map +1 -1
  168. package/lib/esm/react-ui/src/components/UserFollowers/UserFollowers.d.ts.map +1 -1
  169. package/lib/esm/react-ui/src/components/UserProfileEdit/Section/PublicInfo.d.ts.map +1 -1
  170. package/lib/esm/react-ui/src/components/UserProfileInfo/UserProfileInfo.d.ts.map +1 -1
  171. package/lib/esm/react-ui/src/components/UsersFollowed/UsersFollowed.d.ts.map +1 -1
  172. package/lib/esm/react-ui/src/shared/ContributionActionsMenu/index.d.ts.map +1 -1
  173. package/lib/esm/shared/ContributionActionsMenu/index.js +10 -10
  174. package/lib/esm/shared/Lightbox/Lightbox.js +5 -5
  175. package/lib/esm/shared/Media/Link/UrlTextField/index.js +3 -3
  176. package/lib/esm/utils/src/index.d.ts +8 -3
  177. package/lib/esm/utils/src/index.d.ts.map +1 -1
  178. package/lib/esm/utils/src/utils/browser.d.ts +9 -0
  179. package/lib/esm/utils/src/utils/browser.d.ts.map +1 -0
  180. package/lib/esm/{react-core → utils}/src/utils/logger.d.ts +0 -0
  181. package/lib/esm/utils/src/utils/logger.d.ts.map +1 -0
  182. package/lib/esm/{react-core → utils}/src/utils/object.d.ts +0 -0
  183. package/lib/esm/utils/src/utils/object.d.ts.map +1 -0
  184. package/lib/esm/utils/src/utils/string.d.ts +22 -0
  185. package/lib/esm/utils/src/utils/string.d.ts.map +1 -1
  186. package/lib/esm/utils/src/utils/url.d.ts +11 -0
  187. package/lib/esm/utils/src/utils/url.d.ts.map +1 -1
  188. package/lib/esm/{react-core → utils}/src/utils/websocket.d.ts +0 -0
  189. package/lib/esm/utils/src/utils/websocket.d.ts.map +1 -0
  190. package/lib/umd/react-ui.js +14 -14
  191. package/lib/umd/react-ui.js.map +1 -1
  192. package/package.json +6 -6
  193. package/lib/cjs/scss/styles.scss +0 -0
  194. package/lib/cjs/utils/string.js +0 -65
  195. package/lib/cjs/utils/url.js +0 -24
  196. package/lib/cjs/utils/window.js +0 -41
  197. package/lib/esm/react-core/src/utils/logger.d.ts.map +0 -1
  198. package/lib/esm/react-core/src/utils/object.d.ts.map +0 -1
  199. package/lib/esm/react-core/src/utils/string.d.ts +0 -21
  200. package/lib/esm/react-core/src/utils/string.d.ts.map +0 -1
  201. package/lib/esm/react-core/src/utils/url.d.ts +0 -22
  202. package/lib/esm/react-core/src/utils/url.d.ts.map +0 -1
  203. package/lib/esm/react-core/src/utils/webPushMessaging.d.ts +0 -14
  204. package/lib/esm/react-core/src/utils/webPushMessaging.d.ts.map +0 -1
  205. package/lib/esm/react-core/src/utils/websocket.d.ts.map +0 -1
  206. package/lib/esm/react-ui/src/utils/url.d.ts +0 -7
  207. package/lib/esm/react-ui/src/utils/url.d.ts.map +0 -1
  208. package/lib/esm/scss/styles.scss +0 -0
  209. package/lib/esm/utils/string.js +0 -65
  210. package/lib/esm/utils/url.js +0 -24
  211. package/lib/esm/utils/window.js +0 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfcommunity/react-ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-alpha.0",
4
4
  "description": "React UI Components to integrate a Community created with SelfCommunity.",
5
5
  "author": "SelfCommunity <https://www.selfcommunity.com>",
6
6
  "homepage": "https://www.selfcommunity.com",
@@ -68,10 +68,10 @@
68
68
  "@rpldy/upload-drop-zone": "^0.18.0",
69
69
  "@rpldy/upload-preview": "^0.18.0",
70
70
  "@rpldy/uploady": "^0.18.0",
71
- "@selfcommunity/api-services": "^0.1.4",
72
- "@selfcommunity/react-core": "^0.1.4",
73
- "@selfcommunity/react-i18n": "^0.1.4",
74
- "@selfcommunity/types": "^0.1.4",
71
+ "@selfcommunity/api-services": "^0.1.5-alpha.0",
72
+ "@selfcommunity/react-core": "^0.1.5-alpha.0",
73
+ "@selfcommunity/react-i18n": "^0.1.5-alpha.0",
74
+ "@selfcommunity/types": "^0.1.5-alpha.0",
75
75
  "@types/classnames": "^2.2.11",
76
76
  "autosuggest-highlight": "^3.1.1",
77
77
  "classnames": "^2.2.6",
@@ -155,5 +155,5 @@
155
155
  "bugs": {
156
156
  "url": "https://github.com/selfcommunity/community-js/issues"
157
157
  },
158
- "gitHead": "054ebdf2fe6993fa65a81e204cd34c678958e047"
158
+ "gitHead": "ce47fd80ccb32a7129728396883790828a3722cd"
159
159
  }
File without changes
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.copyTextToClipboard = copyTextToClipboard;
5
- exports.fallbackCopyTextToClipboard = fallbackCopyTextToClipboard;
6
- exports.random = random;
7
- exports.stripHtml = stripHtml;
8
-
9
- function stripHtml(str) {
10
- return str.replace(/<[^>]*>?/gm, '').trim();
11
- }
12
-
13
- function random() {
14
- return (Math.random() + 1).toString(36).substring(7);
15
- }
16
- /**
17
- * Fallback if navigator.clipboard doensn't exist
18
- * @param text
19
- * @returns {Promise<void>}
20
- */
21
-
22
-
23
- function fallbackCopyTextToClipboard(text) {
24
- let textArea = document.createElement('textarea');
25
- textArea.value = text; // Avoid scrolling to bottom
26
-
27
- textArea.style.top = '0';
28
- textArea.style.left = '0';
29
- textArea.style.position = 'fixed';
30
- document.body.appendChild(textArea);
31
- textArea.focus();
32
- textArea.select();
33
-
34
- try {
35
- let successful = document.execCommand('copy');
36
- document.body.removeChild(textArea);
37
- return Promise.success();
38
- } catch (err) {
39
- document.body.removeChild(textArea);
40
- return Promise.reject(err);
41
- }
42
- }
43
- /**
44
- * Copy text to clipboard
45
- * @param text
46
- * @returns {Promise<void>}
47
- *
48
- * Ex.
49
- * copyTextToClipboard(text).then(
50
- * function () {
51
- * console.log('Async: Copying to clipboard was successful!');
52
- * },
53
- * function (err) {
54
- * console.error('Async: Could not copy text: ', err);
55
- * });
56
- */
57
-
58
-
59
- function copyTextToClipboard(text) {
60
- if (!navigator.clipboard) {
61
- return fallbackCopyTextToClipboard(text);
62
- }
63
-
64
- return navigator.clipboard.writeText(text);
65
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.appendURLSearchParams = appendURLSearchParams;
5
-
6
- /**
7
- * Append params
8
- * @param baseUrl
9
- * @param queryParams
10
- */
11
- function appendURLSearchParams(baseUrl, queryParams) {
12
- let _url = baseUrl;
13
-
14
- if (queryParams.length && _url) {
15
- const key = Object.keys(queryParams[0])[0];
16
- _url += (_url.split('?')[1] ? '&' : '?') + `${key}=${queryParams[0][key]}`;
17
- queryParams.slice(1).map(p => {
18
- const key = Object.keys(p)[0];
19
- _url += `&${key}=${p[key]}`;
20
- });
21
- }
22
-
23
- return _url;
24
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.getHighestSafeWindowContext = getHighestSafeWindowContext;
5
- exports.getWindowHeight = getWindowHeight;
6
- exports.getWindowWidth = getWindowWidth;
7
-
8
- function getWindowWidth() {
9
- return typeof global.window !== 'undefined' ? global.window.innerWidth : 0;
10
- }
11
-
12
- function getWindowHeight() {
13
- return typeof global.window !== 'undefined' ? global.window.innerHeight : 0;
14
- }
15
-
16
- const isCrossOriginFrame = () => {
17
- try {
18
- return global.window.location.hostname !== global.window.parent.location.hostname;
19
- } catch (e) {
20
- return true;
21
- }
22
- }; // Get the highest window context that isn't cross-origin
23
- // (When in an iframe)
24
-
25
-
26
- function getHighestSafeWindowContext(self = global.window.self) {
27
- // If we reached the top level, return self
28
- if (self === global.window.top) {
29
- return self;
30
- } // If parent is the same origin, we can move up one context
31
- // Reference: https://stackoverflow.com/a/21965342/1601953
32
-
33
-
34
- if (!isCrossOriginFrame()) {
35
- return getHighestSafeWindowContext(self.parent);
36
- } // If a different origin, we consider the current level
37
- // as the top reachable one
38
-
39
-
40
- return self;
41
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../../../react-core/src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,MAAM;IACjB,MAAM,CAAC,IAAI,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA;IAI1B,MAAM,CAAC,IAAI,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA;IAI1B,MAAM,CAAC,KAAK,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA;IAI3B,MAAM,CAAC,GAAG,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA;IAIzB,MAAM,CAAC,KAAK,CAAC,KAAK,KAAA,EAAE,OAAO,KAAA;CAG5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../../../react-core/src/utils/object.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,KAAA,WAEzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgBhE"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Check if v is a string
3
- * @param v
4
- */
5
- export declare function isString(v: any): boolean;
6
- /**
7
- * Capitalize a string
8
- * @param str
9
- */
10
- export declare function capitalize(str: string): string;
11
- /**
12
- * CamelCase a string
13
- * @param str
14
- */
15
- export declare function camelCase(str: string): string;
16
- /**
17
- * Stripe html tags from a string
18
- * @param str
19
- */
20
- export declare function stripHtml(str: string): string;
21
- //# sourceMappingURL=string.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../../../../react-core/src/utils/string.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,KAAA,WAEzB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO9C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiB7C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Utility Url Replacer
3
- * @param path
4
- */
5
- export declare const urlReplacer: (path: string) => (params: object) => any;
6
- /**
7
- * Get domain
8
- * @param url
9
- */
10
- export declare const getDomain: (url: string) => string;
11
- /**
12
- * Check a str is a valid url pattern
13
- * @param url
14
- */
15
- export declare const isValidUrl: (url: string) => boolean;
16
- /**
17
- * Check a str is a valid list of urls separated by delimiter
18
- * @param value
19
- * @param delimiter
20
- */
21
- export declare const isValidUrls: (value: string, delimiter: string) => boolean;
22
- //# sourceMappingURL=url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../../../react-core/src/utils/url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,cAWtB,MAAM,QACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,MAOvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,OAGxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,MAAM,aAAa,MAAM,KAAG,OAG9D,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Take the application server's public key, which is Base64 URL-safe encoded,
3
- * and convert it to a UInt8Array, because this is the expected input of the subscribe()
4
- */
5
- export declare const urlB64ToUint8Array: (base64String: any) => Uint8Array;
6
- /**
7
- * Get browser version to track on backend
8
- * @return {{name: string, version: null}|{name: string, version: string}|{name: *, version: *}|{name: string, version}}
9
- */
10
- export declare const loadVersionBrowser: () => {
11
- name: any;
12
- version: any;
13
- };
14
- //# sourceMappingURL=webPushMessaging.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webPushMessaging.d.ts","sourceRoot":"","sources":["../../../../../../react-core/src/utils/webPushMessaging.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,mCAW9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;CAgE9B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../../../react-core/src/utils/websocket.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC;IAEvB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,GAAG,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,KAAA,KAAK,GAAG,CAAC;IAE/B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,WAAW,EAAE,CAAC,OAAO,KAAA,KAAK,IAAI,CAAC;IAE/B;;OAEG;IACH,QAAQ,EAAE,MAAM,MAAM,CAAC;IAEvB;;OAEG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC;IAE5B;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC;IAE3B;;OAEG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;IAExB;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,YAAY;IACnD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC;IACb,OAAO,CAAC,GAAG,CAAC;IACZ,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,iBAAiB,CAAK;IAE9B;;;OAGG;gBACS,GAAG,EAAE,iBAAiB;IAQlC;;OAEG;WACW,WAAW,CAAC,GAAG,KAAA,GAAG,QAAQ;IAKxC;;OAEG;IACH,OAAO;IAyBP;;;OAGG;IACH,cAAc,CAAC,GAAG,EAAE,iBAAiB;IAqCrC;;;OAGG;IACH,cAAc;IAQd;;;OAGG;IACH,SAAS;IAKT;;;OAGG;IACH,aAAa;IAeb;;;OAGG;IACH,MAAM;IAUN;;;OAGG;IACH,OAAO,CAAC,GAAG,KAAA;IAMX;;;OAGG;IACH,OAAO,CAAC,GAAG,KAAA;IAKX;;;;;OAKG;IACH,SAAS,CAAC,GAAG,KAAA;IASb;;;;OAIG;IACH,eAAe,CAAC,CAAC,KAAA;IAUjB;;;OAGG;IACI,WAAW,CAAC,OAAO,KAAA;IAI1B;;OAEG;IACI,QAAQ;IAIf;;OAEG;IACI,YAAY;IAInB;;OAEG;IACI,WAAW;IAIlB;;OAEG;IACI,SAAS;IAIhB;;OAEG;IACI,QAAQ;IAIf;;OAEG;IACI,KAAK;CAQb"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Append params
3
- * @param baseUrl
4
- * @param queryParams
5
- */
6
- export declare function appendURLSearchParams(baseUrl: string, queryParams: Record<string, string | number>[]): string;
7
- //# sourceMappingURL=url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../../src/utils/url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,UAWpG"}
File without changes
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.copyTextToClipboard = copyTextToClipboard;
5
- exports.fallbackCopyTextToClipboard = fallbackCopyTextToClipboard;
6
- exports.random = random;
7
- exports.stripHtml = stripHtml;
8
-
9
- function stripHtml(str) {
10
- return str.replace(/<[^>]*>?/gm, '').trim();
11
- }
12
-
13
- function random() {
14
- return (Math.random() + 1).toString(36).substring(7);
15
- }
16
- /**
17
- * Fallback if navigator.clipboard doensn't exist
18
- * @param text
19
- * @returns {Promise<void>}
20
- */
21
-
22
-
23
- function fallbackCopyTextToClipboard(text) {
24
- let textArea = document.createElement('textarea');
25
- textArea.value = text; // Avoid scrolling to bottom
26
-
27
- textArea.style.top = '0';
28
- textArea.style.left = '0';
29
- textArea.style.position = 'fixed';
30
- document.body.appendChild(textArea);
31
- textArea.focus();
32
- textArea.select();
33
-
34
- try {
35
- let successful = document.execCommand('copy');
36
- document.body.removeChild(textArea);
37
- return Promise.success();
38
- } catch (err) {
39
- document.body.removeChild(textArea);
40
- return Promise.reject(err);
41
- }
42
- }
43
- /**
44
- * Copy text to clipboard
45
- * @param text
46
- * @returns {Promise<void>}
47
- *
48
- * Ex.
49
- * copyTextToClipboard(text).then(
50
- * function () {
51
- * console.log('Async: Copying to clipboard was successful!');
52
- * },
53
- * function (err) {
54
- * console.error('Async: Could not copy text: ', err);
55
- * });
56
- */
57
-
58
-
59
- function copyTextToClipboard(text) {
60
- if (!navigator.clipboard) {
61
- return fallbackCopyTextToClipboard(text);
62
- }
63
-
64
- return navigator.clipboard.writeText(text);
65
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.appendURLSearchParams = appendURLSearchParams;
5
-
6
- /**
7
- * Append params
8
- * @param baseUrl
9
- * @param queryParams
10
- */
11
- function appendURLSearchParams(baseUrl, queryParams) {
12
- let _url = baseUrl;
13
-
14
- if (queryParams.length && _url) {
15
- const key = Object.keys(queryParams[0])[0];
16
- _url += (_url.split('?')[1] ? '&' : '?') + `${key}=${queryParams[0][key]}`;
17
- queryParams.slice(1).map(p => {
18
- const key = Object.keys(p)[0];
19
- _url += `&${key}=${p[key]}`;
20
- });
21
- }
22
-
23
- return _url;
24
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.getHighestSafeWindowContext = getHighestSafeWindowContext;
5
- exports.getWindowHeight = getWindowHeight;
6
- exports.getWindowWidth = getWindowWidth;
7
-
8
- function getWindowWidth() {
9
- return typeof global.window !== 'undefined' ? global.window.innerWidth : 0;
10
- }
11
-
12
- function getWindowHeight() {
13
- return typeof global.window !== 'undefined' ? global.window.innerHeight : 0;
14
- }
15
-
16
- const isCrossOriginFrame = () => {
17
- try {
18
- return global.window.location.hostname !== global.window.parent.location.hostname;
19
- } catch (e) {
20
- return true;
21
- }
22
- }; // Get the highest window context that isn't cross-origin
23
- // (When in an iframe)
24
-
25
-
26
- function getHighestSafeWindowContext(self = global.window.self) {
27
- // If we reached the top level, return self
28
- if (self === global.window.top) {
29
- return self;
30
- } // If parent is the same origin, we can move up one context
31
- // Reference: https://stackoverflow.com/a/21965342/1601953
32
-
33
-
34
- if (!isCrossOriginFrame()) {
35
- return getHighestSafeWindowContext(self.parent);
36
- } // If a different origin, we consider the current level
37
- // as the top reachable one
38
-
39
-
40
- return self;
41
- }