@uniformdev/canvas 19.35.1-alpha.8 → 19.35.2

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.ts CHANGED
@@ -8263,6 +8263,35 @@ declare const createUniformApiEnhancer: ({ apiUrl }: {
8263
8263
  } | undefined;
8264
8264
  }>;
8265
8265
 
8266
+ declare const ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
8267
+ declare const ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
8268
+ declare const ATTRIBUTE_PARAMETER_VALUE = "data-uniform-parameter-value";
8269
+ declare const ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
8270
+ declare const ATTRIBUTE_PLACEHOLDER = "data-uniform-placeholder";
8271
+ declare const ATTRIBUTE_MULTILINE = "data-uniform-is-multiline";
8272
+ type GetParameterAttributesProps = {
8273
+ /** The public Id of the parameter */
8274
+ id: string;
8275
+ /** The component object where this parameter is used */
8276
+ component: ComponentInstance;
8277
+ /**
8278
+ * Sets the value to show in Canvas editor when the parameter value is empty.
8279
+ * @default undefined
8280
+ */
8281
+ placeholder?: string;
8282
+ /**
8283
+ * When set to true, it adds `whiteSpace: 'pre-wrap'` to the styles of the root element to allow the rendering of line breaks.
8284
+ * @default false
8285
+ */
8286
+ isMultiline?: boolean;
8287
+ };
8288
+ /**
8289
+ * Returns the attributes needed to annotate a Uniform parameter for inline editing.
8290
+ * Supports only text parameters at the moment.
8291
+ * @deprecated Unstable, and not ready for production usage.
8292
+ **/
8293
+ declare const getParameterAttributes: ({ id, component, placeholder, isMultiline, }: GetParameterAttributesProps) => Record<string, string | boolean | undefined>;
8294
+
8266
8295
  declare const generateHash: ({ composition, secret, }: {
8267
8296
  composition: RootComponentInstance;
8268
8297
  secret: string | undefined;
@@ -8285,4 +8314,4 @@ declare function mapSlotToTestVariations(slot: ComponentInstance[] | undefined):
8285
8314
 
8286
8315
  declare const CanvasClientError: typeof ApiClientError;
8287
8316
 
8288
- export { AddComponentMessage, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, CANVAS_DRAFT_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionUIStatus, ContextualEditingComponentReference, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS, EDGE_MAX_CACHE_TTL, EDGE_MAX_L2_CACHE_TTL_IN_HOURS, EDGE_MIN_CACHE_TTL, EDGE_MIN_L2_CACHE_TTL_IN_HOURS, EMPTY_COMPOSITION, EnhancerBuilder, EnhancerContext, EnhancerError, EventNames, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, InvalidationResult, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NonProjectMapLinkParamValue, OverrideOptions, PLACEHOLDER_ID, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TriggerCompositionActionMessage, UncachedCanvasClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, bindVariables, bindVariablesToObject, compose, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, enhance, extractLocales, generateHash, getChannelName, getComponentJsonPointer, getComponentPath, isAddComponentMessage, isDismissPlaceholderMessage, isMovingComponentMessage, isReadyMessage, isReportRenderedCompositionsMessage, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree };
8317
+ export { ATTRIBUTE_COMPONENT_ID, ATTRIBUTE_MULTILINE, ATTRIBUTE_PARAMETER_ID, ATTRIBUTE_PARAMETER_TYPE, ATTRIBUTE_PARAMETER_VALUE, ATTRIBUTE_PLACEHOLDER, AddComponentMessage, BatchEnhancer, BatchEntry, BatchInvalidationPayload, BindVariablesOptions, BindVariablesResult, BindVariablesToObjectOptions, CANVAS_DRAFT_STATE, CANVAS_ENRICHMENT_TAG_PARAM, CANVAS_INTENT_TAG_PARAM, CANVAS_LOCALE_TAG_PARAM, CANVAS_LOCALIZATION_SLOT, CANVAS_LOCALIZATION_TYPE, CANVAS_PERSONALIZATION_PARAM, CANVAS_PERSONALIZE_SLOT, CANVAS_PERSONALIZE_TYPE, CANVAS_PUBLISHED_STATE, CANVAS_TEST_SLOT, CANVAS_TEST_TYPE, CANVAS_TEST_VARIANT_PARAM, CanvasClient, CanvasClientError, CanvasDefinitions, Channel, ChannelMessage, ChannelSubscription, ChildEnhancerBuilder, ComponentDefinition, ComponentDefinitionDeleteParameters, ComponentDefinitionGetParameters, ComponentDefinitionGetResponse, ComponentDefinitionParameter, ComponentDefinitionPermission, ComponentDefinitionPutParameters, ComponentDefinitionSlot, ComponentDefinitionSlugSettings, ComponentDefinitionVariant, ComponentEnhancer, ComponentEnhancerFunction, ComponentEnhancerOptions, ComponentInstance, ComponentInstanceHistoryEntry, ComponentInstanceHistoryGetParameters, ComponentInstanceHistoryGetResponse, ComponentLocationReference, ComponentOverridability, ComponentOverride, ComponentOverrides, ComponentParameter, ComponentParameterContextualEditing, ComponentParameterEnhancer, ComponentParameterEnhancerFunction, ComponentParameterEnhancerOptions, CompositionDataDiagnostic, CompositionDeleteParameters, CompositionDiagnostics, CompositionGetByIdParameters, CompositionGetByNodeIdParameters, CompositionGetByNodePathParameters, CompositionGetBySlugParameters, CompositionGetListResponse, CompositionGetOrderBy, CompositionGetParameters, CompositionGetResponse, CompositionGetValidResponses, CompositionIssue, CompositionPatternIssue, CompositionPutParameters, CompositionRelationshipsClientOptions, CompositionRelationshipsDDefinitionGetResponse, CompositionRelationshipsDefinitionApi, CompositionRelationshipsDefinitionGetParameters, CompositionResolvedGetResponse, CompositionUIStatus, ContextualEditingComponentReference, DataElementBindingIssue, DataElementConnectionDefinition, DataResolutionConfigIssue, DataResolutionOption, DataResolutionOptionNegative, DataResolutionOptionPositive, DataResolutionParameters, DataResourceDefinition, DataResourceDefinitions, DataResourceIssue, DataResourceVariables, DataSource, DataSourceClient, DataSourceDeleteParameters, DataSourceGetParameters, DataSourceGetResponse, DataSourcePutParameters, DataSourcesGetParameters, DataSourcesGetResponse, DataType, DataTypeClient, DataTypeDeleteParameters, DataTypeGetParameters, DataTypeGetResponse, DataTypePutParameters, DataVariableDefinition, DismissPlaceholderMessage, DynamicInputIssue, EDGE_CACHE_DISABLED, EDGE_DEFAULT_CACHE_TTL, EDGE_DEFAULT_L2_CACHE_TTL_IN_HOURS, EDGE_MAX_CACHE_TTL, EDGE_MAX_L2_CACHE_TTL_IN_HOURS, EDGE_MIN_CACHE_TTL, EDGE_MIN_L2_CACHE_TTL_IN_HOURS, EMPTY_COMPOSITION, EnhancerBuilder, EnhancerContext, EnhancerError, EventNames, GetParameterAttributesProps, IN_CONTEXT_EDITOR_COMPONENT_END_ROLE, IN_CONTEXT_EDITOR_COMPONENT_START_ROLE, IN_CONTEXT_EDITOR_EMBED_SCRIPT_ID, IN_CONTEXT_EDITOR_QUERY_STRING_PARAM, IS_RENDERED_BY_UNIFORM_ATTRIBUTE, InvalidationPayload, InvalidationResult, LimitPolicy, LinkComponentParameterValue, LinkParamConfiguration, LinkParamValue, LinkParameterType, LinkTypeConfiguration, MessageHandler, MoveComponentMessage, NonProjectMapLinkParamValue, OverrideOptions, PLACEHOLDER_ID, PreviewEventBus, PreviewPanelSettings, ProjectMapLinkComponentParameterValue, ProjectMapLinkParamValue, ReadyMessage, ReportRenderedCompositionsMessage, ResolvedRouteGetResponse, RichTextBuiltInElement, RichTextBuiltInFormat, RichTextParamConfiguration, RichTextParamValue, RootComponentInstance, RouteClient, RouteDynamicInputs, RouteGetParameters, RouteGetResponse, RouteGetResponseComposition, RouteGetResponseEdgehancedComposition, RouteGetResponseNotFound, RouteGetResponseRedirect, SelectComponentMessage, SelectParameterMessage, SpecificProjectMap, SubscribeToCompositionOptions, TriggerCompositionActionMessage, UncachedCanvasClient, UniqueBatchEntries, UnsubscribeCallback, UpdateComponentParameterMessage, UpdateCompositionInternalMessage, UpdateCompositionMessage, UpdateContextualEditingStateInternalMessage, UpdatePreviewSettingsMessage, UsageTrackingApi, UsageTrackingGetParameters, UsageTrackingGetResponse, UsageTrackingPostParameters, UsageTrackingPostResponse, WalkComponentTreeActions, bindVariables, bindVariablesToObject, compose, createBatchEnhancer, createCanvasChannel, createEventBus, createLimitPolicy, createUniformApiEnhancer, enhance, extractLocales, generateHash, getChannelName, getComponentJsonPointer, getComponentPath, getParameterAttributes, isAddComponentMessage, isDismissPlaceholderMessage, isMovingComponentMessage, isReadyMessage, isReportRenderedCompositionsMessage, isSelectComponentMessage, isSelectParameterMessage, isSystemComponentDefinition, isTriggerCompositionActionMessage, isUpdateComponentParameterMessage, isUpdateCompositionInternalMessage, isUpdateCompositionMessage, isUpdateContextualEditingStateInternalMessage, isUpdatePreviewSettingsMessage, localize, mapSlotToPersonalizedVariations, mapSlotToTestVariations, nullLimitPolicy, subscribeToComposition, unstable_CompositionRelationshipClient, walkComponentTree };
package/dist/index.esm.js CHANGED
@@ -1695,6 +1695,36 @@ var createUniformApiEnhancer = ({ apiUrl }) => {
1695
1695
  };
1696
1696
  };
1697
1697
 
1698
+ // src/utils/getParameterAttributes.ts
1699
+ var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
1700
+ var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
1701
+ var ATTRIBUTE_PARAMETER_VALUE = "data-uniform-parameter-value";
1702
+ var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
1703
+ var ATTRIBUTE_PLACEHOLDER = "data-uniform-placeholder";
1704
+ var ATTRIBUTE_MULTILINE = "data-uniform-is-multiline";
1705
+ var getParameterAttributes = ({
1706
+ id,
1707
+ component,
1708
+ placeholder,
1709
+ isMultiline = false
1710
+ }) => {
1711
+ var _a, _b, _c;
1712
+ const componentId = component == null ? void 0 : component._id;
1713
+ const parameter = (_a = component == null ? void 0 : component.parameters) == null ? void 0 : _a[id];
1714
+ const value = parameter == null ? void 0 : parameter.value;
1715
+ const type = parameter == null ? void 0 : parameter.type;
1716
+ const isEditable = (_c = (_b = parameter == null ? void 0 : parameter._contextualEditing) == null ? void 0 : _b.isEditable) != null ? _c : false;
1717
+ return {
1718
+ [ATTRIBUTE_COMPONENT_ID]: componentId,
1719
+ [ATTRIBUTE_PARAMETER_ID]: id,
1720
+ [ATTRIBUTE_PARAMETER_VALUE]: String(value != null ? value : ""),
1721
+ [ATTRIBUTE_PARAMETER_TYPE]: type,
1722
+ [ATTRIBUTE_PLACEHOLDER]: placeholder,
1723
+ [ATTRIBUTE_MULTILINE]: isMultiline,
1724
+ contentEditable: isEditable
1725
+ };
1726
+ };
1727
+
1698
1728
  // src/utils/isSystemComponentDefinition.ts
1699
1729
  var isSystemComponentDefinition = (componentType) => {
1700
1730
  return componentType.startsWith("$");
@@ -1736,6 +1766,12 @@ function mapSlotToTestVariations(slot) {
1736
1766
  import { ApiClientError } from "@uniformdev/context/api";
1737
1767
  var CanvasClientError = ApiClientError;
1738
1768
  export {
1769
+ ATTRIBUTE_COMPONENT_ID,
1770
+ ATTRIBUTE_MULTILINE,
1771
+ ATTRIBUTE_PARAMETER_ID,
1772
+ ATTRIBUTE_PARAMETER_TYPE,
1773
+ ATTRIBUTE_PARAMETER_VALUE,
1774
+ ATTRIBUTE_PLACEHOLDER,
1739
1775
  ApiClientError,
1740
1776
  BatchEntry,
1741
1777
  CANVAS_DRAFT_STATE,
@@ -1788,6 +1824,7 @@ export {
1788
1824
  getChannelName,
1789
1825
  getComponentJsonPointer,
1790
1826
  getComponentPath,
1827
+ getParameterAttributes,
1791
1828
  isAddComponentMessage,
1792
1829
  isDismissPlaceholderMessage,
1793
1830
  isMovingComponentMessage,
package/dist/index.js CHANGED
@@ -277,6 +277,12 @@ var require_retry2 = __commonJS({
277
277
  // src/index.ts
278
278
  var src_exports = {};
279
279
  __export(src_exports, {
280
+ ATTRIBUTE_COMPONENT_ID: () => ATTRIBUTE_COMPONENT_ID,
281
+ ATTRIBUTE_MULTILINE: () => ATTRIBUTE_MULTILINE,
282
+ ATTRIBUTE_PARAMETER_ID: () => ATTRIBUTE_PARAMETER_ID,
283
+ ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
284
+ ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
285
+ ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
280
286
  ApiClientError: () => import_api6.ApiClientError,
281
287
  BatchEntry: () => BatchEntry,
282
288
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
@@ -329,6 +335,7 @@ __export(src_exports, {
329
335
  getChannelName: () => getChannelName,
330
336
  getComponentJsonPointer: () => getComponentJsonPointer,
331
337
  getComponentPath: () => getComponentPath,
338
+ getParameterAttributes: () => getParameterAttributes,
332
339
  isAddComponentMessage: () => isAddComponentMessage,
333
340
  isDismissPlaceholderMessage: () => isDismissPlaceholderMessage,
334
341
  isMovingComponentMessage: () => isMovingComponentMessage,
@@ -1780,6 +1787,36 @@ var createUniformApiEnhancer = ({ apiUrl }) => {
1780
1787
  };
1781
1788
  };
1782
1789
 
1790
+ // src/utils/getParameterAttributes.ts
1791
+ var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
1792
+ var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
1793
+ var ATTRIBUTE_PARAMETER_VALUE = "data-uniform-parameter-value";
1794
+ var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
1795
+ var ATTRIBUTE_PLACEHOLDER = "data-uniform-placeholder";
1796
+ var ATTRIBUTE_MULTILINE = "data-uniform-is-multiline";
1797
+ var getParameterAttributes = ({
1798
+ id,
1799
+ component,
1800
+ placeholder,
1801
+ isMultiline = false
1802
+ }) => {
1803
+ var _a, _b, _c;
1804
+ const componentId = component == null ? void 0 : component._id;
1805
+ const parameter = (_a = component == null ? void 0 : component.parameters) == null ? void 0 : _a[id];
1806
+ const value = parameter == null ? void 0 : parameter.value;
1807
+ const type = parameter == null ? void 0 : parameter.type;
1808
+ const isEditable = (_c = (_b = parameter == null ? void 0 : parameter._contextualEditing) == null ? void 0 : _b.isEditable) != null ? _c : false;
1809
+ return {
1810
+ [ATTRIBUTE_COMPONENT_ID]: componentId,
1811
+ [ATTRIBUTE_PARAMETER_ID]: id,
1812
+ [ATTRIBUTE_PARAMETER_VALUE]: String(value != null ? value : ""),
1813
+ [ATTRIBUTE_PARAMETER_TYPE]: type,
1814
+ [ATTRIBUTE_PLACEHOLDER]: placeholder,
1815
+ [ATTRIBUTE_MULTILINE]: isMultiline,
1816
+ contentEditable: isEditable
1817
+ };
1818
+ };
1819
+
1783
1820
  // src/utils/isSystemComponentDefinition.ts
1784
1821
  var isSystemComponentDefinition = (componentType) => {
1785
1822
  return componentType.startsWith("$");
@@ -1822,6 +1859,12 @@ var import_api6 = require("@uniformdev/context/api");
1822
1859
  var CanvasClientError = import_api6.ApiClientError;
1823
1860
  // Annotate the CommonJS export names for ESM import in node:
1824
1861
  0 && (module.exports = {
1862
+ ATTRIBUTE_COMPONENT_ID,
1863
+ ATTRIBUTE_MULTILINE,
1864
+ ATTRIBUTE_PARAMETER_ID,
1865
+ ATTRIBUTE_PARAMETER_TYPE,
1866
+ ATTRIBUTE_PARAMETER_VALUE,
1867
+ ATTRIBUTE_PLACEHOLDER,
1825
1868
  ApiClientError,
1826
1869
  BatchEntry,
1827
1870
  CANVAS_DRAFT_STATE,
@@ -1874,6 +1917,7 @@ var CanvasClientError = import_api6.ApiClientError;
1874
1917
  getChannelName,
1875
1918
  getComponentJsonPointer,
1876
1919
  getComponentPath,
1920
+ getParameterAttributes,
1877
1921
  isAddComponentMessage,
1878
1922
  isDismissPlaceholderMessage,
1879
1923
  isMovingComponentMessage,
package/dist/index.mjs CHANGED
@@ -1695,6 +1695,36 @@ var createUniformApiEnhancer = ({ apiUrl }) => {
1695
1695
  };
1696
1696
  };
1697
1697
 
1698
+ // src/utils/getParameterAttributes.ts
1699
+ var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
1700
+ var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
1701
+ var ATTRIBUTE_PARAMETER_VALUE = "data-uniform-parameter-value";
1702
+ var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
1703
+ var ATTRIBUTE_PLACEHOLDER = "data-uniform-placeholder";
1704
+ var ATTRIBUTE_MULTILINE = "data-uniform-is-multiline";
1705
+ var getParameterAttributes = ({
1706
+ id,
1707
+ component,
1708
+ placeholder,
1709
+ isMultiline = false
1710
+ }) => {
1711
+ var _a, _b, _c;
1712
+ const componentId = component == null ? void 0 : component._id;
1713
+ const parameter = (_a = component == null ? void 0 : component.parameters) == null ? void 0 : _a[id];
1714
+ const value = parameter == null ? void 0 : parameter.value;
1715
+ const type = parameter == null ? void 0 : parameter.type;
1716
+ const isEditable = (_c = (_b = parameter == null ? void 0 : parameter._contextualEditing) == null ? void 0 : _b.isEditable) != null ? _c : false;
1717
+ return {
1718
+ [ATTRIBUTE_COMPONENT_ID]: componentId,
1719
+ [ATTRIBUTE_PARAMETER_ID]: id,
1720
+ [ATTRIBUTE_PARAMETER_VALUE]: String(value != null ? value : ""),
1721
+ [ATTRIBUTE_PARAMETER_TYPE]: type,
1722
+ [ATTRIBUTE_PLACEHOLDER]: placeholder,
1723
+ [ATTRIBUTE_MULTILINE]: isMultiline,
1724
+ contentEditable: isEditable
1725
+ };
1726
+ };
1727
+
1698
1728
  // src/utils/isSystemComponentDefinition.ts
1699
1729
  var isSystemComponentDefinition = (componentType) => {
1700
1730
  return componentType.startsWith("$");
@@ -1736,6 +1766,12 @@ function mapSlotToTestVariations(slot) {
1736
1766
  import { ApiClientError } from "@uniformdev/context/api";
1737
1767
  var CanvasClientError = ApiClientError;
1738
1768
  export {
1769
+ ATTRIBUTE_COMPONENT_ID,
1770
+ ATTRIBUTE_MULTILINE,
1771
+ ATTRIBUTE_PARAMETER_ID,
1772
+ ATTRIBUTE_PARAMETER_TYPE,
1773
+ ATTRIBUTE_PARAMETER_VALUE,
1774
+ ATTRIBUTE_PLACEHOLDER,
1739
1775
  ApiClientError,
1740
1776
  BatchEntry,
1741
1777
  CANVAS_DRAFT_STATE,
@@ -1788,6 +1824,7 @@ export {
1788
1824
  getChannelName,
1789
1825
  getComponentJsonPointer,
1790
1826
  getComponentPath,
1827
+ getParameterAttributes,
1791
1828
  isAddComponentMessage,
1792
1829
  isDismissPlaceholderMessage,
1793
1830
  isMovingComponentMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.35.1-alpha.8+a708c0c03",
3
+ "version": "19.35.2",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/context": "19.35.1-alpha.8+a708c0c03",
41
+ "@uniformdev/context": "19.35.2",
42
42
  "immer": "9.0.21"
43
43
  },
44
44
  "files": [
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "a708c0c034aa8375d0bd74e9f619319955b63a19"
50
+ "gitHead": "64d3270175087c87cfaa29a283aa4a7b0a98fd2c"
51
51
  }