Skip to content

Commit 3bb7ffb

Browse files
Upgrade to Filament v4 (#19)
* Upgrade to Filament v4 * Add plugin.css since we have some views loaded in Filament * Fix placeholder input for Filament 4 * Upgrade to Filament v5 (#24) * Upgrade to Filament v5 * Update namespace to wotz * Fix styling --------- Co-authored-by: jyrkidn <2447042+jyrkidn@users.noreply.github.com> --------- Co-authored-by: Sander Van Damme <sander.vandamme@onlyhumans.com> Co-authored-by: jyrkidn <2447042+jyrkidn@users.noreply.github.com>
1 parent 4f176a6 commit 3bb7ffb

File tree

16 files changed

+45
-45
lines changed

16 files changed

+45
-45
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Feature request
4-
url: https://github.com/codedor/filament-placeholder-input/discussions/new?category=ideas
4+
url: https://github.com/wotzebra/filament-placeholder-input/discussions/new?category=ideas
55
about: Share ideas for new features
66
- name: Support question
7-
url: https://github.com/codedor/filament-placeholder-input/discussions/new?category=q-a
7+
url: https://github.com/wotzebra/filament-placeholder-input/discussions/new?category=q-a
88
about: Ask the community for help
99
- name: Report a security issue
10-
url: https://github.com/codedor/filament-placeholder-input/README.md#security
10+
url: https://github.com/wotzebra/filament-placeholder-input/README.md#security
1111
about: Learn how to notify us for sensitive bugs
1212
- name: Report a bug
13-
url: https://github.com/codedor/filament-placeholder-input/issues/new
13+
url: https://github.com/wotzebra/filament-placeholder-input/issues/new
1414
about: Report a reproducable bug

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
info@codedor.be.
63+
info@whoownsthezebra.be.
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ Some things to consider before submitting an issue
4545

4646
## Coding style
4747

48-
See our [guidelines](https://guidelines.codedor.be/coding-standards/php).
49-
5048
### Laravel Pint
5149

5250
Don't worry if your code styling is not perfect! Each of our packages have a [Laravel Pint](https://github.com/laravel/pint) Github Action will automatically merge any style fixes into the package when you commit changes to a pull request.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A field for Filament that allows you to add content to another field
77
You can install the package via composer:
88

99
```bash
10-
composer require codedor/filament-placeholder-input
10+
composer require wotz/filament-placeholder-input
1111
```
1212

1313
## Documentation
@@ -34,7 +34,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
3434

3535
## Security Vulnerabilities
3636

37-
If you discover any security-related issues, please email info@codedor.be instead of using the issue tracker.
37+
If you discover any security-related issues, please email info@whoownsthezebra.be instead of using the issue tracker.
3838

3939
## License
4040

UPGRADING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Upgrading
22

3-
## From vx to vy
3+
## From v1 to v2
4+
5+
- Install `wotz/filament-placeholder-input` instead of `codedor/filament-placeholder-input`
6+
- Replace all occurrences of `Codedor\FilamentPlaceholderInput` namespace with new `Wotz\FilamentPlaceholderInput` namespace

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
{
2-
"name": "codedor/filament-placeholder-input",
2+
"name": "wotz/filament-placeholder-input",
33
"description": "A field for Filament that allows you to add content to another field",
44
"keywords": [
5-
"codedor",
5+
"who owns the zebra",
66
"laravel",
77
"filament-placeholder-input"
88
],
9-
"homepage": "https://github.com/codedor/filament-placeholder-input",
9+
"homepage": "https://github.com/wotzebra/filament-placeholder-input",
1010
"license": "MIT",
1111
"require": {
1212
"php": "^8.2",
13-
"filament/filament": "^3.1",
13+
"filament/filament": "^4.0|^5.0",
1414
"illuminate/contracts": "^10.0|^11.0|^12.0",
1515
"spatie/laravel-package-tools": "^1.12"
1616
},
1717
"require-dev": {
18+
"larastan/larastan": "^2.0|^3.0",
1819
"laravel/pint": "^1.0",
1920
"nunomaduro/collision": "^7.0 || ^8.0",
20-
"larastan/larastan": "^2.0|^3.0",
2121
"orchestra/testbench": "^8.0|^9.0|^10.0",
22-
"pestphp/pest": "^2.0|^3.0",
23-
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
22+
"pestphp/pest": "^3.0|^4.0",
23+
"pestphp/pest-plugin-laravel": "^3.0|^4.0",
2424
"phpstan/extension-installer": "^1.1|^2.0",
2525
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
2626
"phpstan/phpstan-phpunit": "^1.0|^2.0"
2727
},
2828
"autoload": {
2929
"psr-4": {
30-
"Codedor\\FilamentPlaceholderInput\\": "src",
31-
"Codedor\\FilamentPlaceholderInput\\Database\\Factories\\": "database/factories"
30+
"Wotz\\FilamentPlaceholderInput\\": "src",
31+
"Wotz\\FilamentPlaceholderInput\\Database\\Factories\\": "database/factories"
3232
}
3333
},
3434
"autoload-dev": {
3535
"psr-4": {
36-
"Codedor\\FilamentPlaceholderInput\\Tests\\": "tests"
36+
"Wotz\\FilamentPlaceholderInput\\Tests\\": "tests"
3737
}
3838
},
3939
"extra": {
4040
"laravel": {
4141
"providers": [
42-
"Codedor\\FilamentPlaceholderInput\\Providers\\FilamentPlaceholderInputServiceProvider"
42+
"Wotz\\FilamentPlaceholderInput\\Providers\\FilamentPlaceholderInputServiceProvider"
4343
]
4444
}
4545
},

phpstan-baseline.neon

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getPlaceholderVariables\\(\\)\\.$#"
5-
count: 1
6-
path: src/Filament/Forms/Components/PlaceholderInput.php
7-
-
8-
message: "#^Property Codedor\\\\FilamentPlaceholderInput\\\\Filament\\\\Forms\\\\Components\\\\PlaceholderInput\\:\\:\\$view \\(view-string\\) does not accept default value of type string\\.$#"
4+
message: "#^Cannot call method getPlaceholderVariables\\(\\) on array\\<string, mixed\\>\\|Illuminate\\\\Database\\\\Eloquent\\\\Model.$#"
95
count: 1
106
path: src/Filament/Forms/Components/PlaceholderInput.php

phpunit.xml.dist

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<testsuites>
4-
<testsuite name="Codedor Test Suite">
4+
<testsuite name="Wotz Test Suite">
55
<directory>tests</directory>
66
</testsuite>
77
</testsuites>
88
<coverage>
9-
<include>
10-
<directory suffix=".php">./src</directory>
11-
</include>
129
<report>
1310
<html outputDirectory="build/coverage"/>
1411
<text outputFile="build/coverage.txt"/>
@@ -21,4 +18,9 @@
2118
<php>
2219
<server name="APP_KEY" value="base64:llrAPMQL0x08EHCBwf/UkOqptL7p/SXkcTnY2znWurE="/>
2320
</php>
21+
<source>
22+
<include>
23+
<directory suffix=".php">./src</directory>
24+
</include>
25+
</source>
2426
</phpunit>

resources/css/plugin.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@source '../views/**';

resources/views/forms/components/placeholder-input.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@
1111
<div x-data="{
1212
linked: @js($getDefaultLink()),
1313
getTiptap (linked) {
14-
let editors = document.querySelectorAll('.tiptap-wrapper');
14+
let editors = document.querySelectorAll('.fi-input-wrp-content-ctn > div');
1515
1616
if (editors.length === 0) {
1717
return null;
1818
}
1919
2020
return [...editors].filter(function (editor) {
21-
return editor._x_dataStack && editor._x_dataStack[0].statePath === 'data.' + linked;
21+
return editor._x_dataStack && editor._x_dataStack[1].$statePath === 'data.' + linked;
2222
});
2323
},
2424
addToBody (e, key) {
2525
let tiptap = this.getTiptap(this.linked)
2626
27-
if (tiptap) {
28-
tiptap[0]._x_dataStack[0].editor().chain().focus().insertContent('@{{ ' + key + ' }}').run()
27+
if (tiptap.length) {
28+
tiptap[0]._x_dataStack[0].getEditor().chain().focus().insertContent('@{{ ' + key + ' }}').run()
2929
return
3030
}
3131

0 commit comments

Comments
 (0)