@protobase/schema 0.119.5 → 0.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/internal.d.ts +2 -1
- package/dist/internal.js +2 -1
- package/dist/model.d.ts +48 -2
- package/dist/plugin-capabilities.d.ts +16 -0
- package/dist/plugin-capabilities.js +16 -0
- package/dist/plugin-version.d.ts +11 -6
- package/dist/plugin-version.js +10 -4
- package/dist/record-page.d.ts +4 -0
- package/dist/record-page.js +19 -0
- package/dist/view.d.ts +8 -1
- package/dist/view.js +16 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { DerivedModel, DerivedTarget } from "./derived/derived-model.js";
|
|
|
4
4
|
import { BucketEvery, BucketMeasure, BucketsModel } from "./buckets/buckets-model.js";
|
|
5
5
|
import { FileOptions, FileProcessor, FileProcessorInput, ImageFormat, ImageVariant, ImageVariantOptions, imageFormats } from "./files/file-options.js";
|
|
6
6
|
import { BadgeTone, badgeTones, isBadgeTone } from "./badge-tones.js";
|
|
7
|
-
import { ActionInputKind, ActionInputModel, ActionModel, ActionRun, AppAddress, BadgeShape, BlockElementModel, BlocksSectionModel, BottomBarItemModel, BottomBarModel, CalendarView, CardFavoriteModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CommentsSectionModel, CompareOp, ComposerSectionModel, CreateModel, CustomFallbackItemModel, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, ExportModel, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, FormModel, GalleryModel, GroupChartModel, GroupItemModel, GroupModel, HelpWhen, HistorySectionModel, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListDragModel, ListModel, ListQuery, Literal, MapSectionModel, MapView, NamedListModel, NavModel, NavRecentModel, NavStartModel, NowValue, OrderByItem, PageWidth, ParentAccess, ParentModel, PeriodChartModel, PositionAfterModel, RecordChartModel, RecordChartRange, RecordMode, RecordPageModel, RecordTrendModel, RecordWhen, RelatedColumnModel, RelatedFilter, RelatedModel, RelatedPresentation, ResourceModel, RowButtonChoice, RowButtonModel, SaveFeedback, SaveSearchModel, SearchMatch, SearchResultModel, SearchesOfModel, SectionModel, SectionPresentation, ShowWhen, SignInPromptModel, SignInViewModel, SortSpec, Span, StatusTone, TabItemModel, TabModel, ThreadSectionModel, TimelineView, TitleFromModel, ToolCallFields, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
7
|
+
import { ActionInputKind, ActionInputModel, ActionModel, ActionRun, AppAddress, BadgeShape, BlockElementModel, BlocksSectionModel, BottomBarItemModel, BottomBarModel, CalendarView, CardFavoriteModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CommentsSectionModel, CompareOp, ComposerSectionModel, ConversationPageModel, CreateModel, CustomFallbackItemModel, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, ExportModel, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, FormModel, GalleryModel, GroupChartModel, GroupItemModel, GroupModel, HelpWhen, HistorySectionModel, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListDragModel, ListModel, ListQuery, Literal, MapSectionModel, MapView, NamedListModel, NavModel, NavRecentModel, NavStartModel, NowValue, OrderByItem, PageWidth, ParentAccess, ParentModel, PeriodChartModel, PositionAfterModel, ReadPositionModel, RecordChartModel, RecordChartRange, RecordMode, RecordPageModel, RecordTrendModel, RecordWhen, RelatedColumnModel, RelatedFilter, RelatedModel, RelatedPresentation, ResourceModel, RowButtonChoice, RowButtonModel, SaveFeedback, SaveSearchModel, SearchMatch, SearchResultModel, SearchesOfModel, SectionModel, SectionPresentation, ShowWhen, SignInPromptModel, SignInViewModel, SortSpec, Span, StatusTone, TabItemModel, TabModel, ThreadSectionModel, TimelineView, TitleFromModel, ToolCallFields, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
8
8
|
import { AccessAction, AccessContext, AccessFn, AccessResult, AccessUser, FieldAccess, FieldRule } from "./access/types.js";
|
|
9
9
|
import { Encrypted, encrypted } from "./encrypted-value.js";
|
|
10
10
|
import { AnyField, Constraint, Field, FieldMeta, FieldTypeDef } from "./field.js";
|
|
@@ -26,6 +26,7 @@ import { ListColumn } from "./view-columns.js";
|
|
|
26
26
|
import { ComponentRef, ViewProps } from "./view-displays.js";
|
|
27
27
|
import { FieldView } from "./view-field.js";
|
|
28
28
|
import { FieldViews, ViewBuilder, view } from "./view.js";
|
|
29
|
+
import { membersRule } from "./record-page.js";
|
|
29
30
|
import { FieldRefValue, fieldRef } from "./field-ref.js";
|
|
30
31
|
import { enumLabel } from "./enum-label.js";
|
|
31
32
|
import { UserMenuSource, userMenu } from "./user-menu.js";
|
|
@@ -57,4 +58,4 @@ import { CellKind, FileCell, FileDate, FileJson, cellKind, isEmptyFileCell } fro
|
|
|
57
58
|
import { UserTableFieldType, UserTableNameIssue, userTableNameIssue } from "./user-tables/names.js";
|
|
58
59
|
import { ColumnType, ColumnTypeReader, DecimalType, columnTypeReader, inferColumnType, maxShortText, minWholeDigits, widerFieldTypes } from "./user-tables/column-type.js";
|
|
59
60
|
import { fieldNamesOf, tableNameOf } from "./user-tables/column-names.js";
|
|
60
|
-
export { type Access, type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionInputKind, type ActionInputModel, type ActionModel, type ActionRun, type AnyField, type AppAddress, type ArgumentSpec, type ArgumentType, type ArgumentsSpec, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BadgeTone, type BlockElementModel, type BlocksSectionModel, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type BucketEvery, type BucketFields, type BucketMeasure, type BucketMeasuresInput, type BucketsModel, type BucketsSpec, type CalendarView, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardFavoriteModel, type CardPhotosModel, type CellKind, type ChartGranularity, type ChartInput, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type ColumnType, type ColumnTypeReader, type CommentsSectionModel, type CompareOp, type ComponentRef, type ComposerSectionModel, type ComputedReveal, type ConnectAddress, type Constraint, type CreateModel, type CreatedOptions, type CustomFallbackItemModel, type CustomSectionModel, type DatePreset, type DecimalType, type DeletedOptions, type DerivedModel, type DerivedSpec, type DerivedTarget, type DurationLiteral, type DurationUnit, type Encrypted, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type ExactCapability, type ExportModel, type Field, type FieldAccess, type FieldFormat, type FieldMeta, type FieldModel, type FieldPath, type FieldRefValue, type FieldRefs, type FieldRule, type FieldType, type FieldTypeDef, type FieldView, type FieldViewModel, type FieldViews, type FieldWidgetModel, type FieldsInput, type FileCell, type FileDate, type FileField, type FileFieldModel, type FileJson, type FileOptions, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type FormAddress, type FormInput, type FormModel, type GalleryModel, type Grant, type GroupChartInput, type GroupChartModel, type GroupItemModel, type GroupModel, type HeldCapability, type HelpWhen, type HistorySectionModel, type ImageFormat, type ImageVariant, type ImageVariantOptions, type InferRecord, type Issue, type JsonValue, type KeyOf, type KeyRefs, type KeyType, type KeyValue, type LayoutItemModel, type ListColumn, type ListDisplayModel, type ListDragModel, type ListModel, type ListQuery, type Literal, type Lookup, type MapSectionModel, type MapView, type NamedListModel, type NavModel, type NavRecentModel, type NavStartModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type PageWidth, type ParentAccess, type ParentModel, type PeriodChartInput, type PeriodChartModel, type PositionAfterModel, type RecordChartModel, type RecordChartRange, type RecordKey, type RecordMode, type RecordOf, type RecordPageModel, type RecordTrendModel, type RecordWhen, type Ref, type Refs, type RelatedColumnModel, type RelatedFilter, type RelatedModel, type RelatedPresentation, type RelationField, type ResolveOptions, type ResolvedAccess, type ResourceBuilder, type ResourceModel, type RevealCaller, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type Rollup, type RollupCount, type RollupFn, type RollupSource, type RollupValue, type RowButtonChoice, type RowButtonModel, type RowFilterOperation, type Rule, type SaveFeedback, type SaveSearchModel, type SearchMatch, type SearchRef, type SearchRefs, type SearchResultModel, type SearchesOfModel, type SectionModel, type SectionPresentation, type ShowWhen, type SignInAddress, type SignInPromptModel, type SignInStep, type SignInViewModel, type SortSpec, type Span, type StatusTone, type TabItemModel, type TabModel, type TenantOptions, type ThreadSectionModel, type TimelineView, type TitleFromModel, type ToolCallFields, type UndeletedOptions, type UpdatedOptions, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type UserTableFieldType, type UserTableNameIssue, type Validator, type ViewBuilder, type ViewModel, type ViewProps, accessWarnings, addressWords, anonymousRole, appPath, argumentsSchema, badgeTones, bottomBar, bottomBarErrors, cellKind, checkFilter, checkOrderBy, checkRecord, columnTypeReader, connectParams, connectPath, connectRoute, createWhere, defineRoles, encrypted, enumLabel, evaluateFilter, f, fieldNamesOf, fieldRef, fieldsUsedBy, fitsKeyType, formPath, formRoute, imageFormats, inferColumnType, isBadgeTone, isEmptyFileCell, isRecordCondition, keyTypes, layout as l, maxBottomBarItems, maxJsonDepth, maxShortText, minWholeDigits, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readConnectAddress, readFormAddress, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, tableNameOf, userMenu, userTableNameIssue, view, where, widerFieldTypes };
|
|
61
|
+
export { type Access, type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionInputKind, type ActionInputModel, type ActionModel, type ActionRun, type AnyField, type AppAddress, type ArgumentSpec, type ArgumentType, type ArgumentsSpec, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BadgeTone, type BlockElementModel, type BlocksSectionModel, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type BucketEvery, type BucketFields, type BucketMeasure, type BucketMeasuresInput, type BucketsModel, type BucketsSpec, type CalendarView, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardFavoriteModel, type CardPhotosModel, type CellKind, type ChartGranularity, type ChartInput, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type ColumnType, type ColumnTypeReader, type CommentsSectionModel, type CompareOp, type ComponentRef, type ComposerSectionModel, type ComputedReveal, type ConnectAddress, type Constraint, type ConversationPageModel, type CreateModel, type CreatedOptions, type CustomFallbackItemModel, type CustomSectionModel, type DatePreset, type DecimalType, type DeletedOptions, type DerivedModel, type DerivedSpec, type DerivedTarget, type DurationLiteral, type DurationUnit, type Encrypted, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type ExactCapability, type ExportModel, type Field, type FieldAccess, type FieldFormat, type FieldMeta, type FieldModel, type FieldPath, type FieldRefValue, type FieldRefs, type FieldRule, type FieldType, type FieldTypeDef, type FieldView, type FieldViewModel, type FieldViews, type FieldWidgetModel, type FieldsInput, type FileCell, type FileDate, type FileField, type FileFieldModel, type FileJson, type FileOptions, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type FormAddress, type FormInput, type FormModel, type GalleryModel, type Grant, type GroupChartInput, type GroupChartModel, type GroupItemModel, type GroupModel, type HeldCapability, type HelpWhen, type HistorySectionModel, type ImageFormat, type ImageVariant, type ImageVariantOptions, type InferRecord, type Issue, type JsonValue, type KeyOf, type KeyRefs, type KeyType, type KeyValue, type LayoutItemModel, type ListColumn, type ListDisplayModel, type ListDragModel, type ListModel, type ListQuery, type Literal, type Lookup, type MapSectionModel, type MapView, type NamedListModel, type NavModel, type NavRecentModel, type NavStartModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type PageWidth, type ParentAccess, type ParentModel, type PeriodChartInput, type PeriodChartModel, type PositionAfterModel, type ReadPositionModel, type RecordChartModel, type RecordChartRange, type RecordKey, type RecordMode, type RecordOf, type RecordPageModel, type RecordTrendModel, type RecordWhen, type Ref, type Refs, type RelatedColumnModel, type RelatedFilter, type RelatedModel, type RelatedPresentation, type RelationField, type ResolveOptions, type ResolvedAccess, type ResourceBuilder, type ResourceModel, type RevealCaller, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type Rollup, type RollupCount, type RollupFn, type RollupSource, type RollupValue, type RowButtonChoice, type RowButtonModel, type RowFilterOperation, type Rule, type SaveFeedback, type SaveSearchModel, type SearchMatch, type SearchRef, type SearchRefs, type SearchResultModel, type SearchesOfModel, type SectionModel, type SectionPresentation, type ShowWhen, type SignInAddress, type SignInPromptModel, type SignInStep, type SignInViewModel, type SortSpec, type Span, type StatusTone, type TabItemModel, type TabModel, type TenantOptions, type ThreadSectionModel, type TimelineView, type TitleFromModel, type ToolCallFields, type UndeletedOptions, type UpdatedOptions, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type UserTableFieldType, type UserTableNameIssue, type Validator, type ViewBuilder, type ViewModel, type ViewProps, accessWarnings, addressWords, anonymousRole, appPath, argumentsSchema, badgeTones, bottomBar, bottomBarErrors, cellKind, checkFilter, checkOrderBy, checkRecord, columnTypeReader, connectParams, connectPath, connectRoute, createWhere, defineRoles, encrypted, enumLabel, evaluateFilter, f, fieldNamesOf, fieldRef, fieldsUsedBy, fitsKeyType, formPath, formRoute, imageFormats, inferColumnType, isBadgeTone, isEmptyFileCell, isRecordCondition, keyTypes, layout as l, maxBottomBarItems, maxJsonDepth, maxShortText, membersRule, minWholeDigits, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readConnectAddress, readFormAddress, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, tableNameOf, userMenu, userTableNameIssue, view, where, widerFieldTypes };
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { accessWarnings, checkRecord, fieldsUsedBy, resolveAccess } from "./acce
|
|
|
13
13
|
import { resource } from "./resource.js";
|
|
14
14
|
import { isRecordCondition } from "./record-when.js";
|
|
15
15
|
import { formPath, formRoute, readFormAddress } from "./form-address.js";
|
|
16
|
+
import { membersRule } from "./record-page.js";
|
|
16
17
|
import { fieldRef } from "./field-ref.js";
|
|
17
18
|
import { badgeTones, isBadgeTone } from "./badge-tones.js";
|
|
18
19
|
import { view } from "./view.js";
|
|
@@ -34,4 +35,4 @@ import { cellKind, isEmptyFileCell } from "./user-tables/cell-kind.js";
|
|
|
34
35
|
import { columnTypeReader, inferColumnType, maxShortText, minWholeDigits, widerFieldTypes } from "./user-tables/column-type.js";
|
|
35
36
|
import { userTableNameIssue } from "./user-tables/names.js";
|
|
36
37
|
import { fieldNamesOf, tableNameOf } from "./user-tables/column-names.js";
|
|
37
|
-
export { accessWarnings, addressWords, anonymousRole, appPath, argumentsSchema, badgeTones, bottomBar, bottomBarErrors, cellKind, checkFilter, checkOrderBy, checkRecord, columnTypeReader, connectParams, connectPath, connectRoute, createWhere, defineRoles, encrypted, enumLabel, evaluateFilter, f, fieldNamesOf, fieldRef, fieldsUsedBy, fitsKeyType, formPath, formRoute, imageFormats, inferColumnType, isBadgeTone, isEmptyFileCell, isRecordCondition, keyTypes, layout as l, maxBottomBarItems, maxJsonDepth, maxShortText, minWholeDigits, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readConnectAddress, readFormAddress, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, tableNameOf, userMenu, userTableNameIssue, view, where, widerFieldTypes };
|
|
38
|
+
export { accessWarnings, addressWords, anonymousRole, appPath, argumentsSchema, badgeTones, bottomBar, bottomBarErrors, cellKind, checkFilter, checkOrderBy, checkRecord, columnTypeReader, connectParams, connectPath, connectRoute, createWhere, defineRoles, encrypted, enumLabel, evaluateFilter, f, fieldNamesOf, fieldRef, fieldsUsedBy, fitsKeyType, formPath, formRoute, imageFormats, inferColumnType, isBadgeTone, isEmptyFileCell, isRecordCondition, keyTypes, layout as l, maxBottomBarItems, maxJsonDepth, maxShortText, membersRule, minWholeDigits, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readConnectAddress, readFormAddress, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, tableNameOf, userMenu, userTableNameIssue, view, where, widerFieldTypes };
|
package/dist/internal.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { PropShapes, RefShape, pruneByShape, shapes } from "./ref-shape.js";
|
|
|
27
27
|
import { SearchTerm, matchedSearchField, matchesSearch, searchTerms, termMatches } from "./search-match.js";
|
|
28
28
|
import { defaultRecentLimit, navRecentErrors, statusTones } from "./nav-recent.js";
|
|
29
29
|
import { navStartErrors } from "./nav-start.js";
|
|
30
|
+
import { PluginCapabilities, missingCapabilities } from "./plugin-capabilities.js";
|
|
30
31
|
import { PluginHost, PluginRequirement, inRange, pluginProblem } from "./plugin-version.js";
|
|
31
32
|
import { redactSecrets } from "./redact-secrets.js";
|
|
32
33
|
import { firstPartyCodeKey } from "./first-party-code.js";
|
|
@@ -67,4 +68,4 @@ import { guestCallsPath } from "./calls/call-guests.js";
|
|
|
67
68
|
import { CallRing, callsChannelEvent, declineWord, ringNotice, ringsPath } from "./calls/call-rings.js";
|
|
68
69
|
import { ReorderSpan, reorderSpan } from "./reorder-span.js";
|
|
69
70
|
import { MovePlan, Ranked, movePlan } from "./move-plan.js";
|
|
70
|
-
export { type AddressCheck, type Availability, type CallCandidate, type CallClientMessage, type CallDescription, type CallGuestLink, type CallGuestRefusal, type CallGuestState, type CallLeftReason, type CallLobbyGuest, type CallMode, type CallRemoteTrack, type CallResume, type CallRing, type CallRosterMember, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type KeyType, type Locale, type MobileReleaseAnswer, type MovePlan, type PathLookup, type PersonStatus, type PluginHost, type PluginRequirement, type PropShapes, type Ranked, type RecordUse, type RefShape, type ReleaseBinding, type ReorderSpan, type RunnerRegistration, type SearchTerm, type StatusInput, type TemplatePath, type WorkflowCacheAdvice, type WorkflowRunTrace, type WorkflowStatus, type WorkflowTraceHeld, type WorkflowTraceStep, type WorkflowTypeEntry, type WorkflowTypeList, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
|
|
71
|
+
export { type AddressCheck, type Availability, type CallCandidate, type CallClientMessage, type CallDescription, type CallGuestLink, type CallGuestRefusal, type CallGuestState, type CallLeftReason, type CallLobbyGuest, type CallMode, type CallRemoteTrack, type CallResume, type CallRing, type CallRosterMember, type CallServerMessage, type CallTrackRequest, type CallTrackSource, type CallVideoLayer, type FormulaNode, type KeyType, type Locale, type MobileReleaseAnswer, type MovePlan, type PathLookup, type PersonStatus, type PluginCapabilities, type PluginHost, type PluginRequirement, type PropShapes, type Ranked, type RecordUse, type RefShape, type ReleaseBinding, type ReorderSpan, type RunnerRegistration, type SearchTerm, type StatusInput, type TemplatePath, type WorkflowCacheAdvice, type WorkflowRunTrace, type WorkflowStatus, type WorkflowTraceHeld, type WorkflowTraceStep, type WorkflowTypeEntry, type WorkflowTypeList, actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, missingCapabilities, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
|
package/dist/internal.js
CHANGED
|
@@ -34,6 +34,7 @@ import { runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRout
|
|
|
34
34
|
import { workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowTraceAfterParam, workflowTraceRevisionParam } from "./workflows/workflow-trace-path.js";
|
|
35
35
|
import { workflowTraceRevision } from "./workflows/workflow-trace-revision.js";
|
|
36
36
|
import { pruneByShape, shapes } from "./ref-shape.js";
|
|
37
|
+
import { missingCapabilities } from "./plugin-capabilities.js";
|
|
37
38
|
import { inRange, pluginProblem } from "./plugin-version.js";
|
|
38
39
|
import { redactSecrets } from "./redact-secrets.js";
|
|
39
40
|
import { firstPartyCodeKey } from "./first-party-code.js";
|
|
@@ -66,4 +67,4 @@ import { guestCallsPath } from "./calls/call-guests.js";
|
|
|
66
67
|
import { callsChannelEvent, declineWord, ringNotice, ringsPath } from "./calls/call-rings.js";
|
|
67
68
|
import { reorderSpan } from "./reorder-span.js";
|
|
68
69
|
import { movePlan } from "./move-plan.js";
|
|
69
|
-
export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
|
|
70
|
+
export { actionConditionError, actionInputErrors, addressErrors, addressPlaceholders, apiOriginMeta, appHrefError, appReadMaxBytes, appReadParam, appReadUrl, applyAssistantEvent, authBasePath, availabilities, bareFilterFields, boardErrors, bottomBarFor, bridgeSocketPath, bridgeTokenParam, builtInFieldTypes, callsChannelEvent, capacitorOrigin, cardPhotoLimit, chartFields, checkEventFilter, checkedAccept, checkedProvider, confirmationMinutes, datesErrors, declineWord, decodeKey, defaultRecentLimit, deviceIdParam, devicesPath, displayFields, emailCodeMinutes, embeddedFilterFields, emptyAssistantState, encodeKey, fieldRefsIn, filePath, filesPath, fillAddress, fillAddressFrom, fillFilter, fillText, filterField, findField, firstPartyCodeKey, followableRowButton, grantsOf, guestCallsPath, heldCapabilities, heldStatus, historyIdParam, historyIdPattern, historyPath, hostPlaceholder, hrefField, hrefPlaceholders, humanize, inRange, isAppRead, isFieldRef, isGroupChart, isLocale, isUserTableName, keyTypes, labelFieldOf, layoutItems, leavesApp, linkActionError, listColumnNames, locales, lookupLink, markFieldRefs, matchedSearchField, matchesSearch, maxLabelLength, maxNameBytes, maxOrganizationNameBytes, maxRelatedDepth, maxRelatedTerms, maxStatusText, missingCapabilities, mobileReleaseBasePath, mobileReleaseParams, mobileReleasePath, mobileReleaseQuery, mobileReleasesPath, movePlan, navRecentErrors, navStartErrors, organizationColumn, parseCapability, parseFormula, parseSize, parseTable, parseTemplatePath, pickLocale, pluginProblem, promptError, promptFields, pruneByShape, pushRecord, readEventStream, recordJsonSchema, recordTitle, recordTitleField, recordValueAt, redactSecrets, relatedErrors, relatedTarget, releaseManifestFile, releaseStatementContext, releaseStatementFile, renderPrompt, reorderSpan, reservedFieldNames, reservedWords, resolvableStatuses, resourceField, ringNotice, ringsPath, rowButtonChoiceFields, rowButtonChoices, rowButtonErrors, rowButtonFields, rowButtonTarget, runnerRegistrationParam, runnerRegistrationPath, runnerRegistrationRoute, searchTerms, secondStepParam, serviceWorkerFile, shapes, shownInputs, splitRelated, statusPath, statusRuns, statusTextProblem, statusTones, storageNamePattern, storedFileRef, tableDisplay, tapUrl, templatePlaceholders, termMatches, textPlaceholders, unmarkFieldRefs, updateSetErrors, updateValues, userTableName, valueText, viewOfList, webhookResources, wholePlaceholder, withLookups, workflowResources, workflowRunParam, workflowRunTracePath, workflowRunTraceRoute, workflowRunsPath, workflowStatusTones, workflowStatuses, workflowTraceAfterParam, workflowTraceRevision, workflowTraceRevisionParam, workflowTypesPath };
|
package/dist/model.d.ts
CHANGED
|
@@ -1682,8 +1682,8 @@ export type CreateModel = {
|
|
|
1682
1682
|
};
|
|
1683
1683
|
/**
|
|
1684
1684
|
* The record page as something else than the form (`.record(...)`): a component of the app's own, filling the content
|
|
1685
|
-
* area, on a focus page with its bar and Save when `focus`;
|
|
1686
|
-
* field type and saved by the framework.
|
|
1685
|
+
* area, on a focus page with its bar and Save when `focus`; a focus page whose surface is one field, drawn by its
|
|
1686
|
+
* field type and saved by the framework; or the record's conversation, filling the content area.
|
|
1687
1687
|
*/
|
|
1688
1688
|
export type RecordPageModel = {
|
|
1689
1689
|
/** The component, by the name `protobase.ui.tsx` exports it under. */
|
|
@@ -1693,6 +1693,52 @@ export type RecordPageModel = {
|
|
|
1693
1693
|
} | {
|
|
1694
1694
|
/** The field the page's surface draws. */
|
|
1695
1695
|
surface: string;
|
|
1696
|
+
} | {
|
|
1697
|
+
/** The record's conversation, its whole page. */
|
|
1698
|
+
conversation: ConversationPageModel;
|
|
1699
|
+
};
|
|
1700
|
+
/**
|
|
1701
|
+
* A record page that is the record's conversation (`.record({ conversation })`): a header, the messages that point at
|
|
1702
|
+
* the record, and a box that sends one. Its message fields name fields of `resource`; `subtitle` and `members` name
|
|
1703
|
+
* fields of the record.
|
|
1704
|
+
*/
|
|
1705
|
+
export type ConversationPageModel = {
|
|
1706
|
+
/** The message resource. */
|
|
1707
|
+
resource: string;
|
|
1708
|
+
/** The filterable relation of `resource` that holds this record's key, which each message sent gets too. */
|
|
1709
|
+
field: string;
|
|
1710
|
+
/** Who wrote each message: a relation, named as the record it points at, or a text field of user ids, named after the organization's members. */
|
|
1711
|
+
sender: string;
|
|
1712
|
+
/** When each message was sent: a date or timestamp field the API can sort by. */
|
|
1713
|
+
time: string;
|
|
1714
|
+
/** The message itself: a text field. */
|
|
1715
|
+
text: string;
|
|
1716
|
+
/** When the message was last changed, a date or timestamp field, empty for one never changed: a changed one says "(edited)". */
|
|
1717
|
+
edited?: string;
|
|
1718
|
+
/** The user ids a message mentions, a JSON field: `@` in the box lists the organization's members, and each pick lands here. */
|
|
1719
|
+
mentions?: string;
|
|
1720
|
+
/** A text field of the record shown beside its title in the header, such as a channel's topic. */
|
|
1721
|
+
subtitle?: string;
|
|
1722
|
+
/** A JSON field of the record holding user ids: the header names the people other than the reader, with their status, in place of the title. */
|
|
1723
|
+
members?: string;
|
|
1724
|
+
/** Where each reader's read position in the record is kept: the conversation opens on a "New messages" line and moves it as they read to the end. */
|
|
1725
|
+
readPosition?: ReadPositionModel;
|
|
1726
|
+
/** The hint in the empty box. */
|
|
1727
|
+
placeholder?: string;
|
|
1728
|
+
/** What the conversation says while it has no messages. */
|
|
1729
|
+
empty?: string;
|
|
1730
|
+
};
|
|
1731
|
+
/**
|
|
1732
|
+
* The resource that keeps how far each reader has read a record's conversation: one record per reader and record, its
|
|
1733
|
+
* `.author()` the reader, `field` a relation to the record and `message` the key of the newest message they read.
|
|
1734
|
+
*/
|
|
1735
|
+
export type ReadPositionModel = {
|
|
1736
|
+
/** The read position resource, which has an `.author()` field. */
|
|
1737
|
+
resource: string;
|
|
1738
|
+
/** The relation of `resource` that holds the record's key. */
|
|
1739
|
+
field: string;
|
|
1740
|
+
/** The integer field that holds the key of the newest message read; the message resource's key is one integer column. */
|
|
1741
|
+
message: string;
|
|
1696
1742
|
};
|
|
1697
1743
|
/** The list page's Export (`.export(...)`): how many rows a file may hold. */
|
|
1698
1744
|
export type ExportModel = {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/plugin-capabilities.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* What a plugin uses from Protobase, as `protobase build-plugin` records it in plugin.json, or what an app provides:
|
|
4
|
+
* the names imported from each module the app shares with plugins (`*` for the whole module, as `import * as` takes
|
|
5
|
+
* it), and the extension points filled, such as `components` or `shell.rightPanel`.
|
|
6
|
+
*/
|
|
7
|
+
export type PluginCapabilities = {
|
|
8
|
+
imports: Record<string, readonly string[]>;
|
|
9
|
+
extensionPoints: readonly string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* What `uses` names that `has` lacks, each as the notice shows it: `Name from module`, a whole `module`, or `the
|
|
13
|
+
* extension point name`. Empty when the app provides all of it, whatever versions it has.
|
|
14
|
+
*/
|
|
15
|
+
export declare const missingCapabilities: (uses: PluginCapabilities, has: PluginCapabilities) => string[];
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/plugin-capabilities.ts
|
|
2
|
+
/**
|
|
3
|
+
* What `uses` names that `has` lacks, each as the notice shows it: `Name from module`, a whole `module`, or `the
|
|
4
|
+
* extension point name`. Empty when the app provides all of it, whatever versions it has.
|
|
5
|
+
*/
|
|
6
|
+
const missingCapabilities = (uses, has) => {
|
|
7
|
+
const imports = Object.entries(uses.imports).flatMap(([module, names]) => {
|
|
8
|
+
const provided = has.imports[module];
|
|
9
|
+
if (provided === void 0) return [module];
|
|
10
|
+
return names.filter((name) => name !== "*" && !provided.includes(name)).map((name) => `${name} from ${module}`);
|
|
11
|
+
});
|
|
12
|
+
const extensionPoints = uses.extensionPoints.filter((point) => !has.extensionPoints.includes(point)).map((point) => `the extension point ${point}`);
|
|
13
|
+
return [...imports, ...extensionPoints];
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { missingCapabilities };
|
package/dist/plugin-version.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PluginCapabilities } from "./plugin-capabilities.js";
|
|
1
2
|
//#region src/plugin-version.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* Whether `version` is in `range`: comparators such as `>=0.12.0 <1.0.0`, separated by spaces, all of which must hold.
|
|
@@ -5,19 +6,23 @@
|
|
|
5
6
|
* in >=0.12.9 and <0.13.0, not in >=0.13.0. Undefined when the range is not one of those, or the version is no semver version.
|
|
6
7
|
*/
|
|
7
8
|
export declare const inRange: (version: string, range: string) => boolean | undefined;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* What a plugin's plugin.json says it is built for: a plugin API, what it uses from Protobase, and the Protobase versions
|
|
11
|
+
* it runs on when its author names them (`engines.protobase`).
|
|
12
|
+
*/
|
|
13
|
+
export type PluginRequirement = PluginCapabilities & {
|
|
10
14
|
api: number;
|
|
11
|
-
protobase
|
|
15
|
+
protobase?: string;
|
|
12
16
|
};
|
|
13
|
-
/** An app that loads plugins: the plugin API its @protobase/ui provides,
|
|
14
|
-
export type PluginHost = {
|
|
17
|
+
/** An app that loads plugins: the plugin API its @protobase/ui provides, its Protobase version, and what it provides. */
|
|
18
|
+
export type PluginHost = PluginCapabilities & {
|
|
15
19
|
api: number;
|
|
16
20
|
version: string;
|
|
17
21
|
};
|
|
18
22
|
/**
|
|
19
23
|
* Why an app does not load a plugin built for `requirement`, or undefined when it does: the plugin API must be the
|
|
20
|
-
* app's,
|
|
24
|
+
* app's, the app's Protobase version in the plugin's range when it names one, and the app must provide everything the
|
|
25
|
+
* plugin uses.
|
|
21
26
|
*/
|
|
22
27
|
export declare const pluginProblem: (requirement: PluginRequirement, host: PluginHost) => string | undefined;
|
|
23
28
|
//#endregion
|
package/dist/plugin-version.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { missingCapabilities } from "./plugin-capabilities.js";
|
|
1
2
|
import semver from "semver";
|
|
2
3
|
//#region src/plugin-version.ts
|
|
3
4
|
const isComparator = (text) => {
|
|
@@ -21,13 +22,18 @@ const inRange = (version, range) => {
|
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
23
24
|
* Why an app does not load a plugin built for `requirement`, or undefined when it does: the plugin API must be the
|
|
24
|
-
* app's,
|
|
25
|
+
* app's, the app's Protobase version in the plugin's range when it names one, and the app must provide everything the
|
|
26
|
+
* plugin uses.
|
|
25
27
|
*/
|
|
26
28
|
const pluginProblem = (requirement, host) => {
|
|
27
29
|
if (requirement.api !== host.api) return `it is built for plugin API ${requirement.api}, and this app has plugin API ${host.api}`;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
if (requirement.protobase !== void 0) {
|
|
31
|
+
const fits = inRange(host.version, requirement.protobase);
|
|
32
|
+
if (fits === void 0) return `its Protobase range "${requirement.protobase}" is not one this app reads, such as >=0.12.0`;
|
|
33
|
+
if (!fits) return `it needs Protobase ${requirement.protobase}, and this app runs ${host.version}`;
|
|
34
|
+
}
|
|
35
|
+
const missing = missingCapabilities(requirement, host);
|
|
36
|
+
if (missing.length > 0) return `it uses what this app does not have: ${missing.join(", ")}`;
|
|
31
37
|
};
|
|
32
38
|
//#endregion
|
|
33
39
|
export { inRange, pluginProblem };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/record-page.ts
|
|
2
|
+
/** The title rule that names a record after the people in a field of user ids other than the reader. */
|
|
3
|
+
const membersRule = "members";
|
|
4
|
+
/** What is wrong with the record page's own fields, those a conversation's header reads of the record; empty when nothing is. */
|
|
5
|
+
const recordPageErrors = (page, resource) => {
|
|
6
|
+
if (!page || !("conversation" in page)) return [];
|
|
7
|
+
const { subtitle, members } = page.conversation;
|
|
8
|
+
return [...subtitle === void 0 || Object.hasOwn(resource.fields, subtitle) ? [] : [`conversation subtitle names field "${subtitle}", which the resource does not have`], ...members === void 0 || Object.hasOwn(resource.fields, members) ? [] : [`conversation members names field "${members}", which the resource does not have`]];
|
|
9
|
+
};
|
|
10
|
+
/** The title a conversation page with `members` gives its record, after the people in it other than the reader. */
|
|
11
|
+
const membersTitle = (page) => {
|
|
12
|
+
if (!page || !("conversation" in page) || page.conversation.members === void 0) return;
|
|
13
|
+
return { titleFrom: {
|
|
14
|
+
rule: membersRule,
|
|
15
|
+
fields: [page.conversation.members]
|
|
16
|
+
} };
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { membersRule, membersTitle, recordPageErrors };
|
package/dist/view.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionModel, AppAddress, CreateModel, ExportModel, FilterWidgetModel, HelpWhen, LayoutItemModel, ListDisplayModel, ListDragModel, NavModel, NavRecentModel, PageWidth, RecordMode, ResourceModel, SaveFeedback, SaveSearchModel, SignInPromptModel, ViewModel } from "./model.js";
|
|
1
|
+
import { ActionModel, AppAddress, ConversationPageModel, CreateModel, ExportModel, FilterWidgetModel, HelpWhen, LayoutItemModel, ListDisplayModel, ListDragModel, NavModel, NavRecentModel, PageWidth, RecordMode, ResourceModel, SaveFeedback, SaveSearchModel, SignInPromptModel, ViewModel } from "./model.js";
|
|
2
2
|
import { FieldRefs, Ref } from "./refs.js";
|
|
3
3
|
import { actions } from "./view-actions.js";
|
|
4
4
|
import { ChartInput } from "./view-chart.js";
|
|
@@ -218,10 +218,17 @@ export declare class ViewBuilder<R extends {
|
|
|
218
218
|
* `focus: true` draws it on a focus page, with the bar's state, Save, the record's actions and panels; the form
|
|
219
219
|
* `(r) => ({ surface: r.body })` needs no component: the surface is one field, drawn by its field type. See
|
|
220
220
|
* [Focus pages](docs/website/src/content/docs/reference/ui-config.mdx#focus-pages).
|
|
221
|
+
*
|
|
222
|
+
* `conversation` makes the page the record's conversation, filling the area with no component of the app's own: a
|
|
223
|
+
* header, the messages that point at the record and a box that sends one. A conversation with `members` titles its
|
|
224
|
+
* record after them for each reader, as `.titleFrom('members', ...)` does, unless the view sets its own. See
|
|
225
|
+
* [Conversation pages](docs/website/src/content/docs/reference/ui-config.mdx#conversation-pages).
|
|
221
226
|
*/
|
|
222
227
|
record(options: {
|
|
223
228
|
component: ComponentRef<never>;
|
|
224
229
|
focus?: boolean;
|
|
230
|
+
} | {
|
|
231
|
+
conversation: ConversationPageModel;
|
|
225
232
|
} | ((r: FieldRefs<FieldsOf<R>>) => {
|
|
226
233
|
surface: Ref;
|
|
227
234
|
})): ViewBuilder<R>;
|
package/dist/view.js
CHANGED
|
@@ -5,6 +5,7 @@ import { layoutItems } from "./layout-items.js";
|
|
|
5
5
|
import { isMenuHref } from "./menu-href.js";
|
|
6
6
|
import { viewOfList } from "./named-list.js";
|
|
7
7
|
import { navRecentErrors } from "./nav-recent.js";
|
|
8
|
+
import { membersTitle, recordPageErrors } from "./record-page.js";
|
|
8
9
|
import { navStartErrors } from "./nav-start.js";
|
|
9
10
|
import { actions } from "./view-actions.js";
|
|
10
11
|
import { chartModel } from "./view-chart.js";
|
|
@@ -310,13 +311,19 @@ var ViewBuilder = class ViewBuilder {
|
|
|
310
311
|
* `focus: true` draws it on a focus page, with the bar's state, Save, the record's actions and panels; the form
|
|
311
312
|
* `(r) => ({ surface: r.body })` needs no component: the surface is one field, drawn by its field type. See
|
|
312
313
|
* [Focus pages](docs/website/src/content/docs/reference/ui-config.mdx#focus-pages).
|
|
314
|
+
*
|
|
315
|
+
* `conversation` makes the page the record's conversation, filling the area with no component of the app's own: a
|
|
316
|
+
* header, the messages that point at the record and a box that sends one. A conversation with `members` titles its
|
|
317
|
+
* record after them for each reader, as `.titleFrom('members', ...)` does, unless the view sets its own. See
|
|
318
|
+
* [Conversation pages](docs/website/src/content/docs/reference/ui-config.mdx#conversation-pages).
|
|
313
319
|
*/
|
|
314
320
|
record(options) {
|
|
315
|
-
|
|
321
|
+
if (typeof options === "function") return this.next({ record: { surface: options(this.refs()).surface.name } });
|
|
322
|
+
if ("conversation" in options) return this.next({ record: { conversation: structuredClone(options.conversation) } });
|
|
323
|
+
return this.next({ record: {
|
|
316
324
|
component: customComponent(options.component, "record component"),
|
|
317
325
|
...options.focus && { focus: true }
|
|
318
|
-
};
|
|
319
|
-
return this.next({ record });
|
|
326
|
+
} });
|
|
320
327
|
}
|
|
321
328
|
/**
|
|
322
329
|
* A record's page opens `to` in its place, replacing the address in the history, `{{field}}` in its resource, key and
|
|
@@ -426,8 +433,13 @@ var ViewBuilder = class ViewBuilder {
|
|
|
426
433
|
const opensUnknown = resource ? (this.state.recordOpens ?? []).flatMap(addressPlaceholders).find((name) => !Object.hasOwn(resource.fields, name)) : void 0;
|
|
427
434
|
if (opensUnknown !== void 0) throw new Error(`View "${this.state.resource}": recordOpens names field "${opensUnknown}", which the resource does not have`);
|
|
428
435
|
if (this.state.lists?.length && (listOf !== void 0 || this.state.searchesOf)) throw new Error(`View "${this.state.resource}": named lists cannot go with listOf or searchesOf, which replace the list page`);
|
|
436
|
+
const pageErrors = resource ? recordPageErrors(this.state.record, resource) : [];
|
|
437
|
+
if (pageErrors.length > 0) throw new Error(`View "${this.state.resource}": record ${pageErrors.join("; ")}`);
|
|
429
438
|
for (const named of this.state.lists ?? []) new ViewBuilder(viewOfList(this.state, named.name)).toModel(resource);
|
|
430
|
-
return structuredClone(
|
|
439
|
+
return structuredClone({
|
|
440
|
+
...this.state,
|
|
441
|
+
...!titleFrom && membersTitle(this.state.record)
|
|
442
|
+
});
|
|
431
443
|
}
|
|
432
444
|
refs() {
|
|
433
445
|
return createRefs(ref);
|