@astro-live-cms/core 0.2.0
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/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/auth/session.d.ts +14 -0
- package/dist/runtime/auth/session.d.ts.map +1 -0
- package/dist/runtime/auth/session.js +77 -0
- package/dist/runtime/auth/session.js.map +1 -0
- package/dist/runtime/bind.d.ts +14 -0
- package/dist/runtime/bind.d.ts.map +1 -0
- package/dist/runtime/bind.js +11 -0
- package/dist/runtime/bind.js.map +1 -0
- package/dist/runtime/config.d.ts +6 -0
- package/dist/runtime/config.d.ts.map +1 -0
- package/dist/runtime/config.js +18 -0
- package/dist/runtime/config.js.map +1 -0
- package/dist/runtime/content.d.ts +30 -0
- package/dist/runtime/content.d.ts.map +1 -0
- package/dist/runtime/content.js +48 -0
- package/dist/runtime/content.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +12 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/markers.d.ts +17 -0
- package/dist/runtime/markers.d.ts.map +1 -0
- package/dist/runtime/markers.js +17 -0
- package/dist/runtime/markers.js.map +1 -0
- package/dist/runtime/middleware.d.ts +12 -0
- package/dist/runtime/middleware.d.ts.map +1 -0
- package/dist/runtime/middleware.js +37 -0
- package/dist/runtime/middleware.js.map +1 -0
- package/dist/runtime/mutations/contracts.d.ts +57 -0
- package/dist/runtime/mutations/contracts.d.ts.map +1 -0
- package/dist/runtime/mutations/contracts.js +242 -0
- package/dist/runtime/mutations/contracts.js.map +1 -0
- package/dist/runtime/mutations/engine.d.ts +23 -0
- package/dist/runtime/mutations/engine.d.ts.map +1 -0
- package/dist/runtime/mutations/engine.js +161 -0
- package/dist/runtime/mutations/engine.js.map +1 -0
- package/dist/runtime/routes/_helpers.d.ts +6 -0
- package/dist/runtime/routes/_helpers.d.ts.map +1 -0
- package/dist/runtime/routes/_helpers.js +23 -0
- package/dist/runtime/routes/_helpers.js.map +1 -0
- package/dist/runtime/routes/admin.d.ts +3 -0
- package/dist/runtime/routes/admin.d.ts.map +1 -0
- package/dist/runtime/routes/admin.js +110 -0
- package/dist/runtime/routes/admin.js.map +1 -0
- package/dist/runtime/routes/auth-login.d.ts +4 -0
- package/dist/runtime/routes/auth-login.d.ts.map +1 -0
- package/dist/runtime/routes/auth-login.js +66 -0
- package/dist/runtime/routes/auth-login.js.map +1 -0
- package/dist/runtime/routes/auth-logout.d.ts +4 -0
- package/dist/runtime/routes/auth-logout.d.ts.map +1 -0
- package/dist/runtime/routes/auth-logout.js +51 -0
- package/dist/runtime/routes/auth-logout.js.map +1 -0
- package/dist/runtime/routes/editor-assets.d.ts +3 -0
- package/dist/runtime/routes/editor-assets.d.ts.map +1 -0
- package/dist/runtime/routes/editor-assets.js +47 -0
- package/dist/runtime/routes/editor-assets.js.map +1 -0
- package/dist/runtime/routes/entries.d.ts +3 -0
- package/dist/runtime/routes/entries.d.ts.map +1 -0
- package/dist/runtime/routes/entries.js +89 -0
- package/dist/runtime/routes/entries.js.map +1 -0
- package/dist/runtime/routes/history.d.ts +4 -0
- package/dist/runtime/routes/history.d.ts.map +1 -0
- package/dist/runtime/routes/history.js +56 -0
- package/dist/runtime/routes/history.js.map +1 -0
- package/dist/runtime/routes/mutate.d.ts +4 -0
- package/dist/runtime/routes/mutate.d.ts.map +1 -0
- package/dist/runtime/routes/mutate.js +35 -0
- package/dist/runtime/routes/mutate.js.map +1 -0
- package/dist/runtime/routes/schema.d.ts +3 -0
- package/dist/runtime/routes/schema.d.ts.map +1 -0
- package/dist/runtime/routes/schema.js +27 -0
- package/dist/runtime/routes/schema.js.map +1 -0
- package/dist/runtime/routes/studio-home.d.ts +3 -0
- package/dist/runtime/routes/studio-home.d.ts.map +1 -0
- package/dist/runtime/routes/studio-home.js +174 -0
- package/dist/runtime/routes/studio-home.js.map +1 -0
- package/dist/runtime/routes/theme-bootstrap.d.ts +4 -0
- package/dist/runtime/routes/theme-bootstrap.d.ts.map +1 -0
- package/dist/runtime/routes/theme-bootstrap.js +65 -0
- package/dist/runtime/routes/theme-bootstrap.js.map +1 -0
- package/dist/runtime/routes/theme-factory.d.ts +3 -0
- package/dist/runtime/routes/theme-factory.d.ts.map +1 -0
- package/dist/runtime/routes/theme-factory.js +142 -0
- package/dist/runtime/routes/theme-factory.js.map +1 -0
- package/dist/runtime/routes/upload.d.ts +3 -0
- package/dist/runtime/routes/upload.d.ts.map +1 -0
- package/dist/runtime/routes/upload.js +29 -0
- package/dist/runtime/routes/upload.js.map +1 -0
- package/dist/runtime/schema/infer-json-schema.d.ts +12 -0
- package/dist/runtime/schema/infer-json-schema.d.ts.map +1 -0
- package/dist/runtime/schema/infer-json-schema.js +75 -0
- package/dist/runtime/schema/infer-json-schema.js.map +1 -0
- package/dist/runtime/storage/filesystem-adapter.d.ts +29 -0
- package/dist/runtime/storage/filesystem-adapter.d.ts.map +1 -0
- package/dist/runtime/storage/filesystem-adapter.js +182 -0
- package/dist/runtime/storage/filesystem-adapter.js.map +1 -0
- package/dist/runtime/storage/filesystem-upload-handler.d.ts +11 -0
- package/dist/runtime/storage/filesystem-upload-handler.d.ts.map +1 -0
- package/dist/runtime/storage/filesystem-upload-handler.js +37 -0
- package/dist/runtime/storage/filesystem-upload-handler.js.map +1 -0
- package/dist/runtime/storage/in-memory-adapter.d.ts +24 -0
- package/dist/runtime/storage/in-memory-adapter.d.ts.map +1 -0
- package/dist/runtime/storage/in-memory-adapter.js +78 -0
- package/dist/runtime/storage/in-memory-adapter.js.map +1 -0
- package/dist/runtime/themes/preset-catalog.d.ts +9 -0
- package/dist/runtime/themes/preset-catalog.d.ts.map +1 -0
- package/dist/runtime/themes/preset-catalog.js +47 -0
- package/dist/runtime/themes/preset-catalog.js.map +1 -0
- package/dist/runtime/utils.d.ts +6 -0
- package/dist/runtime/utils.d.ts.map +1 -0
- package/dist/runtime/utils.js +29 -0
- package/dist/runtime/utils.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/vite/virtual-config-plugin.d.ts +7 -0
- package/dist/vite/virtual-config-plugin.d.ts.map +1 -0
- package/dist/vite/virtual-config-plugin.js +25 -0
- package/dist/vite/virtual-config-plugin.js.map +1 -0
- package/package.json +35 -0
- package/static/cms/editor/config.js +6 -0
- package/static/cms/editor/guards.js +68 -0
- package/static/cms/editor/helpers.js +16 -0
- package/static/cms/editor/image-edit.js +148 -0
- package/static/cms/editor/image-utils.js +84 -0
- package/static/cms/editor/image.css +133 -0
- package/static/cms/editor/link-ui.css +143 -0
- package/static/cms/editor/linkify.js +55 -0
- package/static/cms/editor/panel.css +91 -0
- package/static/cms/editor/panel.js +64 -0
- package/static/cms/editor/save-queue.js +167 -0
- package/static/cms/editor/section-controls/activation.js +10 -0
- package/static/cms/editor/section-controls/api.js +88 -0
- package/static/cms/editor/section-controls/constants.js +24 -0
- package/static/cms/editor/section-controls/index.js +622 -0
- package/static/cms/editor/section-controls/model.js +76 -0
- package/static/cms/editor/section-controls/mutations.js +112 -0
- package/static/cms/editor/section-controls/page-context.js +34 -0
- package/static/cms/editor/section-controls/pickers.js +196 -0
- package/static/cms/editor/section-controls/reorder.js +92 -0
- package/static/cms/editor/section-controls/selection.js +54 -0
- package/static/cms/editor/section-controls/spacing-drag.js +83 -0
- package/static/cms/editor/section-controls/ui-elements.js +54 -0
- package/static/cms/editor/section-controls/utils.js +35 -0
- package/static/cms/editor/section-controls.css +349 -0
- package/static/cms/editor/section-controls.js +1 -0
- package/static/cms/editor/security.js +23 -0
- package/static/cms/editor/sync.js +64 -0
- package/static/cms/editor/text-edit.js +129 -0
- package/static/cms/editor/text-link-interactions.js +191 -0
- package/static/cms/editor/toast.css +50 -0
- package/static/cms/editor/toast.js +29 -0
- package/static/cms/editor/tokens-and-text.css +94 -0
- package/static/cms/editor/toolbar.css +261 -0
- package/static/cms/editor/toolbar.js +110 -0
- package/static/cms/editor.css +10 -0
- package/static/cms/editor.js +101 -0
- package/static/cms/studio.css +312 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { escapeHtml } from './linkify.js';
|
|
2
|
+
|
|
3
|
+
export function createTextLinkInteractions({
|
|
4
|
+
state,
|
|
5
|
+
clientLinkify,
|
|
6
|
+
showToast,
|
|
7
|
+
snapshots,
|
|
8
|
+
}) {
|
|
9
|
+
let activePopover = null;
|
|
10
|
+
let activeLinkHint = null;
|
|
11
|
+
|
|
12
|
+
function removeLinkHint() {
|
|
13
|
+
if (activeLinkHint) {
|
|
14
|
+
activeLinkHint.remove();
|
|
15
|
+
activeLinkHint = null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function dismissLinkPopup() {
|
|
20
|
+
if (activePopover) {
|
|
21
|
+
activePopover.remove();
|
|
22
|
+
activePopover = null;
|
|
23
|
+
}
|
|
24
|
+
state.linkPopupEl = null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function showLinkPopup(rect, initialUrl, onApply) {
|
|
28
|
+
dismissLinkPopup();
|
|
29
|
+
|
|
30
|
+
const popover = document.createElement('div');
|
|
31
|
+
popover.className = 'cms-link-popover';
|
|
32
|
+
popover.innerHTML = `
|
|
33
|
+
<div class="cms-link-popover-row">
|
|
34
|
+
<svg class="cms-link-popover-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
35
|
+
<path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/>
|
|
36
|
+
<path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/>
|
|
37
|
+
</svg>
|
|
38
|
+
<input type="text" class="cms-link-popover-input" placeholder="Paste URL or path (e.g. /contact)" value="${escapeHtml(initialUrl)}" />
|
|
39
|
+
</div>
|
|
40
|
+
<div class="cms-link-popover-actions">
|
|
41
|
+
<span class="cms-link-popover-hint">${navigator.platform.includes('Mac') ? '\u2318' : 'Ctrl'}+K</span>
|
|
42
|
+
<div class="cms-link-popover-btns">
|
|
43
|
+
<button type="button" class="cms-link-popover-cancel">Cancel</button>
|
|
44
|
+
<button type="button" class="cms-link-popover-apply">Apply</button>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
document.body.appendChild(popover);
|
|
50
|
+
activePopover = popover;
|
|
51
|
+
|
|
52
|
+
const popW = 340;
|
|
53
|
+
let left = rect.left + rect.width / 2 - popW / 2;
|
|
54
|
+
left = Math.max(8, Math.min(left, window.innerWidth - popW - 8));
|
|
55
|
+
let top = rect.bottom + 8;
|
|
56
|
+
if (top + 120 > window.innerHeight) {
|
|
57
|
+
top = rect.top - 120;
|
|
58
|
+
}
|
|
59
|
+
popover.style.left = `${left}px`;
|
|
60
|
+
popover.style.top = `${top}px`;
|
|
61
|
+
|
|
62
|
+
const input = popover.querySelector('.cms-link-popover-input');
|
|
63
|
+
const applyBtn = popover.querySelector('.cms-link-popover-apply');
|
|
64
|
+
const cancelBtn = popover.querySelector('.cms-link-popover-cancel');
|
|
65
|
+
|
|
66
|
+
requestAnimationFrame(() => input.focus());
|
|
67
|
+
if (initialUrl) input.select();
|
|
68
|
+
|
|
69
|
+
function apply() {
|
|
70
|
+
const url = input.value.trim();
|
|
71
|
+
dismissLinkPopup();
|
|
72
|
+
onApply(url);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function cancel() {
|
|
76
|
+
dismissLinkPopup();
|
|
77
|
+
onApply(null);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
applyBtn.addEventListener('click', apply);
|
|
81
|
+
cancelBtn.addEventListener('click', cancel);
|
|
82
|
+
|
|
83
|
+
input.addEventListener('keydown', (e) => {
|
|
84
|
+
if (e.key === 'Enter') {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
apply();
|
|
87
|
+
}
|
|
88
|
+
if (e.key === 'Escape') {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
cancel();
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
setTimeout(() => {
|
|
95
|
+
function onDocClick(e) {
|
|
96
|
+
if (!popover.contains(e.target)) {
|
|
97
|
+
document.removeEventListener('click', onDocClick, true);
|
|
98
|
+
cancel();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
document.addEventListener('click', onDocClick, true);
|
|
102
|
+
}, 0);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function showLinkHint(el) {
|
|
106
|
+
removeLinkHint();
|
|
107
|
+
const hint = document.createElement('div');
|
|
108
|
+
hint.className = 'cms-link-hint';
|
|
109
|
+
hint.textContent = `${navigator.platform.includes('Mac') ? '\u2318' : 'Ctrl'}+K to link`;
|
|
110
|
+
document.body.appendChild(hint);
|
|
111
|
+
activeLinkHint = hint;
|
|
112
|
+
|
|
113
|
+
const rect = el.getBoundingClientRect();
|
|
114
|
+
hint.style.top = `${rect.top - 28}px`;
|
|
115
|
+
hint.style.left = `${rect.right - hint.offsetWidth}px`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function onKeydown(e) {
|
|
119
|
+
const focused = document.activeElement;
|
|
120
|
+
|
|
121
|
+
// Ctrl+S / Cmd+S — save focused element by triggering blur save
|
|
122
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 's') {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
if (focused && focused.matches('[data-cms]')) {
|
|
125
|
+
focused.blur();
|
|
126
|
+
}
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Ctrl+K / Cmd+K — insert markdown link in a linkable field
|
|
131
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
|
|
132
|
+
if (focused && focused.matches('[data-cms]') && focused.hasAttribute('data-cms-raw')) {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
const sel = window.getSelection();
|
|
135
|
+
if (!sel || sel.isCollapsed) return;
|
|
136
|
+
|
|
137
|
+
const selectedText = sel.toString();
|
|
138
|
+
if (!selectedText.trim()) return;
|
|
139
|
+
|
|
140
|
+
const range = sel.getRangeAt(0).cloneRange();
|
|
141
|
+
const selRect = range.getBoundingClientRect();
|
|
142
|
+
state.linkPopupEl = focused;
|
|
143
|
+
|
|
144
|
+
showLinkPopup(selRect, '', (url) => {
|
|
145
|
+
focused.focus();
|
|
146
|
+
|
|
147
|
+
if (url) {
|
|
148
|
+
const newSel = window.getSelection();
|
|
149
|
+
newSel.removeAllRanges();
|
|
150
|
+
newSel.addRange(range);
|
|
151
|
+
document.execCommand('insertText', false, `[${selectedText}](${url})`);
|
|
152
|
+
state.dirtyEl = focused;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
state.linkPopupEl = null;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Escape — revert to snapshot and blur without saving
|
|
162
|
+
if (e.key === 'Escape') {
|
|
163
|
+
if (activePopover) return;
|
|
164
|
+
|
|
165
|
+
if (focused && focused.matches('[data-cms]')) {
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
const snapshot = snapshots.get(focused);
|
|
168
|
+
if (snapshot !== undefined) {
|
|
169
|
+
const isLinkable = focused.hasAttribute('data-cms-raw');
|
|
170
|
+
if (isLinkable) {
|
|
171
|
+
focused.innerHTML = clientLinkify(snapshot);
|
|
172
|
+
focused.setAttribute('data-cms-raw', snapshot);
|
|
173
|
+
} else {
|
|
174
|
+
focused.textContent = snapshot;
|
|
175
|
+
}
|
|
176
|
+
state.dirtyEl = null;
|
|
177
|
+
}
|
|
178
|
+
focused._cmsSkipSave = true;
|
|
179
|
+
focused.blur();
|
|
180
|
+
removeLinkHint();
|
|
181
|
+
showToast('Edit cancelled', 'success');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
onKeydown,
|
|
188
|
+
showLinkHint,
|
|
189
|
+
removeLinkHint,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* ---------------------------------------------------------------------------
|
|
2
|
+
Toast notifications
|
|
3
|
+
--------------------------------------------------------------------------- */
|
|
4
|
+
|
|
5
|
+
.cms-toast {
|
|
6
|
+
position: fixed;
|
|
7
|
+
bottom: 62px;
|
|
8
|
+
right: 24px;
|
|
9
|
+
z-index: 100000;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 10px;
|
|
13
|
+
padding: 12px 20px;
|
|
14
|
+
background: var(--cms-navy-deep);
|
|
15
|
+
border: 1px solid rgba(255, 255, 255, 0.06);
|
|
16
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
|
17
|
+
font-family: var(--cms-font);
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
color: rgba(255, 255, 255, 0.8);
|
|
20
|
+
border-radius: 2px;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transform: translateY(8px) scale(0.98);
|
|
23
|
+
animation: cms-toast-in 0.3s ease forwards;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.cms-toast.cms-toast-out {
|
|
28
|
+
animation: cms-toast-out 0.3s ease forwards;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.cms-toast-icon {
|
|
32
|
+
width: 16px;
|
|
33
|
+
height: 16px;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cms-toast-success { border-left: 3px solid var(--cms-green); }
|
|
38
|
+
.cms-toast-success .cms-toast-icon { color: var(--cms-green); }
|
|
39
|
+
|
|
40
|
+
.cms-toast-error { border-left: 3px solid var(--cms-red); }
|
|
41
|
+
.cms-toast-error .cms-toast-icon { color: var(--cms-red); }
|
|
42
|
+
|
|
43
|
+
@keyframes cms-toast-in {
|
|
44
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes cms-toast-out {
|
|
48
|
+
to { opacity: 0; transform: translateY(12px) scale(0.98); }
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function createToast() {
|
|
2
|
+
let activeToast = null;
|
|
3
|
+
|
|
4
|
+
return function showToast(message, type) {
|
|
5
|
+
if (activeToast) {
|
|
6
|
+
activeToast.remove();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const toast = document.createElement('div');
|
|
10
|
+
toast.className = `cms-toast cms-toast-${type}`;
|
|
11
|
+
|
|
12
|
+
const iconSvg =
|
|
13
|
+
type === 'success'
|
|
14
|
+
? '<svg class="cms-toast-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>'
|
|
15
|
+
: '<svg class="cms-toast-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>';
|
|
16
|
+
|
|
17
|
+
toast.innerHTML = iconSvg + `<span>${message}</span>`;
|
|
18
|
+
document.body.appendChild(toast);
|
|
19
|
+
activeToast = toast;
|
|
20
|
+
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
toast.classList.add('cms-toast-out');
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
toast.remove();
|
|
25
|
+
if (activeToast === toast) activeToast = null;
|
|
26
|
+
}, 300);
|
|
27
|
+
}, 2500);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* ========================================================================
|
|
2
|
+
CMS Editor Styles — only loaded when isEditor = true
|
|
3
|
+
======================================================================== */
|
|
4
|
+
|
|
5
|
+
/* ---------------------------------------------------------------------------
|
|
6
|
+
CSS Custom Properties
|
|
7
|
+
--------------------------------------------------------------------------- */
|
|
8
|
+
|
|
9
|
+
:root {
|
|
10
|
+
--cms-blue: rgba(59, 130, 246, 0.8);
|
|
11
|
+
--cms-blue-dim: rgba(59, 130, 246, 0.1);
|
|
12
|
+
--cms-blue-hover: rgba(59, 130, 246, 0.4);
|
|
13
|
+
--cms-navy-deep: #0f1a33;
|
|
14
|
+
--cms-gold: #D4AF37;
|
|
15
|
+
--cms-gold-dim: rgba(212, 175, 55, 0.15);
|
|
16
|
+
--cms-green: #22c55e;
|
|
17
|
+
--cms-red: #ef4444;
|
|
18
|
+
--cms-yellow: #eab308;
|
|
19
|
+
--cms-font: 'Poppins', system-ui, -apple-system, sans-serif;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* ---------------------------------------------------------------------------
|
|
23
|
+
Text editing affordances — simple blue outline
|
|
24
|
+
--------------------------------------------------------------------------- */
|
|
25
|
+
|
|
26
|
+
[data-cms].cms-editable {
|
|
27
|
+
cursor: text;
|
|
28
|
+
transition: outline 0.2s, box-shadow 0.2s;
|
|
29
|
+
outline: 2px dashed transparent;
|
|
30
|
+
outline-offset: 4px;
|
|
31
|
+
border-radius: 2px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[data-cms].cms-editable:hover {
|
|
35
|
+
outline-color: var(--cms-blue-hover);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-cms].cms-editable:focus {
|
|
39
|
+
outline: 2px solid var(--cms-blue);
|
|
40
|
+
outline-offset: 4px;
|
|
41
|
+
box-shadow: 0 0 0 4px var(--cms-blue-dim);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ---------------------------------------------------------------------------
|
|
45
|
+
Link/button click prevention in editor mode
|
|
46
|
+
--------------------------------------------------------------------------- */
|
|
47
|
+
|
|
48
|
+
.cms-edit-mode a[data-cms],
|
|
49
|
+
.cms-edit-mode button[data-cms],
|
|
50
|
+
.cms-edit-mode [data-cms] a,
|
|
51
|
+
.cms-edit-mode [data-cms] button {
|
|
52
|
+
pointer-events: auto;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* CMS-editable links get text cursor; non-CMS links keep pointer for navigation */
|
|
56
|
+
.cms-edit-mode a[data-cms],
|
|
57
|
+
.cms-edit-mode a:has([data-cms]) {
|
|
58
|
+
cursor: text;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ---------------------------------------------------------------------------
|
|
62
|
+
Save / error feedback
|
|
63
|
+
--------------------------------------------------------------------------- */
|
|
64
|
+
|
|
65
|
+
.cms-saving {
|
|
66
|
+
outline-color: var(--cms-yellow) !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cms-saved {
|
|
70
|
+
animation: cms-flash-green 1.5s ease-out;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.cms-error {
|
|
74
|
+
animation: cms-flash-red 1.5s ease-out;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes cms-flash-green {
|
|
78
|
+
0% { outline: 2px solid var(--cms-green); outline-offset: 4px; }
|
|
79
|
+
100% { outline: 2px solid transparent; outline-offset: 4px; }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes cms-flash-red {
|
|
83
|
+
0% { outline: 2px solid var(--cms-red); outline-offset: 4px; }
|
|
84
|
+
100% { outline: 2px solid transparent; outline-offset: 4px; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ---------------------------------------------------------------------------
|
|
88
|
+
Invisible overlays — prevent hover-state duplicates from blocking editing
|
|
89
|
+
--------------------------------------------------------------------------- */
|
|
90
|
+
|
|
91
|
+
.cms-edit-mode .opacity-0 {
|
|
92
|
+
pointer-events: none !important;
|
|
93
|
+
}
|
|
94
|
+
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/* ---------------------------------------------------------------------------
|
|
2
|
+
Toolbar — fixed bottom bar
|
|
3
|
+
--------------------------------------------------------------------------- */
|
|
4
|
+
|
|
5
|
+
.cms-toolbar {
|
|
6
|
+
position: fixed;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
right: 0;
|
|
10
|
+
z-index: 99999;
|
|
11
|
+
font-family: var(--cms-font);
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
transform: translateY(100%);
|
|
15
|
+
animation: cms-toolbar-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.cms-toolbar-inner {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
background: var(--cms-navy-deep);
|
|
23
|
+
border-top: 1px solid rgba(212, 175, 55, 0.15);
|
|
24
|
+
box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
padding: 0 24px;
|
|
27
|
+
height: 48px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.cms-toolbar-left {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: 12px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cms-toolbar-badge {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 8px;
|
|
40
|
+
padding: 5px 14px;
|
|
41
|
+
background: var(--cms-gold-dim);
|
|
42
|
+
border: 1px solid rgba(212, 175, 55, 0.2);
|
|
43
|
+
border-radius: 2px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cms-toolbar-badge svg {
|
|
47
|
+
width: 14px;
|
|
48
|
+
height: 14px;
|
|
49
|
+
color: var(--cms-gold);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.cms-toolbar-badge-text {
|
|
53
|
+
color: var(--cms-gold);
|
|
54
|
+
font-size: 10px;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
letter-spacing: 0.15em;
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.cms-toolbar-divider {
|
|
61
|
+
width: 1px;
|
|
62
|
+
height: 20px;
|
|
63
|
+
background: rgba(255, 255, 255, 0.08);
|
|
64
|
+
margin: 0 4px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cms-toolbar-right {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: 16px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Status indicator */
|
|
74
|
+
.cms-status-group {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
gap: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.cms-status-dot {
|
|
81
|
+
width: 7px;
|
|
82
|
+
height: 7px;
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
transition: background-color 0.3s, box-shadow 0.3s;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.cms-status-idle {
|
|
88
|
+
background-color: var(--cms-green);
|
|
89
|
+
box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cms-status-saving {
|
|
93
|
+
background-color: var(--cms-yellow);
|
|
94
|
+
box-shadow: 0 0 6px rgba(234, 179, 8, 0.4);
|
|
95
|
+
animation: cms-dot-pulse 1s ease-in-out infinite;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.cms-status-error {
|
|
99
|
+
background-color: var(--cms-red);
|
|
100
|
+
box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes cms-dot-pulse {
|
|
104
|
+
0%, 100% { opacity: 1; }
|
|
105
|
+
50% { opacity: 0.3; }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cms-status-text {
|
|
109
|
+
color: rgba(255, 255, 255, 0.5);
|
|
110
|
+
font-size: 11px;
|
|
111
|
+
font-weight: 400;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Content Studio link button */
|
|
115
|
+
.cms-studio-btn {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: 6px;
|
|
119
|
+
background: var(--cms-gold-dim);
|
|
120
|
+
color: var(--cms-gold);
|
|
121
|
+
border: 1px solid rgba(212, 175, 55, 0.2);
|
|
122
|
+
padding: 6px 14px;
|
|
123
|
+
font-family: var(--cms-font);
|
|
124
|
+
font-size: 10px;
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
letter-spacing: 0.12em;
|
|
127
|
+
text-transform: uppercase;
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
transition: all 0.3s ease;
|
|
131
|
+
border-radius: 2px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.cms-studio-btn:hover {
|
|
135
|
+
background: rgba(212, 175, 55, 0.25);
|
|
136
|
+
border-color: rgba(212, 175, 55, 0.4);
|
|
137
|
+
color: var(--cms-gold);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Highlight all toggle button */
|
|
141
|
+
.cms-highlight-btn {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: 6px;
|
|
145
|
+
background: transparent;
|
|
146
|
+
color: rgba(255, 255, 255, 0.5);
|
|
147
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
148
|
+
padding: 6px 14px;
|
|
149
|
+
font-family: var(--cms-font);
|
|
150
|
+
font-size: 10px;
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
letter-spacing: 0.12em;
|
|
153
|
+
text-transform: uppercase;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
transition: all 0.3s ease;
|
|
156
|
+
border-radius: 2px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.cms-highlight-btn:hover {
|
|
160
|
+
background: rgba(59, 130, 246, 0.08);
|
|
161
|
+
border-color: rgba(59, 130, 246, 0.3);
|
|
162
|
+
color: rgba(59, 130, 246, 0.8);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.cms-highlight-btn-active {
|
|
166
|
+
background: rgba(59, 130, 246, 0.12);
|
|
167
|
+
border-color: rgba(59, 130, 246, 0.4);
|
|
168
|
+
color: rgba(59, 130, 246, 0.9);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Highlight all mode — show every editable region */
|
|
172
|
+
.cms-highlight-all [data-cms].cms-editable {
|
|
173
|
+
outline-color: var(--cms-blue-hover);
|
|
174
|
+
background: rgba(59, 130, 246, 0.04);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.cms-highlight-all [data-cms-img] {
|
|
178
|
+
outline: 2px dashed rgba(59, 130, 246, 0.4);
|
|
179
|
+
outline-offset: 4px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* ---------------------------------------------------------------------------
|
|
183
|
+
Toolbar — page navigation links
|
|
184
|
+
--------------------------------------------------------------------------- */
|
|
185
|
+
|
|
186
|
+
.cms-toolbar-nav {
|
|
187
|
+
display: none;
|
|
188
|
+
align-items: center;
|
|
189
|
+
gap: 2px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@media (min-width: 768px) {
|
|
193
|
+
.cms-toolbar-nav {
|
|
194
|
+
display: flex;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.cms-nav-link {
|
|
199
|
+
padding: 5px 14px;
|
|
200
|
+
font-size: 10px;
|
|
201
|
+
letter-spacing: 0.1em;
|
|
202
|
+
text-transform: uppercase;
|
|
203
|
+
text-decoration: none;
|
|
204
|
+
color: rgba(255, 255, 255, 0.35);
|
|
205
|
+
transition: color 0.15s, background 0.15s;
|
|
206
|
+
border-radius: 2px;
|
|
207
|
+
white-space: nowrap;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.cms-nav-link:hover {
|
|
211
|
+
color: rgba(255, 255, 255, 0.7);
|
|
212
|
+
background: rgba(255, 255, 255, 0.04);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.cms-nav-link.active {
|
|
216
|
+
color: var(--cms-gold);
|
|
217
|
+
background: var(--cms-gold-dim);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Exit button */
|
|
221
|
+
.cms-exit-btn {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: 6px;
|
|
225
|
+
background: transparent;
|
|
226
|
+
color: rgba(255, 255, 255, 0.5);
|
|
227
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
228
|
+
padding: 6px 18px;
|
|
229
|
+
font-family: var(--cms-font);
|
|
230
|
+
font-size: 10px;
|
|
231
|
+
font-weight: 500;
|
|
232
|
+
letter-spacing: 0.12em;
|
|
233
|
+
text-transform: uppercase;
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
transition: all 0.3s ease;
|
|
236
|
+
border-radius: 2px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.cms-exit-btn:hover {
|
|
240
|
+
background: rgba(248, 113, 113, 0.08);
|
|
241
|
+
border-color: rgba(248, 113, 113, 0.3);
|
|
242
|
+
color: var(--cms-red);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* Account for toolbar height */
|
|
246
|
+
body:has(.cms-toolbar) {
|
|
247
|
+
padding-bottom: 48px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Shift back-to-top button above toolbar */
|
|
251
|
+
body:has(.cms-toolbar) #back-to-top {
|
|
252
|
+
bottom: 60px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@keyframes cms-toolbar-enter {
|
|
256
|
+
to {
|
|
257
|
+
opacity: 1;
|
|
258
|
+
transform: translateY(0);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|