Skip to content

Commit

Permalink
Update to 2.1.0
Browse files Browse the repository at this point in the history
* Fix Icon svg pin and mask icon color
* Update dependencies
* Clear code
  • Loading branch information
denysdesign committed Mar 14, 2024
1 parent 5f0f9ac commit 8604fc1
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 220 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
basedir=".">

<property name="VERSION"
value="2.0.2" />
value="2.1.0" />
<property name="JOOMLA"
value="4.0" />

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jupwa",
"sideEffects": true,
"version": "1.7",
"version": "1.9",
"description": "JUPWA",
"private": true,
"scripts": {
Expand All @@ -21,18 +21,18 @@
"@babel/plugin-transform-runtime": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/runtime": "^7.24.0",
"@swc/core": "^1.4.2",
"@swc/core": "^1.4.8",
"babel-loader": "^9.1.3",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"cssnano": "^6.0.5",
"cssnano-preset-advanced": "^6.0.5",
"cssnano": "^6.1.0",
"cssnano-preset-advanced": "^6.1.0",
"mini-css-extract-plugin": "^2.8.1",
"postcss-loader": "^8.1.1",
"progress-bar-webpack-plugin": "^2.1.0",
"replace-in-file-webpack-plugin": "^1.0.6",
"sass": "^1.71.1",
"sass": "^1.72.0",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4",
"terser-webpack-plugin": "^5.3.10",
Expand All @@ -42,6 +42,6 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@khmyznikov/pwa-install": "^0.3.3"
"@khmyznikov/pwa-install": "^0.3.4"
}
}
2 changes: 1 addition & 1 deletion packages/plg_system_jupwa/jupwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function onAfterDispatch(): void
if($this->params->get('usepwainstall') == 1)
{
$wa = $doc->getWebAssetManager();
$jupwa_install_version = '1.7';
$jupwa_install_version = '1.9';

$wa->registerAndUseScript('jupwa', Uri::root() . 'media/jupwa/js/jupwa.' . $jupwa_install_version . '.js', [ 'version' => false ], [
'defer' => 'defer',
Expand Down
24 changes: 1 addition & 23 deletions packages/plg_system_jupwa/libraries/src/Helpers/META.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public static function render(array $option = []): void

self::splash([ 'params' => $option[ 'params' ] ]);

self::tags([ 'params' => $option[ 'params' ] ]);

self::pwa([ 'params' => $option[ 'params' ] ]);
}

Expand Down Expand Up @@ -222,7 +220,7 @@ public static function meta_apple(array $option = []): void
$doc->setMetaData('apple-mobile-web-app-title', ($option[ 'params' ]->get('manifest_sname') ? : $option[ 'params' ]->get('manifest_name')));
$doc->setMetaData('apple-mobile-web-app-status-bar-style', 'black-translucent');

if($option[ 'params' ]->get('source_icon_svg_pin') !== '' && $option[ 'params' ]->get('maskiconcolor') !== '')
if($option[ 'params' ]->get('source_icon_svg_pin') && $option[ 'params' ]->get('maskiconcolor'))
{
$file = $option[ 'params' ]->get('source_icon_svg_pin');
if(file_exists(JPATH_SITE . '/' . $file))
Expand Down Expand Up @@ -321,26 +319,6 @@ public static function manifest(): void
}
}

/**
*
* @param array $option
*
* @return void
*
* @throws \Exception
* @since 1.0
*/
public static function tags(array $option = []): void
{
$app = Factory::getApplication();
$doc = $app->getDocument();

if($option[ 'params' ]->get('theme_color') != '')
{
$doc->setMetaData('theme-color', $option[ 'params' ]->get('theme_color'));
}
}

/**
*
* @param array $option
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@
'JUPWA\\Helpers\\Schema' => $baseDir . '/src/Helpers/Schema.php',
'JUPWA\\Helpers\\ServiceWorker' => $baseDir . '/src/Helpers/ServiceWorker.php',
'JUPWA\\Helpers\\URL' => $baseDir . '/src/Helpers/URL.php',
'JUPWA\\Helpers\\Video' => $baseDir . '/src/Helpers/Video.php',
'JUPWA\\Thumbs\\Render' => $baseDir . '/src/Thumbs/Render.php',
'JUPWA\\Utils\\Image' => $baseDir . '/src/Utils/Image.php',
'JUPWA\\Utils\\Util' => $baseDir . '/src/Utils/Util.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class ComposerStaticInit4b8d8882bc29fff50f41e65be4486188
'JUPWA\\Helpers\\Schema' => __DIR__ . '/../..' . '/src/Helpers/Schema.php',
'JUPWA\\Helpers\\ServiceWorker' => __DIR__ . '/../..' . '/src/Helpers/ServiceWorker.php',
'JUPWA\\Helpers\\URL' => __DIR__ . '/../..' . '/src/Helpers/URL.php',
'JUPWA\\Helpers\\Video' => __DIR__ . '/../..' . '/src/Helpers/Video.php',
'JUPWA\\Thumbs\\Render' => __DIR__ . '/../..' . '/src/Thumbs/Render.php',
'JUPWA\\Utils\\Image' => __DIR__ . '/../..' . '/src/Utils/Image.php',
'JUPWA\\Utils\\Util' => __DIR__ . '/../..' . '/src/Utils/Util.php',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'joomla-ua/jupwa',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '7d6067dae1497efb92b1378e08047ee6f5dd811d',
'reference' => '5f0f9ac7e96875b971e24d984a70f900f450accb',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -31,7 +31,7 @@
'joomla-ua/jupwa' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '7d6067dae1497efb92b1378e08047ee6f5dd811d',
'reference' => '5f0f9ac7e96875b971e24d984a70f900f450accb',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
1 change: 0 additions & 1 deletion packages/plg_system_jupwa/media/jupwa/js/jupwa.1.7.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/plg_system_jupwa/media/jupwa/js/jupwa.1.9.js

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions packages/plg_system_jupwa/tmpl/sw.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,22 @@
});

// Offline
self.addEventListener('activate', () => self.clients.claim());

self.addEventListener('install', async (event) => {
event.waitUntil(
caches.open(CACHE)
.then((cache) => cache.add(offlineFallbackPage))
);
});

self.addEventListener('activate', () => self.clients.claim());
setCatchHandler(async ({event}) => {
if (event.request.destination === 'document') {
return new matchPrecache(offlineFallbackPage);
}

return new Response.error();
});

// Preload
if (workbox.navigationPreload.isSupported()) {
Expand Down Expand Up @@ -110,12 +118,10 @@
return preloadResp;
}
const networkResp = await fetch(event.request);

return networkResp;
} catch (error) {
const cache = await caches.open(CACHE);
const cachedResp = await cache.match(offlineFallbackPage);

return cachedResp;
}
})());
Expand Down
Loading

0 comments on commit 8604fc1

Please sign in to comment.