@theseam/ui-common 2.0.1-beta.110 → 2.0.1-beta.111
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.
- package/fesm2022/theseam-ui-common-google-maps.mjs +1632 -161
- package/fesm2022/theseam-ui-common-google-maps.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-story-helpers.mjs +55 -2
- package/fesm2022/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/google-maps/index.d.ts +426 -13
- package/package.json +1 -1
- package/story-helpers/index.d.ts +4 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ThemeNames, OutlineThemeNames } from '@theseam/ui-common/models';
|
|
2
2
|
import { useStoryContext } from 'storybook/preview-api';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, InjectionToken, Injectable, APP_INITIALIZER, NgModule, signal, computed, Injector, Input, ChangeDetectionStrategy, ElementRef, APP_BOOTSTRAP_LISTENER } from '@angular/core';
|
|
4
|
+
import { Component, InjectionToken, Injectable, APP_INITIALIZER, NgModule, signal, computed, Injector, Input, ChangeDetectionStrategy, ElementRef, APP_BOOTSTRAP_LISTENER, ɵgetLContext as _getLContext } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/router';
|
|
6
6
|
import { Router, NavigationEnd, RouterModule } from '@angular/router';
|
|
7
7
|
import { filter, take } from 'rxjs/operators';
|
|
@@ -594,9 +594,62 @@ const getInjectorFromArgs = (args, argName = INJECTOR_TO_ARGS_PROPERTY_NAME) =>
|
|
|
594
594
|
return injector;
|
|
595
595
|
};
|
|
596
596
|
|
|
597
|
+
/**
|
|
598
|
+
* Index of the context slot in Angular's internal `LView` array.
|
|
599
|
+
*
|
|
600
|
+
* Unlike `ng.getComponent`, `ɵgetLContext` is a real (if private) export
|
|
601
|
+
* rather than a devMode-only global, so this helper works in a production
|
|
602
|
+
* build — verified by running the story suite against a built
|
|
603
|
+
* `storybook-static`. What it IS pinned to is Angular's internal `LView`
|
|
604
|
+
* layout: if this slot index ever moves, `getComponentInstance()` returns the
|
|
605
|
+
* wrong object or null rather than failing loudly. Re-verify on a major
|
|
606
|
+
* Angular upgrade, against a production build rather than the dev server.
|
|
607
|
+
*/
|
|
608
|
+
const CONTEXT = 8;
|
|
609
|
+
function getComponentInstance(element, componentType) {
|
|
610
|
+
if (!element)
|
|
611
|
+
return null;
|
|
612
|
+
const ctx = _getLContext(element);
|
|
613
|
+
if (!ctx)
|
|
614
|
+
return null;
|
|
615
|
+
if (ctx.component != null) {
|
|
616
|
+
return match(ctx.component, componentType);
|
|
617
|
+
}
|
|
618
|
+
const lView = ctx.lView;
|
|
619
|
+
if (!lView)
|
|
620
|
+
return null;
|
|
621
|
+
// Host component of this node (same as ng.getComponent)
|
|
622
|
+
const atNode = getComponentAtNode(lView, ctx.nodeIndex);
|
|
623
|
+
if (atNode != null) {
|
|
624
|
+
const matched = match(atNode, componentType);
|
|
625
|
+
if (matched)
|
|
626
|
+
return matched;
|
|
627
|
+
}
|
|
628
|
+
// Fallback: owning component view context (same idea as ng.getOwningComponent)
|
|
629
|
+
const owning = lView[CONTEXT];
|
|
630
|
+
return match(owning, componentType);
|
|
631
|
+
}
|
|
632
|
+
function match(value, type) {
|
|
633
|
+
if (value == null)
|
|
634
|
+
return null;
|
|
635
|
+
if (!type)
|
|
636
|
+
return value;
|
|
637
|
+
return value instanceof type ? value : null;
|
|
638
|
+
}
|
|
639
|
+
function getComponentAtNode(lView, nodeIndex) {
|
|
640
|
+
const slot = lView[nodeIndex];
|
|
641
|
+
if (!slot)
|
|
642
|
+
return null;
|
|
643
|
+
// Component host slot is either an LView or an LContainer whose [0]/HOST is the LView
|
|
644
|
+
const childView = Array.isArray(slot) && Array.isArray(slot[1]) ? slot : slot[0];
|
|
645
|
+
if (!Array.isArray(childView))
|
|
646
|
+
return null;
|
|
647
|
+
return childView[CONTEXT] ?? null;
|
|
648
|
+
}
|
|
649
|
+
|
|
597
650
|
/**
|
|
598
651
|
* Generated bundle index. Do not edit.
|
|
599
652
|
*/
|
|
600
653
|
|
|
601
|
-
export { INJECTOR_TO_ARGS_PROPERTY_NAME, STORY_INITIAL_ROUTE_URL, StoryEmptyComponent, StoryEmptyWithRouteComponent, StoryHelperComponentsModule, StoryInitialRouteModule, StoryInitialRouteService, StoryModalContainerComponent, StoryPreferencesAccessorService, addInjectorGetterToArgs, argsToTpl, buttonTypeArgType, getInjectorFromArgs, onStoryBootstrappedTrigger, routeButton, routesArgType, sizeArgType, storyInitialRouteFactory, storyModalDecorator, themeArgType, themeWithOutlineArgType };
|
|
654
|
+
export { INJECTOR_TO_ARGS_PROPERTY_NAME, STORY_INITIAL_ROUTE_URL, StoryEmptyComponent, StoryEmptyWithRouteComponent, StoryHelperComponentsModule, StoryInitialRouteModule, StoryInitialRouteService, StoryModalContainerComponent, StoryPreferencesAccessorService, addInjectorGetterToArgs, argsToTpl, buttonTypeArgType, getComponentInstance, getInjectorFromArgs, onStoryBootstrappedTrigger, routeButton, routesArgType, sizeArgType, storyInitialRouteFactory, storyModalDecorator, themeArgType, themeWithOutlineArgType };
|
|
602
655
|
//# sourceMappingURL=theseam-ui-common-story-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-story-helpers.mjs","sources":["../../../projects/ui-common/story-helpers/arg-type-helpers.ts","../../../projects/ui-common/story-helpers/args-to-tpl.ts","../../../projects/ui-common/story-helpers/story-empty.component.ts","../../../projects/ui-common/story-helpers/initial-route-factory.ts","../../../projects/ui-common/story-helpers/initial-route.service.ts","../../../projects/ui-common/story-helpers/story-initial-route.ts","../../../projects/ui-common/story-helpers/route-button.ts","../../../projects/ui-common/story-helpers/routes-arg-type.ts","../../../projects/ui-common/story-helpers/story-empty-with-route.component.ts","../../../projects/ui-common/story-helpers/story-modal-container.component.ts","../../../projects/ui-common/story-helpers/story-helper-components.module.ts","../../../projects/ui-common/story-helpers/story-modal-decorator.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-exec.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-trigger.ts","../../../projects/ui-common/story-helpers/story-preferences-accessor.service.ts","../../../projects/ui-common/story-helpers/add-injector-to-args.ts","../../../projects/ui-common/story-helpers/theseam-ui-common-story-helpers.ts"],"sourcesContent":["// import { ArgType } from '@storybook/addons'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\ndeclare type ArgType = any\n\nexport const themeArgType: ArgType = {\n options: ThemeNames,\n control: {\n type: 'select',\n },\n description: `Theme style.`,\n}\n\nexport const themeWithOutlineArgType: ArgType = {\n options: [...ThemeNames, ...OutlineThemeNames],\n control: {\n type: 'select',\n },\n description: `Theme style.`,\n}\n\nexport const sizeArgType: ArgType = {\n options: [undefined, 'sm', 'lg'],\n control: {\n type: 'select',\n },\n description: `Size.`,\n}\n\nexport const buttonTypeArgType: ArgType = {\n options: ['button', 'submit'],\n control: {\n type: 'select',\n },\n description: `Button type.`,\n}\n","/* eslint-disable no-prototype-builtins */\nimport { action, HandlerFunction } from 'storybook/actions'\nimport { AngularRenderer, ArgTypes } from '@storybook/angular'\nimport { useStoryContext } from 'storybook/preview-api'\n\nexport interface ArgsTplParts {\n actions: { [prop: string]: HandlerFunction }\n tplfragment: string\n}\n\n/**\n * This is an attempt at simplifying the use of auto-generated args in stories\n * defined with `template`, since Angular doesn't have a way to simply use a\n * spread operator syntax.\n *\n * @experimental\n */\n// export function argsToTplParts(args: any, argTypes: ArgTypes): ArgsTplParts {\n// // console.log({ args, argTypes })\n// const parts: ArgsTplParts = {\n// actions: {},\n// tplfragment: ''\n// }\n\n// Object.keys(argTypes).forEach(k => {\n// // Inputs\n// if (\n// // Is in the inputs category\n// argTypes[k].table.category === 'inputs' &&\n// // Needs a control to be able to change from auto-generated args.\n// argTypes[k]?.hasOwnProperty('control') &&\n// // Assuming the arg might not be in props if there isn't an arg value.\n// args.hasOwnProperty(k)\n// ) {\n// parts.tplfragment += `[${k}]=\"${k}\" `\n// }\n\n// // Outputs\n// if (\n// // Is in the outputs category\n// argTypes[k]?.table?.category === 'outputs'\n// ) {\n// // Without access to props, I don't know if I can get an action into the\n// // template context like this.\n// parts.tplfragment += `(${k})=\"${k}($event)\" `\n// parts.actions[k] = action(k)\n// }\n// })\n\n// return parts\n// }\n\nfunction removeDuplicates(arr: string[]) {\n const seen: { [k: string]: boolean } = {}\n return arr.filter((item) => {\n if (!seen[item]) {\n seen[item] = true\n return true\n }\n return false\n })\n}\n\nexport interface ArgsTplOptions {\n /**\n * Properties to always bind to the template.\n */\n alwaysBind?: string[]\n /**\n * Properties to exclude from bidning to the template.\n */\n exclude?: string[]\n}\n\n/**\n * This is an attempt at simplifying the use of auto-generated args in stories\n * defined with `template`, since Angular doesn't have a way to simply use a\n * spread operator syntax.\n *\n * @experimental\n */\nexport function argsToTpl(options?: ArgsTplOptions) {\n const context = useStoryContext<AngularRenderer>()\n\n const exclude = [\n ...(context?.parameters?.argsToTplOptions?.exclude || []),\n ...(options?.exclude || []),\n ]\n\n const alwaysBind = context?.parameters?.argsToTplOptions?.alwaysBind || []\n\n const props = removeDuplicates([...alwaysBind, ...Object.keys(context.args)])\n\n const parts = props\n .filter((k) => exclude.indexOf(k) === -1)\n .map((k) => {\n // Outputs\n if (\n context.argTypes[k]?.hasOwnProperty('action') &&\n (context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1)\n ) {\n return `(${k})=\"${k}($event)\"`\n }\n\n // Inputs\n if (context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1) {\n return `[${k}]=\"${k}\"`\n }\n })\n\n return parts.length > 0 ? parts.join(' ') : ''\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: ``, standalone: true })\nexport class StoryEmptyComponent {}\n","import { StoryInitialRouteService } from './initial-route.service'\n\nexport function storyInitialRouteFactory(\n _storyInitialRouteService: StoryInitialRouteService,\n) {\n return () => _storyInitialRouteService.setInitialRoute()\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core'\nimport { NavigationEnd, Router } from '@angular/router'\nimport { filter, take } from 'rxjs/operators'\n\nexport const STORY_INITIAL_ROUTE_URL = new InjectionToken<any>(\n 'STORY_INITIAL_ROUTE_URL',\n)\n\n@Injectable()\nexport class StoryInitialRouteService {\n constructor(private _injector: Injector) {}\n\n public setInitialRoute() {\n const _router = this._injector.get(Router)\n const url = this._injector.get(STORY_INITIAL_ROUTE_URL)\n if (_router.navigated) {\n _router.navigateByUrl(url)\n } else {\n _router.events\n .pipe(\n filter((e) => e instanceof NavigationEnd),\n take(1),\n )\n .subscribe(() => {\n _router.navigateByUrl(url)\n })\n }\n }\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { storyInitialRouteFactory } from './initial-route-factory'\nimport {\n StoryInitialRouteService,\n STORY_INITIAL_ROUTE_URL,\n} from './initial-route.service'\n\n@NgModule()\nexport class StoryInitialRouteModule {\n static forRoot(url: string): ModuleWithProviders<StoryInitialRouteModule> {\n return {\n ngModule: StoryInitialRouteModule,\n providers: [\n StoryInitialRouteService,\n {\n provide: APP_INITIALIZER,\n useFactory: storyInitialRouteFactory,\n deps: [StoryInitialRouteService],\n multi: true,\n },\n { provide: STORY_INITIAL_ROUTE_URL, useValue: url },\n ],\n }\n }\n}\n","// import { button } from '@storybook/addon-knobs'\n\n/**\n * Until I find a way to avoid '@storybook/addon-knobs' from interfering with\n * NgZone I can't import it in the knob when built by ng-packagr.\n */\nexport function routeButton(buttonKnob: any, url: string) {\n return buttonKnob(url, () => {\n location.hash = `#${url}`\n return false\n })\n}\n","// import { ArgType } from '@storybook/addons'\n\ndeclare const __STORYBOOK_ADDONS: any\n\nfunction goToHashUrl(url: string): void {\n location.hash = `#${url}`\n}\n\n// __STORYBOOK_ADDONS.getChannel().on('custom/go-to-hash', (data: { hash: string }) => {\n\n// goToHashUrl(data.hash)\n// })\n\n// __STORYBOOK_ADDONS.getChannel().on('storyArgsUpdated', (data: { hash: string }) => {\n// console.log('storyArgsUpdated')\n// })\n\nexport function routesArgType(routes: string[]) /*: ArgType*/ {\n return {\n options: routes,\n control: {\n type: 'select',\n // Runs in the 'manager', so I am emitting to a channel in the 'preview'.\n onChange: (e: any, a: any) => {\n __STORYBOOK_ADDONS.getChannel().emit('custom/go-to-hash', { hash: e })\n return e\n },\n },\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `<router-outlet></router-outlet>`, standalone: false })\nexport class StoryEmptyWithRouteComponent {}\n","import { CommonModule } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n Injector,\n Input,\n signal,\n TemplateRef,\n} from '@angular/core'\nimport { of } from 'rxjs'\n\nimport { ModalConfig, ModalRef, MODAL_DATA } from '@theseam/ui-common/modal'\nimport type { ComponentType } from '@theseam/ui-common/models'\nimport { TheSeamOverlayScrollbarDirective } from '@theseam/ui-common/scrollbar'\n\nclass FakeModalRef<T, R = any> implements Partial<ModalRef<T, R>> {\n afterOpened() {\n return of(undefined)\n }\n\n close(_dialogResult?: R): void {\n /* no-op in stories */\n }\n}\n\n/**\n * Renders its content (or an imperatively provided component/template) inside\n * a stand-in modal frame so stories can preview components that are normally\n * opened through the modal service.\n *\n * Three ways to provide content, checked in order:\n * 1. `[component]` input — renders via `ngComponentOutlet`. Kept for\n * compatibility with existing app stories.\n * 2. `[template]` input — renders a `TemplateRef` via `ngTemplateOutlet`.\n * 3. Projected content (`<ng-content>`) — the preferred form for new stories\n * because Storybook's default template auto-binds inputs/outputs.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'story-modal-container-component',\n imports: [CommonModule, TheSeamOverlayScrollbarDirective],\n template: `\n <div class=\"cdk-overlay-container\">\n <div\n class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"\n ></div>\n <div\n class=\"cdk-global-overlay-wrapper\"\n dir=\"ltr\"\n style=\"justify-content: flex-start; align-items: center; pointer-events: auto\"\n seamOverlayScrollbar\n >\n <div\n class=\"seam-modal-container modal-dialog modal-dialog-centered {{\n _modalSizeClass()\n }}\"\n tabindex=\"-1\"\n >\n <div class=\"modal-content\">\n @if (_component(); as c) {\n <ng-container\n *ngComponentOutlet=\"c; injector: _componentInjector()\"\n ></ng-container>\n } @else if (template) {\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n </div>\n </div>\n </div>\n </div>\n `,\n styles: [\n `\n .seam-modal-container[tabindex='-1']:focus {\n outline: 0 !important;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class StoryModalContainerComponent<T = unknown, D = any> {\n constructor(private readonly _injector: Injector) {}\n\n @Input()\n set component(c: ComponentType<T> | null | undefined) {\n this._component.set(c ?? null)\n }\n\n @Input()\n set data(d: D | null | undefined) {\n this._data.set(d ?? null)\n }\n\n @Input()\n set modalConfig(config: ModalConfig<D> | null | undefined) {\n this._modalConfig.set(config ?? null)\n }\n get modalConfig(): ModalConfig<D> | null {\n return this._modalConfig()\n }\n\n @Input() template?: TemplateRef<unknown> | null\n\n protected readonly _component = signal<ComponentType<T> | null>(null)\n private readonly _data = signal<D | null>(null)\n private readonly _modalConfig = signal<ModalConfig<D> | null>(null)\n\n protected readonly _componentInjector = computed(() =>\n this._createInjector(this._data()),\n )\n\n // No default size — stories opt into a Bootstrap modal size via\n // `modalConfig.modalSize`, matching how the real ModalService is used.\n protected readonly _modalSizeClass = computed(() => {\n const size = this._modalConfig()?.modalSize\n return size ? `modal-${size}` : ''\n })\n\n private _createInjector(data: D | null): Injector {\n return Injector.create({\n providers: [\n { provide: ModalRef, useClass: FakeModalRef, deps: [] },\n { provide: MODAL_DATA, useValue: data ?? undefined },\n ],\n parent: this._injector,\n })\n }\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { RouterModule } from '@angular/router'\n\nimport { TheSeamOverlayScrollbarDirective } from '@theseam/ui-common/scrollbar'\n\nimport { StoryEmptyWithRouteComponent } from './story-empty-with-route.component'\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\n@NgModule({\n declarations: [StoryEmptyWithRouteComponent],\n imports: [\n CommonModule,\n RouterModule,\n TheSeamOverlayScrollbarDirective,\n StoryModalContainerComponent,\n ],\n exports: [StoryEmptyWithRouteComponent, StoryModalContainerComponent],\n})\nexport class StoryHelperComponentsModule {}\n","import { componentWrapperDecorator, Decorator } from '@storybook/angular'\n\nimport { ModalConfig } from '@theseam/ui-common/modal'\n\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\nexport interface StoryModalDecoratorOptions {\n /**\n * Passed through to `StoryModalContainerComponent`'s `modalConfig` input.\n * Commonly used to opt into a Bootstrap modal size, e.g.\n * `{ modalSize: 'lg' }`.\n */\n modalConfig?: ModalConfig\n}\n\n/**\n * Wraps a story's rendered component in `<story-modal-container-component>`\n * so it previews inside a stand-in modal frame. Storybook's default template\n * binds the story's args to the wrapped component, so inputs/outputs (e.g.\n * for the Actions addon) work without extra wiring.\n *\n * Use as an entry in a story's `decorators` array:\n *\n * ```ts\n * const meta: Meta<MyModalComponent> = {\n * title: 'Modal/My',\n * component: MyModalComponent,\n * decorators: [storyModalDecorator({ modalConfig: { modalSize: 'lg' } })],\n * }\n * ```\n */\nexport function storyModalDecorator(\n options?: StoryModalDecoratorOptions,\n): Decorator {\n return (storyFn, storyContext) => {\n const result = componentWrapperDecorator(\n (story) => `\n <story-modal-container-component [modalConfig]=\"_storyModalConfig\">\n ${story}\n </story-modal-container-component>\n `,\n )(storyFn, storyContext)\n\n return {\n ...result,\n props: {\n ...(result.props ?? {}),\n // Prefixed to avoid colliding with a story's own args.\n _storyModalConfig: options?.modalConfig ?? null,\n },\n moduleMetadata: {\n ...(result.moduleMetadata ?? {}),\n imports: [\n ...(result.moduleMetadata?.imports ?? []),\n StoryModalContainerComponent,\n ],\n },\n }\n }\n}\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef } from '@angular/core'\n// import { STORY } from '@storybook/angular/dist/ts3.9/client/preview/angular/app.token'\n// import { StoryFnAngularReturnType } from '@storybook/angular/dist/ts3.9/client/preview/types'\nimport { Observable } from 'rxjs'\nimport { first } from 'rxjs/operators'\n\n/**\n * Can be used to access a stories component after the story has been bootstrapped.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'story-example',\n * template: `Touched: {{ exControl.touched }}`\n * })\n * class StoryExampleComponent {\n * exControl = new FormControl('')\n * }\n *\n * export const TouchExample2 = () => ({\n * moduleMetadata: {\n * declarations: [ StoryExampleComponent ],\n * providers: [ onStoryBootstrappedExec((c: StoryExampleComponent) => c.exControl.markAsTouched()) ]\n * },\n * props: { },\n * component: StoryExampleComponent\n * })\n * ```\n */\n// export function onStoryBootstrappedExec<T = any>(callback: (component: T) => void) {\n// function bootstrapped(componentRef: ComponentRef<any>) {\n// const data = componentRef.instance.target.injector.get(STORY, null) as Observable<StoryFnAngularReturnType> | null\n// if (!data) {\n// console.warn(`STORY provider not found.`)\n// return\n// }\n// data?.pipe(first()).subscribe(story => {\n// if (!story.component) {\n// console.warn(`'onStoryBootstrappedExec' only supported on stories that provide 'component' property.`)\n// return\n// }\n\n// let c = null\n// for (let i = 0; i < componentRef.instance.target.length; i++) {\n// const tmp = componentRef.instance.target._embeddedViews[i].nodes?.find((f: any) => f?.instance instanceof story.component)\n// const comp = tmp?.instance\n// if (comp) {\n// c = comp\n// break\n// }\n// }\n\n// if (!c) {\n// console.warn(`Story component instance not found.`)\n// return\n// }\n\n// if (c) {\n// callback(c)\n// }\n// })\n// }\n\n// return {\n// provide: APP_BOOTSTRAP_LISTENER,\n// useValue: bootstrapped,\n// multi: true\n// }\n// }\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef, ElementRef } from '@angular/core'\n\n// TODO: Consider supporting a target selection function, so that complex\n// selections that can't be expressed by a simple selector can be used.\n\n/**\n * Can be used to trigger an event on a target element when the story component has been bootstrapped.\n *\n * Example:\n * ```\n * export const TouchExample1 = () => ({\n * moduleMetadata: {\n * providers: [ onStoryBootstrappedTrigger('input', 'blur') ]\n * },\n * props: { control: new FormControl('') },\n * template: `\n * <input type=\"text\" [formControl]=\"control\">\n * Touched: {{ control.touched }}\n * `\n * })\n * ```\n */\nexport function onStoryBootstrappedTrigger(\n targetSelector: string,\n eventName: string,\n) {\n function bootstrapped(componentRef: ComponentRef<any>) {\n const elementRef = componentRef.injector.get(ElementRef, null)\n const target = elementRef?.nativeElement.querySelector(targetSelector)\n if (!target) {\n // eslint-disable-next-line no-console\n console.warn(\n `Unable to trigger event '${eventName}'. Target '${targetSelector}' not found.`,\n )\n }\n\n const e = document.createEvent('HTMLEvents')\n e.initEvent('blur', false, true)\n target.dispatchEvent(e)\n }\n\n return {\n provide: APP_BOOTSTRAP_LISTENER,\n useValue: bootstrapped,\n multi: true,\n }\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, of } from 'rxjs'\n\nimport { TheSeamPreferencesAccessor } from '@theseam/ui-common/services'\n\nconst ACCESSOR_PREFIX = 'story-pref'\n\n@Injectable()\nexport class StoryPreferencesAccessorService\n implements TheSeamPreferencesAccessor\n{\n /**\n * Gets a preference.\n */\n public get(name: string): Observable<string> {\n // console.log('get', name)\n return of(localStorage.getItem(`${ACCESSOR_PREFIX}-${name}`) || '{}')\n }\n\n /**\n * Update a preference.\n */\n public update(name: string, value: string): Observable<string> {\n // console.log('update', name)\n localStorage.setItem(`${ACCESSOR_PREFIX}-${name}`, value)\n return this.get(name)\n }\n\n /**\n * Delete a preference.\n */\n public delete(name: string): Observable<boolean> {\n localStorage.removeItem(`${ACCESSOR_PREFIX}-${name}`)\n return of(true)\n }\n}\n","import { APP_INITIALIZER, Injector } from '@angular/core'\n\nimport { AngularRenderer, applicationConfig } from '@storybook/angular'\nimport { DecoratorFunction } from 'storybook/internal/csf'\n\nexport const INJECTOR_TO_ARGS_PROPERTY_NAME = '__getInjector'\n\n// TODO: Decide a better way to persist the injector reference than poluting\n// args with a value that isn't really meant to be an arg.\n\n/**\n * Storybook decorator that stores the Angular Injector in\n * args, for retrieval in play function.\n */\nexport const addInjectorGetterToArgs =\n (\n argName: string = INJECTOR_TO_ARGS_PROPERTY_NAME,\n ): DecoratorFunction<AngularRenderer> =>\n (story: any, context: any) => {\n // TODO: Test this more thoroughly.\n let injector: Injector | null = null\n context.args[argName] = () => injector\n return applicationConfig({\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: (injectorService: Injector) => () => {\n injector = injectorService\n },\n deps: [Injector],\n multi: true,\n },\n ],\n })(story, context)\n }\n\nexport const getInjectorFromArgs = (\n args: any,\n argName: string = INJECTOR_TO_ARGS_PROPERTY_NAME,\n): Injector => {\n if (!args || typeof args[argName] !== 'function') {\n throw Error(`Injector getter function '${argName}' not found.`)\n }\n const injector = args[argName]()\n if (!injector) {\n throw Error(\n `Injector not found. Did you add 'addInjectorGetterToArgs' to your story dectorators?`,\n )\n }\n\n return injector\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAMO,MAAM,YAAY,GAAY;AACnC,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAA,YAAA,CAAc;;AAGtB,MAAM,uBAAuB,GAAY;AAC9C,IAAA,OAAO,EAAE,CAAC,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC;AAC9C,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAA,YAAA,CAAc;;AAGtB,MAAM,WAAW,GAAY;AAClC,IAAA,OAAO,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;AAChC,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAA,KAAA,CAAO;;AAGf,MAAM,iBAAiB,GAAY;AACxC,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C,OAAO,CAAC,EAAE;IAChC,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,MAAM,KAAK,CACT,CAAA,oFAAA,CAAsF,CACvF;IACH;AAEA,IAAA,OAAO,QAAQ;AACjB;;ACnDA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-story-helpers.mjs","sources":["../../../projects/ui-common/story-helpers/arg-type-helpers.ts","../../../projects/ui-common/story-helpers/args-to-tpl.ts","../../../projects/ui-common/story-helpers/story-empty.component.ts","../../../projects/ui-common/story-helpers/initial-route-factory.ts","../../../projects/ui-common/story-helpers/initial-route.service.ts","../../../projects/ui-common/story-helpers/story-initial-route.ts","../../../projects/ui-common/story-helpers/route-button.ts","../../../projects/ui-common/story-helpers/routes-arg-type.ts","../../../projects/ui-common/story-helpers/story-empty-with-route.component.ts","../../../projects/ui-common/story-helpers/story-modal-container.component.ts","../../../projects/ui-common/story-helpers/story-helper-components.module.ts","../../../projects/ui-common/story-helpers/story-modal-decorator.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-exec.ts","../../../projects/ui-common/story-helpers/on-story-bootstrapped-trigger.ts","../../../projects/ui-common/story-helpers/story-preferences-accessor.service.ts","../../../projects/ui-common/story-helpers/add-injector-to-args.ts","../../../projects/ui-common/story-helpers/get-component-instance.ts","../../../projects/ui-common/story-helpers/theseam-ui-common-story-helpers.ts"],"sourcesContent":["// import { ArgType } from '@storybook/addons'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\ndeclare type ArgType = any\n\nexport const themeArgType: ArgType = {\n options: ThemeNames,\n control: {\n type: 'select',\n },\n description: `Theme style.`,\n}\n\nexport const themeWithOutlineArgType: ArgType = {\n options: [...ThemeNames, ...OutlineThemeNames],\n control: {\n type: 'select',\n },\n description: `Theme style.`,\n}\n\nexport const sizeArgType: ArgType = {\n options: [undefined, 'sm', 'lg'],\n control: {\n type: 'select',\n },\n description: `Size.`,\n}\n\nexport const buttonTypeArgType: ArgType = {\n options: ['button', 'submit'],\n control: {\n type: 'select',\n },\n description: `Button type.`,\n}\n","/* eslint-disable no-prototype-builtins */\nimport { action, HandlerFunction } from 'storybook/actions'\nimport { AngularRenderer, ArgTypes } from '@storybook/angular'\nimport { useStoryContext } from 'storybook/preview-api'\n\nexport interface ArgsTplParts {\n actions: { [prop: string]: HandlerFunction }\n tplfragment: string\n}\n\n/**\n * This is an attempt at simplifying the use of auto-generated args in stories\n * defined with `template`, since Angular doesn't have a way to simply use a\n * spread operator syntax.\n *\n * @experimental\n */\n// export function argsToTplParts(args: any, argTypes: ArgTypes): ArgsTplParts {\n// // console.log({ args, argTypes })\n// const parts: ArgsTplParts = {\n// actions: {},\n// tplfragment: ''\n// }\n\n// Object.keys(argTypes).forEach(k => {\n// // Inputs\n// if (\n// // Is in the inputs category\n// argTypes[k].table.category === 'inputs' &&\n// // Needs a control to be able to change from auto-generated args.\n// argTypes[k]?.hasOwnProperty('control') &&\n// // Assuming the arg might not be in props if there isn't an arg value.\n// args.hasOwnProperty(k)\n// ) {\n// parts.tplfragment += `[${k}]=\"${k}\" `\n// }\n\n// // Outputs\n// if (\n// // Is in the outputs category\n// argTypes[k]?.table?.category === 'outputs'\n// ) {\n// // Without access to props, I don't know if I can get an action into the\n// // template context like this.\n// parts.tplfragment += `(${k})=\"${k}($event)\" `\n// parts.actions[k] = action(k)\n// }\n// })\n\n// return parts\n// }\n\nfunction removeDuplicates(arr: string[]) {\n const seen: { [k: string]: boolean } = {}\n return arr.filter((item) => {\n if (!seen[item]) {\n seen[item] = true\n return true\n }\n return false\n })\n}\n\nexport interface ArgsTplOptions {\n /**\n * Properties to always bind to the template.\n */\n alwaysBind?: string[]\n /**\n * Properties to exclude from bidning to the template.\n */\n exclude?: string[]\n}\n\n/**\n * This is an attempt at simplifying the use of auto-generated args in stories\n * defined with `template`, since Angular doesn't have a way to simply use a\n * spread operator syntax.\n *\n * @experimental\n */\nexport function argsToTpl(options?: ArgsTplOptions) {\n const context = useStoryContext<AngularRenderer>()\n\n const exclude = [\n ...(context?.parameters?.argsToTplOptions?.exclude || []),\n ...(options?.exclude || []),\n ]\n\n const alwaysBind = context?.parameters?.argsToTplOptions?.alwaysBind || []\n\n const props = removeDuplicates([...alwaysBind, ...Object.keys(context.args)])\n\n const parts = props\n .filter((k) => exclude.indexOf(k) === -1)\n .map((k) => {\n // Outputs\n if (\n context.argTypes[k]?.hasOwnProperty('action') &&\n (context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1)\n ) {\n return `(${k})=\"${k}($event)\"`\n }\n\n // Inputs\n if (context.args.hasOwnProperty(k) || alwaysBind.indexOf(k) !== -1) {\n return `[${k}]=\"${k}\"`\n }\n })\n\n return parts.length > 0 ? parts.join(' ') : ''\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: ``, standalone: true })\nexport class StoryEmptyComponent {}\n","import { StoryInitialRouteService } from './initial-route.service'\n\nexport function storyInitialRouteFactory(\n _storyInitialRouteService: StoryInitialRouteService,\n) {\n return () => _storyInitialRouteService.setInitialRoute()\n}\n","import { Injectable, InjectionToken, Injector } from '@angular/core'\nimport { NavigationEnd, Router } from '@angular/router'\nimport { filter, take } from 'rxjs/operators'\n\nexport const STORY_INITIAL_ROUTE_URL = new InjectionToken<any>(\n 'STORY_INITIAL_ROUTE_URL',\n)\n\n@Injectable()\nexport class StoryInitialRouteService {\n constructor(private _injector: Injector) {}\n\n public setInitialRoute() {\n const _router = this._injector.get(Router)\n const url = this._injector.get(STORY_INITIAL_ROUTE_URL)\n if (_router.navigated) {\n _router.navigateByUrl(url)\n } else {\n _router.events\n .pipe(\n filter((e) => e instanceof NavigationEnd),\n take(1),\n )\n .subscribe(() => {\n _router.navigateByUrl(url)\n })\n }\n }\n}\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core'\n\nimport { storyInitialRouteFactory } from './initial-route-factory'\nimport {\n StoryInitialRouteService,\n STORY_INITIAL_ROUTE_URL,\n} from './initial-route.service'\n\n@NgModule()\nexport class StoryInitialRouteModule {\n static forRoot(url: string): ModuleWithProviders<StoryInitialRouteModule> {\n return {\n ngModule: StoryInitialRouteModule,\n providers: [\n StoryInitialRouteService,\n {\n provide: APP_INITIALIZER,\n useFactory: storyInitialRouteFactory,\n deps: [StoryInitialRouteService],\n multi: true,\n },\n { provide: STORY_INITIAL_ROUTE_URL, useValue: url },\n ],\n }\n }\n}\n","// import { button } from '@storybook/addon-knobs'\n\n/**\n * Until I find a way to avoid '@storybook/addon-knobs' from interfering with\n * NgZone I can't import it in the knob when built by ng-packagr.\n */\nexport function routeButton(buttonKnob: any, url: string) {\n return buttonKnob(url, () => {\n location.hash = `#${url}`\n return false\n })\n}\n","// import { ArgType } from '@storybook/addons'\n\ndeclare const __STORYBOOK_ADDONS: any\n\nfunction goToHashUrl(url: string): void {\n location.hash = `#${url}`\n}\n\n// __STORYBOOK_ADDONS.getChannel().on('custom/go-to-hash', (data: { hash: string }) => {\n\n// goToHashUrl(data.hash)\n// })\n\n// __STORYBOOK_ADDONS.getChannel().on('storyArgsUpdated', (data: { hash: string }) => {\n// console.log('storyArgsUpdated')\n// })\n\nexport function routesArgType(routes: string[]) /*: ArgType*/ {\n return {\n options: routes,\n control: {\n type: 'select',\n // Runs in the 'manager', so I am emitting to a channel in the 'preview'.\n onChange: (e: any, a: any) => {\n __STORYBOOK_ADDONS.getChannel().emit('custom/go-to-hash', { hash: e })\n return e\n },\n },\n }\n}\n","import { Component } from '@angular/core'\n\n@Component({ template: `<router-outlet></router-outlet>`, standalone: false })\nexport class StoryEmptyWithRouteComponent {}\n","import { CommonModule } from '@angular/common'\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n Injector,\n Input,\n signal,\n TemplateRef,\n} from '@angular/core'\nimport { of } from 'rxjs'\n\nimport { ModalConfig, ModalRef, MODAL_DATA } from '@theseam/ui-common/modal'\nimport type { ComponentType } from '@theseam/ui-common/models'\nimport { TheSeamOverlayScrollbarDirective } from '@theseam/ui-common/scrollbar'\n\nclass FakeModalRef<T, R = any> implements Partial<ModalRef<T, R>> {\n afterOpened() {\n return of(undefined)\n }\n\n close(_dialogResult?: R): void {\n /* no-op in stories */\n }\n}\n\n/**\n * Renders its content (or an imperatively provided component/template) inside\n * a stand-in modal frame so stories can preview components that are normally\n * opened through the modal service.\n *\n * Three ways to provide content, checked in order:\n * 1. `[component]` input — renders via `ngComponentOutlet`. Kept for\n * compatibility with existing app stories.\n * 2. `[template]` input — renders a `TemplateRef` via `ngTemplateOutlet`.\n * 3. Projected content (`<ng-content>`) — the preferred form for new stories\n * because Storybook's default template auto-binds inputs/outputs.\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'story-modal-container-component',\n imports: [CommonModule, TheSeamOverlayScrollbarDirective],\n template: `\n <div class=\"cdk-overlay-container\">\n <div\n class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"\n ></div>\n <div\n class=\"cdk-global-overlay-wrapper\"\n dir=\"ltr\"\n style=\"justify-content: flex-start; align-items: center; pointer-events: auto\"\n seamOverlayScrollbar\n >\n <div\n class=\"seam-modal-container modal-dialog modal-dialog-centered {{\n _modalSizeClass()\n }}\"\n tabindex=\"-1\"\n >\n <div class=\"modal-content\">\n @if (_component(); as c) {\n <ng-container\n *ngComponentOutlet=\"c; injector: _componentInjector()\"\n ></ng-container>\n } @else if (template) {\n <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n } @else {\n <ng-content></ng-content>\n }\n </div>\n </div>\n </div>\n </div>\n `,\n styles: [\n `\n .seam-modal-container[tabindex='-1']:focus {\n outline: 0 !important;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class StoryModalContainerComponent<T = unknown, D = any> {\n constructor(private readonly _injector: Injector) {}\n\n @Input()\n set component(c: ComponentType<T> | null | undefined) {\n this._component.set(c ?? null)\n }\n\n @Input()\n set data(d: D | null | undefined) {\n this._data.set(d ?? null)\n }\n\n @Input()\n set modalConfig(config: ModalConfig<D> | null | undefined) {\n this._modalConfig.set(config ?? null)\n }\n get modalConfig(): ModalConfig<D> | null {\n return this._modalConfig()\n }\n\n @Input() template?: TemplateRef<unknown> | null\n\n protected readonly _component = signal<ComponentType<T> | null>(null)\n private readonly _data = signal<D | null>(null)\n private readonly _modalConfig = signal<ModalConfig<D> | null>(null)\n\n protected readonly _componentInjector = computed(() =>\n this._createInjector(this._data()),\n )\n\n // No default size — stories opt into a Bootstrap modal size via\n // `modalConfig.modalSize`, matching how the real ModalService is used.\n protected readonly _modalSizeClass = computed(() => {\n const size = this._modalConfig()?.modalSize\n return size ? `modal-${size}` : ''\n })\n\n private _createInjector(data: D | null): Injector {\n return Injector.create({\n providers: [\n { provide: ModalRef, useClass: FakeModalRef, deps: [] },\n { provide: MODAL_DATA, useValue: data ?? undefined },\n ],\n parent: this._injector,\n })\n }\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { RouterModule } from '@angular/router'\n\nimport { TheSeamOverlayScrollbarDirective } from '@theseam/ui-common/scrollbar'\n\nimport { StoryEmptyWithRouteComponent } from './story-empty-with-route.component'\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\n@NgModule({\n declarations: [StoryEmptyWithRouteComponent],\n imports: [\n CommonModule,\n RouterModule,\n TheSeamOverlayScrollbarDirective,\n StoryModalContainerComponent,\n ],\n exports: [StoryEmptyWithRouteComponent, StoryModalContainerComponent],\n})\nexport class StoryHelperComponentsModule {}\n","import { componentWrapperDecorator, Decorator } from '@storybook/angular'\n\nimport { ModalConfig } from '@theseam/ui-common/modal'\n\nimport { StoryModalContainerComponent } from './story-modal-container.component'\n\nexport interface StoryModalDecoratorOptions {\n /**\n * Passed through to `StoryModalContainerComponent`'s `modalConfig` input.\n * Commonly used to opt into a Bootstrap modal size, e.g.\n * `{ modalSize: 'lg' }`.\n */\n modalConfig?: ModalConfig\n}\n\n/**\n * Wraps a story's rendered component in `<story-modal-container-component>`\n * so it previews inside a stand-in modal frame. Storybook's default template\n * binds the story's args to the wrapped component, so inputs/outputs (e.g.\n * for the Actions addon) work without extra wiring.\n *\n * Use as an entry in a story's `decorators` array:\n *\n * ```ts\n * const meta: Meta<MyModalComponent> = {\n * title: 'Modal/My',\n * component: MyModalComponent,\n * decorators: [storyModalDecorator({ modalConfig: { modalSize: 'lg' } })],\n * }\n * ```\n */\nexport function storyModalDecorator(\n options?: StoryModalDecoratorOptions,\n): Decorator {\n return (storyFn, storyContext) => {\n const result = componentWrapperDecorator(\n (story) => `\n <story-modal-container-component [modalConfig]=\"_storyModalConfig\">\n ${story}\n </story-modal-container-component>\n `,\n )(storyFn, storyContext)\n\n return {\n ...result,\n props: {\n ...(result.props ?? {}),\n // Prefixed to avoid colliding with a story's own args.\n _storyModalConfig: options?.modalConfig ?? null,\n },\n moduleMetadata: {\n ...(result.moduleMetadata ?? {}),\n imports: [\n ...(result.moduleMetadata?.imports ?? []),\n StoryModalContainerComponent,\n ],\n },\n }\n }\n}\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef } from '@angular/core'\n// import { STORY } from '@storybook/angular/dist/ts3.9/client/preview/angular/app.token'\n// import { StoryFnAngularReturnType } from '@storybook/angular/dist/ts3.9/client/preview/types'\nimport { Observable } from 'rxjs'\nimport { first } from 'rxjs/operators'\n\n/**\n * Can be used to access a stories component after the story has been bootstrapped.\n *\n * Example:\n * ```ts\n * @Component({\n * selector: 'story-example',\n * template: `Touched: {{ exControl.touched }}`\n * })\n * class StoryExampleComponent {\n * exControl = new FormControl('')\n * }\n *\n * export const TouchExample2 = () => ({\n * moduleMetadata: {\n * declarations: [ StoryExampleComponent ],\n * providers: [ onStoryBootstrappedExec((c: StoryExampleComponent) => c.exControl.markAsTouched()) ]\n * },\n * props: { },\n * component: StoryExampleComponent\n * })\n * ```\n */\n// export function onStoryBootstrappedExec<T = any>(callback: (component: T) => void) {\n// function bootstrapped(componentRef: ComponentRef<any>) {\n// const data = componentRef.instance.target.injector.get(STORY, null) as Observable<StoryFnAngularReturnType> | null\n// if (!data) {\n// console.warn(`STORY provider not found.`)\n// return\n// }\n// data?.pipe(first()).subscribe(story => {\n// if (!story.component) {\n// console.warn(`'onStoryBootstrappedExec' only supported on stories that provide 'component' property.`)\n// return\n// }\n\n// let c = null\n// for (let i = 0; i < componentRef.instance.target.length; i++) {\n// const tmp = componentRef.instance.target._embeddedViews[i].nodes?.find((f: any) => f?.instance instanceof story.component)\n// const comp = tmp?.instance\n// if (comp) {\n// c = comp\n// break\n// }\n// }\n\n// if (!c) {\n// console.warn(`Story component instance not found.`)\n// return\n// }\n\n// if (c) {\n// callback(c)\n// }\n// })\n// }\n\n// return {\n// provide: APP_BOOTSTRAP_LISTENER,\n// useValue: bootstrapped,\n// multi: true\n// }\n// }\n","import { APP_BOOTSTRAP_LISTENER, ComponentRef, ElementRef } from '@angular/core'\n\n// TODO: Consider supporting a target selection function, so that complex\n// selections that can't be expressed by a simple selector can be used.\n\n/**\n * Can be used to trigger an event on a target element when the story component has been bootstrapped.\n *\n * Example:\n * ```\n * export const TouchExample1 = () => ({\n * moduleMetadata: {\n * providers: [ onStoryBootstrappedTrigger('input', 'blur') ]\n * },\n * props: { control: new FormControl('') },\n * template: `\n * <input type=\"text\" [formControl]=\"control\">\n * Touched: {{ control.touched }}\n * `\n * })\n * ```\n */\nexport function onStoryBootstrappedTrigger(\n targetSelector: string,\n eventName: string,\n) {\n function bootstrapped(componentRef: ComponentRef<any>) {\n const elementRef = componentRef.injector.get(ElementRef, null)\n const target = elementRef?.nativeElement.querySelector(targetSelector)\n if (!target) {\n // eslint-disable-next-line no-console\n console.warn(\n `Unable to trigger event '${eventName}'. Target '${targetSelector}' not found.`,\n )\n }\n\n const e = document.createEvent('HTMLEvents')\n e.initEvent('blur', false, true)\n target.dispatchEvent(e)\n }\n\n return {\n provide: APP_BOOTSTRAP_LISTENER,\n useValue: bootstrapped,\n multi: true,\n }\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, of } from 'rxjs'\n\nimport { TheSeamPreferencesAccessor } from '@theseam/ui-common/services'\n\nconst ACCESSOR_PREFIX = 'story-pref'\n\n@Injectable()\nexport class StoryPreferencesAccessorService\n implements TheSeamPreferencesAccessor\n{\n /**\n * Gets a preference.\n */\n public get(name: string): Observable<string> {\n // console.log('get', name)\n return of(localStorage.getItem(`${ACCESSOR_PREFIX}-${name}`) || '{}')\n }\n\n /**\n * Update a preference.\n */\n public update(name: string, value: string): Observable<string> {\n // console.log('update', name)\n localStorage.setItem(`${ACCESSOR_PREFIX}-${name}`, value)\n return this.get(name)\n }\n\n /**\n * Delete a preference.\n */\n public delete(name: string): Observable<boolean> {\n localStorage.removeItem(`${ACCESSOR_PREFIX}-${name}`)\n return of(true)\n }\n}\n","import { APP_INITIALIZER, Injector } from '@angular/core'\n\nimport { AngularRenderer, applicationConfig } from '@storybook/angular'\nimport { DecoratorFunction } from 'storybook/internal/csf'\n\nexport const INJECTOR_TO_ARGS_PROPERTY_NAME = '__getInjector'\n\n// TODO: Decide a better way to persist the injector reference than poluting\n// args with a value that isn't really meant to be an arg.\n\n/**\n * Storybook decorator that stores the Angular Injector in\n * args, for retrieval in play function.\n */\nexport const addInjectorGetterToArgs =\n (\n argName: string = INJECTOR_TO_ARGS_PROPERTY_NAME,\n ): DecoratorFunction<AngularRenderer> =>\n (story: any, context: any) => {\n // TODO: Test this more thoroughly.\n let injector: Injector | null = null\n context.args[argName] = () => injector\n return applicationConfig({\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: (injectorService: Injector) => () => {\n injector = injectorService\n },\n deps: [Injector],\n multi: true,\n },\n ],\n })(story, context)\n }\n\nexport const getInjectorFromArgs = (\n args: any,\n argName: string = INJECTOR_TO_ARGS_PROPERTY_NAME,\n): Injector => {\n if (!args || typeof args[argName] !== 'function') {\n throw Error(`Injector getter function '${argName}' not found.`)\n }\n const injector = args[argName]()\n if (!injector) {\n throw Error(\n `Injector not found. Did you add 'addInjectorGetterToArgs' to your story dectorators?`,\n )\n }\n\n return injector\n}\n","import { Type, ɵgetLContext as getLContext } from '@angular/core'\n\n/**\n * Index of the context slot in Angular's internal `LView` array.\n *\n * Unlike `ng.getComponent`, `ɵgetLContext` is a real (if private) export\n * rather than a devMode-only global, so this helper works in a production\n * build — verified by running the story suite against a built\n * `storybook-static`. What it IS pinned to is Angular's internal `LView`\n * layout: if this slot index ever moves, `getComponentInstance()` returns the\n * wrong object or null rather than failing loudly. Re-verify on a major\n * Angular upgrade, against a production build rather than the dev server.\n */\nconst CONTEXT = 8\n\nexport function getComponentInstance<T>(\n element: Element | null | undefined,\n componentType?: Type<T>,\n): T | null {\n if (!element) return null\n\n const ctx = getLContext(element)\n if (!ctx) return null\n\n if (ctx.component != null) {\n return match(ctx.component, componentType)\n }\n\n const lView = ctx.lView\n if (!lView) return null\n\n // Host component of this node (same as ng.getComponent)\n const atNode = getComponentAtNode(lView, ctx.nodeIndex)\n if (atNode != null) {\n const matched = match(atNode, componentType)\n if (matched) return matched\n }\n\n // Fallback: owning component view context (same idea as ng.getOwningComponent)\n const owning = lView[CONTEXT]\n return match(owning, componentType)\n}\n\nfunction match<T>(value: unknown, type?: Type<T>): T | null {\n if (value == null) return null\n if (!type) return value as T\n return value instanceof type ? value : null\n}\n\nfunction getComponentAtNode(lView: any[], nodeIndex: number): unknown {\n const slot = lView[nodeIndex]\n if (!slot) return null\n // Component host slot is either an LView or an LContainer whose [0]/HOST is the LView\n const childView =\n Array.isArray(slot) && Array.isArray(slot[1]) ? slot : slot[0]\n if (!Array.isArray(childView)) return null\n return childView[CONTEXT] ?? null\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["getLContext"],"mappings":";;;;;;;;;;;;;;AAAA;AAMO,MAAM,YAAY,GAAY;AACnC,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,OAAO,EAAE;AACP,QAAA,IAAI,EAAE,QAAQ;AACf,KAAA;AACD,IAAA,WAAW,EAAE,CAAA,YAAA,CAAc;;AAGtB,MAAM,uBAAuB,GAA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