@caring-dev/react-notion-x 7.7.8 → 7.8.3

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.
@@ -5481,7 +5481,7 @@ function CollectionCard({
5481
5481
  } else if ((cover == null ? void 0 : cover.type) === "property") {
5482
5482
  const { property } = cover;
5483
5483
  if (!property) return null;
5484
- const schema = collection.schema[property];
5484
+ const schema = collection.value.schema[property];
5485
5485
  const data = (_l = block.properties) == null ? void 0 : _l[property];
5486
5486
  if (schema && data) {
5487
5487
  if (schema.type === "file") {
@@ -5508,10 +5508,10 @@ function CollectionCard({
5508
5508
  let linkProperties = [];
5509
5509
  if (isLinkCollectionToUrlProperty && properties) {
5510
5510
  linkProperties = properties.filter(
5511
- (p) => p.visible && p.property !== "title" && collection.schema[p.property]
5511
+ (p) => p.visible && p.property !== "title" && collection.value.schema[p.property]
5512
5512
  ).filter((p) => {
5513
5513
  if (!block.properties) return false;
5514
- const schema = collection.schema[p.property];
5514
+ const schema = collection.value.schema[p.property];
5515
5515
  return (schema == null ? void 0 : schema.type) === "url";
5516
5516
  }).map((p) => {
5517
5517
  var _a2;
@@ -5528,17 +5528,17 @@ function CollectionCard({
5528
5528
  /* @__PURE__ */ jsx51("div", { className: "notion-collection-card-property", children: /* @__PURE__ */ jsx51(
5529
5529
  Property,
5530
5530
  {
5531
- schema: collection.schema.title,
5531
+ schema: collection.value.schema.title,
5532
5532
  data: (_m = block == null ? void 0 : block.properties) == null ? void 0 : _m.title,
5533
5533
  block,
5534
5534
  collection
5535
5535
  }
5536
5536
  ) }),
5537
5537
  properties == null ? void 0 : properties.filter(
5538
- (p) => p.visible && p.property !== "title" && collection.schema[p.property]
5538
+ (p) => p.visible && p.property !== "title" && collection.value.schema[p.property]
5539
5539
  ).map((p) => {
5540
5540
  if (!block.properties || !p.property) return null;
5541
- const schema = collection.schema[p.property];
5541
+ const schema = collection.value.schema[p.property];
5542
5542
  const data = block.properties[p.property];
5543
5543
  return /* @__PURE__ */ jsx51("div", { className: "notion-collection-card-property", children: /* @__PURE__ */ jsx51(
5544
5544
  Property,
@@ -5644,7 +5644,7 @@ function getCollectionGroups(collection, collectionView, collectionData, ...rest
5644
5644
  const queryLabel = isUncategorizedValue ? "uncategorized" : isDateValue ? ((_a2 = value.range) == null ? void 0 : _a2.start_date) || ((_b = value.range) == null ? void 0 : _b.end_date) : (value == null ? void 0 : value.value) || value;
5645
5645
  const collectionGroup = collectionData[`results:${type}:${queryLabel}`];
5646
5646
  let queryValue = !isUncategorizedValue && (isDateValue || (value == null ? void 0 : value.value) || value);
5647
- let schema = collection.schema[property];
5647
+ let schema = collection.value.schema[property];
5648
5648
  if (type === "checkbox" && value) {
5649
5649
  queryValue = "Yes";
5650
5650
  }
@@ -5746,7 +5746,7 @@ function Board({
5746
5746
  return null;
5747
5747
  }
5748
5748
  const group = collectionData.board_columns.results[index];
5749
- const schema = collection.schema[p.property];
5749
+ const schema = collection.value.schema[p.property];
5750
5750
  if (!group || !schema || p.hidden) {
5751
5751
  return null;
5752
5752
  }
@@ -5775,7 +5775,7 @@ function Board({
5775
5775
  const boardResults = (_a2 = collectionData.board_columns) == null ? void 0 : _a2.results;
5776
5776
  if (!boardResults) return null;
5777
5777
  if (!((_b2 = p == null ? void 0 : p.value) == null ? void 0 : _b2.type)) return null;
5778
- const schema = collection.schema[p.property];
5778
+ const schema = collection.value.schema[p.property];
5779
5779
  const group = collectionData[`results:${(_c2 = p == null ? void 0 : p.value) == null ? void 0 : _c2.type}:${((_d2 = p == null ? void 0 : p.value) == null ? void 0 : _d2.value) || "uncategorized"}`];
5780
5780
  if (!group || !schema || p.hidden) {
5781
5781
  return null;
@@ -6400,20 +6400,20 @@ function CollectionViewCalendar({
6400
6400
  var _a2;
6401
6401
  const calendarBy = (_a2 = collectionView == null ? void 0 : collectionView.query2) == null ? void 0 : _a2.calendar_by;
6402
6402
  if (calendarBy) {
6403
- const schema2 = collection.schema;
6403
+ const schema2 = collection.value.schema;
6404
6404
  const propertySchema = schema2[calendarBy];
6405
6405
  if (propertySchema && propertySchema.type === "date") {
6406
6406
  return calendarBy;
6407
6407
  }
6408
6408
  }
6409
- const schema = collection.schema;
6409
+ const schema = collection.value.schema;
6410
6410
  for (const [propertyId, propertySchema] of Object.entries(schema)) {
6411
6411
  if (propertySchema.type === "date") {
6412
6412
  return propertyId;
6413
6413
  }
6414
6414
  }
6415
6415
  return null;
6416
- }, [collection.schema, collectionView]);
6416
+ }, [collection.value.schema, collectionView]);
6417
6417
  const eventsByDate = React20.useMemo(() => {
6418
6418
  var _a2, _b2;
6419
6419
  const eventsMap = /* @__PURE__ */ new Map();
@@ -6670,7 +6670,7 @@ function List({
6670
6670
  var _a, _b, _c, _d;
6671
6671
  const block = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value;
6672
6672
  if (!block) return null;
6673
- const titleSchema = collection.schema.title;
6673
+ const titleSchema = collection.value.schema.title;
6674
6674
  const titleData = (_b = block == null ? void 0 : block.properties) == null ? void 0 : _b.title;
6675
6675
  return /* @__PURE__ */ jsxs19(
6676
6676
  components.PageLink,
@@ -6700,7 +6700,7 @@ function List({
6700
6700
  ] }),
6701
6701
  /* @__PURE__ */ jsx57("div", { className: "notion-list-item-body", children: (_d = (_c = collectionView.format) == null ? void 0 : _c.list_properties) == null ? void 0 : _d.filter((p) => p.visible).map((p) => {
6702
6702
  var _a2;
6703
- const schema = collection.schema[p.property];
6703
+ const schema = collection.value.schema[p.property];
6704
6704
  const data = block && ((_a2 = block.properties) == null ? void 0 : _a2[p.property]);
6705
6705
  if (!schema) {
6706
6706
  return null;
@@ -6933,17 +6933,17 @@ function Table({
6933
6933
  let properties = [];
6934
6934
  if ((_a = collectionView.format) == null ? void 0 : _a.table_properties) {
6935
6935
  properties = collectionView.format.table_properties.filter(
6936
- (p) => p.visible && collection.schema[p.property]
6936
+ (p) => p.visible && collection.value.schema[p.property]
6937
6937
  );
6938
6938
  } else {
6939
6939
  properties = [{ property: "title" }].concat(
6940
- Object.keys(collection.schema).filter((p) => p !== "title").map((property) => ({ property }))
6940
+ Object.keys(collection.value.schema).filter((p) => p !== "title").map((property) => ({ property }))
6941
6941
  );
6942
6942
  }
6943
6943
  return /* @__PURE__ */ jsx58("div", { className: "notion-table", style: tableStyle, children: /* @__PURE__ */ jsx58("div", { className: "notion-table-view", style: tableViewStyle, children: !!properties.length && /* @__PURE__ */ jsxs20(Fragment7, { children: [
6944
6944
  /* @__PURE__ */ jsx58("div", { className: "notion-table-header", children: /* @__PURE__ */ jsx58("div", { className: "notion-table-header-inner", children: properties.map((p) => {
6945
6945
  var _a2;
6946
- const schema = (_a2 = collection.schema) == null ? void 0 : _a2[p.property];
6946
+ const schema = (_a2 = collection.value.schema) == null ? void 0 : _a2[p.property];
6947
6947
  const isTitle = p.property === "title";
6948
6948
  const style = {};
6949
6949
  if (p.width) {
@@ -6965,7 +6965,7 @@ function Table({
6965
6965
  /* @__PURE__ */ jsx58("div", { className: "notion-table-header-placeholder" }),
6966
6966
  /* @__PURE__ */ jsx58("div", { className: "notion-table-body", children: blockIds == null ? void 0 : blockIds.map((blockId) => /* @__PURE__ */ jsx58("div", { className: "notion-table-row", children: properties.map((p) => {
6967
6967
  var _a2, _b, _c;
6968
- const schema = (_a2 = collection.schema) == null ? void 0 : _a2[p.property];
6968
+ const schema = (_a2 = collection.value.schema) == null ? void 0 : _a2[p.property];
6969
6969
  const block = (_b = recordMap.block[blockId]) == null ? void 0 : _b.value;
6970
6970
  const data = (_c = block == null ? void 0 : block.properties) == null ? void 0 : _c[p.property];
6971
6971
  const isTitle = p.property === "title";