domma-cms 1.27.3 → 1.28.1
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/CHANGELOG.md +10 -0
- package/CLAUDE.md +2 -2
- package/admin/js/app.js +4 -4
- package/admin/js/lib/chats-arrange.js +2 -0
- package/admin/js/lib/launchers-arrange.js +2 -0
- package/admin/js/lib/menu-item-help.js +1 -1
- package/admin/js/lib/page-image-hosts.js +2 -2
- package/admin/js/lib/shortcode-form.js +6 -6
- package/admin/js/lib/shortcode-registry.js +1 -1
- package/admin/js/templates/chat-knowledge.html +96 -0
- package/admin/js/templates/chats.html +146 -0
- package/admin/js/templates/docs/usage-chat.html +96 -0
- package/admin/js/templates/docs/usage-launchers.html +83 -0
- package/admin/js/templates/docs/usage-media.html +14 -0
- package/admin/js/templates/docs/usage-navigation.html +3 -0
- package/admin/js/templates/docs/usage-shortcodes.html +8 -0
- package/admin/js/templates/documentation.html +8 -0
- package/admin/js/templates/launchers.html +105 -0
- package/admin/js/views/chat-knowledge.js +60 -0
- package/admin/js/views/chats.js +53 -0
- package/admin/js/views/doc-pages.js +1 -1
- package/admin/js/views/index.js +1 -1
- package/admin/js/views/launchers.js +230 -0
- package/admin/js/views/menu-editor.js +22 -22
- package/admin/js/views/page-editor.js +10 -10
- package/docs/DommaFeatures.md +30 -0
- package/docs/markdown-shortcodes.md +69 -16
- package/package.json +1 -1
- package/public/css/image-zoom.css +1 -0
- package/public/css/launcher-chat.css +1 -0
- package/public/css/launchers.css +1 -0
- package/public/css/site.css +1 -1
- package/public/js/image-zoom.mjs +30 -0
- package/public/js/launcher-chat.mjs +47 -0
- package/public/js/launcher-settings.mjs +2 -0
- package/public/js/launchers.mjs +12 -0
- package/public/js/motion-control.mjs +1 -1
- package/public/js/site.js +1 -1
- package/server/routes/api/chat.js +203 -0
- package/server/routes/api/chats.js +235 -0
- package/server/routes/api/launchers.js +50 -0
- package/server/routes/launcher-public.js +96 -0
- package/server/server.js +33 -0
- package/server/services/adapterRegistry.js +4 -4
- package/server/services/adapters/FileAdapter.js +18 -0
- package/server/services/adapters/MongoAdapter.js +14 -0
- package/server/services/chat/conversation.js +458 -0
- package/server/services/chat/launcher-bridge.js +73 -0
- package/server/services/chat/matcher.js +324 -0
- package/server/services/chat/settings.js +118 -0
- package/server/services/chat/store.js +532 -0
- package/server/services/collectionAccess.js +16 -0
- package/server/services/docs.js +2 -0
- package/server/services/launchers.js +172 -0
- package/server/services/markdown.js +175 -4
- package/server/services/number-fields-migration.js +4 -0
- package/server/services/permissionRegistry.js +12 -0
- package/server/services/presetCollections.js +75 -2
- package/server/services/renderer.js +86 -18
- package/server/services/roles.js +1 -1
- package/server/services/tools.js +1 -0
- package/server/templates/page.html +4 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<!-- No heading: the banner above is the title. Bound with M.applyBindings - see admin/js/views/chat-knowledge.js. -->
|
|
2
|
+
<div class="ck-tool">
|
|
3
|
+
<div class="tool-load-error" role="alert" data-bind-hidden="!loadError.value">
|
|
4
|
+
<span data-bind-text="loadError.value"></span>
|
|
5
|
+
<button type="button" class="btn btn-sm btn-ghost" data-on-click="retry">Retry</button>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<section class="ck-try">
|
|
9
|
+
<form class="ck-try-row" data-on-submit="tryIt">
|
|
10
|
+
<label class="form-label" for="ck-try-input" style="margin:0">Try the bot
|
|
11
|
+
<span data-help-title="Try the bot"
|
|
12
|
+
data-help="Type a question the way a visitor would. You see what the bot would do - answer, offer choices, or not know - with its scores, without starting a chat or adding to the Unanswered list."></span>
|
|
13
|
+
</label>
|
|
14
|
+
<input id="ck-try-input" type="text" class="form-input" placeholder="e.g. are you open on sundays?" maxlength="300" data-model="tryText.value">
|
|
15
|
+
<button type="submit" class="btn btn-sm btn-outline" data-bind-disabled="!tryText.value">Ask</button>
|
|
16
|
+
</form>
|
|
17
|
+
<p class="ck-try-out" data-bind-hidden="!tryOut.value" data-bind-text="tryOut.value"></p>
|
|
18
|
+
</section>
|
|
19
|
+
|
|
20
|
+
<div class="ck-bar">
|
|
21
|
+
<div class="ck-seg" role="group" aria-label="Show">
|
|
22
|
+
<button type="button" class="btn btn-sm btn-ghost" data-bind-class="tab.value === 'knowledge' && 'is-active'" data-on-click="showKnowledge">
|
|
23
|
+
Knowledge <span class="ck-n" data-bind-text="knowledgeCount.value"></span></button>
|
|
24
|
+
<button type="button" class="btn btn-sm btn-ghost" data-bind-class="tab.value === 'unanswered' && 'is-active'" data-on-click="showUnanswered">
|
|
25
|
+
Unanswered <span class="ck-n" data-bind-text="unansweredCount.value"></span></button>
|
|
26
|
+
</div>
|
|
27
|
+
<label class="ck-search">
|
|
28
|
+
<span data-icon="search" data-icon-size="14"></span>
|
|
29
|
+
<input type="search" class="form-input" placeholder="Search…" aria-label="Search" data-model="query.value">
|
|
30
|
+
</label>
|
|
31
|
+
<select class="form-input ck-sort" aria-label="Sort" data-model="sort.value" data-bind-hidden="tab.value !== 'knowledge'">
|
|
32
|
+
<option value="question">A to Z</option>
|
|
33
|
+
<option value="hits">Most used</option>
|
|
34
|
+
<option value="recent">Recently changed</option>
|
|
35
|
+
</select>
|
|
36
|
+
<span data-help-title="Knowledge"
|
|
37
|
+
data-help="Each entry is a question, other ways people ask it, a few keywords and the answer. The bot matches a visitor's words against the question and the other ways of asking, so add the phrasings people really use - the Unanswered list shows you those. Right-click an entry (or its ⋮) to edit, switch it off or delete it."></span>
|
|
38
|
+
<div class="ck-bar-end">
|
|
39
|
+
<a class="btn btn-sm btn-ghost" href="#/launchers/chats"><span data-icon="message-circle" data-icon-size="14"></span> Chats</a>
|
|
40
|
+
<button type="button" class="btn btn-sm btn-primary" data-bind-hidden="!canManage" data-on-click="create" title="New entry (N)">
|
|
41
|
+
<span data-icon="plus" data-icon-size="14"></span> New entry
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<p class="ck-note" data-bind-hidden="!sampleNote.value">
|
|
47
|
+
<span data-bind-text="sampleNote.value"></span>
|
|
48
|
+
<button type="button" class="btn btn-xs btn-ghost" data-bind-hidden="!canManage" data-on-click="removeExamples">Remove the examples</button>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<div class="ck-loading dm-loading-slot" data-bind-hidden="!loading.value">Loading…</div>
|
|
52
|
+
<p class="ck-empty" data-bind-hidden="!emptyText.value" data-bind-text="emptyText.value"></p>
|
|
53
|
+
|
|
54
|
+
<!-- Templates inserted by chat-knowledge.js (ENTRY, QUESTION). -->
|
|
55
|
+
<div class="ck-list" data-bind-hidden="tab.value !== 'knowledge'"><div class="ck-items" data-each="entries.value key=id"></div></div>
|
|
56
|
+
<div class="ck-unanswered" data-bind-hidden="tab.value !== 'unanswered'"><div class="ck-qs" data-each="questions.value key=id"></div></div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<style>
|
|
60
|
+
.ck-tool { display: flex; flex-direction: column; gap: .75rem; }
|
|
61
|
+
.ck-tool [hidden] { display: none !important; }
|
|
62
|
+
.ck-try { border: 1px solid var(--dm-border); border-radius: var(--dm-radius-lg, 10px); background: var(--dm-surface); padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
|
|
63
|
+
.ck-try-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
|
64
|
+
.ck-try-row .form-input { flex: 1 1 240px; height: 2rem; }
|
|
65
|
+
.ck-try-out { margin: 0; font-size: var(--dm-text-sm); }
|
|
66
|
+
.ck-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
|
67
|
+
.ck-seg { display: inline-flex; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); overflow: hidden; }
|
|
68
|
+
.ck-seg .btn { border-radius: 0; color: var(--dm-text-muted); }
|
|
69
|
+
.ck-seg .btn.is-active { background: var(--dm-hover-bg); color: var(--dm-primary); }
|
|
70
|
+
.ck-n { font-size: var(--dm-text-xs); opacity: .8; }
|
|
71
|
+
.ck-search { position: relative; flex: 1 1 180px; max-width: 280px; margin: 0; }
|
|
72
|
+
.ck-search > svg, .ck-search > [data-icon] { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--dm-text-muted); pointer-events: none; }
|
|
73
|
+
.ck-search .form-input { padding-left: 1.9rem; height: 2rem; }
|
|
74
|
+
.ck-sort { width: auto; height: 2rem; padding-top: 0; padding-bottom: 0; }
|
|
75
|
+
.ck-bar-end { display: flex; gap: .5rem; margin-left: auto; }
|
|
76
|
+
.ck-note { margin: 0; padding: .5rem .75rem; border: 1px dashed var(--dm-border); border-radius: var(--dm-radius-md); color: var(--dm-text-muted); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
|
77
|
+
.ck-empty, .ck-loading { margin: 1.5rem 0; text-align: center; color: var(--dm-text-muted); }
|
|
78
|
+
.ck-items, .ck-qs { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
|
|
79
|
+
.ck-card { position: relative; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-lg, 10px); background: var(--dm-surface); padding: .7rem 2rem .7rem .8rem; display: flex; flex-direction: column; gap: .3rem; cursor: pointer; min-width: 0; }
|
|
80
|
+
.ck-card:hover { border-color: var(--dm-primary); }
|
|
81
|
+
.ck-card.is-off { opacity: .6; }
|
|
82
|
+
.ck-q { margin: 0; font-size: var(--dm-text-base, 1rem); font-weight: 600; }
|
|
83
|
+
.ck-a { margin: 0; font-size: var(--dm-text-sm); color: var(--dm-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
84
|
+
.ck-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: var(--dm-text-xs); color: var(--dm-text-muted); }
|
|
85
|
+
.ck-chip { padding: 0 .45rem; border-radius: 999px; border: 1px solid var(--dm-border); }
|
|
86
|
+
.ck-chip--warn { border-color: var(--dm-warning); color: var(--dm-warning); }
|
|
87
|
+
.ck-chip[hidden] { display: none; }
|
|
88
|
+
.ck-kebab { position: absolute; right: .3rem; top: .45rem; border: 0; background: none; color: var(--dm-text-muted); cursor: pointer; padding: .1rem .35rem; }
|
|
89
|
+
.ck-q-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
|
|
90
|
+
.ck-links { display: flex; flex-direction: column; gap: .4rem; }
|
|
91
|
+
.ck-link-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: .4rem; }
|
|
92
|
+
.ck-panel { display: flex; flex-direction: column; gap: .9rem; }
|
|
93
|
+
.ck-panel textarea { resize: vertical; }
|
|
94
|
+
.ck-panel-actions { display: flex; gap: .5rem; align-items: center; }
|
|
95
|
+
.ck-panel-actions .spacer { flex: 1; }
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<!-- No heading: the banner above (admin/js/lib/plugin-chrome.js) is the title.
|
|
2
|
+
Everything that changes is bound (M.applyBindings) - see admin/js/views/chats.js. -->
|
|
3
|
+
<div class="chats-tool">
|
|
4
|
+
<div class="tool-load-error" role="alert" data-bind-hidden="!loadError.value">
|
|
5
|
+
<span data-bind-text="loadError.value"></span>
|
|
6
|
+
<button type="button" class="btn btn-sm btn-ghost" data-on-click="retry">Retry</button>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="chats-bar">
|
|
10
|
+
<label class="chats-search">
|
|
11
|
+
<span data-icon="search" data-icon-size="14"></span>
|
|
12
|
+
<input type="search" class="form-input" placeholder="Search chats…" aria-label="Search chats" data-model="query.value">
|
|
13
|
+
</label>
|
|
14
|
+
<div class="chats-seg" role="group" aria-label="Which chats">
|
|
15
|
+
<button type="button" class="btn btn-sm btn-ghost" data-bind-class="view.value === 'active' && 'is-active'"
|
|
16
|
+
data-bind-aria-pressed="view.value === 'active'" data-on-click="showActive">Active</button>
|
|
17
|
+
<button type="button" class="btn btn-sm btn-ghost" data-bind-class="view.value === 'closed' && 'is-active'"
|
|
18
|
+
data-bind-aria-pressed="view.value === 'closed'" data-on-click="showClosed">Ended</button>
|
|
19
|
+
</div>
|
|
20
|
+
<span class="chats-count" data-bind-text="countText.value"></span>
|
|
21
|
+
<span data-help-title="The inbox"
|
|
22
|
+
data-help="Visitors chat from a chat launcher on your site. The bot answers first from the Knowledge; a chat comes to you when the visitor asks for a person (Waiting), when nobody was available and they left their details (Message left), or when you reply to one yourself. Waiting chats are at the top, the longest wait first. Right-click a chat (or its ⋮) for everything you can do with it."></span>
|
|
23
|
+
|
|
24
|
+
<div class="chats-bar-end">
|
|
25
|
+
<label class="chats-avail" data-bind-hidden="!canReply">
|
|
26
|
+
<input type="checkbox" class="form-switch" data-model="available.value">
|
|
27
|
+
<span data-bind-text="availText.value"></span>
|
|
28
|
+
</label>
|
|
29
|
+
<span data-help-title="Available for chats"
|
|
30
|
+
data-help="While this is on and this screen is open, visitors who ask for a person are put through to you. Leave the screen (or switch this off) and, once nobody else is available, the bot asks visitors for their name and email instead, so nobody is left waiting."></span>
|
|
31
|
+
<a class="btn btn-sm btn-outline" href="#/launchers/knowledge" title="What the bot knows">
|
|
32
|
+
<span data-icon="book-open" data-icon-size="14"></span> Knowledge
|
|
33
|
+
</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<p class="chats-note" data-bind-hidden="!noLauncherNote.value" data-bind-text="noLauncherNote.value"></p>
|
|
38
|
+
|
|
39
|
+
<div class="chats-body" data-bind-class="openId.value && 'has-open'">
|
|
40
|
+
<div class="chats-list-wrap">
|
|
41
|
+
<div class="chats-loading dm-loading-slot" data-bind-hidden="!loading.value">Loading chats…</div>
|
|
42
|
+
<p class="chats-empty" data-bind-hidden="!isEmpty.value" data-bind-text="emptyText.value"></p>
|
|
43
|
+
<!-- Row template inserted by chats.js (ROW): the router's _.render would eat its {{…}}. -->
|
|
44
|
+
<div class="chats-list" data-each="rows.value key=id"></div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<section class="chats-thread" aria-label="Conversation">
|
|
48
|
+
<p class="chats-pick" data-bind-hidden="openId.value">Pick a chat to read it.</p>
|
|
49
|
+
<div class="chats-thread-inner" data-bind-hidden="!openId.value">
|
|
50
|
+
<header class="chats-head">
|
|
51
|
+
<button type="button" class="btn btn-sm btn-ghost chats-back" data-on-click="back" aria-label="Back to the list">
|
|
52
|
+
<span data-icon="arrow-left" data-icon-size="14"></span>
|
|
53
|
+
</button>
|
|
54
|
+
<div class="chats-who">
|
|
55
|
+
<strong data-bind-text="head.value.who"></strong>
|
|
56
|
+
<span class="chat-chip" data-bind-class="head.value.chipClass" data-bind-text="head.value.chip"></span>
|
|
57
|
+
<div class="chats-who-meta">
|
|
58
|
+
<a data-bind-href="head.value.mailto" data-bind-hidden="!head.value.email" data-bind-text="head.value.email"></a>
|
|
59
|
+
<span data-bind-text="head.value.meta"></span>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<button type="button" class="btn btn-sm btn-ghost chats-head-kebab" aria-label="Chat actions" title="Actions">⋮</button>
|
|
63
|
+
</header>
|
|
64
|
+
<div class="chats-messages" role="log" aria-live="polite" tabindex="0">
|
|
65
|
+
<!-- Message template inserted by chats.js (MESSAGE). -->
|
|
66
|
+
<div class="chats-msgs" data-each="thread.value key=key"></div>
|
|
67
|
+
</div>
|
|
68
|
+
<form class="chats-reply" data-on-submit="sendReply" data-bind-hidden="!canReply">
|
|
69
|
+
<textarea class="form-input" rows="2" maxlength="1000" aria-label="Your reply"
|
|
70
|
+
data-bind-placeholder="replyHint.value" data-model="reply.value"
|
|
71
|
+
data-bind-disabled="!canWrite.value"></textarea>
|
|
72
|
+
<button type="submit" class="btn btn-sm btn-primary" data-bind-disabled="!canSend.value">
|
|
73
|
+
<span data-icon="send" data-icon-size="13"></span> Send
|
|
74
|
+
</button>
|
|
75
|
+
</form>
|
|
76
|
+
</div>
|
|
77
|
+
</section>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
.view-container:has(.chats-tool) { max-width: none; }
|
|
83
|
+
.chats-tool { display: flex; flex-direction: column; gap: .75rem; }
|
|
84
|
+
.chats-tool [hidden] { display: none !important; }
|
|
85
|
+
.chats-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
|
86
|
+
.chats-search { position: relative; flex: 1 1 200px; max-width: 300px; margin: 0; }
|
|
87
|
+
.chats-search > svg, .chats-search > [data-icon] { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--dm-text-muted); pointer-events: none; }
|
|
88
|
+
.chats-search .form-input { padding-left: 1.9rem; height: 2rem; }
|
|
89
|
+
.chats-seg { display: inline-flex; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); overflow: hidden; }
|
|
90
|
+
.chats-seg .btn { border-radius: 0; color: var(--dm-text-muted); }
|
|
91
|
+
.chats-seg .btn.is-active { background: var(--dm-hover-bg); color: var(--dm-primary); }
|
|
92
|
+
.chats-count { font-size: var(--dm-text-xs); color: var(--dm-text-muted); white-space: nowrap; }
|
|
93
|
+
.chats-bar-end { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex-wrap: wrap; }
|
|
94
|
+
.chats-avail { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: var(--dm-text-sm); }
|
|
95
|
+
.chats-note { margin: 0; padding: .6rem .8rem; border: 1px dashed var(--dm-border); border-radius: var(--dm-radius-md); color: var(--dm-text-muted); }
|
|
96
|
+
|
|
97
|
+
.chats-body { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: .75rem; min-height: 60vh; }
|
|
98
|
+
.chats-list-wrap { border: 1px solid var(--dm-border); border-radius: var(--dm-radius-lg, 10px); background: var(--dm-surface); overflow: auto; max-height: 75vh; }
|
|
99
|
+
.chats-list { display: flex; flex-direction: column; }
|
|
100
|
+
.chats-empty, .chats-loading, .chats-pick { margin: 1.5rem 1rem; text-align: center; color: var(--dm-text-muted); }
|
|
101
|
+
.chat-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; padding: .6rem 2rem .6rem .75rem;
|
|
102
|
+
border-bottom: 1px solid var(--dm-border); cursor: pointer; outline-offset: -2px; }
|
|
103
|
+
.chat-row:hover { background: var(--dm-hover-bg); }
|
|
104
|
+
.chat-row.is-open { background: color-mix(in srgb, var(--dm-primary) 10%, transparent); }
|
|
105
|
+
.chat-row-who { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
106
|
+
.chat-row-line { grid-column: 1 / -1; font-size: var(--dm-text-sm); color: var(--dm-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
107
|
+
.chat-row-meta { grid-column: 1 / -1; font-size: var(--dm-text-xs); color: var(--dm-text-muted); }
|
|
108
|
+
.chat-row-unread { position: absolute; right: .6rem; bottom: .6rem; min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px;
|
|
109
|
+
background: var(--dm-primary); color: var(--dm-primary-text, #fff); font-size: var(--dm-text-xs); text-align: center; }
|
|
110
|
+
.chat-row-unread:empty { display: none; }
|
|
111
|
+
.chat-row-kebab { position: absolute; right: .25rem; top: .4rem; border: 0; background: none; color: var(--dm-text-muted); cursor: pointer; padding: .1rem .35rem; }
|
|
112
|
+
|
|
113
|
+
.chat-chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: var(--dm-text-xs); border: 1px solid var(--dm-border); color: var(--dm-text-muted); white-space: nowrap; }
|
|
114
|
+
.chat-chip--ok { border-color: var(--dm-success); color: var(--dm-success); }
|
|
115
|
+
.chat-chip--warn { border-color: var(--dm-warning); color: var(--dm-warning); }
|
|
116
|
+
.chat-chip--danger { border-color: var(--dm-danger); color: var(--dm-danger); }
|
|
117
|
+
|
|
118
|
+
.chats-thread { border: 1px solid var(--dm-border); border-radius: var(--dm-radius-lg, 10px); background: var(--dm-surface); display: flex; flex-direction: column; min-width: 0; }
|
|
119
|
+
.chats-thread-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
|
|
120
|
+
.chats-head { display: flex; align-items: flex-start; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--dm-border); }
|
|
121
|
+
.chats-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
|
|
122
|
+
.chats-who-meta { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .75rem; font-size: var(--dm-text-sm); color: var(--dm-text-muted); }
|
|
123
|
+
.chats-back { display: none; }
|
|
124
|
+
.chats-messages { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .6rem; max-height: 60vh; min-height: 240px; }
|
|
125
|
+
.chats-msgs { display: flex; flex-direction: column; gap: .6rem; }
|
|
126
|
+
.chat-msg { max-width: 80%; display: flex; flex-direction: column; gap: .15rem; }
|
|
127
|
+
.chat-msg-who { font-size: var(--dm-text-xs); color: var(--dm-text-muted); }
|
|
128
|
+
.chat-msg-text { padding: .45rem .7rem; border-radius: 12px; background: var(--dm-hover-bg); border: 1px solid var(--dm-border); white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
129
|
+
.chat-msg-note { font-size: var(--dm-text-xs); color: var(--dm-text-muted); }
|
|
130
|
+
.chat-msg-note:empty { display: none; }
|
|
131
|
+
.chat-msg--staff { align-self: flex-end; align-items: flex-end; }
|
|
132
|
+
.chat-msg--staff .chat-msg-text { background: var(--dm-primary); border-color: var(--dm-primary); color: var(--dm-primary-text, #fff); }
|
|
133
|
+
.chat-msg--bot .chat-msg-text { border-style: dashed; }
|
|
134
|
+
.chat-msg--system { align-self: center; align-items: center; max-width: 95%; }
|
|
135
|
+
.chat-msg--system .chat-msg-text { background: none; border: 0; font-size: var(--dm-text-sm); color: var(--dm-text-muted); padding: 0; text-align: center; }
|
|
136
|
+
.chat-msg--system .chat-msg-who { display: none; }
|
|
137
|
+
.chats-reply { display: flex; gap: .5rem; align-items: flex-end; padding: .6rem .75rem; border-top: 1px solid var(--dm-border); }
|
|
138
|
+
.chats-reply textarea { flex: 1; resize: vertical; min-height: 2.5rem; }
|
|
139
|
+
|
|
140
|
+
@media (max-width: 760px) {
|
|
141
|
+
.chats-body { grid-template-columns: 1fr; }
|
|
142
|
+
.chats-body.has-open .chats-list-wrap { display: none; }
|
|
143
|
+
.chats-body:not(.has-open) .chats-thread { display: none; }
|
|
144
|
+
.chats-back { display: inline-flex; }
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<div class="view-header">
|
|
2
|
+
<h1><span data-icon="book"></span> Chat & Knowledge</h1>
|
|
3
|
+
<a href="#/documentation" class="btn btn-ghost btn-sm"><span data-icon="arrow-left"></span> All usage topics</a>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-12">
|
|
8
|
+
<div class="docs-body">
|
|
9
|
+
|
|
10
|
+
<p>A <strong>chat launcher</strong> puts a chat on your site: visitors tap the disc and talk to you in a small panel.
|
|
11
|
+
A <strong>bot</strong> answers first, straight away, from what you have taught it in the <strong>Knowledge</strong>.
|
|
12
|
+
When it cannot help, or the visitor asks for a person, the chat comes to you in <strong>Content > Chats</strong>.
|
|
13
|
+
When nobody is available, the visitor leaves their name and email instead, so nobody is left waiting. There is no
|
|
14
|
+
AI here: the bot only ever says what you wrote.</p>
|
|
15
|
+
|
|
16
|
+
<h3>Setting it up</h3>
|
|
17
|
+
<ol>
|
|
18
|
+
<li>In <strong>Launchers</strong>, add a launcher and choose the <strong>Chat</strong> action. Its chat settings
|
|
19
|
+
are the greeting, the bot's name, whether the bot answers (off: every message goes to a person), whether
|
|
20
|
+
visitors can ask for a person, and when to ask for a name and email: <strong>when nobody is available</strong>
|
|
21
|
+
(the usual), <strong>always</strong> before putting them through, or <strong>never</strong>.</li>
|
|
22
|
+
<li>Open <strong>Chats > Knowledge</strong> and replace the four example entries (marked
|
|
23
|
+
<strong>Example</strong>) with your own - or use <strong>Remove the examples</strong>.</li>
|
|
24
|
+
<li>Ask a few questions in <strong>Try the bot</strong> the way a visitor would, and add phrasings until it
|
|
25
|
+
answers them.</li>
|
|
26
|
+
</ol>
|
|
27
|
+
|
|
28
|
+
<h3>The Knowledge</h3>
|
|
29
|
+
<p>Each entry is a <strong>question</strong>, <strong>other ways of asking</strong> it (one per line), a few
|
|
30
|
+
<strong>keywords</strong>, the <strong>answer</strong> and up to five <strong>buttons</strong> under it (a page on
|
|
31
|
+
your site such as <code>/contact</code>, a web address, <code>mailto:</code> or <code>tel:</code>). Answers can use
|
|
32
|
+
Markdown: <strong>bold</strong>, <em>italic</em>, lists and links.</p>
|
|
33
|
+
<p>How the bot matches: it ignores small words (the, is, your), meets plurals and tenses at one root (bookings,
|
|
34
|
+
booked, booking), treats common words as the same (cost, price, fee, charge; open, hours, close; delivery,
|
|
35
|
+
shipping, postage; and so on), forgives a one-letter typo in longer words, and gives rarer words more weight.
|
|
36
|
+
Then:</p>
|
|
37
|
+
<ul>
|
|
38
|
+
<li><strong>One clear match</strong> - it answers.</li>
|
|
39
|
+
<li><strong>A few close ones</strong> - "Did you mean...?" with up to three choices and <em>None of these</em>.</li>
|
|
40
|
+
<li><strong>Nothing close</strong> - it says it does not know yet, offers a person, and puts the question on the
|
|
41
|
+
<strong>Unanswered</strong> list. After two misses in a row it offers a person again.</li>
|
|
42
|
+
</ul>
|
|
43
|
+
<p>It also understands "can I talk to a person", "real human", "customer service" and similar (it hands over),
|
|
44
|
+
"hello" and "thanks". How sure it must be before answering is in the Chats settings cog:
|
|
45
|
+
<strong>Strict</strong>, <strong>Balanced</strong> (the default) or <strong>Relaxed</strong>.</p>
|
|
46
|
+
<p><strong>Unanswered</strong> lists what visitors asked that the bot could not answer, with how often. Click one to
|
|
47
|
+
<strong>Make an entry</strong> from it, or right-click to add it to the closest entry as another way of asking,
|
|
48
|
+
to dismiss it or to delete it. This is the quickest way to teach the bot.</p>
|
|
49
|
+
<p>Switch an entry off (right-click it) to stop the bot using it without losing it. The <strong>answered N
|
|
50
|
+
times</strong> count shows which entries earn their keep.</p>
|
|
51
|
+
|
|
52
|
+
<h3>Answering visitors: Chats</h3>
|
|
53
|
+
<p><strong>Content > Chats</strong> is the inbox. Its sidebar badge counts the chats that need you: a visitor
|
|
54
|
+
<strong>Waiting</strong> for a person (a live dot; red after five minutes), a <strong>Message left</strong> when
|
|
55
|
+
nobody was available, and chats with new messages since your reply. Waiting chats are listed first, the longest
|
|
56
|
+
wait at the top.</p>
|
|
57
|
+
<ul>
|
|
58
|
+
<li><strong>Available for chats</strong> - on while this screen is open. That is what tells the bot someone can
|
|
59
|
+
take a chat. Leave the screen or switch it off and, when nobody else is available, visitors are asked for
|
|
60
|
+
their details instead. You get a notification when a visitor asks for a person or leaves a message.</li>
|
|
61
|
+
<li>Click a chat to read it; type a reply and press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> (or Send). Once you reply,
|
|
62
|
+
the bot stays quiet in that chat. You can also reply to a chat the bot is handling.</li>
|
|
63
|
+
<li>Right-click a chat (or its ⋮) to <strong>email the visitor</strong>, copy their address, open the page they
|
|
64
|
+
were on, <strong>end the chat</strong> (they see that it ended) or <strong>delete</strong> it.</li>
|
|
65
|
+
<li>What you type is kept as a draft for each chat until you send it.</li>
|
|
66
|
+
</ul>
|
|
67
|
+
<p>The settings cog sets how visitors see your name (first name, full name or "The team"), how sure the bot must be,
|
|
68
|
+
how long ended chats are kept (90 days to begin with), and how many new chats the whole site takes in an hour
|
|
69
|
+
(300 to begin with; each visitor can start at most 6 an hour and send 120 messages).</p>
|
|
70
|
+
|
|
71
|
+
<h3>What visitors see</h3>
|
|
72
|
+
<p>The greeting, then the conversation. Their chat carries on across pages and reloads in the same browser for a
|
|
73
|
+
day (two weeks after they leave a message). They can tap <strong>Talk to a person</strong> (or
|
|
74
|
+
<strong>Leave a message</strong> where nobody chats live) at any time, and <strong>End chat</strong>. Nothing moves
|
|
75
|
+
for a visitor who asked the site to keep still.</p>
|
|
76
|
+
|
|
77
|
+
<h3>Tidy-up and privacy</h3>
|
|
78
|
+
<ul>
|
|
79
|
+
<li>Every hour: chats with the bot quiet for two hours end; waiting and open chats quiet for a day end; ended
|
|
80
|
+
chats older than the keep setting are deleted with their messages - chats that only ever talked to the bot and left
|
|
81
|
+
no details go after a week. A message left for the team is kept until
|
|
82
|
+
someone ends it.</li>
|
|
83
|
+
<li>A visitor's chat is theirs by a random key kept in their browser; the site stores only a fingerprint of it.
|
|
84
|
+
Messages are plain text, up to 1,000 characters.</li>
|
|
85
|
+
<li>Chats, messages, Knowledge and the Unanswered list are kept in MongoDB where your site has it, in files
|
|
86
|
+
otherwise.</li>
|
|
87
|
+
</ul>
|
|
88
|
+
|
|
89
|
+
<h3>Who can do what</h3>
|
|
90
|
+
<p><strong>System > Roles > Chats</strong>: <strong>View</strong> (see chats, the Knowledge and the Unanswered
|
|
91
|
+
list), <strong>Answer</strong> (reply, end chats, show as available) and <strong>Manage</strong> (edit the
|
|
92
|
+
Knowledge and settings, delete chats). Admin has all three to begin with.</p>
|
|
93
|
+
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<div class="view-header">
|
|
2
|
+
<h1><span data-icon="message-circle"></span> Launchers</h1>
|
|
3
|
+
<a href="#/documentation" class="btn btn-ghost btn-sm"><span data-icon="arrow-left"></span> All usage topics</a>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="row">
|
|
7
|
+
<div class="col-12">
|
|
8
|
+
<div class="docs-body">
|
|
9
|
+
|
|
10
|
+
<p>A launcher is a disc (or a pill with words) pinned to the window of your public site - like the Search and
|
|
11
|
+
Reduce motion discs - that opens something when pressed. Make as many as you like at
|
|
12
|
+
<strong>Content > Launchers</strong>, put each one wherever you want it, and switch any of them on or off.</p>
|
|
13
|
+
|
|
14
|
+
<h3>What a launcher can open</h3>
|
|
15
|
+
<ul>
|
|
16
|
+
<li><strong>A page, a form or a block, in a modal</strong> - a page's own words and components on their own,
|
|
17
|
+
without the navbar or footer, or one of your forms or blocks, in a box over the page. Good for a price list,
|
|
18
|
+
opening hours, a short "How it works" or a quick enquiry form.
|
|
19
|
+
Its width runs from Extra small (320px) to Huge (1400px), nearly the full width, or a custom width in
|
|
20
|
+
pixels or as a share of the window. Its height either fits the page or is fixed (short, medium, tall,
|
|
21
|
+
nearly full or custom), with a longer page scrolling inside. Full screen fills the whole window.</li>
|
|
22
|
+
<li><strong>A page, a form or a block, in a slideover</strong> - a panel from the left or right. Good for an
|
|
23
|
+
enquiry or booking form: visitors fill it in without leaving the page they are on, and it sends exactly as
|
|
24
|
+
it does on a page.</li>
|
|
25
|
+
<li><strong>A chat</strong> - a chat panel beside the disc (the whole screen on a phone). The bot answers
|
|
26
|
+
first from your Knowledge entries, and hands over to your team in the Chats inbox when it has no answer.
|
|
27
|
+
You choose the greeting, the bot's name, whether the bot or your team answer, and when visitors are asked
|
|
28
|
+
for their name and email.</li>
|
|
29
|
+
</ul>
|
|
30
|
+
<p>A page keeps its own rules: a members-only page opens only for members, and a draft never opens. Links in
|
|
31
|
+
the page open in the main window, so a visitor who follows one leaves the panel behind.</p>
|
|
32
|
+
|
|
33
|
+
<h3>Where it sits</h3>
|
|
34
|
+
<p>Pick one of eight spots: a corner, the middle of the left or right edge, or the top or bottom centre. Then set
|
|
35
|
+
how far in from the edges it sits, its size and how round it is. Its tooltip, shown on hover and when a
|
|
36
|
+
visitor tabs to it, is its label, words of its own, or none. The editor shows a desktop and a phone
|
|
37
|
+
preview as you change them.</p>
|
|
38
|
+
<ul>
|
|
39
|
+
<li>Launchers step clear of each other and of the page's other floating controls - Search, Back to top, the
|
|
40
|
+
theme switcher and Reduce motion - so two that share a spot stack neatly instead of overlapping. The one
|
|
41
|
+
higher in the list sits nearer the edge: drag rows by their grip to change the order.</li>
|
|
42
|
+
<li><strong>Its own spot on phones</strong> gives it a different spot, distance and size on screens up to
|
|
43
|
+
640px wide - out of the way of a phone's bottom bar, for instance.</li>
|
|
44
|
+
<li><strong>Shows on</strong> can keep it to desktops or to phones.</li>
|
|
45
|
+
</ul>
|
|
46
|
+
|
|
47
|
+
<h3>Opening it from a menu or a link</h3>
|
|
48
|
+
<p>Any menu or sub-menu item can open a launcher: in <strong>Content > Menus</strong>, edit the item and choose
|
|
49
|
+
the launcher from the <strong>Launcher</strong> list under its URL. The editor's <strong>Link to open it</strong>
|
|
50
|
+
(<code>#launcher-</code> and the launcher's id) works anywhere else too: a button, a link in a page, or the end of
|
|
51
|
+
an address, which opens the launcher as the page loads.</p>
|
|
52
|
+
<p>Turn off <strong>Show a disc on the page</strong> for a launcher that should open only from links. Its page and
|
|
53
|
+
audience rules still apply: on a page where it does not show, its link does nothing.</p>
|
|
54
|
+
|
|
55
|
+
<h3>Which pages, and who sees it</h3>
|
|
56
|
+
<p>A launcher shows on every page, only on the pages you list, or on every page except those. List one address
|
|
57
|
+
per line. <code>*</code> matches anything: <code>/blog/*</code> is the blog and everything under it,
|
|
58
|
+
<code>/shop/*/reviews</code> any product's reviews, <code>/*</code> every page. You can also keep it to
|
|
59
|
+
signed-in people, or to visitors who are not signed in.</p>
|
|
60
|
+
|
|
61
|
+
<h3>How it looks</h3>
|
|
62
|
+
<p>By default a launcher takes the theme's primary colour, so it follows light, dark and custom themes. You can
|
|
63
|
+
pick another theme colour or your own hex colour for the background and for the icon and text, and add your
|
|
64
|
+
own CSS class names to style it from Custom CSS.</p>
|
|
65
|
+
|
|
66
|
+
<h3>The list</h3>
|
|
67
|
+
<p>Click a launcher to edit it, or use its switch to turn it on or off. Right-click it (or ⋮, or Shift+F10) to
|
|
68
|
+
duplicate it, open what it shows in a new tab, or delete it. A copy starts switched off. The sidebar badge
|
|
69
|
+
counts your launchers and calls out any that are switched on but have nothing to open - those stay off the
|
|
70
|
+
page until you choose what they open.</p>
|
|
71
|
+
|
|
72
|
+
<h3>Accessibility</h3>
|
|
73
|
+
<p>Every disc is a real button with the label you gave it, reachable with the keyboard. Escape closes what it
|
|
74
|
+
opened, and focus goes back to the disc. Nothing about a launcher moves for a visitor who has asked for
|
|
75
|
+
reduced motion, and launchers are left out when a page is printed.</p>
|
|
76
|
+
|
|
77
|
+
<h3>Switching the Tool off</h3>
|
|
78
|
+
<p>Launchers is a built-in Tool. Switched off at <strong>System > Plugins</strong>, no page shows a launcher,
|
|
79
|
+
but every launcher you made is kept for when it comes back on.</p>
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
@@ -31,6 +31,20 @@
|
|
|
31
31
|
<img src="/media/my-image.jpg" alt="Alt text"></code></pre>
|
|
32
32
|
<p>Always give pictures alt text - SEO's audit checks for it.</p>
|
|
33
33
|
|
|
34
|
+
<h3>Pictures with options, and click to zoom</h3>
|
|
35
|
+
<p>In the Page Editor, <strong>Insert → Image</strong> picks a picture from Media (or uploads one),
|
|
36
|
+
then opens the Image form: description, caption, width, alignment and <strong>Click to zoom</strong>
|
|
37
|
+
(on by default), with corners, border, shadow, height, a link and more under <em>More options</em>.
|
|
38
|
+
It writes an <code>[image]</code> shortcode; right-click one and choose <strong>Edit Image…</strong>
|
|
39
|
+
to change it later.</p>
|
|
40
|
+
<pre class="code-block"><code>[image src="/media/settings.png" alt="The settings screen" caption="Settings" zoom /]
|
|
41
|
+
[image src="/media/step-1.png" alt="Step 1" width="480" align="center" zoom group="tour" /]</code></pre>
|
|
42
|
+
<p>With zoom on, visitors click the picture (or press Enter on it) to see it full size: it opens fitted to the
|
|
43
|
+
window, and a click, the magnifier button or <kbd>+</kbd> shows actual size - drag to move around, pinch
|
|
44
|
+
on a phone. Pictures with the same <code>group</code> step with the arrows. Use it for screenshots whose
|
|
45
|
+
small text cannot be read on the page. A picture with a <code>link</code> follows the link instead of
|
|
46
|
+
zooming. Every option is listed under Shortcodes.</p>
|
|
47
|
+
|
|
34
48
|
<h3>Upload limits</h3>
|
|
35
49
|
<p>The largest file is set in <code>config/server.json</code> under
|
|
36
50
|
<code>uploads.maxFileSize</code> (bytes). The default is 10 MB. File names are limited to 200
|
|
@@ -136,6 +136,9 @@
|
|
|
136
136
|
<p>Use a site path (<code>/about</code>) for your own pages or a full <code>https://</code> address
|
|
137
137
|
for another site. An item with no link and sub-items is a heading. When you rename a page in
|
|
138
138
|
the page editor, every menu link to it follows it to the new address.</p>
|
|
139
|
+
<p>An item can open a launcher instead (Content > Launchers): choose it from the
|
|
140
|
+
<strong>Launcher</strong> list under the URL, and its modal, slideover or chat opens over the
|
|
141
|
+
page, from a top-level item or a sub-menu item alike.</p>
|
|
139
142
|
|
|
140
143
|
<h3>Who sees an item</h3>
|
|
141
144
|
<p>Each item can be limited to roles, using the same ladder as page visibility: "Member and above",
|
|
@@ -765,6 +765,14 @@ Body content in **Markdown** is supported.
|
|
|
765
765
|
<td><code>[center]...[/center]</code></td>
|
|
766
766
|
<td>Centres its content</td>
|
|
767
767
|
</tr>
|
|
768
|
+
<tr>
|
|
769
|
+
<td><code>[image src="/media/shot.png" alt="..." zoom /]</code></td>
|
|
770
|
+
<td>A picture with a caption, size, alignment, corners, border and shadow. <code>zoom</code> lets
|
|
771
|
+
visitors click it to see it full size (fitted, then actual size with drag to pan);
|
|
772
|
+
<code>group</code> steps between pictures; <code>link</code> makes it a link instead.
|
|
773
|
+
Options: <code>caption title width max-width height fit align radius border shadow loading
|
|
774
|
+
link target zoom zoom-src group class id</code></td>
|
|
775
|
+
</tr>
|
|
768
776
|
<tr>
|
|
769
777
|
<td><code>[embed url="https://youtu.be/..." /]</code></td>
|
|
770
778
|
<td>YouTube, Vimeo, an uploaded video, or a page from a host allowed in
|
|
@@ -70,10 +70,18 @@
|
|
|
70
70
|
<div class="card-body"><h3 style="margin-top:0;"><span data-icon="home"></span> Dashboard</h3>
|
|
71
71
|
<p class="text-muted" style="margin-bottom:0;">The admin's home, and Dashboard Pro: widgets, boards and settings.</p></div>
|
|
72
72
|
</a>
|
|
73
|
+
<a href="#/docs/usage/chat" class="card" style="text-decoration:none;display:block;">
|
|
74
|
+
<div class="card-body"><h3 style="margin-top:0;"><span data-icon="message-circle"></span> Chat & Knowledge</h3>
|
|
75
|
+
<p class="text-muted" style="margin-bottom:0;">Chat launchers: the bot, its Knowledge, and answering visitors in Chats.</p></div>
|
|
76
|
+
</a>
|
|
73
77
|
<a href="#/docs/usage/search-engines" class="card" style="text-decoration:none;display:block;">
|
|
74
78
|
<div class="card-body"><h3 style="margin-top:0;"><span data-icon="search"></span> Search Engines & AI</h3>
|
|
75
79
|
<p class="text-muted" style="margin-bottom:0;">What Google and AI crawlers read on your pages, and how to check.</p></div>
|
|
76
80
|
</a>
|
|
81
|
+
<a href="#/docs/usage/launchers" class="card" style="text-decoration:none;display:block;">
|
|
82
|
+
<div class="card-body"><h3 style="margin-top:0;"><span data-icon="message-circle"></span> Launchers</h3>
|
|
83
|
+
<p class="text-muted" style="margin-bottom:0;">Discs on your pages that open a page, a form or a chat.</p></div>
|
|
84
|
+
</a>
|
|
77
85
|
<a href="#/docs/usage/plugins" class="card" style="text-decoration:none;display:block;">
|
|
78
86
|
<div class="card-body"><h3 style="margin-top:0;"><span data-icon="package"></span> Plugins</h3>
|
|
79
87
|
<p class="text-muted" style="margin-bottom:0;">The Marketplace: install, update, restarts, switches and dependencies.</p></div>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<!-- Launchers. Bound with M.applyBindings - see admin/views/launchers.js, which also inserts the row
|
|
2
|
+
template (the router renders a templateUrl through _.render, eating any {{…}}). No page heading:
|
|
3
|
+
the Tool banner above is the heading, and New launcher is a banner action. -->
|
|
4
|
+
<div class="lnx">
|
|
5
|
+
<p class="lnx-note">Discs pinned to the page - like Search and Reduce motion - that open a page in a modal, a page,
|
|
6
|
+
form or block in a slideover, or a chat. Put as many as you like anywhere on the screen.
|
|
7
|
+
<span data-help-title="Launchers" data-help="Each launcher is one disc (or a pill with words) fixed to a spot on the window: a corner, the middle of an edge, or the top or bottom centre. Pressing it opens what you chose - a page shown on its own in a modal, a page, form or block in a slideover, or a chat. You decide which pages it shows on and who sees it. Discs step clear of each other and of Search, Back to top, the theme switcher and Reduce motion, so they never sit on top of one another."></span></p>
|
|
8
|
+
|
|
9
|
+
<div class="lnx-card">
|
|
10
|
+
<div class="lnx-bar">
|
|
11
|
+
<div class="lnx-seg" role="group" aria-label="Show">
|
|
12
|
+
<button type="button" data-on-click="showAll" data-bind-class="filter.value === 'all' && 'is-on'">All <b data-bind-text="counts.value.all"></b></button>
|
|
13
|
+
<button type="button" data-on-click="showOn" data-bind-class="filter.value === 'on' && 'is-on'">On <b data-bind-text="counts.value.on"></b></button>
|
|
14
|
+
<button type="button" data-on-click="showOff" data-bind-class="filter.value === 'off' && 'is-on'">Off <b data-bind-text="counts.value.off"></b></button>
|
|
15
|
+
</div>
|
|
16
|
+
<input type="search" class="form-input lnx-search" placeholder="Search launchers…" aria-label="Search launchers" data-model="query.value">
|
|
17
|
+
<span data-help-title="The list" data-help="Click a launcher to edit it, or use its switch to turn it on or off. Right-click it (or ⋮, or Shift+F10) to duplicate, preview or delete it. Drag a row by its grip to change the order: where two launchers share a spot, the one higher in the list sits nearer the edge."></span>
|
|
18
|
+
</div>
|
|
19
|
+
<p class="lnx-note is-bad" data-bind-hidden="toolOn.value">Launchers is switched off for this site (System > Plugins), so no page shows them. Your launchers are kept.</p>
|
|
20
|
+
<p class="lnx-note" data-bind-hidden="!loading.value">Loading…</p>
|
|
21
|
+
<p class="lnx-note is-bad" data-bind-hidden="!loadError.value" data-bind-text="loadError.value"></p>
|
|
22
|
+
<p class="lnx-note" data-bind-hidden="loading.value || loadError.value || rows.value.length" data-bind-text="emptyText.value"></p>
|
|
23
|
+
<div class="lnx-list" data-each="rows.value key=id"></div>
|
|
24
|
+
<p class="lnx-note lnx-drag-note" data-bind-hidden="!dragNote.value">Drag reorders only while the list shows everything - clear the search and choose All.</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.lnx { display: flex; flex-direction: column; gap: .75rem; }
|
|
30
|
+
.lnx [hidden] { display: none !important; }
|
|
31
|
+
.lnx-note { margin: 0; color: var(--dm-text-muted); font-size: var(--dm-text-sm); }
|
|
32
|
+
.lnx-note.is-bad { color: var(--dm-danger); }
|
|
33
|
+
.lnx-card { border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); padding: .75rem .9rem; display: flex; flex-direction: column; gap: .6rem; }
|
|
34
|
+
.lnx-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
|
|
35
|
+
.lnx-search { flex: 1; min-width: 10rem; max-width: 22rem; }
|
|
36
|
+
.lnx-seg { display: inline-flex; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); overflow: hidden; }
|
|
37
|
+
.lnx-seg button { border: 0; background: none; color: var(--dm-text); padding: .3rem .7rem; cursor: pointer; font: inherit; font-size: var(--dm-text-sm); }
|
|
38
|
+
.lnx-seg button + button { border-left: 1px solid var(--dm-border); }
|
|
39
|
+
.lnx-seg button b { font-weight: 500; opacity: .65; margin-left: .2rem; }
|
|
40
|
+
.lnx-seg button:hover { background: var(--dm-table-hover-bg, color-mix(in srgb, var(--dm-text) 6%, transparent)); }
|
|
41
|
+
.lnx-seg button.is-on { background: var(--dm-primary); color: var(--dm-primary-text); }
|
|
42
|
+
.lnx-list { display: flex; flex-direction: column; }
|
|
43
|
+
.lnx-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .35rem; border-bottom: 1px solid var(--dm-border); cursor: pointer; background: var(--dm-surface); }
|
|
44
|
+
.lnx-row:last-child { border-bottom: 0; }
|
|
45
|
+
.lnx-row:hover, .lnx-row:focus-visible { background: var(--dm-table-hover-bg, color-mix(in srgb, var(--dm-text) 6%, transparent)); outline: none; }
|
|
46
|
+
.lnx-row.is-off .lnx-main strong { color: var(--dm-text-muted); }
|
|
47
|
+
.lnx-row.is-off .lnx-disc { opacity: .45; }
|
|
48
|
+
.lnx-grip { color: var(--dm-text-muted); cursor: grab; display: inline-flex; padding: 0 .1rem; }
|
|
49
|
+
.lnx-disc { flex-shrink: 0; height: 30px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
|
|
50
|
+
background: var(--lnx-bg); color: var(--lnx-fg); border: 1px solid color-mix(in srgb, var(--lnx-bg) 70%, var(--dm-text)); font-size: var(--dm-text-xs); font-weight: 600; }
|
|
51
|
+
.lnx-disc.is-pill { padding: 0 .6rem 0 .45rem; }
|
|
52
|
+
.lnx-disc svg { width: 15px; height: 15px; }
|
|
53
|
+
.lnx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
54
|
+
.lnx-main strong, .lnx-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
55
|
+
.lnx-main small { color: var(--dm-text-muted); font-size: var(--dm-text-xs); }
|
|
56
|
+
.lnx-chips { display: inline-flex; gap: .3rem; flex-shrink: 0; }
|
|
57
|
+
.lnx-chip { display: inline-flex; align-items: center; font-size: var(--dm-text-xs); font-weight: 600; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap;
|
|
58
|
+
background: color-mix(in srgb, var(--dm-text) 10%, transparent); color: var(--dm-text-muted); }
|
|
59
|
+
.lnx-chip.is-danger { background: color-mix(in srgb, var(--dm-danger) 16%, transparent); color: var(--dm-danger); }
|
|
60
|
+
.lnx-switch { flex-shrink: 0; display: inline-flex; align-items: center; }
|
|
61
|
+
.lnx-kebab { border: 0; background: none; cursor: pointer; font-size: var(--dm-text-lg); color: var(--dm-text-muted); border-radius: var(--dm-radius-sm); padding: 0 .3rem; }
|
|
62
|
+
.lnx-kebab:hover { color: var(--dm-primary); }
|
|
63
|
+
@media (max-width: 640px) { .lnx-main small { white-space: normal; } .lnx-chips { display: none; } }
|
|
64
|
+
|
|
65
|
+
/* ---- The editor (a slideover; the panel lives outside .lnx) ---- */
|
|
66
|
+
.lnx-form { display: flex; flex-direction: column; gap: .9rem; padding-bottom: .5rem; }
|
|
67
|
+
.lnx-form [hidden] { display: none !important; }
|
|
68
|
+
.lnx-section { border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); padding: .75rem .85rem; display: flex; flex-direction: column; gap: .65rem; }
|
|
69
|
+
.lnx-section > h6 { margin: 0; font-size: var(--dm-text-sm); font-weight: 700; display: flex; align-items: center; gap: .35rem; }
|
|
70
|
+
.lnx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
|
|
71
|
+
@media (max-width: 560px) { .lnx-grid2 { grid-template-columns: 1fr; } }
|
|
72
|
+
.lnx-field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
|
|
73
|
+
.lnx-field .form-label { margin: 0; }
|
|
74
|
+
.lnx-inline { display: flex; gap: .35rem; align-items: center; }
|
|
75
|
+
.lnx-inline > .form-input, .lnx-inline > select { flex: 1; min-width: 0; }
|
|
76
|
+
.lnx-icon-btn { padding: .35rem .55rem; background: transparent; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-sm); color: var(--dm-text-muted); cursor: pointer; display: inline-flex; align-items: center; flex-shrink: 0; }
|
|
77
|
+
.lnx-icon-btn:hover { color: var(--dm-primary); border-color: var(--dm-primary); }
|
|
78
|
+
.lnx-err { color: var(--dm-danger); font-size: var(--dm-text-xs); }
|
|
79
|
+
.lnx-warn { color: var(--dm-text-muted); font-size: var(--dm-text-xs); }
|
|
80
|
+
.lnx-check { display: flex; align-items: center; gap: .45rem; font-size: var(--dm-text-sm); }
|
|
81
|
+
.lnx-range { display: flex; align-items: center; gap: .5rem; }
|
|
82
|
+
.lnx-unit { display: flex; gap: .5rem; }
|
|
83
|
+
.lnx-unit input { flex: 1; min-width: 0; }
|
|
84
|
+
.lnx-unit select { flex: 0 0 auto; width: auto; }
|
|
85
|
+
.lnx-range input[type=range] { flex: 1; }
|
|
86
|
+
.lnx-range output { min-width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; font-size: var(--dm-text-sm); color: var(--dm-text-muted); }
|
|
87
|
+
.lnx-corners { display: grid; grid-template-columns: repeat(3, 2.1rem); grid-template-rows: repeat(3, 2.1rem); gap: .25rem; }
|
|
88
|
+
.lnx-corners button { border: 1px solid var(--dm-border); background: var(--dm-surface); border-radius: var(--dm-radius-sm); cursor: pointer; color: var(--dm-text-muted); font-size: var(--dm-text-xs); }
|
|
89
|
+
.lnx-corners button:hover { border-color: var(--dm-primary); color: var(--dm-primary); }
|
|
90
|
+
.lnx-corners button.is-on { background: var(--dm-primary); border-color: var(--dm-primary); color: var(--dm-primary-text); }
|
|
91
|
+
.lnx-corners .lnx-corner-mid { visibility: hidden; }
|
|
92
|
+
.lnx-place { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
|
|
93
|
+
.lnx-preview { position: relative; width: 320px; max-width: 100%; height: 200px; border: 1px solid var(--dm-border); border-radius: var(--dm-radius-md); overflow: hidden;
|
|
94
|
+
background: linear-gradient(var(--dm-background), var(--dm-background)); }
|
|
95
|
+
.lnx-preview.is-phone { width: 120px; height: 220px; }
|
|
96
|
+
.lnx-preview-bar { position: absolute; inset: 0 0 auto 0; height: 14px; background: color-mix(in srgb, var(--dm-text) 10%, transparent); }
|
|
97
|
+
.lnx-preview-disc { position: absolute; display: inline-flex; align-items: center; justify-content: center; gap: .2rem; overflow: hidden;
|
|
98
|
+
background: var(--lnx-bg); color: var(--lnx-fg); border: 1px solid color-mix(in srgb, var(--lnx-bg) 70%, var(--dm-text)); font-size: 10px; font-weight: 600; white-space: nowrap; }
|
|
99
|
+
.lnx-preview-disc svg { width: 55%; height: 55%; max-width: 16px; max-height: 16px; }
|
|
100
|
+
.lnx-previews { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
|
|
101
|
+
.lnx-previews small { display: block; color: var(--dm-text-muted); font-size: var(--dm-text-xs); margin-top: .2rem; }
|
|
102
|
+
.lnx-actions { display: flex; align-items: center; gap: .5rem; position: sticky; bottom: 0; background: var(--dm-surface); padding-top: .6rem; border-top: 1px solid var(--dm-border); }
|
|
103
|
+
.lnx-actions .lnx-spacer { flex: 1; }
|
|
104
|
+
.lnx-hint { color: var(--dm-text-muted); font-size: var(--dm-text-xs); }
|
|
105
|
+
</style>
|