@useinsider/guido 1.0.0-beta.67efae2 → 1.0.0-beta.6ebce36
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 +30 -229
- package/dist/@types/generic.d.ts +0 -12
- package/dist/App.vue.d.ts +1 -1
- package/dist/components/Guido.vue.d.ts +3 -16
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +25 -60
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +8 -10
- 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 +9 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +14 -29
- 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/composables/useActionsApi.d.ts +0 -1
- package/dist/composables/useActionsApi.js +12 -14
- package/dist/composables/useHtmlCompiler.js +8 -9
- package/dist/composables/useStripo.js +29 -41
- package/dist/composables/useTemplates.d.ts +5 -0
- package/dist/composables/useTemplates.js +27 -0
- package/dist/composables/useTranslations.js +2 -3
- package/dist/config/compiler/htmlCompilerRules.js +6 -6
- package/dist/enums/defaults.js +5 -10
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.d.ts +1 -2
- package/dist/services/stripoApi.js +7 -27
- package/dist/static/templates/default/index.html.js +5 -0
- package/dist/static/templates/default/style.css.js +119 -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/useConfig.d.ts +0 -5
- package/dist/composables/useConfig.js +0 -11
- package/dist/composables/useGuidoActions.d.ts +0 -46
- package/dist/composables/useGuidoActions.js +0 -37
- package/dist/composables/useProvideInject.d.ts +0 -14
- package/dist/composables/useProvideInject.js +0 -17
- 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/mock/api/default-template.d.ts +0 -2
- 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/node_modules/lodash-es/_Stack.js +0 -18
- package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
- package/dist/node_modules/lodash-es/_apply.js +0 -16
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -19
- package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
- package/dist/node_modules/lodash-es/_assignValue.js +0 -10
- package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
- package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
- package/dist/node_modules/lodash-es/_baseFor.js +0 -5
- package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
- package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
- package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
- package/dist/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
- package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
- package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
- package/dist/node_modules/lodash-es/_copyArray.js +0 -9
- package/dist/node_modules/lodash-es/_copyObject.js +0 -14
- package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
- package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
- package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
- package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
- package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
- package/dist/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
- package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
- package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
- package/dist/node_modules/lodash-es/_overArg.js +0 -8
- package/dist/node_modules/lodash-es/_overRest.js +0 -15
- package/dist/node_modules/lodash-es/_safeGet.js +0 -7
- package/dist/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/lodash-es/_shortOut.js +0 -16
- package/dist/node_modules/lodash-es/_stackClear.js +0 -7
- package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
- package/dist/node_modules/lodash-es/_stackGet.js +0 -6
- package/dist/node_modules/lodash-es/_stackHas.js +0 -6
- package/dist/node_modules/lodash-es/_stackSet.js +0 -17
- package/dist/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
- package/dist/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
- package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/lodash-es/merge.js +0 -8
- package/dist/node_modules/lodash-es/stubFalse.js +0 -6
- package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
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,16 +23,9 @@ npm install @useinsider/guido
|
|
|
26
23
|
<template>
|
|
27
24
|
<div>
|
|
28
25
|
<Guido
|
|
29
|
-
|
|
30
|
-
:template-id="templateId"
|
|
26
|
+
:email-id="emailId"
|
|
31
27
|
:user-id="userId"
|
|
32
28
|
:guido-config="guidoConfig"
|
|
33
|
-
:html="initialHtml"
|
|
34
|
-
:css="initialCss"
|
|
35
|
-
@dynamic-content:open="handleDynamicContentOpen"
|
|
36
|
-
@back="handleBack"
|
|
37
|
-
@save:start="handleSaveStart"
|
|
38
|
-
@save:complete="handleSaveComplete"
|
|
39
29
|
/>
|
|
40
30
|
</div>
|
|
41
31
|
</template>
|
|
@@ -49,60 +39,14 @@ export default {
|
|
|
49
39
|
},
|
|
50
40
|
data() {
|
|
51
41
|
return {
|
|
52
|
-
|
|
53
|
-
userId: '
|
|
54
|
-
initialHtml: '<p>Initial HTML content</p>',
|
|
55
|
-
initialCss: 'p { color: #333; }',
|
|
42
|
+
emailId: 'abc123',
|
|
43
|
+
userId: '12345',
|
|
56
44
|
guidoConfig: {
|
|
57
|
-
translationsPath: 'window.trans.en'
|
|
45
|
+
translationsPath: 'window.trans.en'
|
|
58
46
|
htmlCompilerRules: [],
|
|
59
47
|
ignoreDefaultHtmlCompilerRules: false,
|
|
60
|
-
|
|
61
|
-
dynamicContent: true,
|
|
62
|
-
saveAsTemplate: true,
|
|
63
|
-
versionHistory: true
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
dynamicContentModalVisible: false
|
|
48
|
+
}
|
|
67
49
|
};
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
methods: {
|
|
71
|
-
handleDynamicContentOpen(detail) {
|
|
72
|
-
console.log('Dynamic content requested:', detail);
|
|
73
|
-
this.dynamicContentModalVisible = true;
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
handleBack() {
|
|
77
|
-
console.log('User clicked back button');
|
|
78
|
-
// Handle navigation back
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
handleSaveStart() {
|
|
82
|
-
console.log('Save process started');
|
|
83
|
-
// Show loading indicator
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
handleSaveComplete(template) {
|
|
87
|
-
console.log('Save completed:', template);
|
|
88
|
-
// Handle saved template data
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
// ⚠️ Your own Dynamic Content Modal should have this id: #guido-dynamic-content-modal
|
|
92
|
-
handleDynamicContentInsert() {
|
|
93
|
-
this.$refs.guidoEditor?.dynamicContent.insert({
|
|
94
|
-
text: 'Display Text',
|
|
95
|
-
value: 'actual-value',
|
|
96
|
-
fallback: 'Fallback Text'
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
this.dynamicContentModalVisible = false;
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
// ⚠️ It's mandatory. There is no way to understand if user closes the modal without selection.
|
|
103
|
-
handleDynamicContentClose() {
|
|
104
|
-
this.$refs.guidoEditor?.dynamicContent.close();
|
|
105
|
-
}
|
|
106
50
|
}
|
|
107
51
|
};
|
|
108
52
|
</script>
|
|
@@ -114,42 +58,20 @@ export default {
|
|
|
114
58
|
|
|
115
59
|
| Prop | Type | Required | Default | Description |
|
|
116
60
|
|------|------|----------|---------|-------------|
|
|
117
|
-
| `
|
|
118
|
-
| `userId` | `string` | ✅ | - | Unique identifier for the user |
|
|
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 |
|
|
119
66
|
| `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
|
|
120
|
-
| `partnerName` | `string` | ⚪ | From URL host | Partner identifier |
|
|
121
|
-
| `productType` | `string` | ⚪ | From URL path | Product type identifier |
|
|
122
|
-
| `username` | `string` | ⚪ | `'Guido User'` | Display name for the user |
|
|
123
|
-
| `html` | `string` | ⚪ | `''` | Initial HTML content for the template |
|
|
124
|
-
| `css` | `string` | ⚪ | `''` | Initial CSS styles for the template |
|
|
125
|
-
|
|
126
|
-
### Guido Component Events
|
|
127
|
-
|
|
128
|
-
| Event | Payload | Description |
|
|
129
|
-
|-------|---------|-------------|
|
|
130
|
-
| `dynamic-content:open` | `DynamicContent \| null` | Fired when user requests to insert dynamic content |
|
|
131
|
-
| `back` | - | Fired when user clicks the back button |
|
|
132
|
-
| `save:start` | - | Fired when the save process begins |
|
|
133
|
-
| `save:complete` | `Omit<Template, 'forceRecreate'>` | Fired when template is successfully saved |
|
|
134
|
-
|
|
135
|
-
### Guido Exposed Methods
|
|
136
|
-
```typescript
|
|
137
|
-
dynamicContent.insert(DynamicContent);
|
|
138
|
-
dynamicContent.close();
|
|
139
|
-
```
|
|
140
67
|
|
|
141
|
-
###
|
|
68
|
+
### GuidoConfig Interface
|
|
142
69
|
|
|
143
70
|
```typescript
|
|
144
71
|
interface GuidoConfig {
|
|
145
72
|
translationsPath: string;
|
|
146
|
-
htmlCompilerRules
|
|
147
|
-
ignoreDefaultHtmlCompilerRules
|
|
148
|
-
features: {
|
|
149
|
-
dynamicContent: boolean;
|
|
150
|
-
saveAsTemplate: boolean;
|
|
151
|
-
versionHistory: boolean;
|
|
152
|
-
};
|
|
73
|
+
htmlCompilerRules: CompilerRule[];
|
|
74
|
+
ignoreDefaultHtmlCompilerRules: boolean;
|
|
153
75
|
}
|
|
154
76
|
```
|
|
155
77
|
|
|
@@ -158,25 +80,6 @@ interface GuidoConfig {
|
|
|
158
80
|
| `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
|
|
159
81
|
| `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
|
|
160
82
|
| `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
|
|
161
|
-
| `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
|
|
162
|
-
| `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
|
|
163
|
-
| `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
|
|
164
|
-
| `features.versionHistory` | `boolean` | `true` | Enable version history feature |
|
|
165
|
-
|
|
166
|
-
```typescript
|
|
167
|
-
interface DynamicContent {
|
|
168
|
-
value: string;
|
|
169
|
-
text: string;
|
|
170
|
-
fallback?: string;
|
|
171
|
-
}
|
|
172
|
-
```
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
| Property | Type | Default | Description |
|
|
176
|
-
|----------|------|---------|-------------|
|
|
177
|
-
| `value` | `string` | '' | Value of the dynamic content |
|
|
178
|
-
| `text` | `string` | '' | Visible value of the dynamic content |
|
|
179
|
-
| `fallback?` | `string` | '' | Fallback value of the dynamic content. Optional |
|
|
180
83
|
|
|
181
84
|
### TypeScript Types
|
|
182
85
|
|
|
@@ -191,6 +94,19 @@ import type { GuidoConfig } from '@useinsider/guido';
|
|
|
191
94
|
import type { StripoEventType } from '@useinsider/guido';
|
|
192
95
|
```
|
|
193
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
|
+
|
|
194
110
|
## 🔨 HTML Compiler Rules
|
|
195
111
|
|
|
196
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.
|
|
@@ -269,11 +185,6 @@ Define complex transformation logic with a custom processor function.
|
|
|
269
185
|
```typescript
|
|
270
186
|
const guidoConfig = {
|
|
271
187
|
translationsPath: 'window.trans.en',
|
|
272
|
-
features: {
|
|
273
|
-
dynamicContent: true,
|
|
274
|
-
saveAsTemplate: true,
|
|
275
|
-
versionHistory: false // Disable version history
|
|
276
|
-
},
|
|
277
188
|
htmlCompilerRules: [
|
|
278
189
|
{
|
|
279
190
|
id: 'replace-domain',
|
|
@@ -302,11 +213,6 @@ const guidoConfig = {
|
|
|
302
213
|
```typescript
|
|
303
214
|
const guidoConfig = {
|
|
304
215
|
translationsPath: 'window.trans.en',
|
|
305
|
-
features: {
|
|
306
|
-
dynamicContent: true,
|
|
307
|
-
saveAsTemplate: true,
|
|
308
|
-
versionHistory: true
|
|
309
|
-
},
|
|
310
216
|
ignoreDefaultHtmlCompilerRules: true, // Skip all default rules
|
|
311
217
|
htmlCompilerRules: [
|
|
312
218
|
// Only your custom rules will be applied
|
|
@@ -436,87 +342,6 @@ src/
|
|
|
436
342
|
└── library.ts # Main export
|
|
437
343
|
```
|
|
438
344
|
|
|
439
|
-
## 🔌 Provide/Inject Utilities
|
|
440
|
-
|
|
441
|
-
Guido includes type-safe utilities for Vue's provide/inject system to facilitate dependency injection between components.
|
|
442
|
-
|
|
443
|
-
### useProvideInject
|
|
444
|
-
|
|
445
|
-
The `useProvideInject` composable provides two helper functions for type-safe dependency injection:
|
|
446
|
-
|
|
447
|
-
#### Basic Usage
|
|
448
|
-
|
|
449
|
-
```typescript
|
|
450
|
-
// Parent component
|
|
451
|
-
import { provideValue } from '@useinsider/guido';
|
|
452
|
-
import { InjectionKey } from 'vue';
|
|
453
|
-
|
|
454
|
-
// Define a typed injection key
|
|
455
|
-
const MyServiceKey: InjectionKey<MyService> = Symbol('MyService');
|
|
456
|
-
|
|
457
|
-
// Provide the value
|
|
458
|
-
const myService = new MyService();
|
|
459
|
-
provideValue(MyServiceKey, myService);
|
|
460
|
-
|
|
461
|
-
// Child component
|
|
462
|
-
import { useInjectedValue } from '@useinsider/guido';
|
|
463
|
-
|
|
464
|
-
// Inject the value with type safety
|
|
465
|
-
const myService = useInjectedValue(MyServiceKey);
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
#### With Default Value
|
|
469
|
-
|
|
470
|
-
```typescript
|
|
471
|
-
// Inject with a fallback value
|
|
472
|
-
const myService = useInjectedValue(MyServiceKey, new DefaultService());
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
#### Error Handling
|
|
476
|
-
|
|
477
|
-
The `useInjectedValue` function will throw a descriptive error if no provider is found and no default value is provided:
|
|
478
|
-
|
|
479
|
-
```typescript
|
|
480
|
-
// This will throw an error if no provider exists
|
|
481
|
-
try {
|
|
482
|
-
const myService = useInjectedValue(MyServiceKey);
|
|
483
|
-
} catch (error) {
|
|
484
|
-
console.error('No provider found for MyService');
|
|
485
|
-
}
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
### API Reference
|
|
489
|
-
|
|
490
|
-
#### `provideValue`
|
|
491
|
-
|
|
492
|
-
```typescript
|
|
493
|
-
provideValue<T>(key: InjectionKey<T>, value: T): void
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
Provides a value using Vue's provide system with type safety.
|
|
497
|
-
|
|
498
|
-
| Parameter | Type | Description |
|
|
499
|
-
|-----------|------|-------------|
|
|
500
|
-
| `key` | `InjectionKey<T>` | The typed injection key |
|
|
501
|
-
| `value` | `T` | The value to provide |
|
|
502
|
-
|
|
503
|
-
#### `useInjectedValue`
|
|
504
|
-
|
|
505
|
-
```typescript
|
|
506
|
-
useInjectedValue<T>(key: InjectionKey<T>, defaultValue?: T): T
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
Injects a value using Vue's inject system with type safety and error handling.
|
|
510
|
-
|
|
511
|
-
| Parameter | Type | Required | Description |
|
|
512
|
-
|-----------|------|----------|-------------|
|
|
513
|
-
| `key` | `InjectionKey<T>` | ✅ | The typed injection key |
|
|
514
|
-
| `defaultValue` | `T` | ⚪ | Optional fallback value |
|
|
515
|
-
|
|
516
|
-
**Returns:** `T` - The injected value
|
|
517
|
-
|
|
518
|
-
**Throws:** `Error` - When no provider is found and no default value is provided
|
|
519
|
-
|
|
520
345
|
## 🌐 i18n
|
|
521
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).
|
|
522
347
|
It allows to use production or local translations on your code. 🚀
|
|
@@ -530,34 +355,6 @@ const trans = useTranslations();
|
|
|
530
355
|
trans('foo.bar')
|
|
531
356
|
```
|
|
532
357
|
|
|
533
|
-
## 📦 Local Building (Recommended)
|
|
534
|
-
|
|
535
|
-
Run this commands if you want to test the package on your local before sending to NPM.
|
|
536
|
-
```sh
|
|
537
|
-
bun run build
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
Since bun does not have packaging yet, use npm here: 🥲
|
|
541
|
-
```sh
|
|
542
|
-
npm pack
|
|
543
|
-
```
|
|
544
|
-
|
|
545
|
-
It'll crate like `useinsider-guido-1.0.0.tgz` file.
|
|
546
|
-
|
|
547
|
-
Move this file to your project path like: `email-fe` via:
|
|
548
|
-
```sh
|
|
549
|
-
cp useinsider-guido-1.0.0.tgz ../email-fe
|
|
550
|
-
```
|
|
551
|
-
|
|
552
|
-
Install the file to your project:
|
|
553
|
-
```sh
|
|
554
|
-
npm i ./useinsider-guido-1.0.0.tgz
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
Then you just need to rebuild to your project or restart the Container. 🎉
|
|
558
|
-
|
|
559
|
-
For Future, we can create a shell script for it. Feel free to help 🙃
|
|
560
|
-
|
|
561
358
|
## 📦 Build Output
|
|
562
359
|
|
|
563
360
|
The library builds to multiple formats:
|
|
@@ -603,4 +400,8 @@ ISC License
|
|
|
603
400
|
- Master Version Generator should be fixed.
|
|
604
401
|
- Playwright integration
|
|
605
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
|
|
606
407
|
- Get Pre-built display conditions from API
|
package/dist/@types/generic.d.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import type { CompilerRule } from './html-compiler';
|
|
2
|
-
type Features = {
|
|
3
|
-
dynamicContent?: boolean;
|
|
4
|
-
saveAsTemplate?: boolean;
|
|
5
|
-
versionHistory?: boolean;
|
|
6
|
-
};
|
|
7
2
|
export type GuidoConfig = {
|
|
8
3
|
translationsPath: string;
|
|
9
4
|
htmlCompilerRules?: CompilerRule[];
|
|
10
5
|
ignoreDefaultHtmlCompilerRules?: boolean;
|
|
11
|
-
features?: Features;
|
|
12
|
-
};
|
|
13
|
-
export type DynamicContent = {
|
|
14
|
-
value: string;
|
|
15
|
-
text: string;
|
|
16
|
-
fallback?: string;
|
|
17
6
|
};
|
|
18
|
-
export {};
|
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,26 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Template } from '@@/Types/stripo';
|
|
1
|
+
import type { GuidoConfig } from '@@/Types/generic';
|
|
3
2
|
type __VLS_Props = {
|
|
4
|
-
|
|
3
|
+
emailId: string;
|
|
5
4
|
userId: string;
|
|
6
5
|
partnerName?: string;
|
|
7
6
|
productType?: string;
|
|
8
7
|
username?: string;
|
|
9
|
-
html?: string;
|
|
10
|
-
css?: string;
|
|
11
8
|
guidoConfig: GuidoConfig;
|
|
12
9
|
};
|
|
13
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
14
|
-
dynamicContent: {
|
|
15
|
-
insert: (data: DynamicContent) => void;
|
|
16
|
-
close: () => void;
|
|
17
|
-
};
|
|
18
|
-
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
19
|
-
"dynamic-content:open": (detail: DynamicContent | null) => void;
|
|
20
|
-
back: () => void;
|
|
21
|
-
"save:start": () => void;
|
|
22
|
-
"save:complete": (template: Omit<Template, "forceRecreate">) => void;
|
|
23
|
-
}, 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>>>, {}>;
|
|
24
11
|
export default _default;
|
|
25
12
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
13
|
type __VLS_TypePropsToOption<T> = {
|
|
@@ -1,78 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DefaultUsername as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import P from "../node_modules/lodash-es/merge.js";
|
|
9
|
-
const H = /* @__PURE__ */ h({
|
|
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({
|
|
10
8
|
__name: "Guido",
|
|
11
9
|
props: {
|
|
12
|
-
|
|
10
|
+
emailId: null,
|
|
13
11
|
userId: null,
|
|
14
12
|
partnerName: null,
|
|
15
13
|
productType: null,
|
|
16
14
|
username: null,
|
|
17
|
-
html: null,
|
|
18
|
-
css: null,
|
|
19
15
|
guidoConfig: null
|
|
20
16
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
partnerName: d = n(),
|
|
30
|
-
productType: u = a(),
|
|
31
|
-
username: m = _
|
|
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
|
|
32
25
|
} = o;
|
|
33
|
-
window.GuidoConfig =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
onBack: () => {
|
|
37
|
-
console.debug("guido:back"), t("back");
|
|
38
|
-
},
|
|
39
|
-
onSaveStart: () => {
|
|
40
|
-
console.debug("guido:save:start"), t("save:start");
|
|
41
|
-
},
|
|
42
|
-
onSaveComplete: (e) => {
|
|
43
|
-
console.debug("guido:save:complete", e), t("save:complete", e);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
const f = (e) => {
|
|
47
|
-
console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
48
|
-
}, y = () => {
|
|
49
|
-
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
26
|
+
window.GuidoConfig = {
|
|
27
|
+
...T,
|
|
28
|
+
...a
|
|
50
29
|
};
|
|
51
|
-
|
|
52
|
-
|
|
30
|
+
const { initPlugin: l } = _({ emailId: n, userId: i, username: m, partnerName: u, productType: p }), { getDefaultTemplate: s } = y();
|
|
31
|
+
return c(async () => {
|
|
53
32
|
try {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
css: l,
|
|
57
|
-
forceRecreate: !0
|
|
58
|
-
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
59
|
-
};
|
|
60
|
-
e.html || (e = await g()), await p(e);
|
|
33
|
+
const e = await s();
|
|
34
|
+
await l(e);
|
|
61
35
|
} catch (e) {
|
|
62
36
|
console.error("Failed to initialize Stripo editor:", e);
|
|
63
37
|
}
|
|
64
|
-
|
|
65
|
-
const v = e;
|
|
66
|
-
console.debug("dynamic-content:open", v.detail), t("dynamic-content:open", v.detail);
|
|
67
|
-
});
|
|
68
|
-
}), b({
|
|
69
|
-
dynamicContent: {
|
|
70
|
-
insert: f,
|
|
71
|
-
close: y
|
|
72
|
-
}
|
|
73
|
-
}), { __sfc: !0, props: o, getPartnerName: n, getProductType: a, templateId: c, userId: r, guidoConfig: s, html: i, css: l, partnerName: d, productType: u, username: m, emit: t, initPlugin: p, getDefaultTemplate: g, insertDynamicContent: f, closeDynamicContent: y, HeaderWrapper: I };
|
|
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 };
|
|
74
39
|
}
|
|
75
40
|
});
|
|
76
41
|
export {
|
|
77
|
-
|
|
42
|
+
h as default
|
|
78
43
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./LeftSlot.vue2.js";
|
|
2
2
|
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
3
|
+
var n = function() {
|
|
4
|
+
var t = this, e = t._self._c, s = t._self._setupProxy;
|
|
5
|
+
return e("div", { staticClass: "d-f a-i-c" }, [e(s.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } }), s.editorStore.isVersionHistoryOpen ? e(s.RestoreButton, { staticClass: "ml-3" }) : t._e()], 1);
|
|
6
6
|
}, a = [], i = /* @__PURE__ */ o(
|
|
7
|
-
n,
|
|
8
7
|
r,
|
|
8
|
+
n,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const c = /* @__PURE__ */ r({
|
|
1
|
+
import { defineComponent as t } from "vue";
|
|
2
|
+
import { useEditorStore as o } from "../../../stores/editor.js";
|
|
3
|
+
import { InButtonV2 as r } from "@useinsider/design-system-vue";
|
|
4
|
+
import e from "./version-history/RestoreButton.vue.js";
|
|
5
|
+
const _ = /* @__PURE__ */ t({
|
|
7
6
|
__name: "LeftSlot",
|
|
8
|
-
setup(
|
|
9
|
-
|
|
10
|
-
return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
|
|
7
|
+
setup(m) {
|
|
8
|
+
return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
|
|
11
9
|
}
|
|
12
10
|
});
|
|
13
11
|
export {
|
|
14
|
-
|
|
12
|
+
_ as default
|
|
15
13
|
};
|
|
@@ -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;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var o, i;
|
|
1
|
+
import o from "./RightSlot.vue2.js";
|
|
2
|
+
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var n = function() {
|
|
5
4
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f" }, [
|
|
7
|
-
},
|
|
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);
|
|
6
|
+
}, r = [], a = /* @__PURE__ */ i(
|
|
7
|
+
o,
|
|
8
8
|
n,
|
|
9
|
-
|
|
10
|
-
l,
|
|
9
|
+
r,
|
|
11
10
|
!1,
|
|
12
11
|
null,
|
|
13
12
|
null
|
|
14
13
|
);
|
|
15
|
-
const
|
|
14
|
+
const c = a.exports;
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
c as default
|
|
18
17
|
};
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { useEditorStore as h } from "../../../stores/editor.js";
|
|
8
|
-
import { InButtonV2 as y } from "@useinsider/design-system-vue";
|
|
9
|
-
const F = /* @__PURE__ */ p({
|
|
1
|
+
import { defineComponent as s } from "vue";
|
|
2
|
+
import { useExport as i } from "../../../composables/useExport.js";
|
|
3
|
+
import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
|
|
4
|
+
import { useEditorStore as p } from "../../../stores/editor.js";
|
|
5
|
+
import { InButtonV2 as m } from "@useinsider/design-system-vue";
|
|
6
|
+
const d = /* @__PURE__ */ s({
|
|
10
7
|
__name: "RightSlot",
|
|
11
|
-
setup(
|
|
12
|
-
const {
|
|
13
|
-
return { __sfc: !0,
|
|
14
|
-
if (
|
|
15
|
-
|
|
8
|
+
setup(f) {
|
|
9
|
+
const { exportHtml: e } = i(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
|
|
10
|
+
return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
|
|
11
|
+
if (t.isVersionHistoryOpen) {
|
|
12
|
+
r();
|
|
16
13
|
return;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
e();
|
|
21
|
-
try {
|
|
22
|
-
const { html: o } = await t();
|
|
23
|
-
r({
|
|
24
|
-
html: o || "",
|
|
25
|
-
css: ""
|
|
26
|
-
// CSS is embedded in HTML from Stripo
|
|
27
|
-
});
|
|
28
|
-
} catch (o) {
|
|
29
|
-
console.error("Failed to get template data for save:", o);
|
|
30
|
-
}
|
|
31
|
-
}, InButtonV2: y };
|
|
15
|
+
o();
|
|
16
|
+
}, InButtonV2: m };
|
|
32
17
|
}
|
|
33
18
|
});
|
|
34
19
|
export {
|
|
35
|
-
|
|
20
|
+
d as default
|
|
36
21
|
};
|