From 36b1616b618d2645bd2f6484748dc971085b6985 Mon Sep 17 00:00:00 2001 From: Zack Murry Date: Sat, 9 Jul 2022 18:54:28 -0500 Subject: [PATCH] Version 0.2 --- README.md | 6 +- index.md | 6 +- public/icons/128.png | Bin 2591 -> 3229 bytes public/icons/16.png | Bin 265 -> 744 bytes public/icons/32.png | Bin 632 -> 1405 bytes public/icons/64.png | Bin 1256 -> 3080 bytes public/manifest.json | 4 +- src/App.tsx | 215 ++++++++++++++++++++++--------------------- src/content.ts | 19 ++-- src/theme.ts | 3 +- 10 files changed, 132 insertions(+), 121 deletions(-) diff --git a/README.md b/README.md index 4f5194fb..5b3ca3d9 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ The `highlight` action has a configuration option for the color of the highlight ![Highlight configuration screenshot](docs/highlight_configuration.png) -Docs Hotkey is able to highlight in all of the colors in the Google Docs color palette. To find the name of a color you wish to highlight in, open the highlight menu in Google Docs and hover over the color. This will show a tooltip with the name of the color, which can be entered into the `highlight` configuration. Note that the highlight color should be entered exactly as shown by Google Docs, including case. +Docs Hotkey is able to highlight in all of the colors in the Google Docs color palette. To find the name of a color you wish to highlight in, open the highlight menu in Google Docs and hover over the color. This will show a tooltip with the name of the color, which can be entered into the `highlight` configuration. ![Highlight color palette](docs/highlight_palette.png) @@ -87,13 +87,13 @@ The `heading` action changes the type of text in Docs (e.g., Normal text, Headin ![Heading configuration](docs/heading.png) -This action will accept any value in the following drop-down (note that this is also case-sensitive): +This action will accept any value in the following drop-down: ![Heading dropdown screenshot](docs/heading_dropdown.png) ### Align configuration -The `align` action accepts any of the following values in its configuration field: `left`, `center`, `right`, or `justify` (case-sensitive). +The `align` action accepts any of the following values in its configuration field: `left`, `center`, `right`, or `justify`. ## Set a keyboard shortcut diff --git a/index.md b/index.md index b71692dc..d3ff1565 100644 --- a/index.md +++ b/index.md @@ -84,7 +84,7 @@ The `highlight` action has a configuration option for the color of the highlight ![Highlight configuration screenshot](docs/highlight_configuration.png) -Docs Hotkey is able to highlight in all of the colors in the Google Docs color palette. To find the name of a color you wish to highlight in, open the highlight menu in Google Docs and hover over the color. This will show a tooltip with the name of the color, which can be entered into the `highlight` configuration. Note that the highlight color should be entered exactly as shown by Google Docs, including case. +Docs Hotkey is able to highlight in all of the colors in the Google Docs color palette. To find the name of a color you wish to highlight in, open the highlight menu in Google Docs and hover over the color. This will show a tooltip with the name of the color, which can be entered into the `highlight` configuration. ![Highlight color palette](docs/highlight_palette.png) @@ -100,13 +100,13 @@ The `heading` action changes the type of text in Docs (e.g., Normal text, Headin ![Heading configuration](docs/heading.png) -This action will accept any value in the following drop-down (note that this is also case-sensitive): +This action will accept any value in the following drop-down: ![Heading dropdown screenshot](docs/heading_dropdown.png) ### Align configuration -The `align` action accepts any of the following values in its configuration field: `left`, `center`, `right`, or `justify` (case-sensitive). +The `align` action accepts any of the following values in its configuration field: `left`, `center`, `right`, or `justify`. ## Set a keyboard shortcut diff --git a/public/icons/128.png b/public/icons/128.png index 1e1a3d2aedbe1cf84c79317b43aae887bf93d8ff..b34e9a99037093c42096cb1df216873dddd3cb2c 100644 GIT binary patch literal 3229 zcmai1XH=6-w|!DTiUH)nAhxrZdbz=lAD>D*e)!(0h-bR`x>zaTi+(50j4Po!nk^I$_chZ^2*kX=F zz2e?Y`l1qdJM>az$w&IN=k8c}?hD(cO_nW1%Fh4F&tAy5Y+)D3)5&{R$JTtvb4@ZJ zMUQo#5I<8G{!oizZ>os>COmJYS#~7O<~qhJ{7Vo*sA@trUL<8VCC%dog`tr)(Y(et zV_)pa=qUdzo0EicwX_KOd@%-Jbb0}<+&O=7g6pDDw%=2_yvL{&ULrNO$boQk+s;d_ z3mZEjw%#(NbPK>^GB{X{-H>r@4 z)Ii_C%B>nLox50gdn<2OZRJC118F05io8;L;`_@*Pe0DWRFc9*j;dhN7iltA3N~D1 z_?+5RALqV-(yTN1y0MdIgf=|Bsms=r=)n}n)y`Cv0=~2sEkp7hk=zm6nb*9gu&AQb z#VvQDe=(=$72}Lt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Yis-|y~!BmO}I0(@{HUNhoZw!hu`e!ev46oiU!^(`cz%-T2)J^S^LUBOP^A( zPUoIvG*WEjksXP(_u{cxO~aA4$gqUbUU6uF6oKj+rDri*k9mp-J5iMjMBCxlIEWE3-a35xV^Lqa6n zdZyf)Sf0!O_wvjUP?7jM@fl=Z_b)ndGk})V|9W_Ony4cg@=jdMhUe4hAXEBOT zJKfb^L|G?C(}ew7B4$`P9fN%Ydsh-~fTjM!akN$->outYa5f6Y9>_kniL(6Il@^26S0xZ zyZl$_ves|LFJ=?F?(m0Xm75OQX|JwZ4bIEqggIk)f^KmOn&-A}&IlkvrjHbiAqK%< zdwMXXK=WyW+IyGo<@E&yA3j+~$1fcBc)7({xU)$@GNf;MeNps6&PkR~uWbS%pL~CO zfqr<87}tzt9wbhv=}Tc{yBT(jsccIv6Vdjqi+LuwvfOpZ!I*DuL#II;3@}{p3eMEx zqhvE-_!x*`COl}e_=%``Y-xtN&TfXCG~ngNPavfK&4qtK;?N+PE0S;|C8M(?5WM4( z8-GOO$sJFe>f_i=qom{Xo&102I^vwKI7K*l!ug+V|bhgg|LILk1R1qp!8Gf-j8`EcEePe6(__=_LWyfM!-CNfFMXsq&Rt2-}J8@Cy@F918&pIQ&ck`U) zB5h^04s&$-jh_YiW&u~Pqts?poRMe*`Z<3u@`?nLh`fCDE^lN+?R2hr~Ny z6P0x1r>)L9j~N`U9>Xl45LU6Aefp8;Z1b1zDdm(yNEhTHfeh48`rmSyA22^-Ez5pC Z;IYr{sggRbaTgqxxrvSO>kIBN{{i~P#sL5T diff --git a/public/icons/16.png b/public/icons/16.png index 37a9f52e1bcb90518475369eac633f96a7c34348..1cc99a2a6f74a92eafc27d21e4111fad8aa63342 100644 GIT binary patch literal 744 zcmVP)Px%qDe$SR5(wqlv_wtQ51&%v(KF442h;fiJ=MVU}0iRR%T&EO_WKPqSQ;ENf)Df z5%EDSAG*C+Nk!(PCFvwM6=WBvw3I;&hH#+BOH3AKrsCMS?bv6UQE3bvT2G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&o?@XG%H$ngql3uPiQqJ~J3;IA`slwdQ0YHF~cSNOc9k%D7Y_`7J zx*ck0v3YG}*Y*Gjrf)3Jfg(*6a)%B8H2IQBmEN}W2Y@m5F!{!kMjl}uQKp93B06aOExVSI~q_Ls>bBj{D&#(q!${RpnD$#f7 z0jxc((T?j0y8XuFF0k7Kb}J5#2fVhja1YPW#t}>>`hxhZIi*Fz4?tWGN2s&MNpgUY z!Nun0!U~nAuTgQ0dvJP0hX_Eh;}bbYXwg3PUoa#(Lz?k7t$yNx!7Hwz`Mo6nO|!-K z{bB_X0)WVE>*dtie5eJE5iG;hk_g2DSkiT0EZ?HRhUUNSaHOI^Y*x6<8Dx8)W$qRa zKkwGkgHq%QL?lvEUaFYVsjZaB~x=waz`>mMeN^sH^PGCFWf z0#@X3l%DT@nL)e`vy(3QN5v5uoEn){qKsIP%0Ep>01|)%klg^rfoaQ0000 { Object.entries(commands).forEach(([internalName, { alias, actions }]) => { actions.forEach((action, index) => { const type = getActionType(action) - const config = getActionConfig(action) + const config = getActionConfig(action).toLowerCase() if (type === 'al' && config !== 'left' && config !== 'center' && config !== 'right' && config !== 'justify') { addActionError(alias, index, 'the configuration for align must be one of `left`, `center`, `right`, or `justify`') hasErrors = true @@ -130,115 +131,123 @@ const App: FC = () => { }, []) return ( - - - - Docs Hotkey - - - {commands && ( - <> - - {Object.entries(commands).map(([internalName, { actions, alias }]) => ( - - - - {alias} - - - - - - - Name: - - setCommands({ ...commands, [internalName]: { actions, alias: e.target.value } })} - my='5px' - /> - + + + + Docs Hotkey + + + {commands && ( + <> + + {Object.entries(commands).map(([internalName, { actions, alias }]) => ( + + + + {alias} + + + + + + + Name: + + setCommands({ ...commands, [internalName]: { actions, alias: e.target.value } })} + my='5px' + /> + } + aria-label='Delete command' + onClick={() => onDeleteCommand(internalName)} + /> + + + Actions + + + {actions.map((action, index) => ( + // I'm using the index as a key, fight me (bc the order won't change and adding an id would increase complexity) + + onActionChange(v, internalName, alias, actions, index)} + onDelete={() => onDeleteAction(internalName, index)} + /> + + ))} + + - - This command is in shortcut slot {internalName.substring(4)} - - - - ))} - + variant='link' + onClick={() => setCommands({ ...commands, [internalName]: { actions: [...actions, ''], alias } })} + > + Add action + + + This command is in shortcut slot {internalName.substring(4)} + + + + ))} + + + + )} + - - )} - - - - - {errors.map(e => ( - - {e} - - ))} + + + {errors.map(e => ( + + {e} + + ))} + - + + + Help + + + ) } diff --git a/src/content.ts b/src/content.ts index a5f1caf1..57283677 100644 --- a/src/content.ts +++ b/src/content.ts @@ -100,7 +100,7 @@ const fontFamily = (val: string) => { for (let i = 0; i < allFontContainer.children.length; i++) { const fontElement = allFontContainer.children[i] as HTMLElement const fontText = fontElement.children[0].children[1].innerHTML - if (fontText === val) { + if (fontText.toLowerCase() === val.toLowerCase()) { clickEl(fontElement) break } @@ -211,15 +211,15 @@ const highlight = (color: string, toggle: boolean = false) => { throw new Error('unable to highlight') } clickEl(dropdownElement) - if (color === 'none') { + if (color.toLowerCase() === 'none') { unhighlight() return } - if (!colorMap.has(color)) { + if (!colorMap.has(color.toLowerCase())) { throw new Error('unknown color!') } - const highlightEl = document.getElementById(`docs-material-colorpalette-cell-${colorMap.get(color)}`) + const highlightEl = document.getElementById(`docs-material-colorpalette-cell-${colorMap.get(color.toLowerCase())}`) if (!highlightEl) { throw new Error('unable to highlight') } @@ -275,7 +275,7 @@ const heading = (val: string) => { throw new Error('unable to set heading type') } console.log(headingText) - if (headingText === val) { + if (headingText.toLowerCase() === val.toLowerCase()) { clickEl(headingItemContainer) console.log('clicked') break @@ -285,13 +285,14 @@ const heading = (val: string) => { const align = (val: string) => { let element: HTMLElement | null - if (val === 'left') { + const alignment = val.toLowerCase() + if (alignment === 'left') { element = document.getElementById('alignLeftButton') - } else if (val === 'center') { + } else if (alignment === 'center') { element = document.getElementById('alignCenterButton') - } else if (val === 'right') { + } else if (alignment === 'right') { element = document.getElementById('alignRightButton') - } else if (val === 'justify') { + } else if (alignment === 'justify') { element = document.getElementById('alignJustifyButton') } else { throw new Error('unknown alignment option: ' + val) diff --git a/src/theme.ts b/src/theme.ts index ee9147a6..51d6cfbf 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -3,7 +3,8 @@ import { extendTheme } from '@chakra-ui/react' const theme = extendTheme({ colors: { docsBlue: '#1a73e8', - docsBlueHover: '#63a0ef' + docsBlueHover: '#63a0ef', + docsBlueClick: '#6ea9f5' }, fonts: { heading: "Roboto, 'Noto Sans', Sans-Serif",