@venite/components 0.16.5 → 0.16.6
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-segment_16.cjs.entry.js +1 -2
- package/dist/cjs/ldf-day-name_5.cjs.entry.js +1 -2
- package/dist/cjs/ldf-editable-add-block-menu.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-filter-documents.cjs.entry.js +1 -1
- package/dist/cjs/ldf-editable-lookup_2.cjs.entry.js +2 -2
- package/dist/cjs/ldf-editable-metadata.cjs.entry.js +2 -2
- package/dist/cjs/{option-961df0f2.js → option-1ebd4514.js} +1 -1
- package/dist/cjs/{specific-class-94e41d45.js → specific-class-d80d272a.js} +1 -1
- package/dist/collection/components/option/dist/option.js +318 -0
- package/dist/collection/components/psalm/dist/psalm.js +0 -1
- package/dist/collection/components/psalm/psalm.js +0 -1
- package/dist/collection/components/string/dist/string.js +0 -1
- package/dist/collection/components/string/string.js +0 -1
- package/dist/collection/components/text/dist/text.js +1 -1
- package/dist/collection/components/text/text.js +1 -1
- package/dist/esm/ion-segment_16.entry.js +1 -2
- package/dist/esm/ldf-day-name_5.entry.js +1 -2
- package/dist/esm/ldf-editable-add-block-menu.entry.js +1 -1
- package/dist/esm/ldf-editable-filter-documents.entry.js +1 -1
- package/dist/esm/ldf-editable-lookup_2.entry.js +2 -2
- package/dist/esm/ldf-editable-metadata.entry.js +2 -2
- package/dist/esm/{option-b80b12c6.js → option-47d50244.js} +1 -1
- package/dist/esm/{specific-class-c2f505d5.js → specific-class-28e26e40.js} +1 -1
- package/dist/ldf/ldf.esm.js +1 -1
- package/dist/ldf/p-02ef484e.entry.js +1 -0
- package/dist/ldf/{p-0d44076e.entry.js → p-0651768a.entry.js} +1 -1
- package/dist/ldf/{p-4a60affd.entry.js → p-0f69db87.entry.js} +1 -1
- package/dist/ldf/{p-31d27100.js → p-53c807a4.js} +1 -1
- package/dist/ldf/{p-c77ce7bf.js → p-5bf20b51.js} +1 -1
- package/dist/ldf/{p-673e7c2c.entry.js → p-7df11f48.entry.js} +1 -1
- package/dist/ldf/{p-626a614d.entry.js → p-a98c89d1.entry.js} +1 -1
- package/dist/ldf/{p-3174f69c.entry.js → p-ca7e0de9.entry.js} +1 -1
- package/package.json +2 -2
- package/dist/ldf/p-b667a7c2.entry.js +0 -1
|
@@ -10,7 +10,7 @@ const overlays = require('./overlays-eb464d6d.js');
|
|
|
10
10
|
const index$1 = require('./index-5e2cc9e9.js');
|
|
11
11
|
const rubric = require('./rubric-662d8baa.js');
|
|
12
12
|
const heading$1 = require('./heading-d3809e59.js');
|
|
13
|
-
const option$1 = require('./option-
|
|
13
|
+
const option$1 = require('./option-1ebd4514.js');
|
|
14
14
|
const change = require('./change-cdb1e8c0.js');
|
|
15
15
|
const locale = require('./locale-d4e925b1.js');
|
|
16
16
|
const image = require('./image-f0ace076.js');
|
|
@@ -2217,7 +2217,6 @@ const PsalmComponent = class {
|
|
|
2217
2217
|
render() {
|
|
2218
2218
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2219
2219
|
const includeAntiphon = this.obj.includeAntiphon();
|
|
2220
|
-
console.log('includeAntiphon = ', includeAntiphon);
|
|
2221
2220
|
// create blank psalm verse pattern
|
|
2222
2221
|
let pattern, templateMaker = (verse) => ({ type: 'psalm-verse', number: '', halfverse: '', verse });
|
|
2223
2222
|
if (this.editable) {
|
|
@@ -479,7 +479,6 @@ const StringComponent = class {
|
|
|
479
479
|
let final = processed;
|
|
480
480
|
if (firstChunk) {
|
|
481
481
|
const splitTest = (firstChunk || '').split(/[\s.!?\\]/);
|
|
482
|
-
console.log('firstChunk = ', firstChunk);
|
|
483
482
|
const firstWord = splitTest ? splitTest[0] : '', re = firstWord.length > 2
|
|
484
483
|
? /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*)/
|
|
485
484
|
: /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*[\s.!?]*[\w\u0590-\u05ff\u0370-\u03ff]*)/, reIncludingPunctuation = ((_a = firstWord[0]) === null || _a === void 0 ? void 0 : _a.match(/[\"\'“”‘’\!\?\[\]\(\)]/))
|
|
@@ -5639,7 +5638,7 @@ const TextComponent = class {
|
|
|
5639
5638
|
? (((_d = this.obj) === null || _d === void 0 ? void 0 : _d.value) || []).map(s => s.replace(/\s+/g, ' '))
|
|
5640
5639
|
: (((_e = this.obj) === null || _e === void 0 ? void 0 : _e.value) || []);
|
|
5641
5640
|
let compiledValue = value.map(s => {
|
|
5642
|
-
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)
|
|
5641
|
+
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
5643
5642
|
});
|
|
5644
5643
|
if (!this.editable && ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.display_format) === 'abbreviated') {
|
|
5645
5644
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
@@ -7,7 +7,7 @@ const index$1 = require('./index-5e2cc9e9.js');
|
|
|
7
7
|
const rubric$1 = require('./rubric-662d8baa.js');
|
|
8
8
|
const heading$1 = require('./heading-d3809e59.js');
|
|
9
9
|
const image$1 = require('./image-f0ace076.js');
|
|
10
|
-
const option$1 = require('./option-
|
|
10
|
+
const option$1 = require('./option-1ebd4514.js');
|
|
11
11
|
const refrain$1 = require('./refrain-a605892e.js');
|
|
12
12
|
const text$1 = require('./text-c5e8ca0a.js');
|
|
13
13
|
const locale = require('./locale-d4e925b1.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-8fe0df8d.js');
|
|
6
6
|
const index = require('./index-5e2cc9e9.js');
|
|
7
|
-
const option = require('./option-
|
|
7
|
+
const option = require('./option-1ebd4514.js');
|
|
8
8
|
const locale = require('./locale-d4e925b1.js');
|
|
9
9
|
require('./_commonjsHelpers-bcc1208a.js');
|
|
10
10
|
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
6
|
const index$1 = require('./index-5e2cc9e9.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
|
-
const option = require('./option-
|
|
9
|
-
const specificClass = require('./specific-class-
|
|
8
|
+
const option = require('./option-1ebd4514.js');
|
|
9
|
+
const specificClass = require('./specific-class-d80d272a.js');
|
|
10
10
|
const locale = require('./locale-d4e925b1.js');
|
|
11
11
|
require('./_commonjsHelpers-bcc1208a.js');
|
|
12
12
|
require('./rubric-662d8baa.js');
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-8fe0df8d.js');
|
|
6
6
|
const index$1 = require('./index-5e2cc9e9.js');
|
|
7
7
|
const change = require('./change-cdb1e8c0.js');
|
|
8
|
-
const specificClass = require('./specific-class-
|
|
8
|
+
const specificClass = require('./specific-class-d80d272a.js');
|
|
9
9
|
const locale = require('./locale-d4e925b1.js');
|
|
10
10
|
require('./_commonjsHelpers-bcc1208a.js');
|
|
11
11
|
require('./rubric-662d8baa.js');
|
|
12
12
|
require('./heading-d3809e59.js');
|
|
13
|
-
require('./option-
|
|
13
|
+
require('./option-1ebd4514.js');
|
|
14
14
|
require('./refrain-a605892e.js');
|
|
15
15
|
require('./text-c5e8ca0a.js');
|
|
16
16
|
|
|
@@ -91,7 +91,7 @@ class Option extends index.LiturgicalDocument {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
// Readings with same citation + different versions => Version
|
|
94
|
-
else if (uniqueCitations == 1) {
|
|
94
|
+
else if (option.type == 'bible-reading' && uniqueCitations == 1) {
|
|
95
95
|
label = versionToString(option.version);
|
|
96
96
|
}
|
|
97
97
|
// Readings with one version => John 1:1-4
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const rubric = require('./rubric-662d8baa.js');
|
|
4
4
|
const heading = require('./heading-d3809e59.js');
|
|
5
|
-
const option = require('./option-
|
|
5
|
+
const option = require('./option-1ebd4514.js');
|
|
6
6
|
const refrain = require('./refrain-a605892e.js');
|
|
7
7
|
const text = require('./text-c5e8ca0a.js');
|
|
8
8
|
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
+
};
|
|
19
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
29
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
30
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
31
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
32
|
+
function step(op) {
|
|
33
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
34
|
+
while (_) try {
|
|
35
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
36
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
37
|
+
switch (op[0]) {
|
|
38
|
+
case 0: case 1: t = op; break;
|
|
39
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
40
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
41
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
42
|
+
default:
|
|
43
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
44
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
45
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
46
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
47
|
+
if (t[2]) _.ops.pop();
|
|
48
|
+
_.trys.pop(); continue;
|
|
49
|
+
}
|
|
50
|
+
op = body.call(thisArg, _);
|
|
51
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
52
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.__esModule = true;
|
|
56
|
+
exports.OptionComponent = void 0;
|
|
57
|
+
var core_1 = require("@stencil/core");
|
|
58
|
+
var ldf_1 = require("@venite/ldf");
|
|
59
|
+
var locale_1 = require("../../utils/locale");
|
|
60
|
+
var option_i18n_en_json_1 = require("./option.i18n.en.json");
|
|
61
|
+
var LOCALE = {
|
|
62
|
+
'en': option_i18n_en_json_1["default"]
|
|
63
|
+
};
|
|
64
|
+
var OptionComponent = /** @class */ (function () {
|
|
65
|
+
function OptionComponent() {
|
|
66
|
+
}
|
|
67
|
+
OptionComponent.prototype.docChanged = function (newDoc) {
|
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
69
|
+
try {
|
|
70
|
+
if (typeof newDoc == 'string') {
|
|
71
|
+
this.obj = new ldf_1.Option(JSON.parse(newDoc));
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.obj = new ldf_1.Option(newDoc);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
console.warn(e);
|
|
79
|
+
this.obj = new ldf_1.Option();
|
|
80
|
+
}
|
|
81
|
+
var selected = this.editable
|
|
82
|
+
? (_f = (_c = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.editor_selected) !== null && _c !== void 0 ? _c : (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.selected) !== null && _f !== void 0 ? _f : 0 : (_j = (_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.selected) !== null && _j !== void 0 ? _j : 0;
|
|
83
|
+
this.select(selected);
|
|
84
|
+
if (!((_k = this.obj) === null || _k === void 0 ? void 0 : _k.value) || !this.obj.value[selected] || !this.obj.value[selected].value) {
|
|
85
|
+
this.selectFirstDefined();
|
|
86
|
+
}
|
|
87
|
+
this.filterOptions();
|
|
88
|
+
};
|
|
89
|
+
// Lifecycle events
|
|
90
|
+
OptionComponent.prototype.componentWillLoad = function () {
|
|
91
|
+
this.docChanged(this.doc);
|
|
92
|
+
this.loadLocaleStrings();
|
|
93
|
+
this.ldfOptionAskForStoredSelection.emit({ el: this.el });
|
|
94
|
+
};
|
|
95
|
+
/** Asynchronously load localization strings */
|
|
96
|
+
OptionComponent.prototype.loadLocaleStrings = function () {
|
|
97
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
try {
|
|
100
|
+
this.localeStrings = LOCALE[locale_1.getComponentClosestLanguage(this.el)];
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
console.warn(e);
|
|
104
|
+
}
|
|
105
|
+
return [2 /*return*/];
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
/** Display the nth option */
|
|
110
|
+
OptionComponent.prototype.select = function (index, resultedFromUserAction) {
|
|
111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
112
|
+
if (resultedFromUserAction === void 0) { resultedFromUserAction = false; }
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var hadMetadata, oldValue;
|
|
115
|
+
return __generator(this, function (_j) {
|
|
116
|
+
if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.slug) && typeof index === 'number' && resultedFromUserAction) {
|
|
117
|
+
this.ldfOptionMakeSelection.emit({ slug: (_b = this.obj) === null || _b === void 0 ? void 0 : _b.slug, index: index });
|
|
118
|
+
}
|
|
119
|
+
hadMetadata = Boolean((_c = this.obj) === null || _c === void 0 ? void 0 : _c.metadata), oldValue = (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.editor_selected;
|
|
120
|
+
if (Number(index) >= 0) {
|
|
121
|
+
//this.selectedDoc = this.obj.value.filter(child => Boolean(child))[index];
|
|
122
|
+
if ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.metadata) {
|
|
123
|
+
this.obj.metadata.selected = Number(index);
|
|
124
|
+
this.obj.metadata.editor_selected = Number(index);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.obj.metadata = { selected: Number(index), editor_selected: Number(index) };
|
|
128
|
+
}
|
|
129
|
+
this.obj = new ldf_1.Option(__assign({}, this.obj));
|
|
130
|
+
// only change the selection at this point if it's not editable
|
|
131
|
+
// if it's editable, the editor will control when it changes
|
|
132
|
+
if (resultedFromUserAction && !this.editable) {
|
|
133
|
+
this.ldfDocShouldChange.emit(new ldf_1.Change({
|
|
134
|
+
path: this.path + "/metadata",
|
|
135
|
+
op: [{
|
|
136
|
+
type: 'set',
|
|
137
|
+
index: 'selected',
|
|
138
|
+
oldValue: oldValue,
|
|
139
|
+
value: Number(index)
|
|
140
|
+
}]
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
if (this.editable) {
|
|
144
|
+
if (hadMetadata && index !== oldValue) {
|
|
145
|
+
this.ldfDocShouldChange.emit(new ldf_1.Change({
|
|
146
|
+
path: this.path + "/metadata",
|
|
147
|
+
op: [{
|
|
148
|
+
type: 'set',
|
|
149
|
+
index: 'editor_selected',
|
|
150
|
+
oldValue: oldValue,
|
|
151
|
+
value: Number(index)
|
|
152
|
+
}]
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
else if (!hadMetadata && index !== oldValue) {
|
|
156
|
+
this.ldfDocShouldChange.emit(new ldf_1.Change({
|
|
157
|
+
path: "" + this.path,
|
|
158
|
+
op: [{
|
|
159
|
+
type: 'set',
|
|
160
|
+
index: 'metadata',
|
|
161
|
+
value: { editor_selected: Number(index) }
|
|
162
|
+
}]
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// sets metadata.selected to new index, and creates objects along the way if undefined
|
|
167
|
+
// without overriding any other metadata fields
|
|
168
|
+
Object.assign(this.obj, { metadata: __assign(__assign({}, this.obj.metadata), { selected: index }) });
|
|
169
|
+
Object.assign(this.obj, { metadata: __assign(__assign({}, this.obj.metadata), { editor_selected: index }) });
|
|
170
|
+
}
|
|
171
|
+
else if (index === 'add') {
|
|
172
|
+
this.ldfAddOptionToDoc.emit({
|
|
173
|
+
base: this.path,
|
|
174
|
+
index: (_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.length,
|
|
175
|
+
obj: this.obj
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return [2 /*return*/];
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
// Private methods
|
|
183
|
+
OptionComponent.prototype.onSelectChange = function (ev) {
|
|
184
|
+
var target = ev.target, value = parseInt(target.value);
|
|
185
|
+
this.select(value, true);
|
|
186
|
+
};
|
|
187
|
+
OptionComponent.prototype.selectFirstDefined = function () {
|
|
188
|
+
var first = this.obj.value.find(function (opt) { return (opt === null || opt === void 0 ? void 0 : opt.value) !== undefined; }), index = this.obj.value.filter(function (child) { return Boolean(child); }).indexOf(first);
|
|
189
|
+
this.select(index);
|
|
190
|
+
};
|
|
191
|
+
OptionComponent.prototype.filterOptions = function () {
|
|
192
|
+
var _this = this;
|
|
193
|
+
var _a;
|
|
194
|
+
if (this.obj) {
|
|
195
|
+
this.obj = new ldf_1.Option(__assign(__assign({}, this.obj), { value: (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.value) || []).filter(function (entry) {
|
|
196
|
+
return _this.editable || (Boolean(entry) && (Boolean(entry.value) || Boolean((entry === null || entry === void 0 ? void 0 : entry.type) === "bible-reading" && entry.citation)));
|
|
197
|
+
}) }));
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
// Render helpers
|
|
201
|
+
/** Return an Ionic Select or Segment element if available, otherwise a vanilla HTML Select Element */
|
|
202
|
+
OptionComponent.prototype.selectNode = function () {
|
|
203
|
+
var _this = this;
|
|
204
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
205
|
+
var currentlySelected = this.editable ? (_f = (_c = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.editor_selected) !== null && _c !== void 0 ? _c : (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.selected) !== null && _f !== void 0 ? _f : 0 : (_j = (_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.selected) !== null && _j !== void 0 ? _j : 0;
|
|
206
|
+
if (((_l = (_k = this.obj) === null || _k === void 0 ? void 0 : _k.value) === null || _l === void 0 ? void 0 : _l.length) > 1 || this.editable) {
|
|
207
|
+
// Ionic available and
|
|
208
|
+
if (customElements && !!customElements.get('ion-select')) {
|
|
209
|
+
var optionsAreLong = (((_m = this.obj) === null || _m === void 0 ? void 0 : _m.value) || [])
|
|
210
|
+
.map(function (option, optionIndex) { var _a; return ((_a = _this.versionLabel(option, optionIndex)) === null || _a === void 0 ? void 0 : _a.length) > 20; })
|
|
211
|
+
.reduce(function (a, b) { return a || b; }, false);
|
|
212
|
+
// <= 3, short options
|
|
213
|
+
if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <= 3) {
|
|
214
|
+
return (React.createElement("ion-segment", { color: "primary", value: currentlySelected.toString() }, (_p = this.obj) === null || _p === void 0 ? void 0 :
|
|
215
|
+
_p.value.map(function (option, optionIndex) {
|
|
216
|
+
return React.createElement("ion-segment-button", { value: optionIndex.toString(), onClick: function () { return _this.select(optionIndex, true); } },
|
|
217
|
+
React.createElement("ion-label", null, _this.versionLabel(option, optionIndex)));
|
|
218
|
+
}),
|
|
219
|
+
this.editable && React.createElement("ion-segment-button", { value: 'add', "class": 'add', onClick: function () { return _this.select('add', true); } },
|
|
220
|
+
React.createElement("ion-label", null, "+"))));
|
|
221
|
+
}
|
|
222
|
+
// >2 options, or options are longish
|
|
223
|
+
else {
|
|
224
|
+
console.log('>2 or longish');
|
|
225
|
+
return (React.createElement("ion-toolbar", null,
|
|
226
|
+
React.createElement("ion-select", { value: currentlySelected, slot: this.editable ? 'start' : 'end', onIonChange: function (e) { return _this.select(Number(e.detail.value), true); } }, (_q = this.obj) === null || _q === void 0 ? void 0 : _q.value.map(function (option, optionIndex) {
|
|
227
|
+
return React.createElement("ion-select-option", { value: optionIndex },
|
|
228
|
+
React.createElement("ion-label", null, _this.versionLabel(option, optionIndex)));
|
|
229
|
+
})),
|
|
230
|
+
this.editable && React.createElement("ion-buttons", { slot: 'end' },
|
|
231
|
+
React.createElement("ion-button", { onClick: function () { return _this.select('add', true); } },
|
|
232
|
+
React.createElement("ion-icon", { slot: 'icon-only', name: 'add' })))));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// Ionic not availabe
|
|
236
|
+
else {
|
|
237
|
+
return (React.createElement("ldf-label-bar", null,
|
|
238
|
+
React.createElement("select", { onInput: function (ev) { return _this.onSelectChange(ev); }, slot: this.editable ? 'start' : 'end' }, (_r = this.obj) === null || _r === void 0 ? void 0 : _r.value.map(function (option, optionIndex) {
|
|
239
|
+
return React.createElement("option", { value: optionIndex, selected: optionIndex == currentlySelected }, _this.versionLabel(option, optionIndex));
|
|
240
|
+
})),
|
|
241
|
+
this.editable && React.createElement("button", { slot: 'end', onClick: function () { return _this.select('add', true); } }, "+")));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
OptionComponent.prototype.versionLabel = function (option, index) {
|
|
249
|
+
try {
|
|
250
|
+
return this.obj.getVersionLabel(option);
|
|
251
|
+
}
|
|
252
|
+
catch (e) {
|
|
253
|
+
console.warn(e);
|
|
254
|
+
return (this.localeStrings || {}).option + " " + (index + 1);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
// Render
|
|
258
|
+
OptionComponent.prototype.render = function () {
|
|
259
|
+
var _a;
|
|
260
|
+
//console.log('ldf-option (render) ', this.obj?.metadata.selected, this.obj.value, this.selectedDoc)
|
|
261
|
+
var selectedIndex = this.editable ? (_a = this.obj.metadata.editor_selected) !== null && _a !== void 0 ? _a : this.obj.metadata.selected : this.obj.metadata.selected;
|
|
262
|
+
return (React.createElement(core_1.Host, { lang: this.obj.language },
|
|
263
|
+
React.createElement("div", { "class": 'select-control' },
|
|
264
|
+
React.createElement("ldf-label-bar", null, this.selectNode())),
|
|
265
|
+
(this.obj.value || this.editable) && React.createElement("ldf-liturgical-document", { doc: this.obj.value[selectedIndex], path: this.path + "/value/" + this.obj.metadata.selected, base: this.path + "/value", index: selectedIndex, editable: this.editable, parentType: 'option' })));
|
|
266
|
+
};
|
|
267
|
+
__decorate([
|
|
268
|
+
core_1.Element()
|
|
269
|
+
], OptionComponent.prototype, "el");
|
|
270
|
+
__decorate([
|
|
271
|
+
core_1.State()
|
|
272
|
+
], OptionComponent.prototype, "obj");
|
|
273
|
+
__decorate([
|
|
274
|
+
core_1.State()
|
|
275
|
+
], OptionComponent.prototype, "localeStrings");
|
|
276
|
+
__decorate([
|
|
277
|
+
core_1.State()
|
|
278
|
+
], OptionComponent.prototype, "filteredOptions");
|
|
279
|
+
__decorate([
|
|
280
|
+
core_1.Prop()
|
|
281
|
+
], OptionComponent.prototype, "doc");
|
|
282
|
+
__decorate([
|
|
283
|
+
core_1.Watch('doc')
|
|
284
|
+
], OptionComponent.prototype, "docChanged");
|
|
285
|
+
__decorate([
|
|
286
|
+
core_1.Prop({ reflect: true })
|
|
287
|
+
], OptionComponent.prototype, "path");
|
|
288
|
+
__decorate([
|
|
289
|
+
core_1.Prop()
|
|
290
|
+
], OptionComponent.prototype, "editable");
|
|
291
|
+
__decorate([
|
|
292
|
+
core_1.Prop()
|
|
293
|
+
], OptionComponent.prototype, "preview");
|
|
294
|
+
__decorate([
|
|
295
|
+
core_1.Event({ bubbles: true })
|
|
296
|
+
], OptionComponent.prototype, "ldfAddOptionToDoc");
|
|
297
|
+
__decorate([
|
|
298
|
+
core_1.Event({ bubbles: true })
|
|
299
|
+
], OptionComponent.prototype, "ldfDocShouldChange");
|
|
300
|
+
__decorate([
|
|
301
|
+
core_1.Event({ bubbles: true })
|
|
302
|
+
], OptionComponent.prototype, "ldfOptionAskForStoredSelection");
|
|
303
|
+
__decorate([
|
|
304
|
+
core_1.Event({ bubbles: true })
|
|
305
|
+
], OptionComponent.prototype, "ldfOptionMakeSelection");
|
|
306
|
+
__decorate([
|
|
307
|
+
core_1.Method()
|
|
308
|
+
], OptionComponent.prototype, "select");
|
|
309
|
+
OptionComponent = __decorate([
|
|
310
|
+
core_1.Component({
|
|
311
|
+
tag: 'ldf-option',
|
|
312
|
+
styleUrl: 'option.scss',
|
|
313
|
+
scoped: true
|
|
314
|
+
})
|
|
315
|
+
], OptionComponent);
|
|
316
|
+
return OptionComponent;
|
|
317
|
+
}());
|
|
318
|
+
exports.OptionComponent = OptionComponent;
|
|
@@ -258,7 +258,6 @@ var PsalmComponent = /** @class */ (function () {
|
|
|
258
258
|
var _this = this;
|
|
259
259
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
260
260
|
var includeAntiphon = this.obj.includeAntiphon();
|
|
261
|
-
console.log('includeAntiphon = ', includeAntiphon);
|
|
262
261
|
// create blank psalm verse pattern
|
|
263
262
|
var pattern, templateMaker = function (verse) { return ({ type: 'psalm-verse', number: '', halfverse: '', verse: verse }); };
|
|
264
263
|
if (this.editable) {
|
|
@@ -167,7 +167,6 @@ export class PsalmComponent {
|
|
|
167
167
|
render() {
|
|
168
168
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
169
169
|
const includeAntiphon = this.obj.includeAntiphon();
|
|
170
|
-
console.log('includeAntiphon = ', includeAntiphon);
|
|
171
170
|
// create blank psalm verse pattern
|
|
172
171
|
let pattern, templateMaker = (verse) => ({ type: 'psalm-verse', number: '', halfverse: '', verse });
|
|
173
172
|
if (this.editable) {
|
|
@@ -127,7 +127,6 @@ var StringComponent = /** @class */ (function () {
|
|
|
127
127
|
var final = processed;
|
|
128
128
|
if (firstChunk) {
|
|
129
129
|
var splitTest = (firstChunk || '').split(/[\s.!?\\]/);
|
|
130
|
-
console.log('firstChunk = ', firstChunk);
|
|
131
130
|
var firstWord = splitTest ? splitTest[0] : '', re = firstWord.length > 2
|
|
132
131
|
? /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*)/
|
|
133
132
|
: /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*[\s.!?]*[\w\u0590-\u05ff\u0370-\u03ff]*)/, reIncludingPunctuation = ((_a = firstWord[0]) === null || _a === void 0 ? void 0 : _a.match(/[\"\'“”‘’\!\?\[\]\(\)]/)) ? /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff]{2})\s*([\w\u0590-\u05ff\u0370-\u03ff]*)/
|
|
@@ -116,7 +116,6 @@ export class StringComponent {
|
|
|
116
116
|
let final = processed;
|
|
117
117
|
if (firstChunk) {
|
|
118
118
|
const splitTest = (firstChunk || '').split(/[\s.!?\\]/);
|
|
119
|
-
console.log('firstChunk = ', firstChunk);
|
|
120
119
|
const firstWord = splitTest ? splitTest[0] : '', re = firstWord.length > 2
|
|
121
120
|
? /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*)/
|
|
122
121
|
: /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*[\s.!?]*[\w\u0590-\u05ff\u0370-\u03ff]*)/, reIncludingPunctuation = ((_a = firstWord[0]) === null || _a === void 0 ? void 0 : _a.match(/[\"\'“”‘’\!\?\[\]\(\)]/))
|
|
@@ -145,7 +145,7 @@ var TextComponent = /** @class */ (function () {
|
|
|
145
145
|
var value = ((_c = (_b = this.obj) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.rollup) ? (((_d = this.obj) === null || _d === void 0 ? void 0 : _d.value) || []).map(function (s) { return s.replace(/\s+/g, ' '); })
|
|
146
146
|
: (((_e = this.obj) === null || _e === void 0 ? void 0 : _e.value) || []);
|
|
147
147
|
var compiledValue_1 = value.map(function (s) {
|
|
148
|
-
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)
|
|
148
|
+
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
149
149
|
});
|
|
150
150
|
if (!this.editable && ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.display_format) === 'abbreviated') {
|
|
151
151
|
var firstSection = compiledValue_1[0], lastSection = compiledValue_1[compiledValue_1.length - 1];
|
|
@@ -74,7 +74,7 @@ export class TextComponent {
|
|
|
74
74
|
? (((_d = this.obj) === null || _d === void 0 ? void 0 : _d.value) || []).map(s => s.replace(/\s+/g, ' '))
|
|
75
75
|
: (((_e = this.obj) === null || _e === void 0 ? void 0 : _e.value) || []);
|
|
76
76
|
let compiledValue = value.map(s => {
|
|
77
|
-
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)
|
|
77
|
+
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
78
78
|
});
|
|
79
79
|
if (!this.editable && ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.display_format) === 'abbreviated') {
|
|
80
80
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
@@ -6,7 +6,7 @@ import { f as alertController, l as loadingController, m as modalController, t a
|
|
|
6
6
|
import { R as Responsive, L as LiturgicalDocument, d as dateFromYMDString } from './index-f5b9b789.js';
|
|
7
7
|
import { B as BibleReading, L as Liturgy, M as Meditation, P as Psalm, R as ResponsivePrayer, a as Rubric } from './rubric-2330a030.js';
|
|
8
8
|
import { H as Heading } from './heading-c9eb7d89.js';
|
|
9
|
-
import { v as versionToString, O as Option } from './option-
|
|
9
|
+
import { v as versionToString, O as Option } from './option-47d50244.js';
|
|
10
10
|
import { C as Change } from './change-ea574d32.js';
|
|
11
11
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
12
12
|
import { I as Image } from './image-f0e35b01.js';
|
|
@@ -2213,7 +2213,6 @@ const PsalmComponent = class {
|
|
|
2213
2213
|
render() {
|
|
2214
2214
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2215
2215
|
const includeAntiphon = this.obj.includeAntiphon();
|
|
2216
|
-
console.log('includeAntiphon = ', includeAntiphon);
|
|
2217
2216
|
// create blank psalm verse pattern
|
|
2218
2217
|
let pattern, templateMaker = (verse) => ({ type: 'psalm-verse', number: '', halfverse: '', verse });
|
|
2219
2218
|
if (this.editable) {
|
|
@@ -475,7 +475,6 @@ const StringComponent = class {
|
|
|
475
475
|
let final = processed;
|
|
476
476
|
if (firstChunk) {
|
|
477
477
|
const splitTest = (firstChunk || '').split(/[\s.!?\\]/);
|
|
478
|
-
console.log('firstChunk = ', firstChunk);
|
|
479
478
|
const firstWord = splitTest ? splitTest[0] : '', re = firstWord.length > 2
|
|
480
479
|
? /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*)/
|
|
481
480
|
: /^ ?([\"\'“”‘’\!\?\[\]\(\)\w\u0590-\u05ff\u0370-\u03ff])([\w\u0590-\u05ff\u0370-\u03ff]*[\s.!?]*[\w\u0590-\u05ff\u0370-\u03ff]*)/, reIncludingPunctuation = ((_a = firstWord[0]) === null || _a === void 0 ? void 0 : _a.match(/[\"\'“”‘’\!\?\[\]\(\)]/))
|
|
@@ -5635,7 +5634,7 @@ const TextComponent = class {
|
|
|
5635
5634
|
? (((_d = this.obj) === null || _d === void 0 ? void 0 : _d.value) || []).map(s => s.replace(/\s+/g, ' '))
|
|
5636
5635
|
: (((_e = this.obj) === null || _e === void 0 ? void 0 : _e.value) || []);
|
|
5637
5636
|
let compiledValue = value.map(s => {
|
|
5638
|
-
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)
|
|
5637
|
+
return s.split(/([\*\w\n\s,:;\.\-–—'“✠”‘’\!\?”\[\]\%\(\)\/\u0041-\u024F]+([^\*\w\n\s,;:\.'“”✠‘’”\-–—\!\?\[\]\%\(\)\/\u0041-\u024F]))/g);
|
|
5639
5638
|
});
|
|
5640
5639
|
if (!this.editable && ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.display_format) === 'abbreviated') {
|
|
5641
5640
|
const firstSection = compiledValue[0], lastSection = compiledValue[compiledValue.length - 1];
|
|
@@ -3,7 +3,7 @@ import { L as LiturgicalDocument } from './index-f5b9b789.js';
|
|
|
3
3
|
import { B as BibleReading, P as Psalm, L as Liturgy$1, M as Meditation, R as ResponsivePrayer, a as Rubric } from './rubric-2330a030.js';
|
|
4
4
|
import { H as Heading } from './heading-c9eb7d89.js';
|
|
5
5
|
import { I as Image } from './image-f0e35b01.js';
|
|
6
|
-
import { O as Option } from './option-
|
|
6
|
+
import { O as Option } from './option-47d50244.js';
|
|
7
7
|
import { R as Refrain } from './refrain-810c4de5.js';
|
|
8
8
|
import { T as Text } from './text-ce1ed17d.js';
|
|
9
9
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
@@ -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
2
|
import { L as LiturgicalDocument } from './index-f5b9b789.js';
|
|
3
|
-
import { v as versionToString, O as Option } from './option-
|
|
3
|
+
import { v as versionToString, O as Option } from './option-47d50244.js';
|
|
4
4
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
5
5
|
import './_commonjsHelpers-ba3f0406.js';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
2
|
import { L as LiturgicalDocument } from './index-f5b9b789.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-47d50244.js';
|
|
5
|
+
import { s as specificClass } from './specific-class-28e26e40.js';
|
|
6
6
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
7
7
|
import './_commonjsHelpers-ba3f0406.js';
|
|
8
8
|
import './rubric-2330a030.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-f0f6a379.js';
|
|
2
2
|
import { L as LiturgicalDocument } from './index-f5b9b789.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-28e26e40.js';
|
|
5
5
|
import { g as getComponentClosestLanguage } from './locale-ec8e14e6.js';
|
|
6
6
|
import './_commonjsHelpers-ba3f0406.js';
|
|
7
7
|
import './rubric-2330a030.js';
|
|
8
8
|
import './heading-c9eb7d89.js';
|
|
9
|
-
import './option-
|
|
9
|
+
import './option-47d50244.js';
|
|
10
10
|
import './refrain-810c4de5.js';
|
|
11
11
|
import './text-ce1ed17d.js';
|
|
12
12
|
|
|
@@ -89,7 +89,7 @@ class Option extends LiturgicalDocument {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
// Readings with same citation + different versions => Version
|
|
92
|
-
else if (uniqueCitations == 1) {
|
|
92
|
+
else if (option.type == 'bible-reading' && uniqueCitations == 1) {
|
|
93
93
|
label = versionToString(option.version);
|
|
94
94
|
}
|
|
95
95
|
// Readings with one version => John 1:1-4
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as Meditation, P as Psalm, B as BibleReading, R as ResponsivePrayer, a as Rubric, L as Liturgy } from './rubric-2330a030.js';
|
|
2
2
|
import { H as Heading } from './heading-c9eb7d89.js';
|
|
3
|
-
import { O as Option } from './option-
|
|
3
|
+
import { O as Option } from './option-47d50244.js';
|
|
4
4
|
import { R as Refrain } from './refrain-810c4de5.js';
|
|
5
5
|
import { T as Text } from './text-ce1ed17d.js';
|
|
6
6
|
|