@uniformdev/mesh-sdk 20.56.1-alpha.10 → 20.56.1-alpha.21
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 +286 -5
- package/dist/index.d.ts +286 -5
- package/dist/index.esm.js +105 -1
- package/dist/index.js +105 -1
- package/dist/index.mjs +105 -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, 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;
|
|
@@ -1568,6 +1614,35 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
|
|
|
1568
1614
|
}, TIntegrationConfiguration>;
|
|
1569
1615
|
type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
|
|
1570
1616
|
|
|
1617
|
+
/**
|
|
1618
|
+
* Metadata for the dataResourceSelector location.
|
|
1619
|
+
* This location type allows custom UI for selecting JSON pointers within a data resource,
|
|
1620
|
+
* replacing the default JSON tree viewer in the dynamic token picker.
|
|
1621
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1622
|
+
*/
|
|
1623
|
+
type DataResourceSelectorLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1624
|
+
/** The resolved data for the currently selected data resource */
|
|
1625
|
+
dataResourceValue: unknown;
|
|
1626
|
+
/** The name of the currently selected data resource */
|
|
1627
|
+
dataResourceName: string;
|
|
1628
|
+
/** The data type ID for the current data resource */
|
|
1629
|
+
dataTypeId: string;
|
|
1630
|
+
/** The data type's archetype value (useful for apps sharing a selector across archetypes) */
|
|
1631
|
+
archetype: string;
|
|
1632
|
+
/** Allowed bindable types for the parameter being connected */
|
|
1633
|
+
allowedTypes: BindableTypes[];
|
|
1634
|
+
}, TIntegrationConfiguration>;
|
|
1635
|
+
/**
|
|
1636
|
+
* Location for custom data resource selector UI.
|
|
1637
|
+
* Replaces the default JSON tree viewer when selecting dynamic tokens from a data resource.
|
|
1638
|
+
*
|
|
1639
|
+
* Value: The selected JSON pointer string (e.g., "/moves/0/move/name")
|
|
1640
|
+
* setValue: Call with a valid JSON pointer to select that path
|
|
1641
|
+
* getDataResource: Fetch data from the data connector using the current data source
|
|
1642
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1643
|
+
*/
|
|
1644
|
+
type DataResourceSelectorLocation = MeshLocationCore<string, DataResourceSelectorLocationMetadata, string, 'dataResourceSelector'> & GetDataResourceLocation;
|
|
1645
|
+
|
|
1571
1646
|
type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
|
|
1572
1647
|
type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1573
1648
|
/**
|
|
@@ -1579,6 +1654,7 @@ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMet
|
|
|
1579
1654
|
type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
|
|
1580
1655
|
|
|
1581
1656
|
type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1657
|
+
/** editorState is an experimental replacement for rootNode. This may become deprecated in the future. */
|
|
1582
1658
|
rootNode: Omit<RootComponentInstance, 'slots' | '_data'> & {
|
|
1583
1659
|
_editionId?: string;
|
|
1584
1660
|
};
|
|
@@ -1607,6 +1683,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
|
|
|
1607
1683
|
* Note that setValue() always sets the target language automatically.
|
|
1608
1684
|
*/
|
|
1609
1685
|
targetLocale: string | undefined;
|
|
1686
|
+
/**
|
|
1687
|
+
* The current locale selected in the editor UI.
|
|
1688
|
+
* Unlike targetLocale, this reflects the editor's global locale state.
|
|
1689
|
+
*/
|
|
1690
|
+
currentLocale: string | undefined;
|
|
1610
1691
|
/**
|
|
1611
1692
|
* When editing a conditional value, this is the index in the parent parameter of the conditional value.
|
|
1612
1693
|
* If this is -1, then the editor is not editing a conditional value.
|
|
@@ -1619,6 +1700,12 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
|
|
|
1619
1700
|
* Returns the result of the dialog. Useful to build data-enabled parameter types.
|
|
1620
1701
|
*/
|
|
1621
1702
|
editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
|
|
1703
|
+
/**
|
|
1704
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
1705
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
1706
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1707
|
+
*/
|
|
1708
|
+
editorState: EditorStateApi;
|
|
1622
1709
|
};
|
|
1623
1710
|
|
|
1624
1711
|
type SettingsLocationMetadata = CommonMetadata;
|
|
@@ -1628,7 +1715,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
|
|
|
1628
1715
|
* Defines methods used for interacting with a Mesh location
|
|
1629
1716
|
* To receive useful typings, check the `type` property of the location to narrow the typing.
|
|
1630
1717
|
*/
|
|
1631
|
-
type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | DashboardToolLocation<TValue> | ProjectToolLocation<TValue>;
|
|
1718
|
+
type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | DataResourceSelectorLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | DashboardToolLocation<TValue> | ProjectToolLocation<TValue>;
|
|
1632
1719
|
interface MeshContextData {
|
|
1633
1720
|
locationKey: string;
|
|
1634
1721
|
locationType: MeshLocationTypes;
|
|
@@ -1820,6 +1907,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
|
|
|
1820
1907
|
navigate: (message: NavigateMessage) => Promise<void>;
|
|
1821
1908
|
reloadLocation: () => Promise<void>;
|
|
1822
1909
|
editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
|
|
1910
|
+
editorState: EditorStateApi;
|
|
1823
1911
|
};
|
|
1824
1912
|
}>;
|
|
1825
1913
|
|
|
@@ -1986,7 +2074,7 @@ type MeshLocationUserPermissions =
|
|
|
1986
2074
|
/**
|
|
1987
2075
|
* Known location types that can be passed to a mesh location
|
|
1988
2076
|
*/
|
|
1989
|
-
type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
|
|
2077
|
+
type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'dataResourceSelector' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
|
|
1990
2078
|
type SetValueOptions = ValidationResult;
|
|
1991
2079
|
type SetValueMessage = {
|
|
1992
2080
|
uniformMeshLocationValue: unknown;
|
|
@@ -2011,6 +2099,183 @@ type DynamicInput = {
|
|
|
2011
2099
|
};
|
|
2012
2100
|
/** Record of dynamic inputs keyed by the input name */
|
|
2013
2101
|
type DynamicInputs = Record<string, DynamicInput>;
|
|
2102
|
+
/** Metadata about the composition (description, category, workflow, etc.) */
|
|
2103
|
+
type EditorRootMetadata = {
|
|
2104
|
+
description?: string;
|
|
2105
|
+
previewImageUrl?: string;
|
|
2106
|
+
categoryId?: string;
|
|
2107
|
+
workflowId?: string;
|
|
2108
|
+
workflowStageId?: string;
|
|
2109
|
+
editionName?: string;
|
|
2110
|
+
editionPriority?: number;
|
|
2111
|
+
};
|
|
2112
|
+
/** Root node metadata (name and slug) */
|
|
2113
|
+
type EditorRootNodeMetadata = {
|
|
2114
|
+
_name: string;
|
|
2115
|
+
_slug: string | null | undefined;
|
|
2116
|
+
};
|
|
2117
|
+
/** Options for exporting the tree */
|
|
2118
|
+
type EditorExportOptions = {
|
|
2119
|
+
/** If true, includes pattern descendant data in export */
|
|
2120
|
+
keepPatternData?: boolean;
|
|
2121
|
+
};
|
|
2122
|
+
/** A component instance without slots/params (indexed separately) */
|
|
2123
|
+
type EditorComponentInstance = Omit<ComponentInstance, 'slots' | 'parameters' | '_id'>;
|
|
2124
|
+
/** An indexed node within the editor state */
|
|
2125
|
+
type EditorNode = {
|
|
2126
|
+
nodeId: string;
|
|
2127
|
+
parentId?: string;
|
|
2128
|
+
isBlock?: boolean;
|
|
2129
|
+
value: EditorComponentInstance;
|
|
2130
|
+
/** If part of a pattern, the pattern ID */
|
|
2131
|
+
partOfPattern?: string;
|
|
2132
|
+
/** If part of a nested pattern */
|
|
2133
|
+
partOfNestedPattern?: string;
|
|
2134
|
+
/** UI expansion state */
|
|
2135
|
+
isExpandedInUI?: boolean;
|
|
2136
|
+
};
|
|
2137
|
+
/** Child node IDs indexed by slot name */
|
|
2138
|
+
type EditorNodeChildren = {
|
|
2139
|
+
[slotName: string]: string[];
|
|
2140
|
+
};
|
|
2141
|
+
/** A component parameter value */
|
|
2142
|
+
type EditorComponentParameter<T = unknown> = Omit<ComponentParameter<T>, 'connectedData'>;
|
|
2143
|
+
/** Parent info for a node */
|
|
2144
|
+
type EditorNodeParentInfo = {
|
|
2145
|
+
parentId: string;
|
|
2146
|
+
parentName: string;
|
|
2147
|
+
targetIndexInParent: number;
|
|
2148
|
+
value: EditorComponentInstance;
|
|
2149
|
+
parentChildIds: string[];
|
|
2150
|
+
parentType: 'slot' | 'block';
|
|
2151
|
+
};
|
|
2152
|
+
/** Options for updateNodeProperty */
|
|
2153
|
+
type UpdateNodePropertyOptions = {
|
|
2154
|
+
nodeId: string;
|
|
2155
|
+
property: string;
|
|
2156
|
+
/**
|
|
2157
|
+
* The new value to set. Pass the final value directly.
|
|
2158
|
+
* - `undefined` to soft-delete (remove current locale/condition value)
|
|
2159
|
+
* - `null` to hard-delete (remove entire parameter)
|
|
2160
|
+
* - any other value to set
|
|
2161
|
+
*
|
|
2162
|
+
* For read-modify-write, call getNodeProperty() first to get current value.
|
|
2163
|
+
*/
|
|
2164
|
+
value: unknown | undefined | null;
|
|
2165
|
+
/** Parameter type (required for new parameters) */
|
|
2166
|
+
type?: string;
|
|
2167
|
+
/** Target locale, or undefined for invariant value */
|
|
2168
|
+
locale: string | undefined;
|
|
2169
|
+
/** Condition index (-1 for base value, >= 0 for conditional) */
|
|
2170
|
+
conditionIndex: number;
|
|
2171
|
+
/** Condition definition (required when conditionIndex >= 0) */
|
|
2172
|
+
conditionDefinition?: VisibilityCriteriaGroup | null;
|
|
2173
|
+
};
|
|
2174
|
+
/** Options for insertNode */
|
|
2175
|
+
type InsertNodeOptions = {
|
|
2176
|
+
node: EditorComponentInstance;
|
|
2177
|
+
parentNodeId: string;
|
|
2178
|
+
parentSlot: string;
|
|
2179
|
+
targetIndexInSlot?: number;
|
|
2180
|
+
};
|
|
2181
|
+
/** Options for moveNode */
|
|
2182
|
+
type MoveNodeOptions = {
|
|
2183
|
+
movedNodeId: string;
|
|
2184
|
+
parentNodeId: string;
|
|
2185
|
+
parentSlot: string;
|
|
2186
|
+
targetIndexInSlot: number;
|
|
2187
|
+
};
|
|
2188
|
+
/** Options for insertPattern */
|
|
2189
|
+
type InsertPatternOptions = {
|
|
2190
|
+
pattern: RootComponentInstance;
|
|
2191
|
+
parentNodeId: string;
|
|
2192
|
+
parentSlot: string;
|
|
2193
|
+
targetIndexInSlot?: number;
|
|
2194
|
+
patternInstanceId?: string;
|
|
2195
|
+
};
|
|
2196
|
+
/** Options for updateRootNode */
|
|
2197
|
+
type UpdateRootNodeOptions = {
|
|
2198
|
+
update: Partial<EditorRootNodeMetadata>;
|
|
2199
|
+
};
|
|
2200
|
+
/**
|
|
2201
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2202
|
+
* Available on `canvasEditorTools` and `paramType` locations.
|
|
2203
|
+
*
|
|
2204
|
+
* All methods use object parameters for consistency across client, wire format, and server.
|
|
2205
|
+
*/
|
|
2206
|
+
interface EditorStateApi {
|
|
2207
|
+
getRootNodeId(): Promise<string>;
|
|
2208
|
+
exportTree(params?: EditorExportOptions): Promise<RootComponentInstance>;
|
|
2209
|
+
exportSubtree(params: {
|
|
2210
|
+
nodeId: string;
|
|
2211
|
+
options?: EditorExportOptions;
|
|
2212
|
+
}): Promise<ComponentInstance>;
|
|
2213
|
+
exportMetadata(): Promise<EditorRootMetadata>;
|
|
2214
|
+
exportRootNodeMetadata(): Promise<EditorRootNodeMetadata>;
|
|
2215
|
+
getNodeById(params: {
|
|
2216
|
+
nodeId: string;
|
|
2217
|
+
}): Promise<EditorNode | undefined>;
|
|
2218
|
+
getNodeChildren(params: {
|
|
2219
|
+
nodeId: string;
|
|
2220
|
+
}): Promise<EditorNodeChildren | undefined>;
|
|
2221
|
+
getNodeProperty<T = unknown>(params: {
|
|
2222
|
+
nodeId: string;
|
|
2223
|
+
property: string;
|
|
2224
|
+
}): Promise<EditorComponentParameter<T> | undefined>;
|
|
2225
|
+
getNodeProperties(params: {
|
|
2226
|
+
nodeId: string;
|
|
2227
|
+
}): Promise<Record<string, EditorComponentParameter>>;
|
|
2228
|
+
getParentInfo(params: {
|
|
2229
|
+
nodeId: string;
|
|
2230
|
+
}): Promise<EditorNodeParentInfo | undefined>;
|
|
2231
|
+
getSelectedNodeId(): Promise<string | undefined>;
|
|
2232
|
+
setSelectedNodeId(params: {
|
|
2233
|
+
nodeId: string | undefined;
|
|
2234
|
+
}): Promise<void>;
|
|
2235
|
+
getSelectedParameterId(): Promise<string | undefined>;
|
|
2236
|
+
setSelectedParameterId(params: {
|
|
2237
|
+
parameterId: string | undefined;
|
|
2238
|
+
}): Promise<void>;
|
|
2239
|
+
getPristine(): Promise<boolean>;
|
|
2240
|
+
insertNode(params: InsertNodeOptions): Promise<string>;
|
|
2241
|
+
deleteNode(params: {
|
|
2242
|
+
nodeId: string;
|
|
2243
|
+
}): Promise<void>;
|
|
2244
|
+
moveNode(params: MoveNodeOptions): Promise<void>;
|
|
2245
|
+
updateNodeProperty(params: UpdateNodePropertyOptions): Promise<void>;
|
|
2246
|
+
updateRootMetadata(params: {
|
|
2247
|
+
metadata: Partial<EditorRootMetadata>;
|
|
2248
|
+
}): Promise<void>;
|
|
2249
|
+
updateRootNode(params: UpdateRootNodeOptions): Promise<void>;
|
|
2250
|
+
insertPattern(params: InsertPatternOptions): Promise<string>;
|
|
2251
|
+
isPatternPropertyOverridden(params: {
|
|
2252
|
+
nodeId: string;
|
|
2253
|
+
property: string;
|
|
2254
|
+
locale?: string;
|
|
2255
|
+
}): Promise<boolean>;
|
|
2256
|
+
resetPatternPropertyOverride(params: {
|
|
2257
|
+
nodeId: string;
|
|
2258
|
+
property: string;
|
|
2259
|
+
locale: string | undefined;
|
|
2260
|
+
}): Promise<void>;
|
|
2261
|
+
enableLocale(params: {
|
|
2262
|
+
locale: string | string[];
|
|
2263
|
+
}): Promise<void>;
|
|
2264
|
+
disableLocale(params: {
|
|
2265
|
+
locale: string;
|
|
2266
|
+
}): Promise<void>;
|
|
2267
|
+
/** Sets the currently active locale in the editor UI */
|
|
2268
|
+
setCurrentLocale(params: {
|
|
2269
|
+
locale: string;
|
|
2270
|
+
}): Promise<void>;
|
|
2271
|
+
/**
|
|
2272
|
+
* Sets the current preview value for a dynamic input.
|
|
2273
|
+
*/
|
|
2274
|
+
setDynamicInputPreviewValue(params: {
|
|
2275
|
+
name: string;
|
|
2276
|
+
value: string;
|
|
2277
|
+
}): Promise<void>;
|
|
2278
|
+
}
|
|
2014
2279
|
|
|
2015
2280
|
type AIGenerateLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
2016
2281
|
prompt: string;
|
|
@@ -2037,6 +2302,13 @@ type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = Co
|
|
|
2037
2302
|
*/
|
|
2038
2303
|
activeReleaseId?: string;
|
|
2039
2304
|
state?: number;
|
|
2305
|
+
/** The current locale selected in the editor UI */
|
|
2306
|
+
currentLocale: string | undefined;
|
|
2307
|
+
/**
|
|
2308
|
+
* Current dynamic inputs configured on the composition (if any).
|
|
2309
|
+
* Dynamic inputs come from project map nodes and represent path or query based dynamic values.
|
|
2310
|
+
*/
|
|
2311
|
+
dynamicInputs: DynamicInputs;
|
|
2040
2312
|
}, TIntegrationConfiguration>;
|
|
2041
2313
|
type CanvasEditorToolsReferenceData = {
|
|
2042
2314
|
name: string;
|
|
@@ -2047,13 +2319,22 @@ type CanvasEditorToolsData = {
|
|
|
2047
2319
|
entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
|
|
2048
2320
|
entityType: CanvasEditorEntityType;
|
|
2049
2321
|
} & ({
|
|
2322
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2050
2323
|
rootEntity: RootComponentInstance;
|
|
2051
2324
|
entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
|
|
2052
2325
|
} | {
|
|
2326
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2053
2327
|
rootEntity: EntryData;
|
|
2054
2328
|
entityType: 'entry' | 'entryPattern';
|
|
2055
2329
|
});
|
|
2056
|
-
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation
|
|
2330
|
+
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation & {
|
|
2331
|
+
/**
|
|
2332
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2333
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
2334
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
2335
|
+
*/
|
|
2336
|
+
editorState: EditorStateApi;
|
|
2337
|
+
};
|
|
2057
2338
|
|
|
2058
2339
|
/**
|
|
2059
2340
|
* @deprecated Alpha version of the Embedded Editor location. This location is not yet available for use in the Mesh SDK.
|
|
@@ -2221,4 +2502,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
|
|
|
2221
2502
|
*/
|
|
2222
2503
|
declare const hasRole: (role: string, user: UniformUser) => boolean;
|
|
2223
2504
|
|
|
2224
|
-
export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type DashboardToolLocation, type DashboardToolLocationMetadata, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshRouter, type MeshSDKEventInterface, type NavigateMessage, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PersonalizationCriteriaLocation, type PersonalizationCriteriaLocationMetadata, type ProjectToolLocation, type ProjectToolLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
|
|
2505
|
+
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;
|
|
@@ -1568,6 +1614,35 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonM
|
|
|
1568
1614
|
}, TIntegrationConfiguration>;
|
|
1569
1615
|
type DataResourceLocation = MeshLocationCore<DataResourceVariables, DataResourceLocationMetadata, DataResourceVariables, 'dataResource'> & GetDataResourceLocation;
|
|
1570
1616
|
|
|
1617
|
+
/**
|
|
1618
|
+
* Metadata for the dataResourceSelector location.
|
|
1619
|
+
* This location type allows custom UI for selecting JSON pointers within a data resource,
|
|
1620
|
+
* replacing the default JSON tree viewer in the dynamic token picker.
|
|
1621
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1622
|
+
*/
|
|
1623
|
+
type DataResourceSelectorLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1624
|
+
/** The resolved data for the currently selected data resource */
|
|
1625
|
+
dataResourceValue: unknown;
|
|
1626
|
+
/** The name of the currently selected data resource */
|
|
1627
|
+
dataResourceName: string;
|
|
1628
|
+
/** The data type ID for the current data resource */
|
|
1629
|
+
dataTypeId: string;
|
|
1630
|
+
/** The data type's archetype value (useful for apps sharing a selector across archetypes) */
|
|
1631
|
+
archetype: string;
|
|
1632
|
+
/** Allowed bindable types for the parameter being connected */
|
|
1633
|
+
allowedTypes: BindableTypes[];
|
|
1634
|
+
}, TIntegrationConfiguration>;
|
|
1635
|
+
/**
|
|
1636
|
+
* Location for custom data resource selector UI.
|
|
1637
|
+
* Replaces the default JSON tree viewer when selecting dynamic tokens from a data resource.
|
|
1638
|
+
*
|
|
1639
|
+
* Value: The selected JSON pointer string (e.g., "/moves/0/move/name")
|
|
1640
|
+
* setValue: Call with a valid JSON pointer to select that path
|
|
1641
|
+
* getDataResource: Fetch data from the data connector using the current data source
|
|
1642
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1643
|
+
*/
|
|
1644
|
+
type DataResourceSelectorLocation = MeshLocationCore<string, DataResourceSelectorLocationMetadata, string, 'dataResourceSelector'> & GetDataResourceLocation;
|
|
1645
|
+
|
|
1571
1646
|
type DataSourceLocationValue = Pick<DataSource, 'baseUrl' | 'custom' | 'customPublic' | 'headers' | 'parameters' | 'variables' | 'enableUnpublishedMode' | 'variants'>;
|
|
1572
1647
|
type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1573
1648
|
/**
|
|
@@ -1579,6 +1654,7 @@ type DataSourceLocationMetadata<TIntegrationConfiguration = unknown> = CommonMet
|
|
|
1579
1654
|
type DataSourceLocation = MeshLocationCore<DataSourceLocationValue, DataSourceLocationMetadata, DataSourceLocationValue, 'dataSource'>;
|
|
1580
1655
|
|
|
1581
1656
|
type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
1657
|
+
/** editorState is an experimental replacement for rootNode. This may become deprecated in the future. */
|
|
1582
1658
|
rootNode: Omit<RootComponentInstance, 'slots' | '_data'> & {
|
|
1583
1659
|
_editionId?: string;
|
|
1584
1660
|
};
|
|
@@ -1607,6 +1683,11 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
|
|
|
1607
1683
|
* Note that setValue() always sets the target language automatically.
|
|
1608
1684
|
*/
|
|
1609
1685
|
targetLocale: string | undefined;
|
|
1686
|
+
/**
|
|
1687
|
+
* The current locale selected in the editor UI.
|
|
1688
|
+
* Unlike targetLocale, this reflects the editor's global locale state.
|
|
1689
|
+
*/
|
|
1690
|
+
currentLocale: string | undefined;
|
|
1610
1691
|
/**
|
|
1611
1692
|
* When editing a conditional value, this is the index in the parent parameter of the conditional value.
|
|
1612
1693
|
* If this is -1, then the editor is not editing a conditional value.
|
|
@@ -1619,6 +1700,12 @@ type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TPa
|
|
|
1619
1700
|
* Returns the result of the dialog. Useful to build data-enabled parameter types.
|
|
1620
1701
|
*/
|
|
1621
1702
|
editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
|
|
1703
|
+
/**
|
|
1704
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
1705
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
1706
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
1707
|
+
*/
|
|
1708
|
+
editorState: EditorStateApi;
|
|
1622
1709
|
};
|
|
1623
1710
|
|
|
1624
1711
|
type SettingsLocationMetadata = CommonMetadata;
|
|
@@ -1628,7 +1715,7 @@ type SettingsLocation<TSettingsType> = MeshLocationCore<TSettingsType, SettingsL
|
|
|
1628
1715
|
* Defines methods used for interacting with a Mesh location
|
|
1629
1716
|
* To receive useful typings, check the `type` property of the location to narrow the typing.
|
|
1630
1717
|
*/
|
|
1631
|
-
type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | DashboardToolLocation<TValue> | ProjectToolLocation<TValue>;
|
|
1718
|
+
type MeshLocation<TValue = unknown, TSetValue = TValue> = ParamTypeLocation<TValue, unknown, TSetValue> | ParamTypeConfigLocation<TValue> | SettingsLocation<TValue> | AssetLibraryLocation | AssetParameterLocation | DataSourceLocation | DataTypeLocation | DataResourceLocation | DataResourceSelectorLocation | CanvasEditorToolsLocation | EmbeddedEditorLocation | AIGenerateLocation<TValue> | AIPromptMetadataLocation | PersonalizationCriteriaLocation<TValue> | DashboardToolLocation<TValue> | ProjectToolLocation<TValue>;
|
|
1632
1719
|
interface MeshContextData {
|
|
1633
1720
|
locationKey: string;
|
|
1634
1721
|
locationType: MeshLocationTypes;
|
|
@@ -1820,6 +1907,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, on
|
|
|
1820
1907
|
navigate: (message: NavigateMessage) => Promise<void>;
|
|
1821
1908
|
reloadLocation: () => Promise<void>;
|
|
1822
1909
|
editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
|
|
1910
|
+
editorState: EditorStateApi;
|
|
1823
1911
|
};
|
|
1824
1912
|
}>;
|
|
1825
1913
|
|
|
@@ -1986,7 +2074,7 @@ type MeshLocationUserPermissions =
|
|
|
1986
2074
|
/**
|
|
1987
2075
|
* Known location types that can be passed to a mesh location
|
|
1988
2076
|
*/
|
|
1989
|
-
type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
|
|
2077
|
+
type MeshLocationTypes = 'paramType' | 'paramTypeConfig' | 'assetLibrary' | 'assetParameter' | 'settings' | 'dataSource' | 'dataType' | 'dataResource' | 'dataResourceSelector' | 'aiGenerate' | 'embeddedEditor' | 'canvasEditorTools' | 'aiMetadata' | 'personalizationCriteria' | 'dashboardTool' | 'projectTool';
|
|
1990
2078
|
type SetValueOptions = ValidationResult;
|
|
1991
2079
|
type SetValueMessage = {
|
|
1992
2080
|
uniformMeshLocationValue: unknown;
|
|
@@ -2011,6 +2099,183 @@ type DynamicInput = {
|
|
|
2011
2099
|
};
|
|
2012
2100
|
/** Record of dynamic inputs keyed by the input name */
|
|
2013
2101
|
type DynamicInputs = Record<string, DynamicInput>;
|
|
2102
|
+
/** Metadata about the composition (description, category, workflow, etc.) */
|
|
2103
|
+
type EditorRootMetadata = {
|
|
2104
|
+
description?: string;
|
|
2105
|
+
previewImageUrl?: string;
|
|
2106
|
+
categoryId?: string;
|
|
2107
|
+
workflowId?: string;
|
|
2108
|
+
workflowStageId?: string;
|
|
2109
|
+
editionName?: string;
|
|
2110
|
+
editionPriority?: number;
|
|
2111
|
+
};
|
|
2112
|
+
/** Root node metadata (name and slug) */
|
|
2113
|
+
type EditorRootNodeMetadata = {
|
|
2114
|
+
_name: string;
|
|
2115
|
+
_slug: string | null | undefined;
|
|
2116
|
+
};
|
|
2117
|
+
/** Options for exporting the tree */
|
|
2118
|
+
type EditorExportOptions = {
|
|
2119
|
+
/** If true, includes pattern descendant data in export */
|
|
2120
|
+
keepPatternData?: boolean;
|
|
2121
|
+
};
|
|
2122
|
+
/** A component instance without slots/params (indexed separately) */
|
|
2123
|
+
type EditorComponentInstance = Omit<ComponentInstance, 'slots' | 'parameters' | '_id'>;
|
|
2124
|
+
/** An indexed node within the editor state */
|
|
2125
|
+
type EditorNode = {
|
|
2126
|
+
nodeId: string;
|
|
2127
|
+
parentId?: string;
|
|
2128
|
+
isBlock?: boolean;
|
|
2129
|
+
value: EditorComponentInstance;
|
|
2130
|
+
/** If part of a pattern, the pattern ID */
|
|
2131
|
+
partOfPattern?: string;
|
|
2132
|
+
/** If part of a nested pattern */
|
|
2133
|
+
partOfNestedPattern?: string;
|
|
2134
|
+
/** UI expansion state */
|
|
2135
|
+
isExpandedInUI?: boolean;
|
|
2136
|
+
};
|
|
2137
|
+
/** Child node IDs indexed by slot name */
|
|
2138
|
+
type EditorNodeChildren = {
|
|
2139
|
+
[slotName: string]: string[];
|
|
2140
|
+
};
|
|
2141
|
+
/** A component parameter value */
|
|
2142
|
+
type EditorComponentParameter<T = unknown> = Omit<ComponentParameter<T>, 'connectedData'>;
|
|
2143
|
+
/** Parent info for a node */
|
|
2144
|
+
type EditorNodeParentInfo = {
|
|
2145
|
+
parentId: string;
|
|
2146
|
+
parentName: string;
|
|
2147
|
+
targetIndexInParent: number;
|
|
2148
|
+
value: EditorComponentInstance;
|
|
2149
|
+
parentChildIds: string[];
|
|
2150
|
+
parentType: 'slot' | 'block';
|
|
2151
|
+
};
|
|
2152
|
+
/** Options for updateNodeProperty */
|
|
2153
|
+
type UpdateNodePropertyOptions = {
|
|
2154
|
+
nodeId: string;
|
|
2155
|
+
property: string;
|
|
2156
|
+
/**
|
|
2157
|
+
* The new value to set. Pass the final value directly.
|
|
2158
|
+
* - `undefined` to soft-delete (remove current locale/condition value)
|
|
2159
|
+
* - `null` to hard-delete (remove entire parameter)
|
|
2160
|
+
* - any other value to set
|
|
2161
|
+
*
|
|
2162
|
+
* For read-modify-write, call getNodeProperty() first to get current value.
|
|
2163
|
+
*/
|
|
2164
|
+
value: unknown | undefined | null;
|
|
2165
|
+
/** Parameter type (required for new parameters) */
|
|
2166
|
+
type?: string;
|
|
2167
|
+
/** Target locale, or undefined for invariant value */
|
|
2168
|
+
locale: string | undefined;
|
|
2169
|
+
/** Condition index (-1 for base value, >= 0 for conditional) */
|
|
2170
|
+
conditionIndex: number;
|
|
2171
|
+
/** Condition definition (required when conditionIndex >= 0) */
|
|
2172
|
+
conditionDefinition?: VisibilityCriteriaGroup | null;
|
|
2173
|
+
};
|
|
2174
|
+
/** Options for insertNode */
|
|
2175
|
+
type InsertNodeOptions = {
|
|
2176
|
+
node: EditorComponentInstance;
|
|
2177
|
+
parentNodeId: string;
|
|
2178
|
+
parentSlot: string;
|
|
2179
|
+
targetIndexInSlot?: number;
|
|
2180
|
+
};
|
|
2181
|
+
/** Options for moveNode */
|
|
2182
|
+
type MoveNodeOptions = {
|
|
2183
|
+
movedNodeId: string;
|
|
2184
|
+
parentNodeId: string;
|
|
2185
|
+
parentSlot: string;
|
|
2186
|
+
targetIndexInSlot: number;
|
|
2187
|
+
};
|
|
2188
|
+
/** Options for insertPattern */
|
|
2189
|
+
type InsertPatternOptions = {
|
|
2190
|
+
pattern: RootComponentInstance;
|
|
2191
|
+
parentNodeId: string;
|
|
2192
|
+
parentSlot: string;
|
|
2193
|
+
targetIndexInSlot?: number;
|
|
2194
|
+
patternInstanceId?: string;
|
|
2195
|
+
};
|
|
2196
|
+
/** Options for updateRootNode */
|
|
2197
|
+
type UpdateRootNodeOptions = {
|
|
2198
|
+
update: Partial<EditorRootNodeMetadata>;
|
|
2199
|
+
};
|
|
2200
|
+
/**
|
|
2201
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2202
|
+
* Available on `canvasEditorTools` and `paramType` locations.
|
|
2203
|
+
*
|
|
2204
|
+
* All methods use object parameters for consistency across client, wire format, and server.
|
|
2205
|
+
*/
|
|
2206
|
+
interface EditorStateApi {
|
|
2207
|
+
getRootNodeId(): Promise<string>;
|
|
2208
|
+
exportTree(params?: EditorExportOptions): Promise<RootComponentInstance>;
|
|
2209
|
+
exportSubtree(params: {
|
|
2210
|
+
nodeId: string;
|
|
2211
|
+
options?: EditorExportOptions;
|
|
2212
|
+
}): Promise<ComponentInstance>;
|
|
2213
|
+
exportMetadata(): Promise<EditorRootMetadata>;
|
|
2214
|
+
exportRootNodeMetadata(): Promise<EditorRootNodeMetadata>;
|
|
2215
|
+
getNodeById(params: {
|
|
2216
|
+
nodeId: string;
|
|
2217
|
+
}): Promise<EditorNode | undefined>;
|
|
2218
|
+
getNodeChildren(params: {
|
|
2219
|
+
nodeId: string;
|
|
2220
|
+
}): Promise<EditorNodeChildren | undefined>;
|
|
2221
|
+
getNodeProperty<T = unknown>(params: {
|
|
2222
|
+
nodeId: string;
|
|
2223
|
+
property: string;
|
|
2224
|
+
}): Promise<EditorComponentParameter<T> | undefined>;
|
|
2225
|
+
getNodeProperties(params: {
|
|
2226
|
+
nodeId: string;
|
|
2227
|
+
}): Promise<Record<string, EditorComponentParameter>>;
|
|
2228
|
+
getParentInfo(params: {
|
|
2229
|
+
nodeId: string;
|
|
2230
|
+
}): Promise<EditorNodeParentInfo | undefined>;
|
|
2231
|
+
getSelectedNodeId(): Promise<string | undefined>;
|
|
2232
|
+
setSelectedNodeId(params: {
|
|
2233
|
+
nodeId: string | undefined;
|
|
2234
|
+
}): Promise<void>;
|
|
2235
|
+
getSelectedParameterId(): Promise<string | undefined>;
|
|
2236
|
+
setSelectedParameterId(params: {
|
|
2237
|
+
parameterId: string | undefined;
|
|
2238
|
+
}): Promise<void>;
|
|
2239
|
+
getPristine(): Promise<boolean>;
|
|
2240
|
+
insertNode(params: InsertNodeOptions): Promise<string>;
|
|
2241
|
+
deleteNode(params: {
|
|
2242
|
+
nodeId: string;
|
|
2243
|
+
}): Promise<void>;
|
|
2244
|
+
moveNode(params: MoveNodeOptions): Promise<void>;
|
|
2245
|
+
updateNodeProperty(params: UpdateNodePropertyOptions): Promise<void>;
|
|
2246
|
+
updateRootMetadata(params: {
|
|
2247
|
+
metadata: Partial<EditorRootMetadata>;
|
|
2248
|
+
}): Promise<void>;
|
|
2249
|
+
updateRootNode(params: UpdateRootNodeOptions): Promise<void>;
|
|
2250
|
+
insertPattern(params: InsertPatternOptions): Promise<string>;
|
|
2251
|
+
isPatternPropertyOverridden(params: {
|
|
2252
|
+
nodeId: string;
|
|
2253
|
+
property: string;
|
|
2254
|
+
locale?: string;
|
|
2255
|
+
}): Promise<boolean>;
|
|
2256
|
+
resetPatternPropertyOverride(params: {
|
|
2257
|
+
nodeId: string;
|
|
2258
|
+
property: string;
|
|
2259
|
+
locale: string | undefined;
|
|
2260
|
+
}): Promise<void>;
|
|
2261
|
+
enableLocale(params: {
|
|
2262
|
+
locale: string | string[];
|
|
2263
|
+
}): Promise<void>;
|
|
2264
|
+
disableLocale(params: {
|
|
2265
|
+
locale: string;
|
|
2266
|
+
}): Promise<void>;
|
|
2267
|
+
/** Sets the currently active locale in the editor UI */
|
|
2268
|
+
setCurrentLocale(params: {
|
|
2269
|
+
locale: string;
|
|
2270
|
+
}): Promise<void>;
|
|
2271
|
+
/**
|
|
2272
|
+
* Sets the current preview value for a dynamic input.
|
|
2273
|
+
*/
|
|
2274
|
+
setDynamicInputPreviewValue(params: {
|
|
2275
|
+
name: string;
|
|
2276
|
+
value: string;
|
|
2277
|
+
}): Promise<void>;
|
|
2278
|
+
}
|
|
2014
2279
|
|
|
2015
2280
|
type AIGenerateLocationMetadata<TIntegrationConfiguration = unknown> = CommonMetadata<{
|
|
2016
2281
|
prompt: string;
|
|
@@ -2037,6 +2302,13 @@ type CanvasEditorToolsLocationMetadata<TIntegrationConfiguration = unknown> = Co
|
|
|
2037
2302
|
*/
|
|
2038
2303
|
activeReleaseId?: string;
|
|
2039
2304
|
state?: number;
|
|
2305
|
+
/** The current locale selected in the editor UI */
|
|
2306
|
+
currentLocale: string | undefined;
|
|
2307
|
+
/**
|
|
2308
|
+
* Current dynamic inputs configured on the composition (if any).
|
|
2309
|
+
* Dynamic inputs come from project map nodes and represent path or query based dynamic values.
|
|
2310
|
+
*/
|
|
2311
|
+
dynamicInputs: DynamicInputs;
|
|
2040
2312
|
}, TIntegrationConfiguration>;
|
|
2041
2313
|
type CanvasEditorToolsReferenceData = {
|
|
2042
2314
|
name: string;
|
|
@@ -2047,13 +2319,22 @@ type CanvasEditorToolsData = {
|
|
|
2047
2319
|
entryNamesIndex?: Record<string, CanvasEditorToolsReferenceData>;
|
|
2048
2320
|
entityType: CanvasEditorEntityType;
|
|
2049
2321
|
} & ({
|
|
2322
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2050
2323
|
rootEntity: RootComponentInstance;
|
|
2051
2324
|
entityType: 'composition' | 'componentPattern' | 'compositionDefaults';
|
|
2052
2325
|
} | {
|
|
2326
|
+
/** editorState is an experimental replacement for rootEntity. This may become deprecated in the future. */
|
|
2053
2327
|
rootEntity: EntryData;
|
|
2054
2328
|
entityType: 'entry' | 'entryPattern';
|
|
2055
2329
|
});
|
|
2056
|
-
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation
|
|
2330
|
+
type CanvasEditorToolsLocation = MeshLocationCore<CanvasEditorToolsData, CanvasEditorToolsLocationMetadata, CanvasEditorToolsData, 'canvasEditorTools'> & GetDataResourceLocation & {
|
|
2331
|
+
/**
|
|
2332
|
+
* Imperative API for interacting with the composition/entry editor state.
|
|
2333
|
+
* Provides non-reactive access to read and modify the editor state.
|
|
2334
|
+
* @deprecated This is experimental functionality and is subject to change without notice.
|
|
2335
|
+
*/
|
|
2336
|
+
editorState: EditorStateApi;
|
|
2337
|
+
};
|
|
2057
2338
|
|
|
2058
2339
|
/**
|
|
2059
2340
|
* @deprecated Alpha version of the Embedded Editor location. This location is not yet available for use in the Mesh SDK.
|
|
@@ -2221,4 +2502,4 @@ declare const hasPermissions: (permissions: MeshLocationUserPermissions | MeshLo
|
|
|
2221
2502
|
*/
|
|
2222
2503
|
declare const hasRole: (role: string, user: UniformUser) => boolean;
|
|
2223
2504
|
|
|
2224
|
-
export { type AIGenerateLocation, type AIGenerateLocationMetadata, type AIPromptMetadataLocation, type AssetLibraryLocation, type AssetLibraryLocationMetadata, type AssetParameterLocation, type AssetParameterLocationMetadata, type BindableTypes, type CSSHeight, type CanvasEditorEntityType, type CanvasEditorToolsData, type CanvasEditorToolsLocation, type CanvasEditorToolsLocationMetadata, type CloseDialogMessage, type CloseLocationDialogOptions, type CommonMetadata, type DashboardToolLocation, type DashboardToolLocationMetadata, type DataConnectorInfo, type DataResourceLocation, type DataResourceLocationMetadata, type DataSourceLocation, type DataSourceLocationMetadata, type DataSourceLocationValue, type DataTypeLocation, type DataTypeLocationMetadata, type DataTypeLocationValue, type DialogContext, type DialogOptions, type DialogParamValue, type DialogParams, type DialogResponseData, type DialogResponseHandler, type DialogResponseHandlers, type DialogType, type DynamicInput, type DynamicInputs, type EditConnectedDataMessage, type EditConnectedDataResponse, type EditConnectedDataResponseCancellationContext, type EmbeddedEditorLocation, type EmbeddedEditorLocationMetadata, type EmbeddedEditorLocationSetValue, type EmbeddedEditorLocationValue, type FunctionCallResponse, type FunctionCallSystemParameter, type GetDataResourceLocation, type GetDataResourceMessage, IntegrationDefinitionClient, type IntegrationDefinitionDeleteParameters, type IntegrationDefinitionGetParameters, type IntegrationDefinitionGetResponse, type IntegrationDefinitionPutParameters, type IntegrationDefinitionPutResponse, IntegrationInstallationClient, type IntegrationInstallationDeleteParameters, type IntegrationInstallationGetParameters, type IntegrationInstallationGetResponse, type IntegrationInstallationPutParameters, type LocationDialogResponse, type MeshContextData, type MeshLocation, type MeshLocationCore, type MeshLocationTypes, type MeshLocationUserPermissions, type MeshRouter, type MeshSDKEventInterface, type NavigateMessage, type OpenConfirmationDialogOptions, type OpenConfirmationDialogResult, type OpenDialogMessage, type OpenDialogResult, type OpenLocationDialogOptions, type ParamTypeConfigLocation, type ParamTypeConfigLocationMetadata, type ParamTypeLocation, type ParamTypeLocationMetadata, type PersonalizationCriteriaLocation, type PersonalizationCriteriaLocationMetadata, type ProjectToolLocation, type ProjectToolLocationMetadata, type PromptSettingsLocationMetadata, type SdkWindow, type SetLocationFunction, type SetValueMessage, type SetValueOptions, type SettingsLocation, type SettingsLocationMetadata, type UniformMeshSDK, type UniformMeshSDKEvents, type UniformUser, type ValidationResult, functionCallSystemParameters, hasPermissions, hasRole, initializeUniformMeshSDK, parseFunctionCall };
|
|
2505
|
+
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
|
@@ -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
|
@@ -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
|
@@ -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.56.1-alpha.
|
|
3
|
+
"version": "20.56.1-alpha.21+28f83064e9",
|
|
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.56.1-alpha.
|
|
37
|
-
"@uniformdev/canvas": "20.56.1-alpha.
|
|
38
|
-
"@uniformdev/context": "20.56.1-alpha.
|
|
39
|
-
"@uniformdev/project-map": "20.56.1-alpha.
|
|
36
|
+
"@uniformdev/assets": "20.56.1-alpha.21+28f83064e9",
|
|
37
|
+
"@uniformdev/canvas": "20.56.1-alpha.21+28f83064e9",
|
|
38
|
+
"@uniformdev/context": "20.56.1-alpha.21+28f83064e9",
|
|
39
|
+
"@uniformdev/project-map": "20.56.1-alpha.21+28f83064e9",
|
|
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": "
|
|
47
|
+
"gitHead": "28f83064e9573adbe807d4ec989ee57a2b311fa8"
|
|
48
48
|
}
|