@uniformdev/mesh-sdk 20.63.0 → 20.63.1-alpha.17
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/index.d.mts +390 -27
- package/dist/index.d.ts +390 -27
- package/dist/index.esm.js +109 -2
- package/dist/index.js +109 -2
- package/dist/index.mjs +109 -2
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
|
|
2
|
-
import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys,
|
|
2
|
+
import { AssetParamValue, DataType, DataSource, DataResourceVariables, DataSourceVariantsKeys, ComponentDefinition, RootComponentInstance, ComponentInstance, ComponentDefinitionParameter, DataVariableDefinition, Locale, EntryData, ComponentParameter, VisibilityCriteriaGroup } from '@uniformdev/canvas';
|
|
3
3
|
export { AssetParamValue, AssetParamValueItem } from '@uniformdev/canvas';
|
|
4
4
|
import { ProjectMapNode } from '@uniformdev/project-map';
|
|
5
5
|
import { AssetDefinitionType } from '@uniformdev/assets';
|
|
@@ -17,8 +17,11 @@ interface paths$1 {
|
|
|
17
17
|
get: {
|
|
18
18
|
parameters: {
|
|
19
19
|
query: {
|
|
20
|
+
/** @description The team ID */
|
|
20
21
|
teamId: string;
|
|
22
|
+
/** @description Whether to include Mesh apps that are shared publicly to all teams, or only custom apps registered on this team. */
|
|
21
23
|
includePublic?: boolean | null;
|
|
24
|
+
/** @description Whether to use team-specific integration types or team-agnostic types (for serialization across projects) */
|
|
22
25
|
teamSpecificType?: boolean | null;
|
|
23
26
|
};
|
|
24
27
|
header?: never;
|
|
@@ -174,6 +177,18 @@ interface paths$1 {
|
|
|
174
177
|
};
|
|
175
178
|
};
|
|
176
179
|
embeddedEditor?: string;
|
|
180
|
+
dataResourceSelectorUrl?: string;
|
|
181
|
+
dataResourceSelectorLocations?: {
|
|
182
|
+
[key: string]: {
|
|
183
|
+
url: string;
|
|
184
|
+
layout?: {
|
|
185
|
+
/** @enum {string} */
|
|
186
|
+
height?: "full-height";
|
|
187
|
+
/** @enum {string} */
|
|
188
|
+
width?: "wide";
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
177
192
|
};
|
|
178
193
|
};
|
|
179
194
|
badgeIconUrl?: string;
|
|
@@ -210,7 +225,6 @@ interface paths$1 {
|
|
|
210
225
|
generateUrl: string;
|
|
211
226
|
metadataUrl?: string;
|
|
212
227
|
prompts?: {
|
|
213
|
-
/** Format: uuid */
|
|
214
228
|
id: string;
|
|
215
229
|
name: string;
|
|
216
230
|
text: string;
|
|
@@ -269,7 +283,6 @@ interface paths$1 {
|
|
|
269
283
|
}[];
|
|
270
284
|
};
|
|
271
285
|
unstable_prompts?: {
|
|
272
|
-
/** Format: uuid */
|
|
273
286
|
id: string;
|
|
274
287
|
name: string;
|
|
275
288
|
text: string;
|
|
@@ -308,10 +321,7 @@ interface paths$1 {
|
|
|
308
321
|
requestBody: {
|
|
309
322
|
content: {
|
|
310
323
|
"application/json": {
|
|
311
|
-
/**
|
|
312
|
-
* Format: uuid
|
|
313
|
-
* @description The team ID
|
|
314
|
-
*/
|
|
324
|
+
/** @description The team ID */
|
|
315
325
|
teamId: string;
|
|
316
326
|
data: {
|
|
317
327
|
type: string;
|
|
@@ -452,6 +462,18 @@ interface paths$1 {
|
|
|
452
462
|
};
|
|
453
463
|
};
|
|
454
464
|
embeddedEditor?: string;
|
|
465
|
+
dataResourceSelectorUrl?: string;
|
|
466
|
+
dataResourceSelectorLocations?: {
|
|
467
|
+
[key: string]: {
|
|
468
|
+
url: string;
|
|
469
|
+
layout?: {
|
|
470
|
+
/** @enum {string} */
|
|
471
|
+
height?: "full-height";
|
|
472
|
+
/** @enum {string} */
|
|
473
|
+
width?: "wide";
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
};
|
|
455
477
|
};
|
|
456
478
|
};
|
|
457
479
|
badgeIconUrl?: string;
|
|
@@ -488,7 +510,6 @@ interface paths$1 {
|
|
|
488
510
|
generateUrl: string;
|
|
489
511
|
metadataUrl?: string;
|
|
490
512
|
prompts?: {
|
|
491
|
-
/** Format: uuid */
|
|
492
513
|
id: string;
|
|
493
514
|
name: string;
|
|
494
515
|
text: string;
|
|
@@ -547,7 +568,6 @@ interface paths$1 {
|
|
|
547
568
|
}[];
|
|
548
569
|
};
|
|
549
570
|
unstable_prompts?: {
|
|
550
|
-
/** Format: uuid */
|
|
551
571
|
id: string;
|
|
552
572
|
name: string;
|
|
553
573
|
text: string;
|
|
@@ -715,6 +735,18 @@ interface paths$1 {
|
|
|
715
735
|
};
|
|
716
736
|
};
|
|
717
737
|
embeddedEditor?: string;
|
|
738
|
+
dataResourceSelectorUrl?: string;
|
|
739
|
+
dataResourceSelectorLocations?: {
|
|
740
|
+
[key: string]: {
|
|
741
|
+
url: string;
|
|
742
|
+
layout?: {
|
|
743
|
+
/** @enum {string} */
|
|
744
|
+
height?: "full-height";
|
|
745
|
+
/** @enum {string} */
|
|
746
|
+
width?: "wide";
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
};
|
|
718
750
|
};
|
|
719
751
|
};
|
|
720
752
|
badgeIconUrl?: string;
|
|
@@ -751,7 +783,6 @@ interface paths$1 {
|
|
|
751
783
|
generateUrl: string;
|
|
752
784
|
metadataUrl?: string;
|
|
753
785
|
prompts?: {
|
|
754
|
-
/** Format: uuid */
|
|
755
786
|
id: string;
|
|
756
787
|
name: string;
|
|
757
788
|
text: string;
|
|
@@ -810,7 +841,6 @@ interface paths$1 {
|
|
|
810
841
|
}[];
|
|
811
842
|
};
|
|
812
843
|
unstable_prompts?: {
|
|
813
|
-
/** Format: uuid */
|
|
814
844
|
id: string;
|
|
815
845
|
name: string;
|
|
816
846
|
text: string;
|
|
@@ -849,10 +879,7 @@ interface paths$1 {
|
|
|
849
879
|
requestBody: {
|
|
850
880
|
content: {
|
|
851
881
|
"application/json": {
|
|
852
|
-
/**
|
|
853
|
-
* Format: uuid
|
|
854
|
-
* @description The team ID
|
|
855
|
-
*/
|
|
882
|
+
/** @description The team ID */
|
|
856
883
|
teamId: string;
|
|
857
884
|
/** @description The integration type to remove */
|
|
858
885
|
type: string;
|
|
@@ -973,9 +1000,13 @@ interface paths {
|
|
|
973
1000
|
get: {
|
|
974
1001
|
parameters: {
|
|
975
1002
|
query: {
|
|
1003
|
+
/** @description The project ID */
|
|
976
1004
|
projectId: string;
|
|
1005
|
+
/** @description Limit results to a single integration type */
|
|
977
1006
|
type?: string;
|
|
1007
|
+
/** @description Whether to match the passed type exactly or to treat the type as a prefix */
|
|
978
1008
|
exactType?: boolean | null;
|
|
1009
|
+
/** @description Whether to use team-specific integration types or team-agnostic types (for serialization across projects) */
|
|
979
1010
|
teamSpecificType?: boolean | null;
|
|
980
1011
|
};
|
|
981
1012
|
header?: never;
|
|
@@ -1018,11 +1049,9 @@ interface paths {
|
|
|
1018
1049
|
requestBody: {
|
|
1019
1050
|
content: {
|
|
1020
1051
|
"application/json": {
|
|
1021
|
-
/**
|
|
1022
|
-
* Format: uuid
|
|
1023
|
-
* @description The project ID
|
|
1024
|
-
*/
|
|
1052
|
+
/** @description The project ID */
|
|
1025
1053
|
projectId: string;
|
|
1054
|
+
/** @description Whether to match the passed type exactly or to treat the type as a prefix */
|
|
1026
1055
|
exactType?: boolean | null;
|
|
1027
1056
|
type: string;
|
|
1028
1057
|
data?: {
|
|
@@ -1058,13 +1087,11 @@ interface paths {
|
|
|
1058
1087
|
requestBody: {
|
|
1059
1088
|
content: {
|
|
1060
1089
|
"application/json": {
|
|
1061
|
-
/**
|
|
1062
|
-
* Format: uuid
|
|
1063
|
-
* @description The project ID
|
|
1064
|
-
*/
|
|
1090
|
+
/** @description The project ID */
|
|
1065
1091
|
projectId: string;
|
|
1066
1092
|
/** @description The integration type to remove */
|
|
1067
1093
|
type: string;
|
|
1094
|
+
/** @description Whether to match the passed type exactly or to treat the type as a prefix */
|
|
1068
1095
|
exactType?: boolean | null;
|
|
1069
1096
|
};
|
|
1070
1097
|
};
|
|
@@ -1328,6 +1355,16 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
|
|
|
1328
1355
|
};
|
|
1329
1356
|
};
|
|
1330
1357
|
embeddedEditor?: string;
|
|
1358
|
+
dataResourceSelectorUrl?: string;
|
|
1359
|
+
dataResourceSelectorLocations?: {
|
|
1360
|
+
[key: string]: {
|
|
1361
|
+
url: string;
|
|
1362
|
+
layout?: {
|
|
1363
|
+
height?: "full-height";
|
|
1364
|
+
width?: "wide";
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1331
1368
|
};
|
|
1332
1369
|
};
|
|
1333
1370
|
badgeIconUrl?: string;
|
|
@@ -1568,6 +1605,45 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
|
|
|
1568
1605
|
}, TIntegrationConfiguration>;
|
|
1569
1606
|
type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
|
|
1570
1607
|
|
|
1608
|
+
/**
|
|
1609
|
+
* Metadata for the dataResourceSelector location.
|
|
1610
|
+
* This location type allows custom UI for selecting JSON pointers within a data resource,
|
|
1611
|
+
* replacing the default JSON tree viewer in the dynamic token picker.
|
|
1612
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1613
|
+
*/
|
|
1614
|
+
type DataResourceSelectorLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1615
|
+
/** The resolved data for the currently selected data resource */
|
|
1616
|
+
dataResourceValue: unknown;
|
|
1617
|
+
/** The name of the currently selected data resource */
|
|
1618
|
+
dataResourceName: string;
|
|
1619
|
+
/** The data type ID for the current data resource */
|
|
1620
|
+
dataTypeId: string;
|
|
1621
|
+
/** The data type's archetype value (useful for apps sharing a selector across archetypes) */
|
|
1622
|
+
archetype: string;
|
|
1623
|
+
/** Allowed bindable types for the parameter being connected */
|
|
1624
|
+
allowedTypes: BindableTypes[];
|
|
1625
|
+
/** Component definitions index, keyed by public id. */
|
|
1626
|
+
componentDefinitions: Record<string, ComponentDefinition | undefined>;
|
|
1627
|
+
}, TIntegrationConfiguration>;
|
|
1628
|
+
/**
|
|
1629
|
+
* Location for custom data resource selector UI.
|
|
1630
|
+
* Replaces the default JSON tree viewer when selecting dynamic tokens from a data resource.
|
|
1631
|
+
*
|
|
1632
|
+
* Value: The selected JSON pointer string (e.g., "/moves/0/move/name")
|
|
1633
|
+
* setValue: Call with a valid JSON pointer to select that path
|
|
1634
|
+
* getDataResource: Fetch data from the data connector using the current data source
|
|
1635
|
+
* editorState: Imperative API for inspecting/mutating the underlying composition / entry tree
|
|
1636
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1637
|
+
*/
|
|
1638
|
+
type DataResourceSelectorLocation = MeshLocationCore<string, DataResourceSelectorLocationMetadata, string, 'dataResourceSelector'> & GetDataResourceLocation & {
|
|
1639
|
+
/**
|
|
1640
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
1641
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
1642
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1643
|
+
*/
|
|
1644
|
+
editorState: EditorStateApi;
|
|
1645
|
+
};
|
|
1646
|
+
|
|
1571
1647
|
type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
|
|
1572
1648
|
type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1573
1649
|
/**
|
|
@@ -1579,6 +1655,7 @@ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMet
|
|
|
1579
1655
|
type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
|
|
1580
1656
|
|
|
1581
1657
|
type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1658
|
+
/** editorState is an experimental replacement for rootNode. This may become deprecated in the future. */
|
|
1582
1659
|
rootNode: Omit<RootComponentInstance, 'slots' | '_data'> & {
|
|
1583
1660
|
_editionId?: string;
|
|
1584
1661
|
};
|
|
@@ -1607,6 +1684,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
|
|
|
1607
1684
|
* Note that setValue() always sets the target language automatically.
|
|
1608
1685
|
*/
|
|
1609
1686
|
targetLocale: string | undefined;
|
|
1687
|
+
/**
|
|
1688
|
+
* The current locale selected in the editor UI.
|
|
1689
|
+
* Unlike targetLocale, this reflects the editor's global locale state.
|
|
1690
|
+
*/
|
|
1691
|
+
currentLocale: string | undefined;
|
|
1610
1692
|
/**
|
|
1611
1693
|
* When editing a conditional value, this is the index in the parent parameter of the conditional value.
|
|
1612
1694
|
* If this is -1, then the editor is not editing a conditional value.
|
|
@@ -1619,6 +1701,12 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
|
|
|
1619
1701
|
* Returns the result of the dialog. Useful to build data-enabled parameter types.
|
|
1620
1702
|
*/
|
|
1621
1703
|
editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
|
|
1704
|
+
/**
|
|
1705
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
1706
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
1707
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1708
|
+
*/
|
|
1709
|
+
editorState: EditorStateApi;
|
|
1622
1710
|
};
|
|
1623
1711
|
|
|
1624
1712
|
type SettingsLocationMetadata = CommonMetadata;
|
|
@@ -1628,7 +1716,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
|
|
|
1628
1716
|
* Defines methods used for interacting with a Mesh location
|
|
1629
1717
|
* To receive useful typings, check the `type` property of the location to narrow the typing.
|
|
1630
1718
|
*/
|
|
1631
|
-
type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | DashboardToolLocation<TValue> | ProjectToolLocation<TValue>;
|
|
1719
|
+
type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | DataResourceSelectorLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | DashboardToolLocation<TValue> | ProjectToolLocation<TValue>;
|
|
1632
1720
|
interface MeshContextData {
|
|
1633
1721
|
locationKey: string;
|
|
1634
1722
|
locationType: MeshLocationTypes;
|
|
@@ -1820,6 +1908,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
|
|
|
1820
1908
|
navigate: (message: NavigateMessage) => Promise<void>;
|
|
1821
1909
|
reloadLocation: () => Promise<void>;
|
|
1822
1910
|
editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
|
|
1911
|
+
editorState: EditorStateApi;
|
|
1823
1912
|
};
|
|
1824
1913
|
}>;
|
|
1825
1914
|
|
|
@@ -1986,7 +2075,7 @@ type MeshLocationUserPermissions =
|
|
|
1986
2075
|
/**
|
|
1987
2076
|
* Known location types that can be passed to a mesh location
|
|
1988
2077
|
*/
|
|
1989
|
-
type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
|
|
2078
|
+
type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'dataResourceSelector' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
|
|
1990
2079
|
type SetValueOptions = ValidationResult;
|
|
1991
2080
|
type SetValueMessage = {
|
|
1992
2081
|
uniformMeshLocationValue: unknown;
|
|
@@ -2011,6 +2100,262 @@ type DynamicInput = {
|
|
|
2011
2100
|
};
|
|
2012
2101
|
/** Record of dynamic inputs keyed by the input name */
|
|
2013
2102
|
type DynamicInputs = Record<string, DynamicInput>;
|
|
2103
|
+
/** Metadata about the composition (description, category, workflow, etc.) */
|
|
2104
|
+
type EditorRootMetadata = {
|
|
2105
|
+
description?: string;
|
|
2106
|
+
previewImageUrl?: string;
|
|
2107
|
+
categoryId?: string;
|
|
2108
|
+
workflowId?: string;
|
|
2109
|
+
workflowStageId?: string;
|
|
2110
|
+
editionName?: string;
|
|
2111
|
+
editionPriority?: number;
|
|
2112
|
+
};
|
|
2113
|
+
/** Root node metadata (name and slug) */
|
|
2114
|
+
type EditorRootNodeMetadata = {
|
|
2115
|
+
_name: string;
|
|
2116
|
+
_slug: string | null | undefined;
|
|
2117
|
+
};
|
|
2118
|
+
/** Options for exporting the tree */
|
|
2119
|
+
type EditorExportOptions = {
|
|
2120
|
+
/** If true, includes pattern descendant data in export */
|
|
2121
|
+
keepPatternData?: boolean;
|
|
2122
|
+
};
|
|
2123
|
+
/** A component instance without slots/params (indexed separately) */
|
|
2124
|
+
type EditorComponentInstance = Omit<ComponentInstance, 'slots' | 'parameters' | '_id'>;
|
|
2125
|
+
/** An indexed node within the editor state */
|
|
2126
|
+
type EditorNode = {
|
|
2127
|
+
nodeId: string;
|
|
2128
|
+
parentId?: string;
|
|
2129
|
+
isBlock?: boolean;
|
|
2130
|
+
value: EditorComponentInstance;
|
|
2131
|
+
/** If part of a pattern, the pattern ID */
|
|
2132
|
+
partOfPattern?: string;
|
|
2133
|
+
/** If part of a nested pattern */
|
|
2134
|
+
partOfNestedPattern?: string;
|
|
2135
|
+
/** UI expansion state */
|
|
2136
|
+
isExpandedInUI?: boolean;
|
|
2137
|
+
};
|
|
2138
|
+
/** Child node IDs indexed by slot name */
|
|
2139
|
+
type EditorNodeChildren = {
|
|
2140
|
+
[slotName: string]: string[];
|
|
2141
|
+
};
|
|
2142
|
+
/** A component parameter value */
|
|
2143
|
+
type EditorComponentParameter<T = unknown> = Omit<ComponentParameter<T>, 'connectedData'>;
|
|
2144
|
+
/** Parent info for a node */
|
|
2145
|
+
type EditorNodeParentInfo = {
|
|
2146
|
+
parentId: string;
|
|
2147
|
+
parentName: string;
|
|
2148
|
+
targetIndexInParent: number;
|
|
2149
|
+
value: EditorComponentInstance;
|
|
2150
|
+
parentChildIds: string[];
|
|
2151
|
+
parentType: 'slot' | 'block';
|
|
2152
|
+
};
|
|
2153
|
+
/** Options for updateNodeProperty */
|
|
2154
|
+
type UpdateNodePropertyOptions = {
|
|
2155
|
+
nodeId: string;
|
|
2156
|
+
property: string;
|
|
2157
|
+
/**
|
|
2158
|
+
* The new value to set. Pass the final value directly.
|
|
2159
|
+
* - `undefined` to soft-delete (remove current locale/condition value)
|
|
2160
|
+
* - `null` to hard-delete (remove entire parameter)
|
|
2161
|
+
* - any other value to set
|
|
2162
|
+
*
|
|
2163
|
+
* For read-modify-write, call getNodeProperty() first to get current value.
|
|
2164
|
+
*/
|
|
2165
|
+
value: unknown | undefined | null;
|
|
2166
|
+
/** Parameter type (required for new parameters) */
|
|
2167
|
+
type?: string;
|
|
2168
|
+
/** Target locale, or undefined for invariant value */
|
|
2169
|
+
locale: string | undefined;
|
|
2170
|
+
/** Condition index (-1 for base value, >= 0 for conditional) */
|
|
2171
|
+
conditionIndex: number;
|
|
2172
|
+
/** Condition definition (required when conditionIndex >= 0) */
|
|
2173
|
+
conditionDefinition?: VisibilityCriteriaGroup | null;
|
|
2174
|
+
};
|
|
2175
|
+
/** Options for insertNode */
|
|
2176
|
+
type InsertNodeOptions = {
|
|
2177
|
+
node: EditorComponentInstance;
|
|
2178
|
+
parentNodeId: string;
|
|
2179
|
+
parentSlot: string;
|
|
2180
|
+
targetIndexInSlot?: number;
|
|
2181
|
+
};
|
|
2182
|
+
/** Options for moveNode */
|
|
2183
|
+
type MoveNodeOptions = {
|
|
2184
|
+
movedNodeId: string;
|
|
2185
|
+
parentNodeId: string;
|
|
2186
|
+
parentSlot: string;
|
|
2187
|
+
targetIndexInSlot: number;
|
|
2188
|
+
};
|
|
2189
|
+
/** Options for deleteNode */
|
|
2190
|
+
type DeleteNodeOptions = {
|
|
2191
|
+
nodeId: string;
|
|
2192
|
+
/**
|
|
2193
|
+
* When true, deletes a block entry without slot-parent bookkeeping.
|
|
2194
|
+
* Pass this when removing nodes from a block parameter.
|
|
2195
|
+
*/
|
|
2196
|
+
isBlock?: boolean;
|
|
2197
|
+
};
|
|
2198
|
+
/**
|
|
2199
|
+
* Common fields for {@link EditorStateApi.setPropertyLocalizability}.
|
|
2200
|
+
*/
|
|
2201
|
+
interface SetPropertyLocalizabilityCommonParams {
|
|
2202
|
+
/** The node owning the parameter. */
|
|
2203
|
+
nodeId: string;
|
|
2204
|
+
/** The parameter id. */
|
|
2205
|
+
property: string;
|
|
2206
|
+
/**
|
|
2207
|
+
* The component-definition parameter for `(nodeId, property)`. Required: the bridge
|
|
2208
|
+
* uses this to enforce localizability business rules (refuses to localize a parameter
|
|
2209
|
+
* whose definition disallows it) and to resolve the parameter type for value fan-out.
|
|
2210
|
+
*
|
|
2211
|
+
* Mesh integrations must resolve this from the Uniform public API (using a service
|
|
2212
|
+
* account API key today, or identity delegation in the future) — the editor frame does
|
|
2213
|
+
* not expose component definitions to mesh apps.
|
|
2214
|
+
*/
|
|
2215
|
+
propertyDefinition: ComponentDefinitionParameter;
|
|
2216
|
+
}
|
|
2217
|
+
/**
|
|
2218
|
+
* Discriminated-union params for {@link EditorStateApi.setPropertyLocalizability}.
|
|
2219
|
+
*
|
|
2220
|
+
* - `isLocalized: true` (toggle ON): per-locale values are written to every enabled
|
|
2221
|
+
* locale of the composition.
|
|
2222
|
+
* - `isLocalized: false` (toggle OFF): per-locale values are collapsed back into a
|
|
2223
|
+
* single invariant value, copying from `copyFromLocale` (or the first defined locale).
|
|
2224
|
+
*/
|
|
2225
|
+
type SetPropertyLocalizabilityParams = (SetPropertyLocalizabilityCommonParams & {
|
|
2226
|
+
/** Toggle ON: convert the invariant value to per-locale values. */
|
|
2227
|
+
isLocalized: true;
|
|
2228
|
+
}) | (SetPropertyLocalizabilityCommonParams & {
|
|
2229
|
+
/** Toggle OFF: collapse per-locale values back to a single invariant value. */
|
|
2230
|
+
isLocalized: false;
|
|
2231
|
+
/**
|
|
2232
|
+
* The locale whose value becomes the new invariant value. Defaults to the first
|
|
2233
|
+
* locale with a defined value on the parameter.
|
|
2234
|
+
*/
|
|
2235
|
+
copyFromLocale?: string;
|
|
2236
|
+
});
|
|
2237
|
+
/** Options for insertPattern */
|
|
2238
|
+
type InsertPatternOptions = {
|
|
2239
|
+
pattern: RootComponentInstance;
|
|
2240
|
+
parentNodeId: string;
|
|
2241
|
+
parentSlot: string;
|
|
2242
|
+
targetIndexInSlot?: number;
|
|
2243
|
+
patternInstanceId?: string;
|
|
2244
|
+
};
|
|
2245
|
+
/** Options for updateRootNode */
|
|
2246
|
+
type UpdateRootNodeOptions = {
|
|
2247
|
+
update: Partial<EditorRootNodeMetadata>;
|
|
2248
|
+
};
|
|
2249
|
+
/**
|
|
2250
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2251
|
+
* Available on `canvasEditorTools` and `paramType` locations.
|
|
2252
|
+
*
|
|
2253
|
+
* All methods use object parameters for consistency across client, wire format, and server.
|
|
2254
|
+
*/
|
|
2255
|
+
interface EditorStateApi {
|
|
2256
|
+
getRootNodeId(): Promise<string>;
|
|
2257
|
+
exportTree(params?: EditorExportOptions): Promise<RootComponentInstance | EntryData>;
|
|
2258
|
+
exportSubtree(params: {
|
|
2259
|
+
nodeId: string;
|
|
2260
|
+
options?: EditorExportOptions;
|
|
2261
|
+
}): Promise<ComponentInstance | EntryData>;
|
|
2262
|
+
exportMetadata(): Promise<EditorRootMetadata>;
|
|
2263
|
+
exportRootNodeMetadata(): Promise<EditorRootNodeMetadata>;
|
|
2264
|
+
getNodeById(params: {
|
|
2265
|
+
nodeId: string;
|
|
2266
|
+
}): Promise<EditorNode | undefined>;
|
|
2267
|
+
getNodeChildren(params: {
|
|
2268
|
+
nodeId: string;
|
|
2269
|
+
}): Promise<EditorNodeChildren | undefined>;
|
|
2270
|
+
getNodeProperty<T = unknown>(params: {
|
|
2271
|
+
nodeId: string;
|
|
2272
|
+
property: string;
|
|
2273
|
+
}): Promise<EditorComponentParameter<T> | undefined>;
|
|
2274
|
+
getNodeProperties(params: {
|
|
2275
|
+
nodeId: string;
|
|
2276
|
+
}): Promise<Record<string, EditorComponentParameter>>;
|
|
2277
|
+
getParentInfo(params: {
|
|
2278
|
+
nodeId: string;
|
|
2279
|
+
}): Promise<EditorNodeParentInfo | undefined>;
|
|
2280
|
+
getSelectedNodeId(): Promise<string | undefined>;
|
|
2281
|
+
setSelectedNodeId(params: {
|
|
2282
|
+
nodeId: string | undefined;
|
|
2283
|
+
}): Promise<void>;
|
|
2284
|
+
getSelectedParameterId(): Promise<string | undefined>;
|
|
2285
|
+
setSelectedParameterId(params: {
|
|
2286
|
+
parameterId: string | undefined;
|
|
2287
|
+
}): Promise<void>;
|
|
2288
|
+
getPristine(): Promise<boolean>;
|
|
2289
|
+
insertNode(params: InsertNodeOptions): Promise<string>;
|
|
2290
|
+
deleteNode(params: DeleteNodeOptions): Promise<void>;
|
|
2291
|
+
moveNode(params: MoveNodeOptions): Promise<void>;
|
|
2292
|
+
updateNodeProperty(params: UpdateNodePropertyOptions): Promise<void>;
|
|
2293
|
+
updateRootMetadata(params: {
|
|
2294
|
+
metadata: Partial<EditorRootMetadata>;
|
|
2295
|
+
}): Promise<void>;
|
|
2296
|
+
updateRootNode(params: UpdateRootNodeOptions): Promise<void>;
|
|
2297
|
+
insertPattern(params: InsertPatternOptions): Promise<string>;
|
|
2298
|
+
isPatternPropertyOverridden(params: {
|
|
2299
|
+
nodeId: string;
|
|
2300
|
+
property: string;
|
|
2301
|
+
locale?: string;
|
|
2302
|
+
}): Promise<boolean>;
|
|
2303
|
+
resetPatternPropertyOverride(params: {
|
|
2304
|
+
nodeId: string;
|
|
2305
|
+
property: string;
|
|
2306
|
+
locale: string | undefined;
|
|
2307
|
+
}): Promise<void>;
|
|
2308
|
+
/**
|
|
2309
|
+
* Toggles a parameter between "shared" (single invariant value) and "localized"
|
|
2310
|
+
* (per-locale values) — the same operation as the dashboard "Use locale-specific values"
|
|
2311
|
+
* switch on the parameter's locale drawer.
|
|
2312
|
+
*
|
|
2313
|
+
* - `isLocalized: true` copies the current invariant value (and its conditions) into
|
|
2314
|
+
* each locale enabled on the composition.
|
|
2315
|
+
* - `isLocalized: false` copies the value from `copyFromLocale` (or the first defined
|
|
2316
|
+
* locale, if omitted) back into the invariant slot and drops the per-locale values.
|
|
2317
|
+
*
|
|
2318
|
+
* The migration handles pattern parameter overrides, `contentReference` data resource
|
|
2319
|
+
* forking, and the per-node localizability metadata, so the resulting state matches
|
|
2320
|
+
* what the dashboard UI would produce for the same toggle. The whole migration is one
|
|
2321
|
+
* editor mutation, which keeps it as a single undo step for the user.
|
|
2322
|
+
*
|
|
2323
|
+
* The caller must supply `propertyDefinition` — the component-definition parameter for
|
|
2324
|
+
* `(nodeId, property)`. This is required so the bridge can enforce localizability
|
|
2325
|
+
* business rules (e.g. refusing to localize a parameter whose definition forbids it)
|
|
2326
|
+
* and resolve the parameter type for value fan-out. Resolve it from the Uniform public
|
|
2327
|
+
* API using your service account API key (or, in the future, identity delegation) and
|
|
2328
|
+
* cache it client-side as needed.
|
|
2329
|
+
*
|
|
2330
|
+
* No-ops if the parameter is already in the requested state; if the parameter does not
|
|
2331
|
+
* exist on the node; if (when localizing) no locales are enabled; or if (when
|
|
2332
|
+
* localizing) the supplied `propertyDefinition.localizable` is `false`.
|
|
2333
|
+
*
|
|
2334
|
+
* @beta This is beta functionality. It is intentionally exposed as `@deprecated` so
|
|
2335
|
+
* consumers do not depend on it from production integrations — the signature and
|
|
2336
|
+
* behaviour may change without notice.
|
|
2337
|
+
* @deprecated Beta. Subject to change without notice; do not rely on this API in
|
|
2338
|
+
* production integrations.
|
|
2339
|
+
*/
|
|
2340
|
+
setPropertyLocalizability(params: SetPropertyLocalizabilityParams): Promise<void>;
|
|
2341
|
+
enableLocale(params: {
|
|
2342
|
+
locale: string | string[];
|
|
2343
|
+
}): Promise<void>;
|
|
2344
|
+
disableLocale(params: {
|
|
2345
|
+
locale: string;
|
|
2346
|
+
}): Promise<void>;
|
|
2347
|
+
/** Sets the currently active locale in the editor UI */
|
|
2348
|
+
setCurrentLocale(params: {
|
|
2349
|
+
locale: string;
|
|
2350
|
+
}): Promise<void>;
|
|
2351
|
+
/**
|
|
2352
|
+
* Sets the current preview value for a dynamic input.
|
|
2353
|
+
*/
|
|
2354
|
+
setDynamicInputPreviewValue(params: {
|
|
2355
|
+
name: string;
|
|
2356
|
+
value: string;
|
|
2357
|
+
}): Promise<void>;
|
|
2358
|
+
}
|
|
2014
2359
|
|
|
2015
2360
|
type AIGenerateLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
2016
2361
|
prompt: string;
|
|
@@ -2037,6 +2382,15 @@ type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = Co
|
|
|
2037
2382
|
*/
|
|
2038
2383
|
activeReleaseId?: string;
|
|
2039
2384
|
state?: number;
|
|
2385
|
+
/** The current locale selected in the editor UI */
|
|
2386
|
+
currentLocale: string | undefined;
|
|
2387
|
+
/**
|
|
2388
|
+
* Current dynamic inputs configured on the composition (if any).
|
|
2389
|
+
* Dynamic inputs come from project map nodes and represent path or query based dynamic values.
|
|
2390
|
+
*/
|
|
2391
|
+
dynamicInputs: DynamicInputs;
|
|
2392
|
+
/** Component definitions index, keyed by public id. */
|
|
2393
|
+
componentDefinitions: Record<string, ComponentDefinition | undefined>;
|
|
2040
2394
|
}, TIntegrationConfiguration>;
|
|
2041
2395
|
type CanvasEditorToolsReferenceData = {
|
|
2042
2396
|
name: string;
|
|
@@ -2047,13 +2401,22 @@ type CanvasEditorToolsData = {
|
|
|
2047
2401
|
entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
|
|
2048
2402
|
entityType: CanvasEditorEntityType;
|
|
2049
2403
|
} & ({
|
|
2404
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2050
2405
|
rootEntity: RootComponentInstance;
|
|
2051
2406
|
entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
|
|
2052
2407
|
} | {
|
|
2408
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2053
2409
|
rootEntity: EntryData;
|
|
2054
2410
|
entityType: 'entry' | 'entryPattern';
|
|
2055
2411
|
});
|
|
2056
|
-
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation
|
|
2412
|
+
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation & {
|
|
2413
|
+
/**
|
|
2414
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2415
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
2416
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
2417
|
+
*/
|
|
2418
|
+
editorState: EditorStateApi;
|
|
2419
|
+
};
|
|
2057
2420
|
|
|
2058
2421
|
/**
|
|
2059
2422
|
* @deprecated Alpha version of the Embedded Editor location. This location is not yet available for use in the Mesh SDK.
|
|
@@ -2221,4 +2584,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
|
|
|
2221
2584
|
*/
|
|
2222
2585
|
declare const hasRole: (role: string, user: UniformUser) => boolean;
|
|
2223
2586
|
|
|
2224
|
-
export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type DashboardToolLocation, type DashboardToolLocationMetadata, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshRouter, type MeshSDKEventInterface, type NavigateMessage, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PersonalizationCriteriaLocation, type PersonalizationCriteriaLocationMetadata, type ProjectToolLocation, type ProjectToolLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
|
|
2587
|
+
export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type DashboardToolLocation, type DashboardToolLocationMetadata, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataResourceSelectorLocation, type DataResourceSelectorLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DeleteNodeOptions, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type EditorComponentInstance, type EditorComponentParameter, type EditorExportOptions, type EditorNode, type EditorNodeChildren, type EditorNodeParentInfo, type EditorRootMetadata, type EditorRootNodeMetadata, type EditorStateApi, type EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, type GetDataResourceLocation, type GetDataResourceMessage, type InsertNodeOptions, type InsertPatternOptions, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshRouter, type MeshSDKEventInterface, type MoveNodeOptions, type NavigateMessage, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PersonalizationCriteriaLocation, type PersonalizationCriteriaLocationMetadata, type ProjectToolLocation, type ProjectToolLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetPropertyLocalizabilityCommonParams, type SetPropertyLocalizabilityParams, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type UpdateNodePropertyOptions, type UpdateRootNodeOptions, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
|