Skip to content

Commit f1e4b18

Browse files
authored
fix: Upgrade HTMX packages (#408)
* fix: Upgrade HTMX packages * chore: Update `codeigniter-markdown-pages`
1 parent 2e7ae99 commit f1e4b18

File tree

8 files changed

+77
-23
lines changed

8 files changed

+77
-23
lines changed

app/Config/Format.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use CodeIgniter\Format\FormatterInterface;
77
use CodeIgniter\Format\JSONFormatter;
88
use CodeIgniter\Format\XMLFormatter;
9+
use Michalsn\CodeIgniterHtmx\Format\HTMLFormatter;
910

1011
class Format extends BaseConfig
1112
{
@@ -28,6 +29,7 @@ class Format extends BaseConfig
2829
'application/json',
2930
'application/xml', // machine-readable XML
3031
'text/xml', // human-readable XML
32+
'text/html'
3133
];
3234

3335
/**
@@ -45,6 +47,7 @@ class Format extends BaseConfig
4547
'application/json' => JSONFormatter::class,
4648
'application/xml' => XMLFormatter::class,
4749
'text/xml' => XMLFormatter::class,
50+
'text/html' => HTMLFormatter::class,
4851
];
4952

5053
/**

app/Config/Htmx.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Config;
4+
5+
use Michalsn\CodeIgniterHtmx\Config\Htmx as BaseHtmx;
6+
7+
class Htmx extends BaseHtmx
8+
{
9+
/**
10+
* Enable / disable ToolbarDecorator.
11+
*/
12+
public bool $toolbarDecorator = true;
13+
14+
/**
15+
* Enable / diable ErrorModalDecorator.
16+
*/
17+
public bool $errorModalDecorator = true;
18+
19+
/**
20+
* The appearance of this string in the view
21+
* content will skip the htmx decorators. Even
22+
* when they are enabled.
23+
*/
24+
public string $skipViewDecoratorsString = 'htmxSkipViewDecorators';
25+
26+
/**
27+
* Enable / disable storing previous URLs for HTMX requests.
28+
*/
29+
public bool $storePreviousURL = true;
30+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"league/flysystem": "^3.18",
1717
"league/flysystem-aws-s3-v3": "^3.16",
1818
"league/flysystem-memory": "^3.19",
19-
"michalsn/codeigniter-htmx": "^1.4",
19+
"michalsn/codeigniter-htmx": "^2.1",
2020
"michalsn/codeigniter-markdown-pages": "dev-develop",
2121
"michalsn/codeigniter-signed-url": "^2.1",
2222
"michalsn/codeigniter-tags": "^1.0",

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 28 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"autoprefixer": "^10.4.16",
1717
"daisyui": "^4.7.2",
1818
"easymde": "^2.18.0",
19-
"htmx.org": "^1.9.10",
19+
"htmx.org": "^2.0",
20+
"htmx-ext-loading-states": "^2.0",
2021
"postcss": "^8.4.35",
2122
"postcss-advanced-variables": "^4.0.0",
2223
"postcss-cli": "^10.1.0",

themes/admin/js/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "./htmx.js";
2-
import "htmx.org/dist/ext/loading-states";
2+
import "htmx-ext-loading-states/dist/loading-states.min.js";
33
import Alpine from "alpinejs";
44
import alerts from "./components/alerts.js";
55
import "./components/themeSwitch.js";

themes/default/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "./htmx.js";
2-
import "htmx.org/dist/ext/loading-states";
2+
import "htmx-ext-loading-states/dist/loading-states.min.js";
33
import Alpine from "alpinejs";
44
import "./events.js";
55
import { initEditor } from "./components/markdownEditor.js";

0 commit comments

Comments
 (0)