@wirekyt/angular 0.0.2 → 0.0.4

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.
@@ -1,6 +1,7 @@
1
1
  import { MachineSchema, Machine, Service } from '@wirekyt/dom';
2
2
  export { mergeProps } from '@wirekyt/dom';
3
- import { ElementRef, Renderer2, DestroyRef, Signal } from '@angular/core';
3
+ import * as i0 from '@angular/core';
4
+ import { ElementRef, Renderer2, DestroyRef, Signal, InjectionToken, Provider, Injector, EnvironmentInjector, ProviderToken, StaticProvider, Type, ComponentRef, ViewContainerRef, TemplateRef, EmbeddedViewRef, ModelSignal } from '@angular/core';
4
5
  import * as _wirekyt_dom_types from '@wirekyt/dom/types';
5
6
  import { JSX, NormalizeProps } from '@wirekyt/dom/types';
6
7
 
@@ -39,6 +40,100 @@ interface UseMachineOptions<TSchema extends MachineSchema, TApi> {
39
40
  type StateFor<TSchema extends MachineSchema> = Service<TSchema>["state"];
40
41
  declare function useMachine<TSchema extends MachineSchema, TApi>(options: UseMachineOptions<TSchema, TApi>): UseMachineReturn<StateFor<TSchema>, TApi, Service<TSchema>>;
41
42
 
42
- export { bindProps, normalizeProps, useMachine };
43
- export type { Assign, BindPropsOptions, MaybePromise, Optional, PropTypes, UseMachineOptions, UseMachineReturn };
43
+ interface EnvironmentContext {
44
+ getRootNode: () => Document | ShadowRoot | undefined;
45
+ }
46
+ interface ProvideEnvironmentConfig {
47
+ getRootNode?: () => Document | ShadowRoot | undefined;
48
+ }
49
+ declare const ENVIRONMENT_TOKEN: InjectionToken<EnvironmentContext>;
50
+ declare function provideEnvironment(config?: ProvideEnvironmentConfig): Provider;
51
+ declare function injectEnvironment(): EnvironmentContext;
52
+
53
+ type InteractionModality = "pointer" | "keyboard" | null;
54
+ interface InteractionContext {
55
+ readonly modality: Signal<InteractionModality>;
56
+ readonly isFocusVisible: Signal<boolean>;
57
+ }
58
+ declare class InteractionService implements InteractionContext {
59
+ private readonly _modality;
60
+ readonly modality: Signal<InteractionModality>;
61
+ readonly isFocusVisible: Signal<boolean>;
62
+ constructor();
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<InteractionService, never>;
64
+ static ɵprov: i0.ɵɵInjectableDeclaration<InteractionService>;
65
+ }
66
+ declare const INTERACTION_TOKEN: InjectionToken<InteractionContext>;
67
+ declare function provideInteraction(): Provider[];
68
+ declare function injectInteraction(): InteractionContext;
69
+
70
+ declare const DEFAULT_LOCALE = "en-US";
71
+ type Direction = "ltr" | "rtl";
72
+ declare function getDirection(locale: string): Direction;
73
+ interface LocaleContext {
74
+ locale: string;
75
+ dir: Direction;
76
+ }
77
+ declare const LOCALE_TOKEN: InjectionToken<LocaleContext>;
78
+ interface ProvideLocaleConfig {
79
+ locale?: string;
80
+ dir?: Direction;
81
+ }
82
+ declare function provideLocale(config?: ProvideLocaleConfig): Provider;
83
+ declare function injectLocale(): LocaleContext;
84
+ declare function getCollator(locale: string, options?: Intl.CollatorOptions): Intl.Collator;
85
+ declare function getDateFormatter(locale: string, options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
86
+ interface Filter {
87
+ contains(string: string, substring: string): boolean;
88
+ startsWith(string: string, substring: string): boolean;
89
+ endsWith(string: string, substring: string): boolean;
90
+ }
91
+ declare function getFilter(locale: string, options?: Intl.CollatorOptions): Filter;
92
+
93
+ interface ContextCarrier<TRoot> {
94
+ readonly originInjector: Injector;
95
+ readonly environmentInjector: EnvironmentInjector;
96
+ readonly elementInjector: Injector;
97
+ readonly root: TRoot;
98
+ }
99
+ interface CreateContextCarrierOptions<TRoot> {
100
+ originInjector: Injector;
101
+ environmentInjector: EnvironmentInjector;
102
+ elementInjector: Injector;
103
+ root: TRoot;
104
+ }
105
+ declare function createContextCarrier<TRoot>(options: CreateContextCarrierOptions<TRoot>): ContextCarrier<TRoot>;
106
+ declare function createEmbeddedViewWithCarrier<C, TRoot>(viewContainer: ViewContainerRef, template: TemplateRef<C>, carrier: ContextCarrier<TRoot>, context?: C): EmbeddedViewRef<C>;
107
+ declare function createComponentWithCarrier<C, TRoot>(component: Type<C>, carrier: ContextCarrier<TRoot>): ComponentRef<C>;
108
+ interface BuildRootCarrierOptions<TRoot> {
109
+ root: TRoot;
110
+ rootToken: ProviderToken<TRoot>;
111
+ originInjector: Injector;
112
+ environmentInjector: EnvironmentInjector;
113
+ providers?: StaticProvider[];
114
+ }
115
+ declare function buildRootCarrier<TRoot>(options: BuildRootCarrierOptions<TRoot>): ContextCarrier<TRoot>;
116
+
117
+ interface CvaController<T> {
118
+ writeValue(value: T | null): void;
119
+ registerOnChange(fn: (value: T | undefined) => void): void;
120
+ registerOnTouched(fn: () => void): void;
121
+ setDisabledState(disabled: boolean): void;
122
+ notifyValueChange(value: T | undefined): void;
123
+ markTouched(): void;
124
+ }
125
+ interface CvaControllerOptions<T> {
126
+ value: ModelSignal<T | undefined>;
127
+ setDisabled: (disabled: boolean) => void;
128
+ componentName: string;
129
+ hasExternalModelBinding: () => boolean;
130
+ }
131
+ declare const createCvaController: <T>(options: CvaControllerOptions<T>) => CvaController<T>;
132
+
133
+ declare const warnMixedFormAndModelBinding: (componentName: string) => void;
134
+
135
+ declare const createId: () => string;
136
+
137
+ export { DEFAULT_LOCALE, ENVIRONMENT_TOKEN, INTERACTION_TOKEN, InteractionService, LOCALE_TOKEN, bindProps, buildRootCarrier, createComponentWithCarrier, createContextCarrier, createCvaController, createEmbeddedViewWithCarrier, createId, getCollator, getDateFormatter, getDirection, getFilter, injectEnvironment, injectInteraction, injectLocale, normalizeProps, provideEnvironment, provideInteraction, provideLocale, useMachine, warnMixedFormAndModelBinding };
138
+ export type { Assign, BindPropsOptions, ContextCarrier, CvaController, CvaControllerOptions, Direction, EnvironmentContext, Filter, InteractionContext, InteractionModality, LocaleContext, MaybePromise, Optional, PropTypes, ProvideEnvironmentConfig, ProvideLocaleConfig, UseMachineOptions, UseMachineReturn };
44
139
  //# sourceMappingURL=wirekyt-angular.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wirekyt-angular.d.ts","sources":["../../src/core/bind-props.ts","../../src/core/normalize-props.ts","../../src/core/types.ts","../../src/core/machine.ts"],"mappings":";;;;;;AAQA,KAAK,SAAS,GAAG,MAAM;UAEN,gBAAgB;AAC/B,gBAAY,UAAU,CAAC,WAAW;cACxB,SAAS;gBACP,UAAU;AACtB,iBAAa,SAAS;AACvB;AA0FD,iBAAgB,SAAS,UAAU,gBAAgB;;KCvGvC,SAAS,GAAG,GAAG,CAAC,iBAAiB;AAC3C,aAAS,GAAG,CAAC,cAAc,CAAC,WAAW,IAAI,MAAM;AACjD,WAAO,GAAG,CAAC,aAAa;;AAG1B,cAAa,cAAc,EAAA,kBAAA,CAAA,cAAA,CAAA,SAAA;;KCDf,MAAM,SAAS,IAAI;AACzB,KAAM,QAAQ,yBAAyB,IAAI,CAAC,OAAO,UAAU,IAAI;AACjE,KAAM,YAAY,UAAU,OAAO;UAExB,gBAAgB;AAC/B,oBAAgB,MAAM;AACtB;;;AACA;AACA,kBAAc,MAAM;AACrB;UAEgB,iBAAiB,iBAAiB,aAAa;AAC9D,aAAS,OAAO;mBACD,OAAO;AACtB,uBAAmB,OAAO,2BAA2B,cAAc,CAAC,SAAS;AAC9E;;ACsBD,KAAK,QAAQ,iBAAiB,aAAa,IAAI,OAAO;AAetD,iBAAgB,UAAU,iBAAiB,aAAa,iBAC7C,iBAAiB,kBACzB,gBAAgB,CAAC,QAAQ,iBAAiB,OAAO;;;;","names":[]}
1
+ {"version":3,"file":"wirekyt-angular.d.ts","sources":["../../src/core/bind-props.ts","../../src/core/normalize-props.ts","../../src/core/types.ts","../../src/core/machine.ts","../../src/providers/environment/environment.ts","../../src/providers/interaction/interaction.ts","../../src/providers/locale/locale.ts","../../src/utils/context-carrier.ts","../../src/utils/control-value-accessor.ts","../../src/utils/forms-diagnostics.ts","../../src/utils/id.ts"],"mappings":";;;;;;;AAQA,KAAK,SAAS,GAAG,MAAM;UAEN,gBAAgB;AAC/B,gBAAY,UAAU,CA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AAM,aAAa;;ACrBvF,cAAa,4BAA4B;;ACAzC,cAAa,QAAQ;;;;","names":[]}
package/package.json CHANGED
@@ -1,20 +1,38 @@
1
1
  {
2
2
  "name": "@wirekyt/angular",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Angular adapter for Wirekyt",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "type": "module",
9
9
  "sideEffects": false,
10
+ "module": "./dist/fesm2022/wirekyt-angular.mjs",
11
+ "types": "./dist/types/wirekyt-angular.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/types/wirekyt-angular.d.ts",
15
+ "default": "./dist/fesm2022/wirekyt-angular.mjs"
16
+ },
17
+ "./collapsible": {
18
+ "types": "./dist/types/wirekyt-angular-collapsible.d.ts",
19
+ "default": "./dist/fesm2022/wirekyt-angular-collapsible.mjs"
20
+ },
21
+ "./accordion": {
22
+ "types": "./dist/types/wirekyt-angular-accordion.d.ts",
23
+ "default": "./dist/fesm2022/wirekyt-angular-accordion.mjs"
24
+ },
25
+ "./package.json": "./package.json"
26
+ },
10
27
  "publishConfig": {
11
28
  "access": "public",
12
29
  "provenance": true
13
30
  },
14
31
  "dependencies": {
15
- "@internationalized/date": "^3.12.2",
32
+ "@internationalized/date": "^3.12.3",
16
33
  "@internationalized/number": "^3.6.7",
17
- "@wirekyt/dom": "0.0.2"
34
+ "tslib": "^2.8.1",
35
+ "@wirekyt/dom": "0.0.4"
18
36
  },
19
37
  "peerDependencies": {
20
38
  "@angular/common": ">=22.0.0",