Skip to content

Commit

Permalink
fix: Announcement: update editor styles, link target on text
Browse files Browse the repository at this point in the history
  • Loading branch information
aqordeon committed Dec 11, 2024
1 parent cd51ad6 commit 98803c2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
8 changes: 4 additions & 4 deletions resources/js/Components/CMS/Fields/MultiEditorInputHTML.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ const transitionList = [
</div>

<div class="mt-6 text-sm text-gray-500 mb-2">{{ trans('Text list') }}</div>
<div class="grid gap-y-4">
<div v-for="(text, idxText) in model?.multi_text" :key="'texteditor_' + idxText + model?.multi_text?.length" class="flex items-center gap-x-1">
<div class="flex flex-col gap-y-4 ">
<div v-for="(text, idxText) in model?.multi_text" :key="'texteditor_' + idxText + model?.multi_text?.length" class="flex items-center gap-x-1 w-full">
<Editor2 :modelValue="text" @update:modelValue="(e) => set(model, ['multi_text', idxText], e)" v-bind="$attrs">
<template #editor-content="{ editor }">
<div
class="editor-wrapper border-2 border-gray-300 rounded px-3 py-2 shadow-sm focus-within:border-blue-400">
class="bg-gray-200 editor-wrapper border-2 border-gray-300 rounded px-3 py-2 shadow-sm focus-within:border-blue-400">
<EditorContent :editor="editor" class="editor-content focus:outline-none" />
</div>
</template>
</Editor2>

<div @click="(event)=>togglePopover(event,idxText)" class="px-1 py-1 text-red-400 hover:text-white cursor-pointer border border-transparent hover:bg-red-500 rounded">
<div @click="(event)=>togglePopover(event,idxText)" class="px-1 py-1 text-red-400 hover:text-white cursor-pointer border border-transparent hover:bg-red-500 rounded">
<FontAwesomeIcon icon='fal fa-trash-alt' class='' fixed-width aria-hidden='true' />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/CMS/Fields/SideEditorInputHTML.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defineOptions({
v-bind="$attrs"
>
<template #editor-content="{ editor }">
<div class="editor-wrapper border-2 border-gray-300 rounded-lg px-3 py-2 shadow-sm focus-within:border-blue-400">
<div class="bg-gray-200 editor-wrapper border-2 border-gray-300 rounded-lg px-3 py-2 shadow-sm focus-within:border-blue-400">
<EditorContent :editor="editor" class="editor-content focus:outline-none" />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/Editor/TiptapLinkDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ onMounted(() => {
<div class="flex flex-col space-y-5">
<div>
<div class="select-none text-sm text-gray-600 mb-2">Link</div>
<PureInput type="url" id="input-link-url" v-model="inputLinkRef" />
<PureInput type="url" id="input-link-url" v-model="inputLinkRef" placeholder="https://wowsbar.com" />
</div>
<div>
<div class="select-none text-sm text-gray-600 mb-2">Target</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,15 @@ const irisVariablesList = [
</TiptapToolbarButton> -->

<TiptapToolbarButton v-if="toogle.includes('color')" label="Text Color">
<div class="relative w-7 h-7">
<div class="relative w-8 h-8 ">
<!-- Color Input -->
<input type="color" class="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
@input="editorInstance?.chain().focus().setColor($event.target.value).run()"
:value="editorInstance.getAttributes('textStyle').color" />
:value="editorInstance.getAttributes('textStyle').color"
/>
<!-- Icon -->
<div class="flex items-center justify-center w-full h-full rounded"
:style="{ color: editorInstance.getAttributes('textStyle').color || 'gray'}"
<div class="flex items-center justify-center w-full h-full border border-gray-200 shadow rounded"
:style="{ color: editorInstance.getAttributes('textStyle').color || 'gray'}"
>
<FontAwesomeIcon :icon="faTint" />
</div>
Expand All @@ -435,7 +436,7 @@ const irisVariablesList = [
@input="editorInstance.chain().focus().setHighlight({ color: $event.target.value }).run()"
:value="editorInstance.getAttributes('highlight').color" />
<!-- Icon -->
<div class="flex items-center justify-center w-full h-full shadow rounded"
<div class="flex items-center justify-center w-full h-full border border-gray-200 shadow rounded"
:style="{ backgroundColor: editorInstance?.getAttributes('highlight').color}"
>
<FontAwesomeIcon :icon="faPaintBrushAlt" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const props = defineProps<{
duration: number
multi_text: string[]
}
button_1: {
text: string
container: {
properties: BlockProperties
}
}
// button_1: {
// text: string
// container: {
// properties: BlockProperties
// }
// }
countdown: {
date: string
expired_text?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ const defaultFieldsData = {
"button_1": {
"link": {
"type" : "internal",
"url": "https://ancientwisdom.biz/showroom",
"href": "https://wowsbar.com",
"id": 9,
"workshop_route" : ""
"workshop_route" : "",
"target": "_blank"
},
"text": '<span style="font-size: 10px"><strong>Claim Now!</strong></span>',
"text": 'Claim Now!',
"container": {
"properties": {
"text": {
Expand Down Expand Up @@ -386,7 +387,7 @@ defineExpose({

</div>

<button
<a
v-if="announcementData?.fields?.button_1?.text"
@click="() => (onClickClose(), onClickOpenFieldWorkshop(2))"
:href="announcementData?.fields.button_1.link.href || '#'"
Expand All @@ -395,8 +396,9 @@ defineExpose({
class="inline-flex items-center announcement-component-editable"
:style="propertiesToHTMLStyle(announcementData?.fields.button_1?.container?.properties)"
>
</button>
</a>
</div>
<pre>{{ announcementData?.fields?.button_1 }}</pre>

<!-- <pre>{{defaultFieldsData?.button_1?.container?.properties}}</pre> -->

Expand Down

0 comments on commit 98803c2

Please sign in to comment.