@edx/frontend-platform 4.6.2 → 4.6.3

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 (229) hide show
  1. package/package.json +1 -1
  2. package/.env.development +0 -30
  3. package/.env.test +0 -30
  4. package/.eslintignore +0 -6
  5. package/.eslintrc.js +0 -28
  6. package/.github/PULL_REQUEST_TEMPLATE.md +0 -13
  7. package/.github/workflows/add-depr-ticket-to-depr-board.yml +0 -19
  8. package/.github/workflows/add-remove-label-on-comment.yml +0 -20
  9. package/.github/workflows/ci.yml +0 -42
  10. package/.github/workflows/commitlint.yml +0 -10
  11. package/.github/workflows/lockfileversion-check.yml +0 -13
  12. package/.github/workflows/manual-publish.yml +0 -43
  13. package/.github/workflows/npm-deprecate.yml +0 -22
  14. package/.github/workflows/release.yml +0 -45
  15. package/.github/workflows/self-assign-issue.yml +0 -12
  16. package/.github/workflows/update-browserslist-db.yml +0 -12
  17. package/.nvmrc +0 -1
  18. package/.releaserc +0 -32
  19. package/catalog-info.yaml +0 -21
  20. package/dist/LICENSE +0 -661
  21. package/dist/README.md +0 -155
  22. package/dist/package.json +0 -86
  23. package/docs/addTagsPlugin.js +0 -10
  24. package/docs/auth-API.md +0 -114
  25. package/docs/decisions/0001-record-architecture-decisions.rst +0 -32
  26. package/docs/decisions/0002-frontend-base-design-goals.rst +0 -222
  27. package/docs/decisions/0003-consolidation-into-frontend-platform.rst +0 -71
  28. package/docs/decisions/0004-axios-caching-implementation.rst +0 -88
  29. package/docs/decisions/0005-token-null-after-successful-refresh.rst +0 -69
  30. package/docs/decisions/0006-middleware-support-for-http-clients.rst +0 -44
  31. package/docs/decisions/0007-javascript-file-configuration.rst +0 -143
  32. package/docs/how_tos/automatic-case-conversion.rst +0 -58
  33. package/docs/how_tos/caching.rst +0 -93
  34. package/docs/how_tos/i18n.rst +0 -305
  35. package/docs/removeExport.js +0 -24
  36. package/docs/template/edx/README.md +0 -12
  37. package/docs/template/edx/publish.js +0 -713
  38. package/docs/template/edx/static/fonts/OpenSans-Bold-webfont.eot +0 -0
  39. package/docs/template/edx/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
  40. package/docs/template/edx/static/fonts/OpenSans-Bold-webfont.woff +0 -0
  41. package/docs/template/edx/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  42. package/docs/template/edx/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  43. package/docs/template/edx/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  44. package/docs/template/edx/static/fonts/OpenSans-Italic-webfont.eot +0 -0
  45. package/docs/template/edx/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
  46. package/docs/template/edx/static/fonts/OpenSans-Italic-webfont.woff +0 -0
  47. package/docs/template/edx/static/fonts/OpenSans-Light-webfont.eot +0 -0
  48. package/docs/template/edx/static/fonts/OpenSans-Light-webfont.svg +0 -1831
  49. package/docs/template/edx/static/fonts/OpenSans-Light-webfont.woff +0 -0
  50. package/docs/template/edx/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  51. package/docs/template/edx/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  52. package/docs/template/edx/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  53. package/docs/template/edx/static/fonts/OpenSans-Regular-webfont.eot +0 -0
  54. package/docs/template/edx/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
  55. package/docs/template/edx/static/fonts/OpenSans-Regular-webfont.woff +0 -0
  56. package/docs/template/edx/static/scripts/linenumber.js +0 -25
  57. package/docs/template/edx/static/scripts/prettify/Apache-License-2.0.txt +0 -202
  58. package/docs/template/edx/static/scripts/prettify/lang-css.js +0 -2
  59. package/docs/template/edx/static/scripts/prettify/prettify.js +0 -28
  60. package/docs/template/edx/static/styles/jsdoc-default.css +0 -356
  61. package/docs/template/edx/static/styles/prettify-jsdoc.css +0 -111
  62. package/docs/template/edx/static/styles/prettify-tomorrow.css +0 -132
  63. package/docs/template/edx/tmpl/augments.tmpl +0 -10
  64. package/docs/template/edx/tmpl/container.tmpl +0 -196
  65. package/docs/template/edx/tmpl/details.tmpl +0 -143
  66. package/docs/template/edx/tmpl/example.tmpl +0 -2
  67. package/docs/template/edx/tmpl/examples.tmpl +0 -13
  68. package/docs/template/edx/tmpl/exceptions.tmpl +0 -32
  69. package/docs/template/edx/tmpl/layout.tmpl +0 -39
  70. package/docs/template/edx/tmpl/mainpage.tmpl +0 -10
  71. package/docs/template/edx/tmpl/members.tmpl +0 -38
  72. package/docs/template/edx/tmpl/method.tmpl +0 -131
  73. package/docs/template/edx/tmpl/modifies.tmpl +0 -14
  74. package/docs/template/edx/tmpl/params.tmpl +0 -131
  75. package/docs/template/edx/tmpl/properties.tmpl +0 -108
  76. package/docs/template/edx/tmpl/returns.tmpl +0 -19
  77. package/docs/template/edx/tmpl/source.tmpl +0 -8
  78. package/docs/template/edx/tmpl/tutorial.tmpl +0 -19
  79. package/docs/template/edx/tmpl/type.tmpl +0 -7
  80. package/env.config.js +0 -8
  81. package/jsdoc.json +0 -36
  82. package/openedx.yaml +0 -12
  83. package/service-interface.png +0 -0
  84. package/src/analytics/MockAnalyticsService.js +0 -71
  85. package/src/analytics/SegmentAnalyticsService.js +0 -243
  86. package/src/analytics/index.js +0 -12
  87. package/src/analytics/interface.js +0 -142
  88. package/src/auth/AxiosCsrfTokenService.js +0 -60
  89. package/src/auth/AxiosJwtAuthService.js +0 -364
  90. package/src/auth/AxiosJwtTokenService.js +0 -134
  91. package/src/auth/LocalForageCache.js +0 -78
  92. package/src/auth/MockAuthService.js +0 -285
  93. package/src/auth/index.js +0 -19
  94. package/src/auth/interceptors/createCsrfTokenProviderInterceptor.js +0 -37
  95. package/src/auth/interceptors/createJwtTokenProviderInterceptor.js +0 -38
  96. package/src/auth/interceptors/createProcessAxiosRequestErrorInterceptor.js +0 -20
  97. package/src/auth/interceptors/createRetryInterceptor.js +0 -72
  98. package/src/auth/interface.js +0 -309
  99. package/src/auth/utils.js +0 -105
  100. package/src/config.js +0 -327
  101. package/src/constants.js +0 -66
  102. package/src/i18n/countries.js +0 -57
  103. package/src/i18n/index.js +0 -123
  104. package/src/i18n/injectIntlWithShim.jsx +0 -45
  105. package/src/i18n/languages.js +0 -60
  106. package/src/i18n/lib.js +0 -282
  107. package/src/i18n/scripts/README.md +0 -29
  108. package/src/i18n/scripts/intl-imports.js +0 -259
  109. package/src/i18n/scripts/transifex-utils.js +0 -75
  110. package/src/index.js +0 -42
  111. package/src/initialize.js +0 -357
  112. package/src/logging/MockLoggingService.js +0 -31
  113. package/src/logging/NewRelicLoggingService.js +0 -181
  114. package/src/logging/index.js +0 -9
  115. package/src/logging/interface.js +0 -110
  116. package/src/pubSub.js +0 -47
  117. package/src/react/AppContext.jsx +0 -24
  118. package/src/react/AppProvider.jsx +0 -93
  119. package/src/react/AuthenticatedPageRoute.jsx +0 -60
  120. package/src/react/ErrorBoundary.jsx +0 -44
  121. package/src/react/ErrorPage.jsx +0 -76
  122. package/src/react/LoginRedirect.jsx +0 -16
  123. package/src/react/OptionalReduxProvider.jsx +0 -28
  124. package/src/react/PageRoute.jsx +0 -31
  125. package/src/react/hooks.js +0 -50
  126. package/src/react/index.js +0 -16
  127. package/src/scripts/GoogleAnalyticsLoader.js +0 -53
  128. package/src/scripts/index.js +0 -2
  129. package/src/testing/index.js +0 -9
  130. package/src/testing/initializeMockApp.js +0 -77
  131. package/src/testing/mockMessages.js +0 -21
  132. package/src/utils.js +0 -167
  133. /package/{dist/analytics → analytics}/MockAnalyticsService.js +0 -0
  134. /package/{dist/analytics → analytics}/MockAnalyticsService.js.map +0 -0
  135. /package/{dist/analytics → analytics}/SegmentAnalyticsService.js +0 -0
  136. /package/{dist/analytics → analytics}/SegmentAnalyticsService.js.map +0 -0
  137. /package/{dist/analytics → analytics}/index.js +0 -0
  138. /package/{dist/analytics → analytics}/index.js.map +0 -0
  139. /package/{dist/analytics → analytics}/interface.js +0 -0
  140. /package/{dist/analytics → analytics}/interface.js.map +0 -0
  141. /package/{dist/auth → auth}/AxiosCsrfTokenService.js +0 -0
  142. /package/{dist/auth → auth}/AxiosCsrfTokenService.js.map +0 -0
  143. /package/{dist/auth → auth}/AxiosJwtAuthService.js +0 -0
  144. /package/{dist/auth → auth}/AxiosJwtAuthService.js.map +0 -0
  145. /package/{dist/auth → auth}/AxiosJwtTokenService.js +0 -0
  146. /package/{dist/auth → auth}/AxiosJwtTokenService.js.map +0 -0
  147. /package/{dist/auth → auth}/LocalForageCache.js +0 -0
  148. /package/{dist/auth → auth}/LocalForageCache.js.map +0 -0
  149. /package/{dist/auth → auth}/MockAuthService.js +0 -0
  150. /package/{dist/auth → auth}/MockAuthService.js.map +0 -0
  151. /package/{dist/auth → auth}/index.js +0 -0
  152. /package/{dist/auth → auth}/index.js.map +0 -0
  153. /package/{dist/auth → auth}/interceptors/createCsrfTokenProviderInterceptor.js +0 -0
  154. /package/{dist/auth → auth}/interceptors/createCsrfTokenProviderInterceptor.js.map +0 -0
  155. /package/{dist/auth → auth}/interceptors/createJwtTokenProviderInterceptor.js +0 -0
  156. /package/{dist/auth → auth}/interceptors/createJwtTokenProviderInterceptor.js.map +0 -0
  157. /package/{dist/auth → auth}/interceptors/createProcessAxiosRequestErrorInterceptor.js +0 -0
  158. /package/{dist/auth → auth}/interceptors/createProcessAxiosRequestErrorInterceptor.js.map +0 -0
  159. /package/{dist/auth → auth}/interceptors/createRetryInterceptor.js +0 -0
  160. /package/{dist/auth → auth}/interceptors/createRetryInterceptor.js.map +0 -0
  161. /package/{dist/auth → auth}/interface.js +0 -0
  162. /package/{dist/auth → auth}/interface.js.map +0 -0
  163. /package/{dist/auth → auth}/utils.js +0 -0
  164. /package/{dist/auth → auth}/utils.js.map +0 -0
  165. /package/{dist/config.js → config.js} +0 -0
  166. /package/{dist/config.js.map → config.js.map} +0 -0
  167. /package/{dist/constants.js → constants.js} +0 -0
  168. /package/{dist/constants.js.map → constants.js.map} +0 -0
  169. /package/{dist/i18n → i18n}/countries.js +0 -0
  170. /package/{dist/i18n → i18n}/countries.js.map +0 -0
  171. /package/{dist/i18n → i18n}/index.js +0 -0
  172. /package/{dist/i18n → i18n}/index.js.map +0 -0
  173. /package/{dist/i18n → i18n}/injectIntlWithShim.js +0 -0
  174. /package/{dist/i18n → i18n}/injectIntlWithShim.js.map +0 -0
  175. /package/{dist/i18n → i18n}/languages.js +0 -0
  176. /package/{dist/i18n → i18n}/languages.js.map +0 -0
  177. /package/{dist/i18n → i18n}/lib.js +0 -0
  178. /package/{dist/i18n → i18n}/lib.js.map +0 -0
  179. /package/{dist/i18n → i18n}/scripts/README.md +0 -0
  180. /package/{dist/i18n → i18n}/scripts/intl-imports.js +0 -0
  181. /package/{dist/i18n → i18n}/scripts/intl-imports.js.map +0 -0
  182. /package/{dist/i18n → i18n}/scripts/transifex-utils.js +0 -0
  183. /package/{dist/i18n → i18n}/scripts/transifex-utils.js.map +0 -0
  184. /package/{dist/index.js → index.js} +0 -0
  185. /package/{dist/index.js.map → index.js.map} +0 -0
  186. /package/{dist/initialize.js → initialize.js} +0 -0
  187. /package/{dist/initialize.js.map → initialize.js.map} +0 -0
  188. /package/{dist/logging → logging}/MockLoggingService.js +0 -0
  189. /package/{dist/logging → logging}/MockLoggingService.js.map +0 -0
  190. /package/{dist/logging → logging}/NewRelicLoggingService.js +0 -0
  191. /package/{dist/logging → logging}/NewRelicLoggingService.js.map +0 -0
  192. /package/{dist/logging → logging}/index.js +0 -0
  193. /package/{dist/logging → logging}/index.js.map +0 -0
  194. /package/{dist/logging → logging}/interface.js +0 -0
  195. /package/{dist/logging → logging}/interface.js.map +0 -0
  196. /package/{dist/pubSub.js → pubSub.js} +0 -0
  197. /package/{dist/pubSub.js.map → pubSub.js.map} +0 -0
  198. /package/{dist/react → react}/AppContext.js +0 -0
  199. /package/{dist/react → react}/AppContext.js.map +0 -0
  200. /package/{dist/react → react}/AppProvider.js +0 -0
  201. /package/{dist/react → react}/AppProvider.js.map +0 -0
  202. /package/{dist/react → react}/AuthenticatedPageRoute.js +0 -0
  203. /package/{dist/react → react}/AuthenticatedPageRoute.js.map +0 -0
  204. /package/{dist/react → react}/ErrorBoundary.js +0 -0
  205. /package/{dist/react → react}/ErrorBoundary.js.map +0 -0
  206. /package/{dist/react → react}/ErrorPage.js +0 -0
  207. /package/{dist/react → react}/ErrorPage.js.map +0 -0
  208. /package/{dist/react → react}/LoginRedirect.js +0 -0
  209. /package/{dist/react → react}/LoginRedirect.js.map +0 -0
  210. /package/{dist/react → react}/OptionalReduxProvider.js +0 -0
  211. /package/{dist/react → react}/OptionalReduxProvider.js.map +0 -0
  212. /package/{dist/react → react}/PageRoute.js +0 -0
  213. /package/{dist/react → react}/PageRoute.js.map +0 -0
  214. /package/{dist/react → react}/hooks.js +0 -0
  215. /package/{dist/react → react}/hooks.js.map +0 -0
  216. /package/{dist/react → react}/index.js +0 -0
  217. /package/{dist/react → react}/index.js.map +0 -0
  218. /package/{dist/scripts → scripts}/GoogleAnalyticsLoader.js +0 -0
  219. /package/{dist/scripts → scripts}/GoogleAnalyticsLoader.js.map +0 -0
  220. /package/{dist/scripts → scripts}/index.js +0 -0
  221. /package/{dist/scripts → scripts}/index.js.map +0 -0
  222. /package/{dist/testing → testing}/index.js +0 -0
  223. /package/{dist/testing → testing}/index.js.map +0 -0
  224. /package/{dist/testing → testing}/initializeMockApp.js +0 -0
  225. /package/{dist/testing → testing}/initializeMockApp.js.map +0 -0
  226. /package/{dist/testing → testing}/mockMessages.js +0 -0
  227. /package/{dist/testing → testing}/mockMessages.js.map +0 -0
  228. /package/{dist/utils.js → utils.js} +0 -0
  229. /package/{dist/utils.js.map → utils.js.map} +0 -0
@@ -1,38 +0,0 @@
1
- <?js
2
- var data = obj;
3
- var self = this;
4
- ?>
5
- <h4 class="name" id="<?js= id ?>"><?js= data.attribs + name + (data.signature ? data.signature : '') ?></h4>
6
-
7
- <?js if (data.summary) { ?>
8
- <p class="summary"><?js= summary ?></p>
9
- <?js } ?>
10
-
11
- <?js if (data.description) { ?>
12
- <div class="description">
13
- <?js= data.description ?>
14
- </div>
15
- <?js } ?>
16
-
17
- <?js if (data.type && data.type.names) {?>
18
- <h5>Type:</h5>
19
- <ul>
20
- <li>
21
- <?js= self.partial('type.tmpl', data.type.names) ?>
22
- </li>
23
- </ul>
24
- <?js } ?>
25
-
26
- <?js= this.partial('details.tmpl', data) ?>
27
-
28
- <?js if (data.fires && fires.length) { ?>
29
- <h5>Fires:</h5>
30
- <ul><?js fires.forEach(function(f) { ?>
31
- <li><?js= self.linkto(f) ?></li>
32
- <?js }); ?></ul>
33
- <?js } ?>
34
-
35
- <?js if (data.examples && examples.length) { ?>
36
- <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
37
- <?js= this.partial('examples.tmpl', examples) ?>
38
- <?js } ?>
@@ -1,131 +0,0 @@
1
- <?js
2
- var data = obj;
3
- var self = this;
4
- ?>
5
- <?js if (data.kind !== 'module' && !data.hideconstructor) { ?>
6
- <?js if (data.kind === 'class' && data.classdesc) { ?>
7
- <h2>Constructor</h2>
8
- <?js } ?>
9
-
10
- <?js if (data.kind !== 'namespace') { ?>
11
- <h4 class="name" id="<?js= id ?>"><?js= data.attribs + (kind === 'class' ? 'new ' : '') +
12
- name + (data.signature || '') ?></h4>
13
- <?js } ?>
14
-
15
- <?js if (data.summary) { ?>
16
- <p class="summary"><?js= summary ?></p>
17
- <?js } ?>
18
- <?js } ?>
19
-
20
- <?js if (data.kind !== 'module' && data.description && !data.hideconstructor) { ?>
21
- <div class="description">
22
- <?js= data.description ?>
23
- </div>
24
- <?js } ?>
25
-
26
- <?js if (data.augments && data.alias && data.alias.indexOf('module:') === 0) { ?>
27
- <h5>Extends:</h5>
28
- <?js= self.partial('augments.tmpl', data) ?>
29
- <?js } ?>
30
-
31
- <?js if (kind === 'event' && data.type && data.type.names) {?>
32
- <h5>Type:</h5>
33
- <ul>
34
- <li>
35
- <?js= self.partial('type.tmpl', data.type.names) ?>
36
- </li>
37
- </ul>
38
- <?js } ?>
39
-
40
- <?js if (data['this']) { ?>
41
- <h5>This:</h5>
42
- <ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
43
- <?js } ?>
44
-
45
- <?js if (data.params && params.length && !data.hideconstructor) { ?>
46
- <h5>Parameters:</h5>
47
- <?js= this.partial('params.tmpl', params) ?>
48
- <?js } ?>
49
-
50
- <?js= this.partial('details.tmpl', data) ?>
51
-
52
- <?js if (data.kind !== 'module' && data.requires && data.requires.length) { ?>
53
- <h5>Requires:</h5>
54
- <ul><?js data.requires.forEach(function(r) { ?>
55
- <li><?js= self.linkto(r) ?></li>
56
- <?js }); ?></ul>
57
- <?js } ?>
58
-
59
- <?js if (data.fires && fires.length) { ?>
60
- <h5>Fires:</h5>
61
- <ul><?js fires.forEach(function(f) { ?>
62
- <li><?js= self.linkto(f) ?></li>
63
- <?js }); ?></ul>
64
- <?js } ?>
65
-
66
- <?js if (data.listens && listens.length) { ?>
67
- <h5>Listens to Events:</h5>
68
- <ul><?js listens.forEach(function(f) { ?>
69
- <li><?js= self.linkto(f) ?></li>
70
- <?js }); ?></ul>
71
- <?js } ?>
72
-
73
- <?js if (data.listeners && listeners.length) { ?>
74
- <h5>Listeners of This Event:</h5>
75
- <ul><?js listeners.forEach(function(f) { ?>
76
- <li><?js= self.linkto(f) ?></li>
77
- <?js }); ?></ul>
78
- <?js } ?>
79
-
80
- <?js if (data.modifies && modifies.length) {?>
81
- <h5>Modifies:</h5>
82
- <?js if (modifies.length > 1) { ?><ul><?js
83
- modifies.forEach(function(m) { ?>
84
- <li><?js= self.partial('modifies.tmpl', m) ?></li>
85
- <?js });
86
- ?></ul><?js } else {
87
- modifies.forEach(function(m) { ?>
88
- <?js= self.partial('modifies.tmpl', m) ?>
89
- <?js });
90
- } } ?>
91
-
92
- <?js if (data.exceptions && exceptions.length) { ?>
93
- <h5>Throws:</h5>
94
- <?js if (exceptions.length > 1) { ?><ul><?js
95
- exceptions.forEach(function(r) { ?>
96
- <li><?js= self.partial('exceptions.tmpl', r) ?></li>
97
- <?js });
98
- ?></ul><?js } else {
99
- exceptions.forEach(function(r) { ?>
100
- <?js= self.partial('exceptions.tmpl', r) ?>
101
- <?js });
102
- } } ?>
103
-
104
- <?js if (data.returns && returns.length) { ?>
105
- <h5>Returns:</h5>
106
- <?js if (returns.length > 1) { ?><ul><?js
107
- returns.forEach(function(r) { ?>
108
- <li><?js= self.partial('returns.tmpl', r) ?></li>
109
- <?js });
110
- ?></ul><?js } else {
111
- returns.forEach(function(r) { ?>
112
- <?js= self.partial('returns.tmpl', r) ?>
113
- <?js });
114
- } } ?>
115
-
116
- <?js if (data.yields && yields.length) { ?>
117
- <h5>Yields:</h5>
118
- <?js if (yields.length > 1) { ?><ul><?js
119
- yields.forEach(function(r) { ?>
120
- <li><?js= self.partial('returns.tmpl', r) ?></li>
121
- <?js });
122
- ?></ul><?js } else {
123
- yields.forEach(function(r) { ?>
124
- <?js= self.partial('returns.tmpl', r) ?>
125
- <?js });
126
- } } ?>
127
-
128
- <?js if (data.examples && examples.length) { ?>
129
- <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
130
- <?js= this.partial('examples.tmpl', examples) ?>
131
- <?js } ?>
@@ -1,14 +0,0 @@
1
- <?js
2
- var data = obj || {};
3
- ?>
4
-
5
- <?js if (data.type && data.type.names) {?>
6
- <dl>
7
- <dt>
8
- Type
9
- </dt>
10
- <dd>
11
- <?js= this.partial('type.tmpl', data.type.names) ?>
12
- </dd>
13
- </dl>
14
- <?js } ?>
@@ -1,131 +0,0 @@
1
- <?js
2
- var params = obj;
3
-
4
- /* sort subparams under their parent params (like opts.classname) */
5
- var parentParam = null;
6
- params.forEach(function(param, i) {
7
- var paramRegExp;
8
-
9
- if (!param) {
10
- return;
11
- }
12
-
13
- if (parentParam && parentParam.name && param.name) {
14
- try {
15
- paramRegExp = new RegExp('^(?:' + parentParam.name + '(?:\\[\\])*)\\.(.+)$');
16
- }
17
- catch (e) {
18
- // there's probably a typo in the JSDoc comment that resulted in a weird
19
- // parameter name
20
- return;
21
- }
22
-
23
- if ( paramRegExp.test(param.name) ) {
24
- param.name = RegExp.$1;
25
- parentParam.subparams = parentParam.subparams || [];
26
- parentParam.subparams.push(param);
27
- params[i] = null;
28
- }
29
- else {
30
- parentParam = param;
31
- }
32
- }
33
- else {
34
- parentParam = param;
35
- }
36
- });
37
-
38
- /* determine if we need extra columns, "attributes" and "default" */
39
- params.hasAttributes = false;
40
- params.hasDefault = false;
41
- params.hasName = false;
42
-
43
- params.forEach(function(param) {
44
- if (!param) { return; }
45
-
46
- if (param.optional || param.nullable || param.variable) {
47
- params.hasAttributes = true;
48
- }
49
-
50
- if (param.name) {
51
- params.hasName = true;
52
- }
53
-
54
- if (typeof param.defaultvalue !== 'undefined') {
55
- params.hasDefault = true;
56
- }
57
- });
58
- ?>
59
-
60
- <table class="params">
61
- <thead>
62
- <tr>
63
- <?js if (params.hasName) {?>
64
- <th>Name</th>
65
- <?js } ?>
66
-
67
- <th>Type</th>
68
-
69
- <?js if (params.hasAttributes) {?>
70
- <th>Attributes</th>
71
- <?js } ?>
72
-
73
- <?js if (params.hasDefault) {?>
74
- <th>Default</th>
75
- <?js } ?>
76
-
77
- <th class="last">Description</th>
78
- </tr>
79
- </thead>
80
-
81
- <tbody>
82
- <?js
83
- var self = this;
84
- params.forEach(function(param) {
85
- if (!param) { return; }
86
- ?>
87
-
88
- <tr>
89
- <?js if (params.hasName) {?>
90
- <td class="name"><code><?js= param.name ?></code></td>
91
- <?js } ?>
92
-
93
- <td class="type">
94
- <?js if (param.type && param.type.names) {?>
95
- <?js= self.partial('type.tmpl', param.type.names) ?>
96
- <?js } ?>
97
- </td>
98
-
99
- <?js if (params.hasAttributes) {?>
100
- <td class="attributes">
101
- <?js if (param.optional) { ?>
102
- &lt;optional><br>
103
- <?js } ?>
104
-
105
- <?js if (param.nullable) { ?>
106
- &lt;nullable><br>
107
- <?js } ?>
108
-
109
- <?js if (param.variable) { ?>
110
- &lt;repeatable><br>
111
- <?js } ?>
112
- </td>
113
- <?js } ?>
114
-
115
- <?js if (params.hasDefault) {?>
116
- <td class="default">
117
- <?js if (typeof param.defaultvalue !== 'undefined') { ?>
118
- <?js= self.htmlsafe(param.defaultvalue) ?>
119
- <?js } ?>
120
- </td>
121
- <?js } ?>
122
-
123
- <td class="description last"><?js= param.description ?><?js if (param.subparams) { ?>
124
- <h6>Properties</h6>
125
- <?js= self.partial('params.tmpl', param.subparams) ?>
126
- <?js } ?></td>
127
- </tr>
128
-
129
- <?js }); ?>
130
- </tbody>
131
- </table>
@@ -1,108 +0,0 @@
1
- <?js
2
- var data = obj;
3
- var props = data.subprops || data.properties;
4
-
5
- /* sort subprops under their parent props (like opts.classname) */
6
- var parentProp = null;
7
- props.forEach(function(prop, i) {
8
- if (!prop) { return; }
9
- if ( parentProp && prop.name && prop.name.indexOf(parentProp.name + '.') === 0 ) {
10
- prop.name = prop.name.substr(parentProp.name.length+1);
11
- parentProp.subprops = parentProp.subprops || [];
12
- parentProp.subprops.push(prop);
13
- props[i] = null;
14
- }
15
- else {
16
- parentProp = prop;
17
- }
18
- });
19
-
20
- /* determine if we need extra columns, "attributes" and "default" */
21
- props.hasAttributes = false;
22
- props.hasDefault = false;
23
- props.hasName = false;
24
-
25
- props.forEach(function(prop) {
26
- if (!prop) { return; }
27
-
28
- if (prop.optional || prop.nullable) {
29
- props.hasAttributes = true;
30
- }
31
-
32
- if (prop.name) {
33
- props.hasName = true;
34
- }
35
-
36
- if (typeof prop.defaultvalue !== 'undefined' && !data.isEnum) {
37
- props.hasDefault = true;
38
- }
39
- });
40
- ?>
41
-
42
- <table class="props">
43
- <thead>
44
- <tr>
45
- <?js if (props.hasName) {?>
46
- <th>Name</th>
47
- <?js } ?>
48
-
49
- <th>Type</th>
50
-
51
- <?js if (props.hasAttributes) {?>
52
- <th>Attributes</th>
53
- <?js } ?>
54
-
55
- <?js if (props.hasDefault) {?>
56
- <th>Default</th>
57
- <?js } ?>
58
-
59
- <th class="last">Description</th>
60
- </tr>
61
- </thead>
62
-
63
- <tbody>
64
- <?js
65
- var self = this;
66
- props.forEach(function(prop) {
67
- if (!prop) { return; }
68
- ?>
69
-
70
- <tr>
71
- <?js if (props.hasName) {?>
72
- <td class="name"><code><?js= prop.name ?></code></td>
73
- <?js } ?>
74
-
75
- <td class="type">
76
- <?js if (prop.type && prop.type.names) {?>
77
- <?js= self.partial('type.tmpl', prop.type.names) ?>
78
- <?js } ?>
79
- </td>
80
-
81
- <?js if (props.hasAttributes) {?>
82
- <td class="attributes">
83
- <?js if (prop.optional) { ?>
84
- &lt;optional><br>
85
- <?js } ?>
86
-
87
- <?js if (prop.nullable) { ?>
88
- &lt;nullable><br>
89
- <?js } ?>
90
- </td>
91
- <?js } ?>
92
-
93
- <?js if (props.hasDefault) {?>
94
- <td class="default">
95
- <?js if (typeof prop.defaultvalue !== 'undefined') { ?>
96
- <?js= self.htmlsafe(prop.defaultvalue) ?>
97
- <?js } ?>
98
- </td>
99
- <?js } ?>
100
-
101
- <td class="description last"><?js= prop.description ?><?js if (prop.subprops) { ?>
102
- <h6>Properties</h6><?js= self.partial('properties.tmpl', prop) ?>
103
- <?js } ?></td>
104
- </tr>
105
-
106
- <?js }); ?>
107
- </tbody>
108
- </table>
@@ -1,19 +0,0 @@
1
- <?js
2
- var data = obj || {};
3
- if (data.description) {
4
- ?>
5
- <div class="param-desc">
6
- <?js= description ?>
7
- </div>
8
- <?js } ?>
9
-
10
- <?js if (data.type && data.type.names) {?>
11
- <dl>
12
- <dt>
13
- Type
14
- </dt>
15
- <dd>
16
- <?js= this.partial('type.tmpl', data.type.names) ?>
17
- </dd>
18
- </dl>
19
- <?js } ?>
@@ -1,8 +0,0 @@
1
- <?js
2
- var data = obj;
3
- ?>
4
- <section>
5
- <article>
6
- <pre class="prettyprint source linenums"><code><?js= data.code ?></code></pre>
7
- </article>
8
- </section>
@@ -1,19 +0,0 @@
1
- <section>
2
-
3
- <header>
4
- <?js if (children.length > 0) { ?>
5
- <ul><?js
6
- var self = this;
7
- children.forEach(function(t) { ?>
8
- <li><?js= self.tutoriallink(t.name) ?></li>
9
- <?js }); ?></ul>
10
- <?js } ?>
11
-
12
- <h2><?js= header ?></h2>
13
- </header>
14
-
15
- <article>
16
- <?js= content ?>
17
- </article>
18
-
19
- </section>
@@ -1,7 +0,0 @@
1
- <?js
2
- var data = obj;
3
- var self = this;
4
- data.forEach(function(name, i) { ?>
5
- <span class="param-type"><?js= self.linkto(name, self.htmlsafe(name)) ?></span>
6
- <?js if (i < data.length-1) { ?>|<?js } ?>
7
- <?js }); ?>
package/env.config.js DELETED
@@ -1,8 +0,0 @@
1
- // NOTE: This file is used by the example app. frontend-build expects the file
2
- // to be in the root of the repository. This is not used by the actual frontend-platform library.
3
- // Also note that in an actual application this file would be added to .gitignore.
4
- const config = {
5
- JS_FILE_VAR: 'JS_FILE_VAR_VALUE_FOR_EXAMPLE_APP',
6
- };
7
-
8
- export default config;
package/jsdoc.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "tags": {
3
- "allowUnknownTags": true,
4
- "dictionaries": ["jsdoc"]
5
- },
6
- "source": {
7
- "include": ["src", "package.json", "README.md"],
8
- "includePattern": ".+\\.js(doc|x)?$",
9
- "excludePattern": "(node_modules/|docs)"
10
- },
11
- "plugins": [
12
- "plugins/markdown",
13
- "docs/addTagsPlugin",
14
- "docs/removeExport"
15
- ],
16
- "templates": {
17
- "cleverLinks": false,
18
- "monospaceLinks": true,
19
- "useLongnameInNav": false,
20
- "showInheritedInNav": true,
21
- "default": {
22
- "staticFiles": {
23
- "include": [
24
- "./service-interface.png"
25
- ]
26
- }
27
- }
28
- },
29
- "opts": {
30
- "destination": "./docs/api",
31
- "encoding": "utf8",
32
- "private": true,
33
- "recurse": true,
34
- "template": "docs/template/edx"
35
- }
36
- }
package/openedx.yaml DELETED
@@ -1,12 +0,0 @@
1
- # openedx.yaml
2
-
3
- ---
4
- owner: edx/fedx-team
5
- tags:
6
- - library
7
- - platform
8
- - react
9
- - i18n
10
- - analytics
11
- - logging
12
- - authentication
Binary file
@@ -1,71 +0,0 @@
1
- /**
2
- * The MockAnalyticsService implements all functions of AnalyticsService as Jest mocks (jest.fn())).
3
- * It emulates the behavior of a real analytics service but witohut making any requests. It has no
4
- * other functionality.
5
- *
6
- * @implements {AnalyticsService}
7
- * @memberof module:Analytics
8
- */
9
- class MockAnalyticsService {
10
- static hasIdentifyBeenCalled = false;
11
-
12
- constructor({ httpClient, loggingService }) {
13
- this.loggingService = loggingService;
14
- this.httpClient = httpClient;
15
- }
16
-
17
- checkIdentifyCalled = jest.fn(() => {
18
- if (!this.hasIdentifyBeenCalled) {
19
- this.loggingService.logError('Identify must be called before other tracking events.');
20
- }
21
- });
22
-
23
- /**
24
- * Returns a resolved promise.
25
- *
26
- * @returns {Promise} The promise returned by HttpClient.post.
27
- */
28
- sendTrackingLogEvent = jest.fn(() => Promise.resolve());
29
-
30
- /**
31
- * No-op, but records that identify has been called.
32
- *
33
- * @param {string} userId
34
- * @throws {Error} If userId argument is not supplied.
35
- */
36
- identifyAuthenticatedUser = jest.fn((userId) => {
37
- if (!userId) {
38
- throw new Error('UserId is required for identifyAuthenticatedUser.');
39
- }
40
- this.hasIdentifyBeenCalled = true;
41
- });
42
-
43
- /**
44
- * No-op, but records that it has been called to prevent double-identification.
45
- * @returns {Promise} A resolved promise.
46
- */
47
- identifyAnonymousUser = jest.fn(() => {
48
- this.hasIdentifyBeenCalled = true;
49
- return Promise.resolve();
50
- });
51
-
52
- /**
53
- * Logs the event to the console.
54
- *
55
- * Checks whether identify has been called, logging an error to the logging service if not.
56
- */
57
- sendTrackEvent = jest.fn(() => {
58
- this.checkIdentifyCalled();
59
- });
60
-
61
- /**
62
- * Logs the event to the console.
63
- *
64
- * Checks whether identify has been called, logging an error to the logging service if not.
65
- */
66
- sendPageEvent = jest.fn(() => {
67
- this.checkIdentifyCalled();
68
- });
69
- }
70
-
71
- export default MockAnalyticsService;