domma-cms 0.6.8 → 0.6.9
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/admin/css/admin.css +1 -1
- package/admin/js/app.js +4 -4
- package/admin/js/config/sidebar-config.js +1 -1
- package/admin/js/lib/markdown-toolbar.js +9 -9
- package/admin/js/lib/themes.js +1 -0
- package/admin/js/templates/page-editor.html +1 -21
- package/admin/js/templates/settings.html +2 -108
- package/admin/js/views/collection-editor.js +3 -3
- package/admin/js/views/login.js +7 -7
- package/admin/js/views/page-editor.js +27 -17
- package/admin/js/views/settings.js +2 -2
- package/package.json +1 -1
- package/plugins/analytics/stats.json +2 -2
- package/server/services/markdown.js +100 -3
package/admin/css/admin.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.dashboard-layout{display:flex;flex-direction:column;min-height:100vh}.dashboard-wrapper{display:flex;flex:1;min-height:0}.dashboard-main{flex:1;min-width:0;overflow-y:auto}.view-container{padding:1.5rem 2rem;max-width:1200px}.view-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;gap:1rem}.view-header h1{font-size:1.5rem;font-weight:700;margin:0;display:flex;align-items:center;gap:.5rem}.view-header-actions{display:flex;gap:.5rem}.stat-card .card-body{display:flex;align-items:center;gap:1rem}.stat-icon{width:44px;height:44px;border-radius:8px;background:var(--primary-alpha, rgba(91,140,255,.15));color:var(--primary, #5b8cff);display:flex;align-items:center;justify-content:center;font-size:1.25rem;flex-shrink:0}.stat-icon--success{background:#34d39926;color:#34d399}.stat-icon--warning{background:#fbbf2426;color:#fbbf24}.stat-value{font-size:1.75rem;font-weight:700;line-height:1}.stat-label{font-size:.8rem;color:var(--text-muted, #888);margin-top:.25rem}.toolbar{display:flex;align-items:center;gap:.75rem}.form-check-label{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem}.form-hint{display:block;font-size:.8rem;color:var(--text-muted, #888);margin-top:.25rem}.dashboard-main:has(#editor-meta-tabs){overflow:hidden}.view-container:has(#editor-meta-tabs){display:flex;flex-direction:column;height:calc(100dvh - 60px);max-width:100%;padding-bottom:0}#editor-meta-tabs{flex:1;min-height:0;display:flex;flex-direction:column}#editor-meta-tabs .tab-content{flex:1;min-height:0;overflow:hidden}#editor-meta-tabs .tab-panel{height:100%;overflow-y:auto}#editor-meta-tabs .tab-panel:has(.editor-card),#live-preview-panel{overflow:hidden}.page-live-preview-frame{display:block;width:100%;height:calc(100vh - 180px);border:none;border-radius:6px}.editor-card{display:flex;flex-direction:column;height:100%}.editor-card .card-body{display:flex;flex-direction:column;flex:1;min-height:0;padding:0!important}.editor-toolbar{display:flex;align-items:center;gap:2px;padding:6px 10px;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08));flex-wrap:wrap;flex-shrink:0}.editor-toolbar-btn{background:none;border:none;color:var(--text-muted, #888);padding:6px 8px;border-radius:4px;cursor:pointer;display:flex;align-items:center;transition:color .15s,background .15s}.editor-toolbar-btn:hover{color:var(--text, #eee);background:#ffffff14}.editor-toolbar-sep{width:1px;height:20px;background:var(--border-color, rgba(255, 255, 255, .08));margin:0 4px;flex-shrink:0}.editor-toolbar-right{margin-left:auto;display:flex;align-items:center;gap:2px}.editor-view-btn{background:none;border:none;color:var(--text-muted, #888);padding:6px 8px;border-radius:4px;cursor:pointer;display:flex;align-items:center;transition:color .15s,background .15s}.editor-view-btn:hover{color:var(--text, #eee);background:#ffffff14}.editor-view-btn.active{color:var(--primary, #5b8cff);background:var(--primary-alpha, rgba(91, 140, 255, .12))}.editor-body{display:flex;flex:1;min-height:0}.editor-pane{flex:1;display:flex;flex-direction:column;min-width:0}.editor-pane--write,.editor-pane--preview{overflow:hidden}.editor-pane--write{flex-direction:row}.editor-line-numbers{padding:1rem .6rem 1rem .75rem;background:var(--dm-background-alt, rgba(0, 0, 0, .15));border-right:1px solid var(--border-color, rgba(255, 255, 255, .08));color:var(--dm-text-muted, #666);font-family:Fira Code,Courier New,monospace;font-size:.9rem;line-height:1.6;text-align:right;user-select:none;white-space:pre;overflow:hidden;flex-shrink:0;min-width:2.5rem}.editor-mode-write .editor-pane--preview,.editor-mode-write .editor-divider,.editor-mode-preview .editor-pane--write,.editor-mode-preview .editor-divider{display:none}.editor-divider{width:1px;background:var(--border-color, rgba(255,255,255,.08));flex-shrink:0}.editor-textarea{flex:1;resize:none;border:none;border-radius:0;background:transparent;font-family:Fira Code,Courier New,monospace;font-size:.9rem;padding:1rem;outline:none;color:inherit;line-height:1.6}.editor-preview{flex:1;padding:1rem;overflow-y:auto;line-height:1.7}.editor-preview h1,.editor-preview h2,.editor-preview h3{margin-top:1.5rem}.editor-preview p{margin-bottom:.75rem}.editor-preview code{background:#ffffff0f;padding:.1em .3em;border-radius:3px;font-size:.9em}.editor-fullscreen{position:fixed;inset:0;z-index:1000;border-radius:0;margin:0}.editor-fullscreen .card-body{height:100vh}.media-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.75rem;max-height:400px;overflow-y:auto;padding:.25rem}.media-picker-item{cursor:pointer;border:2px solid transparent;border-radius:6px;overflow:hidden;transition:border-color .15s}.media-picker-item:hover{border-color:var(--primary, #5b8cff)}.media-picker-item img{width:100%;height:80px;object-fit:cover;display:block}.media-picker-item span{display:block;font-size:.75rem;padding:4px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.docs-body h3{margin-top:1.25rem;margin-bottom:.5rem}.docs-body p{margin-bottom:.5rem;line-height:1.6}.docs-body ol,.docs-body ul{margin-bottom:.75rem;padding-left:1.25rem}.docs-body li{margin-bottom:.25rem}.docs-body hr{margin:1.25rem 0;border-color:var(--border-color, rgba(255, 255, 255, .08))}.docs-body .table{margin-bottom:.75rem}.nav-items-header,.nav-item-row{display:flex;gap:.5rem;align-items:center;padding:.35rem .75rem}.nav-items-header{border-bottom:1px solid var(--border-color, rgba(255,255,255,.08));padding-bottom:.4rem;margin-bottom:.25rem}.nav-item-row{border-bottom:1px solid var(--border-color, rgba(255,255,255,.04))}.nav-item-row:last-child{border-bottom:none}.nav-col-indent{width:18px;flex-shrink:0;color:var(--text-muted, #888);text-align:center;font-size:.85rem}.nav-col-main{flex:2;min-width:0}.nav-col-icon{flex:0 0 90px}.nav-col-parent{flex:2;min-width:0}.nav-col-action{flex-shrink:0}.nav-item-row--child{background:#ffffff05}.nav-col-action{display:flex;align-items:center;gap:.25rem}.nav-item-row--hidden{opacity:.45}.nav-item-row--hidden .item-text,.nav-item-row--hidden .footer-link-text{text-decoration:line-through}.btn-toggle-hidden{color:var(--text-muted, #888)}.btn-toggle-hidden.active{color:var(--color-warning, #f59e0b)}.toggle-label{display:flex;align-items:center;gap:.4rem;font-size:.9rem;cursor:pointer;margin-right:1rem}.preset-toggles{display:flex;flex-wrap:wrap;margin-top:.75rem}.presets-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}.card-header{padding:.5rem 1rem}.card-header h2{margin:0;font-size:.9rem;font-weight:600;letter-spacing:.02em}.preset-card .card-header{display:flex;align-items:center;justify-content:space-between}.preset-card .card-header h3{margin:0;font-size:1rem}.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:1rem}.media-card{background:var(--card-bg, rgba(255,255,255,.04));border:1px solid var(--border-color, rgba(255,255,255,.08));border-radius:8px;overflow:hidden}.media-preview{height:130px;display:flex;align-items:center;justify-content:center;background:#0003;overflow:hidden}.media-thumb{width:100%;height:100%;object-fit:cover}.media-thumb--file{font-size:2rem;color:var(--text-muted, #888)}.media-info{padding:.5rem .75rem;display:flex;flex-direction:column;gap:.15rem}.media-name{font-size:.8rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default}.media-rename-input{width:100%;font-size:.8rem;font-weight:500;padding:.1rem .25rem;border:1px solid var(--primary, #7c6af7);border-radius:3px;background:var(--input-bg, transparent);color:inherit;outline:none}.media-size{font-size:.75rem;color:var(--text-muted, #888)}.media-actions{padding:.5rem .75rem;display:flex;gap:.4rem;border-top:1px solid var(--border-color, rgba(255,255,255,.08))}#admin-topbar{height:60px;display:flex;align-items:center;gap:1rem;padding:0 1.25rem;background:var(--navbar-bg, rgba(0,0,0,.3));border-bottom:1px solid var(--border-color, rgba(255,255,255,.08));position:sticky;top:0;z-index:200;flex-shrink:0}.topbar-brand{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:.95rem;color:inherit;flex-shrink:0;margin-right:.5rem}.topbar-brand span[data-icon],.topbar-brand svg{color:var(--primary, #5b8cff);width:22px;height:22px}.topbar-brand-text{opacity:.85}.topbar-user{display:flex;align-items:center;gap:.6rem;flex:1}.topbar-user-name{font-size:.875rem;font-weight:500}.topbar-role-badge{font-size:.7rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:.15rem .45rem;border-radius:4px}.topbar-role-badge--admin{background:#5b8cff26;color:#5b8cff}.topbar-role-badge--manager{background:#34d39926;color:#34d399}.topbar-role-badge--editor{background:#fbbf2426;color:#fbbf24}.topbar-role-badge--subscriber{background:#94a3b826;color:#94a3b8}.topbar-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.topbar-action-link{display:flex;align-items:center;gap:.35rem;font-size:.875rem;color:var(--text-muted, #888);text-decoration:none;padding:.4rem .65rem;border-radius:6px;transition:color .15s,background .15s}.topbar-action-link:hover{color:var(--text, #eee);background:#ffffff0f}.topbar-action-link span[data-icon],.topbar-action-link svg{width:16px;height:16px}.topbar-signout{display:flex;align-items:center;gap:.35rem;font-size:.875rem}.topbar-signout span[data-icon],.topbar-signout svg{width:16px;height:16px}.login-wrap{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;background:var(--body-bg, #0f1117);z-index:100;overflow-y:auto}.login-card{width:100%;max-width:460px}.ob-done-icon{font-size:3rem;color:#34d399;margin-bottom:1rem;text-align:center}.btn-skip{display:block;text-align:center;margin-top:.75rem;font-size:.85rem;color:var(--text-muted, #888);text-decoration:none}.btn-skip:hover{text-decoration:underline}.theme-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem}.theme-swatch{border:2px solid var(--border-color, rgba(255,255,255,.1));border-radius:8px;overflow:hidden;cursor:pointer;transition:border-color .15s,transform .1s}.theme-swatch:hover{border-color:var(--primary, #5b8cff);transform:translateY(-1px)}.theme-swatch.selected{border-color:var(--primary, #5b8cff);box-shadow:0 0 0 2px var(--primary, #5b8cff)}.theme-swatch-preview{height:52px;position:relative;display:flex;align-items:flex-end;padding:.35rem}.theme-swatch-accent{width:28px;height:6px;border-radius:3px}.theme-swatch-label{display:flex;justify-content:space-between;align-items:center;padding:.3rem .45rem;font-size:.7rem;background:var(--card-bg, rgba(255,255,255,.04))}.theme-swatch-mode{color:var(--text-muted, #888);font-size:.65rem}.login-logo{display:flex;align-items:center;gap:.75rem;margin-bottom:1.75rem;font-size:1.5rem}.login-logo span[data-icon]{font-size:2rem;color:var(--primary, #5b8cff)}.login-logo h1{margin:0;font-size:1.5rem;font-weight:700}.login-heading{font-size:1.1rem;font-weight:600;margin-bottom:1.25rem}.btn-block{width:100%}.plugins-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem}.plugin-card{display:flex;flex-direction:column}.plugin-card .card-body{flex:1}.plugin-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:.75rem}.plugin-icon{width:40px;height:40px;border-radius:8px;background:var(--primary-alpha, rgba(91,140,255,.15));color:var(--primary, #5b8cff);display:flex;align-items:center;justify-content:center;flex-shrink:0}.plugin-meta{flex:1;min-width:0}.plugin-name{font-weight:600;margin-bottom:.15rem}.plugin-version{font-size:.75rem;color:var(--text-muted, #888)}.plugin-desc{font-size:.875rem;color:var(--text-muted, #888);margin-bottom:1rem}.plugin-footer{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-top:1px solid var(--border-color, rgba(255,255,255,.08))}#admin-sidebar .sidebar-link{position:relative!important}#admin-sidebar .sidebar-badge{position:absolute!important;right:1rem!important;top:50%!important;transform:translateY(-50%)!important;margin-left:0!important}#admin-sidebar .sidebar-text{padding-right:2rem!important}#admin-sidebar.sidebar-dark{background:var(--dm-surface);border-color:var(--dm-border)}#admin-sidebar.sidebar-dark .sidebar-header{background:var(--dm-surface-raised);border-color:var(--dm-border)}#admin-sidebar.sidebar-dark .sidebar-header-title{color:var(--dm-text)}#admin-sidebar.sidebar-dark .sidebar-link{color:var(--dm-text-muted)}#admin-sidebar.sidebar-dark .sidebar-link:hover{color:var(--dm-text);background:var(--dm-surface-overlay)}#admin-sidebar.sidebar-dark .sidebar-link.active{color:var(--dm-primary);background:var(--dm-primary-alpha, rgba(91,140,255,.12));border-left-color:var(--dm-primary)}#admin-sidebar.sidebar-dark .sidebar-heading{color:var(--dm-text-muted)}#admin-sidebar.sidebar-dark .sidebar-divider{background:var(--dm-border)}#admin-sidebar.sidebar-dark .sidebar-footer{background:var(--dm-surface-raised);border-color:var(--dm-border)}.sidebar-heading--collapsible{display:flex!important;align-items:center;justify-content:space-between;cursor:pointer;user-select:none}.sidebar-heading-toggle{display:flex;align-items:center;opacity:.5;flex-shrink:0;transition:transform .2s ease}.sidebar-heading--collapsible.is-collapsed .sidebar-heading-toggle{transform:rotate(-90deg)}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.p-0{padding:0!important}.text-muted{color:var(--text-muted, #888)}@media(max-width:768px){.view-container{padding:1rem}.editor-body{flex-direction:column}.editor-divider{width:auto;height:1px}}.image-editor{display:flex;flex-direction:column;gap:0}.image-editor-toolbar{display:flex;flex-direction:row;align-items:center;gap:.25rem;padding:.5rem .75rem;border-bottom:1px solid var(--border, rgba(255, 255, 255, .1))}.image-editor-sep{display:inline-block;width:1px;height:1.5rem;background:var(--border, rgba(255, 255, 255, .15));margin:0 .25rem;flex-shrink:0}.editor-toolbar-btn.active{color:var(--primary, #7c6af7);background:color-mix(in srgb,var(--primary, #7c6af7) 15%,transparent)}.editor-toolbar-caret{font-size:.6rem;line-height:1;margin-left:2px;opacity:.6}.editor-toolbar-dropdown{position:absolute;z-index:1000;background:var(--dm-surface, #1e1e2e);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;box-shadow:0 8px 24px #0006;padding:4px;min-width:160px}.editor-toolbar-dropdown-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:none;color:var(--dm-text, #ddd);padding:7px 10px;border-radius:5px;cursor:pointer;font-size:.85rem;transition:background .12s,color .12s}.editor-toolbar-dropdown-item:hover{background:#ffffff14;color:var(--dm-text-bright, #fff)}.editor-toolbar-dropdown-item span[data-icon],.editor-toolbar-dropdown-item svg{width:15px;height:15px;flex-shrink:0;opacity:.75}.editor-toolbar{position:relative}.editor-effects-dropdown-menu{position:absolute;top:100%;z-index:1000;background:var(--dm-surface, #1e1e2e);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;box-shadow:0 8px 24px #0006;padding:6px;min-width:180px;max-height:340px;overflow-y:auto}.editor-effects-category{padding:6px 8px 3px;font-size:.7rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--dm-text-muted, #888)}.editor-effects-item{display:block;width:100%;text-align:left;background:none;border:none;color:var(--dm-text, #ddd);padding:6px 10px;border-radius:5px;cursor:pointer;font-size:.85rem;transition:background .12s,color .12s}.editor-effects-item:hover{background:#ffffff14;color:var(--dm-text-bright, #fff)}.editor-icon-picker{position:absolute;z-index:1000;background:var(--dm-surface, #1e1e2e);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;box-shadow:0 8px 24px #0006;padding:8px;width:320px}.editor-icon-picker-search{width:100%;margin-bottom:8px;font-size:.8rem}.editor-spacer-picker{position:absolute;z-index:9999;background:var(--dm-surface, #1e1e2e);border:1px solid var(--dm-border, #333);border-radius:8px;padding:12px;width:240px;box-shadow:0 8px 24px #00000073}.editor-spacer-picker-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--dm-text-muted, #888);margin-bottom:10px}.editor-spacer-picker-row{display:flex;align-items:center;gap:10px;margin-bottom:12px}.editor-spacer-slider{flex:1;accent-color:var(--primary, #6366f1);cursor:pointer}.editor-spacer-slider-value{font-size:13px;font-weight:600;min-width:38px;text-align:right;color:var(--dm-text, #cdd6f4)}.editor-spacer-insert-btn{width:100%}.editor-icon-picker-size-row{display:flex;align-items:center;gap:8px;padding:0 8px 8px}.editor-icon-picker-size-row label{font-size:11px;color:var(--dm-text-muted, #888);white-space:nowrap}.editor-icon-picker-size{width:70px;font-size:12px;padding:3px 6px}.editor-icon-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:2px;max-height:280px;overflow-y:auto}.editor-icon-picker-item{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px 2px;border-radius:5px;cursor:pointer;background:none;border:none;color:var(--dm-text, #ddd);font-size:.58rem;text-align:center;gap:4px;overflow:hidden;transition:background .12s,color .12s}.editor-icon-picker-item:hover{background:#ffffff14;color:var(--dm-text-bright, #fff)}.editor-icon-picker-item span[data-icon],.editor-icon-picker-item svg{width:16px;height:16px;flex-shrink:0}.editor-icon-picker-item>span:last-child{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.editor-icon-picker-empty{grid-column:1 / -1;text-align:center;color:var(--dm-text-muted, #888);font-size:.8rem;padding:1.5rem}.image-editor-canvas{min-height:320px;max-height:520px;background:#111;overflow:hidden;display:flex;align-items:center;justify-content:center}.image-editor-canvas img{display:block;max-width:100%;max-height:520px}.image-editor-resize{display:flex;flex-direction:row;align-items:center;gap:.5rem;padding:.6rem .75rem;border-top:1px solid var(--border, rgba(255, 255, 255, .1));font-size:.85rem}.image-editor-resize label{font-weight:600;color:var(--text-muted, #888);font-size:.8rem}.image-editor-resize .form-input{width:5rem;padding:.25rem .5rem;font-size:.85rem}.image-editor-footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:.75rem;border-top:1px solid var(--border, rgba(255, 255, 255, .1));gap:.5rem}.image-editor-effects{border-top:1px solid var(--border, rgba(255, 255, 255, .1))}.image-editor-tab-bar{display:flex;flex-direction:row;overflow-x:auto;border-bottom:1px solid var(--border, rgba(255, 255, 255, .1));scrollbar-width:none}.image-editor-tab-bar::-webkit-scrollbar{display:none}.image-editor-tab-btn{display:inline-flex;align-items:center;gap:.35rem;padding:.5rem .85rem;font-size:.8rem;font-weight:500;border:none;border-bottom:2px solid transparent;background:transparent;cursor:pointer;color:var(--text-muted, #888);white-space:nowrap;transition:color .15s,border-color .15s;flex-shrink:0}.image-editor-tab-btn:hover{color:var(--text, #eee)}.image-editor-tab-btn.active{color:var(--primary, #7c6af7);border-bottom-color:var(--primary, #7c6af7)}.image-editor-tab-panel{padding:.75rem;max-height:200px;overflow-y:auto}.ie-presets-grid{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:.5rem}.ie-preset-btn.active{color:var(--primary, #7c6af7);background:color-mix(in srgb,var(--primary, #7c6af7) 15%,transparent);border-color:var(--primary, #7c6af7)}.ie-server-note{font-size:.73rem;color:var(--text-muted, #888);font-style:italic;margin:.25rem 0 0;line-height:1.4}.ie-slider-row{display:flex;align-items:center;gap:.5rem;margin-bottom:.4rem}.ie-slider-label{width:6rem;font-size:.8rem;color:var(--text-muted, #888);font-weight:600;flex-shrink:0}.ie-slider{flex:1;accent-color:var(--primary, #7c6af7);cursor:pointer}.ie-slider-val{width:3rem;font-size:.8rem;text-align:right;color:var(--text, #eee);flex-shrink:0}.ie-select{flex:1;font-size:.85rem;padding:.25rem .5rem}.ie-colour-input{width:40px;height:28px;padding:0;border:1px solid var(--border, rgba(255, 255, 255, .15));border-radius:4px;cursor:pointer;background:transparent;flex-shrink:0}.ie-wm-preview-row{display:flex;align-items:center;gap:.5rem;margin:.4rem 0}.ie-wm-preview-img{width:48px;height:48px;object-fit:contain;border-radius:4px;background:var(--surface-2, rgba(255, 255, 255, .06));flex-shrink:0}.ie-wm-preview-name{font-size:.8rem;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text, #eee)}.ie-media-picker{padding:.25rem 0}.ie-media-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:.5rem;max-height:300px;overflow-y:auto}.ie-media-thumb{display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.4rem;border-radius:6px;cursor:pointer;border:2px solid transparent;transition:border-color .15s,background .15s}.ie-media-thumb:hover{background:var(--surface-2, rgba(255, 255, 255, .08));border-color:var(--primary, #7c6af7)}.ie-media-thumb img{width:72px;height:72px;object-fit:cover;border-radius:4px}.ie-media-thumb-name{font-size:.7rem;color:var(--text-muted, #888);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:72px}.dm-slideover-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid var(--dm-border, #333);flex-shrink:0}.dm-slideover-title{margin:0;font-size:1rem;font-weight:600}.dm-slideover-close{padding:.2rem .35rem!important;line-height:1;font-size:.75rem}.dm-slideover-body{flex:1;overflow-y:auto;min-height:0}.dconfig-textarea{font-family:monospace;min-height:100px;resize:vertical}.dm-editor-line-numbers{white-space:pre}.dm-code-inline{font-family:Fira Code,Courier New,monospace;font-size:.82em;padding:.15em .35em;border-radius:3px;background:var(--dm-surface-subtle, rgba(0, 0, 0, .18));color:var(--dm-text, inherit);border:1px solid var(--dm-border, rgba(255, 255, 255, .08))}.dm-code-block{font-family:Fira Code,Courier New,monospace;font-size:.82rem;line-height:1.6;padding:.65rem .9rem;border-radius:6px;background:var(--dm-surface-subtle, rgba(0, 0, 0, .18));color:var(--dm-text, inherit);border:1px solid var(--dm-border, rgba(255, 255, 255, .08));white-space:pre;overflow-x:auto;display:block;margin:.4rem 0}
|
|
1
|
+
.dashboard-layout{display:flex;flex-direction:column;min-height:100vh}.dashboard-wrapper{display:flex;flex:1;min-height:0}.dashboard-main{flex:1;min-width:0;overflow-y:auto}.view-container{padding:1.5rem 2rem;max-width:1200px}.view-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;gap:1rem}.view-header h1{font-size:1.5rem;font-weight:700;margin:0;display:flex;align-items:center;gap:.5rem}.view-header-actions{display:flex;gap:.5rem}.stat-card .card-body{display:flex;align-items:center;gap:1rem}.stat-icon{width:44px;height:44px;border-radius:8px;background:var(--primary-alpha, rgba(91,140,255,.15));color:var(--primary, #5b8cff);display:flex;align-items:center;justify-content:center;font-size:1.25rem;flex-shrink:0}.stat-icon--success{background:#34d39926;color:#34d399}.stat-icon--warning{background:#fbbf2426;color:#fbbf24}.stat-value{font-size:1.75rem;font-weight:700;line-height:1}.stat-label{font-size:.8rem;color:var(--text-muted, #888);margin-top:.25rem}.toolbar{display:flex;align-items:center;gap:.75rem}.form-check-label{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem}.form-hint{display:block;font-size:.8rem;color:var(--text-muted, #888);margin-top:.25rem}.dashboard-main:has(#editor-meta-tabs){overflow:hidden}.view-container:has(#editor-meta-tabs){display:flex;flex-direction:column;height:calc(100dvh - 60px);max-width:100%;padding-bottom:0}#editor-meta-tabs{flex:1;min-height:0;display:flex;flex-direction:column}#editor-meta-tabs .tab-content{flex:1;min-height:0;overflow:hidden}#editor-meta-tabs .tab-panel{height:100%;overflow-y:auto}#editor-meta-tabs .tab-panel:has(.editor-card),#live-preview-panel{overflow:hidden}.page-live-preview-frame{display:block;width:100%;height:calc(100vh - 180px);border:none;border-radius:6px}.editor-card{display:flex;flex-direction:column;height:100%}.editor-card .card-body{display:flex;flex-direction:column;flex:1;min-height:0;padding:0!important}.editor-toolbar{display:flex;align-items:center;gap:2px;padding:6px 10px;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08));flex-wrap:wrap;flex-shrink:0}.editor-toolbar-btn{background:none;border:none;color:var(--text-muted, #888);padding:6px 8px;border-radius:4px;cursor:pointer;display:flex;align-items:center;transition:color .15s,background .15s}.editor-toolbar-btn:hover{color:var(--text, #eee);background:#ffffff14}.editor-toolbar-sep{width:1px;height:20px;background:var(--border-color, rgba(255, 255, 255, .08));margin:0 4px;flex-shrink:0}.editor-toolbar-right{margin-left:auto;display:flex;align-items:center;gap:2px}.editor-view-btn{background:none;border:none;color:var(--text-muted, #888);padding:6px 8px;border-radius:4px;cursor:pointer;display:flex;align-items:center;transition:color .15s,background .15s}.editor-view-btn:hover{color:var(--text, #eee);background:#ffffff14}.editor-view-btn.active{color:var(--primary, #5b8cff);background:var(--primary-alpha, rgba(91, 140, 255, .12))}.editor-body{display:flex;flex:1;min-height:0}.editor-pane{flex:1;display:flex;flex-direction:column;min-width:0}.editor-pane--write,.editor-pane--preview{overflow:hidden}.editor-pane--write{flex-direction:row}.editor-line-numbers{padding:1rem .6rem 1rem .75rem;background:var(--dm-background-alt, rgba(0, 0, 0, .15));border-right:1px solid var(--border-color, rgba(255, 255, 255, .08));color:var(--dm-text-muted, #666);font-family:Fira Code,Courier New,monospace;font-size:.9rem;line-height:1.6;text-align:right;user-select:none;white-space:pre;overflow:hidden;flex-shrink:0;min-width:2.5rem}.editor-mode-write .editor-pane--preview,.editor-mode-write .editor-divider,.editor-mode-preview .editor-pane--write,.editor-mode-preview .editor-divider{display:none}.editor-divider{width:1px;background:var(--border-color, rgba(255,255,255,.08));flex-shrink:0}.editor-textarea{flex:1;resize:none;border:none;border-radius:0;background:transparent;font-family:Fira Code,Courier New,monospace;font-size:.9rem;padding:1rem;outline:none;color:inherit;line-height:1.6}.editor-preview{flex:1;padding:1rem;overflow-y:auto;line-height:1.7}.editor-preview h1,.editor-preview h2,.editor-preview h3{margin-top:1.5rem}.editor-preview p{margin-bottom:.75rem}.editor-preview code{background:#ffffff0f;padding:.1em .3em;border-radius:3px;font-size:.9em}.editor-fullscreen{position:fixed;inset:0;z-index:1000;border-radius:0;margin:0}.editor-fullscreen .card-body{height:100vh}.media-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.75rem;max-height:400px;overflow-y:auto;padding:.25rem}.media-picker-item{cursor:pointer;border:2px solid transparent;border-radius:6px;overflow:hidden;transition:border-color .15s}.media-picker-item:hover{border-color:var(--primary, #5b8cff)}.media-picker-item img{width:100%;height:80px;object-fit:cover;display:block}.media-picker-item span{display:block;font-size:.75rem;padding:4px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.docs-body h3{margin-top:1.25rem;margin-bottom:.5rem}.docs-body p{margin-bottom:.5rem;line-height:1.6}.docs-body ol,.docs-body ul{margin-bottom:.75rem;padding-left:1.25rem}.docs-body li{margin-bottom:.25rem}.docs-body hr{margin:1.25rem 0;border-color:var(--border-color, rgba(255, 255, 255, .08))}.docs-body .table{margin-bottom:.75rem}.nav-items-header,.nav-item-row{display:flex;gap:.5rem;align-items:center;padding:.35rem .75rem}.nav-items-header{border-bottom:1px solid var(--border-color, rgba(255,255,255,.08));padding-bottom:.4rem;margin-bottom:.25rem}.nav-item-row{border-bottom:1px solid var(--border-color, rgba(255,255,255,.04))}.nav-item-row:last-child{border-bottom:none}.nav-col-indent{width:18px;flex-shrink:0;color:var(--text-muted, #888);text-align:center;font-size:.85rem}.nav-col-main{flex:2;min-width:0}.nav-col-icon{flex:0 0 90px}.nav-col-parent{flex:2;min-width:0}.nav-col-action{flex-shrink:0}.nav-item-row--child{background:#ffffff05}.nav-col-action{display:flex;align-items:center;gap:.25rem}.nav-item-row--hidden{opacity:.45}.nav-item-row--hidden .item-text,.nav-item-row--hidden .footer-link-text{text-decoration:line-through}.btn-toggle-hidden{color:var(--text-muted, #888)}.btn-toggle-hidden.active{color:var(--color-warning, #f59e0b)}.fb-field-card.fb-drag-over{outline:2px dashed var(--primary, #6366f1);outline-offset:-2px}.toggle-label{display:flex;align-items:center;gap:.4rem;font-size:.9rem;cursor:pointer;margin-right:1rem}.preset-toggles{display:flex;flex-wrap:wrap;margin-top:.75rem}.presets-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}.card-header{padding:.5rem 1rem}.card-header h2{margin:0;font-size:.9rem;font-weight:600;letter-spacing:.02em}.preset-card .card-header{display:flex;align-items:center;justify-content:space-between}.preset-card .card-header h3{margin:0;font-size:1rem}.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:1rem}.media-card{background:var(--card-bg, rgba(255,255,255,.04));border:1px solid var(--border-color, rgba(255,255,255,.08));border-radius:8px;overflow:hidden}.media-preview{height:130px;display:flex;align-items:center;justify-content:center;background:#0003;overflow:hidden}.media-thumb{width:100%;height:100%;object-fit:cover}.media-thumb--file{font-size:2rem;color:var(--text-muted, #888)}.media-info{padding:.5rem .75rem;display:flex;flex-direction:column;gap:.15rem}.media-name{font-size:.8rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default}.media-rename-input{width:100%;font-size:.8rem;font-weight:500;padding:.1rem .25rem;border:1px solid var(--primary, #7c6af7);border-radius:3px;background:var(--input-bg, transparent);color:inherit;outline:none}.media-size{font-size:.75rem;color:var(--text-muted, #888)}.media-actions{padding:.5rem .75rem;display:flex;gap:.4rem;border-top:1px solid var(--border-color, rgba(255,255,255,.08))}#admin-topbar{height:60px;display:flex;align-items:center;gap:1rem;padding:0 1.25rem;background:var(--navbar-bg, rgba(0,0,0,.3));border-bottom:1px solid var(--border-color, rgba(255,255,255,.08));position:sticky;top:0;z-index:200;flex-shrink:0}.topbar-brand{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:.95rem;color:inherit;flex-shrink:0;margin-right:.5rem}.topbar-brand span[data-icon],.topbar-brand svg{color:var(--primary, #5b8cff);width:22px;height:22px}.topbar-brand-text{opacity:.85}.topbar-user{display:flex;align-items:center;gap:.6rem;flex:1}.topbar-user-name{font-size:.875rem;font-weight:500}.topbar-role-badge{font-size:.7rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:.15rem .45rem;border-radius:4px}.topbar-role-badge--admin{background:#5b8cff26;color:#5b8cff}.topbar-role-badge--manager{background:#34d39926;color:#34d399}.topbar-role-badge--editor{background:#fbbf2426;color:#fbbf24}.topbar-role-badge--subscriber{background:#94a3b826;color:#94a3b8}.topbar-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.topbar-action-link{display:flex;align-items:center;gap:.35rem;font-size:.875rem;color:var(--text-muted, #888);text-decoration:none;padding:.4rem .65rem;border-radius:6px;transition:color .15s,background .15s}.topbar-action-link:hover{color:var(--text, #eee);background:#ffffff0f}.topbar-action-link span[data-icon],.topbar-action-link svg{width:16px;height:16px}.topbar-signout{display:flex;align-items:center;gap:.35rem;font-size:.875rem}.topbar-signout span[data-icon],.topbar-signout svg{width:16px;height:16px}.login-wrap{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:1rem;background:var(--body-bg, #0f1117);z-index:100;overflow-y:auto}.login-card{width:100%;max-width:460px}.ob-done-icon{font-size:3rem;color:#34d399;margin-bottom:1rem;text-align:center}.btn-skip{display:block;text-align:center;margin-top:.75rem;font-size:.85rem;color:var(--text-muted, #888);text-decoration:none}.btn-skip:hover{text-decoration:underline}.theme-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem}.theme-swatch{border:2px solid var(--border-color, rgba(255,255,255,.1));border-radius:8px;overflow:hidden;cursor:pointer;transition:border-color .15s,transform .1s}.theme-swatch:hover{border-color:var(--primary, #5b8cff);transform:translateY(-1px)}.theme-swatch.selected{border-color:var(--primary, #5b8cff);box-shadow:0 0 0 2px var(--primary, #5b8cff)}.theme-swatch-preview{height:52px;position:relative;display:flex;align-items:flex-end;padding:.35rem}.theme-swatch-accent{width:28px;height:6px;border-radius:3px}.theme-swatch-label{display:flex;justify-content:space-between;align-items:center;padding:.3rem .45rem;font-size:.7rem;background:var(--card-bg, rgba(255,255,255,.04))}.theme-swatch-mode{color:var(--text-muted, #888);font-size:.65rem}.login-logo{display:flex;align-items:center;gap:.75rem;margin-bottom:1.75rem;font-size:1.5rem}.login-logo span[data-icon]{font-size:2rem;color:var(--primary, #5b8cff)}.login-logo h1{margin:0;font-size:1.5rem;font-weight:700}.login-heading{font-size:1.1rem;font-weight:600;margin-bottom:1.25rem}.btn-block{width:100%}.plugins-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem}.plugin-card{display:flex;flex-direction:column}.plugin-card .card-body{flex:1}.plugin-header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:.75rem}.plugin-icon{width:40px;height:40px;border-radius:8px;background:var(--primary-alpha, rgba(91,140,255,.15));color:var(--primary, #5b8cff);display:flex;align-items:center;justify-content:center;flex-shrink:0}.plugin-meta{flex:1;min-width:0}.plugin-name{font-weight:600;margin-bottom:.15rem}.plugin-version{font-size:.75rem;color:var(--text-muted, #888)}.plugin-desc{font-size:.875rem;color:var(--text-muted, #888);margin-bottom:1rem}.plugin-footer{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-top:1px solid var(--border-color, rgba(255,255,255,.08))}#admin-sidebar .sidebar-link{position:relative!important}#admin-sidebar .sidebar-badge{position:absolute!important;right:.75rem!important;top:50%!important;transform:translateY(-50%)!important;margin-left:0!important;padding-left:.45rem!important;padding-right:.45rem!important}#admin-sidebar .sidebar-text{padding-right:2rem!important}#admin-sidebar.sidebar-dark{background:var(--dm-surface);border-color:var(--dm-border)}#admin-sidebar.sidebar-dark .sidebar-header{background:var(--dm-surface-raised);border-color:var(--dm-border)}#admin-sidebar.sidebar-dark .sidebar-header-title{color:var(--dm-text)}#admin-sidebar.sidebar-dark .sidebar-link{color:var(--dm-text-muted)}#admin-sidebar.sidebar-dark .sidebar-link:hover{color:var(--dm-text);background:var(--dm-surface-overlay)}#admin-sidebar.sidebar-dark .sidebar-link.active{color:var(--dm-primary);background:var(--dm-primary-alpha, rgba(91,140,255,.12));border-left-color:var(--dm-primary)}#admin-sidebar.sidebar-dark .sidebar-heading{color:var(--dm-text-muted)}#admin-sidebar.sidebar-dark .sidebar-divider{background:var(--dm-border)}#admin-sidebar.sidebar-dark .sidebar-footer{background:var(--dm-surface-raised);border-color:var(--dm-border)}.sidebar-heading--collapsible{display:flex!important;align-items:center;justify-content:space-between;cursor:pointer;user-select:none}.sidebar-heading-toggle{display:flex;align-items:center;opacity:.5;flex-shrink:0;transition:transform .2s ease}.sidebar-heading--collapsible.is-collapsed .sidebar-heading-toggle{transform:rotate(-90deg)}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.p-0{padding:0!important}.text-muted{color:var(--text-muted, #888)}@media(max-width:768px){.view-container{padding:1rem}.editor-body{flex-direction:column}.editor-divider{width:auto;height:1px}}.image-editor{display:flex;flex-direction:column;gap:0}.image-editor-toolbar{display:flex;flex-direction:row;align-items:center;gap:.25rem;padding:.5rem .75rem;border-bottom:1px solid var(--border, rgba(255, 255, 255, .1))}.image-editor-sep{display:inline-block;width:1px;height:1.5rem;background:var(--border, rgba(255, 255, 255, .15));margin:0 .25rem;flex-shrink:0}.editor-toolbar-btn.active{color:var(--primary, #7c6af7);background:color-mix(in srgb,var(--primary, #7c6af7) 15%,transparent)}.editor-toolbar-caret{font-size:.6rem;line-height:1;margin-left:2px;opacity:.6}.editor-toolbar-dropdown{position:absolute;z-index:1000;background:var(--dm-surface, #1e1e2e);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;box-shadow:0 8px 24px #0006;padding:4px;min-width:160px}.editor-toolbar-dropdown-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:none;color:var(--dm-text, #ddd);padding:7px 10px;border-radius:5px;cursor:pointer;font-size:.85rem;transition:background .12s,color .12s}.editor-toolbar-dropdown-item:hover{background:#ffffff14;color:var(--dm-text-bright, #fff)}.editor-toolbar-dropdown-item span[data-icon],.editor-toolbar-dropdown-item svg{width:15px;height:15px;flex-shrink:0;opacity:.75}.editor-toolbar{position:relative}.editor-effects-dropdown-menu{position:absolute;top:100%;z-index:1000;background:var(--dm-surface, #1e1e2e);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;box-shadow:0 8px 24px #0006;padding:6px;min-width:180px;max-height:340px;overflow-y:auto}.editor-effects-category{padding:6px 8px 3px;font-size:.7rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--dm-text-muted, #888)}.editor-effects-item{display:block;width:100%;text-align:left;background:none;border:none;color:var(--dm-text, #ddd);padding:6px 10px;border-radius:5px;cursor:pointer;font-size:.85rem;transition:background .12s,color .12s}.editor-effects-item:hover{background:#ffffff14;color:var(--dm-text-bright, #fff)}.editor-icon-picker{position:absolute;z-index:1000;background:var(--dm-surface, #1e1e2e);border:1px solid var(--border-color, rgba(255, 255, 255, .1));border-radius:8px;box-shadow:0 8px 24px #0006;padding:8px;width:320px}.editor-icon-picker-search{width:100%;margin-bottom:8px;font-size:.8rem}.editor-spacer-picker{position:absolute;z-index:9999;background:var(--dm-surface, #1e1e2e);border:1px solid var(--dm-border, #333);border-radius:8px;padding:12px;width:240px;box-shadow:0 8px 24px #00000073}.editor-spacer-picker-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--dm-text-muted, #888);margin-bottom:10px}.editor-spacer-picker-row{display:flex;align-items:center;gap:10px;margin-bottom:12px}.editor-spacer-slider{flex:1;accent-color:var(--primary, #6366f1);cursor:pointer}.editor-spacer-slider-value{font-size:13px;font-weight:600;min-width:38px;text-align:right;color:var(--dm-text, #cdd6f4)}.editor-spacer-insert-btn{width:100%}.editor-icon-picker-size-row{display:flex;align-items:center;gap:8px;padding:0 8px 8px}.editor-icon-picker-size-row label{font-size:11px;color:var(--dm-text-muted, #888);white-space:nowrap}.editor-icon-picker-size{width:70px;font-size:12px;padding:3px 6px}.editor-icon-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:2px;max-height:280px;overflow-y:auto}.editor-icon-picker-item{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px 2px;border-radius:5px;cursor:pointer;background:none;border:none;color:var(--dm-text, #ddd);font-size:.58rem;text-align:center;gap:4px;overflow:hidden;transition:background .12s,color .12s}.editor-icon-picker-item:hover{background:#ffffff14;color:var(--dm-text-bright, #fff)}.editor-icon-picker-item span[data-icon],.editor-icon-picker-item svg{width:16px;height:16px;flex-shrink:0}.editor-icon-picker-item>span:last-child{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.editor-icon-picker-empty{grid-column:1 / -1;text-align:center;color:var(--dm-text-muted, #888);font-size:.8rem;padding:1.5rem}.image-editor-canvas{min-height:320px;max-height:520px;background:#111;overflow:hidden;display:flex;align-items:center;justify-content:center}.image-editor-canvas img{display:block;max-width:100%;max-height:520px}.image-editor-resize{display:flex;flex-direction:row;align-items:center;gap:.5rem;padding:.6rem .75rem;border-top:1px solid var(--border, rgba(255, 255, 255, .1));font-size:.85rem}.image-editor-resize label{font-weight:600;color:var(--text-muted, #888);font-size:.8rem}.image-editor-resize .form-input{width:5rem;padding:.25rem .5rem;font-size:.85rem}.image-editor-footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:.75rem;border-top:1px solid var(--border, rgba(255, 255, 255, .1));gap:.5rem}.image-editor-effects{border-top:1px solid var(--border, rgba(255, 255, 255, .1))}.image-editor-tab-bar{display:flex;flex-direction:row;overflow-x:auto;border-bottom:1px solid var(--border, rgba(255, 255, 255, .1));scrollbar-width:none}.image-editor-tab-bar::-webkit-scrollbar{display:none}.image-editor-tab-btn{display:inline-flex;align-items:center;gap:.35rem;padding:.5rem .85rem;font-size:.8rem;font-weight:500;border:none;border-bottom:2px solid transparent;background:transparent;cursor:pointer;color:var(--text-muted, #888);white-space:nowrap;transition:color .15s,border-color .15s;flex-shrink:0}.image-editor-tab-btn:hover{color:var(--text, #eee)}.image-editor-tab-btn.active{color:var(--primary, #7c6af7);border-bottom-color:var(--primary, #7c6af7)}.image-editor-tab-panel{padding:.75rem;max-height:200px;overflow-y:auto}.ie-presets-grid{display:flex;flex-wrap:wrap;gap:.35rem;margin-bottom:.5rem}.ie-preset-btn.active{color:var(--primary, #7c6af7);background:color-mix(in srgb,var(--primary, #7c6af7) 15%,transparent);border-color:var(--primary, #7c6af7)}.ie-server-note{font-size:.73rem;color:var(--text-muted, #888);font-style:italic;margin:.25rem 0 0;line-height:1.4}.ie-slider-row{display:flex;align-items:center;gap:.5rem;margin-bottom:.4rem}.ie-slider-label{width:6rem;font-size:.8rem;color:var(--text-muted, #888);font-weight:600;flex-shrink:0}.ie-slider{flex:1;accent-color:var(--primary, #7c6af7);cursor:pointer}.ie-slider-val{width:3rem;font-size:.8rem;text-align:right;color:var(--text, #eee);flex-shrink:0}.ie-select{flex:1;font-size:.85rem;padding:.25rem .5rem}.ie-colour-input{width:40px;height:28px;padding:0;border:1px solid var(--border, rgba(255, 255, 255, .15));border-radius:4px;cursor:pointer;background:transparent;flex-shrink:0}.ie-wm-preview-row{display:flex;align-items:center;gap:.5rem;margin:.4rem 0}.ie-wm-preview-img{width:48px;height:48px;object-fit:contain;border-radius:4px;background:var(--surface-2, rgba(255, 255, 255, .06));flex-shrink:0}.ie-wm-preview-name{font-size:.8rem;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text, #eee)}.ie-media-picker{padding:.25rem 0}.ie-media-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:.5rem;max-height:300px;overflow-y:auto}.ie-media-thumb{display:flex;flex-direction:column;align-items:center;gap:.25rem;padding:.4rem;border-radius:6px;cursor:pointer;border:2px solid transparent;transition:border-color .15s,background .15s}.ie-media-thumb:hover{background:var(--surface-2, rgba(255, 255, 255, .08));border-color:var(--primary, #7c6af7)}.ie-media-thumb img{width:72px;height:72px;object-fit:cover;border-radius:4px}.ie-media-thumb-name{font-size:.7rem;color:var(--text-muted, #888);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:72px}.dm-slideover-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid var(--dm-border, #333);flex-shrink:0}.dm-slideover-title{margin:0;font-size:1rem;font-weight:600}.dm-slideover-close{padding:.2rem .35rem!important;line-height:1;font-size:.75rem}.dm-slideover-body{flex:1;overflow-y:auto;min-height:0}.dconfig-textarea{font-family:monospace;min-height:100px;resize:vertical}.dm-editor-line-numbers{white-space:pre}.dm-code-inline{font-family:Fira Code,Courier New,monospace;font-size:.82em;padding:.15em .35em;border-radius:3px;background:var(--dm-surface-subtle, rgba(0, 0, 0, .18));color:var(--dm-text, inherit);border:1px solid var(--dm-border, rgba(255, 255, 255, .08))}.dm-code-block{font-family:Fira Code,Courier New,monospace;font-size:.82rem;line-height:1.6;padding:.65rem .9rem;border-radius:6px;background:var(--dm-surface-subtle, rgba(0, 0, 0, .18));color:var(--dm-text, inherit);border:1px solid var(--dm-border, rgba(255, 255, 255, .08));white-space:pre;overflow-x:auto;display:block;margin:.4rem 0}
|
package/admin/js/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{getSidebarConfig as
|
|
2
|
-
<span id="topbar-user-name" class="topbar-user-name">${
|
|
3
|
-
<span class="topbar-role-badge topbar-role-badge--${
|
|
1
|
+
import{getSidebarConfig as B}from"./config/sidebar-config.js";import{views as K}from"./views/index.js";import{api as s,getUser as S,isAuthenticated as n,logout as j}from"./api.js";$(()=>{(async()=>{try{const t=n()?await s.settings.get():null;Domma.theme.init({theme:t?.adminTheme||"charcoal-dark",persist:!0})}catch{Domma.theme.init({theme:"charcoal-dark",persist:!0})}})(),R.use(async(t,a,e)=>{if(t.path==="/login"||t.path==="/reset-password")return e();if(!n()){R.navigate("/login");return}e()});let l=null;async function D(){if(!n())return{};try{const[t,a,e,i,o,c,N,x,A,W,L,V,T]=await Promise.all([s.pages.list().catch(()=>[]),s.media.list().catch(()=>[]),s.users.list().catch(()=>[]),s.plugins.list().catch(()=>[]),s.collections.list().catch(()=>[]),s.forms.list().catch(()=>[]),s.themes.list().catch(()=>[]),s.views.list().catch(()=>[]),s.actions.list().catch(()=>[]),s.blocks.list().catch(()=>[]),s.navigation.get().catch(()=>({})),s.layouts.get().catch(()=>({})),s.get("/collections/roles/entries?limit=100").catch(()=>({entries:[]}))]),f=L.items||[],U=f.filter(m=>!m.hidden).length,v=f.length,I=i.filter(m=>m.enabled).length,C=i.length;return{pages:t.length,media:a.length,users:e.length,plugins:C>0?`${I}/${C}`:null,collections:o.length,forms:c.length,themes:N.length,views:x.length,actions:A.length,blocks:W.length,navigation:v>0?`${U}/${v}`:null,layouts:Object.keys(V).length,roles:(T.entries||[]).length}}catch{return{}}}async function d(){try{return(await s.get("/auth/permissions")).permissions||[]}catch{return[]}}async function p(t){l&&$("#admin-sidebar").empty();const a=await D(),e=u.map(i=>{if(!i.countKey)return i;const o=a[i.countKey];return{...i,badge:o!=null&&o>0?String(o):null}});l=Domma.elements.sidebar("#admin-sidebar",{header:{title:"CMS Admin",icon:"layout"},items:B(t,a,e),collapsible:!0,collapseAt:992,push:!0,contentSelector:".dashboard-main",top:"60px"}),y(),k()}function y(){$("#admin-sidebar .sidebar-link").each(function(){const t=$(this).find(".sidebar-text").text().trim();t&&$(this).attr("data-tooltip",t)}),E.tooltip("#admin-sidebar [data-tooltip]",{placement:"right"})}function k(){$("#admin-sidebar .sidebar-heading").each(function(){const t=$(this);t.addClass("sidebar-heading--collapsible"),t.append('<span class="sidebar-heading-toggle"><span data-icon="chevron-down"></span></span>'),t.on("click",function(){const a=!t.hasClass("is-collapsed");t.toggleClass("is-collapsed",a);let e=t.next();for(;e.length&&!e.hasClass("sidebar-heading")&&!e.hasClass("sidebar-divider");)e.toggle(!a),e=e.next()})}),Domma.icons.scan("#admin-sidebar")}M.subscribe("router:afterChange",({to:t})=>{l&&t.path!=="/login"&&t.path!=="/reset-password"&&l.setActive("#"+t.path)});const P=[{path:"/",view:"dashboard",title:"Dashboard - Domma CMS"},{path:"/pages",view:"pages",title:"Pages - Domma CMS"},{path:"/pages/new",view:"pageEditor",title:"New Page - Domma CMS"},{path:"/pages/edit/*",view:"pageEditor",title:"Edit Page - Domma CMS"},{path:"/media",view:"media",title:"Media - Domma CMS"},{path:"/navigation",view:"navigation",title:"Navigation - Domma CMS"},{path:"/layouts",view:"layouts",title:"Layouts - Domma CMS"},{path:"/settings",view:"settings",title:"Settings - Domma CMS"},{path:"/users",view:"users",title:"Users - Domma CMS"},{path:"/users/new",view:"userEditor",title:"New User - Domma CMS"},{path:"/users/edit/:id",view:"userEditor",title:"Edit User - Domma CMS"},{path:"/plugins",view:"plugins",title:"Plugins - Domma CMS"},{path:"/documentation",view:"documentation",title:"Usage - Domma CMS"},{path:"/tutorials",view:"tutorials",title:"Tutorials - Domma CMS"},{path:"/api-reference",view:"apiReference",title:"API Reference - Domma CMS"},{path:"/collections",view:"collections",title:"Collections - Domma CMS"},{path:"/collections/new",view:"collectionEditor",title:"New Collection - Domma CMS"},{path:"/collections/edit/:slug",view:"collectionEditor",title:"Edit Collection - Domma CMS"},{path:"/collections/:slug/entries",view:"collectionEntries",title:"Entries - Domma CMS"},{path:"/forms",view:"forms",title:"Forms - Domma CMS"},{path:"/forms/new",view:"formEditor",title:"New Form - Domma CMS"},{path:"/forms/edit/:slug",view:"formEditor",title:"Edit Form - Domma CMS"},{path:"/forms/:slug/submissions",view:"formSubmissions",title:"Submissions - Domma CMS"},{path:"/views",view:"viewsList",title:"Views - Domma CMS"},{path:"/views/new",view:"viewEditor",title:"New View - Domma CMS"},{path:"/views/edit/:slug",view:"viewEditor",title:"Edit View - Domma CMS"},{path:"/views/:slug/preview",view:"viewPreview",title:"View Preview - Domma CMS"},{path:"/actions",view:"actionsList",title:"Actions - Domma CMS"},{path:"/actions/new",view:"actionEditor",title:"New Action - Domma CMS"},{path:"/actions/edit/:slug",view:"actionEditor",title:"Edit Action - Domma CMS"},{path:"/pro/docs",view:"proDocs",title:"Pro Documentation - Domma CMS"},{path:"/blocks",view:"blocks",title:"Blocks - Domma CMS"},{path:"/blocks/new",view:"blockEditor",title:"New Block - Domma CMS"},{path:"/blocks/edit/:name",view:"blockEditor",title:"Edit Block - Domma CMS"},{path:"/my-profile",view:"myProfile",title:"My Profile - Domma CMS"},{path:"/roles",view:"roles",title:"Roles & Permissions - Domma CMS"},{path:"/roles/edit/:id",view:"roleEditor",title:"Edit Role - Domma CMS"},{path:"/login",view:"login",title:"Sign in - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}},{path:"/reset-password",view:"login",title:"Reset Password - Domma CMS",onEnter:()=>{$("#admin-sidebar").hide(),$("#admin-topbar").hide()}}];M.subscribe("router:afterChange",async({to:t,from:a})=>{if(t.path!=="/login"&&t.path!=="/reset-password"){if($("#admin-sidebar").show(),$("#admin-topbar").show(),a?.path==="/login"||a?.path==="/reset-password"){await g();const e=await d();p(e)}w()}}),M.subscribe("router:afterChange",()=>{setTimeout(()=>{$(".btn-primary, .btn-danger").length&&Domma.effects.reveal(".btn-primary, .btn-danger",{animation:"fade",stagger:40,duration:300})},50)}),$("#view-container").on("click",".card-collapsible .card-header",function(t){$(t.target).closest("button, a").length||$(this).closest(".card").toggleClass("card-collapsed")}),document.addEventListener("keydown",t=>{if(!(t.ctrlKey||t.metaKey)||t.key!=="s"||window.location.hash==="#/login"||window.location.hash.startsWith("#/reset-password"))return;const a=document.querySelector("#view-container .view-header button.btn-primary");a&&(t.preventDefault(),a.click())});const h={...K},r=[...P];let u=[];async function g(){if(n())try{const t=await s.plugins.adminConfig();u=t.sidebar||[],t.routes?.length&&r.push(...t.routes);for(const[a,e]of Object.entries(t.views||{}))try{const i=await import(`/plugins/${e.entry}`);h[a]=i[e.exportName]}catch{}}catch{}}function w(){const t=S();if(!t||$("#topbar-user-name").length)return;const e={admin:"Admin",manager:"Manager",editor:"Editor",subscriber:"Subscriber"}[t.role]||t.role;$("#topbar-user").html(`
|
|
2
|
+
<span id="topbar-user-name" class="topbar-user-name">${b(t.name)}</span>
|
|
3
|
+
<span class="topbar-role-badge topbar-role-badge--${b(t.role)}">${e}</span>
|
|
4
4
|
`),$("#topbar-actions").html(`
|
|
5
5
|
<a href="#/my-profile" class="topbar-action-link" data-tooltip="My Profile" data-tooltip-placement="bottom">
|
|
6
6
|
<span data-icon="user"></span>
|
|
@@ -14,4 +14,4 @@ import{getSidebarConfig as L}from"./config/sidebar-config.js";import{views as U}
|
|
|
14
14
|
<span data-icon="log-out"></span>
|
|
15
15
|
<span>Sign out</span>
|
|
16
16
|
</a>
|
|
17
|
-
`),$("#topbar-logout-btn").on("click",i=>{i.preventDefault(),
|
|
17
|
+
`),$("#topbar-logout-btn").on("click",i=>{i.preventDefault(),j()}),Domma.icons.scan("#admin-topbar"),E.tooltip("#topbar-actions [data-tooltip]",{placement:"bottom"})}function b(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}(async()=>{if(!n()&&!window.location.hash.startsWith("#/reset-password"))window.location.hash="#/login";else if(await g(),S()){const o=await d();await p(o),w()}R.init({container:"#view-container",routes:r,views:h,default:"/",transitions:{enter:"fadeIn",leave:"fadeOut",duration:150}});const t=R._extractParams.bind(R);R._extractParams=function(i,o){if(i.endsWith("/*")){const c=i.slice(0,-2);return o.startsWith(c+"/")?{}:null}return t(i,o)};const a=(window.location.hash||"#/").slice(1)||"/";r.filter(i=>i.path.endsWith("/*")).some(i=>a.startsWith(i.path.slice(0,-2)+"/"))&&R._handleRouteChange()})()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function getSidebarConfig(n=[],t={},a=[]){const e=o=>n.includes(o)||["read","create","update","delete"].some(
|
|
1
|
+
export function getSidebarConfig(n=[],t={},a=[]){const e=o=>n.includes(o)||["read","create","update","delete"].some(u=>n.includes(`${o}.${u}`)),s=o=>o==null?null:typeof o=="string"?o.length>0?o:null:o>0?String(o):null,i=[];return i.push({heading:"Overview"},{id:"dashboard",text:"Dashboard",icon:"home",url:"#/",section:"#/"},{divider:!0}),(e("navigation")||e("layouts"))&&i.push({heading:"Structure"},...e("navigation")?[{id:"navigation",text:"Navigation",icon:"menu",url:"#/navigation",section:"#/navigation",badge:s(t.navigation)}]:[],...e("layouts")?[{id:"layouts",text:"Layouts",icon:"layout",url:"#/layouts",section:"#/layouts",badge:s(t.layouts)}]:[],{divider:!0}),i.push({heading:"Content"}),e("pages")&&i.push({id:"pages",text:"Pages",icon:"file-text",url:"#/pages",section:"#/pages",badge:s(t.pages)}),e("media")&&i.push({id:"media",text:"Media",icon:"image",url:"#/media",section:"#/media",badge:s(t.media)}),(e("collections")||e("views")||e("actions"))&&(i.push({divider:!0},{heading:"Data"}),e("collections")&&(i.push({id:"collections",text:"Collections",icon:"database",url:"#/collections",section:"#/collections",badge:s(t.collections)}),i.push({id:"forms",text:"Forms",icon:"layout",url:"#/forms",section:"#/forms",badge:s(t.forms)})),e("views")&&i.push({id:"views",text:"Views",icon:"eye",url:"#/views",section:"#/views",badge:s(t.views)}),e("actions")&&i.push({id:"actions",text:"Actions",icon:"zap",url:"#/actions",section:"#/actions",badge:s(t.actions)}),e("pages")&&i.push({id:"blocks",text:"Blocks",icon:"box",url:"#/blocks",section:"#/blocks",badge:s(t.blocks)})),i.push({divider:!0},{heading:"Configuration"}),e("plugins")&&i.push({id:"roles",text:"Roles",icon:"shield",url:"#/roles",section:"#/roles",badge:s(t.roles)}),e("users")&&i.push({id:"users",text:"Users",icon:"users",url:"#/users",section:"#/users",badge:s(t.users)}),e("settings")&&i.push({id:"settings",text:"Site Settings",icon:"settings",url:"#/settings",section:"#/settings"}),i.push({divider:!0},{heading:"Plugins"}),e("plugins")&&(i.push({id:"plugins",text:"Plugins",icon:"package",url:"#/plugins",section:"#/plugins",badge:s(t.plugins)}),i.push(...a)),(e("navigation")||e("layouts")||e("settings"))&&i.push({divider:!0},{heading:"Pro"},{id:"pro-docs",text:"Documentation",icon:"zap",url:"#/pro/docs",section:"#/pro/docs"}),i.push({divider:!0},{heading:"Account"},{id:"my-profile",text:"My Profile",icon:"user",url:"#/my-profile",section:"#/my-profile"}),i.push({divider:!0},{heading:"View Site"},{id:"view-site",text:"View Site",icon:"external-link",url:"/",section:"/"}),i.push({divider:!0},{heading:"Documentation"},{id:"documentation",text:"Usage",icon:"book",url:"#/documentation",section:"#/documentation",badge:s(t.documents)},{id:"tutorials",text:"Tutorials",icon:"document",url:"#/tutorials",section:"#/documentation",badge:s(t.tutorials)},{id:"api-reference",text:"API Reference",icon:"code",url:"#/api-reference",section:"#/documentation"}),i}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function z(){I.register("bold",{viewBox:"0 0 24 24",path:"M7 5H14a3 3 0 0 1 0 6H7V5zM7 11H15a3 3 0 0 1 0 6H7V11z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("italic",{viewBox:"0 0 24 24",path:"M11 5h4M9 19h4M13 5l-2 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("strikethrough",{viewBox:"0 0 24 24",path:"M16 4H9a3 3 0 0 0 0 6h6a3 3 0 0 1 0 6H6M3 12h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("quote",{viewBox:"0 0 24 24",path:"M3 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zM15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("eye",{viewBox:"0 0 24 24",path:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("expand",{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("columns",{viewBox:"0 0 24 24",path:"M3 4h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("card",{viewBox:"0 0 24 24",paths:["M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z","M3 9h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("help-circle",{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 17h.01M12 13a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("spacer-insert",{viewBox:"0 0 24 24",paths:["M3 8h18","M3 16h18","M12 8v8"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("icon-pick",{viewBox:"0 0 24 24",paths:["M4 4h6v6H4z","M14 4h6v6h-6z","M4 14h6v6H4z","M14 14h6v6h-6z"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("sparkles",{viewBox:"0 0 24 24",paths:["M12 3L13.5 8.5H19L14.5 11.5L16 17L12 14L8 17L9.5 11.5L5 8.5H10.5L12 3Z","M19 3L19.7 5.3H22L20.2 6.6L20.9 9L19 7.7L17.1 9L17.8 6.6L16 5.3H18.3L19 3Z","M5 13L5.5 14.7H7L5.8 15.5L6.3 17.2L5 16.3L3.7 17.2L4.2 15.5L3 14.7H4.5L5 13Z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}export function wrapSelection(e,t,p){const i=e.selectionStart,
|
|
1
|
+
function z(){I.register("bold",{viewBox:"0 0 24 24",path:"M7 5H14a3 3 0 0 1 0 6H7V5zM7 11H15a3 3 0 0 1 0 6H7V11z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("italic",{viewBox:"0 0 24 24",path:"M11 5h4M9 19h4M13 5l-2 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("strikethrough",{viewBox:"0 0 24 24",path:"M16 4H9a3 3 0 0 0 0 6h6a3 3 0 0 1 0 6H6M3 12h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("quote",{viewBox:"0 0 24 24",path:"M3 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zM15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("eye",{viewBox:"0 0 24 24",path:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("expand",{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("columns",{viewBox:"0 0 24 24",path:"M3 4h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("card",{viewBox:"0 0 24 24",paths:["M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z","M3 9h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("help-circle",{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 17h.01M12 13a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("spacer-insert",{viewBox:"0 0 24 24",paths:["M3 8h18","M3 16h18","M12 8v8"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("icon-pick",{viewBox:"0 0 24 24",paths:["M4 4h6v6H4z","M14 4h6v6h-6z","M4 14h6v6H4z","M14 14h6v6h-6z"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("btn-insert",{viewBox:"0 0 24 24",paths:["M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z","M8 12h8M12 9v6"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("link-shortcode",{viewBox:"0 0 24 24",paths:["M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71","M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),I.register("sparkles",{viewBox:"0 0 24 24",paths:["M12 3L13.5 8.5H19L14.5 11.5L16 17L12 14L8 17L9.5 11.5L5 8.5H10.5L12 3Z","M19 3L19.7 5.3H22L20.2 6.6L20.9 9L19 7.7L17.1 9L17.8 6.6L16 5.3H18.3L19 3Z","M5 13L5.5 14.7H7L5.8 15.5L6.3 17.2L5 16.3L3.7 17.2L4.2 15.5L3 14.7H4.5L5 13Z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}export function wrapSelection(e,t,p){const i=e.selectionStart,s=e.selectionEnd,n=e.value,r=n.substring(i,s);r?(e.value=n.substring(0,i)+t+r+p+n.substring(s),e.selectionStart=i+t.length,e.selectionEnd=s+t.length):(e.value=n.substring(0,i)+t+p+n.substring(i),e.selectionStart=e.selectionEnd=i+t.length),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()}export function insertAtCursor(e,t){const p=e.selectionStart,i=e.value;e.value=i.substring(0,p)+t+i.substring(p),e.selectionStart=e.selectionEnd=p+t.length,e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()}export function insertLine(e,t){const p=e.selectionStart,i=e.value,s=i.lastIndexOf(`
|
|
2
2
|
`,p-1)+1,n=i.indexOf(`
|
|
3
|
-
`,
|
|
3
|
+
`,s),r=i.substring(s,n===-1?i.length:n);if(r.startsWith(t)){const l=n===-1?"":i.substring(n);e.value=i.substring(0,s)+r.substring(t.length)+l,e.selectionStart=e.selectionEnd=Math.max(s,p-t.length)}else e.value=i.substring(0,s)+t+i.substring(s),e.selectionStart=e.selectionEnd=p+t.length;e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()}const B=[{category:"Entrance"},{label:"Reveal (fade)",snippet:e=>`[reveal animation="fade"]
|
|
4
4
|
${e||"Content"}
|
|
5
5
|
[/reveal]`},{label:"Reveal (slide up)",snippet:e=>`[reveal animation="slide-up"]
|
|
6
6
|
${e||"Content"}
|
|
@@ -29,10 +29,10 @@ ${e||"Content"}
|
|
|
29
29
|
[/firework]`},{label:"Fireworks show",snippet:()=>`[fireworks]
|
|
30
30
|
[firework type="burst" colour="rainbow" /]
|
|
31
31
|
[firework type="sparkle" colour="primary" /]
|
|
32
|
-
[/fireworks]`,insert:!0},{label:"Celebrate",snippet:()=>'[celebrate theme="auto" intensity="medium" /]',insert:!0}];function
|
|
33
|
-
`)});const o=t.getBoundingClientRect(),
|
|
32
|
+
[/fireworks]`,insert:!0},{label:"Celebrate",snippet:()=>'[celebrate theme="auto" intensity="medium" /]',insert:!0}];function N(e,t){const p=document.querySelector(".editor-effects-dropdown-menu");if(p){p.remove();return}const i=document.createElement("div");i.className="editor-effects-dropdown-menu",B.forEach(function(l){if(l.category){const d=document.createElement("div");d.className="editor-effects-category",d.textContent=l.category,i.appendChild(d)}else{const d=document.createElement("button");d.type="button",d.className="editor-effects-item",d.textContent=l.label,d.addEventListener("click",function(){if(i.remove(),l.insert)insertAtCursor(e,l.snippet(""));else{const c=e.selectionStart,m=e.selectionEnd,o=e.value.substring(c,m),a=l.snippet(o);e.value=e.value.substring(0,c)+a+e.value.substring(m),e.selectionStart=c,e.selectionEnd=c+a.length,e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()}}),i.appendChild(d)}});const s=t.getBoundingClientRect(),n=t.closest(".editor-toolbar").getBoundingClientRect();i.style.top=s.bottom-n.top+4+"px",i.style.left=s.left-n.left+"px",t.closest(".editor-toolbar").appendChild(i);function r(l){!i.contains(l.target)&&l.target!==t&&(i.remove(),document.removeEventListener("click",r,!0))}setTimeout(function(){document.addEventListener("click",r,!0)},0)}const L=["activity","airpods","airport","alert-circle","alert-warning","ambulance","angry","annoyed","apartment","arch","archive","arrow-down","arrow-down-left","arrow-down-right","arrow-left","arrow-right","arrow-up","arrow-up-left","arrow-up-right","astonished","at-sign","attachment","award","badge","ban","bandage","bank","banknote","barbell","barcode","barn","baseball","basketball","battery","battery-charging","bauble","bell","bell-off","bells","bicycle","bitcoin","blood-drop","blush","bold","bone","book","book-closed","book-open","bookmark","bookmark-filled","bowling","box","boxing-glove","brain","bridge","briefcase","building","bus","cabin","cake","calculator","calendar","camera","camera-off","candy-cane","capsule","car","cart","cart-add","cash","cast","castle","chart-area","chart-bar","chart-bar-horizontal","chart-candlestick","chart-line","chart-pie","chat","chat-alt","check","check-circle","check-circle-filled","check-square","chevron-down","chevron-left","chevron-right","chevron-up","chevrons-down","chevrons-left","chevrons-right","chevrons-up","church","circle","circle-filled","clear-format","clipboard","clipboard-check","clipboard-list","clock","close","cloud","cloud-download","cloud-drizzle","cloud-lightning","cloud-off","cloud-rain","cloud-sun","cloud-upload","code","code-block","code-inline","cog","coins","columns","comment","compass","component","confused","cool","copy","corner-down-left","corner-down-right","corner-up-left","corner-up-right","court","cpu","credit-card","crown","crutch","cry","currency-dollar","currency-euro","currency-pound","cycling","database","dead","desktop","disappointed","dna","document","document-add","document-check","document-remove","document-text","dollar-sign","dome","dot","dots-horizontal","dots-vertical","download","droplet","droplets","dumbbell","edit","embed","emoji-happy","emoji-sad","euro-sign","exclamation","expand","expressionless","external-link","eye","eye-medical","eye-off","factory","fast-forward","feather","file-code","file-text","file-zip","fill","film","filter","fire","first-aid","fishing","flag","fog","folder","folder-add","folder-minus","folder-open","folder-plus","folder-remove","football","fortress","fuel","gamepad","garage","gauge","gift","git-branch","github","globe","golf","grid","grin","growth","hard-drive","hash","haze","heading-1","heading-2","heading-3","headphones","heart","heart-eyes","heart-filled","heart-pulse","heartbeat","help-circle","holly","home","hospital","hotel","house","image","image-add","images","inbox","indent","info","info-filled","investment","invoice","italic","joy","joystick","key","kettlebell","keyboard","laptop","laugh","layers","layout","library","lighthouse","lightning","link","link-2","link-add","linkedin","list","list-bullet","list-numbered","loader","loading","lock","log-in","log-out","lungs","mail","mail-open","map","map-pin","mask","maximize","medal","medical-cross","menu","menu-alt","message-circle","message-square","mic","mic-off","microscope","minimize","minus","minus-circle","minus-square","monitor","monument","moon","moon-star","more-horizontal","more-vertical","mosque","motorcycle","mountain","mouse","mouse-pointer","move","museum","music","nerd","neutral","notification","obelisk","office","outdent","package","palette","panel-bottom","panel-left","panel-right","panel-top","paperclip","parking","pause","pause-filled","percent","phone","phone-call","phone-incoming","phone-off","phone-outgoing","piggy-bank","pill","pill-bottle","pin","play","play-circle","play-filled","plug","plus","plus-circle","plus-square","podium","pound-sign","printer","pulse","pyramid","qrcode","question","quote","racket","radio","rage","rain","rainbow","receipt","redo","refresh","refresh-cw","reindeer","rewind","road","rotate-ccw","rotate-cw","router","rss","running","sad","safe","save","scale","scale-weight","school","search","send","server","settings","share","share-2","share-alt","shield","shield-alert","shield-check","shield-x","shipping","shocked","shopping-bag","shrink","sick","sidebar-left","sidebar-right","silly","skate","ski","skip-back","skip-forward","skyscraper","sleepy","sleigh","sliders","smartphone","smartwatch","smile","snow","snowflake","snowman","sob","soccer","sort","sparkles","speaker","spinner","square","stadium","star","star-decoration","star-eyes","star-filled","stethoscope","stop","stop-filled","stopwatch","store","strikethrough","sun","sunrise","sunset","surfboard","surprised","swimming","sync","syringe","tablet","tablet-smartphone","tag","tags","target","taxi","temple","tennis","tent","terminal","test-tube","text-center","text-left","text-right","thermometer","thermometer-medical","thermometer-sun","thinking","thumb-down","thumb-up","tongue","tool","tooth","tower","train-station","trash","tree","trending-down","trending-neutral","trending-up","trophy","truck","tv","tv-minimal","twitter","type","umbrella","underline","undo","university","unlink","unlock","upload","usb","user","user-add","user-check","user-group","user-plus","user-remove","users","vaccine","van","vault","video","video-off","volleyball","volume","volume-down","volume-mute","volume-off","volume-up","wallet","warehouse","warning","warning-filled","watch","webcam","wheelchair","whistle","wifi","wifi-off","wind","windmill","wink","wreath","x","x-circle","x-circle-filled","yoga","youtube","zany","zap"];function H(e,t,p){const i=document.querySelector(".editor-spacer-picker");if(i){i.remove();return}const s=document.createElement("div");s.className="editor-spacer-picker";const n=document.createElement("div");n.className="editor-spacer-picker-label",n.textContent="Spacer height",s.appendChild(n);const r=document.createElement("div");r.className="editor-spacer-picker-row";const l=document.createElement("input");l.type="range",l.className="editor-spacer-slider",l.min="4",l.max="200",l.step="4",l.value=p;const d=document.createElement("span");d.className="editor-spacer-slider-value",d.textContent=p+"px",l.addEventListener("input",function(){d.textContent=this.value+"px"}),r.appendChild(l),r.appendChild(d),s.appendChild(r);const c=document.createElement("button");c.type="button",c.className="btn btn-primary btn-sm editor-spacer-insert-btn",c.textContent="Insert",s.appendChild(c);function m(b){!s.contains(b.target)&&b.target!==t&&(s.remove(),document.removeEventListener("click",m,!0))}c.addEventListener("click",function(){s.remove(),document.removeEventListener("click",m,!0),insertAtCursor(e,`[spacer size="${l.value}" /]
|
|
33
|
+
`)});const o=t.getBoundingClientRect(),a=t.closest(".editor-toolbar").getBoundingClientRect();s.style.top=o.bottom-a.top+4+"px";const u=o.left-a.left;s.style.left=Math.min(u,a.width-240-8)+"px",t.closest(".editor-toolbar").appendChild(s),setTimeout(function(){document.addEventListener("click",m,!0)},0)}function q(e,t){const p=document.querySelector(".editor-icon-picker");if(p){p.remove();return}const i=document.createElement("div");i.className="editor-icon-picker";const s=document.createElement("input");s.type="text",s.className="form-input editor-icon-picker-search",s.placeholder="Search icons\u2026",i.appendChild(s);const n=document.createElement("div");n.className="editor-icon-picker-size-row";const r=document.createElement("label");r.textContent="Size (px)";const l=document.createElement("input");l.type="number",l.className="form-input editor-icon-picker-size",l.placeholder="default",l.min="8",l.max="256",n.appendChild(r),n.appendChild(l),i.appendChild(n);const d=document.createElement("div");d.className="editor-icon-picker-grid",i.appendChild(d);function c(g){!i.contains(g.target)&&g.target!==t&&(i.remove(),document.removeEventListener("click",c,!0))}function m(g){d.textContent="";const k=g?L.filter(f=>f.includes(g.toLowerCase())):L;if(k.length===0){const f=document.createElement("div");f.className="editor-icon-picker-empty",f.textContent="No icons found",d.appendChild(f);return}k.forEach(function(f){const v=document.createElement("button");v.type="button",v.className="editor-icon-picker-item";const w=document.createElement("span");w.setAttribute("data-icon",f);const y=document.createElement("span");y.textContent=f,v.appendChild(w),v.appendChild(y),v.addEventListener("click",function(){i.remove(),document.removeEventListener("click",c,!0);const C=l.value.trim(),M=C?`[icon name="${f}" size="${C}" /]`:`[icon name="${f}" /]`;insertAtCursor(e,M)}),d.appendChild(v)}),Domma.icons.scan(d)}m(""),s.addEventListener("input",function(){m(this.value.trim())});const o=t.getBoundingClientRect(),a=t.closest(".editor-toolbar").getBoundingClientRect();i.style.top=o.bottom-a.top+4+"px";const u=o.left-a.left,b=320,h=a.width;i.style.left=Math.min(u,h-b-8)+"px",t.closest(".editor-toolbar").appendChild(i),requestAnimationFrame(function(){s.focus()}),setTimeout(function(){document.addEventListener("click",c,!0)},0)}function A(e,t,p,i){const s=document.querySelector(".editor-toolbar-dropdown");if(s){s.remove();return}const n=document.createElement("div");n.className="editor-toolbar-dropdown",p.forEach(function(m){const o=document.createElement("button");if(o.type="button",o.className="editor-toolbar-dropdown-item",m.icon){const u=document.createElement("span");u.setAttribute("data-icon",m.icon),o.appendChild(u)}const a=document.createElement("span");a.textContent=m.label,o.appendChild(a),o.addEventListener("click",function(){n.remove(),document.removeEventListener("click",c,!0),x(m.action,e,t,i)}),n.appendChild(o)});const r=t.getBoundingClientRect(),l=t.closest(".editor-toolbar").getBoundingClientRect();n.style.top=r.bottom-l.top+4+"px";const d=r.left-l.left;n.style.left=Math.min(d,l.width-180-8)+"px",t.closest(".editor-toolbar").appendChild(n),Domma.icons.scan(n);function c(m){!n.contains(m.target)&&m.target!==t&&(n.remove(),document.removeEventListener("click",c,!0))}setTimeout(function(){document.addEventListener("click",c,!0)},0)}function x(e,t,p,i){const{spacerDefault:s,handlers:n}=i;if(typeof e=="function")e(t);else if(e==="button")if(n.button)n.button(t);else{const r=t.selectionStart,l=t.selectionEnd,c=`[button href="" variant="primary"]${t.value.substring(r,l)||"Click me"}[/button]`;t.value=t.value.substring(0,r)+c+t.value.substring(l),t.selectionStart=t.selectionEnd=r+14,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else if(e==="linksc")if(n.linksc)n.linksc(t);else{const r=t.selectionStart,l=t.selectionEnd,c=`[link href=""]${t.value.substring(r,l)||"Link text"}[/link]`;t.value=t.value.substring(0,r)+c+t.value.substring(l),t.selectionStart=t.selectionEnd=r+12,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else if(e==="link")n.link&&n.link(t);else if(e==="image")n.image&&n.image(t);else if(e==="card")if(n.card)n.card(t);else{const r=t.selectionStart,l=t.selectionEnd,c=`[card title="Card Title"]
|
|
34
34
|
${t.value.substring(r,l)||"Content here"}
|
|
35
|
-
[/card]`;t.value=t.value.substring(0,r)+
|
|
35
|
+
[/card]`;t.value=t.value.substring(0,r)+c+t.value.substring(l),t.selectionStart=r+13,t.selectionEnd=r+23,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else if(e==="grid")if(n.grid)n.grid(t);else{const r=t.selectionStart,l=`[grid cols="2" gap="4"]
|
|
36
36
|
[col]
|
|
37
37
|
Column 1
|
|
38
38
|
[/col]
|
|
@@ -40,7 +40,7 @@ Column 1
|
|
|
40
40
|
Column 2
|
|
41
41
|
[/col]
|
|
42
42
|
[/grid]
|
|
43
|
-
`;t.value=t.value.substring(0,r)+l+t.value.substring(r),t.selectionStart=t.selectionEnd=r+l.length,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else if(e==="badge"){const r=t.selectionStart,l=t.selectionEnd,
|
|
43
|
+
`;t.value=t.value.substring(0,r)+l+t.value.substring(r),t.selectionStart=t.selectionEnd=r+l.length,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else if(e==="badge"){const r=t.selectionStart,l=t.selectionEnd,c=`[badge variant="primary"]${t.value.substring(r,l)||"New"}[/badge]`;t.value=t.value.substring(0,r)+c+t.value.substring(l),t.selectionStart=r+16,t.selectionEnd=r+23,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else if(e==="timeline"){const r=t.selectionStart,l=`[timeline layout="vertical"]
|
|
44
44
|
[event title="First Event" date="${new Date().toISOString().slice(0,10)}" status="completed"]
|
|
45
45
|
Describe this event.
|
|
46
46
|
[/event]
|
|
@@ -48,7 +48,7 @@ Describe this event.
|
|
|
48
48
|
Describe this event.
|
|
49
49
|
[/event]
|
|
50
50
|
[/timeline]
|
|
51
|
-
`;t.value=t.value.substring(0,r)+l+t.value.substring(r),t.selectionStart=t.selectionEnd=r+l.length,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else e==="effects"?n.effects?n.effects(t):
|
|
51
|
+
`;t.value=t.value.substring(0,r)+l+t.value.substring(r),t.selectionStart=t.selectionEnd=r+l.length,t.dispatchEvent(new Event("input",{bubbles:!0})),t.focus()}else e==="effects"?n.effects?n.effects(t):N(t,p):e==="spacerpick"?H(t,p,s):e==="iconpick"?q(t,p):e==="collection"?n.collection?n.collection(t):insertAtCursor(t,'[collection slug="" display="table" /]'):e==="view"?n.view&&n.view(t):e==="cta"?n.cta&&n.cta(t):e==="form"?n.form?n.form(t):insertAtCursor(t,'[form slug="" /]'):e==="help"&&n.help&&n.help(t)}const S=[{icon:"bold",title:"Bold (Ctrl+B)",action:e=>wrapSelection(e,"**","**")},{icon:"italic",title:"Italic (Ctrl+I)",action:e=>wrapSelection(e,"_","_")},{icon:"strikethrough",title:"Strikethrough",action:e=>wrapSelection(e,"~~","~~")},"|",{type:"dropdown",icon:"heading-1",title:"Headings",items:[{label:"Heading 1",icon:"heading-1",action:e=>insertLine(e,"# ")},{label:"Heading 2",icon:"heading-2",action:e=>insertLine(e,"## ")},{label:"Heading 3",icon:"heading-3",action:e=>insertLine(e,"### ")}]},"|",{icon:"list-bullet",title:"Bullet list",action:e=>insertLine(e,"- ")},{icon:"list-numbered",title:"Numbered list",action:e=>insertLine(e,"1. ")},"|",{type:"dropdown",icon:"quote",title:"Paragraph",items:[{label:"Blockquote",icon:"quote",action:e=>insertLine(e,"> ")},{label:"Horizontal rule",icon:"minus-circle",action:e=>insertAtCursor(e,`
|
|
52
52
|
---
|
|
53
|
-
`)}]},"|",{
|
|
54
|
-
`,n.selectionStart-1)+1,
|
|
53
|
+
`)}]},"|",{type:"dropdown",icon:"code-inline",title:"Code",items:[{label:"Inline code",icon:"code-inline",action:e=>wrapSelection(e,"`","`")},{label:"Code block",icon:"code-block",action:e=>wrapSelection(e,"\n```\n","\n```\n")}]},"|",{type:"dropdown",icon:"plus-circle",title:"Insert",items:[{label:"Image",icon:"image-add",action:"image"},{label:"Card",icon:"card",action:"card"},{label:"Grid",icon:"columns",action:"grid"},{label:"Badge",icon:"badge",action:"badge"},{label:"Timeline",icon:"activity",action:"timeline"},{label:"Spacer",icon:"spacer-insert",action:"spacerpick"},{label:"Icon",icon:"icon-pick",action:"iconpick"},{label:"Collection",icon:"database",action:"collection"},{label:"View",icon:"eye",action:"view"},{label:"Button",icon:"btn-insert",action:"button"},{label:"Link",icon:"link-shortcode",action:"linksc"},{label:"CTA Button",icon:"mouse-pointer",action:"cta"},{label:"Form",icon:"file-text",action:"form"}]},"|",{icon:"sparkles",title:"Effects",action:"effects"},{icon:"help-circle",title:"Editor help",action:"help"}];export function createToolbar(e,t,p={}){z();const i={link:null,image:null,card:null,grid:null,help:null,effects:null,collection:null,view:null,cta:null,form:null,button:null,linksc:null},s=p.spacerDefault??40,n=e.get(0),r=t.get(0);r.textContent="",S.forEach((o,a)=>{if(o==="|"){const u=document.createElement("span");u.className="editor-toolbar-sep",r.appendChild(u)}else{const u=document.createElement("button");u.className=o.type==="dropdown"?"editor-toolbar-btn editor-toolbar-dropdown-trigger":"editor-toolbar-btn",u.setAttribute("data-tooltip",o.title),u.setAttribute("data-idx",String(a)),u.type="button";const b=document.createElement("span");if(b.setAttribute("data-icon",o.icon),u.appendChild(b),o.type==="dropdown"){const h=document.createElement("span");h.className="editor-toolbar-caret",h.textContent="\u25BE",u.appendChild(h)}r.appendChild(u)}});const l=document.createElement("div");l.className="editor-toolbar-right",[{mode:"split",icon:"columns",label:"Split view",active:!0},{mode:"write",icon:"file-text",label:"Write only",active:!1},{mode:"preview",icon:"eye",label:"Preview only",active:!1}].forEach(o=>{const a=document.createElement("button");a.className="editor-view-btn"+(o.active?" active":""),a.setAttribute("data-mode",o.mode),a.setAttribute("data-tooltip",o.label),a.type="button";const u=document.createElement("span");u.setAttribute("data-icon",o.icon),a.appendChild(u),l.appendChild(a)});const d=document.createElement("span");d.className="editor-toolbar-sep",l.appendChild(d);const c=document.createElement("button");c.id="fullscreen-btn",c.className="editor-toolbar-btn",c.setAttribute("data-tooltip","Toggle fullscreen"),c.type="button";const m=document.createElement("span");return m.setAttribute("data-icon","expand"),c.appendChild(m),l.appendChild(c),r.appendChild(l),Domma.icons.scan(),r.querySelectorAll("[data-tooltip]").forEach(o=>{E.tooltip(o,{content:o.getAttribute("data-tooltip"),position:"top"})}),t.on("click",".editor-toolbar-btn[data-idx]",function(){const o=parseInt($(this).data("idx"),10),a=S[o];if(!a||a==="|")return;const u=t.get(0).querySelector(`[data-idx="${o}"]`),b={spacerDefault:s,handlers:i};a.type==="dropdown"?A(n,u,a.items,b):x(a.action,n,u,b)}),e.on("keydown",function(o){const a=o.key.toLowerCase();if(o.ctrlKey||o.metaKey)a==="b"?(o.preventDefault(),wrapSelection(n,"**","**")):a==="i"?(o.preventDefault(),wrapSelection(n,"_","_")):a==="k"&&(o.preventDefault(),i.link&&i.link(n));else if(o.key==="Tab")if(o.preventDefault(),o.shiftKey){const u=n.value.lastIndexOf(`
|
|
54
|
+
`,n.selectionStart-1)+1,b=n.value.substring(u),h=b.match(/^ {1,4}/);if(h){const g=n.value.substring(0,u),k=n.value.substring(u+h[0].length);n.value=g+b.substring(h[0].length),n.selectionStart=n.selectionEnd=Math.max(u,n.selectionStart-h[0].length),n.dispatchEvent(new Event("input",{bubbles:!0}))}}else insertAtCursor(n," ")}),{$toolbar:t,onLink(o){i.link=o},onImage(o){i.image=o},onCard(o){i.card=o},onGrid(o){i.grid=o},onHelp(o){i.help=o},onEffects(o){i.effects=o},onCollection(o){i.collection=o},onView(o){i.view=o},onCta(o){i.cta=o},onForm(o){i.form=o},onButton(o){i.button=o},onLinkShortcode(o){i.linksc=o}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const THEMES=[{id:"charcoal-dark",label:"Charcoal",dark:!0,primary:"#5b8cff",bg:"#1a1d23"},{id:"charcoal-light",label:"Charcoal",dark:!1,primary:"#4a7aff",bg:"#f4f5f7"},{id:"ocean-dark",label:"Ocean",dark:!0,primary:"#00b4d8",bg:"#0d1b2a"},{id:"ocean-light",label:"Ocean",dark:!1,primary:"#0096c7",bg:"#e8f4f8"},{id:"forest-dark",label:"Forest",dark:!0,primary:"#52b788",bg:"#1a231e"},{id:"forest-light",label:"Forest",dark:!1,primary:"#40916c",bg:"#f0f7f4"},{id:"sunset-dark",label:"Sunset",dark:!0,primary:"#ff6b6b",bg:"#1f1a1a"},{id:"sunset-light",label:"Sunset",dark:!1,primary:"#e05555",bg:"#fff0f0"},{id:"royal-dark",label:"Royal",dark:!0,primary:"#9b59b6",bg:"#1a1525"},{id:"royal-light",label:"Royal",dark:!1,primary:"#8e44ad",bg:"#f5f0fa"},{id:"lemon-dark",label:"Lemon",dark:!0,primary:"#f1c40f",bg:"#1a1a10"},{id:"lemon-light",label:"Lemon",dark:!1,primary:"#d4ac0d",bg:"#fffef0"},{id:"silver-dark",label:"Silver",dark:!0,primary:"#95a5a6",bg:"#1c1e20"},{id:"silver-light",label:"Silver",dark:!1,primary:"#7f8c8d",bg:"#f2f3f4"},{id:"grayve-dark",label:"Grayve",dark:!0,primary:"#00bcd4",bg:"#1a1e21"},{id:"grayve-light",label:"Grayve",dark:!1,primary:"#00838f",bg:"#ffffff"},{id:"mint-dark",label:"Mint",dark:!0,primary:"#00c896",bg:"#0f1f1a"},{id:"mint-light",label:"Mint",dark:!1,primary:"#00a878",bg:"#f0faf6"},{id:"unicorn-dark",label:"Unicorn",dark:!0,primary:"#e040fb",bg:"#1a0a1e"},{id:"unicorn-light",label:"Unicorn",dark:!1,primary:"#ba68c8",bg:"#fdf5ff"},{id:"dreamy-dark",label:"Dreamy",dark:!0,primary:"#7986cb",bg:"#15152a"},{id:"dreamy-light",label:"Dreamy",dark:!1,primary:"#5c6bc0",bg:"#f3f4fd"},{id:"christmas-dark",label:"Christmas",dark:!0,primary:"#e53935",bg:"#0a1a0a"},{id:"christmas-light",label:"Christmas",dark:!1,primary:"#c62828",bg:"#f5fff5"},{id:"wedding-dark",label:"Wedding",dark:!0,primary:"#ec407a",bg:"#1a0e14"},{id:"wedding-light",label:"Wedding",dark:!1,primary:"#e91e63",bg:"#fff5f8"}];export function populateThemeSelect(r,{includeDefault:f=!1,defaultLabel:t="\u2014 Use site default \u2014"}={}){for(;r.firstChild;)r.removeChild(r.firstChild);if(f){const a=document.createElement("option");a.value="",a.textContent=t,r.appendChild(a)}const i=new Set;for(const a of THEMES)if(!i.has(a.label)){i.add(a.label);const l=document.createElement("optgroup");l.label=a.label;for(const d of THEMES.filter(e=>e.label===a.label)){const e=document.createElement("option");e.value=d.id,e.textContent=`${d.label} ${d.dark?"Dark":"Light"}`,l.appendChild(e)}r.appendChild(l)}}
|
|
@@ -94,27 +94,7 @@
|
|
|
94
94
|
<div class="row mb-3">
|
|
95
95
|
<div class="col-6">
|
|
96
96
|
<label class="form-label">Theme Override</label>
|
|
97
|
-
|
|
98
|
-
<option value="">— Use site default —</option>
|
|
99
|
-
<option value="charcoal-dark">Charcoal Dark</option>
|
|
100
|
-
<option value="charcoal-light">Charcoal Light</option>
|
|
101
|
-
<option value="ocean-dark">Ocean Dark</option>
|
|
102
|
-
<option value="ocean-light">Ocean Light</option>
|
|
103
|
-
<option value="forest-dark">Forest Dark</option>
|
|
104
|
-
<option value="forest-light">Forest Light</option>
|
|
105
|
-
<option value="sunset-dark">Sunset Dark</option>
|
|
106
|
-
<option value="sunset-light">Sunset Light</option>
|
|
107
|
-
<option value="royal-dark">Royal Dark</option>
|
|
108
|
-
<option value="royal-light">Royal Light</option>
|
|
109
|
-
<option value="lemon-dark">Lemon Dark</option>
|
|
110
|
-
<option value="lemon-light">Lemon Light</option>
|
|
111
|
-
<option value="silver-dark">Silver Dark</option>
|
|
112
|
-
<option value="silver-light">Silver Light</option>
|
|
113
|
-
<option value="grayve-dark">Grayve Dark</option>
|
|
114
|
-
<option value="grayve-light">Grayve Light</option>
|
|
115
|
-
<option value="mint-dark">Mint Dark</option>
|
|
116
|
-
<option value="mint-light">Mint Light</option>
|
|
117
|
-
</select>
|
|
97
|
+
<select id="field-theme" class="form-select"></select>
|
|
118
98
|
<small class="form-hint">Overrides the site-wide theme for this page only.</small>
|
|
119
99
|
</div>
|
|
120
100
|
</div>
|
|
@@ -64,119 +64,13 @@
|
|
|
64
64
|
<div class="row">
|
|
65
65
|
<div class="col-6">
|
|
66
66
|
<label class="form-label">Public Site Theme</label>
|
|
67
|
-
|
|
68
|
-
<optgroup label="Charcoal">
|
|
69
|
-
<option value="charcoal-dark">Charcoal Dark</option>
|
|
70
|
-
<option value="charcoal-light">Charcoal Light</option>
|
|
71
|
-
</optgroup>
|
|
72
|
-
<optgroup label="Ocean">
|
|
73
|
-
<option value="ocean-dark">Ocean Dark</option>
|
|
74
|
-
<option value="ocean-light">Ocean Light</option>
|
|
75
|
-
</optgroup>
|
|
76
|
-
<optgroup label="Forest">
|
|
77
|
-
<option value="forest-dark">Forest Dark</option>
|
|
78
|
-
<option value="forest-light">Forest Light</option>
|
|
79
|
-
</optgroup>
|
|
80
|
-
<optgroup label="Sunset">
|
|
81
|
-
<option value="sunset-dark">Sunset Dark</option>
|
|
82
|
-
<option value="sunset-light">Sunset Light</option>
|
|
83
|
-
</optgroup>
|
|
84
|
-
<optgroup label="Royal">
|
|
85
|
-
<option value="royal-dark">Royal Dark</option>
|
|
86
|
-
<option value="royal-light">Royal Light</option>
|
|
87
|
-
</optgroup>
|
|
88
|
-
<optgroup label="Lemon">
|
|
89
|
-
<option value="lemon-dark">Lemon Dark</option>
|
|
90
|
-
<option value="lemon-light">Lemon Light</option>
|
|
91
|
-
</optgroup>
|
|
92
|
-
<optgroup label="Silver">
|
|
93
|
-
<option value="silver-dark">Silver Dark</option>
|
|
94
|
-
<option value="silver-light">Silver Light</option>
|
|
95
|
-
</optgroup>
|
|
96
|
-
<optgroup label="Unicorn">
|
|
97
|
-
<option value="unicorn-dark">Unicorn Dark</option>
|
|
98
|
-
<option value="unicorn-light">Unicorn Light</option>
|
|
99
|
-
</optgroup>
|
|
100
|
-
<optgroup label="Dreamy">
|
|
101
|
-
<option value="dreamy-dark">Dreamy Dark</option>
|
|
102
|
-
<option value="dreamy-light">Dreamy Light</option>
|
|
103
|
-
</optgroup>
|
|
104
|
-
<optgroup label="Grayve">
|
|
105
|
-
<option value="grayve-dark">Grayve Dark</option>
|
|
106
|
-
<option value="grayve-light">Grayve Light</option>
|
|
107
|
-
</optgroup>
|
|
108
|
-
<optgroup label="Mint">
|
|
109
|
-
<option value="mint-dark">Mint Dark</option>
|
|
110
|
-
<option value="mint-light">Mint Light</option>
|
|
111
|
-
</optgroup>
|
|
112
|
-
<optgroup label="Christmas">
|
|
113
|
-
<option value="christmas-dark">Christmas Dark</option>
|
|
114
|
-
<option value="christmas-light">Christmas Light</option>
|
|
115
|
-
</optgroup>
|
|
116
|
-
<optgroup label="Wedding">
|
|
117
|
-
<option value="wedding-dark">Wedding Dark</option>
|
|
118
|
-
<option value="wedding-light">Wedding Light</option>
|
|
119
|
-
</optgroup>
|
|
120
|
-
</select>
|
|
67
|
+
<select id="field-theme" class="form-select"></select>
|
|
121
68
|
<p class="form-hint text-muted" style="margin-top:0.4rem;font-size:0.8rem;">Applied to the public-facing
|
|
122
69
|
website.</p>
|
|
123
70
|
</div>
|
|
124
71
|
<div class="col-6">
|
|
125
72
|
<label class="form-label">Admin Theme</label>
|
|
126
|
-
|
|
127
|
-
<optgroup label="Charcoal">
|
|
128
|
-
<option value="charcoal-dark">Charcoal Dark</option>
|
|
129
|
-
<option value="charcoal-light">Charcoal Light</option>
|
|
130
|
-
</optgroup>
|
|
131
|
-
<optgroup label="Ocean">
|
|
132
|
-
<option value="ocean-dark">Ocean Dark</option>
|
|
133
|
-
<option value="ocean-light">Ocean Light</option>
|
|
134
|
-
</optgroup>
|
|
135
|
-
<optgroup label="Forest">
|
|
136
|
-
<option value="forest-dark">Forest Dark</option>
|
|
137
|
-
<option value="forest-light">Forest Light</option>
|
|
138
|
-
</optgroup>
|
|
139
|
-
<optgroup label="Sunset">
|
|
140
|
-
<option value="sunset-dark">Sunset Dark</option>
|
|
141
|
-
<option value="sunset-light">Sunset Light</option>
|
|
142
|
-
</optgroup>
|
|
143
|
-
<optgroup label="Royal">
|
|
144
|
-
<option value="royal-dark">Royal Dark</option>
|
|
145
|
-
<option value="royal-light">Royal Light</option>
|
|
146
|
-
</optgroup>
|
|
147
|
-
<optgroup label="Lemon">
|
|
148
|
-
<option value="lemon-dark">Lemon Dark</option>
|
|
149
|
-
<option value="lemon-light">Lemon Light</option>
|
|
150
|
-
</optgroup>
|
|
151
|
-
<optgroup label="Silver">
|
|
152
|
-
<option value="silver-dark">Silver Dark</option>
|
|
153
|
-
<option value="silver-light">Silver Light</option>
|
|
154
|
-
</optgroup>
|
|
155
|
-
<optgroup label="Unicorn">
|
|
156
|
-
<option value="unicorn-dark">Unicorn Dark</option>
|
|
157
|
-
<option value="unicorn-light">Unicorn Light</option>
|
|
158
|
-
</optgroup>
|
|
159
|
-
<optgroup label="Dreamy">
|
|
160
|
-
<option value="dreamy-dark">Dreamy Dark</option>
|
|
161
|
-
<option value="dreamy-light">Dreamy Light</option>
|
|
162
|
-
</optgroup>
|
|
163
|
-
<optgroup label="Grayve">
|
|
164
|
-
<option value="grayve-dark">Grayve Dark</option>
|
|
165
|
-
<option value="grayve-light">Grayve Light</option>
|
|
166
|
-
</optgroup>
|
|
167
|
-
<optgroup label="Mint">
|
|
168
|
-
<option value="mint-dark">Mint Dark</option>
|
|
169
|
-
<option value="mint-light">Mint Light</option>
|
|
170
|
-
</optgroup>
|
|
171
|
-
<optgroup label="Christmas">
|
|
172
|
-
<option value="christmas-dark">Christmas Dark</option>
|
|
173
|
-
<option value="christmas-light">Christmas Light</option>
|
|
174
|
-
</optgroup>
|
|
175
|
-
<optgroup label="Wedding">
|
|
176
|
-
<option value="wedding-dark">Wedding Dark</option>
|
|
177
|
-
<option value="wedding-light">Wedding Light</option>
|
|
178
|
-
</optgroup>
|
|
179
|
-
</select>
|
|
73
|
+
<select id="field-admin-theme" class="form-select"></select>
|
|
180
74
|
<p class="form-hint text-muted" style="margin-top:0.4rem;font-size:0.8rem;">Applied to the admin panel.</p>
|
|
181
75
|
</div>
|
|
182
76
|
</div>
|