Skip to content

Commit 99c4ed5

Browse files
authored
Merge pull request #90 from takielias/12.x
12.x
2 parents 7f9e72b + 685f5ec commit 99c4ed5

File tree

8 files changed

+519
-61
lines changed

8 files changed

+519
-61
lines changed

resources/views/errors/minimal.blade.php

Lines changed: 330 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,37 @@
1-
<a href="?theme=dark" class="nav-link px-0 hide-theme-dark" title="Enable dark mode"
2-
data-bs-toggle="tooltip"
1+
<a href="?theme=dark" class="nav-link px-0 hide-theme-dark" title="Enable dark mode" data-bs-toggle="tooltip"
32
data-bs-placement="bottom">
4-
<!-- Download SVG icon from http://tabler-icons.io/i/moon -->
5-
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
6-
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
7-
stroke-linejoin="round">
8-
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
3+
<!-- Download SVG icon from http://tabler.io/icons/icon/moon -->
4+
<svg
5+
xmlns="http://www.w3.org/2000/svg"
6+
width="24"
7+
height="24"
8+
viewBox="0 0 24 24"
9+
fill="none"
10+
stroke="currentColor"
11+
stroke-width="2"
12+
stroke-linecap="round"
13+
stroke-linejoin="round"
14+
class="icon icon-1"
15+
>
916
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z"/>
1017
</svg>
1118
</a>
12-
<a href="?theme=light" class="nav-link px-0 hide-theme-light" title="Enable light mode"
13-
data-bs-toggle="tooltip"
19+
<a href="?theme=light" class="nav-link px-0 hide-theme-light" title="Enable light mode" data-bs-toggle="tooltip"
1420
data-bs-placement="bottom">
15-
<!-- Download SVG icon from http://tabler-icons.io/i/sun -->
16-
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
17-
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
18-
stroke-linejoin="round">
19-
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
20-
<circle cx="12" cy="12" r="4"/>
21-
<path
22-
d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"/>
21+
<!-- Download SVG icon from http://tabler.io/icons/icon/sun -->
22+
<svg
23+
xmlns="http://www.w3.org/2000/svg"
24+
width="24"
25+
height="24"
26+
viewBox="0 0 24 24"
27+
fill="none"
28+
stroke="currentColor"
29+
stroke-width="2"
30+
stroke-linecap="round"
31+
stroke-linejoin="round"
32+
class="icon icon-1"
33+
>
34+
<path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"/>
35+
<path d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"/>
2336
</svg>
2437
</a>
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
<header class="{{$layoutData['cssClasses'] ?? 'navbar navbar-expand-md navbar-light d-print-none'}}"
2-
@if(config('tablar.layout_light_topbar') !== null)
3-
data-bs-theme="{{ config('tablar.layout_light_topbar') ? 'light' : 'dark' }}"
4-
@endif
5-
>
1+
<header class="{{$layoutData['cssClasses'] ?? 'navbar navbar-expand-md navbar-light d-print-none'}}">
62
@include('tablar::partials.common.container-xl')
73
</header>

src/Console/TablarUpdateCommand.php

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,124 @@ class TablarUpdateCommand extends Command
1414
public function handle()
1515
{
1616
TablarPreset::update();
17+
$this->updateTablarJsImport();
18+
$this->updateTablerCssImport();
1719
$this->info('Tablar has been updated successfully.');
1820
$this->comment('Please run "npm install" first. Once the installation is done, run "npm run dev"');
1921
}
22+
23+
24+
/**
25+
* Update Tablar import - comment out old demo-theme.js import and add new one
26+
*
27+
* @param string $filePath Path to the tablar-init.js file
28+
* @return void True if update was successful, false otherwise
29+
*/
30+
private function updateTablarJsImport($filePath = null): void
31+
{
32+
// Default path if none provided
33+
if (!$filePath) {
34+
$filePath = resource_path('js/tabler-init.js');
35+
}
36+
37+
// Check if file exists
38+
if (!file_exists($filePath)) {
39+
$this->error("File not found: {$filePath}");
40+
return;
41+
}
42+
43+
// Read the file content
44+
$content = file_get_contents($filePath);
45+
$originalContent = $content;
46+
47+
// Define patterns to search for /assets/demo-theme.js
48+
$patterns = [
49+
'/^(\s*)(import\s+[\'"][^\'\"]*\/assets\/demo-theme\.js[\'"];?\s*)$/m',
50+
'/^(\s*)(import\s+[\'"][^\'\"]*\/assets\/demo-theme[\'"];?\s*)$/m'
51+
];
52+
53+
// Define the new import
54+
$newImport = "import '../../node_modules/@tabler/core/dist/js/tabler-theme.js';";
55+
56+
$found = false;
57+
58+
// Check and comment out old imports
59+
foreach ($patterns as $pattern) {
60+
if (preg_match($pattern, $content)) {
61+
$content = preg_replace($pattern, '$1// $2' . "\n$1" . $newImport, $content);
62+
$found = true;
63+
$this->info("Found and commented out old demo-theme.js import");
64+
break;
65+
}
66+
}
67+
68+
if (!$found) {
69+
$this->info("No /assets/demo-theme.js import found in file.");
70+
return;
71+
}
72+
73+
// Write the updated content back to file
74+
$result = file_put_contents($filePath, $content);
75+
76+
if ($result !== false) {
77+
$this->info("Successfully updated {$filePath}");
78+
$this->info("Old import commented out and new import added");
79+
} else {
80+
$this->error("Failed to write to {$filePath}");
81+
}
82+
}
83+
84+
/**
85+
* Update Tabler CSS import - replace old tabler-icons import with new one
86+
*
87+
* @param string $filePath Path to the tabler.scss file
88+
* @return void
89+
*/
90+
private function updateTablerCssImport($filePath = null): void
91+
{
92+
// Default path if none provided
93+
if (!$filePath) {
94+
$filePath = resource_path('sass/tabler.scss');
95+
}
96+
97+
// Check if file exists
98+
if (!file_exists($filePath)) {
99+
$this->error("File not found: {$filePath}");
100+
return;
101+
}
102+
103+
// Read the file content
104+
$content = file_get_contents($filePath);
105+
106+
// Define the old import pattern
107+
$oldImportPattern = '/^(\s*)@import\s+[\'"]\.\.\/\.\.\/node_modules\/@tabler\/icons-webfont\/dist\/tabler-icons[\'"];?\s*$/m';
108+
109+
// Define the new import
110+
$newImport = '@import "@tabler/icons-webfont/dist/tabler-icons.css";' . "\n";
111+
112+
$found = false;
113+
114+
// Check if old import exists
115+
if (preg_match($oldImportPattern, $content)) {
116+
$content = preg_replace($oldImportPattern, '$1' . $newImport, $content);
117+
$found = true;
118+
$this->info("Found and updated old tabler-icons import");
119+
}
120+
121+
if (!$found) {
122+
$this->info("No old tabler-icons import found in file.");
123+
return;
124+
}
125+
126+
// Write the updated content back to file
127+
$result = file_put_contents($filePath, $content);
128+
129+
if ($result !== false) {
130+
$this->info("Successfully updated {$filePath}");
131+
$this->info("Old CSS import replaced with new import");
132+
} else {
133+
$this->error("Failed to write to {$filePath}");
134+
}
135+
}
136+
20137
}

src/TablarPreset.php

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function exportAssets(): void
9999
{
100100

101101
tap(new Filesystem, function ($filesystem) {
102-
collect($filesystem->allFiles(base_path('node_modules/@tabler/icons-webfont/fonts')))
102+
collect($filesystem->allFiles(base_path('node_modules/@tabler/icons-webfont/dist/fonts')))
103103
->each(function (SplFileInfo $file) use ($filesystem) {
104104
$filesystem->copy(
105105
$file->getPathname(),
@@ -121,58 +121,42 @@ protected static function updatePackageArray(array $packages): array
121121
{
122122
return array_merge([
123123
"jquery" => "3.7.*",
124-
"bootstrap" => "5.3.3",
125-
'@tabler/core' => '1.0.0',
124+
"bootstrap" => "5.3.6",
125+
'@tabler/core' => '1.3.2',
126126
"@popperjs/core" => "^2.11.8",
127-
"@tabler/icons" => "^3.30.0",
128-
"@tabler/icons-webfont" => "^2.32.0",
129-
"apexcharts" => "^3.40.0",
130-
"countup.js" => "^2.8.0",
127+
"@tabler/icons" => "^3.33.0",
128+
"@tabler/icons-webfont" => "^3.33.0",
129+
"apexcharts" => "^3.54.1",
130+
"countup.js" => "^2.8.2",
131131
"dropzone" => "^6.0.0-beta.2",
132132
"autosize" => "^6.0.1",
133-
"choices.js" => "^10.2.0",
133+
"choices.js" => "^11.1.0",
134134
"star-rating.js" => "^4.3.1",
135-
"fslightbox" => "^3.4.2",
135+
"fslightbox" => "^3.6.0",
136136
"jsvectormap" => "^1.6.0",
137+
"fullcalendar" => "^6.1.17",
138+
"signature_pad" => "^5.0.7",
137139
"list.js" => "^2.3.1",
138140
"litepicker" => "^2.0.12",
139141
"nouislider" => "^15.8.1",
140142
"plyr" => "^3.7.8",
141-
"tinymce" => "^7.6.1",
142-
"tom-select" => "^2.4.2",
143-
"@melloware/coloris" => "^0.19.1",
143+
"tom-select" => "^2.4.3",
144+
"@melloware/coloris" => "^0.24.2",
144145
"typed.js" => "^2.1.0",
145-
"imask" => "^6.6.1",
146+
"imask" => "^7.6.1",
146147
"laravel-vite-plugin" => "^1.0",
147148
"sass" => "~1.64.2",
148149
"sass-loader" => "^16.0.1",
149150
"vite" => "^5.0.0",
150151
"axios" => "^1.7.4",
152+
"vite-plugin-static-copy" => "~3.0.0",
151153
], Arr::except($packages, [
152154
'axios',
153155
'postcss',
154-
'jquery',
155-
'bootstrap',
156-
'@tabler/core',
157-
'@popperjs/core',
158-
'@tabler/icons',
159-
'@tabler/icons-webfont',
160-
'apexcharts',
161-
'countup.js',
162-
'choices.js',
163-
'dropzone',
164-
'fslightbox',
165-
'jsvectormap',
166-
'list.js',
167-
'litepicker',
168-
'nouislider',
169-
'plyr',
170-
'imask',
171-
'tinymce',
172-
'tom-select',
173156
'laravel-vite-plugin',
174157
'sass',
175158
'sass-loader',
159+
'vite-plugin-static-copy',
176160
'vite'
177161
]));
178162
}

src/stubs/resources/js/tabler-init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ window.$ = window.jQuery = jQuery;
1010
Import the Tabler Js with Demo theme
1111
*/
1212
import '../../node_modules/@tabler/core/dist/js/tabler';
13-
import '../../node_modules/@tabler/core/src/js/demo-theme';
13+
import '../../node_modules/@tabler/core/dist/js/tabler-theme.js';
1414

src/stubs/resources/sass/tabler.scss

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@
44

55
// Default (LTR) Tabler Styles.
66
// DISABLE this line if you want to enable Right-to-Left (RTL) support.
7-
@import "../../node_modules/@tabler/core/src/scss/tabler";
7+
@import "../../node_modules/@tabler/core/scss/tabler";
88

99
// ENABLE the following line for Right-to-Left (RTL) support.
1010
// @import "../../node_modules/@tabler/core/dist/css/tabler.rtl.css";
1111

1212
// Tabler Vendor Styles.
13-
@import "../../node_modules/@tabler/core/src/scss/tabler-vendors";
13+
// ENABLE the following line for Vendor style support.
14+
@import "../../node_modules/@tabler/core/scss/tabler-vendors";
1415

1516
// Tabler Flags Styles.
1617
// ENABLE the following line for Flags Icon style support.
17-
// @import "../../node_modules/@tabler/core/src/scss/tabler-flags";
18+
// @import "../../node_modules/@tabler/core/scss/tabler-flags";
19+
20+
// Tabler Marketing Styles.
21+
// ENABLE the following line for Marketing style support.
22+
// @import "../../node_modules/@tabler/core/scss/tabler-marketing";
1823

1924
// Tabler Payment Styles.
2025
// ENABLE the following line for Payment Icon style support.
21-
// @import "../../node_modules/@tabler/core/src/scss/tabler-payments";
26+
// @import "../../node_modules/@tabler/core/scss/tabler-payments";
2227

2328
// Tabler Social Styles.
2429
// ENABLE the following line for Social Icon style support.
25-
// @import "../../node_modules/@tabler/core/src/scss/tabler-social";
30+
// @import "../../node_modules/@tabler/core/scss/tabler-socials";
2631

2732
// Tabler Webfont Icons
28-
@import "../../node_modules/@tabler/icons-webfont/tabler-icons.css";
33+
@import "@tabler/icons-webfont/dist/tabler-icons.css";
2934

3035
// Custom Icon Sizes and Styles
3136
@import "../css/icon-style.css";

src/stubs/vite.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
import {defineConfig} from 'vite';
22
import laravel from 'laravel-vite-plugin';
3+
import {viteStaticCopy} from 'vite-plugin-static-copy'
34

45
export default defineConfig({
56
plugins: [
67
laravel({
78
input: ['resources/js/app.js'],
89
refresh: true,
910
}),
11+
viteStaticCopy({
12+
targets: [
13+
{
14+
src: 'node_modules/@tabler/core/dist/img',
15+
dest: '../dist'
16+
},
17+
{
18+
src: 'node_modules/@tabler/icons-webfont/dist/fonts',
19+
dest: '../build/assets'
20+
}
21+
]
22+
})
1023
],
1124
server: {
1225
hmr: {

0 commit comments

Comments
 (0)