@stina/extension-api 1.9.0 → 1.17.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/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/schemas/index.cjs +35 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +391 -1
- package/dist/schemas/index.d.ts +391 -1
- package/dist/schemas/index.js +32 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/{types.tools-DcFBsfRV.d.cts → types.tools-DswDxtun.d.cts} +80 -1
- package/dist/{types.tools-DcFBsfRV.d.ts → types.tools-DswDxtun.d.ts} +80 -1
- package/package.json +1 -1
- package/schema/extension-manifest.schema.json +4 -0
- package/src/index.ts +5 -0
- package/src/schemas/components.schema.ts +39 -0
- package/src/schemas/contributions.schema.ts +8 -0
- package/src/schemas/index.ts +3 -0
- package/src/types.components.ts +57 -0
- package/src/types.contributions.ts +32 -0
- package/src/types.ts +2 -0
|
@@ -770,6 +770,60 @@ interface CalendarEventProps extends ExtensionComponentData {
|
|
|
770
770
|
/** One short line of context. */
|
|
771
771
|
notes?: string;
|
|
772
772
|
}
|
|
773
|
+
/**
|
|
774
|
+
* One event on an agenda.
|
|
775
|
+
*
|
|
776
|
+
* Timestamps rather than worded times, for the same reason as `CalendarEvent`:
|
|
777
|
+
* the agenda is about where today stands, and it can only keep that true if it
|
|
778
|
+
* knows when things actually start and end.
|
|
779
|
+
*/
|
|
780
|
+
interface AgendaEvent {
|
|
781
|
+
/** Handed back to `onEventClickAction` as `$event.id`. Not shown. */
|
|
782
|
+
id?: string;
|
|
783
|
+
title: string;
|
|
784
|
+
/** ISO 8601, with an offset. */
|
|
785
|
+
start: string;
|
|
786
|
+
/** ISO 8601, with an offset. Absent for an event with no stated end. */
|
|
787
|
+
end?: string;
|
|
788
|
+
/** Drawn as a chip above the day's list rather than in it. */
|
|
789
|
+
allDay?: boolean;
|
|
790
|
+
/** One quiet line under the title: a place, a meeting link, a room. */
|
|
791
|
+
detail?: string;
|
|
792
|
+
}
|
|
793
|
+
/** One day on an agenda, as the caller groups them. */
|
|
794
|
+
interface AgendaDay {
|
|
795
|
+
/** The day's heading, e.g. "Idag". */
|
|
796
|
+
label: string;
|
|
797
|
+
/** A quieter line beside the heading, e.g. "tis 6 okt". */
|
|
798
|
+
date?: string;
|
|
799
|
+
events: AgendaEvent[];
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* The extension API properties for the Agenda component.
|
|
803
|
+
*
|
|
804
|
+
* A day's schedule that knows what time it is. What is behind us recedes, what
|
|
805
|
+
* is running is lifted out with its progress drawn down its edge, what comes
|
|
806
|
+
* next counts down, and a line marks the gap we are in. The host works all of
|
|
807
|
+
* that out from the timestamps and keeps it current while the panel is open.
|
|
808
|
+
*
|
|
809
|
+
* For milestones, or anything whose times are words rather than instants, use
|
|
810
|
+
* `Timeline`. This is for a schedule.
|
|
811
|
+
*/
|
|
812
|
+
interface AgendaProps extends ExtensionComponentData {
|
|
813
|
+
component: 'Agenda';
|
|
814
|
+
/** Heading above the days. */
|
|
815
|
+
title?: string;
|
|
816
|
+
/** Icon shown to the left of the title. */
|
|
817
|
+
icon?: HugeIconName;
|
|
818
|
+
days: AgendaDay[];
|
|
819
|
+
/**
|
|
820
|
+
* Word clashes: "Krockar med 11:00", "2 samtidigt". Off by default, since a
|
|
821
|
+
* schedule of lessons or training sessions has nothing to warn about.
|
|
822
|
+
*/
|
|
823
|
+
warnOverlaps?: boolean;
|
|
824
|
+
/** Called when an event is clicked, with the event in scope as `$event`. */
|
|
825
|
+
onEventClickAction?: ExtensionActionRef;
|
|
826
|
+
}
|
|
773
827
|
|
|
774
828
|
/**
|
|
775
829
|
* What an extension can contribute to Stina
|
|
@@ -840,6 +894,29 @@ interface AccountContribution {
|
|
|
840
894
|
/** Why the extension needs them, shown next to the scopes in the settings. */
|
|
841
895
|
reason?: LocalizedString;
|
|
842
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* What a settings view is about, which decides where Stina shows it.
|
|
899
|
+
*
|
|
900
|
+
* An extension never picks a place in the settings menu: the menu belongs to Stina and
|
|
901
|
+
* changes between versions. It says what the view is *about*, and Stina puts each topic
|
|
902
|
+
* where it belongs, the way `accounts`, `providers` and `statusCards` already work.
|
|
903
|
+
*
|
|
904
|
+
* - `accounts`: connects Stina to an account or a service (a mailbox, a calendar feed).
|
|
905
|
+
* Shown with the other connected accounts.
|
|
906
|
+
* - `notifications`: when and how the extension may get in touch. Shown with Stina's own
|
|
907
|
+
* notification settings.
|
|
908
|
+
* - `personal`: facts about the user the extension relies on (a home town for the
|
|
909
|
+
* weather). Shown with the profile.
|
|
910
|
+
* - `tracking`: things Stina keeps track of for the user that are worth looking through
|
|
911
|
+
* now and then (people, projects, reminders). Gets its own row in the register.
|
|
912
|
+
*
|
|
913
|
+
* A view without a topic, or with one this version of Stina does not know, is shown on
|
|
914
|
+
* the extension's own page. That is always a working place, only a less fitting one, so
|
|
915
|
+
* a topic added later never breaks an older Stina.
|
|
916
|
+
*/
|
|
917
|
+
type ExtensionSettingsTopic = 'accounts' | 'notifications' | 'personal' | 'tracking';
|
|
918
|
+
/** Every topic this version of the API knows, in no particular order. */
|
|
919
|
+
declare const EXTENSION_SETTINGS_TOPICS: readonly ExtensionSettingsTopic[];
|
|
843
920
|
/**
|
|
844
921
|
* Tool settings view definition (UI schema)
|
|
845
922
|
*/
|
|
@@ -850,6 +927,8 @@ interface ToolSettingsViewDefinition {
|
|
|
850
927
|
title: string;
|
|
851
928
|
/** Help text */
|
|
852
929
|
description?: string;
|
|
930
|
+
/** What the view is about, and so where Stina shows it. See {@link ExtensionSettingsTopic}. */
|
|
931
|
+
topic?: ExtensionSettingsTopic;
|
|
853
932
|
/** View configuration */
|
|
854
933
|
view: ToolSettingsView;
|
|
855
934
|
}
|
|
@@ -2611,4 +2690,4 @@ interface ActionResult {
|
|
|
2611
2690
|
error?: string;
|
|
2612
2691
|
}
|
|
2613
2692
|
|
|
2614
|
-
export { type
|
|
2693
|
+
export { type AttachmentsAPI as $, type ActionResult as A, type ExtensionContext as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SettingsAPI as F, type GetModelsOptions as G, type HugeIconName as H, type ProvidersAPI as I, type ToolsAPI as J, type ActionsAPI as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type EventsAPI as O, type PanelDefinition as P, type SchedulerAPI as Q, type SchedulerJobRequest as R, type SchedulerFirePayload as S, type ToolResult as T, type SchedulerSchedule as U, type VoiceSessionOptions as V, type UserAPI as W, type UserProfile as X, type ChatAPI as Y, type ChatInstructionMessage as Z, type ConversationPresentation as _, type ChatOptions as a, type PillProps as a$, type AttachmentContent as a0, type ConnectedAccountsAPI as a1, type ConnectedAccount as a2, type AccountAccessToken as a3, type LogAPI as a4, type BackgroundWorkersAPI as a5, type BackgroundTaskConfig as a6, type BackgroundTaskCallback as a7, type BackgroundTaskContext as a8, type BackgroundTaskHealth as a9, type HeaderProps as aA, type LabelProps as aB, type ClockProps as aC, type ParagraphProps as aD, type ButtonProps as aE, type TextInputProps as aF, type PasswordInputProps as aG, type NumberInputProps as aH, type TextAreaProps as aI, type DateTimeInputProps as aJ, type SelectProps as aK, type IconPickerProps as aL, type VerticalStackProps as aM, type HorizontalStackProps as aN, type GridProps as aO, type DividerProps as aP, type IconProps as aQ, type IconButtonType as aR, type IconButtonProps as aS, type PanelAction as aT, type PanelProps as aU, type ToggleProps as aV, type CollapsibleProps as aW, type FrameVariant as aX, type FrameProps as aY, type ListProps as aZ, type PillVariant as a_, type BackgroundRestartPolicy as aa, type Query as ab, type QueryOptions as ac, type StorageAPI as ad, type SecretsAPI as ae, type StorageCollectionConfig as af, type StorageContributions as ag, type AIProvider as ah, type ModelCapabilities as ai, type ChatImage as aj, type ChatFile as ak, type ToolCall as al, type VoiceTransportRequest as am, type Tool as an, type ToolAttachment as ao, type Action as ap, type ExtensionModule as aq, type AllowedCSSProperty as ar, type ExtensionComponentStyle as as, type ExtensionComponentData as at, type ExtensionComponentIterator as au, type ExtensionComponentChildren as av, type ExtensionActionCall as aw, type ExtensionActionRef as ax, type ExtensionDataSource as ay, type ExtensionPanelDefinition as az, type StreamEvent as b, type CheckboxProps as b0, type MarkdownProps as b1, type TextPreviewProps as b2, type ModalProps as b3, type ConditionalGroupProps as b4, type WeatherCondition as b5, type WeatherWind as b6, type WeatherNowProps as b7, type WeatherForecastStep as b8, type WeatherForecastProps as b9, type ChartKind as ba, type ChartSeries as bb, type ChartProps as bc, type StatTrend as bd, type StatTileProps as be, type ProgressShape as bf, type ProgressColor as bg, type ProgressBarProps as bh, type KeyValueRow as bi, type KeyValueListProps as bj, type TimelineVariant as bk, type TimelineEntry as bl, type TimelineProps as bm, type NoteVariant as bn, type NoteProps as bo, type CalendarEventStatus as bp, type CalendarEventProps as bq, type AgendaEvent as br, type AgendaDay as bs, type AgendaProps as bt, type ExecutionContext as bu, type VoiceSessionDescriptor as c, EXTENSION_SETTINGS_TOPICS as d, type ToolSettingsViewDefinition as e, type ExtensionSettingsTopic as f, type ToolSettingsView as g, type ToolSettingsListView as h, type ToolSettingsListMapping as i, type ToolSettingsComponentView as j, type ToolSettingsActionDataSource as k, type StatusCardDefinition as l, type PanelView as m, type PanelComponentView as n, type PanelActionDataSource as o, type PanelUnknownView as p, type ProviderDefinition as q, resolveLocalizedString as r, type ProviderConfigView as s, type PromptContribution as t, type PromptSection as u, type ToolDefinition as v, type ToolConfirmationConfig as w, type CommandDefinition as x, type AccountProvider as y, type AccountContribution as z };
|
|
@@ -770,6 +770,60 @@ interface CalendarEventProps extends ExtensionComponentData {
|
|
|
770
770
|
/** One short line of context. */
|
|
771
771
|
notes?: string;
|
|
772
772
|
}
|
|
773
|
+
/**
|
|
774
|
+
* One event on an agenda.
|
|
775
|
+
*
|
|
776
|
+
* Timestamps rather than worded times, for the same reason as `CalendarEvent`:
|
|
777
|
+
* the agenda is about where today stands, and it can only keep that true if it
|
|
778
|
+
* knows when things actually start and end.
|
|
779
|
+
*/
|
|
780
|
+
interface AgendaEvent {
|
|
781
|
+
/** Handed back to `onEventClickAction` as `$event.id`. Not shown. */
|
|
782
|
+
id?: string;
|
|
783
|
+
title: string;
|
|
784
|
+
/** ISO 8601, with an offset. */
|
|
785
|
+
start: string;
|
|
786
|
+
/** ISO 8601, with an offset. Absent for an event with no stated end. */
|
|
787
|
+
end?: string;
|
|
788
|
+
/** Drawn as a chip above the day's list rather than in it. */
|
|
789
|
+
allDay?: boolean;
|
|
790
|
+
/** One quiet line under the title: a place, a meeting link, a room. */
|
|
791
|
+
detail?: string;
|
|
792
|
+
}
|
|
793
|
+
/** One day on an agenda, as the caller groups them. */
|
|
794
|
+
interface AgendaDay {
|
|
795
|
+
/** The day's heading, e.g. "Idag". */
|
|
796
|
+
label: string;
|
|
797
|
+
/** A quieter line beside the heading, e.g. "tis 6 okt". */
|
|
798
|
+
date?: string;
|
|
799
|
+
events: AgendaEvent[];
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* The extension API properties for the Agenda component.
|
|
803
|
+
*
|
|
804
|
+
* A day's schedule that knows what time it is. What is behind us recedes, what
|
|
805
|
+
* is running is lifted out with its progress drawn down its edge, what comes
|
|
806
|
+
* next counts down, and a line marks the gap we are in. The host works all of
|
|
807
|
+
* that out from the timestamps and keeps it current while the panel is open.
|
|
808
|
+
*
|
|
809
|
+
* For milestones, or anything whose times are words rather than instants, use
|
|
810
|
+
* `Timeline`. This is for a schedule.
|
|
811
|
+
*/
|
|
812
|
+
interface AgendaProps extends ExtensionComponentData {
|
|
813
|
+
component: 'Agenda';
|
|
814
|
+
/** Heading above the days. */
|
|
815
|
+
title?: string;
|
|
816
|
+
/** Icon shown to the left of the title. */
|
|
817
|
+
icon?: HugeIconName;
|
|
818
|
+
days: AgendaDay[];
|
|
819
|
+
/**
|
|
820
|
+
* Word clashes: "Krockar med 11:00", "2 samtidigt". Off by default, since a
|
|
821
|
+
* schedule of lessons or training sessions has nothing to warn about.
|
|
822
|
+
*/
|
|
823
|
+
warnOverlaps?: boolean;
|
|
824
|
+
/** Called when an event is clicked, with the event in scope as `$event`. */
|
|
825
|
+
onEventClickAction?: ExtensionActionRef;
|
|
826
|
+
}
|
|
773
827
|
|
|
774
828
|
/**
|
|
775
829
|
* What an extension can contribute to Stina
|
|
@@ -840,6 +894,29 @@ interface AccountContribution {
|
|
|
840
894
|
/** Why the extension needs them, shown next to the scopes in the settings. */
|
|
841
895
|
reason?: LocalizedString;
|
|
842
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* What a settings view is about, which decides where Stina shows it.
|
|
899
|
+
*
|
|
900
|
+
* An extension never picks a place in the settings menu: the menu belongs to Stina and
|
|
901
|
+
* changes between versions. It says what the view is *about*, and Stina puts each topic
|
|
902
|
+
* where it belongs, the way `accounts`, `providers` and `statusCards` already work.
|
|
903
|
+
*
|
|
904
|
+
* - `accounts`: connects Stina to an account or a service (a mailbox, a calendar feed).
|
|
905
|
+
* Shown with the other connected accounts.
|
|
906
|
+
* - `notifications`: when and how the extension may get in touch. Shown with Stina's own
|
|
907
|
+
* notification settings.
|
|
908
|
+
* - `personal`: facts about the user the extension relies on (a home town for the
|
|
909
|
+
* weather). Shown with the profile.
|
|
910
|
+
* - `tracking`: things Stina keeps track of for the user that are worth looking through
|
|
911
|
+
* now and then (people, projects, reminders). Gets its own row in the register.
|
|
912
|
+
*
|
|
913
|
+
* A view without a topic, or with one this version of Stina does not know, is shown on
|
|
914
|
+
* the extension's own page. That is always a working place, only a less fitting one, so
|
|
915
|
+
* a topic added later never breaks an older Stina.
|
|
916
|
+
*/
|
|
917
|
+
type ExtensionSettingsTopic = 'accounts' | 'notifications' | 'personal' | 'tracking';
|
|
918
|
+
/** Every topic this version of the API knows, in no particular order. */
|
|
919
|
+
declare const EXTENSION_SETTINGS_TOPICS: readonly ExtensionSettingsTopic[];
|
|
843
920
|
/**
|
|
844
921
|
* Tool settings view definition (UI schema)
|
|
845
922
|
*/
|
|
@@ -850,6 +927,8 @@ interface ToolSettingsViewDefinition {
|
|
|
850
927
|
title: string;
|
|
851
928
|
/** Help text */
|
|
852
929
|
description?: string;
|
|
930
|
+
/** What the view is about, and so where Stina shows it. See {@link ExtensionSettingsTopic}. */
|
|
931
|
+
topic?: ExtensionSettingsTopic;
|
|
853
932
|
/** View configuration */
|
|
854
933
|
view: ToolSettingsView;
|
|
855
934
|
}
|
|
@@ -2611,4 +2690,4 @@ interface ActionResult {
|
|
|
2611
2690
|
error?: string;
|
|
2612
2691
|
}
|
|
2613
2692
|
|
|
2614
|
-
export { type
|
|
2693
|
+
export { type AttachmentsAPI as $, type ActionResult as A, type ExtensionContext as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SettingsAPI as F, type GetModelsOptions as G, type HugeIconName as H, type ProvidersAPI as I, type ToolsAPI as J, type ActionsAPI as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type EventsAPI as O, type PanelDefinition as P, type SchedulerAPI as Q, type SchedulerJobRequest as R, type SchedulerFirePayload as S, type ToolResult as T, type SchedulerSchedule as U, type VoiceSessionOptions as V, type UserAPI as W, type UserProfile as X, type ChatAPI as Y, type ChatInstructionMessage as Z, type ConversationPresentation as _, type ChatOptions as a, type PillProps as a$, type AttachmentContent as a0, type ConnectedAccountsAPI as a1, type ConnectedAccount as a2, type AccountAccessToken as a3, type LogAPI as a4, type BackgroundWorkersAPI as a5, type BackgroundTaskConfig as a6, type BackgroundTaskCallback as a7, type BackgroundTaskContext as a8, type BackgroundTaskHealth as a9, type HeaderProps as aA, type LabelProps as aB, type ClockProps as aC, type ParagraphProps as aD, type ButtonProps as aE, type TextInputProps as aF, type PasswordInputProps as aG, type NumberInputProps as aH, type TextAreaProps as aI, type DateTimeInputProps as aJ, type SelectProps as aK, type IconPickerProps as aL, type VerticalStackProps as aM, type HorizontalStackProps as aN, type GridProps as aO, type DividerProps as aP, type IconProps as aQ, type IconButtonType as aR, type IconButtonProps as aS, type PanelAction as aT, type PanelProps as aU, type ToggleProps as aV, type CollapsibleProps as aW, type FrameVariant as aX, type FrameProps as aY, type ListProps as aZ, type PillVariant as a_, type BackgroundRestartPolicy as aa, type Query as ab, type QueryOptions as ac, type StorageAPI as ad, type SecretsAPI as ae, type StorageCollectionConfig as af, type StorageContributions as ag, type AIProvider as ah, type ModelCapabilities as ai, type ChatImage as aj, type ChatFile as ak, type ToolCall as al, type VoiceTransportRequest as am, type Tool as an, type ToolAttachment as ao, type Action as ap, type ExtensionModule as aq, type AllowedCSSProperty as ar, type ExtensionComponentStyle as as, type ExtensionComponentData as at, type ExtensionComponentIterator as au, type ExtensionComponentChildren as av, type ExtensionActionCall as aw, type ExtensionActionRef as ax, type ExtensionDataSource as ay, type ExtensionPanelDefinition as az, type StreamEvent as b, type CheckboxProps as b0, type MarkdownProps as b1, type TextPreviewProps as b2, type ModalProps as b3, type ConditionalGroupProps as b4, type WeatherCondition as b5, type WeatherWind as b6, type WeatherNowProps as b7, type WeatherForecastStep as b8, type WeatherForecastProps as b9, type ChartKind as ba, type ChartSeries as bb, type ChartProps as bc, type StatTrend as bd, type StatTileProps as be, type ProgressShape as bf, type ProgressColor as bg, type ProgressBarProps as bh, type KeyValueRow as bi, type KeyValueListProps as bj, type TimelineVariant as bk, type TimelineEntry as bl, type TimelineProps as bm, type NoteVariant as bn, type NoteProps as bo, type CalendarEventStatus as bp, type CalendarEventProps as bq, type AgendaEvent as br, type AgendaDay as bs, type AgendaProps as bt, type ExecutionContext as bu, type VoiceSessionDescriptor as c, EXTENSION_SETTINGS_TOPICS as d, type ToolSettingsViewDefinition as e, type ExtensionSettingsTopic as f, type ToolSettingsView as g, type ToolSettingsListView as h, type ToolSettingsListMapping as i, type ToolSettingsComponentView as j, type ToolSettingsActionDataSource as k, type StatusCardDefinition as l, type PanelView as m, type PanelComponentView as n, type PanelActionDataSource as o, type PanelUnknownView as p, type ProviderDefinition as q, resolveLocalizedString as r, type ProviderConfigView as s, type PromptContribution as t, type PromptSection as u, type ToolDefinition as v, type ToolConfirmationConfig as w, type CommandDefinition as x, type AccountProvider as y, type AccountContribution as z };
|
package/package.json
CHANGED
|
@@ -163,6 +163,10 @@
|
|
|
163
163
|
"type": "string",
|
|
164
164
|
"description": "Help text"
|
|
165
165
|
},
|
|
166
|
+
"topic": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"description": "What the view is about, which decides where Stina shows it: accounts, notifications, personal or tracking. Without one, or with one Stina does not know, the view is shown on the extension's own page."
|
|
169
|
+
},
|
|
166
170
|
"view": {
|
|
167
171
|
"anyOf": [
|
|
168
172
|
{
|
package/src/index.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// Localization
|
|
11
11
|
export type { LocalizedString } from './types.js'
|
|
12
12
|
export { resolveLocalizedString } from './types.js'
|
|
13
|
+
export { EXTENSION_SETTINGS_TOPICS } from './types.js'
|
|
13
14
|
|
|
14
15
|
// Types
|
|
15
16
|
export type {
|
|
@@ -18,6 +19,7 @@ export type {
|
|
|
18
19
|
Platform,
|
|
19
20
|
ExtensionContributions,
|
|
20
21
|
ToolSettingsViewDefinition,
|
|
22
|
+
ExtensionSettingsTopic,
|
|
21
23
|
ToolSettingsView,
|
|
22
24
|
ToolSettingsListView,
|
|
23
25
|
ToolSettingsListMapping,
|
|
@@ -226,4 +228,7 @@ export type {
|
|
|
226
228
|
NoteProps,
|
|
227
229
|
CalendarEventStatus,
|
|
228
230
|
CalendarEventProps,
|
|
231
|
+
AgendaEvent,
|
|
232
|
+
AgendaDay,
|
|
233
|
+
AgendaProps,
|
|
229
234
|
} from './types.components.js'
|
|
@@ -774,6 +774,42 @@ export const CalendarEventPropsSchema = z
|
|
|
774
774
|
.passthrough()
|
|
775
775
|
.describe('Single calendar event component')
|
|
776
776
|
|
|
777
|
+
export const AgendaEventSchema = z
|
|
778
|
+
.object({
|
|
779
|
+
id: z.string().optional().describe('Handed back to onEventClickAction as $event.id'),
|
|
780
|
+
title: z.string(),
|
|
781
|
+
start: z.string().describe('ISO 8601 with an offset'),
|
|
782
|
+
end: z.string().optional().describe('ISO 8601 with an offset'),
|
|
783
|
+
allDay: z.boolean().optional(),
|
|
784
|
+
detail: z.string().optional().describe('One quiet line under the title'),
|
|
785
|
+
})
|
|
786
|
+
.passthrough()
|
|
787
|
+
.describe('One agenda event')
|
|
788
|
+
|
|
789
|
+
export const AgendaDaySchema = z
|
|
790
|
+
.object({
|
|
791
|
+
label: z.string().describe('The day heading'),
|
|
792
|
+
date: z.string().optional().describe('A quieter line beside the heading'),
|
|
793
|
+
events: z.array(AgendaEventSchema),
|
|
794
|
+
})
|
|
795
|
+
.passthrough()
|
|
796
|
+
.describe('One agenda day')
|
|
797
|
+
|
|
798
|
+
export const AgendaPropsSchema = z
|
|
799
|
+
.object({
|
|
800
|
+
component: z.literal('Agenda'),
|
|
801
|
+
title: z.string().optional(),
|
|
802
|
+
icon: z.string().optional().describe('Icon shown to the left of the title'),
|
|
803
|
+
days: z.array(AgendaDaySchema),
|
|
804
|
+
warnOverlaps: z.boolean().optional().describe('Word clashes between events'),
|
|
805
|
+
onEventClickAction: ExtensionActionRefSchema.optional().describe(
|
|
806
|
+
'Action to call when an event is clicked, with the event as $event'
|
|
807
|
+
),
|
|
808
|
+
style: ExtensionComponentStyleSchema.optional(),
|
|
809
|
+
})
|
|
810
|
+
.passthrough()
|
|
811
|
+
.describe('Schedule component that tracks the current time')
|
|
812
|
+
|
|
777
813
|
// =============================================================================
|
|
778
814
|
// Type Exports
|
|
779
815
|
// =============================================================================
|
|
@@ -841,3 +877,6 @@ export type NoteVariant = z.infer<typeof NoteVariantSchema>
|
|
|
841
877
|
export type NoteProps = z.infer<typeof NotePropsSchema>
|
|
842
878
|
export type CalendarEventStatus = z.infer<typeof CalendarEventStatusSchema>
|
|
843
879
|
export type CalendarEventProps = z.infer<typeof CalendarEventPropsSchema>
|
|
880
|
+
export type AgendaEvent = z.infer<typeof AgendaEventSchema>
|
|
881
|
+
export type AgendaDay = z.infer<typeof AgendaDaySchema>
|
|
882
|
+
export type AgendaProps = z.infer<typeof AgendaPropsSchema>
|
|
@@ -117,6 +117,14 @@ export const ToolSettingsViewDefinitionSchema = z
|
|
|
117
117
|
id: z.string().describe('Unique view ID within the extension'),
|
|
118
118
|
title: z.string().describe('Display title'),
|
|
119
119
|
description: z.string().optional().describe('Help text'),
|
|
120
|
+
// A string rather than the known topics: one this host does not know yet must not stop
|
|
121
|
+
// the extension installing, it only lands on the extension's own page.
|
|
122
|
+
topic: z
|
|
123
|
+
.string()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe(
|
|
126
|
+
'What the view is about, which decides where Stina shows it: accounts, notifications, personal or tracking. Without one, or with one Stina does not know, the view is shown on the extension\'s own page.'
|
|
127
|
+
),
|
|
120
128
|
view: ToolSettingsViewSchema.describe('View configuration'),
|
|
121
129
|
})
|
|
122
130
|
.describe('Tool settings view definition')
|
package/src/schemas/index.ts
CHANGED
|
@@ -149,6 +149,9 @@ export {
|
|
|
149
149
|
NotePropsSchema,
|
|
150
150
|
CalendarEventStatusSchema,
|
|
151
151
|
CalendarEventPropsSchema,
|
|
152
|
+
AgendaEventSchema,
|
|
153
|
+
AgendaDaySchema,
|
|
154
|
+
AgendaPropsSchema,
|
|
152
155
|
type ExtensionComponentData,
|
|
153
156
|
type ExtensionComponentStyle,
|
|
154
157
|
type ExtensionActionCall,
|
package/src/types.components.ts
CHANGED
|
@@ -959,3 +959,60 @@ export interface CalendarEventProps extends ExtensionComponentData {
|
|
|
959
959
|
/** One short line of context. */
|
|
960
960
|
notes?: string
|
|
961
961
|
}
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* One event on an agenda.
|
|
965
|
+
*
|
|
966
|
+
* Timestamps rather than worded times, for the same reason as `CalendarEvent`:
|
|
967
|
+
* the agenda is about where today stands, and it can only keep that true if it
|
|
968
|
+
* knows when things actually start and end.
|
|
969
|
+
*/
|
|
970
|
+
export interface AgendaEvent {
|
|
971
|
+
/** Handed back to `onEventClickAction` as `$event.id`. Not shown. */
|
|
972
|
+
id?: string
|
|
973
|
+
title: string
|
|
974
|
+
/** ISO 8601, with an offset. */
|
|
975
|
+
start: string
|
|
976
|
+
/** ISO 8601, with an offset. Absent for an event with no stated end. */
|
|
977
|
+
end?: string
|
|
978
|
+
/** Drawn as a chip above the day's list rather than in it. */
|
|
979
|
+
allDay?: boolean
|
|
980
|
+
/** One quiet line under the title: a place, a meeting link, a room. */
|
|
981
|
+
detail?: string
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/** One day on an agenda, as the caller groups them. */
|
|
985
|
+
export interface AgendaDay {
|
|
986
|
+
/** The day's heading, e.g. "Idag". */
|
|
987
|
+
label: string
|
|
988
|
+
/** A quieter line beside the heading, e.g. "tis 6 okt". */
|
|
989
|
+
date?: string
|
|
990
|
+
events: AgendaEvent[]
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* The extension API properties for the Agenda component.
|
|
995
|
+
*
|
|
996
|
+
* A day's schedule that knows what time it is. What is behind us recedes, what
|
|
997
|
+
* is running is lifted out with its progress drawn down its edge, what comes
|
|
998
|
+
* next counts down, and a line marks the gap we are in. The host works all of
|
|
999
|
+
* that out from the timestamps and keeps it current while the panel is open.
|
|
1000
|
+
*
|
|
1001
|
+
* For milestones, or anything whose times are words rather than instants, use
|
|
1002
|
+
* `Timeline`. This is for a schedule.
|
|
1003
|
+
*/
|
|
1004
|
+
export interface AgendaProps extends ExtensionComponentData {
|
|
1005
|
+
component: 'Agenda'
|
|
1006
|
+
/** Heading above the days. */
|
|
1007
|
+
title?: string
|
|
1008
|
+
/** Icon shown to the left of the title. */
|
|
1009
|
+
icon?: HugeIconName
|
|
1010
|
+
days: AgendaDay[]
|
|
1011
|
+
/**
|
|
1012
|
+
* Word clashes: "Krockar med 11:00", "2 samtidigt". Off by default, since a
|
|
1013
|
+
* schedule of lessons or training sessions has nothing to warn about.
|
|
1014
|
+
*/
|
|
1015
|
+
warnOverlaps?: boolean
|
|
1016
|
+
/** Called when an event is clicked, with the event in scope as `$event`. */
|
|
1017
|
+
onEventClickAction?: ExtensionActionRef
|
|
1018
|
+
}
|
|
@@ -87,6 +87,36 @@ export interface AccountContribution {
|
|
|
87
87
|
// Tool Settings Views
|
|
88
88
|
// ============================================================================
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* What a settings view is about, which decides where Stina shows it.
|
|
92
|
+
*
|
|
93
|
+
* An extension never picks a place in the settings menu: the menu belongs to Stina and
|
|
94
|
+
* changes between versions. It says what the view is *about*, and Stina puts each topic
|
|
95
|
+
* where it belongs, the way `accounts`, `providers` and `statusCards` already work.
|
|
96
|
+
*
|
|
97
|
+
* - `accounts`: connects Stina to an account or a service (a mailbox, a calendar feed).
|
|
98
|
+
* Shown with the other connected accounts.
|
|
99
|
+
* - `notifications`: when and how the extension may get in touch. Shown with Stina's own
|
|
100
|
+
* notification settings.
|
|
101
|
+
* - `personal`: facts about the user the extension relies on (a home town for the
|
|
102
|
+
* weather). Shown with the profile.
|
|
103
|
+
* - `tracking`: things Stina keeps track of for the user that are worth looking through
|
|
104
|
+
* now and then (people, projects, reminders). Gets its own row in the register.
|
|
105
|
+
*
|
|
106
|
+
* A view without a topic, or with one this version of Stina does not know, is shown on
|
|
107
|
+
* the extension's own page. That is always a working place, only a less fitting one, so
|
|
108
|
+
* a topic added later never breaks an older Stina.
|
|
109
|
+
*/
|
|
110
|
+
export type ExtensionSettingsTopic = 'accounts' | 'notifications' | 'personal' | 'tracking'
|
|
111
|
+
|
|
112
|
+
/** Every topic this version of the API knows, in no particular order. */
|
|
113
|
+
export const EXTENSION_SETTINGS_TOPICS: readonly ExtensionSettingsTopic[] = [
|
|
114
|
+
'accounts',
|
|
115
|
+
'notifications',
|
|
116
|
+
'personal',
|
|
117
|
+
'tracking',
|
|
118
|
+
]
|
|
119
|
+
|
|
90
120
|
/**
|
|
91
121
|
* Tool settings view definition (UI schema)
|
|
92
122
|
*/
|
|
@@ -97,6 +127,8 @@ export interface ToolSettingsViewDefinition {
|
|
|
97
127
|
title: string
|
|
98
128
|
/** Help text */
|
|
99
129
|
description?: string
|
|
130
|
+
/** What the view is about, and so where Stina shows it. See {@link ExtensionSettingsTopic}. */
|
|
131
|
+
topic?: ExtensionSettingsTopic
|
|
100
132
|
/** View configuration */
|
|
101
133
|
view: ToolSettingsView
|
|
102
134
|
}
|
package/src/types.ts
CHANGED
|
@@ -24,6 +24,7 @@ export type {
|
|
|
24
24
|
ExtensionContributions,
|
|
25
25
|
// Tool Settings Views
|
|
26
26
|
ToolSettingsViewDefinition,
|
|
27
|
+
ExtensionSettingsTopic,
|
|
27
28
|
ToolSettingsView,
|
|
28
29
|
ToolSettingsListView,
|
|
29
30
|
ToolSettingsListMapping,
|
|
@@ -51,6 +52,7 @@ export type {
|
|
|
51
52
|
AccountProvider,
|
|
52
53
|
AccountContribution,
|
|
53
54
|
} from './types.contributions.js'
|
|
55
|
+
export { EXTENSION_SETTINGS_TOPICS } from './types.contributions.js'
|
|
54
56
|
|
|
55
57
|
// Manifest
|
|
56
58
|
export type { ExtensionManifest, Platform } from './types.manifest.js'
|