@aparte/core 0.2.0-alpha.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.
Files changed (175) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +53 -0
  3. package/dist/client/aparte-client.d.ts +326 -0
  4. package/dist/client/aparte-client.d.ts.map +1 -0
  5. package/dist/client/stream-adapter.d.ts +197 -0
  6. package/dist/client/stream-adapter.d.ts.map +1 -0
  7. package/dist/components/bubble/aparte-chat-bubble.d.ts +153 -0
  8. package/dist/components/bubble/aparte-chat-bubble.d.ts.map +1 -0
  9. package/dist/components/bubble/bubble-sync.d.ts +44 -0
  10. package/dist/components/bubble/bubble-sync.d.ts.map +1 -0
  11. package/dist/components/bubble/index.d.ts +4 -0
  12. package/dist/components/bubble/index.d.ts.map +1 -0
  13. package/dist/components/chat/aparte-chat.d.ts +49 -0
  14. package/dist/components/chat/aparte-chat.d.ts.map +1 -0
  15. package/dist/components/chat/index.d.ts +2 -0
  16. package/dist/components/chat/index.d.ts.map +1 -0
  17. package/dist/components/composer/aparte-composer-action.d.ts +37 -0
  18. package/dist/components/composer/aparte-composer-action.d.ts.map +1 -0
  19. package/dist/components/composer/aparte-composer-add-attachment.d.ts +27 -0
  20. package/dist/components/composer/aparte-composer-add-attachment.d.ts.map +1 -0
  21. package/dist/components/composer/aparte-composer-attachments.d.ts +26 -0
  22. package/dist/components/composer/aparte-composer-attachments.d.ts.map +1 -0
  23. package/dist/components/composer/aparte-composer-cancel.d.ts +21 -0
  24. package/dist/components/composer/aparte-composer-cancel.d.ts.map +1 -0
  25. package/dist/components/composer/aparte-composer-input.d.ts +63 -0
  26. package/dist/components/composer/aparte-composer-input.d.ts.map +1 -0
  27. package/dist/components/composer/aparte-composer-send.d.ts +25 -0
  28. package/dist/components/composer/aparte-composer-send.d.ts.map +1 -0
  29. package/dist/components/composer/aparte-composer.d.ts +150 -0
  30. package/dist/components/composer/aparte-composer.d.ts.map +1 -0
  31. package/dist/components/composer/index.d.ts +9 -0
  32. package/dist/components/composer/index.d.ts.map +1 -0
  33. package/dist/components/conversation-list/aparte-conversation-list.d.ts +50 -0
  34. package/dist/components/conversation-list/aparte-conversation-list.d.ts.map +1 -0
  35. package/dist/components/conversation-list/index.d.ts +2 -0
  36. package/dist/components/conversation-list/index.d.ts.map +1 -0
  37. package/dist/components/elicitation/aparte-elicitation.d.ts +29 -0
  38. package/dist/components/elicitation/aparte-elicitation.d.ts.map +1 -0
  39. package/dist/components/index.d.ts +10 -0
  40. package/dist/components/index.d.ts.map +1 -0
  41. package/dist/components/status/aparte-chat-status.d.ts +34 -0
  42. package/dist/components/status/aparte-chat-status.d.ts.map +1 -0
  43. package/dist/components/status/index.d.ts +2 -0
  44. package/dist/components/status/index.d.ts.map +1 -0
  45. package/dist/components/viewport/aparte-chat-viewport.d.ts +358 -0
  46. package/dist/components/viewport/aparte-chat-viewport.d.ts.map +1 -0
  47. package/dist/components/viewport/index.d.ts +2 -0
  48. package/dist/components/viewport/index.d.ts.map +1 -0
  49. package/dist/config/action-provider.d.ts +59 -0
  50. package/dist/config/action-provider.d.ts.map +1 -0
  51. package/dist/config/aparte-config.d.ts +490 -0
  52. package/dist/config/aparte-config.d.ts.map +1 -0
  53. package/dist/config/attachment-renderer.d.ts +28 -0
  54. package/dist/config/attachment-renderer.d.ts.map +1 -0
  55. package/dist/config/avatar-provider.d.ts +35 -0
  56. package/dist/config/avatar-provider.d.ts.map +1 -0
  57. package/dist/config/bubble-shell-renderer.d.ts +41 -0
  58. package/dist/config/bubble-shell-renderer.d.ts.map +1 -0
  59. package/dist/config/config-context.d.ts +47 -0
  60. package/dist/config/config-context.d.ts.map +1 -0
  61. package/dist/config/error-renderer.d.ts +26 -0
  62. package/dist/config/error-renderer.d.ts.map +1 -0
  63. package/dist/config/icon-provider.d.ts +63 -0
  64. package/dist/config/icon-provider.d.ts.map +1 -0
  65. package/dist/config/index.d.ts +19 -0
  66. package/dist/config/index.d.ts.map +1 -0
  67. package/dist/config/locale.d.ts +60 -0
  68. package/dist/config/locale.d.ts.map +1 -0
  69. package/dist/config/sanitize.d.ts +31 -0
  70. package/dist/config/sanitize.d.ts.map +1 -0
  71. package/dist/config/sibling-nav-renderer.d.ts +27 -0
  72. package/dist/config/sibling-nav-renderer.d.ts.map +1 -0
  73. package/dist/config/skeleton-provider.d.ts +26 -0
  74. package/dist/config/skeleton-provider.d.ts.map +1 -0
  75. package/dist/config/status-renderer.d.ts +23 -0
  76. package/dist/config/status-renderer.d.ts.map +1 -0
  77. package/dist/conversations/conversation-controller.d.ts +126 -0
  78. package/dist/conversations/conversation-controller.d.ts.map +1 -0
  79. package/dist/conversations/conversation-manager.d.ts +98 -0
  80. package/dist/conversations/conversation-manager.d.ts.map +1 -0
  81. package/dist/conversations/index.d.ts +5 -0
  82. package/dist/conversations/index.d.ts.map +1 -0
  83. package/dist/conversations/types.d.ts +172 -0
  84. package/dist/conversations/types.d.ts.map +1 -0
  85. package/dist/custom-elements.json +15833 -0
  86. package/dist/elicitation/index.d.ts +20 -0
  87. package/dist/elicitation/index.d.ts.map +1 -0
  88. package/dist/elicitation/panel.d.ts +18 -0
  89. package/dist/elicitation/panel.d.ts.map +1 -0
  90. package/dist/elicitation/types.d.ts +98 -0
  91. package/dist/elicitation/types.d.ts.map +1 -0
  92. package/dist/host/aparte-chat-host.d.ts +176 -0
  93. package/dist/host/aparte-chat-host.d.ts.map +1 -0
  94. package/dist/host/index.d.ts +2 -0
  95. package/dist/host/index.d.ts.map +1 -0
  96. package/dist/index-D89k-n2Q.js +6294 -0
  97. package/dist/index-D89k-n2Q.js.map +1 -0
  98. package/dist/index.css +2554 -0
  99. package/dist/index.d.ts +62 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +3763 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/index.node.d.ts +53 -0
  104. package/dist/index.node.d.ts.map +1 -0
  105. package/dist/index.node.js +49 -0
  106. package/dist/index.node.js.map +1 -0
  107. package/dist/interop/element-props.d.ts +23 -0
  108. package/dist/interop/element-props.d.ts.map +1 -0
  109. package/dist/parsers/aparte-event-stream.d.ts +13 -0
  110. package/dist/parsers/aparte-event-stream.d.ts.map +1 -0
  111. package/dist/parsers/aparte-stream-parser.d.ts +137 -0
  112. package/dist/parsers/aparte-stream-parser.d.ts.map +1 -0
  113. package/dist/parsers/index.d.ts +4 -0
  114. package/dist/parsers/index.d.ts.map +1 -0
  115. package/dist/primitives/index.d.ts +8 -0
  116. package/dist/primitives/index.d.ts.map +1 -0
  117. package/dist/primitives/progress-spinner/aparte-progress-spinner.d.ts +25 -0
  118. package/dist/primitives/progress-spinner/aparte-progress-spinner.d.ts.map +1 -0
  119. package/dist/primitives/progress-spinner/index.d.ts +2 -0
  120. package/dist/primitives/progress-spinner/index.d.ts.map +1 -0
  121. package/dist/primitives/select/aparte-optgroup.d.ts +32 -0
  122. package/dist/primitives/select/aparte-optgroup.d.ts.map +1 -0
  123. package/dist/primitives/select/aparte-option.d.ts +30 -0
  124. package/dist/primitives/select/aparte-option.d.ts.map +1 -0
  125. package/dist/primitives/select/aparte-select.d.ts +74 -0
  126. package/dist/primitives/select/aparte-select.d.ts.map +1 -0
  127. package/dist/primitives/select/index.d.ts +9 -0
  128. package/dist/primitives/select/index.d.ts.map +1 -0
  129. package/dist/renderers/index.d.ts +5 -0
  130. package/dist/renderers/index.d.ts.map +1 -0
  131. package/dist/renderers/segment-renderers.d.ts +31 -0
  132. package/dist/renderers/segment-renderers.d.ts.map +1 -0
  133. package/dist/runtime/message-repository.d.ts +111 -0
  134. package/dist/runtime/message-repository.d.ts.map +1 -0
  135. package/dist/transport/backend-handler.d.ts +50 -0
  136. package/dist/transport/backend-handler.d.ts.map +1 -0
  137. package/dist/transport/backend-transport.d.ts +39 -0
  138. package/dist/transport/backend-transport.d.ts.map +1 -0
  139. package/dist/transport/direct-transport.d.ts +36 -0
  140. package/dist/transport/direct-transport.d.ts.map +1 -0
  141. package/dist/transport/index.d.ts +6 -0
  142. package/dist/transport/index.d.ts.map +1 -0
  143. package/dist/transport/types.d.ts +73 -0
  144. package/dist/transport/types.d.ts.map +1 -0
  145. package/dist/types/chat.d.ts +223 -0
  146. package/dist/types/chat.d.ts.map +1 -0
  147. package/dist/types/errors.d.ts +25 -0
  148. package/dist/types/errors.d.ts.map +1 -0
  149. package/dist/types/event-map.d.ts +41 -0
  150. package/dist/types/event-map.d.ts.map +1 -0
  151. package/dist/types/events.d.ts +290 -0
  152. package/dist/types/events.d.ts.map +1 -0
  153. package/dist/types/imperative-api.d.ts +38 -0
  154. package/dist/types/imperative-api.d.ts.map +1 -0
  155. package/dist/types/index.d.ts +22 -0
  156. package/dist/types/index.d.ts.map +1 -0
  157. package/dist/types/model-provider.d.ts +229 -0
  158. package/dist/types/model-provider.d.ts.map +1 -0
  159. package/dist/types/models.d.ts +173 -0
  160. package/dist/types/models.d.ts.map +1 -0
  161. package/dist/types/parsers.d.ts +42 -0
  162. package/dist/types/parsers.d.ts.map +1 -0
  163. package/dist/types/providers.d.ts +93 -0
  164. package/dist/types/providers.d.ts.map +1 -0
  165. package/dist/types/segments.d.ts +221 -0
  166. package/dist/types/segments.d.ts.map +1 -0
  167. package/dist/types/theming.d.ts +44 -0
  168. package/dist/types/theming.d.ts.map +1 -0
  169. package/dist/types/tools.d.ts +98 -0
  170. package/dist/types/tools.d.ts.map +1 -0
  171. package/dist/utils/assert-never.d.ts +9 -0
  172. package/dist/utils/assert-never.d.ts.map +1 -0
  173. package/dist/utils/css-escape.d.ts +15 -0
  174. package/dist/utils/css-escape.d.ts.map +1 -0
  175. package/package.json +68 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @aparte/core — Node.js / SSR-safe entry point.
3
+ *
4
+ * Resolved via the `node` export condition, so `import '@aparte/core'` in Node
5
+ * (Next.js / Nuxt / Angular Universal / SvelteKit server, tsx, CLI tools) loads
6
+ * THIS module instead of the browser entry. It exposes the same public API
7
+ * surface MINUS the Web Components and CSS side-effects — importing the real
8
+ * `index.ts` in Node throws `HTMLElement is not defined` because the custom
9
+ * elements extend `HTMLElement` at module scope.
10
+ *
11
+ * Everything re-exported here is DOM-free at import time. Custom-element CLASSES
12
+ * (AparteChatBubble, AparteComposer*, AparteSelect, …) are intentionally NOT exported
13
+ * as runtime values — they only exist in the browser build. Their TYPES are
14
+ * re-exported (types are erased, so they never pull DOM at runtime), which keeps
15
+ * TypeScript consumers fully typed on the server; `registerAllComponents()` is a
16
+ * no-op here (there is nothing to register without a DOM).
17
+ */
18
+ export type { AparteBubbleRole, AparteMessage, AparteContentParser, AparteSendEventDetail, AparteTokenEventDetail, AparteViewportConfig, AparteInputConfig, AparteThemeVariables, AparteStatus, AparteAttachment, AparteMessageBranch, AparteBubbleActionsConfig, AparteBubbleActionName, AparteSegment, AparteSegmentType, AparteTextSegment, AparteThinkingSegment, AparteCodeSegment, AparteTerminalSegment, AparteSegmentRenderer, AparteCustomSegment, AparteToolCallSegment, AparteArtifactSegment, AparteAIProvider, AparteAIModel, AparteAIProviderConfigField, AparteAIProviderConfigSchema, AparteModelConfig, ModelStatus, ModelLoadProgress, AparteModelChangeEventDetail, AparteMessageDoneEventDetail, AparteMessageInfoEventDetail, AparteSiblingInfo, AparteBranchNavigateEventDetail, ApartePathChangedEventDetail, AparteRetryEventDetail, AparteEditEventDetail, AparteFeedbackEventDetail, AparteActionEventDetail, AparteArtifactStartEventDetail, AparteArtifactDeltaEventDetail, AparteArtifactReadyEventDetail, AparteArtifactOpenEventDetail, AparteChatRequest, AparteChatResponse, AparteChatMessage, AparteContentPart, AparteTextPart, AparteImagePart, AparteFilePart, AparteStreamEvent, AparteStreamEventMap, AparteUsage, AparteTool, AparteToolCall, AparteToolResult, AparteToolHandler, AparteToolRenderer, AparteToolDecisionDetail, AparteToolApprovalRequestDetail, AparteToolActionDetail, AparteChatImperativeApi, } from './types/index.js';
19
+ export { AparteErrorCode, AparteError, contentToText } from './types/index.js';
20
+ export type { AparteSelectChangeDetail } from './primitives/index.js';
21
+ export type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail } from './components/index.js';
22
+ export type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail } from './components/index.js';
23
+ export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, collectRendererStyles, registerDefaultRenderers, } from './renderers/index.js';
24
+ export { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';
25
+ export type { AparteConversation, AparteConversationMeta, AparteStorageAdapter, AparteMemoryFact, AparteArtifactRow, AparteAttachmentRow, } from './conversations/index.js';
26
+ export { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';
27
+ export { ConversationManager, type ConversationManagerOptions } from './conversations/index.js';
28
+ export { AparteConversationController, type AparteChatBinding, type AparteConversationControllerOptions, } from './conversations/index.js';
29
+ export { AparteChatHost, type AparteChatHostBinding, type AparteChatHostOptions, } from './host/index.js';
30
+ export { AparteStreamParser, parseMarkdownToSegments, deriveArtifactKind, parseAparteEventStream } from './parsers/index.js';
31
+ export type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';
32
+ export { DirectTransport, BackendTransport, createAparteChatHandler, isFormatAdapter } from './transport/index.js';
33
+ export type { AparteTransport, AparteTransportContext, AparteFormatAdapter, AparteVendorRequest, BackendTransportOptions, DirectTransportOptions, AparteChatHandlerOptions, } from './transport/index.js';
34
+ export { AparteConfig, AparteConfigClass } from './config/index.js';
35
+ export { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';
36
+ export type { AparteMarkdownProvider, AparteStreamingMarkdownProvider, AparteStreamingMarkdownRenderer, AparteHighlightProvider, AparteSystemPromptVarsProvider, AparteSkeletonProvider, AparteSkeletonType, AparteLocale, AparteAction, AparteActionZone, AparteIconProvider, AparteIconName, AparteAvatarProvider, AparteStatusRenderer, AparteErrorRenderer, AparteAttachmentRenderer, AparteSiblingNavRenderer, AparteBubbleShellRenderer, AparteModelPreference, AparteModelPreferenceProvider, AparteArtifactPreviewBuilder, AparteSanitizer, } from './config/index.js';
37
+ export { DEFAULT_ICON_FALLBACKS, DEFAULT_SKELETON_FALLBACKS, DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';
38
+ export { AparteClient } from './client/aparte-client.js';
39
+ export type { AparteClientOptions, AparteToolApprovalResolver, AparteCompactionSelector } from './client/aparte-client.js';
40
+ export { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';
41
+ export type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';
42
+ export { MessageRepository } from './runtime/message-repository.js';
43
+ export type { ExportedMessageRepository } from './runtime/message-repository.js';
44
+ export { applyElementProps, DEFAULT_UI_EVENTS } from './interop/element-props.js';
45
+ export { requestUserInput, buildElicitationPanel } from './elicitation/index.js';
46
+ export type { AparteElicitationSchema, AparteElicitationField, AparteElicitationEnumField, AparteElicitationBooleanField, AparteElicitationStringField, AparteElicitationObjectSchema, AparteElicitationRequest, AparteElicitationResult, AparteElicitationPresenter, BuiltElicitationPanel, } from './elicitation/index.js';
47
+ /**
48
+ * No-op on the server: custom elements only exist in the browser, where the
49
+ * real `index.ts` registers them at import time. Wrappers can call this
50
+ * unconditionally without a `typeof window` guard.
51
+ */
52
+ export declare function registerAllComponents(): void;
53
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../src/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACR,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,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2
+ function registerAllComponents() {
3
+ }
4
+ export {
5
+ A as APARTE_CONVERSATION_SCHEMA_VERSION,
6
+ a as APARTE_HOST_ATTR,
7
+ b as AparteChatHost,
8
+ c as AparteClient,
9
+ d as AparteConfig,
10
+ e as AparteConfigClass,
11
+ f as AparteConversationController,
12
+ g as AparteError,
13
+ h as AparteErrorCode,
14
+ i as AparteStreamParser,
15
+ B as BackendTransport,
16
+ C as ConversationManager,
17
+ D as DEFAULT_ICON_FALLBACKS,
18
+ j as DEFAULT_LOCALE,
19
+ k as DEFAULT_SKELETON_FALLBACKS,
20
+ l as DEFAULT_UI_EVENTS,
21
+ m as DirectTransport,
22
+ M as MessageRepository,
23
+ n as applyElementProps,
24
+ o as attachConfig,
25
+ p as buildElicitationPanel,
26
+ q as collectRendererStyles,
27
+ r as contentToText,
28
+ s as contextConfig,
29
+ t as createAparteChatHandler,
30
+ u as createStreamAdapter,
31
+ v as defaultSanitizer,
32
+ w as deriveArtifactKind,
33
+ x as detachConfig,
34
+ y as getSegmentRenderer,
35
+ z as isFormatAdapter,
36
+ E as isSafeUrl,
37
+ F as parseAparteEventStream,
38
+ G as parseMarkdownToSegments,
39
+ H as populateBubbleFromMessage,
40
+ I as readableToAsyncIterable,
41
+ registerAllComponents,
42
+ J as registerDefaultRenderers,
43
+ K as registerSegmentRenderer,
44
+ L as requestUserInput,
45
+ N as resolveConfig,
46
+ O as runWithConfig,
47
+ P as unregisterSegmentRenderer
48
+ };
49
+ //# sourceMappingURL=index.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.js","sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @aparte/core — Node.js / SSR-safe entry point.\n *\n * Resolved via the `node` export condition, so `import '@aparte/core'` in Node\n * (Next.js / Nuxt / Angular Universal / SvelteKit server, tsx, CLI tools) loads\n * THIS module instead of the browser entry. It exposes the same public API\n * surface MINUS the Web Components and CSS side-effects — importing the real\n * `index.ts` in Node throws `HTMLElement is not defined` because the custom\n * elements extend `HTMLElement` at module scope.\n *\n * Everything re-exported here is DOM-free at import time. Custom-element CLASSES\n * (AparteChatBubble, AparteComposer*, AparteSelect, …) are intentionally NOT exported\n * as runtime values — they only exist in the browser build. Their TYPES are\n * re-exported (types are erased, so they never pull DOM at runtime), which keeps\n * TypeScript consumers fully typed on the server; `registerAllComponents()` is a\n * no-op here (there is nothing to register without a DOM).\n */\n\n// ── Types (erased at runtime — always safe, mirror index.ts) ────────────────\nexport type {\n AparteBubbleRole,\n AparteMessage,\n AparteContentParser,\n AparteSendEventDetail,\n AparteTokenEventDetail,\n AparteViewportConfig,\n AparteInputConfig,\n AparteThemeVariables,\n AparteStatus,\n AparteAttachment,\n AparteMessageBranch,\n AparteBubbleActionsConfig,\n AparteBubbleActionName,\n AparteSegment,\n AparteSegmentType,\n AparteTextSegment,\n AparteThinkingSegment,\n AparteCodeSegment,\n AparteTerminalSegment,\n AparteSegmentRenderer,\n AparteCustomSegment,\n AparteToolCallSegment,\n AparteArtifactSegment,\n AparteAIProvider,\n AparteAIModel,\n AparteAIProviderConfigField,\n AparteAIProviderConfigSchema,\n AparteModelConfig,\n ModelStatus,\n ModelLoadProgress,\n AparteModelChangeEventDetail,\n AparteMessageDoneEventDetail,\n AparteMessageInfoEventDetail,\n AparteSiblingInfo,\n AparteBranchNavigateEventDetail,\n ApartePathChangedEventDetail,\n AparteRetryEventDetail,\n AparteEditEventDetail,\n AparteFeedbackEventDetail,\n AparteActionEventDetail,\n AparteArtifactStartEventDetail,\n AparteArtifactDeltaEventDetail,\n AparteArtifactReadyEventDetail,\n AparteArtifactOpenEventDetail,\n AparteChatRequest,\n AparteChatResponse,\n AparteChatMessage,\n AparteContentPart,\n AparteTextPart,\n AparteImagePart,\n AparteFilePart,\n AparteStreamEvent,\n AparteStreamEventMap,\n AparteUsage,\n AparteTool,\n AparteToolCall,\n AparteToolResult,\n AparteToolHandler,\n AparteToolRenderer,\n AparteToolDecisionDetail,\n AparteToolApprovalRequestDetail,\n AparteToolActionDetail,\n AparteChatImperativeApi,\n} from './types/index.js';\nexport { AparteErrorCode, AparteError, contentToText } from './types/index.js';\n\n// Custom-element TYPES (erased) — keep server consumers fully typed.\nexport type { AparteSelectChangeDetail } from './primitives/index.js';\nexport type { SyncableBubble, AparteComposerEventMap, AparteComposerEventType, AparteComposerState, AparteComposerChangeEventDetail } from './components/index.js';\nexport type { AparteConversationListItem, AparteConversationSelectDetail, AparteConversationDeleteDetail } from './components/index.js';\n\n// ── Renderers (produce HTML strings; DOM-free at import) ────────────────────\nexport {\n registerSegmentRenderer,\n unregisterSegmentRenderer,\n getSegmentRenderer,\n collectRendererStyles,\n registerDefaultRenderers,\n} from './renderers/index.js';\n\n// `populateBubbleFromMessage` is a plain helper — import it from its own module,\n// NOT the components barrel (which would pull in the HTMLElement classes).\nexport { populateBubbleFromMessage } from './components/bubble/bubble-sync.js';\n\n// ── Conversations (types, adapter contract, manager, controller) ────────────\nexport type {\n AparteConversation,\n AparteConversationMeta,\n AparteStorageAdapter,\n AparteMemoryFact,\n AparteArtifactRow,\n AparteAttachmentRow,\n} from './conversations/index.js';\nexport { APARTE_CONVERSATION_SCHEMA_VERSION } from './conversations/index.js';\nexport { ConversationManager, type ConversationManagerOptions } from './conversations/index.js';\nexport {\n AparteConversationController,\n type AparteChatBinding,\n type AparteConversationControllerOptions,\n} from './conversations/index.js';\n\n// ── Framework-agnostic chat-host orchestrator (every wrapper binds to it) ───\nexport {\n AparteChatHost,\n type AparteChatHostBinding,\n type AparteChatHostOptions,\n} from './host/index.js';\n\n// ── Parsers ─────────────────────────────────────────────────────────────────\nexport { AparteStreamParser, parseMarkdownToSegments, deriveArtifactKind, parseAparteEventStream } from './parsers/index.js';\nexport type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './parsers/index.js';\n\n// Transport seam — DOM-free (fetch-based), so the whole seam is SSR-safe. The\n// server-side `/api/chat` handler AND both client transports live here; a browser\n// never runs the handler, and the transports touch no DOM at import. Mirrored in\n// full so a wrapper barrel re-exporting a transport can't crash under SSR.\nexport { DirectTransport, BackendTransport, createAparteChatHandler, isFormatAdapter } from './transport/index.js';\nexport type {\n AparteTransport,\n AparteTransportContext,\n AparteFormatAdapter,\n AparteVendorRequest,\n BackendTransportOptions,\n DirectTransportOptions,\n AparteChatHandlerOptions,\n} from './transport/index.js';\n\n// ── Config ──────────────────────────────────────────────────────────────────\nexport { AparteConfig, AparteConfigClass } from './config/index.js';\nexport { resolveConfig, attachConfig, detachConfig, runWithConfig, contextConfig, APARTE_HOST_ATTR } from './config/index.js';\nexport type {\n AparteMarkdownProvider,\n AparteStreamingMarkdownProvider,\n AparteStreamingMarkdownRenderer,\n AparteHighlightProvider,\n AparteSystemPromptVarsProvider,\n AparteSkeletonProvider,\n AparteSkeletonType,\n AparteLocale,\n AparteAction,\n AparteActionZone,\n AparteIconProvider,\n AparteIconName,\n AparteAvatarProvider,\n AparteStatusRenderer,\n AparteErrorRenderer,\n AparteAttachmentRenderer,\n AparteSiblingNavRenderer,\n AparteBubbleShellRenderer,\n AparteModelPreference,\n AparteModelPreferenceProvider,\n AparteArtifactPreviewBuilder,\n AparteSanitizer,\n} from './config/index.js';\nexport { DEFAULT_ICON_FALLBACKS, DEFAULT_SKELETON_FALLBACKS, DEFAULT_LOCALE, defaultSanitizer, isSafeUrl } from './config/index.js';\n\n// ── Client + runtime ─────────────────────────────────────────────────────────\nexport { AparteClient } from './client/aparte-client.js';\nexport type { AparteClientOptions, AparteToolApprovalResolver, AparteCompactionSelector } from './client/aparte-client.js';\nexport { createStreamAdapter, readableToAsyncIterable } from './client/stream-adapter.js';\nexport type { AparteStreamRunEvent, AparteStreamRunEmitter, StreamAdapterTarget, CreateStreamAdapterOptions, AparteStreamRunner, AparteStreamRunOptions } from './client/stream-adapter.js';\nexport { MessageRepository } from './runtime/message-repository.js';\nexport type { ExportedMessageRepository } from './runtime/message-repository.js';\n\n// ── Wrapper interop (DOM-free helpers the four wrappers' AparteUi value-imports) ─\n// `applyElementProps`/`DEFAULT_UI_EVENTS` are pure (a string array + a function that\n// only touches its `HTMLElement` argument when CALLED, never at import). They MUST be\n// on the Node surface: every wrapper barrel re-exports `AparteUi`, which value-imports\n// these two — omit them here and any SSR toolchain resolving the `node` condition\n// crashes the whole barrel with \"does not provide an export named 'applyElementProps'\".\nexport { applyElementProps, DEFAULT_UI_EVENTS } from './interop/element-props.js';\n\n// Elicitation (human-in-the-loop typed input) — DOM-free at import.\nexport { requestUserInput, buildElicitationPanel } from './elicitation/index.js';\nexport type {\n AparteElicitationSchema,\n AparteElicitationField,\n AparteElicitationEnumField,\n AparteElicitationBooleanField,\n AparteElicitationStringField,\n AparteElicitationObjectSchema,\n AparteElicitationRequest,\n AparteElicitationResult,\n AparteElicitationPresenter,\n BuiltElicitationPanel,\n} from './elicitation/index.js';\n\n/**\n * No-op on the server: custom elements only exist in the browser, where the\n * real `index.ts` registers them at import time. Wrappers can call this\n * unconditionally without a `typeof window` guard.\n */\nexport function registerAllComponents(): void {\n /* browser-only — nothing to register without a DOM */\n}\n"],"names":[],"mappings":";AAoNO,SAAS,wBAA8B;AAE9C;"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Vanilla-DOM helpers shared by the framework wrappers' `AparteUi` pass-through
3
+ * component. They live in core (zero-dep) so the four wrappers don't each carry
4
+ * a byte-identical copy — only the framework-specific mounting differs.
5
+ */
6
+ /** The custom events aparté elements actually dispatch (verified against core). */
7
+ export declare const DEFAULT_UI_EVENTS: readonly string[];
8
+ /**
9
+ * Apply props to an aparté custom element. aparté elements are
10
+ * **attribute-driven** (`observedAttributes`): assigning a property is either a
11
+ * silent no-op (nothing observes it) or throws outright on a getter-only
12
+ * accessor — `<aparte-composer>`'s `placeholder`/`disabled` are exactly that.
13
+ * So primitives go through `setAttribute`; only values an attribute cannot carry
14
+ * (objects, functions) are handed over as properties. Keys starting with `--`
15
+ * become CSS variables; `on…` function values are ignored (event forwarding is
16
+ * the wrapper's job).
17
+ *
18
+ * `transformValue` is applied to object/function values before they're set as
19
+ * properties — Vue passes `toRaw` to unwrap its reactive proxy (a deep proxy
20
+ * breaks Maps/class internals on a plain custom element); it defaults to identity.
21
+ */
22
+ export declare function applyElementProps(el: HTMLElement, props: Record<string, unknown>, transformValue?: (value: unknown) => unknown): void;
23
+ //# sourceMappingURL=element-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-props.d.ts","sourceRoot":"","sources":["../../src/interop/element-props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAQ9C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,cAAc,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAA0B,GAC/D,IAAI,CAgBN"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Aparte event stream parser — the wire format for the backend path.
3
+ *
4
+ * A backend that keeps the API key server-side runs the vendor's own parser
5
+ * server-side and streams back **already-normalized `AparteStreamEvent`s, one JSON
6
+ * object per line (NDJSON)**. This parser turns that NDJSON byte stream back
7
+ * into a `ReadableStream<AparteStreamEvent>`, so the client stays fully
8
+ * vendor-agnostic on the backend path (it never needs the vendor-specific
9
+ * `parseStream`). See `transport/backend-transport.ts`.
10
+ */
11
+ import type { AparteStreamEvent } from '../types/index.js';
12
+ export declare function parseAparteEventStream(stream: ReadableStream<Uint8Array>): ReadableStream<AparteStreamEvent>;
13
+ //# sourceMappingURL=aparte-event-stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aparte-event-stream.d.ts","sourceRoot":"","sources":["../../src/parsers/aparte-event-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,cAAc,CAAC,iBAAiB,CAAC,CAsCnC"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * AparteStreamParser
3
+ *
4
+ * Real-time markdown stream parser for AI/LLM responses.
5
+ * Detects code blocks, thinking blocks, and other patterns during streaming.
6
+ *
7
+ * Supported patterns:
8
+ * - ```language\ncode\n``` → AparteCodeSegment
9
+ * - Plain text → AparteTextSegment
10
+ * - <think>…</think> or <thinking>…</thinking> → AparteThinkingSegment (configurable)
11
+ */
12
+ import type { AparteSegment } from '../types/index.js';
13
+ /** One inline thinking-block delimiter pair (open/close tag). */
14
+ export interface AparteThinkingDelimiterPair {
15
+ start: string;
16
+ end: string;
17
+ }
18
+ export interface AparteStreamParserOptions {
19
+ /**
20
+ * Inline thinking-block delimiters — for a model that streams its reasoning
21
+ * *inline in the content* (rather than on a separate reasoning channel).
22
+ * Accepts one pair or several; the parser opens a thinking segment at
23
+ * whichever pair appears first. Default recognizes BOTH common conventions:
24
+ * `<think>…</think>` (DeepSeek-R1, QwQ, most local GGUF reasoning models) and
25
+ * `<thinking>…</thinking>` (Claude-style). Pass your own to override.
26
+ */
27
+ thinkingDelimiters?: AparteThinkingDelimiterPair | AparteThinkingDelimiterPair[];
28
+ /** Auto-generate segment IDs (default: true) */
29
+ autoGenerateIds?: boolean;
30
+ /** ID prefix for generated segments */
31
+ idPrefix?: string;
32
+ }
33
+ export interface AparteParserState {
34
+ /** Current parser mode */
35
+ mode: 'text' | 'code' | 'thinking' | 'artifact';
36
+ /** Buffer for incomplete patterns */
37
+ buffer: string;
38
+ /** Current code block language */
39
+ codeLanguage?: string;
40
+ /** Close delimiter of the thinking pair currently open (multi-delimiter support) */
41
+ thinkingEnd?: string;
42
+ /** Accumulated segments */
43
+ segments: AparteSegment[];
44
+ /** Current active segment being built */
45
+ activeSegment: AparteSegment | null;
46
+ /** Counter for generating IDs */
47
+ segmentCounter: number;
48
+ }
49
+ export interface AparteParserResult {
50
+ /** Parsed segments */
51
+ segments: AparteSegment[];
52
+ /** Remaining buffer (incomplete patterns) */
53
+ remaining: string;
54
+ /** Current parser state */
55
+ state: AparteParserState;
56
+ }
57
+ export declare class AparteStreamParser {
58
+ private _options;
59
+ /** Normalized to an array; the parser matches whichever pair opens first. */
60
+ private _thinkingDelimiters;
61
+ private _state;
62
+ constructor(options?: AparteStreamParserOptions);
63
+ /**
64
+ * Parse a chunk of streamed content
65
+ * Call this for each chunk received from the LLM
66
+ */
67
+ parse(chunk: string): AparteParserResult;
68
+ /**
69
+ * Finalize parsing - flush any remaining content as text
70
+ */
71
+ finalize(): AparteSegment[];
72
+ /**
73
+ * Reset parser state
74
+ */
75
+ reset(): void;
76
+ /**
77
+ * Get current parser state (for debugging/inspection)
78
+ */
79
+ getState(): Readonly<AparteParserState>;
80
+ private _parseNext;
81
+ private _parseTextMode;
82
+ private _startCodeBlock;
83
+ private _parseCodeMode;
84
+ private _startThinkingBlock;
85
+ private _parseThinkingMode;
86
+ /**
87
+ * Start an artifact block. Buffer must start with `<artifact`.
88
+ * The full opening tag must be present (`>`); otherwise we return null and wait
89
+ * for more chunks.
90
+ *
91
+ * Supported attributes (Anthropic-style, single or double quotes):
92
+ * - type — required (MIME type, verbatim)
93
+ * - title — optional human label
94
+ *
95
+ * Any other attributes are ignored gracefully.
96
+ */
97
+ private _startArtifactBlock;
98
+ /**
99
+ * Stream content into the active artifact segment until `</artifact>` is seen.
100
+ * Mirrors `_parseThinkingMode` so partial matches at chunk boundaries don't
101
+ * split the closing tag across two updates.
102
+ */
103
+ private _parseArtifactMode;
104
+ private _createInitialState;
105
+ private _generateId;
106
+ private _createTextSegment;
107
+ private _createCodeSegment;
108
+ private _createThinkingSegment;
109
+ private _createArtifactSegment;
110
+ private _isPartialMatch;
111
+ private _getPartialMatchLength;
112
+ }
113
+ /**
114
+ * Parse a complete markdown string into segments
115
+ * Use this for non-streaming scenarios
116
+ */
117
+ export declare function parseMarkdownToSegments(content: string, options?: AparteStreamParserOptions): AparteSegment[];
118
+ /**
119
+ * Map a MIME type to a short, stable artifact kind identifier.
120
+ *
121
+ * Resolution order: Anthropic's vendor namespace (`application/vnd.ant.<kind>`),
122
+ * exact standard MIMEs, then a substring rescue for parameterised or vendor
123
+ * variants (`text/html; charset=utf-8`, `application/ld+json`, …). Unrecognised
124
+ * MIMEs return `fallback` (default `'unknown'`) — consumers are expected to
125
+ * guard their renderers accordingly.
126
+ *
127
+ * Canonical implementation. `@aparte/engine` keeps a byte-identical copy (core is
128
+ * an OPTIONAL peer there, so it cannot import this at runtime); the engine's
129
+ * `derive-artifact-kind-parity.test.ts` locks the two together.
130
+ *
131
+ * @example
132
+ * deriveArtifactKind('application/vnd.ant.react') // 'react'
133
+ * deriveArtifactKind('text/html; charset=utf-8') // 'html'
134
+ * deriveArtifactKind('font/woff2', 'text') // 'text' (fallback)
135
+ */
136
+ export declare function deriveArtifactKind(mimeType: string, fallback?: string): string;
137
+ //# sourceMappingURL=aparte-stream-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aparte-stream-parser.d.ts","sourceRoot":"","sources":["../../src/parsers/aparte-stream-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACR,aAAa,EAKhB,MAAM,mBAAmB,CAAC;AAM3B,iEAAiE;AACjE,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACtC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,2BAA2B,GAAG,2BAA2B,EAAE,CAAC;IACjF,gDAAgD;IAChD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAQD,MAAM,WAAW,iBAAiB;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,G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Q1B,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,sBAAsB;CAQjC;AAMD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,yBAAyB,GACpC,aAAa,EAAE,CAKjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,SAAY,GAAG,MAAM,CAqBjF"}
@@ -0,0 +1,4 @@
1
+ export { AparteStreamParser, parseMarkdownToSegments, deriveArtifactKind } from './aparte-stream-parser.js';
2
+ export type { AparteStreamParserOptions, AparteThinkingDelimiterPair, AparteParserState, AparteParserResult } from './aparte-stream-parser.js';
3
+ export { parseAparteEventStream } from './aparte-event-stream.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parsers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC5G,YAAY,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAO/I,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * AparteCore Primitives
3
+ *
4
+ * Reusable UI components that all plugins can use.
5
+ */
6
+ export { AparteSelect, AparteOption, AparteOptgroup, type AparteSelectChangeDetail } from './select/index.js';
7
+ export { AparteProgressSpinner } from './progress-spinner/index.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * AparteProgressSpinner
3
+ *
4
+ * Circular progress spinner web component.
5
+ * - Indeterminate (no `value` attribute): continuous rotation animation
6
+ * - Determinate (`value="0–100"`): fills the arc proportionally
7
+ *
8
+ * @element aparte-progress-spinner
9
+ * @attr {number} value - Progress percentage 0–100 (omit for indeterminate)
10
+ *
11
+ * @cssvar --aparte-spinner-size Size of the spinner. Default: 14px
12
+ * @cssvar --aparte-spinner-stroke Stroke width in SVG units. Default: 2.5
13
+ * @cssvar --aparte-spinner-color Fill arc stroke color. Default: currentColor
14
+ * @cssvar --aparte-spinner-track Track arc stroke color. Default: 15% currentColor
15
+ */
16
+ export declare class AparteProgressSpinner extends HTMLElement {
17
+ static get observedAttributes(): string[];
18
+ /** Radius of the SVG circle (viewBox is 0 0 24 24, center at 12,12) */
19
+ private readonly _r;
20
+ private get _circ();
21
+ connectedCallback(): void;
22
+ attributeChangedCallback(): void;
23
+ private _render;
24
+ }
25
+ //# sourceMappingURL=aparte-progress-spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aparte-progress-spinner.d.ts","sourceRoot":"","sources":["../../../src/primitives/progress-spinner/aparte-progress-spinner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IAClD,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAAsB;IAE/D,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAK;IACxB,OAAO,KAAK,KAAK,GAA4C;IAE7D,iBAAiB,IAAI,IAAI;IACzB,wBAAwB,IAAI,IAAI;IAEhC,OAAO,CAAC,OAAO;CAwBlB"}
@@ -0,0 +1,2 @@
1
+ export { AparteProgressSpinner } from './aparte-progress-spinner.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/progress-spinner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * AparteOptgroup
3
+ *
4
+ * Option group element for aparte-select dropdown.
5
+ *
6
+ * @element aparte-optgroup
7
+ * @attr {string} label - Group label
8
+ * @attr {boolean} collapsible - Allow collapse/expand
9
+ * @attr {boolean} collapsed - Collapsed state
10
+ */
11
+ export declare class AparteOptgroup extends HTMLElement {
12
+ static get observedAttributes(): string[];
13
+ connectedCallback(): void;
14
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
15
+ get label(): string;
16
+ set label(val: string);
17
+ get collapsible(): boolean;
18
+ get collapsed(): boolean;
19
+ set collapsed(val: boolean);
20
+ get loading(): boolean;
21
+ set loading(val: boolean);
22
+ private _render;
23
+ private _updateLoadingState;
24
+ private _toggleCollapse;
25
+ private _updateCollapsedState;
26
+ }
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ 'aparte-optgroup': AparteOptgroup;
30
+ }
31
+ }
32
+ //# sourceMappingURL=aparte-optgroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aparte-optgroup.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/aparte-optgroup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,qBAAa,cAAe,SAAQ,WAAW;IAC3C,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAKzB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAY9F,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAEpB;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,EAMzB;IAED,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,GAAG,EAAE,OAAO,EAGvB;IAED,OAAO,CAAC,OAAO;IAsCf,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,qBAAqB;CAMhC;AAOD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,iBAAiB,EAAE,cAAc,CAAC;KACrC;CACJ"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * AparteOption
3
+ *
4
+ * Option element for aparte-select dropdown.
5
+ *
6
+ * @element aparte-option
7
+ * @attr {string} value - Option value
8
+ * @attr {boolean} disabled - Disabled state
9
+ * @attr {boolean} selected - Selected state
10
+ */
11
+ export declare class AparteOption extends HTMLElement {
12
+ static get observedAttributes(): string[];
13
+ connectedCallback(): void;
14
+ attributeChangedCallback(name: string): void;
15
+ get value(): string;
16
+ set value(val: string);
17
+ get label(): string;
18
+ get disabled(): boolean;
19
+ set disabled(val: boolean);
20
+ get selected(): boolean;
21
+ set selected(val: boolean);
22
+ private _updateAriaSelected;
23
+ private _updateStatusDot;
24
+ }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ 'aparte-option': AparteOption;
28
+ }
29
+ }
30
+ //# sourceMappingURL=aparte-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aparte-option.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/aparte-option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,qBAAa,YAAa,SAAQ,WAAW;IACzC,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,iBAAiB,IAAI,IAAI;IAMzB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAY5C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAEpB;IAED,IAAI,KAAK,IAAI,MAAM,CAIlB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAMxB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAMxB;IAED,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,gBAAgB;CAkB3B;AAOD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,eAAe,EAAE,YAAY,CAAC;KACjC;CACJ"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * AparteSelect
3
+ *
4
+ * Dropdown select component for AparteCore.
5
+ * Vanilla Web Component with configurable features.
6
+ *
7
+ * @element aparte-select
8
+ * @attr {string} value - Selected value
9
+ * @attr {string} placeholder - Placeholder text
10
+ * @attr {boolean} disabled - Disabled state
11
+ * @attr {boolean} grouped - Enable optgroup mode
12
+ * @attr {boolean} searchable - Enable search filter
13
+ * @attr {boolean} open - Dropdown open state
14
+ *
15
+ * @fires aparte-select-change - Fired when selection changes
16
+ * @fires aparte-select-open - Fired when dropdown opens
17
+ * @fires aparte-select-close - Fired when dropdown closes
18
+ */
19
+ import './aparte-option.js';
20
+ import './aparte-optgroup.js';
21
+ export interface AparteSelectChangeDetail {
22
+ value: string;
23
+ label: string;
24
+ previousValue: string;
25
+ }
26
+ export declare class AparteSelect extends HTMLElement {
27
+ private static _optIdSeq;
28
+ private _value;
29
+ private _isOpen;
30
+ private _activeIndex;
31
+ private _trigger;
32
+ private _dropdown;
33
+ private _searchInput;
34
+ private _observer;
35
+ private _boundHandleDocumentClick;
36
+ private _boundHandleKeydown;
37
+ static get observedAttributes(): string[];
38
+ connectedCallback(): void;
39
+ disconnectedCallback(): void;
40
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
41
+ get value(): string;
42
+ set value(val: string);
43
+ get open(): boolean;
44
+ set open(val: boolean);
45
+ private _render;
46
+ private _setupMutationObserver;
47
+ private _updateDropdownContent;
48
+ private _setupEventListeners;
49
+ private _handleDocumentClick;
50
+ private _handleKeydown;
51
+ /** Non-disabled, non-filtered options in DOM order. */
52
+ private _visibleOptions;
53
+ /** Move the active (keyboard-highlighted) option by `delta`, clamped. */
54
+ private _moveActive;
55
+ /** Highlight the option at `index` (clamped) and point aria-activedescendant at it. */
56
+ private _setActive;
57
+ /** Clear the keyboard highlight (on close). */
58
+ private _clearActive;
59
+ private _toggle;
60
+ private _openDropdown;
61
+ private _closeDropdown;
62
+ private _updatePosition;
63
+ private _selectOption;
64
+ private _updateTriggerLabel;
65
+ private _getSelectedLabel;
66
+ private _filterOptions;
67
+ private _emitChange;
68
+ }
69
+ declare global {
70
+ interface HTMLElementTagNameMap {
71
+ 'aparte-select': AparteSelect;
72
+ }
73
+ }
74
+ //# sourceMappingURL=aparte-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aparte-select.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/aparte-select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,CAAC;AAE9B,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,YAAa,SAAQ,WAAW;IACzC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAK;IAE7B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,SAA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 *
4
+ * Exports all select-related components.
5
+ */
6
+ export { AparteSelect, type AparteSelectChangeDetail } from './aparte-select.js';
7
+ export { AparteOption } from './aparte-option.js';
8
+ export { AparteOptgroup } from './aparte-optgroup.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Segment Renderers Barrel Export
3
+ */
4
+ export { registerSegmentRenderer, unregisterSegmentRenderer, getSegmentRenderer, getAllRenderers, collectRendererStyles, registerDefaultRenderers } from './segment-renderers.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EAC3B,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Aparte Segment Renderers
3
+ * Built-in renderers for core segment types
4
+ */
5
+ import type { AparteSegmentBase, AparteSegmentRenderer } from '../types/index.js';
6
+ /**
7
+ * Register a segment renderer
8
+ */
9
+ export declare function registerSegmentRenderer<T extends AparteSegmentBase>(renderer: AparteSegmentRenderer<T>): void;
10
+ /**
11
+ * Unregister a segment renderer
12
+ */
13
+ export declare function unregisterSegmentRenderer(type: string): void;
14
+ /**
15
+ * Get renderer for a segment type
16
+ */
17
+ export declare function getSegmentRenderer(type: string): AparteSegmentRenderer | undefined;
18
+ /**
19
+ * Get all registered renderers
20
+ */
21
+ export declare function getAllRenderers(): readonly AparteSegmentRenderer[];
22
+ /**
23
+ * Collect all renderer styles
24
+ */
25
+ export declare function collectRendererStyles(): string;
26
+ /**
27
+ * Inject renderer styles into the document head
28
+ */
29
+ export declare function injectRendererStyles(): void;
30
+ export declare function registerDefaultRenderers(): void;
31
+ //# sourceMappingURL=segment-renderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-renderers.d.ts","sourceRoot":"","sources":["../../src/renderers/segment-renderers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,iBAAiB,EACjB,qBAAqB,EAWxB,MAAM,mBAAmB,CAAC;AAoG3B;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,GACnC,IAAI,CAGN;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAElF;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,SAAS,qBAAqB,EAAE,CAElE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAK9C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAU3C;AAweD,wBAAgB,wBAAwB,IAAI,IAAI,CAW/C"}