@myissue/vue-website-page-builder 3.3.72 → 3.3.74

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 (51) hide show
  1. package/README.md +61 -0
  2. package/dist/ar-Sg258Eh1.js +110 -0
  3. package/dist/de-DU6Hv8W2.js +112 -0
  4. package/dist/en-B__-m2Os.js +112 -0
  5. package/dist/es-DmzWA1F8.js +112 -0
  6. package/dist/fr-BARDIQ1D.js +112 -0
  7. package/dist/hi-BgQJcRDP.js +112 -0
  8. package/dist/ja-Drg74-B1.js +112 -0
  9. package/dist/pt-D19DpjTw.js +112 -0
  10. package/dist/robots.txt +1 -1
  11. package/dist/ru-D0zybCPa.js +112 -0
  12. package/dist/style.css +1 -1
  13. package/dist/vue-website-page-builder.js +9435 -9300
  14. package/dist/vue-website-page-builder.umd.cjs +40 -40
  15. package/dist/zh-Hans-notf0z2N.js +112 -0
  16. package/package.json +1 -1
  17. package/src/App.vue +17 -1
  18. package/src/Components/PageBuilder/DefaultComponents/DefaultBuilderComponents.vue +10 -4
  19. package/src/Components/PageBuilder/EditorMenu/Editables/BackgroundColorEditor.vue +6 -2
  20. package/src/Components/PageBuilder/EditorMenu/Editables/BorderRadius.vue +23 -13
  21. package/src/Components/PageBuilder/EditorMenu/Editables/Borders.vue +22 -9
  22. package/src/Components/PageBuilder/EditorMenu/Editables/ClassEditor.vue +15 -7
  23. package/src/Components/PageBuilder/EditorMenu/Editables/ComponentTopMenu.vue +10 -6
  24. package/src/Components/PageBuilder/EditorMenu/Editables/ManageBackgroundOpacity.vue +1 -1
  25. package/src/Components/PageBuilder/EditorMenu/Editables/ManageOpacity.vue +1 -1
  26. package/src/Components/PageBuilder/EditorMenu/Editables/Margin.vue +12 -5
  27. package/src/Components/PageBuilder/EditorMenu/Editables/OpacityEditor.vue +4 -1
  28. package/src/Components/PageBuilder/EditorMenu/Editables/Padding.vue +13 -5
  29. package/src/Components/PageBuilder/EditorMenu/Editables/StyleEditor.vue +14 -7
  30. package/src/Components/PageBuilder/EditorMenu/Editables/TextColorEditor.vue +7 -1
  31. package/src/Components/PageBuilder/EditorMenu/Editables/Typography.vue +36 -16
  32. package/src/Components/PageBuilder/EditorMenu/RightSidebarEditor.vue +26 -14
  33. package/src/Components/PageBuilder/ToolbarOption/ToolbarOption.vue +13 -10
  34. package/src/Components/TipTap/TipTapInput.vue +1 -1
  35. package/src/PageBuilder/PageBuilder.vue +115 -19
  36. package/src/composables/useTranslations.ts +28 -0
  37. package/src/css/style.css +2 -1
  38. package/src/locales/ar.json +85 -0
  39. package/src/locales/de.json +86 -0
  40. package/src/locales/en.json +93 -0
  41. package/src/locales/es.json +86 -0
  42. package/src/locales/fr.json +86 -0
  43. package/src/locales/hi.json +86 -0
  44. package/src/locales/ja.json +86 -0
  45. package/src/locales/pt.json +92 -0
  46. package/src/locales/ru.json +86 -0
  47. package/src/locales/zh-Hans.json +86 -0
  48. package/src/services/PageBuilderService.ts +63 -1
  49. package/src/stores/page-builder-state.ts +3 -3
  50. package/src/tests/PageBuilderTest.vue +39 -77
  51. package/src/types/index.ts +1 -1
@@ -0,0 +1,86 @@
1
+ {
2
+ "Reset Page": "重置页面",
3
+ "Global Page Styles": "全局页面样式",
4
+ "Try the powerful Click & Drop Page Builder—designed for developers and creators who want full control without the hassle. Customize layouts, fonts, and colors. Edit content visually in real time. Add media, embed YouTube videos, or export everything as clean HTML. With responsive editing, local auto-save, Tailwind support, and even Unsplash integration, it's everything you need—wrapped in one seamless builder. Build Stunning Pages in Minutes.": "试试强大的Click & Drop Page Builder——专为希望完全控制而无需麻烦的开发者和创作者设计。自定义布局、字体和颜色。实时可视化编辑内容。添加媒体、嵌入YouTube视频或将所有内容导出为干净的HTML。凭借响应式编辑、本地自动保存、Tailwind支持,甚至Unsplash集成,它是您所需的一切——集成在一个无缝的构建器中。几分钟内构建令人惊叹的页面。",
5
+ "A Page Builder designed for growth. Build your website pages with ready-made components that are fully customizable and always responsive, designed to fit every need. A powerful Page Builder for growing merchants, brands, and agencies.": "为增长而设计的页面构建器。使用完全可定制且始终响应的现成组件构建您的网站页面,旨在满足所有需求。为不断发展的商家、品牌和代理商提供强大的页面构建器。",
6
+ "Everything you need. Break free from design limitations": "您需要的一切。突破设计限制",
7
+ "Bring your vision to life and create impressive pages using a click & drop Page Builder": "实现您的愿景,并使用点击和拖放页面构建器创建令人印象深刻的页面",
8
+ "The web builder for stunning pages. Enable users to design and publish modern pages at any scale. Build responsive pages like listings, jobs or blog posts and manage content easily using the free click & drop Page Builder. Developed with TypeScript, Vue 3, Composition API, Pinia, CSS, Tailwind CSS and HTML.": "令人惊叹页面的网页构建器。使用户能够设计和发布任何规模的现代页面。创建响应式页面,例如列表、工作或博客文章,并使用免费的点击和拖放页面构建器轻松管理内容。使用 TypeScript、Vue 3、Composition API、Pinia、CSS、Tailwind CSS 和 HTML 开发。",
9
+ "Download or install our powerful, flexible, and easy-to-use free Vue 3 Page Builder via": "通过下载或安装我们强大、灵活且易于使用的免费 Vue 3 页面构建器",
10
+ "Save": "保存",
11
+ "Add new Components": "添加新组件",
12
+ "Options": "选项",
13
+ "Config Overview": "配置概览",
14
+ "HTML Overview": "HTML概览",
15
+ "Delete Layout": "删除布局",
16
+ "avatar": "头像",
17
+ "Publish": "发布",
18
+ "Add Components to Page": "将组件添加到页面",
19
+ "Close": "关闭",
20
+ "Helper Components": "辅助组件",
21
+ "Click to add": "点击添加",
22
+ "component": "组件",
23
+ "Layout Components": "布局组件",
24
+ "Click to add component": "点击添加组件",
25
+ "Remove all Components": "删除所有组件",
26
+ "Are you sure you want to remove all Components?": "您确定要删除所有组件吗?",
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.": "应用影响整个页面的样式。这些设置包括全局字体系列、文本颜色、背景颜色和适用于所有部分的其他通用样式。",
29
+ "Update Page Styles": "更新页面样式",
30
+ "Download HTML": "下载HTML",
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文件。这包括所有部分、内容和应用的样式,使其可以随时使用或集成到其他地方。",
32
+ "Download HTML file": "下载HTML文件",
33
+ "Typographies": "排版",
34
+ "Font Appearance": "字体外观",
35
+ "Font Size": "字体大小",
36
+ "Select": "选择",
37
+ "Font size": "字体大小",
38
+ "Font tablet size": "平板字体大小",
39
+ "Font small screens": "小屏幕字体大小",
40
+ "Font weight": "字体粗细",
41
+ "Font family": "字体家族",
42
+ "Font Style": "字体样式",
43
+ "Opacity & Transparency": "不透明度和透明度",
44
+ "Padding": "内边距",
45
+ "Vertical Padding": "垂直内边距",
46
+ "Horizontal Padding": "水平内边距",
47
+ "Margin": "边距",
48
+ "Vertical Margin": "垂直边距",
49
+ "Horizontal Margin": "水平边距",
50
+ "Border Radius": "边框半径",
51
+ "Global": "全局",
52
+ "Specific": "具体",
53
+ "Border Radius top left": "边框半径 左上",
54
+ "Border Radius top right": "边框半径 右上",
55
+ "Border Radius bottom left": "边框半径 左下",
56
+ "Border Radius bottom right": "边框半径 右下",
57
+ "Border Style, Width & Color": "边框样式、宽度和颜色",
58
+ "Border": "边框",
59
+ "Border Style": "边框样式",
60
+ "Border Width": "边框宽度",
61
+ "Border Color": "边框颜色",
62
+ "Transparent": "透明",
63
+ "Generated CSS": "生成的CSS",
64
+ "This is the CSS applied by the builder. Add your own CSS and press Enter to apply it to the selected element.": "这是构建器应用的CSS。添加您自己的CSS并按Enter将其应用于选定的元素。",
65
+ "Add your CSS.": "添加您的CSS。",
66
+ "The pbx- prefix is added automatically.": "pbx-前缀会自动添加。",
67
+ "Type class": "输入类",
68
+ "Add": "添加",
69
+ "Inline Styles": "内联样式",
70
+ "These are the inline styles applied by the builder. Add your own styles and press Enter to apply them to the selected element.": "这些是构建器应用的内联样式。添加您自己的样式,然后按 Enter 将其应用于选定的元素。",
71
+ "Add your own style.": "添加您自己的样式。",
72
+ "property": "属性",
73
+ "value": "值",
74
+ "close": "关闭",
75
+ "Editing": "编辑",
76
+ "Loading...": "加载中...",
77
+ "Background Color": "背景颜色",
78
+ "Text Color": "文字颜色",
79
+ "Default black": "默认黑色",
80
+ "Remove Component?": "删除组件?",
81
+ "Are you sure you want to remove this Component?": "您确定要删除此组件吗?",
82
+ "Delete": "删除",
83
+ "Add to the bottom": "添加到底部",
84
+ "Preview": "预览",
85
+ "Mobile": "移动"
86
+ }
@@ -129,6 +129,10 @@ export class PageBuilderService {
129
129
  public availableLanguage(): AvailableLanguage[] {
130
130
  return AVAILABLE_LANGUAGES
131
131
  }
132
+
133
+ public changeLanguage(lang: string) {
134
+ this.pageBuilderStateStore.setCurrentLanguage(lang)
135
+ }
132
136
  // Deselect any selected or hovered elements in the builder UI
133
137
  async clearHtmlSelection(): Promise<void> {
134
138
  this.pageBuilderStateStore.setComponent(null)
@@ -264,6 +268,55 @@ export class PageBuilderService {
264
268
  return
265
269
  }
266
270
 
271
+ private ensureLanguage(config: PageBuilderConfig): void {
272
+ // Set default language config if missing, empty, or language missing/empty
273
+ const defaultLang = 'en'
274
+ const defaultEnable = ['en', 'zh-Hans', 'fr', 'ja', 'ru', 'es', 'pt', 'de', 'ar', 'hi'] as const
275
+
276
+ let needsDefault = false
277
+ const userSettings = config.userSettings
278
+ const language = userSettings && userSettings.language
279
+
280
+ if (!userSettings || isEmptyObject(userSettings)) {
281
+ needsDefault = true
282
+ } else if (!language || isEmptyObject(language)) {
283
+ needsDefault = true
284
+ }
285
+
286
+ if (needsDefault) {
287
+ const updatedLanguage = {
288
+ ...config,
289
+ userSettings: {
290
+ ...userSettings,
291
+ language: {
292
+ default: defaultLang,
293
+ enable: defaultEnable as typeof defaultEnable,
294
+ },
295
+ },
296
+ } as const
297
+ this.pageBuilderStateStore.setPageBuilderConfig(updatedLanguage)
298
+ return
299
+ }
300
+
301
+ // Ensure default is in enable array
302
+ if (language && Array.isArray(language.enable) && language.default) {
303
+ if (!language.enable.includes(language.default)) {
304
+ const updatedEnable = [...language.enable, language.default]
305
+ const updatedLanguage = {
306
+ ...config,
307
+ userSettings: {
308
+ ...userSettings,
309
+ language: {
310
+ ...language,
311
+ enable: updatedEnable,
312
+ },
313
+ },
314
+ } as const
315
+ this.pageBuilderStateStore.setPageBuilderConfig(updatedLanguage)
316
+ }
317
+ }
318
+ }
319
+
267
320
  private validateConfig(config: PageBuilderConfig): void {
268
321
  const defaultConfigValues = {
269
322
  updateOrCreate: {
@@ -280,6 +333,15 @@ export class PageBuilderService {
280
333
  if (config && Object.keys(config).length !== 0 && config.constructor === Object) {
281
334
  this.ensureUpdateOrCreateConfig(config)
282
335
  }
336
+
337
+ this.ensureLanguage(config)
338
+ }
339
+
340
+ public saveUserSettingsStorage(newLang: string) {
341
+ localStorage.setItem(
342
+ 'userSettingsPageBuilder',
343
+ JSON.stringify({ userSettings: { lang: newLang } }),
344
+ )
283
345
  }
284
346
 
285
347
  /**
@@ -422,7 +484,7 @@ export class PageBuilderService {
422
484
  if (localStorageData && this.isPageBuilderMissingOnStart) {
423
485
  console.log('8888:', internalPageBuilderCall)
424
486
  await this.completeMountProcess(JSON.stringify(this.pendingMountComponents), true)
425
- await delay(3000)
487
+ await delay(400)
426
488
  this.pageBuilderStateStore.setHasLocalDraftForUpdate(true)
427
489
  this.pendingMountComponents = null
428
490
  return
@@ -67,7 +67,7 @@ interface PageBuilderState {
67
67
  hasLocalDraftForUpdate: boolean
68
68
  isResumeEditing: boolean
69
69
  isRestoring: boolean
70
- currentLanguage: string
70
+ currentLanguage: string | null
71
71
  }
72
72
 
73
73
  export const usePageBuilderStateStore = defineStore('pageBuilderState', {
@@ -130,7 +130,7 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
130
130
  hasLocalDraftForUpdate: false,
131
131
  isResumeEditing: false,
132
132
  isRestoring: false,
133
- currentLanguage: 'en',
133
+ currentLanguage: null,
134
134
  }),
135
135
  getters: {
136
136
  // Core Page Builder Getters
@@ -286,7 +286,7 @@ export const usePageBuilderStateStore = defineStore('pageBuilderState', {
286
286
  getHasLocalDraftForUpdate: (state: PageBuilderState): boolean => state.hasLocalDraftForUpdate,
287
287
  getIsLoadingResumeEditing: (state: PageBuilderState): boolean => state.isResumeEditing,
288
288
  getIsRestoring: (state: PageBuilderState): boolean => state.isRestoring,
289
- getCurrentLanguage: (state: PageBuilderState): string => state.currentLanguage,
289
+ getCurrentLanguage: (state: PageBuilderState): string | null => state.currentLanguage,
290
290
  },
291
291
  actions: {
292
292
  setComponentArrayAddMethod(payload: string | null): void {
@@ -6,50 +6,10 @@ import DemoBuilderComponentsTest from '../tests/TestComponents/DemoBuilderCompon
6
6
  import { onMounted } from 'vue'
7
7
  import componentsArray from '../tests/componentsArray.test.json'
8
8
  import { getPageBuilder } from '../composables/builderInstance'
9
- const pageBuilderService = getPageBuilder()
9
+ import { useTranslations } from '../composables/useTranslations'
10
10
 
11
- const features = [
12
- {
13
- name: 'Live Drag & Drop Builder',
14
- description:
15
- 'Click & Drop content on a page and watch your pages come to life. Bring your vision to life and create impressive pages using a click & drop Page Builder',
16
- },
17
- {
18
- name: 'True Visual Editing',
19
- description:
20
- 'See your changes in real-time as you make them. Elevate your creative vision and create pages using an intuitive click & drop page builder. Break free from design limitations and turn your visions into reality.',
21
- },
22
- {
23
- name: 'Features',
24
- description:
25
- 'Click & Drop, Reordering, True Visual Editing, Responsive Editing, Font Customization, Undo & Redo, Text Editing, Media Library, Unsplash Integration, YouTube Videos.',
26
- },
27
- {
28
- name: 'Technologies',
29
- description:
30
- 'Developed with TypeScript, Vue 3, Composition API, Pinia, CSS, Tailwind CSS and HTML.',
31
- },
32
- {
33
- name: 'Set Brand and Link Colors one place',
34
- description:
35
- 'Global Styles for fonts, designs, & colors. Set Brand and Link Colors once and apply them across the entire Platform with ease.',
36
- },
37
- {
38
- name: 'Mobile-First Approach',
39
- description:
40
- 'Developed with Mobile-First approach. The Page Builder even works on mobile phones.',
41
- },
42
- {
43
- name: 'Media Library',
44
- description:
45
- 'A beautiful and user-friendly media library that allows you to change and update images. Unsplash Integration is included.',
46
- },
47
- {
48
- name: 'Minimal and Intuitive Design',
49
- description:
50
- 'Beautiful, elegant and intuitive design. Enhance user engagement with amazing visual experience.',
51
- },
52
- ]
11
+ const pageBuilderService = getPageBuilder()
12
+ const { translate } = useTranslations()
53
13
 
54
14
  const publishPageBuilder = function () {}
55
15
 
@@ -81,20 +41,22 @@ const configPageBuilder = {
81
41
  userSettings: {
82
42
  theme: 'light',
83
43
  language: {
84
- default: 'en',
85
- disable: ['fr', 'es'],
44
+ default: 'zh-Hans',
45
+ enable: ['en', 'zh-Hans', 'fr', 'ja', 'ru', 'es', 'pt', 'de', 'ar', 'hi'],
46
+ disableLanguageDropDown: false,
86
47
  },
87
48
  autoSave: true,
88
49
  },
50
+
89
51
  settings: {
90
52
  brandColor: '#DB93B0',
91
53
  },
92
- pageSettings,
54
+ pageSettings: pageSettings,
93
55
  } as const
94
56
 
95
57
  onMounted(async () => {
96
58
  const result = await pageBuilderService.startBuilder(configPageBuilder, components)
97
- console.log('Page Builder inspect the result for message, status, or error::', result)
59
+ console.log('Page Builder result for message, status, or error::', result)
98
60
  })
99
61
  </script>
100
62
 
@@ -103,19 +65,27 @@ onMounted(async () => {
103
65
  <div class="pbx-myPrimaryWidthScreenModule pbx-bg-red-50 lg:pbx-block">
104
66
  <div class="pbx-myPrimaryContentSection">
105
67
  <h2 class="pbx-mySecondaryHeader">
106
- Bring your vision to life and create impressive pages using a click & drop Page Builder
68
+ {{
69
+ translate(
70
+ 'Bring your vision to life and create impressive pages using a click & drop Page Builder',
71
+ )
72
+ }}
107
73
  </h2>
108
74
  <p class="pbx-myPrimaryParagraph pbx-font-normal">
109
- The web builder for stunning pages. Enable users to design and publish modern pages at any
110
- scale. Build responsive pages like listings, jobs or blog posts and manage content easily
111
- using the free click & drop Page Builder. Developed with TypeScript, Vue 3, Composition
112
- API, Pinia, CSS, Tailwind CSS and HTML.
113
-
75
+ {{
76
+ translate(
77
+ 'The web builder for stunning pages. Enable users to design and publish modern pages at any scale. Build responsive pages like listings, jobs or blog posts and manage content easily using the free click & drop Page Builder. Developed with TypeScript, Vue 3, Composition API, Pinia, CSS, Tailwind CSS and HTML.',
78
+ )
79
+ }}
114
80
  <br />
115
81
  </p>
116
82
  <div class="pbx-mt-4">
117
83
  <p class="pbx-myPrimaryParagraph pbx-font-normal">
118
- Download or install our powerful, flexible, and easy-to-use free Vue 3 Page Builder via
84
+ {{
85
+ translate(
86
+ 'Download or install our powerful, flexible, and easy-to-use free Vue 3 Page Builder via',
87
+ )
88
+ }}
119
89
  <br />
120
90
  <strong> npm:</strong>
121
91
  <a
@@ -139,34 +109,26 @@ onMounted(async () => {
139
109
  </div>
140
110
 
141
111
  <FullWidthElement :descriptionArea="true" class="pbx-bg-gray-50">
142
- <template #title>Everything you need. Break free from design limitations </template>
112
+ <template #title>
113
+ {{ translate('Everything you need. Break free from design limitations') }}
114
+ </template>
143
115
  <template #description>
144
116
  <p class="pbx-myPrimaryParagraph pbx-font-normal">
145
- A Page Builder designed for growth. Build your website pages with ready-made components
146
- that are fully customizable and always responsive, designed to fit every need. A powerful
147
- Page Builder for growing merchants, brands, and agencies.
117
+ {{
118
+ translate(
119
+ 'A Page Builder designed for growth. Build your website pages with ready-made components that are fully customizable and always responsive, designed to fit every need. A powerful Page Builder for growing merchants, brands, and agencies.',
120
+ )
121
+ }}
148
122
  </p>
149
123
  </template>
150
124
  <template #content>
151
- <div
152
- class="pbx-grid pbx-grid-cols-1 pbx-gap-8 sm:pbx-grid-cols-2 md:pbx-grid-cols-2 lg:pbx-grid-cols-4 pbx-mt-8"
153
- >
154
- <div
155
- v-for="feature in features"
156
- :key="feature.name"
157
- class="pbx-bg-red-200 pbx-bg-opacity-20 hover:pbx-bg-opacity-10 pbx-w-full lg:pbx-min-h-[20rem] pbx-min-h-[12rem] pbx-relative pbx-col-span-1 pbx-flex pbx-flex-col pbx-text-center pbx-rounded-lg pbx-shadow-sm pbx-outline pbx-outline-2 pbx-outline-offset-8 pbx-outline-yellow-400"
158
- >
159
- <div
160
- class="pbx-bg-black/0 pbx-absolute pbx-top-0 pbx-left-0 pbx-w-full pbx-h-full pbx-rounded-lg"
161
- ></div>
162
- <div class="pbx-px-2 pbx-pt-8 pbx-absolute pbx-top-0 pbx-w-full">
163
- <p class="pbx-myTertiaryHeader">{{ feature.name }}</p>
164
- <p class="pbx-myPrimaryParagraph pbx-font-medium pbx-drop-shadow-sm">
165
- {{ feature.description }}
166
- </p>
167
- </div>
168
- </div>
169
- </div>
125
+ <p class="pbx-myPrimaryParagraph pbx-font-normal">
126
+ {{
127
+ translate(
128
+ "Try the powerful Click & Drop Page Builder—designed for developers and creators who want full control without the hassle. Customize layouts, fonts, and colors. Edit content visually in real time. Add media, embed YouTube videos, or export everything as clean HTML. With responsive editing, local auto-save, Tailwind support, and even Unsplash integration, it's everything you need—wrapped in one seamless builder. Build Stunning Pages in Minutes.",
129
+ )
130
+ }}
131
+ </p>
170
132
  </template>
171
133
  </FullWidthElement>
172
134
  </div>
@@ -229,7 +229,7 @@ export interface PageBuilderConfig {
229
229
  theme?: 'light' | 'dark' | 'auto'
230
230
  language?: {
231
231
  default: 'en' | 'zh-Hans' | 'fr' | 'ja' | 'ru' | 'es' | 'pt' | 'de' | 'ar' | 'hi'
232
- disable?: ReadonlyArray<
232
+ enable?: ReadonlyArray<
233
233
  'en' | 'zh-Hans' | 'fr' | 'ja' | 'ru' | 'es' | 'pt' | 'de' | 'ar' | 'hi'
234
234
  >
235
235
  }