anentrypoint-design 0.0.114 → 0.0.117
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.117",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
/* chatlog (legacy fd-chat-msgs container) */
|
|
37
37
|
.fd-chatlog {
|
|
38
38
|
max-height: 420px; overflow-y: auto;
|
|
39
|
-
background:
|
|
39
|
+
background: var(--panel-2, #DDD3BC);
|
|
40
40
|
border-radius: 4px; padding: 4px; margin-top: 8px;
|
|
41
41
|
}
|
|
42
|
-
.fd-chatlog-msg { padding: 6px 10px;
|
|
43
|
-
.fd-chatlog-assistant { color: var(--
|
|
44
|
-
.fd-chatlog-tool { margin: 4px 0; padding: 4px 8px; background:
|
|
45
|
-
.fd-chatlog-tool-sum { cursor: pointer; color: var(--
|
|
42
|
+
.fd-chatlog-msg { padding: 6px 10px; background: var(--panel-2, #DDD3BC); white-space: pre-wrap; word-break: break-word; }
|
|
43
|
+
.fd-chatlog-assistant { color: var(--panel-accent, #3F8A4A); }
|
|
44
|
+
.fd-chatlog-tool { margin: 4px 0; padding: 4px 8px; background: var(--panel-3, #C9BDA0); border-radius: 4px; font-family: var(--ff-mono, JetBrains Mono, monospace); font-size: 0.85em; }
|
|
45
|
+
.fd-chatlog-tool-sum { cursor: pointer; color: var(--warn, #FF6B4A); padding: 2px 0; }
|
|
46
46
|
.fd-chatlog-tool-body { margin: 4px 0 0; white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; }
|
|
47
47
|
|
|
48
48
|
/* chip wraps (providers, env) */
|
package/src/kits/os/theme.css
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
|
|
2
|
+
|
|
1
3
|
:root {
|
|
4
|
+
--ff-ui: 'Space Grotesk', system-ui, sans-serif;
|
|
5
|
+
--ff-display: 'Space Grotesk', system-ui, sans-serif;
|
|
6
|
+
--ff-mono: 'JetBrains Mono', ui-monospace, monospace;
|
|
2
7
|
--os-accent: var(--panel-accent, #3F8A4A);
|
|
3
8
|
--os-accent-2: var(--panel-accent-2, #2B6B36);
|
|
4
9
|
--os-accent-soft: var(--panel-select, #D8ECCB);
|
|
@@ -18,8 +23,8 @@
|
|
|
18
23
|
--os-bar-h-mobile: 52px;
|
|
19
24
|
--os-rail-w: 64px;
|
|
20
25
|
--os-tap: 44px;
|
|
21
|
-
--os-font: var(--ff-ui, '
|
|
22
|
-
--os-display: var(--ff-display, '
|
|
26
|
+
--os-font: var(--ff-ui, 'Space Grotesk', system-ui, sans-serif);
|
|
27
|
+
--os-display: var(--ff-display, 'Space Grotesk', system-ui, sans-serif);
|
|
23
28
|
--os-mono: var(--ff-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
24
29
|
}
|
|
25
30
|
|
|
@@ -32,7 +37,9 @@ html, body {
|
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
.os-menubar, .os-taskbar {
|
|
35
|
-
background: var(--os-bg-2);
|
|
40
|
+
background: color-mix(in oklab, var(--os-bg-2) 88%, transparent);
|
|
41
|
+
backdrop-filter: blur(10px);
|
|
42
|
+
-webkit-backdrop-filter: blur(10px);
|
|
36
43
|
border: none;
|
|
37
44
|
color: var(--os-fg);
|
|
38
45
|
font: 13px var(--os-font);
|
|
@@ -410,3 +417,34 @@ html, body {
|
|
|
410
417
|
.wm-btns .wm-btn:nth-child(3) { width: 44px !important; height: 44px !important; border-radius: var(--r-1, 6px) !important; background: var(--os-bg-3) !important; color: var(--os-fg) !important; }
|
|
411
418
|
.wm-resize { display: none !important; }
|
|
412
419
|
}
|
|
420
|
+
|
|
421
|
+
/* ---- data-attr theme/density/accent rules (ported from anentrypoint-update colors_and_type.css) ---- */
|
|
422
|
+
:root[data-theme="ink"] {
|
|
423
|
+
--os-bg-0: #14131a;
|
|
424
|
+
--os-bg-1: #1a1924;
|
|
425
|
+
--os-bg-2: #20202a;
|
|
426
|
+
--os-bg-3: #2a2a36;
|
|
427
|
+
--os-fg: #efece4;
|
|
428
|
+
--os-fg-2: #c8c5bc;
|
|
429
|
+
--os-fg-3: #8c8a80;
|
|
430
|
+
color-scheme: dark;
|
|
431
|
+
}
|
|
432
|
+
:root[data-theme="paper"] {
|
|
433
|
+
--os-bg-0: #f6f5f1;
|
|
434
|
+
--os-bg-1: #efece4;
|
|
435
|
+
--os-bg-2: #e7e3d8;
|
|
436
|
+
--os-bg-3: #d8d3c4;
|
|
437
|
+
--os-fg: #14131a;
|
|
438
|
+
--os-fg-2: #3a3833;
|
|
439
|
+
--os-fg-3: #6a6660;
|
|
440
|
+
color-scheme: light;
|
|
441
|
+
}
|
|
442
|
+
:root[data-density="compact"] { --os-bar-h: 28px; --os-tile-pad: 6px; --os-gap: 6px; }
|
|
443
|
+
:root[data-density="comfortable"] { --os-bar-h: 36px; --os-tile-pad: 10px; --os-gap: 10px; }
|
|
444
|
+
:root[data-density="spacious"] { --os-bar-h: 44px; --os-tile-pad: 14px; --os-gap: 14px; }
|
|
445
|
+
:root[data-accent="green"] { --os-accent: #247420; --os-accent-tint: color-mix(in oklab, #247420 18%, transparent); }
|
|
446
|
+
:root[data-accent="purple"] { --os-accent: #7c5cff; --os-accent-tint: color-mix(in oklab, #7c5cff 18%, transparent); }
|
|
447
|
+
:root[data-accent="mascot"] { --os-accent: #ff6d3f; --os-accent-tint: color-mix(in oklab, #ff6d3f 18%, transparent); }
|
|
448
|
+
:root[data-theme="ink"][data-accent="green"] { --os-accent: #3FA93A; }
|
|
449
|
+
:root[data-theme="ink"][data-accent="purple"] { --os-accent: #a085ff; }
|
|
450
|
+
:root[data-theme="ink"][data-accent="mascot"] { --os-accent: #ff8a64; }
|
|
@@ -1,35 +1,106 @@
|
|
|
1
1
|
// <ds-chat> custom element — auto-registers when SDK loads in a browser.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// Attributes / properties:
|
|
3
|
+
// el.messages = [{who,text,time,name,...}, ...]
|
|
4
|
+
// el.placeholder, el.title, el.sub, el.disabled
|
|
5
|
+
// Emits a bubbling, composed 'send' event with { detail: { text } } when the
|
|
6
|
+
// user submits via the built-in composer.
|
|
4
7
|
|
|
5
8
|
import * as webjsx from '../../vendor/webjsx/index.js';
|
|
6
|
-
import { Chat } from '../components/chat.js';
|
|
9
|
+
import { Chat, ChatComposer } from '../components/chat.js';
|
|
7
10
|
|
|
8
11
|
class DsChat extends HTMLElement {
|
|
9
12
|
constructor() {
|
|
10
13
|
super();
|
|
11
14
|
this._messages = [];
|
|
12
15
|
this._placeholder = 'type, then ⏎';
|
|
16
|
+
this._title = 'chat';
|
|
17
|
+
this._sub = '';
|
|
18
|
+
this._composerValue = '';
|
|
19
|
+
this._disabled = false;
|
|
20
|
+
this._scrollPending = false;
|
|
13
21
|
}
|
|
14
|
-
static get observedAttributes() { return ['messages', 'placeholder']; }
|
|
22
|
+
static get observedAttributes() { return ['messages', 'placeholder', 'title', 'sub', 'disabled']; }
|
|
15
23
|
attributeChangedCallback(name, _old, val) {
|
|
16
24
|
if (name === 'messages') {
|
|
17
25
|
try { this._messages = JSON.parse(val); } catch { this._messages = []; }
|
|
26
|
+
this._scrollPending = true;
|
|
18
27
|
} else if (name === 'placeholder') {
|
|
19
28
|
this._placeholder = val || '';
|
|
29
|
+
} else if (name === 'title') {
|
|
30
|
+
this._title = val || 'chat';
|
|
31
|
+
} else if (name === 'sub') {
|
|
32
|
+
this._sub = val || '';
|
|
33
|
+
} else if (name === 'disabled') {
|
|
34
|
+
this._disabled = val != null && val !== 'false';
|
|
20
35
|
}
|
|
21
36
|
this._render();
|
|
22
37
|
}
|
|
23
|
-
set messages(v) { this._messages = Array.isArray(v) ? v : []; this._render(); }
|
|
38
|
+
set messages(v) { this._messages = Array.isArray(v) ? v : []; this._scrollPending = true; this._render(); }
|
|
24
39
|
get messages() { return this._messages; }
|
|
25
40
|
set placeholder(v) { this._placeholder = v || ''; this._render(); }
|
|
26
41
|
get placeholder() { return this._placeholder; }
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
set title(v) { this._title = v || 'chat'; this._render(); }
|
|
43
|
+
get title() { return this._title; }
|
|
44
|
+
set sub(v) { this._sub = v || ''; this._render(); }
|
|
45
|
+
get sub() { return this._sub; }
|
|
46
|
+
set disabled(v) { this._disabled = !!v; this._render(); }
|
|
47
|
+
get disabled() { return this._disabled; }
|
|
48
|
+
connectedCallback() {
|
|
49
|
+
this.classList.add('ds-247420');
|
|
50
|
+
this._render();
|
|
51
|
+
}
|
|
52
|
+
_send(text) {
|
|
53
|
+
this._composerValue = '';
|
|
54
|
+
this.dispatchEvent(new CustomEvent('send', { detail: { text }, bubbles: true, composed: true }));
|
|
55
|
+
this._render();
|
|
56
|
+
}
|
|
29
57
|
_render() {
|
|
30
58
|
if (!this.isConnected) return;
|
|
31
|
-
|
|
59
|
+
// The factory captures `value` at construction time, so the click handler
|
|
60
|
+
// it builds sees a stale empty string. Pass a no-op and own send wiring
|
|
61
|
+
// ourselves by reading the live textarea below.
|
|
62
|
+
const self = this;
|
|
63
|
+
const composer = ChatComposer({
|
|
64
|
+
value: this._composerValue,
|
|
65
|
+
placeholder: this._placeholder,
|
|
66
|
+
disabled: this._disabled,
|
|
67
|
+
onInput: (v) => { self._composerValue = v; self._syncSendButton(); },
|
|
68
|
+
onSend: () => { /* superseded by live read below */ },
|
|
69
|
+
});
|
|
70
|
+
const node = Chat({
|
|
71
|
+
title: this._title,
|
|
72
|
+
sub: this._sub,
|
|
73
|
+
messages: this._messages,
|
|
74
|
+
composer,
|
|
75
|
+
});
|
|
32
76
|
webjsx.applyDiff(this, node);
|
|
77
|
+
// Wire send button + Enter-key to read the LIVE textarea value rather than
|
|
78
|
+
// the closure's stale prop. Idempotent — only attach once per composer DOM node.
|
|
79
|
+
const composerEl = this.querySelector('.chat-composer');
|
|
80
|
+
if (composerEl && !composerEl._dsBound) {
|
|
81
|
+
composerEl._dsBound = true;
|
|
82
|
+
const ta = composerEl.querySelector('textarea');
|
|
83
|
+
const btn = composerEl.querySelector('button.send');
|
|
84
|
+
const submit = () => {
|
|
85
|
+
const v = ta ? ta.value.trim() : '';
|
|
86
|
+
if (!v || this._disabled) return;
|
|
87
|
+
if (ta) ta.value = '';
|
|
88
|
+
this._send(v);
|
|
89
|
+
};
|
|
90
|
+
if (btn) btn.addEventListener('click', (e) => { e.preventDefault(); submit(); });
|
|
91
|
+
if (ta) ta.addEventListener('keydown', (e) => {
|
|
92
|
+
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); submit(); }
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (this._scrollPending) {
|
|
96
|
+
this._scrollPending = false;
|
|
97
|
+
const thread = this.querySelector('.chat-thread');
|
|
98
|
+
if (thread) thread.scrollTop = thread.scrollHeight;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
_syncSendButton() {
|
|
102
|
+
const btn = this.querySelector('.chat-composer button.send');
|
|
103
|
+
if (btn) btn.disabled = this._disabled || !this._composerValue.trim();
|
|
33
104
|
}
|
|
34
105
|
}
|
|
35
106
|
|