useblocks 1.0.111 → 1.0.114
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/CHANGELOG.en.md +11 -0
- package/CHANGELOG.md +11 -0
- package/README.md +125 -100
- package/asset-manifest.json +204 -197
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/css/sandbox-darktheme.css +23 -7
- package/iframe/css/sandbox.css +24 -12
- package/iframe/iframe-eblock.5346cae33cc3cae425f5.html +1 -0
- package/iframe/iframe.5346cae33cc3cae425f5.html +1 -0
- package/iframe/index.html +1 -1
- package/iframe/js/525.98bd9c02.js +1 -0
- package/iframe/js/667.99ef2e89.js +1 -0
- package/iframe/js/882.6b0a7986.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/js/amplitude.min.js +8 -10
- package/js/browser-image-compression.js +3054 -1
- package/js/sourcebuster.min.js +0 -1
- package/package.json +1 -1
- package/static/css/{8778.3f22f159.chunk.css → 2557.2ede4a53.chunk.css} +2 -2
- package/static/css/6310.9ddbf524.chunk.css +2 -0
- package/static/css/9617.12b6bf39.chunk.css +2 -0
- package/static/css/main.644247c3.css +2 -0
- package/static/js/1241.e3e56034.js +2 -0
- package/static/js/1330.ef930318.js +2 -0
- package/static/js/1332.0cb959b4.js +2 -0
- package/static/js/1377.2c61acc1.js +2 -0
- package/static/js/1454.84d2c0a8.js +2 -0
- package/static/js/1502.8a2f6e6b.js +2 -0
- package/static/js/1510.e74cce46.js +2 -0
- package/static/js/1626.3320a5f3.js +2 -0
- package/static/js/1640.27be7178.js +2 -0
- package/static/js/1788.d2bc729b.js +2 -0
- package/static/js/{1807.edd17ae4.js → 1807.2f873ba8.js} +3 -3
- package/static/js/1872.43ec6943.js +2 -0
- package/static/js/{1902.b8ea2bf6.js → 1902.7b351f26.js} +2 -2
- package/static/js/{1940.e8374763.js → 1940.f13d2898.js} +3 -3
- package/static/js/197.6d76c202.js +2 -0
- package/static/js/2066.c62582aa.js +2 -0
- package/static/js/2114.e385ca42.js +2 -0
- package/static/js/2139.775a0a57.js +3 -0
- package/static/js/2248.39c53056.js +2 -0
- package/static/js/2336.4fc241a6.js +2 -0
- package/static/js/2408.c5572548.js +2 -0
- package/static/js/2438.712814b0.js +2 -0
- package/static/js/2557.663778e1.js +2 -0
- package/static/js/2827.36a23b69.js +2 -0
- package/static/js/284.efb80df6.js +2 -0
- package/static/js/2844.54191136.js +2 -0
- package/static/js/290.b615a90b.js +2 -0
- package/static/js/2917.a6e819bf.js +2 -0
- package/static/js/2988.2496986e.js +2 -0
- package/static/js/327.31ca6e0d.js +3 -0
- package/static/js/327.31ca6e0d.js.LICENSE.txt +29 -0
- package/static/js/3302.84e32b62.js +2 -0
- package/static/js/3411.311c6ae0.js +2 -0
- package/static/js/3624.c30f383e.js +2 -0
- package/static/js/3628.578b9a71.js +3 -0
- package/static/js/3711.102a68ee.js +2 -0
- package/static/js/3816.8f941c79.js +2 -0
- package/static/js/3914.72124e24.js +2 -0
- package/static/js/426.ad870198.js +3 -0
- package/static/js/426.ad870198.js.LICENSE.txt +163 -0
- package/static/js/4425.47aa4461.js +2 -0
- package/static/js/4607.f88cf27a.js +2 -0
- package/static/js/4686.180d7a12.js +2 -0
- package/static/js/4702.eb86f466.js +2 -0
- package/static/js/4813.b282e8cb.js +2 -0
- package/static/js/4823.ddb0914d.js +2 -0
- package/static/js/494.447cdadd.js +2 -0
- package/static/js/5108.b3eccf14.js +2 -0
- package/static/js/5261.8499aaa1.js +2 -0
- package/static/js/5266.8ab2e97a.js +3 -0
- package/static/js/5266.8ab2e97a.js.LICENSE.txt +20 -0
- package/static/js/5322.413feb5a.js +2 -0
- package/static/js/5432.a1089dad.js +2 -0
- package/static/js/5466.50904f4e.js +2 -0
- package/static/js/5641.7f2999ab.js +3 -0
- package/static/js/{3080.353033ae.js.LICENSE.txt → 5641.7f2999ab.js.LICENSE.txt} +0 -9
- package/static/js/5653.016de6aa.js +2 -0
- package/static/js/5827.9dcc9443.js +2 -0
- package/static/js/5862.faad8f74.js +2 -0
- package/static/js/5864.6033ee51.js +2 -0
- package/static/js/5902.33cce976.js +2 -0
- package/static/js/5980.d73d6b51.js +2 -0
- package/static/js/6033.eb6097f0.js +2 -0
- package/static/js/6135.3b810692.js +2 -0
- package/static/js/6310.e0dfd60e.js +2 -0
- package/static/js/6418.59058d0d.js +2 -0
- package/static/js/6428.57a30f96.js +2 -0
- package/static/js/6552.271c84f5.js +2 -0
- package/static/js/6618.feb19bcb.js +2 -0
- package/static/js/6764.2a43d6d5.js +2 -0
- package/static/js/6832.2e6f8499.js +2 -0
- package/static/js/7288.efae06f4.js +2 -0
- package/static/js/737.b395c2b2.js +2 -0
- package/static/js/7426.1de30709.js +2 -0
- package/static/js/7673.2db4eeee.js +3 -0
- package/static/js/{5255.9c7c7b3d.js.LICENSE.txt → 7673.2db4eeee.js.LICENSE.txt} +9 -0
- package/static/js/77.9fcf0459.js +2 -0
- package/static/js/7974.db4992e0.js +2 -0
- package/static/js/8181.401f77cb.js +2 -0
- package/static/js/8363.bf7fae8b.js +2 -0
- package/static/js/8466.d3339ec9.js +2 -0
- package/static/js/8534.a012d026.js +2 -0
- package/static/js/8580.05b41c79.js +2 -0
- package/static/js/8590.3e646adc.js +2 -0
- package/static/js/8682.b39ae089.js +2 -0
- package/static/js/8796.27f3a38e.js +2 -0
- package/static/js/8839.75fb5ef2.js +2 -0
- package/static/js/912.e406cb4c.js +3 -0
- package/static/js/9169.a1d48107.js +2 -0
- package/static/js/9200.f1b7e119.js +2 -0
- package/static/js/9487.6209c75a.js +3 -0
- package/static/js/9487.6209c75a.js.LICENSE.txt +24 -0
- package/static/js/9508.4fb40b12.js +2 -0
- package/static/js/9617.eabdb986.js +3 -0
- package/static/js/9716.e99deec1.js +2 -0
- package/static/js/{useblocks_core.3f3f7e7e.js → useblocks_core.e69f8dfd.js} +3 -3
- package/useblocks-esm.js +1 -1
- package/useblocks.d.ts +7 -0
- package/useblocks.js +1 -1
- package/iframe/iframe-eblock.7b382310c122b86eff21.html +0 -1
- package/iframe/iframe.7b382310c122b86eff21.html +0 -1
- package/iframe/js/174.62b19abc.js +0 -1
- package/iframe/js/525.c01787e6.js +0 -1
- package/iframe/js/882.4eca7796.js +0 -1
- package/static/css/3934.8026f9d8.chunk.css +0 -2
- package/static/css/6310.ce3b451b.chunk.css +0 -2
- package/static/css/main.6dff3bf8.css +0 -2
- package/static/js/1157.1e6829d5.js +0 -3
- package/static/js/1157.1e6829d5.js.LICENSE.txt +0 -9
- package/static/js/1241.9f7c977b.js +0 -2
- package/static/js/1330.607183c7.js +0 -2
- package/static/js/1332.3eba834b.js +0 -2
- package/static/js/1377.b486b1f4.js +0 -2
- package/static/js/1454.23356a65.js +0 -2
- package/static/js/1502.6be06fc7.js +0 -2
- package/static/js/1510.32a77efc.js +0 -2
- package/static/js/1626.0cd4dd3f.js +0 -2
- package/static/js/1640.7ae88653.js +0 -2
- package/static/js/1788.e7e85733.js +0 -2
- package/static/js/1872.610556e1.js +0 -2
- package/static/js/197.64f9fd6b.js +0 -2
- package/static/js/2066.a4cfddd1.js +0 -2
- package/static/js/2114.dff67863.js +0 -2
- package/static/js/2139.fe670ca3.js +0 -3
- package/static/js/2248.364643d4.js +0 -2
- package/static/js/2408.8dcea713.js +0 -2
- package/static/js/2438.02617e55.js +0 -2
- package/static/js/2827.e02551c9.js +0 -2
- package/static/js/284.89002158.js +0 -2
- package/static/js/2844.4c02df45.js +0 -2
- package/static/js/290.3b771060.js +0 -2
- package/static/js/2917.f75d7ce1.js +0 -2
- package/static/js/2988.6d43f35a.js +0 -2
- package/static/js/3080.353033ae.js +0 -3
- package/static/js/3302.9b320bc9.js +0 -2
- package/static/js/3411.69f4008b.js +0 -2
- package/static/js/3624.a7076f34.js +0 -2
- package/static/js/3628.d51bff41.js +0 -3
- package/static/js/3711.d621dbad.js +0 -2
- package/static/js/3816.bf684fe1.js +0 -2
- package/static/js/3914.c63f1b85.js +0 -2
- package/static/js/3934.1b72968b.js +0 -3
- package/static/js/4301.5da300dd.js +0 -2
- package/static/js/4425.39579a63.js +0 -2
- package/static/js/4607.25f2d561.js +0 -2
- package/static/js/4686.6a800b56.js +0 -2
- package/static/js/4702.de98cbd5.js +0 -2
- package/static/js/4813.ca2fe39e.js +0 -2
- package/static/js/4823.d4ba65be.js +0 -2
- package/static/js/4875.9b1d5dc8.js +0 -3
- package/static/js/4875.9b1d5dc8.js.LICENSE.txt +0 -40
- package/static/js/494.87c48e86.js +0 -2
- package/static/js/5108.473a7fe1.js +0 -2
- package/static/js/5255.9c7c7b3d.js +0 -3
- package/static/js/5261.3e64116f.js +0 -2
- package/static/js/5322.ce259c32.js +0 -2
- package/static/js/5466.a0f769cb.js +0 -2
- package/static/js/5612.37f3811e.js +0 -3
- package/static/js/5612.37f3811e.js.LICENSE.txt +0 -30
- package/static/js/5653.5f06277c.js +0 -2
- package/static/js/5800.c5dc1c76.js +0 -3
- package/static/js/5827.6555a26a.js +0 -2
- package/static/js/5862.225d9aac.js +0 -2
- package/static/js/5864.340bc721.js +0 -2
- package/static/js/5902.73cb2cc4.js +0 -2
- package/static/js/5980.fbc691ed.js +0 -2
- package/static/js/6033.71847c1c.js +0 -2
- package/static/js/6135.ceb22131.js +0 -2
- package/static/js/6310.b62546f1.js +0 -2
- package/static/js/6418.5c3bf780.js +0 -2
- package/static/js/6428.8b233458.js +0 -2
- package/static/js/6552.9d811323.js +0 -2
- package/static/js/6618.8866f1fa.js +0 -2
- package/static/js/6764.9e4a7f5f.js +0 -2
- package/static/js/6832.4c4f3da7.js +0 -2
- package/static/js/7288.170ea51b.js +0 -2
- package/static/js/737.fae14b35.js +0 -2
- package/static/js/7426.eaa2cbe4.js +0 -2
- package/static/js/77.6ea8ad5d.js +0 -2
- package/static/js/7974.5b71f208.js +0 -2
- package/static/js/8081.95779f5d.js +0 -2
- package/static/js/8466.ae622785.js +0 -2
- package/static/js/8534.10b79ff1.js +0 -2
- package/static/js/8580.4a5c4223.js +0 -2
- package/static/js/8590.2779de33.js +0 -2
- package/static/js/8682.ec99bbfe.js +0 -2
- package/static/js/8778.37afb80d.js +0 -2
- package/static/js/8796.a6838d71.js +0 -2
- package/static/js/8839.25cace14.js +0 -2
- package/static/js/9169.dee65ca6.js +0 -2
- package/static/js/9200.63433716.js +0 -2
- package/static/js/9508.a68ced7b.js +0 -2
- package/static/js/9716.fb4af6bc.js +0 -2
- package/static/media/icon-border-radius.2a56b93a7711558098a622296b7ae2e1.svg +0 -1
- package/static/media/icon-create-block.0b077f4000bf7907b9ea871d28c7fb1e.svg +0 -1
- /package/iframe/js/{525.c01787e6.js.LICENSE.txt → 525.98bd9c02.js.LICENSE.txt} +0 -0
- /package/iframe/js/{174.62b19abc.js.LICENSE.txt → 667.99ef2e89.js.LICENSE.txt} +0 -0
- /package/iframe/js/{882.4eca7796.js.LICENSE.txt → 882.6b0a7986.js.LICENSE.txt} +0 -0
- /package/static/js/{1807.edd17ae4.js.LICENSE.txt → 1807.2f873ba8.js.LICENSE.txt} +0 -0
- /package/static/js/{1940.e8374763.js.LICENSE.txt → 1940.f13d2898.js.LICENSE.txt} +0 -0
- /package/static/js/{2139.fe670ca3.js.LICENSE.txt → 2139.775a0a57.js.LICENSE.txt} +0 -0
- /package/static/js/{3628.d51bff41.js.LICENSE.txt → 3628.578b9a71.js.LICENSE.txt} +0 -0
- /package/static/js/{3934.1b72968b.js.LICENSE.txt → 912.e406cb4c.js.LICENSE.txt} +0 -0
- /package/static/js/{5800.c5dc1c76.js.LICENSE.txt → 9617.eabdb986.js.LICENSE.txt} +0 -0
- /package/static/js/{useblocks_core.3f3f7e7e.js.LICENSE.txt → useblocks_core.e69f8dfd.js.LICENSE.txt} +0 -0
package/CHANGELOG.en.md
CHANGED
|
@@ -64,10 +64,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
64
64
|
### Added
|
|
65
65
|
|
|
66
66
|
**Integrations:**
|
|
67
|
+
|
|
67
68
|
- Unisender integration and settings management
|
|
68
69
|
- App-specific integration availability system
|
|
69
70
|
|
|
70
71
|
**Editor:**
|
|
72
|
+
|
|
71
73
|
- Free plan restrictions in ButtonsEmail component
|
|
72
74
|
- mailto link support (subject, body) — DEV-13102
|
|
73
75
|
- Mass blocks functionality
|
|
@@ -75,29 +77,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
75
77
|
- Insert link with correct color — DEV-13172
|
|
76
78
|
|
|
77
79
|
**AI & UX:**
|
|
80
|
+
|
|
78
81
|
- AI functionality in EmailPageHeader with payment verification
|
|
79
82
|
- Improved modal animations
|
|
80
83
|
|
|
81
84
|
**FileManager:**
|
|
85
|
+
|
|
82
86
|
- Support for custom names when copying files and folders
|
|
83
87
|
- Cache clearing
|
|
84
88
|
|
|
85
89
|
### Fixed
|
|
86
90
|
|
|
87
91
|
**Table Editor:**
|
|
92
|
+
|
|
88
93
|
- Dropdown menu layout for Table element — DEV-13370
|
|
89
94
|
- Table editor functionality — DEV-13371
|
|
90
95
|
|
|
91
96
|
**Paste & Links:**
|
|
97
|
+
|
|
92
98
|
- Tag duplication when pasting text — DEV-13293
|
|
93
99
|
- Link duplication when pasting — DEV-13378
|
|
94
100
|
|
|
95
101
|
**Elements:**
|
|
102
|
+
|
|
96
103
|
- Adding Button element to email — DEV-13312
|
|
97
104
|
- Incorrect marker settings display — DEV-13313
|
|
98
105
|
- Line break restriction for notifications — DEV-13143
|
|
99
106
|
|
|
100
107
|
**Data & API:**
|
|
108
|
+
|
|
101
109
|
- Tag and group changes when sending email data — DEV-10189
|
|
102
110
|
- Recurring payment calculation with `is_only_first_period` — DEV-13377
|
|
103
111
|
- Notification on test email send error
|
|
@@ -107,6 +115,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
107
115
|
### Changed
|
|
108
116
|
|
|
109
117
|
**sandbox.js → TypeScript Refactoring:**
|
|
118
|
+
|
|
110
119
|
- Migration to modular structure with types and centralized state
|
|
111
120
|
- Modules for mouse, keyboard, and drag-and-drop event handling
|
|
112
121
|
- Element settings handlers (links, variables, padding)
|
|
@@ -114,10 +123,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
114
123
|
- Utilities for text formatting, styles, and VML
|
|
115
124
|
|
|
116
125
|
**Integrations:**
|
|
126
|
+
|
|
117
127
|
- IntegrationSettings renamed to IntegrationSettingsData
|
|
118
128
|
- Unisender integration migrated to flexible structure
|
|
119
129
|
|
|
120
130
|
**UI:**
|
|
131
|
+
|
|
121
132
|
- Updated layout for BlocksTable and EmailsTable
|
|
122
133
|
- Improved checkbox styles in tables
|
|
123
134
|
|
package/CHANGELOG.md
CHANGED
|
@@ -59,10 +59,12 @@
|
|
|
59
59
|
### Добавлено
|
|
60
60
|
|
|
61
61
|
**Интеграции:**
|
|
62
|
+
|
|
62
63
|
- Интеграция с Unisender и управление настройками
|
|
63
64
|
- Система доступности интеграций для конкретных приложений
|
|
64
65
|
|
|
65
66
|
**Редактор:**
|
|
67
|
+
|
|
66
68
|
- Ограничения для бесплатного плана в компоненте ButtonsEmail
|
|
67
69
|
- Поддержка mailto ссылок (subject, body) — DEV-13102
|
|
68
70
|
- Функциональность массовых блоков
|
|
@@ -70,29 +72,35 @@
|
|
|
70
72
|
- Вставка ссылки с нужным цветом — DEV-13172
|
|
71
73
|
|
|
72
74
|
**AI и UX:**
|
|
75
|
+
|
|
73
76
|
- AI-функциональность в EmailPageHeader с проверкой оплаты
|
|
74
77
|
- Улучшенные анимации модальных окон
|
|
75
78
|
|
|
76
79
|
**FileManager:**
|
|
80
|
+
|
|
77
81
|
- Поддержка задания нового имени при копировании файлов и папок
|
|
78
82
|
- Очистка кеша
|
|
79
83
|
|
|
80
84
|
### Исправлено
|
|
81
85
|
|
|
82
86
|
**Редактор таблиц:**
|
|
87
|
+
|
|
83
88
|
- Вёрстка выпадающего меню элемента Таблица — DEV-13370
|
|
84
89
|
- Работа редактора таблиц — DEV-13371
|
|
85
90
|
|
|
86
91
|
**Вставка и ссылки:**
|
|
92
|
+
|
|
87
93
|
- Дублирование тегов при вставке текста — DEV-13293
|
|
88
94
|
- Дублирование ссылок при вставке — DEV-13378
|
|
89
95
|
|
|
90
96
|
**Элементы:**
|
|
97
|
+
|
|
91
98
|
- Добавление элемента Кнопка в письмо — DEV-13312
|
|
92
99
|
- Некорректное отображение настроек маркеров — DEV-13313
|
|
93
100
|
- Запрет переноса строки для уведомления — DEV-13143
|
|
94
101
|
|
|
95
102
|
**Данные и API:**
|
|
103
|
+
|
|
96
104
|
- Изменения тегов и групп при отправке данных письма — DEV-10189
|
|
97
105
|
- Расчёт суммы рекуррентного платежа с `is_only_first_period` — DEV-13377
|
|
98
106
|
- Уведомление при ошибке отправки тестового письма
|
|
@@ -102,6 +110,7 @@
|
|
|
102
110
|
### Изменено
|
|
103
111
|
|
|
104
112
|
**Рефакторинг sandbox.js → TypeScript:**
|
|
113
|
+
|
|
105
114
|
- Миграция на модульную структуру с типами и централизованным состоянием
|
|
106
115
|
- Модули для обработки событий мыши, клавиатуры, drag-and-drop
|
|
107
116
|
- Обработчики настроек элементов (ссылки, переменные, отступы)
|
|
@@ -109,10 +118,12 @@
|
|
|
109
118
|
- Утилиты для текстового форматирования, стилей и VML
|
|
110
119
|
|
|
111
120
|
**Интеграции:**
|
|
121
|
+
|
|
112
122
|
- IntegrationSettings переименован в IntegrationSettingsData
|
|
113
123
|
- Unisender интеграция мигрирована на гибкую структуру
|
|
114
124
|
|
|
115
125
|
**UI:**
|
|
126
|
+
|
|
116
127
|
- Обновлён layout для BlocksTable и EmailsTable
|
|
117
128
|
- Улучшены стили чекбоксов в таблицах
|
|
118
129
|
|
package/README.md
CHANGED
|
@@ -1,43 +1,57 @@
|
|
|
1
1
|
# Installation
|
|
2
|
+
|
|
2
3
|
Run this code in the command prompt:
|
|
3
4
|
|
|
4
5
|
```cmd
|
|
5
|
-
$ npm i useblocks@1.0.
|
|
6
|
+
$ npm i useblocks@1.0.114 -save
|
|
6
7
|
```
|
|
7
8
|
|
|
8
9
|
Add the Blocks plugin to your App config.
|
|
10
|
+
|
|
9
11
|
### For the Webpack module bundler
|
|
12
|
+
|
|
10
13
|
Package import:
|
|
14
|
+
|
|
11
15
|
```javascript
|
|
12
|
-
const useblocksPlugin = require('useblocks/webpack')
|
|
16
|
+
const useblocksPlugin = require('useblocks/webpack');
|
|
13
17
|
```
|
|
18
|
+
|
|
14
19
|
Defining the package in the app:
|
|
20
|
+
|
|
15
21
|
```javascript
|
|
16
22
|
module.exports = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]
|
|
20
|
-
}
|
|
23
|
+
plugins: [new UseblocksWebpackPlugin()],
|
|
24
|
+
};
|
|
21
25
|
```
|
|
26
|
+
|
|
22
27
|
### For the Vite module bundler
|
|
28
|
+
|
|
23
29
|
Package import:
|
|
30
|
+
|
|
24
31
|
```javascript
|
|
25
|
-
import useblocksPlugin from 'useblocks/vite'
|
|
32
|
+
import useblocksPlugin from 'useblocks/vite';
|
|
26
33
|
```
|
|
34
|
+
|
|
27
35
|
Defining the package in the app:
|
|
36
|
+
|
|
28
37
|
```javascript
|
|
29
38
|
export default defineConfig({
|
|
30
|
-
|
|
31
|
-
})
|
|
39
|
+
plugins: [useblocksPlugin()],
|
|
40
|
+
});
|
|
32
41
|
```
|
|
42
|
+
|
|
33
43
|
# Initialization
|
|
44
|
+
|
|
34
45
|
Import the Blocks plugin into your component:
|
|
46
|
+
|
|
35
47
|
```javascript
|
|
36
|
-
import * as useblocks from
|
|
48
|
+
import * as useblocks from 'useblocks';
|
|
37
49
|
```
|
|
50
|
+
|
|
38
51
|
The Plugin configuration contains a parameter named `getAuthToken`. For authorization, you must pass the application's OAuth token to its value. For debugging purposes, the dev version of the plugin supports a mechanism for obtaining a token from the front of the application. To use this mechanism you need first to define auth-proxy in AppConfig:
|
|
39
52
|
|
|
40
53
|
### Fetching the OAuth token on the backend
|
|
54
|
+
|
|
41
55
|
```javascript
|
|
42
56
|
curl --location 'https://api.useblocks.io/oauth/token' \
|
|
43
57
|
--header 'Content-Type: application/x-www-form-urlencoded' \
|
|
@@ -47,26 +61,33 @@ curl --location 'https://api.useblocks.io/oauth/token' \
|
|
|
47
61
|
```
|
|
48
62
|
|
|
49
63
|
### Creating the Blocks plugin entity
|
|
64
|
+
|
|
50
65
|
```javascript
|
|
51
|
-
useblocks
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
useblocks
|
|
67
|
+
.init({
|
|
68
|
+
getAuthToken: getAuthToken,
|
|
69
|
+
element: '#test',
|
|
70
|
+
content: {
|
|
71
|
+
title: 'Email subject',
|
|
72
|
+
html: 'EMAIL_CODE',
|
|
73
|
+
},
|
|
74
|
+
config: {},
|
|
75
|
+
})
|
|
76
|
+
.then((instance) => {});
|
|
60
77
|
```
|
|
78
|
+
|
|
61
79
|
You can get the EMAIL_CODE from <a href="https://cdn.useblocks.io/plugin/new-email.html" target="_blank">our example</a> or paste the HTML code of your own email
|
|
62
80
|
|
|
63
81
|
# Configuration
|
|
82
|
+
|
|
64
83
|
Plugin configuration is JSON with several nesting levels. In the config you can set the appearance, content, and the logic the plugin will work with.
|
|
65
84
|
|
|
66
85
|
### Element
|
|
86
|
+
|
|
67
87
|
You can send the `element` line into the plugin configuration. It is a DOM element selector and you need to initiate the plugin inside of it. If the element is not defined, the app will run in the background mode.
|
|
68
88
|
|
|
69
89
|
### Content
|
|
90
|
+
|
|
70
91
|
The `content` section contains parameters of an email that must be displayed in the editor. This is what can be sent to this parameter:
|
|
71
92
|
|
|
72
93
|
#### {string}
|
|
@@ -74,6 +95,7 @@ The `content` section contains parameters of an email that must be displayed in
|
|
|
74
95
|
HTML code of an email.
|
|
75
96
|
|
|
76
97
|
#### {object} email options
|
|
98
|
+
|
|
77
99
|
```javascript
|
|
78
100
|
{
|
|
79
101
|
id?: string; // A unique ID of a project in your system.
|
|
@@ -85,6 +107,7 @@ HTML code of an email.
|
|
|
85
107
|
```
|
|
86
108
|
|
|
87
109
|
#### {object} full description
|
|
110
|
+
|
|
88
111
|
```javascript
|
|
89
112
|
{
|
|
90
113
|
temlateId?: string; // Email template ID in Blocks.
|
|
@@ -96,8 +119,10 @@ HTML code of an email.
|
|
|
96
119
|
|
|
97
120
|
You can change the content at any moment after the initialization with the help of the `instance.show(content)` method.
|
|
98
121
|
|
|
99
|
-
### Config
|
|
122
|
+
### Config
|
|
123
|
+
|
|
100
124
|
This section is dedicated to setting the appearance and settings of the editor. You can change the configuration of this section after the initialization with the help of `useblocks.setConfig` or `useblocks.updateConfig`.
|
|
125
|
+
|
|
101
126
|
##### The list of parameters of the config section
|
|
102
127
|
| Parameter | Description | Default |
|
|
103
128
|
| ---------------------- | --------------------------------- | ------- |
|
|
@@ -236,11 +261,12 @@ This section is dedicated to setting the appearance and settings of the editor.
|
|
|
236
261
|
| imageCenterEditorEnabled | Image editor tab. | true |
|
|
237
262
|
| compressMaxSize | Max image size after optimization, MB. | true |
|
|
238
263
|
| compressMaxWidthOrHeight | Max image width after optimization, px. | true |
|
|
239
|
-
|
|
240
264
|
### Events
|
|
265
|
+
|
|
241
266
|
Events can be sent to configurations or added to them later while working with the instance of the plugin. All event subscribers can be asynchronous features.
|
|
242
267
|
|
|
243
|
-
#### Example
|
|
268
|
+
#### Example
|
|
269
|
+
|
|
244
270
|
```javascript
|
|
245
271
|
useblocks.init({
|
|
246
272
|
....,
|
|
@@ -255,7 +281,9 @@ useblocks.init({
|
|
|
255
281
|
```
|
|
256
282
|
|
|
257
283
|
By sending the asynchronous feature you can implement the asynchronous data load.
|
|
258
|
-
|
|
284
|
+
|
|
285
|
+
#### Example
|
|
286
|
+
|
|
259
287
|
```javascript
|
|
260
288
|
useblocks.init({
|
|
261
289
|
element: "#test",
|
|
@@ -265,61 +293,58 @@ useblocks.init({
|
|
|
265
293
|
handleReadEmail: async (id) => {
|
|
266
294
|
return await fetchData(id); // Your data fetch feature.
|
|
267
295
|
}
|
|
268
|
-
}).then((instance) => {
|
|
296
|
+
}).then((instance) => {
|
|
269
297
|
setTimeout(() => instance.show({ id: "2" }), 1000)
|
|
270
298
|
});
|
|
271
299
|
```
|
|
272
300
|
|
|
273
|
-
|
|
274
|
-
|
|
275
301
|
### Events
|
|
276
|
-
| Name | Description |
|
|
277
|
-
| ------------------------- | -------------------------------------------- |
|
|
278
|
-
| handleReadEmail | Read email |
|
|
279
|
-
| handleSaveEmail | Save / update email |
|
|
280
|
-
| handleReadEmailRevisions | Read autosave list |
|
|
281
|
-
| handleEmailAutosave | Autosave |
|
|
282
|
-
| handleReadBlocks | Read project blocks list |
|
|
283
|
-
| handleSaveBlock | Save / update project block |
|
|
284
|
-
| handleRemoveBlock | Delete project block |
|
|
285
|
-
| handleReadComments | Read email comments list |
|
|
286
|
-
| handleSaveComment | Save / update comment |
|
|
287
|
-
| handleRemoveComment | Delete email comment |
|
|
288
|
-
| handleSaveButtonClick | Email save button click |
|
|
289
|
-
| handleNextButtonClick | Next button click |
|
|
290
|
-
| handlePreviousButtonClick | Back button click |
|
|
291
|
-
| handleEmailChanged | Any email parameter changed |
|
|
292
|
-
| handleHtmlChanged | Email HTML changed |
|
|
293
|
-
| handleDestroy | Plugin destroy |
|
|
294
|
-
| handleLoad | Plugin instance initialization completed |
|
|
295
|
-
| handleLoadImage | Load images |
|
|
296
|
-
| handleNotify | Notification |
|
|
297
|
-
| handleError | Error notification |
|
|
298
|
-
| handleSuccess | Success notification |
|
|
299
|
-
| handleTestEmailSend | Test email send |
|
|
300
|
-
| handleTestEmailModal | Open test email modal window |
|
|
301
|
-
|
|
302
302
|
|
|
303
|
+
| Name | Description |
|
|
304
|
+
| ------------------------- | ---------------------------------------- |
|
|
305
|
+
| handleReadEmail | Read email |
|
|
306
|
+
| handleSaveEmail | Save / update email |
|
|
307
|
+
| handleReadEmailRevisions | Read autosave list |
|
|
308
|
+
| handleEmailAutosave | Autosave |
|
|
309
|
+
| handleReadBlocks | Read project blocks list |
|
|
310
|
+
| handleSaveBlock | Save / update project block |
|
|
311
|
+
| handleRemoveBlock | Delete project block |
|
|
312
|
+
| handleReadComments | Read email comments list |
|
|
313
|
+
| handleSaveComment | Save / update comment |
|
|
314
|
+
| handleRemoveComment | Delete email comment |
|
|
315
|
+
| handleSaveButtonClick | Email save button click |
|
|
316
|
+
| handleNextButtonClick | Next button click |
|
|
317
|
+
| handlePreviousButtonClick | Back button click |
|
|
318
|
+
| handleEmailChanged | Any email parameter changed |
|
|
319
|
+
| handleHtmlChanged | Email HTML changed |
|
|
320
|
+
| handleDestroy | Plugin destroy |
|
|
321
|
+
| handleLoad | Plugin instance initialization completed |
|
|
322
|
+
| handleLoadImage | Load images |
|
|
323
|
+
| handleNotify | Notification |
|
|
324
|
+
| handleError | Error notification |
|
|
325
|
+
| handleSuccess | Success notification |
|
|
326
|
+
| handleTestEmailSend | Test email send |
|
|
327
|
+
| handleTestEmailModal | Open test email modal window |
|
|
303
328
|
|
|
304
329
|
### Methods
|
|
305
|
-
| Method name | Description |
|
|
306
|
-
| ------------------------- | -------------------------------------------- |
|
|
307
|
-
| init | Initialization (async) |
|
|
308
|
-
| show | Update content after initialization |
|
|
309
|
-
| destroy | Destroy instance |
|
|
310
|
-
| reset | Reset all configuration |
|
|
311
|
-
| getEmail | Get current email |
|
|
312
|
-
| getConfig | Get configuration |
|
|
313
|
-
| getBlocks | Get project blocks |
|
|
314
|
-
| getComments | Get email comments |
|
|
315
|
-
| getEmailRevisions | Get version control list |
|
|
316
|
-
| setConfig | Set new config parameters |
|
|
317
|
-
| updateConfig | Add to config parameters |
|
|
318
|
-
| notify | Show notifications |
|
|
319
|
-
| getElement | Get initialization element |
|
|
320
|
-
| save | Save email |
|
|
321
|
-
| compileEmail | Get compiled email |
|
|
322
330
|
|
|
331
|
+
| Method name | Description |
|
|
332
|
+
| ----------------- | ----------------------------------- |
|
|
333
|
+
| init | Initialization (async) |
|
|
334
|
+
| show | Update content after initialization |
|
|
335
|
+
| destroy | Destroy instance |
|
|
336
|
+
| reset | Reset all configuration |
|
|
337
|
+
| getEmail | Get current email |
|
|
338
|
+
| getConfig | Get configuration |
|
|
339
|
+
| getBlocks | Get project blocks |
|
|
340
|
+
| getComments | Get email comments |
|
|
341
|
+
| getEmailRevisions | Get version control list |
|
|
342
|
+
| setConfig | Set new config parameters |
|
|
343
|
+
| updateConfig | Add to config parameters |
|
|
344
|
+
| notify | Show notifications |
|
|
345
|
+
| getElement | Get initialization element |
|
|
346
|
+
| save | Save email |
|
|
347
|
+
| compileEmail | Get compiled email |
|
|
323
348
|
|
|
324
349
|
## 📂 File Manager
|
|
325
350
|
|
|
@@ -381,45 +406,44 @@ The `fileManager` section controls the features of the file manager. All fields
|
|
|
381
406
|
- **comparator** — comparison function for sorting two files. Default: name-based comparison
|
|
382
407
|
- **filterMatch** — function to check if a file passes current filters. Default: name-based search
|
|
383
408
|
|
|
384
|
-
|
|
385
409
|
### Interface StorageProvider
|
|
386
410
|
|
|
387
411
|
#### Properties
|
|
388
412
|
|
|
389
|
-
| Property
|
|
390
|
-
|
|
391
|
-
| `pathMode`
|
|
392
|
-
| `rootId`
|
|
393
|
-
| `trashPath`
|
|
394
|
-
| `tempPath`
|
|
395
|
-
| `useSoftDelete`
|
|
396
|
-
| `ensureFolderTrailingSlash` | boolean
|
|
397
|
-
| `validateDuplicates`
|
|
413
|
+
| Property | Type | Description | Default |
|
|
414
|
+
| --------------------------- | --------- | ----------------------------------------------- | ------- |
|
|
415
|
+
| `pathMode` | `boolean` | Use path as identifier for folders | - |
|
|
416
|
+
| `rootId` | `string` | Custom identifier for root folder | `''` |
|
|
417
|
+
| `trashPath` | `string` | Path to trash/recycle bin folder | - |
|
|
418
|
+
| `tempPath` | `string` | Path to temporary folder for uploads | - |
|
|
419
|
+
| `useSoftDelete` | `boolean` | Enable client-side soft delete | `false` |
|
|
420
|
+
| `ensureFolderTrailingSlash` | boolean | Add a trailing slash to folder paths | `true` |
|
|
421
|
+
| `validateDuplicates` | `boolean` | Client-side check for existing files or folders | - |
|
|
398
422
|
|
|
399
423
|
#### Methods
|
|
400
424
|
|
|
401
425
|
##### Core Methods
|
|
402
426
|
|
|
403
|
-
| Method
|
|
404
|
-
|
|
405
|
-
| **getItems**
|
|
406
|
-
| **createFolder**
|
|
407
|
-
| uploadFile
|
|
408
|
-
| uploadFiles
|
|
409
|
-
| **uploadFileByUrl** | `url: string`, `folderId?: string`
|
|
410
|
-
| `findItemByPath`
|
|
411
|
-
| `setController`
|
|
412
|
-
| `getFileData`
|
|
413
|
-
| `getUrl`
|
|
414
|
-
| `getThumbnailUrl`
|
|
415
|
-
| `renameItem`
|
|
416
|
-
| `deleteItem`
|
|
417
|
-
| `deleteItems`
|
|
418
|
-
| `moveItem`
|
|
419
|
-
| `moveItems`
|
|
420
|
-
| `copyItem`
|
|
421
|
-
| `copyItems`
|
|
422
|
-
| `updateFile`
|
|
427
|
+
| Method | Parameters | Returns | Description |
|
|
428
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
429
|
+
| **getItems** | `options`:<br>- `folderId?: string`<br>- `search?: string`<br>- `sortBy?: string`<br>- `sortOrder?: 'asc'\|'desc'`<br>- `page?: number`<br>- `limit?: number`<br>- `itemType: 'all'\|'file'\|'folder'` | `{ items: FileSystemItem[], pagination?: Partial<ApiPaginationResponse> }` | Retrieve files/folders with filtering, sorting, pagination |
|
|
430
|
+
| **createFolder** | `name: string`, `parentid?: string` | `FileSystemItem` | Create new folder |
|
|
431
|
+
| uploadFile | `file`: <br>- `name: string`<br>- `size: number`<br>- `type: string`<br>- `folderId?: string`<br>- `data: Blob \| string`<br>- `thumbnail?: string`<br>- `dimensions?: string`<br>- `aspectRatio?: string`<br>- `extension?: string` | `FileSystemItemUpdate` | Upload file with metadata |
|
|
432
|
+
| uploadFiles | `request`:<br>- `items: { requestId?: string, name: string, size: number, type: string, folderId?: string \| null, data: Blob \| string, extension?: string }[]`<br>- `folderId?: string \| null` | `BatchResult<UploadFileResultData>` | Upload multiple files. The order of items matters — if `requestId` is not provided, results are matched by index |
|
|
433
|
+
| **uploadFileByUrl** | `url: string`, `folderId?: string` | `FileSystemItem` | Upload file from URL (check for existing files) |
|
|
434
|
+
| `findItemByPath` | `path: string` | `FileSystemItem \| undefined` | Find system files/folders by path |
|
|
435
|
+
| `setController` | `controller: StorageProviderController` | `void` | Set cache management controller |
|
|
436
|
+
| `getFileData` | `file: FileSystemItem` | `Blob` | Get file content as blob |
|
|
437
|
+
| `getUrl` | `file: FileSystemItem` | `string` | Get file access URL |
|
|
438
|
+
| `getThumbnailUrl` | `file: FileSystemItem` | `string` | Get thumbnail URL |
|
|
439
|
+
| `renameItem` | `item: FileSystemItem`, `newName: string` | `FileSystemItemUpdate` | Rename file/folder |
|
|
440
|
+
| `deleteItem` | `item: FileSystemItem` | `void` | Delete single item (moves to trash if soft delete enabled) |
|
|
441
|
+
| `deleteItems` | `items: FileSystemItem[]` | `BatchResult<never>` | Delete multiple items |
|
|
442
|
+
| `moveItem` | `item: FileSystemItem`, `targetFolderId?: string` | `FileSystemItemUpdate` | Move single item |
|
|
443
|
+
| `moveItems` | `items: FileSystemItem[]`, `targetFolderId?: string` | `BatchResult<FileSystemItemUpdate>` | Move multiple items |
|
|
444
|
+
| `copyItem` | `item: FileSystemItem`, `targetFolderId?: string` | `FileSystemItemUpdate` | Copy single item |
|
|
445
|
+
| `copyItems` | `items: FileSystemItem[]`, `targetFolderId?: string` | `BatchResult<FileSystemItemUpdate>` | Copy multiple items |
|
|
446
|
+
| `updateFile` | `file: FileSystemItem`, `updates`: metadata object | `FileSystemItemUpdate` | Update file metadata/content |
|
|
423
447
|
|
|
424
448
|
##### Type Definitions
|
|
425
449
|
|
|
@@ -438,4 +462,5 @@ The `fileManager` section controls the features of the file manager. All fields
|
|
|
438
462
|
- **Cache Control**: Use `setController` for cache invalidation requests
|
|
439
463
|
|
|
440
464
|
### Keywords
|
|
441
|
-
|
|
465
|
+
|
|
466
|
+
none
|