@memberjunction/ng-shared-generic 6.3.0-edge.0 → 6.3.0-edge.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,6 +135,7 @@
135
135
 
136
136
  /* Background Colors */
137
137
  --mj-bg-page: var(--mj-color-neutral-50);
138
+ --mj-bg-canvas: var(--mj-color-neutral-100);
138
139
  --mj-bg-surface: var(--mj-color-neutral-0);
139
140
  --mj-bg-surface-elevated: var(--mj-color-neutral-0);
140
141
  --mj-bg-surface-card: var(--mj-color-neutral-50);
@@ -161,6 +162,73 @@
161
162
  --mj-border-focus: var(--mj-color-brand-500);
162
163
  --mj-border-error: var(--mj-color-error-500);
163
164
 
165
+ /* Surface & Elevation Ramp B (Tier 2 role tokens — NAMING.md)
166
+ Four levels: sunken (wells, code blocks; no state tokens), base (default cards,
167
+ panels, form sections, table bodies), elevated (raised above base, still part of
168
+ the page), overlay (floats over the page: dialogs, sheets, popovers, menus, toasts).
169
+ Hover and selected are states at the end of the token name, not elevation changes.
170
+ Border tokens split color (--mj-surface-<level>-border) from width and style
171
+ (--mj-surface-border-width, --mj-surface-border-style) so brands can re-color a
172
+ surface without restating stroke width/style, or set borderless/2px surfaces
173
+ without resetting border-style to initial (none). */
174
+ --mj-surface-border-width: 1px;
175
+ --mj-surface-border-style: solid;
176
+
177
+ --mj-surface-sunken-bg: var(--mj-bg-surface-sunken);
178
+ --mj-surface-sunken-border: var(--mj-border-subtle);
179
+ --mj-surface-sunken-shadow: var(--mj-shadow-inner);
180
+
181
+ --mj-surface-base-bg: var(--mj-bg-surface);
182
+ --mj-surface-base-border: var(--mj-border-default);
183
+ --mj-surface-base-shadow: var(--mj-shadow-none);
184
+ --mj-surface-base-bg-hover: var(--mj-bg-surface-hover);
185
+ --mj-surface-base-bg-selected: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));
186
+ --mj-surface-base-border-selected: var(--mj-brand-primary);
187
+
188
+ --mj-surface-elevated-bg: var(--mj-bg-surface-elevated);
189
+ --mj-surface-elevated-border: var(--mj-border-default);
190
+ --mj-surface-elevated-shadow: var(--mj-shadow-md);
191
+ --mj-surface-elevated-bg-hover: var(--mj-bg-surface-hover);
192
+ --mj-surface-elevated-bg-selected: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface-elevated));
193
+ --mj-surface-elevated-border-selected: var(--mj-brand-primary);
194
+
195
+ --mj-surface-overlay-bg: var(--mj-bg-surface-elevated);
196
+ --mj-surface-overlay-border: var(--mj-border-strong);
197
+ --mj-surface-overlay-shadow: var(--mj-shadow-xl);
198
+ --mj-surface-overlay-bg-hover: var(--mj-bg-surface-hover);
199
+ --mj-surface-overlay-bg-selected: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface-elevated));
200
+ --mj-surface-overlay-border-selected: var(--mj-brand-primary);
201
+
202
+ /* Surface-scoped text re-point tokens (Tier 2 — NAMING.md).
203
+ Point at primitives (never var(--mj-text-*)) so placing a .mj-surface-* class on
204
+ the same element as :root or the dark theme block never creates a custom-property
205
+ cycle. Light sunken (neutral-100) steps one primitive darker so muted (6.92:1)
206
+ and link (5.34:1) clear WCAG AA, mirroring how dark elevated steps brighter.
207
+ Selected surfaces promote muted text to neutral-600 so subtitles stay >= AA on
208
+ the selected tint (6.80:1 on base, 6.61:1 on elevated in light).
209
+ Keep ThemeEngine derive.ts resolveSemantics in lockstep. */
210
+ --mj-surface-text-muted-selected: var(--mj-color-neutral-600);
211
+ --mj-surface-base-text-secondary: var(--mj-color-neutral-600);
212
+ --mj-surface-base-text-muted: var(--mj-color-neutral-500);
213
+ --mj-surface-base-text-link: var(--mj-color-brand-500);
214
+ --mj-surface-base-text-link-hover: var(--mj-color-brand-600);
215
+ --mj-surface-sunken-text-secondary: var(--mj-color-neutral-700);
216
+ --mj-surface-sunken-text-muted: var(--mj-color-neutral-600);
217
+ --mj-surface-sunken-text-link: var(--mj-color-brand-600);
218
+ --mj-surface-sunken-text-link-hover: var(--mj-color-brand-700);
219
+ --mj-surface-elevated-text-secondary: var(--mj-color-neutral-600);
220
+ --mj-surface-elevated-text-muted: var(--mj-color-neutral-500);
221
+ --mj-surface-elevated-text-link: var(--mj-color-brand-500);
222
+ --mj-surface-elevated-text-link-hover: var(--mj-color-brand-600);
223
+ --mj-surface-overlay-text-secondary: var(--mj-surface-elevated-text-secondary);
224
+ --mj-surface-overlay-text-muted: var(--mj-surface-elevated-text-muted);
225
+ --mj-surface-overlay-text-link: var(--mj-surface-elevated-text-link);
226
+ --mj-surface-overlay-text-link-hover: var(--mj-surface-elevated-text-link-hover);
227
+
228
+ /* Ambient Layer — off by default in the stock theme. */
229
+ --mj-ambient: none;
230
+ --mj-ambient-strength: 0;
231
+
164
232
  /* Brand Colors (semantic) */
165
233
  --mj-brand-primary: var(--mj-color-brand-500);
166
234
  --mj-brand-primary-hover: var(--mj-color-brand-600);
@@ -351,8 +419,10 @@
351
419
  TYPOGRAPHY
352
420
  ======================================== */
353
421
 
354
- /* Font Family */
355
- --mj-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
422
+ /* Font Family
423
+ --mj-font-family-display is intentionally unset at :root so container-scoped
424
+ --mj-font-family overrides cascade into headings via _typography.scss's fallback chain. */
425
+ --mj-font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
356
426
  --mj-font-family-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
357
427
 
358
428
  /* Font Sizes */
@@ -416,6 +486,12 @@
416
486
  --mj-space-20: 5rem; /* 80px */
417
487
  --mj-space-24: 6rem; /* 96px */
418
488
 
489
+ /* Control Height Scale (NAMING.md)
490
+ 32 / 40 / 52px on desktop; sm and md become 44px on coarse pointers (WCAG 2.5.5). */
491
+ --mj-control-height-sm: 32px;
492
+ --mj-control-height-md: 40px;
493
+ --mj-control-height-lg: 52px;
494
+
419
495
  /* ========================================
420
496
  EFFECTS
421
497
  ======================================== */
@@ -429,6 +505,12 @@
429
505
  --mj-radius-2xl: 24px;
430
506
  --mj-radius-full: 9999px;
431
507
 
508
+ /* Radius Roles (Tier 2 — NAMING.md) */
509
+ --mj-radius-control: var(--mj-radius-md);
510
+ --mj-radius-surface: var(--mj-radius-lg);
511
+ --mj-radius-overlay: var(--mj-radius-lg);
512
+ --mj-radius-pill: var(--mj-radius-full);
513
+
432
514
  /* Shadows */
433
515
  --mj-shadow-none: none;
434
516
  --mj-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
@@ -533,6 +615,7 @@
533
615
  /* Background Colors */
534
616
 
535
617
  --mj-bg-page: var(--mj-color-neutral-900);
618
+ --mj-bg-canvas: var(--mj-color-neutral-900);
536
619
  --mj-bg-surface: var(--mj-color-neutral-800);
537
620
  /* Card sits between surface (800) and elevated (700). Derived from the neutral
538
621
  primitives (not a literal) so org brand overlays re-tint it in dark mode; the
@@ -562,6 +645,64 @@
562
645
  --mj-border-focus: var(--mj-color-brand-400);
563
646
  --mj-border-error: var(--mj-color-error-400);
564
647
 
648
+ /* Surface & Elevation Ramp B (dark mode)
649
+ Re-declared in [data-theme="dark"] so both document-level and scoped dark
650
+ containers (e.g. Theme Studio preview canvas) resolve the dark surface fills,
651
+ borders, shadows, and per-level text tiers. Shadows point at Tier-1 scale tokens
652
+ (never literals) so theme-level shadow overrides (e.g. Flatter) apply in dark too. */
653
+ --mj-surface-sunken-bg: var(--mj-bg-surface-sunken);
654
+ --mj-surface-sunken-border: var(--mj-border-subtle);
655
+ --mj-surface-sunken-shadow: var(--mj-shadow-none);
656
+
657
+ --mj-surface-base-bg: var(--mj-bg-surface);
658
+ --mj-surface-base-border: var(--mj-border-default);
659
+ --mj-surface-base-shadow: var(--mj-shadow-none);
660
+ --mj-surface-base-bg-hover: var(--mj-bg-surface-hover);
661
+ --mj-surface-base-bg-selected: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));
662
+ --mj-surface-base-border-selected: var(--mj-brand-primary);
663
+
664
+ --mj-surface-elevated-bg: var(--mj-bg-surface-elevated);
665
+ --mj-surface-elevated-border: var(--mj-border-default);
666
+ --mj-surface-elevated-shadow: var(--mj-shadow-md);
667
+ --mj-surface-elevated-bg-hover: var(--mj-bg-surface-hover);
668
+ --mj-surface-elevated-bg-selected: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface-elevated));
669
+ --mj-surface-elevated-border-selected: var(--mj-brand-primary);
670
+
671
+ --mj-surface-overlay-bg: var(--mj-bg-surface-elevated);
672
+ --mj-surface-overlay-border: var(--mj-border-strong);
673
+ --mj-surface-overlay-shadow: var(--mj-shadow-xl);
674
+ --mj-surface-overlay-bg-hover: var(--mj-bg-surface-hover);
675
+ --mj-surface-overlay-bg-selected: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface-elevated));
676
+ --mj-surface-overlay-border-selected: var(--mj-brand-primary);
677
+
678
+ /* Dark text tiers on elevated and overlay surfaces step one primitive brighter
679
+ so they clear WCAG AA against --mj-bg-surface-elevated (neutral-700):
680
+ secondary: neutral-300 -> neutral-200 (6.97:1 -> 8.40:1)
681
+ muted: neutral-400 -> neutral-300 (4.04:1 -> 6.97:1)
682
+ link: brand-300 -> brand-200 (3.99:1 -> 5.33:1)
683
+ link-hover: brand-200 -> brand-100 (5.33:1 -> 7.04:1)
684
+ Base and sunken point directly at primitives (never var(--mj-text-*)) so an
685
+ element carrying both [data-theme="dark"] and .mj-surface-base / .mj-surface-sunken
686
+ never hits a CSS custom-property cycle.
687
+ Keep ThemeEngine derive.ts resolveSemantics in lockstep. */
688
+ --mj-surface-text-muted-selected: var(--mj-color-neutral-300);
689
+ --mj-surface-base-text-secondary: var(--mj-color-neutral-300);
690
+ --mj-surface-base-text-muted: var(--mj-color-neutral-400);
691
+ --mj-surface-base-text-link: var(--mj-color-brand-300);
692
+ --mj-surface-base-text-link-hover: var(--mj-color-brand-200);
693
+ --mj-surface-sunken-text-secondary: var(--mj-surface-base-text-secondary);
694
+ --mj-surface-sunken-text-muted: var(--mj-surface-base-text-muted);
695
+ --mj-surface-sunken-text-link: var(--mj-surface-base-text-link);
696
+ --mj-surface-sunken-text-link-hover: var(--mj-surface-base-text-link-hover);
697
+ --mj-surface-elevated-text-secondary: var(--mj-color-neutral-200);
698
+ --mj-surface-elevated-text-muted: var(--mj-color-neutral-300);
699
+ --mj-surface-elevated-text-link: var(--mj-color-brand-200);
700
+ --mj-surface-elevated-text-link-hover: var(--mj-color-brand-100);
701
+ --mj-surface-overlay-text-secondary: var(--mj-surface-elevated-text-secondary);
702
+ --mj-surface-overlay-text-muted: var(--mj-surface-elevated-text-muted);
703
+ --mj-surface-overlay-text-link: var(--mj-surface-elevated-text-link);
704
+ --mj-surface-overlay-text-link-hover: var(--mj-surface-elevated-text-link-hover);
705
+
565
706
  /* Brand Colors (adjusted for dark) */
566
707
  --mj-brand-primary: var(--mj-color-brand-400);
567
708
  --mj-brand-primary-hover: var(--mj-color-brand-300);
@@ -673,3 +814,103 @@
673
814
  --mj-logo-mark: url('/assets/mj-mark-dark.svg');
674
815
  --mj-logo-color: #4dabd5;
675
816
  }
817
+
818
+ /* ========================================
819
+ TOUCH TARGET FLOOR (WCAG 2.5.5)
820
+ ======================================== */
821
+
822
+ @media (pointer: coarse) {
823
+ :root {
824
+ --mj-control-height-sm: 44px;
825
+ --mj-control-height-md: 44px;
826
+ }
827
+ }
828
+
829
+ /* ========================================
830
+ SURFACE LEVEL CLASSES (Ramp B — NAMING.md)
831
+ ========================================
832
+ Each surface class sets background, border (composing width, style, and color
833
+ tokens), and box-shadow from its level's role tokens and re-points
834
+ --mj-text-{secondary,muted,link,link-hover} so nested surfaces always reset to
835
+ their own contrast tiers. Hover (.is-hover) and selected (.is-selected) states
836
+ exist on base, elevated, and overlay (sunken is a well and has no interactive
837
+ state tokens). */
838
+
839
+ .mj-surface-sunken {
840
+ background: var(--mj-surface-sunken-bg);
841
+ border: var(--mj-surface-sunken-border-width, var(--mj-surface-border-width))
842
+ var(--mj-surface-sunken-border-style, var(--mj-surface-border-style))
843
+ var(--mj-surface-sunken-border);
844
+ box-shadow: var(--mj-surface-sunken-shadow);
845
+ --mj-text-secondary: var(--mj-surface-sunken-text-secondary);
846
+ --mj-text-muted: var(--mj-surface-sunken-text-muted);
847
+ --mj-text-link: var(--mj-surface-sunken-text-link);
848
+ --mj-text-link-hover: var(--mj-surface-sunken-text-link-hover);
849
+ }
850
+
851
+ .mj-surface-base {
852
+ background: var(--mj-surface-base-bg);
853
+ border: var(--mj-surface-base-border-width, var(--mj-surface-border-width))
854
+ var(--mj-surface-base-border-style, var(--mj-surface-border-style))
855
+ var(--mj-surface-base-border);
856
+ box-shadow: var(--mj-surface-base-shadow);
857
+ --mj-text-secondary: var(--mj-surface-base-text-secondary);
858
+ --mj-text-muted: var(--mj-surface-base-text-muted);
859
+ --mj-text-link: var(--mj-surface-base-text-link);
860
+ --mj-text-link-hover: var(--mj-surface-base-text-link-hover);
861
+ }
862
+
863
+ .mj-surface-elevated {
864
+ background: var(--mj-surface-elevated-bg);
865
+ border: var(--mj-surface-elevated-border-width, var(--mj-surface-border-width))
866
+ var(--mj-surface-elevated-border-style, var(--mj-surface-border-style))
867
+ var(--mj-surface-elevated-border);
868
+ box-shadow: var(--mj-surface-elevated-shadow);
869
+ --mj-text-secondary: var(--mj-surface-elevated-text-secondary);
870
+ --mj-text-muted: var(--mj-surface-elevated-text-muted);
871
+ --mj-text-link: var(--mj-surface-elevated-text-link);
872
+ --mj-text-link-hover: var(--mj-surface-elevated-text-link-hover);
873
+ }
874
+
875
+ .mj-surface-overlay {
876
+ background: var(--mj-surface-overlay-bg);
877
+ border: var(--mj-surface-overlay-border-width, var(--mj-surface-border-width))
878
+ var(--mj-surface-overlay-border-style, var(--mj-surface-border-style))
879
+ var(--mj-surface-overlay-border);
880
+ box-shadow: var(--mj-surface-overlay-shadow);
881
+ --mj-text-secondary: var(--mj-surface-overlay-text-secondary);
882
+ --mj-text-muted: var(--mj-surface-overlay-text-muted);
883
+ --mj-text-link: var(--mj-surface-overlay-text-link);
884
+ --mj-text-link-hover: var(--mj-surface-overlay-text-link-hover);
885
+ }
886
+
887
+ .mj-surface-base.is-hover {
888
+ background: var(--mj-surface-base-bg-hover);
889
+ }
890
+
891
+ .mj-surface-elevated.is-hover {
892
+ background: var(--mj-surface-elevated-bg-hover);
893
+ }
894
+
895
+ .mj-surface-overlay.is-hover {
896
+ background: var(--mj-surface-overlay-bg-hover);
897
+ }
898
+
899
+ .mj-surface-base.is-selected {
900
+ background: var(--mj-surface-base-bg-selected);
901
+ border-color: var(--mj-surface-base-border-selected);
902
+ --mj-text-muted: var(--mj-surface-text-muted-selected);
903
+ }
904
+
905
+ .mj-surface-elevated.is-selected {
906
+ background: var(--mj-surface-elevated-bg-selected);
907
+ border-color: var(--mj-surface-elevated-border-selected);
908
+ --mj-text-muted: var(--mj-surface-text-muted-selected);
909
+ }
910
+
911
+ .mj-surface-overlay.is-selected {
912
+ background: var(--mj-surface-overlay-bg-selected);
913
+ border-color: var(--mj-surface-overlay-border-selected);
914
+ --mj-text-muted: var(--mj-surface-text-muted-selected);
915
+ }
916
+
@@ -0,0 +1,53 @@
1
+ import { NgZone } from '@angular/core';
2
+ import { GraphQLDataProvider, GraphQLProviderConfigData } from '@memberjunction/graphql-dataprovider';
3
+ /**
4
+ * Structural typing for the global Zone.js root zone holder, avoiding any types or direct Zone.js imports.
5
+ */
6
+ export interface RootZoneHolder {
7
+ Zone?: {
8
+ root?: {
9
+ run<R>(cb: () => R): R;
10
+ };
11
+ };
12
+ }
13
+ /**
14
+ * Angular-aware extension of {@link GraphQLDataProvider}. Delegates background transport I/O
15
+ * (WebSocket handshakes, ping/pong watchdogs, subscription dispatch, and keep-alive intervals)
16
+ * to `NgZone.runOutsideAngular` so continuous socket traffic does not trigger continuous
17
+ * Angular change-detection cycles or keep the browser main thread hot.
18
+ */
19
+ export declare class AngularGraphQLDataProvider extends GraphQLDataProvider {
20
+ private _ngZone;
21
+ constructor(ngZone?: NgZone | null);
22
+ /**
23
+ * Attaches an {@link NgZone} instance to this provider. If null or undefined is passed,
24
+ * any existing zone reference is preserved.
25
+ */
26
+ SetNgZone(ngZone: NgZone | null | undefined): void;
27
+ /**
28
+ * Currently attached {@link NgZone}, or null when running in headless/fallback mode.
29
+ */
30
+ get NgZone(): NgZone | null;
31
+ /**
32
+ * Runs background transport operations outside Angular's zone when an {@link NgZone} is
33
+ * available. Falls back to Zone.js `root.run()` or direct execution when no zone has been injected.
34
+ */
35
+ protected ExecuteInBackgroundScope<T>(fn: () => T): T;
36
+ }
37
+ /**
38
+ * Resolves an {@link AngularGraphQLDataProvider} instance. Reuses and attaches `ngZone` to an
39
+ * existing `GraphQLDataProvider.Instance` when it is already an `AngularGraphQLDataProvider`, or
40
+ * constructs a new instance (which upgrades an unconfigured base provider in the global store).
41
+ */
42
+ export declare function ResolveAngularGraphQLProvider(ngZone?: NgZone | null): AngularGraphQLDataProvider;
43
+ /**
44
+ * Initializes and configures the GraphQL client with an {@link AngularGraphQLDataProvider},
45
+ * ensuring WebSocket transport operations run outside Angular's change-detection zone.
46
+ */
47
+ export declare function SetupAngularGraphQLClient(config: GraphQLProviderConfigData, ngZone?: NgZone | null): Promise<AngularGraphQLDataProvider>;
48
+ /**
49
+ * Connects to GraphQL and metadata with an {@link AngularGraphQLDataProvider}, ensuring WebSocket
50
+ * transport operations run outside Angular's change-detection zone.
51
+ */
52
+ export declare function ConnectAngularGraphQLClient(config: GraphQLProviderConfigData, ngZone?: NgZone | null): Promise<AngularGraphQLDataProvider>;
53
+ //# sourceMappingURL=angular-graphql-data-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-graphql-data-provider.d.ts","sourceRoot":"","sources":["../../src/lib/angular-graphql-data-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAEH,mBAAmB,EACnB,yBAAyB,EAE5B,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,CAAC,EAAE;QACH,IAAI,CAAC,EAAE;YACH,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;SAC1B,CAAC;KACL,CAAC;CACL;AAED;;;;;GAKG;AACH,qBACa,0BAA2B,SAAQ,mBAAmB;IAC/D,OAAO,CAAC,OAAO,CAAuB;gBAE1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAOlC;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAMzD;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,GAAG,IAAI,CAEjC;IAED;;;OAGG;cACgB,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;CAajE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,0BAA0B,CAShG;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC3C,MAAM,EAAE,yBAAyB,EACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAIrC;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC7C,MAAM,EAAE,yBAAyB,EACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAIrC"}
@@ -0,0 +1,91 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { RegisterClassEx } from '@memberjunction/global';
8
+ import { ConnectGraphQLClient, GraphQLDataProvider, SetupGraphQLClient, } from '@memberjunction/graphql-dataprovider';
9
+ /**
10
+ * Angular-aware extension of {@link GraphQLDataProvider}. Delegates background transport I/O
11
+ * (WebSocket handshakes, ping/pong watchdogs, subscription dispatch, and keep-alive intervals)
12
+ * to `NgZone.runOutsideAngular` so continuous socket traffic does not trigger continuous
13
+ * Angular change-detection cycles or keep the browser main thread hot.
14
+ */
15
+ let AngularGraphQLDataProvider = class AngularGraphQLDataProvider extends GraphQLDataProvider {
16
+ _ngZone = null;
17
+ constructor(ngZone) {
18
+ super();
19
+ if (ngZone) {
20
+ this.SetNgZone(ngZone);
21
+ }
22
+ }
23
+ /**
24
+ * Attaches an {@link NgZone} instance to this provider. If null or undefined is passed,
25
+ * any existing zone reference is preserved.
26
+ */
27
+ SetNgZone(ngZone) {
28
+ if (ngZone) {
29
+ this._ngZone = ngZone;
30
+ }
31
+ }
32
+ /**
33
+ * Currently attached {@link NgZone}, or null when running in headless/fallback mode.
34
+ */
35
+ get NgZone() {
36
+ return this._ngZone;
37
+ }
38
+ /**
39
+ * Runs background transport operations outside Angular's zone when an {@link NgZone} is
40
+ * available. Falls back to Zone.js `root.run()` or direct execution when no zone has been injected.
41
+ */
42
+ ExecuteInBackgroundScope(fn) {
43
+ if (this._ngZone) {
44
+ return this._ngZone.runOutsideAngular(fn);
45
+ }
46
+ const holder = globalThis;
47
+ const rootZone = holder.Zone?.root;
48
+ if (rootZone && typeof rootZone.run === 'function') {
49
+ return rootZone.run(fn);
50
+ }
51
+ return fn();
52
+ }
53
+ };
54
+ AngularGraphQLDataProvider = __decorate([
55
+ RegisterClassEx(GraphQLDataProvider, { skipNullKeyWarning: true })
56
+ ], AngularGraphQLDataProvider);
57
+ export { AngularGraphQLDataProvider };
58
+ /**
59
+ * Resolves an {@link AngularGraphQLDataProvider} instance. Reuses and attaches `ngZone` to an
60
+ * existing `GraphQLDataProvider.Instance` when it is already an `AngularGraphQLDataProvider`, or
61
+ * constructs a new instance (which upgrades an unconfigured base provider in the global store).
62
+ */
63
+ export function ResolveAngularGraphQLProvider(ngZone) {
64
+ const existing = GraphQLDataProvider.Instance;
65
+ if (existing instanceof AngularGraphQLDataProvider) {
66
+ if (ngZone) {
67
+ existing.SetNgZone(ngZone);
68
+ }
69
+ return existing;
70
+ }
71
+ return new AngularGraphQLDataProvider(ngZone);
72
+ }
73
+ /**
74
+ * Initializes and configures the GraphQL client with an {@link AngularGraphQLDataProvider},
75
+ * ensuring WebSocket transport operations run outside Angular's change-detection zone.
76
+ */
77
+ export async function SetupAngularGraphQLClient(config, ngZone) {
78
+ const provider = ResolveAngularGraphQLProvider(ngZone);
79
+ await SetupGraphQLClient(config, provider);
80
+ return provider;
81
+ }
82
+ /**
83
+ * Connects to GraphQL and metadata with an {@link AngularGraphQLDataProvider}, ensuring WebSocket
84
+ * transport operations run outside Angular's change-detection zone.
85
+ */
86
+ export async function ConnectAngularGraphQLClient(config, ngZone) {
87
+ const provider = ResolveAngularGraphQLProvider(ngZone);
88
+ await ConnectGraphQLClient(config, provider);
89
+ return provider;
90
+ }
91
+ //# sourceMappingURL=angular-graphql-data-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-graphql-data-provider.js","sourceRoot":"","sources":["../../src/lib/angular-graphql-data-provider.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EAEnB,kBAAkB,GACrB,MAAM,sCAAsC,CAAC;AAa9C;;;;;GAKG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,mBAAmB;IACvD,OAAO,GAAkB,IAAI,CAAC;IAEtC,YAAY,MAAsB;QAC9B,KAAK,EAAE,CAAC;QACR,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,MAAiC;QAC9C,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAC1B,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;OAGG;IACgB,wBAAwB,CAAI,EAAW;QACtD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,MAAM,GAAG,UAA4B,CAAC;QAC5C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;QACnC,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;YACjD,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,EAAE,EAAE,CAAC;IAChB,CAAC;CACJ,CAAA;AA5CY,0BAA0B;IADtC,eAAe,CAAC,mBAAmB,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;GACtD,0BAA0B,CA4CtC;;AAED;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAsB;IAChE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC;IAC9C,IAAI,QAAQ,YAAY,0BAA0B,EAAE,CAAC;QACjD,IAAI,MAAM,EAAE,CAAC;YACT,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC3C,MAAiC,EACjC,MAAsB;IAEtB,MAAM,QAAQ,GAAG,6BAA6B,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC7C,MAAiC,EACjC,MAAsB;IAEtB,MAAM,QAAQ,GAAG,6BAA6B,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { NgZone } from '@angular/core';\nimport { RegisterClassEx } from '@memberjunction/global';\nimport {\n ConnectGraphQLClient,\n GraphQLDataProvider,\n GraphQLProviderConfigData,\n SetupGraphQLClient,\n} from '@memberjunction/graphql-dataprovider';\n\n/**\n * Structural typing for the global Zone.js root zone holder, avoiding any types or direct Zone.js imports.\n */\nexport interface RootZoneHolder {\n Zone?: {\n root?: {\n run<R>(cb: () => R): R;\n };\n };\n}\n\n/**\n * Angular-aware extension of {@link GraphQLDataProvider}. Delegates background transport I/O\n * (WebSocket handshakes, ping/pong watchdogs, subscription dispatch, and keep-alive intervals)\n * to `NgZone.runOutsideAngular` so continuous socket traffic does not trigger continuous\n * Angular change-detection cycles or keep the browser main thread hot.\n */\n@RegisterClassEx(GraphQLDataProvider, { skipNullKeyWarning: true })\nexport class AngularGraphQLDataProvider extends GraphQLDataProvider {\n private _ngZone: NgZone | null = null;\n\n constructor(ngZone?: NgZone | null) {\n super();\n if (ngZone) {\n this.SetNgZone(ngZone);\n }\n }\n\n /**\n * Attaches an {@link NgZone} instance to this provider. If null or undefined is passed,\n * any existing zone reference is preserved.\n */\n public SetNgZone(ngZone: NgZone | null | undefined): void {\n if (ngZone) {\n this._ngZone = ngZone;\n }\n }\n\n /**\n * Currently attached {@link NgZone}, or null when running in headless/fallback mode.\n */\n public get NgZone(): NgZone | null {\n return this._ngZone;\n }\n\n /**\n * Runs background transport operations outside Angular's zone when an {@link NgZone} is\n * available. Falls back to Zone.js `root.run()` or direct execution when no zone has been injected.\n */\n protected override ExecuteInBackgroundScope<T>(fn: () => T): T {\n if (this._ngZone) {\n return this._ngZone.runOutsideAngular(fn);\n }\n\n const holder = globalThis as RootZoneHolder;\n const rootZone = holder.Zone?.root;\n if (rootZone && typeof rootZone.run === 'function') {\n return rootZone.run(fn);\n }\n\n return fn();\n }\n}\n\n/**\n * Resolves an {@link AngularGraphQLDataProvider} instance. Reuses and attaches `ngZone` to an\n * existing `GraphQLDataProvider.Instance` when it is already an `AngularGraphQLDataProvider`, or\n * constructs a new instance (which upgrades an unconfigured base provider in the global store).\n */\nexport function ResolveAngularGraphQLProvider(ngZone?: NgZone | null): AngularGraphQLDataProvider {\n const existing = GraphQLDataProvider.Instance;\n if (existing instanceof AngularGraphQLDataProvider) {\n if (ngZone) {\n existing.SetNgZone(ngZone);\n }\n return existing;\n }\n return new AngularGraphQLDataProvider(ngZone);\n}\n\n/**\n * Initializes and configures the GraphQL client with an {@link AngularGraphQLDataProvider},\n * ensuring WebSocket transport operations run outside Angular's change-detection zone.\n */\nexport async function SetupAngularGraphQLClient(\n config: GraphQLProviderConfigData,\n ngZone?: NgZone | null\n): Promise<AngularGraphQLDataProvider> {\n const provider = ResolveAngularGraphQLProvider(ngZone);\n await SetupGraphQLClient(config, provider);\n return provider;\n}\n\n/**\n * Connects to GraphQL and metadata with an {@link AngularGraphQLDataProvider}, ensuring WebSocket\n * transport operations run outside Angular's change-detection zone.\n */\nexport async function ConnectAngularGraphQLClient(\n config: GraphQLProviderConfigData,\n ngZone?: NgZone | null\n): Promise<AngularGraphQLDataProvider> {\n const provider = ResolveAngularGraphQLProvider(ngZone);\n await ConnectGraphQLClient(config, provider);\n return provider;\n}\n"]}
@@ -8,4 +8,5 @@ export * from './lib/ag-grid-theme-params';
8
8
  export * from './lib/loading/loading.component';
9
9
  export * from './lib/rich-text/rich-text-sanitize';
10
10
  export * from './lib/rich-text/safe-rich-html.pipe';
11
+ export * from './lib/angular-graphql-data-provider';
11
12
  //# sourceMappingURL=public-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,iBAAiB,CAAC;AAGhC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAG7C,cAAc,iBAAiB,CAAC;AAGhC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AAGpD,cAAc,qCAAqC,CAAC"}
@@ -17,4 +17,6 @@ export * from './lib/loading/loading.component';
17
17
  // Rich-text rendering (safe HTML/SVG sanitization)
18
18
  export * from './lib/rich-text/rich-text-sanitize';
19
19
  export * from './lib/rich-text/safe-rich-html.pipe';
20
+ // Angular GraphQL Provider
21
+ export * from './lib/angular-graphql-data-provider';
20
22
  //# sourceMappingURL=public-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAE7C,cAAc;AACd,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,4BAA4B,CAAC;AAE3C,aAAa;AACb,cAAc,iCAAiC,CAAC;AAEhD,mDAAmD;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface for @memberjunction/ng-shared-generic\n */\n\n// Module\nexport * from './lib/module';\n\n// Services\nexport * from './lib/recent-access.service';\nexport * from './lib/recent-resource-type';\nexport * from './lib/theme.service';\nexport * from './lib/brand-overlay-prepaint';\n\n// DOM helpers\nexport * from './lib/dom-utils';\n\n// Theming constants\nexport * from './lib/ag-grid-theme-params';\n\n// Components\nexport * from './lib/loading/loading.component';\n\n// Rich-text rendering (safe HTML/SVG sanitization)\nexport * from './lib/rich-text/rich-text-sanitize';\nexport * from './lib/rich-text/safe-rich-html.pipe';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAE7C,cAAc;AACd,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,4BAA4B,CAAC;AAE3C,aAAa;AACb,cAAc,iCAAiC,CAAC;AAEhD,mDAAmD;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AAEpD,2BAA2B;AAC3B,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface for @memberjunction/ng-shared-generic\n */\n\n// Module\nexport * from './lib/module';\n\n// Services\nexport * from './lib/recent-access.service';\nexport * from './lib/recent-resource-type';\nexport * from './lib/theme.service';\nexport * from './lib/brand-overlay-prepaint';\n\n// DOM helpers\nexport * from './lib/dom-utils';\n\n// Theming constants\nexport * from './lib/ag-grid-theme-params';\n\n// Components\nexport * from './lib/loading/loading.component';\n\n// Rich-text rendering (safe HTML/SVG sanitization)\nexport * from './lib/rich-text/rich-text-sanitize';\nexport * from './lib/rich-text/safe-rich-html.pipe';\n\n// Angular GraphQL Provider\nexport * from './lib/angular-graphql-data-provider';\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-shared-generic",
3
- "version": "6.3.0-edge.0",
3
+ "version": "6.3.0-edge.2",
4
4
  "description": "MemberJunction: Generic Angular Shared Package - utility services and reusable elements used in any Angular application.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -16,7 +16,7 @@
16
16
  "devDependencies": {
17
17
  "@angular/compiler": "21.2.22",
18
18
  "@angular/compiler-cli": "21.2.22",
19
- "@memberjunction/ng-test-utils": "6.3.0-edge.0",
19
+ "@memberjunction/ng-test-utils": "6.3.0-edge.2",
20
20
  "vitest": "^4.0.18"
21
21
  },
22
22
  "peerDependencies": {
@@ -26,11 +26,12 @@
26
26
  "rxjs": "^7.8.2"
27
27
  },
28
28
  "dependencies": {
29
- "@memberjunction/core": "6.3.0-edge.0",
30
- "@memberjunction/ng-base-types": "6.3.0-edge.0",
31
- "@memberjunction/core-entities": "6.3.0-edge.0",
32
- "@memberjunction/global": "6.3.0-edge.0",
33
- "@memberjunction/theme-engine": "6.3.0-edge.0",
29
+ "@memberjunction/core": "6.3.0-edge.2",
30
+ "@memberjunction/ng-base-types": "6.3.0-edge.2",
31
+ "@memberjunction/core-entities": "6.3.0-edge.2",
32
+ "@memberjunction/global": "6.3.0-edge.2",
33
+ "@memberjunction/graphql-dataprovider": "6.3.0-edge.2",
34
+ "@memberjunction/theme-engine": "6.3.0-edge.2",
34
35
  "dompurify": "^3.3.0",
35
36
  "tslib": "^2.8.1"
36
37
  },