Skip to content

Commit

Permalink
Merge pull request #175 from HerrZatacke/develop
Browse files Browse the repository at this point in the history
Version 1.41.1
  • Loading branch information
HerrZatacke authored Jul 22, 2024
2 parents 4376e0d + b9f36a7 commit 02730c2
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gb-printer-web",
"version": "1.41.0",
"version": "1.41.1",
"description": "gb-printer-web",
"scripts": {
"start": "webpack serve --config ./scripts/webpack.dev.js",
Expand Down
2 changes: 1 addition & 1 deletion src/javascript/app/components/GalleryImage/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
&__created-meta {
display: flex;
justify-content: space-between;
z-index: $z-index-meta-pre;
}

&__meta {
Expand Down Expand Up @@ -109,7 +110,6 @@
white-space: pre;
font-family: monospace;
overflow: auto;
z-index: $z-index-content;
font-size: 11px;
line-height: 14px;
}
Expand Down
2 changes: 2 additions & 0 deletions src/javascript/app/store/middlewares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import importMessage from './middlewares/importMessage';
import lightbox from './middlewares/lightbox';
import pluginsMiddleware from './middlewares/plugins';
import saveEditPalette from './middlewares/saveEditPalette';
import saveRGBNImage from './middlewares/saveRGBNImage';
import settings from './middlewares/settings';
import share from './middlewares/share';
import startDownload from './middlewares/startDownload';
Expand All @@ -30,6 +31,7 @@ export default applyMiddleware(
lightbox,
pluginsMiddleware,
saveEditPalette,
saveRGBNImage,
settings,
share,
startDownload,
Expand Down
44 changes: 44 additions & 0 deletions src/javascript/app/store/middlewares/saveRGBNImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import dayjs from 'dayjs';
import { dateFormat, defaultRGBNPalette } from '../../defaults';
import { Actions } from '../actions';
import type { MiddlewareWithState } from '../../../../types/MiddlewareWithState';
import type { AddImagesAction } from '../../../../types/actions/ImageActions';
import type { RGBNHashes, RGBNImage } from '../../../../types/Image';
import type { ImageSelectionSetAction } from '../../../../types/actions/ImageSelectionActions';

const saveRGBNImage: MiddlewareWithState = (store) => (next) => async (action) => {
if (action.type === Actions.SAVE_NEW_RGB_IMAGES) {
const hashes: RGBNHashes[] = action.payload;

const { default: hash } = await import(/* webpackChunkName: "obh" */ 'object-hash');

const now = dayjs();

const images = hashes.map((rgbnHashes: RGBNHashes, index: number): RGBNImage => {
const image: RGBNImage = {
palette: defaultRGBNPalette,
hashes: rgbnHashes,
hash: hash(rgbnHashes),
created: now.add(index, 'milliseconds').format(dateFormat),
title: '',
tags: [],
};

return image;
});

store.dispatch<AddImagesAction>({
type: Actions.ADD_IMAGES,
payload: images,
});

store.dispatch<ImageSelectionSetAction>({
type: Actions.IMAGE_SELECTION_SET,
payload: images.map((i) => i.hash),
});
}

next(action);
};

export default saveRGBNImage;
3 changes: 2 additions & 1 deletion src/scss/auto-imports/_basic/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ $z-index-live-image: 1;
$z-index-navigation: 2;
$z-index-overlay-buttons: 2;
$z-index-gallery-image-buttons: 2;
$z-index-gallery-header-sticky: 3;
$z-index-overlay: 3;
$z-index-meta-pre: 4;
$z-index-overlay-box: 4;
$z-index-gallery-header-sticky: 5;

$default-border-radius: 5px;
$default-border-radius-small: 2px;
Expand Down

0 comments on commit 02730c2

Please sign in to comment.