@mjml-agent-editor/editor 0.1.17 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -67,9 +67,204 @@ var DEFAULT_LABELS = {
67
67
  exportHtml: "Export HTML",
68
68
  exportMjml: "Export MJML",
69
69
  copied: (kind) => `${kind} copied.`,
70
+ tabBlocks: "Blocks",
71
+ tabSettings: "Settings",
72
+ tabLayers: "Layers",
70
73
  searchBlocks: "Search blocks\u2026",
74
+ noBlocksMatch: "No blocks match.",
75
+ blockAdded: (block) => `Added: ${block}`,
76
+ blockCategoryLayout: "Layout",
77
+ blockCategoryContent: "Content",
78
+ blockCategorySections: "Sections",
79
+ blockLabels: {
80
+ "mj-1-column": "1 column",
81
+ "mj-2-columns": "2 columns",
82
+ "mj-3-columns": "3 columns",
83
+ "mj-text": "Text",
84
+ "mj-image": "Image",
85
+ "mj-button": "Button",
86
+ "mj-divider": "Divider",
87
+ "mj-spacer": "Spacer",
88
+ "mj-social-group": "Social links",
89
+ "mj-navbar": "Navigation"
90
+ },
91
+ elementNames: {
92
+ "mj-wrapper": "Section group",
93
+ "mj-section": "Section",
94
+ "mj-column": "Column",
95
+ "mj-group": "Column group",
96
+ "mj-text": "Text",
97
+ "mj-button": "Button",
98
+ "mj-image": "Image",
99
+ "mj-divider": "Divider",
100
+ "mj-spacer": "Spacer",
101
+ "mj-hero": "Hero",
102
+ "mj-navbar": "Navigation",
103
+ "mj-navbar-link": "Navigation link",
104
+ "mj-social": "Social links",
105
+ "mj-social-element": "Social link",
106
+ "mj-raw": "Raw HTML",
107
+ "mj-table": "Table"
108
+ },
71
109
  expandAll: "Expand all",
72
110
  selectAnElement: "Select an element\u2026",
111
+ settingsEmpty: "Select something in the email to edit it.",
112
+ emailSettings: "Email settings",
113
+ loadingEditor: "Loading editor\u2026",
114
+ commentOnElement: "Comment on element / section",
115
+ groupContent: "Content",
116
+ groupLayout: "Layout",
117
+ groupSpacing: "Spacing",
118
+ groupStyle: "Style",
119
+ groupAdvanced: "Advanced",
120
+ otherAttributes: "Other attributes",
121
+ removeAttribute: "Remove",
122
+ resetToDefault: "Reset to default",
123
+ selectParent: "Select parent",
124
+ duplicate: "Duplicate",
125
+ deleteElement: "Delete",
126
+ multipleSelected: (count) => `${count} elements selected \u2014 select one to edit its settings.`,
127
+ editEachSide: "Edit each side",
128
+ increase: "Increase",
129
+ decrease: "Decrease",
130
+ changeUnit: (unit) => `Unit: ${unit}. Click to change`,
131
+ noUnit: "\xD7",
132
+ sidesVertical: "Top and bottom",
133
+ sidesHorizontal: "Left and right",
134
+ sideTop: "Top",
135
+ sideRight: "Right",
136
+ sideBottom: "Bottom",
137
+ sideLeft: "Left",
138
+ linkTypeProfile: "Your profile",
139
+ linkTypeShare: "Share this page",
140
+ allScreenSizes: "Changes apply to every screen size.",
141
+ columnWidths: "Column widths",
142
+ columnRatio: (ratio) => `Columns ${ratio}`,
143
+ socialNetworks: "Networks",
144
+ addNetwork: "Add network",
145
+ navbarLinks: "Links",
146
+ addLink: "Add link",
147
+ newLinkText: "Link",
148
+ inspectorLabels: {
149
+ // Fields
150
+ contentWidth: "Width",
151
+ pageBackground: "Page background",
152
+ "pageBackground.help": "Fills the area around and behind the email.",
153
+ fullWidth: "Full-width background",
154
+ "fullWidth.help": "The background reaches the window edges; the content keeps the email width.",
155
+ padding: "Padding",
156
+ backgroundColor: "Background",
157
+ backgroundImage: "Background image",
158
+ backgroundSize: "Image size",
159
+ backgroundRepeat: "Repeat image",
160
+ backgroundPosition: "Position",
161
+ cornerRadius: "Corners",
162
+ gap: "Space between sections",
163
+ border: "Border",
164
+ alignColumns: "Align columns",
165
+ "alignColumns.help": "Where the columns sit when they don't fill the row.",
166
+ reverseColumns: "Reverse column order",
167
+ "reverseColumns.help": "Swaps the columns on desktop; on phones they still stack in their original order.",
168
+ verticalAlign: "Vertical",
169
+ width: "Width",
170
+ innerBackground: "Inner background",
171
+ "innerBackground.help": "Fills only the area inside the padding, so it needs padding to show.",
172
+ innerCornerRadius: "Inner corners",
173
+ innerBorder: "Inner border",
174
+ align: "Alignment",
175
+ font: "Font",
176
+ fontSize: "Text size",
177
+ fontWeight: "Weight",
178
+ textColor: "Text color",
179
+ lineHeight: "Line height",
180
+ letterSpacing: "Letter spacing",
181
+ textTransform: "Capitalization",
182
+ blockBackground: "Block background",
183
+ "blockBackground.help": "Fills the whole block, including its padding.",
184
+ link: "Link",
185
+ buttonColor: "Button color",
186
+ buttonPadding: "Button padding",
187
+ "buttonPadding.help": "Space between the text and the button's edge; this sets the button's size.",
188
+ spaceAround: "Space around",
189
+ "spaceAround.help": "Empty space outside the button, between it and what is next to it.",
190
+ opensIn: "Opens in",
191
+ tooltip: "Tooltip",
192
+ rel: "Link relationship",
193
+ image: "Image",
194
+ altText: "Alt text",
195
+ "altText.help": "Read by screen readers and shown when images are blocked.",
196
+ fluidOnMobile: "Full width on mobile",
197
+ "fluidOnMobile.help": "On phones the image stretches across the screen, whatever its width here.",
198
+ lineColor: "Line color",
199
+ thickness: "Thickness",
200
+ lineStyle: "Line style",
201
+ height: "Height",
202
+ socialMode: "Direction",
203
+ iconSize: "Icon size",
204
+ iconSpacing: "Space around each icon",
205
+ network: "Network",
206
+ // Brand names are the same in every language and are not keys; these two are words.
207
+ networkWebsite: "Website",
208
+ networkCustom: "Custom",
209
+ customIcon: "Custom icon",
210
+ iconColor: "Icon color",
211
+ iconPosition: "Icon side",
212
+ heroMode: "Sizing",
213
+ "heroMode.help": "Fixed keeps the height you set; Fit image follows the background image's proportions.",
214
+ backgroundWidth: "Image width",
215
+ "backgroundWidth.help": "The background image's real size in pixels, so the hero keeps its proportions.",
216
+ backgroundHeight: "Image height",
217
+ fallbackColor: "Fallback color",
218
+ "fallbackColor.help": "Shown while the image loads, or when images are blocked.",
219
+ contentPadding: "Content padding",
220
+ contentBackground: "Content background",
221
+ hamburger: "Collapse into a menu on mobile",
222
+ "hamburger.help": "On phones the links fold into a menu button.",
223
+ menuIconColor: "Menu icon color",
224
+ menuIconSize: "Menu icon size",
225
+ menuIconAlign: "Menu icon align",
226
+ baseUrl: "Link prefix",
227
+ "baseUrl.help": "Added in front of every link in the bar, full addresses included, so links then give only the path.",
228
+ // Options
229
+ alignLeft: "Left",
230
+ alignCenter: "Center",
231
+ alignRight: "Right",
232
+ alignJustify: "Justify",
233
+ alignTop: "Top",
234
+ alignMiddle: "Middle",
235
+ alignBottom: "Bottom",
236
+ weightRegular: "Regular",
237
+ weightMedium: "Medium",
238
+ weightSemibold: "Semibold",
239
+ weightBold: "Bold",
240
+ caseNone: "As typed",
241
+ caseUpper: "UPPERCASE",
242
+ caseLower: "lowercase",
243
+ caseCapitalize: "Capitalize Each Word",
244
+ targetNewTab: "New tab",
245
+ targetSameTab: "Same tab",
246
+ sizeCover: "Fill",
247
+ sizeContain: "Fit",
248
+ sizeAuto: "Original",
249
+ repeatTile: "Tile",
250
+ repeatOnce: "Once",
251
+ positionTopLeft: "Top left",
252
+ positionTopCenter: "Top",
253
+ positionTopRight: "Top right",
254
+ positionCenterLeft: "Left",
255
+ positionCenter: "Center",
256
+ positionCenterRight: "Right",
257
+ positionBottomLeft: "Bottom left",
258
+ positionBottomCenter: "Bottom",
259
+ positionBottomRight: "Bottom right",
260
+ lineSolid: "Solid",
261
+ lineDashed: "Dashed",
262
+ lineDotted: "Dotted",
263
+ modeHorizontal: "In a row",
264
+ modeVertical: "Stacked",
265
+ heroFixed: "Fixed",
266
+ heroFluid: "Fit image"
267
+ },
73
268
  attributes: "Attributes",
74
269
  style: "Style",
75
270
  rteFont: "Font",
@@ -136,7 +331,10 @@ function mergeLabels(overrides) {
136
331
  return {
137
332
  ...DEFAULT_LABELS,
138
333
  ...overrides,
139
- toolLabels: { ...DEFAULT_LABELS.toolLabels, ...overrides.toolLabels }
334
+ toolLabels: { ...DEFAULT_LABELS.toolLabels, ...overrides.toolLabels },
335
+ blockLabels: { ...DEFAULT_LABELS.blockLabels, ...overrides.blockLabels },
336
+ elementNames: { ...DEFAULT_LABELS.elementNames, ...overrides.elementNames },
337
+ inspectorLabels: { ...DEFAULT_LABELS.inspectorLabels, ...overrides.inspectorLabels }
140
338
  };
141
339
  }
142
340
 
@@ -934,6 +1132,7 @@ function EditorHeader({
934
1132
  {
935
1133
  title: labels.previewFrameTitle,
936
1134
  srcDoc: preview,
1135
+ sandbox: "allow-popups allow-popups-to-escape-sandbox",
937
1136
  className: cn(
938
1137
  "mx-auto block h-full min-h-[80vh] rounded-md border bg-white shadow-sm",
939
1138
  state.device === "Mobile" ? "w-[375px]" : "w-full max-w-[720px]"