@builder.io/react
Advanced tools
Comparing version 0.1.102-5 to 0.1.102-6
@@ -114,2 +114,3 @@ "use strict"; | ||
// tslint:disable-next-line:no-function-constructor-with-string-args | ||
// TODO: VM in node...... | ||
fn = new Function('state', "with (state) {\n " + (useReturn ? "return (" + value + ");" : value) + ";\n }"); | ||
@@ -128,4 +129,4 @@ } | ||
}; | ||
function searchToObject() { | ||
var pairs = window.location.search.substring(1).split('&'); | ||
function searchToObject(location) { | ||
var pairs = (location.search || '').substring(1).split('&'); | ||
var obj = {}; | ||
@@ -197,3 +198,3 @@ for (var i in pairs) { | ||
get: function () { | ||
return __assign({}, pick_1.default(location, 'pathname', 'hostname', 'search', 'host'), { path: location.pathname.split('/').slice(1), query: searchToObject() }); | ||
return __assign({}, pick_1.default(location, 'pathname', 'hostname', 'search', 'host'), { path: this.location.pathname.split('/').slice(1), query: searchToObject(this.location) }); | ||
}, | ||
@@ -231,2 +232,9 @@ enumerable: true, | ||
}; | ||
Object.defineProperty(BuilderPage.prototype, "location", { | ||
get: function () { | ||
return this.props.location || (sdk_1.Builder.isBrowser ? location : {}); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
BuilderPage.prototype.getCssFromFont = function (font) { | ||
@@ -233,0 +241,0 @@ var family = font.family + (font.kind ? ', ' + font.kind : ''); |
@@ -0,3 +1,5 @@ | ||
/// <reference types="node" /> | ||
import React from 'react'; | ||
import { GetContentOptions, Subscription } from '@builder.io/sdk'; | ||
import { Url } from 'url'; | ||
export interface BuilderPageProps { | ||
@@ -9,2 +11,3 @@ modelName?: string; | ||
content?: any; | ||
location?: Location | Url; | ||
} | ||
@@ -20,3 +23,3 @@ interface BuilderPageState { | ||
readonly locationState: { | ||
path: string[]; | ||
path: any; | ||
query: { | ||
@@ -39,2 +42,3 @@ [key: string]: string; | ||
}; | ||
readonly location: any; | ||
getCssFromFont(font: any): string; | ||
@@ -41,0 +45,0 @@ componentWillMount(): void; |
{ | ||
"name": "@builder.io/react", | ||
"version": "0.1.102-5", | ||
"version": "0.1.102-6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3659892
26662