Skip to content

Commit 92a3c11

Browse files
committed
refactor: extract Craftile config to register method
1 parent 6322d8b commit 92a3c11

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

resources/assets/editor/craftile/features/updatePersistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function setupUpdatePersistence(editor: CraftileEditor, state: State) {
171171
const blocksToUpdate = determineBlocksToProcess(directlyModifiedIds, allBlocks);
172172

173173
const effects = computeEffects(htmlResponse, blocksToUpdate);
174-
console.log(effects);
174+
175175
editor.preview.sendMessage('updates.effects', {
176176
effects,
177177
...mergedUpdates,

src/Providers/CoreServiceProvider.php

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function boot(): void
6767
public function register(): void
6868
{
6969
$this->registerConfigs();
70+
$this->registerCraftileConfig();
7071
$this->registerSingletons();
7172
$this->registerCustomUrlGenerator();
7273
}
@@ -79,22 +80,6 @@ public function register(): void
7980

8081
protected function bootCraftile(): void
8182
{
82-
config([
83-
'craftile.directives' => [
84-
'craftileBlock' => 'visualBlock',
85-
'craftileRegion' => 'visualRegion',
86-
'craftileContent' => 'visualContent',
87-
'craftileLayoutContent' => 'visualLayoutContent',
88-
],
89-
90-
'craftile.components.namespace' => 'visual',
91-
92-
'craftile.block_data_class' => \BagistoPlus\Visual\Data\BlockData::class,
93-
'craftile.block_schema_class' => \BagistoPlus\Visual\Data\BlockSchema::class,
94-
95-
'craftile.php_template_extensions' => ['visual.php'],
96-
]);
97-
9883
Craftile::resolveRegionViewUsing(function ($name) {
9984
return "shop::regions.$name";
10085
});
@@ -252,6 +237,25 @@ protected function registerConfigs(): void
252237
$this->mergeConfigFrom(__DIR__.'/../../config/svg-iconmap.php', 'bagisto_visual_iconmap');
253238
}
254239

240+
protected function registerCraftileConfig(): void
241+
{
242+
config([
243+
'craftile.directives' => [
244+
'craftileBlock' => 'visualBlock',
245+
'craftileRegion' => 'visualRegion',
246+
'craftileContent' => 'visualContent',
247+
'craftileLayoutContent' => 'visualLayoutContent',
248+
],
249+
250+
'craftile.components.namespace' => 'visual',
251+
252+
'craftile.block_data_class' => \BagistoPlus\Visual\Data\BlockData::class,
253+
'craftile.block_schema_class' => \BagistoPlus\Visual\Data\BlockSchema::class,
254+
255+
'craftile.php_template_extensions' => ['visual.php'],
256+
]);
257+
}
258+
255259
protected function registerSingletons(): void
256260
{
257261
$this->app->singleton(ThemeSettingsLoader::class, function (Application $app) {

0 commit comments

Comments
 (0)