@timeax/digital-service-engine 0.3.1 → 0.3.3
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/core/index.cjs +471 -434
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1 -8
- package/dist/core/index.d.ts +1 -8
- package/dist/core/index.js +471 -434
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.cjs +1636 -1145
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +66 -29
- package/dist/react/index.d.ts +66 -29
- package/dist/react/index.js +1635 -1145
- package/dist/react/index.js.map +1 -1
- package/dist/workspace/index.cjs +651 -173
- package/dist/workspace/index.cjs.map +1 -1
- package/dist/workspace/index.d.cts +71 -24
- package/dist/workspace/index.d.ts +71 -24
- package/dist/workspace/index.js +650 -173
- package/dist/workspace/index.js.map +1 -1
- package/package.json +2 -2
package/dist/react/index.d.cts
CHANGED
|
@@ -1042,12 +1042,6 @@ type BackendResult<T> = {
|
|
|
1042
1042
|
error: BackendError;
|
|
1043
1043
|
};
|
|
1044
1044
|
type Result<T> = Promise<BackendResult<T>>;
|
|
1045
|
-
interface Actor {
|
|
1046
|
-
readonly id: string;
|
|
1047
|
-
readonly name?: string;
|
|
1048
|
-
readonly roles?: readonly string[];
|
|
1049
|
-
readonly meta?: Readonly<Record<string, unknown>>;
|
|
1050
|
-
}
|
|
1051
1045
|
interface Author {
|
|
1052
1046
|
readonly id: string;
|
|
1053
1047
|
readonly name: string;
|
|
@@ -1072,12 +1066,26 @@ interface MergeResult {
|
|
|
1072
1066
|
readonly conflicts?: number;
|
|
1073
1067
|
readonly message?: string;
|
|
1074
1068
|
}
|
|
1069
|
+
type WorkspaceLoadContext = Readonly<{
|
|
1070
|
+
workspaceId: string;
|
|
1071
|
+
actorId?: string;
|
|
1072
|
+
branchId?: string;
|
|
1073
|
+
since?: string | number;
|
|
1074
|
+
}>;
|
|
1075
|
+
type WorkspaceActorLoadContext = WorkspaceLoadContext & Readonly<{
|
|
1076
|
+
actorId: string;
|
|
1077
|
+
}>;
|
|
1078
|
+
type WorkspaceBranchLoadContext = WorkspaceLoadContext & Readonly<{
|
|
1079
|
+
branchId: string;
|
|
1080
|
+
}>;
|
|
1081
|
+
type WorkspaceActorBranchLoadContext = WorkspaceLoadContext & Readonly<{
|
|
1082
|
+
actorId: string;
|
|
1083
|
+
branchId: string;
|
|
1084
|
+
}>;
|
|
1075
1085
|
type ServicesInput = readonly DgpServiceCapability[] | DgpServiceMap;
|
|
1076
1086
|
interface ServicesBackend {
|
|
1077
|
-
get(
|
|
1078
|
-
refresh(
|
|
1079
|
-
since?: number | string;
|
|
1080
|
-
}>): Result<ServicesInput>;
|
|
1087
|
+
get(ctx: WorkspaceLoadContext): Result<ServicesInput>;
|
|
1088
|
+
refresh(ctx: WorkspaceLoadContext): Result<ServicesInput>;
|
|
1081
1089
|
}
|
|
1082
1090
|
interface BranchParticipant {
|
|
1083
1091
|
readonly id: string;
|
|
@@ -1094,10 +1102,8 @@ interface BranchParticipant {
|
|
|
1094
1102
|
readonly updatedAt?: string;
|
|
1095
1103
|
}
|
|
1096
1104
|
interface BranchAccessBackend {
|
|
1097
|
-
listParticipants(
|
|
1098
|
-
refreshParticipants(
|
|
1099
|
-
since?: number | string;
|
|
1100
|
-
}>): Result<readonly BranchParticipant[]>;
|
|
1105
|
+
listParticipants(ctx: WorkspaceBranchLoadContext): Result<readonly BranchParticipant[]>;
|
|
1106
|
+
refreshParticipants(ctx: WorkspaceBranchLoadContext): Result<readonly BranchParticipant[]>;
|
|
1101
1107
|
}
|
|
1102
1108
|
interface ServiceSnapshot {
|
|
1103
1109
|
readonly schema_version: string;
|
|
@@ -1211,12 +1217,13 @@ interface FieldTemplate {
|
|
|
1211
1217
|
}
|
|
1212
1218
|
/** Narrow list/search input */
|
|
1213
1219
|
interface TemplatesListParams {
|
|
1214
|
-
readonly workspaceId:
|
|
1215
|
-
readonly
|
|
1220
|
+
readonly workspaceId: WorkspaceLoadContext["workspaceId"];
|
|
1221
|
+
readonly actorId?: WorkspaceLoadContext["actorId"];
|
|
1222
|
+
readonly branchId?: WorkspaceLoadContext["branchId"];
|
|
1216
1223
|
readonly q?: string;
|
|
1217
1224
|
readonly tags?: readonly string[];
|
|
1218
1225
|
readonly category?: string;
|
|
1219
|
-
readonly since?:
|
|
1226
|
+
readonly since?: WorkspaceLoadContext["since"];
|
|
1220
1227
|
}
|
|
1221
1228
|
interface TemplateCreateInput {
|
|
1222
1229
|
readonly key?: string;
|
|
@@ -1264,23 +1271,23 @@ interface TemplatesBackend {
|
|
|
1264
1271
|
refresh(params: Omit<TemplatesListParams, "q" | "tags" | "category">): Result<readonly FieldTemplate[]>;
|
|
1265
1272
|
}
|
|
1266
1273
|
interface AuthorsBackend {
|
|
1267
|
-
list(
|
|
1274
|
+
list(ctx: WorkspaceLoadContext): Result<readonly Author[]>;
|
|
1268
1275
|
get(authorId: string): Result<Author | null>;
|
|
1269
|
-
refresh(
|
|
1276
|
+
refresh(ctx: WorkspaceLoadContext): Result<readonly Author[]>;
|
|
1270
1277
|
}
|
|
1271
1278
|
interface PermissionsBackend {
|
|
1272
|
-
get(
|
|
1273
|
-
refresh(
|
|
1279
|
+
get(ctx: WorkspaceActorLoadContext): Result<PermissionsMap>;
|
|
1280
|
+
refresh(ctx: WorkspaceActorLoadContext): Result<PermissionsMap>;
|
|
1274
1281
|
}
|
|
1275
1282
|
interface BranchesBackend {
|
|
1276
|
-
list(
|
|
1283
|
+
list(ctx: WorkspaceLoadContext): Result<readonly Branch[]>;
|
|
1277
1284
|
create(workspaceId: string, name: string, opts?: Readonly<{
|
|
1278
1285
|
fromId?: string;
|
|
1279
1286
|
}>): Result<Branch>;
|
|
1280
1287
|
setMain(workspaceId: string, branchId: string): Result<Branch>;
|
|
1281
1288
|
merge(workspaceId: string, sourceId: string, targetId: string): Result<MergeResult>;
|
|
1282
1289
|
delete(workspaceId: string, branchId: string): Result<void>;
|
|
1283
|
-
refresh(
|
|
1290
|
+
refresh(ctx: WorkspaceLoadContext): Result<readonly Branch[]>;
|
|
1284
1291
|
}
|
|
1285
1292
|
interface WorkspaceInfo {
|
|
1286
1293
|
readonly id: string;
|
|
@@ -1295,10 +1302,7 @@ interface WorkspaceInfo {
|
|
|
1295
1302
|
* This is intentionally transport-agnostic and minimal so other layers (e.g. canvas/comments)
|
|
1296
1303
|
* can reuse it without redefining identity types.
|
|
1297
1304
|
*/
|
|
1298
|
-
interface BackendScope {
|
|
1299
|
-
readonly workspaceId: string;
|
|
1300
|
-
readonly actorId: string;
|
|
1301
|
-
readonly branchId: string;
|
|
1305
|
+
interface BackendScope extends WorkspaceActorBranchLoadContext {
|
|
1302
1306
|
}
|
|
1303
1307
|
/**
|
|
1304
1308
|
* Generic canvas comments backend contract.
|
|
@@ -1349,7 +1353,7 @@ interface CommentsBackend<ThreadDTO = unknown, MessageDTO = unknown, AnchorDTO =
|
|
|
1349
1353
|
* - If branchId is provided -> branch-scoped policies
|
|
1350
1354
|
* - If branchId is omitted -> workspace-scoped policies
|
|
1351
1355
|
*/
|
|
1352
|
-
interface PolicyScope extends
|
|
1356
|
+
interface PolicyScope extends WorkspaceActorLoadContext {
|
|
1353
1357
|
}
|
|
1354
1358
|
interface PoliciesLoadResult {
|
|
1355
1359
|
/** the raw JSON the host stored (authoring format) */
|
|
@@ -1476,6 +1480,7 @@ type DuplicateOptions = {
|
|
|
1476
1480
|
nameStrategy?: (old?: string) => string | undefined;
|
|
1477
1481
|
optionIdStrategy?: (old: string) => string;
|
|
1478
1482
|
};
|
|
1483
|
+
type DuplicateManyOptions = Omit<DuplicateOptions, "id">;
|
|
1479
1484
|
type EditorNodeLookup = {
|
|
1480
1485
|
kind: "tag";
|
|
1481
1486
|
data?: Tag;
|
|
@@ -1528,6 +1533,7 @@ declare class Editor {
|
|
|
1528
1533
|
redo(): boolean;
|
|
1529
1534
|
clearService(id: string): void;
|
|
1530
1535
|
duplicate(ref: NodeRef, opts?: DuplicateOptions): string;
|
|
1536
|
+
duplicateMany(ids: readonly string[], opts?: DuplicateManyOptions): string[];
|
|
1531
1537
|
reLabel(id: string, nextLabel: string): void;
|
|
1532
1538
|
setFieldName(fieldId: string, nextName: string | null | undefined): void;
|
|
1533
1539
|
getLastPolicyDiagnostics(): PolicyDiagnostic[] | undefined;
|
|
@@ -1580,6 +1586,29 @@ declare class Editor {
|
|
|
1580
1586
|
updateField(id: string, patch: Partial<Field>): void;
|
|
1581
1587
|
removeField(id: string): void;
|
|
1582
1588
|
remove(id: string): void;
|
|
1589
|
+
removeMany(ids: readonly string[]): void;
|
|
1590
|
+
clearServiceMany(ids: readonly string[]): void;
|
|
1591
|
+
rebindMany(ids: readonly string[], targetTagId: string, opts?: {
|
|
1592
|
+
allowTagCycles?: boolean;
|
|
1593
|
+
}): void;
|
|
1594
|
+
includeMany(receiverId: string, ids: readonly string[]): void;
|
|
1595
|
+
excludeMany(receiverId: string, ids: readonly string[]): void;
|
|
1596
|
+
clearRelationsMany(ids: readonly string[], mode?: "owned" | "incoming" | "both"): void;
|
|
1597
|
+
renameLabelsMany(ids: readonly string[], input: {
|
|
1598
|
+
prefix?: string;
|
|
1599
|
+
suffix?: string;
|
|
1600
|
+
}): void;
|
|
1601
|
+
setPricingRoleMany(ids: readonly string[], role: "base" | "utility"): void;
|
|
1602
|
+
clearFieldDefaultsMany(ids: readonly string[]): void;
|
|
1603
|
+
clearFieldValidationMany(ids: readonly string[]): void;
|
|
1604
|
+
autoCreateOptionsMany(ids: readonly string[], makeOption?: (fieldId: string) => {
|
|
1605
|
+
id?: string;
|
|
1606
|
+
label: string;
|
|
1607
|
+
value?: string | number;
|
|
1608
|
+
}): void;
|
|
1609
|
+
clearAllOptionsMany(ids: readonly string[]): void;
|
|
1610
|
+
removeNoticesForNodes(ids: readonly string[]): void;
|
|
1611
|
+
setNoticesVisibilityForNodes(ids: readonly string[], type: "public" | "private"): void;
|
|
1583
1612
|
getNode(id: string): EditorNodeLookup;
|
|
1584
1613
|
getFieldQuantityRule(id: string): QuantityRule | undefined;
|
|
1585
1614
|
setFieldQuantityRule(id: string, rule: unknown): void;
|
|
@@ -1816,11 +1845,18 @@ type Adapter = {
|
|
|
1816
1845
|
getInputPropsFromField?: (props: AdapterCtx) => any;
|
|
1817
1846
|
toValue?: (value: any) => any;
|
|
1818
1847
|
};
|
|
1848
|
+
type InputOptionCapability = {
|
|
1849
|
+
supported?: boolean;
|
|
1850
|
+
autoCreate?: boolean;
|
|
1851
|
+
defaultLabel?: string;
|
|
1852
|
+
defaultValue?: string | number;
|
|
1853
|
+
};
|
|
1819
1854
|
type InputDescriptor = {
|
|
1820
1855
|
Component: React.ComponentType<Record<string, unknown>>;
|
|
1821
1856
|
adapter?: Adapter;
|
|
1822
1857
|
defaultProps?: Record<string, unknown>;
|
|
1823
1858
|
ui?: Record<string, Ui>;
|
|
1859
|
+
options?: InputOptionCapability;
|
|
1824
1860
|
};
|
|
1825
1861
|
type VariantMap = Map<InputVariant, InputDescriptor>;
|
|
1826
1862
|
type RegistryStore = Map<InputKind, VariantMap>;
|
|
@@ -1856,6 +1892,7 @@ declare function Provider({ children, initialRegistry, }: {
|
|
|
1856
1892
|
initialRegistry?: Registry;
|
|
1857
1893
|
}): react_jsx_runtime.JSX.Element;
|
|
1858
1894
|
declare function useInputs(): InputsCtxValue;
|
|
1895
|
+
declare function useInputsMaybe(): InputsCtxValue | null;
|
|
1859
1896
|
|
|
1860
1897
|
type InputWrapperProps = {
|
|
1861
1898
|
field: Field;
|
|
@@ -2246,4 +2283,4 @@ type Props = {
|
|
|
2246
2283
|
};
|
|
2247
2284
|
declare function FallbackAddRegistrationDialog({ open, onClose, onSelect, }: Props): react_jsx_runtime.JSX.Element | null;
|
|
2248
2285
|
|
|
2249
|
-
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 };
|
|
2286
|
+
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 InputOptionCapability, 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, useInputsMaybe, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1042,12 +1042,6 @@ type BackendResult<T> = {
|
|
|
1042
1042
|
error: BackendError;
|
|
1043
1043
|
};
|
|
1044
1044
|
type Result<T> = Promise<BackendResult<T>>;
|
|
1045
|
-
interface Actor {
|
|
1046
|
-
readonly id: string;
|
|
1047
|
-
readonly name?: string;
|
|
1048
|
-
readonly roles?: readonly string[];
|
|
1049
|
-
readonly meta?: Readonly<Record<string, unknown>>;
|
|
1050
|
-
}
|
|
1051
1045
|
interface Author {
|
|
1052
1046
|
readonly id: string;
|
|
1053
1047
|
readonly name: string;
|
|
@@ -1072,12 +1066,26 @@ interface MergeResult {
|
|
|
1072
1066
|
readonly conflicts?: number;
|
|
1073
1067
|
readonly message?: string;
|
|
1074
1068
|
}
|
|
1069
|
+
type WorkspaceLoadContext = Readonly<{
|
|
1070
|
+
workspaceId: string;
|
|
1071
|
+
actorId?: string;
|
|
1072
|
+
branchId?: string;
|
|
1073
|
+
since?: string | number;
|
|
1074
|
+
}>;
|
|
1075
|
+
type WorkspaceActorLoadContext = WorkspaceLoadContext & Readonly<{
|
|
1076
|
+
actorId: string;
|
|
1077
|
+
}>;
|
|
1078
|
+
type WorkspaceBranchLoadContext = WorkspaceLoadContext & Readonly<{
|
|
1079
|
+
branchId: string;
|
|
1080
|
+
}>;
|
|
1081
|
+
type WorkspaceActorBranchLoadContext = WorkspaceLoadContext & Readonly<{
|
|
1082
|
+
actorId: string;
|
|
1083
|
+
branchId: string;
|
|
1084
|
+
}>;
|
|
1075
1085
|
type ServicesInput = readonly DgpServiceCapability[] | DgpServiceMap;
|
|
1076
1086
|
interface ServicesBackend {
|
|
1077
|
-
get(
|
|
1078
|
-
refresh(
|
|
1079
|
-
since?: number | string;
|
|
1080
|
-
}>): Result<ServicesInput>;
|
|
1087
|
+
get(ctx: WorkspaceLoadContext): Result<ServicesInput>;
|
|
1088
|
+
refresh(ctx: WorkspaceLoadContext): Result<ServicesInput>;
|
|
1081
1089
|
}
|
|
1082
1090
|
interface BranchParticipant {
|
|
1083
1091
|
readonly id: string;
|
|
@@ -1094,10 +1102,8 @@ interface BranchParticipant {
|
|
|
1094
1102
|
readonly updatedAt?: string;
|
|
1095
1103
|
}
|
|
1096
1104
|
interface BranchAccessBackend {
|
|
1097
|
-
listParticipants(
|
|
1098
|
-
refreshParticipants(
|
|
1099
|
-
since?: number | string;
|
|
1100
|
-
}>): Result<readonly BranchParticipant[]>;
|
|
1105
|
+
listParticipants(ctx: WorkspaceBranchLoadContext): Result<readonly BranchParticipant[]>;
|
|
1106
|
+
refreshParticipants(ctx: WorkspaceBranchLoadContext): Result<readonly BranchParticipant[]>;
|
|
1101
1107
|
}
|
|
1102
1108
|
interface ServiceSnapshot {
|
|
1103
1109
|
readonly schema_version: string;
|
|
@@ -1211,12 +1217,13 @@ interface FieldTemplate {
|
|
|
1211
1217
|
}
|
|
1212
1218
|
/** Narrow list/search input */
|
|
1213
1219
|
interface TemplatesListParams {
|
|
1214
|
-
readonly workspaceId:
|
|
1215
|
-
readonly
|
|
1220
|
+
readonly workspaceId: WorkspaceLoadContext["workspaceId"];
|
|
1221
|
+
readonly actorId?: WorkspaceLoadContext["actorId"];
|
|
1222
|
+
readonly branchId?: WorkspaceLoadContext["branchId"];
|
|
1216
1223
|
readonly q?: string;
|
|
1217
1224
|
readonly tags?: readonly string[];
|
|
1218
1225
|
readonly category?: string;
|
|
1219
|
-
readonly since?:
|
|
1226
|
+
readonly since?: WorkspaceLoadContext["since"];
|
|
1220
1227
|
}
|
|
1221
1228
|
interface TemplateCreateInput {
|
|
1222
1229
|
readonly key?: string;
|
|
@@ -1264,23 +1271,23 @@ interface TemplatesBackend {
|
|
|
1264
1271
|
refresh(params: Omit<TemplatesListParams, "q" | "tags" | "category">): Result<readonly FieldTemplate[]>;
|
|
1265
1272
|
}
|
|
1266
1273
|
interface AuthorsBackend {
|
|
1267
|
-
list(
|
|
1274
|
+
list(ctx: WorkspaceLoadContext): Result<readonly Author[]>;
|
|
1268
1275
|
get(authorId: string): Result<Author | null>;
|
|
1269
|
-
refresh(
|
|
1276
|
+
refresh(ctx: WorkspaceLoadContext): Result<readonly Author[]>;
|
|
1270
1277
|
}
|
|
1271
1278
|
interface PermissionsBackend {
|
|
1272
|
-
get(
|
|
1273
|
-
refresh(
|
|
1279
|
+
get(ctx: WorkspaceActorLoadContext): Result<PermissionsMap>;
|
|
1280
|
+
refresh(ctx: WorkspaceActorLoadContext): Result<PermissionsMap>;
|
|
1274
1281
|
}
|
|
1275
1282
|
interface BranchesBackend {
|
|
1276
|
-
list(
|
|
1283
|
+
list(ctx: WorkspaceLoadContext): Result<readonly Branch[]>;
|
|
1277
1284
|
create(workspaceId: string, name: string, opts?: Readonly<{
|
|
1278
1285
|
fromId?: string;
|
|
1279
1286
|
}>): Result<Branch>;
|
|
1280
1287
|
setMain(workspaceId: string, branchId: string): Result<Branch>;
|
|
1281
1288
|
merge(workspaceId: string, sourceId: string, targetId: string): Result<MergeResult>;
|
|
1282
1289
|
delete(workspaceId: string, branchId: string): Result<void>;
|
|
1283
|
-
refresh(
|
|
1290
|
+
refresh(ctx: WorkspaceLoadContext): Result<readonly Branch[]>;
|
|
1284
1291
|
}
|
|
1285
1292
|
interface WorkspaceInfo {
|
|
1286
1293
|
readonly id: string;
|
|
@@ -1295,10 +1302,7 @@ interface WorkspaceInfo {
|
|
|
1295
1302
|
* This is intentionally transport-agnostic and minimal so other layers (e.g. canvas/comments)
|
|
1296
1303
|
* can reuse it without redefining identity types.
|
|
1297
1304
|
*/
|
|
1298
|
-
interface BackendScope {
|
|
1299
|
-
readonly workspaceId: string;
|
|
1300
|
-
readonly actorId: string;
|
|
1301
|
-
readonly branchId: string;
|
|
1305
|
+
interface BackendScope extends WorkspaceActorBranchLoadContext {
|
|
1302
1306
|
}
|
|
1303
1307
|
/**
|
|
1304
1308
|
* Generic canvas comments backend contract.
|
|
@@ -1349,7 +1353,7 @@ interface CommentsBackend<ThreadDTO = unknown, MessageDTO = unknown, AnchorDTO =
|
|
|
1349
1353
|
* - If branchId is provided -> branch-scoped policies
|
|
1350
1354
|
* - If branchId is omitted -> workspace-scoped policies
|
|
1351
1355
|
*/
|
|
1352
|
-
interface PolicyScope extends
|
|
1356
|
+
interface PolicyScope extends WorkspaceActorLoadContext {
|
|
1353
1357
|
}
|
|
1354
1358
|
interface PoliciesLoadResult {
|
|
1355
1359
|
/** the raw JSON the host stored (authoring format) */
|
|
@@ -1476,6 +1480,7 @@ type DuplicateOptions = {
|
|
|
1476
1480
|
nameStrategy?: (old?: string) => string | undefined;
|
|
1477
1481
|
optionIdStrategy?: (old: string) => string;
|
|
1478
1482
|
};
|
|
1483
|
+
type DuplicateManyOptions = Omit<DuplicateOptions, "id">;
|
|
1479
1484
|
type EditorNodeLookup = {
|
|
1480
1485
|
kind: "tag";
|
|
1481
1486
|
data?: Tag;
|
|
@@ -1528,6 +1533,7 @@ declare class Editor {
|
|
|
1528
1533
|
redo(): boolean;
|
|
1529
1534
|
clearService(id: string): void;
|
|
1530
1535
|
duplicate(ref: NodeRef, opts?: DuplicateOptions): string;
|
|
1536
|
+
duplicateMany(ids: readonly string[], opts?: DuplicateManyOptions): string[];
|
|
1531
1537
|
reLabel(id: string, nextLabel: string): void;
|
|
1532
1538
|
setFieldName(fieldId: string, nextName: string | null | undefined): void;
|
|
1533
1539
|
getLastPolicyDiagnostics(): PolicyDiagnostic[] | undefined;
|
|
@@ -1580,6 +1586,29 @@ declare class Editor {
|
|
|
1580
1586
|
updateField(id: string, patch: Partial<Field>): void;
|
|
1581
1587
|
removeField(id: string): void;
|
|
1582
1588
|
remove(id: string): void;
|
|
1589
|
+
removeMany(ids: readonly string[]): void;
|
|
1590
|
+
clearServiceMany(ids: readonly string[]): void;
|
|
1591
|
+
rebindMany(ids: readonly string[], targetTagId: string, opts?: {
|
|
1592
|
+
allowTagCycles?: boolean;
|
|
1593
|
+
}): void;
|
|
1594
|
+
includeMany(receiverId: string, ids: readonly string[]): void;
|
|
1595
|
+
excludeMany(receiverId: string, ids: readonly string[]): void;
|
|
1596
|
+
clearRelationsMany(ids: readonly string[], mode?: "owned" | "incoming" | "both"): void;
|
|
1597
|
+
renameLabelsMany(ids: readonly string[], input: {
|
|
1598
|
+
prefix?: string;
|
|
1599
|
+
suffix?: string;
|
|
1600
|
+
}): void;
|
|
1601
|
+
setPricingRoleMany(ids: readonly string[], role: "base" | "utility"): void;
|
|
1602
|
+
clearFieldDefaultsMany(ids: readonly string[]): void;
|
|
1603
|
+
clearFieldValidationMany(ids: readonly string[]): void;
|
|
1604
|
+
autoCreateOptionsMany(ids: readonly string[], makeOption?: (fieldId: string) => {
|
|
1605
|
+
id?: string;
|
|
1606
|
+
label: string;
|
|
1607
|
+
value?: string | number;
|
|
1608
|
+
}): void;
|
|
1609
|
+
clearAllOptionsMany(ids: readonly string[]): void;
|
|
1610
|
+
removeNoticesForNodes(ids: readonly string[]): void;
|
|
1611
|
+
setNoticesVisibilityForNodes(ids: readonly string[], type: "public" | "private"): void;
|
|
1583
1612
|
getNode(id: string): EditorNodeLookup;
|
|
1584
1613
|
getFieldQuantityRule(id: string): QuantityRule | undefined;
|
|
1585
1614
|
setFieldQuantityRule(id: string, rule: unknown): void;
|
|
@@ -1816,11 +1845,18 @@ type Adapter = {
|
|
|
1816
1845
|
getInputPropsFromField?: (props: AdapterCtx) => any;
|
|
1817
1846
|
toValue?: (value: any) => any;
|
|
1818
1847
|
};
|
|
1848
|
+
type InputOptionCapability = {
|
|
1849
|
+
supported?: boolean;
|
|
1850
|
+
autoCreate?: boolean;
|
|
1851
|
+
defaultLabel?: string;
|
|
1852
|
+
defaultValue?: string | number;
|
|
1853
|
+
};
|
|
1819
1854
|
type InputDescriptor = {
|
|
1820
1855
|
Component: React.ComponentType<Record<string, unknown>>;
|
|
1821
1856
|
adapter?: Adapter;
|
|
1822
1857
|
defaultProps?: Record<string, unknown>;
|
|
1823
1858
|
ui?: Record<string, Ui>;
|
|
1859
|
+
options?: InputOptionCapability;
|
|
1824
1860
|
};
|
|
1825
1861
|
type VariantMap = Map<InputVariant, InputDescriptor>;
|
|
1826
1862
|
type RegistryStore = Map<InputKind, VariantMap>;
|
|
@@ -1856,6 +1892,7 @@ declare function Provider({ children, initialRegistry, }: {
|
|
|
1856
1892
|
initialRegistry?: Registry;
|
|
1857
1893
|
}): react_jsx_runtime.JSX.Element;
|
|
1858
1894
|
declare function useInputs(): InputsCtxValue;
|
|
1895
|
+
declare function useInputsMaybe(): InputsCtxValue | null;
|
|
1859
1896
|
|
|
1860
1897
|
type InputWrapperProps = {
|
|
1861
1898
|
field: Field;
|
|
@@ -2246,4 +2283,4 @@ type Props = {
|
|
|
2246
2283
|
};
|
|
2247
2284
|
declare function FallbackAddRegistrationDialog({ open, onClose, onSelect, }: Props): react_jsx_runtime.JSX.Element | null;
|
|
2248
2285
|
|
|
2249
|
-
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 };
|
|
2286
|
+
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 InputOptionCapability, 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, useInputsMaybe, useOptionalFormApi, useOrderFlow, useOrderFlowContext, usePrimaryServiceList };
|