nio-cat 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web/board.css ADDED
@@ -0,0 +1,170 @@
1
+ /* Nio · Pissarra */
2
+ .board-root { position: relative; height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; --bd-bg: var(--bg); --bd-blue: #2b5bd8; --chat-w: 360px; --bd-ease: cubic-bezier(.22,1,.36,1); }
3
+ .bd { container: stage / inline-size; position: relative; display: block; height: 100%; min-height: 0; overflow: hidden; }
4
+ .bd-stage { position: absolute; inset: 0; overflow: hidden; overscroll-behavior: none; touch-action: none; background-color: var(--bg); background-image: radial-gradient(circle, color-mix(in srgb, var(--fg) 16%, transparent) 1px, transparent 1.3px); user-select: none; -webkit-user-select: none; }
5
+ .bd-stage.nogrid { background-image: none; }
6
+ .bd-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
7
+ .bd-stage[data-tool="select"] .bd-svg { cursor: default; }
8
+ .bd-stage[data-tool="select"] g[data-id] { cursor: move; }
9
+ .bd-stage[data-tool="hand"] .bd-svg, .bd-stage.space .bd-svg { cursor: grab; }
10
+ .bd-stage.panning .bd-svg { cursor: grabbing; }
11
+ .bd-stage[data-tool="text"] .bd-svg { cursor: text; }
12
+ .bd-stage[data-tool="eraser"] .bd-svg { cursor: cell; }
13
+ .bd-svg .hit { fill: transparent; stroke: none; pointer-events: all; }
14
+ .bd-svg .hit.line { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; }
15
+ .bd-svg g[data-id] { transition: opacity .15s; }
16
+ .bd-svg g.erasing { opacity: .22; }
17
+ .bd-svg g.editing text { opacity: 0; }
18
+ .bd-selg .selbox { fill: none; stroke: var(--bd-blue); }
19
+ .bd-selg .marq { fill: color-mix(in srgb, var(--bd-blue) 7%, transparent); stroke: var(--bd-blue); }
20
+ .bd-selg .bindhint { fill: none; stroke: var(--bd-blue); opacity: .45; }
21
+ .bd-selg .hdl { fill: #fff; stroke: var(--bd-blue); }
22
+ .bd-selg [data-h="nw"], .bd-selg [data-h="se"] { cursor: nwse-resize; }
23
+ .bd-selg [data-h="ne"], .bd-selg [data-h="sw"] { cursor: nesw-resize; }
24
+ .bd-selg [data-h="n"], .bd-selg [data-h="s"] { cursor: ns-resize; }
25
+ .bd-selg [data-h="e"], .bd-selg [data-h="w"] { cursor: ew-resize; }
26
+ .bd-selg [data-ep] { cursor: grab; }
27
+
28
+ .bd .ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
29
+ .bd-bar { position: absolute; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); background: color-mix(in srgb, var(--white) 80%, transparent); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--fg) 40%, transparent); }
30
+ .bd-bar .sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--border); }
31
+ .bd-tools { top: 14px; left: 50%; transform: translateX(-50%); transition: transform .34s var(--bd-ease); }
32
+ .chat-open .bd-tools { transform: translateX(calc(-50% - var(--chat-w) / 2)); }
33
+ .bd .tb, .bd .ib { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--fg); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s, transform .12s; }
34
+ .bd .ib { width: 34px; height: 34px; }
35
+ .bd .tb:hover, .bd .ib:hover { background: color-mix(in srgb, var(--bg-2) 85%, transparent); }
36
+ .bd .tb:active, .bd .ib:active { transform: scale(.94); }
37
+ .bd .tb[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
38
+ .bd .tb small { position: absolute; right: 4px; bottom: 2px; font-size: 9px; font-weight: 600; opacity: .5; line-height: 1; }
39
+ .bd .ib.danger { color: var(--red); }
40
+ .bd .pct { min-width: 54px; height: 34px; border: 0; border-radius: 10px; background: none; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
41
+ .bd .pct:hover { background: color-mix(in srgb, var(--bg-2) 85%, transparent); }
42
+ .bd-zoom { left: 14px; bottom: 14px; }
43
+ .bd-right { top: 14px; right: 14px; transition: transform .34s var(--bd-ease); }
44
+ .chat-open .bd-right { transform: translateX(calc(-1 * var(--chat-w))); }
45
+ .bd .chat-t { width: auto; display: flex; gap: 8px; padding: 0 12px 0 9px; font-size: 13px; font-weight: 600; }
46
+ .bd .chat-t .tbbot { --s: 20px; --bw: .15; }
47
+ .only-m { display: none !important; }
48
+
49
+ .bd-menuwrap { position: relative; }
50
+ .bd-menu { position: absolute; top: 44px; right: 0; z-index: 8; min-width: 230px; padding: 6px; display: grid; border-radius: 14px; border: 1px solid var(--border); background: color-mix(in srgb, var(--white) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 16px 40px -20px color-mix(in srgb, var(--fg) 45%, transparent); animation: bd-pop .16s cubic-bezier(.22,1,.36,1); }
51
+ .bd-menu[hidden] { display: none; }
52
+ .bd-menu button, .bd-menu label { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; color: var(--fg); }
53
+ .bd-menu button:hover, .bd-menu label:hover { background: var(--bg-2); }
54
+ .bd-menu .danger { color: var(--red); }
55
+ .bd-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }
56
+ .bd kbd { font: 600 10px var(--font); padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--white); color: var(--fg-muted); white-space: nowrap; }
57
+ @keyframes bd-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
58
+
59
+ .bd-style { position: absolute; z-index: 4; left: 14px; top: 70px; width: 216px; padding: 14px; display: grid; gap: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); background: color-mix(in srgb, var(--white) 84%, transparent); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--fg) 40%, transparent); animation: bd-pop .18s cubic-bezier(.22,1,.36,1); }
60
+ .bd-style[hidden] { display: none; }
61
+ .bd-style .grp { display: grid; gap: 7px; }
62
+ .bd-style .grp > span { font-size: 11px; font-weight: 600; color: var(--fg-muted); }
63
+ .bd-style .row { display: flex; gap: 6px; flex-wrap: wrap; }
64
+ .bd-style .sw-c { width: 26px; height: 26px; padding: 0; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); background: var(--c); cursor: pointer; transition: transform .12s; }
65
+ .bd-style .sw-c:hover { transform: scale(1.08); }
66
+ .bd-style .sw-c[aria-pressed="true"] { outline: 2px solid var(--fg); outline-offset: 2px; }
67
+ .bd-style .sw-c.none { background: linear-gradient(135deg, transparent 45%, var(--red) 46%, var(--red) 54%, transparent 55%), var(--white); }
68
+ .bd-style .seg2 { display: flex; padding: 2px; border-radius: 9px; background: var(--bg-2); }
69
+ .bd-style .seg2 button { flex: 1; display: grid; place-items: center; height: 28px; border: 0; border-radius: 7px; background: none; font-size: 12px; font-weight: 600; color: var(--fg-muted); cursor: pointer; }
70
+ .bd-style .seg2 button[aria-pressed="true"] { background: var(--white); color: var(--fg); }
71
+ .bd-style .seg2 i { display: block; width: 20px; border-radius: 2px; background: currentColor; }
72
+ .bd-style .acts { gap: 2px; }
73
+
74
+ .bd-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 48px)); display: grid; gap: 6px; text-align: center; color: var(--fg-muted); pointer-events: none; }
75
+ .bd-empty b { font-size: 17px; font-weight: 600; color: var(--fg); }
76
+ .bd-empty[hidden] { display: none; }
77
+ .bd-edit { position: absolute; left: 0; top: 0; z-index: 5; margin: 0; padding: 0; border: 0; outline: none; background: transparent; resize: none; overflow: hidden; white-space: pre-wrap; word-break: break-word; caret-color: var(--accent); }
78
+
79
+ .bd-help { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--fg) 22%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
80
+ .bd-help[hidden] { display: none; }
81
+ .bd-help-in { width: min(820px, 100%); max-height: 100%; overflow: auto; padding: 22px; border-radius: 18px; background: var(--bg); box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--fg) 60%, transparent); animation: bd-pop .2s cubic-bezier(.22,1,.36,1); }
82
+ .bd-help header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
83
+ .bd-help h3 { font-size: 20px; font-weight: 500; letter-spacing: -.04em; }
84
+ .bd-help .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
85
+ .bd-help dt { font-size: 12px; font-weight: 600; color: var(--fg-muted); margin-bottom: 8px; }
86
+ .bd-help dl div { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); font-size: 13px; }
87
+ .bd-help dd { flex: 1; }
88
+
89
+ .bd-chat { position: absolute; z-index: 6; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: var(--chat-w); min-height: 0; overflow: hidden; border-left: 1px solid var(--border); background: var(--panel); transform: translateX(100%); visibility: hidden; transition: transform .34s var(--bd-ease), visibility 0s linear .34s; }
90
+ .chat-open .bd-chat { transform: none; visibility: visible; transition: transform .34s var(--bd-ease), visibility 0s; }
91
+ .bd-chat header { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--border); }
92
+ .bd-chat .who { display: flex; align-items: center; gap: 10px; }
93
+ .bd-chat .hbot { --s: 30px; --bw: .14; }
94
+ .bd-chat .who b { display: block; font-size: 15px; font-weight: 600; }
95
+ .bd-chat .who small { display: block; font-size: 12px; color: var(--fg-muted); }
96
+ .bd-chat .brain { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--fg-muted); }
97
+ .bd-chat .brain select { flex: 1; min-width: 0; height: 32px; padding: 0 34px 0 10px; border: 1px solid var(--border); border-radius: 9px; background-color: var(--white); font-size: 13px; color: var(--fg); background-position: right 9px center; }
98
+ .bd-chat .m .dim { color: var(--fg-muted); font-size: 12px; }
99
+ .bd-chat .msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
100
+ .bd-chat .m { max-width: 88%; font-size: 14px; line-height: 1.45; animation: bd-msg .28s cubic-bezier(.22,1,.36,1); }
101
+ .bd-chat .m.me { align-self: flex-end; padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: var(--fg); color: var(--bg); white-space: pre-wrap; }
102
+ .bd-chat .m.nio { display: flex; gap: 8px; align-items: flex-end; }
103
+ .bd-chat .m.nio > div { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: var(--white); border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
104
+ .bd-chat .m.nio b { font-weight: 600; }
105
+ .bd-chat .mav { --s: 24px; --bw: .15; margin-bottom: 4px; }
106
+ @keyframes bd-msg { from { opacity: 0; transform: translateY(6px); } }
107
+ .bd-chat .chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
108
+ .bd-chat .chips::-webkit-scrollbar { display: none; }
109
+ .bd-chat .chip-s { flex: none; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); font-size: 12px; font-weight: 500; cursor: pointer; }
110
+ .bd-chat .chip-s:hover { border-color: var(--fg); }
111
+ .bd-chat .cin { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
112
+ .bd-chat .cin textarea { flex: 1; min-height: 42px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); resize: none; font: inherit; font-size: 14px; line-height: 1.4; outline: none; }
113
+ .bd-chat .cin textarea:focus { border-color: var(--fg); }
114
+ .bd-chat .send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; background: var(--fg); color: var(--bg); cursor: pointer; }
115
+
116
+ @media (prefers-reduced-motion: reduce) { .bd *, .bd *::before { animation: none !important; transition: none !important; } }
117
+
118
+ @media (max-width: 1100px) { .board-root { --chat-w: 320px; } }
119
+ @media (max-width: 820px) {
120
+ .board-root { height: calc(100dvh - 56px - env(safe-area-inset-top)); }
121
+ .chat-open .bd-tools, .chat-open .bd-right { transform: none; }
122
+ .bd-tools { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 10px; right: 10px; transform: none; overflow-x: auto; scrollbar-width: none; }
123
+ .bd-tools::-webkit-scrollbar { display: none; }
124
+ .bd .tb { width: 40px; height: 40px; flex: none; }
125
+ .bd .tb small { display: none; }
126
+ .bd-zoom { top: 10px; bottom: auto; left: 10px; }
127
+ .bd-zoom [data-bd="zin"], .bd-zoom [data-bd="zout"] { display: none; }
128
+ .bd-right { top: 10px; right: 10px; }
129
+ .bd .chat-t { padding: 0 9px; }
130
+ .bd .chat-t > span:not(.bot) { display: none; }
131
+ .only-m { display: grid !important; }
132
+ .bd-style { display: none; }
133
+ .style-open .bd-style:not([hidden]) { display: grid; left: 10px; right: 10px; top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); width: auto; grid-template-columns: 1fr 1fr; }
134
+ .bd-help .cols { grid-template-columns: 1fr; }
135
+ .bd-chat { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; width: auto; height: min(72%, 560px); border: 0; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .34s var(--bd-ease), visibility 0s linear .34s; box-shadow: 0 -20px 50px -30px color-mix(in srgb, var(--fg) 55%, transparent); }
136
+ .chat-open .bd-chat { transform: none; transition: transform .34s var(--bd-ease), visibility 0s; }
137
+ .bd-chat header::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--border); }
138
+ .bd-empty { top: 42%; }
139
+ }
140
+
141
+ /* El llenç s'adapta a la seva amplada real (tauleta, xat obert, mòbil) */
142
+ @container stage (max-width: 720px) {
143
+ .bd-chat { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; width: auto; height: min(72%, 560px); border: 0; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform .34s var(--bd-ease), visibility 0s linear .34s; box-shadow: 0 -20px 50px -30px color-mix(in srgb, var(--fg) 55%, transparent); }
144
+ .chat-open .bd-chat { transform: none; transition: transform .34s var(--bd-ease), visibility 0s; }
145
+ .bd-chat header::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--border); }
146
+ .chat-open .bd-tools, .chat-open .bd-right { transform: none; }
147
+ .bd-tools { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 10px; right: 10px; transform: none; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
148
+ .bd-tools::-webkit-scrollbar { display: none; }
149
+ .bd .tb { flex: none; }
150
+ .bd .tb small { display: none; }
151
+ .bd-zoom { top: 10px; bottom: auto; left: 10px; }
152
+ .bd-zoom [data-bd="zin"], .bd-zoom [data-bd="zout"] { display: none; }
153
+ .bd-right { top: 10px; right: 10px; }
154
+ .bd .chat-t { padding: 0 9px; }
155
+ .bd .chat-t > span:not(.bot) { display: none; }
156
+ .bd .tb.only-m { display: grid !important; }
157
+ .bd-style { display: none; }
158
+ .style-open .bd-style:not([hidden]) { display: grid; left: 10px; right: 10px; top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); width: auto; grid-template-columns: 1fr 1fr; }
159
+ }
160
+ @container stage (max-width: 440px) {
161
+ .bd .tb[data-tool="hand"], .bd .tb[data-tool="line"], .bd .tb[data-bd="lock"] { display: none; }
162
+ .bd .tb { width: 38px; height: 38px; }
163
+ .bd-tools { justify-content: space-between; }
164
+ .style-open .bd-style:not([hidden]) { grid-template-columns: 1fr; max-height: 55%; overflow-y: auto; }
165
+ }
166
+ @container stage (max-width: 400px) {
167
+ .bd-tools { gap: 0; padding: 3px; left: 6px; right: 6px; }
168
+ .bd-tools .sep { display: none; }
169
+ .bd-tools .tb { flex: 1 1 0; min-width: 30px; width: auto; height: 38px; }
170
+ }