-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support glob patterns in
editor.fileTree.allowEdits
(#332)
- Loading branch information
1 parent
5e5c60e
commit c1a59f5
Showing
28 changed files
with
557 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
e2e/src/content/tutorial/tests/file-tree/allow-edits-glob/_files/first-level/file.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 'File in first level'; |
1 change: 1 addition & 0 deletions
1
...content/tutorial/tests/file-tree/allow-edits-glob/_files/first-level/second-level/file.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 'File in second level'; |
18 changes: 18 additions & 0 deletions
18
e2e/src/content/tutorial/tests/file-tree/allow-edits-glob/content.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
type: lesson | ||
title: Allow Edits Glob | ||
previews: false | ||
editor: | ||
fileTree: | ||
allowEdits: | ||
# Items in root | ||
- "/*" | ||
# Only "allowed-filename-only.js" inside "/first-level" folder | ||
- "/first-level/allowed-filename-only.js" | ||
# Anything inside "second-level" folders anywhere | ||
- "**/second-level/**" | ||
terminal: | ||
panels: terminal | ||
--- | ||
|
||
# File Tree test - Allow Edits Glob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { defineConfig } from '@tutorialkit/theme'; | ||
|
||
export default defineConfig({ | ||
// add your UnoCSS config here: https://unocss.dev/guide/config-file | ||
// required for TutorialKit monorepo development mode | ||
content: { | ||
pipeline: { | ||
include: '**', | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { type ComponentProps, forwardRef, type Ref } from 'react'; | ||
import { classNames } from './utils/classnames.js'; | ||
|
||
interface Props extends ComponentProps<'button'> { | ||
variant?: 'primary' | 'secondary'; | ||
} | ||
|
||
export const Button = forwardRef(({ className, variant = 'primary', ...props }: Props, ref: Ref<HTMLButtonElement>) => { | ||
return ( | ||
<button | ||
ref={ref} | ||
{...props} | ||
className={classNames( | ||
className, | ||
'flex items-center font-500 text-sm px-4 py-1 rounded-md disabled:opacity-32', | ||
variant === 'primary' && | ||
'bg-tk-elements-primaryButton-backgroundColor text-tk-elements-primaryButton-textColor', | ||
|
||
!props.disabled && | ||
variant === 'primary' && | ||
'hover:bg-tk-elements-primaryButton-backgroundColorHover hover:text-tk-elements-primaryButton-textColorHover', | ||
|
||
variant === 'secondary' && | ||
'bg-tk-elements-secondaryButton-backgroundColor text-tk-elements-secondaryButton-textColor', | ||
|
||
!props.disabled && | ||
variant === 'secondary' && | ||
'hover:bg-tk-elements-secondaryButton-backgroundColorHover hover:text-tk-elements-secondaryButton-textColorHover', | ||
)} | ||
/> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.