@venite/components 0.16.18 → 0.16.22-s
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/ion-button_13.cjs.entry.js +23 -3
- package/dist/cjs/ldf-day-name_5.cjs.entry.js +31 -15
- package/dist/cjs/ldf.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- 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 +43 -16
- 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 +71 -19
- 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/ion-button_13.entry.js +23 -3
- package/dist/esm/ldf-day-name_5.entry.js +31 -15
- package/dist/esm/ldf.js +1 -1
- package/dist/esm/loader.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-e4f0cd91.entry.js → p-7a9ab85c.entry.js} +1 -1
- package/dist/ldf/{p-f184d804.entry.js → p-e301606a.entry.js} +1 -1
- package/dist/types/components/text/text.d.ts +4 -0
- package/dist/types/components.d.ts +5 -0
- package/package.json +1 -1
|
@@ -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
|
|
@@ -56,8 +56,20 @@ var LOCALE = {
|
|
|
56
56
|
};
|
|
57
57
|
var TextComponent = /** @class */ (function () {
|
|
58
58
|
function TextComponent() {
|
|
59
|
+
// prayer list for authorized prayers
|
|
60
|
+
this.intentions = [];
|
|
59
61
|
}
|
|
62
|
+
TextComponent.prototype.setPrayerList = function (intentions) {
|
|
63
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
console.log("(PrayerList) setPrayerList", intentions);
|
|
66
|
+
this.intentions = intentions;
|
|
67
|
+
return [2 /*return*/];
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
60
71
|
TextComponent.prototype.docChanged = function (newDoc) {
|
|
72
|
+
var _a;
|
|
61
73
|
try {
|
|
62
74
|
if (typeof newDoc == 'string') {
|
|
63
75
|
this.obj = new ldf_1.Text(JSON.parse(newDoc));
|
|
@@ -65,6 +77,10 @@ var TextComponent = /** @class */ (function () {
|
|
|
65
77
|
else {
|
|
66
78
|
this.obj = new ldf_1.Text(newDoc);
|
|
67
79
|
}
|
|
80
|
+
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) == "authorized-prayers") {
|
|
81
|
+
console.log("(PrayerList) ldfAskForPrayerList");
|
|
82
|
+
this.ldfAskForPrayerList.emit(true);
|
|
83
|
+
}
|
|
68
84
|
}
|
|
69
85
|
catch (e) {
|
|
70
86
|
console.warn(e);
|
|
@@ -133,21 +149,23 @@ var TextComponent = /** @class */ (function () {
|
|
|
133
149
|
// Render
|
|
134
150
|
TextComponent.prototype.render = function () {
|
|
135
151
|
var _this = this;
|
|
136
|
-
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;
|
|
137
153
|
var localeStrings = this.localeStrings || {};
|
|
138
154
|
/** `authorized-prayer` type */
|
|
139
155
|
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) === 'authorized-prayers') {
|
|
140
156
|
var splits = this.path.split('/'), index_1 = Number(splits[splits.length - 1]), base_1 = splits.slice(0, splits.length - 1).join('/');
|
|
141
|
-
return React.createElement(
|
|
142
|
-
React.createElement("
|
|
157
|
+
return React.createElement(core_1.Host, null,
|
|
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)), (_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
|
+
React.createElement("ul", { "class": "prayer-list" }, (this.intentions || []).map(function (intention) { return React.createElement("li", null, intention); })));
|
|
143
161
|
}
|
|
144
162
|
else {
|
|
145
|
-
var value = ((
|
|
146
|
-
: (((
|
|
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) || []);
|
|
147
165
|
var compiledValue_1 = value.map(function (s) {
|
|
148
166
|
return s.split(/([\*\w\n\s,:;\.\-–—'“☩✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”☩✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
149
167
|
});
|
|
150
|
-
if (!this.editable && ((
|
|
168
|
+
if (!this.editable && ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.display_format) === 'abbreviated') {
|
|
151
169
|
var firstSection = compiledValue_1[0], lastSection = compiledValue_1[compiledValue_1.length - 1];
|
|
152
170
|
var firstChunk = this.truncate(firstSection[0]), lastChunk = this.truncate(lastSection[lastSection.length - 1], true);
|
|
153
171
|
compiledValue_1 = [[firstChunk], [lastChunk]];
|
|
@@ -158,27 +176,27 @@ var TextComponent = /** @class */ (function () {
|
|
|
158
176
|
React.createElement("slot", { slot: 'end', name: 'controls' })),
|
|
159
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 }) }),
|
|
160
178
|
this.editable && React.createElement("ldf-label-bar", null,
|
|
161
|
-
!((
|
|
162
|
-
React.createElement("ldf-editable-text", { id: (this.obj.uid || this.obj.slug) + "-label", text: (
|
|
163
|
-
React.createElement("ldf-editable-text", { slot: "end", id: "source-source", text: (
|
|
164
|
-
React.createElement("ldf-editable-text", { slot: "end", id: "source-citation", text: (
|
|
165
|
-
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') },
|
|
166
184
|
this.obj.value.map(function (prayer, prayerIndex) {
|
|
167
185
|
return React.createElement("ldf-editable-text", { id: (_this.obj.uid || _this.obj.slug) + "-" + prayerIndex, text: prayer, path: _this.path + "/value/" + prayerIndex });
|
|
168
186
|
}),
|
|
169
|
-
(((
|
|
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' },
|
|
170
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 })))));
|
|
171
189
|
}
|
|
172
190
|
else {
|
|
173
191
|
/** `markdown` types */
|
|
174
|
-
if (((
|
|
192
|
+
if (((_z = this.obj) === null || _z === void 0 ? void 0 : _z.style) === 'markdown') {
|
|
175
193
|
var converter_1 = new showdown_1["default"].Converter();
|
|
176
|
-
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) }); });
|
|
177
195
|
}
|
|
178
196
|
/** `text` and `prayer` types */
|
|
179
197
|
else {
|
|
180
|
-
return (React.createElement("div", { lang: ((
|
|
181
|
-
((((
|
|
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 }) }),
|
|
182
200
|
compiledValue_1.map(function (prayer, prayerIndex) {
|
|
183
201
|
var _a, _b, _c, _d;
|
|
184
202
|
return React.createElement("p", { "class": "text-body", id: (_this.obj.uid || _this.obj.slug) + "-prayerIndex" }, prayer === null || prayer === void 0 ? void 0 :
|
|
@@ -207,6 +225,12 @@ var TextComponent = /** @class */ (function () {
|
|
|
207
225
|
__decorate([
|
|
208
226
|
core_1.State()
|
|
209
227
|
], TextComponent.prototype, "localeStrings");
|
|
228
|
+
__decorate([
|
|
229
|
+
core_1.State()
|
|
230
|
+
], TextComponent.prototype, "intentions");
|
|
231
|
+
__decorate([
|
|
232
|
+
core_1.Method()
|
|
233
|
+
], TextComponent.prototype, "setPrayerList");
|
|
210
234
|
__decorate([
|
|
211
235
|
core_1.Prop()
|
|
212
236
|
], TextComponent.prototype, "doc");
|
|
@@ -222,6 +246,9 @@ var TextComponent = /** @class */ (function () {
|
|
|
222
246
|
__decorate([
|
|
223
247
|
core_1.Event({ bubbles: true })
|
|
224
248
|
], TextComponent.prototype, "ldfDocShouldChange");
|
|
249
|
+
__decorate([
|
|
250
|
+
core_1.Event({ bubbles: true })
|
|
251
|
+
], TextComponent.prototype, "ldfAskForPrayerList");
|
|
225
252
|
TextComponent = __decorate([
|
|
226
253
|
core_1.Component({
|
|
227
254
|
tag: 'ldf-text',
|
|
@@ -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
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, Watch, State, Element, Host, Event, h } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, Watch, State, Element, Host, Event, h, Method } from '@stencil/core';
|
|
2
2
|
import { Text, Heading } from '@venite/ldf';
|
|
3
3
|
import { getComponentClosestLanguage } from '../../utils/locale';
|
|
4
4
|
import showdown from 'showdown';
|
|
@@ -10,7 +10,16 @@ const LOCALE = {
|
|
|
10
10
|
'es': ES
|
|
11
11
|
};
|
|
12
12
|
export class TextComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
// prayer list for authorized prayers
|
|
15
|
+
this.intentions = [];
|
|
16
|
+
}
|
|
17
|
+
async setPrayerList(intentions) {
|
|
18
|
+
console.log("(PrayerList) setPrayerList", intentions);
|
|
19
|
+
this.intentions = intentions;
|
|
20
|
+
}
|
|
13
21
|
docChanged(newDoc) {
|
|
22
|
+
var _a;
|
|
14
23
|
try {
|
|
15
24
|
if (typeof newDoc == 'string') {
|
|
16
25
|
this.obj = new Text(JSON.parse(newDoc));
|
|
@@ -18,6 +27,10 @@ export class TextComponent {
|
|
|
18
27
|
else {
|
|
19
28
|
this.obj = new Text(newDoc);
|
|
20
29
|
}
|
|
30
|
+
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) == "authorized-prayers") {
|
|
31
|
+
console.log("(PrayerList) ldfAskForPrayerList");
|
|
32
|
+
this.ldfAskForPrayerList.emit(true);
|
|
33
|
+
}
|
|
21
34
|
}
|
|
22
35
|
catch (e) {
|
|
23
36
|
console.warn(e);
|
|
@@ -61,22 +74,24 @@ export class TextComponent {
|
|
|
61
74
|
}
|
|
62
75
|
// Render
|
|
63
76
|
render() {
|
|
64
|
-
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;
|
|
65
78
|
const localeStrings = this.localeStrings || {};
|
|
66
79
|
/** `authorized-prayer` type */
|
|
67
80
|
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) === 'authorized-prayers') {
|
|
68
81
|
const splits = this.path.split('/'), index = Number(splits[splits.length - 1]), base = splits.slice(0, splits.length - 1).join('/');
|
|
69
|
-
return h(
|
|
70
|
-
h("
|
|
82
|
+
return h(Host, null,
|
|
83
|
+
h("ldf-label-bar", null,
|
|
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
|
+
h("ul", { class: "prayer-list" }, (this.intentions || []).map(intention => h("li", null, intention))));
|
|
71
86
|
}
|
|
72
87
|
else {
|
|
73
|
-
let value = ((
|
|
74
|
-
? (((
|
|
75
|
-
: (((
|
|
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) || []);
|
|
76
91
|
let compiledValue = value.map(s => {
|
|
77
92
|
return s.split(/([\*\w\n\s,:;\.\-–—'“☩✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”☩✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
78
93
|
});
|
|
79
|
-
if (!this.editable && ((
|
|
94
|
+
if (!this.editable && ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.display_format) === 'abbreviated') {
|
|
80
95
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
81
96
|
const firstChunk = this.truncate(firstSection[0]), lastChunk = this.truncate(lastSection[lastSection.length - 1], true);
|
|
82
97
|
compiledValue = [[firstChunk], [lastChunk]];
|
|
@@ -87,25 +102,25 @@ export class TextComponent {
|
|
|
87
102
|
h("slot", { slot: 'end', name: 'controls' })),
|
|
88
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 }) }),
|
|
89
104
|
this.editable && h("ldf-label-bar", null,
|
|
90
|
-
!((
|
|
91
|
-
h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-label`, text: (
|
|
92
|
-
h("ldf-editable-text", { slot: "end", id: "source-source", text: (
|
|
93
|
-
h("ldf-editable-text", { slot: "end", id: "source-citation", text: (
|
|
94
|
-
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'}` },
|
|
95
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}` })),
|
|
96
|
-
(((
|
|
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' },
|
|
97
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 })))));
|
|
98
113
|
}
|
|
99
114
|
else {
|
|
100
115
|
/** `markdown` types */
|
|
101
|
-
if (((
|
|
116
|
+
if (((_z = this.obj) === null || _z === void 0 ? void 0 : _z.style) === 'markdown') {
|
|
102
117
|
const converter = new showdown.Converter();
|
|
103
|
-
return (((
|
|
118
|
+
return (((_0 = this.obj) === null || _0 === void 0 ? void 0 : _0.value) || []).map(value => h("div", { innerHTML: converter.makeHtml(value) }));
|
|
104
119
|
}
|
|
105
120
|
/** `text` and `prayer` types */
|
|
106
121
|
else {
|
|
107
|
-
return (h("div", { lang: ((
|
|
108
|
-
((((
|
|
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 }) }),
|
|
109
124
|
compiledValue.map((prayer, prayerIndex) => {
|
|
110
125
|
var _a, _b, _c, _d;
|
|
111
126
|
return h("p", { class: "text-body", id: `${this.obj.uid || this.obj.slug}-prayerIndex` }, prayer === null || prayer === void 0 ? void 0 :
|
|
@@ -193,7 +208,8 @@ export class TextComponent {
|
|
|
193
208
|
}; }
|
|
194
209
|
static get states() { return {
|
|
195
210
|
"obj": {},
|
|
196
|
-
"localeStrings": {}
|
|
211
|
+
"localeStrings": {},
|
|
212
|
+
"intentions": {}
|
|
197
213
|
}; }
|
|
198
214
|
static get events() { return [{
|
|
199
215
|
"method": "ldfDocShouldChange",
|
|
@@ -215,7 +231,43 @@ export class TextComponent {
|
|
|
215
231
|
}
|
|
216
232
|
}
|
|
217
233
|
}
|
|
234
|
+
}, {
|
|
235
|
+
"method": "ldfAskForPrayerList",
|
|
236
|
+
"name": "ldfAskForPrayerList",
|
|
237
|
+
"bubbles": true,
|
|
238
|
+
"cancelable": true,
|
|
239
|
+
"composed": true,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": "Request prayer list for Prayers and Thanksgivings"
|
|
243
|
+
},
|
|
244
|
+
"complexType": {
|
|
245
|
+
"original": "boolean",
|
|
246
|
+
"resolved": "boolean",
|
|
247
|
+
"references": {}
|
|
248
|
+
}
|
|
218
249
|
}]; }
|
|
250
|
+
static get methods() { return {
|
|
251
|
+
"setPrayerList": {
|
|
252
|
+
"complexType": {
|
|
253
|
+
"signature": "(intentions: string[]) => Promise<void>",
|
|
254
|
+
"parameters": [{
|
|
255
|
+
"tags": [],
|
|
256
|
+
"text": ""
|
|
257
|
+
}],
|
|
258
|
+
"references": {
|
|
259
|
+
"Promise": {
|
|
260
|
+
"location": "global"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"return": "Promise<void>"
|
|
264
|
+
},
|
|
265
|
+
"docs": {
|
|
266
|
+
"text": "",
|
|
267
|
+
"tags": []
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}; }
|
|
219
271
|
static get elementRef() { return "element"; }
|
|
220
272
|
static get watchers() { return [{
|
|
221
273
|
"propName": "doc",
|
|
@@ -1651,8 +1651,13 @@ Toolbar.style = {
|
|
|
1651
1651
|
md: toolbarMdCss
|
|
1652
1652
|
};
|
|
1653
1653
|
|
|
1654
|
-
const title = "Prayers and Thanksgivings";
|
|
1654
|
+
const title$1 = "Prayers and Thanksgivings";
|
|
1655
1655
|
const EN = {
|
|
1656
|
+
title: title$1
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
const title = "Oraciones y Acciones de Gracias";
|
|
1660
|
+
const ES = {
|
|
1656
1661
|
title: title
|
|
1657
1662
|
};
|
|
1658
1663
|
|
|
@@ -1660,6 +1665,7 @@ const prayersAndThanksgivingsCss = ".padded.sc-ldf-prayers-and-thanksgivings{pad
|
|
|
1660
1665
|
|
|
1661
1666
|
const LOCALE = {
|
|
1662
1667
|
'en': EN,
|
|
1668
|
+
'es': ES
|
|
1663
1669
|
};
|
|
1664
1670
|
const PrayersAndThanksgivingsComponent = class {
|
|
1665
1671
|
constructor(hostRef) {
|
|
@@ -1736,7 +1742,7 @@ const PrayersAndThanksgivingsComponent = class {
|
|
|
1736
1742
|
return map;
|
|
1737
1743
|
}
|
|
1738
1744
|
const options = !this.filter ? this.currentOptions || [] :
|
|
1739
|
-
(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
|
|
1745
|
+
(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())); });
|
|
1740
1746
|
const categories = Array.from(groupBy(options, (item) => (item.category || [])[1]));
|
|
1741
1747
|
const subcategories = categories.map(([categoryLabel, values]) => [categoryLabel, Array.from(groupBy(values, (item) => (item.category || [])[2]))]);
|
|
1742
1748
|
return subcategories;
|
|
@@ -1750,7 +1756,21 @@ const PrayersAndThanksgivingsComponent = class {
|
|
|
1750
1756
|
h("h3", { class: "padded" }, subcategory),
|
|
1751
1757
|
...subvalues
|
|
1752
1758
|
.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; })
|
|
1753
|
-
.map(option =>
|
|
1759
|
+
.map(option => {
|
|
1760
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1761
|
+
let summary;
|
|
1762
|
+
if (option.type == "text") {
|
|
1763
|
+
summary = (_b = (_a = option.value[0]) === null || _a === void 0 ? void 0 : _a.replace(/\*/g, '')) === null || _b === void 0 ? void 0 : _b.replace(" ", " ");
|
|
1764
|
+
}
|
|
1765
|
+
else if (option.type == "liturgy") {
|
|
1766
|
+
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(" ", " ");
|
|
1767
|
+
}
|
|
1768
|
+
else if (option.type == "responsive-prayer") {
|
|
1769
|
+
summary = (_f = option.value[0]) === null || _f === void 0 ? void 0 : _f.text;
|
|
1770
|
+
}
|
|
1771
|
+
summary = summary || "";
|
|
1772
|
+
return h("ion-item", { button: true, onClick: () => this.addPrayer(option) }, h("ion-label", null, h("h3", null, option.label), h("p", null, summary)));
|
|
1773
|
+
})
|
|
1754
1774
|
])
|
|
1755
1775
|
]));
|
|
1756
1776
|
return this.modal
|
|
@@ -5543,24 +5543,28 @@ if (module.exports) {
|
|
|
5543
5543
|
});
|
|
5544
5544
|
|
|
5545
5545
|
const amen$1 = "Amen.";
|
|
5546
|
-
const authorized_prayers = "Prayers and Thanksgivings";
|
|
5546
|
+
const authorized_prayers$1 = "Prayers and Thanksgivings";
|
|
5547
5547
|
const label = "Label";
|
|
5548
5548
|
const source = "Source";
|
|
5549
5549
|
const source_citation = "Citation";
|
|
5550
5550
|
const EN = {
|
|
5551
5551
|
amen: amen$1,
|
|
5552
|
-
authorized_prayers: authorized_prayers,
|
|
5552
|
+
authorized_prayers: authorized_prayers$1,
|
|
5553
5553
|
label: label,
|
|
5554
5554
|
source: source,
|
|
5555
|
-
source_citation: source_citation
|
|
5555
|
+
source_citation: source_citation,
|
|
5556
|
+
"prayer-list": "Prayer List"
|
|
5556
5557
|
};
|
|
5557
5558
|
|
|
5558
5559
|
const amen = "Amén.";
|
|
5560
|
+
const authorized_prayers = "Oraciones y Acciones de Gracias";
|
|
5559
5561
|
const ES = {
|
|
5560
|
-
amen: amen
|
|
5562
|
+
amen: amen,
|
|
5563
|
+
"prayer-list": "Oraciones",
|
|
5564
|
+
authorized_prayers: authorized_prayers
|
|
5561
5565
|
};
|
|
5562
5566
|
|
|
5563
|
-
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)}";
|
|
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)}.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}";
|
|
5564
5568
|
|
|
5565
5569
|
const LOCALE = {
|
|
5566
5570
|
'en': EN,
|
|
@@ -5570,8 +5574,16 @@ const TextComponent = class {
|
|
|
5570
5574
|
constructor(hostRef) {
|
|
5571
5575
|
registerInstance(this, hostRef);
|
|
5572
5576
|
this.ldfDocShouldChange = createEvent(this, "ldfDocShouldChange", 7);
|
|
5577
|
+
this.ldfAskForPrayerList = createEvent(this, "ldfAskForPrayerList", 7);
|
|
5578
|
+
// prayer list for authorized prayers
|
|
5579
|
+
this.intentions = [];
|
|
5580
|
+
}
|
|
5581
|
+
async setPrayerList(intentions) {
|
|
5582
|
+
console.log("(PrayerList) setPrayerList", intentions);
|
|
5583
|
+
this.intentions = intentions;
|
|
5573
5584
|
}
|
|
5574
5585
|
docChanged(newDoc) {
|
|
5586
|
+
var _a;
|
|
5575
5587
|
try {
|
|
5576
5588
|
if (typeof newDoc == 'string') {
|
|
5577
5589
|
this.obj = new Text(JSON.parse(newDoc));
|
|
@@ -5579,6 +5591,10 @@ const TextComponent = class {
|
|
|
5579
5591
|
else {
|
|
5580
5592
|
this.obj = new Text(newDoc);
|
|
5581
5593
|
}
|
|
5594
|
+
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) == "authorized-prayers") {
|
|
5595
|
+
console.log("(PrayerList) ldfAskForPrayerList");
|
|
5596
|
+
this.ldfAskForPrayerList.emit(true);
|
|
5597
|
+
}
|
|
5582
5598
|
}
|
|
5583
5599
|
catch (e) {
|
|
5584
5600
|
console.warn(e);
|
|
@@ -5622,37 +5638,37 @@ const TextComponent = class {
|
|
|
5622
5638
|
}
|
|
5623
5639
|
// Render
|
|
5624
5640
|
render() {
|
|
5625
|
-
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;
|
|
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, _6, _7;
|
|
5626
5642
|
const localeStrings = this.localeStrings || {};
|
|
5627
5643
|
/** `authorized-prayer` type */
|
|
5628
5644
|
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) === 'authorized-prayers') {
|
|
5629
5645
|
const splits = this.path.split('/'), index = Number(splits[splits.length - 1]), base = splits.slice(0, splits.length - 1).join('/');
|
|
5630
|
-
return h("ldf-label-bar", null, h("ion-button", { onClick: () => this.addPAndT(base, index), fill: "clear" }, localeStrings.authorized_prayers));
|
|
5646
|
+
return h(Host, null, h("ldf-label-bar", null, 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']), h("ul", { class: "prayer-list" }, (this.intentions || []).map(intention => h("li", null, intention))));
|
|
5631
5647
|
}
|
|
5632
5648
|
else {
|
|
5633
|
-
let value = ((
|
|
5634
|
-
? (((
|
|
5635
|
-
: (((
|
|
5649
|
+
let value = ((_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.rollup)
|
|
5650
|
+
? (((_f = this.obj) === null || _f === void 0 ? void 0 : _f.value) || []).map(s => s.replace(/\s+/g, ' '))
|
|
5651
|
+
: (((_g = this.obj) === null || _g === void 0 ? void 0 : _g.value) || []);
|
|
5636
5652
|
let compiledValue = value.map(s => {
|
|
5637
5653
|
return s.split(/([\*\w\n\s,:;\.\-–—'“☩✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”☩✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
5638
5654
|
});
|
|
5639
|
-
if (!this.editable && ((
|
|
5655
|
+
if (!this.editable && ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.display_format) === 'abbreviated') {
|
|
5640
5656
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
5641
5657
|
const firstChunk = this.truncate(firstSection[0]), lastChunk = this.truncate(lastSection[lastSection.length - 1], true);
|
|
5642
5658
|
compiledValue = [[firstChunk], [lastChunk]];
|
|
5643
5659
|
}
|
|
5644
5660
|
if (this.editable) {
|
|
5645
|
-
return (h(Host, { lang: this.obj.language }, h("ldf-label-bar", null, h("slot", { slot: 'end', name: 'controls' })), !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 }) }), this.editable && h("ldf-label-bar", null, !((
|
|
5661
|
+
return (h(Host, { lang: this.obj.language }, h("ldf-label-bar", null, h("slot", { slot: 'end', name: 'controls' })), !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 }) }), this.editable && 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) && h("h3", { class: "editable-label", slot: "start" }, 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` })), 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 }), 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 })), 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) => 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))) && h("span", { class: 'response' }, 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 })))));
|
|
5646
5662
|
}
|
|
5647
5663
|
else {
|
|
5648
5664
|
/** `markdown` types */
|
|
5649
|
-
if (((
|
|
5665
|
+
if (((_z = this.obj) === null || _z === void 0 ? void 0 : _z.style) === 'markdown') {
|
|
5650
5666
|
const converter = new showdown.Converter();
|
|
5651
|
-
return (((
|
|
5667
|
+
return (((_0 = this.obj) === null || _0 === void 0 ? void 0 : _0.value) || []).map(value => h("div", { innerHTML: converter.makeHtml(value) }));
|
|
5652
5668
|
}
|
|
5653
5669
|
/** `text` and `prayer` types */
|
|
5654
5670
|
else {
|
|
5655
|
-
return (h("div", { lang: ((
|
|
5671
|
+
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'}` }, ((((_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 }) }), compiledValue.map((prayer, prayerIndex) => {
|
|
5656
5672
|
var _a, _b, _c, _d;
|
|
5657
5673
|
return h("p", { class: "text-body", id: `${this.obj.uid || this.obj.slug}-prayerIndex` }, prayer === null || prayer === void 0 ? void 0 :
|
|
5658
5674
|
prayer.map((chunk, chunkIndex) => {
|