@odigos/ui-kit 0.0.34 → 0.0.36
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 +29 -0
- package/eslint.config.mjs +17 -0
- package/lib/components/data-card/index.d.ts +2 -1
- package/lib/components.js +8 -9
- package/lib/constants/strings/index.d.ts +6 -0
- package/lib/constants.js +1 -2
- package/lib/containers/data-flow/helpers/build-action-nodes.d.ts +7 -1
- package/lib/containers/data-flow/helpers/build-destination-nodes.d.ts +7 -1
- package/lib/containers/data-flow/helpers/build-edges.d.ts +2 -2
- package/lib/containers/data-flow/helpers/build-rule-nodes.d.ts +7 -1
- package/lib/containers/destination-modal/choose-destination/destinations-list/index.d.ts +1 -1
- package/lib/containers/destination-modal/choose-destination/index.d.ts +2 -2
- package/lib/containers.js +222 -97
- package/lib/functions.js +6 -7
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useSessionStorage.d.ts +5 -0
- package/lib/hooks.js +4 -5
- package/lib/icons.js +7 -7
- package/lib/{index-Bd8ZAEvq.js → index-7YZOplrB.js} +1 -1
- package/lib/{index-Cq8NT9Hr.js → index-BGzxan6E.js} +1 -1
- package/lib/{index-ChYtqgBW.js → index-BbEmZ4Wj.js} +2 -2
- package/lib/{index-BZq0yNL-.js → index-Be0m3TUg.js} +30 -27
- package/lib/{index-CnZlllYu.js → index-BlZKWuxe.js} +7 -1
- package/lib/{index-a_WA-82O.js → index-CNbTSsNJ.js} +2 -2
- package/lib/{index-BBjwRlta.js → index-CrethNg6.js} +5 -12
- package/lib/{index-CIKkezVt.js → index-D8AnbGCE.js} +1 -1
- package/lib/{index--RecCPGA.js → index-DJpBLpwG.js} +1 -1
- package/lib/{index-DJGe2YeC.js → index-aRNtyuuU.js} +333 -232
- package/lib/{index-ovjVbVQq.js → index-oEjS7cX3.js} +4 -5
- package/lib/{index-BWZT-ipR.js → index-t3OxxFsp.js} +1 -1
- package/lib/mock-data/sources/index.d.ts +3 -0
- package/lib/snippets.js +8 -9
- package/lib/store.js +1 -1
- package/lib/theme/index.d.ts +2 -3
- package/lib/theme/palletes/index.d.ts +2 -105
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +6 -0
- package/lib/types.js +8 -1
- package/lib/{useSourceSelectionFormData-DBNf1uEe.js → useSourceSelectionFormData-CH2xUOpu.js} +34 -16
- package/lib/{useTransition-dZ92VxT2.js → useTransition-0Rz0QKmh.js} +1 -1
- package/package.json +18 -21
- package/lib/index-mOgS3e5E.js +0 -101
|
@@ -43,231 +43,6 @@ const createImpl = (createState) => {
|
|
|
43
43
|
};
|
|
44
44
|
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
45
45
|
|
|
46
|
-
function createJSONStorage(getStorage, options) {
|
|
47
|
-
let storage;
|
|
48
|
-
try {
|
|
49
|
-
storage = getStorage();
|
|
50
|
-
} catch (e) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const persistStorage = {
|
|
54
|
-
getItem: (name) => {
|
|
55
|
-
var _a;
|
|
56
|
-
const parse = (str2) => {
|
|
57
|
-
if (str2 === null) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
return JSON.parse(str2, void 0 );
|
|
61
|
-
};
|
|
62
|
-
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
|
63
|
-
if (str instanceof Promise) {
|
|
64
|
-
return str.then(parse);
|
|
65
|
-
}
|
|
66
|
-
return parse(str);
|
|
67
|
-
},
|
|
68
|
-
setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, void 0 )),
|
|
69
|
-
removeItem: (name) => storage.removeItem(name)
|
|
70
|
-
};
|
|
71
|
-
return persistStorage;
|
|
72
|
-
}
|
|
73
|
-
const toThenable = (fn) => (input) => {
|
|
74
|
-
try {
|
|
75
|
-
const result = fn(input);
|
|
76
|
-
if (result instanceof Promise) {
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
then(onFulfilled) {
|
|
81
|
-
return toThenable(onFulfilled)(result);
|
|
82
|
-
},
|
|
83
|
-
catch(_onRejected) {
|
|
84
|
-
return this;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
} catch (e) {
|
|
88
|
-
return {
|
|
89
|
-
then(_onFulfilled) {
|
|
90
|
-
return this;
|
|
91
|
-
},
|
|
92
|
-
catch(onRejected) {
|
|
93
|
-
return toThenable(onRejected)(e);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
99
|
-
let options = {
|
|
100
|
-
storage: createJSONStorage(() => localStorage),
|
|
101
|
-
partialize: (state) => state,
|
|
102
|
-
version: 0,
|
|
103
|
-
merge: (persistedState, currentState) => ({
|
|
104
|
-
...currentState,
|
|
105
|
-
...persistedState
|
|
106
|
-
}),
|
|
107
|
-
...baseOptions
|
|
108
|
-
};
|
|
109
|
-
let hasHydrated = false;
|
|
110
|
-
const hydrationListeners = /* @__PURE__ */ new Set();
|
|
111
|
-
const finishHydrationListeners = /* @__PURE__ */ new Set();
|
|
112
|
-
let storage = options.storage;
|
|
113
|
-
if (!storage) {
|
|
114
|
-
return config(
|
|
115
|
-
(...args) => {
|
|
116
|
-
console.warn(
|
|
117
|
-
`[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
|
|
118
|
-
);
|
|
119
|
-
set(...args);
|
|
120
|
-
},
|
|
121
|
-
get,
|
|
122
|
-
api
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
const setItem = () => {
|
|
126
|
-
const state = options.partialize({ ...get() });
|
|
127
|
-
return storage.setItem(options.name, {
|
|
128
|
-
state,
|
|
129
|
-
version: options.version
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
const savedSetState = api.setState;
|
|
133
|
-
api.setState = (state, replace) => {
|
|
134
|
-
savedSetState(state, replace);
|
|
135
|
-
void setItem();
|
|
136
|
-
};
|
|
137
|
-
const configResult = config(
|
|
138
|
-
(...args) => {
|
|
139
|
-
set(...args);
|
|
140
|
-
void setItem();
|
|
141
|
-
},
|
|
142
|
-
get,
|
|
143
|
-
api
|
|
144
|
-
);
|
|
145
|
-
api.getInitialState = () => configResult;
|
|
146
|
-
let stateFromStorage;
|
|
147
|
-
const hydrate = () => {
|
|
148
|
-
var _a, _b;
|
|
149
|
-
if (!storage) return;
|
|
150
|
-
hasHydrated = false;
|
|
151
|
-
hydrationListeners.forEach((cb) => {
|
|
152
|
-
var _a2;
|
|
153
|
-
return cb((_a2 = get()) != null ? _a2 : configResult);
|
|
154
|
-
});
|
|
155
|
-
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
|
156
|
-
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
|
157
|
-
if (deserializedStorageValue) {
|
|
158
|
-
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
|
159
|
-
if (options.migrate) {
|
|
160
|
-
const migration = options.migrate(
|
|
161
|
-
deserializedStorageValue.state,
|
|
162
|
-
deserializedStorageValue.version
|
|
163
|
-
);
|
|
164
|
-
if (migration instanceof Promise) {
|
|
165
|
-
return migration.then((result) => [true, result]);
|
|
166
|
-
}
|
|
167
|
-
return [true, migration];
|
|
168
|
-
}
|
|
169
|
-
console.error(
|
|
170
|
-
`State loaded from storage couldn't be migrated since no migrate function was provided`
|
|
171
|
-
);
|
|
172
|
-
} else {
|
|
173
|
-
return [false, deserializedStorageValue.state];
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return [false, void 0];
|
|
177
|
-
}).then((migrationResult) => {
|
|
178
|
-
var _a2;
|
|
179
|
-
const [migrated, migratedState] = migrationResult;
|
|
180
|
-
stateFromStorage = options.merge(
|
|
181
|
-
migratedState,
|
|
182
|
-
(_a2 = get()) != null ? _a2 : configResult
|
|
183
|
-
);
|
|
184
|
-
set(stateFromStorage, true);
|
|
185
|
-
if (migrated) {
|
|
186
|
-
return setItem();
|
|
187
|
-
}
|
|
188
|
-
}).then(() => {
|
|
189
|
-
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
|
190
|
-
stateFromStorage = get();
|
|
191
|
-
hasHydrated = true;
|
|
192
|
-
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
|
193
|
-
}).catch((e) => {
|
|
194
|
-
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
api.persist = {
|
|
198
|
-
setOptions: (newOptions) => {
|
|
199
|
-
options = {
|
|
200
|
-
...options,
|
|
201
|
-
...newOptions
|
|
202
|
-
};
|
|
203
|
-
if (newOptions.storage) {
|
|
204
|
-
storage = newOptions.storage;
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
clearStorage: () => {
|
|
208
|
-
storage == null ? void 0 : storage.removeItem(options.name);
|
|
209
|
-
},
|
|
210
|
-
getOptions: () => options,
|
|
211
|
-
rehydrate: () => hydrate(),
|
|
212
|
-
hasHydrated: () => hasHydrated,
|
|
213
|
-
onHydrate: (cb) => {
|
|
214
|
-
hydrationListeners.add(cb);
|
|
215
|
-
return () => {
|
|
216
|
-
hydrationListeners.delete(cb);
|
|
217
|
-
};
|
|
218
|
-
},
|
|
219
|
-
onFinishHydration: (cb) => {
|
|
220
|
-
finishHydrationListeners.add(cb);
|
|
221
|
-
return () => {
|
|
222
|
-
finishHydrationListeners.delete(cb);
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
if (!options.skipHydration) {
|
|
227
|
-
hydrate();
|
|
228
|
-
}
|
|
229
|
-
return stateFromStorage || configResult;
|
|
230
|
-
};
|
|
231
|
-
const persist = persistImpl;
|
|
232
|
-
|
|
233
|
-
const useDarkMode = create()(persist((set) => ({
|
|
234
|
-
darkMode: true,
|
|
235
|
-
setDarkMode: (bool) => set({ darkMode: bool }),
|
|
236
|
-
}), {
|
|
237
|
-
name: 'odigos-dark-mode',
|
|
238
|
-
storage: typeof window !== 'undefined' ? createJSONStorage(() => localStorage) : undefined,
|
|
239
|
-
}));
|
|
240
|
-
|
|
241
|
-
const initialState$1 = {
|
|
242
|
-
dataStreamsLoading: false,
|
|
243
|
-
dataStreams: [],
|
|
244
|
-
selectedStreamName: '',
|
|
245
|
-
};
|
|
246
|
-
const useDataStreamStore = create((set) => ({
|
|
247
|
-
...initialState$1,
|
|
248
|
-
setDataStreamsLoading: (bool) => set({ dataStreamsLoading: bool }),
|
|
249
|
-
setDataStreams: (dataStreams) => set({ dataStreams }),
|
|
250
|
-
addDataStreams: (newStreams) => set((state) => {
|
|
251
|
-
const merged = [...state.dataStreams, ...newStreams];
|
|
252
|
-
const mapped = merged.map((ds) => [ds.name, ds]);
|
|
253
|
-
const uniqueByName = Array.from(new Map(mapped).values());
|
|
254
|
-
return { dataStreams: uniqueByName };
|
|
255
|
-
}),
|
|
256
|
-
removeDataStreams: (dataStreams) => set((state) => {
|
|
257
|
-
const filtered = state.dataStreams.filter((ds) => !dataStreams.find((toRemove) => toRemove.name === ds.name));
|
|
258
|
-
return { dataStreams: filtered };
|
|
259
|
-
}),
|
|
260
|
-
setSelectedStreamName: (streamName) => set({ selectedStreamName: streamName }),
|
|
261
|
-
resetDataStreamStore: () => set(initialState$1),
|
|
262
|
-
}));
|
|
263
|
-
|
|
264
|
-
const useDrawerStore = create((set) => ({
|
|
265
|
-
drawerType: null,
|
|
266
|
-
drawerEntityId: null,
|
|
267
|
-
setDrawerType: (value) => set({ drawerType: value }),
|
|
268
|
-
setDrawerEntityId: (value) => set({ drawerEntityId: value }),
|
|
269
|
-
}));
|
|
270
|
-
|
|
271
46
|
const AddClusterInfoIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
|
|
272
47
|
const theme = Theme.useTheme();
|
|
273
48
|
const fill = f || theme.text.secondary;
|
|
@@ -518,6 +293,337 @@ const MONITORS_OPTIONS = [
|
|
|
518
293
|
},
|
|
519
294
|
];
|
|
520
295
|
|
|
296
|
+
const DEFAULT_DATA_STREAM_NAME = 'default';
|
|
297
|
+
const STORAGE_KEYS = {
|
|
298
|
+
SELECTED_DATA_STREAM: 'SELECTED_DATA_STREAM',
|
|
299
|
+
SELECTED_DATA_STREAM_WITH_PROXY: (proxyId) => `SELECTED_DATA_STREAM_${proxyId}`,
|
|
300
|
+
OVERVIEW_FILTERS: 'OVERVIEW_FILTERS',
|
|
301
|
+
DARK_MODE: 'DARK_MODE',
|
|
302
|
+
};
|
|
303
|
+
const FORM_ALERTS = {
|
|
304
|
+
REQUIRED_FIELDS: 'Required fields are missing',
|
|
305
|
+
FIELD_IS_REQUIRED: 'This field is required',
|
|
306
|
+
FORBIDDEN: 'Forbidden',
|
|
307
|
+
ENTERPRISE_ONLY: (str = 'This') => `${str} is an Enterprise feature. Please upgrade your plan.`,
|
|
308
|
+
DEFINED_FOR_ALL_STREAMS: (str) => `${str} are defined for all Data Streams.`,
|
|
309
|
+
CANNOT_EDIT_RULE: 'Cannot edit a system-managed instrumentation rule',
|
|
310
|
+
CANNOT_DELETE_RULE: 'Cannot delete a system-managed instrumentation rule',
|
|
311
|
+
LATENCY_HTTP_ROUTE: 'HTTP route must start with a forward slash "/"',
|
|
312
|
+
READONLY_WARNING: "You're not allowed to create/update/delete in readonly mode",
|
|
313
|
+
ILLEGAL_K8S_LABEL: 'Must be 63 characters or less, must consist of alphanumeric characters, "-", "_", or ".", and must start & end with an alphanumeric character (e.g., my-name, 123.abc).',
|
|
314
|
+
};
|
|
315
|
+
const DISPLAY_TITLES = {
|
|
316
|
+
NAMESPACE: 'Namespace',
|
|
317
|
+
NAME: 'Name',
|
|
318
|
+
KIND: 'Kind',
|
|
319
|
+
CONNECTION: 'Connection',
|
|
320
|
+
CONNECTIONS: 'Connections',
|
|
321
|
+
DATA_STREAM: 'Data Stream',
|
|
322
|
+
DATA_STREAMS: 'Data Streams',
|
|
323
|
+
STREAM_NAME: 'Data Stream Name',
|
|
324
|
+
NAME_YOUR_STREAM: 'Name your Data Stream',
|
|
325
|
+
NAME_YOUR_STREAM_PLACEHOLDER: 'e.g. Highest priority',
|
|
326
|
+
STREAM_DESCRIPTION: 'Provide a clear and descriptive name for your pipeline to ensure its purpose is easily understood by you and your team.',
|
|
327
|
+
STREAM_CONFIRM: 'Confirm your new Data Stream',
|
|
328
|
+
ACTION: 'Action',
|
|
329
|
+
ACTIONS: 'Actions',
|
|
330
|
+
ADD_ACTION: 'Add Action',
|
|
331
|
+
ACTION_DETAILS: 'Action Details',
|
|
332
|
+
INSTRUMENTATION_RULE: 'Instrumentation Rule',
|
|
333
|
+
INSTRUMENTATION_RULES: 'Instrumentation Rules',
|
|
334
|
+
ADD_INSTRUMENTATION_RULE: 'Add Instrumentation Rule',
|
|
335
|
+
INSTRUMENTATION_RULE_DETAILS: 'Instrumentation Rule Details',
|
|
336
|
+
DESTINATION: 'Destination',
|
|
337
|
+
DESTINATIONS: 'Destinations',
|
|
338
|
+
ADD_DESTINATION: 'Add Destination',
|
|
339
|
+
ADD_DESTINATIONS: 'Add Destinations',
|
|
340
|
+
ADD_DESTINATION_DESCRIPTION: 'Add a destination to send your telemetry data to. You can add multiple destinations.',
|
|
341
|
+
DESTINATION_DETAILS: 'Destination Details',
|
|
342
|
+
SELECTED_DESTINATIONS: 'Selected Destinations',
|
|
343
|
+
SOURCE: 'Source',
|
|
344
|
+
SOURCES: 'Sources',
|
|
345
|
+
ADD_SOURCE: 'Add Source',
|
|
346
|
+
SOURCE_DETAILS: 'Source Details',
|
|
347
|
+
SELECT_SOURCES: 'Select Sources',
|
|
348
|
+
SELECTED_SOURCES: 'Selected Sources',
|
|
349
|
+
SELECT_SOURCES_DESCRIPTION: 'Select apps to monitor in each namespace. Odigos will instrument them and send telemetry data to your destinations.',
|
|
350
|
+
NO_SOURCES: 'No sources',
|
|
351
|
+
NO_SOURCES_GO_BACK: 'No sources selected. Please go back to select sources.',
|
|
352
|
+
PLEASE_ADD_SOURCE: 'Please add a source',
|
|
353
|
+
NO_SOURCES_NAMESPACE: 'No sources available in this namespace',
|
|
354
|
+
TRY_SEARCH_OR_OTHER_NAMESPACE: 'Try searching again or select another namespace.',
|
|
355
|
+
PLEASE_MAKE_SURE_UNIGNORED_NAMESPACES: 'Please make sure your cluster has unignored namespaces',
|
|
356
|
+
INSTALLATION: 'Installation',
|
|
357
|
+
SUMMARY: 'Summary',
|
|
358
|
+
TYPE: 'Type',
|
|
359
|
+
NOTES: 'Notes',
|
|
360
|
+
STATUS: 'Status',
|
|
361
|
+
READONLY: 'Readonly',
|
|
362
|
+
LANGUAGE: 'Language',
|
|
363
|
+
MONITORS: 'Monitors',
|
|
364
|
+
SIGNALS_FOR_PROCESSING: 'Signals for Processing',
|
|
365
|
+
MANAGED_BY_PROFILE: 'Managed by Profile',
|
|
366
|
+
API_TOKEN: 'API Token',
|
|
367
|
+
API_TOKENS: 'API Tokens',
|
|
368
|
+
DESCRIBE_ODIGOS: 'Describe Odigos',
|
|
369
|
+
DESCRIBE_SOURCE: 'Describe Source',
|
|
370
|
+
DETECTED_CONTAINERS: 'Detected Containers',
|
|
371
|
+
DETECTED_CONTAINERS_DESCRIPTION: 'The system automatically instruments the containers it detects with a supported programming language.',
|
|
372
|
+
CONTAINER_NAME: 'Container Name',
|
|
373
|
+
FILTERED_COUNT_TOOLTIP: 'Represents filtered amount, out of total amount',
|
|
374
|
+
SEARCH_NAMESPACES: 'Search Namespaces',
|
|
375
|
+
SHOW_SELECTED_ONLY: 'Show selected only',
|
|
376
|
+
TO_COLLECT_OTEL_DATA: 'To collect OpenTelemetry data',
|
|
377
|
+
TO_MONITOR_OTEL_DATA: 'To monitor OpenTelemetry data',
|
|
378
|
+
TO_MODIFY_OTEL_DATA: 'To modify OpenTelemetry data',
|
|
379
|
+
QUICK_BACK_TO_SUMMARY: 'When you finish editing you can quickly go back to the summary.',
|
|
380
|
+
GO_TO_SUMMARY: 'Go to summary',
|
|
381
|
+
};
|
|
382
|
+
const BUTTON_TEXTS = {
|
|
383
|
+
ADD: 'Add',
|
|
384
|
+
ADD_NEW: 'Add New',
|
|
385
|
+
NEW: 'New',
|
|
386
|
+
SELECT: 'Select',
|
|
387
|
+
CREATE: 'Create',
|
|
388
|
+
UPDATE: 'Update',
|
|
389
|
+
EDIT: 'Edit',
|
|
390
|
+
DELETE: 'Delete',
|
|
391
|
+
CANCEL: 'Cancel',
|
|
392
|
+
DONE: 'Done',
|
|
393
|
+
SAVE: 'Save',
|
|
394
|
+
BACK: 'Back',
|
|
395
|
+
NEXT: 'Next',
|
|
396
|
+
TEST: 'Test',
|
|
397
|
+
TEST_CONNECTION: 'Test Connection',
|
|
398
|
+
INSTRUMENT: 'Instrument',
|
|
399
|
+
UNINSTRUMENT: 'Uninstrument',
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
function createJSONStorage(getStorage, options) {
|
|
403
|
+
let storage;
|
|
404
|
+
try {
|
|
405
|
+
storage = getStorage();
|
|
406
|
+
} catch (e) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
const persistStorage = {
|
|
410
|
+
getItem: (name) => {
|
|
411
|
+
var _a;
|
|
412
|
+
const parse = (str2) => {
|
|
413
|
+
if (str2 === null) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return JSON.parse(str2, void 0 );
|
|
417
|
+
};
|
|
418
|
+
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
|
419
|
+
if (str instanceof Promise) {
|
|
420
|
+
return str.then(parse);
|
|
421
|
+
}
|
|
422
|
+
return parse(str);
|
|
423
|
+
},
|
|
424
|
+
setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, void 0 )),
|
|
425
|
+
removeItem: (name) => storage.removeItem(name)
|
|
426
|
+
};
|
|
427
|
+
return persistStorage;
|
|
428
|
+
}
|
|
429
|
+
const toThenable = (fn) => (input) => {
|
|
430
|
+
try {
|
|
431
|
+
const result = fn(input);
|
|
432
|
+
if (result instanceof Promise) {
|
|
433
|
+
return result;
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
then(onFulfilled) {
|
|
437
|
+
return toThenable(onFulfilled)(result);
|
|
438
|
+
},
|
|
439
|
+
catch(_onRejected) {
|
|
440
|
+
return this;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
} catch (e) {
|
|
444
|
+
return {
|
|
445
|
+
then(_onFulfilled) {
|
|
446
|
+
return this;
|
|
447
|
+
},
|
|
448
|
+
catch(onRejected) {
|
|
449
|
+
return toThenable(onRejected)(e);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
455
|
+
let options = {
|
|
456
|
+
storage: createJSONStorage(() => localStorage),
|
|
457
|
+
partialize: (state) => state,
|
|
458
|
+
version: 0,
|
|
459
|
+
merge: (persistedState, currentState) => ({
|
|
460
|
+
...currentState,
|
|
461
|
+
...persistedState
|
|
462
|
+
}),
|
|
463
|
+
...baseOptions
|
|
464
|
+
};
|
|
465
|
+
let hasHydrated = false;
|
|
466
|
+
const hydrationListeners = /* @__PURE__ */ new Set();
|
|
467
|
+
const finishHydrationListeners = /* @__PURE__ */ new Set();
|
|
468
|
+
let storage = options.storage;
|
|
469
|
+
if (!storage) {
|
|
470
|
+
return config(
|
|
471
|
+
(...args) => {
|
|
472
|
+
console.warn(
|
|
473
|
+
`[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
|
|
474
|
+
);
|
|
475
|
+
set(...args);
|
|
476
|
+
},
|
|
477
|
+
get,
|
|
478
|
+
api
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
const setItem = () => {
|
|
482
|
+
const state = options.partialize({ ...get() });
|
|
483
|
+
return storage.setItem(options.name, {
|
|
484
|
+
state,
|
|
485
|
+
version: options.version
|
|
486
|
+
});
|
|
487
|
+
};
|
|
488
|
+
const savedSetState = api.setState;
|
|
489
|
+
api.setState = (state, replace) => {
|
|
490
|
+
savedSetState(state, replace);
|
|
491
|
+
void setItem();
|
|
492
|
+
};
|
|
493
|
+
const configResult = config(
|
|
494
|
+
(...args) => {
|
|
495
|
+
set(...args);
|
|
496
|
+
void setItem();
|
|
497
|
+
},
|
|
498
|
+
get,
|
|
499
|
+
api
|
|
500
|
+
);
|
|
501
|
+
api.getInitialState = () => configResult;
|
|
502
|
+
let stateFromStorage;
|
|
503
|
+
const hydrate = () => {
|
|
504
|
+
var _a, _b;
|
|
505
|
+
if (!storage) return;
|
|
506
|
+
hasHydrated = false;
|
|
507
|
+
hydrationListeners.forEach((cb) => {
|
|
508
|
+
var _a2;
|
|
509
|
+
return cb((_a2 = get()) != null ? _a2 : configResult);
|
|
510
|
+
});
|
|
511
|
+
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
|
512
|
+
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
|
513
|
+
if (deserializedStorageValue) {
|
|
514
|
+
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
|
515
|
+
if (options.migrate) {
|
|
516
|
+
const migration = options.migrate(
|
|
517
|
+
deserializedStorageValue.state,
|
|
518
|
+
deserializedStorageValue.version
|
|
519
|
+
);
|
|
520
|
+
if (migration instanceof Promise) {
|
|
521
|
+
return migration.then((result) => [true, result]);
|
|
522
|
+
}
|
|
523
|
+
return [true, migration];
|
|
524
|
+
}
|
|
525
|
+
console.error(
|
|
526
|
+
`State loaded from storage couldn't be migrated since no migrate function was provided`
|
|
527
|
+
);
|
|
528
|
+
} else {
|
|
529
|
+
return [false, deserializedStorageValue.state];
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
return [false, void 0];
|
|
533
|
+
}).then((migrationResult) => {
|
|
534
|
+
var _a2;
|
|
535
|
+
const [migrated, migratedState] = migrationResult;
|
|
536
|
+
stateFromStorage = options.merge(
|
|
537
|
+
migratedState,
|
|
538
|
+
(_a2 = get()) != null ? _a2 : configResult
|
|
539
|
+
);
|
|
540
|
+
set(stateFromStorage, true);
|
|
541
|
+
if (migrated) {
|
|
542
|
+
return setItem();
|
|
543
|
+
}
|
|
544
|
+
}).then(() => {
|
|
545
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
|
546
|
+
stateFromStorage = get();
|
|
547
|
+
hasHydrated = true;
|
|
548
|
+
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
|
549
|
+
}).catch((e) => {
|
|
550
|
+
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
api.persist = {
|
|
554
|
+
setOptions: (newOptions) => {
|
|
555
|
+
options = {
|
|
556
|
+
...options,
|
|
557
|
+
...newOptions
|
|
558
|
+
};
|
|
559
|
+
if (newOptions.storage) {
|
|
560
|
+
storage = newOptions.storage;
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
clearStorage: () => {
|
|
564
|
+
storage == null ? void 0 : storage.removeItem(options.name);
|
|
565
|
+
},
|
|
566
|
+
getOptions: () => options,
|
|
567
|
+
rehydrate: () => hydrate(),
|
|
568
|
+
hasHydrated: () => hasHydrated,
|
|
569
|
+
onHydrate: (cb) => {
|
|
570
|
+
hydrationListeners.add(cb);
|
|
571
|
+
return () => {
|
|
572
|
+
hydrationListeners.delete(cb);
|
|
573
|
+
};
|
|
574
|
+
},
|
|
575
|
+
onFinishHydration: (cb) => {
|
|
576
|
+
finishHydrationListeners.add(cb);
|
|
577
|
+
return () => {
|
|
578
|
+
finishHydrationListeners.delete(cb);
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
if (!options.skipHydration) {
|
|
583
|
+
hydrate();
|
|
584
|
+
}
|
|
585
|
+
return stateFromStorage || configResult;
|
|
586
|
+
};
|
|
587
|
+
const persist = persistImpl;
|
|
588
|
+
|
|
589
|
+
const useDarkMode = create()(persist((set) => ({
|
|
590
|
+
darkMode: true,
|
|
591
|
+
setDarkMode: (bool) => set({ darkMode: bool }),
|
|
592
|
+
}), {
|
|
593
|
+
name: STORAGE_KEYS.DARK_MODE,
|
|
594
|
+
storage: typeof window !== 'undefined' ? createJSONStorage(() => localStorage) : undefined,
|
|
595
|
+
}));
|
|
596
|
+
|
|
597
|
+
const initialState$1 = {
|
|
598
|
+
dataStreamsLoading: false,
|
|
599
|
+
dataStreams: [],
|
|
600
|
+
selectedStreamName: '',
|
|
601
|
+
};
|
|
602
|
+
const useDataStreamStore = create((set) => ({
|
|
603
|
+
...initialState$1,
|
|
604
|
+
setDataStreamsLoading: (bool) => set({ dataStreamsLoading: bool }),
|
|
605
|
+
setDataStreams: (dataStreams) => set({ dataStreams }),
|
|
606
|
+
addDataStreams: (newStreams) => set((state) => {
|
|
607
|
+
const merged = [...state.dataStreams, ...newStreams];
|
|
608
|
+
const mapped = merged.map((ds) => [ds.name, ds]);
|
|
609
|
+
const uniqueByName = Array.from(new Map(mapped).values());
|
|
610
|
+
return { dataStreams: uniqueByName };
|
|
611
|
+
}),
|
|
612
|
+
removeDataStreams: (dataStreams) => set((state) => {
|
|
613
|
+
const filtered = state.dataStreams.filter((ds) => !dataStreams.find((toRemove) => toRemove.name === ds.name));
|
|
614
|
+
return { dataStreams: filtered };
|
|
615
|
+
}),
|
|
616
|
+
setSelectedStreamName: (streamName) => set({ selectedStreamName: streamName }),
|
|
617
|
+
resetDataStreamStore: () => set(initialState$1),
|
|
618
|
+
}));
|
|
619
|
+
|
|
620
|
+
const useDrawerStore = create((set) => ({
|
|
621
|
+
drawerType: null,
|
|
622
|
+
drawerEntityId: null,
|
|
623
|
+
setDrawerType: (value) => set({ drawerType: value }),
|
|
624
|
+
setDrawerEntityId: (value) => set({ drawerEntityId: value }),
|
|
625
|
+
}));
|
|
626
|
+
|
|
521
627
|
const getEntityId = (item) => {
|
|
522
628
|
if ('ruleId' in item && !!item.ruleId) {
|
|
523
629
|
// Instrumentation Rule
|
|
@@ -1185,11 +1291,6 @@ var animations = /*#__PURE__*/Object.freeze({
|
|
|
1185
1291
|
slide: slide
|
|
1186
1292
|
});
|
|
1187
1293
|
|
|
1188
|
-
const Theme = {
|
|
1189
|
-
Provider,
|
|
1190
|
-
useTheme: useTheme,
|
|
1191
|
-
opacity,
|
|
1192
|
-
animations,
|
|
1193
|
-
};
|
|
1294
|
+
const Theme = { Provider, useTheme, opacity, animations };
|
|
1194
1295
|
|
|
1195
|
-
export { ACTION_OPTIONS as A, CodeAttributesIcon as C,
|
|
1296
|
+
export { ACTION_OPTIONS as A, BUTTON_TEXTS as B, CodeAttributesIcon as C, DEFAULT_DATA_STREAM_NAME as D, FORM_ALERTS as F, HeadersCollectionIcon as H, INSTRUMENTATION_RULE_OPTIONS as I, K8sLogo as K, MONITORS_OPTIONS as M, PiiMaskingIcon as P, RenameAttributeIcon as R, STORAGE_KEYS as S, Theme as T, useDataStreamStore as a, useDrawerStore as b, useEntityStore as c, useFilterStore as d, useInstrumentStore as e, useModalStore as f, useNotificationStore as g, usePendingStore as h, useSelectedStore as i, useSetupStore as j, DISPLAY_TITLES as k, getActionIcon as l, getEntityId as m, getInstrumentationRuleIcon as n, ImageErrorIcon as o, AddClusterInfoIcon as p, DeleteAttributeIcon as q, SamplerIcon as r, PayloadCollectionIcon as s, styleInject as t, useDarkMode as u };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { T as Theme } from './index-
|
|
3
|
-
import { E as EditIcon } from './index-
|
|
4
|
-
import { B as
|
|
5
|
-
import { B as Button, V as Text, J as NotificationNote } from './index-BZq0yNL-.js';
|
|
2
|
+
import { T as Theme, B as BUTTON_TEXTS, k as DISPLAY_TITLES } from './index-aRNtyuuU.js';
|
|
3
|
+
import { E as EditIcon } from './index-t3OxxFsp.js';
|
|
4
|
+
import { B as Button, V as Text, J as NotificationNote } from './index-Be0m3TUg.js';
|
|
6
5
|
import { StatusType } from './types.js';
|
|
7
6
|
import 'styled-components';
|
|
8
|
-
import { I as InfoIcon } from './index-
|
|
7
|
+
import { I as InfoIcon } from './index-7YZOplrB.js';
|
|
9
8
|
|
|
10
9
|
const EditButton = ({ label, onClick, variant = 'tertiary', ...props }) => {
|
|
11
10
|
const theme = Theme.useTheme();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { K8sResourceKind, ProgrammingLanguages, type Source } from '@/types';
|
|
2
|
+
export declare const MOCK_SOURCES_OTHER: Source[];
|
|
3
|
+
export declare const MOCK_SOURCES_SIMPLE_DEMO: Source[];
|
|
4
|
+
export declare const MOCK_SOURCES_GOOGLE: Source[];
|
|
2
5
|
export declare const MOCK_SOURCES: Source[];
|
|
3
6
|
export declare const MOCK_SOURCE_JAEGER: {
|
|
4
7
|
namespace: string;
|
package/lib/snippets.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
export { A as AddButton } from './index-
|
|
2
|
-
export { E as EditButton, N as NoteBackToSummary } from './index-
|
|
1
|
+
export { A as AddButton } from './index-Be0m3TUg.js';
|
|
2
|
+
export { E as EditButton, N as NoteBackToSummary } from './index-oEjS7cX3.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import './index-
|
|
4
|
+
import './index-aRNtyuuU.js';
|
|
5
5
|
import './types.js';
|
|
6
6
|
import 'styled-components';
|
|
7
|
-
import './index-
|
|
8
|
-
import './index-
|
|
9
|
-
import './index-
|
|
7
|
+
import './index-D8AnbGCE.js';
|
|
8
|
+
import './index-BbEmZ4Wj.js';
|
|
9
|
+
import './index-7YZOplrB.js';
|
|
10
10
|
import './index-BV85P9UP.js';
|
|
11
|
-
import './
|
|
12
|
-
import './useTransition-dZ92VxT2.js';
|
|
11
|
+
import './useTransition-0Rz0QKmh.js';
|
|
13
12
|
import 'react-dom';
|
|
14
|
-
import './index-
|
|
13
|
+
import './index-t3OxxFsp.js';
|
package/lib/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-
|
|
1
|
+
export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-aRNtyuuU.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './types.js';
|
|
4
4
|
import 'styled-components';
|
package/lib/theme/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as opacity from './opacity';
|
|
2
|
-
import { type ITheme } from './palletes';
|
|
3
2
|
import * as animations from './animations';
|
|
3
|
+
import { useTheme } from 'styled-components';
|
|
4
4
|
declare const Theme: {
|
|
5
5
|
Provider: import("react").FC<{
|
|
6
6
|
children?: import("react").ReactNode | undefined;
|
|
7
7
|
}>;
|
|
8
|
-
useTheme:
|
|
8
|
+
useTheme: typeof useTheme;
|
|
9
9
|
opacity: typeof opacity;
|
|
10
10
|
animations: typeof animations;
|
|
11
11
|
};
|
|
12
12
|
export default Theme;
|
|
13
|
-
export { type ITheme };
|