@teleporthq/teleport-uidl-resolver
Advanced tools
Comparing version 0.43.0-alpha.0 to 0.44.0-alpha.0
@@ -16,3 +16,2 @@ "use strict"; | ||
var teleport_shared_1 = require("@teleporthq/teleport-shared"); | ||
var path_1 = require("path"); | ||
var insertLinks = function (node, options, linkInParent, parentNode) { | ||
@@ -181,3 +180,3 @@ var _a, _b, _c, _d; | ||
var resolveNavlink = function (route, options) { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b; | ||
if (options.skipNavlinkResolver) { | ||
@@ -204,19 +203,14 @@ return route; | ||
} | ||
var value = (_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 (((_c = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _c === void 0 ? void 0 : _c.navLink) === '/') { | ||
value = transitionRoute.pageOptions.navLink; | ||
if (((_a = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _a === void 0 ? void 0 : _a.navLink) === '/') { | ||
return { | ||
type: 'static', | ||
content: transitionRoute.pageOptions.navLink, | ||
}; | ||
} | ||
/* | ||
We are using `navLink` + fileName for the target location calculation. | ||
See `teleport-project-generator` -> createPageUIDL for more info. | ||
*/ | ||
value = | ||
((_d = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _d === void 0 ? void 0 : _d.navLink) && ((_e = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _e === void 0 ? void 0 : _e.fileName) | ||
? (0, path_1.join)(transitionRoute.pageOptions.navLink, "../".concat(transitionRoute.pageOptions.fileName)) | ||
: (_f = transitionRoute.pageOptions.navLink) !== null && _f !== void 0 ? _f : "/".concat(friendlyURL); | ||
var pageOptions = transitionRoute.pageOptions; | ||
return { | ||
type: 'static', | ||
content: value, | ||
content: (_b = pageOptions.navLink) !== null && _b !== void 0 ? _b : "/".concat(friendlyURL), | ||
}; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
@@ -13,3 +13,2 @@ var __assign = (this && this.__assign) || function () { | ||
import { StringUtils } from '@teleporthq/teleport-shared'; | ||
import { join } from 'path'; | ||
export var insertLinks = function (node, options, linkInParent, parentNode) { | ||
@@ -176,3 +175,3 @@ var _a, _b, _c, _d; | ||
var resolveNavlink = function (route, options) { | ||
var _a, _b, _c, _d, _e, _f; | ||
var _a, _b; | ||
if (options.skipNavlinkResolver) { | ||
@@ -199,19 +198,14 @@ return route; | ||
} | ||
var value = (_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 (((_c = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _c === void 0 ? void 0 : _c.navLink) === '/') { | ||
value = transitionRoute.pageOptions.navLink; | ||
if (((_a = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _a === void 0 ? void 0 : _a.navLink) === '/') { | ||
return { | ||
type: 'static', | ||
content: transitionRoute.pageOptions.navLink, | ||
}; | ||
} | ||
/* | ||
We are using `navLink` + fileName for the target location calculation. | ||
See `teleport-project-generator` -> createPageUIDL for more info. | ||
*/ | ||
value = | ||
((_d = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _d === void 0 ? void 0 : _d.navLink) && ((_e = transitionRoute === null || transitionRoute === void 0 ? void 0 : transitionRoute.pageOptions) === null || _e === void 0 ? void 0 : _e.fileName) | ||
? join(transitionRoute.pageOptions.navLink, "../".concat(transitionRoute.pageOptions.fileName)) | ||
: (_f = transitionRoute.pageOptions.navLink) !== null && _f !== void 0 ? _f : "/".concat(friendlyURL); | ||
var pageOptions = transitionRoute.pageOptions; | ||
return { | ||
type: 'static', | ||
content: value, | ||
content: (_b = pageOptions.navLink) !== null && _b !== void 0 ? _b : "/".concat(friendlyURL), | ||
}; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@teleporthq/teleport-uidl-resolver", | ||
"version": "0.43.0-alpha.0", | ||
"version": "0.44.0-alpha.0", | ||
"description": "A small package that handles the transition from UIDL to HTML elements and has support for custom mappings.", | ||
@@ -27,8 +27,8 @@ "author": "teleportHQ", | ||
"dependencies": { | ||
"@teleporthq/teleport-shared": "^0.43.0-alpha.0", | ||
"@teleporthq/teleport-types": "^0.43.0-alpha.0", | ||
"@teleporthq/teleport-uidl-builders": "^0.43.0-alpha.0", | ||
"@teleporthq/teleport-shared": "^0.44.0-alpha.0", | ||
"@teleporthq/teleport-types": "^0.44.0-alpha.0", | ||
"@teleporthq/teleport-uidl-builders": "^0.44.0-alpha.0", | ||
"deepmerge": "^4.0.0" | ||
}, | ||
"gitHead": "b3c9ae8e66be2e9621e83706b15305be9d51dd01" | ||
"gitHead": "45837677d7dc78f2557c5af83deb519bd33b36c6" | ||
} |
@@ -8,3 +8,2 @@ import { StringUtils } from '@teleporthq/teleport-shared' | ||
} from '@teleporthq/teleport-types' | ||
import { join } from 'path' | ||
@@ -265,22 +264,15 @@ export const insertLinks = ( | ||
let value = transitionRoute?.pageOptions?.navLink ?? `/${friendlyURL}` | ||
if (transitionRoute?.pageOptions?.navLink === '/') { | ||
value = transitionRoute.pageOptions.navLink | ||
return { | ||
type: 'static', | ||
content: transitionRoute.pageOptions.navLink, | ||
} | ||
} | ||
/* | ||
We are using `navLink` + fileName for the target location calculation. | ||
See `teleport-project-generator` -> createPageUIDL for more info. | ||
*/ | ||
const { pageOptions } = transitionRoute | ||
value = | ||
transitionRoute?.pageOptions?.navLink && transitionRoute?.pageOptions?.fileName | ||
? join(transitionRoute.pageOptions.navLink, `../${transitionRoute.pageOptions.fileName}`) | ||
: transitionRoute.pageOptions.navLink ?? `/${friendlyURL}` | ||
return { | ||
type: 'static', | ||
content: value, | ||
content: pageOptions.navLink ?? `/${friendlyURL}`, | ||
} | ||
} |
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
328868
4911
+ Added@teleporthq/teleport-shared@0.44.0-alpha.0(transitive)
+ Added@teleporthq/teleport-types@0.44.0-alpha.0(transitive)
+ Added@teleporthq/teleport-uidl-builders@0.44.0-alpha.0(transitive)
- Removed@teleporthq/teleport-shared@0.43.0-alpha.0(transitive)
- Removed@teleporthq/teleport-types@0.43.0-alpha.0(transitive)
- Removed@teleporthq/teleport-uidl-builders@0.43.0-alpha.0(transitive)