[next] Embed plus (#1877)

* Implement StreamEmbed instance and rename library to coral

* Add article & articleButton.html, only show embed htmls in production

* Respect assetURL

* Add tests

* Add parseHashQuery

* Fix permalink query and integration tests

* Fix permalink URL

* Remove optionalparams from pym

* Scroll when showing permalink view

* Implement autoRender

* AutoRender immediately when render permalink

* Add test for `showPermalink` event

* Add comment
This commit is contained in:
Kiwi
2018-09-21 22:43:28 +00:00
committed by Wyatt Johnson
parent 85af8d1bbf
commit 106a5d36ed
57 changed files with 906 additions and 240 deletions
+7 -1
View File
@@ -2,13 +2,18 @@ import pym from "pym.js";
import { CleanupCallback, Decorator } from "./decorators";
interface PymControlConfig {
export interface PymControlConfig {
id: string;
url: string;
title: string;
decorators?: ReadonlyArray<Decorator>;
}
export type PymControlFactory = (config: PymControlConfig) => PymControl;
export const defaultPymControlFactory: PymControlFactory = config =>
new PymControl(config);
export default class PymControl {
private pym: pym.Parent;
private cleanups: CleanupCallback[];
@@ -20,6 +25,7 @@ export default class PymControl {
title: config.title,
id: `${config.id}_iframe`,
name: `${config.id}_iframe`,
optionalparams: "",
});
this.cleanups = decorators