alinea 2.0.0-preview.12 → 2.0.0-preview.14
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/.init/content/pages/welcome.json +1 -1
- package/dist/.mcp/later/dev.json +1 -1
- package/dist/.mcp/online/dev.json +1 -1
- package/dist/adapter/next/cms.js +22 -10
- package/dist/adapter/next/context.js +1 -4
- package/dist/adapter/next/dashboardUrl.d.ts +6 -0
- package/dist/adapter/next/dashboardUrl.js +13 -0
- package/dist/adapter/next/handler.js +12 -1
- package/dist/adapter/next/syncCheck.d.ts +15 -2
- package/dist/adapter/next/syncCheck.js +26 -9
- package/dist/backend/CommitEntries.d.ts +17 -0
- package/dist/backend/CommitEntries.js +39 -0
- package/dist/backend/Handler.d.ts +9 -0
- package/dist/backend/Handler.js +84 -20
- package/dist/backend/api/BasicAuth.js +5 -1
- package/dist/backend/api/BlobStore.d.ts +21 -0
- package/dist/backend/api/BlobStore.js +63 -0
- package/dist/backend/api/CreateBackend.js +10 -8
- package/dist/backend/api/DatabaseApi.d.ts +4 -1
- package/dist/backend/api/DatabaseApi.js +104 -7
- package/dist/backend/api/GithubApi.d.ts +13 -0
- package/dist/backend/api/GithubApi.js +213 -50
- package/dist/backend/api/database.js +6 -6
- package/dist/backend/util/Syncable.d.ts +6 -0
- package/dist/backend/util/Syncable.js +3 -1
- package/dist/bundled.d.ts +1582 -426
- package/dist/chunks/{bun-sqlite-5SHXN3AT.js → bun-sqlite-RI6BYU5S.js} +3 -3
- package/dist/chunks/{chunk-ASYKC6IE.js → chunk-2PP7WJUJ.js} +2 -12
- package/dist/chunks/{chunk-QJGGYF6E.js → chunk-6FQ5IMNA.js} +7 -7
- package/dist/chunks/{chunk-JOF663EG.js → chunk-7DDPSWRY.js} +465 -2
- package/dist/chunks/{chunk-ETWOY4AL.js → chunk-A2I6MCCS.js} +1 -1
- package/dist/chunks/{chunk-W5AXN7GH.js → chunk-CYVOGRSD.js} +1 -2
- package/dist/chunks/{chunk-TIJTT5ZI.js → chunk-G43W7AME.js} +1 -0
- package/dist/chunks/{chunk-RE523BQ7.js → chunk-PMGIIYDD.js} +5830 -5830
- package/dist/chunks/{chunk-AIU6CMVT.js → chunk-PTYZMV5G.js} +1 -1
- package/dist/chunks/{chunk-66YZ47TY.js → chunk-RAR44T5O.js} +1 -1
- package/dist/chunks/{chunk-OHGAVV4G.js → chunk-SCV3TEXM.js} +2 -3
- package/dist/chunks/{chunk-UPY2RUZF.js → chunk-TWBREZWC.js} +30 -0
- package/dist/chunks/{chunk-QSN6RH6X.js → chunk-VA6NC3MI.js} +1 -1
- package/dist/chunks/{node-sqlite-XVNTNMCY.js → node-sqlite-C7VJ2NSN.js} +3 -3
- package/dist/cli/Generate.js +20 -7
- package/dist/cli/Mcp.js +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +2 -3
- package/dist/cli/build/BuildEmitter.d.ts +5 -1
- package/dist/cli/build/BuildEmitter.js +8 -3
- package/dist/cli/generate/CompileConfig.js +10 -6
- package/dist/cli/generate/DevDB.d.ts +4 -1
- package/dist/cli/generate/DevDB.js +15 -7
- package/dist/cli/generate/GenerateDashboard.js +1 -0
- package/dist/cli/generate/MediaLocations.d.ts +18 -0
- package/dist/cli/generate/MediaLocations.js +69 -0
- package/dist/cli/serve/CreateLocalServer.js +1 -0
- package/dist/cli/serve/mcp/DevMcp.js +1 -1
- package/dist/cli/serve/mcp/McpTools.js +29 -1
- package/dist/cloud/CloudRemote.js +21 -7
- package/dist/cms.d.ts +4 -2
- package/dist/components/Alert.js +3 -3
- package/dist/components/AsyncList.d.ts +52 -0
- package/dist/components/AsyncList.js +69 -0
- package/dist/components/Badge.d.ts +3 -1
- package/dist/components/Badge.js +5 -3
- package/dist/components/Breadcrumbs.js +4 -4
- package/dist/components/Button.d.ts +6 -1
- package/dist/components/Button.js +14 -5
- package/dist/components/Calendar.js +20 -20
- package/dist/components/Checkbox.js +10 -10
- package/dist/components/CheckboxGroup.js +4 -4
- package/dist/components/Code.js +2 -2
- package/dist/components/Collapsible.js +3 -3
- package/dist/components/ColorSwatch.js +2 -2
- package/dist/components/ColorSwatchPicker.js +4 -4
- package/dist/components/ComboBox.d.ts +27 -9
- package/dist/components/ComboBox.js +42 -11
- package/dist/components/Command.js +14 -13
- package/dist/components/ContentCard.d.ts +3 -1
- package/dist/components/ContentCard.js +46 -24
- package/dist/components/ContentGrid.js +17 -17
- package/dist/components/DataList.js +3 -3
- package/dist/components/DateField.d.ts +4 -0
- package/dist/components/DateField.js +2 -2
- package/dist/components/DatePicker.js +2 -2
- package/dist/components/DateRangePicker.js +2 -2
- package/dist/components/Dialog.d.ts +14 -3
- package/dist/components/Dialog.js +36 -9
- package/dist/components/DropZone.js +5 -5
- package/dist/components/DropdownMenu.js +9 -9
- package/dist/components/Empty.js +4 -4
- package/dist/components/Field.d.ts +1 -1
- package/dist/components/Field.js +17 -11
- package/dist/components/Form.d.ts +23 -0
- package/dist/components/Form.js +64 -0
- package/dist/components/Link.d.ts +8 -1
- package/dist/components/List.js +24 -24
- package/dist/components/MediaPreview.js +7 -7
- package/dist/components/MultipleSelect.d.ts +13 -8
- package/dist/components/MultipleSelect.js +21 -21
- package/dist/components/NavRail.js +6 -6
- package/dist/components/NumberField.d.ts +5 -1
- package/dist/components/NumberField.js +6 -4
- package/dist/components/Page.js +6 -6
- package/dist/components/Popover.js +2 -2
- package/dist/components/PreviewFrame.js +6 -6
- package/dist/components/RadioGroup.js +9 -9
- package/dist/components/Resizable.js +4 -4
- package/dist/components/SearchField.d.ts +6 -1
- package/dist/components/SearchField.js +10 -8
- package/dist/components/Select.d.ts +13 -10
- package/dist/components/Select.js +16 -30
- package/dist/components/Sheet.d.ts +50 -0
- package/dist/components/Sheet.js +202 -0
- package/dist/components/Sidebar.js +5 -5
- package/dist/components/SortableList.d.ts +34 -30
- package/dist/components/SortableList.js +160 -263
- package/dist/components/Spinner.js +4 -4
- package/dist/components/Stack.d.ts +20 -0
- package/dist/components/Stack.js +45 -0
- package/dist/components/Surface.js +2 -2
- package/dist/components/Switch.js +6 -6
- package/dist/components/Table.d.ts +14 -2
- package/dist/components/Table.js +90 -51
- package/dist/components/Tabs.js +4 -4
- package/dist/components/TagGroup.js +10 -10
- package/dist/components/TextField.d.ts +7 -1
- package/dist/components/TextField.js +19 -10
- package/dist/components/TimeField.d.ts +6 -1
- package/dist/components/TimeField.js +48 -23
- package/dist/components/Timestamp.js +1 -1
- package/dist/components/ToggleGroup.js +2 -2
- package/dist/components/Toolbar.js +3 -3
- package/dist/components/Tooltip.js +6 -5
- package/dist/components/Tree.js +24 -24
- package/dist/components/internal/DateControl.js +9 -9
- package/dist/components/internal/FormScope.d.ts +2 -0
- package/dist/components/internal/FormScope.js +8 -0
- package/dist/components/internal/ListBoxGroup.d.ts +12 -0
- package/dist/components/internal/ListBoxGroup.js +46 -0
- package/dist/components/internal/ListBoxOption.d.ts +2 -2
- package/dist/components/internal/ListBoxOption.js +7 -7
- package/dist/components/internal/Locale.js +2 -2
- package/dist/components/internal/PopoverSurface.js +3 -2
- package/dist/components/internal/SelectionCheckbox.js +6 -6
- package/dist/components/internal/Slot.js +1 -1
- package/dist/components/internal/ToggleButton.js +4 -4
- package/dist/components/internal/Trigger.js +2 -2
- package/dist/components/internal/sortableDrag.d.ts +19 -0
- package/dist/components/internal/sortableDrag.js +175 -0
- package/dist/components/internal/useDragDrop.js +2 -2
- package/dist/components/types.d.ts +4 -0
- package/dist/components.d.ts +4 -0
- package/dist/components.js +4 -0
- package/dist/core/Client.js +12 -1
- package/dist/core/Config.d.ts +12 -1
- package/dist/core/Config.js +12 -0
- package/dist/core/DashboardEntry.d.ts +19 -0
- package/dist/core/DashboardEntry.js +0 -0
- package/dist/core/Document.d.ts +9 -1
- package/dist/core/Document.js +40 -8
- package/dist/core/EntryFields.d.ts +8 -2
- package/dist/core/Field.d.ts +5 -0
- package/dist/core/Filter.d.ts +19 -2
- package/dist/core/Filter.js +5 -0
- package/dist/core/Graph.d.ts +10 -2
- package/dist/core/Overview.d.ts +76 -9
- package/dist/core/Overview.js +1 -0
- package/dist/core/Root.js +1 -1
- package/dist/core/Scope.d.ts +5 -0
- package/dist/core/Scope.js +22 -5
- package/dist/core/TextDoc.d.ts +4 -0
- package/dist/core/Type.d.ts +25 -6
- package/dist/core/Type.js +25 -7
- package/dist/core/Validation.d.ts +0 -1
- package/dist/core/Validation.js +0 -6
- package/dist/core/db/LocalStore.d.ts +7 -0
- package/dist/core/field/CreateField.d.ts +1 -2
- package/dist/core/field/RichTextField.js +23 -4
- package/dist/core/media/MediaTypes.js +1 -1
- package/dist/core/source/GithubSource.d.ts +4 -0
- package/dist/core/source/GithubSource.js +127 -25
- package/dist/core/source/GithubUsage.d.ts +21 -0
- package/dist/core/source/GithubUsage.js +47 -0
- package/dist/core/source/Source.d.ts +2 -0
- package/dist/core/source/Source.js +11 -0
- package/dist/core/util/Async.d.ts +2 -0
- package/dist/core/util/Async.js +12 -1
- package/dist/core/util/Checks.js +1 -1
- package/dist/core/util/Slugs.js +4 -3
- package/dist/dashboard/App.css +13 -11
- package/dist/dashboard/App.d.ts +3 -2
- package/dist/dashboard/App.js +24 -6
- package/dist/dashboard/Href.d.ts +37 -0
- package/dist/dashboard/Href.js +46 -0
- package/dist/dashboard/ViewKeys.d.ts +1 -0
- package/dist/dashboard/ViewKeys.js +1 -0
- package/dist/dashboard/app/ActivityStatus.js +34 -12
- package/dist/dashboard/app/AuthView.js +6 -6
- package/dist/dashboard/app/BlockSettings.d.ts +9 -0
- package/dist/dashboard/app/BlockSettings.js +16 -0
- package/dist/dashboard/app/BlockSheet.d.ts +50 -0
- package/dist/dashboard/app/BlockSheet.js +207 -0
- package/dist/dashboard/app/BlockSheetStoryFrame.d.ts +6 -0
- package/dist/dashboard/app/BlockSheetStoryFrame.js +29 -0
- package/dist/dashboard/app/CompactField.js +14 -14
- package/dist/dashboard/app/CroppedImage.js +2 -2
- package/dist/dashboard/app/DashboardLayout.d.ts +1 -1
- package/dist/dashboard/app/DashboardLayout.js +15 -1
- package/dist/dashboard/app/EntryActions.d.ts +11 -0
- package/dist/dashboard/app/EntryActions.js +30 -0
- package/dist/dashboard/app/EntryFields.d.ts +15 -2
- package/dist/dashboard/app/EntryFields.js +24 -3
- package/dist/dashboard/app/EntryHeader.js +45 -36
- package/dist/dashboard/app/EntryReferences.js +5 -5
- package/dist/dashboard/app/EntrySidebar.js +24 -22
- package/dist/dashboard/app/EntrySidebarPreview.js +2 -2
- package/dist/dashboard/app/EntryStatusIcon.d.ts +23 -0
- package/dist/dashboard/app/EntryStatusIcon.js +58 -0
- package/dist/dashboard/app/EntryValidationModal.d.ts +6 -5
- package/dist/dashboard/app/EntryValidationModal.js +17 -17
- package/dist/dashboard/app/Explorer.d.ts +3 -1
- package/dist/dashboard/app/Explorer.js +90 -47
- package/dist/dashboard/app/ExplorerBatchActions.d.ts +3 -1
- package/dist/dashboard/app/ExplorerBatchActions.js +70 -45
- package/dist/dashboard/app/ExplorerCards.js +7 -1
- package/dist/dashboard/app/ExplorerControls.js +4 -4
- package/dist/dashboard/app/ExplorerList.js +7 -7
- package/dist/dashboard/app/ExplorerModal.js +4 -4
- package/dist/dashboard/app/ExplorerOverviewHeader.d.ts +6 -0
- package/dist/dashboard/app/ExplorerOverviewHeader.js +28 -0
- package/dist/dashboard/app/ExplorerTable.js +11 -8
- package/dist/dashboard/app/ExplorerTabs.d.ts +12 -0
- package/dist/dashboard/app/ExplorerTabs.js +42 -0
- package/dist/dashboard/app/ImageEditor.js +26 -26
- package/dist/dashboard/app/ImagePicker.js +3 -13
- package/dist/dashboard/app/LinkPicker.js +27 -25
- package/dist/dashboard/app/LocaleMenu.js +7 -7
- package/dist/dashboard/app/MediaPreviewCell.js +4 -4
- package/dist/dashboard/app/MoveConfirmDialog.d.ts +5 -0
- package/dist/dashboard/app/MoveConfirmDialog.js +79 -0
- package/dist/dashboard/app/OverviewCell.js +11 -14
- package/dist/dashboard/app/PendingUploadsView.js +3 -3
- package/dist/dashboard/app/ReadOnlyBadge.d.ts +1 -1
- package/dist/dashboard/app/RemoveDialog.d.ts +17 -0
- package/dist/dashboard/app/{DeleteDialog.js → RemoveDialog.js} +72 -27
- package/dist/dashboard/app/RemoveRedirect.d.ts +7 -0
- package/dist/dashboard/app/RemoveRedirect.js +123 -0
- package/dist/dashboard/app/SearchBar.d.ts +9 -0
- package/dist/dashboard/app/SearchBar.js +31 -0
- package/dist/dashboard/app/SettingsTab.d.ts +6 -0
- package/dist/dashboard/app/SettingsTab.js +27 -0
- package/dist/dashboard/app/SidebarTree.js +26 -71
- package/dist/dashboard/app/WorkspaceMenu.js +9 -9
- package/dist/dashboard/app/WorkspaceRoots.js +108 -104
- package/dist/dashboard/app/editor/FileEditor.js +17 -17
- package/dist/dashboard/app/modals/CreateEntry.js +3 -3
- package/dist/dashboard/app/pages/EntryPage.d.ts +2 -1
- package/dist/dashboard/app/pages/EntryPage.js +65 -43
- package/dist/dashboard/app/pages/RootPage.js +3 -3
- package/dist/dashboard/app/pages/SplashPage.js +91 -76
- package/dist/dashboard/app/pages/UsersPage.js +11 -11
- package/dist/dashboard/app/ui/DashboardModal.js +14 -13
- package/dist/dashboard/atoms/activity.d.ts +1 -0
- package/dist/dashboard/atoms/activity.js +8 -5
- package/dist/dashboard/atoms/config.d.ts +2 -0
- package/dist/dashboard/atoms/dashboard.d.ts +11 -0
- package/dist/dashboard/atoms/dashboard.js +9 -1
- package/dist/dashboard/atoms/editor.d.ts +7 -1
- package/dist/dashboard/atoms/editor.js +14 -2
- package/dist/dashboard/atoms/entry.js +1 -14
- package/dist/dashboard/atoms/entryTable.js +1 -0
- package/dist/dashboard/atoms/explorer.d.ts +19 -0
- package/dist/dashboard/atoms/explorer.js +62 -21
- package/dist/dashboard/atoms/graph.d.ts +5 -0
- package/dist/dashboard/atoms/graph.js +27 -2
- package/dist/dashboard/atoms/link.js +5 -2
- package/dist/dashboard/atoms/move.d.ts +5 -0
- package/dist/dashboard/atoms/move.js +29 -3
- package/dist/dashboard/atoms/moveConfirmation.d.ts +34 -0
- package/dist/dashboard/atoms/moveConfirmation.js +95 -0
- package/dist/dashboard/atoms/nav.d.ts +22 -12
- package/dist/dashboard/atoms/nav.js +200 -65
- package/dist/dashboard/atoms/overview.d.ts +32 -9
- package/dist/dashboard/atoms/overview.js +43 -28
- package/dist/dashboard/atoms/remove.d.ts +112 -0
- package/dist/dashboard/atoms/remove.js +268 -0
- package/dist/dashboard/atoms/root.d.ts +2 -2
- package/dist/dashboard/atoms/root.js +48 -27
- package/dist/dashboard/atoms/user.js +1 -1
- package/dist/dashboard/atoms/utils.js +1 -1
- package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
- package/dist/dashboard/boot/Boot.js +31 -17
- package/dist/dashboard/boot/DashboardWorker.d.ts +7 -0
- package/dist/dashboard/boot/DashboardWorker.js +99 -54
- package/dist/dashboard/boot/LoadWorker.js +20 -10
- package/dist/dashboard/boot/SyncEvent.d.ts +7 -0
- package/dist/dashboard/boot/SyncEvent.js +14 -0
- package/dist/dashboard/boot/WorkerDB.d.ts +1 -0
- package/dist/dashboard/boot/WorkerDB.js +3 -0
- package/dist/dashboard/cms/EntryTable.d.ts +4 -3
- package/dist/dashboard/cms/EntryTable.js +6 -3
- package/dist/dashboard/cms/ViewProps.d.ts +3 -2
- package/dist/dashboard/cms/hooks.d.ts +34 -18
- package/dist/dashboard/cms/hooks.js +43 -18
- package/dist/dashboard/contexts.d.ts +3 -2
- package/dist/dashboard/contexts.js +3 -2
- package/dist/dashboard/hook/UseEntryEditor.d.ts +1 -1
- package/dist/dashboard/hook/UseEntryEditor.js +7 -3
- package/dist/dashboard/icons.d.ts +1 -0
- package/dist/dashboard/icons.js +15 -0
- package/dist/database/BrowserEntryStore.d.ts +12 -62
- package/dist/database/BrowserEntryStore.js +116 -193
- package/dist/database/DatabaseTables.js +2 -2
- package/dist/database/EntryDatabase.d.ts +10 -1
- package/dist/database/EntryDatabase.js +45 -4
- package/dist/database/EntryStore.js +1 -11
- package/dist/database/EntryTransaction.js +0 -35
- package/dist/database/EntryUrlAliases.d.ts +4 -0
- package/dist/database/EntryUrlAliases.js +16 -10
- package/dist/database/driver/RuntimeDatabase.js +3 -3
- package/dist/database/driver/WasmDatabase.d.ts +5 -18
- package/dist/database/driver/WasmDatabase.js +15 -16
- package/dist/database/entry/EntryTable.d.ts +5 -3
- package/dist/database/entry/EntryTable.js +26 -9
- package/dist/database/query/Condition.d.ts +4 -1
- package/dist/database/query/Condition.js +16 -5
- package/dist/database/query/EntryQuery.js +60 -8
- package/dist/database/query/Relation.d.ts +13 -1
- package/dist/database/query/Relation.js +20 -2
- package/dist/database/query/Search.d.ts +7 -1
- package/dist/database/query/Search.js +55 -10
- package/dist/database/sync/EntrySyncer.d.ts +2 -0
- package/dist/database/sync/EntrySyncer.js +4 -2
- package/dist/database/sync/Ingest.d.ts +2 -1
- package/dist/database/sync/Ingest.js +20 -6
- package/dist/field/code/CodeField.view.js +13 -13
- package/dist/field/link/EntryLink.d.ts +8 -9
- package/dist/field/link/FileLink.d.ts +6 -6
- package/dist/field/link/ImageLink.d.ts +6 -9
- package/dist/field/link/ImageLink.js +0 -1
- package/dist/field/link/Link.d.ts +1 -1
- package/dist/field/link/LinkField.d.ts +5 -0
- package/dist/field/link/LinkField.view.js +251 -374
- package/dist/field/link/UrlLink.d.ts +4 -4
- package/dist/field/list/ListField.d.ts +2 -0
- package/dist/field/list/ListField.view.d.ts +15 -0
- package/dist/field/list/ListField.view.js +356 -299
- package/dist/field/metadata/MetadataField.d.ts +17 -7
- package/dist/field/metadata/MetadataField.js +14 -3
- package/dist/field/metadata/MetadataField.view.d.ts +1 -0
- package/dist/field/metadata/MetadataField.view.js +24 -20
- package/dist/field/richtext/RichTextBlock.d.ts +3 -1
- package/dist/field/richtext/RichTextBlock.js +181 -74
- package/dist/field/richtext/RichTextBlockHost.js +1 -1
- package/dist/field/richtext/RichTextExtensions.js +28 -28
- package/dist/field/richtext/RichTextField.view.js +10 -4
- package/dist/field/richtext/RichTextInsertMenu.js +45 -29
- package/dist/field/richtext/RichTextToolbar.js +26 -1
- package/dist/field/richtext/Toolbar.d.ts +9 -1
- package/dist/field/richtext/Toolbar.js +12 -2
- package/dist/field/select/SelectField.view.js +1 -0
- package/dist/field/views.js +2 -0
- package/dist/index.css +664 -332
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/next.d.ts +2 -0
- package/dist/next.edge.d.ts +2 -0
- package/dist/picker/entry/EntryPicker.d.ts +3 -1
- package/dist/picker/entry/EntryPicker.js +15 -1
- package/dist/picker/url/UrlPicker.js +1 -0
- package/dist/preview/react.js +3 -0
- package/dist/query.d.ts +26 -14
- package/dist/query.js +4 -0
- package/dist/types.d.ts +8 -5
- package/dist/ui/Stack.d.ts +4 -2
- package/docs/ai-setup.md +3 -3
- package/docs/cli.md +4 -2
- package/docs/components/badge.md +1 -0
- package/docs/components/button.md +1 -0
- package/docs/components/combo-box.md +105 -16
- package/docs/components/content-card.md +1 -0
- package/docs/components/date-field.md +1 -1
- package/docs/components/dialog.md +51 -0
- package/docs/components/form.md +67 -0
- package/docs/components/link.md +10 -0
- package/docs/components/multiple-select.md +9 -17
- package/docs/components/number-field.md +5 -1
- package/docs/components/search-field.md +1 -0
- package/docs/components/select.md +9 -20
- package/docs/components/sortable-list.md +5 -20
- package/docs/components/stack.md +42 -0
- package/docs/components/table.md +84 -0
- package/docs/components/text-field.md +9 -1
- package/docs/components/time-field.md +5 -1
- package/docs/components.md +39 -1
- package/docs/configuration.md +4 -2
- package/docs/custom-fields.md +135 -7
- package/docs/deploy/self-host.md +3 -1
- package/docs/deploy.md +9 -5
- package/docs/fields/image.md +0 -1
- package/docs/fields/list.md +19 -0
- package/docs/fields/object.md +5 -3
- package/docs/fields/rich-text.md +31 -0
- package/docs/fields.md +1 -1
- package/docs/index.md +9 -7
- package/docs/instant-publishing.md +17 -11
- package/docs/overviews.md +131 -8
- package/docs/query/filtering.md +2 -0
- package/docs/query/related.md +58 -9
- package/docs/query.md +52 -1
- package/docs/quickstart.md +5 -5
- package/docs/schema/document.md +2 -0
- package/docs/schema/type.md +3 -1
- package/docs/upgrading.md +101 -19
- package/llms-full.txt +1036 -163
- package/package.json +2 -3
- package/readme.md +2 -2
- package/dist/core/db/EntryValidationError.d.ts +0 -13
- package/dist/core/db/EntryValidationError.js +0 -23
- package/dist/dashboard/app/DeleteDialog.d.ts +0 -11
- package/dist/dashboard/atoms/delete.d.ts +0 -68
- package/dist/dashboard/atoms/delete.js +0 -143
- package/dist/chunks/{chunk-MOWR65LM.js → chunk-PYDOMKJZ.js} +71 -71
|
@@ -22,35 +22,27 @@ export function MultipleSelectExample() {
|
|
|
22
22
|
}
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## Values
|
|
26
|
+
|
|
27
|
+
The value is an array of the `value`s of the picked items, strings or numbers. With a `name` the field submits one form entry per value, like a native multiple select: read them with `formData.getAll(name)`.
|
|
28
|
+
|
|
25
29
|
## Props
|
|
26
30
|
|
|
27
31
|
`MultipleSelect`
|
|
28
32
|
A labelled field to pick several values from a searchable list, the selected values are shown as removable tags.
|
|
29
33
|
| Prop | Type | Default | Description |
|
|
30
34
|
| --- | --- | --- | --- |
|
|
31
|
-
| value | `Array<
|
|
32
|
-
| defaultValue | `Array<
|
|
33
|
-
| onValueChange | `(value: Array<
|
|
35
|
+
| value | `Array<V>` | | The values of the selected MultipleSelectItems |
|
|
36
|
+
| defaultValue | `Array<V>` | | |
|
|
37
|
+
| onValueChange | `(value: Array<V>) => void` | | |
|
|
34
38
|
| placeholder | `string` | | |
|
|
35
39
|
| emptyMessage | `ReactNode` | `'No options'` | Shown in the list when no item matches the search, defaults to "No options" |
|
|
36
|
-
| name | `string` | | Name of the hidden form input carrying the values |
|
|
37
|
-
| label | `ReactNode` | | |
|
|
38
|
-
| description | `ReactNode` | | |
|
|
39
|
-
| error | `ReactNode` | | |
|
|
40
|
-
| required | `boolean` | | |
|
|
41
|
-
| disabled | `boolean` | | |
|
|
42
|
-
| readOnly | `boolean` | | |
|
|
43
|
-
| icon | `IconType \| ReactElement` | | |
|
|
44
|
-
| shared | `boolean` | | Marks the field as shared between translations |
|
|
45
|
-
| open | `boolean` | | |
|
|
46
|
-
| defaultOpen | `boolean` | | |
|
|
47
|
-
| onOpenChange | `(open: boolean) => void` | | |
|
|
48
|
-
Also accepts `className` and `style`, `id` and `aria-*` labelling attributes, `data-*` attributes.
|
|
40
|
+
| name | `string` | | Name of the hidden form input carrying the values, it submits one entry per selected value like a native multiple select: read them with `formData.getAll(name)` |
|
|
49
41
|
|
|
50
42
|
`MultipleSelectItem`
|
|
51
43
|
| Prop | Type | Default | Description |
|
|
52
44
|
| --- | --- | --- | --- |
|
|
53
|
-
| value (required) | `
|
|
45
|
+
| value (required) | `Key` | | |
|
|
54
46
|
| textValue | `string` | | Text used for searching and the tag, defaults to string children |
|
|
55
47
|
| disabled | `boolean` | | |
|
|
56
48
|
Also accepts `className` and `style`.
|
|
@@ -19,6 +19,10 @@ export function NumberFieldExample() {
|
|
|
19
19
|
}
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
## Formatting
|
|
23
|
+
|
|
24
|
+
`formatOptions` takes the options of `Intl.NumberFormat`, such as a currency or a unit, and the number is shown and parsed in the locale of the dashboard. Digits are not grouped by default, since number fields often hold years or ids: pass `formatOptions={{useGrouping: true}}` to show `1,250` rather than `1250`. The value is a number, or `null` when the field is empty.
|
|
25
|
+
|
|
22
26
|
## Props
|
|
23
27
|
|
|
24
28
|
`NumberField`
|
|
@@ -30,7 +34,7 @@ export function NumberFieldExample() {
|
|
|
30
34
|
| min | `number` | | |
|
|
31
35
|
| max | `number` | | |
|
|
32
36
|
| step | `number` | | |
|
|
33
|
-
| formatOptions | `Intl.NumberFormatOptions` | |
|
|
37
|
+
| formatOptions | `Intl.NumberFormatOptions` | | How the number is shown and parsed. Digits are not grouped unless `useGrouping` is set: number fields often hold years and ids |
|
|
34
38
|
| placeholder | `string` | | |
|
|
35
39
|
| steppers | `boolean` | `true` | Show increment and decrement buttons, defaults to true |
|
|
36
40
|
| name | `string` | | |
|
|
@@ -31,6 +31,7 @@ A text input for search queries with a clear button. The `icon` is shown inside
|
|
|
31
31
|
| onClear | `() => void` | | Called when the user clears the field with the clear button or escape |
|
|
32
32
|
| placeholder | `string` | | |
|
|
33
33
|
| loading | `boolean` | | Shows a spinner while results are being loaded |
|
|
34
|
+
| variant | `'default' \| 'inline'` | `'default'` | `inline` drops the box so the field reads as the top row of the results it searches, like a command palette. The row draws its own border. |
|
|
34
35
|
| name | `string` | | |
|
|
35
36
|
| autoFocus | `boolean` | | |
|
|
36
37
|
| onBlur | `(event: FocusEvent<HTMLInputElement>) => void` | | |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Select
|
|
2
2
|
|
|
3
|
-
Picks a single value from a list of options. The value is the `value` of the chosen SelectItem, and
|
|
3
|
+
Picks a single value from a list of options. The value is the `value` of the chosen SelectItem, and `onValueChange` receives it, typed like the `value` you pass: values are strings or numbers. Set `clearable` to show a button that clears the value again, `onValueChange` then receives `null`.
|
|
4
4
|
|
|
5
5
|
Example: Select
|
|
6
6
|
```tsx
|
|
@@ -63,7 +63,7 @@ export function SelectGroupsExample() {
|
|
|
63
63
|
|
|
64
64
|
## States
|
|
65
65
|
|
|
66
|
-
A placeholder shows while nothing is selected. Like the other form controls, a select takes `description`, `error`, `required`, `disabled` and `readOnly`.
|
|
66
|
+
A placeholder shows while nothing is selected, and `clearable` adds a button to clear the selection. Like the other form controls, a select takes `description`, `error`, `required`, `disabled` and `readOnly`.
|
|
67
67
|
|
|
68
68
|
Example: Select: states
|
|
69
69
|
```tsx
|
|
@@ -72,7 +72,7 @@ import {Select, SelectItem} from 'alinea/components'
|
|
|
72
72
|
export function SelectStatesExample() {
|
|
73
73
|
return (
|
|
74
74
|
<div style={{display: 'grid', gap: 16, width: 280}}>
|
|
75
|
-
<Select label="Category" placeholder="Choose a category">
|
|
75
|
+
<Select label="Category" placeholder="Choose a category" clearable>
|
|
76
76
|
<SelectItem value="bedroom">Bedroom</SelectItem>
|
|
77
77
|
<SelectItem value="dining">Dining</SelectItem>
|
|
78
78
|
</Select>
|
|
@@ -92,33 +92,22 @@ export function SelectStatesExample() {
|
|
|
92
92
|
## Props
|
|
93
93
|
|
|
94
94
|
`Select`
|
|
95
|
-
A labelled field to pick a single value from a list.
|
|
95
|
+
A labelled field to pick a single value from a list. Set `clearable` to let the value be cleared again.
|
|
96
96
|
| Prop | Type | Default | Description |
|
|
97
97
|
| --- | --- | --- | --- |
|
|
98
|
-
| value | `
|
|
99
|
-
| defaultValue | `
|
|
100
|
-
| onValueChange | `(value:
|
|
98
|
+
| value | `V \| null` | | The value of the selected SelectItem |
|
|
99
|
+
| defaultValue | `V \| null` | | |
|
|
100
|
+
| onValueChange | `(value: V \| null) => void` | | Called with the selected value, or null when the value is cleared |
|
|
101
101
|
| placeholder | `string` | | |
|
|
102
|
+
| clearable | `boolean` | | Show a button that clears the value |
|
|
102
103
|
| name | `string` | | Name of the hidden form input carrying the value |
|
|
103
104
|
| autoFocus | `boolean` | | |
|
|
104
105
|
| size | `'default' \| 'sm'` | `'default'` | `sm` is as tall as a default Button, defaults to `default` |
|
|
105
|
-
| label | `ReactNode` | | |
|
|
106
|
-
| description | `ReactNode` | | |
|
|
107
|
-
| error | `ReactNode` | | |
|
|
108
|
-
| required | `boolean` | | |
|
|
109
|
-
| disabled | `boolean` | | |
|
|
110
|
-
| readOnly | `boolean` | | |
|
|
111
|
-
| icon | `IconType \| ReactElement` | | |
|
|
112
|
-
| shared | `boolean` | | Marks the field as shared between translations |
|
|
113
|
-
| open | `boolean` | | |
|
|
114
|
-
| defaultOpen | `boolean` | | |
|
|
115
|
-
| onOpenChange | `(open: boolean) => void` | | |
|
|
116
|
-
Also accepts `className` and `style`, `id` and `aria-*` labelling attributes, `data-*` attributes.
|
|
117
106
|
|
|
118
107
|
`SelectItem`
|
|
119
108
|
| Prop | Type | Default | Description |
|
|
120
109
|
| --- | --- | --- | --- |
|
|
121
|
-
| value (required) | `
|
|
110
|
+
| value (required) | `Key` | | |
|
|
122
111
|
| disabled | `boolean` | | |
|
|
123
112
|
| icon | `IconType \| ReactElement` | | |
|
|
124
113
|
| textValue | `string` | | Text used for typeahead and the value, defaults to string children |
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Badge,
|
|
9
9
|
type DragMoveEvent,
|
|
10
10
|
SortableList,
|
|
11
|
-
SortableListHandle,
|
|
12
11
|
SortableListItem,
|
|
13
12
|
SortableListItemDescription,
|
|
14
13
|
SortableListItemHeader,
|
|
@@ -40,7 +39,6 @@ export function SortableListExample() {
|
|
|
40
39
|
{sections.map(section => (
|
|
41
40
|
<SortableListItem key={section.id} id={section.id} role="listitem">
|
|
42
41
|
<SortableListItemHeader>
|
|
43
|
-
<SortableListHandle aria-label={`Drag ${section.label}`} />
|
|
44
42
|
<SortableListItemTitle>
|
|
45
43
|
<Badge size="sm">{section.type}</Badge>
|
|
46
44
|
<SortableListItemDescription>
|
|
@@ -60,25 +58,20 @@ export function SortableListExample() {
|
|
|
60
58
|
`SortableList`
|
|
61
59
|
| Prop | Type | Default | Description |
|
|
62
60
|
| --- | --- | --- | --- |
|
|
63
|
-
| onReorder | `(event: DragMoveEvent) => void` | | Enables reordering: items with an `id`
|
|
64
|
-
|
|
65
|
-
Also accepts every prop of `Surface`.
|
|
61
|
+
| onReorder | `(event: DragMoveEvent) => void` | | Enables reordering: items with an `id` follow the pointer when their `SortableListItemHeader` is dragged, the other items move aside as it passes them. With focus in the header, Alt+ArrowUp and Alt+ArrowDown move an item. Called with the key of the moved item and the item it was dropped before or after. Update the order synchronously: the dropped item glides into the place it renders in right after this returns. |
|
|
62
|
+
Also accepts every prop of a `<div>` element.
|
|
66
63
|
|
|
67
64
|
`SortableListItem`
|
|
68
65
|
| Prop | Type | Default | Description |
|
|
69
66
|
| --- | --- | --- | --- |
|
|
70
67
|
| id | `Key` | | Identifies the item within its list. Items with an id can be dragged when the list has `onReorder`. The id is not rendered as a DOM id. |
|
|
71
|
-
|
|
|
68
|
+
| current | `boolean` | | Highlights the item, eg. while its settings are open next to the list |
|
|
72
69
|
Also accepts every prop of a `<div>` element.
|
|
73
70
|
|
|
74
71
|
`SortableListItemHeader`
|
|
75
|
-
Top bar of an item, holds its
|
|
72
|
+
Top bar of an item, holds its title and actions. Drags the item when the list has `onReorder`, a press that does not move still clicks.
|
|
76
73
|
Accepts every prop of a `<div>` element.
|
|
77
74
|
|
|
78
|
-
`SortableListHandle`
|
|
79
|
-
Drags its `SortableListItem` when the list has `onReorder`. Focusable in that case: press Enter to start a keyboard drag. Place it in the `SortableListItemHeader`, it shows while the header is hovered or focused.
|
|
80
|
-
Accepts every prop of a `<span>` element.
|
|
81
|
-
|
|
82
75
|
`SortableListItemTitle`
|
|
83
76
|
Row of the toggle, badges and description of an item, fills the header
|
|
84
77
|
Accepts every prop of a `<div>` element.
|
|
@@ -94,7 +87,7 @@ Accepts every prop of a `<div>` element.
|
|
|
94
87
|
Folds the content of an item
|
|
95
88
|
| Prop | Type | Default | Description |
|
|
96
89
|
| --- | --- | --- | --- |
|
|
97
|
-
| expanded (required) | `boolean` | | Whether the item content is shown,
|
|
90
|
+
| expanded (required) | `boolean` | | Whether the item content is shown, picks the unfold icon |
|
|
98
91
|
Also accepts every prop of `Button`.
|
|
99
92
|
|
|
100
93
|
`SortableListItemContent`
|
|
@@ -112,14 +105,6 @@ A group of settings or actions in the popover of an item
|
|
|
112
105
|
| variant | `'default' \| 'actions'` | `'default'` | `actions` removes the padding around a group of ghost buttons |
|
|
113
106
|
Also accepts every prop of a `<div>` element.
|
|
114
107
|
|
|
115
|
-
`SortableListDragPreview`
|
|
116
|
-
Card shown under the pointer while dragging an item
|
|
117
|
-
| Prop | Type | Default | Description |
|
|
118
|
-
| --- | --- | --- | --- |
|
|
119
|
-
| icon | `IconType` | | |
|
|
120
|
-
| label (required) | `ReactNode` | | |
|
|
121
|
-
Also accepts every prop of a `<div>` element.
|
|
122
|
-
|
|
123
108
|
`SortableListAdd`
|
|
124
109
|
Last row of the list holding the buttons that add items
|
|
125
110
|
Accepts every prop of a `<div>` element.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Stack
|
|
2
|
+
|
|
3
|
+
Lays out its children in a column, or a row with `direction="row"`, with a `gap` between them: a number is in pixels, a string any CSS length. `align` positions the items across the stack (they stretch by default), `justify` along it, and `wrap` lets a row continue on the next line.
|
|
4
|
+
|
|
5
|
+
Example: Stack
|
|
6
|
+
```tsx
|
|
7
|
+
import {Badge, Button, Stack, TextField} from 'alinea/components'
|
|
8
|
+
|
|
9
|
+
export function StackExample() {
|
|
10
|
+
return (
|
|
11
|
+
<Stack gap={16} style={{width: 320}}>
|
|
12
|
+
<Stack direction="row" align="center" justify="between">
|
|
13
|
+
<strong>About us</strong>
|
|
14
|
+
<Badge status="draft">Draft</Badge>
|
|
15
|
+
</Stack>
|
|
16
|
+
<TextField label="Title" defaultValue="About us" />
|
|
17
|
+
<TextField label="Path" defaultValue="about" />
|
|
18
|
+
<Stack direction="row" gap={8} justify="end" wrap>
|
|
19
|
+
<Button variant="outline">Cancel</Button>
|
|
20
|
+
<Button color="primary">Save</Button>
|
|
21
|
+
</Stack>
|
|
22
|
+
</Stack>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
With `asChild` the stack lays out its single child element instead of rendering a div. `Stack` replaces the deprecated `HStack` and `VStack` of `alinea/ui`: `<Stack direction="row">` is an HStack.
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
`Stack`
|
|
32
|
+
Lays out its children in a row or column with a gap between them
|
|
33
|
+
| Prop | Type | Default | Description |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| direction | `'row' \| 'column'` | `'column'` | Defaults to `column` |
|
|
36
|
+
| gap | `number \| string` | | Space between the items, a number is in pixels |
|
|
37
|
+
| align | `'start' \| 'center' \| 'end' \| 'stretch' \| 'baseline'` | | Cross axis alignment of the items, they stretch by default |
|
|
38
|
+
| justify | `'start' \| 'center' \| 'end' \| 'between'` | | Main axis distribution of the items |
|
|
39
|
+
| wrap | `boolean` | | Wrap items onto multiple lines |
|
|
40
|
+
| asChild | `boolean` | | Lay out the single child element instead of rendering a div |
|
|
41
|
+
| ref | `Ref<HTMLDivElement>` | | |
|
|
42
|
+
Also accepts `className` and `style`, `id` and `aria-*` labelling attributes, `data-*` attributes.
|
package/docs/components/table.md
CHANGED
|
@@ -112,6 +112,84 @@ export function TableSelectionExample() {
|
|
|
112
112
|
}
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
+
## Load more rows
|
|
116
|
+
|
|
117
|
+
`onLoadMore` is called when the rows are scrolled close to the end, to fetch the next page. While `loading` is set, a spinner shows below the rows, or in place of them while there are none. `useAsyncList` keeps the loaded pages: its `load` function receives the `cursor` the previous page returned, and `loadMore` does nothing once a page returns no cursor. Its `items`, `loading`, `loadMore`, `sortDescriptor` and `sort`, and `selectedKeys` and `setSelectedKeys` plug into the props of the table. `update(key, item)`, `remove(...keys)`, `prepend(...items)` and `append(...items)` change the loaded items without loading them again, for example after a dialog saves a row.
|
|
118
|
+
|
|
119
|
+
Example: Table: async
|
|
120
|
+
```tsx
|
|
121
|
+
import {
|
|
122
|
+
Table,
|
|
123
|
+
TableCell,
|
|
124
|
+
TableRow,
|
|
125
|
+
TableTitle,
|
|
126
|
+
useAsyncList
|
|
127
|
+
} from 'alinea/components'
|
|
128
|
+
|
|
129
|
+
interface Product {
|
|
130
|
+
id: string
|
|
131
|
+
title: string
|
|
132
|
+
price: number
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const materials = ['Linen', 'Oak', 'Wool', 'Walnut', 'Ceramic']
|
|
136
|
+
const kinds = ['shirt', 'chair', 'throw', 'stool', 'lamp', 'table']
|
|
137
|
+
|
|
138
|
+
// Stands in for a paged API: 20 products per page, 100 in total
|
|
139
|
+
async function fetchProducts(page: number) {
|
|
140
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
141
|
+
const items: Array<Product> = Array.from({length: 20}, (_, i) => {
|
|
142
|
+
const n = page * 20 + i
|
|
143
|
+
const title = `${materials[n % 5]} ${kinds[n % 6]} ${n + 1}`
|
|
144
|
+
return {id: `product-${n}`, title, price: 40 + ((n * 37) % 300)}
|
|
145
|
+
})
|
|
146
|
+
return {items, cursor: page < 4 ? page + 1 : undefined}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function TableAsyncExample() {
|
|
150
|
+
const list = useAsyncList<Product, number>({
|
|
151
|
+
load: ({cursor = 0}) => fetchProducts(cursor)
|
|
152
|
+
})
|
|
153
|
+
return (
|
|
154
|
+
<div style={{width: 420, height: 260}}>
|
|
155
|
+
<Table
|
|
156
|
+
aria-label="Products"
|
|
157
|
+
items={list.items}
|
|
158
|
+
columns={[
|
|
159
|
+
{id: 'title', header: 'Title', width: '1fr'},
|
|
160
|
+
{id: 'price', header: 'Price', width: 100, align: 'end'}
|
|
161
|
+
]}
|
|
162
|
+
loading={list.loading}
|
|
163
|
+
onLoadMore={list.loadMore}
|
|
164
|
+
>
|
|
165
|
+
{product => (
|
|
166
|
+
<TableRow id={product.id} textValue={product.title}>
|
|
167
|
+
<TableTitle title={product.title} />
|
|
168
|
+
<TableCell align="end">€{product.price}</TableCell>
|
|
169
|
+
</TableRow>
|
|
170
|
+
)}
|
|
171
|
+
</Table>
|
|
172
|
+
</div>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import {useAsyncList} from 'alinea/components'
|
|
179
|
+
|
|
180
|
+
const list = useAsyncList({
|
|
181
|
+
async load({cursor, filterText, sort, signal}) {
|
|
182
|
+
const res = await fetch(`/api/products?page=${cursor ?? 1}`, {signal})
|
|
183
|
+
const {items, next} = await res.json()
|
|
184
|
+
// Leave out the cursor, or return null, on the last page
|
|
185
|
+
return {items, cursor: next}
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
// list.items, list.loading, list.hasMore, list.error,
|
|
189
|
+
// list.loadMore(), list.reload(), list.setFilterText(text), list.sort(sort),
|
|
190
|
+
// list.update(id, item), list.remove(id), list.prepend(item)
|
|
191
|
+
```
|
|
192
|
+
|
|
115
193
|
## Props
|
|
116
194
|
|
|
117
195
|
`Table`
|
|
@@ -132,6 +210,8 @@ export function TableSelectionExample() {
|
|
|
132
210
|
| onSortChange | `(descriptor: SortDescriptor) => void` | | |
|
|
133
211
|
| onRowAction | `(key: Key) => void` | | Called when a row is activated (see `selectionBehavior`), rows can override it with their own `onAction` |
|
|
134
212
|
| renderEmptyState | `() => ReactNode` | | |
|
|
213
|
+
| loading | `boolean` | | Shows a spinner in place of the rows while there are none, below the rows otherwise |
|
|
214
|
+
| onLoadMore | `() => void` | | Called when the rows are scrolled close to the end, to load the next page (see useAsyncList) |
|
|
135
215
|
| dependencies | `ReadonlyArray<unknown>` | | Rows are cached per item, list the values `children` reads besides the item to render them again when those change |
|
|
136
216
|
| children (required) | `(item: T) => ReactElement` | | |
|
|
137
217
|
|
|
@@ -171,8 +251,12 @@ Also accepts `className` and `style`.
|
|
|
171
251
|
| icon | `IconType` | | Doubles as the drag handle of the row when rows can be dragged |
|
|
172
252
|
| title (required) | `ReactNode` | | |
|
|
173
253
|
| label | `ReactNode` | | A small caption above the title, eg. the parent path |
|
|
254
|
+
| suffix | `ReactNode` | | Shown right after the title, eg. a status icon |
|
|
174
255
|
Also accepts `className` and `style`.
|
|
175
256
|
|
|
257
|
+
`useAsyncList`
|
|
258
|
+
Loads a list of items, with sorting, filtering and paging
|
|
259
|
+
|
|
176
260
|
## Accessibility
|
|
177
261
|
|
|
178
262
|
Built on the React Aria grid: the arrow keys move between rows, Space selects a row and Enter runs its action. Sortable column headers announce their sort direction.
|
|
@@ -43,7 +43,7 @@ export function TextFieldStatesExample() {
|
|
|
43
43
|
|
|
44
44
|
## Multiline
|
|
45
45
|
|
|
46
|
-
A multiline field starts at `rows` lines and grows as editors type.
|
|
46
|
+
A multiline field starts at `rows` lines and grows as editors type, up to `maxRows` lines when you set it, then it scrolls.
|
|
47
47
|
|
|
48
48
|
Example: TextField: multiline
|
|
49
49
|
```tsx
|
|
@@ -55,6 +55,7 @@ export function TextFieldMultilineExample() {
|
|
|
55
55
|
label="Description"
|
|
56
56
|
multiline
|
|
57
57
|
rows={4}
|
|
58
|
+
maxRows={8}
|
|
58
59
|
defaultValue="A relaxed shirt in washed linen that softens with every wear."
|
|
59
60
|
style={{width: 300}}
|
|
60
61
|
/>
|
|
@@ -95,6 +96,10 @@ export function TextFieldIconsExample() {
|
|
|
95
96
|
}
|
|
96
97
|
```
|
|
97
98
|
|
|
99
|
+
## Native input attributes
|
|
100
|
+
|
|
101
|
+
`type`, `name`, `autoComplete`, `inputMode`, `pattern`, `minLength` and `maxLength` are passed to the input. `inputMode` picks the virtual keyboard on touch devices, eg. `numeric` for a code, and `pattern` is a regular expression the value must match, checked when the field is in a [Form](form.md).
|
|
102
|
+
|
|
98
103
|
## Props
|
|
99
104
|
|
|
100
105
|
`TextField`
|
|
@@ -107,6 +112,7 @@ export function TextFieldIconsExample() {
|
|
|
107
112
|
| type | `'text' \| 'email' \| 'url' \| 'password' \| 'tel' \| 'search'` | `'text'` | |
|
|
108
113
|
| multiline | `boolean` | | Render a textarea that grows with its content |
|
|
109
114
|
| rows | `number` | `1` | Minimum number of rows of a multiline field |
|
|
115
|
+
| maxRows | `number` | | Maximum number of rows a multiline field grows to before it scrolls |
|
|
110
116
|
| startIcon | `IconType \| ReactElement` | | Icon displayed inside the input, before the text |
|
|
111
117
|
| endIcon | `IconType \| ReactElement` | | Icon displayed inside the input, after the text |
|
|
112
118
|
| name | `string` | | |
|
|
@@ -114,6 +120,8 @@ export function TextFieldIconsExample() {
|
|
|
114
120
|
| autoComplete | `string` | | |
|
|
115
121
|
| maxLength | `number` | | |
|
|
116
122
|
| minLength | `number` | | |
|
|
123
|
+
| inputMode | `'none' \| 'text' \| 'tel' \| 'url' \| 'email' \| 'numeric' \| 'decimal' \| 'search'` | | Which virtual keyboard to show, eg. `numeric` for a code |
|
|
124
|
+
| pattern | `string` | | A regular expression the value must match to be valid |
|
|
117
125
|
| onBlur | `(event: FocusEvent<TextFieldElement>) => void` | | |
|
|
118
126
|
| onFocus | `(event: FocusEvent<TextFieldElement>) => void` | | |
|
|
119
127
|
| onKeyDown | `(event: KeyboardEvent<TextFieldElement>) => void` | | |
|
|
@@ -18,13 +18,17 @@ export function TimeFieldExample() {
|
|
|
18
18
|
}
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## Value
|
|
22
|
+
|
|
23
|
+
The value is an ISO time string: `14:30`, or `14:30:15` with `granularity="second"`. With a `name` the field submits the same string in a form, like a native time input, and an empty string when no time is set. `hourCycle` only changes how the time is shown.
|
|
24
|
+
|
|
21
25
|
## Props
|
|
22
26
|
|
|
23
27
|
`TimeField`
|
|
24
28
|
| Prop | Type | Default | Description |
|
|
25
29
|
| --- | --- | --- | --- |
|
|
26
30
|
| locale | `string; /** The time, `HH:mm` or `HH:mm:ss` */ value?: string \| null; defaultValue?: string \| null; /** Receives `HH:mm`, or `HH:mm:ss` when granularity is `second` */ onValueChange?: (value: string \| null) => void; /** The earliest valid time, `HH:mm` or `HH:mm:ss` */ min?: string; /** The latest valid time, `HH:mm` or `HH:mm:ss` */ max?: string; /** The smallest unit that can be edited, defaults to `minute` */ granularity?: 'minute' \| 'second'; /** Defaults to the locale's hour cycle */ hourCycle?: 12 \| 24` | | BCP 47 locale used to format dates, eg. `en-GB`, defaults to the user's locale |
|
|
27
|
-
| name | `string` | |
|
|
31
|
+
| name | `string` | | Name of the hidden form input, which submits the time like a native time input: `HH:mm`, or `HH:mm:ss` when granularity is `second`, and an empty string when no time is set |
|
|
28
32
|
| autoFocus | `boolean` | | |
|
|
29
33
|
| label | `ReactNode` | | |
|
|
30
34
|
| description | `ReactNode` | | |
|
package/docs/components.md
CHANGED
|
@@ -34,6 +34,7 @@ Components are the React components the dashboard is built from, import them fro
|
|
|
34
34
|
- [ColorSwatchPicker](components/color-swatch-picker.md): Picks a color from a set of swatches.
|
|
35
35
|
- [DropZone](components/drop-zone.md): A target to drop files or other content on.
|
|
36
36
|
- [Field](components/field.md): The label, help text and error around your own input.
|
|
37
|
+
- [Form](components/form.md): Submits its fields and shows their validation errors.
|
|
37
38
|
|
|
38
39
|
### Collections
|
|
39
40
|
- [Table](components/table.md): Rows and columns with sorting, selection and dragging.
|
|
@@ -67,6 +68,7 @@ Components are the React components the dashboard is built from, import them fro
|
|
|
67
68
|
- [FoldIcon](components/fold-icon.md): A chevron that turns when its section opens.
|
|
68
69
|
|
|
69
70
|
### Layout
|
|
71
|
+
- [Stack](components/stack.md): Lays out its children in a row or column with a gap.
|
|
70
72
|
- [Surface](components/surface.md): A bordered panel for a group of content.
|
|
71
73
|
- [Collapsible](components/collapsible.md): A section that opens and closes.
|
|
72
74
|
- [Page](components/page.md): The header, content and footer of a dashboard page.
|
|
@@ -111,7 +113,7 @@ export function PriorityView({field}: FieldViewProps<PriorityField>) {
|
|
|
111
113
|
}
|
|
112
114
|
```
|
|
113
115
|
|
|
114
|
-
The components are styled by the dashboard's stylesheet and theme
|
|
116
|
+
The components are styled by the dashboard's stylesheet and theme. They are meant for code that runs inside the dashboard, but work on other pages too (see Theme tokens below).
|
|
115
117
|
|
|
116
118
|
## Conventions
|
|
117
119
|
|
|
@@ -129,3 +131,39 @@ The props of every component are typed, so your editor shows what each one accep
|
|
|
129
131
|
## Icons
|
|
130
132
|
|
|
131
133
|
Components with an `icon` prop take an icon component (any component that renders an `<svg>`, such as those from [react-icons](https://react-icons.github.io/react-icons) or copied from [Icones](https://icones.js.org)) or an element. The icons of the dashboard itself are exported from `alinea/dashboard/icons`.
|
|
134
|
+
|
|
135
|
+
## Theme tokens
|
|
136
|
+
|
|
137
|
+
The components are styled with CSS custom properties. `alinea/css` declares them, and its resets, only on elements with a `data-alinea-theme` attribute, so loading the stylesheet doesn't restyle the rest of a page. The dashboard sets the attribute on `<html>`, and popovers, dialogs and tooltips set it on themselves since they render outside the page. To use the components on a page of your site, import `alinea/css` and render them inside an element with `data-alinea-theme`. Add `data-theme="light"` or `data-theme="dark"` to that element to fix the color scheme, otherwise it follows the page.
|
|
138
|
+
|
|
139
|
+
A theme only sets the inputs, as `light-dark()` pairs where a value differs per color scheme. Every other token is derived from them. Set them on the element with `data-alinea-theme`, for example `<div data-alinea-theme className="brand-theme">`:
|
|
140
|
+
|
|
141
|
+
File: theme.css
|
|
142
|
+
```css
|
|
143
|
+
.brand-theme {
|
|
144
|
+
--alinea-radius: 6px;
|
|
145
|
+
--alinea-bg: light-dark(#ffffff, #18181b);
|
|
146
|
+
--alinea-fg: light-dark(#27272a, #e4e4e7);
|
|
147
|
+
--alinea-primary: light-dark(#2f6b45, #5fbf82);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Popovers, dialogs and tooltips render outside that element and carry the attribute themselves, so a class on the page doesn't reach them: use `[data-alinea-theme]` as the selector to theme every part of the components on a page.
|
|
152
|
+
|
|
153
|
+
Inputs:
|
|
154
|
+
|
|
155
|
+
- `--alinea-font`, `--alinea-mono-font`, `--alinea-font-size-base` and `--alinea-radius`.
|
|
156
|
+
- `--alinea-backdrop` (behind panels), `--alinea-bg` (panels), `--alinea-fg` (text) and `--alinea-border`.
|
|
157
|
+
- `--alinea-primary`, `--alinea-danger`, `--alinea-warning` and `--alinea-success`, with `--alinea-primary-fg`, `--alinea-danger-fg` and `--alinea-warning-fg` for text on them.
|
|
158
|
+
- `--alinea-ring`: the focus ring.
|
|
159
|
+
- `--alinea-workspace-color`: the `color` option of the current workspace, set by the dashboard. It falls back to `--alinea-primary`.
|
|
160
|
+
|
|
161
|
+
Derived tokens, to read in your own styles:
|
|
162
|
+
|
|
163
|
+
- Text: `--alinea-fg-strong`, `--alinea-fg-muted`, `--alinea-fg-disabled` and `--alinea-field-label`.
|
|
164
|
+
- Surfaces: `--alinea-bg-muted`, `--alinea-muted` (hover backgrounds), `--alinea-input`, `--alinea-overlay`, `--alinea-scrim` (behind dialogs) and `--alinea-border-strong`.
|
|
165
|
+
- Tones: `--alinea-selected` and `--alinea-selected-fg`, and a `-subtle` background with a `-subtle-fg` text color for `primary`, `danger`, `warning` and `success`, eg. `--alinea-danger-subtle`.
|
|
166
|
+
- Entry statuses: `--alinea-status-published`, `--alinea-status-draft` and `--alinea-status-unpublished`, each with a `-fg` color.
|
|
167
|
+
- Shape and motion: `--alinea-radius-sm`, `--alinea-radius-lg`, `--alinea-radius-xl`, `--alinea-shadow-raised`, `--alinea-shadow-muted`, `--alinea-shadow-tooltip`, `--alinea-shadow-modal` and `--alinea-transition`.
|
|
168
|
+
|
|
169
|
+
The color palette the default theme is built from (`--alinea-gray-500`, `--alinea-blue-800`, ...) is not part of this list and can change.
|
package/docs/configuration.md
CHANGED
|
@@ -56,9 +56,11 @@ The URL of the API route that serves the dashboard and media files: the route th
|
|
|
56
56
|
|
|
57
57
|
The URL of your website, either one string or one per environment: `{development, production}`, picked by `NODE_ENV`. A value without a protocol gets `https://`.
|
|
58
58
|
|
|
59
|
-
- `alinea build` exits with `
|
|
59
|
+
- It is required for production builds when `handlerUrl` is relative: `alinea build` exits, and queries on your site throw, with `Missing baseUrl in Alinea config: set baseUrl.production to the url of your site, …`. An absolute `handlerUrl` doesn't need it.
|
|
60
60
|
- In production your site reaches the handler at `handlerUrl` resolved against this URL, to check for new content. That includes `next start` on your machine, which talks to the production URL.
|
|
61
61
|
|
|
62
|
+
Server renders have no request to take the origin from (static pages and pages from `generateStaticParams` are rendered without one, and reading the request headers would make every route dynamic), so Alinea doesn't guess it. Set `baseUrl.production`, or make `handlerUrl` absolute.
|
|
63
|
+
|
|
62
64
|
Most projects read the production URL from an environment variable, see [Environment variables](#environment-variables) below.
|
|
63
65
|
|
|
64
66
|
## Dashboard options
|
|
@@ -96,7 +98,7 @@ Scale down JPEG, PNG and WebP uploads larger than `maxWidth` or `maxHeight` pixe
|
|
|
96
98
|
|
|
97
99
|
### `syncInterval`
|
|
98
100
|
|
|
99
|
-
How your deployed site keeps its content fresh. The site checks the content revision of the repository and syncs right away when it changed; `syncInterval` is the fallback interval in seconds when that revision can't be determined. Defaults to `60`.
|
|
101
|
+
How your deployed site keeps its content fresh. The site checks the content revision of the repository and syncs right away when it changed; `syncInterval` is the fallback interval in seconds when that revision can't be determined. Defaults to `60`. In Next.js a value you set also controls how long renders share the latest revision, which bounds how soon content pushed without the dashboard shows up; without one that is five minutes.
|
|
100
102
|
|
|
101
103
|
- `0` syncs on every query.
|
|
102
104
|
- `Infinity` never syncs: the site only serves the content it was built with, and new content goes live with the next deploy.
|