@dyrected/core 2.7.1 → 2.8.1

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.
Files changed (53) hide show
  1. package/dist/app-config-7G-3tF_I.d.cts +2259 -0
  2. package/dist/app-config-7G-3tF_I.d.ts +2259 -0
  3. package/dist/app-config-B3ByBjCN.d.cts +2222 -0
  4. package/dist/app-config-B3ByBjCN.d.ts +2222 -0
  5. package/dist/app-config-B5tYsZaH.d.cts +2404 -0
  6. package/dist/app-config-B5tYsZaH.d.ts +2404 -0
  7. package/dist/app-config-BEuyPktb.d.cts +2556 -0
  8. package/dist/app-config-BEuyPktb.d.ts +2556 -0
  9. package/dist/app-config-BIkjQWzU.d.cts +2218 -0
  10. package/dist/app-config-BIkjQWzU.d.ts +2218 -0
  11. package/dist/app-config-BfpeE3bF.d.cts +2100 -0
  12. package/dist/app-config-BfpeE3bF.d.ts +2100 -0
  13. package/dist/app-config-CCe-yq9q.d.cts +2222 -0
  14. package/dist/app-config-CCe-yq9q.d.ts +2222 -0
  15. package/dist/app-config-CPOs7THF.d.cts +2217 -0
  16. package/dist/app-config-CPOs7THF.d.ts +2217 -0
  17. package/dist/app-config-Ctp454zB.d.cts +2214 -0
  18. package/dist/app-config-Ctp454zB.d.ts +2214 -0
  19. package/dist/app-config-DJmNYgYh.d.cts +2305 -0
  20. package/dist/app-config-DJmNYgYh.d.ts +2305 -0
  21. package/dist/app-config-DO3laV58.d.cts +2397 -0
  22. package/dist/app-config-DO3laV58.d.ts +2397 -0
  23. package/dist/app-config-DZf_mmi9.d.cts +2211 -0
  24. package/dist/app-config-DZf_mmi9.d.ts +2211 -0
  25. package/dist/app-config-SkUoN5JU.d.cts +2192 -0
  26. package/dist/app-config-SkUoN5JU.d.ts +2192 -0
  27. package/dist/app-config-WzqpuZMr.d.cts +2566 -0
  28. package/dist/app-config-WzqpuZMr.d.ts +2566 -0
  29. package/dist/app-config-fEjRm1o9.d.cts +2402 -0
  30. package/dist/app-config-fEjRm1o9.d.ts +2402 -0
  31. package/dist/app-config-oz8H_MOX.d.cts +2224 -0
  32. package/dist/app-config-oz8H_MOX.d.ts +2224 -0
  33. package/dist/chunk-3TRRTN6U.js +3441 -0
  34. package/dist/chunk-5ZIA5COH.js +3414 -0
  35. package/dist/chunk-6TWQ6GTD.js +3480 -0
  36. package/dist/chunk-AQO4HI2Y.js +3204 -0
  37. package/dist/chunk-DFBLNYUH.js +3402 -0
  38. package/dist/chunk-GFFGDHST.js +3543 -0
  39. package/dist/chunk-KEKOEAX6.js +3139 -0
  40. package/dist/chunk-PRQ2RF5C.js +3485 -0
  41. package/dist/chunk-PZMDK3MH.js +3203 -0
  42. package/dist/chunk-SM32ND5M.js +3472 -0
  43. package/dist/chunk-XX7N64NL.js +3550 -0
  44. package/dist/chunk-ZISFMAEL.js +3550 -0
  45. package/dist/index.cjs +439 -9
  46. package/dist/index.d.cts +166 -3
  47. package/dist/index.d.ts +166 -3
  48. package/dist/index.js +53 -1
  49. package/dist/server.cjs +623 -367
  50. package/dist/server.d.cts +26 -7
  51. package/dist/server.d.ts +26 -7
  52. package/dist/server.js +420 -359
  53. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as ArrayField, g as BlocksField, h as BooleanField, i as AuthConfig, j as AccessPolicyResolver, k as DateField, l as DateTimeField, E as EmailField, I as IconField, m as ImageField, J as JoinField, n as JsonField, M as MultiSelectField, N as NumberField, O as ObjectField, R as RadioField, o as RelationshipField, p as RichTextField, q as RowField, S as SelectField, T as TextField, r as TextareaField, s as TimeField, U as UrlField } from './app-config-ChsrBB7p.cjs';
2
- export { t as AccessFunction, u as AccessFunctionArgs, v as AccessResult, w as AccessRule, x as AdminAuthAccessResolution, y as AdminAuthClaimMapping, z as AdminAuthMember, K as AdminAuthProvider, Q as AdminAuthProviderMembersConfig, V as AdminAuthProvisioningMode, X as AdminAuthResolveAccessArgs, Y as AdminAuthResolvedIdentity, Z as AdminConfig, _ as AdminDashboardComponentSlots, $ as AdminIconName, a0 as BaseAdminAuthProvider, a1 as BaseFieldAdmin, a2 as BlockVariant, a3 as BooleanFieldAdmin, a4 as BooleanFormat, a5 as CharacterLimitFieldAdmin, a6 as CharacterLimitFieldConfig, a7 as CollectionAfterChangeHook, a8 as CollectionAfterDeleteHook, a9 as CollectionAfterReadHook, aa as CollectionAfterReadHookEntry, ab as CollectionAfterTransitionHook, ac as CollectionBeforeChangeHook, ad as CollectionBeforeChangeHookEntry, ae as CollectionBeforeDeleteHook, af as CollectionBeforeReadHook, ag as CollectionBeforeReadHookEntry, ah as CollectionBeforeTransitionHook, ai as CollectionListComponentSlots, aj as CustomAdminAuthProvider, ak as DatabaseAdapter, al as DateFieldAdmin, am as DateFormat, an as DisplayTone, ao as DynamicOptionItem, ap as DynamicOptionsConfig, aq as DynamicOptionsResolver, ar as DynamicOptionsResolverArgs, as as DyrectedLoggerConfig, at as DyrectedObservabilityConfig, au as EmailFieldAdmin, av as FieldAdminHooks, aw as FieldAdminOnChangeHook, ax as FieldAdminOnChangeHookArgs, ay as FieldAdminOptionsHook, az as FieldAdminOptionsHookArgs, aA as FieldAdminOptionsHookResult, aB as FieldAfterReadHook, aC as FieldAfterReadHookArgs, aD as FieldBase, aE as FieldBeforeChangeHook, aF as FieldBeforeChangeHookArgs, aG as FieldHook, aH as FieldHooks, aI as FieldType, aJ as FileData, aK as GlobalAfterChangeHook, aL as GlobalAfterReadHook, aM as GlobalAfterReadHookEntry, aN as GlobalBeforeChangeHook, aO as GlobalBeforeChangeHookEntry, aP as GlobalBeforeReadHook, aQ as GlobalBeforeReadHookEntry, aR as HeadingLevel, aS as HookFunction, aT as IconFieldAdmin, aU as ImageService, aV as JoinFieldAdmin, aW as JsonFieldAdmin, aX as JsonFormat, aY as LIFECYCLE_EVENT_NAMES, aZ as LifecycleEventHandler, a_ as LinkFormat, a$ as MultiSelectFieldAdmin, b0 as NamedAccessPolicy, b1 as NumberFieldAdmin, b2 as NumberFormat, b3 as NumberLimitFieldAdmin, b4 as NumberLimitFieldConfig, b5 as OIDCAdminAuthProvider, b6 as OptionFormat, b7 as PaginatedResult, b8 as PublicAdminAuthProvider, b9 as RadioFieldAdmin, ba as RateLimitConfig, bb as ReadonlyDatabaseAdapter, bc as RichTextFeature, bd as RichTextFieldConfig, be as SelectFieldAdmin, bf as StorageAdapter, bg as TextFieldAdmin, bh as TextFormat, bi as TextareaFieldAdmin, bj as TrustProxyConfig, bk as TypedField, bl as UploadConfig, bm as UrlFieldAdmin, bn as UrlLinkValue, bo as WordLimitFieldAdmin, bp as WordLimitFieldConfig, bq as WorkflowMetadata, br as WorkflowRole, bs as WorkflowState, bt as WorkflowTransitionContext } from './app-config-ChsrBB7p.cjs';
1
+ import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as ArrayField, K as BlocksField, M as BooleanField, N as AuthConfig, O as AccessPolicyResolver, Q as DateField, R as DateTimeField, S as EmailField, T as IconField, U as ImageField, V as JoinField, X as JsonField, Y as MultiSelectField, Z as NumberField, _ as ObjectField, $ as RadioField, a0 as RelationshipField, a1 as RichTextField, a2 as RowField, a3 as SelectField, a4 as TextField, a5 as TextareaField, a6 as TimeField, a7 as UrlField } from './app-config-WzqpuZMr.cjs';
2
+ export { a8 as AccessFunction, a9 as AccessFunctionArgs, aa as AccessResult, ab as AccessRule, ac as AdminAuthAccessResolution, ad as AdminAuthClaimMapping, ae as AdminAuthMember, af as AdminAuthProvider, ag as AdminAuthProviderMembersConfig, ah as AdminAuthProvisioningMode, ai as AdminAuthResolveAccessArgs, aj as AdminAuthResolvedIdentity, ak as AdminConfig, al as AdminDashboardComponentSlots, am as AdminIconName, an as AggregateArgs, ao as AggregateCastType, ap as AggregateInput, aq as AggregateOperation, ar as AggregateResult, as as BaseAdminAuthProvider, at as BaseFieldAdmin, au as BlockVariant, av as BooleanFieldAdmin, aw as BooleanFormat, ax as CharacterLimitFieldAdmin, ay as CharacterLimitFieldConfig, az as CollectionAfterChangeHook, aA as CollectionAfterDeleteHook, aB as CollectionAfterReadHook, aC as CollectionAfterReadHookEntry, aD as CollectionAfterTransitionHook, aE as CollectionBeforeChangeHook, aF as CollectionBeforeChangeHookEntry, aG as CollectionBeforeDeleteHook, aH as CollectionBeforeReadHook, aI as CollectionBeforeReadHookEntry, aJ as CollectionBeforeTransitionHook, aK as CollectionListComponentSlots, aL as CountOperation, aM as CustomAdminAuthProvider, aN as DatabaseAdapter, aO as DateFieldAdmin, aP as DateFormat, aQ as DetailSpan, aR as DisplayTone, aS as DisplayVariant, aT as DynamicOptionItem, aU as DynamicOptionsConfig, aV as DynamicOptionsResolver, aW as DynamicOptionsResolverArgs, aX as DyrectedLoggerConfig, aY as DyrectedObservabilityConfig, aZ as EmailFieldAdmin, a_ as FieldAdminHooks, a$ as FieldAdminOnChangeHook, b0 as FieldAdminOnChangeHookArgs, b1 as FieldAdminOptionsHook, b2 as FieldAdminOptionsHookArgs, b3 as FieldAdminOptionsHookResult, b4 as FieldAfterReadHook, b5 as FieldAfterReadHookArgs, b6 as FieldBase, b7 as FieldBeforeChangeHook, b8 as FieldBeforeChangeHookArgs, b9 as FieldHook, ba as FieldHooks, bb as FieldType, bc as FileData, bd as GlobalAfterChangeHook, be as GlobalAfterReadHook, bf as GlobalAfterReadHookEntry, bg as GlobalBeforeChangeHook, bh as GlobalBeforeChangeHookEntry, bi as GlobalBeforeReadHook, bj as GlobalBeforeReadHookEntry, bk as HeadingLevel, bl as HookFunction, bm as IconFieldAdmin, bn as ImageService, bo as InferAggregateResult, bp as JoinFieldAdmin, bq as JsonFieldAdmin, br as JsonFormat, bs as LIFECYCLE_EVENT_NAMES, bt as LifecycleEventHandler, bu as LinkFormat, bv as MultiSelectFieldAdmin, bw as NamedAccessPolicy, bx as NumberFieldAdmin, by as NumberFormat, bz as NumberLimitFieldAdmin, bA as NumberLimitFieldConfig, bB as NumericOperation, bC as OIDCAdminAuthProvider, bD as OptionFormat, bE as PaginatedResult, bF as PublicAdminAuthProvider, bG as RadioFieldAdmin, bH as RateLimitConfig, bI as ReadonlyDatabaseAdapter, bJ as RichTextFeature, bK as RichTextFieldConfig, bL as SelectFieldAdmin, bM as StorageAdapter, bN as TextFieldAdmin, bO as TextFormat, bP as TextareaFieldAdmin, bQ as TrustProxyConfig, bR as TypedField, bS as UploadConfig, bT as UrlFieldAdmin, bU as UrlLinkValue, bV as WordLimitFieldAdmin, bW as WordLimitFieldConfig, bX as WorkflowMetadata, bY as WorkflowRole, bZ as WorkflowState, b_ as WorkflowTransitionContext } from './app-config-WzqpuZMr.cjs';
3
3
  import jexl from 'jexl';
4
4
  import 'lucide-react';
5
5
  import 'pino';
@@ -429,6 +429,15 @@ declare function round(val: unknown, decimals?: number): number;
429
429
  * @example `clamp(150, 0, 100)` => `100`
430
430
  */
431
431
  declare function clamp(val: unknown, minVal: unknown, maxVal: unknown): number;
432
+ declare function ceil(val: unknown): number;
433
+ declare function floor(val: unknown): number;
434
+ declare function abs(val: unknown): number;
435
+ declare function min(...args: unknown[]): number;
436
+ declare function max(...args: unknown[]): number;
437
+ declare function pow(base: unknown, exp: unknown): number;
438
+ declare function sqrt(val: unknown): number;
439
+ declare function sum(arr: unknown): number;
440
+ declare function count(val: unknown): number;
432
441
  /**
433
442
  * Returns a fallback value if the target value is undefined, null, or an empty string.
434
443
  *
@@ -457,6 +466,16 @@ declare function get(obj: unknown, path: unknown, fallback?: unknown): unknown;
457
466
  * Registers all Dyrected built-in helper functions onto a Jexl evaluation instance.
458
467
  */
459
468
  declare function registerJexlHelpers(jexlInstance?: typeof jexl): void;
469
+ /**
470
+ * Standard shared evaluator for JEXL expressions across server and browser.
471
+ * Injects math namespace and standard helpers into the context.
472
+ */
473
+ declare function evaluateJexl(expression: string, context?: Record<string, any>): Promise<any>;
474
+ /**
475
+ * Synchronous standard shared evaluator for JEXL expressions.
476
+ * Injects math namespace and standard helpers into the context.
477
+ */
478
+ declare function evaluateJexlSync(expression: string, context?: Record<string, any>): any;
460
479
  /** List of all built-in Jexl helper function names for AST validation. */
461
480
  declare const BUILTIN_JEXL_HELPERS: readonly ["slugify", "lower", "upper", "trim", "capitalize", "truncate", "readingTime", "wordCount", "replace", "startsWith", "endsWith", "now", "today", "formatDate", "addDays", "diffDays", "isPast", "isFuture", "includes", "join", "first", "last", "compact", "unique", "length", "round", "clamp", "default", "coalesce", "isEmpty", "get"];
462
481
 
@@ -593,6 +612,150 @@ declare function transitionWorkflow(args: {
593
612
  req: HookRequestContext;
594
613
  }): Promise<BaseDocument>;
595
614
 
615
+ /**
616
+ * Normalizes a DetailItem (which may be a shorthand string) into a standard DetailItem object.
617
+ *
618
+ * @example `normalizeDetailItem('title')` => `{ type: 'field', field: 'title' }`
619
+ */
620
+ declare function normalizeDetailItem(item: DetailItem): Exclude<DetailItem, string>;
621
+ /**
622
+ * Creates a section container in a Detail View layout.
623
+ *
624
+ * @example
625
+ * ```ts
626
+ * displaySection('Product Information', [
627
+ * displayField('name', { span: 8 }),
628
+ * displayField('sku', { span: 4 }),
629
+ * ], { span: 8, icon: 'package' })
630
+ * ```
631
+ */
632
+ declare function displaySection(title: string, items: DetailItem[], options?: DetailSectionOptions): DetailSection;
633
+ /**
634
+ * Creates a single tab entry for use within `displayTabs()`.
635
+ */
636
+ declare function displayTab(label: string, items: DetailItem[], options?: DetailTabOptions): DetailTab;
637
+ /**
638
+ * Creates a tabbed container in a Detail View layout.
639
+ *
640
+ * @example
641
+ * ```ts
642
+ * displayTabs([
643
+ * displayTab('Specifications', [displayField('specs')]),
644
+ * displayTab('Reviews', [displayRepeat('reviews', [...])], { badge: '3' }),
645
+ * ])
646
+ * ```
647
+ */
648
+ declare function displayTabs(tabs: DetailTab[], options?: DetailTabsOptions): DetailTabs;
649
+ /**
650
+ * Creates a multi-column grid layout inside a section or detail schema.
651
+ *
652
+ * @example
653
+ * ```ts
654
+ * displayGrid(2, [
655
+ * displayField('firstName'),
656
+ * displayField('lastName'),
657
+ * ])
658
+ * ```
659
+ */
660
+ declare function displayGrid(columns: number, items: DetailItem[], options?: DetailGridOptions): DetailGrid;
661
+ /**
662
+ * Declares a field for presentation in a Detail View.
663
+ *
664
+ * @example
665
+ * ```ts
666
+ * displayField('status', { display: 'badge', badgeColors: { active: 'emerald' } })
667
+ * displayField('author.name', { label: 'Written By' })
668
+ * displayField('specs', { display: 'key-value', keyLabel: 'Spec', valueLabel: 'Detail' })
669
+ * ```
670
+ */
671
+ declare function displayField(fieldName: string, options?: DisplayFieldOptions): DetailField;
672
+ /**
673
+ * Renders an array/repeated field using a delegated display schema.
674
+ * Supports `'table'`, `'cards'`, and `'list'` layouts.
675
+ *
676
+ * @example
677
+ * ```ts
678
+ * displayRepeat('items', [
679
+ * displayField('product'),
680
+ * displayField('quantity'),
681
+ * displayField('price'),
682
+ * ], { layout: 'table' })
683
+ * ```
684
+ */
685
+ declare function displayRepeat(fieldName: string, items: DetailItem[], options?: DetailRepeatOptions): DetailRepeat;
686
+ /**
687
+ * Renders a computed value calculated from document and user context.
688
+ *
689
+ * @example
690
+ * ```ts
691
+ * displayComputed('Reading Time', 'math.ceil(doc.wordCount / 200) + " min"')
692
+ * displayComputed('Total', ({ doc }) => `$${doc.price * doc.quantity}`)
693
+ * ```
694
+ */
695
+ declare function displayComputed<TDoc = any>(label: string, expressionOrOptionsOrHandler: string | DetailComputedOptions<TDoc> | ComputedHandler<TDoc>, options?: DetailComputedOptions<TDoc>): DetailComputed<TDoc>;
696
+ /**
697
+ * Creates a horizontal divider line in a Detail View layout.
698
+ *
699
+ * @example
700
+ * ```ts
701
+ * displayDivider({ spacing: 'md' })
702
+ * ```
703
+ */
704
+ declare function displayDivider(options?: DetailDividerOptions): DetailDivider;
705
+ /**
706
+ * Renders static text, heading, callout, or information notice in a Detail View layout.
707
+ *
708
+ * @example
709
+ * ```ts
710
+ * displayText('Please note this action is permanent.', { variant: 'warning' })
711
+ * displayText('Overview Notes', { variant: 'heading' })
712
+ * ```
713
+ */
714
+ declare function displayText(content: string, options?: DetailTextOptions): DetailText;
715
+ /**
716
+ * Renders a custom React component registered by name in the Admin panel.
717
+ *
718
+ * @example
719
+ * ```ts
720
+ * displayCustom('AnalyticsChart', { props: { timeframe: '30d' } })
721
+ * ```
722
+ */
723
+ declare function displayCustom<TDoc = any>(name: string, options?: DetailCustomOptions<TDoc>): DetailCustom<TDoc>;
724
+ /**
725
+ * Alias for `displayCustom` to render a custom component in a Detail View layout.
726
+ */
727
+ declare function displayCustomComponent<TDoc = any>(name: string, options?: DetailCustomOptions<TDoc>): DetailCustom<TDoc>;
728
+ /**
729
+ * Evaluates server-side computed functions and JEXL expressions from a detail schema
730
+ * and attaches them to `doc._meta.computed`.
731
+ */
732
+ declare function evaluateDetailComputed(detail: DetailSchema | boolean | undefined, doc: any, user: any, db: any): Promise<any>;
733
+ /**
734
+ * Generates an automatic default 12-column Detail View schema for a collection or global
735
+ * when no explicit `detail` configuration is provided.
736
+ */
737
+ declare function generateDefaultDetailSchema(schema: {
738
+ fields?: Field[];
739
+ labels?: {
740
+ singular?: string;
741
+ plural?: string;
742
+ };
743
+ label?: string;
744
+ slug?: string;
745
+ }): DetailSchema;
746
+ /**
747
+ * Evaluates whether a detail item should be visible based on its `options.visible` rule.
748
+ * Supports boolean values or JEXL expressions evaluated against `{ doc, user }`.
749
+ * Works consistently for top-level and nested detail items.
750
+ *
751
+ * @example
752
+ * ```ts
753
+ * isDetailItemVisible(displayField('secret', { visible: false }), doc, user) // false
754
+ * isDetailItemVisible(displayField('publishedAt', { visible: "doc.status == 'published'" }), doc, user)
755
+ * ```
756
+ */
757
+ declare function isDetailItemVisible(item: DetailItem, doc: any, user?: any): boolean;
758
+
596
759
  type TopLevelFieldName<TFields extends readonly Field[]> = Extract<TFields[number], {
597
760
  name: string;
598
761
  }>["name"];
@@ -1011,4 +1174,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
1011
1174
  fields: T;
1012
1175
  }): T;
1013
1176
 
1014
- export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, endsWith, executeFieldAfterRead, executeFieldBeforeChange, first, formatConfigDiagnostics, formatDate, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, normalizeConfig, now, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, startsWith, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, wordCount, workflowCapabilities };
1177
+ export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, first, floor, formatConfigDiagnostics, formatDate, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, wordCount, workflowCapabilities };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as ArrayField, g as BlocksField, h as BooleanField, i as AuthConfig, j as AccessPolicyResolver, k as DateField, l as DateTimeField, E as EmailField, I as IconField, m as ImageField, J as JoinField, n as JsonField, M as MultiSelectField, N as NumberField, O as ObjectField, R as RadioField, o as RelationshipField, p as RichTextField, q as RowField, S as SelectField, T as TextField, r as TextareaField, s as TimeField, U as UrlField } from './app-config-ChsrBB7p.js';
2
- export { t as AccessFunction, u as AccessFunctionArgs, v as AccessResult, w as AccessRule, x as AdminAuthAccessResolution, y as AdminAuthClaimMapping, z as AdminAuthMember, K as AdminAuthProvider, Q as AdminAuthProviderMembersConfig, V as AdminAuthProvisioningMode, X as AdminAuthResolveAccessArgs, Y as AdminAuthResolvedIdentity, Z as AdminConfig, _ as AdminDashboardComponentSlots, $ as AdminIconName, a0 as BaseAdminAuthProvider, a1 as BaseFieldAdmin, a2 as BlockVariant, a3 as BooleanFieldAdmin, a4 as BooleanFormat, a5 as CharacterLimitFieldAdmin, a6 as CharacterLimitFieldConfig, a7 as CollectionAfterChangeHook, a8 as CollectionAfterDeleteHook, a9 as CollectionAfterReadHook, aa as CollectionAfterReadHookEntry, ab as CollectionAfterTransitionHook, ac as CollectionBeforeChangeHook, ad as CollectionBeforeChangeHookEntry, ae as CollectionBeforeDeleteHook, af as CollectionBeforeReadHook, ag as CollectionBeforeReadHookEntry, ah as CollectionBeforeTransitionHook, ai as CollectionListComponentSlots, aj as CustomAdminAuthProvider, ak as DatabaseAdapter, al as DateFieldAdmin, am as DateFormat, an as DisplayTone, ao as DynamicOptionItem, ap as DynamicOptionsConfig, aq as DynamicOptionsResolver, ar as DynamicOptionsResolverArgs, as as DyrectedLoggerConfig, at as DyrectedObservabilityConfig, au as EmailFieldAdmin, av as FieldAdminHooks, aw as FieldAdminOnChangeHook, ax as FieldAdminOnChangeHookArgs, ay as FieldAdminOptionsHook, az as FieldAdminOptionsHookArgs, aA as FieldAdminOptionsHookResult, aB as FieldAfterReadHook, aC as FieldAfterReadHookArgs, aD as FieldBase, aE as FieldBeforeChangeHook, aF as FieldBeforeChangeHookArgs, aG as FieldHook, aH as FieldHooks, aI as FieldType, aJ as FileData, aK as GlobalAfterChangeHook, aL as GlobalAfterReadHook, aM as GlobalAfterReadHookEntry, aN as GlobalBeforeChangeHook, aO as GlobalBeforeChangeHookEntry, aP as GlobalBeforeReadHook, aQ as GlobalBeforeReadHookEntry, aR as HeadingLevel, aS as HookFunction, aT as IconFieldAdmin, aU as ImageService, aV as JoinFieldAdmin, aW as JsonFieldAdmin, aX as JsonFormat, aY as LIFECYCLE_EVENT_NAMES, aZ as LifecycleEventHandler, a_ as LinkFormat, a$ as MultiSelectFieldAdmin, b0 as NamedAccessPolicy, b1 as NumberFieldAdmin, b2 as NumberFormat, b3 as NumberLimitFieldAdmin, b4 as NumberLimitFieldConfig, b5 as OIDCAdminAuthProvider, b6 as OptionFormat, b7 as PaginatedResult, b8 as PublicAdminAuthProvider, b9 as RadioFieldAdmin, ba as RateLimitConfig, bb as ReadonlyDatabaseAdapter, bc as RichTextFeature, bd as RichTextFieldConfig, be as SelectFieldAdmin, bf as StorageAdapter, bg as TextFieldAdmin, bh as TextFormat, bi as TextareaFieldAdmin, bj as TrustProxyConfig, bk as TypedField, bl as UploadConfig, bm as UrlFieldAdmin, bn as UrlLinkValue, bo as WordLimitFieldAdmin, bp as WordLimitFieldConfig, bq as WorkflowMetadata, br as WorkflowRole, bs as WorkflowState, bt as WorkflowTransitionContext } from './app-config-ChsrBB7p.js';
1
+ import { F as Field, B as Block, D as DyrectedConfig, C as CollectionConfig, A as AdminAuthConfig, P as PublicAdminAuthConfig, G as GlobalConfig, a as DeclarativeHookExpression, W as WorkflowConfig, b as AuthenticatedUser, c as WorkflowTransition, L as LifecycleEventName, d as LifecycleEvent, e as BaseDocument, H as HookRequestContext, f as DetailComputedOptions, g as ComputedHandler, h as DetailComputed, i as DetailCustomOptions, j as DetailCustom, k as DetailDividerOptions, l as DetailDivider, m as DisplayFieldOptions, n as DetailField, o as DetailItem, p as DetailGridOptions, q as DetailGrid, r as DetailRepeatOptions, s as DetailRepeat, t as DetailSectionOptions, u as DetailSection, v as DetailTabOptions, w as DetailTab, x as DetailTabsOptions, y as DetailTabs, z as DetailTextOptions, E as DetailText, I as DetailSchema, J as ArrayField, K as BlocksField, M as BooleanField, N as AuthConfig, O as AccessPolicyResolver, Q as DateField, R as DateTimeField, S as EmailField, T as IconField, U as ImageField, V as JoinField, X as JsonField, Y as MultiSelectField, Z as NumberField, _ as ObjectField, $ as RadioField, a0 as RelationshipField, a1 as RichTextField, a2 as RowField, a3 as SelectField, a4 as TextField, a5 as TextareaField, a6 as TimeField, a7 as UrlField } from './app-config-WzqpuZMr.js';
2
+ export { a8 as AccessFunction, a9 as AccessFunctionArgs, aa as AccessResult, ab as AccessRule, ac as AdminAuthAccessResolution, ad as AdminAuthClaimMapping, ae as AdminAuthMember, af as AdminAuthProvider, ag as AdminAuthProviderMembersConfig, ah as AdminAuthProvisioningMode, ai as AdminAuthResolveAccessArgs, aj as AdminAuthResolvedIdentity, ak as AdminConfig, al as AdminDashboardComponentSlots, am as AdminIconName, an as AggregateArgs, ao as AggregateCastType, ap as AggregateInput, aq as AggregateOperation, ar as AggregateResult, as as BaseAdminAuthProvider, at as BaseFieldAdmin, au as BlockVariant, av as BooleanFieldAdmin, aw as BooleanFormat, ax as CharacterLimitFieldAdmin, ay as CharacterLimitFieldConfig, az as CollectionAfterChangeHook, aA as CollectionAfterDeleteHook, aB as CollectionAfterReadHook, aC as CollectionAfterReadHookEntry, aD as CollectionAfterTransitionHook, aE as CollectionBeforeChangeHook, aF as CollectionBeforeChangeHookEntry, aG as CollectionBeforeDeleteHook, aH as CollectionBeforeReadHook, aI as CollectionBeforeReadHookEntry, aJ as CollectionBeforeTransitionHook, aK as CollectionListComponentSlots, aL as CountOperation, aM as CustomAdminAuthProvider, aN as DatabaseAdapter, aO as DateFieldAdmin, aP as DateFormat, aQ as DetailSpan, aR as DisplayTone, aS as DisplayVariant, aT as DynamicOptionItem, aU as DynamicOptionsConfig, aV as DynamicOptionsResolver, aW as DynamicOptionsResolverArgs, aX as DyrectedLoggerConfig, aY as DyrectedObservabilityConfig, aZ as EmailFieldAdmin, a_ as FieldAdminHooks, a$ as FieldAdminOnChangeHook, b0 as FieldAdminOnChangeHookArgs, b1 as FieldAdminOptionsHook, b2 as FieldAdminOptionsHookArgs, b3 as FieldAdminOptionsHookResult, b4 as FieldAfterReadHook, b5 as FieldAfterReadHookArgs, b6 as FieldBase, b7 as FieldBeforeChangeHook, b8 as FieldBeforeChangeHookArgs, b9 as FieldHook, ba as FieldHooks, bb as FieldType, bc as FileData, bd as GlobalAfterChangeHook, be as GlobalAfterReadHook, bf as GlobalAfterReadHookEntry, bg as GlobalBeforeChangeHook, bh as GlobalBeforeChangeHookEntry, bi as GlobalBeforeReadHook, bj as GlobalBeforeReadHookEntry, bk as HeadingLevel, bl as HookFunction, bm as IconFieldAdmin, bn as ImageService, bo as InferAggregateResult, bp as JoinFieldAdmin, bq as JsonFieldAdmin, br as JsonFormat, bs as LIFECYCLE_EVENT_NAMES, bt as LifecycleEventHandler, bu as LinkFormat, bv as MultiSelectFieldAdmin, bw as NamedAccessPolicy, bx as NumberFieldAdmin, by as NumberFormat, bz as NumberLimitFieldAdmin, bA as NumberLimitFieldConfig, bB as NumericOperation, bC as OIDCAdminAuthProvider, bD as OptionFormat, bE as PaginatedResult, bF as PublicAdminAuthProvider, bG as RadioFieldAdmin, bH as RateLimitConfig, bI as ReadonlyDatabaseAdapter, bJ as RichTextFeature, bK as RichTextFieldConfig, bL as SelectFieldAdmin, bM as StorageAdapter, bN as TextFieldAdmin, bO as TextFormat, bP as TextareaFieldAdmin, bQ as TrustProxyConfig, bR as TypedField, bS as UploadConfig, bT as UrlFieldAdmin, bU as UrlLinkValue, bV as WordLimitFieldAdmin, bW as WordLimitFieldConfig, bX as WorkflowMetadata, bY as WorkflowRole, bZ as WorkflowState, b_ as WorkflowTransitionContext } from './app-config-WzqpuZMr.js';
3
3
  import jexl from 'jexl';
4
4
  import 'lucide-react';
5
5
  import 'pino';
@@ -429,6 +429,15 @@ declare function round(val: unknown, decimals?: number): number;
429
429
  * @example `clamp(150, 0, 100)` => `100`
430
430
  */
431
431
  declare function clamp(val: unknown, minVal: unknown, maxVal: unknown): number;
432
+ declare function ceil(val: unknown): number;
433
+ declare function floor(val: unknown): number;
434
+ declare function abs(val: unknown): number;
435
+ declare function min(...args: unknown[]): number;
436
+ declare function max(...args: unknown[]): number;
437
+ declare function pow(base: unknown, exp: unknown): number;
438
+ declare function sqrt(val: unknown): number;
439
+ declare function sum(arr: unknown): number;
440
+ declare function count(val: unknown): number;
432
441
  /**
433
442
  * Returns a fallback value if the target value is undefined, null, or an empty string.
434
443
  *
@@ -457,6 +466,16 @@ declare function get(obj: unknown, path: unknown, fallback?: unknown): unknown;
457
466
  * Registers all Dyrected built-in helper functions onto a Jexl evaluation instance.
458
467
  */
459
468
  declare function registerJexlHelpers(jexlInstance?: typeof jexl): void;
469
+ /**
470
+ * Standard shared evaluator for JEXL expressions across server and browser.
471
+ * Injects math namespace and standard helpers into the context.
472
+ */
473
+ declare function evaluateJexl(expression: string, context?: Record<string, any>): Promise<any>;
474
+ /**
475
+ * Synchronous standard shared evaluator for JEXL expressions.
476
+ * Injects math namespace and standard helpers into the context.
477
+ */
478
+ declare function evaluateJexlSync(expression: string, context?: Record<string, any>): any;
460
479
  /** List of all built-in Jexl helper function names for AST validation. */
461
480
  declare const BUILTIN_JEXL_HELPERS: readonly ["slugify", "lower", "upper", "trim", "capitalize", "truncate", "readingTime", "wordCount", "replace", "startsWith", "endsWith", "now", "today", "formatDate", "addDays", "diffDays", "isPast", "isFuture", "includes", "join", "first", "last", "compact", "unique", "length", "round", "clamp", "default", "coalesce", "isEmpty", "get"];
462
481
 
@@ -593,6 +612,150 @@ declare function transitionWorkflow(args: {
593
612
  req: HookRequestContext;
594
613
  }): Promise<BaseDocument>;
595
614
 
615
+ /**
616
+ * Normalizes a DetailItem (which may be a shorthand string) into a standard DetailItem object.
617
+ *
618
+ * @example `normalizeDetailItem('title')` => `{ type: 'field', field: 'title' }`
619
+ */
620
+ declare function normalizeDetailItem(item: DetailItem): Exclude<DetailItem, string>;
621
+ /**
622
+ * Creates a section container in a Detail View layout.
623
+ *
624
+ * @example
625
+ * ```ts
626
+ * displaySection('Product Information', [
627
+ * displayField('name', { span: 8 }),
628
+ * displayField('sku', { span: 4 }),
629
+ * ], { span: 8, icon: 'package' })
630
+ * ```
631
+ */
632
+ declare function displaySection(title: string, items: DetailItem[], options?: DetailSectionOptions): DetailSection;
633
+ /**
634
+ * Creates a single tab entry for use within `displayTabs()`.
635
+ */
636
+ declare function displayTab(label: string, items: DetailItem[], options?: DetailTabOptions): DetailTab;
637
+ /**
638
+ * Creates a tabbed container in a Detail View layout.
639
+ *
640
+ * @example
641
+ * ```ts
642
+ * displayTabs([
643
+ * displayTab('Specifications', [displayField('specs')]),
644
+ * displayTab('Reviews', [displayRepeat('reviews', [...])], { badge: '3' }),
645
+ * ])
646
+ * ```
647
+ */
648
+ declare function displayTabs(tabs: DetailTab[], options?: DetailTabsOptions): DetailTabs;
649
+ /**
650
+ * Creates a multi-column grid layout inside a section or detail schema.
651
+ *
652
+ * @example
653
+ * ```ts
654
+ * displayGrid(2, [
655
+ * displayField('firstName'),
656
+ * displayField('lastName'),
657
+ * ])
658
+ * ```
659
+ */
660
+ declare function displayGrid(columns: number, items: DetailItem[], options?: DetailGridOptions): DetailGrid;
661
+ /**
662
+ * Declares a field for presentation in a Detail View.
663
+ *
664
+ * @example
665
+ * ```ts
666
+ * displayField('status', { display: 'badge', badgeColors: { active: 'emerald' } })
667
+ * displayField('author.name', { label: 'Written By' })
668
+ * displayField('specs', { display: 'key-value', keyLabel: 'Spec', valueLabel: 'Detail' })
669
+ * ```
670
+ */
671
+ declare function displayField(fieldName: string, options?: DisplayFieldOptions): DetailField;
672
+ /**
673
+ * Renders an array/repeated field using a delegated display schema.
674
+ * Supports `'table'`, `'cards'`, and `'list'` layouts.
675
+ *
676
+ * @example
677
+ * ```ts
678
+ * displayRepeat('items', [
679
+ * displayField('product'),
680
+ * displayField('quantity'),
681
+ * displayField('price'),
682
+ * ], { layout: 'table' })
683
+ * ```
684
+ */
685
+ declare function displayRepeat(fieldName: string, items: DetailItem[], options?: DetailRepeatOptions): DetailRepeat;
686
+ /**
687
+ * Renders a computed value calculated from document and user context.
688
+ *
689
+ * @example
690
+ * ```ts
691
+ * displayComputed('Reading Time', 'math.ceil(doc.wordCount / 200) + " min"')
692
+ * displayComputed('Total', ({ doc }) => `$${doc.price * doc.quantity}`)
693
+ * ```
694
+ */
695
+ declare function displayComputed<TDoc = any>(label: string, expressionOrOptionsOrHandler: string | DetailComputedOptions<TDoc> | ComputedHandler<TDoc>, options?: DetailComputedOptions<TDoc>): DetailComputed<TDoc>;
696
+ /**
697
+ * Creates a horizontal divider line in a Detail View layout.
698
+ *
699
+ * @example
700
+ * ```ts
701
+ * displayDivider({ spacing: 'md' })
702
+ * ```
703
+ */
704
+ declare function displayDivider(options?: DetailDividerOptions): DetailDivider;
705
+ /**
706
+ * Renders static text, heading, callout, or information notice in a Detail View layout.
707
+ *
708
+ * @example
709
+ * ```ts
710
+ * displayText('Please note this action is permanent.', { variant: 'warning' })
711
+ * displayText('Overview Notes', { variant: 'heading' })
712
+ * ```
713
+ */
714
+ declare function displayText(content: string, options?: DetailTextOptions): DetailText;
715
+ /**
716
+ * Renders a custom React component registered by name in the Admin panel.
717
+ *
718
+ * @example
719
+ * ```ts
720
+ * displayCustom('AnalyticsChart', { props: { timeframe: '30d' } })
721
+ * ```
722
+ */
723
+ declare function displayCustom<TDoc = any>(name: string, options?: DetailCustomOptions<TDoc>): DetailCustom<TDoc>;
724
+ /**
725
+ * Alias for `displayCustom` to render a custom component in a Detail View layout.
726
+ */
727
+ declare function displayCustomComponent<TDoc = any>(name: string, options?: DetailCustomOptions<TDoc>): DetailCustom<TDoc>;
728
+ /**
729
+ * Evaluates server-side computed functions and JEXL expressions from a detail schema
730
+ * and attaches them to `doc._meta.computed`.
731
+ */
732
+ declare function evaluateDetailComputed(detail: DetailSchema | boolean | undefined, doc: any, user: any, db: any): Promise<any>;
733
+ /**
734
+ * Generates an automatic default 12-column Detail View schema for a collection or global
735
+ * when no explicit `detail` configuration is provided.
736
+ */
737
+ declare function generateDefaultDetailSchema(schema: {
738
+ fields?: Field[];
739
+ labels?: {
740
+ singular?: string;
741
+ plural?: string;
742
+ };
743
+ label?: string;
744
+ slug?: string;
745
+ }): DetailSchema;
746
+ /**
747
+ * Evaluates whether a detail item should be visible based on its `options.visible` rule.
748
+ * Supports boolean values or JEXL expressions evaluated against `{ doc, user }`.
749
+ * Works consistently for top-level and nested detail items.
750
+ *
751
+ * @example
752
+ * ```ts
753
+ * isDetailItemVisible(displayField('secret', { visible: false }), doc, user) // false
754
+ * isDetailItemVisible(displayField('publishedAt', { visible: "doc.status == 'published'" }), doc, user)
755
+ * ```
756
+ */
757
+ declare function isDetailItemVisible(item: DetailItem, doc: any, user?: any): boolean;
758
+
596
759
  type TopLevelFieldName<TFields extends readonly Field[]> = Extract<TFields[number], {
597
760
  name: string;
598
761
  }>["name"];
@@ -1011,4 +1174,4 @@ declare function defineTab<const T extends readonly Field[]>(args: {
1011
1174
  fields: T;
1012
1175
  }): T;
1013
1176
 
1014
- export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, endsWith, executeFieldAfterRead, executeFieldBeforeChange, first, formatConfigDiagnostics, formatDate, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, normalizeConfig, now, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, startsWith, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, wordCount, workflowCapabilities };
1177
+ export { AccessPolicyResolver, AdminAuthConfig, ArrayField, AuthConfig, type AuthDocFields, AuthenticatedUser, BUILTIN_JEXL_HELPERS, BaseDocument, Block, BlocksField, BooleanField, CollectionConfig, ComputedHandler, type ConfigDiagnostic, ConfigValidationError, DateField, DateTimeField, type DeclarativeAccessSurface, type DeclarativeAccessValidationIssue, type DeclarativeAdminSurface, type DeclarativeAdminValidationIssue, DeclarativeHookExpression, type DeclarativeHookSurface, type DeclarativeHookValidationIssue, type DeclarativePreviewSurface, type DeclarativePreviewValidationIssue, DetailComputed, DetailComputedOptions, DetailCustom, DetailCustomOptions, DetailDivider, DetailDividerOptions, DetailField, DetailGrid, DetailGridOptions, DetailItem, DetailRepeat, DetailRepeatOptions, DetailSchema, DetailSection, DetailSectionOptions, DetailTab, DetailTabOptions, DetailTabs, DetailTabsOptions, DetailText, DetailTextOptions, DisplayFieldOptions, DyrectedConfig, EmailField, Field, GlobalConfig, HookRequestContext, IconField, ImageField, type InferDocShape, JoinField, JsonField, LIFECYCLE_EVENTS_COLLECTION, LifecycleEvent, LifecycleEventName, MultiSelectField, NumberField, ObjectField, type Prettify, PublicAdminAuthConfig, type PublishingWorkflowOptions, RadioField, RelationshipField, RichTextField, RowField, SelectField, type SortClause, type SortDirection, type SqlSortDialect, type SqlWhereResult, type SystemDocFields, TextField, TextareaField, TimeField, type UploadDocFields, UrlField, WORKFLOW_HISTORY_COLLECTION, type WhereClause, type WhereOperator, type WhereOperatorName, WorkflowConfig, WorkflowTransition, abs, addDays, assertValidAdminConditionsInConfig, assertValidDeclarativeAccessInConfig, assertValidDeclarativeHookExpression, assertValidDeclarativeHookResult, assertValidDeclarativeHooksInConfig, assertValidPreviewUrlsInConfig, availableWorkflowTransitions, buildSqlOrderBy, canViewWorkflowDraft, capitalize, ceil, clamp, coalesce, collectAdminConditionValidationIssues, collectConfigDiagnostics, collectDeclarativeAccessValidationIssues, collectDeclarativeHookValidationIssues, collectPreviewUrlValidationIssues, compact, count, createLifecycleEvent, createWorkflowDocument, defaultValue, defineArrayField, defineBlock, defineBlocksField, defineBooleanField, defineCollection, defineConfig, defineDateField, defineDateTimeField, defineEmailField, defineField, defineGlobal, defineIconField, defineImageField, defineJoinField, defineJsonField, defineMultiSelectField, defineNumberField, defineObjectField, definePublishingWorkflow, defineRadioField, defineRelationshipField, defineRichTextField, defineRowField, defineSelectField, defineTab, defineTextField, defineTextareaField, defineTimeField, defineUrlField, diffDays, dispatchLifecycleEvent, dispatchPendingLifecycleEvents, displayComputed, displayCustom, displayCustomComponent, displayDivider, displayField, displayGrid, displayRepeat, displaySection, displayTab, displayTabs, displayText, endsWith, evaluateDetailComputed, evaluateJexl, evaluateJexlSync, executeFieldAfterRead, executeFieldBeforeChange, first, floor, formatConfigDiagnostics, formatDate, generateDefaultDetailSchema, generateOpenApi, get, getAdminAuthCollection, getPublicAdminAuthConfig, includes, initializeWorkflowDocument, isConfigValidationError, isDetailItemVisible, isEmpty, isFuture, isPast, join, last, length, lower, materializeWorkflowDocument, max, min, normalizeConfig, normalizeDetailItem, now, numericFieldNames, parseMongoWhere, parseSort, parseSqlWhere, pow, publishedStateName, publishingWorkflow, readingTime, registerJexlHelpers, replace, resolveAdminAuthCollection, round, runCollectionHooks, saveWorkflowDraft, simplePublishingWorkflow, slugify, sqrt, startsWith, sum, today, transitionWorkflow, trim, truncate, unique, upper, validateAdminConditionExpression, validateDeclarativeAccessExpression, validateDeclarativeHookExpression, validatePreviewUrlExpression, wordCount, workflowCapabilities };
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  ConfigValidationError,
4
4
  LIFECYCLE_EVENTS_COLLECTION,
5
5
  WORKFLOW_HISTORY_COLLECTION,
6
+ abs,
6
7
  addDays,
7
8
  assertValidAdminConditionsInConfig,
8
9
  assertValidDeclarativeAccessInConfig,
@@ -13,6 +14,7 @@ import {
13
14
  availableWorkflowTransitions,
14
15
  canViewWorkflowDraft,
15
16
  capitalize,
17
+ ceil,
16
18
  clamp,
17
19
  coalesce,
18
20
  collectAdminConditionValidationIssues,
@@ -21,6 +23,7 @@ import {
21
23
  collectDeclarativeHookValidationIssues,
22
24
  collectPreviewUrlValidationIssues,
23
25
  compact,
26
+ count,
24
27
  createLifecycleEvent,
25
28
  createWorkflowDocument,
26
29
  defaultValue,
@@ -28,12 +31,28 @@ import {
28
31
  diffDays,
29
32
  dispatchLifecycleEvent,
30
33
  dispatchPendingLifecycleEvents,
34
+ displayComputed,
35
+ displayCustom,
36
+ displayCustomComponent,
37
+ displayDivider,
38
+ displayField,
39
+ displayGrid,
40
+ displayRepeat,
41
+ displaySection,
42
+ displayTab,
43
+ displayTabs,
44
+ displayText,
31
45
  endsWith,
46
+ evaluateDetailComputed,
47
+ evaluateJexl,
48
+ evaluateJexlSync,
32
49
  executeFieldAfterRead,
33
50
  executeFieldBeforeChange,
34
51
  first,
52
+ floor,
35
53
  formatConfigDiagnostics,
36
54
  formatDate,
55
+ generateDefaultDetailSchema,
37
56
  generateOpenApi,
38
57
  get,
39
58
  getAdminAuthCollection,
@@ -41,6 +60,7 @@ import {
41
60
  includes,
42
61
  initializeWorkflowDocument,
43
62
  isConfigValidationError,
63
+ isDetailItemVisible,
44
64
  isEmpty,
45
65
  isFuture,
46
66
  isPast,
@@ -49,8 +69,12 @@ import {
49
69
  length,
50
70
  lower,
51
71
  materializeWorkflowDocument,
72
+ max,
73
+ min,
52
74
  normalizeConfig,
75
+ normalizeDetailItem,
53
76
  now,
77
+ pow,
54
78
  publishedStateName,
55
79
  publishingWorkflow,
56
80
  readingTime,
@@ -62,7 +86,9 @@ import {
62
86
  saveWorkflowDraft,
63
87
  simplePublishingWorkflow,
64
88
  slugify,
89
+ sqrt,
65
90
  startsWith,
91
+ sum,
66
92
  today,
67
93
  transitionWorkflow,
68
94
  trim,
@@ -75,7 +101,7 @@ import {
75
101
  validatePreviewUrlExpression,
76
102
  wordCount,
77
103
  workflowCapabilities
78
- } from "./chunk-YSSHLGQ6.js";
104
+ } from "./chunk-GFFGDHST.js";
79
105
 
80
106
  // src/types/workflows.ts
81
107
  var LIFECYCLE_EVENT_NAMES = [
@@ -340,6 +366,7 @@ export {
340
366
  LIFECYCLE_EVENTS_COLLECTION,
341
367
  LIFECYCLE_EVENT_NAMES,
342
368
  WORKFLOW_HISTORY_COLLECTION,
369
+ abs,
343
370
  addDays,
344
371
  assertValidAdminConditionsInConfig,
345
372
  assertValidDeclarativeAccessInConfig,
@@ -351,6 +378,7 @@ export {
351
378
  buildSqlOrderBy,
352
379
  canViewWorkflowDraft,
353
380
  capitalize,
381
+ ceil,
354
382
  clamp,
355
383
  coalesce,
356
384
  collectAdminConditionValidationIssues,
@@ -359,6 +387,7 @@ export {
359
387
  collectDeclarativeHookValidationIssues,
360
388
  collectPreviewUrlValidationIssues,
361
389
  compact,
390
+ count,
362
391
  createLifecycleEvent,
363
392
  createWorkflowDocument,
364
393
  defaultValue,
@@ -394,12 +423,28 @@ export {
394
423
  diffDays,
395
424
  dispatchLifecycleEvent,
396
425
  dispatchPendingLifecycleEvents,
426
+ displayComputed,
427
+ displayCustom,
428
+ displayCustomComponent,
429
+ displayDivider,
430
+ displayField,
431
+ displayGrid,
432
+ displayRepeat,
433
+ displaySection,
434
+ displayTab,
435
+ displayTabs,
436
+ displayText,
397
437
  endsWith,
438
+ evaluateDetailComputed,
439
+ evaluateJexl,
440
+ evaluateJexlSync,
398
441
  executeFieldAfterRead,
399
442
  executeFieldBeforeChange,
400
443
  first,
444
+ floor,
401
445
  formatConfigDiagnostics,
402
446
  formatDate,
447
+ generateDefaultDetailSchema,
403
448
  generateOpenApi,
404
449
  get,
405
450
  getAdminAuthCollection,
@@ -407,6 +452,7 @@ export {
407
452
  includes,
408
453
  initializeWorkflowDocument,
409
454
  isConfigValidationError,
455
+ isDetailItemVisible,
410
456
  isEmpty,
411
457
  isFuture,
412
458
  isPast,
@@ -415,12 +461,16 @@ export {
415
461
  length,
416
462
  lower,
417
463
  materializeWorkflowDocument,
464
+ max,
465
+ min,
418
466
  normalizeConfig,
467
+ normalizeDetailItem,
419
468
  now,
420
469
  numericFieldNames,
421
470
  parseMongoWhere,
422
471
  parseSort,
423
472
  parseSqlWhere,
473
+ pow,
424
474
  publishedStateName,
425
475
  publishingWorkflow,
426
476
  readingTime,
@@ -432,7 +482,9 @@ export {
432
482
  saveWorkflowDraft,
433
483
  simplePublishingWorkflow,
434
484
  slugify,
485
+ sqrt,
435
486
  startsWith,
487
+ sum,
436
488
  today,
437
489
  transitionWorkflow,
438
490
  trim,