From 6ad705ef177e27c4f0f46c47f01b0ca6bacdbeca Mon Sep 17 00:00:00 2001 From: "pablo.garcia.almis" Date: Sun, 14 Apr 2024 19:58:58 +0200 Subject: [PATCH 1/2] feature: On slideshows allow to wait for video finish instead of wait an amount of time --- .devcontainer/configuration.yaml | 22 ----- .devcontainer/devcontainer.json | 40 --------- .devcontainer/ui-lovelace.yaml | 24 ------ README.md | 80 +++++++++--------- package-lock.json | 135 ++++++++++--------------------- package.json | 3 +- rollup.config.mjs | 16 +--- src/gallery-card.js | 9 ++- 8 files changed, 93 insertions(+), 236 deletions(-) delete mode 100644 .devcontainer/configuration.yaml delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainer/ui-lovelace.yaml diff --git a/.devcontainer/configuration.yaml b/.devcontainer/configuration.yaml deleted file mode 100644 index 31ddd24..0000000 --- a/.devcontainer/configuration.yaml +++ /dev/null @@ -1,22 +0,0 @@ -lovelace: - mode: yaml - resources: - - url: http://127.0.0.1:5000/gallery-card.js - type: module - -default_config: - -demo: - -sensor: - - platform: files - folder: ./www/images - filter: '*.png' - name: images - sort: date - - - platform: files - folder: ./www/videos - filter: '*.png' - name: videos - sort: date \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 5ac0393..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,40 +0,0 @@ -// See https://aka.ms/vscode-remote/devcontainer.json for format details. -{ - "name": "Gallery Card 2024 Development", - "image": "ghcr.io/ludeeus/devcontainer/generic:latest", - "context": "..", - "remoteUser": "vscode", - "appPort": ["5000:5000", "9123:8123"], - "postCreateCommand": "npm ci && sudo container install", - "runArgs": ["-v", "${localWorkspaceFolder}/.devcontainer/www:/config/www"], - "extensions": [ - "github.vscode-pull-request-github", - "eamodio.gitlens", - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - "bierner.lit-html", - "runem.lit-plugin", - "davidanson.vscode-markdownlint", - "redhat.vscode-yaml", - "msjsdiag.debugger-for-chrome", - "yzhang.markdown-all-in-one" - ], - "settings": { - "files.eol": "\n", - "editor.tabSize": 2, - "terminal.integrated.shell.linux": "/bin/bash", - "editor.formatOnPaste": false, - "editor.formatOnSave": true, - "editor.formatOnType": true, - "files.trimTrailingWhitespace": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "markdown.extension.toc.githubCompatibility": true, - "files.watcherExclude": { - "**/.git/objects/**": true, - "**/.git/subtree-cache/**": true, - "**/node_modules/**": true, - "**/.hg/store/**": true, - "**/.rpt2_cache/**": true - } - } -} \ No newline at end of file diff --git a/.devcontainer/ui-lovelace.yaml b/.devcontainer/ui-lovelace.yaml deleted file mode 100644 index 50e03cf..0000000 --- a/.devcontainer/ui-lovelace.yaml +++ /dev/null @@ -1,24 +0,0 @@ -gallery_card_templates: - -views: - - title: Main - panel: true - cards: - - type: grid - columns: 2 - cards: - - type: custom:gallery-card - entities: - - sensor.images - file_name_format: YYYY-MM-DD_hh_mm_ss - caption_format: H:mm - D/M/YYYY - menu_alignment: hidden - reverse_sort: true - - - type: custom:gallery-card - entities: - - sensor.videos - file_name_format: YYYY-MM-DD_hh_mm_ss - caption_format: H:mm - D/M/YYYY - menu_alignment: hidden - reverse_sort: true \ No newline at end of file diff --git a/README.md b/README.md index 933af62..ff718f4 100644 --- a/README.md +++ b/README.md @@ -46,31 +46,32 @@ I recommend adding the card to a view which is set to Panel Mode for best result ### Configuration Variables Whether using the editor or yaml, the following configurations can be used: -| Name | Type | Default | Description -| ---- | ---- | ------- | ----------- -| entities | string | **Required** | A list of entity_id of a files sensor, folder sensor, or camera entity, or the media source path (see below). -| title | string | **Optional** | The name to show at the top of the card. -| menu_alignment | string | **Optional** | Alignment of the menu (the small list of images/videos to view). Default is if not specified is Responsive (see below) -| maximum_files | integer | **Optional** | The number of files to show. You may want to limit videos to make it perform better and to conserve bandwith. Used in combination with sort (using the config as above, the latest 10 for each entity by date will be shown) -| maximum_files_per_entity | boolean | **Optional** | Whether the number of files counted are per Entity. If true, then the maximum files displayed will be up to maximum_files per entity ; if false then only maximum_files total will be displayed (camera entities are always included and count as 1 file). The default is true. -| file_name_format | string | **Optional** | The format of the file names (see below). Used in combination with caption_format for the captions below the image/video. As of v3.4, this may also be specified at the entity level to override this for a specific entity. -| file_name_date_begins | integer | **Optional** | The character at which the date begins in the file name (starting at 1). It is usually not necessary to specify this, but if your dates are not parsing correctly and there are numbers at the start of your file names try this. This may also be specified at the entity level to override this for a specific entity. -| caption_format | string | **Optional** | The format of the caption (see below). Used in combination with file_name_format. As of v3.4, this may also be specified at the entity level to override this for a specific entity. -| folder_format | string | **Optional** | The format of the subfolder names under any media source folders (same options as for Captions below). Used when reverse_sort is true and maximum_files is specified to more efficiently fetch files from the media source (rather than looking in all folders). This may also be specified at the entity level to override this for a specific entity. -| slideshow_timer | integer | **Optional** | If present and greater than 0, will automatically advance the gallery after the provided number of seconds have passed. -| show_duration | boolean | **Optional** | Whether to include the video duration as part of the caption. The default is true. -| show_zoom | boolean | **Optional** | Whether to include a "Zoom" link with the URL to the resource. The default is false. -| video_autoplay | boolean | **Optional** | Enables the autoplay attribute for the main video in the gallery. The default is false. -| video_loop | boolean | **Optional** | Enables the loop attribute for the main video in the gallery. The default is false. -| video_muted | boolean | **Optional** | Mutes all videos in the gallery. The default is false. -| video_preload | boolean | **Optional** | Enables preloading and displaying of the preview image of all videos in the gallery. If disabled a static icon will be displayed instead. The default is true. -| parsed_date_sort | boolean | **Optional** | Whether to use the date parsed using file_name_format in order to sort the items. Use this to ensure sorting by date if the source is not properly sorted. The default is false. -| reverse_sort | boolean | **Optional** | Whether to sort the items with the newest first. The default is true. -| random_sort | boolean | **Optional** | Whether to sort the items randomly. The default is false. -| show_reload | boolean | **Optional** | Shows a reload link to allow manually triggering a reload of images/videos. The default is false. -| preview_video_at | integer | **Optional** | The preview picture time. Allow you to specify the seconds from start at which the preview image will be captured from the video. The default is 0. -| enable_date_search | boolean | **Optional** | Displays a date picker to enable the filtering of images and videos based on date. When enabled, the selected date will be used to search for a folder that matches the "search_date_folder_format." The default value is false (Requires recursion to be enabled). -| search_date_folder_format | string | **Optional** | The folder format for date search. Used in combination with "enable_date_search" to specify the folder format for filtering by date. The default value is "DD_MM_YYYY." +| Name | Type | Default | Description | +|---------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| entities | string | **Required** | A list of entity_id of a files sensor, folder sensor, or camera entity, or the media source path (see below). | +| title | string | **Optional** | The name to show at the top of the card. | +| menu_alignment | string | **Optional** | Alignment of the menu (the small list of images/videos to view). Default is if not specified is Responsive (see below) | +| maximum_files | integer | **Optional** | The number of files to show. You may want to limit videos to make it perform better and to conserve bandwith. Used in combination with sort (using the config as above, the latest 10 for each entity by date will be shown) | +| maximum_files_per_entity | boolean | **Optional** | Whether the number of files counted are per Entity. If true, then the maximum files displayed will be up to maximum_files per entity ; if false then only maximum_files total will be displayed (camera entities are always included and count as 1 file). The default is true. | +| file_name_format | string | **Optional** | The format of the file names (see below). Used in combination with caption_format for the captions below the image/video. As of v3.4, this may also be specified at the entity level to override this for a specific entity. | +| file_name_date_begins | integer | **Optional** | The character at which the date begins in the file name (starting at 1). It is usually not necessary to specify this, but if your dates are not parsing correctly and there are numbers at the start of your file names try this. This may also be specified at the entity level to override this for a specific entity. | +| caption_format | string | **Optional** | The format of the caption (see below). Used in combination with file_name_format. As of v3.4, this may also be specified at the entity level to override this for a specific entity. | +| folder_format | string | **Optional** | The format of the subfolder names under any media source folders (same options as for Captions below). Used when reverse_sort is true and maximum_files is specified to more efficiently fetch files from the media source (rather than looking in all folders). This may also be specified at the entity level to override this for a specific entity. | +| slideshow_timer | integer | **Optional** | If present and greater than 0, will automatically advance the gallery after the provided number of seconds have passed. | +| slideshow_video_end | boolean | **Optional** | If true, will automatically advance the gallery after the video has finished (only for video galleries). | +| show_duration | boolean | **Optional** | Whether to include the video duration as part of the caption. The default is true. | +| show_zoom | boolean | **Optional** | Whether to include a "Zoom" link with the URL to the resource. The default is false. | +| video_autoplay | boolean | **Optional** | Enables the autoplay attribute for the main video in the gallery. The default is false. | +| video_loop | boolean | **Optional** | Enables the loop attribute for the main video in the gallery. The default is false. | +| video_muted | boolean | **Optional** | Mutes all videos in the gallery. The default is false. | +| video_preload | boolean | **Optional** | Enables preloading and displaying of the preview image of all videos in the gallery. If disabled a static icon will be displayed instead. The default is true. | +| parsed_date_sort | boolean | **Optional** | Whether to use the date parsed using file_name_format in order to sort the items. Use this to ensure sorting by date if the source is not properly sorted. The default is false. | +| reverse_sort | boolean | **Optional** | Whether to sort the items with the newest first. The default is true. | +| random_sort | boolean | **Optional** | Whether to sort the items randomly. The default is false. | +| show_reload | boolean | **Optional** | Shows a reload link to allow manually triggering a reload of images/videos. The default is false. | +| preview_video_at | integer | **Optional** | The preview picture time. Allow you to specify the seconds from start at which the preview image will be captured from the video. The default is 0. | +| enable_date_search | boolean | **Optional** | Displays a date picker to enable the filtering of images and videos based on date. When enabled, the selected date will be used to search for a folder that matches the "search_date_folder_format." The default value is false (Requires recursion to be enabled). | +| search_date_folder_format | string | **Optional** | The folder format for date search. Used in combination with "enable_date_search" to specify the folder format for filtering by date. The default value is "DD_MM_YYYY." | ### Media Source To add a media source, specify the path to the media source folder as an entity. @@ -78,12 +79,13 @@ The format of a media source path should be: media-source://media_source/{your Only Local Media sources are currently supported (i.e. not DLNA sources) Additionally, media source entities can have the following additional options: -| Name | Type | Default | Description -| ---- | ---- | ------- | ----------- -| include_images | boolean | **Optional** | Whether to include image files from the folder. The default is true. -| include_video | boolean | **Optional** | Whether to include video files from the folder. The default is true. -| recursive | boolean | **Optional** | Whether to load files only under this folder (the default, false) or from any subfolder under the folder specified. Ignored when folder_format is specified. -| folder_format | string | **Optional** | The format of the subfolder names under the media source folder (same options as for Captions below). Used when reverse_sort is true and maximum_files is specified to more efficiently fetch files from the media source (rather than looking in all folders). + +| Name | Type | Default | Description | +|----------------|---------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| include_images | boolean | **Optional** | Whether to include image files from the folder. The default is true. | +| include_video | boolean | **Optional** | Whether to include video files from the folder. The default is true. | +| recursive | boolean | **Optional** | Whether to load files only under this folder (the default, false) or from any subfolder under the folder specified. Ignored when folder_format is specified. | +| folder_format | string | **Optional** | The format of the subfolder names under the media source folder (same options as for Captions below). Used when reverse_sort is true and maximum_files is specified to more efficiently fetch files from the media source (rather than looking in all folders). | Examples: @@ -106,14 +108,14 @@ Use caution if your folders are very deep (lots of subfolders) or wide (lots of ### Menu Alignment Available options for Menu Alignment are below: -| Value | Description -| ----------- | ----------- -| Responsive | On wider views (e.g. landscape >= 600px) uses the Right alignment, on narrower views (e.g. portrait < 600px) the Bottom -| Left | Always shows a vertical list on the left of the card. -| Right | Always shows a vertical list on the right of the card (shown in the image above). -| Top | Always shows a horizontal list on the top of the card. -| Botom | Always shows a vertical list on the bottom of the card. -| Hidden | Hides the list and only shows the larger image +| Value | Description | +|------------|-------------------------------------------------------------------------------------------------------------------------| +| Responsive | On wider views (e.g. landscape >= 600px) uses the Right alignment, on narrower views (e.g. portrait < 600px) the Bottom | +| Left | Always shows a vertical list on the left of the card. | +| Right | Always shows a vertical list on the right of the card (shown in the image above). | +| Top | Always shows a horizontal list on the top of the card. | +| Bottom | Always shows a vertical list on the bottom of the card. | +| Hidden | Hides the list and only shows the larger image | ### Caption Configuration The captions under the image/video is formatted using file_name_format and caption_format. If either file_name_format or caption_format is ommitted, the raw filename is used. diff --git a/package-lock.json b/package-lock.json index db7cb28..52f565a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-terser": "^0.4.4", "@semantic-release/changelog": "^6.0.3", "@semantic-release/commit-analyzer": "^12.0.0", "@semantic-release/exec": "^6.0.3", @@ -45,8 +46,6 @@ "prettier-eslint": "^16.3.0", "rollup": "^2.77.4-1", "rollup-plugin": "^1.0.0", - "rollup-plugin-serve": "^1.1.1", - "rollup-plugin-terser": "^7.0.2", "semantic-release": "^23.0.8" } }, @@ -1140,6 +1139,37 @@ } } }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser/node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", @@ -1762,6 +1792,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", "dev": true, + "peer": true, "dependencies": { "undici-types": "~5.26.4" } @@ -6211,41 +6242,6 @@ "node": ">= 0.6.0" } }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6747,18 +6743,6 @@ "node": ">=8.6" } }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -9907,15 +9891,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/opener": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", - "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", - "dev": true, - "bin": { - "opener": "bin/opener-bin.js" - } - }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -10839,32 +10814,6 @@ "rollup": "^3.26.3" } }, - "node_modules/rollup-plugin-serve": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-serve/-/rollup-plugin-serve-1.1.1.tgz", - "integrity": "sha512-H0VarZRtFR0lfiiC9/P8jzCDvtFf1liOX4oSdIeeYqUCKrmFA7vNiQ0rg2D+TuoP7leaa/LBR8XBts5viF6lnw==", - "dev": true, - "dependencies": { - "mime": "^2", - "opener": "1" - } - }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "deprecated": "This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, "node_modules/rollup-plugin/node_modules/rollup": { "version": "3.29.4", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", @@ -11380,15 +11329,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -11522,6 +11462,12 @@ "node": ">=8" } }, + "node_modules/smob": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", + "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", + "dev": true + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -12348,7 +12294,8 @@ "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/unicode-emoji-modifier-base": { "version": "1.0.0", diff --git a/package.json b/package.json index 829d4e8..4816107 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-terser": "^0.4.4", "@semantic-release/changelog": "^6.0.3", "@semantic-release/commit-analyzer": "^12.0.0", "@semantic-release/exec": "^6.0.3", @@ -56,8 +57,6 @@ "prettier-eslint": "^16.3.0", "rollup": "^2.77.4-1", "rollup-plugin": "^1.0.0", - "rollup-plugin-serve": "^1.1.1", - "rollup-plugin-terser": "^7.0.2", "semantic-release": "^23.0.8" }, "dependencies": { diff --git a/rollup.config.mjs b/rollup.config.mjs index 37301da..d70715e 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,22 +1,12 @@ import commonjs from '@rollup/plugin-commonjs'; import nodeResolve from '@rollup/plugin-node-resolve'; import babel from '@rollup/plugin-babel'; -import { terser } from 'rollup-plugin-terser'; -import serve from 'rollup-plugin-serve'; +import '@rollup/plugin-terser'; import json from '@rollup/plugin-json'; +import terser from '@rollup/plugin-terser'; const dev = process.env.ROLLUP_WATCH; -const serveopts = { - contentBase: ['./dist'], - host: '0.0.0.0', - port: 5000, - allowCrossOrigin: true, - headers: { - 'Access-Control-Allow-Origin': '*', - }, -}; - const plugins = [ nodeResolve({}), commonjs(), @@ -26,8 +16,6 @@ const plugins = [ babelHelpers: 'bundled', babelrc: false, }), - //cleanup({ comments: 'none' }), - dev && serve(serveopts), !dev && terser({ format: { diff --git a/src/gallery-card.js b/src/gallery-card.js index 0da89ed..624e49c 100644 --- a/src/gallery-card.js +++ b/src/gallery-card.js @@ -42,7 +42,8 @@ class GalleryCard extends LitElement { ` : this._isImageExtension(this._currentResource().extension) ? html`` : - html`` + html`` }
${this._currentResource().caption} ${this._isImageExtension(this._currentResource().extension) ? @@ -237,6 +238,12 @@ class GalleryCard extends LitElement { event.target.muted = "muted"; } + _videoHasEnded() { + if (this.config.slideshow_video_end) { + this._doSlideShow(); + } + } + _popupCamera() { const event = new Event("hass-more-info", { bubbles: true, From 7e1319ca88fa4743b19e1688cc0b1685feb2be0d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Apr 2024 18:01:57 +0000 Subject: [PATCH 2/2] chore(release): 1.1.0-dev.1 [skip ci] ## [1.1.0-dev.1](https://github.com/lukelalo/gallery-card/compare/v1.0.2-dev.2...v1.1.0-dev.1) (2024-04-14) ### Features * Try to validate with hacs validation ([58e1402](https://github.com/lukelalo/gallery-card/commit/58e1402c10fc7c15d80598fc5e4c72ecb1b48080)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da5af59..bd31d1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.1.0-dev.1](https://github.com/lukelalo/gallery-card/compare/v1.0.2-dev.2...v1.1.0-dev.1) (2024-04-14) + + +### Features + +* Try to validate with hacs validation ([58e1402](https://github.com/lukelalo/gallery-card/commit/58e1402c10fc7c15d80598fc5e4c72ecb1b48080)) + ## [1.0.2-dev.2](https://github.com/lukelalo/gallery-card/compare/v1.0.2-dev.1...v1.0.2-dev.2) (2024-04-14) diff --git a/package-lock.json b/package-lock.json index 52f565a..7c1340b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gallery-card", - "version": "1.0.2-dev.2", + "version": "1.1.0-dev.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gallery-card", - "version": "1.0.2-dev.2", + "version": "1.1.0-dev.1", "license": "MIT", "dependencies": { "dayjs": "^1.11.10", diff --git a/package.json b/package.json index 4816107..ae99cf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gallery-card", - "version": "1.0.2-dev.2", + "version": "1.1.0-dev.1", "description": "Gallery Card 2024 for lovelace", "main": "dist/gallery-card.js", "scripts": {