@teleporthq/teleport-uidl-resolver
Advanced tools
Comparing version 0.29.0 to 0.29.2
@@ -16,2 +16,3 @@ "use strict"; | ||
var teleport_shared_1 = require("@teleporthq/teleport-shared"); | ||
var path_1 = require("path"); | ||
var insertLinks = function (node, options, linkInParent, parentNode) { | ||
@@ -141,3 +142,3 @@ var _a, _b, _c, _d; | ||
var resolveNavlink = function (routeName, options) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
if (options.skipNavlinkResolver) { | ||
@@ -157,4 +158,13 @@ return routeName; | ||
} | ||
return (_b = (_a = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _a === void 0 ? void 0 : _a.navLink) !== null && _b !== void 0 ? _b : "/".concat(friendlyURL); | ||
if (((_a = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _a === void 0 ? void 0 : _a.navLink) === '/') { | ||
return transitionRoute.pageOptions.navLink; | ||
} | ||
/* | ||
We are using `navLink` + fileName for the target location calculation. | ||
See `teleport-project-generator` -> createPageUIDL for more info. | ||
*/ | ||
return ((_b = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _b === void 0 ? void 0 : _b.navLink) && ((_c = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _c === void 0 ? void 0 : _c.fileName) | ||
? (0, path_1.join)(transitionRoute.pageOptions.navLink, "../".concat(transitionRoute.pageOptions.fileName)) | ||
: (_d = transitionRoute.pageOptions.navLink) !== null && _d !== void 0 ? _d : "/".concat(friendlyURL); | ||
}; | ||
//# sourceMappingURL=utils.js.map |
@@ -13,2 +13,3 @@ var __assign = (this && this.__assign) || function () { | ||
import { StringUtils } from '@teleporthq/teleport-shared'; | ||
import { join } from 'path'; | ||
export var insertLinks = function (node, options, linkInParent, parentNode) { | ||
@@ -136,3 +137,3 @@ var _a, _b, _c, _d; | ||
var resolveNavlink = function (routeName, options) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
if (options.skipNavlinkResolver) { | ||
@@ -152,4 +153,13 @@ return routeName; | ||
} | ||
return (_b = (_a = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _a === void 0 ? void 0 : _a.navLink) !== null && _b !== void 0 ? _b : "/".concat(friendlyURL); | ||
if (((_a = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _a === void 0 ? void 0 : _a.navLink) === '/') { | ||
return transitionRoute.pageOptions.navLink; | ||
} | ||
/* | ||
We are using `navLink` + fileName for the target location calculation. | ||
See `teleport-project-generator` -> createPageUIDL for more info. | ||
*/ | ||
return ((_b = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _b === void 0 ? void 0 : _b.navLink) && ((_c = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _c === void 0 ? void 0 : _c.fileName) | ||
? join(transitionRoute.pageOptions.navLink, "../".concat(transitionRoute.pageOptions.fileName)) | ||
: (_d = transitionRoute.pageOptions.navLink) !== null && _d !== void 0 ? _d : "/".concat(friendlyURL); | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@teleporthq/teleport-uidl-resolver", | ||
"version": "0.29.0", | ||
"version": "0.29.2", | ||
"description": "A small package that handles the transition from UIDL to HTML elements and has support for custom mappings.", | ||
@@ -32,3 +32,3 @@ "author": "teleportHQ", | ||
}, | ||
"gitHead": "9a99af0b622182d02a80ea6ff6b45221facab5c9" | ||
"gitHead": "6f0dc585f5165679ea7cbd795f3d17d84a22728a" | ||
} |
@@ -8,2 +8,3 @@ import { StringUtils } from '@teleporthq/teleport-shared' | ||
} from '@teleporthq/teleport-types' | ||
import { join } from 'path' | ||
@@ -195,3 +196,14 @@ export const insertLinks = ( | ||
return transitionRoute?.pageOptions?.navLink ?? `/${friendlyURL}` | ||
if (transitionRoute?.pageOptions?.navLink === '/') { | ||
return transitionRoute.pageOptions.navLink | ||
} | ||
/* | ||
We are using `navLink` + fileName for the target location calculation. | ||
See `teleport-project-generator` -> createPageUIDL for more info. | ||
*/ | ||
return transitionRoute?.pageOptions?.navLink && transitionRoute?.pageOptions?.fileName | ||
? join(transitionRoute.pageOptions.navLink, `../${transitionRoute.pageOptions.fileName}`) | ||
: transitionRoute.pageOptions.navLink ?? `/${friendlyURL}` | ||
} |
@@ -438,3 +438,3 @@ import { UIDLUtils, StringUtils } from '@teleporthq/teleport-shared' | ||
background image such as gradient shouldn't be urls | ||
we prevent that by checking if the value is actually an asset or not (same check as in the prefixAssetsPath function | ||
we prevent that by checking if the value is actually an asset or not (same check as in the prefixAssetsPath function | ||
but we don't compute and generate a url) | ||
@@ -441,0 +441,0 @@ */ |
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
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
309892
4570