@uniformdev/mesh-sdk 20.63.1-alpha.18 → 20.63.1-alpha.22
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 +370 -5
- package/dist/index.d.ts +370 -5
- package/dist/index.esm.js +108 -1
- package/dist/index.js +108 -1
- package/dist/index.mjs +108 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
|
|
2
|
-
import { AssetParamValue, DataType, DataSource, DataResourceVariables, DataSourceVariantsKeys, RootComponentInstance, ComponentInstance,
|
|
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';
|
|
@@ -177,6 +177,18 @@ interface paths$1 {
|
|
|
177
177
|
};
|
|
178
178
|
};
|
|
179
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
|
+
};
|
|
180
192
|
};
|
|
181
193
|
};
|
|
182
194
|
badgeIconUrl?: string;
|
|
@@ -450,6 +462,18 @@ interface paths$1 {
|
|
|
450
462
|
};
|
|
451
463
|
};
|
|
452
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
|
+
};
|
|
453
477
|
};
|
|
454
478
|
};
|
|
455
479
|
badgeIconUrl?: string;
|
|
@@ -711,6 +735,18 @@ interface paths$1 {
|
|
|
711
735
|
};
|
|
712
736
|
};
|
|
713
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
|
+
};
|
|
714
750
|
};
|
|
715
751
|
};
|
|
716
752
|
badgeIconUrl?: string;
|
|
@@ -1319,6 +1355,16 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
|
|
|
1319
1355
|
};
|
|
1320
1356
|
};
|
|
1321
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
|
+
};
|
|
1322
1368
|
};
|
|
1323
1369
|
};
|
|
1324
1370
|
badgeIconUrl?: string;
|
|
@@ -1559,6 +1605,45 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
|
|
|
1559
1605
|
}, TIntegrationConfiguration>;
|
|
1560
1606
|
type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
|
|
1561
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
|
+
|
|
1562
1647
|
type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
|
|
1563
1648
|
type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1564
1649
|
/**
|
|
@@ -1570,6 +1655,7 @@ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMet
|
|
|
1570
1655
|
type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
|
|
1571
1656
|
|
|
1572
1657
|
type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1658
|
+
/** editorState is an experimental replacement for rootNode. This may become deprecated in the future. */
|
|
1573
1659
|
rootNode: Omit<RootComponentInstance, 'slots' | '_data'> & {
|
|
1574
1660
|
_editionId?: string;
|
|
1575
1661
|
};
|
|
@@ -1598,6 +1684,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
|
|
|
1598
1684
|
* Note that setValue() always sets the target language automatically.
|
|
1599
1685
|
*/
|
|
1600
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;
|
|
1601
1692
|
/**
|
|
1602
1693
|
* When editing a conditional value, this is the index in the parent parameter of the conditional value.
|
|
1603
1694
|
* If this is -1, then the editor is not editing a conditional value.
|
|
@@ -1610,6 +1701,12 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
|
|
|
1610
1701
|
* Returns the result of the dialog. Useful to build data-enabled parameter types.
|
|
1611
1702
|
*/
|
|
1612
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;
|
|
1613
1710
|
};
|
|
1614
1711
|
|
|
1615
1712
|
type SettingsLocationMetadata = CommonMetadata;
|
|
@@ -1619,7 +1716,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
|
|
|
1619
1716
|
* Defines methods used for interacting with a Mesh location
|
|
1620
1717
|
* To receive useful typings, check the `type` property of the location to narrow the typing.
|
|
1621
1718
|
*/
|
|
1622
|
-
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>;
|
|
1623
1720
|
interface MeshContextData {
|
|
1624
1721
|
locationKey: string;
|
|
1625
1722
|
locationType: MeshLocationTypes;
|
|
@@ -1811,6 +1908,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
|
|
|
1811
1908
|
navigate: (message: NavigateMessage) => Promise<void>;
|
|
1812
1909
|
reloadLocation: () => Promise<void>;
|
|
1813
1910
|
editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
|
|
1911
|
+
editorState: EditorStateApi;
|
|
1814
1912
|
};
|
|
1815
1913
|
}>;
|
|
1816
1914
|
|
|
@@ -1977,7 +2075,7 @@ type MeshLocationUserPermissions =
|
|
|
1977
2075
|
/**
|
|
1978
2076
|
* Known location types that can be passed to a mesh location
|
|
1979
2077
|
*/
|
|
1980
|
-
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';
|
|
1981
2079
|
type SetValueOptions = ValidationResult;
|
|
1982
2080
|
type SetValueMessage = {
|
|
1983
2081
|
uniformMeshLocationValue: unknown;
|
|
@@ -2002,6 +2100,255 @@ type DynamicInput = {
|
|
|
2002
2100
|
};
|
|
2003
2101
|
/** Record of dynamic inputs keyed by the input name */
|
|
2004
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
|
+
/**
|
|
2190
|
+
* Common fields for {@link EditorStateApi.setPropertyLocalizability}.
|
|
2191
|
+
*/
|
|
2192
|
+
interface SetPropertyLocalizabilityCommonParams {
|
|
2193
|
+
/** The node owning the parameter. */
|
|
2194
|
+
nodeId: string;
|
|
2195
|
+
/** The parameter id. */
|
|
2196
|
+
property: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* The component-definition parameter for `(nodeId, property)`. Required: the bridge
|
|
2199
|
+
* uses this to enforce localizability business rules (refuses to localize a parameter
|
|
2200
|
+
* whose definition disallows it) and to resolve the parameter type for value fan-out.
|
|
2201
|
+
*
|
|
2202
|
+
* Mesh integrations must resolve this from the Uniform public API (using a service
|
|
2203
|
+
* account API key today, or identity delegation in the future) — the editor frame does
|
|
2204
|
+
* not expose component definitions to mesh apps.
|
|
2205
|
+
*/
|
|
2206
|
+
propertyDefinition: ComponentDefinitionParameter;
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* Discriminated-union params for {@link EditorStateApi.setPropertyLocalizability}.
|
|
2210
|
+
*
|
|
2211
|
+
* - `isLocalized: true` (toggle ON): per-locale values are written to every enabled
|
|
2212
|
+
* locale of the composition.
|
|
2213
|
+
* - `isLocalized: false` (toggle OFF): per-locale values are collapsed back into a
|
|
2214
|
+
* single invariant value, copying from `copyFromLocale` (or the first defined locale).
|
|
2215
|
+
*/
|
|
2216
|
+
type SetPropertyLocalizabilityParams = (SetPropertyLocalizabilityCommonParams & {
|
|
2217
|
+
/** Toggle ON: convert the invariant value to per-locale values. */
|
|
2218
|
+
isLocalized: true;
|
|
2219
|
+
}) | (SetPropertyLocalizabilityCommonParams & {
|
|
2220
|
+
/** Toggle OFF: collapse per-locale values back to a single invariant value. */
|
|
2221
|
+
isLocalized: false;
|
|
2222
|
+
/**
|
|
2223
|
+
* The locale whose value becomes the new invariant value. Defaults to the first
|
|
2224
|
+
* locale with a defined value on the parameter.
|
|
2225
|
+
*/
|
|
2226
|
+
copyFromLocale?: string;
|
|
2227
|
+
});
|
|
2228
|
+
/** Options for insertPattern */
|
|
2229
|
+
type InsertPatternOptions = {
|
|
2230
|
+
pattern: RootComponentInstance;
|
|
2231
|
+
parentNodeId: string;
|
|
2232
|
+
parentSlot: string;
|
|
2233
|
+
targetIndexInSlot?: number;
|
|
2234
|
+
patternInstanceId?: string;
|
|
2235
|
+
};
|
|
2236
|
+
/** Options for updateRootNode */
|
|
2237
|
+
type UpdateRootNodeOptions = {
|
|
2238
|
+
update: Partial<EditorRootNodeMetadata>;
|
|
2239
|
+
};
|
|
2240
|
+
/**
|
|
2241
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2242
|
+
* Available on `canvasEditorTools` and `paramType` locations.
|
|
2243
|
+
*
|
|
2244
|
+
* All methods use object parameters for consistency across client, wire format, and server.
|
|
2245
|
+
*/
|
|
2246
|
+
interface EditorStateApi {
|
|
2247
|
+
getRootNodeId(): Promise<string>;
|
|
2248
|
+
exportTree(params?: EditorExportOptions): Promise<RootComponentInstance | EntryData>;
|
|
2249
|
+
exportSubtree(params: {
|
|
2250
|
+
nodeId: string;
|
|
2251
|
+
options?: EditorExportOptions;
|
|
2252
|
+
}): Promise<ComponentInstance | EntryData>;
|
|
2253
|
+
exportMetadata(): Promise<EditorRootMetadata>;
|
|
2254
|
+
exportRootNodeMetadata(): Promise<EditorRootNodeMetadata>;
|
|
2255
|
+
getNodeById(params: {
|
|
2256
|
+
nodeId: string;
|
|
2257
|
+
}): Promise<EditorNode | undefined>;
|
|
2258
|
+
getNodeChildren(params: {
|
|
2259
|
+
nodeId: string;
|
|
2260
|
+
}): Promise<EditorNodeChildren | undefined>;
|
|
2261
|
+
getNodeProperty<T = unknown>(params: {
|
|
2262
|
+
nodeId: string;
|
|
2263
|
+
property: string;
|
|
2264
|
+
}): Promise<EditorComponentParameter<T> | undefined>;
|
|
2265
|
+
getNodeProperties(params: {
|
|
2266
|
+
nodeId: string;
|
|
2267
|
+
}): Promise<Record<string, EditorComponentParameter>>;
|
|
2268
|
+
getParentInfo(params: {
|
|
2269
|
+
nodeId: string;
|
|
2270
|
+
}): Promise<EditorNodeParentInfo | undefined>;
|
|
2271
|
+
getSelectedNodeId(): Promise<string | undefined>;
|
|
2272
|
+
setSelectedNodeId(params: {
|
|
2273
|
+
nodeId: string | undefined;
|
|
2274
|
+
}): Promise<void>;
|
|
2275
|
+
getSelectedParameterId(): Promise<string | undefined>;
|
|
2276
|
+
setSelectedParameterId(params: {
|
|
2277
|
+
parameterId: string | undefined;
|
|
2278
|
+
}): Promise<void>;
|
|
2279
|
+
getPristine(): Promise<boolean>;
|
|
2280
|
+
insertNode(params: InsertNodeOptions): Promise<string>;
|
|
2281
|
+
deleteNode(params: {
|
|
2282
|
+
nodeId: string;
|
|
2283
|
+
}): Promise<void>;
|
|
2284
|
+
moveNode(params: MoveNodeOptions): Promise<void>;
|
|
2285
|
+
updateNodeProperty(params: UpdateNodePropertyOptions): Promise<void>;
|
|
2286
|
+
updateRootMetadata(params: {
|
|
2287
|
+
metadata: Partial<EditorRootMetadata>;
|
|
2288
|
+
}): Promise<void>;
|
|
2289
|
+
updateRootNode(params: UpdateRootNodeOptions): Promise<void>;
|
|
2290
|
+
insertPattern(params: InsertPatternOptions): Promise<string>;
|
|
2291
|
+
isPatternPropertyOverridden(params: {
|
|
2292
|
+
nodeId: string;
|
|
2293
|
+
property: string;
|
|
2294
|
+
locale?: string;
|
|
2295
|
+
}): Promise<boolean>;
|
|
2296
|
+
resetPatternPropertyOverride(params: {
|
|
2297
|
+
nodeId: string;
|
|
2298
|
+
property: string;
|
|
2299
|
+
locale: string | undefined;
|
|
2300
|
+
}): Promise<void>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Toggles a parameter between "shared" (single invariant value) and "localized"
|
|
2303
|
+
* (per-locale values) — the same operation as the dashboard "Use locale-specific values"
|
|
2304
|
+
* switch on the parameter's locale drawer.
|
|
2305
|
+
*
|
|
2306
|
+
* - `isLocalized: true` copies the current invariant value (and its conditions) into
|
|
2307
|
+
* each locale enabled on the composition.
|
|
2308
|
+
* - `isLocalized: false` copies the value from `copyFromLocale` (or the first defined
|
|
2309
|
+
* locale, if omitted) back into the invariant slot and drops the per-locale values.
|
|
2310
|
+
*
|
|
2311
|
+
* The migration handles pattern parameter overrides, `contentReference` data resource
|
|
2312
|
+
* forking, and the per-node localizability metadata, so the resulting state matches
|
|
2313
|
+
* what the dashboard UI would produce for the same toggle. The whole migration is one
|
|
2314
|
+
* editor mutation, which keeps it as a single undo step for the user.
|
|
2315
|
+
*
|
|
2316
|
+
* The caller must supply `propertyDefinition` — the component-definition parameter for
|
|
2317
|
+
* `(nodeId, property)`. This is required so the bridge can enforce localizability
|
|
2318
|
+
* business rules (e.g. refusing to localize a parameter whose definition forbids it)
|
|
2319
|
+
* and resolve the parameter type for value fan-out. Resolve it from the Uniform public
|
|
2320
|
+
* API using your service account API key (or, in the future, identity delegation) and
|
|
2321
|
+
* cache it client-side as needed.
|
|
2322
|
+
*
|
|
2323
|
+
* No-ops if the parameter is already in the requested state; if the parameter does not
|
|
2324
|
+
* exist on the node; if (when localizing) no locales are enabled; or if (when
|
|
2325
|
+
* localizing) the supplied `propertyDefinition.localizable` is `false`.
|
|
2326
|
+
*
|
|
2327
|
+
* @beta This is beta functionality. It is intentionally exposed as `@deprecated` so
|
|
2328
|
+
* consumers do not depend on it from production integrations — the signature and
|
|
2329
|
+
* behaviour may change without notice.
|
|
2330
|
+
* @deprecated Beta. Subject to change without notice; do not rely on this API in
|
|
2331
|
+
* production integrations.
|
|
2332
|
+
*/
|
|
2333
|
+
setPropertyLocalizability(params: SetPropertyLocalizabilityParams): Promise<void>;
|
|
2334
|
+
enableLocale(params: {
|
|
2335
|
+
locale: string | string[];
|
|
2336
|
+
}): Promise<void>;
|
|
2337
|
+
disableLocale(params: {
|
|
2338
|
+
locale: string;
|
|
2339
|
+
}): Promise<void>;
|
|
2340
|
+
/** Sets the currently active locale in the editor UI */
|
|
2341
|
+
setCurrentLocale(params: {
|
|
2342
|
+
locale: string;
|
|
2343
|
+
}): Promise<void>;
|
|
2344
|
+
/**
|
|
2345
|
+
* Sets the current preview value for a dynamic input.
|
|
2346
|
+
*/
|
|
2347
|
+
setDynamicInputPreviewValue(params: {
|
|
2348
|
+
name: string;
|
|
2349
|
+
value: string;
|
|
2350
|
+
}): Promise<void>;
|
|
2351
|
+
}
|
|
2005
2352
|
|
|
2006
2353
|
type AIGenerateLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
2007
2354
|
prompt: string;
|
|
@@ -2028,6 +2375,15 @@ type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = Co
|
|
|
2028
2375
|
*/
|
|
2029
2376
|
activeReleaseId?: string;
|
|
2030
2377
|
state?: number;
|
|
2378
|
+
/** The current locale selected in the editor UI */
|
|
2379
|
+
currentLocale: string | undefined;
|
|
2380
|
+
/**
|
|
2381
|
+
* Current dynamic inputs configured on the composition (if any).
|
|
2382
|
+
* Dynamic inputs come from project map nodes and represent path or query based dynamic values.
|
|
2383
|
+
*/
|
|
2384
|
+
dynamicInputs: DynamicInputs;
|
|
2385
|
+
/** Component definitions index, keyed by public id. */
|
|
2386
|
+
componentDefinitions: Record<string, ComponentDefinition | undefined>;
|
|
2031
2387
|
}, TIntegrationConfiguration>;
|
|
2032
2388
|
type CanvasEditorToolsReferenceData = {
|
|
2033
2389
|
name: string;
|
|
@@ -2038,13 +2394,22 @@ type CanvasEditorToolsData = {
|
|
|
2038
2394
|
entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
|
|
2039
2395
|
entityType: CanvasEditorEntityType;
|
|
2040
2396
|
} & ({
|
|
2397
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2041
2398
|
rootEntity: RootComponentInstance;
|
|
2042
2399
|
entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
|
|
2043
2400
|
} | {
|
|
2401
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2044
2402
|
rootEntity: EntryData;
|
|
2045
2403
|
entityType: 'entry' | 'entryPattern';
|
|
2046
2404
|
});
|
|
2047
|
-
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation
|
|
2405
|
+
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation & {
|
|
2406
|
+
/**
|
|
2407
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2408
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
2409
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
2410
|
+
*/
|
|
2411
|
+
editorState: EditorStateApi;
|
|
2412
|
+
};
|
|
2048
2413
|
|
|
2049
2414
|
/**
|
|
2050
2415
|
* @deprecated Alpha version of the Embedded Editor location. This location is not yet available for use in the Mesh SDK.
|
|
@@ -2212,4 +2577,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
|
|
|
2212
2577
|
*/
|
|
2213
2578
|
declare const hasRole: (role: string, user: UniformUser) => boolean;
|
|
2214
2579
|
|
|
2215
|
-
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 };
|
|
2580
|
+
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 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 };
|