@financial-times/n-myft-ui 28.0.0 → 28.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- @import 'o-buttons/main';
1
+ @import '@financial-times/o-buttons/main';
2
2
 
3
3
  .n-myft-ui__button {
4
4
  @include oButtonsContent($opts: (
@@ -1,4 +1,4 @@
1
- import * as nNotification from 'n-notification/main';
1
+ import * as nNotification from '@financial-times/n-notification/main';
2
2
  import Delegate from 'ftdomdelegate';
3
3
  import myftClient from 'next-myft-client';
4
4
  import { $, $$ } from 'n-ui-foundations/main';
@@ -1,7 +1,7 @@
1
1
  import Delegate from 'ftdomdelegate';
2
2
  import myftApiClient from 'next-myft-client';
3
3
  import serialize from 'form-serialize';
4
- import Tooltip from 'o-tooltip';
4
+ import Tooltip from '@financial-times/o-tooltip';
5
5
 
6
6
  const delegate = new Delegate(document.body);
7
7
 
@@ -1,9 +1,8 @@
1
- import {isAfter, addMinutes} from './date-fns';
1
+ import { isAfter, addMinutes } from 'date-fns';
2
2
  import * as storage from './storage';
3
3
  const SESSION_THRESHOLD_MINUTES = 30;
4
4
 
5
5
  export default class DeviceSession {
6
-
7
6
  constructor () {
8
7
  this.expiry = storage.getDeviceSessionExpiry();
9
8
  const newExpiry = addMinutes(new Date(), SESSION_THRESHOLD_MINUTES);
@@ -17,5 +16,4 @@ export default class DeviceSession {
17
16
  return true;
18
17
  }
19
18
  }
20
-
21
19
  }
@@ -1,4 +1,4 @@
1
- import {startOfDay} from './date-fns';
1
+ import { startOfDay } from 'date-fns';
2
2
  import * as storage from './storage';
3
3
  import initialiseFeedStartTime from './initialise-feed-start-time';
4
4
  import sessionClient from 'next-session-client';
@@ -8,7 +8,7 @@ let userId;
8
8
 
9
9
  async function getValidSession () {
10
10
  if (!userId) {
11
- const {uuid} = await sessionClient.uuid();
11
+ const { uuid } = await sessionClient.uuid();
12
12
  if (!uuid) throw new Error('No userId');
13
13
  userId = uuid;
14
14
  }
@@ -24,7 +24,7 @@ export async function getNewArticlesSinceTime () {
24
24
  if (!initialFeedStartTime && storage.isAvailable()) {
25
25
  try {
26
26
  initialFeedStartTime = await initialiseFeedStartTime(user, new Date());
27
- } catch(e) {}
27
+ } catch (e) {}
28
28
  }
29
29
 
30
30
  return initialFeedStartTime || dayStart;
@@ -1,16 +1,18 @@
1
- import {isToday, startOfDay} from './date-fns';
1
+ import { isToday, startOfDay } from 'date-fns';
2
2
  import DeviceSession from './device-session';
3
3
  import * as storage from './storage';
4
- import {json as fetchJson} from 'fetchres';
4
+ import { json as fetchJson } from 'fetchres';
5
5
 
6
6
  const deviceSession = new DeviceSession();
7
7
 
8
8
  export const fetchUserLastVisitedAt = (userId) => {
9
- const url = '/__myft/users/:userId/last-seen?source=next-myft'
10
- .replace(':userId', userId);
11
- return fetch(url, {credentials: 'include'})
9
+ const url = '/__myft/users/:userId/last-seen?source=next-myft'.replace(
10
+ ':userId',
11
+ userId
12
+ );
13
+ return fetch(url, { credentials: 'include' })
12
14
  .then(fetchJson)
13
- .then(({lastSeen}) => new Date(lastSeen));
15
+ .then(({ lastSeen }) => new Date(lastSeen));
14
16
  };
15
17
 
16
18
  /**
@@ -19,12 +21,18 @@ export const fetchUserLastVisitedAt = (userId) => {
19
21
  * @return {Promise<Date>} date when we now determine articles to be 'new' for the user
20
22
  */
21
23
  const determineFeedStartTime = (userId, now, previousFeedStartTime) => {
22
- if (previousFeedStartTime && isToday(previousFeedStartTime) && !deviceSession.isNewSession()) {
24
+ if (
25
+ previousFeedStartTime &&
26
+ isToday(previousFeedStartTime) &&
27
+ !deviceSession.isNewSession()
28
+ ) {
23
29
  return Promise.resolve(previousFeedStartTime);
24
30
  }
25
31
 
26
32
  return fetchUserLastVisitedAt(userId)
27
- .then(userLastVisitedAt => isToday(userLastVisitedAt) ? userLastVisitedAt : Promise.reject())
33
+ .then((userLastVisitedAt) =>
34
+ isToday(userLastVisitedAt) ? userLastVisitedAt : Promise.reject()
35
+ )
28
36
  .catch(() => startOfDay(now));
29
37
  };
30
38
 
@@ -33,12 +41,14 @@ const determineFeedStartTime = (userId, now, previousFeedStartTime) => {
33
41
  * @param {Date} now Date representing the time now
34
42
  */
35
43
  export default (userId, now) => {
36
- const previousFeedStartTime = (storage.isAvailable() && storage.getFeedStartTime());
37
- return determineFeedStartTime(userId, now, previousFeedStartTime)
38
- .then(startTime => {
44
+ const previousFeedStartTime =
45
+ storage.isAvailable() && storage.getFeedStartTime();
46
+ return determineFeedStartTime(userId, now, previousFeedStartTime).then(
47
+ (startTime) => {
39
48
  if (storage.isAvailable()) {
40
49
  storage.setFeedStartTime(startTime);
41
50
  }
42
51
  return startTime;
43
- });
52
+ }
53
+ );
44
54
  };
@@ -1,23 +1,26 @@
1
- import {isValid} from './date-fns';
1
+ import { isValid } from 'date-fns';
2
2
 
3
3
  const DEVICE_SESSION_EXPIRY = 'deviceSessionExpiry';
4
4
  const FEED_START_TIME = 'newArticlesSinceTime';
5
5
 
6
- const isISOString = str => typeof str === 'string' && str.charAt(10) === 'T';
7
- const getStoredDate = key => {
6
+ const isISOString = (str) => typeof str === 'string' && str.charAt(10) === 'T';
7
+ const getStoredDate = (key) => {
8
8
  const value = window.localStorage.getItem(key);
9
9
  const date = new Date(value);
10
10
 
11
11
  return isISOString(value) && isValid(date) ? date : null;
12
12
  };
13
13
 
14
- export const getDeviceSessionExpiry = () => getStoredDate(DEVICE_SESSION_EXPIRY);
14
+ export const getDeviceSessionExpiry = () =>
15
+ getStoredDate(DEVICE_SESSION_EXPIRY);
15
16
 
16
- export const setDeviceSessionExpiry = date => window.localStorage.setItem(DEVICE_SESSION_EXPIRY, date.toISOString());
17
+ export const setDeviceSessionExpiry = (date) =>
18
+ window.localStorage.setItem(DEVICE_SESSION_EXPIRY, date.toISOString());
17
19
 
18
20
  export const getFeedStartTime = () => getStoredDate(FEED_START_TIME);
19
21
 
20
- export const setFeedStartTime = date => window.localStorage.setItem(FEED_START_TIME, date.toISOString());
22
+ export const setFeedStartTime = (date) =>
23
+ window.localStorage.setItem(FEED_START_TIME, date.toISOString());
21
24
 
22
25
  export const isAvailable = () => {
23
26
  try {
@@ -26,8 +29,7 @@ export const isAvailable = () => {
26
29
  storage.setItem(x, x);
27
30
  storage.removeItem(x);
28
31
  return true;
29
- }
30
- catch(e) {
32
+ } catch (e) {
31
33
  return false;
32
34
  }
33
35
  };
package/karma.conf.js CHANGED
@@ -1,6 +1,5 @@
1
1
  // Karma configuration
2
2
  // Generated on Fri Apr 18 2014 18:19:03 GMT+0100 (BST)
3
- const BowerResolvePlugin = require('bower-resolve-webpack-plugin');
4
3
  module.exports = function (karma) {
5
4
 
6
5
 
@@ -41,9 +40,8 @@ module.exports = function (karma) {
41
40
  },
42
41
  webpack: {
43
42
  resolve: {
44
- plugins: [new BowerResolvePlugin()],
45
- modules: ['bower_components', 'node_modules'],
46
- descriptionFiles: ['bower.json', 'package.json'],
43
+ modules: ['node_modules'],
44
+ descriptionFiles: ['package.json'],
47
45
  mainFields: ['browser', 'main'],
48
46
  mainFiles: ['index', 'main'],
49
47
  extensions: ['.js', '.json']
package/myft/README.md CHANGED
@@ -40,7 +40,7 @@ If `isSaved=true` is specified then the button will start in the *saved* state,
40
40
 
41
41
  ## Releasing
42
42
 
43
- This is a bower module, to release update the git tag.
43
+ This is an NPM module, to release update the git tag.
44
44
 
45
45
  ## Testing
46
46
 
package/myft/main.scss CHANGED
@@ -1,15 +1,15 @@
1
- @import 'o-normalise/main';
2
- @import 'o-colors/main';
3
- @import 'o-grid/main';
4
- @import 'o-icons/main';
5
- @import 'o-buttons/main';
6
- @import 'o-editorial-typography/main';
7
- @import 'o-forms/main';
8
- @import 'o-overlay/main';
9
- @import 'o-spacing/main';
1
+ @import '@financial-times/o-normalise/main';
2
+ @import '@financial-times/o-colors/main';
3
+ @import '@financial-times/o-grid/main';
4
+ @import '@financial-times/o-icons/main';
5
+ @import '@financial-times/o-buttons/main';
6
+ @import '@financial-times/o-editorial-typography/main';
7
+ @import '@financial-times/o-forms/main';
8
+ @import '@financial-times/o-overlay/main';
9
+ @import '@financial-times/o-spacing/main';
10
10
 
11
11
  $n-notification-is-silent: false !default;
12
- @import 'n-notification/main';
12
+ @import '@financial-times/n-notification/main';
13
13
 
14
14
  @import './ui/myft-buttons/main';
15
15
  @import './ui/lists';
package/myft/ui/lists.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import myFtClient from 'next-myft-client';
2
2
  import Delegate from 'ftdomdelegate';
3
- import Overlay from 'o-overlay';
3
+ import Overlay from '@financial-times/o-overlay';
4
4
  import * as myFtUiButtonStates from './lib/button-states';
5
- import nNotification from 'n-notification';
5
+ import nNotification from '@financial-times/n-notification';
6
6
  import { uuid } from 'n-ui-foundations';
7
7
  import getToken from './lib/get-csrf-token';
8
- import oForms from 'o-forms';
8
+ import oForms from '@financial-times/o-forms';
9
9
  import openSaveArticleToListVariant from './save-article-to-list-variant';
10
10
 
11
11
  const delegate = new Delegate(document.body);
@@ -3,7 +3,7 @@ import * as tracking from '../lib/tracking';
3
3
  import * as loadedRelationships from '../lib/loaded-relationships';
4
4
  import relationshipConfig from '../lib/relationship-config';
5
5
  import setTokens from '../lib/set-tokens';
6
- import nNotification from 'n-notification';
6
+ import nNotification from '@financial-times/n-notification';
7
7
  import Delegate from 'ftdomdelegate';
8
8
  import personaliseLinks from '../personalise-links';
9
9
  import doFormSubmit from './do-form-submit';
@@ -1,4 +1,4 @@
1
- import Overlay from 'o-overlay';
1
+ import Overlay from '@financial-times/o-overlay';
2
2
  import myFtClient from 'next-myft-client';
3
3
  import { uuid } from 'n-ui-foundations';
4
4
  import getToken from './lib/get-csrf-token';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/n-myft-ui",
3
- "version": "28.0.0",
3
+ "version": "28.0.6",
4
4
  "description": "Client side component for interaction with myft",
5
5
  "main": "server.js",
6
6
  "scripts": {
@@ -21,7 +21,6 @@
21
21
  "homepage": "https://github.com/Financial-Times/n-myft-ui#readme",
22
22
  "devDependencies": {
23
23
  "@financial-times/dotcom-build-base": "^7.0.0",
24
- "@financial-times/dotcom-build-bower-resolve": "^2.6.2",
25
24
  "@financial-times/dotcom-build-code-splitting": "^5.0.0",
26
25
  "@financial-times/dotcom-build-js": "^5.0.0",
27
26
  "@financial-times/dotcom-build-sass": "^5.0.0",
@@ -37,13 +36,10 @@
37
36
  "babel-plugin-transform-async-to-generator": "^6.24.1",
38
37
  "babel-plugin-transform-es2015-classes": "^6.8.0",
39
38
  "babel-plugin-transform-es2015-modules-commonjs": "^6.5.2",
40
- "babel-plugin-transform-runtime": "^6.9.0",
39
+ "babel-plugin-transform-runtime": "^6.23.0",
41
40
  "babel-preset-env": "^1.7.0",
42
41
  "babel-preset-es2015": "^6.6.0",
43
42
  "babel-runtime": "^6.9.2",
44
- "bower": "^1.8.8",
45
- "bower-resolve-webpack-plugin": "^1.0.5",
46
- "bower-webpack-plugin": "^0.1.9",
47
43
  "brotli": "^1.3.1",
48
44
  "chai": "4.2.0",
49
45
  "chalk": "2.4.2",
@@ -89,11 +85,25 @@
89
85
  "webpack-cli": "^4.9.2"
90
86
  },
91
87
  "peerDependencies": {
88
+ "@financial-times/n-notification": "^8.2.2",
89
+ "@financial-times/o-editorial-typography": "^2.3.2",
90
+ "@financial-times/o-errors": "^5.0.0",
91
+ "@financial-times/o-forms": "^9.4.0",
92
+ "@financial-times/o-grid": "^6.1.1",
93
+ "@financial-times/o-normalise": "^3.0.0",
94
+ "@financial-times/o-overlay": "^4.0.0",
95
+ "@financial-times/o-spacing": "^3.0.0",
96
+ "@financial-times/o-tooltip": "^5.0.0",
97
+ "@financial-times/o-topper": "^5.2.3",
92
98
  "n-ui-foundations": "^9.0.0"
93
99
  },
94
100
  "dependencies": {
101
+ "date-fns": "2.16.1",
102
+ "fetchres": "^1.7.2",
103
+ "form-serialize": "^0.7.2",
95
104
  "ftdomdelegate": "^4.0.6",
96
- "next-myft-client": "^9.0.0",
105
+ "js-cookie": "^2.2.1",
106
+ "next-myft-client": "^10.1.0",
97
107
  "next-session-client": "^4.0.0",
98
108
  "superstore-sync": "^2.1.1"
99
109
  },
@@ -15,7 +15,6 @@ cd honk
15
15
 
16
16
  git checkout -b gh-pages
17
17
 
18
- mv ../bower_components .
19
18
  mv ../node_modules .
20
19
  cp ../scripts/* scripts/
21
20
 
package/styles.css ADDED
@@ -0,0 +1 @@
1
+ @keyframes load-notice{0%{max-height:0}to{max-height:200px}}.n-notification{position:fixed;top:0;left:0;width:100%;z-index:10}.n-notification__item{position:relative;background-color:rgba(255,241,229,.95);border-bottom:3px solid #33302e;color:#33302e;box-sizing:border-box;margin:0;padding:14px 0;overflow:hidden;animation:load-notice .2s forwards}.n-notification__content-wrapper{margin:0 auto;width:100%;position:relative;text-align:center;padding:0 30px;box-sizing:border-box}.n-notification__title{font-family:MetricWeb,sans-serif;font-size:20px;line-height:24px;font-weight:600;display:inline-block;padding-right:10px;margin:0}.o-typography--loading-sans-bold .n-notification__title{font-size:16.6px;font-family:sans-serif}.n-notification__content{font-family:MetricWeb,sans-serif;font-size:20px;line-height:24px;display:inline-block;margin:0}.o-typography--loading-sans .n-notification__content{font-size:17.4px;font-family:sans-serif}.n-notification__content b,.n-notification__content strong{font-family:MetricWeb,sans-serif;font-size:20px;line-height:24px;font-weight:600}.o-typography--loading-sans-bold .n-notification__content b,.o-typography--loading-sans-bold .n-notification__content strong{font-size:16.6px;font-family:sans-serif}.n-notification__content a{color:#33302e;border-bottom-color:#33302e}.n-notification--error{background-color:#fad9ce;color:#b30000}.n-notification--error .n-notification__content a{color:#fff}.n-notification--error .n-notification__close{width:40px;height:40px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23B30000%2C%23B30000)}@media screen and (-ms-high-contrast:active){.n-notification--error .n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-notification--error .n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-notification--success{background-color:#ccdfc7;color:#00572c}.n-notification--success .n-notification__content a{color:#00572c}.n-notification--success .n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%2300572C%2C%2300572C);position:absolute;right:0;top:0;border:0;cursor:pointer;background-size:20px;background-position:50%;margin-top:5px;width:40px;height:40px;text-indent:-999em}@media screen and (-ms-high-contrast:active){.n-notification--success .n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-notification--success .n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-notification__close{display:inline-block;background-repeat:no-repeat;background-size:contain;background-color:transparent;vertical-align:baseline;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%2333302E%2C%2333302E);position:absolute;right:0;top:0;border:0;cursor:pointer;background-size:20px;background-position:50%;margin-top:5px;width:40px;height:40px;text-indent:-999em}@media screen and (-ms-high-contrast:active){.n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-notification__close{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.myft-ui__logo{border:0}.myft-ui__icon{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:16px;height:16px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23FFFFFF%2C%23FFFFFF);width:34px;margin:0 8px -5px}@media screen and (-ms-high-contrast:active){.myft-ui__icon{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.myft-ui__icon{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-notification .myft-ui__icon{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:20px;height:20px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%2333302E%2C%2333302E);margin:0 3px -5px}@media screen and (-ms-high-contrast:active){.n-notification .myft-ui__icon{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-notification .myft-ui__icon{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-notification--error .myft-ui__icon,.n-notification--success .myft-ui__icon{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:20px;height:20px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23FFFFFF%2C%23FFFFFF)}@media screen and (-ms-high-contrast:active){.n-notification--error .myft-ui__icon,.n-notification--success .myft-ui__icon{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-notification--error .myft-ui__icon,.n-notification--success .myft-ui__icon{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:logo?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.myft-pin-divider{height:18px;width:1px;background:#e6d9ce;margin:0 1px}.myft-pin-button-wrapper .myft-pin-button{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;vertical-align:baseline;width:36px;height:36px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:pin?format=svg&source=n-myft-ui&tint=%2366605C%2C%2366605C)}@media screen and (-ms-high-contrast:active){.myft-pin-button-wrapper .myft-pin-button{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:pin?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.myft-pin-button-wrapper .myft-pin-button{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:pin?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.myft-pin-button-wrapper .myft-pin-button:not([disabled]):hover,.myft-pin-button-wrapper .myft-pin-button[aria-pressed=true]{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;vertical-align:baseline;width:36px;height:36px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:pin?format=svg&source=n-myft-ui&tint=%23990F3D%2C%23990F3D);background-color:transparent;border:0}@media screen and (-ms-high-contrast:active){.myft-pin-button-wrapper .myft-pin-button:not([disabled]):hover,.myft-pin-button-wrapper .myft-pin-button[aria-pressed=true]{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:pin?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.myft-pin-button-wrapper .myft-pin-button:not([disabled]):hover,.myft-pin-button-wrapper .myft-pin-button[aria-pressed=true]{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:pin?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.myft-pin-button__label{position:absolute;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0,0 0);clip-path:polygon(0 0,0 0);margin:-1px;border:0;overflow:hidden;padding:0;width:2px;height:2px;white-space:nowrap}.myft-pin-button-wrapper .myft-pin-button{background-color:transparent;border:0;padding:0;min-width:28px}.myft-pin-button-wrapper .o-tooltip--myft-pin-button{min-width:200px}.myft-pin-button-wrapper>form{display:flex}.myft-pin-button-wrapper.loading{position:relative}.myft-pin-button-wrapper.loading form{visibility:hidden}.myft-pin-button-wrapper.loading:after{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);content:" ";display:block;width:12px;height:12px;margin:0 auto;border-radius:50%;border-color:#66605c transparent;border-style:solid;border-width:3px;animation:lds-dual-ring 1.2s linear infinite}@keyframes lds-dual-ring{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}.n-myft-ui--instant{position:relative}.n-myft-ui--instant .n-myft-ui__button{position:relative;padding-left:26px;display:inline-block}.n-myft-ui--instant .n-myft-ui__button:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:24px;height:24px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%230A5E66%2C%230A5E66);content:" ";position:absolute;top:50%;left:1px;margin:-12px 1px 0 0}@media screen and (-ms-high-contrast:active){.n-myft-ui--instant .n-myft-ui__button:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-myft-ui--instant .n-myft-ui__button:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-myft-ui--instant .n-myft-ui__button[aria-pressed=true]:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:24px;height:24px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23FFFFFF%2C%23FFFFFF)}@media screen and (-ms-high-contrast:active){.n-myft-ui--instant .n-myft-ui__button[aria-pressed=true]:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-myft-ui--instant .n-myft-ui__button[aria-pressed=true]:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-myft-ui--instant .n-myft-ui__button[aria-pressed=true]:hover:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:24px;height:24px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%230A5E66%2C%230A5E66)}@media screen and (-ms-high-contrast:active){.n-myft-ui--instant .n-myft-ui__button[aria-pressed=true]:hover:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-myft-ui--instant .n-myft-ui__button[aria-pressed=true]:hover:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:mail?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-myft-ui__button--instant.n-myft-ui__button--instant-light{border:0;padding-left:8px;padding-right:36px;color:#33302e;font-weight:400;background:transparent}.n-myft-ui__button--instant.n-myft-ui__button--instant-light:not([disabled]):focus,.n-myft-ui__button--instant.n-myft-ui__button--instant-light:not([disabled]):hover,.n-myft-ui__button--instant.n-myft-ui__button--instant-light[aria-pressed=true]{background:transparent;color:#33302e}.n-myft-ui__button--instant.n-myft-ui__button--instant-light:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:36px;height:36px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:notifications?format=svg&source=n-myft-ui&tint=%2366605C%2C%2366605C);left:auto;right:1px;margin-top:-18px}@media screen and (-ms-high-contrast:active){.n-myft-ui__button--instant.n-myft-ui__button--instant-light:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:notifications?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-myft-ui__button--instant.n-myft-ui__button--instant-light:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:notifications?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-myft-ui__button--instant.n-myft-ui__button--instant-light:not([disabled]):hover:before,.n-myft-ui__button--instant.n-myft-ui__button--instant-light[aria-pressed=true]:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:36px;height:36px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:notifications?format=svg&source=n-myft-ui&tint=%23990F3D%2C%23990F3D)}@media screen and (-ms-high-contrast:active){.n-myft-ui__button--instant.n-myft-ui__button--instant-light:not([disabled]):hover:before,.n-myft-ui__button--instant.n-myft-ui__button--instant-light[aria-pressed=true]:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:notifications?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.n-myft-ui__button--instant.n-myft-ui__button--instant-light:not([disabled]):hover:before,.n-myft-ui__button--instant.n-myft-ui__button--instant-light[aria-pressed=true]:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:notifications?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-myft-ui--instant--hide-text .n-myft-ui__button--instant.n-myft-ui__button--instant-light{margin-top:5px;width:20px;overflow:hidden;white-space:nowrap;text-indent:-110px}.myft-ui,.n-myft-ui{display:inline-block}@keyframes myft-flash{25%{opacity:1}50%{opacity:1}}@keyframes myft-flash-white{10%{filter:brightness(0) invert(1)}75%{filter:brightness(0) invert(1)}}.experimental-myft-flash .o-header__top-column--right:before{content:" ";position:absolute;display:block;background-color:#0d7680;top:0;right:0;height:100%;opacity:0;animation:myft-flash 1.2s linear;width:58px}@media(min-width:46.25em){.experimental-myft-flash .o-header__top-column--right:before{width:88px}}@media(min-width:61.25em){.experimental-myft-flash .o-header__top-column--right:before{width:100px}}.experimental-myft-flash .o-header__top-link--myft:before{animation:myft-flash-white 1.2s linear}.myft-ui__button--manage[aria-pressed=true]:before,.myft-ui__button--myft-manage[aria-pressed=true]:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:28px;height:28px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23FFFFFF%2C%23FFFFFF)}@media screen and (-ms-high-contrast:active){.myft-ui__button--manage[aria-pressed=true]:before,.myft-ui__button--myft-manage[aria-pressed=true]:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.myft-ui__button--manage[aria-pressed=true]:before,.myft-ui__button--myft-manage[aria-pressed=true]:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:cross?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.n-myft-ui--article-saved__list-select{margin-bottom:10px}.o-overlay.o-overlay--myft-lists{height:100%;width:100%;max-width:640px}@media(min-width:30.625em){.o-overlay.o-overlay--myft-lists{height:auto}}.myft-list-form__wrapper{margin-bottom:20px}@media(min-width:46.25em){.myft-list-form__wrapper{display:flex}}.o-overlay__content .myft-list-form__wrapper{margin-bottom:0}.myft-list-form{overflow:hidden}@media(min-width:46.25em){.myft-list-form{flex:1}}.myft-list-form__button{float:right}.mypage .myft-list-form__message,.o-overlay .myft-list-form__message{font-family:MetricWeb,sans-serif;font-size:18px;line-height:20px;background:#fff1e5;border-radius:0;margin:3px 0 0;padding:20px}.o-typography--loading-sans .mypage .myft-list-form__message,.o-typography--loading-sans .o-overlay .myft-list-form__message{font-size:15.66px;font-family:sans-serif}.mypage .myft-list-form__message h3,.o-overlay .myft-list-form__message h3{font-family:MetricWeb,sans-serif;font-size:20px;line-height:24px;font-weight:600;margin:0 5px 0 0}.o-typography--loading-sans-bold .mypage .myft-list-form__message h3,.o-typography--loading-sans-bold .o-overlay .myft-list-form__message h3{font-size:16.6px;font-family:sans-serif}.mypage .myft-list-form__message p,.o-overlay .myft-list-form__message p{font-family:MetricWeb,sans-serif;font-size:20px;line-height:24px;padding:8px 0;margin:0}.o-typography--loading-sans .mypage .myft-list-form__message p,.o-typography--loading-sans .o-overlay .myft-list-form__message p{font-size:17.4px;font-family:sans-serif}.mypage .myft-list-form__message h3,.mypage .myft-list-form__message p,.o-overlay .myft-list-form__message h3,.o-overlay .myft-list-form__message p{display:inline-block;padding:0}.myft-list-form__message+.myft-list-form__wrapper{margin-top:20px}.o-overlay .myft-list-form__message{border-top:1px solid #ccc1b7;margin:0 -20px}.o-overlay .myft-list-form__message:first-child{border-top:0;margin-top:-20px}.myft-list-form__message--success h3{color:#00994d}.myft-list-form__message--success h3:before{display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:14px;height:14px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:tick?format=svg&source=n-myft-ui&tint=%2300994D%2C%2300994D);content:"";margin-right:3px}@media screen and (-ms-high-contrast:active){.myft-list-form__message--success h3:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:tick?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.myft-list-form__message--success h3:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:tick?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.myft-list-form-divider{text-align:center;margin-bottom:32px;padding:24px 0}@media(min-width:46.25em){.myft-list-form-divider{display:flex;position:relative;justify-content:center;align-items:center;margin:0;padding:0 8px}}.myft-list-form-divider:after{content:"";display:block;border-top:1px solid #ccc1b7;margin-top:-10px}@media(min-width:46.25em){.myft-list-form-divider:after{position:absolute;top:0;height:100%;width:1px;margin-top:0;border-top:0;border-left:1px solid #ccc1b7}}.myft-list-form-divider__inner{padding:10px;background-color:#fff9f5}@media(min-width:46.25em){.myft-list-form-divider__inner{z-index:10}}.o-overlay__content .myft-list-form-divider__inner{background-color:#fff}.share-nav.data-overlap-initialised .o-overlay{transition:opacity .15s ease-in;opacity:0;z-index:-1}.share-nav .myft-ui-create-list-variant{border-radius:10px;border:1px solid #f2e5da;background:#fffcfa}.share-nav .myft-ui-create-list-variant .o-overlay__heading{border-radius:10px 10px 0 0;background:#fff9f5;font-family:MetricWeb,sans-serif;font-size:20px;line-height:24px;color:#33302e}.o-typography--loading-sans .share-nav .myft-ui-create-list-variant .o-overlay__heading{font-size:17.4px;font-family:sans-serif}.share-nav .myft-ui-create-list-variant .o-overlay__content{font-family:MetricWeb,sans-serif;font-size:16px;line-height:20px;color:#33302e;padding:0}.o-typography--loading-sans .share-nav .myft-ui-create-list-variant .o-overlay__content{font-size:13.92px;font-family:sans-serif}.share-nav .myft-ui-create-list-variant .o-overlay__title{margin:8px 14px 0 8px}.share-nav .myft-ui-create-list-variant-container{display:block;width:340px;top:115.5px;left:50px}.share-nav .myft-ui-create-list-variant-add{border:0;background:none;font-family:MetricWeb,sans-serif;font-size:18px;line-height:20px;font-weight:600;color:#33302e;padding-left:0;margin-left:-8px}.o-typography--loading-sans-bold .share-nav .myft-ui-create-list-variant-add{font-size:14.94px;font-family:sans-serif}.share-nav .myft-ui-create-list-variant-add:hover{text-decoration:underline}.share-nav .myft-ui-create-list-variant-add:before{content:"";display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:28px;height:28px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:plus?format=svg&source=n-myft-ui&tint=%2333302E%2C%2333302E);vertical-align:middle;margin-top:-2px}@media screen and (-ms-high-contrast:active){.share-nav .myft-ui-create-list-variant-add:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:plus?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.share-nav .myft-ui-create-list-variant-add:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:plus?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.share-nav .myft-ui-create-list-variant-add-description{margin:4px 0}.share-nav .myft-ui-create-list-variant-heading:before{content:"";display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;vertical-align:baseline;width:32px;height:32px;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:tick?format=svg&source=n-myft-ui&tint=%230D7680%2C%230D7680);vertical-align:middle;margin-top:-2px}@media screen and (-ms-high-contrast:active){.share-nav .myft-ui-create-list-variant-heading:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:tick?format=svg&source=n-myft-ui&tint=%23ffffff%2C%23ffffff)}}@media screen and (-ms-high-contrast:black-on-white){.share-nav .myft-ui-create-list-variant-heading:before{background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/fticon-v1:tick?format=svg&source=n-myft-ui&tint=%23000000%2C%23000000)}}.share-nav .myft-ui-create-list-variant-footer{border-top:1px solid #f2e5da;padding:16px}.share-nav .myft-ui-create-list-variant-icon:before{content:"";display:inline-block;background-repeat:no-repeat;background-size:contain;background-position:50%;background-color:transparent;background-image:url(https://www.ft.com/__origami/service/image/v2/images/raw/ftlogo-v1:brand-myft?source=next-article);width:42px;height:42px;vertical-align:middle;margin-top:-2px}.share-nav .myft-ui-create-list-variant-icon-visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.share-nav .myft-ui-create-list-variant-form{display:flex;width:calc(100% - 32px);justify-content:space-between;height:40px;gap:8px;padding:0 16px 16px}.share-nav .myft-ui-create-list-variant-form>*{flex:1 1 auto}.share-nav .myft-ui-create-list-variant-form .o-forms-input{margin-top:0}.share-nav .myft-ui-create-list-variant-lists{padding:16px 16px 0;font-family:MetricWeb,sans-serif;font-size:18px;line-height:20px}.o-typography--loading-sans .share-nav .myft-ui-create-list-variant-lists{font-size:15.66px;font-family:sans-serif}.share-nav .myft-ui-create-list-variant-lists-text{font-family:MetricWeb,sans-serif;font-weight:600;color:#33302e;margin-bottom:16px}.share-nav .myft-ui-create-list-variant-lists-container{margin-top:0}
@@ -1,7 +1,7 @@
1
1
  /* global expect */
2
2
  import sinon from 'sinon';
3
- import addMinutes from 'date-fns/src/addMinutes';
4
- import parseISO from 'date-fns/src/parseISO';
3
+ import addMinutes from 'date-fns/addMinutes';
4
+ import parseISO from 'date-fns/parseISO';
5
5
 
6
6
  const expiryTimestamp = parseISO('2018-06-14T12:00:00.000Z');
7
7
  const timestampBeforeExpiry = '2018-06-14T11:40:00.000Z';
@@ -29,7 +29,7 @@ describe('initialiseFeedStartTime', () => {
29
29
  let lastVisitTime;
30
30
  const injector = require('inject-loader!../../components/unread-articles-indicator/initialise-feed-start-time');
31
31
  const initialiseFeedStartTime = injector({
32
- './date-fns': {
32
+ 'date-fns': {
33
33
  isToday: mockDateFns.isToday,
34
34
  startOfDay: mockDateFns.startOfDay
35
35
  },
package/webpack.config.js CHANGED
@@ -1,21 +1,15 @@
1
1
  const path = require('path');
2
2
  const { PageKitJsPlugin } = require('@financial-times/dotcom-build-js');
3
3
  const { PageKitSassPlugin } = require('@financial-times/dotcom-build-sass');
4
- const { PageKitBowerResolvePlugin } = require('@financial-times/dotcom-build-bower-resolve');
5
4
 
6
5
  module.exports = {
7
6
  plugins: [
8
7
  new PageKitJsPlugin(),
9
- new PageKitSassPlugin(),
10
- new PageKitBowerResolvePlugin()
8
+ new PageKitSassPlugin()
11
9
  ],
12
10
  entry: {
13
- scripts: [
14
- './myft/index.js',
15
- './myft-common/index.js'
16
- ],
17
-
18
- styles: './myft/test.scss'
11
+ scripts: ['./myft/index.js', './myft-common/index.js'],
12
+ styles: './myft/test.scss',
19
13
  },
20
14
  output: {
21
15
  path: path.resolve(__dirname, 'public')
package/bower.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "name": "n-myft-ui",
3
- "homepage": "https://github.com/Financial-Times/n-myft-ui",
4
- "authors": [
5
- "Rhys Evans <rhys.evans@ft.com>"
6
- ],
7
- "license": "MIT",
8
- "ignore": [
9
- "circle.yml",
10
- "karma.conf.js",
11
- "Makefile",
12
- "n.Makefile",
13
- "package.json",
14
- "webpack.config.js",
15
- "webpack.config.demo.js"
16
- ],
17
- "main": "main.js",
18
- "dependencies": {
19
- "date-fns": "2.16.1",
20
- "fetchres": "^1.7.2",
21
- "form-serialize": "^0.7.2",
22
- "js-cookie": "^2.2.0",
23
- "n-notification": "^7.0.0",
24
- "o-editorial-typography": "^1.0.1",
25
- "o-errors": "^4.0.2",
26
- "o-forms": "^8.0.0",
27
- "o-grid": "^5.0.0",
28
- "o-normalise": "^2.0.1",
29
- "o-overlay": "^3.0.0",
30
- "o-spacing": "^2.0.0",
31
- "o-tooltip": "^4.0.0"
32
- }
33
- }