Skip to content

Commit dd3da6f

Browse files
committed
Update dependency tailwindcss to v3.3.3
refs #676 - required for the `eslint-plugin-tailwindcss` bump to work correctly - ran `yarn lint:js --fix` - CSS ordering changed to be more deterministic, see tailwindlabs/tailwindcss#10672
1 parent ca4da35 commit dd3da6f

40 files changed

+174
-112
lines changed

packages/koenig-lexical/.eslintrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ module.exports = {
4747
'react/prop-types': 2
4848
}
4949
}]
50-
};
50+
};

packages/koenig-lexical/demo/DemoApp.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function DemoComposer({editorType, isMultiplayer, setWordCount}) {
240240
}
241241
<DarkModeToggle darkMode={darkMode} toggleDarkMode={toggleDarkMode} />
242242
<div ref={containerRef} className="h-full overflow-auto overflow-x-hidden" onClick={focusEditor}>
243-
<div className="mx-auto max-w-[740px] py-[15vmin] px-6 lg:px-0">
243+
<div className="mx-auto max-w-[740px] px-6 py-[15vmin] lg:px-0">
244244
{showTitle
245245
? <TitleTextBox ref={titleRef} editorAPI={editorAPI} setTitle={setTitle} title={title} />
246246
: null

packages/koenig-lexical/demo/HtmlOutputDemo.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function HtmlOutputDemo() {
8989
>
9090
<div className="relative h-full grow">
9191
<div ref={containerRef} className="h-full overflow-auto" onClick={focusEditor}>
92-
<div className="mx-auto max-w-[740px] py-[15vmin] px-6 lg:px-0">
92+
<div className="mx-auto max-w-[740px] px-6 py-[15vmin] lg:px-0">
9393
<KoenigComposableEditor
9494
cursorDidExitAtTop={focusTitle}
9595
registerAPI={setEditorAPI}

packages/koenig-lexical/demo/RestrictedContentDemo.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function RestrictedContentDemo() {
9595
>
9696
<div className="relative h-full grow">
9797
<div ref={containerRef} className="h-full overflow-auto" onClick={focusEditor}>
98-
<div className="mx-auto max-w-[740px] py-[15vmin] px-6 lg:px-0">
98+
<div className="mx-auto max-w-[740px] px-6 py-[15vmin] lg:px-0">
9999
<KoenigComposableEditor
100100
cursorDidExitAtTop={focusTitle}
101101
registerAPI={setEditorAPI}

packages/koenig-lexical/demo/components/FloatingButton.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
const FloatingButton = ({isOpen, ...props}) => {
44
return (
5-
<div className={`fixed bottom-4 right-6 z-20 rounded py-1 px-2 font-mono text-sm tracking-tight text-grey-600 transition-all duration-200 ease-in-out ${isOpen ? 'bg-transparent' : 'bg-white'}`}>
5+
<div className={`fixed bottom-4 right-6 z-20 rounded px-2 py-1 font-mono text-sm tracking-tight text-grey-600 transition-all duration-200 ease-in-out ${isOpen ? 'bg-transparent' : 'bg-white'}`}>
66
<button className="cursor-pointer" type="button" onClick={() => props.onClick('json')}>
77
JSON output
88
</button>

packages/koenig-lexical/demo/components/InitialContentToggle.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ const InitialContentToggle = ({defaultContent, setTitle, searchParams, setSearch
3333

3434
return (
3535
<>
36-
<button className="absolute top-4 right-6 z-20 block h-[22px] w-[42px] cursor-pointer rounded-full bg-black transition-all ease-in-out" type="button" onClick={toggle}>
37-
<EyeOpenIcon className="absolute top-[5px] left-[6px] h-3 w-3 text-white" />
38-
<EyeClosedIcon className="absolute top-[5px] right-[6px] h-3 w-3 text-white" />
36+
<button className="absolute right-6 top-4 z-20 block h-[22px] w-[42px] cursor-pointer rounded-full bg-black transition-all ease-in-out" type="button" onClick={toggle}>
37+
<EyeOpenIcon className="absolute left-[6px] top-[5px] h-3 w-3 text-white" />
38+
<EyeClosedIcon className="absolute right-[6px] top-[5px] h-3 w-3 text-white" />
3939
<div className={`absolute top-[2px] h-[18px] w-[18px] rounded-full bg-white transition-all ease-in-out ${isOn ? 'left-[22px]' : 'left-[2px]'}`}></div>
4040
</button>
4141
</>

packages/koenig-lexical/demo/components/Watermark.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function EditorLink({editorType}) {
1313
const Watermark = ({editorType}) => {
1414
if (!editorType) {
1515
return (
16-
<a className="absolute bottom-4 left-6 z-20 flex items-center rounded bg-white py-1 pr-2 pl-1 font-mono text-sm tracking-tight text-black" href="https://github.com/TryGhost/Koenig/tree/main/packages/koenig-lexical" rel="nofollow ugc noopener noreferrer" target="_blank">
16+
<a className="absolute bottom-4 left-6 z-20 flex items-center rounded bg-white py-1 pl-1 pr-2 font-mono text-sm tracking-tight text-black" href="https://github.com/TryGhost/Koenig/tree/main/packages/koenig-lexical" rel="nofollow ugc noopener noreferrer" target="_blank">
1717
<GhostFavicon className="mr-2 h-6 w-6" />
1818
<span className="pr-1 font-bold tracking-wide">Koenig</span>
1919
editor
@@ -40,7 +40,7 @@ const Watermark = ({editorType}) => {
4040

4141
return (
4242
<>
43-
<div className="group absolute bottom-4 left-6 z-20 flex items-center rounded bg-white py-1 pr-2 pl-1 font-mono text-sm tracking-tight text-black">
43+
<div className="group absolute bottom-4 left-6 z-20 flex items-center rounded bg-white py-1 pl-1 pr-2 font-mono text-sm tracking-tight text-black">
4444
<GhostFavicon className="mr-2 h-6 w-6" />
4545
<span className="pr-1 font-bold tracking-wide">Koenig</span>
4646
<span className="group-hover:font-bold">{editorType}

packages/koenig-lexical/demo/components/WordCount.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const WordCount = ({wordCount}) => {
22
return (
3-
<div className="absolute top-4 left-6 z-20 block cursor-pointer rounded bg-white py-1 px-2 font-mono text-sm tracking-tight text-grey-600 dark:bg-transparent">
3+
<div className="absolute left-6 top-4 z-20 block cursor-pointer rounded bg-white px-2 py-1 font-mono text-sm tracking-tight text-grey-600 dark:bg-transparent">
44
<span data-testid="word-count">{wordCount}</span> words
55
</div>
66
);

packages/koenig-lexical/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"react-router-dom": "6.14.2",
121121
"storybook": "^7.0.12",
122122
"stylelint": "^15.6.1",
123-
"tailwindcss": "3.2.7",
123+
"tailwindcss": "3.3.3",
124124
"typescript": "5.1.6",
125125
"vite": "4.3.8",
126126
"vite-plugin-svgr": "^3.2.0",

packages/koenig-lexical/src/components/KoenigCaptionEditor.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
77

88
const Placeholder = ({text = 'Type here'}) => {
99
return (
10-
<div className="pointer-events-none absolute top-0 left-0 !m-0 min-w-full cursor-text font-sans text-sm font-normal tracking-wide text-grey-500 dark:text-grey-800">
10+
<div className="pointer-events-none absolute left-0 top-0 !m-0 min-w-full cursor-text font-sans text-sm font-normal tracking-wide text-grey-500 dark:text-grey-800">
1111
{text}
1212
</div>
1313
);

packages/koenig-lexical/src/components/KoenigNestedEditor.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Placeholder = ({text = 'Type here', className = ''}) => {
66
// Note: we use line-clamp-1, instead of truncate because truncate adds 'white-space: nowrap', which often breaks overflows of parents in some cards
77
return (
88
<div className={`placeholder not-kg-prose pointer-events-none h-0 cursor-text overflow-visible`}>
9-
<div className={`translate-y-[-100%] line-clamp-1 ${className}`}>{text}</div>
9+
<div className={`line-clamp-1 translate-y-[-100%] ${className}`}>{text}</div>
1010
</div>
1111
);
1212
};

packages/koenig-lexical/src/components/ui/ActionToolbar.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function ActionToolbar({isVisible, children, ...props}) {
66

77
if (isVisible && !isDragging) {
88
return (
9-
<div className="not-kg-prose absolute top-[-44px] left-1/2 z-[1000] -translate-x-1/2" {...props}>
9+
<div className="not-kg-prose absolute left-1/2 top-[-44px] z-[1000] -translate-x-1/2" {...props}>
1010
{children}
1111
</div>
1212
);

packages/koenig-lexical/src/components/ui/BackgroundImagePicker.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function BackgroundImagePicker({onFileChange,
5555
<div className="group relative mb-4 w-full rounded">
5656
<div className="absolute inset-0 rounded bg-gradient-to-t from-black/0 via-black/5 to-black/30 opacity-0 transition-all group-hover:opacity-100">
5757
</div>
58-
<div className="absolute top-5 right-5 flex opacity-0 transition-all group-hover:opacity-100">
58+
<div className="absolute right-5 top-5 flex opacity-0 transition-all group-hover:opacity-100">
5959
<button className="pointer-events-auto flex h-8 w-9 cursor-pointer items-center justify-center rounded bg-white/90 transition-all hover:bg-white" type="button" onClick={handleClearBackgroundImage}>
6060
<TrashIcon className="h-5 w-5 fill-grey-900 stroke-[3px] transition-all ease-linear group-hover:scale-105" />
6161
</button>

packages/koenig-lexical/src/components/ui/ColorPicker.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export function ColorIndicator({value, swatches, onSwatchChange, onTogglePicker,
159159
<div className='absolute inset-0 rounded-full bg-[conic-gradient(hsl(360,100%,50%),hsl(315,100%,50%),hsl(270,100%,50%),hsl(225,100%,50%),hsl(180,100%,50%),hsl(135,100%,50%),hsl(90,100%,50%),hsl(45,100%,50%),hsl(0,100%,50%))]' />
160160
{value && !selectedSwatch && (
161161
<div className="absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950" style={{backgroundColor}}>
162-
{value === 'transparent' && <div className="absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red" />}
162+
{value === 'transparent' && <div className="absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red" />}
163163
</div>
164164
)}
165165
</button>

packages/koenig-lexical/src/components/ui/Dropdown.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function Dropdown({value, menu, onChange}) {
6363

6464
return (
6565
<div className="relative z-0 font-sans text-sm font-normal">
66-
<button className={`relative w-full cursor-pointer border border-grey-300 py-2 px-3 text-left font-sans font-normal text-grey-900 focus-visible:outline-none dark:border-grey-900 dark:bg-grey-900 dark:text-white dark:placeholder:text-grey-800 ${open ? 'rounded-t' : 'rounded'}`} type="button" onBlur={handleBlur} onClick={handleOpen} onMouseDownCapture={preventLoseFocus}>
66+
<button className={`relative w-full cursor-pointer border border-grey-300 px-3 py-2 text-left font-sans font-normal text-grey-900 focus-visible:outline-none dark:border-grey-900 dark:bg-grey-900 dark:text-white dark:placeholder:text-grey-800 ${open ? 'rounded-t' : 'rounded'}`} type="button" onBlur={handleBlur} onClick={handleOpen} onMouseDownCapture={preventLoseFocus}>
6767
{trigger}
6868
<ArrowIcon className={`absolute right-2 top-4 h-2 w-2 text-grey-600 ${open && 'rotate-180'}`} />
6969
</button>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function EditorPlaceholder({className, text}) {
22
return (
33
<div
4-
className={`pointer-events-none absolute top-0 left-0 min-w-full cursor-text font-serif text-xl text-grey-500 dark:text-grey-800 ${className}`}
4+
className={`pointer-events-none absolute left-0 top-0 min-w-full cursor-text font-serif text-xl text-grey-500 dark:text-grey-800 ${className}`}
55
>{text || 'Begin writing your post...'}</div>
66
);
77
}

packages/koenig-lexical/src/components/ui/InputList.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Item({dataTestId, item, selected, onChange}) {
2121
return (
2222
<li className={`${selectionClass} cursor-pointer px-4 py-2 text-left hover:bg-grey-100 dark:hover:bg-black`} data-testid={`${dataTestId}-listOption`} onMouseDownCapture={event => handleOptionMouseDown(event, item.value)}>
2323
<span className="block text-sm font-semibold leading-tight text-black dark:text-white" data-testid={`${dataTestId}-listOption-${item.label}`}>{item.label}</span>
24-
<span className="block overflow-hidden text-ellipsis whitespace-nowrap text-xs leading-tight text-grey-700 dark:text-grey-600" data-testid={`${dataTestId}-listOption-${item.value}`}>
24+
<span className="block truncate text-xs leading-tight text-grey-700 dark:text-grey-600" data-testid={`${dataTestId}-listOption-${item.value}`}>
2525
{item.value}
2626
</span>
2727
</li>

packages/koenig-lexical/src/components/ui/LinkInput.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function LinkInput({href, update, cancel, arrowStyles}) {
4949
}, [onEscape]);
5050

5151
return (
52-
<div ref={containerRef} className="relative m-0 flex h-[36px] min-w-[240px] items-center justify-evenly rounded bg-black py-0 px-1 font-sans text-sm font-medium dark:bg-grey-950">
52+
<div ref={containerRef} className="relative m-0 flex h-[36px] min-w-[240px] items-center justify-evenly rounded bg-black px-1 py-0 font-sans text-sm font-medium dark:bg-grey-950">
5353
<input
5454
ref={inputRef}
5555
className="mb-[1px] h-auto w-full rounded bg-black pl-3 pr-9 leading-loose text-white selection:bg-grey/40 dark:bg-grey-950"
@@ -84,7 +84,7 @@ export function LinkInput({href, update, cancel, arrowStyles}) {
8484
{/* Arrow block. Used div instead of pseudo-element. Arrow requires dynamic values for position,
8585
and Tailwind can't handle this. They recommended CSS-in-JS or style attr for such cases (https://v2.tailwindcss.com/docs/just-in-time-mode) */}
8686
<div
87-
className="absolute top-[36px] left-[calc(50%-8px)] w-0 border-x-8 border-t-8 border-x-transparent border-t-black dark:border-t-grey-950"
87+
className="absolute left-[calc(50%-8px)] top-[36px] w-0 border-x-8 border-t-8 border-x-transparent border-t-black dark:border-t-grey-950"
8888
style={arrowStyles}
8989
></div>
9090
</div>

packages/koenig-lexical/src/components/ui/MediaPlayer.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function MediaPlayer({type, duration, theme, ...args}) {
1515
<div className={`relative mx-2 h-1 grow rounded ${theme === 'light' ? 'bg-white/40' : 'bg-grey/30'}`}>
1616
<button className="absolute left-0 top-[-6px] h-4 w-4 rounded-full border border-grey/50 bg-white shadow" type="button"></button>
1717
</div>
18-
<button className={`mr-4 mb-[1px] px-1 font-sans text-sm font-medium ${theme === 'light' ? 'text-white' : 'text-black'}`} type="button">1&#215;</button>
18+
<button className={`mb-[1px] mr-4 px-1 font-sans text-sm font-medium ${theme === 'light' ? 'text-white' : 'text-black'}`} type="button">1&#215;</button>
1919
<button type="button">
2020
<UnmuteIcon className={`${theme === 'light' ? 'fill-white' : 'fill-black'}`} />
2121
</button>

packages/koenig-lexical/src/components/ui/MediaUploader.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function MediaUploader({
8585
)}
8686

8787
{!isLoading && (
88-
<div className="absolute top-2 right-2 flex space-x-2 opacity-0 transition-all group-hover:opacity-100">
88+
<div className="absolute right-2 top-2 flex space-x-2 opacity-0 transition-all group-hover:opacity-100">
8989
{additionalActions}
9090
{ isPinturaEnabled && <IconButton Icon={EditIcon} onClick={() => openImageEditor({
9191
image: src,

packages/koenig-lexical/src/components/ui/Modal.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export function Modal({isOpen, onClose, children}) {
2020
return (
2121
<Portal>
2222
<div
23-
className="fixed top-0 left-0 z-40 flex h-full w-full items-start justify-center overflow-auto"
23+
className="fixed left-0 top-0 z-40 flex h-full w-full items-start justify-center overflow-auto"
2424
role="dialog"
2525
aria-modal
2626
onKeyDown={controlByKeys}
2727
>
2828
<div className="fixed inset-0 z-40 h-[100vh] bg-black opacity-60" onClick={onClose}></div>
2929
<div className="relative z-50 my-8 w-full max-w-[550px] rounded bg-white drop-shadow-2xl">
30-
<button aria-label="Close dialog" className="absolute top-6 right-6 cursor-pointer" type="button" autoFocus>
30+
<button aria-label="Close dialog" className="absolute right-6 top-6 cursor-pointer" type="button" autoFocus>
3131
<CloseIcon className="h-4 w-4 stroke-2 text-grey-400" onClick={onClose}/>
3232
</button>
3333
{children}

packages/koenig-lexical/src/components/ui/PlusMenu.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {ReactComponent as PlusIcon} from '../../assets/icons/plus.svg';
22

33
export function PlusButton({onClick}) {
44
return (
5-
<div className="absolute top-[-2px] left-[-32px] xs:left-[-66px]" data-kg-plus-button>
5+
<div className="absolute left-[-32px] top-[-2px] xs:left-[-66px]" data-kg-plus-button>
66
<button
77
aria-label="Add a card"
88
className="group relative flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border border-grey transition-all ease-linear hover:border-grey-900 dark:border-grey-800 dark:hover:border-grey-100 md:h-9 md:w-9"

packages/koenig-lexical/src/components/ui/SnippetInput/Dropdown.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const Dropdown = ({
5454
const DropdownSection = ({list = [], onClick, activeMenuItem}) => {
5555
return (
5656
<li role="separator">
57-
<span className="tracking-loose block border-t border-grey-200 px-3 pt-3 pb-2 text-xs font-medium uppercase text-grey dark:border-grey-900 dark:text-grey-800">Replace existing</span>
57+
<span className="tracking-loose block border-t border-grey-200 px-3 pb-2 pt-3 text-xs font-medium uppercase text-grey dark:border-grey-900 dark:text-grey-800">Replace existing</span>
5858
<ul role="menu">
5959
{
6060
list.map((item, index) => (
@@ -88,7 +88,7 @@ const DropdownItem = ({onClick, name, active, index}) => {
8888
<li className="mb-1">
8989
<button
9090
ref={buttonRef}
91-
className="flex w-full cursor-pointer items-center justify-between py-2 px-3 text-left text-sm hover:bg-grey-100 focus:bg-grey-100 dark:hover:bg-black dark:focus:bg-black"
91+
className="flex w-full cursor-pointer items-center justify-between px-3 py-2 text-left text-sm hover:bg-grey-100 focus:bg-grey-100 dark:hover:bg-black dark:focus:bg-black"
9292
type="button"
9393
onClick={() => onClick(name)}
9494
>

packages/koenig-lexical/src/components/ui/SnippetInput/Input.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const Input = ({value, onChange, onClear, onKeyDown, arrowStyles}) => {
66
<div className="shadow-[0 18px 45px -5px rgba(0,0,0,.15)] relative m-0 flex h-[35px] min-w-[240px] items-center justify-evenly rounded bg-white py-0 font-sans text-sm font-medium">
77
<input
88
autoFocus={true}
9-
className={`mb-[1px] h-auto w-full border bg-white py-1 pl-3 pr-9 font-normal leading-loose text-grey-900 selection:bg-grey/40 dark:bg-grey-950 dark:text-grey-100 dark:placeholder:text-grey-800 ${value ? 'rounded-t rounded-b-none border-grey-300 dark:border-grey-900' : 'rounded border-green'}`}
9+
className={`mb-[1px] h-auto w-full border bg-white py-1 pl-3 pr-9 font-normal leading-loose text-grey-900 selection:bg-grey/40 dark:bg-grey-950 dark:text-grey-100 dark:placeholder:text-grey-800 ${value ? 'rounded-b-none rounded-t border-grey-300 dark:border-grey-900' : 'rounded border-green'}`}
1010
data-testid="snippet-name"
1111
placeholder="Snippet name"
1212
value={value}
@@ -20,7 +20,7 @@ export const Input = ({value, onChange, onClear, onKeyDown, arrowStyles}) => {
2020
{/* Arrow block. Used div instead of pseudo-element. Arrow requires dynamic values for position,
2121
and Tailwind can't handle this. They recommended CSS-in-JS or style attr for such cases (https://v2.tailwindcss.com/docs/just-in-time-mode) */}
2222
<div
23-
className="absolute top-[35px] left-[calc(50%-8px)] w-0 border-x-[9px] border-t-[9px] border-x-transparent border-t-green after:absolute after:top-[-9px] after:left-[calc(50%-8px)] after:w-0 after:border-x-8 after:border-t-8 after:border-x-transparent after:border-t-white dark:after:border-t-grey-950"
23+
className="absolute left-[calc(50%-8px)] top-[35px] w-0 border-x-[9px] border-t-[9px] border-x-transparent border-t-green after:absolute after:left-[calc(50%-8px)] after:top-[-9px] after:w-0 after:border-x-8 after:border-t-8 after:border-x-transparent after:border-t-white dark:after:border-t-grey-950"
2424
style={arrowStyles}
2525
></div>
2626
</div>

0 commit comments

Comments
 (0)