anentrypoint-design 0.0.176 → 0.0.178
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/dist/247420.js +10 -10
- package/package.json +1 -1
- package/src/components/interaction-primitives.js +48 -0
- package/src/components.js +1 -1
- package/src/kits/os/theme.css +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.178",
|
|
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",
|
|
@@ -139,6 +139,54 @@ export function useNumberScrub(el, { getValue, onChange, step = 0.01, threshold
|
|
|
139
139
|
}};
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
// usePointerDrag — free 2D pointer drag with caller-supplied onMove, for surfaces
|
|
143
|
+
// that need raw pointer coordinates each frame (a 3D viewport gizmo, a canvas
|
|
144
|
+
// handle) rather than the data-transfer DnD model of useDraggable. Pointer Events
|
|
145
|
+
// only, so mouse+touch+pen+XR-controller all drive it. The primary pointer is
|
|
146
|
+
// captured on the element (drag keeps tracking when it leaves the element or
|
|
147
|
+
// crosses a panel) and released on pointerup/pointercancel; a non-primary pointer
|
|
148
|
+
// (second finger) is ignored mid-drag so multi-touch never makes the drag jump.
|
|
149
|
+
// onStart returns false to decline the drag (e.g. a miss in the gizmo raycast),
|
|
150
|
+
// leaving the pointerdown to propagate to other handlers.
|
|
151
|
+
export function usePointerDrag(el, { onStart, onMove, onEnd, button = 0 } = {}) {
|
|
152
|
+
if (!el) return { destroy() {} };
|
|
153
|
+
let pid = null;
|
|
154
|
+
const onMoveEv = (e) => {
|
|
155
|
+
if (pid == null || e.pointerId !== pid) return;
|
|
156
|
+
if (onMove) onMove(e);
|
|
157
|
+
};
|
|
158
|
+
const finish = (e, cancelled) => {
|
|
159
|
+
if (pid == null) return;
|
|
160
|
+
try { el.releasePointerCapture(pid); } catch {}
|
|
161
|
+
pid = null;
|
|
162
|
+
el.removeAttribute('data-pointer-dragging');
|
|
163
|
+
window.removeEventListener('pointermove', onMoveEv);
|
|
164
|
+
window.removeEventListener('pointerup', onUpEv);
|
|
165
|
+
window.removeEventListener('pointercancel', onCancelEv);
|
|
166
|
+
if (onEnd) onEnd(e, cancelled);
|
|
167
|
+
};
|
|
168
|
+
const onUpEv = (e) => { if (e.pointerId === pid) finish(e, false); };
|
|
169
|
+
const onCancelEv = (e) => { if (e.pointerId === pid) finish(e, true); };
|
|
170
|
+
const onDown = (e) => {
|
|
171
|
+
if (button != null && e.button != null && e.button !== button) return;
|
|
172
|
+
if (pid != null) return; // already dragging with the primary pointer
|
|
173
|
+
if (onStart && onStart(e) === false) return; // caller declined (e.g. raycast miss)
|
|
174
|
+
pid = e.pointerId;
|
|
175
|
+
el.setAttribute('data-pointer-dragging', 'true');
|
|
176
|
+
try { el.setPointerCapture(pid); } catch {}
|
|
177
|
+
window.addEventListener('pointermove', onMoveEv);
|
|
178
|
+
window.addEventListener('pointerup', onUpEv);
|
|
179
|
+
window.addEventListener('pointercancel', onCancelEv);
|
|
180
|
+
};
|
|
181
|
+
el.addEventListener('pointerdown', onDown);
|
|
182
|
+
return { destroy() {
|
|
183
|
+
el.removeEventListener('pointerdown', onDown);
|
|
184
|
+
window.removeEventListener('pointermove', onMoveEv);
|
|
185
|
+
window.removeEventListener('pointerup', onUpEv);
|
|
186
|
+
window.removeEventListener('pointercancel', onCancelEv);
|
|
187
|
+
}, get dragging() { return pid != null; } };
|
|
188
|
+
}
|
|
189
|
+
|
|
142
190
|
export function useDropTarget(el, { accepts = [], onDrop, onDragOver } = {}) {
|
|
143
191
|
if (!el) return { destroy() {} };
|
|
144
192
|
el.setAttribute('data-drop-target', '');
|
package/src/components.js
CHANGED
|
@@ -58,7 +58,7 @@ export {
|
|
|
58
58
|
} from './components/form-primitives.js';
|
|
59
59
|
|
|
60
60
|
export {
|
|
61
|
-
useDraggable, useDropTarget, useNumberScrub, Reorderable,
|
|
61
|
+
useDraggable, useDropTarget, useNumberScrub, usePointerDrag, Reorderable,
|
|
62
62
|
useKeyboardShortcut, formatShortcut, ShortcutHint,
|
|
63
63
|
useKeyboardShortcutHelp, ShortcutHelpDialog
|
|
64
64
|
} from './components/interaction-primitives.js';
|
package/src/kits/os/theme.css
CHANGED
|
@@ -957,12 +957,24 @@ html.ds-247420 { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-t
|
|
|
957
957
|
* ----------------------------------------------------------------------- */
|
|
958
958
|
|
|
959
959
|
.ds-247420 freddie-chat,
|
|
960
|
-
.ds-247420 ds-chat
|
|
960
|
+
.ds-247420 ds-chat,
|
|
961
|
+
.ds-247420 freddie-chat.chat,
|
|
962
|
+
.ds-247420 ds-chat.chat {
|
|
961
963
|
display: flex;
|
|
962
964
|
flex-direction: column;
|
|
963
965
|
min-height: 0;
|
|
964
966
|
height: 100%;
|
|
965
967
|
overflow: hidden;
|
|
968
|
+
/* zero legacy .ds-247420 .chat + .chat (app-shell) token leak — host
|
|
969
|
+
carries `.chat` class so the legacy full-page chat-card rule
|
|
970
|
+
(margin:12px 0; max-width:820; min-height:480; padding-bottom:50)
|
|
971
|
+
applies. Bump specificity with the doubled-class selector. */
|
|
972
|
+
margin: 0 !important;
|
|
973
|
+
padding: 0 !important;
|
|
974
|
+
gap: 0 !important;
|
|
975
|
+
max-width: none !important;
|
|
976
|
+
background: transparent !important;
|
|
977
|
+
border-radius: 0 !important;
|
|
966
978
|
}
|
|
967
979
|
.ds-247420 freddie-chat > .chat,
|
|
968
980
|
.ds-247420 ds-chat > .chat {
|
|
@@ -971,6 +983,7 @@ html.ds-247420 { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-t
|
|
|
971
983
|
display: flex;
|
|
972
984
|
flex-direction: column;
|
|
973
985
|
overflow: hidden;
|
|
986
|
+
margin: 0;
|
|
974
987
|
padding: 0;
|
|
975
988
|
gap: 0;
|
|
976
989
|
}
|