@myissue/vue-website-page-builder 3.3.92 → 3.3.93

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.
@@ -164,7 +164,9 @@ const e = "保存", t = "选项", o = "头像", n = "发布", a = "组件", s =
164
164
  "Continue Your Work?": "继续您的工作?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "我们注意到您上次有一些更改没有保存。您是想从上次离开的地方继续,还是使用当前从数据库加载的版本?",
166
166
  "Use Saved Version": "使用保存的版本",
167
- "Continue Where I Left Off": "从我离开的地方继续"
167
+ "Continue Where I Left Off": "从我离开的地方继续",
168
+ "HTML Editor": "HTML 编辑器",
169
+ "Gain full control over components by editing the raw HTML.": "通过编辑原始 HTML 获得对组件的完全控制。"
168
170
  };
169
171
  export {
170
172
  m as Add,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myissue/vue-website-page-builder",
3
- "version": "3.3.92",
3
+ "version": "3.3.93",
4
4
  "description": "Vue 3 page builder component with drag & drop functionality.",
5
5
  "type": "module",
6
6
  "main": "./dist/vue-website-page-builder.umd.cjs",
@@ -72,7 +72,7 @@ const maxWidthClass = computed(() => {
72
72
  ></div>
73
73
 
74
74
  <div
75
- class="pbx-relative pbx-inline-block pbx-bg-white pbx-rounded-xl pbx-text-left pbx-overflow-hidden pbx-shadow-xl pbx-transform pbx-transition-all pbx-max-w-[96vh] lg:pbx-max-h-[98vh] pbx-max-h-[85vh] pbx-overflow-y-scroll pbx-w-full"
75
+ class="pbx-relative pbx-inline-block pbx-bg-white pbx-rounded-xl pbx-text-left pbx-shadow-xl pbx-transform pbx-transition-all pbx-max-w-[96vh] lg:pbx-max-h-[98vh] pbx-max-h-[85vh] pbx-overflow-y-auto pbx-w-full"
76
76
  :class="[
77
77
  maxWidthClass ? maxWidthClass : '',
78
78
  minHeight ? minHeight : '',
@@ -5,12 +5,20 @@ import ModalBuilder from '../../../../Components/Modals/ModalBuilder.vue'
5
5
  import EditorAccordion from '../EditorAccordion.vue'
6
6
  import { getPageBuilder } from '../../../../composables/builderInstance'
7
7
  import { useTranslations } from '../../../../composables/useTranslations'
8
+ import { delay } from '../../../../composables/delay'
8
9
 
9
10
  const pageBuilderService = getPageBuilder()
10
11
  const pageBuilderStateStore = sharedPageBuilderStore
11
12
  const { translate } = useTranslations()
12
13
 
14
+ const props = defineProps({
15
+ globalPage: {
16
+ type: Boolean,
17
+ },
18
+ })
19
+
13
20
  const getElement = computed(() => pageBuilderStateStore.getElement)
21
+ const getComponents = computed(() => pageBuilderStateStore.getComponents)
14
22
 
15
23
  const elementHTML = computed(() => {
16
24
  if (!getElement.value || !(getElement.value instanceof HTMLElement)) {
@@ -22,20 +30,70 @@ const elementHTML = computed(() => {
22
30
  const showModalHTMLEditor = ref(false)
23
31
 
24
32
  const editableHtml = ref('')
33
+ const editableComponents = ref('')
25
34
 
26
35
  const handleShowHTMLEditor = () => {
27
- editableHtml.value = elementHTML.value
28
36
  showModalHTMLEditor.value = true
37
+
38
+ if (!props.globalPage) {
39
+ editableHtml.value = elementHTML.value
40
+ }
41
+
42
+ if (props.globalPage) {
43
+ const compsHTMLString =
44
+ Array.isArray(getComponents.value) &&
45
+ getComponents.value
46
+ .map((comp) => {
47
+ return comp.html_code
48
+ .replace(/data-componentid="[^"]*"/g, '') // remove data-componentid
49
+ .replace(/\s{2,}/g, ' ') // optional: clean up excess spaces
50
+ })
51
+ .join('\n')
52
+
53
+ editableComponents.value = compsHTMLString
54
+ }
29
55
  }
30
56
 
31
57
  const handleCloseHTMLEditor = () => {
32
58
  showModalHTMLEditor.value = false
33
59
  }
34
60
 
35
- const handleSaveChanges = () => {
36
- pageBuilderService.applyModifiedHTML(editableHtml.value)
61
+ const isLoading = ref(false)
62
+ const errSaveComponents = ref(null)
37
63
 
38
- showModalHTMLEditor.value = true
64
+ const handleSaveChangesElement = async () => {
65
+ errSaveComponents.value = null
66
+ isLoading.value = true
67
+ await delay(300)
68
+
69
+ const error = await pageBuilderService.applyModifiedHTML(editableHtml.value)
70
+
71
+ if (error) {
72
+ errSaveComponents.value = error
73
+ isLoading.value = false
74
+ return
75
+ }
76
+
77
+ showModalHTMLEditor.value = false
78
+ isLoading.value = false
79
+ }
80
+
81
+ const handleSaveChangesComponents = async () => {
82
+ errSaveComponents.value = null
83
+ isLoading.value = true
84
+ errSaveComponents.value = null
85
+ await delay(300)
86
+
87
+ const error = await pageBuilderService.applyModifiedComponents(editableComponents.value)
88
+
89
+ if (error) {
90
+ errSaveComponents.value = error
91
+ isLoading.value = false
92
+ return
93
+ }
94
+
95
+ showModalHTMLEditor.value = false
96
+ isLoading.value = false
39
97
  }
40
98
  </script>
41
99
  <template>
@@ -44,9 +102,7 @@ const handleSaveChanges = () => {
44
102
  <template #content>
45
103
  <div class="pbx-my-2 pbx-py-2">
46
104
  <label for="vertical-margin" class="pbx-myPrimaryInputLabel">{{
47
- translate(
48
- 'Gain full control over individual components by editing the raw HTML of any selected element. This feature empowers advanced users to fine-tune the HTML structure,',
49
- )
105
+ translate('Gain full control over components by editing the raw HTML.')
50
106
  }}</label>
51
107
  <hr />
52
108
  </div>
@@ -57,32 +113,100 @@ const handleSaveChanges = () => {
57
113
  </EditorAccordion>
58
114
  <ModalBuilder
59
115
  maxWidth="7xl"
60
- minHeight="pbx-min-h-[65vh] pbx-max-h-[65vh]"
61
116
  :showModalBuilder="showModalHTMLEditor"
62
117
  :title="translate('HTML Editor')"
63
118
  @closeMainModalBuilder="handleCloseHTMLEditor"
64
119
  >
65
- <textarea
66
- id="html-editor"
67
- v-model="editableHtml"
68
- class="pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full"
69
- style="overflow: auto; min-height: 400px"
70
- ></textarea>
71
- <div
72
- class="pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-mt-4 pbx-flex pbx-items-center pbx-justify-end"
73
- >
74
- <div class="pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center">
75
- <div
76
- class="sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex sm:pbx-flex-row pbx-flex-col pbx-myPrimaryGap sm:pbx-w-5/6 pbx-w-full"
77
- >
78
- <button @click="handleCloseHTMLEditor" type="button" class="pbx-mySecondaryButton">
79
- {{ translate('Close') }}
80
- </button>
81
- <button @click="handleSaveChanges" type="button" class="pbx-myPrimaryButton">
82
- {{ translate('Save') }}
83
- </button>
120
+ <template v-if="!globalPage">
121
+ <textarea
122
+ id="html-editor"
123
+ v-model="editableHtml"
124
+ class="pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full"
125
+ style="overflow: auto; min-height: 400px"
126
+ ></textarea>
127
+ <div class="pbx-flex pbx-justify-end pbx-min-h-6">
128
+ <p v-if="errSaveComponents" class="pbx-myPrimaryParagraphError">
129
+ Error: {{ errSaveComponents }}
130
+ </p>
131
+ </div>
132
+ <div
133
+ class="pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"
134
+ >
135
+ <div class="pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center">
136
+ <div
137
+ class="sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex sm:pbx-flex-row pbx-flex-col pbx-myPrimaryGap sm:pbx-w-5/6 pbx-w-full"
138
+ >
139
+ <template v-if="!isLoading">
140
+ <button @click="handleCloseHTMLEditor" type="button" class="pbx-mySecondaryButton">
141
+ {{ translate('Close') }}
142
+ </button>
143
+ <button @click="handleSaveChangesElement" type="button" class="pbx-myPrimaryButton">
144
+ {{ translate('Save') }}
145
+ </button>
146
+ </template>
147
+ <template v-if="isLoading">
148
+ <div class="pbx-flex pbx-items-center pbx-my-2 pbx-justify-end">
149
+ <div
150
+ class="pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"
151
+ >
152
+ <span
153
+ class="!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"
154
+ >Loading...</span
155
+ >
156
+ </div>
157
+ </div>
158
+ </template>
159
+ </div>
84
160
  </div>
85
161
  </div>
86
- </div>
162
+ </template>
163
+
164
+ <template v-if="globalPage">
165
+ <textarea
166
+ id="html-editor"
167
+ v-model="editableComponents"
168
+ class="pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full"
169
+ style="overflow: auto; min-height: 400px"
170
+ ></textarea>
171
+ <div class="pbx-flex pbx-justify-end pbx-min-h-6">
172
+ <p v-if="errSaveComponents" class="pbx-myPrimaryParagraphError">
173
+ Error: {{ errSaveComponents }}
174
+ </p>
175
+ </div>
176
+ <div
177
+ class="pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"
178
+ >
179
+ <div class="pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center">
180
+ <div
181
+ class="sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex sm:pbx-flex-row pbx-flex-col pbx-myPrimaryGap sm:pbx-w-5/6 pbx-w-full"
182
+ >
183
+ <template v-if="!isLoading">
184
+ <button @click="handleCloseHTMLEditor" type="button" class="pbx-mySecondaryButton">
185
+ {{ translate('Close') }}
186
+ </button>
187
+ <button
188
+ @click="handleSaveChangesComponents"
189
+ type="button"
190
+ class="pbx-myPrimaryButton"
191
+ >
192
+ {{ translate('Save') }}
193
+ </button>
194
+ </template>
195
+ <template v-if="isLoading">
196
+ <div class="pbx-flex pbx-items-center pbx-my-2 pbx-justify-end">
197
+ <div
198
+ class="pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"
199
+ >
200
+ <span
201
+ class="!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"
202
+ >Loading...</span
203
+ >
204
+ </div>
205
+ </div>
206
+ </template>
207
+ </div>
208
+ </div>
209
+ </div>
210
+ </template>
87
211
  </ModalBuilder>
88
212
  </template>
@@ -290,7 +290,7 @@ const handleCloseGlobalPageStyles = async function () {
290
290
  <StyleEditor></StyleEditor>
291
291
  </article>
292
292
  <article class="pbx-my-1">
293
- <HTMLEditor></HTMLEditor>
293
+ <HTMLEditor :globalPage="true"></HTMLEditor>
294
294
  </article>
295
295
  </div>
296
296
  </div>
package/src/css/style.css CHANGED
@@ -90,7 +90,7 @@
90
90
  }
91
91
 
92
92
  .pbx-myPrimaryParagraphError {
93
- @apply pbx-myPrimaryParagraph pbx-mt-1 pbx-italic pbx-text-myPrimaryErrorColor;
93
+ @apply pbx-myPrimaryParagraph pbx-mt-1 pbx-italic pbx-text-myPrimaryErrorColor pbx-text-sm;
94
94
  }
95
95
 
96
96
  /*
@@ -161,7 +161,9 @@
161
161
  "Four Square Images With Text": "أربع صور مربعة مع نص",
162
162
  "Four Square Images": "أربع صور مربعة",
163
163
  "Continue Your Work?": "أترغب في متابعة عملك؟",
164
- "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "لاحظنا أن لديك بعض التغييرات التي لم يتم حفظها في المرة الأخيرة. هل ترغب في المتابعة من حيث توقفت، أم استخدام النسخة المح��لة حاليًا من قاعدة البيانات؟",
164
+ "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "لاحظنا وجود بعض التغييرات التي لم تُحفظ في المرة السابقة. هل ترغب في المتابعة من حيث توقفت، أم استخدام الإصدار المُحمّل حاليًا من قاعدة البيانات؟",
165
165
  "Use Saved Version": "استخدام النسخة المحفوظة",
166
- "Continue Where I Left Off": "المتابعة من حيث توقفت"
166
+ "Continue Where I Left Off": "المتابعة من حيث توقفت",
167
+ "HTML Editor": "محرر HTML",
168
+ "Gain full control over components by editing the raw HTML.": "احصل على التحكم الكامل في المكونات عن طريق تحرير HTML الخام."
167
169
  }
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "Möchten Sie Ihre Arbeit fortsetzen?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "Wir haben festgestellt, dass Sie beim letzten Mal einige Änderungen nicht gespeichert haben. Möchten Sie dort weitermachen, wo Sie aufgehört haben, oder die aktuell aus der Datenbank geladene Version verwenden?",
166
166
  "Use Saved Version": "Gespeicherte Version verwenden",
167
- "Continue Where I Left Off": "Dort weitermachen, wo ich aufgehört habe"
167
+ "Continue Where I Left Off": "Dort weitermachen, wo ich aufgehört habe",
168
+ "HTML Editor": "HTML-Editor",
169
+ "Gain full control over components by editing the raw HTML.": "Erhalten Sie die vollständige Kontrolle über Komponenten, indem Sie das reine HTML bearbeiten."
168
170
  }
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "Continue Your Work?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?",
166
166
  "Use Saved Version": "Use Saved Version",
167
- "Continue Where I Left Off": "Continue Where I Left Off"
167
+ "Continue Where I Left Off": "Continue Where I Left Off",
168
+ "HTML Editor": "HTML Editor",
169
+ "Gain full control over components by editing the raw HTML.": "Gain full control over components by editing the raw HTML."
168
170
  }
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "¿Desea continuar su trabajo?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "Notamos que tiene algunos cambios que no se guardaron la última vez. ¿Le gustaría continuar donde lo dejó o usar la versión que está cargada actualmente desde la base de datos?",
166
166
  "Use Saved Version": "Usar la versión guardada",
167
- "Continue Where I Left Off": "Continuar donde lo dejé"
167
+ "Continue Where I Left Off": "Continuar donde lo dejé",
168
+ "HTML Editor": "Editor HTML",
169
+ "Gain full control over components by editing the raw HTML.": "Obtenga control total sobre los componentes editando el HTML sin formato."
168
170
  }
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "Continuer votre travail ?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "Nous avons remarqué que vous avez des modifications qui n'ont pas été enregistrées la dernière fois. Souhaitez-vous reprendre là où vous vous êtes arrêté, ou utiliser la version actuellement chargée depuis la base de données ?",
166
166
  "Use Saved Version": "Utiliser la version enregistrée",
167
- "Continue Where I Left Off": "Continuer là où je me suis arrêté"
167
+ "Continue Where I Left Off": "Continuer là où je me suis arrêté",
168
+ "HTML Editor": "Éditeur HTML",
169
+ "Gain full control over components by editing the raw HTML.": "Obtenez un contrôle total sur les composants en modifiant le code HTML brut."
168
170
  }
@@ -165,5 +165,7 @@
165
165
  "Continue Your Work?": "अपना काम जारी रखें?",
166
166
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "हमने देखा कि आपके पास कुछ बदलाव हैं जो पिछली बार सहेजे नहीं गए थे। क्या आप वहीं से शुरू करना चाहेंगे जहां आपने छोड़ा था, या डेटाबेस से वर्तमान में लोड किए गए संस्करण का उपयोग करना चाहेंगे?",
167
167
  "Use Saved Version": "सहेजा गया संस्करण उपयोग करें",
168
- "Continue Where I Left Off": "वहीं से जारी रखें जहां मैंने छोड़ा ��ा"
168
+ "Continue Where I Left Off": "वहीं से शुरु करो जहाँ मैने छोड़ा था",
169
+ "HTML Editor": "HTML संपादक",
170
+ "Gain full control over components by editing the raw HTML.": "कच्चे HTML को संपादित करके घटकों पर पूर्ण नियंत्रण प्राप्त करें।"
169
171
  }
@@ -25,7 +25,7 @@
25
25
  "Remove all Components": "すべてのコンポーネントを削除",
26
26
  "Are you sure you want to remove all Components?": "すべてのコンポーネントを削除してもよろしいですか?",
27
27
  "Styles": "スタイル",
28
- "Apply styles that affect the entire page. These settings include global font family, text color, background color, and other universal styles that apply to all sections.": "ページ全体に影響を与���るスタイルを適用します。これらの設定には、グローバルフォントファミリー、テキストカラー、背景色、すべてのセクションに適用されるその他のユニバーサルスタイルが含まれます。",
28
+ "Apply styles that affect the entire page. These settings include global font family, text color, background color, and other universal styles that apply to all sections.": "ページ全体に適用されるスタイルを適用します。これらの設定には、グローバルフォントファミリー、テキストカラー、背景色、その他すべてのセクションに適用されるユニバーサルスタイルが含まれます。",
29
29
  "Update Page Styles": "ページスタイルを更新",
30
30
  "Download HTML": "HTMLをダウンロード",
31
31
  "Export the entire page as a standalone HTML file. This includes all sections, content, and applied styles, making it ready for use or integration elsewhere.": "ページ全体をスタンドアロンのHTMLファイルとしてエクスポートします。これには、すべてのセクション、コンテンツ、および適用されたスタイルが含まれ、他の場所での使用または統合の準備が整います。",
@@ -85,7 +85,7 @@
85
85
  "Demo Content": "デモコンテンツ",
86
86
  "Demo Description": "軽量で無料のVue Click & Dropページビルダーをご紹介します。Vueを使用してデジタル体験を簡単に作成および強化します。強力なものすべてが複雑である必要はありません。このミニマリストで軽量なページビルダーは、シンプルさとスピードに焦点を当てたエレガントで直感的なインターフェイスを提供します。リスト、求人ボード、またはブログ投稿など、完全にレスポンシブなページを作成し、無料のClick & Dropページビルダーを使用してコンテンツを簡単に管理します。",
87
87
  "Demo Description Two": "成長のために設計されたページビルダー。完全にカスタマイズ可能で常に応答性があり、あらゆるニーズに対応するように設計された既製のコンポーネントを使用して、ウェブサイトのページを作成します。成長中の商人、ブランド、代理店のための強力なページビルダー。",
88
- "Demo Description Three": "��ザイナーに愛されているウェブサイトビルダー。あらゆる画面サイズに合わせてレイアウトを簡単にデザイン、プレビュー、調整できます。クリーン。高速。直感的。強力なものすべてが複雑に見える必要はありません。",
88
+ "Demo Description Three": "デザイナーに愛されるウェブサイトビルダー。あらゆる画面サイズに合わせてレイアウトを簡単にデザイン、プレビュー、調整できます。シンプルで使いやすく、高速で、直感的です。パワフルなデザインは必ずしも複雑に見えなくても構いません。",
89
89
  "Demo Description Four": "すべてのデバイスでサイトが見栄えよく表示されるようにします。テキストコンテンツをライブおよびリアルタイムで編集します。あなたのスタイルに合った完璧なフォントを選択してください。変更を元に戻す機能で自信を持って実験してください。プレフィックス付きのスタイル。ビルダーとアプリの間でスタイルの競合のリスクはありません。",
90
90
  "Demo Title": "素晴らしいページのためのウェブビルダー",
91
91
  "Demo Title Two": "Vueで公開するだけ",
@@ -162,7 +162,9 @@
162
162
  "Four Square Images With Text": "テキスト付きの4つの正方形の画像",
163
163
  "Four Square Images": "4つの正方形の画像",
164
164
  "Continue Your Work?": "作業を続行しますか?",
165
- "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "前回保存されなかった変更があります。中断したところ��ら再開しますか、それとも現在データベースから読み込まれているバージョンを使用しますか?",
165
+ "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "前回保存されなかった変更がいくつかあるようです。中断したところから再開しますか、それともデータベースから現在読み込まれているバージョンを使用しますか",
166
166
  "Use Saved Version": "保存されたバージョンを使用",
167
- "Continue Where I Left Off": "中断したところから続行"
167
+ "Continue Where I Left Off": "中断したところから続行",
168
+ "HTML Editor": "HTMLエディター",
169
+ "Gain full control over components by editing the raw HTML.": "生の HTML を編集することで、コンポーネントを完全に制御できます。"
168
170
  }
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "Continuar seu trabalho?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "Percebemos que você tem algumas alterações que não foram salvas da última vez. Gostaria de continuar de onde parou ou usar a versão que está carregada atualmente no banco de dados?",
166
166
  "Use Saved Version": "Usar a versão salva",
167
- "Continue Where I Left Off": "Continuar de onde parei"
167
+ "Continue Where I Left Off": "Continuar de onde parei",
168
+ "HTML Editor": "Editor HTML",
169
+ "Gain full control over components by editing the raw HTML.": "Obtenha controlo total sobre os componentes editando o HTML em bruto."
168
170
  }
@@ -72,7 +72,7 @@
72
72
  "property": "свойство",
73
73
  "value": "значение",
74
74
  "Editing": "Редактирование",
75
- "Loading...": "Загруз��а...",
75
+ "Loading...": "Загрузка...",
76
76
  "Background Color": "Цвет фона",
77
77
  "Text Color": "Цвет текста",
78
78
  "Default black": "Черный по умолчанию",
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "Продолжить работу?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "Мы заметили, что у вас есть несохраненные изменения с прошлого раза. Хотите продолжить с того места, где остановились, или использовать версию, загруженную из базы данных?",
166
166
  "Use Saved Version": "Использовать сохраненную версию",
167
- "Continue Where I Left Off": "Продолжить с того места, где я остановился"
167
+ "Continue Where I Left Off": "Продолжить с того места, где я остановился",
168
+ "HTML Editor": "HTML-редактор",
169
+ "Gain full control over components by editing the raw HTML.": "Получите полный контроль над компонентами, редактируя необработанный HTML-код."
168
170
  }
@@ -164,5 +164,7 @@
164
164
  "Continue Your Work?": "继续您的工作?",
165
165
  "We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?": "我们注意到您上次有一些更改没有保存。您是想从上次离开的地方继续,还是使用当前从数据库加载的版本?",
166
166
  "Use Saved Version": "使用保存的版本",
167
- "Continue Where I Left Off": "从我离开的地方继续"
167
+ "Continue Where I Left Off": "从我离开的地方继续",
168
+ "HTML Editor": "HTML 编辑器",
169
+ "Gain full control over components by editing the raw HTML.": "通过编辑原始 HTML 获得对组件的完全控制。"
168
170
  }
@@ -491,8 +491,9 @@ export class PageBuilderService {
491
491
  }
492
492
 
493
493
  if (passedComponentsArray && localStorageData) {
494
- this.pageBuilderStateStore.setHasLocalDraftForUpdate(true)
495
494
  await this.completeMountProcess(JSON.stringify(passedComponentsArray), true)
495
+ await delay(500)
496
+ this.pageBuilderStateStore.setHasLocalDraftForUpdate(true)
496
497
  return
497
498
  }
498
499
  if (!passedComponentsArray && localStorageData && !this.savedMountComponents) {
@@ -520,7 +521,7 @@ export class PageBuilderService {
520
521
  // No Page Builder Is present in DOM initially
521
522
  if (localStorageData && this.isPageBuilderMissingOnStart) {
522
523
  await this.completeMountProcess(JSON.stringify(this.pendingMountComponents), true)
523
- await delay(400)
524
+ await delay(500)
524
525
  this.pageBuilderStateStore.setHasLocalDraftForUpdate(true)
525
526
  this.pendingMountComponents = null
526
527
  return
@@ -2792,30 +2793,55 @@ export class PageBuilderService {
2792
2793
  }
2793
2794
  }
2794
2795
 
2795
- public async applyModifiedHTML(htmlString: string) {
2796
+ /**
2797
+ * Applies modified components by mounting them to the DOM and attaching listeners.
2798
+ * @param htmlString - The HTML string to apply
2799
+ * @returns {Promise<string | null>} - Returns error message if failed, otherwise null
2800
+ */
2801
+ public async applyModifiedHTML(htmlString: string): Promise<string | null> {
2802
+ if (!htmlString || (typeof htmlString === 'string' && htmlString.length === 0)) {
2803
+ return 'No HTML content was provided. Please ensure a valid HTML string is passed.'
2804
+ }
2805
+
2796
2806
  const tempDiv = document.createElement('div')
2797
2807
  tempDiv.innerHTML = htmlString.trim()
2798
2808
 
2799
2809
  const parsedElement = tempDiv.firstElementChild as HTMLElement | null
2800
2810
 
2801
2811
  if (!parsedElement) {
2802
- console.warn('Could not parse element from HTML string:', htmlString)
2803
- return
2812
+ return 'Could not parse element from HTML string.'
2804
2813
  }
2805
2814
 
2806
2815
  // Replace the actual DOM element
2807
2816
  const oldElement = this.pageBuilderStateStore.getElement
2817
+
2808
2818
  if (oldElement && oldElement.parentElement) {
2809
2819
  oldElement.replaceWith(parsedElement)
2810
2820
 
2811
2821
  // Update the element in the store (now referencing the new one)
2812
2822
  this.pageBuilderStateStore.setElement(parsedElement)
2813
- } else {
2814
- console.warn('No valid element to replace in DOM')
2815
2823
  }
2816
2824
 
2817
2825
  await this.addListenersToEditableElements()
2818
2826
  await nextTick()
2827
+ return null
2828
+ }
2829
+
2830
+ /**
2831
+ * Applies modified components by mounting them to the DOM and attaching listeners.
2832
+ * @param htmlString - The HTML string to apply
2833
+ * @returns {Promise<string | null>} - Returns error message if failed, otherwise null
2834
+ */
2835
+ public async applyModifiedComponents(htmlString: string): Promise<string | null> {
2836
+ if (!htmlString || (typeof htmlString === 'string' && htmlString.length === 0)) {
2837
+ return 'No HTML content was provided. Please ensure a valid HTML string is passed.'
2838
+ }
2839
+
2840
+ await this.mountComponentsToDOM(htmlString)
2841
+
2842
+ await this.addListenersToEditableElements()
2843
+ await nextTick()
2844
+ return null
2819
2845
  }
2820
2846
 
2821
2847
  /**