@venite/components 0.16.19 → 0.16.23
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/{index-de13bd01.js → index-b22a8b22.js} +0 -0
- package/dist/cjs/ion-button_13.cjs.entry.js +23 -3
- package/dist/cjs/ion-segment_16.cjs.entry.js +2 -2
- package/dist/cjs/ldf-day-name_5.cjs.entry.js +19 -15
- package/dist/cjs/ldf-editor-cursors.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editor.cjs.entry.js +1 -1
- package/dist/collection/components/option/dist/option.js +2 -2
- package/dist/collection/components/option/option.js +2 -2
- package/dist/collection/components/prayers-and-thanksgivings/dist/prayers-and-thanksgivings.js +22 -6
- package/dist/collection/components/prayers-and-thanksgivings/prayers-and-thanksgivings.i18n.es.json +3 -0
- package/dist/collection/components/prayers-and-thanksgivings/prayers-and-thanksgivings.js +21 -5
- package/dist/collection/components/text/dist/text.js +15 -15
- package/dist/collection/components/text/text.css +14 -1
- package/dist/collection/components/text/text.i18n.en.json +2 -1
- package/dist/collection/components/text/text.i18n.es.json +3 -1
- package/dist/collection/components/text/text.js +16 -16
- package/dist/collection/i18n/prayers-and-thanksgivings.i18n.es.json +3 -0
- package/dist/collection/i18n/text.i18n.en.json +2 -1
- package/dist/collection/i18n/text.i18n.es.json +3 -1
- package/dist/esm/{index-1bf6d100.js → index-a3645557.js} +0 -0
- package/dist/esm/ion-button_13.entry.js +23 -3
- package/dist/esm/ion-segment_16.entry.js +2 -2
- package/dist/esm/ldf-day-name_5.entry.js +19 -15
- package/dist/esm/ldf-editor-cursors.entry.js +1 -1
- package/dist/esm/ldf-editor.entry.js +1 -1
- package/dist/ldf/i18n/prayers-and-thanksgivings.i18n.es.json +3 -0
- package/dist/ldf/i18n/text.i18n.en.json +2 -1
- package/dist/ldf/i18n/text.i18n.es.json +3 -1
- package/dist/ldf/ldf.esm.js +1 -1
- package/dist/ldf/{p-70e47f8b.entry.js → p-39d4be39.entry.js} +1 -1
- package/dist/ldf/{p-95650471.entry.js → p-592ea68f.entry.js} +1 -1
- package/dist/ldf/{p-e4f0cd91.entry.js → p-7a9ab85c.entry.js} +1 -1
- package/dist/ldf/{p-3ca74c80.js → p-8e00a6ae.js} +0 -0
- package/dist/ldf/{p-23af1bc3.entry.js → p-ba9eda0b.entry.js} +1 -1
- package/dist/ldf/{p-59683bec.entry.js → p-e301606a.entry.js} +1 -1
- package/package.json +1 -1
|
File without changes
|
|
@@ -1655,8 +1655,13 @@ Toolbar.style = {
|
|
|
1655
1655
|
md: toolbarMdCss
|
|
1656
1656
|
};
|
|
1657
1657
|
|
|
1658
|
-
const title = "Prayers and Thanksgivings";
|
|
1658
|
+
const title$1 = "Prayers and Thanksgivings";
|
|
1659
1659
|
const EN = {
|
|
1660
|
+
title: title$1
|
|
1661
|
+
};
|
|
1662
|
+
|
|
1663
|
+
const title = "Oraciones y Acciones de Gracias";
|
|
1664
|
+
const ES = {
|
|
1660
1665
|
title: title
|
|
1661
1666
|
};
|
|
1662
1667
|
|
|
@@ -1664,6 +1669,7 @@ const prayersAndThanksgivingsCss = ".padded.sc-ldf-prayers-and-thanksgivings{pad
|
|
|
1664
1669
|
|
|
1665
1670
|
const LOCALE = {
|
|
1666
1671
|
'en': EN,
|
|
1672
|
+
'es': ES
|
|
1667
1673
|
};
|
|
1668
1674
|
const PrayersAndThanksgivingsComponent = class {
|
|
1669
1675
|
constructor(hostRef) {
|
|
@@ -1740,7 +1746,7 @@ const PrayersAndThanksgivingsComponent = class {
|
|
|
1740
1746
|
return map;
|
|
1741
1747
|
}
|
|
1742
1748
|
const options = !this.filter ? this.currentOptions || [] :
|
|
1743
|
-
(this.currentOptions || []).filter(doc => { var _a, _b, _c, _d; return ((_b = (_a = doc.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(this.filter.toLowerCase())) || ((_d = (_c = (doc.value
|
|
1749
|
+
(this.currentOptions || []).filter(doc => { var _a, _b, _c, _d; return ((_b = (_a = doc.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(this.filter.toLowerCase())) || ((_d = (_c = JSON.stringify(doc.value)) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === null || _d === void 0 ? void 0 : _d.includes(this.filter.toLowerCase())); });
|
|
1744
1750
|
const categories = Array.from(groupBy(options, (item) => (item.category || [])[1]));
|
|
1745
1751
|
const subcategories = categories.map(([categoryLabel, values]) => [categoryLabel, Array.from(groupBy(values, (item) => (item.category || [])[2]))]);
|
|
1746
1752
|
return subcategories;
|
|
@@ -1754,7 +1760,21 @@ const PrayersAndThanksgivingsComponent = class {
|
|
|
1754
1760
|
index.h("h3", { class: "padded" }, subcategory),
|
|
1755
1761
|
...subvalues
|
|
1756
1762
|
.sort((a, b) => { var _a, _b; return Number((_a = a.label) === null || _a === void 0 ? void 0 : _a.split('.')[0]) < Number((_b = b.label) === null || _b === void 0 ? void 0 : _b.split('.')[0]) ? -1 : 1; })
|
|
1757
|
-
.map(option =>
|
|
1763
|
+
.map(option => {
|
|
1764
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1765
|
+
let summary;
|
|
1766
|
+
if (option.type == "text") {
|
|
1767
|
+
summary = (_b = (_a = option.value[0]) === null || _a === void 0 ? void 0 : _a.replace(/\*/g, '')) === null || _b === void 0 ? void 0 : _b.replace(" ", " ");
|
|
1768
|
+
}
|
|
1769
|
+
else if (option.type == "liturgy") {
|
|
1770
|
+
summary = (_e = (_d = (_c = option.value[0]) === null || _c === void 0 ? void 0 : _c.value[0]) === null || _d === void 0 ? void 0 : _d.replace(/\*/g, '')) === null || _e === void 0 ? void 0 : _e.replace(" ", " ");
|
|
1771
|
+
}
|
|
1772
|
+
else if (option.type == "responsive-prayer") {
|
|
1773
|
+
summary = (_f = option.value[0]) === null || _f === void 0 ? void 0 : _f.text;
|
|
1774
|
+
}
|
|
1775
|
+
summary = summary || "";
|
|
1776
|
+
return index.h("ion-item", { button: true, onClick: () => this.addPrayer(option) }, index.h("ion-label", null, index.h("h3", null, option.label), index.h("p", null, summary)));
|
|
1777
|
+
})
|
|
1758
1778
|
])
|
|
1759
1779
|
]));
|
|
1760
1780
|
return this.modal
|
|
@@ -1998,8 +1998,8 @@ const OptionComponent = class {
|
|
|
1998
1998
|
const optionsAreLong = (((_m = this.obj) === null || _m === void 0 ? void 0 : _m.value) || [])
|
|
1999
1999
|
.map((option, optionIndex) => { var _a; return ((_a = this.versionLabel(option, optionIndex)) === null || _a === void 0 ? void 0 : _a.length) > 20; })
|
|
2000
2000
|
.reduce((a, b) => a || b, false);
|
|
2001
|
-
// <=
|
|
2002
|
-
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <=
|
|
2001
|
+
// <= 4, short options
|
|
2002
|
+
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <= 4) {
|
|
2003
2003
|
return (index.h("ion-segment", { color: "primary", value: currentlySelected.toString() }, (_p = this.obj) === null || _p === void 0 ? void 0 :
|
|
2004
2004
|
_p.value.map((option, optionIndex) => index.h("ion-segment-button", { value: optionIndex.toString(), onClick: () => this.select(optionIndex, true) }, index.h("ion-label", null, this.versionLabel(option, optionIndex)))), this.editable && index.h("ion-segment-button", { value: 'add', class: 'add', onClick: () => this.select('add', true) }, index.h("ion-label", null, "+"))));
|
|
2005
2005
|
}
|
|
@@ -5547,24 +5547,28 @@ if (module.exports) {
|
|
|
5547
5547
|
});
|
|
5548
5548
|
|
|
5549
5549
|
const amen$1 = "Amen.";
|
|
5550
|
-
const authorized_prayers = "Prayers and Thanksgivings";
|
|
5550
|
+
const authorized_prayers$1 = "Prayers and Thanksgivings";
|
|
5551
5551
|
const label = "Label";
|
|
5552
5552
|
const source = "Source";
|
|
5553
5553
|
const source_citation = "Citation";
|
|
5554
5554
|
const EN = {
|
|
5555
5555
|
amen: amen$1,
|
|
5556
|
-
authorized_prayers: authorized_prayers,
|
|
5556
|
+
authorized_prayers: authorized_prayers$1,
|
|
5557
5557
|
label: label,
|
|
5558
5558
|
source: source,
|
|
5559
|
-
source_citation: source_citation
|
|
5559
|
+
source_citation: source_citation,
|
|
5560
|
+
"prayer-list": "Prayer List"
|
|
5560
5561
|
};
|
|
5561
5562
|
|
|
5562
5563
|
const amen = "Amén.";
|
|
5564
|
+
const authorized_prayers = "Oraciones y Acciones de Gracias";
|
|
5563
5565
|
const ES = {
|
|
5564
|
-
amen: amen
|
|
5566
|
+
amen: amen,
|
|
5567
|
+
"prayer-list": "Oraciones",
|
|
5568
|
+
authorized_prayers: authorized_prayers
|
|
5565
5569
|
};
|
|
5566
5570
|
|
|
5567
|
-
const textCss = "ldf-label-bar.sc-ldf-text{min-height:0}p.sc-ldf-text{font-family:var(--ldf-font-face);text-align:var(--ldf-text-align);text-justify:inter-character}li.sc-ldf-text,h1.sc-ldf-text,h2.sc-ldf-text,h3.sc-ldf-text,h4.sc-ldf-text,h5.sc-ldf-text,h6.sc-ldf-text,ol.sc-ldf-text,span.sc-ldf-text,em.sc-ldf-text,strong.sc-ldf-text{font-family:var(--ldf-font-face)}.response.sc-ldf-text{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.text.omit.sc-ldf-text .text-body.sc-ldf-text{display:none}.text.editable.omit.sc-ldf-text .text-body.sc-ldf-text{display:block}.text.unison.sc-ldf-text .text-body.sc-ldf-text{font-weight:var(--ldf-unison-font-weight);font-style:var(--ldf-unison-font-style)}h3.editable-label.sc-ldf-text{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}";
|
|
5571
|
+
const textCss = "ldf-label-bar.sc-ldf-text{min-height:0}p.sc-ldf-text{font-family:var(--ldf-font-face);text-align:var(--ldf-text-align);text-justify:inter-character}li.sc-ldf-text,h1.sc-ldf-text,h2.sc-ldf-text,h3.sc-ldf-text,h4.sc-ldf-text,h5.sc-ldf-text,h6.sc-ldf-text,ol.sc-ldf-text,span.sc-ldf-text,em.sc-ldf-text,strong.sc-ldf-text{font-family:var(--ldf-font-face)}.response.sc-ldf-text{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.text.omit.sc-ldf-text .text-body.sc-ldf-text{display:none}.text.editable.omit.sc-ldf-text .text-body.sc-ldf-text{display:block}.text.unison.sc-ldf-text .text-body.sc-ldf-text{font-weight:var(--ldf-unison-font-weight);font-style:var(--ldf-unison-font-style)}h3.editable-label.sc-ldf-text{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.prayer-list.sc-ldf-text{display:block;margin:0;padding:0;text-align:center}.prayer-list.sc-ldf-text li.sc-ldf-text{list-style-type:none;text-align:center;margin:0.5em 0;padding:0}";
|
|
5568
5572
|
|
|
5569
5573
|
const LOCALE = {
|
|
5570
5574
|
'en': EN,
|
|
@@ -5638,37 +5642,37 @@ const TextComponent = class {
|
|
|
5638
5642
|
}
|
|
5639
5643
|
// Render
|
|
5640
5644
|
render() {
|
|
5641
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
5645
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
5642
5646
|
const localeStrings = this.localeStrings || {};
|
|
5643
5647
|
/** `authorized-prayer` type */
|
|
5644
5648
|
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) === 'authorized-prayers') {
|
|
5645
5649
|
const splits = this.path.split('/'), index$1 = Number(splits[splits.length - 1]), base = splits.slice(0, splits.length - 1).join('/');
|
|
5646
|
-
return index.h(index.Host, null, index.h("ldf-label-bar", null, index.h("ion-button", { onClick: () => this.addPAndT(base, index$1), fill: "clear" }, localeStrings.authorized_prayers)), index.h("ul", { class: "prayer-list" }, (this.intentions || []).map(intention => index.h("li", null, intention))));
|
|
5650
|
+
return index.h(index.Host, null, index.h("ldf-label-bar", null, index.h("ion-button", { onClick: () => this.addPAndT(base, index$1), fill: "clear" }, localeStrings.authorized_prayers)), (_c = ((_b = this.intentions) === null || _b === void 0 ? void 0 : _b.length) > 0) !== null && _c !== void 0 ? _c : index.h("strong", { class: "prayer-list" }, localeStrings['prayer-list']), index.h("ul", { class: "prayer-list" }, (this.intentions || []).map(intention => index.h("li", null, intention))));
|
|
5647
5651
|
}
|
|
5648
5652
|
else {
|
|
5649
|
-
let value = ((
|
|
5650
|
-
? (((
|
|
5651
|
-
: (((
|
|
5653
|
+
let value = ((_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.rollup)
|
|
5654
|
+
? (((_f = this.obj) === null || _f === void 0 ? void 0 : _f.value) || []).map(s => s.replace(/\s+/g, ' '))
|
|
5655
|
+
: (((_g = this.obj) === null || _g === void 0 ? void 0 : _g.value) || []);
|
|
5652
5656
|
let compiledValue = value.map(s => {
|
|
5653
5657
|
return s.split(/([\*\w\n\s,:;\.\-–—'“☩✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”☩✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
5654
5658
|
});
|
|
5655
|
-
if (!this.editable && ((
|
|
5659
|
+
if (!this.editable && ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.display_format) === 'abbreviated') {
|
|
5656
5660
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
5657
5661
|
const firstChunk = this.truncate(firstSection[0]), lastChunk = this.truncate(lastSection[lastSection.length - 1], true);
|
|
5658
5662
|
compiledValue = [[firstChunk], [lastChunk]];
|
|
5659
5663
|
}
|
|
5660
5664
|
if (this.editable) {
|
|
5661
|
-
return (index.h(index.Host, { lang: this.obj.language }, index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })), !this.editable && index.h("ldf-heading", { path: `${this.path}/label`, doc: new heading.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }), this.editable && index.h("ldf-label-bar", null, !((
|
|
5665
|
+
return (index.h(index.Host, { lang: this.obj.language }, index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })), !this.editable && index.h("ldf-heading", { path: `${this.path}/label`, doc: new heading.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }), this.editable && index.h("ldf-label-bar", null, !((_k = (_j = this.obj) === null || _j === void 0 ? void 0 : _j.metadata) === null || _k === void 0 ? void 0 : _k.omit_label) && index.h("h3", { class: "editable-label", slot: "start" }, index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-label`, text: (_l = this.obj) === null || _l === void 0 ? void 0 : _l.label, placeholder: localeStrings.label, path: `${this.path}/label` })), index.h("ldf-editable-text", { slot: "end", id: "source-source", text: (_o = (_m = this.obj) === null || _m === void 0 ? void 0 : _m.source) === null || _o === void 0 ? void 0 : _o.source, path: `${this.path}/source/source`, placeholder: (_p = this.localeStrings) === null || _p === void 0 ? void 0 : _p.source }), index.h("ldf-editable-text", { slot: "end", id: "source-citation", text: (_r = (_q = this.obj) === null || _q === void 0 ? void 0 : _q.source) === null || _r === void 0 ? void 0 : _r.citation, path: `${this.path}/source/citation`, placeholder: (_s = this.localeStrings) === null || _s === void 0 ? void 0 : _s.source_citation })), index.h("div", { class: `text ${this.editable ? 'editable' : ''} ${((_t = this.obj) === null || _t === void 0 ? void 0 : _t.display_format) || 'default'}` }, this.obj.value.map((prayer, prayerIndex) => index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${prayerIndex}`, text: prayer, path: `${this.path}/value/${prayerIndex}` })), (((_u = this.obj) === null || _u === void 0 ? void 0 : _u.style) === 'prayer' || (((_w = (_v = this.obj) === null || _v === void 0 ? void 0 : _v.metadata) === null || _w === void 0 ? void 0 : _w.response) && !((_y = (_x = this.obj) === null || _x === void 0 ? void 0 : _x.metadata) === null || _y === void 0 ? void 0 : _y.omit_response))) && index.h("span", { class: 'response' }, index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-response`, text: this.obj.metadata && this.obj.metadata.response, path: `${this.path}/response`, placeholder: localeStrings.amen })))));
|
|
5662
5666
|
}
|
|
5663
5667
|
else {
|
|
5664
5668
|
/** `markdown` types */
|
|
5665
|
-
if (((
|
|
5669
|
+
if (((_z = this.obj) === null || _z === void 0 ? void 0 : _z.style) === 'markdown') {
|
|
5666
5670
|
const converter = new showdown.Converter();
|
|
5667
|
-
return (((
|
|
5671
|
+
return (((_0 = this.obj) === null || _0 === void 0 ? void 0 : _0.value) || []).map(value => index.h("div", { innerHTML: converter.makeHtml(value) }));
|
|
5668
5672
|
}
|
|
5669
5673
|
/** `text` and `prayer` types */
|
|
5670
5674
|
else {
|
|
5671
|
-
return (index.h("div", { lang: ((
|
|
5675
|
+
return (index.h("div", { lang: ((_1 = this.obj) === null || _1 === void 0 ? void 0 : _1.language) || 'en', class: `text ${((_2 = this.obj) === null || _2 === void 0 ? void 0 : _2.display_format) || 'default'}` }, ((((_3 = this.obj) === null || _3 === void 0 ? void 0 : _3.label) && !((_5 = (_4 = this.obj) === null || _4 === void 0 ? void 0 : _4.metadata) === null || _5 === void 0 ? void 0 : _5.omit_label)) || ((_6 = this.obj) === null || _6 === void 0 ? void 0 : _6.citation)) && index.h("ldf-heading", { path: this.path, doc: new heading.Heading({ type: 'heading', metadata: { level: 3 }, value: [((_7 = this.obj.metadata) === null || _7 === void 0 ? void 0 : _7.omit_label) ? '' : this.obj.label], citation: this.obj.citation, source: this.obj.source }) }), compiledValue.map((prayer, prayerIndex) => {
|
|
5672
5676
|
var _a, _b, _c, _d;
|
|
5673
5677
|
return index.h("p", { class: "text-body", id: `${this.obj.uid || this.obj.slug}-prayerIndex` }, prayer === null || prayer === void 0 ? void 0 :
|
|
5674
5678
|
prayer.map((chunk, chunkIndex) => {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
6
|
const index$2 = require('./index-7aa21373.js');
|
|
7
|
-
const index$1 = require('./index-
|
|
7
|
+
const index$1 = require('./index-b22a8b22.js');
|
|
8
8
|
const _commonjsHelpers = require('./_commonjsHelpers-bcc1208a.js');
|
|
9
9
|
|
|
10
10
|
var textareaCaret = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
@@ -6,7 +6,7 @@ const index = require('./index-8fe0df8d.js');
|
|
|
6
6
|
const book = require('./book-1a92678a.js');
|
|
7
7
|
const cursor = require('./cursor-81bfd01e.js');
|
|
8
8
|
const change = require('./change-cdb1e8c0.js');
|
|
9
|
-
const index$1 = require('./index-
|
|
9
|
+
const index$1 = require('./index-b22a8b22.js');
|
|
10
10
|
require('./_commonjsHelpers-bcc1208a.js');
|
|
11
11
|
|
|
12
12
|
const editorCss = "ldf-editor.sc-ldf-editor, .sc-ldf-editor-h {\n display: block;\n}\n\n.sc-ldf-editor-h textarea.sc-ldf-editor {\n display: block;\n\n width: 100%;\n max-width: 100%;\n max-height: 100%;\n\n border: 1px solid grey;\n\n outline: none;\n\n background: transparent;\n box-sizing: border-box;\n resize: none;\n appearance: none;\n\n font-family: inherit;\n}\n\n@keyframes \"blink\" {\n from, to {\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n}\n\n.user.sc-ldf-editor {\n padding-top: 3px;\n padding-bottom: 3px;\n border-left-width: 2px;\n border-right-width: 2px;\n border-style: solid;\n border-top-width: 0;\n border-bottom-width: 0;\n}";
|
|
@@ -209,8 +209,8 @@ var OptionComponent = /** @class */ (function () {
|
|
|
209
209
|
var optionsAreLong = (((_m = this.obj) === null || _m === void 0 ? void 0 : _m.value) || [])
|
|
210
210
|
.map(function (option, optionIndex) { var _a; return ((_a = _this.versionLabel(option, optionIndex)) === null || _a === void 0 ? void 0 : _a.length) > 20; })
|
|
211
211
|
.reduce(function (a, b) { return a || b; }, false);
|
|
212
|
-
// <=
|
|
213
|
-
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <=
|
|
212
|
+
// <= 4, short options
|
|
213
|
+
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <= 4) {
|
|
214
214
|
return (React.createElement("ion-segment", { color: "primary", value: currentlySelected.toString() }, (_p = this.obj) === null || _p === void 0 ? void 0 :
|
|
215
215
|
_p.value.map(function (option, optionIndex) {
|
|
216
216
|
return React.createElement("ion-segment-button", { value: optionIndex.toString(), onClick: function () { return _this.select(optionIndex, true); } },
|
|
@@ -138,8 +138,8 @@ export class OptionComponent {
|
|
|
138
138
|
const optionsAreLong = (((_m = this.obj) === null || _m === void 0 ? void 0 : _m.value) || [])
|
|
139
139
|
.map((option, optionIndex) => { var _a; return ((_a = this.versionLabel(option, optionIndex)) === null || _a === void 0 ? void 0 : _a.length) > 20; })
|
|
140
140
|
.reduce((a, b) => a || b, false);
|
|
141
|
-
// <=
|
|
142
|
-
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <=
|
|
141
|
+
// <= 4, short options
|
|
142
|
+
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <= 4) {
|
|
143
143
|
return (h("ion-segment", { color: "primary", value: currentlySelected.toString() }, (_p = this.obj) === null || _p === void 0 ? void 0 :
|
|
144
144
|
_p.value.map((option, optionIndex) => h("ion-segment-button", { value: optionIndex.toString(), onClick: () => this.select(optionIndex, true) },
|
|
145
145
|
h("ion-label", null, this.versionLabel(option, optionIndex)))),
|
package/dist/collection/components/prayers-and-thanksgivings/dist/prayers-and-thanksgivings.js
CHANGED
|
@@ -66,8 +66,10 @@ var core_2 = require("@stencil/core");
|
|
|
66
66
|
var ldf_1 = require("@venite/ldf");
|
|
67
67
|
var locale_1 = require("../../utils/locale");
|
|
68
68
|
var prayers_and_thanksgivings_i18n_en_json_1 = require("./prayers-and-thanksgivings.i18n.en.json");
|
|
69
|
+
var prayers_and_thanksgivings_i18n_es_json_1 = require("./prayers-and-thanksgivings.i18n.es.json");
|
|
69
70
|
var LOCALE = {
|
|
70
|
-
'en': prayers_and_thanksgivings_i18n_en_json_1["default"]
|
|
71
|
+
'en': prayers_and_thanksgivings_i18n_en_json_1["default"],
|
|
72
|
+
'es': prayers_and_thanksgivings_i18n_es_json_1["default"]
|
|
71
73
|
};
|
|
72
74
|
var PrayersAndThanksgivingsComponent = /** @class */ (function () {
|
|
73
75
|
function PrayersAndThanksgivingsComponent() {
|
|
@@ -168,7 +170,7 @@ var PrayersAndThanksgivingsComponent = /** @class */ (function () {
|
|
|
168
170
|
return map;
|
|
169
171
|
}
|
|
170
172
|
var options = !this.filter ? this.currentOptions || [] :
|
|
171
|
-
(this.currentOptions || []).filter(function (doc) { var _a, _b, _c, _d; return ((_b = (_a = doc.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(_this.filter.toLowerCase())) || ((_d = (_c = (doc.value
|
|
173
|
+
(this.currentOptions || []).filter(function (doc) { var _a, _b, _c, _d; return ((_b = (_a = doc.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(_this.filter.toLowerCase())) || ((_d = (_c = JSON.stringify(doc.value)) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === null || _d === void 0 ? void 0 : _d.includes(_this.filter.toLowerCase())); });
|
|
172
174
|
var categories = Array.from(groupBy(options, function (item) { return (item.category || [])[1]; }));
|
|
173
175
|
var subcategories = categories.map(function (_a) {
|
|
174
176
|
var categoryLabel = _a[0], values = _a[1];
|
|
@@ -192,10 +194,24 @@ var PrayersAndThanksgivingsComponent = /** @class */ (function () {
|
|
|
192
194
|
React.createElement("h3", { "class": "padded" }, subcategory)
|
|
193
195
|
], subvalues
|
|
194
196
|
.sort(function (a, b) { var _a, _b; return Number((_a = a.label) === null || _a === void 0 ? void 0 : _a.split('.')[0]) < Number((_b = b.label) === null || _b === void 0 ? void 0 : _b.split('.')[0]) ? -1 : 1; })
|
|
195
|
-
.map(function (option) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
.map(function (option) {
|
|
198
|
+
var _a, _b, _c, _d, _e, _f;
|
|
199
|
+
var summary;
|
|
200
|
+
if (option.type == "text") {
|
|
201
|
+
summary = (_b = (_a = option.value[0]) === null || _a === void 0 ? void 0 : _a.replace(/\*/g, '')) === null || _b === void 0 ? void 0 : _b.replace(" ", " ");
|
|
202
|
+
}
|
|
203
|
+
else if (option.type == "liturgy") {
|
|
204
|
+
summary = (_e = (_d = (_c = option.value[0]) === null || _c === void 0 ? void 0 : _c.value[0]) === null || _d === void 0 ? void 0 : _d.replace(/\*/g, '')) === null || _e === void 0 ? void 0 : _e.replace(" ", " ");
|
|
205
|
+
}
|
|
206
|
+
else if (option.type == "responsive-prayer") {
|
|
207
|
+
summary = (_f = option.value[0]) === null || _f === void 0 ? void 0 : _f.text;
|
|
208
|
+
}
|
|
209
|
+
summary = summary || "";
|
|
210
|
+
return React.createElement("ion-item", { button: true, onClick: function () { return _this.addPrayer(option); } },
|
|
211
|
+
React.createElement("ion-label", null,
|
|
212
|
+
React.createElement("h3", null, option.label),
|
|
213
|
+
React.createElement("p", null, summary)));
|
|
214
|
+
}));
|
|
199
215
|
}));
|
|
200
216
|
}));
|
|
201
217
|
return this.modal
|
|
@@ -3,8 +3,10 @@ import { Component, Prop, Watch, State, Element, h, Event, Method } from '@stenc
|
|
|
3
3
|
import { Change } from '@venite/ldf';
|
|
4
4
|
import { getComponentClosestLanguage } from '../../utils/locale';
|
|
5
5
|
import EN from './prayers-and-thanksgivings.i18n.en.json';
|
|
6
|
+
import ES from './prayers-and-thanksgivings.i18n.es.json';
|
|
6
7
|
const LOCALE = {
|
|
7
8
|
'en': EN,
|
|
9
|
+
'es': ES
|
|
8
10
|
};
|
|
9
11
|
export class PrayersAndThanksgivingsComponent {
|
|
10
12
|
constructor() {
|
|
@@ -79,7 +81,7 @@ export class PrayersAndThanksgivingsComponent {
|
|
|
79
81
|
return map;
|
|
80
82
|
}
|
|
81
83
|
const options = !this.filter ? this.currentOptions || [] :
|
|
82
|
-
(this.currentOptions || []).filter(doc => { var _a, _b, _c, _d; return ((_b = (_a = doc.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(this.filter.toLowerCase())) || ((_d = (_c = (doc.value
|
|
84
|
+
(this.currentOptions || []).filter(doc => { var _a, _b, _c, _d; return ((_b = (_a = doc.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(this.filter.toLowerCase())) || ((_d = (_c = JSON.stringify(doc.value)) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === null || _d === void 0 ? void 0 : _d.includes(this.filter.toLowerCase())); });
|
|
83
85
|
const categories = Array.from(groupBy(options, (item) => (item.category || [])[1]));
|
|
84
86
|
const subcategories = categories.map(([categoryLabel, values]) => [categoryLabel, Array.from(groupBy(values, (item) => (item.category || [])[2]))]);
|
|
85
87
|
return subcategories;
|
|
@@ -95,10 +97,24 @@ export class PrayersAndThanksgivingsComponent {
|
|
|
95
97
|
h("h3", { class: "padded" }, subcategory),
|
|
96
98
|
...subvalues
|
|
97
99
|
.sort((a, b) => { var _a, _b; return Number((_a = a.label) === null || _a === void 0 ? void 0 : _a.split('.')[0]) < Number((_b = b.label) === null || _b === void 0 ? void 0 : _b.split('.')[0]) ? -1 : 1; })
|
|
98
|
-
.map(option =>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
.map(option => {
|
|
101
|
+
var _a, _b, _c, _d, _e, _f;
|
|
102
|
+
let summary;
|
|
103
|
+
if (option.type == "text") {
|
|
104
|
+
summary = (_b = (_a = option.value[0]) === null || _a === void 0 ? void 0 : _a.replace(/\*/g, '')) === null || _b === void 0 ? void 0 : _b.replace(" ", " ");
|
|
105
|
+
}
|
|
106
|
+
else if (option.type == "liturgy") {
|
|
107
|
+
summary = (_e = (_d = (_c = option.value[0]) === null || _c === void 0 ? void 0 : _c.value[0]) === null || _d === void 0 ? void 0 : _d.replace(/\*/g, '')) === null || _e === void 0 ? void 0 : _e.replace(" ", " ");
|
|
108
|
+
}
|
|
109
|
+
else if (option.type == "responsive-prayer") {
|
|
110
|
+
summary = (_f = option.value[0]) === null || _f === void 0 ? void 0 : _f.text;
|
|
111
|
+
}
|
|
112
|
+
summary = summary || "";
|
|
113
|
+
return h("ion-item", { button: true, onClick: () => this.addPrayer(option) },
|
|
114
|
+
h("ion-label", null,
|
|
115
|
+
h("h3", null, option.label),
|
|
116
|
+
h("p", null, summary)));
|
|
117
|
+
})
|
|
102
118
|
])
|
|
103
119
|
]));
|
|
104
120
|
return this.modal
|
|
@@ -149,23 +149,23 @@ var TextComponent = /** @class */ (function () {
|
|
|
149
149
|
// Render
|
|
150
150
|
TextComponent.prototype.render = function () {
|
|
151
151
|
var _this = this;
|
|
152
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
152
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
153
153
|
var localeStrings = this.localeStrings || {};
|
|
154
154
|
/** `authorized-prayer` type */
|
|
155
155
|
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) === 'authorized-prayers') {
|
|
156
156
|
var splits = this.path.split('/'), index_1 = Number(splits[splits.length - 1]), base_1 = splits.slice(0, splits.length - 1).join('/');
|
|
157
157
|
return React.createElement(core_1.Host, null,
|
|
158
158
|
React.createElement("ldf-label-bar", null,
|
|
159
|
-
React.createElement("ion-button", { onClick: function () { return _this.addPAndT(base_1, index_1); }, fill: "clear" }, localeStrings.authorized_prayers)),
|
|
159
|
+
React.createElement("ion-button", { onClick: function () { return _this.addPAndT(base_1, index_1); }, fill: "clear" }, localeStrings.authorized_prayers)), (_c = ((_b = this.intentions) === null || _b === void 0 ? void 0 : _b.length) > 0) !== null && _c !== void 0 ? _c : React.createElement("strong", { "class": "prayer-list" }, localeStrings['prayer-list']),
|
|
160
160
|
React.createElement("ul", { "class": "prayer-list" }, (this.intentions || []).map(function (intention) { return React.createElement("li", null, intention); })));
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
|
-
var value = ((
|
|
164
|
-
: (((
|
|
163
|
+
var value = ((_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.rollup) ? (((_f = this.obj) === null || _f === void 0 ? void 0 : _f.value) || []).map(function (s) { return s.replace(/\s+/g, ' '); })
|
|
164
|
+
: (((_g = this.obj) === null || _g === void 0 ? void 0 : _g.value) || []);
|
|
165
165
|
var compiledValue_1 = value.map(function (s) {
|
|
166
166
|
return s.split(/([\*\w\n\s,:;\.\-–—'“☩✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”☩✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
167
167
|
});
|
|
168
|
-
if (!this.editable && ((
|
|
168
|
+
if (!this.editable && ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.display_format) === 'abbreviated') {
|
|
169
169
|
var firstSection = compiledValue_1[0], lastSection = compiledValue_1[compiledValue_1.length - 1];
|
|
170
170
|
var firstChunk = this.truncate(firstSection[0]), lastChunk = this.truncate(lastSection[lastSection.length - 1], true);
|
|
171
171
|
compiledValue_1 = [[firstChunk], [lastChunk]];
|
|
@@ -176,27 +176,27 @@ var TextComponent = /** @class */ (function () {
|
|
|
176
176
|
React.createElement("slot", { slot: 'end', name: 'controls' })),
|
|
177
177
|
!this.editable && React.createElement("ldf-heading", { path: this.path + "/label", doc: new ldf_1.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }),
|
|
178
178
|
this.editable && React.createElement("ldf-label-bar", null,
|
|
179
|
-
!((
|
|
180
|
-
React.createElement("ldf-editable-text", { id: (this.obj.uid || this.obj.slug) + "-label", text: (
|
|
181
|
-
React.createElement("ldf-editable-text", { slot: "end", id: "source-source", text: (
|
|
182
|
-
React.createElement("ldf-editable-text", { slot: "end", id: "source-citation", text: (
|
|
183
|
-
React.createElement("div", { "class": "text " + (this.editable ? 'editable' : '') + " " + (((
|
|
179
|
+
!((_k = (_j = this.obj) === null || _j === void 0 ? void 0 : _j.metadata) === null || _k === void 0 ? void 0 : _k.omit_label) && React.createElement("h3", { "class": "editable-label", slot: "start" },
|
|
180
|
+
React.createElement("ldf-editable-text", { id: (this.obj.uid || this.obj.slug) + "-label", text: (_l = this.obj) === null || _l === void 0 ? void 0 : _l.label, placeholder: localeStrings.label, path: this.path + "/label" })),
|
|
181
|
+
React.createElement("ldf-editable-text", { slot: "end", id: "source-source", text: (_o = (_m = this.obj) === null || _m === void 0 ? void 0 : _m.source) === null || _o === void 0 ? void 0 : _o.source, path: this.path + "/source/source", placeholder: (_p = this.localeStrings) === null || _p === void 0 ? void 0 : _p.source }),
|
|
182
|
+
React.createElement("ldf-editable-text", { slot: "end", id: "source-citation", text: (_r = (_q = this.obj) === null || _q === void 0 ? void 0 : _q.source) === null || _r === void 0 ? void 0 : _r.citation, path: this.path + "/source/citation", placeholder: (_s = this.localeStrings) === null || _s === void 0 ? void 0 : _s.source_citation })),
|
|
183
|
+
React.createElement("div", { "class": "text " + (this.editable ? 'editable' : '') + " " + (((_t = this.obj) === null || _t === void 0 ? void 0 : _t.display_format) || 'default') },
|
|
184
184
|
this.obj.value.map(function (prayer, prayerIndex) {
|
|
185
185
|
return React.createElement("ldf-editable-text", { id: (_this.obj.uid || _this.obj.slug) + "-" + prayerIndex, text: prayer, path: _this.path + "/value/" + prayerIndex });
|
|
186
186
|
}),
|
|
187
|
-
(((
|
|
187
|
+
(((_u = this.obj) === null || _u === void 0 ? void 0 : _u.style) === 'prayer' || (((_w = (_v = this.obj) === null || _v === void 0 ? void 0 : _v.metadata) === null || _w === void 0 ? void 0 : _w.response) && !((_y = (_x = this.obj) === null || _x === void 0 ? void 0 : _x.metadata) === null || _y === void 0 ? void 0 : _y.omit_response))) && React.createElement("span", { "class": 'response' },
|
|
188
188
|
React.createElement("ldf-editable-text", { id: (this.obj.uid || this.obj.slug) + "-response", text: this.obj.metadata && this.obj.metadata.response, path: this.path + "/response", placeholder: localeStrings.amen })))));
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
191
|
/** `markdown` types */
|
|
192
|
-
if (((
|
|
192
|
+
if (((_z = this.obj) === null || _z === void 0 ? void 0 : _z.style) === 'markdown') {
|
|
193
193
|
var converter_1 = new showdown_1["default"].Converter();
|
|
194
|
-
return (((
|
|
194
|
+
return (((_0 = this.obj) === null || _0 === void 0 ? void 0 : _0.value) || []).map(function (value) { return React.createElement("div", { innerHTML: converter_1.makeHtml(value) }); });
|
|
195
195
|
}
|
|
196
196
|
/** `text` and `prayer` types */
|
|
197
197
|
else {
|
|
198
|
-
return (React.createElement("div", { lang: ((
|
|
199
|
-
((((
|
|
198
|
+
return (React.createElement("div", { lang: ((_1 = this.obj) === null || _1 === void 0 ? void 0 : _1.language) || 'en', "class": "text " + (((_2 = this.obj) === null || _2 === void 0 ? void 0 : _2.display_format) || 'default') },
|
|
199
|
+
((((_3 = this.obj) === null || _3 === void 0 ? void 0 : _3.label) && !((_5 = (_4 = this.obj) === null || _4 === void 0 ? void 0 : _4.metadata) === null || _5 === void 0 ? void 0 : _5.omit_label)) || ((_6 = this.obj) === null || _6 === void 0 ? void 0 : _6.citation)) && React.createElement("ldf-heading", { path: this.path, doc: new ldf_1.Heading({ type: 'heading', metadata: { level: 3 }, value: [((_7 = this.obj.metadata) === null || _7 === void 0 ? void 0 : _7.omit_label) ? '' : this.obj.label], citation: this.obj.citation, source: this.obj.source }) }),
|
|
200
200
|
compiledValue_1.map(function (prayer, prayerIndex) {
|
|
201
201
|
var _a, _b, _c, _d;
|
|
202
202
|
return React.createElement("p", { "class": "text-body", id: (_this.obj.uid || _this.obj.slug) + "-prayerIndex" }, prayer === null || prayer === void 0 ? void 0 :
|
|
@@ -49,4 +49,17 @@ h3.editable-label {
|
|
|
49
49
|
text-transform: var(--ldf-h3-text-transform);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/* .text.abbreviated is handled in the DOM itself, in the component */
|
|
52
|
+
/* .text.abbreviated is handled in the DOM itself, in the component */
|
|
53
|
+
.prayer-list {
|
|
54
|
+
display: block;
|
|
55
|
+
margin: 0;
|
|
56
|
+
padding: 0;
|
|
57
|
+
text-align: center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.prayer-list li {
|
|
61
|
+
list-style-type: none;
|
|
62
|
+
text-align: center;
|
|
63
|
+
margin: 0.5em 0;
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
@@ -74,24 +74,24 @@ export class TextComponent {
|
|
|
74
74
|
}
|
|
75
75
|
// Render
|
|
76
76
|
render() {
|
|
77
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
78
78
|
const localeStrings = this.localeStrings || {};
|
|
79
79
|
/** `authorized-prayer` type */
|
|
80
80
|
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) === 'authorized-prayers') {
|
|
81
81
|
const splits = this.path.split('/'), index = Number(splits[splits.length - 1]), base = splits.slice(0, splits.length - 1).join('/');
|
|
82
82
|
return h(Host, null,
|
|
83
83
|
h("ldf-label-bar", null,
|
|
84
|
-
h("ion-button", { onClick: () => this.addPAndT(base, index), fill: "clear" }, localeStrings.authorized_prayers)),
|
|
84
|
+
h("ion-button", { onClick: () => this.addPAndT(base, index), fill: "clear" }, localeStrings.authorized_prayers)), (_c = ((_b = this.intentions) === null || _b === void 0 ? void 0 : _b.length) > 0) !== null && _c !== void 0 ? _c : h("strong", { class: "prayer-list" }, localeStrings['prayer-list']),
|
|
85
85
|
h("ul", { class: "prayer-list" }, (this.intentions || []).map(intention => h("li", null, intention))));
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
let value = ((
|
|
89
|
-
? (((
|
|
90
|
-
: (((
|
|
88
|
+
let value = ((_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.rollup)
|
|
89
|
+
? (((_f = this.obj) === null || _f === void 0 ? void 0 : _f.value) || []).map(s => s.replace(/\s+/g, ' '))
|
|
90
|
+
: (((_g = this.obj) === null || _g === void 0 ? void 0 : _g.value) || []);
|
|
91
91
|
let compiledValue = value.map(s => {
|
|
92
92
|
return s.split(/([\*\w\n\s,:;\.\-–—'“☩✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”☩✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
93
93
|
});
|
|
94
|
-
if (!this.editable && ((
|
|
94
|
+
if (!this.editable && ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.display_format) === 'abbreviated') {
|
|
95
95
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
96
96
|
const firstChunk = this.truncate(firstSection[0]), lastChunk = this.truncate(lastSection[lastSection.length - 1], true);
|
|
97
97
|
compiledValue = [[firstChunk], [lastChunk]];
|
|
@@ -102,25 +102,25 @@ export class TextComponent {
|
|
|
102
102
|
h("slot", { slot: 'end', name: 'controls' })),
|
|
103
103
|
!this.editable && h("ldf-heading", { path: `${this.path}/label`, doc: new Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }),
|
|
104
104
|
this.editable && h("ldf-label-bar", null,
|
|
105
|
-
!((
|
|
106
|
-
h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-label`, text: (
|
|
107
|
-
h("ldf-editable-text", { slot: "end", id: "source-source", text: (
|
|
108
|
-
h("ldf-editable-text", { slot: "end", id: "source-citation", text: (
|
|
109
|
-
h("div", { class: `text ${this.editable ? 'editable' : ''} ${((
|
|
105
|
+
!((_k = (_j = this.obj) === null || _j === void 0 ? void 0 : _j.metadata) === null || _k === void 0 ? void 0 : _k.omit_label) && h("h3", { class: "editable-label", slot: "start" },
|
|
106
|
+
h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-label`, text: (_l = this.obj) === null || _l === void 0 ? void 0 : _l.label, placeholder: localeStrings.label, path: `${this.path}/label` })),
|
|
107
|
+
h("ldf-editable-text", { slot: "end", id: "source-source", text: (_o = (_m = this.obj) === null || _m === void 0 ? void 0 : _m.source) === null || _o === void 0 ? void 0 : _o.source, path: `${this.path}/source/source`, placeholder: (_p = this.localeStrings) === null || _p === void 0 ? void 0 : _p.source }),
|
|
108
|
+
h("ldf-editable-text", { slot: "end", id: "source-citation", text: (_r = (_q = this.obj) === null || _q === void 0 ? void 0 : _q.source) === null || _r === void 0 ? void 0 : _r.citation, path: `${this.path}/source/citation`, placeholder: (_s = this.localeStrings) === null || _s === void 0 ? void 0 : _s.source_citation })),
|
|
109
|
+
h("div", { class: `text ${this.editable ? 'editable' : ''} ${((_t = this.obj) === null || _t === void 0 ? void 0 : _t.display_format) || 'default'}` },
|
|
110
110
|
this.obj.value.map((prayer, prayerIndex) => h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${prayerIndex}`, text: prayer, path: `${this.path}/value/${prayerIndex}` })),
|
|
111
|
-
(((
|
|
111
|
+
(((_u = this.obj) === null || _u === void 0 ? void 0 : _u.style) === 'prayer' || (((_w = (_v = this.obj) === null || _v === void 0 ? void 0 : _v.metadata) === null || _w === void 0 ? void 0 : _w.response) && !((_y = (_x = this.obj) === null || _x === void 0 ? void 0 : _x.metadata) === null || _y === void 0 ? void 0 : _y.omit_response))) && h("span", { class: 'response' },
|
|
112
112
|
h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-response`, text: this.obj.metadata && this.obj.metadata.response, path: `${this.path}/response`, placeholder: localeStrings.amen })))));
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
115
|
/** `markdown` types */
|
|
116
|
-
if (((
|
|
116
|
+
if (((_z = this.obj) === null || _z === void 0 ? void 0 : _z.style) === 'markdown') {
|
|
117
117
|
const converter = new showdown.Converter();
|
|
118
|
-
return (((
|
|
118
|
+
return (((_0 = this.obj) === null || _0 === void 0 ? void 0 : _0.value) || []).map(value => h("div", { innerHTML: converter.makeHtml(value) }));
|
|
119
119
|
}
|
|
120
120
|
/** `text` and `prayer` types */
|
|
121
121
|
else {
|
|
122
|
-
return (h("div", { lang: ((
|
|
123
|
-
((((
|
|
122
|
+
return (h("div", { lang: ((_1 = this.obj) === null || _1 === void 0 ? void 0 : _1.language) || 'en', class: `text ${((_2 = this.obj) === null || _2 === void 0 ? void 0 : _2.display_format) || 'default'}` },
|
|
123
|
+
((((_3 = this.obj) === null || _3 === void 0 ? void 0 : _3.label) && !((_5 = (_4 = this.obj) === null || _4 === void 0 ? void 0 : _4.metadata) === null || _5 === void 0 ? void 0 : _5.omit_label)) || ((_6 = this.obj) === null || _6 === void 0 ? void 0 : _6.citation)) && h("ldf-heading", { path: this.path, doc: new Heading({ type: 'heading', metadata: { level: 3 }, value: [((_7 = this.obj.metadata) === null || _7 === void 0 ? void 0 : _7.omit_label) ? '' : this.obj.label], citation: this.obj.citation, source: this.obj.source }) }),
|
|
124
124
|
compiledValue.map((prayer, prayerIndex) => {
|
|
125
125
|
var _a, _b, _c, _d;
|
|
126
126
|
return h("p", { class: "text-body", id: `${this.obj.uid || this.obj.slug}-prayerIndex` }, prayer === null || prayer === void 0 ? void 0 :
|
|
File without changes
|