Making things looks nicer. Various fixes.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
|
import { fade } from 'svelte/transition'
|
||||||
import { Color } from '@tiptap/extension-color'
|
import { Color } from '@tiptap/extension-color'
|
||||||
import ListItem from '@tiptap/extension-list-item'
|
import ListItem from '@tiptap/extension-list-item'
|
||||||
import TextStyle from '@tiptap/extension-text-style'
|
import TextStyle from '@tiptap/extension-text-style'
|
||||||
@@ -11,6 +12,7 @@ import { Editor } from "@tiptap/core";
|
|||||||
// import Typography from '@tiptap/extension-typography' ????
|
// import Typography from '@tiptap/extension-typography' ????
|
||||||
|
|
||||||
import "./element_tiptap_editor.scss";
|
import "./element_tiptap_editor.scss";
|
||||||
|
import { cubicOut } from 'svelte/easing';
|
||||||
|
|
||||||
// https://tiptap.dev/docs/examples/basics/default-text-editor
|
// https://tiptap.dev/docs/examples/basics/default-text-editor
|
||||||
// https://tiptap.dev/docs/examples/basics/formatting
|
// https://tiptap.dev/docs/examples/basics/formatting
|
||||||
@@ -144,17 +146,41 @@ function getContent() {
|
|||||||
show_menu = false;
|
show_menu = false;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
class="editor border border-gray-300 rounded p-1 pb-2 bg-gray-200"
|
on:mouseenter={() => {
|
||||||
|
if (default_minimal) {
|
||||||
|
show_menu = true;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
class="editor border border-gray-300 rounded p-1 bg-gray-200 transition-all duration-1000"
|
||||||
|
class:font-mono={show_menu}
|
||||||
|
class:py-2={show_menu}
|
||||||
>
|
>
|
||||||
|
|
||||||
{#if editor && show_menu}
|
<!-- && show_menu -->
|
||||||
<div class="control-group bg-gray-200 border-b border-gray-400 p-1">
|
<!-- class:h-0={!show_menu} -->
|
||||||
<div class="button-group flex flex-row flex-wrap gap-4 items-center justify-between">
|
<!-- class:h-auto={show_menu} -->
|
||||||
|
<!-- class:opacity-0={!show_menu} -->
|
||||||
|
<!-- class:opacity-100={show_menu} -->
|
||||||
|
{#if editor && show_menu}
|
||||||
|
<div
|
||||||
|
transition:fade={{delay: 150, duration: 750, easing: cubicOut}}
|
||||||
|
class="
|
||||||
|
control-group button-group
|
||||||
|
bg-gray-200
|
||||||
|
border-b border-gray-400
|
||||||
|
p-1
|
||||||
|
transition-all duration-1000
|
||||||
|
flex flex-row flex-wrap gap-4
|
||||||
|
items-center justify-between
|
||||||
|
"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- <div class="button-group flex flex-row flex-wrap gap-4 items-center justify-between"> -->
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => console.log(editor?.getHTML()) && editor.chain().toggleBold().run()}
|
on:click={() => editor.chain().toggleBold().run()}
|
||||||
disabled={!editor.can().chain().focus().toggleBold().run()}
|
disabled={!editor.can().chain().focus().toggleBold().run()}
|
||||||
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md font-bold"
|
class="btn btn-sm variant-glass-secondary hover:variant-filled-secondary rounded-md font-bold"
|
||||||
class:variant-ghost-secondary={editor.isActive("bold") ?? false}
|
class:variant-ghost-secondary={editor.isActive("bold") ?? false}
|
||||||
@@ -408,17 +434,17 @@ function getContent() {
|
|||||||
</button>
|
</button>
|
||||||
</span> -->
|
</span> -->
|
||||||
|
|
||||||
|
<!-- </div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/if} <!-- show_menu -->
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
bind:this={element}
|
bind:this={element}
|
||||||
class="tiptap bg-slate-100 px-1 py-2"
|
class="tiptap bg-slate-100 px-2 py-2 relative"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="placeholder text-sm text-gray-400 italic"
|
class="placeholder text-sm text-gray-400 italic absolute"
|
||||||
contenteditable="false"
|
contenteditable="false"
|
||||||
hidden={editor?.getHTML() !== '<p></p>'}
|
hidden={editor?.getHTML() !== '<p></p>'}
|
||||||
>{placeholder}</span>
|
>{placeholder}</span>
|
||||||
@@ -428,4 +454,12 @@ function getContent() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
// :global(.ProseMirror) {
|
||||||
|
// padding: .25em;
|
||||||
|
// }
|
||||||
|
:global(.ProseMirror-focused) {
|
||||||
|
// padding: .25em;
|
||||||
|
// box-shadow: 0 0 0 2px hsla(208, 99%, 55%, .1);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1313,14 +1313,9 @@ async function handle_delete_event_obj({event_id, method='disable'}) {
|
|||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.ae_section .ae_options {
|
/* .ae_section .ae_options {
|
||||||
/* align-self: center; */
|
align-self: center;
|
||||||
}
|
} */
|
||||||
|
|
||||||
textarea.event__description {
|
|
||||||
/* width: 100%; */
|
|
||||||
/* max-width: 100%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.event__physical_virtual .ae_group {
|
.event__physical_virtual .ae_group {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -1354,21 +1349,4 @@ textarea.event__description {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .ae_edit.event_obj {
|
|
||||||
border: dashed thin hsla(0,0%,70%,1);
|
|
||||||
|
|
||||||
margin: .5em .25em;
|
|
||||||
padding: .5em .25em;
|
|
||||||
|
|
||||||
background-color: hsla(0,0%,90%,1);
|
|
||||||
} */
|
|
||||||
|
|
||||||
/* .ae_d_none, .d-none {
|
|
||||||
display: none;
|
|
||||||
} */
|
|
||||||
|
|
||||||
:global(.tox .tox-promotion, .tox .tox-statusbar__branding) {
|
|
||||||
display: none !important;
|
|
||||||
/* visibility: hidden !important; */
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -343,10 +343,10 @@ onMount(() => {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event_obj .ae_meta {
|
/* .event_obj .ae_meta {
|
||||||
/* flex-direction: column; */
|
flex-direction: column;
|
||||||
/* justify-content: space-between; */
|
justify-content: space-between;
|
||||||
}
|
} */
|
||||||
|
|
||||||
.event_obj .ae_meta .ae_group {
|
.event_obj .ae_meta .ae_group {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -49,9 +49,10 @@ onMount(() => {
|
|||||||
>
|
>
|
||||||
|
|
||||||
<header class="ae_header event__header">
|
<header class="ae_header event__header">
|
||||||
<h3>
|
<h3
|
||||||
|
class="flex flex-row gap-2 items-center">
|
||||||
<span class="event__name">{idaa_event_obj?.name}</span>
|
<span class="event__name">{idaa_event_obj?.name}</span>
|
||||||
<span class="badge badge-info bg-info">
|
<span class="badge badge-info variant-glass-tertiary">
|
||||||
{#if idaa_event_obj?.physical && idaa_event_obj?.virtual}
|
{#if idaa_event_obj?.physical && idaa_event_obj?.virtual}
|
||||||
<span class="fas fa-home m-1"></span> F2F and <span class="fas fa-laptop m-1"></span> Virtual
|
<span class="fas fa-home m-1"></span> F2F and <span class="fas fa-laptop m-1"></span> Virtual
|
||||||
{:else if idaa_event_obj?.physical}
|
{:else if idaa_event_obj?.physical}
|
||||||
@@ -61,7 +62,7 @@ onMount(() => {
|
|||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
{#if idaa_event_obj?.type}
|
{#if idaa_event_obj?.type}
|
||||||
<span class="badge badge-info bg-info"><span class="fas fa-user-md m-1"></span> {idaa_event_obj?.type}</span>
|
<span class="badge badge-info variant-glass-secondary"><span class="fas fa-user-md m-1"></span> {idaa_event_obj?.type}</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $ae_loc.trusted_access && idaa_event_obj?.hide}
|
{#if $ae_loc.trusted_access && idaa_event_obj?.hide}
|
||||||
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Hidden</span>
|
<span class="badge badge-warning"><span class="fas fa-exclamation-triangle m-1"></span> Hidden</span>
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ async function handle_qry__event(
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<fieldset class="flex flex-row gap-1 w-full items-center justify-center">
|
<fieldset class="flex flex-row flex-wrap gap-4 w-full items-center justify-center">
|
||||||
<div class="legend inline-block">
|
<div class="legend inline-block">
|
||||||
Location?</div>
|
Location?</div>
|
||||||
<!-- <div class="ae_row ae_flex_justify_around ae_width_md"> -->
|
<!-- <div class="ae_row ae_flex_justify_around ae_width_md"> -->
|
||||||
@@ -274,7 +274,7 @@ async function handle_qry__event(
|
|||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="flex flex-row gap-1 w-full items-center justify-center">
|
<fieldset class="flex flex-row flex-wrap gap-4 w-full items-center justify-center">
|
||||||
<div class="legend inline-block">
|
<div class="legend inline-block">
|
||||||
Type?
|
Type?
|
||||||
</div>
|
</div>
|
||||||
@@ -350,7 +350,7 @@ async function handle_qry__event(
|
|||||||
<div>Error: {error.message}</div>
|
<div>Error: {error.message}</div>
|
||||||
{/await} -->
|
{/await} -->
|
||||||
|
|
||||||
<div class="ae_group ae_row flex flex-row gap-1 w-full items-center justify-center">
|
<div class="ae_group ae_row flex flex-row flex-wrap gap-1 w-full items-center justify-center">
|
||||||
|
|
||||||
<!-- Max events select options -->
|
<!-- Max events select options -->
|
||||||
<span
|
<span
|
||||||
|
|||||||
Reference in New Issue
Block a user