@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
|
@@ -24,6 +24,118 @@ function dateFromYMDString(ymd) {
|
|
|
24
24
|
return dateFromYMD(y, m, d);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* LiturgicalDay represents a particular moment in the liturgical calendar,
|
|
29
|
+
* like "Monday in Holy Week" or "The Eve of the Epiphany."
|
|
30
|
+
*/
|
|
31
|
+
class LiturgicalDay {
|
|
32
|
+
//** Constructor takes a Javascript object containing the class's properties */
|
|
33
|
+
constructor(data = {}) {
|
|
34
|
+
/** True if this moment is the evening. Used to indicate the eve of feasts. */
|
|
35
|
+
this.evening = false;
|
|
36
|
+
Object.assign(this, data);
|
|
37
|
+
}
|
|
38
|
+
/** Returns a native Date from the day's date string */
|
|
39
|
+
getDate() {
|
|
40
|
+
return dateFromYMDString(this.date);
|
|
41
|
+
}
|
|
42
|
+
/** Given a LiturgicalDay, returns a new LiturgicalDay that includes the feasts passed */
|
|
43
|
+
addHolyDays(holydays) {
|
|
44
|
+
var _a, _b, _c, _d;
|
|
45
|
+
const day = this;
|
|
46
|
+
holydays = holydays
|
|
47
|
+
// filter out eves if it's not evening
|
|
48
|
+
.filter((feast) => !feast.eve || this.evening)
|
|
49
|
+
// filter out days that are supposed to stop after a certain Sunday
|
|
50
|
+
// viz., the 1979 daily lectionary for January 8, 9, 10, 11, etc., stops at the 1st Sunday after the Epiphany
|
|
51
|
+
.filter((feast) => feast.stops_at_sunday !== day.week.slug)
|
|
52
|
+
.map((feast) => {
|
|
53
|
+
// if a feast has an `evening` field and it's evening, use that
|
|
54
|
+
if (feast.hasOwnProperty('evening') && this.evening == true) {
|
|
55
|
+
return feast.evening;
|
|
56
|
+
}
|
|
57
|
+
// if a feast has a `morning` field and it's morning, use that
|
|
58
|
+
else if (feast.hasOwnProperty('morning') && this.evening == false) {
|
|
59
|
+
return feast.morning;
|
|
60
|
+
}
|
|
61
|
+
// if a feast is the eve of something and it's evening, use that feast
|
|
62
|
+
else if (feast && feast.eve && this.evening == true) {
|
|
63
|
+
return feast;
|
|
64
|
+
}
|
|
65
|
+
// if none of these, just return the feast
|
|
66
|
+
else {
|
|
67
|
+
return feast;
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
.filter((feast) => !!feast);
|
|
71
|
+
// Determine whether a holy day takes precedence over the ordinary day
|
|
72
|
+
const observed = this.observedDay(this, (this.holy_days || new Array()).concat(holydays));
|
|
73
|
+
// overwrite the day's slug with the observed day's slug if they differ
|
|
74
|
+
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;
|
|
75
|
+
let propers = this.propers;
|
|
76
|
+
if (slug !== this.slug) {
|
|
77
|
+
propers = slug;
|
|
78
|
+
}
|
|
79
|
+
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);
|
|
80
|
+
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,
|
|
81
|
+
season,
|
|
82
|
+
octave,
|
|
83
|
+
collect, holy_days: (this.holy_days || new Array()).concat(holydays), holy_day_observed: holy_day_is_observed ? observed : this.holy_day_observed }));
|
|
84
|
+
}
|
|
85
|
+
/** Given a `LiturgicalDay` and a set of `HolyDay`s, it returns whichever option takes precedence */
|
|
86
|
+
observedDay(day, holydays) {
|
|
87
|
+
// rank: Principal Feast (5), Sunday (4), Holy Day (3), random other days (2), ferial weekday (1)
|
|
88
|
+
function getRank(item, type) {
|
|
89
|
+
var _a;
|
|
90
|
+
// ranked items => go with rank
|
|
91
|
+
if (type == 'holyday') {
|
|
92
|
+
return ((_a = item === null || item === void 0 ? void 0 : item.type) === null || _a === void 0 ? void 0 : _a.rank) || 2;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
// if `day.date` is defined, used it to generate a date
|
|
96
|
+
// otherwise, use the current date
|
|
97
|
+
const date = day.date ? dateFromYMDString(day.date) : dateOnly(new Date());
|
|
98
|
+
// Sundays => 4
|
|
99
|
+
if (date.getDay() == 0) {
|
|
100
|
+
return 4;
|
|
101
|
+
}
|
|
102
|
+
// weekdays => 1
|
|
103
|
+
else {
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const sorted = holydays
|
|
109
|
+
.map((holyday) => ({ rank: getRank(holyday, 'holyday'), obj: holyday }))
|
|
110
|
+
.concat({ rank: getRank(day, 'weekday'), obj: day })
|
|
111
|
+
.sort((a, b) => {
|
|
112
|
+
// equal rank => choose earlier feast (probably )
|
|
113
|
+
if (a.rank === b.rank && a.obj.mmdd && b.obj.mmdd) {
|
|
114
|
+
const [bMM, bDD] = b.obj.mmdd.split('/'), [aMM, aDD] = a.obj.mmdd.split('/'), bDate = new Date(), aDate = new Date();
|
|
115
|
+
bDate.setMonth(parseInt(bMM) - 1);
|
|
116
|
+
bDate.setDate(parseInt(bDD));
|
|
117
|
+
aDate.setMonth(parseInt(aMM) - 1);
|
|
118
|
+
aDate.setDate(parseInt(aDD));
|
|
119
|
+
return a.obj.mmdd === b.obj.mmdd && a.obj.kalendar !== b.obj.kalendar
|
|
120
|
+
? a.obj.kalendar === day.kalendar
|
|
121
|
+
? -1
|
|
122
|
+
: 1
|
|
123
|
+
: aDate.getTime() - bDate.getTime();
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return b.rank - a.rank;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
return Object.assign({}, sorted[0].obj);
|
|
130
|
+
}
|
|
131
|
+
// whether this day is ranked as a Major Feast
|
|
132
|
+
isFeast() {
|
|
133
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
134
|
+
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');
|
|
135
|
+
return isSunday || (hasRank && !holyWeek && !easterWeek && !ashWednesdayWeek && !ascensionWeek && !ember);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
27
139
|
class Condition {
|
|
28
140
|
//** Constructor takes a Javascript object containing the class's properties */
|
|
29
141
|
constructor(data = {}) {
|
|
@@ -55,11 +167,11 @@ class Condition {
|
|
|
55
167
|
}
|
|
56
168
|
// `feastDay`
|
|
57
169
|
if (this.hasOwnProperty('feastDay') && this.feastDay !== undefined) {
|
|
58
|
-
|
|
170
|
+
Math.max(
|
|
59
171
|
// highest rank of holy days given
|
|
60
172
|
...(day.holy_days || [])
|
|
61
173
|
.filter((a) => !!a) // exclude any null or undefined from array
|
|
62
|
-
.map((a) => (a && a.type && a.type.rank ? a.type.rank : 3)))
|
|
174
|
+
.map((a) => (a && a.type && a.type.rank ? a.type.rank : 3))); dateFromYMDString(day.date).getDay() == 0; const isFeast = new LiturgicalDay(day).isFeast();
|
|
63
175
|
evaluatedConditions.push(isFeast == this.feastDay);
|
|
64
176
|
}
|
|
65
177
|
// `date`
|
|
@@ -279,4 +391,4 @@ var Book;
|
|
|
279
391
|
Book["Bel"] = "Bel";
|
|
280
392
|
})(Book || (Book = {}));
|
|
281
393
|
|
|
282
|
-
export { Condition as C, LiturgicalDocument as L, Responsive as R,
|
|
394
|
+
export { Condition as C, LiturgicalDocument as L, Responsive as R, LiturgicalDay as a, dateFromYMDString as d };
|
|
@@ -3,7 +3,7 @@ import { g as getIonMode$1, i as isPlatform, c as config } from './ionic-global-
|
|
|
3
3
|
import { h as hasShadowDom, c as clamp, d as debounceEvent, r as raf } from './helpers-8c93393b.js';
|
|
4
4
|
import { o as openURL, c as createColorClasses$1, h as hostContext } from './theme-74c22054.js';
|
|
5
5
|
import { p as popoverController } from './overlays-06b43b65.js';
|
|
6
|
-
import './book-
|
|
6
|
+
import './book-6ee92642.js';
|
|
7
7
|
import { C as Change } from './change-ea574d32.js';
|
|
8
8
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
9
9
|
import './hardware-back-button-b3b61715.js';
|
|
@@ -2,8 +2,8 @@ import { r as registerInstance, h, H as Host, f as forceUpdate, c as createEvent
|
|
|
2
2
|
import { g as getIonMode } from './ionic-global-ef89a0a5.js';
|
|
3
3
|
import { c as createColorClasses } from './theme-74c22054.js';
|
|
4
4
|
import { f as alertController } from './overlays-06b43b65.js';
|
|
5
|
-
import './book-
|
|
6
|
-
import { R as Refrain } from './refrain-
|
|
5
|
+
import './book-6ee92642.js';
|
|
6
|
+
import { R as Refrain } from './refrain-05638b3c.js';
|
|
7
7
|
import { C as Change } from './change-ea574d32.js';
|
|
8
8
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
9
9
|
import './hardware-back-button-b3b61715.js';
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement
|
|
|
2
2
|
import { g as getIonMode } from './ionic-global-ef89a0a5.js';
|
|
3
3
|
import { f as findItemLabel, b as renderHiddenInput } from './helpers-8c93393b.js';
|
|
4
4
|
import { c as createColorClasses, h as hostContext } from './theme-74c22054.js';
|
|
5
|
-
import './book-
|
|
5
|
+
import './book-6ee92642.js';
|
|
6
6
|
import { C as Change } from './change-ea574d32.js';
|
|
7
7
|
import { f as alertController } from './overlays-06b43b65.js';
|
|
8
8
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
@@ -3,7 +3,7 @@ import { g as getIonMode } from './ionic-global-ef89a0a5.js';
|
|
|
3
3
|
import { d as debounceEvent, f as findItemLabel } from './helpers-8c93393b.js';
|
|
4
4
|
import { c as createColorClasses } from './theme-74c22054.js';
|
|
5
5
|
import { D as Debounce } from './index-f08f6130.js';
|
|
6
|
-
import './book-
|
|
6
|
+
import './book-6ee92642.js';
|
|
7
7
|
import { C as Cursor } from './cursor-0e47f111.js';
|
|
8
8
|
import { C as Change } from './change-ea574d32.js';
|
|
9
9
|
import { c as createCommonjsModule } from './_commonjsHelpers-ba3f0406.js';
|
|
@@ -3,15 +3,15 @@ import { c as config, g as getIonMode } from './ionic-global-ef89a0a5.js';
|
|
|
3
3
|
import { p as pointerCoord } from './helpers-8c93393b.js';
|
|
4
4
|
import { c as createColorClasses, h as hostContext } from './theme-74c22054.js';
|
|
5
5
|
import { f as alertController, l as loadingController, m as modalController, t as toastController } from './overlays-06b43b65.js';
|
|
6
|
-
import { R as Responsive, L as LiturgicalDocument, d as dateFromYMDString } from './book-
|
|
7
|
-
import { B as BibleReading, L as Liturgy, M as Meditation, P as Psalm, R as ResponsivePrayer, a as Rubric } from './rubric-
|
|
8
|
-
import { H as Heading } from './heading-
|
|
9
|
-
import { v as versionToString, O as Option } from './option-
|
|
6
|
+
import { R as Responsive, L as LiturgicalDocument, d as dateFromYMDString } from './book-6ee92642.js';
|
|
7
|
+
import { B as BibleReading, L as Liturgy, M as Meditation, P as Psalm, R as ResponsivePrayer, a as Rubric } from './rubric-1e407afb.js';
|
|
8
|
+
import { H as Heading } from './heading-e8b2aee9.js';
|
|
9
|
+
import { v as versionToString, O as Option } from './option-265feb4a.js';
|
|
10
10
|
import { C as Change } from './change-ea574d32.js';
|
|
11
11
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
12
|
-
import { I as Image } from './image-
|
|
12
|
+
import { I as Image } from './image-444b2288.js';
|
|
13
13
|
import { D as Debounce } from './index-f08f6130.js';
|
|
14
|
-
import { R as Refrain } from './refrain-
|
|
14
|
+
import { R as Refrain } from './refrain-05638b3c.js';
|
|
15
15
|
import './hardware-back-button-b3b61715.js';
|
|
16
16
|
import './_commonjsHelpers-ba3f0406.js';
|
|
17
17
|
|
|
@@ -1,125 +1,13 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-f0f6a379.js';
|
|
2
|
-
import {
|
|
3
|
-
import { T as Text } from './text-
|
|
2
|
+
import { a as LiturgicalDay, d as dateFromYMDString } from './book-6ee92642.js';
|
|
3
|
+
import { T as Text } from './text-aebc57f1.js';
|
|
4
4
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
5
|
-
import { H as Heading } from './heading-
|
|
5
|
+
import { H as Heading } from './heading-e8b2aee9.js';
|
|
6
6
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-ba3f0406.js';
|
|
7
7
|
import { m as modalController } from './overlays-06b43b65.js';
|
|
8
8
|
import './ionic-global-ef89a0a5.js';
|
|
9
9
|
import './hardware-back-button-b3b61715.js';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* LiturgicalDay represents a particular moment in the liturgical calendar,
|
|
13
|
-
* like "Monday in Holy Week" or "The Eve of the Epiphany."
|
|
14
|
-
*/
|
|
15
|
-
class LiturgicalDay {
|
|
16
|
-
//** Constructor takes a Javascript object containing the class's properties */
|
|
17
|
-
constructor(data = {}) {
|
|
18
|
-
/** True if this moment is the evening. Used to indicate the eve of feasts. */
|
|
19
|
-
this.evening = false;
|
|
20
|
-
Object.assign(this, data);
|
|
21
|
-
}
|
|
22
|
-
/** Returns a native Date from the day's date string */
|
|
23
|
-
getDate() {
|
|
24
|
-
return dateFromYMDString(this.date);
|
|
25
|
-
}
|
|
26
|
-
/** Given a LiturgicalDay, returns a new LiturgicalDay that includes the feasts passed */
|
|
27
|
-
addHolyDays(holydays) {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
29
|
-
const day = this;
|
|
30
|
-
holydays = holydays
|
|
31
|
-
// filter out eves if it's not evening
|
|
32
|
-
.filter((feast) => !feast.eve || this.evening)
|
|
33
|
-
// filter out days that are supposed to stop after a certain Sunday
|
|
34
|
-
// viz., the 1979 daily lectionary for January 8, 9, 10, 11, etc., stops at the 1st Sunday after the Epiphany
|
|
35
|
-
.filter((feast) => feast.stops_at_sunday !== day.week.slug)
|
|
36
|
-
.map((feast) => {
|
|
37
|
-
// if a feast has an `evening` field and it's evening, use that
|
|
38
|
-
if (feast.hasOwnProperty('evening') && this.evening == true) {
|
|
39
|
-
return feast.evening;
|
|
40
|
-
}
|
|
41
|
-
// if a feast has a `morning` field and it's morning, use that
|
|
42
|
-
else if (feast.hasOwnProperty('morning') && this.evening == false) {
|
|
43
|
-
return feast.morning;
|
|
44
|
-
}
|
|
45
|
-
// if a feast is the eve of something and it's evening, use that feast
|
|
46
|
-
else if (feast && feast.eve && this.evening == true) {
|
|
47
|
-
return feast;
|
|
48
|
-
}
|
|
49
|
-
// if none of these, just return the feast
|
|
50
|
-
else {
|
|
51
|
-
return feast;
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
.filter((feast) => !!feast);
|
|
55
|
-
// Determine whether a holy day takes precedence over the ordinary day
|
|
56
|
-
const observed = this.observedDay(this, (this.holy_days || new Array()).concat(holydays));
|
|
57
|
-
// overwrite the day's slug with the observed day's slug if they differ
|
|
58
|
-
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;
|
|
59
|
-
let propers = this.propers;
|
|
60
|
-
if (slug !== this.slug) {
|
|
61
|
-
propers = slug;
|
|
62
|
-
}
|
|
63
|
-
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);
|
|
64
|
-
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,
|
|
65
|
-
season,
|
|
66
|
-
octave,
|
|
67
|
-
collect, holy_days: (this.holy_days || new Array()).concat(holydays), holy_day_observed: holy_day_is_observed ? observed : this.holy_day_observed }));
|
|
68
|
-
}
|
|
69
|
-
/** Given a `LiturgicalDay` and a set of `HolyDay`s, it returns whichever option takes precedence */
|
|
70
|
-
observedDay(day, holydays) {
|
|
71
|
-
// rank: Principal Feast (5), Sunday (4), Holy Day (3), random other days (2), ferial weekday (1)
|
|
72
|
-
function getRank(item, type) {
|
|
73
|
-
var _a;
|
|
74
|
-
// ranked items => go with rank
|
|
75
|
-
if (type == 'holyday') {
|
|
76
|
-
return ((_a = item === null || item === void 0 ? void 0 : item.type) === null || _a === void 0 ? void 0 : _a.rank) || 2;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
// if `day.date` is defined, used it to generate a date
|
|
80
|
-
// otherwise, use the current date
|
|
81
|
-
const date = day.date ? dateFromYMDString(day.date) : dateOnly(new Date());
|
|
82
|
-
// Sundays => 4
|
|
83
|
-
if (date.getDay() == 0) {
|
|
84
|
-
return 4;
|
|
85
|
-
}
|
|
86
|
-
// weekdays => 1
|
|
87
|
-
else {
|
|
88
|
-
return 1;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const sorted = holydays
|
|
93
|
-
.map((holyday) => ({ rank: getRank(holyday, 'holyday'), obj: holyday }))
|
|
94
|
-
.concat({ rank: getRank(day, 'weekday'), obj: day })
|
|
95
|
-
.sort((a, b) => {
|
|
96
|
-
// equal rank => choose earlier feast (probably )
|
|
97
|
-
if (a.rank === b.rank && a.obj.mmdd && b.obj.mmdd) {
|
|
98
|
-
const [bMM, bDD] = b.obj.mmdd.split('/'), [aMM, aDD] = a.obj.mmdd.split('/'), bDate = new Date(), aDate = new Date();
|
|
99
|
-
bDate.setMonth(parseInt(bMM) - 1);
|
|
100
|
-
bDate.setDate(parseInt(bDD));
|
|
101
|
-
aDate.setMonth(parseInt(aMM) - 1);
|
|
102
|
-
aDate.setDate(parseInt(aDD));
|
|
103
|
-
return a.obj.mmdd === b.obj.mmdd && a.obj.kalendar !== b.obj.kalendar
|
|
104
|
-
? a.obj.kalendar === day.kalendar
|
|
105
|
-
? -1
|
|
106
|
-
: 1
|
|
107
|
-
: aDate.getTime() - bDate.getTime();
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
return b.rank - a.rank;
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
return Object.assign({}, sorted[0].obj);
|
|
114
|
-
}
|
|
115
|
-
// whether this day is ranked as a Major Feast
|
|
116
|
-
isFeast() {
|
|
117
|
-
var _a, _b, _c, _d;
|
|
118
|
-
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';
|
|
119
|
-
return isSunday || (hasRank && !holyWeek && !easterWeek);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
11
|
class Citation {
|
|
124
12
|
//** Constructor takes a Javascript object containing the class's properties */
|
|
125
13
|
constructor(data = {}) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { L as LiturgicalDocument } from './book-
|
|
3
|
-
import { B as BibleReading, P as Psalm, L as Liturgy$1, M as Meditation, R as ResponsivePrayer, a as Rubric } from './rubric-
|
|
4
|
-
import { H as Heading } from './heading-
|
|
5
|
-
import { I as Image } from './image-
|
|
6
|
-
import { O as Option } from './option-
|
|
7
|
-
import { R as Refrain } from './refrain-
|
|
8
|
-
import { T as Text } from './text-
|
|
2
|
+
import { L as LiturgicalDocument } from './book-6ee92642.js';
|
|
3
|
+
import { B as BibleReading, P as Psalm, L as Liturgy$1, M as Meditation, R as ResponsivePrayer, a as Rubric } from './rubric-1e407afb.js';
|
|
4
|
+
import { H as Heading } from './heading-e8b2aee9.js';
|
|
5
|
+
import { I as Image } from './image-444b2288.js';
|
|
6
|
+
import { O as Option } from './option-265feb4a.js';
|
|
7
|
+
import { R as Refrain } from './refrain-05638b3c.js';
|
|
8
|
+
import { T as Text } from './text-aebc57f1.js';
|
|
9
9
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
10
10
|
|
|
11
11
|
const MENU = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { C as Condition } from './book-
|
|
2
|
+
import { C as Condition } from './book-6ee92642.js';
|
|
3
3
|
import { C as Change } from './change-ea574d32.js';
|
|
4
4
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { C as Condition } from './book-
|
|
2
|
+
import { C as Condition } from './book-6ee92642.js';
|
|
3
3
|
import { C as Change } from './change-ea574d32.js';
|
|
4
4
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { L as LiturgicalDocument } from './book-
|
|
3
|
-
import { v as versionToString, O as Option } from './option-
|
|
2
|
+
import { L as LiturgicalDocument } from './book-6ee92642.js';
|
|
3
|
+
import { v as versionToString, O as Option } from './option-265feb4a.js';
|
|
4
4
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
5
5
|
|
|
6
6
|
/* Converts a list of documents into a single document showing options in parallel */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { L as LiturgicalDocument } from './book-
|
|
2
|
+
import { L as LiturgicalDocument } from './book-6ee92642.js';
|
|
3
3
|
import { C as Change } from './change-ea574d32.js';
|
|
4
|
-
import { v as versionToString } from './option-
|
|
5
|
-
import { s as specificClass } from './specific-class-
|
|
4
|
+
import { v as versionToString } from './option-265feb4a.js';
|
|
5
|
+
import { s as specificClass } from './specific-class-6d69c516.js';
|
|
6
6
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
7
|
-
import './rubric-
|
|
8
|
-
import './heading-
|
|
9
|
-
import './refrain-
|
|
10
|
-
import './text-
|
|
7
|
+
import './rubric-1e407afb.js';
|
|
8
|
+
import './heading-e8b2aee9.js';
|
|
9
|
+
import './refrain-05638b3c.js';
|
|
10
|
+
import './text-aebc57f1.js';
|
|
11
11
|
|
|
12
12
|
const LOCALE_STRINGS = {
|
|
13
13
|
"allowMultiple": "Allow multiple options",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { L as LiturgicalDocument } from './book-
|
|
2
|
+
import { L as LiturgicalDocument } from './book-6ee92642.js';
|
|
3
3
|
import { C as Change } from './change-ea574d32.js';
|
|
4
|
-
import { s as specificClass } from './specific-class-
|
|
4
|
+
import { s as specificClass } from './specific-class-6d69c516.js';
|
|
5
5
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
6
|
-
import './rubric-
|
|
7
|
-
import './heading-
|
|
8
|
-
import './option-
|
|
9
|
-
import './refrain-
|
|
10
|
-
import './text-
|
|
6
|
+
import './rubric-1e407afb.js';
|
|
7
|
+
import './heading-e8b2aee9.js';
|
|
8
|
+
import './option-265feb4a.js';
|
|
9
|
+
import './refrain-05638b3c.js';
|
|
10
|
+
import './text-aebc57f1.js';
|
|
11
11
|
|
|
12
12
|
const abbreviated = "Abbreviated";
|
|
13
13
|
const advanced = "Advanced Settings";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import './book-
|
|
2
|
+
import './book-6ee92642.js';
|
|
3
3
|
import { a as PreferenceOption } from './preference-d070d4cb.js';
|
|
4
4
|
import { C as Change } from './change-ea574d32.js';
|
|
5
5
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import './book-
|
|
2
|
+
import './book-6ee92642.js';
|
|
3
3
|
import { P as Preference, a as PreferenceOption } from './preference-d070d4cb.js';
|
|
4
4
|
import { C as Change } from './change-ea574d32.js';
|
|
5
5
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
2
|
import { f as alertController } from './overlays-06b43b65.js';
|
|
3
|
-
import './book-
|
|
3
|
+
import './book-6ee92642.js';
|
|
4
4
|
import { P as Preference } from './preference-d070d4cb.js';
|
|
5
5
|
import { C as Change } from './change-ea574d32.js';
|
|
6
6
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import './book-
|
|
2
|
+
import './book-6ee92642.js';
|
|
3
3
|
import { C as Change } from './change-ea574d32.js';
|
|
4
4
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
|
-
import { L as LiturgicalDocument } from './book-
|
|
2
|
+
import { L as LiturgicalDocument } from './book-6ee92642.js';
|
|
3
3
|
import { C as Cursor } from './cursor-0e47f111.js';
|
|
4
4
|
import { C as Change } from './change-ea574d32.js';
|
|
5
5
|
import { e as elementFromPath, q as querySelectorDeep, v as values_js } from './index-1bf6d100.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LiturgicalDocument } from './book-
|
|
1
|
+
import { L as LiturgicalDocument } from './book-6ee92642.js';
|
|
2
2
|
|
|
3
3
|
function versionToString(version) {
|
|
4
4
|
if (typeof version === 'string') {
|
|
@@ -18,6 +18,10 @@ const VERSIONS = {
|
|
|
18
18
|
rite_i: 'Rite I',
|
|
19
19
|
bhs: 'Hebrew',
|
|
20
20
|
hebrew: 'Hebrew',
|
|
21
|
+
EAIB: 'EAIB',
|
|
22
|
+
BCP: 'BCP',
|
|
23
|
+
eaib: 'EAIB',
|
|
24
|
+
bcp: 'BCP',
|
|
21
25
|
};
|
|
22
26
|
function modifiedVersion(option) {
|
|
23
27
|
return option.type === 'psalm' && option.style === 'psalm' && option.version === 'bcp1979'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as Meditation, P as Psalm, B as BibleReading, R as ResponsivePrayer, a as Rubric, L as Liturgy } from './rubric-
|
|
2
|
-
import { H as Heading } from './heading-
|
|
3
|
-
import { O as Option } from './option-
|
|
4
|
-
import { R as Refrain } from './refrain-
|
|
5
|
-
import { T as Text } from './text-
|
|
1
|
+
import { M as Meditation, P as Psalm, B as BibleReading, R as ResponsivePrayer, a as Rubric, L as Liturgy } from './rubric-1e407afb.js';
|
|
2
|
+
import { H as Heading } from './heading-e8b2aee9.js';
|
|
3
|
+
import { O as Option } from './option-265feb4a.js';
|
|
4
|
+
import { R as Refrain } from './refrain-05638b3c.js';
|
|
5
|
+
import { T as Text } from './text-aebc57f1.js';
|
|
6
6
|
|
|
7
7
|
/** Transforms a generic `LiturgicalDocument` (either a class instance or an `Object` that matches the type),
|
|
8
8
|
* into an instance of a more-specific inherited class */
|