@venite/components 0.16.30 → 0.16.31
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/cjs/{book-1a92678a.js → book-71dd5dc7.js} +115 -3
- package/dist/cjs/{heading-5afc2b24.js → heading-360e2c09.js} +1 -1
- package/dist/cjs/{image-3bee3e73.js → image-cd8ea545.js} +1 -1
- package/dist/cjs/ion-button_13.cjs.entry.js +1 -1
- package/dist/cjs/ion-card-content_6.cjs.entry.js +2 -2
- package/dist/cjs/ion-checkbox_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-input_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment_16.cjs.entry.js +6 -6
- package/dist/cjs/ldf-day-name_5.cjs.entry.js +7 -119
- package/dist/cjs/ldf-editable-add-block-menu.cjs.entry.js +7 -7
- package/dist/cjs/ldf-editable-condition-piece.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-condition.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-filter-documents.cjs.entry.js +2 -2
- package/dist/cjs/ldf-editable-lookup_2.cjs.entry.js +7 -7
- package/dist/cjs/ldf-editable-metadata.cjs.entry.js +7 -7
- package/dist/cjs/ldf-editable-preference-option.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-preference.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-preferences.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-string-list.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editor.cjs.entry.js +1 -1
- package/dist/cjs/{option-a078d432.js → option-7c7e095b.js} +5 -1
- package/dist/cjs/{refrain-91fb446b.js → refrain-54b64e3c.js} +1 -1
- package/dist/cjs/{rubric-0afbe4c0.js → rubric-b7453a62.js} +1 -1
- package/dist/cjs/{specific-class-76b4d343.js → specific-class-da66301f.js} +5 -5
- package/dist/cjs/{text-5edb80f3.js → text-e6103020.js} +1 -1
- package/dist/esm/{book-31b8cdde.js → book-6ee92642.js} +115 -3
- package/dist/esm/{heading-cc5ffa8a.js → heading-e8b2aee9.js} +1 -1
- package/dist/esm/{image-c6a3f0c5.js → image-444b2288.js} +1 -1
- package/dist/esm/ion-button_13.entry.js +1 -1
- package/dist/esm/ion-card-content_6.entry.js +2 -2
- package/dist/esm/ion-checkbox_3.entry.js +1 -1
- package/dist/esm/ion-input_2.entry.js +1 -1
- package/dist/esm/ion-segment_16.entry.js +6 -6
- package/dist/esm/ldf-day-name_5.entry.js +3 -115
- package/dist/esm/ldf-editable-add-block-menu.entry.js +7 -7
- package/dist/esm/ldf-editable-condition-piece.entry.js +1 -1
- package/dist/esm/ldf-editable-condition.entry.js +1 -1
- package/dist/esm/ldf-editable-filter-documents.entry.js +2 -2
- package/dist/esm/ldf-editable-lookup_2.entry.js +7 -7
- package/dist/esm/ldf-editable-metadata.entry.js +7 -7
- package/dist/esm/ldf-editable-preference-option.entry.js +1 -1
- package/dist/esm/ldf-editable-preference.entry.js +1 -1
- package/dist/esm/ldf-editable-preferences.entry.js +1 -1
- package/dist/esm/ldf-editable-string-list.entry.js +1 -1
- package/dist/esm/ldf-editor.entry.js +1 -1
- package/dist/esm/{option-c16af13a.js → option-265feb4a.js} +5 -1
- package/dist/esm/{refrain-75a412cb.js → refrain-05638b3c.js} +1 -1
- package/dist/esm/{rubric-f779c469.js → rubric-1e407afb.js} +1 -1
- package/dist/esm/{specific-class-09c98625.js → specific-class-6d69c516.js} +5 -5
- package/dist/esm/{text-ed75fbd4.js → text-aebc57f1.js} +1 -1
- package/dist/ldf/ldf.esm.js +1 -1
- package/dist/ldf/p-1574e7dd.entry.js +1 -0
- package/dist/ldf/{p-005ad01b.entry.js → p-1ecd820f.entry.js} +1 -1
- package/dist/ldf/{p-594fa9d4.entry.js → p-46535260.entry.js} +1 -1
- package/dist/ldf/{p-fa191f47.entry.js → p-4aca0620.entry.js} +1 -1
- package/dist/ldf/p-5af751cb.js +1 -0
- package/dist/ldf/{p-468d36d0.entry.js → p-5c0ee099.entry.js} +1 -1
- package/dist/ldf/p-5fa18ca9.entry.js +1 -0
- package/dist/ldf/p-67cc378d.js +1 -0
- package/dist/ldf/p-697ca87f.js +1 -0
- package/dist/ldf/p-7a613c13.js +1 -0
- package/dist/ldf/{p-94949614.entry.js → p-86af77f3.entry.js} +1 -1
- package/dist/ldf/p-8e9ce302.js +1 -0
- package/dist/ldf/p-8f74c786.js +1 -0
- package/dist/ldf/{p-7a9ab85c.entry.js → p-b17fd746.entry.js} +1 -1
- package/dist/ldf/{p-d56dff05.js → p-b883db41.js} +1 -1
- package/dist/ldf/{p-c0ef6296.entry.js → p-bad49599.entry.js} +1 -1
- package/dist/ldf/{p-03afc8cb.entry.js → p-bfa17342.entry.js} +1 -1
- package/dist/ldf/{p-2ae548b3.entry.js → p-c9ae004b.entry.js} +1 -1
- package/dist/ldf/{p-5b43e6be.js → p-d9b01d53.js} +1 -1
- package/dist/ldf/{p-c1a86b14.entry.js → p-e209b30e.entry.js} +1 -1
- package/dist/ldf/{p-9c1973a6.entry.js → p-e27792f2.entry.js} +1 -1
- package/dist/ldf/{p-65ea7ab3.entry.js → p-e3457e6c.entry.js} +1 -1
- package/dist/ldf/{p-23af1bc3.entry.js → p-e3f3587a.entry.js} +1 -1
- package/dist/ldf/{p-2c39ce94.entry.js → p-e596826e.entry.js} +1 -1
- package/dist/ldf/{p-f0de7628.entry.js → p-ed8be718.entry.js} +1 -1
- package/package.json +2 -2
- package/dist/ldf/p-00e5ee6b.js +0 -1
- package/dist/ldf/p-021add56.entry.js +0 -1
- package/dist/ldf/p-476327d6.js +0 -1
- package/dist/ldf/p-4aa9a6f2.js +0 -1
- package/dist/ldf/p-65d26c45.js +0 -1
- package/dist/ldf/p-800a115c.entry.js +0 -1
- package/dist/ldf/p-a1729dbd.js +0 -1
- package/dist/ldf/p-e7a449d7.js +0 -1
|
@@ -26,6 +26,118 @@ function dateFromYMDString(ymd) {
|
|
|
26
26
|
return dateFromYMD(y, m, d);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* LiturgicalDay represents a particular moment in the liturgical calendar,
|
|
31
|
+
* like "Monday in Holy Week" or "The Eve of the Epiphany."
|
|
32
|
+
*/
|
|
33
|
+
class LiturgicalDay {
|
|
34
|
+
//** Constructor takes a Javascript object containing the class's properties */
|
|
35
|
+
constructor(data = {}) {
|
|
36
|
+
/** True if this moment is the evening. Used to indicate the eve of feasts. */
|
|
37
|
+
this.evening = false;
|
|
38
|
+
Object.assign(this, data);
|
|
39
|
+
}
|
|
40
|
+
/** Returns a native Date from the day's date string */
|
|
41
|
+
getDate() {
|
|
42
|
+
return dateFromYMDString(this.date);
|
|
43
|
+
}
|
|
44
|
+
/** Given a LiturgicalDay, returns a new LiturgicalDay that includes the feasts passed */
|
|
45
|
+
addHolyDays(holydays) {
|
|
46
|
+
var _a, _b, _c, _d;
|
|
47
|
+
const day = this;
|
|
48
|
+
holydays = holydays
|
|
49
|
+
// filter out eves if it's not evening
|
|
50
|
+
.filter((feast) => !feast.eve || this.evening)
|
|
51
|
+
// filter out days that are supposed to stop after a certain Sunday
|
|
52
|
+
// viz., the 1979 daily lectionary for January 8, 9, 10, 11, etc., stops at the 1st Sunday after the Epiphany
|
|
53
|
+
.filter((feast) => feast.stops_at_sunday !== day.week.slug)
|
|
54
|
+
.map((feast) => {
|
|
55
|
+
// if a feast has an `evening` field and it's evening, use that
|
|
56
|
+
if (feast.hasOwnProperty('evening') && this.evening == true) {
|
|
57
|
+
return feast.evening;
|
|
58
|
+
}
|
|
59
|
+
// if a feast has a `morning` field and it's morning, use that
|
|
60
|
+
else if (feast.hasOwnProperty('morning') && this.evening == false) {
|
|
61
|
+
return feast.morning;
|
|
62
|
+
}
|
|
63
|
+
// if a feast is the eve of something and it's evening, use that feast
|
|
64
|
+
else if (feast && feast.eve && this.evening == true) {
|
|
65
|
+
return feast;
|
|
66
|
+
}
|
|
67
|
+
// if none of these, just return the feast
|
|
68
|
+
else {
|
|
69
|
+
return feast;
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
.filter((feast) => !!feast);
|
|
73
|
+
// Determine whether a holy day takes precedence over the ordinary day
|
|
74
|
+
const observed = this.observedDay(this, (this.holy_days || new Array()).concat(holydays));
|
|
75
|
+
// overwrite the day's slug with the observed day's slug if they differ
|
|
76
|
+
const holy_day_rank = Number((_b = (_a = observed) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.rank), holy_day_is_observed = (observed === null || observed === void 0 ? void 0 : observed.slug) && ((observed === null || observed === void 0 ? void 0 : observed.slug) !== day.slug || holy_day_rank > 2), slug = holy_day_is_observed && holy_day_rank > 2 ? observed.slug : day.slug;
|
|
77
|
+
let propers = this.propers;
|
|
78
|
+
if (slug !== this.slug) {
|
|
79
|
+
propers = slug;
|
|
80
|
+
}
|
|
81
|
+
const color = observed.color || this.color, collect = observed.collect || this.collect, season = observed.season || this.season, octave = (_d = (_c = (this.holy_days || [])) === null || _c === void 0 ? void 0 : _c.concat(holydays)) === null || _d === void 0 ? void 0 : _d.map((holyday) => holyday.octave).filter((octave) => Boolean(octave)).reduce((acc, curr) => (acc ? acc : curr || acc), undefined);
|
|
82
|
+
return new LiturgicalDay(Object.assign(Object.assign({}, this), { slug, propers: holy_day_is_observed && holy_day_rank > 2 ? (observed === null || observed === void 0 ? void 0 : observed.propers) || (observed === null || observed === void 0 ? void 0 : observed.slug) : propers, color,
|
|
83
|
+
season,
|
|
84
|
+
octave,
|
|
85
|
+
collect, holy_days: (this.holy_days || new Array()).concat(holydays), holy_day_observed: holy_day_is_observed ? observed : this.holy_day_observed }));
|
|
86
|
+
}
|
|
87
|
+
/** Given a `LiturgicalDay` and a set of `HolyDay`s, it returns whichever option takes precedence */
|
|
88
|
+
observedDay(day, holydays) {
|
|
89
|
+
// rank: Principal Feast (5), Sunday (4), Holy Day (3), random other days (2), ferial weekday (1)
|
|
90
|
+
function getRank(item, type) {
|
|
91
|
+
var _a;
|
|
92
|
+
// ranked items => go with rank
|
|
93
|
+
if (type == 'holyday') {
|
|
94
|
+
return ((_a = item === null || item === void 0 ? void 0 : item.type) === null || _a === void 0 ? void 0 : _a.rank) || 2;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// if `day.date` is defined, used it to generate a date
|
|
98
|
+
// otherwise, use the current date
|
|
99
|
+
const date = day.date ? dateFromYMDString(day.date) : dateOnly(new Date());
|
|
100
|
+
// Sundays => 4
|
|
101
|
+
if (date.getDay() == 0) {
|
|
102
|
+
return 4;
|
|
103
|
+
}
|
|
104
|
+
// weekdays => 1
|
|
105
|
+
else {
|
|
106
|
+
return 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const sorted = holydays
|
|
111
|
+
.map((holyday) => ({ rank: getRank(holyday, 'holyday'), obj: holyday }))
|
|
112
|
+
.concat({ rank: getRank(day, 'weekday'), obj: day })
|
|
113
|
+
.sort((a, b) => {
|
|
114
|
+
// equal rank => choose earlier feast (probably )
|
|
115
|
+
if (a.rank === b.rank && a.obj.mmdd && b.obj.mmdd) {
|
|
116
|
+
const [bMM, bDD] = b.obj.mmdd.split('/'), [aMM, aDD] = a.obj.mmdd.split('/'), bDate = new Date(), aDate = new Date();
|
|
117
|
+
bDate.setMonth(parseInt(bMM) - 1);
|
|
118
|
+
bDate.setDate(parseInt(bDD));
|
|
119
|
+
aDate.setMonth(parseInt(aMM) - 1);
|
|
120
|
+
aDate.setDate(parseInt(aDD));
|
|
121
|
+
return a.obj.mmdd === b.obj.mmdd && a.obj.kalendar !== b.obj.kalendar
|
|
122
|
+
? a.obj.kalendar === day.kalendar
|
|
123
|
+
? -1
|
|
124
|
+
: 1
|
|
125
|
+
: aDate.getTime() - bDate.getTime();
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return b.rank - a.rank;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return Object.assign({}, sorted[0].obj);
|
|
132
|
+
}
|
|
133
|
+
// whether this day is ranked as a Major Feast
|
|
134
|
+
isFeast() {
|
|
135
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
136
|
+
const isSunday = this.getDate().getDay() === 0, hasRank = (((_b = (_a = this.holy_day_observed) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.rank) || 1) >= 3, holyWeek = (_c = this.slug) === null || _c === void 0 ? void 0 : _c.includes('holy-week'), ashWednesdayWeek = (_d = this.slug) === null || _d === void 0 ? void 0 : _d.includes('last-epiphany'), ascensionWeek = (_e = this.slug) === null || _e === void 0 ? void 0 : _e.includes('6th-easter'), easterWeek = (_f = this.slug) === null || _f === void 0 ? void 0 : _f.includes('easter'), ember = (_g = this.season) === null || _g === void 0 ? void 0 : _g.includes('Ember');
|
|
137
|
+
return isSunday || (hasRank && !holyWeek && !easterWeek && !ashWednesdayWeek && !ascensionWeek && !ember);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
29
141
|
class Condition {
|
|
30
142
|
//** Constructor takes a Javascript object containing the class's properties */
|
|
31
143
|
constructor(data = {}) {
|
|
@@ -57,11 +169,11 @@ class Condition {
|
|
|
57
169
|
}
|
|
58
170
|
// `feastDay`
|
|
59
171
|
if (this.hasOwnProperty('feastDay') && this.feastDay !== undefined) {
|
|
60
|
-
|
|
172
|
+
Math.max(
|
|
61
173
|
// highest rank of holy days given
|
|
62
174
|
...(day.holy_days || [])
|
|
63
175
|
.filter((a) => !!a) // exclude any null or undefined from array
|
|
64
|
-
.map((a) => (a && a.type && a.type.rank ? a.type.rank : 3)))
|
|
176
|
+
.map((a) => (a && a.type && a.type.rank ? a.type.rank : 3))); dateFromYMDString(day.date).getDay() == 0; const isFeast = new LiturgicalDay(day).isFeast();
|
|
65
177
|
evaluatedConditions.push(isFeast == this.feastDay);
|
|
66
178
|
}
|
|
67
179
|
// `date`
|
|
@@ -282,6 +394,6 @@ var Book;
|
|
|
282
394
|
})(Book || (Book = {}));
|
|
283
395
|
|
|
284
396
|
exports.Condition = Condition;
|
|
397
|
+
exports.LiturgicalDay = LiturgicalDay;
|
|
285
398
|
exports.LiturgicalDocument = LiturgicalDocument;
|
|
286
399
|
exports.dateFromYMDString = dateFromYMDString;
|
|
287
|
-
exports.dateOnly = dateOnly;
|
|
@@ -7,7 +7,7 @@ const ionicGlobal = require('./ionic-global-581fb4f8.js');
|
|
|
7
7
|
const helpers = require('./helpers-41dfb43a.js');
|
|
8
8
|
const theme = require('./theme-81caa5b0.js');
|
|
9
9
|
const overlays = require('./overlays-eb464d6d.js');
|
|
10
|
-
require('./book-
|
|
10
|
+
require('./book-71dd5dc7.js');
|
|
11
11
|
const change = require('./change-cdb1e8c0.js');
|
|
12
12
|
const locale = require('./locale-d4e925b1.js');
|
|
13
13
|
require('./hardware-back-button-8c2f48d2.js');
|
|
@@ -6,8 +6,8 @@ const index = require('./index-8fe0df8d.js');
|
|
|
6
6
|
const ionicGlobal = require('./ionic-global-581fb4f8.js');
|
|
7
7
|
const theme = require('./theme-81caa5b0.js');
|
|
8
8
|
const overlays = require('./overlays-eb464d6d.js');
|
|
9
|
-
require('./book-
|
|
10
|
-
const refrain = require('./refrain-
|
|
9
|
+
require('./book-71dd5dc7.js');
|
|
10
|
+
const refrain = require('./refrain-54b64e3c.js');
|
|
11
11
|
const change = require('./change-cdb1e8c0.js');
|
|
12
12
|
const locale = require('./locale-d4e925b1.js');
|
|
13
13
|
require('./hardware-back-button-8c2f48d2.js');
|
|
@@ -6,7 +6,7 @@ const index = require('./index-8fe0df8d.js');
|
|
|
6
6
|
const ionicGlobal = require('./ionic-global-581fb4f8.js');
|
|
7
7
|
const helpers = require('./helpers-41dfb43a.js');
|
|
8
8
|
const theme = require('./theme-81caa5b0.js');
|
|
9
|
-
require('./book-
|
|
9
|
+
require('./book-71dd5dc7.js');
|
|
10
10
|
const change = require('./change-cdb1e8c0.js');
|
|
11
11
|
const overlays = require('./overlays-eb464d6d.js');
|
|
12
12
|
const locale = require('./locale-d4e925b1.js');
|
|
@@ -7,7 +7,7 @@ const ionicGlobal = require('./ionic-global-581fb4f8.js');
|
|
|
7
7
|
const helpers = require('./helpers-41dfb43a.js');
|
|
8
8
|
const theme = require('./theme-81caa5b0.js');
|
|
9
9
|
const index$1 = require('./index-7aa21373.js');
|
|
10
|
-
require('./book-
|
|
10
|
+
require('./book-71dd5dc7.js');
|
|
11
11
|
const cursor = require('./cursor-81bfd01e.js');
|
|
12
12
|
const change = require('./change-cdb1e8c0.js');
|
|
13
13
|
const _commonjsHelpers = require('./_commonjsHelpers-bcc1208a.js');
|
|
@@ -7,15 +7,15 @@ const ionicGlobal = require('./ionic-global-581fb4f8.js');
|
|
|
7
7
|
const helpers = require('./helpers-41dfb43a.js');
|
|
8
8
|
const theme = require('./theme-81caa5b0.js');
|
|
9
9
|
const overlays = require('./overlays-eb464d6d.js');
|
|
10
|
-
const book$2 = require('./book-
|
|
11
|
-
const rubric = require('./rubric-
|
|
12
|
-
const heading$1 = require('./heading-
|
|
13
|
-
const option$1 = require('./option-
|
|
10
|
+
const book$2 = require('./book-71dd5dc7.js');
|
|
11
|
+
const rubric = require('./rubric-b7453a62.js');
|
|
12
|
+
const heading$1 = require('./heading-360e2c09.js');
|
|
13
|
+
const option$1 = require('./option-7c7e095b.js');
|
|
14
14
|
const change = require('./change-cdb1e8c0.js');
|
|
15
15
|
const locale = require('./locale-d4e925b1.js');
|
|
16
|
-
const image = require('./image-
|
|
16
|
+
const image = require('./image-cd8ea545.js');
|
|
17
17
|
const index$1 = require('./index-7aa21373.js');
|
|
18
|
-
const refrain = require('./refrain-
|
|
18
|
+
const refrain = require('./refrain-54b64e3c.js');
|
|
19
19
|
require('./hardware-back-button-8c2f48d2.js');
|
|
20
20
|
require('./_commonjsHelpers-bcc1208a.js');
|
|
21
21
|
|
|
@@ -3,127 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
7
|
-
const text = require('./text-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
|
+
const text = require('./text-e6103020.js');
|
|
8
8
|
const locale = require('./locale-d4e925b1.js');
|
|
9
|
-
const heading = require('./heading-
|
|
9
|
+
const heading = require('./heading-360e2c09.js');
|
|
10
10
|
const _commonjsHelpers = require('./_commonjsHelpers-bcc1208a.js');
|
|
11
11
|
const overlays = require('./overlays-eb464d6d.js');
|
|
12
12
|
require('./ionic-global-581fb4f8.js');
|
|
13
13
|
require('./hardware-back-button-8c2f48d2.js');
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* LiturgicalDay represents a particular moment in the liturgical calendar,
|
|
17
|
-
* like "Monday in Holy Week" or "The Eve of the Epiphany."
|
|
18
|
-
*/
|
|
19
|
-
class LiturgicalDay {
|
|
20
|
-
//** Constructor takes a Javascript object containing the class's properties */
|
|
21
|
-
constructor(data = {}) {
|
|
22
|
-
/** True if this moment is the evening. Used to indicate the eve of feasts. */
|
|
23
|
-
this.evening = false;
|
|
24
|
-
Object.assign(this, data);
|
|
25
|
-
}
|
|
26
|
-
/** Returns a native Date from the day's date string */
|
|
27
|
-
getDate() {
|
|
28
|
-
return book.dateFromYMDString(this.date);
|
|
29
|
-
}
|
|
30
|
-
/** Given a LiturgicalDay, returns a new LiturgicalDay that includes the feasts passed */
|
|
31
|
-
addHolyDays(holydays) {
|
|
32
|
-
var _a, _b, _c, _d;
|
|
33
|
-
const day = this;
|
|
34
|
-
holydays = holydays
|
|
35
|
-
// filter out eves if it's not evening
|
|
36
|
-
.filter((feast) => !feast.eve || this.evening)
|
|
37
|
-
// filter out days that are supposed to stop after a certain Sunday
|
|
38
|
-
// viz., the 1979 daily lectionary for January 8, 9, 10, 11, etc., stops at the 1st Sunday after the Epiphany
|
|
39
|
-
.filter((feast) => feast.stops_at_sunday !== day.week.slug)
|
|
40
|
-
.map((feast) => {
|
|
41
|
-
// if a feast has an `evening` field and it's evening, use that
|
|
42
|
-
if (feast.hasOwnProperty('evening') && this.evening == true) {
|
|
43
|
-
return feast.evening;
|
|
44
|
-
}
|
|
45
|
-
// if a feast has a `morning` field and it's morning, use that
|
|
46
|
-
else if (feast.hasOwnProperty('morning') && this.evening == false) {
|
|
47
|
-
return feast.morning;
|
|
48
|
-
}
|
|
49
|
-
// if a feast is the eve of something and it's evening, use that feast
|
|
50
|
-
else if (feast && feast.eve && this.evening == true) {
|
|
51
|
-
return feast;
|
|
52
|
-
}
|
|
53
|
-
// if none of these, just return the feast
|
|
54
|
-
else {
|
|
55
|
-
return feast;
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
.filter((feast) => !!feast);
|
|
59
|
-
// Determine whether a holy day takes precedence over the ordinary day
|
|
60
|
-
const observed = this.observedDay(this, (this.holy_days || new Array()).concat(holydays));
|
|
61
|
-
// overwrite the day's slug with the observed day's slug if they differ
|
|
62
|
-
const holy_day_rank = Number((_b = (_a = observed) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.rank), holy_day_is_observed = (observed === null || observed === void 0 ? void 0 : observed.slug) && ((observed === null || observed === void 0 ? void 0 : observed.slug) !== day.slug || holy_day_rank > 2), slug = holy_day_is_observed && holy_day_rank > 2 ? observed.slug : day.slug;
|
|
63
|
-
let propers = this.propers;
|
|
64
|
-
if (slug !== this.slug) {
|
|
65
|
-
propers = slug;
|
|
66
|
-
}
|
|
67
|
-
const color = observed.color || this.color, collect = observed.collect || this.collect, season = observed.season || this.season, octave = (_d = (_c = (this.holy_days || [])) === null || _c === void 0 ? void 0 : _c.concat(holydays)) === null || _d === void 0 ? void 0 : _d.map((holyday) => holyday.octave).filter((octave) => Boolean(octave)).reduce((acc, curr) => (acc ? acc : curr || acc), undefined);
|
|
68
|
-
return new LiturgicalDay(Object.assign(Object.assign({}, this), { slug, propers: holy_day_is_observed && holy_day_rank > 2 ? (observed === null || observed === void 0 ? void 0 : observed.propers) || (observed === null || observed === void 0 ? void 0 : observed.slug) : propers, color,
|
|
69
|
-
season,
|
|
70
|
-
octave,
|
|
71
|
-
collect, holy_days: (this.holy_days || new Array()).concat(holydays), holy_day_observed: holy_day_is_observed ? observed : this.holy_day_observed }));
|
|
72
|
-
}
|
|
73
|
-
/** Given a `LiturgicalDay` and a set of `HolyDay`s, it returns whichever option takes precedence */
|
|
74
|
-
observedDay(day, holydays) {
|
|
75
|
-
// rank: Principal Feast (5), Sunday (4), Holy Day (3), random other days (2), ferial weekday (1)
|
|
76
|
-
function getRank(item, type) {
|
|
77
|
-
var _a;
|
|
78
|
-
// ranked items => go with rank
|
|
79
|
-
if (type == 'holyday') {
|
|
80
|
-
return ((_a = item === null || item === void 0 ? void 0 : item.type) === null || _a === void 0 ? void 0 : _a.rank) || 2;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
// if `day.date` is defined, used it to generate a date
|
|
84
|
-
// otherwise, use the current date
|
|
85
|
-
const date = day.date ? book.dateFromYMDString(day.date) : book.dateOnly(new Date());
|
|
86
|
-
// Sundays => 4
|
|
87
|
-
if (date.getDay() == 0) {
|
|
88
|
-
return 4;
|
|
89
|
-
}
|
|
90
|
-
// weekdays => 1
|
|
91
|
-
else {
|
|
92
|
-
return 1;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const sorted = holydays
|
|
97
|
-
.map((holyday) => ({ rank: getRank(holyday, 'holyday'), obj: holyday }))
|
|
98
|
-
.concat({ rank: getRank(day, 'weekday'), obj: day })
|
|
99
|
-
.sort((a, b) => {
|
|
100
|
-
// equal rank => choose earlier feast (probably )
|
|
101
|
-
if (a.rank === b.rank && a.obj.mmdd && b.obj.mmdd) {
|
|
102
|
-
const [bMM, bDD] = b.obj.mmdd.split('/'), [aMM, aDD] = a.obj.mmdd.split('/'), bDate = new Date(), aDate = new Date();
|
|
103
|
-
bDate.setMonth(parseInt(bMM) - 1);
|
|
104
|
-
bDate.setDate(parseInt(bDD));
|
|
105
|
-
aDate.setMonth(parseInt(aMM) - 1);
|
|
106
|
-
aDate.setDate(parseInt(aDD));
|
|
107
|
-
return a.obj.mmdd === b.obj.mmdd && a.obj.kalendar !== b.obj.kalendar
|
|
108
|
-
? a.obj.kalendar === day.kalendar
|
|
109
|
-
? -1
|
|
110
|
-
: 1
|
|
111
|
-
: aDate.getTime() - bDate.getTime();
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return b.rank - a.rank;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return Object.assign({}, sorted[0].obj);
|
|
118
|
-
}
|
|
119
|
-
// whether this day is ranked as a Major Feast
|
|
120
|
-
isFeast() {
|
|
121
|
-
var _a, _b, _c, _d;
|
|
122
|
-
const isSunday = this.getDate().getDay() === 0, hasRank = (((_b = (_a = this.holy_day_observed) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.rank) || 1) >= 3, holyWeek = (_c = this.slug) === null || _c === void 0 ? void 0 : _c.includes('holy-week'), easterWeek = ((_d = this.week) === null || _d === void 0 ? void 0 : _d.slug) === 'easter';
|
|
123
|
-
return isSunday || (hasRank && !holyWeek && !easterWeek);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
15
|
class Citation {
|
|
128
16
|
//** Constructor takes a Javascript object containing the class's properties */
|
|
129
17
|
constructor(data = {}) {
|
|
@@ -157,17 +45,17 @@ const DayNameComponent = class {
|
|
|
157
45
|
let provisionalObj;
|
|
158
46
|
try {
|
|
159
47
|
if (typeof newDay == 'string') {
|
|
160
|
-
provisionalObj = new LiturgicalDay(JSON.parse(newDay));
|
|
48
|
+
provisionalObj = new book.LiturgicalDay(JSON.parse(newDay));
|
|
161
49
|
}
|
|
162
50
|
else {
|
|
163
|
-
provisionalObj = new LiturgicalDay(newDay);
|
|
51
|
+
provisionalObj = new book.LiturgicalDay(newDay);
|
|
164
52
|
}
|
|
165
53
|
}
|
|
166
54
|
catch (e) {
|
|
167
55
|
console.warn('(ldf-day-name)', e);
|
|
168
|
-
provisionalObj = new LiturgicalDay();
|
|
56
|
+
provisionalObj = new book.LiturgicalDay();
|
|
169
57
|
}
|
|
170
|
-
this.obj = provisionalObj || new LiturgicalDay();
|
|
58
|
+
this.obj = provisionalObj || new book.LiturgicalDay();
|
|
171
59
|
}
|
|
172
60
|
// Lifecycle events
|
|
173
61
|
componentWillLoad() {
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
7
|
-
const rubric$1 = require('./rubric-
|
|
8
|
-
const heading$1 = require('./heading-
|
|
9
|
-
const image$1 = require('./image-
|
|
10
|
-
const option$1 = require('./option-
|
|
11
|
-
const refrain$1 = require('./refrain-
|
|
12
|
-
const text$1 = require('./text-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
|
+
const rubric$1 = require('./rubric-b7453a62.js');
|
|
8
|
+
const heading$1 = require('./heading-360e2c09.js');
|
|
9
|
+
const image$1 = require('./image-cd8ea545.js');
|
|
10
|
+
const option$1 = require('./option-7c7e095b.js');
|
|
11
|
+
const refrain$1 = require('./refrain-54b64e3c.js');
|
|
12
|
+
const text$1 = require('./text-e6103020.js');
|
|
13
13
|
const locale = require('./locale-d4e925b1.js');
|
|
14
14
|
|
|
15
15
|
const MENU = [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
8
|
const locale = require('./locale-d4e925b1.js');
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
8
|
const locale = require('./locale-d4e925b1.js');
|
|
9
9
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
7
|
-
const option = require('./option-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
|
+
const option = require('./option-7c7e095b.js');
|
|
8
8
|
const locale = require('./locale-d4e925b1.js');
|
|
9
9
|
|
|
10
10
|
/* Converts a list of documents into a single document showing options in parallel */
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
|
-
const option = require('./option-
|
|
9
|
-
const specificClass = require('./specific-class-
|
|
8
|
+
const option = require('./option-7c7e095b.js');
|
|
9
|
+
const specificClass = require('./specific-class-da66301f.js');
|
|
10
10
|
const locale = require('./locale-d4e925b1.js');
|
|
11
|
-
require('./rubric-
|
|
12
|
-
require('./heading-
|
|
13
|
-
require('./refrain-
|
|
14
|
-
require('./text-
|
|
11
|
+
require('./rubric-b7453a62.js');
|
|
12
|
+
require('./heading-360e2c09.js');
|
|
13
|
+
require('./refrain-54b64e3c.js');
|
|
14
|
+
require('./text-e6103020.js');
|
|
15
15
|
|
|
16
16
|
const LOCALE_STRINGS = {
|
|
17
17
|
"allowMultiple": "Allow multiple options",
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
|
-
const specificClass = require('./specific-class-
|
|
8
|
+
const specificClass = require('./specific-class-da66301f.js');
|
|
9
9
|
const locale = require('./locale-d4e925b1.js');
|
|
10
|
-
require('./rubric-
|
|
11
|
-
require('./heading-
|
|
12
|
-
require('./option-
|
|
13
|
-
require('./refrain-
|
|
14
|
-
require('./text-
|
|
10
|
+
require('./rubric-b7453a62.js');
|
|
11
|
+
require('./heading-360e2c09.js');
|
|
12
|
+
require('./option-7c7e095b.js');
|
|
13
|
+
require('./refrain-54b64e3c.js');
|
|
14
|
+
require('./text-e6103020.js');
|
|
15
15
|
|
|
16
16
|
const abbreviated = "Abbreviated";
|
|
17
17
|
const advanced = "Advanced Settings";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
require('./book-
|
|
6
|
+
require('./book-71dd5dc7.js');
|
|
7
7
|
const preference = require('./preference-a4bd51c4.js');
|
|
8
8
|
const change = require('./change-cdb1e8c0.js');
|
|
9
9
|
const locale = require('./locale-d4e925b1.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
require('./book-
|
|
6
|
+
require('./book-71dd5dc7.js');
|
|
7
7
|
const preference$1 = require('./preference-a4bd51c4.js');
|
|
8
8
|
const change = require('./change-cdb1e8c0.js');
|
|
9
9
|
const locale = require('./locale-d4e925b1.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
6
|
const overlays = require('./overlays-eb464d6d.js');
|
|
7
|
-
require('./book-
|
|
7
|
+
require('./book-71dd5dc7.js');
|
|
8
8
|
const preference = require('./preference-a4bd51c4.js');
|
|
9
9
|
const change = require('./change-cdb1e8c0.js');
|
|
10
10
|
const locale = require('./locale-d4e925b1.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
require('./book-
|
|
6
|
+
require('./book-71dd5dc7.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
8
|
const locale = require('./locale-d4e925b1.js');
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
|
-
const book = require('./book-
|
|
6
|
+
const book = require('./book-71dd5dc7.js');
|
|
7
7
|
const cursor = require('./cursor-81bfd01e.js');
|
|
8
8
|
const change = require('./change-cdb1e8c0.js');
|
|
9
9
|
const index$1 = require('./index-de13bd01.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const book = require('./book-
|
|
3
|
+
const book = require('./book-71dd5dc7.js');
|
|
4
4
|
|
|
5
5
|
function versionToString(version) {
|
|
6
6
|
if (typeof version === 'string') {
|
|
@@ -20,6 +20,10 @@ const VERSIONS = {
|
|
|
20
20
|
rite_i: 'Rite I',
|
|
21
21
|
bhs: 'Hebrew',
|
|
22
22
|
hebrew: 'Hebrew',
|
|
23
|
+
EAIB: 'EAIB',
|
|
24
|
+
BCP: 'BCP',
|
|
25
|
+
eaib: 'EAIB',
|
|
26
|
+
bcp: 'BCP',
|
|
23
27
|
};
|
|
24
28
|
function modifiedVersion(option) {
|
|
25
29
|
return option.type === 'psalm' && option.style === 'psalm' && option.version === 'bcp1979'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const rubric = require('./rubric-
|
|
4
|
-
const heading = require('./heading-
|
|
5
|
-
const option = require('./option-
|
|
6
|
-
const refrain = require('./refrain-
|
|
7
|
-
const text = require('./text-
|
|
3
|
+
const rubric = require('./rubric-b7453a62.js');
|
|
4
|
+
const heading = require('./heading-360e2c09.js');
|
|
5
|
+
const option = require('./option-7c7e095b.js');
|
|
6
|
+
const refrain = require('./refrain-54b64e3c.js');
|
|
7
|
+
const text = require('./text-e6103020.js');
|
|
8
8
|
|
|
9
9
|
/** Transforms a generic `LiturgicalDocument` (either a class instance or an `Object` that matches the type),
|
|
10
10
|
* into an instance of a more-specific inherited class */
|