@peerboard/core
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -50,3 +50,3 @@ "use strict"; | ||
}; | ||
var defaultOptions = { | ||
var defaultOptions = function () { return ({ | ||
resize: true, | ||
@@ -58,5 +58,9 @@ hideMenu: true, | ||
onPathChanged: function (newPath) { return window.history.replaceState({}, window.document.title, newPath); } | ||
}; | ||
}); }; | ||
exports.createForum = function (forumID, container, options) { | ||
var opts = __assign(__assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true }), options); | ||
if (typeof window === 'undefined') { | ||
console.warn('peerboard: window is not defined, cannot create forum, potentially used in ssr'); | ||
return Promise.resolve(null); | ||
} | ||
var opts = __assign(__assign(__assign({}, defaultOptions()), { scrollToTopOnNavigationChanged: true }), options); | ||
if (!opts.usePathFromQs) { | ||
@@ -114,3 +118,7 @@ // Auto resolve final location using part after the prefix | ||
if (spaceID === void 0) { spaceID = 0; } | ||
var opts = __assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true, | ||
if (typeof window === 'undefined') { | ||
console.warn('peerboard: window is not defined, cannot create forum, potentially used in ssr'); | ||
return Promise.resolve(null); | ||
} | ||
var opts = __assign(__assign({}, defaultOptions()), { scrollToTopOnNavigationChanged: true, | ||
// tslint:disable-next-line:no-empty | ||
@@ -117,0 +125,0 @@ onPathChanged: function () { } }); |
@@ -65,3 +65,3 @@ 'use strict'; | ||
}; | ||
var defaultOptions = { | ||
var defaultOptions = function () { return ({ | ||
resize: true, | ||
@@ -73,5 +73,9 @@ hideMenu: true, | ||
onPathChanged: function (newPath) { return window.history.replaceState({}, window.document.title, newPath); } | ||
}; | ||
}); }; | ||
var createForum = function (forumID, container, options) { | ||
var opts = __assign(__assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true }), options); | ||
if (typeof window === 'undefined') { | ||
console.warn('peerboard: window is not defined, cannot create forum, potentially used in ssr'); | ||
return Promise.resolve(null); | ||
} | ||
var opts = __assign(__assign(__assign({}, defaultOptions()), { scrollToTopOnNavigationChanged: true }), options); | ||
if (!opts.usePathFromQs) { | ||
@@ -129,3 +133,7 @@ // Auto resolve final location using part after the prefix | ||
if (spaceID === void 0) { spaceID = 0; } | ||
var opts = __assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true, | ||
if (typeof window === 'undefined') { | ||
console.warn('peerboard: window is not defined, cannot create forum, potentially used in ssr'); | ||
return Promise.resolve(null); | ||
} | ||
var opts = __assign(__assign({}, defaultOptions()), { scrollToTopOnNavigationChanged: true, | ||
// tslint:disable-next-line:no-empty | ||
@@ -132,0 +140,0 @@ onPathChanged: function () { } }); |
@@ -67,3 +67,3 @@ (function (global, factory) { | ||
}; | ||
var defaultOptions = { | ||
var defaultOptions = function () { return ({ | ||
resize: true, | ||
@@ -75,5 +75,9 @@ hideMenu: true, | ||
onPathChanged: function (newPath) { return window.history.replaceState({}, window.document.title, newPath); } | ||
}; | ||
}); }; | ||
var createForum = function (forumID, container, options) { | ||
var opts = __assign(__assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true }), options); | ||
if (typeof window === 'undefined') { | ||
console.warn('peerboard: window is not defined, cannot create forum, potentially used in ssr'); | ||
return Promise.resolve(null); | ||
} | ||
var opts = __assign(__assign(__assign({}, defaultOptions()), { scrollToTopOnNavigationChanged: true }), options); | ||
if (!opts.usePathFromQs) { | ||
@@ -131,3 +135,7 @@ // Auto resolve final location using part after the prefix | ||
if (spaceID === void 0) { spaceID = 0; } | ||
var opts = __assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true, | ||
if (typeof window === 'undefined') { | ||
console.warn('peerboard: window is not defined, cannot create forum, potentially used in ssr'); | ||
return Promise.resolve(null); | ||
} | ||
var opts = __assign(__assign({}, defaultOptions()), { scrollToTopOnNavigationChanged: true, | ||
// tslint:disable-next-line:no-empty | ||
@@ -134,0 +142,0 @@ onPathChanged: function () { } }); |
@@ -91,4 +91,4 @@ export declare enum ExcludeOptions { | ||
export declare const loadSdk: (embedSDKURL?: string | undefined) => Promise<void>; | ||
export declare const createForum: (forumID: number, container: HTMLElement, options: Readonly<Options>) => Promise<ForumAPI>; | ||
export declare const createCommentWidget: (communityID: number, container: HTMLElement, exclude: ExcludeOptions[], spaceID: number | undefined, options: Readonly<WidgetOptions>) => Promise<ForumAPI>; | ||
export declare const createForum: (forumID: number, container: HTMLElement, options: Readonly<Options>) => Promise<ForumAPI | null>; | ||
export declare const createCommentWidget: (communityID: number, container: HTMLElement, exclude: ExcludeOptions[], spaceID: number | undefined, options: Readonly<WidgetOptions>) => Promise<ForumAPI | null>; | ||
export {}; |
{ | ||
"name": "@peerboard/core", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "peerboard.com frontend components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59154
568