domma-cms 0.6.9 → 0.6.10
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/api.js +1 -1
- package/admin/js/lib/markdown-toolbar.js +4 -4
- package/admin/js/templates/page-editor.html +40 -0
- package/admin/js/views/page-editor.js +25 -23
- package/package.json +1 -1
- package/plugins/analytics/stats.json +2 -2
- package/public/css/site.css +1 -1
- package/server/routes/api/pages.js +2 -2
- package/server/routes/api/versions.js +77 -0
- package/server/server.js +2 -0
- package/server/services/content.js +20 -2
- package/server/services/markdown.js +2 -1
- package/server/services/versions.js +253 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{api as
|
|
1
|
+
import{api as _}from"../api.js";import{createToolbar as ke,insertAtCursor as he}from"../lib/markdown-toolbar.js";import{populateThemeSelect as Se}from"../lib/themes.js";function Le(){const n=E.slideover({title:"Editor Reference",size:"md",position:"right"}),ne="background:var(--dm-surface-subtle,#1a1a2e);padding:.2rem .4rem;border-radius:3px;font-size:.85em;font-family:monospace;",be="margin:1rem 0 .5rem;font-size:1rem;";function z(w){const h=document.createElement("code");return h.style.cssText=ne,h.textContent=w,h}function N(w){const h=document.createElement("h3");return h.style.cssText=be,h.textContent=w,h}const ge=document.createElement("div");ge.style.cssText="padding:1rem;";const ae=document.createElement("div");ae.className="tabs";const fe=document.createElement("div");fe.className="tab-list",["Basics","Layout","Components","Data","Advanced"].forEach((w,h)=>{const a=document.createElement("button");a.className="tab-item"+(h===0?" active":""),a.textContent=w,fe.appendChild(a)});const le=document.createElement("div");le.className="tab-content";const F="display:flex;flex-direction:column;gap:1rem;",oe=document.createElement("div");oe.className="tab-panel active",oe.style.cssText=F;const X=document.createElement("div");X.className="tab-panel",X.style.cssText=F;const U=document.createElement("div");U.className="tab-panel",U.style.cssText=F;const de=document.createElement("div");de.className="tab-panel",de.style.cssText=F;const re=document.createElement("div");re.className="tab-panel",re.style.cssText=F,le.appendChild(oe),le.appendChild(X),le.appendChild(U),le.appendChild(de),le.appendChild(re),ae.appendChild(fe),ae.appendChild(le),ge.appendChild(ae);const se=document.createElement("div");se.appendChild(N("Markdown Basics"));const Q=document.createElement("table");Q.style.cssText="width:100%;border-collapse:collapse;font-size:.9em;";const O=document.createElement("thead"),J=document.createElement("tr");["Syntax","Result"].forEach(w=>{const h=document.createElement("th");h.style.cssText="text-align:left;padding:.4rem .5rem;border-bottom:1px solid var(--dm-border,#333);",h.textContent=w,J.appendChild(h)}),O.appendChild(J),Q.appendChild(O);const V=document.createElement("tbody");[["**bold**","bold (rendered bold)"],["_italic_","italic (rendered italic)"],["## Heading","Heading (h2)"],["[text](url)","Link"],["","Image"],["- item","Bullet list"],["`code`","Inline code"],["---","Divider"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.35rem .5rem;vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.35rem .5rem;vertical-align:top;color:var(--dm-text-muted,#aaa);font-size:.85em;",d.textContent=h,a.appendChild(o),a.appendChild(d),V.appendChild(a)}),Q.appendChild(V),se.appendChild(Q),oe.appendChild(se);const K=document.createElement("div");K.appendChild(N("Grid & Columns"));function k(w){const h=document.createElement("p");return h.style.cssText="margin:.3rem 0 .6rem;font-size:.82em;color:var(--dm-text-muted,#aaa);",h.textContent=w,h}function s(w,h,a){const o=document.createElement("p");o.style.cssText="margin:.75rem 0 .25rem;font-size:.85em;font-weight:600;",o.textContent=w;const d=document.createElement("pre");d.style.cssText=ne+"display:block;padding:.5rem .75rem;white-space:pre;overflow-x:auto;margin:0;",d.textContent=h;const ve=document.createDocumentFragment();return ve.appendChild(o),ve.appendChild(d),a&&ve.appendChild(k(a)),ve}const Y=document.createElement("table");Y.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['cols="N"',"[grid] only","Number of columns (1\u201312)"],['gap="N"',"[grid], [row]","Gap between columns/rows (1\u20136)"],['span="N"',"[col] only","How many columns this cell spans"],['fullwidth="true"',"[grid] only","Break out of page container to span full viewport"],['class="x"',"all","Add extra CSS classes"]].forEach(([w,h,a])=>{const o=document.createElement("tr");[w,h,a].forEach((d,ve)=>{const Ee=document.createElement("td");Ee.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",ve===0?Ee.appendChild(z(w)):(Ee.style.color="var(--dm-text-muted,#aaa)",Ee.textContent=d),o.appendChild(Ee)}),Y.appendChild(o)}),K.appendChild(Y),K.appendChild(s("Equal columns",`[grid cols="3" gap="4"]
|
|
2
2
|
[col]One[/col]
|
|
3
3
|
[col]Two[/col]
|
|
4
4
|
[col]Three[/col]
|
|
5
|
-
[/grid]`,"cols sets the track count; each [col] fills one track.")),
|
|
5
|
+
[/grid]`,"cols sets the track count; each [col] fills one track.")),K.appendChild(s("Column spanning (12-col base)",`[grid cols="12" gap="3"]
|
|
6
6
|
[col span="8"]Main content[/col]
|
|
7
7
|
[col span="4"]Sidebar[/col]
|
|
8
|
-
[/grid]`,"span values must add up to cols. Common splits: 8/4, 6/6, 9/3.")),
|
|
8
|
+
[/grid]`,"span values must add up to cols. Common splits: 8/4, 6/6, 9/3.")),K.appendChild(s("Row (flexbox, equal-width)",`[row gap="4"]
|
|
9
9
|
[col]Left[/col]
|
|
10
10
|
[col]Right[/col]
|
|
11
|
-
[/row]`,"Use [row] when you want equal-width columns without specifying a count.")),
|
|
11
|
+
[/row]`,"Use [row] when you want equal-width columns without specifying a count.")),K.appendChild(s("Card in a grid",`[grid cols="3" gap="4"]
|
|
12
12
|
[col]
|
|
13
13
|
[card title="One"]Content[/card]
|
|
14
14
|
[/col]
|
|
@@ -18,21 +18,21 @@ import{api as H}from"../api.js";import{createToolbar as Te,insertAtCursor as re}
|
|
|
18
18
|
[col]
|
|
19
19
|
[card title="Three"]Content[/card]
|
|
20
20
|
[/col]
|
|
21
|
-
[/grid]`,null)),X.appendChild(
|
|
21
|
+
[/grid]`,null)),X.appendChild(K);const j=document.createElement("div");j.appendChild(N("Cards")),j.appendChild(s("Basic card",`[card title="Optional Title"]
|
|
22
22
|
Markdown **works** here.
|
|
23
|
-
[/card]`,"Omit title for a card with no header.")),
|
|
23
|
+
[/card]`,"Omit title for a card with no header.")),j.appendChild(s("Icon \u2014 inline (default)",`[card title="Feature" icon="star"]
|
|
24
24
|
Icon sits left of the title in a flex row.
|
|
25
|
-
[/card]`,"icon accepts any Domma icon name. Default layout when icon is set.")),
|
|
25
|
+
[/card]`,"icon accepts any Domma icon name. Default layout when icon is set.")),j.appendChild(s("Icon \u2014 stacked (centred)",`[card title="Feature" icon="star" icon-layout="stacked" hover]
|
|
26
26
|
Icon is centred above the title. Great for feature tiles.
|
|
27
|
-
[/card]`,'icon-layout="stacked" centres the icon above the title. Combine with hover for a lift effect.')),
|
|
27
|
+
[/card]`,'icon-layout="stacked" centres the icon above the title. Combine with hover for a lift effect.')),j.appendChild(s("Icon with subtitle",`[card title="Feature" subtitle="Tagline here" icon="star" icon-layout="stacked"]
|
|
28
28
|
Body content.
|
|
29
|
-
[/card]`,"subtitle adds a secondary line beneath the title in both layouts.")),
|
|
29
|
+
[/card]`,"subtitle adds a secondary line beneath the title in both layouts.")),j.appendChild(s("Collapsible card",`[card title="Click to expand" collapsible="true"]
|
|
30
30
|
Hidden by default.
|
|
31
|
-
[/card]`,null)),
|
|
31
|
+
[/card]`,null)),j.appendChild(s("Full attribute reference",`[card title="Title" subtitle="Sub" icon="star" icon-layout="stacked"
|
|
32
32
|
variant="primary" hover footer="Footer text"
|
|
33
33
|
collapsible="true" class="extra" id="my-card"]
|
|
34
34
|
Body content.
|
|
35
|
-
[/card]`,'All attributes are optional. variant accepts "primary". icon-layout accepts "inline" (default) or "stacked".')),
|
|
35
|
+
[/card]`,'All attributes are optional. variant accepts "primary". icon-layout accepts "inline" (default) or "stacked".')),j.appendChild(s("Rich header / footer sub-tags",`[card]
|
|
36
36
|
[header]
|
|
37
37
|
### Custom Title with **bold** and [a link](/about)
|
|
38
38
|
[/header]
|
|
@@ -42,41 +42,43 @@ Body content here.
|
|
|
42
42
|
[footer]
|
|
43
43
|
[Read more](/about) | [icon name="arrow-right" /]
|
|
44
44
|
[/footer]
|
|
45
|
-
[/card]`,"Use [header] and [footer] sub-tags for Markdown-rendered header/footer regions. Sub-tags override the title/subtitle/icon and footer attributes when both are present.")),
|
|
45
|
+
[/card]`,"Use [header] and [footer] sub-tags for Markdown-rendered header/footer regions. Sub-tags override the title/subtitle/icon and footer attributes when both are present.")),U.appendChild(j);const e=document.createElement("div");e.appendChild(N("Badge")),e.appendChild(k("Inline badge/label elements. Self-closing renders an empty coloured dot."));const c=document.createElement("table");c.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['variant="..."',"primary (default), secondary, success, danger, warning, info, light, dark"],["pill","Flag: rounded pill shape (.badge-pill)"],["outline","Flag: outlined style (.badge-outline)"],['size="small|large"',"Reduced or enlarged badge"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),c.appendChild(a)}),e.appendChild(c),e.appendChild(s("Basic badge",'[badge variant="success"]New[/badge]',null)),e.appendChild(s("Pill outline badge",'[badge variant="danger" outline pill]Deprecated[/badge]',null)),U.appendChild(e);const t=document.createElement("div");t.appendChild(N("Button")),t.appendChild(k("Renders a styled anchor as a Domma button. Use the Insert \u2192 Button toolbar item for a guided dialog."));const i=document.createElement("table");i.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['href="..."',"Link destination (required)"],['label="..."',"Button text (self-closing form)"],['variant="..."',"primary (default), secondary, success, danger, warning, info, outline, ghost, link, outline-*"],['size="sm|lg"',"Button size modifier"],['icon="..."',"Domma icon name before the label"],['icon-after="..."',"Domma icon name after the label"],['target="..."','Link target, e.g. "_blank"'],['class="..."',"Extra CSS classes"],['id="..."',"Element id"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),i.appendChild(a)}),t.appendChild(i),t.appendChild(s("Primary button",'[button href="/contact" variant="primary"]Get in touch[/button]',null)),t.appendChild(s("Self-closing with icon",'[button href="/download" variant="success" icon="download" size="sm" label="Download" /]',null)),t.appendChild(s("Opens in new tab",'[button href="https://example.com" variant="outline" target="_blank"]Visit site[/button]',null)),U.appendChild(t);const y=document.createElement("div");y.appendChild(N("Link (shortcode)")),y.appendChild(k("Renders a plain anchor with optional icon, target, and class. Use Insert \u2192 Link for a guided dialog. For simple inline links, standard Markdown [text](url) is fine."));const p=document.createElement("table");p.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['href="..."',"Link destination (required)"],['label="..."',"Link text (self-closing form)"],['target="..."','Link target, e.g. "_blank"'],['class="..."',"CSS classes on the <a>"],['icon="..."',"Domma icon name before the text"],['icon-after="..."',"Domma icon name after the text"],['id="..."',"Element id"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),p.appendChild(a)}),y.appendChild(p),y.appendChild(s("External link in new tab",'[link href="https://example.com" target="_blank" icon-after="external-link"]Visit site[/link]',null)),y.appendChild(s("Self-closing with icon",'[link href="/about" icon="arrow-right" label="About us" /]',null)),U.appendChild(y);const m=document.createElement("div");m.appendChild(N("Spacer")),m.appendChild(k("Self-closing shortcode that inserts a fixed-height blank gap."));const C=document.createElement("table");C.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['size="N"',"Height in px (default: 8)"],['class="..."',"Extra CSS class on the spacer div"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),C.appendChild(a)}),m.appendChild(C),m.appendChild(s("32px gap",'[spacer size="32" /]',null)),X.appendChild(m);const v=document.createElement("div");v.appendChild(N("Icon")),v.appendChild(k("Self-closing shortcode that renders any Domma icon inline."));const f=document.createElement("table");f.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['name="..."',"Domma icon name (required). Also accepted as src=."],['size="N"',"Width and height in px"],['color="..."',"CSS colour applied via style"],['class="..."',"Extra CSS classes"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),f.appendChild(a)}),v.appendChild(f),v.appendChild(s("Coloured icon",'[icon name="star" size="24" color="#f5a623" /]',null)),U.appendChild(v);const b=document.createElement("div");b.appendChild(N("Center")),b.appendChild(k("Wraps content in a centred div. Works with any content including cards, grids, and text.")),b.appendChild(s("Example","[center]Centred content here[/center]",'Accepts an optional class="..." attribute for extra styling.')),X.appendChild(b);const L=document.createElement("div");L.appendChild(N("Hero")),L.appendChild(k("Full-width hero sections \u2014 no plugin required. Uses Domma's built-in Hero CSS component."));const P=document.createElement("table");P.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['title="..."',"Heading text"],['tagline="..."',"Subtitle text"],['size="sm|lg|full"',"Height variant (default: normal)"],['variant="dark|primary|gradient-blue|gradient-purple|gradient-sunset|gradient-ocean"',"Colour / gradient preset"],['image="url"',"Background image URL (adds cover mode)"],['overlay="light|dark|darker|gradient|gradient-reverse"',"Image overlay style"],['align="center|left"',"Content alignment (default: center)"],['fullwidth="true"',"Break out of the page container to span full viewport width"],['bg="..."',"Background colour CSS value"],["twinkle","Flag: adds particle overlay (requires Effects plugin)"],['twinkle-count="N"',"Number of particles"],['twinkle-colour="..."',"Particle colour CSS value"],["blobs","Flag: adds ambient blob background"],['blobs-type="..."',"Blob animation type (default: float-blobs)"],['class="..."',"Extra CSS classes"],['id="..."',"Element id"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),P.appendChild(a)}),L.appendChild(P),L.appendChild(s("Basic hero",'[hero title="Welcome" tagline="Build something great"][/hero]',null)),L.appendChild(s("Gradient with body content",`[hero title="Get Started" tagline="Everything you need." size="lg" variant="gradient-blue" align="center"]
|
|
46
46
|
Some introductory **Markdown** content here.
|
|
47
|
-
[/hero]`,null)),
|
|
47
|
+
[/hero]`,null)),L.appendChild(s("Background image with overlay",'[hero title="Our Story" image="/media/hero.jpg" overlay="dark" size="full"][/hero]',"Combine image + overlay for text legibility over photos.")),X.appendChild(L);const T=document.createElement("div");T.appendChild(N("Interactive Components")),T.appendChild(k("Tabs, accordion, carousel, and countdown \u2014 no plugin required.")),T.appendChild(s("Tabs",`[tabs]
|
|
48
48
|
[tab title="First"]Content **A**[/tab]
|
|
49
49
|
[tab title="Second"]Content **B**[/tab]
|
|
50
|
-
[/tabs]`,'Add style="pills" for pill-style navigation.')),
|
|
50
|
+
[/tabs]`,'Add style="pills" for pill-style navigation.')),T.appendChild(s("Accordion",`[accordion]
|
|
51
51
|
[item title="Question 1"]Answer here.[/item]
|
|
52
52
|
[item title="Question 2"]Answer here.[/item]
|
|
53
|
-
[/accordion]`,'Add multiple="true" to allow several panels open at once.')),
|
|
53
|
+
[/accordion]`,'Add multiple="true" to allow several panels open at once.')),T.appendChild(s("Carousel",`[carousel autoplay="true" interval="5000"]
|
|
54
54
|
[slide title="Slide 1"]Description[/slide]
|
|
55
55
|
[slide image="/media/photo.jpg" title="Slide 2"]Caption[/slide]
|
|
56
|
-
[/carousel]`,'Omit autoplay for a manual carousel. loop="false" disables wrapping.')),
|
|
56
|
+
[/carousel]`,'Omit autoplay for a manual carousel. loop="false" disables wrapping.')),T.appendChild(s("Countdown (to date)",'[countdown to="2026-12-31" format="DD:HH:mm:ss" /]',null)),T.appendChild(s("Countdown (duration)",'[countdown duration="300" format="mm:ss" /]',"duration is in seconds. format options: mm:ss \xB7 HH:mm:ss \xB7 DD:HH:mm:ss")),U.appendChild(T);const S=document.createElement("div");S.appendChild(N("Timeline")),S.appendChild(k("Renders a Domma Progression component with event items."));const q=document.createElement("table");q.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['layout="vertical|centred|horizontal"',"[timeline] \u2014 layout orientation (default: vertical)"],['theme="minimal|corporate|modern"',"[timeline] \u2014 visual theme (default: minimal)"],['mode="timeline|roadmap"',"[timeline] \u2014 display mode (default: timeline)"],['class="..."',"[timeline] \u2014 extra CSS classes"],['id="..."',"[timeline] \u2014 element id"],['title="..."',"[event] \u2014 event heading"],['date="..."',"[event] \u2014 display date string"],['status="planned|in-progress|completed|blocked"',"[event] \u2014 progress status"],['icon="..."',"[event] \u2014 Domma icon name"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),q.appendChild(a)}),S.appendChild(q),S.appendChild(s("Vertical timeline",`[timeline layout="vertical" theme="modern"]
|
|
57
57
|
[event title="Kickoff" date="Jan 2025" status="completed" icon="flag"]
|
|
58
58
|
Project launched.
|
|
59
59
|
[/event]
|
|
60
60
|
[event title="Beta" date="Jun 2025" status="in-progress" icon="rocket"]
|
|
61
61
|
In active development.
|
|
62
62
|
[/event]
|
|
63
|
-
[/timeline]`,null)),
|
|
63
|
+
[/timeline]`,null)),U.appendChild(S);const l=document.createElement("div");l.appendChild(N("Embedding a Form"));const x=document.createElement("table");x.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['name="..."',"Form slug (required). Also accepted as slug=."],['class="..."',"Extra CSS classes on the wrapper div"],['id="..."',"id attribute on the wrapper div"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),x.appendChild(a)}),l.appendChild(x),l.appendChild(s("Basic",'[form name="contact" /]',"Forms are managed under Forms in the sidebar.")),l.appendChild(s("With wrapper styling",'[form name="newsletter" class="mt-4" id="newsletter-form" /]',null)),de.appendChild(l);const r=document.createElement("div");r.appendChild(N("Displaying a Collection"));const g=document.createElement("pre");g.style.cssText=ne+"display:block;padding:.5rem .75rem;white-space:pre;overflow-x:auto;",g.textContent='[collection slug="enquiries" display="table" /]',r.appendChild(g);const u=[["slug","Required. The collection slug."],["display","table (default), cards, or list."],["fields","Comma-separated field keys to show. Defaults to all."],["limit","Maximum number of entries to display."],["sort","Field key to sort by."],["order","asc or desc (default asc)."],["title-field","Field used as the card/list title (cards + list)."],["columns","Grid columns for cards display (2\u20134, default 3)."],["search","true/false \u2014 enable search in table mode (default true)."],["sortable","true/false \u2014 enable column sorting in table mode (default true)."],["exportable","true/false \u2014 show CSV export button in table mode (default false)."],["page-size","Rows per page in table mode (default 25)."],["empty","Text shown when there are no entries."],["cta","Action slug: enables per-entry CTA buttons."],["cta-label",'CTA button label (default: "Run").'],["cta-icon","CTA button icon name."],["cta-style","CTA button variant (default: primary)."],["cta-confirm","CTA confirmation prompt text."]],B=document.createElement("table");B.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",u.forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;width:35%;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),B.appendChild(a)}),r.appendChild(B),r.appendChild(k("Table display uses Domma Table \u2014 search, sort, pagination, column selector, and CSV export are all built in. Cards and lists are static.")),de.appendChild(r);const A=document.createElement("div");A.appendChild(N("View \u2014 Pro")),A.appendChild(k("Renders a Collection with full filtering, pagination, and display options. Requires a Pro MongoDB collection."));const M=document.createElement("table");M.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[["slug","Required. The collection slug."],["display","table (default), cards, or list."],["limit","Maximum number of entries to display."],["fields","Comma-separated field keys to show."],["title-field","Field used as the card/list title."],["columns","Grid columns for cards display (2\u20134, default 3)."],["empty","Text shown when there are no entries."]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;width:35%;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),M.appendChild(a)}),A.appendChild(M),A.appendChild(s("Table display",'[view slug="products" display="table" limit="50" /]',null)),A.appendChild(s("Cards display",'[view slug="team" display="cards" columns="3" title-field="name" /]',null)),de.appendChild(A);const W=document.createElement("div");W.appendChild(N("CTA \u2014 Pro")),W.appendChild(k("Renders an action button that triggers a Pro Action against an entry. Requires the Pro Actions feature."));const ee=document.createElement("table");ee.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[["action","Required. The action slug."],["entry","Required. The entry id to act on."],["style","Button variant (default: primary)."],["icon","Domma icon name for the button."],["size","Button size (sm, lg)."],["confirm","Confirmation prompt text before running."],["label","Self-closing only: button label text."]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;width:35%;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),ee.appendChild(a)}),W.appendChild(ee),W.appendChild(s("Wrapping form",'[cta action="approve" entry="abc123" style="success" confirm="Approve this entry?"]Approve[/cta]',null)),W.appendChild(s("Self-closing",'[cta action="archive" entry="abc123" icon="archive" label="Archive" /]',null)),de.appendChild(W);const ce=document.createElement("div");ce.appendChild(N("Effects")),ce.appendChild(k("Shortcodes for scroll-triggered animations, counters, typewriter text, and more. Requires the Domma Effects plugin."));const ye=[['[reveal animation="fade"]...[/reveal]',"Fade/slide/zoom on scroll"],["[breathe]...[/breathe]","Continuous gentle scale loop"],["[pulse]...[/pulse]","Repeating scale pulse"],["[shake]...[/shake]","One-shot shake"],['[scribe speed="50"]...[/scribe]',"Typewriter \u2014 simple mode (text typed letter by letter)"],['[scribe loop="true"][render]Text[/render][wait]1500[/wait][undo /][/scribe]',"Typewriter \u2014 script mode (sequenced render/wait/undo actions)"],["[scramble]...[/scramble]","Character-scramble reveal"],['[counter to="100" /]',"Animated number counter (self-closing)"],["[ripple]...[/ripple]","Click-triggered ripple"],['[twinkle count="50"]...[/twinkle]',"Particle/star overlay"],['[animate type="fade-in-up"]...[/animate]',"CSS-only animation (no plugin needed)"],['[ambient type="aurora"]...[/ambient]',"CSS-only animated background"],['[firework type="burst" colour="rainbow" /]',"CSS firework (self-closing)"],["[fireworks]...[/fireworks]","Fireworks display container"],['[celebrate theme="auto" /]',"Seasonal canvas celebration"]],pe=document.createElement("table");pe.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",ye.forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),pe.appendChild(a)}),ce.appendChild(pe),ce.appendChild(s("Scribe script \u2014 looping multi-phrase typewriter",`[scribe loop="true" loop-delay="2000" delete-speed="20"]
|
|
64
64
|
[render]We build things that matter.[/render]
|
|
65
65
|
[wait]1200[/wait]
|
|
66
66
|
[undo all="true" /]
|
|
67
67
|
[render]We design for humans.[/render]
|
|
68
68
|
[wait]1200[/wait]
|
|
69
69
|
[undo all="true" /]
|
|
70
|
-
[/scribe]`,'Use [render]...[/render] to type text, [wait]Ms[/wait] to pause, and [undo /] to delete. loop="true" replays the sequence. Only [render], [wait], and [undo] shortcodes are parsed \u2014 plain text between actions is ignored.')),
|
|
70
|
+
[/scribe]`,'Use [render]...[/render] to type text, [wait]Ms[/wait] to pause, and [undo /] to delete. loop="true" replays the sequence. Only [render], [wait], and [undo] shortcodes are parsed \u2014 plain text between actions is ignored.')),ce.appendChild(k("Enable the Domma Effects plugin to activate these shortcodes on your site.")),re.appendChild(ce);const ie=document.createElement("div");ie.appendChild(N("Tables")),ie.appendChild(k("Wrap a standard Markdown (GFM) table with Domma CSS classes and responsive horizontal scrolling."));const xe=document.createElement("table");xe.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['striped="true"',"Alternate row background (.table-striped)"],['bordered="true"',"Borders on all cells (.table-bordered)"],['compact="true"',"Reduced cell padding (.table-compact)"],['caption="..."',"Caption text above the table"],['class="..."',"Extra CSS classes appended to .table"],['id="..."',"id attribute on the <table> element"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),xe.appendChild(a)}),ie.appendChild(xe),ie.appendChild(s("Striped + bordered table",`[table striped="true" bordered="true" caption="Product Pricing"]
|
|
71
71
|
| Product | Price |
|
|
72
72
|
| ------- | ----: |
|
|
73
73
|
| Widget | $9.99 |
|
|
74
74
|
| Gadget | $14.99 |
|
|
75
|
-
[/table]`,"The inner content must be a valid GFM Markdown table. The shortcode adds Domma CSS classes and wraps in a responsive scroll container.")),
|
|
75
|
+
[/table]`,"The inner content must be a valid GFM Markdown table. The shortcode adds Domma CSS classes and wraps in a responsive scroll container.")),U.appendChild(ie);const ue=document.createElement("div");ue.appendChild(N("Slideover")),ue.appendChild(k("A trigger button that opens a slide-in panel with Markdown content. No plugin required."));const Ce=document.createElement("table");Ce.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['title="..."',"Panel header text"],['trigger="..."','Button label (default: "Open")'],['size="sm|md|lg"',"Panel width (default: md)"],['position="right|left"',"Slide direction (default: right)"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),Ce.appendChild(a)}),ue.appendChild(Ce),ue.appendChild(s("Example",`[slideover title="More Info" trigger="Read more" size="md"]
|
|
76
76
|
## Details
|
|
77
77
|
Markdown content here.
|
|
78
|
-
[/slideover]`,"Nested [card] and [grid] shortcodes work inside the slideover body.")),
|
|
78
|
+
[/slideover]`,"Nested [card] and [grid] shortcodes work inside the slideover body.")),U.appendChild(ue);const H=document.createElement("div");H.appendChild(N("DConfig \u2014 Declarative Behaviour")),H.appendChild(k("Define click handlers and class toggles without writing JavaScript. Use the DConfig section above or embed inline with [dconfig]...[/dconfig] in the content body. Inline shortcodes win on selector conflict.")),H.appendChild(s("Toggle a class on click",'{ "#my-btn": { "events": { "click": { "target": "#panel", "toggleClass": "hidden" } } } }','Selector keys use standard CSS selectors. "target" is optional \u2014 defaults to the element itself.')),H.appendChild(s("Inline shortcode syntax",`[dconfig]
|
|
79
79
|
{ "#my-btn": { "events": { "click": { "target": "#panel", "toggleClass": "hidden" } } } }
|
|
80
|
-
[/dconfig]`,null)),
|
|
81
|
-
`).length;
|
|
82
|
-
`),ae.scrollTop=J.scrollTop};he(),J.addEventListener("input",he),J.addEventListener("scroll",()=>{ae.scrollTop=J.scrollTop});let ye=null;const Q=()=>{clearTimeout(ye),ye=setTimeout(async()=>{try{const{html:e}=await H.pages.preview(G.val());ne.html(e,{safe:!1}),I.scan(ne.get(0))}catch{window.marked&&ne.html(marked.parse(G.val()))}},400)},L=Te(G,i.find("#editor-toolbar"),{spacerDefault:oe});L.onLink(async e=>{const l=(await H.pages.list().catch(()=>[])).map(d=>({label:d.title||d.urlPath,value:d.urlPath})),o=document.createElement("div");o.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const x=document.createElement("label");x.className="form-label",x.textContent="URL";const r=document.createElement("input");r.type="text",r.className="form-input",r.placeholder="/about or https://example.com";const u=e.value.substring(e.selectionStart,e.selectionEnd);u&&u.startsWith("/")&&(r.value=u),o.appendChild(x),o.appendChild(r);const p=document.createElement("label");p.className="form-label",p.textContent="Link text";const g=document.createElement("input");g.type="text",g.className="form-input",g.placeholder="Display text",u&&!u.startsWith("/")&&(g.value=u),o.appendChild(p),o.appendChild(g);const C=document.createElement("label");C.className="form-label",C.style.cssText="display:flex;align-items:center;gap:.5rem;cursor:pointer;";const m=document.createElement("input");m.type="checkbox",m.style.cssText="width:1rem;height:1rem;cursor:pointer;",C.appendChild(m),C.appendChild(document.createTextNode("Display as button")),o.appendChild(C);const v=document.createElement("label");v.className="form-label",v.textContent="Button colour",v.style.display="none";const B=document.createElement("select");B.className="form-select",B.style.display="none",[["primary","Primary"],["secondary","Secondary"],["success","Success (Green)"],["danger","Danger (Red)"],["warning","Warning (Orange)"],["info","Info (Blue)"],["outline","Outline"],["outline-success","Outline Success"],["outline-danger","Outline Danger"],["ghost","Ghost"]].forEach(([d,T])=>{const h=document.createElement("option");h.value=d,h.textContent=T,B.appendChild(h)}),o.appendChild(v),o.appendChild(B),m.addEventListener("change",()=>{const d=m.checked;v.style.display=d?"":"none",B.style.display=d?"":"none"});const f=document.createElement("button");f.type="button",f.className="btn btn-primary",f.textContent="Insert Link",o.appendChild(f);const P=E.modal({title:"Insert Link",size:"sm"});P.element.appendChild(o),P.open(),requestAnimationFrame(()=>{E.autocomplete(r,{data:l,minChars:1,onSelect:d=>{r.value=d.value,g.value||(g.value=d.label)}}),r.focus()}),f.addEventListener("click",()=>{const d=r.value.trim(),T=g.value.trim();if(!d)return;P.close();const h=m.checked?`[button href="${d}" variant="${B.value}"]${T||d}[/button]`:`[${T||d}](${d})`,w=e.selectionStart,c=e.selectionEnd;e.value=e.value.substring(0,w)+h+e.value.substring(c),e.selectionStart=e.selectionEnd=w+h.length,e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),L.onImage(async e=>{const l=(await H.media.list().catch(()=>[])).filter(r=>/\.(png|jpe?g|gif|webp|svg)$/i.test(r.name)),o=document.createElement("div");if(o.className="media-picker-grid",l.length)l.forEach(r=>{const u=document.createElement("div");u.className="media-picker-item",u.dataset.url=r.url;const p=document.createElement("img");p.src=r.url,p.alt=r.name;const g=document.createElement("span");g.textContent=r.name,u.appendChild(p),u.appendChild(g),o.appendChild(u)});else{const r=document.createElement("p");r.className="text-muted p-3",r.textContent="No images uploaded yet.",o.appendChild(r)}const x=E.modal({title:"Insert Image",size:"lg"});x.element.appendChild(o),$(x.element).on("click",".media-picker-item",function(){const r=$(this).data("url"),u=$(this).find("span").text();re(e,``),x.close(),G.get(0).dispatchEvent(new Event("input",{bubbles:!0}))}),x.open()}),L.onCollection(async e=>{const k=await H.collections.list().catch(()=>[]),l=document.createElement("div");l.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const o="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",x="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;",r=document.createElement("div"),u=document.createElement("label");u.style.cssText=o,u.textContent="Collection";const p=document.createElement("select");if(p.style.cssText=x,k.length)k.forEach(q=>{const O=document.createElement("option");O.value=q.slug,O.textContent=q.title||q.slug,p.appendChild(O)});else{const q=document.createElement("option");q.value="",q.textContent="No collections found",p.appendChild(q)}r.appendChild(u),r.appendChild(p),l.appendChild(r);const g=document.createElement("div"),C=document.createElement("label");C.style.cssText=o,C.textContent="Display";const m=document.createElement("select");m.style.cssText=x,["table","cards","list"].forEach(q=>{const O=document.createElement("option");O.value=q,O.textContent=q.charAt(0).toUpperCase()+q.slice(1),m.appendChild(O)}),g.appendChild(C),g.appendChild(m),l.appendChild(g);const v=document.createElement("div");v.style.display="none";const B=document.createElement("label");B.style.cssText=o,B.textContent="Columns (2\u20134)";const y=document.createElement("input");y.type="number",y.min="2",y.max="4",y.value="3",y.style.cssText=x,v.appendChild(B),v.appendChild(y),l.appendChild(v);const f=document.createElement("div"),P=document.createElement("label");P.style.cssText="display:flex;align-items:center;gap:.5rem;font-size:.9em;cursor:pointer;";const d=document.createElement("input");d.type="checkbox",d.checked=!0,P.appendChild(d),P.appendChild(document.createTextNode("Enable search")),f.appendChild(P),l.appendChild(f);const T=document.createElement("div"),h=document.createElement("label");h.style.cssText="display:flex;align-items:center;gap:.5rem;font-size:.9em;cursor:pointer;";const w=document.createElement("input");w.type="checkbox",w.checked=!0,h.appendChild(w),h.appendChild(document.createTextNode("Sortable columns")),T.appendChild(h),l.appendChild(T);const c=document.createElement("div"),z=document.createElement("label");z.style.cssText="display:flex;align-items:center;gap:.5rem;font-size:.9em;cursor:pointer;";const S=document.createElement("input");S.type="checkbox",S.checked=!1,z.appendChild(S),z.appendChild(document.createTextNode("CSV export")),c.appendChild(z),l.appendChild(c);const F=document.createElement("div"),U=document.createElement("label");U.style.cssText=o,U.textContent="Rows per page";const M=document.createElement("input");M.type="number",M.min="5",M.max="100",M.value="25",M.style.cssText=x,F.appendChild(U),F.appendChild(M),l.appendChild(F);const ie=document.createElement("div"),K=document.createElement("label");K.style.cssText=o,K.textContent="Limit (optional)";const Z=document.createElement("input");Z.type="number",Z.placeholder="All",Z.style.cssText=x,ie.appendChild(K),ie.appendChild(Z),l.appendChild(ie);const V=document.createElement("button");V.type="button",V.className="btn btn-primary",V.textContent="Insert",l.appendChild(V);const xe=[f,T,c,F],ce=()=>{const q=m.value==="table";xe.forEach(O=>{O.style.display=q?"":"none"}),v.style.display=m.value==="cards"?"":"none"};m.addEventListener("change",ce),ce();const ee=E.modal({title:"Insert Collection",size:"sm"});ee.element.appendChild(l),ee.open(),V.addEventListener("click",()=>{const q=p.value;if(!q)return;const O=m.value;let _=`[collection slug="${q}" display="${O}"`;O==="cards"&&(_+=` columns="${y.value}"`),O==="table"&&!d.checked&&(_+=' search="false"'),O==="table"&&!w.checked&&(_+=' sortable="false"'),O==="table"&&S.checked&&(_+=' exportable="true"'),O==="table"&&M.value!=="25"&&(_+=` page-size="${M.value}"`);const le=Z.value.trim();le&&(_+=` limit="${le}"`),_+=" /]",ee.close(),re(e,_),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),L.onForm(async e=>{const k=await H.forms.list().catch(()=>[]),l=document.createElement("div");l.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const o="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",x="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;",r=document.createElement("div"),u=document.createElement("label");u.style.cssText=o,u.textContent="Form";const p=document.createElement("select");if(p.style.cssText=x,k.length)k.forEach(m=>{const v=document.createElement("option");v.value=m.slug,v.textContent=m.title||m.slug,p.appendChild(v)});else{const m=document.createElement("option");m.value="",m.textContent="No forms found",p.appendChild(m)}r.appendChild(u),r.appendChild(p),l.appendChild(r);const g=document.createElement("button");g.className="btn btn-primary btn-sm",g.style.cssText="align-self:flex-end;margin-top:.5rem;",g.textContent="Insert Form",l.appendChild(g);const C=E.modal({title:"Insert Form",size:"sm"});C.element.appendChild(l),C.open(),g.addEventListener("click",()=>{const m=p.value;m&&(re(e,`[form slug="${m}" /]`),C.close(),G.get(0).dispatchEvent(new Event("input",{bubbles:!0})))})}),L.onView(async e=>{const k=await H.views.list().catch(()=>[]),l=document.createElement("div");l.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const o="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",x="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;",r=document.createElement("div"),u=document.createElement("label");u.style.cssText=o,u.textContent="View";const p=document.createElement("select");if(p.style.cssText=x,k.length)k.forEach(y=>{const f=document.createElement("option");f.value=y.slug,f.textContent=y.title||y.slug,p.appendChild(f)});else{const y=document.createElement("option");y.value="",y.textContent="No Views configured yet \u2014 create one under Data \u2192 Views",p.appendChild(y)}r.appendChild(u),r.appendChild(p),l.appendChild(r);const g=document.createElement("div"),C=document.createElement("label");C.style.cssText=o,C.textContent="Display";const m=document.createElement("select");m.style.cssText=x,["table","cards","list"].forEach(y=>{const f=document.createElement("option");f.value=y,f.textContent=y.charAt(0).toUpperCase()+y.slice(1),m.appendChild(f)}),g.appendChild(C),g.appendChild(m),l.appendChild(g);const v=document.createElement("button");v.type="button",v.className="btn btn-primary",v.textContent="Insert",l.appendChild(v);const B=E.modal({title:"Insert View",size:"sm"});B.element.appendChild(l),B.open(),v.addEventListener("click",()=>{const y=p.value;if(!y)return;const f=`[view slug="${y}" display="${m.value}" /]`;B.close(),re(e,f),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),L.onCta(async e=>{const k=await H.actions.list().catch(()=>[]),l=document.createElement("div");l.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const o="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",x="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function r(d,T){const h=document.createElement("div"),w=document.createElement("label");return w.style.cssText=o,w.textContent=d,h.appendChild(w),h.appendChild(T),h}function u(d){const T=document.createElement("select");return T.style.cssText=x,d.forEach(([h,w])=>{const c=document.createElement("option");c.value=h,c.textContent=w,T.appendChild(c)}),T}function p(d,T,h){const w=document.createElement("input");return w.type=d,w.placeholder=T||"",w.value=h||"",w.style.cssText=x,w}const g=u(k.length?k.map(d=>[d.slug,d.title||d.slug]):[["","No Actions configured yet \u2014 create one under Data \u2192 Actions"]]);l.appendChild(r("Action",g));const C=p("text","Button label","Run");if(l.appendChild(r("Label",C)),g.addEventListener("change",()=>{const d=k.find(T=>T.slug===g.value);d?.trigger?.label&&(C.value=d.trigger.label)}),k.length){const d=k[0];d?.trigger?.label&&(C.value=d.trigger.label)}const m=p("text","Paste entry UUID\u2026","");l.appendChild(r("Entry ID",m));const v=u([["primary","Primary"],["secondary","Secondary"],["ghost","Ghost"],["danger","Danger"]]);l.appendChild(r("Style",v));const B=p("text","e.g. check, zap, send (optional)","");l.appendChild(r("Icon",B));const y=p("text","Confirmation message (optional)","");l.appendChild(r("Confirm prompt",y));const f=document.createElement("button");f.type="button",f.className="btn btn-primary",f.textContent="Insert",l.appendChild(f);const P=E.modal({title:"Insert CTA Button",size:"sm"});P.element.appendChild(l),P.open(),f.addEventListener("click",()=>{const d=g.value;if(!d)return;const T=m.value.trim(),h=(C.value.trim()||"Run").replace(/\[\/cta\]/gi,""),w=v.value,c=B.value.trim().replace(/"/g,""),z=y.value.trim().replace(/"/g,""),S=T.replace(/"/g,"");let F=`action="${d}" style="${w}"`;S&&(F+=` entry="${S}"`),c&&(F+=` icon="${c}"`),z&&(F+=` confirm="${z}"`);const U=`[cta ${F}]${h}[/cta]`;P.close(),re(e,U),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),L.onButton(async e=>{const l=(await H.pages.list().catch(()=>[])).map(c=>({label:c.title||c.urlPath,value:c.urlPath})),o=document.createElement("div");o.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const x="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",r="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function u(c,z){const S=document.createElement("div"),F=document.createElement("label");return F.style.cssText=x,F.textContent=c,S.appendChild(F),S.appendChild(z),S}function p(c,z){const S=document.createElement("input");return S.type="text",S.placeholder=c,S.value=z||"",S.style.cssText=r,S}function g(c){const z=document.createElement("select");return z.style.cssText=r,c.forEach(([S,F])=>{const U=document.createElement("option");U.value=S,U.textContent=F,z.appendChild(U)}),z}const C=e.value.substring(e.selectionStart,e.selectionEnd),m=p("/about or https://example.com",C.startsWith("/")?C:"");o.appendChild(u("URL",m));const v=p("Button label",C&&!C.startsWith("/")?C:"");o.appendChild(u("Label",v));const B=g([["primary","Primary"],["secondary","Secondary"],["success","Success (Green)"],["danger","Danger (Red)"],["warning","Warning (Orange)"],["info","Info (Blue)"],["outline","Outline"],["ghost","Ghost"],["link","Link"],["outline-success","Outline Success"],["outline-danger","Outline Danger"]]);o.appendChild(u("Variant",B));const y=g([["","Default"],["sm","Small"],["lg","Large"]]);o.appendChild(u("Size",y));const f=p("e.g. arrow-right, star (optional)","");o.appendChild(u("Icon (before label)",f));const P=p("e.g. arrow-right (optional)","");o.appendChild(u("Icon (after label)",P));const d=document.createElement("label");d.style.cssText="display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9em;";const T=document.createElement("input");T.type="checkbox",T.style.cssText="width:1rem;height:1rem;",d.appendChild(T),d.appendChild(document.createTextNode("Open in new tab")),o.appendChild(d);const h=document.createElement("button");h.type="button",h.className="btn btn-primary",h.textContent="Insert Button",o.appendChild(h);const w=E.modal({title:"Insert Button",size:"sm"});w.element.appendChild(o),w.open(),requestAnimationFrame(()=>{E.autocomplete(m,{data:l,minChars:1,onSelect:c=>{m.value=c.value,v.value||(v.value=c.label)}}),m.focus()}),h.addEventListener("click",()=>{const c=m.value.trim();if(!c)return;w.close();const z=v.value.trim()||c;let S=`href="${c}" variant="${B.value}"`;y.value&&(S+=` size="${y.value}"`);const F=f.value.trim().replace(/"/g,"");F&&(S+=` icon="${F}"`);const U=P.value.trim().replace(/"/g,"");U&&(S+=` icon-after="${U}"`),T.checked&&(S+=' target="_blank"');const M=`[button ${S}]${z}[/button]`;re(e,M)})}),L.onLinkShortcode(async e=>{const l=(await H.pages.list().catch(()=>[])).map(h=>({label:h.title||h.urlPath,value:h.urlPath})),o=document.createElement("div");o.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const x="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",r="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function u(h,w){const c=document.createElement("div"),z=document.createElement("label");return z.style.cssText=x,z.textContent=h,c.appendChild(z),c.appendChild(w),c}function p(h,w){const c=document.createElement("input");return c.type="text",c.placeholder=h,c.value=w||"",c.style.cssText=r,c}const g=e.value.substring(e.selectionStart,e.selectionEnd),C=p("/about or https://example.com",g.startsWith("/")?g:"");o.appendChild(u("URL",C));const m=p("Link text",g&&!g.startsWith("/")?g:"");o.appendChild(u("Link text",m));const v=p("e.g. text-primary, fw-bold (optional)","");o.appendChild(u("CSS class",v));const B=p("e.g. arrow-right (optional)","");o.appendChild(u("Icon (before text)",B));const y=p("e.g. external-link (optional)","");o.appendChild(u("Icon (after text)",y));const f=document.createElement("label");f.style.cssText="display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9em;";const P=document.createElement("input");P.type="checkbox",P.style.cssText="width:1rem;height:1rem;",f.appendChild(P),f.appendChild(document.createTextNode("Open in new tab")),o.appendChild(f);const d=document.createElement("button");d.type="button",d.className="btn btn-primary",d.textContent="Insert Link",o.appendChild(d);const T=E.modal({title:"Insert Link Shortcode",size:"sm"});T.element.appendChild(o),T.open(),requestAnimationFrame(()=>{E.autocomplete(C,{data:l,minChars:1,onSelect:h=>{C.value=h.value,m.value||(m.value=h.label)}}),C.focus()}),d.addEventListener("click",()=>{const h=C.value.trim();if(!h)return;T.close();const w=m.value.trim()||h;let c=`href="${h}"`;const z=v.value.trim().replace(/"/g,"");z&&(c+=` class="${z}"`);const S=B.value.trim().replace(/"/g,"");S&&(c+=` icon="${S}"`);const F=y.value.trim().replace(/"/g,"");F&&(c+=` icon-after="${F}"`),P.checked&&(c+=' target="_blank"');const U=`[link ${c}]${w}[/link]`;re(e,U)})}),L.onHelp(()=>{Se()}),i.find(".editor-view-btn").on("click",function(){const e=$(this).data("mode");i.find(".editor-view-btn").removeClass("active"),$(this).addClass("active"),i.find("#editor-body").removeClass("editor-mode-split editor-mode-write editor-mode-preview").addClass(`editor-mode-${e}`)}),i.find("#fullscreen-btn").on("click",function(){i.find(".editor-card").toggleClass("editor-fullscreen")}),se=!1,ve&&window.removeEventListener("beforeunload",ve),ve=e=>{se&&e.preventDefault()},window.addEventListener("beforeunload",ve),we||(we=!0,R.use((e,k,l)=>{const o=window.location.hash.startsWith("#/pages/edit")||window.location.hash==="#/pages/new";if(!se||!o)return l();E.confirm("You have unsaved changes. Leave this page?").then(x=>{x&&(se=!1,l())})})),G.on("input",()=>{se=!0,Q()}),Q(),i.find("#save-btn").on("click",async()=>{const e=i.find("#page-url-path").val().trim();if(!e){E.toast("URL path is required.",{type:"warning"});return}const k=i.find("#field-dconfig").val().trim();let l=null;if(k)try{l=JSON.parse(k)}catch{E.toast("DConfig JSON is invalid. Please check the format before saving.",{type:"warning"});return}const o={title:i.find("#field-title").val().trim()||"Untitled",description:i.find("#field-description").val().trim(),layout:i.find("#field-layout").val(),status:i.find("#field-status").val(),sortOrder:parseInt(i.find("#field-sort-order").val(),10)||99,showInNav:i.find("#field-show-in-nav").is(":checked"),sidebar:i.find("#field-sidebar").is(":checked"),...i.find("#field-show-breadcrumbs").is(":checked")?{}:{breadcrumbs:!1},tags:j?j.getValue():[],category:i.find("#field-category").val().trim()||null,visibility:i.find("#field-visibility").val()||"public",seo:{title:i.find("#field-seo-title").val().trim(),description:i.find("#field-seo-desc").val().trim()},dconfig:l,...i.find("#field-theme").val()?{theme:i.find("#field-theme").val()}:{}};try{if(i.find("#save-btn").prop("disabled",!0).text("Saving\u2026"),D){const x={frontmatter:o,body:G.val()};e!==A&&(x.newUrlPath=e),await H.pages.update(A,x),E.toast("Page saved successfully.",{type:"success"}),se=!1,e!==A&&R.navigate(`/pages/edit${e}`)}else await H.pages.create({urlPath:e,frontmatter:o,body:G.val()}),E.toast("Page saved successfully.",{type:"success"}),se=!1,R.navigate("/pages")}catch(x){E.toast(`Save failed: ${x.message||"Unknown error"}`,{type:"error"})}finally{i.find("#save-btn").prop("disabled",!1).text("Save")}}),i.find("#cancel-btn").on("click",()=>R.navigate("/pages")),Domma.icons.scan()}};
|
|
80
|
+
[/dconfig]`,null)),re.appendChild(H);const G=document.createElement("div");G.appendChild(N("Tips"));const te=document.createElement("table");te.style.cssText="width:100%;border-collapse:collapse;font-size:.85em;margin-bottom:.5rem;",[['class="text-center"',"Centre text and inline elements on any shortcode"],['class="mx-auto"',"Centre a block element horizontally"],["[center]...[/center]","Shorthand wrapper for centred content"]].forEach(([w,h])=>{const a=document.createElement("tr"),o=document.createElement("td");o.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;",o.appendChild(z(w));const d=document.createElement("td");d.style.cssText="padding:.3rem .4rem;border-bottom:1px solid var(--dm-border,#333);vertical-align:top;color:var(--dm-text-muted,#aaa);",d.textContent=h,a.appendChild(o),a.appendChild(d),te.appendChild(a)}),G.appendChild(te),G.appendChild(k("Most shortcodes accept a class attribute for custom styling.")),oe.appendChild(G),n.setContent(ge),n.open(),E.tabs(ae)}function ze(n,ne){const be=n.find("#history-tab").get(0),z=n.find("#version-list").get(0),N=n.find("#version-compare").get(0),ge=n.find("#version-compare-old").get(0),ae=n.find("#version-compare-new").get(0),fe=n.find("#version-compare-label").get(0),le=n.find("#version-compare-back-btn").get(0),F=n.find("#version-restore-btn").get(0),oe=n.find("#history-save-named-btn").get(0);let X=!1,U=null;function de(){z.style.display="",N.style.display="none",U=null}function re(){z.style.display="none",N.style.display=""}async function se(){z.textContent="";const Q=document.createElement("p");Q.style.color="var(--dm-text-muted)",Q.textContent="Loading\u2026",z.appendChild(Q);let O;try{O=(await _.versions.list(ne)).versions||[]}catch(k){z.textContent="";const s=document.createElement("p");s.style.color="var(--dm-text-danger,#e55)",s.textContent="Failed to load versions: "+k.message,z.appendChild(s);return}if(z.textContent="",!O.length){const k=document.createElement("p");k.style.color="var(--dm-text-muted)",k.textContent="No versions saved yet. Versions are created automatically on each save.",z.appendChild(k);return}const J=document.createElement("table");J.style.cssText="width:100%;border-collapse:collapse;font-size:.875rem;";const V=document.createElement("thead"),Z=document.createElement("tr");["Date","Author","Type","Label","Actions"].forEach(k=>{const s=document.createElement("th");s.style.cssText="text-align:left;padding:.5rem .75rem;border-bottom:1px solid var(--dm-border);font-size:.8rem;color:var(--dm-text-muted);",s.textContent=k,Z.appendChild(s)}),V.appendChild(Z),J.appendChild(V);const K=document.createElement("tbody");O.forEach(k=>{const s=document.createElement("tr");s.style.borderBottom="1px solid var(--dm-border)";const Y=document.createElement("td");Y.style.padding=".5rem .75rem",Y.textContent=D(k.createdAt).format("D MMM YYYY, HH:mm");const j=document.createElement("td");j.style.padding=".5rem .75rem",j.textContent=k.author||"\u2014";const e=document.createElement("td");e.style.padding=".5rem .75rem";const c=document.createElement("span");c.className="badge badge-"+(k.type==="manual"?"primary":"secondary"),c.style.cssText="font-size:.75rem;padding:.2rem .5rem;border-radius:4px;",c.textContent=k.type,e.appendChild(c);const t=document.createElement("td");t.style.cssText="padding:.5rem .75rem;color:var(--dm-text-muted);",t.textContent=k.label||"\u2014";const i=document.createElement("td");i.style.padding=".5rem .75rem";const y=document.createElement("button");y.className="btn btn-ghost btn-xs",y.style.marginRight=".4rem",y.textContent="Compare",y.addEventListener("click",async()=>{try{const m=await _.versions.get(ne,k.filename);ge.textContent=m.content,ae.textContent=n.find("#markdown-editor").get(0).value,fe.textContent=D(k.createdAt).format("D MMM YYYY, HH:mm")+(k.label?` \u2014 ${k.label}`:""),U=k.filename,re()}catch(m){E.toast("Failed to load version: "+m.message,{type:"error"})}});const p=document.createElement("button");p.className="btn btn-ghost btn-xs",p.style.color="var(--dm-text-danger,#e55)",p.textContent="Delete",p.addEventListener("click",async()=>{if(await E.confirm("Delete this version? This cannot be undone."))try{await _.versions.delete(ne,k.filename),E.toast("Version deleted.",{type:"success"}),await se()}catch(C){E.toast("Failed to delete: "+C.message,{type:"error"})}}),i.appendChild(y),i.appendChild(p),s.appendChild(Y),s.appendChild(j),s.appendChild(e),s.appendChild(t),s.appendChild(i),K.appendChild(s)}),J.appendChild(K),z.appendChild(J)}be.addEventListener("click",async()=>{X||(X=!0,await se())}),le.addEventListener("click",()=>{de()}),F.addEventListener("click",async()=>{if(!(!U||!await E.confirm("Restore this version? The current page content will be overwritten (a pre-restore snapshot will be saved automatically).")))try{await _.versions.restore(ne,U),E.toast("Page restored. Reloading editor\u2026",{type:"success"}),R.navigate("/pages"),setTimeout(()=>R.navigate(`/pages/edit${ne}`),300)}catch(O){E.toast("Restore failed: "+O.message,{type:"error"})}}),oe.addEventListener("click",()=>{const Q=E.modal({title:"Save Named Version"}),O=document.createElement("div");O.style.padding="1rem";const J=document.createElement("label");J.className="form-label",J.textContent="Version Label";const V=document.createElement("input");V.type="text",V.className="form-input",V.placeholder="e.g. Initial design, Before restructure",V.style.marginBottom=".75rem";const Z=document.createElement("button");Z.className="btn btn-primary",Z.textContent="Save Version",Z.addEventListener("click",async()=>{const K=V.value.trim();try{await _.versions.create(ne,K||null),E.toast("Named version saved.",{type:"success"}),Q.close(),X=!1,be.classList.contains("active")&&(X=!0,await se())}catch(k){E.toast("Failed to save version: "+k.message,{type:"error"})}}),O.appendChild(J),O.appendChild(V),O.appendChild(Z),Q.element.appendChild(O),Q.open(),setTimeout(()=>V.focus(),100)})}let me=!1,we=null,Te=!1;export const pageEditorView={templateUrl:"/admin/js/templates/page-editor.html",async onMount(n){const be=window.location.hash.match(/#\/pages\/edit(\/.*)/),z=be?be[1]:null,N=!!z,ge=E.loader(n.get(0),{type:"dots"}),ae=[_.layouts.get().catch(()=>({})),_.settings.get().catch(()=>({}))];N&&(ae.push(_.pages.get(z).catch(()=>null)),ae.push(_.pages.list().catch(()=>[])));const[fe,le,F,oe]=await Promise.all(ae);ge.destroy(),Se(n.find("#field-theme").get(0),{includeDefault:!0});const X=le?.layoutOptions?.spacerSize??40;if(N&&!F){E.toast("Page not found.",{type:"error"}),R.navigate("/pages");return}n.find("#editor-title").text(N?`Edit Page \u2014 ${F.title||z}`:"New Page"),N&&n.find("#page-url-path").val(z),F&&(n.find("#field-title").val(F.title||""),n.find("#field-description").val(F.description||""),n.find("#field-status").val(F.status||"draft"),n.find("#field-sort-order").val(F.sortOrder??99),n.find("#field-show-in-nav").prop("checked",!!F.showInNav),n.find("#field-sidebar").prop("checked",!!F.sidebar),n.find("#field-show-breadcrumbs").prop("checked",F.breadcrumbs!==!1),n.find("#field-category").val(F.category||""),n.find("#field-visibility").val(F.visibility||"public"),n.find("#field-theme").val(F.theme||""),n.find("#field-seo-title").val(F.seo?.title||""),n.find("#field-seo-desc").val(F.seo?.description||""),F.dconfig&&n.find("#field-dconfig").val(JSON.stringify(F.dconfig,null,2)));const U=n.find("#quick-switch");N&&Array.isArray(oe)&&oe.length&&([...oe].sort((c,t)=>(c.title||c.urlPath).localeCompare(t.title||t.urlPath)).forEach(c=>{const t=document.createElement("option");t.value=c.urlPath,t.textContent=`${c.title||"Untitled"} (${c.urlPath})`,c.urlPath===z&&(t.selected=!0),U.get(0).appendChild(t)}),U.css("display",""),U.on("change",function(){const c=this.value;c&&R.navigate("/pages/edit"+c)}));const de=await _.pages.tags().catch(()=>[]),re=n.find("#field-tags").get(0),se=re?E.pillbox(re,{data:de,value:F?.tags||[],creatable:!0,searchable:!0,placeholder:"Add tag\u2026"}):null,Q=n.find("#field-layout").empty();if(Object.entries(fe).forEach(([e,c])=>{const t=(F?.layout||"default")===e?"selected":"";Q.append(`<option value="${e}" ${t}>${c.label||e}</option>`)}),N){const e=n.find("#view-page-btn").get(0);e.href=z,e.style.display="";const c=n.find("#live-preview-tab").get(0);c.style.display="";const t=n.find("#history-tab").get(0);t.style.display=""}if(E.tabs(n.find("#editor-meta-tabs").get(0)),N){const e=n.find("#live-preview-tab").get(0),c=n.find("#live-preview-frame").get(0);let t=!1;e.addEventListener("click",function(){t||(c.src=z,t=!0)}),ze(n,z)}const O=n.find("#markdown-editor"),J=n.find("#markdown-preview");F&&O.val(F.content||"");const V=O.get(0),Z=document.createElement("div");Z.className="editor-line-numbers",V.parentElement.insertBefore(Z,V);const K=()=>{const e=V.value.split(`
|
|
81
|
+
`).length;Z.textContent=Array.from({length:e},(c,t)=>t+1).join(`
|
|
82
|
+
`),Z.scrollTop=V.scrollTop};K(),V.addEventListener("input",K),V.addEventListener("scroll",()=>{Z.scrollTop=V.scrollTop});let k=null;const s=()=>{clearTimeout(k),k=setTimeout(async()=>{try{const{html:e}=await _.pages.preview(O.val());J.html(e,{safe:!1}),I.scan(J.get(0)),J.get(0).querySelectorAll(".tabs").forEach(c=>Domma.elements.tabs(c))}catch{window.marked&&J.html(marked.parse(O.val()))}},400)},Y=ke(O,n.find("#editor-toolbar"),{spacerDefault:X});Y.onLink(async e=>{const t=(await _.pages.list().catch(()=>[])).map(l=>({label:l.title||l.urlPath,value:l.urlPath})),i=document.createElement("div");i.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const y=document.createElement("label");y.className="form-label",y.textContent="URL";const p=document.createElement("input");p.type="text",p.className="form-input",p.placeholder="/about or https://example.com";const m=e.value.substring(e.selectionStart,e.selectionEnd);m&&m.startsWith("/")&&(p.value=m),i.appendChild(y),i.appendChild(p);const C=document.createElement("label");C.className="form-label",C.textContent="Link text";const v=document.createElement("input");v.type="text",v.className="form-input",v.placeholder="Display text",m&&!m.startsWith("/")&&(v.value=m),i.appendChild(C),i.appendChild(v);const f=document.createElement("label");f.className="form-label",f.style.cssText="display:flex;align-items:center;gap:.5rem;cursor:pointer;";const b=document.createElement("input");b.type="checkbox",b.style.cssText="width:1rem;height:1rem;cursor:pointer;",f.appendChild(b),f.appendChild(document.createTextNode("Display as button")),i.appendChild(f);const L=document.createElement("label");L.className="form-label",L.textContent="Button colour",L.style.display="none";const P=document.createElement("select");P.className="form-select",P.style.display="none",[["primary","Primary"],["secondary","Secondary"],["success","Success (Green)"],["danger","Danger (Red)"],["warning","Warning (Orange)"],["info","Info (Blue)"],["outline","Outline"],["outline-success","Outline Success"],["outline-danger","Outline Danger"],["ghost","Ghost"]].forEach(([l,x])=>{const r=document.createElement("option");r.value=l,r.textContent=x,P.appendChild(r)}),i.appendChild(L),i.appendChild(P),b.addEventListener("change",()=>{const l=b.checked;L.style.display=l?"":"none",P.style.display=l?"":"none"});const S=document.createElement("button");S.type="button",S.className="btn btn-primary",S.textContent="Insert Link",i.appendChild(S);const q=E.modal({title:"Insert Link",size:"sm"});q.element.appendChild(i),q.open(),requestAnimationFrame(()=>{E.autocomplete(p,{data:t,minChars:1,onSelect:l=>{p.value=l.value,v.value||(v.value=l.label)}}),p.focus()}),S.addEventListener("click",()=>{const l=p.value.trim(),x=v.value.trim();if(!l)return;q.close();const r=b.checked?`[button href="${l}" variant="${P.value}"]${x||l}[/button]`:`[${x||l}](${l})`,g=e.selectionStart,u=e.selectionEnd;e.value=e.value.substring(0,g)+r+e.value.substring(u),e.selectionStart=e.selectionEnd=g+r.length,e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),Y.onImage(async e=>{const t=(await _.media.list().catch(()=>[])).filter(p=>/\.(png|jpe?g|gif|webp|svg)$/i.test(p.name)),i=document.createElement("div");if(i.className="media-picker-grid",t.length)t.forEach(p=>{const m=document.createElement("div");m.className="media-picker-item",m.dataset.url=p.url;const C=document.createElement("img");C.src=p.url,C.alt=p.name;const v=document.createElement("span");v.textContent=p.name,m.appendChild(C),m.appendChild(v),i.appendChild(m)});else{const p=document.createElement("p");p.className="text-muted p-3",p.textContent="No images uploaded yet.",i.appendChild(p)}const y=E.modal({title:"Insert Image",size:"lg"});y.element.appendChild(i),$(y.element).on("click",".media-picker-item",function(){const p=$(this).data("url"),m=$(this).find("span").text();he(e,``),y.close(),O.get(0).dispatchEvent(new Event("input",{bubbles:!0}))}),y.open()}),Y.onCollection(async e=>{const c=await _.collections.list().catch(()=>[]),t=document.createElement("div");t.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const i="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",y="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;",p=document.createElement("div"),m=document.createElement("label");m.style.cssText=i,m.textContent="Collection";const C=document.createElement("select");if(C.style.cssText=y,c.length)c.forEach(H=>{const G=document.createElement("option");G.value=H.slug,G.textContent=H.title||H.slug,C.appendChild(G)});else{const H=document.createElement("option");H.value="",H.textContent="No collections found",C.appendChild(H)}p.appendChild(m),p.appendChild(C),t.appendChild(p);const v=document.createElement("div"),f=document.createElement("label");f.style.cssText=i,f.textContent="Display";const b=document.createElement("select");b.style.cssText=y,["table","cards","list"].forEach(H=>{const G=document.createElement("option");G.value=H,G.textContent=H.charAt(0).toUpperCase()+H.slice(1),b.appendChild(G)}),v.appendChild(f),v.appendChild(b),t.appendChild(v);const L=document.createElement("div");L.style.display="none";const P=document.createElement("label");P.style.cssText=i,P.textContent="Columns (2\u20134)";const T=document.createElement("input");T.type="number",T.min="2",T.max="4",T.value="3",T.style.cssText=y,L.appendChild(P),L.appendChild(T),t.appendChild(L);const S=document.createElement("div"),q=document.createElement("label");q.style.cssText="display:flex;align-items:center;gap:.5rem;font-size:.9em;cursor:pointer;";const l=document.createElement("input");l.type="checkbox",l.checked=!0,q.appendChild(l),q.appendChild(document.createTextNode("Enable search")),S.appendChild(q),t.appendChild(S);const x=document.createElement("div"),r=document.createElement("label");r.style.cssText="display:flex;align-items:center;gap:.5rem;font-size:.9em;cursor:pointer;";const g=document.createElement("input");g.type="checkbox",g.checked=!0,r.appendChild(g),r.appendChild(document.createTextNode("Sortable columns")),x.appendChild(r),t.appendChild(x);const u=document.createElement("div"),B=document.createElement("label");B.style.cssText="display:flex;align-items:center;gap:.5rem;font-size:.9em;cursor:pointer;";const A=document.createElement("input");A.type="checkbox",A.checked=!1,B.appendChild(A),B.appendChild(document.createTextNode("CSV export")),u.appendChild(B),t.appendChild(u);const M=document.createElement("div"),W=document.createElement("label");W.style.cssText=i,W.textContent="Rows per page";const ee=document.createElement("input");ee.type="number",ee.min="5",ee.max="100",ee.value="25",ee.style.cssText=y,M.appendChild(W),M.appendChild(ee),t.appendChild(M);const ce=document.createElement("div"),ye=document.createElement("label");ye.style.cssText=i,ye.textContent="Limit (optional)";const pe=document.createElement("input");pe.type="number",pe.placeholder="All",pe.style.cssText=y,ce.appendChild(ye),ce.appendChild(pe),t.appendChild(ce);const ie=document.createElement("button");ie.type="button",ie.className="btn btn-primary",ie.textContent="Insert",t.appendChild(ie);const xe=[S,x,u,M],ue=()=>{const H=b.value==="table";xe.forEach(G=>{G.style.display=H?"":"none"}),L.style.display=b.value==="cards"?"":"none"};b.addEventListener("change",ue),ue();const Ce=E.modal({title:"Insert Collection",size:"sm"});Ce.element.appendChild(t),Ce.open(),ie.addEventListener("click",()=>{const H=C.value;if(!H)return;const G=b.value;let te=`[collection slug="${H}" display="${G}"`;G==="cards"&&(te+=` columns="${T.value}"`),G==="table"&&!l.checked&&(te+=' search="false"'),G==="table"&&!g.checked&&(te+=' sortable="false"'),G==="table"&&A.checked&&(te+=' exportable="true"'),G==="table"&&ee.value!=="25"&&(te+=` page-size="${ee.value}"`);const w=pe.value.trim();w&&(te+=` limit="${w}"`),te+=" /]",Ce.close(),he(e,te),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),Y.onForm(async e=>{const c=await _.forms.list().catch(()=>[]),t=document.createElement("div");t.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const i="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",y="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;",p=document.createElement("div"),m=document.createElement("label");m.style.cssText=i,m.textContent="Form";const C=document.createElement("select");if(C.style.cssText=y,c.length)c.forEach(b=>{const L=document.createElement("option");L.value=b.slug,L.textContent=b.title||b.slug,C.appendChild(L)});else{const b=document.createElement("option");b.value="",b.textContent="No forms found",C.appendChild(b)}p.appendChild(m),p.appendChild(C),t.appendChild(p);const v=document.createElement("button");v.className="btn btn-primary btn-sm",v.style.cssText="align-self:flex-end;margin-top:.5rem;",v.textContent="Insert Form",t.appendChild(v);const f=E.modal({title:"Insert Form",size:"sm"});f.element.appendChild(t),f.open(),v.addEventListener("click",()=>{const b=C.value;b&&(he(e,`[form slug="${b}" /]`),f.close(),O.get(0).dispatchEvent(new Event("input",{bubbles:!0})))})}),Y.onView(async e=>{const c=await _.views.list().catch(()=>[]),t=document.createElement("div");t.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const i="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",y="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;",p=document.createElement("div"),m=document.createElement("label");m.style.cssText=i,m.textContent="View";const C=document.createElement("select");if(C.style.cssText=y,c.length)c.forEach(T=>{const S=document.createElement("option");S.value=T.slug,S.textContent=T.title||T.slug,C.appendChild(S)});else{const T=document.createElement("option");T.value="",T.textContent="No Views configured yet \u2014 create one under Data \u2192 Views",C.appendChild(T)}p.appendChild(m),p.appendChild(C),t.appendChild(p);const v=document.createElement("div"),f=document.createElement("label");f.style.cssText=i,f.textContent="Display";const b=document.createElement("select");b.style.cssText=y,["table","cards","list"].forEach(T=>{const S=document.createElement("option");S.value=T,S.textContent=T.charAt(0).toUpperCase()+T.slice(1),b.appendChild(S)}),v.appendChild(f),v.appendChild(b),t.appendChild(v);const L=document.createElement("button");L.type="button",L.className="btn btn-primary",L.textContent="Insert",t.appendChild(L);const P=E.modal({title:"Insert View",size:"sm"});P.element.appendChild(t),P.open(),L.addEventListener("click",()=>{const T=C.value;if(!T)return;const S=`[view slug="${T}" display="${b.value}" /]`;P.close(),he(e,S),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),Y.onCta(async e=>{const c=await _.actions.list().catch(()=>[]),t=document.createElement("div");t.style.cssText="padding:1rem;display:flex;flex-direction:column;gap:.75rem;";const i="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",y="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function p(l,x){const r=document.createElement("div"),g=document.createElement("label");return g.style.cssText=i,g.textContent=l,r.appendChild(g),r.appendChild(x),r}function m(l){const x=document.createElement("select");return x.style.cssText=y,l.forEach(([r,g])=>{const u=document.createElement("option");u.value=r,u.textContent=g,x.appendChild(u)}),x}function C(l,x,r){const g=document.createElement("input");return g.type=l,g.placeholder=x||"",g.value=r||"",g.style.cssText=y,g}const v=m(c.length?c.map(l=>[l.slug,l.title||l.slug]):[["","No Actions configured yet \u2014 create one under Data \u2192 Actions"]]);t.appendChild(p("Action",v));const f=C("text","Button label","Run");if(t.appendChild(p("Label",f)),v.addEventListener("change",()=>{const l=c.find(x=>x.slug===v.value);l?.trigger?.label&&(f.value=l.trigger.label)}),c.length){const l=c[0];l?.trigger?.label&&(f.value=l.trigger.label)}const b=C("text","Paste entry UUID\u2026","");t.appendChild(p("Entry ID",b));const L=m([["primary","Primary"],["secondary","Secondary"],["ghost","Ghost"],["danger","Danger"]]);t.appendChild(p("Style",L));const P=C("text","e.g. check, zap, send (optional)","");t.appendChild(p("Icon",P));const T=C("text","Confirmation message (optional)","");t.appendChild(p("Confirm prompt",T));const S=document.createElement("button");S.type="button",S.className="btn btn-primary",S.textContent="Insert",t.appendChild(S);const q=E.modal({title:"Insert CTA Button",size:"sm"});q.element.appendChild(t),q.open(),S.addEventListener("click",()=>{const l=v.value;if(!l)return;const x=b.value.trim(),r=(f.value.trim()||"Run").replace(/\[\/cta\]/gi,""),g=L.value,u=P.value.trim().replace(/"/g,""),B=T.value.trim().replace(/"/g,""),A=x.replace(/"/g,"");let M=`action="${l}" style="${g}"`;A&&(M+=` entry="${A}"`),u&&(M+=` icon="${u}"`),B&&(M+=` confirm="${B}"`);const W=`[cta ${M}]${r}[/cta]`;q.close(),he(e,W),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),Y.onButton(async e=>{const t=(await _.pages.list().catch(()=>[])).map(u=>({label:u.title||u.urlPath,value:u.urlPath})),i=document.createElement("div");i.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const y="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",p="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function m(u,B){const A=document.createElement("div"),M=document.createElement("label");return M.style.cssText=y,M.textContent=u,A.appendChild(M),A.appendChild(B),A}function C(u,B){const A=document.createElement("input");return A.type="text",A.placeholder=u,A.value=B||"",A.style.cssText=p,A}function v(u){const B=document.createElement("select");return B.style.cssText=p,u.forEach(([A,M])=>{const W=document.createElement("option");W.value=A,W.textContent=M,B.appendChild(W)}),B}const f=e.value.substring(e.selectionStart,e.selectionEnd),b=C("/about or https://example.com",f.startsWith("/")?f:"");i.appendChild(m("URL",b));const L=C("Button label",f&&!f.startsWith("/")?f:"");i.appendChild(m("Label",L));const P=v([["primary","Primary"],["secondary","Secondary"],["success","Success (Green)"],["danger","Danger (Red)"],["warning","Warning (Orange)"],["info","Info (Blue)"],["outline","Outline"],["ghost","Ghost"],["link","Link"],["outline-success","Outline Success"],["outline-danger","Outline Danger"]]);i.appendChild(m("Variant",P));const T=v([["","Default"],["sm","Small"],["lg","Large"]]);i.appendChild(m("Size",T));const S=C("e.g. arrow-right, star (optional)","");i.appendChild(m("Icon (before label)",S));const q=C("e.g. arrow-right (optional)","");i.appendChild(m("Icon (after label)",q));const l=document.createElement("label");l.style.cssText="display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9em;";const x=document.createElement("input");x.type="checkbox",x.style.cssText="width:1rem;height:1rem;",l.appendChild(x),l.appendChild(document.createTextNode("Open in new tab")),i.appendChild(l);const r=document.createElement("button");r.type="button",r.className="btn btn-primary",r.textContent="Insert Button",i.appendChild(r);const g=E.modal({title:"Insert Button",size:"sm"});g.element.appendChild(i),g.open(),requestAnimationFrame(()=>{E.autocomplete(b,{data:t,minChars:1,onSelect:u=>{b.value=u.value,L.value||(L.value=u.label)}}),b.focus()}),r.addEventListener("click",()=>{const u=b.value.trim();if(!u)return;g.close();const B=L.value.trim()||u;let A=`href="${u}" variant="${P.value}"`;T.value&&(A+=` size="${T.value}"`);const M=S.value.trim().replace(/"/g,"");M&&(A+=` icon="${M}"`);const W=q.value.trim().replace(/"/g,"");W&&(A+=` icon-after="${W}"`),x.checked&&(A+=' target="_blank"');const ee=`[button ${A}]${B}[/button]`;he(e,ee)})}),Y.onLinkShortcode(async e=>{const t=(await _.pages.list().catch(()=>[])).map(r=>({label:r.title||r.urlPath,value:r.urlPath})),i=document.createElement("div");i.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const y="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",p="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function m(r,g){const u=document.createElement("div"),B=document.createElement("label");return B.style.cssText=y,B.textContent=r,u.appendChild(B),u.appendChild(g),u}function C(r,g){const u=document.createElement("input");return u.type="text",u.placeholder=r,u.value=g||"",u.style.cssText=p,u}const v=e.value.substring(e.selectionStart,e.selectionEnd),f=C("/about or https://example.com",v.startsWith("/")?v:"");i.appendChild(m("URL",f));const b=C("Link text",v&&!v.startsWith("/")?v:"");i.appendChild(m("Link text",b));const L=C("e.g. text-primary, fw-bold (optional)","");i.appendChild(m("CSS class",L));const P=C("e.g. arrow-right (optional)","");i.appendChild(m("Icon (before text)",P));const T=C("e.g. external-link (optional)","");i.appendChild(m("Icon (after text)",T));const S=document.createElement("label");S.style.cssText="display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9em;";const q=document.createElement("input");q.type="checkbox",q.style.cssText="width:1rem;height:1rem;",S.appendChild(q),S.appendChild(document.createTextNode("Open in new tab")),i.appendChild(S);const l=document.createElement("button");l.type="button",l.className="btn btn-primary",l.textContent="Insert Link",i.appendChild(l);const x=E.modal({title:"Insert Link Shortcode",size:"sm"});x.element.appendChild(i),x.open(),requestAnimationFrame(()=>{E.autocomplete(f,{data:t,minChars:1,onSelect:r=>{f.value=r.value,b.value||(b.value=r.label)}}),f.focus()}),l.addEventListener("click",()=>{const r=f.value.trim();if(!r)return;x.close();const g=b.value.trim()||r;let u=`href="${r}"`;const B=L.value.trim().replace(/"/g,"");B&&(u+=` class="${B}"`);const A=P.value.trim().replace(/"/g,"");A&&(u+=` icon="${A}"`);const M=T.value.trim().replace(/"/g,"");M&&(u+=` icon-after="${M}"`),q.checked&&(u+=' target="_blank"');const W=`[link ${u}]${g}[/link]`;he(e,W)})}),Y.onTabs(e=>{const c=document.createElement("div");c.style.cssText="padding:.25rem 0 .5rem;display:flex;flex-direction:column;gap:.75rem;";const t="display:block;font-size:.85em;font-weight:600;margin-bottom:.25rem;color:var(--dm-text-muted,#aaa);text-transform:uppercase;letter-spacing:.05em;",i="width:100%;padding:.4rem .6rem;background:var(--dm-input-bg,#1a1a1a);border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text,#eee);font-size:.9em;";function y(l,x){const r=document.createElement("div"),g=document.createElement("label");return g.style.cssText=t,g.textContent=l,r.appendChild(g),r.appendChild(x),r}function p(l){const x=document.createElement("select");return x.style.cssText=i,l.forEach(([r,g])=>{const u=document.createElement("option");u.value=r,u.textContent=g,x.appendChild(u)}),x}const m=p([["","Default (underline)"],["pills","Pills"]]);c.appendChild(y("Style",m));const C=p([["","Left"],["center","Centre"]]);c.appendChild(y("Alignment",C));const v=document.createElement("div");v.style.cssText="display:flex;flex-direction:column;gap:.4rem;";const f=[];function b(){f.forEach(l=>{l.removeBtn.disabled=f.length<=2,l.removeBtn.style.opacity=f.length<=2?"0.3":"1"})}function L(l){const x=document.createElement("div");x.style.cssText="display:flex;gap:.4rem;align-items:center;";const r=document.createElement("input");r.type="text",r.placeholder="Tab title",r.value=l||"",r.style.cssText=i+"flex:1;";const g=document.createElement("button");g.type="button",g.textContent="\u2715",g.style.cssText="padding:.3rem .5rem;background:transparent;border:1px solid var(--dm-border,#333);border-radius:4px;color:var(--dm-text-muted,#aaa);cursor:pointer;font-size:.85em;flex-shrink:0;";const u={row:x,input:r,removeBtn:g};f.push(u),x.appendChild(r),x.appendChild(g),v.appendChild(x),g.addEventListener("click",()=>{if(f.length<=2)return;const B=f.indexOf(u);f.splice(B,1),v.removeChild(x),b()}),b()}L("Overview"),L("Details");const P=document.createElement("div");P.style.cssText=t,P.textContent="Tabs",c.appendChild(P),c.appendChild(v);const T=document.createElement("button");T.type="button",T.textContent="+ Add Tab",T.style.cssText="padding:.35rem .75rem;background:transparent;border:1px dashed var(--dm-border,#555);border-radius:4px;color:var(--dm-text-muted,#aaa);cursor:pointer;font-size:.85em;align-self:flex-start;",T.addEventListener("click",()=>{f.length>=10||(L(""),f[f.length-1].input.focus())}),c.appendChild(T);const S=document.createElement("button");S.type="button",S.className="btn btn-primary",S.textContent="Insert Tabs",c.appendChild(S);const q=E.modal({title:"Insert Tabs",size:"sm"});q.element.appendChild(c),q.open(),requestAnimationFrame(()=>f[0].input.focus()),S.addEventListener("click",()=>{q.close();const l=m.value,x=C.value;let r=l?` style="${l}"`:"";x&&(r+=` align="${x}"`);let g=`[tabs${r}]
|
|
83
|
+
`;f.forEach((u,B)=>{const A=u.input.value.trim()||`Tab ${B+1}`;g+=`[tab title="${A}"]Tab content here.[/tab]
|
|
84
|
+
`}),g+="[/tabs]",he(e,g),e.dispatchEvent(new Event("input",{bubbles:!0})),e.focus()})}),Y.onHelp(()=>{Le()}),n.find(".editor-view-btn").on("click",function(){const e=$(this).data("mode");n.find(".editor-view-btn").removeClass("active"),$(this).addClass("active"),n.find("#editor-body").removeClass("editor-mode-split editor-mode-write editor-mode-preview").addClass(`editor-mode-${e}`)}),n.find("#fullscreen-btn").on("click",function(){n.find(".editor-card").toggleClass("editor-fullscreen")}),me=!1,n.find("#quick-switch").prop("disabled",!1),we&&window.removeEventListener("beforeunload",we),we=e=>{me&&e.preventDefault()},window.addEventListener("beforeunload",we),Te||(Te=!0,R.use((e,c,t)=>{const i=window.location.hash.startsWith("#/pages/edit")||window.location.hash==="#/pages/new";if(!me||!i)return t();E.confirm("You have unsaved changes. Leave this page?").then(y=>{y&&(me=!1,t())})})),O.on("input",()=>{me=!0,n.find("#quick-switch").prop("disabled",!0),s()});const j=n.find("#editor-meta-tabs").get(0);j&&(j.addEventListener("input",()=>{me=!0,n.find("#quick-switch").prop("disabled",!0)}),j.addEventListener("change",e=>{e.target.id!=="quick-switch"&&(me=!0,n.find("#quick-switch").prop("disabled",!0))})),s(),n.find("#save-btn").on("click",async()=>{const e=n.find("#page-url-path").val().trim();if(!e){E.toast("URL path is required.",{type:"warning"});return}const c=n.find("#field-dconfig").val().trim();let t=null;if(c)try{t=JSON.parse(c)}catch{E.toast("DConfig JSON is invalid. Please check the format before saving.",{type:"warning"});return}const i={title:n.find("#field-title").val().trim()||"Untitled",description:n.find("#field-description").val().trim(),layout:n.find("#field-layout").val(),status:n.find("#field-status").val(),sortOrder:parseInt(n.find("#field-sort-order").val(),10)||99,showInNav:n.find("#field-show-in-nav").is(":checked"),sidebar:n.find("#field-sidebar").is(":checked"),...n.find("#field-show-breadcrumbs").is(":checked")?{}:{breadcrumbs:!1},tags:se?se.getValue():[],category:n.find("#field-category").val().trim()||null,visibility:n.find("#field-visibility").val()||"public",seo:{title:n.find("#field-seo-title").val().trim(),description:n.find("#field-seo-desc").val().trim()},dconfig:t,...n.find("#field-theme").val()?{theme:n.find("#field-theme").val()}:{}};try{if(n.find("#save-btn").prop("disabled",!0).text("Saving\u2026"),N){const y={frontmatter:i,body:O.val()};e!==z&&(y.newUrlPath=e),await _.pages.update(z,y),E.toast("Page saved successfully.",{type:"success"}),me=!1,n.find("#quick-switch").prop("disabled",!1),e!==z&&R.navigate(`/pages/edit${e}`)}else await _.pages.create({urlPath:e,frontmatter:i,body:O.val()}),E.toast("Page saved successfully.",{type:"success"}),me=!1,R.navigate("/pages")}catch(y){E.toast(`Save failed: ${y.message||"Unknown error"}`,{type:"error"})}finally{n.find("#save-btn").prop("disabled",!1).text("Save")}}),n.find("#cancel-btn").on("click",()=>R.navigate("/pages")),Domma.icons.scan()}};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"/": 139,
|
|
3
3
|
"/about": 71,
|
|
4
|
-
"/blog":
|
|
4
|
+
"/blog": 36,
|
|
5
5
|
"/contact": 30,
|
|
6
6
|
"/resources/typography": 4,
|
|
7
7
|
"/resources": 13,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"/resources/dependencies": 2,
|
|
17
17
|
"/resources/components": 6,
|
|
18
18
|
"/gdpr": 3,
|
|
19
|
-
"/scratch":
|
|
19
|
+
"/scratch": 67,
|
|
20
20
|
"/getting-started": 3,
|
|
21
21
|
"/resources/pro": 1,
|
|
22
22
|
"/todo": 23,
|
package/public/css/site.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
body,button,input,select,textarea{font-family:Roboto,sans-serif}.site-main{min-height:calc(100vh - 60px);padding-top:2rem;padding-bottom:4rem}.site-main.with-sidebar{display:grid;grid-template-columns:260px 1fr;gap:0}.site-sidebar{min-height:100%;border-right:1px solid var(--border-color, rgba(255,255,255,.08))}.site-content{overflow:hidden}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}.container{max-width:860px;margin:0 auto;padding:0 1.5rem}.page-title{font-size:2rem;font-weight:700;margin-bottom:1.5rem;line-height:1.2}.page-body{line-height:1.7;font-size:1rem}.page-body h1,.page-body h2,.page-body h3,.page-body h4{margin-top:2rem;margin-bottom:.75rem;font-weight:600}.page-body h2{font-size:1.5rem}.page-body h3{font-size:1.25rem}.page-body p{margin-bottom:1rem}.page-body ul,.page-body ol{margin-bottom:1rem;padding-left:1.5rem}.page-body a{color:var(--primary, #5b8cff)}.page-body a:hover{text-decoration:underline}.page-body code{font-family:Fira Code,Courier New,monospace;font-size:.9em;background:#ffffff0f;padding:.15em .35em;border-radius:3px}.page-body pre{background:#0000004d;border:1px solid rgba(255,255,255,.08);border-radius:6px;padding:1rem;overflow-x:auto;margin-bottom:1rem}.page-body pre code{background:none;padding:0}.page-body img{max-width:100%;border-radius:6px}.page-body blockquote{border-left:3px solid var(--primary, #5b8cff);margin:1.5rem 0;padding:.75rem 1rem;background:#5b8cff0f;border-radius:0 6px 6px 0}h3.accordion-header{margin:0}.accordion-button{all:unset;display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer;font:inherit}.page-body .card-header h2{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.card[data-collapsible] .card-header{cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between}.card[data-collapsible] .card-header:after{content:"\25be";font-size:1.1em;line-height:1;display:inline-block;transition:transform .25s ease;flex-shrink:0}.card[data-collapsible].is-collapsed .card-header:after{transform:rotate(-90deg)}.card[data-collapsible] .card-body{overflow:hidden;max-height:4000px;opacity:1;transition:max-height .3s ease,opacity .25s ease}.card[data-collapsible].is-collapsed .card-body{max-height:0;opacity:0}.navbar-link span[data-icon],.navbar-link svg,.navbar-dropdown-toggle span[data-icon],.navbar-dropdown-toggle svg,.navbar-dropdown-item span[data-icon],.navbar-dropdown-item svg{width:13px!important;height:13px!important;margin-right:10px!important}.navbar-dropdown-toggle{font-size:var(--dm-font-size-base)}@media(min-width:993px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-sm)}}@media(min-width:1201px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-xs)}}.dm-reduced-motion *,.dm-reduced-motion *:before,.dm-reduced-motion *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.page-footer{border-top:1px solid var(--border-color, rgba(255,255,255,.08));padding:1.5rem 0}.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}.footer-inner p{margin:0;color:var(--text-muted, #888);font-size:.875rem}.footer-links{display:flex;gap:1.25rem}.footer-links a{color:var(--text-muted, #888);font-size:.875rem;text-decoration:none}.footer-links a:hover{color:var(--text, #eee)}.footer-social{display:flex;gap:.5rem;align-items:center}.footer-social-link{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;color:var(--text-muted, #888);transition:color .15s}.footer-social-link:hover{color:var(--text, #eee)}.footer-social-link svg{width:1rem;height:1rem}.footer-motion-switch{font-size:.8rem;color:var(--text-muted, #888);white-space:nowrap}.footer-motion-switch .form-switch-label{color:var(--text-muted, #888)}.footer-motion-switch .form-switch-input{width:2rem;height:1.125rem}.footer-motion-switch .form-switch-input:after{width:.875rem;height:.875rem}.footer-motion-switch .form-switch-input:checked:after{transform:translate(.875rem)}.dm-slideover-header{display:flex;align-items:center;justify-content:space-between;padding:.875rem 1.25rem;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08));flex-shrink:0}.dm-slideover-title{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.dm-slideover-body{padding:1.25rem;overflow-y:auto;flex:1}@media(max-width:768px){.site-main.with-sidebar{grid-template-columns:1fr}.site-sidebar{display:none}}.dm-spacer{display:block;width:100%}.hero-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.site-main:has(.page-body>.hero-breakout:first-child){padding-top:0}body[data-layout=landing]>.site-main{padding-top:0}body[data-layout=landing]>.site-main .container{max-width:none;padding:0}body[data-layout=landing] .page-body{padding-left:1.5rem;padding-right:1.5rem}body[data-layout=landing] .page-body>p,body[data-layout=landing] .page-body>h1,body[data-layout=landing] .page-body>h2,body[data-layout=landing] .page-body>h3,body[data-layout=landing] .page-body>ul,body[data-layout=landing] .page-body>ol,body[data-layout=landing] .page-body>blockquote{max-width:860px;margin-left:auto;margin-right:auto}body[data-layout=landing] .page-body .hero-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem}body[data-layout=landing] .page-body .grid-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem;padding-left:1.5rem;padding-right:1.5rem}.page-body .card{transition:transform .2s ease,box-shadow .2s ease}.page-body .card:hover{transform:translateY(-3px);box-shadow:0 8px 24px #00000059}.page-body .card-header-icon-inline{display:flex;align-items:center;gap:.6rem}.page-body .card-header-icon-inline [data-icon]{flex-shrink:0;line-height:0}.page-body .card-header-icon-inline [data-icon] svg,.page-body .card-header-icon-inline>svg{display:block;width:1.25rem;height:1.25rem}.page-body .card-header-icon-stacked{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.35rem;padding-top:.25rem}.page-body .card-header-icon-stacked [data-icon],.page-body .card-header-icon-stacked svg{width:2rem;height:2rem}.hero.hero-dark{background:linear-gradient(135deg,#1f2937,#111827);color:#e2e8f0}.hero .hero-content{position:relative;z-index:2}.hero.hero-left .hero-content{text-align:left;align-items:flex-start;max-width:62%}@media(max-width:768px){.hero.hero-left .hero-content{max-width:100%}}.hero .hero-cta{display:flex;gap:.85rem;flex-wrap:wrap;margin-top:1.75rem}.hero .hero-cta a{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem 1.35rem;border-radius:6px;font-size:.95rem;font-weight:500;text-decoration:none;transition:background .2s ease,border-color .2s ease,transform .15s ease,box-shadow .2s ease}.hero .hero-cta a:first-child{background:#ffffffeb;color:#111;border:1px solid transparent}.hero .hero-cta a:first-child:hover{background:#fff;box-shadow:0 4px 16px #00000040;transform:translateY(-2px)}.hero .hero-cta a:last-child{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4)}.hero .hero-cta a:last-child:hover{border-color:#ffffffbf;background:#ffffff14;transform:translateY(-2px)}.hero .hero-label{display:inline-block;margin-bottom:.9rem;padding:.2rem .8rem;border-radius:999px;font-size:.72rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:#ffffffb3;border:1px solid rgba(255,255,255,.22)}.grid-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.dm-breadcrumbs{position:fixed;z-index:200;display:inline-flex;align-items:center;gap:.2rem;padding:.3rem .8rem;border-radius:999px;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);background:#00000047;border:1px solid rgba(255,255,255,.11);box-shadow:0 2px 10px #00000038;font-size:.72rem;font-weight:500;letter-spacing:.01em;line-height:1.4;max-width:calc(100vw - 2rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dm-breadcrumbs .dm-breadcrumbs-item{color:#ffffffa6}.dm-breadcrumbs .dm-breadcrumbs-link{display:inline-flex;align-items:center;gap:.25rem;color:#ffffff8c;text-decoration:none;transition:color .15s}.dm-breadcrumbs .dm-breadcrumbs-home-icon{flex-shrink:0;vertical-align:middle}.dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#fffffff2}.dm-breadcrumbs .dm-breadcrumbs-current{color:#ffffffeb;font-weight:600}.dm-breadcrumbs .dm-breadcrumbs-separator{color:#ffffff47;font-size:.8em;line-height:1;margin:0 .05rem}[data-mode=light] .dm-breadcrumbs{background:#ffffff8c;border-color:#00000012;box-shadow:0 2px 10px #00000014}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-item,[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link{color:#0000008c}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#000000e6}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-current{color:#000000d9}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-separator{color:#00000040}.dm-collection-display{margin:1.5rem 0}.dm-collection-list{display:flex;flex-direction:column;gap:0}.dm-collection-list-item{padding:1rem 0;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08))}.dm-collection-list-item:last-child{border-bottom:none}.dm-collection-list-item strong{display:block;font-size:1rem;margin-bottom:.25rem}.dm-collection-list-item p{margin:0;color:var(--text-muted, #888);font-size:.9rem}.dm-collection-empty p{color:var(--text-muted, #888);font-style:italic}.hero-gradient-purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#1e1b4b}.hero-gradient-blue{background:linear-gradient(135deg,#dbeafe,#bfdbfe);color:#1e3a5f}.hero-gradient-green{background:linear-gradient(135deg,#d1fae5,#a7f3d0);color:#064e3b}.hero-gradient-sunset{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#78350f}.hero-gradient-ocean{background:linear-gradient(135deg,#e0f2fe,#bae6fd);color:#0c4a6e}.hero-gradient-rose{background:linear-gradient(135deg,#fce7f3,#fbcfe8);color:#831843}.hero-gradient-forest{background:linear-gradient(135deg,#dcfce7,#bbf7d0);color:#14532d}.hero-gradient-night{background:linear-gradient(135deg,#334155,#1e293b);color:#e2e8f0}.hero-gradient-ocean-light{background:linear-gradient(135deg,#e0f2fe,#caf0f8);color:#1e293b}.hero-gradient-ocean-dark{background:linear-gradient(135deg,#0c4a6e,#164e63);color:#e2e8f0}.hero-gradient-forest-light{background:linear-gradient(135deg,#d1fae5,#c6f6dc);color:#1e293b}.hero-gradient-forest-dark{background:linear-gradient(135deg,#1a4731,#166534);color:#e2e8f0}.hero-gradient-sunset-light{background:linear-gradient(135deg,#fde8d8,#fddcc9);color:#1e293b}.hero-gradient-sunset-dark{background:linear-gradient(135deg,#6b3727,#7c4036);color:#f5ede8}.hero-gradient-royal-light{background:linear-gradient(135deg,#e8f0fd,#dce8fc);color:#1e293b}.hero-gradient-royal-dark{background:linear-gradient(135deg,#1e3465,#263d7a);color:#e2e8f0}.hero-gradient-lemon-light{background:linear-gradient(135deg,#fefce8,#fef9c3);color:#1e293b}.hero-gradient-lemon-dark{background:linear-gradient(135deg,#5c4d1a,#6b5920);color:#fefce8}.hero-gradient-silver-light{background:linear-gradient(135deg,#f1f5f9,#e2e8f0);color:#1e293b}.hero-gradient-silver-dark{background:linear-gradient(135deg,#2d3748,#374151);color:#e2e8f0}.hero-gradient-charcoal-light{background:linear-gradient(135deg,#eceff1,#e1e7eb);color:#1e293b}.hero-gradient-charcoal-dark{background:linear-gradient(135deg,#2c3843,#374451);color:#e2e8f0}.hero-gradient-christmas-light{background:linear-gradient(135deg,#fde8ea,#fdd5d8);color:#1e293b}.hero-gradient-christmas-dark{background:linear-gradient(135deg,#5c0f1d,#7a1525);color:#fde8ea}.hero-gradient-unicorn-light{background:linear-gradient(135deg,#f5e8fd,#edd6fb);color:#1e293b}.hero-gradient-unicorn-dark{background:linear-gradient(135deg,#3d1a5a,#4a2068);color:#f5e8fd}.hero-gradient-dreamy-light{background:linear-gradient(135deg,#f5ede8,#eeddd4);color:#1e293b}.hero-gradient-dreamy-dark{background:linear-gradient(135deg,#3d2820,#503328);color:#f5ede8}.hero-gradient-grayve-light{background:linear-gradient(135deg,#e0f7f9,#cbf2f5);color:#1e293b}.hero-gradient-grayve-dark{background:linear-gradient(135deg,#00363d,#00444d);color:#e0f7f9}.hero-gradient-mint-light{background:linear-gradient(135deg,#d8f5ea,#c5efdd);color:#1e293b}.hero-gradient-mint-dark{background:linear-gradient(135deg,#134d33,#195f3f);color:#d8f5ea}.hero-gradient-wedding-light{background:linear-gradient(135deg,#faf3e0,#f5e9c7);color:#1e293b}.hero-gradient-wedding-dark{background:linear-gradient(135deg,#5c4418,#6f5320);color:#faf3e0}
|
|
1
|
+
body,button,input,select,textarea{font-family:Roboto,sans-serif}.site-main{min-height:calc(100vh - 60px);padding-top:2rem;padding-bottom:4rem}.site-main.with-sidebar{display:grid;grid-template-columns:260px 1fr;gap:0}.site-sidebar{min-height:100%;border-right:1px solid var(--border-color, rgba(255,255,255,.08))}.site-content{overflow:hidden}.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}.container{max-width:860px;margin:0 auto;padding:0 1.5rem}.page-title{font-size:2rem;font-weight:700;margin-bottom:1.5rem;line-height:1.2}.page-body{line-height:1.7;font-size:1rem}.page-body h1,.page-body h2,.page-body h3,.page-body h4{margin-top:2rem;margin-bottom:.75rem;font-weight:600}.page-body h2{font-size:1.5rem}.page-body h3{font-size:1.25rem}.page-body p{margin-bottom:1rem}.page-body ul,.page-body ol{margin-bottom:1rem;padding-left:1.5rem}.page-body a{color:var(--primary, #5b8cff)}.page-body a:hover{text-decoration:underline}.page-body code{font-family:Fira Code,Courier New,monospace;font-size:.9em;background:#ffffff0f;padding:.15em .35em;border-radius:3px}.page-body pre{background:#0000004d;border:1px solid rgba(255,255,255,.08);border-radius:6px;padding:1rem;overflow-x:auto;margin-bottom:1rem}.page-body pre code{background:none;padding:0}.page-body img{max-width:100%;border-radius:6px}.page-body blockquote{border-left:3px solid var(--primary, #5b8cff);margin:1.5rem 0;padding:.75rem 1rem;background:#5b8cff0f;border-radius:0 6px 6px 0}h3.accordion-header{margin:0}.accordion-button{all:unset;display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer;font:inherit}.page-body .card-header h2{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.card[data-collapsible] .card-header{cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between}.card[data-collapsible] .card-header:after{content:"\25be";font-size:1.1em;line-height:1;display:inline-block;transition:transform .25s ease;flex-shrink:0}.card[data-collapsible].is-collapsed .card-header:after{transform:rotate(-90deg)}.card[data-collapsible] .card-body{overflow:hidden;max-height:4000px;opacity:1;transition:max-height .3s ease,opacity .25s ease}.card[data-collapsible].is-collapsed .card-body{max-height:0;opacity:0}.navbar-link span[data-icon],.navbar-link svg,.navbar-dropdown-toggle span[data-icon],.navbar-dropdown-toggle svg,.navbar-dropdown-item span[data-icon],.navbar-dropdown-item svg{width:13px!important;height:13px!important;margin-right:10px!important}.navbar-dropdown-toggle{font-size:var(--dm-font-size-base)}@media(min-width:993px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-sm)}}@media(min-width:1201px){.navbar-dropdown-toggle{font-size:var(--dm-font-size-xs)}}.dm-reduced-motion *,.dm-reduced-motion *:before,.dm-reduced-motion *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.page-footer{border-top:1px solid var(--border-color, rgba(255,255,255,.08));padding:1.5rem 0}.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}.footer-inner p{margin:0;color:var(--text-muted, #888);font-size:.875rem}.footer-links{display:flex;gap:1.25rem}.footer-links a{color:var(--text-muted, #888);font-size:.875rem;text-decoration:none}.footer-links a:hover{color:var(--text, #eee)}.footer-social{display:flex;gap:.5rem;align-items:center}.footer-social-link{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;color:var(--text-muted, #888);transition:color .15s}.footer-social-link:hover{color:var(--text, #eee)}.footer-social-link svg{width:1rem;height:1rem}.footer-motion-switch{font-size:.8rem;color:var(--text-muted, #888);white-space:nowrap}.footer-motion-switch .form-switch-label{color:var(--text-muted, #888)}.footer-motion-switch .form-switch-input{width:2rem;height:1.125rem}.footer-motion-switch .form-switch-input:after{width:.875rem;height:.875rem}.footer-motion-switch .form-switch-input:checked:after{transform:translate(.875rem)}.dm-slideover-header{display:flex;align-items:center;justify-content:space-between;padding:.875rem 1.25rem;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08));flex-shrink:0}.dm-slideover-title{margin:0;font-size:1rem;font-weight:600;line-height:1.4}.dm-slideover-body{padding:1.25rem;overflow-y:auto;flex:1}@media(max-width:768px){.site-main.with-sidebar{grid-template-columns:1fr}.site-sidebar{display:none}}.dm-spacer{display:block;width:100%}.hero-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.site-main:has(.page-body>.hero-breakout:first-child){padding-top:0}body[data-layout=landing]>.site-main{padding-top:0}body[data-layout=landing]>.site-main .container{max-width:none;padding:0}body[data-layout=landing] .page-body{padding-left:1.5rem;padding-right:1.5rem}body[data-layout=landing] .page-body>p,body[data-layout=landing] .page-body>h1,body[data-layout=landing] .page-body>h2,body[data-layout=landing] .page-body>h3,body[data-layout=landing] .page-body>ul,body[data-layout=landing] .page-body>ol,body[data-layout=landing] .page-body>blockquote{max-width:860px;margin-left:auto;margin-right:auto}body[data-layout=landing] .page-body .hero-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem}body[data-layout=landing] .page-body .grid-breakout{width:calc(100% + 3rem);margin-left:-1.5rem;margin-right:-1.5rem;padding-left:1.5rem;padding-right:1.5rem}.page-body .card{transition:transform .2s ease,box-shadow .2s ease}.page-body .card:hover{transform:translateY(-3px);box-shadow:0 8px 24px #00000059}.page-body .card-header-icon-inline{display:flex;align-items:center;gap:.6rem}.page-body .card-header-icon-inline [data-icon]{flex-shrink:0;line-height:0}.page-body .card-header-icon-inline [data-icon] svg,.page-body .card-header-icon-inline>svg{display:block;width:1.25rem;height:1.25rem}.page-body .card-header-icon-stacked{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.35rem;padding-top:.25rem}.page-body .card-header-icon-stacked [data-icon],.page-body .card-header-icon-stacked svg{width:2rem;height:2rem}.hero.hero-dark{background:linear-gradient(135deg,#1f2937,#111827);color:#e2e8f0}.hero .hero-content{position:relative;z-index:2}.hero.hero-left .hero-content{text-align:left;align-items:flex-start;max-width:62%}@media(max-width:768px){.hero.hero-left .hero-content{max-width:100%}}.hero .hero-cta{display:flex;gap:.85rem;flex-wrap:wrap;margin-top:1.75rem}.hero .hero-cta a{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem 1.35rem;border-radius:6px;font-size:.95rem;font-weight:500;text-decoration:none;transition:background .2s ease,border-color .2s ease,transform .15s ease,box-shadow .2s ease}.hero .hero-cta a:first-child{background:#ffffffeb;color:#111;border:1px solid transparent}.hero .hero-cta a:first-child:hover{background:#fff;box-shadow:0 4px 16px #00000040;transform:translateY(-2px)}.hero .hero-cta a:last-child{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4)}.hero .hero-cta a:last-child:hover{border-color:#ffffffbf;background:#ffffff14;transform:translateY(-2px)}.hero .hero-label{display:inline-block;margin-bottom:.9rem;padding:.2rem .8rem;border-radius:999px;font-size:.72rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:#ffffffb3;border:1px solid rgba(255,255,255,.22)}.grid-breakout{width:calc(100vw - 2rem);margin-left:calc(50% - 50vw + 1rem);margin-right:calc(50% - 50vw + 1rem)}.dm-breadcrumbs{position:fixed;z-index:200;display:inline-flex;align-items:center;gap:.2rem;padding:.3rem .8rem;border-radius:999px;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);background:#00000047;border:1px solid rgba(255,255,255,.11);box-shadow:0 2px 10px #00000038;font-size:.72rem;font-weight:500;letter-spacing:.01em;line-height:1.4;max-width:calc(100vw - 2rem);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dm-breadcrumbs .dm-breadcrumbs-item{color:#ffffffa6}.dm-breadcrumbs .dm-breadcrumbs-link{display:inline-flex;align-items:center;gap:.25rem;color:#ffffff8c;text-decoration:none;transition:color .15s}.dm-breadcrumbs .dm-breadcrumbs-home-icon{flex-shrink:0;vertical-align:middle}.dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#fffffff2}.dm-breadcrumbs .dm-breadcrumbs-current{color:#ffffffeb;font-weight:600}.dm-breadcrumbs .dm-breadcrumbs-separator{color:#ffffff47;font-size:.8em;line-height:1;margin:0 .05rem}[data-mode=light] .dm-breadcrumbs{background:#ffffff8c;border-color:#00000012;box-shadow:0 2px 10px #00000014}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-item,[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link{color:#0000008c}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-link:hover{color:#000000e6}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-current{color:#000000d9}[data-mode=light] .dm-breadcrumbs .dm-breadcrumbs-separator{color:#00000040}.dm-collection-display{margin:1.5rem 0}.dm-collection-list{display:flex;flex-direction:column;gap:0}.dm-collection-list-item{padding:1rem 0;border-bottom:1px solid var(--border-color, rgba(255, 255, 255, .08))}.dm-collection-list-item:last-child{border-bottom:none}.dm-collection-list-item strong{display:block;font-size:1rem;margin-bottom:.25rem}.dm-collection-list-item p{margin:0;color:var(--text-muted, #888);font-size:.9rem}.dm-collection-empty p{color:var(--text-muted, #888);font-style:italic}.hero-gradient-purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);color:#1e1b4b}.hero-gradient-blue{background:linear-gradient(135deg,#dbeafe,#bfdbfe);color:#1e3a5f}.hero-gradient-green{background:linear-gradient(135deg,#d1fae5,#a7f3d0);color:#064e3b}.hero-gradient-sunset{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#78350f}.hero-gradient-ocean{background:linear-gradient(135deg,#e0f2fe,#bae6fd);color:#0c4a6e}.hero-gradient-rose{background:linear-gradient(135deg,#fce7f3,#fbcfe8);color:#831843}.hero-gradient-forest{background:linear-gradient(135deg,#dcfce7,#bbf7d0);color:#14532d}.hero-gradient-night{background:linear-gradient(135deg,#334155,#1e293b);color:#e2e8f0}.hero-gradient-ocean-light{background:linear-gradient(135deg,#e0f2fe,#caf0f8);color:#1e293b}.hero-gradient-ocean-dark{background:linear-gradient(135deg,#0c4a6e,#164e63);color:#e2e8f0}.hero-gradient-forest-light{background:linear-gradient(135deg,#d1fae5,#c6f6dc);color:#1e293b}.hero-gradient-forest-dark{background:linear-gradient(135deg,#1a4731,#166534);color:#e2e8f0}.hero-gradient-sunset-light{background:linear-gradient(135deg,#fde8d8,#fddcc9);color:#1e293b}.hero-gradient-sunset-dark{background:linear-gradient(135deg,#6b3727,#7c4036);color:#f5ede8}.hero-gradient-royal-light{background:linear-gradient(135deg,#e8f0fd,#dce8fc);color:#1e293b}.hero-gradient-royal-dark{background:linear-gradient(135deg,#1e3465,#263d7a);color:#e2e8f0}.hero-gradient-lemon-light{background:linear-gradient(135deg,#fefce8,#fef9c3);color:#1e293b}.hero-gradient-lemon-dark{background:linear-gradient(135deg,#5c4d1a,#6b5920);color:#fefce8}.hero-gradient-silver-light{background:linear-gradient(135deg,#f1f5f9,#e2e8f0);color:#1e293b}.hero-gradient-silver-dark{background:linear-gradient(135deg,#2d3748,#374151);color:#e2e8f0}.hero-gradient-charcoal-light{background:linear-gradient(135deg,#eceff1,#e1e7eb);color:#1e293b}.hero-gradient-charcoal-dark{background:linear-gradient(135deg,#2c3843,#374451);color:#e2e8f0}.hero-gradient-christmas-light{background:linear-gradient(135deg,#fde8ea,#fdd5d8);color:#1e293b}.hero-gradient-christmas-dark{background:linear-gradient(135deg,#5c0f1d,#7a1525);color:#fde8ea}.hero-gradient-unicorn-light{background:linear-gradient(135deg,#f5e8fd,#edd6fb);color:#1e293b}.hero-gradient-unicorn-dark{background:linear-gradient(135deg,#3d1a5a,#4a2068);color:#f5e8fd}.hero-gradient-dreamy-light{background:linear-gradient(135deg,#f5ede8,#eeddd4);color:#1e293b}.hero-gradient-dreamy-dark{background:linear-gradient(135deg,#3d2820,#503328);color:#f5ede8}.hero-gradient-grayve-light{background:linear-gradient(135deg,#e0f7f9,#cbf2f5);color:#1e293b}.hero-gradient-grayve-dark{background:linear-gradient(135deg,#00363d,#00444d);color:#e0f7f9}.hero-gradient-mint-light{background:linear-gradient(135deg,#d8f5ea,#c5efdd);color:#1e293b}.hero-gradient-mint-dark{background:linear-gradient(135deg,#134d33,#195f3f);color:#d8f5ea}.hero-gradient-wedding-light{background:linear-gradient(135deg,#faf3e0,#f5e9c7);color:#1e293b}.hero-gradient-wedding-dark{background:linear-gradient(135deg,#5c4418,#6f5320);color:#faf3e0}.tabs-centered{text-align:center}.tabs-centered .tab-list{display:inline-flex}.tabs-centered .tab-content{text-align:left}
|
|
@@ -89,11 +89,11 @@ export async function pagesRoutes(fastify) {
|
|
|
89
89
|
await renamePage(urlPath, newUrlPath);
|
|
90
90
|
await rewriteNavLinks(urlPath, newUrlPath);
|
|
91
91
|
|
|
92
|
-
const page = await updatePage(newUrlPath, frontmatter || {}, body);
|
|
92
|
+
const page = await updatePage(newUrlPath, frontmatter || {}, body, {author: request.user.username});
|
|
93
93
|
return page;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const page = await updatePage(urlPath, frontmatter || {}, body);
|
|
96
|
+
const page = await updatePage(urlPath, frontmatter || {}, body, {author: request.user.username});
|
|
97
97
|
return page;
|
|
98
98
|
});
|
|
99
99
|
|