@mistriwork/kit 1.0.0-rc.10 → 1.0.0-rc.12
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/client/actionGrants.d.ts +21 -0
- package/dist/client/actionGrants.js +24 -0
- package/dist/client/addressMount.d.ts +67 -0
- package/dist/client/addressMount.js +136 -0
- package/dist/client/app.d.ts +10 -0
- package/dist/client/app.js +976 -0
- package/dist/client/boot.d.ts +1 -0
- package/dist/client/boot.js +37 -0
- package/dist/client/brandLook.css +125 -0
- package/dist/client/breakdownBatch.d.ts +34 -0
- package/dist/client/breakdownBatch.js +115 -0
- package/dist/client/bulkActions.d.ts +66 -0
- package/dist/client/bulkActions.js +171 -0
- package/dist/client/chart.d.ts +20 -0
- package/dist/client/chart.js +80 -0
- package/dist/client/clauses.d.ts +121 -0
- package/dist/client/clauses.js +276 -0
- package/dist/client/columns.d.ts +77 -0
- package/dist/client/columns.js +102 -0
- package/dist/client/components/Accordion.d.ts +26 -0
- package/dist/client/components/Accordion.js +44 -0
- package/dist/client/components/ApiOperations.d.ts +3 -0
- package/dist/client/components/ApiOperations.js +162 -0
- package/dist/client/components/AppColumnMenu.d.ts +66 -0
- package/dist/client/components/AppColumnMenu.js +59 -0
- package/dist/client/components/AppColumnMenuPopups.d.ts +21 -0
- package/dist/client/components/AppColumnMenuPopups.js +92 -0
- package/dist/client/components/AppFooter.css +17 -0
- package/dist/client/components/AppFooter.d.ts +23 -0
- package/dist/client/components/AppFooter.js +12 -0
- package/dist/client/components/AppIssues.d.ts +4 -0
- package/dist/client/components/AppIssues.js +18 -0
- package/dist/client/components/AppList.d.ts +20 -0
- package/dist/client/components/AppList.js +696 -0
- package/dist/client/components/AttachmentList.d.ts +45 -0
- package/dist/client/components/AttachmentList.js +178 -0
- package/dist/client/components/BoardList.css +9 -0
- package/dist/client/components/Breakdown.d.ts +11 -0
- package/dist/client/components/Breakdown.js +157 -0
- package/dist/client/components/BreakdownRoom.d.ts +4 -0
- package/dist/client/components/BreakdownRoom.js +48 -0
- package/dist/client/components/CardsList.d.ts +23 -0
- package/dist/client/components/CardsList.js +209 -0
- package/dist/client/components/Chart.css +165 -0
- package/dist/client/components/Chart.d.ts +194 -0
- package/dist/client/components/Chart.js +801 -0
- package/dist/client/components/ChartFigure.d.ts +82 -0
- package/dist/client/components/ChartFigure.js +102 -0
- package/dist/client/components/ChartShapes.css +213 -0
- package/dist/client/components/ChartShapes.d.ts +63 -0
- package/dist/client/components/ChartShapes.js +393 -0
- package/dist/client/components/Checklist.css +16 -0
- package/dist/client/components/Composer.d.ts +1 -0
- package/dist/client/components/Composer.js +331 -0
- package/dist/client/components/Content.d.ts +8 -0
- package/dist/client/components/Content.js +170 -0
- package/dist/client/components/CountedLabel.d.ts +10 -0
- package/dist/client/components/CountedLabel.js +26 -0
- package/dist/client/components/Crumbs.d.ts +11 -0
- package/dist/client/components/Crumbs.js +142 -0
- package/dist/client/components/DashboardList.css +7 -0
- package/dist/client/components/DashboardList.d.ts +9 -0
- package/dist/client/components/DashboardList.js +46 -0
- package/dist/client/components/DashboardNote.d.ts +21 -0
- package/dist/client/components/DashboardNote.js +22 -0
- package/dist/client/components/DateField.css +6 -0
- package/dist/client/components/DateField.d.ts +7 -0
- package/dist/client/components/DateField.js +27 -0
- package/dist/client/components/DefinedFields.d.ts +50 -0
- package/dist/client/components/DefinedFields.js +186 -0
- package/dist/client/components/DeleteButton.d.ts +30 -0
- package/dist/client/components/DeleteButton.js +198 -0
- package/dist/client/components/Diagram.d.ts +7 -0
- package/dist/client/components/Diagram.js +320 -0
- package/dist/client/components/Dressed.d.ts +31 -0
- package/dist/client/components/Dressed.js +138 -0
- package/dist/client/components/Dropdown.d.ts +14 -0
- package/dist/client/components/Dropdown.js +20 -0
- package/dist/client/components/EditLayoutButton.d.ts +13 -0
- package/dist/client/components/EditLayoutButton.js +7 -0
- package/dist/client/components/Editable.d.ts +47 -0
- package/dist/client/components/Editable.js +422 -0
- package/dist/client/components/ErrorBoundary.d.ts +40 -0
- package/dist/client/components/ErrorBoundary.js +41 -0
- package/dist/client/components/Export.d.ts +15 -0
- package/dist/client/components/Export.js +151 -0
- package/dist/client/components/ExportHold.d.ts +18 -0
- package/dist/client/components/ExportHold.js +30 -0
- package/dist/client/components/FavoriteStar.d.ts +5 -0
- package/dist/client/components/FavoriteStar.js +14 -0
- package/dist/client/components/FieldArranger.d.ts +28 -0
- package/dist/client/components/FieldArranger.js +82 -0
- package/dist/client/components/FilePreview.css +20 -0
- package/dist/client/components/FilePreview.d.ts +26 -0
- package/dist/client/components/FilePreview.js +170 -0
- package/dist/client/components/FilterBoxes.d.ts +76 -0
- package/dist/client/components/FilterBoxes.js +294 -0
- package/dist/client/components/FilterRail.css +100 -0
- package/dist/client/components/FilterRail.d.ts +61 -0
- package/dist/client/components/FilterRail.js +559 -0
- package/dist/client/components/Gallery.d.ts +11 -0
- package/dist/client/components/Gallery.js +53 -0
- package/dist/client/components/Grid.d.ts +122 -0
- package/dist/client/components/Grid.js +1115 -0
- package/dist/client/components/GridCellEditor.d.ts +35 -0
- package/dist/client/components/GridCellEditor.js +291 -0
- package/dist/client/components/GridSelection.d.ts +16 -0
- package/dist/client/components/GridSelection.js +28 -0
- package/dist/client/components/HelpPanel.d.ts +5 -0
- package/dist/client/components/HelpPanel.js +92 -0
- package/dist/client/components/History.d.ts +10 -0
- package/dist/client/components/History.js +22 -0
- package/dist/client/components/Icon.d.ts +31 -0
- package/dist/client/components/Icon.js +20 -0
- package/dist/client/components/JsonPreview.d.ts +5 -0
- package/dist/client/components/JsonPreview.js +25 -0
- package/dist/client/components/JsonValue.d.ts +4 -0
- package/dist/client/components/JsonValue.js +3 -0
- package/dist/client/components/JsonView.css +109 -0
- package/dist/client/components/JsonView.d.ts +3 -0
- package/dist/client/components/JsonView.js +118 -0
- package/dist/client/components/Landing.d.ts +19 -0
- package/dist/client/components/Landing.js +55 -0
- package/dist/client/components/LandingSurface.css +177 -0
- package/dist/client/components/LandingSurface.d.ts +42 -0
- package/dist/client/components/LandingSurface.js +108 -0
- package/dist/client/components/LayoutBuilder.d.ts +36 -0
- package/dist/client/components/LayoutBuilder.js +104 -0
- package/dist/client/components/Lightbox.d.ts +29 -0
- package/dist/client/components/Lightbox.js +62 -0
- package/dist/client/components/ListEmpty.css +13 -0
- package/dist/client/components/ListEmpty.d.ts +10 -0
- package/dist/client/components/ListEmpty.js +8 -0
- package/dist/client/components/ListFilterBar.css +76 -0
- package/dist/client/components/ListFilterBar.d.ts +52 -0
- package/dist/client/components/ListFilterBar.js +304 -0
- package/dist/client/components/LiveNotices.css +105 -0
- package/dist/client/components/LiveNotices.d.ts +26 -0
- package/dist/client/components/LiveNotices.js +211 -0
- package/dist/client/components/MinorMoneyInput.d.ts +26 -0
- package/dist/client/components/MinorMoneyInput.js +50 -0
- package/dist/client/components/Modal.css +3 -0
- package/dist/client/components/MultiStepForm.css +122 -0
- package/dist/client/components/MultiStepForm.d.ts +59 -0
- package/dist/client/components/MultiStepForm.js +216 -0
- package/dist/client/components/NavGlyph.d.ts +14 -0
- package/dist/client/components/NavGlyph.js +27 -0
- package/dist/client/components/Nested.d.ts +21 -0
- package/dist/client/components/Nested.js +86 -0
- package/dist/client/components/NewRecord.d.ts +89 -0
- package/dist/client/components/NewRecord.js +897 -0
- package/dist/client/components/NewRecordButton.d.ts +13 -0
- package/dist/client/components/NewRecordButton.js +28 -0
- package/dist/client/components/Notes.css +39 -0
- package/dist/client/components/Notes.d.ts +59 -0
- package/dist/client/components/Notes.js +96 -0
- package/dist/client/components/OverflowMenu.d.ts +3 -0
- package/dist/client/components/OverflowMenu.js +60 -0
- package/dist/client/components/Page.d.ts +52 -0
- package/dist/client/components/Page.js +237 -0
- package/dist/client/components/PageCurrent.d.ts +38 -0
- package/dist/client/components/PageCurrent.js +27 -0
- package/dist/client/components/PageEmptyRun.d.ts +18 -0
- package/dist/client/components/PageEmptyRun.js +118 -0
- package/dist/client/components/PageFields.d.ts +3 -0
- package/dist/client/components/PageFields.js +294 -0
- package/dist/client/components/PageFlowDiagram.css +193 -0
- package/dist/client/components/PageFlowDiagram.d.ts +95 -0
- package/dist/client/components/PageFlowDiagram.js +276 -0
- package/dist/client/components/PageFlows.css +27 -0
- package/dist/client/components/PageFlows.d.ts +54 -0
- package/dist/client/components/PageFlows.js +92 -0
- package/dist/client/components/PageGroups.d.ts +43 -0
- package/dist/client/components/PageGroups.js +123 -0
- package/dist/client/components/PageHead.d.ts +28 -0
- package/dist/client/components/PageHead.js +279 -0
- package/dist/client/components/PageHeadline.d.ts +23 -0
- package/dist/client/components/PageHeadline.js +101 -0
- package/dist/client/components/PageHistory.d.ts +62 -0
- package/dist/client/components/PageHistory.js +160 -0
- package/dist/client/components/PageLayout.d.ts +22 -0
- package/dist/client/components/PageLayout.js +13 -0
- package/dist/client/components/PageMetrics.d.ts +11 -0
- package/dist/client/components/PageMetrics.js +252 -0
- package/dist/client/components/PageRelated.d.ts +70 -0
- package/dist/client/components/PageRelated.js +667 -0
- package/dist/client/components/PageRoom.d.ts +37 -0
- package/dist/client/components/PageRoom.js +277 -0
- package/dist/client/components/PageSectionBox.d.ts +28 -0
- package/dist/client/components/PageSectionBox.js +65 -0
- package/dist/client/components/PageSections.d.ts +38 -0
- package/dist/client/components/PageSections.js +352 -0
- package/dist/client/components/PageSkeleton.css +17 -0
- package/dist/client/components/PageSkeleton.d.ts +11 -0
- package/dist/client/components/PageSkeleton.js +25 -0
- package/dist/client/components/PageTimeline.d.ts +2 -0
- package/dist/client/components/PageTimeline.js +273 -0
- package/dist/client/components/Palette.d.ts +4 -0
- package/dist/client/components/Palette.js +176 -0
- package/dist/client/components/Peek.d.ts +1 -0
- package/dist/client/components/Peek.js +158 -0
- package/dist/client/components/PeekPanel.d.ts +16 -0
- package/dist/client/components/PeekPanel.js +120 -0
- package/dist/client/components/Picker.d.ts +13 -0
- package/dist/client/components/Picker.js +33 -0
- package/dist/client/components/Prefs.d.ts +3 -0
- package/dist/client/components/Prefs.js +121 -0
- package/dist/client/components/PresentationSwitch.d.ts +13 -0
- package/dist/client/components/PresentationSwitch.js +10 -0
- package/dist/client/components/Prompt.d.ts +35 -0
- package/dist/client/components/Prompt.js +114 -0
- package/dist/client/components/QrCode.css +11 -0
- package/dist/client/components/QrCode.d.ts +4 -0
- package/dist/client/components/QrCode.js +57 -0
- package/dist/client/components/QueueList.css +122 -0
- package/dist/client/components/QuickAdd.css +18 -0
- package/dist/client/components/QuickAdd.d.ts +11 -0
- package/dist/client/components/QuickAdd.js +53 -0
- package/dist/client/components/QuickAddOnDemand.d.ts +4 -0
- package/dist/client/components/QuickAddOnDemand.js +10 -0
- package/dist/client/components/Record.d.ts +36 -0
- package/dist/client/components/Record.js +385 -0
- package/dist/client/components/RecordGone.d.ts +7 -0
- package/dist/client/components/RecordGone.js +22 -0
- package/dist/client/components/RecordPicker.d.ts +59 -0
- package/dist/client/components/RecordPicker.js +299 -0
- package/dist/client/components/RecordSummaries.d.ts +55 -0
- package/dist/client/components/RecordSummaries.js +151 -0
- package/dist/client/components/RecordTags.d.ts +6 -0
- package/dist/client/components/RecordTags.js +119 -0
- package/dist/client/components/RecordTrailNav.d.ts +25 -0
- package/dist/client/components/RecordTrailNav.js +110 -0
- package/dist/client/components/RichText.d.ts +7 -0
- package/dist/client/components/RichText.js +82 -0
- package/dist/client/components/RichTextEditor.css +202 -0
- package/dist/client/components/RichTextEditor.d.ts +33 -0
- package/dist/client/components/RichTextEditor.js +348 -0
- package/dist/client/components/RichTextField.d.ts +26 -0
- package/dist/client/components/RichTextField.js +71 -0
- package/dist/client/components/Rooms.d.ts +35 -0
- package/dist/client/components/Rooms.js +276 -0
- package/dist/client/components/RowActions.d.ts +8 -0
- package/dist/client/components/RowActions.js +49 -0
- package/dist/client/components/RowHost.d.ts +110 -0
- package/dist/client/components/RowHost.js +212 -0
- package/dist/client/components/SavedViews.d.ts +25 -0
- package/dist/client/components/SavedViews.js +35 -0
- package/dist/client/components/SchemaExport.d.ts +15 -0
- package/dist/client/components/SchemaExport.js +42 -0
- package/dist/client/components/SectionPeriod.css +14 -0
- package/dist/client/components/SectionPeriod.d.ts +7 -0
- package/dist/client/components/SectionPeriod.js +14 -0
- package/dist/client/components/SetFieldDialog.d.ts +12 -0
- package/dist/client/components/SetFieldDialog.js +51 -0
- package/dist/client/components/Sidebar.d.ts +34 -0
- package/dist/client/components/Sidebar.js +398 -0
- package/dist/client/components/Skeleton.d.ts +35 -0
- package/dist/client/components/Skeleton.js +49 -0
- package/dist/client/components/SortMenu.d.ts +20 -0
- package/dist/client/components/SortMenu.js +45 -0
- package/dist/client/components/SplitListDetail.css +119 -0
- package/dist/client/components/SuggestBox.d.ts +29 -0
- package/dist/client/components/SuggestBox.js +60 -0
- package/dist/client/components/Summary.d.ts +14 -0
- package/dist/client/components/Summary.js +93 -0
- package/dist/client/components/TableRoom.d.ts +88 -0
- package/dist/client/components/TableRoom.js +246 -0
- package/dist/client/components/TableView.d.ts +111 -0
- package/dist/client/components/TableView.js +324 -0
- package/dist/client/components/ThMenu.d.ts +40 -0
- package/dist/client/components/ThMenu.js +163 -0
- package/dist/client/components/ThemeLab.d.ts +4 -0
- package/dist/client/components/ThemeLab.js +67 -0
- package/dist/client/components/TimelineSides.css +23 -0
- package/dist/client/components/TimelineSides.d.ts +7 -0
- package/dist/client/components/TimelineSides.js +9 -0
- package/dist/client/components/Tour.d.ts +12 -0
- package/dist/client/components/Tour.js +131 -0
- package/dist/client/components/Value.d.ts +38 -0
- package/dist/client/components/Value.js +172 -0
- package/dist/client/components/WorkPanel.d.ts +9 -0
- package/dist/client/components/WorkPanel.js +43 -0
- package/dist/client/components/WorkflowStatus.d.ts +6 -0
- package/dist/client/components/WorkflowStatus.js +44 -0
- package/dist/client/components/WriteConfirm.d.ts +4 -0
- package/dist/client/components/WriteConfirm.js +27 -0
- package/dist/client/components/appColumnMenuModel.d.ts +46 -0
- package/dist/client/components/appColumnMenuModel.js +51 -0
- package/dist/client/components/appListModel.d.ts +179 -0
- package/dist/client/components/appListModel.js +421 -0
- package/dist/client/components/appRooms.d.ts +106 -0
- package/dist/client/components/appRooms.js +133 -0
- package/dist/client/components/autoChart.d.ts +33 -0
- package/dist/client/components/autoChart.js +107 -0
- package/dist/client/components/avatarPhotos.d.ts +45 -0
- package/dist/client/components/avatarPhotos.js +93 -0
- package/dist/client/components/besideDetail.d.ts +1 -0
- package/dist/client/components/besideDetail.js +10 -0
- package/dist/client/components/boardNew.d.ts +2 -0
- package/dist/client/components/boardNew.js +8 -0
- package/dist/client/components/cardsModel.d.ts +11 -0
- package/dist/client/components/cardsModel.js +24 -0
- package/dist/client/components/chromeIcons.d.ts +16 -0
- package/dist/client/components/chromeIcons.js +16 -0
- package/dist/client/components/columnPresentation.d.ts +8 -0
- package/dist/client/components/columnPresentation.js +47 -0
- package/dist/client/components/componentSlot.d.ts +31 -0
- package/dist/client/components/componentSlot.js +76 -0
- package/dist/client/components/composerDraft.d.ts +16 -0
- package/dist/client/components/composerDraft.js +16 -0
- package/dist/client/components/conditionText.d.ts +14 -0
- package/dist/client/components/conditionText.js +45 -0
- package/dist/client/components/conditionWords.d.ts +37 -0
- package/dist/client/components/conditionWords.js +382 -0
- package/dist/client/components/crumbSlot.d.ts +14 -0
- package/dist/client/components/crumbSlot.js +49 -0
- package/dist/client/components/dashboardModel.d.ts +283 -0
- package/dist/client/components/dashboardModel.js +415 -0
- package/dist/client/components/dashboardParts.d.ts +9 -0
- package/dist/client/components/dashboardParts.js +18 -0
- package/dist/client/components/diagramModel.d.ts +83 -0
- package/dist/client/components/diagramModel.js +211 -0
- package/dist/client/components/dueOpen.d.ts +1 -0
- package/dist/client/components/dueOpen.js +23 -0
- package/dist/client/components/editInteraction.d.ts +20 -0
- package/dist/client/components/editInteraction.js +178 -0
- package/dist/client/components/favoriteNav.d.ts +6 -0
- package/dist/client/components/favoriteNav.js +31 -0
- package/dist/client/components/favorites.d.ts +23 -0
- package/dist/client/components/favorites.js +86 -0
- package/dist/client/components/filePreviewModel.d.ts +18 -0
- package/dist/client/components/filePreviewModel.js +21 -0
- package/dist/client/components/filterRailModel.d.ts +93 -0
- package/dist/client/components/filterRailModel.js +302 -0
- package/dist/client/components/formControlsStyle.d.ts +1 -0
- package/dist/client/components/formControlsStyle.js +3 -0
- package/dist/client/components/formDefaults.d.ts +17 -0
- package/dist/client/components/formDefaults.js +128 -0
- package/dist/client/components/gridArrange.d.ts +33 -0
- package/dist/client/components/gridArrange.js +62 -0
- package/dist/client/components/gridCellModel.d.ts +32 -0
- package/dist/client/components/gridCellModel.js +42 -0
- package/dist/client/components/gridSizing.d.ts +89 -0
- package/dist/client/components/gridSizing.js +295 -0
- package/dist/client/components/groupMoves.d.ts +44 -0
- package/dist/client/components/groupMoves.js +295 -0
- package/dist/client/components/groupOrder.d.ts +43 -0
- package/dist/client/components/groupOrder.js +63 -0
- package/dist/client/components/inputRenderers.d.ts +48 -0
- package/dist/client/components/inputRenderers.js +37 -0
- package/dist/client/components/intakeStyle.d.ts +2 -0
- package/dist/client/components/intakeStyle.js +6 -0
- package/dist/client/components/jsonModel.d.ts +98 -0
- package/dist/client/components/jsonModel.js +264 -0
- package/dist/client/components/listColumn.d.ts +20 -0
- package/dist/client/components/listColumn.js +31 -0
- package/dist/client/components/listNavigation.d.ts +16 -0
- package/dist/client/components/listNavigation.js +14 -0
- package/dist/client/components/mentionRows.d.ts +5 -0
- package/dist/client/components/mentionRows.js +62 -0
- package/dist/client/components/mount.d.ts +55 -0
- package/dist/client/components/mount.js +155 -0
- package/dist/client/components/myViews.d.ts +54 -0
- package/dist/client/components/myViews.js +82 -0
- package/dist/client/components/navCounts.d.ts +84 -0
- package/dist/client/components/navCounts.js +194 -0
- package/dist/client/components/navigationTree.d.ts +52 -0
- package/dist/client/components/navigationTree.js +49 -0
- package/dist/client/components/newMenuModel.d.ts +27 -0
- package/dist/client/components/newMenuModel.js +58 -0
- package/dist/client/components/newRecordModel.d.ts +58 -0
- package/dist/client/components/newRecordModel.js +232 -0
- package/dist/client/components/onDemand.d.ts +30 -0
- package/dist/client/components/onDemand.js +121 -0
- package/dist/client/components/optimisticMoves.d.ts +21 -0
- package/dist/client/components/optimisticMoves.js +145 -0
- package/dist/client/components/pageContext.d.ts +154 -0
- package/dist/client/components/pageContext.js +47 -0
- package/dist/client/components/pageFieldsRead.d.ts +67 -0
- package/dist/client/components/pageFieldsRead.js +55 -0
- package/dist/client/components/pageModel.d.ts +203 -0
- package/dist/client/components/pageModel.js +67 -0
- package/dist/client/components/pageStep.d.ts +31 -0
- package/dist/client/components/pageStep.js +15 -0
- package/dist/client/components/paletteModel.d.ts +9 -0
- package/dist/client/components/paletteModel.js +46 -0
- package/dist/client/components/pickerStaleness.d.ts +32 -0
- package/dist/client/components/pickerStaleness.js +27 -0
- package/dist/client/components/placeOrder.d.ts +47 -0
- package/dist/client/components/placeOrder.js +71 -0
- package/dist/client/components/pointerDrag.d.ts +54 -0
- package/dist/client/components/pointerDrag.js +95 -0
- package/dist/client/components/presentationFit.d.ts +19 -0
- package/dist/client/components/presentationFit.js +32 -0
- package/dist/client/components/recordKeys.d.ts +2 -0
- package/dist/client/components/recordKeys.js +8 -0
- package/dist/client/components/recordSearch.d.ts +31 -0
- package/dist/client/components/recordSearch.js +80 -0
- package/dist/client/components/recordSurface.d.ts +86 -0
- package/dist/client/components/recordSurface.js +267 -0
- package/dist/client/components/rowOpens.d.ts +19 -0
- package/dist/client/components/rowOpens.js +25 -0
- package/dist/client/components/sidebarModel.d.ts +152 -0
- package/dist/client/components/sidebarModel.js +372 -0
- package/dist/client/components/suggestModel.d.ts +22 -0
- package/dist/client/components/suggestModel.js +49 -0
- package/dist/client/components/suggestPart.d.ts +4 -0
- package/dist/client/components/suggestPart.js +4 -0
- package/dist/client/components/textMeasure.d.ts +2 -0
- package/dist/client/components/textMeasure.js +35 -0
- package/dist/client/components/unknownIcon.d.ts +8 -0
- package/dist/client/components/unknownIcon.js +32 -0
- package/dist/client/components/useBulkSelection.d.ts +30 -0
- package/dist/client/components/useBulkSelection.js +360 -0
- package/dist/client/components/useConditionWords.d.ts +17 -0
- package/dist/client/components/useConditionWords.js +104 -0
- package/dist/client/components/useGridKeyboard.d.ts +32 -0
- package/dist/client/components/useGridKeyboard.js +223 -0
- package/dist/client/components/useListOrder.d.ts +94 -0
- package/dist/client/components/useListOrder.js +294 -0
- package/dist/client/components/useMediaQuery.d.ts +10 -0
- package/dist/client/components/useMediaQuery.js +45 -0
- package/dist/client/components/useMessageLanguage.d.ts +1 -0
- package/dist/client/components/useMessageLanguage.js +6 -0
- package/dist/client/components/usePins.d.ts +20 -0
- package/dist/client/components/usePins.js +66 -0
- package/dist/client/components/usePointerDrag.d.ts +72 -0
- package/dist/client/components/usePointerDrag.js +553 -0
- package/dist/client/components/useRecordInsert.d.ts +42 -0
- package/dist/client/components/useRecordInsert.js +145 -0
- package/dist/client/components/useRowWindow.d.ts +35 -0
- package/dist/client/components/useRowWindow.js +149 -0
- package/dist/client/components/useStickyHead.d.ts +17 -0
- package/dist/client/components/useStickyHead.js +65 -0
- package/dist/client/components/useTabFold.d.ts +32 -0
- package/dist/client/components/useTabFold.js +145 -0
- package/dist/client/components/valueModel.d.ts +300 -0
- package/dist/client/components/valueModel.js +560 -0
- package/dist/client/components/valueRenderers.d.ts +36 -0
- package/dist/client/components/valueRenderers.js +13 -0
- package/dist/client/components/viewLink.d.ts +27 -0
- package/dist/client/components/viewLink.js +79 -0
- package/dist/client/components/walk.d.ts +14 -0
- package/dist/client/components/walk.js +16 -0
- package/dist/client/compose.d.ts +8 -0
- package/dist/client/compose.js +163 -0
- package/dist/client/composedHook.d.ts +20 -0
- package/dist/client/composedHook.js +12 -0
- package/dist/client/composedReads.d.ts +26 -0
- package/dist/client/composedReads.js +183 -0
- package/dist/client/composer.css +499 -0
- package/dist/client/composer.d.ts +121 -0
- package/dist/client/composer.js +1079 -0
- package/dist/client/composerEntry.d.ts +1 -0
- package/dist/client/composerEntry.js +58 -0
- package/dist/client/composerTab.d.ts +6 -0
- package/dist/client/composerTab.js +20 -0
- package/dist/client/conditions.d.ts +46 -0
- package/dist/client/conditions.js +150 -0
- package/dist/client/connectionList.d.ts +11 -0
- package/dist/client/connectionList.js +146 -0
- package/dist/client/connectionScope.d.ts +6 -0
- package/dist/client/connectionScope.js +14 -0
- package/dist/client/connectionTransition.d.ts +12 -0
- package/dist/client/connectionTransition.js +41 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenu.d.ts +4 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenu.js +6 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.d.ts +4 -0
- package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.js +6 -0
- package/dist/client/copy/columnMenu/components/ThMenu.d.ts +35 -0
- package/dist/client/copy/columnMenu/components/ThMenu.js +37 -0
- package/dist/client/copy/columnMenu/components/appColumnMenuModel.d.ts +10 -0
- package/dist/client/copy/columnMenu/components/appColumnMenuModel.js +12 -0
- package/dist/client/copy/dashboards/breakdownBatch.d.ts +3 -0
- package/dist/client/copy/dashboards/breakdownBatch.js +5 -0
- package/dist/client/copy/dashboards/components/Breakdown.d.ts +32 -0
- package/dist/client/copy/dashboards/components/Breakdown.js +25 -0
- package/dist/client/copy/dashboards/components/BreakdownRoom.d.ts +3 -0
- package/dist/client/copy/dashboards/components/BreakdownRoom.js +5 -0
- package/dist/client/copy/dashboards/components/Chart.d.ts +26 -0
- package/dist/client/copy/dashboards/components/Chart.js +19 -0
- package/dist/client/copy/dashboards/components/ChartShapes.d.ts +16 -0
- package/dist/client/copy/dashboards/components/ChartShapes.js +12 -0
- package/dist/client/copy/dashboards/components/PageMetrics.d.ts +21 -0
- package/dist/client/copy/dashboards/components/PageMetrics.js +20 -0
- package/dist/client/copy/dashboards/components/SectionPeriod.d.ts +4 -0
- package/dist/client/copy/dashboards/components/SectionPeriod.js +6 -0
- package/dist/client/copy/dashboards/components/dashboardModel.d.ts +3 -0
- package/dist/client/copy/dashboards/components/dashboardModel.js +5 -0
- package/dist/client/copy/es.d.ts +11 -0
- package/dist/client/copy/es.js +60 -0
- package/dist/client/copy/filters/components/FilterBoxes.d.ts +10 -0
- package/dist/client/copy/filters/components/FilterBoxes.js +12 -0
- package/dist/client/copy/filters/components/FilterRail.d.ts +16 -0
- package/dist/client/copy/filters/components/FilterRail.js +18 -0
- package/dist/client/copy/filters/components/ListFilterBar.d.ts +9 -0
- package/dist/client/copy/filters/components/ListFilterBar.js +11 -0
- package/dist/client/copy/filters/components/conditionWords.d.ts +46 -0
- package/dist/client/copy/filters/components/conditionWords.js +95 -0
- package/dist/client/copy/filters/components/filterRailModel.d.ts +12 -0
- package/dist/client/copy/filters/components/filterRailModel.js +14 -0
- package/dist/client/copy/forms/components/DateField.d.ts +13 -0
- package/dist/client/copy/forms/components/DateField.js +15 -0
- package/dist/client/copy/forms/components/MinorMoneyInput.d.ts +4 -0
- package/dist/client/copy/forms/components/MinorMoneyInput.js +6 -0
- package/dist/client/copy/forms/components/MultiStepForm.d.ts +10 -0
- package/dist/client/copy/forms/components/MultiStepForm.js +12 -0
- package/dist/client/copy/forms/components/NewRecord.d.ts +29 -0
- package/dist/client/copy/forms/components/NewRecord.js +31 -0
- package/dist/client/copy/forms/components/NewRecordButton.d.ts +6 -0
- package/dist/client/copy/forms/components/NewRecordButton.js +8 -0
- package/dist/client/copy/forms/components/Picker.d.ts +4 -0
- package/dist/client/copy/forms/components/Picker.js +6 -0
- package/dist/client/copy/forms/components/QuickAdd.d.ts +3 -0
- package/dist/client/copy/forms/components/QuickAdd.js +5 -0
- package/dist/client/copy/forms/components/RecordPicker.d.ts +6 -0
- package/dist/client/copy/forms/components/RecordPicker.js +8 -0
- package/dist/client/copy/forms/components/RichTextEditor.d.ts +36 -0
- package/dist/client/copy/forms/components/RichTextEditor.js +40 -0
- package/dist/client/copy/forms/components/RichTextField.d.ts +3 -0
- package/dist/client/copy/forms/components/RichTextField.js +5 -0
- package/dist/client/copy/forms/components/SetFieldDialog.d.ts +10 -0
- package/dist/client/copy/forms/components/SetFieldDialog.js +9 -0
- package/dist/client/copy/forms/components/useRecordInsert.d.ts +7 -0
- package/dist/client/copy/forms/components/useRecordInsert.js +9 -0
- package/dist/client/copy/help/helpContent.d.ts +71 -0
- package/dist/client/copy/help/helpContent.js +73 -0
- package/dist/client/copy/lists/bulkActions.d.ts +12 -0
- package/dist/client/copy/lists/bulkActions.js +14 -0
- package/dist/client/copy/lists/components/AppList.d.ts +28 -0
- package/dist/client/copy/lists/components/AppList.js +30 -0
- package/dist/client/copy/lists/components/CardsList.d.ts +3 -0
- package/dist/client/copy/lists/components/CardsList.js +5 -0
- package/dist/client/copy/lists/components/Gallery.d.ts +7 -0
- package/dist/client/copy/lists/components/Gallery.js +9 -0
- package/dist/client/copy/lists/components/Grid.d.ts +30 -0
- package/dist/client/copy/lists/components/Grid.js +29 -0
- package/dist/client/copy/lists/components/GridCellEditor.d.ts +5 -0
- package/dist/client/copy/lists/components/GridCellEditor.js +7 -0
- package/dist/client/copy/lists/components/GridSelection.d.ts +4 -0
- package/dist/client/copy/lists/components/GridSelection.js +6 -0
- package/dist/client/copy/lists/components/Nested.d.ts +7 -0
- package/dist/client/copy/lists/components/Nested.js +9 -0
- package/dist/client/copy/lists/components/RowActions.d.ts +1 -0
- package/dist/client/copy/lists/components/RowActions.js +3 -0
- package/dist/client/copy/lists/components/SavedViews.d.ts +5 -0
- package/dist/client/copy/lists/components/SavedViews.js +7 -0
- package/dist/client/copy/lists/components/SortMenu.d.ts +5 -0
- package/dist/client/copy/lists/components/SortMenu.js +7 -0
- package/dist/client/copy/lists/components/TableRoom.d.ts +12 -0
- package/dist/client/copy/lists/components/TableRoom.js +14 -0
- package/dist/client/copy/lists/components/TableView.d.ts +37 -0
- package/dist/client/copy/lists/components/TableView.js +39 -0
- package/dist/client/copy/lists/components/appListModel.d.ts +6 -0
- package/dist/client/copy/lists/components/appListModel.js +5 -0
- package/dist/client/copy/lists/components/myViews.d.ts +4 -0
- package/dist/client/copy/lists/components/myViews.js +6 -0
- package/dist/client/copy/lists/components/placeOrder.d.ts +4 -0
- package/dist/client/copy/lists/components/placeOrder.js +6 -0
- package/dist/client/copy/lists/components/useBulkSelection.d.ts +20 -0
- package/dist/client/copy/lists/components/useBulkSelection.js +16 -0
- package/dist/client/copy/lists/components/useListOrder.d.ts +7 -0
- package/dist/client/copy/lists/components/useListOrder.js +9 -0
- package/dist/client/copy/public/components/appRooms.d.ts +3 -0
- package/dist/client/copy/public/components/appRooms.js +5 -0
- package/dist/client/copy/record/components/Actions.d.ts +13 -0
- package/dist/client/copy/record/components/Actions.js +15 -0
- package/dist/client/copy/record/components/AttachmentList.d.ts +23 -0
- package/dist/client/copy/record/components/AttachmentList.js +22 -0
- package/dist/client/copy/record/components/DeleteButton.d.ts +22 -0
- package/dist/client/copy/record/components/DeleteButton.js +24 -0
- package/dist/client/copy/record/components/Dressed.d.ts +5 -0
- package/dist/client/copy/record/components/Dressed.js +7 -0
- package/dist/client/copy/record/components/EditLayoutButton.d.ts +5 -0
- package/dist/client/copy/record/components/EditLayoutButton.js +7 -0
- package/dist/client/copy/record/components/Editable.d.ts +25 -0
- package/dist/client/copy/record/components/Editable.js +24 -0
- package/dist/client/copy/record/components/FieldArranger.d.ts +15 -0
- package/dist/client/copy/record/components/FieldArranger.js +17 -0
- package/dist/client/copy/record/components/FilePreview.d.ts +13 -0
- package/dist/client/copy/record/components/FilePreview.js +15 -0
- package/dist/client/copy/record/components/JsonPreview.d.ts +3 -0
- package/dist/client/copy/record/components/JsonPreview.js +5 -0
- package/dist/client/copy/record/components/JsonView.d.ts +12 -0
- package/dist/client/copy/record/components/JsonView.js +14 -0
- package/dist/client/copy/record/components/LayoutBuilder.d.ts +23 -0
- package/dist/client/copy/record/components/LayoutBuilder.js +25 -0
- package/dist/client/copy/record/components/Lightbox.d.ts +5 -0
- package/dist/client/copy/record/components/Lightbox.js +7 -0
- package/dist/client/copy/record/components/LiveNotices.d.ts +33 -0
- package/dist/client/copy/record/components/LiveNotices.js +29 -0
- package/dist/client/copy/record/components/PageCurrent.d.ts +1 -0
- package/dist/client/copy/record/components/PageCurrent.js +3 -0
- package/dist/client/copy/record/components/PageEmptyRun.d.ts +3 -0
- package/dist/client/copy/record/components/PageEmptyRun.js +5 -0
- package/dist/client/copy/record/components/PageFields.d.ts +5 -0
- package/dist/client/copy/record/components/PageFields.js +7 -0
- package/dist/client/copy/record/components/PageFlowDiagram.d.ts +33 -0
- package/dist/client/copy/record/components/PageFlowDiagram.js +37 -0
- package/dist/client/copy/record/components/PageFlows.d.ts +20 -0
- package/dist/client/copy/record/components/PageFlows.js +22 -0
- package/dist/client/copy/record/components/PageGroups.d.ts +12 -0
- package/dist/client/copy/record/components/PageGroups.js +14 -0
- package/dist/client/copy/record/components/PageHead.d.ts +8 -0
- package/dist/client/copy/record/components/PageHead.js +10 -0
- package/dist/client/copy/record/components/PageHistory.d.ts +18 -0
- package/dist/client/copy/record/components/PageHistory.js +20 -0
- package/dist/client/copy/record/components/PageLayout.d.ts +5 -0
- package/dist/client/copy/record/components/PageLayout.js +7 -0
- package/dist/client/copy/record/components/PageRelated.d.ts +24 -0
- package/dist/client/copy/record/components/PageRelated.js +26 -0
- package/dist/client/copy/record/components/PageRoom.d.ts +4 -0
- package/dist/client/copy/record/components/PageRoom.js +6 -0
- package/dist/client/copy/record/components/PageSectionBox.d.ts +6 -0
- package/dist/client/copy/record/components/PageSectionBox.js +10 -0
- package/dist/client/copy/record/components/PageTimeline.d.ts +9 -0
- package/dist/client/copy/record/components/PageTimeline.js +8 -0
- package/dist/client/copy/record/components/Peek.d.ts +3 -0
- package/dist/client/copy/record/components/Peek.js +5 -0
- package/dist/client/copy/record/components/PeekPanel.d.ts +5 -0
- package/dist/client/copy/record/components/PeekPanel.js +7 -0
- package/dist/client/copy/record/components/QrCode.d.ts +3 -0
- package/dist/client/copy/record/components/QrCode.js +5 -0
- package/dist/client/copy/record/components/Record.d.ts +19 -0
- package/dist/client/copy/record/components/Record.js +21 -0
- package/dist/client/copy/record/components/RecordGone.d.ts +4 -0
- package/dist/client/copy/record/components/RecordGone.js +6 -0
- package/dist/client/copy/record/components/RecordSummaries.d.ts +1 -0
- package/dist/client/copy/record/components/RecordSummaries.js +3 -0
- package/dist/client/copy/record/components/RecordTags.d.ts +9 -0
- package/dist/client/copy/record/components/RecordTags.js +11 -0
- package/dist/client/copy/record/components/RecordTrailNav.d.ts +8 -0
- package/dist/client/copy/record/components/RecordTrailNav.js +10 -0
- package/dist/client/copy/record/components/RichText.d.ts +4 -0
- package/dist/client/copy/record/components/RichText.js +6 -0
- package/dist/client/copy/record/components/Value.d.ts +4 -0
- package/dist/client/copy/record/components/Value.js +6 -0
- package/dist/client/copy/record/components/WorkflowStatus.d.ts +7 -0
- package/dist/client/copy/record/components/WorkflowStatus.js +9 -0
- package/dist/client/copy/record/components/WriteConfirm.d.ts +11 -0
- package/dist/client/copy/record/components/WriteConfirm.js +13 -0
- package/dist/client/copy/record/components/groupMoves.d.ts +7 -0
- package/dist/client/copy/record/components/groupMoves.js +9 -0
- package/dist/client/copy/record/components/jsonModel.d.ts +3 -0
- package/dist/client/copy/record/components/jsonModel.js +5 -0
- package/dist/client/copy/record/components/pageModel.d.ts +5 -0
- package/dist/client/copy/record/components/pageModel.js +7 -0
- package/dist/client/copy/record/components/recordSurface.d.ts +6 -0
- package/dist/client/copy/record/components/recordSurface.js +8 -0
- package/dist/client/copy/record/components/valueModel.d.ts +5 -0
- package/dist/client/copy/record/components/valueModel.js +7 -0
- package/dist/client/copy/record/fileSource.d.ts +3 -0
- package/dist/client/copy/record/fileSource.js +5 -0
- package/dist/client/copy/record/insert.d.ts +6 -0
- package/dist/client/copy/record/insert.js +8 -0
- package/dist/client/copy/record/page.d.ts +4 -0
- package/dist/client/copy/record/page.js +6 -0
- package/dist/client/copy/record/recordEditValidation.d.ts +4 -0
- package/dist/client/copy/record/recordEditValidation.js +6 -0
- package/dist/client/copy/record/savedPages.d.ts +4 -0
- package/dist/client/copy/record/savedPages.js +6 -0
- package/dist/client/copy/record/template.d.ts +9 -0
- package/dist/client/copy/record/template.js +11 -0
- package/dist/client/copy/record/write.d.ts +30 -0
- package/dist/client/copy/record/write.js +26 -0
- package/dist/client/copy/shell/app.d.ts +27 -0
- package/dist/client/copy/shell/app.js +43 -0
- package/dist/client/copy/shell/components/AppIssues.d.ts +10 -0
- package/dist/client/copy/shell/components/AppIssues.js +9 -0
- package/dist/client/copy/shell/components/Crumbs.d.ts +7 -0
- package/dist/client/copy/shell/components/Crumbs.js +17 -0
- package/dist/client/copy/shell/components/Dropdown.d.ts +3 -0
- package/dist/client/copy/shell/components/Dropdown.js +5 -0
- package/dist/client/copy/shell/components/ErrorBoundary.d.ts +4 -0
- package/dist/client/copy/shell/components/ErrorBoundary.js +6 -0
- package/dist/client/copy/shell/components/FavoriteStar.d.ts +4 -0
- package/dist/client/copy/shell/components/FavoriteStar.js +6 -0
- package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +4 -0
- package/dist/client/copy/shell/components/MobileNavDrawer.js +12 -0
- package/dist/client/copy/shell/components/OverflowMenu.d.ts +3 -0
- package/dist/client/copy/shell/components/OverflowMenu.js +10 -0
- package/dist/client/copy/shell/components/Palette.d.ts +15 -0
- package/dist/client/copy/shell/components/Palette.js +18 -0
- package/dist/client/copy/shell/components/Prefs.d.ts +4 -0
- package/dist/client/copy/shell/components/Prefs.js +11 -0
- package/dist/client/copy/shell/components/Prompt.d.ts +1 -0
- package/dist/client/copy/shell/components/Prompt.js +3 -0
- package/dist/client/copy/shell/components/Rooms.d.ts +6 -0
- package/dist/client/copy/shell/components/Rooms.js +8 -0
- package/dist/client/copy/shell/components/Sidebar.d.ts +7 -0
- package/dist/client/copy/shell/components/Sidebar.js +9 -0
- package/dist/client/copy/shell/components/Skeleton.d.ts +5 -0
- package/dist/client/copy/shell/components/Skeleton.js +7 -0
- package/dist/client/copy/shell/components/TopNav.d.ts +4 -0
- package/dist/client/copy/shell/components/TopNav.js +12 -0
- package/dist/client/copy/shell/components/Tour.d.ts +4 -0
- package/dist/client/copy/shell/components/Tour.js +6 -0
- package/dist/client/copy/shell/components/newMenuModel.d.ts +3 -0
- package/dist/client/copy/shell/components/newMenuModel.js +5 -0
- package/dist/client/copy/shell/components/onDemand.d.ts +3 -0
- package/dist/client/copy/shell/components/onDemand.js +5 -0
- package/dist/client/copy/shell/components/sidebarModel.d.ts +3 -0
- package/dist/client/copy/shell/components/sidebarModel.js +5 -0
- package/dist/client/copy/shell/connectionList.d.ts +6 -0
- package/dist/client/copy/shell/connectionList.js +8 -0
- package/dist/client/copy/shell/core.d.ts +16 -0
- package/dist/client/copy/shell/core.js +18 -0
- package/dist/client/copy/shell/palette.d.ts +6 -0
- package/dist/client/copy/shell/palette.js +8 -0
- package/dist/client/copy/shell/prompt.d.ts +1 -0
- package/dist/client/copy/shell/prompt.js +3 -0
- package/dist/client/copy/shell/requestIdentity.d.ts +9 -0
- package/dist/client/copy/shell/requestIdentity.js +11 -0
- package/dist/client/copy/shell/resourceRequests.d.ts +4 -0
- package/dist/client/copy/shell/resourceRequests.js +6 -0
- package/dist/client/copy/shell/sessionIdentity.d.ts +11 -0
- package/dist/client/copy/shell/sessionIdentity.js +13 -0
- package/dist/client/copy/shell/sessionLifecycle.d.ts +5 -0
- package/dist/client/copy/shell/sessionLifecycle.js +7 -0
- package/dist/client/copy/shell/startup.d.ts +5 -0
- package/dist/client/copy/shell/startup.js +7 -0
- package/dist/client/copy/shell/theme.d.ts +5 -0
- package/dist/client/copy/shell/theme.js +14 -0
- package/dist/client/copy/shell/toast.d.ts +3 -0
- package/dist/client/copy/shell/toast.js +5 -0
- package/dist/client/copy/shell/updateAttempts.d.ts +6 -0
- package/dist/client/copy/shell/updateAttempts.js +8 -0
- package/dist/client/copy/shell/visualTheme.d.ts +4 -0
- package/dist/client/copy/shell/visualTheme.js +6 -0
- package/dist/client/copy/workbench/clauses.d.ts +3 -0
- package/dist/client/copy/workbench/clauses.js +5 -0
- package/dist/client/copy/workbench/components/ApiOperations.d.ts +21 -0
- package/dist/client/copy/workbench/components/ApiOperations.js +23 -0
- package/dist/client/copy/workbench/components/Composer.d.ts +105 -0
- package/dist/client/copy/workbench/components/Composer.js +92 -0
- package/dist/client/copy/workbench/components/Diagram.d.ts +56 -0
- package/dist/client/copy/workbench/components/Diagram.js +46 -0
- package/dist/client/copy/workbench/components/Export.d.ts +26 -0
- package/dist/client/copy/workbench/components/Export.js +25 -0
- package/dist/client/copy/workbench/components/HelpPanel.d.ts +10 -0
- package/dist/client/copy/workbench/components/HelpPanel.js +12 -0
- package/dist/client/copy/workbench/components/History.d.ts +11 -0
- package/dist/client/copy/workbench/components/History.js +10 -0
- package/dist/client/copy/workbench/components/Landing.d.ts +5 -0
- package/dist/client/copy/workbench/components/Landing.js +7 -0
- package/dist/client/copy/workbench/components/SchemaExport.d.ts +24 -0
- package/dist/client/copy/workbench/components/SchemaExport.js +20 -0
- package/dist/client/copy/workbench/components/Summary.d.ts +28 -0
- package/dist/client/copy/workbench/components/Summary.js +24 -0
- package/dist/client/copy/workbench/components/ThemeLab.d.ts +25 -0
- package/dist/client/copy/workbench/components/ThemeLab.js +27 -0
- package/dist/client/copy/workbench/components/WorkPanel.d.ts +12 -0
- package/dist/client/copy/workbench/components/WorkPanel.js +14 -0
- package/dist/client/copy/workbench/composer.d.ts +36 -0
- package/dist/client/copy/workbench/composer.js +32 -0
- package/dist/client/copy/workbench/composerEntry.d.ts +4 -0
- package/dist/client/copy/workbench/composerEntry.js +6 -0
- package/dist/client/copy/workbench/export.d.ts +8 -0
- package/dist/client/copy/workbench/export.js +7 -0
- package/dist/client/copy/workbench/filterbar.d.ts +6 -0
- package/dist/client/copy/workbench/filterbar.js +8 -0
- package/dist/client/copy/workbench/handoff.d.ts +20 -0
- package/dist/client/copy/workbench/handoff.js +19 -0
- package/dist/client/copy/workbench/help.d.ts +6 -0
- package/dist/client/copy/workbench/help.js +8 -0
- package/dist/client/copy/workbench/history.d.ts +3 -0
- package/dist/client/copy/workbench/history.js +5 -0
- package/dist/client/copy/workbench/schemaexport.d.ts +5 -0
- package/dist/client/copy/workbench/schemaexport.js +7 -0
- package/dist/client/copy/workbench/tour.d.ts +22 -0
- package/dist/client/copy/workbench/tour.js +24 -0
- package/dist/client/copy/workbench/views.d.ts +6 -0
- package/dist/client/copy/workbench/views.js +8 -0
- package/dist/client/core.d.ts +312 -0
- package/dist/client/core.js +1067 -0
- package/dist/client/customThemes.css +43 -0
- package/dist/client/dashboard.d.ts +16 -0
- package/dist/client/dashboard.js +35 -0
- package/dist/client/deeplink.d.ts +64 -0
- package/dist/client/deeplink.js +384 -0
- package/dist/client/delete.d.ts +8 -0
- package/dist/client/delete.js +35 -0
- package/dist/client/density.d.ts +8 -0
- package/dist/client/density.js +102 -0
- package/dist/client/devtoolsEventClient.d.ts +27 -0
- package/dist/client/devtoolsEventClient.js +32 -0
- package/dist/client/documents.d.ts +9 -0
- package/dist/client/documents.js +23 -0
- package/dist/client/dom.d.ts +36 -0
- package/dist/client/dom.js +232 -0
- package/dist/client/draftRecovery.d.ts +16 -0
- package/dist/client/draftRecovery.js +56 -0
- package/dist/client/export.d.ts +59 -0
- package/dist/client/export.js +217 -0
- package/dist/client/features.css +2187 -0
- package/dist/client/fieldErrors.d.ts +27 -0
- package/dist/client/fieldErrors.js +20 -0
- package/dist/client/fileSource.d.ts +10 -0
- package/dist/client/fileSource.js +115 -0
- package/dist/client/filterbar.d.ts +87 -0
- package/dist/client/filterbar.js +168 -0
- package/dist/client/firstPaint.d.ts +26 -0
- package/dist/client/firstPaint.js +102 -0
- package/dist/client/fonts/Barlow-OFL.txt +125 -0
- package/dist/client/fonts/IBMPlexMono-OFL.txt +104 -0
- package/dist/client/fonts/Inter-OFL.txt +92 -0
- package/dist/client/fonts/barlow-400.woff2 +0 -0
- package/dist/client/fonts/barlow-600.woff2 +0 -0
- package/dist/client/fonts/barlow-semi-condensed-700.woff2 +0 -0
- package/dist/client/fonts/ibm-plex-mono-400.woff2 +0 -0
- package/dist/client/fonts/ibm-plex-mono-500.woff2 +0 -0
- package/dist/client/fonts/inter-latin.woff2 +0 -0
- package/dist/client/formControls.css +5 -0
- package/dist/client/handoff.d.ts +47 -0
- package/dist/client/handoff.js +138 -0
- package/dist/client/help.css +151 -0
- package/dist/client/help.d.ts +20 -0
- package/dist/client/help.js +103 -0
- package/dist/client/helpContent.d.ts +95 -0
- package/dist/client/helpContent.js +661 -0
- package/dist/client/history.d.ts +10 -0
- package/dist/client/history.js +181 -0
- package/dist/client/historyToken.d.ts +18 -0
- package/dist/client/historyToken.js +27 -0
- package/dist/client/iconWeight.d.ts +16 -0
- package/dist/client/iconWeight.js +44 -0
- package/dist/client/index.html +244 -0
- package/dist/client/insert.d.ts +50 -0
- package/dist/client/insert.js +269 -0
- package/dist/client/kit.d.ts +7 -0
- package/dist/client/kit.js +1 -0
- package/dist/client/layoutDraftRecovery.d.ts +8 -0
- package/dist/client/layoutDraftRecovery.js +33 -0
- package/dist/client/ledgerLook.css +32 -0
- package/dist/client/liveReads.d.ts +23 -0
- package/dist/client/liveReads.js +38 -0
- package/dist/client/liveState.d.ts +94 -0
- package/dist/client/liveState.js +212 -0
- package/dist/client/locale.d.ts +141 -0
- package/dist/client/locale.js +0 -0
- package/dist/client/lumenLook.css +1867 -0
- package/dist/client/menu.d.ts +49 -0
- package/dist/client/menu.js +131 -0
- package/dist/client/menuScope.d.ts +6 -0
- package/dist/client/menuScope.js +4 -0
- package/dist/client/messages.d.ts +240 -0
- package/dist/client/messages.js +370 -0
- package/dist/client/motionStill.d.ts +1 -0
- package/dist/client/motionStill.js +17 -0
- package/dist/client/navigationHold.d.ts +37 -0
- package/dist/client/navigationHold.js +503 -0
- package/dist/client/nested.d.ts +8 -0
- package/dist/client/nested.js +26 -0
- package/dist/client/ownWrites.d.ts +33 -0
- package/dist/client/ownWrites.js +76 -0
- package/dist/client/page.css +4052 -0
- package/dist/client/page.d.ts +21 -0
- package/dist/client/page.js +187 -0
- package/dist/client/pagemarks.d.ts +32 -0
- package/dist/client/pagemarks.js +98 -0
- package/dist/client/palette.d.ts +35 -0
- package/dist/client/palette.js +357 -0
- package/dist/client/partsLook.css +1047 -0
- package/dist/client/peek.d.ts +11 -0
- package/dist/client/peek.js +51 -0
- package/dist/client/peekpanel.d.ts +26 -0
- package/dist/client/peekpanel.js +121 -0
- package/dist/client/pendingWork.d.ts +19 -0
- package/dist/client/pendingWork.js +36 -0
- package/dist/client/pins.d.ts +24 -0
- package/dist/client/pins.js +97 -0
- package/dist/client/prefs.d.ts +3 -0
- package/dist/client/prefs.js +32 -0
- package/dist/client/prompt.d.ts +27 -0
- package/dist/client/prompt.js +61 -0
- package/dist/client/readGathering.d.ts +4 -0
- package/dist/client/readGathering.js +23 -0
- package/dist/client/recordCompose.d.ts +11 -0
- package/dist/client/recordCompose.js +69 -0
- package/dist/client/recordDrafts.d.ts +40 -0
- package/dist/client/recordDrafts.js +57 -0
- package/dist/client/recordEditValidation.d.ts +12 -0
- package/dist/client/recordEditValidation.js +52 -0
- package/dist/client/recordIntent.d.ts +6 -0
- package/dist/client/recordIntent.js +15 -0
- package/dist/client/recordPress.d.ts +12 -0
- package/dist/client/recordPress.js +84 -0
- package/dist/client/recordSource.d.ts +6 -0
- package/dist/client/recordSource.js +15 -0
- package/dist/client/recordTrail.d.ts +77 -0
- package/dist/client/recordTrail.js +101 -0
- package/dist/client/recordWriteRefresh.d.ts +74 -0
- package/dist/client/recordWriteRefresh.js +284 -0
- package/dist/client/relatedRows.d.ts +4 -0
- package/dist/client/relatedRows.js +24 -0
- package/dist/client/requestIdentity.d.ts +36 -0
- package/dist/client/requestIdentity.js +97 -0
- package/dist/client/resourceRequests.d.ts +7 -0
- package/dist/client/resourceRequests.js +32 -0
- package/dist/client/roleLabels.d.ts +7 -0
- package/dist/client/roleLabels.js +24 -0
- package/dist/client/rowEditing.d.ts +15 -0
- package/dist/client/rowEditing.js +36 -0
- package/dist/client/sageLook.css +242 -0
- package/dist/client/savedPages.d.ts +15 -0
- package/dist/client/savedPages.js +123 -0
- package/dist/client/schemaexport.d.ts +14 -0
- package/dist/client/schemaexport.js +182 -0
- package/dist/client/sessionIdentity.d.ts +39 -0
- package/dist/client/sessionIdentity.js +255 -0
- package/dist/client/sessionLifecycle.d.ts +33 -0
- package/dist/client/sessionLifecycle.js +276 -0
- package/dist/client/shellHost.d.ts +70 -0
- package/dist/client/shellHost.js +92 -0
- package/dist/client/shellMain.d.ts +8 -0
- package/dist/client/shellMode.d.ts +433 -0
- package/dist/client/shellMode.js +68 -0
- package/dist/client/shellStart.d.ts +5 -0
- package/dist/client/shellStart.js +54 -0
- package/dist/client/shells.d.ts +123 -0
- package/dist/client/shells.js +1 -0
- package/dist/client/sql.css +139 -0
- package/dist/client/startup.d.ts +8 -0
- package/dist/client/startup.js +85 -0
- package/dist/client/startupHold.d.ts +10 -0
- package/dist/client/startupHold.js +73 -0
- package/dist/client/structure.css +1296 -0
- package/dist/client/style.css +3526 -0
- package/dist/client/styleImports.d.ts +3 -0
- package/dist/client/surfaces.d.ts +18 -0
- package/dist/client/surfaces.js +27 -0
- package/dist/client/surfacesLook.css +88 -0
- package/dist/client/template.d.ts +75 -0
- package/dist/client/template.js +403 -0
- package/dist/client/theme.d.ts +14 -0
- package/dist/client/theme.js +112 -0
- package/dist/client/themeFamilies.css +788 -0
- package/dist/client/thmenu.d.ts +12 -0
- package/dist/client/thmenu.js +94 -0
- package/dist/client/toast.d.ts +7 -0
- package/dist/client/toast.js +117 -0
- package/dist/client/tour.d.ts +8 -0
- package/dist/client/tour.js +176 -0
- package/dist/client/transport.d.ts +2 -0
- package/dist/client/transport.js +13 -0
- package/dist/client/typography.d.ts +4 -0
- package/dist/client/typography.js +51 -0
- package/dist/client/uiBridge.d.ts +57 -0
- package/dist/client/uiBridge.js +30 -0
- package/dist/client/updateAttempts.d.ts +46 -0
- package/dist/client/updateAttempts.js +131 -0
- package/dist/client/url.d.ts +74 -0
- package/dist/client/url.js +388 -0
- package/dist/client/views.d.ts +19 -0
- package/dist/client/views.js +133 -0
- package/dist/client/visualTheme.d.ts +62 -0
- package/dist/client/visualTheme.js +502 -0
- package/dist/client/visualThemes.css +421 -0
- package/dist/client/workshopLook.css +126 -0
- package/dist/client/write.d.ts +100 -0
- package/dist/client/write.js +882 -0
- package/dist/client/writePaths.d.ts +16 -0
- package/dist/client/writePaths.js +35 -0
- package/dist/client/yesNoRule.d.ts +12 -0
- package/dist/client/yesNoRule.js +39 -0
- package/dist/clientFiles.d.ts +11 -4
- package/dist/clientFiles.js +16 -12
- package/dist/vite.d.ts +136 -0
- package/dist/vite.js +571 -0
- package/package.json +130 -3
|
@@ -0,0 +1,882 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Write mode.
|
|
3
|
+
*
|
|
4
|
+
* Workbench defaults to read-only; apps enable editing on writable connections.
|
|
5
|
+
* The connection the browsing path uses remains read-only, so looking
|
|
6
|
+
* around cannot write, even after editing is enabled. Editing goes through a
|
|
7
|
+
* separate connection that the server opens lazily, the first time it is
|
|
8
|
+
* actually asked to write.
|
|
9
|
+
*
|
|
10
|
+
* Editing preferences are remembered separately per connection and workspace.
|
|
11
|
+
* Workbench enabling still requires explicit confirmation.
|
|
12
|
+
* It never grants server permission or carries from one database to another.
|
|
13
|
+
*
|
|
14
|
+
* The real guard is on the server, not here. This file makes the state
|
|
15
|
+
* obvious and asks for confirmation; the server independently refuses any
|
|
16
|
+
* update whose WHERE clause does not match exactly one row.
|
|
17
|
+
*/
|
|
18
|
+
import { ownedBy } from './requestIdentity.js';
|
|
19
|
+
import { api, captureNavigation, columnLabel, currentEntry, el, loadJson, prefersPages, render, saveJson, setRecordMutationPendingProbe, state, toast, } from './core.js';
|
|
20
|
+
import { ask, confirmFor } from './prompt.js';
|
|
21
|
+
import { WriteConfirmDialog } from './components/WriteConfirm.js';
|
|
22
|
+
import { booleanChoices, canEditRow } from './rowEditing.js';
|
|
23
|
+
import { captureSessionIdentity, sessionIdentity, subscribeSessionIdentity } from './sessionIdentity.js';
|
|
24
|
+
import { updateAttempts, updateOwnerKey } from './updateAttempts.js';
|
|
25
|
+
import { createRecordDrafts, draftSchemaKey } from './recordDrafts.js';
|
|
26
|
+
import { shell } from './shellMode.js';
|
|
27
|
+
import { validateRecordEdits } from './recordEditValidation.js';
|
|
28
|
+
import { captureRecordWriteRefresh } from './recordWriteRefresh.js';
|
|
29
|
+
import { connectionGeneration } from './connectionTransition.js';
|
|
30
|
+
import { plural } from './locale.js';
|
|
31
|
+
import { say } from './copy/record/write.js';
|
|
32
|
+
import { isJsonType } from '@mistriwork/engine/shared/schema.js';
|
|
33
|
+
import { addHostListener, portalRoot, shellBody } from './shellHost.js';
|
|
34
|
+
setRecordMutationPendingProbe(recordAutosavePending);
|
|
35
|
+
/* Write mode is remembered per connection.
|
|
36
|
+
Per connection, not globally: switching from the demo to production must
|
|
37
|
+
not silently inherit permission to edit it. Each database is opted into
|
|
38
|
+
separately, and the choice sticks until it is turned off. */
|
|
39
|
+
const WRITE_KEY = 'mistri.write.v1';
|
|
40
|
+
const APP_WRITE_KEY = 'mistri.app-editing.v1';
|
|
41
|
+
const connectionKey = () => state.activeConnection ?? 'default';
|
|
42
|
+
const writableConnection = () => Boolean(state.connections?.find((c) => c.id === state.activeConnection)?.writable);
|
|
43
|
+
function rememberedWrite() {
|
|
44
|
+
if (prefersPages())
|
|
45
|
+
return writableConnection() && loadJson(APP_WRITE_KEY, {})[connectionKey()] !== false;
|
|
46
|
+
return loadJson(WRITE_KEY, {})[connectionKey()] === true;
|
|
47
|
+
}
|
|
48
|
+
function rememberWrite(on) {
|
|
49
|
+
const storageKey = prefersPages() ? APP_WRITE_KEY : WRITE_KEY;
|
|
50
|
+
const all = loadJson(storageKey, {});
|
|
51
|
+
all[connectionKey()] = on;
|
|
52
|
+
saveJson(storageKey, all);
|
|
53
|
+
}
|
|
54
|
+
export function initWriteMode() {
|
|
55
|
+
// Restored without asking again: the confirmation was given for this
|
|
56
|
+
// database and has not been withdrawn.
|
|
57
|
+
setWriteMode(rememberedWrite(), { remember: false });
|
|
58
|
+
}
|
|
59
|
+
/** Mode changes must not hide pending work or interrupt an acknowledged save. */
|
|
60
|
+
export async function prepareEditingExit() {
|
|
61
|
+
if (shell().mutations.hasUnresolved()) {
|
|
62
|
+
toast(say('resolveThePendingOrUnconfirmed'), 'error');
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
if (applyingStaged()) {
|
|
66
|
+
toast(say('waitForThePending'), 'error');
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const connection = state.activeConnection;
|
|
70
|
+
const schema = state.schema;
|
|
71
|
+
const entry = currentEntry();
|
|
72
|
+
const mode = prefersPages();
|
|
73
|
+
const captured = staged;
|
|
74
|
+
if (pendingCount() &&
|
|
75
|
+
!(await confirmFor({
|
|
76
|
+
title: say('discardPendingRecordChanges'),
|
|
77
|
+
body: say('theseFieldChangesHaveNotBeen'),
|
|
78
|
+
confirmLabel: say('discardChanges'),
|
|
79
|
+
})))
|
|
80
|
+
return false;
|
|
81
|
+
if (connection !== state.activeConnection ||
|
|
82
|
+
schema !== state.schema ||
|
|
83
|
+
entry !== currentEntry() ||
|
|
84
|
+
mode !== prefersPages() ||
|
|
85
|
+
captured !== staged ||
|
|
86
|
+
applyingStaged() ||
|
|
87
|
+
shell().mutations.hasUnresolved())
|
|
88
|
+
return false;
|
|
89
|
+
discardStaged();
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
export async function toggleWriteMode() {
|
|
93
|
+
if (state.canWrite) {
|
|
94
|
+
if (await prepareEditingExit())
|
|
95
|
+
setWriteMode(false);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const connection = state.activeConnection;
|
|
99
|
+
const schema = state.schema;
|
|
100
|
+
const app = prefersPages();
|
|
101
|
+
if (app && !writableConnection()) {
|
|
102
|
+
toast(say('thisConnectionIsRead'), 'error');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if ((app || (await confirmWrite())) && connection === state.activeConnection && schema === state.schema && app === prefersPages())
|
|
106
|
+
setWriteMode(true);
|
|
107
|
+
}
|
|
108
|
+
/** Re-evaluate on connection switch, since the setting is per database. */
|
|
109
|
+
export function syncWriteMode() {
|
|
110
|
+
setWriteMode(rememberedWrite(), { remember: false });
|
|
111
|
+
}
|
|
112
|
+
function setWriteMode(on, { remember = true } = {}) {
|
|
113
|
+
state.canWrite = on;
|
|
114
|
+
if (remember)
|
|
115
|
+
rememberWrite(on);
|
|
116
|
+
/* The indicator is on <body> rather than the button, so it can colour the
|
|
117
|
+
window frame. Being in write mode should be visible from across the room,
|
|
118
|
+
not something you have to go looking for. */
|
|
119
|
+
shellBody().classList.toggle('write-mode', on && !prefersPages());
|
|
120
|
+
// Explicit mode exits discard above; automatic connection changes retain drafts.
|
|
121
|
+
if (!on && remember)
|
|
122
|
+
discardStaged();
|
|
123
|
+
render();
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A real confirmation, naming the database — `components/WriteConfirm.tsx`.
|
|
127
|
+
* "Are you sure?" teaches nothing; the name of the thing you are about to
|
|
128
|
+
* be able to change does.
|
|
129
|
+
*/
|
|
130
|
+
function confirmWrite() {
|
|
131
|
+
return ask(WriteConfirmDialog, { label: state.schema.label });
|
|
132
|
+
}
|
|
133
|
+
/* ---------- staged edits ----------
|
|
134
|
+
|
|
135
|
+
Every submission captures the whole draft as one update. An opted-in App
|
|
136
|
+
can submit on an owned blur; Workbench keeps explicit review and apply.
|
|
137
|
+
|
|
138
|
+
Staging is keyed by table and row, so walking away and back does not
|
|
139
|
+
silently carry pending edits onto a different row. */
|
|
140
|
+
const drafts = createRecordDrafts();
|
|
141
|
+
const emptyDraft = () => ({
|
|
142
|
+
connection: null,
|
|
143
|
+
table: '',
|
|
144
|
+
key: {},
|
|
145
|
+
schemaKey: '',
|
|
146
|
+
needsReview: false,
|
|
147
|
+
manualSaveRequired: false,
|
|
148
|
+
values: {},
|
|
149
|
+
originals: {},
|
|
150
|
+
inputs: {},
|
|
151
|
+
});
|
|
152
|
+
let staged = emptyDraft();
|
|
153
|
+
subscribeSessionIdentity(() => {
|
|
154
|
+
cancelRecordAutosave();
|
|
155
|
+
drafts.clear();
|
|
156
|
+
staged = emptyDraft();
|
|
157
|
+
tell();
|
|
158
|
+
});
|
|
159
|
+
export function activateDraft(table, key) {
|
|
160
|
+
const next = drafts.acquire({ connection: state.activeConnection ?? null, table: table.id, key }, draftSchemaKey(table));
|
|
161
|
+
if (next === staged)
|
|
162
|
+
return staged;
|
|
163
|
+
staged = next;
|
|
164
|
+
tell();
|
|
165
|
+
return staged;
|
|
166
|
+
}
|
|
167
|
+
export function suspendDraft(draft) {
|
|
168
|
+
const retained = draft === staged && prefersPages() && Object.keys(draft.values).length > 0 && !updateAttempts.get(draft);
|
|
169
|
+
if (draft === staged)
|
|
170
|
+
cancelRecordAutosave();
|
|
171
|
+
drafts.suspend(draft);
|
|
172
|
+
feedback.delete(draft);
|
|
173
|
+
if (draft === staged)
|
|
174
|
+
staged = emptyDraft();
|
|
175
|
+
if (retained)
|
|
176
|
+
toast(say('unsavedChangesWereRetained'), 'info');
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The record the reader has an unsaved draft of, for live sync (liveInvalidate.ts): a change another person made to
|
|
180
|
+
* it does not reach the form, it is said beside it (components/LiveNotice.tsx).
|
|
181
|
+
* @returns {{ table: string, key: Record<string, unknown>, originals: Record<string, unknown>, values: Record<string, unknown> } | undefined}
|
|
182
|
+
*/
|
|
183
|
+
export const dirtyDraft = () => staged.connection === (state.activeConnection ?? null) && Object.keys(staged.values).length ? staged : undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Take another person's value for one field of the draft: the form shows it, and Save checks against it.
|
|
186
|
+
* @param {string} column
|
|
187
|
+
* @param {unknown} value
|
|
188
|
+
*/
|
|
189
|
+
export function takeTheirs(column, value) {
|
|
190
|
+
if (!Object.keys(staged.values).length)
|
|
191
|
+
return;
|
|
192
|
+
staged.values[column] = value;
|
|
193
|
+
staged.originals[column] = value;
|
|
194
|
+
tell();
|
|
195
|
+
}
|
|
196
|
+
export const draftNeedsReview = (table, key) => sameRow(table, key) && staged.needsReview;
|
|
197
|
+
export const draftRequiresManualSave = (table, key) => sameRow(table, key) && staged.manualSaveRequired;
|
|
198
|
+
export const draftSchemaChanged = (table) => staged.schemaKey !== draftSchemaKey(table);
|
|
199
|
+
export const retainedValues = () => ({ ...staged.values });
|
|
200
|
+
export const stagedOriginal = (column) => (staged.needsReview ? undefined : staged.originals[column]);
|
|
201
|
+
export function resumeDraft(table, key) {
|
|
202
|
+
if (!sameRow(table.id, key) || draftSchemaChanged(table) || !canEditRow(table, key) || stagedAttempt(table.id, key))
|
|
203
|
+
return;
|
|
204
|
+
staged.needsReview = false;
|
|
205
|
+
tell();
|
|
206
|
+
}
|
|
207
|
+
addHostListener(window, 'beforeunload', (event) => {
|
|
208
|
+
if (!drafts.hasPending())
|
|
209
|
+
return;
|
|
210
|
+
event.preventDefault();
|
|
211
|
+
event.returnValue = '';
|
|
212
|
+
});
|
|
213
|
+
export function pendingCount() {
|
|
214
|
+
return staged.connection === (state.activeConnection ?? null) ? Object.keys(staged.values).length : 0;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Whether what is staged belongs to the row on screen.
|
|
218
|
+
*
|
|
219
|
+
* The connection is part of the answer. Keyed by table and key alone, an edit
|
|
220
|
+
* staged against staging's `customer:4` showed as pending on production's
|
|
221
|
+
* `customer:4` — the same table name and the same id, a different database,
|
|
222
|
+
* and one click from being written to the wrong one.
|
|
223
|
+
*/
|
|
224
|
+
function sameRow(table, key) {
|
|
225
|
+
return updateOwnerKey(staged) === updateOwnerKey({ connection: state.activeConnection ?? null, table, key });
|
|
226
|
+
}
|
|
227
|
+
export function discardStaged() {
|
|
228
|
+
cancelRecordAutosave();
|
|
229
|
+
editErrors.delete(staged);
|
|
230
|
+
clearServerErrors(staged);
|
|
231
|
+
discards.set(staged, (discards.get(staged) ?? 0) + 1);
|
|
232
|
+
if (staged.connection === (state.activeConnection ?? null)) {
|
|
233
|
+
staged.values = {};
|
|
234
|
+
staged.originals = {};
|
|
235
|
+
staged.needsReview = false;
|
|
236
|
+
staged.manualSaveRequired = false;
|
|
237
|
+
feedback.delete(staged);
|
|
238
|
+
}
|
|
239
|
+
else
|
|
240
|
+
staged = emptyDraft();
|
|
241
|
+
tell();
|
|
242
|
+
}
|
|
243
|
+
/* A flag's two stored values and whether a row may be edited live in
|
|
244
|
+
rowEditing.js, where a grid's cell asks them too; re-exported for the
|
|
245
|
+
record editors that have always asked here. */
|
|
246
|
+
export { booleanChoices, canEditRow };
|
|
247
|
+
/* The editor and the pending bar are components (components/Editable.tsx); they
|
|
248
|
+
read this store and tick with it. */
|
|
249
|
+
const listeners = new Set();
|
|
250
|
+
const feedback = new WeakMap();
|
|
251
|
+
const discards = new WeakMap();
|
|
252
|
+
/** @type {WeakMap<import('./recordDrafts.js').RecordDraft, Readonly<Record<string, string>>>} */
|
|
253
|
+
const editErrors = new WeakMap();
|
|
254
|
+
/* The fields a refused save named, marked on the record until each is edited.
|
|
255
|
+
Kept apart from the preflight's errors, which are recomputed from the draft
|
|
256
|
+
on every edit and would otherwise wipe a mark the reader has not touched. */
|
|
257
|
+
/** @type {WeakMap<import('./recordDrafts.js').RecordDraft, Readonly<Record<string, string>>>} */
|
|
258
|
+
const serverErrors = new WeakMap();
|
|
259
|
+
/** @type {WeakMap<Readonly<Record<string, string>>, { client: Readonly<Record<string, string>>, errors: Readonly<Record<string, string>> }>} */
|
|
260
|
+
const mergedErrors = new WeakMap();
|
|
261
|
+
/* The first field a refused explicit Save marked. Its editor may not be drawn
|
|
262
|
+
yet — an unopened field opens because it is marked — so the editor takes
|
|
263
|
+
the focus when it is, once. */
|
|
264
|
+
/** @type {{ draft: import('./recordDrafts.js').RecordDraft, field: string } | null} */
|
|
265
|
+
let fieldFocus = null;
|
|
266
|
+
const noEditErrors = Object.freeze({});
|
|
267
|
+
let version = 0;
|
|
268
|
+
function tell() {
|
|
269
|
+
version += 1;
|
|
270
|
+
for (const fn of listeners)
|
|
271
|
+
fn();
|
|
272
|
+
}
|
|
273
|
+
export function subscribeStaged(fn) {
|
|
274
|
+
listeners.add(fn);
|
|
275
|
+
const unsubscribe = updateAttempts.subscribe(fn);
|
|
276
|
+
return () => {
|
|
277
|
+
listeners.delete(fn);
|
|
278
|
+
unsubscribe();
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
export const stagedVersion = () => version + updateAttempts.version();
|
|
282
|
+
/** @returns {import('./updateAttempts.js').UpdateAttempt | undefined} */
|
|
283
|
+
export const stagedAttempt = (table, key) => updateAttempts.get({ connection: state.activeConnection ?? null, table, key });
|
|
284
|
+
export const stagedFeedback = (table, key) => (sameRow(table, key) ? feedback.get(staged) : undefined);
|
|
285
|
+
export const stagedDiscardVersion = (table, key) => (sameRow(table, key) ? (discards.get(staged) ?? 0) : 0);
|
|
286
|
+
/** @returns {Readonly<Record<string, string>>} */
|
|
287
|
+
export const stagedEditErrors = (tableId, key) => (sameRow(tableId, key) ? draftErrors(staged) : noEditErrors);
|
|
288
|
+
/* The preflight's word wins over a refusal's for the same field: it is about
|
|
289
|
+
the value on screen now, the refusal about the one that was sent. */
|
|
290
|
+
function draftErrors(draft) {
|
|
291
|
+
const client = editErrors.get(draft) ?? noEditErrors;
|
|
292
|
+
const server = serverErrors.get(draft);
|
|
293
|
+
if (!server)
|
|
294
|
+
return client;
|
|
295
|
+
const cached = mergedErrors.get(server);
|
|
296
|
+
if (cached?.client === client)
|
|
297
|
+
return cached.errors;
|
|
298
|
+
const errors = Object.freeze({ ...server, ...client });
|
|
299
|
+
mergedErrors.set(server, { client, errors });
|
|
300
|
+
return errors;
|
|
301
|
+
}
|
|
302
|
+
/** Whether this field's editor should take the focus a refused Save left for it. Consumed. */
|
|
303
|
+
export function takeFieldFocus(tableId, key, column) {
|
|
304
|
+
if (!fieldFocus || fieldFocus.draft !== staged || fieldFocus.field !== column || !sameRow(tableId, key))
|
|
305
|
+
return false;
|
|
306
|
+
fieldFocus = null;
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
/* A column's own mark, and its row-defined fields' (`specs.capacity`): the
|
|
310
|
+
whole object is what was staged again. */
|
|
311
|
+
function clearServerError(draft, name) {
|
|
312
|
+
const server = serverErrors.get(draft);
|
|
313
|
+
const of = (field) => field === name || field.startsWith(`${name}.`);
|
|
314
|
+
if (fieldFocus?.draft === draft && of(fieldFocus.field))
|
|
315
|
+
fieldFocus = null;
|
|
316
|
+
if (!server || !Object.keys(server).some(of))
|
|
317
|
+
return;
|
|
318
|
+
const rest = Object.fromEntries(Object.entries(server).filter(([field]) => !of(field)));
|
|
319
|
+
if (Object.keys(rest).length)
|
|
320
|
+
serverErrors.set(draft, Object.freeze(rest));
|
|
321
|
+
else
|
|
322
|
+
serverErrors.delete(draft);
|
|
323
|
+
}
|
|
324
|
+
function clearServerErrors(draft) {
|
|
325
|
+
serverErrors.delete(draft);
|
|
326
|
+
if (fieldFocus?.draft === draft)
|
|
327
|
+
fieldFocus = null;
|
|
328
|
+
}
|
|
329
|
+
/* A field is on screen when its editor — open or not — is registered and
|
|
330
|
+
drawn. Presence, not focusability: a pending save disables the launchers. */
|
|
331
|
+
function fieldOnScreen(draft, name) {
|
|
332
|
+
const root = draft.inputs[name]?.element;
|
|
333
|
+
return Boolean(root?.isConnected && !root.closest('[hidden], [inert], [aria-hidden="true"]'));
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Mark the fields a refused save named — the New form's contract, through the
|
|
337
|
+
* same shape check — on the record they are drawn on, and say in the summary
|
|
338
|
+
* only what cannot be marked: fields this record does not show, or none named
|
|
339
|
+
* at all. An explicit Save leaves the focus on the first marked field in
|
|
340
|
+
* catalog order; a blur save leaves it where the reader moved it.
|
|
341
|
+
* @returns {string} The summary, empty when every named field is marked.
|
|
342
|
+
*/
|
|
343
|
+
function markRefusal(draft, table, result, focus) {
|
|
344
|
+
const marks = Object.create(null);
|
|
345
|
+
const unplaced = [];
|
|
346
|
+
for (const { field, message } of result.fields ?? []) {
|
|
347
|
+
// A row-defined field is `column.key` (definedFields.ts), marked where its own editor is registered under that name.
|
|
348
|
+
const column = table.columns?.find((candidate) => candidate.name === field.split('.')[0]);
|
|
349
|
+
if (column && fieldOnScreen(draft, field))
|
|
350
|
+
marks[field] = message;
|
|
351
|
+
else
|
|
352
|
+
unplaced.push(column ? `${columnLabel(table.id, field) ?? field}: ${message}` : '');
|
|
353
|
+
}
|
|
354
|
+
const marked = Object.keys(marks);
|
|
355
|
+
if (marked.length)
|
|
356
|
+
serverErrors.set(draft, Object.freeze(marks));
|
|
357
|
+
else
|
|
358
|
+
clearServerErrors(draft);
|
|
359
|
+
const first = table.columns?.find((column) => Object.hasOwn(marks, column.name))?.name ??
|
|
360
|
+
marked.find((field) => table.columns?.some((column) => field.startsWith(`${column.name}.`)));
|
|
361
|
+
fieldFocus = focus && first ? { draft, field: first } : fieldFocus?.draft === draft ? null : fieldFocus;
|
|
362
|
+
if (marked.length && !unplaced.length)
|
|
363
|
+
return '';
|
|
364
|
+
return [result.message, ...unplaced.filter(Boolean)].join(' ');
|
|
365
|
+
}
|
|
366
|
+
export function dismissSaveFeedback() {
|
|
367
|
+
feedback.delete(staged);
|
|
368
|
+
tell();
|
|
369
|
+
}
|
|
370
|
+
function readEditControls(draft) {
|
|
371
|
+
/** @type {Record<string, import('./recordEditValidation.js').RecordEditControlState>} */
|
|
372
|
+
const controls = Object.create(null);
|
|
373
|
+
for (const [name, registered] of Object.entries(draft.inputs)) {
|
|
374
|
+
if (!registered.element.isConnected || !registered.readState)
|
|
375
|
+
continue;
|
|
376
|
+
try {
|
|
377
|
+
const value = registered.readState();
|
|
378
|
+
if (!value || typeof value !== 'object' || Array.isArray(value) || 'then' in value)
|
|
379
|
+
throw new Error();
|
|
380
|
+
const { unresolvedReference, invalidInput } = value;
|
|
381
|
+
if ((unresolvedReference !== undefined && typeof unresolvedReference !== 'boolean') ||
|
|
382
|
+
(invalidInput !== undefined && typeof invalidInput !== 'boolean'))
|
|
383
|
+
throw new Error();
|
|
384
|
+
controls[name] = { unresolvedReference, invalidInput };
|
|
385
|
+
}
|
|
386
|
+
catch {
|
|
387
|
+
// Control faults never expose callback diagnostics or permit a partial save.
|
|
388
|
+
controls[name] = { invalidInput: true };
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return controls;
|
|
392
|
+
}
|
|
393
|
+
function errorControl(draft, name) {
|
|
394
|
+
const root = draft.inputs[name]?.element;
|
|
395
|
+
if (!root?.isConnected || root.closest('[hidden], [inert], [aria-hidden="true"]'))
|
|
396
|
+
return;
|
|
397
|
+
const selector = 'input:not(:disabled):not([type="hidden"]), textarea:not(:disabled), select:not(:disabled), button:not(:disabled), [tabindex]:not([tabindex="-1"])';
|
|
398
|
+
return root.matches(selector) ? root : root.querySelector(selector);
|
|
399
|
+
}
|
|
400
|
+
function publishEditValidation(draft, errors) {
|
|
401
|
+
const previous = editErrors.get(draft) ?? noEditErrors;
|
|
402
|
+
const names = Object.keys(errors);
|
|
403
|
+
let changed = names.length !== Object.keys(previous).length || names.some((name) => errors[name] !== previous[name]);
|
|
404
|
+
editErrors.set(draft, changed ? errors : previous);
|
|
405
|
+
const inaccessible = names.filter((name) => !errorControl(draft, name));
|
|
406
|
+
const priorFeedback = feedback.get(draft);
|
|
407
|
+
if (inaccessible.length) {
|
|
408
|
+
const message = inaccessible.map((name) => `${name}: ${errors[name]}`).join(' ');
|
|
409
|
+
if (priorFeedback?.source !== 'validation' || priorFeedback.message !== message) {
|
|
410
|
+
feedback.set(draft, { phase: 'error', source: 'validation', message });
|
|
411
|
+
changed = true;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
else if (priorFeedback?.source === 'validation') {
|
|
415
|
+
feedback.delete(draft);
|
|
416
|
+
changed = true;
|
|
417
|
+
}
|
|
418
|
+
return changed;
|
|
419
|
+
}
|
|
420
|
+
/** Corrections may clear attempted validation, but mounting stays quiet. */
|
|
421
|
+
export function refreshEditValidation(table, key) {
|
|
422
|
+
if (!prefersPages() || !sameRow(table.id, key) || !editErrors.has(staged))
|
|
423
|
+
return;
|
|
424
|
+
const captured = staged, revision = stagedVersion();
|
|
425
|
+
const currentTable = state.schema?.tables?.find((candidate) => candidate.id === table.id) ?? table;
|
|
426
|
+
const errors = validateRecordEdits(currentTable, captured.values, readEditControls(captured));
|
|
427
|
+
if (captured !== staged || revision !== stagedVersion() || !sameRow(table.id, key))
|
|
428
|
+
return;
|
|
429
|
+
if (publishEditValidation(captured, errors))
|
|
430
|
+
tell();
|
|
431
|
+
}
|
|
432
|
+
/** What is staged for a column of the row on screen, or undefined. */
|
|
433
|
+
export const stagedValue = (column) => (staged.needsReview ? undefined : staged.values[column]);
|
|
434
|
+
export const pendingColumns = () => Object.keys(staged.values);
|
|
435
|
+
/**
|
|
436
|
+
* Stage one change. Typing a value and then typing the original back is not
|
|
437
|
+
* a change. Exported for the editor component.
|
|
438
|
+
*/
|
|
439
|
+
export function stage(table, key, column, value, original) {
|
|
440
|
+
const known = table.columns?.find((c) => c.name === column.name);
|
|
441
|
+
// A declared transition moves only through the record's actions.
|
|
442
|
+
if (column.writable === false || column.changesBy === 'actions' || known?.writable === false || known?.changesBy === 'actions')
|
|
443
|
+
return;
|
|
444
|
+
// Freeze before an autosave publishes pending state. Other staged operations
|
|
445
|
+
// (notably Undo reconciliation) still preserve edits begun while they settle.
|
|
446
|
+
if (stagedAttempt(table.id, key) || (recordAutosavePending() && sameRow(table.id, key)))
|
|
447
|
+
return;
|
|
448
|
+
activateDraft(table, key);
|
|
449
|
+
if (staged.needsReview)
|
|
450
|
+
return;
|
|
451
|
+
feedback.delete(staged);
|
|
452
|
+
// An edited field is the reader's answer to its mark; the others keep theirs.
|
|
453
|
+
clearServerError(staged, column.name);
|
|
454
|
+
if (Object.hasOwn(staged.originals, column.name))
|
|
455
|
+
original = staged.originals[column.name];
|
|
456
|
+
// Text inputs stringify numbers and booleans, but NULL is not the text "null".
|
|
457
|
+
const unchanged = value === null || original === null ? value === original : String(value) === String(original);
|
|
458
|
+
if (unchanged) {
|
|
459
|
+
delete staged.values[column.name];
|
|
460
|
+
delete staged.originals[column.name];
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
staged.values[column.name] = value;
|
|
464
|
+
staged.originals[column.name] = original;
|
|
465
|
+
/* A row-defined field (DefinedFields.tsx) is staged under `column.key`
|
|
466
|
+
and saved as its column's whole object: the object it was read in and
|
|
467
|
+
how its box's text becomes a value ride with the draft. */
|
|
468
|
+
if (column.defined)
|
|
469
|
+
(staged.folds ??= {})[column.name] = column.defined;
|
|
470
|
+
}
|
|
471
|
+
refreshEditValidation(table, key);
|
|
472
|
+
tell();
|
|
473
|
+
}
|
|
474
|
+
/* What is sent: each row-defined field folded into its column's object, as
|
|
475
|
+
JSON text (the server writes and judges the whole object). */
|
|
476
|
+
function folded(draft, values, originals) {
|
|
477
|
+
const folds = draft.folds ?? {};
|
|
478
|
+
const fields = Object.keys(values).filter((name) => Object.hasOwn(folds, name));
|
|
479
|
+
if (!fields.length)
|
|
480
|
+
return { values, originals };
|
|
481
|
+
const objects = {};
|
|
482
|
+
const sent = { ...values }, guarded = { ...originals };
|
|
483
|
+
for (const name of fields) {
|
|
484
|
+
const { column, object, toValue } = folds[name];
|
|
485
|
+
const next = (objects[column] ??= { ...object });
|
|
486
|
+
const value = toValue(values[name]);
|
|
487
|
+
if (value === undefined)
|
|
488
|
+
delete next[name.slice(column.length + 1)];
|
|
489
|
+
else
|
|
490
|
+
next[name.slice(column.length + 1)] = value;
|
|
491
|
+
delete sent[name];
|
|
492
|
+
delete guarded[name];
|
|
493
|
+
}
|
|
494
|
+
for (const [column, object] of Object.entries(objects))
|
|
495
|
+
sent[column] = JSON.stringify(object);
|
|
496
|
+
return { values: sent, originals: guarded };
|
|
497
|
+
}
|
|
498
|
+
/** The editor's element, kept so a successful write can confirm in place.
|
|
499
|
+
* @param {() => import('./recordEditValidation.js').RecordEditControlState} [readState]
|
|
500
|
+
*/
|
|
501
|
+
export function registerInput(table, key, column, input, onCommitted, readState) {
|
|
502
|
+
activateDraft(table, key);
|
|
503
|
+
const captured = staged, registration = { element: input, onCommitted, readState };
|
|
504
|
+
Object.defineProperty(captured.inputs, column, { value: registration, configurable: true, writable: true, enumerable: true });
|
|
505
|
+
return () => {
|
|
506
|
+
if (captured.inputs[column] === registration)
|
|
507
|
+
delete captured.inputs[column];
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
export { sameRow };
|
|
511
|
+
/* An update's guard names each changed column at the value it was read with —
|
|
512
|
+
but a JSON column's, which no engine compares: it is written whole. */
|
|
513
|
+
function comparable(table, originals) {
|
|
514
|
+
const json = new Set((table.columns ?? []).filter((column) => isJsonType(column.type)).map((column) => column.name));
|
|
515
|
+
return json.size ? Object.fromEntries(Object.entries(originals).filter(([column]) => !json.has(column))) : originals;
|
|
516
|
+
}
|
|
517
|
+
let applying = false;
|
|
518
|
+
export const applyingStaged = () => applying;
|
|
519
|
+
let autosaveCancellation = 0;
|
|
520
|
+
/** @type {ReturnType<typeof captureSessionIdentity> | undefined} */
|
|
521
|
+
let autosaveIdentity;
|
|
522
|
+
/** @type {import('./updateAttempts.js').UpdateOwner | undefined} */
|
|
523
|
+
let autosaveOwner;
|
|
524
|
+
/** Deferred intent only: an already dispatched write still settles normally. */
|
|
525
|
+
export function cancelRecordAutosave() {
|
|
526
|
+
autosaveCancellation++;
|
|
527
|
+
}
|
|
528
|
+
export function recordAutosavePending() {
|
|
529
|
+
// Ordinary uncertainty keeps the record locked, not every route. Tenant
|
|
530
|
+
// uncertainty still has its independent stronger navigation gate in core.
|
|
531
|
+
return (autosaveIdentity !== undefined &&
|
|
532
|
+
autosaveIdentity === sessionIdentity() &&
|
|
533
|
+
autosaveOwner !== undefined &&
|
|
534
|
+
updateAttempts.get(autosaveOwner)?.phase !== 'uncertain');
|
|
535
|
+
}
|
|
536
|
+
/** Capture only for a fresh user edit leaving its complete interaction surface.
|
|
537
|
+
* This predicate does not schedule or send anything. The interaction owner must
|
|
538
|
+
* also prove its mount, picker state and current App save policy at dispatch. */
|
|
539
|
+
export function captureRecordAutosaveGuard(table, key, stillEditing) {
|
|
540
|
+
const captured = staged, identity = captureSessionIdentity(), schema = state.schema;
|
|
541
|
+
const capturedKey = { ...key }, revision = stagedVersion();
|
|
542
|
+
const cancellation = autosaveCancellation;
|
|
543
|
+
const navigation = captureNavigation();
|
|
544
|
+
const current = () => {
|
|
545
|
+
try {
|
|
546
|
+
return (typeof stillEditing === 'function' &&
|
|
547
|
+
stillEditing() === true &&
|
|
548
|
+
cancellation === autosaveCancellation &&
|
|
549
|
+
prefersPages() &&
|
|
550
|
+
navigation() &&
|
|
551
|
+
captured === staged &&
|
|
552
|
+
identity === sessionIdentity() &&
|
|
553
|
+
schema === state.schema &&
|
|
554
|
+
revision === stagedVersion() &&
|
|
555
|
+
sameRow(table.id, capturedKey) &&
|
|
556
|
+
pendingCount() > 0 &&
|
|
557
|
+
!staged.needsReview &&
|
|
558
|
+
!staged.manualSaveRequired &&
|
|
559
|
+
!applying &&
|
|
560
|
+
!stagedAttempt(table.id, capturedKey) &&
|
|
561
|
+
!draftSchemaChanged(table) &&
|
|
562
|
+
canEditRow(table, capturedKey));
|
|
563
|
+
}
|
|
564
|
+
catch {
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
// An initially ineligible draft cannot be armed later by Resume, policy
|
|
569
|
+
// changes, another acknowledgement or programmatic focus restoration.
|
|
570
|
+
return current() ? current : () => false;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* @param {(opts?: { inPlace?: boolean }) => void} [onDone]
|
|
574
|
+
* @param {{ trigger?: 'explicit'|'blur', guard?: () => boolean }} [options]
|
|
575
|
+
*/
|
|
576
|
+
export async function applyStaged(table, key, onDone = undefined, options = {}) {
|
|
577
|
+
const trigger = options.trigger ?? 'explicit';
|
|
578
|
+
if (trigger !== 'explicit' && trigger !== 'blur')
|
|
579
|
+
return;
|
|
580
|
+
const blur = trigger === 'blur';
|
|
581
|
+
// Do not cancel the supplied blur capture before checking it.
|
|
582
|
+
if (!blur)
|
|
583
|
+
cancelRecordAutosave();
|
|
584
|
+
const guard = () => {
|
|
585
|
+
try {
|
|
586
|
+
return typeof options.guard === 'function' && options.guard() === true;
|
|
587
|
+
}
|
|
588
|
+
catch {
|
|
589
|
+
return false;
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
if (blur && (!prefersPages() || staged.manualSaveRequired || !guard()))
|
|
593
|
+
return;
|
|
594
|
+
if (applying || staged.needsReview || stagedAttempt(table.id, key) || !sameRow(table.id, key))
|
|
595
|
+
return;
|
|
596
|
+
if (!pendingCount()) {
|
|
597
|
+
if (!blur && staged.manualSaveRequired) {
|
|
598
|
+
staged.manualSaveRequired = false;
|
|
599
|
+
editErrors.delete(staged);
|
|
600
|
+
clearServerErrors(staged);
|
|
601
|
+
feedback.delete(staged);
|
|
602
|
+
tell();
|
|
603
|
+
}
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
const currentTable = state.schema?.tables ? state.schema.tables.find((candidate) => candidate.id === table.id) : table;
|
|
607
|
+
if (!currentTable ||
|
|
608
|
+
draftSchemaChanged(currentTable) ||
|
|
609
|
+
draftSchemaChanged(table) ||
|
|
610
|
+
Object.keys(staged.values).some((name) => {
|
|
611
|
+
const column = currentTable.columns?.find((c) => c.name === name);
|
|
612
|
+
return column?.writable === false || column?.changesBy === 'actions';
|
|
613
|
+
}))
|
|
614
|
+
return;
|
|
615
|
+
const app = prefersPages();
|
|
616
|
+
if (app && !canEditRow(currentTable, key))
|
|
617
|
+
return;
|
|
618
|
+
const captured = staged;
|
|
619
|
+
const connection = captured.connection;
|
|
620
|
+
const staging = { ...staged.values };
|
|
621
|
+
const { values, originals } = folded(captured, staging, { ...staged.originals });
|
|
622
|
+
key = { ...key };
|
|
623
|
+
const schema = state.schema;
|
|
624
|
+
const identity = captureSessionIdentity();
|
|
625
|
+
const generation = connectionGeneration();
|
|
626
|
+
const navigation = blur ? captureNavigation() : () => true;
|
|
627
|
+
const cancellation = autosaveCancellation, revision = stagedVersion();
|
|
628
|
+
if (app) {
|
|
629
|
+
const errors = validateRecordEdits(currentTable, values, readEditControls(captured));
|
|
630
|
+
if (captured !== staged ||
|
|
631
|
+
revision !== stagedVersion() ||
|
|
632
|
+
schema !== state.schema ||
|
|
633
|
+
identity !== sessionIdentity() ||
|
|
634
|
+
cancellation !== autosaveCancellation ||
|
|
635
|
+
!sameRow(table.id, key) ||
|
|
636
|
+
!canEditRow(currentTable, key) ||
|
|
637
|
+
(blur && !guard()))
|
|
638
|
+
return;
|
|
639
|
+
const changed = publishEditValidation(captured, errors);
|
|
640
|
+
if (Object.keys(errors).length) {
|
|
641
|
+
if (changed)
|
|
642
|
+
tell();
|
|
643
|
+
if (!blur && captured === staged && identity === sessionIdentity() && sameRow(table.id, key)) {
|
|
644
|
+
const first = Object.keys(errors)
|
|
645
|
+
.map((name) => errorControl(captured, name))
|
|
646
|
+
.find(Boolean);
|
|
647
|
+
first?.focus();
|
|
648
|
+
}
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
feedback.delete(captured);
|
|
653
|
+
const current = () => identity === sessionIdentity() && captured === staged && sameRow(table.id, key) && state.canWrite;
|
|
654
|
+
const dispatchCurrent = () => current() &&
|
|
655
|
+
schema === state.schema &&
|
|
656
|
+
generation === connectionGeneration() &&
|
|
657
|
+
!draftSchemaChanged(table) &&
|
|
658
|
+
(!app || (prefersPages() && canEditRow(currentTable, key))) &&
|
|
659
|
+
(!blur || (navigation() && cancellation === autosaveCancellation && !captured.manualSaveRequired && !captured.needsReview));
|
|
660
|
+
applying = true;
|
|
661
|
+
if (blur) {
|
|
662
|
+
autosaveIdentity = identity;
|
|
663
|
+
autosaveOwner = { connection: connection ?? null, table: table.id, key: { ...key } };
|
|
664
|
+
}
|
|
665
|
+
try {
|
|
666
|
+
tell();
|
|
667
|
+
const ok = app || (await confirmUpdate(table, key, values, originals));
|
|
668
|
+
if (!ok)
|
|
669
|
+
return;
|
|
670
|
+
if (!dispatchCurrent()) {
|
|
671
|
+
if (!blur)
|
|
672
|
+
toast(say('theRecordConnectionOrTable'), 'error');
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
/** @type {(() => void) | undefined} */
|
|
676
|
+
let acknowledged;
|
|
677
|
+
const result = await updateAttempts.run({ connection: connection ?? null, table: table.id, key }, values, () => {
|
|
678
|
+
if (!dispatchCurrent())
|
|
679
|
+
throw Object.assign(new Error(say('theRecordChangedBefore')), { outcome: 'not_applied' });
|
|
680
|
+
if (app)
|
|
681
|
+
acknowledged = captureRecordWriteRefresh(table.id, key);
|
|
682
|
+
return api('/api/update', { ...ownedBy(connection), table: table.id, key, values, expected: comparable(table, originals) });
|
|
683
|
+
});
|
|
684
|
+
if (result.kind !== 'applied') {
|
|
685
|
+
if (result.kind === 'rejected')
|
|
686
|
+
captured.manualSaveRequired = true;
|
|
687
|
+
if (app && current() && result.kind === 'rejected') {
|
|
688
|
+
/* The draft stays as it was; the fields the server named are marked
|
|
689
|
+
on it, and nothing is retried — a blur save included. */
|
|
690
|
+
const summary = markRefusal(captured, currentTable, result, !blur);
|
|
691
|
+
if (summary)
|
|
692
|
+
feedback.set(captured, { phase: 'error', message: summary });
|
|
693
|
+
else
|
|
694
|
+
feedback.delete(captured);
|
|
695
|
+
tell();
|
|
696
|
+
}
|
|
697
|
+
else if (identity === sessionIdentity() && (result.kind !== 'uncertain' || !current()))
|
|
698
|
+
toast(result.message, 'error');
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const n = Object.keys(result.applied).length;
|
|
702
|
+
const inputs = captured.inputs;
|
|
703
|
+
// Settle the original draft even after navigation selected another record.
|
|
704
|
+
for (const [column, value] of Object.entries(result.applied)) {
|
|
705
|
+
if (Object.is(captured.values[column], values[column])) {
|
|
706
|
+
delete captured.values[column];
|
|
707
|
+
delete captured.originals[column];
|
|
708
|
+
}
|
|
709
|
+
else if (column in captured.values)
|
|
710
|
+
captured.originals[column] = value;
|
|
711
|
+
}
|
|
712
|
+
// A row-defined field folded into a column that was written, unless it was edited again meanwhile.
|
|
713
|
+
const foldedSaved = {};
|
|
714
|
+
for (const name of Object.keys(staging)) {
|
|
715
|
+
const fold = captured.folds?.[name];
|
|
716
|
+
if (!fold || !Object.hasOwn(result.applied, fold.column))
|
|
717
|
+
continue;
|
|
718
|
+
// Its editor is told what it now holds: the box's own text, which the object was written from.
|
|
719
|
+
foldedSaved[name] = staging[name];
|
|
720
|
+
if (!Object.is(captured.values[name], staging[name]))
|
|
721
|
+
continue;
|
|
722
|
+
delete captured.values[name];
|
|
723
|
+
delete captured.originals[name];
|
|
724
|
+
delete captured.folds[name];
|
|
725
|
+
}
|
|
726
|
+
if (!Object.keys(captured.values).length) {
|
|
727
|
+
captured.needsReview = false;
|
|
728
|
+
captured.manualSaveRequired = false;
|
|
729
|
+
editErrors.delete(captured);
|
|
730
|
+
}
|
|
731
|
+
// What a refusal said was about the values it saw; these were written.
|
|
732
|
+
clearServerErrors(captured);
|
|
733
|
+
acknowledged?.();
|
|
734
|
+
// History follows the original owner even if another record is now open.
|
|
735
|
+
if (identity === sessionIdentity() &&
|
|
736
|
+
connection === state.activeConnection &&
|
|
737
|
+
schema === state.schema &&
|
|
738
|
+
generation === connectionGeneration())
|
|
739
|
+
void shell().undo.refresh();
|
|
740
|
+
tell();
|
|
741
|
+
if (!current()) {
|
|
742
|
+
if (identity === sessionIdentity())
|
|
743
|
+
toast(say('updatedColumnsOnTheOriginal', { count: n, connection: connection ?? say('theOriginalConnection') }), 'ok');
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
// An App has no Undo: the dock says what was saved.
|
|
747
|
+
if (app)
|
|
748
|
+
feedback.set(captured, { phase: 'saved', message: say('changesSaved'), identity, columns: Object.keys(values) });
|
|
749
|
+
else
|
|
750
|
+
toast(say('updatedColumns', { count: n, name: table.name }), 'ok', !identity.tenantRequired && result.undoId
|
|
751
|
+
? {
|
|
752
|
+
/* Beside the confirmation, because this is the moment someone realises
|
|
753
|
+
it was the wrong row — and sending them to a menu to find Undo wastes
|
|
754
|
+
the seconds in which they still remember what they changed. */
|
|
755
|
+
label: say('common.undo'),
|
|
756
|
+
run: () => {
|
|
757
|
+
if (identity === sessionIdentity() && connection === state.activeConnection)
|
|
758
|
+
void shell().undo.last(result.undoId);
|
|
759
|
+
},
|
|
760
|
+
}
|
|
761
|
+
: undefined);
|
|
762
|
+
/* Confirmed in place rather than by re-rendering. A re-render would throw
|
|
763
|
+
away the row you are looking at and rebuild it, which reads as a flicker
|
|
764
|
+
and loses the caret; worse, it left the fields showing their unsaved
|
|
765
|
+
styling because the DOM they styled was gone before the class was.
|
|
766
|
+
Showing the saved value, in green, on the field you just edited is both
|
|
767
|
+
calmer and more specific — it says *which* fields landed. */
|
|
768
|
+
tell();
|
|
769
|
+
confirmSaved(inputs, { ...result.applied, ...foldedSaved });
|
|
770
|
+
// Only the pending bar is refreshed, so the green fields survive.
|
|
771
|
+
onDone?.({ inPlace: true });
|
|
772
|
+
}
|
|
773
|
+
catch (err) {
|
|
774
|
+
// Attempt failures are classified above; presentation failures must not resend.
|
|
775
|
+
toast(err.message, 'error');
|
|
776
|
+
}
|
|
777
|
+
finally {
|
|
778
|
+
if (blur) {
|
|
779
|
+
autosaveIdentity = undefined;
|
|
780
|
+
autosaveOwner = undefined;
|
|
781
|
+
}
|
|
782
|
+
applying = false;
|
|
783
|
+
tell();
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
function confirmSaved(inputs, applied) {
|
|
787
|
+
for (const [column, value] of Object.entries(applied)) {
|
|
788
|
+
const registered = inputs[column];
|
|
789
|
+
const input = registered?.element;
|
|
790
|
+
if (!input || !input.isConnected)
|
|
791
|
+
continue;
|
|
792
|
+
// The value the database actually stored, which may differ from what was
|
|
793
|
+
// typed — "17901" comes back as the number 17901.
|
|
794
|
+
registered.onCommitted?.(value);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
/** Show the statement before it runs. This is the last stop before a write. */
|
|
798
|
+
function confirmUpdate(table, key, values, originals) {
|
|
799
|
+
return new Promise((resolve) => {
|
|
800
|
+
const q = (id) => `"${id}"`;
|
|
801
|
+
const sets = Object.keys(values)
|
|
802
|
+
.map((c) => `${q(c)} = ?`)
|
|
803
|
+
.join(',\n ');
|
|
804
|
+
const where = [
|
|
805
|
+
...Object.keys(key).map((c) => `${q(c)} = ?`),
|
|
806
|
+
...Object.keys(originals).map((c) => `${q(c)} ${originals[c] === null ? 'IS NULL' : '= ?'}`),
|
|
807
|
+
].join(' AND ');
|
|
808
|
+
const sql = `UPDATE ${q(table.id)}\n SET ${sets}\n WHERE ${where};`;
|
|
809
|
+
/* The parameters shown are the raw staged values. The server coerces them
|
|
810
|
+
against the declared column types and returns what it applied, so a
|
|
811
|
+
number typed as text is corrected there rather than guessed at here. */
|
|
812
|
+
const params = JSON.stringify([
|
|
813
|
+
...Object.values(values),
|
|
814
|
+
...Object.values(key),
|
|
815
|
+
...Object.values(originals).filter((value) => value !== null),
|
|
816
|
+
]);
|
|
817
|
+
const rows = Object.entries(values).map(([column, to]) => {
|
|
818
|
+
const from = originals[column];
|
|
819
|
+
const type = table.columns.find((c) => c.name === column)?.type ?? '';
|
|
820
|
+
return el('tr', {}, [
|
|
821
|
+
el('td', {}, [el('span', { class: 'diff-col', text: column }), el('span', { class: 'diff-type', text: type.toLowerCase() })]),
|
|
822
|
+
el('td', { class: `diff-from${from === null ? ' null' : ''}`, text: from === null ? 'null' : String(from) }),
|
|
823
|
+
el('td', { class: 'diff-arrow', text: '→' }),
|
|
824
|
+
el('td', { class: `diff-to${to === null ? ' null' : ''}`, text: to === null ? 'null' : String(to) }),
|
|
825
|
+
]);
|
|
826
|
+
});
|
|
827
|
+
const dialog = el('dialog', { class: 'confirm confirm-wide' }, [
|
|
828
|
+
el('h2', { text: rows.length === 1 ? say('applyThisChange') : say('applyChanges', { count: rows.length }) }),
|
|
829
|
+
el('p', {}, [
|
|
830
|
+
document.createTextNode('One row in '),
|
|
831
|
+
el('strong', { text: table.id }),
|
|
832
|
+
document.createTextNode(', identified by '),
|
|
833
|
+
el('strong', {
|
|
834
|
+
text: Object.entries(key)
|
|
835
|
+
.map(([k, v]) => `${k} = ${v}`)
|
|
836
|
+
.join(', '),
|
|
837
|
+
}),
|
|
838
|
+
document.createTextNode('. Applied as a single statement only if these fields still match their original values.'),
|
|
839
|
+
]),
|
|
840
|
+
el('table', { class: 'confirm-diff' }, el('tbody', {}, rows)),
|
|
841
|
+
el('pre', { class: 'ddl', text: sql }),
|
|
842
|
+
el('p', { class: 'confirm-params', text: say('parameters', { params }) }),
|
|
843
|
+
el('div', { class: 'confirm-actions' }, [
|
|
844
|
+
el('button', {
|
|
845
|
+
type: 'button',
|
|
846
|
+
class: 'ghost',
|
|
847
|
+
text: say('common.cancel'),
|
|
848
|
+
onclick: () => {
|
|
849
|
+
dialog.close();
|
|
850
|
+
resolve(false);
|
|
851
|
+
},
|
|
852
|
+
}),
|
|
853
|
+
el('button', {
|
|
854
|
+
type: 'button',
|
|
855
|
+
class: 'primary',
|
|
856
|
+
text: say('common.apply'),
|
|
857
|
+
onclick: () => {
|
|
858
|
+
dialog.close();
|
|
859
|
+
resolve(true);
|
|
860
|
+
},
|
|
861
|
+
}),
|
|
862
|
+
]),
|
|
863
|
+
]);
|
|
864
|
+
dialog.addEventListener('close', () => dialog.remove());
|
|
865
|
+
dialog.addEventListener('cancel', () => resolve(false));
|
|
866
|
+
portalRoot().append(dialog);
|
|
867
|
+
dialog.showModal();
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
/** Why a row is not editable, for the record view to explain rather than hide. */
|
|
871
|
+
export function whyNotEditable(table) {
|
|
872
|
+
if (!state.canWrite)
|
|
873
|
+
return null; // not in write mode: say nothing
|
|
874
|
+
if (!table)
|
|
875
|
+
return say('unknownTable');
|
|
876
|
+
if (table.isView)
|
|
877
|
+
return say('thisIsAView');
|
|
878
|
+
if (!table.columns.some((c) => c.primaryKey)) {
|
|
879
|
+
return say('thisTableHasNoPrimary');
|
|
880
|
+
}
|
|
881
|
+
return null;
|
|
882
|
+
}
|