@vizzly/dashboard 0.15.0-dev-4beae8623ea0574c0fe50b5f3fd0ef2ec64b955a → 0.15.0-dev-dc8abbc27d404a01b1c730481930e726e875c32b

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.
@@ -10,7 +10,6 @@ var isEmpty$2 = _interopDefault(require('lodash/isEmpty'));
10
10
  var _ = require('lodash');
11
11
  var ___default = _interopDefault(_);
12
12
  var semanticLayerPublic = require('@vizzly/semantic-layer-public');
13
- var pino = _interopDefault(require('pino'));
14
13
  var moment = _interopDefault(require('moment-timezone'));
15
14
  var Joi = _interopDefault(require('@vizzly/joi'));
16
15
  var uuid = require('uuid');
@@ -774,43 +773,6 @@ var snakeCaseToHumanReadable = function snakeCaseToHumanReadable(str) {
774
773
  return capitalise(_replaceAll(str, '_', ' '));
775
774
  };
776
775
 
777
- var enableBrowserLogging = function enableBrowserLogging() {
778
- if (typeof window !== 'undefined' && typeof document !== 'undefined') return true;
779
- return false;
780
- };
781
- var getOptions = function getOptions() {
782
- if (enableBrowserLogging()) {
783
- return {
784
- browser: {
785
- asObject: true
786
- }
787
- };
788
- } else {
789
- var _process$env, _process$env2, _process$env3, _process$env4;
790
- var otelExporter = (_process$env = process.env) == null ? void 0 : _process$env['OTEL_EXPORTER_OTLP_ENDPOINT'];
791
- var otelLogsExporter = (_process$env2 = process.env) == null ? void 0 : _process$env2['OTEL_EXPORTER_OTLP_LOGS_ENDPOINT'];
792
- var enableTerminalLogging = !!((_process$env3 = process.env) != null && _process$env3['TERMINAL_LOGGING']);
793
- var enableOTEL = !!otelExporter || !!otelLogsExporter;
794
- var logLevel = ((_process$env4 = process.env) == null ? void 0 : _process$env4['LOG_LEVEL']) || 'info';
795
- var targets = [];
796
- if (!!process.stdout.isTTY || !enableOTEL || !!enableTerminalLogging) {
797
- targets.push({
798
- target: 'pino-pretty',
799
- level: logLevel,
800
- customPrettifiers: {},
801
- options: {
802
- colorize: true,
803
- singleLine: false
804
- }
805
- });
806
- }
807
- return pino.transport({
808
- targets: targets
809
- });
810
- }
811
- };
812
- var logger = /*#__PURE__*/pino( /*#__PURE__*/getOptions());
813
-
814
776
  var LOG_LEVELS = ['debug', 'info', 'warning', 'error', 'properties'];
815
777
 
816
778
  // Singleton.
@@ -845,55 +807,46 @@ var shouldLog = function shouldLog(level) {
845
807
  });
846
808
  return currentLogLevelIndex <= logLevelIndex;
847
809
  };
810
+ var format = function format(value) {
811
+ if (value instanceof Error) return value;
812
+ if (_.isObject(value)) return JSON.stringify(value);
813
+ if (_.isArray(value)) return JSON.stringify(value);
814
+ return value;
815
+ };
848
816
  var logDebug = function logDebug() {
817
+ var _console;
849
818
  for (var _len = arguments.length, message = new Array(_len), _key = 0; _key < _len; _key++) {
850
819
  message[_key] = arguments[_key];
851
820
  }
852
821
  // Actually log as info because then it shows in browsers without making another change...
853
- if (shouldLog('debug')) logger.info.apply(logger, parseToPino("[VIZZLY DEBUG]", message));
822
+ if (shouldLog('debug')) (_console = console).info.apply(_console, ["[VIZZLY DEBUG]"].concat(message.map(format)));
854
823
  };
855
824
  var logInfo = function logInfo() {
825
+ var _console2;
856
826
  for (var _len2 = arguments.length, message = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
857
827
  message[_key2] = arguments[_key2];
858
828
  }
859
- if (shouldLog('info')) logger.info.apply(logger, parseToPino("[VIZZLY INFO]", message));
829
+ if (shouldLog('info')) (_console2 = console).info.apply(_console2, ["[VIZZLY INFO]"].concat(message.map(format)));
860
830
  };
861
831
  var logProperties = function logProperties() {
862
832
  for (var _len3 = arguments.length, message = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
863
833
  message[_key3] = arguments[_key3];
864
834
  }
865
- if (shouldLog('properties')) logger.info.apply(logger, parseToPino("[VIZZLY Dashboard Properties]", message));
835
+ if (shouldLog('properties')) console.info("[VIZZLY Dashboard Properties]", message);
866
836
  };
867
837
  var logWarning = function logWarning() {
838
+ var _console3;
868
839
  for (var _len4 = arguments.length, message = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
869
840
  message[_key4] = arguments[_key4];
870
841
  }
871
- if (shouldLog('warning')) logger.warn.apply(logger, parseToPino("[VIZZLY WARNING]", message));
842
+ if (shouldLog('warning')) (_console3 = console).warn.apply(_console3, ["[VIZZLY WARNING]"].concat(message.map(format)));
872
843
  };
873
844
  var logError = function logError() {
845
+ var _console4;
874
846
  for (var _len5 = arguments.length, message = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
875
847
  message[_key5] = arguments[_key5];
876
848
  }
877
- if (shouldLog('error')) logger.error.apply(logger, parseToPino("[VIZZLY ERROR]", message));
878
- };
879
- var parseToPino = function parseToPino(prefix, args) {
880
- var inputs = _.isArray(args) ? args : [args];
881
- var err;
882
- var parts = [];
883
- for (var _iterator = _createForOfIteratorHelperLoose(inputs), _step; !(_step = _iterator()).done;) {
884
- var val = _step.value;
885
- if (!err && val instanceof Error) {
886
- err = val;
887
- continue;
888
- }
889
- if (_.isObject(val) || _.isArray(val)) {
890
- parts.push(JSON.stringify(val));
891
- } else if (val !== undefined && val !== null) {
892
- parts.push(String(val));
893
- }
894
- }
895
- var msg = parts.length ? prefix + " " + parts.join(' ') : prefix;
896
- return err ? [err, msg] : [msg];
849
+ if (shouldLog('error')) (_console4 = console).error.apply(_console4, ["[VIZZLY ERROR]"].concat(message.map(format)));
897
850
  };
898
851
  var wrapCallbackInDebugLog = function wrapCallbackInDebugLog(name, fn) {
899
852
  if (fn === undefined) return undefined;
@@ -13084,7 +13037,7 @@ var formatShortDateAndTime = function formatShortDateAndTime(date) {
13084
13037
  });
13085
13038
  return date.toLocaleTimeString(EN_GB_LOCALE, options);
13086
13039
  };
13087
- var format = function format(value, _format) {
13040
+ var format$1 = function format(value, _format) {
13088
13041
  if (_format === 'day_of_month' && (typeof value === 'number' || typeof value === 'string')) {
13089
13042
  return "" + value + numberPostfix(typeof value === 'string' ? parseInt(value) : value);
13090
13043
  }
@@ -13474,7 +13427,7 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
13474
13427
  noValueReplacement = noValue;
13475
13428
  }
13476
13429
  if (value === null || value === undefined) return noValueReplacement;
13477
- return format(value, 'hour_of_day');
13430
+ return format$1(value, 'hour_of_day');
13478
13431
  }
13479
13432
  },
13480
13433
  _vizzly_month_of_year: {
@@ -13484,7 +13437,7 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
13484
13437
  noValueReplacement = noValue;
13485
13438
  }
13486
13439
  if (value === null || value === undefined) return noValueReplacement;
13487
- return format(value, 'month_of_year');
13440
+ return format$1(value, 'month_of_year');
13488
13441
  }
13489
13442
  },
13490
13443
  _vizzly_day_of_month: {
@@ -13494,7 +13447,7 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
13494
13447
  noValueReplacement = noValue;
13495
13448
  }
13496
13449
  if (value === null || value === undefined) return noValueReplacement;
13497
- return format(value, 'day_of_month');
13450
+ return format$1(value, 'day_of_month');
13498
13451
  }
13499
13452
  },
13500
13453
  _vizzly_day_of_week_iso: {
@@ -13504,7 +13457,7 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
13504
13457
  noValueReplacement = noValue;
13505
13458
  }
13506
13459
  if (value === null || value === undefined) return noValueReplacement;
13507
- return format(value, 'day_of_week_iso');
13460
+ return format$1(value, 'day_of_week_iso');
13508
13461
  }
13509
13462
  },
13510
13463
  _vizzly_week_of_year: {
@@ -13514,7 +13467,7 @@ var defaultNumberFormatOptions = function defaultNumberFormatOptions(textOverrid
13514
13467
  noValueReplacement = noValue;
13515
13468
  }
13516
13469
  if (value === null || value === undefined) return noValueReplacement;
13517
- return format(value, 'week_of_year');
13470
+ return format$1(value, 'week_of_year');
13518
13471
  }
13519
13472
  }
13520
13473
  };
@@ -13886,7 +13839,7 @@ function formattedFallbackDateTime(value) {
13886
13839
  var formattedDate;
13887
13840
  try {
13888
13841
  // Attempt to format using your custom DateTime functions
13889
- formattedDate = format(date, 'DD MMMM YYYY, hh:mm') || '';
13842
+ formattedDate = format$1(date, 'DD MMMM YYYY, hh:mm') || '';
13890
13843
  if (!formattedDate) throw new Error('Invalid format');
13891
13844
  } catch (e) {
13892
13845
  // Fallback to native Date handling if custom format fails
@@ -16239,119 +16192,119 @@ var defaultDateTimeFormatOptions = {
16239
16192
  hour_of_day: {
16240
16193
  description: 'Hour of the day',
16241
16194
  formatter: function formatter(date) {
16242
- return format(date, 'hour_of_day');
16195
+ return format$1(date, 'hour_of_day');
16243
16196
  }
16244
16197
  },
16245
16198
  /** @deprecated - moved to number formatting option */
16246
16199
  month_of_year: {
16247
16200
  description: 'Month of the year',
16248
16201
  formatter: function formatter(date) {
16249
- return format(date, 'month_of_year');
16202
+ return format$1(date, 'month_of_year');
16250
16203
  }
16251
16204
  },
16252
16205
  /** @deprecated - moved to number formatting option */
16253
16206
  day_of_month: {
16254
16207
  description: 'Day of month',
16255
16208
  formatter: function formatter(date) {
16256
- return format(date, 'day_of_month');
16209
+ return format$1(date, 'day_of_month');
16257
16210
  }
16258
16211
  },
16259
16212
  /** @deprecated - moved to number formatting option */
16260
16213
  day_of_week_iso: {
16261
16214
  description: 'Day of week',
16262
16215
  formatter: function formatter(date) {
16263
- return format(date, 'day_of_week_iso');
16216
+ return format$1(date, 'day_of_week_iso');
16264
16217
  }
16265
16218
  },
16266
16219
  /** @deprecated - moved to number formatting option */
16267
16220
  week_of_year: {
16268
16221
  description: 'Week of year',
16269
16222
  formatter: function formatter(date) {
16270
- return format(date, 'week_of_year');
16223
+ return format$1(date, 'week_of_year');
16271
16224
  }
16272
16225
  },
16273
16226
  'DD/MM/YYYY': {
16274
16227
  description: 'DD/MM/YYYY',
16275
16228
  formatter: function formatter(date) {
16276
- return format(date, 'DD/MM/YYYY');
16229
+ return format$1(date, 'DD/MM/YYYY');
16277
16230
  }
16278
16231
  },
16279
16232
  'MM/DD/YYYY': {
16280
16233
  description: 'MM/DD/YYYY',
16281
16234
  formatter: function formatter(date) {
16282
- return format(date, 'MM/DD/YYYY');
16235
+ return format$1(date, 'MM/DD/YYYY');
16283
16236
  }
16284
16237
  },
16285
16238
  'DD-MM-YYYY': {
16286
16239
  description: 'DD-MM-YYYY',
16287
16240
  formatter: function formatter(date) {
16288
- return format(date, 'DD-MM-YYYY');
16241
+ return format$1(date, 'DD-MM-YYYY');
16289
16242
  }
16290
16243
  },
16291
16244
  'MM-DD-YYYY': {
16292
16245
  description: 'MM-DD-YYYY',
16293
16246
  formatter: function formatter(date) {
16294
- return format(date, 'MM-DD-YYYY');
16247
+ return format$1(date, 'MM-DD-YYYY');
16295
16248
  }
16296
16249
  },
16297
16250
  'DD MMMM YYYY, hh:mm': {
16298
16251
  description: 'DD MMMM YYYY, hh:mm',
16299
16252
  formatter: function formatter(date) {
16300
- return format(date, 'DD MMMM YYYY, hh:mm');
16253
+ return format$1(date, 'DD MMMM YYYY, hh:mm');
16301
16254
  }
16302
16255
  },
16303
16256
  'dddd DD MMMM YYYY, hh:mm': {
16304
16257
  description: 'dddd DD MMMM YYYY, hh:mm',
16305
16258
  formatter: function formatter(date) {
16306
- return format(date, 'dddd DD MMMM YYYY, hh:mm');
16259
+ return format$1(date, 'dddd DD MMMM YYYY, hh:mm');
16307
16260
  }
16308
16261
  },
16309
16262
  'hh:mm': {
16310
16263
  description: 'hh:mm',
16311
16264
  formatter: function formatter(date) {
16312
- return format(date, 'hh:mm');
16265
+ return format$1(date, 'hh:mm');
16313
16266
  }
16314
16267
  },
16315
16268
  'hh:mm:ss': {
16316
16269
  description: 'hh:mm:ss',
16317
16270
  formatter: function formatter(date) {
16318
- return format(date, 'hh:mm:ss');
16271
+ return format$1(date, 'hh:mm:ss');
16319
16272
  }
16320
16273
  },
16321
16274
  'DD MMMM YYYY': {
16322
16275
  description: 'DD MMMM YYYY',
16323
16276
  formatter: function formatter(date) {
16324
- return format(date, 'DD MMMM YYYY');
16277
+ return format$1(date, 'DD MMMM YYYY');
16325
16278
  }
16326
16279
  },
16327
16280
  'MMMM YYYY': {
16328
16281
  description: 'MMMM YYYY',
16329
16282
  formatter: function formatter(date) {
16330
- return format(date, 'MMMM YYYY');
16283
+ return format$1(date, 'MMMM YYYY');
16331
16284
  }
16332
16285
  },
16333
16286
  YYYY: {
16334
16287
  description: 'YYYY',
16335
16288
  formatter: function formatter(date) {
16336
- return format(date, 'YYYY');
16289
+ return format$1(date, 'YYYY');
16337
16290
  }
16338
16291
  },
16339
16292
  'YYYY-MM-DD[T]HH:mm:ss': {
16340
16293
  description: 'YYYY-MM-DD[T]HH:mm:ss',
16341
16294
  formatter: function formatter(date) {
16342
- return format(date, 'YYYY-MM-DD[T]HH:mm:ss');
16295
+ return format$1(date, 'YYYY-MM-DD[T]HH:mm:ss');
16343
16296
  }
16344
16297
  },
16345
16298
  quarter: {
16346
16299
  description: 'Quarter',
16347
16300
  formatter: function formatter(date) {
16348
- return format(date, 'quarter');
16301
+ return format$1(date, 'quarter');
16349
16302
  }
16350
16303
  },
16351
16304
  week: {
16352
16305
  description: 'Week',
16353
16306
  formatter: function formatter(date) {
16354
- return format(date, 'week');
16307
+ return format$1(date, 'week');
16355
16308
  }
16356
16309
  }
16357
16310
  };
@@ -28823,7 +28776,7 @@ function DateFilter(props) {
28823
28776
  gap: "0.25rem",
28824
28777
  children: [jsxRuntime.jsxs(Flex, {
28825
28778
  children: [dateType === DateType.Fixed && jsxRuntime.jsx(DateTimeInput, {
28826
- value: value ? format(new Date(value), 'YYYY-MM-DD[T]HH:mm:ss') : undefined,
28779
+ value: value ? format$1(new Date(value), 'YYYY-MM-DD[T]HH:mm:ss') : undefined,
28827
28780
  onChange: function onChange(date) {
28828
28781
  var value = date ? date.toISOString() : null;
28829
28782
  setFilter({
@@ -69202,7 +69155,7 @@ function available(dashboard) {
69202
69155
  return Array.from(tagSet);
69203
69156
  }
69204
69157
 
69205
- function getOptions$1(allAvailableTags) {
69158
+ function getOptions(allAvailableTags) {
69206
69159
  var seenKeys = new Set();
69207
69160
  var tagOptions = [];
69208
69161
  allAvailableTags.forEach(function (tag) {
@@ -69239,7 +69192,7 @@ var TagsForm = function TagsForm(props) {
69239
69192
  dashboard = _useDashboardContext.dashboard;
69240
69193
  var allAvailableTags = available(dashboard);
69241
69194
  var getTagOptions = function getTagOptions() {
69242
- return getOptions$1(allAvailableTags);
69195
+ return getOptions(allAvailableTags);
69243
69196
  };
69244
69197
  var selectedTags = function selectedTags() {
69245
69198
  var options = getTagOptions();