@useinsider/guido 1.0.0-beta.e73b90d → 1.0.0-beta.e830eab
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/README.md +11 -259
- package/dist/@types/generic.d.ts +0 -8
- package/dist/App.vue.d.ts +1 -1
- package/dist/components/Guido.vue.d.ts +3 -12
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +28 -46
- package/dist/components/organisms/header/MiddleSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +12 -10
- package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
- package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +1 -1
- package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +1 -1
- package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +1 -1
- package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +1 -1
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +16 -0
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +22 -0
- package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +79 -0
- package/dist/components/wrappers/ModalWrapper.vue.d.ts +72 -0
- package/dist/components/wrappers/ModalWrapper.vue.js +19 -0
- package/dist/components/wrappers/ModalWrapper.vue2.js +43 -0
- package/dist/composables/useActionsApi.d.ts +0 -1
- package/dist/composables/useActionsApi.js +12 -14
- package/dist/composables/useExport.d.ts +1 -1
- package/dist/composables/useExport.js +20 -35
- package/dist/composables/useSaveAsTemplate.d.ts +7 -0
- package/dist/composables/useSaveAsTemplate.js +44 -0
- package/dist/composables/useStripo.js +28 -40
- package/dist/composables/useTemplateNameValidation.d.ts +13 -0
- package/dist/composables/useTemplateNameValidation.js +57 -0
- package/dist/composables/useTemplates.d.ts +5 -0
- package/dist/composables/useTemplates.js +27 -0
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.d.ts +1 -2
- package/dist/services/stripoApi.js +7 -23
- package/dist/static/templates/default/index.html.js +5 -0
- package/dist/static/templates/default/style.css.js +119 -0
- package/dist/stores/editor.d.ts +1 -0
- package/dist/stores/editor.js +2 -1
- package/dist/stores/template-categories.d.ts +41 -0
- package/dist/stores/template-categories.js +91 -0
- package/dist/utils/base64.d.ts +2 -0
- package/dist/utils/base64.js +14 -0
- package/package.json +5 -6
- package/dist/_virtual/AddCustomFont.js +0 -4
- package/dist/_virtual/AiAssistantValueType.js +0 -4
- package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
- package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
- package/dist/_virtual/Block.js +0 -4
- package/dist/_virtual/BlockAttributes.js +0 -4
- package/dist/_virtual/BlockCompositionType.js +0 -4
- package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/BlockRenderer.js +0 -4
- package/dist/_virtual/BlockType.js +0 -4
- package/dist/_virtual/BlocksPanel.js +0 -4
- package/dist/_virtual/BuiltInControl.js +0 -4
- package/dist/_virtual/BuiltInControlTypes.js +0 -4
- package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
- package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
- package/dist/_virtual/ContextAction.js +0 -4
- package/dist/_virtual/ContextActionType.js +0 -4
- package/dist/_virtual/Control.js +0 -4
- package/dist/_virtual/EditorStatePropertyType.js +0 -4
- package/dist/_virtual/Extension.js +0 -4
- package/dist/_virtual/ExtensionBuilder.js +0 -4
- package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
- package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
- package/dist/_virtual/ModificationDescription.js +0 -4
- package/dist/_virtual/PanelPosition.js +0 -4
- package/dist/_virtual/PreviewDeviceMode.js +0 -4
- package/dist/_virtual/SettingsPanelRegistry.js +0 -4
- package/dist/_virtual/SettingsPanelTab.js +0 -4
- package/dist/_virtual/SettingsTab.js +0 -4
- package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
- package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
- package/dist/_virtual/TextColorBuiltInControl.js +0 -4
- package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
- package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
- package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
- package/dist/_virtual/UIElement.js +0 -4
- package/dist/_virtual/UIElementTagRegistry.js +0 -4
- package/dist/_virtual/UIElementType.js +0 -4
- package/dist/_virtual/UIElementsAttributes.js +0 -4
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -4
- package/dist/composables/useHtmlCompiler.d.ts +0 -4
- package/dist/composables/useHtmlCompiler.js +0 -16
- package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
- package/dist/config/compiler/htmlCompilerRules.js +0 -145
- package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -6
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +0 -27
- package/dist/extensions/DynamicContent/dynamic-content.css.js +0 -24
- package/dist/extensions/DynamicContent/dynamic-content.d.ts +0 -16
- package/dist/extensions/DynamicContent/dynamic-content.js +0 -63
- package/dist/extensions/DynamicContent/extension.d.ts +0 -2
- package/dist/extensions/DynamicContent/extension.js +0 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -51
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -52
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -41
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -104
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -13
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -20
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -18
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -32
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -26
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -18
- package/dist/utils/htmlCompiler.d.ts +0 -12
- package/dist/utils/htmlCompiler.js +0 -70
- /package/dist/mock/api/{default-template.d.ts → template-library.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -14,10 +14,7 @@ Guido is a Vue 2 + TypeScript wrapper for the Stripo Email Editor plugin. Easily
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install @useinsider/guido
|
|
16
16
|
```
|
|
17
|
-
### Prerequisites
|
|
18
|
-
🍍 Your project should have `pinia`
|
|
19
17
|
|
|
20
|
-
---
|
|
21
18
|
## 🚀 Usage
|
|
22
19
|
|
|
23
20
|
### Basic Usage
|
|
@@ -26,11 +23,9 @@ npm install @useinsider/guido
|
|
|
26
23
|
<template>
|
|
27
24
|
<div>
|
|
28
25
|
<Guido
|
|
29
|
-
ref="guidoEditor"
|
|
30
26
|
:email-id="emailId"
|
|
31
27
|
:user-id="userId"
|
|
32
28
|
:guido-config="guidoConfig"
|
|
33
|
-
@dynamic-content:open="handleDynamicContentOpen"
|
|
34
29
|
/>
|
|
35
30
|
</div>
|
|
36
31
|
</template>
|
|
@@ -47,33 +42,9 @@ export default {
|
|
|
47
42
|
emailId: 'abc123',
|
|
48
43
|
userId: '12345',
|
|
49
44
|
guidoConfig: {
|
|
50
|
-
translationsPath: 'window.trans.en'
|
|
51
|
-
htmlCompilerRules: [],
|
|
52
|
-
ignoreDefaultHtmlCompilerRules: false,
|
|
45
|
+
translationsPath: 'window.trans.en'
|
|
53
46
|
}
|
|
54
|
-
dynamicContentModalVisible: false
|
|
55
47
|
};
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
methods: {
|
|
59
|
-
handleDynamicContentOpen() {
|
|
60
|
-
this.dynamicContentModalVisible = true;
|
|
61
|
-
}
|
|
62
|
-
// ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
|
|
63
|
-
handleDynamicContentInsert() {
|
|
64
|
-
this.$ref.guidoEditor?.dynamicContent.insert({
|
|
65
|
-
text: 'Text',
|
|
66
|
-
value: 'Value',
|
|
67
|
-
fallback: 'Fallback'
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
this.dynamicContentModalVisible = false;
|
|
71
|
-
},
|
|
72
|
-
// ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
|
|
73
|
-
handleDynamicContentClose() {
|
|
74
|
-
this.$ref.guidoEditor?.dynamicContent.close();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
48
|
}
|
|
78
49
|
};
|
|
79
50
|
</script>
|
|
@@ -92,42 +63,17 @@ export default {
|
|
|
92
63
|
| `productType` | `string` | ⚪ | Getting from URL path | Unique identifier for the product draft |
|
|
93
64
|
| `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
|
|
94
65
|
|
|
95
|
-
###
|
|
96
|
-
```typescript
|
|
97
|
-
dynamicContent.insert(DynamicContent);
|
|
98
|
-
dynamicContent.close();
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Guido Interfaces
|
|
66
|
+
### GuidoConfig Interface
|
|
102
67
|
|
|
103
68
|
```typescript
|
|
104
69
|
interface GuidoConfig {
|
|
105
70
|
translationsPath: string;
|
|
106
|
-
htmlCompilerRules: CompilerRule[];
|
|
107
|
-
ignoreDefaultHtmlCompilerRules: boolean;
|
|
108
71
|
}
|
|
109
72
|
```
|
|
110
73
|
|
|
111
74
|
| Property | Type | Default | Description |
|
|
112
75
|
|----------|------|---------|-------------|
|
|
113
76
|
| `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
|
|
114
|
-
| `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
|
|
115
|
-
| `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
interface DynamicContent {
|
|
119
|
-
value: string;
|
|
120
|
-
text: string;
|
|
121
|
-
fallback?: string;
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
| Property | Type | Default | Description |
|
|
127
|
-
|----------|------|---------|-------------|
|
|
128
|
-
| `value` | `string` | '' | Value of the dynamic content |
|
|
129
|
-
| `text` | `string` | '' | Visible value of the dynamic content |
|
|
130
|
-
| `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
|
|
131
77
|
|
|
132
78
|
### TypeScript Types
|
|
133
79
|
|
|
@@ -142,183 +88,17 @@ import type { GuidoConfig } from '@useinsider/guido';
|
|
|
142
88
|
import type { StripoEventType } from '@useinsider/guido';
|
|
143
89
|
```
|
|
144
90
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
Guido includes a powerful HTML compiler system that allows you to transform HTML content with custom rules. You can define additional rules and optionally ignore the default rules.
|
|
148
|
-
|
|
149
|
-
### Rule Types
|
|
150
|
-
|
|
151
|
-
There are 4 types of compiler rules:
|
|
152
|
-
|
|
153
|
-
#### 1. Replace Rule
|
|
154
|
-
Replace specific strings in HTML content.
|
|
91
|
+
### StripoEventType
|
|
155
92
|
|
|
156
93
|
```typescript
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
#### 2. Regex Rule
|
|
169
|
-
Use regular expressions for complex pattern matching and replacement.
|
|
170
|
-
|
|
171
|
-
```typescript
|
|
172
|
-
{
|
|
173
|
-
id: 'remove-comments',
|
|
174
|
-
description: 'Remove HTML comments',
|
|
175
|
-
type: 'regex',
|
|
176
|
-
pattern: '<!--.*?-->', // Regex pattern
|
|
177
|
-
replacement: '', // Replacement string
|
|
178
|
-
flags: 'g', // Regex flags (default: 'g')
|
|
179
|
-
priority: 20
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
#### 3. Remove Rule
|
|
184
|
-
Remove specific strings or patterns from HTML content.
|
|
185
|
-
|
|
186
|
-
```typescript
|
|
187
|
-
{
|
|
188
|
-
id: 'cleanup-scripts',
|
|
189
|
-
description: 'Remove unwanted script tags',
|
|
190
|
-
type: 'remove',
|
|
191
|
-
targets: [ // Array of strings or RegExp objects
|
|
192
|
-
'<script src="unwanted.js"></script>',
|
|
193
|
-
/onclick="[^"]*"/g
|
|
194
|
-
],
|
|
195
|
-
priority: 30
|
|
196
|
-
}
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
#### 4. Custom Rule
|
|
200
|
-
Define complex transformation logic with a custom processor function.
|
|
201
|
-
|
|
202
|
-
```typescript
|
|
203
|
-
{
|
|
204
|
-
id: 'add-meta-tags',
|
|
205
|
-
description: 'Add custom meta tags to head',
|
|
206
|
-
type: 'custom',
|
|
207
|
-
processor: (html: string): string => {
|
|
208
|
-
// Custom transformation logic
|
|
209
|
-
const metaTags = '<meta name="custom" content="value">';
|
|
210
|
-
return html.replace('</head>', `${metaTags}</head>`);
|
|
211
|
-
},
|
|
212
|
-
priority: 40
|
|
213
|
-
}
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### Using HTML Compiler Rules
|
|
217
|
-
|
|
218
|
-
#### Basic Usage with Custom Rules
|
|
219
|
-
|
|
220
|
-
```typescript
|
|
221
|
-
const guidoConfig = {
|
|
222
|
-
translationsPath: 'window.trans.en',
|
|
223
|
-
htmlCompilerRules: [
|
|
224
|
-
{
|
|
225
|
-
id: 'replace-domain',
|
|
226
|
-
description: 'Replace old domain with new one',
|
|
227
|
-
type: 'replace',
|
|
228
|
-
search: 'old-domain.com',
|
|
229
|
-
replacement: 'new-domain.com',
|
|
230
|
-
replaceAll: true,
|
|
231
|
-
priority: 10
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
id: 'remove-tracking',
|
|
235
|
-
description: 'Remove tracking pixels',
|
|
236
|
-
type: 'regex',
|
|
237
|
-
pattern: '<img[^>]*tracking[^>]*>',
|
|
238
|
-
replacement: '',
|
|
239
|
-
flags: 'gi',
|
|
240
|
-
priority: 20
|
|
241
|
-
}
|
|
242
|
-
]
|
|
243
|
-
};
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
#### Ignoring Default Rules
|
|
247
|
-
|
|
248
|
-
```typescript
|
|
249
|
-
const guidoConfig = {
|
|
250
|
-
translationsPath: 'window.trans.en',
|
|
251
|
-
ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
|
|
252
|
-
htmlCompilerRules: [
|
|
253
|
-
// Only your custom rules will be applied
|
|
254
|
-
{
|
|
255
|
-
id: 'custom-transformation',
|
|
256
|
-
type: 'replace',
|
|
257
|
-
search: 'old-text',
|
|
258
|
-
replacement: 'new-text',
|
|
259
|
-
priority: 1
|
|
260
|
-
}
|
|
261
|
-
]
|
|
262
|
-
};
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### Rule Execution Order
|
|
266
|
-
|
|
267
|
-
Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
|
|
268
|
-
|
|
269
|
-
- **Priority 1-99**: Reserved for critical transformations
|
|
270
|
-
- **Priority 100-999**: Standard transformations
|
|
271
|
-
- **Priority 1000+**: Additional custom rules (automatically assigned)
|
|
272
|
-
|
|
273
|
-
### Default Rules
|
|
274
|
-
|
|
275
|
-
Guido includes several default rules for common email HTML optimizations:
|
|
276
|
-
|
|
277
|
-
- **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
|
|
278
|
-
- **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
|
|
279
|
-
- **HTML entity decoding**: Converts `<` and `>` back to `<` and `>`
|
|
280
|
-
- **Cleanup rules**: Removes unwanted iframe and style elements
|
|
281
|
-
- **MSO conditions**: Manages Outlook-specific conditional comments
|
|
282
|
-
- **Domain replacement**: Updates old image domains to current ones
|
|
283
|
-
|
|
284
|
-
You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
|
|
285
|
-
|
|
286
|
-
### CompilerRule Interface
|
|
287
|
-
|
|
288
|
-
```typescript
|
|
289
|
-
type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
|
|
290
|
-
|
|
291
|
-
interface BaseCompilerRule {
|
|
292
|
-
id: string;
|
|
293
|
-
description?: string;
|
|
294
|
-
priority: number;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
interface ReplaceRule extends BaseCompilerRule {
|
|
298
|
-
type: 'replace';
|
|
299
|
-
search: string;
|
|
300
|
-
replacement: string;
|
|
301
|
-
replaceAll?: boolean; // Default: true
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
interface RegexRule extends BaseCompilerRule {
|
|
305
|
-
type: 'regex';
|
|
306
|
-
pattern: string;
|
|
307
|
-
replacement: string;
|
|
308
|
-
flags?: string; // Default: 'g'
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
interface RemoveRule extends BaseCompilerRule {
|
|
312
|
-
type: 'remove';
|
|
313
|
-
targets: (string | RegExp)[]; // Array of strings or RegExp objects
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
interface CustomRule extends BaseCompilerRule {
|
|
317
|
-
type: 'custom';
|
|
318
|
-
processor: (html: string) => string;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
|
|
94
|
+
type StripoEventType =
|
|
95
|
+
| 'save'
|
|
96
|
+
| 'export'
|
|
97
|
+
| 'close'
|
|
98
|
+
| 'autosave'
|
|
99
|
+
| 'publish'
|
|
100
|
+
| 'export:requested'
|
|
101
|
+
| 'export:ready';
|
|
322
102
|
```
|
|
323
103
|
|
|
324
104
|
---
|
|
@@ -390,34 +170,6 @@ const trans = useTranslations();
|
|
|
390
170
|
trans('foo.bar')
|
|
391
171
|
```
|
|
392
172
|
|
|
393
|
-
## 📦 Local Building (Recommended)
|
|
394
|
-
|
|
395
|
-
Run this commands if you want to test the package on your local before sending to NPM.
|
|
396
|
-
```sh
|
|
397
|
-
bun run build
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
Since bun does not have packaging yet, use npm here: 🥲
|
|
401
|
-
```sh
|
|
402
|
-
npm pack
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
It'll crate like `useinsider-guido-1.0.0.tgz` file.
|
|
406
|
-
|
|
407
|
-
Move this file to your project path like: `email-fe` via:
|
|
408
|
-
```sh
|
|
409
|
-
cp useinsider-guido-1.0.0.tgz ../email-fe
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
Install the file to your project:
|
|
413
|
-
```sh
|
|
414
|
-
npm i ./useinsider-guido-1.0.0.tgz
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
Then you just need to rebuild to your project or restart the Container. 🎉
|
|
418
|
-
|
|
419
|
-
For Future, we can create a shell script for it. Feel free to help 🙃
|
|
420
|
-
|
|
421
173
|
## 📦 Build Output
|
|
422
174
|
|
|
423
175
|
The library builds to multiple formats:
|
package/dist/@types/generic.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import type { CompilerRule } from './html-compiler';
|
|
2
1
|
export type GuidoConfig = {
|
|
3
2
|
translationsPath: string;
|
|
4
|
-
htmlCompilerRules?: CompilerRule[];
|
|
5
|
-
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export type DynamicContent = {
|
|
8
|
-
value: string;
|
|
9
|
-
text: string;
|
|
10
|
-
fallback?: string;
|
|
11
3
|
};
|
package/dist/App.vue.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../node_modules/@useinsider/design-system-vue/dist/design-system-vue.css';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
3
3
|
export default _default;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GuidoConfig } from '@@/Types/generic';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
|
|
3
|
+
emailId: string;
|
|
4
4
|
userId: string;
|
|
5
5
|
partnerName?: string;
|
|
6
6
|
productType?: string;
|
|
7
7
|
username?: string;
|
|
8
|
-
html?: string;
|
|
9
|
-
css?: string;
|
|
10
8
|
guidoConfig: GuidoConfig;
|
|
11
9
|
};
|
|
12
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
13
|
-
dynamicContent: {
|
|
14
|
-
insert: (data: DynamicContent) => void;
|
|
15
|
-
close: () => void;
|
|
16
|
-
};
|
|
17
|
-
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
18
|
-
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
19
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
20
11
|
export default _default;
|
|
21
12
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
13
|
type __VLS_TypePropsToOption<T> = {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var s = function() {
|
|
5
|
-
var
|
|
6
|
-
return
|
|
7
|
-
},
|
|
5
|
+
var t = this, e = t._self._c, r = t._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), e("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.SaveTemplateModal, { attrs: { "is-open": r.editorStore.isSaveTemplateModalOpen }, on: { close: r.handleCloseSaveTemplateModal } })], 1);
|
|
7
|
+
}, i = [], n = /* @__PURE__ */ a(
|
|
8
8
|
o,
|
|
9
9
|
s,
|
|
10
|
-
|
|
10
|
+
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"69c35c60"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const c = n.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
c as default
|
|
18
18
|
};
|
|
@@ -1,65 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { usePartner as
|
|
3
|
-
import { useStripo as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { defineComponent as g, onMounted as T } from "vue";
|
|
2
|
+
import { usePartner as S } from "../composables/usePartner.js";
|
|
3
|
+
import { useStripo as C } from "../composables/useStripo.js";
|
|
4
|
+
import { useTemplates as _ } from "../composables/useTemplates.js";
|
|
5
|
+
import { DefaultUsername as y, DefaultGuidoConfig as w } from "../enums/defaults.js";
|
|
6
|
+
import I from "./organisms/header/HeaderWrapper.vue.js";
|
|
7
|
+
import M from "./organisms/save-template/SaveTemplateModal.vue.js";
|
|
8
|
+
import { useEditorStore as P } from "../stores/editor.js";
|
|
9
|
+
const F = /* @__PURE__ */ g({
|
|
8
10
|
__name: "Guido",
|
|
9
11
|
props: {
|
|
10
|
-
|
|
12
|
+
emailId: null,
|
|
11
13
|
userId: null,
|
|
12
14
|
partnerName: null,
|
|
13
15
|
productType: null,
|
|
14
16
|
username: null,
|
|
15
|
-
html: null,
|
|
16
|
-
css: null,
|
|
17
17
|
guidoConfig: null
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
productType: m = i(),
|
|
29
|
-
username: u = b
|
|
30
|
-
} = n;
|
|
19
|
+
setup(f) {
|
|
20
|
+
const o = f, { getPartnerName: t, getProductType: r } = S(), {
|
|
21
|
+
emailId: a,
|
|
22
|
+
userId: n,
|
|
23
|
+
guidoConfig: i,
|
|
24
|
+
partnerName: l = t(),
|
|
25
|
+
productType: m = r(),
|
|
26
|
+
username: p = y
|
|
27
|
+
} = o;
|
|
31
28
|
window.GuidoConfig = {
|
|
32
|
-
...
|
|
33
|
-
...
|
|
29
|
+
...w,
|
|
30
|
+
...i
|
|
34
31
|
};
|
|
35
|
-
const { initPlugin:
|
|
36
|
-
|
|
37
|
-
}, g = () => {
|
|
38
|
-
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
32
|
+
const { initPlugin: u } = C({ emailId: a, userId: n, username: p, partnerName: l, productType: m }), { getDefaultTemplate: s } = _(), d = P(), c = () => {
|
|
33
|
+
d.isSaveTemplateModalOpen = !1;
|
|
39
34
|
};
|
|
40
|
-
return
|
|
41
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
35
|
+
return T(async () => {
|
|
42
36
|
try {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
css: l
|
|
46
|
-
};
|
|
47
|
-
e.html || (e = await f()), await p(e);
|
|
37
|
+
const e = await s();
|
|
38
|
+
await u(e);
|
|
48
39
|
} catch (e) {
|
|
49
40
|
console.error("Failed to initialize Stripo editor:", e);
|
|
50
41
|
}
|
|
51
|
-
|
|
52
|
-
const C = e;
|
|
53
|
-
console.debug("dynamic-content:open", C.detail), t("dynamic-content:open", C.detail);
|
|
54
|
-
});
|
|
55
|
-
}), v({
|
|
56
|
-
dynamicContent: {
|
|
57
|
-
insert: y,
|
|
58
|
-
close: g
|
|
59
|
-
}
|
|
60
|
-
}), { __sfc: !0, props: n, getPartnerName: o, getProductType: i, templateId: c, userId: a, guidoConfig: r, html: s, css: l, partnerName: d, productType: m, username: u, emit: t, initPlugin: p, getDefaultTemplate: f, insertDynamicContent: y, closeDynamicContent: g, HeaderWrapper: G };
|
|
42
|
+
}), { __sfc: !0, props: o, getPartnerName: t, getProductType: r, emailId: a, userId: n, guidoConfig: i, partnerName: l, productType: m, username: p, initPlugin: u, getDefaultTemplate: s, editorStore: d, handleCloseSaveTemplateModal: c, HeaderWrapper: I, SaveTemplateModal: M };
|
|
61
43
|
}
|
|
62
44
|
});
|
|
63
45
|
export {
|
|
64
|
-
|
|
46
|
+
F as default
|
|
65
47
|
};
|
|
@@ -2,7 +2,7 @@ import s from "./MiddleSlot.vue2.js";
|
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
4
|
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
5
|
-
return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "
|
|
5
|
+
return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
|
|
6
6
|
}, l = [], r = /* @__PURE__ */ i(
|
|
7
7
|
s,
|
|
8
8
|
n,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import o from "./RightSlot.vue2.js";
|
|
|
2
2
|
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var n = function() {
|
|
4
4
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
5
|
-
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
|
|
5
|
+
return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.handleSaveAsTemplate } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen } })], 1);
|
|
6
6
|
}, r = [], a = /* @__PURE__ */ i(
|
|
7
7
|
o,
|
|
8
8
|
n,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { defineComponent as s } from "vue";
|
|
2
|
-
import { useExport as
|
|
3
|
-
import { useVersionHistoryApi as
|
|
2
|
+
import { useExport as n } from "../../../composables/useExport.js";
|
|
3
|
+
import { useVersionHistoryApi as i } from "../../../composables/useVersionHistoryApi.js";
|
|
4
4
|
import { useEditorStore as p } from "../../../stores/editor.js";
|
|
5
5
|
import { InButtonV2 as m } from "@useinsider/design-system-vue";
|
|
6
|
-
const
|
|
6
|
+
const H = /* @__PURE__ */ s({
|
|
7
7
|
__name: "RightSlot",
|
|
8
|
-
setup(
|
|
9
|
-
const { exportHtml:
|
|
10
|
-
return { __sfc: !0, exportHtml:
|
|
11
|
-
if (
|
|
12
|
-
|
|
8
|
+
setup(a) {
|
|
9
|
+
const { exportHtml: r } = n(), { openVersionHistory: e, closeVersionHistory: t } = i(), o = p();
|
|
10
|
+
return { __sfc: !0, exportHtml: r, openVersionHistory: e, closeVersionHistory: t, editorStore: o, handleVersionHistory: () => {
|
|
11
|
+
if (o.isVersionHistoryOpen) {
|
|
12
|
+
t();
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
e();
|
|
16
|
+
}, handleSaveAsTemplate: async () => {
|
|
17
|
+
o.isSaveTemplateModalOpen = !0;
|
|
16
18
|
}, InButtonV2: m };
|
|
17
19
|
}
|
|
18
20
|
});
|
|
19
21
|
export {
|
|
20
|
-
|
|
22
|
+
H as default
|
|
21
23
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -3,7 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
date: number;
|
|
4
4
|
textAlign: string;
|
|
5
5
|
};
|
|
6
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
7
7
|
export default _default;
|
|
8
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
9
|
type __VLS_TypePropsToOption<T> = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
|
|
5
|
+
close: () => void;
|
|
6
|
+
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
type __VLS_TypePropsToOption<T> = {
|
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
+
} : {
|
|
13
|
+
type: import('vue').PropType<T[K]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import s from "./SaveTemplateModal.vue2.js";
|
|
2
|
+
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var l = function() {
|
|
4
|
+
var r = this, e = r._self._c, t = r._self._setupProxy;
|
|
5
|
+
return e(t.ModalWrapper, { attrs: { "cancel-button-text": t.trans("products.cancel"), description: t.trans("newsletter.save-template-description"), "is-open": t.props.isOpen, "primary-button-loading": t.saveState.saving || t.isLoadingHtml, "primary-button-text": t.trans("products.save"), title: t.trans("products.save-template") }, on: { cancel: t.closeModal, close: t.closeModal, save: t.saveTemplate } }, [e(t.InBasicTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", name: "templateName", "character-counter-status": !1, invalid: !!t.validationError, "invalid-message": t.validationError, "label-text": t.trans("products.template-name"), "placeholder-text": t.trans("newsletter.enter-template-name"), "tooltip-status": !1 }, model: { value: t.templateNameInput, callback: function(a) {
|
|
6
|
+
t.templateNameInput = typeof a == "string" ? a.trim() : a;
|
|
7
|
+
}, expression: "templateNameInput" } }), e(t.InMultiSelect, { staticClass: "template-category-dropdown mb-5 w-1", attrs: { "create-option-status": "", "search-status": "", "button-status": !1, "character-limit-validation-text": t.trans("validation-v2.duration-value", {
|
|
8
|
+
min: 1,
|
|
9
|
+
max: t.templateCategorySearchInputLimit
|
|
10
|
+
}), "create-button-label": t.trans("products.create-new-category"), "label-text": t.trans("products.template-category"), "loading-state": t.categoriesStore.loading || t.categoriesStore.loadingCreate, "max-character-limit": t.templateCategorySearchInputLimit, options: t.categoriesStore.mappedCategories, "placeholder-text": t.trans("products.select-template-category"), value: t.categoriesStore.selectedCategories }, on: { addOption: t.addOption, change: t.categoriesStore.setSelectedCategories, resetAllOptions: t.categoriesStore.setSelectedCategories, selectAllOptions: t.categoriesStore.setSelectedCategories } })], 1);
|
|
11
|
+
}, n = [], i = /* @__PURE__ */ o(
|
|
12
|
+
s,
|
|
13
|
+
l,
|
|
14
|
+
n,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
null
|
|
18
|
+
);
|
|
19
|
+
const d = i.exports;
|
|
20
|
+
export {
|
|
21
|
+
d as default
|
|
22
|
+
};
|