pith-ui 0.0.0-stage → 0.1.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/AI.md +75 -0
- package/API.md +3688 -0
- package/LICENSE +661 -0
- package/README.md +80 -2
- package/dist/composer.d.ts +38 -0
- package/dist/composer.d.ts.map +1 -0
- package/dist/composer.js +123 -0
- package/dist/composer.js.map +1 -0
- package/dist/content/conversation-reader.d.ts +19 -0
- package/dist/content/conversation-reader.d.ts.map +1 -0
- package/dist/content/conversation-reader.js +280 -0
- package/dist/content/conversation-reader.js.map +1 -0
- package/dist/content/conversation-view.d.ts +65 -0
- package/dist/content/conversation-view.d.ts.map +1 -0
- package/dist/content/conversation-view.js +140 -0
- package/dist/content/conversation-view.js.map +1 -0
- package/dist/content/image-viewer.d.ts +25 -0
- package/dist/content/image-viewer.d.ts.map +1 -0
- package/dist/content/image-viewer.js +114 -0
- package/dist/content/image-viewer.js.map +1 -0
- package/dist/content/markdown.d.ts +12 -0
- package/dist/content/markdown.d.ts.map +1 -0
- package/dist/content/markdown.js +68 -0
- package/dist/content/markdown.js.map +1 -0
- package/dist/content/paged-preview.d.ts +15 -0
- package/dist/content/paged-preview.d.ts.map +1 -0
- package/dist/content/paged-preview.js +108 -0
- package/dist/content/paged-preview.js.map +1 -0
- package/dist/content/views.d.ts +9 -0
- package/dist/content/views.d.ts.map +1 -0
- package/dist/content/views.js +53 -0
- package/dist/content/views.js.map +1 -0
- package/dist/content/welcome.d.ts +18 -0
- package/dist/content/welcome.d.ts.map +1 -0
- package/dist/content/welcome.js +54 -0
- package/dist/content/welcome.js.map +1 -0
- package/dist/core.d.ts +36 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +44 -0
- package/dist/core.js.map +1 -0
- package/dist/dom.d.ts +14 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +69 -0
- package/dist/dom.js.map +1 -0
- package/dist/files/panels.d.ts +100 -0
- package/dist/files/panels.d.ts.map +1 -0
- package/dist/files/panels.js +286 -0
- package/dist/files/panels.js.map +1 -0
- package/dist/files/systems.d.ts +91 -0
- package/dist/files/systems.d.ts.map +1 -0
- package/dist/files/systems.js +273 -0
- package/dist/files/systems.js.map +1 -0
- package/dist/forms/actions.d.ts +27 -0
- package/dist/forms/actions.d.ts.map +1 -0
- package/dist/forms/actions.js +39 -0
- package/dist/forms/actions.js.map +1 -0
- package/dist/forms/custom-connection.d.ts +62 -0
- package/dist/forms/custom-connection.d.ts.map +1 -0
- package/dist/forms/custom-connection.js +72 -0
- package/dist/forms/custom-connection.js.map +1 -0
- package/dist/forms/dialog-frame.d.ts +41 -0
- package/dist/forms/dialog-frame.d.ts.map +1 -0
- package/dist/forms/dialog-frame.js +95 -0
- package/dist/forms/dialog-frame.js.map +1 -0
- package/dist/forms/history.d.ts +16 -0
- package/dist/forms/history.d.ts.map +1 -0
- package/dist/forms/history.js +21 -0
- package/dist/forms/history.js.map +1 -0
- package/dist/forms/identity.d.ts +16 -0
- package/dist/forms/identity.d.ts.map +1 -0
- package/dist/forms/identity.js +53 -0
- package/dist/forms/identity.js.map +1 -0
- package/dist/forms/model-editor.d.ts +40 -0
- package/dist/forms/model-editor.d.ts.map +1 -0
- package/dist/forms/model-editor.js +89 -0
- package/dist/forms/model-editor.js.map +1 -0
- package/dist/forms/panels.d.ts +146 -0
- package/dist/forms/panels.d.ts.map +1 -0
- package/dist/forms/panels.js +339 -0
- package/dist/forms/panels.js.map +1 -0
- package/dist/forms/provider-login.d.ts +22 -0
- package/dist/forms/provider-login.d.ts.map +1 -0
- package/dist/forms/provider-login.js +116 -0
- package/dist/forms/provider-login.js.map +1 -0
- package/dist/forms/resource-editor.d.ts +27 -0
- package/dist/forms/resource-editor.d.ts.map +1 -0
- package/dist/forms/resource-editor.js +34 -0
- package/dist/forms/resource-editor.js.map +1 -0
- package/dist/foundations.d.ts +95 -0
- package/dist/foundations.d.ts.map +1 -0
- package/dist/foundations.js +315 -0
- package/dist/foundations.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation/context-menu.d.ts +26 -0
- package/dist/navigation/context-menu.d.ts.map +1 -0
- package/dist/navigation/context-menu.js +81 -0
- package/dist/navigation/context-menu.js.map +1 -0
- package/dist/navigation/navigation.d.ts +92 -0
- package/dist/navigation/navigation.d.ts.map +1 -0
- package/dist/navigation/navigation.js +368 -0
- package/dist/navigation/navigation.js.map +1 -0
- package/dist/primitives.d.ts +310 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +633 -0
- package/dist/primitives.js.map +1 -0
- package/dist/styles.css +853 -0
- package/dist/surface.d.ts +29 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +154 -0
- package/dist/surface.js.map +1 -0
- package/dist/tasks/approval.d.ts +25 -0
- package/dist/tasks/approval.d.ts.map +1 -0
- package/dist/tasks/approval.js +64 -0
- package/dist/tasks/approval.js.map +1 -0
- package/dist/tasks/permission.d.ts +37 -0
- package/dist/tasks/permission.d.ts.map +1 -0
- package/dist/tasks/permission.js +73 -0
- package/dist/tasks/permission.js.map +1 -0
- package/dist/tasks/runtime.d.ts +31 -0
- package/dist/tasks/runtime.d.ts.map +1 -0
- package/dist/tasks/runtime.js +34 -0
- package/dist/tasks/runtime.js.map +1 -0
- package/dist/theme.d.ts +4 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +6 -0
- package/dist/theme.js.map +1 -0
- package/dist/workspace.d.ts +92 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +288 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +27 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panels.js","sourceRoot":"","sources":["../../src/forms/panels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkC,MAAM,YAAY,CAAC;AACvE,OAAO,EAAC,QAAQ,EA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AAC,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAC/H,CAAC,CAAC;IACF,MAAM,CAAC,OAAO,CAAC,CAAC;IAAC,OAAO,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,KAAI,IAAI,SAAS;YAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,EAAC,CAAC;AACpJ,CAAC","sourcesContent":["import {Generation, type ActionResult, type UIBlock} from '../core.js';\nimport {scopeIds,bindFormSubmission} from './identity.js';\nimport { dialogHeading, escape, icon, uniqueId, setText } from '../dom.js';\nimport {createModelEditor, modelEditorMarkup, type ModelEditorState, type ModelSelection} from './model-editor.js';\nimport {adoptProductParts,reconcileSelectOptions} from '../foundations.js';\nexport {modelEditorMarkup} from './model-editor.js';\n\nexport interface FormFeedback { error?: string; disabled?: boolean }\nexport interface FormDOMBlock<State extends FormFeedback> extends UIBlock<State> {\n field<T extends HTMLElement = HTMLElement>(id: string): T;\n id(localId: string): string;\n}\nfunction formBlock<State extends FormFeedback>(markup: string, className: string, initial: State, prefix = ''): FormDOMBlock<State> & {parts: ReturnType<typeof adoptProductParts>} {\n const element = document.createElement('div');\n element.className = className;\n element.innerHTML = markup; scopeIds(element, prefix);\n const parts = adoptProductParts(element); let destroyed = false;\n const field = <T extends HTMLElement = HTMLElement>(id: string): T => {\n const result = Array.from(element.querySelectorAll<HTMLElement>('[id]')).find((node) => node.getAttribute('id') === prefix + id);\n if (!result) throw new Error(`Unknown component field: ${id}`);\n return result as T;\n };\n const update = (state: Readonly<State>) => {\n if (destroyed) return;\n if (state.error !== undefined) {\n const error = element.querySelector<HTMLElement>('[data-dialog-error]') || element.querySelector<HTMLElement>('.pui-form-error[role=\"alert\"]');\n if (error) parts.feedback(error).update({message:state.error,tone:'error'});\n }\n if (state.disabled !== undefined) {\n for (const control of element.querySelectorAll<HTMLButtonElement>('button[type=\"submit\"]')) {\n parts.action(control).update({disabled:state.disabled,pending:control.dataset.controlPending === 'true'});\n }\n }\n };\n update(initial);\n return {element,field,parts,id:(id) => prefix + id,update,destroy() {if (destroyed) return; destroyed = true; parts.destroy(); element.remove();}};\n}\nexport interface SettingsPanelState extends FormFeedback { baseUrl: string; hasApiKey: boolean; ready?: boolean; testing?: boolean; appearance?: {mode: 'light' | 'dark' | 'system'; disabled?: boolean; error?: string}; testResult?: {message: string; ok?: boolean} }\nexport interface FormOptions { idPrefix?: string }\nexport interface SettingsDraft {provider: string; baseUrl: string; apiKey: string}\nexport interface SettingsProviderOption {id: string; name: string; configured?: boolean; signedIn?: boolean}\nexport interface SettingsCredentialView {status: string; hidden: boolean; required: boolean; placeholder: string; removeVisible: boolean; hint?: string; actions?: Node}\nexport interface SettingsPanel extends FormDOMBlock<SettingsPanelState> {read(): SettingsDraft; setProviders(providers: readonly SettingsProviderOption[], selected?: string): void; resetProvider(value: {provider: string; baseUrl: string; clearKey?: boolean; collapseAdvanced?: boolean}): void; setCredential(view: SettingsCredentialView): void; clearSecrets(): void; readonly updates: HTMLElement}\nexport interface SettingsPanelOptions extends FormOptions {onAppearanceChange?: (mode: string) => void; onProviderChange?: (provider: string) => void; onDraftChange?: (draft: SettingsDraft) => void; onSubmit?: (draft: SettingsDraft) => ActionResult | Promise<ActionResult>; onTest?: (draft: SettingsDraft) => void; onRemoveKey?: (draft: SettingsDraft) => ActionResult | Promise<ActionResult>}\nexport function createSettingsPanel(state: SettingsPanelState, options: SettingsPanelOptions = {}): SettingsPanel {\n const block = formBlock(`\n ${dialogHeading('Settings', 'settings-title', 'settings-dialog', 'MAKE IT YOURS')}\n <section class=\"pui-settings-section pui-appearance-settings\" aria-labelledby=\"appearance-title\">\n <h3 id=\"appearance-title\">Appearance</h3>\n <p class=\"pui-appearance-hint\" id=\"appearance-hint\">A bright white workspace or a calm dark one, both with a blue accent. Follow system matches your computer.</p>\n <label class=\"pui-sr-only\" for=\"appearance-mode\">Appearance</label>\n <select id=\"appearance-mode\" class=\"pui-appearance-select\" aria-describedby=\"appearance-hint\"><option value=\"system\">Follow system</option><option value=\"light\">Light</option><option value=\"dark\">Dark</option></select>\n <div id=\"appearance-error\" class=\"pui-form-error\" role=\"alert\"></div>\n </section>\n <section id=\"update-settings\" class=\"pui-settings-section pui-update-settings\" aria-labelledby=\"update-title\">\n <h3 id=\"update-title\">Updates</h3>\n <div class=\"pui-settings-copy\">\n <p class=\"pui-field-hint\" data-update-version></p>\n <p class=\"pui-field-hint\" role=\"status\" aria-live=\"polite\" data-update-message>Loading update status…</p>\n </div>\n <progress max=\"100\" value=\"0\" aria-label=\"Update progress\" hidden></progress>\n <div class=\"pui-settings-actions\"><button class=\"pui-secondary-button\" type=\"button\" data-update-check disabled>Check for updates</button><button class=\"pui-primary-button\" type=\"button\" data-update-install hidden>Update and restart</button></div>\n </section>\n <form id=\"settings-form\">\n <section class=\"pui-settings-section\" aria-labelledby=\"provider-title\">\n <h3 id=\"provider-title\">Model providers</h3>\n <p class=\"pui-modal-description\">Connect your model providers here. Choose models and thinking effort beside the message box.</p>\n <div class=\"pui-settings-actions\"><button class=\"pui-secondary-button\" type=\"button\" data-sdk=\"custom\">Add independent model connection</button></div>\n <div class=\"pui-settings-field\">\n <label class=\"pui-field-label\" for=\"settings-provider\">Provider</label>\n <select id=\"settings-provider\" class=\"pui-feature-select\" required disabled><option value=\"\">Loading providers…</option></select>\n <div id=\"provider-actions\" hidden></div>\n <p id=\"provider-auth-hint\" class=\"pui-field-hint\" hidden></p>\n </div>\n <details id=\"provider-advanced\" class=\"pui-provider-advanced\">\n <summary>Advanced connection settings</summary>\n <label class=\"pui-field-label\" for=\"base-url\">API base URL</label>\n <div class=\"pui-input-with-icon\">${icon('globe')}<input id=\"base-url\" name=\"baseUrl\" type=\"url\" required value=\"${escape(state.baseUrl)}\" autocomplete=\"off\" /></div>\n <p class=\"pui-field-hint\">The provider’s endpoint is filled in automatically. Change it only for a proxy or custom service.</p>\n </details>\n <div id=\"provider-api-key\" class=\"pui-settings-field\">\n <label class=\"pui-field-label\" for=\"api-key\">API key <span id=\"key-status\" class=\"pui-configured-badge\"></span></label>\n <input id=\"api-key\" name=\"apiKey\" type=\"password\" placeholder=\"${state.hasApiKey ? 'Leave blank to keep your current key' : 'Paste your API key'}\" autocomplete=\"new-password\" ${state.hasApiKey ? '' : 'required'} />\n <p class=\"pui-field-hint\">The saved key is never returned to this page. Model requests go to your configured provider.</p>\n <button class=\"pui-secondary-button pui-destructive-button\" id=\"remove-key\" type=\"button\" hidden>Remove saved API key</button>\n </div>\n </section>\n <section class=\"pui-settings-section pui-connection-test\">\n <p class=\"pui-field-hint\">Uses this provider’s last selected model, or Pith’s default, to check streaming and tool calling. Does not save settings or access files.</p>\n <div class=\"pui-settings-actions\"><button type=\"button\" class=\"pui-secondary-button\" id=\"test-connection\" data-control-pending=\"true\" disabled data-global-idle data-idle-action>Test connection</button></div>\n <div id=\"connection-test-result\" role=\"status\" aria-live=\"polite\"></div>\n </section>\n <div id=\"settings-error\" data-dialog-error class=\"pui-form-error\" role=\"alert\"></div>\n <section class=\"pui-settings-section pui-diagnostics-setting\">\n <p class=\"pui-field-hint\">Version, usage and failure category only; no conversation, file contents, paths or credentials.</p>\n <div class=\"pui-settings-actions\"><button type=\"button\" class=\"pui-secondary-button\" data-action=\"diagnostics\">Save diagnostics</button></div>\n </section>\n <div class=\"pui-modal-footer\"><button class=\"pui-secondary-button\" type=\"button\" data-close=\"settings-dialog\">Cancel</button><button class=\"pui-primary-button\" id=\"save-settings\" data-control-pending=\"true\" disabled data-global-idle type=\"submit\">Save settings</button></div>\n </form>`, 'pui-settings-panel', state, options.idPrefix ?? uniqueId('pui-form') + '-');\n const $ = block.field, abort = new AbortController(), generation = new Generation(); let current = state, pending = false, removing = false, destroyed = false;\n const form = $<HTMLFormElement>('settings-form'), submit = $<HTMLButtonElement>('save-settings'), test = $<HTMLButtonElement>('test-connection'), remove = $<HTMLButtonElement>('remove-key');\n const read = (): SettingsDraft => {const key = $<HTMLInputElement>('api-key'); return {provider:block.parts.control($<HTMLSelectElement>('settings-provider')).getValue(),baseUrl:block.parts.control($<HTMLInputElement>('base-url')).getValue().trim(),apiKey:key.disabled ? '' : block.parts.control(key).getValue().trim()};};\n const update = (next: Readonly<SettingsPanelState>) => {\n if (destroyed) return; current = next; block.update(next);\n block.parts.action(submit).update({disabled:next.disabled,pending:pending || !!next.testing || next.ready !== true});\n block.parts.action(test).update({label:next.testing ? 'Cancel test' : 'Test connection',disabled:!!next.disabled || pending,pending:next.ready !== true});\n block.parts.action(remove).update({disabled:!!next.disabled || pending,pending:removing});\n if (next.appearance) {const appearance = block.parts.control($<HTMLSelectElement>('appearance-mode')); appearance.reset(next.appearance.mode); appearance.update({disabled:!!next.appearance.disabled}); block.parts.feedback($('appearance-error')).update({message:next.appearance.error || '',tone:'error'});}\n if (next.testResult) {const result = $('connection-test-result'); result.textContent = next.testResult.message; result.className = next.testResult.ok === undefined ? '' : next.testResult.ok ? 'pui-test-success' : 'pui-form-error';}\n };\n const run = async (action: SettingsPanelOptions['onSubmit'], kind: 'submit' | 'remove') => {\n if (!action || pending || removing || current.disabled || current.testing || current.ready !== true) return;\n const seq = generation.next(); if (kind === 'submit') pending = true; else removing = true; update({...current,error:''});\n try {const result = await action(read()); if (generation.current(seq) && !result.ok) update({...current,error:result.error});}\n catch (error) {if (generation.current(seq)) update({...current,error:error instanceof Error ? error.message : String(error)});}\n finally {if (generation.current(seq)) {pending = false; removing = false; update(current);}}\n };\n form.addEventListener('submit',event => {if (options.onSubmit) {event.preventDefault(); void run(options.onSubmit,'submit');}}, {signal:abort.signal});\n remove.addEventListener('click',() => {void run(options.onRemoveKey,'remove');}, {signal:abort.signal});\n test.addEventListener('click',() => {if (!test.disabled && (current.testing || form.reportValidity())) options.onTest?.(read());}, {signal:abort.signal});\n $<HTMLSelectElement>('appearance-mode').addEventListener('change',() => options.onAppearanceChange?.($<HTMLSelectElement>('appearance-mode').value), {signal:abort.signal});\n $<HTMLSelectElement>('settings-provider').addEventListener('change',() => options.onProviderChange?.(read().provider), {signal:abort.signal});\n form.addEventListener('input',() => options.onDraftChange?.(read()), {signal:abort.signal});\n $<HTMLInputElement>('base-url').addEventListener('invalid',() => {$<HTMLDetailsElement>('provider-advanced').open = true;}, {signal:abort.signal});\n update(state);\n return {...block,read,update,updates:$('update-settings'),\n setProviders(providers, selected) {if (destroyed) return; const select = $<HTMLSelectElement>('settings-provider'),previous = selected ?? select.value; reconcileSelectOptions(select,providers.map(provider=>({value:provider.id,label:`${provider.name}${provider.signedIn ? ' · Signed in' : provider.configured ? ' · Configured' : ''}`})),providers.some(provider=>provider.id === previous) ? previous : providers[0]?.id || ''); block.parts.control(select).update({disabled:!providers.length});},\n resetProvider(value) {if (destroyed) return; generation.invalidate(); pending = false; removing = false; update({...current,error:''}); block.parts.control($<HTMLSelectElement>('settings-provider')).reset(value.provider); block.parts.control($<HTMLInputElement>('base-url')).reset(value.baseUrl); if (value.clearKey) block.parts.control($<HTMLInputElement>('api-key')).reset(''); if (value.collapseAdvanced) $<HTMLDetailsElement>('provider-advanced').open = false;},\n setCredential(view) {if (destroyed) return; $('key-status').textContent = view.status; $('provider-api-key').hidden = view.hidden; block.parts.control($<HTMLInputElement>('api-key')).update({disabled:view.hidden,required:view.required,placeholder:view.placeholder}); remove.hidden = !view.removeVisible; $('provider-auth-hint').hidden = !view.hint; $('provider-auth-hint').textContent = view.hint || ''; const actions = $('provider-actions'); actions.hidden = !view.actions; if (view.actions && actions.firstChild !== view.actions) actions.replaceChildren(view.actions); else if (!view.actions) actions.replaceChildren(); block.parts.update();},\n clearSecrets() {block.parts.control($<HTMLInputElement>('api-key')).reset('');},\n destroy() {if (destroyed) return; destroyed = true; generation.destroy(); abort.abort(); $<HTMLInputElement>('api-key').value = ''; block.destroy();}\n };\n}\nexport interface MCPEditorValue {name: string; type: string; url?: string; oauth?: boolean; oauthClientId?: string; oauthScope?: string; command?: string; args?: readonly string[]; enabled?: boolean; hasBearerToken?: boolean; envKeys?: readonly string[]}\nexport interface MCPConnectionDraft {name: string; type: 'http' | 'stdio'; url: string; oauth: boolean; oauthClientId: string; oauthScope: string; command: string; args: string; enabled: boolean; bearerToken: string; clearBearerToken: boolean; env: string; clearEnv: boolean}\nexport interface MCPConnectionsState extends FormFeedback {formError?: string}\nexport interface MCPConnectionsPanel extends FormDOMBlock<MCPConnectionsState> {renderType(): void; edit(value?: MCPEditorValue): void; read(): MCPConnectionDraft; clearBearerToken(): void; clearSecrets(): void; toggleEnvironment(): void; readonly list: HTMLElement}\nexport function createMCPConnectionsPanel(state: MCPConnectionsState = {}, options: FormOptions & {onSubmit?: (draft: MCPConnectionDraft) => ActionResult | Promise<ActionResult>} = {}): MCPConnectionsPanel {\n const block = formBlock(`${dialogHeading('Connections', 'connections-title', 'connections-dialog', 'EXTERNAL TOOLS')}<p class=\"pui-modal-description\">Add an MCP server to give Pith access to its tools. Enabled connections connect automatically when a task starts. Disable a connection to stop using it in tasks. External tools require approval unless this conversation has full access.</p><div class=\"pui-feature-toolbar\"><button class=\"pui-secondary-button\" data-action=\"refresh-mcp\">Refresh</button></div><div id=\"mcp-list\"><p class=\"pui-feature-hint\">Loading connections…</p></div><div id=\"mcp-error\" data-dialog-error class=\"pui-form-error\" role=\"alert\"></div><section class=\"pui-connection-editor\"><div class=\"pui-section-heading\"><span id=\"mcp-form-title\">Add connection</span><button type=\"button\" class=\"pui-secondary-button\" data-action=\"new-mcp\">New connection</button></div><form id=\"mcp-form\"><label class=\"pui-field-label\" for=\"mcp-name\">Name</label><input id=\"mcp-name\" name=\"name\" required autocomplete=\"off\" placeholder=\"my-tools\" /><label class=\"pui-field-label\" for=\"mcp-type\">Connection type</label><select id=\"mcp-type\" name=\"type\" class=\"pui-feature-select\"><option value=\"http\">HTTP</option><option value=\"stdio\">Local command (stdio)</option></select><div id=\"mcp-http-fields\"><label class=\"pui-field-label\" for=\"mcp-url\">Server URL</label><input id=\"mcp-url\" name=\"url\" type=\"url\" placeholder=\"https://example.com/mcp\" autocomplete=\"off\" /><label class=\"pui-checkbox-field\"><input id=\"mcp-oauth\" type=\"checkbox\" />Sign in with OAuth</label><details class=\"pui-provider-advanced\"><summary>OAuth settings (optional)</summary><label class=\"pui-field-label\">Registered client ID<input id=\"mcp-oauth-client\" /></label><label class=\"pui-field-label\">Scopes<input id=\"mcp-oauth-scope\" /></label><p class=\"pui-field-hint\">Uses the server’s OAuth discovery and PKCE. The temporary callback listens on 127.0.0.1:54819.</p></details><label class=\"pui-field-label\" for=\"mcp-token\">Bearer token (optional)</label><input id=\"mcp-token\" name=\"bearerToken\" type=\"password\" autocomplete=\"new-password\" placeholder=\"Optional token\" /><label class=\"pui-checkbox-field\" id=\"mcp-clear-token-row\" hidden><input id=\"mcp-clear-token\" type=\"checkbox\" />Remove saved bearer token</label><p class=\"pui-field-hint\">Saved tokens are never returned to this page. Leave this field blank to keep an existing token.</p></div><div id=\"mcp-stdio-fields\" hidden><label class=\"pui-field-label\" for=\"mcp-command\">Installed executable</label><input id=\"mcp-command\" name=\"command\" placeholder=\"/path/to/mcp-server\" autocomplete=\"off\" /><label class=\"pui-field-label\" for=\"mcp-args\">Arguments (JSON array)</label><textarea id=\"mcp-args\" name=\"args\" rows=\"3\" spellcheck=\"false\">[]</textarea><p class=\"pui-field-hint\">The executable and any runtime it needs must already be installed on your computer. Pith Desk does not bundle external runtimes or a marketplace.</p><div class=\"pui-secret-label\"><label class=\"pui-field-label\" for=\"mcp-env\">Environment overrides (JSON object, optional)</label><button class=\"pui-secondary-button\" type=\"button\" id=\"mcp-env-visibility\" data-action=\"toggle-env\" aria-controls=\"mcp-env\" aria-pressed=\"false\">Show</button></div><textarea id=\"mcp-env\" class=\"pui-secret-field\" name=\"env\" rows=\"3\" spellcheck=\"false\" autocomplete=\"off\" aria-describedby=\"mcp-env-hint\" placeholder='{\"API_KEY\":\"…\"}'></textarea><p id=\"mcp-env-hint\" class=\"pui-field-hint\">Values stay private. Leave blank to keep saved overrides. Add a JSON object of string keys and values to set or replace individual overrides.</p><p id=\"mcp-env-keys\" class=\"pui-field-hint\" hidden></p><label class=\"pui-checkbox-field\" id=\"mcp-clear-env-row\" hidden><input id=\"mcp-clear-env\" type=\"checkbox\" />Clear saved environment overrides</label></div><label class=\"pui-checkbox-field\"><input id=\"mcp-enabled\" name=\"enabled\" type=\"checkbox\" checked />Enable this connection</label><div id=\"mcp-form-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button class=\"pui-secondary-button\" type=\"button\" data-close=\"connections-dialog\">Close</button><button class=\"pui-primary-button\" type=\"submit\" data-idle-action data-global-idle>Save connection</button></div></form></section>`, 'pui-mcp-connections', state, options.idPrefix ?? uniqueId('pui-form') + '-');\n const $ = block.field; const abort = new AbortController(); let disposed = false, pending = false, current: MCPConnectionsState = state;\n const form = $<HTMLFormElement>('mcp-form'), submit = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]')!;\n const control = (id:string) => block.parts.control($<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>(id));\n const read = (): MCPConnectionDraft => ({name:control('mcp-name').getValue().trim(),type:control('mcp-type').getValue() === 'stdio' ? 'stdio' : 'http',url:control('mcp-url').getValue().trim(),oauth:control('mcp-oauth').getChecked(),oauthClientId:control('mcp-oauth-client').getValue().trim(),oauthScope:control('mcp-oauth-scope').getValue().trim(),command:control('mcp-command').getValue().trim(),args:control('mcp-args').getValue(),enabled:control('mcp-enabled').getChecked(),bearerToken:control('mcp-token').getValue().trim(),clearBearerToken:control('mcp-clear-token').getChecked(),env:control('mcp-env').getValue(),clearEnv:control('mcp-clear-env').getChecked()});\n const update = (next: Readonly<MCPConnectionsState>) => {if (disposed) return; current = next; block.update(next); if (next.formError !== undefined) block.parts.feedback($('mcp-form-error')).update({message:next.formError,tone:'error'}); block.parts.action(submit).update({disabled:next.disabled,pending});};\n const renderType = () => {if (disposed) return; const http = control('mcp-type').getValue() === 'http'; $('mcp-http-fields').hidden = !http; $('mcp-stdio-fields').hidden = http; control('mcp-url').update({required:http}); control('mcp-command').update({required:!http});};\n const edit = (entry?: MCPEditorValue) => {\n if (disposed) return;\n submission.invalidate();\n $<HTMLFormElement>('mcp-form').reset();\n $<HTMLTextAreaElement>('mcp-env').classList.remove('pui-revealed');\n $('mcp-env-visibility').setAttribute('aria-pressed', 'false'); $('mcp-env-visibility').textContent = 'Show';\n $('mcp-form-title').textContent = entry ? `Edit ${entry.name}` : 'Add connection';\n control('mcp-name').reset(entry?.name || ''); control('mcp-name').update({readOnly:!!entry});\n control('mcp-type').reset(entry?.type || 'http'); control('mcp-url').reset(entry?.url || '');\n control('mcp-oauth').reset(entry?.oauth || false); control('mcp-oauth-client').reset(entry?.oauthClientId || ''); control('mcp-oauth-scope').reset(entry?.oauthScope || '');\n control('mcp-command').reset(entry?.command || ''); control('mcp-args').reset(JSON.stringify(entry?.args || [],null,2));\n control('mcp-enabled').reset(entry?.enabled ?? true);\n control('mcp-token').update({placeholder:entry?.hasBearerToken ? 'Leave blank to keep your saved token' : 'Optional token'});\n $('mcp-clear-token-row').hidden = !entry?.hasBearerToken; const envKeys = entry?.envKeys || [];\n $('mcp-clear-env-row').hidden = !envKeys.length; $('mcp-env-keys').hidden = !envKeys.length; $('mcp-env-keys').textContent = `Saved environment keys: ${envKeys.join(', ')}`;\n $('mcp-form-error').textContent = ''; current = {...current,formError:''}; update(current); renderType(); $<HTMLInputElement>(entry ? entry.type === 'stdio' ? 'mcp-command' : 'mcp-url' : 'mcp-name').focus();\n };\n $<HTMLSelectElement>('mcp-type').addEventListener('change', renderType, {signal:abort.signal});\n const toggleEnvironment = () => {if (disposed) return; const field = $<HTMLTextAreaElement>('mcp-env'); const revealed = field.classList.toggle('pui-revealed'); const button = $('mcp-env-visibility'); button.setAttribute('aria-pressed',String(revealed)); block.parts.action(button as HTMLButtonElement).update({label:revealed ? 'Hide' : 'Show'});};\n $('mcp-env-visibility').addEventListener('click',event => {event.stopPropagation(); toggleEnvironment();}, {signal:abort.signal});\n const submission = bindFormSubmission(form,{read,unavailable:()=>!!current.disabled,onSubmit:options.onSubmit,onPending(value) {pending = value; update(current);},onError(formError) {update({...current,formError});}});\n const clearBearerToken = () => {control('mcp-token').reset('');};\n const clearSecrets = () => {clearBearerToken(); control('mcp-env').reset('');};\n renderType(); update(state);\n return {...block,update,renderType,edit,read,clearBearerToken,clearSecrets,toggleEnvironment,list:$('mcp-list'),destroy() {if (disposed) return; disposed = true; submission.destroy(); abort.abort(); clearSecrets(); block.destroy();}};\n}\nexport interface ModelPickerState extends FormFeedback {editor?: ModelEditorState; loading?: boolean}\nexport interface ModelPicker extends FormDOMBlock<ModelPickerState> {read(): ModelSelection; reset(selection: ModelSelection): void; focus(): void}\nexport function createModelPicker(state: ModelPickerState = {}, options: FormOptions & {onSubmit?: (selection: ModelSelection) => ActionResult | Promise<ActionResult>} = {}): ModelPicker {\n const prefix = options.idPrefix ?? uniqueId('pui-form') + '-';\n const block = formBlock(`${dialogHeading('Choose a model', 'model-title', 'model-dialog', 'PITH MODEL CATALOG')}<form id=\"model-form\">${modelEditorMarkup('picker')}<div id=\"model-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button type=\"button\" class=\"pui-secondary-button\" data-close=\"model-dialog\">Cancel</button><button type=\"submit\" class=\"pui-primary-button\" id=\"choose-model\" data-global-idle data-control-pending=\"true\" disabled>Use model</button></div></form>`, 'pui-model-picker', state, prefix);\n let editor: ReturnType<typeof createModelEditor> | undefined;\n let destroyed = false, pending = false, current = state;\n const form = block.field<HTMLFormElement>('model-form'), submit = block.field<HTMLButtonElement>('choose-model');\n const update = (next: Readonly<ModelPickerState>) => {if (destroyed) return; current = next; block.update(next); if (next.editor) {if (editor) editor.update(next.editor); else editor = createModelEditor(next.editor,{prefix:prefix + 'picker',element:block.element});} const loading = next.loading ?? !next.editor; block.parts.action(submit).update({disabled:next.disabled,pending:pending || loading});};\n const read = (): ModelSelection => editor?.read() || {provider:'',model:'',thinkingLevel:''};\n const submission = bindFormSubmission(form,{read,unavailable:()=>submit.disabled,onSubmit:options.onSubmit,onPending(value) {pending = value; update(current);},onError(error) {update({...current,error});}});\n update(state); return {...block,update,read,reset(selection) {submission.invalidate(); editor?.reset(selection);},focus() {editor?.focus();},destroy() {if (destroyed) return; destroyed = true; submission.destroy(); editor?.destroy(); block.destroy();}};\n}\nexport interface MCPConnectionItem {\n name: string; type: string; url?: string; command?: string; args?: readonly string[]; enabled: boolean;\n hasBearerToken?: boolean; status?: string; statusLabel: string; envKeys?: readonly string[]; error?: string; oauth?: boolean; signedIn?: boolean;\n}\nexport interface MCPConnectionListState extends FormFeedback { entries: readonly MCPConnectionItem[] }\ntype MCPConnectionDOM = {element: HTMLElement; name: HTMLElement; address: HTMLElement; enabled: HTMLElement; status: HTMLElement; env: HTMLElement; error: HTMLElement; actions: HTMLElement; signIn: HTMLButtonElement; signOut: HTMLButtonElement; edit: HTMLButtonElement; toggle: HTMLButtonElement; remove: HTMLButtonElement};\nexport function createMCPConnectionList(initial: MCPConnectionListState): UIBlock<MCPConnectionListState> {\n const element = document.createElement('div'); element.className = 'pui-mcp-connection-list';\n const parts = adoptProductParts(element); let destroyed = false; const entries = new Map<string, MCPConnectionDOM>();\n const empty = document.createElement('p'); empty.className = 'pui-feature-hint'; empty.textContent = 'No connections yet. Add an HTTP server or an installed local MCP command below. Tools are discovered on demand using tool search and Codemode.';\n function createEntry(): MCPConnectionDOM {\n const root = document.createElement('article'); root.className = 'pui-connection-card';\n root.innerHTML = '<div class=\"pui-connection-card-heading\"><strong></strong></div><p class=\"pui-file-path\"></p><p class=\"pui-feature-hint\"></p><p class=\"pui-connection-status\" role=\"status\"></p><p class=\"pui-feature-hint\" hidden></p><p class=\"pui-form-error\"></p><div class=\"pui-file-actions\"></div>';\n const paragraphs = root.querySelectorAll<HTMLElement>('p'); const actions = root.querySelector<HTMLElement>('.pui-file-actions')!;\n const button = (label: string, destructive = false) => {const node = document.createElement('button'); node.type = 'button'; node.className = destructive ? 'pui-secondary-button pui-destructive-button' : 'pui-secondary-button'; node.textContent = label; return node;};\n const signIn = button('Sign in'); signIn.dataset.sdk = 'mcp-login'; const signOut = button('Sign out'); signOut.dataset.sdk = 'mcp-logout';\n const edit = button('Edit'); const toggle = button('Disable'); const remove = button('Delete',true);\n for (const node of [toggle,remove]) {node.dataset.globalIdle = ''; node.dataset.idleAction = '';}\n actions.append(edit,toggle,remove);\n return {element:root,name:root.querySelector('strong')!,address:paragraphs[0],enabled:paragraphs[1],status:paragraphs[2],env:paragraphs[3],error:paragraphs[4],actions,signIn,signOut,edit,toggle,remove};\n }\n const update = (state: Readonly<MCPConnectionListState>) => {\n if (destroyed) return; const current = new Set<string>(); let cursor: Element | null = element.firstElementChild;\n for (const item of state.entries) {\n current.add(item.name); let entry = entries.get(item.name); if (!entry) {entry = createEntry(); entries.set(item.name,entry);}\n setText(entry.name, item.name); entry.element.dataset.connectionKey = item.name;\n setText(entry.address, item.type === 'http' ? item.url || '' : [item.command,...(item.args || [])].join(' '));\n setText(entry.enabled, `${item.enabled ? 'Enabled' : 'Disabled'}${item.hasBearerToken ? ' · Token configured' : ''}`);\n setText(entry.status, item.statusLabel); entry.status.classList.toggle('pui-is-error',item.enabled && item.status === 'error');\n entry.env.hidden = !item.envKeys?.length; setText(entry.env, item.envKeys?.length ? 'Saved environment keys: '+item.envKeys.join(', ') : ''); parts.feedback(entry.error).update({message:item.error || '',tone:'error'});\n setText(entry.signIn, item.signedIn ? 'Sign in again' : 'Sign in'); entry.signIn.dataset.id = entry.signOut.dataset.id = item.name;\n entry.edit.dataset.mcpEdit = item.name; entry.toggle.dataset.mcpToggle = item.name; entry.remove.dataset.mcpRemove = item.name; setText(entry.toggle, item.enabled ? 'Disable' : 'Enable');\n if (item.oauth) {if (entry.signIn.parentElement !== entry.actions) entry.actions.insertBefore(entry.signIn,entry.edit);} else entry.signIn.remove();\n if (item.oauth && item.signedIn) {if (entry.signOut.parentElement !== entry.actions) entry.actions.insertBefore(entry.signOut,entry.edit);} else entry.signOut.remove();\n for (const button of [entry.signIn,entry.signOut,entry.edit,entry.toggle,entry.remove]) parts.action(button).update({disabled:!!state.disabled});\n if (entry.element !== cursor) element.insertBefore(entry.element,cursor); cursor = entry.element.nextElementSibling;\n }\n for (const [key,entry] of entries) if (!current.has(key)) {entry.element.remove(); entries.delete(key);}\n if (!state.entries.length) {if (empty.parentElement !== element) element.append(empty);} else empty.remove(); parts.update();\n };\n update(initial); return {element,update,destroy() {if (destroyed) return; destroyed = true; parts.destroy(); entries.clear(); element.remove();}};\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ActionResult, type UIBlock } from '../core.js';
|
|
2
|
+
export interface ProviderLoginState {
|
|
3
|
+
phase: string;
|
|
4
|
+
message: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
prompt?: string;
|
|
8
|
+
promptType?: string;
|
|
9
|
+
options?: readonly {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}[] | null;
|
|
13
|
+
error?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function createProviderLoginPanel(initial: ProviderLoginState, options?: {
|
|
17
|
+
idPrefix?: string;
|
|
18
|
+
onAnswer?: (answer: string) => void | ActionResult | Promise<void | ActionResult>;
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}): UIBlock<ProviderLoginState>;
|
|
22
|
+
//# sourceMappingURL=provider-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-login.d.ts","sourceRoot":"","sources":["../../src/forms/provider-login.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,YAAY,EAAE,KAAK,OAAO,EAAC,MAAM,YAAY,CAAC;AAGvE,MAAM,WAAW,kBAAkB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,EAAE,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAC;AACpO,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,GAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,GAAG,YAAY,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4CpQ"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { scopeIds, localField } from './identity.js';
|
|
2
|
+
import { Generation } from '../core.js';
|
|
3
|
+
import { uniqueId } from '../dom.js';
|
|
4
|
+
import { adoptProductParts } from '../foundations.js';
|
|
5
|
+
export function createProviderLoginPanel(initial, options = {}) {
|
|
6
|
+
const element = document.createElement('div');
|
|
7
|
+
element.className = 'pui-provider-login';
|
|
8
|
+
const prefix = options.idPrefix ?? uniqueId('pui-login') + '-';
|
|
9
|
+
element.innerHTML = `<p class="pui-provider-login-status" role="status"></p><p data-login-link hidden><a target="_blank" rel="noopener noreferrer">Open sign-in page in your browser ↗</a></p><p data-login-code hidden>Verification code: <strong></strong></p><form id="oauth-answer" hidden><label class="pui-field-label" for="oauth-value"></label><span data-login-input></span><button type="submit" class="pui-primary-button">Continue</button></form><div id="oauth-error" class="pui-form-error" role="alert"></div><div class="pui-modal-footer"><button type="button" class="pui-secondary-button" data-close="oauth-dialog" hidden>Close</button><button type="button" class="pui-secondary-button" data-sdk="cancel-login">Cancel sign-in</button></div>`;
|
|
10
|
+
scopeIds(element, prefix);
|
|
11
|
+
const field = (id) => localField(element, prefix + id);
|
|
12
|
+
const form = field('oauth-answer'), status = element.querySelector('.pui-provider-login-status'), inputHost = element.querySelector('[data-login-input]'), submit = form.querySelector('button');
|
|
13
|
+
const link = element.querySelector('a'), code = element.querySelector('[data-login-code]'), error = field('oauth-error');
|
|
14
|
+
const generation = new Generation(), abort = new AbortController(), parts = adoptProductParts(element);
|
|
15
|
+
let signature = '', destroyed = false, pending = false, localError = '', state = initial;
|
|
16
|
+
function renderDisabled() { parts.action(submit).update({ disabled: state.disabled, pending }); }
|
|
17
|
+
const update = (login) => {
|
|
18
|
+
if (destroyed)
|
|
19
|
+
return;
|
|
20
|
+
state = login;
|
|
21
|
+
const next = JSON.stringify([login.phase, login.prompt, login.promptType, login.options]);
|
|
22
|
+
if (next !== signature) {
|
|
23
|
+
signature = next;
|
|
24
|
+
generation.invalidate();
|
|
25
|
+
pending = false;
|
|
26
|
+
localError = '';
|
|
27
|
+
inputHost.replaceChildren();
|
|
28
|
+
if (login.phase === 'prompt') {
|
|
29
|
+
const input = document.createElement(login.options?.length ? 'select' : 'input');
|
|
30
|
+
input.id = prefix + 'oauth-value';
|
|
31
|
+
if (input instanceof HTMLInputElement) {
|
|
32
|
+
input.type = login.promptType === 'secret' ? 'password' : 'text';
|
|
33
|
+
input.required = true;
|
|
34
|
+
input.autocomplete = 'off';
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
input.className = 'pui-feature-select';
|
|
38
|
+
for (const item of login.options || []) {
|
|
39
|
+
const option = document.createElement('option');
|
|
40
|
+
option.value = item.id;
|
|
41
|
+
option.textContent = item.label;
|
|
42
|
+
input.append(option);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
inputHost.append(input);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
status.textContent = login.message;
|
|
49
|
+
status.classList.toggle('pui-form-error', login.phase === 'error');
|
|
50
|
+
status.setAttribute('role', login.phase === 'error' ? 'alert' : 'status');
|
|
51
|
+
let href = '';
|
|
52
|
+
try {
|
|
53
|
+
const url = new URL(login.url || '');
|
|
54
|
+
if (url.protocol === 'https:' || url.protocol === 'http:')
|
|
55
|
+
href = url.href;
|
|
56
|
+
}
|
|
57
|
+
catch { }
|
|
58
|
+
link.parentElement.hidden = !href;
|
|
59
|
+
if (href)
|
|
60
|
+
link.href = href;
|
|
61
|
+
else
|
|
62
|
+
link.removeAttribute('href');
|
|
63
|
+
code.hidden = !login.code;
|
|
64
|
+
code.querySelector('strong').textContent = login.code || '';
|
|
65
|
+
form.hidden = login.phase !== 'prompt';
|
|
66
|
+
form.querySelector('label').textContent = login.prompt || '';
|
|
67
|
+
parts.update();
|
|
68
|
+
parts.feedback(error).update({ message: login.error || localError, tone: 'error' });
|
|
69
|
+
const complete = ['complete', 'error'].includes(login.phase);
|
|
70
|
+
element.querySelector('[data-close]').hidden = !complete;
|
|
71
|
+
element.querySelector('[data-sdk]').hidden = complete;
|
|
72
|
+
renderDisabled();
|
|
73
|
+
};
|
|
74
|
+
element.addEventListener('submit', async (event) => {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
if (pending || state.disabled || state.phase !== 'prompt' || !options.onAnswer)
|
|
77
|
+
return;
|
|
78
|
+
const input = field('oauth-value');
|
|
79
|
+
if (!input.checkValidity()) {
|
|
80
|
+
input.reportValidity();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const seq = generation.next();
|
|
84
|
+
pending = true;
|
|
85
|
+
localError = '';
|
|
86
|
+
error.textContent = '';
|
|
87
|
+
renderDisabled();
|
|
88
|
+
try {
|
|
89
|
+
const result = await options.onAnswer(parts.control(input).getValue());
|
|
90
|
+
if (generation.current(seq) && result && !result.ok) {
|
|
91
|
+
localError = result.error;
|
|
92
|
+
parts.feedback(error).update({ message: localError, tone: 'error' });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (reason) {
|
|
96
|
+
if (generation.current(seq)) {
|
|
97
|
+
localError = reason instanceof Error ? reason.message : String(reason);
|
|
98
|
+
parts.feedback(error).update({ message: localError, tone: 'error' });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
if (generation.current(seq)) {
|
|
103
|
+
pending = false;
|
|
104
|
+
renderDisabled();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, { signal: abort.signal });
|
|
108
|
+
element.addEventListener('click', event => { const target = event.target.closest('button'); if (target?.dataset.sdk === 'cancel-login')
|
|
109
|
+
options.onCancel?.(); if (target?.dataset.close === prefix + 'oauth-dialog')
|
|
110
|
+
options.onClose?.(); }, { signal: abort.signal });
|
|
111
|
+
update(initial);
|
|
112
|
+
return { element, update, destroy() { if (destroyed)
|
|
113
|
+
return; destroyed = true; generation.destroy(); abort.abort(); for (const input of element.querySelectorAll('input'))
|
|
114
|
+
parts.control(input).reset(''); parts.destroy(); element.remove(); } };
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=provider-login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-login.js","sourceRoot":"","sources":["../../src/forms/provider-login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,UAAU,EAAkC,MAAM,YAAY,CAAC;AACvE,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AACnC,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,wBAAwB,CAAC,OAA2B,EAAE,UAA+J,EAAE;IACtO,MAAM,OAAO,GAAG,QAAQ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;QAAE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,CAAC,EAAE,EAAC,MAAM,EAAC,KAAK,CAAC,MAAM,EAAC,CAAC,CAAC;IACtS,MAAM,CAAC,OAAO,CAAC,CAAC;IAAC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,KAAI,IAAI,SAAS;YAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,gBAAgB,CAAmB,OAAO,CAAC;YAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,EAAC,CAAC;AAClR,CAAC","sourcesContent":["import {scopeIds, localField} from './identity.js';\nimport {Generation, type ActionResult, type UIBlock} from '../core.js';\nimport {uniqueId} from '../dom.js';\nimport {adoptProductParts} from '../foundations.js';\nexport interface ProviderLoginState {phase: string; message: string; url?: string; code?: string; prompt?: string; promptType?: string; options?: readonly {id: string; label: string}[] | null; error?: string; disabled?: boolean}\nexport function createProviderLoginPanel(initial: ProviderLoginState, options: {idPrefix?: string; onAnswer?: (answer: string) => void | ActionResult | Promise<void | ActionResult>; onCancel?: () => void; onClose?: () => void} = {}): UIBlock<ProviderLoginState> {\n const element = document.createElement('div'); element.className = 'pui-provider-login'; const prefix = options.idPrefix ?? uniqueId('pui-login') + '-';\n element.innerHTML = `<p class=\"pui-provider-login-status\" role=\"status\"></p><p data-login-link hidden><a target=\"_blank\" rel=\"noopener noreferrer\">Open sign-in page in your browser ↗</a></p><p data-login-code hidden>Verification code: <strong></strong></p><form id=\"oauth-answer\" hidden><label class=\"pui-field-label\" for=\"oauth-value\"></label><span data-login-input></span><button type=\"submit\" class=\"pui-primary-button\">Continue</button></form><div id=\"oauth-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button type=\"button\" class=\"pui-secondary-button\" data-close=\"oauth-dialog\" hidden>Close</button><button type=\"button\" class=\"pui-secondary-button\" data-sdk=\"cancel-login\">Cancel sign-in</button></div>`;\n scopeIds(element, prefix);\n const field = <T extends HTMLElement = HTMLElement>(id: string): T => localField<T>(element, prefix + id);\n const form = field<HTMLFormElement>('oauth-answer'), status = element.querySelector<HTMLElement>('.pui-provider-login-status')!, inputHost = element.querySelector<HTMLElement>('[data-login-input]')!, submit = form.querySelector<HTMLButtonElement>('button')!;\n const link = element.querySelector<HTMLAnchorElement>('a')!, code = element.querySelector<HTMLElement>('[data-login-code]')!, error = field('oauth-error');\n const generation = new Generation(), abort = new AbortController(), parts = adoptProductParts(element);\n let signature = '', destroyed = false, pending = false, localError = '', state: Readonly<ProviderLoginState> = initial;\n function renderDisabled(): void {parts.action(submit).update({disabled:state.disabled,pending});}\n const update = (login: Readonly<ProviderLoginState>) => {\n if (destroyed) return; state = login;\n const next = JSON.stringify([login.phase, login.prompt, login.promptType, login.options]);\n if (next !== signature) {\n signature = next; generation.invalidate(); pending = false; localError = '';\n inputHost.replaceChildren();\n if (login.phase === 'prompt') {\n const input = document.createElement(login.options?.length ? 'select' : 'input'); input.id = prefix + 'oauth-value';\n if (input instanceof HTMLInputElement) { input.type = login.promptType === 'secret' ? 'password' : 'text'; input.required = true; input.autocomplete = 'off'; }\n else { input.className = 'pui-feature-select'; for (const item of login.options || []) { const option = document.createElement('option'); option.value = item.id; option.textContent = item.label; input.append(option); } }\n inputHost.append(input);\n }\n }\n status.textContent = login.message; status.classList.toggle('pui-form-error', login.phase === 'error'); status.setAttribute('role', login.phase === 'error' ? 'alert' : 'status');\n let href = ''; try {const url = new URL(login.url || ''); if (url.protocol === 'https:' || url.protocol === 'http:') href = url.href;} catch {}\n link.parentElement!.hidden = !href; if (href) link.href = href; else link.removeAttribute('href');\n code.hidden = !login.code; code.querySelector('strong')!.textContent = login.code || '';\n form.hidden = login.phase !== 'prompt'; form.querySelector('label')!.textContent = login.prompt || '';\n parts.update(); parts.feedback(error).update({message:login.error || localError,tone:'error'});\n const complete = ['complete','error'].includes(login.phase);\n element.querySelector<HTMLButtonElement>('[data-close]')!.hidden = !complete;\n element.querySelector<HTMLButtonElement>('[data-sdk]')!.hidden = complete;\n renderDisabled();\n };\n element.addEventListener('submit', async event => {\n event.preventDefault(); if (pending || state.disabled || state.phase !== 'prompt' || !options.onAnswer) return;\n const input = field<HTMLInputElement | HTMLSelectElement>('oauth-value'); if (!input.checkValidity()) {input.reportValidity(); return;}\n const seq = generation.next(); pending = true; localError = ''; error.textContent = ''; renderDisabled();\n try { const result = await options.onAnswer(parts.control(input).getValue()); if (generation.current(seq) && result && !result.ok) {localError = result.error; parts.feedback(error).update({message:localError,tone:'error'});} }\n catch (reason) {if (generation.current(seq)) {localError = reason instanceof Error ? reason.message : String(reason); parts.feedback(error).update({message:localError,tone:'error'});}}\n finally {if (generation.current(seq)) {pending = false; renderDisabled();}}\n }, {signal:abort.signal});\n element.addEventListener('click', event => {const target = (event.target as HTMLElement).closest<HTMLButtonElement>('button'); if (target?.dataset.sdk === 'cancel-login') options.onCancel?.(); if (target?.dataset.close === prefix + 'oauth-dialog') options.onClose?.();}, {signal:abort.signal});\n update(initial); return {element, update, destroy() {if (destroyed) return; destroyed = true; generation.destroy(); abort.abort(); for (const input of element.querySelectorAll<HTMLInputElement>('input')) parts.control(input).reset(''); parts.destroy(); element.remove();}};\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ActionResult, UIBlock } from '../core.js';
|
|
2
|
+
export interface ResourceEditorState {
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
workspacePath: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
kind: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
content: string;
|
|
9
|
+
editable: boolean;
|
|
10
|
+
workspaceBusy: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ResourceDraft {
|
|
15
|
+
name: string;
|
|
16
|
+
content: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createResourceEditor(state: ResourceEditorState, options?: {
|
|
19
|
+
idPrefix?: string;
|
|
20
|
+
onSubmit?: (draft: ResourceDraft) => ActionResult | Promise<ActionResult>;
|
|
21
|
+
onDelete?: () => void;
|
|
22
|
+
}): UIBlock<ResourceEditorState> & {
|
|
23
|
+
read(): ResourceDraft;
|
|
24
|
+
readonly form: HTMLFormElement;
|
|
25
|
+
readonly removeButton: HTMLButtonElement | null;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=resource-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-editor.d.ts","sourceRoot":"","sources":["../../src/forms/resource-editor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAGrD,MAAM,WAAW,mBAAmB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAC;AAC7N,MAAM,WAAW,aAAa;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC;AAC9D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,GAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG;IAAC,IAAI,IAAI,aAAa,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAC,CAc7U"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { scopeIds, bindFormSubmission } from './identity.js';
|
|
2
|
+
import { escape, uniqueId } from '../dom.js';
|
|
3
|
+
import { adoptProductParts } from '../foundations.js';
|
|
4
|
+
export function createResourceEditor(state, options = {}) {
|
|
5
|
+
const element = document.createElement('div');
|
|
6
|
+
element.className = 'pui-resource-editor';
|
|
7
|
+
element.innerHTML = `<p class="pui-file-path">${escape(state.path || state.workspacePath)}</p>${!state.editable ? `<p>${state.workspaceBusy ? 'Stop this workspace’s task before editing resources.' : 'Inherited instructions are read-only here. Add workspace instructions to specialize them.'}</p>` : ''}<form id="resource-form">${!state.path && state.kind !== 'instructions' ? '<label class="pui-field-label">Name<input id="resource-name" required pattern="[A-Za-z0-9]([A-Za-z0-9_]|-)*" placeholder="my-resource" /></label>' : ''}<label class="pui-field-label" for="resource-body">Markdown</label><textarea id="resource-body" class="pui-resource-editor" ${!state.editable ? 'readonly' : ''}>${escape(state.content)}</textarea><p class="pui-form-error" data-resource-error role="alert"></p><div class="pui-modal-footer">${state.path && state.editable ? '<button type="button" id="delete-resource" class="pui-secondary-button pui-destructive-button">Delete resource</button>' : ''}<button type="button" class="pui-secondary-button" data-close="sdk-dialog">${state.editable ? 'Cancel' : 'Close'}</button>${state.editable ? `<button type="submit" class="pui-primary-button" data-idle-action data-idle-workspace="${escape(state.workspaceId)}">Save</button>` : ''}</div></form>`;
|
|
8
|
+
const initialError = element.querySelector('[data-resource-error]');
|
|
9
|
+
initialError.textContent = state.error || '';
|
|
10
|
+
const name = element.querySelector('#resource-name');
|
|
11
|
+
if (name)
|
|
12
|
+
name.value = state.name || '';
|
|
13
|
+
const removeButton = element.querySelector('#delete-resource');
|
|
14
|
+
if (removeButton)
|
|
15
|
+
removeButton.dataset.resourceDelete = '';
|
|
16
|
+
const form = element.querySelector('#resource-form');
|
|
17
|
+
const body = element.querySelector('#resource-body');
|
|
18
|
+
let destroyed = false, pending = false;
|
|
19
|
+
scopeIds(element, options.idPrefix ?? uniqueId('pui-resource') + '-');
|
|
20
|
+
const parts = adoptProductParts(element), abort = new AbortController();
|
|
21
|
+
let current = state;
|
|
22
|
+
const read = () => ({ name: name ? parts.control(name).getValue() : '', content: parts.control(body).getValue() });
|
|
23
|
+
const update = (next) => { if (destroyed)
|
|
24
|
+
return; current = next; if (next.error !== undefined)
|
|
25
|
+
parts.feedback(initialError).update({ message: next.error, tone: 'error' }); for (const button of form.querySelectorAll('button[type="submit"], [data-resource-delete]'))
|
|
26
|
+
parts.action(button).update({ disabled: next.disabled, pending }); };
|
|
27
|
+
const submission = bindFormSubmission(form, { read, unavailable: () => !!current.disabled || !current.editable || current.workspaceBusy, onSubmit: options.onSubmit, onPending(value) { pending = value; update(current); }, onError(error) { update({ ...current, error }); } });
|
|
28
|
+
removeButton?.addEventListener('click', () => { if (!pending && !current.disabled)
|
|
29
|
+
options.onDelete?.(); }, { signal: abort.signal });
|
|
30
|
+
update(state);
|
|
31
|
+
return { element, form, removeButton, read, update, destroy() { if (destroyed)
|
|
32
|
+
return; destroyed = true; submission.destroy(); abort.abort(); parts.destroy(); element.remove(); } };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=resource-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-editor.js","sourceRoot":"","sources":["../../src/forms/resource-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,kBAAkB,EAAC,MAAM,eAAe,CA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O,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,EAAC,CAAC;AAC5L,CAAC","sourcesContent":["import {scopeIds,bindFormSubmission} from './identity.js';\nimport type {ActionResult,UIBlock} from '../core.js';\nimport { escape, uniqueId } from '../dom.js';\nimport {adoptProductParts} from '../foundations.js';\nexport interface ResourceEditorState {workspaceId: string; workspacePath: string; path?: string; kind: string; name?: string; content: string; editable: boolean; workspaceBusy: boolean; error?: string; disabled?: boolean}\nexport interface ResourceDraft {name: string; content: string}\nexport function createResourceEditor(state: ResourceEditorState, options: {idPrefix?: string; onSubmit?: (draft: ResourceDraft) => ActionResult | Promise<ActionResult>; onDelete?: () => void} = {}): UIBlock<ResourceEditorState> & {read(): ResourceDraft; readonly form: HTMLFormElement; readonly removeButton: HTMLButtonElement | null} {\n const element = document.createElement('div'); element.className = 'pui-resource-editor'; element.innerHTML = `<p class=\"pui-file-path\">${escape(state.path || state.workspacePath)}</p>${!state.editable ? `<p>${state.workspaceBusy ? 'Stop this workspace’s task before editing resources.' : 'Inherited instructions are read-only here. Add workspace instructions to specialize them.'}</p>` : ''}<form id=\"resource-form\">${!state.path && state.kind !== 'instructions' ? '<label class=\"pui-field-label\">Name<input id=\"resource-name\" required pattern=\"[A-Za-z0-9]([A-Za-z0-9_]|-)*\" placeholder=\"my-resource\" /></label>' : ''}<label class=\"pui-field-label\" for=\"resource-body\">Markdown</label><textarea id=\"resource-body\" class=\"pui-resource-editor\" ${!state.editable ? 'readonly' : ''}>${escape(state.content)}</textarea><p class=\"pui-form-error\" data-resource-error role=\"alert\"></p><div class=\"pui-modal-footer\">${state.path && state.editable ? '<button type=\"button\" id=\"delete-resource\" class=\"pui-secondary-button pui-destructive-button\">Delete resource</button>' : ''}<button type=\"button\" class=\"pui-secondary-button\" data-close=\"sdk-dialog\">${state.editable ? 'Cancel' : 'Close'}</button>${state.editable ? `<button type=\"submit\" class=\"pui-primary-button\" data-idle-action data-idle-workspace=\"${escape(state.workspaceId)}\">Save</button>` : ''}</div></form>`;\n const initialError = element.querySelector<HTMLElement>('[data-resource-error]')!; initialError.textContent = state.error || '';\n const name = element.querySelector<HTMLInputElement>('#resource-name');\n if (name) name.value = state.name || '';\n const removeButton = element.querySelector<HTMLButtonElement>('#delete-resource');\n if (removeButton) removeButton.dataset.resourceDelete = '';\n const form = element.querySelector<HTMLFormElement>('#resource-form')!; const body = element.querySelector<HTMLTextAreaElement>('#resource-body')!; let destroyed = false, pending = false; scopeIds(element, options.idPrefix ?? uniqueId('pui-resource') + '-');\n const parts = adoptProductParts(element), abort = new AbortController(); let current = state;\n const read = (): ResourceDraft => ({name:name ? parts.control(name).getValue() : '',content:parts.control(body).getValue()});\n const update = (next: Readonly<ResourceEditorState>) => {if (destroyed) return; current = next; if (next.error !== undefined) parts.feedback(initialError).update({message:next.error,tone:'error'}); for (const button of form.querySelectorAll<HTMLButtonElement>('button[type=\"submit\"], [data-resource-delete]')) parts.action(button).update({disabled:next.disabled,pending});};\n const submission = bindFormSubmission(form,{read,unavailable:()=>!!current.disabled || !current.editable || current.workspaceBusy,onSubmit:options.onSubmit,onPending(value) {pending = value; update(current);},onError(error) {update({...current,error});}});\n removeButton?.addEventListener('click',() => {if (!pending && !current.disabled) options.onDelete?.();}, {signal:abort.signal});\n update(state); return {element,form,removeButton,read,update,destroy() {if (destroyed) return; destroyed = true; submission.destroy(); abort.abort(); parts.destroy(); element.remove();}};\n}\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { Density, Intent, UIAction } from './core.js';
|
|
2
|
+
/** Private controllers shared by factories and the retained product templates.
|
|
3
|
+
* Adoption does not replace nodes, move controls or infer business availability.
|
|
4
|
+
*/
|
|
5
|
+
export interface ActionState {
|
|
6
|
+
label?: string;
|
|
7
|
+
intent?: Intent;
|
|
8
|
+
density?: Density;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
pending?: boolean;
|
|
11
|
+
icon?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
appearance?: 'standard' | 'secondary';
|
|
14
|
+
}
|
|
15
|
+
export interface ActionController {
|
|
16
|
+
readonly element: HTMLButtonElement;
|
|
17
|
+
update(state: Readonly<ActionState>): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function adoptAction(node: HTMLButtonElement, options?: {
|
|
21
|
+
caption?: HTMLElement;
|
|
22
|
+
onAction?: UIAction;
|
|
23
|
+
onError?: (message: string) => void;
|
|
24
|
+
}): ActionController;
|
|
25
|
+
export type NativeControl = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
|
|
26
|
+
export interface NativeSelectOption {
|
|
27
|
+
value: string;
|
|
28
|
+
label: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Reconcile native options by their stable value without replacing the select.
|
|
32
|
+
* Callers decide the fallback when a preferred value has disappeared.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reconcileSelectOptions(control: HTMLSelectElement, entries: readonly NativeSelectOption[], preferred?: string): void;
|
|
35
|
+
export interface NativeControlState {
|
|
36
|
+
label?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
readOnly?: boolean;
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface NativeControlController {
|
|
45
|
+
readonly element: NativeControl;
|
|
46
|
+
update(state: Readonly<NativeControlState>): void;
|
|
47
|
+
getValue(): string;
|
|
48
|
+
getChecked(): boolean;
|
|
49
|
+
reset(value: string | boolean): void;
|
|
50
|
+
focus(): void;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
}
|
|
53
|
+
export declare function adoptNativeControl(control: NativeControl, options?: {
|
|
54
|
+
label?: HTMLLabelElement;
|
|
55
|
+
description?: HTMLElement;
|
|
56
|
+
error?: HTMLElement;
|
|
57
|
+
onInput?: (value: string, event: Event) => void;
|
|
58
|
+
onChange?: (value: string, event: Event) => void;
|
|
59
|
+
}): NativeControlController;
|
|
60
|
+
export interface FeedbackState {
|
|
61
|
+
message: string;
|
|
62
|
+
tone?: 'info' | 'neutral' | 'success' | 'warning' | 'error';
|
|
63
|
+
}
|
|
64
|
+
export interface FeedbackController {
|
|
65
|
+
readonly element: HTMLElement;
|
|
66
|
+
update(state: Readonly<FeedbackState>): void;
|
|
67
|
+
destroy(): void;
|
|
68
|
+
}
|
|
69
|
+
export declare function adoptFeedback(node: HTMLElement, options: {
|
|
70
|
+
presentation: 'notice' | 'inline' | 'status';
|
|
71
|
+
autoHide?: boolean;
|
|
72
|
+
}): FeedbackController;
|
|
73
|
+
export interface ActionLayoutState {
|
|
74
|
+
align?: 'start' | 'end' | 'between';
|
|
75
|
+
density?: Density;
|
|
76
|
+
label?: string;
|
|
77
|
+
}
|
|
78
|
+
export declare function adoptActionLayout(node: HTMLElement, kind: 'actions' | 'toolbar'): {
|
|
79
|
+
readonly element: HTMLElement;
|
|
80
|
+
update(state: Readonly<ActionLayoutState>): void;
|
|
81
|
+
destroy(): void;
|
|
82
|
+
};
|
|
83
|
+
/** Owned controllers for existing product templates; not a renderer or observer.
|
|
84
|
+
* Controllers are lazy. Reconciliation prunes owned handles without rescanning
|
|
85
|
+
* long message histories or allocating a controller for every static button.
|
|
86
|
+
*/
|
|
87
|
+
export declare function adoptProductParts(owner: HTMLElement): {
|
|
88
|
+
update(): void;
|
|
89
|
+
action(node: HTMLButtonElement): ActionController;
|
|
90
|
+
control(node: NativeControl): NativeControlController;
|
|
91
|
+
feedback(node: HTMLElement): FeedbackController;
|
|
92
|
+
layout(node: HTMLElement, kind: 'actions' | 'toolbar'): ReturnType<typeof adoptActionLayout>;
|
|
93
|
+
destroy(): void;
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=foundations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foundations.d.ts","sourceRoot":"","sources":["../src/foundations.ts"],"names":[],"mappings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