@susilkumar006/widgets-test 1.0.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 (107) hide show
  1. package/README.md +445 -0
  2. package/dist/api/FacePeApiClient.d.cts +74 -0
  3. package/dist/api/FacePeApiClient.d.ts +74 -0
  4. package/dist/api/FacePeApiContext.d.cts +8 -0
  5. package/dist/api/FacePeApiContext.d.ts +8 -0
  6. package/dist/api/decoders.d.cts +48 -0
  7. package/dist/api/decoders.d.ts +48 -0
  8. package/dist/api/index.d.cts +8 -0
  9. package/dist/api/index.d.ts +8 -0
  10. package/dist/api/json.d.cts +5 -0
  11. package/dist/api/json.d.ts +5 -0
  12. package/dist/api/useFacePeResource.d.cts +21 -0
  13. package/dist/api/useFacePeResource.d.ts +21 -0
  14. package/dist/components/Avatar/FacePeAvatar.d.cts +23 -0
  15. package/dist/components/Avatar/FacePeAvatar.d.ts +23 -0
  16. package/dist/components/Avatar/engines.d.cts +30 -0
  17. package/dist/components/Avatar/engines.d.ts +30 -0
  18. package/dist/components/Avatar/index.d.cts +1 -0
  19. package/dist/components/Avatar/index.d.ts +1 -0
  20. package/dist/components/Form/FacePeForm.d.cts +19 -0
  21. package/dist/components/Form/FacePeForm.d.ts +19 -0
  22. package/dist/components/Form/index.d.cts +1 -0
  23. package/dist/components/Form/index.d.ts +1 -0
  24. package/dist/components/Picker/FacePePicker.d.cts +22 -0
  25. package/dist/components/Picker/FacePePicker.d.ts +22 -0
  26. package/dist/components/Picker/index.d.cts +1 -0
  27. package/dist/components/Picker/index.d.ts +1 -0
  28. package/dist/components/Placement/FacePeOverlay.d.cts +13 -0
  29. package/dist/components/Placement/FacePeOverlay.d.ts +13 -0
  30. package/dist/components/Placement/FacePePage.d.cts +10 -0
  31. package/dist/components/Placement/FacePePage.d.ts +10 -0
  32. package/dist/components/Placement/index.d.cts +2 -0
  33. package/dist/components/Placement/index.d.ts +2 -0
  34. package/dist/components/Timeline/FacePeTimeline.d.cts +23 -0
  35. package/dist/components/Timeline/FacePeTimeline.d.ts +23 -0
  36. package/dist/components/Timeline/index.d.cts +1 -0
  37. package/dist/components/Timeline/index.d.ts +1 -0
  38. package/dist/components/shared/FacePeErrorBoundary.d.cts +28 -0
  39. package/dist/components/shared/FacePeErrorBoundary.d.ts +28 -0
  40. package/dist/components/shared/surface.d.cts +6 -0
  41. package/dist/components/shared/surface.d.ts +6 -0
  42. package/dist/context/FacePeContext.d.cts +22 -0
  43. package/dist/context/FacePeContext.d.ts +22 -0
  44. package/dist/context/avatar.d.cts +6 -0
  45. package/dist/context/avatar.d.ts +6 -0
  46. package/dist/context/index.d.cts +5 -0
  47. package/dist/context/index.d.ts +5 -0
  48. package/dist/context/navigation.d.cts +10 -0
  49. package/dist/context/navigation.d.ts +10 -0
  50. package/dist/events/FacePeEventEmitter.d.cts +59 -0
  51. package/dist/events/FacePeEventEmitter.d.ts +59 -0
  52. package/dist/events/createCorrelationId.d.cts +9 -0
  53. package/dist/events/createCorrelationId.d.ts +9 -0
  54. package/dist/events/index.d.cts +8 -0
  55. package/dist/events/index.d.ts +8 -0
  56. package/dist/events/telemetry.d.cts +11 -0
  57. package/dist/events/telemetry.d.ts +11 -0
  58. package/dist/events/useFacePeEmitter.d.cts +15 -0
  59. package/dist/events/useFacePeEmitter.d.ts +15 -0
  60. package/dist/index.cjs +1925 -0
  61. package/dist/index.cjs.map +1 -0
  62. package/dist/index.d.cts +26 -0
  63. package/dist/index.d.ts +26 -0
  64. package/dist/index.js +1903 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/schemas/FacePeCustomerPayload.schema.json +31 -0
  67. package/dist/schemas/FacePeError.schema.json +63 -0
  68. package/dist/schemas/FacePeEventMeta.schema.json +53 -0
  69. package/dist/schemas/FacePeFormValues.schema.json +27 -0
  70. package/dist/schemas/FacePeNavigationRequest.schema.json +33 -0
  71. package/dist/schemas/FacePePickerOption.schema.json +34 -0
  72. package/dist/schemas/FacePePickerOptionsPayload.schema.json +49 -0
  73. package/dist/schemas/FacePeTelemetryEvent.schema.json +66 -0
  74. package/dist/schemas/FacePeTimelineItem.schema.json +91 -0
  75. package/dist/schemas/FacePeTimelinePayload.schema.json +109 -0
  76. package/dist/styles.css +887 -0
  77. package/dist/types/api.d.cts +60 -0
  78. package/dist/types/api.d.ts +60 -0
  79. package/dist/types/avatar.d.cts +102 -0
  80. package/dist/types/avatar.d.ts +102 -0
  81. package/dist/types/common.d.cts +42 -0
  82. package/dist/types/common.d.ts +42 -0
  83. package/dist/types/components.d.cts +53 -0
  84. package/dist/types/components.d.ts +53 -0
  85. package/dist/types/config.d.cts +27 -0
  86. package/dist/types/config.d.ts +27 -0
  87. package/dist/types/events.d.cts +85 -0
  88. package/dist/types/events.d.ts +85 -0
  89. package/dist/types/form.d.cts +83 -0
  90. package/dist/types/form.d.ts +83 -0
  91. package/dist/types/index.d.cts +18 -0
  92. package/dist/types/index.d.ts +18 -0
  93. package/dist/types/picker.d.cts +82 -0
  94. package/dist/types/picker.d.ts +82 -0
  95. package/dist/types/placement.d.cts +69 -0
  96. package/dist/types/placement.d.ts +69 -0
  97. package/dist/types/provider.d.cts +75 -0
  98. package/dist/types/provider.d.ts +75 -0
  99. package/dist/types/results.d.cts +28 -0
  100. package/dist/types/results.d.ts +28 -0
  101. package/dist/types/telemetry.d.cts +38 -0
  102. package/dist/types/telemetry.d.ts +38 -0
  103. package/dist/types/timeline.d.cts +103 -0
  104. package/dist/types/timeline.d.ts +103 -0
  105. package/dist/version.d.cts +2 -0
  106. package/dist/version.d.ts +2 -0
  107. package/package.json +71 -0
@@ -0,0 +1,10 @@
1
+ import type { FacePeEvent, FacePeNavigationRequest } from '../types/index.js';
2
+ /** Hands a component's `navigate` event to the provider's `onNavigate`. */
3
+ export type FacePeNavigationRelay = (event: FacePeEvent<'navigate', FacePeNavigationRequest>) => void;
4
+ /**
5
+ * Internal: the navigation side of the context bridge. Components emit
6
+ * `navigate` to their own handler and relay the same event here; the host's
7
+ * router does the navigating. Not exported from the package.
8
+ */
9
+ export declare const FacePeNavigationContext: import("react").Context<FacePeNavigationRelay>;
10
+ export declare function useFacePeNavigationRelay(): FacePeNavigationRelay;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Internal: the event emitter every SDK component emits through. Not exported
3
+ * from the package — hosts receive events through the components' `on…`
4
+ * props, which the components subscribe to their emitter.
5
+ */
6
+ import type { CorrelationId, EntityId, FacePeEvent, FacePeEventHandler, FacePeEventMap } from '../types/index.cjs';
7
+ import { type FacePeTelemetryReporter } from './telemetry.cjs';
8
+ type EventName<TEvents extends FacePeEventMap> = keyof TEvents & string;
9
+ /** A listener for one event type: the public `FacePeEventHandler` for that event. */
10
+ export type FacePeListener<TEvents extends FacePeEventMap, K extends EventName<TEvents>> = FacePeEventHandler<FacePeEvent<K, TEvents[K]>>;
11
+ /** Per-component values stamped on each event's meta, read at emit time. */
12
+ export type FacePeEventContext = {
13
+ readonly entityId?: EntityId;
14
+ };
15
+ /**
16
+ * Typed publish/subscribe for one component's events.
17
+ *
18
+ * @typeParam TEvents - the component's event map (event name → payload type).
19
+ */
20
+ export declare class FacePeEventEmitter<TEvents extends FacePeEventMap> {
21
+ private readonly source;
22
+ private readonly context;
23
+ private readonly report;
24
+ private listeners;
25
+ /**
26
+ * @param source - the emitting component's name, stamped on every event's meta.
27
+ * @param context - read on every emit, e.g. the component's current `entityId`.
28
+ * @param report - receives the telemetry record of every emitted event.
29
+ */
30
+ constructor(source: string, context?: () => FacePeEventContext, report?: FacePeTelemetryReporter);
31
+ /**
32
+ * Subscribes a listener to one event type. The same function subscribed
33
+ * twice is held once. Returns the matching unsubscribe function.
34
+ */
35
+ on<K extends EventName<TEvents>>(type: K, listener: FacePeListener<TEvents, K>): () => void;
36
+ /** Unsubscribes one listener; others on the same event are untouched. */
37
+ off<K extends EventName<TEvents>>(type: K, listener: FacePeListener<TEvents, K>): void;
38
+ /** How many listeners an event type has (for cleanup checks). */
39
+ listenerCount<K extends EventName<TEvents>>(type: K): number;
40
+ /** Removes every listener. */
41
+ clear(): void;
42
+ /**
43
+ * Wraps `payload` in the standard envelope and delivers it to every
44
+ * listener of `type`, in subscription order. A listener that throws is
45
+ * reported and skipped; the rest still run. The event is also reported to
46
+ * telemetry (without its payload). Returns the event delivered.
47
+ *
48
+ * @param correlationId - pass one to tie several events to one action
49
+ * (e.g. a submit attempt's `submit` or `error`); a new one otherwise.
50
+ */
51
+ emit<K extends EventName<TEvents>>(type: K, payload: TEvents[K], correlationId?: CorrelationId): FacePeEvent<K, TEvents[K]>;
52
+ /**
53
+ * Delivers an event that already has its envelope — e.g. a component's
54
+ * `navigate` relayed to the provider, so both receive the very same event.
55
+ * Same isolation as `emit`. Not reported to telemetry: `emit` already did.
56
+ */
57
+ dispatch<K extends EventName<TEvents>>(event: FacePeEvent<K, TEvents[K]>): void;
58
+ }
59
+ export {};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Internal: the event emitter every SDK component emits through. Not exported
3
+ * from the package — hosts receive events through the components' `on…`
4
+ * props, which the components subscribe to their emitter.
5
+ */
6
+ import type { CorrelationId, EntityId, FacePeEvent, FacePeEventHandler, FacePeEventMap } from '../types/index.js';
7
+ import { type FacePeTelemetryReporter } from './telemetry.js';
8
+ type EventName<TEvents extends FacePeEventMap> = keyof TEvents & string;
9
+ /** A listener for one event type: the public `FacePeEventHandler` for that event. */
10
+ export type FacePeListener<TEvents extends FacePeEventMap, K extends EventName<TEvents>> = FacePeEventHandler<FacePeEvent<K, TEvents[K]>>;
11
+ /** Per-component values stamped on each event's meta, read at emit time. */
12
+ export type FacePeEventContext = {
13
+ readonly entityId?: EntityId;
14
+ };
15
+ /**
16
+ * Typed publish/subscribe for one component's events.
17
+ *
18
+ * @typeParam TEvents - the component's event map (event name → payload type).
19
+ */
20
+ export declare class FacePeEventEmitter<TEvents extends FacePeEventMap> {
21
+ private readonly source;
22
+ private readonly context;
23
+ private readonly report;
24
+ private listeners;
25
+ /**
26
+ * @param source - the emitting component's name, stamped on every event's meta.
27
+ * @param context - read on every emit, e.g. the component's current `entityId`.
28
+ * @param report - receives the telemetry record of every emitted event.
29
+ */
30
+ constructor(source: string, context?: () => FacePeEventContext, report?: FacePeTelemetryReporter);
31
+ /**
32
+ * Subscribes a listener to one event type. The same function subscribed
33
+ * twice is held once. Returns the matching unsubscribe function.
34
+ */
35
+ on<K extends EventName<TEvents>>(type: K, listener: FacePeListener<TEvents, K>): () => void;
36
+ /** Unsubscribes one listener; others on the same event are untouched. */
37
+ off<K extends EventName<TEvents>>(type: K, listener: FacePeListener<TEvents, K>): void;
38
+ /** How many listeners an event type has (for cleanup checks). */
39
+ listenerCount<K extends EventName<TEvents>>(type: K): number;
40
+ /** Removes every listener. */
41
+ clear(): void;
42
+ /**
43
+ * Wraps `payload` in the standard envelope and delivers it to every
44
+ * listener of `type`, in subscription order. A listener that throws is
45
+ * reported and skipped; the rest still run. The event is also reported to
46
+ * telemetry (without its payload). Returns the event delivered.
47
+ *
48
+ * @param correlationId - pass one to tie several events to one action
49
+ * (e.g. a submit attempt's `submit` or `error`); a new one otherwise.
50
+ */
51
+ emit<K extends EventName<TEvents>>(type: K, payload: TEvents[K], correlationId?: CorrelationId): FacePeEvent<K, TEvents[K]>;
52
+ /**
53
+ * Delivers an event that already has its envelope — e.g. a component's
54
+ * `navigate` relayed to the provider, so both receive the very same event.
55
+ * Same isolation as `emit`. Not reported to telemetry: `emit` already did.
56
+ */
57
+ dispatch<K extends EventName<TEvents>>(event: FacePeEvent<K, TEvents[K]>): void;
58
+ }
59
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Internal: correlation ids for SDK events. Not exported from the package.
3
+ */
4
+ import type { CorrelationId } from '../types/index.cjs';
5
+ /**
6
+ * A new, unique correlation id. Uses `crypto.randomUUID` and falls back where
7
+ * it is unavailable (pages not served over HTTPS, older runtimes).
8
+ */
9
+ export declare function createCorrelationId(): CorrelationId;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Internal: correlation ids for SDK events. Not exported from the package.
3
+ */
4
+ import type { CorrelationId } from '../types/index.js';
5
+ /**
6
+ * A new, unique correlation id. Uses `crypto.randomUUID` and falls back where
7
+ * it is unavailable (pages not served over HTTPS, older runtimes).
8
+ */
9
+ export declare function createCorrelationId(): CorrelationId;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Internal event infrastructure shared by SDK components. Not re-exported from
3
+ * src/index.ts, and package.json exports no path to it.
4
+ */
5
+ export { FacePeEventEmitter, type FacePeEventContext, type FacePeListener } from './FacePeEventEmitter.cjs';
6
+ export { useFacePeEmitter } from './useFacePeEmitter.cjs';
7
+ export { createCorrelationId } from './createCorrelationId.cjs';
8
+ export { FacePeTelemetryContext, telemetryOf, useFacePeTelemetryReporter, type FacePeTelemetryReporter, } from './telemetry.cjs';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Internal event infrastructure shared by SDK components. Not re-exported from
3
+ * src/index.ts, and package.json exports no path to it.
4
+ */
5
+ export { FacePeEventEmitter, type FacePeEventContext, type FacePeListener } from './FacePeEventEmitter.js';
6
+ export { useFacePeEmitter } from './useFacePeEmitter.js';
7
+ export { createCorrelationId } from './createCorrelationId.js';
8
+ export { FacePeTelemetryContext, telemetryOf, useFacePeTelemetryReporter, type FacePeTelemetryReporter, } from './telemetry.js';
@@ -0,0 +1,11 @@
1
+ import type { FacePeEvent, FacePeTelemetryEvent } from '../types/index.cjs';
2
+ /**
3
+ * Internal: hands a telemetry record to the host's sink. The provider supplies
4
+ * one that reads its current `telemetry` prop and isolates a throwing sink;
5
+ * outside a provider it does nothing.
6
+ */
7
+ export type FacePeTelemetryReporter = (event: FacePeTelemetryEvent) => void;
8
+ export declare const FacePeTelemetryContext: import("react").Context<FacePeTelemetryReporter>;
9
+ export declare function useFacePeTelemetryReporter(): FacePeTelemetryReporter;
10
+ /** The telemetry record of a component event: its envelope minus the payload. */
11
+ export declare function telemetryOf(event: FacePeEvent<string, unknown>): FacePeTelemetryEvent;
@@ -0,0 +1,11 @@
1
+ import type { FacePeEvent, FacePeTelemetryEvent } from '../types/index.js';
2
+ /**
3
+ * Internal: hands a telemetry record to the host's sink. The provider supplies
4
+ * one that reads its current `telemetry` prop and isolates a throwing sink;
5
+ * outside a provider it does nothing.
6
+ */
7
+ export type FacePeTelemetryReporter = (event: FacePeTelemetryEvent) => void;
8
+ export declare const FacePeTelemetryContext: import("react").Context<FacePeTelemetryReporter>;
9
+ export declare function useFacePeTelemetryReporter(): FacePeTelemetryReporter;
10
+ /** The telemetry record of a component event: its envelope minus the payload. */
11
+ export declare function telemetryOf(event: FacePeEvent<string, unknown>): FacePeTelemetryEvent;
@@ -0,0 +1,15 @@
1
+ import type { FacePeEventMap } from '../types/index.cjs';
2
+ import { FacePeEventEmitter, type FacePeEventContext } from './FacePeEventEmitter.cjs';
3
+ import { type FacePeTelemetryReporter } from './telemetry.cjs';
4
+ /**
5
+ * Internal: one emitter per component instance, created on first render and
6
+ * kept for the component's life. Components subscribe their host handlers in
7
+ * an effect (and unsubscribe in its cleanup), declared before any effect that
8
+ * emits, so listeners are in place for `ready`.
9
+ *
10
+ * @param context - read on every emit; pass a function over a ref so it sees
11
+ * current values (e.g. `() => ({ entityId: entityRef.current })`).
12
+ * @param report - telemetry reporter; defaults to the nearest provider's (the
13
+ * provider passes its own, as it sits above its own context).
14
+ */
15
+ export declare function useFacePeEmitter<TEvents extends FacePeEventMap>(source: string, context?: () => FacePeEventContext, report?: FacePeTelemetryReporter): FacePeEventEmitter<TEvents>;
@@ -0,0 +1,15 @@
1
+ import type { FacePeEventMap } from '../types/index.js';
2
+ import { FacePeEventEmitter, type FacePeEventContext } from './FacePeEventEmitter.js';
3
+ import { type FacePeTelemetryReporter } from './telemetry.js';
4
+ /**
5
+ * Internal: one emitter per component instance, created on first render and
6
+ * kept for the component's life. Components subscribe their host handlers in
7
+ * an effect (and unsubscribe in its cleanup), declared before any effect that
8
+ * emits, so listeners are in place for `ready`.
9
+ *
10
+ * @param context - read on every emit; pass a function over a ref so it sees
11
+ * current values (e.g. `() => ({ entityId: entityRef.current })`).
12
+ * @param report - telemetry reporter; defaults to the nearest provider's (the
13
+ * provider passes its own, as it sits above its own context).
14
+ */
15
+ export declare function useFacePeEmitter<TEvents extends FacePeEventMap>(source: string, context?: () => FacePeEventContext, report?: FacePeTelemetryReporter): FacePeEventEmitter<TEvents>;