@intentic/extension-ui 1.287.0 → 1.290.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.
package/dist/format.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/build.mjs: do not edit.
2
- // The formatting half of the kit, off the same host bridge as ./index.js.
2
+ // The kit's format entry point, off the same host bridge as ./index.js.
3
3
  const host = globalThis.__intenticHost;
4
4
  if (host === undefined) {
5
5
  throw new Error("@intentic/extension-ui was loaded outside an intentic host: its helpers come from the app, not from this package.");
package/dist/i18n.js ADDED
@@ -0,0 +1,9 @@
1
+ // Generated by scripts/build.mjs: do not edit.
2
+ // The kit's i18n entry point, off the same host bridge as ./index.js.
3
+ const host = globalThis.__intenticHost;
4
+ if (host === undefined) {
5
+ throw new Error("@intentic/extension-ui was loaded outside an intentic host: its helpers come from the app, not from this package.");
6
+ }
7
+ const m = host.modules["@intentic/extension-ui"];
8
+ export const activeLocale = m["activeLocale"];
9
+ export const extensionT = m["extensionT"];
package/dist/index.js CHANGED
@@ -67,10 +67,12 @@ export const StatusTally = m["StatusTally"];
67
67
  export const StepSection = m["StepSection"];
68
68
  export const TIME_WINDOWS = m["TIME_WINDOWS"];
69
69
  export const ToggleSwitch = m["ToggleSwitch"];
70
+ export const activeLocale = m["activeLocale"];
70
71
  export const appLink = m["appLink"];
71
72
  export const browserOwnsClick = m["browserOwnsClick"];
72
73
  export const clipboardOf = m["clipboardOf"];
73
74
  export const errorMessage = m["errorMessage"];
75
+ export const extensionT = m["extensionT"];
74
76
  export const fixStanceLook = m["fixStanceLook"];
75
77
  export const formatBytes = m["formatBytes"];
76
78
  export const formatDate = m["formatDate"];
@@ -0,0 +1,6 @@
1
+ import { type Locale } from "../../ui/src/i18n/index.js";
2
+ import type { Ref } from "vue";
3
+ export type ExtensionT = (key: string, values?: Record<string, unknown>) => string;
4
+ export declare const extensionT: (extensionId: string) => ExtensionT;
5
+ export declare const activeLocale: Readonly<Ref<Locale>>;
6
+ export type { Locale };
@@ -1,5 +1,6 @@
1
1
  export { AgentRunButton, type AgentRunAttempt, type AgentRunChoice, type AgentRunPicker, type ModelPicking, useAgentRunPick, type FixStanceLook, fixStanceLook, AnchoredOverlay, Avatar, Button, vAction, BarChart, BottomSheet, BrandMark, Card, clipboardOf, browserOwnsClick, appLink, openForwardedPort, ChangeStatusMark, type ChangeStatus, ui, Code, CodeField, ConfirmDialog, ContextMenu, CopyButton, StatusTally, type TallyItem, DagEditor, DagGraph, type DagEdge, type DagNode, DiffStat, DisclosureRow, FilterBar, Icon, type IconName, ImageView, InfoDialog, InfoHint, InfoTable, isRenderableImage, Markdown, MarkdownDocument, MarkdownFigure, Modal, type NavGroup, NavRail, NoteEditor, type NoteDraft, type NoteDraftOptions, useNoteDraft, useKeyedDraft, type NoticeModel, type NoticeTone, type NoticeAction, Notice, NoticeStack, Page, PageAction, PageHeader, ScrollFrame, PersonaFace, type PersonaLike, Picker, ProjectChip, type PickerGroup, type PickerOption, type PickerOptions, ProgressRing, RepoRail, type RepoRailAll, type RepoRailGroup, type RepoRailRow, ProseField, ResizeSeam, ResponsiveOverlay, Row, RowGroup, SearchBar, SegmentedControl, seriesColor, sinceOf, useLoadingReveal, SkeletonRows, SplitView, StatStrip, StatusBadge, type StatusVariant, StepSection, TIME_WINDOWS, type TimeWindow, timeWindowWords, useCompact, useDevice, useListNavigation, useNow, errorMessage, noticeFrom, noticeOf, useAsyncAction, useNarrow, useRailMemory, useScrollReset, type StickyTop, useStickyTop, useTheme, } from "../../ui/src/index.js";
2
2
  export { formatBytes, formatDate, formatDateTime, formatDayMonth, formatDuration, formatTime, formatTimestamp, formatTokens, formatWeekdayTime, freshness, timeAgo, } from "./format.js";
3
+ export { activeLocale, extensionT } from "./i18n.js";
3
4
  export type { BarsFigure, BarsFigureItem, DagFigure, DagFigureEdge, DagFigureNode, Figure, FigureAccent, MermaidFigure, StatsFigure, StatsFigureItem, } from "../../ui/src/markdown/index.js";
4
5
  export { default as Checkbox } from "primevue/checkbox";
5
6
  export type { MenuItem } from "primevue/menuitem";
@@ -18,6 +18,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
18
18
  readonly x: number;
19
19
  readonly y: number;
20
20
  };
21
+ touchPan?: boolean;
21
22
  } & {
22
23
  modelValue?: string | undefined;
23
24
  }) & {
@@ -28,15 +28,15 @@ type __VLS_Slots = {} & {
28
28
  default?: (props: typeof __VLS_88) => any;
29
29
  };
30
30
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
- save: () => any;
32
31
  cancel: () => any;
32
+ save: () => any;
33
33
  remove: () => any;
34
34
  edit: () => any;
35
35
  "update:source": (value: string) => any;
36
36
  "update:confirming": (value: boolean) => any;
37
37
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
38
- onSave?: (() => any) | undefined;
39
38
  onCancel?: (() => any) | undefined;
39
+ onSave?: (() => any) | undefined;
40
40
  onRemove?: (() => any) | undefined;
41
41
  onEdit?: (() => any) | undefined;
42
42
  "onUpdate:source"?: ((value: string) => any) | undefined;
@@ -29,12 +29,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
29
29
  dirty: import("vue").ComputedRef<boolean>;
30
30
  status: import("vue").ComputedRef<string>;
31
31
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
- save: (value: string) => any;
33
32
  change: (value: string) => any;
33
+ save: (value: string) => any;
34
34
  "update:modelValue": (value: string) => any;
35
35
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
36
- onSave?: ((value: string) => any) | undefined;
37
36
  onChange?: ((value: string) => any) | undefined;
37
+ onSave?: ((value: string) => any) | undefined;
38
38
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
39
39
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
40
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -3,6 +3,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
3
3
  props: import("vue").PublicProps & __VLS_PrettifyLocal<{
4
4
  open: boolean;
5
5
  header: string;
6
+ headerIcon?: IconName;
6
7
  confirmLabel: string;
7
8
  confirmIcon?: IconName;
8
9
  items?: readonly T[];
@@ -5,9 +5,12 @@ type __VLS_Props = {
5
5
  scroll?: boolean;
6
6
  dismissable?: boolean;
7
7
  position?: `center` | `top`;
8
+ labelledBy?: string;
8
9
  appendTo?: HTMLElement | string;
9
10
  };
10
- declare var __VLS_12: {}, __VLS_14: {}, __VLS_17: {};
11
+ declare var __VLS_12: {
12
+ titleClass: string;
13
+ }, __VLS_14: {}, __VLS_17: {};
11
14
  type __VLS_Slots = {} & {
12
15
  header?: (props: typeof __VLS_12) => any;
13
16
  } & {
@@ -0,0 +1,24 @@
1
+ import { type ComputedRef, type App } from "vue";
2
+ import { BASE_LOCALE, type Locale } from "./locales.js";
3
+ export type MessageTree = {
4
+ readonly [key: string]: string | MessageTree;
5
+ };
6
+ export interface Catalog {
7
+ readonly namespace?: string;
8
+ readonly base: MessageTree;
9
+ readonly load: (locale: Exclude<Locale, typeof BASE_LOCALE>) => Promise<{
10
+ readonly default: MessageTree;
11
+ }>;
12
+ }
13
+ declare const i18n: import("vue-i18n").I18n<{}, {}, {}, string, false>;
14
+ export declare const activeLocale: ComputedRef<Locale>;
15
+ export declare const registerCatalog: (catalog: Catalog) => Promise<void>;
16
+ export declare const setLocale: (locale: Locale) => Promise<void>;
17
+ export declare const startI18n: () => Promise<void>;
18
+ export declare const installI18n: (app: App) => void;
19
+ export type TypedT = typeof i18n.global.t;
20
+ export type LooseT = (key: string, values?: Record<string, unknown>) => string;
21
+ export declare function useT(): TypedT;
22
+ export declare function useT(namespace: string): LooseT;
23
+ export declare const t: TypedT;
24
+ export { BASE_LOCALE, isLocale, type Locale, LOCALE_CODES, LOCALE_KEY, LOCALES, negotiate } from "./locales.js";
@@ -0,0 +1,7 @@
1
+ import base from "./locales/en.json";
2
+ declare module "vue-i18n" {
3
+ interface DefineLocaleMessage {
4
+ readonly ui: typeof base;
5
+ }
6
+ }
7
+ export { activeLocale, BASE_LOCALE, type Catalog, installI18n, isLocale, type Locale, LOCALE_CODES, LOCALE_KEY, LOCALES, type LooseT, type MessageTree, negotiate, registerCatalog, setLocale, startI18n, t, type TypedT, useT, } from "./i18n.js";
@@ -0,0 +1,32 @@
1
+ export interface LocaleEntry {
2
+ readonly endonym: string;
3
+ readonly tag: string;
4
+ }
5
+ export declare const LOCALES: {
6
+ readonly en: {
7
+ readonly endonym: "English";
8
+ readonly tag: "en";
9
+ };
10
+ readonly de: {
11
+ readonly endonym: "Deutsch";
12
+ readonly tag: "de";
13
+ };
14
+ readonly es: {
15
+ readonly endonym: "Español";
16
+ readonly tag: "es";
17
+ };
18
+ readonly fr: {
19
+ readonly endonym: "Français";
20
+ readonly tag: "fr";
21
+ };
22
+ readonly pl: {
23
+ readonly endonym: "Polski";
24
+ readonly tag: "pl";
25
+ };
26
+ };
27
+ export type Locale = keyof typeof LOCALES;
28
+ export declare const BASE_LOCALE = "en";
29
+ export declare const LOCALE_CODES: readonly Locale[];
30
+ export declare const isLocale: (value: unknown) => value is Locale;
31
+ export declare const negotiate: (preferred: readonly string[]) => Locale;
32
+ export declare const LOCALE_KEY = "ui-locale";
@@ -2,6 +2,7 @@ export declare const formatBytes: (bytes: number | undefined) => string;
2
2
  export declare const formatDuration: (seconds: number) => string;
3
3
  export declare const formatTokens: (tokens: number) => string;
4
4
  export declare const initialsOf: (name: string) => string | undefined;
5
+ export declare const setFormatLocale: (tag: string) => void;
5
6
  export declare const formatDate: (at: number) => string;
6
7
  export declare const formatDayMonth: (at: number) => string;
7
8
  export declare const formatDateTime: (at: number) => string;
@@ -16,6 +16,7 @@ export interface ProbeOptions {
16
16
  readonly onWaiting?: (elapsedMs: number, slow: boolean) => void;
17
17
  readonly stillWanted?: () => boolean;
18
18
  }
19
+ export declare const probePreviewOnce: (url: string) => Promise<PreviewProbe>;
19
20
  export declare const probePreview: (url: string, options?: ProbeOptions) => Promise<PreviewProbe>;
20
21
  export interface ForwardedPortTab {
21
22
  readonly port: number;
package/names.mjs CHANGED
@@ -38,6 +38,8 @@ export const extensionUiNames = [
38
38
  "formatTokens",
39
39
  "formatWeekdayTime",
40
40
  "freshness",
41
+ "activeLocale",
42
+ "extensionT",
41
43
  "Icon",
42
44
  "ImageView",
43
45
  "InfoDialog",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentic/extension-ui",
3
- "version": "1.287.0",
3
+ "version": "1.290.0",
4
4
  "description": "The UI kit intentic extensions render with, host-provided at runtime (the app's own components via the import map), so extension UI is always native to the shell",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -31,6 +31,11 @@
31
31
  "types": "./dist/types/extension-ui/src/format.d.ts",
32
32
  "default": "./dist/format.js"
33
33
  },
34
+ "./i18n": {
35
+ "@intentic/src": "./src/i18n.ts",
36
+ "types": "./dist/types/extension-ui/src/i18n.d.ts",
37
+ "default": "./dist/i18n.js"
38
+ },
34
39
  "./names": "./names.mjs"
35
40
  },
36
41
  "dependencies": {
package/src/i18n.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { activeLocale as active, type Locale, useT } from "@intentic/ui/i18n";
2
+ import type { Ref } from "vue";
3
+
4
+ // The kit's translator, reachable without the component barrel: `index.ts` pulls in every .vue component, which breaks
5
+ // an extension's node-environment tests that have no Vue plugin to parse SFCs with. A source-level door for in-repo
6
+ // extensions and their tests; a git-installed bundle resolves through the import map instead, which carries the same
7
+ // names, and either way the words come from the host's one instance rather than a second copy of vue-i18n.
8
+ //
9
+ // EVERY EXPORT BELOW IS ANNOTATED BY HAND, and that is load-bearing. This package is published; an inferred type here
10
+ // would name `vue-i18n` in the emitted declarations and make an outside extension author install a library they never
11
+ // call, just to type-check. Spelled out, the published types reach no further than `vue` and the locale table.
12
+
13
+ /**
14
+ * Translating an extension's own keys. A plain string rather than a checked union: an extension's catalog belongs to
15
+ * its own package, and no schema on this side has ever seen it.
16
+ */
17
+ export type ExtensionT = (key: string, values?: Record<string, unknown>) => string;
18
+
19
+ /**
20
+ * One extension's translator, bound to the slice of the message tree the host mounted its catalog under. Keys are its
21
+ * own — `t("panel.title")` for what lives at `ext.<id>.panel.title` — so nothing it writes can collide with the app's
22
+ * keys or another extension's.
23
+ *
24
+ * Bind it once per extension rather than per component:
25
+ *
26
+ * ```ts
27
+ * // src/i18n.ts
28
+ * export const t = extensionT(extensionIdOf(manifest));
29
+ * ```
30
+ *
31
+ * The messages themselves are declared on the extension's module (`export const messages`), which the host loads for
32
+ * the reader's language before it calls `activate`.
33
+ */
34
+ export const extensionT = (extensionId: string): ExtensionT => useT(`ext.${extensionId}`);
35
+
36
+ /** The language on screen, for the rare contribution that formats something itself. Read-only: change it with nothing. */
37
+ export const activeLocale: Readonly<Ref<Locale>> = active;
38
+
39
+ export type { Locale };
package/src/index.ts CHANGED
@@ -169,6 +169,11 @@ export {
169
169
  freshness,
170
170
  timeAgo,
171
171
  } from "./format.js";
172
+ // The extension's own words. `extensionT(id)` is the translator for the catalog the host mounted from the module's
173
+ // `messages` export; `activeLocale` is the language on screen, for a contribution that formats something itself.
174
+ // The `Locale` type comes off `@intentic/extension-ui/i18n`, not from here: this file's re-exports become runtime
175
+ // bindings on the host bridge, and a type has none.
176
+ export { activeLocale, extensionT } from "./i18n.js";
172
177
  // Types only, so an extension can build a figure straight from facts it holds instead of round-tripping through
173
178
  // markdown. The parser and document splitter stay in `<Markdown>`, not here.
174
179
  export type {