@signality/core 0.1.3 → 0.2.0

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.
Files changed (36) hide show
  1. package/browser/device-pixel-ratio/index.d.ts +30 -0
  2. package/browser/index.d.ts +1 -0
  3. package/browser/listener/index.d.ts +1 -0
  4. package/browser/picture-in-picture/index.d.ts +1 -5
  5. package/browser/web-notification/index.d.ts +3 -3
  6. package/fesm2022/signality-core-browser-clipboard.mjs +11 -29
  7. package/fesm2022/signality-core-browser-clipboard.mjs.map +1 -1
  8. package/fesm2022/signality-core-browser-device-pixel-ratio.mjs +45 -0
  9. package/fesm2022/signality-core-browser-device-pixel-ratio.mjs.map +1 -0
  10. package/fesm2022/signality-core-browser-eye-dropper.mjs +2 -3
  11. package/fesm2022/signality-core-browser-eye-dropper.mjs.map +1 -1
  12. package/fesm2022/signality-core-browser-fullscreen.mjs +7 -19
  13. package/fesm2022/signality-core-browser-fullscreen.mjs.map +1 -1
  14. package/fesm2022/signality-core-browser-gamepad.mjs +2 -10
  15. package/fesm2022/signality-core-browser-gamepad.mjs.map +1 -1
  16. package/fesm2022/signality-core-browser-listener.mjs.map +1 -1
  17. package/fesm2022/signality-core-browser-picture-in-picture.mjs +8 -12
  18. package/fesm2022/signality-core-browser-picture-in-picture.mjs.map +1 -1
  19. package/fesm2022/signality-core-browser-storage.mjs +19 -44
  20. package/fesm2022/signality-core-browser-storage.mjs.map +1 -1
  21. package/fesm2022/signality-core-browser-vibration.mjs +14 -29
  22. package/fesm2022/signality-core-browser-vibration.mjs.map +1 -1
  23. package/fesm2022/signality-core-browser-web-notification.mjs +32 -53
  24. package/fesm2022/signality-core-browser-web-notification.mjs.map +1 -1
  25. package/fesm2022/signality-core-browser-web-share.mjs +3 -11
  26. package/fesm2022/signality-core-browser-web-share.mjs.map +1 -1
  27. package/fesm2022/signality-core-browser.mjs +1 -0
  28. package/fesm2022/signality-core-browser.mjs.map +1 -1
  29. package/fesm2022/signality-core-forms-cva.mjs +13 -3
  30. package/fesm2022/signality-core-forms-cva.mjs.map +1 -1
  31. package/fesm2022/signality-core-internal.mjs +34 -2
  32. package/fesm2022/signality-core-internal.mjs.map +1 -1
  33. package/forms/cva/index.d.ts +10 -5
  34. package/internal/utils/index.d.ts +1 -0
  35. package/internal/utils/wait-for-value.d.ts +6 -0
  36. package/package.json +5 -1
@@ -1,4 +1,4 @@
1
- import { InjectionToken, inject, PLATFORM_ID, assertInInjectionContext, INJECTOR, runInInjectionContext, DestroyRef, untracked, isSignal, ElementRef } from '@angular/core';
1
+ import { InjectionToken, inject, PLATFORM_ID, assertInInjectionContext, INJECTOR, runInInjectionContext, DestroyRef, untracked, isSignal, effect, ElementRef } from '@angular/core';
2
2
  import { isPlatformBrowser, isPlatformServer } from '@angular/common';
3
3
  import { SIGNAL, SIGNAL_NODE } from '@angular/core/primitives/signals';
4
4
 
@@ -184,6 +184,38 @@ function createToken(factory, providedIn = 'root') {
184
184
  return new InjectionToken(ngDevMode ? factory.name : '', { factory, providedIn });
185
185
  }
186
186
 
187
+ /**
188
+ * Resolves the first available value of a signal as a Promise.
189
+ * @internal
190
+ */
191
+ function waitForValue(source, injector) {
192
+ const { runInContext } = setupContext(injector, waitForValue);
193
+ return runInContext(() => {
194
+ try {
195
+ // Try to read the signal synchronously
196
+ return Promise.resolve(source());
197
+ }
198
+ catch {
199
+ // Required signals (input, model, queries) throw when read outside a reactive context
200
+ // during initialization, fall back to reading the value inside an effect
201
+ return new Promise((resolve, reject) => {
202
+ const effectRef = effect(() => {
203
+ try {
204
+ const value = source();
205
+ resolve(value);
206
+ }
207
+ catch (e) {
208
+ reject(e);
209
+ }
210
+ finally {
211
+ effectRef.destroy();
212
+ }
213
+ }, ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
214
+ });
215
+ }
216
+ });
217
+ }
218
+
187
219
  /**
188
220
  * Determines if a signal is a query signal (viewChild, contentChild).
189
221
  * Query signals have a special internal structure with a `_dirtyCounter` property that tracks
@@ -287,5 +319,5 @@ function isAcceptedFile(file, accept) {
287
319
  * Generated bundle index. Do not edit.
288
320
  */
289
321
 
290
- export { ALWAYS_FALSE_FN, IS_BROWSER, IS_MOBILE, IS_SERVER, MOBILE_REGEX, NOOP_ASYNC_FN, NOOP_EFFECT_REF, NOOP_FN, assertElement, assertEventTarget, constSignal, createToken, getActiveElement, getEventTarget, getPipElement, getShadowRoot, isAcceptedFile, isElement, isEventTarget, isNodeWithin, isPlainObject, isQuerySignal, isWindow, proxySignal, setupContext, unrefElement };
322
+ export { ALWAYS_FALSE_FN, IS_BROWSER, IS_MOBILE, IS_SERVER, MOBILE_REGEX, NOOP_ASYNC_FN, NOOP_EFFECT_REF, NOOP_FN, assertElement, assertEventTarget, constSignal, createToken, getActiveElement, getEventTarget, getPipElement, getShadowRoot, isAcceptedFile, isElement, isEventTarget, isNodeWithin, isPlainObject, isQuerySignal, isWindow, proxySignal, setupContext, unrefElement, waitForValue };
291
323
  //# sourceMappingURL=signality-core-internal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"signality-core-internal.mjs","sources":["../../../projects/core/internal/constants/mobile-regex.ts","../../../projects/core/internal/constants/stubs.ts","../../../projects/core/internal/providers/is-browser.ts","../../../projects/core/internal/providers/is-mobile.ts","../../../projects/core/internal/providers/is-server.ts","../../../projects/core/internal/utils/bom/is-window.ts","../../../projects/core/internal/utils/dom/get-active-element.ts","../../../projects/core/internal/utils/dom/get-event-target.ts","../../../projects/core/internal/utils/dom/get-pip-element.ts","../../../projects/core/internal/utils/dom/get-shadow-root.ts","../../../projects/core/internal/utils/dom/is-element.ts","../../../projects/core/internal/utils/dom/is-event-target.ts","../../../projects/core/internal/utils/dom/is-node-within.ts","../../../projects/core/internal/utils/assert.ts","../../../projects/core/internal/utils/context.ts","../../../projects/core/internal/utils/create-token.ts","../../../projects/core/internal/utils/is-query-signal.ts","../../../projects/core/internal/utils/is-plain-object.ts","../../../projects/core/internal/utils/const-signal.ts","../../../projects/core/internal/utils/proxy-signal.ts","../../../projects/core/internal/utils/unref-element.ts","../../../projects/core/internal/utils/files/is-accepted-file.ts","../../../projects/core/internal/signality-core-internal.ts"],"sourcesContent":["export const MOBILE_REGEX = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n","/**\n * Empty synchronous function stub.\n * Used for SSR compatibility when returning method functions in Ref objects that should do nothing on the server.\n *\n * Example: `close: NOOP_FN` in {@link WebNotificationRef}\n */\nexport const NOOP_FN: (...args: any[]) => void = () => {\n /* empty */\n};\n\n/**\n * Empty asynchronous function stub that returns a resolved Promise.\n * Used for SSR compatibility when returning async method functions in Ref objects that should do nothing on the server.\n *\n * Example: `share: NOOP_ASYNC_FN` in {@link WebShareRef}\n */\nexport const NOOP_ASYNC_FN = () => Promise.resolve();\n\n/**\n * Frozen EffectRef stub with a no-op destroy method.\n * Used for SSR compatibility when returning EffectRef from observer utilities (ResizeObserver, MutationObserver, etc.)\n * that cannot run on the server. Prevents errors when calling destroy() on server-rendered refs.\n *\n * Example: `return NOOP_EFFECT_REF` in {@link resizeObserver}\n */\nexport const NOOP_EFFECT_REF = { destroy: NOOP_FN };\n\n/**\n * Equality function that always returns false, forcing signal updates on every change.\n * Used for signals that hold mutable objects (like Selection, Range) where reference equality is not sufficient\n * and we need to detect changes even when the object structure appears the same.\n *\n * Example: `signal<Selection | null>(null, { equal: ALWAYS_FALSE_FN })` in {@link textSelection}\n */\nexport const ALWAYS_FALSE_FN = () => false;\n","import { inject, InjectionToken, PLATFORM_ID } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nexport const IS_BROWSER = new InjectionToken<boolean>(ngDevMode ? 'IS_BROWSER' : '', {\n providedIn: 'platform',\n factory: () => isPlatformBrowser(inject(PLATFORM_ID)),\n});\n","import { inject, InjectionToken } from '@angular/core';\nimport { MOBILE_REGEX } from '../constants';\nimport { IS_BROWSER } from './is-browser';\n\nexport const IS_MOBILE = new InjectionToken<boolean>(ngDevMode ? 'IS_MOBILE' : '', {\n providedIn: 'platform',\n factory: () => {\n return inject(IS_BROWSER) ? MOBILE_REGEX.test(navigator.userAgent) : false;\n },\n});\n","import { inject, InjectionToken, PLATFORM_ID } from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\n\nexport const IS_SERVER = new InjectionToken<boolean>(ngDevMode ? 'IS_SERVER' : '', {\n providedIn: 'platform',\n factory: () => isPlatformServer(inject(PLATFORM_ID)),\n});\n","export function isWindow(obj: object | null): obj is Window {\n return !!obj && (obj as Window).window === obj;\n}\n","export function getActiveElement(document: Document): Element | null {\n let activeElement = document.activeElement;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\n}\n","export function getEventTarget<T extends EventTarget>(event: Event): T | null {\n return (event.composedPath ? event.composedPath()[0] : event.target) as T | null;\n}\n","export function getPipElement(document: Document): Element | null {\n let pipElement = document.pictureInPictureElement;\n\n while (pipElement && pipElement.shadowRoot) {\n const newPipElement = pipElement.shadowRoot.pictureInPictureElement;\n if (newPipElement === pipElement) {\n break;\n } else {\n pipElement = newPipElement;\n }\n }\n\n return pipElement;\n}\n","export function getShadowRoot(element: Element | null): ShadowRoot | null {\n const rootNode = element?.getRootNode ? element.getRootNode() : null;\n\n if (rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n\n return null;\n}\n","export function isElement(value: unknown): value is Element {\n return !!value && (value as Element).nodeType === Node.ELEMENT_NODE;\n}\n","export function isEventTarget(value: unknown): value is EventTarget {\n return typeof (value as EventTarget)?.addEventListener === 'function';\n}\n","export function isNodeWithin(node: Node, root: Element): boolean {\n return root === node || root.contains(node) || (root.shadowRoot?.contains(node) ?? false);\n}\n","import { isElement, isEventTarget } from './dom';\n\nexport function assertElement(value: unknown, source: string): asserts value is Element {\n if (!isElement(value)) {\n throw new Error(\n `[${source}] Expected a DOM Element, ElementRef but received: ${\n (value as object).constructor?.name ?? typeof value\n }. ` +\n `If you are using viewChild/contentChild, make sure to specify \"{ read: ElementRef }\" to avoid implicit directive references.`\n );\n }\n}\n\nexport function assertEventTarget(value: unknown, source: string): asserts value is EventTarget {\n if (!isEventTarget(value)) {\n throw new Error(\n `[${source}] Expected an EventTarget, ElementRef but received: ${\n (value as object).constructor?.name ?? typeof value\n }. ` +\n `If you are using viewChild/contentChild, specify \"{ read: ElementRef }\" to avoid implicit directive references.`\n );\n }\n}\n","import {\n assertInInjectionContext,\n DestroyRef,\n inject,\n type Injector,\n INJECTOR,\n isSignal,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\nimport { SIGNAL, type SignalNode } from '@angular/core/primitives/signals';\nimport { IS_BROWSER, IS_MOBILE, IS_SERVER } from '../providers';\n\nexport interface ContextRef {\n readonly injector: Injector;\n readonly isServer: boolean;\n readonly isBrowser: boolean;\n readonly isMobile: boolean;\n readonly onCleanup: (cleanupFn: () => void) => void;\n}\n\nexport interface SetupContextRef {\n runInContext<T>(fn: (context: ContextRef) => T): T;\n}\n\n/**\n * @internal\n *\n * @param injector - injector to use for context\n * @param debugFn - context owner function\n */\nexport function setupContext(\n injector?: Injector,\n debugFn?: (...args: any[]) => any\n): SetupContextRef {\n if (typeof ngDevMode !== 'undefined' && ngDevMode && !injector) {\n assertInInjectionContext(debugFn || setupContext);\n }\n\n const ctxInjector = injector || inject(INJECTOR);\n\n return {\n runInContext<T>(fn: (context: ContextRef) => T): T {\n return runInContextImpl(fn, ctxInjector, debugFn || setupContext);\n },\n };\n}\n\nfunction runInContextImpl<T>(\n fn: (context: ContextRef) => T,\n injector: Injector,\n debugFn: (...args: any[]) => any\n): T {\n const result = runInInjectionContext(injector, () => {\n const isBrowser = inject(IS_BROWSER);\n const isServer = inject(IS_SERVER);\n const isMobile = inject(IS_MOBILE);\n const destroyRef = inject(DestroyRef);\n\n const onCleanup = (cleanupFn: () => void) => {\n destroyRef.onDestroy(cleanupFn);\n };\n\n return untracked(() => fn({ injector, isBrowser, isServer, isMobile, onCleanup }));\n });\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode && result != null) {\n setupDebugInfo(result, debugFn);\n }\n\n return result;\n}\n\nfunction setupDebugInfo<T>(value: T, debugFn: (...args: any[]) => any): T {\n if (isSignal(value)) {\n setDebugName(value, debugFn);\n } else if (value && typeof value === 'object') {\n for (const [postfix, maybeSignal] of Object.entries(value)) {\n if (isSignal(maybeSignal)) {\n setDebugName(maybeSignal, debugFn, postfix);\n }\n }\n }\n\n return value;\n}\n\nfunction setDebugName(\n signal: Signal<unknown>,\n debugFn: (...args: any[]) => any,\n postfix?: string\n): void {\n const node = signal[SIGNAL] as SignalNode<unknown>;\n\n if (node.debugName === undefined) {\n node.debugName = debugFn.name + (postfix ? '.' + postfix : '');\n }\n}\n","import { InjectionToken, type ProviderToken } from '@angular/core';\n\n/**\n * Creates an Angular InjectionToken with a factory function.\n * @internal\n */\nexport function createToken<T>(\n factory: () => T,\n providedIn: ProvidedIn = 'root'\n): ProviderToken<T> {\n return new InjectionToken(ngDevMode ? factory.name : '', { factory, providedIn });\n}\n\ntype ProvidedIn = NonNullable<ConstructorParameters<typeof InjectionToken>[1]>['providedIn'];\n","import { isSignal, type Signal } from '@angular/core';\nimport { SIGNAL } from '@angular/core/primitives/signals';\n\n/**\n * Determines if a signal is a query signal (viewChild, contentChild).\n * Query signals have a special internal structure with a `_dirtyCounter` property that tracks\n * when query results change.\n\n * See: https://github.com/angular/angular/blob/main/packages/core/src/render3/queries/query_reactive.ts#L43\n * @internal\n */\nexport function isQuerySignal(val: unknown): val is Signal<unknown> {\n if (!isSignal(val)) {\n return false;\n }\n\n const node = val[SIGNAL] as object;\n return '_dirtyCounter' in node;\n}\n","export function isPlainObject(value: unknown): value is Record<PropertyKey, unknown> {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n}\n","import type { Signal } from '@angular/core';\nimport {\n SIGNAL,\n SIGNAL_NODE,\n type SignalGetter,\n type SignalNode,\n} from '@angular/core/primitives/signals';\n\n/***\n * Creates a lightweight, readonly signal.\n * This is primarily used to provide fallback values for states that cannot be\n * computed in the current environment. For example:\n * - During SSR where browser-only APIs are unavailable\n * - In environments that lack support for specific APIs\n * @internal\n */\nexport function constSignal<T>(value: T): Signal<T> {\n const node: SignalNode<T> = Object.create(SIGNAL_NODE);\n node.value = value;\n\n const getter = (() => node.value) as SignalGetter<T>;\n (getter as any)[SIGNAL] = node;\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const debugName = node.debugName ? ' (' + node.debugName + ')' : '';\n getter.toString = () => `[Signal${debugName}: ${String(node.value)}]`;\n }\n\n return getter;\n}\n","import { type Signal, untracked, type WritableSignal } from '@angular/core';\nimport { SIGNAL, type SignalNode } from '@angular/core/primitives/signals';\n\n/**\n * @internal\n */\nexport interface SignalProxyHandler<T> {\n get?(source: Signal<T>): T;\n set?(value: T, source: WritableSignal<T>): void;\n}\n\n/**\n * Creates a proxy wrapper around a {@link Signal}\n * @internal\n */\nexport function proxySignal<T>(\n source: Signal<T>,\n handler: Omit<SignalProxyHandler<T>, 'set'>\n): Signal<T>;\n\n/**\n * Creates a proxy wrapper around a {@link WritableSignal}\n * @internal\n */\nexport function proxySignal<T>(\n source: WritableSignal<T>,\n handler: SignalProxyHandler<T>\n): WritableSignal<T>;\n\nexport function proxySignal<T>(\n source: Signal<T> | WritableSignal<T>,\n handler: SignalProxyHandler<T>\n): Signal<T> | WritableSignal<T> {\n const node = source[SIGNAL] as SignalNode<T>;\n const isWritable = 'set' in source && typeof source.set === 'function';\n\n const proxy = (handler.get ? () => handler.get!(source) : () => source()) as Signal<T>;\n\n proxy[SIGNAL] = node;\n\n // @TODO: consider (original toString internally reads from the original getter, bypassing the proxy)\n proxy.toString = source.toString;\n\n if (isWritable) {\n const set = handler.set\n ? (value: T) => untracked(() => handler.set!(value, source))\n : (value: T) => source.set(value);\n\n const update = (updater: (current: T) => T) => set(updater(node.value));\n\n (proxy as WritableSignal<T>).set = set;\n (proxy as WritableSignal<T>).update = update;\n (proxy as WritableSignal<T>).asReadonly = () => {\n const getter = source.asReadonly();\n return proxySignal(getter, { get: handler.get?.bind(handler) });\n };\n }\n\n return proxy;\n}\n","import { ElementRef } from '@angular/core';\n\nexport function unrefElement<T>(value: T | ElementRef<T>): T {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n","/**\n * Checks whether a file matches the given accept patterns.\n * Follows the native HTML\n * [`accept`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept) attribute format:\n * MIME types (`'image/png'`), wildcards (`'image/*'`), and file extensions (`'.pdf'`).\n *\n * @param file - File to check\n * @param accept - Comma-separated string of accepted patterns (e.g. `'image/*, .pdf'`)\n * @internal\n */\nexport function isAcceptedFile(file: File, accept: string): boolean {\n if (accept === '*') {\n return true;\n }\n\n const patterns = accept.split(',').map(s => s.trim());\n\n if (patterns.length === 0) {\n return true;\n }\n\n return patterns.some(pattern => {\n if (pattern.startsWith('.')) {\n return file.name.toLowerCase().endsWith(pattern.toLowerCase());\n }\n\n if (pattern.endsWith('/*')) {\n return file.type.startsWith(pattern.slice(0, -1));\n }\n\n return file.type === pattern;\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAO,MAAM,YAAY,GAAG;;ACA5B;;;;;AAKG;AACI,MAAM,OAAO,GAA6B,MAAK;;AAEtD;AAEA;;;;;AAKG;AACI,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,OAAO;AAElD;;;;;;AAMG;MACU,eAAe,GAAG,EAAE,OAAO,EAAE,OAAO;AAEjD;;;;;;AAMG;MACU,eAAe,GAAG,MAAM;;AC/B9B,MAAM,UAAU,GAAG,IAAI,cAAc,CAAU,SAAS,GAAG,YAAY,GAAG,EAAE,EAAE;AACnF,IAAA,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,MAAM,iBAAiB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CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AAErD,IAAA,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;AACzB,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAG;AAC7B,QAAA,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC3B,YAAA,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAChE;AAEA,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC1B,YAAA,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD;AAEA,QAAA,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO;AAC9B,IAAA,CAAC,CAAC;AACJ;;AChCA;;AAEG;;;;"}
1
+ {"version":3,"file":"signality-core-internal.mjs","sources":["../../../projects/core/internal/constants/mobile-regex.ts","../../../projects/core/internal/constants/stubs.ts","../../../projects/core/internal/providers/is-browser.ts","../../../projects/core/internal/providers/is-mobile.ts","../../../projects/core/internal/providers/is-server.ts","../../../projects/core/internal/utils/bom/is-window.ts","../../../projects/core/internal/utils/dom/get-active-element.ts","../../../projects/core/internal/utils/dom/get-event-target.ts","../../../projects/core/internal/utils/dom/get-pip-element.ts","../../../projects/core/internal/utils/dom/get-shadow-root.ts","../../../projects/core/internal/utils/dom/is-element.ts","../../../projects/core/internal/utils/dom/is-event-target.ts","../../../projects/core/internal/utils/dom/is-node-within.ts","../../../projects/core/internal/utils/assert.ts","../../../projects/core/internal/utils/context.ts","../../../projects/core/internal/utils/create-token.ts","../../../projects/core/internal/utils/wait-for-value.ts","../../../projects/core/internal/utils/is-query-signal.ts","../../../projects/core/internal/utils/is-plain-object.ts","../../../projects/core/internal/utils/const-signal.ts","../../../projects/core/internal/utils/proxy-signal.ts","../../../projects/core/internal/utils/unref-element.ts","../../../projects/core/internal/utils/files/is-accepted-file.ts","../../../projects/core/internal/signality-core-internal.ts"],"sourcesContent":["export const MOBILE_REGEX = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n","/**\n * Empty synchronous function stub.\n * Used for SSR compatibility when returning method functions in Ref objects that should do nothing on the server.\n *\n * Example: `close: NOOP_FN` in {@link WebNotificationRef}\n */\nexport const NOOP_FN: (...args: any[]) => void = () => {\n /* empty */\n};\n\n/**\n * Empty asynchronous function stub that returns a resolved Promise.\n * Used for SSR compatibility when returning async method functions in Ref objects that should do nothing on the server.\n *\n * Example: `share: NOOP_ASYNC_FN` in {@link WebShareRef}\n */\nexport const NOOP_ASYNC_FN = () => Promise.resolve();\n\n/**\n * Frozen EffectRef stub with a no-op destroy method.\n * Used for SSR compatibility when returning EffectRef from observer utilities (ResizeObserver, MutationObserver, etc.)\n * that cannot run on the server. Prevents errors when calling destroy() on server-rendered refs.\n *\n * Example: `return NOOP_EFFECT_REF` in {@link resizeObserver}\n */\nexport const NOOP_EFFECT_REF = { destroy: NOOP_FN };\n\n/**\n * Equality function that always returns false, forcing signal updates on every change.\n * Used for signals that hold mutable objects (like Selection, Range) where reference equality is not sufficient\n * and we need to detect changes even when the object structure appears the same.\n *\n * Example: `signal<Selection | null>(null, { equal: ALWAYS_FALSE_FN })` in {@link textSelection}\n */\nexport const ALWAYS_FALSE_FN = () => false;\n","import { inject, InjectionToken, PLATFORM_ID } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nexport const IS_BROWSER = new InjectionToken<boolean>(ngDevMode ? 'IS_BROWSER' : '', {\n providedIn: 'platform',\n factory: () => isPlatformBrowser(inject(PLATFORM_ID)),\n});\n","import { inject, InjectionToken } from '@angular/core';\nimport { MOBILE_REGEX } from '../constants';\nimport { IS_BROWSER } from './is-browser';\n\nexport const IS_MOBILE = new InjectionToken<boolean>(ngDevMode ? 'IS_MOBILE' : '', {\n providedIn: 'platform',\n factory: () => {\n return inject(IS_BROWSER) ? MOBILE_REGEX.test(navigator.userAgent) : false;\n },\n});\n","import { inject, InjectionToken, PLATFORM_ID } from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\n\nexport const IS_SERVER = new InjectionToken<boolean>(ngDevMode ? 'IS_SERVER' : '', {\n providedIn: 'platform',\n factory: () => isPlatformServer(inject(PLATFORM_ID)),\n});\n","export function isWindow(obj: object | null): obj is Window {\n return !!obj && (obj as Window).window === obj;\n}\n","export function getActiveElement(document: Document): Element | null {\n let activeElement = document.activeElement;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\n}\n","export function getEventTarget<T extends EventTarget>(event: Event): T | null {\n return (event.composedPath ? event.composedPath()[0] : event.target) as T | null;\n}\n","export function getPipElement(document: Document): Element | null {\n let pipElement = document.pictureInPictureElement;\n\n while (pipElement && pipElement.shadowRoot) {\n const newPipElement = pipElement.shadowRoot.pictureInPictureElement;\n if (newPipElement === pipElement) {\n break;\n } else {\n pipElement = newPipElement;\n }\n }\n\n return pipElement;\n}\n","export function getShadowRoot(element: Element | null): ShadowRoot | null {\n const rootNode = element?.getRootNode ? element.getRootNode() : null;\n\n if (rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n\n return null;\n}\n","export function isElement(value: unknown): value is Element {\n return !!value && (value as Element).nodeType === Node.ELEMENT_NODE;\n}\n","export function isEventTarget(value: unknown): value is EventTarget {\n return typeof (value as EventTarget)?.addEventListener === 'function';\n}\n","export function isNodeWithin(node: Node, root: Element): boolean {\n return root === node || root.contains(node) || (root.shadowRoot?.contains(node) ?? false);\n}\n","import { isElement, isEventTarget } from './dom';\n\nexport function assertElement(value: unknown, source: string): asserts value is Element {\n if (!isElement(value)) {\n throw new Error(\n `[${source}] Expected a DOM Element, ElementRef but received: ${\n (value as object).constructor?.name ?? typeof value\n }. ` +\n `If you are using viewChild/contentChild, make sure to specify \"{ read: ElementRef }\" to avoid implicit directive references.`\n );\n }\n}\n\nexport function assertEventTarget(value: unknown, source: string): asserts value is EventTarget {\n if (!isEventTarget(value)) {\n throw new Error(\n `[${source}] Expected an EventTarget, ElementRef but received: ${\n (value as object).constructor?.name ?? typeof value\n }. ` +\n `If you are using viewChild/contentChild, specify \"{ read: ElementRef }\" to avoid implicit directive references.`\n );\n }\n}\n","import {\n assertInInjectionContext,\n DestroyRef,\n inject,\n type Injector,\n INJECTOR,\n isSignal,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\nimport { SIGNAL, type SignalNode } from '@angular/core/primitives/signals';\nimport { IS_BROWSER, IS_MOBILE, IS_SERVER } from '../providers';\n\nexport interface ContextRef {\n readonly injector: Injector;\n readonly isServer: boolean;\n readonly isBrowser: boolean;\n readonly isMobile: boolean;\n readonly onCleanup: (cleanupFn: () => void) => void;\n}\n\nexport interface SetupContextRef {\n runInContext<T>(fn: (context: ContextRef) => T): T;\n}\n\n/**\n * @internal\n *\n * @param injector - injector to use for context\n * @param debugFn - context owner function\n */\nexport function setupContext(\n injector?: Injector,\n debugFn?: (...args: any[]) => any\n): SetupContextRef {\n if (typeof ngDevMode !== 'undefined' && ngDevMode && !injector) {\n assertInInjectionContext(debugFn || setupContext);\n }\n\n const ctxInjector = injector || inject(INJECTOR);\n\n return {\n runInContext<T>(fn: (context: ContextRef) => T): T {\n return runInContextImpl(fn, ctxInjector, debugFn || setupContext);\n },\n };\n}\n\nfunction runInContextImpl<T>(\n fn: (context: ContextRef) => T,\n injector: Injector,\n debugFn: (...args: any[]) => any\n): T {\n const result = runInInjectionContext(injector, () => {\n const isBrowser = inject(IS_BROWSER);\n const isServer = inject(IS_SERVER);\n const isMobile = inject(IS_MOBILE);\n const destroyRef = inject(DestroyRef);\n\n const onCleanup = (cleanupFn: () => void) => {\n destroyRef.onDestroy(cleanupFn);\n };\n\n return untracked(() => fn({ injector, isBrowser, isServer, isMobile, onCleanup }));\n });\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode && result != null) {\n setupDebugInfo(result, debugFn);\n }\n\n return result;\n}\n\nfunction setupDebugInfo<T>(value: T, debugFn: (...args: any[]) => any): T {\n if (isSignal(value)) {\n setDebugName(value, debugFn);\n } else if (value && typeof value === 'object') {\n for (const [postfix, maybeSignal] of Object.entries(value)) {\n if (isSignal(maybeSignal)) {\n setDebugName(maybeSignal, debugFn, postfix);\n }\n }\n }\n\n return value;\n}\n\nfunction setDebugName(\n signal: Signal<unknown>,\n debugFn: (...args: any[]) => any,\n postfix?: string\n): void {\n const node = signal[SIGNAL] as SignalNode<unknown>;\n\n if (node.debugName === undefined) {\n node.debugName = debugFn.name + (postfix ? '.' + postfix : '');\n }\n}\n","import { InjectionToken, type ProviderToken } from '@angular/core';\n\n/**\n * Creates an Angular InjectionToken with a factory function.\n * @internal\n */\nexport function createToken<T>(\n factory: () => T,\n providedIn: ProvidedIn = 'root'\n): ProviderToken<T> {\n return new InjectionToken(ngDevMode ? factory.name : '', { factory, providedIn });\n}\n\ntype ProvidedIn = NonNullable<ConstructorParameters<typeof InjectionToken>[1]>['providedIn'];\n","import { effect, type Injector, type Signal } from '@angular/core';\nimport { setupContext } from './context';\n\n/**\n * Resolves the first available value of a signal as a Promise.\n * @internal\n */\nexport function waitForValue<T>(source: Signal<T>, injector?: Injector): Promise<T> {\n const { runInContext } = setupContext(injector, waitForValue);\n\n return runInContext(() => {\n try {\n // Try to read the signal synchronously\n return Promise.resolve(source());\n } catch {\n // Required signals (input, model, queries) throw when read outside a reactive context\n // during initialization, fall back to reading the value inside an effect\n return new Promise<T>((resolve, reject) => {\n const effectRef = effect(() => {\n try {\n const value = source();\n resolve(value);\n } catch (e) {\n reject(e);\n } finally {\n effectRef.destroy();\n }\n });\n });\n }\n });\n}\n","import { isSignal, type Signal } from '@angular/core';\nimport { SIGNAL } from '@angular/core/primitives/signals';\n\n/**\n * Determines if a signal is a query signal (viewChild, contentChild).\n * Query signals have a special internal structure with a `_dirtyCounter` property that tracks\n * when query results change.\n\n * See: https://github.com/angular/angular/blob/main/packages/core/src/render3/queries/query_reactive.ts#L43\n * @internal\n */\nexport function isQuerySignal(val: unknown): val is Signal<unknown> {\n if (!isSignal(val)) {\n return false;\n }\n\n const node = val[SIGNAL] as object;\n return '_dirtyCounter' in node;\n}\n","export function isPlainObject(value: unknown): value is Record<PropertyKey, unknown> {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n}\n","import type { Signal } from '@angular/core';\nimport {\n SIGNAL,\n SIGNAL_NODE,\n type SignalGetter,\n type SignalNode,\n} from '@angular/core/primitives/signals';\n\n/***\n * Creates a lightweight, readonly signal.\n * This is primarily used to provide fallback values for states that cannot be\n * computed in the current environment. For example:\n * - During SSR where browser-only APIs are unavailable\n * - In environments that lack support for specific APIs\n * @internal\n */\nexport function constSignal<T>(value: T): Signal<T> {\n const node: SignalNode<T> = Object.create(SIGNAL_NODE);\n node.value = value;\n\n const getter = (() => node.value) as SignalGetter<T>;\n (getter as any)[SIGNAL] = node;\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const debugName = node.debugName ? ' (' + node.debugName + ')' : '';\n getter.toString = () => `[Signal${debugName}: ${String(node.value)}]`;\n }\n\n return getter;\n}\n","import { type Signal, untracked, type WritableSignal } from '@angular/core';\nimport { SIGNAL, type SignalNode } from '@angular/core/primitives/signals';\n\n/**\n * @internal\n */\nexport interface SignalProxyHandler<T> {\n get?(source: Signal<T>): T;\n set?(value: T, source: WritableSignal<T>): void;\n}\n\n/**\n * Creates a proxy wrapper around a {@link Signal}\n * @internal\n */\nexport function proxySignal<T>(\n source: Signal<T>,\n handler: Omit<SignalProxyHandler<T>, 'set'>\n): Signal<T>;\n\n/**\n * Creates a proxy wrapper around a {@link WritableSignal}\n * @internal\n */\nexport function proxySignal<T>(\n source: WritableSignal<T>,\n handler: SignalProxyHandler<T>\n): WritableSignal<T>;\n\nexport function proxySignal<T>(\n source: Signal<T> | WritableSignal<T>,\n handler: SignalProxyHandler<T>\n): Signal<T> | WritableSignal<T> {\n const node = source[SIGNAL] as SignalNode<T>;\n const isWritable = 'set' in source && typeof source.set === 'function';\n\n const proxy = (handler.get ? () => handler.get!(source) : () => source()) as Signal<T>;\n\n proxy[SIGNAL] = node;\n\n // @TODO: consider (original toString internally reads from the original getter, bypassing the proxy)\n proxy.toString = source.toString;\n\n if (isWritable) {\n const set = handler.set\n ? (value: T) => untracked(() => handler.set!(value, source))\n : (value: T) => source.set(value);\n\n const update = (updater: (current: T) => T) => set(updater(node.value));\n\n (proxy as WritableSignal<T>).set = set;\n (proxy as WritableSignal<T>).update = update;\n (proxy as WritableSignal<T>).asReadonly = () => {\n const getter = source.asReadonly();\n return proxySignal(getter, { get: handler.get?.bind(handler) });\n };\n }\n\n return proxy;\n}\n","import { ElementRef } from '@angular/core';\n\nexport function unrefElement<T>(value: T | ElementRef<T>): T {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n","/**\n * Checks whether a file matches the given accept patterns.\n * Follows the native HTML\n * [`accept`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/accept) attribute format:\n * MIME types (`'image/png'`), wildcards (`'image/*'`), and file extensions (`'.pdf'`).\n *\n * @param file - File to check\n * @param accept - Comma-separated string of accepted patterns (e.g. `'image/*, .pdf'`)\n * @internal\n */\nexport function isAcceptedFile(file: File, accept: string): boolean {\n if (accept === '*') {\n return true;\n }\n\n const patterns = accept.split(',').map(s => s.trim());\n\n if (patterns.length === 0) {\n return true;\n }\n\n return patterns.some(pattern => {\n if (pattern.startsWith('.')) {\n return file.name.toLowerCase().endsWith(pattern.toLowerCase());\n }\n\n if (pattern.endsWith('/*')) {\n return file.type.startsWith(pattern.slice(0, -1));\n }\n\n return file.type === pattern;\n });\n}\n","/**\n * Generated bundle index. Do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IACb;AAEA,IAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAG;AAC7B,QAAA,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC3B,YAAA,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAChE;AAEA,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AAC1B,YAAA,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD;AAEA,QAAA,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO;AAC9B,IAAA,CAAC,CAAC;AACJ;;AChCA;;AAEG;;;;"}
@@ -1,7 +1,16 @@
1
1
  import { type Signal, type WritableSignal } from '@angular/core';
2
2
  import { type ValidationErrors } from '@angular/forms';
3
3
  import type { WithInjector } from '@signality/core/types';
4
- export type CvaOptions<T> = Omit<Partial<MakeWritable<CvaRef<T>>>, 'value'> & Pick<CvaRef<T>, 'value'> & WithInjector;
4
+ export interface CvaOptions<T> extends WithInjector {
5
+ readonly value: WritableSignal<T>;
6
+ readonly touched?: WritableSignal<boolean>;
7
+ readonly disabled?: WritableSignal<boolean>;
8
+ readonly required?: WritableSignal<boolean>;
9
+ readonly invalid?: WritableSignal<boolean>;
10
+ readonly pending?: WritableSignal<boolean>;
11
+ readonly dirty?: WritableSignal<boolean>;
12
+ readonly errors?: WritableSignal<ValidationErrors | null>;
13
+ }
5
14
  export interface CvaRef<T> {
6
15
  readonly value: WritableSignal<T>;
7
16
  readonly touched: WritableSignal<boolean>;
@@ -54,7 +63,3 @@ export interface CvaRef<T> {
54
63
  * ```
55
64
  */
56
65
  export declare function cva<T>(options: CvaOptions<T>): CvaRef<T>;
57
- type MakeWritable<T extends object> = {
58
- [K in keyof T]: T[K] extends Signal<infer U> ? WritableSignal<U> : never;
59
- };
60
- export {};
@@ -3,6 +3,7 @@ export * from './dom';
3
3
  export * from './assert';
4
4
  export * from './context';
5
5
  export * from './create-token';
6
+ export * from './wait-for-value';
6
7
  export * from './is-query-signal';
7
8
  export * from './is-plain-object';
8
9
  export * from './const-signal';
@@ -0,0 +1,6 @@
1
+ import { type Injector, type Signal } from '@angular/core';
2
+ /**
3
+ * Resolves the first available value of a signal as a Promise.
4
+ * @internal
5
+ */
6
+ export declare function waitForValue<T>(source: Signal<T>, injector?: Injector): Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signality/core",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "author": "Vyacheslav Borodin <https://github.com/vs-borodin>",
6
6
  "description": "A foundational toolkit for Angular Signals",
@@ -104,6 +104,10 @@
104
104
  "types": "./browser/clipboard/index.d.ts",
105
105
  "default": "./fesm2022/signality-core-browser-clipboard.mjs"
106
106
  },
107
+ "./browser/device-pixel-ratio": {
108
+ "types": "./browser/device-pixel-ratio/index.d.ts",
109
+ "default": "./fesm2022/signality-core-browser-device-pixel-ratio.mjs"
110
+ },
107
111
  "./browser/device-posture": {
108
112
  "types": "./browser/device-posture/index.d.ts",
109
113
  "default": "./fesm2022/signality-core-browser-device-posture.mjs"