generator-folklore 3.0.6 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/lib/generators/babel/index.js +8 -1
  2. package/lib/generators/build/index.js +3 -1
  3. package/lib/generators/cli/index.js +4 -1
  4. package/lib/generators/docs/index.js +9 -4
  5. package/lib/generators/eslint/index.js +12 -1
  6. package/lib/generators/intl/index.js +3 -1
  7. package/lib/generators/laravel-mediatheque/index.js +18 -0
  8. package/lib/generators/laravel-mediatheque/instructions/ServiceProvider.php +26 -0
  9. package/lib/generators/laravel-panneau/index.js +51 -5
  10. package/lib/generators/laravel-panneau/instructions/ServiceProvider.php +21 -0
  11. package/lib/generators/laravel-panneau/instructions/config.php +13 -0
  12. package/lib/generators/laravel-panneau/templates/app/Contracts/Repositories/Pages.php +2 -2
  13. package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Block.php +10 -0
  14. package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Image.php +15 -0
  15. package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Text.php +2 -0
  16. package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlockResource.php +1 -1
  17. package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlocksCollection.php +2 -0
  18. package/lib/generators/laravel-panneau/templates/app/Http/Resources/PageResource.php +6 -4
  19. package/lib/generators/laravel-panneau/templates/app/Models/Block.php +11 -0
  20. package/lib/generators/laravel-panneau/templates/app/Models/Media.php +11 -0
  21. package/lib/generators/laravel-panneau/templates/app/Models/Page.php +12 -2
  22. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/.gitkeep +0 -0
  23. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlocksCollection.php +2 -0
  24. package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/UsersCollection.php +10 -0
  25. package/lib/generators/laravel-panneau/templates/app/Panneau/PanneauServiceProvider.php +30 -4
  26. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/ImageBlock.php +30 -0
  27. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/TextBlock.php +3 -2
  28. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks.php +4 -1
  29. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages/Page.php +2 -2
  30. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages.php +2 -2
  31. package/lib/generators/laravel-panneau/templates/app/Repositories/Pages.php +2 -2
  32. package/lib/generators/laravel-panneau/templates/app/Resources/Block.php +10 -0
  33. package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/ImageBlock.php +27 -0
  34. package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/TextBlock.php +7 -2
  35. package/lib/generators/laravel-panneau/templates/config.php +29 -0
  36. package/lib/generators/laravel-panneau/templates/index.js +1 -1
  37. package/lib/generators/laravel-panneau/templates/lang/en/panneau.php +4 -0
  38. package/lib/generators/laravel-panneau/templates/lang/fr/panneau.php +4 -0
  39. package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlug.jsx +68 -0
  40. package/lib/generators/laravel-project/index.js +27 -12
  41. package/lib/generators/laravel-project/templates/laravel/app/Actions/Fortify/CreateNewUser.php +41 -0
  42. package/lib/generators/laravel-project/templates/laravel/app/Actions/Fortify/ResetUserPassword.php +31 -0
  43. package/lib/generators/laravel-project/templates/laravel/app/Actions/Fortify/UpdateUserPassword.php +34 -0
  44. package/lib/generators/laravel-project/templates/laravel/app/Actions/Fortify/UpdateUserProfileInformation.php +61 -0
  45. package/lib/generators/laravel-project/templates/laravel/app/Contracts/Repositories/Users.php +17 -0
  46. package/lib/generators/laravel-project/templates/laravel/app/Models/User.php +0 -30
  47. package/lib/generators/laravel-project/templates/laravel/app/Providers/AppServiceProvider.php +90 -15
  48. package/lib/generators/laravel-project/templates/laravel/app/Repositories/Users.php +4 -3
  49. package/lib/generators/laravel-project/templates/laravel/config/app.php +3 -2
  50. package/lib/generators/laravel-project/templates/laravel/config/image.php +204 -0
  51. package/lib/generators/lerna-repository/index.js +8 -3
  52. package/lib/generators/npm-package/index.js +6 -2
  53. package/lib/generators/prettier/index.js +5 -1
  54. package/lib/generators/react-app/index.js +22 -2
  55. package/lib/generators/react-package/index.js +14 -5
  56. package/lib/generators/rollup/index.js +8 -1
  57. package/lib/generators/server/index.js +9 -2
  58. package/lib/generators/storybook/index.js +9 -1
  59. package/lib/generators/stylelint/index.js +6 -1
  60. package/lib/generators/test/index.js +10 -1
  61. package/package.json +6 -5
  62. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Block.php +0 -22
  63. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Blocks.php +0 -87
  64. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/Page.php +0 -51
  65. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/PageSlug.php +0 -34
  66. package/lib/generators/laravel-panneau/templates/app/Panneau/Fields/PageSlugLocalized.php +0 -18
  67. package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/BlockWithBlocks.php +0 -110
@@ -1,110 +0,0 @@
1
- <?php
2
-
3
- namespace App\Panneau\Resources\Blocks;
4
-
5
- use Panneau\Contracts\ResourceType;
6
- use Panneau\Contracts\Repository;
7
- use Panneau\Contracts\Resource;
8
- use Panneau\Contracts\ResourceItem;
9
- use App\Panneau\Fields\Blocks;
10
- use JsonSerializable;
11
- use Illuminate\Contracts\Support\Arrayable;
12
- use Illuminate\Contracts\Support\Jsonable;
13
-
14
- class BlockWithBlocks implements ResourceType, Arrayable, Jsonable
15
- {
16
- protected $type;
17
-
18
- protected $depth;
19
-
20
- public function __construct(ResourceType $type, $depth)
21
- {
22
- $this->type = $type;
23
- $this->depth = $depth;
24
- }
25
-
26
- public function currentDepth(): int
27
- {
28
- return $this->depth;
29
- }
30
-
31
- public function id(): string
32
- {
33
- return $this->type->id();
34
- }
35
-
36
- public function name(): string
37
- {
38
- return $this->type->name();
39
- }
40
-
41
- public function fields(): array
42
- {
43
- return collect($this->type->fields())
44
- ->map(function ($field) {
45
- return $field instanceof Blocks ? $field->currentDepth($this->depth) : $field;
46
- })
47
- ->toArray();
48
- }
49
-
50
- public function resource(): Resource
51
- {
52
- return $this->type->resource();
53
- }
54
-
55
- public function settings(): ?array
56
- {
57
- return $this->type->settings();
58
- }
59
-
60
- public function makeRepository(): ?Repository
61
- {
62
- return $this->type->makeRepository();
63
- }
64
-
65
- public function makeJsonResource(ResourceItem $item): ?JsonSerializable
66
- {
67
- return $this->type->makeJsonResource($item);
68
- }
69
-
70
- public function makeJsonCollection($resources): ?JsonSerializable
71
- {
72
- return $this->type->makeJsonCollection($resources);
73
- }
74
-
75
- public function toArray()
76
- {
77
- $id = $this->id();
78
- $data = [
79
- 'id' => $this->id(),
80
- 'name' => $this->name(),
81
- 'fields' => collect($this->resource()->fields())
82
- ->filter(function ($field) use ($id) {
83
- $excepTypes = $field->exceptTypes();
84
- $onlyTypes = $field->onlyTypes();
85
- return (is_null($excepTypes) || !in_array($id, $excepTypes)) &&
86
- (is_null($onlyTypes) || in_array($id, $onlyTypes));
87
- })
88
- ->merge($this->fields())
89
- ->values()
90
- ->toArray(),
91
- ];
92
-
93
- $settings = $this->settings();
94
- if (isset($settings)) {
95
- $data['settings'] = $settings;
96
- }
97
-
98
- return $data;
99
- }
100
-
101
- public function jsonSerialize()
102
- {
103
- return $this->type->jsonSerialize();
104
- }
105
-
106
- public function toJson($options = 0)
107
- {
108
- return $this->type->toJson($options);
109
- }
110
- }