rotion 0.0.3 → 0.0.5
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/exporter/blocks.js +4 -1
- package/dist/exporter/blocks.js.map +1 -1
- package/dist/exporter/breadcrumbs.d.ts +2 -7
- package/dist/exporter/breadcrumbs.js +94 -78
- package/dist/exporter/breadcrumbs.js.map +1 -1
- package/dist/exporter/database.d.ts +3 -1
- package/dist/exporter/database.js +27 -9
- package/dist/exporter/database.js.map +1 -1
- package/dist/exporter/index.d.ts +1 -0
- package/dist/exporter/index.js +1 -0
- package/dist/exporter/index.js.map +1 -1
- package/dist/exporter/page.d.ts +3 -1
- package/dist/exporter/page.js +24 -16
- package/dist/exporter/page.js.map +1 -1
- package/dist/exporter/types.d.ts +26 -1
- package/dist/ui/cjs/index.js +28 -12
- package/dist/ui/cjs/index.js.map +1 -1
- package/dist/ui/cjs/types/exporter/breadcrumbs.d.ts +7 -0
- package/dist/ui/cjs/types/exporter/database.d.ts +3 -1
- package/dist/ui/cjs/types/exporter/index.d.ts +1 -0
- package/dist/ui/cjs/types/exporter/page.d.ts +3 -1
- package/dist/ui/cjs/types/exporter/types.d.ts +26 -1
- package/dist/ui/cjs/types/ui/components/Page/BreadcrumbBlock/BreadcrumbBlock.d.ts +1 -1
- package/dist/ui/cjs/types/ui/components/Page/BreadcrumbBlock/BreadcrumbBlock.types.d.ts +16 -2
- package/dist/ui/cjs/types/ui/components/Page/Page.d.ts +1 -1
- package/dist/ui/cjs/types/ui/components/Page/Page.types.d.ts +1 -0
- package/dist/ui/cjs/types/ui/components/Page/PageHandler.d.ts +1 -1
- package/dist/ui/cjs/types/ui/components/Page/PageHandler.types.d.ts +1 -0
- package/dist/ui/esm/index.js +28 -12
- package/dist/ui/esm/index.js.map +1 -1
- package/dist/ui/esm/types/exporter/breadcrumbs.d.ts +7 -0
- package/dist/ui/esm/types/exporter/database.d.ts +3 -1
- package/dist/ui/esm/types/exporter/index.d.ts +1 -0
- package/dist/ui/esm/types/exporter/page.d.ts +3 -1
- package/dist/ui/esm/types/exporter/types.d.ts +26 -1
- package/dist/ui/esm/types/ui/components/Page/BreadcrumbBlock/BreadcrumbBlock.d.ts +1 -1
- package/dist/ui/esm/types/ui/components/Page/BreadcrumbBlock/BreadcrumbBlock.types.d.ts +16 -2
- package/dist/ui/esm/types/ui/components/Page/Page.d.ts +1 -1
- package/dist/ui/esm/types/ui/components/Page/Page.types.d.ts +1 -0
- package/dist/ui/esm/types/ui/components/Page/PageHandler.d.ts +1 -1
- package/dist/ui/esm/types/ui/components/Page/PageHandler.types.d.ts +1 -0
- package/dist/ui/styles/page.css +26 -0
- package/dist/ui/types.d.ts +34 -5
- package/dist/ui/umd/index.js +28 -12
- package/dist/ui/umd/index.js.map +1 -1
- package/dist/ui/umd/types/exporter/breadcrumbs.d.ts +7 -0
- package/dist/ui/umd/types/exporter/database.d.ts +3 -1
- package/dist/ui/umd/types/exporter/index.d.ts +1 -0
- package/dist/ui/umd/types/exporter/page.d.ts +3 -1
- package/dist/ui/umd/types/exporter/types.d.ts +26 -1
- package/dist/ui/umd/types/ui/components/Page/BreadcrumbBlock/BreadcrumbBlock.d.ts +1 -1
- package/dist/ui/umd/types/ui/components/Page/BreadcrumbBlock/BreadcrumbBlock.types.d.ts +16 -2
- package/dist/ui/umd/types/ui/components/Page/Page.d.ts +1 -1
- package/dist/ui/umd/types/ui/components/Page/Page.types.d.ts +1 -0
- package/dist/ui/umd/types/ui/components/Page/PageHandler.d.ts +1 -1
- package/dist/ui/umd/types/ui/components/Page/PageHandler.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Breadcrumb } from './types.js';
|
|
2
|
+
export interface FetchBreadcrumbsProps {
|
|
3
|
+
type: 'page_id' | 'database_id' | 'block_id' | 'workspace';
|
|
4
|
+
id: string;
|
|
5
|
+
limit?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const FetchBreadcrumbs: ({ type, id, limit }: FetchBreadcrumbsProps) => Promise<Breadcrumb[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryDatabaseParameters, QueryDatabaseResponseEx } from './types.js';
|
|
1
|
+
import type { QueryDatabaseParameters, QueryDatabaseResponseEx, GetDatabaseResponseEx } from './types.js';
|
|
2
2
|
export interface FetchDatabaseArgs extends QueryDatabaseParameters {
|
|
3
3
|
}
|
|
4
4
|
export interface FetchDatabaseRes extends QueryDatabaseResponseEx {
|
|
@@ -8,3 +8,5 @@ export interface FetchDatabaseRes extends QueryDatabaseResponseEx {
|
|
|
8
8
|
* And create cache that includes filepath of downloaded images.
|
|
9
9
|
*/
|
|
10
10
|
export declare const FetchDatabase: (params: FetchDatabaseArgs) => Promise<FetchDatabaseRes>;
|
|
11
|
+
export declare function saveDatabaseCover(db: GetDatabaseResponseEx): Promise<void>;
|
|
12
|
+
export declare function saveDatabaseIcon(db: GetDatabaseResponseEx): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetPageResponseEx } from './types.js';
|
|
1
|
+
import type { GetPageResponseEx, PageObjectResponseEx } from './types.js';
|
|
2
2
|
export interface FetchPageArgs {
|
|
3
3
|
page_id: string;
|
|
4
4
|
last_edited_time?: string;
|
|
@@ -11,3 +11,5 @@ export interface FetchPageRes extends GetPageResponseEx {
|
|
|
11
11
|
* The last_edited_time of 2nd args is for ROTION_INCREMENTAL_CACHE.
|
|
12
12
|
*/
|
|
13
13
|
export declare const FetchPage: ({ page_id, last_edited_time }: FetchPageArgs) => Promise<FetchPageRes>;
|
|
14
|
+
export declare function savePageCover(page: GetPageResponseEx | PageObjectResponseEx): Promise<void>;
|
|
15
|
+
export declare function savePageIcon(page: GetPageResponseEx | PageObjectResponseEx): Promise<void>;
|
|
@@ -208,7 +208,15 @@ export type ParagraphBlockObjectResponseEx = ParagraphBlockObjectResponse & {
|
|
|
208
208
|
color: SelectColor;
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
|
-
export type
|
|
211
|
+
export type Breadcrumb = {
|
|
212
|
+
id: string;
|
|
213
|
+
name: string;
|
|
214
|
+
icon: MentionIcon;
|
|
215
|
+
};
|
|
216
|
+
export type BreadcrumbBlockObjectResponseEx = BreadcrumbBlockObjectResponse & {
|
|
217
|
+
list: Breadcrumb[];
|
|
218
|
+
};
|
|
219
|
+
export type BlockObjectResponse = ParagraphBlockObjectResponseEx | Heading1BlockObjectResponse | Heading2BlockObjectResponse | Heading3BlockObjectResponse | BulletedListItemBlockObjectResponseEx | NumberedListItemBlockObjectResponseEx | QuoteBlockObjectResponse | ToDoBlockObjectResponse | ToggleBlockObjectResponseEx | TemplateBlockObjectResponse | SyncedBlockBlockObjectResponse | ChildPageBlockObjectResponseEx | ChildDatabaseBlockObjectResponseEx | EquationBlockObjectResponse | CodeBlockObjectResponse | CalloutBlockObjectResponseEx | DividerBlockObjectResponse | BreadcrumbBlockObjectResponseEx | TableOfContentsBlockObjectResponse | ColumnListBlockObjectResponseEx | ColumnBlockObjectResponse | LinkToPageBlockObjectResponse | TableBlockObjectResponseEx | TableRowBlockObjectResponse | EmbedBlockObjectResponseEx | BookmarkBlockObjectResponseEx | ImageBlockObjectResponseEx | VideoBlockObjectResponseEx | PdfBlockObjectResponse | FileBlockObjectResponse | AudioBlockObjectResponse | LinkPreviewBlockObjectResponse | UnsupportedBlockObjectResponse;
|
|
212
220
|
export type ListBlockChildrenResponseEx = ListBlockChildrenResponse & {
|
|
213
221
|
results: Array<BlockObjectResponse>;
|
|
214
222
|
children?: ListBlockChildrenResponse;
|
|
@@ -450,6 +458,23 @@ export type PageObjectResponseEx = PageObjectResponse & {
|
|
|
450
458
|
expiry_time: string;
|
|
451
459
|
};
|
|
452
460
|
} | null;
|
|
461
|
+
icon: {
|
|
462
|
+
type: 'emoji';
|
|
463
|
+
emoji: EmojiRequest;
|
|
464
|
+
} | {
|
|
465
|
+
src: string;
|
|
466
|
+
type: 'external';
|
|
467
|
+
external: {
|
|
468
|
+
url: TextRequest;
|
|
469
|
+
};
|
|
470
|
+
} | {
|
|
471
|
+
src: string;
|
|
472
|
+
type: 'file';
|
|
473
|
+
file: {
|
|
474
|
+
url: string;
|
|
475
|
+
expiry_time: string;
|
|
476
|
+
};
|
|
477
|
+
} | null;
|
|
453
478
|
};
|
|
454
479
|
export type GetDatabaseResponseEx = DatabaseObjectResponse & {
|
|
455
480
|
icon: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BreadcrumbBlockProps } from './BreadcrumbBlock.types';
|
|
3
|
-
declare const BreadcrumbBlock: ({ block }: BreadcrumbBlockProps) => React.JSX.Element;
|
|
3
|
+
declare const BreadcrumbBlock: ({ block, link, hrefs, query }: BreadcrumbBlockProps) => React.JSX.Element;
|
|
4
4
|
export default BreadcrumbBlock;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { ParsedUrlQueryInput } from 'node:querystring';
|
|
4
|
+
import type { Link } from '../../types';
|
|
5
|
+
import type { Breadcrumb, BreadcrumbBlockObjectResponseEx } from '../../../../exporter';
|
|
6
|
+
export interface BreadcrumbLinkProps {
|
|
7
|
+
breadcrumb: Breadcrumb;
|
|
8
|
+
link?: Link;
|
|
9
|
+
href?: string;
|
|
10
|
+
query?: ParsedUrlQueryInput;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
2
13
|
export interface BreadcrumbBlockProps {
|
|
3
|
-
block:
|
|
14
|
+
block: BreadcrumbBlockObjectResponseEx;
|
|
15
|
+
link?: Link;
|
|
16
|
+
hrefs?: string[];
|
|
17
|
+
query?: ParsedUrlQueryInput;
|
|
4
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PageProps } from './Page.types';
|
|
3
|
-
export declare const Page: ({ blocks, href, link, query, modules }: PageProps) => React.JSX.Element;
|
|
3
|
+
export declare const Page: ({ blocks, href, link, query, modules, breadcrumb_hrefs }: PageProps) => React.JSX.Element;
|
|
4
4
|
export default Page;
|
|
@@ -11,5 +11,5 @@ export declare const blockType: {
|
|
|
11
11
|
code: string;
|
|
12
12
|
quote: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const PageHandler: ({ block, href, link, query, modules }: HandlerProps) => React.JSX.Element;
|
|
14
|
+
export declare const PageHandler: ({ block, href, link, query, modules, breadcrumb_hrefs }: HandlerProps) => React.JSX.Element;
|
|
15
15
|
export default PageHandler;
|
package/dist/ui/styles/page.css
CHANGED
|
@@ -89,6 +89,32 @@
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/* breadcrumb */
|
|
93
|
+
.notionate-blocks-breadcrumb {
|
|
94
|
+
padding-left: .5rem;
|
|
95
|
+
}
|
|
96
|
+
.notionate-blocks-breadcrumb-a {
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
color: #333;
|
|
99
|
+
font-size: .9rem;
|
|
100
|
+
padding: .2rem .3rem;
|
|
101
|
+
border-radius: 4px;
|
|
102
|
+
}
|
|
103
|
+
.notionate-blocks-breadcrumb-a:hover {
|
|
104
|
+
color: #666;
|
|
105
|
+
background-color: #fff;
|
|
106
|
+
}
|
|
107
|
+
.notionate-blocks-breadcrumb-icon {
|
|
108
|
+
vertical-align: middle;
|
|
109
|
+
padding-right: .4rem;
|
|
110
|
+
padding-bottom: .2rem;
|
|
111
|
+
}
|
|
112
|
+
.notionate-blocks-breadcrumb-slash {
|
|
113
|
+
font-size: .9rem;
|
|
114
|
+
opacity: .5;
|
|
115
|
+
padding: 0 .3rem;
|
|
116
|
+
}
|
|
117
|
+
|
|
92
118
|
/* callout */
|
|
93
119
|
.notionate-blocks-callout {
|
|
94
120
|
display: flex;
|
package/dist/ui/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ListBlockChildrenResponse, BulletedListItemBlockObjectResponse, NumberedListItemBlockObjectResponse, TableBlockObjectResponse, ToggleBlockObjectResponse, ColumnListBlockObjectResponse, ChildPageBlockObjectResponse, ChildDatabaseBlockObjectResponse, BookmarkBlockObjectResponse, RichTextItemResponse, CalloutBlockObjectResponse, ImageBlockObjectResponse, VideoBlockObjectResponse, EmbedBlockObjectResponse, TextRichTextItemResponse, EquationRichTextItemResponse, Heading1BlockObjectResponse, Heading2BlockObjectResponse, Heading3BlockObjectResponse, QuoteBlockObjectResponse, ToDoBlockObjectResponse, TemplateBlockObjectResponse, SyncedBlockBlockObjectResponse, EquationBlockObjectResponse, CodeBlockObjectResponse, DividerBlockObjectResponse,
|
|
2
|
+
import { ListBlockChildrenResponse, BulletedListItemBlockObjectResponse, NumberedListItemBlockObjectResponse, TableBlockObjectResponse, ToggleBlockObjectResponse, ColumnListBlockObjectResponse, ChildPageBlockObjectResponse, ChildDatabaseBlockObjectResponse, BookmarkBlockObjectResponse, RichTextItemResponse, CalloutBlockObjectResponse, ImageBlockObjectResponse, VideoBlockObjectResponse, EmbedBlockObjectResponse, TextRichTextItemResponse, EquationRichTextItemResponse, BreadcrumbBlockObjectResponse, Heading1BlockObjectResponse, Heading2BlockObjectResponse, Heading3BlockObjectResponse, QuoteBlockObjectResponse, ToDoBlockObjectResponse, TemplateBlockObjectResponse, SyncedBlockBlockObjectResponse, EquationBlockObjectResponse, CodeBlockObjectResponse, DividerBlockObjectResponse, TableOfContentsBlockObjectResponse, ColumnBlockObjectResponse, LinkToPageBlockObjectResponse, TableRowBlockObjectResponse, PdfBlockObjectResponse, FileBlockObjectResponse, AudioBlockObjectResponse, LinkPreviewBlockObjectResponse, UnsupportedBlockObjectResponse, PageObjectResponse, GetPagePropertyResponse, DatabaseObjectResponse, QueryDatabaseResponse, MentionRichTextItemResponse, ParagraphBlockObjectResponse, GetSelfResponse, MultiSelectPropertyItemObjectResponse, NumberPropertyItemObjectResponse, RichTextPropertyItemObjectResponse, TitlePropertyItemObjectResponse, SelectPropertyItemObjectResponse } from '@notionhq/client/build/src/api-endpoints.js';
|
|
3
3
|
import { ParsedUrlQueryInput } from 'node:querystring';
|
|
4
4
|
import { UrlObject } from 'node:url';
|
|
5
5
|
|
|
@@ -174,7 +174,15 @@ type ParagraphBlockObjectResponseEx = ParagraphBlockObjectResponse & {
|
|
|
174
174
|
color: SelectColor;
|
|
175
175
|
};
|
|
176
176
|
};
|
|
177
|
-
type
|
|
177
|
+
type Breadcrumb = {
|
|
178
|
+
id: string;
|
|
179
|
+
name: string;
|
|
180
|
+
icon: MentionIcon;
|
|
181
|
+
};
|
|
182
|
+
type BreadcrumbBlockObjectResponseEx = BreadcrumbBlockObjectResponse & {
|
|
183
|
+
list: Breadcrumb[];
|
|
184
|
+
};
|
|
185
|
+
type BlockObjectResponse = ParagraphBlockObjectResponseEx | Heading1BlockObjectResponse | Heading2BlockObjectResponse | Heading3BlockObjectResponse | BulletedListItemBlockObjectResponseEx | NumberedListItemBlockObjectResponseEx | QuoteBlockObjectResponse | ToDoBlockObjectResponse | ToggleBlockObjectResponseEx | TemplateBlockObjectResponse | SyncedBlockBlockObjectResponse | ChildPageBlockObjectResponseEx | ChildDatabaseBlockObjectResponseEx | EquationBlockObjectResponse | CodeBlockObjectResponse | CalloutBlockObjectResponseEx | DividerBlockObjectResponse | BreadcrumbBlockObjectResponseEx | TableOfContentsBlockObjectResponse | ColumnListBlockObjectResponseEx | ColumnBlockObjectResponse | LinkToPageBlockObjectResponse | TableBlockObjectResponseEx | TableRowBlockObjectResponse | EmbedBlockObjectResponseEx | BookmarkBlockObjectResponseEx | ImageBlockObjectResponseEx | VideoBlockObjectResponseEx | PdfBlockObjectResponse | FileBlockObjectResponse | AudioBlockObjectResponse | LinkPreviewBlockObjectResponse | UnsupportedBlockObjectResponse;
|
|
178
186
|
type ListBlockChildrenResponseEx = ListBlockChildrenResponse & {
|
|
179
187
|
results: Array<BlockObjectResponse>;
|
|
180
188
|
children?: ListBlockChildrenResponse;
|
|
@@ -233,6 +241,23 @@ type PageObjectResponseEx = PageObjectResponse & {
|
|
|
233
241
|
expiry_time: string;
|
|
234
242
|
};
|
|
235
243
|
} | null;
|
|
244
|
+
icon: {
|
|
245
|
+
type: 'emoji';
|
|
246
|
+
emoji: EmojiRequest;
|
|
247
|
+
} | {
|
|
248
|
+
src: string;
|
|
249
|
+
type: 'external';
|
|
250
|
+
external: {
|
|
251
|
+
url: TextRequest;
|
|
252
|
+
};
|
|
253
|
+
} | {
|
|
254
|
+
src: string;
|
|
255
|
+
type: 'file';
|
|
256
|
+
file: {
|
|
257
|
+
url: string;
|
|
258
|
+
expiry_time: string;
|
|
259
|
+
};
|
|
260
|
+
} | null;
|
|
236
261
|
};
|
|
237
262
|
type GetDatabaseResponseEx = DatabaseObjectResponse & {
|
|
238
263
|
icon: {
|
|
@@ -494,9 +519,10 @@ interface PageProps {
|
|
|
494
519
|
link?: Link;
|
|
495
520
|
query?: ParsedUrlQueryInput;
|
|
496
521
|
modules?: ExternalModules;
|
|
522
|
+
breadcrumb_hrefs?: string[];
|
|
497
523
|
}
|
|
498
524
|
|
|
499
|
-
declare const Page: ({ blocks, href, link, query, modules }: PageProps) => React.JSX.Element;
|
|
525
|
+
declare const Page: ({ blocks, href, link, query, modules, breadcrumb_hrefs }: PageProps) => React.JSX.Element;
|
|
500
526
|
|
|
501
527
|
interface BookmarkBlockProps {
|
|
502
528
|
block: BookmarkBlockObjectResponseEx;
|
|
@@ -505,10 +531,13 @@ interface BookmarkBlockProps {
|
|
|
505
531
|
declare const BookmarkBlock: ({ block }: BookmarkBlockProps) => React.JSX.Element;
|
|
506
532
|
|
|
507
533
|
interface BreadcrumbBlockProps {
|
|
508
|
-
block:
|
|
534
|
+
block: BreadcrumbBlockObjectResponseEx;
|
|
535
|
+
link?: Link;
|
|
536
|
+
hrefs?: string[];
|
|
537
|
+
query?: ParsedUrlQueryInput;
|
|
509
538
|
}
|
|
510
539
|
|
|
511
|
-
declare const BreadcrumbBlock: ({ block }: BreadcrumbBlockProps) => React.JSX.Element;
|
|
540
|
+
declare const BreadcrumbBlock: ({ block, link, hrefs, query }: BreadcrumbBlockProps) => React.JSX.Element;
|
|
512
541
|
|
|
513
542
|
interface BulletedListBlocksProps {
|
|
514
543
|
block: BulletedListItemBlockObjectResponseEx;
|
package/dist/ui/umd/index.js
CHANGED
|
@@ -19317,11 +19317,28 @@
|
|
|
19317
19317
|
React.createElement(TextBlock, { tag: "span", block: block.bookmark.caption }))));
|
|
19318
19318
|
};
|
|
19319
19319
|
|
|
19320
|
-
|
|
19320
|
+
var BreadcrumbLink = function (_a) {
|
|
19321
|
+
var breadcrumb = _a.breadcrumb, link = _a.link, href = _a.href, query = _a.query, children = _a.children;
|
|
19322
|
+
var id = breadcrumb.id, name = breadcrumb.name;
|
|
19323
|
+
var _b = getLinkPathAndLinkKey(href || ''), path = _b[0], slugKey = _b[1];
|
|
19324
|
+
var file = slugKey === 'id' ? id : encodeURIComponent(name.toLowerCase()).replace(/%20/g, '-');
|
|
19325
|
+
if (link && href) {
|
|
19326
|
+
var Link = link;
|
|
19327
|
+
return (React.createElement(Link, { className: "notionate-blocks-breadcrumb-a", href: { pathname: "".concat(path).concat(file), query: query } }, children));
|
|
19328
|
+
}
|
|
19329
|
+
if (href) {
|
|
19330
|
+
return (React.createElement("a", { className: "notionate-blocks-breadcrumb-a", href: "".concat(path).concat(file).concat(queryToString(query)) }, children));
|
|
19331
|
+
}
|
|
19332
|
+
return (React.createElement("span", { className: "notionate-blocks-breadcrumb-a" }, children));
|
|
19333
|
+
};
|
|
19321
19334
|
var BreadcrumbBlock = function (_a) {
|
|
19322
|
-
var block = _a.block;
|
|
19323
|
-
var
|
|
19324
|
-
return (React.createElement("div", { className: "notionate-blocks-breadcrumb" },
|
|
19335
|
+
var block = _a.block, link = _a.link, hrefs = _a.hrefs, query = _a.query;
|
|
19336
|
+
var max = block.list.length;
|
|
19337
|
+
return (React.createElement("div", { className: "notionate-blocks-breadcrumb" }, block.list.map(function (v, i) { return (React.createElement(BreadcrumbLink, { key: "crumb-".concat(i), breadcrumb: v, href: hrefs === undefined ? undefined : hrefs[i], link: link, query: query },
|
|
19338
|
+
v.icon.type === 'emoji' && React.createElement("span", { className: "notionate-blocks-breadcrumb-emoji" }, v.icon.emoji),
|
|
19339
|
+
v.icon.type !== 'emoji' && React.createElement("img", { className: "notionate-blocks-breadcrumb-icon", src: v.icon.src, width: 20, height: 20, alt: v.name }),
|
|
19340
|
+
React.createElement("span", { className: "notionate-blocks-breadcrumb-title" }, v.name),
|
|
19341
|
+
i + 1 < max && React.createElement("span", { className: "notionate-blocks-breadcrumb-slash" }, "/"))); })));
|
|
19325
19342
|
};
|
|
19326
19343
|
|
|
19327
19344
|
var BulletedListBlocks = function (_a) {
|
|
@@ -19818,9 +19835,9 @@
|
|
|
19818
19835
|
};
|
|
19819
19836
|
|
|
19820
19837
|
var blockType = {
|
|
19821
|
-
heading_1: '
|
|
19822
|
-
heading_2: '
|
|
19823
|
-
heading_3: '
|
|
19838
|
+
heading_1: 'h2',
|
|
19839
|
+
heading_2: 'h3',
|
|
19840
|
+
heading_3: 'h4',
|
|
19824
19841
|
bulleted_list_item: 'li',
|
|
19825
19842
|
numbered_list_item: 'li',
|
|
19826
19843
|
divider: 'hr',
|
|
@@ -19830,13 +19847,12 @@
|
|
|
19830
19847
|
};
|
|
19831
19848
|
var PageHandler = function (_a) {
|
|
19832
19849
|
var _b;
|
|
19833
|
-
var block = _a.block, href = _a.href, link = _a.link, query = _a.query, modules = _a.modules;
|
|
19850
|
+
var block = _a.block, href = _a.href, link = _a.link, query = _a.query, modules = _a.modules, breadcrumb_hrefs = _a.breadcrumb_hrefs;
|
|
19834
19851
|
switch (block.type) {
|
|
19835
19852
|
case 'bookmark':
|
|
19836
19853
|
return React.createElement(BookmarkBlock, { block: block, key: block.id });
|
|
19837
19854
|
case 'breadcrumb':
|
|
19838
|
-
|
|
19839
|
-
return React.createElement(BreadcrumbBlock, { block: block, key: block.id });
|
|
19855
|
+
return React.createElement(BreadcrumbBlock, { block: block, hrefs: breadcrumb_hrefs, link: link, query: query, key: block.id });
|
|
19840
19856
|
case 'bulleted_list_item':
|
|
19841
19857
|
return React.createElement(BulletedListBlocks, { block: block, key: block.id });
|
|
19842
19858
|
case 'callout':
|
|
@@ -19908,7 +19924,7 @@
|
|
|
19908
19924
|
};
|
|
19909
19925
|
|
|
19910
19926
|
var Page = function (_a) {
|
|
19911
|
-
var blocks = _a.blocks, href = _a.href, link = _a.link, query = _a.query, modules = _a.modules;
|
|
19927
|
+
var blocks = _a.blocks, href = _a.href, link = _a.link, query = _a.query, modules = _a.modules, breadcrumb_hrefs = _a.breadcrumb_hrefs;
|
|
19912
19928
|
var results = blocks.results;
|
|
19913
19929
|
var listType = {
|
|
19914
19930
|
bulleted_list_item: 'ul',
|
|
@@ -19943,7 +19959,7 @@
|
|
|
19943
19959
|
}
|
|
19944
19960
|
}
|
|
19945
19961
|
else {
|
|
19946
|
-
var elem = PageHandler({ block: block, href: href, link: link, query: query, modules: modules });
|
|
19962
|
+
var elem = PageHandler({ block: block, href: href, link: link, query: query, modules: modules, breadcrumb_hrefs: breadcrumb_hrefs });
|
|
19947
19963
|
if (elem !== undefined) {
|
|
19948
19964
|
children.push(elem);
|
|
19949
19965
|
}
|