Skip to content

Commit d2d81b0

Browse files
committed
Patch ngx-gallery for removed Hammer symbols
`@kolkov/ngx-gallery` imports `HammerGestureConfig` and `HAMMER_GESTURE_CONFIG`, which `@angular/platform-browser` no longer exports. Introduces patch-package with a patch replacing the import with inert local stubs. The gallery's gesture configuration was already non-functional, as the application never imported `HammerModule`.
1 parent 4ca77de commit d2d81b0

3 files changed

Lines changed: 266 additions & 1 deletion

File tree

frontend/package-lock.json

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

frontend/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"eslint-plugin-react-hooks": "^7.1.1",
4848
"globals": "^17.6.0",
4949
"jsdom": "^29.1.1",
50+
"patch-package": "^8.0.1",
5051
"playwright": "^1.59.1",
5152
"source-map-explorer": "^2.5.2",
5253
"ts-node": "~10.9.2",
@@ -193,6 +194,7 @@
193194
"test:watch": "ng test --watch=true",
194195
"lint": "ng lint",
195196
"lint:fix": "ng lint --fix",
196-
"generate-typings": "tsc -d -p tsconfig.app.json"
197+
"generate-typings": "tsc -d -p tsconfig.app.json",
198+
"postinstall": "patch-package"
197199
}
198200
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
diff --git a/node_modules/@kolkov/ngx-gallery/esm2020/lib/ngx-gallery.module.mjs b/node_modules/@kolkov/ngx-gallery/esm2020/lib/ngx-gallery.module.mjs
2+
index def4186..5d00f28 100644
3+
--- a/node_modules/@kolkov/ngx-gallery/esm2020/lib/ngx-gallery.module.mjs
4+
+++ b/node_modules/@kolkov/ngx-gallery/esm2020/lib/ngx-gallery.module.mjs
5+
@@ -1,4 +1,4 @@
6+
-import { NgModule, Injectable } from '@angular/core';
7+
+import { NgModule, Injectable, InjectionToken } from '@angular/core';
8+
import { NgxGalleryComponent } from './ngx-gallery.component';
9+
import { NgxGalleryImageComponent } from './ngx-gallery-image/ngx-gallery-image.component';
10+
import { NgxGalleryArrowsComponent } from './ngx-gallery-arrows/ngx-gallery-arrows.component';
11+
@@ -7,7 +7,16 @@ import { NgxGalleryPreviewComponent } from './ngx-gallery-preview/ngx-gallery-pr
12+
import { NgxGalleryActionComponent } from './ngx-gallery-action/ngx-gallery-action.component';
13+
import { NgxGalleryBulletsComponent } from './ngx-gallery-bullets/ngx-gallery-bullets.component';
14+
import { CommonModule } from '@angular/common';
15+
-import { HAMMER_GESTURE_CONFIG, HammerGestureConfig } from '@angular/platform-browser';
16+
+// Hammer support was removed from @angular/platform-browser.
17+
+// These inert stubs keep the gallery's gesture-config wiring compiling; the
18+
+// config was already non-functional without HammerModule.
19+
+const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
20+
+class HammerGestureConfig {
21+
+ constructor() {
22+
+ this.events = [];
23+
+ this.overrides = {};
24+
+ }
25+
+}
26+
import * as i0 from "@angular/core";
27+
export class CustomHammerConfig extends HammerGestureConfig {
28+
constructor() {
29+
diff --git a/node_modules/@kolkov/ngx-gallery/fesm2015/kolkov-ngx-gallery.mjs b/node_modules/@kolkov/ngx-gallery/fesm2015/kolkov-ngx-gallery.mjs
30+
index a92208c..38fea6a 100644
31+
--- a/node_modules/@kolkov/ngx-gallery/fesm2015/kolkov-ngx-gallery.mjs
32+
+++ b/node_modules/@kolkov/ngx-gallery/fesm2015/kolkov-ngx-gallery.mjs
33+
@@ -1,7 +1,16 @@
34+
import * as i0 from '@angular/core';
35+
-import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, ViewEncapsulation, HostBinding, NgModule } from '@angular/core';
36+
+import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, ViewEncapsulation, HostBinding, NgModule, InjectionToken } from '@angular/core';
37+
import * as i1 from '@angular/platform-browser';
38+
-import { HammerGestureConfig, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
39+
+// Hammer support was removed from @angular/platform-browser.
40+
+// These inert stubs keep the gallery's gesture-config wiring compiling; the
41+
+// config was already non-functional without HammerModule.
42+
+const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
43+
+class HammerGestureConfig {
44+
+ constructor() {
45+
+ this.events = [];
46+
+ this.overrides = {};
47+
+ }
48+
+}
49+
import * as i6 from '@angular/common';
50+
import { CommonModule } from '@angular/common';
51+
import { trigger, state, style, transition, animate } from '@angular/animations';
52+
diff --git a/node_modules/@kolkov/ngx-gallery/fesm2020/kolkov-ngx-gallery.mjs b/node_modules/@kolkov/ngx-gallery/fesm2020/kolkov-ngx-gallery.mjs
53+
index a92208c..38fea6a 100644
54+
--- a/node_modules/@kolkov/ngx-gallery/fesm2020/kolkov-ngx-gallery.mjs
55+
+++ b/node_modules/@kolkov/ngx-gallery/fesm2020/kolkov-ngx-gallery.mjs
56+
@@ -1,7 +1,16 @@
57+
import * as i0 from '@angular/core';
58+
-import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, ViewEncapsulation, HostBinding, NgModule } from '@angular/core';
59+
+import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, ViewEncapsulation, HostBinding, NgModule, InjectionToken } from '@angular/core';
60+
import * as i1 from '@angular/platform-browser';
61+
-import { HammerGestureConfig, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
62+
+// Hammer support was removed from @angular/platform-browser.
63+
+// These inert stubs keep the gallery's gesture-config wiring compiling; the
64+
+// config was already non-functional without HammerModule.
65+
+const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
66+
+class HammerGestureConfig {
67+
+ constructor() {
68+
+ this.events = [];
69+
+ this.overrides = {};
70+
+ }
71+
+}
72+
import * as i6 from '@angular/common';
73+
import { CommonModule } from '@angular/common';
74+
import { trigger, state, style, transition, animate } from '@angular/animations';

0 commit comments

Comments
 (0)