@bagelink/vue 1.4.153 → 1.4.159
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/dist/components/Alert.vue.d.ts +17 -2
- package/dist/components/Alert.vue.d.ts.map +1 -1
- package/dist/components/ListItem.vue.d.ts +2 -2
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/Loading.vue.d.ts +3 -2
- package/dist/components/Loading.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ColorInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
- package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/index.cjs +21 -21
- package/dist/index.mjs +21 -21
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +1 -0
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/BtnOptions.d.ts +3 -0
- package/dist/types/BtnOptions.d.ts.map +1 -1
- package/dist/utils/sizeParsing.d.ts +3 -0
- package/dist/utils/sizeParsing.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Alert.vue +12 -9
- package/src/components/ListItem.vue +42 -35
- package/src/components/Loading.vue +73 -25
- package/src/components/Modal.vue +40 -24
- package/src/components/form/inputs/ColorInput.vue +5 -5
- package/src/components/form/inputs/DateInput.vue +0 -1
- package/src/components/form/inputs/NumberInput.vue +2 -2
- package/src/components/form/inputs/RichText/index.vue +147 -271
- package/src/components/form/inputs/Upload/UploadInput.vue +95 -212
- package/src/components/form/inputs/Upload/upload.css +36 -2
- package/src/components/layout/AppSidebar.vue +1 -1
- package/src/components/layout/TabsNav.vue +24 -22
- package/src/components/lightbox/Lightbox.vue +1 -0
- package/src/styles/colors.css +502 -3
- package/src/styles/inputs.css +12 -4
- package/src/styles/layout.css +779 -1
- package/src/styles/mobilLayout.css +779 -1
- package/src/styles/mobileColors.css +4167 -3739
- package/src/types/BagelForm.ts +1 -0
- package/src/types/BtnOptions.ts +4 -0
- package/src/utils/sizeParsing.ts +26 -0
|
@@ -414,8 +414,8 @@ function showInlineToolbarForSelection() {
|
|
|
414
414
|
const rangeClone = range.cloneRange()
|
|
415
415
|
inlineToolbarSelection.value = selection
|
|
416
416
|
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
// Store the cloned range for later use
|
|
418
|
+
; (inlineToolbarSelection.value as any)._storedRange = rangeClone
|
|
419
419
|
|
|
420
420
|
showInlineToolbar.value = true
|
|
421
421
|
}
|
|
@@ -1480,7 +1480,7 @@ function createNewTable(doc: Document) {
|
|
|
1480
1480
|
console.log('Trying to add edit button to new table...')
|
|
1481
1481
|
if (doc && (doc as any).__addEditButtonsToTables) {
|
|
1482
1482
|
console.log('Calling __addEditButtonsToTables...')
|
|
1483
|
-
|
|
1483
|
+
; (doc as any).__addEditButtonsToTables()
|
|
1484
1484
|
} else {
|
|
1485
1485
|
console.log('__addEditButtonsToTables not found, calling setupTableEditButtons...')
|
|
1486
1486
|
setupTableEditButtons(doc)
|
|
@@ -1582,13 +1582,13 @@ function deleteEmbed() {
|
|
|
1582
1582
|
|
|
1583
1583
|
// Expose openLinkModal to editor state
|
|
1584
1584
|
; (editor.state as any).openLinkModal = openLinkModal
|
|
1585
|
-
; (editor.state as any).showTooltipMessage = showTooltipMessage
|
|
1585
|
+
; (editor.state as any).showTooltipMessage = showTooltipMessage
|
|
1586
1586
|
|
|
1587
|
-
// Expose openTableEditor to editor state
|
|
1588
|
-
; (editor.state as any).openTableEditor = openTableEditor
|
|
1589
|
-
; (editor.state as any).openImageModal = openImageModal
|
|
1590
|
-
; (editor.state as any).openEmbedModal = openEmbedModal
|
|
1591
|
-
; (editor.state as any).openVideoModal = openVideoModal
|
|
1587
|
+
// Expose openTableEditor to editor state
|
|
1588
|
+
; (editor.state as any).openTableEditor = openTableEditor
|
|
1589
|
+
; (editor.state as any).openImageModal = openImageModal
|
|
1590
|
+
; (editor.state as any).openEmbedModal = openEmbedModal
|
|
1591
|
+
; (editor.state as any).openVideoModal = openVideoModal
|
|
1592
1592
|
|
|
1593
1593
|
// Table manipulation functions
|
|
1594
1594
|
function mergeCellRight() {
|
|
@@ -1916,12 +1916,6 @@ function handleTableContextMenu(event: MouseEvent) {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
}
|
|
1918
1918
|
|
|
1919
|
-
// Close context menu when clicking outside
|
|
1920
|
-
function closeTableContextMenu() {
|
|
1921
|
-
showTableContextMenu.value = false
|
|
1922
|
-
contextMenuCell.value = null
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
1919
|
// Handle clicks outside context menu
|
|
1926
1920
|
// function handleDocumentClick(event: MouseEvent) {
|
|
1927
1921
|
// if (showTableContextMenu.value) {
|
|
@@ -2908,38 +2902,28 @@ defineExpose({
|
|
|
2908
2902
|
<div class="bagel-input" v-bind="attrs">
|
|
2909
2903
|
<label v-if="label">{{ label }}</label>
|
|
2910
2904
|
|
|
2911
|
-
<div
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
>
|
|
2920
|
-
<EditorToolbar
|
|
2921
|
-
v-if="editor.state.hasInit && shouldShowToolbar" :config="effectiveToolbarConfig"
|
|
2905
|
+
<div class="rounded" :class="[
|
|
2906
|
+
{
|
|
2907
|
+
'rich-text-editor pt-05 px-05 pb-075': !basic,
|
|
2908
|
+
'rich-text-editor--basic': basic,
|
|
2909
|
+
'fullscreen-mode': editor.state.isFullscreen,
|
|
2910
|
+
},
|
|
2911
|
+
]">
|
|
2912
|
+
<EditorToolbar v-if="editor.state.hasInit && shouldShowToolbar" :config="effectiveToolbarConfig"
|
|
2922
2913
|
:selectedStyles="editor.state.selectedStyles" :hide-images="hideImages" :hide-videos="hideVideos"
|
|
2923
2914
|
:hide-embeds="hideEmbed" :hide-tables="hideTables" :hide-alignment="hideAlignment"
|
|
2924
2915
|
:hide-directions="hideDirections" :hide-h5-h6="hideH5H6" :hide="effectiveHideArray"
|
|
2925
|
-
@action="commands.execute"
|
|
2926
|
-
/>
|
|
2916
|
+
@action="commands.execute" />
|
|
2927
2917
|
<div class="editor-container" :class="{ 'split-view': editor.state.isSplitView }">
|
|
2928
|
-
<div
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
>
|
|
2932
|
-
<iframe
|
|
2933
|
-
id="rich-text-iframe" ref="iframe" class="editableContent" title="Editor" srcdoc=""
|
|
2918
|
+
<div class="content-area radius-1"
|
|
2919
|
+
:style="{ height: editor.state.isFullscreen ? 'calc(100vh - 4rem)' : editorHeight }">
|
|
2920
|
+
<iframe id="rich-text-iframe" ref="iframe" class="editableContent" title="Editor" srcdoc=""
|
|
2934
2921
|
sandbox="allow-same-origin allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-scripts allow-top-navigation allow-top-navigation-by-user-activation"
|
|
2935
|
-
@load="initEditor" @contextmenu="handleTableContextMenu"
|
|
2936
|
-
/>
|
|
2922
|
+
@load="initEditor" @contextmenu="handleTableContextMenu" />
|
|
2937
2923
|
</div>
|
|
2938
|
-
<CodeEditor
|
|
2939
|
-
v-if="editor.state.isSplitView" v-model="editor.state.content" language="html"
|
|
2924
|
+
<CodeEditor v-if="editor.state.isSplitView" v-model="editor.state.content" language="html"
|
|
2940
2925
|
:height="editor.state.isFullscreen ? 'calc(100vh - 4rem)' : editorHeight"
|
|
2941
|
-
@update:modelValue="editor.updateState.content('html')"
|
|
2942
|
-
/>
|
|
2926
|
+
@update:modelValue="editor.updateState.content('html')" />
|
|
2943
2927
|
</div>
|
|
2944
2928
|
<div v-if="debug" class="flex pt-05">
|
|
2945
2929
|
<p class="txt12 txt-gray mb-0 p-0">
|
|
@@ -2954,51 +2938,39 @@ defineExpose({
|
|
|
2954
2938
|
<Btn thin color="gray" icon="download" @click="debugMethods?.downloadSession">
|
|
2955
2939
|
Download Log
|
|
2956
2940
|
</Btn>
|
|
2957
|
-
<Btn
|
|
2958
|
-
|
|
2959
|
-
@click="copyText(debugMethods?.exportDebugWithPrompt() || '')"
|
|
2960
|
-
>
|
|
2941
|
+
<Btn thin color="gray" icon="content_copy"
|
|
2942
|
+
@click="copyText(debugMethods?.exportDebugWithPrompt() || '')">
|
|
2961
2943
|
Copy Log
|
|
2962
2944
|
</Btn>
|
|
2963
2945
|
</div>
|
|
2964
2946
|
</div>
|
|
2965
2947
|
|
|
2966
2948
|
<!-- Inline Toolbar -->
|
|
2967
|
-
<div
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
}"
|
|
2974
|
-
>
|
|
2949
|
+
<div v-if="showInlineToolbar" class="inline-toolbar" :style="{
|
|
2950
|
+
position: 'fixed',
|
|
2951
|
+
top: `${inlineToolbarPosition.top}px`,
|
|
2952
|
+
left: `${inlineToolbarPosition.left}px`,
|
|
2953
|
+
zIndex: 99,
|
|
2954
|
+
}">
|
|
2975
2955
|
<div class="inline-toolbar-content">
|
|
2976
|
-
<Btn
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
<Btn
|
|
2981
|
-
thin flat icon="format_italic" :class="{ active: editor.state.selectedStyles.has('italic') }"
|
|
2982
|
-
@click="runInlineAction('italic')"
|
|
2983
|
-
/>
|
|
2984
|
-
<Btn
|
|
2985
|
-
thin flat icon="format_underlined"
|
|
2956
|
+
<Btn thin flat icon="format_bold" :class="{ active: editor.state.selectedStyles.has('bold') }"
|
|
2957
|
+
@click="runInlineAction('bold')" />
|
|
2958
|
+
<Btn thin flat icon="format_italic" :class="{ active: editor.state.selectedStyles.has('italic') }"
|
|
2959
|
+
@click="runInlineAction('italic')" />
|
|
2960
|
+
<Btn thin flat icon="format_underlined"
|
|
2986
2961
|
:class="{ active: editor.state.selectedStyles.has('underline') }"
|
|
2987
|
-
@click="runInlineAction('underline')"
|
|
2988
|
-
/>
|
|
2962
|
+
@click="runInlineAction('underline')" />
|
|
2989
2963
|
<span class="separator">|</span>
|
|
2990
2964
|
<Btn thin flat icon="add_link" @click="runInlineAction('link')" />
|
|
2991
2965
|
</div>
|
|
2992
2966
|
</div>
|
|
2993
2967
|
<!-- Table Context Menu -->
|
|
2994
|
-
<div
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
}"
|
|
3001
|
-
>
|
|
2968
|
+
<div v-if="showTableContextMenu" class="table-context-menu" :style="{
|
|
2969
|
+
position: 'fixed',
|
|
2970
|
+
top: `${contextMenuPosition.y}px`,
|
|
2971
|
+
left: `${contextMenuPosition.x}px`,
|
|
2972
|
+
zIndex: 1001,
|
|
2973
|
+
}">
|
|
3002
2974
|
<div class="context-menu-content" @click.stop>
|
|
3003
2975
|
<div class="menu-header">
|
|
3004
2976
|
<span>Table Actions</span>
|
|
@@ -3007,60 +2979,42 @@ defineExpose({
|
|
|
3007
2979
|
</button>
|
|
3008
2980
|
</div>
|
|
3009
2981
|
<div class="px-025">
|
|
3010
|
-
<Btn
|
|
3011
|
-
|
|
3012
|
-
class="context-menu-btn" @click="mergeCellRight(); showTableContextMenu = false"
|
|
3013
|
-
>
|
|
2982
|
+
<Btn v-if="canMergeRight" full-width align-txt="start" thin flat icon="start"
|
|
2983
|
+
class="context-menu-btn" @click="mergeCellRight(); showTableContextMenu = false">
|
|
3014
2984
|
Merge Right
|
|
3015
2985
|
</Btn>
|
|
3016
|
-
<Btn
|
|
3017
|
-
|
|
3018
|
-
class="context-menu-btn" @click="mergeCellDown(); showTableContextMenu = false"
|
|
3019
|
-
>
|
|
2986
|
+
<Btn v-if="canMergeDown" full-width align-txt="start" thin flat icon="text_select_move_down"
|
|
2987
|
+
class="context-menu-btn" @click="mergeCellDown(); showTableContextMenu = false">
|
|
3020
2988
|
Merge Down
|
|
3021
2989
|
</Btn>
|
|
3022
|
-
<Btn
|
|
3023
|
-
|
|
3024
|
-
class="context-menu-btn" @click="splitCell(); showTableContextMenu = false"
|
|
3025
|
-
>
|
|
2990
|
+
<Btn v-if="canSplit" full-width align-txt="start" thin flat icon="call_split"
|
|
2991
|
+
class="context-menu-btn" @click="splitCell(); showTableContextMenu = false">
|
|
3026
2992
|
Split Cell
|
|
3027
2993
|
</Btn>
|
|
3028
2994
|
<div v-if="canMergeRight || canMergeDown || canSplit" class="context-menu-separator" />
|
|
3029
|
-
<Btn
|
|
3030
|
-
|
|
3031
|
-
@click="insertRowAbove(); showTableContextMenu = false"
|
|
3032
|
-
>
|
|
2995
|
+
<Btn full-width align-txt="start" thin flat icon="add_row_above" class="context-menu-btn"
|
|
2996
|
+
@click="insertRowAbove(); showTableContextMenu = false">
|
|
3033
2997
|
Insert Row Above
|
|
3034
2998
|
</Btn>
|
|
3035
|
-
<Btn
|
|
3036
|
-
|
|
3037
|
-
@click="insertRowBelow(); showTableContextMenu = false"
|
|
3038
|
-
>
|
|
2999
|
+
<Btn full-width align-txt="start" thin flat icon="add_row_below" class="context-menu-btn"
|
|
3000
|
+
@click="insertRowBelow(); showTableContextMenu = false">
|
|
3039
3001
|
Insert Row Below
|
|
3040
3002
|
</Btn>
|
|
3041
|
-
<Btn
|
|
3042
|
-
|
|
3043
|
-
@click="deleteRow(); showTableContextMenu = false"
|
|
3044
|
-
>
|
|
3003
|
+
<Btn full-width align-txt="start" thin flat icon="remove" class="context-menu-btn"
|
|
3004
|
+
@click="deleteRow(); showTableContextMenu = false">
|
|
3045
3005
|
Delete Row
|
|
3046
3006
|
</Btn>
|
|
3047
3007
|
<div class="context-menu-separator" />
|
|
3048
|
-
<Btn
|
|
3049
|
-
|
|
3050
|
-
@click="insertColumnLeft(); showTableContextMenu = false"
|
|
3051
|
-
>
|
|
3008
|
+
<Btn full-width align-txt="start" thin flat icon="add_column_left" class="context-menu-btn"
|
|
3009
|
+
@click="insertColumnLeft(); showTableContextMenu = false">
|
|
3052
3010
|
Insert Column Left
|
|
3053
3011
|
</Btn>
|
|
3054
|
-
<Btn
|
|
3055
|
-
|
|
3056
|
-
@click="insertColumnRight(); showTableContextMenu = false"
|
|
3057
|
-
>
|
|
3012
|
+
<Btn full-width align-txt="start" thin flat icon="add_column_right" class="context-menu-btn"
|
|
3013
|
+
@click="insertColumnRight(); showTableContextMenu = false">
|
|
3058
3014
|
Insert Column Right
|
|
3059
3015
|
</Btn>
|
|
3060
|
-
<Btn
|
|
3061
|
-
|
|
3062
|
-
@click="deleteColumn(); showTableContextMenu = false"
|
|
3063
|
-
>
|
|
3016
|
+
<Btn full-width align-txt="start" thin flat icon="remove" class="context-menu-btn"
|
|
3017
|
+
@click="deleteColumn(); showTableContextMenu = false">
|
|
3064
3018
|
Delete Column
|
|
3065
3019
|
</Btn>
|
|
3066
3020
|
</div>
|
|
@@ -3070,14 +3024,10 @@ defineExpose({
|
|
|
3070
3024
|
<!-- Link Modal -->
|
|
3071
3025
|
<Modal v-model:visible="showLinkModal" title="Add Link" width="400">
|
|
3072
3026
|
<div class="flex gap-05 align-items-end">
|
|
3073
|
-
<TextInput
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
<Btn
|
|
3078
|
-
icon="open_in_new" class="mb-05 radius-1" flat :disabled="!isValidUrl(linkForm.url)"
|
|
3079
|
-
@click="visitLink"
|
|
3080
|
-
/>
|
|
3027
|
+
<TextInput v-model="linkForm.url" label="URL" type="url" placeholder="https://example.com"
|
|
3028
|
+
@keydown.enter="submitLink" />
|
|
3029
|
+
<Btn icon="open_in_new" class="mb-05 radius-1" flat :disabled="!isValidUrl(linkForm.url)"
|
|
3030
|
+
@click="visitLink" />
|
|
3081
3031
|
</div>
|
|
3082
3032
|
<CheckInput v-model="linkForm.openInNewTab" label="Open in new tab" type="checkbox" class="mb-2 mt-05" />
|
|
3083
3033
|
<template #footer>
|
|
@@ -3092,54 +3042,36 @@ defineExpose({
|
|
|
3092
3042
|
</div>
|
|
3093
3043
|
|
|
3094
3044
|
<!-- Image Modal -->
|
|
3095
|
-
<Modal
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
<TextInput
|
|
3100
|
-
v-model="imageForm.src" label="Image URL" type="url" placeholder="https://example.com/image.jpg"
|
|
3101
|
-
@keydown.enter="submitImage"
|
|
3102
|
-
/>
|
|
3045
|
+
<Modal v-model:visible="showImageModal" :title="pendingImageData?.existingImage ? 'Edit Image' : 'Insert Image'"
|
|
3046
|
+
width="500">
|
|
3047
|
+
<TextInput v-model="imageForm.src" label="Image URL" type="url" placeholder="https://example.com/image.jpg"
|
|
3048
|
+
@keydown.enter="submitImage" />
|
|
3103
3049
|
<TextInput v-model="imageForm.alt" label="Alt Text" placeholder="Describe the image" />
|
|
3104
3050
|
<div class="flex gap-1">
|
|
3105
|
-
<TextInput
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
<TextInput
|
|
3110
|
-
v-model="imageForm.height" label="Height" placeholder="auto or 300px"
|
|
3111
|
-
help="Examples: auto, 300px"
|
|
3112
|
-
/>
|
|
3051
|
+
<TextInput v-model="imageForm.width" label="Width" placeholder="100% or 500px or auto"
|
|
3052
|
+
help="Examples: 100%, 500px, auto" />
|
|
3053
|
+
<TextInput v-model="imageForm.height" label="Height" placeholder="auto or 300px"
|
|
3054
|
+
help="Examples: auto, 300px" />
|
|
3113
3055
|
</div>
|
|
3114
3056
|
<TextInput v-model="imageForm.credit" label="Photo Credit" placeholder="Photographer name (optional)" />
|
|
3115
|
-
<CheckInput
|
|
3116
|
-
|
|
3117
|
-
help="Photo credit will always be shown if provided"
|
|
3118
|
-
/>
|
|
3057
|
+
<CheckInput v-model="imageForm.figcaption" label="Show alt text as caption"
|
|
3058
|
+
help="Photo credit will always be shown if provided" />
|
|
3119
3059
|
<template #footer>
|
|
3120
3060
|
<div class="flex gap-05 w-100 ">
|
|
3121
3061
|
<Btn value="Cancel" flat thin @click="showImageModal = false" />
|
|
3122
|
-
<Btn
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
<Btn
|
|
3127
|
-
class="ms-auto" :value="pendingImageData?.existingImage ? 'Save Changes' : 'Insert Image'"
|
|
3128
|
-
:disabled="!imageForm.src" @click="submitImage"
|
|
3129
|
-
/>
|
|
3062
|
+
<Btn v-if="pendingImageData?.existingImage" value="Delete Image" color="red" flat thin icon="delete"
|
|
3063
|
+
@click="deleteImage" />
|
|
3064
|
+
<Btn class="ms-auto" :value="pendingImageData?.existingImage ? 'Save Changes' : 'Insert Image'"
|
|
3065
|
+
:disabled="!imageForm.src" @click="submitImage" />
|
|
3130
3066
|
</div>
|
|
3131
3067
|
</template>
|
|
3132
3068
|
</Modal>
|
|
3133
3069
|
|
|
3134
3070
|
<!-- Embed Modal -->
|
|
3135
|
-
<Modal
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
<TextInput
|
|
3140
|
-
v-model="embedForm.src" label="Embed URL or Code" type="url"
|
|
3141
|
-
placeholder="https://www.youtube.com/embed/... or paste iframe code" @keydown.enter="submitEmbed"
|
|
3142
|
-
/>
|
|
3071
|
+
<Modal v-model:visible="showEmbedModal" :title="pendingEmbedData?.existingEmbed ? 'Edit Embed' : 'Insert Embed'"
|
|
3072
|
+
width="500">
|
|
3073
|
+
<TextInput v-model="embedForm.src" label="Embed URL or Code" type="url"
|
|
3074
|
+
placeholder="https://www.youtube.com/embed/... or paste iframe code" @keydown.enter="submitEmbed" />
|
|
3143
3075
|
<div class="flex gap-1">
|
|
3144
3076
|
<TextInput v-model="embedForm.width" label="Width" placeholder="560" />
|
|
3145
3077
|
<TextInput v-model="embedForm.height" label="Height" placeholder="315" />
|
|
@@ -3148,25 +3080,19 @@ defineExpose({
|
|
|
3148
3080
|
<template #footer>
|
|
3149
3081
|
<div class="flex gap-05 w-100">
|
|
3150
3082
|
<Btn value="Cancel" flat thin @click="showEmbedModal = false" />
|
|
3151
|
-
<Btn
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
<Btn
|
|
3156
|
-
:value="pendingEmbedData?.existingEmbed ? 'Save Changes' : 'Insert Embed'"
|
|
3157
|
-
:disabled="!embedForm.src" class="ms-auto" @click="submitEmbed"
|
|
3158
|
-
/>
|
|
3083
|
+
<Btn v-if="pendingEmbedData?.existingEmbed" value="Delete Embed" color="red" flat thin icon="delete"
|
|
3084
|
+
@click="deleteEmbed" />
|
|
3085
|
+
<Btn :value="pendingEmbedData?.existingEmbed ? 'Save Changes' : 'Insert Embed'"
|
|
3086
|
+
:disabled="!embedForm.src" class="ms-auto" @click="submitEmbed" />
|
|
3159
3087
|
</div>
|
|
3160
3088
|
</template>
|
|
3161
3089
|
</Modal>
|
|
3162
3090
|
<!-- Video Modal -->
|
|
3163
3091
|
<Modal v-model:visible="showVideoModal" title="Insert Video" width="500">
|
|
3164
3092
|
<div class="grid gap-0">
|
|
3165
|
-
<TextInput
|
|
3166
|
-
v-model="videoForm.src" label="Video URL or Embed Code" type="url"
|
|
3093
|
+
<TextInput v-model="videoForm.src" label="Video URL or Embed Code" type="url"
|
|
3167
3094
|
placeholder="Paste YouTube URL, video file URL, or iframe embed code..."
|
|
3168
|
-
:class="{ error: videoForm.src && !isValidVideoUrl(videoForm.src) }" @keydown.enter="submitVideo"
|
|
3169
|
-
/>
|
|
3095
|
+
:class="{ error: videoForm.src && !isValidVideoUrl(videoForm.src) }" @keydown.enter="submitVideo" />
|
|
3170
3096
|
|
|
3171
3097
|
<div v-if="videoForm.src && !isValidVideoUrl(videoForm.src)" class="flex gap-025 opacity-5 -mt-05">
|
|
3172
3098
|
<Icon name="warning" />
|
|
@@ -3175,21 +3101,17 @@ defineExpose({
|
|
|
3175
3101
|
</p>
|
|
3176
3102
|
</div>
|
|
3177
3103
|
|
|
3178
|
-
<TextInput
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
{ value: '1:1', label: '1:1 (Square)' },
|
|
3190
|
-
{ value: 'custom', label: 'Custom' },
|
|
3191
|
-
]"
|
|
3192
|
-
/>
|
|
3104
|
+
<TextInput v-model="videoForm.width" label="Width" placeholder="100% or 500px or 50vw"
|
|
3105
|
+
help="Examples: 100%, 500px, 50vw, 300" />
|
|
3106
|
+
|
|
3107
|
+
<SelectInput v-model="videoForm.aspectRatio" label="Aspect Ratio" :options="[
|
|
3108
|
+
{ value: '16:9', label: '16:9 (Standard)' },
|
|
3109
|
+
{ value: '4:3', label: '4:3 (Classic)' },
|
|
3110
|
+
{ value: '9:16', label: '9:16 (Vertical/Shorts)' },
|
|
3111
|
+
{ value: '21:9', label: '21:9 (Cinematic)' },
|
|
3112
|
+
{ value: '1:1', label: '1:1 (Square)' },
|
|
3113
|
+
{ value: 'custom', label: 'Custom' },
|
|
3114
|
+
]" />
|
|
3193
3115
|
|
|
3194
3116
|
<div v-if="videoForm.aspectRatio === 'custom'" class="grid grid-wrap-2 gap-05">
|
|
3195
3117
|
<TextInput v-model="videoForm.customWidth" label="Width ratio" placeholder="16" type="number" />
|
|
@@ -3202,10 +3124,8 @@ defineExpose({
|
|
|
3202
3124
|
<CheckInput v-model="videoForm.mute" label="Mute" />
|
|
3203
3125
|
<CheckInput v-model="videoForm.loop" label="Loop" />
|
|
3204
3126
|
<CheckInput v-model="videoForm.showCaption" class="grid-span-2" label="Show caption below video" />
|
|
3205
|
-
<TextInput
|
|
3206
|
-
|
|
3207
|
-
placeholder="Describe the video content"
|
|
3208
|
-
/>
|
|
3127
|
+
<TextInput v-if="videoForm.showCaption" v-model="videoForm.caption" label="Caption" class="grid-span-2"
|
|
3128
|
+
placeholder="Describe the video content" />
|
|
3209
3129
|
</div>
|
|
3210
3130
|
|
|
3211
3131
|
<!-- Video Preview -->
|
|
@@ -3214,35 +3134,27 @@ defineExpose({
|
|
|
3214
3134
|
Preview:
|
|
3215
3135
|
</p>
|
|
3216
3136
|
<div class="overflow-hidden flex justify-content-center">
|
|
3217
|
-
<BglVideo
|
|
3218
|
-
:src="videoForm.src" class=""
|
|
3137
|
+
<BglVideo :src="videoForm.src" class=""
|
|
3219
3138
|
:aspect-ratio="videoForm.aspectRatio === 'custom' && videoForm.customWidth && videoForm.customHeight ? `${videoForm.customWidth}:${videoForm.customHeight}` : videoForm.aspectRatio"
|
|
3220
3139
|
:autoplay="false" :mute="videoForm.mute" :controls="videoForm.controls"
|
|
3221
|
-
:loop="videoForm.loop"
|
|
3222
|
-
/>
|
|
3140
|
+
:loop="videoForm.loop" />
|
|
3223
3141
|
</div>
|
|
3224
3142
|
</Card>
|
|
3225
3143
|
</div>
|
|
3226
3144
|
<template #footer>
|
|
3227
3145
|
<div class="flex gap-05 w-100 ">
|
|
3228
3146
|
<Btn value="Cancel" flat thin @click="showVideoModal = false" />
|
|
3229
|
-
<Btn
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
<Btn
|
|
3234
|
-
value="Insert Video" class="ms-auto" :disabled="!videoForm.src || !isValidVideoUrl(videoForm.src)"
|
|
3235
|
-
@click="submitVideo"
|
|
3236
|
-
/>
|
|
3147
|
+
<Btn v-if="pendingVideoData?.existingVideo" value="Delete Video" color="red" flat thin icon="delete"
|
|
3148
|
+
@click="deleteVideo" />
|
|
3149
|
+
<Btn value="Insert Video" class="ms-auto" :disabled="!videoForm.src || !isValidVideoUrl(videoForm.src)"
|
|
3150
|
+
@click="submitVideo" />
|
|
3237
3151
|
</div>
|
|
3238
3152
|
</template>
|
|
3239
3153
|
</Modal>
|
|
3240
3154
|
|
|
3241
3155
|
<!-- Table Editor Modal -->
|
|
3242
|
-
<Modal
|
|
3243
|
-
|
|
3244
|
-
width="700"
|
|
3245
|
-
>
|
|
3156
|
+
<Modal v-model:visible="showTableEditor" :title="pendingTableData?.existingTable ? 'Edit Table' : 'Insert Table'"
|
|
3157
|
+
width="700">
|
|
3246
3158
|
<template #default>
|
|
3247
3159
|
<div class="grid grid-wrap-4 m_grid-wrap-2 gap-col-1 table-editor testMe1">
|
|
3248
3160
|
<!-- Structure Section -->
|
|
@@ -3258,40 +3170,26 @@ defineExpose({
|
|
|
3258
3170
|
<!-- Cell Text Alignment -->
|
|
3259
3171
|
<div class="grid-span-1">
|
|
3260
3172
|
<label class="label">Cell Text Alignment</label>
|
|
3261
|
-
<div
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
<Btn
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
<Btn
|
|
3270
|
-
:class="{ activeBtn: tableForm.alignment === 'center' }" flat thin
|
|
3271
|
-
icon="format_align_center" title="Align Center" @click="tableForm.alignment = 'center'"
|
|
3272
|
-
/>
|
|
3273
|
-
<Btn
|
|
3274
|
-
:class="{ activeBtn: tableForm.alignment === 'right' }" flat thin icon="format_align_right"
|
|
3275
|
-
title="Align Right" @click="tableForm.alignment = 'right'"
|
|
3276
|
-
/>
|
|
3173
|
+
<div class="flex gap-025 mt-025 radius-1 p-05 w-fit"
|
|
3174
|
+
style="height: var(--input-height); background: var(--input-bg);">
|
|
3175
|
+
<Btn :class="{ activeBtn: tableForm.alignment === 'left' }" flat thin icon="format_align_left"
|
|
3176
|
+
title="Align Left" @click="tableForm.alignment = 'left'" />
|
|
3177
|
+
<Btn :class="{ activeBtn: tableForm.alignment === 'center' }" flat thin
|
|
3178
|
+
icon="format_align_center" title="Align Center" @click="tableForm.alignment = 'center'" />
|
|
3179
|
+
<Btn :class="{ activeBtn: tableForm.alignment === 'right' }" flat thin icon="format_align_right"
|
|
3180
|
+
title="Align Right" @click="tableForm.alignment = 'right'" />
|
|
3277
3181
|
</div>
|
|
3278
3182
|
</div>
|
|
3279
3183
|
|
|
3280
3184
|
<!-- Text Direction -->
|
|
3281
3185
|
<div class="grid-span-1">
|
|
3282
3186
|
<label class="label">Text Direction</label>
|
|
3283
|
-
<div
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
<Btn
|
|
3288
|
-
|
|
3289
|
-
title="Left to Right" @click="tableForm.direction = 'ltr'"
|
|
3290
|
-
/>
|
|
3291
|
-
<Btn
|
|
3292
|
-
:class="{ activeBtn: tableForm.direction === 'rtl' }" flat thin value="RTL"
|
|
3293
|
-
title="Right to Left" @click="tableForm.direction = 'rtl'"
|
|
3294
|
-
/>
|
|
3187
|
+
<div class="flex gap-025 mt-025 radius-1 p-025 w-fit"
|
|
3188
|
+
style="height: var(--input-height); background: var(--input-bg);">
|
|
3189
|
+
<Btn :class="{ activeBtn: tableForm.direction === 'ltr' }" flat thin value="LTR"
|
|
3190
|
+
title="Left to Right" @click="tableForm.direction = 'ltr'" />
|
|
3191
|
+
<Btn :class="{ activeBtn: tableForm.direction === 'rtl' }" flat thin value="RTL"
|
|
3192
|
+
title="Right to Left" @click="tableForm.direction = 'rtl'" />
|
|
3295
3193
|
</div>
|
|
3296
3194
|
</div>
|
|
3297
3195
|
<!-- Style Section -->
|
|
@@ -3306,10 +3204,8 @@ defineExpose({
|
|
|
3306
3204
|
<NumberInput v-model="tableForm.cellPadding" label="Cell Padding (px)" :min="2" :max="20" />
|
|
3307
3205
|
<NumberInput v-model="tableForm.borderWidth" label="Border Width (px)" :min="0" :max="5" />
|
|
3308
3206
|
<ColorInput v-model="tableForm.borderColor" label="Border Color" />
|
|
3309
|
-
<CheckInput
|
|
3310
|
-
|
|
3311
|
-
class="grid-span-4 m_grid-span-2"
|
|
3312
|
-
/>
|
|
3207
|
+
<CheckInput v-model="tableForm.fixedLayout" label="Fixed cell width (doesn't change by content)"
|
|
3208
|
+
class="grid-span-4 m_grid-span-2" />
|
|
3313
3209
|
|
|
3314
3210
|
<!-- Cell Colors -->
|
|
3315
3211
|
<div class="flex gap-05 white-space mt-0 grid-span-4 m_grid-span-2 pt-1 pb-05">
|
|
@@ -3319,10 +3215,8 @@ defineExpose({
|
|
|
3319
3215
|
</p>
|
|
3320
3216
|
<div class="line" />
|
|
3321
3217
|
</div>
|
|
3322
|
-
<ColorInput
|
|
3323
|
-
|
|
3324
|
-
label="Background Color"
|
|
3325
|
-
/>
|
|
3218
|
+
<ColorInput v-model="tableForm.cellBgColor" class="grid-span-2 m_grid-span-1"
|
|
3219
|
+
label="Background Color" />
|
|
3326
3220
|
<ColorInput v-model="tableForm.cellTextColor" class="grid-span-2 m_grid-span-1" label="Text Color" />
|
|
3327
3221
|
<!-- Alternating Rows -->
|
|
3328
3222
|
<div class="flex gap-05 white-space mt-0 grid-span-4 m_grid-span-2 pt-1 pb-05">
|
|
@@ -3334,35 +3228,21 @@ defineExpose({
|
|
|
3334
3228
|
</div>
|
|
3335
3229
|
<CheckInput v-model="tableForm.showHeaders" label="Show header row" class="grid-span-4 m_grid-span-2" />
|
|
3336
3230
|
<!-- Header Colors -->
|
|
3337
|
-
<div
|
|
3338
|
-
|
|
3339
|
-
class="grid-span-
|
|
3340
|
-
|
|
3341
|
-
<ColorInput
|
|
3342
|
-
|
|
3343
|
-
label="Header Background Color"
|
|
3344
|
-
/>
|
|
3345
|
-
<ColorInput
|
|
3346
|
-
v-model="tableForm.headerTextColor" class="grid-span-2 m_grid-span-1"
|
|
3347
|
-
label="Header Text Color"
|
|
3348
|
-
/>
|
|
3231
|
+
<div v-if="tableForm.showHeaders"
|
|
3232
|
+
class="grid-span-4 m_grid-span-2 grid-wrap-4 m_grid-wrap-2 grid gap-col-1 border-bottom pb-05 mb-05">
|
|
3233
|
+
<ColorInput v-model="tableForm.headerBgColor" class="grid-span-2 m_grid-span-1"
|
|
3234
|
+
label="Header Background Color" />
|
|
3235
|
+
<ColorInput v-model="tableForm.headerTextColor" class="grid-span-2 m_grid-span-1"
|
|
3236
|
+
label="Header Text Color" />
|
|
3349
3237
|
</div>
|
|
3350
|
-
<CheckInput
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
class="grid
|
|
3357
|
-
|
|
3358
|
-
<ColorInput
|
|
3359
|
-
v-model="tableForm.alternateRowBgColor" class="grid-span-2 m_grid-span-1"
|
|
3360
|
-
label="Alternate Row Background:"
|
|
3361
|
-
/>
|
|
3362
|
-
<ColorInput
|
|
3363
|
-
v-model="tableForm.alternateRowTextColor" class="grid-span-2 m_grid-span-1"
|
|
3364
|
-
label="Alternate Row Text:"
|
|
3365
|
-
/>
|
|
3238
|
+
<CheckInput v-model="tableForm.alternateRows" label="Alternating Row Colors"
|
|
3239
|
+
class="grid-span-4 m_grid-span-2" />
|
|
3240
|
+
<div v-if="tableForm.alternateRows"
|
|
3241
|
+
class="grid grid-wrap-4 m_grid-wrap-2 gap-col-1 grid-span-4 m_grid-span-2 border-bottom pb-05 mb-05">
|
|
3242
|
+
<ColorInput v-model="tableForm.alternateRowBgColor" class="grid-span-2 m_grid-span-1"
|
|
3243
|
+
label="Alternate Row Background:" />
|
|
3244
|
+
<ColorInput v-model="tableForm.alternateRowTextColor" class="grid-span-2 m_grid-span-1"
|
|
3245
|
+
label="Alternate Row Text:" />
|
|
3366
3246
|
</div>
|
|
3367
3247
|
</div>
|
|
3368
3248
|
<!-- Table Preview -->
|
|
@@ -3378,14 +3258,10 @@ defineExpose({
|
|
|
3378
3258
|
|
|
3379
3259
|
<template #footer>
|
|
3380
3260
|
<Btn value="Cancel" flat thin @click="showTableEditor = false" />
|
|
3381
|
-
<Btn
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
<Btn
|
|
3386
|
-
:value="pendingTableData?.existingTable ? 'Save' : 'Insert Table'" class="ms-auto"
|
|
3387
|
-
@click="submitTable"
|
|
3388
|
-
/>
|
|
3261
|
+
<Btn v-if="pendingTableData?.existingTable" value="Delete Table" color="red" flat thin icon="delete"
|
|
3262
|
+
@click="deleteTable" />
|
|
3263
|
+
<Btn :value="pendingTableData?.existingTable ? 'Save' : 'Insert Table'" class="ms-auto"
|
|
3264
|
+
@click="submitTable" />
|
|
3389
3265
|
</template>
|
|
3390
3266
|
</Modal>
|
|
3391
3267
|
</template>
|