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

Giving developers control over the Windows Icon Background color option in the packaging form #3892

Merged
merged 33 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
faf9e70
working on screen sizes > 530px, need to figure out how to adjust for…
Jaylyn-Barbee Jan 19, 2023
3870dfd
centered canvas
Jaylyn-Barbee Jan 19, 2023
1cd926c
share card ready for polishing with sana, functionally done!
Jaylyn-Barbee Jan 20, 2023
a14f89c
merged dev into share card
Jaylyn-Barbee Jan 23, 2023
8b63cfb
share-card polishing
Jaylyn-Barbee Jan 23, 2023
cf89b90
removed and replaced the share icon inside the modal with the same on…
Jaylyn-Barbee Jan 23, 2023
f468eea
figuring out how to dynamically show diff buttons to share depending …
Jaylyn-Barbee Jan 23, 2023
df9374a
Share feature done and ready for testing!
Jaylyn-Barbee Jan 24, 2023
67d46be
Merge pull request #3789 from pwa-builder/jay/dev/share-card
Jaylyn-Barbee Jan 24, 2023
14e9d1a
switched up the langauge on the sw and security details to be consist…
Jaylyn-Barbee Jan 24, 2023
f7f9182
adding accent colors to the progress rings on report page
Jaylyn-Barbee Jan 24, 2023
bf5c26d
added colored progress rings to report card page
Jaylyn-Barbee Jan 24, 2023
b4a1233
fixed small bug with filled progress rings
Jaylyn-Barbee Jan 25, 2023
28e5021
simplified css for filled progress rings
Jaylyn-Barbee Jan 25, 2023
ca8ece5
removing fill on progress rings in app-report
Jaylyn-Barbee Jan 30, 2023
a958af1
removed trailing slash visually from the app card at the top of the r…
Jaylyn-Barbee Feb 7, 2023
6ba50e6
Testing fix for action items pane resizing on paging. (#3828)
Jaylyn-Barbee Feb 7, 2023
542a400
Resizing Action Items Pane fix (#3833)
Jaylyn-Barbee Feb 8, 2023
b755a9e
Removes hard requirement of having a service worker to be able to pac…
Jaylyn-Barbee Feb 21, 2023
43b50a2
test on wkflw
Jaylyn-Barbee Feb 21, 2023
2857b91
made it so that action items populate as they come in instead of wait…
Jaylyn-Barbee Feb 22, 2023
e1bcb32
ready to be properly designed, placeholder tooltip link in as well
Jaylyn-Barbee Feb 28, 2023
175a05b
merging dev so i can merge with no conflicts
Jaylyn-Barbee Feb 28, 2023
1eef447
almost done, just need to make the radios our purple
Jaylyn-Barbee Mar 1, 2023
66ff1a6
finished the implementation of the color picker however, shoelace rew…
Jaylyn-Barbee Mar 2, 2023
05edc75
done for now
Jaylyn-Barbee Mar 3, 2023
0734e53
Merge remote-tracking branch 'origin' into jay/icon-bg
Jaylyn-Barbee Mar 7, 2023
5dee2fc
removing unecessary files for merge to main
Jaylyn-Barbee Mar 7, 2023
baa7591
fixed some stuff from PR review: removed unneeded code block and cons…
Jaylyn-Barbee Mar 7, 2023
d5c30d0
Merge branch 'main' into jay/icon-bg
Jaylyn-Barbee Mar 7, 2023
b2fe9ee
removed unused import
Jaylyn-Barbee Mar 7, 2023
b0298ef
Merge branch 'main' into jay/icon-bg
nmetulev Mar 14, 2023
2b36b4f
Merge branch 'main' into jay/icon-bg
Jaylyn-Barbee Mar 20, 2023
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
273 changes: 110 additions & 163 deletions apps/pwabuilder/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/pwabuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@pwabuilder/manifest-editor": "file:../../components/manifest-editor",
"@pwabuilder/manifest-validation": "file:../../libraries/manifest-validation",
"@pwabuilder/site-analytics": "file:../../libraries/site-analytics",
"@shoelace-style/shoelace": "^2.0.0-beta.83",
"@shoelace-style/shoelace": "^2.2.0",
"@vaadin/router": "^1.7.4",
"browser-fs-access": "^0.23.0",
"colorjs.io": "^0.4.0",
Expand Down
10 changes: 5 additions & 5 deletions apps/pwabuilder/src/script/components/publish-pane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export class PublishPane extends LitElement {
title: 'Windows',
factoids: [
Jaylyn-Barbee marked this conversation as resolved.
Show resolved Hide resolved
"PWAs can be indistinguishable from native apps on Windows",
"PWAs are first class applications.",
"Collect 100% of revenue generated via third party commerce platforms.",
"1B+ store enabled devices."
"PWAs are first class applications",
"Collect 100% of revenue generated via third party commerce platforms",
"1B+ store enabled devices"
],
isActionCard: true,
icon: '/assets/Publish_Windows.svg',
Expand All @@ -99,8 +99,8 @@ export class PublishPane extends LitElement {
title: 'iOS',
factoids: [
"Leverage same codebase across all platforms",
"Large user base.",
"Premium devices."
"Large user base",
"Premium devices"
],
isActionCard: true,
icon: '/assets/Publish_Apple.svg',
Expand Down
6 changes: 3 additions & 3 deletions apps/pwabuilder/src/script/components/test-publish-pane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export class TestPublishPane extends LitElement {
title: 'Windows',
factoids: [
"PWAs can be indistinguishable from native apps on Windows",
"PWAs are first class applications.",
"Collect 100% of revenue generated via third party commerce platforms.",
"1B+ store enabled devices."
"PWAs are first class applications",
"Collect 100% of revenue generated via third party commerce platforms",
"1B+ store enabled devices"
],
isActionCard: true,
icon: '/assets/Publish_Windows.svg',
Expand Down
126 changes: 110 additions & 16 deletions apps/pwabuilder/src/script/components/windows-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import { ManifestContext, PackageOptions } from '../utils/interfaces';
export class WindowsForm extends AppPackageFormBase {
@property({ type: Boolean }) generating: boolean = false;
@state() showAdvanced = false;
@state() customSelected = false;
@state() initialBgColor: string = '';
@state() currentSelectedColor: string = '';
@state() packageOptions: WindowsPackageOptions = emptyWindowsPackageOptions();
@state() activeLanguages: string[] = [];
@state() activeLanguageCodes: string[] = [];
Expand Down Expand Up @@ -93,28 +96,38 @@ export class WindowsForm extends AppPackageFormBase {
color: rgba(0,0,0,.5);
}

#color-input-holder {
display: flex;
align-items: center;
gap: 10px;
}

#color-input-holder p {
margin: 0;
color: var(--secondary-font-color);
}

:host{
--sl-focus-ring-width: 3px;
--sl-input-focus-ring-color: #4f3fb670;
--sl-focus-ring: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
--sl-input-border-color-focus: #4F3FB6ac;
--sl-input-font-size-small: 22px;

}

#languageDrop::part(control){
#languageDrop::part(display-input){
min-height: 40px;
}

#languageDrop::part(tag__base){
height: 35px;
#languageDrop::part(tag){
font-size: var(--body-font-size);
color: #757575;
background-color: #f0f0f0;
border-radius: var(--input-border-radius);
padding: 8px 15px;
gap: 40px;
}

#languageDrop::part(menu){
#languageDrop::part(listbox){
background-color: #ffffff;
height: 200px;
overflow-y: scroll;
Expand All @@ -123,17 +136,17 @@ export class WindowsForm extends AppPackageFormBase {
margin-top: 3px;
}

#languageDrop sl-menu-item::part(base){
#languageDrop sl-option::part(base){
font-size: var(--body-font-size);
color: #757575;
}

#languageDrop sl-menu-item:focus-within::part(base) {
#languageDrop sl-option:focus-within::part(base) {
color: #ffffff;
background-color: #4F3FB6;
}

#languageDrop sl-menu-item::part(base):hover{
#languageDrop sl-option::part(base):hover{
color: #ffffff;
background-color: #4F3FB6;
}
Expand All @@ -142,6 +155,23 @@ export class WindowsForm extends AppPackageFormBase {
font-size: var(--body-font-size);
color: #757575;
}

sl-color-picker {
--grid-width: 315px;
height: 25px;
}

sl-color-picker::part(trigger){
border-radius: 0;
height: 25px;
width: 75px;
display: flex;
}

.color-radio::part(control--checked){
background-color: var(--primary-color);
border-color: var(--primary-color);
}

`
];
Expand All @@ -164,6 +194,9 @@ export class WindowsForm extends AppPackageFormBase {
);

this.packageOptions.targetDeviceFamilies = ['Desktop', 'Holographic'];

this.customSelected = this.packageOptions.images?.backgroundColor != 'transparent';
this.initialBgColor = this.currentSelectedColor = (this.packageOptions.images?.backgroundColor as string);
}

toggleSettings(settingsToggleValue: 'basic' | 'advanced') {
Expand Down Expand Up @@ -248,29 +281,77 @@ export class WindowsForm extends AppPackageFormBase {
<sl-select id="languageDrop"
placeholder="Select one or more languages"
@sl-change=${(e: any) => this.handleLanguage(e)}
.value=${this.packageOptions.resourceLanguage!}
value=${this.packageOptions.resourceLanguage!}
jgw96 marked this conversation as resolved.
Show resolved Hide resolved
?stayopenonselect=${true}
multiple
.maxTagsVisible=${5}
.maxOptionsVisible=${5}
size="small"
>
${windowsLanguages.map((lang: any) =>
html`
${lang.codes.map((code: string) =>
html`
<sl-menu-item value=${code}>${lang.name} - ${code}</sl-menu-item>
<sl-option value=${code}>${lang.name} - ${code}</sl-option>
`
)}
`
)}
<!-- ${windowsLanguages.map((lang: any) => html`
<sl-menu-item value=${lang.codes[0]}>${lang.name}</sl-menu-item>
`)} -->
</sl-select>
</div>
</div>
`;
}

renderColorPicker(formInput: FormInput): TemplateResult {
return html`
<label for="${formInput.inputId}">
${formInput.label}
${this.renderTooltip(formInput)}
</label>
<div id="iconColorPicker">
<div class="color-wrap">
<p class="sub-multi">Select your Windows icons background color</p>
<sl-radio-group
id="icon-bg-radio-group"
.value=${this.packageOptions!.images!.backgroundColor === 'transparent' ? 'transparent' : 'custom'}
@sl-change=${() => this.toggleIconBgRadios()}
>
<sl-radio class="color-radio" size="small" value="transparent">Transparent</sl-radio>
<sl-radio class="color-radio" size="small" value="custom">Custom Color</sl-radio>
</sl-radio-group>
${this.customSelected ? html`
<div id="color-input-holder">
<sl-color-picker
id="icon-bg-color"
value=${this.packageOptions.images!.backgroundColor || 'transparent'}
@sl-change=${() => this.switchIconBgColor()}
></sl-color-picker>
<p>${this.currentSelectedColor}</p>
</div>
` : html``}
</div>
</div>
`;
}

toggleIconBgRadios(){
let input = (this.shadowRoot?.getElementById("icon-bg-radio-group") as any);
let selected = input.value;
this.customSelected = selected !== 'transparent';
if(!this.customSelected){
this.packageOptions.images!.backgroundColor = 'transparent';
} else {
this.packageOptions.images!.backgroundColor = this.initialBgColor;
this.currentSelectedColor = this.initialBgColor;
}
}

switchIconBgColor(){
let input = (this.shadowRoot?.getElementById("icon-bg-color") as any);
let formattedValue = input.getFormattedValue('hex')
this.packageOptions.images!.backgroundColor = this.currentSelectedColor = formattedValue;
}

handleLanguage(e: any){
this.packageOptions.resourceLanguage = e.target.value;
}
Expand Down Expand Up @@ -422,6 +503,19 @@ export class WindowsForm extends AppPackageFormBase {
(this.packageOptions.images!.baseImage = val),
})}
</div>
<div class="form-group">
${this.renderColorPicker({
Jaylyn-Barbee marked this conversation as resolved.
Show resolved Hide resolved
label: 'Icon Background Color',
tooltip: `Optional. The background color of the Windows icons that will be generated with your .msix.`,
tooltipLink:
'https://learn.microsoft.com/en-us/windows/apps/design/style/iconography/app-icon-design#color-contrast',
inputId: 'icon-bg-color-input',
value: this.packageOptions.images!.backgroundColor || 'transparent',
placeholder: 'transparent',
inputHandler: (val: string) =>
(this.packageOptions.images!.backgroundColor = val),
})}
</div>
<div class="form-group">
${this.renderMultiSelect({
label: 'Language',
Expand Down Expand Up @@ -486,7 +580,7 @@ export class WindowsForm extends AppPackageFormBase {
})}
</div>
</div>
<div class="form-group" id="target-device-families">
<div class="form-group" id="widgets-picker">
<label>Widgets</label>
<div class="form-check">
${this.renderFormInput({
Expand Down
8 changes: 1 addition & 7 deletions apps/pwabuilder/src/script/pages/app-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1650,12 +1650,6 @@ export class AppReport extends LitElement {
this.pageNumber = 1;
}

copyReportCardLink() {
navigator.clipboard.writeText(window.location.href).then(() => {
setTimeout(() =>{this.shadowRoot!.querySelector("#cl-mani-tooltip")!.removeAttribute('open')}, 2000)
})
}

// Opens manifest editor and tracks analytics
async openManifestEditorModal() {
let dialog: any = this.shadowRoot!.querySelector("manifest-editor-frame")!.shadowRoot!.querySelector(".dialog");
Expand Down Expand Up @@ -2461,7 +2455,7 @@ export class AppReport extends LitElement {
}

</sl-dialog>

<publish-pane></publish-pane>
<test-publish-pane></test-publish-pane>
${this.manifestDataLoading ? html`` : html`<manifest-editor-frame .isGenerated=${this.createdManifest} @readyForRetest=${() => this.addRetestTodo("Manifest")}></manifest-editor-frame>`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const windowsLanguages = [
{ "codes": ["et", "et-ee"], "name": "Estonian" },
{ "codes": ["fil", "fil-latn", "fil-ph"], "name": "Filipino" },
{ "codes": ["fi", "fi-fi"], "name": "Finnish" },
{ "codes": ["fr", "fr-be ", "fr-ca ", "fr-ch ", "fr-fr ", "fr-lu", "fr-015", "fr-cd", "fr-ci", "fr-cm", "fr-ht", "fr-ma", "fr-mc", "fr-ml", "fr-re", "frc-latn", "frp-latn", "fr-155", "fr-029", "fr-021", "fr-011"], "name": "French" },
{ "codes": ["fr", "fr-be", "fr-ca", "fr-ch", "fr-fr", "fr-lu", "fr-015", "fr-cd", "fr-ci", "fr-cm", "fr-ht", "fr-ma", "fr-mc", "fr-ml", "fr-re", "frc-latn", "frp-latn", "fr-155", "fr-029", "fr-021", "fr-011"], "name": "French" },
{ "codes": ["gl", "gl-es"], "name": "Galician" },
{ "codes": ["ka", "ka-ge"], "name": "Georgian" },
{ "codes": ["de", "de-at", "de-ch", "de-de", "de-lu", "de-li"], "name": "German" },
Expand Down
1 change: 1 addition & 0 deletions apps/pwabuilder/src/shoelace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import '@shoelace-style/shoelace/dist/components/tab-panel/tab-panel';
import '@shoelace-style/shoelace/dist/components/textarea/textarea';
import '@shoelace-style/shoelace/dist/components/tooltip/tooltip';
import '@shoelace-style/shoelace/dist/components/skeleton/skeleton';
import '@shoelace-style/shoelace/dist/components/option/option';


// also needed for site
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export class ManifestIconsForm extends LitElement {
static get styles() {
return css`

:host {
--sl-input-font-family: Hind, sans-serif;
}


sl-checkbox::part(base),
sl-checkbox::part(control),
sl-button::part(base) {
Expand Down
13 changes: 7 additions & 6 deletions components/manifest-editor/src/components/manifest-info-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ export class ManifestInfoForm extends LitElement {
--sl-input-focus-ring-color: #4f3fb670;
--sl-focus-ring: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
--sl-input-border-color-focus: #4F3FB6ac;
--sl-input-font-family: Hind, sans-serif;
}

sl-input::part(base),
sl-textarea::part(base),
sl-menu-item::part(base),
sl-option::part(base),
sl-color-picker::part(base),
sl-button::part(base) {
--sl-input-font-size-medium: 16px;
Expand Down Expand Up @@ -166,12 +167,12 @@ export class ManifestInfoForm extends LitElement {
width: 100%;
}

sl-menu-item:focus-within::part(base) {
sl-option:focus-within::part(base) {
color: #ffffff;
background-color: #4F3FB6;
}

sl-menu-item::part(base):hover{
sl-option::part(base):hover{
color: #ffffff;
background-color: #4F3FB6;
}
Expand Down Expand Up @@ -212,7 +213,7 @@ export class ManifestInfoForm extends LitElement {

@media(max-width: 480px){
sl-input::part(base),
sl-menu-item::part(base) {
sl-option::part(base) {
--sl-input-font-size-medium: 14px;
--sl-font-size-medium: 14px;
--sl-input-height-medium: 2.5em;
Expand Down Expand Up @@ -594,7 +595,7 @@ export class ManifestInfoForm extends LitElement {
<p class="field-desc">Select a Background color</p>
<span class="color-holder">
<div class="color-section">
<sl-color-picker id="background_color_picker" value=${this.manifest.background_color! || defaultColor} hoist=${true} data-field="background_color" .swatches=${[]} @sl-change=${() => this.handleColorSwitch("background_color")}></sl-color-picker>
<sl-color-picker id="background_color_picker" value=${this.manifest.background_color! || defaultColor} hoist=${true} data-field="background_color" @sl-change=${() => this.handleColorSwitch("background_color")}></sl-color-picker>
<p id="background_color_string" class="color_string">${this.manifest.background_color?.toLocaleUpperCase() || defaultColor}</p>
</div>
</span>
Expand All @@ -618,7 +619,7 @@ export class ManifestInfoForm extends LitElement {
<p class="field-desc">Select a Theme color</p>
<span class="color-holder">
<div class="color-section">
<sl-color-picker id="theme_color_picker" value=${this.manifest.theme_color! || defaultColor} hoist=${true} data-field="theme_color" .swatches=${[]} @sl-change=${() => this.handleColorSwitch("theme_color")}></sl-color-picker>
<sl-color-picker id="theme_color_picker" value=${this.manifest.theme_color! || defaultColor} hoist=${true} data-field="theme_color" @sl-change=${() => this.handleColorSwitch("theme_color")}></sl-color-picker>
<p id="theme_color_string" class="color_string">${this.manifest.theme_color?.toLocaleUpperCase() || defaultColor}</p>
</div>
</span>
Expand Down
Loading