@ai-matrx/records-ui 0.52.0 → 0.56.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/CHANGELOG.md +126 -0
- package/dist/index.cjs +156 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +156 -22
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1109,6 +1109,7 @@ declare function whatIsMissing(state: {
|
|
|
1109
1109
|
|
|
1110
1110
|
declare const NO_RULES_YET = "Nothing has to be true to get here yet.";
|
|
1111
1111
|
declare const NEEDS_A_SENTENCE = "Write the sentence somebody reads when this stops them, the way you would say it out loud.";
|
|
1112
|
+
declare const NOT_DRAWN_HERE = "This part of the rule is not something this builder can draw yet";
|
|
1112
1113
|
interface StageRulesSectionProps {
|
|
1113
1114
|
tableId: Uuid;
|
|
1114
1115
|
/** Which stage's rules to edit. Left out, the section opens on the first stage. */
|
|
@@ -1139,6 +1140,23 @@ interface ConditionRowProps {
|
|
|
1139
1140
|
emptyLabel?: string;
|
|
1140
1141
|
className?: string | undefined;
|
|
1141
1142
|
}
|
|
1143
|
+
/**
|
|
1144
|
+
* CAN THIS ROW DRAW THAT CONDITION? The builder writes ONE clause — a field, a comparison
|
|
1145
|
+
* and a value — and the store's Rule language is bigger than that. A node it cannot draw
|
|
1146
|
+
* (a `sibling_count`, an `and`/`or`, a comparison between two columns) rendered as an empty
|
|
1147
|
+
* picker is a screen SAYING there is no condition when there is one, and it invites somebody
|
|
1148
|
+
* to replace a rule they cannot see. Every caller asks this first and says so instead.
|
|
1149
|
+
*
|
|
1150
|
+
* Found by a screenshot: the homeowner's own rule — "a second quote from a DIFFERENT
|
|
1151
|
+
* contractor", a `sibling_count` — opened in the editor as "— pick a column —".
|
|
1152
|
+
*/
|
|
1153
|
+
declare function conditionIsSimple(expr: RuleExpression | Record<string, unknown> | null | undefined): boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* What a condition this row cannot draw actually ASKS, in the words the store uses for it.
|
|
1156
|
+
* Not a pretty-printer for the whole Rule language — enough that a person reading a rule
|
|
1157
|
+
* they cannot edit here still knows what it does before deciding to replace it.
|
|
1158
|
+
*/
|
|
1159
|
+
declare function conditionInWords(expr: RuleExpression | Record<string, unknown> | null | undefined, fields: ConditionField[]): string;
|
|
1142
1160
|
/**
|
|
1143
1161
|
* A value typed into a text box, as the store should hold it. A number column compared
|
|
1144
1162
|
* against the text "5000" is not the comparison anybody meant, and the store has no way
|
|
@@ -2796,4 +2814,4 @@ interface PipelineBoardProps {
|
|
|
2796
2814
|
}
|
|
2797
2815
|
declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
|
|
2798
2816
|
|
|
2799
|
-
export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, CommentThread, type CommentThreadProps, type ConditionField, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, HistoryPanel, type HistoryPanelProps, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, LEVEL_WORD, type LabelLookup, MACHINE_IDENTITY, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NO_AGENT_PORT, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, lastChangeSentence, machineIdentityIn, memberName, nextInWords, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords };
|
|
2817
|
+
export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, CommentThread, type CommentThreadProps, type ConditionField, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, HistoryPanel, type HistoryPanelProps, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, LEVEL_WORD, type LabelLookup, MACHINE_IDENTITY, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NOT_DRAWN_HERE, NO_AGENT_PORT, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsSimple, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, lastChangeSentence, machineIdentityIn, memberName, nextInWords, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords };
|
package/dist/index.d.ts
CHANGED
|
@@ -1109,6 +1109,7 @@ declare function whatIsMissing(state: {
|
|
|
1109
1109
|
|
|
1110
1110
|
declare const NO_RULES_YET = "Nothing has to be true to get here yet.";
|
|
1111
1111
|
declare const NEEDS_A_SENTENCE = "Write the sentence somebody reads when this stops them, the way you would say it out loud.";
|
|
1112
|
+
declare const NOT_DRAWN_HERE = "This part of the rule is not something this builder can draw yet";
|
|
1112
1113
|
interface StageRulesSectionProps {
|
|
1113
1114
|
tableId: Uuid;
|
|
1114
1115
|
/** Which stage's rules to edit. Left out, the section opens on the first stage. */
|
|
@@ -1139,6 +1140,23 @@ interface ConditionRowProps {
|
|
|
1139
1140
|
emptyLabel?: string;
|
|
1140
1141
|
className?: string | undefined;
|
|
1141
1142
|
}
|
|
1143
|
+
/**
|
|
1144
|
+
* CAN THIS ROW DRAW THAT CONDITION? The builder writes ONE clause — a field, a comparison
|
|
1145
|
+
* and a value — and the store's Rule language is bigger than that. A node it cannot draw
|
|
1146
|
+
* (a `sibling_count`, an `and`/`or`, a comparison between two columns) rendered as an empty
|
|
1147
|
+
* picker is a screen SAYING there is no condition when there is one, and it invites somebody
|
|
1148
|
+
* to replace a rule they cannot see. Every caller asks this first and says so instead.
|
|
1149
|
+
*
|
|
1150
|
+
* Found by a screenshot: the homeowner's own rule — "a second quote from a DIFFERENT
|
|
1151
|
+
* contractor", a `sibling_count` — opened in the editor as "— pick a column —".
|
|
1152
|
+
*/
|
|
1153
|
+
declare function conditionIsSimple(expr: RuleExpression | Record<string, unknown> | null | undefined): boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* What a condition this row cannot draw actually ASKS, in the words the store uses for it.
|
|
1156
|
+
* Not a pretty-printer for the whole Rule language — enough that a person reading a rule
|
|
1157
|
+
* they cannot edit here still knows what it does before deciding to replace it.
|
|
1158
|
+
*/
|
|
1159
|
+
declare function conditionInWords(expr: RuleExpression | Record<string, unknown> | null | undefined, fields: ConditionField[]): string;
|
|
1142
1160
|
/**
|
|
1143
1161
|
* A value typed into a text box, as the store should hold it. A number column compared
|
|
1144
1162
|
* against the text "5000" is not the comparison anybody meant, and the store has no way
|
|
@@ -2796,4 +2814,4 @@ interface PipelineBoardProps {
|
|
|
2796
2814
|
}
|
|
2797
2815
|
declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
|
|
2798
2816
|
|
|
2799
|
-
export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, CommentThread, type CommentThreadProps, type ConditionField, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, HistoryPanel, type HistoryPanelProps, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, LEVEL_WORD, type LabelLookup, MACHINE_IDENTITY, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NO_AGENT_PORT, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, lastChangeSentence, machineIdentityIn, memberName, nextInWords, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords };
|
|
2817
|
+
export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, CommentThread, type CommentThreadProps, type ConditionField, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, HistoryPanel, type HistoryPanelProps, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, LEVEL_WORD, type LabelLookup, MACHINE_IDENTITY, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NOT_DRAWN_HERE, NO_AGENT_PORT, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsSimple, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, lastChangeSentence, machineIdentityIn, memberName, nextInWords, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords };
|
package/dist/index.js
CHANGED
|
@@ -2539,7 +2539,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
2539
2539
|
import { useState as useState8 } from "react";
|
|
2540
2540
|
import { Badge as Badge4, Button as Button6, Separator } from "@ai-matrx/design-system";
|
|
2541
2541
|
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2542
|
-
function PastePreview({ plan, noun, onConfirm, onCancel }) {
|
|
2542
|
+
function PastePreview({ plan, noun, nounPlural, onConfirm, onCancel }) {
|
|
2543
2543
|
const [busy, setBusy] = useState8(false);
|
|
2544
2544
|
const [outcome, setOutcome] = useState8(null);
|
|
2545
2545
|
const nothingToDo = plan.cells === 0;
|
|
@@ -2559,7 +2559,7 @@ function PastePreview({ plan, noun, onConfirm, onCancel }) {
|
|
|
2559
2559
|
/* @__PURE__ */ jsx11(Separator, {}),
|
|
2560
2560
|
outcome === null ? /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
2561
2561
|
nothingToDo ? /* @__PURE__ */ jsx11("p", { className: "text-sm", children: "Nothing in what you pasted can be written to this table. Every cell is listed below with the reason." }) : /* @__PURE__ */ jsxs7("p", { className: "text-sm", children: [
|
|
2562
|
-
sentence(plan, noun),
|
|
2562
|
+
sentence(plan, noun, nounPlural),
|
|
2563
2563
|
" The values below are exactly what will be stored."
|
|
2564
2564
|
] }),
|
|
2565
2565
|
/* @__PURE__ */ jsx11(PlanTable, { plan }),
|
|
@@ -2599,7 +2599,7 @@ function PastePreview({ plan, noun, onConfirm, onCancel }) {
|
|
|
2599
2599
|
setBusy(true);
|
|
2600
2600
|
void onConfirm().then(setOutcome).finally(() => setBusy(false));
|
|
2601
2601
|
},
|
|
2602
|
-
children: busy ? "Writing\u2026" : confirmLabel(plan, noun)
|
|
2602
|
+
children: busy ? "Writing\u2026" : confirmLabel(plan, noun, nounPlural)
|
|
2603
2603
|
}
|
|
2604
2604
|
)
|
|
2605
2605
|
] })
|
|
@@ -2654,19 +2654,19 @@ function plural(n, one, many) {
|
|
|
2654
2654
|
function summarize(plan) {
|
|
2655
2655
|
return `${plural(plan.cells, "value", "values")} across ${plural(plan.rows.length, "row", "rows")}`;
|
|
2656
2656
|
}
|
|
2657
|
-
function sentence(plan, noun) {
|
|
2657
|
+
function sentence(plan, noun, nounPlural) {
|
|
2658
2658
|
const parts = [];
|
|
2659
|
-
if (plan.updates > 0) parts.push(`change ${plural(plan.updates, noun,
|
|
2660
|
-
if (plan.creates > 0) parts.push(`create ${plural(plan.creates, `new ${noun}`, `new ${
|
|
2659
|
+
if (plan.updates > 0) parts.push(`change ${plural(plan.updates, noun, nounPlural)}`);
|
|
2660
|
+
if (plan.creates > 0) parts.push(`create ${plural(plan.creates, `new ${noun}`, `new ${nounPlural}`)}`);
|
|
2661
2661
|
const what = parts.length === 2 ? `${parts[0]} and ${parts[1]}` : parts[0] ?? "write nothing";
|
|
2662
2662
|
return `This will ${what}.`;
|
|
2663
2663
|
}
|
|
2664
|
-
function confirmLabel(plan, noun) {
|
|
2664
|
+
function confirmLabel(plan, noun, nounPlural) {
|
|
2665
2665
|
if (plan.creates > 0 && plan.updates === 0) {
|
|
2666
|
-
return `Create ${plural(plan.creates, noun,
|
|
2666
|
+
return `Create ${plural(plan.creates, noun, nounPlural)}`;
|
|
2667
2667
|
}
|
|
2668
2668
|
if (plan.creates > 0) return `Write ${plural(plan.rows.length, "row", "rows")}`;
|
|
2669
|
-
return `Update ${plural(plan.updates, noun,
|
|
2669
|
+
return `Update ${plural(plan.updates, noun, nounPlural)}`;
|
|
2670
2670
|
}
|
|
2671
2671
|
|
|
2672
2672
|
// src/pasteValues.ts
|
|
@@ -2701,13 +2701,21 @@ function valueFromPastedText(field, raw) {
|
|
|
2701
2701
|
return { value: negative ? -n : n };
|
|
2702
2702
|
}
|
|
2703
2703
|
case "datetime": {
|
|
2704
|
+
const wantsTime = String(field.config?.["kind"] ?? "date") === "datetime";
|
|
2705
|
+
const plainDay = /^\s*(\d{4})-(\d{2})-(\d{2})\s*$/.exec(raw);
|
|
2706
|
+
if (!wantsTime && plainDay) return { value: `${plainDay[1]}-${plainDay[2]}-${plainDay[3]}` };
|
|
2704
2707
|
const at = Date.parse(text);
|
|
2705
2708
|
if (Number.isNaN(at)) {
|
|
2706
2709
|
return {
|
|
2707
2710
|
refusal: `${label} holds a date, and \u201C${raw}\u201D is not one this can read. Paste it as 2026-09-21, or as your spreadsheet's own date format.`
|
|
2708
2711
|
};
|
|
2709
2712
|
}
|
|
2710
|
-
|
|
2713
|
+
const parsed = new Date(at);
|
|
2714
|
+
if (wantsTime) return { value: parsed.toISOString() };
|
|
2715
|
+
const y = parsed.getFullYear();
|
|
2716
|
+
const m = String(parsed.getMonth() + 1).padStart(2, "0");
|
|
2717
|
+
const d = String(parsed.getDate()).padStart(2, "0");
|
|
2718
|
+
return { value: `${y}-${m}-${d}` };
|
|
2711
2719
|
}
|
|
2712
2720
|
case "json": {
|
|
2713
2721
|
try {
|
|
@@ -2898,42 +2906,55 @@ function Grid({
|
|
|
2898
2906
|
const fieldList = fields.data ?? [];
|
|
2899
2907
|
const byRecord = /* @__PURE__ */ new Map();
|
|
2900
2908
|
const order = [];
|
|
2901
|
-
|
|
2902
|
-
let held = byRecord.get(
|
|
2909
|
+
const take = (rowId, columnId, value) => {
|
|
2910
|
+
let held = byRecord.get(rowId);
|
|
2903
2911
|
if (held === void 0) {
|
|
2904
2912
|
held = {};
|
|
2905
|
-
byRecord.set(
|
|
2906
|
-
order.push(
|
|
2913
|
+
byRecord.set(rowId, held);
|
|
2914
|
+
order.push(rowId);
|
|
2907
2915
|
}
|
|
2908
|
-
held[
|
|
2916
|
+
held[columnId] = value === null || value === void 0 ? "" : String(value);
|
|
2917
|
+
};
|
|
2918
|
+
for (const patch of sheetPlan.accepted) take(patch.rowId, patch.columnId, patch.value);
|
|
2919
|
+
for (const refused of sheetPlan.refusals) {
|
|
2920
|
+
if (refused.rowId === null) continue;
|
|
2921
|
+
take(refused.rowId, refused.columnId, refused.value);
|
|
2909
2922
|
}
|
|
2923
|
+
const onScreen = rows.map((r) => r.id).filter((id) => byRecord.has(id));
|
|
2924
|
+
const touched = [...onScreen, ...order.filter((id) => !onScreen.includes(id))];
|
|
2910
2925
|
const columnKeys = Array.from(
|
|
2911
2926
|
/* @__PURE__ */ new Set([
|
|
2912
2927
|
...sheetPlan.accepted.map((p) => p.columnId),
|
|
2928
|
+
...sheetPlan.refusals.map((r) => r.columnId),
|
|
2913
2929
|
...sheetPlan.overflow.flatMap((row) => Object.keys(row))
|
|
2914
2930
|
])
|
|
2915
2931
|
);
|
|
2916
2932
|
const built = planPastedBlock({
|
|
2917
2933
|
fields: fieldList,
|
|
2918
2934
|
columnKeys,
|
|
2919
|
-
onExisting:
|
|
2935
|
+
onExisting: touched.map((recordId) => ({
|
|
2920
2936
|
recordId,
|
|
2921
2937
|
raw: columnKeys.map((key) => byRecord.get(recordId)?.[key])
|
|
2922
2938
|
})),
|
|
2923
2939
|
onNew: sheetPlan.overflow.map((row) => columnKeys.map((key) => row[key])),
|
|
2924
2940
|
pastRightEdge: sheetPlan.pastRightEdge
|
|
2925
2941
|
});
|
|
2942
|
+
const notWritable = /* @__PURE__ */ new Map();
|
|
2926
2943
|
for (const refused of sheetPlan.refusals) {
|
|
2944
|
+
if (built.refusals.some((r) => r.column === columnLabel(fieldList, refused.columnId))) continue;
|
|
2945
|
+
notWritable.set(refused.columnId, refused.reason);
|
|
2946
|
+
}
|
|
2947
|
+
for (const [columnId, why] of notWritable) {
|
|
2927
2948
|
built.refusals.push({
|
|
2928
2949
|
fromLine: 0,
|
|
2929
|
-
column:
|
|
2950
|
+
column: columnLabel(fieldList, columnId),
|
|
2930
2951
|
raw: "",
|
|
2931
|
-
why
|
|
2952
|
+
why
|
|
2932
2953
|
});
|
|
2933
2954
|
}
|
|
2934
2955
|
setPastePlan({ plan: built });
|
|
2935
2956
|
},
|
|
2936
|
-
[fields.data]
|
|
2957
|
+
[fields.data, rows]
|
|
2937
2958
|
);
|
|
2938
2959
|
const applyPaste = useCallback6(async () => {
|
|
2939
2960
|
const held = pastePlan;
|
|
@@ -3244,6 +3265,7 @@ function Grid({
|
|
|
3244
3265
|
{
|
|
3245
3266
|
plan: pastePlan.plan,
|
|
3246
3267
|
noun: table.data?.label_singular ?? "record",
|
|
3268
|
+
nounPlural: table.data?.label_plural ?? `${table.data?.label_singular ?? "record"}s`,
|
|
3247
3269
|
onConfirm: applyPaste,
|
|
3248
3270
|
onCancel: () => setPastePlan(null)
|
|
3249
3271
|
}
|
|
@@ -3261,6 +3283,10 @@ function Grid({
|
|
|
3261
3283
|
] })
|
|
3262
3284
|
] }) });
|
|
3263
3285
|
}
|
|
3286
|
+
function columnLabel(fields, columnId) {
|
|
3287
|
+
const field = fields.find((f) => f.key === columnId);
|
|
3288
|
+
return field ? fieldName(field) : humanize(columnId);
|
|
3289
|
+
}
|
|
3264
3290
|
function AddFieldButton({ onClick }) {
|
|
3265
3291
|
return /* @__PURE__ */ jsx12(
|
|
3266
3292
|
Button7,
|
|
@@ -4621,6 +4647,60 @@ var CONDITION_OPS = [
|
|
|
4621
4647
|
{ op: "gt", label: "is more than" },
|
|
4622
4648
|
{ op: "lt", label: "is less than" }
|
|
4623
4649
|
];
|
|
4650
|
+
function conditionIsSimple(expr) {
|
|
4651
|
+
if (expr === null || expr === void 0) return true;
|
|
4652
|
+
const node = expr;
|
|
4653
|
+
if (typeof node.op !== "string" || !CONDITION_OPS.some((c) => c.op === node.op)) return false;
|
|
4654
|
+
if (!Array.isArray(node.args)) return false;
|
|
4655
|
+
const first = node.args[0];
|
|
4656
|
+
if (!first || typeof first.field !== "string") return false;
|
|
4657
|
+
if (node.op === "present") return node.args.length === 1;
|
|
4658
|
+
const second = node.args[1];
|
|
4659
|
+
return node.args.length === 2 && !!second && "const" in second;
|
|
4660
|
+
}
|
|
4661
|
+
function conditionInWords(expr, fields) {
|
|
4662
|
+
const name = (id) => {
|
|
4663
|
+
const f = fields.find((x) => x.id === id);
|
|
4664
|
+
return f ? f.label || f.key : "a column";
|
|
4665
|
+
};
|
|
4666
|
+
const said = {
|
|
4667
|
+
eq: "is",
|
|
4668
|
+
ne: "is not",
|
|
4669
|
+
gt: "is more than",
|
|
4670
|
+
lt: "is less than",
|
|
4671
|
+
gte: "is at least",
|
|
4672
|
+
lte: "is at most",
|
|
4673
|
+
and: "and",
|
|
4674
|
+
or: "or",
|
|
4675
|
+
matches: "matches"
|
|
4676
|
+
};
|
|
4677
|
+
const walk = (node) => {
|
|
4678
|
+
if (node === null || node === void 0) return "nothing";
|
|
4679
|
+
const n = node;
|
|
4680
|
+
if ("const" in n) return JSON.stringify(n["const"]);
|
|
4681
|
+
if (typeof n["field"] === "string" && !("op" in n)) return name(n["field"]);
|
|
4682
|
+
const op = typeof n["op"] === "string" ? n["op"] : "";
|
|
4683
|
+
if (op === "previous" && typeof n["field"] === "string") return `what ${name(n["field"])} used to say`;
|
|
4684
|
+
if (op === "sibling_count") {
|
|
4685
|
+
const same = n["same"] ?? [];
|
|
4686
|
+
const differs = n["differs"] ?? [];
|
|
4687
|
+
const sameWords = same.length > 0 ? ` for the same ${same.map(name).join(" and ")}` : "";
|
|
4688
|
+
const diffWords = differs.length > 0 ? ` from a different ${differs.map(name).join(" and ")}` : "";
|
|
4689
|
+
return `how many others there are${sameWords}${diffWords}`;
|
|
4690
|
+
}
|
|
4691
|
+
if (op === "stage_count") return "how many are in that column already";
|
|
4692
|
+
if (op === "actor_at_least") return `whoever is moving it is at least ${String(n["level"] ?? "somebody")}`;
|
|
4693
|
+
const args = Array.isArray(n["args"]) ? n["args"] : [];
|
|
4694
|
+
if (op === "not") return `not ${walk(args[0])}`;
|
|
4695
|
+
if (op === "present") return `${walk(args[0])} has been answered`;
|
|
4696
|
+
const word = said[op] ?? op;
|
|
4697
|
+
if (op === "and" || op === "or") return args.map(walk).join(` ${word} `);
|
|
4698
|
+
if (args.length === 2) return `${walk(args[0])} ${word} ${walk(args[1])}`;
|
|
4699
|
+
if (args.length === 1) return `${walk(args[0])} ${word}`;
|
|
4700
|
+
return op;
|
|
4701
|
+
};
|
|
4702
|
+
return walk(expr);
|
|
4703
|
+
}
|
|
4624
4704
|
function conditionValue(typed) {
|
|
4625
4705
|
const trimmed = typed.trim();
|
|
4626
4706
|
if (trimmed === "") return typed;
|
|
@@ -4692,6 +4772,7 @@ function ConditionRow({ lead, expr, fields, onChange, emptyLabel = "always", cla
|
|
|
4692
4772
|
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4693
4773
|
var NO_RULES_YET = "Nothing has to be true to get here yet.";
|
|
4694
4774
|
var NEEDS_A_SENTENCE = "Write the sentence somebody reads when this stops them, the way you would say it out loud.";
|
|
4775
|
+
var NOT_DRAWN_HERE = "This part of the rule is not something this builder can draw yet";
|
|
4695
4776
|
var ON_FAIL = [
|
|
4696
4777
|
{ value: "refuse", label: "Turn it away", note: "The card stays where it is and the person is told why." },
|
|
4697
4778
|
{
|
|
@@ -4872,7 +4953,7 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
4872
4953
|
}
|
|
4873
4954
|
),
|
|
4874
4955
|
/* @__PURE__ */ jsx18(
|
|
4875
|
-
|
|
4956
|
+
Clause,
|
|
4876
4957
|
{
|
|
4877
4958
|
lead: "When",
|
|
4878
4959
|
emptyLabel: "every card",
|
|
@@ -4882,7 +4963,7 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
4882
4963
|
}
|
|
4883
4964
|
),
|
|
4884
4965
|
/* @__PURE__ */ jsx18(
|
|
4885
|
-
|
|
4966
|
+
Clause,
|
|
4886
4967
|
{
|
|
4887
4968
|
lead: "it cannot get here unless",
|
|
4888
4969
|
emptyLabel: "\u2014 pick a column \u2014",
|
|
@@ -4926,6 +5007,50 @@ function StageRulesSection({ tableId, stage, className }) {
|
|
|
4926
5007
|
/* @__PURE__ */ jsx18(Separator5, {})
|
|
4927
5008
|
] });
|
|
4928
5009
|
}
|
|
5010
|
+
function Clause({
|
|
5011
|
+
lead,
|
|
5012
|
+
emptyLabel,
|
|
5013
|
+
expr,
|
|
5014
|
+
fields,
|
|
5015
|
+
onChange
|
|
5016
|
+
}) {
|
|
5017
|
+
const [replacing, setReplacing] = useState14(false);
|
|
5018
|
+
const drawable = conditionIsSimple(expr) || replacing;
|
|
5019
|
+
if (drawable) {
|
|
5020
|
+
return /* @__PURE__ */ jsx18(
|
|
5021
|
+
ConditionRow,
|
|
5022
|
+
{
|
|
5023
|
+
lead,
|
|
5024
|
+
emptyLabel,
|
|
5025
|
+
expr: replacing && !conditionIsSimple(expr) ? null : expr,
|
|
5026
|
+
fields,
|
|
5027
|
+
onChange
|
|
5028
|
+
}
|
|
5029
|
+
);
|
|
5030
|
+
}
|
|
5031
|
+
return /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-1 text-xs", "data-testid": "stage-rule-clause-in-words", children: [
|
|
5032
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: lead }),
|
|
5033
|
+
/* @__PURE__ */ jsx18("span", { className: "font-medium", children: conditionInWords(expr, fields) }),
|
|
5034
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground", children: [
|
|
5035
|
+
"\u2014 ",
|
|
5036
|
+
NOT_DRAWN_HERE,
|
|
5037
|
+
", so it is shown as it reads."
|
|
5038
|
+
] }),
|
|
5039
|
+
/* @__PURE__ */ jsx18(
|
|
5040
|
+
Button12,
|
|
5041
|
+
{
|
|
5042
|
+
size: "sm",
|
|
5043
|
+
variant: "ghost",
|
|
5044
|
+
className: "h-6",
|
|
5045
|
+
onClick: () => {
|
|
5046
|
+
setReplacing(true);
|
|
5047
|
+
onChange(null);
|
|
5048
|
+
},
|
|
5049
|
+
children: "Replace it"
|
|
5050
|
+
}
|
|
5051
|
+
)
|
|
5052
|
+
] });
|
|
5053
|
+
}
|
|
4929
5054
|
|
|
4930
5055
|
// src/TableSettings.tsx
|
|
4931
5056
|
import { useState as useState15 } from "react";
|
|
@@ -6250,6 +6375,7 @@ function Card({
|
|
|
6250
6375
|
|
|
6251
6376
|
// src/ViewSwitcher.tsx
|
|
6252
6377
|
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
6378
|
+
var NO_FIELDS = [];
|
|
6253
6379
|
function useViewRecords(view, pageSize = 200) {
|
|
6254
6380
|
const client = useRecordsClient16();
|
|
6255
6381
|
const table = useRecords4(view.ruleId ? null : view.subject, { pageSize });
|
|
@@ -6619,7 +6745,12 @@ function Card2({
|
|
|
6619
6745
|
onOpenRecord
|
|
6620
6746
|
}) {
|
|
6621
6747
|
const host = useRecordsUi();
|
|
6622
|
-
const
|
|
6748
|
+
const wanted = useMemo17(
|
|
6749
|
+
() => field && pointsAtRecords(field) ? [field] : NO_FIELDS,
|
|
6750
|
+
[field]
|
|
6751
|
+
);
|
|
6752
|
+
const labels = useRecordLabels(wanted);
|
|
6753
|
+
const label = field ? scalarText(field, (record.document ?? {})[field.key], labels) : rowName(record, null, "Untitled");
|
|
6623
6754
|
return /* @__PURE__ */ jsx25(
|
|
6624
6755
|
"button",
|
|
6625
6756
|
{
|
|
@@ -14262,6 +14393,7 @@ export {
|
|
|
14262
14393
|
MyChecklistSteps,
|
|
14263
14394
|
NEEDS_A_SENTENCE,
|
|
14264
14395
|
NOT_ANSWERED_YET,
|
|
14396
|
+
NOT_DRAWN_HERE,
|
|
14265
14397
|
NO_AGENT_PORT,
|
|
14266
14398
|
NO_CHAT_REASON,
|
|
14267
14399
|
NO_COLUMNS_WHY,
|
|
@@ -14330,6 +14462,8 @@ export {
|
|
|
14330
14462
|
chooseSurface,
|
|
14331
14463
|
colorFromTheValue,
|
|
14332
14464
|
columnForField,
|
|
14465
|
+
conditionInWords,
|
|
14466
|
+
conditionIsSimple,
|
|
14333
14467
|
conditionValue,
|
|
14334
14468
|
controlFor,
|
|
14335
14469
|
currencyCodeFor,
|