@texonom/nreact 1.5.3 → 1.5.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.
|
@@ -9,7 +9,7 @@ var Lt = (a, e, t) => e in a ? Ma(a, e, { enumerable: !0, configurable: !0, writ
|
|
|
9
9
|
for (var t of ce(e))
|
|
10
10
|
jt.call(e, t) && Lt(a, t, e[t]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
12
|
+
}, j = (a, e) => wa(a, Da(e));
|
|
13
13
|
var te = (a, e) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var n in a)
|
|
@@ -22,7 +22,7 @@ var te = (a, e) => {
|
|
|
22
22
|
import f from "react";
|
|
23
23
|
import { getTextContent as St, getDateValue as Ta, formatDate as $t, getBlockCollectionId as Oa, getBlockParentPage as Ea } from "@texonom/nutils";
|
|
24
24
|
import { useLocalStorage as qa, useWindowSize as Ca } from "react-use";
|
|
25
|
-
import { u as B, T as
|
|
25
|
+
import { u as B, T as F, P as Pa, G as Ra, C as ka, L as Ct, N as kt, d as Sa, a as Ia } from "../asset-wrapper-CaHInqoM.js";
|
|
26
26
|
import { C as sa } from "../collection-column-title-l4hmVo49.js";
|
|
27
27
|
import { g as A } from "../_commonjsHelpers-bAxELxBV.js";
|
|
28
28
|
function Na(a) {
|
|
@@ -2600,7 +2600,7 @@ function nu(a, e) {
|
|
|
2600
2600
|
case "day":
|
|
2601
2601
|
return Dn(M(t[0], e));
|
|
2602
2602
|
case "end":
|
|
2603
|
-
return M(t[0],
|
|
2603
|
+
return M(t[0], j(R({}, e), { endDate: !0 }));
|
|
2604
2604
|
case "formatDate": {
|
|
2605
2605
|
const n = M(t[0], e), o = M(t[1], e).replace("dddd", "eeee");
|
|
2606
2606
|
return Mt(n, o);
|
|
@@ -2616,7 +2616,7 @@ function nu(a, e) {
|
|
|
2616
2616
|
case "now":
|
|
2617
2617
|
return /* @__PURE__ */ new Date();
|
|
2618
2618
|
case "start":
|
|
2619
|
-
return M(t[0],
|
|
2619
|
+
return M(t[0], j(R({}, e), { endDate: !1 }));
|
|
2620
2620
|
case "timestamp":
|
|
2621
2621
|
return M(t[0], e).getTime();
|
|
2622
2622
|
case "year":
|
|
@@ -2631,12 +2631,12 @@ const J = (a) => {
|
|
|
2631
2631
|
}, uu = (a) => {
|
|
2632
2632
|
const { components: e, mapImageUrl: t, mapPageUrl: n } = B(), { schema: o, data: i, block: s, collection: r, inline: u = !1, linkToTitlePage: l = !0 } = a, d = f.useMemo(
|
|
2633
2633
|
() => function() {
|
|
2634
|
-
return /* @__PURE__ */ f.createElement(
|
|
2634
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2635
2635
|
},
|
|
2636
2636
|
[s, i]
|
|
2637
2637
|
), c = f.useMemo(
|
|
2638
2638
|
() => function() {
|
|
2639
|
-
return /* @__PURE__ */ f.createElement(
|
|
2639
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2640
2640
|
},
|
|
2641
2641
|
[s, i]
|
|
2642
2642
|
), p = f.useMemo(
|
|
@@ -2655,17 +2655,17 @@ const J = (a) => {
|
|
|
2655
2655
|
[s == null ? void 0 : s.properties, r == null ? void 0 : r.schema, o]
|
|
2656
2656
|
), _ = f.useMemo(
|
|
2657
2657
|
() => function() {
|
|
2658
|
-
return /* @__PURE__ */ f.createElement(
|
|
2658
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2659
2659
|
},
|
|
2660
2660
|
[s, i]
|
|
2661
2661
|
), x = f.useMemo(
|
|
2662
2662
|
() => function() {
|
|
2663
|
-
return s && l ? /* @__PURE__ */ f.createElement(e.PageLink, { className: "notion-page-link", href: n(s.id) }, /* @__PURE__ */ f.createElement(Pa, { block: s })) : /* @__PURE__ */ f.createElement(
|
|
2663
|
+
return s && l ? /* @__PURE__ */ f.createElement(e.PageLink, { className: "notion-page-link", href: n(s.id) }, /* @__PURE__ */ f.createElement(Pa, { block: s })) : /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2664
2664
|
},
|
|
2665
2665
|
[s, e, i, l, n]
|
|
2666
2666
|
), w = f.useMemo(
|
|
2667
2667
|
() => function() {
|
|
2668
|
-
return /* @__PURE__ */ f.createElement("span", null, /* @__PURE__ */ f.createElement(
|
|
2668
|
+
return /* @__PURE__ */ f.createElement("span", null, /* @__PURE__ */ f.createElement(F, { block: s, value: [["‣", [["u", s.created_by_id]]]] }));
|
|
2669
2669
|
},
|
|
2670
2670
|
[s]
|
|
2671
2671
|
), y = f.useMemo(
|
|
@@ -2699,7 +2699,7 @@ const J = (a) => {
|
|
|
2699
2699
|
} catch (P) {
|
|
2700
2700
|
}
|
|
2701
2701
|
return /* @__PURE__ */ f.createElement(
|
|
2702
|
-
|
|
2702
|
+
F,
|
|
2703
2703
|
{
|
|
2704
2704
|
value: E,
|
|
2705
2705
|
block: s,
|
|
@@ -2714,12 +2714,12 @@ const J = (a) => {
|
|
|
2714
2714
|
[s, i, u]
|
|
2715
2715
|
), v = f.useMemo(
|
|
2716
2716
|
() => function() {
|
|
2717
|
-
return /* @__PURE__ */ f.createElement(
|
|
2717
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, linkProtocol: "mailto", block: s });
|
|
2718
2718
|
},
|
|
2719
2719
|
[s, i]
|
|
2720
2720
|
), h = f.useMemo(
|
|
2721
2721
|
() => function() {
|
|
2722
|
-
return /* @__PURE__ */ f.createElement(
|
|
2722
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, linkProtocol: "tel", block: s });
|
|
2723
2723
|
},
|
|
2724
2724
|
[s, i]
|
|
2725
2725
|
), b = f.useMemo(
|
|
@@ -2727,7 +2727,7 @@ const J = (a) => {
|
|
|
2727
2727
|
const E = parseFloat(i[0][0] || "0");
|
|
2728
2728
|
let P = "";
|
|
2729
2729
|
if (isNaN(E))
|
|
2730
|
-
return /* @__PURE__ */ f.createElement(
|
|
2730
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2731
2731
|
switch (o.number_format) {
|
|
2732
2732
|
case "number_with_commas":
|
|
2733
2733
|
P = X()(E);
|
|
@@ -2757,23 +2757,24 @@ const J = (a) => {
|
|
|
2757
2757
|
P = X({ prefix: "CN¥", round: 2, padRight: 2 })(E);
|
|
2758
2758
|
break;
|
|
2759
2759
|
default:
|
|
2760
|
-
return /* @__PURE__ */ f.createElement(
|
|
2760
|
+
return /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2761
2761
|
}
|
|
2762
|
-
return /* @__PURE__ */ f.createElement(
|
|
2762
|
+
return /* @__PURE__ */ f.createElement(F, { value: [[P]], block: s });
|
|
2763
2763
|
},
|
|
2764
2764
|
[s, i, o]
|
|
2765
2765
|
), D = f.useMemo(
|
|
2766
2766
|
() => function() {
|
|
2767
|
-
return /* @__PURE__ */ f.createElement(
|
|
2767
|
+
return /* @__PURE__ */ f.createElement(F, { block: s, value: [[$t(s == null ? void 0 : s.created_time, { month: "short" })]] });
|
|
2768
2768
|
},
|
|
2769
2769
|
[s]
|
|
2770
2770
|
), O = f.useMemo(
|
|
2771
2771
|
() => function() {
|
|
2772
|
-
return /* @__PURE__ */ f.createElement(
|
|
2772
|
+
return /* @__PURE__ */ f.createElement(F, { block: s, value: [[$t(s == null ? void 0 : s.last_edited_time, { month: "short" })]] });
|
|
2773
2773
|
},
|
|
2774
2774
|
[s]
|
|
2775
2775
|
);
|
|
2776
|
-
if (!o)
|
|
2776
|
+
if (!o)
|
|
2777
|
+
return i ? /* @__PURE__ */ f.createElement(F, { value: i, block: s }) : null;
|
|
2777
2778
|
let k = null;
|
|
2778
2779
|
if (i || o.type === "checkbox" || o.type === "title" || o.type === "formula" || o.type === "created_by" || o.type === "last_edited_by" || o.type === "created_time" || o.type === "last_edited_time")
|
|
2779
2780
|
switch (o.type) {
|
|
@@ -2793,7 +2794,7 @@ const J = (a) => {
|
|
|
2793
2794
|
var G;
|
|
2794
2795
|
const L = (G = o.options) == null ? void 0 : G.find((Z) => E === Z.value), $ = L == null ? void 0 : L.color;
|
|
2795
2796
|
return e.propertySelectValue(
|
|
2796
|
-
|
|
2797
|
+
j(R({}, a), {
|
|
2797
2798
|
key: P,
|
|
2798
2799
|
value: E,
|
|
2799
2800
|
option: L,
|
|
@@ -2844,11 +2845,11 @@ const J = (a) => {
|
|
|
2844
2845
|
k = e.propertyDateValue(a, d);
|
|
2845
2846
|
break;
|
|
2846
2847
|
default:
|
|
2847
|
-
k = /* @__PURE__ */ f.createElement(
|
|
2848
|
+
k = /* @__PURE__ */ f.createElement(F, { value: i, block: s });
|
|
2848
2849
|
break;
|
|
2849
2850
|
}
|
|
2850
2851
|
const W = o.type === "title";
|
|
2851
|
-
return /* @__PURE__ */ f.createElement("span", { className: `notion-property notion-property-${o.type}` }, W ? null : /* @__PURE__ */ f.createElement("div", { style: { marginRight: "1em", display: "inline" } }, /* @__PURE__ */ f.createElement(
|
|
2852
|
+
return /* @__PURE__ */ f.createElement("span", { className: `notion-property notion-property-${o.type}` }, W ? null : /* @__PURE__ */ f.createElement("div", { style: { marginRight: "1em", display: "inline" } }, /* @__PURE__ */ f.createElement(F, { block: s, value: [[o.name, [["h", "gray"]]]] }), " "), k);
|
|
2852
2853
|
}, iu = f.memo(uu), ou = ({ block: a, pageHeader: e = !1, className: t }) => {
|
|
2853
2854
|
var u, l, d, c;
|
|
2854
2855
|
const { recordMap: n } = B(), o = a.parent_id, i = (u = n.collection[o]) == null ? void 0 : u.value, s = i == null ? void 0 : i.schema;
|
|
@@ -2861,7 +2862,7 @@ const J = (a) => {
|
|
|
2861
2862
|
}
|
|
2862
2863
|
)), (d = i.format) != null && d.collection_page_properties) {
|
|
2863
2864
|
const p = (c = i.format) == null ? void 0 : c.collection_page_properties.reduce(
|
|
2864
|
-
(_, x, w) =>
|
|
2865
|
+
(_, x, w) => j(R({}, _), {
|
|
2865
2866
|
[x.property]: w
|
|
2866
2867
|
}),
|
|
2867
2868
|
{}
|
|
@@ -2886,7 +2887,7 @@ const J = (a) => {
|
|
|
2886
2887
|
})));
|
|
2887
2888
|
}, su = (a) => {
|
|
2888
2889
|
const n = a, { className: e } = n, t = te(n, ["className"]);
|
|
2889
|
-
return /* @__PURE__ */ f.createElement("svg",
|
|
2890
|
+
return /* @__PURE__ */ f.createElement("svg", j(R({ className: e }, t), { viewBox: "0 0 14 14", width: "14" }), /* @__PURE__ */ f.createElement("path", { d: "M11.0918,0 C11.5383,0 11.9307,0.295898 12.0533,0.725586 L13.9615,7.40332 C13.9871,7.49316 14,7.58594 14,7.67871 L14,13 C14,13.5527 13.5522,14 13,14 L1,14 C0.447754,14 0,13.5527 0,13 L0,7.67871 C0,7.58594 0.0129395,7.49316 0.0384521,7.40332 L1.94666,0.725586 C2.06934,0.295898 2.46167,0 2.9082,0 L11.0918,0 Z M4.27271,1.5 C3.83728,1.5 3.45178,1.78223 3.31982,2.19727 L1.91455,6.61328 C1.70947,7.25879 2.1908,7.91699 2.86755,7.91699 L4.70837,7.91699 C4.70837,8.93652 5.16663,10.168 7,10.168 C8.83337,10.168 9.29163,8.93652 9.29163,7.91699 L11.1478,7.89355 C11.8201,7.88477 12.2927,7.22852 12.0876,6.58887 L10.681,2.19531 C10.5485,1.78125 10.1635,1.5 9.72864,1.5 L4.27271,1.5 Z" }));
|
|
2890
2891
|
}, ga = (u) => {
|
|
2891
2892
|
var l = u, {
|
|
2892
2893
|
collection: a,
|
|
@@ -2996,8 +2997,8 @@ const J = (a) => {
|
|
|
2996
2997
|
})));
|
|
2997
2998
|
return /* @__PURE__ */ f.createElement(
|
|
2998
2999
|
kt,
|
|
2999
|
-
|
|
3000
|
-
components:
|
|
3000
|
+
j(R({}, d), {
|
|
3001
|
+
components: j(R({}, d.components), {
|
|
3001
3002
|
// Disable <a> tabs in all child components so we don't create invalid DOM
|
|
3002
3003
|
// trees with stacked <a> tags.
|
|
3003
3004
|
PageLink: Sa
|
|
@@ -3072,7 +3073,7 @@ const lu = ({
|
|
|
3072
3073
|
var i;
|
|
3073
3074
|
return ((i = e == null ? void 0 : e.format) == null ? void 0 : i.collection_group_by) ? Ot(a, e, t, n).map((r, u) => /* @__PURE__ */ f.createElement(
|
|
3074
3075
|
Tt,
|
|
3075
|
-
|
|
3076
|
+
j(R({
|
|
3076
3077
|
key: u
|
|
3077
3078
|
}, r), {
|
|
3078
3079
|
summaryProps: {
|
|
@@ -3128,7 +3129,7 @@ function aa({ collectionView: a, collectionData: e, collection: t, padding: n })
|
|
|
3128
3129
|
const du = [], fu = ({ collection: a, collectionView: e, collectionData: t }) => {
|
|
3129
3130
|
var i, s, r, u, l;
|
|
3130
3131
|
if ((i = e == null ? void 0 : e.format) == null ? void 0 : i.collection_group_by)
|
|
3131
|
-
return Ot(a, e, t).map((c, p) => /* @__PURE__ */ f.createElement(Tt,
|
|
3132
|
+
return Ot(a, e, t).map((c, p) => /* @__PURE__ */ f.createElement(Tt, j(R({ key: p }, c), { collectionViewComponent: na })));
|
|
3132
3133
|
const o = ((l = (u = (s = t.collection_group_results) == null ? void 0 : s.blockIds) != null ? u : (r = t["results:relation:uncategorized"]) == null ? void 0 : r.blockIds) != null ? l : t.blockIds) || du;
|
|
3133
3134
|
return /* @__PURE__ */ f.createElement(na, { collectionView: e, collection: a, blockIds: o });
|
|
3134
3135
|
};
|
|
@@ -3158,7 +3159,7 @@ function na({ blockIds: a, collectionView: e, collection: t }) {
|
|
|
3158
3159
|
const cu = [], vu = ({ collection: a, collectionView: e, collectionData: t }) => {
|
|
3159
3160
|
var i, s, r;
|
|
3160
3161
|
if ((i = e == null ? void 0 : e.format) == null ? void 0 : i.collection_group_by)
|
|
3161
|
-
return Ot(a, e, t).map((l, d) => /* @__PURE__ */ f.createElement(Tt,
|
|
3162
|
+
return Ot(a, e, t).map((l, d) => /* @__PURE__ */ f.createElement(Tt, j(R({ key: d }, l), { collectionViewComponent: ua })));
|
|
3162
3163
|
const o = ((r = (s = t.collection_group_results) == null ? void 0 : s.blockIds) != null ? r : t.blockIds) || cu;
|
|
3163
3164
|
return /* @__PURE__ */ f.createElement(ua, { blockIds: o, collection: a, collectionView: e });
|
|
3164
3165
|
};
|
|
@@ -3187,10 +3188,10 @@ const mu = [], hu = ({
|
|
|
3187
3188
|
if ((r = e == null ? void 0 : e.format) == null ? void 0 : r.collection_group_by)
|
|
3188
3189
|
return Ot(a, e, t, n, o).map((c, p) => /* @__PURE__ */ f.createElement(
|
|
3189
3190
|
Tt,
|
|
3190
|
-
|
|
3191
|
+
j(R({
|
|
3191
3192
|
key: p
|
|
3192
3193
|
}, c), {
|
|
3193
|
-
collectionViewComponent: (_) => /* @__PURE__ */ f.createElement(ia,
|
|
3194
|
+
collectionViewComponent: (_) => /* @__PURE__ */ f.createElement(ia, j(R({}, _), { padding: n, width: o })),
|
|
3194
3195
|
summaryProps: {
|
|
3195
3196
|
style: {
|
|
3196
3197
|
paddingLeft: n,
|
|
@@ -3280,7 +3281,7 @@ const pu = (a) => {
|
|
|
3280
3281
|
collectionViewId: u
|
|
3281
3282
|
}), c = s && o.find((S) => S === l.collectionViewId) || u, p = f.useCallback(
|
|
3282
3283
|
(S) => {
|
|
3283
|
-
console.debug("change collection view", S), d(
|
|
3284
|
+
console.debug("change collection view", S), d(j(R({}, l), {
|
|
3284
3285
|
collectionViewId: S
|
|
3285
3286
|
}));
|
|
3286
3287
|
},
|
|
@@ -3316,7 +3317,7 @@ const pu = (a) => {
|
|
|
3316
3317
|
recordMap: t
|
|
3317
3318
|
}), null;
|
|
3318
3319
|
const h = St(x.name).trim(), b = ((W = w.format) == null ? void 0 : W.hide_linked_collection_name) !== !0 && h;
|
|
3319
|
-
return x.icon && (a.format =
|
|
3320
|
+
return x.icon && (a.format = j(R({}, a.format), {
|
|
3320
3321
|
page_icon: x.icon
|
|
3321
3322
|
})), /* @__PURE__ */ f.createElement(f.Fragment, null, /* @__PURE__ */ f.createElement("div", null, /* @__PURE__ */ f.createElement("div", null, o.length > 1 && n && /* @__PURE__ */ f.createElement(_u, { collectionViewId: c, viewIds: o, onChangeView: p })), b && /* @__PURE__ */ f.createElement("div", { className: "notion-collection-header" }, /* @__PURE__ */ f.createElement("div", { className: "notion-collection-header-title" }, /* @__PURE__ */ f.createElement(Ia, { block: a, className: "notion-page-title-icon", hideDefaultIcon: !0 }), h))), /* @__PURE__ */ f.createElement("div", { className: `notion-collection ${e || ""}` }, /* @__PURE__ */ f.createElement(
|
|
3322
3323
|
gu,
|