@ndla/ui 3.0.11 → 3.0.12

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.
package/es/index.js CHANGED
@@ -46,4 +46,5 @@ export { i18nInstance, formatNestedMessages, formatMessage } from './i18n';
46
46
  export { default as ResourceGroup } from './ResourceGroup';
47
47
  export { default as LayoutItem, OneColumn, PageContainer, Content } from './Layout';
48
48
  export { SubjectAbout, SubjectArchive, SubjectCarousel, SubjectChildContent, SubjectContent, SubjectFilter, SubjectFlexChild, SubjectFlexWrapper, SubjectHeader, SubjectLinks, SubjectNewContent, SubjectSecondaryContent, SubjectSectionTitle, SubjectShortcuts, SubjectSidebarWrapper, SubjectSocialContent, SubjectSocialSection, SubjectTopics, SubjectBanner } from './Subject';
49
- export { default as ContentCard } from './ContentCard';
49
+ export { default as ContentCard } from './ContentCard';
50
+ export { default as MatomoTracker } from './Matomo';
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ trackerUrl: string;
3
+ siteId: string;
4
+ }
5
+ export declare const MatomoTracker: ({ trackerUrl, siteId }: Props) => JSX.Element;
6
+ export default MatomoTracker;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = exports.MatomoTracker = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _core = require("@emotion/core");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ /*
15
+ * Copyright (c) 2021-present, NDLA.
16
+ *
17
+ * This source code is licensed under the GPLv3 license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ *
20
+ */
21
+ var MatomoTracker = function MatomoTracker(_ref) {
22
+ var trackerUrl = _ref.trackerUrl,
23
+ siteId = _ref.siteId;
24
+ return (0, _core.jsx)("script", {
25
+ dangerouslySetInnerHTML: {
26
+ __html: "\n var _paq = window._paq = window._paq || [];\n _paq.push(['trackPageView']);\n _paq.push(['enableLinkTracking']);\n (function() {\n var u=\"".concat(trackerUrl, "\";\n _paq.push(['setTrackerUrl', u+'matomo.php']);\n _paq.push(['setSiteId', '").concat(siteId, "']);\n var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];\n g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);\n })();")
27
+ }
28
+ });
29
+ };
30
+
31
+ exports.MatomoTracker = MatomoTracker;
32
+ var _default = MatomoTracker;
33
+ exports["default"] = _default;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) 2021-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import MatomoTracker from './MatomoTracker';
9
+ export default MatomoTracker;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _MatomoTracker = _interopRequireDefault(require("./MatomoTracker"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ /**
13
+ * Copyright (c) 2021-present, NDLA.
14
+ *
15
+ * This source code is licensed under the GPLv3 license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ *
18
+ */
19
+ var _default = _MatomoTracker["default"];
20
+ exports["default"] = _default;
@@ -1,8 +1,8 @@
1
- import { ReactChildren } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { ListItemProps } from './ListItem';
3
3
  declare type Props = {
4
4
  cards: ListItemProps[];
5
- children: ReactChildren;
5
+ children: ReactNode;
6
6
  totalCardCount: number;
7
7
  hideCards?: boolean;
8
8
  };