notion-to-jsx 1.2.7 → 1.2.8
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/index.css +110 -22
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +192 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +178 -153
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// src/components/Renderer/index.tsx
|
|
38
|
-
var
|
|
38
|
+
var import_react7 = __toESM(require("react"));
|
|
39
39
|
|
|
40
40
|
// src/components/Renderer/styles.css.ts
|
|
41
41
|
var container = "styles_container__epva5u0";
|
|
@@ -83,7 +83,7 @@ var RichTexts = ({ richTexts }) => {
|
|
|
83
83
|
case "text": {
|
|
84
84
|
if (text.text) {
|
|
85
85
|
const { text: textData } = text;
|
|
86
|
-
content3 = textData.link ? renderLink(textData.link, textData.content) : textData.content;
|
|
86
|
+
content3 = textData.link?.url ? renderLink(textData.link.url, textData.content) : textData.content;
|
|
87
87
|
} else {
|
|
88
88
|
content3 = text.plain_text;
|
|
89
89
|
}
|
|
@@ -143,15 +143,88 @@ var import_react = require("react");
|
|
|
143
143
|
|
|
144
144
|
// src/components/Renderer/components/Image/styles.css.ts
|
|
145
145
|
var import_createRuntimeFn3 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
146
|
-
var caption = "
|
|
146
|
+
var caption = "styles_caption__2f3ncf7";
|
|
147
147
|
var imageContainer = "styles_imageContainer__2f3ncf0";
|
|
148
|
-
var
|
|
149
|
-
var
|
|
150
|
-
var
|
|
148
|
+
var imageStyle = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "styles_imageStyle__2f3ncf2", variantClassNames: { loaded: { true: "styles_imageStyle_loaded_true__2f3ncf3", false: "styles_imageStyle_loaded_false__2f3ncf4" }, hasAspectRatio: { true: "styles_imageStyle_hasAspectRatio_true__2f3ncf5", false: "styles_imageStyle_hasAspectRatio_false__2f3ncf6" } }, defaultVariants: { loaded: false, hasAspectRatio: false }, compoundVariants: [] });
|
|
149
|
+
var imageWrapper = "styles_imageWrapper__2f3ncf1";
|
|
150
|
+
var skeletonWrapper = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "styles_skeletonWrapper__2f3ncf8", variantClassNames: { isLoaded: { true: "styles_skeletonWrapper_isLoaded_true__2f3ncf9", false: "styles_skeletonWrapper_isLoaded_false__2f3ncfa" } }, defaultVariants: { isLoaded: false }, compoundVariants: [] });
|
|
151
151
|
|
|
152
|
-
// src/components/
|
|
152
|
+
// src/components/Skeleton/styles.css.ts
|
|
153
|
+
var circle = "styles_circle__a3g8q93";
|
|
154
|
+
var image = "styles_image__a3g8q94";
|
|
155
|
+
var rect = "styles_rect__a3g8q92";
|
|
156
|
+
var skeleton = "styles_skeleton__a3g8q91";
|
|
157
|
+
|
|
158
|
+
// src/components/Skeleton/index.tsx
|
|
153
159
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
160
|
+
var Skeleton = ({
|
|
161
|
+
variant = "rect",
|
|
162
|
+
width,
|
|
163
|
+
height,
|
|
164
|
+
className
|
|
165
|
+
}) => {
|
|
166
|
+
const getVariantClass = () => {
|
|
167
|
+
switch (variant) {
|
|
168
|
+
case "circle":
|
|
169
|
+
return circle;
|
|
170
|
+
case "image":
|
|
171
|
+
return image;
|
|
172
|
+
case "rect":
|
|
173
|
+
default:
|
|
174
|
+
return rect;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
className: `${skeleton} ${getVariantClass()} ${className || ""}`,
|
|
181
|
+
style: {
|
|
182
|
+
width: width || void 0,
|
|
183
|
+
height: height || void 0
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
var Skeleton_default = Skeleton;
|
|
189
|
+
|
|
190
|
+
// src/components/Renderer/components/Image/Image.tsx
|
|
191
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
154
192
|
var MAX_WIDTH = 720;
|
|
193
|
+
var getImageTagStyle = (format) => {
|
|
194
|
+
return format?.block_aspect_ratio ? { aspectRatio: `${format.block_aspect_ratio}` } : void 0;
|
|
195
|
+
};
|
|
196
|
+
var Image = ({
|
|
197
|
+
src,
|
|
198
|
+
alt,
|
|
199
|
+
caption: imageCaption,
|
|
200
|
+
format,
|
|
201
|
+
isColumn = false
|
|
202
|
+
}) => {
|
|
203
|
+
const [isLoaded, setIsLoaded] = (0, import_react.useState)(false);
|
|
204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: imageContainer, children: [
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: imageWrapper, style: getImageStyles(format, isColumn), children: [
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: skeletonWrapper({ isLoaded }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Skeleton_default, { variant: "image" }) }),
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
208
|
+
"img",
|
|
209
|
+
{
|
|
210
|
+
className: imageStyle({
|
|
211
|
+
loaded: isLoaded,
|
|
212
|
+
hasAspectRatio: !!format?.block_aspect_ratio
|
|
213
|
+
}),
|
|
214
|
+
src,
|
|
215
|
+
alt,
|
|
216
|
+
loading: "lazy",
|
|
217
|
+
onLoad: () => setIsLoaded(true),
|
|
218
|
+
width: format?.block_width,
|
|
219
|
+
height: format?.block_height,
|
|
220
|
+
style: getImageTagStyle(format)
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] }),
|
|
224
|
+
imageCaption && imageCaption.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("figcaption", { className: caption, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(MemoizedRichText, { richTexts: imageCaption }) })
|
|
225
|
+
] });
|
|
226
|
+
};
|
|
227
|
+
var Image_default = Image;
|
|
155
228
|
var getImageStyles = (format, isColumn = false) => {
|
|
156
229
|
const getWidthStyle = () => {
|
|
157
230
|
if (!isColumn && format?.block_aspect_ratio && format.block_aspect_ratio < 1) {
|
|
@@ -170,73 +243,6 @@ var getImageStyles = (format, isColumn = false) => {
|
|
|
170
243
|
aspectRatio: getAspectRatioStyle()
|
|
171
244
|
};
|
|
172
245
|
};
|
|
173
|
-
var getImageTagStyle = (format) => {
|
|
174
|
-
return format?.block_aspect_ratio ? { aspectRatio: `${format.block_aspect_ratio}` } : void 0;
|
|
175
|
-
};
|
|
176
|
-
var Image = ({
|
|
177
|
-
src,
|
|
178
|
-
alt,
|
|
179
|
-
caption: imageCaption,
|
|
180
|
-
format,
|
|
181
|
-
isColumn = false
|
|
182
|
-
}) => {
|
|
183
|
-
const [isLoaded, setIsLoaded] = (0, import_react.useState)(false);
|
|
184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: imageContainer, children: [
|
|
185
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
186
|
-
"div",
|
|
187
|
-
{
|
|
188
|
-
className: imageWrapper({
|
|
189
|
-
hasWidth: !!format?.block_width
|
|
190
|
-
}),
|
|
191
|
-
style: getImageStyles(format, isColumn),
|
|
192
|
-
children: [
|
|
193
|
-
!isLoaded && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: placeholder, style: getImageStyles(format, isColumn), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
194
|
-
"svg",
|
|
195
|
-
{
|
|
196
|
-
width: "38",
|
|
197
|
-
height: "38",
|
|
198
|
-
viewBox: "0 0 38 38",
|
|
199
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
200
|
-
stroke: "#888",
|
|
201
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("g", { fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("g", { transform: "translate(1 1)", strokeWidth: "2", children: [
|
|
202
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("circle", { strokeOpacity: ".5", cx: "18", cy: "18", r: "18" }),
|
|
203
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M36 18c0-9.94-8.06-18-18-18", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
204
|
-
"animateTransform",
|
|
205
|
-
{
|
|
206
|
-
attributeName: "transform",
|
|
207
|
-
type: "rotate",
|
|
208
|
-
from: "0 18 18",
|
|
209
|
-
to: "360 18 18",
|
|
210
|
-
dur: "1s",
|
|
211
|
-
repeatCount: "indefinite"
|
|
212
|
-
}
|
|
213
|
-
) })
|
|
214
|
-
] }) })
|
|
215
|
-
}
|
|
216
|
-
) }),
|
|
217
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
218
|
-
"img",
|
|
219
|
-
{
|
|
220
|
-
className: styledImage({
|
|
221
|
-
loaded: isLoaded,
|
|
222
|
-
hasAspectRatio: !!format?.block_aspect_ratio
|
|
223
|
-
}),
|
|
224
|
-
src,
|
|
225
|
-
alt,
|
|
226
|
-
loading: "lazy",
|
|
227
|
-
onLoad: () => setIsLoaded(true),
|
|
228
|
-
width: format?.block_width,
|
|
229
|
-
height: format?.block_height,
|
|
230
|
-
style: getImageTagStyle(format)
|
|
231
|
-
}
|
|
232
|
-
)
|
|
233
|
-
]
|
|
234
|
-
}
|
|
235
|
-
),
|
|
236
|
-
imageCaption && imageCaption.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("figcaption", { className: caption, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MemoizedRichText, { richTexts: imageCaption }) })
|
|
237
|
-
] });
|
|
238
|
-
};
|
|
239
|
-
var Image_default = Image;
|
|
240
246
|
|
|
241
247
|
// src/components/Renderer/components/Bookmark/styles.css.ts
|
|
242
248
|
var card = "styles_card__qrq8yf1";
|
|
@@ -251,20 +257,20 @@ var title = "styles_title__qrq8yf5";
|
|
|
251
257
|
var urlText = "styles_urlText__qrq8yf9";
|
|
252
258
|
|
|
253
259
|
// src/components/Renderer/components/Bookmark/Bookmark.tsx
|
|
254
|
-
var
|
|
260
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
255
261
|
var Bookmark = ({ url, metadata }) => {
|
|
256
|
-
return /* @__PURE__ */ (0,
|
|
257
|
-
/* @__PURE__ */ (0,
|
|
258
|
-
/* @__PURE__ */ (0,
|
|
259
|
-
/* @__PURE__ */ (0,
|
|
260
|
-
/* @__PURE__ */ (0,
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: link2, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: card, children: [
|
|
263
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: content, children: [
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
265
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h4", { className: title, children: metadata?.title || url }),
|
|
266
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: description, children: metadata?.description || "" })
|
|
261
267
|
] }),
|
|
262
|
-
/* @__PURE__ */ (0,
|
|
263
|
-
metadata?.favicon && /* @__PURE__ */ (0,
|
|
264
|
-
/* @__PURE__ */ (0,
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: siteName, children: [
|
|
269
|
+
metadata?.favicon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src: metadata.favicon, alt: "", className: favicon }),
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: urlText, children: metadata?.url || "" })
|
|
265
271
|
] })
|
|
266
272
|
] }),
|
|
267
|
-
metadata?.image && /* @__PURE__ */ (0,
|
|
273
|
+
metadata?.image && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: previewContainer, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
268
274
|
"img",
|
|
269
275
|
{
|
|
270
276
|
className: previewImage,
|
|
@@ -296,7 +302,7 @@ var preview = "styles_preview__o1p3m11";
|
|
|
296
302
|
var title2 = "styles_title__o1p3m15";
|
|
297
303
|
|
|
298
304
|
// src/components/Renderer/components/LinkPreview/LinkPreview.tsx
|
|
299
|
-
var
|
|
305
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
300
306
|
var fetchGitHubRepoData = async (repoPath) => {
|
|
301
307
|
try {
|
|
302
308
|
const apiUrl = `https://api.github.com/repos/${repoPath}`;
|
|
@@ -443,7 +449,7 @@ var LinkPreview = ({ url }) => {
|
|
|
443
449
|
}, [url]);
|
|
444
450
|
const repoName = repoData?.name || extractRepoPathFromUrl(url)?.split("/")[1] || "Repository";
|
|
445
451
|
const updatedTimeText = repoData?.updated_at ? formatUpdatedTime(repoData.updated_at) : "";
|
|
446
|
-
return /* @__PURE__ */ (0,
|
|
452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
447
453
|
"a",
|
|
448
454
|
{
|
|
449
455
|
href: url,
|
|
@@ -452,8 +458,8 @@ var LinkPreview = ({ url }) => {
|
|
|
452
458
|
className: link3,
|
|
453
459
|
children: linkType === "figma" && figmaData ? (
|
|
454
460
|
// Figma 프리뷰 렌더링
|
|
455
|
-
/* @__PURE__ */ (0,
|
|
456
|
-
/* @__PURE__ */ (0,
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: preview, children: [
|
|
462
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: iconContainer, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
457
463
|
"img",
|
|
458
464
|
{
|
|
459
465
|
src: figmaData.thumbnailUrl || "https://static.figma.com/app/icon/1/favicon.svg",
|
|
@@ -461,15 +467,15 @@ var LinkPreview = ({ url }) => {
|
|
|
461
467
|
className: icon
|
|
462
468
|
}
|
|
463
469
|
) }),
|
|
464
|
-
/* @__PURE__ */ (0,
|
|
465
|
-
/* @__PURE__ */ (0,
|
|
466
|
-
/* @__PURE__ */ (0,
|
|
470
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: content2, children: [
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: title2, children: figmaData.name }),
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: description2, children: "www.figma.com" })
|
|
467
473
|
] })
|
|
468
474
|
] })
|
|
469
475
|
) : linkType === "github" ? (
|
|
470
476
|
// GitHub 프리뷰 렌더링
|
|
471
|
-
/* @__PURE__ */ (0,
|
|
472
|
-
/* @__PURE__ */ (0,
|
|
477
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `${preview} ${githubPreview}`, children: [
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: iconContainer, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
473
479
|
"img",
|
|
474
480
|
{
|
|
475
481
|
src: repoData?.owner?.avatar_url || "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
|
|
@@ -477,14 +483,14 @@ var LinkPreview = ({ url }) => {
|
|
|
477
483
|
className: icon
|
|
478
484
|
}
|
|
479
485
|
) }),
|
|
480
|
-
/* @__PURE__ */ (0,
|
|
481
|
-
/* @__PURE__ */ (0,
|
|
482
|
-
/* @__PURE__ */ (0,
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `${content2} ${githubContent}`, children: [
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: title2, children: repoName }),
|
|
488
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: description2, children: loading ? "Loading..." : `${repoName} \u2022 ${updatedTimeText}` })
|
|
483
489
|
] })
|
|
484
490
|
] })
|
|
485
491
|
) : (
|
|
486
492
|
// 기본 링크 프리뷰 렌더링
|
|
487
|
-
/* @__PURE__ */ (0,
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: preview, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: content2, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: title2, children: url }) }) })
|
|
488
494
|
)
|
|
489
495
|
}
|
|
490
496
|
);
|
|
@@ -515,16 +521,16 @@ var MemoizedLinkPreview = import_react3.default.memo(
|
|
|
515
521
|
);
|
|
516
522
|
|
|
517
523
|
// src/components/Renderer/components/List/ListBlocksRenderer.tsx
|
|
518
|
-
var
|
|
524
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
519
525
|
var RecursiveListItem = ({ block, index }) => {
|
|
520
526
|
const blockProps = {
|
|
521
527
|
tabIndex: 0
|
|
522
528
|
};
|
|
523
529
|
const blockType = block.type;
|
|
524
530
|
const richTexts = block[blockType]?.rich_text;
|
|
525
|
-
return /* @__PURE__ */ (0,
|
|
526
|
-
/* @__PURE__ */ (0,
|
|
527
|
-
block.children && block.children.length > 0 && /* @__PURE__ */ (0,
|
|
531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ListItem, { ...blockProps, children: [
|
|
532
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MemoizedRichText, { richTexts }),
|
|
533
|
+
block.children && block.children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
528
534
|
RecursiveListGroup,
|
|
529
535
|
{
|
|
530
536
|
blocks: block.children,
|
|
@@ -539,14 +545,14 @@ var RecursiveListGroup = ({ blocks, type }) => {
|
|
|
539
545
|
(block) => block.type === `${type}_list_item`
|
|
540
546
|
);
|
|
541
547
|
if (listItems.length === 0) return null;
|
|
542
|
-
return /* @__PURE__ */ (0,
|
|
548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
543
549
|
List,
|
|
544
550
|
{
|
|
545
551
|
as: type === "numbered" ? "ol" : "ul",
|
|
546
552
|
type,
|
|
547
553
|
role: "list",
|
|
548
554
|
"aria-label": type === "bulleted" ? "Bulleted list" : "Numbered list",
|
|
549
|
-
children: listItems.map((block, index) => /* @__PURE__ */ (0,
|
|
555
|
+
children: listItems.map((block, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RecursiveListItem, { block, index }, block.id))
|
|
550
556
|
}
|
|
551
557
|
);
|
|
552
558
|
};
|
|
@@ -562,14 +568,14 @@ var ListBlocksRenderer = ({ blocks, startIndex, type }) => {
|
|
|
562
568
|
}
|
|
563
569
|
}
|
|
564
570
|
const listItems = blocks.slice(startIndex, startIndex + consecutiveItems);
|
|
565
|
-
return /* @__PURE__ */ (0,
|
|
571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
566
572
|
List,
|
|
567
573
|
{
|
|
568
574
|
as: type === "numbered" ? "ol" : "ul",
|
|
569
575
|
type,
|
|
570
576
|
role: "list",
|
|
571
577
|
"aria-label": type === "bulleted" ? "Bulleted list" : "Numbered list",
|
|
572
|
-
children: listItems.map((block, index) => /* @__PURE__ */ (0,
|
|
578
|
+
children: listItems.map((block, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
573
579
|
RecursiveListItem,
|
|
574
580
|
{
|
|
575
581
|
block,
|
|
@@ -593,13 +599,13 @@ var import_prismjs = __toESM(require("prismjs"));
|
|
|
593
599
|
var import_prism_typescript = require("prismjs/components/prism-typescript");
|
|
594
600
|
var import_prism_jsx = require("prismjs/components/prism-jsx");
|
|
595
601
|
var import_prism_tsx = require("prismjs/components/prism-tsx");
|
|
596
|
-
var
|
|
602
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
597
603
|
if (typeof window !== "undefined") {
|
|
598
604
|
window.Prism = import_prismjs.default;
|
|
599
605
|
}
|
|
600
606
|
var renderToken = (token, i) => {
|
|
601
607
|
if (typeof token === "string") {
|
|
602
|
-
return /* @__PURE__ */ (0,
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: token }, i);
|
|
603
609
|
}
|
|
604
610
|
const content3 = token.content;
|
|
605
611
|
let tokenContent;
|
|
@@ -610,16 +616,16 @@ var renderToken = (token, i) => {
|
|
|
610
616
|
} else {
|
|
611
617
|
tokenContent = content3;
|
|
612
618
|
}
|
|
613
|
-
return /* @__PURE__ */ (0,
|
|
619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `token ${token.type}`, children: tokenContent }, i);
|
|
614
620
|
};
|
|
615
621
|
var CodeBlock = ({ code, language, caption: caption2 }) => {
|
|
616
622
|
const tokens = (0, import_react4.useMemo)(() => {
|
|
617
623
|
const prismLanguage = import_prismjs.default.languages[language] || import_prismjs.default.languages.plaintext;
|
|
618
624
|
return import_prismjs.default.tokenize(code, prismLanguage);
|
|
619
625
|
}, [code, language]);
|
|
620
|
-
return /* @__PURE__ */ (0,
|
|
621
|
-
/* @__PURE__ */ (0,
|
|
622
|
-
caption2 && /* @__PURE__ */ (0,
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
627
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("pre", { className: `${codeBlock} language-${language}`, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", { className: `language-${language}`, children: tokens.map((token, i) => renderToken(token, i)) }) }),
|
|
628
|
+
caption2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("figcaption", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MemoizedRichText, { richTexts: caption2 }) })
|
|
623
629
|
] });
|
|
624
630
|
};
|
|
625
631
|
var CodeBlock_default = CodeBlock;
|
|
@@ -631,34 +637,34 @@ var heading3 = "styles_heading3__90a95g3";
|
|
|
631
637
|
var paragraph = "styles_paragraph__90a95g0";
|
|
632
638
|
|
|
633
639
|
// src/components/Renderer/components/Typography/Typography.tsx
|
|
634
|
-
var
|
|
640
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
635
641
|
var Paragraph = ({
|
|
636
642
|
className,
|
|
637
643
|
children,
|
|
638
644
|
...props
|
|
639
645
|
}) => {
|
|
640
|
-
return /* @__PURE__ */ (0,
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: paragraph, ...props, children });
|
|
641
647
|
};
|
|
642
648
|
var Heading1 = ({
|
|
643
649
|
className,
|
|
644
650
|
children,
|
|
645
651
|
...props
|
|
646
652
|
}) => {
|
|
647
|
-
return /* @__PURE__ */ (0,
|
|
653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h1", { className: heading1, ...props, children });
|
|
648
654
|
};
|
|
649
655
|
var Heading2 = ({
|
|
650
656
|
className,
|
|
651
657
|
children,
|
|
652
658
|
...props
|
|
653
659
|
}) => {
|
|
654
|
-
return /* @__PURE__ */ (0,
|
|
660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: heading2, ...props, children });
|
|
655
661
|
};
|
|
656
662
|
var Heading3 = ({
|
|
657
663
|
className,
|
|
658
664
|
children,
|
|
659
665
|
...props
|
|
660
666
|
}) => {
|
|
661
|
-
return /* @__PURE__ */ (0,
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: heading3, ...props, children });
|
|
662
668
|
};
|
|
663
669
|
|
|
664
670
|
// src/components/Renderer/components/Column/styles.css.ts
|
|
@@ -666,10 +672,10 @@ var columnContainer = "styles_columnContainer__wle6we0";
|
|
|
666
672
|
var columnListContainer = "styles_columnListContainer__wle6we1";
|
|
667
673
|
|
|
668
674
|
// src/components/Renderer/components/Column/Column.tsx
|
|
669
|
-
var
|
|
675
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
670
676
|
var Column = ({ block, onFocus }) => {
|
|
671
677
|
if (!block || !block.children) return null;
|
|
672
|
-
return /* @__PURE__ */ (0,
|
|
678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: columnContainer, children: block.children.map((childBlock, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
673
679
|
BlockRenderer_default,
|
|
674
680
|
{
|
|
675
681
|
block: childBlock,
|
|
@@ -683,10 +689,10 @@ var Column = ({ block, onFocus }) => {
|
|
|
683
689
|
var Column_default = Column;
|
|
684
690
|
|
|
685
691
|
// src/components/Renderer/components/Column/ColumnList.tsx
|
|
686
|
-
var
|
|
692
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
687
693
|
var ColumnList = ({ block, onFocus }) => {
|
|
688
694
|
if (!block || !block.children) return null;
|
|
689
|
-
return /* @__PURE__ */ (0,
|
|
695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: columnListContainer, children: block.children.map((column) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Column_default, { block: column, onFocus }, column.id)) });
|
|
690
696
|
};
|
|
691
697
|
var ColumnList_default = ColumnList;
|
|
692
698
|
|
|
@@ -694,9 +700,9 @@ var ColumnList_default = ColumnList;
|
|
|
694
700
|
var container2 = "styles_container__mra9n0";
|
|
695
701
|
|
|
696
702
|
// src/components/Renderer/components/Quote/Quote.tsx
|
|
697
|
-
var
|
|
703
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
698
704
|
var Quote = ({ richTexts, tabIndex }) => {
|
|
699
|
-
return /* @__PURE__ */ (0,
|
|
705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("blockquote", { className: container2, tabIndex, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MemoizedRichText, { richTexts }) });
|
|
700
706
|
};
|
|
701
707
|
var Quote_default = Quote;
|
|
702
708
|
|
|
@@ -710,7 +716,7 @@ var tableCell = "styles_tableCell__1rvbzfo3";
|
|
|
710
716
|
var tableContainer = "styles_tableContainer__1rvbzfo0";
|
|
711
717
|
|
|
712
718
|
// src/components/Renderer/components/Table/TableRow.tsx
|
|
713
|
-
var
|
|
719
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
714
720
|
var TableRow = ({
|
|
715
721
|
rowBlock,
|
|
716
722
|
cellClassName = "",
|
|
@@ -720,7 +726,7 @@ var TableRow = ({
|
|
|
720
726
|
return null;
|
|
721
727
|
}
|
|
722
728
|
const { cells } = rowBlock.table_row;
|
|
723
|
-
return /* @__PURE__ */ (0,
|
|
729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tr", { children: cells.map((cell, index) => {
|
|
724
730
|
const isFirstCell = index === 0;
|
|
725
731
|
const isLastCell = index === cells.length - 1;
|
|
726
732
|
const isRowHeader = index === rowHeaderIndex;
|
|
@@ -728,11 +734,11 @@ var TableRow = ({
|
|
|
728
734
|
if (isFirstCell) cellClasses.push(firstCell);
|
|
729
735
|
if (isLastCell) cellClasses.push(lastCell);
|
|
730
736
|
if (isRowHeader) cellClasses.push(hasRowHeader);
|
|
731
|
-
return /* @__PURE__ */ (0,
|
|
737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
732
738
|
"td",
|
|
733
739
|
{
|
|
734
740
|
className: cellClasses.filter(Boolean).join(" "),
|
|
735
|
-
children: /* @__PURE__ */ (0,
|
|
741
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MemoizedRichText, { richTexts: cell })
|
|
736
742
|
},
|
|
737
743
|
`${rowBlock.id}-cell-${index}`
|
|
738
744
|
);
|
|
@@ -741,7 +747,7 @@ var TableRow = ({
|
|
|
741
747
|
var TableRow_default = TableRow;
|
|
742
748
|
|
|
743
749
|
// src/components/Renderer/components/Table/Table.tsx
|
|
744
|
-
var
|
|
750
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
745
751
|
var Table = ({ block, tabIndex = 0 }) => {
|
|
746
752
|
if (!block.table || !block.children) {
|
|
747
753
|
return null;
|
|
@@ -750,16 +756,16 @@ var Table = ({ block, tabIndex = 0 }) => {
|
|
|
750
756
|
const rows = block.children?.filter(
|
|
751
757
|
(child) => child.type === "table_row"
|
|
752
758
|
) || [];
|
|
753
|
-
return /* @__PURE__ */ (0,
|
|
754
|
-
has_column_header && rows[0] && /* @__PURE__ */ (0,
|
|
755
|
-
/* @__PURE__ */ (0,
|
|
759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: tableContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("table", { className: table, tabIndex, children: rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
760
|
+
has_column_header && rows[0] && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TableRow_default, { rowBlock: rows[0], cellClassName: headerCell }) }),
|
|
761
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { children: rows.filter(
|
|
756
762
|
(row) => row !== void 0 && row.type === "table_row"
|
|
757
763
|
).map((row, rowIndex) => {
|
|
758
764
|
if (has_column_header && rowIndex === 0) {
|
|
759
765
|
return null;
|
|
760
766
|
}
|
|
761
767
|
const actualRowIndex = has_column_header ? rowIndex - 1 : rowIndex;
|
|
762
|
-
return /* @__PURE__ */ (0,
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
763
769
|
TableRow_default,
|
|
764
770
|
{
|
|
765
771
|
rowBlock: row,
|
|
@@ -786,7 +792,7 @@ var toggleIcon = "styles_toggleIcon__p7ue1z2";
|
|
|
786
792
|
var toggleIconOpen = "styles_toggleIconOpen__p7ue1z3";
|
|
787
793
|
|
|
788
794
|
// src/components/Renderer/components/Toggle/Toggle.tsx
|
|
789
|
-
var
|
|
795
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
790
796
|
var Toggle = ({ block, tabIndex = 0, onFocus }) => {
|
|
791
797
|
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
792
798
|
if (!block.toggle || !block.children) {
|
|
@@ -801,8 +807,8 @@ var Toggle = ({ block, tabIndex = 0, onFocus }) => {
|
|
|
801
807
|
handleToggle();
|
|
802
808
|
}
|
|
803
809
|
};
|
|
804
|
-
return /* @__PURE__ */ (0,
|
|
805
|
-
/* @__PURE__ */ (0,
|
|
810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: toggleContainer, children: [
|
|
811
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
806
812
|
"div",
|
|
807
813
|
{
|
|
808
814
|
className: toggleHeader,
|
|
@@ -813,12 +819,12 @@ var Toggle = ({ block, tabIndex = 0, onFocus }) => {
|
|
|
813
819
|
role: "button",
|
|
814
820
|
"aria-expanded": isOpen,
|
|
815
821
|
children: [
|
|
816
|
-
/* @__PURE__ */ (0,
|
|
817
|
-
/* @__PURE__ */ (0,
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `${toggleIcon} ${isOpen ? toggleIconOpen : ""}`, children: "\u25B6" }),
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RichTexts_default, { richTexts: block.toggle.rich_text })
|
|
818
824
|
]
|
|
819
825
|
}
|
|
820
826
|
),
|
|
821
|
-
isOpen && block.children && /* @__PURE__ */ (0,
|
|
827
|
+
isOpen && block.children && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: toggleContent, children: block.children.map((childBlock, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
822
828
|
BlockRenderer_default,
|
|
823
829
|
{
|
|
824
830
|
block: childBlock,
|
|
@@ -831,7 +837,7 @@ var Toggle = ({ block, tabIndex = 0, onFocus }) => {
|
|
|
831
837
|
var Toggle_default = Toggle;
|
|
832
838
|
|
|
833
839
|
// src/components/Renderer/components/Block/BlockRenderer.tsx
|
|
834
|
-
var
|
|
840
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
835
841
|
var BlockRenderer = ({
|
|
836
842
|
block,
|
|
837
843
|
onFocus,
|
|
@@ -845,17 +851,17 @@ var BlockRenderer = ({
|
|
|
845
851
|
};
|
|
846
852
|
switch (block.type) {
|
|
847
853
|
case "link_preview":
|
|
848
|
-
return /* @__PURE__ */ (0,
|
|
854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MemoizedLinkPreview, { url: block.link_preview.url, ...blockProps });
|
|
849
855
|
case "paragraph":
|
|
850
|
-
return /* @__PURE__ */ (0,
|
|
856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Paragraph, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MemoizedRichText, { richTexts: block.paragraph.rich_text }) });
|
|
851
857
|
case "heading_1":
|
|
852
|
-
return /* @__PURE__ */ (0,
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Heading1, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MemoizedRichText, { richTexts: block.heading_1.rich_text }) });
|
|
853
859
|
case "heading_2":
|
|
854
|
-
return /* @__PURE__ */ (0,
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Heading2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MemoizedRichText, { richTexts: block.heading_2.rich_text }) });
|
|
855
861
|
case "heading_3":
|
|
856
|
-
return /* @__PURE__ */ (0,
|
|
862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Heading3, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MemoizedRichText, { richTexts: block.heading_3.rich_text }) });
|
|
857
863
|
case "code":
|
|
858
|
-
return /* @__PURE__ */ (0,
|
|
864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
859
865
|
CodeBlock_default,
|
|
860
866
|
{
|
|
861
867
|
code: block.code.rich_text[0].text.content,
|
|
@@ -864,7 +870,7 @@ var BlockRenderer = ({
|
|
|
864
870
|
}
|
|
865
871
|
) });
|
|
866
872
|
case "image":
|
|
867
|
-
return /* @__PURE__ */ (0,
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("figure", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
868
874
|
MemoizedImage,
|
|
869
875
|
{
|
|
870
876
|
src: block.image.file?.url || block.image.external?.url,
|
|
@@ -875,7 +881,7 @@ var BlockRenderer = ({
|
|
|
875
881
|
}
|
|
876
882
|
) });
|
|
877
883
|
case "bookmark":
|
|
878
|
-
return /* @__PURE__ */ (0,
|
|
884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
879
885
|
MemoizedBookmark,
|
|
880
886
|
{
|
|
881
887
|
url: block.bookmark.url,
|
|
@@ -883,15 +889,15 @@ var BlockRenderer = ({
|
|
|
883
889
|
}
|
|
884
890
|
);
|
|
885
891
|
case "column_list":
|
|
886
|
-
return /* @__PURE__ */ (0,
|
|
892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ColumnList_default, { block, onFocus });
|
|
887
893
|
case "column":
|
|
888
894
|
return null;
|
|
889
895
|
case "quote":
|
|
890
|
-
return /* @__PURE__ */ (0,
|
|
896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Quote_default, { richTexts: block.quote.rich_text, ...blockProps });
|
|
891
897
|
case "table":
|
|
892
|
-
return /* @__PURE__ */ (0,
|
|
898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Table_default2, { block, tabIndex: blockProps.tabIndex });
|
|
893
899
|
case "toggle":
|
|
894
|
-
return /* @__PURE__ */ (0,
|
|
900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
895
901
|
Toggle_default,
|
|
896
902
|
{
|
|
897
903
|
block,
|
|
@@ -910,36 +916,55 @@ var darkTheme = "theme_darkTheme__sq3jkb1n";
|
|
|
910
916
|
var lightTheme = "theme_lightTheme__sq3jkb1m";
|
|
911
917
|
|
|
912
918
|
// src/components/Title/index.tsx
|
|
913
|
-
var
|
|
919
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
914
920
|
var Title = ({ title: title3 }) => {
|
|
915
|
-
return /* @__PURE__ */ (0,
|
|
921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Heading1, { children: title3 });
|
|
916
922
|
};
|
|
917
923
|
var Title_default = Title;
|
|
918
924
|
|
|
925
|
+
// src/components/Cover/index.tsx
|
|
926
|
+
var import_react6 = require("react");
|
|
927
|
+
|
|
919
928
|
// src/components/Cover/styles.css.ts
|
|
920
|
-
var
|
|
929
|
+
var import_createRuntimeFn4 = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
930
|
+
var coverContainer = "styles_coverContainer__p0cp8d0";
|
|
931
|
+
var imageStyle2 = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "styles_imageStyle__p0cp8d4", variantClassNames: { isLoaded: { true: "styles_imageStyle_isLoaded_true__p0cp8d5", false: "styles_imageStyle_isLoaded_false__p0cp8d6" } }, defaultVariants: { isLoaded: false }, compoundVariants: [] });
|
|
932
|
+
var skeletonWrapper2 = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "styles_skeletonWrapper__p0cp8d1", variantClassNames: { isLoaded: { true: "styles_skeletonWrapper_isLoaded_true__p0cp8d2", false: "styles_skeletonWrapper_isLoaded_false__p0cp8d3" } }, defaultVariants: { isLoaded: false }, compoundVariants: [] });
|
|
921
933
|
|
|
922
934
|
// src/components/Cover/index.tsx
|
|
923
|
-
var
|
|
935
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
924
936
|
var Cover = ({ src, alt }) => {
|
|
925
|
-
|
|
937
|
+
const [isLoaded, setIsLoaded] = (0, import_react6.useState)(false);
|
|
938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: coverContainer, children: [
|
|
939
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: skeletonWrapper2({ isLoaded }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Skeleton_default, { variant: "image" }) }),
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
941
|
+
"img",
|
|
942
|
+
{
|
|
943
|
+
src,
|
|
944
|
+
alt,
|
|
945
|
+
className: imageStyle2({ isLoaded }),
|
|
946
|
+
onLoad: () => setIsLoaded(true),
|
|
947
|
+
loading: "lazy"
|
|
948
|
+
}
|
|
949
|
+
)
|
|
950
|
+
] });
|
|
926
951
|
};
|
|
927
952
|
var Cover_default = Cover;
|
|
928
953
|
|
|
929
954
|
// src/components/Renderer/index.tsx
|
|
930
|
-
var
|
|
931
|
-
var Renderer =
|
|
932
|
-
({ blocks, isDarkMode = false, title: title3, cover
|
|
955
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
956
|
+
var Renderer = import_react7.default.memo(
|
|
957
|
+
({ blocks, isDarkMode = false, title: title3, cover, onBlockFocus }) => {
|
|
933
958
|
const theme = isDarkMode ? darkTheme : lightTheme;
|
|
934
|
-
const [focusedIndex, setFocusedIndex] = (0,
|
|
935
|
-
const handleBlockFocus = (0,
|
|
959
|
+
const [focusedIndex, setFocusedIndex] = (0, import_react7.useState)(-1);
|
|
960
|
+
const handleBlockFocus = (0, import_react7.useCallback)(
|
|
936
961
|
(index) => {
|
|
937
962
|
setFocusedIndex(index);
|
|
938
963
|
onBlockFocus?.(index);
|
|
939
964
|
},
|
|
940
965
|
[onBlockFocus]
|
|
941
966
|
);
|
|
942
|
-
const renderedBlocks = (0,
|
|
967
|
+
const renderedBlocks = (0, import_react7.useMemo)(() => {
|
|
943
968
|
const result = [];
|
|
944
969
|
for (let i = 0; i < blocks.length; i++) {
|
|
945
970
|
const block = blocks[i];
|
|
@@ -948,7 +973,7 @@ var Renderer = import_react6.default.memo(
|
|
|
948
973
|
const listItemType = `${listType}_list_item`;
|
|
949
974
|
if (block.type === listItemType && (i === 0 || blocks[i - 1]?.type !== listItemType)) {
|
|
950
975
|
result.push(
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
952
977
|
ListBlocksRenderer_default,
|
|
953
978
|
{
|
|
954
979
|
blocks,
|
|
@@ -969,7 +994,7 @@ var Renderer = import_react6.default.memo(
|
|
|
969
994
|
continue;
|
|
970
995
|
} else {
|
|
971
996
|
result.push(
|
|
972
|
-
/* @__PURE__ */ (0,
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
973
998
|
BlockRenderer_default,
|
|
974
999
|
{
|
|
975
1000
|
block,
|
|
@@ -983,15 +1008,15 @@ var Renderer = import_react6.default.memo(
|
|
|
983
1008
|
}
|
|
984
1009
|
return result;
|
|
985
1010
|
}, [blocks, handleBlockFocus]);
|
|
986
|
-
return /* @__PURE__ */ (0,
|
|
987
|
-
|
|
988
|
-
/* @__PURE__ */ (0,
|
|
1011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
1012
|
+
cover && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Cover_default, { src: cover, alt: title3 || "Notion page content" }),
|
|
1013
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
989
1014
|
"article",
|
|
990
1015
|
{
|
|
991
1016
|
className: `${theme} ${container}`,
|
|
992
1017
|
"aria-label": title3 || "Notion page content",
|
|
993
1018
|
children: [
|
|
994
|
-
title3 && /* @__PURE__ */ (0,
|
|
1019
|
+
title3 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Title_default, { title: title3 }),
|
|
995
1020
|
renderedBlocks
|
|
996
1021
|
]
|
|
997
1022
|
}
|