From 3204abc01d3df569de8ed294dc7f99d130dc30a7 Mon Sep 17 00:00:00 2001 From: Tracy French Date: Tue, 26 Nov 2024 15:40:33 -0700 Subject: [PATCH] chore: update lodash imports to use esm --- .../e2e/dashboard/utils/dragAndDrop.ts | 2 +- apps/dev-env/package.json | 3 +- package-lock.json | 632 +- packages/core-util/package.json | 4 +- packages/core-util/src/sdks/colorizer.ts | 2 +- packages/dashboard/package.json | 4 +- .../src/components/actions/index.tsx | 2 +- .../src/components/dashboard/index.tsx | 21 +- .../src/components/dashboard/view.tsx | 10 +- .../internalDashboard/dashboardHeader.tsx | 6 +- .../internalDashboard/keyboardShortcuts.ts | 4 +- .../components/internalDashboard/useLayers.ts | 4 +- .../modelBasedQuery/useModelBasedQuery.ts | 10 +- .../useModelBasedQuerySelection.ts | 18 +- .../useSelectedAssetModelProperties.ts | 6 +- .../footer/disableAdd.ts | 2 +- .../dashboard/src/components/widgets/list.tsx | 4 +- .../src/customization/hooks/useIsSelected.ts | 6 +- .../src/customization/propertiesSection.ts | 7 +- .../styleExpandableSection.tsx | 2 +- .../yAxisSettings/index.tsx | 6 +- .../customization/widgets/gauge/component.tsx | 2 +- .../customization/widgets/kpi/component.tsx | 2 +- .../widgets/status/component.tsx | 2 +- .../utils/alarmModelQueryToAlarmQuery.ts | 4 +- .../utils/assetModelQueryToAssetQuery.ts | 6 +- .../widgets/utils/assetQuery/defaultColors.ts | 4 +- .../dashboard/src/hooks/useSelectedWidgets.ts | 6 +- .../hooks/useStableDashboardConfiguration.ts | 10 +- .../hooks/useSyncDashboardConfiguration.ts | 4 +- .../assistantWidgetsSelection/index.ts | 2 +- .../src/store/actions/bringToFront/index.ts | 6 +- .../src/store/actions/copyWidgets/index.ts | 2 +- .../src/store/actions/pasteWidgets/index.ts | 7 +- .../src/store/actions/selectWidgets/index.ts | 2 +- .../src/store/actions/sendToBack/index.ts | 6 +- packages/dashboard/src/store/index.ts | 4 +- .../dashboard/src/util/mergeAssetQueries.ts | 2 +- packages/dashboard/src/util/select.ts | 6 +- packages/dashboard/testing/mocks.ts | 5 +- packages/react-components/package.json | 22 +- .../anomaly-chart/converters/convertXAxis.ts | 8 +- .../anomaly-chart/hooks/useAnomalyEchart.ts | 18 +- .../bar-chart/hooks/useBarChartAlarms.ts | 14 +- .../chart/chartOptions/style/convertStyles.ts | 2 +- .../chartOptions/useChartConfiguration.ts | 28 +- .../components/chart/hooks/useChartAlarms.ts | 22 +- .../hooks/useChartStoreDataStreamsSync.ts | 4 +- .../chart/hooks/useDataStreamMaxMin.ts | 2 +- .../chart/hooks/useHighlightedDataStreams.ts | 4 +- .../chart/hooks/useNormalizedDataStreams.ts | 10 +- .../chart/hooks/useVisibleDataStreams.ts | 4 +- .../chart/hooks/useVisualizedDataStreams.ts | 6 +- .../gauge/hooks/useGaugeConfiguration.ts | 11 +- .../src/components/kpi/kpiBase.tsx | 2 +- .../anomaly/object/transformer.ts | 16 +- .../updateDataStreamMinMax.ts | 2 +- .../hooks/useThrottledTrendCursorValues.ts | 2 +- .../hooks/useTrendCursorColorer.ts | 2 +- .../extensions/yAxisSync/updateYAxis.ts | 6 +- .../unboundedZoom/useUnboundedDataZoom.ts | 2 +- .../updateAlarmStatusForDatastreams.ts | 2 +- .../hookHelpers/useReactQueryEffect.ts | 4 +- .../summarizeAlarmModels.ts | 5 +- .../updateAlarmInputPropertyData.ts | 2 +- .../convertAlarmsStateToAlarmDatas.ts | 6 +- .../useAlarms/state/useRequestSelector.ts | 2 +- .../useColoredDataStreams.ts | 5 +- .../useDataStreamColorer.ts | 4 +- .../useSingleQueryAlarm.ts | 14 +- .../useTimeSeriesData/useTimeSeriesData.ts | 22 +- .../hooks/useViewport/useUtilizedViewport.ts | 7 +- .../cacheClient/cacheClient.ts | 6 +- .../cacheClient/keyManager.ts | 5 +- .../requestManager.ts | 6 +- .../requestManager.ts | 6 +- .../getAssetPropertyAggregates.ts | 16 +- .../getAssetPropertyValueHistory.ts | 16 +- .../useRequestResolverStrategy.ts | 12 +- .../batchResponseProcessor.ts | 2 +- .../getHistoricalAssetPropertyValueRequest.ts | 6 +- .../useHistoricalAssetPropertyValues.spec.ts | 2 +- .../useLatestAssetPropertyValues.spec.ts | 2 +- .../intervals/useLiveDataIntervals.ts | 4 +- .../intervals/utils/collapse.ts | 4 +- .../requestExecution/useRequestExecuter.ts | 10 +- .../requestManager/useRequestManager.ts | 6 +- .../useTimeSeriesData/useRequestStatus.ts | 8 +- .../src/translations/messages.ts | 6 +- .../stories/anomaly/mockData.ts | 2 +- packages/scene-composer/package.json | 4 +- packages/scene-composer/src/SceneViewer.tsx | 3 +- .../src/components/IntlProvider/index.tsx | 7 +- .../src/components/SceneComposerInternal.tsx | 4 +- .../components/modals/ConvertSceneModal.tsx | 3 +- .../src/components/modals/DeleteNodeModal.tsx | 4 +- .../src/components/modals/MessageModal.tsx | 4 +- .../panels/ColorPicker/ColorPicker.tsx | 3 +- .../SceneHierarchyDataProvider.tsx | 2 +- .../panels/SceneNodeInspectorPanel.tsx | 2 +- .../panels/__tests__/TopBar.spec.tsx | 2 +- .../__snapshots__/TopBar.spec.tsx.snap | 2 +- .../AnchorComponentEditor.tsx | 4 +- .../DataOverlayComponentEditor.tsx | 4 +- .../common/DataBindingMapEditor.tsx | 4 +- .../data-overlay/DataBindingMapNameEditor.tsx | 3 +- .../DataBindingMapNameEditorSnap.spec.tsx | 3 +- .../motion-indicator/AppearanceEditor.tsx | 4 +- .../motion-indicator/ColorEditor.tsx | 2 +- .../motion-indicator/SpeedEditor.tsx | 2 +- .../motion-indicator/helpers.ts | 3 +- .../tag-style/IconPicker/IconPicker.tsx | 2 +- .../scene-settings/MatterportIntegration.tsx | 4 +- .../scene-settings/MatterportTagSync.tsx | 3 +- .../SceneDataBindingTemplateEditor.tsx | 3 +- .../ColorOverlayComponent/index.tsx | 3 +- .../toolbars/common/ItemContainer.tsx | 4 +- .../src/hooks/useBindingData.ts | 10 +- .../src/hooks/useBindingQueries.ts | 5 +- .../src/hooks/useMatterportTags.ts | 2 +- .../src/hooks/useMatterportViewer.ts | 5 +- .../src/layouts/SceneLayout/SceneLayout.tsx | 38 +- .../__snapshots__/SceneLayout.spec.tsx.snap | 7934 ++--------------- .../__tests__/sceneDocumentHelpers.spec.ts | 3 +- .../src/store/helpers/componentMapHelpers.ts | 5 +- .../src/store/helpers/sceneDocumentHelpers.ts | 3 +- .../src/store/helpers/serializationHelpers.ts | 24 +- .../store/slices/SceneDocumentSlice.spec.ts | 16 +- .../src/store/slices/SceneDocumentSlice.ts | 4 +- .../utils/dataBindingTemplateUtils.spec.ts | 4 +- .../src/utils/dataBindingTemplateUtils.ts | 4 +- .../src/utils/dataBindingUtils.ts | 5 +- .../entityModelUtils/dataBindingUtils.ts | 3 +- .../motionIndicatorComponent.ts | 10 +- .../utils/entityModelUtils/nodeComponent.ts | 22 +- .../entityModelUtils/overlayComponent.ts | 6 +- .../utils/entityModelUtils/sceneComponent.ts | 8 +- .../src/utils/entityModelUtils/sceneUtils.ts | 12 +- .../utils/entityModelUtils/tagComponent.ts | 6 +- .../scene-composer/src/utils/stringUtils.ts | 3 +- .../useMockedValueDataBindingProvider.ts | 26 +- .../LightComponentEditor.spec.tsx | 9 +- packages/source-iotsitewise/package.json | 8 +- .../iotevents/util/getAlarmStateProperty.ts | 6 +- .../src/time-series-data/store.ts | 8 +- .../time-series-data/util/deduplication.ts | 4 +- packages/source-iottwinmaker/package.json | 5 +- .../EntityPropertyBindingProviderStore.ts | 37 +- .../client/getPropertyValueByEntity.ts | 6 +- .../getPropertyValueHistoryByComponentType.ts | 3 +- .../client/getPropertyValueHistoryByEntity.ts | 8 +- .../src/time-series-data/data-source.ts | 12 +- .../src/time-series-data/utils/values.ts | 4 +- .../src/utils/propertyValueUtils.ts | 11 +- .../src/video-data/VideoData.ts | 26 +- .../src/video-data/utils/twinmakerUtils.ts | 4 +- 156 files changed, 1397 insertions(+), 8216 deletions(-) diff --git a/apps/dev-env/e2e/dashboard/utils/dragAndDrop.ts b/apps/dev-env/e2e/dashboard/utils/dragAndDrop.ts index baf833f40..c1d712764 100644 --- a/apps/dev-env/e2e/dashboard/utils/dragAndDrop.ts +++ b/apps/dev-env/e2e/dashboard/utils/dragAndDrop.ts @@ -1,5 +1,5 @@ import { type Locator, type Page } from '@playwright/test'; -import zip from 'lodash/zip.js'; +import zip from 'lodash-es/zip.js'; import { type BoundingBox, getBoundingBox } from './locator'; import { center } from './mousePosition'; diff --git a/apps/dev-env/package.json b/apps/dev-env/package.json index ea18e4d43..56a2b9e43 100644 --- a/apps/dev-env/package.json +++ b/apps/dev-env/package.json @@ -31,10 +31,11 @@ "@storybook/react": "^8.4.5", "@storybook/react-vite": "^8.4.5", "@storybook/test": "^8.4.5", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@vitejs/plugin-react": "^4.3.3", "eslint-config-iot-app-kit": "*", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "msw-storybook-addon": "^2.0.4", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/package-lock.json b/package-lock.json index af5e747ab..30692870c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,10 +49,11 @@ "@storybook/react": "^8.4.5", "@storybook/react-vite": "^8.4.5", "@storybook/test": "^8.4.5", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@vitejs/plugin-react": "^4.3.3", "eslint-config-iot-app-kit": "*", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "msw-storybook-addon": "^2.0.4", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -10097,19 +10098,6 @@ "node": ">=8" } }, - "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "jest-get-type": "^29.6.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -10123,57 +10111,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/@joshwooding/vite-plugin-react-docgen-typescript": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@joshwooding/vite-plugin-react-docgen-typescript/-/vite-plugin-react-docgen-typescript-0.3.0.tgz", @@ -16602,79 +16539,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/@types/jest": { - "version": "29.5.14", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", - "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, - "node_modules/@types/jest/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@types/jest/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@types/jest/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/jexl": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/@types/jexl/-/jexl-2.3.4.tgz", @@ -16721,114 +16585,12 @@ "version": "4.17.13", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.13.tgz", "integrity": "sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==", - "dev": true, "license": "MIT" }, - "node_modules/@types/lodash.difference": { - "version": "4.5.9", - "resolved": "https://registry.npmjs.org/@types/lodash.difference/-/lodash.difference-4.5.9.tgz", - "integrity": "sha512-MNlajcjtwzLpXk+cw38UkBvEXJNEPhULgS8A4EHwtUwT7f7yFH/SFKD0iw5Rfilwh60yJIgFo0vsMr7xsa5+aw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.differenceby": { - "version": "4.8.9", - "resolved": "https://registry.npmjs.org/@types/lodash.differenceby/-/lodash.differenceby-4.8.9.tgz", - "integrity": "sha512-j/Sh0KjdDGmQTBsHRmbKGHfIsYHY5nDA3I5dfJcnlI+fTn38GV2rc2bMPbi+FNLPehnL4NjOnskD32cK7Zvemg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.groupby": { - "version": "4.6.9", - "resolved": "https://registry.npmjs.org/@types/lodash.groupby/-/lodash.groupby-4.6.9.tgz", - "integrity": "sha512-z2xtCX2ko7GrqORnnYea4+ksT7jZNAvaOcLd6mP9M7J09RHvJs06W8BGdQQAX8ARef09VQLdeRilSOcfHlDQJQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.isequal": { - "version": "4.5.8", - "resolved": "https://registry.npmjs.org/@types/lodash.isequal/-/lodash.isequal-4.5.8.tgz", - "integrity": "sha512-uput6pg4E/tj2LGxCZo9+y27JNyB2OZuuI/T5F+ylVDYuqICLG2/ktjxx0v6GvVntAf8TvEzeQLcV0ffRirXuA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.maxby": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/@types/lodash.maxby/-/lodash.maxby-4.6.7.tgz", - "integrity": "sha512-IEAUqiNm6L+dKSAx1StBfl+EUT3kMoLKDslTOxzkTlb2HYldIqcQOgavuRdqlTI2yKzSVRZM2ZZbRvKuEpaQaQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.merge": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/@types/lodash.merge/-/lodash.merge-4.6.7.tgz", - "integrity": "sha512-OwxUJ9E50gw3LnAefSHJPHaBLGEKmQBQ7CZe/xflHkyy/wH2zVyEIAKReHvVrrn7zKdF58p16We9kMfh7v0RRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.minby": { - "version": "4.6.7", - "resolved": "https://registry.npmjs.org/@types/lodash.minby/-/lodash.minby-4.6.7.tgz", - "integrity": "sha512-xTsh2c3zn711K0SjV5v9jndFBToyQqCaXoA6oLezfzRauR8RPypBOm0qXqfOLCjgFaBWSyYh6EWEBveVI58Dyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.omitby": { - "version": "4.6.9", - "resolved": "https://registry.npmjs.org/@types/lodash.omitby/-/lodash.omitby-4.6.9.tgz", - "integrity": "sha512-QPHwcQeWP/bQVwKV1+goohDgBtSZlHgM2KA/+QhjMYV2/7RTHF72KxLPzybvu8mO7O46NdugTH/yPs3/Jcavxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.takeright": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/lodash.takeright/-/lodash.takeright-4.1.9.tgz", - "integrity": "sha512-AGnwgjSy0sYhOW+QWLcubGibV+87evFBQHPIWxWvBRuqQ0u/TeXXUigg2higHx3J6+8uofdoOYU6whgJeCeIIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.throttle": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/lodash.throttle/-/lodash.throttle-4.1.7.tgz", - "integrity": "sha512-znwGDpjCHQ4FpLLx19w4OXDqq8+OvREa05H89obtSyXyOFKL3dDjCslsmfBz0T2FU8dmf5Wx1QvogbINiGIu9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/lodash": "*" - } - }, - "node_modules/@types/lodash.uniqwith": { - "version": "4.5.9", - "resolved": "https://registry.npmjs.org/@types/lodash.uniqwith/-/lodash.uniqwith-4.5.9.tgz", - "integrity": "sha512-r/L/U1bAHuZF/bKVanxZtPTCr0J47L8Ftpg4BeV1Knv5ZOl9f6bwqVxP5fvvqniHatgcYpp7vwccxbvVGMV8Xw==", - "dev": true, + "node_modules/@types/lodash-es": { + "version": "4.17.12", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz", + "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", "license": "MIT", "dependencies": { "@types/lodash": "*" @@ -17077,13 +16839,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/statuses": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.5.tgz", @@ -19589,22 +19344,6 @@ "dev": true, "license": "ISC" }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/cipher-base": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.5.tgz", @@ -22954,23 +22693,6 @@ "node": ">=6" } }, - "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/expect-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", @@ -25364,230 +25086,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-message-util/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, "node_modules/jexl": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/jexl/-/jexl-2.3.0.tgz", @@ -26043,18 +25541,6 @@ "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "license": "MIT" }, - "node_modules/lodash.difference": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==", - "license": "MIT" - }, - "node_modules/lodash.differenceby": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/lodash.differenceby/-/lodash.differenceby-4.8.0.tgz", - "integrity": "sha512-rJKrEP7/9SLBRcCaxYbE8iODlOgR3O3ckL/ZbONxC99n4QfpoovHw/+FZwDl16h3UKLrruLHJUuv440rOPksrg==", - "license": "MIT" - }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -26062,12 +25548,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.groupby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.groupby/-/lodash.groupby-4.6.0.tgz", - "integrity": "sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw==", - "license": "MIT" - }, "node_modules/lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -26094,12 +25574,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.maxby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.maxby/-/lodash.maxby-4.6.0.tgz", - "integrity": "sha512-QfTqQTwzmKxLy7VZlbx2M/ipWv8DCQ2F5BI/MRxLharOQ5V78yMSuB+JE+EuUM22txYfj09R2Q7hUlEYj7KdNg==", - "license": "MIT" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -26113,24 +25587,12 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.minby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.minby/-/lodash.minby-4.6.0.tgz", - "integrity": "sha512-/BQsNmceLCn6priGkiihvV5w/G9da7tqI6Wb4rS+PeaZcsFOv4PjNRs9/3ZQPY1sqpfhRtJQkAYLiaohlTUt0g==", - "license": "MIT" - }, "node_modules/lodash.omit": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", "license": "MIT" }, - "node_modules/lodash.omitby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.omitby/-/lodash.omitby-4.6.0.tgz", - "integrity": "sha512-5OrRcIVR75M288p4nbI2WLAf3ndw2GD9fyNv3Bc15+WCxJDdZ4lYndSxGd7hnG6PVjiJTeJE2dHEGhIuKGicIQ==", - "license": "MIT" - }, "node_modules/lodash.pick": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", @@ -26157,12 +25619,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.takeright": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.takeright/-/lodash.takeright-4.1.1.tgz", - "integrity": "sha512-/I41i2h8VkHtv3PYD8z1P4dkLIco5Z3z35hT/FJl18AxwSdifcATaaiBOxuQOT3T/F1qfRTct3VWMFSj1xCtAw==", - "license": "MIT" - }, "node_modules/lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", @@ -26188,12 +25644,6 @@ "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", "license": "MIT" }, - "node_modules/lodash.uniqwith": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniqwith/-/lodash.uniqwith-4.5.0.tgz", - "integrity": "sha512-7lYL8bLopMoy4CTICbxygAUq6CdRJ36vFc80DucPueUee+d5NBRxz3FdT9Pes/HEx5mPoT9jwnsEJWz1N7uq7Q==", - "license": "MIT" - }, "node_modules/lodash.upperfirst": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", @@ -32743,29 +32193,6 @@ "stackframe": "^1.3.4" } }, - "node_modules/stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -37231,14 +36658,14 @@ "license": "Apache-2.0", "dependencies": { "@iot-app-kit/core": "*", - "lodash.difference": "4.5.0", + "lodash-es": "^4.17.21", "pako": "^2.1.0", "zustand": "^4.5.2" }, "devDependencies": { "@aws-sdk/types": "^3.696.0", "@iot-app-kit/ts-config": "*", - "@types/lodash.difference": "4.5.9", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@types/pako": "^2.0.3", "@vitest/coverage-v8": "^2.1.5", @@ -37310,7 +36737,7 @@ "buffer": "^6.0.3", "dompurify": "^3.1.7", "is-hotkey": "^0.2.0", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "papaparse": "^5.4.1", "parse-duration": "^1.0.3", "react-dnd": "^16.0.1", @@ -37338,7 +36765,7 @@ "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", "@types/is-hotkey": "^0.1.7", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@types/papaparse": "^5.3.10", "@types/react": "^18.2.12", @@ -37591,16 +37018,7 @@ "dompurify": "^3.1.7", "echarts": "^5.4.3", "is-hotkey": "^0.2.0", - "lodash.difference": "4.5.0", - "lodash.differenceby": "4.8.0", - "lodash.groupby": "4.6.0", - "lodash.isequal": "4.5.0", - "lodash.maxby": "4.6.0", - "lodash.merge": "4.6.2", - "lodash.minby": "4.6.0", - "lodash.omitby": "^4.6.0", - "lodash.takeright": "^4.1.1", - "lodash.throttle": "^4.1.1", + "lodash-es": "^4.17.21", "luxon": "^3.5.0", "parse-duration": "^1.0.3", "react-cytoscapejs": "^2.0.0", @@ -37639,16 +37057,7 @@ "@types/d3": "^7.4.0", "@types/dompurify": "3.0.2", "@types/is-hotkey": "^0.1.7", - "@types/lodash.difference": "4.5.9", - "@types/lodash.differenceby": "4.8.9", - "@types/lodash.groupby": "4.6.9", - "@types/lodash.isequal": "4.5.8", - "@types/lodash.maxby": "4.6.7", - "@types/lodash.merge": "4.6.7", - "@types/lodash.minby": "4.6.7", - "@types/lodash.omitby": "^4.6.7", - "@types/lodash.takeright": "4.1.9", - "@types/lodash.throttle": "4.1.7", + "@types/lodash-es": "^4.17.12", "@types/luxon": "^3.4.2", "@types/node": "^18.16.18", "@types/react": "^18.2.12", @@ -37867,6 +37276,7 @@ "immer": "^9.0.21", "is-absolute-url": "^4.0.1", "jexl": "^2.3.0", + "lodash-es": "^4.17.21", "merge": "^2.1.1", "path-browserify": "1.0.1", "postprocessing": "6.28.5", @@ -37914,7 +37324,7 @@ "@testing-library/user-event": "^14.5.2", "@types/debug": "^4.1.8", "@types/jexl": "^2.2.0", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@types/react": "^18.2.12", "@types/react-dom": "^18.2.5", @@ -37929,7 +37339,6 @@ "husky": "8.0.3", "jest-extended": "^3.2.4", "jsdom": "^25.0.1", - "lodash": "^4.17.21", "nodemon": "^2.0.22", "npm-run-all": "^4.1.5", "postcss": "^8.4.31", @@ -39645,18 +39054,14 @@ "@iot-app-kit/core-util": "*", "@synchro-charts/core": "7.2.0", "dataloader": "^2.2.2", - "lodash.isequal": "^4.5.0", - "lodash.merge": "^4.6.2", - "lodash.uniqwith": "^4.5.0", + "lodash-es": "^4.17.21", "rxjs": "^7.8.1" }, "devDependencies": { "@aws-sdk/types": "^3.696.0", "@iot-app-kit/testing-util": "*", "@iot-app-kit/ts-config": "*", - "@types/lodash.isequal": "^4.5.6", - "@types/lodash.merge": "^4.6.7", - "@types/lodash.uniqwith": "^4.5.7", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@vitest/coverage-v8": "^2.1.5", "eslint-config-iot-app-kit": "*", @@ -39686,14 +39091,13 @@ "@aws-sdk/url-parser": "3.374.0", "@iot-app-kit/core": "*", "@tanstack/query-core": "^4.29.15", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "rxjs": "^7.8.1" }, "devDependencies": { "@aws-sdk/types": "^3.696.0", "@iot-app-kit/ts-config": "*", - "@types/jest": "^29.4.0", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@vitest/coverage-v8": "^2.1.5", "aws-sdk-client-mock": "^1.0.0", diff --git a/packages/core-util/package.json b/packages/core-util/package.json index e430f24f9..b528c12c5 100644 --- a/packages/core-util/package.json +++ b/packages/core-util/package.json @@ -40,14 +40,14 @@ }, "dependencies": { "@iot-app-kit/core": "*", - "lodash.difference": "4.5.0", + "lodash-es": "^4.17.21", "pako": "^2.1.0", "zustand": "^4.5.2" }, "devDependencies": { "@aws-sdk/types": "^3.696.0", "@iot-app-kit/ts-config": "*", - "@types/lodash.difference": "4.5.9", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@types/pako": "^2.0.3", "@vitest/coverage-v8": "^2.1.5", diff --git a/packages/core-util/src/sdks/colorizer.ts b/packages/core-util/src/sdks/colorizer.ts index 642edc882..867227a8d 100644 --- a/packages/core-util/src/sdks/colorizer.ts +++ b/packages/core-util/src/sdks/colorizer.ts @@ -1,4 +1,4 @@ -import difference from 'lodash.difference'; +import difference from 'lodash-es/difference'; import { colorPalette } from './colorPalette'; type Colorable = { color?: string }; diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json index 7fa220e3c..7bea7cb4a 100644 --- a/packages/dashboard/package.json +++ b/packages/dashboard/package.json @@ -56,7 +56,7 @@ "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", "@types/is-hotkey": "^0.1.7", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@types/papaparse": "^5.3.10", "@types/react": "^18.2.12", @@ -96,7 +96,7 @@ "buffer": "^6.0.3", "dompurify": "^3.1.7", "is-hotkey": "^0.2.0", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "papaparse": "^5.4.1", "parse-duration": "^1.0.3", "react-dnd": "^16.0.1", diff --git a/packages/dashboard/src/components/actions/index.tsx b/packages/dashboard/src/components/actions/index.tsx index fb429be50..51eecb7fb 100644 --- a/packages/dashboard/src/components/actions/index.tsx +++ b/packages/dashboard/src/components/actions/index.tsx @@ -1,4 +1,4 @@ -import { isEqual } from 'lodash'; +import isEqual from 'lodash-es/isEqual'; import { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; diff --git a/packages/dashboard/src/components/dashboard/index.tsx b/packages/dashboard/src/components/dashboard/index.tsx index f8c7825bf..869fa497f 100644 --- a/packages/dashboard/src/components/dashboard/index.tsx +++ b/packages/dashboard/src/components/dashboard/index.tsx @@ -1,16 +1,19 @@ +import '@cloudscape-design/global-styles/index.css'; import type { EdgeMode, Viewport } from '@iot-app-kit/core'; import { isEdgeModeEnabled } from '@iot-app-kit/core'; +import { TimeSync } from '@iot-app-kit/react-components'; import { QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import debounce from 'lodash-es/debounce'; import { memo, useMemo } from 'react'; import { DndProvider } from 'react-dnd'; import { TouchBackend } from 'react-dnd-touch-backend'; +import { FpsView } from 'react-fps'; import { Provider } from 'react-redux'; -import InternalDashboard from '../internalDashboard'; - -import { configureDashboardStore, toDashboardState } from '~/store'; - import { useDashboardPlugins } from '~/customization/api'; +import { PropertiesPanel } from '~/customization/propertiesSections'; +import { queryClient } from '~/data/query-client'; +import { configureDashboardStore, toDashboardState } from '~/store'; import type { AssistantConfiguration, DashboardClientConfiguration, @@ -20,19 +23,13 @@ import type { DashboardToolbar, ViewportChange, } from '~/types'; +import '../../styles/variables.css'; +import InternalDashboard from '../internalDashboard'; import { ClientContext } from './clientContext'; import { getClients } from './getClients'; import { getQueries } from './getQueries'; import { QueryContext } from './queryContext'; -import '@cloudscape-design/global-styles/index.css'; -import { TimeSync } from '@iot-app-kit/react-components'; -import { debounce } from 'lodash'; -import { FpsView } from 'react-fps'; -import { PropertiesPanel } from '~/customization/propertiesSections'; -import { queryClient } from '~/data/query-client'; -import '../../styles/variables.css'; - export type DashboardProperties = { onDashboardConfigurationChange?: DashboardConfigurationChange; onSave?: DashboardSave; diff --git a/packages/dashboard/src/components/dashboard/view.tsx b/packages/dashboard/src/components/dashboard/view.tsx index 90163d750..4269fcd49 100644 --- a/packages/dashboard/src/components/dashboard/view.tsx +++ b/packages/dashboard/src/components/dashboard/view.tsx @@ -1,13 +1,13 @@ +import '@cloudscape-design/global-styles/index.css'; import type { EdgeMode, Viewport } from '@iot-app-kit/core'; import { isEdgeModeEnabled } from '@iot-app-kit/core'; +import { TimeSync } from '@iot-app-kit/react-components'; import { QueryClientProvider } from '@tanstack/react-query'; +import debounce from 'lodash-es/debounce'; import { useMemo } from 'react'; import { DndProvider } from 'react-dnd'; import { TouchBackend } from 'react-dnd-touch-backend'; import { Provider } from 'react-redux'; - -import { TimeSync } from '@iot-app-kit/react-components'; -import { debounce } from 'lodash'; import { useDashboardPlugins } from '~/customization/api'; import { queryClient } from '~/data/query-client'; import { configureDashboardStore, toDashboardState } from '~/store'; @@ -18,15 +18,13 @@ import type { DashboardToolbar, ViewportChange, } from '~/types'; +import '../../styles/variables.css'; import InternalDashboard from '../internalDashboard'; import { ClientContext } from './clientContext'; import { getClients } from './getClients'; import { getQueries } from './getQueries'; import { QueryContext } from './queryContext'; -import '@cloudscape-design/global-styles/index.css'; -import '../../styles/variables.css'; - export type DashboardViewProperties = { clientConfiguration: DashboardClientConfiguration; dashboardConfiguration: DashboardConfiguration; diff --git a/packages/dashboard/src/components/internalDashboard/dashboardHeader.tsx b/packages/dashboard/src/components/internalDashboard/dashboardHeader.tsx index 473f34304..d0cd6118c 100644 --- a/packages/dashboard/src/components/internalDashboard/dashboardHeader.tsx +++ b/packages/dashboard/src/components/internalDashboard/dashboardHeader.tsx @@ -3,12 +3,12 @@ import { type ReactNode, memo } from 'react'; import { Box, Header, SpaceBetween } from '@cloudscape-design/components'; import { TimeSelection, useViewport } from '@iot-app-kit/react-components'; -import Actions from '../actions'; -import type { DashboardSave, DashboardToolbar } from '~/types'; +import isEqual from 'lodash-es/isEqual'; import { useSelector } from 'react-redux'; import { type DashboardState } from '~/store/state'; +import type { DashboardSave, DashboardToolbar } from '~/types'; import { convertToDashboardConfiguration } from '~/util/convertToDashbaoardConfiguration'; -import isEqual from 'lodash/isEqual'; +import Actions from '../actions'; type DashboardHeaderProps = { name?: string; diff --git a/packages/dashboard/src/components/internalDashboard/keyboardShortcuts.ts b/packages/dashboard/src/components/internalDashboard/keyboardShortcuts.ts index bab40f580..b3c618238 100644 --- a/packages/dashboard/src/components/internalDashboard/keyboardShortcuts.ts +++ b/packages/dashboard/src/components/internalDashboard/keyboardShortcuts.ts @@ -1,5 +1,7 @@ +import isFunction from 'lodash-es/isFunction'; import { useCallback } from 'react'; import { useDispatch } from 'react-redux'; +import { useSelectedWidgets } from '~/hooks/useSelectedWidgets'; import { useKeyPress } from '../../hooks/useKeyPress'; import { onBringWidgetsToFrontAction, @@ -10,8 +12,6 @@ import { onSendWidgetsToBackAction, } from '../../store/actions'; import { DASHBOARD_CONTAINER_ID } from '../grid/getDashboardPosition'; -import { useSelectedWidgets } from '~/hooks/useSelectedWidgets'; -import { isFunction } from 'lodash'; type useKeyboardShortcutsProps = { deleteWidgets?: () => void; diff --git a/packages/dashboard/src/components/internalDashboard/useLayers.ts b/packages/dashboard/src/components/internalDashboard/useLayers.ts index 19d754bb7..217755207 100644 --- a/packages/dashboard/src/components/internalDashboard/useLayers.ts +++ b/packages/dashboard/src/components/internalDashboard/useLayers.ts @@ -1,6 +1,6 @@ +import max from 'lodash-es/max'; +import min from 'lodash-es/min'; import { useSelector } from 'react-redux'; -import max from 'lodash/max'; -import min from 'lodash/min'; import type { DashboardState } from '~/store/state'; type Layers = { diff --git a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuery.ts b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuery.ts index 7dc80c766..7dbe0247c 100644 --- a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuery.ts +++ b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuery.ts @@ -1,14 +1,14 @@ -import { type DashboardState } from '~/store/state'; -import { isEqual } from 'lodash'; +import { type AssetResource } from '@iot-app-kit/react-components'; +import isEqual from 'lodash-es/isEqual'; +import { useCallback, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; +import { onUpdateWidgetsAction } from '~/store/actions'; +import { type DashboardState } from '~/store/state'; import { type QueryConfigWidget, findModelBasedQueryWidgets, hasModelBasedQuery, } from './findModelBasedQueryWidgets'; -import { useCallback, useMemo } from 'react'; -import { onUpdateWidgetsAction } from '~/store/actions'; -import { type AssetResource } from '@iot-app-kit/react-components'; export const useModelBasedQuery = () => { const dispatch = useDispatch(); diff --git a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuerySelection.ts b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuerySelection.ts index c31db7e6c..50f4d48c3 100644 --- a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuerySelection.ts +++ b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/modelBasedQuery/useModelBasedQuerySelection.ts @@ -1,18 +1,18 @@ -import { useSelection } from '~/customization/propertiesSection'; -import { - type QueryConfigWidget, - isQueryWidget, -} from './findModelBasedQueryWidgets'; -import { type QueryProperties } from '~/customization/widgets/types'; -import { isJust, maybeWithDefault } from '~/util/maybe'; -import { noop } from 'lodash'; import { - type AssetModelQuery, type AlarmAssetModelQuery, + type AssetModelQuery, } from '@iot-app-kit/source-iotsitewise'; +import noop from 'lodash-es/noop'; import { styledQueryWidgetOnDrop } from '~/components/queryEditor/useQuery'; +import { useSelection } from '~/customization/propertiesSection'; +import { type QueryProperties } from '~/customization/widgets/types'; import { assignDefaultStyles } from '~/customization/widgets/utils/assignDefaultStyleSettings'; import { type IoTSiteWiseDataStreamQuery } from '~/types'; +import { isJust, maybeWithDefault } from '~/util/maybe'; +import { + type QueryConfigWidget, + isQueryWidget, +} from './findModelBasedQueryWidgets'; const mergeAssetModelProperties = ( currentQuery: QueryConfigWidget['properties']['queryConfig']['query'], diff --git a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/useSelectedAssetModelProperties.ts b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/useSelectedAssetModelProperties.ts index 869f52b4f..0162e75b4 100644 --- a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/useSelectedAssetModelProperties.ts +++ b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/assetModelDataStreamExplorer/useSelectedAssetModelProperties.ts @@ -1,10 +1,10 @@ -import { useState } from 'react'; -import { isEqual } from 'lodash'; -import { useCustomCompareEffect } from 'react-use'; import { type AssetPropertyExplorerProps, type AssetPropertyResource, } from '@iot-app-kit/react-components'; +import isEqual from 'lodash-es/isEqual'; +import { useState } from 'react'; +import { useCustomCompareEffect } from 'react-use'; export const useSelectedAssetModelProperties = ( initialAssetModelProperties: NonNullable< diff --git a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/footer/disableAdd.ts b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/footer/disableAdd.ts index 440f8d71a..523b83c99 100644 --- a/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/footer/disableAdd.ts +++ b/packages/dashboard/src/components/queryEditor/iotSiteWiseQueryEditor/footer/disableAdd.ts @@ -1,4 +1,4 @@ -import { get } from 'lodash'; +import get from 'lodash-es/get'; import { type DashboardWidget } from '~/types'; export const disableAdd = ( diff --git a/packages/dashboard/src/components/widgets/list.tsx b/packages/dashboard/src/components/widgets/list.tsx index 34bac625a..7db569b17 100644 --- a/packages/dashboard/src/components/widgets/list.tsx +++ b/packages/dashboard/src/components/widgets/list.tsx @@ -1,6 +1,6 @@ import type { SiteWiseQuery } from '@iot-app-kit/source-iotsitewise'; -import includes from 'lodash/includes'; -import map from 'lodash/map'; +import includes from 'lodash-es/includes'; +import map from 'lodash-es/map'; import type { DashboardMessages } from '~/messages'; import { type DashboardState } from '~/store/state'; import type { DashboardWidget } from '~/types'; diff --git a/packages/dashboard/src/customization/hooks/useIsSelected.ts b/packages/dashboard/src/customization/hooks/useIsSelected.ts index 106a63554..79bd9d6ef 100644 --- a/packages/dashboard/src/customization/hooks/useIsSelected.ts +++ b/packages/dashboard/src/customization/hooks/useIsSelected.ts @@ -1,8 +1,8 @@ -import includes from 'lodash/includes'; -import map from 'lodash/map'; +import includes from 'lodash-es/includes'; +import map from 'lodash-es/map'; import { useCallback } from 'react'; -import type { DashboardWidget } from '~/types'; import { useSelectedWidgets } from '~/hooks/useSelectedWidgets'; +import type { DashboardWidget } from '~/types'; /** * Helper hook that can be exposed to consumers making their own widget components diff --git a/packages/dashboard/src/customization/propertiesSection.ts b/packages/dashboard/src/customization/propertiesSection.ts index dcb668f2c..3bbba5721 100644 --- a/packages/dashboard/src/customization/propertiesSection.ts +++ b/packages/dashboard/src/customization/propertiesSection.ts @@ -1,7 +1,7 @@ +import isEqual from 'lodash-es/isEqual'; import type * as React from 'react'; import { useDispatch } from 'react-redux'; -import isEqual from 'lodash/isEqual'; - +import { useSelectedWidgets } from '~/hooks/useSelectedWidgets'; import { onMoveWidgetsAction, onResizeWidgetsAction, @@ -9,9 +9,8 @@ import { } from '~/store/actions'; import { type DashboardWidget, type Rect } from '~/types'; import { getSelectionBox } from '~/util/getSelectionBox'; -import { useSelectedWidgets } from '~/hooks/useSelectedWidgets'; -import { trimRectPosition } from '~/util/trimRectPosition'; import { Just, type Maybe, Nothing } from '~/util/maybe'; +import { trimRectPosition } from '~/util/trimRectPosition'; /** * Predicate function type for dashboard widgets diff --git a/packages/dashboard/src/customization/propertiesSections/shared/styleExpandableSection/styleExpandableSection.tsx b/packages/dashboard/src/customization/propertiesSections/shared/styleExpandableSection/styleExpandableSection.tsx index be26b92c4..4bc277542 100644 --- a/packages/dashboard/src/customization/propertiesSections/shared/styleExpandableSection/styleExpandableSection.tsx +++ b/packages/dashboard/src/customization/propertiesSections/shared/styleExpandableSection/styleExpandableSection.tsx @@ -1,5 +1,5 @@ import Toggle from '@cloudscape-design/components/toggle'; -import { isFunction } from 'lodash'; +import isFunction from 'lodash-es/isFunction'; import { type ReactNode } from 'react'; import { StyledExpandableSection } from '../../components/styledComponents'; import { useExpandable } from '../useExpandable'; diff --git a/packages/dashboard/src/customization/propertiesSections/yAxisSettings/index.tsx b/packages/dashboard/src/customization/propertiesSections/yAxisSettings/index.tsx index 95970c0f0..f37404915 100644 --- a/packages/dashboard/src/customization/propertiesSections/yAxisSettings/index.tsx +++ b/packages/dashboard/src/customization/propertiesSections/yAxisSettings/index.tsx @@ -1,12 +1,12 @@ import type { FC } from 'react'; +import Box from '@cloudscape-design/components/box'; import FormField from '@cloudscape-design/components/form-field'; import Input from '@cloudscape-design/components/input'; -import Box from '@cloudscape-design/components/box'; -import StyleExpandableSection from '../shared/styleExpandableSection/styleExpandableSection'; +import isFunction from 'lodash-es/isFunction'; import { FormLabel } from '../components/styledComponents'; -import { isFunction } from 'lodash'; +import StyleExpandableSection from '../shared/styleExpandableSection/styleExpandableSection'; type YAxisSectionOptions = { visible?: boolean; diff --git a/packages/dashboard/src/customization/widgets/gauge/component.tsx b/packages/dashboard/src/customization/widgets/gauge/component.tsx index 3b2d9a37a..c196c6b0d 100644 --- a/packages/dashboard/src/customization/widgets/gauge/component.tsx +++ b/packages/dashboard/src/customization/widgets/gauge/component.tsx @@ -1,6 +1,6 @@ import { Box } from '@cloudscape-design/components'; import { Gauge, useViewport } from '@iot-app-kit/react-components'; -import pickBy from 'lodash/pickBy'; +import pickBy from 'lodash-es/pickBy'; import { useSelector } from 'react-redux'; import { useQueries } from '~/components/dashboard/queryContext'; import WidgetTile from '~/components/widgets/tile'; diff --git a/packages/dashboard/src/customization/widgets/kpi/component.tsx b/packages/dashboard/src/customization/widgets/kpi/component.tsx index 8b6563f63..b70174c48 100644 --- a/packages/dashboard/src/customization/widgets/kpi/component.tsx +++ b/packages/dashboard/src/customization/widgets/kpi/component.tsx @@ -1,6 +1,6 @@ import { Box } from '@cloudscape-design/components'; import { KPI, useViewport } from '@iot-app-kit/react-components'; -import pickBy from 'lodash/pickBy'; +import pickBy from 'lodash-es/pickBy'; import { useSelector } from 'react-redux'; import { useQueries } from '~/components/dashboard/queryContext'; import type { DashboardState } from '~/store/state'; diff --git a/packages/dashboard/src/customization/widgets/status/component.tsx b/packages/dashboard/src/customization/widgets/status/component.tsx index 9fbfd1228..035571237 100644 --- a/packages/dashboard/src/customization/widgets/status/component.tsx +++ b/packages/dashboard/src/customization/widgets/status/component.tsx @@ -1,6 +1,6 @@ import { Box } from '@cloudscape-design/components'; import { Status, useViewport } from '@iot-app-kit/react-components'; -import pickBy from 'lodash/pickBy'; +import pickBy from 'lodash-es/pickBy'; import { useSelector } from 'react-redux'; import { useQueries } from '~/components/dashboard/queryContext'; import WidgetTile from '~/components/widgets/tile/tile'; diff --git a/packages/dashboard/src/customization/widgets/utils/alarmModelQueryToAlarmQuery.ts b/packages/dashboard/src/customization/widgets/utils/alarmModelQueryToAlarmQuery.ts index 69db818af..7a2bc7636 100644 --- a/packages/dashboard/src/customization/widgets/utils/alarmModelQueryToAlarmQuery.ts +++ b/packages/dashboard/src/customization/widgets/utils/alarmModelQueryToAlarmQuery.ts @@ -2,8 +2,8 @@ import { type AlarmAssetModelQuery, type SiteWiseAlarmQuery, } from '@iot-app-kit/source-iotsitewise'; -import uniq from 'lodash/uniq'; -import unionBy from 'lodash/unionBy'; +import unionBy from 'lodash-es/unionBy'; +import uniq from 'lodash-es/uniq'; import { type IoTSiteWiseDataStreamQuery } from '~/types'; type AlarmModelQueryWithAssetId = Required; diff --git a/packages/dashboard/src/customization/widgets/utils/assetModelQueryToAssetQuery.ts b/packages/dashboard/src/customization/widgets/utils/assetModelQueryToAssetQuery.ts index 4e8eb5797..8feaebdad 100644 --- a/packages/dashboard/src/customization/widgets/utils/assetModelQueryToAssetQuery.ts +++ b/packages/dashboard/src/customization/widgets/utils/assetModelQueryToAssetQuery.ts @@ -2,10 +2,8 @@ import { type AssetModelQuery, type SiteWiseAssetQuery, } from '@iot-app-kit/source-iotsitewise'; - -import unionBy from 'lodash/unionBy'; -import uniq from 'lodash/uniq'; - +import unionBy from 'lodash-es/unionBy'; +import uniq from 'lodash-es/uniq'; import { type IoTSiteWiseDataStreamQuery } from '~/types'; type AssetModelQueryWithAssetId = Required; diff --git a/packages/dashboard/src/customization/widgets/utils/assetQuery/defaultColors.ts b/packages/dashboard/src/customization/widgets/utils/assetQuery/defaultColors.ts index 2152ec275..53edf3113 100644 --- a/packages/dashboard/src/customization/widgets/utils/assetQuery/defaultColors.ts +++ b/packages/dashboard/src/customization/widgets/utils/assetQuery/defaultColors.ts @@ -1,8 +1,6 @@ -import uniq from 'lodash/uniq'; - import { type StyleSettingsMap } from '@iot-app-kit/core'; import { Colorizer } from '@iot-app-kit/core-util'; - +import uniq from 'lodash-es/uniq'; import { createNonNullableList } from '~/helpers/lists/createNonNullableList'; import { type StyledAssetQuery } from '../../types'; diff --git a/packages/dashboard/src/hooks/useSelectedWidgets.ts b/packages/dashboard/src/hooks/useSelectedWidgets.ts index d1223efd1..87a0daa21 100644 --- a/packages/dashboard/src/hooks/useSelectedWidgets.ts +++ b/packages/dashboard/src/hooks/useSelectedWidgets.ts @@ -1,9 +1,7 @@ +import isEqual from 'lodash-es/isEqual'; import { useSelector } from 'react-redux'; - -import isEqual from 'lodash/isEqual'; - -import { type DashboardWidget } from '~/types'; import type { DashboardState } from '~/store/state'; +import { type DashboardWidget } from '~/types'; const compareSelectedWidgets = (a: DashboardWidget[], b: DashboardWidget[]) => isEqual(a, b); diff --git a/packages/dashboard/src/hooks/useStableDashboardConfiguration.ts b/packages/dashboard/src/hooks/useStableDashboardConfiguration.ts index d0180e5bf..0befa826d 100644 --- a/packages/dashboard/src/hooks/useStableDashboardConfiguration.ts +++ b/packages/dashboard/src/hooks/useStableDashboardConfiguration.ts @@ -1,12 +1,12 @@ -import { useCallback, useEffect, useRef, useState, useMemo } from 'react'; -import noop from 'lodash/noop'; -import throttle from 'lodash/throttle'; -import isEqual from 'lodash/isEqual'; +import { type Viewport } from '@iot-app-kit/core'; +import isEqual from 'lodash-es/isEqual'; +import noop from 'lodash-es/noop'; +import throttle from 'lodash-es/throttle'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { type DashboardConfiguration, type DashboardConfigurationChange, } from '~/types'; -import { type Viewport } from '@iot-app-kit/core'; export const useStableDashboardConfiguration = ({ dashboardConfiguration, diff --git a/packages/dashboard/src/hooks/useSyncDashboardConfiguration.ts b/packages/dashboard/src/hooks/useSyncDashboardConfiguration.ts index f7628bfac..23cd60787 100644 --- a/packages/dashboard/src/hooks/useSyncDashboardConfiguration.ts +++ b/packages/dashboard/src/hooks/useSyncDashboardConfiguration.ts @@ -1,7 +1,7 @@ +import isEqual from 'lodash-es/isEqual'; +import noop from 'lodash-es/noop'; import { useEffect } from 'react'; import { useSelector } from 'react-redux'; -import noop from 'lodash/noop'; -import isEqual from 'lodash/isEqual'; import { type DashboardConfigurationChange } from '~/types'; import { convertToDashboardConfiguration } from '~/util/convertToDashbaoardConfiguration'; diff --git a/packages/dashboard/src/store/actions/assistantWidgetsSelection/index.ts b/packages/dashboard/src/store/actions/assistantWidgetsSelection/index.ts index a698c8dd7..86b12562c 100644 --- a/packages/dashboard/src/store/actions/assistantWidgetsSelection/index.ts +++ b/packages/dashboard/src/store/actions/assistantWidgetsSelection/index.ts @@ -1,6 +1,6 @@ +import uniqBy from 'lodash-es/uniqBy'; import type { Action } from 'redux'; import type { DashboardState } from '../../state'; -import { uniqBy } from 'lodash'; export type AssistantSelectWidgetsActionPayload = { widgetId: string; diff --git a/packages/dashboard/src/store/actions/bringToFront/index.ts b/packages/dashboard/src/store/actions/bringToFront/index.ts index a53b36bd2..c80331b12 100644 --- a/packages/dashboard/src/store/actions/bringToFront/index.ts +++ b/packages/dashboard/src/store/actions/bringToFront/index.ts @@ -1,7 +1,7 @@ -import xorBy from 'lodash/xorBy'; -import maxBy from 'lodash/maxBy'; -import minBy from 'lodash/minBy'; import type { PayloadAction } from '@reduxjs/toolkit'; +import maxBy from 'lodash-es/maxBy'; +import minBy from 'lodash-es/minBy'; +import xorBy from 'lodash-es/xorBy'; import type { DashboardState } from '../../state'; export interface BringWidgetsToFrontAction extends PayloadAction { diff --git a/packages/dashboard/src/store/actions/copyWidgets/index.ts b/packages/dashboard/src/store/actions/copyWidgets/index.ts index 4c19a61f3..8dd583688 100644 --- a/packages/dashboard/src/store/actions/copyWidgets/index.ts +++ b/packages/dashboard/src/store/actions/copyWidgets/index.ts @@ -1,4 +1,4 @@ -import intersectionBy from 'lodash/intersectionBy'; +import intersectionBy from 'lodash-es/intersectionBy'; import type { Action } from 'redux'; import type { DashboardWidget } from '~/types'; import type { DashboardState } from '../../state'; diff --git a/packages/dashboard/src/store/actions/pasteWidgets/index.ts b/packages/dashboard/src/store/actions/pasteWidgets/index.ts index e541ae18d..177ae490b 100644 --- a/packages/dashboard/src/store/actions/pasteWidgets/index.ts +++ b/packages/dashboard/src/store/actions/pasteWidgets/index.ts @@ -1,7 +1,8 @@ -import { minBy, max } from 'lodash'; -import { v4 } from 'uuid'; +import max from 'lodash-es/max'; +import minBy from 'lodash-es/minBy'; import type { Action } from 'redux'; -import type { Position, DashboardWidget } from '~/types'; +import { v4 } from 'uuid'; +import type { DashboardWidget, Position } from '~/types'; import type { DashboardState } from '../../state'; type PasteWidgetsActionPayload = { diff --git a/packages/dashboard/src/store/actions/selectWidgets/index.ts b/packages/dashboard/src/store/actions/selectWidgets/index.ts index a5c024163..99be81b1b 100644 --- a/packages/dashboard/src/store/actions/selectWidgets/index.ts +++ b/packages/dashboard/src/store/actions/selectWidgets/index.ts @@ -1,4 +1,4 @@ -import uniqBy from 'lodash/uniqBy'; +import uniqBy from 'lodash-es/uniqBy'; import type { Action } from 'redux'; import type { DashboardWidget } from '~/types'; import type { DashboardState } from '../../state'; diff --git a/packages/dashboard/src/store/actions/sendToBack/index.ts b/packages/dashboard/src/store/actions/sendToBack/index.ts index 89a9604b1..f2f1380de 100644 --- a/packages/dashboard/src/store/actions/sendToBack/index.ts +++ b/packages/dashboard/src/store/actions/sendToBack/index.ts @@ -1,7 +1,7 @@ -import xorBy from 'lodash/xorBy'; -import maxBy from 'lodash/maxBy'; -import minBy from 'lodash/minBy'; import type { PayloadAction } from '@reduxjs/toolkit'; +import maxBy from 'lodash-es/maxBy'; +import minBy from 'lodash-es/minBy'; +import xorBy from 'lodash-es/xorBy'; import type { DashboardState } from '../../state'; export interface SendWidgetsToBackAction extends PayloadAction { diff --git a/packages/dashboard/src/store/index.ts b/packages/dashboard/src/store/index.ts index 4aaf7f270..038cef274 100644 --- a/packages/dashboard/src/store/index.ts +++ b/packages/dashboard/src/store/index.ts @@ -1,6 +1,6 @@ import { configureStore } from '@reduxjs/toolkit'; -import cloneDeep from 'lodash/cloneDeep'; -import merge from 'lodash/merge'; +import cloneDeep from 'lodash-es/cloneDeep'; +import merge from 'lodash-es/merge'; import type { Store } from 'redux'; import type { PartialDeep } from 'type-fest'; import type { DashboardConfiguration } from '~/types'; diff --git a/packages/dashboard/src/util/mergeAssetQueries.ts b/packages/dashboard/src/util/mergeAssetQueries.ts index 6e09dcfb0..aad65d0c5 100644 --- a/packages/dashboard/src/util/mergeAssetQueries.ts +++ b/packages/dashboard/src/util/mergeAssetQueries.ts @@ -1,5 +1,5 @@ -import unionWith from 'lodash/unionWith'; import type { SiteWiseAssetQuery } from '@iot-app-kit/source-iotsitewise'; +import unionWith from 'lodash-es/unionWith'; export const mergeAssetQueries = ( currentQueries: SiteWiseAssetQuery['assets'], diff --git a/packages/dashboard/src/util/select.ts b/packages/dashboard/src/util/select.ts index c765655cd..5a9dff8fb 100644 --- a/packages/dashboard/src/util/select.ts +++ b/packages/dashboard/src/util/select.ts @@ -1,7 +1,7 @@ -import last from 'lodash/last'; -import sortBy from 'lodash/sortBy'; +import last from 'lodash-es/last'; +import sortBy from 'lodash-es/sortBy'; +import type { DashboardWidget, Position, Rect, Selection } from '~/types'; import { overlaps } from './overlaps'; -import type { Position, Rect, Selection, DashboardWidget } from '~/types'; export const getSelectedWidgets = ({ selectedRect, diff --git a/packages/dashboard/testing/mocks.ts b/packages/dashboard/testing/mocks.ts index f92aacffe..7b8893c12 100644 --- a/packages/dashboard/testing/mocks.ts +++ b/packages/dashboard/testing/mocks.ts @@ -1,6 +1,6 @@ import type { DataPoint, TimeSeriesData } from '@iot-app-kit/core'; import { DATA_TYPE } from '@iot-app-kit/core'; -import random from 'lodash/random'; +import random from 'lodash-es/random'; import { type BarChartWidget, type KPIWidget, @@ -15,10 +15,9 @@ import { * Shared mocks for testing purposes */ import { - type DashboardWidgetsConfiguration, type DashboardWidget, + type DashboardWidgetsConfiguration, } from '../src/types'; - import { DEMO_TURBINE_ASSET_1, DEMO_TURBINE_ASSET_1_PROPERTY_1, diff --git a/packages/react-components/package.json b/packages/react-components/package.json index cf0705436..bb1af8523 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -78,16 +78,7 @@ "@types/d3": "^7.4.0", "@types/dompurify": "3.0.2", "@types/is-hotkey": "^0.1.7", - "@types/lodash.difference": "4.5.9", - "@types/lodash.differenceby": "4.8.9", - "@types/lodash.groupby": "4.6.9", - "@types/lodash.isequal": "4.5.8", - "@types/lodash.maxby": "4.6.7", - "@types/lodash.merge": "4.6.7", - "@types/lodash.minby": "4.6.7", - "@types/lodash.omitby": "^4.6.7", - "@types/lodash.takeright": "4.1.9", - "@types/lodash.throttle": "4.1.7", + "@types/lodash-es": "^4.17.12", "@types/luxon": "^3.4.2", "@types/node": "^18.16.18", "@types/react": "^18.2.12", @@ -143,16 +134,7 @@ "dompurify": "^3.1.7", "echarts": "^5.4.3", "is-hotkey": "^0.2.0", - "lodash.difference": "4.5.0", - "lodash.differenceby": "4.8.0", - "lodash.groupby": "4.6.0", - "lodash.isequal": "4.5.0", - "lodash.maxby": "4.6.0", - "lodash.merge": "4.6.2", - "lodash.minby": "4.6.0", - "lodash.omitby": "^4.6.0", - "lodash.takeright": "^4.1.1", - "lodash.throttle": "^4.1.1", + "lodash-es": "^4.17.21", "luxon": "^3.5.0", "parse-duration": "^1.0.3", "react-cytoscapejs": "^2.0.0", diff --git a/packages/react-components/src/components/anomaly-chart/converters/convertXAxis.ts b/packages/react-components/src/components/anomaly-chart/converters/convertXAxis.ts index 86ea931f0..52f3b222b 100644 --- a/packages/react-components/src/components/anomaly-chart/converters/convertXAxis.ts +++ b/packages/react-components/src/components/anomaly-chart/converters/convertXAxis.ts @@ -1,10 +1,10 @@ -import merge from 'lodash.merge'; -import { ANOMALY_X_AXIS } from '../constants'; -import { type ConfigurationOptions } from '../hooks/types'; +import merge from 'lodash-es/merge'; import { - getPatternForXAxisLabelForAnomalyChart, formatDate, + getPatternForXAxisLabelForAnomalyChart, } from '../../../utils/time'; +import { ANOMALY_X_AXIS } from '../constants'; +import { type ConfigurationOptions } from '../hooks/types'; export const convertXAxis = ({ axis, timeZone }: ConfigurationOptions) => { const show = axis?.showX ?? true; diff --git a/packages/react-components/src/components/anomaly-chart/hooks/useAnomalyEchart.ts b/packages/react-components/src/components/anomaly-chart/hooks/useAnomalyEchart.ts index 5b19b03b4..14c504cb4 100644 --- a/packages/react-components/src/components/anomaly-chart/hooks/useAnomalyEchart.ts +++ b/packages/react-components/src/components/anomaly-chart/hooks/useAnomalyEchart.ts @@ -1,5 +1,12 @@ import { type Viewport } from '@iot-app-kit/core'; -import { type ConfigurationOptions, type DataSetOptions } from './types'; +import isEqual from 'lodash-es/isEqual'; +import merge from 'lodash-es/merge'; +import { useEffect, useReducer } from 'react'; +import { useCustomCompareEffect } from 'react-use'; +import { type AnomalyData } from '../../../data'; +import { useZoomableECharts } from '../../../hooks/useECharts/useZoomableECharts'; +import { type UtilizedViewportType } from '../../../hooks/useViewport/useUtilizedViewport'; +import { DEFAULT_ANOMALY_WIDGET_SETTINGS } from '../constants'; import { convertDataset, convertGrid, @@ -9,14 +16,7 @@ import { convertXAxis, convertYAxis, } from '../converters'; -import { type AnomalyData } from '../../../data'; -import { useEffect, useReducer } from 'react'; -import { useCustomCompareEffect } from 'react-use'; -import isEqual from 'lodash.isequal'; -import { DEFAULT_ANOMALY_WIDGET_SETTINGS } from '../constants'; -import { useZoomableECharts } from '../../../hooks/useECharts/useZoomableECharts'; -import merge from 'lodash.merge'; -import { type UtilizedViewportType } from '../../../hooks/useViewport/useUtilizedViewport'; +import { type ConfigurationOptions, type DataSetOptions } from './types'; type AnomalyChartOptionState = { series: ReturnType; diff --git a/packages/react-components/src/components/bar-chart/hooks/useBarChartAlarms.ts b/packages/react-components/src/components/bar-chart/hooks/useBarChartAlarms.ts index fef5a0893..afb3475b3 100644 --- a/packages/react-components/src/components/bar-chart/hooks/useBarChartAlarms.ts +++ b/packages/react-components/src/components/bar-chart/hooks/useBarChartAlarms.ts @@ -1,10 +1,3 @@ -import { useState } from 'react'; -import { useAlarmsFromQueries } from '../../../hooks/useAlarmsFromQueries'; -import { useCustomCompareEffect } from 'react-use'; -import isEqual from 'lodash.isequal'; -import { type BarChartProps } from '../barChart'; -import { transformAlarmsToThreshold } from '../../../utils/transformAlarmsToThreshold'; -import { type AlarmData } from '../../../hooks/useAlarms'; import { type DataStream, type Primitive, @@ -13,6 +6,13 @@ import { type ThresholdValue, } from '@iot-app-kit/core'; import { toId } from '@iot-app-kit/source-iotsitewise'; +import isEqual from 'lodash-es/isEqual'; +import { useState } from 'react'; +import { useCustomCompareEffect } from 'react-use'; +import { type AlarmData } from '../../../hooks/useAlarms'; +import { useAlarmsFromQueries } from '../../../hooks/useAlarmsFromQueries'; +import { transformAlarmsToThreshold } from '../../../utils/transformAlarmsToThreshold'; +import { type BarChartProps } from '../barChart'; type UseBarChartAlarmOptions = Pick & { resolutionConfig?: ResolutionConfig; diff --git a/packages/react-components/src/components/chart/chartOptions/style/convertStyles.ts b/packages/react-components/src/components/chart/chartOptions/style/convertStyles.ts index 278642cf6..3c52d6b1c 100644 --- a/packages/react-components/src/components/chart/chartOptions/style/convertStyles.ts +++ b/packages/react-components/src/components/chart/chartOptions/style/convertStyles.ts @@ -1,4 +1,5 @@ import { type DataStream } from '@iot-app-kit/core'; +import merge from 'lodash-es/merge'; import { type ChartOptions } from '../../types'; import { type ChartStyleSettingsWithDefaults, @@ -6,7 +7,6 @@ import { getDefaultStyles, getStyles, } from '../../utils/getStyles'; -import merge from 'lodash.merge'; type ConvertChartOptions = Pick< ChartOptions, diff --git a/packages/react-components/src/components/chart/chartOptions/useChartConfiguration.ts b/packages/react-components/src/components/chart/chartOptions/useChartConfiguration.ts index 6589feffb..bc659cb00 100644 --- a/packages/react-components/src/components/chart/chartOptions/useChartConfiguration.ts +++ b/packages/react-components/src/components/chart/chartOptions/useChartConfiguration.ts @@ -3,32 +3,32 @@ import { type Threshold, type ThresholdValue, } from '@iot-app-kit/core'; +import { type SeriesOption } from 'echarts'; +import isEqual from 'lodash-es/isEqual'; +import uniqWith from 'lodash-es/uniqWith'; +import { useEffect, useMemo, useRef, useState } from 'react'; +import { type GenericSeries } from '../../../echarts/types'; import { type ChartRef, useGroupableEChart, useLoadableEChart, } from '../../../hooks/useECharts'; +import { createNonNullableList } from '../../../utils/createNonNullableList'; +import { + DEFAULT_DATA_ZOOM, + getDefaultChartOption, + PERFORMANCE_MODE_THRESHOLD, +} from '../eChartsConstants'; +import { type ChartAlarms } from '../hooks/useChartAlarms'; +import { type useNormalizedDataStreams } from '../hooks/useNormalizedDataStreams'; import { type ChartDataQuality, type ChartOptions, type ChartStyleSettings, } from '../types'; import { useXAxis } from './axes/xAxis'; -import { useTooltip } from './tooltip/convertTooltip'; -import { useEffect, useMemo, useRef, useState } from 'react'; -import isEqual from 'lodash.isequal'; -import { uniqWith } from 'lodash'; -import { - getDefaultChartOption, - DEFAULT_DATA_ZOOM, - PERFORMANCE_MODE_THRESHOLD, -} from '../eChartsConstants'; import { useSeriesAndYAxis } from './seriesAndYAxis/convertSeriesAndYAxis'; -import { type SeriesOption } from 'echarts'; -import { type GenericSeries } from '../../../echarts/types'; -import { type useNormalizedDataStreams } from '../hooks/useNormalizedDataStreams'; -import { type ChartAlarms } from '../hooks/useChartAlarms'; -import { createNonNullableList } from '../../../utils/createNonNullableList'; +import { useTooltip } from './tooltip/convertTooltip'; const toDataStreamIdentifiers = ( dataStreams: ReturnType diff --git a/packages/react-components/src/components/chart/hooks/useChartAlarms.ts b/packages/react-components/src/components/chart/hooks/useChartAlarms.ts index 9c4f0bbbd..a3fbdd232 100644 --- a/packages/react-components/src/components/chart/hooks/useChartAlarms.ts +++ b/packages/react-components/src/components/chart/hooks/useChartAlarms.ts @@ -1,21 +1,21 @@ -import { useCallback, useMemo, useState } from 'react'; -import { parseAlarmStateAssetProperty } from '../../../hooks/useAlarms/transformers'; -import { useAlarmsFromQueries } from '../../../hooks/useAlarmsFromQueries/useAlarmsFromQueries'; -import { createNonNullableList } from '../../../utils/createNonNullableList'; -import { type ChartOptions } from '../types'; -import { useCustomCompareEffect } from 'react-use'; -import isEqual from 'lodash.isequal'; -import { type AlarmData } from '../../../hooks/useAlarms'; -import { type AlarmContent } from '../../alarm-components/alarm-content/types'; -import { mapAlarmRuleExpression } from '../../../hooks/useAlarms/transformers/mapAlarmRuleExpression'; -import { toId } from '@iot-app-kit/source-iotsitewise'; import { type DataStream, type Primitive, type Threshold, type ThresholdValue, } from '@iot-app-kit/core'; +import { toId } from '@iot-app-kit/source-iotsitewise'; +import isEqual from 'lodash-es/isEqual'; +import { useCallback, useMemo, useState } from 'react'; +import { useCustomCompareEffect } from 'react-use'; +import { type AlarmData } from '../../../hooks/useAlarms'; +import { parseAlarmStateAssetProperty } from '../../../hooks/useAlarms/transformers'; +import { mapAlarmRuleExpression } from '../../../hooks/useAlarms/transformers/mapAlarmRuleExpression'; +import { useAlarmsFromQueries } from '../../../hooks/useAlarmsFromQueries/useAlarmsFromQueries'; +import { createNonNullableList } from '../../../utils/createNonNullableList'; import { transformAlarmsToThreshold } from '../../../utils/transformAlarmsToThreshold'; +import { type AlarmContent } from '../../alarm-components/alarm-content/types'; +import { type ChartOptions } from '../types'; type UseChartAlarmOptions = Pick; diff --git a/packages/react-components/src/components/chart/hooks/useChartStoreDataStreamsSync.ts b/packages/react-components/src/components/chart/hooks/useChartStoreDataStreamsSync.ts index 6e4c5dffd..465782319 100644 --- a/packages/react-components/src/components/chart/hooks/useChartStoreDataStreamsSync.ts +++ b/packages/react-components/src/components/chart/hooks/useChartStoreDataStreamsSync.ts @@ -1,6 +1,6 @@ -import { useEffect } from 'react'; -import differenceBy from 'lodash.differenceby'; import { type DataStream } from '@iot-app-kit/core'; +import differenceBy from 'lodash-es/differenceBy'; +import { useEffect } from 'react'; import { type DataStreamMetaData } from '../chartOptions/useChartConfiguration'; import { useHighlightedDataStreams } from './useHighlightedDataStreams'; import { useVisibleDataStreams } from './useVisibleDataStreams'; diff --git a/packages/react-components/src/components/chart/hooks/useDataStreamMaxMin.ts b/packages/react-components/src/components/chart/hooks/useDataStreamMaxMin.ts index 1f652b199..ee53923b5 100644 --- a/packages/react-components/src/components/chart/hooks/useDataStreamMaxMin.ts +++ b/packages/react-components/src/components/chart/hooks/useDataStreamMaxMin.ts @@ -1,4 +1,4 @@ -import isEqual from 'lodash.isequal'; +import isEqual from 'lodash-es/isEqual'; import { useChartStore } from '../store'; export const useDataStreamMaxMin = () => { diff --git a/packages/react-components/src/components/chart/hooks/useHighlightedDataStreams.ts b/packages/react-components/src/components/chart/hooks/useHighlightedDataStreams.ts index 465679447..f8e11917e 100644 --- a/packages/react-components/src/components/chart/hooks/useHighlightedDataStreams.ts +++ b/packages/react-components/src/components/chart/hooks/useHighlightedDataStreams.ts @@ -1,7 +1,7 @@ +import isEqual from 'lodash-es/isEqual'; import { useCallback } from 'react'; -import isEqual from 'lodash.isequal'; -import { useChartStore } from '../store'; import { isDataStreamInList } from '../../../utils/isDataStreamInList'; +import { useChartStore } from '../store'; import { type DataStreamIdentity } from '../store/contextDataStreams'; export const useHighlightedDataStreams = () => { diff --git a/packages/react-components/src/components/chart/hooks/useNormalizedDataStreams.ts b/packages/react-components/src/components/chart/hooks/useNormalizedDataStreams.ts index 679858e39..9da0b9c2d 100644 --- a/packages/react-components/src/components/chart/hooks/useNormalizedDataStreams.ts +++ b/packages/react-components/src/components/chart/hooks/useNormalizedDataStreams.ts @@ -1,12 +1,12 @@ import { type DataPoint, type DataStream } from '@iot-app-kit/core'; import { fromId, toId } from '@iot-app-kit/source-iotsitewise'; -import { type ChartAlarm, type ChartAlarms } from './useChartAlarms'; -import { createNonNullableList } from '../../../utils/createNonNullableList'; -import { useMemo } from 'react'; import { bisector } from 'd3-array'; -import { uniqWith } from 'lodash'; -import { type AlarmContent } from '../../alarm-components/alarm-content/types'; +import uniqWith from 'lodash-es/uniqWith'; +import { useMemo } from 'react'; import type { AlarmAssistantContext } from '../../../common/assistantProps'; +import { createNonNullableList } from '../../../utils/createNonNullableList'; +import { type AlarmContent } from '../../alarm-components/alarm-content/types'; +import { type ChartAlarm, type ChartAlarms } from './useChartAlarms'; const interpolateY = ( point1: DataPointWithAlarm, diff --git a/packages/react-components/src/components/chart/hooks/useVisibleDataStreams.ts b/packages/react-components/src/components/chart/hooks/useVisibleDataStreams.ts index 587a19b9c..41b086a24 100644 --- a/packages/react-components/src/components/chart/hooks/useVisibleDataStreams.ts +++ b/packages/react-components/src/components/chart/hooks/useVisibleDataStreams.ts @@ -1,7 +1,7 @@ +import isEqual from 'lodash-es/isEqual'; import { useCallback } from 'react'; -import isEqual from 'lodash.isequal'; -import { useChartStore } from '../store'; import { isDataStreamInList } from '../../../utils/isDataStreamInList'; +import { useChartStore } from '../store'; import { type DataStreamIdentity } from '../store/contextDataStreams'; export const useVisibleDataStreams = () => { diff --git a/packages/react-components/src/components/chart/hooks/useVisualizedDataStreams.ts b/packages/react-components/src/components/chart/hooks/useVisualizedDataStreams.ts index e9b20b41e..ef539e88b 100644 --- a/packages/react-components/src/components/chart/hooks/useVisualizedDataStreams.ts +++ b/packages/react-components/src/components/chart/hooks/useVisualizedDataStreams.ts @@ -1,4 +1,3 @@ -import { useEffect, useMemo, useState } from 'react'; import { type DataStream, type StyledThreshold, @@ -7,10 +6,11 @@ import { type Viewport, getVisibleData, } from '@iot-app-kit/core'; -import isEqual from 'lodash.isequal'; +import isEqual from 'lodash-es/isEqual'; +import { useEffect, useMemo, useState } from 'react'; +import { DEFAULT_VIEWPORT, StreamType } from '../../../common/constants'; import { useTimeSeriesData } from '../../../hooks/useTimeSeriesData'; import { useViewport } from '../../../hooks/useViewport'; -import { DEFAULT_VIEWPORT, StreamType } from '../../../common/constants'; const isNotAlarmStream = ({ streamType }: DataStream) => streamType !== StreamType.ALARM; diff --git a/packages/react-components/src/components/gauge/hooks/useGaugeConfiguration.ts b/packages/react-components/src/components/gauge/hooks/useGaugeConfiguration.ts index 673e17016..7c5310ec6 100644 --- a/packages/react-components/src/components/gauge/hooks/useGaugeConfiguration.ts +++ b/packages/react-components/src/components/gauge/hooks/useGaugeConfiguration.ts @@ -1,11 +1,12 @@ -import { useEffect, useReducer } from 'react'; import { type Primitive } from '@iot-app-kit/core'; -import { type ChartRef } from '../../../hooks/useECharts'; -import { type GaugeConfigurationOptions } from '../types'; -import { isEqual, merge } from 'lodash'; +import isEqual from 'lodash-es/isEqual'; +import merge from 'lodash-es/merge'; +import { useEffect, useReducer } from 'react'; import { useCustomCompareEffect } from 'react-use'; -import { convertSeries } from '../converters/convertSeries'; +import { type ChartRef } from '../../../hooks/useECharts'; import { convertDataset } from '../converters/convertDataset'; +import { convertSeries } from '../converters/convertSeries'; +import { type GaugeConfigurationOptions } from '../types'; type GaugeOptionState = { series: ReturnType; diff --git a/packages/react-components/src/components/kpi/kpiBase.tsx b/packages/react-components/src/components/kpi/kpiBase.tsx index 79bfeb00f..20cbc7ff8 100644 --- a/packages/react-components/src/components/kpi/kpiBase.tsx +++ b/packages/react-components/src/components/kpi/kpiBase.tsx @@ -4,7 +4,7 @@ import { fontSizeBodyS, spaceStaticXs, } from '@cloudscape-design/design-tokens'; -import omitBy from 'lodash.omitby'; +import omitBy from 'lodash-es/omitBy'; import { DEFAULT_DECIMAL_PLACES } from '../../common/constants'; import { Title } from '../../common/title'; import { getAggregationFrequency } from '../../utils/aggregationFrequency'; diff --git a/packages/react-components/src/data/transformers/anomaly/object/transformer.ts b/packages/react-components/src/data/transformers/anomaly/object/transformer.ts index 65f69ed72..bcc07c78b 100644 --- a/packages/react-components/src/data/transformers/anomaly/object/transformer.ts +++ b/packages/react-components/src/data/transformers/anomaly/object/transformer.ts @@ -1,12 +1,16 @@ -import unique from 'lodash/uniq'; - +import { isAfter, isBefore } from 'date-fns'; +import unique from 'lodash-es/uniq'; import { type DataSource } from '../../../types'; - import { type ObjectDataSource, ObjectDataSourceTransformer, type ObjectDataSourceValue, } from '../../object'; +import { + type AnomalyData, + type AnomalyDescription, + type DiagnosticData, +} from '../output'; import { type AnomalyObjectDataSource } from './datasource'; import { type AnomalyObjectDataInput, @@ -14,12 +18,6 @@ import { type Diagnostic, type Diagnostics, } from './input'; -import { isAfter, isBefore } from 'date-fns'; -import { - type AnomalyData, - type AnomalyDescription, - type DiagnosticData, -} from '../output'; /** * there can be points that have an anomaly score diff --git a/packages/react-components/src/echarts/extensions/minMaxDataStreamValues/updateDataStreamMinMax.ts b/packages/react-components/src/echarts/extensions/minMaxDataStreamValues/updateDataStreamMinMax.ts index 18a541ec0..3fb3b21f4 100644 --- a/packages/react-components/src/echarts/extensions/minMaxDataStreamValues/updateDataStreamMinMax.ts +++ b/packages/react-components/src/echarts/extensions/minMaxDataStreamValues/updateDataStreamMinMax.ts @@ -1,7 +1,7 @@ import type Grid from 'echarts/types/src/coord/cartesian/Grid.js'; import { type LifecycleEvents } from 'echarts/types/src/core/lifecycle.js'; import { type EChartsExtensionInstallRegisters } from 'echarts/types/src/extension.js'; -import throttle from 'lodash.throttle'; +import throttle from 'lodash-es/throttle'; import useDataStore from '../../../store'; import { findMinMax } from './minMaxDataStreamSync'; diff --git a/packages/react-components/src/echarts/extensions/trendCursors/hooks/useThrottledTrendCursorValues.ts b/packages/react-components/src/echarts/extensions/trendCursors/hooks/useThrottledTrendCursorValues.ts index 9fc14201b..9ca4358c9 100644 --- a/packages/react-components/src/echarts/extensions/trendCursors/hooks/useThrottledTrendCursorValues.ts +++ b/packages/react-components/src/echarts/extensions/trendCursors/hooks/useThrottledTrendCursorValues.ts @@ -1,4 +1,4 @@ -import throttle from 'lodash.throttle'; +import throttle from 'lodash-es/throttle'; import { useEffect, useRef, useState } from 'react'; import useDataStore, { type StateData } from '../../../../store'; import { diff --git a/packages/react-components/src/echarts/extensions/trendCursors/hooks/useTrendCursorColorer.ts b/packages/react-components/src/echarts/extensions/trendCursors/hooks/useTrendCursorColorer.ts index 5cbd9cd9e..384c882fa 100644 --- a/packages/react-components/src/echarts/extensions/trendCursors/hooks/useTrendCursorColorer.ts +++ b/packages/react-components/src/echarts/extensions/trendCursors/hooks/useTrendCursorColorer.ts @@ -1,6 +1,6 @@ import { Colorizer } from '@iot-app-kit/core-util'; +import isEqual from 'lodash-es/isEqual'; import { useEffect, useRef } from 'react'; -import isEqual from 'lodash.isequal'; import useDataStore from '../../../../store'; import { type TrendCursor, diff --git a/packages/react-components/src/echarts/extensions/yAxisSync/updateYAxis.ts b/packages/react-components/src/echarts/extensions/yAxisSync/updateYAxis.ts index c650f9289..dc79bdd25 100644 --- a/packages/react-components/src/echarts/extensions/yAxisSync/updateYAxis.ts +++ b/packages/react-components/src/echarts/extensions/yAxisSync/updateYAxis.ts @@ -1,7 +1,7 @@ import type LineSeriesModel from 'echarts/types/src/chart/line/LineSeries.js'; -import isEqual from 'lodash.isequal'; -import maxBy from 'lodash.maxby'; -import minBy from 'lodash.minby'; +import isEqual from 'lodash-es/isEqual'; +import maxBy from 'lodash-es/maxBy'; +import minBy from 'lodash-es/minBy'; import useDataStore from '../../../store'; import { type GenericSeries } from '../../types'; import { hasCustomYAxis } from './yAxisPredicates'; diff --git a/packages/react-components/src/echarts/unboundedZoom/useUnboundedDataZoom.ts b/packages/react-components/src/echarts/unboundedZoom/useUnboundedDataZoom.ts index b6ad23eb0..09e1a79d9 100644 --- a/packages/react-components/src/echarts/unboundedZoom/useUnboundedDataZoom.ts +++ b/packages/react-components/src/echarts/unboundedZoom/useUnboundedDataZoom.ts @@ -13,7 +13,7 @@ import { import { useCallback, useEffect, useReducer, useRef } from 'react'; import { useEffectOnce, useUpdateEffect } from 'react-use'; -import merge from 'lodash.merge'; +import merge from 'lodash-es/merge'; import { DEFAULT_VIEWPORT } from '../../components/time-sync'; import { useViewport } from '../../hooks/useViewport'; import { type UtilizedViewportType } from '../../hooks/useViewport/useUtilizedViewport'; diff --git a/packages/react-components/src/hooks/useAlarms/hookHelpers/useInputPropertyTimeSeriesData/updateAlarmStatusForDatastreams.ts b/packages/react-components/src/hooks/useAlarms/hookHelpers/useInputPropertyTimeSeriesData/updateAlarmStatusForDatastreams.ts index b245215cf..595b34795 100644 --- a/packages/react-components/src/hooks/useAlarms/hookHelpers/useInputPropertyTimeSeriesData/updateAlarmStatusForDatastreams.ts +++ b/packages/react-components/src/hooks/useAlarms/hookHelpers/useInputPropertyTimeSeriesData/updateAlarmStatusForDatastreams.ts @@ -1,7 +1,7 @@ import { type DataStream } from '@iot-app-kit/core'; +import isEqual from 'lodash-es/isEqual'; import { type AlarmData } from '../../types'; import { combineStatusForQueries } from '../../utils/queryStatus'; -import isEqual from 'lodash.isequal'; export const updateAlarmStatusForDatastreams = ( alarm: AlarmData, diff --git a/packages/react-components/src/hooks/useAlarms/hookHelpers/useReactQueryEffect.ts b/packages/react-components/src/hooks/useAlarms/hookHelpers/useReactQueryEffect.ts index e7dc3a860..e6a6de9f2 100644 --- a/packages/react-components/src/hooks/useAlarms/hookHelpers/useReactQueryEffect.ts +++ b/packages/react-components/src/hooks/useAlarms/hookHelpers/useReactQueryEffect.ts @@ -1,6 +1,6 @@ -import { type EffectCallback } from 'react'; import type { UseQueryResult } from '@tanstack/react-query'; -import isEqual from 'lodash.isequal'; +import isEqual from 'lodash-es/isEqual'; +import { type EffectCallback } from 'react'; import { useCustomCompareEffect } from 'react-use'; const queryAsComparable = (query: UseQueryResult) => ({ diff --git a/packages/react-components/src/hooks/useAlarms/state/actions/summarizeAlarmModels/summarizeAlarmModels.ts b/packages/react-components/src/hooks/useAlarms/state/actions/summarizeAlarmModels/summarizeAlarmModels.ts index daac942a9..a94e17876 100644 --- a/packages/react-components/src/hooks/useAlarms/state/actions/summarizeAlarmModels/summarizeAlarmModels.ts +++ b/packages/react-components/src/hooks/useAlarms/state/actions/summarizeAlarmModels/summarizeAlarmModels.ts @@ -1,4 +1,6 @@ -import { isEqual, uniqWith } from 'lodash'; +import isEqual from 'lodash-es/isEqual'; +import uniqWith from 'lodash-es/uniqWith'; +import { createNonNullableList } from '../../../../../utils/createNonNullableList'; import { extractAssetPropertyId, getAlarmModelNameFromAlarmSourceProperty, @@ -10,7 +12,6 @@ import { type SummarizeAlarmModelsAction, type SummarizeAlarmModelsActionPayload, } from './types'; -import { createNonNullableList } from '../../../../../utils/createNonNullableList'; export const onSummarizeAlarmModelsAction = ( payload: SummarizeAlarmModelsActionPayload diff --git a/packages/react-components/src/hooks/useAlarms/state/actions/updateAlarmInputPropertyData/updateAlarmInputPropertyData.ts b/packages/react-components/src/hooks/useAlarms/state/actions/updateAlarmInputPropertyData/updateAlarmInputPropertyData.ts index 34f865972..5cd30c82e 100644 --- a/packages/react-components/src/hooks/useAlarms/state/actions/updateAlarmInputPropertyData/updateAlarmInputPropertyData.ts +++ b/packages/react-components/src/hooks/useAlarms/state/actions/updateAlarmInputPropertyData/updateAlarmInputPropertyData.ts @@ -1,4 +1,4 @@ -import isEqual from 'lodash.isequal'; +import isEqual from 'lodash-es/isEqual'; import { combineStatusForQueries } from '../../../utils/queryStatus'; import { type AlarmsState } from '../../types'; import { filterDataStreamsForAlarm } from './filterDataStreamsForAlarm'; diff --git a/packages/react-components/src/hooks/useAlarms/state/converter/convertAlarmsStateToAlarmDatas.ts b/packages/react-components/src/hooks/useAlarms/state/converter/convertAlarmsStateToAlarmDatas.ts index a0589778e..bc8aa1e50 100644 --- a/packages/react-components/src/hooks/useAlarms/state/converter/convertAlarmsStateToAlarmDatas.ts +++ b/packages/react-components/src/hooks/useAlarms/state/converter/convertAlarmsStateToAlarmDatas.ts @@ -1,16 +1,16 @@ -import { isEqual, uniqWith } from 'lodash'; - +import isEqual from 'lodash-es/isEqual'; +import uniqWith from 'lodash-es/uniqWith'; import { type AlarmData } from '../../types'; import { type AlarmsState } from '../types'; import { convertAlarmRequestStateToAlarmData } from './convertAlarmRequestStateToAlarmData'; import { convertAlarmRequestStateToInitialAlarmData } from './convertAlarmRequestStateToInitialAlarmData'; -import { isInputPropertyRequest } from './utils/isInputPropertyRequest'; import { alarmDataAsComparable, isGettingLatestAlarmSourceValue, isSummarizingAlarmModels, isSummarizingAlarms, } from './utils'; +import { isInputPropertyRequest } from './utils/isInputPropertyRequest'; export const convertAlarmsStateToAlarmDatas = ( state: AlarmsState diff --git a/packages/react-components/src/hooks/useAlarms/state/useRequestSelector.ts b/packages/react-components/src/hooks/useAlarms/state/useRequestSelector.ts index b93b65af6..7ef30ac93 100644 --- a/packages/react-components/src/hooks/useAlarms/state/useRequestSelector.ts +++ b/packages/react-components/src/hooks/useAlarms/state/useRequestSelector.ts @@ -1,4 +1,4 @@ -import isEqual from 'lodash.isequal'; +import isEqual from 'lodash-es/isEqual'; import { useState } from 'react'; import { useCustomCompareEffect } from 'react-use'; diff --git a/packages/react-components/src/hooks/useColoredDataStreams/useColoredDataStreams.ts b/packages/react-components/src/hooks/useColoredDataStreams/useColoredDataStreams.ts index 5693f8f31..47459b431 100644 --- a/packages/react-components/src/hooks/useColoredDataStreams/useColoredDataStreams.ts +++ b/packages/react-components/src/hooks/useColoredDataStreams/useColoredDataStreams.ts @@ -1,8 +1,7 @@ -import { useEffect, useRef } from 'react'; - import { type DataStream, type StyleSettingsMap } from '@iot-app-kit/core'; import { Colorizer } from '@iot-app-kit/core-util'; -import difference from 'lodash.difference'; +import difference from 'lodash-es/difference'; +import { useEffect, useRef } from 'react'; const hasColor = (stream: DataStream, styles: StyleSettingsMap): boolean => { const streamHasColor = stream.color != null; diff --git a/packages/react-components/src/hooks/useColoredDataStreams/useDataStreamColorer.ts b/packages/react-components/src/hooks/useColoredDataStreams/useDataStreamColorer.ts index 6008ccd38..643f47536 100644 --- a/packages/react-components/src/hooks/useColoredDataStreams/useDataStreamColorer.ts +++ b/packages/react-components/src/hooks/useColoredDataStreams/useDataStreamColorer.ts @@ -1,8 +1,8 @@ -import { useCallback, useRef } from 'react'; import { type DataStream, type StyleSettingsMap } from '@iot-app-kit/core'; import { Colorizer } from '@iot-app-kit/core-util'; +import difference from 'lodash-es/difference'; +import { useCallback, useRef } from 'react'; import { bindStyleToDataStream } from '../utils/bindStylesToDataStreams'; -import difference from 'lodash.difference'; type ColorMap = { [key in DataStream['id']]: string | undefined }; diff --git a/packages/react-components/src/hooks/useSingleQueryAlarm/useSingleQueryAlarm.ts b/packages/react-components/src/hooks/useSingleQueryAlarm/useSingleQueryAlarm.ts index c52f011da..18b6b91d3 100644 --- a/packages/react-components/src/hooks/useSingleQueryAlarm/useSingleQueryAlarm.ts +++ b/packages/react-components/src/hooks/useSingleQueryAlarm/useSingleQueryAlarm.ts @@ -1,7 +1,3 @@ -import { useState } from 'react'; -import { useCustomCompareEffect } from 'react-use'; -import isEqual from 'lodash.isequal'; -import { type AlarmData, type AlarmDataStatus } from '../useAlarms'; import { type DataStream, type Primitive, @@ -9,12 +5,16 @@ import { type ThresholdValue, type Viewport, } from '@iot-app-kit/core'; -import { parseAlarmStateAssetProperty } from '../useAlarms/transformers'; +import isEqual from 'lodash-es/isEqual'; +import { useState } from 'react'; +import useCustomCompareEffect from 'react-use/esm/useCustomCompareEffect'; +import { type ComponentQuery } from '../../common/chartTypes'; +import { type AlarmContent } from '../../components/alarm-components/alarm-content/types'; import { transformAlarmsToThreshold } from '../../utils/transformAlarmsToThreshold'; +import { type AlarmData, type AlarmDataStatus } from '../useAlarms'; +import { parseAlarmStateAssetProperty } from '../useAlarms/transformers'; import { mapAlarmRuleExpression } from '../useAlarms/transformers/mapAlarmRuleExpression'; -import { type ComponentQuery } from '../../common/chartTypes'; import { useAlarmsFromQueries } from '../useAlarmsFromQueries'; -import { type AlarmContent } from '../../components/alarm-components/alarm-content/types'; type UseSingleQueryAlarmOptions = { query: ComponentQuery; diff --git a/packages/react-components/src/hooks/useTimeSeriesData/useTimeSeriesData.ts b/packages/react-components/src/hooks/useTimeSeriesData/useTimeSeriesData.ts index 794d2715c..22a66be4c 100644 --- a/packages/react-components/src/hooks/useTimeSeriesData/useTimeSeriesData.ts +++ b/packages/react-components/src/hooks/useTimeSeriesData/useTimeSeriesData.ts @@ -1,26 +1,26 @@ -import { useEffect, useState, useRef } from 'react'; -import { combineProviders } from '@iot-app-kit/core'; -import { - type SiteWiseAssetQuery, - type SiteWisePropertyAliasQuery, -} from '@iot-app-kit/source-iotsitewise'; import type { - Viewport, DataStream, + StyleSettingsMap, Threshold, + TimeQuery, TimeSeriesData, TimeSeriesDataRequest, - TimeQuery, TimeSeriesDataRequestSettings, - StyleSettingsMap, + Viewport, } from '@iot-app-kit/core'; +import { combineProviders } from '@iot-app-kit/core'; +import { + type SiteWiseAssetQuery, + type SiteWisePropertyAliasQuery, +} from '@iot-app-kit/source-iotsitewise'; +import { useEffect, useRef, useState } from 'react'; import { v4 as uuid } from 'uuid'; import { combineTimeSeriesData } from '../utils/combineTimeSeriesData'; +import isEqual from 'lodash-es/isEqual'; +import { useDataStreamStyler } from '../useColoredDataStreams/useDataStreamColorer'; import { useViewport } from '../useViewport'; import { ProviderStore } from './providerStore'; -import { useDataStreamStyler } from '../useColoredDataStreams/useDataStreamColorer'; -import isEqual from 'lodash.isequal'; const DEFAULT_SETTINGS: TimeSeriesDataRequestSettings = { resolution: '0', diff --git a/packages/react-components/src/hooks/useViewport/useUtilizedViewport.ts b/packages/react-components/src/hooks/useViewport/useUtilizedViewport.ts index 5ea4b25e8..cb41cb417 100644 --- a/packages/react-components/src/hooks/useViewport/useUtilizedViewport.ts +++ b/packages/react-components/src/hooks/useViewport/useUtilizedViewport.ts @@ -1,8 +1,9 @@ import { type Viewport } from '@iot-app-kit/core'; -import { useViewport } from './useViewport'; +import isEqual from 'lodash-es/isEqual'; import { useCallback, useState } from 'react'; -import { useCustomCompareEffect, useEffectOnce } from 'react-use'; -import { isEqual } from 'lodash'; +import useCustomCompareEffect from 'react-use/esm/useCustomCompareEffect'; +import useEffectOnce from 'react-use/esm/useEffectOnce'; +import { useViewport } from './useViewport'; export type UtilizedViewportType = | 'passed-in' diff --git a/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/cacheClient.ts b/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/cacheClient.ts index c895f02a3..f8c504925 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/cacheClient.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/cacheClient.ts @@ -1,6 +1,6 @@ -import isEqual from 'lodash.isequal'; -import omitBy from 'lodash.omitby'; -import { isUndefined } from 'lodash'; +import isEqual from 'lodash-es/isEqual'; +import isUndefined from 'lodash-es/isUndefined'; +import omitBy from 'lodash-es/omitBy'; import { type Interval, TimeSeriesDataCacheClient, diff --git a/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/keyManager.ts b/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/keyManager.ts index ce10424f4..bfd79c7ca 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/keyManager.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/cacheClient/keyManager.ts @@ -1,5 +1,6 @@ -import { isUndefined, omit } from 'lodash'; -import omitBy from 'lodash.omitby'; +import isUndefined from 'lodash-es/isUndefined'; +import omit from 'lodash-es/omit'; +import omitBy from 'lodash-es/omitBy'; import { type SeriaizedRequest, TimeSeriesDataCacheKeyManager, diff --git a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyAggregates/requestManager.ts b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyAggregates/requestManager.ts index 9aa43ef18..570bd51f3 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyAggregates/requestManager.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyAggregates/requestManager.ts @@ -1,4 +1,7 @@ import { TimeOrdering } from '@aws-sdk/client-iotsitewise'; +import takeRight from 'lodash-es/takeRight'; +import { nanoid } from 'nanoid'; +import { createNonNullableList } from '../../../../utils/createNonNullableList'; import { type OnRequestSuccessCallback, type SendOptions, @@ -9,9 +12,6 @@ import { type BatchGetAssetPropertyAggregatesRequestParameters, type BatchGetAssetPropertyAggregatesRequestResponse, } from '../../types'; -import { nanoid } from 'nanoid'; -import takeRight from 'lodash.takeright'; -import { createNonNullableList } from '../../../../utils/createNonNullableList'; import { aggregateToDataPoint } from '../../utils/toDataPoint'; export type BatchGetRequest = { diff --git a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyValueHistory/requestManager.ts b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyValueHistory/requestManager.ts index ec65f387a..868142110 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyValueHistory/requestManager.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/batchGetAssetPropertyValueHistory/requestManager.ts @@ -1,4 +1,7 @@ import { TimeOrdering } from '@aws-sdk/client-iotsitewise'; +import takeRight from 'lodash-es/takeRight'; +import { nanoid } from 'nanoid'; +import { createNonNullableList } from '../../../../utils/createNonNullableList'; import { type OnRequestSuccessCallback, type SendOptions, @@ -9,9 +12,6 @@ import { type BatchGetAssetPropertyValueHistoryRequestParameters, type BatchGetAssetPropertyValueHistoryRequestResponse, } from '../../types'; -import { nanoid } from 'nanoid'; -import takeRight from 'lodash.takeright'; -import { createNonNullableList } from '../../../../utils/createNonNullableList'; import { toDataPoint } from '../../utils/toDataPoint'; export type BatchGetRequest = { diff --git a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyAggregates.ts b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyAggregates.ts index c9b50c9f9..8096a4c4e 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyAggregates.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyAggregates.ts @@ -1,18 +1,18 @@ import { TimeOrdering } from '@aws-sdk/client-iotsitewise'; -import { - type AssetPropertyAggregatesRequest, - type AssetPropertyValuesData, - type GetAssetPropertyAggregatesRequestFunction, -} from '../types'; -import { type SendOptions } from '../../useTimeSeriesData/requestExecution/types'; import { type RequestResponse } from '@iot-app-kit/core'; +import takeRight from 'lodash-es/takeRight'; +import { createNonNullableList } from '../../../utils/createNonNullableList'; import { type ExecuteRequestStrategy, type OnRequestSuccessCallback, } from '../../useTimeSeriesData/requestExecution/requestExecutionStrategy'; -import takeRight from 'lodash.takeright'; +import { type SendOptions } from '../../useTimeSeriesData/requestExecution/types'; +import { + type AssetPropertyAggregatesRequest, + type AssetPropertyValuesData, + type GetAssetPropertyAggregatesRequestFunction, +} from '../types'; import { aggregateToDataPoint } from '../utils/toDataPoint'; -import { createNonNullableList } from '../../../utils/createNonNullableList'; export class GetAssetPropertyAggregates implements diff --git a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyValueHistory.ts b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyValueHistory.ts index c5b0229a8..70a716908 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyValueHistory.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/requestExecution/getAssetPropertyValueHistory.ts @@ -1,18 +1,18 @@ import { TimeOrdering } from '@aws-sdk/client-iotsitewise'; -import { - type AssetPropertyValueHistoryRequest, - type AssetPropertyValuesData, - type GetAssetPropertyValueHistoryRequestFunction, -} from '../types'; -import { type SendOptions } from '../../useTimeSeriesData/requestExecution/types'; import { type RequestResponse } from '@iot-app-kit/core'; +import takeRight from 'lodash-es/takeRight'; +import { createNonNullableList } from '../../../utils/createNonNullableList'; import { type ExecuteRequestStrategy, type OnRequestSuccessCallback, } from '../../useTimeSeriesData/requestExecution/requestExecutionStrategy'; -import takeRight from 'lodash.takeright'; +import { type SendOptions } from '../../useTimeSeriesData/requestExecution/types'; +import { + type AssetPropertyValueHistoryRequest, + type AssetPropertyValuesData, + type GetAssetPropertyValueHistoryRequestFunction, +} from '../types'; import { toDataPoint } from '../utils/toDataPoint'; -import { createNonNullableList } from '../../../utils/createNonNullableList'; export class GetAssetPropertyValueHistory implements diff --git a/packages/react-components/src/queries/useAssetPropertyValues/requestManager/useRequestResolverStrategy.ts b/packages/react-components/src/queries/useAssetPropertyValues/requestManager/useRequestResolverStrategy.ts index c134fdff2..180ffbcb3 100644 --- a/packages/react-components/src/queries/useAssetPropertyValues/requestManager/useRequestResolverStrategy.ts +++ b/packages/react-components/src/queries/useAssetPropertyValues/requestManager/useRequestResolverStrategy.ts @@ -1,16 +1,16 @@ +import { isDurationViewport, viewportEndDate } from '@iot-app-kit/core'; +import { isAfter } from 'date-fns'; +import minBy from 'lodash-es/minBy'; import { useCallback, useMemo, useState } from 'react'; import { useHarmonicIntervalFn } from 'react-use'; -import { isAfter } from 'date-fns'; -import minBy from 'lodash.minby'; -import { isDurationViewport, viewportEndDate } from '@iot-app-kit/core'; import { AbsoluteDurationTimeSeriesDataRequestResolver, - LiveDurationTimeSeriesDataRequestResolver, - type Viewport, getViewportType, IntervalTransformer, - type RequestResolverStrategy, LIVE_DATA_INTERVALS, + LiveDurationTimeSeriesDataRequestResolver, + type RequestResolverStrategy, + type Viewport, } from '../../useTimeSeriesData'; import { type AssetPropertyValuesCacheClient } from '../cacheClient'; import { type AssetPropertyValueHistoryRequest } from '../types'; diff --git a/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/batchResponseProcessor.ts b/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/batchResponseProcessor.ts index 95dd66dc4..b3b3433b9 100644 --- a/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/batchResponseProcessor.ts +++ b/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/batchResponseProcessor.ts @@ -4,7 +4,7 @@ import { type GetAssetPropertyValueHistory, type RequestResponse, } from '@iot-app-kit/core'; -import { take } from 'lodash'; +import take from 'lodash-es/take'; export class BatchResponseProcessor { private entry: BatchGetAssetPropertyValueHistoryEntry; diff --git a/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/getHistoricalAssetPropertyValueRequest.ts b/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/getHistoricalAssetPropertyValueRequest.ts index 801bd0528..db5b49cd0 100644 --- a/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/getHistoricalAssetPropertyValueRequest.ts +++ b/packages/react-components/src/queries/useHistoricalAssetPropertyValues/requestExecution/getHistoricalAssetPropertyValueRequest.ts @@ -2,11 +2,11 @@ import { type GetAssetPropertyValueHistory, type RequestResponse, } from '@iot-app-kit/core'; +import take from 'lodash-es/take'; import { type HistoricalAssetPropertyValueRequest } from '../types'; -import { take } from 'lodash'; -import { mapViewport } from './mapViewport'; -import { mapTimeOrdering } from './mapTimeOrdering'; import { DEFAULT_MAX_RESULTS } from './constants'; +import { mapTimeOrdering } from './mapTimeOrdering'; +import { mapViewport } from './mapViewport'; export class GetHistoricalAssetPropertyValueRequest { readonly #getAssetPropertyValueHistory: GetAssetPropertyValueHistory; diff --git a/packages/react-components/src/queries/useHistoricalAssetPropertyValues/useHistoricalAssetPropertyValues.spec.ts b/packages/react-components/src/queries/useHistoricalAssetPropertyValues/useHistoricalAssetPropertyValues.spec.ts index bfa3b0d16..d9d80cbe6 100644 --- a/packages/react-components/src/queries/useHistoricalAssetPropertyValues/useHistoricalAssetPropertyValues.spec.ts +++ b/packages/react-components/src/queries/useHistoricalAssetPropertyValues/useHistoricalAssetPropertyValues.spec.ts @@ -4,9 +4,9 @@ import { type IoTSiteWise, } from '@aws-sdk/client-iotsitewise'; import { renderHook, waitFor } from '@testing-library/react'; +import merge from 'lodash-es/merge'; import { queryClient } from '../queryClient'; import { useHistoricalAssetPropertyValues } from './useHistoricalAssetPropertyValues'; -import merge from 'lodash.merge'; const MOCK_ASSET_ID_1 = 'asset-1'; diff --git a/packages/react-components/src/queries/useLatestAssetPropertyValues/useLatestAssetPropertyValues.spec.ts b/packages/react-components/src/queries/useLatestAssetPropertyValues/useLatestAssetPropertyValues.spec.ts index 0196146c7..634ba3241 100644 --- a/packages/react-components/src/queries/useLatestAssetPropertyValues/useLatestAssetPropertyValues.spec.ts +++ b/packages/react-components/src/queries/useLatestAssetPropertyValues/useLatestAssetPropertyValues.spec.ts @@ -4,9 +4,9 @@ import { type IoTSiteWise, } from '@aws-sdk/client-iotsitewise'; import { renderHook, waitFor } from '@testing-library/react'; +import merge from 'lodash-es/merge'; import { queryClient } from '../queryClient'; import { useLatestAssetPropertyValues } from './useLatestAssetPropertyValues'; -import merge from 'lodash.merge'; const MOCK_ASSET_ID_1 = 'asset-1'; diff --git a/packages/react-components/src/queries/useTimeSeriesData/intervals/useLiveDataIntervals.ts b/packages/react-components/src/queries/useTimeSeriesData/intervals/useLiveDataIntervals.ts index 214221c7b..073d90123 100644 --- a/packages/react-components/src/queries/useTimeSeriesData/intervals/useLiveDataIntervals.ts +++ b/packages/react-components/src/queries/useTimeSeriesData/intervals/useLiveDataIntervals.ts @@ -1,11 +1,11 @@ +import isEqual from 'lodash-es/isEqual'; import { useMemo, useState } from 'react'; +import useCustomCompareEffect from 'react-use/esm/useCustomCompareEffect'; import { type LiveDataConfiguration, type Viewport } from '../types'; import { DEFAULT_LIVE_DATA_CONFIGURATION, convertToLiveDataIntervals, } from './liveData'; -import { useCustomCompareEffect } from 'react-use'; -import isEqual from 'lodash.isequal'; type UseLiveDataIntervalsOptions = { viewport: Viewport; diff --git a/packages/react-components/src/queries/useTimeSeriesData/intervals/utils/collapse.ts b/packages/react-components/src/queries/useTimeSeriesData/intervals/utils/collapse.ts index 1046b09c5..349e9f0eb 100644 --- a/packages/react-components/src/queries/useTimeSeriesData/intervals/utils/collapse.ts +++ b/packages/react-components/src/queries/useTimeSeriesData/intervals/utils/collapse.ts @@ -1,7 +1,7 @@ import { isBefore } from 'date-fns'; -import { sortIntervals } from './sort'; +import isEqual from 'lodash-es/isEqual'; import { type Interval } from '../../types'; -import isEqual from 'lodash.isequal'; +import { sortIntervals } from './sort'; /** * diff --git a/packages/react-components/src/queries/useTimeSeriesData/requestExecution/useRequestExecuter.ts b/packages/react-components/src/queries/useTimeSeriesData/requestExecution/useRequestExecuter.ts index 2dc167b5e..c0152802e 100644 --- a/packages/react-components/src/queries/useTimeSeriesData/requestExecution/useRequestExecuter.ts +++ b/packages/react-components/src/queries/useTimeSeriesData/requestExecution/useRequestExecuter.ts @@ -1,18 +1,18 @@ -import { useCallback, useMemo } from 'react'; import { type QueryFunctionContext, useQueries } from '@tanstack/react-query'; -import zip from 'lodash/zip'; -import groupBy from 'lodash.groupby'; +import groupBy from 'lodash-es/groupBy'; +import zip from 'lodash-es/zip'; +import { useCallback, useMemo } from 'react'; import { createNonNullableList, createNonNullableTupleList, } from '../../../utils/createNonNullableList'; -import { type useTimeSeriesDataRequestManager } from '../requestManager'; import { type TimeSeriesDataCacheClient, type TimeSeriesDataCacheKeyManager, } from '../cacheClient'; -import { type TimeSeriesDataRequestExecution } from '../requestExecution/requestExecution'; import { IntervalTransformer, getViewportType } from '../intervals'; +import { type TimeSeriesDataRequestExecution } from '../requestExecution/requestExecution'; +import { type useTimeSeriesDataRequestManager } from '../requestManager'; type UseRequestExecuterOptions = { cacheClient: TimeSeriesDataCacheClient; diff --git a/packages/react-components/src/queries/useTimeSeriesData/requestManager/useRequestManager.ts b/packages/react-components/src/queries/useTimeSeriesData/requestManager/useRequestManager.ts index f39608807..8b4ad8eee 100644 --- a/packages/react-components/src/queries/useTimeSeriesData/requestManager/useRequestManager.ts +++ b/packages/react-components/src/queries/useTimeSeriesData/requestManager/useRequestManager.ts @@ -1,9 +1,9 @@ -import { useCallback, useMemo } from 'react'; import { useQueries } from '@tanstack/react-query'; -import { zip } from 'lodash'; +import zip from 'lodash-es/zip'; +import { useCallback, useMemo } from 'react'; +import { createNonNullableTupleList } from '../../../utils/createNonNullableList'; import { type TimeSeriesDataCacheClient } from '../cacheClient'; import { type Viewport } from '../types'; -import { createNonNullableTupleList } from '../../../utils/createNonNullableList'; import { type RequestResolverStrategy, type RequestSettings } from './types'; type TimeSeriesDataRequestManagerOptions = { diff --git a/packages/react-components/src/queries/useTimeSeriesData/useRequestStatus.ts b/packages/react-components/src/queries/useTimeSeriesData/useRequestStatus.ts index cd7a5e405..5ba9b480d 100644 --- a/packages/react-components/src/queries/useTimeSeriesData/useRequestStatus.ts +++ b/packages/react-components/src/queries/useTimeSeriesData/useRequestStatus.ts @@ -1,11 +1,11 @@ -import isEqual from 'lodash.isequal'; -import { type useTimeSeriesDataRequestManager } from './requestManager'; +import isEqual from 'lodash-es/isEqual'; +import { useMemo } from 'react'; import { createNonNullableList } from '../../utils/createNonNullableList'; import { aggregateStatuses } from './queryUtils'; -import { useMemo } from 'react'; -import { type useTimeSeriesDataCachedQueries } from './useCachedQueries'; import { type useTimeSeriesDataRequestExecuter } from './requestExecution'; +import { type useTimeSeriesDataRequestManager } from './requestManager'; import { type useTimeSeriesBisectedData } from './useBisectedData'; +import { type useTimeSeriesDataCachedQueries } from './useCachedQueries'; type UseRequestStatusOptions = { requestQueries: ReturnType< diff --git a/packages/react-components/src/translations/messages.ts b/packages/react-components/src/translations/messages.ts index 3e2556253..a8c9979b5 100644 --- a/packages/react-components/src/translations/messages.ts +++ b/packages/react-components/src/translations/messages.ts @@ -1,14 +1,14 @@ -import merge from 'lodash.merge'; +import merge from 'lodash-es/merge'; import { AnomalyChart, type AnomalyChartMessageKeys } from './anomalyWidget'; -import { Echarts, type EchartsMessageKeys } from './echarts'; import { AssistantActionPanel, type AssistantActionPanelMessageKeys, AssistantResultPanel, type AssistantResultPanelMessageKeys, } from './assistantActionPanel/messages'; -import { type Messages } from './types'; +import { Echarts, type EchartsMessageKeys } from './echarts'; import { Table, type TableMessageKeys } from './table/messages'; +import { type Messages } from './types'; /** * In order to add messages to the intl instance diff --git a/packages/react-components/stories/anomaly/mockData.ts b/packages/react-components/stories/anomaly/mockData.ts index 5aef423fa..9cb310494 100644 --- a/packages/react-components/stories/anomaly/mockData.ts +++ b/packages/react-components/stories/anomaly/mockData.ts @@ -1,5 +1,5 @@ +import shuffle from 'lodash-es/shuffle'; import { type AnomalyObjectDataSource } from '../../src/data'; -import shuffle from 'lodash/shuffle'; const randomValuePicker = ( initialValues = [0.1, 0.1, 0.15, 0.18, 0.22, 0.25] diff --git a/packages/scene-composer/package.json b/packages/scene-composer/package.json index ad421953b..7b613301e 100644 --- a/packages/scene-composer/package.json +++ b/packages/scene-composer/package.json @@ -112,7 +112,7 @@ "@testing-library/user-event": "^14.5.2", "@types/debug": "^4.1.8", "@types/jexl": "^2.2.0", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@types/react": "^18.2.12", "@types/react-dom": "^18.2.5", @@ -127,7 +127,6 @@ "husky": "8.0.3", "jest-extended": "^3.2.4", "jsdom": "^25.0.1", - "lodash": "^4.17.21", "nodemon": "^2.0.22", "npm-run-all": "^4.1.5", "postcss": "^8.4.31", @@ -176,6 +175,7 @@ "immer": "^9.0.21", "is-absolute-url": "^4.0.1", "jexl": "^2.3.0", + "lodash-es": "^4.17.21", "merge": "^2.1.1", "path-browserify": "1.0.1", "postprocessing": "6.28.5", diff --git a/packages/scene-composer/src/SceneViewer.tsx b/packages/scene-composer/src/SceneViewer.tsx index 7e474456b..a2c6c8a76 100644 --- a/packages/scene-composer/src/SceneViewer.tsx +++ b/packages/scene-composer/src/SceneViewer.tsx @@ -1,8 +1,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { v4 as uuid } from 'uuid'; -import { isEqual } from 'lodash'; +import isEqual from 'lodash-es/isEqual'; import styled from 'styled-components'; - import { COMPOSER_FEATURES, type ISelectedDataBinding, KnownComponentType, type SceneViewerProps } from './interfaces'; import { SceneComposerInternal, useSceneComposerApi } from './components/SceneComposerInternal'; diff --git a/packages/scene-composer/src/components/IntlProvider/index.tsx b/packages/scene-composer/src/components/IntlProvider/index.tsx index 545627429..af72f0300 100644 --- a/packages/scene-composer/src/components/IntlProvider/index.tsx +++ b/packages/scene-composer/src/components/IntlProvider/index.tsx @@ -1,10 +1,9 @@ +import defaultsDeep from 'lodash-es/defaultsDeep'; +import * as PropTypes from 'prop-types'; import { useEffect, useState } from 'react'; -import { defaultsDeep } from 'lodash'; -import PropTypes from 'prop-types'; import { IntlProvider } from 'react-intl'; - -import useLogger from '../../logger/react-logger/hooks/useLogger'; import { defaultMessages, messagesMap } from '../../../translations'; +import useLogger from '../../logger/react-logger/hooks/useLogger'; const DEFAULT_LOCALE = 'en-US'; diff --git a/packages/scene-composer/src/components/SceneComposerInternal.tsx b/packages/scene-composer/src/components/SceneComposerInternal.tsx index 541a17e0f..c657eb176 100644 --- a/packages/scene-composer/src/components/SceneComposerInternal.tsx +++ b/packages/scene-composer/src/components/SceneComposerInternal.tsx @@ -1,9 +1,8 @@ import { Mode } from '@cloudscape-design/global-styles'; import { useViewport } from '@iot-app-kit/react-components'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash-es/cloneDeep'; import { useCallback, useEffect, useMemo, useReducer, useRef } from 'react'; import { ThemeProvider } from 'styled-components'; - import { SCENE_BODY_CLASS } from '../common/constants'; import { sceneComposerIdContext } from '../common/sceneComposerIdContext'; import { GlobalStyles } from '../GlobalStyles'; @@ -18,7 +17,6 @@ import { darkTheme, lightTheme } from '../theme'; import { containsMatchingEntityComponent } from '../utils/dataBindingUtils'; import { generateUUID } from '../utils/mathUtils'; import { createMaterialFromStyle } from '../utils/objectThreeStyleUtils'; - import DefaultErrorFallback from './DefaultErrorFallback'; import IntlProvider from './IntlProvider'; import StateManager from './StateManager'; diff --git a/packages/scene-composer/src/components/modals/ConvertSceneModal.tsx b/packages/scene-composer/src/components/modals/ConvertSceneModal.tsx index 650d994c7..1e01d9358 100644 --- a/packages/scene-composer/src/components/modals/ConvertSceneModal.tsx +++ b/packages/scene-composer/src/components/modals/ConvertSceneModal.tsx @@ -1,8 +1,7 @@ import { Alert, Box, Button, Header, SpaceBetween } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback, useContext, useState } from 'react'; import { useIntl } from 'react-intl'; - import { getGlobalSettings } from '../../common/GlobalSettings'; import { sceneComposerIdContext } from '../../common/sceneComposerIdContext'; import { KnownSceneProperty } from '../../interfaces'; diff --git a/packages/scene-composer/src/components/modals/DeleteNodeModal.tsx b/packages/scene-composer/src/components/modals/DeleteNodeModal.tsx index de8692bb0..f04a57809 100644 --- a/packages/scene-composer/src/components/modals/DeleteNodeModal.tsx +++ b/packages/scene-composer/src/components/modals/DeleteNodeModal.tsx @@ -1,13 +1,11 @@ import { Spinner } from '@cloudscape-design/components'; -import { isNumber } from 'lodash'; +import isNumber from 'lodash-es/isNumber'; import { useCallback, useContext, useEffect, useState } from 'react'; import { useIntl } from 'react-intl'; - import { getGlobalSettings } from '../../common/GlobalSettings'; import { DEFAULT_PARENT_RELATIONSHIP_NAME, MAX_QUERY_HOP } from '../../common/entityModelConstants'; import { sceneComposerIdContext } from '../../common/sceneComposerIdContext'; import { accessStore, useSceneDocument } from '../../store'; - import DeleteConfirmationModal from './DeleteConfirmationModal'; const DeleteNodeModal: React.FC = () => { diff --git a/packages/scene-composer/src/components/modals/MessageModal.tsx b/packages/scene-composer/src/components/modals/MessageModal.tsx index c85455f4d..5714b740a 100644 --- a/packages/scene-composer/src/components/modals/MessageModal.tsx +++ b/packages/scene-composer/src/components/modals/MessageModal.tsx @@ -1,5 +1,5 @@ -import _ from 'lodash'; import { Box, Button, Header, Icon, SpaceBetween, StatusIndicator, TextContent } from '@cloudscape-design/components'; +import groupBy from 'lodash-es/groupBy'; import { Fragment, useContext, useMemo } from 'react'; import { useIntl } from 'react-intl'; @@ -40,7 +40,7 @@ const MessageModal = () => { const showUserGuideLink = containsError || containsWarning; const messageContent = useMemo(() => { - const groupedMessages = _.groupBy(messages, (m) => m.category); + const groupedMessages = groupBy(messages, (m) => m.category); return [DisplayMessageCategory.Error, DisplayMessageCategory.Warning, DisplayMessageCategory.Info] .map((category) => { if (category in groupedMessages) { diff --git a/packages/scene-composer/src/components/panels/ColorPicker/ColorPicker.tsx b/packages/scene-composer/src/components/panels/ColorPicker/ColorPicker.tsx index 1bfb71421..ffaa395d1 100644 --- a/packages/scene-composer/src/components/panels/ColorPicker/ColorPicker.tsx +++ b/packages/scene-composer/src/components/panels/ColorPicker/ColorPicker.tsx @@ -1,9 +1,8 @@ import { SpaceBetween } from '@cloudscape-design/components'; -import { debounce } from 'lodash'; +import debounce from 'lodash-es/debounce'; import { useState } from 'react'; import { useIntl } from 'react-intl'; import { type ColorRepresentation } from 'three'; - import { ColorPickerWrapper, DEFAULT_COLOR, diff --git a/packages/scene-composer/src/components/panels/SceneHierarchyPanel/SceneHierarchyDataProvider.tsx b/packages/scene-composer/src/components/panels/SceneHierarchyPanel/SceneHierarchyDataProvider.tsx index ad374dad1..1d905fb63 100644 --- a/packages/scene-composer/src/components/panels/SceneHierarchyPanel/SceneHierarchyDataProvider.tsx +++ b/packages/scene-composer/src/components/panels/SceneHierarchyPanel/SceneHierarchyDataProvider.tsx @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { type FC, type ReactNode, createContext, useCallback, useContext, useEffect, useState } from 'react'; import { DndProvider } from 'react-dnd'; import { HTML5Backend } from 'react-dnd-html5-backend'; diff --git a/packages/scene-composer/src/components/panels/SceneNodeInspectorPanel.tsx b/packages/scene-composer/src/components/panels/SceneNodeInspectorPanel.tsx index 0588ea426..11380e91e 100644 --- a/packages/scene-composer/src/components/panels/SceneNodeInspectorPanel.tsx +++ b/packages/scene-composer/src/components/panels/SceneNodeInspectorPanel.tsx @@ -1,5 +1,5 @@ import { Checkbox, FormField, TextContent } from '@cloudscape-design/components'; -import { debounce } from 'lodash'; +import debounce from 'lodash-es/debounce'; import { Fragment, useCallback, useContext, useRef } from 'react'; import { useIntl } from 'react-intl'; import * as THREE from 'three'; diff --git a/packages/scene-composer/src/components/panels/__tests__/TopBar.spec.tsx b/packages/scene-composer/src/components/panels/__tests__/TopBar.spec.tsx index 54d7e5546..ed5ef205d 100644 --- a/packages/scene-composer/src/components/panels/__tests__/TopBar.spec.tsx +++ b/packages/scene-composer/src/components/panels/__tests__/TopBar.spec.tsx @@ -1,4 +1,4 @@ -import { render, screen, user, fireEvent, waitFor } from '@/tests/testing-library'; +import { fireEvent, render } from '@/tests/testing-library'; import * as THREE from 'three'; import { DEFAULT_CAMERA_OPTIONS, DEFAULT_CAMERA_POSITION, KnownComponentType } from '../../..'; import { accessStore } from '../../../store'; diff --git a/packages/scene-composer/src/components/panels/__tests__/__snapshots__/TopBar.spec.tsx.snap b/packages/scene-composer/src/components/panels/__tests__/__snapshots__/TopBar.spec.tsx.snap index bc2cf4165..1bb8a25be 100644 --- a/packages/scene-composer/src/components/panels/__tests__/__snapshots__/TopBar.spec.tsx.snap +++ b/packages/scene-composer/src/components/panels/__tests__/__snapshots__/TopBar.spec.tsx.snap @@ -5,7 +5,7 @@ exports[` > should not render without camera view 1`] = `
`; exports[` > should render Cameras Drop down with camera view 1`] = `
diff --git a/packages/scene-composer/src/components/panels/scene-components/AnchorComponentEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/AnchorComponentEditor.tsx index 27420a4ee..442aa30ac 100644 --- a/packages/scene-composer/src/components/panels/scene-components/AnchorComponentEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/AnchorComponentEditor.tsx @@ -8,10 +8,9 @@ import { TextContent, } from '@cloudscape-design/components'; import { type IconLookup, findIconDefinition } from '@fortawesome/fontawesome-svg-core'; -import { debounce } from 'lodash'; +import debounce from 'lodash-es/debounce'; import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; - import { SCENE_ICONS } from '../../../common/constants'; import { sceneComposerIdContext } from '../../../common/sceneComposerIdContext'; import { @@ -33,7 +32,6 @@ import { convertToIotTwinMakerNamespace, getSceneResourceInfo } from '../../../u import { colors } from '../../../utils/styleUtils'; import { TextInput } from '../CommonPanelComponents'; import { type IComponentEditorProps } from '../ComponentEditor'; - import { ValueDataBindingBuilder } from './common/ValueDataBindingBuilder'; import { ColorSelectorCombo } from './tag-style/ColorSelectorCombo/ColorSelectorCombo'; import { DecodeSvgString } from './tag-style/ColorSelectorCombo/ColorSelectorComboUtils/DecodeSvgString'; diff --git a/packages/scene-composer/src/components/panels/scene-components/DataOverlayComponentEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/DataOverlayComponentEditor.tsx index 797d66217..0c0a7f553 100644 --- a/packages/scene-composer/src/components/panels/scene-components/DataOverlayComponentEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/DataOverlayComponentEditor.tsx @@ -1,14 +1,12 @@ import { FormField, SpaceBetween, Textarea } from '@cloudscape-design/components'; -import { debounce } from 'lodash'; +import debounce from 'lodash-es/debounce'; import { useCallback, useContext, useEffect, useState } from 'react'; import { useIntl } from 'react-intl'; - import { sceneComposerIdContext } from '../../../common/sceneComposerIdContext'; import { Component } from '../../../models/SceneModels'; import { type IDataOverlayComponentInternal, type ISceneComponentInternal, accessStore } from '../../../store'; import { isDynamicScene } from '../../../utils/entityModelUtils/sceneUtils'; import { type IComponentEditorProps } from '../ComponentEditor'; - import { type ComponentWithDataBindings, DataBindingMapEditor } from './common/DataBindingMapEditor'; export interface IDataOverlayComponentEditorProps extends IComponentEditorProps { diff --git a/packages/scene-composer/src/components/panels/scene-components/common/DataBindingMapEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/common/DataBindingMapEditor.tsx index ca296eba8..d5091f744 100644 --- a/packages/scene-composer/src/components/panels/scene-components/common/DataBindingMapEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/common/DataBindingMapEditor.tsx @@ -1,15 +1,13 @@ import { Box, Button, SpaceBetween } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback } from 'react'; import { useIntl } from 'react-intl'; import styled from 'styled-components'; - import { type IValueDataBinding, type IValueDataBindingProvider } from '../../../../interfaces'; import { type Component } from '../../../../models/SceneModels'; import { type ISceneComponentInternal } from '../../../../store'; import { Divider } from '../../../Divider'; import { DataBindingMapNameEditor } from '../data-overlay/DataBindingMapNameEditor'; - import { ValueDataBindingBuilder } from './ValueDataBindingBuilder'; export interface ComponentWithDataBindings extends ISceneComponentInternal { diff --git a/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditor.tsx index 0ab3a3b4f..3f208f4d4 100644 --- a/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditor.tsx @@ -1,8 +1,7 @@ import { FormField } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback } from 'react'; import { useIntl } from 'react-intl'; - import { type Component } from '../../../../models/SceneModels'; import { TextInput } from '../../CommonPanelComponents'; diff --git a/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditorSnap.spec.tsx b/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditorSnap.spec.tsx index 14bc7757c..3eab68cce 100644 --- a/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditorSnap.spec.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/data-overlay/DataBindingMapNameEditorSnap.spec.tsx @@ -1,6 +1,5 @@ import { render } from '@/tests/testing-library'; -import cloneDeep from 'lodash/cloneDeep'; - +import cloneDeep from 'lodash-es/cloneDeep'; import { DataBindingMapNameEditor } from './DataBindingMapNameEditor'; describe('DataBindingMapNameEditor', () => { diff --git a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/AppearanceEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/AppearanceEditor.tsx index d2ea464d1..e579bb374 100644 --- a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/AppearanceEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/AppearanceEditor.tsx @@ -1,10 +1,8 @@ import { Box, FormField, Grid, Input, Select, SpaceBetween } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useIntl } from 'react-intl'; - import { Component, type Vector3 } from '../../../../models/SceneModels'; import { type IMotionIndicatorComponentInternal } from '../../../../store'; - import ColorEditor from './ColorEditor'; import { updateComponentForColorTypeSelection } from './helpers'; import PreviewArrow from './PreviewArrow'; diff --git a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/ColorEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/ColorEditor.tsx index 9bb4ed67e..ff7763847 100644 --- a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/ColorEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/ColorEditor.tsx @@ -1,5 +1,5 @@ import { Box, Button, FormField, Grid, Icon, Select, SpaceBetween } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useContext, useEffect, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; import styled from 'styled-components'; diff --git a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/SpeedEditor.tsx b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/SpeedEditor.tsx index 6e5631824..bc173b884 100644 --- a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/SpeedEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/SpeedEditor.tsx @@ -1,5 +1,5 @@ import { Box, Button, FormField, Icon, Select, SpaceBetween } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useContext, useEffect, useState } from 'react'; import { useIntl } from 'react-intl'; diff --git a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/helpers.ts b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/helpers.ts index 9c0fc7264..31a6774dd 100644 --- a/packages/scene-composer/src/components/panels/scene-components/motion-indicator/helpers.ts +++ b/packages/scene-composer/src/components/panels/scene-components/motion-indicator/helpers.ts @@ -1,5 +1,4 @@ -import { isEmpty } from 'lodash'; - +import isEmpty from 'lodash-es/isEmpty'; import { Component } from '../../../../models/SceneModels'; import { type IMotionIndicatorComponentInternal } from '../../../../store'; diff --git a/packages/scene-composer/src/components/panels/scene-components/tag-style/IconPicker/IconPicker.tsx b/packages/scene-composer/src/components/panels/scene-components/tag-style/IconPicker/IconPicker.tsx index 48e7713eb..2fef912bd 100644 --- a/packages/scene-composer/src/components/panels/scene-components/tag-style/IconPicker/IconPicker.tsx +++ b/packages/scene-composer/src/components/panels/scene-components/tag-style/IconPicker/IconPicker.tsx @@ -8,7 +8,7 @@ import { } from '@fortawesome/fontawesome-svg-core'; import { fas } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback, useEffect, useState } from 'react'; import { type IIconPicker } from '../interface'; diff --git a/packages/scene-composer/src/components/panels/scene-settings/MatterportIntegration.tsx b/packages/scene-composer/src/components/panels/scene-settings/MatterportIntegration.tsx index 395f813f9..7a77d6ea3 100644 --- a/packages/scene-composer/src/components/panels/scene-settings/MatterportIntegration.tsx +++ b/packages/scene-composer/src/components/panels/scene-settings/MatterportIntegration.tsx @@ -1,8 +1,7 @@ import { Box, Button, FormField, Input, Select, SpaceBetween } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useIntl } from 'react-intl'; - import { getGlobalSettings, subscribe, unsubscribe } from '../../../common/GlobalSettings'; import { MATTERPORT_ERROR } from '../../../common/constants'; import { OPTIONS_PLACEHOLDER_VALUE } from '../../../common/internalConstants'; @@ -15,7 +14,6 @@ import { getMatterportConnectionList, getUpdatedSceneInfoForConnection, } from '../../../utils/matterportIntegrationUtils'; - import { MatterportTagSync } from './MatterportTagSync'; export const MatterportIntegration: React.FC = () => { diff --git a/packages/scene-composer/src/components/panels/scene-settings/MatterportTagSync.tsx b/packages/scene-composer/src/components/panels/scene-settings/MatterportTagSync.tsx index 9cc3c6870..cb5df00f9 100644 --- a/packages/scene-composer/src/components/panels/scene-settings/MatterportTagSync.tsx +++ b/packages/scene-composer/src/components/panels/scene-settings/MatterportTagSync.tsx @@ -1,8 +1,7 @@ import { Button, Popover, StatusIndicator } from '@cloudscape-design/components'; -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback, useState } from 'react'; import { useIntl } from 'react-intl'; - import { useSceneComposerId } from '../../../common/sceneComposerIdContext'; import useMatterportObserver from '../../../hooks/useMatterportObserver'; import useMatterportTags from '../../../hooks/useMatterportTags'; diff --git a/packages/scene-composer/src/components/panels/scene-settings/SceneDataBindingTemplateEditor.tsx b/packages/scene-composer/src/components/panels/scene-settings/SceneDataBindingTemplateEditor.tsx index b54bc2803..5b54ecd2a 100644 --- a/packages/scene-composer/src/components/panels/scene-settings/SceneDataBindingTemplateEditor.tsx +++ b/packages/scene-composer/src/components/panels/scene-settings/SceneDataBindingTemplateEditor.tsx @@ -1,8 +1,7 @@ import { FormField, Select } from '@cloudscape-design/components'; -import { cloneDeep } from 'lodash'; +import cloneDeep from 'lodash-es/cloneDeep'; import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { useIntl } from 'react-intl'; - import { EMPTY_VALUE_DATA_BINDING_PROVIDER_STATE } from '../../../common/constants'; import { sceneComposerIdContext } from '../../../common/sceneComposerIdContext'; import { diff --git a/packages/scene-composer/src/components/three-fiber/ColorOverlayComponent/index.tsx b/packages/scene-composer/src/components/three-fiber/ColorOverlayComponent/index.tsx index 3715b0ece..c50a1009b 100644 --- a/packages/scene-composer/src/components/three-fiber/ColorOverlayComponent/index.tsx +++ b/packages/scene-composer/src/components/three-fiber/ColorOverlayComponent/index.tsx @@ -1,7 +1,6 @@ -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useEffect, useMemo } from 'react'; import { type Material, Mesh } from 'three'; - import { useSceneComposerId } from '../../../common/sceneComposerIdContext'; import useMaterialEffect from '../../../hooks/useMaterialEffect'; import useRuleResult from '../../../hooks/useRuleResult'; diff --git a/packages/scene-composer/src/components/toolbars/common/ItemContainer.tsx b/packages/scene-composer/src/components/toolbars/common/ItemContainer.tsx index 6b73b06e8..9fccf5d04 100644 --- a/packages/scene-composer/src/components/toolbars/common/ItemContainer.tsx +++ b/packages/scene-composer/src/components/toolbars/common/ItemContainer.tsx @@ -1,8 +1,6 @@ -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { forwardRef, type ReactNode, useCallback, useState } from 'react'; - import { getGlobalSettings } from '../../../common/GlobalSettings'; - import { Icon, SubMenuIconContainer, diff --git a/packages/scene-composer/src/hooks/useBindingData.ts b/packages/scene-composer/src/hooks/useBindingData.ts index fa485e276..67b6f9182 100644 --- a/packages/scene-composer/src/hooks/useBindingData.ts +++ b/packages/scene-composer/src/hooks/useBindingData.ts @@ -1,13 +1,11 @@ -import { useEffect, useMemo, useRef, useState } from 'react'; -import { type DataBase, type TimeSeriesData, type Primitive, type DurationViewport } from '@iot-app-kit/core'; -import { isEmpty } from 'lodash'; +import { type DataBase, type DurationViewport, type Primitive, type TimeSeriesData } from '@iot-app-kit/core'; import { type ITwinMakerEntityDataBindingContext } from '@iot-app-kit/source-iottwinmaker'; - +import isEmpty from 'lodash-es/isEmpty'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { useSceneComposerId } from '../common/sceneComposerIdContext'; import { type IValueDataBinding } from '../interfaces'; -import { useViewOptionState } from '../store'; import useLogger from '../logger/react-logger/hooks/useLogger'; - +import { useViewOptionState } from '../store'; import useBindingQueries from './useBindingQueries'; /** diff --git a/packages/scene-composer/src/hooks/useBindingQueries.ts b/packages/scene-composer/src/hooks/useBindingQueries.ts index 90231bbd5..79ae650da 100644 --- a/packages/scene-composer/src/hooks/useBindingQueries.ts +++ b/packages/scene-composer/src/hooks/useBindingQueries.ts @@ -1,7 +1,6 @@ -import { useMemo } from 'react'; import { type DataBase, type DataRequest, type Query, type TimeSeriesData } from '@iot-app-kit/core'; -import { isEmpty } from 'lodash'; - +import isEmpty from 'lodash-es/isEmpty'; +import { useMemo } from 'react'; import { useSceneComposerId } from '../common/sceneComposerIdContext'; import { type IValueDataBinding } from '../interfaces'; import { accessStore } from '../store'; diff --git a/packages/scene-composer/src/hooks/useMatterportTags.ts b/packages/scene-composer/src/hooks/useMatterportTags.ts index 4dee6352c..802dcca84 100644 --- a/packages/scene-composer/src/hooks/useMatterportTags.ts +++ b/packages/scene-composer/src/hooks/useMatterportTags.ts @@ -1,4 +1,4 @@ -import { isEmpty } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; import { useCallback } from 'react'; import { Color } from 'three'; import type { PartialDeep } from 'type-fest'; diff --git a/packages/scene-composer/src/hooks/useMatterportViewer.ts b/packages/scene-composer/src/hooks/useMatterportViewer.ts index 45337c0c9..e7039bac9 100644 --- a/packages/scene-composer/src/hooks/useMatterportViewer.ts +++ b/packages/scene-composer/src/hooks/useMatterportViewer.ts @@ -1,9 +1,8 @@ -import { isEmpty } from 'lodash'; - +import isEmpty from 'lodash-es/isEmpty'; +import { OPTIONS_PLACEHOLDER_VALUE } from '../common/internalConstants'; import { useSceneComposerId } from '../common/sceneComposerIdContext'; import { KnownSceneProperty } from '../interfaces'; import { accessStore, useViewOptionState } from '../store'; -import { OPTIONS_PLACEHOLDER_VALUE } from '../common/internalConstants'; const useMatterportViewer = (): { enableMatterportViewer: boolean } => { const sceneComposerId = useSceneComposerId(); diff --git a/packages/scene-composer/src/layouts/SceneLayout/SceneLayout.tsx b/packages/scene-composer/src/layouts/SceneLayout/SceneLayout.tsx index 1b1f5fae7..8ece4e588 100644 --- a/packages/scene-composer/src/layouts/SceneLayout/SceneLayout.tsx +++ b/packages/scene-composer/src/layouts/SceneLayout/SceneLayout.tsx @@ -1,18 +1,17 @@ +import { MatterportViewer, type MpSdk } from '@matterport/r3f/dist'; +import { useContextBridge } from '@react-three/drei/core/useContextBridge'; +import { Canvas, type ThreeEvent, useThree } from '@react-three/fiber'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import isEmpty from 'lodash-es/isEmpty'; import { type FC, Fragment, type ReactNode, Suspense, useContext, useEffect, useMemo, useRef } from 'react'; import { useIntl } from 'react-intl'; import styled, { ThemeContext } from 'styled-components'; -import { Canvas, type ThreeEvent, useThree } from '@react-three/fiber'; -import { useContextBridge } from '@react-three/drei/core/useContextBridge'; -import { MatterportViewer, type MpSdk } from '@matterport/r3f/dist'; -import { isEmpty } from 'lodash'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; - import { setMatterportSdk } from '../../common/GlobalSettings'; -import LoggingContext from '../../logger/react-logger/contexts/logging'; +import { sceneComposerIdContext, useSceneComposerId } from '../../common/sceneComposerIdContext'; +import DefaultErrorFallback from '../../components/DefaultErrorFallback'; import { MenuBar } from '../../components/MenuBar'; -import { StaticLayout } from '../StaticLayout'; +import { SceneLayers } from '../../components/SceneLayers'; import { WebGLCanvasManager } from '../../components/WebGLCanvasManager'; -import { FloatingToolbar } from '../../components/toolbars'; import { SceneHierarchyPanel, SceneNodeInspectorPanel, @@ -20,22 +19,21 @@ import { SettingsPanel, TopBar, } from '../../components/panels'; -import { sceneComposerIdContext, useSceneComposerId } from '../../common/sceneComposerIdContext'; -import { useSceneDocument, accessStore } from '../../store'; -import LogProvider from '../../logger/react-logger/log-provider'; -import DefaultErrorFallback from '../../components/DefaultErrorFallback'; -import { type ExternalLibraryConfig, KnownComponentType, type MatterportConfig } from '../../interfaces'; import { CameraPreview } from '../../components/three-fiber/CameraPreview'; +import { FloatingToolbar } from '../../components/toolbars'; +import useDynamicScene from '../../hooks/useDynamicScene'; import useMatterportViewer from '../../hooks/useMatterportViewer'; +import useSceneModal from '../../hooks/useSceneModal'; import useSelectedNode from '../../hooks/useSelectedNode'; +import { type ExternalLibraryConfig, KnownComponentType, type MatterportConfig } from '../../interfaces'; +import LoggingContext from '../../logger/react-logger/contexts/logging'; +import LogProvider from '../../logger/react-logger/log-provider'; +import { accessStore, useSceneDocument } from '../../store'; import { findComponentByType } from '../../utils/nodeUtils'; -import useDynamicScene from '../../hooks/useDynamicScene'; -import { SceneLayers } from '../../components/SceneLayers'; -import useSceneModal from '../../hooks/useSceneModal'; - -import { Direction } from './components/utils'; -import ScenePanel from './components/ScenePanel'; +import { StaticLayout } from '../StaticLayout'; import CameraPreviewTrack from './components/CameraPreviewTrack'; +import ScenePanel from './components/ScenePanel'; +import { Direction } from './components/utils'; const queryClient = new QueryClient(); diff --git a/packages/scene-composer/src/layouts/SceneLayout/__snapshots__/SceneLayout.spec.tsx.snap b/packages/scene-composer/src/layouts/SceneLayout/__snapshots__/SceneLayout.spec.tsx.snap index a5d72adde..1c66d9288 100644 --- a/packages/scene-composer/src/layouts/SceneLayout/__snapshots__/SceneLayout.spec.tsx.snap +++ b/packages/scene-composer/src/layouts/SceneLayout/__snapshots__/SceneLayout.spec.tsx.snap @@ -3,16 +3,20 @@ exports[`SceneLayout > should not render camera preview if editing and non-camera component is on selectedNode 1`] = `
should not render camera preview if editing and non-camer class="tm-collapse-panel open" >
-
-
    - - - -
-
-
-
-
-
-
-
+ class="tm-sidePanelTabs" + data-mocked="Tabs" + tabs="[object Object],[object Object],[object Object]" + />
- - - +
- - - +
- - - +
- - - +
should not render camera preview if editing and non-camer
- Add empty node - +
- Add 3D model - +
- Add light - +
- Add camera from current view - +
- Add tag - +
- Add annotation - +
- Add model shader - +
- Add motion indicator - +
- +
+
should not render camera preview if editing and non-camer
- +
+
- 3D Orbit - +
- +
+ + + + + +
+
- 3D Pan - +
- +
+ + + + + +
+
- +
+ + + + + + + +
+
should not render camera preview if editing and non-camer
- +
+
- Translate object - +
- +
+
- Rotate object - +
- +
+
- Scale object - + @@ -787,7 +731,8 @@ exports[`SceneLayout > should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer class="tm-collapse-panel open" >
-
-
    - -
-
-
-
-
-
-
- - - -
-
-
- - Properties - -
-
-
-
-
-
-
-
-

- No node selected. -

-
-
-
-
-
-
-
-
-
+ class="tm-sidePanelTabs" + data-mocked="Tabs" + tabs="[object Object]" + />
- - - +
@@ -941,19 +767,23 @@ exports[`SceneLayout > should not render camera preview if editing and non-camer `; -exports[`SceneLayout > should not render camera preview if editing and non-camera component is on selectedNode 2`] = ` +exports[`SceneLayout > should render camera preview if editing and camera component is on selectedNode 1`] = `
should not render camera preview if editing and non-camer class="tm-collapse-panel open" >
-
-
    - - - -
-
-
-
-
-
-
-
+ class="tm-sidePanelTabs" + data-mocked="Tabs" + tabs="[object Object],[object Object],[object Object]" + />
- - - +
- - - +
- - - +
- - - +
should not render camera preview if editing and non-camer
- Add empty node - +
- Add 3D model - +
- Add light - +
- Add camera from current view - +
- Add tag - +
- Add annotation - +
- Add model shader - +
- Add motion indicator - +
- +
+
should not render camera preview if editing and non-camer
- +
+
- 3D Orbit - +
- +
+ + + + + +
+
- 3D Pan - +
- +
+ + + + + +
+
- +
+
should not render camera preview if editing and non-camer
- + + + + + +
+
+
- Translate object - +
- +
+
- Rotate object - +
- +
+
- Scale object - + @@ -1737,10 +1495,23 @@ exports[`SceneLayout > should not render camera preview if editing and non-camer +
+
+ Test Camera +
+
+
should not render camera preview if editing and non-camer class="tm-collapse-panel open" >
-
-
    - -
-
-
-
-
-
-
- - - -
-
-
- - Properties - -
-
-
-
-
-
-
-
-

- No node selected. -

-
-
-
-
-
-
-
-
-
+ class="tm-sidePanelTabs" + data-mocked="Tabs" + tabs="[object Object]" + />
- - - +
@@ -1898,7 +1546,7 @@ exports[`SceneLayout > should not render camera preview if editing and non-camer `; -exports[`SceneLayout > should not render camera preview if editing and non-camera component is on selectedNode 3`] = ` +exports[`SceneLayout > should render correctly in Edit mode 1`] = `
should not render camera preview if editing and non-camer data-mocked="Box" >
should not render camera preview if editing and non-camer title="Undo" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Redo" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Add object" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Orbit" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Orbit" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Pan" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Delete" >
@@ -2389,12 +2037,12 @@ exports[`SceneLayout > should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Translate" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Translate" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Rotate" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer title="Scale" >
should not render camera preview if editing and non-camer
should not render camera preview if editing and non-camer
`; -exports[`SceneLayout > should render camera preview if editing and camera component is on selectedNode 1`] = ` -
-
-
-
-
-
-
-
-
-
-
    - - - -
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - -
-
- - - -
-
-
-
- - Add empty node - -
-
- - Add 3D model - -
-
- - Add light - -
-
- - Add camera from current view - -
-
- - Add tag - -
-
- - Add annotation - -
-
- - Add model shader - -
-
- - Add motion indicator - -
-
-
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - 3D Orbit - -
-
-
- - - -
- - 3D Pan - -
-
-
-
-
-
-
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - Translate object - -
-
-
- - - -
- - Rotate object - -
-
-
- - - -
- - Scale object - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
    - -
-
-
-
-
-
-
- - - -
-
-
- - Properties - -
-
-
-
-
-
-
-
-

- No node selected. -

-
-
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-`; - -exports[`SceneLayout > should render camera preview if editing and camera component is on selectedNode 2`] = ` -
-
-
-
-
-
-
-
-
-
-
    - - - -
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - -
-
- - - -
-
-
-
- - Add empty node - -
-
- - Add 3D model - -
-
- - Add light - -
-
- - Add camera from current view - -
-
- - Add tag - -
-
- - Add annotation - -
-
- - Add model shader - -
-
- - Add motion indicator - -
-
-
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - 3D Orbit - -
-
-
- - - -
- - 3D Pan - -
-
-
-
-
-
-
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - Translate object - -
-
-
- - - -
- - Rotate object - -
-
-
- - - -
- - Scale object - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
    - -
-
-
-
-
-
-
- - - -
-
-
- - Properties - -
-
-
-
-
-
-
-
-

- No node selected. -

-
-
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-`; - -exports[`SceneLayout > should render camera preview if editing and camera component is on selectedNode 3`] = ` -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
-
- -
- -
-
- - - -
-
-
-
-
- Add empty node -
-
-
-
- Add 3D model -
-
-
-
- Add light -
-
-
-
- Add camera from current view -
-
-
-
- Add tag -
-
-
-
- Add annotation -
-
-
-
- Add model shader -
-
-
-
- Add motion indicator -
-
-
-
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
- - - -
-
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
- 3D Orbit -
-
-
-
- -
-
- - - - - -
-
-
-
-
- 3D Pan -
-
-
-
-
-
-
-
-
- -
-
- - - - - -
-
-
-
-
-
-
- -
-
- - - - - - - -
-
-
-
-
- - - -
-
-
-
-
- -
-
- - - - - - - -
-
-
-
-
- Translate object -
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
- Rotate object -
-
-
-
- -
-
- - - - - - - - - -
-
-
-
-
- Scale object -
-
-
-
-
-
-
-
-
-
- Test Camera -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-`; - -exports[`SceneLayout > should render correctly in Edit mode 1`] = ` -
-
-
-
-
-
-
-
-
-
-
    - - - -
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - -
-
- - - -
-
-
-
- - Add empty node - -
-
- - Add 3D model - -
-
- - Add light - -
-
- - Add camera from current view - -
-
- - Add tag - -
-
- - Add annotation - -
-
- - Add model shader - -
-
- - Add motion indicator - -
-
-
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - 3D Orbit - -
-
-
- - - -
- - 3D Pan - -
-
-
-
-
-
-
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - Translate object - -
-
-
- - - -
- - Rotate object - -
-
-
- - - -
- - Scale object - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
    - -
-
-
-
-
-
-
- - - -
-
-
- - Properties - -
-
-
-
-
-
-
-
-

- No node selected. -

-
-
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-`; - -exports[`SceneLayout > should render correctly in Edit mode 2`] = ` -
-
-
-
-
-
-
-
-
-
-
    - - - -
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - -
-
-
-
- - - - - -
-
-
-
-
-
- - - - - -
-
- - - -
-
-
-
- - Add empty node - -
-
- - Add 3D model - -
-
- - Add light - -
-
- - Add camera from current view - -
-
- - Add tag - -
-
- - Add annotation - -
-
- - Add model shader - -
-
- - Add motion indicator - -
-
-
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - 3D Orbit - -
-
-
- - - -
- - 3D Pan - -
-
-
-
-
-
-
-
- - - -
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - Translate object - -
-
-
- - - -
- - Rotate object - -
-
-
- - - -
- - Scale object - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
    - -
-
-
-
-
-
-
- - - -
-
-
- - Properties - -
-
-
-
-
-
-
-
-

- No node selected. -

-
-
-
-
-
-
-
-
-
-
-
-
- - - -
-
-
-
-
-
-`; - -exports[`SceneLayout > should render correctly in Edit mode 3`] = ` -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
- -
-
-
-
- -
- -
-
-
-
-
-
- -
- -
-
- - - -
-
-
-
-
- Add empty node -
-
-
-
- Add 3D model -
-
-
-
- Add light -
-
-
-
- Add camera from current view -
-
-
-
- Add tag -
-
-
-
- Add annotation -
-
-
-
- Add model shader -
-
-
-
- Add motion indicator -
-
-
-
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
- - - -
-
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
- 3D Orbit -
-
-
-
- -
-
- - - - - -
-
-
-
-
- 3D Pan -
-
-
-
-
-
-
-
-
- -
-
- - - - - -
-
-
-
-
-
-
- -
-
- - - - - - - -
-
-
-
-
- - - -
-
-
-
-
- -
-
- - - - - - - -
-
-
-
-
- Translate object -
-
-
-
- -
-
- - - - - - - - - - -
-
-
-
-
- Rotate object -
-
-
-
- -
-
- - - - - - - - - -
-
-
-
-
- Scale object -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-`; - -exports[`SceneLayout > should render correctly in Viewing mode 1`] = ` -
-
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - 3D Orbit - -
-
-
- - - -
- - 3D Pan - -
-
-
-
-
-
-
-
-
-
-
-
-`; - -exports[`SceneLayout > should render correctly in Viewing mode 2`] = ` -
-
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
-
-
- - - -
-
- - - -
-
-
-
-
- - - -
- - 3D Orbit - -
-
-
- - - -
- - 3D Pan - -
-
-
-
-
-
-
-
-
-
-
-
-`; - -exports[`SceneLayout > should render correctly in Viewing mode 3`] = ` +exports[`SceneLayout > should render correctly in Viewing mode 1`] = `
should render correctly in Viewing mode 3`] = ` data-mocked="Box" >
should render correctly in Viewing mode 3`] = ` title="Orbit" >
should render correctly in Viewing mode 3`] = `
should render correctly in Viewing mode 3`] = `
should render correctly in Viewing mode 3`] = ` title="Orbit" >
should render correctly in Viewing mode 3`] = `
should render correctly in Viewing mode 3`] = `
should render correctly in Viewing mode 3`] = ` title="Pan" >
should render correctly in Viewing mode 3`] = `
}, diff --git a/packages/scene-composer/src/store/helpers/sceneDocumentHelpers.ts b/packages/scene-composer/src/store/helpers/sceneDocumentHelpers.ts index baf2cfc83..1274d8bac 100644 --- a/packages/scene-composer/src/store/helpers/sceneDocumentHelpers.ts +++ b/packages/scene-composer/src/store/helpers/sceneDocumentHelpers.ts @@ -1,4 +1,5 @@ -import { cloneDeep, isEmpty } from 'lodash'; +import cloneDeep from 'lodash-es/cloneDeep'; +import isEmpty from 'lodash-es/isEmpty'; import type { PartialDeep } from 'type-fest'; import { RESERVED_LAYER_ID } from '../../common/entityModelConstants'; import type ILogger from '../../logger/ILogger'; diff --git a/packages/scene-composer/src/store/helpers/serializationHelpers.ts b/packages/scene-composer/src/store/helpers/serializationHelpers.ts index cb7ca50e6..0422c921d 100644 --- a/packages/scene-composer/src/store/helpers/serializationHelpers.ts +++ b/packages/scene-composer/src/store/helpers/serializationHelpers.ts @@ -1,5 +1,4 @@ -import { isNumber } from 'lodash'; - +import isNumber from 'lodash-es/isNumber'; import { CURRENT_MAJOR_VERSION, CURRENT_MINOR_VERSION, @@ -11,22 +10,25 @@ import { } from '../../common/constants'; import { ERROR_MESSAGE_DICT, ErrorCode, ErrorLevel, SceneComposerRuntimeError } from '../../common/errors'; import { + DEFAULT_FOG_COLOR, + DEFAULT_FOG_FAR, + DEFAULT_FOG_NEAR, + DEFAULT_GROUND_PLANE_COLOR, + DEFAULT_SCENE_BACKGROUND_COLOR, KnownComponentType, KnownSceneProperty, type IFogSettings, type IGroundPlaneSettings, type ISceneBackgroundSetting, - DEFAULT_FOG_COLOR, - DEFAULT_FOG_NEAR, - DEFAULT_FOG_FAR, - DEFAULT_SCENE_BACKGROUND_COLOR, - DEFAULT_GROUND_PLANE_COLOR, } from '../../interfaces'; import DebugLogger from '../../logger/DebugLogger'; -import { Component, type DistanceUnit, ModelType, type Node, type Scene } from '../../models/SceneModels'; +import { Component, ModelType, type DistanceUnit, type Node, type Scene } from '../../models/SceneModels'; +import { isValidHexCode } from '../../utils/colorUtils'; import { isDynamicNode } from '../../utils/entityModelUtils/sceneUtils'; import { colorToHexString, generateUUID } from '../../utils/mathUtils'; import { + SceneNodeRuntimeProperty, + isISceneComponentInternal, type IAnchorComponentInternal, type IAnimationComponentInternal, type ICameraComponentInternal, @@ -37,18 +39,14 @@ import { type ILightComponentInternal, type IModelRefComponentInternal, type IMotionIndicatorComponentInternal, + type IPlaneGeometryComponentInternal, type IRuleBasedMapInternal, type ISceneComponentInternal, type ISceneDocumentInternal, type ISceneNodeInternal, type ISerializationErrorDetails, type ISubModelRefComponentInternal, - SceneNodeRuntimeProperty, - isISceneComponentInternal, - type IPlaneGeometryComponentInternal, } from '../internalInterfaces'; -import { isValidHexCode } from '../../utils/colorUtils'; - import { addComponentToComponentNodeMap } from './componentMapHelpers'; const LOG = new DebugLogger('serializationHelpers'); diff --git a/packages/scene-composer/src/store/slices/SceneDocumentSlice.spec.ts b/packages/scene-composer/src/store/slices/SceneDocumentSlice.spec.ts index fd5bded74..7e5c13fb6 100644 --- a/packages/scene-composer/src/store/slices/SceneDocumentSlice.spec.ts +++ b/packages/scene-composer/src/store/slices/SceneDocumentSlice.spec.ts @@ -1,24 +1,22 @@ -import cloneDeep from 'lodash/cloneDeep'; +import { ComponentUpdateType } from '@aws-sdk/client-iottwinmaker'; import flushPromises from 'flush-promises'; +import cloneDeep from 'lodash-es/cloneDeep'; import { Object3D } from 'three'; -import { ComponentUpdateType } from '@aws-sdk/client-iottwinmaker'; - import { type IAnchorComponentInternal, type IDataOverlayComponentInternal, type ISceneNodeInternal } from '..'; import { COMPOSER_FEATURES, type IErrorDetails, KnownComponentType, KnownSceneProperty } from '../..'; +import { setFeatureConfig, setOnFlashMessage } from '../../common/GlobalSettings'; +import { RESERVED_LAYER_ID } from '../../common/entityModelConstants'; import { Component } from '../../models/SceneModels'; import { containsMatchingEntityComponent } from '../../utils/dataBindingUtils'; +import { createNodeEntity } from '../../utils/entityModelUtils/createNodeEntity'; import { deleteNodeEntity } from '../../utils/entityModelUtils/deleteNodeEntity'; +import { updateSceneRootEntity } from '../../utils/entityModelUtils/sceneUtils'; import { updateEntity } from '../../utils/entityModelUtils/updateNodeEntity'; import { mergeDeep } from '../../utils/objectUtils'; import interfaceHelpers from '../helpers/interfaceHelpers'; +import { appendSceneNode } from '../helpers/sceneDocumentHelpers'; import serializationHelpers from '../helpers/serializationHelpers'; import { DisplayMessageCategory, SceneNodeRuntimeProperty } from '../internalInterfaces'; -import { appendSceneNode } from '../helpers/sceneDocumentHelpers'; -import { createNodeEntity } from '../../utils/entityModelUtils/createNodeEntity'; -import { updateSceneRootEntity } from '../../utils/entityModelUtils/sceneUtils'; -import { setFeatureConfig, setOnFlashMessage } from '../../common/GlobalSettings'; -import { RESERVED_LAYER_ID } from '../../common/entityModelConstants'; - import { createSceneDocumentSlice } from './SceneDocumentSlice'; vi.mock('../../../src/utils/objectUtils', () => { diff --git a/packages/scene-composer/src/store/slices/SceneDocumentSlice.ts b/packages/scene-composer/src/store/slices/SceneDocumentSlice.ts index 4e1f5f741..185d7b724 100644 --- a/packages/scene-composer/src/store/slices/SceneDocumentSlice.ts +++ b/packages/scene-composer/src/store/slices/SceneDocumentSlice.ts @@ -1,6 +1,8 @@ import { ComponentUpdateType } from '@aws-sdk/client-iottwinmaker'; import { isDataBindingTemplate } from '@iot-app-kit/source-iottwinmaker'; -import { cloneDeep, isEmpty, isString } from 'lodash'; +import cloneDeep from 'lodash-es/cloneDeep'; +import isEmpty from 'lodash-es/isEmpty'; +import isString from 'lodash-es/isString'; import type { PartialDeep } from 'type-fest'; import { type StoreApi } from 'zustand'; import { getGlobalSettings } from '../../common/GlobalSettings'; diff --git a/packages/scene-composer/src/utils/dataBindingTemplateUtils.spec.ts b/packages/scene-composer/src/utils/dataBindingTemplateUtils.spec.ts index e6ba8bfe6..291723229 100644 --- a/packages/scene-composer/src/utils/dataBindingTemplateUtils.spec.ts +++ b/packages/scene-composer/src/utils/dataBindingTemplateUtils.spec.ts @@ -1,7 +1,5 @@ -import { pick } from 'lodash'; - +import pick from 'lodash-es/pick'; import { type IDataBindingTemplate } from '../interfaces'; - import { applyDataBindingTemplate, dataBindingConfigSelector, extractEntityId } from './dataBindingTemplateUtils'; describe('dataBindingTemplatesSelector', () => { diff --git a/packages/scene-composer/src/utils/dataBindingTemplateUtils.ts b/packages/scene-composer/src/utils/dataBindingTemplateUtils.ts index 72920e6f0..bff95eb55 100644 --- a/packages/scene-composer/src/utils/dataBindingTemplateUtils.ts +++ b/packages/scene-composer/src/utils/dataBindingTemplateUtils.ts @@ -1,11 +1,11 @@ -import { cloneDeep, pick } from 'lodash'; import { type IDataBindingConfig, type IDataBindingTemplate, type ITwinMakerDataBindingContext, undecorateDataBindingTemplate, } from '@iot-app-kit/source-iottwinmaker'; - +import cloneDeep from 'lodash-es/cloneDeep'; +import pick from 'lodash-es/pick'; import { DEFAULT_DATA_BINDING_TEMPLATE_COMPONENT_NAME, DEFAULT_DATA_BINDING_TEMPLATE_ENTITY_ID, diff --git a/packages/scene-composer/src/utils/dataBindingUtils.ts b/packages/scene-composer/src/utils/dataBindingUtils.ts index 2e7d9b088..ce221df66 100644 --- a/packages/scene-composer/src/utils/dataBindingUtils.ts +++ b/packages/scene-composer/src/utils/dataBindingUtils.ts @@ -1,7 +1,7 @@ import { type Primitive } from '@iot-app-kit/core'; import jexl from 'jexl'; -import { isEqual, pick } from 'lodash'; - +import isEqual from 'lodash-es/isEqual'; +import pick from 'lodash-es/pick'; import { DataBindingLabelKeys } from '../common/constants'; import { DataFieldTimeType, @@ -15,7 +15,6 @@ import { type TargetMetadata, } from '../interfaces'; import DebugLogger from '../logger/DebugLogger'; - import { applyDataBindingTemplate } from './dataBindingTemplateUtils'; const LOG = new DebugLogger('dataBindingUtils'); diff --git a/packages/scene-composer/src/utils/entityModelUtils/dataBindingUtils.ts b/packages/scene-composer/src/utils/entityModelUtils/dataBindingUtils.ts index bf51464c4..3e4fd92ae 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/dataBindingUtils.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/dataBindingUtils.ts @@ -4,8 +4,7 @@ import { type ITwinMakerDataBindingContext, type ITwinMakerEntityDataBindingContext, } from '@iot-app-kit/source-iottwinmaker'; -import { isEmpty } from 'lodash'; - +import isEmpty from 'lodash-es/isEmpty'; import { type ValueDataBinding } from '../../models/SceneModels'; enum DataBindingPropertyKey { diff --git a/packages/scene-composer/src/utils/entityModelUtils/motionIndicatorComponent.ts b/packages/scene-composer/src/utils/entityModelUtils/motionIndicatorComponent.ts index 24dd51a20..55011b7e9 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/motionIndicatorComponent.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/motionIndicatorComponent.ts @@ -1,13 +1,11 @@ import { type ComponentRequest, type ComponentUpdateRequest } from '@aws-sdk/client-iottwinmaker'; import { type DocumentType } from '@aws-sdk/types'; -import { isEmpty } from 'lodash'; - -import { type IMotionIndicatorComponent, KnownComponentType } from '../../interfaces'; +import isEmpty from 'lodash-es/isEmpty'; import { componentTypeToId } from '../../common/entityModelConstants'; -import { generateUUID } from '../mathUtils'; -import { type IMotionIndicatorComponentInternal } from '../../store'; +import { type IMotionIndicatorComponent, KnownComponentType } from '../../interfaces'; import { type Component } from '../../models/SceneModels'; - +import { type IMotionIndicatorComponentInternal } from '../../store'; +import { generateUUID } from '../mathUtils'; import { createDataBindingMap, parseDataBinding } from './dataBindingUtils'; import { resetProperties } from './updateNodeEntity'; diff --git a/packages/scene-composer/src/utils/entityModelUtils/nodeComponent.ts b/packages/scene-composer/src/utils/entityModelUtils/nodeComponent.ts index 9fa55bae4..ee3d7979f 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/nodeComponent.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/nodeComponent.ts @@ -1,27 +1,25 @@ import { type ComponentRequest, type ComponentUpdateRequest, PropertyUpdateType } from '@aws-sdk/client-iottwinmaker'; import { type DocumentType } from '@aws-sdk/types'; -import { isEmpty } from 'lodash'; - -import { type IEntityBindingComponent, type ISceneNode } from '../../interfaces'; +import isEmpty from 'lodash-es/isEmpty'; import { + componentTypeToId, DEFAULT_ENTITY_BINDING_RELATIONSHIP_NAME, NODE_COMPONENT_TYPE_ID, - componentTypeToId, RESERVED_LAYER_ID, } from '../../common/entityModelConstants'; +import { type IEntityBindingComponent, type ISceneNode } from '../../interfaces'; import { type ISceneComponentInternal, type ISceneNodeInternal } from '../../store'; import { SceneNodeRuntimeProperty } from '../../store/internalInterfaces'; - -import { attachToLayerRequest } from './sceneLayerUtils'; -import { parseTagComp } from './tagComponent'; -import { parseOverlayComp } from './overlayComponent'; -import { parseModelRefComp } from './modelRefComponent'; import { parseCameraComp } from './cameraComponent'; -import { parseMotionIndicatorComp } from './motionIndicatorComponent'; -import { parseModelShaderComp } from './modelShaderComponent'; import { parseLightComp } from './lightComponent'; -import { parseSubModelRefComp } from './subModelRefComponent'; +import { parseModelRefComp } from './modelRefComponent'; +import { parseModelShaderComp } from './modelShaderComponent'; +import { parseMotionIndicatorComp } from './motionIndicatorComponent'; +import { parseOverlayComp } from './overlayComponent'; import { parsePlaneGeometryComp } from './planeGeometryComponent'; +import { attachToLayerRequest } from './sceneLayerUtils'; +import { parseSubModelRefComp } from './subModelRefComponent'; +import { parseTagComp } from './tagComponent'; export enum NodeComponentProperty { Name = 'name', diff --git a/packages/scene-composer/src/utils/entityModelUtils/overlayComponent.ts b/packages/scene-composer/src/utils/entityModelUtils/overlayComponent.ts index caee8db91..e08e162ef 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/overlayComponent.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/overlayComponent.ts @@ -1,13 +1,11 @@ import { type ComponentRequest, type ComponentUpdateRequest, PropertyUpdateType } from '@aws-sdk/client-iottwinmaker'; -import { isEmpty } from 'lodash'; import { type DocumentType } from '@aws-sdk/types'; - -import { type IDataOverlayComponent, KnownComponentType } from '../../interfaces'; +import isEmpty from 'lodash-es/isEmpty'; import { MAX_PROPERTY_STRING_LENGTH, componentTypeToId } from '../../common/entityModelConstants'; +import { type IDataOverlayComponent, KnownComponentType } from '../../interfaces'; import { type Component } from '../../models/SceneModels'; import { type IDataOverlayComponentInternal } from '../../store'; import { generateUUID } from '../mathUtils'; - import { createDataBindingMap, parseDataBinding } from './dataBindingUtils'; import { resetProperties } from './updateNodeEntity'; diff --git a/packages/scene-composer/src/utils/entityModelUtils/sceneComponent.ts b/packages/scene-composer/src/utils/entityModelUtils/sceneComponent.ts index eb1ca2fac..9a4aa036d 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/sceneComponent.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/sceneComponent.ts @@ -4,8 +4,10 @@ import { type DataValue, type GetEntityCommandOutput, } from '@aws-sdk/client-iottwinmaker'; -import { isEmpty, isFinite } from 'lodash'; - +import isEmpty from 'lodash-es/isEmpty'; +import isFinite from 'lodash-es/isFinite'; +import { CURRENT_VERSION, DEFAULT_DISTANCE_UNIT, DEFAULT_TAG_GLOBAL_SETTINGS } from '../../common/constants'; +import { RESERVED_LAYER_ID, SCENE_COMPONENT_TYPE_ID } from '../../common/entityModelConstants'; import { type IComponentSettingsMap, type IDataBindingConfig, @@ -17,8 +19,6 @@ import { KnownComponentType, KnownSceneProperty, } from '../../interfaces'; -import { SCENE_COMPONENT_TYPE_ID, RESERVED_LAYER_ID } from '../../common/entityModelConstants'; -import { CURRENT_VERSION, DEFAULT_DISTANCE_UNIT, DEFAULT_TAG_GLOBAL_SETTINGS } from '../../common/constants'; import { type ISceneDocumentInternal } from '../../store'; enum SceneComponentProperty { diff --git a/packages/scene-composer/src/utils/entityModelUtils/sceneUtils.ts b/packages/scene-composer/src/utils/entityModelUtils/sceneUtils.ts index acca19955..eb305eb22 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/sceneUtils.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/sceneUtils.ts @@ -6,22 +6,20 @@ import { type UpdateEntityCommandOutput, } from '@aws-sdk/client-iottwinmaker'; import { type TwinMakerSceneMetadataModule } from '@iot-app-kit/source-iottwinmaker'; -import { isEmpty } from 'lodash'; - +import isEmpty from 'lodash-es/isEmpty'; import { - DEFAULT_PARENT_RELATIONSHIP_NAME, DEFAULT_ENTITY_BINDING_RELATIONSHIP_NAME, + DEFAULT_PARENT_RELATIONSHIP_NAME, + RESERVED_LAYER_ID, SCENE_ROOT_ENTITY_COMPONENT_NAME, SCENE_ROOT_ENTITY_ID, SCENE_ROOT_ENTITY_NAME, - RESERVED_LAYER_ID, } from '../../common/entityModelConstants'; import { getGlobalSettings } from '../../common/GlobalSettings'; -import { generateUUID } from '../mathUtils'; -import { type ISceneDocumentInternal, type ISceneNodeInternal } from '../../store'; import { type ISceneDocument, KnownSceneProperty } from '../../interfaces'; +import { type ISceneDocumentInternal, type ISceneNodeInternal } from '../../store'; import { SceneNodeRuntimeProperty } from '../../store/internalInterfaces'; - +import { generateUUID } from '../mathUtils'; import { createNodeEntity } from './createNodeEntity'; import { processQueries } from './processQueries'; import { updateSceneEntityComponent } from './sceneComponent'; diff --git a/packages/scene-composer/src/utils/entityModelUtils/tagComponent.ts b/packages/scene-composer/src/utils/entityModelUtils/tagComponent.ts index 58d4e549e..e9de5df8c 100644 --- a/packages/scene-composer/src/utils/entityModelUtils/tagComponent.ts +++ b/packages/scene-composer/src/utils/entityModelUtils/tagComponent.ts @@ -1,12 +1,10 @@ import { type ComponentRequest, type ComponentUpdateRequest, PropertyUpdateType } from '@aws-sdk/client-iottwinmaker'; import { type DocumentType } from '@aws-sdk/types'; -import { isEmpty } from 'lodash'; - -import { type IAnchorComponent, KnownComponentType } from '../../interfaces'; +import isEmpty from 'lodash-es/isEmpty'; import { componentTypeToId } from '../../common/entityModelConstants'; +import { type IAnchorComponent, KnownComponentType } from '../../interfaces'; import { type IAnchorComponentInternal } from '../../store'; import { generateUUID } from '../mathUtils'; - import { createDataBindingMap, parseDataBinding } from './dataBindingUtils'; import { resetProperties } from './updateNodeEntity'; diff --git a/packages/scene-composer/src/utils/stringUtils.ts b/packages/scene-composer/src/utils/stringUtils.ts index 0e4b8dcae..9a36f3bf2 100644 --- a/packages/scene-composer/src/utils/stringUtils.ts +++ b/packages/scene-composer/src/utils/stringUtils.ts @@ -1,4 +1,5 @@ -import { upperFirst, camelCase } from 'lodash'; +import camelCase from 'lodash-es/camelCase'; +import upperFirst from 'lodash-es/upperFirst'; const templateVarRegex = /{{[^{][\s\S]*?}}/g; diff --git a/packages/scene-composer/stories/useMockedValueDataBindingProvider.ts b/packages/scene-composer/stories/useMockedValueDataBindingProvider.ts index 5fc70edf6..99aebda9d 100644 --- a/packages/scene-composer/stories/useMockedValueDataBindingProvider.ts +++ b/packages/scene-composer/stories/useMockedValueDataBindingProvider.ts @@ -1,30 +1,28 @@ -import { isEqual } from 'lodash'; - +import isEqual from 'lodash-es/isEqual'; +import { + COMPONENT_NAME_INDEX, + ENTITY_ID_INDEX, + PROPERTY_NAME_INDEX, +} from '../src/components/panels/scene-components/common/ValueDataBindingBuilder'; import { - type IValueDataBindingProvider, - type IDataFieldOption, type IDataBindingConfig, + type IDataFieldOption, type IValueDataBinding, - type IValueDataBindingStore, + type IValueDataBindingProvider, type IValueDataBindingProviderState, + type IValueDataBindingStore, } from '../src/interfaces'; +import { FIELDS, MOCK_DELAY } from './constants'; +import { type FIELD_NAME, type MockedValueDataBindingProviderStore } from './types'; import { - ENTITY_ID_INDEX, - COMPONENT_NAME_INDEX, - PROPERTY_NAME_INDEX, -} from '../src/components/panels/scene-components/common/ValueDataBindingBuilder'; - -import { - asyncLoadEntityOptions, asyncLoadComponentNameOptions, + asyncLoadEntityOptions, asyncLoadPropertyNameOptions, cloneStoreState, createEmtpyStoreState, createIdenticalLabelOption, validateEntityId, } from './useMockedValueDataBindingProviderUtils'; -import { type FIELD_NAME, type MockedValueDataBindingProviderStore } from './types'; -import { FIELDS, MOCK_DELAY } from './constants'; export const propertyNames = Object.seal(['temperature']); diff --git a/packages/scene-composer/tests/components/panels/scene-components/LightComponentEditor.spec.tsx b/packages/scene-composer/tests/components/panels/scene-components/LightComponentEditor.spec.tsx index 1ea6e7bb5..f40c8d387 100644 --- a/packages/scene-composer/tests/components/panels/scene-components/LightComponentEditor.spec.tsx +++ b/packages/scene-composer/tests/components/panels/scene-components/LightComponentEditor.spec.tsx @@ -1,14 +1,11 @@ /* eslint-disable import/first */ -import { render } from '@testing-library/react'; import wrapper from '@cloudscape-design/components/test-utils/dom'; -import _ from 'lodash'; - +import { render } from '@testing-library/react'; +import { DEFAULT_LIGHT_SETTINGS_MAP } from '../../../../src/common/constants'; import { LightComponentEditor } from '../../../../src/components/panels/scene-components/LightComponentEditor'; import { LightType } from '../../../../src/models/SceneModels'; -import { DEFAULT_LIGHT_SETTINGS_MAP } from '../../../../src/common/constants'; import { type ILightComponentInternal, accessStore } from '../../../../src/store'; - -import { mockNode, mockComponent } from './MockComponents'; +import { mockComponent, mockNode } from './MockComponents'; const mockParse = vi.fn((_str: string, _defaultValue: number) => { return 2; diff --git a/packages/source-iotsitewise/package.json b/packages/source-iotsitewise/package.json index e6403b0ac..660e1c09a 100644 --- a/packages/source-iotsitewise/package.json +++ b/packages/source-iotsitewise/package.json @@ -56,18 +56,14 @@ "@iot-app-kit/core-util": "*", "@synchro-charts/core": "7.2.0", "dataloader": "^2.2.2", - "lodash.isequal": "^4.5.0", - "lodash.merge": "^4.6.2", - "lodash.uniqwith": "^4.5.0", + "lodash-es": "^4.17.21", "rxjs": "^7.8.1" }, "devDependencies": { "@aws-sdk/types": "^3.696.0", "@iot-app-kit/testing-util": "*", "@iot-app-kit/ts-config": "*", - "@types/lodash.isequal": "^4.5.6", - "@types/lodash.merge": "^4.6.7", - "@types/lodash.uniqwith": "^4.5.7", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@vitest/coverage-v8": "^2.1.5", "eslint-config-iot-app-kit": "*", diff --git a/packages/source-iotsitewise/src/alarms/iotevents/util/getAlarmStateProperty.ts b/packages/source-iotsitewise/src/alarms/iotevents/util/getAlarmStateProperty.ts index 65cb3ee0e..d39f5c81d 100644 --- a/packages/source-iotsitewise/src/alarms/iotevents/util/getAlarmStateProperty.ts +++ b/packages/source-iotsitewise/src/alarms/iotevents/util/getAlarmStateProperty.ts @@ -1,9 +1,9 @@ import type { - DescribeAssetModelResponse, - AssetModelProperty, AssetModelCompositeModel, + AssetModelProperty, + DescribeAssetModelResponse, } from '@aws-sdk/client-iotsitewise'; -import first from 'lodash/first'; +import first from 'lodash-es/first'; import { isDefined } from '../../../common/predicates'; const isAlarm = (model: AssetModelCompositeModel) => model.type === 'AWS/ALARM'; diff --git a/packages/source-iotsitewise/src/time-series-data/store.ts b/packages/source-iotsitewise/src/time-series-data/store.ts index b94f575ea..2c8ce6b4d 100644 --- a/packages/source-iotsitewise/src/time-series-data/store.ts +++ b/packages/source-iotsitewise/src/time-series-data/store.ts @@ -1,15 +1,15 @@ -import merge from 'lodash.merge'; -import { completeDataStreams } from '../completeDataStreams'; +import type { DescribeAssetModelResponse } from '@aws-sdk/client-iotsitewise'; import type { - Threshold, DataStream, ErrorDetails, + Threshold, TimeSeriesData, Viewport, } from '@iot-app-kit/core'; -import type { DescribeAssetModelResponse } from '@aws-sdk/client-iotsitewise'; +import merge from 'lodash-es/merge'; import type { Alarms } from '../alarms/iotevents'; import type { ModeledDataStream } from '../asset-modules/describeModeledDataStreamRequest/types'; +import { completeDataStreams } from '../completeDataStreams'; export type TimeSeriesDataStore = { modeledDataStreams: ModeledDataStream[]; diff --git a/packages/source-iotsitewise/src/time-series-data/util/deduplication.ts b/packages/source-iotsitewise/src/time-series-data/util/deduplication.ts index c800ef254..cb547d40e 100644 --- a/packages/source-iotsitewise/src/time-series-data/util/deduplication.ts +++ b/packages/source-iotsitewise/src/time-series-data/util/deduplication.ts @@ -1,5 +1,5 @@ -import isEqual from 'lodash.isequal'; -import uniqWith from 'lodash.uniqwith'; +import isEqual from 'lodash-es/isEqual'; +import uniqWith from 'lodash-es/uniqWith'; import type { BatchAggregatedEntry } from '../client/batchGetAggregatedPropertyDataPoints'; import type { BatchHistoricalEntry } from '../client/batchGetHistoricalPropertyDataPoints'; import type { BatchLatestEntry } from '../client/batchGetLatestPropertyDataPoints'; diff --git a/packages/source-iottwinmaker/package.json b/packages/source-iottwinmaker/package.json index 8b0f9e071..f4dec53f1 100644 --- a/packages/source-iottwinmaker/package.json +++ b/packages/source-iottwinmaker/package.json @@ -60,14 +60,13 @@ "@aws-sdk/url-parser": "3.374.0", "@iot-app-kit/core": "*", "@tanstack/query-core": "^4.29.15", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "rxjs": "^7.8.1" }, "devDependencies": { "@aws-sdk/types": "^3.696.0", "@iot-app-kit/ts-config": "*", - "@types/jest": "^29.4.0", - "@types/lodash": "^4.14.195", + "@types/lodash-es": "^4.17.12", "@types/node": "^18.16.18", "@vitest/coverage-v8": "^2.1.5", "aws-sdk-client-mock": "^1.0.0", diff --git a/packages/source-iottwinmaker/src/data-binding-provider/EntityPropertyBindingProviderStore.ts b/packages/source-iottwinmaker/src/data-binding-provider/EntityPropertyBindingProviderStore.ts index 9a5cba7ed..66996cca9 100644 --- a/packages/source-iottwinmaker/src/data-binding-provider/EntityPropertyBindingProviderStore.ts +++ b/packages/source-iottwinmaker/src/data-binding-provider/EntityPropertyBindingProviderStore.ts @@ -1,28 +1,29 @@ import { type GetEntityResponse } from '@aws-sdk/client-iottwinmaker'; -import { cloneDeep, isEmpty, isEqual } from 'lodash'; - +import { type ErrorDetails } from '@iot-app-kit/core'; +import cloneDeep from 'lodash-es/cloneDeep'; +import isEmpty from 'lodash-es/isEmpty'; +import isEqual from 'lodash-es/isEqual'; +import { type TwinMakerErrorCode } from '../common/error'; +import { type TwinMakerMetadataModule } from '../metadata-module/TwinMakerMetadataModule'; import { - type IValueDataBinding, - type IValueDataBindingStore, - type IDataFieldOption, - type IDataBindingConfig, - type IValueDataBindingProviderState, - type ITwinMakerDataBindingContext, - type ITwinMakerEntityDataBindingContext, -} from './types'; + createDataBindingTemplateOptions, + decorateDataBindingTemplate, +} from '../utils/dataBindingTemplateUtils'; import { - DataField, - DATA_FIELD_NAMES, DATA_BINDING_CONTEXT_KEYS, + DATA_FIELD_NAMES, + DataField, EMPTY_STORE_STATE, } from './constants'; -import { type TwinMakerErrorCode } from '../common/error'; import { - createDataBindingTemplateOptions, - decorateDataBindingTemplate, -} from '../utils/dataBindingTemplateUtils'; -import { type TwinMakerMetadataModule } from '../metadata-module/TwinMakerMetadataModule'; -import { type ErrorDetails } from '@iot-app-kit/core'; + type IDataBindingConfig, + type IDataFieldOption, + type ITwinMakerDataBindingContext, + type ITwinMakerEntityDataBindingContext, + type IValueDataBinding, + type IValueDataBindingProviderState, + type IValueDataBindingStore, +} from './types'; import { convertDataBindingTemplateId, convertEntitySummariesToDataFieldOptions, diff --git a/packages/source-iottwinmaker/src/property-value/client/getPropertyValueByEntity.ts b/packages/source-iottwinmaker/src/property-value/client/getPropertyValueByEntity.ts index c1154b359..99c2d2f5e 100644 --- a/packages/source-iottwinmaker/src/property-value/client/getPropertyValueByEntity.ts +++ b/packages/source-iottwinmaker/src/property-value/client/getPropertyValueByEntity.ts @@ -3,10 +3,10 @@ import { type GetPropertyValueResponse, type IoTTwinMakerClient, } from '@aws-sdk/client-iottwinmaker'; -import { type DataType, type DataStreamBase } from '@iot-app-kit/core'; -import { type TwinMakerStaticDataQuery } from '../types'; +import { type DataStreamBase, type DataType } from '@iot-app-kit/core'; +import isNumber from 'lodash-es/isNumber'; import { toValue } from '../../utils/propertyValueUtils'; -import { isNumber } from 'lodash'; +import { type TwinMakerStaticDataQuery } from '../types'; /** * Call TwinMaker GetPropertyValue API to get property value diff --git a/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByComponentType.ts b/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByComponentType.ts index bf4660200..c27e1d76e 100644 --- a/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByComponentType.ts +++ b/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByComponentType.ts @@ -11,7 +11,8 @@ import type { OnSuccessCallback, RequestInformationAndRange, } from '@iot-app-kit/core'; -import { isEmpty, isEqual } from 'lodash'; +import isEmpty from 'lodash-es/isEmpty'; +import isEqual from 'lodash-es/isEqual'; import { type TwinMakerMetadataModule } from '../../metadata-module/TwinMakerMetadataModule'; import { isDefined, toDataType } from '../../utils/propertyValueUtils'; import { fromDataStreamId, toDataStreamId } from '../utils/dataStreamId'; diff --git a/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByEntity.ts b/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByEntity.ts index 38c48576f..342c39396 100644 --- a/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByEntity.ts +++ b/packages/source-iottwinmaker/src/time-series-data/client/getPropertyValueHistoryByEntity.ts @@ -2,15 +2,15 @@ import { GetPropertyValueHistoryCommand, type IoTTwinMakerClient, } from '@aws-sdk/client-iottwinmaker'; -import { isEqual } from 'lodash'; -import { fromDataStreamId, toDataStreamId } from '../utils/dataStreamId'; -import { toDataPoint, toDataStream } from '../utils/values'; import type { + ErrorCallback, OnSuccessCallback, RequestInformationAndRange, - ErrorCallback, } from '@iot-app-kit/core'; +import isEqual from 'lodash-es/isEqual'; import { isDefined } from '../../utils/propertyValueUtils'; +import { fromDataStreamId, toDataStreamId } from '../utils/dataStreamId'; +import { toDataPoint, toDataStream } from '../utils/values'; export const getPropertyValueHistoryByEntityRequest = ({ workspaceId, diff --git a/packages/source-iottwinmaker/src/time-series-data/data-source.ts b/packages/source-iottwinmaker/src/time-series-data/data-source.ts index ac3a8c5f3..68d4c6fc9 100644 --- a/packages/source-iottwinmaker/src/time-series-data/data-source.ts +++ b/packages/source-iottwinmaker/src/time-series-data/data-source.ts @@ -1,16 +1,16 @@ import { type IoTTwinMakerClient } from '@aws-sdk/client-iottwinmaker'; -import { toDataStreamId } from './utils/dataStreamId'; -import { getPropertyValueHistoryByEntity } from './client/getPropertyValueHistoryByEntity'; -import { getPropertyValueHistoryByComponentType } from './client/getPropertyValueHistoryByComponentType'; -import { type TwinMakerMetadataModule } from '../metadata-module/TwinMakerMetadataModule'; -import { isEmpty } from 'lodash'; import type { DataSource, RequestInformationAndRange } from '@iot-app-kit/core'; -import type { TwinMakerDataStreamQuery } from './types'; +import isEmpty from 'lodash-es/isEmpty'; import { type TwinMakerComponentHistoryQuery, type TwinMakerEntityHistoryQuery, } from '../common/queryTypes'; +import { type TwinMakerMetadataModule } from '../metadata-module/TwinMakerMetadataModule'; import { isDefined } from '../utils/propertyValueUtils'; +import { getPropertyValueHistoryByComponentType } from './client/getPropertyValueHistoryByComponentType'; +import { getPropertyValueHistoryByEntity } from './client/getPropertyValueHistoryByEntity'; +import type { TwinMakerDataStreamQuery } from './types'; +import { toDataStreamId } from './utils/dataStreamId'; export const createDataSource = ( metadataModule: TwinMakerMetadataModule, diff --git a/packages/source-iottwinmaker/src/time-series-data/utils/values.ts b/packages/source-iottwinmaker/src/time-series-data/utils/values.ts index 737c63be0..7d7f37c19 100644 --- a/packages/source-iottwinmaker/src/time-series-data/utils/values.ts +++ b/packages/source-iottwinmaker/src/time-series-data/utils/values.ts @@ -1,6 +1,6 @@ -import { isNil } from 'lodash'; import type { PropertyValue } from '@aws-sdk/client-iottwinmaker'; -import type { DataStream, DataPoint } from '@iot-app-kit/core'; +import type { DataPoint, DataStream } from '@iot-app-kit/core'; +import isNil from 'lodash-es/isNil'; import { toValue } from '../../utils/propertyValueUtils'; /** diff --git a/packages/source-iottwinmaker/src/utils/propertyValueUtils.ts b/packages/source-iottwinmaker/src/utils/propertyValueUtils.ts index d6153f30c..a952e5250 100644 --- a/packages/source-iottwinmaker/src/utils/propertyValueUtils.ts +++ b/packages/source-iottwinmaker/src/utils/propertyValueUtils.ts @@ -1,11 +1,14 @@ -import { Type } from '@aws-sdk/client-iottwinmaker'; -import { isEmpty, isNil, isNumber, isString } from 'lodash'; -import { DATA_TYPE } from '@iot-app-kit/core'; import type { DataValue, DataType as TMDataType, } from '@aws-sdk/client-iottwinmaker'; -import type { Primitive, DataType } from '@iot-app-kit/core'; +import { Type } from '@aws-sdk/client-iottwinmaker'; +import type { DataType, Primitive } from '@iot-app-kit/core'; +import { DATA_TYPE } from '@iot-app-kit/core'; +import isEmpty from 'lodash-es/isEmpty'; +import isNil from 'lodash-es/isNil'; +import isNumber from 'lodash-es/isNumber'; +import isString from 'lodash-es/isString'; /** * Check if value is not null and not undefined. diff --git a/packages/source-iottwinmaker/src/video-data/VideoData.ts b/packages/source-iottwinmaker/src/video-data/VideoData.ts index b27ca6846..bb00e3c48 100644 --- a/packages/source-iottwinmaker/src/video-data/VideoData.ts +++ b/packages/source-iottwinmaker/src/video-data/VideoData.ts @@ -1,16 +1,18 @@ import { - type IoTSiteWiseClient, type GetAssetPropertyValueRequest, + type IoTSiteWiseClient, } from '@aws-sdk/client-iotsitewise'; import { GetEntityCommand, - type IoTTwinMakerClient, type GetEntityCommandInput, type GetPropertyValueHistoryRequest, + type IoTTwinMakerClient, } from '@aws-sdk/client-iottwinmaker'; import { type KinesisVideoClient } from '@aws-sdk/client-kinesis-video'; import { type KinesisVideoArchivedMediaClient } from '@aws-sdk/client-kinesis-video-archived-media'; -import { isEmpty } from 'lodash'; +import type { Endpoint } from '@aws-sdk/types'; +import isEmpty from 'lodash-es/isEmpty'; +import type { VideoData } from '../types'; import { ASCENDING, CachedVideoAgeOutOnEdge, @@ -22,6 +24,14 @@ import { VideoUploadedTimeRange, VideoUploadRequest, } from './constants'; +import type { + GetLastValueBeforeTimestampRequest, + GetLiveHLSStreamingSessionURLRequest, + GetOnDemandHLSStreamingSessionURLRequest, + TriggerVideoUploadRequest, + VideoDataInput, + VideoPlaybackMode, +} from './types'; import { getKVSDataEndpoint, getLiveHLSStreamingSessionURL, @@ -36,16 +46,6 @@ import { createPropertyIndentifierKey, getSinglePropertyValueHistory, } from './utils/twinmakerUtils'; -import type { Endpoint } from '@aws-sdk/types'; -import type { - GetLastValueBeforeTimestampRequest, - GetLiveHLSStreamingSessionURLRequest, - GetOnDemandHLSStreamingSessionURLRequest, - TriggerVideoUploadRequest, - VideoDataInput, - VideoPlaybackMode, -} from './types'; -import type { VideoData } from '../types'; export class VideoDataImpl implements VideoData { workspaceId?: string; diff --git a/packages/source-iottwinmaker/src/video-data/utils/twinmakerUtils.ts b/packages/source-iottwinmaker/src/video-data/utils/twinmakerUtils.ts index 69236ffda..d3e7c8bb3 100644 --- a/packages/source-iottwinmaker/src/video-data/utils/twinmakerUtils.ts +++ b/packages/source-iottwinmaker/src/video-data/utils/twinmakerUtils.ts @@ -1,12 +1,12 @@ import { GetPropertyValueHistoryCommand, - type IoTTwinMakerClient, type EntityPropertyReference, type GetPropertyValueHistoryRequest, type GetPropertyValueHistoryResponse, + type IoTTwinMakerClient, type PropertyValueHistory, } from '@aws-sdk/client-iottwinmaker'; -import { isUndefined } from 'lodash'; +import isUndefined from 'lodash-es/isUndefined'; import type { Primitive } from '../../common/types'; export const getSinglePropertyValueHistory = async (