@mixd-id/web-scaffold 0.2.250801010 → 0.2.250801012
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/docs/components/AccountIcon.md +16 -0
- package/docs/components/Ahref.md +35 -0
- package/docs/components/Alert.md +72 -0
- package/docs/components/ArrayList.md +39 -0
- package/docs/components/Article.md +28 -0
- package/docs/components/BarChart.md +81 -0
- package/docs/components/Block.md +23 -0
- package/docs/components/Box.md +15 -0
- package/docs/components/Button.md +68 -0
- package/docs/components/Card.md +67 -0
- package/docs/components/Carousel.md +70 -0
- package/docs/components/Cart.md +20 -0
- package/docs/components/CartIcon.md +29 -0
- package/docs/components/Chart.md +53 -0
- package/docs/components/ChartBar.md +34 -0
- package/docs/components/ChatTyping.md +21 -0
- package/docs/components/Checkbox.md +63 -0
- package/docs/components/CodeEditor.md +25 -0
- package/docs/components/CollapsiblePanel.md +41 -0
- package/docs/components/ColorPicker.md +52 -0
- package/docs/components/Confirm.md +62 -0
- package/docs/components/ContextMenu.md +76 -0
- package/docs/components/ContextMenuItem.md +29 -0
- package/docs/components/CopyToClipboard.md +43 -0
- package/docs/components/Countdown.md +47 -0
- package/docs/components/Datepicker.md +61 -0
- package/docs/components/Datetimepicker.md +57 -0
- package/docs/components/DayTimeRange.md +20 -0
- package/docs/components/Dropdown.md +65 -0
- package/docs/components/ErrorText.md +15 -0
- package/docs/components/FBLogin.md +21 -0
- package/docs/components/Flex.md +44 -0
- package/docs/components/GHeatMaps.md +16 -0
- package/docs/components/GSignIn.md +21 -0
- package/docs/components/Gmaps.md +16 -0
- package/docs/components/GmapsDirection.md +20 -0
- package/docs/components/Grid.md +36 -0
- package/docs/components/HTMLEditor.md +26 -0
- package/docs/components/IconMenu.md +20 -0
- package/docs/components/Image.md +78 -0
- package/docs/components/Link.md +33 -0
- package/docs/components/MultiDropdown.md +46 -0
- package/docs/components/Radio.md +55 -0
- package/docs/components/Slider.md +47 -0
- package/docs/components/Switch.md +43 -0
- package/docs/components/Table.md +31 -0
- package/docs/components/Tabs.md +65 -0
- package/docs/components/Text.md +30 -0
- package/docs/components/Textarea.md +66 -0
- package/docs/components/Textbox.md +97 -0
- package/docs/components/Timepicker.md +62 -0
- package/docs/components/Toast.md +59 -0
- package/docs/components/Uploader.md +51 -0
- package/docs/components/Video.md +54 -0
- package/package.json +65 -2
- package/docs/components/Dashboard.md +0 -56
- package/docs/components/Header2.md +0 -16
- package/log.txt +0 -7
- package/public/assets/dashboard/bar.png +0 -0
- package/public/assets/dashboard/doughnut.png +0 -0
- package/public/assets/dashboard/metric.png +0 -0
- package/public/assets/dashboard/pie.png +0 -0
- package/public/assets/dashboard/polar-area.png +0 -0
- package/public/assets/dashboard/virtual-table.png +0 -0
- package/public/static/dashboard/bar.png +0 -0
- package/public/static/dashboard/doughnut.png +0 -0
- package/public/static/dashboard/metric.png +0 -0
- package/public/static/dashboard/pie.png +0 -0
- package/public/static/dashboard/polar-area.png +0 -0
- package/public/static/dashboard/virtual-table.png +0 -0
- package/src/components/404.vue +0 -61
- package/src/components/AccountIcon.vue +0 -19
- package/src/components/Ahref.vue +0 -200
- package/src/components/Alert.vue +0 -257
- package/src/components/ArrayList.vue +0 -49
- package/src/components/Article.vue +0 -387
- package/src/components/Block.vue +0 -31
- package/src/components/Box.vue +0 -34
- package/src/components/Button.vue +0 -258
- package/src/components/Card.vue +0 -257
- package/src/components/Carousel.vue +0 -364
- package/src/components/Cart.vue +0 -192
- package/src/components/CartIcon.vue +0 -89
- package/src/components/Chart.vue +0 -485
- package/src/components/ChartBar.vue +0 -192
- package/src/components/ChatTyping.vue +0 -69
- package/src/components/Checkbox.vue +0 -200
- package/src/components/Checkout.vue +0 -373
- package/src/components/CheckoutDelivery.vue +0 -267
- package/src/components/CodeEditor.vue +0 -50
- package/src/components/CollapsiblePanel.vue +0 -70
- package/src/components/ColorPicker.vue +0 -165
- package/src/components/ColorPicker2.vue +0 -186
- package/src/components/ColorPicker3.vue +0 -100
- package/src/components/Confirm.vue +0 -180
- package/src/components/ContextMenu.vue +0 -265
- package/src/components/ContextMenuItem.vue +0 -53
- package/src/components/ConversationBuilder.vue +0 -161
- package/src/components/CopyToClipboard.vue +0 -34
- package/src/components/Countdown.vue +0 -264
- package/src/components/DGrid.vue +0 -21
- package/src/components/DGridItem.vue +0 -263
- package/src/components/Dashboard.vue +0 -243
- package/src/components/Dashboard2.vue +0 -118
- package/src/components/DashboardComponentSelector.vue +0 -96
- package/src/components/DashboardConfigs.vue +0 -202
- package/src/components/DataList.vue +0 -92
- package/src/components/Datepicker.vue +0 -399
- package/src/components/DayTimeRange.vue +0 -126
- package/src/components/Dropdown.vue +0 -224
- package/src/components/ErrorText.vue +0 -57
- package/src/components/FBLogin.vue +0 -194
- package/src/components/Feed.vue +0 -118
- package/src/components/Flex.vue +0 -44
- package/src/components/GHeatMaps.vue +0 -317
- package/src/components/GSignIn.vue +0 -166
- package/src/components/Gmaps.vue +0 -251
- package/src/components/GmapsDirection.vue +0 -191
- package/src/components/Grid.vue +0 -35
- package/src/components/HTMLEditor.vue +0 -588
- package/src/components/IconMenu.vue +0 -95
- package/src/components/IconMenu2.vue +0 -89
- package/src/components/IconPlus.vue +0 -89
- package/src/components/Image.vue +0 -263
- package/src/components/Image360.vue +0 -140
- package/src/components/ImageFullScreen.vue +0 -101
- package/src/components/ImagePreview.vue +0 -93
- package/src/components/ImageUploader.vue +0 -114
- package/src/components/ImportModal.vue +0 -260
- package/src/components/Link.vue +0 -95
- package/src/components/List.vue +0 -1381
- package/src/components/ListContextMenu.vue +0 -88
- package/src/components/ListItem.vue +0 -160
- package/src/components/ListPage1.vue +0 -1401
- package/src/components/ListPage1Filter.vue +0 -170
- package/src/components/ListView.vue +0 -961
- package/src/components/ListViewBarSummary.vue +0 -81
- package/src/components/ListViewLineSummary.vue +0 -75
- package/src/components/ListViewLiveBarSummary.vue +0 -52
- package/src/components/ListViewMapSummary.vue +0 -56
- package/src/components/ListViewSettings.vue +0 -514
- package/src/components/ListViewTableSummary.vue +0 -77
- package/src/components/LogViewerItem.vue +0 -116
- package/src/components/MarkdownEdit.vue +0 -128
- package/src/components/MarkdownPreview.vue +0 -102
- package/src/components/MenuItem1.vue +0 -36
- package/src/components/Modal.vue +0 -456
- package/src/components/MultiDropdown.vue +0 -124
- package/src/components/MultilineText.vue +0 -174
- package/src/components/OTPField.vue +0 -139
- package/src/components/ObjectTree.vue +0 -105
- package/src/components/PageBuilder.vue +0 -449
- package/src/components/Paragraph.vue +0 -40
- package/src/components/PresetSelectorFilterItem.vue +0 -203
- package/src/components/Radio.vue +0 -109
- package/src/components/SearchModal.vue +0 -153
- package/src/components/Slider.vue +0 -317
- package/src/components/SplitPane.vue +0 -129
- package/src/components/Svg.vue +0 -33
- package/src/components/SvgEditor.vue +0 -173
- package/src/components/Switch.vue +0 -101
- package/src/components/TabView.vue +0 -105
- package/src/components/Table.vue +0 -56
- package/src/components/TableView.vue +0 -200
- package/src/components/TableViewHead.vue +0 -159
- package/src/components/Tabs.vue +0 -131
- package/src/components/Test.vue +0 -23
- package/src/components/Testimonial.vue +0 -86
- package/src/components/Text.vue +0 -34
- package/src/components/TextBlock.vue +0 -50
- package/src/components/TextEditor.vue +0 -85
- package/src/components/TextWithTag.vue +0 -298
- package/src/components/Textarea.vue +0 -184
- package/src/components/Textbox.vue +0 -216
- package/src/components/Thumbnail.vue +0 -27
- package/src/components/Timepicker.vue +0 -125
- package/src/components/Toast.vue +0 -117
- package/src/components/TreeMenu.vue +0 -122
- package/src/components/TreeView.vue +0 -106
- package/src/components/TreeView2.vue +0 -38
- package/src/components/TreeViewItem.vue +0 -453
- package/src/components/TreeViewItem1.vue +0 -282
- package/src/components/TreeViewItem2.vue +0 -55
- package/src/components/Uploader.vue +0 -45
- package/src/components/Video.vue +0 -119
- package/src/components/VirtualGrid.vue +0 -297
- package/src/components/VirtualScroll.vue +0 -282
- package/src/components/VirtualTable.vue +0 -956
- package/src/components/YoutubeVideo.vue +0 -196
- package/src/configs/dashboard/bar.js +0 -10
- package/src/configs/dashboard/collection-1.js +0 -5
- package/src/configs/dashboard/data-table.js +0 -9
- package/src/configs/dashboard/doughnut.js +0 -7
- package/src/configs/dashboard/gheatmaps.js +0 -9
- package/src/configs/dashboard/grid-2.js +0 -34
- package/src/configs/dashboard/grid-3.js +0 -34
- package/src/configs/dashboard/grid-4.js +0 -34
- package/src/configs/dashboard/grid.js +0 -15
- package/src/configs/dashboard/metric.js +0 -10
- package/src/configs/dashboard/pie.js +0 -7
- package/src/configs/dashboard/polar-area.js +0 -7
- package/src/configs/dashboard/virtual-table.js +0 -9
- package/src/configs/icons-fa.json +0 -12
- package/src/configs/web-page-builder.js +0 -118
- package/src/defs/dashboard-preset.js +0 -22
- package/src/directives/intersect.js +0 -26
- package/src/hooks/device.js +0 -14
- package/src/index.css +0 -3
- package/src/index.js +0 -648
- package/src/middleware/http/trim-string.js +0 -20
- package/src/mixin/component.js +0 -306
- package/src/mixin/ready-state.js +0 -37
- package/src/stores/components.js +0 -36
- package/src/stores/datasource.js +0 -11
- package/src/themes/default/index.js +0 -303
- package/src/utils/dashboard.js +0 -140
- package/src/utils/event-bus.js +0 -8
- package/src/utils/helpers.cjs +0 -635
- package/src/utils/helpers.js +0 -635
- package/src/utils/helpers.mjs +0 -722
- package/src/utils/importer.js +0 -209
- package/src/utils/list.mjs +0 -1509
- package/src/utils/listpage1.js +0 -1507
- package/src/utils/listview.js +0 -1287
- package/src/utils/preset-selector.cjs +0 -1455
- package/src/utils/preset-selector.js +0 -1452
- package/src/utils/preset-selector.mjs +0 -234
- package/src/utils/queue.js +0 -63
- package/src/utils/selection.js +0 -43
- package/src/utils/web.js +0 -50
- package/src/utils/web.mjs +0 -120
- package/src/utils/wss.js +0 -296
- package/src/utils/wss.mjs +0 -285
- package/src/widgets/AhrefSetting.vue +0 -97
- package/src/widgets/ArticleSetting.vue +0 -457
- package/src/widgets/BackgroundColorSetting.vue +0 -153
- package/src/widgets/BackgroundSetting.vue +0 -132
- package/src/widgets/BlockSetting.vue +0 -49
- package/src/widgets/BorderColorSetting.vue +0 -57
- package/src/widgets/BorderSetting.vue +0 -201
- package/src/widgets/BotEditor/BotEditorActions.vue +0 -163
- package/src/widgets/BotEditor/BotEditorSettings.vue +0 -21
- package/src/widgets/BotEditor.vue +0 -248
- package/src/widgets/BoxSetting.vue +0 -53
- package/src/widgets/ButtonSetting.vue +0 -113
- package/src/widgets/CarouselSetting.vue +0 -181
- package/src/widgets/CartSetting.vue +0 -46
- package/src/widgets/CheckoutSetting.vue +0 -46
- package/src/widgets/CollapsiblePanelSetting.vue +0 -46
- package/src/widgets/ColumnSelector.vue +0 -104
- package/src/widgets/ComponentPropertyLabel.vue +0 -35
- package/src/widgets/ComponentPropertySelector.vue +0 -115
- package/src/widgets/ComponentSetting.vue +0 -2220
- package/src/widgets/ComponentSetting2.vue +0 -927
- package/src/widgets/ComponentSetting3.vue +0 -231
- package/src/widgets/ContactForm.vue +0 -193
- package/src/widgets/ContactFormSetting.vue +0 -395
- package/src/widgets/CountdownSetting.vue +0 -76
- package/src/widgets/Dashboard/BarChart.vue +0 -366
- package/src/widgets/Dashboard/BarChartSetting.vue +0 -317
- package/src/widgets/Dashboard/DataTable.vue +0 -125
- package/src/widgets/Dashboard/DataTableSetting.vue +0 -243
- package/src/widgets/Dashboard/DatasourceFilterSharing.vue +0 -93
- package/src/widgets/Dashboard/DatasourcePreview.vue +0 -93
- package/src/widgets/Dashboard/DatasourceSelector.vue +0 -122
- package/src/widgets/Dashboard/Doughnut.vue +0 -199
- package/src/widgets/Dashboard/DoughnutSetting.vue +0 -196
- package/src/widgets/Dashboard/GHeatMapsSetting.vue +0 -108
- package/src/widgets/Dashboard/InteractionEdit.vue +0 -228
- package/src/widgets/Dashboard/Metric.vue +0 -135
- package/src/widgets/Dashboard/MetricSetting.vue +0 -227
- package/src/widgets/Dashboard/Pie.vue +0 -188
- package/src/widgets/Dashboard/PieSetting.vue +0 -247
- package/src/widgets/Dashboard/PolarArea.vue +0 -201
- package/src/widgets/Dashboard/PolarAreaSetting.vue +0 -195
- package/src/widgets/Dashboard/SharingModal.vue +0 -115
- package/src/widgets/Dashboard/ViewSelector.vue +0 -183
- package/src/widgets/Dashboard/VirtualColumnEdit.vue +0 -97
- package/src/widgets/Dashboard/VirtualTableSetting.vue +0 -171
- package/src/widgets/Dashboard0.vue +0 -1856
- package/src/widgets/DataListSetting.vue +0 -102
- package/src/widgets/EffectSetting.vue +0 -94
- package/src/widgets/EmbeddedVideo.vue +0 -60
- package/src/widgets/EmbeddedVideoSetting.vue +0 -50
- package/src/widgets/FAQ.vue +0 -98
- package/src/widgets/FAQSetting.vue +0 -94
- package/src/widgets/FeatureList.vue +0 -131
- package/src/widgets/FeatureListSetting.vue +0 -233
- package/src/widgets/FiltersSetting.vue +0 -88
- package/src/widgets/FlexSetting.vue +0 -174
- package/src/widgets/GridSetting.vue +0 -165
- package/src/widgets/Header.vue +0 -15
- package/src/widgets/Header0.vue +0 -41
- package/src/widgets/Header0Setting.vue +0 -75
- package/src/widgets/Header2.vue +0 -65
- package/src/widgets/Header2Setting.vue +0 -193
- package/src/widgets/HeaderSetting.vue +0 -102
- package/src/widgets/IconList.vue +0 -51
- package/src/widgets/IconListSetting.vue +0 -188
- package/src/widgets/ImageSetting.vue +0 -119
- package/src/widgets/LayoutSetting.vue +0 -251
- package/src/widgets/LinkSetting.vue +0 -209
- package/src/widgets/LinkSettingModal.vue +0 -173
- package/src/widgets/LogViewer.vue +0 -85
- package/src/widgets/MarginPaddingSetting.vue +0 -58
- package/src/widgets/MarginSetting.vue +0 -142
- package/src/widgets/MenuEditor.vue +0 -256
- package/src/widgets/MenuItem1Setting.vue +0 -78
- package/src/widgets/ModalSetting.vue +0 -94
- package/src/widgets/MultiValueSetting.vue +0 -121
- package/src/widgets/MultiValueSetting2.vue +0 -147
- package/src/widgets/OGSettingModal.vue +0 -103
- package/src/widgets/PaddingSetting.vue +0 -142
- package/src/widgets/ParagraphSetting.vue +0 -89
- package/src/widgets/PositionSetting.vue +0 -209
- package/src/widgets/PresetBar.vue +0 -990
- package/src/widgets/PresetBarPivot.vue +0 -198
- package/src/widgets/PresetBarPivotColumnEdit.vue +0 -197
- package/src/widgets/PresetSelector.vue +0 -685
- package/src/widgets/Review.vue +0 -131
- package/src/widgets/ReviewSetting.vue +0 -201
- package/src/widgets/SearchModalSetting.vue +0 -70
- package/src/widgets/Share.vue +0 -164
- package/src/widgets/ShareSetting.vue +0 -99
- package/src/widgets/SizingSetting.vue +0 -306
- package/src/widgets/SpacingSetting.vue +0 -77
- package/src/widgets/StyleSetting.vue +0 -543
- package/src/widgets/StyleSetting2.vue +0 -90
- package/src/widgets/SvgSetting.vue +0 -133
- package/src/widgets/TableSetting.vue +0 -172
- package/src/widgets/TestimonialSetting.vue +0 -161
- package/src/widgets/TextBlockSetting.vue +0 -81
- package/src/widgets/ThumbnailSetting.vue +0 -49
- package/src/widgets/TransitionSetting.vue +0 -64
- package/src/widgets/TypographySetting.vue +0 -334
- package/src/widgets/UserActionBuilder/UserActionCondition.vue +0 -99
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +0 -97
- package/src/widgets/UserActionBuilder/UserActionItem.vue +0 -273
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +0 -152
- package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +0 -27
- package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +0 -28
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +0 -112
- package/src/widgets/UserActionBuilder/UserActionProps.vue +0 -213
- package/src/widgets/UserActionBuilder.vue +0 -314
- package/src/widgets/WebComponentSelector.vue +0 -205
- package/src/widgets/WebDatasourceSelector.vue +0 -153
- package/src/widgets/WebLayoutSelector.vue +0 -147
- package/src/widgets/WebPageBuilder.vue +0 -2161
- package/src/widgets/WebPageBuilder2.vue +0 -1091
- package/src/widgets/WebPageBuilder3.vue +0 -411
- package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +0 -54
- package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BlurSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +0 -64
- package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +0 -69
- package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +0 -73
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -65
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +0 -178
- package/src/widgets/WebPageBuilder4/DisplaySetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +0 -71
- package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +0 -74
- package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +0 -71
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +0 -96
- package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +0 -69
- package/src/widgets/WebPageBuilder4/GapSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/GridSetting.vue +0 -216
- package/src/widgets/WebPageBuilder4/HeightSetting.vue +0 -98
- package/src/widgets/WebPageBuilder4/ImageSetting.vue +0 -102
- package/src/widgets/WebPageBuilder4/MarginSetting.vue +0 -73
- package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +0 -82
- package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +0 -90
- package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +0 -81
- package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +0 -101
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +0 -163
- package/src/widgets/WebPageBuilder4/OpacitySetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/OverflowSetting.vue +0 -81
- package/src/widgets/WebPageBuilder4/PaddingSetting.vue +0 -57
- package/src/widgets/WebPageBuilder4/PositionSetting.vue +0 -191
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -176
- package/src/widgets/WebPageBuilder4/TextSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/TreeView.vue +0 -46
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +0 -303
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +0 -141
- package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +0 -172
- package/src/widgets/WebPageBuilder4/WidthSetting.vue +0 -105
- package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4.vue +0 -798
- package/src/widgets/WebPagePreview.vue +0 -295
- package/src/widgets/WebPageSelector.vue +0 -173
- package/src/widgets/WebTemplateCreator.vue +0 -156
- package/src/widgets/YoutubeVideoSetting.vue +0 -68
- package/tailwind.config.js +0 -481
|
@@ -1,2161 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex-1 flex items-center justify-center" v-if="readyState === 2">
|
|
3
|
-
<svg class="animate-spin aspect-square w-[48px]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
|
|
4
|
-
</div>
|
|
5
|
-
<div :class="$style.comp" v-else-if="page">
|
|
6
|
-
|
|
7
|
-
<div class="flex-1 flex flex-col bg-base-400">
|
|
8
|
-
|
|
9
|
-
<div class="p-3 pr-5 flex justify-center gap-4 border-b-[1px] border-border-50">
|
|
10
|
-
<div class="flex-1 flex flex-row gap-4 items-center"
|
|
11
|
-
@click.meta="log(page)"
|
|
12
|
-
@click.alt="log(layout)">
|
|
13
|
-
|
|
14
|
-
<button ref="close" class=" p-1"
|
|
15
|
-
@click="close">
|
|
16
|
-
<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>
|
|
17
|
-
</button>
|
|
18
|
-
|
|
19
|
-
<h4 class="mr-5 w-[200px] text-ellipsis whitespace-nowrap overflow-hidden">
|
|
20
|
-
{{ page.title }}
|
|
21
|
-
</h4>
|
|
22
|
-
|
|
23
|
-
<div class="flex-1">
|
|
24
|
-
<Textbox :readonly="1" :value="computedIframeSrc" class="w-full rounded-full" item-class="p-1">
|
|
25
|
-
<template #start>
|
|
26
|
-
<div class="flex flex-row items-center mr-2">
|
|
27
|
-
<button @click="reloadIframe" class="p-3">
|
|
28
|
-
<svg width="14" height="14" viewBox="0 0 24 24" class="fill-primary" xmlns="http://www.w3.org/2000/svg">
|
|
29
|
-
<path d="M3.75 12C3.75 7.44365 7.44365 3.75 12 3.75C14.7802 3.75 17.1982 5.12612 18.6816 7.24467L16.5022 7.23828C16.088 7.23707 15.7512 7.57187 15.75 7.98608C15.7488 8.4003 16.0836 8.73706 16.4978 8.73828L19.9491 8.74839C19.9817 8.75065 20.0147 8.75076 20.0477 8.74868L20.4978 8.75C20.6971 8.75058 20.8884 8.67182 21.0296 8.53111C21.1707 8.39039 21.25 8.19929 21.25 8L21.25 4C21.25 3.58579 20.9142 3.25 20.5 3.25C20.0858 3.25 19.75 3.58579 19.75 4L19.75 6.16237C17.9894 3.79113 15.2004 2.25 12 2.25C6.61522 2.25 2.25 6.61522 2.25 12C2.25 17.3848 6.61522 21.75 12 21.75C15.8354 21.75 19.0799 19.5367 20.6716 16.3338C20.856 15.9628 20.7047 15.5127 20.3338 15.3284C19.9628 15.144 19.5127 15.2953 19.3284 15.6662C17.9747 18.3902 15.2321 20.25 12 20.25C7.44365 20.25 3.75 16.5563 3.75 12Z"/>
|
|
30
|
-
</svg>
|
|
31
|
-
</button>
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
34
|
-
<template #end>
|
|
35
|
-
<div class="flex flex-row gap-5 ml-3">
|
|
36
|
-
<CopyToClipboard :value="computedIframeSrc" @copied="toast($t('URL Copied'))">
|
|
37
|
-
<svg width="14" height="14" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM352 32.491a15.88 15.88 0 0 1 7.431 4.195l51.882 51.883A15.885 15.885 0 0 1 415.508 96H352V32.491zM288 464c0 8.822-7.178 16-16 16H48c-8.822 0-16-7.178-16-16V144c0-8.822 7.178-16 16-16h80v240c0 26.51 21.49 48 48 48h112v48zm128-96c0 8.822-7.178 16-16 16H176c-8.822 0-16-7.178-16-16V48c0-8.822 7.178-16 16-16h144v72c0 13.2 10.8 24 24 24h72v240z"/></svg>
|
|
38
|
-
</CopyToClipboard>
|
|
39
|
-
<a type="button" class="w-[24px]" :href="computedIframeSrc" target="_blank">
|
|
40
|
-
<svg width="12" height="12" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M497.6,0,334.4.17A14.4,14.4,0,0,0,320,14.57V47.88a14.4,14.4,0,0,0,14.69,14.4l73.63-2.72,2.06,2.06L131.52,340.49a12,12,0,0,0,0,17l23,23a12,12,0,0,0,17,0L450.38,101.62l2.06,2.06-2.72,73.63A14.4,14.4,0,0,0,464.12,192h33.31a14.4,14.4,0,0,0,14.4-14.4L512,14.4A14.4,14.4,0,0,0,497.6,0ZM432,288H416a16,16,0,0,0-16,16V458a6,6,0,0,1-6,6H54a6,6,0,0,1-6-6V118a6,6,0,0,1,6-6H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V304A16,16,0,0,0,432,288Z"/></svg>
|
|
41
|
-
</a>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
</Textbox>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<Tabs :items="previewModes" v-model="store.previewMode" variant="button" @change="updateIframe" class="rounded-full" />
|
|
48
|
-
|
|
49
|
-
<div v-if="pageHistory" class="flex flex-row border-[1px] border-border-200 bg-text-50 rounded-full overflow-hidden">
|
|
50
|
-
<button type="button" class="p-2 px-3 group"
|
|
51
|
-
:class="pageHistory.canUndo.value && pageHistory.history.value.length > 2 ? 'hover:bg-primary' : 'opacity-50 cursor-not-allowed'"
|
|
52
|
-
:disabled="!(pageHistory.canUndo.value && pageHistory.history.value.length > 2)"
|
|
53
|
-
@click="pageHistory.undo">
|
|
54
|
-
<svg width="14" height="14" class="fill-text"
|
|
55
|
-
:class="pageHistory.canUndo.value && pageHistory.history.value.length > 2 ? 'group-hover:fill-white' : ''"
|
|
56
|
-
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/></svg>
|
|
57
|
-
</button>
|
|
58
|
-
<button type="button" class="p-2 px-3 group"
|
|
59
|
-
:class="pageHistory.canRedo.value ? 'hover:bg-primary': 'opacity-50 cursor-not-allowed'"
|
|
60
|
-
:disabled="!pageHistory.canRedo.value"
|
|
61
|
-
@click="pageHistory.redo">
|
|
62
|
-
<svg width="14" height="14" class="fill-text"
|
|
63
|
-
:class="pageHistory.canRedo.value ? 'group-hover:fill-white' : ''"
|
|
64
|
-
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/></svg>
|
|
65
|
-
</button>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<Button ref="saveBtn"
|
|
69
|
-
class="w-[70px] rounded-full p-1"
|
|
70
|
-
:state="canSave ? 1 : -1"
|
|
71
|
-
@click="save">{{ $t('Save') }}</Button>
|
|
72
|
-
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div class="flex-1 flex flex-row">
|
|
77
|
-
|
|
78
|
-
<div ref="leftPanel" class="flex flex-row"
|
|
79
|
-
:style="section1Style">
|
|
80
|
-
|
|
81
|
-
<div class="flex-1 flex flex-col overflow-y-auto">
|
|
82
|
-
|
|
83
|
-
<div class="flex flex-col px-3 border-b-[1px] border-border-100 overflow-x-auto no-scrollbar pt-1">
|
|
84
|
-
<Tabs :items="tabItems"
|
|
85
|
-
v-model="store.tabIndex" />
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div v-if="store.tabIndex === 1" class="flex-1 overflow-y-auto flex flex-col gap-4 p-6">
|
|
89
|
-
|
|
90
|
-
<div class="flex flex-row gap-4" v-if="!page.isSystem">
|
|
91
|
-
<div class="flex flex-col gap-1">
|
|
92
|
-
<small class="text-text-400 w-[40px]">{{ $t('Status') }}</small>
|
|
93
|
-
<Dropdown v-model="page.status">
|
|
94
|
-
<option :value="-1">{{ $t('Disabled') }}</option>
|
|
95
|
-
<option :value="0">{{ $t('Draft') }}</option>
|
|
96
|
-
<option :value="1">{{ $t('Active') }}</option>
|
|
97
|
-
</Dropdown>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<div class="flex-1">
|
|
101
|
-
<small class="text-text-400">{{ $t('Path')}}</small>
|
|
102
|
-
<Textbox v-model="page.path" />
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
<div class="flex flex-col gap-1">
|
|
107
|
-
<small class="text-text-400">{{ $t('Title')}}</small>
|
|
108
|
-
<Textbox v-model="page.title" />
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div class="flex flex-col gap-1">
|
|
112
|
-
<small class="text-text-400">{{ $t('Description')}}</small>
|
|
113
|
-
<Textarea v-model="page.description" />
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<div class="flex flex-col gap-1">
|
|
117
|
-
<small class="text-text-400">{{ $t('Keywords')}}</small>
|
|
118
|
-
<Textbox v-model="page.keywords" />
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
<div>
|
|
122
|
-
<div class="mb-1">
|
|
123
|
-
<small class="text-text-400">{{ $t('OG')}}</small>
|
|
124
|
-
</div>
|
|
125
|
-
<div class="flex flex-row gap-2 bg-base-500 border-[1px] border-border-200 rounded-lg p-1 cursor-pointer"
|
|
126
|
-
@click="$refs.ogModal.open({ ...this.page.og }, og => page.og = og)"
|
|
127
|
-
v-if="page.og && Object.keys(page.og).length > 0">
|
|
128
|
-
<div>
|
|
129
|
-
<Image :src="page.og.image" class="w-[40px] aspect-square bg-text-50" />
|
|
130
|
-
</div>
|
|
131
|
-
<div class="flex-1 flex flex-col">
|
|
132
|
-
<label class="text-sm text-ellipsis-nowrap">
|
|
133
|
-
{{ page.og.title }}
|
|
134
|
-
</label>
|
|
135
|
-
<small class="text-sm text-ellipsis-nowrap">
|
|
136
|
-
{{ page.og.description }}
|
|
137
|
-
</small>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
<div v-else class="bg-base-500 p-2 text-center border-[1px] border-border-100 rounded-lg cursor-pointer"
|
|
141
|
-
@click="$refs.ogModal.open(page.og, og => page.og = og)">
|
|
142
|
-
Set OG
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
<div>
|
|
147
|
-
<div class="flex flex-row gap-2 mb-1">
|
|
148
|
-
<small class="flex-1 text-text-400">{{ $t('JSON-LD')}}</small>
|
|
149
|
-
<button type="button" class="text-primary text-sm" @click="$refs.ldjsonModal.open({})">
|
|
150
|
-
{{ $t('Add') }}
|
|
151
|
-
</button>
|
|
152
|
-
</div>
|
|
153
|
-
<ListItem v-if="page.ldjson && page.ldjson.length > 0" :items="page.ldjson" class="mt-1">
|
|
154
|
-
<template v-slot="{ item, index }">
|
|
155
|
-
<div class="flex overflow-hidden bg-text-50 rounded-lg p-2 mb-1" :key="item">
|
|
156
|
-
<p class="flex-1 line-clamp-1 cursor-pointer" @click="$refs.ldjsonModal.open({ index, code:item })">
|
|
157
|
-
{{ item }}
|
|
158
|
-
</p>
|
|
159
|
-
<button type="button" @click="confirm($t('Remove this json-ld?'), { onConfirm: () => { page.ldjson.splice(index, 1); } })">
|
|
160
|
-
<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="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>
|
|
161
|
-
</button>
|
|
162
|
-
</div>
|
|
163
|
-
</template>
|
|
164
|
-
</ListItem>
|
|
165
|
-
<div v-else class="bg-base-500 p-2 text-center border-[1px] border-border-100 rounded-lg cursor-pointer text-text-300">
|
|
166
|
-
No JSON-LD set
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
<div>
|
|
171
|
-
<small class="flex-1 text-text-400">{{ $t('No Index')}}</small>
|
|
172
|
-
<Dropdown v-model="page.noIndex" class="w-full max-w-[300px]">
|
|
173
|
-
<option value="none">None</option>
|
|
174
|
-
<option value="robots">All</option>
|
|
175
|
-
<option value="googlebot">Google Bot</option>
|
|
176
|
-
</Dropdown>
|
|
177
|
-
</div>
|
|
178
|
-
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<div v-else-if="store.tabIndex === 2" class="flex-1 overflow-y-auto p-6 flex flex-col gap-6">
|
|
182
|
-
|
|
183
|
-
<div>
|
|
184
|
-
<div class="flex flex-row gap-1 items-end cursor-pointer">
|
|
185
|
-
<small class="flex-1 text-text-400 text-overflow-ellipsis">{{ $t('Components')}}</small>
|
|
186
|
-
<button type="button" class="text-primary text-sm flex flex-row items-center gap-1"
|
|
187
|
-
@click="openComponentSelector({ callback:(component) => page.components.push(component) })">
|
|
188
|
-
{{ $t('Add')}}
|
|
189
|
-
</button>
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
<div class="flex flex-col gap-10">
|
|
193
|
-
<TreeView class="mt-2"
|
|
194
|
-
v-model="page.components"
|
|
195
|
-
:selected-item="currentItem"
|
|
196
|
-
@add="(items) => openComponentSelector({ callback:(component) => items.push(component) })"
|
|
197
|
-
@duplicate="duplicate"
|
|
198
|
-
@change="pageHistory.commit()">
|
|
199
|
-
<template #default="{ item }">
|
|
200
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
201
|
-
:class="!item.props.enabled ? 'line-through' : ''"
|
|
202
|
-
@click="select(item.uid)">
|
|
203
|
-
{{ item.props.name ?? item.type }}
|
|
204
|
-
</div>
|
|
205
|
-
</template>
|
|
206
|
-
</TreeView>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
</div>
|
|
211
|
-
|
|
212
|
-
<div v-else-if="store.tabIndex === 3" class="flex-1 overflow-y-auto p-6">
|
|
213
|
-
|
|
214
|
-
<div class="p-6 flex flex-col gap-2" v-if="Array.isArray(page.datasource) && page.datasource.length > 0">
|
|
215
|
-
<div v-for="(ds, index) in page.datasource"
|
|
216
|
-
class="p-3 border-[1px] border-border-50 rounded-lg flex flex-row items-start gap-2">
|
|
217
|
-
<div class="flex-1 flex flex-col" @click="$refs.webDatasourceSelector.open({ _index:index, ...ds })">
|
|
218
|
-
<label>{{ ds.name }}</label>
|
|
219
|
-
</div>
|
|
220
|
-
<button type="button"
|
|
221
|
-
@click="removeDatasource(index)">
|
|
222
|
-
<svg width="14" height="14" class="fill-text-300 hover:fill-red-500" 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>
|
|
223
|
-
</button>
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
<div v-else>
|
|
227
|
-
<div class="p-6 text-center">
|
|
228
|
-
<small class="text-text-400">{{ $t('No Datasource')}}</small>
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<div class="text-center" v-if="useDatasource">
|
|
233
|
-
<button type="button" class="text-primary"
|
|
234
|
-
@click="$refs.webDatasourceSelector.create()">
|
|
235
|
-
Add Datasource
|
|
236
|
-
</button>
|
|
237
|
-
</div>
|
|
238
|
-
|
|
239
|
-
<WebDatasourceSelector ref="webDatasourceSelector"
|
|
240
|
-
@apply="addDatasource"
|
|
241
|
-
:use-datasource="useDatasource" />
|
|
242
|
-
|
|
243
|
-
</div>
|
|
244
|
-
|
|
245
|
-
<div v-else-if="store.tabIndex === 4" class="flex-1 overflow-y-auto flex flex-col">
|
|
246
|
-
|
|
247
|
-
<div class="p-6">
|
|
248
|
-
<div class="flex flex-row items-end gap-2">
|
|
249
|
-
<small class="flex-1 text-text-400">{{ $t('Layout')}}</small>
|
|
250
|
-
<button type="button" class="text-primary text-sm" @click="store.layoutMode = !store.layoutMode">
|
|
251
|
-
{{ store.layoutMode ? 'Hide Layout' : 'Edit Layout' }}
|
|
252
|
-
</button>
|
|
253
|
-
</div>
|
|
254
|
-
<div class="mt-1">
|
|
255
|
-
<div class="cursor-pointer bg-text-50 p-2 border-[1px] border-border-200 flex flex-row items-center rounded-lg"
|
|
256
|
-
@click="(e) => $refs.layoutSelector.open(e.target)">
|
|
257
|
-
<div class="flex-1 pointer-events-none">
|
|
258
|
-
{{ layout ? (layout.name ?? layout.title) : 'None' }}
|
|
259
|
-
</div>
|
|
260
|
-
<div class="pointer-events-none">
|
|
261
|
-
<svg class="fill-text-300 pointer-events-none" width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
262
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
|
|
263
|
-
</svg>
|
|
264
|
-
</div>
|
|
265
|
-
</div>
|
|
266
|
-
|
|
267
|
-
<ContextMenu ref="layoutSelector">
|
|
268
|
-
<div class="flex flex-col min-w-[260px] divide-y divide-border-50">
|
|
269
|
-
|
|
270
|
-
<div @click="page.layoutId = null;" :class="appStyle.menuItem">None</div>
|
|
271
|
-
|
|
272
|
-
<div v-for="layout in layouts"
|
|
273
|
-
:class="appStyle.menuItem"
|
|
274
|
-
@click="page.layoutId = layout.id;pageHistory.commit()">
|
|
275
|
-
{{ layout.name ?? layout.title }}
|
|
276
|
-
</div>
|
|
277
|
-
|
|
278
|
-
<div class="flex flex-row">
|
|
279
|
-
<button type="button" class="p-3 flex-1 cursor-pointer text-primary"
|
|
280
|
-
@click="$refs.webLayoutSelector.create({})">
|
|
281
|
-
Create New...
|
|
282
|
-
</button>
|
|
283
|
-
</div>
|
|
284
|
-
|
|
285
|
-
</div>
|
|
286
|
-
</ContextMenu>
|
|
287
|
-
</div>
|
|
288
|
-
</div>
|
|
289
|
-
|
|
290
|
-
<div v-if="layout" class="flex flex-col gap-6 p-6 border-t-[1px] border-border-50">
|
|
291
|
-
<div>
|
|
292
|
-
<small class="text-text-400">Name</small>
|
|
293
|
-
<Textbox v-model="layout.title"/>
|
|
294
|
-
</div>
|
|
295
|
-
|
|
296
|
-
<div>
|
|
297
|
-
<div class="flex flex-row gap-1 items-end cursor-pointer">
|
|
298
|
-
<small class="flex-1 text-text-400 text-overflow-ellipsis">{{ $t('Headers')}}</small>
|
|
299
|
-
<button type="button" class="text-primary text-sm flex flex-row items-center gap-1"
|
|
300
|
-
@click="openComponentSelector({ callback:(component) => layout.headers.push(component) })">
|
|
301
|
-
{{ $t('Add')}}
|
|
302
|
-
</button>
|
|
303
|
-
</div>
|
|
304
|
-
|
|
305
|
-
<TreeView class="mt-2"
|
|
306
|
-
v-model="layout.headers"
|
|
307
|
-
:selected-item="currentItem"
|
|
308
|
-
@add="(items) => openComponentSelector({ callback:(component) => items.push(component) })"
|
|
309
|
-
@duplicate="duplicate"
|
|
310
|
-
@change="pageHistory.commit()">
|
|
311
|
-
<template #default="{ item }">
|
|
312
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
313
|
-
:class="!item.props.enabled ? 'line-through' : ''"
|
|
314
|
-
@click="select(item.uid)">
|
|
315
|
-
{{ item.props.name ?? item.type }}
|
|
316
|
-
</div>
|
|
317
|
-
</template>
|
|
318
|
-
</TreeView>
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
<div>
|
|
322
|
-
<div class="flex flex-row gap-1 items-end cursor-pointer">
|
|
323
|
-
<small class="flex-1 text-text-400 text-overflow-ellipsis">{{ $t('Footers')}}</small>
|
|
324
|
-
<button type="button" class="text-primary text-sm flex flex-row items-center gap-1"
|
|
325
|
-
@click="openComponentSelector({ callback:(component) => layout.footers.push(component) })">
|
|
326
|
-
{{ $t('Add')}}
|
|
327
|
-
</button>
|
|
328
|
-
</div>
|
|
329
|
-
|
|
330
|
-
<TreeView class="mt-2"
|
|
331
|
-
v-model="layout.footers"
|
|
332
|
-
:selected-item="currentItem"
|
|
333
|
-
@add="(items) => openComponentSelector({ callback:(component) => items.push(component) })"
|
|
334
|
-
@duplicate="duplicate"
|
|
335
|
-
@change="pageHistory.commit()">
|
|
336
|
-
<template #default="{ item }">
|
|
337
|
-
<div class="flex-1 text-ellipsis whitespace-nowrap overflow-hidden"
|
|
338
|
-
:class="!item.props.enabled ? 'line-through' : ''"
|
|
339
|
-
@click="select(item.uid)">
|
|
340
|
-
{{ item.props.name ?? item.type }}
|
|
341
|
-
</div>
|
|
342
|
-
</template>
|
|
343
|
-
</TreeView>
|
|
344
|
-
</div>
|
|
345
|
-
|
|
346
|
-
<div>
|
|
347
|
-
<div class="flex flex-row gap-1 items-end cursor-pointer">
|
|
348
|
-
<small class="flex-1 text-text-400 text-overflow-ellipsis">{{ $t('Styles')}}</small>
|
|
349
|
-
<button type="button" class="text-primary text-sm flex flex-row items-center gap-1"
|
|
350
|
-
@click="select('style')">
|
|
351
|
-
{{ $t('Edit Style')}}
|
|
352
|
-
</button>
|
|
353
|
-
</div>
|
|
354
|
-
</div>
|
|
355
|
-
</div>
|
|
356
|
-
|
|
357
|
-
</div>
|
|
358
|
-
|
|
359
|
-
<div v-else-if="store.tabIndex === 7" class="flex-1 flex flex-col">
|
|
360
|
-
<div class="flex flex-row justify-end p-4">
|
|
361
|
-
<button type="button" @click="newChat()">
|
|
362
|
-
<svg width="19" height="19" class="fill-primary hover:fill-primary-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256C397.4 512 512 397.4 512 256S397.4 0 256 0zM352 280H280V352c0 13.2-10.8 24-23.1 24C242.8 376 232 365.2 232 352V280H160C146.8 280 136 269.2 136 256c0-13.2 10.8-24 24-24H232V160c0-13.2 10.8-24 24-24C269.2 136 280 146.8 280 160v72h72C365.2 232 376 242.8 376 256C376 269.2 365.2 280 352 280z"/></svg>
|
|
363
|
-
</button>
|
|
364
|
-
</div>
|
|
365
|
-
<div class="flex-1 overflow-y-auto">
|
|
366
|
-
|
|
367
|
-
<div class="flex flex-col gap-4 p-4">
|
|
368
|
-
|
|
369
|
-
<div v-for="message in chat.messages"
|
|
370
|
-
:class="$style.chat + ' ' + (message.direction === 1 ? $style.chatIn : $style.chatOut)">
|
|
371
|
-
|
|
372
|
-
<p>{{ message.body }}</p>
|
|
373
|
-
|
|
374
|
-
<div v-if="message.direction !== 1" class="flex text-text-300 flex-row items-center gap-2 self-stretch pl-3">
|
|
375
|
-
<small class="text-xs text-text-300">{{ message.llmOutputTokenCount }} token</small>
|
|
376
|
-
•
|
|
377
|
-
<small class="text-xs text-text-300">{{ message.llmEllapsedMs }} ms</small>
|
|
378
|
-
<div class="flex-1"></div>
|
|
379
|
-
<button type="button" class="text-xs group hover:text-primary" v-if="(message.attachments ?? [])[0]" @click="chatSet(message.attachments[0])">
|
|
380
|
-
<svg width="9" height="9" class="inline fill-text-300 group-hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M176 480C148.6 480 128 457.6 128 432v-352c0-25.38 20.4-47.98 48.01-47.98c8.686 0 17.35 2.352 25.02 7.031l288 176C503.3 223.8 512 239.3 512 256s-8.703 32.23-22.97 40.95l-288 176C193.4 477.6 184.7 480 176 480z"/></svg>
|
|
381
|
-
Apply
|
|
382
|
-
</button>
|
|
383
|
-
</div>
|
|
384
|
-
</div>
|
|
385
|
-
|
|
386
|
-
</div>
|
|
387
|
-
|
|
388
|
-
<pre class="text-xs break-all whitespace-pre-wrap">
|
|
389
|
-
|
|
390
|
-
</pre>
|
|
391
|
-
|
|
392
|
-
</div>
|
|
393
|
-
<div class="p-2">
|
|
394
|
-
<div class="flex flex-col gap-2">
|
|
395
|
-
<div class="flex flex-row gap-2 items-start">
|
|
396
|
-
<div class="w-[22px]"></div>
|
|
397
|
-
<div class="flex-1 flex flex-row flex-wrap gap-2">
|
|
398
|
-
<div v-for="(attachment, idx) in chat.attachments">
|
|
399
|
-
<Image :src="attachment.image"
|
|
400
|
-
@click="chat.attachments.splice(idx, 1)"
|
|
401
|
-
class="w-[48px] h-[48px] border-[1px] rounded-lg border-border-200" />
|
|
402
|
-
</div>
|
|
403
|
-
</div>
|
|
404
|
-
</div>
|
|
405
|
-
|
|
406
|
-
<div class="flex flex-row items-start gap-2">
|
|
407
|
-
<div class="pt-1">
|
|
408
|
-
<Button variant="minimal" class="p-0 mt-1" type="button" @click="$refs.chatFile.click()">
|
|
409
|
-
<svg width="19" height="19" class="fill-primary hover:fill-primary-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256C397.4 512 512 397.4 512 256S397.4 0 256 0zM352 280H280V352c0 13.2-10.8 24-23.1 24C242.8 376 232 365.2 232 352V280H160C146.8 280 136 269.2 136 256c0-13.2 10.8-24 24-24H232V160c0-13.2 10.8-24 24-24C269.2 136 280 146.8 280 160v72h72C365.2 232 376 242.8 376 256C376 269.2 365.2 280 352 280z"/></svg>
|
|
410
|
-
</Button>
|
|
411
|
-
<input type="file" accept="image/*" multiple ref="chatFile" class="hidden" @change="onChatUpload" />
|
|
412
|
-
</div>
|
|
413
|
-
<div class="flex-1">
|
|
414
|
-
<Textarea v-model="chat.input" rows="5" class="max-h-[60vh]">
|
|
415
|
-
<template #end>
|
|
416
|
-
<div class="p-2">
|
|
417
|
-
<Button ref="chatBtn" variant="minimal" class="p-0" type="button" @click="chatApply">
|
|
418
|
-
<svg width="19" height="19" class="fill-primary hover:fill-primary-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM372.5 276.5l-144 88C224.7 366.8 220.3 368 216 368c-13.69 0-24-11.2-24-24V168C192 155.3 202.2 144 216 144c4.344 0 8.678 1.176 12.51 3.516l144 88C379.6 239.9 384 247.6 384 256C384 264.4 379.6 272.1 372.5 276.5z"/></svg>
|
|
419
|
-
</Button>
|
|
420
|
-
</div>
|
|
421
|
-
</template>
|
|
422
|
-
</Textarea>
|
|
423
|
-
</div>
|
|
424
|
-
</div>
|
|
425
|
-
|
|
426
|
-
<div class="flex flex-row justify-end px-3 gap-2 text-text-300 text-xs">
|
|
427
|
-
<div class="text-text-300">{{ totalChatTokens }} tokens</div>
|
|
428
|
-
•
|
|
429
|
-
<div class="text-text-300">{{ chat.model }}</div>
|
|
430
|
-
</div>
|
|
431
|
-
</div>
|
|
432
|
-
</div>
|
|
433
|
-
</div>
|
|
434
|
-
|
|
435
|
-
</div>
|
|
436
|
-
|
|
437
|
-
<div :class="$style.resize1"
|
|
438
|
-
@mousedown="(e) => $util.dragResize(e, resize1)"></div>
|
|
439
|
-
|
|
440
|
-
</div>
|
|
441
|
-
|
|
442
|
-
<div ref="preview" class="flex-1 relative" :class="previewClass">
|
|
443
|
-
|
|
444
|
-
<div class="flex flex-row gap-4 items-center p-2">
|
|
445
|
-
<select v-model="store.zoomLevel" :class="$style.zoomLevel">
|
|
446
|
-
<optgroup label="Zoom Level">
|
|
447
|
-
<option value="fit">Fit</option>
|
|
448
|
-
<option value="125%">125%</option>
|
|
449
|
-
<option value="100%">100%</option>
|
|
450
|
-
<option value="75%">75%</option>
|
|
451
|
-
<option value="50%">50%</option>
|
|
452
|
-
</optgroup>
|
|
453
|
-
</select>
|
|
454
|
-
|
|
455
|
-
<div class="flex-1"></div>
|
|
456
|
-
|
|
457
|
-
<div class="flex flex-row border-[1px] border-border-200 divide-x divide-border-50" :class="$style.zoomLevel">
|
|
458
|
-
<Radio v-for="_type in viewTypes" :value="_type.value" v-model="store.viewType" :custom="true">
|
|
459
|
-
<template #default="">
|
|
460
|
-
<button v-if="_type.value === ''" type="button" class="w-[30px] flex items-center justify-center">
|
|
461
|
-
<svg width="14" height="14" :class="_type.value === store.viewType ? 'fill-primary' : 'fill-text'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M320 0H64C37.5 0 16 21.5 16 48v416C16 490.5 37.5 512 64 512h256c26.5 0 48-21.5 48-48v-416C368 21.5 346.5 0 320 0zM240 447.1C240 456.8 232.8 464 224 464H159.1C151.2 464 144 456.8 144 448S151.2 432 160 432h64C232.8 432 240 439.2 240 447.1zM304 384h-224V64h224V384z"/></svg>
|
|
462
|
-
</button>
|
|
463
|
-
<button v-if="_type.value === 'md:'" type="button" class="w-[30px] flex items-center justify-center">
|
|
464
|
-
<svg width="14" height="14" :class="_type.value === store.viewType ? 'fill-primary' : 'fill-text'" 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="M384 .0001H64c-35.35 0-64 28.65-64 64v384c0 35.35 28.65 63.1 64 63.1h320c35.35 0 64-28.65 64-63.1v-384C448 28.65 419.3 .0001 384 .0001zM288 448c0 8.837-7.163 16-15.1 16H175.1c-8.837 0-15.1-7.163-15.1-16s7.163-16 15.1-16h96C280.8 432 288 439.2 288 448zM384 384H64v-320h320V384z"/></svg>
|
|
465
|
-
</button>
|
|
466
|
-
<button v-if="_type.value === 'xl:'" type="button" class="w-[30px] flex items-center justify-center">
|
|
467
|
-
<svg width="14" height="14" :class="_type.value === store.viewType ? 'fill-primary' : 'fill-text'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M528 0h-480C21.5 0 0 21.5 0 48v320C0 394.5 21.5 416 48 416h192L224 464H152C138.8 464 128 474.8 128 488S138.8 512 152 512h272c13.25 0 24-10.75 24-24s-10.75-24-24-24H352L336 416h192c26.5 0 48-21.5 48-48v-320C576 21.5 554.5 0 528 0zM512 288H64V64h448V288z"/></svg>
|
|
468
|
-
</button>
|
|
469
|
-
<button v-if="_type.value === '2xl:'" type="button" class="w-[30px] flex items-center justify-center">
|
|
470
|
-
<svg width="14" height="14" :class="_type.value === store.viewType ? 'fill-primary' : 'fill-text'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M512 448H127.1C110.3 448 96 462.3 96 479.1S110.3 512 127.1 512h384C529.7 512 544 497.7 544 480S529.7 448 512 448zM592 0h-544C21.5 0 0 21.5 0 48v320C0 394.5 21.5 416 48 416h544c26.5 0 48-21.5 48-48v-320C640 21.5 618.5 0 592 0zM576 352H64v-288h512V352z"/></svg>
|
|
471
|
-
</button>
|
|
472
|
-
</template>
|
|
473
|
-
</Radio>
|
|
474
|
-
</div>
|
|
475
|
-
</div>
|
|
476
|
-
|
|
477
|
-
<div class="p-6">
|
|
478
|
-
<iframe :src="iframeSrc" :width="iframeSize.width" :height="iframeSize.height"
|
|
479
|
-
class="mx-auto border-[2px] border-text-300" :style="iframeStyle" ref="iframe"></iframe>
|
|
480
|
-
</div>
|
|
481
|
-
</div>
|
|
482
|
-
|
|
483
|
-
<div v-if="currentItem" ref="rightPanel" class="flex flex-row"
|
|
484
|
-
:style="section3Style" @click.meta="log(currentItem)">
|
|
485
|
-
|
|
486
|
-
<div :class="$style.resize3"
|
|
487
|
-
@mousedown="(e) => $util.dragResize(e, resize3)"></div>
|
|
488
|
-
|
|
489
|
-
<div class="flex-1 flex flex-col relative"
|
|
490
|
-
ref="rightPane">
|
|
491
|
-
|
|
492
|
-
<TransitionGroup name="openltr" tag="div" class="flex-1 flex flex-col">
|
|
493
|
-
|
|
494
|
-
<div v-if="extRightPane === null" class="flex-1 flex flex-col divide-y divide-border-50 overflow-y-auto">
|
|
495
|
-
|
|
496
|
-
<div v-if="currentItem.type !== 'Style'" class="px-6 py-4 flex flex-row gap-5 items-start">
|
|
497
|
-
<div>
|
|
498
|
-
<small class="text-text-400">Enabled</small>
|
|
499
|
-
<Switch v-model="currentItem.props.enabled"/>
|
|
500
|
-
</div>
|
|
501
|
-
<div v-if="currentItem.type !== 'Style'" class="flex-1">
|
|
502
|
-
<small class="text-text-400">Name</small>
|
|
503
|
-
<Textbox v-model="currentItem.props.name"
|
|
504
|
-
:placeholder="currentItem.type"
|
|
505
|
-
class="bg-base-500 flex-1"
|
|
506
|
-
variant="minimal" />
|
|
507
|
-
</div>
|
|
508
|
-
<div v-else class="px-3">
|
|
509
|
-
<h4>Style</h4>
|
|
510
|
-
</div>
|
|
511
|
-
</div>
|
|
512
|
-
|
|
513
|
-
<component :is="`${currentItem.type}Setting`"
|
|
514
|
-
:item="currentItem"
|
|
515
|
-
:view-type="store.viewType"
|
|
516
|
-
:view-index="viewIndex"
|
|
517
|
-
:view-types="viewTypes"
|
|
518
|
-
ref="settingComponent"
|
|
519
|
-
@change="pageHistory.commit()"
|
|
520
|
-
@postMessageToIframe="onPostMessageToIframe"/>
|
|
521
|
-
|
|
522
|
-
<div class="p-6 py-4" v-if="debugMode">
|
|
523
|
-
<small class="text-text-400">Debug ID</small>
|
|
524
|
-
<Textbox v-model="currentItem.props.debugId" maxlength="5" />
|
|
525
|
-
</div>
|
|
526
|
-
|
|
527
|
-
<br />
|
|
528
|
-
<br />
|
|
529
|
-
<br />
|
|
530
|
-
|
|
531
|
-
</div>
|
|
532
|
-
|
|
533
|
-
<div v-else-if="extRightPane?.type" class="flex-1 flex flex-col divide-y divide-border-50 overflow-y-auto">
|
|
534
|
-
|
|
535
|
-
<div class="px-6 py-4 flex flex-row gap-5 items-center">
|
|
536
|
-
<div class="flex flex-col">
|
|
537
|
-
<small class="text-text-400"> </small>
|
|
538
|
-
<button type="button" @click="extRightPane = null">
|
|
539
|
-
<svg width="14" height="14" class="fill-text" 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="M447.1 256C447.1 273.7 433.7 288 416 288H109.3l105.4 105.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448s-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L109.3 224H416C433.7 224 447.1 238.3 447.1 256z"/></svg>
|
|
540
|
-
</button>
|
|
541
|
-
</div>
|
|
542
|
-
<div>
|
|
543
|
-
<small class="text-text-400">Enabled</small>
|
|
544
|
-
<Switch v-model="extRightPane.props.enabled"/>
|
|
545
|
-
</div>
|
|
546
|
-
<div v-if="extRightPane.type !== 'Style'" class="flex-1">
|
|
547
|
-
<small class="text-text-400">Name</small>
|
|
548
|
-
<Textbox v-model="currentItem.props.name"
|
|
549
|
-
:placeholder="extRightPane.type"
|
|
550
|
-
class="bg-base-500 flex-1"
|
|
551
|
-
variant="minimal" />
|
|
552
|
-
</div>
|
|
553
|
-
<div v-else class="px-3">
|
|
554
|
-
<h4>Style</h4>
|
|
555
|
-
</div>
|
|
556
|
-
</div>
|
|
557
|
-
|
|
558
|
-
<component :is="`${extRightPane.type}Setting`"
|
|
559
|
-
:item="extRightPane"
|
|
560
|
-
:view-type="store.viewType"
|
|
561
|
-
:view-index="viewIndex"
|
|
562
|
-
:view-types="viewTypes"
|
|
563
|
-
ref="settingComponent"
|
|
564
|
-
@change="pageHistory.commit()"
|
|
565
|
-
@postMessageToIframe="onPostMessageToIframe"/>
|
|
566
|
-
|
|
567
|
-
<br />
|
|
568
|
-
<br />
|
|
569
|
-
<br />
|
|
570
|
-
|
|
571
|
-
</div>
|
|
572
|
-
|
|
573
|
-
</TransitionGroup>
|
|
574
|
-
|
|
575
|
-
</div>
|
|
576
|
-
|
|
577
|
-
</div>
|
|
578
|
-
|
|
579
|
-
</div>
|
|
580
|
-
|
|
581
|
-
</div>
|
|
582
|
-
|
|
583
|
-
<div class="absolute">
|
|
584
|
-
<WebLayoutSelector ref="webLayoutSelector" @apply="createLayout"/>
|
|
585
|
-
|
|
586
|
-
<WebComponentSelector ref="webPageComponentSelector"
|
|
587
|
-
:component-src="`${this.controller}.load-templates`"
|
|
588
|
-
:components="availableComponents"
|
|
589
|
-
@apply="addComponent"
|
|
590
|
-
dismissable="true"
|
|
591
|
-
@dismiss="$refs.webPageComponentSelector.close()" />
|
|
592
|
-
|
|
593
|
-
<OGSettingModal ref="ogModal" />
|
|
594
|
-
|
|
595
|
-
<Modal ref="ldjsonModal" width="600" height="480">
|
|
596
|
-
<template v-slot:head>
|
|
597
|
-
<div class="relative p-5">
|
|
598
|
-
<h3>JSON-LD</h3>
|
|
599
|
-
<div class="absolute top-0 right-0 p-2">
|
|
600
|
-
<button type="button" class="p-2" @click="$refs.ldjsonModal.close()">
|
|
601
|
-
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
602
|
-
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
603
|
-
</svg>
|
|
604
|
-
</button>
|
|
605
|
-
</div>
|
|
606
|
-
</div>
|
|
607
|
-
</template>
|
|
608
|
-
<template #foot="{ context }">
|
|
609
|
-
<div class="p-5">
|
|
610
|
-
<Button type="button" class="w-[100px]"
|
|
611
|
-
@click="saveLdjson(context)">
|
|
612
|
-
Save
|
|
613
|
-
</Button>
|
|
614
|
-
</div>
|
|
615
|
-
</template>
|
|
616
|
-
<template #default="{ context }">
|
|
617
|
-
<div class="flex-1 p-5">
|
|
618
|
-
<Textarea v-model="context.code" rows="10" ></Textarea>
|
|
619
|
-
</div>
|
|
620
|
-
</template>
|
|
621
|
-
</Modal>
|
|
622
|
-
</div>
|
|
623
|
-
|
|
624
|
-
</div>
|
|
625
|
-
</template>
|
|
626
|
-
|
|
627
|
-
<script>
|
|
628
|
-
|
|
629
|
-
import throttle from "lodash/throttle";
|
|
630
|
-
import md5 from "md5";
|
|
631
|
-
import {createFormData, invokeAfterIdle} from "../utils/helpers.mjs";
|
|
632
|
-
import {ref} from 'vue'
|
|
633
|
-
import {useManualRefHistory} from "@vueuse/core";
|
|
634
|
-
import axios from "axios";
|
|
635
|
-
import {useRouter} from "vue-router";
|
|
636
|
-
import WebLayoutSelector from "./WebLayoutSelector.vue";
|
|
637
|
-
import WebComponentSelector from "./WebComponentSelector.vue";
|
|
638
|
-
import defaultConfig from "../configs/web-page-builder.js"
|
|
639
|
-
import OGSettingModal from "./OGSettingModal.vue";
|
|
640
|
-
|
|
641
|
-
const patchPageCache = {}
|
|
642
|
-
|
|
643
|
-
const fontFamilies = {
|
|
644
|
-
'"Anton", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');`,
|
|
645
|
-
'Dosis, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Dosis:wght@400;700&display=swap');`,
|
|
646
|
-
'Lato, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');`,
|
|
647
|
-
'Merriweather, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');`,
|
|
648
|
-
'Montserrat, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');`,
|
|
649
|
-
'"Noto Sans", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;800&display=swap');`,
|
|
650
|
-
'Oswald, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&display=swap');`,
|
|
651
|
-
'Oxygen, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&display=swap');`,
|
|
652
|
-
'Poppins, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap');`,
|
|
653
|
-
'Quantico, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Quantico:wght@400;700&display=swap"');`,
|
|
654
|
-
'Raleway, sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap');`,
|
|
655
|
-
'"Reddit Sans", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Reddit+Sans:wght@400;700&display=swap');`,
|
|
656
|
-
'"Roboto", sans-serif': `@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');`,
|
|
657
|
-
'"Roboto Slab", serif': `@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;800&display=swap');`,
|
|
658
|
-
'Volkhov, serif': `@import url('https://fonts.googleapis.com/css2?family=Volkhov:wght@400;700&display=swap');`,
|
|
659
|
-
'"Work Sans", serif': `@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;700&display=swap');`,
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
const defaultMedia = {
|
|
663
|
-
":root": {
|
|
664
|
-
"--spacing-1": [],
|
|
665
|
-
"--spacing-2": [],
|
|
666
|
-
"--spacing-3": [],
|
|
667
|
-
"--spacing-4": [],
|
|
668
|
-
"--spacing-5": [],
|
|
669
|
-
"--spacing-6": [],
|
|
670
|
-
"--spacing-7": [],
|
|
671
|
-
"--spacing-8": [],
|
|
672
|
-
"--spacing-9": [],
|
|
673
|
-
"--spacing-10": [],
|
|
674
|
-
"--spacing-11": [],
|
|
675
|
-
"--spacing-12": []
|
|
676
|
-
},
|
|
677
|
-
"*": {
|
|
678
|
-
"font-family": [ "Poppins, sans-serif" ]
|
|
679
|
-
},
|
|
680
|
-
"html, .html": {
|
|
681
|
-
"font-size": [],
|
|
682
|
-
"--base-300": [ "rgb(235, 235, 235)" ],
|
|
683
|
-
"--base-400": [ "rgb(245, 245, 245)" ],
|
|
684
|
-
"--base-500": [ "rgb(255, 255, 255)" ],
|
|
685
|
-
"--primary-100": [],
|
|
686
|
-
"--primary-200": [],
|
|
687
|
-
"--primary-300": [],
|
|
688
|
-
"--primary-400": [],
|
|
689
|
-
"--primary-500": [ "rgb(0, 0, 0)" ],
|
|
690
|
-
"--primary-600": [ "rgb(15, 15, 15)" ],
|
|
691
|
-
"--primary-700": [],
|
|
692
|
-
"--primary-800": [],
|
|
693
|
-
"--primary-900": [],
|
|
694
|
-
"--secondary-100": [],
|
|
695
|
-
"--secondary-200": [],
|
|
696
|
-
"--secondary-300": [],
|
|
697
|
-
"--secondary-400": [],
|
|
698
|
-
"--secondary-500": [],
|
|
699
|
-
"--secondary-600": [],
|
|
700
|
-
"--secondary-700": [],
|
|
701
|
-
"--secondary-800": [],
|
|
702
|
-
"--secondary-900": [],
|
|
703
|
-
"--text-100": [],
|
|
704
|
-
"--text-200": [],
|
|
705
|
-
"--text-300": [],
|
|
706
|
-
"--text-400": [],
|
|
707
|
-
"--text-500": [ "rgb(33, 33, 33)" ],
|
|
708
|
-
"--text-600": [],
|
|
709
|
-
"--text-700": [],
|
|
710
|
-
"--text-800": [],
|
|
711
|
-
"--text-900": []
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
function collectFontImports(styles) {
|
|
716
|
-
const usedFonts = new Set()
|
|
717
|
-
const media = styles?.media || {}
|
|
718
|
-
|
|
719
|
-
for (const selector in media) {
|
|
720
|
-
const rules = media[selector]
|
|
721
|
-
if (!rules || !rules['font-family']) continue
|
|
722
|
-
|
|
723
|
-
const values = rules['font-family']
|
|
724
|
-
if (!Array.isArray(values)) continue
|
|
725
|
-
|
|
726
|
-
for (const val of values) {
|
|
727
|
-
if (!val) continue
|
|
728
|
-
if (fontFamilies[val]) {
|
|
729
|
-
usedFonts.add(val)
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
return Array.from(usedFonts)
|
|
735
|
-
.map(font => fontFamilies[font])
|
|
736
|
-
.join('\n')
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
function indent(str, spaces = 2) {
|
|
740
|
-
const pad = ' '.repeat(spaces)
|
|
741
|
-
return str.split('\n').map(line => pad + line).join('\n')
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
export default{
|
|
745
|
-
|
|
746
|
-
components: {OGSettingModal, WebComponentSelector, WebLayoutSelector},
|
|
747
|
-
|
|
748
|
-
setup(){
|
|
749
|
-
const page = ref({})
|
|
750
|
-
const pageHistory = useManualRefHistory(page, { clone:true })
|
|
751
|
-
|
|
752
|
-
return {
|
|
753
|
-
page,
|
|
754
|
-
pageHistory
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
|
|
758
|
-
props: {
|
|
759
|
-
|
|
760
|
-
canManageLayout: {
|
|
761
|
-
type: Boolean,
|
|
762
|
-
default: false
|
|
763
|
-
},
|
|
764
|
-
|
|
765
|
-
controller: String,
|
|
766
|
-
|
|
767
|
-
excludeComponents: {
|
|
768
|
-
type: Array,
|
|
769
|
-
default: []
|
|
770
|
-
},
|
|
771
|
-
|
|
772
|
-
moreComponents: {
|
|
773
|
-
type: Array,
|
|
774
|
-
default: []
|
|
775
|
-
},
|
|
776
|
-
|
|
777
|
-
uploadConfig: {
|
|
778
|
-
type: Object
|
|
779
|
-
},
|
|
780
|
-
|
|
781
|
-
uploadImageFn: Function,
|
|
782
|
-
|
|
783
|
-
useDatasource: undefined,
|
|
784
|
-
|
|
785
|
-
useTemplateCreator: undefined,
|
|
786
|
-
|
|
787
|
-
presetKey: String
|
|
788
|
-
|
|
789
|
-
},
|
|
790
|
-
|
|
791
|
-
methods: {
|
|
792
|
-
|
|
793
|
-
addComponent({ component, items, isLayout }){
|
|
794
|
-
|
|
795
|
-
Object.assign(component.props, {
|
|
796
|
-
enabled: true
|
|
797
|
-
})
|
|
798
|
-
this.setUid(component)
|
|
799
|
-
|
|
800
|
-
items.push(component)
|
|
801
|
-
|
|
802
|
-
this.pageHistory.commit()
|
|
803
|
-
|
|
804
|
-
this.store.selectedComponent = [ component.uid ]
|
|
805
|
-
|
|
806
|
-
this.$refs.webPageComponentSelector.close()
|
|
807
|
-
},
|
|
808
|
-
|
|
809
|
-
addDatasource(datasource){
|
|
810
|
-
|
|
811
|
-
if(!Array.isArray(this.page.datasource)){
|
|
812
|
-
this.page.datasource = []
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
if('_index' in datasource){
|
|
816
|
-
this.page.datasource.splice(datasource._index, 1, datasource)
|
|
817
|
-
delete datasource._index
|
|
818
|
-
}
|
|
819
|
-
else{
|
|
820
|
-
this.page.datasource.push(datasource)
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
this.loadDatasource()
|
|
824
|
-
},
|
|
825
|
-
|
|
826
|
-
close(){
|
|
827
|
-
this.$emit('close')
|
|
828
|
-
},
|
|
829
|
-
|
|
830
|
-
createComponentInstance(component){
|
|
831
|
-
|
|
832
|
-
if(!component.uid) return
|
|
833
|
-
if(!component.props.enabled) return
|
|
834
|
-
|
|
835
|
-
const compUid = '_' + component.uid.substring(0, 4) + ' '
|
|
836
|
-
|
|
837
|
-
const instance = {
|
|
838
|
-
type: component.type,
|
|
839
|
-
uid: component.uid,
|
|
840
|
-
|
|
841
|
-
class: compUid + this.compClasses.map(key => {
|
|
842
|
-
return Array.isArray(component.props[key]) ? component.props[key].join(' ') : ''
|
|
843
|
-
})
|
|
844
|
-
.filter(_ => _)
|
|
845
|
-
.join(' '),
|
|
846
|
-
|
|
847
|
-
containerClass: this.containerClasses.map(key => {
|
|
848
|
-
return Array.isArray(component.props[key]) ? component.props[key].join(' ') : ''
|
|
849
|
-
})
|
|
850
|
-
.filter(_ => _)
|
|
851
|
-
.join(' '),
|
|
852
|
-
|
|
853
|
-
itemClass: this.itemClasses.map(key => {
|
|
854
|
-
return Array.isArray(component.props[key]) ? component.props[key].join(' ') : ''
|
|
855
|
-
})
|
|
856
|
-
.filter(_ => _)
|
|
857
|
-
.join(' '),
|
|
858
|
-
|
|
859
|
-
style: this.styleClasses.reduce((res, cur) => {
|
|
860
|
-
if(Array.isArray(component.props[cur]))
|
|
861
|
-
res[cur] = component.props[cur]
|
|
862
|
-
return res
|
|
863
|
-
}, {})
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
for(let key in component.props){
|
|
867
|
-
if(!this.compClasses.includes(key) &&
|
|
868
|
-
!this.containerClasses.includes(key) &&
|
|
869
|
-
!this.itemClasses.includes(key) &&
|
|
870
|
-
![ 'enabled' ].includes(key)){
|
|
871
|
-
instance[key] = component.props[key]
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
const whitelistProps = [ 'containerVariant' ]
|
|
876
|
-
whitelistProps.forEach((key) => {
|
|
877
|
-
if(component.props[key]){
|
|
878
|
-
instance[key] = component.props[key]
|
|
879
|
-
}
|
|
880
|
-
})
|
|
881
|
-
|
|
882
|
-
if(Array.isArray(component.items)){
|
|
883
|
-
instance.items = component.items.map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
if(Array.isArray(component.items2)){
|
|
887
|
-
instance.items2 = component.items2.map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
if(Array.isArray(component.items3)){
|
|
891
|
-
instance.items3 = component.items3.map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
if(component.props && Array.isArray(component.props.items)){
|
|
895
|
-
instance.items = component.props.items
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
if(component.slots){
|
|
899
|
-
const slots = {}
|
|
900
|
-
for(let key in component.slots){
|
|
901
|
-
slots[key] = component.slots[key].map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
902
|
-
}
|
|
903
|
-
instance.slots = slots
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
return instance
|
|
907
|
-
},
|
|
908
|
-
|
|
909
|
-
createLayout(layout){
|
|
910
|
-
this.useSocket().send(`${this.controller}.create-layout`, layout)
|
|
911
|
-
.then(layout => {
|
|
912
|
-
this.loadLayouts()
|
|
913
|
-
this.page.layoutId = layout.id
|
|
914
|
-
this.$refs.webLayoutSelector.close()
|
|
915
|
-
})
|
|
916
|
-
.catch(err => this.alert(err))
|
|
917
|
-
},
|
|
918
|
-
|
|
919
|
-
createStyleSheet(styles, breakpoints = {
|
|
920
|
-
md: '768px',
|
|
921
|
-
lg: '1024px',
|
|
922
|
-
xl: '1280px'
|
|
923
|
-
}){
|
|
924
|
-
const mediaBuckets = {
|
|
925
|
-
base: [],
|
|
926
|
-
md: [],
|
|
927
|
-
lg: [],
|
|
928
|
-
xl: []
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
const media = styles?.media || {}
|
|
932
|
-
|
|
933
|
-
for (const selector in media) {
|
|
934
|
-
const rules = media[selector]
|
|
935
|
-
if (!rules || Object.keys(rules).length === 0) continue
|
|
936
|
-
|
|
937
|
-
const ruleSets = {
|
|
938
|
-
base: [],
|
|
939
|
-
md: [],
|
|
940
|
-
lg: [],
|
|
941
|
-
xl: []
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
for (const prop in rules) {
|
|
945
|
-
const values = rules[prop]
|
|
946
|
-
if (!Array.isArray(values)) continue
|
|
947
|
-
|
|
948
|
-
if (values[0] !== undefined) ruleSets.base.push(`${prop}: ${values[0]};`)
|
|
949
|
-
if (values[1] !== undefined) ruleSets.md.push(`${prop}: ${values[1]};`)
|
|
950
|
-
if (values[2] !== undefined) ruleSets.lg.push(`${prop}: ${values[2]};`)
|
|
951
|
-
if (values[3] !== undefined) ruleSets.xl.push(`${prop}: ${values[3]};`)
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
for (const size in ruleSets) {
|
|
955
|
-
if (ruleSets[size].length === 0) continue
|
|
956
|
-
mediaBuckets[size].push(
|
|
957
|
-
`${selector} {\n ${ruleSets[size].join('\n ')}\n}`
|
|
958
|
-
)
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
let css = ''
|
|
963
|
-
|
|
964
|
-
const fontImports = collectFontImports(styles, fontFamilies)
|
|
965
|
-
if (fontImports) {
|
|
966
|
-
css += fontImports + '\n\n'
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
const mediaImports = styles?.imports || []
|
|
970
|
-
if (Array.isArray(mediaImports)) {
|
|
971
|
-
css += mediaImports.join('\n') + '\n\n'
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
if (mediaBuckets.base.length) {
|
|
975
|
-
css += mediaBuckets.base.join('\n\n') + '\n\n'
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
if (mediaBuckets.md.length) {
|
|
979
|
-
css += `@media (min-width: ${breakpoints.md}) {\n${indent(mediaBuckets.md.join('\n\n'))}\n}\n\n`
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
if (mediaBuckets.lg.length) {
|
|
983
|
-
css += `@media (min-width: ${breakpoints.lg}) {\n${indent(mediaBuckets.lg.join('\n\n'))}\n}\n\n`
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
if (mediaBuckets.xl.length) {
|
|
987
|
-
css += `@media (min-width: ${breakpoints.xl}) {\n${indent(mediaBuckets.xl.join('\n\n'))}\n}\n\n`
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
return css.trim()
|
|
991
|
-
},
|
|
992
|
-
|
|
993
|
-
createInstances(){
|
|
994
|
-
if(!this.page.instances || typeof this.page.instances !== 'object' || Array.isArray(this.page.instances))
|
|
995
|
-
this.page.instances = {}
|
|
996
|
-
this.page.instances.components = (this.page.components ?? []).map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
997
|
-
|
|
998
|
-
if(this.layout){
|
|
999
|
-
if(!this.layout.instances || typeof this.layout.instances !== 'object' || Array.isArray(this.layout.instances))
|
|
1000
|
-
this.layout.instances = {}
|
|
1001
|
-
this.layout.instances.headers = (this.layout.headers ?? []).map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
1002
|
-
this.layout.instances.footers = (this.layout.footers ?? []).map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
1003
|
-
|
|
1004
|
-
this.layout.instances.stylesheet = this.createStyleSheet(this.layout.styles)
|
|
1005
|
-
}
|
|
1006
|
-
},
|
|
1007
|
-
|
|
1008
|
-
duplicate(parent, item){
|
|
1009
|
-
const newItem = JSON.parse(JSON.stringify(item))
|
|
1010
|
-
this.setUid(newItem)
|
|
1011
|
-
parent.push(newItem)
|
|
1012
|
-
},
|
|
1013
|
-
|
|
1014
|
-
findCompByUid(uid, components){
|
|
1015
|
-
|
|
1016
|
-
for(let i in components){
|
|
1017
|
-
const comp = components[i]
|
|
1018
|
-
|
|
1019
|
-
if(comp.uid === uid){
|
|
1020
|
-
return comp
|
|
1021
|
-
}
|
|
1022
|
-
else if(comp.items){
|
|
1023
|
-
const c = this.findCompByUid(uid, comp.items)
|
|
1024
|
-
|
|
1025
|
-
if(c){
|
|
1026
|
-
return c
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
findItemByUid(uid, items){
|
|
1033
|
-
|
|
1034
|
-
if(!items){
|
|
1035
|
-
for(let type of [ 'headers', 'footers' ]){
|
|
1036
|
-
let item = this.findItemByUid(uid, (this.layout ?? {})[type] ?? [])
|
|
1037
|
-
if(item){
|
|
1038
|
-
return {
|
|
1039
|
-
...item,
|
|
1040
|
-
type
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
let item = this.findItemByUid(uid, (this.page ?? {}).components ?? [])
|
|
1046
|
-
if(item){
|
|
1047
|
-
return {
|
|
1048
|
-
...item,
|
|
1049
|
-
type: 'components'
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
else{
|
|
1054
|
-
|
|
1055
|
-
let item
|
|
1056
|
-
for(let _item of items){
|
|
1057
|
-
if(_item.uid === uid){
|
|
1058
|
-
return {
|
|
1059
|
-
item: _item,
|
|
1060
|
-
items
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
else if(_item.items){
|
|
1064
|
-
item = this.findItemByUid(uid, _item.items)
|
|
1065
|
-
if(item){
|
|
1066
|
-
return item
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
},
|
|
1072
|
-
|
|
1073
|
-
getPage(){
|
|
1074
|
-
return this.page
|
|
1075
|
-
},
|
|
1076
|
-
|
|
1077
|
-
imageSrc(imageUrl){
|
|
1078
|
-
return typeof imageUrl === 'string' ? import.meta.env.VITE_IMAGE_HOST + '/' + imageUrl : imageUrl
|
|
1079
|
-
},
|
|
1080
|
-
|
|
1081
|
-
imageUrl(obj){
|
|
1082
|
-
return obj ?
|
|
1083
|
-
(typeof obj.imageUrl === 'string' ? import.meta.env.VITE_IMAGE_HOST + '/' + obj.imageUrl : obj.imageUrl) :
|
|
1084
|
-
obj
|
|
1085
|
-
},
|
|
1086
|
-
|
|
1087
|
-
listen(){
|
|
1088
|
-
this.useSocket().send(`${this.controller}.subscribe`, { name:'page' })
|
|
1089
|
-
.then(() => {
|
|
1090
|
-
|
|
1091
|
-
})
|
|
1092
|
-
.catch((err) => this.toast(err))
|
|
1093
|
-
},
|
|
1094
|
-
|
|
1095
|
-
async load(){
|
|
1096
|
-
return this.useSocket().send(`${this.controller}.open`, { uid:this.$route.params.uid })
|
|
1097
|
-
.then(({ page, previewHost, debugMode, useChat }) => {
|
|
1098
|
-
|
|
1099
|
-
this.patchPage(page)
|
|
1100
|
-
|
|
1101
|
-
if(page) Object.assign(this.page, page)
|
|
1102
|
-
this.debugMode = debugMode ?? this.debugMode
|
|
1103
|
-
if(previewHost) this.previewHost = previewHost
|
|
1104
|
-
|
|
1105
|
-
this.useChat = useChat ?? this.useChat
|
|
1106
|
-
|
|
1107
|
-
this.prevData = {
|
|
1108
|
-
page: JSON.stringify(this.page),
|
|
1109
|
-
layout: JSON.stringify(this.layout)
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
this.pageHistory.commit()
|
|
1113
|
-
|
|
1114
|
-
this.$nextTick(() => {
|
|
1115
|
-
this.resize()
|
|
1116
|
-
|
|
1117
|
-
this.iframeSrc = this.previewHost + `?edit-mode=${this.store.previewMode}`
|
|
1118
|
-
})
|
|
1119
|
-
|
|
1120
|
-
this.readyState = 1
|
|
1121
|
-
})
|
|
1122
|
-
.catch((err) => {
|
|
1123
|
-
this.toast(err)
|
|
1124
|
-
this.readyState = -1
|
|
1125
|
-
console.error(err)
|
|
1126
|
-
})
|
|
1127
|
-
},
|
|
1128
|
-
|
|
1129
|
-
patchBgColors(bgColors){
|
|
1130
|
-
if (!Array.isArray(bgColors)) return
|
|
1131
|
-
|
|
1132
|
-
for(let i = 0 ; i < bgColors.length ; i++){
|
|
1133
|
-
let value = bgColors[i]
|
|
1134
|
-
if(`${bgColors[i]}`.startsWith('bg-')){
|
|
1135
|
-
if(patchPageCache[bgColors[i]]){
|
|
1136
|
-
value = patchPageCache[bgColors[i]]
|
|
1137
|
-
}
|
|
1138
|
-
else{
|
|
1139
|
-
const el = document.createElement('div')
|
|
1140
|
-
el.classList.add(bgColors[i])
|
|
1141
|
-
el.style.position = 'fixed'
|
|
1142
|
-
el.style.top = '-100000px'
|
|
1143
|
-
document.body.appendChild(el)
|
|
1144
|
-
|
|
1145
|
-
const rgbText = window.getComputedStyle(el)['background-color']
|
|
1146
|
-
|
|
1147
|
-
const rgb = rgbText.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*\d+)?\)/)
|
|
1148
|
-
if(rgb){
|
|
1149
|
-
value = `#${((1 << 24) + (parseInt(rgb[1]) << 16) +
|
|
1150
|
-
(parseInt(rgb[2]) << 8) +
|
|
1151
|
-
parseInt(rgb[3])).toString(16).slice(1)}`
|
|
1152
|
-
}
|
|
1153
|
-
document.body.removeChild(el)
|
|
1154
|
-
|
|
1155
|
-
patchPageCache[bgColors[i]] = value
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
bgColors[i] = value
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
},
|
|
1162
|
-
|
|
1163
|
-
patchBdColor(bdColor){
|
|
1164
|
-
if (!Array.isArray(bdColor)) return
|
|
1165
|
-
|
|
1166
|
-
for(let i = 0 ; i < bdColor.length ; i++){
|
|
1167
|
-
let value = bdColor[i]
|
|
1168
|
-
if(`${bdColor[i]}`.startsWith('border-')){
|
|
1169
|
-
if(patchPageCache[bdColor[i]]){
|
|
1170
|
-
value = patchPageCache[bdColor[i]]
|
|
1171
|
-
}
|
|
1172
|
-
else{
|
|
1173
|
-
const el = document.createElement('div')
|
|
1174
|
-
el.classList.add(bdColor[i])
|
|
1175
|
-
el.style.position = 'fixed'
|
|
1176
|
-
el.style.borderStyle = "solid"
|
|
1177
|
-
el.style.borderWidth = "5px"
|
|
1178
|
-
el.style.width = '100px'
|
|
1179
|
-
el.style.height = '100px'
|
|
1180
|
-
el.style.top = '10px'
|
|
1181
|
-
el.style.left = '10px'
|
|
1182
|
-
document.body.appendChild(el)
|
|
1183
|
-
|
|
1184
|
-
const rgbText = window.getComputedStyle(el)['border-color']
|
|
1185
|
-
const rgb = rgbText.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*\d+)?\)/)
|
|
1186
|
-
if(rgb){
|
|
1187
|
-
value = `#${((1 << 24) + (parseInt(rgb[1]) << 16) +
|
|
1188
|
-
(parseInt(rgb[2]) << 8) +
|
|
1189
|
-
parseInt(rgb[3])).toString(16).slice(1)}`
|
|
1190
|
-
}
|
|
1191
|
-
document.body.removeChild(el)
|
|
1192
|
-
|
|
1193
|
-
patchPageCache[bdColor[i]] = value
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
bdColor[i] = value
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
},
|
|
1200
|
-
|
|
1201
|
-
patchPage(page){
|
|
1202
|
-
|
|
1203
|
-
const recursePatch = (components) => {
|
|
1204
|
-
for(let component of components){
|
|
1205
|
-
this.patchBgColors(component.props.bgColors)
|
|
1206
|
-
this.patchBdColor(component.props.bdColor)
|
|
1207
|
-
|
|
1208
|
-
if(Array.isArray(component.items)){
|
|
1209
|
-
recursePatch(component.items)
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
recursePatch(page.components)
|
|
1215
|
-
},
|
|
1216
|
-
|
|
1217
|
-
async loadLayouts(){
|
|
1218
|
-
this.useSocket().send(`${this.controller}.load-layouts`, {})
|
|
1219
|
-
.then(_ => {
|
|
1220
|
-
this.layouts = _
|
|
1221
|
-
})
|
|
1222
|
-
},
|
|
1223
|
-
|
|
1224
|
-
loadDatasource(){
|
|
1225
|
-
if(this.useDatasource && this.useDatasource[1]){
|
|
1226
|
-
this.useSocket().send(this.useDatasource[1], this.page.datasource)
|
|
1227
|
-
.then((data) => {
|
|
1228
|
-
Object.assign(this.page, { data })
|
|
1229
|
-
this.updateIframe()
|
|
1230
|
-
})
|
|
1231
|
-
}
|
|
1232
|
-
},
|
|
1233
|
-
|
|
1234
|
-
loadPreset(){
|
|
1235
|
-
if(!Object.keys(this.$route.query).map(_ => _.toLowerCase()).includes('reset')){
|
|
1236
|
-
if(this.presetKey){
|
|
1237
|
-
return this.useSocket().send(this.presetSrc, { key:this.presetKey })
|
|
1238
|
-
.then(config => {
|
|
1239
|
-
if(config){
|
|
1240
|
-
Object.assign(this.config.params, config.params)
|
|
1241
|
-
|
|
1242
|
-
if(this.$route.query?.search)
|
|
1243
|
-
this.preset.search = this.$route.query.search
|
|
1244
|
-
}
|
|
1245
|
-
})
|
|
1246
|
-
}
|
|
1247
|
-
return new Promise(resolve => resolve())
|
|
1248
|
-
}
|
|
1249
|
-
else{
|
|
1250
|
-
return new Promise((resolve) => {
|
|
1251
|
-
const query = {}
|
|
1252
|
-
for(let key in this.$route.query){
|
|
1253
|
-
if(key.toLowerCase() !== 'reset')
|
|
1254
|
-
query[key] = this.$route.query[key]
|
|
1255
|
-
}
|
|
1256
|
-
this.$router.replace({
|
|
1257
|
-
...this.$route,
|
|
1258
|
-
query
|
|
1259
|
-
})
|
|
1260
|
-
|
|
1261
|
-
resolve()
|
|
1262
|
-
})
|
|
1263
|
-
}
|
|
1264
|
-
},
|
|
1265
|
-
|
|
1266
|
-
openComponentSelector(params, callback){
|
|
1267
|
-
this.$refs.webPageComponentSelector.open(params, callback)
|
|
1268
|
-
},
|
|
1269
|
-
|
|
1270
|
-
onHooks(model, event, items){
|
|
1271
|
-
/*if(model === 'page' && event === 'update'){
|
|
1272
|
-
items.forEach((item) => {
|
|
1273
|
-
if(item.id === this.page.id){
|
|
1274
|
-
Object.assign(this.page, item)
|
|
1275
|
-
//this.reloadIframe()
|
|
1276
|
-
}
|
|
1277
|
-
})
|
|
1278
|
-
}*/
|
|
1279
|
-
},
|
|
1280
|
-
|
|
1281
|
-
onKeyDown(e){
|
|
1282
|
-
|
|
1283
|
-
if(e.altKey){
|
|
1284
|
-
if([ 49, 50, 51, 52 ].includes(e.keyCode)){
|
|
1285
|
-
if(e.keyCode === 49){
|
|
1286
|
-
this.store.viewType = ''
|
|
1287
|
-
}
|
|
1288
|
-
else if(e.keyCode === 50){
|
|
1289
|
-
this.store.viewType = 'md:'
|
|
1290
|
-
}
|
|
1291
|
-
else if(e.keyCode === 51){
|
|
1292
|
-
this.store.viewType = 'xl:'
|
|
1293
|
-
}
|
|
1294
|
-
else if(e.keyCode === 52){
|
|
1295
|
-
this.store.viewType = '2xl:'
|
|
1296
|
-
}
|
|
1297
|
-
this.resize()
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1303
|
-
onMessage(event){
|
|
1304
|
-
|
|
1305
|
-
const { uid, type, value } = event.data ?? {}
|
|
1306
|
-
|
|
1307
|
-
switch(type){
|
|
1308
|
-
|
|
1309
|
-
case 'setProp':
|
|
1310
|
-
let comp
|
|
1311
|
-
let compType
|
|
1312
|
-
if(uid){
|
|
1313
|
-
comp = this.findCompByUid(uid, this.page.components)
|
|
1314
|
-
if(!comp){
|
|
1315
|
-
comp = this.findCompByUid(uid, this.layout.headers)
|
|
1316
|
-
if(!comp){
|
|
1317
|
-
comp = this.findCompByUid(uid, this.layout.footers)
|
|
1318
|
-
if(comp){
|
|
1319
|
-
compType = 'footers'
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
else{
|
|
1323
|
-
compType = 'headers'
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
else{
|
|
1327
|
-
compType = 'components'
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
if(comp){
|
|
1332
|
-
this.updating = false
|
|
1333
|
-
Object.assign(comp.props, value)
|
|
1334
|
-
}
|
|
1335
|
-
break
|
|
1336
|
-
|
|
1337
|
-
case 'setSubAction':
|
|
1338
|
-
if(this.$refs.settingComponent && this.$refs.settingComponent.setSubAction)
|
|
1339
|
-
this.$refs.settingComponent.setSubAction(value)
|
|
1340
|
-
break
|
|
1341
|
-
|
|
1342
|
-
case 'component-click':
|
|
1343
|
-
let component = this.findCompByUid(uid, this.page.components)
|
|
1344
|
-
if(component){
|
|
1345
|
-
this.store.tabIndex = 2
|
|
1346
|
-
this.store.selectedComponent = [ uid ]
|
|
1347
|
-
return
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
component = this.findCompByUid(uid, this.layout.headers)
|
|
1351
|
-
if(!component)
|
|
1352
|
-
component = this.findCompByUid(uid, this.layout.footers)
|
|
1353
|
-
if(component){
|
|
1354
|
-
this.store.tabIndex = 4
|
|
1355
|
-
this.store.selectedComponent = [ uid ]
|
|
1356
|
-
return
|
|
1357
|
-
}
|
|
1358
|
-
break
|
|
1359
|
-
|
|
1360
|
-
case 'mounted':
|
|
1361
|
-
this.updateIframe()
|
|
1362
|
-
break
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
|
|
1366
|
-
onPostMessageToIframe(uid, data){
|
|
1367
|
-
this.$refs.iframe.contentWindow.postMessage({ uid, data }, '*')
|
|
1368
|
-
},
|
|
1369
|
-
|
|
1370
|
-
onResize: throttle(function() {
|
|
1371
|
-
this.resize()
|
|
1372
|
-
}, 500, { leading:true }),
|
|
1373
|
-
|
|
1374
|
-
onUnload(e){
|
|
1375
|
-
if(this.canSave){
|
|
1376
|
-
e.preventDefault();
|
|
1377
|
-
e.returnValue = true;
|
|
1378
|
-
}
|
|
1379
|
-
},
|
|
1380
|
-
|
|
1381
|
-
openRightPane2(component){
|
|
1382
|
-
this.extRightPane = component
|
|
1383
|
-
},
|
|
1384
|
-
|
|
1385
|
-
postIframe(data){
|
|
1386
|
-
return new Promise((resolve, reject) => {
|
|
1387
|
-
const handleResponse = (e) => {
|
|
1388
|
-
window.removeEventListener('message', handleResponse)
|
|
1389
|
-
resolve(e.data)
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
|
-
window.addEventListener('message', handleResponse)
|
|
1393
|
-
|
|
1394
|
-
this.$refs.iframe.contentWindow.postMessage(data, '*')
|
|
1395
|
-
})
|
|
1396
|
-
},
|
|
1397
|
-
|
|
1398
|
-
reloadIframe(){
|
|
1399
|
-
if(this.$refs.iframe && this.$refs.iframe.contentWindow){
|
|
1400
|
-
this.$refs.iframe.contentWindow.postMessage({
|
|
1401
|
-
action: 'reload'
|
|
1402
|
-
}, '*')
|
|
1403
|
-
}
|
|
1404
|
-
},
|
|
1405
|
-
|
|
1406
|
-
remove(item){
|
|
1407
|
-
this.confirm(this.$t('Remove this item?'), {
|
|
1408
|
-
onConfirm: () => {
|
|
1409
|
-
const { items, type } = this.findItemByUid(item.uid)
|
|
1410
|
-
items.splice(items.indexOf(item), 1)
|
|
1411
|
-
this.store.selectedComponent = null
|
|
1412
|
-
}
|
|
1413
|
-
})
|
|
1414
|
-
},
|
|
1415
|
-
|
|
1416
|
-
removeDatasource(index){
|
|
1417
|
-
this.confirm({
|
|
1418
|
-
title:this.$t('Remove this item?'),
|
|
1419
|
-
onConfirm: () => {
|
|
1420
|
-
this.page.datasource.splice(index, 1)
|
|
1421
|
-
this.loadDatasource()
|
|
1422
|
-
}
|
|
1423
|
-
})
|
|
1424
|
-
},
|
|
1425
|
-
|
|
1426
|
-
resize(){
|
|
1427
|
-
|
|
1428
|
-
const transformOrigin = this.store.viewType === '' ? 'center top' : '0 0'
|
|
1429
|
-
|
|
1430
|
-
switch(this.store.zoomLevel){
|
|
1431
|
-
|
|
1432
|
-
case 'fit':
|
|
1433
|
-
if(this.$refs.preview){
|
|
1434
|
-
const previewWidth = this.$refs.preview.clientWidth - 50
|
|
1435
|
-
const previewHeight = this.$refs.preview.clientHeight - 70
|
|
1436
|
-
|
|
1437
|
-
let scale = 1
|
|
1438
|
-
switch(this.store.viewType){
|
|
1439
|
-
|
|
1440
|
-
case 'md:':
|
|
1441
|
-
scale = (previewWidth / 1024).toFixed(2)
|
|
1442
|
-
break
|
|
1443
|
-
|
|
1444
|
-
case 'xl:':
|
|
1445
|
-
scale = (previewWidth / 1365).toFixed(2)
|
|
1446
|
-
break
|
|
1447
|
-
|
|
1448
|
-
case '2xl:':
|
|
1449
|
-
scale = (previewWidth / 1920).toFixed(2)
|
|
1450
|
-
break
|
|
1451
|
-
|
|
1452
|
-
default:
|
|
1453
|
-
scale = (previewHeight / 844).toFixed(2)
|
|
1454
|
-
break
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
this.iframeStyle = {
|
|
1458
|
-
'transform': `scale(${scale})`,
|
|
1459
|
-
'-webkit-transform': `scale(${scale})`,
|
|
1460
|
-
'-moz-transform': `scale(${scale})`,
|
|
1461
|
-
'transform-origin': transformOrigin,
|
|
1462
|
-
'-webkit-transform-origin': transformOrigin,
|
|
1463
|
-
'-moz-transform-origin': transformOrigin
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
break
|
|
1467
|
-
|
|
1468
|
-
case '125%':
|
|
1469
|
-
this.iframeStyle = {
|
|
1470
|
-
'transform': 'scale(1.25)',
|
|
1471
|
-
'-webkit-transform': 'scale(1.25)',
|
|
1472
|
-
'-moz-transform': 'scale(1.25)',
|
|
1473
|
-
'transform-origin': transformOrigin,
|
|
1474
|
-
'-webkit-transform-origin': transformOrigin,
|
|
1475
|
-
'-moz-transform-origin': transformOrigin
|
|
1476
|
-
}
|
|
1477
|
-
break
|
|
1478
|
-
|
|
1479
|
-
case '100%':
|
|
1480
|
-
this.iframeStyle = {
|
|
1481
|
-
'transform': 'scale(1)',
|
|
1482
|
-
'-webkit-transform': 'scale(1)',
|
|
1483
|
-
'-moz-transform': 'scale(1)',
|
|
1484
|
-
'transform-origin': transformOrigin,
|
|
1485
|
-
'-webkit-transform-origin': transformOrigin,
|
|
1486
|
-
'-moz-transform-origin': transformOrigin
|
|
1487
|
-
}
|
|
1488
|
-
break
|
|
1489
|
-
|
|
1490
|
-
case '75%':
|
|
1491
|
-
this.iframeStyle = {
|
|
1492
|
-
'transform': 'scale(.75)',
|
|
1493
|
-
'-webkit-transform': 'scale(.75)',
|
|
1494
|
-
'-moz-transform': 'scale(.75)',
|
|
1495
|
-
'transform-origin': transformOrigin,
|
|
1496
|
-
'-webkit-transform-origin': transformOrigin,
|
|
1497
|
-
'-moz-transform-origin': transformOrigin
|
|
1498
|
-
}
|
|
1499
|
-
break
|
|
1500
|
-
|
|
1501
|
-
case '50%':
|
|
1502
|
-
this.iframeStyle = {
|
|
1503
|
-
'transform': 'scale(.5)',
|
|
1504
|
-
'-webkit-transform': 'scale(.5)',
|
|
1505
|
-
'-moz-transform': 'scale(.5)',
|
|
1506
|
-
'transform-origin': transformOrigin,
|
|
1507
|
-
'-webkit-transform-origin': transformOrigin,
|
|
1508
|
-
'-moz-transform-origin': transformOrigin
|
|
1509
|
-
}
|
|
1510
|
-
break
|
|
1511
|
-
|
|
1512
|
-
}
|
|
1513
|
-
},
|
|
1514
|
-
|
|
1515
|
-
resize1(w){
|
|
1516
|
-
if(this.store.width[0] + w >= 270){
|
|
1517
|
-
this.store.width[0] += w
|
|
1518
|
-
}
|
|
1519
|
-
},
|
|
1520
|
-
|
|
1521
|
-
resize3(w){
|
|
1522
|
-
if(this.store.width[1] - w >= 270 && this.store.width[1] - w <= 480){
|
|
1523
|
-
this.store.width[1] -= w
|
|
1524
|
-
}
|
|
1525
|
-
},
|
|
1526
|
-
|
|
1527
|
-
save(){
|
|
1528
|
-
this.createInstances()
|
|
1529
|
-
|
|
1530
|
-
this.$refs.saveBtn.setState(2)
|
|
1531
|
-
this.useSocket().send(`${this.controller}.save`, { ...this.page, layout:this.layout })
|
|
1532
|
-
.then((_) => {
|
|
1533
|
-
this.prevData = {
|
|
1534
|
-
page: JSON.stringify(this.page),
|
|
1535
|
-
layout: JSON.stringify(this.layout)
|
|
1536
|
-
}
|
|
1537
|
-
})
|
|
1538
|
-
.catch((err) => {
|
|
1539
|
-
console.log('ERR', err)
|
|
1540
|
-
this.toast(err)
|
|
1541
|
-
})
|
|
1542
|
-
.finally(_ => this.$refs.saveBtn.resetState())
|
|
1543
|
-
},
|
|
1544
|
-
|
|
1545
|
-
saveLdjson(context){
|
|
1546
|
-
/*const errors = this.$refs.monacoEditor.getErrors()
|
|
1547
|
-
if(errors){
|
|
1548
|
-
this.alert('JSON is not valid', errors.map(_ => _.message).join("\n"))
|
|
1549
|
-
return
|
|
1550
|
-
}*/
|
|
1551
|
-
|
|
1552
|
-
if(!Array.isArray(this.page.ldjson))
|
|
1553
|
-
this.page.ldjson = []
|
|
1554
|
-
|
|
1555
|
-
'index' in context ?
|
|
1556
|
-
this.page.ldjson[context.index] = context.code :
|
|
1557
|
-
this.page.ldjson.push(context.code);
|
|
1558
|
-
this.$refs.ldjsonModal.close()
|
|
1559
|
-
},
|
|
1560
|
-
|
|
1561
|
-
savePreset: invokeAfterIdle(function() {
|
|
1562
|
-
if(this.presetKey) {
|
|
1563
|
-
this.useSocket().send(this.presetSrc,
|
|
1564
|
-
{key: this.presetKey, config: this.config})
|
|
1565
|
-
}
|
|
1566
|
-
}),
|
|
1567
|
-
|
|
1568
|
-
select(uid){
|
|
1569
|
-
this.store.selectedComponent = [ uid ]
|
|
1570
|
-
this.extRightPane = null
|
|
1571
|
-
|
|
1572
|
-
this.$refs.iframe.contentWindow.postMessage({
|
|
1573
|
-
action: 'select',
|
|
1574
|
-
uid
|
|
1575
|
-
}, '*')
|
|
1576
|
-
},
|
|
1577
|
-
|
|
1578
|
-
setUid(item){
|
|
1579
|
-
item.uid = md5(Math.random())
|
|
1580
|
-
|
|
1581
|
-
if(Array.isArray(item.items)){
|
|
1582
|
-
for(let subItem of item.items){
|
|
1583
|
-
this.setUid(subItem)
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
},
|
|
1587
|
-
|
|
1588
|
-
stopListen(){
|
|
1589
|
-
this.useSocket().send(`${this.controller}.unsubscribe`, { name:'page' })
|
|
1590
|
-
.catch((err) => this.toast(err))
|
|
1591
|
-
},
|
|
1592
|
-
|
|
1593
|
-
updateIframe(){
|
|
1594
|
-
if(!this.updating){
|
|
1595
|
-
this.updating = true
|
|
1596
|
-
return
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
if(this.$refs.iframe){
|
|
1600
|
-
|
|
1601
|
-
const headers = this.layout && Array.isArray(this.layout.headers) ?
|
|
1602
|
-
this.layout.headers.map((_) => this.createComponentInstance(_)).filter(_=>_) :
|
|
1603
|
-
null
|
|
1604
|
-
|
|
1605
|
-
const footers = this.layout && Array.isArray(this.layout.footers) ?
|
|
1606
|
-
this.layout.footers.map((_) => this.createComponentInstance(_)).filter(_=>_) :
|
|
1607
|
-
null
|
|
1608
|
-
|
|
1609
|
-
const components = (this.page.components ?? []).map((_) => this.createComponentInstance(_)).filter(_=>_)
|
|
1610
|
-
|
|
1611
|
-
const stylesheet = this.layout ? this.createStyleSheet(this.layout.styles) : ''
|
|
1612
|
-
|
|
1613
|
-
this.$refs.iframe.contentWindow.postMessage({
|
|
1614
|
-
action:'update',
|
|
1615
|
-
page: JSON.stringify({
|
|
1616
|
-
headers,
|
|
1617
|
-
footers,
|
|
1618
|
-
components,
|
|
1619
|
-
stylesheet,
|
|
1620
|
-
data: this.page.data,
|
|
1621
|
-
editMode: this.store.previewMode
|
|
1622
|
-
})
|
|
1623
|
-
}, '*')
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1626
|
-
|
|
1627
|
-
async uploadImage(image, extra = {}, opt = {}){
|
|
1628
|
-
|
|
1629
|
-
if(typeof this.uploadImageFn === 'function'){
|
|
1630
|
-
return this.uploadImageFn(image, extra, opt)
|
|
1631
|
-
}
|
|
1632
|
-
else if(this.uploadConfig?.method){
|
|
1633
|
-
return axios({
|
|
1634
|
-
method: this.uploadConfig.method,
|
|
1635
|
-
url: this.uploadConfig.url,
|
|
1636
|
-
data: createFormData({ image, ...extra, ...(this.uploadConfig.data ?? {}) }),
|
|
1637
|
-
onUploadProgress: function (progressEvent) {
|
|
1638
|
-
if(opt.onUploadProgress)
|
|
1639
|
-
opt.onUploadProgress(progressEvent)
|
|
1640
|
-
},
|
|
1641
|
-
})
|
|
1642
|
-
.then((res) => {
|
|
1643
|
-
return res.data
|
|
1644
|
-
})
|
|
1645
|
-
.catch((err) => {
|
|
1646
|
-
this.$refs.image.value = ''
|
|
1647
|
-
this.$refs.imageModal.close()
|
|
1648
|
-
this.toast(err)
|
|
1649
|
-
})
|
|
1650
|
-
}
|
|
1651
|
-
else{
|
|
1652
|
-
throw 'Unable to upload image'
|
|
1653
|
-
}
|
|
1654
|
-
},
|
|
1655
|
-
|
|
1656
|
-
chatApply(){
|
|
1657
|
-
|
|
1658
|
-
this.$refs.chatBtn.setState(2)
|
|
1659
|
-
return this.useSocket()
|
|
1660
|
-
.send(`${this.controller}.chat`, {
|
|
1661
|
-
key: this.chat.key,
|
|
1662
|
-
prompt: this.chat.input,
|
|
1663
|
-
attachments: this.chat.attachments,
|
|
1664
|
-
pageId: this.page.id,
|
|
1665
|
-
input: {
|
|
1666
|
-
components: this.page.components,
|
|
1667
|
-
styles: this.layout?.styles ?? {}
|
|
1668
|
-
}
|
|
1669
|
-
})
|
|
1670
|
-
.catch(err => this.alert(err))
|
|
1671
|
-
.then(res => {
|
|
1672
|
-
for(let message of res.messages){
|
|
1673
|
-
try{
|
|
1674
|
-
for(let attachment of (message.attachments ?? [])){
|
|
1675
|
-
if(attachment.type === 'page'){
|
|
1676
|
-
this.chatSet(attachment)
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
if(message.model) this.chat.model = message.model
|
|
1681
|
-
|
|
1682
|
-
this.chat.messages.push(message)
|
|
1683
|
-
}
|
|
1684
|
-
catch(e){
|
|
1685
|
-
console.error(e)
|
|
1686
|
-
}
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
this.chat.input = ''
|
|
1690
|
-
this.chat.attachments = []
|
|
1691
|
-
})
|
|
1692
|
-
.finally(_ => this.$refs.chatBtn?.resetState())
|
|
1693
|
-
},
|
|
1694
|
-
|
|
1695
|
-
onChatUpload(e){
|
|
1696
|
-
for(let file of e.target.files){
|
|
1697
|
-
this.chat.attachments.push({
|
|
1698
|
-
type: "image",
|
|
1699
|
-
image: file
|
|
1700
|
-
})
|
|
1701
|
-
}
|
|
1702
|
-
},
|
|
1703
|
-
|
|
1704
|
-
chatSet(obj){
|
|
1705
|
-
|
|
1706
|
-
if(obj?.styles?.media && this.layout){
|
|
1707
|
-
Object.assign(this.layout, {
|
|
1708
|
-
styles: {
|
|
1709
|
-
media: this.createMedia(obj.styles.media),
|
|
1710
|
-
imports: obj.styles.imports
|
|
1711
|
-
}
|
|
1712
|
-
})
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
if((obj?.components ?? []).length > 0){
|
|
1716
|
-
Object.assign(this.page, {
|
|
1717
|
-
components: obj.components
|
|
1718
|
-
})
|
|
1719
|
-
}
|
|
1720
|
-
},
|
|
1721
|
-
|
|
1722
|
-
createMedia(obj){
|
|
1723
|
-
|
|
1724
|
-
const newMedia = JSON.parse(JSON.stringify(defaultMedia))
|
|
1725
|
-
|
|
1726
|
-
for(let selector in obj){
|
|
1727
|
-
if(!newMedia[selector]){
|
|
1728
|
-
newMedia[selector] = {}
|
|
1729
|
-
}
|
|
1730
|
-
for(let prop in obj[selector]){
|
|
1731
|
-
newMedia[selector][prop] = obj[selector][prop]
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
return newMedia
|
|
1736
|
-
},
|
|
1737
|
-
|
|
1738
|
-
newChat(){
|
|
1739
|
-
this.config.params.chat = {
|
|
1740
|
-
key: md5('web-page-chat-' + new Date().getTime()),
|
|
1741
|
-
input: '',
|
|
1742
|
-
attachments: [],
|
|
1743
|
-
messages: []
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
},
|
|
1748
|
-
|
|
1749
|
-
computed: {
|
|
1750
|
-
|
|
1751
|
-
componentStore(){
|
|
1752
|
-
if(!this.store.components)
|
|
1753
|
-
this.store.components = {}
|
|
1754
|
-
|
|
1755
|
-
if(!this.store.components.compsetting)
|
|
1756
|
-
this.store.components.compsetting = {}
|
|
1757
|
-
|
|
1758
|
-
return this.store.components.compsetting
|
|
1759
|
-
},
|
|
1760
|
-
|
|
1761
|
-
expanded(){
|
|
1762
|
-
if(!this.componentStore['expanded'])
|
|
1763
|
-
this.componentStore['expanded'] = {}
|
|
1764
|
-
return this.componentStore['expanded']
|
|
1765
|
-
},
|
|
1766
|
-
|
|
1767
|
-
availableComponents(){
|
|
1768
|
-
|
|
1769
|
-
return [
|
|
1770
|
-
...this.components,
|
|
1771
|
-
...this.moreComponents
|
|
1772
|
-
]
|
|
1773
|
-
.filter((_) => !this.excludeComponents.includes(_.type))
|
|
1774
|
-
.sort((a, b) => a.type > b.type ? 1 : -1)
|
|
1775
|
-
},
|
|
1776
|
-
|
|
1777
|
-
canSave(){
|
|
1778
|
-
return this.prevData &&
|
|
1779
|
-
(this.prevData.page !== JSON.stringify(this.page) ||
|
|
1780
|
-
this.prevData.layout !== JSON.stringify(this.layout))
|
|
1781
|
-
},
|
|
1782
|
-
|
|
1783
|
-
computedIframeSrc(){
|
|
1784
|
-
return this.page.app.hosts[0].name + this.page.path
|
|
1785
|
-
},
|
|
1786
|
-
|
|
1787
|
-
currentItem(){
|
|
1788
|
-
let comp
|
|
1789
|
-
if(this.page && Array.isArray(this.store.selectedComponent)){
|
|
1790
|
-
|
|
1791
|
-
switch(this.store.selectedComponent[0]){
|
|
1792
|
-
|
|
1793
|
-
case 'style':
|
|
1794
|
-
if(this.layout){
|
|
1795
|
-
comp = {
|
|
1796
|
-
type: 'Style',
|
|
1797
|
-
props: this.layout.styles ?? {}
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
this.store.selectedComponent[1] = 'style'
|
|
1801
|
-
}
|
|
1802
|
-
break
|
|
1803
|
-
|
|
1804
|
-
default:
|
|
1805
|
-
comp = this.findCompByUid(this.store.selectedComponent[0], this.layout ? this.layout.headers : [])
|
|
1806
|
-
if(!comp){
|
|
1807
|
-
comp = this.findCompByUid(this.store.selectedComponent[0], this.page.components)
|
|
1808
|
-
if(!comp){
|
|
1809
|
-
comp = this.findCompByUid(this.store.selectedComponent[0], this.layout ? this.layout.footers : [])
|
|
1810
|
-
if(comp){
|
|
1811
|
-
this.store.selectedComponent[1] = 'footers'
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
else{
|
|
1815
|
-
this.store.selectedComponent[1] = 'components'
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
else{
|
|
1819
|
-
this.store.selectedComponent[1] = 'headers'
|
|
1820
|
-
}
|
|
1821
|
-
break
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
return comp
|
|
1825
|
-
},
|
|
1826
|
-
|
|
1827
|
-
iframeSize(){
|
|
1828
|
-
|
|
1829
|
-
let width, height
|
|
1830
|
-
switch(this.store.viewType){
|
|
1831
|
-
case '':
|
|
1832
|
-
width = 390
|
|
1833
|
-
height = 844
|
|
1834
|
-
break
|
|
1835
|
-
|
|
1836
|
-
case 'md:':
|
|
1837
|
-
width = 1024
|
|
1838
|
-
height = 768
|
|
1839
|
-
break
|
|
1840
|
-
|
|
1841
|
-
case 'xl:':
|
|
1842
|
-
width = 1365
|
|
1843
|
-
height = 768
|
|
1844
|
-
break
|
|
1845
|
-
|
|
1846
|
-
case '2xl:':
|
|
1847
|
-
width = 1920
|
|
1848
|
-
height = 1080
|
|
1849
|
-
break
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
return {
|
|
1853
|
-
width,
|
|
1854
|
-
height
|
|
1855
|
-
}
|
|
1856
|
-
},
|
|
1857
|
-
|
|
1858
|
-
layout(){
|
|
1859
|
-
if(this.page){
|
|
1860
|
-
return (this.layouts ?? []).find((_) => _.id === parseInt(this.page.layoutId))
|
|
1861
|
-
}
|
|
1862
|
-
},
|
|
1863
|
-
|
|
1864
|
-
previewClass(){
|
|
1865
|
-
return {
|
|
1866
|
-
'overflow-auto': this.store.zoomLevel !== 'fit',
|
|
1867
|
-
'overflow-hidden': this.store.zoomLevel === 'fit',
|
|
1868
|
-
}
|
|
1869
|
-
},
|
|
1870
|
-
|
|
1871
|
-
section1Style(){
|
|
1872
|
-
return {
|
|
1873
|
-
width: this.store.width[0] + 'px'
|
|
1874
|
-
}
|
|
1875
|
-
},
|
|
1876
|
-
|
|
1877
|
-
section3Style(){
|
|
1878
|
-
return {
|
|
1879
|
-
width: this.store.width[1] + 'px'
|
|
1880
|
-
}
|
|
1881
|
-
},
|
|
1882
|
-
|
|
1883
|
-
store(){
|
|
1884
|
-
return this.config.params
|
|
1885
|
-
},
|
|
1886
|
-
|
|
1887
|
-
tabItems(){
|
|
1888
|
-
return [
|
|
1889
|
-
{ text:"Page Info", value:1 },
|
|
1890
|
-
{ text:"Layout", value:4 },
|
|
1891
|
-
{ text:"Components", value:2 },
|
|
1892
|
-
this.useChat ? { text:"Chat", value:7 } : null,
|
|
1893
|
-
/*{ text:"Datasource", value:3 },*/
|
|
1894
|
-
]
|
|
1895
|
-
.filter(_ => _)
|
|
1896
|
-
},
|
|
1897
|
-
|
|
1898
|
-
presetSrc(){
|
|
1899
|
-
return this.controller ?
|
|
1900
|
-
`${this.controller}.preset` :
|
|
1901
|
-
'user.preset'
|
|
1902
|
-
},
|
|
1903
|
-
|
|
1904
|
-
viewIndex(){
|
|
1905
|
-
return this.viewTypes.findIndex(_ => _.value === this.store.viewType)
|
|
1906
|
-
},
|
|
1907
|
-
|
|
1908
|
-
chat(){
|
|
1909
|
-
if(!this.config.params.chat)
|
|
1910
|
-
this.newChat()
|
|
1911
|
-
return this.config.params.chat
|
|
1912
|
-
},
|
|
1913
|
-
|
|
1914
|
-
totalChatTokens(){
|
|
1915
|
-
let total = 0
|
|
1916
|
-
for(let message of this.chat.messages){
|
|
1917
|
-
total += message.llmOutputTokenCount ?? 0
|
|
1918
|
-
}
|
|
1919
|
-
return total
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
},
|
|
1923
|
-
|
|
1924
|
-
data(){
|
|
1925
|
-
return {
|
|
1926
|
-
components: defaultConfig.components,
|
|
1927
|
-
config: {
|
|
1928
|
-
params: {
|
|
1929
|
-
version: '0.0.999',
|
|
1930
|
-
layoutMode: false,
|
|
1931
|
-
selectedComponent: null, // [ 'uid|style', 'style|headers|components|footers' ]
|
|
1932
|
-
tabIndex: 2,
|
|
1933
|
-
viewType: '',
|
|
1934
|
-
zoomLevel: 'fit',
|
|
1935
|
-
width: [ 320, 320 ],
|
|
1936
|
-
previewMode: 1,
|
|
1937
|
-
}
|
|
1938
|
-
},
|
|
1939
|
-
|
|
1940
|
-
currentComponentItems: null,
|
|
1941
|
-
compClasses: [
|
|
1942
|
-
'aspectRatio', 'position', 'left', 'top', 'right', 'bottom',
|
|
1943
|
-
|
|
1944
|
-
'bdSize', 'bdRadius', 'bdStyle',
|
|
1945
|
-
'divideSize', 'divideColor', 'divideStyle',
|
|
1946
|
-
'outlineWidth', 'outlineColor', 'outlineStyle',
|
|
1947
|
-
'bgSize', 'bgPosition', 'bgRepeat',
|
|
1948
|
-
'textAlign', 'verticalAlign',
|
|
1949
|
-
'gap',
|
|
1950
|
-
'padding', 'margin',
|
|
1951
|
-
'direction', 'columns', 'rows', 'display', 'wrap',
|
|
1952
|
-
'width', 'minWidth', 'maxWidth',
|
|
1953
|
-
'height', 'minHeight', 'maxHeight',
|
|
1954
|
-
'fontFamily', 'fontSize', 'fontWeight', 'textColor', 'lineHeight', 'overflow',
|
|
1955
|
-
'textTransform', 'whitespace', 'textOverflow', 'textDecoration',
|
|
1956
|
-
'boxShadow', 'opacity',
|
|
1957
|
-
'colSpan', 'rowSpan',
|
|
1958
|
-
'flex', 'flexAlign', 'flexJustify', 'flexBasis', 'flexColumns', 'flexWrap',
|
|
1959
|
-
'flexDirection',
|
|
1960
|
-
'zIndex',
|
|
1961
|
-
|
|
1962
|
-
'backdropBlur',
|
|
1963
|
-
|
|
1964
|
-
'autoFlow', 'alignItems', 'justifyContent',
|
|
1965
|
-
'letterSpacing', 'lineClamp',
|
|
1966
|
-
|
|
1967
|
-
'animate',
|
|
1968
|
-
|
|
1969
|
-
'blur', 'grayscale',
|
|
1970
|
-
],
|
|
1971
|
-
containerClasses: [
|
|
1972
|
-
'containerVariant', 'containerGridColumn', 'containerGap'
|
|
1973
|
-
],
|
|
1974
|
-
itemClasses: [
|
|
1975
|
-
'itemMinWidth', 'itemRatio', 'itemVariant', 'objectFit'
|
|
1976
|
-
],
|
|
1977
|
-
styleClasses: [
|
|
1978
|
-
'bgColors', 'bgImages', 'bdColor'
|
|
1979
|
-
],
|
|
1980
|
-
previewHost: null,
|
|
1981
|
-
iframeStyle: {},
|
|
1982
|
-
iframeSrc: '',
|
|
1983
|
-
layouts: [],
|
|
1984
|
-
prevData: null,
|
|
1985
|
-
previewModes: [
|
|
1986
|
-
{ text:"Design", value:1 },
|
|
1987
|
-
{ text:"Preview", value:2 },
|
|
1988
|
-
],
|
|
1989
|
-
viewTypes: [
|
|
1990
|
-
{ text:'Mobile', value:'' },
|
|
1991
|
-
{ text:'Tablet', value:'md:' },
|
|
1992
|
-
{ text:'Desktop', value:'xl:' }
|
|
1993
|
-
],
|
|
1994
|
-
routerBeforeEach: null,
|
|
1995
|
-
readyState: 2,
|
|
1996
|
-
stylesheets: [
|
|
1997
|
-
'font-family'
|
|
1998
|
-
],
|
|
1999
|
-
updating: true,
|
|
2000
|
-
|
|
2001
|
-
extRightPane: null,
|
|
2002
|
-
debugMode: false,
|
|
2003
|
-
|
|
2004
|
-
useChat: false
|
|
2005
|
-
}
|
|
2006
|
-
},
|
|
2007
|
-
|
|
2008
|
-
emits: [ 'close', 'unmount' ],
|
|
2009
|
-
|
|
2010
|
-
inject: [ 'alert', 'appStyle', 'confirm', 'useSocket', 'toast' ],
|
|
2011
|
-
|
|
2012
|
-
mounted() {
|
|
2013
|
-
this.loadPreset()
|
|
2014
|
-
.then(_ => {
|
|
2015
|
-
this.loadLayouts()
|
|
2016
|
-
this.load()
|
|
2017
|
-
})
|
|
2018
|
-
|
|
2019
|
-
window.addEventListener('message', this.onMessage)
|
|
2020
|
-
window.addEventListener('resize', this.onResize)
|
|
2021
|
-
window.addEventListener('keydown', this.onKeyDown)
|
|
2022
|
-
window.addEventListener('beforeunload', this.onUnload)
|
|
2023
|
-
|
|
2024
|
-
this.router = useRouter()
|
|
2025
|
-
this.routerBeforeEach = this.router.beforeEach((to, from, next) => {
|
|
2026
|
-
if(to.path !== from.path && this.canSave){
|
|
2027
|
-
const answer = window.confirm('Do you really want to leave? you have unsaved changes!')
|
|
2028
|
-
if (!answer) next(false)
|
|
2029
|
-
}
|
|
2030
|
-
next()
|
|
2031
|
-
})
|
|
2032
|
-
|
|
2033
|
-
this.listen()
|
|
2034
|
-
this.useSocket().onAny(this.onHooks)
|
|
2035
|
-
},
|
|
2036
|
-
|
|
2037
|
-
unmounted() {
|
|
2038
|
-
window.removeEventListener('message', this.onMessage)
|
|
2039
|
-
window.removeEventListener('resize', this.onResize)
|
|
2040
|
-
window.removeEventListener('keydown', this.onKeyDown)
|
|
2041
|
-
window.removeEventListener('beforeunload', this.onUnload)
|
|
2042
|
-
this.routerBeforeEach()
|
|
2043
|
-
this.stopListen()
|
|
2044
|
-
this.useSocket().offAny(this.onHooks)
|
|
2045
|
-
this.$emit('unmount', { uid:this.page.uid })
|
|
2046
|
-
},
|
|
2047
|
-
|
|
2048
|
-
provide(){
|
|
2049
|
-
return {
|
|
2050
|
-
imageUrl: this.imageUrl,
|
|
2051
|
-
imageSrc: this.imageSrc,
|
|
2052
|
-
store: this.store,
|
|
2053
|
-
postIframe: this.postIframe,
|
|
2054
|
-
getPage: this.getPage,
|
|
2055
|
-
uploadImage: this.uploadImage,
|
|
2056
|
-
openComponentSelector: this.openComponentSelector,
|
|
2057
|
-
setUid: this.setUid,
|
|
2058
|
-
openRightPane2: this.openRightPane2,
|
|
2059
|
-
getRightPane: () => this.$refs.rightPane,
|
|
2060
|
-
pageHistory: this.pageHistory,
|
|
2061
|
-
duplicate: this.duplicate
|
|
2062
|
-
}
|
|
2063
|
-
},
|
|
2064
|
-
|
|
2065
|
-
watch: {
|
|
2066
|
-
|
|
2067
|
-
config: {
|
|
2068
|
-
deep: true,
|
|
2069
|
-
handler(){
|
|
2070
|
-
this.savePreset()
|
|
2071
|
-
}
|
|
2072
|
-
},
|
|
2073
|
-
|
|
2074
|
-
currentItem(){
|
|
2075
|
-
this.$nextTick(() => this.resize())
|
|
2076
|
-
},
|
|
2077
|
-
|
|
2078
|
-
"store.zoomLevel"(to){
|
|
2079
|
-
if(to === 'fit'){
|
|
2080
|
-
this.$refs.preview.scrollTop = 0
|
|
2081
|
-
}
|
|
2082
|
-
this.resize()
|
|
2083
|
-
},
|
|
2084
|
-
|
|
2085
|
-
"store.viewType"(to){
|
|
2086
|
-
this.resize()
|
|
2087
|
-
},
|
|
2088
|
-
|
|
2089
|
-
page: {
|
|
2090
|
-
deep: true,
|
|
2091
|
-
handler(to){
|
|
2092
|
-
this.updateIframe()
|
|
2093
|
-
}
|
|
2094
|
-
},
|
|
2095
|
-
|
|
2096
|
-
layout: {
|
|
2097
|
-
deep: true,
|
|
2098
|
-
handler(to){
|
|
2099
|
-
this.updateIframe()
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
</script>
|
|
2108
|
-
|
|
2109
|
-
<style module>
|
|
2110
|
-
|
|
2111
|
-
.comp{
|
|
2112
|
-
@apply flex-1;
|
|
2113
|
-
@apply hidden md:flex flex-row;
|
|
2114
|
-
@apply divide-x divide-border-50;
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
.resize1{
|
|
2118
|
-
@apply w-[3px] cursor-ew-resize border-l-[1px] border-border-50;
|
|
2119
|
-
}
|
|
2120
|
-
|
|
2121
|
-
.resize3{
|
|
2122
|
-
@apply w-[3px] cursor-ew-resize border-r-[1px] border-border-50;
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
.zoomLevel{
|
|
2126
|
-
@apply appearance-none bg-base-400 text-center outline-none h-[24px] rounded-md;
|
|
2127
|
-
@apply border-[1px] border-border-200;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
.chat{
|
|
2131
|
-
@apply max-w-[80%] flex flex-col;
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
.chatIn{
|
|
2135
|
-
@apply self-start;
|
|
2136
|
-
}
|
|
2137
|
-
.chatIn p{
|
|
2138
|
-
@apply bg-border-100 p-3 rounded-lg;
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
.chatOut{
|
|
2142
|
-
@apply self-end flex flex-col items-end;
|
|
2143
|
-
}
|
|
2144
|
-
.chatOut p{
|
|
2145
|
-
@apply bg-primary-100 p-3 rounded-lg;
|
|
2146
|
-
}
|
|
2147
|
-
.chatOut button{
|
|
2148
|
-
@apply p-0 px-2 text-sm mt-1 rounded-sm;
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
</style>
|
|
2152
|
-
|
|
2153
|
-
<style>
|
|
2154
|
-
|
|
2155
|
-
.transparent-image-bg{
|
|
2156
|
-
@apply p-2 bg-white;
|
|
2157
|
-
background-image: radial-gradient(rgba(var(--primary-500)) 1px, transparent 1px);
|
|
2158
|
-
background-size: calc(10 * 1px) calc(10 * 1px);
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
</style>
|