@cloudscape-design/code-view 3.0.65 → 3.0.67

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,6 +1,7 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
2
  // SPDX-License-Identifier: Apache-2.0
3
+ "use client";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  import { applyDisplayName } from "../internal/base-component/apply-display-name";
5
6
  import useBaseComponent from "../internal/base-component/use-base-component";
6
7
  import { InternalCodeView } from "./internal";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-view/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,gBAAgB,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAoB;IACnD,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,EAAE;QACtD,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE;QACrE,QAAQ,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE;KAC1C,CAAC,CAAC;IACH,OAAO,KAAC,gBAAgB,OAAK,KAAK,KAAM,kBAAkB,GAAI,CAAC;AACjE,CAAC;AAED,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { applyDisplayName } from \"../internal/base-component/apply-display-name\";\nimport useBaseComponent from \"../internal/base-component/use-base-component\";\nimport type { CodeViewProps } from \"./interfaces\";\nimport { InternalCodeView } from \"./internal\";\n\nexport type { CodeViewProps };\n\nexport default function CodeView(props: CodeViewProps) {\n const baseComponentProps = useBaseComponent(\"CodeView\", {\n props: { lineNumbers: props.lineNumbers, wrapLines: props.wrapLines },\n metadata: { hasActions: !!props.actions },\n });\n return <InternalCodeView {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(CodeView, \"CodeView\");\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/code-view/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,gBAAgB,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAoB;IACnD,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,EAAE;QACtD,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE;QACrE,QAAQ,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE;KAC1C,CAAC,CAAC;IACH,OAAO,KAAC,gBAAgB,OAAK,KAAK,KAAM,kBAAkB,GAAI,CAAC;AACjE,CAAC;AAED,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\"use client\";\nimport { applyDisplayName } from \"../internal/base-component/apply-display-name\";\nimport useBaseComponent from \"../internal/base-component/use-base-component\";\nimport type { CodeViewProps } from \"./interfaces\";\nimport { InternalCodeView } from \"./internal\";\n\nexport type { CodeViewProps };\n\nexport default function CodeView(props: CodeViewProps) {\n const baseComponentProps = useBaseComponent(\"CodeView\", {\n props: { lineNumbers: props.lineNumbers, wrapLines: props.wrapLines },\n metadata: { hasActions: !!props.actions },\n });\n return <InternalCodeView {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(CodeView, \"CodeView\");\n"]}
@@ -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,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;AAQD,MAAM,UAAU,YAAY,CAAC,KAAyB;IACpD,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC5B,SAAS,CAAC,IAAI,CAAC,GAAI,KAAgC,CAAC,IAAI,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,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\n// we also support data-* attributes, but they are always implicitly allowed by typescript\n// http://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking\n// \"Note: If an attribute name is not a valid JS identifier (like a data-* attribute), it is not considered to be an error\"\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface BaseComponentProps {}\n\nexport function getBaseProps(props: BaseComponentProps) {\n const baseProps: Record<string, string> = {};\n Object.keys(props).forEach((prop) => {\n if (prop.startsWith(\"data-\")) {\n baseProps[prop] = (props as Record<string, string>)[prop];\n }\n });\n return baseProps;\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;AAQD,MAAM,UAAU,YAAY,CAAC,KAAyB;IACpD,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC5B,SAAS,CAAC,IAAI,CAAC,GAAI,KAAgC,CAAC,IAAI,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,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\n// we also support data-* attributes, but they are always implicitly allowed by typescript\n// http://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking\n// \"Note: If an attribute name is not a valid JS identifier (like a data-* attribute), it is not considered to be an error\"\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface BaseComponentProps {}\n\nexport function getBaseProps(props: BaseComponentProps) {\n const baseProps: Record<string, string> = {};\n Object.keys(props).forEach((prop) => {\n if (prop.startsWith(\"data-\")) {\n baseProps[prop] = (props as Record<string, string>)[prop];\n }\n });\n return baseProps;\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export var PACKAGE_SOURCE = "code-view";
2
- export var PACKAGE_VERSION = "3.0.0 (8c840b8d)";
2
+ export var PACKAGE_VERSION = "3.0.0 (45e0dc4e)";
3
3
  export var THEME = "open-source-visual-refresh";
4
- export var ALWAYS_VISUAL_REFRESH = true;
4
+ export var ALWAYS_VISUAL_REFRESH = true;
5
+ export var SYSTEM = "console";
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "code-view",
3
- "PACKAGE_VERSION": "3.0.0 (8c840b8d)",
3
+ "PACKAGE_VERSION": "3.0.0 (45e0dc4e)",
4
4
  "THEME": "open-source-visual-refresh",
5
- "ALWAYS_VISUAL_REFRESH": true
5
+ "ALWAYS_VISUAL_REFRESH": true,
6
+ "SYSTEM": "console"
6
7
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "8c840b8d5acea2fcb6a1348e95bf410930e2ddcc"
2
+ "commit": "45e0dc4ed011ca78bc4900e572eb0562eba3efe8"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/code-view",
3
- "version": "3.0.65",
3
+ "version": "3.0.67",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/code-view.git"
@@ -50,39 +50,40 @@
50
50
  "@cloudscape-design/global-styles": "^1.0.1",
51
51
  "@cloudscape-design/test-utils-converter": "^1.0.0",
52
52
  "@cloudscape-design/theming-build": "^1",
53
+ "@eslint/compat": "^1.2.9",
54
+ "@eslint/js": "^9.26.0",
53
55
  "@size-limit/preset-small-lib": "^11.2.0",
54
56
  "@testing-library/jest-dom": "^5.16.5",
55
57
  "@testing-library/react": "^13.4.0",
56
58
  "@types/jest-image-snapshot": "^6.1.0",
57
59
  "@types/lodash": "^4.14.191",
58
- "@types/node": "^18.19.4",
60
+ "@types/node": "^20.17.14",
59
61
  "@types/react": "^18.0.26",
60
62
  "@types/react-dom": "^18.0.10",
61
- "@typescript-eslint/eslint-plugin": "^5.48.0",
62
- "@typescript-eslint/parser": "^5.48.0",
63
63
  "@vitejs/plugin-react": "^4.3.4",
64
64
  "@vitest/coverage-v8": "^3.1.1",
65
65
  "chokidar-cli": "^3.0.0",
66
- "eslint": "^8.57.0",
67
- "eslint-config-prettier": "^8.10.0",
66
+ "eslint": "^9.20.1",
67
+ "eslint-config-prettier": "^10.1.5",
68
68
  "eslint-plugin-header": "^3.1.1",
69
- "eslint-plugin-import": "^2.29.1",
70
- "eslint-plugin-no-unsanitized": "^4.0.2",
71
- "eslint-plugin-prettier": "^5.0.0",
72
- "eslint-plugin-react": "^7.35.0",
73
- "eslint-plugin-react-hooks": "^4.6.2",
69
+ "eslint-plugin-import": "^2.32.0",
70
+ "eslint-plugin-no-unsanitized": "^4.1.2",
71
+ "eslint-plugin-prettier": "^5.2.3",
72
+ "eslint-plugin-react": "^7.31.11",
73
+ "eslint-plugin-react-hooks": "^5.2.0",
74
74
  "eslint-plugin-simple-import-sort": "^12.1.1",
75
- "eslint-plugin-unicorn": "^45.0.2",
75
+ "eslint-plugin-unicorn": "^59.0.1",
76
76
  "execa": "^6.1.0",
77
77
  "globby": "^13.1.3",
78
+ "globals": "^16.1.0",
78
79
  "husky": "^9.1.7",
79
80
  "jest-image-snapshot": "^6.1.0",
80
81
  "jsdom": "^20.0.3",
81
- "lint-staged": "^13.1.0",
82
+ "lint-staged": "^15.2.2",
82
83
  "lodash": "^4.17.21",
83
84
  "lodash-es": "^4.17.21",
84
85
  "npm-run-all": "^4.1.5",
85
- "prettier": "^3.3.3",
86
+ "prettier": "^3.6.1",
86
87
  "puppeteer-core": "^22.15.0",
87
88
  "react": "^18.2.0",
88
89
  "react-dom": "^18.2.0",
@@ -94,13 +95,14 @@
94
95
  "stylelint-prettier": "^5.0.2",
95
96
  "stylelint-scss": "^6.4.1",
96
97
  "stylelint-use-logical": "^2.1.2",
97
- "typescript": "4.9.4",
98
+ "typescript": "^4.9.5",
99
+ "typescript-eslint": "^8.32.1",
98
100
  "vite": "^6.3.4",
99
101
  "vitest": "^3.1.1"
100
102
  },
101
103
  "//": "ensure that typedoc uses typescript 4.9.4. It prints a warning, but works",
102
104
  "overrides": {
103
- "typescript": "4.9.4"
105
+ "typescript": "^4.9.5"
104
106
  },
105
107
  "lint-staged": {
106
108
  "*.{js,jsx,ts,tsx}": [