@wix/bex-core 2.412.0 → 2.413.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/cjs/model/setupWidget.js.map +1 -1
- package/dist/cjs/types/FieldsSource.js.map +1 -1
- package/dist/cjs/types/SchemaSource.js.map +1 -1
- package/dist/types/model/setupWidget.d.ts +19 -0
- package/dist/types/model/setupWidget.d.ts.map +1 -1
- package/dist/types/types/FieldsSource.d.ts +2 -1
- package/dist/types/types/FieldsSource.d.ts.map +1 -1
- package/dist/types/types/SchemaSource.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/model/setupWidget.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * Public data model for the Setup widget (\"Focus Widget\").\n *\n * The widget follows the \"pluggable adapter\" design (Option C): the consumer\n * supplies a promise-returning `fetchData`, and the widget owns loading / error\n * / refetch state itself. This keeps the data source swappable (Dealer-direct,\n * patterns-service, or a static fixture) behind a single component.\n */\n\n/**\n * Server/data-derived step state only. Which step is focused/expanded is\n * presentation state the widget derives itself (first upcoming, else first\n * actionable step) — the data never pins it, matching dashboard-setup.\n */\nexport type SetupWidgetStepStatus =\n | 'upcoming'\n | 'in-progress'\n | 'completed'\n | 'disabled';\n\n/**\n * An extra icon-only action on a step, shown next to its CTA (e.g. an AI\n * shortcut). Clicking it fires the widget's `onStepSecondaryClick`.\n */\nexport interface SetupWidgetStepSecondaryCta {\n /** Icon rendered inside the button — an icon element, e.g. `<AI />`. */\n icon: ReactNode;\n /**\n * Accessible name for the button. Required: the button renders an icon and\n * nothing else, so without it screen readers have no way to name the action.\n */\n ariaLabel: string;\n /** Tooltip shown on hover. */\n tooltip?: string;\n}\n\nexport interface SetupWidgetStep {\n /** Stable identifier, used as the React key and for inline-expansion toggling. */\n id: string;\n title: string;\n description?: string;\n /** Label for the step's call-to-action while it's still actionable. */\n ctaLabel?: string;\n /**\n * Label for the action shown on a *completed* step (e.g. \"View\", \"Manage\").\n * When set, the completed row stays actionable and clicking it fires\n * `onStepClick`. Mirrors `completedCta` in dashboard-setup. Omit to render a\n * completed step with no action (the default).\n */\n completedCtaLabel?: string;\n /**\n * Tooltip shown on a `disabled` step's CTA, explaining why it can't be acted\n * on. The only production use is permission-denied (e.g. sub-accounts that\n * lack access) — mirrors the permission tooltip in dashboard-setup. Falls\n * back to a generic \"you don't have access\" message when omitted.\n */\n disabledTooltip?: string;\n /**\n * Icon-only action rendered before the step's CTA on desktop rows — leaf\n * steps, aggregated group rows and their children alike. Mobile cards have no\n * per-step CTA and ignore it. Only offered while the step is still actionable:\n * a completed step drops it along with its CTA, and a group drops it once all\n * its children are done.\n */\n secondaryCta?: SetupWidgetStepSecondaryCta;\n status: SetupWidgetStepStatus;\n /**\n * What happens when the row is activated:\n * - `navigate` (default when omitted): fires the consumer's `onStepClick`\n * (e.g. opens settings or the editor).\n * - `inline`: toggles content in-card below the row (via the widget's\n * `renderStepContent`), then fires `onStepClick` with `details.expanded`\n * set to the new state.\n */\n expansionMode?: 'inline' | 'navigate';\n /**\n * Nested sub-steps for an *aggregated* group (e.g. \"Stores\", \"Bookings\").\n * When present, the step renders as a collapsible group row with an \"x/y\"\n * counter; expanding it reveals the sub-steps as sub-rows. Progress (the\n * header ratio / all-complete) counts the leaves, not the group row.\n * Sub-steps should be leaf steps (`navigate` / completed) — nested inline\n * expansion is not supported. Mirrors `aggregated.steps` in dashboard-setup.\n */\n steps?: SetupWidgetStep[];\n}\n\n/** Resolved by the consumer's `fetchData`. */\nexport interface SetupWidgetData {\n /** Overrides the default \"Setup\" widget title. */\n title?: string;\n /** Ordered list of steps. Each carries its own status. */\n steps: SetupWidgetStep[];\n}\n\n/** Config shape shared by the state class and the component props. */\nexport interface SetupWidgetConfig {\n /** Consumer resolves the data; the widget owns loading / error / refetch. */\n fetchData: () => Promise<SetupWidgetData>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/model/setupWidget.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\n/**\n * Public data model for the Setup widget (\"Focus Widget\").\n *\n * The widget follows the \"pluggable adapter\" design (Option C): the consumer\n * supplies a promise-returning `fetchData`, and the widget owns loading / error\n * / refetch state itself. This keeps the data source swappable (Dealer-direct,\n * patterns-service, or a static fixture) behind a single component.\n */\n\n/**\n * Server/data-derived step state only. Which step is focused/expanded is\n * presentation state the widget derives itself (first upcoming, else first\n * actionable step) — the data never pins it, matching dashboard-setup.\n */\nexport type SetupWidgetStepStatus =\n | 'upcoming'\n | 'in-progress'\n | 'completed'\n | 'disabled';\n\n/**\n * An extra icon-only action on a step, shown next to its CTA (e.g. an AI\n * shortcut). Clicking it fires the widget's `onStepSecondaryClick`.\n */\nexport interface SetupWidgetStepSecondaryCta {\n /** Icon rendered inside the button — an icon element, e.g. `<AI />`. */\n icon: ReactNode;\n /**\n * Accessible name for the button. Required: the button renders an icon and\n * nothing else, so without it screen readers have no way to name the action.\n */\n ariaLabel: string;\n /** Tooltip shown on hover. */\n tooltip?: string;\n}\n\n/**\n * A close button in the step's top-right corner. Clicking it fires the\n * widget's `onStepClose`.\n */\nexport interface SetupWidgetStepCloseButton {\n /** Tooltip shown on hover. */\n tooltip: string;\n /**\n * Accessible name for the button. Required: the button renders an icon and\n * nothing else. Include the step name so it is unique on the page.\n */\n ariaLabel: string;\n}\n\nexport interface SetupWidgetStep {\n /** Stable identifier, used as the React key and for inline-expansion toggling. */\n id: string;\n title: string;\n description?: string;\n /** Label for the step's call-to-action while it's still actionable. */\n ctaLabel?: string;\n /**\n * Label for the action shown on a *completed* step (e.g. \"View\", \"Manage\").\n * When set, the completed row stays actionable and clicking it fires\n * `onStepClick`. Mirrors `completedCta` in dashboard-setup. Omit to render a\n * completed step with no action (the default).\n */\n completedCtaLabel?: string;\n /**\n * Tooltip shown on a `disabled` step's CTA, explaining why it can't be acted\n * on. The only production use is permission-denied (e.g. sub-accounts that\n * lack access) — mirrors the permission tooltip in dashboard-setup. Falls\n * back to a generic \"you don't have access\" message when omitted.\n */\n disabledTooltip?: string;\n /**\n * Icon-only action rendered before the step's CTA on desktop rows — leaf\n * steps, aggregated group rows and their children alike. Mobile cards have no\n * per-step CTA and ignore it. Only offered while the step is still actionable:\n * a completed step drops it along with its CTA, and a group drops it once all\n * its children are done.\n */\n secondaryCta?: SetupWidgetStepSecondaryCta;\n /**\n * Close button in the step's top-right corner, on desktop rows, mobile cards,\n * aggregated group rows and their children. Set it only on the steps that\n * should have one. It renders only when the widget also gets `onStepClose`.\n */\n closeButton?: SetupWidgetStepCloseButton;\n status: SetupWidgetStepStatus;\n /**\n * What happens when the row is activated:\n * - `navigate` (default when omitted): fires the consumer's `onStepClick`\n * (e.g. opens settings or the editor).\n * - `inline`: toggles content in-card below the row (via the widget's\n * `renderStepContent`), then fires `onStepClick` with `details.expanded`\n * set to the new state.\n */\n expansionMode?: 'inline' | 'navigate';\n /**\n * Nested sub-steps for an *aggregated* group (e.g. \"Stores\", \"Bookings\").\n * When present, the step renders as a collapsible group row with an \"x/y\"\n * counter; expanding it reveals the sub-steps as sub-rows. Progress (the\n * header ratio / all-complete) counts the leaves, not the group row.\n * Sub-steps should be leaf steps (`navigate` / completed) — nested inline\n * expansion is not supported. Mirrors `aggregated.steps` in dashboard-setup.\n */\n steps?: SetupWidgetStep[];\n}\n\n/** Resolved by the consumer's `fetchData`. */\nexport interface SetupWidgetData {\n /** Overrides the default \"Setup\" widget title. */\n title?: string;\n /** Ordered list of steps. Each carries its own status. */\n steps: SetupWidgetStep[];\n}\n\n/** Config shape shared by the state class and the component props. */\nexport interface SetupWidgetConfig {\n /** Consumer resolves the data; the widget owns loading / error / refetch. */\n fetchData: () => Promise<SetupWidgetData>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/FieldsSource.ts"],"sourcesContent":["import type { ComponentType } from 'react';\nimport type { Field, PatternsFieldType } from './Field';\nimport type { FieldActions, FieldSettings, Schema } from './Schema';\nimport type {\n FieldTypeDefinition,\n FieldTypeDisplay,\n} from './FieldTypeDefinition';\nimport type { CustomFieldOrigin } from '../services';\n\n/** Presentation for one existing field, without changing its type or behavior. */\nexport interface FieldPresentation {\n typeDisplay?: Partial<FieldTypeDisplay>;\n collectionInputLabel?: string;\n /** Starts the table column hidden; users can show it in the column picker. */\n defaultHidden?: boolean;\n}\n\n/** A field the source has archived. Sources without archiving omit `archive`. */\nexport interface ArchivedFieldItem {\n id: string;\n label: string;\n isPii?: boolean;\n}\n\n/** A `FieldTypeOption` the modal can render: the id and label a source left to\n * the defaults are filled in. */\nexport interface ResolvedFieldTypeOption {\n /** Stored on the draft; the source maps it back to its native type. */\n id: string;\n label: string;\n namePlaceholder?: string;\n /** Fallback field ID base when the name cannot produce a valid ID.\n * Default: the normalized type ID. Numeric suffixes resolve collisions. */\n keyBase?: string;\n subtitle?: string;\n /** Group heading in the type list; types sharing a heading form one group. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide `supportsPii`. */\n supportsPii?: boolean;\n /** Warning to show while the PII toggle is on. Called on every render.\n * Absent ⇒ none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section below the main fields.\n * Absent ⇒ the section holds only what the modal itself puts there. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown below the type picker. For built-in reference\n * types, absent copy can use the source's referenceable collection loader. */\n collectionInput?: FieldModalCollectionInput;\n /** Drives the type icon in the modal. */\n patternsType: PatternsFieldType;\n /** Type icons for the picker. Absent ⇒ the icon derives from `patternsType`. */\n icons?: { Small: ComponentType; Medium: ComponentType };\n}\n\n/** Read/write permission defaults a source supports, per audience. */\nexport interface FieldPermissions {\n installedApps?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n siteVisitors?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n}\n\n/** The values the add/edit field modal collects, source-neutral. */\nexport interface FieldDraft {\n type?: string;\n key: string;\n name: string;\n readApps: boolean;\n readUsers: boolean;\n writeApps: boolean;\n writeUsers: boolean;\n containsPii: boolean;\n /** Collection selected by the modal's collection picker, when a type has one. */\n referencedCollectionId?: string;\n /** The field this draft was built from, for the source's settings section to\n * read its own values off. Absent for a new field. */\n field?: Field;\n /** What the source's settings section collected, on its way to that source's\n * `addField`/`editField`. */\n settings?: FieldSettings;\n}\n\n/** The add-modal subtitle: a line of text, an optional second note line, and an\n * optional \"learn more\" link. */\nexport interface FieldModalSubtitle {\n text: string;\n note?: string;\n learnMore?: { label: string; href: string };\n}\n\n/** The text a source supplies for the add/edit field modal. */\nexport interface FieldModalText {\n addTitle: string;\n editTitle: string;\n /** Subtitle for the add modal; omit for none. */\n addSubtitle?: FieldModalSubtitle;\n /** Label of the collapsible section below the main fields. */\n settingsLabel?: string;\n /** Label of the field ID input. Absent ⇒ the standard key label. */\n keyLabel?: string;\n}\n\n/** A warning shown under the PII toggle, with an optional action button. */\nexport interface FieldPiiWarning {\n text: string;\n action?: { label: string; onClick: () => void };\n}\n\nexport interface FieldModalCollectionOption {\n id: string;\n label: string;\n}\n\nexport interface FieldModalCollectionGroup {\n heading: string;\n options: FieldModalCollectionEntry[];\n}\n\nexport type FieldModalCollectionEntry =\n | FieldModalCollectionOption\n | FieldModalCollectionGroup;\n\nexport type FieldModalCollectionOptionsLoader = () => Promise<\n FieldModalCollectionEntry[]\n>;\n\nexport interface FieldModalCollectionAction {\n label: string;\n icon?: ComponentType;\n disabled?: boolean;\n /** Return an option to select, or undefined on cancellation. The option may\n * be pending creation; persistence remains the source's responsibility. */\n onClick: () => Promise<FieldModalCollectionOption | undefined>;\n}\n\n/** Extra collection picker a field type can add to the main modal body. */\nexport interface FieldModalCollectionInput {\n label?: string;\n placeholder?: string;\n emptyStateMessage?: string;\n errorMessage?: string;\n required?: boolean;\n loadOptions?: FieldModalCollectionOptionsLoader;\n /** An action below the options, also shown when no options match. */\n dropdownAction?: FieldModalCollectionAction;\n /** Restores the picker value from an existing field. */\n getValue?: (field: Field) => string | undefined;\n /** Adds picker-derived values to the source-owned settings payload. */\n getSettings?: (collectionId: string) => FieldSettings;\n}\n\nexport interface FieldSettingsProps {\n /** The picked field type, or absent before one is picked. */\n fieldType?: string;\n /** Validation rules the section should render as fixed, not user-editable.\n * A section ignores any entry it doesn't recognize. */\n lockedRules?: readonly string[];\n /** When false, hide error styling and messages.\n * `hasError` must still report validity. Omit to show errors immediately. */\n showValidationErrors?: boolean;\n}\n\n/**\n * The collapsible section below the main add/edit field inputs, supplied by the\n * source. The modal renders it, blocks confirm while it has an error, and hands\n * its values to the source's own `addField`/`editField` — it never looks inside.\n */\nexport interface FieldSettingsSection {\n Component: ComponentType<FieldSettingsProps>;\n /** Pure validity check: true blocks confirm even while errors are hidden.\n * The section shows errors according to `showValidationErrors`. */\n hasError(fieldType?: string): boolean;\n /** Passed to the source's field-creation or editing action as-is. */\n getValues(fieldType?: string): FieldSettings;\n /**\n * Fills the inputs when the modal opens: the field being edited, or nothing\n * for a new field. Pushed in rather than read from a prop, so the values are\n * there whether or not the section has been rendered yet.\n */\n setValues(field?: Field): void;\n /** Restores settings saved on a pending new-field draft. */\n setDraftValues?(settings: FieldSettings): void;\n /**\n * Prefills a new field's rules from the caller's requested initial values —\n * there is no backing `Field` yet, so this is separate from `setValues`.\n * Absent ⇒ the section doesn't support prefilling any rule this way, and\n * the modal drops that rule from `lockedProperties` rather than locking a\n * control at a value it could never actually apply.\n */\n setInitialValues?(initial: { required?: boolean }): void;\n}\n\n/** Add/edit/delete capability a source exposes. Present ⇒ field management UI shows. */\nexport interface FieldManagement {\n /** False ⇒ the add-field CTA is hidden entirely. */\n canAddFields: boolean;\n /** True ⇒ the add-field CTA renders but is disabled. */\n addFieldDisabled: boolean;\n /** Hint text shown beneath the add-field CTA while it is disabled. */\n addFieldDisabledHint?: string;\n canEditField(field: Field): boolean;\n /** Allows changing PII on an existing supported field. Default: disabled. */\n canEditFieldPii?(field: Field): boolean;\n /** `origin` is the UI surface the delete was triggered from; used for BI. */\n deleteField(fieldId: string, origin: string): Promise<void>;\n\n /** Everything the add/edit field modal shows: its titles, and the field types\n * it offers with what each one brings to it. */\n fieldModal: {\n /** Whether to show the field ID input. Default: true. */\n showFieldId?: boolean;\n text: FieldModalText;\n /** Default option loader for built-in reference and multi-reference types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: ResolvedFieldTypeOption[];\n /** Metadata for an existing type that is absent from the add-field picker. */\n getEditFieldType?: (type: string) => ResolvedFieldTypeOption | undefined;\n /** Defaults for the read/write permissions per audience. Absent ⇒ the modal\n * shows no permissions section. */\n permissions?: FieldPermissions;\n /** Whether a field can be marked PII. A field type option overrides it with\n * its own `supportsPii`. */\n supportsPii?: boolean;\n };\n /** Existing field keys, used by the add modal to reject duplicates. */\n existingFieldKeys: string[];\n /** True when no more fields can be added because a limit is reached. */\n maxReached?: boolean;\n /** Returns the created field's id when the source can identify it, so the\n * modal can report it back to the caller. Absent ⇒ the caller isn't told\n * which field was created. */\n addField(draft: FieldDraft): Promise<string | void>;\n editField(fieldId: string, draft: FieldDraft): Promise<void>;\n /** Current values for an existing field, to prefill the edit modal. */\n getFieldDraft(fieldId: string): FieldDraft | undefined;\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n}\n\n/** A field-modal property that can be locked from editing. */\nexport type LockableFieldProperty = 'type' | 'name' | 'required';\n\n/** Options for opening the add/edit field modal. */\nexport interface OpenFieldModalOptions {\n fieldId?: string;\n origin?: CustomFieldOrigin;\n customOrigin?: string;\n /** Fired with the field's id after it's successfully created or edited.\n * Not called for a create when the source can't report which field it\n * created. */\n onSave?: (fieldId: string) => void;\n /** Prefills a new field. Ignored when `fieldId` is set — edit mode prefills\n * from the existing field instead. */\n initialField?: {\n /** Prefilled; locked when included in `lockedProperties`. */\n type?: string;\n /** Prefilled; locked when included in `lockedProperties`. */\n name?: string;\n /** Prefilled; locked when included in `lockedProperties`. Support depends\n * on the picked type's settings section — see `FieldSettingsSection.setInitialValues`. */\n required?: boolean;\n };\n /** Properties the user can't change, on top of being prefilled. A property\n * with no matching `initialField` value is never locked — there is nothing\n * to lock it to. */\n lockedProperties?: readonly LockableFieldProperty[];\n}\n\n/** Archiving capability a source exposes. Present ⇒ archive/restore UI shows. */\nexport interface FieldArchive {\n items: ArchivedFieldItem[];\n shouldDisplay: boolean;\n /** Whether the archived-items panel is currently open. */\n isOpen: boolean;\n openPanel(): void;\n closePanel(): void;\n /** `origin` is the UI surface the action was triggered from; used for BI. */\n archiveField(fieldId: string, origin: string): Promise<void>;\n restoreField(fieldId: string, origin: string): Promise<void>;\n /** Display name for a field, for the confirm-dialog copy. */\n fieldName(fieldId: string): string;\n}\n\n/**\n * The source-neutral fields data a collection reads, implemented by each source\n * adapter. Rendering — field modals, filter elements — is not here; it lives in\n * the collection-page layer.\n */\nexport interface FieldsSource {\n /** Loads the fields (schema/data). The collection runs this once, tracks its\n * status, and shows a retry toast on failure. */\n load(): Promise<void>;\n\n fields: Field[];\n filterableFields: Field[];\n /** The fields the manage-fields panel lists — the source's editable fields. */\n manageableFields: Field[];\n /** Column id for a field. Sources that group fields prefix the group; flat sources use the field key. */\n columnIdForField(field: Field): string;\n /** WQL field path for a filter. Sources that group fields prefix the group; flat sources use the field key. */\n queryFieldId(field: Field): string;\n /** The value to display for a field on a row. */\n getCellValue(row: unknown, field: Field): unknown;\n /** Writes a new value for a field on a row, returning the updated row. Present when cells can be edited in place. */\n setCellValue?(row: unknown, field: Field, value: unknown): unknown;\n\n /** Replaces the source's fields with a freshly-returned map, updating the\n * columns with no refetch. Present when the source holds its fields in a\n * mergeable state (e.g. a loaded schema); used after an import creates fields. */\n mergeFields?(fields: Schema['fields']): void;\n\n /** Field-type definitions the source supports: how a field of that type\n * renders, filters and validates. Built-in types are keyed by their\n * `PatternsFieldType`; consumer-defined types are keyed by the string a field\n * references via `customType`. The add/edit field modal never reads this —\n * see `FieldManagement.fieldModal`. */\n fieldTypes?: FieldTypeDefinition[];\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n\n /** Present when fields can be added/edited/deleted. */\n fieldManagement?: FieldManagement;\n\n /** The collection's field-mutation actions (delete/makePrimary/duplicate/…),\n * driving the shared FieldActions menu. Absent ⇒ no per-field action menu. */\n fieldActions?: FieldActions;\n\n /** Present when the source supports archiving fields. */\n archive?: FieldArchive;\n\n /** Present when fields are grouped. Absent ⇒ flat list. */\n groups?: {\n all: string[];\n fieldsForGroup(group: string): Field[];\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/FieldsSource.ts"],"sourcesContent":["import type { ComponentType } from 'react';\nimport type { Field, PatternsFieldType } from './Field';\nimport type { FieldActions, FieldSettings, Schema } from './Schema';\nimport type {\n FieldTypeDefinition,\n FieldTypeDisplay,\n} from './FieldTypeDefinition';\nimport type { CustomFieldOrigin } from '../services';\n\n/** Presentation for one existing field, without changing its type or behavior. */\nexport interface FieldPresentation {\n typeDisplay?: Partial<FieldTypeDisplay>;\n collectionInputLabel?: string;\n /** Starts the field hidden in tables and entity-page field cards; users can\n * show it in field management. */\n defaultHidden?: boolean;\n}\n\n/** A field the source has archived. Sources without archiving omit `archive`. */\nexport interface ArchivedFieldItem {\n id: string;\n label: string;\n isPii?: boolean;\n}\n\n/** A `FieldTypeOption` the modal can render: the id and label a source left to\n * the defaults are filled in. */\nexport interface ResolvedFieldTypeOption {\n /** Stored on the draft; the source maps it back to its native type. */\n id: string;\n label: string;\n namePlaceholder?: string;\n /** Fallback field ID base when the name cannot produce a valid ID.\n * Default: the normalized type ID. Numeric suffixes resolve collisions. */\n keyBase?: string;\n subtitle?: string;\n /** Group heading in the type list; types sharing a heading form one group. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source-wide `supportsPii`. */\n supportsPii?: boolean;\n /** Warning to show while the PII toggle is on. Called on every render.\n * Absent ⇒ none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section below the main fields.\n * Absent ⇒ the section holds only what the modal itself puts there. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown below the type picker. For built-in reference\n * types, absent copy can use the source's referenceable collection loader. */\n collectionInput?: FieldModalCollectionInput;\n /** Drives the type icon in the modal. */\n patternsType: PatternsFieldType;\n /** Type icons for the picker. Absent ⇒ the icon derives from `patternsType`. */\n icons?: { Small: ComponentType; Medium: ComponentType };\n}\n\n/** Read/write permission defaults a source supports, per audience. */\nexport interface FieldPermissions {\n installedApps?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n siteVisitors?: {\n hide?: boolean;\n defaultRead?: boolean;\n defaultWrite?: boolean;\n };\n}\n\n/** The values the add/edit field modal collects, source-neutral. */\nexport interface FieldDraft {\n type?: string;\n key: string;\n name: string;\n readApps: boolean;\n readUsers: boolean;\n writeApps: boolean;\n writeUsers: boolean;\n containsPii: boolean;\n /** Collection selected by the modal's collection picker, when a type has one. */\n referencedCollectionId?: string;\n /** The field this draft was built from, for the source's settings section to\n * read its own values off. Absent for a new field. */\n field?: Field;\n /** What the source's settings section collected, on its way to that source's\n * `addField`/`editField`. */\n settings?: FieldSettings;\n}\n\n/** The add-modal subtitle: a line of text, an optional second note line, and an\n * optional \"learn more\" link. */\nexport interface FieldModalSubtitle {\n text: string;\n note?: string;\n learnMore?: { label: string; href: string };\n}\n\n/** The text a source supplies for the add/edit field modal. */\nexport interface FieldModalText {\n addTitle: string;\n editTitle: string;\n /** Subtitle for the add modal; omit for none. */\n addSubtitle?: FieldModalSubtitle;\n /** Label of the collapsible section below the main fields. */\n settingsLabel?: string;\n /** Label of the field ID input. Absent ⇒ the standard key label. */\n keyLabel?: string;\n}\n\n/** A warning shown under the PII toggle, with an optional action button. */\nexport interface FieldPiiWarning {\n text: string;\n action?: { label: string; onClick: () => void };\n}\n\nexport interface FieldModalCollectionOption {\n id: string;\n label: string;\n}\n\nexport interface FieldModalCollectionGroup {\n heading: string;\n options: FieldModalCollectionEntry[];\n}\n\nexport type FieldModalCollectionEntry =\n | FieldModalCollectionOption\n | FieldModalCollectionGroup;\n\nexport type FieldModalCollectionOptionsLoader = () => Promise<\n FieldModalCollectionEntry[]\n>;\n\nexport interface FieldModalCollectionAction {\n label: string;\n icon?: ComponentType;\n disabled?: boolean;\n /** Return an option to select, or undefined on cancellation. The option may\n * be pending creation; persistence remains the source's responsibility. */\n onClick: () => Promise<FieldModalCollectionOption | undefined>;\n}\n\n/** Extra collection picker a field type can add to the main modal body. */\nexport interface FieldModalCollectionInput {\n label?: string;\n placeholder?: string;\n emptyStateMessage?: string;\n errorMessage?: string;\n required?: boolean;\n loadOptions?: FieldModalCollectionOptionsLoader;\n /** An action below the options, also shown when no options match. */\n dropdownAction?: FieldModalCollectionAction;\n /** Restores the picker value from an existing field. */\n getValue?: (field: Field) => string | undefined;\n /** Adds picker-derived values to the source-owned settings payload. */\n getSettings?: (collectionId: string) => FieldSettings;\n}\n\nexport interface FieldSettingsProps {\n /** The picked field type, or absent before one is picked. */\n fieldType?: string;\n /** Validation rules the section should render as fixed, not user-editable.\n * A section ignores any entry it doesn't recognize. */\n lockedRules?: readonly string[];\n /** When false, hide error styling and messages.\n * `hasError` must still report validity. Omit to show errors immediately. */\n showValidationErrors?: boolean;\n}\n\n/**\n * The collapsible section below the main add/edit field inputs, supplied by the\n * source. The modal renders it, blocks confirm while it has an error, and hands\n * its values to the source's own `addField`/`editField` — it never looks inside.\n */\nexport interface FieldSettingsSection {\n Component: ComponentType<FieldSettingsProps>;\n /** Pure validity check: true blocks confirm even while errors are hidden.\n * The section shows errors according to `showValidationErrors`. */\n hasError(fieldType?: string): boolean;\n /** Passed to the source's field-creation or editing action as-is. */\n getValues(fieldType?: string): FieldSettings;\n /**\n * Fills the inputs when the modal opens: the field being edited, or nothing\n * for a new field. Pushed in rather than read from a prop, so the values are\n * there whether or not the section has been rendered yet.\n */\n setValues(field?: Field): void;\n /** Restores settings saved on a pending new-field draft. */\n setDraftValues?(settings: FieldSettings): void;\n /**\n * Prefills a new field's rules from the caller's requested initial values —\n * there is no backing `Field` yet, so this is separate from `setValues`.\n * Absent ⇒ the section doesn't support prefilling any rule this way, and\n * the modal drops that rule from `lockedProperties` rather than locking a\n * control at a value it could never actually apply.\n */\n setInitialValues?(initial: { required?: boolean }): void;\n}\n\n/** Add/edit/delete capability a source exposes. Present ⇒ field management UI shows. */\nexport interface FieldManagement {\n /** False ⇒ the add-field CTA is hidden entirely. */\n canAddFields: boolean;\n /** True ⇒ the add-field CTA renders but is disabled. */\n addFieldDisabled: boolean;\n /** Hint text shown beneath the add-field CTA while it is disabled. */\n addFieldDisabledHint?: string;\n canEditField(field: Field): boolean;\n /** Allows changing PII on an existing supported field. Default: disabled. */\n canEditFieldPii?(field: Field): boolean;\n /** `origin` is the UI surface the delete was triggered from; used for BI. */\n deleteField(fieldId: string, origin: string): Promise<void>;\n\n /** Everything the add/edit field modal shows: its titles, and the field types\n * it offers with what each one brings to it. */\n fieldModal: {\n /** Whether to show the field ID input. Default: true. */\n showFieldId?: boolean;\n text: FieldModalText;\n /** Default option loader for built-in reference and multi-reference types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: ResolvedFieldTypeOption[];\n /** Metadata for an existing type that is absent from the add-field picker. */\n getEditFieldType?: (type: string) => ResolvedFieldTypeOption | undefined;\n /** Defaults for the read/write permissions per audience. Absent ⇒ the modal\n * shows no permissions section. */\n permissions?: FieldPermissions;\n /** Whether a field can be marked PII. A field type option overrides it with\n * its own `supportsPii`. */\n supportsPii?: boolean;\n };\n /** Existing field keys, used by the add modal to reject duplicates. */\n existingFieldKeys: string[];\n /** True when no more fields can be added because a limit is reached. */\n maxReached?: boolean;\n /** Returns the created field's id when the source can identify it, so the\n * modal can report it back to the caller. Absent ⇒ the caller isn't told\n * which field was created. */\n addField(draft: FieldDraft): Promise<string | void>;\n editField(fieldId: string, draft: FieldDraft): Promise<void>;\n /** Current values for an existing field, to prefill the edit modal. */\n getFieldDraft(fieldId: string): FieldDraft | undefined;\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n}\n\n/** A field-modal property that can be locked from editing. */\nexport type LockableFieldProperty = 'type' | 'name' | 'required';\n\n/** Options for opening the add/edit field modal. */\nexport interface OpenFieldModalOptions {\n fieldId?: string;\n origin?: CustomFieldOrigin;\n customOrigin?: string;\n /** Fired with the field's id after it's successfully created or edited.\n * Not called for a create when the source can't report which field it\n * created. */\n onSave?: (fieldId: string) => void;\n /** Prefills a new field. Ignored when `fieldId` is set — edit mode prefills\n * from the existing field instead. */\n initialField?: {\n /** Prefilled; locked when included in `lockedProperties`. */\n type?: string;\n /** Prefilled; locked when included in `lockedProperties`. */\n name?: string;\n /** Prefilled; locked when included in `lockedProperties`. Support depends\n * on the picked type's settings section — see `FieldSettingsSection.setInitialValues`. */\n required?: boolean;\n };\n /** Properties the user can't change, on top of being prefilled. A property\n * with no matching `initialField` value is never locked — there is nothing\n * to lock it to. */\n lockedProperties?: readonly LockableFieldProperty[];\n}\n\n/** Archiving capability a source exposes. Present ⇒ archive/restore UI shows. */\nexport interface FieldArchive {\n items: ArchivedFieldItem[];\n shouldDisplay: boolean;\n /** Whether the archived-items panel is currently open. */\n isOpen: boolean;\n openPanel(): void;\n closePanel(): void;\n /** `origin` is the UI surface the action was triggered from; used for BI. */\n archiveField(fieldId: string, origin: string): Promise<void>;\n restoreField(fieldId: string, origin: string): Promise<void>;\n /** Display name for a field, for the confirm-dialog copy. */\n fieldName(fieldId: string): string;\n}\n\n/**\n * The source-neutral fields data a collection reads, implemented by each source\n * adapter. Rendering — field modals, filter elements — is not here; it lives in\n * the collection-page layer.\n */\nexport interface FieldsSource {\n /** Loads the fields (schema/data). The collection runs this once, tracks its\n * status, and shows a retry toast on failure. */\n load(): Promise<void>;\n\n fields: Field[];\n filterableFields: Field[];\n /** The fields the manage-fields panel lists — the source's editable fields. */\n manageableFields: Field[];\n /** Column id for a field. Sources that group fields prefix the group; flat sources use the field key. */\n columnIdForField(field: Field): string;\n /** WQL field path for a filter. Sources that group fields prefix the group; flat sources use the field key. */\n queryFieldId(field: Field): string;\n /** The value to display for a field on a row. */\n getCellValue(row: unknown, field: Field): unknown;\n /** Writes a new value for a field on a row, returning the updated row. Present when cells can be edited in place. */\n setCellValue?(row: unknown, field: Field, value: unknown): unknown;\n\n /** Replaces the source's fields with a freshly-returned map, updating the\n * columns with no refetch. Present when the source holds its fields in a\n * mergeable state (e.g. a loaded schema); used after an import creates fields. */\n mergeFields?(fields: Schema['fields']): void;\n\n /** Field-type definitions the source supports: how a field of that type\n * renders, filters and validates. Built-in types are keyed by their\n * `PatternsFieldType`; consumer-defined types are keyed by the string a field\n * references via `customType`. The add/edit field modal never reads this —\n * see `FieldManagement.fieldModal`. */\n fieldTypes?: FieldTypeDefinition[];\n getFieldPresentation?(field: Field): FieldPresentation | undefined;\n\n /** Present when fields can be added/edited/deleted. */\n fieldManagement?: FieldManagement;\n\n /** The collection's field-mutation actions (delete/makePrimary/duplicate/…),\n * driving the shared FieldActions menu. Absent ⇒ no per-field action menu. */\n fieldActions?: FieldActions;\n\n /** Present when the source supports archiving fields. */\n archive?: FieldArchive;\n\n /** Present when fields are grouped. Absent ⇒ flat list. */\n groups?: {\n all: string[];\n fieldsForGroup(group: string): Field[];\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sourceFetchData","source","query","backend","schema","loadSchema","visibleColumns","columns","find","searchableFieldIds","length","defineSchemaSource","input","collectionId","paginationMode","fieldModal","fieldTypes","fieldPermissions","supportsPii","references","getReferencedCollectionSource","loaded","resolved","then","result","catch","error","undefined","setLoadedSchema","Promise","resolve","s","displayField","itemKey","item","_resolved","String","idField","itemName","_resolved2","canAddFields","_s$schemaPermissions","schemaPermissions","createField","isLockedField","field","isSystem","id","canEditField","_s$schemaPermissions2","updateField","canDeleteField","_s$schemaPermissions3","deleteField","getFieldValue","setFieldValue","value","schemaParams","_resolved3","_resolved4","_resolved5","tableId","tableName","name","tableType","type","showFieldId","text","loadReferenceableCollectionOptions","types","getFieldPresentation","getFieldActionDisabledReason","canMakePrimary","getDeleteFieldConfirmation","canEditFieldPii"],"sources":["../../../src/types/SchemaSource.ts"],"sourcesContent":["import type { Field, PatternsFieldType } from './Field';\nimport type { FieldTypeDefinition } from './FieldTypeDefinition';\nimport type { Schema, LoadedSchema, FindOptions } from './Schema';\nimport type {\n FieldPresentation,\n FieldModalText,\n FieldModalCollectionInput,\n FieldModalCollectionOptionsLoader,\n FieldPermissions,\n FieldPiiWarning,\n FieldSettingsSection,\n} from './FieldsSource';\nimport type {\n OffsetQuery,\n OffsetQueryResult,\n} from '../hooks/paginationModeConfig';\n\n/** A field type the add/edit field modal offers, with everything that type\n * brings to it. Declare one entry per `patternsType` — the type is the entry's\n * identity. Nothing here reaches the table or the filters; that is `fieldTypes`\n * (`FieldTypeDefinition[]`). */\nexport interface FieldTypeOption {\n patternsType: PatternsFieldType;\n /** Custom display name. Absent ⇒ the UI's standard name for this type. */\n label?: string;\n /** Custom name-input placeholder. Absent ⇒ the UI's standard placeholder. */\n namePlaceholder?: string;\n /** Fallback field ID base when the name cannot produce a valid ID.\n * Default: the normalized type ID. Numeric suffixes resolve collisions. */\n keyBase?: string;\n /** A one-line description shown under the type in the add-field menu. */\n subtitle?: string;\n /** The group heading this type is listed under in the add-field menu, in\n * first-seen order. Types sharing a heading form one group. Absent ⇒\n * ungrouped. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source's `supportsPii`. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section in the add/edit field\n * modal. Default: none. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown in the main add/edit field form. */\n collectionInput?: FieldModalCollectionInput;\n}\n\n/** Everything the add/edit field modal shows for this source. */\nexport interface FieldModalInput {\n /** Whether to show the field ID input. Default: true. */\n showFieldId?: boolean;\n /** Title and subtitle. Default: generic titles. */\n text?: FieldModalText;\n /** Default option loader for reference-like built-in field types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n /** The types the modal offers, in display order. Default: none. */\n types?: FieldTypeOption[];\n}\n\n/** Copy shown before deleting a field. Strings are translated by the caller. */\nexport interface DeleteFieldConfirmation {\n title: string;\n description: string;\n /** When provided, confirmation requires this checkbox to be checked. */\n confirmationCheckboxLabel?: string;\n}\n\n/** Identifies the collection behind a table on BI events. */\nexport interface SchemaBiParams {\n tableId?: string;\n tableName?: string;\n tableType?: string;\n}\n\n/** What a caller passes. Only `collectionId` and `loadSchema` are required. */\nexport interface SchemaSourceInput<T> {\n collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n /** Sources for collections this one references, keyed by the referenced\n * collection id. A renderer resolves a reference field through the matching\n * entry — its `loadSchema` gives the referenced schema and `sourceFetchData`\n * queries the referenced items. Default: none. */\n references?: Record<string, SchemaSource<any>>;\n /** Lazy source lookup for a referenced collection that is not in `references`.\n * Is used when a reference field is created in the add field modal.\n * The returned source owns its own async schema/item loading. */\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n paginationMode?: 'offset';\n /** Stable row identity. Default: `row[idField]`. */\n itemKey?: (item: T) => string;\n /** Row display label. Default: `row[displayField]`. */\n itemName?: (item: T) => string;\n /** Fields free-text search runs against. Default: `[displayField]`. */\n searchableFieldIds?: (schema: Schema) => string[];\n /** What the add/edit field modal shows. Default: no types, generic titles. */\n fieldModal?: FieldModalInput;\n /** Consumer-defined field types: how a field of that type renders, filters and\n * validates wherever it appears. A field with `type: 'CUSTOM'` resolves its\n * definition here by `customType`. The add/edit field modal never reads this\n * — see `fieldModal`. Default: none. */\n fieldTypes?: FieldTypeDefinition[];\n /** Overrides one existing field's type label, icons, collection-picker label\n * and initial column visibility. Does not change its type, values or\n * add-field options. */\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n /** Default: `schemaPermissions.createField`. */\n canAddFields?: (schema: Schema) => boolean;\n /** Default: `schemaPermissions.updateField`, except for system fields and\n * the id field. */\n canEditField?: (field: Field, schema: Schema) => boolean;\n /** Default: `schemaPermissions.deleteField`, except for system fields and\n * the id field. */\n canDeleteField?: (field: Field, schema: Schema) => boolean;\n /** Disables an otherwise available field action with this tooltip.\n * Undefined preserves its default state; denied actions stay hidden. */\n getFieldActionDisabledReason?: (\n field: Field,\n schema: Schema,\n action:\n | 'editField'\n | 'makePrimary'\n | 'duplicateField'\n | 'duplicateFieldWithContent'\n | 'delete',\n ) => string | undefined;\n /** Whether a field can become the primary field. When omitted, only\n * `SHORT_TEXT` and `LONG_TEXT` fields can. When set, its result replaces\n * that rule, so return `false` for non-text fields too. */\n canMakePrimary?: (field: Field, schema: Schema) => boolean;\n /** Resolved when deletion is requested. Undefined keeps the default dialog. */\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n /** Permission defaults shown in the modal. Absent ⇒ no permissions section. */\n fieldPermissions?: FieldPermissions;\n /** Default: `false`. */\n supportsPii?: boolean;\n /** Allows changing PII on an existing supported field. Default: disabled.\n * Does not override `canEditField` or the field type's PII support. */\n canEditFieldPii?: (field: Field, schema: Schema) => boolean;\n /** The value of a field on an item. Default: `item[field.id]`. */\n getFieldValue?: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item.\n * Default: `{ ...item, [field.id]: value }`. */\n setFieldValue?: (item: T, field: Field, value: unknown) => T;\n}\n\n/** The resolved source: defaults filled, `loadSchema` memoized. */\nexport interface SchemaSource<T> {\n readonly collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n readonly paginationMode: 'offset';\n /** Stable row identity. */\n itemKey: (item: T) => string;\n /** Row display label. */\n itemName: (item: T) => string;\n /** Sources for referenced collections, keyed by referenced collection id. */\n readonly references: Record<string, SchemaSource<any>>;\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n readonly fieldModal: {\n showFieldId?: boolean;\n text?: FieldModalText;\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: FieldTypeOption[];\n };\n readonly fieldTypes: FieldTypeDefinition[];\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n searchableFieldIds: (schema: Schema) => string[];\n canAddFields: (schema: Schema) => boolean;\n canEditField: (field: Field, schema: Schema) => boolean;\n canDeleteField: (field: Field, schema: Schema) => boolean;\n getFieldActionDisabledReason?: SchemaSourceInput<T>['getFieldActionDisabledReason'];\n canMakePrimary?: (field: Field, schema: Schema) => boolean;\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n readonly fieldPermissions?: FieldPermissions;\n readonly supportsPii: boolean;\n canEditFieldPii?: (field: Field, schema: Schema) => boolean;\n /** The value of a field on an item. */\n getFieldValue: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item. */\n setFieldValue: (item: T, field: Field, value: unknown) => T;\n schemaParams: () => SchemaBiParams;\n /** Replaces the memoized schema returned by later `loadSchema()` calls.\n * No-op before the first successful load. */\n setLoadedSchema?: (schema: Schema) => void;\n}\n\ntype OffsetFind<T> = (\n query: OffsetQuery,\n options?: FindOptions,\n) => Promise<OffsetQueryResult<T>>;\n\n/** The collection fetch derived from a source: loads once, then queries the\n * backend's `find`.\n *\n * Free-text search covers the columns the page is showing: the table keeps\n * `query.columns` in sync with them, so the scope comes off the query rather\n * than being threaded in. Falls back to the source's own `searchableFieldIds`\n * before any columns are known (or with no table attached). */\nexport function sourceFetchData<T>(\n source: SchemaSource<T>,\n): (query: OffsetQuery) => Promise<OffsetQueryResult<T>> {\n return async (query) => {\n const { backend, schema } = await source.loadSchema();\n // `columns` is the visible-column list; `fields` is the projection, which a\n // source-driven table doesn't set.\n const visibleColumns = query.columns;\n return (backend.find as OffsetFind<T>)(query, {\n searchableFieldIds: visibleColumns?.length\n ? visibleColumns\n : source.searchableFieldIds(schema),\n });\n };\n}\n\n/** Fills source-neutral defaults over `input` and memoizes the load so the collection\n * query and the table columns share a single fetch. */\nexport function defineSchemaSource<T>(\n input: SchemaSourceInput<T>,\n): SchemaSource<T> {\n const {\n collectionId,\n paginationMode = 'offset',\n fieldModal = {},\n fieldTypes = [],\n fieldPermissions,\n supportsPii = false,\n references = {},\n getReferencedCollectionSource,\n } = input;\n\n let loaded: Promise<LoadedSchema<T>> | undefined;\n let resolved: LoadedSchema<T> | undefined;\n\n const loadSchema = () =>\n (loaded ??= input\n .loadSchema()\n .then((result) => {\n resolved = result;\n return result;\n })\n .catch((error) => {\n loaded = undefined;\n throw error;\n }));\n\n const setLoadedSchema = (schema: Schema) => {\n if (!resolved) {\n return;\n }\n resolved = { ...resolved, schema };\n loaded = Promise.resolve(resolved);\n };\n\n const searchableFieldIds =\n input.searchableFieldIds ?? ((s) => [s.displayField]);\n\n const itemKey =\n input.itemKey ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[resolved?.schema.idField ?? '_id'] ??\n '',\n ));\n const itemName =\n input.itemName ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[\n resolved?.schema.displayField ?? '_id'\n ] ?? '',\n ));\n const canAddFields =\n input.canAddFields ?? ((s) => s.schemaPermissions?.createField ?? false);\n const isLockedField = (field: Field, s: Schema) =>\n field.isSystem === true || field.id === s.idField;\n const canEditField =\n input.canEditField ??\n ((field, s) =>\n (s.schemaPermissions?.updateField ?? false) && !isLockedField(field, s));\n const canDeleteField =\n input.canDeleteField ??\n ((field, s) =>\n (s.schemaPermissions?.deleteField ?? false) && !isLockedField(field, s));\n const getFieldValue =\n input.getFieldValue ??\n ((item, field) => (item as Record<string, unknown>)[field.id]);\n const setFieldValue =\n input.setFieldValue ??\n ((item, field, value) => ({ ...item, [field.id]: value } as T));\n\n const schemaParams = (): SchemaBiParams => ({\n tableId: resolved?.schema.id ?? collectionId,\n tableName: resolved?.schema.name,\n tableType: resolved?.schema.type,\n });\n\n return {\n collectionId,\n loadSchema,\n paginationMode,\n itemKey,\n itemName,\n references,\n ...(getReferencedCollectionSource && { getReferencedCollectionSource }),\n fieldModal: {\n showFieldId: fieldModal.showFieldId,\n text: fieldModal.text,\n loadReferenceableCollectionOptions:\n fieldModal.loadReferenceableCollectionOptions,\n types: fieldModal.types ?? [],\n },\n fieldTypes,\n getFieldPresentation: input.getFieldPresentation,\n searchableFieldIds,\n canAddFields,\n canEditField,\n canDeleteField,\n getFieldActionDisabledReason: input.getFieldActionDisabledReason,\n canMakePrimary: input.canMakePrimary,\n getDeleteFieldConfirmation: input.getDeleteFieldConfirmation,\n fieldPermissions,\n supportsPii,\n canEditFieldPii: input.canEditFieldPii,\n getFieldValue,\n setFieldValue,\n schemaParams,\n setLoadedSchema,\n };\n}\n"],"mappings":";;;;;AAiBA;AACA;AACA;AACA;;AA6BA;;AAYA;;AAQA;;AAOA;;AA4EA;;AAkDA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAC7BC,MAAuB,EACgC;EACvD,OAAO,MAAOC,KAAK,IAAK;IACtB,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAG,MAAMH,MAAM,CAACI,UAAU,CAAC,CAAC;IACrD;IACA;IACA,MAAMC,cAAc,GAAGJ,KAAK,CAACK,OAAO;IACpC,OAAQJ,OAAO,CAACK,IAAI,CAAmBN,KAAK,EAAE;MAC5CO,kBAAkB,EAAEH,cAAc,YAAdA,cAAc,CAAEI,MAAM,GACtCJ,cAAc,GACdL,MAAM,CAACQ,kBAAkB,CAACL,MAAM;IACtC,CAAC,CAAC;EACJ,CAAC;AACH;;AAEA;AACA;AACO,SAASO,kBAAkBA,CAChCC,KAA2B,EACV;EACjB,MAAM;IACJC,YAAY;IACZC,cAAc,GAAG,QAAQ;IACzBC,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MC,YAAY,GAAGA,CAAA;IAAA,IAAAC,UAAA,EAAAC,UAAA,EAAAC,UAAA;IAAA,OAAuB;MAC1CC,OAAO,EAAE,EAAAH,UAAA,GAAApC,QAAQ,qBAARoC,UAAA,CAAUtD,MAAM,CAAC2C,EAAE,KAAIlC,YAAY;MAC5CiD,SAAS,GAAAH,UAAA,GAAErC,QAAQ,qBAARqC,UAAA,CAAUvD,MAAM,CAAC2D,IAAI;MAChCC,SAAS,GAAAJ,UAAA,GAAEtC,QAAQ,qBAARsC,UAAA,CAAUxD,MAAM,CAAC6D;IAC9B,CAAC;EAAA,CAAC;EAEF,OAAO;IACLpD,YAAY;IACZR,UAAU;IACVS,cAAc;IACdmB,OAAO;IACPK,QAAQ;IACRnB,UAAU;IACV,IAAIC,6BAA6B,IAAI;MAAEA;IAA8B,CAAC,CAAC;IACvEL,UAAU,EAAE;MACVmD,WAAW,EAAEnD,UAAU,CAACmD,WAAW;MACnCC,IAAI,EAAEpD,UAAU,CAACoD,IAAI;MACrBC,kCAAkC,EAChCrD,UAAU,CAACqD,kCAAkC;MAC/CC,KAAK,EAAEtD,UAAU,CAACsD,KAAK,IAAI;IAC7B,CAAC;IACDrD,UAAU;IACVsD,oBAAoB,EAAE1D,KAAK,CAAC0D,oBAAoB;IAChD7D,kBAAkB;IAClB+B,YAAY;IACZQ,YAAY;IACZG,cAAc;IACdoB,4BAA4B,EAAE3D,KAAK,CAAC2D,4BAA4B;IAChEC,cAAc,EAAE5D,KAAK,CAAC4D,cAAc;IACpCC,0BAA0B,EAAE7D,KAAK,CAAC6D,0BAA0B;IAC5DxD,gBAAgB;IAChBC,WAAW;IACXwD,eAAe,EAAE9D,KAAK,CAAC8D,eAAe;IACtCpB,aAAa;IACbC,aAAa;IACbE,YAAY;IACZ7B;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["sourceFetchData","source","query","backend","schema","loadSchema","visibleColumns","columns","find","searchableFieldIds","length","defineSchemaSource","input","collectionId","paginationMode","fieldModal","fieldTypes","fieldPermissions","supportsPii","references","getReferencedCollectionSource","loaded","resolved","then","result","catch","error","undefined","setLoadedSchema","Promise","resolve","s","displayField","itemKey","item","_resolved","String","idField","itemName","_resolved2","canAddFields","_s$schemaPermissions","schemaPermissions","createField","isLockedField","field","isSystem","id","canEditField","_s$schemaPermissions2","updateField","canDeleteField","_s$schemaPermissions3","deleteField","getFieldValue","setFieldValue","value","schemaParams","_resolved3","_resolved4","_resolved5","tableId","tableName","name","tableType","type","showFieldId","text","loadReferenceableCollectionOptions","types","getFieldPresentation","getFieldActionDisabledReason","canMakePrimary","getDeleteFieldConfirmation","canEditFieldPii"],"sources":["../../../src/types/SchemaSource.ts"],"sourcesContent":["import type { Field, PatternsFieldType } from './Field';\nimport type { FieldTypeDefinition } from './FieldTypeDefinition';\nimport type { Schema, LoadedSchema, FindOptions } from './Schema';\nimport type {\n FieldPresentation,\n FieldModalText,\n FieldModalCollectionInput,\n FieldModalCollectionOptionsLoader,\n FieldPermissions,\n FieldPiiWarning,\n FieldSettingsSection,\n} from './FieldsSource';\nimport type {\n OffsetQuery,\n OffsetQueryResult,\n} from '../hooks/paginationModeConfig';\n\n/** A field type the add/edit field modal offers, with everything that type\n * brings to it. Declare one entry per `patternsType` — the type is the entry's\n * identity. Nothing here reaches the table or the filters; that is `fieldTypes`\n * (`FieldTypeDefinition[]`). */\nexport interface FieldTypeOption {\n patternsType: PatternsFieldType;\n /** Custom display name. Absent ⇒ the UI's standard name for this type. */\n label?: string;\n /** Custom name-input placeholder. Absent ⇒ the UI's standard placeholder. */\n namePlaceholder?: string;\n /** Fallback field ID base when the name cannot produce a valid ID.\n * Default: the normalized type ID. Numeric suffixes resolve collisions. */\n keyBase?: string;\n /** A one-line description shown under the type in the add-field menu. */\n subtitle?: string;\n /** The group heading this type is listed under in the add-field menu, in\n * first-seen order. Types sharing a heading form one group. Absent ⇒\n * ungrouped. */\n group?: string;\n /** Whether a field of this type can be marked PII. Absent ⇒ follows the\n * source's `supportsPii`. */\n supportsPii?: boolean;\n /** Warning shown while the PII toggle is on. Read on every render, so it can\n * use data that only exists once the schema has loaded. Default: none. */\n piiWarning?: () => FieldPiiWarning | undefined;\n /** This type's own part of the collapsible section in the add/edit field\n * modal. Default: none. */\n settingsSection?: FieldSettingsSection;\n /** Collection picker shown in the main add/edit field form. */\n collectionInput?: FieldModalCollectionInput;\n}\n\n/** Everything the add/edit field modal shows for this source. */\nexport interface FieldModalInput {\n /** Whether to show the field ID input. Default: true. */\n showFieldId?: boolean;\n /** Title and subtitle. Default: generic titles. */\n text?: FieldModalText;\n /** Default option loader for reference-like built-in field types. */\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n /** The types the modal offers, in display order. Default: none. */\n types?: FieldTypeOption[];\n}\n\n/** Copy shown before deleting a field. Strings are translated by the caller. */\nexport interface DeleteFieldConfirmation {\n title: string;\n description: string;\n /** When provided, confirmation requires this checkbox to be checked. */\n confirmationCheckboxLabel?: string;\n}\n\n/** Identifies the collection behind a table on BI events. */\nexport interface SchemaBiParams {\n tableId?: string;\n tableName?: string;\n tableType?: string;\n}\n\n/** What a caller passes. Only `collectionId` and `loadSchema` are required. */\nexport interface SchemaSourceInput<T> {\n collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n /** Sources for collections this one references, keyed by the referenced\n * collection id. A renderer resolves a reference field through the matching\n * entry — its `loadSchema` gives the referenced schema and `sourceFetchData`\n * queries the referenced items. Default: none. */\n references?: Record<string, SchemaSource<any>>;\n /** Lazy source lookup for a referenced collection that is not in `references`.\n * Is used when a reference field is created in the add field modal.\n * The returned source owns its own async schema/item loading. */\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n paginationMode?: 'offset';\n /** Stable row identity. Default: `row[idField]`. */\n itemKey?: (item: T) => string;\n /** Row display label. Default: `row[displayField]`. */\n itemName?: (item: T) => string;\n /** Fields free-text search runs against. Default: `[displayField]`. */\n searchableFieldIds?: (schema: Schema) => string[];\n /** What the add/edit field modal shows. Default: no types, generic titles. */\n fieldModal?: FieldModalInput;\n /** Consumer-defined field types: how a field of that type renders, filters and\n * validates wherever it appears. A field with `type: 'CUSTOM'` resolves its\n * definition here by `customType`. The add/edit field modal never reads this\n * — see `fieldModal`. Default: none. */\n fieldTypes?: FieldTypeDefinition[];\n /** Overrides one existing field's type label, icons, collection-picker label\n * and initial field visibility. Does not change its type, values or\n * add-field options. */\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n /** Default: `schemaPermissions.createField`. */\n canAddFields?: (schema: Schema) => boolean;\n /** Default: `schemaPermissions.updateField`, except for system fields and\n * the id field. */\n canEditField?: (field: Field, schema: Schema) => boolean;\n /** Default: `schemaPermissions.deleteField`, except for system fields and\n * the id field. */\n canDeleteField?: (field: Field, schema: Schema) => boolean;\n /** Disables an otherwise available field action with this tooltip.\n * Undefined preserves its default state; denied actions stay hidden. */\n getFieldActionDisabledReason?: (\n field: Field,\n schema: Schema,\n action:\n | 'editField'\n | 'makePrimary'\n | 'duplicateField'\n | 'duplicateFieldWithContent'\n | 'delete',\n ) => string | undefined;\n /** Whether a field can become the primary field. When omitted, only\n * `SHORT_TEXT` and `LONG_TEXT` fields can. When set, its result replaces\n * that rule, so return `false` for non-text fields too. */\n canMakePrimary?: (field: Field, schema: Schema) => boolean;\n /** Resolved when deletion is requested. Undefined keeps the default dialog. */\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n /** Permission defaults shown in the modal. Absent ⇒ no permissions section. */\n fieldPermissions?: FieldPermissions;\n /** Default: `false`. */\n supportsPii?: boolean;\n /** Allows changing PII on an existing supported field. Default: disabled.\n * Does not override `canEditField` or the field type's PII support. */\n canEditFieldPii?: (field: Field, schema: Schema) => boolean;\n /** The value of a field on an item. Default: `item[field.id]`. */\n getFieldValue?: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item.\n * Default: `{ ...item, [field.id]: value }`. */\n setFieldValue?: (item: T, field: Field, value: unknown) => T;\n}\n\n/** The resolved source: defaults filled, `loadSchema` memoized. */\nexport interface SchemaSource<T> {\n readonly collectionId: string;\n loadSchema: () => Promise<LoadedSchema<T>>;\n readonly paginationMode: 'offset';\n /** Stable row identity. */\n itemKey: (item: T) => string;\n /** Row display label. */\n itemName: (item: T) => string;\n /** Sources for referenced collections, keyed by referenced collection id. */\n readonly references: Record<string, SchemaSource<any>>;\n getReferencedCollectionSource?: (\n collectionId: string,\n ) => SchemaSource<any> | undefined;\n readonly fieldModal: {\n showFieldId?: boolean;\n text?: FieldModalText;\n loadReferenceableCollectionOptions?: FieldModalCollectionOptionsLoader;\n types: FieldTypeOption[];\n };\n readonly fieldTypes: FieldTypeDefinition[];\n getFieldPresentation?: (field: Field) => FieldPresentation | undefined;\n searchableFieldIds: (schema: Schema) => string[];\n canAddFields: (schema: Schema) => boolean;\n canEditField: (field: Field, schema: Schema) => boolean;\n canDeleteField: (field: Field, schema: Schema) => boolean;\n getFieldActionDisabledReason?: SchemaSourceInput<T>['getFieldActionDisabledReason'];\n canMakePrimary?: (field: Field, schema: Schema) => boolean;\n getDeleteFieldConfirmation?: (\n field: Field,\n schema: Schema,\n ) => DeleteFieldConfirmation | undefined;\n readonly fieldPermissions?: FieldPermissions;\n readonly supportsPii: boolean;\n canEditFieldPii?: (field: Field, schema: Schema) => boolean;\n /** The value of a field on an item. */\n getFieldValue: (item: T, field: Field) => unknown;\n /** Writes a field's value on an item, returning the updated item. */\n setFieldValue: (item: T, field: Field, value: unknown) => T;\n schemaParams: () => SchemaBiParams;\n /** Replaces the memoized schema returned by later `loadSchema()` calls.\n * No-op before the first successful load. */\n setLoadedSchema?: (schema: Schema) => void;\n}\n\ntype OffsetFind<T> = (\n query: OffsetQuery,\n options?: FindOptions,\n) => Promise<OffsetQueryResult<T>>;\n\n/** The collection fetch derived from a source: loads once, then queries the\n * backend's `find`.\n *\n * Free-text search covers the columns the page is showing: the table keeps\n * `query.columns` in sync with them, so the scope comes off the query rather\n * than being threaded in. Falls back to the source's own `searchableFieldIds`\n * before any columns are known (or with no table attached). */\nexport function sourceFetchData<T>(\n source: SchemaSource<T>,\n): (query: OffsetQuery) => Promise<OffsetQueryResult<T>> {\n return async (query) => {\n const { backend, schema } = await source.loadSchema();\n // `columns` is the visible-column list; `fields` is the projection, which a\n // source-driven table doesn't set.\n const visibleColumns = query.columns;\n return (backend.find as OffsetFind<T>)(query, {\n searchableFieldIds: visibleColumns?.length\n ? visibleColumns\n : source.searchableFieldIds(schema),\n });\n };\n}\n\n/** Fills source-neutral defaults over `input` and memoizes the load so the collection\n * query and the table columns share a single fetch. */\nexport function defineSchemaSource<T>(\n input: SchemaSourceInput<T>,\n): SchemaSource<T> {\n const {\n collectionId,\n paginationMode = 'offset',\n fieldModal = {},\n fieldTypes = [],\n fieldPermissions,\n supportsPii = false,\n references = {},\n getReferencedCollectionSource,\n } = input;\n\n let loaded: Promise<LoadedSchema<T>> | undefined;\n let resolved: LoadedSchema<T> | undefined;\n\n const loadSchema = () =>\n (loaded ??= input\n .loadSchema()\n .then((result) => {\n resolved = result;\n return result;\n })\n .catch((error) => {\n loaded = undefined;\n throw error;\n }));\n\n const setLoadedSchema = (schema: Schema) => {\n if (!resolved) {\n return;\n }\n resolved = { ...resolved, schema };\n loaded = Promise.resolve(resolved);\n };\n\n const searchableFieldIds =\n input.searchableFieldIds ?? ((s) => [s.displayField]);\n\n const itemKey =\n input.itemKey ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[resolved?.schema.idField ?? '_id'] ??\n '',\n ));\n const itemName =\n input.itemName ??\n ((item) =>\n String(\n (item as Record<string, unknown>)[\n resolved?.schema.displayField ?? '_id'\n ] ?? '',\n ));\n const canAddFields =\n input.canAddFields ?? ((s) => s.schemaPermissions?.createField ?? false);\n const isLockedField = (field: Field, s: Schema) =>\n field.isSystem === true || field.id === s.idField;\n const canEditField =\n input.canEditField ??\n ((field, s) =>\n (s.schemaPermissions?.updateField ?? false) && !isLockedField(field, s));\n const canDeleteField =\n input.canDeleteField ??\n ((field, s) =>\n (s.schemaPermissions?.deleteField ?? false) && !isLockedField(field, s));\n const getFieldValue =\n input.getFieldValue ??\n ((item, field) => (item as Record<string, unknown>)[field.id]);\n const setFieldValue =\n input.setFieldValue ??\n ((item, field, value) => ({ ...item, [field.id]: value } as T));\n\n const schemaParams = (): SchemaBiParams => ({\n tableId: resolved?.schema.id ?? collectionId,\n tableName: resolved?.schema.name,\n tableType: resolved?.schema.type,\n });\n\n return {\n collectionId,\n loadSchema,\n paginationMode,\n itemKey,\n itemName,\n references,\n ...(getReferencedCollectionSource && { getReferencedCollectionSource }),\n fieldModal: {\n showFieldId: fieldModal.showFieldId,\n text: fieldModal.text,\n loadReferenceableCollectionOptions:\n fieldModal.loadReferenceableCollectionOptions,\n types: fieldModal.types ?? [],\n },\n fieldTypes,\n getFieldPresentation: input.getFieldPresentation,\n searchableFieldIds,\n canAddFields,\n canEditField,\n canDeleteField,\n getFieldActionDisabledReason: input.getFieldActionDisabledReason,\n canMakePrimary: input.canMakePrimary,\n getDeleteFieldConfirmation: input.getDeleteFieldConfirmation,\n fieldPermissions,\n supportsPii,\n canEditFieldPii: input.canEditFieldPii,\n getFieldValue,\n setFieldValue,\n schemaParams,\n setLoadedSchema,\n };\n}\n"],"mappings":";;;;;AAiBA;AACA;AACA;AACA;;AA6BA;;AAYA;;AAQA;;AAOA;;AA4EA;;AAkDA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAeA,CAC7BC,MAAuB,EACgC;EACvD,OAAO,MAAOC,KAAK,IAAK;IACtB,MAAM;MAAEC,OAAO;MAAEC;IAAO,CAAC,GAAG,MAAMH,MAAM,CAACI,UAAU,CAAC,CAAC;IACrD;IACA;IACA,MAAMC,cAAc,GAAGJ,KAAK,CAACK,OAAO;IACpC,OAAQJ,OAAO,CAACK,IAAI,CAAmBN,KAAK,EAAE;MAC5CO,kBAAkB,EAAEH,cAAc,YAAdA,cAAc,C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AAe,EAAE9D,KAAK,CAAC8D,eAAe;IACtCpB,aAAa;IACbC,aAAa;IACbE,YAAY;IACZ7B;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -28,6 +28,19 @@ export interface SetupWidgetStepSecondaryCta {
|
|
|
28
28
|
/** Tooltip shown on hover. */
|
|
29
29
|
tooltip?: string;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* A close button in the step's top-right corner. Clicking it fires the
|
|
33
|
+
* widget's `onStepClose`.
|
|
34
|
+
*/
|
|
35
|
+
export interface SetupWidgetStepCloseButton {
|
|
36
|
+
/** Tooltip shown on hover. */
|
|
37
|
+
tooltip: string;
|
|
38
|
+
/**
|
|
39
|
+
* Accessible name for the button. Required: the button renders an icon and
|
|
40
|
+
* nothing else. Include the step name so it is unique on the page.
|
|
41
|
+
*/
|
|
42
|
+
ariaLabel: string;
|
|
43
|
+
}
|
|
31
44
|
export interface SetupWidgetStep {
|
|
32
45
|
/** Stable identifier, used as the React key and for inline-expansion toggling. */
|
|
33
46
|
id: string;
|
|
@@ -57,6 +70,12 @@ export interface SetupWidgetStep {
|
|
|
57
70
|
* its children are done.
|
|
58
71
|
*/
|
|
59
72
|
secondaryCta?: SetupWidgetStepSecondaryCta;
|
|
73
|
+
/**
|
|
74
|
+
* Close button in the step's top-right corner, on desktop rows, mobile cards,
|
|
75
|
+
* aggregated group rows and their children. Set it only on the steps that
|
|
76
|
+
* should have one. It renders only when the widget also gets `onStepClose`.
|
|
77
|
+
*/
|
|
78
|
+
closeButton?: SetupWidgetStepCloseButton;
|
|
60
79
|
status: SetupWidgetStepStatus;
|
|
61
80
|
/**
|
|
62
81
|
* What happens when the row is activated:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupWidget.d.ts","sourceRoot":"","sources":["../../../src/model/setupWidget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;GAOG;AAEH;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}
|
|
@@ -7,7 +7,8 @@ import type { CustomFieldOrigin } from '../services';
|
|
|
7
7
|
export interface FieldPresentation {
|
|
8
8
|
typeDisplay?: Partial<FieldTypeDisplay>;
|
|
9
9
|
collectionInputLabel?: string;
|
|
10
|
-
/** Starts the
|
|
10
|
+
/** Starts the field hidden in tables and entity-page field cards; users can
|
|
11
|
+
* show it in field management. */
|
|
11
12
|
defaultHidden?: boolean;
|
|
12
13
|
}
|
|
13
14
|
/** A field the source has archived. Sources without archiving omit `archive`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldsSource.d.ts","sourceRoot":"","sources":["../../../src/types/FieldsSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B
|
|
1
|
+
{"version":3,"file":"FieldsSource.d.ts","sourceRoot":"","sources":["../../../src/types/FieldsSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EACV,mBAAmB,EACn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CAIwC;IACxC,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC,oBAAoB,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAEnE,uDAAuD;IACvD,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;mFAC+E;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,yDAAyD;IACzD,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,2DAA2D;IAC3D,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,MAAM,EAAE,CAAC;QACd,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;KACxC,CAAC;CACH"}
|
|
@@ -86,7 +86,7 @@ export interface SchemaSourceInput<T> {
|
|
|
86
86
|
* — see `fieldModal`. Default: none. */
|
|
87
87
|
fieldTypes?: FieldTypeDefinition[];
|
|
88
88
|
/** Overrides one existing field's type label, icons, collection-picker label
|
|
89
|
-
* and initial
|
|
89
|
+
* and initial field visibility. Does not change its type, values or
|
|
90
90
|
* add-field options. */
|
|
91
91
|
getFieldPresentation?: (field: Field) => FieldPresentation | undefined;
|
|
92
92
|
/** Default: `schemaPermissions.createField`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/bex-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.413.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Kobi",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"exports"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@wix/bex-utils": "2.
|
|
44
|
+
"@wix/bex-utils": "2.200.0",
|
|
45
45
|
"chance": "^1.0.0",
|
|
46
46
|
"events": "^3.0.0",
|
|
47
47
|
"formstate": "^2.1.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@types/react": "^16.0.0",
|
|
64
64
|
"@wix/auto-crud": "^1.0.108",
|
|
65
65
|
"@wix/babel-cli": "^1.11.0",
|
|
66
|
-
"@wix/cairo-integration-utils": "1.
|
|
66
|
+
"@wix/cairo-integration-utils": "1.175.0",
|
|
67
67
|
"@wix/eslint-config-yoshi": "^6.74.0",
|
|
68
68
|
"@wix/fe-essentials": "^1.233.0",
|
|
69
69
|
"@wix/fe-essentials-standalone": "^1.374.0",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"wallaby": {
|
|
173
173
|
"autoDetect": true
|
|
174
174
|
},
|
|
175
|
-
"falconPackageHash": "
|
|
175
|
+
"falconPackageHash": "daf2bd8991b17919a937d5cf6917a3b6e247d3609fb33e34a0c1254b"
|
|
176
176
|
}
|