@bagelink/vue 1.4.188 → 1.5.3
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/RouterWrapper.vue.d.ts +16 -1
- package/dist/components/RouterWrapper.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectBtn.vue.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.vue.d.ts.map +1 -1
- package/dist/index.cjs +15 -9
- package/dist/index.mjs +15 -9
- package/dist/style.css +1 -1
- package/dist/utils/BagelFormUtils.d.ts +16 -0
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/useSearch.d.ts +18 -1
- package/dist/utils/useSearch.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/RouterWrapper.vue +13 -12
- package/src/components/form/inputs/RichText/index.vue +279 -149
- package/src/components/form/inputs/SelectBtn.vue +3 -8
- package/src/components/layout/AppSidebar.vue +42 -29
- package/src/styles/layout.css +82 -2
- package/src/styles/mobilLayout.css +91 -1
- package/src/utils/BagelFormUtils.ts +43 -0
- package/src/utils/useSearch.ts +57 -2
|
@@ -416,8 +416,8 @@ function showInlineToolbarForSelection() {
|
|
|
416
416
|
const rangeClone = range.cloneRange()
|
|
417
417
|
inlineToolbarSelection.value = selection
|
|
418
418
|
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
// Store the cloned range for later use
|
|
420
|
+
; (inlineToolbarSelection.value as any)._storedRange = rangeClone
|
|
421
421
|
|
|
422
422
|
showInlineToolbar.value = true
|
|
423
423
|
}
|
|
@@ -1482,7 +1482,7 @@ function createNewTable(doc: Document) {
|
|
|
1482
1482
|
console.log('Trying to add edit button to new table...')
|
|
1483
1483
|
if (doc && (doc as any).__addEditButtonsToTables) {
|
|
1484
1484
|
console.log('Calling __addEditButtonsToTables...')
|
|
1485
|
-
|
|
1485
|
+
; (doc as any).__addEditButtonsToTables()
|
|
1486
1486
|
} else {
|
|
1487
1487
|
console.log('__addEditButtonsToTables not found, calling setupTableEditButtons...')
|
|
1488
1488
|
setupTableEditButtons(doc)
|
|
@@ -1584,13 +1584,13 @@ function deleteEmbed() {
|
|
|
1584
1584
|
|
|
1585
1585
|
// Expose openLinkModal to editor state
|
|
1586
1586
|
; (editor.state as any).openLinkModal = openLinkModal
|
|
1587
|
-
|
|
1587
|
+
; (editor.state as any).showTooltipMessage = showTooltipMessage
|
|
1588
1588
|
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1589
|
+
// Expose openTableEditor to editor state
|
|
1590
|
+
; (editor.state as any).openTableEditor = openTableEditor
|
|
1591
|
+
; (editor.state as any).openImageModal = openImageModal
|
|
1592
|
+
; (editor.state as any).openEmbedModal = openEmbedModal
|
|
1593
|
+
; (editor.state as any).openVideoModal = openVideoModal
|
|
1594
1594
|
|
|
1595
1595
|
// Table manipulation functions
|
|
1596
1596
|
function mergeCellRight() {
|
|
@@ -2509,15 +2509,24 @@ async function initEditor() {
|
|
|
2509
2509
|
isInitializing.value = true
|
|
2510
2510
|
|
|
2511
2511
|
try {
|
|
2512
|
+
// Get the --input-color CSS variable from the parent page
|
|
2513
|
+
const computedStyle = getComputedStyle(document.documentElement)
|
|
2514
|
+
const inputColor = computedStyle.getPropertyValue('--input-color').trim()
|
|
2515
|
+
const defaultTextColor = inputColor || 'inherit'
|
|
2516
|
+
|
|
2512
2517
|
// Use basic embedded styles for better compatibility
|
|
2518
|
+
// We copy CSS variables to the iframe so it can use them
|
|
2513
2519
|
const editorStylesContent = `
|
|
2520
|
+
:root {
|
|
2521
|
+
--input-color: ${inputColor || '#000'};
|
|
2522
|
+
}
|
|
2514
2523
|
body {
|
|
2515
2524
|
margin: 0;
|
|
2516
2525
|
padding: 8px;
|
|
2517
2526
|
min-height: 200px;
|
|
2518
2527
|
font-family: sans-serif !important;
|
|
2519
2528
|
line-height: 1.5;
|
|
2520
|
-
color: ${props.textColor || 'inherit'};
|
|
2529
|
+
color: ${props.textColor || (inputColor ? 'var(--input-color)' : 'inherit')};
|
|
2521
2530
|
background: transparent;
|
|
2522
2531
|
max-width: 1060px;
|
|
2523
2532
|
margin: 0 auto;
|
|
@@ -2535,6 +2544,9 @@ async function initEditor() {
|
|
|
2535
2544
|
th {
|
|
2536
2545
|
background-color: #f4f4f4;
|
|
2537
2546
|
}
|
|
2547
|
+
p{
|
|
2548
|
+
margin: 0 0 0.5em 0;
|
|
2549
|
+
}
|
|
2538
2550
|
|
|
2539
2551
|
/* Table edit button styles */
|
|
2540
2552
|
.table-edit-btn {
|
|
@@ -2904,28 +2916,38 @@ defineExpose({
|
|
|
2904
2916
|
<div class="bagel-input" v-bind="attrs">
|
|
2905
2917
|
<label v-if="label">{{ label }}</label>
|
|
2906
2918
|
|
|
2907
|
-
<div
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2919
|
+
<div
|
|
2920
|
+
class="rounded" :class="[
|
|
2921
|
+
{
|
|
2922
|
+
'rich-text-editor pt-05 px-05 pb-075': !basic,
|
|
2923
|
+
'rich-text-editor--basic': basic,
|
|
2924
|
+
'fullscreen-mode': editor.state.isFullscreen,
|
|
2925
|
+
},
|
|
2926
|
+
]"
|
|
2927
|
+
>
|
|
2928
|
+
<EditorToolbar
|
|
2929
|
+
v-if="editor.state.hasInit && shouldShowToolbar" :config="effectiveToolbarConfig"
|
|
2915
2930
|
:selectedStyles="editor.state.selectedStyles" :hide-images="hideImages" :hide-videos="hideVideos"
|
|
2916
2931
|
:hide-embeds="hideEmbed" :hide-tables="hideTables" :hide-alignment="hideAlignment"
|
|
2917
2932
|
:hide-directions="hideDirections" :hide-h5-h6="hideH5H6" :hide="effectiveHideArray"
|
|
2918
|
-
@action="commands.execute"
|
|
2933
|
+
@action="commands.execute"
|
|
2934
|
+
/>
|
|
2919
2935
|
<div class="editor-container" :class="{ 'split-view': editor.state.isSplitView }">
|
|
2920
|
-
<div
|
|
2921
|
-
|
|
2922
|
-
|
|
2936
|
+
<div
|
|
2937
|
+
class="content-area radius-1"
|
|
2938
|
+
:style="{ height: editor.state.isFullscreen ? 'calc(100vh - 4rem)' : editorHeight }"
|
|
2939
|
+
>
|
|
2940
|
+
<iframe
|
|
2941
|
+
id="rich-text-iframe" ref="iframe" class="editableContent" title="Editor" srcdoc=""
|
|
2923
2942
|
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"
|
|
2924
|
-
@load="initEditor" @contextmenu="handleTableContextMenu"
|
|
2943
|
+
@load="initEditor" @contextmenu="handleTableContextMenu"
|
|
2944
|
+
/>
|
|
2925
2945
|
</div>
|
|
2926
|
-
<CodeEditor
|
|
2946
|
+
<CodeEditor
|
|
2947
|
+
v-if="editor.state.isSplitView" v-model="editor.state.content" language="html"
|
|
2927
2948
|
:height="editor.state.isFullscreen ? 'calc(100vh - 4rem)' : editorHeight"
|
|
2928
|
-
@update:modelValue="editor.updateState.content('html')"
|
|
2949
|
+
@update:modelValue="editor.updateState.content('html')"
|
|
2950
|
+
/>
|
|
2929
2951
|
</div>
|
|
2930
2952
|
<div v-if="debug" class="flex pt-05">
|
|
2931
2953
|
<p class="txt12 txt-gray mb-0 p-0">
|
|
@@ -2940,39 +2962,51 @@ defineExpose({
|
|
|
2940
2962
|
<Btn thin color="gray" icon="download" @click="debugMethods?.downloadSession">
|
|
2941
2963
|
Download Log
|
|
2942
2964
|
</Btn>
|
|
2943
|
-
<Btn
|
|
2944
|
-
|
|
2965
|
+
<Btn
|
|
2966
|
+
thin color="gray" icon="content_copy"
|
|
2967
|
+
@click="copyText(debugMethods?.exportDebugWithPrompt() || '')"
|
|
2968
|
+
>
|
|
2945
2969
|
Copy Log
|
|
2946
2970
|
</Btn>
|
|
2947
2971
|
</div>
|
|
2948
2972
|
</div>
|
|
2949
2973
|
|
|
2950
2974
|
<!-- Inline Toolbar -->
|
|
2951
|
-
<div
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2975
|
+
<div
|
|
2976
|
+
v-if="showInlineToolbar" class="inline-toolbar" :style="{
|
|
2977
|
+
position: 'fixed',
|
|
2978
|
+
top: `${inlineToolbarPosition.top}px`,
|
|
2979
|
+
left: `${inlineToolbarPosition.left}px`,
|
|
2980
|
+
zIndex: 99,
|
|
2981
|
+
}"
|
|
2982
|
+
>
|
|
2957
2983
|
<div class="inline-toolbar-content">
|
|
2958
|
-
<Btn
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
<Btn
|
|
2984
|
+
<Btn
|
|
2985
|
+
thin flat icon="format_bold" :class="{ active: editor.state.selectedStyles.has('bold') }"
|
|
2986
|
+
@click="runInlineAction('bold')"
|
|
2987
|
+
/>
|
|
2988
|
+
<Btn
|
|
2989
|
+
thin flat icon="format_italic" :class="{ active: editor.state.selectedStyles.has('italic') }"
|
|
2990
|
+
@click="runInlineAction('italic')"
|
|
2991
|
+
/>
|
|
2992
|
+
<Btn
|
|
2993
|
+
thin flat icon="format_underlined"
|
|
2963
2994
|
:class="{ active: editor.state.selectedStyles.has('underline') }"
|
|
2964
|
-
@click="runInlineAction('underline')"
|
|
2995
|
+
@click="runInlineAction('underline')"
|
|
2996
|
+
/>
|
|
2965
2997
|
<span class="separator">|</span>
|
|
2966
2998
|
<Btn thin flat icon="add_link" @click="runInlineAction('link')" />
|
|
2967
2999
|
</div>
|
|
2968
3000
|
</div>
|
|
2969
3001
|
<!-- Table Context Menu -->
|
|
2970
|
-
<div
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
3002
|
+
<div
|
|
3003
|
+
v-if="showTableContextMenu" class="table-context-menu" :style="{
|
|
3004
|
+
position: 'fixed',
|
|
3005
|
+
top: `${contextMenuPosition.y}px`,
|
|
3006
|
+
left: `${contextMenuPosition.x}px`,
|
|
3007
|
+
zIndex: 1001,
|
|
3008
|
+
}"
|
|
3009
|
+
>
|
|
2976
3010
|
<div class="context-menu-content" @click.stop>
|
|
2977
3011
|
<div class="menu-header">
|
|
2978
3012
|
<span>Table Actions</span>
|
|
@@ -2981,42 +3015,60 @@ defineExpose({
|
|
|
2981
3015
|
</button>
|
|
2982
3016
|
</div>
|
|
2983
3017
|
<div class="px-025">
|
|
2984
|
-
<Btn
|
|
2985
|
-
|
|
3018
|
+
<Btn
|
|
3019
|
+
v-if="canMergeRight" full-width align-txt="start" thin flat icon="start"
|
|
3020
|
+
class="context-menu-btn" @click="mergeCellRight(); showTableContextMenu = false"
|
|
3021
|
+
>
|
|
2986
3022
|
Merge Right
|
|
2987
3023
|
</Btn>
|
|
2988
|
-
<Btn
|
|
2989
|
-
|
|
3024
|
+
<Btn
|
|
3025
|
+
v-if="canMergeDown" full-width align-txt="start" thin flat icon="text_select_move_down"
|
|
3026
|
+
class="context-menu-btn" @click="mergeCellDown(); showTableContextMenu = false"
|
|
3027
|
+
>
|
|
2990
3028
|
Merge Down
|
|
2991
3029
|
</Btn>
|
|
2992
|
-
<Btn
|
|
2993
|
-
|
|
3030
|
+
<Btn
|
|
3031
|
+
v-if="canSplit" full-width align-txt="start" thin flat icon="call_split"
|
|
3032
|
+
class="context-menu-btn" @click="splitCell(); showTableContextMenu = false"
|
|
3033
|
+
>
|
|
2994
3034
|
Split Cell
|
|
2995
3035
|
</Btn>
|
|
2996
3036
|
<div v-if="canMergeRight || canMergeDown || canSplit" class="context-menu-separator" />
|
|
2997
|
-
<Btn
|
|
2998
|
-
|
|
3037
|
+
<Btn
|
|
3038
|
+
full-width align-txt="start" thin flat icon="add_row_above" class="context-menu-btn"
|
|
3039
|
+
@click="insertRowAbove(); showTableContextMenu = false"
|
|
3040
|
+
>
|
|
2999
3041
|
Insert Row Above
|
|
3000
3042
|
</Btn>
|
|
3001
|
-
<Btn
|
|
3002
|
-
|
|
3043
|
+
<Btn
|
|
3044
|
+
full-width align-txt="start" thin flat icon="add_row_below" class="context-menu-btn"
|
|
3045
|
+
@click="insertRowBelow(); showTableContextMenu = false"
|
|
3046
|
+
>
|
|
3003
3047
|
Insert Row Below
|
|
3004
3048
|
</Btn>
|
|
3005
|
-
<Btn
|
|
3006
|
-
|
|
3049
|
+
<Btn
|
|
3050
|
+
full-width align-txt="start" thin flat icon="remove" class="context-menu-btn"
|
|
3051
|
+
@click="deleteRow(); showTableContextMenu = false"
|
|
3052
|
+
>
|
|
3007
3053
|
Delete Row
|
|
3008
3054
|
</Btn>
|
|
3009
3055
|
<div class="context-menu-separator" />
|
|
3010
|
-
<Btn
|
|
3011
|
-
|
|
3056
|
+
<Btn
|
|
3057
|
+
full-width align-txt="start" thin flat icon="add_column_left" class="context-menu-btn"
|
|
3058
|
+
@click="insertColumnLeft(); showTableContextMenu = false"
|
|
3059
|
+
>
|
|
3012
3060
|
Insert Column Left
|
|
3013
3061
|
</Btn>
|
|
3014
|
-
<Btn
|
|
3015
|
-
|
|
3062
|
+
<Btn
|
|
3063
|
+
full-width align-txt="start" thin flat icon="add_column_right" class="context-menu-btn"
|
|
3064
|
+
@click="insertColumnRight(); showTableContextMenu = false"
|
|
3065
|
+
>
|
|
3016
3066
|
Insert Column Right
|
|
3017
3067
|
</Btn>
|
|
3018
|
-
<Btn
|
|
3019
|
-
|
|
3068
|
+
<Btn
|
|
3069
|
+
full-width align-txt="start" thin flat icon="remove" class="context-menu-btn"
|
|
3070
|
+
@click="deleteColumn(); showTableContextMenu = false"
|
|
3071
|
+
>
|
|
3020
3072
|
Delete Column
|
|
3021
3073
|
</Btn>
|
|
3022
3074
|
</div>
|
|
@@ -3026,10 +3078,14 @@ defineExpose({
|
|
|
3026
3078
|
<!-- Link Modal -->
|
|
3027
3079
|
<Modal v-model:visible="showLinkModal" title="Add Link" width="400">
|
|
3028
3080
|
<div class="flex gap-05 align-items-end">
|
|
3029
|
-
<TextInput
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3081
|
+
<TextInput
|
|
3082
|
+
v-model="linkForm.url" label="URL" type="url" placeholder="https://example.com"
|
|
3083
|
+
@keydown.enter="submitLink"
|
|
3084
|
+
/>
|
|
3085
|
+
<Btn
|
|
3086
|
+
icon="open_in_new" class="mb-05 radius-1" flat :disabled="!isValidUrl(linkForm.url)"
|
|
3087
|
+
@click="visitLink"
|
|
3088
|
+
/>
|
|
3033
3089
|
</div>
|
|
3034
3090
|
<CheckInput v-model="linkForm.openInNewTab" label="Open in new tab" type="checkbox" class="mb-2 mt-05" />
|
|
3035
3091
|
<template #footer>
|
|
@@ -3044,36 +3100,54 @@ defineExpose({
|
|
|
3044
3100
|
</div>
|
|
3045
3101
|
|
|
3046
3102
|
<!-- Image Modal -->
|
|
3047
|
-
<Modal
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3103
|
+
<Modal
|
|
3104
|
+
v-model:visible="showImageModal" :title="pendingImageData?.existingImage ? 'Edit Image' : 'Insert Image'"
|
|
3105
|
+
width="500"
|
|
3106
|
+
>
|
|
3107
|
+
<TextInput
|
|
3108
|
+
v-model="imageForm.src" label="Image URL" type="url" placeholder="https://example.com/image.jpg"
|
|
3109
|
+
@keydown.enter="submitImage"
|
|
3110
|
+
/>
|
|
3051
3111
|
<TextInput v-model="imageForm.alt" label="Alt Text" placeholder="Describe the image" />
|
|
3052
3112
|
<div class="flex gap-1">
|
|
3053
|
-
<TextInput
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3113
|
+
<TextInput
|
|
3114
|
+
v-model="imageForm.width" label="Width" placeholder="100% or 500px or auto"
|
|
3115
|
+
help="Examples: 100%, 500px, auto"
|
|
3116
|
+
/>
|
|
3117
|
+
<TextInput
|
|
3118
|
+
v-model="imageForm.height" label="Height" placeholder="auto or 300px"
|
|
3119
|
+
help="Examples: auto, 300px"
|
|
3120
|
+
/>
|
|
3057
3121
|
</div>
|
|
3058
3122
|
<TextInput v-model="imageForm.credit" label="Photo Credit" placeholder="Photographer name (optional)" />
|
|
3059
|
-
<CheckInput
|
|
3060
|
-
|
|
3123
|
+
<CheckInput
|
|
3124
|
+
v-model="imageForm.figcaption" label="Show alt text as caption"
|
|
3125
|
+
help="Photo credit will always be shown if provided"
|
|
3126
|
+
/>
|
|
3061
3127
|
<template #footer>
|
|
3062
3128
|
<div class="flex gap-05 w-100 ">
|
|
3063
3129
|
<Btn value="Cancel" flat thin @click="showImageModal = false" />
|
|
3064
|
-
<Btn
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3130
|
+
<Btn
|
|
3131
|
+
v-if="pendingImageData?.existingImage" value="Delete Image" color="red" flat thin icon="delete"
|
|
3132
|
+
@click="deleteImage"
|
|
3133
|
+
/>
|
|
3134
|
+
<Btn
|
|
3135
|
+
class="ms-auto" :value="pendingImageData?.existingImage ? 'Save Changes' : 'Insert Image'"
|
|
3136
|
+
:disabled="!imageForm.src" @click="submitImage"
|
|
3137
|
+
/>
|
|
3068
3138
|
</div>
|
|
3069
3139
|
</template>
|
|
3070
3140
|
</Modal>
|
|
3071
3141
|
|
|
3072
3142
|
<!-- Embed Modal -->
|
|
3073
|
-
<Modal
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3143
|
+
<Modal
|
|
3144
|
+
v-model:visible="showEmbedModal" :title="pendingEmbedData?.existingEmbed ? 'Edit Embed' : 'Insert Embed'"
|
|
3145
|
+
width="500"
|
|
3146
|
+
>
|
|
3147
|
+
<TextInput
|
|
3148
|
+
v-model="embedForm.src" label="Embed URL or Code" type="url"
|
|
3149
|
+
placeholder="https://www.youtube.com/embed/... or paste iframe code" @keydown.enter="submitEmbed"
|
|
3150
|
+
/>
|
|
3077
3151
|
<div class="flex gap-1">
|
|
3078
3152
|
<TextInput v-model="embedForm.width" label="Width" placeholder="560" />
|
|
3079
3153
|
<TextInput v-model="embedForm.height" label="Height" placeholder="315" />
|
|
@@ -3082,19 +3156,25 @@ defineExpose({
|
|
|
3082
3156
|
<template #footer>
|
|
3083
3157
|
<div class="flex gap-05 w-100">
|
|
3084
3158
|
<Btn value="Cancel" flat thin @click="showEmbedModal = false" />
|
|
3085
|
-
<Btn
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3159
|
+
<Btn
|
|
3160
|
+
v-if="pendingEmbedData?.existingEmbed" value="Delete Embed" color="red" flat thin icon="delete"
|
|
3161
|
+
@click="deleteEmbed"
|
|
3162
|
+
/>
|
|
3163
|
+
<Btn
|
|
3164
|
+
:value="pendingEmbedData?.existingEmbed ? 'Save Changes' : 'Insert Embed'"
|
|
3165
|
+
:disabled="!embedForm.src" class="ms-auto" @click="submitEmbed"
|
|
3166
|
+
/>
|
|
3089
3167
|
</div>
|
|
3090
3168
|
</template>
|
|
3091
3169
|
</Modal>
|
|
3092
3170
|
<!-- Video Modal -->
|
|
3093
3171
|
<Modal v-model:visible="showVideoModal" title="Insert Video" width="500">
|
|
3094
3172
|
<div class="grid gap-0">
|
|
3095
|
-
<TextInput
|
|
3173
|
+
<TextInput
|
|
3174
|
+
v-model="videoForm.src" label="Video URL or Embed Code" type="url"
|
|
3096
3175
|
placeholder="Paste YouTube URL, video file URL, or iframe embed code..."
|
|
3097
|
-
:class="{ error: videoForm.src && !isValidVideoUrl(videoForm.src) }" @keydown.enter="submitVideo"
|
|
3176
|
+
:class="{ error: videoForm.src && !isValidVideoUrl(videoForm.src) }" @keydown.enter="submitVideo"
|
|
3177
|
+
/>
|
|
3098
3178
|
|
|
3099
3179
|
<div v-if="videoForm.src && !isValidVideoUrl(videoForm.src)" class="flex gap-025 opacity-5 -mt-05">
|
|
3100
3180
|
<Icon name="warning" />
|
|
@@ -3103,17 +3183,21 @@ defineExpose({
|
|
|
3103
3183
|
</p>
|
|
3104
3184
|
</div>
|
|
3105
3185
|
|
|
3106
|
-
<TextInput
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3186
|
+
<TextInput
|
|
3187
|
+
v-model="videoForm.width" label="Width" placeholder="100% or 500px or 50vw"
|
|
3188
|
+
help="Examples: 100%, 500px, 50vw, 300"
|
|
3189
|
+
/>
|
|
3190
|
+
|
|
3191
|
+
<SelectInput
|
|
3192
|
+
v-model="videoForm.aspectRatio" label="Aspect Ratio" :options="[
|
|
3193
|
+
{ value: '16:9', label: '16:9 (Standard)' },
|
|
3194
|
+
{ value: '4:3', label: '4:3 (Classic)' },
|
|
3195
|
+
{ value: '9:16', label: '9:16 (Vertical/Shorts)' },
|
|
3196
|
+
{ value: '21:9', label: '21:9 (Cinematic)' },
|
|
3197
|
+
{ value: '1:1', label: '1:1 (Square)' },
|
|
3198
|
+
{ value: 'custom', label: 'Custom' },
|
|
3199
|
+
]"
|
|
3200
|
+
/>
|
|
3117
3201
|
|
|
3118
3202
|
<div v-if="videoForm.aspectRatio === 'custom'" class="grid grid-wrap-2 gap-05">
|
|
3119
3203
|
<TextInput v-model="videoForm.customWidth" label="Width ratio" placeholder="16" type="number" />
|
|
@@ -3126,8 +3210,10 @@ defineExpose({
|
|
|
3126
3210
|
<CheckInput v-model="videoForm.mute" label="Mute" />
|
|
3127
3211
|
<CheckInput v-model="videoForm.loop" label="Loop" />
|
|
3128
3212
|
<CheckInput v-model="videoForm.showCaption" class="grid-span-2" label="Show caption below video" />
|
|
3129
|
-
<TextInput
|
|
3130
|
-
|
|
3213
|
+
<TextInput
|
|
3214
|
+
v-if="videoForm.showCaption" v-model="videoForm.caption" label="Caption" class="grid-span-2"
|
|
3215
|
+
placeholder="Describe the video content"
|
|
3216
|
+
/>
|
|
3131
3217
|
</div>
|
|
3132
3218
|
|
|
3133
3219
|
<!-- Video Preview -->
|
|
@@ -3136,27 +3222,35 @@ defineExpose({
|
|
|
3136
3222
|
Preview:
|
|
3137
3223
|
</p>
|
|
3138
3224
|
<div class="overflow-hidden flex justify-content-center">
|
|
3139
|
-
<BglVideo
|
|
3225
|
+
<BglVideo
|
|
3226
|
+
:src="videoForm.src" class=""
|
|
3140
3227
|
:aspect-ratio="videoForm.aspectRatio === 'custom' && videoForm.customWidth && videoForm.customHeight ? `${videoForm.customWidth}:${videoForm.customHeight}` : videoForm.aspectRatio"
|
|
3141
3228
|
:autoplay="false" :mute="videoForm.mute" :controls="videoForm.controls"
|
|
3142
|
-
:loop="videoForm.loop"
|
|
3229
|
+
:loop="videoForm.loop"
|
|
3230
|
+
/>
|
|
3143
3231
|
</div>
|
|
3144
3232
|
</Card>
|
|
3145
3233
|
</div>
|
|
3146
3234
|
<template #footer>
|
|
3147
3235
|
<div class="flex gap-05 w-100 ">
|
|
3148
3236
|
<Btn value="Cancel" flat thin @click="showVideoModal = false" />
|
|
3149
|
-
<Btn
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3237
|
+
<Btn
|
|
3238
|
+
v-if="pendingVideoData?.existingVideo" value="Delete Video" color="red" flat thin icon="delete"
|
|
3239
|
+
@click="deleteVideo"
|
|
3240
|
+
/>
|
|
3241
|
+
<Btn
|
|
3242
|
+
value="Insert Video" class="ms-auto" :disabled="!videoForm.src || !isValidVideoUrl(videoForm.src)"
|
|
3243
|
+
@click="submitVideo"
|
|
3244
|
+
/>
|
|
3153
3245
|
</div>
|
|
3154
3246
|
</template>
|
|
3155
3247
|
</Modal>
|
|
3156
3248
|
|
|
3157
3249
|
<!-- Table Editor Modal -->
|
|
3158
|
-
<Modal
|
|
3159
|
-
|
|
3250
|
+
<Modal
|
|
3251
|
+
v-model:visible="showTableEditor" :title="pendingTableData?.existingTable ? 'Edit Table' : 'Insert Table'"
|
|
3252
|
+
width="700"
|
|
3253
|
+
>
|
|
3160
3254
|
<template #default>
|
|
3161
3255
|
<div class="grid grid-wrap-4 m_grid-wrap-2 gap-col-1 table-editor testMe1">
|
|
3162
3256
|
<!-- Structure Section -->
|
|
@@ -3172,26 +3266,40 @@ defineExpose({
|
|
|
3172
3266
|
<!-- Cell Text Alignment -->
|
|
3173
3267
|
<div class="grid-span-1">
|
|
3174
3268
|
<label class="label">Cell Text Alignment</label>
|
|
3175
|
-
<div
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
<Btn
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3269
|
+
<div
|
|
3270
|
+
class="flex gap-025 mt-025 radius-1 p-05 w-fit"
|
|
3271
|
+
style="height: var(--input-height); background: var(--input-bg);"
|
|
3272
|
+
>
|
|
3273
|
+
<Btn
|
|
3274
|
+
:class="{ activeBtn: tableForm.alignment === 'left' }" flat thin icon="format_align_left"
|
|
3275
|
+
title="Align Left" @click="tableForm.alignment = 'left'"
|
|
3276
|
+
/>
|
|
3277
|
+
<Btn
|
|
3278
|
+
:class="{ activeBtn: tableForm.alignment === 'center' }" flat thin
|
|
3279
|
+
icon="format_align_center" title="Align Center" @click="tableForm.alignment = 'center'"
|
|
3280
|
+
/>
|
|
3281
|
+
<Btn
|
|
3282
|
+
:class="{ activeBtn: tableForm.alignment === 'right' }" flat thin icon="format_align_right"
|
|
3283
|
+
title="Align Right" @click="tableForm.alignment = 'right'"
|
|
3284
|
+
/>
|
|
3183
3285
|
</div>
|
|
3184
3286
|
</div>
|
|
3185
3287
|
|
|
3186
3288
|
<!-- Text Direction -->
|
|
3187
3289
|
<div class="grid-span-1">
|
|
3188
3290
|
<label class="label">Text Direction</label>
|
|
3189
|
-
<div
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
<Btn
|
|
3194
|
-
|
|
3291
|
+
<div
|
|
3292
|
+
class="flex gap-025 mt-025 radius-1 p-025 w-fit"
|
|
3293
|
+
style="height: var(--input-height); background: var(--input-bg);"
|
|
3294
|
+
>
|
|
3295
|
+
<Btn
|
|
3296
|
+
:class="{ activeBtn: tableForm.direction === 'ltr' }" flat thin value="LTR"
|
|
3297
|
+
title="Left to Right" @click="tableForm.direction = 'ltr'"
|
|
3298
|
+
/>
|
|
3299
|
+
<Btn
|
|
3300
|
+
:class="{ activeBtn: tableForm.direction === 'rtl' }" flat thin value="RTL"
|
|
3301
|
+
title="Right to Left" @click="tableForm.direction = 'rtl'"
|
|
3302
|
+
/>
|
|
3195
3303
|
</div>
|
|
3196
3304
|
</div>
|
|
3197
3305
|
<!-- Style Section -->
|
|
@@ -3206,8 +3314,10 @@ defineExpose({
|
|
|
3206
3314
|
<NumberInput v-model="tableForm.cellPadding" label="Cell Padding (px)" :min="2" :max="20" />
|
|
3207
3315
|
<NumberInput v-model="tableForm.borderWidth" label="Border Width (px)" :min="0" :max="5" />
|
|
3208
3316
|
<ColorInput v-model="tableForm.borderColor" label="Border Color" />
|
|
3209
|
-
<CheckInput
|
|
3210
|
-
|
|
3317
|
+
<CheckInput
|
|
3318
|
+
v-model="tableForm.fixedLayout" label="Fixed cell width (doesn't change by content)"
|
|
3319
|
+
class="grid-span-4 m_grid-span-2"
|
|
3320
|
+
/>
|
|
3211
3321
|
|
|
3212
3322
|
<!-- Cell Colors -->
|
|
3213
3323
|
<div class="flex gap-05 white-space mt-0 grid-span-4 m_grid-span-2 pt-1 pb-05">
|
|
@@ -3217,8 +3327,10 @@ defineExpose({
|
|
|
3217
3327
|
</p>
|
|
3218
3328
|
<div class="line" />
|
|
3219
3329
|
</div>
|
|
3220
|
-
<ColorInput
|
|
3221
|
-
|
|
3330
|
+
<ColorInput
|
|
3331
|
+
v-model="tableForm.cellBgColor" class="grid-span-2 m_grid-span-1"
|
|
3332
|
+
label="Background Color"
|
|
3333
|
+
/>
|
|
3222
3334
|
<ColorInput v-model="tableForm.cellTextColor" class="grid-span-2 m_grid-span-1" label="Text Color" />
|
|
3223
3335
|
<!-- Alternating Rows -->
|
|
3224
3336
|
<div class="flex gap-05 white-space mt-0 grid-span-4 m_grid-span-2 pt-1 pb-05">
|
|
@@ -3230,21 +3342,35 @@ defineExpose({
|
|
|
3230
3342
|
</div>
|
|
3231
3343
|
<CheckInput v-model="tableForm.showHeaders" label="Show header row" class="grid-span-4 m_grid-span-2" />
|
|
3232
3344
|
<!-- Header Colors -->
|
|
3233
|
-
<div
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
<ColorInput
|
|
3238
|
-
|
|
3345
|
+
<div
|
|
3346
|
+
v-if="tableForm.showHeaders"
|
|
3347
|
+
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"
|
|
3348
|
+
>
|
|
3349
|
+
<ColorInput
|
|
3350
|
+
v-model="tableForm.headerBgColor" class="grid-span-2 m_grid-span-1"
|
|
3351
|
+
label="Header Background Color"
|
|
3352
|
+
/>
|
|
3353
|
+
<ColorInput
|
|
3354
|
+
v-model="tableForm.headerTextColor" class="grid-span-2 m_grid-span-1"
|
|
3355
|
+
label="Header Text Color"
|
|
3356
|
+
/>
|
|
3239
3357
|
</div>
|
|
3240
|
-
<CheckInput
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3358
|
+
<CheckInput
|
|
3359
|
+
v-model="tableForm.alternateRows" label="Alternating Row Colors"
|
|
3360
|
+
class="grid-span-4 m_grid-span-2"
|
|
3361
|
+
/>
|
|
3362
|
+
<div
|
|
3363
|
+
v-if="tableForm.alternateRows"
|
|
3364
|
+
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"
|
|
3365
|
+
>
|
|
3366
|
+
<ColorInput
|
|
3367
|
+
v-model="tableForm.alternateRowBgColor" class="grid-span-2 m_grid-span-1"
|
|
3368
|
+
label="Alternate Row Background:"
|
|
3369
|
+
/>
|
|
3370
|
+
<ColorInput
|
|
3371
|
+
v-model="tableForm.alternateRowTextColor" class="grid-span-2 m_grid-span-1"
|
|
3372
|
+
label="Alternate Row Text:"
|
|
3373
|
+
/>
|
|
3248
3374
|
</div>
|
|
3249
3375
|
</div>
|
|
3250
3376
|
<!-- Table Preview -->
|
|
@@ -3260,10 +3386,14 @@ defineExpose({
|
|
|
3260
3386
|
|
|
3261
3387
|
<template #footer>
|
|
3262
3388
|
<Btn value="Cancel" flat thin @click="showTableEditor = false" />
|
|
3263
|
-
<Btn
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3389
|
+
<Btn
|
|
3390
|
+
v-if="pendingTableData?.existingTable" value="Delete Table" color="red" flat thin icon="delete"
|
|
3391
|
+
@click="deleteTable"
|
|
3392
|
+
/>
|
|
3393
|
+
<Btn
|
|
3394
|
+
:value="pendingTableData?.existingTable ? 'Save' : 'Insert Table'" class="ms-auto"
|
|
3395
|
+
@click="submitTable"
|
|
3396
|
+
/>
|
|
3267
3397
|
</template>
|
|
3268
3398
|
</Modal>
|
|
3269
3399
|
</template>
|
|
@@ -3276,7 +3406,7 @@ defineExpose({
|
|
|
3276
3406
|
.rich-text-editor--basic .content-area {
|
|
3277
3407
|
background: var(--input-bg) !important;
|
|
3278
3408
|
border: none;
|
|
3279
|
-
padding: 0 0.7rem;
|
|
3409
|
+
/* padding: 0 0.7rem; */
|
|
3280
3410
|
border-radius: var(--input-border-radius);
|
|
3281
3411
|
color: var(--input-color);
|
|
3282
3412
|
min-width: calc(var(--input-height) * 3);
|