@emailmaker/emailmaker 1.0.72 → 1.0.74-alpha.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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/asset-manifest.json +18 -17
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.js +1 -1
  5. package/iframe/429.js +1 -1
  6. package/iframe/766.js +1 -1
  7. package/iframe/{iframe-eblock.8aa10c4f52f0546dc847.html → iframe-eblock.a8035f2518846f2fa683.html} +1 -1
  8. package/iframe/iframe.a8035f2518846f2fa683.html +1 -0
  9. package/iframe/js/882.f2730521.js +1 -0
  10. package/iframe/js/97.9eebccb0.js +1 -0
  11. package/iframe/sandbox-eblock.js +1 -1
  12. package/package.json +1 -1
  13. package/plugin.html +1 -1
  14. package/plugin_blocks_test.html +1 -1
  15. package/plugin_default.html +1 -1
  16. package/plugin_idigital.html +1 -1
  17. package/plugin_nota.html +869 -0
  18. package/plugin_s.html +1 -1
  19. package/static/css/3397.d5d9e813.chunk.css +1 -0
  20. package/static/js/1390.c31fb2a8.js +1 -0
  21. package/static/js/1538.915b9392.chunk.js +2 -0
  22. package/static/js/1538.915b9392.chunk.js.LICENSE.txt +23 -0
  23. package/static/js/1543.24a7fe72.js +2 -0
  24. package/static/js/{3017.a7a7e6d7.chunk.js → 3017.2d7ddc18.chunk.js} +1 -1
  25. package/static/js/3397.a7f72632.chunk.js +2 -0
  26. package/static/js/5763.bd02cece.js +2 -0
  27. package/static/js/9684.ebeda076.js +2 -0
  28. package/static/js/9684.ebeda076.js.LICENSE.txt +28 -0
  29. package/static/js/emailmaker_core.f677e99e.js +2 -0
  30. package/static/js/emailmaker_core.f677e99e.js.LICENSE.txt +23 -0
  31. package/translations.pot +357 -356
  32. package/iframe/iframe.8aa10c4f52f0546dc847.html +0 -1
  33. package/iframe/js/882.3288bb42.js +0 -1
  34. package/iframe/js/97.35099201.js +0 -1
  35. package/static/css/9259.0ff59443.chunk.css +0 -1
  36. package/static/js/1538.f72d3446.chunk.js +0 -2
  37. package/static/js/1538.f72d3446.chunk.js.LICENSE.txt +0 -8
  38. package/static/js/2117.ff58a29c.js +0 -2
  39. package/static/js/2117.ff58a29c.js.LICENSE.txt +0 -13
  40. package/static/js/4560.1deed372.js +0 -2
  41. package/static/js/8344.64ed55cf.js +0 -1
  42. package/static/js/9259.b109f7be.chunk.js +0 -2
  43. package/static/js/9924.5916ce85.js +0 -2
  44. package/static/js/emailmaker_core.4303dd58.js +0 -2
  45. package/static/js/emailmaker_core.4303dd58.js.LICENSE.txt +0 -8
  46. /package/iframe/js/{882.3288bb42.js.LICENSE.txt → 882.f2730521.js.LICENSE.txt} +0 -0
  47. /package/static/js/{9924.5916ce85.js.LICENSE.txt → 1543.24a7fe72.js.LICENSE.txt} +0 -0
  48. /package/static/js/{9259.b109f7be.chunk.js.LICENSE.txt → 3397.a7f72632.chunk.js.LICENSE.txt} +0 -0
  49. /package/static/js/{4560.1deed372.js.LICENSE.txt → 5763.bd02cece.js.LICENSE.txt} +0 -0
@@ -0,0 +1,869 @@
1
+ <!doctype html><html lang="en"><head><script id="plugin-script" src="emailmaker.js?90624a6c788ef1fec5dd"></script></head><body><button id="change_theme" style="width: 150px; height: 30px">Click Me</button><div style="background: white; width: 100%; height: 50px; display: flex; justify-content: center; align-items: center"></div><div id="shadow-host" style="padding: 0px; background: #fff; height: 100vh"></div><script async defer="defer">// import { init } from "./emailmaker-esm.js?90624a6c788ef1fec5dd";
2
+ const auth_jwt = {
3
+ username: '****',
4
+ password: '****',
5
+ };
6
+
7
+ const systemfields = [
8
+ {
9
+ label: 'Дополнительное поле «Имя»',
10
+ value: 'Name',
11
+ },
12
+ {
13
+ label: 'Имя получателя',
14
+ value: 'ToName',
15
+ },
16
+ ];
17
+
18
+ const auth_client = {
19
+ client_id: '****',
20
+ client_secret: '****',
21
+ };
22
+
23
+ const getAuthToken = async () => {
24
+ var formdata = new FormData();
25
+ formdata.append('grant_type', 'client_credentials');
26
+ formdata.append('client_id', 'z72ev3L8JuDoyoE9JQeb2CiVGvVRibQ9q95jNiJ8');
27
+ formdata.append('client_secret', 'wxMqp4DbfH6DzKj7xkMg7cQUkh1AbTvxjr04uwQ2');
28
+
29
+ var requestOptions = {
30
+ method: 'POST',
31
+ body: formdata,
32
+ redirect: 'follow',
33
+ };
34
+
35
+ return fetch('http://localhost:3000/api?oauth=token', requestOptions)
36
+ .then((response) => response.json())
37
+ .then((result) => result.access_token)
38
+ .catch((error) => {
39
+ console.log('error', error);
40
+ return '';
41
+ });
42
+ };
43
+
44
+ const auth_client_oauth = {
45
+ client_id: '****',
46
+ client_secret: '****',
47
+ };
48
+
49
+ const BLOCKS_KEY = 'blocks';
50
+ const COMMENTS_KEY = 'blocks';
51
+ const RESOURSE = 'aaa.bbb.xyz.com';
52
+ let _instance = undefined;
53
+ const host = document.getElementById('shadow-host');
54
+
55
+ // Создаём Shadow DOM
56
+ const shadowRoot = host.attachShadow({ mode: 'closed' });
57
+
58
+ // Создаём элемент, который нужно вставить
59
+ const div = document.createElement('div');
60
+ div.id = 'test';
61
+ div.style.cssText = 'padding: 0px; background: #fff; height: 100vh';
62
+
63
+ // Вставляем в shadow DOM
64
+ shadowRoot.appendChild(div);
65
+ const options = {
66
+ getAuthToken,
67
+ previewIconEnabled: true,
68
+ livePreviewEnabled: true,
69
+ element: div,
70
+ handleEmailChanged(event) {
71
+ console.log(event);
72
+ },
73
+ handleLoad(instance) {
74
+ _instance = instance;
75
+ },
76
+ handleReadEmailRevisions() {
77
+ return [];
78
+ },
79
+ // async handleReadLocale() {
80
+ // const response = await fetch("./react_app-ru_RU.po");
81
+ // const text = await response.text();
82
+ // return text;
83
+ // },
84
+ async handleSaveEmail({ value }) {
85
+ const email = await _instance.compileEmail(value);
86
+ },
87
+ handleEmailChanged(event) {
88
+ console.log(event);
89
+ },
90
+ handleLoad(instance) {
91
+ _instance = instance;
92
+ },
93
+ async handleSaveEmail({ value }) {
94
+ const email = await _instance.compileEmail(value);
95
+ console.log(email);
96
+ },
97
+ handleCloneEmail(event) {
98
+ console.log(event);
99
+ },
100
+ handleShareEmail(event) {
101
+ console.log(event);
102
+ },
103
+ handlePreviewEmail(event) {
104
+ console.log(event);
105
+ },
106
+ handleLivePreviewEmail(event) {
107
+ console.log(event);
108
+ },
109
+ handleValidate(e) {
110
+ console.log(e);
111
+ },
112
+ handleEmailAutosave: () => {
113
+ console.log('handleEmailAutosave 1');
114
+ },
115
+
116
+ // headless: true,
117
+ content: {
118
+ templateId: 321739,
119
+
120
+ email: {
121
+ id: '3769995',
122
+ author: 123,
123
+ isNew: false,
124
+ subject: 'topic',
125
+ preheader: '',
126
+ description: '',
127
+ project: 'undefined',
128
+ parent_email: '309707',
129
+ common_styles:
130
+ '{"block":{"darkBgColor":"#1c52dc"},"text":{"fontFamily":["Safe Fonts","-apple-system, \'Segoe UI\', \'Helvetica Neue\', Helvetica, Roboto, Arial, sans-serif"],"fontSize":16,"fontSizeDim":"px","lineHeight":21,"lineHeightDim":"px","color":"#5a5a5a","textAlign":"left","paddingBottom":10,"paddingBottomDim":"px"},"headings":{"fontFamily":["Safe Fonts","-apple-system, \'Segoe UI\', \'Helvetica Neue\', Helvetica, Roboto, Arial, sans-serif"],"fontSize":24,"fontSizeDim":"px","lineHeight":32,"lineHeightDim":"px","color":"#333333","textAlign":"left","paddingTop":20,"paddingTopDim":"px","paddingBottom":10,"paddingBottomDim":"px","letterSpacing":0,"letterSpacingDim":"px","bold":true,"italic":false},"links":{"color":"#1C52DC","underline":true},"buttons":{"fontFamily":["Safe Fonts","-apple-system, \'Segoe UI\', \'Helvetica Neue\', Helvetica, Roboto, Arial, sans-serif"],"fontSize":16,"fontSizeDim":"px","letterSpacing":0,"letterSpacingDim":"px","color":"#FFFFFF","bold":false,"italic":false,"backgroundColor":"#1C52DC","marginTop":10,"marginTopDim":"px","marginBottom":10,"marginBottomDim":"px","border":{"all":null,"top":null,"right":null,"bottom":null,"left":null},"borderRadius":{"all":5,"topLeft":null,"topRight":null,"bottomRight":null,"bottomLeft":null},"textAlign":"center","padding":{"all":null,"top":null,"right":null,"bottom":null,"left":null}},"block":{"backgroundColor":""}}',
131
+ title: '',
132
+ date: '2024-01-12T08:42:09',
133
+ modified: '2024-02-16T17:21:01',
134
+ group: [],
135
+ lock: false,
136
+ utm_parameters: {
137
+ utm_content: 'ssssssss',
138
+ },
139
+ // "code": "<html><head></head><body><body></html>",
140
+ },
141
+ },
142
+ project: undefined,
143
+ user: {
144
+ id: 123,
145
+ username: 'testetrter',
146
+ name: 'ssss',
147
+ },
148
+
149
+ config: {
150
+ styles:
151
+ "\n .blocks-app .ant-cascader-dropdown .ant-cascader-menu-item[title='Google Fonts'] {\n display: none;\n }\n\n [data-node-key='Settings'] {\n display: none;\n }\n\n .blocks-app .ant-app .ant-tabs-large>.ant-tabs-nav .ant-tabs-tab[data-node-key='Settings'] {\n display: none;\n }\n\n .blocks-app .ant-app .ant-tabs-large>.ant-tabs-nav .ant-tabs-tab[data-node-key='UTM parameters'] {\n margin: 0;\n }\n\n .blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane[id='rc-tabs-2-panel-Settings'] {\n display: none;\n }\n\n .blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane[id='rc-tabs-2-panel-UTM parameters'] {\n display: block !important;\n }\n\n .blocks-app .ant-form-item .ant-form-item-label >label {\n display: flex;\n flex-direction: row;\n }\n\n .blocks-app .ant-radio-group[id='selected_td_form_direction'] {\n display: none;\n }\n\n .blocks-app .ant-input-number .ant-input-number-input,\n .blocks-app .ant-input, \n .blocks-app .ant-app .ant-form-item-switch-label {\n font-family: Roboto;\n font-weight: var(--font-weight-400);\n font-size: var(--font-size-14);\n letter-spacing: 0px;\n line-height: var(--line-height-18);\n color: var(--color-grey-200);\n }\n\n .blocks-app .ant-app .form-group-title,\n .blocks-app .email-pane .ant-tabs .ant-tabs-tab-btn {\n font-family: Roboto;\n font-weight: var(--font-weight-500);\n font-size: var(--font-size-14);\n letter-spacing: 0px;\n line-height: var(--line-height-18);\n color: var(--color-grey-200);\n }\n\n .ant-space.ant-space-horizontal.ant-space-align-center.ant-space-gap-row-small.ant-space-gap-col-small {\n row-gap: var(--space-xxs) !important;\n column-gap: var(--space-xxs) !important;\n color: var(--color-grey-140);\n font-family: Roboto;\n font-weight: var(--font-weight-500);\n font-size: var(--font-size-14);\n letter-spacing: 0px;\n line-height: var(--line-height-18);\n }\n\n .blocks-app .ant-app .ant-btn-default {\n color: var(--gray-140);\n }\n \n .blocks-app .ant-btn-primary {\n background-color: var(--blue-120);\n }\n\n .blocks-app .email-pane__header {\n background-color: var(--common-white);\n }\n\n .blocks-app .ant-app .header__left .ant-btn.ant-btn-icon-only {\n border: var(--space-1) solid var(--color-grey-30);\n }\n\n .blocks-app .atoms__item,\n .blocks-app .ant-app .email-page .header__container .ant-btn, .blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,\n .blocks-app .ant-app .email-page .email-pane__collapse-wrapper .ant-btn, .blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,\n .blocks-app .ant-input-number-affix-wrapper,\n .blocks-app .ant-input-number,\n .blocks-app .ant-input-number-group .ant-input-number-group-addon,\n .blocks-app .ant-input-affix-wrapper,\n .blocks-app .color-picker-input__control-wrap .ant-color-picker-trigger .ant-color-picker-color-block,\n .blocks-app .ant-select-single .ant-select-selector,\n .blocks-app .ant-cascader-dropdown .ant-cascader-menu-item,\n .blocks-app .upload-bg-image__inner-wrap,\n .blocks-app .upload-bg-image__uploader,\n .blocks-app .ant-app .ant-segmented,\n .blocks-app .ant-app .ant-segmented .ant-segmented-item,\n .blocks-app textarea.ant-input,\n .blocks-app .ant-alert,\n .blocks-app .email-pane .email-pane__content-col_main {\n border-radius: var(--border-radius4);\n }\n\n .blocks-app .ant-select-dropdown,\n .blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list,\n .blocks-app .email-pane__collapse-wrapper {\n border-radius: var(--border-radius6);\n }\n\n .blocks-app [class^=\"ant-col\"], .blocks-app [class*=\" ant-col\"] {\n font-family: Roboto;\n }\n\n .blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover {\n background-color: var(--gray-20);\n }\n\n .blocks-app .ant-switch.ant-switch-checked {\n background: var(--color-blue-120);\n }\n\n .blocks-app .ant-switch.ant-switch-checked:hover {\n background: var(--color-blue-100);\n }\n\n .blocks-app .ant-switch {\n background: var(--color-grey-100);\n }\n\n .blocks-app .ant-switch:hover {\n background: var(--color-grey-80);\n }\n\n .blocks-app .ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {\n color: var(--color-grey-200)\n }\n\n .blocks-app .email-pane .ant-tabs .ant-tabs-tab-btn:hover {\n color: var(--color-grey-200);\n }\n\n .blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {\n background-color: var(--color-blue-10);\n color: var(--color-blue-120);\n }\n\n .blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab .ant-tabs-tab-btn {\n color: var(--color-grey-140);\n }\n\n .blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-content {\n font-family: Roboto;\n padding: var(--space-xs) var(--space-xxxss) var(--space-xs) var(--space-xs);\n }\n\n .blocks-app .atoms__list {\n margin-bottom: 0;\n }\n\n .blocks-app .ant-app .ant-card-hoverable:hover {\n box-shadow: none;\n background-color: var(--color-grey-30);\n }\n\n .blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder {\n max-width: 83%;\n }\n\n .blocks-app .email-pane__col.email-pane__col_preview {\n height: 90%;\n max-height: 90vh;\n overflow: scroll;\n }\n\n .blocks-app .ant-notification {\n display: none;\n }\n\n .blocks-app .ant-app .email-page .header__container .ant-btn {\n font-weight: var(--font-weight-500);\n } \n\n .anticon-save,\n .anticon-cloud-download {\n >svg {\n width: var(--space-xsx);\n height: var(--space-xsx);\n }\n }\n\n .ant-btn.ant-btn-primary.ant-btn-block.em-analytics__email-save {\n display: flex;\n align-items: center\n }\n\n .ant-btn.ant-btn-default.ant-dropdown-trigger.em-analytics__email-page__export {\n display: flex;\n align-items: center;\n }\n\n .blocks-app .email-pane .ant-tabs .blocks-search__empty-wrapper {\n height: 100%;\n padding: var(--space-sm) var(--space-xsss) var(--space-xsss) var(--space-sm);\n }\n\n .blocks-app .ant-app .ant-layout {\n max-height: 95vh;\n }\n",
152
+ theme: 'light',
153
+ headerTitleVisible: false,
154
+ historyEnabled: false,
155
+ previewIconEnabled: false,
156
+ sendTestEnabled: false,
157
+ emailDropdownMenuEnabled: false,
158
+ emailDropdownMenuImport: false,
159
+ commentsEnabled: false,
160
+ aiAssistentEnabled: false,
161
+ exportOutlookEnabled: false,
162
+ exportPdfEnabled: false,
163
+ exportPngEnabled: false,
164
+ elementAIimageEnabled: false,
165
+ elementCountdownEnabled: false,
166
+ elementVideoEnabled: false,
167
+ elementCarouselEnabled: false,
168
+ elementAccordionEnabled: false,
169
+ elementFormEnabled: false,
170
+ blocksSavedEnabled: false,
171
+ blocksCommonEnabled: false,
172
+ blocksTemplateEnabled: false,
173
+ blocksSearchEnabled: false,
174
+ imageCenterGifEnabled: false,
175
+ imageCenterStockEnabled: false,
176
+ optimizeLinksEnabled: false,
177
+ optimizeImagesEnabled: false,
178
+ optimizeSpamAssassinEnabled: false,
179
+ imageCenterEditorEnabled: false,
180
+ formFieldExportAsPictureEnabled: false,
181
+ optimizeEnabled: false,
182
+ headerShow: true,
183
+ desktopMobileSwitchRule: true,
184
+ pathEnabled: true,
185
+ mergeTags: {
186
+ syntax: ['{{%value%}}'],
187
+ items: [
188
+ {
189
+ label: 'Системные',
190
+ value: 'system',
191
+ children: [
192
+ {
193
+ label: 'test66',
194
+ value: 'test66',
195
+ children: [
196
+ {
197
+ label: 'gggdd',
198
+ value: 'test66.gggdd',
199
+ },
200
+ ],
201
+ },
202
+ {
203
+ label: '667',
204
+ value: '667',
205
+ children: [],
206
+ },
207
+ {
208
+ label: 'тест',
209
+ value: 'тест',
210
+ children: [],
211
+ },
212
+ {
213
+ label: 'personData',
214
+ value: 'personData',
215
+ children: [
216
+ {
217
+ label: 'middleName',
218
+ value: 'personData.middleName',
219
+ },
220
+ {
221
+ label: 'id',
222
+ value: 'personData.id',
223
+ },
224
+ {
225
+ label: 'firstName',
226
+ value: 'personData.firstName',
227
+ },
228
+ ],
229
+ },
230
+ {
231
+ label: 'test пробел ',
232
+ value: 'test пробел ',
233
+ children: [],
234
+ },
235
+ {
236
+ label: 'marka67',
237
+ value: 'marka67',
238
+ children: [],
239
+ },
240
+ {
241
+ label: 'marka',
242
+ value: 'marka',
243
+ children: [],
244
+ },
245
+ {
246
+ label: 'teste46475743753734',
247
+ value: 'teste46475743753734',
248
+ children: [],
249
+ },
250
+ {
251
+ label: 'testtttt',
252
+ value: 'testtttt',
253
+ children: [],
254
+ },
255
+ {
256
+ label: 'client_requests_subscribers',
257
+ value: 'client_requests_subscribers',
258
+ children: [
259
+ {
260
+ label: 'id',
261
+ value: 'client_requests_subscribers.id',
262
+ },
263
+ ],
264
+ },
265
+ {
266
+ label: 'client_requests_subscribers2',
267
+ value: 'client_requests_subscribers2',
268
+ children: [
269
+ {
270
+ label: 'id',
271
+ value: 'client_requests_subscribers2.id',
272
+ },
273
+ ],
274
+ },
275
+ {
276
+ label: 'client_requests_subscribers1',
277
+ value: 'client_requests_subscribers1',
278
+ children: [
279
+ {
280
+ label: 'id',
281
+ value: 'client_requests_subscribers1.id',
282
+ },
283
+ ],
284
+ },
285
+ {
286
+ label: 'client_requests',
287
+ value: 'client_requests',
288
+ children: [
289
+ {
290
+ label: 'id',
291
+ value: 'client_requests.id',
292
+ },
293
+ {
294
+ label: 'status',
295
+ value: 'client_requests.status',
296
+ },
297
+ ],
298
+ },
299
+ {
300
+ label: 'demo',
301
+ value: 'demo',
302
+ children: [
303
+ {
304
+ label: 'pokaz',
305
+ value: 'demo.pokaz',
306
+ },
307
+ ],
308
+ },
309
+ {
310
+ label: 'test771',
311
+ value: 'test771',
312
+ children: [
313
+ {
314
+ label: 'test',
315
+ value: 'test771.test',
316
+ },
317
+ {
318
+ label: 'test18',
319
+ value: 'test771.test18',
320
+ },
321
+ ],
322
+ },
323
+ {
324
+ label: 'personTest',
325
+ value: 'personTest',
326
+ children: [],
327
+ },
328
+ {
329
+ label: 'тест1504',
330
+ value: 'тест1504',
331
+ children: [
332
+ {
333
+ label: 'тест',
334
+ value: 'тест1504.тест',
335
+ },
336
+ {
337
+ label: 'тест',
338
+ value: 'тест1504.тест',
339
+ },
340
+ ],
341
+ },
342
+ {
343
+ label: 'testAVV',
344
+ value: 'testAVV',
345
+ children: [],
346
+ },
347
+ {
348
+ label: 'testAVV1',
349
+ value: 'testAVV1',
350
+ children: [],
351
+ },
352
+ {
353
+ label: 'testAVV11',
354
+ value: 'testAVV11',
355
+ children: [
356
+ {
357
+ label: null,
358
+ value: 'testAVV11.null',
359
+ },
360
+ {
361
+ label: null,
362
+ value: 'testAVV11.null',
363
+ },
364
+ {
365
+ label: null,
366
+ value: 'testAVV11.null',
367
+ },
368
+ {
369
+ label: null,
370
+ value: 'testAVV11.null',
371
+ },
372
+ {
373
+ label: null,
374
+ value: 'testAVV11.null',
375
+ },
376
+ {
377
+ label: null,
378
+ value: 'testAVV11.null',
379
+ },
380
+ {
381
+ label: 'test',
382
+ value: 'testAVV11.test',
383
+ },
384
+ {
385
+ label: 'test1',
386
+ value: 'testAVV11.test1',
387
+ },
388
+ ],
389
+ },
390
+ {
391
+ label: 'personDataOld',
392
+ value: 'personDataOld',
393
+ children: [
394
+ {
395
+ label: 'id',
396
+ value: 'personDataOld.id',
397
+ },
398
+ {
399
+ label: 'firstName',
400
+ value: 'personDataOld.firstName',
401
+ },
402
+ {
403
+ label: 'lastName',
404
+ value: 'personDataOld.lastName',
405
+ },
406
+ {
407
+ label: 'middleName',
408
+ value: 'personDataOld.middleName',
409
+ },
410
+ {
411
+ label: 'gender',
412
+ value: 'personDataOld.gender',
413
+ },
414
+ {
415
+ label: 'birthDate',
416
+ value: 'personDataOld.birthDate',
417
+ },
418
+ {
419
+ label: 'citizenshipCountry',
420
+ value: 'personDataOld.citizenshipCountry',
421
+ },
422
+ ],
423
+ },
424
+ {
425
+ label: 'test7',
426
+ value: 'test7',
427
+ children: [],
428
+ },
429
+ {
430
+ label: 'test666',
431
+ value: 'test666',
432
+ children: [],
433
+ },
434
+ {
435
+ label: 'test333',
436
+ value: 'test333',
437
+ children: [
438
+ {
439
+ label: 'test',
440
+ value: 'test333.test',
441
+ },
442
+ {
443
+ label: 'test',
444
+ value: 'test333.test',
445
+ },
446
+ {
447
+ label: 'test123',
448
+ value: 'test333.test123',
449
+ },
450
+ ],
451
+ },
452
+ {
453
+ label: 'test123456',
454
+ value: 'test123456',
455
+ children: [],
456
+ },
457
+ {
458
+ label: 'test12345',
459
+ value: 'test12345',
460
+ children: [],
461
+ },
462
+ {
463
+ label: 'test1234',
464
+ value: 'test1234',
465
+ children: [],
466
+ },
467
+ {
468
+ label: 'test123',
469
+ value: 'test123',
470
+ children: [],
471
+ },
472
+ {
473
+ label: 'fasdfasd',
474
+ value: 'fasdfasd',
475
+ children: [],
476
+ },
477
+ {
478
+ label: 'test',
479
+ value: 'test',
480
+ children: [],
481
+ },
482
+ {
483
+ label: 'const',
484
+ value: 'const',
485
+ children: [
486
+ {
487
+ label: 'T1_companyName',
488
+ value: 'const.T1_companyName',
489
+ },
490
+ {
491
+ label: 'PI',
492
+ value: 'const.PI',
493
+ },
494
+ ],
495
+ },
496
+ {
497
+ label: 'system',
498
+ value: 'system',
499
+ children: [
500
+ {
501
+ label: 'currentDateTime',
502
+ value: 'system.currentDateTime',
503
+ },
504
+ {
505
+ label: 'currentDate',
506
+ value: 'system.currentDate',
507
+ },
508
+ {
509
+ label: 'currentDomain',
510
+ value: 'system.currentDomain',
511
+ },
512
+ {
513
+ label: null,
514
+ value: 'system.null',
515
+ },
516
+ ],
517
+ },
518
+ {
519
+ label: 'kv',
520
+ value: 'kv',
521
+ children: [
522
+ {
523
+ label: 'kv',
524
+ value: 'kv.kv',
525
+ },
526
+ ],
527
+ },
528
+ {
529
+ label: 'orgStructureUser2',
530
+ value: 'orgStructureUser2',
531
+ children: [
532
+ {
533
+ label: 'name1',
534
+ value: 'orgStructureUser2.name1',
535
+ },
536
+ {
537
+ label: 'name2',
538
+ value: 'orgStructureUser2.name2',
539
+ },
540
+ ],
541
+ },
542
+ {
543
+ label: 'personObject',
544
+ value: 'personObject',
545
+ children: [
546
+ {
547
+ label: 'birthDate',
548
+ value: 'personObject.birthDate',
549
+ },
550
+ {
551
+ label: 'middleName',
552
+ value: 'personObject.middleName',
553
+ },
554
+ {
555
+ label: 'gender',
556
+ value: 'personObject.gender',
557
+ },
558
+ {
559
+ label: 'citizenshipCountry',
560
+ value: 'personObject.citizenshipCountry',
561
+ },
562
+ {
563
+ label: 'id',
564
+ value: 'personObject.id',
565
+ },
566
+ {
567
+ label: 'firstName',
568
+ value: 'personObject.firstName',
569
+ },
570
+ {
571
+ label: 'status',
572
+ value: 'personObject.status',
573
+ },
574
+ {
575
+ label: 'lastName',
576
+ value: 'personObject.lastName',
577
+ },
578
+ ],
579
+ },
580
+ {
581
+ label: 'orgStructureUser3',
582
+ value: 'orgStructureUser3',
583
+ children: [
584
+ {
585
+ label: 'name3',
586
+ value: 'orgStructureUser3.name3',
587
+ },
588
+ {
589
+ label: 'name4',
590
+ value: 'orgStructureUser3.name4',
591
+ },
592
+ ],
593
+ },
594
+ {
595
+ label: 'collClient',
596
+ value: 'collClient',
597
+ children: [
598
+ {
599
+ label: 'lastName',
600
+ value: 'collClient.lastName',
601
+ },
602
+ {
603
+ label: 'firstName',
604
+ value: 'collClient.firstName',
605
+ },
606
+ {
607
+ label: 'test',
608
+ value: 'collClient.test',
609
+ },
610
+ ],
611
+ },
612
+ {
613
+ label: 'test13',
614
+ value: 'test13',
615
+ children: [],
616
+ },
617
+ {
618
+ label: 'test12',
619
+ value: 'test12',
620
+ children: [],
621
+ },
622
+ {
623
+ label: 'opportunity',
624
+ value: 'opportunity',
625
+ children: [
626
+ {
627
+ label: 'id',
628
+ value: 'opportunity.id',
629
+ },
630
+ {
631
+ label: 'name',
632
+ value: 'opportunity.name',
633
+ },
634
+ {
635
+ label: 'companyName',
636
+ value: 'opportunity.companyName',
637
+ },
638
+ {
639
+ label: 'companyShortName',
640
+ value: 'opportunity.companyShortName',
641
+ },
642
+ {
643
+ label: 'initiatorId',
644
+ value: 'opportunity.initiatorId',
645
+ },
646
+ {
647
+ label: 'initiatorName',
648
+ value: 'opportunity.initiatorName',
649
+ },
650
+ ],
651
+ },
652
+ {
653
+ label: 'contract',
654
+ value: 'contract',
655
+ children: [
656
+ {
657
+ label: 'id',
658
+ value: 'contract.id',
659
+ },
660
+ {
661
+ label: 'name',
662
+ value: 'contract.name',
663
+ },
664
+ {
665
+ label: 'number',
666
+ value: 'contract.number',
667
+ },
668
+ {
669
+ label: 'officialName',
670
+ value: 'contract.officialName',
671
+ },
672
+ {
673
+ label: 'shortName',
674
+ value: 'contract.shortName',
675
+ },
676
+ {
677
+ label: 'managerFirstName',
678
+ value: 'contract.managerFirstName',
679
+ },
680
+ {
681
+ label: 'managerLastName',
682
+ value: 'contract.managerLastName',
683
+ },
684
+ {
685
+ label: 'managerMiddleName',
686
+ value: 'contract.managerMiddleName',
687
+ },
688
+ ],
689
+ },
690
+ {
691
+ label: 'test15',
692
+ value: 'test15',
693
+ children: [
694
+ {
695
+ label: 'name5',
696
+ value: 'test15.name5',
697
+ },
698
+ {
699
+ label: 'name6',
700
+ value: 'test15.name6',
701
+ },
702
+ ],
703
+ },
704
+ {
705
+ label: 'test16',
706
+ value: 'test16',
707
+ children: [
708
+ {
709
+ label: 'name7',
710
+ value: 'test16.name7',
711
+ },
712
+ {
713
+ label: 'name8',
714
+ value: 'test16.name8',
715
+ },
716
+ {
717
+ label: 'test',
718
+ value: 'test16.test',
719
+ },
720
+ {
721
+ label: null,
722
+ value: 'test16.null',
723
+ },
724
+ ],
725
+ },
726
+ {
727
+ label: 'orgStructureOrg',
728
+ value: 'orgStructureOrg',
729
+ children: [
730
+ {
731
+ label: 'id',
732
+ value: 'orgStructureOrg.id',
733
+ },
734
+ {
735
+ label: 'name',
736
+ value: 'orgStructureOrg.name',
737
+ },
738
+ ],
739
+ },
740
+ {
741
+ label: 'orgStructurePosition',
742
+ value: 'orgStructurePosition',
743
+ children: [
744
+ {
745
+ label: 'id',
746
+ value: 'orgStructurePosition.id',
747
+ },
748
+ {
749
+ label: 'name',
750
+ value: 'orgStructurePosition.name',
751
+ },
752
+ {
753
+ label: 'type',
754
+ value: 'orgStructurePosition.type',
755
+ },
756
+ ],
757
+ },
758
+ {
759
+ label: 'orgStructureUser',
760
+ value: 'orgStructureUser',
761
+ children: [
762
+ {
763
+ label: 'id',
764
+ value: 'orgStructureUser.id',
765
+ },
766
+ {
767
+ label: 'firstName',
768
+ value: 'orgStructureUser.firstName',
769
+ },
770
+ {
771
+ label: 'lastName',
772
+ value: 'orgStructureUser.lastName',
773
+ },
774
+ {
775
+ label: 'middleName',
776
+ value: 'orgStructureUser.middleName',
777
+ },
778
+ {
779
+ label: 'fullName',
780
+ value: 'orgStructureUser.fullName',
781
+ },
782
+ ],
783
+ },
784
+ ],
785
+ },
786
+ ],
787
+ },
788
+ },
789
+ };
790
+
791
+ async function init() {
792
+ // const response = await fetch("./key.txt");
793
+ // const key = await response.text();
794
+ const instance = await emailmaker.init({ ...options });
795
+ // let i = 0;
796
+ // let id = 0;
797
+ // setInterval(() => {
798
+ // i = i === 0 ? 1 : 0;
799
+ // instance.show({
800
+ // ...options.content,
801
+ // email: {
802
+ // ...options.content.email,
803
+ // // id: id++,
804
+ // code: '<div>31111111111111111111111111</div>'
805
+ // }
806
+
807
+ // });
808
+ // }, 30000);
809
+ instance.handleSaveEmail(async ({ value, patch, prev }) => {
810
+ const _email = await instance.compileEmail(value);
811
+ console.log(_email);
812
+ _email.utm_parameters = { ..._email.utm_parameters, utm_content: '333' };
813
+ const a = await instance.compileEmail(_email);
814
+ console.log(a);
815
+ });
816
+ instance.handleEmailAutosave(() => {
817
+ console.log('handleEmailAutosave 2');
818
+ });
819
+ instance.setConfig({
820
+ ...options.config,
821
+ mergeTags: {
822
+ syntax: ['{{%value%}}'],
823
+ items: [
824
+ {
825
+ label: 'Системные3131',
826
+ value: 'System',
827
+ children: systemfields,
828
+ },
829
+ {
830
+ label: 'Пользовательские4444',
831
+ value: 'User',
832
+ children: systemfields,
833
+ },
834
+ ],
835
+ },
836
+ });
837
+ instance.handleLimitUsage(({ name, count }) => {
838
+ console.log('Вы превысили количество допустимых сообщений в чат с AI');
839
+ console.log(name, count);
840
+ });
841
+ // await instance.show({
842
+ // email: {
843
+ // "id": "3769995",
844
+ // "isNew": false,
845
+ // "subject": "topic1Ы",
846
+ // "preheader": "pre",
847
+ // "description": "",
848
+ // "project": "undefined",
849
+ // "parent_email": "309707",
850
+ // "common_styles": "{\"text\":{\"fontFamily\":[\"Safe Fonts\",\"-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif\"],\"fontSize\":16,\"fontSizeDim\":\"px\",\"lineHeight\":21,\"lineHeightDim\":\"px\",\"color\":\"#5a5a5a\",\"textAlign\":\"left\",\"paddingBottom\":10,\"paddingBottomDim\":\"px\"},\"headings\":{\"fontFamily\":[\"Safe Fonts\",\"-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif\"],\"fontSize\":24,\"fontSizeDim\":\"px\",\"lineHeight\":32,\"lineHeightDim\":\"px\",\"color\":\"#333333\",\"textAlign\":\"left\",\"paddingTop\":20,\"paddingTopDim\":\"px\",\"paddingBottom\":10,\"paddingBottomDim\":\"px\",\"letterSpacing\":0,\"letterSpacingDim\":\"px\",\"bold\":true,\"italic\":false},\"links\":{\"color\":\"#1C52DC\",\"underline\":true},\"buttons\":{\"fontFamily\":[\"Safe Fonts\",\"-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif\"],\"fontSize\":16,\"fontSizeDim\":\"px\",\"letterSpacing\":0,\"letterSpacingDim\":\"px\",\"color\":\"#FFFFFF\",\"bold\":false,\"italic\":false,\"backgroundColor\":\"#1C52DC\",\"marginTop\":10,\"marginTopDim\":\"px\",\"marginBottom\":10,\"marginBottomDim\":\"px\",\"border\":{\"all\":null,\"top\":null,\"right\":null,\"bottom\":null,\"left\":null},\"borderRadius\":{\"all\":5,\"topLeft\":null,\"topRight\":null,\"bottomRight\":null,\"bottomLeft\":null},\"textAlign\":\"center\",\"padding\":{\"all\":null,\"top\":null,\"right\":null,\"bottom\":null,\"left\":null}},\"block\":{\"backgroundColor\":\"\"}}",
851
+ // "title": "",
852
+ // "date": "2024-01-12T08:42:09",
853
+ // "modified": "2024-02-16T17:21:01",
854
+ // "group": [],
855
+ // "lock": false,
856
+ // "code": "<html><head></head><body><body></html>",
857
+ // }
858
+ // });
859
+ // const email = await instance.getEmail();
860
+
861
+ // const TITLE_REGEX = /<title>(.*)<\/title>/gm;
862
+ // console.log(email.code);
863
+ // email.code.matchAll(TITLE_REGEX).map(item => item[1]).find(title => console.log(title));
864
+ }
865
+
866
+ init()
867
+ .then((e) => {})
868
+ .catch((e) => console.log(e));
869
+ // })</script></body></html>