@akcelik/strct 5.10.0 → 5.11.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/fesm2022/akcelik-strct.mjs +1205 -59
- package/fesm2022/akcelik-strct.mjs.map +1 -1
- package/package.json +1 -1
- package/types/akcelik-strct.d.ts +243 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akcelik/strct",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
|
|
5
5
|
"author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
package/types/akcelik-strct.d.ts
CHANGED
|
@@ -700,6 +700,15 @@ declare class StrctListItem {
|
|
|
700
700
|
* row at once; this is the per-row form.
|
|
701
701
|
*/
|
|
702
702
|
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
703
|
+
/**
|
|
704
|
+
* The row cannot be activated — a conversation that cannot be switched away
|
|
705
|
+
* from while a reply arrives. It keeps its tab stop and says
|
|
706
|
+
* `aria-disabled`, so the reason can be read; a keyboard or touch user
|
|
707
|
+
* never sees a `title`.
|
|
708
|
+
*/
|
|
709
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
710
|
+
/** Why it cannot be activated, read as the row's description. */
|
|
711
|
+
readonly disabledReason: _angular_core.InputSignal<string>;
|
|
703
712
|
/** Marks the current row (`aria-current`). */
|
|
704
713
|
readonly selected: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
705
714
|
/** Optional leading rail, as `strct-card [status]`. */
|
|
@@ -708,7 +717,7 @@ declare class StrctListItem {
|
|
|
708
717
|
readonly activated: _angular_core.OutputEmitterRef<void>;
|
|
709
718
|
protected onActivate(): void;
|
|
710
719
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctListItem, never>;
|
|
711
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctListItem, "strct-list-item", never, { "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; }, { "activated": "activated"; }, never, ["[strctListItemLeading]", "*", "[strctListItemDescription]", "[strctListItemMeta]", "[strctListItemTrailing]"], true, never>;
|
|
720
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctListItem, "strct-list-item", never, { "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; }, { "activated": "activated"; }, never, ["[strctListItemLeading]", "*", "[strctListItemDescription]", "[strctListItemMeta]", "[strctListItemTrailing]"], true, never>;
|
|
712
721
|
}
|
|
713
722
|
/**
|
|
714
723
|
* A short list of things with a status — alarms, findings, clusters in a
|
|
@@ -866,6 +875,14 @@ declare class StrctTag {
|
|
|
866
875
|
* The × keeps `removeLabel`.
|
|
867
876
|
*/
|
|
868
877
|
readonly activateLabel: _angular_core.InputSignal<string>;
|
|
878
|
+
/**
|
|
879
|
+
* The tag's body is a link to this address — an object chip in a reply opens
|
|
880
|
+
* the object's page. A link is what a middle click, a Ctrl/Cmd-click and
|
|
881
|
+
* "copy link address" need; `interactive` cannot give them.
|
|
882
|
+
*/
|
|
883
|
+
readonly href: _angular_core.InputSignal<string | null>;
|
|
884
|
+
/** `_blank` adds the `rel` a new tab needs. */
|
|
885
|
+
readonly target: _angular_core.InputSignal<string>;
|
|
869
886
|
/**
|
|
870
887
|
* The body becomes a control: pointer, hover, focus ring, and `activated` on
|
|
871
888
|
* click / Enter / Space. The × stays a separate tab stop, so "open it" and
|
|
@@ -882,7 +899,7 @@ declare class StrctTag {
|
|
|
882
899
|
readonly activated: _angular_core.OutputEmitterRef<void>;
|
|
883
900
|
protected onActivate(): void;
|
|
884
901
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctTag, never>;
|
|
885
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctTag, "strct-tag", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "activateLabel": { "alias": "activateLabel"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "mono": { "alias": "mono"; "required": false; "isSignal": true; }; }, { "removed": "removed"; "activated": "activated"; }, never, ["[strctTagLeading]", "*"], true, never>;
|
|
902
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctTag, "strct-tag", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "removable": { "alias": "removable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "removeLabel": { "alias": "removeLabel"; "required": false; "isSignal": true; }; "activateLabel": { "alias": "activateLabel"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "mono": { "alias": "mono"; "required": false; "isSignal": true; }; }, { "removed": "removed"; "activated": "activated"; }, never, ["[strctTagLeading]", "*", "[strctTagLeading]", "*"], true, never>;
|
|
886
903
|
}
|
|
887
904
|
|
|
888
905
|
/** Avatar size variants. */
|
|
@@ -1711,6 +1728,15 @@ declare class StrctModal {
|
|
|
1711
1728
|
* `dismissible` for lightweight, transient dialogs where quick dismissal is fine.
|
|
1712
1729
|
*/
|
|
1713
1730
|
readonly dismissible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Escape closes the dialog. Defaults to `dismissible`; set it on its own for
|
|
1733
|
+
* a window that should close on Escape — nothing is lost — but not on a
|
|
1734
|
+
* stray click outside it. An Escape a focused control already handled
|
|
1735
|
+
* (`defaultPrevented`) is left alone.
|
|
1736
|
+
*/
|
|
1737
|
+
readonly closeOnEscape: _angular_core.InputSignalWithTransform<boolean | null, string | boolean | null | undefined>;
|
|
1738
|
+
/** A click on the backdrop closes it. Defaults to `dismissible`. */
|
|
1739
|
+
readonly closeOnBackdrop: _angular_core.InputSignalWithTransform<boolean | null, string | boolean | null | undefined>;
|
|
1714
1740
|
/** Allow repositioning the dialog by dragging its header (mouse + touch). */
|
|
1715
1741
|
readonly draggable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1716
1742
|
/** Extra class(es) added to the dialog panel — style it from app-global CSS. */
|
|
@@ -1732,7 +1758,7 @@ declare class StrctModal {
|
|
|
1732
1758
|
constructor();
|
|
1733
1759
|
close(): void;
|
|
1734
1760
|
protected onBackdrop(event?: Event): void;
|
|
1735
|
-
protected onEscape(): void;
|
|
1761
|
+
protected onEscape(event?: Event): void;
|
|
1736
1762
|
/** Wrap Tab focus within the dialog. */
|
|
1737
1763
|
protected onTab(event: Event): void;
|
|
1738
1764
|
/** Dialog translation from its centered position; reset on every open. */
|
|
@@ -1747,7 +1773,7 @@ declare class StrctModal {
|
|
|
1747
1773
|
private focusable;
|
|
1748
1774
|
private focusInitial;
|
|
1749
1775
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctModal, never>;
|
|
1750
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctModal, "strct-modal", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hideFooter": { "alias": "hideFooter"; "required": false; "isSignal": true; }; "chromeless": { "alias": "chromeless"; "required": false; "isSignal": true; }; "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "draggable": { "alias": "draggable"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "backdropClass": { "alias": "backdropClass"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "closed": "closed"; }, ["lazyContent"], ["*", "[strctModalFooter]"], true, never>;
|
|
1776
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctModal, "strct-modal", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hideFooter": { "alias": "hideFooter"; "required": false; "isSignal": true; }; "chromeless": { "alias": "chromeless"; "required": false; "isSignal": true; }; "closeLabel": { "alias": "closeLabel"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnBackdrop": { "alias": "closeOnBackdrop"; "required": false; "isSignal": true; }; "draggable": { "alias": "draggable"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "backdropClass": { "alias": "backdropClass"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "closed": "closed"; }, ["lazyContent"], ["*", "[strctModalFooter]"], true, never>;
|
|
1751
1777
|
}
|
|
1752
1778
|
|
|
1753
1779
|
/** Marks the drawer's footer action area: `<ng-container strctDrawerFooter>…`. */
|
|
@@ -7114,6 +7140,11 @@ declare class StrctWindowDock {
|
|
|
7114
7140
|
/** Who wrote a message. */
|
|
7115
7141
|
type StrctChatAuthor = 'user' | 'assistant' | 'system';
|
|
7116
7142
|
/** A card the message carries — an action to approve, a result to read. */
|
|
7143
|
+
/** A quiet row under the bubble — copy, a status, a fold. */
|
|
7144
|
+
declare class StrctChatMessageActions {
|
|
7145
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctChatMessageActions, never>;
|
|
7146
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StrctChatMessageActions, "[strctChatMessageActions]", never, {}, {}, never, never, true, never>;
|
|
7147
|
+
}
|
|
7117
7148
|
declare class StrctChatAttachment {
|
|
7118
7149
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctChatAttachment, never>;
|
|
7119
7150
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StrctChatAttachment, "[strctChatAttachment]", never, {}, {}, never, never, true, never>;
|
|
@@ -7172,7 +7203,7 @@ declare class StrctChatMessage {
|
|
|
7172
7203
|
protected readonly shortTime: _angular_core.Signal<string>;
|
|
7173
7204
|
protected readonly isoTime: _angular_core.Signal<string | null>;
|
|
7174
7205
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctChatMessage, never>;
|
|
7175
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctChatMessage, "strct-chat-message", never, { "author": { "alias": "author"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "avatarIcon": { "alias": "avatarIcon"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "time": { "alias": "time"; "required": false; "isSignal": true; }; "timeFormat": { "alias": "timeFormat"; "required": false; "isSignal": true; }; "authorNames": { "alias": "authorNames"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[strctChatAttachment]"], true, never>;
|
|
7206
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctChatMessage, "strct-chat-message", never, { "author": { "alias": "author"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "avatarIcon": { "alias": "avatarIcon"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "time": { "alias": "time"; "required": false; "isSignal": true; }; "timeFormat": { "alias": "timeFormat"; "required": false; "isSignal": true; }; "authorNames": { "alias": "authorNames"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[strctChatAttachment]", "[strctChatMessageActions]"], true, never>;
|
|
7176
7207
|
}
|
|
7177
7208
|
/**
|
|
7178
7209
|
* The box the user writes in: it grows with the text up to `maxRows`, sends on
|
|
@@ -7193,6 +7224,16 @@ declare class StrctChatComposer {
|
|
|
7193
7224
|
* while a reply is still streaming. `disabled` stops the typing as well.
|
|
7194
7225
|
*/
|
|
7195
7226
|
readonly sendDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
7227
|
+
/**
|
|
7228
|
+
* A reply is streaming: the one button becomes Stop, where every chat the
|
|
7229
|
+
* operators know puts it. It is enabled whatever the draft holds, and Enter
|
|
7230
|
+
* still never sends — the draft stays editable meanwhile.
|
|
7231
|
+
*/
|
|
7232
|
+
readonly busy: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
7233
|
+
/** What the Stop button is called. */
|
|
7234
|
+
readonly stopLabel: _angular_core.InputSignal<string>;
|
|
7235
|
+
/** The reader asked for the reply to stop. */
|
|
7236
|
+
readonly stop: _angular_core.OutputEmitterRef<void>;
|
|
7196
7237
|
/** How tall the box grows before it scrolls. */
|
|
7197
7238
|
readonly maxRows: _angular_core.InputSignal<number>;
|
|
7198
7239
|
/** The send button's accessible name. */
|
|
@@ -7209,7 +7250,7 @@ declare class StrctChatComposer {
|
|
|
7209
7250
|
protected onEnter(event: Event): void;
|
|
7210
7251
|
submit(): void;
|
|
7211
7252
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctChatComposer, never>;
|
|
7212
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctChatComposer, "strct-chat-composer", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "sendDisabled": { "alias": "sendDisabled"; "required": false; "isSignal": true; }; "maxRows": { "alias": "maxRows"; "required": false; "isSignal": true; }; "sendLabel": { "alias": "sendLabel"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "send": "send"; }, never, never, true, never>;
|
|
7253
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctChatComposer, "strct-chat-composer", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "sendDisabled": { "alias": "sendDisabled"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "stopLabel": { "alias": "stopLabel"; "required": false; "isSignal": true; }; "maxRows": { "alias": "maxRows"; "required": false; "isSignal": true; }; "sendLabel": { "alias": "sendLabel"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "stop": "stop"; "send": "send"; }, never, never, true, never>;
|
|
7213
7254
|
}
|
|
7214
7255
|
|
|
7215
7256
|
/**
|
|
@@ -7940,5 +7981,199 @@ declare function strctCheckHostInputs(host: HTMLElement, selector: string, owns:
|
|
|
7940
7981
|
*/
|
|
7941
7982
|
declare function strctCheckHostDisplay(host: HTMLElement, selector: string, expected: string): void;
|
|
7942
7983
|
|
|
7943
|
-
|
|
7944
|
-
|
|
7984
|
+
/**
|
|
7985
|
+
* A Markdown reader that produces plain objects — never HTML.
|
|
7986
|
+
*
|
|
7987
|
+
* A model's reply is Markdown, and an app that reaches for a Markdown library
|
|
7988
|
+
* ends up handing the browser a string of HTML (`innerHTML` plus a sanitiser),
|
|
7989
|
+
* which a sealed, reviewed build cannot accept. This reader returns a tree the
|
|
7990
|
+
* templates draw with ordinary bindings, so every word reaches the page as a
|
|
7991
|
+
* text node and raw HTML is shown as the characters it is.
|
|
7992
|
+
*
|
|
7993
|
+
* It is deliberately a subset of CommonMark + GFM: paragraphs, ATX headings,
|
|
7994
|
+
* fenced code, lists (nested), block quotes, thematic breaks, tables with
|
|
7995
|
+
* alignment, and inline emphasis / strong / strikethrough / code / links /
|
|
7996
|
+
* autolinks. Everything else is text.
|
|
7997
|
+
*
|
|
7998
|
+
* Every loop is bounded, because the input is a remote model's output.
|
|
7999
|
+
*/
|
|
8000
|
+
/** Hard limits, so hostile input costs a known amount of work. */
|
|
8001
|
+
declare const STRCT_MD_LIMITS: {
|
|
8002
|
+
/** Characters of source read at all. */
|
|
8003
|
+
readonly source: number;
|
|
8004
|
+
/** Lines read at all. */
|
|
8005
|
+
readonly lines: 20000;
|
|
8006
|
+
/** How deep lists and quotes may nest. */
|
|
8007
|
+
readonly depth: 8;
|
|
8008
|
+
/** Inline delimiter runs considered per text span. */
|
|
8009
|
+
readonly delimiters: 2000;
|
|
8010
|
+
};
|
|
8011
|
+
type StrctMdAlign = 'start' | 'center' | 'end' | null;
|
|
8012
|
+
type StrctMdInline = {
|
|
8013
|
+
kind: 'text';
|
|
8014
|
+
text: string;
|
|
8015
|
+
} | {
|
|
8016
|
+
kind: 'code';
|
|
8017
|
+
text: string;
|
|
8018
|
+
} | {
|
|
8019
|
+
kind: 'strong';
|
|
8020
|
+
children: StrctMdInline[];
|
|
8021
|
+
} | {
|
|
8022
|
+
kind: 'em';
|
|
8023
|
+
children: StrctMdInline[];
|
|
8024
|
+
} | {
|
|
8025
|
+
kind: 'del';
|
|
8026
|
+
children: StrctMdInline[];
|
|
8027
|
+
} | {
|
|
8028
|
+
kind: 'link';
|
|
8029
|
+
href: string;
|
|
8030
|
+
children: StrctMdInline[];
|
|
8031
|
+
} | {
|
|
8032
|
+
kind: 'break';
|
|
8033
|
+
}
|
|
8034
|
+
/** A span the consumer claimed through `tokens` — an object chip, a mention. */
|
|
8035
|
+
| {
|
|
8036
|
+
kind: 'token';
|
|
8037
|
+
token: string;
|
|
8038
|
+
text: string;
|
|
8039
|
+
data?: unknown;
|
|
8040
|
+
};
|
|
8041
|
+
type StrctMdBlock = {
|
|
8042
|
+
kind: 'p';
|
|
8043
|
+
inlines: StrctMdInline[];
|
|
8044
|
+
} | {
|
|
8045
|
+
kind: 'heading';
|
|
8046
|
+
level: number;
|
|
8047
|
+
inlines: StrctMdInline[];
|
|
8048
|
+
} | {
|
|
8049
|
+
kind: 'code';
|
|
8050
|
+
text: string;
|
|
8051
|
+
lang: string;
|
|
8052
|
+
closed: boolean;
|
|
8053
|
+
} | {
|
|
8054
|
+
kind: 'list';
|
|
8055
|
+
ordered: boolean;
|
|
8056
|
+
start: number;
|
|
8057
|
+
items: StrctMdBlock[][];
|
|
8058
|
+
} | {
|
|
8059
|
+
kind: 'quote';
|
|
8060
|
+
blocks: StrctMdBlock[];
|
|
8061
|
+
} | {
|
|
8062
|
+
kind: 'rule';
|
|
8063
|
+
} | {
|
|
8064
|
+
kind: 'table';
|
|
8065
|
+
head: StrctMdInline[][];
|
|
8066
|
+
rows: StrctMdInline[][][];
|
|
8067
|
+
align: StrctMdAlign[];
|
|
8068
|
+
};
|
|
8069
|
+
/** What a consumer's `tokens` function returns for one run of text. */
|
|
8070
|
+
interface StrctMdToken {
|
|
8071
|
+
/** Where the token starts in the text it was found in. */
|
|
8072
|
+
start: number;
|
|
8073
|
+
/** How many characters it covers. */
|
|
8074
|
+
length: number;
|
|
8075
|
+
/** Which template draws it. */
|
|
8076
|
+
token: string;
|
|
8077
|
+
/** Anything the template needs. */
|
|
8078
|
+
data?: unknown;
|
|
8079
|
+
}
|
|
8080
|
+
type StrctMdTokenizer = (text: string) => StrctMdToken[];
|
|
8081
|
+
/**
|
|
8082
|
+
* Read Markdown into blocks.
|
|
8083
|
+
*
|
|
8084
|
+
* `streaming` says the source may be cut mid-token: an unterminated fence is
|
|
8085
|
+
* still a code block, so a reply that streams code looks like code from its
|
|
8086
|
+
* first line rather than flashing as a paragraph and then becoming one.
|
|
8087
|
+
*/
|
|
8088
|
+
declare function strctParseMarkdown(source: string, options?: {
|
|
8089
|
+
streaming?: boolean;
|
|
8090
|
+
tokenize?: StrctMdTokenizer;
|
|
8091
|
+
}): StrctMdBlock[];
|
|
8092
|
+
/**
|
|
8093
|
+
* Inline reading. Code spans win over everything (their content is literal),
|
|
8094
|
+
* then links, then the emphasis delimiters — each bounded.
|
|
8095
|
+
*/
|
|
8096
|
+
declare function parseInlines(source: string, options?: {
|
|
8097
|
+
tokenize?: StrctMdTokenizer;
|
|
8098
|
+
}): StrctMdInline[];
|
|
8099
|
+
/**
|
|
8100
|
+
* What a link may do. Anything that is not plainly safe stays the text the
|
|
8101
|
+
* model wrote: `javascript:`, `data:`, a protocol-relative `//host`, or
|
|
8102
|
+
* anything this does not recognise.
|
|
8103
|
+
*/
|
|
8104
|
+
declare function strctClassifyHref(href: string): 'external' | 'internal' | null;
|
|
8105
|
+
|
|
8106
|
+
/**
|
|
8107
|
+
* A template for a span the consumer claimed through `tokens`, keyed by the
|
|
8108
|
+
* token's kind:
|
|
8109
|
+
*
|
|
8110
|
+
* <ng-template strctMarkdownToken="object" let-text let-data="data">
|
|
8111
|
+
* <strct-tag [href]="data.url">{{ text }}</strct-tag>
|
|
8112
|
+
* </ng-template>
|
|
8113
|
+
*/
|
|
8114
|
+
declare class StrctMarkdownToken {
|
|
8115
|
+
/** Which token kind this template draws. */
|
|
8116
|
+
readonly strctMarkdownToken: _angular_core.InputSignal<string>;
|
|
8117
|
+
readonly template: TemplateRef<any>;
|
|
8118
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctMarkdownToken, never>;
|
|
8119
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StrctMarkdownToken, "ng-template[strctMarkdownToken]", never, { "strctMarkdownToken": { "alias": "strctMarkdownToken"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
8120
|
+
}
|
|
8121
|
+
/**
|
|
8122
|
+
* Markdown as a tree of components, never as HTML.
|
|
8123
|
+
*
|
|
8124
|
+
* <strct-markdown [source]="reply()" [streaming]="busy()" />
|
|
8125
|
+
*
|
|
8126
|
+
* A model's reply is Markdown: drawn as plain text it leaves tables as rows of
|
|
8127
|
+
* pipes and `**` everywhere, and an app that reaches for a Markdown library
|
|
8128
|
+
* ends up handing the browser HTML — `innerHTML` plus a sanitiser — which a
|
|
8129
|
+
* sealed, reviewed build cannot accept.
|
|
8130
|
+
*
|
|
8131
|
+
* Every word reaches the page as a text node. Raw HTML is shown as the
|
|
8132
|
+
* characters it is. Images are never loaded: an image's alt text is all a
|
|
8133
|
+
* reader gets. A link opens in a new tab only when it is plainly http(s);
|
|
8134
|
+
* an in-app path is handed to `(navigate)`; anything else — `javascript:`,
|
|
8135
|
+
* `data:`, `//host` — stays the text the model wrote.
|
|
8136
|
+
*/
|
|
8137
|
+
declare class StrctMarkdown {
|
|
8138
|
+
/** The Markdown to read. */
|
|
8139
|
+
readonly source: _angular_core.InputSignal<string>;
|
|
8140
|
+
/**
|
|
8141
|
+
* A tree read elsewhere, instead of `source` — how the component draws the
|
|
8142
|
+
* blocks inside a list item or a quote without re-reading them.
|
|
8143
|
+
*/
|
|
8144
|
+
readonly tree: _angular_core.InputSignal<StrctMdBlock[] | null>;
|
|
8145
|
+
/**
|
|
8146
|
+
* The reply is still arriving: an unterminated fence is already a code
|
|
8147
|
+
* block, so streamed code does not flash as a paragraph first, and the
|
|
8148
|
+
* caret sits at the end of the last line.
|
|
8149
|
+
*/
|
|
8150
|
+
readonly streaming: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
8151
|
+
/**
|
|
8152
|
+
* How far the model's headings are pulled down. A message is a region
|
|
8153
|
+
* inside a dialog, so `#` should not be the page's `h1`: the default of 2
|
|
8154
|
+
* makes it an `h3`.
|
|
8155
|
+
*/
|
|
8156
|
+
readonly headingOffset: _angular_core.InputSignal<number>;
|
|
8157
|
+
/**
|
|
8158
|
+
* What a link may do, when the default rule is not what the app wants.
|
|
8159
|
+
* Returning `null` leaves the link as text.
|
|
8160
|
+
*/
|
|
8161
|
+
readonly linkPolicy: _angular_core.InputSignal<((href: string) => "external" | "internal" | null) | null>;
|
|
8162
|
+
/** Claim runs of plain text — an inventory id becomes an object chip. */
|
|
8163
|
+
readonly tokens: _angular_core.InputSignal<StrctMdTokenizer | null>;
|
|
8164
|
+
/** An in-app link was followed; the consumer routes it. */
|
|
8165
|
+
readonly navigate: _angular_core.OutputEmitterRef<string>;
|
|
8166
|
+
private readonly tokenDefs;
|
|
8167
|
+
protected readonly blocks: _angular_core.Signal<StrctMdBlock[]>;
|
|
8168
|
+
protected level(level: number): number;
|
|
8169
|
+
protected hrefKind(href: string): 'external' | 'internal' | null;
|
|
8170
|
+
protected tokenTemplate(kind: string): TemplateRef<unknown> | null;
|
|
8171
|
+
/** The caret belongs to the last block, and only while streaming. */
|
|
8172
|
+
protected caretOn(index: number): boolean;
|
|
8173
|
+
protected onInternal(event: Event, href: string): void;
|
|
8174
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctMarkdown, never>;
|
|
8175
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctMarkdown, "strct-markdown", never, { "source": { "alias": "source"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "headingOffset": { "alias": "headingOffset"; "required": false; "isSignal": true; }; "linkPolicy": { "alias": "linkPolicy"; "required": false; "isSignal": true; }; "tokens": { "alias": "tokens"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; }, ["tokenDefs"], never, true, never>;
|
|
8176
|
+
}
|
|
8177
|
+
|
|
8178
|
+
export { FOCUSABLE_SELECTOR, STRCT_DP_DOW, STRCT_DP_DOW_FULL, STRCT_DP_MONTHS, STRCT_ICONS, STRCT_ICON_GROUPS, STRCT_ICON_NAMES, STRCT_MASKS, STRCT_MD_LIMITS, STRCT_NOTIFICATION_HISTORY_LIMIT, STRCT_PALETTES, STRCT_RAW_ICONS, STRCT_TIME_RANGE_PRESETS, STRCT_WIZARD_DEFAULTS, StrctAccordion, StrctAccordionPanel, StrctAlert, StrctAlertActions, StrctAnnouncer, StrctAvatar, StrctBadge, StrctBreadcrumb, StrctBreadcrumbItem, StrctButton, StrctButtonGroup, StrctBytesPipe, StrctCard, StrctCardBlock, StrctCardFooter, StrctCardHeader, StrctCardHeaderActions, StrctCardHeaderLeading, StrctCardHeaderMeta, StrctCardHeaderNote, StrctCascadeColumn, StrctCascadeHost, StrctCascadeSelect, StrctCellDef, StrctCellStatus, StrctChange, StrctChart, StrctChatAttachment, StrctChatComposer, StrctChatMessage, StrctChatMessageActions, StrctChatThread, StrctCheckbox, StrctChips, StrctCode, StrctCodeInline, StrctColorPicker, StrctCombobox, StrctCommandPalette, StrctConfirmOutlet, StrctConfirmService, StrctContextMenu, StrctContextMenuTrigger, StrctControlDescription, StrctCopy, StrctDatagrid, StrctDatagridActionBar, StrctDatagridActionBarCaption, StrctDatepicker, StrctDatetimePicker, StrctDesc, StrctDescriptionList, StrctDetailPaneActions, StrctDetailPaneMeta, StrctDetailPaneTitle, StrctDiff, StrctDivider, StrctDonut, StrctDrawer, StrctDrawerFooter, StrctDropdown, StrctDropdownDivider, StrctDropdownItem, StrctDropdownItemAction, StrctDropdownTrigger, StrctDurationPipe, StrctEmptyState, StrctField, StrctFieldGroup, StrctFieldHint, StrctFieldPrefix, StrctFieldSuffix, StrctFieldValue, StrctFile, StrctFilterBar, StrctFlow, StrctFlowNodeTemplate, StrctFooter, StrctGauge, StrctGroupHeaderDef, StrctHeader, StrctHeatmap, StrctHero, StrctHotkeysHelp, StrctHotkeysService, StrctIcon, StrctInlineEdit, StrctInput, StrctInputMask, StrctInputOtp, StrctKbd, StrctKnob, StrctLegend, StrctList, StrctListItem, StrctListItemDescription, StrctListItemLeading, StrctListItemMeta, StrctListItemTrailing, StrctLiveIndicator, StrctLogViewer, StrctLogin, StrctMarkdown, StrctMarkdownToken, StrctMediaFrame, StrctMenuPanel, StrctMenuService, StrctMenubar, StrctMetricTile, StrctModal, StrctModalContent, StrctNav, StrctNavItem, StrctNotificationCenter, StrctNumber, StrctOverlay, StrctPageHeader, StrctPageHeaderActions, StrctPageHeaderCrumbs, StrctPageHeaderTitleMeta, StrctPagination, StrctPassword, StrctPopover, StrctPopoverTrigger, StrctProgress, StrctQr, StrctRadio, StrctRadioGroup, StrctRail, StrctRange, StrctRatePipe, StrctRating, StrctReorder, StrctReorderGroup, StrctReorderHandle, StrctReorderItem, StrctResizeHandle, StrctRowDetailDef, StrctSearchbox, StrctSectionHeader, StrctSectionHeaderActions, StrctSectionHeaderMeta, StrctSectionMenu, StrctSegmented, StrctSelect, StrctShell, StrctShellService, StrctSiPipe, StrctSignpost, StrctSignpostTrigger, StrctSkeleton, StrctSparkline, StrctSpeedDial, StrctSpinner, StrctSplitButton, StrctSplitter, StrctStack, StrctStackItem, StrctStatusDot, StrctStep, StrctStepAction, StrctSteps, StrctSubmenu, StrctTab, StrctTable, StrctTabs, StrctTag, StrctTagLeading, StrctThemeService, StrctThemeSwitcher, StrctTimeRangePicker, StrctTimeline, StrctTimelineItem, StrctToastOutlet, StrctToastService, StrctToggle, StrctToolbar, StrctToolbarCaption, StrctToolbarSpacer, StrctTooltip, StrctTour, StrctTransfer, StrctTree, StrctTreeNode, StrctTreeSelect, StrctVerticalNav, StrctWatermark, StrctWindow, StrctWindowDock, StrctWindowDockItem, StrctWindowService, StrctWizard, StrctWizardAside, __qrInternals, focusFirstIn, keepTabInside, lockBodyScroll, parseAnsi, parseInlines, provideStrctWizardDefaults, registerStrctIcon, restoreFocus, saveFocusedElement, strctCheckHostDisplay, strctCheckHostInputs, strctClassifyHref, strctComputeDiff, strctDpPad, strctFormatBytes, strctFormatDuration, strctFormatRate, strctFormatSi, strctParseMarkdown, strctQrMatrix, strctValidationIcon, strctValidationTone, unlockBodyScroll };
|
|
8179
|
+
export type { StrctAlertType, StrctAvatarSize, StrctAvatarStatus, StrctBadgeStatus, StrctButtonSize, StrctButtonVariant, StrctCascadeOption, StrctCellContext, StrctChartAnnotation, StrctChartColor, StrctChartCurve, StrctChartSeries, StrctChartSlot, StrctChartStatus, StrctChartSummaryInfo, StrctChartThreshold, StrctChartType, StrctChatAuthor, StrctColumn, StrctCommandItem, StrctConfirmOptions, StrctConfirmTone, StrctDatagridColumn, StrctDatagridColumnState, StrctDatagridFilters, StrctDatagridGroup, StrctDatagridLabels, StrctDatagridLazyState, StrctDescAlign, StrctDescItem, StrctDiffRow, StrctDonutSegment, StrctDrawerSide, StrctDrawerSize, StrctEmptyVariant, StrctFilterChip, StrctFlowColumn, StrctFlowDirection, StrctFlowEdge, StrctFlowNode, StrctFlowOrientation, StrctHeatmapCell, StrctHeatmapSummaryInfo, StrctHotkey, StrctIconBadge, StrctIconName, StrctKnobStatus, StrctLegendItem, StrctLiveLabels, StrctLiveState, StrctLogLine, StrctMdAlign, StrctMdBlock, StrctMdInline, StrctMdToken, StrctMdTokenizer, StrctMediaState, StrctMenuItem, StrctMenuLink, StrctMenuOpenOptions, StrctMenuPlacement, StrctMenuSection, StrctMenubarItem, StrctMetricStatus, StrctModalSize, StrctMode, StrctNotification, StrctOption, StrctOverlayPlacement, StrctPalette, StrctPaletteInfo, StrctProgressSegment, StrctProgressStatus, StrctQrEcc, StrctRailItem, StrctRailStatus, StrctReorderEvent, StrctReorderMoveEvent, StrctRow, StrctRowId, StrctSegmentedOption, StrctSegmentedSize, StrctSignpostPosition, StrctSpeedDialDirection, StrctSpinnerSize, StrctStatus, StrctStatusDotSize, StrctStepPhase, StrctStepState, StrctStepsLabels, StrctTagStatus, StrctThresholds, StrctTimeRange, StrctTimeRangePreset, StrctTimelineState, StrctToast, StrctToastOptions, StrctToastType, StrctTooltipPosition, StrctTourStep, StrctTransferItem, StrctTreeDropEvent, StrctTreeMenuEvent, StrctTreeNodeData, StrctTreeNodeMenuFn, StrctValidationState, StrctValidationStatus, StrctWindowBounds, StrctWindowLabels, StrctWindowOutsidePointer, StrctWizardDefaults };
|