@upbound/monarch-blocks 0.3.0 → 0.4.0

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { CelFilterBar, RELATIVE_DURATION_PRESET_VALUES, allowsMultipleConditions, appendCondition, applyDisplayRules, applyOperatorChange, calendarDayStartInstant, celStringLiteral, compileCelFilterTree, computeIsEmitReady, createCelNodeId, createDefaultCondition, createEmptyCelFilterTree, dateBoundaryForOperator, denormalizeColumnIdWithReservedNames, denormalizeColumnsWithReservedNames, escapeCelString, formatCalendarDateUtc, formatInstantLabel, getAllowedOperators, getColumnEmitOn, getDefaultOperator, getOperatorLabel, getQuantifierLabel, isDateRangeOperator, isDateRelativeOperator, isDateWindowOperator, isMultiTextColumn, isRealCalendarDay, isRelativeDateCelValue, isRelativeDurationPreset, mergeContextualIntoCelTree, parseCalendarDate, readDateCelValue, readMapKeyCelValue, readMultiTextCelValue, readTimeOfDay, removeConditionById, replaceCondition, resolveColumnDefinition, resolveFilterShape, validateCondition, withTimeOfDay } from './cel-filter-bar.js';
1
+ export { CelFilterBar, RELATIVE_DURATION_PRESET_VALUES, allowsMultipleConditions, appendCondition, applyDisplayRules, applyOperatorChange, calendarDayEndInstant, calendarDayStartInstant, celStringLiteral, compileCelFilterTree, computeIsEmitReady, createCelNodeId, createDefaultCondition, createEmptyCelFilterTree, dateBoundaryForOperator, denormalizeColumnIdWithReservedNames, denormalizeColumnsWithReservedNames, escapeCelString, formatCalendarDateUtc, formatInstantLabel, getAllowedOperators, getColumnEmitOn, getDefaultOperator, getOperatorLabel, getQuantifierLabel, isDateRangeOperator, isDateRelativeOperator, isDateWindowOperator, isEndOfDayTimestamp, isEndOfMinuteTimestamp, isMultiTextColumn, isRealCalendarDay, isRelativeDateCelValue, isRelativeDurationPreset, isStartOfDayTimestamp, mergeContextualIntoCelTree, normalizeColumnsWithReservedNames, parseCalendarDate, readDateCelValue, readMapKeyCelValue, readMultiTextCelValue, readTimeOfDay, removeConditionById, replaceCondition, resolveColumnDefinition, resolveFilterShape, startInstantFromEndOfDay, startInstantFromEndOfMinute, validateCondition, withTimeOfDay } from './cel-filter-bar.js';
2
2
  export { C as CelColumnDefinition, a as CelColumnOption, b as CelConditionValue, c as CelFilterBarProps, d as CelFilterCondition, e as CelFilterGroup, f as CelFilterSchema, g as CelFilterTree, h as CelOperator, i as CelRestrictedOptionSelectPayload, j as CheckboxCelValue, k as CompileResult, D as DateCelValue, M as MapKeyCelValue, l as MultiTextCelValue, P as PillActiveSurface, R as RadioCelValue, m as RelativeDurationPreset, V as ValidationIssue, n as isCelFilterCondition, o as isCelFilterGroup, p as isCheckboxCelValue, q as isDateCelValue, r as isMapKeyCelValue, s as isMultiTextCelValue } from './types-BULiU2qC.js';
3
3
  export { ChartAction, ChartConfig, ChartContainer, ChartDescription, ChartFooter, ChartHeader, ChartLegend, ChartLegendContent, ChartStyle, ChartTitle, ChartTooltip, ChartTooltipContent } from './chart.js';
4
4
  export { ChatInput, ChatInputProps, ChatInterface, ChatInterfaceProps, ChatMessage, ChatMessageBubble, ChatRoutine, ChatSession, ChatSessionList, ChatSessionListProps, ChatThread, ChatThreadProps, ChatToolCall } from './chat-interface.js';
package/dist/index.js CHANGED
@@ -293,6 +293,26 @@ function inclusiveEndInstant(instant, granularity) {
293
293
  const match = CALENDAR_DAY_PATTERN.exec(instant);
294
294
  return match ? `${match[1]}T23:59:59.999Z` : instant;
295
295
  }
296
+ function calendarDayEndInstant(startInstant) {
297
+ return inclusiveEndInstant(startInstant, "day");
298
+ }
299
+ function startInstantFromEndOfDay(endInstant) {
300
+ const match = CALENDAR_DAY_PATTERN.exec(endInstant);
301
+ return match ? `${match[1]}T00:00:00Z` : endInstant;
302
+ }
303
+ function startInstantFromEndOfMinute(endInstant) {
304
+ const match = MINUTE_PATTERN.exec(endInstant);
305
+ return match ? `${match[1]}:00.000Z` : endInstant;
306
+ }
307
+ function isEndOfDayTimestamp(instant) {
308
+ return /T23:59:59(\.\d+)?Z$/.test(instant);
309
+ }
310
+ function isStartOfDayTimestamp(instant) {
311
+ return /T00:00:00(\.0+)?Z$/.test(instant);
312
+ }
313
+ function isEndOfMinuteTimestamp(instant) {
314
+ return /T\d{2}:\d{2}:59(\.\d+)?Z$/.test(instant);
315
+ }
296
316
  function isRealCalendarDay(instant) {
297
317
  const match = /^(\d{4})-(\d{2})-(\d{2})/.exec(instant);
298
318
  if (!match) {
@@ -721,6 +741,15 @@ function denormalizeColumnIdWithReservedNames(columnId) {
721
741
  var _a;
722
742
  return (_a = CEL_IDENTIFIER_TO_COLUMN_ID[columnId]) != null ? _a : columnId;
723
743
  }
744
+ function normalizeColumnsWithReservedNames(expression) {
745
+ return Object.entries(RESERVED_COLUMN_CEL_IDENTIFIERS).reduce(
746
+ (normalized, [columnId, celIdentifier]) => normalized.replace(
747
+ new RegExp(`\\b${escapeRegExp(columnId)}\\b${RESERVED_FIELD_OPERATOR_PATTERN}`, "g"),
748
+ celIdentifier
749
+ ),
750
+ expression
751
+ );
752
+ }
724
753
  function denormalizeColumnsWithReservedNames(expression) {
725
754
  return Object.entries(RESERVED_COLUMN_CEL_IDENTIFIERS).reduce(
726
755
  (denormalized, [columnId, celIdentifier]) => denormalized.replace(
@@ -6241,6 +6270,7 @@ export {
6241
6270
  appendCondition,
6242
6271
  applyDisplayRules,
6243
6272
  applyOperatorChange,
6273
+ calendarDayEndInstant,
6244
6274
  calendarDayStartInstant,
6245
6275
  celStringLiteral,
6246
6276
  compileCelFilterTree,
@@ -6271,13 +6301,17 @@ export {
6271
6301
  isDateRangeOperator,
6272
6302
  isDateRelativeOperator,
6273
6303
  isDateWindowOperator,
6304
+ isEndOfDayTimestamp,
6305
+ isEndOfMinuteTimestamp,
6274
6306
  isMapKeyCelValue,
6275
6307
  isMultiTextCelValue,
6276
6308
  isMultiTextColumn,
6277
6309
  isRealCalendarDay,
6278
6310
  isRelativeDateCelValue,
6279
6311
  isRelativeDurationPreset,
6312
+ isStartOfDayTimestamp,
6280
6313
  mergeContextualIntoCelTree,
6314
+ normalizeColumnsWithReservedNames,
6281
6315
  normalizePageSizeOptions,
6282
6316
  parseCalendarDate,
6283
6317
  readDateCelValue,
@@ -6288,6 +6322,8 @@ export {
6288
6322
  replaceCondition,
6289
6323
  resolveColumnDefinition,
6290
6324
  resolveFilterShape,
6325
+ startInstantFromEndOfDay,
6326
+ startInstantFromEndOfMinute,
6291
6327
  useFloatingWidget,
6292
6328
  validateCondition,
6293
6329
  withTimeOfDay