@mixd-id/web-scaffold 0.1.230406311 → 0.1.230406312
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/package.json +1 -1
- package/src/App.vue +9 -1
- package/src/components/Carousel.vue +3 -3
- package/src/components/ColorPicker2.vue +1 -1
- package/src/components/Image.vue +5 -3
- package/src/components/Modal.vue +2 -2
- package/src/components/Text.vue +34 -0
- package/src/components/Textbox.vue +1 -1
- package/src/components/VirtualTable.vue +12 -2
- package/src/index.js +22 -38
- package/src/main.js +0 -9
- package/src/mixin/component.js +2 -1
- package/src/utils/preset-selector.js +4 -1
- package/src/utils/wss.js +6 -1
- package/src/utils/wss.mjs +2 -2
- package/src/widgets/WebPageBuilder3.vue +3 -218
- package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +54 -0
- package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +75 -0
- package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BlurSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +64 -0
- package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +75 -0
- package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +69 -0
- package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +73 -0
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +65 -0
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +178 -0
- package/src/widgets/WebPageBuilder4/DisplaySetting.vue +76 -0
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +71 -0
- package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +70 -0
- package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +74 -0
- package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +71 -0
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +96 -0
- package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +69 -0
- package/src/widgets/WebPageBuilder4/GapSetting.vue +75 -0
- package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +68 -0
- package/src/widgets/WebPageBuilder4/GridSetting.vue +166 -0
- package/src/widgets/WebPageBuilder4/HeightSetting.vue +95 -0
- package/src/widgets/WebPageBuilder4/ImageSetting.vue +102 -0
- package/src/widgets/WebPageBuilder4/MarginSetting.vue +64 -0
- package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +82 -0
- package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +90 -0
- package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +81 -0
- package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +101 -0
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +155 -0
- package/src/widgets/WebPageBuilder4/OpacitySetting.vue +77 -0
- package/src/widgets/WebPageBuilder4/OverflowSetting.vue +81 -0
- package/src/widgets/WebPageBuilder4/PaddingSetting.vue +53 -0
- package/src/widgets/WebPageBuilder4/PositionSetting.vue +191 -0
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +176 -0
- package/src/widgets/WebPageBuilder4/TextSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4/TreeView.vue +43 -0
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +298 -0
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +141 -0
- package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +172 -0
- package/src/widgets/WebPageBuilder4/WidthSetting.vue +105 -0
- package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +72 -0
- package/src/widgets/WebPageBuilder4.vue +798 -0
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<div v-if="items && items.length > 1" :class="$style.carouselNext" @click="next(true)">
|
|
15
|
-
<slot name="next">
|
|
16
|
-
</slot>
|
|
15
|
+
<slot name="next"></slot>
|
|
17
16
|
</div>
|
|
18
17
|
|
|
19
18
|
<div v-if="items && items.length > 1" :class="$style.carouselPrev" @click="prev">
|
|
@@ -179,7 +178,8 @@ export default{
|
|
|
179
178
|
},
|
|
180
179
|
|
|
181
180
|
play(){
|
|
182
|
-
|
|
181
|
+
if(this.autoPlay > 0)
|
|
182
|
+
this.timeoutId = window.setTimeout(() => { this.next(true); this.play() }, this.autoPlay)
|
|
183
183
|
},
|
|
184
184
|
|
|
185
185
|
stop(){
|
|
@@ -83,7 +83,7 @@ export default{
|
|
|
83
83
|
|
|
84
84
|
select(color){
|
|
85
85
|
if(this.mode === 'class'){
|
|
86
|
-
this.$emit('update:modelValue', color ? this.keys[0][0] + color : '')
|
|
86
|
+
this.$emit('update:modelValue', color ? `${this.prefix}${this.keys[0][0]}` + color : '')
|
|
87
87
|
}
|
|
88
88
|
else{
|
|
89
89
|
if(this.valueType === 'rgb'){
|
package/src/components/Image.vue
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</slot>
|
|
15
15
|
|
|
16
16
|
<div v-else-if="status === 2 && actualSrc.indexOf('<svg') >= 0" v-html="actualSrc"></div>
|
|
17
|
-
<img v-else-if="status === 2" :class="computedItemClass" :src="actualSrc" ref="img" />
|
|
17
|
+
<img v-else-if="status === 2" :class="computedItemClass" :src="actualSrc" ref="img" :alt="alt" />
|
|
18
18
|
|
|
19
19
|
<slot v-else-if="status === 3" name="error" :instance="this"></slot>
|
|
20
20
|
|
|
@@ -45,6 +45,8 @@ export default{
|
|
|
45
45
|
|
|
46
46
|
props:{
|
|
47
47
|
|
|
48
|
+
alt: String,
|
|
49
|
+
|
|
48
50
|
eager: {
|
|
49
51
|
type: [ Boolean, String ],
|
|
50
52
|
default: false
|
|
@@ -207,9 +209,9 @@ export default{
|
|
|
207
209
|
else if(Array.isArray(this.src)){
|
|
208
210
|
|
|
209
211
|
const src = {}
|
|
210
|
-
src['all'] =
|
|
212
|
+
src['all'] = this.src[0]
|
|
211
213
|
if(this.src[1]){
|
|
212
|
-
src['md'] =
|
|
214
|
+
src['md'] = this.src[1]
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
let imgSrc
|
package/src/components/Modal.vue
CHANGED
|
@@ -308,7 +308,7 @@ export default{
|
|
|
308
308
|
|
|
309
309
|
.bW9k{
|
|
310
310
|
@apply z-20 hidden w-[100vw] h-[100vh];
|
|
311
|
-
@apply bg-white/50 backdrop-blur-
|
|
311
|
+
@apply bg-white/50 backdrop-blur-xl;
|
|
312
312
|
position: fixed;
|
|
313
313
|
top: 0;
|
|
314
314
|
left: 0;
|
|
@@ -334,7 +334,7 @@ export default{
|
|
|
334
334
|
background-color: rgba(255, 255, 255, .6)
|
|
335
335
|
}
|
|
336
336
|
html[data-theme='dark'] .modal{
|
|
337
|
-
background-color: rgba(0, 0, 0, .
|
|
337
|
+
background-color: rgba(0, 0, 0, .6)
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
.modal.v-show{
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="tag" v-html="htmlText2[$device.mediaIndex]"></component>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
|
|
7
|
+
import {componentMixin} from "../mixin/component";
|
|
8
|
+
|
|
9
|
+
export default{
|
|
10
|
+
|
|
11
|
+
mixins: [ componentMixin ],
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
|
|
15
|
+
tag: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'div'
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
htmlText2: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => []
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style module>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</style>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<table :class="$style.table" ref="tableHead" :style="tableHeadStyle">
|
|
5
5
|
<thead>
|
|
6
6
|
<tr>
|
|
7
|
-
<th v-for="column in visibleColumns" :style="thStyle(column)"
|
|
7
|
+
<th v-for="column in visibleColumns" :style="thStyle(column)" :class="thClass(column)"
|
|
8
8
|
v-tooltip="`${column.label ? column.label : column.key}`">
|
|
9
9
|
<slot v-if="$slots['col-' + column.key]" :name="'col-' + column.key" :column="column"></slot>
|
|
10
10
|
<div v-else :class="headerColumnClass(column)">
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<table :class="$style.table">
|
|
65
65
|
<tbody>
|
|
66
66
|
<tr>
|
|
67
|
-
<td v-for="column in columns" :style="thStyle(column)">
|
|
67
|
+
<td v-for="column in columns" :style="thStyle(column)" :class="thClass(column)">
|
|
68
68
|
<slot v-if="$slots[column.key]" :name="column.key" :column="column" :item="items[0]"></slot>
|
|
69
69
|
<slot v-else-if="$slots.default" name="default" :column="column" :item="items[0]"></slot>
|
|
70
70
|
<div v-else :class="columnClass(column)" v-html="formatColumn(items[0] ?? {}, column)"></div>
|
|
@@ -246,6 +246,16 @@ export default{
|
|
|
246
246
|
}
|
|
247
247
|
},
|
|
248
248
|
|
|
249
|
+
thClass(column){
|
|
250
|
+
let classNames = []
|
|
251
|
+
|
|
252
|
+
if(column.align){
|
|
253
|
+
classNames.push(`text-${column.align}`)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return classNames.join(' ')
|
|
257
|
+
},
|
|
258
|
+
|
|
249
259
|
async resize(){
|
|
250
260
|
|
|
251
261
|
this.$nextTick(() => {
|
package/src/index.js
CHANGED
|
@@ -10,13 +10,13 @@ const uniqid = (additionalKey = '') => {
|
|
|
10
10
|
return 'u' + Math.random().toString(36).substr(2) + Date.now().toString(36)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const mediaBreakpoints =
|
|
14
|
-
640
|
|
15
|
-
768
|
|
16
|
-
1024
|
|
17
|
-
1280
|
|
18
|
-
1536
|
|
19
|
-
|
|
13
|
+
const mediaBreakpoints = [
|
|
14
|
+
[ 640, 'sm:' ],
|
|
15
|
+
[ 768, 'md:' ],
|
|
16
|
+
[ 1024, 'lg:' ],
|
|
17
|
+
[ 1280, 'xl:' ],
|
|
18
|
+
[ 1536, '2xl:' ],
|
|
19
|
+
]
|
|
20
20
|
|
|
21
21
|
const download = (url, as) => {
|
|
22
22
|
url = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'nocache=' + new Date().getTime()
|
|
@@ -291,14 +291,18 @@ const util = {
|
|
|
291
291
|
|
|
292
292
|
calculateMediaPrefix(width){
|
|
293
293
|
|
|
294
|
-
let
|
|
295
|
-
|
|
294
|
+
let media = ''
|
|
295
|
+
let mediaIndex = 0
|
|
296
|
+
for(let breakpointIdx in mediaBreakpoints){
|
|
297
|
+
const [ breakpoint, breakpointPrefix ] = mediaBreakpoints[breakpointIdx]
|
|
296
298
|
if(width > breakpoint){
|
|
297
|
-
|
|
299
|
+
media = breakpointPrefix
|
|
300
|
+
mediaIndex = breakpointIdx
|
|
298
301
|
}
|
|
302
|
+
else break
|
|
299
303
|
}
|
|
300
304
|
|
|
301
|
-
return
|
|
305
|
+
return { media, mediaIndex }
|
|
302
306
|
},
|
|
303
307
|
|
|
304
308
|
uniqid
|
|
@@ -403,29 +407,9 @@ export default{
|
|
|
403
407
|
app.config.globalProperties.timeLog = consoleTimeLog
|
|
404
408
|
app.config.globalProperties.timeEnd = consoleTimeEnd
|
|
405
409
|
app.config.globalProperties.$device = reactive({
|
|
406
|
-
|
|
407
|
-
getValue: (arr) => {
|
|
408
|
-
if(Array.isArray(arr)){
|
|
409
|
-
let index = 0
|
|
410
|
-
switch(app.config.globalProperties.$device){
|
|
411
|
-
case 'md':
|
|
412
|
-
index = 1
|
|
413
|
-
break
|
|
414
|
-
case 'lg':
|
|
415
|
-
index = 2
|
|
416
|
-
break
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
for(let i = index ; i >= 0 ; i--){
|
|
420
|
-
if(arr && arr[i])
|
|
421
|
-
return arr[i]
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
|
|
426
410
|
type: 'mobile',
|
|
427
411
|
media: '',
|
|
428
|
-
|
|
412
|
+
mediaIndex: 0
|
|
429
413
|
})
|
|
430
414
|
app.config.globalProperties.$isDebugMode = () => {
|
|
431
415
|
if(!('isDebugMode' in privateVars)){
|
|
@@ -477,18 +461,16 @@ export default{
|
|
|
477
461
|
}
|
|
478
462
|
|
|
479
463
|
const onWindowResize = throttle(() => {
|
|
480
|
-
|
|
481
464
|
Object.assign(app.config.globalProperties.$device, {
|
|
482
465
|
type: getDeviceType(),
|
|
483
|
-
|
|
466
|
+
...util.calculateMediaPrefix(document.documentElement.clientWidth)
|
|
484
467
|
})
|
|
485
468
|
|
|
486
469
|
resizeEvents.forEach((fn) => fn())
|
|
487
|
-
},
|
|
470
|
+
}, 300, {leading: true})
|
|
488
471
|
window.addEventListener('resize', onWindowResize)
|
|
489
472
|
|
|
490
473
|
app.config.globalProperties.$addResizeListener = (el, fn) => {
|
|
491
|
-
|
|
492
474
|
if (!resizeObserver) {
|
|
493
475
|
resizeObserver = new ResizeObserver((entries) => {
|
|
494
476
|
for (const entry of entries) {
|
|
@@ -515,8 +497,8 @@ export default{
|
|
|
515
497
|
app.config.globalProperties.$onMounted = () => {
|
|
516
498
|
Object.assign(app.config.globalProperties.$device, {
|
|
517
499
|
type: getDeviceType(),
|
|
518
|
-
|
|
519
|
-
|
|
500
|
+
touchSupported: isTouchSupported(),
|
|
501
|
+
...util.calculateMediaPrefix(document.documentElement.clientWidth)
|
|
520
502
|
})
|
|
521
503
|
}
|
|
522
504
|
}
|
|
@@ -658,6 +640,7 @@ export default{
|
|
|
658
640
|
app.component('WebPageBuilder', defineAsyncComponent(() => import("./widgets/WebPageBuilder.vue")))
|
|
659
641
|
app.component('WebPageBuilder2', defineAsyncComponent(() => import("./widgets/WebPageBuilder2.vue")))
|
|
660
642
|
app.component('WebPageBuilder3', defineAsyncComponent(() => import("./widgets/WebPageBuilder3.vue")))
|
|
643
|
+
app.component('WebPageBuilder4', defineAsyncComponent(() => import("./widgets/WebPageBuilder4.vue")))
|
|
661
644
|
app.component('WebPagePreview', defineAsyncComponent(() => import("./widgets/WebPagePreview.vue")))
|
|
662
645
|
app.component('WebComponentSelector', defineAsyncComponent(() => import("./widgets/WebComponentSelector.vue")))
|
|
663
646
|
app.component('WebDatasourceSelector', defineAsyncComponent(() => import("./widgets/WebDatasourceSelector.vue")))
|
|
@@ -685,6 +668,7 @@ export default{
|
|
|
685
668
|
app.component('TypographySetting', defineAsyncComponent(() => import("./widgets/TypographySetting.vue")))
|
|
686
669
|
app.component('FiltersSetting', defineAsyncComponent(() => import("./widgets/FiltersSetting.vue")))
|
|
687
670
|
app.component('MenuEditor', defineAsyncComponent(() => import("./widgets/MenuEditor.vue")))
|
|
671
|
+
app.component('Text', defineAsyncComponent(() => import("./components/Text.vue")))
|
|
688
672
|
}
|
|
689
673
|
|
|
690
674
|
}
|
package/src/main.js
CHANGED
|
@@ -5,14 +5,6 @@ import { createRouter } from './router'
|
|
|
5
5
|
import WebScaffold from './index'
|
|
6
6
|
import './index.css'
|
|
7
7
|
|
|
8
|
-
const AppScaffold = {
|
|
9
|
-
install: (app, options) => {
|
|
10
|
-
app.component('PropertyTable', defineAsyncComponent(() => import("./pages/playground/components/PropertyTable.vue")))
|
|
11
|
-
app.component('Preview', defineAsyncComponent(() => import("./pages/playground/components/Preview.vue")))
|
|
12
|
-
app.component('SourceCode', defineAsyncComponent(() => import("./pages/playground/components/SourceCode.vue")))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
8
|
export function createApp(){
|
|
17
9
|
|
|
18
10
|
const app = createSSRApp(App)
|
|
@@ -22,7 +14,6 @@ export function createApp(){
|
|
|
22
14
|
app.use(router)
|
|
23
15
|
app.use(pinia)
|
|
24
16
|
app.use(WebScaffold)
|
|
25
|
-
app.use(AppScaffold)
|
|
26
17
|
|
|
27
18
|
return { app, router, pinia }
|
|
28
19
|
}
|
package/src/mixin/component.js
CHANGED
|
@@ -67,6 +67,7 @@ export const componentMixin = {
|
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
htmlText: String,
|
|
70
|
+
htmlText2: Array,
|
|
70
71
|
|
|
71
72
|
editSelectable: {
|
|
72
73
|
type: undefined,
|
|
@@ -119,7 +120,7 @@ export const componentMixin = {
|
|
|
119
120
|
},
|
|
120
121
|
|
|
121
122
|
componentClick(e){
|
|
122
|
-
if(this.editMode
|
|
123
|
+
if(!this.editMode) return
|
|
123
124
|
|
|
124
125
|
e.stopPropagation()
|
|
125
126
|
e.preventDefault()
|
|
@@ -995,7 +995,10 @@ const presetToSequelizeList = async(preset, {
|
|
|
995
995
|
searchReplacements = syntaxSearchOpt.replacements
|
|
996
996
|
}
|
|
997
997
|
else{
|
|
998
|
-
const match = (config.columns ?? [])
|
|
998
|
+
const match = (config.columns ?? [])
|
|
999
|
+
.filter(_ => (_.search && _.key))
|
|
1000
|
+
.map(_ => typeof _.search === 'string' ? _.search : _.key)
|
|
1001
|
+
|
|
999
1002
|
if(match !== null){
|
|
1000
1003
|
const searchOpt = await searchToSequelizeWhere(search, {
|
|
1001
1004
|
match
|
package/src/utils/wss.js
CHANGED
|
@@ -97,7 +97,12 @@ class WSS extends EventEmitter2{
|
|
|
97
97
|
this._opt = opt
|
|
98
98
|
this._instance = new WebSocket.Server(opt);
|
|
99
99
|
|
|
100
|
-
this._client = redis.createClient(
|
|
100
|
+
this._client = redis.createClient({
|
|
101
|
+
socket: {
|
|
102
|
+
host: process.env.REDIS_HOST ?? '127.0.0.1',
|
|
103
|
+
port: process.env.REDIS_PORT ?? 6379
|
|
104
|
+
}
|
|
105
|
+
})
|
|
101
106
|
this._client.connect().then()
|
|
102
107
|
|
|
103
108
|
this._instance.on('connection', async (socket, req) => {
|
package/src/utils/wss.mjs
CHANGED
|
@@ -128,8 +128,8 @@ class WSS extends EventEmitter2{
|
|
|
128
128
|
|
|
129
129
|
if(this._opt.debug){
|
|
130
130
|
status === 200 ?
|
|
131
|
-
console.log(new Date().getTime() - t1
|
|
132
|
-
console.error(new Date().getTime() - t1
|
|
131
|
+
console.log(`${new Date().getTime() - t1}ms`, `l:${JSON.stringify(data ?? '').length}`, path, params, data) :
|
|
132
|
+
console.error(`${new Date().getTime() - t1}ms`, `l:${JSON.stringify(data ?? '').length}`, path, params, data)
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -1,222 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<div class="flex-1 flex flex-row gap-4 items-center">
|
|
6
|
-
|
|
7
|
-
<button ref="close" class=" p-1"
|
|
8
|
-
@click="close">
|
|
9
|
-
<svg class="fill-text-300 hover:fill-red-500" width="18" height="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
10
|
-
</button>
|
|
11
|
-
|
|
12
|
-
<h5 class="mr-5 w-[200px] text-ellipsis whitespace-nowrap overflow-hidden">
|
|
13
|
-
{{ page.title }}
|
|
14
|
-
</h5>
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div>
|
|
19
|
-
<Button ref="saveBtn"
|
|
20
|
-
class="w-[70px] rounded-full p-1"
|
|
21
|
-
:state="canSave ? 1 : -1"
|
|
22
|
-
@click="save">{{ $t('Save') }}</Button>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<div class="flex-1 flex flex-row">
|
|
27
|
-
|
|
28
|
-
<div class="flex flex-row bg-base-400 dark:bg-base-300 border-r-[1px] border-text-50"
|
|
29
|
-
:style="section1Style">
|
|
30
|
-
|
|
31
|
-
<div class="flex-1 overflow-y-auto">
|
|
32
|
-
<div class="px-3 flex flex-col border-b-[1px] border-text-50 overflow-x-auto">
|
|
33
|
-
<Tabs :items="tabItems"
|
|
34
|
-
class="pt-1"
|
|
35
|
-
v-model="config.leftbarTabIndex" />
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div v-if="config.leftbarTabIndex === 2" class="p-5">
|
|
39
|
-
<div>
|
|
40
|
-
<div class="flex flex-row gap-1 items-center cursor-pointer">
|
|
41
|
-
<strong class="flex-1 text-text-400 line-clamp-1">{{ $t('Headers')}}</strong>
|
|
42
|
-
<button type="button" class="text-primary flex flex-row items-center gap-1"
|
|
43
|
-
@click="$refs.webPageComponentSelector.open(comp => addComponent(layout.headers, comp))">
|
|
44
|
-
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376 232H216V72c0-4.42-3.58-8-8-8h-32c-4.42 0-8 3.58-8 8v160H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h160v160c0 4.42 3.58 8 8 8h32c4.42 0 8-3.58 8-8V280h160c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"/></svg>
|
|
45
|
-
{{ $t('Add')}}
|
|
46
|
-
</button>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div class="flex flex-col gap-10">
|
|
50
|
-
<TreeView class="mt-2"
|
|
51
|
-
:config="config"
|
|
52
|
-
:items="layout.headers"
|
|
53
|
-
:selected-item="currentItem"
|
|
54
|
-
@change="">
|
|
55
|
-
<template #default="{ item, index, parent, depth }">
|
|
56
|
-
<div class="flex-1 flex flex-row gap-2">
|
|
57
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
58
|
-
:class="!item.props.enabled ? 'line-through' : ''"
|
|
59
|
-
@click="config.selectedComponent = item.uid">
|
|
60
|
-
{{ item.props.name ?? item.type }}
|
|
61
|
-
</div>
|
|
62
|
-
<button v-if="Array.isArray(item.items)"
|
|
63
|
-
type="button"
|
|
64
|
-
@click="$refs.webPageComponentSelector.open(comp => addComponent(item.items, comp))">
|
|
65
|
-
<svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
66
|
-
</button>
|
|
67
|
-
<button type="button" @click="parent ? parent.items.splice(index, 1) : layout.headers.splice(index, 1)">
|
|
68
|
-
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
69
|
-
</button>
|
|
70
|
-
</div>
|
|
71
|
-
</template>
|
|
72
|
-
</TreeView>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div>
|
|
77
|
-
<div class="flex flex-row gap-1 items-center cursor-pointer">
|
|
78
|
-
<strong class="flex-1 text-text-400 line-clamp-1">{{ $t('Footers')}}</strong>
|
|
79
|
-
<button type="button" class="text-primary flex flex-row items-center gap-1"
|
|
80
|
-
@click="$refs.webPageComponentSelector.open(comp => addComponent(layout.footers, comp))">
|
|
81
|
-
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376 232H216V72c0-4.42-3.58-8-8-8h-32c-4.42 0-8 3.58-8 8v160H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h160v160c0 4.42 3.58 8 8 8h32c4.42 0 8-3.58 8-8V280h160c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"/></svg>
|
|
82
|
-
{{ $t('Add')}}
|
|
83
|
-
</button>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<div class="flex flex-col gap-10">
|
|
87
|
-
<TreeView class="mt-2"
|
|
88
|
-
:config="config"
|
|
89
|
-
:items="layout.footers"
|
|
90
|
-
:selected-item="currentItem"
|
|
91
|
-
@change="">
|
|
92
|
-
<template #default="{ item, index, parent, depth }">
|
|
93
|
-
<div class="flex-1 flex flex-row gap-2">
|
|
94
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
95
|
-
:class="!item.props.enabled ? 'line-through' : ''"
|
|
96
|
-
@click="config.selectedComponent = item.uid">
|
|
97
|
-
{{ item.props.name ?? item.type }}
|
|
98
|
-
</div>
|
|
99
|
-
<button v-if="Array.isArray(item.items)"
|
|
100
|
-
type="button"
|
|
101
|
-
@click="$refs.webPageComponentSelector.open(comp => addComponent(item.items, comp))">
|
|
102
|
-
<svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
103
|
-
</button>
|
|
104
|
-
<button type="button" @click="parent ? parent.items.splice(index, 1) : layout.footers.splice(index, 1)">
|
|
105
|
-
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
106
|
-
</button>
|
|
107
|
-
</div>
|
|
108
|
-
</template>
|
|
109
|
-
</TreeView>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<div>
|
|
114
|
-
<div class="flex flex-row gap-1 items-center cursor-pointer">
|
|
115
|
-
<strong class="flex-1 text-text-400 line-clamp-1">{{ $t('Styles')}}</strong>
|
|
116
|
-
<button type="button" class="text-primary flex flex-row items-center gap-1"
|
|
117
|
-
@click="">
|
|
118
|
-
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376 232H216V72c0-4.42-3.58-8-8-8h-32c-4.42 0-8 3.58-8 8v160H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h160v160c0 4.42 3.58 8 8 8h32c4.42 0 8-3.58 8-8V280h160c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"/></svg>
|
|
119
|
-
{{ $t('Add')}}
|
|
120
|
-
</button>
|
|
121
|
-
</div>
|
|
122
|
-
<TreeView class="mt-2"
|
|
123
|
-
:items="styles"
|
|
124
|
-
:selected-item="currentItem"
|
|
125
|
-
:config="config"
|
|
126
|
-
@change="">
|
|
127
|
-
<template #default="{ item, index, parent, depth }">
|
|
128
|
-
<div class="flex-1 flex flex-row gap-2">
|
|
129
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
130
|
-
@click="config.selectedComponent = item.uid">
|
|
131
|
-
{{ item.props.name ?? item.type }}
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
</template>
|
|
135
|
-
</TreeView>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<div v-else-if="config.leftbarTabIndex === 3" class="p-5">
|
|
140
|
-
<div class="flex flex-row gap-1 items-center cursor-pointer">
|
|
141
|
-
<strong class="flex-1 text-text-400 line-clamp-1">{{ $t('Components')}}</strong>
|
|
142
|
-
<button type="button" class="text-primary flex flex-row items-center gap-1"
|
|
143
|
-
@click="$refs.webPageComponentSelector.open(comp => addComponent(page.components, comp))">
|
|
144
|
-
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376 232H216V72c0-4.42-3.58-8-8-8h-32c-4.42 0-8 3.58-8 8v160H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h160v160c0 4.42 3.58 8 8 8h32c4.42 0 8-3.58 8-8V280h160c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"/></svg>
|
|
145
|
-
{{ $t('Add')}}
|
|
146
|
-
</button>
|
|
147
|
-
</div>
|
|
148
|
-
|
|
149
|
-
<TreeView class="mt-2"
|
|
150
|
-
:items="page.components"
|
|
151
|
-
:selected-item="currentItem"
|
|
152
|
-
:config="config"
|
|
153
|
-
@change="">
|
|
154
|
-
<template #default="{ item, index, parent, depth }">
|
|
155
|
-
<div class="flex-1 flex flex-row gap-2">
|
|
156
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
157
|
-
:class="!item.props.enabled ? 'line-through' : ''"
|
|
158
|
-
@click="config.selectedComponent = item.uid">
|
|
159
|
-
{{ item.props.name ?? item.type }}
|
|
160
|
-
</div>
|
|
161
|
-
<button v-if="Array.isArray(item.items)"
|
|
162
|
-
type="button"
|
|
163
|
-
@click="$refs.webPageComponentSelector.open(comp => addComponent(item.items, comp))">
|
|
164
|
-
<svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256C432 269.3 421.3 280 408 280h-160v160c0 13.25-10.75 24.01-24 24.01S200 453.3 200 440v-160h-160c-13.25 0-24-10.74-24-23.99C16 242.8 26.75 232 40 232h160v-160c0-13.25 10.75-23.99 24-23.99S248 58.75 248 72v160h160C421.3 232 432 242.8 432 256z"/></svg>
|
|
165
|
-
</button>
|
|
166
|
-
<button type="button" @click="parent ? parent.items.splice(index, 1) : page.components.splice(index, 1)">
|
|
167
|
-
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
168
|
-
</button>
|
|
169
|
-
</div>
|
|
170
|
-
</template>
|
|
171
|
-
</TreeView>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
174
|
-
<WebComponentSelector ref="webPageComponentSelector"
|
|
175
|
-
:components="components"
|
|
176
|
-
dismissable="true"
|
|
177
|
-
@dismiss="$refs.webPageComponentSelector.close()" />
|
|
178
|
-
</div>
|
|
179
|
-
|
|
180
|
-
<div :class="$style.resize1"
|
|
181
|
-
@mousedown="(e) => $util.dragResize(e, resize1)"></div>
|
|
182
|
-
|
|
183
|
-
</div>
|
|
184
|
-
|
|
185
|
-
<div class="flex-1 flex flex-col bg-base-300 dark:bg-base-400 relative">
|
|
186
|
-
|
|
187
|
-
<WebPagePreview :config="config"
|
|
188
|
-
:page="page"
|
|
189
|
-
class="flex-1"
|
|
190
|
-
ref="preview"
|
|
191
|
-
@message="onIframeMessage" />
|
|
192
|
-
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<div v-if="currentItem" class="flex flex-row bg-base-400 dark:bg-base-300 border-l-[1px] border-text-50"
|
|
196
|
-
:style="section3Style">
|
|
197
|
-
|
|
198
|
-
<div :class="$style.resize3"
|
|
199
|
-
@mousedown="(e) => $util.dragResize(e, resize3)"></div>
|
|
200
|
-
|
|
201
|
-
<div class="flex-1 flex flex-col gap-6 overflow-y-auto">
|
|
202
|
-
|
|
203
|
-
<StyleSetting2 v-if="currentItem.type.startsWith('style:')"
|
|
204
|
-
:item="currentItem"
|
|
205
|
-
:config="config"
|
|
206
|
-
ref="settingComponent" />
|
|
207
|
-
|
|
208
|
-
<ComponentSetting3 v-else
|
|
209
|
-
:item="currentItem"
|
|
210
|
-
:config="config"
|
|
211
|
-
ref="settingComponent" />
|
|
212
|
-
|
|
213
|
-
</div>
|
|
214
|
-
|
|
215
|
-
</div>
|
|
216
|
-
|
|
217
|
-
</div>
|
|
218
|
-
|
|
219
|
-
</div>
|
|
2
|
+
<div>
|
|
3
|
+
<h1>Web Page Builder 3</h1>
|
|
4
|
+
</div>
|
|
220
5
|
</template>
|
|
221
6
|
|
|
222
7
|
<script>
|