@texonom/nreact 1.3.0 → 1.4.0
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/build/.tsbuildinfo +1 -1
- package/build/{chunk-HJGIONX2.js → chunk-72RHNPWF.js} +56 -107
- package/build/{chunk-LB5ZQ7L5.js → chunk-P7HX4BAT.js} +2 -3
- package/build/dev/{chunk-NVAEYUJK.js → chunk-64UJZ76E.js} +57 -108
- package/build/dev/{chunk-NVAEYUJK.js.map → chunk-64UJZ76E.js.map} +1 -1
- package/build/dev/{chunk-CWNFRR32.js → chunk-ABDRHJEI.js} +3 -4
- package/build/dev/{chunk-CWNFRR32.js.map → chunk-ABDRHJEI.js.map} +1 -1
- package/build/dev/{chunk-JX5CEG3A.js → chunk-OAIRL2FN.js} +1 -1
- package/build/dev/{chunk-4XJBBVRZ.js → chunk-SEA7YL2O.js} +57 -108
- package/build/dev/chunk-SEA7YL2O.js.map +1 -0
- package/build/dev/index.js +42 -55
- package/build/dev/index.js.map +1 -1
- package/build/dev/third-party/code.js +3 -4
- package/build/dev/third-party/code.js.map +1 -1
- package/build/dev/third-party/collection.js +137 -113
- package/build/dev/third-party/collection.js.map +1 -1
- package/build/dev/third-party/equation.js +3 -4
- package/build/dev/third-party/equation.js.map +1 -1
- package/build/dev/third-party/modal.js +1 -1
- package/build/dev/third-party/pdf.js +1 -1
- package/build/index.js +42 -55
- package/build/next.d.ts.map +1 -1
- package/build/third-party/code.js +3 -4
- package/build/third-party/collection.js +137 -113
- package/build/third-party/equation.js +3 -4
- package/build/third-party/modal.js +1 -1
- package/build/third-party/pdf.js +1 -1
- package/build/utils.d.ts.map +1 -1
- package/package.json +13 -13
- package/build/chunk-26XPY26R.js +0 -1364
- package/build/chunk-3GUXT4PT.js +0 -1386
- package/build/chunk-3R4ITV3N.js +0 -1358
- package/build/chunk-626ANHMX.js +0 -4519
- package/build/chunk-BYOAK6PN.js +0 -1362
- package/build/chunk-E7SOYYOP.js +0 -1364
- package/build/chunk-GDUEQGYI.js +0 -1373
- package/build/chunk-INDII3MG.js +0 -1346
- package/build/chunk-LAZZ76RR.js +0 -142
- package/build/chunk-NH6F5YHO.js +0 -90
- package/build/chunk-THLNCQWF.js +0 -1364
- package/build/chunk-YEVPS76Z.js +0 -1355
- package/build/dev/chunk-2LHADYU7.js +0 -1365
- package/build/dev/chunk-2LHADYU7.js.map +0 -1
- package/build/dev/chunk-4XJBBVRZ.js.map +0 -1
- package/build/dev/chunk-5DDQTDIS.js +0 -1365
- package/build/dev/chunk-5DDQTDIS.js.map +0 -1
- package/build/dev/chunk-73CYHEZ6.js +0 -1374
- package/build/dev/chunk-73CYHEZ6.js.map +0 -1
- package/build/dev/chunk-7R2ZX3WF.js +0 -1359
- package/build/dev/chunk-7R2ZX3WF.js.map +0 -1
- package/build/dev/chunk-CRSVOVI5.js +0 -1387
- package/build/dev/chunk-CRSVOVI5.js.map +0 -1
- package/build/dev/chunk-EDEWD2W7.js +0 -1363
- package/build/dev/chunk-EDEWD2W7.js.map +0 -1
- package/build/dev/chunk-O5ZUWUSN.js +0 -158
- package/build/dev/chunk-O5ZUWUSN.js.map +0 -1
- package/build/dev/chunk-QAD7OWKG.js +0 -91
- package/build/dev/chunk-QAD7OWKG.js.map +0 -1
- package/build/dev/chunk-QHYYIFZL.js +0 -1365
- package/build/dev/chunk-QHYYIFZL.js.map +0 -1
- package/build/dev/chunk-QN4Z7A2J.js +0 -1359
- package/build/dev/chunk-QN4Z7A2J.js.map +0 -1
- package/build/dev/chunk-RO7JTBZN.js +0 -1356
- package/build/dev/chunk-RO7JTBZN.js.map +0 -1
- package/build/dev/chunk-UE6LH4B3.js +0 -1347
- package/build/dev/chunk-UE6LH4B3.js.map +0 -1
- package/build/dev/chunk-VHTSGS2P.js +0 -1365
- package/build/dev/chunk-VHTSGS2P.js.map +0 -1
- package/build/dev/chunk-VZCA75U7.js +0 -143
- package/build/dev/chunk-VZCA75U7.js.map +0 -1
- package/build/dev/chunk-XJQFUGEP.js +0 -4520
- package/build/dev/chunk-XJQFUGEP.js.map +0 -1
- package/build/map-image-url.d.ts +0 -3
- package/build/map-image-url.d.ts.map +0 -1
- package/build/map-page-url.d.ts +0 -2
- package/build/map-page-url.d.ts.map +0 -1
- /package/build/{chunk-723T62SD.js → chunk-C6BUIPAM.js} +0 -0
- /package/build/dev/{chunk-JX5CEG3A.js.map → chunk-OAIRL2FN.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CollectionColumnTitle
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-P7HX4BAT.js";
|
|
4
4
|
import {
|
|
5
5
|
Checkbox,
|
|
6
6
|
GracefulImage,
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
dummyLink,
|
|
13
13
|
formatDate,
|
|
14
14
|
useNotionContext
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-72RHNPWF.js";
|
|
16
16
|
import {
|
|
17
17
|
__commonJS,
|
|
18
18
|
__objRest,
|
|
19
19
|
__spreadProps,
|
|
20
20
|
__spreadValues,
|
|
21
21
|
__toESM
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-C6BUIPAM.js";
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/@babel+runtime@7.21.5/node_modules/@babel/runtime/helpers/interopRequireDefault.js
|
|
25
25
|
var require_interopRequireDefault = __commonJS({
|
|
@@ -611,16 +611,19 @@ var require_formatters = __commonJS({
|
|
|
611
611
|
G: function G(date, token, localize) {
|
|
612
612
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
|
613
613
|
switch (token) {
|
|
614
|
+
// AD, BC
|
|
614
615
|
case "G":
|
|
615
616
|
case "GG":
|
|
616
617
|
case "GGG":
|
|
617
618
|
return localize.era(era, {
|
|
618
619
|
width: "abbreviated"
|
|
619
620
|
});
|
|
621
|
+
// A, B
|
|
620
622
|
case "GGGGG":
|
|
621
623
|
return localize.era(era, {
|
|
622
624
|
width: "narrow"
|
|
623
625
|
});
|
|
626
|
+
// Anno Domini, Before Christ
|
|
624
627
|
case "GGGG":
|
|
625
628
|
default:
|
|
626
629
|
return localize.era(era, {
|
|
@@ -676,24 +679,30 @@ var require_formatters = __commonJS({
|
|
|
676
679
|
Q: function Q(date, token, localize) {
|
|
677
680
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
678
681
|
switch (token) {
|
|
682
|
+
// 1, 2, 3, 4
|
|
679
683
|
case "Q":
|
|
680
684
|
return String(quarter);
|
|
685
|
+
// 01, 02, 03, 04
|
|
681
686
|
case "QQ":
|
|
682
687
|
return (0, _index6.default)(quarter, 2);
|
|
688
|
+
// 1st, 2nd, 3rd, 4th
|
|
683
689
|
case "Qo":
|
|
684
690
|
return localize.ordinalNumber(quarter, {
|
|
685
691
|
unit: "quarter"
|
|
686
692
|
});
|
|
693
|
+
// Q1, Q2, Q3, Q4
|
|
687
694
|
case "QQQ":
|
|
688
695
|
return localize.quarter(quarter, {
|
|
689
696
|
width: "abbreviated",
|
|
690
697
|
context: "formatting"
|
|
691
698
|
});
|
|
699
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
692
700
|
case "QQQQQ":
|
|
693
701
|
return localize.quarter(quarter, {
|
|
694
702
|
width: "narrow",
|
|
695
703
|
context: "formatting"
|
|
696
704
|
});
|
|
705
|
+
// 1st quarter, 2nd quarter, ...
|
|
697
706
|
case "QQQQ":
|
|
698
707
|
default:
|
|
699
708
|
return localize.quarter(quarter, {
|
|
@@ -706,24 +715,30 @@ var require_formatters = __commonJS({
|
|
|
706
715
|
q: function q(date, token, localize) {
|
|
707
716
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
|
708
717
|
switch (token) {
|
|
718
|
+
// 1, 2, 3, 4
|
|
709
719
|
case "q":
|
|
710
720
|
return String(quarter);
|
|
721
|
+
// 01, 02, 03, 04
|
|
711
722
|
case "qq":
|
|
712
723
|
return (0, _index6.default)(quarter, 2);
|
|
724
|
+
// 1st, 2nd, 3rd, 4th
|
|
713
725
|
case "qo":
|
|
714
726
|
return localize.ordinalNumber(quarter, {
|
|
715
727
|
unit: "quarter"
|
|
716
728
|
});
|
|
729
|
+
// Q1, Q2, Q3, Q4
|
|
717
730
|
case "qqq":
|
|
718
731
|
return localize.quarter(quarter, {
|
|
719
732
|
width: "abbreviated",
|
|
720
733
|
context: "standalone"
|
|
721
734
|
});
|
|
735
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
722
736
|
case "qqqqq":
|
|
723
737
|
return localize.quarter(quarter, {
|
|
724
738
|
width: "narrow",
|
|
725
739
|
context: "standalone"
|
|
726
740
|
});
|
|
741
|
+
// 1st quarter, 2nd quarter, ...
|
|
727
742
|
case "qqqq":
|
|
728
743
|
default:
|
|
729
744
|
return localize.quarter(quarter, {
|
|
@@ -739,20 +754,24 @@ var require_formatters = __commonJS({
|
|
|
739
754
|
case "M":
|
|
740
755
|
case "MM":
|
|
741
756
|
return _index7.default.M(date, token);
|
|
757
|
+
// 1st, 2nd, ..., 12th
|
|
742
758
|
case "Mo":
|
|
743
759
|
return localize.ordinalNumber(month + 1, {
|
|
744
760
|
unit: "month"
|
|
745
761
|
});
|
|
762
|
+
// Jan, Feb, ..., Dec
|
|
746
763
|
case "MMM":
|
|
747
764
|
return localize.month(month, {
|
|
748
765
|
width: "abbreviated",
|
|
749
766
|
context: "formatting"
|
|
750
767
|
});
|
|
768
|
+
// J, F, ..., D
|
|
751
769
|
case "MMMMM":
|
|
752
770
|
return localize.month(month, {
|
|
753
771
|
width: "narrow",
|
|
754
772
|
context: "formatting"
|
|
755
773
|
});
|
|
774
|
+
// January, February, ..., December
|
|
756
775
|
case "MMMM":
|
|
757
776
|
default:
|
|
758
777
|
return localize.month(month, {
|
|
@@ -765,24 +784,30 @@ var require_formatters = __commonJS({
|
|
|
765
784
|
L: function L(date, token, localize) {
|
|
766
785
|
var month = date.getUTCMonth();
|
|
767
786
|
switch (token) {
|
|
787
|
+
// 1, 2, ..., 12
|
|
768
788
|
case "L":
|
|
769
789
|
return String(month + 1);
|
|
790
|
+
// 01, 02, ..., 12
|
|
770
791
|
case "LL":
|
|
771
792
|
return (0, _index6.default)(month + 1, 2);
|
|
793
|
+
// 1st, 2nd, ..., 12th
|
|
772
794
|
case "Lo":
|
|
773
795
|
return localize.ordinalNumber(month + 1, {
|
|
774
796
|
unit: "month"
|
|
775
797
|
});
|
|
798
|
+
// Jan, Feb, ..., Dec
|
|
776
799
|
case "LLL":
|
|
777
800
|
return localize.month(month, {
|
|
778
801
|
width: "abbreviated",
|
|
779
802
|
context: "standalone"
|
|
780
803
|
});
|
|
804
|
+
// J, F, ..., D
|
|
781
805
|
case "LLLLL":
|
|
782
806
|
return localize.month(month, {
|
|
783
807
|
width: "narrow",
|
|
784
808
|
context: "standalone"
|
|
785
809
|
});
|
|
810
|
+
// January, February, ..., December
|
|
786
811
|
case "LLLL":
|
|
787
812
|
default:
|
|
788
813
|
return localize.month(month, {
|
|
@@ -834,6 +859,7 @@ var require_formatters = __commonJS({
|
|
|
834
859
|
E: function E(date, token, localize) {
|
|
835
860
|
var dayOfWeek = date.getUTCDay();
|
|
836
861
|
switch (token) {
|
|
862
|
+
// Tue
|
|
837
863
|
case "E":
|
|
838
864
|
case "EE":
|
|
839
865
|
case "EEE":
|
|
@@ -841,16 +867,19 @@ var require_formatters = __commonJS({
|
|
|
841
867
|
width: "abbreviated",
|
|
842
868
|
context: "formatting"
|
|
843
869
|
});
|
|
870
|
+
// T
|
|
844
871
|
case "EEEEE":
|
|
845
872
|
return localize.day(dayOfWeek, {
|
|
846
873
|
width: "narrow",
|
|
847
874
|
context: "formatting"
|
|
848
875
|
});
|
|
876
|
+
// Tu
|
|
849
877
|
case "EEEEEE":
|
|
850
878
|
return localize.day(dayOfWeek, {
|
|
851
879
|
width: "short",
|
|
852
880
|
context: "formatting"
|
|
853
881
|
});
|
|
882
|
+
// Tuesday
|
|
854
883
|
case "EEEE":
|
|
855
884
|
default:
|
|
856
885
|
return localize.day(dayOfWeek, {
|
|
@@ -864,10 +893,13 @@ var require_formatters = __commonJS({
|
|
|
864
893
|
var dayOfWeek = date.getUTCDay();
|
|
865
894
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
866
895
|
switch (token) {
|
|
896
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
867
897
|
case "e":
|
|
868
898
|
return String(localDayOfWeek);
|
|
899
|
+
// Padded numerical value
|
|
869
900
|
case "ee":
|
|
870
901
|
return (0, _index6.default)(localDayOfWeek, 2);
|
|
902
|
+
// 1st, 2nd, ..., 7th
|
|
871
903
|
case "eo":
|
|
872
904
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
873
905
|
unit: "day"
|
|
@@ -877,16 +909,19 @@ var require_formatters = __commonJS({
|
|
|
877
909
|
width: "abbreviated",
|
|
878
910
|
context: "formatting"
|
|
879
911
|
});
|
|
912
|
+
// T
|
|
880
913
|
case "eeeee":
|
|
881
914
|
return localize.day(dayOfWeek, {
|
|
882
915
|
width: "narrow",
|
|
883
916
|
context: "formatting"
|
|
884
917
|
});
|
|
918
|
+
// Tu
|
|
885
919
|
case "eeeeee":
|
|
886
920
|
return localize.day(dayOfWeek, {
|
|
887
921
|
width: "short",
|
|
888
922
|
context: "formatting"
|
|
889
923
|
});
|
|
924
|
+
// Tuesday
|
|
890
925
|
case "eeee":
|
|
891
926
|
default:
|
|
892
927
|
return localize.day(dayOfWeek, {
|
|
@@ -900,10 +935,13 @@ var require_formatters = __commonJS({
|
|
|
900
935
|
var dayOfWeek = date.getUTCDay();
|
|
901
936
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
902
937
|
switch (token) {
|
|
938
|
+
// Numerical value (same as in `e`)
|
|
903
939
|
case "c":
|
|
904
940
|
return String(localDayOfWeek);
|
|
941
|
+
// Padded numerical value
|
|
905
942
|
case "cc":
|
|
906
943
|
return (0, _index6.default)(localDayOfWeek, token.length);
|
|
944
|
+
// 1st, 2nd, ..., 7th
|
|
907
945
|
case "co":
|
|
908
946
|
return localize.ordinalNumber(localDayOfWeek, {
|
|
909
947
|
unit: "day"
|
|
@@ -913,16 +951,19 @@ var require_formatters = __commonJS({
|
|
|
913
951
|
width: "abbreviated",
|
|
914
952
|
context: "standalone"
|
|
915
953
|
});
|
|
954
|
+
// T
|
|
916
955
|
case "ccccc":
|
|
917
956
|
return localize.day(dayOfWeek, {
|
|
918
957
|
width: "narrow",
|
|
919
958
|
context: "standalone"
|
|
920
959
|
});
|
|
960
|
+
// Tu
|
|
921
961
|
case "cccccc":
|
|
922
962
|
return localize.day(dayOfWeek, {
|
|
923
963
|
width: "short",
|
|
924
964
|
context: "standalone"
|
|
925
965
|
});
|
|
966
|
+
// Tuesday
|
|
926
967
|
case "cccc":
|
|
927
968
|
default:
|
|
928
969
|
return localize.day(dayOfWeek, {
|
|
@@ -936,29 +977,36 @@ var require_formatters = __commonJS({
|
|
|
936
977
|
var dayOfWeek = date.getUTCDay();
|
|
937
978
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
938
979
|
switch (token) {
|
|
980
|
+
// 2
|
|
939
981
|
case "i":
|
|
940
982
|
return String(isoDayOfWeek);
|
|
983
|
+
// 02
|
|
941
984
|
case "ii":
|
|
942
985
|
return (0, _index6.default)(isoDayOfWeek, token.length);
|
|
986
|
+
// 2nd
|
|
943
987
|
case "io":
|
|
944
988
|
return localize.ordinalNumber(isoDayOfWeek, {
|
|
945
989
|
unit: "day"
|
|
946
990
|
});
|
|
991
|
+
// Tue
|
|
947
992
|
case "iii":
|
|
948
993
|
return localize.day(dayOfWeek, {
|
|
949
994
|
width: "abbreviated",
|
|
950
995
|
context: "formatting"
|
|
951
996
|
});
|
|
997
|
+
// T
|
|
952
998
|
case "iiiii":
|
|
953
999
|
return localize.day(dayOfWeek, {
|
|
954
1000
|
width: "narrow",
|
|
955
1001
|
context: "formatting"
|
|
956
1002
|
});
|
|
1003
|
+
// Tu
|
|
957
1004
|
case "iiiiii":
|
|
958
1005
|
return localize.day(dayOfWeek, {
|
|
959
1006
|
width: "short",
|
|
960
1007
|
context: "formatting"
|
|
961
1008
|
});
|
|
1009
|
+
// Tuesday
|
|
962
1010
|
case "iiii":
|
|
963
1011
|
default:
|
|
964
1012
|
return localize.day(dayOfWeek, {
|
|
@@ -1070,8 +1118,7 @@ var require_formatters = __commonJS({
|
|
|
1070
1118
|
h: function h(date, token, localize) {
|
|
1071
1119
|
if (token === "ho") {
|
|
1072
1120
|
var hours = date.getUTCHours() % 12;
|
|
1073
|
-
if (hours === 0)
|
|
1074
|
-
hours = 12;
|
|
1121
|
+
if (hours === 0) hours = 12;
|
|
1075
1122
|
return localize.ordinalNumber(hours, {
|
|
1076
1123
|
unit: "hour"
|
|
1077
1124
|
});
|
|
@@ -1100,8 +1147,7 @@ var require_formatters = __commonJS({
|
|
|
1100
1147
|
// Hour [1-24]
|
|
1101
1148
|
k: function k(date, token, localize) {
|
|
1102
1149
|
var hours = date.getUTCHours();
|
|
1103
|
-
if (hours === 0)
|
|
1104
|
-
hours = 24;
|
|
1150
|
+
if (hours === 0) hours = 24;
|
|
1105
1151
|
if (token === "ko") {
|
|
1106
1152
|
return localize.ordinalNumber(hours, {
|
|
1107
1153
|
unit: "hour"
|
|
@@ -1139,13 +1185,21 @@ var require_formatters = __commonJS({
|
|
|
1139
1185
|
return "Z";
|
|
1140
1186
|
}
|
|
1141
1187
|
switch (token) {
|
|
1188
|
+
// Hours and optional minutes
|
|
1142
1189
|
case "X":
|
|
1143
1190
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
1191
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1192
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1193
|
+
// so this token always has the same output as `XX`
|
|
1144
1194
|
case "XXXX":
|
|
1145
1195
|
case "XX":
|
|
1146
1196
|
return formatTimezone(timezoneOffset);
|
|
1197
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
1198
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1199
|
+
// so this token always has the same output as `XXX`
|
|
1147
1200
|
case "XXXXX":
|
|
1148
1201
|
case "XXX":
|
|
1202
|
+
// Hours and minutes with `:` delimiter
|
|
1149
1203
|
default:
|
|
1150
1204
|
return formatTimezone(timezoneOffset, ":");
|
|
1151
1205
|
}
|
|
@@ -1155,13 +1209,21 @@ var require_formatters = __commonJS({
|
|
|
1155
1209
|
var originalDate = options._originalDate || date;
|
|
1156
1210
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1157
1211
|
switch (token) {
|
|
1212
|
+
// Hours and optional minutes
|
|
1158
1213
|
case "x":
|
|
1159
1214
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
1215
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
1216
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1217
|
+
// so this token always has the same output as `xx`
|
|
1160
1218
|
case "xxxx":
|
|
1161
1219
|
case "xx":
|
|
1162
1220
|
return formatTimezone(timezoneOffset);
|
|
1221
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
1222
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1223
|
+
// so this token always has the same output as `xxx`
|
|
1163
1224
|
case "xxxxx":
|
|
1164
1225
|
case "xxx":
|
|
1226
|
+
// Hours and minutes with `:` delimiter
|
|
1165
1227
|
default:
|
|
1166
1228
|
return formatTimezone(timezoneOffset, ":");
|
|
1167
1229
|
}
|
|
@@ -1171,10 +1233,12 @@ var require_formatters = __commonJS({
|
|
|
1171
1233
|
var originalDate = options._originalDate || date;
|
|
1172
1234
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1173
1235
|
switch (token) {
|
|
1236
|
+
// Short
|
|
1174
1237
|
case "O":
|
|
1175
1238
|
case "OO":
|
|
1176
1239
|
case "OOO":
|
|
1177
1240
|
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
1241
|
+
// Long
|
|
1178
1242
|
case "OOOO":
|
|
1179
1243
|
default:
|
|
1180
1244
|
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
@@ -1185,10 +1249,12 @@ var require_formatters = __commonJS({
|
|
|
1185
1249
|
var originalDate = options._originalDate || date;
|
|
1186
1250
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
|
1187
1251
|
switch (token) {
|
|
1252
|
+
// Short
|
|
1188
1253
|
case "z":
|
|
1189
1254
|
case "zz":
|
|
1190
1255
|
case "zzz":
|
|
1191
1256
|
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
1257
|
+
// Long
|
|
1192
1258
|
case "zzzz":
|
|
1193
1259
|
default:
|
|
1194
1260
|
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
@@ -1809,12 +1875,10 @@ var require_buildMatchPatternFn = __commonJS({
|
|
|
1809
1875
|
return function(string) {
|
|
1810
1876
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1811
1877
|
var matchResult = string.match(args.matchPattern);
|
|
1812
|
-
if (!matchResult)
|
|
1813
|
-
return null;
|
|
1878
|
+
if (!matchResult) return null;
|
|
1814
1879
|
var matchedString = matchResult[0];
|
|
1815
1880
|
var parseResult = string.match(args.parsePattern);
|
|
1816
|
-
if (!parseResult)
|
|
1817
|
-
return null;
|
|
1881
|
+
if (!parseResult) return null;
|
|
1818
1882
|
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
1819
1883
|
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
1820
1884
|
var rest = string.slice(matchedString.length);
|
|
@@ -2155,18 +2219,12 @@ var require_format_number = __commonJS({
|
|
|
2155
2219
|
output.push(options.prefix);
|
|
2156
2220
|
}
|
|
2157
2221
|
number = number.split(".");
|
|
2158
|
-
if (options.round != null)
|
|
2159
|
-
|
|
2160
|
-
if (options.
|
|
2161
|
-
|
|
2162
|
-
if (
|
|
2163
|
-
|
|
2164
|
-
if (options.padRight > 0)
|
|
2165
|
-
number[1] = padRight(number[1], options.padRight);
|
|
2166
|
-
if (!overrideOptions.noSeparator && number[1])
|
|
2167
|
-
number[1] = addDecimalSeparators(number[1], options.decimalsSeparator);
|
|
2168
|
-
if (!overrideOptions.noSeparator && number[0])
|
|
2169
|
-
number[0] = addIntegerSeparators(number[0], options.integerSeparator);
|
|
2222
|
+
if (options.round != null) round(number, options.round);
|
|
2223
|
+
if (options.truncate != null) number[1] = truncate(number[1], options.truncate);
|
|
2224
|
+
if (options.padLeft > 0) number[0] = padLeft(number[0], options.padLeft);
|
|
2225
|
+
if (options.padRight > 0) number[1] = padRight(number[1], options.padRight);
|
|
2226
|
+
if (!overrideOptions.noSeparator && number[1]) number[1] = addDecimalSeparators(number[1], options.decimalsSeparator);
|
|
2227
|
+
if (!overrideOptions.noSeparator && number[0]) number[0] = addIntegerSeparators(number[0], options.integerSeparator);
|
|
2170
2228
|
output.push(number[0]);
|
|
2171
2229
|
if (number[1]) {
|
|
2172
2230
|
output.push(options.decimal);
|
|
@@ -2238,8 +2296,7 @@ var require_format_number = __commonJS({
|
|
|
2238
2296
|
}
|
|
2239
2297
|
function addIntegerSeparators(x, separator) {
|
|
2240
2298
|
x += "";
|
|
2241
|
-
if (!separator)
|
|
2242
|
-
return x;
|
|
2299
|
+
if (!separator) return x;
|
|
2243
2300
|
var rgx = /(\d+)(\d{3})/;
|
|
2244
2301
|
while (rgx.test(x)) {
|
|
2245
2302
|
x = x.replace(rgx, "$1" + separator + "$2");
|
|
@@ -2248,8 +2305,7 @@ var require_format_number = __commonJS({
|
|
|
2248
2305
|
}
|
|
2249
2306
|
function addDecimalSeparators(x, separator) {
|
|
2250
2307
|
x += "";
|
|
2251
|
-
if (!separator)
|
|
2252
|
-
return x;
|
|
2308
|
+
if (!separator) return x;
|
|
2253
2309
|
var rgx = /(\d{3})(\d+)/;
|
|
2254
2310
|
while (rgx.test(x)) {
|
|
2255
2311
|
x = x.replace(rgx, "$1" + separator + "$2");
|
|
@@ -2392,8 +2448,7 @@ var require_add = __commonJS({
|
|
|
2392
2448
|
var _index5 = _interopRequireDefault(require_toInteger());
|
|
2393
2449
|
function add2(dirtyDate, duration) {
|
|
2394
2450
|
(0, _index4.default)(2, arguments);
|
|
2395
|
-
if (!duration || (0, _typeof2.default)(duration) !== "object")
|
|
2396
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
2451
|
+
if (!duration || (0, _typeof2.default)(duration) !== "object") return /* @__PURE__ */ new Date(NaN);
|
|
2397
2452
|
var years = duration.years ? (0, _index5.default)(duration.years) : 0;
|
|
2398
2453
|
var months = duration.months ? (0, _index5.default)(duration.months) : 0;
|
|
2399
2454
|
var weeks = duration.weeks ? (0, _index5.default)(duration.weeks) : 0;
|
|
@@ -3006,10 +3061,8 @@ var require_intervalToDuration = __commonJS({
|
|
|
3006
3061
|
(0, _index10.default)(1, arguments);
|
|
3007
3062
|
var start = (0, _index9.default)(interval.start);
|
|
3008
3063
|
var end = (0, _index9.default)(interval.end);
|
|
3009
|
-
if (isNaN(start.getTime()))
|
|
3010
|
-
|
|
3011
|
-
if (isNaN(end.getTime()))
|
|
3012
|
-
throw new RangeError("End Date is invalid");
|
|
3064
|
+
if (isNaN(start.getTime())) throw new RangeError("Start Date is invalid");
|
|
3065
|
+
if (isNaN(end.getTime())) throw new RangeError("End Date is invalid");
|
|
3013
3066
|
var duration = {};
|
|
3014
3067
|
duration.years = Math.abs((0, _index8.default)(end, start));
|
|
3015
3068
|
var sign = (0, _index.default)(end, start);
|
|
@@ -3097,8 +3150,7 @@ var require_sub = __commonJS({
|
|
|
3097
3150
|
var _index4 = _interopRequireDefault(require_toInteger());
|
|
3098
3151
|
function sub2(date, duration) {
|
|
3099
3152
|
(0, _index3.default)(2, arguments);
|
|
3100
|
-
if (!duration || (0, _typeof2.default)(duration) !== "object")
|
|
3101
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
3153
|
+
if (!duration || (0, _typeof2.default)(duration) !== "object") return /* @__PURE__ */ new Date(NaN);
|
|
3102
3154
|
var years = duration.years ? (0, _index4.default)(duration.years) : 0;
|
|
3103
3155
|
var months = duration.months ? (0, _index4.default)(duration.months) : 0;
|
|
3104
3156
|
var weeks = duration.weeks ? (0, _index4.default)(duration.weeks) : 0;
|
|
@@ -3169,8 +3221,7 @@ var iconMap = {
|
|
|
3169
3221
|
var CollectionViewIcon = (_a) => {
|
|
3170
3222
|
var _b = _a, { type } = _b, rest = __objRest(_b, ["type"]);
|
|
3171
3223
|
const icon = iconMap[type];
|
|
3172
|
-
if (!icon)
|
|
3173
|
-
return null;
|
|
3224
|
+
if (!icon) return null;
|
|
3174
3225
|
return icon(rest);
|
|
3175
3226
|
};
|
|
3176
3227
|
|
|
@@ -3219,10 +3270,8 @@ function evalFormula(formula, context) {
|
|
|
3219
3270
|
case "number":
|
|
3220
3271
|
return parseFloat(text);
|
|
3221
3272
|
case "boolean":
|
|
3222
|
-
if (typeof text === "string")
|
|
3223
|
-
|
|
3224
|
-
else
|
|
3225
|
-
return !!text;
|
|
3273
|
+
if (typeof text === "string") return text === "true";
|
|
3274
|
+
else return !!text;
|
|
3226
3275
|
case "date": {
|
|
3227
3276
|
const v = getDateValue(value);
|
|
3228
3277
|
if (v)
|
|
@@ -3233,14 +3282,15 @@ function evalFormula(formula, context) {
|
|
|
3233
3282
|
const date = new Date(v.start_date);
|
|
3234
3283
|
return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
3235
3284
|
}
|
|
3236
|
-
else
|
|
3237
|
-
return new Date(text);
|
|
3285
|
+
else return new Date(text);
|
|
3238
3286
|
}
|
|
3239
3287
|
default:
|
|
3240
3288
|
return text;
|
|
3241
3289
|
}
|
|
3242
3290
|
}
|
|
3243
3291
|
case "operator":
|
|
3292
|
+
// All operators are exposed as functions, so we handle them the same
|
|
3293
|
+
// eslint-disable-next-line no-fallthrough
|
|
3244
3294
|
case "function":
|
|
3245
3295
|
return evalFunctionFormula(formula, ctx);
|
|
3246
3296
|
default:
|
|
@@ -3250,6 +3300,8 @@ function evalFormula(formula, context) {
|
|
|
3250
3300
|
function evalFunctionFormula(formula, ctx) {
|
|
3251
3301
|
const args = formula == null ? void 0 : formula.args;
|
|
3252
3302
|
switch (formula.name) {
|
|
3303
|
+
// logic
|
|
3304
|
+
// ------------------------------------------------------------------------
|
|
3253
3305
|
case "and":
|
|
3254
3306
|
return evalFormula(args[0], ctx) && evalFormula(args[1], ctx);
|
|
3255
3307
|
case "empty":
|
|
@@ -3272,17 +3324,16 @@ function evalFunctionFormula(formula, ctx) {
|
|
|
3272
3324
|
return evalFormula(args[0], ctx) <= evalFormula(args[1], ctx);
|
|
3273
3325
|
case "unequal":
|
|
3274
3326
|
return evalFormula(args[0], ctx) != evalFormula(args[1], ctx);
|
|
3327
|
+
// numeric
|
|
3328
|
+
// ------------------------------------------------------------------------
|
|
3275
3329
|
case "abs":
|
|
3276
3330
|
return Math.abs(evalFormula(args[0], ctx));
|
|
3277
3331
|
case "add": {
|
|
3278
3332
|
const v0 = evalFormula(args[0], ctx);
|
|
3279
3333
|
const v1 = evalFormula(args[1], ctx);
|
|
3280
|
-
if (typeof v0 === "number")
|
|
3281
|
-
|
|
3282
|
-
else
|
|
3283
|
-
return v0 + `${v1}`;
|
|
3284
|
-
else
|
|
3285
|
-
return v0;
|
|
3334
|
+
if (typeof v0 === "number") return v0 + +v1;
|
|
3335
|
+
else if (typeof v0 === "string") return v0 + `${v1}`;
|
|
3336
|
+
else return v0;
|
|
3286
3337
|
}
|
|
3287
3338
|
case "cbrt":
|
|
3288
3339
|
return Math.cbrt(evalFormula(args[0], ctx));
|
|
@@ -3328,6 +3379,8 @@ function evalFunctionFormula(formula, ctx) {
|
|
|
3328
3379
|
return evalFormula(args[0], ctx) * -1;
|
|
3329
3380
|
case "unaryPlus":
|
|
3330
3381
|
return parseFloat(evalFormula(args[0], ctx));
|
|
3382
|
+
// text
|
|
3383
|
+
// ------------------------------------------------------------------------
|
|
3331
3384
|
case "concat": {
|
|
3332
3385
|
const values = args.map((arg) => evalFormula(arg, ctx));
|
|
3333
3386
|
return values.join("");
|
|
@@ -3340,10 +3393,8 @@ function evalFunctionFormula(formula, ctx) {
|
|
|
3340
3393
|
case "string":
|
|
3341
3394
|
return value;
|
|
3342
3395
|
case "object":
|
|
3343
|
-
if (value instanceof Date)
|
|
3344
|
-
|
|
3345
|
-
else
|
|
3346
|
-
return `${value}`;
|
|
3396
|
+
if (value instanceof Date) return (0, import_format.default)(value, "MMM d, YYY");
|
|
3397
|
+
else return `${value}`;
|
|
3347
3398
|
case "number":
|
|
3348
3399
|
default:
|
|
3349
3400
|
return `${value}`;
|
|
@@ -3380,6 +3431,8 @@ function evalFunctionFormula(formula, ctx) {
|
|
|
3380
3431
|
const regex = evalFormula(args[1], ctx);
|
|
3381
3432
|
return new RegExp(regex).test(value);
|
|
3382
3433
|
}
|
|
3434
|
+
// date & time
|
|
3435
|
+
// ------------------------------------------------------------------------
|
|
3383
3436
|
case "date":
|
|
3384
3437
|
return (0, import_getDate.default)(evalFormula(args[0], ctx));
|
|
3385
3438
|
case "dateAdd": {
|
|
@@ -3436,10 +3489,8 @@ function evalFunctionFormula(formula, ctx) {
|
|
|
3436
3489
|
// src/third-party/property.tsx
|
|
3437
3490
|
var Property = (props) => {
|
|
3438
3491
|
const { components } = useNotionContext();
|
|
3439
|
-
if (components.Property)
|
|
3440
|
-
|
|
3441
|
-
else
|
|
3442
|
-
return /* @__PURE__ */ React6.createElement(PropertyImplMemo, __spreadValues({}, props));
|
|
3492
|
+
if (components.Property) return /* @__PURE__ */ React6.createElement(components.Property, __spreadValues({}, props));
|
|
3493
|
+
else return /* @__PURE__ */ React6.createElement(PropertyImplMemo, __spreadValues({}, props));
|
|
3443
3494
|
};
|
|
3444
3495
|
var PropertyImpl = (props) => {
|
|
3445
3496
|
const { components, mapImageUrl, mapPageUrl } = useNotionContext();
|
|
@@ -3464,10 +3515,8 @@ var PropertyImpl = (props) => {
|
|
|
3464
3515
|
schema: collection == null ? void 0 : collection.schema,
|
|
3465
3516
|
properties: block == null ? void 0 : block.properties
|
|
3466
3517
|
});
|
|
3467
|
-
if (isNaN(content2))
|
|
3468
|
-
|
|
3469
|
-
if (content2 instanceof Date)
|
|
3470
|
-
content2 = (0, import_format2.default)(content2, "MMM d, YYY hh:mm aa");
|
|
3518
|
+
if (isNaN(content2)) console.debug("NaN", schema.formula);
|
|
3519
|
+
if (content2 instanceof Date) content2 = (0, import_format2.default)(content2, "MMM d, YYY hh:mm aa");
|
|
3471
3520
|
} catch (err) {
|
|
3472
3521
|
console.error("error evaluating formula", schema.formula, err);
|
|
3473
3522
|
content2 = null;
|
|
@@ -3486,8 +3535,7 @@ var PropertyImpl = (props) => {
|
|
|
3486
3535
|
() => function FormulaTitle() {
|
|
3487
3536
|
if (block && linkToTitlePage)
|
|
3488
3537
|
return /* @__PURE__ */ React6.createElement(components.PageLink, { className: "notion-page-link", href: mapPageUrl(block.id) }, /* @__PURE__ */ React6.createElement(PageTitle, { block }));
|
|
3489
|
-
else
|
|
3490
|
-
return /* @__PURE__ */ React6.createElement(Text, { value: data, block });
|
|
3538
|
+
else return /* @__PURE__ */ React6.createElement(Text, { value: data, block });
|
|
3491
3539
|
},
|
|
3492
3540
|
[block, components, data, linkToTitlePage, mapPageUrl]
|
|
3493
3541
|
);
|
|
@@ -3612,8 +3660,7 @@ var PropertyImpl = (props) => {
|
|
|
3612
3660
|
},
|
|
3613
3661
|
[block]
|
|
3614
3662
|
);
|
|
3615
|
-
if (!schema)
|
|
3616
|
-
return null;
|
|
3663
|
+
if (!schema) return null;
|
|
3617
3664
|
let content = null;
|
|
3618
3665
|
if (data || schema.type === "checkbox" || schema.type === "title" || schema.type === "formula" || schema.type === "created_by" || schema.type === "last_edited_by" || schema.type === "created_time" || schema.type === "last_edited_time")
|
|
3619
3666
|
switch (schema.type) {
|
|
@@ -3627,6 +3674,7 @@ var PropertyImpl = (props) => {
|
|
|
3627
3674
|
content = components.propertyTitleValue(props, renderTitleValue);
|
|
3628
3675
|
break;
|
|
3629
3676
|
case "select":
|
|
3677
|
+
// intentional fallthrough
|
|
3630
3678
|
case "multi_select": {
|
|
3631
3679
|
const values = (data[0][0] || "").split(",");
|
|
3632
3680
|
content = values.map((value, index) => {
|
|
@@ -3700,8 +3748,7 @@ var CollectionRow = ({ block, pageHeader = false, className }) => {
|
|
|
3700
3748
|
const collectionId = block.parent_id;
|
|
3701
3749
|
const collection = (_a = recordMap.collection[collectionId]) == null ? void 0 : _a.value;
|
|
3702
3750
|
const schemas = collection == null ? void 0 : collection.schema;
|
|
3703
|
-
if (!collection || !schemas)
|
|
3704
|
-
return null;
|
|
3751
|
+
if (!collection || !schemas) return null;
|
|
3705
3752
|
let propertyIds = Object.keys(schemas).filter((id) => id !== "title");
|
|
3706
3753
|
if ((_b = collection.format) == null ? void 0 : _b.property_visibility)
|
|
3707
3754
|
propertyIds = propertyIds.filter(
|
|
@@ -3782,8 +3829,7 @@ var CollectionCard = (_a) => {
|
|
|
3782
3829
|
const contentBlockId = (_a2 = block.content) == null ? void 0 : _a2.find((blockId) => {
|
|
3783
3830
|
var _a3;
|
|
3784
3831
|
const block2 = (_a3 = recordMap.block[blockId]) == null ? void 0 : _a3.value;
|
|
3785
|
-
if ((block2 == null ? void 0 : block2.type) === "image")
|
|
3786
|
-
return true;
|
|
3832
|
+
if ((block2 == null ? void 0 : block2.type) === "image") return true;
|
|
3787
3833
|
});
|
|
3788
3834
|
if (contentBlockId) {
|
|
3789
3835
|
const contentBlock = (_b2 = recordMap.block[contentBlockId]) == null ? void 0 : _b2.value;
|
|
@@ -3803,8 +3849,7 @@ var CollectionCard = (_a) => {
|
|
|
3803
3849
|
);
|
|
3804
3850
|
}
|
|
3805
3851
|
}
|
|
3806
|
-
if (!coverContent)
|
|
3807
|
-
coverContent = /* @__PURE__ */ React9.createElement("div", { className: "notion-collection-card-cover-empty" });
|
|
3852
|
+
if (!coverContent) coverContent = /* @__PURE__ */ React9.createElement("div", { className: "notion-collection-card-cover-empty" });
|
|
3808
3853
|
} else if ((cover == null ? void 0 : cover.type) === "page_cover") {
|
|
3809
3854
|
const { page_cover } = block.format || {};
|
|
3810
3855
|
if (page_cover) {
|
|
@@ -3848,8 +3893,7 @@ var CollectionCard = (_a) => {
|
|
|
3848
3893
|
let linkProperties = [];
|
|
3849
3894
|
if (isLinkCollectionToUrlProperty)
|
|
3850
3895
|
linkProperties = (_m = properties == null ? void 0 : properties.filter((p) => p.visible && p.property !== "title" && collection.schema[p.property]).filter((p) => {
|
|
3851
|
-
if (!block.properties)
|
|
3852
|
-
return false;
|
|
3896
|
+
if (!block.properties) return false;
|
|
3853
3897
|
const schema = collection.schema[p.property];
|
|
3854
3898
|
return schema.type == "url";
|
|
3855
3899
|
}).map((p) => {
|
|
@@ -3859,8 +3903,7 @@ var CollectionCard = (_a) => {
|
|
|
3859
3903
|
if (linkProperties && linkProperties.length > 0 && linkProperties[0].length > 0 && linkProperties[0][0].length > 0)
|
|
3860
3904
|
url = linkProperties[0][0][0];
|
|
3861
3905
|
const innerCard = /* @__PURE__ */ React9.createElement(React9.Fragment, null, (coverContent || (cover == null ? void 0 : cover.type) !== "none") && /* @__PURE__ */ React9.createElement("div", { className: "notion-collection-card-cover" }, coverContent), /* @__PURE__ */ React9.createElement("div", { className: "notion-collection-card-body" }, /* @__PURE__ */ React9.createElement("div", { className: "notion-collection-card-property" }, /* @__PURE__ */ React9.createElement(Property, { schema: collection.schema.title, data: (_n = block == null ? void 0 : block.properties) == null ? void 0 : _n.title, block, collection })), properties == null ? void 0 : properties.filter((p) => p.visible && p.property !== "title" && collection.schema[p.property]).map((p) => {
|
|
3862
|
-
if (!block.properties)
|
|
3863
|
-
return null;
|
|
3906
|
+
if (!block.properties) return null;
|
|
3864
3907
|
const schema = collection.schema[p.property];
|
|
3865
3908
|
const data = block.properties[p.property];
|
|
3866
3909
|
return /* @__PURE__ */ React9.createElement("div", { className: "notion-collection-card-property", key: p.property }, /* @__PURE__ */ React9.createElement(Property, { schema, data, block, collection, inline: true }));
|
|
@@ -3914,8 +3957,7 @@ var CollectionGroup = (_a) => {
|
|
|
3914
3957
|
"summaryProps",
|
|
3915
3958
|
"detailsProps"
|
|
3916
3959
|
]);
|
|
3917
|
-
if (hidden)
|
|
3918
|
-
return null;
|
|
3960
|
+
if (hidden) return null;
|
|
3919
3961
|
return /* @__PURE__ */ React10.createElement("details", __spreadValues({ open: true, className: "notion-collection-group" }, detailsProps), /* @__PURE__ */ React10.createElement("summary", __spreadValues({ className: "notion-collection-group-title" }, summaryProps), /* @__PURE__ */ React10.createElement("div", null, /* @__PURE__ */ React10.createElement(Property, { schema, data: [[value]], collection }), /* @__PURE__ */ React10.createElement("span", { className: "notion-board-th-count" }, collectionGroup == null ? void 0 : collectionGroup.total))), /* @__PURE__ */ React10.createElement(CollectionViewComponent, __spreadValues({ collection, collectionGroup }, rest)));
|
|
3920
3962
|
};
|
|
3921
3963
|
|
|
@@ -3932,8 +3974,7 @@ function getCollectionGroups(collection, collectionView, collectionData, ...rest
|
|
|
3932
3974
|
const collectionGroup = collectionData[`results:${type}:${queryLabel}`];
|
|
3933
3975
|
let queryValue = !isUncategorizedValue && (isDateValue || (value == null ? void 0 : value.value) || value);
|
|
3934
3976
|
let schema = collection.schema[property];
|
|
3935
|
-
if (type === "checkbox" && value)
|
|
3936
|
-
queryValue = "Yes";
|
|
3977
|
+
if (type === "checkbox" && value) queryValue = "Yes";
|
|
3937
3978
|
if (isDateValue) {
|
|
3938
3979
|
schema = {
|
|
3939
3980
|
type: "text",
|
|
@@ -4002,25 +4043,20 @@ function Board({ collectionView, collectionData, collection, padding }) {
|
|
|
4002
4043
|
return null;
|
|
4003
4044
|
const group = collectionData.board_columns.results[index];
|
|
4004
4045
|
const schema = collection.schema[p.property];
|
|
4005
|
-
if (!group || !schema || p.hidden)
|
|
4006
|
-
return null;
|
|
4046
|
+
if (!group || !schema || p.hidden) return null;
|
|
4007
4047
|
return /* @__PURE__ */ React11.createElement("div", { className: "notion-board-th", key: index }, /* @__PURE__ */ React11.createElement("div", { className: "notion-board-th-body" }, ((_b2 = group.value) == null ? void 0 : _b2.value) ? /* @__PURE__ */ React11.createElement(Property, { schema, data: [[(_c = group.value) == null ? void 0 : _c.value]], collection }) : /* @__PURE__ */ React11.createElement("span", null, /* @__PURE__ */ React11.createElement(EmptyIcon, { className: "notion-board-th-empty" }), " No Select"), /* @__PURE__ */ React11.createElement("span", { className: "notion-board-th-count" }, group.total)));
|
|
4008
4048
|
}))), /* @__PURE__ */ React11.createElement("div", { className: "notion-board-header-placeholder" }), /* @__PURE__ */ React11.createElement("div", { className: "notion-board-body" }, boardGroups.map((p, index) => {
|
|
4009
4049
|
var _a2, _b2, _c, _d, _e;
|
|
4010
4050
|
const boardResults = (_a2 = collectionData.board_columns) == null ? void 0 : _a2.results;
|
|
4011
|
-
if (!boardResults)
|
|
4012
|
-
|
|
4013
|
-
if (!((_b2 = p == null ? void 0 : p.value) == null ? void 0 : _b2.type))
|
|
4014
|
-
return null;
|
|
4051
|
+
if (!boardResults) return null;
|
|
4052
|
+
if (!((_b2 = p == null ? void 0 : p.value) == null ? void 0 : _b2.type)) return null;
|
|
4015
4053
|
const schema = collection.schema[p.property];
|
|
4016
4054
|
const group = collectionData[`results:${(_c = p == null ? void 0 : p.value) == null ? void 0 : _c.type}:${((_d = p == null ? void 0 : p.value) == null ? void 0 : _d.value) || "uncategorized"}`];
|
|
4017
|
-
if (!group || !schema || p.hidden)
|
|
4018
|
-
return null;
|
|
4055
|
+
if (!group || !schema || p.hidden) return null;
|
|
4019
4056
|
return /* @__PURE__ */ React11.createElement("div", { className: "notion-board-group", key: index }, (_e = group.blockIds) == null ? void 0 : _e.map((blockId) => {
|
|
4020
4057
|
var _a3, _b3;
|
|
4021
4058
|
const block = (_a3 = recordMap.block[blockId]) == null ? void 0 : _a3.value;
|
|
4022
|
-
if (!block)
|
|
4023
|
-
return null;
|
|
4059
|
+
if (!block) return null;
|
|
4024
4060
|
return /* @__PURE__ */ React11.createElement(
|
|
4025
4061
|
CollectionCard,
|
|
4026
4062
|
{
|
|
@@ -4061,8 +4097,7 @@ function Gallery({ blockIds, collectionView, collection }) {
|
|
|
4061
4097
|
return /* @__PURE__ */ React12.createElement("div", { className: "notion-gallery" }, /* @__PURE__ */ React12.createElement("div", { className: "notion-gallery-view" }, /* @__PURE__ */ React12.createElement("div", { className: `notion-gallery-grid ${`notion-gallery-grid-size-${gallery_cover_size}`}` }, blockIds == null ? void 0 : blockIds.map((blockId) => {
|
|
4062
4098
|
var _a, _b;
|
|
4063
4099
|
const block = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value;
|
|
4064
|
-
if (!block)
|
|
4065
|
-
return null;
|
|
4100
|
+
if (!block) return null;
|
|
4066
4101
|
return /* @__PURE__ */ React12.createElement(
|
|
4067
4102
|
CollectionCard,
|
|
4068
4103
|
{
|
|
@@ -4096,16 +4131,14 @@ function List({ blockIds, collection, collectionView }) {
|
|
|
4096
4131
|
return /* @__PURE__ */ React13.createElement("div", { className: "notion-list-collection" }, /* @__PURE__ */ React13.createElement("div", { className: "notion-list-view" }, /* @__PURE__ */ React13.createElement("div", { className: "notion-list-body" }, blockIds == null ? void 0 : blockIds.map((blockId) => {
|
|
4097
4132
|
var _a, _b, _c, _d;
|
|
4098
4133
|
const block = (_a = recordMap.block[blockId]) == null ? void 0 : _a.value;
|
|
4099
|
-
if (!block)
|
|
4100
|
-
return null;
|
|
4134
|
+
if (!block) return null;
|
|
4101
4135
|
const titleSchema = collection.schema.title;
|
|
4102
4136
|
const titleData = (_b = block == null ? void 0 : block.properties) == null ? void 0 : _b.title;
|
|
4103
4137
|
return /* @__PURE__ */ React13.createElement(components.PageLink, { className: "notion-list-item notion-page-link", href: mapPageUrl(block.id), key: blockId }, /* @__PURE__ */ React13.createElement("div", { className: "notion-list-item-title" }, /* @__PURE__ */ React13.createElement(Property, { schema: titleSchema, data: titleData, block, collection })), /* @__PURE__ */ React13.createElement("div", { className: "notion-list-item-body" }, (_d = (_c = collectionView.format) == null ? void 0 : _c.list_properties) == null ? void 0 : _d.filter((p) => p.visible).map((p) => {
|
|
4104
4138
|
var _a2;
|
|
4105
4139
|
const schema = collection.schema[p.property];
|
|
4106
4140
|
const data = block && ((_a2 = block.properties) == null ? void 0 : _a2[p.property]);
|
|
4107
|
-
if (!schema)
|
|
4108
|
-
return null;
|
|
4141
|
+
if (!schema) return null;
|
|
4109
4142
|
return /* @__PURE__ */ React13.createElement("div", { className: "notion-list-item-property", key: p.property }, /* @__PURE__ */ React13.createElement(Property, { schema, data, block, collection }));
|
|
4110
4143
|
})));
|
|
4111
4144
|
}))));
|
|
@@ -4172,12 +4205,9 @@ function Table({ blockIds = [], collection, collectionView, width, padding }) {
|
|
|
4172
4205
|
const schema = (_a2 = collection.schema) == null ? void 0 : _a2[p.property];
|
|
4173
4206
|
const isTitle = p.property === "title";
|
|
4174
4207
|
const style = {};
|
|
4175
|
-
if (p.width)
|
|
4176
|
-
|
|
4177
|
-
else
|
|
4178
|
-
style.width = 280;
|
|
4179
|
-
else
|
|
4180
|
-
style.width = 200;
|
|
4208
|
+
if (p.width) style.width = p.width;
|
|
4209
|
+
else if (isTitle) style.width = 280;
|
|
4210
|
+
else style.width = 200;
|
|
4181
4211
|
return /* @__PURE__ */ React14.createElement("div", { className: "notion-table-th", key: p.property }, /* @__PURE__ */ React14.createElement("div", { className: "notion-table-view-header-cell", style }, /* @__PURE__ */ React14.createElement("div", { className: "notion-table-view-header-cell-inner" }, /* @__PURE__ */ React14.createElement(CollectionColumnTitle, { schema }))));
|
|
4182
4212
|
}))), /* @__PURE__ */ React14.createElement("div", { className: "notion-table-header-placeholder" }), /* @__PURE__ */ React14.createElement("div", { className: "notion-table-body" }, blockIds == null ? void 0 : blockIds.map((blockId) => /* @__PURE__ */ React14.createElement("div", { className: "notion-table-row", key: blockId }, properties.map((p) => {
|
|
4183
4213
|
var _a2, _b, _c;
|
|
@@ -4186,12 +4216,9 @@ function Table({ blockIds = [], collection, collectionView, width, padding }) {
|
|
|
4186
4216
|
const data = (_c = block == null ? void 0 : block.properties) == null ? void 0 : _c[p.property];
|
|
4187
4217
|
const isTitle = p.property === "title";
|
|
4188
4218
|
const style = {};
|
|
4189
|
-
if (p.width)
|
|
4190
|
-
|
|
4191
|
-
else
|
|
4192
|
-
style.width = 280;
|
|
4193
|
-
else
|
|
4194
|
-
style.width = 200;
|
|
4219
|
+
if (p.width) style.width = p.width;
|
|
4220
|
+
else if (isTitle) style.width = 280;
|
|
4221
|
+
else style.width = 200;
|
|
4195
4222
|
return /* @__PURE__ */ React14.createElement(
|
|
4196
4223
|
"div",
|
|
4197
4224
|
{
|
|
@@ -4240,8 +4267,7 @@ var Collection = ({ block, className, ctx }) => {
|
|
|
4240
4267
|
[ctx]
|
|
4241
4268
|
);
|
|
4242
4269
|
if (block.type === "page") {
|
|
4243
|
-
if (block.parent_table !== "collection")
|
|
4244
|
-
return null;
|
|
4270
|
+
if (block.parent_table !== "collection") return null;
|
|
4245
4271
|
return /* @__PURE__ */ React16.createElement(NotionContextProvider, __spreadValues({}, context), /* @__PURE__ */ React16.createElement("div", { className: "notion-collection-page-properties" }, /* @__PURE__ */ React16.createElement(CollectionRow, { block, pageHeader: true, className })));
|
|
4246
4272
|
} else {
|
|
4247
4273
|
return /* @__PURE__ */ React16.createElement(NotionContextProvider, __spreadValues({}, context), /* @__PURE__ */ React16.createElement(CollectionViewBlock, { block, className }));
|
|
@@ -4271,8 +4297,7 @@ var CollectionViewBlock = ({ block, className }) => {
|
|
|
4271
4297
|
[collectionState, setCollectionState]
|
|
4272
4298
|
);
|
|
4273
4299
|
let { width: windowWidth } = useWindowSize();
|
|
4274
|
-
if (isServer)
|
|
4275
|
-
windowWidth = 1024;
|
|
4300
|
+
if (isServer) windowWidth = 1024;
|
|
4276
4301
|
const collection = (_a = recordMap.collection[collectionId]) == null ? void 0 : _a.value;
|
|
4277
4302
|
const collectionView = (_b = recordMap.collection_view[collectionViewId]) == null ? void 0 : _b.value;
|
|
4278
4303
|
const collectionData = (_c = recordMap.collection_query[collectionId]) == null ? void 0 : _c[collectionViewId];
|
|
@@ -4289,8 +4314,7 @@ var CollectionViewBlock = ({ block, className }) => {
|
|
|
4289
4314
|
const width2 = windowWidth;
|
|
4290
4315
|
const maxNotionBodyWidth = 708;
|
|
4291
4316
|
let notionBodyWidth = maxNotionBodyWidth;
|
|
4292
|
-
if ((_a2 = parentPage == null ? void 0 : parentPage.format) == null ? void 0 : _a2.page_full_width)
|
|
4293
|
-
notionBodyWidth = width2 - 2 * Math.min(96, width2 * 0.08) | 0;
|
|
4317
|
+
if ((_a2 = parentPage == null ? void 0 : parentPage.format) == null ? void 0 : _a2.page_full_width) notionBodyWidth = width2 - 2 * Math.min(96, width2 * 0.08) | 0;
|
|
4294
4318
|
else
|
|
4295
4319
|
notionBodyWidth = width2 < maxNotionBodyWidth ? width2 - width2 * 0.02 | 0 : maxNotionBodyWidth;
|
|
4296
4320
|
const padding2 = isServer && !isMounted ? 96 : (width2 - notionBodyWidth) / 2 | 0;
|