@useinsider/guido 1.0.0-beta.e096204 → 1.0.0-beta.e239762

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 (138) hide show
  1. package/README.md +89 -367
  2. package/dist/@types/generic.d.ts +4 -4
  3. package/dist/components/Guido.vue.d.ts +0 -6
  4. package/dist/components/Guido.vue.js +6 -6
  5. package/dist/components/Guido.vue2.js +15 -34
  6. package/dist/components/organisms/{header/HeaderWrapper.vue.js → top-bar/Header.vue.js} +7 -7
  7. package/dist/components/organisms/top-bar/Header.vue2.js +14 -0
  8. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue.js +17 -0
  9. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +11 -0
  10. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +17 -0
  11. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +11 -0
  12. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +18 -0
  13. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +14 -0
  14. package/dist/composables/useCustomInterfaceAppearance.js +9 -45
  15. package/dist/composables/useStripo.d.ts +2 -2
  16. package/dist/composables/useStripo.js +48 -59
  17. package/dist/composables/useTemplates.d.ts +1 -1
  18. package/dist/composables/useToaster.d.ts +0 -1
  19. package/dist/composables/useTranslations.d.ts +3 -1
  20. package/dist/enums/defaults.enum.d.ts +18 -0
  21. package/dist/guido.css +1 -1
  22. package/dist/library.d.ts +0 -1
  23. package/dist/static/editor.css.js +182 -0
  24. package/dist/stores/counter.d.ts +12 -0
  25. package/package.json +5 -5
  26. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -14
  27. package/dist/components/organisms/header/LeftSlot.vue.d.ts +0 -2
  28. package/dist/components/organisms/header/LeftSlot.vue.js +0 -17
  29. package/dist/components/organisms/header/LeftSlot.vue2.js +0 -13
  30. package/dist/components/organisms/header/MiddleSlot.vue.d.ts +0 -2
  31. package/dist/components/organisms/header/MiddleSlot.vue.js +0 -17
  32. package/dist/components/organisms/header/MiddleSlot.vue2.js +0 -22
  33. package/dist/components/organisms/header/RightSlot.vue.js +0 -17
  34. package/dist/components/organisms/header/RightSlot.vue2.js +0 -21
  35. package/dist/components/organisms/header/ViewOptions.vue.js +0 -18
  36. package/dist/components/organisms/header/ViewOptions.vue2.js +0 -15
  37. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  38. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  39. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +0 -14
  40. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +0 -22
  41. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +0 -18
  42. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  43. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  44. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  45. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +0 -2
  46. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +0 -18
  47. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +0 -23
  48. package/dist/composables/useActionsApi.d.ts +0 -4
  49. package/dist/composables/useActionsApi.js +0 -36
  50. package/dist/composables/useExport.d.ts +0 -3
  51. package/dist/composables/useExport.js +0 -45
  52. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  53. package/dist/composables/useHtmlCompiler.js +0 -16
  54. package/dist/composables/useHttp.js +0 -84
  55. package/dist/composables/usePartner.d.ts +0 -4
  56. package/dist/composables/usePartner.js +0 -16
  57. package/dist/composables/useToaster.js +0 -37
  58. package/dist/composables/useTranslations.js +0 -18
  59. package/dist/composables/useVersionHistoryApi.d.ts +0 -8
  60. package/dist/composables/useVersionHistoryApi.js +0 -53
  61. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  62. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  63. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  64. package/dist/enums/defaults.d.ts +0 -4
  65. package/dist/enums/defaults.js +0 -8
  66. package/dist/enums/displayConditions.d.ts +0 -2
  67. package/dist/enums/displayConditions.js +0 -80
  68. package/dist/guido.png +0 -0
  69. package/dist/mock/api/custom-fonts.d.ts +0 -2
  70. package/dist/node_modules/lodash-es/_Hash.js +0 -20
  71. package/dist/node_modules/lodash-es/_ListCache.js +0 -20
  72. package/dist/node_modules/lodash-es/_Map.js +0 -6
  73. package/dist/node_modules/lodash-es/_MapCache.js +0 -20
  74. package/dist/node_modules/lodash-es/_Symbol.js +0 -5
  75. package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
  76. package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
  77. package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
  78. package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
  79. package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
  80. package/dist/node_modules/lodash-es/_getMapData.js +0 -8
  81. package/dist/node_modules/lodash-es/_getNative.js +0 -9
  82. package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
  83. package/dist/node_modules/lodash-es/_getValue.js +0 -6
  84. package/dist/node_modules/lodash-es/_hashClear.js +0 -7
  85. package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
  86. package/dist/node_modules/lodash-es/_hashGet.js +0 -13
  87. package/dist/node_modules/lodash-es/_hashHas.js +0 -9
  88. package/dist/node_modules/lodash-es/_hashSet.js +0 -9
  89. package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
  90. package/dist/node_modules/lodash-es/_isMasked.js +0 -11
  91. package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
  92. package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
  93. package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
  94. package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
  95. package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
  96. package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
  97. package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  98. package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
  99. package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
  100. package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
  101. package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
  102. package/dist/node_modules/lodash-es/_objectToString.js +0 -7
  103. package/dist/node_modules/lodash-es/_root.js +0 -5
  104. package/dist/node_modules/lodash-es/_toSource.js +0 -17
  105. package/dist/node_modules/lodash-es/eq.js +0 -6
  106. package/dist/node_modules/lodash-es/isFunction.js +0 -12
  107. package/dist/node_modules/lodash-es/isObject.js +0 -7
  108. package/dist/node_modules/lodash-es/memoize.js +0 -18
  109. package/dist/services/stripoApi.d.ts +0 -7
  110. package/dist/services/stripoApi.js +0 -29
  111. package/dist/static/styles/base.css.js +0 -11
  112. package/dist/static/styles/components/alert-message.css.js +0 -39
  113. package/dist/static/styles/components/amp-block.css.js +0 -18
  114. package/dist/static/styles/components/base-input.css.js +0 -47
  115. package/dist/static/styles/components/button-group.css.js +0 -54
  116. package/dist/static/styles/components/button.css.js +0 -106
  117. package/dist/static/styles/components/combobox.css.js +0 -49
  118. package/dist/static/styles/components/counter.css.js +0 -42
  119. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  120. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  121. package/dist/static/styles/components/switcher.css.js +0 -11
  122. package/dist/static/styles/components/tabs.css.js +0 -97
  123. package/dist/static/styles/components/tools.css.js +0 -23
  124. package/dist/static/styles/components/version-history.css.js +0 -30
  125. package/dist/static/styles/components/wide-panel.css.js +0 -135
  126. package/dist/static/styles/variables.css.js +0 -23
  127. package/dist/stores/editor.d.ts +0 -5
  128. package/dist/stores/editor.js +0 -11
  129. package/dist/stores/version-history.d.ts +0 -80
  130. package/dist/stores/version-history.js +0 -28
  131. package/dist/utils/dateUtil.d.ts +0 -1
  132. package/dist/utils/dateUtil.js +0 -16
  133. package/dist/utils/htmlCompiler.d.ts +0 -12
  134. package/dist/utils/htmlCompiler.js +0 -70
  135. /package/dist/components/organisms/{header/HeaderWrapper.vue.d.ts → top-bar/Header.vue.d.ts} +0 -0
  136. /package/dist/components/organisms/{header/RightSlot.vue.d.ts → top-bar/HeaderLeftSlot.vue.d.ts} +0 -0
  137. /package/dist/components/organisms/{header/ViewOptions.vue.d.ts → top-bar/HeaderMiddleSlot.vue.d.ts} +0 -0
  138. /package/dist/components/organisms/{header/version-history/RestoreButton.vue.d.ts → top-bar/HeaderRightSlot.vue.d.ts} +0 -0
package/README.md CHANGED
@@ -1,33 +1,25 @@
1
- <p align="center">
2
- <a href="https://www.youtube.com/shorts/Y0RwBeMezL4" target="_blank" rel="noopener noreferrer">
3
- <img width="180" src="./public/guido.png" alt="Guido logo">
4
- </a>
5
- </p>
1
+ # @useinsider/guido-plugin
6
2
 
7
-
8
- # @useinsider/guido
9
-
10
- Guido is a Vue 2 + TypeScript wrapper for the Stripo Email Editor plugin. Easily embed the professional email editor in your Vue applications with a clean, customizable interface.
3
+ Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.
11
4
 
12
5
  ## 📦 Install
13
-
14
6
  ```bash
15
7
  npm install @useinsider/guido
16
8
  ```
17
9
 
18
- ## 🚀 Usage
19
-
20
- ### Basic Usage
21
-
22
- ```html
10
+ ## 🚀 Usage (Vue 2)
11
+ ```vue
23
12
  <template>
24
- <div>
25
- <Guido
26
- :email-id="emailId"
27
- :user-id="userId"
28
- :guido-config="guidoConfig"
29
- />
30
- </div>
13
+ <Guido
14
+ email-id="abc123"
15
+ :api="apiEndpoints"
16
+ :extensions="extensions"
17
+ :insider-stripo-config="insiderStripoConfig"
18
+ @save="handleSave"
19
+ @export:requested="onExportRequested"
20
+ @export:ready="handleHtml"
21
+ @close="onClose"
22
+ />
31
23
  </template>
32
24
 
33
25
  <script lang="ts">
@@ -39,369 +31,99 @@ export default {
39
31
  },
40
32
  data() {
41
33
  return {
42
- emailId: 'abc123',
43
- userId: '12345',
44
- guidoConfig: {
45
- translationsPath: 'window.trans.en'
46
- htmlCompilerRules: [],
47
- ignoreDefaultHtmlCompilerRules: false,
34
+ apiEndpoints: {
35
+ dynamicContent: '/api/dynamic-content',
36
+ unsubPages: '/api/unsub-pages',
37
+ header: '/api/header',
38
+ footer: '/api/footer',
39
+ productName: '/api/product-name',
40
+ productVersion: '/api/product-version',
41
+ token: '/api/stripo-token'
42
+ },
43
+ extensions: {
44
+ dynamicContent: true,
45
+ unsubPages: true,
46
+ header: false,
47
+ footer: false
48
48
  }
49
49
  };
50
- }
51
- };
52
- </script>
53
- ```
54
-
55
- ## 📚 API
56
-
57
- ### Guido Component Props
58
-
59
- | Prop | Type | Required | Default | Description |
60
- |------|------|----------|---------|-------------|
61
- | `emailId` | `string` | ✅ | - | Unique identifier for the email draft |
62
- | `userId` | `string` | ✅ | - | Unique identifier for the user draft |
63
- | `username` | `string` | ⚪ | Guido User | User name |
64
- | `partnerName` | `string` | ⚪ | Getting from URL host | Unique identifier for the partner draft |
65
- | `productType` | `string` | ⚪ | Getting from URL path | Unique identifier for the product draft |
66
- | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
67
-
68
- ### GuidoConfig Interface
69
-
70
- ```typescript
71
- interface GuidoConfig {
72
- translationsPath: string;
73
- htmlCompilerRules: CompilerRule[];
74
- ignoreDefaultHtmlCompilerRules: boolean;
75
- }
76
- ```
77
-
78
- | Property | Type | Default | Description |
79
- |----------|------|---------|-------------|
80
- | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
81
- | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
82
- | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
83
-
84
- ### TypeScript Types
85
-
86
- The library exports the following TypeScript types:
87
-
88
- ```typescript
89
- // Main component
90
- import { Guido } from '@useinsider/guido';
91
-
92
- // Types
93
- import type { GuidoConfig } from '@useinsider/guido';
94
- import type { StripoEventType } from '@useinsider/guido';
95
- ```
96
-
97
- ### StripoEventType
98
-
99
- ```typescript
100
- type StripoEventType =
101
- | 'save'
102
- | 'export'
103
- | 'close'
104
- | 'autosave'
105
- | 'publish'
106
- | 'export:requested'
107
- | 'export:ready';
108
- ```
109
-
110
- ## 🔨 HTML Compiler Rules
111
-
112
- 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.
113
-
114
- ### Rule Types
115
-
116
- There are 4 types of compiler rules:
117
-
118
- #### 1. Replace Rule
119
- Replace specific strings in HTML content.
120
-
121
- ```typescript
122
- {
123
- id: 'fix-encoding',
124
- description: 'Fix URL encoding issues',
125
- type: 'replace',
126
- search: '{%22', // String to find
127
- replacement: '%7B%22', // String to replace with
128
- replaceAll: true, // Replace all occurrences (default: true)
129
- priority: 10 // Execution priority (lower = earlier)
130
- }
131
- ```
132
-
133
- #### 2. Regex Rule
134
- Use regular expressions for complex pattern matching and replacement.
135
-
136
- ```typescript
137
- {
138
- id: 'remove-comments',
139
- description: 'Remove HTML comments',
140
- type: 'regex',
141
- pattern: '<!--.*?-->', // Regex pattern
142
- replacement: '', // Replacement string
143
- flags: 'g', // Regex flags (default: 'g')
144
- priority: 20
145
- }
146
- ```
147
-
148
- #### 3. Remove Rule
149
- Remove specific strings or patterns from HTML content.
150
-
151
- ```typescript
152
- {
153
- id: 'cleanup-scripts',
154
- description: 'Remove unwanted script tags',
155
- type: 'remove',
156
- targets: [ // Array of strings or RegExp objects
157
- '<script src="unwanted.js"></script>',
158
- /onclick="[^"]*"/g
159
- ],
160
- priority: 30
161
- }
162
- ```
163
-
164
- #### 4. Custom Rule
165
- Define complex transformation logic with a custom processor function.
166
-
167
- ```typescript
168
- {
169
- id: 'add-meta-tags',
170
- description: 'Add custom meta tags to head',
171
- type: 'custom',
172
- processor: (html: string): string => {
173
- // Custom transformation logic
174
- const metaTags = '<meta name="custom" content="value">';
175
- return html.replace('</head>', `${metaTags}</head>`);
176
50
  },
177
- priority: 40
178
- }
179
- ```
180
-
181
- ### Using HTML Compiler Rules
182
-
183
- #### Basic Usage with Custom Rules
184
-
185
- ```typescript
186
- const guidoConfig = {
187
- translationsPath: 'window.trans.en',
188
- htmlCompilerRules: [
189
- {
190
- id: 'replace-domain',
191
- description: 'Replace old domain with new one',
192
- type: 'replace',
193
- search: 'old-domain.com',
194
- replacement: 'new-domain.com',
195
- replaceAll: true,
196
- priority: 10
51
+ methods: {
52
+ handleSave(data: any) {
53
+ console.log('Saved:', data);
197
54
  },
198
- {
199
- id: 'remove-tracking',
200
- description: 'Remove tracking pixels',
201
- type: 'regex',
202
- pattern: '<img[^>]*tracking[^>]*>',
203
- replacement: '',
204
- flags: 'gi',
205
- priority: 20
206
- }
207
- ]
208
- };
209
- ```
210
-
211
- #### Ignoring Default Rules
212
-
213
- ```typescript
214
- const guidoConfig = {
215
- translationsPath: 'window.trans.en',
216
- ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
217
- htmlCompilerRules: [
218
- // Only your custom rules will be applied
219
- {
220
- id: 'custom-transformation',
221
- type: 'replace',
222
- search: 'old-text',
223
- replacement: 'new-text',
224
- priority: 1
55
+ handleHtml({ html }: { html: string }) {
56
+ console.log('HTML ready:', html);
57
+ },
58
+ onExportRequested() {
59
+ console.log('Export started');
60
+ },
61
+ onClose() {
62
+ console.log('Closed');
225
63
  }
226
- ]
64
+ }
227
65
  };
66
+ </script>
228
67
  ```
229
68
 
230
- ### Rule Execution Order
231
-
232
- Rules are executed in priority order (lower numbers first). Rules with the same priority are executed in array order.
233
-
234
- - **Priority 1-99**: Reserved for critical transformations
235
- - **Priority 100-999**: Standard transformations
236
- - **Priority 1000+**: Additional custom rules (automatically assigned)
237
-
238
- ### Default Rules
239
-
240
- Guido includes several default rules for common email HTML optimizations:
241
-
242
- - **URL encoding fixes**: Fixes malformed URL encoding in dynamic content
243
- - **Template tag restoration**: Restores `{{}}` template tags that got URL encoded
244
- - **HTML entity decoding**: Converts `&lt;` and `&gt;` back to `<` and `>`
245
- - **Cleanup rules**: Removes unwanted iframe and style elements
246
- - **MSO conditions**: Manages Outlook-specific conditional comments
247
- - **Domain replacement**: Updates old image domains to current ones
248
-
249
- You can view all default rules in: `src/config/compiler/htmlCompilerRules.ts`
250
-
251
- ### CompilerRule Interface
252
-
253
- ```typescript
254
- type CompilerRuleType = 'replace' | 'regex' | 'remove' | 'custom';
255
-
256
- interface BaseCompilerRule {
257
- id: string;
258
- description?: string;
259
- priority: number;
260
- }
261
-
262
- interface ReplaceRule extends BaseCompilerRule {
263
- type: 'replace';
264
- search: string;
265
- replacement: string;
266
- replaceAll?: boolean; // Default: true
267
- }
268
-
269
- interface RegexRule extends BaseCompilerRule {
270
- type: 'regex';
271
- pattern: string;
272
- replacement: string;
273
- flags?: string; // Default: 'g'
274
- }
275
-
276
- interface RemoveRule extends BaseCompilerRule {
277
- type: 'remove';
278
- targets: (string | RegExp)[]; // Array of strings or RegExp objects
279
- }
280
-
281
- interface CustomRule extends BaseCompilerRule {
282
- type: 'custom';
283
- processor: (html: string) => string;
284
- }
69
+ ## 📚 API
70
+ ### `<StripoEditor />` Props
71
+ | Prop | Type | Required | Description |
72
+ |-------------|----------|----------|----------------------------|
73
+ | emailId | string | ✅ | Stripo email draft ID |
74
+ | iframeId | string | ❌ | Custom iframe ID |
75
+ | api | object | ❌ | Custom API endpoints |
76
+ | extensions | object | ❌ | Enable/disable extensions |
77
+ | insiderStripoConfig | object | ❌ | Insider Stripo configuration |
78
+
79
+ ### Extensions
80
+ | Extension | Type | Default | Description |
81
+ |----------------|-----------|---------|--------------------------------|
82
+ | dynamicContent | boolean | true | Dynamic content functionality |
83
+ | unsubPages | boolean | true | Unsubscribe pages feature |
84
+ | header | boolean | true | Header customization |
85
+ | footer | boolean | true | Footer customization |
86
+
87
+ ### Insider Stripo Configuration
88
+ | Property | Type | Default | Description |
89
+ |-------------------|----------|---------|--------------------------------|
90
+ | translationsPath | string | 'window.trans.en | JS Path to translations file |
91
+
92
+ ### API Endpoints
93
+ | Endpoint | Default Path | Description |
94
+ |-------------------|------------------------|--------------------------------|
95
+ | dynamicContent | /api/dynamic-content | Dynamic content endpoint |
96
+ | unsubPages | /api/unsub-pages | Unsubscribe pages endpoint |
97
+ | header | /api/header | Header endpoint |
98
+ | footer | /api/footer | Footer endpoint |
99
+ | productName | /api/product-name | Product name endpoint |
100
+ | productVersion | /api/product-version | Product version endpoint |
101
+ | token | /api/stripo-token | Authentication token endpoint |
102
+
103
+ ### Events
104
+ | Event | Payload | Description |
105
+ |-------------------|------------------------|--------------------------------|
106
+ | `save` | any | Triggered on save |
107
+ | `export:requested`| void | Triggered when export starts |
108
+ | `export:ready` | { html: string } | Triggered when HTML is ready |
109
+ | `close` | void | Triggered when editor closes |
285
110
 
286
- type CompilerRule = ReplaceRule | RegexRule | RemoveRule | CustomRule;
287
- ```
288
111
 
289
112
  ---
290
113
 
291
- ## 🔧 Development
292
-
293
- ### Prerequisites
294
-
295
- - 🧄 `Bun` (strongly recommended)
296
- or
297
- - NodeJS 18+ & `npm`
298
-
299
- ### Setup
300
-
114
+ ## 🛠 Development
301
115
  ```bash
302
- # Install dependencies
303
116
  bun install
304
-
305
- # Start development server
306
117
  bun start
307
-
308
- # Build for production
309
- bun run build
310
-
311
- # Type checking
312
- bun run type-check
313
-
314
- # Linting
315
- bun run lint
316
118
  ```
317
119
 
318
- ### Environment Variables
319
-
320
- Create a `.env` file with the following variables: (You can get env variables from your senior)
321
-
322
- ```env
323
- VITE_STRIPO_PLUGIN_ID=your_plugin_id
324
- VITE_STRIPO_SECRET_KEY=your_secret_key
325
- VITE_STRIPO_ROLE=your_role
326
- ```
327
-
328
- ### Project Structure
329
-
330
- ```
331
- src/
332
- ├── components/ # Vue components
333
- ├── composables/ # Vue composables & business logic
334
- ├── services/ # API layer
335
- ├── stores/ # State management
336
- ├── @types/ # TypeScript definitions
337
- ├── static/ # Static assets & templates
338
- ├── utils/ # Utility functions
339
- ├── enums/ # Constants & enums
340
- ├── mock/ # Mock data for development
341
- ├── plugins/ # Vue plugins
342
- └── library.ts # Main export
343
- ```
344
-
345
- ## 🌐 i18n
346
- Before running the project, it sends to request to inone.useinsider.com/translations and writes the JSON file into - [trans.json](src/mock/responses/trans.json).
347
- It allows to use production or local translations on your code. 🚀
348
- Example usage:
349
- ```js
350
- import { useTranslations } from '@@/Composables/useTranslations';
351
-
352
- const trans = useTranslations();
353
-
354
- // use everywhere like this:
355
- trans('foo.bar')
356
- ```
357
-
358
- ## 📦 Build Output
359
-
360
- The library builds to multiple formats:
361
-
362
- - **ES Module**: `dist/library.js` (recommended)
363
- - **CSS**: `dist/guido.css` (custom styles)
364
-
365
- ### Package Exports
366
-
367
- ```json
368
- {
369
- "exports": {
370
- ".": {
371
- "import": "./dist/library.js",
372
- "types": "./dist/components/Guido.vue.d.ts",
373
- "require": "./dist/components/Guido.vue.js"
374
- },
375
- "./style": "./dist/guido.css"
376
- }
377
- }
120
+ Build & types:
121
+ ```bash
122
+ bun run build
378
123
  ```
379
124
 
380
- ## 🤝 Contributing
381
- - PR Titles should be structured like `TASK-ID | 🔥 | Some Clear Task Descriptions`
382
- - PR Labels should be filled.
383
- - PR Assignee required.
384
- - Tests should be covered.
385
- - All required checks should be passed before sending review request.
386
-
387
- ## 📄 License
388
-
389
- ISC License
390
-
391
125
  ---
392
126
 
393
- ## 🔗 Related
394
-
395
- - [Stripo Email Editor](https://stripo.email/) - The underlying email editor
396
- - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
397
-
398
- ## 🎯 TODO:
399
- - CSS part should be optimized with variables & `sass-loader`.
400
- - Master Version Generator should be fixed.
401
- - Playwright integration
402
- - Commitlint & Precommit Hooks integration
403
- - We need to emit save event and we should return template config to it
404
- - Default template should be same with production
405
- - Open Guido with saved template
406
- - Get User ID, Email and Unique Template ID as dynamic from props
407
- - Get Pre-built display conditions from API
127
+ TODO:
128
+ [ ] - Default Template @edugencioglu
129
+ [ ] - Using CSS variables into [editor.css](./src/static/editor.css) @berkansezer-useinsider
@@ -1,6 +1,6 @@
1
- import type { CompilerRule } from './html-compiler';
2
- export type GuidoConfig = {
1
+ export type Translations = {
2
+ [key: string]: string;
3
+ };
4
+ export type InsiderStripoConfig = {
3
5
  translationsPath: string;
4
- htmlCompilerRules?: CompilerRule[];
5
- ignoreDefaultHtmlCompilerRules?: boolean;
6
6
  };
@@ -1,11 +1,5 @@
1
- import type { GuidoConfig } from '@@/Types/generic';
2
1
  type __VLS_Props = {
3
2
  emailId: string;
4
- userId: string;
5
- partnerName?: string;
6
- productType?: string;
7
- username?: string;
8
- guidoConfig: GuidoConfig;
9
3
  };
10
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, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
11
5
  export default _default;
@@ -2,17 +2,17 @@ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
- var e = this, r = e._self._c, t = e._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.HeaderWrapper), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
- }, _ = [], a = /* @__PURE__ */ i(
5
+ var t = this, r = t._self._c, e = t._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor-wrapper" }, [r(e.Header), r("div", { staticClass: "guido-editor-container", attrs: { id: "guido-editor" } })], 1);
7
+ }, a = [], n = /* @__PURE__ */ i(
8
8
  o,
9
9
  s,
10
- _,
10
+ a,
11
11
  !1,
12
12
  null,
13
- "8e229594"
13
+ "c14163ad"
14
14
  );
15
- const f = a.exports;
15
+ const f = n.exports;
16
16
  export {
17
17
  f as default
18
18
  };
@@ -1,43 +1,24 @@
1
- import { defineComponent as f, onMounted as c } from "vue";
2
- import { usePartner as g } from "../composables/usePartner.js";
3
- import { useStripo as _ } from "../composables/useStripo.js";
4
- import { useTemplates as y } from "../composables/useTemplates.js";
5
- import { DefaultUsername as C, DefaultGuidoConfig as T } from "../enums/defaults.js";
6
- import w from "./organisms/header/HeaderWrapper.vue.js";
7
- const h = /* @__PURE__ */ f({
1
+ import { defineComponent as a, onMounted as n } from "vue";
2
+ import { useStripo as m } from "../composables/useStripo.js";
3
+ import { useTemplates as p } from "../composables/useTemplates.js";
4
+ import s from "./organisms/top-bar/Header.vue.js";
5
+ const f = /* @__PURE__ */ a({
8
6
  __name: "Guido",
9
7
  props: {
10
- emailId: null,
11
- userId: null,
12
- partnerName: null,
13
- productType: null,
14
- username: null,
15
- guidoConfig: null
8
+ emailId: null
16
9
  },
17
- setup(d) {
18
- const o = d, { getPartnerName: r, getProductType: t } = g(), {
19
- emailId: n,
20
- userId: i,
21
- guidoConfig: a,
22
- partnerName: u = r(),
23
- productType: p = t(),
24
- username: m = C
25
- } = o;
26
- window.GuidoConfig = {
27
- ...T,
28
- ...a
29
- };
30
- const { initPlugin: l } = _({ emailId: n, userId: i, username: m, partnerName: u, productType: p }), { getDefaultTemplate: s } = y();
31
- return c(async () => {
10
+ setup(i) {
11
+ const e = i, { initPlugin: o } = m(e.emailId), { getDefaultTemplate: r } = p();
12
+ return n(async () => {
32
13
  try {
33
- const e = await s();
34
- await l(e);
35
- } catch (e) {
36
- console.error("Failed to initialize Stripo editor:", e);
14
+ const t = await r();
15
+ await o(t);
16
+ } catch (t) {
17
+ console.error("Failed to initialize Stripo editor:", t);
37
18
  }
38
- }), { __sfc: !0, props: o, getPartnerName: r, getProductType: t, emailId: n, userId: i, guidoConfig: a, partnerName: u, productType: p, username: m, initPlugin: l, getDefaultTemplate: s, HeaderWrapper: w };
19
+ }), { __sfc: !0, props: e, initPlugin: o, getDefaultTemplate: r, Header: s };
39
20
  }
40
21
  });
41
22
  export {
42
- h as default
23
+ f as default
43
24
  };
@@ -1,17 +1,17 @@
1
- import t from "./HeaderWrapper.vue2.js";
1
+ import t from "./Header.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
3
+ var a = function() {
4
4
  var o = this, r = o._self._c, e = o._self._setupProxy;
5
- return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
6
- }, a = [], _ = /* @__PURE__ */ s(
5
+ return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.HeaderLeftSlot), r(e.HeaderMiddleSlot), r(e.HeaderRightSlot)], 1)]);
6
+ }, n = [], _ = /* @__PURE__ */ s(
7
7
  t,
8
- n,
9
8
  a,
9
+ n,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const d = _.exports;
14
+ const c = _.exports;
15
15
  export {
16
- d as default
16
+ c as default
17
17
  };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InContainer as r } from "@useinsider/design-system-vue";
3
+ import o from "./HeaderLeftSlot.vue.js";
4
+ import t from "./HeaderMiddleSlot.vue.js";
5
+ import m from "./HeaderRightSlot.vue.js";
6
+ const _ = /* @__PURE__ */ e({
7
+ __name: "Header",
8
+ setup(f) {
9
+ return { __sfc: !0, InContainer: r, HeaderLeftSlot: o, HeaderMiddleSlot: t, HeaderRightSlot: m };
10
+ }
11
+ });
12
+ export {
13
+ _ as default
14
+ };
@@ -0,0 +1,17 @@
1
+ import n from "./HeaderLeftSlot.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var _ = function() {
4
+ var t = this, e = t._self._c, r = t._self._setupProxy;
5
+ return e("div", [e(r.InButtonV2, { attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } })], 1);
6
+ }, a = [], s = /* @__PURE__ */ o(
7
+ n,
8
+ _,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const i = s.exports;
15
+ export {
16
+ i as default
17
+ };
@@ -0,0 +1,11 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
3
+ const _ = /* @__PURE__ */ t({
4
+ __name: "HeaderLeftSlot",
5
+ setup(o) {
6
+ return { __sfc: !0, InButtonV2: e };
7
+ }
8
+ });
9
+ export {
10
+ _ as default
11
+ };