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

RemoteMessagingFramework component #1114

Merged
merged 40 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
30833b9
Create asana.yml (#1159)
jonathanKingston Oct 24, 2024
9b2b8e3
chore: Start RemoteMessagingFramework component
vkraucunas Oct 16, 2024
809b925
chore: Update RMF components
vkraucunas Oct 19, 2024
e7f88e8
chore: Add to Examples.jsx
vkraucunas Oct 19, 2024
3d4934b
chore: Add to Examples.jsx
vkraucunas Oct 19, 2024
2568b70
chore: Fix styles ref
vkraucunas Oct 19, 2024
a873895
fix: MessageIcon lint
vkraucunas Oct 19, 2024
b20cdc5
chore: Improve the RMF component
vkraucunas Oct 21, 2024
7be2081
fix: Lint
vkraucunas Oct 21, 2024
9b92068
chore: Incorporate the stuff from #1140 that make sense
vkraucunas Oct 21, 2024
e23c087
fix: All the stuff i meant to commit last time
vkraucunas Oct 21, 2024
f92498e
chore: Add more of 1140 solution with small edits
vkraucunas Oct 21, 2024
2b22d9a
fix: Examples.jsx prop mess
vkraucunas Oct 21, 2024
5ed13bd
data example
Oct 21, 2024
7bfe6f8
better types override
Oct 21, 2024
531c3e1
fix: message.icon issues and lint fix
vkraucunas Oct 22, 2024
953a03b
chore: Complete dark mode styles
vkraucunas Oct 22, 2024
2b335ee
re-use a json schema type for icons
Oct 22, 2024
8bb1419
trying to not regress Examples.jsx
vkraucunas Oct 22, 2024
5fdc055
chore: Improve rmf example on new-tab route
vkraucunas Oct 22, 2024
579df6f
chore: Add tests for RMF
vkraucunas Oct 22, 2024
a005adf
fix(attempt): Added an rmfParam to ntp.openPage method
vkraucunas Oct 22, 2024
7861e62
feat: Added type to shared Button component
vkraucunas Oct 23, 2024
9afe9cb
rmf: removed configurability + fixed tests
Oct 23, 2024
2f1bccc
support widgets without config
Oct 23, 2024
25e1b5c
added primary action
Oct 23, 2024
c8bc344
lint
Oct 23, 2024
2b57ca7
chore: Add dismiss and secondaryAction
vkraucunas Oct 24, 2024
29f454e
fix: after rebase
vkraucunas Oct 24, 2024
a0e6b21
fix: RMF test
vkraucunas Oct 24, 2024
28bcf02
fix: RMF test
vkraucunas Oct 24, 2024
c8e45b6
chore: Add the show/hide functionality for the dismissBtn commented o…
vkraucunas Oct 24, 2024
34811f7
fix: Add focus visible css for dismiss btn
vkraucunas Oct 24, 2024
41131b2
fix: Dismiss btn colors
vkraucunas Oct 24, 2024
eaff43b
extract mock data and inert svgs
Oct 24, 2024
f00f0dc
chore: Rm the show/hide code for dismissBtn, update focus ring
vkraucunas Oct 24, 2024
1b5c1b8
fix: Line height messing with inbetween spacing
vkraucunas Oct 24, 2024
babee23
updated tests
Oct 24, 2024
ceef7db
fix: Content spacing
vkraucunas Oct 24, 2024
8e42da9
fix: Margin errors
vkraucunas Oct 25, 2024
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
13 changes: 13 additions & 0 deletions special-pages/messages/new-tab/rmf_dismiss.notify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "RMF Dismiss Action",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
}
}
}
3 changes: 3 additions & 0 deletions special-pages/messages/new-tab/rmf_getData.request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "http://json-schema.org/draft-07/schema#"
}
8 changes: 8 additions & 0 deletions special-pages/messages/new-tab/rmf_getData.response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "types/rmf-message.json"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
"$ref": "types/rmf-message.json"
}
]
}
11 changes: 11 additions & 0 deletions special-pages/messages/new-tab/rmf_primaryAction.notify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "RMF Primary Action",
"type": "object",
"required": ["id"],
"properties": {
"id": {
"type": "string"
}
}
}
13 changes: 13 additions & 0 deletions special-pages/messages/new-tab/rmf_secondaryAction.notify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "RMF Secondary Action",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
}
}
}
146 changes: 146 additions & 0 deletions special-pages/messages/new-tab/types/rmf-message.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "RMF Data",
"description": "The 'content' field is optional. Use that fact to show/hide messages",
"properties": {
"content": {
"title": "RMF Message",
"oneOf": [
{
"title": "Small Message",
"type": "object",
"properties": {
"messageType": {
"const": "small"
},
"id": {
"type": "string"
},
"titleText": {
"type": "string"
},
"descriptionText": {
"type": "string"
}
},
"required": [
"messageType",
"id",
"titleText",
"descriptionText"
]
},
{
"title": "Medium Message",
"type": "object",
"properties": {
"messageType": {
"const": "medium"
},
"id": {
"type": "string"
},
"titleText": {
"type": "string"
},
"descriptionText": {
"type": "string"
},
"icon": {
"$ref": "#/definitions/rmf-icon"
}
},
"required": [
"messageType",
"id",
"titleText",
"descriptionText",
"icon"
]
},
{
"title": "Big Single Action Message",
"type": "object",
"properties": {
"messageType": {
"const": "big_single_action"
},
"id": {
"type": "string"
},
"titleText": {
"type": "string"
},
"descriptionText": {
"type": "string"
},
"icon": {
"$ref": "#/definitions/rmf-icon"
},
"primaryActionText": {
"type": "string"
}
},
"required": [
"messageType",
"id",
"titleText",
"descriptionText",
"icon",
"primaryActionText"
]
},
{
"title": "Big Two Action Message",
"type": "object",
"properties": {
"messageType": {
"const": "big_two_action"
},
"id": {
"type": "string"
},
"titleText": {
"type": "string"
},
"descriptionText": {
"type": "string"
},
"icon": {
"$ref": "#/definitions/rmf-icon"
},
"primaryActionText": {
"type": "string"
},
"secondaryActionText": {
"type": "string"
}
},
"required": [
"messageType",
"id",
"titleText",
"descriptionText",
"icon",
"primaryActionText",
"secondaryActionText"
]
}
]
}
},
"definitions": {
"rmf-icon": {
"title": "RMF Icon",
"type": "string",
"enum": [
"Announce",
"DDGAnnounce",
"CriticalUpdate",
"AppUpdate",
"PrivacyPro"
]
}
}
}
23 changes: 13 additions & 10 deletions special-pages/pages/new-tab/app/components/Components.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Fragment, h } from "preact";
import styles from "./Components.module.css";
import { mainExamples, otherExamples } from "./Examples.jsx";

const url = new URL(window.location.href);

export function Components() {
Expand All @@ -23,7 +22,7 @@ export function Components() {

return (
<div>
<DebugBar id={ids[0]} ids={ids} entries={entries}/>
<DebugBar id={ids[0]} ids={ids} entries={entries} />
<Stage entries={/** @type {any} */(filtered)} />
</div>
)
Expand Down Expand Up @@ -70,18 +69,22 @@ function Stage({ entries }) {
<div class={styles.itemLinks}>
<code>{id}</code>
<a href={next.toString()}
target="_blank"
title="open in new tab">Open 🔗</a>{" "}
target="_blank"
title="open in new tab">Open 🔗</a>{" "}
<a href={without.toString()} hidden={current.length === 0}>Remove</a>
</div>
<div class={styles.itemLinks}>
<a href={selected.toString()}
class={styles.itemLink}
title="show this component only">select</a>{" "}
class={styles.itemLink}
title="show this component only">select</a>{" "}
<a href={next.toString()}
target="_blank"
class={styles.itemLink}
title="isolate this component">isolate</a>{" "}
<a href={e2e.toString()}
target="_blank"
class={styles.itemLink}
title="isolate this component">edge-to-edge</a>
target="_blank"
class={styles.itemLink}
title="isolate this component">edge-to-edge</a>
</div>
</div>
<div className={styles.item} key={id}>
Expand Down Expand Up @@ -180,7 +183,7 @@ function ExampleSelector({ entries, id }) {
if (!(event.target instanceof HTMLSelectElement)) return;
const selectedId = event.target.value;
if (selectedId) {
if (selectedId==="none") return onReset();
if (selectedId === "none") return onReset();
const url = new URL(window.location.href);
url.searchParams.set("id", selectedId);
window.location.href = url.toString();
Expand Down
Loading
Loading