@proteos/sdk 0.56.0 → 0.57.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.
@@ -1092,6 +1092,19 @@ var FilterGroupSchema = z.lazy(
1092
1092
  })
1093
1093
  );
1094
1094
  var SIZE_VALUE_STRING_RE = /^(\d+\/\d+|\d+px|\d+%|auto|fill)$/;
1095
+ var LENGTH_VALUE_RE = /^(\d+px|\d+%)$/;
1096
+ function isLengthValue(text) {
1097
+ return LENGTH_VALUE_RE.test(text);
1098
+ }
1099
+ var LengthValueSchema = z.string().regex(LENGTH_VALUE_RE, "must match Npx or N%");
1100
+ var STYLE_SIZE_VALUE_RE = /^(\d+px|\d+%|auto|fill)$/;
1101
+ function isStyleSizeValue(text) {
1102
+ return STYLE_SIZE_VALUE_RE.test(text);
1103
+ }
1104
+ var StyleSizeValueSchema = z.string().regex(
1105
+ STYLE_SIZE_VALUE_RE,
1106
+ 'must match Npx, N%, "auto", or "fill"'
1107
+ );
1095
1108
  var SizeValueSchema = z.union([
1096
1109
  z.number().min(0).max(1).describe("Fraction in [0, 1]"),
1097
1110
  z.string().regex(SIZE_VALUE_STRING_RE, 'must match n/m, Npx, N%, "auto", or "fill"')
@@ -1104,6 +1117,7 @@ var GapSchema = z.enum(["xs", "sm", "md", "lg"]);
1104
1117
  var SizingPropsSchema = z.object({
1105
1118
  width: SizeValueSchema.optional(),
1106
1119
  height: SizeValueSchema.optional(),
1120
+ min_height: LengthValueSchema.optional(),
1107
1121
  grow: z.number().optional(),
1108
1122
  shrink: z.number().optional(),
1109
1123
  align: AlignSchema.optional()
@@ -1120,6 +1134,7 @@ var commonPropsShape = {
1120
1134
  read_only_when: FilterGroupSchema.optional(),
1121
1135
  width: SizeValueSchema.optional(),
1122
1136
  height: SizeValueSchema.optional(),
1137
+ min_height: LengthValueSchema.optional(),
1123
1138
  grow: z.number().optional(),
1124
1139
  shrink: z.number().optional(),
1125
1140
  align: AlignSchema.optional(),
@@ -1145,8 +1160,11 @@ var LayoutElementType = {
1145
1160
  RecordFilter: "record_filter",
1146
1161
  List: "list",
1147
1162
  WorkflowTrigger: "workflow_trigger",
1148
- SchedulingPicker: "scheduling_picker"
1163
+ SchedulingPicker: "scheduling_picker",
1164
+ Calendar: "calendar"
1149
1165
  };
1166
+ var CALENDAR_VIEW_KINDS = ["day", "week", "month", "agenda"];
1167
+ var CALENDAR_MAX_OVERLAY_USERS = 8;
1150
1168
  var LayoutTabSchema = z.lazy(
1151
1169
  () => z.object({
1152
1170
  id: z.string().min(1),
@@ -1281,6 +1299,17 @@ var LayoutElementSchema = z.lazy(
1281
1299
  host_user_id: z.string().min(1).optional(),
1282
1300
  contact_id: z.string().optional(),
1283
1301
  is_header_hidden: z.boolean().optional()
1302
+ }),
1303
+ z.object({
1304
+ type: z.literal("calendar"),
1305
+ ...commonPropsShape,
1306
+ user_id: z.string().min(1),
1307
+ default_view: z.enum(CALENDAR_VIEW_KINDS).optional(),
1308
+ views: z.array(z.enum(CALENDAR_VIEW_KINDS)).min(1).optional(),
1309
+ date: z.string().optional(),
1310
+ is_record_scoped: z.boolean().optional(),
1311
+ overlay_user_ids: z.array(z.string().min(1)).max(CALENDAR_MAX_OVERLAY_USERS).optional(),
1312
+ is_hosted_create_allowed: z.boolean().optional()
1284
1313
  })
1285
1314
  ])
1286
1315
  );
@@ -1307,11 +1336,17 @@ var PAGE_BACKGROUND_TOKENS = [
1307
1336
  "danger",
1308
1337
  "info"
1309
1338
  ];
1339
+ var PAGE_BACKGROUND_COLOR_RE = /^(#[0-9a-fA-F]{3,8}|(rgb|rgba|hsl|hsla|oklch|oklab)\([0-9a-zA-Z.,%/ +-]+\))$/;
1340
+ function isPageBackground(text) {
1341
+ const value = text.trim();
1342
+ if (value.length === 0 || value.length > 64) return false;
1343
+ return PAGE_BACKGROUND_TOKENS.includes(value) || PAGE_BACKGROUND_COLOR_RE.test(value);
1344
+ }
1310
1345
  var PageStyleSchema = z.object({
1311
- background: z.string().optional(),
1312
- max_width: SizeValueSchema.optional(),
1313
- padding_x: SizeValueSchema.optional(),
1314
- padding_y: SizeValueSchema.optional()
1346
+ background: z.string().refine(isPageBackground, "must be a design token or a hex / rgb / hsl / oklch / oklab color").optional(),
1347
+ max_width: StyleSizeValueSchema.optional(),
1348
+ padding_x: StyleSizeValueSchema.optional(),
1349
+ padding_y: StyleSizeValueSchema.optional()
1315
1350
  });
1316
1351
  var PageLayoutSchema = z.object({
1317
1352
  version: z.literal(1),
@@ -1765,6 +1800,10 @@ var DesignReferenceSchema = AuditFieldsSchema.extend({
1765
1800
  description: z.string(),
1766
1801
  content: z.string().optional()
1767
1802
  });
1803
+ var CURRENT_USER = "$current_user";
1804
+ function isCurrentUser(value) {
1805
+ return value === CURRENT_USER;
1806
+ }
1768
1807
  var CURRENT_USER_DEFAULT = { type: "current_user" };
1769
1808
  function isCurrentUserDefault(value) {
1770
1809
  if (!value || typeof value !== "object" || Array.isArray(value)) return false;
@@ -1866,6 +1905,6 @@ var MetaClient = class {
1866
1905
  }
1867
1906
  };
1868
1907
 
1869
- export { AppConfigurationSchema, AppHomeSchema, AppSchema, AttributeSchema, AuditFieldsSchema, BUILT_IN_CONTROLS, CURRENT_USER_DEFAULT, ColumnSchema, ComponentSchema, ContactAddressAttributeMetaSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntityContactBindingSchema, EntityExtensionSchema, EntitySchema, EntityWithSchemaSchema, ExtensionPositionSchema, FileAttributeMetaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, LayoutElementSchema, LayoutElementType, LayoutTabSchema, ListExtensionColumnPlacementSchema, ListExtensionSchema, ListSchema, ListViewSchema, MENU_CONFIGURATION_EXTENSION_ANCHOR_ITEMS, MenuConfigurationExtensionPlacementSchema, MenuConfigurationExtensionPositionSchema, MenuConfigurationExtensionSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PAGE_BACKGROUND_TOKENS, PAGE_EXTENSION_ANCHOR_MAIN, PAGE_EXTENSION_ANCHOR_SIDE_PANEL, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageExtensionPlacementSchema, PageExtensionSchema, PageIterator, PageLayoutSchema, PageLayoutSidePanelSchema, PageSchema, PageStyleSchema, PrincipalRefSchema, RECORD_TITLE_FIELD, RelationAttributeMetaSchema, ResponseMetaSchema, SizeValueSchema, SortConfigSchema, UserAttributeMetaSchema, UserRefSchema, VariableSchema, acceptsCurrentUserDefault, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isBuiltInControl, isCurrentUserDefault, isPlatformAttributeName, isReservedAttributeName, isTitleQueryable, localeNumberSeparators, lookupCompatibleControls, lookupControls, lookupPrimaryControl, parseAmount, parseContactAddressMeta, parseCurrencyMeta, parseFileMeta, parsePrincipalMeta, parseRelationMeta, parseUserMeta, platformAttributes, titleTemplateVariables };
1870
- //# sourceMappingURL=chunk-AB4HIKF3.js.map
1871
- //# sourceMappingURL=chunk-AB4HIKF3.js.map
1908
+ export { AppConfigurationSchema, AppHomeSchema, AppSchema, AttributeSchema, AuditFieldsSchema, BUILT_IN_CONTROLS, CALENDAR_MAX_OVERLAY_USERS, CALENDAR_VIEW_KINDS, CURRENT_USER, CURRENT_USER_DEFAULT, ColumnSchema, ComponentSchema, ContactAddressAttributeMetaSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntityContactBindingSchema, EntityExtensionSchema, EntitySchema, EntityWithSchemaSchema, ExtensionPositionSchema, FileAttributeMetaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, LayoutElementSchema, LayoutElementType, LayoutTabSchema, LengthValueSchema, ListExtensionColumnPlacementSchema, ListExtensionSchema, ListSchema, ListViewSchema, MENU_CONFIGURATION_EXTENSION_ANCHOR_ITEMS, MenuConfigurationExtensionPlacementSchema, MenuConfigurationExtensionPositionSchema, MenuConfigurationExtensionSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PAGE_BACKGROUND_COLOR_RE, PAGE_BACKGROUND_TOKENS, PAGE_EXTENSION_ANCHOR_MAIN, PAGE_EXTENSION_ANCHOR_SIDE_PANEL, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageExtensionPlacementSchema, PageExtensionSchema, PageIterator, PageLayoutSchema, PageLayoutSidePanelSchema, PageSchema, PageStyleSchema, PrincipalRefSchema, RECORD_TITLE_FIELD, RelationAttributeMetaSchema, ResponseMetaSchema, SizeValueSchema, SortConfigSchema, StyleSizeValueSchema, UserAttributeMetaSchema, UserRefSchema, VariableSchema, acceptsCurrentUserDefault, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isBuiltInControl, isCurrentUser, isCurrentUserDefault, isLengthValue, isPageBackground, isPlatformAttributeName, isReservedAttributeName, isStyleSizeValue, isTitleQueryable, localeNumberSeparators, lookupCompatibleControls, lookupControls, lookupPrimaryControl, parseAmount, parseContactAddressMeta, parseCurrencyMeta, parseFileMeta, parsePrincipalMeta, parseRelationMeta, parseUserMeta, platformAttributes, titleTemplateVariables };
1909
+ //# sourceMappingURL=chunk-U3FT5KAH.js.map
1910
+ //# sourceMappingURL=chunk-U3FT5KAH.js.map