meowtail 0.3.0-alpha.0 → 0.4.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 (95) hide show
  1. package/AGENT-COMPONENTS.md +2 -1
  2. package/ASSISTANT.md +2 -1
  3. package/JSON.md +1 -1
  4. package/README.md +6 -5
  5. package/dist/src/chat/assistant-composer.js +8 -7
  6. package/dist/src/chat/assistant-content.d.ts +2 -1
  7. package/dist/src/chat/assistant-content.js +3 -2
  8. package/dist/src/chat/assistant-markdown.d.ts +2 -1
  9. package/dist/src/chat/assistant-markdown.js +2 -1
  10. package/dist/src/chat/assistant-question.d.ts +2 -1
  11. package/dist/src/chat/assistant-question.js +5 -4
  12. package/dist/src/chat/assistant-types.d.ts +2 -1
  13. package/dist/src/chat/assistant.js +6 -5
  14. package/dist/src/chat/attachments.d.ts +2 -1
  15. package/dist/src/chat/attachments.js +2 -1
  16. package/dist/src/chat/composer.d.ts +2 -1
  17. package/dist/src/chat/composer.js +2 -1
  18. package/dist/src/chat/conversation.js +2 -1
  19. package/dist/src/chat/reasoning.d.ts +2 -1
  20. package/dist/src/chat/reasoning.js +2 -1
  21. package/dist/src/chat/task.d.ts +2 -1
  22. package/dist/src/chat/task.js +2 -1
  23. package/dist/src/chat/tool-call.d.ts +2 -1
  24. package/dist/src/chat/tool-call.js +2 -1
  25. package/dist/src/components/accordion.d.ts +2 -1
  26. package/dist/src/components/accordion.js +3 -2
  27. package/dist/src/components/avatar.js +2 -1
  28. package/dist/src/components/checkbox.d.ts +2 -1
  29. package/dist/src/components/checkbox.js +2 -1
  30. package/dist/src/components/choice-group.d.ts +2 -1
  31. package/dist/src/components/choice-group.js +3 -2
  32. package/dist/src/components/choice-select.d.ts +2 -1
  33. package/dist/src/components/choice-select.js +7 -6
  34. package/dist/src/components/code-block.d.ts +2 -1
  35. package/dist/src/components/code-block.js +6 -5
  36. package/dist/src/components/context-menu.d.ts +2 -1
  37. package/dist/src/components/context-menu.js +3 -2
  38. package/dist/src/components/disclosure.d.ts +2 -1
  39. package/dist/src/components/drawer.d.ts +2 -1
  40. package/dist/src/components/drawer.js +2 -1
  41. package/dist/src/components/field.d.ts +2 -1
  42. package/dist/src/components/field.js +2 -1
  43. package/dist/src/components/hover-card.js +3 -2
  44. package/dist/src/components/icon-button.d.ts +2 -1
  45. package/dist/src/components/icon-rail.d.ts +2 -1
  46. package/dist/src/components/icon-rail.js +2 -1
  47. package/dist/src/components/image-preview.js +3 -2
  48. package/dist/src/components/json-block.js +2 -1
  49. package/dist/src/components/json-tree.js +3 -2
  50. package/dist/src/components/menu-button.d.ts +2 -1
  51. package/dist/src/components/menu.d.ts +2 -1
  52. package/dist/src/components/menu.js +4 -3
  53. package/dist/src/components/mermaid-diagram.d.ts +2 -1
  54. package/dist/src/components/mermaid-diagram.js +6 -5
  55. package/dist/src/components/meta-row.d.ts +2 -1
  56. package/dist/src/components/meta-row.js +2 -1
  57. package/dist/src/components/modal.d.ts +2 -1
  58. package/dist/src/components/modal.js +2 -1
  59. package/dist/src/components/nav-item.d.ts +2 -1
  60. package/dist/src/components/nav-item.js +2 -1
  61. package/dist/src/components/nav-list.d.ts +2 -1
  62. package/dist/src/components/nav-list.js +2 -1
  63. package/dist/src/components/number-input.d.ts +2 -1
  64. package/dist/src/components/number-input.js +5 -4
  65. package/dist/src/components/output-block.d.ts +2 -1
  66. package/dist/src/components/output-block.js +4 -3
  67. package/dist/src/components/path-picker.d.ts +2 -1
  68. package/dist/src/components/path-picker.js +4 -3
  69. package/dist/src/components/pill.d.ts +2 -1
  70. package/dist/src/components/pill.js +2 -1
  71. package/dist/src/components/popover.d.ts +2 -1
  72. package/dist/src/components/popover.js +3 -2
  73. package/dist/src/components/progress.d.ts +2 -1
  74. package/dist/src/components/read-block.js +2 -1
  75. package/dist/src/components/risk-confirmation.d.ts +2 -1
  76. package/dist/src/components/risk-confirmation.js +2 -1
  77. package/dist/src/components/search-input.d.ts +2 -1
  78. package/dist/src/components/segmented-control.d.ts +2 -1
  79. package/dist/src/components/segmented-control.js +2 -1
  80. package/dist/src/components/select.d.ts +2 -1
  81. package/dist/src/components/skeleton-boundary.d.ts +2 -1
  82. package/dist/src/components/skeleton-boundary.js +3 -2
  83. package/dist/src/components/slider.d.ts +2 -1
  84. package/dist/src/components/slider.js +3 -2
  85. package/dist/src/components/table.d.ts +2 -1
  86. package/dist/src/components/table.js +5 -4
  87. package/dist/src/components/tabs.d.ts +2 -1
  88. package/dist/src/components/tabs.js +4 -3
  89. package/dist/src/components/task-list.d.ts +2 -1
  90. package/dist/src/components/task-list.js +2 -1
  91. package/dist/src/components/text-shimmer.d.ts +2 -1
  92. package/dist/src/components/text-shimmer.js +2 -1
  93. package/dist/src/components/tooltip.js +2 -1
  94. package/dist/src/components/work-card.d.ts +2 -1
  95. package/package.json +6 -6
@@ -32,7 +32,8 @@ This round fills two high-frequency joints: extending the existing `ChatToolCall
32
32
  ## Tool calls: separate data from execution actions
33
33
 
34
34
  ```tsx
35
- import { h, signal } from "meowjsx";
35
+ import { h } from "meowjsx";
36
+ import { signal } from "meowjsx/signal";
36
37
  import { ChatToolCall, type ChatExecutionState } from "meowtail/chat";
37
38
 
38
39
  const state = signal<ChatExecutionState>("queued");
package/ASSISTANT.md CHANGED
@@ -5,7 +5,8 @@ Status: the new composition is implemented, and the author's local behavior regr
5
5
  `AssistantView` from `meowtail/chat` provides messages, safe Markdown, code, processes, inputs, attachments, model and thinking options, current activity, background work details, and unanswered questions. The default structure and visuals live in the library; the `assistant-complete` scene in Meowbook only supplies local data and actions.
6
6
 
7
7
  ```tsx
8
- import { h, signal } from "meowjsx";
8
+ import { h } from "meowjsx";
9
+ import { signal } from "meowjsx/signal";
9
10
  import { AssistantView, type AssistantDraft, type AssistantMessage } from "meowtail/chat";
10
11
 
11
12
  const messages = signal<readonly AssistantMessage[]>([]);
package/JSON.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ```ts
6
6
  import { createJsonView, parseJsonView } from "meowjsx/json";
7
- import { signal, type ReadableSignal } from "meowjsx";
7
+ import { signal, type ReadableSignal } from "meowjsx/signal";
8
8
  import type { AssistantDraft, AssistantMessage } from "meowtail/chat";
9
9
  import { createMeowUICatalog } from "meowtail/json";
10
10
 
package/README.md CHANGED
@@ -16,10 +16,10 @@ Application authors writing their own components (the shadcn/ui and Tailwind equ
16
16
 
17
17
  ## Runtime compatibility
18
18
 
19
- The local `0.3.0-alpha.0` candidate requires `meowjsx@^0.2.0-alpha.0` and
20
- `meowcss@^0.2.0-alpha.0`. It uses ordinary components with static `meta`, composed part/ref bindings
19
+ The local `0.4.0-alpha.0` candidate requires `meowjsx@^0.3.0-alpha.0` and
20
+ `meowcss@^0.3.0-alpha.0`. It uses ordinary components with static `meta`, composed part/ref bindings
21
21
  and the class-value theme API. Earlier package generations do not implement that authoring contract.
22
- These are local candidate versions; the published releases remain listed in the root README.
22
+ The published releases remain listed in the root README.
23
23
 
24
24
  ## Minimal browser integration
25
25
 
@@ -691,12 +691,13 @@ Static visuals use CSS. Use a shadow only when real DOM, instance state, listene
691
691
 
692
692
  ```ts
693
693
  // Web shadow: context.element is a real Element.
694
+ import { signal } from "meowjsx/signal";
694
695
  import { defineShadow } from "meowjsx/web";
695
696
 
696
697
  runtime.use({
697
698
  shadows: [
698
699
  defineShadow(Button, "root", (props, context) => {
699
- const active = context.signal(false);
700
+ const active = signal(false);
700
701
  context.effect(() => {
701
702
  context.element.classList.toggle("is-active", active.value);
702
703
  });
@@ -717,7 +718,7 @@ runtime.use({
717
718
  });
718
719
  ```
719
720
 
720
- Register centrally; do not generate wrapper components. A shadow shares the signal/effect/onCleanup lifecycle API with components.
721
+ Register centrally; do not generate wrapper components. Shadows and components import `signal` from `meowjsx/signal` and share the `effect`/`onCleanup` lifecycle API.
721
722
  Plugin uninstall blocks later application; instance cleanup for existing elements is handled by the unmount of their mount. Do not use
722
723
  renderToHtml + innerHTML instead of browser mounting that needs a lifecycle.
723
724
 
@@ -1,4 +1,5 @@
1
- import { derived, h, isSignal, unwrap } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, isSignal, signal, unwrap } from "meowjsx/signal";
2
3
  // Fragment is required by the classic JSX transform for conditional attachment controls.
3
4
  // eslint-disable-next-line no-unused-vars
4
5
  import { Fragment } from "meowjsx";
@@ -14,12 +15,12 @@ export function AssistantComposer({ options, trailing }, context) {
14
15
  const controlled = options.draft !== undefined;
15
16
  if (controlled && !options.onDraftChange && !options.readOnly)
16
17
  throw new Error("A controlled Assistant draft requires onDraftChange or readOnly");
17
- const local = context.signal(options.defaultDraft ?? { text: "", attachments: [] });
18
+ const local = signal(options.defaultDraft ?? { text: "", attachments: [] });
18
19
  const draft = derived(() => (controlled ? unwrap(options.draft) : local.value));
19
20
  const text = derived(() => draft.value.text);
20
- const pending = context.signal(false);
21
- const attaching = context.signal(false);
22
- const feedback = context.signal("");
21
+ const pending = signal(false);
22
+ const attaching = signal(false);
23
+ const feedback = signal("");
23
24
  const disabled = derived(() => options.readOnly || unwrap(options.disabled ?? false));
24
25
  const submitDisabled = derived(() => disabled.value ||
25
26
  pending.value ||
@@ -110,8 +111,8 @@ export function AssistantComposer({ options, trailing }, context) {
110
111
  for (const url of urls)
111
112
  URL.revokeObjectURL(url);
112
113
  });
113
- const localModel = context.signal(unwrap(options.models ?? [])[0]?.value ?? "");
114
- const localReasoning = context.signal(unwrap(options.reasoningOptions ?? [])[0]?.value ?? "");
114
+ const localModel = signal(unwrap(options.models ?? [])[0]?.value ?? "");
115
+ const localReasoning = signal(unwrap(options.reasoningOptions ?? [])[0]?.value ?? "");
115
116
  const modelsLive = options.models !== undefined && (isSignal(options.models) || options.models.length > 0);
116
117
  const reasoningLive = options.reasoningOptions !== undefined &&
117
118
  (isSignal(options.reasoningOptions) || options.reasoningOptions.length > 0);
@@ -1,4 +1,5 @@
1
- import { type Context, type Signal } from "meowjsx";
1
+ import { type Context } from "meowjsx";
2
+ import { type Signal } from "meowjsx/signal";
2
3
  import type { AssistantLabels, AssistantMessage, AssistantMessagePart, AssistantProcessStep, AssistantViewProps } from "./assistant-types.js";
3
4
  export declare function AssistantSteps({ steps }: {
4
5
  steps: Signal<readonly AssistantProcessStep[]>;
@@ -1,4 +1,5 @@
1
- import { derived, h, keyed, unwrap } from "meowjsx";
1
+ import { h, keyed } from "meowjsx";
2
+ import { derived, signal, unwrap } from "meowjsx/signal";
2
3
  // Fragment is required by the classic JSX transform for process status content.
3
4
  // eslint-disable-next-line no-unused-vars
4
5
  import { Fragment } from "meowjsx";
@@ -78,7 +79,7 @@ export function AssistantPartView({ value, message, renderPart, onToolAction, },
78
79
  }
79
80
  AssistantPartView.meta = { name: "assistant-part", parts: ["root"] };
80
81
  function AssistantReplyActions({ value, labels, onMessageAction, }, context) {
81
- const copied = context.signal(false);
82
+ const copied = signal(false);
82
83
  let timer;
83
84
  context.onCleanup(() => clearTimeout(timer));
84
85
  const text = () => value.value.parts.flatMap((part) => (part.kind === "text" ? [part.text] : [])).join("\n\n");
@@ -1,4 +1,5 @@
1
- import { type Context, type Props, type Signal } from "meowjsx";
1
+ import { type Context, type Props } from "meowjsx";
2
+ import { type Signal } from "meowjsx/signal";
2
3
  export declare function assistantSafeLink(href: string): string | undefined;
3
4
  /** Raw HTML and images are text. Only explicit safe external links become navigation. */
4
5
  export declare const assistantMarkdown: (text: string) => string;
@@ -1,4 +1,5 @@
1
- import { derived, h } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived } from "meowjsx/signal";
2
3
  import { Marked, Renderer } from "marked";
3
4
  const escape = (text) => text.replace(/[&<>"']/g, (value) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[value]);
4
5
  export function assistantSafeLink(href) {
@@ -1,4 +1,5 @@
1
- import { type Context, type Signal } from "meowjsx";
1
+ import { type Context } from "meowjsx";
2
+ import { type Signal } from "meowjsx/signal";
2
3
  import { type AssistantLabels, type AssistantQuestion, type AssistantViewProps } from "./assistant-types.js";
3
4
  export declare function AssistantQuestionView({ value, onAnswer, onDismiss, labels, }: {
4
5
  value: Signal<AssistantQuestion>;
@@ -1,4 +1,5 @@
1
- import { derived, h, keyed } from "meowjsx";
1
+ import { h, keyed } from "meowjsx";
2
+ import { derived, signal } from "meowjsx/signal";
2
3
  // Fragment is required by the classic JSX transform for question actions.
3
4
  // eslint-disable-next-line no-unused-vars
4
5
  import { Fragment } from "meowjsx";
@@ -8,9 +9,9 @@ import { Select } from "../components/select.js";
8
9
  import { assistantCopy as defaultAssistantCopy, } from "./assistant-types.js";
9
10
  export function AssistantQuestionView({ value, onAnswer, onDismiss, labels, }, context) {
10
11
  const assistantCopy = { ...defaultAssistantCopy, ...labels };
11
- const answer = context.signal("");
12
- const sending = context.signal(false);
13
- const error = context.signal("");
12
+ const answer = signal("");
13
+ const sending = signal(false);
14
+ const error = signal("");
14
15
  const disabled = derived(() => sending.value || value.value.state !== "open" || !onAnswer);
15
16
  let disposed = false;
16
17
  context.onCleanup(() => {
@@ -1,5 +1,6 @@
1
1
  import type { IconName } from "../icons/icon.js";
2
- import type { Child, MaybeSignal, Props } from "meowjsx";
2
+ import type { Child, Props } from "meowjsx";
3
+ import type { MaybeSignal } from "meowjsx/signal";
3
4
  import type { ChatAttachmentItem } from "./attachments.js";
4
5
  import type { ChatMessageRole, ChatMessageStatus } from "./message.js";
5
6
  import type { StatusDotState } from "../components/status-dot.js";
@@ -1,4 +1,5 @@
1
- import { derived, h, keyed, unwrap } from "meowjsx";
1
+ import { h, keyed } from "meowjsx";
2
+ import { derived, signal, unwrap } from "meowjsx/signal";
2
3
  // Fragment is required by the classic JSX transform for header actions.
3
4
  // eslint-disable-next-line no-unused-vars
4
5
  import { Fragment } from "meowjsx";
@@ -72,11 +73,11 @@ export function AssistantView(options, context) {
72
73
  const work = derived(() => unwrap(options.work ?? []));
73
74
  const questions = derived(() => unwrap(options.questions ?? []));
74
75
  const activity = derived(() => unwrap(options.activity));
75
- const panelOpen = context.signal(false);
76
- const selected = context.signal("");
76
+ const panelOpen = signal(false);
77
+ const selected = signal("");
77
78
  const selectedWork = derived(() => work.value.find((item) => item.id === selected.value));
78
- const latestHidden = context.signal(true);
79
- const historyOpen = context.signal(false);
79
+ const latestHidden = signal(true);
80
+ const historyOpen = signal(false);
80
81
  const asked = derived(() => messages.value.flatMap((message) => {
81
82
  if (message.role !== "user")
82
83
  return [];
@@ -1,4 +1,5 @@
1
- import { type Context, type MaybeSignal, type Props } from "meowjsx";
1
+ import { type Context, type Props } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface ChatAttachmentItem {
3
4
  id: string;
4
5
  name: string;
@@ -1,4 +1,5 @@
1
- import { derived, h, keyed } from "meowjsx";
1
+ import { h, keyed } from "meowjsx";
2
+ import { derived } from "meowjsx/signal";
2
3
  import { Icon } from "../icons/icon.js";
3
4
  import { FileTypeIcon, fileExtension } from "../icons/file-type-icon.js";
4
5
  import { ImagePreview } from "../components/image-preview.js";
@@ -1,4 +1,5 @@
1
- import { type Child, type Context, type MaybeSignal, type Props } from "meowjsx";
1
+ import { type Child, type Context, type Props } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export type ChatComposerSubmit = (event: SubmitEvent) => void;
3
4
  export type ChatComposerInput = (event: Event) => void;
4
5
  export interface ChatComposerProps extends Props {
@@ -1,5 +1,6 @@
1
1
  import { defineStyleProps } from "meowcss/meowjsx";
2
- import { derived, h, unwrap, } from "meowjsx";
2
+ import { h } from "meowjsx";
3
+ import { derived, unwrap } from "meowjsx/signal";
3
4
  import { chatComposerOptions } from "./composer.options.js";
4
5
  import { Icon } from "../icons/icon.js";
5
6
  /** The message input of a conversation, with attachments, model choice and send. */
@@ -1,4 +1,5 @@
1
1
  import { h } from "meowjsx";
2
+ import { signal } from "meowjsx/signal";
2
3
  import { createChatScroll } from "./conversation-scroll.js";
3
4
  /**
4
5
  * A normal-flow action for hosts that already own transcript scrolling.
@@ -14,7 +15,7 @@ export function ChatConversationLatest({ children, ref, ...props }, context) {
14
15
  * Do not combine with an application-owned scroll controller. Children can use ChatMessageList.
15
16
  */
16
17
  export function ChatConversation({ children, ariaLabel = "Conversation reading area", latestLabel = "Back to latest message", ref, ...props }, context) {
17
- const hidden = context.signal(true);
18
+ const hidden = signal(true);
18
19
  let jump;
19
20
  const mount = (root) => {
20
21
  let disposed = false;
@@ -1,4 +1,5 @@
1
- import { type Context, type MaybeSignal, type Props } from "meowjsx";
1
+ import { type Context, type Props } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface ChatReasoningProps extends Props {
3
4
  /** What the model is doing now, for example "Drafting the rollout policy". */
4
5
  label: MaybeSignal<string>;
@@ -1,4 +1,5 @@
1
- import { derived, h, unwrap } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, unwrap } from "meowjsx/signal";
2
3
  import { Icon } from "../icons/icon.js";
3
4
  import { TextShimmer } from "../components/text-shimmer.js";
4
5
  /**
@@ -1,4 +1,5 @@
1
- import { type Child, type Context, type MaybeSignal, type Props } from "meowjsx";
1
+ import { type Child, type Context, type Props } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  import { type ChatExecutionState } from "../shared/execution-state.js";
3
4
  export interface ChatTaskProgress {
4
5
  value: number;
@@ -1,4 +1,5 @@
1
- import { derived, h, unwrap, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, unwrap } from "meowjsx/signal";
2
3
  import { Progress } from "../components/progress.js";
3
4
  import { StatusDot } from "../components/status-dot.js";
4
5
  import { executionStateLabel, executionStateTone, } from "../shared/execution-state.js";
@@ -1,4 +1,5 @@
1
- import { type Child, type Context, type MaybeSignal, type Props } from "meowjsx";
1
+ import { type Child, type Context, type Props } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  import { type ChatExecutionState } from "../shared/execution-state.js";
3
4
  /** The complete spelling remains supported for existing tool consumers. */
4
5
  export type ChatToolCallState = ChatExecutionState;
@@ -1,4 +1,5 @@
1
- import { derived, h, unwrap, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, unwrap } from "meowjsx/signal";
2
3
  // Fragment is required by the classic JSX transform for tool header content.
3
4
  // eslint-disable-next-line no-unused-vars
4
5
  import { Fragment } from "meowjsx";
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Child, type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface AccordionItem {
3
4
  id: string;
4
5
  summary: Child;
@@ -1,4 +1,5 @@
1
- import { derived, unwrap, h, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, signal, unwrap } from "meowjsx/signal";
2
3
  import { Disclosure } from "./disclosure.js";
3
4
  function asList(value, type) {
4
5
  if (value === undefined)
@@ -26,7 +27,7 @@ function nextValue(current, type, id, open) {
26
27
  }
27
28
  /** Grouped disclosures. Items are fixed for the mount. Expansion is handed to the caller when `value` is set. */
28
29
  export function Accordion({ items, type = "single", value, defaultValue, onValueChange, label, className, ref, ...props }, context) {
29
- const local = context.signal(defaultValue ?? (type === "single" ? "" : []));
30
+ const local = signal(defaultValue ?? (type === "single" ? "" : []));
30
31
  const current = value !== undefined ? value : local;
31
32
  const readValue = () => unwrap(current);
32
33
  const opened = items.map((item) => derived(() => isOpen(readValue(), type, item.id)));
@@ -1,5 +1,6 @@
1
1
  import { defineStyleProps } from "meowcss/meowjsx";
2
2
  import { h } from "meowjsx";
3
+ import { signal } from "meowjsx/signal";
3
4
  import { avatarOptions } from "./avatar.options.js";
4
5
  export { avatarOptions } from "./avatar.options.js";
5
6
  export function initialsFromName(name) {
@@ -17,7 +18,7 @@ export function initialsFromName(name) {
17
18
  }
18
19
  /** A face or the initials that remain when the image is missing. */
19
20
  export function Avatar({ name, src, alt, className, ...props }, context) {
20
- const failed = context.signal(false);
21
+ const failed = signal(false);
21
22
  return (h("span", { ...props, className: className, role: "img", "aria-label": name, ref: [context.parts.root, props.ref] },
22
23
  h("span", { "aria-hidden": "true", ref: [context.parts.initials] }, initialsFromName(name)),
23
24
  src ? (h("img", { src: src, alt: alt ?? "", hidden: failed, referrerPolicy: "no-referrer", onError: () => {
@@ -1,4 +1,5 @@
1
- import { type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  interface NativeToggleProps extends Props {
3
4
  checked?: MaybeSignal<boolean>;
4
5
  defaultChecked?: boolean;
@@ -1,4 +1,5 @@
1
- import { isSignal, mapSignal, unwrap, h, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { isSignal, mapSignal, unwrap } from "meowjsx/signal";
2
3
  function mixedValue(indeterminate) {
3
4
  return Boolean(indeterminate !== undefined && unwrap(indeterminate));
4
5
  }
@@ -1,4 +1,5 @@
1
- import { type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface ChoiceGroupOption {
3
4
  value: string;
4
5
  label: string;
@@ -1,8 +1,9 @@
1
- import { derived, unwrap, h } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, signal, unwrap } from "meowjsx/signal";
2
3
  let nextChoiceGroupId = 0;
3
4
  /** Visible single choices with native radio keyboard, validation and form semantics. */
4
5
  export function ChoiceGroup({ options, label, hideLabel = false, id = `choice-group-${++nextChoiceGroupId}`, name = id, form, value, defaultValue = "", onValueChange, disabled = false, required = false, className, ...props }, context) {
5
- const local = context.signal(defaultValue);
6
+ const local = signal(defaultValue);
6
7
  const current = value !== undefined ? value : local;
7
8
  const readValue = () => unwrap(current);
8
9
  const inputs = new Map();
@@ -1,4 +1,5 @@
1
- import { type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface ChoiceOption {
3
4
  value: string;
4
5
  label: string;
@@ -1,18 +1,19 @@
1
- import { derived, h, keyed, unwrap } from "meowjsx";
1
+ import { h, keyed } from "meowjsx";
2
+ import { derived, signal, unwrap } from "meowjsx/signal";
2
3
  import { Popover } from "./popover.js";
3
4
  import { Icon } from "../icons/icon.js";
4
5
  import { elementByIdInRoot } from "../shared/dom-root.js";
5
6
  let nextChoiceId = 0;
6
7
  /** Single-choice listbox. Form participation remains native; data fetching belongs to callers. */
7
8
  export function ChoiceSelect({ options, hidden, value, defaultValue = "", onValueChange, name, id = `choice-${++nextChoiceId}`, disabled = false, required = false, placeholder = "Select an option", searchable = false, searchPlaceholder = "Search options", emptyMessage = "No matching options", className, placement = "bottom", align = "start", matchTriggerWidth = true, ...props }, context) {
8
- const local = context.signal(defaultValue);
9
+ const local = signal(defaultValue);
9
10
  const current = value !== undefined ? value : local;
10
11
  const readValue = () => unwrap(current);
11
12
  const readOptions = () => unwrap(options);
12
- const open = context.signal(false);
13
- const invalid = context.signal(undefined);
14
- const validation = context.signal("");
15
- const query = context.signal("");
13
+ const open = signal(false);
14
+ const invalid = signal(undefined);
15
+ const validation = signal("");
16
+ const query = signal("");
16
17
  let searchElement = null;
17
18
  let triggerElement = null;
18
19
  let nativeElement = null;
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Child, type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface CodeBlockProps extends Props {
3
4
  code: MaybeSignal<string>;
4
5
  language?: MaybeSignal<string | undefined>;
@@ -1,4 +1,5 @@
1
- import { derived, h, unwrap, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, signal, unwrap } from "meowjsx/signal";
2
3
  import { Button } from "./button.js";
3
4
  import { copyTextToClipboard } from "../clipboard.js";
4
5
  // The highlighter stays in this module. Themes use type-only component imports,
@@ -11,10 +12,10 @@ function provided(value) {
11
12
  /** A block of code with its language, an optional title, soft wrap and copy. */
12
13
  export function CodeBlock({ code, language, title, caption, actions, defaultWrap = false, onCopy, ref, ...props }, context) {
13
14
  // These are enumerated attributes, not native boolean attributes such as disabled.
14
- const wrap = context.signal(defaultWrap ? "true" : "false");
15
- const copying = context.signal(false);
16
- const feedback = context.signal("");
17
- const highlighted = context.signal(unwrap(code));
15
+ const wrap = signal(defaultWrap ? "true" : "false");
16
+ const copying = signal(false);
17
+ const feedback = signal("");
18
+ const highlighted = signal(unwrap(code));
18
19
  const languageLabel = derived(() => unwrap(language)?.trim() || "Code");
19
20
  let disposed = false;
20
21
  context.onCleanup(() => {
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Child, type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  import { type MenuEntry } from "./menu.js";
3
4
  export interface ContextMenuProps extends Props {
4
5
  id: string;
@@ -1,8 +1,9 @@
1
- import { h, unwrap } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { signal, unwrap } from "meowjsx/signal";
2
3
  import { Menu } from "./menu.js";
3
4
  /** Right-click or Shift+F10 opens the existing Menu, including nested items. */
4
5
  export function ContextMenu({ id, items, open, onOpenChange, className, children, ...props }, context) {
5
- const local = context.signal(false);
6
+ const local = signal(false);
6
7
  const state = open !== undefined ? open : local;
7
8
  let point = { x: 0, y: 0 };
8
9
  const request = (next) => {
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Child, type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface DisclosureProps extends Props {
3
4
  summary: Child;
4
5
  open?: MaybeSignal<boolean>;
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Child, type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface DrawerProps extends Props {
3
4
  /** Accessible name of the drawer. */
4
5
  label: string;
@@ -1,4 +1,5 @@
1
- import { h, unwrap } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { unwrap } from "meowjsx/signal";
2
3
  import { PageFrame } from "./page-frame.js";
3
4
  /**
4
5
  * A modal panel that slides in from the start edge over a scrim, for navigation on narrow
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type VNode, type Context } from "meowjsx";
1
+ import { type Child, type Props, type VNode, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface FieldProps extends Props {
3
4
  label: Child;
4
5
  description?: Child;
@@ -1,4 +1,5 @@
1
- import { derived, isSignal, mapSignal, unwrap, h, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { derived, isSignal, mapSignal, unwrap } from "meowjsx/signal";
2
3
  /** A labelled form control with optional help text and an error message. */
3
4
  export function Field({ label, description, error, htmlFor, descriptionId, errorId, invalid, children, className, ref, ...props }, context) {
4
5
  const hasDescription = isSignal(description)
@@ -1,4 +1,5 @@
1
1
  import { h } from "meowjsx";
2
+ import { signal } from "meowjsx/signal";
2
3
  import { Popover } from "./popover.js";
3
4
  import { copyTextToClipboard } from "../clipboard.js";
4
5
  /**
@@ -6,7 +7,7 @@ import { copyTextToClipboard } from "../clipboard.js";
6
7
  * Popover owns positioning, Escape, outside dismissal and focus.
7
8
  */
8
9
  export function HoverCard({ id, trigger, content, openDelay = 500, disabled = false, className, variant = "compact", widthAnchor, copyText, copyLabel = "Copy", copiedLabel = "Copied", onCopy, }, context) {
9
- const open = context.signal(false);
10
+ const open = signal(false);
10
11
  let timer;
11
12
  let hovered = false;
12
13
  let focused = false;
@@ -16,7 +17,7 @@ export function HoverCard({ id, trigger, content, openDelay = 500, disabled = fa
16
17
  let copying = false;
17
18
  let copySession = {};
18
19
  let feedbackTimer;
19
- const feedback = context.signal("");
20
+ const feedback = signal("");
20
21
  const clear = () => {
21
22
  if (timer !== undefined)
22
23
  clearTimeout(timer);
@@ -1,5 +1,6 @@
1
1
  import { type ThemedProps } from "meowcss/meowjsx";
2
- import { type MaybeSignal, type Props, type Context } from "meowjsx";
2
+ import { type Props, type Context } from "meowjsx";
3
+ import { type MaybeSignal } from "meowjsx/signal";
3
4
  import { iconButtonOptions } from "./icon-button.options.js";
4
5
  export { iconButtonOptions } from "./icon-button.options.js";
5
6
  export interface IconButtonProps extends Props, ThemedProps<typeof iconButtonOptions> {
@@ -1,4 +1,5 @@
1
- import { type Child, type MaybeSignal, type Props, type Context } from "meowjsx";
1
+ import { type Child, type Props, type Context } from "meowjsx";
2
+ import { type MaybeSignal } from "meowjsx/signal";
2
3
  export interface IconRailProps extends Props {
3
4
  /** Accessible name of the navigation. */
4
5
  label: string;
@@ -1,4 +1,5 @@
1
- import { isSignal, mapSignal, h, } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { isSignal, mapSignal } from "meowjsx/signal";
2
3
  /**
3
4
  * A narrow icon column that expands into a labelled drawer over the page. The column keeps its
4
5
  * width in the layout, so expanding never reflows the content beside it.
@@ -1,8 +1,9 @@
1
- import { h, mapSignal } from "meowjsx";
1
+ import { h } from "meowjsx";
2
+ import { mapSignal, signal } from "meowjsx/signal";
2
3
  import { Icon } from "../icons/icon.js";
3
4
  /** Passive media display; navigation, preview activation and URL authorization belong to the host. */
4
5
  export function ImagePreview({ src, alt, loading = "lazy", loadingLabel = "Loading image", failedLabel = "Failed to load image", onLoad, onError, ...props }, context) {
5
- const state = context.signal("loading");
6
+ const state = signal("loading");
6
7
  return (h("span", { ...props, "data-image-state": state, ref: [context.parts.root, props.ref] }, [
7
8
  h("img", { src: src, alt: alt, loading: loading, decoding: "async", referrerPolicy: "no-referrer", hidden: mapSignal(state, (value) => value === "failed"), onLoad: (event) => {
8
9
  state.value = "ready";
@@ -1,11 +1,12 @@
1
1
  import { h } from "meowjsx";
2
+ import { signal } from "meowjsx/signal";
2
3
  import { CodeBlock } from "./code-block.js";
3
4
  /**
4
5
  * A collapsible block that shows a JSON value as a tree. Serialization and rendering wait for
5
6
  * expansion. Invalid text remains verbatim.
6
7
  */
7
8
  export function JsonBlock({ text, payload, label = "JSON", defaultOpen = false, onCopy, ...props }, context) {
8
- const body = context.signal(null);
9
+ const body = signal(null);
9
10
  let loaded = false;
10
11
  const load = () => {
11
12
  if (loaded)
@@ -1,4 +1,5 @@
1
1
  import { h } from "meowjsx";
2
+ import { signal } from "meowjsx/signal";
2
3
  import { copyTextToClipboard } from "../clipboard.js";
3
4
  import { Icon } from "../icons/icon.js";
4
5
  /**
@@ -7,8 +8,8 @@ import { Icon } from "../icons/icon.js";
7
8
  */
8
9
  export function JsonTree({ data, label = "JSON", defaultOpen = true, onCopy, ...props }, context) {
9
10
  const container = data !== null && typeof data === "object";
10
- const feedback = context.signal("");
11
- const children = context.signal(null);
11
+ const feedback = signal("");
12
+ const children = signal(null);
12
13
  let loaded = false;
13
14
  let alive = true;
14
15
  context.onCleanup(() => {