@simai-studio/mail 0.0.0-stage → 1.0.1
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/LICENSE.md +188 -0
- package/README.md +79 -2
- package/dist/package-receipt.json +1176 -0
- package/dist/set.json +97 -0
- package/dist/smart/mail-canvas/component.json +562 -0
- package/dist/smart/mail-canvas/component.json.gz +0 -0
- package/dist/smart/mail-canvas/css/mail-canvas.css +85 -0
- package/dist/smart/mail-canvas/css/mail-canvas.css.gz +0 -0
- package/dist/smart/mail-canvas/css/mail-canvas.min.css +2 -0
- package/dist/smart/mail-canvas/css/mail-canvas.min.css.gz +0 -0
- package/dist/smart/mail-canvas/examples.json +731 -0
- package/dist/smart/mail-canvas/examples.json.gz +0 -0
- package/dist/smart/mail-canvas/js/mail-canvas.js +1039 -0
- package/dist/smart/mail-canvas/js/mail-canvas.js.gz +0 -0
- package/dist/smart/mail-canvas/js/mail-canvas.min.js +22 -0
- package/dist/smart/mail-canvas/js/mail-canvas.min.js.gz +0 -0
- package/dist/smart/mail-canvas/lang/en.json +25 -0
- package/dist/smart/mail-canvas/lang/en.json.gz +0 -0
- package/dist/smart/mail-canvas/lang/ru.json +25 -0
- package/dist/smart/mail-canvas/lang/ru.json.gz +0 -0
- package/dist/smart/mail-canvas/probe.json +465 -0
- package/dist/smart/mail-canvas/probe.json.gz +0 -0
- package/dist/smart/mail-canvas/smart.manifest.json +550 -0
- package/dist/smart/mail-canvas/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-canvas/static/default/notes.html +43 -0
- package/dist/smart/mail-canvas/static/default/notes.html.gz +0 -0
- package/dist/smart/mail-canvas/static/default/phone.html +43 -0
- package/dist/smart/mail-canvas/static/default/phone.html.gz +0 -0
- package/dist/smart/mail-canvas/static/default/reference.html +48 -0
- package/dist/smart/mail-canvas/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-canvas/static/sheets.json +132 -0
- package/dist/smart/mail-canvas/static/sheets.json.gz +0 -0
- package/dist/smart/mail-canvas/studio.fixture.json +63 -0
- package/dist/smart/mail-canvas/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-canvas/studio.scenario.json +39 -0
- package/dist/smart/mail-canvas/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-canvas/template/default.css +73 -0
- package/dist/smart/mail-canvas/template/default.css.gz +0 -0
- package/dist/smart/mail-canvas/template/default.js +38 -0
- package/dist/smart/mail-canvas/template/default.js.gz +0 -0
- package/dist/smart/mail-inspector/component.json +768 -0
- package/dist/smart/mail-inspector/component.json.gz +0 -0
- package/dist/smart/mail-inspector/css/mail-inspector.css +194 -0
- package/dist/smart/mail-inspector/css/mail-inspector.css.gz +0 -0
- package/dist/smart/mail-inspector/css/mail-inspector.min.css +2 -0
- package/dist/smart/mail-inspector/css/mail-inspector.min.css.gz +0 -0
- package/dist/smart/mail-inspector/examples.json +1301 -0
- package/dist/smart/mail-inspector/examples.json.gz +0 -0
- package/dist/smart/mail-inspector/js/mail-inspector.js +1619 -0
- package/dist/smart/mail-inspector/js/mail-inspector.js.gz +0 -0
- package/dist/smart/mail-inspector/js/mail-inspector.min.js +103 -0
- package/dist/smart/mail-inspector/js/mail-inspector.min.js.gz +0 -0
- package/dist/smart/mail-inspector/lang/en.json +29 -0
- package/dist/smart/mail-inspector/lang/en.json.gz +0 -0
- package/dist/smart/mail-inspector/lang/ru.json +29 -0
- package/dist/smart/mail-inspector/lang/ru.json.gz +0 -0
- package/dist/smart/mail-inspector/probe.json +648 -0
- package/dist/smart/mail-inspector/probe.json.gz +0 -0
- package/dist/smart/mail-inspector/smart.manifest.json +920 -0
- package/dist/smart/mail-inspector/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-inspector/static/default/item.html +189 -0
- package/dist/smart/mail-inspector/static/default/item.html.gz +0 -0
- package/dist/smart/mail-inspector/static/default/letter.html +247 -0
- package/dist/smart/mail-inspector/static/default/letter.html.gz +0 -0
- package/dist/smart/mail-inspector/static/default/reference.html +545 -0
- package/dist/smart/mail-inspector/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-inspector/static/sheets.json +226 -0
- package/dist/smart/mail-inspector/static/sheets.json.gz +0 -0
- package/dist/smart/mail-inspector/studio.fixture.json +232 -0
- package/dist/smart/mail-inspector/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-inspector/studio.scenario.json +43 -0
- package/dist/smart/mail-inspector/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-inspector/template/default.css +190 -0
- package/dist/smart/mail-inspector/template/default.css.gz +0 -0
- package/dist/smart/mail-inspector/template/default.js +249 -0
- package/dist/smart/mail-inspector/template/default.js.gz +0 -0
- package/dist/smart/mail-letters/component.json +455 -0
- package/dist/smart/mail-letters/component.json.gz +0 -0
- package/dist/smart/mail-letters/css/mail-letters.css +72 -0
- package/dist/smart/mail-letters/css/mail-letters.css.gz +0 -0
- package/dist/smart/mail-letters/css/mail-letters.min.css +2 -0
- package/dist/smart/mail-letters/css/mail-letters.min.css.gz +0 -0
- package/dist/smart/mail-letters/examples.json +477 -0
- package/dist/smart/mail-letters/examples.json.gz +0 -0
- package/dist/smart/mail-letters/js/mail-letters.js +1772 -0
- package/dist/smart/mail-letters/js/mail-letters.js.gz +0 -0
- package/dist/smart/mail-letters/js/mail-letters.min.js +35 -0
- package/dist/smart/mail-letters/js/mail-letters.min.js.gz +0 -0
- package/dist/smart/mail-letters/lang/en.json +29 -0
- package/dist/smart/mail-letters/lang/en.json.gz +0 -0
- package/dist/smart/mail-letters/lang/ru.json +31 -0
- package/dist/smart/mail-letters/lang/ru.json.gz +0 -0
- package/dist/smart/mail-letters/probe.json +290 -0
- package/dist/smart/mail-letters/probe.json.gz +0 -0
- package/dist/smart/mail-letters/smart.manifest.json +476 -0
- package/dist/smart/mail-letters/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-letters/static/default/by-title.html +177 -0
- package/dist/smart/mail-letters/static/default/by-title.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/empty.html +88 -0
- package/dist/smart/mail-letters/static/default/empty.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/nothing-found.html +88 -0
- package/dist/smart/mail-letters/static/default/nothing-found.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/reference.html +168 -0
- package/dist/smart/mail-letters/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-letters/static/sheets.json +245 -0
- package/dist/smart/mail-letters/static/sheets.json.gz +0 -0
- package/dist/smart/mail-letters/studio.fixture.json +41 -0
- package/dist/smart/mail-letters/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-letters/studio.scenario.json +41 -0
- package/dist/smart/mail-letters/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-letters/template/default.css +79 -0
- package/dist/smart/mail-letters/template/default.css.gz +0 -0
- package/dist/smart/mail-letters/template/default.js +61 -0
- package/dist/smart/mail-letters/template/default.js.gz +0 -0
- package/dist/smart/mail-library/component.json +512 -0
- package/dist/smart/mail-library/component.json.gz +0 -0
- package/dist/smart/mail-library/css/mail-library.css +149 -0
- package/dist/smart/mail-library/css/mail-library.css.gz +0 -0
- package/dist/smart/mail-library/css/mail-library.min.css +2 -0
- package/dist/smart/mail-library/css/mail-library.min.css.gz +0 -0
- package/dist/smart/mail-library/examples.json +616 -0
- package/dist/smart/mail-library/examples.json.gz +0 -0
- package/dist/smart/mail-library/js/mail-library.js +559 -0
- package/dist/smart/mail-library/js/mail-library.js.gz +0 -0
- package/dist/smart/mail-library/js/mail-library.min.js +52 -0
- package/dist/smart/mail-library/js/mail-library.min.js.gz +0 -0
- package/dist/smart/mail-library/lang/en.json +21 -0
- package/dist/smart/mail-library/lang/en.json.gz +0 -0
- package/dist/smart/mail-library/lang/ru.json +21 -0
- package/dist/smart/mail-library/lang/ru.json.gz +0 -0
- package/dist/smart/mail-library/probe.json +275 -0
- package/dist/smart/mail-library/probe.json.gz +0 -0
- package/dist/smart/mail-library/smart.manifest.json +512 -0
- package/dist/smart/mail-library/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-library/static/default/category.html +85 -0
- package/dist/smart/mail-library/static/default/category.html.gz +0 -0
- package/dist/smart/mail-library/static/default/nothing-found.html +81 -0
- package/dist/smart/mail-library/static/default/nothing-found.html.gz +0 -0
- package/dist/smart/mail-library/static/default/one-group.html +67 -0
- package/dist/smart/mail-library/static/default/one-group.html.gz +0 -0
- package/dist/smart/mail-library/static/default/reference.html +135 -0
- package/dist/smart/mail-library/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-library/static/sheets.json +180 -0
- package/dist/smart/mail-library/static/sheets.json.gz +0 -0
- package/dist/smart/mail-library/studio.fixture.json +75 -0
- package/dist/smart/mail-library/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-library/studio.scenario.json +41 -0
- package/dist/smart/mail-library/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-library/template/default.css +133 -0
- package/dist/smart/mail-library/template/default.css.gz +0 -0
- package/dist/smart/mail-library/template/default.js +83 -0
- package/dist/smart/mail-library/template/default.js.gz +0 -0
- package/dist/smart/mail-structure/component.json +497 -0
- package/dist/smart/mail-structure/component.json.gz +0 -0
- package/dist/smart/mail-structure/css/mail-structure.css +106 -0
- package/dist/smart/mail-structure/css/mail-structure.css.gz +0 -0
- package/dist/smart/mail-structure/css/mail-structure.min.css +2 -0
- package/dist/smart/mail-structure/css/mail-structure.min.css.gz +0 -0
- package/dist/smart/mail-structure/examples.json +286 -0
- package/dist/smart/mail-structure/examples.json.gz +0 -0
- package/dist/smart/mail-structure/js/mail-structure.js +767 -0
- package/dist/smart/mail-structure/js/mail-structure.js.gz +0 -0
- package/dist/smart/mail-structure/js/mail-structure.min.js +48 -0
- package/dist/smart/mail-structure/js/mail-structure.min.js.gz +0 -0
- package/dist/smart/mail-structure/lang/en.json +22 -0
- package/dist/smart/mail-structure/lang/en.json.gz +0 -0
- package/dist/smart/mail-structure/lang/ru.json +22 -0
- package/dist/smart/mail-structure/lang/ru.json.gz +0 -0
- package/dist/smart/mail-structure/probe.json +112 -0
- package/dist/smart/mail-structure/probe.json.gz +0 -0
- package/dist/smart/mail-structure/smart.manifest.json +495 -0
- package/dist/smart/mail-structure/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-structure/static/default/empty.html +76 -0
- package/dist/smart/mail-structure/static/default/empty.html.gz +0 -0
- package/dist/smart/mail-structure/static/default/reference.html +98 -0
- package/dist/smart/mail-structure/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-structure/static/default/settings.html +98 -0
- package/dist/smart/mail-structure/static/default/settings.html.gz +0 -0
- package/dist/smart/mail-structure/static/sheets.json +142 -0
- package/dist/smart/mail-structure/static/sheets.json.gz +0 -0
- package/dist/smart/mail-structure/studio.fixture.json +45 -0
- package/dist/smart/mail-structure/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-structure/studio.scenario.json +42 -0
- package/dist/smart/mail-structure/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-structure/template/default.css +100 -0
- package/dist/smart/mail-structure/template/default.css.gz +0 -0
- package/dist/smart/mail-structure/template/default.js +80 -0
- package/dist/smart/mail-structure/template/default.js.gz +0 -0
- package/dist/smart/rule.js +161 -0
- package/dist/smart/rule.js.gz +0 -0
- package/package.json +29 -4
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ "b65dbad8169f"
|
|
6
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
|
|
8
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("deb1a4d61565");
|
|
11
|
+
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5b7d7695b41b");
|
|
12
|
+
/* harmony import */ var _js_templates_default_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("db6e10a599e5");
|
|
13
|
+
/* harmony import */ var _component_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("30633924c5d7");
|
|
14
|
+
/* harmony import */ var _lang_en_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("57be4d52c1c3");
|
|
15
|
+
/* harmony import */ var _lang_ru_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("2446fd4870c2");
|
|
16
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _js_templates_default_js__WEBPACK_IMPORTED_MODULE_2__]);
|
|
17
|
+
([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _js_templates_default_js__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
18
|
+
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__);
|
|
19
|
+
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__);
|
|
20
|
+
// sf-mail-structure: the structure of a letter in SIMAI Email Editor -- the
|
|
21
|
+
// letter's own settings, one row per block in the letter's order, and a way to
|
|
22
|
+
// add a block. A row chooses its block, moves by its handle or by keys, offers
|
|
23
|
+
// a copy and a removal under ⋯, and a point between rows asks for a new block
|
|
24
|
+
// in that place. The two places every letter has (header, footer) are pinned:
|
|
25
|
+
// they do not move, nothing lands outside them, and their ⋯ offers another
|
|
26
|
+
// variant instead.
|
|
27
|
+
//
|
|
28
|
+
// It holds no letter. The host passes `rows` and `selected`, hears what the
|
|
29
|
+
// person asked for and passes the rows back; a drop or an insertion that aims
|
|
30
|
+
// beyond a pinned place is told as the nearest place it can have.
|
|
31
|
+
//
|
|
32
|
+
// Written for ui-mail's editor by the owner's decision D31 (2026-10-29): a
|
|
33
|
+
// product keeps no component set of its own. From its component.json (standard
|
|
34
|
+
// simai.smart-component 1.4 §3, §4, §8, §11): the settings are attributes and
|
|
35
|
+
// properties made by core/js/element-manifest.js, its words are
|
|
36
|
+
// lang/<locale>.json, and the actions answer outcomes.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
const applied = () => ({
|
|
45
|
+
outcome: "applied"
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const refused = reason => ({
|
|
49
|
+
outcome: "refused",
|
|
50
|
+
reason
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const MailStructureElement = (0,_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__.elementFromManifest)(_component_json__WEBPACK_IMPORTED_MODULE_3__, {
|
|
54
|
+
base: (_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default()),
|
|
55
|
+
lang: {
|
|
56
|
+
en: _lang_en_json__WEBPACK_IMPORTED_MODULE_4__,
|
|
57
|
+
ru: _lang_ru_json__WEBPACK_IMPORTED_MODULE_5__
|
|
58
|
+
},
|
|
59
|
+
source: "ru",
|
|
60
|
+
actions: {
|
|
61
|
+
select({
|
|
62
|
+
id
|
|
63
|
+
} = {}) {
|
|
64
|
+
const wanted = String(id ?? "");
|
|
65
|
+
if (wanted && !this.rowOf(wanted)) return refused("unknown");
|
|
66
|
+
this.sfEmit("select", {
|
|
67
|
+
id: wanted
|
|
68
|
+
});
|
|
69
|
+
return applied();
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
move({
|
|
73
|
+
id,
|
|
74
|
+
index,
|
|
75
|
+
by
|
|
76
|
+
} = {}) {
|
|
77
|
+
const row = this.rowOf(id);
|
|
78
|
+
if (!row) return refused("unknown");
|
|
79
|
+
if (row.family) return this.pinnedRefusal();
|
|
80
|
+
const at = this.rowList().indexOf(row);
|
|
81
|
+
const wanted = Number.isFinite(Number(index)) && index !== undefined && index !== null ? Number(index) : at + Number(by ?? 0);
|
|
82
|
+
const to = this.clamped(wanted, this.rowList().length - 1);
|
|
83
|
+
if (to === at) return refused("unchanged");
|
|
84
|
+
this.sfEmit("move", {
|
|
85
|
+
id: row.id,
|
|
86
|
+
index: to
|
|
87
|
+
});
|
|
88
|
+
return applied();
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
insert({
|
|
92
|
+
type,
|
|
93
|
+
index
|
|
94
|
+
} = {}) {
|
|
95
|
+
const kind = String(type ?? "");
|
|
96
|
+
if (!this.kinds().some(item => item.value === kind)) return refused("unknown");
|
|
97
|
+
this.sfEmit("insert", {
|
|
98
|
+
type: kind,
|
|
99
|
+
index: this.clamped(Number(index ?? this.rowList().length), this.rowList().length)
|
|
100
|
+
});
|
|
101
|
+
return applied();
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
add() {
|
|
105
|
+
this.sfEmit("add", {});
|
|
106
|
+
return applied();
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
duplicate({
|
|
110
|
+
id
|
|
111
|
+
} = {}) {
|
|
112
|
+
const row = this.rowOf(id);
|
|
113
|
+
if (!row) return refused("unknown");
|
|
114
|
+
if (row.family) return this.pinnedRefusal();
|
|
115
|
+
this.sfEmit("duplicate", {
|
|
116
|
+
id: row.id
|
|
117
|
+
});
|
|
118
|
+
return applied();
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
// Not `remove`: that is the DOM's own method, and the element would take itself off the page.
|
|
122
|
+
delete({
|
|
123
|
+
id
|
|
124
|
+
} = {}) {
|
|
125
|
+
const row = this.rowOf(id);
|
|
126
|
+
if (!row) return refused("unknown");
|
|
127
|
+
if (row.family) return this.pinnedRefusal();
|
|
128
|
+
this.sfEmit("delete", {
|
|
129
|
+
ids: [row.id],
|
|
130
|
+
id: row.id
|
|
131
|
+
});
|
|
132
|
+
return applied();
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
replace({
|
|
136
|
+
id
|
|
137
|
+
} = {}) {
|
|
138
|
+
const row = this.rowOf(id);
|
|
139
|
+
if (!row) return refused("unknown");
|
|
140
|
+
if (!row.family) return refused("not-pinned");
|
|
141
|
+
this.sfEmit("replace", {
|
|
142
|
+
family: row.family
|
|
143
|
+
});
|
|
144
|
+
return applied();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
class SfMailStructure extends MailStructureElement {
|
|
151
|
+
static get props() {
|
|
152
|
+
return { ...super.props,
|
|
153
|
+
templateName: {
|
|
154
|
+
attribute: "template",
|
|
155
|
+
default: "default"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
constructor() {
|
|
161
|
+
super(); // A list set as a property before the element was defined is an own
|
|
162
|
+
// property that would hide the accessor; it is taken through it.
|
|
163
|
+
|
|
164
|
+
for (const name of ["rows", "inserterItems"]) {
|
|
165
|
+
if (Object.prototype.hasOwnProperty.call(this, name)) {
|
|
166
|
+
const early = this[name];
|
|
167
|
+
delete this[name];
|
|
168
|
+
this[name] = early;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
this.menuFor = "";
|
|
173
|
+
this.stop = "";
|
|
174
|
+
this.notice = "";
|
|
175
|
+
} // [{id, title, summary, icon, family}]: one row per block, in the letter's
|
|
176
|
+
// order. `family` marks a place every letter has ("header", "footer").
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
rowList() {
|
|
180
|
+
return Array.isArray(this.rows) ? this.rows.filter(row => row && typeof row.id === "string" && row.id) : [];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
rowOf(id) {
|
|
184
|
+
return this.rowList().find(row => row.id === String(id ?? ""));
|
|
185
|
+
}
|
|
186
|
+
/** The kinds an insertion point offers, without the headings between them. */
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
kinds() {
|
|
190
|
+
return Array.isArray(this.inserterItems) ? this.inserterItems.filter(item => item && item.value) : [];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The nearest place a block can have: nothing goes before a pinned header
|
|
194
|
+
* or after a pinned footer, so a place beyond them lands next to them.
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
clamped(index, last) {
|
|
199
|
+
const rows = this.rowList();
|
|
200
|
+
const lowest = rows[0]?.family === "header" ? 1 : 0;
|
|
201
|
+
const highest = rows.at(-1)?.family === "footer" ? last - 1 : last;
|
|
202
|
+
return Math.min(highest, Math.max(lowest, index));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
pinnedRefusal() {
|
|
206
|
+
this.notice = this.sfWord("pinned-text");
|
|
207
|
+
this.requestComponentUpdate("notice");
|
|
208
|
+
return refused("pinned");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
get menu() {
|
|
212
|
+
return this.querySelector(".sf-mail-structure-menu");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
menuEntries(row) {
|
|
216
|
+
if (row.family) return [{
|
|
217
|
+
id: "replace",
|
|
218
|
+
text: this.sfWord("replace-text"),
|
|
219
|
+
icon: "swap_horiz"
|
|
220
|
+
}];
|
|
221
|
+
const rows = this.rowList();
|
|
222
|
+
const at = rows.indexOf(row);
|
|
223
|
+
return [{
|
|
224
|
+
id: "up",
|
|
225
|
+
text: this.sfWord("up-text"),
|
|
226
|
+
icon: "arrow_upward",
|
|
227
|
+
shortcut: "Alt+↑",
|
|
228
|
+
disabled: this.clamped(at - 1, rows.length - 1) === at
|
|
229
|
+
}, {
|
|
230
|
+
id: "down",
|
|
231
|
+
text: this.sfWord("down-text"),
|
|
232
|
+
icon: "arrow_downward",
|
|
233
|
+
shortcut: "Alt+↓",
|
|
234
|
+
disabled: this.clamped(at + 1, rows.length - 1) === at
|
|
235
|
+
}, {
|
|
236
|
+
id: "duplicate",
|
|
237
|
+
text: this.sfWord("duplicate-text"),
|
|
238
|
+
icon: "content_copy"
|
|
239
|
+
}, {
|
|
240
|
+
type: "separator"
|
|
241
|
+
}, {
|
|
242
|
+
id: "remove",
|
|
243
|
+
text: this.sfWord("delete-text"),
|
|
244
|
+
icon: "delete",
|
|
245
|
+
shortcut: "Delete",
|
|
246
|
+
danger: true
|
|
247
|
+
}];
|
|
248
|
+
}
|
|
249
|
+
/** The ⋯ of a row: one menu, filled for the row it was opened from. */
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
openMenu(id, anchor) {
|
|
253
|
+
const row = this.rowOf(id);
|
|
254
|
+
const menu = this.menu;
|
|
255
|
+
if (!row || !menu) return;
|
|
256
|
+
this.menuFor = row.id;
|
|
257
|
+
const native = anchor?.querySelector?.("button") ?? anchor; // The Loader brings sf-menu-context when the page is ready (the rule
|
|
258
|
+
// fetches it lazily); a press before that waits for it.
|
|
259
|
+
|
|
260
|
+
customElements.whenDefined("sf-menu-context").then(() => {
|
|
261
|
+
menu.entries = this.menuEntries(row);
|
|
262
|
+
menu.toggleFor(native);
|
|
263
|
+
});
|
|
264
|
+
} // The menu answers for the row it was opened from, whatever is redrawn
|
|
265
|
+
// meanwhile: the id is remembered, not read back out of the markup.
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
onMenuSelect(detail = {}) {
|
|
269
|
+
const choice = String(detail.id ?? detail.entry?.id ?? "");
|
|
270
|
+
const id = this.menuFor;
|
|
271
|
+
if (!choice || !id) return;
|
|
272
|
+
if (choice === "up") this.move({
|
|
273
|
+
id,
|
|
274
|
+
by: -1
|
|
275
|
+
});else if (choice === "down") this.move({
|
|
276
|
+
id,
|
|
277
|
+
by: 1
|
|
278
|
+
});else if (choice === "duplicate") this.duplicate({
|
|
279
|
+
id
|
|
280
|
+
});else if (choice === "remove") this.delete({
|
|
281
|
+
id
|
|
282
|
+
});else if (choice === "replace") this.replace({
|
|
283
|
+
id
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
onRowClick(event, id) {
|
|
288
|
+
if (event.target.closest?.("sf-button-icon")) return;
|
|
289
|
+
this.select({
|
|
290
|
+
id
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/** The one tab stop of the list: the chosen row, else the last focused, else the first. */
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
tabStop() {
|
|
297
|
+
const rows = this.rowList();
|
|
298
|
+
const selected = String(this.selected ?? "");
|
|
299
|
+
if (rows.some(row => row.id === selected)) return selected;
|
|
300
|
+
if (rows.some(row => row.id === this.stop)) return this.stop;
|
|
301
|
+
return rows[0]?.id ?? "";
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
onRowKeydown(event, id) {
|
|
305
|
+
// A key on the row's own ⋯ or a held row is not the list's.
|
|
306
|
+
if (event.target !== event.currentTarget) return;
|
|
307
|
+
const row = this.rowOf(id);
|
|
308
|
+
if (!row) return;
|
|
309
|
+
|
|
310
|
+
const stopped = () => {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
event.stopPropagation();
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const vertical = event.key === "ArrowUp" || event.key === "ArrowDown";
|
|
316
|
+
|
|
317
|
+
if ((event.key === "Enter" || event.key === " ") && !event.altKey) {
|
|
318
|
+
stopped();
|
|
319
|
+
this.sfEmit("select", {
|
|
320
|
+
id,
|
|
321
|
+
keyboard: true
|
|
322
|
+
});
|
|
323
|
+
} else if (event.altKey && vertical) {
|
|
324
|
+
stopped();
|
|
325
|
+
this.move({
|
|
326
|
+
id,
|
|
327
|
+
by: event.key === "ArrowUp" ? -1 : 1
|
|
328
|
+
});
|
|
329
|
+
} else if (vertical || event.key === "Home" || event.key === "End") {
|
|
330
|
+
stopped();
|
|
331
|
+
const rows = this.rowList();
|
|
332
|
+
const at = rows.indexOf(row);
|
|
333
|
+
const to = event.key === "Home" ? 0 : event.key === "End" ? rows.length - 1 : at + (event.key === "ArrowUp" ? -1 : 1);
|
|
334
|
+
this.focusRow(rows[Math.max(0, Math.min(rows.length - 1, to))]?.id);
|
|
335
|
+
} else if (event.key === "ContextMenu" || event.shiftKey && event.key === "F10") {
|
|
336
|
+
stopped();
|
|
337
|
+
this.openMenu(id, event.currentTarget.querySelector("sf-button-icon"));
|
|
338
|
+
} else if (event.key === "Delete" || event.key === "Backspace") {
|
|
339
|
+
stopped();
|
|
340
|
+
this.delete({
|
|
341
|
+
id
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
focusRow(id) {
|
|
347
|
+
if (!id) return;
|
|
348
|
+
this.stop = id;
|
|
349
|
+
this.requestComponentUpdate("stop");
|
|
350
|
+
requestAnimationFrame(() => this.querySelector(`[data-sf-sortable-item="${CSS.escape(id)}"]`)?.focus());
|
|
351
|
+
} // sf-sortable only asks; a pinned row refuses, a drop beyond a pinned place
|
|
352
|
+
// lands next to it. The list's own redraw comes with the rows the host passes.
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
onSortableMove(event) {
|
|
356
|
+
event.stopPropagation();
|
|
357
|
+
const {
|
|
358
|
+
item,
|
|
359
|
+
index
|
|
360
|
+
} = event.detail ?? {};
|
|
361
|
+
const row = this.rowOf(item);
|
|
362
|
+
if (!row) return;
|
|
363
|
+
|
|
364
|
+
if (row.family) {
|
|
365
|
+
this.pinnedRefusal();
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
this.move({
|
|
370
|
+
id: item,
|
|
371
|
+
index
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
onSortableInsert(event) {
|
|
376
|
+
event.stopPropagation();
|
|
377
|
+
const {
|
|
378
|
+
index,
|
|
379
|
+
item
|
|
380
|
+
} = event.detail ?? {}; // Cancelling keeps the inserter open, which only a synchronous answer can do.
|
|
381
|
+
|
|
382
|
+
if (this.insert({
|
|
383
|
+
type: item,
|
|
384
|
+
index
|
|
385
|
+
}).outcome !== "applied") event.preventDefault();
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
templateContext() {
|
|
389
|
+
const rows = this.rowList();
|
|
390
|
+
const selected = String(this.selected ?? "");
|
|
391
|
+
const stop = this.tabStop();
|
|
392
|
+
const empty = !rows.some(row => !row.family);
|
|
393
|
+
return {
|
|
394
|
+
component: this,
|
|
395
|
+
rows: rows.map(row => ({ ...row,
|
|
396
|
+
isSelected: row.id === selected,
|
|
397
|
+
isStop: row.id === stop,
|
|
398
|
+
actionsLabel: this.sfWord("actions-label", {
|
|
399
|
+
vars: {
|
|
400
|
+
title: String(row.title ?? "")
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
})),
|
|
404
|
+
kinds: Array.isArray(this.inserterItems) ? this.inserterItems : [],
|
|
405
|
+
settingsSelected: !selected,
|
|
406
|
+
empty,
|
|
407
|
+
// The card stands where the first content block will go, before the footer.
|
|
408
|
+
emptyBefore: empty ? rows.find(row => row.family === "footer")?.id ?? "" : "",
|
|
409
|
+
noticeText: this.notice,
|
|
410
|
+
listLabel: this.sfWord("list-label"),
|
|
411
|
+
settingsLabel: this.sfWord("settings-text"),
|
|
412
|
+
addLabel: this.sfWord("add-text"),
|
|
413
|
+
emptyTitle: this.sfWord("empty-heading"),
|
|
414
|
+
emptyText: this.sfWord("empty-text"),
|
|
415
|
+
pinnedLabel: this.sfWord("pinned-text"),
|
|
416
|
+
rootClass: this.getRootClass?.() ?? ""
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
template() {
|
|
421
|
+
return (0,_js_templates_default_js__WEBPACK_IMPORTED_MODULE_2__.renderMailStructureTemplate)(this.templateContext());
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
SfMailStructure.define("sf-mail-structure");
|
|
427
|
+
__webpack_async_result__();
|
|
428
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
429
|
+
|
|
430
|
+
/***/ },
|
|
431
|
+
|
|
432
|
+
/***/ "db6e10a599e5"
|
|
433
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
434
|
+
|
|
435
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
436
|
+
__webpack_require__.r(__webpack_exports__);
|
|
437
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
438
|
+
/* harmony export */ renderMailStructureTemplate: () => (/* binding */ renderMailStructureTemplate)
|
|
439
|
+
/* harmony export */ });
|
|
440
|
+
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a080a730149");
|
|
441
|
+
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("efa66f8927d1");
|
|
442
|
+
/* harmony import */ var _default_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("3c626a3bebaa");
|
|
443
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__]);
|
|
444
|
+
([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
445
|
+
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lit__WEBPACK_IMPORTED_MODULE_0__);
|
|
446
|
+
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
// A row: its handle (a pin for a place that does not move), its icon, the name
|
|
450
|
+
// and what it holds, and ⋯, whose space is kept. One row of the list is the tab
|
|
451
|
+
// stop; arrows go between rows. `slot` marks it as the list's content, not as
|
|
452
|
+
// sf-sortable's own first paint: sf-sortable may arrive before this element
|
|
453
|
+
// draws, and would drop the printed rows.
|
|
454
|
+
|
|
455
|
+
function renderRow(context, row) {
|
|
456
|
+
const {
|
|
457
|
+
component
|
|
458
|
+
} = context;
|
|
459
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
460
|
+
<div slot="item" class=${["sf-mail-structure-row", row.isSelected ? "is-selected" : "", row.family ? "is-pinned" : ""].filter(Boolean).join(" ")}
|
|
461
|
+
data-sf-sortable-item=${row.id} data-family=${row.family || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} tabindex=${row.isStop ? "0" : "-1"}
|
|
462
|
+
aria-current=${row.isSelected ? "true" : "false"}
|
|
463
|
+
@focus=${() => {
|
|
464
|
+
component.stop = row.id;
|
|
465
|
+
}}
|
|
466
|
+
@click=${event => component.onRowClick(event, row.id)}
|
|
467
|
+
@keydown=${event => component.onRowKeydown(event, row.id)}>
|
|
468
|
+
${row.family ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="sf-mail-structure-handle" aria-hidden="true" title=${context.pinnedLabel}><sf-icon icon="push_pin" size="1"></sf-icon></span>` : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="sf-mail-structure-handle" data-sf-sortable-handle aria-hidden="true"><sf-icon icon="drag_indicator" size="1"></sf-icon></span>`}
|
|
469
|
+
<sf-icon class="sf-mail-structure-icon" icon=${row.icon || "widgets"} size="2" aria-hidden="true"></sf-icon>
|
|
470
|
+
<span class="sf-mail-structure-words">
|
|
471
|
+
<span class="sf-mail-structure-title">${row.title}</span>
|
|
472
|
+
${row.summary ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<span class="sf-mail-structure-summary">${row.summary}</span>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
473
|
+
</span>
|
|
474
|
+
<sf-button-icon class="sf-mail-structure-more" size="1/2" appearance="ghost" scheme="on-surface-variant" icon="more_horiz" tabindex="-1"
|
|
475
|
+
aria-label=${row.actionsLabel} title=${row.actionsLabel}
|
|
476
|
+
@click=${event => component.openMenu(row.id, event.currentTarget)}></sf-button-icon>
|
|
477
|
+
</div>
|
|
478
|
+
`;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function renderEmpty(context) {
|
|
482
|
+
const {
|
|
483
|
+
component
|
|
484
|
+
} = context;
|
|
485
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
486
|
+
<sf-empty-state slot="item" class="sf-mail-structure-empty" kind="no-data" size="1/2" heading-level="3"
|
|
487
|
+
heading=${context.emptyTitle} text=${context.emptyText}>
|
|
488
|
+
<sf-button slot="actions" size="1/2" appearance="outline" icon-start="add" text=${context.addLabel}
|
|
489
|
+
data-action="add" @click=${() => component.add()}></sf-button>
|
|
490
|
+
</sf-empty-state>
|
|
491
|
+
`;
|
|
492
|
+
} // The structure: the letter's settings, the rows in the letter's order (with
|
|
493
|
+
// the empty card where the first block will go), then «Добавить блок» unless
|
|
494
|
+
// the card says it already.
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
function renderMailStructureTemplate(context) {
|
|
498
|
+
const {
|
|
499
|
+
component
|
|
500
|
+
} = context;
|
|
501
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
502
|
+
<div class=${["sf-mail-structure", context.rootClass].filter(Boolean).join(" ")}>
|
|
503
|
+
<button type="button" class=${["sf-mail-structure-row", "sf-mail-structure-settings", context.settingsSelected ? "is-selected" : ""].filter(Boolean).join(" ")}
|
|
504
|
+
aria-current=${context.settingsSelected ? "true" : "false"}
|
|
505
|
+
@click=${() => component.select({
|
|
506
|
+
id: ""
|
|
507
|
+
})}>
|
|
508
|
+
<span class="sf-mail-structure-handle" aria-hidden="true"></span>
|
|
509
|
+
<sf-icon class="sf-mail-structure-icon" icon="tune" size="2" aria-hidden="true"></sf-icon>
|
|
510
|
+
<span class="sf-mail-structure-title">${context.settingsLabel}</span>
|
|
511
|
+
</button>
|
|
512
|
+
<sf-sortable class="sf-mail-structure-list" group="letter" label=${context.listLabel} .inserterItems=${context.kinds}
|
|
513
|
+
@sf-sortable-move=${event => component.onSortableMove(event)}
|
|
514
|
+
@sf-sortable-insert=${event => component.onSortableInsert(event)}>
|
|
515
|
+
${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_1__.repeat)(context.rows, row => row.id, row => (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`${row.id === context.emptyBefore ? renderEmpty(context) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}${renderRow(context, row)}`)}
|
|
516
|
+
${context.empty && !context.emptyBefore ? renderEmpty(context) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
517
|
+
</sf-sortable>
|
|
518
|
+
${context.empty ? lit__WEBPACK_IMPORTED_MODULE_0__.nothing : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<button type="button" class="sf-mail-structure-row sf-mail-structure-add" data-action="add" @click=${() => component.add()}>
|
|
519
|
+
<span class="sf-mail-structure-handle" aria-hidden="true"></span>
|
|
520
|
+
<sf-icon class="sf-mail-structure-icon" icon="add" size="2" aria-hidden="true"></sf-icon>
|
|
521
|
+
<span class="sf-mail-structure-title">${context.addLabel}</span>
|
|
522
|
+
</button>`}
|
|
523
|
+
<span class="sf-mail-structure-notice sr-only" role="status">${context.noticeText}</span>
|
|
524
|
+
<sf-menu-context class="sf-mail-structure-menu" popup
|
|
525
|
+
@sf-menu-context-select=${event => {
|
|
526
|
+
event.stopPropagation();
|
|
527
|
+
component.onMenuSelect(event.detail);
|
|
528
|
+
}}></sf-menu-context>
|
|
529
|
+
</div>
|
|
530
|
+
`;
|
|
531
|
+
}
|
|
532
|
+
__webpack_async_result__();
|
|
533
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
534
|
+
|
|
535
|
+
/***/ },
|
|
536
|
+
|
|
537
|
+
/***/ "3c626a3bebaa"
|
|
538
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
539
|
+
|
|
540
|
+
__webpack_require__.r(__webpack_exports__);
|
|
541
|
+
// extracted by mini-css-extract-plugin
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
/***/ },
|
|
545
|
+
|
|
546
|
+
/***/ "5b7d7695b41b"
|
|
547
|
+
(module) {
|
|
548
|
+
|
|
549
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("element-manifest", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("element-manifest", 1).then(resolve, reject), { once: true })));
|
|
550
|
+
|
|
551
|
+
/***/ },
|
|
552
|
+
|
|
553
|
+
/***/ "efa66f8927d1"
|
|
554
|
+
(module) {
|
|
555
|
+
|
|
556
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("lit/directives/repeat.js", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("lit/directives/repeat.js", 1).then(resolve, reject), { once: true })));
|
|
557
|
+
|
|
558
|
+
/***/ },
|
|
559
|
+
|
|
560
|
+
/***/ "2a080a730149"
|
|
561
|
+
(module) {
|
|
562
|
+
|
|
563
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("lit", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("lit", 1).then(resolve, reject), { once: true })));
|
|
564
|
+
|
|
565
|
+
/***/ },
|
|
566
|
+
|
|
567
|
+
/***/ "deb1a4d61565"
|
|
568
|
+
(module) {
|
|
569
|
+
|
|
570
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("smart-base", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("smart-base", 1).then(resolve, reject), { once: true })));
|
|
571
|
+
|
|
572
|
+
/***/ },
|
|
573
|
+
|
|
574
|
+
/***/ "30633924c5d7"
|
|
575
|
+
(module) {
|
|
576
|
+
|
|
577
|
+
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.mail-structure","tag":"sf-mail-structure","version":"1.1.2","kind":"leaf","settings":{"rows":{"type":"list","default":[],"of":{"id":"id","title":"string","icon":{"type":"icon","optional":true},"family":{"type":"id","optional":true}},"entries":{"key":"id","changes":"content"}},"selected":{"type":"id","default":""},"inserter-items":{"type":"list","default":[],"of":{"type":{"type":"string","optional":true},"value":{"type":"id","optional":true},"label":"string","icon":{"type":"icon","optional":true},"caption":{"type":"string","optional":true},"keywords":{"type":"string","optional":true}},"entries":{"key":"value","changes":"content"}}},"values":{},"events":{"select":{"carries":{"id":"id","keyboard":{"type":"boolean","optional":true}}},"move":{"carries":{"id":"id","index":"number"}},"insert":{"carries":{"type":"id","index":"number"},"own-verb":true},"add":{"carries":{}},"duplicate":{"carries":{"id":"id"},"own-verb":true},"delete":{"carries":{"ids":"list","id":"id"}},"replace":{"carries":{"family":"id"}}},"actions":{"select":{"with":{"id":{"type":"id","optional":true}}},"move":{"with":{"id":"id","index":{"type":"number","optional":true},"by":{"type":"number","optional":true}}},"insert":{"with":{"type":"id","index":{"type":"number","optional":true}}},"add":{"with":{}},"duplicate":{"with":{"id":"id"}},"delete":{"with":{"id":"id"}},"replace":{"with":{"id":"id"}}},"host-states":{},"css-variables":{}}');
|
|
578
|
+
|
|
579
|
+
/***/ },
|
|
580
|
+
|
|
581
|
+
/***/ "57be4d52c1c3"
|
|
582
|
+
(module) {
|
|
583
|
+
|
|
584
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Letter structure","runtime":{"actions-label":"Block actions: {title}","add-text":"Add a block","delete-text":"Remove","down-text":"Move down","duplicate-text":"Duplicate","empty-heading":"Add the first block","empty-text":"Headings, text, buttons, products and more are in the Library.","list-label":"Email","pinned-text":"The header and the footer are pinned: they cannot be moved, deleted or duplicated — only swapped.","replace-text":"Change the variant…","settings-text":"Email settings","up-text":"Move up"},"events":{"duplicate":{"label":"Duplicate the block"}}}');
|
|
585
|
+
|
|
586
|
+
/***/ },
|
|
587
|
+
|
|
588
|
+
/***/ "2446fd4870c2"
|
|
589
|
+
(module) {
|
|
590
|
+
|
|
591
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Структура письма","runtime":{"actions-label":"Действия с блоком: {title}","add-text":"Добавить блок","delete-text":"Удалить","down-text":"Ниже","duplicate-text":"Дублировать","empty-heading":"Добавьте первый блок","empty-text":"Заголовок, текст, кнопка, товары и другие блоки — в Библиотеке.","list-label":"Письмо","pinned-text":"Шапка и подвал закреплены: их нельзя переместить, удалить или дублировать — только сменить вариант.","replace-text":"Сменить вариант…","settings-text":"Параметры письма","up-text":"Выше"},"events":{"duplicate":{"label":"Дублировать блок"}}}');
|
|
592
|
+
|
|
593
|
+
/***/ }
|
|
594
|
+
|
|
595
|
+
/******/ });
|
|
596
|
+
/************************************************************************/
|
|
597
|
+
/******/ // The module cache
|
|
598
|
+
/******/ const __webpack_module_cache__ = {};
|
|
599
|
+
/******/
|
|
600
|
+
/******/ // The require function
|
|
601
|
+
/******/ function __webpack_require__(moduleId) {
|
|
602
|
+
/******/ // Check if module is in cache
|
|
603
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
604
|
+
/******/ if (cachedModule !== undefined) {
|
|
605
|
+
/******/ return cachedModule.exports;
|
|
606
|
+
/******/ }
|
|
607
|
+
/******/ // Create a new module (and put it into the cache)
|
|
608
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
609
|
+
/******/ // no module.id needed
|
|
610
|
+
/******/ // no module.loaded needed
|
|
611
|
+
/******/ exports: {}
|
|
612
|
+
/******/ };
|
|
613
|
+
/******/
|
|
614
|
+
/******/ // Execute the module function
|
|
615
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
616
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
617
|
+
/******/ const e = new Error("Cannot find module '" + moduleId + "'");
|
|
618
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
619
|
+
/******/ throw e;
|
|
620
|
+
/******/ }
|
|
621
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
622
|
+
/******/
|
|
623
|
+
/******/ // Return the exports of the module
|
|
624
|
+
/******/ return module.exports;
|
|
625
|
+
/******/ }
|
|
626
|
+
/******/
|
|
627
|
+
/************************************************************************/
|
|
628
|
+
/******/ /* webpack/runtime/async module */
|
|
629
|
+
/******/ (() => {
|
|
630
|
+
/******/ const hasSymbol = typeof Symbol === "function";
|
|
631
|
+
/******/ const webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
|
632
|
+
/******/ const webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
|
633
|
+
/******/ const webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
|
634
|
+
/******/
|
|
635
|
+
/******/ const resolveQueue = (queue) => {
|
|
636
|
+
/******/ if(queue?.d < 1) {
|
|
637
|
+
/******/ queue.d = 1;
|
|
638
|
+
/******/ queue.forEach((fn) => (fn.r--));
|
|
639
|
+
/******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
|
|
640
|
+
/******/ }
|
|
641
|
+
/******/ }
|
|
642
|
+
/******/ const wrapDeps = (deps) => (deps.map((dep) => {
|
|
643
|
+
/******/ if(dep !== null && typeof dep === "object") {
|
|
644
|
+
/******/
|
|
645
|
+
/******/ if(dep[webpackQueues]) return dep;
|
|
646
|
+
/******/ if(dep.then) {
|
|
647
|
+
/******/ const queue = [];
|
|
648
|
+
/******/ queue.d = 0;
|
|
649
|
+
/******/ dep.then((r) => {
|
|
650
|
+
/******/ obj[webpackExports] = r;
|
|
651
|
+
/******/ resolveQueue(queue);
|
|
652
|
+
/******/ }, (e) => {
|
|
653
|
+
/******/ obj[webpackError] = e;
|
|
654
|
+
/******/ resolveQueue(queue);
|
|
655
|
+
/******/ });
|
|
656
|
+
/******/ const obj = {};
|
|
657
|
+
/******/
|
|
658
|
+
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
|
659
|
+
/******/ return obj;
|
|
660
|
+
/******/ }
|
|
661
|
+
/******/ }
|
|
662
|
+
/******/ const ret = {};
|
|
663
|
+
/******/ ret[webpackQueues] = x => {};
|
|
664
|
+
/******/ ret[webpackExports] = dep;
|
|
665
|
+
/******/ return ret;
|
|
666
|
+
/******/ }));
|
|
667
|
+
/******/ __webpack_require__.a = (module, body, hasAwait) => {
|
|
668
|
+
/******/ let queue;
|
|
669
|
+
/******/ hasAwait && ((queue = []).d = -1);
|
|
670
|
+
/******/ const depQueues = new Set();
|
|
671
|
+
/******/ const exports = module.exports;
|
|
672
|
+
/******/ let currentDeps;
|
|
673
|
+
/******/ let outerResolve;
|
|
674
|
+
/******/ let reject;
|
|
675
|
+
/******/ const promise = new Promise((resolve, rej) => {
|
|
676
|
+
/******/ reject = rej;
|
|
677
|
+
/******/ outerResolve = resolve;
|
|
678
|
+
/******/ });
|
|
679
|
+
/******/ promise[webpackExports] = exports;
|
|
680
|
+
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
|
681
|
+
/******/ module.exports = promise;
|
|
682
|
+
/******/ const handle = (deps) => {
|
|
683
|
+
/******/ currentDeps = wrapDeps(deps);
|
|
684
|
+
/******/ let fn;
|
|
685
|
+
/******/ const getResult = () => (currentDeps.map((d) => {
|
|
686
|
+
/******/
|
|
687
|
+
/******/ if(d[webpackError]) throw d[webpackError];
|
|
688
|
+
/******/ return d[webpackExports];
|
|
689
|
+
/******/ }))
|
|
690
|
+
/******/ const promise = new Promise((resolve) => {
|
|
691
|
+
/******/ fn = () => (resolve(getResult));
|
|
692
|
+
/******/ fn.r = 0;
|
|
693
|
+
/******/ const fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
|
|
694
|
+
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
|
695
|
+
/******/ });
|
|
696
|
+
/******/ return fn.r ? promise : getResult();
|
|
697
|
+
/******/ }
|
|
698
|
+
/******/ const done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
|
699
|
+
/******/ body(handle, done);
|
|
700
|
+
/******/ queue?.d < 0 && (queue.d = 0);
|
|
701
|
+
/******/ };
|
|
702
|
+
/******/ })();
|
|
703
|
+
/******/
|
|
704
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
705
|
+
/******/ (() => {
|
|
706
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
707
|
+
/******/ __webpack_require__.n = (module) => {
|
|
708
|
+
/******/ const getter = module && module.__esModule ?
|
|
709
|
+
/******/ () => (module['default']) :
|
|
710
|
+
/******/ () => (module);
|
|
711
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
712
|
+
/******/ return getter;
|
|
713
|
+
/******/ };
|
|
714
|
+
/******/ })();
|
|
715
|
+
/******/
|
|
716
|
+
/******/ /* webpack/runtime/define property getters */
|
|
717
|
+
/******/ (() => {
|
|
718
|
+
/******/ // define getter/value functions for harmony exports
|
|
719
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
720
|
+
/******/ if(Array.isArray(definition)) {
|
|
721
|
+
/******/ var i = 0;
|
|
722
|
+
/******/ while(i < definition.length) {
|
|
723
|
+
/******/ var key = definition[i++];
|
|
724
|
+
/******/ var binding = definition[i++];
|
|
725
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
726
|
+
/******/ if(binding === 0) {
|
|
727
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
728
|
+
/******/ } else {
|
|
729
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
730
|
+
/******/ }
|
|
731
|
+
/******/ } else if(binding === 0) { i++; }
|
|
732
|
+
/******/ }
|
|
733
|
+
/******/ } else {
|
|
734
|
+
/******/ for(var key in definition) {
|
|
735
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
736
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
737
|
+
/******/ }
|
|
738
|
+
/******/ }
|
|
739
|
+
/******/ }
|
|
740
|
+
/******/ };
|
|
741
|
+
/******/ })();
|
|
742
|
+
/******/
|
|
743
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
744
|
+
/******/ (() => {
|
|
745
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
746
|
+
/******/ })();
|
|
747
|
+
/******/
|
|
748
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
749
|
+
/******/ (() => {
|
|
750
|
+
/******/ // define __esModule on exports
|
|
751
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
752
|
+
/******/ if(Symbol.toStringTag) {
|
|
753
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
754
|
+
/******/ }
|
|
755
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
756
|
+
/******/ };
|
|
757
|
+
/******/ })();
|
|
758
|
+
/******/
|
|
759
|
+
/************************************************************************/
|
|
760
|
+
/******/
|
|
761
|
+
/******/ // startup
|
|
762
|
+
/******/ // Load entry module and return exports
|
|
763
|
+
/******/ // This entry module used 'module' so it can't be inlined
|
|
764
|
+
/******/ let __webpack_exports__ = __webpack_require__("b65dbad8169f");
|
|
765
|
+
/******/
|
|
766
|
+
/******/ })()
|
|
767
|
+
;
|