@uniformdev/mesh-sdk 20.50.1-alpha.4 → 20.50.2-alpha.9

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
2
- import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataVariableDefinition, Locale, EntryData } from '@uniformdev/canvas';
2
+ import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataVariableDefinition, Locale, ComponentParameter, VisibilityCriteriaGroup, EntryData } 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';
@@ -174,6 +174,18 @@ interface paths$1 {
174
174
  };
175
175
  };
176
176
  embeddedEditor?: string;
177
+ dataResourceSelectorUrl?: string;
178
+ dataResourceSelectorLocations?: {
179
+ [key: string]: {
180
+ url: string;
181
+ layout?: {
182
+ /** @enum {string} */
183
+ height?: "full-height";
184
+ /** @enum {string} */
185
+ width?: "wide";
186
+ };
187
+ };
188
+ };
177
189
  };
178
190
  };
179
191
  badgeIconUrl?: string;
@@ -452,6 +464,18 @@ interface paths$1 {
452
464
  };
453
465
  };
454
466
  embeddedEditor?: string;
467
+ dataResourceSelectorUrl?: string;
468
+ dataResourceSelectorLocations?: {
469
+ [key: string]: {
470
+ url: string;
471
+ layout?: {
472
+ /** @enum {string} */
473
+ height?: "full-height";
474
+ /** @enum {string} */
475
+ width?: "wide";
476
+ };
477
+ };
478
+ };
455
479
  };
456
480
  };
457
481
  badgeIconUrl?: string;
@@ -715,6 +739,18 @@ interface paths$1 {
715
739
  };
716
740
  };
717
741
  embeddedEditor?: string;
742
+ dataResourceSelectorUrl?: string;
743
+ dataResourceSelectorLocations?: {
744
+ [key: string]: {
745
+ url: string;
746
+ layout?: {
747
+ /** @enum {string} */
748
+ height?: "full-height";
749
+ /** @enum {string} */
750
+ width?: "wide";
751
+ };
752
+ };
753
+ };
718
754
  };
719
755
  };
720
756
  badgeIconUrl?: string;
@@ -1328,6 +1364,16 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1328
1364
  };
1329
1365
  };
1330
1366
  embeddedEditor?: string;
1367
+ dataResourceSelectorUrl?: string;
1368
+ dataResourceSelectorLocations?: {
1369
+ [key: string]: {
1370
+ url: string;
1371
+ layout?: {
1372
+ height?: "full-height";
1373
+ width?: "wide";
1374
+ };
1375
+ };
1376
+ };
1331
1377
  };
1332
1378
  };
1333
1379
  badgeIconUrl?: string;
@@ -1558,6 +1604,34 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
1558
1604
  }, TIntegrationConfiguration>;
1559
1605
  type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
1560
1606
 
1607
+ /**
1608
+ * Metadata for the dataResourceSelector location.
1609
+ * This location type allows custom UI for selecting JSON pointers within a data resource,
1610
+ * replacing the default JSON tree viewer in the dynamic token picker.
1611
+ */
1612
+ type DataResourceSelectorLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1613
+ /** The resolved data for the currently selected data resource */
1614
+ dataResourceValue: unknown;
1615
+ /** The name of the currently selected data resource */
1616
+ dataResourceName: string;
1617
+ /** The data type ID for the current data resource */
1618
+ dataTypeId: string;
1619
+ /** The data type's archetype value (useful for apps sharing a selector across archetypes) */
1620
+ archetype: string;
1621
+ /** Allowed bindable types for the parameter being connected */
1622
+ allowedTypes: BindableTypes[];
1623
+ }, TIntegrationConfiguration>;
1624
+ /**
1625
+ * Location for custom data resource selector UI.
1626
+ * Replaces the default JSON tree viewer when selecting dynamic tokens from a data resource.
1627
+ *
1628
+ * Value: The selected JSON pointer string (e.g., "/moves/0/move/name")
1629
+ * setValue: Call with a valid JSON pointer to select that path
1630
+ * getDataResource: Fetch data from the data connector using the current data source
1631
+ * @deprecated This is experimental functionality and is subject to change without notice.
1632
+ */
1633
+ type DataResourceSelectorLocation = MeshLocationCore<string, DataResourceSelectorLocationMetadata, string, 'dataResourceSelector'> & GetDataResourceLocation;
1634
+
1561
1635
  type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
1562
1636
  type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1563
1637
  /**
@@ -1569,6 +1643,7 @@ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMet
1569
1643
  type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
1570
1644
 
1571
1645
  type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
1646
+ /** editorState is an experimental replacement for rootNode. This may become deprecated in the future. */
1572
1647
  rootNode: Omit<RootComponentInstance, 'slots' | '_data'> & {
1573
1648
  _editionId?: string;
1574
1649
  };
@@ -1597,6 +1672,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1597
1672
  * Note that setValue() always sets the target language automatically.
1598
1673
  */
1599
1674
  targetLocale: string | undefined;
1675
+ /**
1676
+ * The current locale selected in the editor UI.
1677
+ * Unlike targetLocale, this reflects the editor's global locale state.
1678
+ */
1679
+ currentLocale: string | undefined;
1600
1680
  /**
1601
1681
  * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1602
1682
  * If this is -1, then the editor is not editing a conditional value.
@@ -1609,6 +1689,12 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
1609
1689
  * Returns the result of the dialog. Useful to build data-enabled parameter types.
1610
1690
  */
1611
1691
  editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
1692
+ /**
1693
+ * Imperative API for interacting with the composition/entry editor state.
1694
+ * Provides non-reactive access to read and modify the editor state.
1695
+ * @deprecated This is experimental functionality and is subject to change without notice.
1696
+ */
1697
+ editorState: EditorStateApi;
1612
1698
  };
1613
1699
 
1614
1700
  type SettingsLocationMetadata = CommonMetadata;
@@ -1618,7 +1704,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
1618
1704
  * Defines methods used for interacting with a Mesh location
1619
1705
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1620
1706
  */
1621
- 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>;
1707
+ 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>;
1622
1708
  interface MeshContextData {
1623
1709
  locationKey: string;
1624
1710
  locationType: MeshLocationTypes;
@@ -1810,6 +1896,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
1810
1896
  navigate: (message: NavigateMessage) => Promise<void>;
1811
1897
  reloadLocation: () => Promise<void>;
1812
1898
  editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
1899
+ editorState: EditorStateApi;
1813
1900
  };
1814
1901
  }>;
1815
1902
 
@@ -1970,7 +2057,7 @@ type MeshLocationUserPermissions =
1970
2057
  /**
1971
2058
  * Known location types that can be passed to a mesh location
1972
2059
  */
1973
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
2060
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'dataResourceSelector' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
1974
2061
  type SetValueOptions = ValidationResult;
1975
2062
  type SetValueMessage = {
1976
2063
  uniformMeshLocationValue: unknown;
@@ -1995,6 +2082,183 @@ type DynamicInput = {
1995
2082
  };
1996
2083
  /** Record of dynamic inputs keyed by the input name */
1997
2084
  type DynamicInputs = Record<string, DynamicInput>;
2085
+ /** Metadata about the composition (description, category, workflow, etc.) */
2086
+ type EditorRootMetadata = {
2087
+ description?: string;
2088
+ previewImageUrl?: string;
2089
+ categoryId?: string;
2090
+ workflowId?: string;
2091
+ workflowStageId?: string;
2092
+ editionName?: string;
2093
+ editionPriority?: number;
2094
+ };
2095
+ /** Root node metadata (name and slug) */
2096
+ type EditorRootNodeMetadata = {
2097
+ _name: string;
2098
+ _slug: string | null | undefined;
2099
+ };
2100
+ /** Options for exporting the tree */
2101
+ type EditorExportOptions = {
2102
+ /** If true, includes pattern descendant data in export */
2103
+ keepPatternData?: boolean;
2104
+ };
2105
+ /** A component instance without slots/params (indexed separately) */
2106
+ type EditorComponentInstance = Omit<ComponentInstance, 'slots' | 'parameters' | '_id'>;
2107
+ /** An indexed node within the editor state */
2108
+ type EditorNode = {
2109
+ nodeId: string;
2110
+ parentId?: string;
2111
+ isBlock?: boolean;
2112
+ value: EditorComponentInstance;
2113
+ /** If part of a pattern, the pattern ID */
2114
+ partOfPattern?: string;
2115
+ /** If part of a nested pattern */
2116
+ partOfNestedPattern?: string;
2117
+ /** UI expansion state */
2118
+ isExpandedInUI?: boolean;
2119
+ };
2120
+ /** Child node IDs indexed by slot name */
2121
+ type EditorNodeChildren = {
2122
+ [slotName: string]: string[];
2123
+ };
2124
+ /** A component parameter value */
2125
+ type EditorComponentParameter<T = unknown> = Omit<ComponentParameter<T>, 'connectedData'>;
2126
+ /** Parent info for a node */
2127
+ type EditorNodeParentInfo = {
2128
+ parentId: string;
2129
+ parentName: string;
2130
+ targetIndexInParent: number;
2131
+ value: EditorComponentInstance;
2132
+ parentChildIds: string[];
2133
+ parentType: 'slot' | 'block';
2134
+ };
2135
+ /** Options for updateNodeProperty */
2136
+ type UpdateNodePropertyOptions = {
2137
+ nodeId: string;
2138
+ property: string;
2139
+ /**
2140
+ * The new value to set. Pass the final value directly.
2141
+ * - `undefined` to soft-delete (remove current locale/condition value)
2142
+ * - `null` to hard-delete (remove entire parameter)
2143
+ * - any other value to set
2144
+ *
2145
+ * For read-modify-write, call getNodeProperty() first to get current value.
2146
+ */
2147
+ value: unknown | undefined | null;
2148
+ /** Parameter type (required for new parameters) */
2149
+ type?: string;
2150
+ /** Target locale, or undefined for invariant value */
2151
+ locale: string | undefined;
2152
+ /** Condition index (-1 for base value, >= 0 for conditional) */
2153
+ conditionIndex: number;
2154
+ /** Condition definition (required when conditionIndex >= 0) */
2155
+ conditionDefinition?: VisibilityCriteriaGroup | null;
2156
+ };
2157
+ /** Options for insertNode */
2158
+ type InsertNodeOptions = {
2159
+ node: EditorComponentInstance;
2160
+ parentNodeId: string;
2161
+ parentSlot: string;
2162
+ targetIndexInSlot?: number;
2163
+ };
2164
+ /** Options for moveNode */
2165
+ type MoveNodeOptions = {
2166
+ movedNodeId: string;
2167
+ parentNodeId: string;
2168
+ parentSlot: string;
2169
+ targetIndexInSlot: number;
2170
+ };
2171
+ /** Options for insertPattern */
2172
+ type InsertPatternOptions = {
2173
+ pattern: RootComponentInstance;
2174
+ parentNodeId: string;
2175
+ parentSlot: string;
2176
+ targetIndexInSlot?: number;
2177
+ patternInstanceId?: string;
2178
+ };
2179
+ /** Options for updateRootNode */
2180
+ type UpdateRootNodeOptions = {
2181
+ update: Partial<EditorRootNodeMetadata>;
2182
+ };
2183
+ /**
2184
+ * Imperative API for interacting with the composition/entry editor state.
2185
+ * Available on `canvasEditorTools` and `paramType` locations.
2186
+ *
2187
+ * All methods use object parameters for consistency across client, wire format, and server.
2188
+ */
2189
+ interface EditorStateApi {
2190
+ getRootNodeId(): Promise<string>;
2191
+ exportTree(params?: EditorExportOptions): Promise<RootComponentInstance>;
2192
+ exportSubtree(params: {
2193
+ nodeId: string;
2194
+ options?: EditorExportOptions;
2195
+ }): Promise<ComponentInstance>;
2196
+ exportMetadata(): Promise<EditorRootMetadata>;
2197
+ exportRootNodeMetadata(): Promise<EditorRootNodeMetadata>;
2198
+ getNodeById(params: {
2199
+ nodeId: string;
2200
+ }): Promise<EditorNode | undefined>;
2201
+ getNodeChildren(params: {
2202
+ nodeId: string;
2203
+ }): Promise<EditorNodeChildren | undefined>;
2204
+ getNodeProperty<T = unknown>(params: {
2205
+ nodeId: string;
2206
+ property: string;
2207
+ }): Promise<EditorComponentParameter<T> | undefined>;
2208
+ getNodeProperties(params: {
2209
+ nodeId: string;
2210
+ }): Promise<Record<string, EditorComponentParameter>>;
2211
+ getParentInfo(params: {
2212
+ nodeId: string;
2213
+ }): Promise<EditorNodeParentInfo | undefined>;
2214
+ getSelectedNodeId(): Promise<string | undefined>;
2215
+ setSelectedNodeId(params: {
2216
+ nodeId: string | undefined;
2217
+ }): Promise<void>;
2218
+ getSelectedParameterId(): Promise<string | undefined>;
2219
+ setSelectedParameterId(params: {
2220
+ parameterId: string | undefined;
2221
+ }): Promise<void>;
2222
+ getPristine(): Promise<boolean>;
2223
+ insertNode(params: InsertNodeOptions): Promise<string>;
2224
+ deleteNode(params: {
2225
+ nodeId: string;
2226
+ }): Promise<void>;
2227
+ moveNode(params: MoveNodeOptions): Promise<void>;
2228
+ updateNodeProperty(params: UpdateNodePropertyOptions): Promise<void>;
2229
+ updateRootMetadata(params: {
2230
+ metadata: Partial<EditorRootMetadata>;
2231
+ }): Promise<void>;
2232
+ updateRootNode(params: UpdateRootNodeOptions): Promise<void>;
2233
+ insertPattern(params: InsertPatternOptions): Promise<string>;
2234
+ isPatternPropertyOverridden(params: {
2235
+ nodeId: string;
2236
+ property: string;
2237
+ locale?: string;
2238
+ }): Promise<boolean>;
2239
+ resetPatternPropertyOverride(params: {
2240
+ nodeId: string;
2241
+ property: string;
2242
+ locale: string | undefined;
2243
+ }): Promise<void>;
2244
+ enableLocale(params: {
2245
+ locale: string | string[];
2246
+ }): Promise<void>;
2247
+ disableLocale(params: {
2248
+ locale: string;
2249
+ }): Promise<void>;
2250
+ /** Sets the currently active locale in the editor UI */
2251
+ setCurrentLocale(params: {
2252
+ locale: string;
2253
+ }): Promise<void>;
2254
+ /**
2255
+ * Sets the current preview value for a dynamic input.
2256
+ */
2257
+ setDynamicInputPreviewValue(params: {
2258
+ name: string;
2259
+ value: string;
2260
+ }): Promise<void>;
2261
+ }
1998
2262
 
1999
2263
  type AIGenerateLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
2000
2264
  prompt: string;
@@ -2012,6 +2276,13 @@ type AIPromptMetadataLocation = MeshLocationCore<Record<string, unknown>, Prompt
2012
2276
  type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
2013
2277
  releaseId?: string;
2014
2278
  state?: number;
2279
+ /** The current locale selected in the editor UI */
2280
+ currentLocale: string | undefined;
2281
+ /**
2282
+ * Current dynamic inputs configured on the composition (if any).
2283
+ * Dynamic inputs come from project map nodes and represent path or query based dynamic values.
2284
+ */
2285
+ dynamicInputs: DynamicInputs;
2015
2286
  }, TIntegrationConfiguration>;
2016
2287
  type CanvasEditorToolsReferenceData = {
2017
2288
  name: string;
@@ -2022,13 +2293,22 @@ type CanvasEditorToolsData = {
2022
2293
  entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
2023
2294
  entityType: CanvasEditorEntityType;
2024
2295
  } & ({
2296
+ /** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
2025
2297
  rootEntity: RootComponentInstance;
2026
2298
  entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
2027
2299
  } | {
2300
+ /** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
2028
2301
  rootEntity: EntryData;
2029
2302
  entityType: 'entry' | 'entryPattern';
2030
2303
  });
2031
- type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
2304
+ type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation & {
2305
+ /**
2306
+ * Imperative API for interacting with the composition/entry editor state.
2307
+ * Provides non-reactive access to read and modify the editor state.
2308
+ * @deprecated This is experimental functionality and is subject to change without notice.
2309
+ */
2310
+ editorState: EditorStateApi;
2311
+ };
2032
2312
 
2033
2313
  /**
2034
2314
  * @deprecated Alpha version of the Embedded Editor location. This location is not yet available for use in the Mesh SDK.
@@ -2196,4 +2476,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
2196
2476
  */
2197
2477
  declare const hasRole: (role: string, user: UniformUser) => boolean;
2198
2478
 
2199
- 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 };
2479
+ 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 SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type UpdateNodePropertyOptions, type UpdateRootNodeOptions, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
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, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataVariableDefinition, Locale, EntryData } from '@uniformdev/canvas';
2
+ import { AssetParamValue, DataType, DataSource, DataSourceVariantsKeys, DataResourceVariables, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataVariableDefinition, Locale, ComponentParameter, VisibilityCriteriaGroup, EntryData } 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';
@@ -174,6 +174,18 @@ interface paths$1 {
174
174
  };
175
175
  };
176
176
  embeddedEditor?: string;
177
+ dataResourceSelectorUrl?: string;
178
+ dataResourceSelectorLocations?: {
179
+ [key: string]: {
180
+ url: string;
181
+ layout?: {
182
+ /** @enum {string} */
183
+ height?: "full-height";
184
+ /** @enum {string} */
185
+ width?: "wide";
186
+ };
187
+ };
188
+ };
177
189
  };
178
190
  };
179
191
  badgeIconUrl?: string;
@@ -452,6 +464,18 @@ interface paths$1 {
452
464
  };
453
465
  };
454
466
  embeddedEditor?: string;
467
+ dataResourceSelectorUrl?: string;
468
+ dataResourceSelectorLocations?: {
469
+ [key: string]: {
470
+ url: string;
471
+ layout?: {
472
+ /** @enum {string} */
473
+ height?: "full-height";
474
+ /** @enum {string} */
475
+ width?: "wide";
476
+ };
477
+ };
478
+ };
455
479
  };
456
480
  };
457
481
  badgeIconUrl?: string;
@@ -715,6 +739,18 @@ interface paths$1 {
715
739
  };
716
740
  };
717
741
  embeddedEditor?: string;
742
+ dataResourceSelectorUrl?: string;
743
+ dataResourceSelectorLocations?: {
744
+ [key: string]: {
745
+ url: string;
746
+ layout?: {
747
+ /** @enum {string} */
748
+ height?: "full-height";
749
+ /** @enum {string} */
750
+ width?: "wide";
751
+ };
752
+ };
753
+ };
718
754
  };
719
755
  };
720
756
  badgeIconUrl?: string;
@@ -1328,6 +1364,16 @@ declare class IntegrationDefinitionClient extends ApiClient<DefClientOptions> {
1328
1364
  };
1329
1365
  };
1330
1366
  embeddedEditor?: string;
1367
+ dataResourceSelectorUrl?: string;
1368
+ dataResourceSelectorLocations?: {
1369
+ [key: string]: {
1370
+ url: string;
1371
+ layout?: {
1372
+ height?: "full-height";
1373
+ width?: "wide";
1374
+ };
1375
+ };
1376
+ };
1331
1377
  };
1332
1378
  };
1333
1379
  badgeIconUrl?: string;
@@ -1558,6 +1604,34 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
1558
1604
  }, TIntegrationConfiguration>;
1559
1605
  type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
1560
1606
 
1607
+ /**
1608
+ * Metadata for the dataResourceSelector location.
1609
+ * This location type allows custom UI for selecting JSON pointers within a data resource,
1610
+ * replacing the default JSON tree viewer in the dynamic token picker.
1611
+ */
1612
+ type DataResourceSelectorLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1613
+ /** The resolved data for the currently selected data resource */
1614
+ dataResourceValue: unknown;
1615
+ /** The name of the currently selected data resource */
1616
+ dataResourceName: string;
1617
+ /** The data type ID for the current data resource */
1618
+ dataTypeId: string;
1619
+ /** The data type's archetype value (useful for apps sharing a selector across archetypes) */
1620
+ archetype: string;
1621
+ /** Allowed bindable types for the parameter being connected */
1622
+ allowedTypes: BindableTypes[];
1623
+ }, TIntegrationConfiguration>;
1624
+ /**
1625
+ * Location for custom data resource selector UI.
1626
+ * Replaces the default JSON tree viewer when selecting dynamic tokens from a data resource.
1627
+ *
1628
+ * Value: The selected JSON pointer string (e.g., "/moves/0/move/name")
1629
+ * setValue: Call with a valid JSON pointer to select that path
1630
+ * getDataResource: Fetch data from the data connector using the current data source
1631
+ * @deprecated This is experimental functionality and is subject to change without notice.
1632
+ */
1633
+ type DataResourceSelectorLocation = MeshLocationCore<string, DataResourceSelectorLocationMetadata, string, 'dataResourceSelector'> & GetDataResourceLocation;
1634
+
1561
1635
  type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
1562
1636
  type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
1563
1637
  /**
@@ -1569,6 +1643,7 @@ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMet
1569
1643
  type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
1570
1644
 
1571
1645
  type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
1646
+ /** editorState is an experimental replacement for rootNode. This may become deprecated in the future. */
1572
1647
  rootNode: Omit<RootComponentInstance, 'slots' | '_data'> & {
1573
1648
  _editionId?: string;
1574
1649
  };
@@ -1597,6 +1672,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
1597
1672
  * Note that setValue() always sets the target language automatically.
1598
1673
  */
1599
1674
  targetLocale: string | undefined;
1675
+ /**
1676
+ * The current locale selected in the editor UI.
1677
+ * Unlike targetLocale, this reflects the editor's global locale state.
1678
+ */
1679
+ currentLocale: string | undefined;
1600
1680
  /**
1601
1681
  * When editing a conditional value, this is the index in the parent parameter of the conditional value.
1602
1682
  * If this is -1, then the editor is not editing a conditional value.
@@ -1609,6 +1689,12 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
1609
1689
  * Returns the result of the dialog. Useful to build data-enabled parameter types.
1610
1690
  */
1611
1691
  editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
1692
+ /**
1693
+ * Imperative API for interacting with the composition/entry editor state.
1694
+ * Provides non-reactive access to read and modify the editor state.
1695
+ * @deprecated This is experimental functionality and is subject to change without notice.
1696
+ */
1697
+ editorState: EditorStateApi;
1612
1698
  };
1613
1699
 
1614
1700
  type SettingsLocationMetadata = CommonMetadata;
@@ -1618,7 +1704,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
1618
1704
  * Defines methods used for interacting with a Mesh location
1619
1705
  * To receive useful typings, check the `type` property of the location to narrow the typing.
1620
1706
  */
1621
- 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>;
1707
+ 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>;
1622
1708
  interface MeshContextData {
1623
1709
  locationKey: string;
1624
1710
  locationType: MeshLocationTypes;
@@ -1810,6 +1896,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
1810
1896
  navigate: (message: NavigateMessage) => Promise<void>;
1811
1897
  reloadLocation: () => Promise<void>;
1812
1898
  editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
1899
+ editorState: EditorStateApi;
1813
1900
  };
1814
1901
  }>;
1815
1902
 
@@ -1970,7 +2057,7 @@ type MeshLocationUserPermissions =
1970
2057
  /**
1971
2058
  * Known location types that can be passed to a mesh location
1972
2059
  */
1973
- type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
2060
+ type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'dataResourceSelector' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
1974
2061
  type SetValueOptions = ValidationResult;
1975
2062
  type SetValueMessage = {
1976
2063
  uniformMeshLocationValue: unknown;
@@ -1995,6 +2082,183 @@ type DynamicInput = {
1995
2082
  };
1996
2083
  /** Record of dynamic inputs keyed by the input name */
1997
2084
  type DynamicInputs = Record<string, DynamicInput>;
2085
+ /** Metadata about the composition (description, category, workflow, etc.) */
2086
+ type EditorRootMetadata = {
2087
+ description?: string;
2088
+ previewImageUrl?: string;
2089
+ categoryId?: string;
2090
+ workflowId?: string;
2091
+ workflowStageId?: string;
2092
+ editionName?: string;
2093
+ editionPriority?: number;
2094
+ };
2095
+ /** Root node metadata (name and slug) */
2096
+ type EditorRootNodeMetadata = {
2097
+ _name: string;
2098
+ _slug: string | null | undefined;
2099
+ };
2100
+ /** Options for exporting the tree */
2101
+ type EditorExportOptions = {
2102
+ /** If true, includes pattern descendant data in export */
2103
+ keepPatternData?: boolean;
2104
+ };
2105
+ /** A component instance without slots/params (indexed separately) */
2106
+ type EditorComponentInstance = Omit<ComponentInstance, 'slots' | 'parameters' | '_id'>;
2107
+ /** An indexed node within the editor state */
2108
+ type EditorNode = {
2109
+ nodeId: string;
2110
+ parentId?: string;
2111
+ isBlock?: boolean;
2112
+ value: EditorComponentInstance;
2113
+ /** If part of a pattern, the pattern ID */
2114
+ partOfPattern?: string;
2115
+ /** If part of a nested pattern */
2116
+ partOfNestedPattern?: string;
2117
+ /** UI expansion state */
2118
+ isExpandedInUI?: boolean;
2119
+ };
2120
+ /** Child node IDs indexed by slot name */
2121
+ type EditorNodeChildren = {
2122
+ [slotName: string]: string[];
2123
+ };
2124
+ /** A component parameter value */
2125
+ type EditorComponentParameter<T = unknown> = Omit<ComponentParameter<T>, 'connectedData'>;
2126
+ /** Parent info for a node */
2127
+ type EditorNodeParentInfo = {
2128
+ parentId: string;
2129
+ parentName: string;
2130
+ targetIndexInParent: number;
2131
+ value: EditorComponentInstance;
2132
+ parentChildIds: string[];
2133
+ parentType: 'slot' | 'block';
2134
+ };
2135
+ /** Options for updateNodeProperty */
2136
+ type UpdateNodePropertyOptions = {
2137
+ nodeId: string;
2138
+ property: string;
2139
+ /**
2140
+ * The new value to set. Pass the final value directly.
2141
+ * - `undefined` to soft-delete (remove current locale/condition value)
2142
+ * - `null` to hard-delete (remove entire parameter)
2143
+ * - any other value to set
2144
+ *
2145
+ * For read-modify-write, call getNodeProperty() first to get current value.
2146
+ */
2147
+ value: unknown | undefined | null;
2148
+ /** Parameter type (required for new parameters) */
2149
+ type?: string;
2150
+ /** Target locale, or undefined for invariant value */
2151
+ locale: string | undefined;
2152
+ /** Condition index (-1 for base value, >= 0 for conditional) */
2153
+ conditionIndex: number;
2154
+ /** Condition definition (required when conditionIndex >= 0) */
2155
+ conditionDefinition?: VisibilityCriteriaGroup | null;
2156
+ };
2157
+ /** Options for insertNode */
2158
+ type InsertNodeOptions = {
2159
+ node: EditorComponentInstance;
2160
+ parentNodeId: string;
2161
+ parentSlot: string;
2162
+ targetIndexInSlot?: number;
2163
+ };
2164
+ /** Options for moveNode */
2165
+ type MoveNodeOptions = {
2166
+ movedNodeId: string;
2167
+ parentNodeId: string;
2168
+ parentSlot: string;
2169
+ targetIndexInSlot: number;
2170
+ };
2171
+ /** Options for insertPattern */
2172
+ type InsertPatternOptions = {
2173
+ pattern: RootComponentInstance;
2174
+ parentNodeId: string;
2175
+ parentSlot: string;
2176
+ targetIndexInSlot?: number;
2177
+ patternInstanceId?: string;
2178
+ };
2179
+ /** Options for updateRootNode */
2180
+ type UpdateRootNodeOptions = {
2181
+ update: Partial<EditorRootNodeMetadata>;
2182
+ };
2183
+ /**
2184
+ * Imperative API for interacting with the composition/entry editor state.
2185
+ * Available on `canvasEditorTools` and `paramType` locations.
2186
+ *
2187
+ * All methods use object parameters for consistency across client, wire format, and server.
2188
+ */
2189
+ interface EditorStateApi {
2190
+ getRootNodeId(): Promise<string>;
2191
+ exportTree(params?: EditorExportOptions): Promise<RootComponentInstance>;
2192
+ exportSubtree(params: {
2193
+ nodeId: string;
2194
+ options?: EditorExportOptions;
2195
+ }): Promise<ComponentInstance>;
2196
+ exportMetadata(): Promise<EditorRootMetadata>;
2197
+ exportRootNodeMetadata(): Promise<EditorRootNodeMetadata>;
2198
+ getNodeById(params: {
2199
+ nodeId: string;
2200
+ }): Promise<EditorNode | undefined>;
2201
+ getNodeChildren(params: {
2202
+ nodeId: string;
2203
+ }): Promise<EditorNodeChildren | undefined>;
2204
+ getNodeProperty<T = unknown>(params: {
2205
+ nodeId: string;
2206
+ property: string;
2207
+ }): Promise<EditorComponentParameter<T> | undefined>;
2208
+ getNodeProperties(params: {
2209
+ nodeId: string;
2210
+ }): Promise<Record<string, EditorComponentParameter>>;
2211
+ getParentInfo(params: {
2212
+ nodeId: string;
2213
+ }): Promise<EditorNodeParentInfo | undefined>;
2214
+ getSelectedNodeId(): Promise<string | undefined>;
2215
+ setSelectedNodeId(params: {
2216
+ nodeId: string | undefined;
2217
+ }): Promise<void>;
2218
+ getSelectedParameterId(): Promise<string | undefined>;
2219
+ setSelectedParameterId(params: {
2220
+ parameterId: string | undefined;
2221
+ }): Promise<void>;
2222
+ getPristine(): Promise<boolean>;
2223
+ insertNode(params: InsertNodeOptions): Promise<string>;
2224
+ deleteNode(params: {
2225
+ nodeId: string;
2226
+ }): Promise<void>;
2227
+ moveNode(params: MoveNodeOptions): Promise<void>;
2228
+ updateNodeProperty(params: UpdateNodePropertyOptions): Promise<void>;
2229
+ updateRootMetadata(params: {
2230
+ metadata: Partial<EditorRootMetadata>;
2231
+ }): Promise<void>;
2232
+ updateRootNode(params: UpdateRootNodeOptions): Promise<void>;
2233
+ insertPattern(params: InsertPatternOptions): Promise<string>;
2234
+ isPatternPropertyOverridden(params: {
2235
+ nodeId: string;
2236
+ property: string;
2237
+ locale?: string;
2238
+ }): Promise<boolean>;
2239
+ resetPatternPropertyOverride(params: {
2240
+ nodeId: string;
2241
+ property: string;
2242
+ locale: string | undefined;
2243
+ }): Promise<void>;
2244
+ enableLocale(params: {
2245
+ locale: string | string[];
2246
+ }): Promise<void>;
2247
+ disableLocale(params: {
2248
+ locale: string;
2249
+ }): Promise<void>;
2250
+ /** Sets the currently active locale in the editor UI */
2251
+ setCurrentLocale(params: {
2252
+ locale: string;
2253
+ }): Promise<void>;
2254
+ /**
2255
+ * Sets the current preview value for a dynamic input.
2256
+ */
2257
+ setDynamicInputPreviewValue(params: {
2258
+ name: string;
2259
+ value: string;
2260
+ }): Promise<void>;
2261
+ }
1998
2262
 
1999
2263
  type AIGenerateLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
2000
2264
  prompt: string;
@@ -2012,6 +2276,13 @@ type AIPromptMetadataLocation = MeshLocationCore<Record<string, unknown>, Prompt
2012
2276
  type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
2013
2277
  releaseId?: string;
2014
2278
  state?: number;
2279
+ /** The current locale selected in the editor UI */
2280
+ currentLocale: string | undefined;
2281
+ /**
2282
+ * Current dynamic inputs configured on the composition (if any).
2283
+ * Dynamic inputs come from project map nodes and represent path or query based dynamic values.
2284
+ */
2285
+ dynamicInputs: DynamicInputs;
2015
2286
  }, TIntegrationConfiguration>;
2016
2287
  type CanvasEditorToolsReferenceData = {
2017
2288
  name: string;
@@ -2022,13 +2293,22 @@ type CanvasEditorToolsData = {
2022
2293
  entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
2023
2294
  entityType: CanvasEditorEntityType;
2024
2295
  } & ({
2296
+ /** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
2025
2297
  rootEntity: RootComponentInstance;
2026
2298
  entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
2027
2299
  } | {
2300
+ /** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
2028
2301
  rootEntity: EntryData;
2029
2302
  entityType: 'entry' | 'entryPattern';
2030
2303
  });
2031
- type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation;
2304
+ type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation & {
2305
+ /**
2306
+ * Imperative API for interacting with the composition/entry editor state.
2307
+ * Provides non-reactive access to read and modify the editor state.
2308
+ * @deprecated This is experimental functionality and is subject to change without notice.
2309
+ */
2310
+ editorState: EditorStateApi;
2311
+ };
2032
2312
 
2033
2313
  /**
2034
2314
  * @deprecated Alpha version of the Embedded Editor location. This location is not yet available for use in the Mesh SDK.
@@ -2196,4 +2476,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
2196
2476
  */
2197
2477
  declare const hasRole: (role: string, user: UniformUser) => boolean;
2198
2478
 
2199
- 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 };
2479
+ 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 SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type UpdateNodePropertyOptions, type UpdateRootNodeOptions, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
package/dist/index.esm.js CHANGED
@@ -131,7 +131,7 @@ var getLogger = (prefix, debug) => {
131
131
  };
132
132
 
133
133
  // src/temp/version.ts
134
- var UNIFORM_MESH_SDK_VERSION = "20.50.0";
134
+ var UNIFORM_MESH_SDK_VERSION = "20.50.1";
135
135
 
136
136
  // src/framepost/constants.ts
137
137
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -535,7 +535,110 @@ async function connectToParent({
535
535
  )
536
536
  }
537
537
  );
538
+ },
539
+ editorState: createEditorStateApi(client)
540
+ }
541
+ };
542
+ }
543
+ function createEditorStateApi(client) {
544
+ let cachedRootNodeId;
545
+ return {
546
+ async getRootNodeId() {
547
+ if (cachedRootNodeId) {
548
+ return cachedRootNodeId;
538
549
  }
550
+ const result = await client.request("editorState.getRootNodeId");
551
+ cachedRootNodeId = result;
552
+ return result;
553
+ },
554
+ // Read operations
555
+ async exportTree(params) {
556
+ const result = await client.request("editorState.exportTree", params);
557
+ cachedRootNodeId != null ? cachedRootNodeId : cachedRootNodeId = result == null ? void 0 : result._id;
558
+ return result;
559
+ },
560
+ async exportSubtree(params) {
561
+ return await client.request("editorState.exportSubtree", params);
562
+ },
563
+ async exportMetadata() {
564
+ return await client.request("editorState.exportMetadata");
565
+ },
566
+ async exportRootNodeMetadata() {
567
+ return await client.request("editorState.exportRootNodeMetadata");
568
+ },
569
+ async getNodeById(params) {
570
+ return await client.request("editorState.getNodeById", params);
571
+ },
572
+ async getNodeChildren(params) {
573
+ return await client.request("editorState.getNodeChildren", params);
574
+ },
575
+ async getNodeProperty(params) {
576
+ return await client.request("editorState.getNodeProperty", params);
577
+ },
578
+ async getNodeProperties(params) {
579
+ return await client.request("editorState.getNodeProperties", params);
580
+ },
581
+ async getParentInfo(params) {
582
+ return await client.request("editorState.getParentInfo", params);
583
+ },
584
+ // Selection
585
+ async getSelectedNodeId() {
586
+ return await client.request("editorState.getSelectedNodeId");
587
+ },
588
+ async setSelectedNodeId(params) {
589
+ await client.request("editorState.setSelectedNodeId", params);
590
+ },
591
+ async getSelectedParameterId() {
592
+ return await client.request("editorState.getSelectedParameterId");
593
+ },
594
+ async setSelectedParameterId(params) {
595
+ await client.request("editorState.setSelectedParameterId", params);
596
+ },
597
+ async getPristine() {
598
+ return await client.request("editorState.getPristine");
599
+ },
600
+ // Write operations
601
+ async insertNode(params) {
602
+ return await client.request("editorState.insertNode", params);
603
+ },
604
+ async deleteNode(params) {
605
+ await client.request("editorState.deleteNode", params);
606
+ },
607
+ async moveNode(params) {
608
+ await client.request("editorState.moveNode", params);
609
+ },
610
+ async updateNodeProperty(params) {
611
+ await client.request("editorState.updateNodeProperty", params);
612
+ },
613
+ async updateRootMetadata(params) {
614
+ await client.request("editorState.updateRootMetadata", params);
615
+ },
616
+ async updateRootNode(params) {
617
+ await client.request("editorState.updateRootNode", params);
618
+ },
619
+ // Pattern operations
620
+ async insertPattern(params) {
621
+ return await client.request("editorState.insertPattern", params);
622
+ },
623
+ async isPatternPropertyOverridden(params) {
624
+ return await client.request("editorState.isPatternPropertyOverridden", params);
625
+ },
626
+ async resetPatternPropertyOverride(params) {
627
+ await client.request("editorState.resetPatternPropertyOverride", params);
628
+ },
629
+ // Locale operations
630
+ async enableLocale(params) {
631
+ await client.request("editorState.enableLocale", params);
632
+ },
633
+ async disableLocale(params) {
634
+ await client.request("editorState.disableLocale", params);
635
+ },
636
+ async setCurrentLocale(params) {
637
+ await client.request("editorState.setCurrentLocale", params);
638
+ },
639
+ // Dynamic input operations
640
+ async setDynamicInputPreviewValue(params) {
641
+ await client.request("editorState.setDynamicInputPreviewValue", params);
539
642
  }
540
643
  };
541
644
  }
@@ -733,7 +836,8 @@ async function initializeUniformMeshSDK({
733
836
  sdk.events.emit("onValueChanged", { newValue: value });
734
837
  await parent.setValue({ uniformMeshLocationValue: value, closeDialog: true });
735
838
  }
736
- } : void 0
839
+ } : void 0,
840
+ editorState: parent.editorState
737
841
  };
738
842
  return location;
739
843
  },
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var getLogger = (prefix, debug) => {
172
172
  };
173
173
 
174
174
  // src/temp/version.ts
175
- var UNIFORM_MESH_SDK_VERSION = "20.50.0";
175
+ var UNIFORM_MESH_SDK_VERSION = "20.50.1";
176
176
 
177
177
  // src/framepost/constants.ts
178
178
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -576,7 +576,110 @@ async function connectToParent({
576
576
  )
577
577
  }
578
578
  );
579
+ },
580
+ editorState: createEditorStateApi(client)
581
+ }
582
+ };
583
+ }
584
+ function createEditorStateApi(client) {
585
+ let cachedRootNodeId;
586
+ return {
587
+ async getRootNodeId() {
588
+ if (cachedRootNodeId) {
589
+ return cachedRootNodeId;
579
590
  }
591
+ const result = await client.request("editorState.getRootNodeId");
592
+ cachedRootNodeId = result;
593
+ return result;
594
+ },
595
+ // Read operations
596
+ async exportTree(params) {
597
+ const result = await client.request("editorState.exportTree", params);
598
+ cachedRootNodeId != null ? cachedRootNodeId : cachedRootNodeId = result == null ? void 0 : result._id;
599
+ return result;
600
+ },
601
+ async exportSubtree(params) {
602
+ return await client.request("editorState.exportSubtree", params);
603
+ },
604
+ async exportMetadata() {
605
+ return await client.request("editorState.exportMetadata");
606
+ },
607
+ async exportRootNodeMetadata() {
608
+ return await client.request("editorState.exportRootNodeMetadata");
609
+ },
610
+ async getNodeById(params) {
611
+ return await client.request("editorState.getNodeById", params);
612
+ },
613
+ async getNodeChildren(params) {
614
+ return await client.request("editorState.getNodeChildren", params);
615
+ },
616
+ async getNodeProperty(params) {
617
+ return await client.request("editorState.getNodeProperty", params);
618
+ },
619
+ async getNodeProperties(params) {
620
+ return await client.request("editorState.getNodeProperties", params);
621
+ },
622
+ async getParentInfo(params) {
623
+ return await client.request("editorState.getParentInfo", params);
624
+ },
625
+ // Selection
626
+ async getSelectedNodeId() {
627
+ return await client.request("editorState.getSelectedNodeId");
628
+ },
629
+ async setSelectedNodeId(params) {
630
+ await client.request("editorState.setSelectedNodeId", params);
631
+ },
632
+ async getSelectedParameterId() {
633
+ return await client.request("editorState.getSelectedParameterId");
634
+ },
635
+ async setSelectedParameterId(params) {
636
+ await client.request("editorState.setSelectedParameterId", params);
637
+ },
638
+ async getPristine() {
639
+ return await client.request("editorState.getPristine");
640
+ },
641
+ // Write operations
642
+ async insertNode(params) {
643
+ return await client.request("editorState.insertNode", params);
644
+ },
645
+ async deleteNode(params) {
646
+ await client.request("editorState.deleteNode", params);
647
+ },
648
+ async moveNode(params) {
649
+ await client.request("editorState.moveNode", params);
650
+ },
651
+ async updateNodeProperty(params) {
652
+ await client.request("editorState.updateNodeProperty", params);
653
+ },
654
+ async updateRootMetadata(params) {
655
+ await client.request("editorState.updateRootMetadata", params);
656
+ },
657
+ async updateRootNode(params) {
658
+ await client.request("editorState.updateRootNode", params);
659
+ },
660
+ // Pattern operations
661
+ async insertPattern(params) {
662
+ return await client.request("editorState.insertPattern", params);
663
+ },
664
+ async isPatternPropertyOverridden(params) {
665
+ return await client.request("editorState.isPatternPropertyOverridden", params);
666
+ },
667
+ async resetPatternPropertyOverride(params) {
668
+ await client.request("editorState.resetPatternPropertyOverride", params);
669
+ },
670
+ // Locale operations
671
+ async enableLocale(params) {
672
+ await client.request("editorState.enableLocale", params);
673
+ },
674
+ async disableLocale(params) {
675
+ await client.request("editorState.disableLocale", params);
676
+ },
677
+ async setCurrentLocale(params) {
678
+ await client.request("editorState.setCurrentLocale", params);
679
+ },
680
+ // Dynamic input operations
681
+ async setDynamicInputPreviewValue(params) {
682
+ await client.request("editorState.setDynamicInputPreviewValue", params);
580
683
  }
581
684
  };
582
685
  }
@@ -774,7 +877,8 @@ async function initializeUniformMeshSDK({
774
877
  sdk.events.emit("onValueChanged", { newValue: value });
775
878
  await parent.setValue({ uniformMeshLocationValue: value, closeDialog: true });
776
879
  }
777
- } : void 0
880
+ } : void 0,
881
+ editorState: parent.editorState
778
882
  };
779
883
  return location;
780
884
  },
package/dist/index.mjs CHANGED
@@ -131,7 +131,7 @@ var getLogger = (prefix, debug) => {
131
131
  };
132
132
 
133
133
  // src/temp/version.ts
134
- var UNIFORM_MESH_SDK_VERSION = "20.50.0";
134
+ var UNIFORM_MESH_SDK_VERSION = "20.50.1";
135
135
 
136
136
  // src/framepost/constants.ts
137
137
  var DEFAULT_REQUEST_TIMEOUT = 5e3;
@@ -535,7 +535,110 @@ async function connectToParent({
535
535
  )
536
536
  }
537
537
  );
538
+ },
539
+ editorState: createEditorStateApi(client)
540
+ }
541
+ };
542
+ }
543
+ function createEditorStateApi(client) {
544
+ let cachedRootNodeId;
545
+ return {
546
+ async getRootNodeId() {
547
+ if (cachedRootNodeId) {
548
+ return cachedRootNodeId;
538
549
  }
550
+ const result = await client.request("editorState.getRootNodeId");
551
+ cachedRootNodeId = result;
552
+ return result;
553
+ },
554
+ // Read operations
555
+ async exportTree(params) {
556
+ const result = await client.request("editorState.exportTree", params);
557
+ cachedRootNodeId != null ? cachedRootNodeId : cachedRootNodeId = result == null ? void 0 : result._id;
558
+ return result;
559
+ },
560
+ async exportSubtree(params) {
561
+ return await client.request("editorState.exportSubtree", params);
562
+ },
563
+ async exportMetadata() {
564
+ return await client.request("editorState.exportMetadata");
565
+ },
566
+ async exportRootNodeMetadata() {
567
+ return await client.request("editorState.exportRootNodeMetadata");
568
+ },
569
+ async getNodeById(params) {
570
+ return await client.request("editorState.getNodeById", params);
571
+ },
572
+ async getNodeChildren(params) {
573
+ return await client.request("editorState.getNodeChildren", params);
574
+ },
575
+ async getNodeProperty(params) {
576
+ return await client.request("editorState.getNodeProperty", params);
577
+ },
578
+ async getNodeProperties(params) {
579
+ return await client.request("editorState.getNodeProperties", params);
580
+ },
581
+ async getParentInfo(params) {
582
+ return await client.request("editorState.getParentInfo", params);
583
+ },
584
+ // Selection
585
+ async getSelectedNodeId() {
586
+ return await client.request("editorState.getSelectedNodeId");
587
+ },
588
+ async setSelectedNodeId(params) {
589
+ await client.request("editorState.setSelectedNodeId", params);
590
+ },
591
+ async getSelectedParameterId() {
592
+ return await client.request("editorState.getSelectedParameterId");
593
+ },
594
+ async setSelectedParameterId(params) {
595
+ await client.request("editorState.setSelectedParameterId", params);
596
+ },
597
+ async getPristine() {
598
+ return await client.request("editorState.getPristine");
599
+ },
600
+ // Write operations
601
+ async insertNode(params) {
602
+ return await client.request("editorState.insertNode", params);
603
+ },
604
+ async deleteNode(params) {
605
+ await client.request("editorState.deleteNode", params);
606
+ },
607
+ async moveNode(params) {
608
+ await client.request("editorState.moveNode", params);
609
+ },
610
+ async updateNodeProperty(params) {
611
+ await client.request("editorState.updateNodeProperty", params);
612
+ },
613
+ async updateRootMetadata(params) {
614
+ await client.request("editorState.updateRootMetadata", params);
615
+ },
616
+ async updateRootNode(params) {
617
+ await client.request("editorState.updateRootNode", params);
618
+ },
619
+ // Pattern operations
620
+ async insertPattern(params) {
621
+ return await client.request("editorState.insertPattern", params);
622
+ },
623
+ async isPatternPropertyOverridden(params) {
624
+ return await client.request("editorState.isPatternPropertyOverridden", params);
625
+ },
626
+ async resetPatternPropertyOverride(params) {
627
+ await client.request("editorState.resetPatternPropertyOverride", params);
628
+ },
629
+ // Locale operations
630
+ async enableLocale(params) {
631
+ await client.request("editorState.enableLocale", params);
632
+ },
633
+ async disableLocale(params) {
634
+ await client.request("editorState.disableLocale", params);
635
+ },
636
+ async setCurrentLocale(params) {
637
+ await client.request("editorState.setCurrentLocale", params);
638
+ },
639
+ // Dynamic input operations
640
+ async setDynamicInputPreviewValue(params) {
641
+ await client.request("editorState.setDynamicInputPreviewValue", params);
539
642
  }
540
643
  };
541
644
  }
@@ -733,7 +836,8 @@ async function initializeUniformMeshSDK({
733
836
  sdk.events.emit("onValueChanged", { newValue: value });
734
837
  await parent.setValue({ uniformMeshLocationValue: value, closeDialog: true });
735
838
  }
736
- } : void 0
839
+ } : void 0,
840
+ editorState: parent.editorState
737
841
  };
738
842
  return location;
739
843
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk",
3
- "version": "20.50.1-alpha.4+47395e9a74",
3
+ "version": "20.50.2-alpha.9+7e214410ae",
4
4
  "description": "Uniform Mesh Framework SDK",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -33,10 +33,10 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@uniformdev/assets": "20.50.1-alpha.4+47395e9a74",
37
- "@uniformdev/canvas": "20.50.1-alpha.4+47395e9a74",
38
- "@uniformdev/context": "20.50.1-alpha.4+47395e9a74",
39
- "@uniformdev/project-map": "20.50.1-alpha.4+47395e9a74",
36
+ "@uniformdev/assets": "20.50.2-alpha.9+7e214410ae",
37
+ "@uniformdev/canvas": "20.50.2-alpha.9+7e214410ae",
38
+ "@uniformdev/context": "20.50.2-alpha.9+7e214410ae",
39
+ "@uniformdev/project-map": "20.50.2-alpha.9+7e214410ae",
40
40
  "imagesloaded": "^5.0.0",
41
41
  "mitt": "^3.0.1"
42
42
  },
@@ -44,5 +44,5 @@
44
44
  "@types/imagesloaded": "^4.1.2",
45
45
  "openai": "4.94.0"
46
46
  },
47
- "gitHead": "47395e9a74fd4e2a7a5b4cc6488c7326ad906bf9"
47
+ "gitHead": "7e214410ae879d142d1bda328761a38b62179e08"
48
48
  }