@caring-dev/react-notion-x 7.8.4 → 7.8.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.
@@ -243,7 +243,7 @@ import React16 from "react";
243
243
 
244
244
  // src/components/text.tsx
245
245
  import "notion-types";
246
- import { parsePageId as parsePageId2 } from "notion-utils";
246
+ import { getBlockValue as getBlockValue2, parsePageId as parsePageId2 } from "notion-utils";
247
247
  import React15 from "react";
248
248
 
249
249
  // src/context.tsx
@@ -255,16 +255,9 @@ import React13 from "react";
255
255
  import "notion-types";
256
256
  import { parsePageId } from "notion-utils";
257
257
 
258
- // src/components/header.tsx
259
- import { getPageBreadcrumbs } from "notion-utils";
260
- import React9 from "react";
261
- import { useHotkeys } from "react-hotkeys-hook";
262
-
263
- // src/icons/search-icon.tsx
264
- import "react";
265
-
266
258
  // src/utils.ts
267
259
  import "notion-types";
260
+ import { getBlockValue } from "notion-utils";
268
261
  import { formatDate, formatNotionDateTime, isUrl } from "notion-utils";
269
262
  var cs = (...classes) => classes.filter((a) => !!a).join(" ");
270
263
  var getHashFragmentValue = (url) => {
@@ -307,7 +300,13 @@ var getUrlParams = (url) => {
307
300
  return;
308
301
  };
309
302
 
303
+ // src/components/header.tsx
304
+ import { getPageBreadcrumbs } from "notion-utils";
305
+ import React9 from "react";
306
+ import { useHotkeys } from "react-hotkeys-hook";
307
+
310
308
  // src/icons/search-icon.tsx
309
+ import "react";
311
310
  import { jsx } from "react/jsx-runtime";
312
311
  function SearchIcon(props) {
313
312
  const { className, ...rest } = props;
@@ -1904,6 +1903,8 @@ var defaultComponents = {
1904
1903
  Checkbox,
1905
1904
  Callout: void 0,
1906
1905
  // use the built-in callout rendering by default
1906
+ Button: void 0,
1907
+ // use the built-in button rendering by default
1907
1908
  Code: dummyComponent("Code"),
1908
1909
  Equation: dummyComponent("Equation"),
1909
1910
  Collection: dummyComponent("Collection"),
@@ -2099,11 +2100,10 @@ function Text({
2099
2100
  }
2100
2101
  const formatted = decorations.reduce(
2101
2102
  (element, decorator) => {
2102
- var _a, _b, _c, _d, _e;
2103
2103
  switch (decorator[0]) {
2104
2104
  case "p": {
2105
2105
  const blockId = decorator[1];
2106
- const linkedBlock = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value;
2106
+ const linkedBlock = getBlockValue2(recordMap.block[blockId]);
2107
2107
  if (!linkedBlock) {
2108
2108
  console.log('"p" missing block', blockId);
2109
2109
  return null;
@@ -2122,7 +2122,7 @@ function Text({
2122
2122
  const id = decorator[1][1];
2123
2123
  switch (linkType) {
2124
2124
  case "u": {
2125
- const user = (_b = recordMap.notion_user[id]) == null ? void 0 : _b.value;
2125
+ const user = getBlockValue2(recordMap.notion_user[id]);
2126
2126
  if (!user) {
2127
2127
  console.log('"\u2023" missing user', id);
2128
2128
  return null;
@@ -2140,7 +2140,7 @@ function Text({
2140
2140
  );
2141
2141
  }
2142
2142
  default: {
2143
- const linkedBlock = (_c = recordMap.block[id]) == null ? void 0 : _c.value;
2143
+ const linkedBlock = getBlockValue2(recordMap.block[id]);
2144
2144
  if (!linkedBlock) {
2145
2145
  console.log('"\u2023" missing block', linkType, id);
2146
2146
  return null;
@@ -2223,7 +2223,7 @@ function Text({
2223
2223
  }
2224
2224
  case "u": {
2225
2225
  const userId = decorator[1];
2226
- const user = (_d = recordMap.notion_user[userId]) == null ? void 0 : _d.value;
2226
+ const user = getBlockValue2(recordMap.notion_user[userId]);
2227
2227
  if (!user) {
2228
2228
  console.log("missing user", userId);
2229
2229
  return null;
@@ -2239,7 +2239,13 @@ function Text({
2239
2239
  }
2240
2240
  case "eoi": {
2241
2241
  const blockId = decorator[1];
2242
- const externalObjectInstance = (_e = recordMap.block[blockId]) == null ? void 0 : _e.value;
2242
+ const externalObjectInstance = getBlockValue2(
2243
+ recordMap.block[blockId]
2244
+ );
2245
+ if (!externalObjectInstance) {
2246
+ console.log('"eoi" missing block', blockId);
2247
+ return null;
2248
+ }
2243
2249
  return /* @__PURE__ */ jsx23(EOI, { block: externalObjectInstance, inline: true });
2244
2250
  }
2245
2251
  case "si":