Skip to content
Merged

PRs #99

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
13d3d4e
use button in navigation panel
Nov 3, 2025
3ad4e1f
added fi-not-prose in permalink class
Nov 3, 2025
c032d84
removed dd from MakeDocumentationCommand.php
Nov 3, 2025
5cc5037
readded missing config entries
Nov 3, 2025
f95d0b4
fixed anchor selector
Nov 3, 2025
b60b223
fixed global search
Nov 5, 2025
84dae68
fixed config file
Nov 6, 2025
6179092
fixed sidebar button
Nov 6, 2025
2c46229
removed fi-not-prose in permalink class
Nov 7, 2025
dcc9c42
added default icons to config
Nov 7, 2025
6a5f3e7
added italian traslation
Nov 7, 2025
1b814d2
fixed global search
Nov 7, 2025
250a78d
use current selected locale
Nov 10, 2025
10efd80
process only markdown files
Nov 13, 2025
99a11dc
wip: documentable method allow to use custom panel id
pimeo Nov 28, 2025
a32d3db
wip: take in account panel id choice to help actions components and a…
pimeo Nov 28, 2025
8809bcf
fix: helper action render documentable html contents
pimeo Nov 28, 2025
0d45af0
fix: inherits from setUp method to avoid missing action view
pimeo Nov 28, 2025
0c618d1
feat: modal support heading
pimeo Nov 28, 2025
2e69764
Fix the link on heading permalinks
skeemer Dec 6, 2025
708b930
Fix the template path in the CSS instructions
skeemer Dec 6, 2025
dad339c
Match PHP version to the minimum allowed in v2 and add the pdo_sqlite…
skeemer Dec 7, 2025
760079f
Upgrade to larastan/larastan
skeemer Dec 7, 2025
fa18487
Remove deprecated parameter
skeemer Dec 7, 2025
57c4c86
Upgrade PestPHP to 3 so it covers 11|12. Upgrade Larastan to match.
skeemer Dec 7, 2025
b600a96
Upgrade the matrix to match current requirements.
skeemer Dec 7, 2025
3f524f8
Update the service provider name to V2.
skeemer Dec 7, 2025
ffe7665
Restore Testbench versions since they didn't autoinstall.
skeemer Dec 7, 2025
4fd622b
Restore carbon versions
skeemer Dec 7, 2025
07b7196
fix: make documentation command
lukas-frey Dec 7, 2025
8fc425f
fix: make documentation command
lukas-frey Dec 7, 2025
9b27875
Merge pull request #90 from makroxyz/main
lukas-frey Dec 7, 2025
c2118f5
Merge remote-tracking branch 'origin/v4-changes' into fork/pimeo/main
lukas-frey Dec 7, 2025
0579436
chore: merge
lukas-frey Dec 7, 2025
0fe6ba9
chore: pint
lukas-frey Dec 7, 2025
6356e85
Merge pull request #93 from pimeo/main
lukas-frey Dec 7, 2025
df07706
fix: the link on heading permalinks
lukas-frey Dec 7, 2025
8a21a67
fix: the template path in the CSS instructions
lukas-frey Dec 7, 2025
cf90734
fix: GitHub workflows
lukas-frey Dec 7, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: pdo_sqlite
php-version: '8.2'
coverage: none

- name: Install composer dependencies
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.2, 8.1]
laravel: [10.*]
php: [8.2, 8.4]
laravel: [11.*, 12.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
carbon: ^2.63
- laravel: 12.*
testbench: 10.*
carbon: ^3.8.4

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
16 changes: 7 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@
"symfony/yaml": "^7.0"
},
"require-dev": {
"larastan/larastan": "^3.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^8.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^9.0|^10.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
"pestphp/pest": "^3.0",
"pestphp/pest-plugin-arch": "^3.0",
"pestphp/pest-plugin-laravel": "^3.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -72,8 +71,7 @@
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
"pestphp/pest-plugin": true
}
},
"extra": {
Expand Down
10 changes: 9 additions & 1 deletion config/filament-knowledge-base.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<?php

// config for Guava/KnowledgeBasePanel
use Guava\FilamentKnowledgeBase\Enums\NodeType;

return [
'flatfile-model' => \Guava\FilamentKnowledgeBase\Models\FlatfileNode::class,

'cache' => [
'prefix' => env('FILAMENT_KB_CACHE_PREFIX', 'filament_kb_'),

Check failure on line 10 in config/filament-knowledge-base.php

View workflow job for this annotation

GitHub Actions / phpstan

Called 'env' outside of the config directory which returns null when the config is cached, use 'config'.
'ttl' => env('FILAMENT_KB_CACHE_TTL', 'forever'),
'ttl' => env('FILAMENT_KB_CACHE_TTL', 86400),

Check failure on line 11 in config/filament-knowledge-base.php

View workflow job for this annotation

GitHub Actions / phpstan

Called 'env' outside of the config directory which returns null when the config is cached, use 'config'.
],

'icons' => [
NodeType::Documentation->value => 'heroicon-o-document',
NodeType::Link->value => 'heroicon-o-link',
NodeType::Group->value => null,
],
];
2 changes: 1 addition & 1 deletion dist/js/anchors-component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/v2/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ And lastly, add the following to your custom filament theme to correctly build t
```css
@plugin "@tailwindcss/typography";
@source '../../../../vendor/guava/filament-knowledge-base/src/**/*';
@source '../../../../vendor/guava/filament-knowledge-base/resources/view/**/*';
@source '../../../../vendor/guava/filament-knowledge-base/resources/views/**/*';
```

> [!IMPORTANT]
Expand Down
4 changes: 1 addition & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
includes:
- phpstan-baseline.neon
- ./vendor/nunomaduro/larastan/extension.neon
- vendor/larastan/larastan/extension.neon

parameters:
level: 4
Expand All @@ -11,5 +11,3 @@ parameters:
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false

4 changes: 2 additions & 2 deletions resources/lang/fr/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
'open-documentation' => 'Ouvrir la documentation',
'close' => 'Fermer',
'back-to-default-panel' => 'Retour',
'url-copied' => 'URL copiée dans votre presse-papiers.',
'code-copied' => 'Code copié dans votre presse-papiers.',
'url-copied' => 'URL copiée dans votre presse-papier.',
'code-copied' => 'Code copié dans votre presse-papier.',
];
11 changes: 11 additions & 0 deletions resources/lang/it/translations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return [
'knowledge-base' => 'Documentazione',
'help' => 'Aiuto',
'open-documentation' => 'Apri documentazione',
'close' => 'Chiudi',
'back-to-default-panel' => 'Indietro',
'url-copied' => 'La URL è stata copiata nei tuoi appunti.',
'code-copied' => 'Il codice è stato copiato nei tuoi appunti.',
];
6 changes: 3 additions & 3 deletions src/Actions/Forms/Components/HelpAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
use Illuminate\Support\Arr;
use Illuminate\Support\HtmlString;

class HelpAction extends Action

Check failure on line 11 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Class Guava\FilamentKnowledgeBase\Actions\Forms\Components\HelpAction extends unknown class Filament\Forms\Components\Actions\Action.
{
protected static function getContentView(Documentable $documentable): HtmlString
{
$html = $documentable->getSimpleHtml();

Check failure on line 15 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Guava\FilamentKnowledgeBase\Contracts\Documentable::getSimpleHtml().
$articleClass = KnowledgeBase::plugin()->getArticleClass();

Check failure on line 16 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Filament\Contracts\Plugin::getArticleClass().

$classes = Arr::toCssClasses([
'gu-kb-article-modal',
Expand All @@ -31,26 +31,26 @@
return new HtmlString(\Str::replace($replacementStringId, $html, $parsed));
}

public static function forDocumentable(Documentable | string $documentable): static
public static function forDocumentable(Documentable | string $documentable, ?string $panelId = null): static
{
$documentable = KnowledgeBase::documentable($documentable);
$documentable = KnowledgeBase::documentable($documentable, $panelId);

return static::make("help.{$documentable->getId()}")

Check failure on line 38 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined static method Guava\FilamentKnowledgeBase\Actions\Forms\Components\HelpAction::make().
->label($documentable->getTitle())
// ->icon($documentable->getIcon())
// ->icon($documentable->getIcon())
->icon('heroicon-o-question-mark-circle')
->when(
KnowledgeBase::companion()->hasModalPreviews(),
fn (HelpAction $action) => $action

Check failure on line 44 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Guava\FilamentKnowledgeBase\Actions\Forms\Components\HelpAction::modalContent().
->modalContent(fn () => static::getContentView($documentable))
->modalHeading($documentable->getTitle())
->modalSubmitAction(false)
->modalCancelActionLabel(__('filament-knowledge-base::translations.close'))
->when(
KnowledgeBase::companion()->hasSlideOverPreviews(),
fn (HelpAction $action) => $action->slideOver()

Check failure on line 51 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Guava\FilamentKnowledgeBase\Actions\Forms\Components\HelpAction::slideOver().
),
fn (HelpAction $action) => $action->url($documentable->getUrl())

Check failure on line 53 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Guava\FilamentKnowledgeBase\Contracts\Documentable::getUrl().

Check failure on line 53 in src/Actions/Forms/Components/HelpAction.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Guava\FilamentKnowledgeBase\Actions\Forms\Components\HelpAction::url().
)
;
}
Expand Down
24 changes: 17 additions & 7 deletions src/Actions/HelpAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

class HelpAction extends Action
{
protected function setUp(): void {}
protected function setUp(): void
{
parent::setUp();
}

public function generic(): HelpAction
{
Expand All @@ -21,20 +24,27 @@ public function generic(): HelpAction
;
}

public static function forDocumentable(Documentable | string $documentable): HelpAction
public static function forDocumentable(Documentable | string $documentable, ?string $panelId = null): HelpAction
{
$documentable = KnowledgeBase::documentable($documentable);
$documentable = KnowledgeBase::documentable($documentable, $panelId);

return static::make("help.{$documentable->getId()}")
->label($documentable->getTitle())
->icon($documentable->getIcon())
->when(
KnowledgeBase::companion()->hasModalPreviews(),
fn (HelpAction $action) => $action
->modal()
->modalContent(new HtmlString('test'))
->action(fn () => dd('test'))
// ->alpineClickHandler('$dispatch(\"open-modal\", {id: "' . $documentable->getId() . '"})')
->modalHeading(function () use ($documentable) {
return new HtmlString("<h3 class='text-lg font-medium'>{$documentable->getTitle()}</h3>");
})
->modalContent(function () use ($documentable) {
$content = data_get($documentable->getData(), 'content', '');
$body = new HtmlString("<div class='prose dark:prose-invert'>{$content}</div>");

return $body;
})
->modalCancelActionLabel(__('filament-knowledge-base::translations.close'))
->modalSubmitAction(false)
->when(
KnowledgeBase::companion()->hasSlideOverPreviews(),
fn (HelpAction $action) => $action->slideOver()
Expand Down
6 changes: 3 additions & 3 deletions src/Actions/Tables/Components/HelpAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ protected static function getContentView(Documentable $documentable): HtmlString
return new HtmlString(\Str::replace($replacementStringId, $html, $parsed));
}

public static function forDocumentable(Documentable | string $documentable): static
public static function forDocumentable(Documentable | string $documentable, ?string $panelId = null): static
{
$documentable = KnowledgeBase::documentable($documentable);
$documentable = KnowledgeBase::documentable($documentable, $panelId);

return static::make("help.{$documentable->getId()}")
->label($documentable->getTitle())
// ->icon($documentable->getIcon())
// ->icon($documentable->getIcon())
->icon('heroicon-o-question-mark-circle')
->when(
KnowledgeBase::companion()->hasModalPreviews(),
Expand Down
Loading
Loading