-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'lexical' into development
- Loading branch information
Showing
302 changed files
with
65,590 additions
and
2,239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: test-js | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**.js' | ||
- '**.ts' | ||
- '**.json' | ||
pull_request: | ||
paths: | ||
- '**.js' | ||
- '**.ts' | ||
- '**.json' | ||
|
||
jobs: | ||
build: | ||
if: ${{ github.ref != 'refs/heads/l10n_development' }} | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install NPM deps | ||
run: npm ci | ||
|
||
- name: Run TypeScript type checking | ||
run: npm run ts:lint | ||
|
||
- name: Run JavaScript tests | ||
run: npm run test |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/node_modules | ||
/.vscode | ||
/composer | ||
/coverage | ||
Homestead.yaml | ||
.env | ||
.idea | ||
|
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,37 @@ | ||
<?php | ||
|
||
namespace BookStack\Entities\Tools; | ||
|
||
use BookStack\Entities\Models\Page; | ||
|
||
enum PageEditorType: string | ||
{ | ||
case WysiwygTinymce = 'wysiwyg'; | ||
case WysiwygLexical = 'wysiwyg2024'; | ||
case Markdown = 'markdown'; | ||
|
||
public function isHtmlBased(): bool | ||
{ | ||
return match ($this) { | ||
self::WysiwygTinymce, self::WysiwygLexical => true, | ||
self::Markdown => false, | ||
}; | ||
} | ||
|
||
public static function fromRequestValue(string $value): static|null | ||
{ | ||
$editor = explode('-', $value)[0]; | ||
return static::tryFrom($editor); | ||
} | ||
|
||
public static function forPage(Page $page): static|null | ||
{ | ||
return static::tryFrom($page->editor); | ||
} | ||
|
||
public static function getSystemDefault(): static | ||
{ | ||
$setting = setting('app-editor'); | ||
return static::tryFrom($setting) ?? static::WysiwygTinymce; | ||
} | ||
} |
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.