anentrypoint-design 0.0.353 → 0.0.354
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.css +43 -0
- package/dist/247420.js +17 -17
- package/package.json +1 -1
- package/src/components/overlay-primitives.js +34 -0
- package/src/components/shell.js +1 -0
- package/src/components.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.354",
|
|
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",
|
|
@@ -315,6 +315,40 @@ export function PermissionMenu({ trigger, categories = [], approved = [], onTogg
|
|
|
315
315
|
: h('button', { type: 'button', class: 'ov-perm-trigger', ref: refFn }, child || 'Permissions');
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
+
// ApprovalPrompt — an inline, in-thread tool-permission card (as opposed to
|
|
319
|
+
// PermissionMenu's settings-style dropdown): shows the tool name + an
|
|
320
|
+
// optional args preview, an optional free-text note the user can attach to
|
|
321
|
+
// their decision (auto-focused, since the note is usually the primary
|
|
322
|
+
// reason to open this card at all), and up to four resolution actions
|
|
323
|
+
// (once/session/all/deny). Mirrors docstudio's chat-approval-prompts.js
|
|
324
|
+
// buildApprovalPrompt shape. The note textarea is entirely optional -
|
|
325
|
+
// omitting `onDecision`'s use of the note arg keeps existing simpler
|
|
326
|
+
// once/deny-only call sites unaffected.
|
|
327
|
+
export function ApprovalPrompt({ toolName, categoryLabel, argsPreview, onDecision, autoFocusNote = true } = {}) {
|
|
328
|
+
let noteEl = null;
|
|
329
|
+
const noteRef = (el) => {
|
|
330
|
+
if (!el || noteEl === el) return;
|
|
331
|
+
noteEl = el;
|
|
332
|
+
if (autoFocusNote) queueMicrotask(() => noteEl && noteEl.focus());
|
|
333
|
+
};
|
|
334
|
+
const decide = (kind) => { if (onDecision) onDecision(kind, (noteEl && noteEl.value || '').trim()); };
|
|
335
|
+
return h('div', { class: 'ov-approval', role: 'group', 'aria-label': toolName ? `Permission requested: ${toolName}` : 'Permission requested' },
|
|
336
|
+
h('div', { class: 'ov-approval-head' },
|
|
337
|
+
h('span', { class: 'ov-approval-icon' }, Icon('lock', { size: 16 })),
|
|
338
|
+
h('strong', { class: 'ov-approval-tool' }, toolName || ''),
|
|
339
|
+
categoryLabel ? h('span', { class: 'ov-approval-cat' }, '- ' + categoryLabel) : null),
|
|
340
|
+
argsPreview ? h('pre', { class: 'ov-approval-args' }, argsPreview) : null,
|
|
341
|
+
h('textarea', {
|
|
342
|
+
class: 'ov-approval-note', ref: noteRef,
|
|
343
|
+
placeholder: 'Add instructions for the assistant (optional)...',
|
|
344
|
+
}),
|
|
345
|
+
h('div', { class: 'ov-approval-actions' },
|
|
346
|
+
h('button', { type: 'button', class: 'ov-approval-btn ov-approval-btn-primary', onclick: () => decide('once') }, 'Allow once'),
|
|
347
|
+
h('button', { type: 'button', class: 'ov-approval-btn ov-approval-btn-soft', onclick: () => decide('session') }, 'Allow for session'),
|
|
348
|
+
h('button', { type: 'button', class: 'ov-approval-btn', onclick: () => decide('all') }, 'Allow all'),
|
|
349
|
+
h('button', { type: 'button', class: 'ov-approval-btn ov-approval-btn-deny', onclick: () => decide('deny') }, 'Deny')));
|
|
350
|
+
}
|
|
351
|
+
|
|
318
352
|
// Clamp a fixed-position box to the viewport given desired top-left coords.
|
|
319
353
|
function _clampToViewport(x, y, w, h, margin = CLAMP_MARGIN) {
|
|
320
354
|
const vw = (typeof window !== 'undefined' ? window.innerWidth : 1024);
|
package/src/components/shell.js
CHANGED
|
@@ -143,6 +143,7 @@ export function Glyph({ children, color, size = 'base', label } = {}) {
|
|
|
143
143
|
// Monochrome inline-SVG icons (stroke=currentColor) so chrome reads as one
|
|
144
144
|
// coherent line-icon set instead of multicolor OS emoji. 16px box, 1.6 stroke.
|
|
145
145
|
export const ICON_PATHS = {
|
|
146
|
+
lock: '<rect x="4" y="10" width="16" height="11" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/>',
|
|
146
147
|
mic: '<path d="M12 3a3 3 0 0 0-3 3v5a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3z"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>',
|
|
147
148
|
'mic-off': '<path d="M9 9v2a3 3 0 0 0 4.5 2.6M15 11V6a3 3 0 0 0-5.9-.8"/><path d="M5 11a7 7 0 0 0 11.5 5.4M12 18v3"/><path d="m4 4 16 16"/>',
|
|
148
149
|
speaker: '<path d="M11 5 6 9H3v6h3l5 4z"/><path d="M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13"/>',
|
package/src/components.js
CHANGED
|
@@ -90,7 +90,7 @@ export {
|
|
|
90
90
|
export {
|
|
91
91
|
Tooltip, Popover, Dropdown, useLongPress, useFloating,
|
|
92
92
|
CommandPalette, EmojiPicker, BootOverlay, SettingsPopover,
|
|
93
|
-
AuthModal, VideoLightbox, PermissionMenu
|
|
93
|
+
AuthModal, VideoLightbox, PermissionMenu, ApprovalPrompt
|
|
94
94
|
} from './components/overlay-primitives.js';
|
|
95
95
|
|
|
96
96
|
export {
|