@velastack/cms 0.2.4 → 0.2.5
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.
|
@@ -226,7 +226,8 @@
|
|
|
226
226
|
data-popover-open={pageSelectOpen ? '' : undefined}
|
|
227
227
|
>
|
|
228
228
|
{#if children}
|
|
229
|
-
|
|
229
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
230
|
+
<span class="cms-link-edit__custom" onclickcapture={blockNav}>
|
|
230
231
|
{@render children(renderProps)}
|
|
231
232
|
</span>
|
|
232
233
|
{:else}
|
|
@@ -390,6 +391,15 @@
|
|
|
390
391
|
white-space: nowrap;
|
|
391
392
|
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
392
393
|
}
|
|
394
|
+
/* Bridge the gap between the link and the toolbar so hover isn't lost crossing it. */
|
|
395
|
+
.cms-link-edit__toolbar::after {
|
|
396
|
+
content: '';
|
|
397
|
+
position: absolute;
|
|
398
|
+
top: 100%;
|
|
399
|
+
left: 0;
|
|
400
|
+
right: 0;
|
|
401
|
+
height: 0.5rem;
|
|
402
|
+
}
|
|
393
403
|
.cms-link-edit:hover .cms-link-edit__toolbar,
|
|
394
404
|
.cms-link-edit:focus-within .cms-link-edit__toolbar,
|
|
395
405
|
.cms-link-edit[data-popover-open] .cms-link-edit__toolbar {
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
</script>
|
|
44
44
|
|
|
45
45
|
{#if editable && ref}
|
|
46
|
+
<!-- Mounted straight into edit mode (navigation while editing): the
|
|
47
|
+
children branch below never rendered, so render it hidden once to
|
|
48
|
+
capture the default markup. Removed as soon as it's captured. -->
|
|
49
|
+
{#if children && initialFromChildren === undefined}
|
|
50
|
+
<div bind:this={childrenEl} class="cms-rich-text-capture">{@render children()}</div>
|
|
51
|
+
{/if}
|
|
46
52
|
{#await import('./cms-rich-text-editable.svelte') then { default: Editable }}
|
|
47
53
|
<Editable scope={ref} {name} initial={editInitial} />
|
|
48
54
|
{/await}
|
|
@@ -63,6 +69,9 @@
|
|
|
63
69
|
.cms-rich-text-children {
|
|
64
70
|
display: contents;
|
|
65
71
|
}
|
|
72
|
+
.cms-rich-text-capture {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
66
75
|
.cms-missing {
|
|
67
76
|
padding: 0.25rem 0.5rem;
|
|
68
77
|
border: 1px dashed rgba(127, 127, 127, 0.6);
|
|
@@ -73,6 +73,12 @@
|
|
|
73
73
|
</script>
|
|
74
74
|
|
|
75
75
|
{#if editable && ref}
|
|
76
|
+
<!-- Mounted straight into edit mode (navigation while editing): the
|
|
77
|
+
children branch below never rendered, so render it hidden once to
|
|
78
|
+
capture the default text. Removed as soon as it's captured. -->
|
|
79
|
+
{#if children && initialFromChildren === undefined}
|
|
80
|
+
<span bind:this={childrenEl} class="cms-text-capture">{@render children()}</span>
|
|
81
|
+
{/if}
|
|
76
82
|
<span
|
|
77
83
|
bind:this={el}
|
|
78
84
|
class="cms-text-editable"
|
|
@@ -118,6 +124,9 @@
|
|
|
118
124
|
.cms-text-children {
|
|
119
125
|
display: contents;
|
|
120
126
|
}
|
|
127
|
+
.cms-text-capture {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
121
130
|
|
|
122
131
|
.cms-missing {
|
|
123
132
|
display: inline-block;
|