Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] TextBlock.style #5607

Merged
merged 32 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0bf7b0a
Schema 1.4 (#5317)
dclaux Mar 11, 2021
ab2f950
[JS] Add support for Universal Actions (#5533)
dclaux Mar 11, 2021
0117e42
Update Action.Execute.json
paulcam206 Mar 11, 2021
8eb4886
[Shared] 1.4 - Action.Execute (#5539)
golddove Mar 15, 2021
7fe39f0
[.NET] Add support for parsing schema 1.4 features (#5531)
Mar 17, 2021
eb9d82f
[Android] Action.Execute support (#5551)
golddove Mar 17, 2021
05c4544
[iOS] Action.Execute Changes (#5549)
jwoo-msft Mar 18, 2021
a70a0e9
[UWP] Add parsing of schema 1.4 changes and Action.Excute support (#5…
Mar 18, 2021
45de88e
Add validation + Action.Execute test card
paulcam206 Mar 18, 2021
3304e6c
[iOS] updated text view to update its intrinsic content size dynamica…
jwoo-msft Mar 18, 2021
8c913fe
[JS] Universal Action designer support + some bug fixes (#5565)
dclaux Mar 19, 2021
bfe1a6e
[JS] Action.description and TextBlock.style
dclaux Mar 22, 2021
1f70fe1
version update for Android
jwoo-msft Mar 22, 2021
6b80f0f
description --> tooltip
dclaux Mar 22, 2021
71353df
Bump custom.props version
paulcam206 Mar 23, 2021
0f3eda0
[JS] Updated package deps
paulcam206 Mar 23, 2021
db35574
[JS] Updated package versions
paulcam206 Mar 23, 2021
f2a6de4
Metrics for layout structure comparison (#5576)
Keerthana786 Mar 24, 2021
2257e48
Merge branch 'release/schema-1.4'
paulcam206 Mar 24, 2021
a8993ea
[shared] Parser support for TextBlock headings changes (#5577)
jwoo-msft Mar 25, 2021
b178d44
[iOS] Text heading changes (#5584)
jwoo-msft Mar 26, 2021
b7e9b44
[Android][Accessibility] TextBlock style: heading (#5587)
golddove Mar 26, 2021
111f32b
[UWP][Shared] Implement Text Heading Object model for UWP and fix sha…
Mar 30, 2021
2f418ad
Remove tooltip implementation
dclaux Mar 31, 2021
4cdff16
Remove tooltip from schema
dclaux Mar 31, 2021
9b4aa0c
Remove tooltip (description) from designer
dclaux Mar 31, 2021
d85058c
Merge remote-tracking branch 'origin/feature/TextHeading' into js/too…
dclaux Mar 31, 2021
1b20803
Restore Action.accessibleTitle
dclaux Mar 31, 2021
f1dc5fb
Add TextBlock.headingLevel to HostConfig
dclaux Apr 1, 2021
64e8cd1
HostConfig.textBlock -> HostConfig.headings
dclaux Apr 1, 2021
d214e1c
Merge branch 'release/js-1.5-preview' into js/tooltips-headings
dclaux Apr 2, 2021
f74d5d2
Designer fix after rebasing to js-1.5-preview
dclaux Apr 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions source/nodejs/adaptivecards/src/card-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,12 @@ export class TextBlock extends BaseTextBlock {

if (this.style === "heading") {
element.setAttribute("role", "heading");
element.setAttribute("aria-level", GlobalSettings.defaultHeadingLevel.toString());

let headingLevel = this.hostConfig.headings.level;

if (headingLevel !== undefined) {
element.setAttribute("aria-level", headingLevel.toString());
}
}

if (this.selectAction && hostConfig.supportsInteractivity) {
Expand Down Expand Up @@ -3874,6 +3879,7 @@ export abstract class Action extends CardObject {
raiseExecuteActionEvent(this);
}

accessibleTitle?: string;
expanded?: boolean;

onExecute: (sender: Action) => void;
Expand Down Expand Up @@ -3914,7 +3920,11 @@ export abstract class Action extends CardObject {

this.addCssClasses(buttonElement);

if (this.effectiveTooltip) {
if (this.accessibleTitle) {
buttonElement.setAttribute("aria-label", this.accessibleTitle);
buttonElement.title = this.accessibleTitle;
}
else if (this.effectiveTooltip) {
buttonElement.setAttribute("aria-label", this.effectiveTooltip);
buttonElement.title = this.effectiveTooltip;
}
Expand Down
11 changes: 11 additions & 0 deletions source/nodejs/adaptivecards/src/host-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ export class FactSetConfig {
}
}

export class HeadingsConfig {
level?: number;

constructor(obj?: any) {
if (obj) {
this.level = obj.level !== undefined && obj.level !== null && typeof obj.level === "number" ? obj.level : this.level;
}
}
}

export class ShowCardActionConfig {
actionMode: Enums.ShowCardActionMode = Enums.ShowCardActionMode.Inline;
inlineTopMargin: number = 16;
Expand Down Expand Up @@ -586,6 +596,7 @@ export class HostConfig {
readonly imageSet: ImageSetConfig = new ImageSetConfig();
readonly media: MediaConfig = new MediaConfig();
readonly factSet: FactSetConfig = new FactSetConfig();
readonly headings: HeadingsConfig = new HeadingsConfig();

cssClassNamePrefix?: string;
alwaysAllowBleed: boolean = false;
Expand Down
1 change: 0 additions & 1 deletion source/nodejs/adaptivecards/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export class GlobalSettings {
static enableFallback: boolean = true;
static useWebkitLineClamp: boolean = true;
static allowMoreThanMaxActionsInOverflowMenu: boolean = false;
static defaultHeadingLevel: number = 2;

static readonly applets: AppletsSettings = {
logEnabled: true,
Expand Down