pagescms 0.0.0-stage → 3.0.1
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/LICENSE +21 -0
- package/README.md +66 -2
- package/dist/package/_headers +7 -0
- package/dist/package/cli.mjs +138 -0
- package/dist/package/config-CAscGjBB.js +123 -0
- package/dist/package/config.mjs +1 -0
- package/dist/package/favicon.ico +0 -0
- package/dist/package/favicon.svg +16 -0
- package/dist/package/generate-B-YdQuMX.js +48 -0
- package/dist/package/generate.mjs +1 -0
- package/dist/package/images/astro-blog-template.webp +0 -0
- package/dist/package/images/eleventy-blog-template.webp +0 -0
- package/dist/package/images/email-logo.png +0 -0
- package/dist/package/images/nextjs-blog-template.webp +0 -0
- package/dist/package/images/social-card.png +0 -0
- package/dist/package/migrate.mjs +184 -0
- package/dist/package/reference/docs/configuration/actions.md +160 -0
- package/dist/package/reference/docs/configuration/components.md +56 -0
- package/dist/package/reference/docs/configuration/content/filename.md +63 -0
- package/dist/package/reference/docs/configuration/content/formats.md +63 -0
- package/dist/package/reference/docs/configuration/content/index.md +138 -0
- package/dist/package/reference/docs/configuration/content/view.md +52 -0
- package/dist/package/reference/docs/configuration/fields/block.md +62 -0
- package/dist/package/reference/docs/configuration/fields/boolean.md +22 -0
- package/dist/package/reference/docs/configuration/fields/code.md +29 -0
- package/dist/package/reference/docs/configuration/fields/date.md +35 -0
- package/dist/package/reference/docs/configuration/fields/file.md +34 -0
- package/dist/package/reference/docs/configuration/fields/image.md +48 -0
- package/dist/package/reference/docs/configuration/fields/index.md +130 -0
- package/dist/package/reference/docs/configuration/fields/number.md +28 -0
- package/dist/package/reference/docs/configuration/fields/object.md +63 -0
- package/dist/package/reference/docs/configuration/fields/reference.md +64 -0
- package/dist/package/reference/docs/configuration/fields/rich-text.md +126 -0
- package/dist/package/reference/docs/configuration/fields/select.md +48 -0
- package/dist/package/reference/docs/configuration/fields/string.md +31 -0
- package/dist/package/reference/docs/configuration/fields/text.md +30 -0
- package/dist/package/reference/docs/configuration/fields/uuid.md +28 -0
- package/dist/package/reference/docs/configuration/index.md +88 -0
- package/dist/package/reference/docs/configuration/localization.md +138 -0
- package/dist/package/reference/docs/configuration/media.md +77 -0
- package/dist/package/reference/docs/configuration/settings.md +85 -0
- package/dist/package/reference/docs/extending/custom-field.md +107 -0
- package/dist/package/reference/docs/extending/field-api.md +71 -0
- package/dist/package/reference/docs/extending/plugins.md +67 -0
- package/dist/package/reference/docs/guides/actions.md +14 -0
- package/dist/package/reference/docs/guides/collaborators.md +43 -0
- package/dist/package/reference/docs/guides/editing.md +36 -0
- package/dist/package/reference/docs/guides/media.md +24 -0
- package/dist/package/reference/docs/guides/translations.md +40 -0
- package/dist/package/reference/docs/how-it-works.md +33 -0
- package/dist/package/reference/docs/index.md +25 -0
- package/dist/package/reference/docs/quick-start.md +87 -0
- package/dist/package/reference/docs/reference.md +84 -0
- package/dist/package/reference/docs/self-hosting/cloudflare.md +62 -0
- package/dist/package/reference/docs/self-hosting/environment-variables.md +84 -0
- package/dist/package/reference/docs/self-hosting/github-app.md +54 -0
- package/dist/package/reference/docs/self-hosting/index.md +44 -0
- package/dist/package/reference/docs/self-hosting/netlify.md +41 -0
- package/dist/package/reference/docs/self-hosting/node.md +42 -0
- package/dist/package/reference/docs/self-hosting/upgrading.md +44 -0
- package/dist/package/reference/docs/self-hosting/vercel.md +41 -0
- package/dist/package/reference/docs.json +119 -0
- package/dist/package/reference/manifest.json +190 -0
- package/dist/package/reference.md +79 -0
- package/dist/package/serve-D2bbxXbp.js +25 -0
- package/dist/package/smtp.mjs +13 -0
- package/dist/package/vite-BUlNpf2j.js +260 -0
- package/dist/package/vite.mjs +1 -0
- package/dist/types/client/api/account.d.ts +33 -0
- package/dist/types/client/api/actions.d.ts +67 -0
- package/dist/types/client/api/activity.d.ts +4 -0
- package/dist/types/client/api/admin.d.ts +11 -0
- package/dist/types/client/api/auth.d.ts +375 -0
- package/dist/types/client/api/authentication.d.ts +2 -0
- package/dist/types/client/api/cache.d.ts +6 -0
- package/dist/types/client/api/collaborators.d.ts +13 -0
- package/dist/types/client/api/collections.d.ts +4 -0
- package/dist/types/client/api/configuration.d.ts +10 -0
- package/dist/types/client/api/dashboard.d.ts +2 -0
- package/dist/types/client/api/entries.d.ts +14 -0
- package/dist/types/client/api/entry-write.d.ts +3394 -0
- package/dist/types/client/api/fixed-file.d.ts +11 -0
- package/dist/types/client/api/index.d.ts +8 -0
- package/dist/types/client/api/local-account.d.ts +1 -0
- package/dist/types/client/api/media.d.ts +38 -0
- package/dist/types/client/api/reference.d.ts +7 -0
- package/dist/types/client/api/repositories.d.ts +1 -0
- package/dist/types/client/api/repository-search.d.ts +6 -0
- package/dist/types/client/api/repository.d.ts +14 -0
- package/dist/types/client/queries/admin.d.ts +179 -0
- package/dist/types/client/queries/content.d.ts +2012 -0
- package/dist/types/client/queries/file-history.d.ts +13 -0
- package/dist/types/client/queries/keys.d.ts +32 -0
- package/dist/types/client/queries/references.d.ts +59 -0
- package/dist/types/client/queries/repository-invalidation.d.ts +7 -0
- package/dist/types/client/queries/repository.d.ts +271 -0
- package/dist/types/client/queries/session.d.ts +116 -0
- package/dist/types/client.d.ts +1 -0
- package/dist/types/components/action-history-menu.d.ts +11 -0
- package/dist/types/components/code-editor-language.d.ts +1 -0
- package/dist/types/components/code-editor.d.ts +23 -0
- package/dist/types/components/code-field.d.ts +10 -0
- package/dist/types/components/collaborator-identity.d.ts +5 -0
- package/dist/types/components/collaborator-invite-input.d.ts +8 -0
- package/dist/types/components/collaborators-loading.d.ts +2 -0
- package/dist/types/components/collection-entry-creator.d.ts +14 -0
- package/dist/types/components/component-preloading.d.ts +1 -0
- package/dist/types/components/content-entry-editor.d.ts +20 -0
- package/dist/types/components/content-entry-skeleton.d.ts +4 -0
- package/dist/types/components/content-icon.d.ts +8 -0
- package/dist/types/components/dropdown-loading-row.d.ts +5 -0
- package/dist/types/components/editor-layout.d.ts +5 -0
- package/dist/types/components/editor-skeleton.d.ts +4 -0
- package/dist/types/components/error-alert.d.ts +6 -0
- package/dist/types/components/file-editor-history.d.ts +4 -0
- package/dist/types/components/file-editor-menu.d.ts +12 -0
- package/dist/types/components/github-icon.d.ts +2 -0
- package/dist/types/components/gradient-avatar-fallback.d.ts +4 -0
- package/dist/types/components/media-file-icon.d.ts +4 -0
- package/dist/types/components/media-thumbnail.d.ts +18 -0
- package/dist/types/components/operation-error.d.ts +18 -0
- package/dist/types/components/option-combobox.d.ts +24 -0
- package/dist/types/components/otp-verification-form.d.ts +13 -0
- package/dist/types/components/repository-action-buttons.d.ts +24 -0
- package/dist/types/components/repository-breadcrumb.d.ts +11 -0
- package/dist/types/components/repository-page-header.d.ts +15 -0
- package/dist/types/components/repository-shell.d.ts +26 -0
- package/dist/types/components/rich-text-field.d.ts +13 -0
- package/dist/types/components/root-error.d.ts +2 -0
- package/dist/types/components/search-input.d.ts +7 -0
- package/dist/types/components/settings-back-link.d.ts +4 -0
- package/dist/types/components/settings-layout.d.ts +17 -0
- package/dist/types/components/settings-loading.d.ts +2 -0
- package/dist/types/components/settings-row.d.ts +2 -0
- package/dist/types/components/sign-in-form.d.ts +6 -0
- package/dist/types/components/startup-error.d.ts +1 -0
- package/dist/types/components/structured-content-field.d.ts +23 -0
- package/dist/types/components/table-pager.d.ts +9 -0
- package/dist/types/components/ui/alert-dialog.d.ts +18 -0
- package/dist/types/components/ui/alert.d.ts +10 -0
- package/dist/types/components/ui/avatar.d.ts +12 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/breadcrumb.d.ts +11 -0
- package/dist/types/components/ui/button-group.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +10 -0
- package/dist/types/components/ui/card.d.ts +11 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/combobox.d.ts +27 -0
- package/dist/types/components/ui/command.d.ts +18 -0
- package/dist/types/components/ui/dialog.d.ts +17 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/types/components/ui/editor/blockquote.d.ts +3 -0
- package/dist/types/components/ui/editor/document.d.ts +6 -0
- package/dist/types/components/ui/editor/html-policy.d.ts +20 -0
- package/dist/types/components/ui/editor/image.d.ts +12 -0
- package/dist/types/components/ui/editor/index.d.ts +52 -0
- package/dist/types/components/ui/editor/preserve.d.ts +39 -0
- package/dist/types/components/ui/editor/slash-command/commands-list.d.ts +24 -0
- package/dist/types/components/ui/editor/slash-command/commands.d.ts +14 -0
- package/dist/types/components/ui/editor/slash-command/suggestion.d.ts +42 -0
- package/dist/types/components/ui/empty.d.ts +11 -0
- package/dist/types/components/ui/field.d.ts +24 -0
- package/dist/types/components/ui/input-group.d.ts +16 -0
- package/dist/types/components/ui/input-otp.d.ts +11 -0
- package/dist/types/components/ui/input.d.ts +3 -0
- package/dist/types/components/ui/label.d.ts +4 -0
- package/dist/types/components/ui/pagination.d.ts +17 -0
- package/dist/types/components/ui/popover.d.ts +10 -0
- package/dist/types/components/ui/progress.d.ts +4 -0
- package/dist/types/components/ui/radio-group.d.ts +5 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +15 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +14 -0
- package/dist/types/components/ui/sidebar.d.ts +69 -0
- package/dist/types/components/ui/skeleton.d.ts +2 -0
- package/dist/types/components/ui/sonner.d.ts +3 -0
- package/dist/types/components/ui/spinner.d.ts +3 -0
- package/dist/types/components/ui/switch.d.ts +6 -0
- package/dist/types/components/ui/table.d.ts +19 -0
- package/dist/types/components/ui/tabs.d.ts +11 -0
- package/dist/types/components/ui/textarea.d.ts +3 -0
- package/dist/types/components/ui/toggle-group.d.ts +10 -0
- package/dist/types/components/ui/toggle.d.ts +9 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/deployment/builtins/resend-email.server.d.ts +2 -0
- package/dist/types/deployment/conformance/media-storage.d.ts +15 -0
- package/dist/types/deployment/contracts/client.d.ts +17 -0
- package/dist/types/deployment/contracts/server.server.d.ts +15 -0
- package/dist/types/deployment/contracts/version.d.ts +4 -0
- package/dist/types/deployment/default/client.d.ts +2 -0
- package/dist/types/deployment/default/server.server.d.ts +2 -0
- package/dist/types/features/account/account-copy.d.ts +11 -0
- package/dist/types/features/account/account-deleted-notice.d.ts +3 -0
- package/dist/types/features/account/account-menu.d.ts +7 -0
- package/dist/types/features/account/account-messages.d.ts +2 -0
- package/dist/types/features/account/app-header.d.ts +6 -0
- package/dist/types/features/account/content-editing-preferences.d.ts +3 -0
- package/dist/types/features/account/delete-account.d.ts +6 -0
- package/dist/types/features/account/language-field.d.ts +6 -0
- package/dist/types/features/account/language-preference.d.ts +4 -0
- package/dist/types/features/account/local-account-data.d.ts +1 -0
- package/dist/types/features/account/local-account-storage.d.ts +8 -0
- package/dist/types/features/account/profile-editor.d.ts +51 -0
- package/dist/types/features/account/profile-fields.d.ts +17 -0
- package/dist/types/features/account/profile-loading.d.ts +1 -0
- package/dist/types/features/account/profile-picture.d.ts +13 -0
- package/dist/types/features/account/profile-settings.d.ts +8 -0
- package/dist/types/features/account/profile-setup-heading.d.ts +1 -0
- package/dist/types/features/account/profile-setup.d.ts +5 -0
- package/dist/types/features/account/require-profile.d.ts +6 -0
- package/dist/types/features/account/sign-in-layout.d.ts +5 -0
- package/dist/types/features/account/sign-in-page.d.ts +9 -0
- package/dist/types/features/account/theme-preference.d.ts +1 -0
- package/dist/types/features/account/use-account-preferences.d.ts +14 -0
- package/dist/types/features/account/use-profile-editor.d.ts +41 -0
- package/dist/types/features/account/use-profile-update.d.ts +19 -0
- package/dist/types/features/activity/activity-feed-item.d.ts +7 -0
- package/dist/types/features/activity/activity-feed-skeleton.d.ts +1 -0
- package/dist/types/features/activity/activity-feed.d.ts +11 -0
- package/dist/types/features/activity/activity-query.d.ts +5 -0
- package/dist/types/features/admin/action-run-status.d.ts +5 -0
- package/dist/types/features/admin/actions-page.d.ts +9 -0
- package/dist/types/features/admin/actions-skeleton.d.ts +1 -0
- package/dist/types/features/admin/admin-loading.d.ts +5 -0
- package/dist/types/features/admin/admin-page.d.ts +2 -0
- package/dist/types/features/admin/allowlist-table.d.ts +12 -0
- package/dist/types/features/admin/cache-copy.d.ts +4 -0
- package/dist/types/features/admin/cache-files-trigger.d.ts +1 -0
- package/dist/types/features/admin/cache-files.d.ts +6 -0
- package/dist/types/features/admin/cache-page.d.ts +6 -0
- package/dist/types/features/admin/cache-skeleton.d.ts +1 -0
- package/dist/types/features/admin/collaborators-page.d.ts +6 -0
- package/dist/types/features/admin/collaborators-skeleton.d.ts +2 -0
- package/dist/types/features/admin/configuration-contribution.d.ts +5 -0
- package/dist/types/features/admin/configuration-page.d.ts +9 -0
- package/dist/types/features/admin/configuration-setup.d.ts +1 -0
- package/dist/types/features/admin/configuration-skeleton.d.ts +1 -0
- package/dist/types/features/admin/plugin-page.d.ts +14 -0
- package/dist/types/features/admin/repository-actions-page.d.ts +1 -0
- package/dist/types/features/admin/repository-admin-access.d.ts +6 -0
- package/dist/types/features/admin/repository-admin-page.d.ts +12 -0
- package/dist/types/features/admin/repository-configuration-page.d.ts +1 -0
- package/dist/types/features/admin/sign-in-allowlist.d.ts +1 -0
- package/dist/types/features/admin/use-action-run-tracking.d.ts +5 -0
- package/dist/types/features/collaborators/collaborator-status.d.ts +4 -0
- package/dist/types/features/collaborators/collaborators-contribution.d.ts +5 -0
- package/dist/types/features/collections/collection-cell.d.ts +25 -0
- package/dist/types/features/collections/collection-header.d.ts +28 -0
- package/dist/types/features/collections/collection-model.d.ts +32 -0
- package/dist/types/features/collections/collection-page.d.ts +4 -0
- package/dist/types/features/collections/collection-skeleton.d.ts +1 -0
- package/dist/types/features/collections/collection-table-layout.d.ts +18 -0
- package/dist/types/features/collections/collection-table.d.ts +44 -0
- package/dist/types/features/content/content-mutations.d.ts +78 -0
- package/dist/types/features/content/unavailable-entry.d.ts +6 -0
- package/dist/types/features/content/use-entry-actions.d.ts +100 -0
- package/dist/types/features/dashboard/about-dialog.d.ts +2 -0
- package/dist/types/features/dashboard/branch-manager.d.ts +8 -0
- package/dist/types/features/dashboard/branch-picker.d.ts +2 -0
- package/dist/types/features/dashboard/create-branch-dialog.d.ts +8 -0
- package/dist/types/features/dashboard/recent-repositories.d.ts +14 -0
- package/dist/types/features/dashboard/recent-repository-list.d.ts +3 -0
- package/dist/types/features/dashboard/relative-time.d.ts +1 -0
- package/dist/types/features/dashboard/repository-dashboard.d.ts +13 -0
- package/dist/types/features/dashboard/repository-loading.d.ts +10 -0
- package/dist/types/features/dashboard/repository-selector.d.ts +10 -0
- package/dist/types/features/dashboard/repository-template-preview.d.ts +8 -0
- package/dist/types/features/dashboard/repository-templates.d.ts +5 -0
- package/dist/types/features/drafts/collection-creation.d.ts +20 -0
- package/dist/types/features/drafts/draft-discard-dialog.d.ts +8 -0
- package/dist/types/features/drafts/draft-field-preview.d.ts +10 -0
- package/dist/types/features/drafts/draft-merge-dialog.d.ts +11 -0
- package/dist/types/features/drafts/draft-merge-fields.d.ts +2 -0
- package/dist/types/features/drafts/draft-read-cache.d.ts +13 -0
- package/dist/types/features/drafts/draft-save-button.d.ts +19 -0
- package/dist/types/features/drafts/draft-session.d.ts +63 -0
- package/dist/types/features/drafts/draft-store.d.ts +44 -0
- package/dist/types/features/drafts/merge-draft.d.ts +22 -0
- package/dist/types/features/drafts/relative-age.d.ts +1 -0
- package/dist/types/features/drafts/saved-draft-menu.d.ts +6 -0
- package/dist/types/features/drafts/use-content-draft.d.ts +30 -0
- package/dist/types/features/drafts/use-draft-merge.d.ts +15 -0
- package/dist/types/features/drafts/use-duplicate-entry.d.ts +7 -0
- package/dist/types/features/drafts/use-review-viewport.d.ts +28 -0
- package/dist/types/features/editor/commit-message-dialog.d.ts +8 -0
- package/dist/types/features/editor/editor-component-loaders.d.ts +8 -0
- package/dist/types/features/editor/entry-breadcrumb.d.ts +28 -0
- package/dist/types/features/editor/entry-page-header.d.ts +9 -0
- package/dist/types/features/editor/entry-title.d.ts +13 -0
- package/dist/types/features/editor/field-locale-menu.d.ts +10 -0
- package/dist/types/features/editor/field-locale-values.d.ts +5 -0
- package/dist/types/features/editor/fields/core-field-renderers.d.ts +1 -0
- package/dist/types/features/editor/fields/custom-field-components.d.ts +3 -0
- package/dist/types/features/editor/fields/field-renderer-registry.d.ts +23 -0
- package/dist/types/features/editor/fields/field-types.d.ts +15 -0
- package/dist/types/features/editor/fields/field-validation.d.ts +27 -0
- package/dist/types/features/editor/fields/structured-field-options.d.ts +9 -0
- package/dist/types/features/editor/fields/use-reference-options.d.ts +14 -0
- package/dist/types/features/editor/file-locale-menu.d.ts +26 -0
- package/dist/types/features/editor/locale-context.d.ts +31 -0
- package/dist/types/features/editor/locale-selection.d.ts +13 -0
- package/dist/types/features/editor/rich-text-media.d.ts +10 -0
- package/dist/types/features/editor/start-translation-dialog.d.ts +10 -0
- package/dist/types/features/editor/translation-preferences.d.ts +8 -0
- package/dist/types/features/editor/translation-start.d.ts +13 -0
- package/dist/types/features/media/media-breadcrumb.d.ts +8 -0
- package/dist/types/features/media/media-browser.d.ts +23 -0
- package/dist/types/features/media/media-delivery.d.ts +35 -0
- package/dist/types/features/media/media-drag-overlay.d.ts +1 -0
- package/dist/types/features/media/media-entry.d.ts +21 -0
- package/dist/types/features/media/media-folder-tree.d.ts +8 -0
- package/dist/types/features/media/media-model.d.ts +22 -0
- package/dist/types/features/media/media-move-dialog.d.ts +12 -0
- package/dist/types/features/media/media-mutations.d.ts +43 -0
- package/dist/types/features/media/media-page.d.ts +6 -0
- package/dist/types/features/media/media-picker-dialog.d.ts +14 -0
- package/dist/types/features/media/media-skeleton.d.ts +6 -0
- package/dist/types/features/media/media-upload.d.ts +28 -0
- package/dist/types/features/media/media-view.d.ts +3 -0
- package/dist/types/features/media/upload-conflict-dialog.d.ts +5 -0
- package/dist/types/features/media/upload-conflicts.d.ts +47 -0
- package/dist/types/features/pending-writes/account-operation.d.ts +10 -0
- package/dist/types/features/pending-writes/pending-write.d.ts +9 -0
- package/dist/types/features/pending-writes/use-operation.d.ts +30 -0
- package/dist/types/features/plugins/standalone-plugin-page.d.ts +4 -0
- package/dist/types/features/plugins/standalone-plugin-routes.d.ts +9 -0
- package/dist/types/features/repository/configuration-required.d.ts +10 -0
- package/dist/types/features/repository/overview-draft-actions.d.ts +5 -0
- package/dist/types/features/repository/overview-entry.d.ts +6 -0
- package/dist/types/features/repository/overview-file-item.d.ts +8 -0
- package/dist/types/features/repository/overview-loading.d.ts +4 -0
- package/dist/types/features/repository/overview-local-files.d.ts +10 -0
- package/dist/types/features/repository/overview-media-upload.d.ts +8 -0
- package/dist/types/features/repository/overview-shortcuts.d.ts +11 -0
- package/dist/types/features/repository/overview.d.ts +7 -0
- package/dist/types/features/repository/repository-loading.d.ts +2 -0
- package/dist/types/features/repository/repository-route-resource.d.ts +8 -0
- package/dist/types/features/repository/repository-route-state.d.ts +8 -0
- package/dist/types/features/repository/repository-shell-loading.d.ts +1 -0
- package/dist/types/features/repository/repository-unavailable-error.d.ts +2 -0
- package/dist/types/features/repository/use-overview-files.d.ts +9 -0
- package/dist/types/features/settings/account-access-table.d.ts +8 -0
- package/dist/types/features/settings/account-settings-contribution.d.ts +4 -0
- package/dist/types/features/settings/settings-navigation.d.ts +14 -0
- package/dist/types/features/settings/shared-projects.d.ts +3 -0
- package/dist/types/features/settings/user-settings-skeleton.d.ts +5 -0
- package/dist/types/features/settings/user-settings.d.ts +1 -0
- package/dist/types/fields/definition.d.ts +23 -0
- package/dist/types/fields/registry.d.ts +2 -0
- package/dist/types/hooks/use-media-github-link.d.ts +10 -0
- package/dist/types/hooks/use-mobile.d.ts +1 -0
- package/dist/types/hooks/use-page-scrolled.d.ts +1 -0
- package/dist/types/hooks/use-repository-coordinates.d.ts +7 -0
- package/dist/types/hooks/use-repository-github-link.d.ts +2 -0
- package/dist/types/hooks/use-route-retry.d.ts +5 -0
- package/dist/types/hooks/use-sidebar-scroll.d.ts +5 -0
- package/dist/types/hooks/use-unsaved-warning.d.ts +1 -0
- package/dist/types/i18n/catalogs.d.ts +3 -0
- package/dist/types/i18n/dates.d.ts +3 -0
- package/dist/types/i18n/document-title.d.ts +10 -0
- package/dist/types/i18n/error-catalogs.d.ts +4 -0
- package/dist/types/i18n/errors.d.ts +13 -0
- package/dist/types/i18n/known-errors.d.ts +2 -0
- package/dist/types/i18n/locale.d.ts +6 -0
- package/dist/types/i18n/localized-error.d.ts +4 -0
- package/dist/types/i18n/localized-route-head.d.ts +5 -0
- package/dist/types/i18n/message.d.ts +8 -0
- package/dist/types/i18n/plugin-catalogs.d.ts +3 -0
- package/dist/types/i18n/test-provider.d.ts +4 -0
- package/dist/types/integrations/tanstack-query/devtools.d.ts +5 -0
- package/dist/types/integrations/tanstack-query/root-provider.d.ts +4 -0
- package/dist/types/lib/access-denial.d.ts +10 -0
- package/dist/types/lib/action-run-tracker.d.ts +34 -0
- package/dist/types/lib/action-run-tracking.d.ts +9 -0
- package/dist/types/lib/actions.d.ts +32 -0
- package/dist/types/lib/activity.d.ts +23 -0
- package/dist/types/lib/auth-error.d.ts +1 -0
- package/dist/types/lib/auth-redirect.d.ts +2 -0
- package/dist/types/lib/authentication.d.ts +20 -0
- package/dist/types/lib/avatar-gradient.d.ts +1 -0
- package/dist/types/lib/base64.d.ts +3 -0
- package/dist/types/lib/cn.d.ts +1 -0
- package/dist/types/lib/collaborator-invites.d.ts +4 -0
- package/dist/types/lib/collaborator-key.d.ts +2 -0
- package/dist/types/lib/collaborator-status.d.ts +1 -0
- package/dist/types/lib/commit-message.d.ts +27 -0
- package/dist/types/lib/component-loader.d.ts +2 -0
- package/dist/types/lib/component-preloading.d.ts +11 -0
- package/dist/types/lib/configuration-completion.d.ts +10 -0
- package/dist/types/lib/content-field-values.d.ts +8 -0
- package/dist/types/lib/content-field.d.ts +2 -0
- package/dist/types/lib/content-filename.d.ts +6 -0
- package/dist/types/lib/content-icon-loader.d.ts +2 -0
- package/dist/types/lib/content-operations.d.ts +15 -0
- package/dist/types/lib/content-validation.d.ts +5 -0
- package/dist/types/lib/core-route-paths.d.ts +2 -0
- package/dist/types/lib/date-field.d.ts +4 -0
- package/dist/types/lib/deferred-component.d.ts +8 -0
- package/dist/types/lib/field-value-shapes.d.ts +11 -0
- package/dist/types/lib/field-values.d.ts +9 -0
- package/dist/types/lib/file-history.d.ts +2 -0
- package/dist/types/lib/file-types.d.ts +13 -0
- package/dist/types/lib/i18n-media.d.ts +4 -0
- package/dist/types/lib/i18n-schema.d.ts +44 -0
- package/dist/types/lib/i18n-values.d.ts +21 -0
- package/dist/types/lib/i18n.d.ts +43 -0
- package/dist/types/lib/icon-name.d.ts +1 -0
- package/dist/types/lib/markdown-images.d.ts +2 -0
- package/dist/types/lib/media-assets.d.ts +9 -0
- package/dist/types/lib/media-field-values.d.ts +20 -0
- package/dist/types/lib/media-upload-name.d.ts +3 -0
- package/dist/types/lib/media-variants.d.ts +4 -0
- package/dist/types/lib/notifications.d.ts +16 -0
- package/dist/types/lib/operation-error.d.ts +3 -0
- package/dist/types/lib/page-title.d.ts +9 -0
- package/dist/types/lib/profile.d.ts +6 -0
- package/dist/types/lib/reference-pages.d.ts +12 -0
- package/dist/types/lib/repository-identity.d.ts +18 -0
- package/dist/types/lib/repository-page-path.d.ts +4 -0
- package/dist/types/lib/repository.d.ts +13 -0
- package/dist/types/lib/select-options.d.ts +4 -0
- package/dist/types/lib/use-raw-search.d.ts +2 -0
- package/dist/types/package/cli.d.ts +2 -0
- package/dist/types/package/cloudflare-project-routes.d.ts +2 -0
- package/dist/types/package/config.d.ts +41 -0
- package/dist/types/package/configured-icons.d.ts +2 -0
- package/dist/types/package/constants.d.ts +2 -0
- package/dist/types/package/deploy-config.d.ts +1 -0
- package/dist/types/package/generate.d.ts +10 -0
- package/dist/types/package/icon-path.d.ts +2 -0
- package/dist/types/package/load.d.ts +1 -0
- package/dist/types/package/migrate.d.ts +31 -0
- package/dist/types/package/node-middleware.d.ts +7 -0
- package/dist/types/package/runtime.d.ts +20 -0
- package/dist/types/package/runtime.server.d.ts +11 -0
- package/dist/types/package/serve.d.ts +5 -0
- package/dist/types/package/server-entry.d.ts +1 -0
- package/dist/types/package/smtp.d.ts +9 -0
- package/dist/types/package/smtp.server.d.ts +2 -0
- package/dist/types/package/vite.d.ts +23 -0
- package/dist/types/plugins/client.d.ts +129 -0
- package/dist/types/plugins/compose.server.d.ts +30 -0
- package/dist/types/plugins/email/cloudflare.server.d.ts +6 -0
- package/dist/types/plugins/email/resend.server.d.ts +2 -0
- package/dist/types/plugins/email/smtp.server.d.ts +15 -0
- package/dist/types/plugins/identity.d.ts +4 -0
- package/dist/types/plugins/server.d.ts +83 -0
- package/dist/types/routeTree.gen.d.ts +592 -0
- package/dist/types/router.d.ts +6 -0
- package/dist/types/routes/__root.d.ts +8 -0
- package/dist/types/routes/admin.d.ts +17 -0
- package/dist/types/routes/auth.error.d.ts +4 -0
- package/dist/types/routes/auth.redirect.d.ts +5 -0
- package/dist/types/routes/github.$owner.$repo.$branch.$page.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.actions.d.ts +13 -0
- package/dist/types/routes/github.$owner.$repo.$branch.cache.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collaborators.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name.d.ts +90 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name_.edit.$.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name_.entry.$.d.ts +15 -0
- package/dist/types/routes/github.$owner.$repo.$branch.collection.$name_.new.d.ts +28 -0
- package/dist/types/routes/github.$owner.$repo.$branch.configuration.d.ts +11 -0
- package/dist/types/routes/github.$owner.$repo.$branch.d.ts +6 -0
- package/dist/types/routes/github.$owner.$repo.$branch.file.$name.d.ts +19 -0
- package/dist/types/routes/github.$owner.$repo.$branch.index.d.ts +32 -0
- package/dist/types/routes/github.$owner.$repo.$branch.media.$name.d.ts +14 -0
- package/dist/types/routes/github.$owner.$repo.index.d.ts +7 -0
- package/dist/types/routes/index.d.ts +11 -0
- package/dist/types/routes/onboarding.d.ts +7 -0
- package/dist/types/routes/settings.d.ts +1 -0
- package/dist/types/routes/sign-in.d.ts +11 -0
- package/dist/types/server/access/policy.d.ts +108 -0
- package/dist/types/server/access/repository-identity-policy.d.ts +3 -0
- package/dist/types/server/access/repository-identity.d.ts +65 -0
- package/dist/types/server/access/repository-policy.d.ts +33 -0
- package/dist/types/server/access/repository.d.ts +227 -0
- package/dist/types/server/account/account.d.ts +39 -0
- package/dist/types/server/account/deletion.d.ts +15 -0
- package/dist/types/server/account/preferences.d.ts +6 -0
- package/dist/types/server/actions/actions.d.ts +152 -0
- package/dist/types/server/activity/capture.d.ts +33 -0
- package/dist/types/server/activity/details.d.ts +23 -0
- package/dist/types/server/activity/store.d.ts +50 -0
- package/dist/types/server/activity/webhook.d.ts +4 -0
- package/dist/types/server/admin/access.d.ts +4 -0
- package/dist/types/server/admin/admin.d.ts +43 -0
- package/dist/types/server/admin/sign-in-allowlist.d.ts +16 -0
- package/dist/types/server/auth/index.d.ts +751 -0
- package/dist/types/server/auth/oauth-account.d.ts +23 -0
- package/dist/types/server/auth/oauth-token-adapter.d.ts +2 -0
- package/dist/types/server/auth/oauth-token-crypto.d.ts +7 -0
- package/dist/types/server/auth/rate-limit.d.ts +3 -0
- package/dist/types/server/auth/secret-crypto.d.ts +5 -0
- package/dist/types/server/auth/sign-in-allowlist.d.ts +4 -0
- package/dist/types/server/cache/configuration-access.d.ts +33 -0
- package/dist/types/server/cache/configuration-read.d.ts +5 -0
- package/dist/types/server/cache/configuration.d.ts +67 -0
- package/dist/types/server/cache/directory-store.d.ts +35 -0
- package/dist/types/server/cache/directory.d.ts +65 -0
- package/dist/types/server/cache/policy.d.ts +14 -0
- package/dist/types/server/cache/repository-read.d.ts +3 -0
- package/dist/types/server/cache/repository.d.ts +30 -0
- package/dist/types/server/collaborators/api.d.ts +2 -0
- package/dist/types/server/collaborators/branches.d.ts +7 -0
- package/dist/types/server/collaborators/collaborators.d.ts +90 -0
- package/dist/types/server/collaborators/membership-match.d.ts +5 -0
- package/dist/types/server/collaborators/shared-projects.d.ts +13 -0
- package/dist/types/server/content/collection.d.ts +67 -0
- package/dist/types/server/content/conflict.d.ts +1 -0
- package/dist/types/server/content/entry-editor.d.ts +2308 -0
- package/dist/types/server/content/localized-directory.d.ts +7 -0
- package/dist/types/server/content/reference.d.ts +26 -0
- package/dist/types/server/content/write-response.d.ts +7 -0
- package/dist/types/server/context-cloudflare.d.ts +1050 -0
- package/dist/types/server/context-node.d.ts +1051 -0
- package/dist/types/server/context.d.ts +1094 -0
- package/dist/types/server/csrf.d.ts +2 -0
- package/dist/types/server/db/client.d.ts +10 -0
- package/dist/types/server/db/core.d.ts +27 -0
- package/dist/types/server/db/schema.d.ts +3270 -0
- package/dist/types/server/db/sql.d.ts +8 -0
- package/dist/types/server/email/email.d.ts +15 -0
- package/dist/types/server/email/templates.d.ts +36 -0
- package/dist/types/server/email/translations.d.ts +121 -0
- package/dist/types/server/github/account.d.ts +7 -0
- package/dist/types/server/github/api.d.ts +208 -0
- package/dist/types/server/github/app-install.d.ts +2 -0
- package/dist/types/server/github/app.d.ts +21 -0
- package/dist/types/server/github/installation-token-cache.d.ts +5 -0
- package/dist/types/server/github/large-collection.d.ts +2 -0
- package/dist/types/server/github/webhook-response.d.ts +2 -0
- package/dist/types/server/github/webhook.d.ts +37 -0
- package/dist/types/server/http.d.ts +7 -0
- package/dist/types/server/index.d.ts +5 -0
- package/dist/types/server/media/media.d.ts +145 -0
- package/dist/types/server/media/preview.d.ts +8 -0
- package/dist/types/server/media/provider.d.ts +233 -0
- package/dist/types/server/repository/activity.d.ts +2 -0
- package/dist/types/server/repository/branches.d.ts +12 -0
- package/dist/types/server/repository/provider.d.ts +155 -0
- package/dist/types/server/repository/repositories.d.ts +55 -0
- package/dist/types/server/request-body.d.ts +4 -0
- package/dist/types/server/routes/account.d.ts +4 -0
- package/dist/types/server/routes/actions.d.ts +4 -0
- package/dist/types/server/routes/activity.d.ts +4 -0
- package/dist/types/server/routes/admin.d.ts +4 -0
- package/dist/types/server/routes/app-version.d.ts +1 -0
- package/dist/types/server/routes/auth.d.ts +4 -0
- package/dist/types/server/routes/cache.d.ts +4 -0
- package/dist/types/server/routes/collaborators.d.ts +4 -0
- package/dist/types/server/routes/configuration.d.ts +4 -0
- package/dist/types/server/routes/entries.d.ts +4 -0
- package/dist/types/server/routes/health.d.ts +6 -0
- package/dist/types/server/routes/index.d.ts +3 -0
- package/dist/types/server/routes/media.d.ts +4 -0
- package/dist/types/server/routes/plugin-request.d.ts +3 -0
- package/dist/types/server/routes/plugins.d.ts +4 -0
- package/dist/types/server/routes/repositories.d.ts +4 -0
- package/dist/types/server/routes/shared.d.ts +16 -0
- package/dist/types/server/routes/webhooks.d.ts +4 -0
- package/dist/types/server/runtime/runtime-ports.d.ts +4 -0
- package/dist/types/server/runtime-config.d.ts +41 -0
- package/dist/types/server/services/account-language.d.ts +3 -0
- package/dist/types/server/services/account.d.ts +41 -0
- package/dist/types/server/services/actions.d.ts +107 -0
- package/dist/types/server/services/activity.d.ts +51 -0
- package/dist/types/server/services/admin.d.ts +61 -0
- package/dist/types/server/services/authentication-state.d.ts +3 -0
- package/dist/types/server/services/cache-management.d.ts +41 -0
- package/dist/types/server/services/cache.d.ts +25 -0
- package/dist/types/server/services/collaborators.d.ts +22 -0
- package/dist/types/server/services/configuration-editor.d.ts +36 -0
- package/dist/types/server/services/configuration.d.ts +20 -0
- package/dist/types/server/services/content.d.ts +4764 -0
- package/dist/types/server/services/context.d.ts +37 -0
- package/dist/types/server/services/dashboard.d.ts +20 -0
- package/dist/types/server/services/entry-translations.d.ts +9 -0
- package/dist/types/server/services/errors.d.ts +14 -0
- package/dist/types/server/services/index.d.ts +12 -0
- package/dist/types/server/services/local-account-data.d.ts +4 -0
- package/dist/types/server/services/media.d.ts +96 -0
- package/dist/types/server/services/reference.d.ts +10 -0
- package/dist/types/server/services/repository.d.ts +40 -0
- package/dist/types/shared/account-preferences.d.ts +13 -0
- package/dist/types/shared/application-operations.d.ts +2 -0
- package/dist/types/shared/collection-presentation.d.ts +13 -0
- package/dist/types/shared/configuration-compatibility.d.ts +10 -0
- package/dist/types/shared/configuration-components.d.ts +4 -0
- package/dist/types/shared/configuration-content.d.ts +21 -0
- package/dist/types/shared/configuration-discovery.d.ts +3 -0
- package/dist/types/shared/configuration-names.d.ts +7 -0
- package/dist/types/shared/configuration-navigation.d.ts +25 -0
- package/dist/types/shared/configuration-schema.d.ts +653 -0
- package/dist/types/shared/configuration-settings.d.ts +4 -0
- package/dist/types/shared/configuration-source.d.ts +17 -0
- package/dist/types/shared/configuration-yaml.d.ts +23 -0
- package/dist/types/shared/configuration.d.ts +4 -0
- package/dist/types/shared/content-conflict.d.ts +2 -0
- package/dist/types/shared/content-serialization.d.ts +18 -0
- package/dist/types/shared/field-validation-error.d.ts +3 -0
- package/dist/types/shared/git-path.d.ts +11 -0
- package/dist/types/shared/json.d.ts +13 -0
- package/dist/types/shared/media-error.d.ts +9 -0
- package/dist/types/shared/repository-search.d.ts +5 -0
- package/dist/types/shared/repository-templates.d.ts +17 -0
- package/dist/types/shared/requests/account.d.ts +16 -0
- package/dist/types/shared/requests/action.d.ts +52 -0
- package/dist/types/shared/requests/activity.d.ts +7 -0
- package/dist/types/shared/requests/admin.d.ts +35 -0
- package/dist/types/shared/requests/branch.d.ts +7 -0
- package/dist/types/shared/requests/cache.d.ts +22 -0
- package/dist/types/shared/requests/collaborator.d.ts +20 -0
- package/dist/types/shared/requests/collection.d.ts +10 -0
- package/dist/types/shared/requests/configuration.d.ts +21 -0
- package/dist/types/shared/requests/entry-write.d.ts +108 -0
- package/dist/types/shared/requests/entry.d.ts +17 -0
- package/dist/types/shared/requests/fixed-file.d.ts +8 -0
- package/dist/types/shared/requests/local-account.d.ts +4 -0
- package/dist/types/shared/requests/media.d.ts +135 -0
- package/dist/types/shared/requests/reference.d.ts +14 -0
- package/dist/types/shared/requests/repository-template.d.ts +6 -0
- package/dist/types/shared/requests/repository.d.ts +6 -0
- package/dist/types/shared/requests/ui-language.d.ts +4 -0
- package/dist/types/shared/sign-in-allowlist.d.ts +18 -0
- package/dist/types/shared/yaml-aliases.d.ts +1 -0
- package/docs/public/configuration/actions.md +160 -0
- package/docs/public/configuration/components.md +56 -0
- package/docs/public/configuration/content/filename.md +63 -0
- package/docs/public/configuration/content/formats.md +63 -0
- package/docs/public/configuration/content/index.md +138 -0
- package/docs/public/configuration/content/view.md +52 -0
- package/docs/public/configuration/fields/block.md +62 -0
- package/docs/public/configuration/fields/boolean.md +22 -0
- package/docs/public/configuration/fields/code.md +29 -0
- package/docs/public/configuration/fields/date.md +35 -0
- package/docs/public/configuration/fields/file.md +34 -0
- package/docs/public/configuration/fields/image.md +48 -0
- package/docs/public/configuration/fields/index.md +130 -0
- package/docs/public/configuration/fields/number.md +28 -0
- package/docs/public/configuration/fields/object.md +63 -0
- package/docs/public/configuration/fields/reference.md +64 -0
- package/docs/public/configuration/fields/rich-text.md +126 -0
- package/docs/public/configuration/fields/select.md +48 -0
- package/docs/public/configuration/fields/string.md +31 -0
- package/docs/public/configuration/fields/text.md +30 -0
- package/docs/public/configuration/fields/uuid.md +28 -0
- package/docs/public/configuration/index.md +88 -0
- package/docs/public/configuration/localization.md +138 -0
- package/docs/public/configuration/media.md +77 -0
- package/docs/public/configuration/settings.md +85 -0
- package/docs/public/docs.json +119 -0
- package/docs/public/extending/custom-field.md +107 -0
- package/docs/public/extending/field-api.md +71 -0
- package/docs/public/extending/plugins.md +67 -0
- package/docs/public/guides/actions.md +14 -0
- package/docs/public/guides/collaborators.md +43 -0
- package/docs/public/guides/editing.md +36 -0
- package/docs/public/guides/media.md +24 -0
- package/docs/public/guides/translations.md +40 -0
- package/docs/public/how-it-works.md +33 -0
- package/docs/public/index.md +25 -0
- package/docs/public/quick-start.md +87 -0
- package/docs/public/reference.md +84 -0
- package/docs/public/self-hosting/cloudflare.md +62 -0
- package/docs/public/self-hosting/environment-variables.md +84 -0
- package/docs/public/self-hosting/github-app.md +54 -0
- package/docs/public/self-hosting/index.md +44 -0
- package/docs/public/self-hosting/netlify.md +41 -0
- package/docs/public/self-hosting/node.md +42 -0
- package/docs/public/self-hosting/upgrading.md +44 -0
- package/docs/public/self-hosting/vercel.md +41 -0
- package/drizzle/0000_wet_overlord.sql +268 -0
- package/drizzle/meta/0000_snapshot.json +1858 -0
- package/drizzle/meta/_journal.json +13 -0
- package/index.html +53 -0
- package/package.json +368 -3
- package/public/_headers +7 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +16 -0
- package/public/images/astro-blog-template.webp +0 -0
- package/public/images/eleventy-blog-template.webp +0 -0
- package/public/images/email-logo.png +0 -0
- package/public/images/nextjs-blog-template.webp +0 -0
- package/public/images/social-card.png +0 -0
- package/public/reference/docs/configuration/actions.md +160 -0
- package/public/reference/docs/configuration/components.md +56 -0
- package/public/reference/docs/configuration/content/filename.md +63 -0
- package/public/reference/docs/configuration/content/formats.md +63 -0
- package/public/reference/docs/configuration/content/index.md +138 -0
- package/public/reference/docs/configuration/content/view.md +52 -0
- package/public/reference/docs/configuration/fields/block.md +62 -0
- package/public/reference/docs/configuration/fields/boolean.md +22 -0
- package/public/reference/docs/configuration/fields/code.md +29 -0
- package/public/reference/docs/configuration/fields/date.md +35 -0
- package/public/reference/docs/configuration/fields/file.md +34 -0
- package/public/reference/docs/configuration/fields/image.md +48 -0
- package/public/reference/docs/configuration/fields/index.md +130 -0
- package/public/reference/docs/configuration/fields/number.md +28 -0
- package/public/reference/docs/configuration/fields/object.md +63 -0
- package/public/reference/docs/configuration/fields/reference.md +64 -0
- package/public/reference/docs/configuration/fields/rich-text.md +126 -0
- package/public/reference/docs/configuration/fields/select.md +48 -0
- package/public/reference/docs/configuration/fields/string.md +31 -0
- package/public/reference/docs/configuration/fields/text.md +30 -0
- package/public/reference/docs/configuration/fields/uuid.md +28 -0
- package/public/reference/docs/configuration/index.md +88 -0
- package/public/reference/docs/configuration/localization.md +138 -0
- package/public/reference/docs/configuration/media.md +77 -0
- package/public/reference/docs/configuration/settings.md +85 -0
- package/public/reference/docs/extending/custom-field.md +107 -0
- package/public/reference/docs/extending/field-api.md +71 -0
- package/public/reference/docs/extending/plugins.md +67 -0
- package/public/reference/docs/guides/actions.md +14 -0
- package/public/reference/docs/guides/collaborators.md +43 -0
- package/public/reference/docs/guides/editing.md +36 -0
- package/public/reference/docs/guides/media.md +24 -0
- package/public/reference/docs/guides/translations.md +40 -0
- package/public/reference/docs/how-it-works.md +33 -0
- package/public/reference/docs/index.md +25 -0
- package/public/reference/docs/quick-start.md +87 -0
- package/public/reference/docs/reference.md +84 -0
- package/public/reference/docs/self-hosting/cloudflare.md +62 -0
- package/public/reference/docs/self-hosting/environment-variables.md +84 -0
- package/public/reference/docs/self-hosting/github-app.md +54 -0
- package/public/reference/docs/self-hosting/index.md +44 -0
- package/public/reference/docs/self-hosting/netlify.md +41 -0
- package/public/reference/docs/self-hosting/node.md +42 -0
- package/public/reference/docs/self-hosting/upgrading.md +44 -0
- package/public/reference/docs/self-hosting/vercel.md +41 -0
- package/public/reference/docs.json +119 -0
- package/public/reference/manifest.json +190 -0
- package/public/reference.md +79 -0
- package/scripts/collaborators.mjs +470 -0
- package/scripts/setup-github-app.mjs +837 -0
- package/src/client/api/account.ts +48 -0
- package/src/client/api/actions.ts +53 -0
- package/src/client/api/activity.ts +17 -0
- package/src/client/api/admin.ts +25 -0
- package/src/client/api/auth.ts +8 -0
- package/src/client/api/authentication.ts +8 -0
- package/src/client/api/cache.ts +18 -0
- package/src/client/api/collaborators.ts +18 -0
- package/src/client/api/collections.ts +26 -0
- package/src/client/api/configuration.ts +38 -0
- package/src/client/api/dashboard.ts +6 -0
- package/src/client/api/entries.ts +53 -0
- package/src/client/api/entry-write.ts +54 -0
- package/src/client/api/fixed-file.ts +23 -0
- package/src/client/api/index.ts +98 -0
- package/src/client/api/local-account.ts +5 -0
- package/src/client/api/media.ts +62 -0
- package/src/client/api/reference.ts +9 -0
- package/src/client/api/repositories.ts +7 -0
- package/src/client/api/repository-search.ts +18 -0
- package/src/client/api/repository.ts +39 -0
- package/src/client/queries/admin.ts +19 -0
- package/src/client/queries/content.ts +114 -0
- package/src/client/queries/file-history.ts +44 -0
- package/src/client/queries/keys.ts +56 -0
- package/src/client/queries/references.ts +124 -0
- package/src/client/queries/repository-invalidation.ts +27 -0
- package/src/client/queries/repository.ts +96 -0
- package/src/client/queries/session.ts +45 -0
- package/src/client.tsx +15 -0
- package/src/components/action-history-menu.tsx +273 -0
- package/src/components/code-editor-language.ts +29 -0
- package/src/components/code-editor.tsx +146 -0
- package/src/components/code-field.tsx +42 -0
- package/src/components/collaborator-identity.tsx +34 -0
- package/src/components/collaborator-invite-input.tsx +160 -0
- package/src/components/collaborators-loading.tsx +53 -0
- package/src/components/collection-entry-creator.tsx +558 -0
- package/src/components/component-preloading.tsx +23 -0
- package/src/components/content-entry-editor.tsx +1240 -0
- package/src/components/content-entry-skeleton.tsx +200 -0
- package/src/components/content-icon.tsx +51 -0
- package/src/components/dropdown-loading-row.tsx +19 -0
- package/src/components/editor-layout.tsx +16 -0
- package/src/components/editor-skeleton.tsx +21 -0
- package/src/components/error-alert.tsx +44 -0
- package/src/components/file-editor-history.tsx +191 -0
- package/src/components/file-editor-menu.tsx +113 -0
- package/src/components/github-icon.tsx +17 -0
- package/src/components/gradient-avatar-fallback.tsx +39 -0
- package/src/components/media-file-icon.tsx +40 -0
- package/src/components/media-thumbnail.tsx +199 -0
- package/src/components/operation-error.tsx +161 -0
- package/src/components/option-combobox.tsx +195 -0
- package/src/components/otp-verification-form.tsx +125 -0
- package/src/components/repository-action-buttons.tsx +547 -0
- package/src/components/repository-breadcrumb.tsx +169 -0
- package/src/components/repository-page-header.tsx +97 -0
- package/src/components/repository-shell.tsx +938 -0
- package/src/components/rich-text-field.tsx +324 -0
- package/src/components/root-error.tsx +77 -0
- package/src/components/search-input.tsx +37 -0
- package/src/components/settings-back-link.tsx +43 -0
- package/src/components/settings-layout.tsx +178 -0
- package/src/components/settings-loading.tsx +19 -0
- package/src/components/settings-row.ts +9 -0
- package/src/components/sign-in-form.tsx +285 -0
- package/src/components/startup-error.tsx +93 -0
- package/src/components/structured-content-field.tsx +1900 -0
- package/src/components/table-pager.tsx +62 -0
- package/src/components/ui/alert-dialog.tsx +199 -0
- package/src/components/ui/alert.tsx +78 -0
- package/src/components/ui/avatar.tsx +113 -0
- package/src/components/ui/badge.tsx +53 -0
- package/src/components/ui/breadcrumb.tsx +128 -0
- package/src/components/ui/button-group.tsx +84 -0
- package/src/components/ui/button.tsx +67 -0
- package/src/components/ui/card.tsx +102 -0
- package/src/components/ui/checkbox.tsx +38 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/combobox.tsx +336 -0
- package/src/components/ui/command.tsx +202 -0
- package/src/components/ui/dialog.tsx +174 -0
- package/src/components/ui/dropdown-menu.tsx +279 -0
- package/src/components/ui/editor/blockquote.ts +45 -0
- package/src/components/ui/editor/document.ts +29 -0
- package/src/components/ui/editor/html-policy.ts +945 -0
- package/src/components/ui/editor/image.ts +309 -0
- package/src/components/ui/editor/index.tsx +1383 -0
- package/src/components/ui/editor/preserve.ts +494 -0
- package/src/components/ui/editor/slash-command/commands-list.tsx +122 -0
- package/src/components/ui/editor/slash-command/commands.ts +66 -0
- package/src/components/ui/editor/slash-command/suggestion.tsx +305 -0
- package/src/components/ui/editor/typeset.css +1120 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +246 -0
- package/src/components/ui/input-group.tsx +155 -0
- package/src/components/ui/input-otp.tsx +84 -0
- package/src/components/ui/input.tsx +18 -0
- package/src/components/ui/label.tsx +23 -0
- package/src/components/ui/pagination.tsx +153 -0
- package/src/components/ui/popover.tsx +86 -0
- package/src/components/ui/progress.tsx +29 -0
- package/src/components/ui/radio-group.tsx +41 -0
- package/src/components/ui/scroll-area.tsx +52 -0
- package/src/components/ui/select.tsx +206 -0
- package/src/components/ui/separator.tsx +25 -0
- package/src/components/ui/sheet.tsx +152 -0
- package/src/components/ui/sidebar.tsx +693 -0
- package/src/components/ui/skeleton.tsx +14 -0
- package/src/components/ui/sonner.tsx +88 -0
- package/src/components/ui/spinner.tsx +24 -0
- package/src/components/ui/switch.tsx +32 -0
- package/src/components/ui/table.tsx +165 -0
- package/src/components/ui/tabs.tsx +88 -0
- package/src/components/ui/textarea.tsx +17 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +47 -0
- package/src/components/ui/tooltip.tsx +54 -0
- package/src/deployment/builtins/resend-email.server.ts +75 -0
- package/src/deployment/conformance/media-storage.ts +177 -0
- package/src/deployment/contracts/client.ts +331 -0
- package/src/deployment/contracts/server.server.ts +55 -0
- package/src/deployment/contracts/version.ts +8 -0
- package/src/deployment/default/client.ts +6 -0
- package/src/deployment/default/server.server.ts +8 -0
- package/src/features/account/account-copy.ts +17 -0
- package/src/features/account/account-deleted-notice.tsx +23 -0
- package/src/features/account/account-menu.tsx +139 -0
- package/src/features/account/account-messages.ts +4 -0
- package/src/features/account/app-header.tsx +46 -0
- package/src/features/account/content-editing-preferences.tsx +104 -0
- package/src/features/account/delete-account.tsx +236 -0
- package/src/features/account/language-field.tsx +79 -0
- package/src/features/account/language-preference.tsx +101 -0
- package/src/features/account/local-account-data.tsx +131 -0
- package/src/features/account/local-account-storage.ts +82 -0
- package/src/features/account/profile-editor.ts +269 -0
- package/src/features/account/profile-fields.tsx +156 -0
- package/src/features/account/profile-loading.tsx +51 -0
- package/src/features/account/profile-picture.tsx +272 -0
- package/src/features/account/profile-settings.tsx +50 -0
- package/src/features/account/profile-setup-heading.tsx +17 -0
- package/src/features/account/profile-setup.tsx +171 -0
- package/src/features/account/require-profile.ts +40 -0
- package/src/features/account/sign-in-layout.tsx +29 -0
- package/src/features/account/sign-in-page.tsx +45 -0
- package/src/features/account/theme-preference.tsx +89 -0
- package/src/features/account/use-account-preferences.ts +96 -0
- package/src/features/account/use-profile-editor.ts +102 -0
- package/src/features/account/use-profile-update.ts +64 -0
- package/src/features/activity/activity-feed-item.tsx +320 -0
- package/src/features/activity/activity-feed-skeleton.tsx +28 -0
- package/src/features/activity/activity-feed.tsx +113 -0
- package/src/features/activity/activity-query.ts +17 -0
- package/src/features/admin/action-run-status.tsx +103 -0
- package/src/features/admin/actions-page.tsx +869 -0
- package/src/features/admin/actions-skeleton.tsx +155 -0
- package/src/features/admin/admin-loading.tsx +165 -0
- package/src/features/admin/admin-page.tsx +573 -0
- package/src/features/admin/allowlist-table.tsx +125 -0
- package/src/features/admin/cache-copy.ts +12 -0
- package/src/features/admin/cache-files-trigger.tsx +17 -0
- package/src/features/admin/cache-files.tsx +196 -0
- package/src/features/admin/cache-page.tsx +302 -0
- package/src/features/admin/cache-skeleton.tsx +76 -0
- package/src/features/admin/collaborators-page.tsx +425 -0
- package/src/features/admin/collaborators-skeleton.tsx +95 -0
- package/src/features/admin/configuration-contribution.tsx +44 -0
- package/src/features/admin/configuration-page.tsx +303 -0
- package/src/features/admin/configuration-setup.tsx +51 -0
- package/src/features/admin/configuration-skeleton.tsx +68 -0
- package/src/features/admin/plugin-page.tsx +115 -0
- package/src/features/admin/repository-actions-page.tsx +32 -0
- package/src/features/admin/repository-admin-access.ts +35 -0
- package/src/features/admin/repository-admin-page.tsx +75 -0
- package/src/features/admin/repository-configuration-page.tsx +18 -0
- package/src/features/admin/sign-in-allowlist.tsx +381 -0
- package/src/features/admin/use-action-run-tracking.ts +32 -0
- package/src/features/collaborators/collaborator-status.tsx +47 -0
- package/src/features/collaborators/collaborators-contribution.tsx +59 -0
- package/src/features/collections/collection-cell.tsx +336 -0
- package/src/features/collections/collection-header.tsx +233 -0
- package/src/features/collections/collection-model.ts +232 -0
- package/src/features/collections/collection-page.tsx +836 -0
- package/src/features/collections/collection-skeleton.tsx +106 -0
- package/src/features/collections/collection-table-layout.tsx +158 -0
- package/src/features/collections/collection-table.tsx +828 -0
- package/src/features/content/content-mutations.ts +544 -0
- package/src/features/content/unavailable-entry.tsx +64 -0
- package/src/features/content/use-entry-actions.tsx +399 -0
- package/src/features/dashboard/about-dialog.tsx +212 -0
- package/src/features/dashboard/branch-manager.tsx +118 -0
- package/src/features/dashboard/branch-picker.ts +17 -0
- package/src/features/dashboard/create-branch-dialog.tsx +182 -0
- package/src/features/dashboard/recent-repositories.ts +119 -0
- package/src/features/dashboard/recent-repository-list.tsx +82 -0
- package/src/features/dashboard/relative-time.ts +30 -0
- package/src/features/dashboard/repository-dashboard.tsx +174 -0
- package/src/features/dashboard/repository-loading.tsx +119 -0
- package/src/features/dashboard/repository-selector.tsx +398 -0
- package/src/features/dashboard/repository-template-preview.tsx +46 -0
- package/src/features/dashboard/repository-templates.tsx +237 -0
- package/src/features/drafts/collection-creation.ts +78 -0
- package/src/features/drafts/draft-discard-dialog.tsx +90 -0
- package/src/features/drafts/draft-field-preview.tsx +128 -0
- package/src/features/drafts/draft-merge-dialog.tsx +322 -0
- package/src/features/drafts/draft-merge-fields.ts +25 -0
- package/src/features/drafts/draft-read-cache.ts +73 -0
- package/src/features/drafts/draft-save-button.tsx +240 -0
- package/src/features/drafts/draft-session.ts +374 -0
- package/src/features/drafts/draft-store.ts +438 -0
- package/src/features/drafts/merge-draft.ts +131 -0
- package/src/features/drafts/relative-age.ts +13 -0
- package/src/features/drafts/saved-draft-menu.tsx +108 -0
- package/src/features/drafts/use-content-draft.tsx +157 -0
- package/src/features/drafts/use-draft-merge.tsx +253 -0
- package/src/features/drafts/use-duplicate-entry.ts +124 -0
- package/src/features/drafts/use-review-viewport.ts +61 -0
- package/src/features/editor/commit-message-dialog.tsx +100 -0
- package/src/features/editor/editor-component-loaders.ts +35 -0
- package/src/features/editor/entry-breadcrumb.ts +64 -0
- package/src/features/editor/entry-page-header.tsx +51 -0
- package/src/features/editor/entry-title.ts +55 -0
- package/src/features/editor/field-locale-menu.tsx +166 -0
- package/src/features/editor/field-locale-values.ts +69 -0
- package/src/features/editor/fields/core-field-renderers.tsx +300 -0
- package/src/features/editor/fields/custom-field-components.ts +15 -0
- package/src/features/editor/fields/field-renderer-registry.ts +45 -0
- package/src/features/editor/fields/field-types.ts +15 -0
- package/src/features/editor/fields/field-validation.tsx +174 -0
- package/src/features/editor/fields/structured-field-options.ts +66 -0
- package/src/features/editor/fields/use-reference-options.ts +47 -0
- package/src/features/editor/file-locale-menu.tsx +487 -0
- package/src/features/editor/locale-context.tsx +264 -0
- package/src/features/editor/locale-selection.tsx +63 -0
- package/src/features/editor/rich-text-media.ts +134 -0
- package/src/features/editor/start-translation-dialog.tsx +136 -0
- package/src/features/editor/translation-preferences.ts +58 -0
- package/src/features/editor/translation-start.ts +35 -0
- package/src/features/media/media-breadcrumb.tsx +84 -0
- package/src/features/media/media-browser.tsx +1236 -0
- package/src/features/media/media-delivery.ts +348 -0
- package/src/features/media/media-drag-overlay.tsx +59 -0
- package/src/features/media/media-entry.tsx +417 -0
- package/src/features/media/media-folder-tree.tsx +216 -0
- package/src/features/media/media-model.ts +60 -0
- package/src/features/media/media-move-dialog.tsx +97 -0
- package/src/features/media/media-mutations.ts +351 -0
- package/src/features/media/media-page.tsx +24 -0
- package/src/features/media/media-picker-dialog.tsx +123 -0
- package/src/features/media/media-skeleton.tsx +97 -0
- package/src/features/media/media-upload.ts +340 -0
- package/src/features/media/media-view.ts +16 -0
- package/src/features/media/upload-conflict-dialog.tsx +126 -0
- package/src/features/media/upload-conflicts.ts +166 -0
- package/src/features/pending-writes/account-operation.ts +44 -0
- package/src/features/pending-writes/pending-write.ts +41 -0
- package/src/features/pending-writes/use-operation.ts +158 -0
- package/src/features/plugins/standalone-plugin-page.tsx +31 -0
- package/src/features/plugins/standalone-plugin-routes.tsx +70 -0
- package/src/features/repository/configuration-required.tsx +91 -0
- package/src/features/repository/overview-draft-actions.tsx +28 -0
- package/src/features/repository/overview-entry.ts +59 -0
- package/src/features/repository/overview-file-item.tsx +115 -0
- package/src/features/repository/overview-loading.tsx +94 -0
- package/src/features/repository/overview-local-files.tsx +138 -0
- package/src/features/repository/overview-media-upload.tsx +183 -0
- package/src/features/repository/overview-shortcuts.tsx +138 -0
- package/src/features/repository/overview.tsx +88 -0
- package/src/features/repository/repository-loading.ts +12 -0
- package/src/features/repository/repository-route-resource.ts +26 -0
- package/src/features/repository/repository-route-state.tsx +147 -0
- package/src/features/repository/repository-shell-loading.tsx +228 -0
- package/src/features/repository/repository-unavailable-error.tsx +90 -0
- package/src/features/repository/use-overview-files.ts +74 -0
- package/src/features/settings/account-access-table.tsx +69 -0
- package/src/features/settings/account-settings-contribution.tsx +88 -0
- package/src/features/settings/settings-navigation.ts +99 -0
- package/src/features/settings/shared-projects.tsx +246 -0
- package/src/features/settings/user-settings-skeleton.tsx +132 -0
- package/src/features/settings/user-settings.tsx +426 -0
- package/src/fields/custom/README.md +56 -0
- package/src/fields/definition.ts +45 -0
- package/src/fields/registry.ts +9 -0
- package/src/hooks/use-media-github-link.ts +29 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-page-scrolled.ts +14 -0
- package/src/hooks/use-repository-coordinates.ts +15 -0
- package/src/hooks/use-repository-github-link.ts +8 -0
- package/src/hooks/use-route-retry.ts +27 -0
- package/src/hooks/use-sidebar-scroll.ts +48 -0
- package/src/hooks/use-unsaved-warning.ts +14 -0
- package/src/i18n/catalogs.ts +37 -0
- package/src/i18n/dates.ts +19 -0
- package/src/i18n/document-title.tsx +22 -0
- package/src/i18n/error-catalogs.ts +37 -0
- package/src/i18n/errors.ts +71 -0
- package/src/i18n/known-errors.ts +2738 -0
- package/src/i18n/lingui.config.mjs +18 -0
- package/src/i18n/locale.ts +51 -0
- package/src/i18n/localized-error.tsx +7 -0
- package/src/i18n/localized-route-head.tsx +82 -0
- package/src/i18n/message.ts +34 -0
- package/src/i18n/plugin-catalogs.ts +97 -0
- package/src/i18n/po.d.ts +5 -0
- package/src/i18n/test-provider.tsx +12 -0
- package/src/integrations/tanstack-query/devtools.tsx +6 -0
- package/src/integrations/tanstack-query/root-provider.tsx +26 -0
- package/src/lib/access-denial.ts +96 -0
- package/src/lib/action-run-tracker.ts +144 -0
- package/src/lib/action-run-tracking.ts +204 -0
- package/src/lib/actions.ts +105 -0
- package/src/lib/activity.ts +119 -0
- package/src/lib/auth-error.ts +15 -0
- package/src/lib/auth-redirect.ts +29 -0
- package/src/lib/authentication.ts +22 -0
- package/src/lib/avatar-gradient.ts +10 -0
- package/src/lib/base64.ts +29 -0
- package/src/lib/cn.ts +1 -0
- package/src/lib/collaborator-invites.ts +55 -0
- package/src/lib/collaborator-key.ts +4 -0
- package/src/lib/collaborator-status.ts +10 -0
- package/src/lib/commit-message.ts +149 -0
- package/src/lib/component-loader.ts +13 -0
- package/src/lib/component-preloading.ts +152 -0
- package/src/lib/configuration-completion.ts +61 -0
- package/src/lib/configuration-reference.d.mts +2 -0
- package/src/lib/configuration-reference.mjs +5 -0
- package/src/lib/content-field-values.ts +157 -0
- package/src/lib/content-field.ts +5 -0
- package/src/lib/content-filename.ts +116 -0
- package/src/lib/content-icon-loader.ts +42 -0
- package/src/lib/content-operations.ts +49 -0
- package/src/lib/content-validation.ts +68 -0
- package/src/lib/core-route-paths.ts +15 -0
- package/src/lib/date-field.ts +53 -0
- package/src/lib/deferred-component.tsx +42 -0
- package/src/lib/field-value-shapes.ts +94 -0
- package/src/lib/field-values.ts +467 -0
- package/src/lib/file-history.ts +9 -0
- package/src/lib/file-types.ts +88 -0
- package/src/lib/i18n-media.ts +77 -0
- package/src/lib/i18n-schema.ts +38 -0
- package/src/lib/i18n-values.ts +428 -0
- package/src/lib/i18n.ts +408 -0
- package/src/lib/icon-name.ts +2 -0
- package/src/lib/markdown-images.ts +156 -0
- package/src/lib/media-assets.ts +39 -0
- package/src/lib/media-field-values.ts +378 -0
- package/src/lib/media-upload-name.ts +41 -0
- package/src/lib/media-variants.ts +18 -0
- package/src/lib/notifications.ts +156 -0
- package/src/lib/operation-error.ts +9 -0
- package/src/lib/page-title.ts +13 -0
- package/src/lib/profile.ts +50 -0
- package/src/lib/reference-pages.ts +24 -0
- package/src/lib/repository-identity.ts +73 -0
- package/src/lib/repository-page-path.ts +29 -0
- package/src/lib/repository.ts +68 -0
- package/src/lib/select-options.ts +23 -0
- package/src/lib/use-raw-search.ts +9 -0
- package/src/locales/de/messages.po +5696 -0
- package/src/locales/en/messages.po +6125 -0
- package/src/locales/es/messages.po +5919 -0
- package/src/locales/fr/messages.po +6125 -0
- package/src/locales/ja/messages.po +5696 -0
- package/src/locales/pt-BR/messages.po +5919 -0
- package/src/locales/zh-CN/messages.po +5919 -0
- package/src/package/cli.ts +132 -0
- package/src/package/cloudflare-project-routes.ts +16 -0
- package/src/package/config.ts +224 -0
- package/src/package/configured-icons.ts +58 -0
- package/src/package/constants.ts +4 -0
- package/src/package/deploy-config.ts +59 -0
- package/src/package/generate.ts +108 -0
- package/src/package/icon-path.ts +9 -0
- package/src/package/libsql-web.mjs +1 -0
- package/src/package/libsql.mjs +1 -0
- package/src/package/load.ts +19 -0
- package/src/package/migrate.ts +365 -0
- package/src/package/node-middleware.ts +29 -0
- package/src/package/runtime.server.ts +66 -0
- package/src/package/runtime.ts +115 -0
- package/src/package/serve.ts +47 -0
- package/src/package/server-entry.ts +1 -0
- package/src/package/smtp.server.ts +52 -0
- package/src/package/smtp.ts +24 -0
- package/src/package/vite.ts +376 -0
- package/src/plugins/client.ts +141 -0
- package/src/plugins/compose.server.ts +429 -0
- package/src/plugins/email/cloudflare.server.ts +58 -0
- package/src/plugins/email/resend.server.ts +12 -0
- package/src/plugins/email/smtp.server.ts +77 -0
- package/src/plugins/identity.ts +17 -0
- package/src/plugins/server.ts +106 -0
- package/src/routeTree.gen.ts +510 -0
- package/src/router.tsx +49 -0
- package/src/routes/__root.tsx +149 -0
- package/src/routes/admin.tsx +77 -0
- package/src/routes/auth.error.tsx +64 -0
- package/src/routes/auth.redirect.tsx +12 -0
- package/src/routes/github.$owner.$repo.$branch.$page.tsx +54 -0
- package/src/routes/github.$owner.$repo.$branch.actions.tsx +41 -0
- package/src/routes/github.$owner.$repo.$branch.cache.tsx +42 -0
- package/src/routes/github.$owner.$repo.$branch.collaborators.tsx +58 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name.tsx +96 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name_.edit.$.tsx +13 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name_.entry.$.tsx +95 -0
- package/src/routes/github.$owner.$repo.$branch.collection.$name_.new.tsx +125 -0
- package/src/routes/github.$owner.$repo.$branch.configuration.tsx +49 -0
- package/src/routes/github.$owner.$repo.$branch.file.$name.tsx +81 -0
- package/src/routes/github.$owner.$repo.$branch.index.tsx +57 -0
- package/src/routes/github.$owner.$repo.$branch.media.$name.tsx +104 -0
- package/src/routes/github.$owner.$repo.$branch.tsx +203 -0
- package/src/routes/github.$owner.$repo.index.tsx +104 -0
- package/src/routes/index.tsx +65 -0
- package/src/routes/onboarding.tsx +51 -0
- package/src/routes/settings.tsx +39 -0
- package/src/routes/sign-in.tsx +71 -0
- package/src/server/access/policy.ts +316 -0
- package/src/server/access/repository-identity-policy.ts +120 -0
- package/src/server/access/repository-identity.ts +361 -0
- package/src/server/access/repository-policy.ts +85 -0
- package/src/server/access/repository.ts +759 -0
- package/src/server/account/account.ts +62 -0
- package/src/server/account/deletion.ts +74 -0
- package/src/server/account/preferences.ts +50 -0
- package/src/server/actions/actions.ts +767 -0
- package/src/server/activity/capture.ts +228 -0
- package/src/server/activity/details.ts +154 -0
- package/src/server/activity/store.ts +174 -0
- package/src/server/activity/webhook.ts +159 -0
- package/src/server/admin/access.ts +9 -0
- package/src/server/admin/admin.ts +159 -0
- package/src/server/admin/sign-in-allowlist.ts +60 -0
- package/src/server/auth/index.ts +284 -0
- package/src/server/auth/oauth-account.ts +131 -0
- package/src/server/auth/oauth-token-adapter.ts +48 -0
- package/src/server/auth/oauth-token-crypto.ts +56 -0
- package/src/server/auth/rate-limit.ts +56 -0
- package/src/server/auth/secret-crypto.ts +57 -0
- package/src/server/auth/sign-in-allowlist.ts +33 -0
- package/src/server/cache/configuration-access.ts +23 -0
- package/src/server/cache/configuration-read.ts +30 -0
- package/src/server/cache/configuration.ts +483 -0
- package/src/server/cache/directory-store.ts +314 -0
- package/src/server/cache/directory.ts +735 -0
- package/src/server/cache/policy.ts +69 -0
- package/src/server/cache/repository-read.ts +119 -0
- package/src/server/cache/repository.ts +345 -0
- package/src/server/collaborators/api.ts +39 -0
- package/src/server/collaborators/branches.ts +72 -0
- package/src/server/collaborators/collaborators.ts +600 -0
- package/src/server/collaborators/membership-match.ts +10 -0
- package/src/server/collaborators/shared-projects.ts +51 -0
- package/src/server/content/collection.ts +301 -0
- package/src/server/content/conflict.ts +11 -0
- package/src/server/content/entry-editor.ts +1487 -0
- package/src/server/content/localized-directory.ts +104 -0
- package/src/server/content/reference.ts +347 -0
- package/src/server/content/write-response.ts +32 -0
- package/src/server/context-cloudflare.ts +91 -0
- package/src/server/context-node.ts +80 -0
- package/src/server/context.ts +262 -0
- package/src/server/csrf.ts +27 -0
- package/src/server/db/client.ts +56 -0
- package/src/server/db/core.ts +69 -0
- package/src/server/db/schema.ts +447 -0
- package/src/server/db/sql.ts +49 -0
- package/src/server/email/email.ts +19 -0
- package/src/server/email/templates.ts +233 -0
- package/src/server/email/translations.ts +144 -0
- package/src/server/github/account.ts +72 -0
- package/src/server/github/api.ts +1375 -0
- package/src/server/github/app-install.ts +15 -0
- package/src/server/github/app.ts +228 -0
- package/src/server/github/installation-token-cache.ts +23 -0
- package/src/server/github/large-collection.ts +48 -0
- package/src/server/github/webhook-response.ts +81 -0
- package/src/server/github/webhook.ts +1013 -0
- package/src/server/http.ts +56 -0
- package/src/server/index.ts +57 -0
- package/src/server/media/media.ts +884 -0
- package/src/server/media/preview.ts +145 -0
- package/src/server/media/provider.ts +722 -0
- package/src/server/repository/activity.ts +20 -0
- package/src/server/repository/branches.ts +35 -0
- package/src/server/repository/provider.ts +237 -0
- package/src/server/repository/repositories.ts +340 -0
- package/src/server/request-body.ts +33 -0
- package/src/server/routes/account.ts +107 -0
- package/src/server/routes/actions.ts +65 -0
- package/src/server/routes/activity.ts +17 -0
- package/src/server/routes/admin.ts +46 -0
- package/src/server/routes/app-version.ts +51 -0
- package/src/server/routes/auth.ts +35 -0
- package/src/server/routes/cache.ts +41 -0
- package/src/server/routes/collaborators.ts +32 -0
- package/src/server/routes/configuration.ts +35 -0
- package/src/server/routes/entries.ts +103 -0
- package/src/server/routes/health.ts +78 -0
- package/src/server/routes/index.ts +154 -0
- package/src/server/routes/media.ts +95 -0
- package/src/server/routes/plugin-request.ts +110 -0
- package/src/server/routes/plugins.ts +30 -0
- package/src/server/routes/repositories.ts +68 -0
- package/src/server/routes/shared.ts +109 -0
- package/src/server/routes/webhooks.ts +11 -0
- package/src/server/runtime/runtime-ports.ts +7 -0
- package/src/server/runtime-config.ts +284 -0
- package/src/server/services/account-language.ts +21 -0
- package/src/server/services/account.ts +145 -0
- package/src/server/services/actions.ts +361 -0
- package/src/server/services/activity.ts +339 -0
- package/src/server/services/admin.ts +106 -0
- package/src/server/services/authentication-state.ts +58 -0
- package/src/server/services/cache-management.ts +165 -0
- package/src/server/services/cache.ts +100 -0
- package/src/server/services/collaborators.ts +138 -0
- package/src/server/services/configuration-editor.ts +272 -0
- package/src/server/services/configuration.ts +102 -0
- package/src/server/services/content.ts +598 -0
- package/src/server/services/context.ts +91 -0
- package/src/server/services/dashboard.ts +74 -0
- package/src/server/services/entry-translations.ts +44 -0
- package/src/server/services/errors.ts +159 -0
- package/src/server/services/index.ts +48 -0
- package/src/server/services/local-account-data.ts +91 -0
- package/src/server/services/media.ts +507 -0
- package/src/server/services/reference.ts +39 -0
- package/src/server/services/repository.ts +188 -0
- package/src/shadcn-tailwind.css +674 -0
- package/src/shared/account-preferences.ts +55 -0
- package/src/shared/application-operations.ts +40 -0
- package/src/shared/collection-presentation.ts +32 -0
- package/src/shared/configuration-compatibility.ts +192 -0
- package/src/shared/configuration-components.ts +98 -0
- package/src/shared/configuration-content.ts +120 -0
- package/src/shared/configuration-discovery.ts +111 -0
- package/src/shared/configuration-names.ts +52 -0
- package/src/shared/configuration-navigation.ts +166 -0
- package/src/shared/configuration-schema.ts +1257 -0
- package/src/shared/configuration-settings.ts +22 -0
- package/src/shared/configuration-source.ts +186 -0
- package/src/shared/configuration-yaml.ts +206 -0
- package/src/shared/configuration.ts +296 -0
- package/src/shared/content-conflict.ts +6 -0
- package/src/shared/content-serialization.ts +252 -0
- package/src/shared/field-validation-error.ts +32 -0
- package/src/shared/git-path.ts +68 -0
- package/src/shared/json.ts +30 -0
- package/src/shared/media-error.ts +23 -0
- package/src/shared/repository-search.ts +43 -0
- package/src/shared/repository-templates.ts +22 -0
- package/src/shared/requests/account.ts +37 -0
- package/src/shared/requests/action.ts +169 -0
- package/src/shared/requests/activity.ts +31 -0
- package/src/shared/requests/admin.ts +98 -0
- package/src/shared/requests/branch.ts +25 -0
- package/src/shared/requests/cache.ts +62 -0
- package/src/shared/requests/collaborator.ts +49 -0
- package/src/shared/requests/collection.ts +32 -0
- package/src/shared/requests/configuration.ts +41 -0
- package/src/shared/requests/entry-write.ts +221 -0
- package/src/shared/requests/entry.ts +35 -0
- package/src/shared/requests/fixed-file.ts +29 -0
- package/src/shared/requests/local-account.ts +5 -0
- package/src/shared/requests/media.ts +215 -0
- package/src/shared/requests/reference.ts +51 -0
- package/src/shared/requests/repository-template.ts +32 -0
- package/src/shared/requests/repository.ts +28 -0
- package/src/shared/requests/ui-language.ts +15 -0
- package/src/shared/sign-in-allowlist.ts +77 -0
- package/src/shared/yaml-aliases.ts +25 -0
- package/src/styles.css +453 -0
|
@@ -0,0 +1,1236 @@
|
|
|
1
|
+
import { useUploadConflictDialog } from '#/features/media/upload-conflict-dialog'
|
|
2
|
+
import {
|
|
3
|
+
useLingui as useUiMessages,
|
|
4
|
+
Trans as UiTrans,
|
|
5
|
+
} from '@lingui/react/macro'
|
|
6
|
+
|
|
7
|
+
import { LoadError } from '#/components/operation-error'
|
|
8
|
+
import { accessDenialFrom, userFacingError } from '#/lib/access-denial'
|
|
9
|
+
import { HugeiconsIcon } from '@hugeicons/react'
|
|
10
|
+
import { Spinner } from '#/components/ui/spinner'
|
|
11
|
+
import { repositoryRequest } from '#/lib/repository-identity'
|
|
12
|
+
import { Field, FieldLabel } from '#/components/ui/field'
|
|
13
|
+
import {
|
|
14
|
+
completeMediaUpload,
|
|
15
|
+
isCopyConflict,
|
|
16
|
+
mediaParent,
|
|
17
|
+
mediaRows,
|
|
18
|
+
patchMedia,
|
|
19
|
+
refreshMedia,
|
|
20
|
+
useMediaJobs,
|
|
21
|
+
useMediaMutation,
|
|
22
|
+
} from './media-mutations'
|
|
23
|
+
import { accountIsActive } from '#/features/pending-writes/account-operation'
|
|
24
|
+
import { authenticationQueryOptions } from '#/client/queries/session'
|
|
25
|
+
import { readMediaView, saveMediaView } from './media-view'
|
|
26
|
+
import {
|
|
27
|
+
startTransition,
|
|
28
|
+
useCallback,
|
|
29
|
+
useEffect,
|
|
30
|
+
useId,
|
|
31
|
+
useMemo,
|
|
32
|
+
useRef,
|
|
33
|
+
useState,
|
|
34
|
+
} from 'react'
|
|
35
|
+
import { DndContext, PointerSensor, useSensor, useSensors } from '@dnd-kit/core'
|
|
36
|
+
import {
|
|
37
|
+
keepPreviousData,
|
|
38
|
+
useQuery,
|
|
39
|
+
useQueryClient,
|
|
40
|
+
} from '@tanstack/react-query'
|
|
41
|
+
import ArrowUp from '@hugeicons/core-free-icons/ArrowUp02Icon'
|
|
42
|
+
import FolderPlus from '@hugeicons/core-free-icons/FolderPlusIcon'
|
|
43
|
+
import Grid2X2 from '@hugeicons/core-free-icons/Grid2x2Icon'
|
|
44
|
+
import List from '@hugeicons/core-free-icons/ListIcon'
|
|
45
|
+
import { SearchInput } from '#/components/search-input'
|
|
46
|
+
import Upload from '@hugeicons/core-free-icons/Upload01Icon'
|
|
47
|
+
|
|
48
|
+
import { RepositoryActionButtons } from '#/components/repository-action-buttons'
|
|
49
|
+
import { RepositoryPageHeader } from '#/components/repository-page-header'
|
|
50
|
+
import {
|
|
51
|
+
AlertDialog,
|
|
52
|
+
AlertDialogAction,
|
|
53
|
+
AlertDialogCancel,
|
|
54
|
+
AlertDialogContent,
|
|
55
|
+
AlertDialogDescription,
|
|
56
|
+
AlertDialogFooter,
|
|
57
|
+
AlertDialogHeader,
|
|
58
|
+
AlertDialogTitle,
|
|
59
|
+
} from '#/components/ui/alert-dialog'
|
|
60
|
+
import { Button } from '#/components/ui/button'
|
|
61
|
+
import {
|
|
62
|
+
Dialog,
|
|
63
|
+
DialogContent,
|
|
64
|
+
DialogDescription,
|
|
65
|
+
DialogFooter,
|
|
66
|
+
DialogHeader,
|
|
67
|
+
DialogTitle,
|
|
68
|
+
} from '#/components/ui/dialog'
|
|
69
|
+
import {
|
|
70
|
+
Empty,
|
|
71
|
+
EmptyContent,
|
|
72
|
+
EmptyDescription,
|
|
73
|
+
EmptyHeader,
|
|
74
|
+
EmptyTitle,
|
|
75
|
+
} from '#/components/ui/empty'
|
|
76
|
+
import { Input } from '#/components/ui/input'
|
|
77
|
+
import { ScrollArea } from '#/components/ui/scroll-area'
|
|
78
|
+
import { Skeleton } from '#/components/ui/skeleton'
|
|
79
|
+
import { ToggleGroup, ToggleGroupItem } from '#/components/ui/toggle-group'
|
|
80
|
+
import {
|
|
81
|
+
Table,
|
|
82
|
+
TableBody,
|
|
83
|
+
TableErrorRow,
|
|
84
|
+
TableCell,
|
|
85
|
+
TableHead,
|
|
86
|
+
TableHeader,
|
|
87
|
+
TableRow,
|
|
88
|
+
} from '#/components/ui/table'
|
|
89
|
+
import {
|
|
90
|
+
createMediaFolder,
|
|
91
|
+
moveMedia,
|
|
92
|
+
removeMedia,
|
|
93
|
+
renameMedia,
|
|
94
|
+
} from '#/client/api/media'
|
|
95
|
+
import { cn } from 'cn'
|
|
96
|
+
import { mediaQueryOptions } from '#/client/queries/content'
|
|
97
|
+
import { repositoryQueryOptions } from '#/client/queries/repository'
|
|
98
|
+
import { findMediaSchema } from '#/shared/configuration-content'
|
|
99
|
+
|
|
100
|
+
import { MediaBreadcrumb } from './media-breadcrumb'
|
|
101
|
+
import { MediaBrowserSkeleton, mediaGridClassName } from './media-skeleton'
|
|
102
|
+
import { MediaMoveDialog } from './media-move-dialog'
|
|
103
|
+
import { MediaDragOverlay } from './media-drag-overlay'
|
|
104
|
+
import { MediaGridEntry, MediaTableRow } from './media-entry'
|
|
105
|
+
import { mediaEntries, parentMediaPath } from './media-model'
|
|
106
|
+
import { MediaUploadError, uploadMediaFiles } from './media-upload'
|
|
107
|
+
|
|
108
|
+
import type { CollisionDetection, DragEndEvent } from '@dnd-kit/core'
|
|
109
|
+
import type { MediaEntry, MediaView } from './media-model'
|
|
110
|
+
|
|
111
|
+
export interface MediaCoordinates {
|
|
112
|
+
repoId?: string
|
|
113
|
+
source?: string
|
|
114
|
+
owner: string
|
|
115
|
+
repo: string
|
|
116
|
+
branch: string
|
|
117
|
+
name: string
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface MediaBrowserProps {
|
|
121
|
+
coordinates: MediaCoordinates
|
|
122
|
+
path?: string
|
|
123
|
+
onPathChange?: (path: string) => void
|
|
124
|
+
extensions?: string[]
|
|
125
|
+
onSelect?: (path: string) => void
|
|
126
|
+
onSelectMany?: (paths: string[]) => void
|
|
127
|
+
selectionLimit?: number
|
|
128
|
+
selected?: string[]
|
|
129
|
+
manage?: boolean
|
|
130
|
+
showBreadcrumb?: boolean
|
|
131
|
+
variant?: 'embedded' | 'page'
|
|
132
|
+
className?: string
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function confirmedMediaEntry(
|
|
136
|
+
result: { path: string; version: string | null },
|
|
137
|
+
entry?: MediaEntry,
|
|
138
|
+
file?: File,
|
|
139
|
+
): MediaEntry {
|
|
140
|
+
return {
|
|
141
|
+
id: result.path,
|
|
142
|
+
type: entry?.type ?? 'file',
|
|
143
|
+
path: result.path,
|
|
144
|
+
name: result.path.split('/').at(-1)!,
|
|
145
|
+
sha: result.version,
|
|
146
|
+
size: file?.size ?? entry?.size ?? null,
|
|
147
|
+
contentType: file?.type ?? entry?.contentType ?? null,
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const pointerSensorOptions = { activationConstraint: { distance: 8 } }
|
|
152
|
+
|
|
153
|
+
// A sticky breadcrumb can cover a folder. Only the visible target accepts the drop.
|
|
154
|
+
const mediaDropTarget: CollisionDetection = ({
|
|
155
|
+
pointerCoordinates,
|
|
156
|
+
droppableContainers,
|
|
157
|
+
}) => {
|
|
158
|
+
if (!pointerCoordinates) return []
|
|
159
|
+
const hit = document.elementFromPoint(
|
|
160
|
+
pointerCoordinates.x,
|
|
161
|
+
pointerCoordinates.y,
|
|
162
|
+
)
|
|
163
|
+
const target = droppableContainers.find(({ node }) =>
|
|
164
|
+
node.current?.contains(hit),
|
|
165
|
+
)
|
|
166
|
+
return target ? [{ id: target.id }] : []
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function MediaViewControls({
|
|
170
|
+
initialView,
|
|
171
|
+
disabled,
|
|
172
|
+
onChange,
|
|
173
|
+
}: {
|
|
174
|
+
initialView: MediaView
|
|
175
|
+
disabled: boolean
|
|
176
|
+
onChange: (view: MediaView) => void
|
|
177
|
+
}) {
|
|
178
|
+
const { t: _t } = useUiMessages()
|
|
179
|
+
const [selectedView, setSelectedView] = useState(initialView)
|
|
180
|
+
const itemClassName =
|
|
181
|
+
'text-muted-foreground hover:text-foreground data-[state=off]:hover:bg-transparent data-[state=on]:text-foreground'
|
|
182
|
+
return (
|
|
183
|
+
<ToggleGroup
|
|
184
|
+
aria-label={_t({ message: 'Media view' })}
|
|
185
|
+
spacing={0}
|
|
186
|
+
type="single"
|
|
187
|
+
value={selectedView}
|
|
188
|
+
variant="outline"
|
|
189
|
+
onValueChange={(value) => {
|
|
190
|
+
if (value !== 'grid' && value !== 'list') return
|
|
191
|
+
setSelectedView(value)
|
|
192
|
+
startTransition(() => onChange(value))
|
|
193
|
+
try {
|
|
194
|
+
saveMediaView(value)
|
|
195
|
+
} catch {
|
|
196
|
+
// Keep the selected view for this session when storage is unavailable.
|
|
197
|
+
}
|
|
198
|
+
}}
|
|
199
|
+
>
|
|
200
|
+
<ToggleGroupItem
|
|
201
|
+
aria-label={_t({ message: 'Grid view' })}
|
|
202
|
+
className={itemClassName}
|
|
203
|
+
disabled={disabled}
|
|
204
|
+
value="grid"
|
|
205
|
+
>
|
|
206
|
+
<HugeiconsIcon aria-hidden="true" icon={Grid2X2} />
|
|
207
|
+
</ToggleGroupItem>
|
|
208
|
+
<ToggleGroupItem
|
|
209
|
+
aria-label={_t({ message: 'List view' })}
|
|
210
|
+
className={itemClassName}
|
|
211
|
+
disabled={disabled}
|
|
212
|
+
value="list"
|
|
213
|
+
>
|
|
214
|
+
<HugeiconsIcon aria-hidden="true" icon={List} />
|
|
215
|
+
</ToggleGroupItem>
|
|
216
|
+
</ToggleGroup>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function MediaBrowser({
|
|
221
|
+
coordinates,
|
|
222
|
+
path,
|
|
223
|
+
onPathChange,
|
|
224
|
+
extensions,
|
|
225
|
+
onSelect,
|
|
226
|
+
onSelectMany,
|
|
227
|
+
selected = [],
|
|
228
|
+
selectionLimit = 1,
|
|
229
|
+
manage = true,
|
|
230
|
+
showBreadcrumb = true,
|
|
231
|
+
variant = 'embedded',
|
|
232
|
+
className,
|
|
233
|
+
}: MediaBrowserProps) {
|
|
234
|
+
const { t: _t, i18n: mediaI18n } = useUiMessages()
|
|
235
|
+
|
|
236
|
+
const conflict = useUploadConflictDialog()
|
|
237
|
+
const fieldPrefix = useId()
|
|
238
|
+
const queryClient = useQueryClient()
|
|
239
|
+
const resultsRef = useRef<HTMLDivElement>(null)
|
|
240
|
+
const dialogFilePath = useRef<string | null>(null)
|
|
241
|
+
const [localPath, setLocalPath] = useState(path)
|
|
242
|
+
const currentPath = path ?? localPath
|
|
243
|
+
const query = useQuery({
|
|
244
|
+
...mediaQueryOptions({ ...coordinates, path: currentPath }),
|
|
245
|
+
placeholderData: keepPreviousData,
|
|
246
|
+
})
|
|
247
|
+
const [search, setSearch] = useState('')
|
|
248
|
+
const [view, setView] = useState<MediaView>(readMediaView)
|
|
249
|
+
const [pagination, setPagination] = useState({ scope: '', page: 0 })
|
|
250
|
+
const operations = useMediaJobs(coordinates)
|
|
251
|
+
const uploadMutation = useMediaMutation<string[]>()
|
|
252
|
+
const folderMutation =
|
|
253
|
+
useMediaMutation<Awaited<ReturnType<typeof createMediaFolder>>>()
|
|
254
|
+
const renameMutation =
|
|
255
|
+
useMediaMutation<Awaited<ReturnType<typeof renameMedia>>>()
|
|
256
|
+
const removalMutation =
|
|
257
|
+
useMediaMutation<Awaited<ReturnType<typeof removeMedia>>>()
|
|
258
|
+
const moveMutation = useMediaMutation<Awaited<ReturnType<typeof moveMedia>>>()
|
|
259
|
+
const mounted = useRef(false)
|
|
260
|
+
const currentView = useRef('')
|
|
261
|
+
useEffect(() => {
|
|
262
|
+
mounted.current = true
|
|
263
|
+
return () => {
|
|
264
|
+
mounted.current = false
|
|
265
|
+
}
|
|
266
|
+
}, [])
|
|
267
|
+
const [folderOpen, setFolderOpen] = useState(false)
|
|
268
|
+
const [folderName, setFolderName] = useState('')
|
|
269
|
+
const [renameEntry, setRenameEntry] = useState<MediaEntry | null>(null)
|
|
270
|
+
const [renameValue, setRenameValue] = useState('')
|
|
271
|
+
const [deleteEntry, setDeleteEntry] = useState<MediaEntry | null>(null)
|
|
272
|
+
const [draggingFiles, setDraggingFiles] = useState(false)
|
|
273
|
+
const fileDragDepth = useRef(0)
|
|
274
|
+
const [moveEntry, setMoveEntry] = useState<MediaEntry | null>(null)
|
|
275
|
+
const uploadInputRef = useRef<HTMLInputElement>(null)
|
|
276
|
+
const sensors = useSensors(useSensor(PointerSensor, pointerSensorOptions))
|
|
277
|
+
const data = query.data
|
|
278
|
+
const folderPending = query.isPending || query.isPlaceholderData
|
|
279
|
+
const manifestUnavailable = query.isError && !data
|
|
280
|
+
const repository = queryClient.getQueryData(
|
|
281
|
+
repositoryQueryOptions(coordinates).queryKey,
|
|
282
|
+
)
|
|
283
|
+
const configuredMedia = repository?.configuration?.object
|
|
284
|
+
? findMediaSchema(repository.configuration.object, coordinates.name)
|
|
285
|
+
: undefined
|
|
286
|
+
const configuredLabel =
|
|
287
|
+
typeof configuredMedia?.label === 'string' && configuredMedia.label
|
|
288
|
+
? configuredMedia.label
|
|
289
|
+
: undefined
|
|
290
|
+
const rootPath =
|
|
291
|
+
data?.media.rootPath ?? configuredMedia?.input ?? currentPath ?? ''
|
|
292
|
+
const mediaDenial = accessDenialFrom(query.error)
|
|
293
|
+
const directoryPath = query.isPlaceholderData
|
|
294
|
+
? (currentPath ?? rootPath)
|
|
295
|
+
: (data?.media.path ?? currentPath ?? rootPath)
|
|
296
|
+
const libraryLabel =
|
|
297
|
+
data?.media.defaultLabel ||
|
|
298
|
+
(!data && !configuredLabel && coordinates.name === 'default')
|
|
299
|
+
? _t({ message: 'Media' })
|
|
300
|
+
: (data?.media.label ?? configuredLabel ?? coordinates.name)
|
|
301
|
+
const folder =
|
|
302
|
+
directoryPath === rootPath
|
|
303
|
+
? libraryLabel
|
|
304
|
+
: directoryPath.split('/').at(-1) || libraryLabel
|
|
305
|
+
currentView.current = JSON.stringify([
|
|
306
|
+
coordinates.owner.toLowerCase(),
|
|
307
|
+
coordinates.repo.toLowerCase(),
|
|
308
|
+
coordinates.branch,
|
|
309
|
+
coordinates.name,
|
|
310
|
+
directoryPath,
|
|
311
|
+
])
|
|
312
|
+
const pendingJobs = useMemo(
|
|
313
|
+
() =>
|
|
314
|
+
operations.jobs
|
|
315
|
+
.filter((item) => item.status === 'pending')
|
|
316
|
+
.flatMap((item) => (item.job ? [item.job] : [])),
|
|
317
|
+
[operations.jobs],
|
|
318
|
+
)
|
|
319
|
+
const uploading = pendingJobs.some(
|
|
320
|
+
(job) => job.kind === 'upload' && job.directory === directoryPath,
|
|
321
|
+
)
|
|
322
|
+
const pending = useMemo(() => {
|
|
323
|
+
const result = new Map<string, string>()
|
|
324
|
+
for (const job of pendingJobs) {
|
|
325
|
+
if (job.kind === 'folder')
|
|
326
|
+
result.set(`__pending__/${job.id}`, _t({ message: 'Creating…' }))
|
|
327
|
+
if (job.kind === 'upload')
|
|
328
|
+
job.files?.forEach((_file, index) => {
|
|
329
|
+
if (!operations.completed[job.id]?.includes(index))
|
|
330
|
+
result.set(
|
|
331
|
+
`__pending__/${job.id}/${index}`,
|
|
332
|
+
_t({ message: 'Uploading…' }),
|
|
333
|
+
)
|
|
334
|
+
})
|
|
335
|
+
if (job.entry)
|
|
336
|
+
result.set(
|
|
337
|
+
job.entry.path,
|
|
338
|
+
job.kind === 'rename'
|
|
339
|
+
? _t({ message: 'Renaming…' })
|
|
340
|
+
: _t({ message: 'Moving…' }),
|
|
341
|
+
)
|
|
342
|
+
}
|
|
343
|
+
return result
|
|
344
|
+
}, [pendingJobs, operations.completed, mediaI18n])
|
|
345
|
+
const entries = useMemo(
|
|
346
|
+
() =>
|
|
347
|
+
folderPending
|
|
348
|
+
? []
|
|
349
|
+
: mediaRows(
|
|
350
|
+
data?.entries ?? [],
|
|
351
|
+
pendingJobs,
|
|
352
|
+
directoryPath,
|
|
353
|
+
operations.completed,
|
|
354
|
+
),
|
|
355
|
+
[
|
|
356
|
+
folderPending,
|
|
357
|
+
data?.entries,
|
|
358
|
+
pendingJobs,
|
|
359
|
+
directoryPath,
|
|
360
|
+
operations.completed,
|
|
361
|
+
],
|
|
362
|
+
)
|
|
363
|
+
const visible = useMemo(
|
|
364
|
+
() => mediaEntries(entries, { search, extensions }),
|
|
365
|
+
[entries, extensions, search],
|
|
366
|
+
)
|
|
367
|
+
const pageScope = JSON.stringify([directoryPath, search, extensions, view])
|
|
368
|
+
const pageCount = Math.max(1, Math.ceil(visible.length / 100))
|
|
369
|
+
const page = Math.min(
|
|
370
|
+
pagination.scope === pageScope ? pagination.page : 0,
|
|
371
|
+
pageCount - 1,
|
|
372
|
+
)
|
|
373
|
+
const first = page * 100 + 1
|
|
374
|
+
const last = Math.min((page + 1) * 100, visible.length)
|
|
375
|
+
const total = visible.length
|
|
376
|
+
const pageEntries = visible.slice(page * 100, (page + 1) * 100)
|
|
377
|
+
const changePage = (next: number) => {
|
|
378
|
+
setPagination({ scope: pageScope, page: next })
|
|
379
|
+
resultsRef.current?.scrollIntoView({ block: 'start' })
|
|
380
|
+
}
|
|
381
|
+
const selectedPaths = new Set(selected)
|
|
382
|
+
const selecting = Boolean(onSelect || onSelectMany)
|
|
383
|
+
const canCreateDirectory =
|
|
384
|
+
manage && Boolean(data?.media.capabilities.createDirectory)
|
|
385
|
+
const canUpload = manage && Boolean(data?.media.capabilities.upload)
|
|
386
|
+
const acceptsFileDrop = canUpload && !uploading && !folderPending
|
|
387
|
+
const canMove =
|
|
388
|
+
manage && Boolean(data?.media.capabilities.move) && !folderPending
|
|
389
|
+
const canRename = manage && Boolean(data?.media.capabilities.rename)
|
|
390
|
+
const canDelete = manage && Boolean(data?.media.capabilities.remove)
|
|
391
|
+
const creatingFolder = pendingJobs.some(
|
|
392
|
+
(job) => job.directory === directoryPath && job.kind === 'folder',
|
|
393
|
+
)
|
|
394
|
+
const renaming = pendingJobs.some(
|
|
395
|
+
(job) => job.entry?.path === renameEntry?.path && job.kind === 'rename',
|
|
396
|
+
)
|
|
397
|
+
const deleting = pendingJobs.some(
|
|
398
|
+
(job) => job.entry?.path === deleteEntry?.path && job.kind === 'delete',
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
const navigate = useCallback(
|
|
402
|
+
(next: string) => {
|
|
403
|
+
setSearch('')
|
|
404
|
+
setFolderOpen(false)
|
|
405
|
+
setRenameEntry(null)
|
|
406
|
+
setDeleteEntry(null)
|
|
407
|
+
setMoveEntry(null)
|
|
408
|
+
if (onPathChange) onPathChange(next)
|
|
409
|
+
else setLocalPath(next)
|
|
410
|
+
},
|
|
411
|
+
[onPathChange],
|
|
412
|
+
)
|
|
413
|
+
|
|
414
|
+
const openRename = useCallback((entry: MediaEntry) => {
|
|
415
|
+
dialogFilePath.current = entry.path
|
|
416
|
+
setRenameEntry(entry)
|
|
417
|
+
setRenameValue(entry.name)
|
|
418
|
+
}, [])
|
|
419
|
+
|
|
420
|
+
const openMove = useCallback((entry: MediaEntry) => {
|
|
421
|
+
dialogFilePath.current = entry.path
|
|
422
|
+
setMoveEntry(entry)
|
|
423
|
+
}, [])
|
|
424
|
+
|
|
425
|
+
const openDelete = useCallback((entry: MediaEntry) => {
|
|
426
|
+
dialogFilePath.current = entry.path
|
|
427
|
+
setDeleteEntry(entry)
|
|
428
|
+
}, [])
|
|
429
|
+
|
|
430
|
+
function restoreFileFocus(event: Event) {
|
|
431
|
+
const filePath = dialogFilePath.current
|
|
432
|
+
const results = resultsRef.current
|
|
433
|
+
if (!filePath || !results) return
|
|
434
|
+
dialogFilePath.current = null
|
|
435
|
+
event.preventDefault()
|
|
436
|
+
const trigger = results.querySelector<HTMLButtonElement>(
|
|
437
|
+
`[data-media-path="${CSS.escape(filePath)}"] button[aria-haspopup="menu"]`,
|
|
438
|
+
)
|
|
439
|
+
const target = trigger ?? results
|
|
440
|
+
target.focus({ preventScroll: true })
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function sameView(origin: string) {
|
|
444
|
+
return mounted.current && currentView.current === origin
|
|
445
|
+
}
|
|
446
|
+
async function upload(files: FileList | File[]) {
|
|
447
|
+
const values = Array.from(files).slice(
|
|
448
|
+
0,
|
|
449
|
+
selecting && Number.isFinite(selectionLimit) ? selectionLimit : undefined,
|
|
450
|
+
)
|
|
451
|
+
if (!canUpload || uploading || !values.length) return
|
|
452
|
+
const origin = currentView.current
|
|
453
|
+
const account = queryClient.getQueryData(
|
|
454
|
+
authenticationQueryOptions().queryKey,
|
|
455
|
+
)?.user?.id
|
|
456
|
+
if (!account) return
|
|
457
|
+
const active = accountIsActive(queryClient, account)
|
|
458
|
+
const id = crypto.randomUUID()
|
|
459
|
+
try {
|
|
460
|
+
await uploadMutation.run({
|
|
461
|
+
id,
|
|
462
|
+
coordinates,
|
|
463
|
+
kind: 'upload',
|
|
464
|
+
directory: directoryPath,
|
|
465
|
+
paths: [
|
|
466
|
+
directoryPath,
|
|
467
|
+
...values.map((file) => `${directoryPath}/${file.name}`),
|
|
468
|
+
],
|
|
469
|
+
files: values,
|
|
470
|
+
run: () =>
|
|
471
|
+
uploadMediaFiles({
|
|
472
|
+
resolveConflict: conflict.resolveConflict,
|
|
473
|
+
directory: !folderPending ? data : undefined,
|
|
474
|
+
notificationId: id,
|
|
475
|
+
coordinates: repositoryRequest(coordinates),
|
|
476
|
+
extensions,
|
|
477
|
+
isActive: active,
|
|
478
|
+
files: values,
|
|
479
|
+
path: directoryPath,
|
|
480
|
+
onFailed: (_file, index) =>
|
|
481
|
+
completeMediaUpload(queryClient, account, id, index),
|
|
482
|
+
onSkipped: (index) =>
|
|
483
|
+
completeMediaUpload(queryClient, account, id, index),
|
|
484
|
+
onUploaded: (result, file, index) => {
|
|
485
|
+
if (!active()) return
|
|
486
|
+
patchMedia(
|
|
487
|
+
queryClient,
|
|
488
|
+
coordinates,
|
|
489
|
+
[],
|
|
490
|
+
confirmedMediaEntry(result, undefined, file),
|
|
491
|
+
)
|
|
492
|
+
completeMediaUpload(queryClient, account, id, index)
|
|
493
|
+
},
|
|
494
|
+
}),
|
|
495
|
+
confirmed: (paths, isActive) => {
|
|
496
|
+
if (!isActive()) return
|
|
497
|
+
refreshMedia(queryClient, coordinates, [directoryPath])
|
|
498
|
+
if (paths.length && sameView(origin)) {
|
|
499
|
+
if (onSelectMany) onSelectMany(paths)
|
|
500
|
+
else if (onSelect) paths.forEach(onSelect)
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
})
|
|
504
|
+
} catch (cause) {
|
|
505
|
+
if (sameView(origin) && active()) {
|
|
506
|
+
if (cause instanceof MediaUploadError && cause.paths.length) {
|
|
507
|
+
if (onSelectMany) onSelectMany(cause.paths)
|
|
508
|
+
else if (onSelect) cause.paths.forEach(onSelect)
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
if (active()) refreshMedia(queryClient, coordinates, [directoryPath])
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
async function createFolder() {
|
|
515
|
+
const filename = folderName.trim()
|
|
516
|
+
if (!canCreateDirectory || !filename || creatingFolder) return
|
|
517
|
+
const origin = currentView.current
|
|
518
|
+
try {
|
|
519
|
+
await folderMutation.run({
|
|
520
|
+
id: crypto.randomUUID(),
|
|
521
|
+
coordinates,
|
|
522
|
+
kind: 'folder',
|
|
523
|
+
directory: directoryPath,
|
|
524
|
+
filename,
|
|
525
|
+
destination: `${directoryPath}/${filename}`,
|
|
526
|
+
paths: [`${directoryPath}/${filename}`],
|
|
527
|
+
run: () =>
|
|
528
|
+
createMediaFolder({
|
|
529
|
+
...repositoryRequest(coordinates),
|
|
530
|
+
path: directoryPath,
|
|
531
|
+
folder: filename,
|
|
532
|
+
}),
|
|
533
|
+
confirmed: (result, active) => {
|
|
534
|
+
if (!active()) return
|
|
535
|
+
patchMedia(queryClient, coordinates, [], {
|
|
536
|
+
...confirmedMediaEntry(result),
|
|
537
|
+
type: 'dir',
|
|
538
|
+
})
|
|
539
|
+
refreshMedia(queryClient, coordinates, [directoryPath])
|
|
540
|
+
if (sameView(origin)) {
|
|
541
|
+
setFolderName('')
|
|
542
|
+
setFolderOpen(false)
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
})
|
|
546
|
+
} catch (cause) {
|
|
547
|
+
// The media action boundary reports this failure.
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
async function rename() {
|
|
551
|
+
const entry = renameEntry
|
|
552
|
+
const filename = renameValue.trim()
|
|
553
|
+
if (!canRename || !entry?.sha || !filename || renaming) return
|
|
554
|
+
const origin = currentView.current
|
|
555
|
+
const destination = [mediaParent(entry.path), filename]
|
|
556
|
+
.filter(Boolean)
|
|
557
|
+
.join('/')
|
|
558
|
+
try {
|
|
559
|
+
await renameMutation.run({
|
|
560
|
+
id: crypto.randomUUID(),
|
|
561
|
+
coordinates,
|
|
562
|
+
kind: 'rename',
|
|
563
|
+
directory: directoryPath,
|
|
564
|
+
entry,
|
|
565
|
+
filename,
|
|
566
|
+
destination,
|
|
567
|
+
paths: [entry.path, destination],
|
|
568
|
+
run: () =>
|
|
569
|
+
renameMedia({
|
|
570
|
+
...repositoryRequest(coordinates),
|
|
571
|
+
path: entry.path,
|
|
572
|
+
sha: entry.sha!,
|
|
573
|
+
filename,
|
|
574
|
+
}),
|
|
575
|
+
confirmed: (result, active) => {
|
|
576
|
+
if (!active()) return
|
|
577
|
+
patchMedia(
|
|
578
|
+
queryClient,
|
|
579
|
+
coordinates,
|
|
580
|
+
[entry.path],
|
|
581
|
+
confirmedMediaEntry(result, entry),
|
|
582
|
+
)
|
|
583
|
+
refreshMedia(queryClient, coordinates, [directoryPath])
|
|
584
|
+
if (sameView(origin) && dialogFilePath.current === entry.path) {
|
|
585
|
+
dialogFilePath.current = result.path
|
|
586
|
+
setRenameEntry(null)
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
})
|
|
590
|
+
} catch (cause) {
|
|
591
|
+
if (
|
|
592
|
+
isCopyConflict(cause, { kind: 'rename', destination }) &&
|
|
593
|
+
sameView(origin)
|
|
594
|
+
)
|
|
595
|
+
setRenameEntry((current) => (current === entry ? null : current))
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
async function remove() {
|
|
599
|
+
const entry = deleteEntry
|
|
600
|
+
if (!canDelete || !entry?.sha || deleting) return
|
|
601
|
+
const origin = currentView.current
|
|
602
|
+
try {
|
|
603
|
+
await removalMutation.run({
|
|
604
|
+
id: crypto.randomUUID(),
|
|
605
|
+
coordinates,
|
|
606
|
+
kind: 'delete',
|
|
607
|
+
directory: directoryPath,
|
|
608
|
+
entry,
|
|
609
|
+
paths: [entry.path],
|
|
610
|
+
run: () =>
|
|
611
|
+
removeMedia({
|
|
612
|
+
...repositoryRequest(coordinates),
|
|
613
|
+
path: entry.path,
|
|
614
|
+
sha: entry.sha!,
|
|
615
|
+
}),
|
|
616
|
+
confirmed: (_result, active) => {
|
|
617
|
+
if (!active()) return
|
|
618
|
+
patchMedia(queryClient, coordinates, [entry.path])
|
|
619
|
+
refreshMedia(queryClient, coordinates, [directoryPath])
|
|
620
|
+
if (sameView(origin)) setDeleteEntry(null)
|
|
621
|
+
},
|
|
622
|
+
})
|
|
623
|
+
} catch (cause) {
|
|
624
|
+
// The media action boundary reports this failure.
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
async function move(entry: MediaEntry, destination: string) {
|
|
628
|
+
const sourceDirectory = mediaParent(entry.path)
|
|
629
|
+
if (
|
|
630
|
+
!canMove ||
|
|
631
|
+
!entry.sha ||
|
|
632
|
+
entry.type !== 'file' ||
|
|
633
|
+
destination === sourceDirectory ||
|
|
634
|
+
pending.has(entry.path) ||
|
|
635
|
+
pending.has(destination)
|
|
636
|
+
)
|
|
637
|
+
return
|
|
638
|
+
const newPath = [destination, entry.name].filter(Boolean).join('/')
|
|
639
|
+
const origin = currentView.current
|
|
640
|
+
try {
|
|
641
|
+
await moveMutation.run({
|
|
642
|
+
id: crypto.randomUUID(),
|
|
643
|
+
coordinates,
|
|
644
|
+
kind: 'move',
|
|
645
|
+
directory: sourceDirectory,
|
|
646
|
+
entry,
|
|
647
|
+
destination: newPath,
|
|
648
|
+
paths: [entry.path, newPath],
|
|
649
|
+
run: () =>
|
|
650
|
+
moveMedia({
|
|
651
|
+
...repositoryRequest(coordinates),
|
|
652
|
+
path: entry.path,
|
|
653
|
+
sha: entry.sha!,
|
|
654
|
+
destination,
|
|
655
|
+
}),
|
|
656
|
+
confirmed: (result, active) => {
|
|
657
|
+
if (!active()) return
|
|
658
|
+
patchMedia(
|
|
659
|
+
queryClient,
|
|
660
|
+
coordinates,
|
|
661
|
+
[entry.path],
|
|
662
|
+
confirmedMediaEntry(result, entry),
|
|
663
|
+
)
|
|
664
|
+
refreshMedia(queryClient, coordinates, [sourceDirectory, destination])
|
|
665
|
+
if (sameView(origin))
|
|
666
|
+
setMoveEntry((current) => (current === entry ? null : current))
|
|
667
|
+
},
|
|
668
|
+
})
|
|
669
|
+
} catch (cause) {
|
|
670
|
+
if (
|
|
671
|
+
isCopyConflict(cause, { kind: 'move', destination: newPath }) &&
|
|
672
|
+
sameView(origin)
|
|
673
|
+
)
|
|
674
|
+
setMoveEntry((current) => (current === entry ? null : current))
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function dropFile({ active, over }: DragEndEvent) {
|
|
679
|
+
const entry = active.data.current?.entry as MediaEntry | undefined
|
|
680
|
+
const destination = over?.data.current?.destination
|
|
681
|
+
if (entry && typeof destination === 'string') void move(entry, destination)
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function entryProps(entry: MediaEntry) {
|
|
685
|
+
return {
|
|
686
|
+
coordinates,
|
|
687
|
+
provider: data?.media.provider,
|
|
688
|
+
entry,
|
|
689
|
+
pending: pending.get(entry.path),
|
|
690
|
+
selected: selectedPaths.has(entry.path),
|
|
691
|
+
canMove,
|
|
692
|
+
canRename,
|
|
693
|
+
canDelete,
|
|
694
|
+
onNavigate: navigate,
|
|
695
|
+
onSelect,
|
|
696
|
+
onRename: openRename,
|
|
697
|
+
onMove: openMove,
|
|
698
|
+
onDelete: openDelete,
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
const searchControl = (
|
|
703
|
+
<SearchInput
|
|
704
|
+
aria-label={_t({ message: 'Search media…' })}
|
|
705
|
+
disabled={folderPending}
|
|
706
|
+
placeholder={_t({ message: 'Search media…' })}
|
|
707
|
+
value={search}
|
|
708
|
+
onChange={(event) => setSearch(event.target.value)}
|
|
709
|
+
/>
|
|
710
|
+
)
|
|
711
|
+
const viewControls = (
|
|
712
|
+
<MediaViewControls
|
|
713
|
+
initialView={view}
|
|
714
|
+
disabled={folderPending}
|
|
715
|
+
onChange={setView}
|
|
716
|
+
/>
|
|
717
|
+
)
|
|
718
|
+
const showPendingManageControls = manage && !data
|
|
719
|
+
const manageControls =
|
|
720
|
+
canCreateDirectory || canUpload || showPendingManageControls ? (
|
|
721
|
+
<>
|
|
722
|
+
{canCreateDirectory || showPendingManageControls ? (
|
|
723
|
+
<Button
|
|
724
|
+
aria-label={_t({ message: 'New folder' })}
|
|
725
|
+
disabled={folderPending || !canCreateDirectory}
|
|
726
|
+
size="icon"
|
|
727
|
+
variant="outline"
|
|
728
|
+
onClick={() => setFolderOpen(true)}
|
|
729
|
+
>
|
|
730
|
+
<HugeiconsIcon aria-hidden="true" icon={FolderPlus} />
|
|
731
|
+
</Button>
|
|
732
|
+
) : null}
|
|
733
|
+
{canUpload || showPendingManageControls ? (
|
|
734
|
+
<>
|
|
735
|
+
<Button
|
|
736
|
+
aria-label={_t({ message: 'Upload' })}
|
|
737
|
+
className="max-md:size-8 max-md:p-0 max-md:has-data-[icon=inline-start]:pl-0 max-md:has-data-[icon=inline-end]:pr-0"
|
|
738
|
+
aria-busy={uploading}
|
|
739
|
+
disabled={folderPending || !canUpload || uploading}
|
|
740
|
+
onClick={() => uploadInputRef.current?.click()}
|
|
741
|
+
>
|
|
742
|
+
<HugeiconsIcon
|
|
743
|
+
aria-hidden="true"
|
|
744
|
+
icon={Upload}
|
|
745
|
+
className={uploading ? 'max-md:hidden' : undefined}
|
|
746
|
+
data-icon="inline-start"
|
|
747
|
+
/>
|
|
748
|
+
<span className="hidden md:inline">
|
|
749
|
+
<UiTrans>Upload</UiTrans>
|
|
750
|
+
</span>
|
|
751
|
+
{uploading ? (
|
|
752
|
+
<Spinner aria-hidden="true" data-icon="inline-end" />
|
|
753
|
+
) : null}
|
|
754
|
+
</Button>
|
|
755
|
+
<input
|
|
756
|
+
multiple
|
|
757
|
+
className="sr-only"
|
|
758
|
+
disabled={folderPending || !canUpload || uploading}
|
|
759
|
+
ref={uploadInputRef}
|
|
760
|
+
type="file"
|
|
761
|
+
accept={extensions?.map((value) => `.${value}`).join(',')}
|
|
762
|
+
onChange={(event) => {
|
|
763
|
+
void upload(event.target.files ?? [])
|
|
764
|
+
event.target.value = ''
|
|
765
|
+
}}
|
|
766
|
+
/>
|
|
767
|
+
</>
|
|
768
|
+
) : null}
|
|
769
|
+
</>
|
|
770
|
+
) : null
|
|
771
|
+
const repositoryActionControls = data ? (
|
|
772
|
+
<RepositoryActionButtons
|
|
773
|
+
actions={data.media.actions}
|
|
774
|
+
disabled={folderPending}
|
|
775
|
+
context={{
|
|
776
|
+
type: 'media',
|
|
777
|
+
name: data.media.name,
|
|
778
|
+
path: data.media.path,
|
|
779
|
+
data: {
|
|
780
|
+
label: data.media.label,
|
|
781
|
+
input: data.media.rootPath,
|
|
782
|
+
output: data.media.output,
|
|
783
|
+
},
|
|
784
|
+
}}
|
|
785
|
+
coordinates={coordinates}
|
|
786
|
+
/>
|
|
787
|
+
) : null
|
|
788
|
+
const tableResults = (
|
|
789
|
+
<Table containerClassName="rounded-xl border bg-card">
|
|
790
|
+
<TableHeader>
|
|
791
|
+
<TableRow className="hover:bg-transparent">
|
|
792
|
+
<TableHead>
|
|
793
|
+
<UiTrans>Name</UiTrans>
|
|
794
|
+
</TableHead>
|
|
795
|
+
<TableHead>
|
|
796
|
+
<UiTrans>Size</UiTrans>
|
|
797
|
+
</TableHead>
|
|
798
|
+
<TableHead />
|
|
799
|
+
</TableRow>
|
|
800
|
+
</TableHeader>
|
|
801
|
+
<TableBody>
|
|
802
|
+
{!visible.length && !query.error ? (
|
|
803
|
+
<TableRow className="hover:bg-transparent">
|
|
804
|
+
<TableCell
|
|
805
|
+
colSpan={3}
|
|
806
|
+
className="text-center text-muted-foreground"
|
|
807
|
+
>
|
|
808
|
+
{search
|
|
809
|
+
? _t({ message: 'No matching media.' })
|
|
810
|
+
: _t({ message: 'No media yet.' })}
|
|
811
|
+
</TableCell>
|
|
812
|
+
</TableRow>
|
|
813
|
+
) : null}
|
|
814
|
+
{pageEntries.map((entry) => (
|
|
815
|
+
<MediaTableRow key={entry.path} {...entryProps(entry)} />
|
|
816
|
+
))}
|
|
817
|
+
{query.error ? (
|
|
818
|
+
<TableErrorRow
|
|
819
|
+
colSpan={3}
|
|
820
|
+
message={
|
|
821
|
+
data
|
|
822
|
+
? _t({
|
|
823
|
+
message:
|
|
824
|
+
'Could not refresh media. The displayed results may be out of date.',
|
|
825
|
+
})
|
|
826
|
+
: _t({ message: 'Could not load media.' })
|
|
827
|
+
}
|
|
828
|
+
onRetry={() => void query.refetch()}
|
|
829
|
+
retrying={query.isFetching}
|
|
830
|
+
/>
|
|
831
|
+
) : null}
|
|
832
|
+
</TableBody>
|
|
833
|
+
</Table>
|
|
834
|
+
)
|
|
835
|
+
const emptyResults = (
|
|
836
|
+
<Empty className="min-h-64">
|
|
837
|
+
<EmptyHeader>
|
|
838
|
+
<EmptyTitle>
|
|
839
|
+
{search
|
|
840
|
+
? _t({ message: 'No matching media' })
|
|
841
|
+
: _t({ message: 'No media yet' })}
|
|
842
|
+
</EmptyTitle>
|
|
843
|
+
<EmptyDescription>
|
|
844
|
+
{search
|
|
845
|
+
? _t({ message: 'Try a different search.' })
|
|
846
|
+
: _t({
|
|
847
|
+
message: 'Upload a file or create a folder to get started.',
|
|
848
|
+
})}
|
|
849
|
+
</EmptyDescription>
|
|
850
|
+
</EmptyHeader>
|
|
851
|
+
{search ? (
|
|
852
|
+
<EmptyContent>
|
|
853
|
+
<Button size="sm" variant="outline" onClick={() => setSearch('')}>
|
|
854
|
+
<UiTrans>Clear search</UiTrans>
|
|
855
|
+
</Button>
|
|
856
|
+
</EmptyContent>
|
|
857
|
+
) : null}
|
|
858
|
+
</Empty>
|
|
859
|
+
)
|
|
860
|
+
const gridResults = (
|
|
861
|
+
<div className={mediaGridClassName}>
|
|
862
|
+
{pageEntries.map((entry) => (
|
|
863
|
+
<MediaGridEntry key={entry.path} {...entryProps(entry)} />
|
|
864
|
+
))}
|
|
865
|
+
</div>
|
|
866
|
+
)
|
|
867
|
+
const centerEmptyGrid =
|
|
868
|
+
view === 'grid' &&
|
|
869
|
+
(manifestUnavailable ||
|
|
870
|
+
(!folderPending && Boolean(data) && !visible.length))
|
|
871
|
+
const mediaResults = (
|
|
872
|
+
<div
|
|
873
|
+
ref={resultsRef}
|
|
874
|
+
role="region"
|
|
875
|
+
aria-label={_t({ message: 'Media' })}
|
|
876
|
+
tabIndex={-1}
|
|
877
|
+
className={cn(
|
|
878
|
+
variant === 'page' && 'scroll-mt-16',
|
|
879
|
+
centerEmptyGrid && 'flex min-h-0 flex-1 flex-col',
|
|
880
|
+
)}
|
|
881
|
+
aria-busy={query.isFetching}
|
|
882
|
+
inert={query.isPlaceholderData}
|
|
883
|
+
>
|
|
884
|
+
{query.error && data && view !== 'list' ? (
|
|
885
|
+
<LoadError
|
|
886
|
+
error={query.error}
|
|
887
|
+
message={_t({ message: 'Could not refresh media.' })}
|
|
888
|
+
stale
|
|
889
|
+
onRetry={() => void query.refetch()}
|
|
890
|
+
retrying={query.isFetching}
|
|
891
|
+
/>
|
|
892
|
+
) : null}
|
|
893
|
+
{manifestUnavailable ? (
|
|
894
|
+
view === 'list' ? (
|
|
895
|
+
tableResults
|
|
896
|
+
) : (
|
|
897
|
+
<Empty role="alert" className="min-h-64">
|
|
898
|
+
<EmptyHeader>
|
|
899
|
+
<EmptyTitle>
|
|
900
|
+
<UiTrans>Could not load media</UiTrans>
|
|
901
|
+
</EmptyTitle>
|
|
902
|
+
<EmptyDescription>
|
|
903
|
+
{mediaDenial
|
|
904
|
+
? userFacingError(query.error, '', mediaI18n)
|
|
905
|
+
: _t({ message: 'Please try again.' })}
|
|
906
|
+
</EmptyDescription>
|
|
907
|
+
</EmptyHeader>
|
|
908
|
+
<EmptyContent>
|
|
909
|
+
{mediaDenial?.actionUrl ? (
|
|
910
|
+
<Button asChild size="sm" variant="outline">
|
|
911
|
+
<a href={mediaDenial.actionUrl} rel="noreferrer">
|
|
912
|
+
<UiTrans>Learn more</UiTrans>
|
|
913
|
+
</a>
|
|
914
|
+
</Button>
|
|
915
|
+
) : (
|
|
916
|
+
<Button
|
|
917
|
+
size="sm"
|
|
918
|
+
variant="outline"
|
|
919
|
+
aria-busy={query.isFetching}
|
|
920
|
+
disabled={query.isFetching}
|
|
921
|
+
onClick={() => void query.refetch()}
|
|
922
|
+
>
|
|
923
|
+
<UiTrans>Try again</UiTrans>
|
|
924
|
+
{query.isFetching ? (
|
|
925
|
+
<Spinner aria-hidden="true" data-icon="inline-end" />
|
|
926
|
+
) : null}
|
|
927
|
+
</Button>
|
|
928
|
+
)}
|
|
929
|
+
</EmptyContent>
|
|
930
|
+
</Empty>
|
|
931
|
+
)
|
|
932
|
+
) : folderPending || !data ? (
|
|
933
|
+
<MediaBrowserSkeleton view={view} />
|
|
934
|
+
) : view === 'list' ? (
|
|
935
|
+
tableResults
|
|
936
|
+
) : visible.length ? (
|
|
937
|
+
gridResults
|
|
938
|
+
) : (
|
|
939
|
+
emptyResults
|
|
940
|
+
)}
|
|
941
|
+
{!folderPending && !manifestUnavailable && pageCount > 1 ? (
|
|
942
|
+
<nav
|
|
943
|
+
aria-label={_t({ message: 'Media pagination' })}
|
|
944
|
+
className="mt-4 flex items-center justify-between gap-2"
|
|
945
|
+
>
|
|
946
|
+
<span className="text-sm text-muted-foreground">
|
|
947
|
+
<UiTrans>
|
|
948
|
+
{first}–{last} of {total}
|
|
949
|
+
</UiTrans>
|
|
950
|
+
</span>
|
|
951
|
+
<div className="flex gap-2">
|
|
952
|
+
<Button
|
|
953
|
+
variant="outline"
|
|
954
|
+
size="sm"
|
|
955
|
+
disabled={page === 0}
|
|
956
|
+
onClick={() => changePage(page - 1)}
|
|
957
|
+
>
|
|
958
|
+
<UiTrans>Previous</UiTrans>
|
|
959
|
+
</Button>
|
|
960
|
+
<Button
|
|
961
|
+
variant="outline"
|
|
962
|
+
size="sm"
|
|
963
|
+
disabled={page === pageCount - 1}
|
|
964
|
+
onClick={() => changePage(page + 1)}
|
|
965
|
+
>
|
|
966
|
+
<UiTrans>Next</UiTrans>
|
|
967
|
+
</Button>
|
|
968
|
+
</div>
|
|
969
|
+
</nav>
|
|
970
|
+
) : null}
|
|
971
|
+
</div>
|
|
972
|
+
)
|
|
973
|
+
|
|
974
|
+
return (
|
|
975
|
+
<DndContext
|
|
976
|
+
sensors={sensors}
|
|
977
|
+
collisionDetection={mediaDropTarget}
|
|
978
|
+
onDragEnd={dropFile}
|
|
979
|
+
>
|
|
980
|
+
<div className={cn('flex min-h-0 min-w-0 flex-1 flex-col', className)}>
|
|
981
|
+
<RepositoryPageHeader
|
|
982
|
+
className={cn(
|
|
983
|
+
'shrink-0',
|
|
984
|
+
variant === 'embedded' &&
|
|
985
|
+
'mb-2 min-h-0 border-0 bg-transparent p-0 md:min-h-0 md:p-0',
|
|
986
|
+
)}
|
|
987
|
+
refreshing={query.isFetching}
|
|
988
|
+
configuredActions={repositoryActionControls}
|
|
989
|
+
toolbar={searchControl}
|
|
990
|
+
actions={
|
|
991
|
+
<>
|
|
992
|
+
{viewControls}
|
|
993
|
+
{manageControls}
|
|
994
|
+
</>
|
|
995
|
+
}
|
|
996
|
+
>
|
|
997
|
+
{showBreadcrumb &&
|
|
998
|
+
(variant === 'page' || directoryPath !== rootPath) &&
|
|
999
|
+
(data || manifestUnavailable ? (
|
|
1000
|
+
<MediaBreadcrumb
|
|
1001
|
+
compact={variant === 'embedded'}
|
|
1002
|
+
label={libraryLabel}
|
|
1003
|
+
path={directoryPath}
|
|
1004
|
+
rootPath={rootPath}
|
|
1005
|
+
onNavigate={navigate}
|
|
1006
|
+
allowDrop={canMove}
|
|
1007
|
+
/>
|
|
1008
|
+
) : (
|
|
1009
|
+
<Skeleton className="h-5 w-40" />
|
|
1010
|
+
))}
|
|
1011
|
+
{!showBreadcrumb && directoryPath !== rootPath && (
|
|
1012
|
+
<Button
|
|
1013
|
+
aria-label={_t({ message: 'Parent folder' })}
|
|
1014
|
+
className="sm:hidden"
|
|
1015
|
+
size="icon"
|
|
1016
|
+
variant="outline"
|
|
1017
|
+
onClick={() => navigate(parentMediaPath(directoryPath, rootPath))}
|
|
1018
|
+
>
|
|
1019
|
+
<HugeiconsIcon aria-hidden="true" icon={ArrowUp} />
|
|
1020
|
+
</Button>
|
|
1021
|
+
)}
|
|
1022
|
+
</RepositoryPageHeader>
|
|
1023
|
+
<section
|
|
1024
|
+
className="relative flex min-h-0 flex-1 flex-col"
|
|
1025
|
+
onDragEnter={(event) => {
|
|
1026
|
+
if (acceptsFileDrop && event.dataTransfer.types.includes('Files')) {
|
|
1027
|
+
event.preventDefault()
|
|
1028
|
+
fileDragDepth.current++
|
|
1029
|
+
setDraggingFiles(true)
|
|
1030
|
+
}
|
|
1031
|
+
}}
|
|
1032
|
+
onDragOver={(event) => {
|
|
1033
|
+
if (event.dataTransfer.types.includes('Files'))
|
|
1034
|
+
event.preventDefault()
|
|
1035
|
+
}}
|
|
1036
|
+
onDragLeave={() => {
|
|
1037
|
+
// Moving over children enters the new target before leaving the old one.
|
|
1038
|
+
if (fileDragDepth.current > 0 && --fileDragDepth.current === 0)
|
|
1039
|
+
setDraggingFiles(false)
|
|
1040
|
+
}}
|
|
1041
|
+
onDrop={(event) => {
|
|
1042
|
+
fileDragDepth.current = 0
|
|
1043
|
+
setDraggingFiles(false)
|
|
1044
|
+
if (!event.dataTransfer.types.includes('Files')) return
|
|
1045
|
+
event.preventDefault()
|
|
1046
|
+
if (acceptsFileDrop) void upload(event.dataTransfer.files)
|
|
1047
|
+
}}
|
|
1048
|
+
>
|
|
1049
|
+
<div
|
|
1050
|
+
className={cn(
|
|
1051
|
+
'md:hidden',
|
|
1052
|
+
variant === 'page' ? 'px-4 pb-4' : 'pb-2',
|
|
1053
|
+
)}
|
|
1054
|
+
>
|
|
1055
|
+
{searchControl}
|
|
1056
|
+
</div>
|
|
1057
|
+
{variant === 'embedded' && !centerEmptyGrid ? (
|
|
1058
|
+
<ScrollArea className="min-h-0 flex-1">{mediaResults}</ScrollArea>
|
|
1059
|
+
) : variant === 'page' ? (
|
|
1060
|
+
<div className="flex min-h-0 flex-1 flex-col px-4 pb-4 md:p-6">
|
|
1061
|
+
{mediaResults}
|
|
1062
|
+
</div>
|
|
1063
|
+
) : (
|
|
1064
|
+
mediaResults
|
|
1065
|
+
)}
|
|
1066
|
+
{draggingFiles && acceptsFileDrop ? (
|
|
1067
|
+
<div className="pointer-events-none absolute inset-0 z-10">
|
|
1068
|
+
<div
|
|
1069
|
+
className={cn(
|
|
1070
|
+
'flex h-full max-h-full p-2',
|
|
1071
|
+
variant === 'page' &&
|
|
1072
|
+
'sticky top-12 h-[calc(100dvh-3rem)] md:top-16 md:h-[calc(100dvh-4rem)]',
|
|
1073
|
+
)}
|
|
1074
|
+
>
|
|
1075
|
+
<div
|
|
1076
|
+
data-media-upload-overlay
|
|
1077
|
+
className="grid min-w-0 flex-1 place-items-center rounded-xl border-2 border-ring bg-ring/10 p-4"
|
|
1078
|
+
>
|
|
1079
|
+
<div
|
|
1080
|
+
role="status"
|
|
1081
|
+
className="max-w-full rounded-full bg-ring px-3 py-1 wrap-anywhere text-center text-[13px] leading-[18px] font-medium text-neutral-950"
|
|
1082
|
+
>
|
|
1083
|
+
<UiTrans>Drop files into “{folder}”</UiTrans>
|
|
1084
|
+
</div>
|
|
1085
|
+
</div>
|
|
1086
|
+
</div>
|
|
1087
|
+
</div>
|
|
1088
|
+
) : null}
|
|
1089
|
+
</section>
|
|
1090
|
+
</div>
|
|
1091
|
+
|
|
1092
|
+
{conflict.dialog}
|
|
1093
|
+
<MediaDragOverlay />
|
|
1094
|
+
{moveEntry && (
|
|
1095
|
+
<MediaMoveDialog
|
|
1096
|
+
coordinates={coordinates}
|
|
1097
|
+
entry={moveEntry}
|
|
1098
|
+
rootPath={rootPath}
|
|
1099
|
+
label={
|
|
1100
|
+
data?.media.defaultLabel
|
|
1101
|
+
? _t({ message: 'Media' })
|
|
1102
|
+
: (data?.media.label ?? coordinates.name)
|
|
1103
|
+
}
|
|
1104
|
+
moving={pending.has(moveEntry.path)}
|
|
1105
|
+
onClose={() => setMoveEntry(null)}
|
|
1106
|
+
onCloseAutoFocus={restoreFileFocus}
|
|
1107
|
+
onMove={(destination) => void move(moveEntry, destination)}
|
|
1108
|
+
/>
|
|
1109
|
+
)}
|
|
1110
|
+
|
|
1111
|
+
<Dialog open={folderOpen} onOpenChange={setFolderOpen}>
|
|
1112
|
+
<DialogContent>
|
|
1113
|
+
<DialogHeader>
|
|
1114
|
+
<DialogTitle>
|
|
1115
|
+
<UiTrans>New folder</UiTrans>
|
|
1116
|
+
</DialogTitle>
|
|
1117
|
+
<DialogDescription>
|
|
1118
|
+
<UiTrans>Create a folder under {directoryPath}.</UiTrans>
|
|
1119
|
+
</DialogDescription>
|
|
1120
|
+
</DialogHeader>
|
|
1121
|
+
<Field>
|
|
1122
|
+
<FieldLabel htmlFor={`${fieldPrefix}-folder`}>
|
|
1123
|
+
<UiTrans>Folder name</UiTrans>
|
|
1124
|
+
</FieldLabel>{' '}
|
|
1125
|
+
<Input
|
|
1126
|
+
id={`${fieldPrefix}-folder`}
|
|
1127
|
+
autoFocus
|
|
1128
|
+
placeholder={_t({ message: 'Folder name' })}
|
|
1129
|
+
value={folderName}
|
|
1130
|
+
onChange={(event) => setFolderName(event.target.value)}
|
|
1131
|
+
onKeyDown={(event) => {
|
|
1132
|
+
if (event.key === 'Enter' && folderName.trim())
|
|
1133
|
+
void createFolder()
|
|
1134
|
+
}}
|
|
1135
|
+
/>
|
|
1136
|
+
</Field>
|
|
1137
|
+
<DialogFooter showCloseButton>
|
|
1138
|
+
<Button
|
|
1139
|
+
aria-busy={creatingFolder}
|
|
1140
|
+
disabled={creatingFolder || !folderName.trim()}
|
|
1141
|
+
onClick={() => void createFolder()}
|
|
1142
|
+
>
|
|
1143
|
+
<UiTrans>Create folder</UiTrans>
|
|
1144
|
+
{creatingFolder ? (
|
|
1145
|
+
<Spinner aria-hidden="true" data-icon="inline-end" />
|
|
1146
|
+
) : null}
|
|
1147
|
+
</Button>
|
|
1148
|
+
</DialogFooter>
|
|
1149
|
+
</DialogContent>
|
|
1150
|
+
</Dialog>
|
|
1151
|
+
<Dialog
|
|
1152
|
+
open={!!renameEntry}
|
|
1153
|
+
onOpenChange={(open) => {
|
|
1154
|
+
if (!open) setRenameEntry(null)
|
|
1155
|
+
}}
|
|
1156
|
+
>
|
|
1157
|
+
<DialogContent onCloseAutoFocus={restoreFileFocus}>
|
|
1158
|
+
<DialogHeader>
|
|
1159
|
+
<DialogTitle>
|
|
1160
|
+
<UiTrans>Rename file</UiTrans>
|
|
1161
|
+
</DialogTitle>
|
|
1162
|
+
<DialogDescription>
|
|
1163
|
+
<UiTrans>
|
|
1164
|
+
Update any content that links to the old filename.
|
|
1165
|
+
</UiTrans>
|
|
1166
|
+
</DialogDescription>
|
|
1167
|
+
</DialogHeader>
|
|
1168
|
+
<Field>
|
|
1169
|
+
<FieldLabel htmlFor={`${fieldPrefix}-filename`}>
|
|
1170
|
+
<UiTrans>Filename</UiTrans>
|
|
1171
|
+
</FieldLabel>{' '}
|
|
1172
|
+
<Input
|
|
1173
|
+
id={`${fieldPrefix}-filename`}
|
|
1174
|
+
autoFocus
|
|
1175
|
+
value={renameValue}
|
|
1176
|
+
onChange={(event) => setRenameValue(event.target.value)}
|
|
1177
|
+
onKeyDown={(event) => {
|
|
1178
|
+
if (event.key === 'Enter' && renameValue.trim()) void rename()
|
|
1179
|
+
}}
|
|
1180
|
+
/>
|
|
1181
|
+
</Field>
|
|
1182
|
+
<DialogFooter showCloseButton>
|
|
1183
|
+
<Button
|
|
1184
|
+
aria-busy={renaming}
|
|
1185
|
+
disabled={renaming || !renameValue.trim()}
|
|
1186
|
+
onClick={() => void rename()}
|
|
1187
|
+
>
|
|
1188
|
+
<UiTrans>Rename</UiTrans>
|
|
1189
|
+
{renaming ? (
|
|
1190
|
+
<Spinner aria-hidden="true" data-icon="inline-end" />
|
|
1191
|
+
) : null}
|
|
1192
|
+
</Button>
|
|
1193
|
+
</DialogFooter>
|
|
1194
|
+
</DialogContent>
|
|
1195
|
+
</Dialog>
|
|
1196
|
+
<AlertDialog
|
|
1197
|
+
open={!!deleteEntry}
|
|
1198
|
+
onOpenChange={(open) => {
|
|
1199
|
+
if (!open) setDeleteEntry(null)
|
|
1200
|
+
}}
|
|
1201
|
+
>
|
|
1202
|
+
<AlertDialogContent onCloseAutoFocus={restoreFileFocus}>
|
|
1203
|
+
<AlertDialogHeader>
|
|
1204
|
+
<AlertDialogTitle>
|
|
1205
|
+
<UiTrans>Delete {deleteEntry?.name}?</UiTrans>
|
|
1206
|
+
</AlertDialogTitle>
|
|
1207
|
+
<AlertDialogDescription>
|
|
1208
|
+
<UiTrans>
|
|
1209
|
+
Deleting this file can break links to it in your content.
|
|
1210
|
+
</UiTrans>
|
|
1211
|
+
</AlertDialogDescription>
|
|
1212
|
+
</AlertDialogHeader>
|
|
1213
|
+
<AlertDialogFooter>
|
|
1214
|
+
<AlertDialogCancel>
|
|
1215
|
+
<UiTrans>Cancel</UiTrans>
|
|
1216
|
+
</AlertDialogCancel>
|
|
1217
|
+
<AlertDialogAction
|
|
1218
|
+
aria-busy={deleting}
|
|
1219
|
+
variant="destructive"
|
|
1220
|
+
disabled={deleting}
|
|
1221
|
+
onClick={(event) => {
|
|
1222
|
+
event.preventDefault()
|
|
1223
|
+
void remove()
|
|
1224
|
+
}}
|
|
1225
|
+
>
|
|
1226
|
+
<UiTrans>Delete</UiTrans>
|
|
1227
|
+
{deleting ? (
|
|
1228
|
+
<Spinner aria-hidden="true" data-icon="inline-end" />
|
|
1229
|
+
) : null}
|
|
1230
|
+
</AlertDialogAction>
|
|
1231
|
+
</AlertDialogFooter>
|
|
1232
|
+
</AlertDialogContent>
|
|
1233
|
+
</AlertDialog>
|
|
1234
|
+
</DndContext>
|
|
1235
|
+
)
|
|
1236
|
+
}
|