@odigos/ui-kit 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/eslint.config.mjs +16 -2
- package/lib/components/data-card/data-card-fields/index.d.ts +2 -1
- package/lib/components/error-boundary/error-boundary.stories.d.ts +3 -1
- package/lib/components/error-boundary/index.d.ts +1 -2
- package/lib/components/field-error/field-error.stories.d.ts +3 -1
- package/lib/components/field-error/index.d.ts +1 -2
- package/lib/components/key-value-input-list/index.d.ts +2 -0
- package/lib/components/key-value-input-list/key-value-input-list.stories.d.ts +2 -0
- package/lib/components/segment/index.d.ts +8 -7
- package/lib/components/styled.d.ts +5 -1
- package/lib/components.js +9 -9
- package/lib/constants.js +1 -1
- package/lib/containers/await-pipeline/await-pipeline.stories.d.ts +1 -1
- package/lib/containers/await-pipeline/index.d.ts +1 -2
- package/lib/containers/data-flow-actions-menu/add-entity/index.d.ts +2 -3
- package/lib/containers/data-flow-actions-menu/filters/index.d.ts +2 -3
- package/lib/containers/data-flow-actions-menu/search/index.d.ts +2 -3
- package/lib/containers/data-stream-modal/data-stream-modal.stories.d.ts +2 -2
- package/lib/containers/data-stream-modal/index.d.ts +1 -2
- package/lib/containers/index.d.ts +1 -0
- package/lib/containers/instrumentation-rule-form/custom-fields/custom-instrumentation.d.ts +5 -0
- package/lib/containers/notification-manager/index.d.ts +1 -2
- package/lib/containers/notification-manager/notification-manager.stories.d.ts +1 -1
- package/lib/containers/service-map/helpers/build-edges.d.ts +10 -0
- package/lib/containers/service-map/helpers/build-map-nodes.d.ts +11 -0
- package/lib/containers/service-map/index.d.ts +8 -0
- package/lib/containers/service-map/service-map.stories.d.ts +9 -0
- package/lib/containers/slack-invite/index.d.ts +1 -2
- package/lib/containers/slack-invite/slack-invite.stories.d.ts +1 -1
- package/lib/containers/toast-list/index.d.ts +1 -2
- package/lib/containers/toast-list/toast-list.stories.d.ts +1 -1
- package/lib/containers/toggle-dark-mode/index.d.ts +1 -2
- package/lib/containers/toggle-dark-mode/toggle-dark-mode.stories.d.ts +1 -1
- package/lib/containers.js +439 -12485
- package/lib/functions/clean-object-empty-strings-values/index.d.ts +2 -1
- package/lib/functions/compare-condition/index.d.ts +1 -1
- package/lib/functions/flatten-object-keys/index.d.ts +2 -1
- package/lib/functions/get-entity-id/index.d.ts +2 -2
- package/lib/functions/get-entity-label/index.d.ts +2 -2
- package/lib/functions/index.d.ts +1 -0
- package/lib/functions/map-destination-fields-for-display/index.d.ts +1 -1
- package/lib/functions/remove-empty-values-from-object/index.d.ts +2 -1
- package/lib/functions/safe-json-parse/index.d.ts +2 -1
- package/lib/functions/safe-json-stringify/index.d.ts +2 -1
- package/lib/functions/stringify-non-string-values/index.d.ts +2 -1
- package/lib/functions.js +35 -9
- package/lib/hooks/useGenericForm.d.ts +2 -1
- package/lib/hooks/useInstrumentationRuleFormData.d.ts +3 -6
- package/lib/hooks/useSessionStorage.d.ts +2 -2
- package/lib/hooks/useSourceFormData.d.ts +1 -4
- package/lib/hooks.js +4 -4
- package/lib/icons/common/index.d.ts +1 -0
- package/lib/icons/common/user-icon/index.d.ts +2 -0
- package/lib/icons/common/user-icon/user-icon.stories.d.ts +8 -0
- package/lib/icons/instrumentation-rules/custom-instrumentation-icon/custom-instrumentation-icon.stories.d.ts +7 -0
- package/lib/icons/instrumentation-rules/custom-instrumentation-icon/index.d.ts +2 -0
- package/lib/icons/instrumentation-rules/index.d.ts +1 -0
- package/lib/icons.js +6 -6
- package/lib/{index-BV85P9UP.js → index-BnvrwbRB.js} +4 -0
- package/lib/{index-BRGQ84pJ.js → index-Bw7RE2T2.js} +21 -4
- package/lib/{index-B1IScVBT.js → index-C1V7D2ey.js} +12728 -363
- package/lib/{index-fEP_guwb.js → index-CeBxw8J4.js} +4 -4
- package/lib/{index-C4aVlsHh.js → index-CeDmxXUE.js} +10 -2
- package/lib/{index-BUCure0Q.js → index-CkTdd3MS.js} +1 -1
- package/lib/{index-C8vqcUbP.js → index-DOU0EdZP.js} +2 -2
- package/lib/{index-BJpPcCBm.js → index-DsEoqSQn.js} +3 -3
- package/lib/{index-CeHgnkLY.js → index-DxR7e2Cq.js} +1 -1
- package/lib/{index-DypjdLnz.js → index-ZTzxu5fz.js} +1 -1
- package/lib/{index-CpT8LSxY.js → index-w9lkC6fb.js} +10 -8
- package/lib/mock-data/index.d.ts +1 -0
- package/lib/mock-data/service-map/index.d.ts +2 -0
- package/lib/snippets/index.d.ts +1 -0
- package/lib/{containers/data-flow → snippets/react-flow}/edges/labeled-edge.d.ts +4 -4
- package/lib/{containers/data-flow → snippets/react-flow}/flow.d.ts +2 -0
- package/lib/snippets/react-flow/index.d.ts +13 -0
- package/lib/{containers/data-flow → snippets/react-flow}/nodes/add-node.d.ts +4 -4
- package/lib/{containers/data-flow → snippets/react-flow}/nodes/base-node.d.ts +4 -4
- package/lib/{containers/data-flow → snippets/react-flow}/nodes/edged-node.d.ts +4 -4
- package/lib/{containers/data-flow → snippets/react-flow}/nodes/frame-node.d.ts +4 -4
- package/lib/{containers/data-flow → snippets/react-flow}/nodes/header-node.d.ts +4 -4
- package/lib/snippets/react-flow/nodes/map-item-node.d.ts +12 -0
- package/lib/snippets/react-flow/nodes/no-data-node.d.ts +9 -0
- package/lib/{containers/data-flow → snippets/react-flow}/nodes/scroll-node.d.ts +4 -4
- package/lib/snippets/react-flow/nodes/skeleton-node.d.ts +8 -0
- package/lib/snippets.js +8 -8
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +1 -0
- package/lib/types/data-flow/index.d.ts +3 -1
- package/lib/types/describe/index.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/instrumentation-rules/index.d.ts +12 -0
- package/lib/types/service-map/index.d.ts +10 -0
- package/lib/types.js +10 -2
- package/lib/{useSourceSelectionFormData-CMXqoHZs.js → useSourceSelectionFormData-C5VMfWEf.js} +13 -48
- package/lib/{useTransition-DsrDiKOV.js → useTransition-mupXsbop.js} +56 -10
- package/package.json +3 -2
- package/lib/containers/data-flow/nodes/skeleton-node.d.ts +0 -8
- /package/lib/{containers/data-flow/helpers/get-main-container-language.d.ts → functions/get-main-container-language/index.d.ts} +0 -0
- /package/lib/{containers/data-flow/helpers → snippets/react-flow}/node-config.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { f as useModalStore, b as useDrawerStore } from './index-Bw7RE2T2.js';
|
|
2
|
+
import { AddNodeTypes, EntityTypes, CustomInstrumentationsKeyTypes, CodeAttributesKeyTypes, PayloadCollectionKeyTypes } from './types.js';
|
|
1
3
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import { g as useNotificationStore } from './index-BRGQ84pJ.js';
|
|
3
|
-
import { CodeAttributesKeyTypes, PayloadCollectionKeyTypes } from './types.js';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
|
|
6
6
|
const useGenericForm = (initialFormData) => {
|
|
@@ -12,6 +12,7 @@ const useGenericForm = (initialFormData) => {
|
|
|
12
12
|
}
|
|
13
13
|
const [formData, setFormData] = useState(copyInitial());
|
|
14
14
|
const [formErrors, setFormErrors] = useState({});
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
16
|
const handleFormChange = (key, val, obj) => {
|
|
16
17
|
if (key) {
|
|
17
18
|
// this is for cases where the form contains objects such as "exportedSignals",
|
|
@@ -60,6 +61,39 @@ const useGenericForm = (initialFormData) => {
|
|
|
60
61
|
};
|
|
61
62
|
};
|
|
62
63
|
|
|
64
|
+
const useClickNode = () => {
|
|
65
|
+
const { setCurrentModal } = useModalStore();
|
|
66
|
+
const { setDrawerType, setDrawerEntityId } = useDrawerStore();
|
|
67
|
+
const onClickNode = (_, object) => {
|
|
68
|
+
const { data: { id, type }, } = object;
|
|
69
|
+
switch (type) {
|
|
70
|
+
case EntityTypes.Source:
|
|
71
|
+
case EntityTypes.Destination:
|
|
72
|
+
case EntityTypes.Action:
|
|
73
|
+
case EntityTypes.InstrumentationRule:
|
|
74
|
+
setDrawerType(type);
|
|
75
|
+
setDrawerEntityId(id);
|
|
76
|
+
break;
|
|
77
|
+
case AddNodeTypes.AddSource:
|
|
78
|
+
setCurrentModal(EntityTypes.Source);
|
|
79
|
+
break;
|
|
80
|
+
case AddNodeTypes.AddDestination:
|
|
81
|
+
setCurrentModal(EntityTypes.Destination);
|
|
82
|
+
break;
|
|
83
|
+
case AddNodeTypes.AddAction:
|
|
84
|
+
setCurrentModal(EntityTypes.Action);
|
|
85
|
+
break;
|
|
86
|
+
case AddNodeTypes.AddRule:
|
|
87
|
+
setCurrentModal(EntityTypes.InstrumentationRule);
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
console.warn('Unhandled node click', object);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return { onClickNode };
|
|
95
|
+
};
|
|
96
|
+
|
|
63
97
|
const useContainerSize = () => {
|
|
64
98
|
const ref = useRef(null);
|
|
65
99
|
const [width, setWidth] = useState(0);
|
|
@@ -142,17 +176,19 @@ const INITIAL = {
|
|
|
142
176
|
[CodeAttributesKeyTypes.Namespace]: null,
|
|
143
177
|
[CodeAttributesKeyTypes.StackTrace]: null,
|
|
144
178
|
},
|
|
179
|
+
headersCollection: null,
|
|
180
|
+
customInstrumentations: {
|
|
181
|
+
[CustomInstrumentationsKeyTypes.Probes]: null,
|
|
182
|
+
},
|
|
145
183
|
};
|
|
146
184
|
const useInstrumentationRuleFormData = () => {
|
|
147
|
-
const { addNotification } = useNotificationStore();
|
|
148
185
|
const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL);
|
|
149
|
-
const validateForm = (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return ok;
|
|
186
|
+
const validateForm = () => {
|
|
187
|
+
// We don't have any specific validations for this form yet
|
|
188
|
+
handleErrorChange(undefined, undefined, {});
|
|
189
|
+
return true;
|
|
154
190
|
};
|
|
155
|
-
const loadFormWithDrawerItem = ({ ruleName, notes, disabled, payloadCollection, codeAttributes }) => {
|
|
191
|
+
const loadFormWithDrawerItem = ({ ruleName, notes, disabled, payloadCollection, codeAttributes, headersCollection, customInstrumentations }) => {
|
|
156
192
|
const updatedData = {
|
|
157
193
|
...INITIAL,
|
|
158
194
|
ruleName,
|
|
@@ -177,6 +213,14 @@ const useInstrumentationRuleFormData = () => {
|
|
|
177
213
|
[CodeAttributesKeyTypes.StackTrace]: codeAttributes[CodeAttributesKeyTypes.StackTrace] || null,
|
|
178
214
|
};
|
|
179
215
|
}
|
|
216
|
+
if (headersCollection) {
|
|
217
|
+
updatedData['headersCollection'] = headersCollection;
|
|
218
|
+
}
|
|
219
|
+
if (customInstrumentations) {
|
|
220
|
+
updatedData['customInstrumentations'] = {
|
|
221
|
+
[CustomInstrumentationsKeyTypes.Probes]: customInstrumentations[CustomInstrumentationsKeyTypes.Probes] || null,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
180
224
|
handleFormChange(undefined, undefined, updatedData);
|
|
181
225
|
};
|
|
182
226
|
return {
|
|
@@ -3475,7 +3519,9 @@ const useTransition = ({ container, animateIn, animateOut, duration = 300 }) =>
|
|
|
3475
3519
|
`;
|
|
3476
3520
|
// !! Do not deprecate this "useCallback" hook, it is necessary for the transition to work properly
|
|
3477
3521
|
const Transition = useCallback(({ children, enter, ...props }) => {
|
|
3522
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
3478
3523
|
const [mounted, setMounted] = useState(false);
|
|
3524
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
3479
3525
|
useEffect(() => {
|
|
3480
3526
|
const t = setTimeout(() => setMounted(enter), duration + 50); // +50ms to ensure the animation is finished
|
|
3481
3527
|
return () => clearTimeout(t);
|
|
@@ -3489,4 +3535,4 @@ const useTransition = ({ container, animateIn, animateOut, duration = 300 }) =>
|
|
|
3489
3535
|
return Transition;
|
|
3490
3536
|
};
|
|
3491
3537
|
|
|
3492
|
-
export {
|
|
3538
|
+
export { useContainerSize as a, useCopy as b, useGenericForm as c, useInstrumentationRuleFormData as d, useKeyDown as e, useOnClickOutside as f, useTimeAgo as g, useTransition as h, useClickNode as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odigos/ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"author": "Odigos",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"dev": "storybook dev -p 6006",
|
|
11
11
|
"prebuild": "rm -rf lib",
|
|
12
12
|
"build": "rollup -c --bundleConfigAsCjs",
|
|
13
|
-
"watch": "rollup -c --bundleConfigAsCjs -w"
|
|
13
|
+
"watch": "rollup -c --bundleConfigAsCjs -w",
|
|
14
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
|
|
14
15
|
},
|
|
15
16
|
"release": {
|
|
16
17
|
"branches": [
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { NodeTypes } from '@/types';
|
|
3
|
-
import { type Node, type NodeProps } from '@xyflow/react';
|
|
4
|
-
export interface SkeletonNodeProps extends NodeProps<Node<{
|
|
5
|
-
nodeWidth: number;
|
|
6
|
-
}, NodeTypes.Skeleton>> {
|
|
7
|
-
}
|
|
8
|
-
export declare const SkeletonNode: React.FC<SkeletonNodeProps>;
|
|
File without changes
|
|
File without changes
|