rotion 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/cjs/index.js +22 -8
- package/dist/ui/cjs/index.js.map +1 -1
- package/dist/ui/esm/index.js +22 -8
- package/dist/ui/esm/index.js.map +1 -1
- package/dist/ui/styles/page.css +1 -0
- package/dist/ui/umd/index.js +22 -8
- package/dist/ui/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/cjs/index.js
CHANGED
|
@@ -19315,27 +19315,41 @@ var BookmarkBlock = function (_a) {
|
|
|
19315
19315
|
React.createElement(TextBlock, { tag: "span", block: block.bookmark.caption }))));
|
|
19316
19316
|
};
|
|
19317
19317
|
|
|
19318
|
+
function buildPathname(id, name, href) {
|
|
19319
|
+
if (href === '/') {
|
|
19320
|
+
return href;
|
|
19321
|
+
}
|
|
19322
|
+
var _a = getLinkPathAndLinkKey(href || ''), path = _a[0], slugKey = _a[1];
|
|
19323
|
+
var file = '';
|
|
19324
|
+
if (slugKey === 'id') {
|
|
19325
|
+
file = id;
|
|
19326
|
+
}
|
|
19327
|
+
else {
|
|
19328
|
+
file = encodeURIComponent(name.toLowerCase()).replace(/%20/g, '-');
|
|
19329
|
+
}
|
|
19330
|
+
return "".concat(path).concat(file);
|
|
19331
|
+
}
|
|
19318
19332
|
var BreadcrumbLink = function (_a) {
|
|
19319
19333
|
var breadcrumb = _a.breadcrumb, link = _a.link, href = _a.href, query = _a.query, children = _a.children;
|
|
19320
19334
|
var id = breadcrumb.id, name = breadcrumb.name;
|
|
19321
|
-
var
|
|
19322
|
-
var file = slugKey === 'id' ? id : encodeURIComponent(name.toLowerCase()).replace(/%20/g, '-');
|
|
19335
|
+
var pathname = buildPathname(id, name, href);
|
|
19323
19336
|
if (link && href) {
|
|
19324
19337
|
var Link = link;
|
|
19325
|
-
return (React.createElement(Link, { className: "notionate-blocks-breadcrumb-a", href: { pathname:
|
|
19338
|
+
return (React.createElement(Link, { className: "notionate-blocks-breadcrumb-a", href: { pathname: pathname, query: query } }, children));
|
|
19326
19339
|
}
|
|
19327
19340
|
if (href) {
|
|
19328
|
-
return (React.createElement("a", { className: "notionate-blocks-breadcrumb-a", href: "".concat(
|
|
19341
|
+
return (React.createElement("a", { className: "notionate-blocks-breadcrumb-a", href: "".concat(pathname).concat(queryToString(query)) }, children));
|
|
19329
19342
|
}
|
|
19330
19343
|
return (React.createElement("span", { className: "notionate-blocks-breadcrumb-a" }, children));
|
|
19331
19344
|
};
|
|
19332
19345
|
var BreadcrumbBlock = function (_a) {
|
|
19333
19346
|
var block = _a.block, link = _a.link, hrefs = _a.hrefs, query = _a.query;
|
|
19334
19347
|
var max = block.list.length;
|
|
19335
|
-
return (React.createElement("div", { className: "notionate-blocks-breadcrumb" }, block.list.map(function (v, i) { return (React.createElement(
|
|
19336
|
-
|
|
19337
|
-
|
|
19338
|
-
|
|
19348
|
+
return (React.createElement("div", { className: "notionate-blocks-breadcrumb" }, block.list.map(function (v, i) { return (React.createElement(React.Fragment, null,
|
|
19349
|
+
React.createElement(BreadcrumbLink, { key: "crumb-".concat(i), breadcrumb: v, href: hrefs === undefined ? undefined : hrefs[i], link: link, query: query },
|
|
19350
|
+
v.icon.type === 'emoji' && React.createElement("span", { className: "notionate-blocks-breadcrumb-emoji" }, v.icon.emoji),
|
|
19351
|
+
v.icon.type !== 'emoji' && React.createElement("img", { className: "notionate-blocks-breadcrumb-icon", src: v.icon.src, width: 20, height: 20, alt: v.name }),
|
|
19352
|
+
React.createElement("span", { className: "notionate-blocks-breadcrumb-title" }, v.name)),
|
|
19339
19353
|
i + 1 < max && React.createElement("span", { className: "notionate-blocks-breadcrumb-slash" }, "/"))); })));
|
|
19340
19354
|
};
|
|
19341
19355
|
|