@theseam/ui-common 2.0.1-beta.103 → 2.0.1-beta.104
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-guide.mjs +1192 -0
- package/fesm2022/theseam-ui-common-guide.mjs.map +1 -0
- package/guide/guide-theme.scss +105 -0
- package/guide/index.d.ts +474 -0
- package/guide/package.json +3 -0
- package/guide/styles/_utilities.scss +4 -0
- package/guide/styles/_variables.scss +6 -0
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-guide.mjs","sources":["../../../projects/ui-common/guide/models/guide-content.ts","../../../projects/ui-common/guide/models/guide-config.ts","../../../projects/ui-common/guide/models/guide-errors.ts","../../../projects/ui-common/guide/target/guide-target-registry.ts","../../../projects/ui-common/guide/target/guide-target.directive.ts","../../../projects/ui-common/guide/adapter/guide-adapter.ts","../../../projects/ui-common/guide/guide-ref.ts","../../../projects/ui-common/guide/content/guide-content.renderer.ts","../../../projects/ui-common/guide/adapter/driver-js/driver-js-guide.adapter.ts","../../../projects/ui-common/guide/guide-providers.ts","../../../projects/ui-common/guide/content/guide-content-resolver.ts","../../../projects/ui-common/guide/guide-session.ts","../../../projects/ui-common/guide/guide.service.ts","../../../projects/ui-common/guide/testing/fake-guide-content.renderer.ts","../../../projects/ui-common/guide/testing/fake-guide.adapter.ts","../../../projects/ui-common/guide/theseam-ui-common-guide.ts"],"sourcesContent":["import { InjectionToken, TemplateRef, Type } from '@angular/core'\n\nimport type { TheSeamGuideRef } from '../guide-ref'\nimport type { TheSeamGuideStep } from './guide-step'\n\n/**\n * Application-defined values handed to popover content.\n *\n * The library reserves **no keys** here. That is why `text` is a sibling field\n * on the content spec rather than a well-known key in this bag: an application\n * can name its data anything without colliding with the guide.\n */\nexport type TheSeamGuideContentData = Record<string, unknown>\n\nexport interface TheSeamGuideContentBase {\n /** The slot's plain text. A bare string is sugar for this. Nearest-wins. */\n text?: string\n /** Shallow-merged across provider -> session -> step. */\n data?: TheSeamGuideContentData\n}\n\nexport interface TheSeamGuideTemplateContent extends TheSeamGuideContentBase {\n template: TemplateRef<TheSeamGuideContentContext>\n component?: never\n}\n\nexport interface TheSeamGuideComponentContent extends TheSeamGuideContentBase {\n component: Type<unknown>\n template?: never\n}\n\n/** Text and/or data for whichever renderer an outer layer supplies. */\nexport interface TheSeamGuideInheritedContent extends TheSeamGuideContentBase {\n template?: never\n component?: never\n}\n\n/**\n * The `never` guards make `template` and `component` on one object a compile\n * error, rather than a runtime precedence rule nobody remembers.\n */\nexport type TheSeamGuideContentSpec =\n | TheSeamGuideTemplateContent\n | TheSeamGuideComponentContent\n | TheSeamGuideInheritedContent\n\nexport type TheSeamGuideContent = string | TheSeamGuideContentSpec\n\n/**\n * What popover content receives. Templates get this as their context;\n * components get it from {@link THE_SEAM_GUIDE_CONTENT}.\n *\n * `data` is never spread, so `let-index` is unambiguously the step index and\n * never an application value.\n */\nexport interface TheSeamGuideContentContext {\n /** `data`, so `let-d` in a template reads `d.icon`. */\n $implicit: TheSeamGuideContentData\n data: TheSeamGuideContentData\n text: string | undefined\n step: TheSeamGuideStep\n index: number\n total: number\n guide: TheSeamGuideRef\n}\n\n/** Injected by a component used as popover content. */\nexport const THE_SEAM_GUIDE_CONTENT =\n new InjectionToken<TheSeamGuideContentContext>('THE_SEAM_GUIDE_CONTENT')\n\n/** One popover slot after its three layers are resolved. */\nexport type TheSeamGuideResolvedSlot =\n | { kind: 'text'; text: string }\n | {\n kind: 'template'\n template: TemplateRef<TheSeamGuideContentContext>\n text: string | undefined\n data: TheSeamGuideContentData\n }\n | {\n kind: 'component'\n component: Type<unknown>\n text: string | undefined\n data: TheSeamGuideContentData\n }\n\n/** A resolved slot that needs an Angular view. */\nexport type TheSeamGuideViewSlot = Exclude<\n TheSeamGuideResolvedSlot,\n { kind: 'text' }\n>\n\n/** A rendered slot. Destroying it tears the view down. */\nexport interface TheSeamGuideContentView {\n destroy(): void\n}\n\n/**\n * Published so `testing/` can fake it, exactly as `TheSeamGuideAdapter` is.\n * The DOM implementation itself is internal.\n */\nexport interface TheSeamGuideContentRenderer {\n render(\n slot: TheSeamGuideViewSlot,\n context: TheSeamGuideContentContext,\n host: HTMLElement,\n ): TheSeamGuideContentView\n}\n","import {\n TheSeamGuideMissPolicy,\n TheSeamGuidePopover,\n TheSeamGuideStep,\n} from './guide-step'\n\nexport interface TheSeamGuideConfig {\n steps: TheSeamGuideStep[]\n\n /** User may dismiss via Escape, overlay click, or close button. Default true. */\n dismissible?: boolean\n\n /** Milliseconds to wait for a target before the miss policy applies. Default 3000. */\n targetTimeout?: number\n\n /** Guide-level miss policy, applied at step entry. Default 'skip'. */\n onMissingTarget?: TheSeamGuideMissPolicy\n\n /**\n * Milliseconds to wait for a target to return after it disappears mid-step,\n * before `onTargetLost` applies. Default 1000.\n */\n targetLostGrace?: number\n\n /** Policy for a target lost mid-step. Default 'elementless'. */\n onTargetLost?: TheSeamGuideMissPolicy\n\n /**\n * Popover defaults for every step in this guide — the middle content layer.\n * Decorates slots a step supplies, and can supply a slot itself; a step\n * opts out of one with `null`.\n */\n popover?: TheSeamGuidePopover\n}\n\n// `popover` is excluded rather than given a default: it is a content layer\n// resolved per slot, not a scalar option with a single fallback value.\nexport type TheSeamGuideResolvedConfig = Required<\n Omit<TheSeamGuideConfig, 'steps' | 'popover'>\n>\n\nexport const THE_SEAM_GUIDE_DEFAULTS: TheSeamGuideResolvedConfig = {\n dismissible: true,\n targetTimeout: 3000,\n onMissingTarget: 'skip',\n targetLostGrace: 1000,\n onTargetLost: 'elementless',\n}\n","export class TheSeamGuideBusyError extends Error {\n constructor() {\n super(\n 'TheSeamGuide: a non-dismissible guide is already active. Wait for' +\n ' `activeGuide()?.afterClosed$` before starting another guide.',\n )\n this.name = 'TheSeamGuideBusyError'\n }\n}\n\nexport class TheSeamGuideTargetTimeoutError extends Error {\n constructor(public readonly targetName: string) {\n super(`TheSeamGuide: timed out waiting for target \"${targetName}\".`)\n this.name = 'TheSeamGuideTargetTimeoutError'\n }\n}\n","import { Injectable, isDevMode } from '@angular/core'\nimport { defer, Observable, of, Subject, throwError } from 'rxjs'\nimport { filter, map, take, timeout } from 'rxjs/operators'\n\nimport { TheSeamGuideTargetTimeoutError } from '../models/guide-errors'\n\n/**\n * Tracks elements registered by `[seamGuideTarget]` so a guide can await a\n * target that does not exist yet, and notice one that disappears.\n */\n@Injectable({ providedIn: 'root' })\nexport class TheSeamGuideTargetRegistry {\n private readonly _targets = new Map<string, Element[]>()\n private readonly _changes = new Subject<string>()\n\n /** Emits the target name whenever its registrations change. */\n readonly changes$: Observable<string> = this._changes.asObservable()\n\n register(name: string, element: Element): void {\n const list = this._targets.get(name) ?? []\n if (!list.includes(element)) {\n list.push(element)\n }\n this._targets.set(name, list)\n\n if (isDevMode() && list.filter((e) => e.isConnected).length > 1) {\n console.warn(\n `TheSeamGuideTargetRegistry: more than one connected element is` +\n ` registered as guide target \"${name}\". The most recently registered` +\n ` one will be used, which may not be the one you meant.`,\n )\n }\n\n this._changes.next(name)\n }\n\n unregister(name: string, element: Element): void {\n const list = this._targets.get(name)\n if (!list) {\n return\n }\n const index = list.indexOf(element)\n if (index === -1) {\n return\n }\n list.splice(index, 1)\n if (list.length === 0) {\n this._targets.delete(name)\n }\n this._changes.next(name)\n }\n\n /** The most recently registered element for `name` that is still in the DOM. */\n resolve(name: string): Element | null {\n const list = this._targets.get(name)\n if (!list) {\n return null\n }\n for (let i = list.length - 1; i >= 0; i--) {\n if (list[i].isConnected) {\n return list[i]\n }\n }\n return null\n }\n\n /** Emits as soon as `name` resolves. Errors with a timeout error otherwise. */\n waitFor(name: string, timeoutMs: number): Observable<Element> {\n return defer(() => {\n const existing = this.resolve(name)\n if (existing !== null) {\n return of(existing)\n }\n return this._changes.pipe(\n filter((changed) => changed === name),\n map(() => this.resolve(name)),\n filter((el): el is Element => el !== null),\n take(1),\n timeout({\n first: timeoutMs,\n with: () =>\n throwError(() => new TheSeamGuideTargetTimeoutError(name)),\n }),\n )\n })\n }\n}\n","import {\n Directive,\n ElementRef,\n effect,\n inject,\n input,\n OnDestroy,\n} from '@angular/core'\n\nimport { TheSeamGuideTargetRegistry } from './guide-target-registry'\n\n/**\n * Marks an element as a named guide target.\n *\n * Registering on init and unregistering on destroy is what lets a guide await a\n * target that has not rendered yet, and recover when one is destroyed and\n * recreated mid-step.\n */\n@Directive({\n selector: '[seamGuideTarget]',\n standalone: true,\n})\nexport class TheSeamGuideTargetDirective implements OnDestroy {\n private readonly _registry = inject(TheSeamGuideTargetRegistry)\n private readonly _elementRef = inject<ElementRef<Element>>(ElementRef)\n\n readonly seamGuideTarget = input.required<string>()\n\n private _registeredName: string | null = null\n\n constructor() {\n effect(() => {\n const name = this.seamGuideTarget()\n if (this._registeredName === name) {\n return\n }\n const element = this._elementRef.nativeElement\n if (this._registeredName !== null) {\n this._registry.unregister(this._registeredName, element)\n }\n this._registry.register(name, element)\n this._registeredName = name\n })\n }\n\n ngOnDestroy(): void {\n if (this._registeredName !== null) {\n this._registry.unregister(\n this._registeredName,\n this._elementRef.nativeElement,\n )\n this._registeredName = null\n }\n }\n}\n","import { InjectionToken } from '@angular/core'\n\n/**\n * A popover as the presentation engine sees it.\n *\n * `HTMLElement` carries template and component content. The service creates,\n * owns, and destroys that node; the adapter only places it, which is what\n * keeps the adapter free of Angular.\n *\n * **An `HTMLElement` slot must be re-adopted on every re-render — never\n * cloned, never wrapped in a fresh element, never rebuilt from its\n * `outerHTML`.** The engine may tear down and rebuild its whole popover DOM\n * on every render (driver.js does, including on the re-drive behind\n * `refresh()`), but the identical node handed in here must end up back in\n * the new DOM each time. Re-adoption of that exact node is what lets the\n * Angular view living inside it survive untouched across a rebuild —\n * preserving scroll position, a typed-in value, or an in-flight animation\n * instead of resetting it.\n */\nexport interface TheSeamGuideAdapterPopover {\n title?: string | HTMLElement\n description?: string | HTMLElement\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n}\n\n/**\n * A step as the presentation engine sees it.\n *\n * `element` is a resolver function, not an element, so the engine re-resolves\n * at paint time. That is what makes mid-step recovery a `refresh()` rather than\n * a step transition.\n */\nexport interface TheSeamGuideAdapterStep {\n element?: () => Element | undefined\n popover?: TheSeamGuideAdapterPopover\n}\n\nexport interface TheSeamGuideAdapterConfig {\n steps: TheSeamGuideAdapterStep[]\n /** When false, Escape, overlay click, and the close button must not dismiss. */\n allowUserDismiss: boolean\n}\n\n/** How the engine reports user intent. It never advances itself. */\nexport interface TheSeamGuideAdapterCallbacks {\n onNextRequested(): void\n onPreviousRequested(): void\n onCloseRequested(): void\n}\n\nexport interface TheSeamGuideAdapter {\n start(\n config: TheSeamGuideAdapterConfig,\n callbacks: TheSeamGuideAdapterCallbacks,\n ): void\n next(): void\n previous(): void\n moveTo(index: number): void\n /**\n * Re-resolves and repositions the current step in place, without a step\n * transition. This is the operation mid-step recovery depends on.\n *\n * **Must re-invoke the current step's element resolver** (the function on\n * `TheSeamGuideAdapterStep.element`), not merely reposition around a\n * previously-resolved element. An implementation that only repositions\n * passes every session-layer spec — the session never observes the\n * difference directly — but silently keeps highlighting a detached element\n * during recovery while still reporting `targetRecovered`. driver.js's own\n * `refresh()` has exactly this bug, which is why the driver.js adapter does\n * not call it and instead re-drives the current index to force\n * re-resolution.\n */\n refresh(): void\n destroy(): void\n isActive(): boolean\n}\n\nexport const THE_SEAM_GUIDE_ADAPTER = new InjectionToken<TheSeamGuideAdapter>(\n 'THE_SEAM_GUIDE_ADAPTER',\n)\n","import { Signal } from '@angular/core'\nimport { Observable } from 'rxjs'\n\nimport {\n TheSeamGuideCloseReason,\n TheSeamGuideEvent,\n TheSeamGuideResult,\n} from './models/guide-event'\n\n/**\n * The contract between a {@link TheSeamGuideRef} and the session backing it.\n * `TheSeamGuideRef` delegates every member to an implementation of this\n * interface, so it never depends on `TheSeamGuideSession` directly.\n */\nexport interface TheSeamGuideSessionController {\n /**\n * Replays every event emitted so far for this guide, from `started`\n * onward, to each new subscriber — so attaching at any point yields the\n * complete history rather than only future events.\n */\n readonly events$: Observable<TheSeamGuideEvent>\n readonly afterClosed$: Observable<TheSeamGuideResult>\n readonly activeIndex: Signal<number>\n readonly dismissible: boolean\n next(): void\n previous(): void\n moveTo(index: number): void\n refresh(): void\n close(reason: TheSeamGuideCloseReason): void\n}\n\n/**\n * Consumer-facing handle to a running guide.\n *\n * The caller owns this ref's lifetime. A guide is not closed automatically\n * when the component that started it is destroyed — `TheSeamGuideService` is\n * `providedIn: 'root'`, so its `ngOnDestroy` only fires when the root\n * injector itself is destroyed, not on ordinary route/component teardown. A\n * component that may be destroyed before its guide naturally ends should tie\n * the ref to its own lifetime:\n *\n * ```ts\n * const ref = this._guide.start(config)\n * inject(DestroyRef).onDestroy(() => ref.close())\n * ```\n */\nexport class TheSeamGuideRef {\n constructor(private readonly _session: TheSeamGuideSessionController) {}\n\n /**\n * Replays every event emitted so far for this guide, from `started`\n * onward — a subscriber attached at any point sees the complete history,\n * not just events emitted after it subscribes. This is why subscribing\n * immediately after `start()` returns still observes `started`: `start()`\n * runs synchronously, but the event is not lost, it is replayed.\n */\n get events$(): Observable<TheSeamGuideEvent> {\n return this._session.events$\n }\n\n get afterClosed$(): Observable<TheSeamGuideResult> {\n return this._session.afterClosed$\n }\n\n get activeIndex(): Signal<number> {\n return this._session.activeIndex\n }\n\n /** Whether the user may dismiss this guide. Read by the service's concurrency rule. */\n get dismissible(): boolean {\n return this._session.dismissible\n }\n\n next(): void {\n this._session.next()\n }\n\n previous(): void {\n this._session.previous()\n }\n\n moveTo(index: number): void {\n this._session.moveTo(index)\n }\n\n refresh(): void {\n this._session.refresh()\n }\n\n /** Always works, including when `dismissible` is false. */\n close(reason: TheSeamGuideCloseReason = 'dismissed'): void {\n this._session.close(reason)\n }\n}\n","import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n Injector,\n} from '@angular/core'\n\nimport { TheSeamGuideRef } from '../guide-ref'\nimport {\n TheSeamGuideContentContext,\n TheSeamGuideContentRenderer,\n TheSeamGuideContentView,\n TheSeamGuideViewSlot,\n THE_SEAM_GUIDE_CONTENT,\n} from '../models/guide-content'\n\n/**\n * Creates and destroys the Angular view behind a popover slot.\n *\n * Separate from `TheSeamGuideSession` so session specs can run against a fake\n * and stay free of a real `ApplicationRef`, and so the session stays free of\n * rendering concerns.\n */\n@Injectable({ providedIn: 'root' })\nexport class TheSeamGuideDomContentRenderer\n implements TheSeamGuideContentRenderer\n{\n private readonly _appRef = inject(ApplicationRef)\n private readonly _envInjector = inject(EnvironmentInjector)\n\n /**\n * Renders `slot` into `host`, which the caller owns.\n *\n * Views are attached to `ApplicationRef` rather than created through a\n * `ViewContainerRef`, because this is a `providedIn: 'root'` service and\n * there is no view container to reach. Attachment is what makes a view\n * change-detected; where its nodes sit in the DOM is independent of it,\n * which is what lets driver.js move `host` around as it rebuilds its\n * popover on every render.\n */\n render(\n slot: TheSeamGuideViewSlot,\n context: TheSeamGuideContentContext,\n host: HTMLElement,\n ): TheSeamGuideContentView {\n if (slot.kind === 'template') {\n const view = slot.template.createEmbeddedView(context)\n this._appRef.attachView(view)\n host.append(...view.rootNodes)\n return {\n destroy: () => {\n this._appRef.detachView(view)\n view.destroy()\n },\n }\n }\n\n const ref = createComponent(slot.component, {\n environmentInjector: this._envInjector,\n // DI rather than `setInput`: `data` is shallow-merged across three\n // layers, so it routinely carries keys a given component never declared\n // as an input, and `setInput` throws NG0303 for those.\n elementInjector: Injector.create({\n parent: this._envInjector,\n providers: [\n { provide: THE_SEAM_GUIDE_CONTENT, useValue: context },\n { provide: TheSeamGuideRef, useValue: context.guide },\n ],\n }),\n })\n this._appRef.attachView(ref.hostView)\n host.append(ref.location.nativeElement)\n return {\n destroy: () => {\n this._appRef.detachView(ref.hostView)\n ref.destroy()\n },\n }\n }\n}\n","import { Injectable } from '@angular/core'\nimport { Config, DriveStep, driver, Driver, PopoverDOM } from 'driver.js'\n\nimport {\n TheSeamGuideAdapter,\n TheSeamGuideAdapterCallbacks,\n TheSeamGuideAdapterConfig,\n TheSeamGuideAdapterPopover,\n TheSeamGuideAdapterStep,\n} from '../guide-adapter'\nimport { ExhaustiveMap } from '../../models/exhaustive-map'\n\n/**\n * driver.js implementation of the guide adapter.\n *\n * The whole step array is handed to driver.js so its buttons, progress\n * indicator, and keyboard handling are preserved, but every navigation click is\n * intercepted and reported instead of acted on. The session decides what\n * happens next.\n */\n@Injectable()\nexport class DriverJsGuideAdapter implements TheSeamGuideAdapter {\n private _driver: Driver | null = null\n\n start(\n config: TheSeamGuideAdapterConfig,\n callbacks: TheSeamGuideAdapterCallbacks,\n ): void {\n this.destroy()\n\n const driverConfig: Config = {\n steps: config.steps.map((step) => this._toDriveStep(step)),\n allowClose: config.allowUserDismiss,\n showButtons: config.allowUserDismiss\n ? ['next', 'previous', 'close']\n : ['next', 'previous'],\n // Intercept every navigation: driver.js must never advance itself,\n // because the session owns sequencing.\n onNextClick: () => callbacks.onNextRequested(),\n onPrevClick: () => callbacks.onPreviousRequested(),\n onCloseClick: () => callbacks.onCloseRequested(),\n onDestroyStarted: () => callbacks.onCloseRequested(),\n }\n\n this._driver = driver(driverConfig)\n }\n\n next(): void {\n this._driver?.moveNext()\n }\n\n previous(): void {\n this._driver?.movePrevious()\n }\n\n moveTo(index: number): void {\n if (this._driver === null) {\n return\n }\n if (!this._driver.isActive()) {\n this._driver.drive(index)\n return\n }\n this._driver.moveTo(index)\n }\n\n refresh(): void {\n // driver.js's own refresh() only repositions the overlay/popover around\n // the cached active element — it never re-invokes the step's element\n // resolver. Re-driving the current index is what forces re-resolution,\n // which is the whole point of `refresh()` for mid-step recovery.\n //\n // This re-drive rebuilds the popover DOM every time, producing a visible\n // flash even when the resolved element hasn't changed — driver.js has no\n // primitive for \"re-resolve without re-render\". Callers should treat this\n // as a recovery operation, not something to invoke speculatively.\n const index = this._driver?.getActiveIndex()\n if (index !== undefined) {\n this._driver?.moveTo(index)\n }\n }\n\n destroy(): void {\n if (this._driver === null) {\n return\n }\n const instance = this._driver\n // Null first, out of caution: if driver.js's public destroy() ever starts\n // invoking onDestroyStarted synchronously, we don't want that callback\n // re-entering this adapter through a non-null _driver. Today it doesn't —\n // destroy() tears down with confirm=false and always skips\n // onDestroyStarted — so this ordering isn't load-bearing for the current\n // wiring, just defensive against a future driver.js change.\n this._driver = null\n instance.destroy()\n }\n\n isActive(): boolean {\n return this._driver?.isActive() ?? false\n }\n\n private _toDriveStep(step: TheSeamGuideAdapterStep): DriveStep {\n // Typed honestly as `Element | undefined`, matching what the resolver\n // can actually return — `undefined` is a real outcome, not an absent\n // one, since the elementless path depends on it.\n const resolveElement: (() => Element | undefined) | undefined =\n step.element === undefined ? undefined : () => step.element?.()\n return {\n // driver.js's own public type only declares `() => Element`, but its\n // runtime falls back to a centered popover when the resolver returns\n // `undefined`. This cast crosses that documentation gap at the one\n // point it matters; `resolveElement` above keeps `undefined` visible\n // everywhere else in this method.\n element: resolveElement as (() => Element) | undefined,\n popover:\n step.popover === undefined\n ? undefined\n : this._toDrivePopover(step.popover),\n }\n }\n\n /**\n * `ExhaustiveMap` makes every key of `TheSeamGuideAdapterPopover` required\n * in `mapped`, so adding a field to the boundary is a compile error here\n * until it is carried through.\n */\n private _toDrivePopover(\n popover: TheSeamGuideAdapterPopover,\n ): NonNullable<DriveStep['popover']> {\n const mapped: ExhaustiveMap<TheSeamGuideAdapterPopover> = {\n title: popover.title,\n description: popover.description,\n side: popover.side,\n align: popover.align,\n }\n const { title, description, side, align } = mapped\n const hasNode =\n title instanceof HTMLElement || description instanceof HTMLElement\n\n return {\n title: typeof title === 'string' ? title : undefined,\n description: typeof description === 'string' ? description : undefined,\n side,\n align,\n // driver.js hides a slot whose string is falsy, so a slot filled with a\n // node must be un-hidden as well as populated. It also rebuilds the\n // whole popover on every render, so this runs again on each re-drive\n // and simply re-adopts the same host node.\n onPopoverRender: hasNode\n ? (dom: PopoverDOM) => {\n if (title instanceof HTMLElement) {\n dom.title.replaceChildren(title)\n dom.title.style.display = 'block'\n }\n if (description instanceof HTMLElement) {\n dom.description.replaceChildren(description)\n dom.description.style.display = 'block'\n }\n }\n : undefined,\n }\n }\n}\n","import {\n EnvironmentProviders,\n InjectionToken,\n makeEnvironmentProviders,\n Type,\n} from '@angular/core'\n\nimport {\n THE_SEAM_GUIDE_ADAPTER,\n TheSeamGuideAdapter,\n} from './adapter/guide-adapter'\nimport { DriverJsGuideAdapter } from './adapter/driver-js/driver-js-guide.adapter'\nimport { TheSeamGuidePopover } from './models/guide-step'\n\n/**\n * Application-wide popover defaults — the outermost of the three content\n * layers. Always provided by {@link provideTheSeamGuide}, defaulting to `{}`.\n */\nexport const THE_SEAM_GUIDE_POPOVER_DEFAULTS =\n new InjectionToken<TheSeamGuidePopover>('THE_SEAM_GUIDE_POPOVER_DEFAULTS')\n\nexport interface TheSeamGuideProviderOptions {\n /** Replace the presentation engine. Defaults to the driver.js adapter. */\n adapter?: Type<TheSeamGuideAdapter>\n\n /**\n * Popover defaults for every guide in the application. This layer decorates\n * slots that a guide or a step supplies; it never creates one.\n */\n popover?: TheSeamGuidePopover\n}\n\n/**\n * Wires the guide's presentation engine.\n *\n * The engine is named only here — no consumer imports driver.js — so replacing\n * it is a change to this call, not to application code.\n */\nexport function provideTheSeamGuide(\n options: TheSeamGuideProviderOptions = {},\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: THE_SEAM_GUIDE_ADAPTER,\n useClass: options.adapter ?? DriverJsGuideAdapter,\n },\n {\n provide: THE_SEAM_GUIDE_POPOVER_DEFAULTS,\n useValue: options.popover ?? {},\n },\n ])\n}\n","import {\n TheSeamGuideContent,\n TheSeamGuideContentData,\n TheSeamGuideContentSpec,\n TheSeamGuideResolvedSlot,\n} from '../models/guide-content'\n\n/** The three layers for one popover slot. */\nexport interface TheSeamGuideContentLayers {\n provider?: TheSeamGuideContent | null\n session?: TheSeamGuideContent | null\n step?: TheSeamGuideContent | null\n}\n\n/** A bare string is sugar for `{ text }`. */\nfunction normalize(\n value: TheSeamGuideContent | null | undefined,\n): TheSeamGuideContentSpec | null | undefined {\n if (value === undefined || value === null) {\n return value\n }\n return typeof value === 'string' ? { text: value } : value\n}\n\n/**\n * Resolves one popover slot from its three layers. `null` means the slot is\n * absent and nothing is rendered for it.\n *\n * Presence and content are decided separately: only the step and session\n * layers can make a slot present, but once it is, all three layers contribute\n * the renderer, the text, and the data. That is what lets a step say\n * `title: 'Step One'` and still get the application's title component.\n */\nexport function resolveGuideContentSlot(\n layers: TheSeamGuideContentLayers,\n): TheSeamGuideResolvedSlot | null {\n const presence = layers.step !== undefined ? layers.step : layers.session\n if (presence === undefined || presence === null) {\n return null\n }\n\n const provider = normalize(layers.provider)\n const session = normalize(layers.session)\n const step = normalize(layers.step)\n\n const nearestFirst = [step, session, provider]\n const outermostFirst = [provider, session, step]\n\n // One search for the renderer, not one per kind: the nearest layer naming\n // either wins outright, so a step's template beats a session's component.\n const renderer = nearestFirst.find(\n (layer) => layer?.template != null || layer?.component != null,\n )\n const text = nearestFirst.find((layer) => layer?.text !== undefined)?.text\n\n const data: TheSeamGuideContentData = {}\n for (const layer of outermostFirst) {\n if (layer?.data !== undefined) {\n Object.assign(data, layer.data)\n }\n }\n\n if (renderer?.template != null) {\n return { kind: 'template', template: renderer.template, text, data }\n }\n if (renderer?.component != null) {\n return { kind: 'component', component: renderer.component, text, data }\n }\n return text === undefined ? null : { kind: 'text', text }\n}\n","import { isDevMode, signal, Signal } from '@angular/core'\nimport {\n defer,\n EMPTY,\n from,\n isObservable,\n Observable,\n of,\n ReplaySubject,\n Subject,\n Subscription,\n} from 'rxjs'\nimport { catchError, filter, map, switchMap, take, tap } from 'rxjs/operators'\n\nimport {\n TheSeamGuideAdapter,\n TheSeamGuideAdapterPopover,\n TheSeamGuideAdapterStep,\n} from './adapter/guide-adapter'\nimport { resolveGuideContentSlot } from './content/guide-content-resolver'\nimport { TheSeamGuideRef, TheSeamGuideSessionController } from './guide-ref'\nimport {\n TheSeamGuideConfig,\n TheSeamGuideResolvedConfig,\n THE_SEAM_GUIDE_DEFAULTS,\n} from './models/guide-config'\nimport {\n TheSeamGuideCloseReason,\n TheSeamGuideEvent,\n TheSeamGuideResult,\n} from './models/guide-event'\nimport { ExhaustiveMap } from './models/exhaustive-map'\nimport {\n TheSeamGuideContentContext,\n TheSeamGuideContentRenderer,\n TheSeamGuideContentView,\n TheSeamGuideViewSlot,\n} from './models/guide-content'\nimport {\n TheSeamGuideMissPolicy,\n TheSeamGuidePopover,\n TheSeamGuideStep,\n} from './models/guide-step'\nimport { TheSeamGuideTargetRegistry } from './target/guide-target-registry'\n\n/**\n * Everything a session needs that it does not own. A bag rather than\n * positional parameters: the list grows, and a mis-ordered pair of same-typed\n * arguments is a silent bug.\n */\nexport interface TheSeamGuideSessionDeps {\n adapter: TheSeamGuideAdapter\n registry: TheSeamGuideTargetRegistry\n contentRenderer: TheSeamGuideContentRenderer\n popoverDefaults: TheSeamGuidePopover\n /**\n * The ref is created after the session, so it is reached lazily. Only ever\n * called at step-entry time, which is a microtask after `start()` returns.\n */\n getRef: () => TheSeamGuideRef\n onClosed: (session: TheSeamGuideSession) => void\n}\n\n/**\n * One popover slot for one step.\n *\n * The host node is created once, when the guide starts, and handed to the\n * adapter for the guide's lifetime. Only the Angular view inside it comes and\n * goes. That is what lets driver.js rebuild its popover on every render — and\n * on the re-drive behind `refresh()` — while the view survives untouched.\n */\ntype SlotBinding =\n | { kind: 'text'; text: string }\n | {\n kind: 'view'\n slot: TheSeamGuideViewSlot\n host: HTMLElement\n view: TheSeamGuideContentView | null\n }\n\ninterface StepSlots {\n title: SlotBinding | null\n description: SlotBinding | null\n}\n\nexport class TheSeamGuideSession implements TheSeamGuideSessionController {\n // ReplaySubject, not Subject: `start()` runs synchronously (including its\n // `'started'` emit) before the service hands the ref back to the caller, so\n // a subscriber that attaches right after `start()` returns is necessarily\n // late. Replaying history is what lets it still observe events already\n // emitted during that synchronous start, matching `_afterClosed` below.\n private readonly _events = new ReplaySubject<TheSeamGuideEvent>()\n private readonly _afterClosed = new ReplaySubject<TheSeamGuideResult>(1)\n private readonly _activeIndex = signal(-1)\n\n private readonly _transitions = new Subject<{\n index: number\n direction: 1 | -1\n }>()\n private _transitionSub: Subscription | null = null\n private _recoverySub: Subscription | null = null\n // Bumped by every `_disarmRecovery()` call. A re-arm queued on a microtask\n // captures the generation in effect when it was queued and checks it before\n // acting, so a re-arm for a step the session has since moved past (a\n // transition disarmed-and-rearmed for a *different* step in between) is a\n // no-op instead of clobbering the newer arming.\n private _recoveryGeneration = 0\n\n private _closed = false\n\n // Whether the currently active step's `afterStep` has already fired for\n // this departure. A skip or a cancellation re-requests a transition\n // without changing `_activeIndex` (the departed-from step never painted\n // anything new), so without this guard the same step's `afterStep` would\n // re-run on every retry. Reset to `false` whenever a step actually paints.\n private _afterStepFired = false\n\n // Index whose `beforeStep` has already been fired while its transition is\n // still in flight (target not yet resolved), or `null`. driver.js leaves\n // the Next/Previous buttons live during that wait, so a second click\n // re-requests the same index; without this guard `switchMap` would restart\n // the transition and run `beforeStep` a second time before the first\n // attempt ever settles. Reset to `null` whenever a step actually paints —\n // mirroring `_afterStepFired` — so a later, genuine re-entry to the same\n // index still runs its `beforeStep`.\n private _beforeStepFiredFor: number | null = null\n\n readonly steps: TheSeamGuideStep[]\n readonly options: TheSeamGuideResolvedConfig\n\n readonly events$: Observable<TheSeamGuideEvent> = this._events.asObservable()\n readonly afterClosed$: Observable<TheSeamGuideResult> =\n this._afterClosed.asObservable()\n readonly activeIndex: Signal<number> = this._activeIndex.asReadonly()\n\n private readonly _adapter: TheSeamGuideAdapter\n private readonly _registry: TheSeamGuideTargetRegistry\n private readonly _contentRenderer: TheSeamGuideContentRenderer\n private readonly _getRef: () => TheSeamGuideRef\n private readonly _slots: StepSlots[] = []\n private readonly _popoverDefaults: TheSeamGuidePopover\n private readonly _sessionPopover: TheSeamGuidePopover | undefined\n private readonly _onClosed: (session: TheSeamGuideSession) => void\n\n constructor(config: TheSeamGuideConfig, deps: TheSeamGuideSessionDeps) {\n this._adapter = deps.adapter\n this._registry = deps.registry\n this._contentRenderer = deps.contentRenderer\n this._getRef = deps.getRef\n this._popoverDefaults = deps.popoverDefaults\n this._sessionPopover = config.popover\n this._onClosed = deps.onClosed\n\n this.steps = config.steps\n this.options = { ...THE_SEAM_GUIDE_DEFAULTS, ...stripUndefined(config) }\n\n this._transitionSub = this._transitions\n .pipe(\n switchMap((request) =>\n this._runTransition(request.index, request.direction),\n ),\n )\n .subscribe()\n }\n\n get dismissible(): boolean {\n return this.options.dismissible\n }\n\n start(): void {\n this._buildSlots()\n this._adapter.start(\n {\n steps: this.steps.map((step, index) =>\n this._toAdapterStep(step, index),\n ),\n allowUserDismiss: this.options.dismissible,\n },\n {\n onNextRequested: () => this.next(),\n onPreviousRequested: () => this.previous(),\n onCloseRequested: () => this.close('dismissed'),\n },\n )\n this._emit({ type: 'started' })\n this.moveTo(0)\n }\n\n next(): void {\n this._request(this._activeIndex() + 1, 1)\n }\n\n previous(): void {\n this._request(this._activeIndex() - 1, -1)\n }\n\n moveTo(index: number): void {\n this._request(index, index >= this._activeIndex() ? 1 : -1)\n }\n\n /**\n * Requests a transition.\n *\n * The emission is deferred to a microtask because `_applyMissPolicy` calls\n * this from *inside* the `switchMap` projection. Emitting synchronously there\n * would make the transition cancel itself mid-flight. `fakeAsync`'s `tick()`\n * flushes microtasks, so specs are unaffected.\n */\n private _request(index: number, direction: 1 | -1): void {\n if (this._closed) {\n return\n }\n queueMicrotask(() => {\n if (this._closed) {\n return\n }\n this._transitions.next({ index, direction })\n })\n }\n\n refresh(): void {\n this._adapter.refresh()\n }\n\n close(reason: TheSeamGuideCloseReason): void {\n if (this._closed) {\n return\n }\n this._closed = true\n this._transitionSub?.unsubscribe()\n this._transitionSub = null\n this._disarmRecovery()\n const result: TheSeamGuideResult = {\n reason,\n lastIndex: this._activeIndex(),\n }\n this._adapter.destroy()\n this._destroyAllSlots()\n this._emit({ type: 'closed', result })\n this._afterClosed.next(result)\n this._afterClosed.complete()\n this._events.complete()\n this._onClosed(this)\n }\n\n protected _emit(event: TheSeamGuideEvent): void {\n this._events.next(event)\n }\n\n /**\n * The one sequence every transition runs. Cancellable: a new request causes\n * `switchMap` to unsubscribe from this, so nothing paints after teardown.\n *\n * A `catchError` wraps the whole sequence: a hook that throws or rejects\n * must not escape to the outer `_transitions` subscriber, because that\n * subscriber has no error handler of its own and an uncaught error there\n * would unsubscribe it permanently, silently wedging the session (`next`,\n * `previous`, and `moveTo` would become no-ops forever). A caught failure\n * closes the guide rather than running the miss policy: the miss policy\n * exists for a target that never appeared, not an arbitrary thrown error,\n * and reusing it would (a) misreport the close reason as `'targetMissing'`\n * for an `'end'`-policy step that never had a target problem, and (b) run\n * `_applyMissPolicy` unprotected as the last step of an error handler,\n * where a further throw (e.g. from `_paint` → `_onStepPainted`, which\n * Task 7 turns into real logic) would escape to the same unhandled outer\n * subscriber this whole `catchError` exists to protect.\n */\n private _runTransition(\n index: number,\n direction: 1 | -1,\n ): Observable<unknown> {\n if (this._closed) {\n return EMPTY\n }\n this._disarmRecovery()\n if (index >= this.steps.length) {\n this.close('completed')\n return EMPTY\n }\n if (index < 0) {\n return EMPTY\n }\n\n const outgoing =\n this._activeIndex() >= 0 ? this.steps[this._activeIndex()] : undefined\n const incoming = this.steps[index]\n\n const afterStep$ = this._afterStepFired\n ? of(null)\n : defer(() => {\n this._afterStepFired = true\n return this._runHook(outgoing?.afterStep)\n })\n\n const beforeStep$ =\n this._beforeStepFiredFor === index\n ? of(null)\n : defer(() => {\n this._beforeStepFiredFor = index\n return this._runHook(incoming.beforeStep)\n })\n\n return afterStep$.pipe(\n switchMap(() => beforeStep$),\n switchMap(() => this._resolveTarget(incoming)),\n switchMap((outcome) => {\n if (this._closed) {\n return EMPTY\n }\n if (outcome === 'missing') {\n return this._applyMissPolicy(index, incoming, direction)\n }\n this._paint(index, incoming)\n return EMPTY\n }),\n catchError((err) => {\n // Deliberately no call-out to `_applyMissPolicy` or anything else\n // that could itself throw: this handler is the last backstop before\n // the outer, handler-less `_transitions` subscription, so the whole\n // body is wrapped in `try/catch` and swallows on failure — there is\n // nothing left to recover to.\n try {\n if (this._closed) {\n return EMPTY\n }\n if (isDevMode()) {\n console.warn(\n `TheSeamGuideSession: step ${index} threw during its` +\n ` transition (${String(err)}); closing the guide.`,\n )\n }\n this.close('destroyed')\n } catch {\n // Nothing left to recover from.\n }\n return EMPTY\n }),\n )\n }\n\n /** Paints a step that is actually entering: real target or elementless. */\n private _paint(index: number, step: TheSeamGuideStep): void {\n const outgoing = this._activeIndex()\n // Before `moveTo`: driver.js calls `onPopoverRender` synchronously from\n // there, so the host must already hold its view.\n this._renderSlots(index)\n // A content component is given `TheSeamGuideRef` on its element injector,\n // so its constructor runs synchronously inside `_renderSlots` above and\n // can call `ref.close()` re-entrantly. `close()` cannot destroy the view\n // `_renderSlots` just created — it is only assigned into `binding.view`\n // after `render()` returns — so this must destroy it here instead, and\n // must not touch the (already-destroyed) adapter or emit any further\n // events for a session that is no longer open.\n if (this._closed) {\n this._destroySlots(index)\n return\n }\n this._activeIndex.set(index)\n this._afterStepFired = false\n this._beforeStepFiredFor = null\n this._adapter.moveTo(index)\n if (outgoing !== index) {\n this._destroySlots(outgoing)\n }\n this._emit({ type: 'stepChanged', index, step })\n this._onStepPainted(index, step)\n }\n\n private _buildSlots(): void {\n for (const step of this.steps) {\n this._slots.push({\n title: this._bindSlot(step, 'title'),\n description: this._bindSlot(step, 'description'),\n })\n }\n }\n\n private _bindSlot(\n step: TheSeamGuideStep,\n name: 'title' | 'description',\n ): SlotBinding | null {\n const resolved = this._resolveSlot(step, name)\n if (resolved === null) {\n return null\n }\n if (resolved.kind === 'text') {\n return { kind: 'text', text: resolved.text }\n }\n return {\n kind: 'view',\n slot: resolved,\n host: document.createElement('div'),\n view: null,\n }\n }\n\n private _renderSlots(index: number): void {\n const slots = this._slots[index]\n if (slots === undefined) {\n return\n }\n for (const binding of [slots.title, slots.description]) {\n if (\n binding === null ||\n binding.kind !== 'view' ||\n binding.view !== null\n ) {\n continue\n }\n binding.view = this._contentRenderer.render(\n binding.slot,\n this._contentContext(index, binding.slot),\n binding.host,\n )\n }\n }\n\n private _destroySlots(index: number): void {\n const slots = this._slots[index]\n if (slots === undefined) {\n return\n }\n for (const binding of [slots.title, slots.description]) {\n if (\n binding === null ||\n binding.kind !== 'view' ||\n binding.view === null\n ) {\n continue\n }\n binding.view.destroy()\n binding.view = null\n binding.host.replaceChildren()\n }\n }\n\n private _destroyAllSlots(): void {\n for (let index = 0; index < this._slots.length; index++) {\n this._destroySlots(index)\n }\n }\n\n /** `data` is per slot, so the context is built per slot rather than per step. */\n private _contentContext(\n index: number,\n slot: TheSeamGuideViewSlot,\n ): TheSeamGuideContentContext {\n return {\n $implicit: slot.data,\n data: slot.data,\n text: slot.text,\n step: this.steps[index],\n index,\n total: this.steps.length,\n guide: this._getRef(),\n }\n }\n\n /**\n * Arms mid-step loss detection for a painted step.\n *\n * Only named targets are watched — a selector or `Element` has no\n * notification channel, so recovery does not apply to them in v1.\n */\n protected _onStepPainted(index: number, step: TheSeamGuideStep): void {\n // A re-entrant `close()` from inside `_renderSlots` (see `_paint`) can\n // reach here via the same synchronous call stack that `close()` itself\n // triggered — `_paint` returns before calling this when it detects that\n // case, but a defensive check here is what stops `TheSeamGuideTargetRegistry`\n // (`providedIn: 'root'`) from ever seeing a subscription arm for a session\n // that no longer exists to disarm it.\n if (this._closed) {\n return\n }\n this._disarmRecovery()\n const generation = this._recoveryGeneration\n\n const name = typeof step.element === 'string' ? step.element : null\n if (name === null) {\n return\n }\n // `_resolveNow` — not the registry's own `resolve` — is the same lookup\n // that feeds the popover's resolver closure (registry, then selector\n // fallback). Arming and the loss check below must agree with it: a name\n // that also happens to be a live selector (e.g. `'nav'`) must not be\n // treated as lost while the selector still finds it on screen.\n if (this._resolveNow(step) === null) {\n return\n }\n\n this._recoverySub = this._registry.changes$\n .pipe(\n filter((changed) => changed === name),\n filter(() => this._resolveNow(step) === null),\n take(1),\n switchMap(() => {\n this._emit({ type: 'targetLost', index, step })\n const grace = this.options.targetLostGrace\n return this._registry.waitFor(name, grace).pipe(\n map(() => 'recovered' as const),\n catchError(() => of('lost' as const)),\n )\n }),\n tap((outcome) => {\n if (this._closed) {\n return\n }\n if (outcome === 'recovered') {\n this._adapter.refresh()\n this._emit({ type: 'targetRecovered', index, step })\n // Re-arm on a microtask: `_onStepPainted` calls `_disarmRecovery`,\n // which would otherwise unsubscribe this subscription from inside\n // its own `tap`. Guarded by generation: if the session has moved\n // on (another `_disarmRecovery()` ran in between — a transition,\n // or a fresher arm for this same step), this queued re-arm must\n // not resurrect detection for a step that is no longer active.\n queueMicrotask(() => {\n if (!this._closed && this._recoveryGeneration === generation) {\n this._onStepPainted(index, step)\n }\n })\n return\n }\n this._applyTargetLostPolicy(index, step)\n }),\n catchError((err) => {\n // Swallowed deliberately, not silently: a broken recovery pipeline\n // must not close a guide the user is actively reading, but it\n // should still be visible to whoever is developing against it.\n if (isDevMode()) {\n console.warn(\n `TheSeamGuideSession: mid-step recovery for step ${index}` +\n ` threw (${String(err)}); recovery detection for this step` +\n ' is now disarmed.',\n )\n }\n return EMPTY\n }),\n )\n .subscribe()\n }\n\n private _applyTargetLostPolicy(index: number, step: TheSeamGuideStep): void {\n const policy: TheSeamGuideMissPolicy =\n step.onTargetLost ?? this.options.onTargetLost\n\n if (policy === 'end') {\n this.close('targetMissing')\n return\n }\n if (policy === 'skip') {\n this._request(index + 1, 1)\n return\n }\n // 'elementless' — the resolver now returns undefined, so a refresh collapses\n // the popover to centered without a step transition. This is terminal:\n // recovery detection was already disarmed on entry to this branch (the\n // `take(1)` above), and nothing re-arms it afterwards, so if the target\n // returns later the popover stays centered until the next transition.\n this._adapter.refresh()\n }\n\n private _disarmRecovery(): void {\n this._recoveryGeneration++\n this._recoverySub?.unsubscribe()\n this._recoverySub = null\n }\n\n private _runHook(\n hook: (() => void | Promise<void> | Observable<unknown>) | undefined,\n ): Observable<unknown> {\n if (hook === undefined) {\n return of(null)\n }\n return defer(() => {\n const result = hook()\n if (result === undefined || result === null) {\n return of(null)\n }\n if (isObservable(result)) {\n return result.pipe(take(1))\n }\n return from(result)\n })\n }\n\n /** Resolves `'resolved'` or `'missing'`. Never throws. */\n private _resolveTarget(\n step: TheSeamGuideStep,\n ): Observable<'resolved' | 'missing'> {\n const target = step.element\n if (target === undefined) {\n return of('resolved')\n }\n if (typeof target !== 'string') {\n const el = target instanceof Element ? target : target.nativeElement\n return of(el?.isConnected ? 'resolved' : 'missing')\n }\n\n const direct = this._registry.resolve(target)\n if (direct !== null) {\n return of('resolved')\n }\n const selectorMatch = safeQuerySelector(target)\n if (selectorMatch !== null) {\n return of('resolved')\n }\n\n const timeoutMs = step.targetTimeout ?? this.options.targetTimeout\n return this._registry.waitFor(target, timeoutMs).pipe(\n map(() => 'resolved' as const),\n catchError(() => of('missing' as const)),\n )\n }\n\n private _applyMissPolicy(\n index: number,\n step: TheSeamGuideStep,\n direction: 1 | -1,\n ): Observable<never> {\n const policy: TheSeamGuideMissPolicy =\n step.onMissingTarget ?? this.options.onMissingTarget\n\n if (policy === 'end') {\n this.close('targetMissing')\n return EMPTY\n }\n\n if (policy === 'elementless') {\n this._paint(index, step)\n return EMPTY\n }\n\n if (isDevMode()) {\n console.warn(\n `TheSeamGuideSession: skipping step ${index} because its target` +\n ` \"${String(step.element)}\" never appeared.`,\n )\n }\n this._emit({ type: 'stepSkipped', index, step })\n\n const nextIndex = index + direction\n if (nextIndex < 0 || nextIndex >= this.steps.length) {\n this.close(direction === 1 ? 'completed' : 'dismissed')\n return EMPTY\n }\n this._request(nextIndex, direction)\n return EMPTY\n }\n\n /** Element is a resolver function so the engine re-resolves at paint time. */\n protected _toAdapterStep(\n step: TheSeamGuideStep,\n index: number,\n ): TheSeamGuideAdapterStep {\n return {\n element:\n step.element === undefined\n ? undefined\n : () => this._resolveNow(step) ?? undefined,\n popover: this._toAdapterPopover(step, index),\n }\n }\n\n /**\n * `ExhaustiveMap` makes every key of `TheSeamGuidePopover` required in\n * `mapped`, so adding a field to the popover is a compile error here until\n * it is carried through. This is the exact hop on which `side` and `align`\n * were once silently dropped by a spread.\n */\n private _toAdapterPopover(\n step: TheSeamGuideStep,\n index: number,\n ): TheSeamGuideAdapterPopover | undefined {\n const slots = this._slots[index]\n const mapped: ExhaustiveMap<\n TheSeamGuidePopover,\n TheSeamGuideAdapterPopover\n > = {\n title: slotValue(slots?.title),\n description: slotValue(slots?.description),\n side: this._nearestScalar(step, 'side'),\n align: this._nearestScalar(step, 'align'),\n }\n\n return Object.values(mapped).every((value) => value === undefined)\n ? undefined\n : mapped\n }\n\n private _resolveSlot(step: TheSeamGuideStep, name: 'title' | 'description') {\n return resolveGuideContentSlot({\n provider: this._popoverDefaults[name],\n session: this._sessionPopover?.[name],\n step: step.popover?.[name],\n })\n }\n\n private _nearestScalar<K extends 'side' | 'align'>(\n step: TheSeamGuideStep,\n key: K,\n ): TheSeamGuidePopover[K] {\n return (\n step.popover?.[key] ??\n this._sessionPopover?.[key] ??\n this._popoverDefaults[key]\n )\n }\n\n /**\n * Synchronous best-effort resolution, used by the adapter's live element\n * resolver at paint time. `_resolveTarget` is the awaiting version used to\n * gate transitions.\n */\n protected _resolveNow(step: TheSeamGuideStep): Element | null {\n const target = step.element\n if (target === undefined) {\n return null\n }\n if (typeof target === 'string') {\n return this._registry.resolve(target) ?? safeQuerySelector(target)\n }\n if (target instanceof Element) {\n return target\n }\n return target.nativeElement\n }\n}\n\nfunction stripUndefined(\n config: TheSeamGuideConfig,\n): Partial<TheSeamGuideResolvedConfig> {\n const { steps: _steps, popover: _popover, ...rest } = config\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(rest)) {\n if (value !== undefined) {\n out[key] = value\n }\n }\n return out as Partial<TheSeamGuideResolvedConfig>\n}\n\n/** A text slot goes to the engine as a string; a view slot as its host node. */\nfunction slotValue(\n binding: SlotBinding | null | undefined,\n): string | HTMLElement | undefined {\n if (binding === null || binding === undefined) {\n return undefined\n }\n return binding.kind === 'text' ? binding.text : binding.host\n}\n\n/** `querySelector` throws on an invalid selector; a registry name often is one. */\nfunction safeQuerySelector(selector: string): Element | null {\n try {\n return document.querySelector(selector)\n } catch {\n return null\n }\n}\n","import {\n inject,\n Injectable,\n isDevMode,\n OnDestroy,\n signal,\n Signal,\n} from '@angular/core'\n\nimport { THE_SEAM_GUIDE_ADAPTER } from './adapter/guide-adapter'\nimport { TheSeamGuideDomContentRenderer } from './content/guide-content.renderer'\nimport { THE_SEAM_GUIDE_POPOVER_DEFAULTS } from './guide-providers'\nimport { TheSeamGuideRef } from './guide-ref'\nimport { TheSeamGuideSession } from './guide-session'\nimport {\n TheSeamGuideConfig,\n THE_SEAM_GUIDE_DEFAULTS,\n} from './models/guide-config'\nimport { TheSeamGuideBusyError } from './models/guide-errors'\nimport { TheSeamGuideStep } from './models/guide-step'\nimport { TheSeamGuideTargetRegistry } from './target/guide-target-registry'\n\n@Injectable({ providedIn: 'root' })\nexport class TheSeamGuideService implements OnDestroy {\n private readonly _adapter = inject(THE_SEAM_GUIDE_ADAPTER)\n private readonly _registry = inject(TheSeamGuideTargetRegistry)\n private readonly _popoverDefaults =\n inject(THE_SEAM_GUIDE_POPOVER_DEFAULTS, { optional: true }) ?? {}\n private readonly _contentRenderer = inject(TheSeamGuideDomContentRenderer)\n\n private readonly _activeGuide = signal<TheSeamGuideRef | null>(null)\n\n /**\n * The running guide, or null. Exposed so a caller can queue itself:\n * `activeGuide()?.afterClosed$.subscribe(() => start(next))`.\n */\n readonly activeGuide: Signal<TheSeamGuideRef | null> =\n this._activeGuide.asReadonly()\n\n /**\n * Starts a guide. One runs at a time: a dismissible active guide is\n * superseded, a non-dismissible one throws `TheSeamGuideBusyError`.\n *\n * The caller owns the returned ref's lifetime. A guide is **not** closed\n * automatically when the component that started it is destroyed — only\n * when the root injector is (this service is `providedIn: 'root'`), which\n * does not happen on ordinary route/component teardown. A component that\n * starts a guide and may be destroyed before it naturally ends should tie\n * the ref to its own lifetime:\n *\n * ```ts\n * const ref = this._guide.start(config)\n * inject(DestroyRef).onDestroy(() => ref.close())\n * ```\n */\n start(config: TheSeamGuideConfig): TheSeamGuideRef {\n const active = this._activeGuide()\n if (active !== null) {\n if (!active.dismissible) {\n throw new TheSeamGuideBusyError()\n }\n active.close('superseded')\n }\n\n if (\n isDevMode() &&\n config.dismissible === false &&\n (config.onMissingTarget ?? THE_SEAM_GUIDE_DEFAULTS.onMissingTarget) ===\n 'skip'\n ) {\n console.warn(\n 'TheSeamGuideService: this guide sets `dismissible: false` with' +\n \" `onMissingTarget: 'skip'`, so the user is forced through a guide\" +\n ' that may silently drop its own steps. Consider onMissingTarget:' +\n \" 'end' or 'elementless'.\",\n )\n }\n\n // eslint-disable-next-line prefer-const -- captured by the closure below before assignment\n let ref: TheSeamGuideRef\n const session = new TheSeamGuideSession(config, {\n adapter: this._adapter,\n registry: this._registry,\n contentRenderer: this._contentRenderer,\n popoverDefaults: this._popoverDefaults,\n getRef: () => ref,\n onClosed: () => this._clearIfCurrent(ref),\n })\n ref = new TheSeamGuideRef(session)\n this._activeGuide.set(ref)\n session.start()\n return ref\n }\n\n /**\n * Highlights a single element. A one-step guide.\n *\n * As with {@link start}, the caller owns the returned ref's lifetime: it is\n * not closed automatically when the component that requested it is\n * destroyed. See {@link start}'s doc comment for the `DestroyRef` pattern.\n */\n highlight(step: TheSeamGuideStep): TheSeamGuideRef {\n return this.start({ steps: [step] })\n }\n\n /**\n * Closes any active guide when the owning injector is destroyed —\n * otherwise driver.js's overlay is left in the DOM, and its\n * `pointer-events: none` blocks every click on the page with no recovery\n * short of a reload. `close` always works programmatically even when the\n * guide is `dismissible: false`, which is exactly the case that must not\n * be left behind.\n */\n ngOnDestroy(): void {\n this._activeGuide()?.close('destroyed')\n }\n\n private _clearIfCurrent(ref: TheSeamGuideRef): void {\n if (this._activeGuide() === ref) {\n this._activeGuide.set(null)\n }\n }\n}\n","import {\n TheSeamGuideContentContext,\n TheSeamGuideContentRenderer,\n TheSeamGuideContentView,\n TheSeamGuideViewSlot,\n} from '../models/guide-content'\n\nexport interface TheSeamFakeGuideContentRender {\n slot: TheSeamGuideViewSlot\n context: TheSeamGuideContentContext\n host: HTMLElement\n destroyed: boolean\n}\n\n/**\n * Angular-free renderer for specs. Records what the session asked to render so\n * a test can assert view lifetime without a `TestBed`.\n */\nexport class TheSeamFakeGuideContentRenderer\n implements TheSeamGuideContentRenderer\n{\n readonly renders: TheSeamFakeGuideContentRender[] = []\n\n render(\n slot: TheSeamGuideViewSlot,\n context: TheSeamGuideContentContext,\n host: HTMLElement,\n ): TheSeamGuideContentView {\n const record: TheSeamFakeGuideContentRender = {\n slot,\n context,\n host,\n destroyed: false,\n }\n this.renders.push(record)\n host.textContent = context.text ?? ''\n return {\n destroy: () => {\n record.destroyed = true\n },\n }\n }\n\n /** Renders that have not been destroyed. */\n get live(): TheSeamFakeGuideContentRender[] {\n return this.renders.filter((r) => !r.destroyed)\n }\n}\n","import {\n TheSeamGuideAdapter,\n TheSeamGuideAdapterCallbacks,\n TheSeamGuideAdapterConfig,\n} from '../adapter/guide-adapter'\n\n/**\n * Engine-free adapter for specs. Records what the service asked for and lets a\n * test simulate user intent without a DOM.\n */\nexport class TheSeamFakeGuideAdapter implements TheSeamGuideAdapter {\n readonly calls: string[] = []\n\n startedConfig: TheSeamGuideAdapterConfig | null = null\n\n private _callbacks: TheSeamGuideAdapterCallbacks | null = null\n private _active = false\n\n start(\n config: TheSeamGuideAdapterConfig,\n callbacks: TheSeamGuideAdapterCallbacks,\n ): void {\n this.startedConfig = config\n this._callbacks = callbacks\n this._active = true\n this.calls.push('start')\n }\n\n next(): void {\n this.calls.push('next')\n }\n\n previous(): void {\n this.calls.push('previous')\n }\n\n moveTo(index: number): void {\n this.calls.push(`moveTo:${index}`)\n }\n\n refresh(): void {\n this.calls.push('refresh')\n }\n\n destroy(): void {\n this._active = false\n // Dropped, not merely inert-by-`_active`: `emitNext`/`emitPrevious`/\n // `emitClose` call through `_callbacks` directly and do not consult\n // `_active`, so a stale reference here would still fire callbacks a test\n // simulates after destroy.\n this._callbacks = null\n this.calls.push('destroy')\n }\n\n isActive(): boolean {\n return this._active\n }\n\n /** Resolves the element for a step, as the engine would at paint time. */\n resolveStepElement(index: number): Element | undefined {\n return this.startedConfig?.steps[index]?.element?.()\n }\n\n emitNext(): void {\n this._callbacks?.onNextRequested()\n }\n\n emitPrevious(): void {\n this._callbacks?.onPreviousRequested()\n }\n\n emitClose(): void {\n this._callbacks?.onCloseRequested()\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAkEA;MACa,sBAAsB,GACjC,IAAI,cAAc,CAA6B,wBAAwB;;AC3BlE,MAAM,uBAAuB,GAA+B;AACjE,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,eAAe,EAAE,MAAM;AACvB,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,YAAY,EAAE,aAAa;;;AC9CvB,MAAO,qBAAsB,SAAQ,KAAK,CAAA;AAC9C,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CACH,mEAAmE;AACjE,YAAA,+DAA+D,CAClE;AACD,QAAA,IAAI,CAAC,IAAI,GAAG,uBAAuB;IACrC;AACD;AAEK,MAAO,8BAA+B,SAAQ,KAAK,CAAA;AAC3B,IAAA,UAAA;AAA5B,IAAA,WAAA,CAA4B,UAAkB,EAAA;AAC5C,QAAA,KAAK,CAAC,CAAA,4CAAA,EAA+C,UAAU,CAAA,EAAA,CAAI,CAAC;QAD1C,IAAA,CAAA,UAAU,GAAV,UAAU;AAEpC,QAAA,IAAI,CAAC,IAAI,GAAG,gCAAgC;IAC9C;AACD;;ACTD;;;AAGG;MAEU,0BAA0B,CAAA;AACpB,IAAA,QAAQ,GAAG,IAAI,GAAG,EAAqB;AACvC,IAAA,QAAQ,GAAG,IAAI,OAAO,EAAU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|
|
|
1
|
+
@import './styles/utilities';
|
|
2
|
+
|
|
3
|
+
// driver.js base styles.
|
|
4
|
+
//
|
|
5
|
+
// Because this specifier ends in `.css`, Sass does not resolve or inline it:
|
|
6
|
+
// it emits a plain CSS `@import` verbatim and leaves resolution to whatever
|
|
7
|
+
// bundles the emitted CSS afterward (Storybook works because webpack's
|
|
8
|
+
// css-loader resolves it at that later stage). This is unlike a Sass partial
|
|
9
|
+
// import, which Sass itself resolves and inlines at compile time.
|
|
10
|
+
//
|
|
11
|
+
// The `.css` extension is required and must not be dropped. driver.js's
|
|
12
|
+
// package.json `exports` map publishes only `./dist/driver.css`, so the
|
|
13
|
+
// extensionless form fails to resolve. This differs from the neighbouring
|
|
14
|
+
// precedents in theme.scss: `@angular/cdk` deliberately publishes both
|
|
15
|
+
// `./overlay-prebuilt.css` and `./overlay-prebuilt`, and `overlayscrollbars`
|
|
16
|
+
// has no `exports` map at all, so both tolerate the extensionless form.
|
|
17
|
+
@import 'driver.js/dist/driver.css';
|
|
18
|
+
|
|
19
|
+
.driver-popover {
|
|
20
|
+
background-color: $seam-guide-popover-bg;
|
|
21
|
+
color: $seam-guide-popover-color;
|
|
22
|
+
border-radius: $seam-guide-popover-border-radius;
|
|
23
|
+
max-width: $seam-guide-popover-max-width;
|
|
24
|
+
font-family: $font-family-base;
|
|
25
|
+
font-size: $font-size-base;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.driver-popover-title {
|
|
29
|
+
font-size: $font-size-lg;
|
|
30
|
+
font-weight: $font-weight-bold;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// driver.js hard-codes the arrow to `border: 5px solid #fff` and then zeroes
|
|
34
|
+
// out three of the four sides per `driver-popover-arrow-side-*` class,
|
|
35
|
+
// leaving the remaining side as the visible triangle. Follow
|
|
36
|
+
// $seam-guide-popover-bg through so the arrow matches an overridden popover
|
|
37
|
+
// background instead of staying stray white.
|
|
38
|
+
.driver-popover-arrow {
|
|
39
|
+
border-color: transparent;
|
|
40
|
+
|
|
41
|
+
&.driver-popover-arrow-side-left {
|
|
42
|
+
border-left-color: $seam-guide-popover-bg;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.driver-popover-arrow-side-right {
|
|
46
|
+
border-right-color: $seam-guide-popover-bg;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.driver-popover-arrow-side-top {
|
|
50
|
+
border-top-color: $seam-guide-popover-bg;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.driver-popover-arrow-side-bottom {
|
|
54
|
+
border-bottom-color: $seam-guide-popover-bg;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// `.btn`/`.btn-sm`/`.btn-primary`/`.btn-secondary` are not available to
|
|
59
|
+
// `@extend` here: `./styles/utilities` (like the global `styles/utilities`
|
|
60
|
+
// it wraps) only pulls in Bootstrap's variables, functions, and mixins, not
|
|
61
|
+
// the `.btn` rule itself. Reproduce the button look with the same mixins
|
|
62
|
+
// Bootstrap's own button classes use instead. These properties mirror
|
|
63
|
+
// Bootstrap 4.6.x's `.btn` base rule in `bootstrap/scss/_buttons.scss` — diff
|
|
64
|
+
// against that file on a Bootstrap version bump.
|
|
65
|
+
.driver-popover-next-btn,
|
|
66
|
+
.driver-popover-prev-btn {
|
|
67
|
+
display: inline-block;
|
|
68
|
+
font-weight: $btn-font-weight;
|
|
69
|
+
text-align: center;
|
|
70
|
+
white-space: $btn-white-space;
|
|
71
|
+
vertical-align: middle;
|
|
72
|
+
user-select: none;
|
|
73
|
+
border: $btn-border-width solid transparent;
|
|
74
|
+
@include transition($btn-transition);
|
|
75
|
+
@include button-size(
|
|
76
|
+
$btn-padding-y-sm,
|
|
77
|
+
$btn-padding-x-sm,
|
|
78
|
+
$btn-font-size-sm,
|
|
79
|
+
$btn-line-height-sm,
|
|
80
|
+
$btn-border-radius-sm
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
&:focus,
|
|
84
|
+
&.focus {
|
|
85
|
+
outline: 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.driver-popover-next-btn {
|
|
90
|
+
@include button-variant($primary, $primary);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.driver-popover-prev-btn {
|
|
94
|
+
@include button-variant($secondary, $secondary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// driver.js sets `fill` and `opacity` as inline styles on the overlay's
|
|
98
|
+
// child `<path>`, not on `.driver-overlay` itself, and an inline style beats
|
|
99
|
+
// any selector without `!important`. Same defect class as the
|
|
100
|
+
// `.driver-popover-arrow` fix above: driver.js owns the element, so its
|
|
101
|
+
// inline styles must be beaten explicitly rather than assumed away.
|
|
102
|
+
.driver-overlay path {
|
|
103
|
+
fill: $seam-guide-overlay-color !important;
|
|
104
|
+
opacity: $seam-guide-overlay-opacity !important;
|
|
105
|
+
}
|