@financial-times/x-live-blog-wrapper
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -114,5 +114,8 @@ 'use strict'; | ||
}, 0); | ||
}; | ||
}; // Allow `next-live-event-api` endpoint URL to be set in development. | ||
var eventSource = new EventSource("http://localhost:3003/v2/liveblog/".concat(liveBlogPackageUuid), { | ||
var baseUrl = typeof LIVE_EVENT_API_URL !== 'undefined' ? LIVE_EVENT_API_URL : 'https://next-live-event.ft.com'; // eslint-disable-line no-undef | ||
var eventSource = new EventSource("".concat(baseUrl, "/v2/liveblog/").concat(liveBlogPackageUuid), { | ||
withCredentials: true | ||
@@ -228,10 +231,10 @@ }); | ||
}, postElements); | ||
}; | ||
}; // A displayName is required for this component | ||
// This enables the component to work with x-interaction | ||
BaseLiveBlogWrapper.displayName = 'BaseLiveBlogWrapper'; | ||
var LiveBlogWrapper = withLiveBlogWrapperActions(BaseLiveBlogWrapper); | ||
console.log({ | ||
LiveBlogWrapper: LiveBlogWrapper | ||
}); // eslint-disable-line no-console | ||
exports.LiveBlogWrapper = LiveBlogWrapper; | ||
exports.listenToLiveBlogEvents = listenToLiveBlogEvents; |
@@ -114,5 +114,8 @@ 'use strict'; | ||
}, 0); | ||
}; | ||
}; // Allow `next-live-event-api` endpoint URL to be set in development. | ||
var eventSource = new EventSource("http://localhost:3003/v2/liveblog/".concat(liveBlogPackageUuid), { | ||
var baseUrl = typeof LIVE_EVENT_API_URL !== 'undefined' ? LIVE_EVENT_API_URL : 'https://next-live-event.ft.com'; // eslint-disable-line no-undef | ||
var eventSource = new EventSource("".concat(baseUrl, "/v2/liveblog/").concat(liveBlogPackageUuid), { | ||
withCredentials: true | ||
@@ -228,10 +231,10 @@ }); | ||
}, postElements); | ||
}; | ||
}; // A displayName is required for this component | ||
// This enables the component to work with x-interaction | ||
BaseLiveBlogWrapper.displayName = 'BaseLiveBlogWrapper'; | ||
var LiveBlogWrapper = withLiveBlogWrapperActions(BaseLiveBlogWrapper); | ||
console.log({ | ||
LiveBlogWrapper: LiveBlogWrapper | ||
}); // eslint-disable-line no-console | ||
exports.LiveBlogWrapper = LiveBlogWrapper; | ||
exports.listenToLiveBlogEvents = listenToLiveBlogEvents; |
@@ -110,5 +110,8 @@ import { h } from '@financial-times/x-engine'; | ||
}, 0); | ||
}; | ||
}; // Allow `next-live-event-api` endpoint URL to be set in development. | ||
var eventSource = new EventSource("http://localhost:3003/v2/liveblog/".concat(liveBlogPackageUuid), { | ||
var baseUrl = typeof LIVE_EVENT_API_URL !== 'undefined' ? LIVE_EVENT_API_URL : 'https://next-live-event.ft.com'; // eslint-disable-line no-undef | ||
var eventSource = new EventSource("".concat(baseUrl, "/v2/liveblog/").concat(liveBlogPackageUuid), { | ||
withCredentials: true | ||
@@ -224,9 +227,9 @@ }); | ||
}, postElements); | ||
}; | ||
}; // A displayName is required for this component | ||
// This enables the component to work with x-interaction | ||
BaseLiveBlogWrapper.displayName = 'BaseLiveBlogWrapper'; | ||
var LiveBlogWrapper = withLiveBlogWrapperActions(BaseLiveBlogWrapper); | ||
console.log({ | ||
LiveBlogWrapper: LiveBlogWrapper | ||
}); // eslint-disable-line no-console | ||
export { LiveBlogWrapper, listenToLiveBlogEvents }; |
{ | ||
"name": "@financial-times/x-live-blog-wrapper", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "", | ||
@@ -18,5 +18,5 @@ "main": "dist/LiveBlogWrapper.cjs.js", | ||
"dependencies": { | ||
"@financial-times/x-engine": "^2.0.5", | ||
"@financial-times/x-live-blog-post": "^2.0.5", | ||
"@financial-times/x-interaction": "^2.0.5" | ||
"@financial-times/x-engine": "^3.1.0", | ||
"@financial-times/x-live-blog-post": "0.0.5", | ||
"@financial-times/x-interaction": "^3.1.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
@@ -193,1 +193,12 @@ # x-live-blog-wrapper | ||
`id` | String | **(required)** Unique id used for identifying the element in the document. | ||
## Configuring the `next-live-event-api` endpoint URL. | ||
If you want to configure the URL for `next-live-event-api`, add the following plugin in your Webpack configuration file: | ||
```javascript | ||
new webpack.DefinePlugin({ | ||
LIVE_EVENT_API_URL: JSON.stringify('http://localhost:3003') | ||
}) | ||
``` |
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { withKnobs, text } from '@storybook/addon-knobs' | ||
import { LiveBlogWrapper } from '../src/LiveBlogWrapper' | ||
@@ -40,17 +38,13 @@ import '../../x-live-blog-post/dist/LiveBlogPost.css' | ||
const toggleMessage = () => text('Message', defaultProps.message) | ||
export default { | ||
title: 'x-live-blog-wrapper', | ||
parameters: { | ||
escapeHTML: false | ||
} | ||
} | ||
storiesOf('x-live-blog-wrapper', module) | ||
.addDecorator(withKnobs) | ||
.addParameters({ | ||
knobs: { | ||
escapeHTML: false | ||
} | ||
}) | ||
.add('Content Body', () => { | ||
const knobs = { | ||
message: toggleMessage() | ||
} | ||
export const ContentBody = (args) => { | ||
return <LiveBlogWrapper {...args} /> | ||
} | ||
return <LiveBlogWrapper {...defaultProps} {...knobs} /> | ||
}) | ||
ContentBody.args = defaultProps |
33976
203
645
+ Added@financial-times/x-engine@3.3.1(transitive)
+ Added@financial-times/x-interaction@3.3.1(transitive)
+ Added@financial-times/x-live-blog-post@0.0.5(transitive)
- Removed@financial-times/x-engine@2.1.0(transitive)
- Removed@financial-times/x-interaction@2.1.0(transitive)
- Removed@financial-times/x-live-blog-post@2.1.0(transitive)