@timeax/digital-service-engine 0.0.4 → 0.0.5
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/dist/react/index.cjs +1914 -2
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +247 -169
- package/dist/react/index.d.ts +247 -169
- package/dist/react/index.js +1898 -1
- package/dist/react/index.js.map +1 -1
- package/dist/workspace/index.cjs.map +1 -1
- package/dist/workspace/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { NodeProps } from 'reactflow';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
2
|
import React, { ReactNode } from 'react';
|
|
4
3
|
|
|
4
|
+
type EventMap = Record<string, unknown>;
|
|
5
|
+
declare class EventBus<E extends EventMap> {
|
|
6
|
+
private listeners;
|
|
7
|
+
on<K extends keyof E>(event: K, handler: (payload: E[K]) => void): () => void;
|
|
8
|
+
once<K extends keyof E>(event: K, handler: (payload: E[K]) => void): () => void;
|
|
9
|
+
emit<K extends keyof E>(event: K, payload: E[K]): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
5
13
|
interface ButtonValue {
|
|
6
14
|
id: string;
|
|
7
15
|
value: string | number;
|
|
@@ -241,17 +249,6 @@ type ServiceFallback = {
|
|
|
241
249
|
/** Primary→fallback list used when no node-scoped entry is present */
|
|
242
250
|
global?: Record<ServiceIdRef, ServiceIdRef[]>;
|
|
243
251
|
};
|
|
244
|
-
/**
|
|
245
|
-
* Optional service-map shape.
|
|
246
|
-
* Keep this loose for now so the editor can be reused by host apps.
|
|
247
|
-
*/
|
|
248
|
-
type FallbackEditorServiceRecord = {
|
|
249
|
-
id: ServiceIdRef;
|
|
250
|
-
rate?: number;
|
|
251
|
-
service_id?: ServiceIdRef;
|
|
252
|
-
[key: string]: unknown;
|
|
253
|
-
};
|
|
254
|
-
type FallbackEditorServiceMap = DgpServiceMap;
|
|
255
252
|
type FallbackRegistrationScope = "global" | "node";
|
|
256
253
|
type FallbackScopeRef = {
|
|
257
254
|
scope: "global";
|
|
@@ -298,31 +295,6 @@ type FallbackEditorState = {
|
|
|
298
295
|
current: ServiceFallback;
|
|
299
296
|
changed: boolean;
|
|
300
297
|
};
|
|
301
|
-
type FallbackEditorOptions = {
|
|
302
|
-
/**
|
|
303
|
-
* The editable payload.
|
|
304
|
-
* The editor clones this and never mutates the caller’s object directly.
|
|
305
|
-
*/
|
|
306
|
-
fallbacks?: ServiceFallback;
|
|
307
|
-
/**
|
|
308
|
-
* Optional read-only source used to resolve node→service ownership
|
|
309
|
-
* and validate node-scoped registrations.
|
|
310
|
-
*/
|
|
311
|
-
props?: ServiceProps;
|
|
312
|
-
/**
|
|
313
|
-
* Optional runtime context enhancer.
|
|
314
|
-
* Useful for ambiguous node contexts / diagnostics.
|
|
315
|
-
*/
|
|
316
|
-
snapshot?: OrderSnapshot;
|
|
317
|
-
/**
|
|
318
|
-
* Optional service map used for rate / existence validation.
|
|
319
|
-
*/
|
|
320
|
-
services?: FallbackEditorServiceMap;
|
|
321
|
-
/**
|
|
322
|
-
* Optional fallback policy.
|
|
323
|
-
*/
|
|
324
|
-
settings?: FallbackSettings;
|
|
325
|
-
};
|
|
326
298
|
type FallbackMutationOptions = {
|
|
327
299
|
/**
|
|
328
300
|
* When true, reject candidates failing validation.
|
|
@@ -335,47 +307,6 @@ type FallbackMutationOptions = {
|
|
|
335
307
|
*/
|
|
336
308
|
index?: number;
|
|
337
309
|
};
|
|
338
|
-
interface FallbackEditor {
|
|
339
|
-
/** Returns original + current editable state */
|
|
340
|
-
state(): FallbackEditorState;
|
|
341
|
-
/** Returns the current editable fallback payload */
|
|
342
|
-
value(): ServiceFallback;
|
|
343
|
-
/** Restores current back to original */
|
|
344
|
-
reset(): FallbackEditorState;
|
|
345
|
-
/**
|
|
346
|
-
* Returns all registrations belonging to a given primary DGP service.
|
|
347
|
-
*
|
|
348
|
-
* With ServiceProps:
|
|
349
|
-
* - includes global registrations
|
|
350
|
-
* - includes node registrations whose node resolves to this primary
|
|
351
|
-
*
|
|
352
|
-
* Without ServiceProps:
|
|
353
|
-
* - global registrations only
|
|
354
|
-
*/
|
|
355
|
-
get(serviceId: ServiceIdRef): FallbackRegistration[];
|
|
356
|
-
/**
|
|
357
|
-
* Direct/raw scope lookup.
|
|
358
|
-
* - global => current.global[primary] ?? []
|
|
359
|
-
* - node => current.nodes[nodeId] ?? []
|
|
360
|
-
*/
|
|
361
|
-
getScope(context: FallbackScopeRef): ServiceIdRef[];
|
|
362
|
-
/**
|
|
363
|
-
* Pure validation/preview.
|
|
364
|
-
* If candidates omitted, validates the currently stored scope value.
|
|
365
|
-
*/
|
|
366
|
-
check(context: FallbackScopeRef, candidates?: ServiceIdRef[]): FallbackCheckResult;
|
|
367
|
-
/** Adds one candidate to an exact scope */
|
|
368
|
-
add(context: FallbackScopeRef, candidate: ServiceIdRef, options?: FallbackMutationOptions): FallbackEditorState;
|
|
369
|
-
/** Adds many candidates to an exact scope */
|
|
370
|
-
addMany(context: FallbackScopeRef, candidates: ServiceIdRef[], options?: FallbackMutationOptions): FallbackEditorState;
|
|
371
|
-
/** Removes one candidate from an exact scope */
|
|
372
|
-
remove(context: FallbackScopeRef, candidate: ServiceIdRef): FallbackEditorState;
|
|
373
|
-
/** Replaces the exact scope value */
|
|
374
|
-
replace(context: FallbackScopeRef, candidates: ServiceIdRef[], options?: FallbackMutationOptions): FallbackEditorState;
|
|
375
|
-
/** Clears one exact scope value */
|
|
376
|
-
clear(context: FallbackScopeRef): FallbackEditorState;
|
|
377
|
-
}
|
|
378
|
-
declare function createFallbackEditor(options?: FallbackEditorOptions): FallbackEditor;
|
|
379
310
|
|
|
380
311
|
type PricingRole = "base" | "utility";
|
|
381
312
|
type FieldType = "custom" | (string & {});
|
|
@@ -481,46 +412,6 @@ interface UiObject {
|
|
|
481
412
|
required?: string[];
|
|
482
413
|
order?: string[];
|
|
483
414
|
}
|
|
484
|
-
/** ---------------- Typed defaults helpers ---------------- */
|
|
485
|
-
/**
|
|
486
|
-
* UiValue<U>: given a Ui node U, infer the runtime value type.
|
|
487
|
-
*/
|
|
488
|
-
type UiValue<U extends Ui> = U extends {
|
|
489
|
-
type: "string";
|
|
490
|
-
} ? string : U extends {
|
|
491
|
-
type: "number";
|
|
492
|
-
} ? number : U extends {
|
|
493
|
-
type: "boolean";
|
|
494
|
-
} ? boolean : U extends {
|
|
495
|
-
type: "anyOf";
|
|
496
|
-
multiple: true;
|
|
497
|
-
} ? Array<U["items"][number]["value"]> : U extends {
|
|
498
|
-
type: "anyOf";
|
|
499
|
-
} ? U["items"][number]["value"] : U extends {
|
|
500
|
-
type: "array";
|
|
501
|
-
item: infer I extends Ui;
|
|
502
|
-
} ? Array<UiValue<I>> : U extends {
|
|
503
|
-
type: "array";
|
|
504
|
-
items: infer T extends Ui[];
|
|
505
|
-
} ? {
|
|
506
|
-
[K in keyof T]: UiValue<T[K]>;
|
|
507
|
-
} : U extends {
|
|
508
|
-
type: "object";
|
|
509
|
-
fields: infer F extends Record<string, Ui>;
|
|
510
|
-
} ? {
|
|
511
|
-
[K in keyof F]?: UiValue<F[K]>;
|
|
512
|
-
} : unknown;
|
|
513
|
-
/**
|
|
514
|
-
* FieldWithTypedDefaults<T>: same shape as BaseFieldUI, but:
|
|
515
|
-
* - ui is a concrete map T (propName → Ui node)
|
|
516
|
-
* - defaults are auto-typed from T via UiValue
|
|
517
|
-
*/
|
|
518
|
-
type FieldWithTypedDefaults<T extends Record<string, Ui>> = Omit<BaseFieldUI, "ui" | "defaults"> & {
|
|
519
|
-
ui: T;
|
|
520
|
-
defaults?: Partial<{
|
|
521
|
-
[K in keyof T]: UiValue<T[K]>;
|
|
522
|
-
}>;
|
|
523
|
-
};
|
|
524
415
|
type FieldOption = {
|
|
525
416
|
id: string;
|
|
526
417
|
label: string;
|
|
@@ -549,11 +440,6 @@ type Field = BaseFieldUI & {
|
|
|
549
440
|
service_id?: number;
|
|
550
441
|
} & WithQuantityDefault));
|
|
551
442
|
type ConstraintKey = string;
|
|
552
|
-
/**
|
|
553
|
-
* Back-compat alias: older code may still import FlagKey.
|
|
554
|
-
* Keeping this prevents a wave of TS errors while still allowing any string key.
|
|
555
|
-
*/
|
|
556
|
-
type FlagKey = ConstraintKey;
|
|
557
443
|
type Tag = {
|
|
558
444
|
id: string;
|
|
559
445
|
label: string;
|
|
@@ -637,10 +523,6 @@ type GraphSnapshot = {
|
|
|
637
523
|
nodes: GraphNode[];
|
|
638
524
|
edges: GraphEdge[];
|
|
639
525
|
};
|
|
640
|
-
type FlowNode = NodeProps<{
|
|
641
|
-
node: GraphNode;
|
|
642
|
-
[x: string]: any;
|
|
643
|
-
}>;
|
|
644
526
|
|
|
645
527
|
type CommentId = string;
|
|
646
528
|
type ThreadId = string;
|
|
@@ -769,10 +651,6 @@ type CanvasEvents = {
|
|
|
769
651
|
error?: any;
|
|
770
652
|
};
|
|
771
653
|
};
|
|
772
|
-
type NodeView = GraphNode & {
|
|
773
|
-
position?: NodePos;
|
|
774
|
-
};
|
|
775
|
-
type EdgeView = GraphEdge;
|
|
776
654
|
type CanvasOptions = {
|
|
777
655
|
initialViewport?: Partial<Viewport>;
|
|
778
656
|
autoEmitState?: boolean;
|
|
@@ -864,6 +742,39 @@ interface Builder {
|
|
|
864
742
|
getNodeMap(): NodeMap;
|
|
865
743
|
}
|
|
866
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Keep the editor contract exactly as discussed:
|
|
747
|
+
* - mutates only ServiceFallback (internal clone)
|
|
748
|
+
* - props are read-only context
|
|
749
|
+
* - get(serviceId) is service-centric
|
|
750
|
+
* - getScope(context) is raw scope access
|
|
751
|
+
*/
|
|
752
|
+
interface FallbackEditor$1 {
|
|
753
|
+
state(): FallbackEditorState;
|
|
754
|
+
value(): ServiceFallback;
|
|
755
|
+
reset(): FallbackEditorState;
|
|
756
|
+
/** Service-centric: all registrations that belong to this primary service */
|
|
757
|
+
get(serviceId: ServiceIdRef): FallbackRegistration[];
|
|
758
|
+
/** Exact/raw scope access */
|
|
759
|
+
getScope(context: FallbackScopeRef): ServiceIdRef[];
|
|
760
|
+
/** Validation preview */
|
|
761
|
+
check(context: FallbackScopeRef, candidates?: ServiceIdRef[]): FallbackCheckResult;
|
|
762
|
+
add(context: FallbackScopeRef, candidate: ServiceIdRef, options?: FallbackMutationOptions): FallbackEditorState;
|
|
763
|
+
addMany(context: FallbackScopeRef, candidates: ServiceIdRef[], options?: FallbackMutationOptions): FallbackEditorState;
|
|
764
|
+
remove(context: FallbackScopeRef, candidate: ServiceIdRef): FallbackEditorState;
|
|
765
|
+
replace(context: FallbackScopeRef, candidates: ServiceIdRef[], options?: FallbackMutationOptions): FallbackEditorState;
|
|
766
|
+
clear(context: FallbackScopeRef): FallbackEditorState;
|
|
767
|
+
/**
|
|
768
|
+
* Optional helper for picker UIs:
|
|
769
|
+
* shows candidates that the core fallback resolver would currently accept.
|
|
770
|
+
*/
|
|
771
|
+
eligible(context: FallbackScopeRef, options?: {
|
|
772
|
+
exclude?: ServiceIdRef[];
|
|
773
|
+
unique?: boolean;
|
|
774
|
+
limit?: number;
|
|
775
|
+
}): ServiceIdRef[];
|
|
776
|
+
}
|
|
777
|
+
|
|
867
778
|
type Env = "client" | "workspace";
|
|
868
779
|
type VisibleGroup = {
|
|
869
780
|
tagId?: string;
|
|
@@ -946,30 +857,6 @@ declare class Selection {
|
|
|
946
857
|
private findOptionById;
|
|
947
858
|
}
|
|
948
859
|
|
|
949
|
-
type EditorEvents = {
|
|
950
|
-
"editor:command": {
|
|
951
|
-
name: string;
|
|
952
|
-
payload?: any;
|
|
953
|
-
};
|
|
954
|
-
"editor:change": {
|
|
955
|
-
props: ServiceProps;
|
|
956
|
-
reason: string;
|
|
957
|
-
command?: string;
|
|
958
|
-
};
|
|
959
|
-
"editor:undo": {
|
|
960
|
-
stackSize: number;
|
|
961
|
-
index: number;
|
|
962
|
-
};
|
|
963
|
-
"editor:redo": {
|
|
964
|
-
stackSize: number;
|
|
965
|
-
index: number;
|
|
966
|
-
};
|
|
967
|
-
"editor:error": {
|
|
968
|
-
message: string;
|
|
969
|
-
code?: string;
|
|
970
|
-
meta?: any;
|
|
971
|
-
};
|
|
972
|
-
};
|
|
973
860
|
type Command = {
|
|
974
861
|
name: string;
|
|
975
862
|
do(): void;
|
|
@@ -986,19 +873,6 @@ type EditorOptions = {
|
|
|
986
873
|
policiesRaw?: unknown;
|
|
987
874
|
selectionProps?: SelectionOptions;
|
|
988
875
|
};
|
|
989
|
-
type ConnectKind = "bind" | "include" | "exclude";
|
|
990
|
-
|
|
991
|
-
/** Exported alias so the schema generator can target an array */
|
|
992
|
-
type AdminPolicies = DynamicRule[];
|
|
993
|
-
|
|
994
|
-
type EventMap = Record<string, unknown>;
|
|
995
|
-
declare class EventBus<E extends EventMap> {
|
|
996
|
-
private listeners;
|
|
997
|
-
on<K extends keyof E>(event: K, handler: (payload: E[K]) => void): () => void;
|
|
998
|
-
once<K extends keyof E>(event: K, handler: (payload: E[K]) => void): () => void;
|
|
999
|
-
emit<K extends keyof E>(event: K, payload: E[K]): void;
|
|
1000
|
-
clear(): void;
|
|
1001
|
-
}
|
|
1002
876
|
|
|
1003
877
|
type PolicyDiagnostic = {
|
|
1004
878
|
ruleIndex: number;
|
|
@@ -1982,4 +1856,208 @@ declare function useOrderFlow(): UseOrderFlowReturn;
|
|
|
1982
1856
|
*/
|
|
1983
1857
|
declare function registerEntries(registry: Registry): void;
|
|
1984
1858
|
|
|
1985
|
-
|
|
1859
|
+
type Props$4 = {
|
|
1860
|
+
className?: string;
|
|
1861
|
+
fallbacks?: ServiceProps["fallbacks"];
|
|
1862
|
+
props?: ServiceProps;
|
|
1863
|
+
snapshot?: OrderSnapshot;
|
|
1864
|
+
primaryServices?: DgpServiceMap;
|
|
1865
|
+
eligibleServices?: DgpServiceMap;
|
|
1866
|
+
settings?: FallbackSettings;
|
|
1867
|
+
initialServiceId?: ServiceIdRef;
|
|
1868
|
+
onSettingsChange?: FallbackEditorProviderProps["onSettingsChange"];
|
|
1869
|
+
onSave?: FallbackEditorProviderProps["onSave"];
|
|
1870
|
+
onValidate?: FallbackEditorProviderProps["onValidate"];
|
|
1871
|
+
onReset?: FallbackEditorProviderProps["onReset"];
|
|
1872
|
+
};
|
|
1873
|
+
declare function FallbackEditor({ className, fallbacks, props, snapshot, primaryServices, eligibleServices, settings, initialServiceId, onSettingsChange, onSave, onValidate, onReset, }: Props$4): react_jsx_runtime.JSX.Element;
|
|
1874
|
+
|
|
1875
|
+
declare function useFallbackEditor(): {
|
|
1876
|
+
editor: FallbackEditor$1;
|
|
1877
|
+
version: number;
|
|
1878
|
+
serviceProps?: ServiceProps;
|
|
1879
|
+
snapshot?: OrderSnapshot;
|
|
1880
|
+
primaryServices: DgpServiceMap;
|
|
1881
|
+
eligibleServices: DgpServiceMap;
|
|
1882
|
+
activeServiceId?: ServiceIdRef;
|
|
1883
|
+
setActiveServiceId: React.Dispatch<React.SetStateAction<ServiceIdRef | undefined>>;
|
|
1884
|
+
activeTab: "registrations" | "settings";
|
|
1885
|
+
setActiveTab: React.Dispatch<React.SetStateAction<"registrations" | "settings">>;
|
|
1886
|
+
state: ReturnType<FallbackEditor$1["state"]>;
|
|
1887
|
+
value: ReturnType<FallbackEditor$1["value"]>;
|
|
1888
|
+
settings: FallbackSettings;
|
|
1889
|
+
settingsSaving: boolean;
|
|
1890
|
+
headerSaving: boolean;
|
|
1891
|
+
headerValidating: boolean;
|
|
1892
|
+
headerResetting: boolean;
|
|
1893
|
+
saveSettings: (next: FallbackSettings) => Promise<FallbackSettings>;
|
|
1894
|
+
saveFallbacks: () => Promise<ServiceProps["fallbacks"] | void>;
|
|
1895
|
+
validateFallbacks: () => Promise<void>;
|
|
1896
|
+
resetEditor: () => Promise<void>;
|
|
1897
|
+
reset: () => void;
|
|
1898
|
+
get: FallbackEditor$1["get"];
|
|
1899
|
+
getScope: FallbackEditor$1["getScope"];
|
|
1900
|
+
check: FallbackEditor$1["check"];
|
|
1901
|
+
eligible: FallbackEditor$1["eligible"];
|
|
1902
|
+
add: FallbackEditor$1["add"];
|
|
1903
|
+
addMany: FallbackEditor$1["addMany"];
|
|
1904
|
+
remove: FallbackEditor$1["remove"];
|
|
1905
|
+
replace: FallbackEditor$1["replace"];
|
|
1906
|
+
clear: FallbackEditor$1["clear"];
|
|
1907
|
+
};
|
|
1908
|
+
declare function useActiveFallbackRegistrations(): FallbackRegistration[];
|
|
1909
|
+
declare function usePrimaryServiceList(): {
|
|
1910
|
+
id: ServiceIdRef;
|
|
1911
|
+
name?: string;
|
|
1912
|
+
platform?: string;
|
|
1913
|
+
rate?: number;
|
|
1914
|
+
}[];
|
|
1915
|
+
declare function useEligibleServiceList(): {
|
|
1916
|
+
id: ServiceIdRef;
|
|
1917
|
+
name?: string;
|
|
1918
|
+
platform?: string;
|
|
1919
|
+
rate?: number;
|
|
1920
|
+
}[];
|
|
1921
|
+
|
|
1922
|
+
type Item = {
|
|
1923
|
+
id: ServiceIdRef;
|
|
1924
|
+
name?: string;
|
|
1925
|
+
platform?: string;
|
|
1926
|
+
rate?: number;
|
|
1927
|
+
};
|
|
1928
|
+
type Props$3 = {
|
|
1929
|
+
items: Item[];
|
|
1930
|
+
selected: Set<string>;
|
|
1931
|
+
onToggle: (id: ServiceIdRef) => void;
|
|
1932
|
+
height?: number;
|
|
1933
|
+
rowHeight?: number;
|
|
1934
|
+
emptyText?: string;
|
|
1935
|
+
};
|
|
1936
|
+
declare function VirtualServiceList({ items, selected, onToggle, height, rowHeight, emptyText, }: Props$3): react_jsx_runtime.JSX.Element;
|
|
1937
|
+
|
|
1938
|
+
type EditorSettings = {
|
|
1939
|
+
requireConstraintFit: boolean;
|
|
1940
|
+
ratePolicy: "lte_primary" | "ignore";
|
|
1941
|
+
selectionStrategy: "priority" | "cheapest";
|
|
1942
|
+
mode: "strict" | "dev";
|
|
1943
|
+
};
|
|
1944
|
+
type ServiceSummary = {
|
|
1945
|
+
id: ServiceIdRef;
|
|
1946
|
+
name: string;
|
|
1947
|
+
platform?: string;
|
|
1948
|
+
rate?: number;
|
|
1949
|
+
flags?: Record<string, boolean>;
|
|
1950
|
+
description?: string;
|
|
1951
|
+
};
|
|
1952
|
+
type RegistrationScope = "global" | "node";
|
|
1953
|
+
type RegistrationItem = {
|
|
1954
|
+
primary: ServiceIdRef;
|
|
1955
|
+
scope: RegistrationScope;
|
|
1956
|
+
scopeId?: string;
|
|
1957
|
+
nodeKind?: "tag" | "field" | "option";
|
|
1958
|
+
nodeLabel?: string;
|
|
1959
|
+
services: ServiceIdRef[];
|
|
1960
|
+
};
|
|
1961
|
+
type ValidationTone = "ok" | "warn" | "error";
|
|
1962
|
+
type ValidationMessage = {
|
|
1963
|
+
primary: ServiceIdRef;
|
|
1964
|
+
scope: RegistrationScope;
|
|
1965
|
+
scopeId?: string;
|
|
1966
|
+
candidate?: ServiceIdRef;
|
|
1967
|
+
tone: ValidationTone;
|
|
1968
|
+
title: string;
|
|
1969
|
+
message: string;
|
|
1970
|
+
};
|
|
1971
|
+
type FallbackEditorData = {
|
|
1972
|
+
services: ServiceSummary[];
|
|
1973
|
+
registrations: RegistrationItem[];
|
|
1974
|
+
diagnostics: ValidationMessage[];
|
|
1975
|
+
settings: EditorSettings;
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
declare function FallbackDetailsPanel(): react_jsx_runtime.JSX.Element;
|
|
1979
|
+
|
|
1980
|
+
type Props$2 = {
|
|
1981
|
+
onReset?: () => void | Promise<void>;
|
|
1982
|
+
onValidate?: () => void | Promise<void>;
|
|
1983
|
+
onSave?: () => void | Promise<void>;
|
|
1984
|
+
resetting?: boolean;
|
|
1985
|
+
validating?: boolean;
|
|
1986
|
+
saving?: boolean;
|
|
1987
|
+
};
|
|
1988
|
+
declare function FallbackEditorHeader({ onReset, onValidate, onSave, resetting, validating, saving, }: Props$2): react_jsx_runtime.JSX.Element;
|
|
1989
|
+
|
|
1990
|
+
declare function FallbackSettingsPanel(): react_jsx_runtime.JSX.Element;
|
|
1991
|
+
|
|
1992
|
+
type TabKey = "registrations" | "settings";
|
|
1993
|
+
type FallbackEditorProviderProps = {
|
|
1994
|
+
children: React.ReactNode;
|
|
1995
|
+
fallbacks?: ServiceProps["fallbacks"];
|
|
1996
|
+
props?: ServiceProps;
|
|
1997
|
+
snapshot?: OrderSnapshot;
|
|
1998
|
+
primaryServices?: DgpServiceMap;
|
|
1999
|
+
eligibleServices?: DgpServiceMap;
|
|
2000
|
+
settings?: FallbackSettings;
|
|
2001
|
+
initialServiceId?: ServiceIdRef;
|
|
2002
|
+
initialTab?: TabKey;
|
|
2003
|
+
onSettingsChange?: (next: FallbackSettings) => Promise<FallbackSettings> | FallbackSettings;
|
|
2004
|
+
onSave?: (next: ServiceProps["fallbacks"]) => Promise<ServiceProps["fallbacks"] | void> | ServiceProps["fallbacks"] | void;
|
|
2005
|
+
onValidate?: (next: ServiceProps["fallbacks"]) => Promise<void> | void;
|
|
2006
|
+
onReset?: () => Promise<void> | void;
|
|
2007
|
+
};
|
|
2008
|
+
type FallbackEditorContextValue = {
|
|
2009
|
+
editor: FallbackEditor$1;
|
|
2010
|
+
version: number;
|
|
2011
|
+
serviceProps?: ServiceProps;
|
|
2012
|
+
snapshot?: OrderSnapshot;
|
|
2013
|
+
primaryServices: DgpServiceMap;
|
|
2014
|
+
eligibleServices: DgpServiceMap;
|
|
2015
|
+
activeServiceId?: ServiceIdRef;
|
|
2016
|
+
setActiveServiceId: React.Dispatch<React.SetStateAction<ServiceIdRef | undefined>>;
|
|
2017
|
+
activeTab: TabKey;
|
|
2018
|
+
setActiveTab: React.Dispatch<React.SetStateAction<TabKey>>;
|
|
2019
|
+
state: ReturnType<FallbackEditor$1["state"]>;
|
|
2020
|
+
value: ReturnType<FallbackEditor$1["value"]>;
|
|
2021
|
+
settings: FallbackSettings;
|
|
2022
|
+
settingsSaving: boolean;
|
|
2023
|
+
headerSaving: boolean;
|
|
2024
|
+
headerValidating: boolean;
|
|
2025
|
+
headerResetting: boolean;
|
|
2026
|
+
saveSettings: (next: FallbackSettings) => Promise<FallbackSettings>;
|
|
2027
|
+
saveFallbacks: () => Promise<ServiceProps["fallbacks"] | void>;
|
|
2028
|
+
validateFallbacks: () => Promise<void>;
|
|
2029
|
+
resetEditor: () => Promise<void>;
|
|
2030
|
+
reset: () => void;
|
|
2031
|
+
get: FallbackEditor$1["get"];
|
|
2032
|
+
getScope: FallbackEditor$1["getScope"];
|
|
2033
|
+
check: FallbackEditor$1["check"];
|
|
2034
|
+
eligible: FallbackEditor$1["eligible"];
|
|
2035
|
+
add: FallbackEditor$1["add"];
|
|
2036
|
+
addMany: FallbackEditor$1["addMany"];
|
|
2037
|
+
remove: FallbackEditor$1["remove"];
|
|
2038
|
+
replace: FallbackEditor$1["replace"];
|
|
2039
|
+
clear: FallbackEditor$1["clear"];
|
|
2040
|
+
};
|
|
2041
|
+
declare function FallbackEditorProvider({ children, fallbacks, props, snapshot, primaryServices, eligibleServices, settings: initialSettings, initialServiceId, initialTab, onSettingsChange, onSave, onValidate, onReset, }: FallbackEditorProviderProps): react_jsx_runtime.JSX.Element;
|
|
2042
|
+
declare function useFallbackEditorContext(): FallbackEditorContextValue;
|
|
2043
|
+
|
|
2044
|
+
declare function FallbackServiceSidebar(): react_jsx_runtime.JSX.Element;
|
|
2045
|
+
|
|
2046
|
+
declare function FallbackRegistrationsPanel(): react_jsx_runtime.JSX.Element;
|
|
2047
|
+
|
|
2048
|
+
type Props$1 = {
|
|
2049
|
+
open: boolean;
|
|
2050
|
+
onClose: () => void;
|
|
2051
|
+
context: FallbackScopeRef | null;
|
|
2052
|
+
primaryId?: ServiceIdRef;
|
|
2053
|
+
};
|
|
2054
|
+
declare function FallbackAddCandidatesDialog({ open, onClose, context, primaryId, }: Props$1): react_jsx_runtime.JSX.Element | null;
|
|
2055
|
+
|
|
2056
|
+
type Props = {
|
|
2057
|
+
open: boolean;
|
|
2058
|
+
onClose: () => void;
|
|
2059
|
+
onSelect: (context: FallbackScopeRef, primaryId: ServiceIdRef) => void;
|
|
2060
|
+
};
|
|
2061
|
+
declare function FallbackAddRegistrationDialog({ open, onClose, onSelect, }: Props): react_jsx_runtime.JSX.Element | null;
|
|
2062
|
+
|
|
2063
|
+
export { type Adapter, type AdapterCtx, CanvasAPI, type EditorSettings, EventBus, type EventMap, FallbackAddCandidatesDialog, FallbackAddRegistrationDialog, FallbackDetailsPanel, FallbackEditor, type FallbackEditorData, FallbackEditorHeader, FallbackEditorProvider, type FallbackEditorProviderProps, FallbackRegistrationsPanel, FallbackServiceSidebar, FallbackSettingsPanel, type FormApi, FormProvider, type FormProviderProps, type FormSnapshot, type InputDescriptor, type InputKind, type InputVariant, type InputWrapperProps, OrderFlowProvider, Provider, type RegistrationItem, type RegistrationScope, type Registry, type ServiceSummary, type ValidationMessage, type ValidationTone, VirtualServiceList, Wrapper, createInputRegistry, registerEntries, resolveInputDescriptor, useActiveFallbackRegistrations, useEligibleServiceList, useFallbackEditor, useFallbackEditorContext, useFormApi, useInputs, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };
|