@cloudscape-design/board-components 3.0.102 → 3.0.104

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.
@@ -1,8 +1,10 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { initAwsUiVersions, useComponentMetadata, } from "@cloudscape-design/component-toolkit/internal";
4
- import { PACKAGE_SOURCE, PACKAGE_VERSION } from "../environment";
4
+ import { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from "../environment";
5
+ import { getVisualTheme } from "../utils/get-visual-theme";
5
6
  import { useTelemetry } from "./use-telemetry";
7
+ import { useVisualRefresh } from "./use-visual-refresh";
6
8
  initAwsUiVersions(PACKAGE_SOURCE, PACKAGE_VERSION);
7
9
  /**
8
10
  * This hook is used for components which are exported to customers. The returned __internalRootRef needs to be
@@ -11,7 +13,13 @@ initAwsUiVersions(PACKAGE_SOURCE, PACKAGE_VERSION);
11
13
  */
12
14
  export default function useBaseComponent(componentName, config) {
13
15
  useTelemetry(componentName, config);
14
- const elementRef = useComponentMetadata(componentName, PACKAGE_VERSION);
16
+ const isVisualRefresh = useVisualRefresh();
17
+ const theme = getVisualTheme(THEME, isVisualRefresh);
18
+ const elementRef = useComponentMetadata(componentName, {
19
+ packageName: PACKAGE_SOURCE,
20
+ version: PACKAGE_VERSION,
21
+ theme,
22
+ });
15
23
  return { __internalRootRef: elementRef };
16
24
  }
17
25
  //# sourceMappingURL=use-base-component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-base-component.js","sourceRoot":"","sources":["../../../../src/internal/base-component/use-base-component.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EAEL,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,iBAAiB,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;AAMnD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAU,aAAqB,EAAE,MAA+B;IACtG,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,UAAU,GAAG,oBAAoB,CAAI,aAAa,EAAE,eAAe,CAAC,CAAC;IAC3E,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { MutableRefObject } from \"react\";\n\nimport {\n ComponentConfiguration,\n initAwsUiVersions,\n useComponentMetadata,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport { PACKAGE_SOURCE, PACKAGE_VERSION } from \"../environment\";\nimport { useTelemetry } from \"./use-telemetry\";\n\ninitAwsUiVersions(PACKAGE_SOURCE, PACKAGE_VERSION);\n\nexport interface InternalBaseComponentProps {\n __internalRootRef?: MutableRefObject<any> | null;\n}\n\n/**\n * This hook is used for components which are exported to customers. The returned __internalRootRef needs to be\n * attached to the (internal) component's root DOM node. The hook takes care of attaching the metadata to this\n * root DOM node and emits the telemetry for this component.\n */\nexport default function useBaseComponent<T = any>(componentName: string, config?: ComponentConfiguration) {\n useTelemetry(componentName, config);\n const elementRef = useComponentMetadata<T>(componentName, PACKAGE_VERSION);\n return { __internalRootRef: elementRef };\n}\n"]}
1
+ {"version":3,"file":"use-base-component.js","sourceRoot":"","sources":["../../../../src/internal/base-component/use-base-component.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,OAAO,EAEL,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,iBAAiB,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;AAMnD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAU,aAAqB,EAAE,MAA+B;IACtG,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,eAAe,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,oBAAoB,CAAI,aAAa,EAAE;QACxD,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,eAAe;QACxB,KAAK;KACN,CAAC,CAAC;IACH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { MutableRefObject } from \"react\";\n\nimport {\n ComponentConfiguration,\n initAwsUiVersions,\n useComponentMetadata,\n} from \"@cloudscape-design/component-toolkit/internal\";\n\nimport { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from \"../environment\";\nimport { getVisualTheme } from \"../utils/get-visual-theme\";\nimport { useTelemetry } from \"./use-telemetry\";\nimport { useVisualRefresh } from \"./use-visual-refresh\";\n\ninitAwsUiVersions(PACKAGE_SOURCE, PACKAGE_VERSION);\n\nexport interface InternalBaseComponentProps {\n __internalRootRef?: MutableRefObject<any> | null;\n}\n\n/**\n * This hook is used for components which are exported to customers. The returned __internalRootRef needs to be\n * attached to the (internal) component's root DOM node. The hook takes care of attaching the metadata to this\n * root DOM node and emits the telemetry for this component.\n */\nexport default function useBaseComponent<T = any>(componentName: string, config?: ComponentConfiguration) {\n useTelemetry(componentName, config);\n const isVisualRefresh = useVisualRefresh();\n const theme = getVisualTheme(THEME, isVisualRefresh);\n const elementRef = useComponentMetadata<T>(componentName, {\n packageName: PACKAGE_SOURCE,\n version: PACKAGE_VERSION,\n theme,\n });\n return { __internalRootRef: elementRef };\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "board-components";
2
- export var PACKAGE_VERSION = "3.0.0 (671b4887)";
2
+ export var PACKAGE_VERSION = "3.0.0 (d636840f)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "board-components",
3
- "PACKAGE_VERSION": "3.0.0 (671b4887)",
3
+ "PACKAGE_VERSION": "3.0.0 (d636840f)",
4
4
  "THEME": "open-source-visual-refresh",
5
5
  "ALWAYS_VISUAL_REFRESH": true
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "671b4887aee8d5206892a6ed68a93ae719dc770b"
2
+ "commit": "d636840f44ec0cfc6080c83d4a84d8de3f248b14"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/board-components",
3
- "version": "3.0.102",
3
+ "version": "3.0.104",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/board-components.git"
@@ -76,7 +76,7 @@
76
76
  "stylelint-config-recommended-scss": "^14.1.0",
77
77
  "stylelint-prettier": "^5.0.2",
78
78
  "typescript": "^4.9.4",
79
- "vite": "^6.2.4",
79
+ "vite": "^6.3.4",
80
80
  "vitest": "^3.0.7"
81
81
  },
82
82
  "//": "ensure that typedoc uses latest typescript. It prints a warning, but works",