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/styles/page.css
CHANGED
package/dist/ui/umd/index.js
CHANGED
|
@@ -19317,27 +19317,41 @@
|
|
|
19317
19317
|
React.createElement(TextBlock, { tag: "span", block: block.bookmark.caption }))));
|
|
19318
19318
|
};
|
|
19319
19319
|
|
|
19320
|
+
function buildPathname(id, name, href) {
|
|
19321
|
+
if (href === '/') {
|
|
19322
|
+
return href;
|
|
19323
|
+
}
|
|
19324
|
+
var _a = getLinkPathAndLinkKey(href || ''), path = _a[0], slugKey = _a[1];
|
|
19325
|
+
var file = '';
|
|
19326
|
+
if (slugKey === 'id') {
|
|
19327
|
+
file = id;
|
|
19328
|
+
}
|
|
19329
|
+
else {
|
|
19330
|
+
file = encodeURIComponent(name.toLowerCase()).replace(/%20/g, '-');
|
|
19331
|
+
}
|
|
19332
|
+
return "".concat(path).concat(file);
|
|
19333
|
+
}
|
|
19320
19334
|
var BreadcrumbLink = function (_a) {
|
|
19321
19335
|
var breadcrumb = _a.breadcrumb, link = _a.link, href = _a.href, query = _a.query, children = _a.children;
|
|
19322
19336
|
var id = breadcrumb.id, name = breadcrumb.name;
|
|
19323
|
-
var
|
|
19324
|
-
var file = slugKey === 'id' ? id : encodeURIComponent(name.toLowerCase()).replace(/%20/g, '-');
|
|
19337
|
+
var pathname = buildPathname(id, name, href);
|
|
19325
19338
|
if (link && href) {
|
|
19326
19339
|
var Link = link;
|
|
19327
|
-
return (React.createElement(Link, { className: "notionate-blocks-breadcrumb-a", href: { pathname:
|
|
19340
|
+
return (React.createElement(Link, { className: "notionate-blocks-breadcrumb-a", href: { pathname: pathname, query: query } }, children));
|
|
19328
19341
|
}
|
|
19329
19342
|
if (href) {
|
|
19330
|
-
return (React.createElement("a", { className: "notionate-blocks-breadcrumb-a", href: "".concat(
|
|
19343
|
+
return (React.createElement("a", { className: "notionate-blocks-breadcrumb-a", href: "".concat(pathname).concat(queryToString(query)) }, children));
|
|
19331
19344
|
}
|
|
19332
19345
|
return (React.createElement("span", { className: "notionate-blocks-breadcrumb-a" }, children));
|
|
19333
19346
|
};
|
|
19334
19347
|
var BreadcrumbBlock = function (_a) {
|
|
19335
19348
|
var block = _a.block, link = _a.link, hrefs = _a.hrefs, query = _a.query;
|
|
19336
19349
|
var max = block.list.length;
|
|
19337
|
-
return (React.createElement("div", { className: "notionate-blocks-breadcrumb" }, block.list.map(function (v, i) { return (React.createElement(
|
|
19338
|
-
|
|
19339
|
-
|
|
19340
|
-
|
|
19350
|
+
return (React.createElement("div", { className: "notionate-blocks-breadcrumb" }, block.list.map(function (v, i) { return (React.createElement(React.Fragment, null,
|
|
19351
|
+
React.createElement(BreadcrumbLink, { key: "crumb-".concat(i), breadcrumb: v, href: hrefs === undefined ? undefined : hrefs[i], link: link, query: query },
|
|
19352
|
+
v.icon.type === 'emoji' && React.createElement("span", { className: "notionate-blocks-breadcrumb-emoji" }, v.icon.emoji),
|
|
19353
|
+
v.icon.type !== 'emoji' && React.createElement("img", { className: "notionate-blocks-breadcrumb-icon", src: v.icon.src, width: 20, height: 20, alt: v.name }),
|
|
19354
|
+
React.createElement("span", { className: "notionate-blocks-breadcrumb-title" }, v.name)),
|
|
19341
19355
|
i + 1 < max && React.createElement("span", { className: "notionate-blocks-breadcrumb-slash" }, "/"))); })));
|
|
19342
19356
|
};
|
|
19343
19357
|
|