alinea 2.0.0-preview.0 → 2.0.0-preview.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/dist/.init/content/pages/welcome.json +1 -1
- package/dist/LICENSES.md +116 -89
- package/dist/backend/Handler.js +17 -14
- package/dist/backend/router/Router.d.ts +1 -0
- package/dist/backend/router/Router.js +21 -15
- package/dist/bundled.d.ts +114 -39
- package/dist/chunks/chunk-6UT4N4CO.js +919 -0
- package/dist/chunks/{chunk-EQ3TDHYD.js → chunk-FRYHNUEK.js} +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/generate/CompileConfig.js +3 -2
- package/dist/cloud/CloudRemote.d.ts +2 -1
- package/dist/cloud/CloudRemote.js +3 -2
- package/dist/components/Calendar.js +6 -6
- package/dist/components/Checkbox.js +3 -3
- package/dist/components/ComboBox.js +9 -9
- package/dist/components/DatePicker.js +3 -3
- package/dist/components/DateRangePicker.js +5 -5
- package/dist/components/Disclosure.js +5 -5
- package/dist/components/Label.js +4 -4
- package/dist/components/List.js +33 -33
- package/dist/components/Menu.js +3 -3
- package/dist/components/Modal.js +3 -3
- package/dist/components/MultipleSelect.js +26 -26
- package/dist/components/NumberField.js +4 -4
- package/dist/components/ProgressCircle.js +3 -3
- package/dist/components/RadioGroup.js +2 -2
- package/dist/components/SearchField.js +9 -9
- package/dist/components/Select.js +7 -7
- package/dist/components/Surface.js +3 -3
- package/dist/components/Switch.js +2 -2
- package/dist/components/Table.js +5 -5
- package/dist/components/Tabs.js +1 -1
- package/dist/components/TagGroup.js +2 -2
- package/dist/components/TextField.js +4 -4
- package/dist/components/TimeField.js +2 -2
- package/dist/components/Toggle.js +2 -2
- package/dist/components/Toolbar.js +3 -3
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/Tree.js +5 -5
- package/dist/core/BlobTransport.d.ts +5 -0
- package/dist/core/BlobTransport.js +79 -0
- package/dist/core/Client.d.ts +2 -1
- package/dist/core/Client.js +14 -10
- package/dist/core/Connection.d.ts +2 -1
- package/dist/core/Type.d.ts +7 -1
- package/dist/core/db/EntryIndex.d.ts +2 -2
- package/dist/core/db/EntryIndex.js +14 -13
- package/dist/core/db/EntryTransaction.js +4 -9
- package/dist/core/db/LocalDB.d.ts +3 -2
- package/dist/core/db/LocalDB.js +14 -4
- package/dist/core/field/RichTextField.js +2 -18
- package/dist/core/media/MediaLocation.d.ts +5 -2
- package/dist/core/media/MediaLocation.js +6 -7
- package/dist/core/media/MediaTypes.js +11 -0
- package/dist/core/source/CombinedSource.d.ts +2 -2
- package/dist/core/source/CombinedSource.js +6 -3
- package/dist/core/source/FSSource.d.ts +4 -3
- package/dist/core/source/FSSource.js +59 -27
- package/dist/core/source/GithubSource.d.ts +2 -2
- package/dist/core/source/GithubSource.js +21 -9
- package/dist/core/source/IndexedDBSource.d.ts +2 -2
- package/dist/core/source/IndexedDBSource.js +3 -1
- package/dist/core/source/MemorySource.d.ts +2 -2
- package/dist/core/source/MemorySource.js +3 -1
- package/dist/core/source/Source.d.ts +4 -1
- package/dist/core/util/Async.d.ts +8 -2
- package/dist/core/util/Async.js +67 -0
- package/dist/core/util/EntryFilenames.d.ts +2 -2
- package/dist/core/util/EntryFilenames.js +3 -3
- package/dist/dashboard/App.js +3 -3
- package/dist/dashboard/app/AccessDenied.js +4 -4
- package/dist/dashboard/app/ActivityStatus.js +9 -9
- package/dist/dashboard/app/AppShell.js +2 -2
- package/dist/dashboard/app/AuthView.js +12 -12
- package/dist/dashboard/app/Badge.js +2 -2
- package/dist/dashboard/app/CompactField.js +7 -7
- package/dist/dashboard/app/DashboardErrorBoundary.js +5 -5
- package/dist/dashboard/app/EntryHeader.js +8 -8
- package/dist/dashboard/app/EntryReferences.js +8 -8
- package/dist/dashboard/app/EntrySidebar.js +14 -14
- package/dist/dashboard/app/EntrySidebarPreview.js +10 -10
- package/dist/dashboard/app/EntryTranslationBanner.js +9 -9
- package/dist/dashboard/app/Explorer.js +54 -46
- package/dist/dashboard/app/ExplorerCards.js +31 -31
- package/dist/dashboard/app/ExplorerFileCard.js +17 -17
- package/dist/dashboard/app/ExplorerList.js +10 -10
- package/dist/dashboard/app/ExplorerModal.js +5 -5
- package/dist/dashboard/app/ExplorerTable.js +63 -48
- package/dist/dashboard/app/LinkPicker.js +3 -3
- package/dist/dashboard/app/LocaleMenu.js +4 -4
- package/dist/dashboard/app/SidebarTree.js +43 -43
- package/dist/dashboard/app/WorkspaceMenu.js +11 -11
- package/dist/dashboard/app/WorkspaceRoots.js +24 -24
- package/dist/dashboard/app/editor/FileEditor.d.ts +2 -1
- package/dist/dashboard/app/editor/FileEditor.js +40 -30
- package/dist/dashboard/app/editor/FilePreview.js +5 -5
- package/dist/dashboard/app/modals/CreateEntry.js +4 -4
- package/dist/dashboard/app/pages/EntryPage.js +21 -19
- package/dist/dashboard/app/pages/UsersPage.js +33 -33
- package/dist/dashboard/app/ui/DashboardModal.js +19 -19
- package/dist/dashboard/app/ui/Rail.js +3 -3
- package/dist/dashboard/app/ui/Sidebar.js +1 -1
- package/dist/dashboard/atoms/entry.d.ts +45 -1
- package/dist/dashboard/atoms/entry.js +167 -2
- package/dist/dashboard/atoms/explorer.js +1 -1
- package/dist/dashboard/atoms/root.d.ts +4 -1
- package/dist/dashboard/atoms/root.js +96 -157
- package/dist/field/code/CodeField.view.js +10 -10
- package/dist/field/link/FileLink.d.ts +2 -2
- package/dist/field/link/FileLink.js +5 -3
- package/dist/field/link/ImageLink.d.ts +1 -1
- package/dist/field/link/ImageLink.js +1 -1
- package/dist/field/link/LinkField.view.js +111 -95
- package/dist/field/list/ListField.view.js +14 -14
- package/dist/field/metadata/MetadataField.view.js +18 -18
- package/dist/field/richtext/RichTextExtensions.js +18 -18
- package/dist/field/richtext/RichTextField.view.js +2 -2
- package/dist/field/richtext/RichTextInsertMenu.js +2 -2
- package/dist/index.css +8 -2
- package/dist/picker/entry/EntryPicker.js +9 -35
- package/dist/preview/PreviewPayload.js +35 -250
- package/package.json +1 -1
- package/dist/cli/util/ExternalPlugin.d.ts +0 -2
- package/dist/cli/util/ExternalPlugin.js +0 -919
package/dist/bundled.d.ts
CHANGED
|
@@ -688,6 +688,7 @@ declare module 'alinea/backend/router/Router' {
|
|
|
688
688
|
function cookie(...cookies: Array<Cookie>): string;
|
|
689
689
|
function compress(...routes: Array<Next<Request, Response | undefined>>): Route<Request, Response | undefined>;
|
|
690
690
|
}
|
|
691
|
+
export function compressResponse(request: Request, response: Response): Response;
|
|
691
692
|
export {};
|
|
692
693
|
|
|
693
694
|
}
|
|
@@ -1109,13 +1110,6 @@ declare module 'alinea/cli/util/EnsureNode' {
|
|
|
1109
1110
|
|
|
1110
1111
|
}
|
|
1111
1112
|
|
|
1112
|
-
declare module 'alinea/cli/util/ExternalPlugin' {
|
|
1113
|
-
|
|
1114
|
-
import type { Plugin } from 'esbuild';
|
|
1115
|
-
export function externalPlugin(cwd: string): Plugin;
|
|
1116
|
-
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
1113
|
declare module 'alinea/cli/util/FindConfigFile' {
|
|
1120
1114
|
|
|
1121
1115
|
export function findConfigFile(cwd: string): string | undefined;
|
|
@@ -1255,12 +1249,13 @@ declare module 'alinea/cloud/CloudRemote' {
|
|
|
1255
1249
|
import { type Draft, type DraftKey } from 'alinea/core/Draft';
|
|
1256
1250
|
import type { EntryRecord } from 'alinea/core/EntryRecord';
|
|
1257
1251
|
import { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
1252
|
+
import type { GetBlobsOptions } from 'alinea/core/source/Source';
|
|
1258
1253
|
import type { User, UserInput } from 'alinea/core/User';
|
|
1259
1254
|
export class CloudRemote extends OAuth2 implements RemoteConnection {
|
|
1260
1255
|
#private;
|
|
1261
1256
|
constructor(context: RequestContext, config: Config);
|
|
1262
1257
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
1263
|
-
getBlobs(shas:
|
|
1258
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
1264
1259
|
write(request: CommitRequest): Promise<{
|
|
1265
1260
|
sha: string;
|
|
1266
1261
|
}>;
|
|
@@ -2024,6 +2019,16 @@ declare module 'alinea/core/Auth' {
|
|
|
2024
2019
|
|
|
2025
2020
|
}
|
|
2026
2021
|
|
|
2022
|
+
declare module 'alinea/core/BlobTransport' {
|
|
2023
|
+
|
|
2024
|
+
import { ReadableStream } from '@alinea/iso';
|
|
2025
|
+
import type { GetBlobsOptions } from 'alinea/core/source/Source';
|
|
2026
|
+
export const BLOB_SEQUENCE_CONTENT_TYPE = "application/cbor-seq";
|
|
2027
|
+
export function encodeBlobSequence(blobs: AsyncIterable<[sha: string, blob: Uint8Array]>): ReadableStream<Uint8Array>;
|
|
2028
|
+
export function decodeBlobSequence(stream: ReadableStream<Uint8Array>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
2029
|
+
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2027
2032
|
declare module 'alinea/core/Client' {
|
|
2028
2033
|
|
|
2029
2034
|
import { type AuthResult } from 'alinea/cloud/AuthResult';
|
|
@@ -2035,6 +2040,7 @@ declare module 'alinea/core/Client' {
|
|
|
2035
2040
|
import type { EntryRecord } from 'alinea/core/EntryRecord';
|
|
2036
2041
|
import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
|
|
2037
2042
|
import { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
2043
|
+
import type { GetBlobsOptions } from 'alinea/core/source/Source';
|
|
2038
2044
|
import type { User, UserInput } from 'alinea/core/User';
|
|
2039
2045
|
export type AuthenticateRequest = (request?: RequestInit) => RequestInit | undefined;
|
|
2040
2046
|
export interface ClientOptions {
|
|
@@ -2065,7 +2071,7 @@ declare module 'alinea/core/Client' {
|
|
|
2065
2071
|
revisions(file: string): Promise<Array<Revision>>;
|
|
2066
2072
|
revisionData(file: string, revisionId: string): Promise<EntryRecord | undefined>;
|
|
2067
2073
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
2068
|
-
getBlobs(shas:
|
|
2074
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
2069
2075
|
write(request: CommitRequest): Promise<{
|
|
2070
2076
|
sha: string;
|
|
2071
2077
|
}>;
|
|
@@ -2159,6 +2165,7 @@ declare module 'alinea/core/Connection' {
|
|
|
2159
2165
|
import type { Draft, DraftKey } from 'alinea/core/Draft';
|
|
2160
2166
|
import type { EntryRecord } from 'alinea/core/EntryRecord';
|
|
2161
2167
|
import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
|
|
2168
|
+
import type { GetBlobsOptions } from 'alinea/core/source/Source';
|
|
2162
2169
|
import type { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
2163
2170
|
import type { User, UserInput } from 'alinea/core/User';
|
|
2164
2171
|
export interface AuthApi {
|
|
@@ -2197,7 +2204,7 @@ declare module 'alinea/core/Connection' {
|
|
|
2197
2204
|
}
|
|
2198
2205
|
export interface SyncApi {
|
|
2199
2206
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
2200
|
-
getBlobs(shas:
|
|
2207
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncIterable<[sha: string, blob: Uint8Array]>;
|
|
2201
2208
|
}
|
|
2202
2209
|
export interface CommitApi {
|
|
2203
2210
|
write(request: CommitRequest): Promise<{
|
|
@@ -2349,7 +2356,7 @@ declare module 'alinea/core/db/EntryIndex' {
|
|
|
2349
2356
|
id: string;
|
|
2350
2357
|
type: string;
|
|
2351
2358
|
index: string;
|
|
2352
|
-
searchableText
|
|
2359
|
+
searchableText?: string;
|
|
2353
2360
|
title: string;
|
|
2354
2361
|
data: Record<string, unknown>;
|
|
2355
2362
|
seeded: string | null;
|
|
@@ -2438,7 +2445,7 @@ declare module 'alinea/core/db/EntryIndex' {
|
|
|
2438
2445
|
get references(): Promise<EntryReferenceIndex>;
|
|
2439
2446
|
sync(source: Source): Promise<string>;
|
|
2440
2447
|
syncWith(source: Source): Promise<string>;
|
|
2441
|
-
indexChanges(batch: ChangesBatch): Promise<string>;
|
|
2448
|
+
indexChanges(batch: ChangesBatch, targetTree?: ReadonlyTree): Promise<string>;
|
|
2442
2449
|
seed(source: Source): Promise<void>;
|
|
2443
2450
|
byId(id: string): EntryNode | undefined;
|
|
2444
2451
|
fix(source: Source): Promise<void>;
|
|
@@ -2702,7 +2709,8 @@ declare module 'alinea/core/db/LocalDB' {
|
|
|
2702
2709
|
import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
|
|
2703
2710
|
import type { Policy } from 'alinea/core/Role';
|
|
2704
2711
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
2705
|
-
import type {
|
|
2712
|
+
import type { GetBlobsOptions } from 'alinea/core/source/Source';
|
|
2713
|
+
import { type Source } from 'alinea/core/source/Source';
|
|
2706
2714
|
import { type CommitRequest } from 'alinea/core/db/CommitRequest';
|
|
2707
2715
|
import { EntryIndex } from 'alinea/core/db/EntryIndex';
|
|
2708
2716
|
import type { EntryReferenceQuery, EntryReferenceResult } from 'alinea/core/db/EntryReference';
|
|
@@ -2720,7 +2728,7 @@ declare module 'alinea/core/db/LocalDB' {
|
|
|
2720
2728
|
indexChanges(batch: ChangesBatch): Promise<string>;
|
|
2721
2729
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
2722
2730
|
getTreeIfDifferent(sha: string): Promise<import("alinea/core/source/Tree").ReadonlyTree | undefined>;
|
|
2723
|
-
getBlobs(shas:
|
|
2731
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncIterable<[sha: string, blob: Uint8Array<ArrayBufferLike>]>;
|
|
2724
2732
|
sync(): Promise<string>;
|
|
2725
2733
|
syncWith(remote: SyncApi): Promise<string>;
|
|
2726
2734
|
logEntries(): Promise<void>;
|
|
@@ -3882,10 +3890,13 @@ declare module 'alinea/core/media/MediaLocation' {
|
|
|
3882
3890
|
(meta: MediaUrlMeta): string;
|
|
3883
3891
|
}
|
|
3884
3892
|
export interface MediaPublicUrlMeta extends Omit<MediaUrlMeta, 'parentPaths'> {
|
|
3885
|
-
|
|
3893
|
+
/** @deprecated Pass parentPaths directly when available. */
|
|
3894
|
+
entryUrl?: string;
|
|
3895
|
+
parentPaths?: Array<string>;
|
|
3886
3896
|
}
|
|
3887
3897
|
export interface MediaEntryUrlMeta {
|
|
3888
|
-
|
|
3898
|
+
defaultUrl: string;
|
|
3899
|
+
parentPaths: Array<string>;
|
|
3889
3900
|
path: string;
|
|
3890
3901
|
workspace: string;
|
|
3891
3902
|
root: string;
|
|
@@ -4525,14 +4536,14 @@ declare module 'alinea/core/source/Change' {
|
|
|
4525
4536
|
declare module 'alinea/core/source/CombinedSource' {
|
|
4526
4537
|
|
|
4527
4538
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
4528
|
-
import type { Source } from 'alinea/core/source/Source';
|
|
4539
|
+
import type { GetBlobsOptions, Source } from 'alinea/core/source/Source';
|
|
4529
4540
|
import { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
4530
4541
|
export class CombinedSource implements Source {
|
|
4531
4542
|
#private;
|
|
4532
4543
|
constructor(sources: Record<string, Source>);
|
|
4533
4544
|
getTree(): Promise<ReadonlyTree>;
|
|
4534
4545
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
4535
|
-
getBlobs(shas:
|
|
4546
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
4536
4547
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
4537
4548
|
}
|
|
4538
4549
|
|
|
@@ -4558,7 +4569,7 @@ declare module 'alinea/core/source/FilePatch' {
|
|
|
4558
4569
|
declare module 'alinea/core/source/FSSource' {
|
|
4559
4570
|
|
|
4560
4571
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
4561
|
-
import type { Source } from 'alinea/core/source/Source';
|
|
4572
|
+
import type { GetBlobsOptions, Source } from 'alinea/core/source/Source';
|
|
4562
4573
|
import { ReadonlyTree, WriteableTree } from 'alinea/core/source/Tree';
|
|
4563
4574
|
export class FSSource implements Source {
|
|
4564
4575
|
#private;
|
|
@@ -4566,7 +4577,8 @@ declare module 'alinea/core/source/FSSource' {
|
|
|
4566
4577
|
getTree(): Promise<ReadonlyTree>;
|
|
4567
4578
|
getFile(current: ReadonlyTree, builder: WriteableTree, file: string): Promise<readonly [string, Uint8Array<ArrayBufferLike>] | undefined>;
|
|
4568
4579
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
4569
|
-
getBlobs(shas:
|
|
4580
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
4581
|
+
readBlob(sha: string, file: string, signal?: AbortSignal): Promise<[sha: string, blob: Uint8Array]>;
|
|
4570
4582
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
4571
4583
|
}
|
|
4572
4584
|
export class CachedFSSource extends FSSource {
|
|
@@ -4576,7 +4588,7 @@ declare module 'alinea/core/source/FSSource' {
|
|
|
4576
4588
|
getTree(): Promise<ReadonlyTree>;
|
|
4577
4589
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
4578
4590
|
getFile(current: ReadonlyTree, builder: WriteableTree, file: string): Promise<readonly [string, Uint8Array<ArrayBufferLike>] | undefined>;
|
|
4579
|
-
getBlobs(shas:
|
|
4591
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
4580
4592
|
}
|
|
4581
4593
|
|
|
4582
4594
|
}
|
|
@@ -4599,7 +4611,7 @@ declare module 'alinea/core/source/GitDelta' {
|
|
|
4599
4611
|
declare module 'alinea/core/source/GithubSource' {
|
|
4600
4612
|
|
|
4601
4613
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
4602
|
-
import type { Source } from 'alinea/core/source/Source';
|
|
4614
|
+
import type { GetBlobsOptions, Source } from 'alinea/core/source/Source';
|
|
4603
4615
|
import { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
4604
4616
|
export interface GithubSourceOptions {
|
|
4605
4617
|
authToken: string;
|
|
@@ -4617,7 +4629,7 @@ declare module 'alinea/core/source/GithubSource' {
|
|
|
4617
4629
|
getTree(): Promise<ReadonlyTree>;
|
|
4618
4630
|
shaAt(ref: string): Promise<string>;
|
|
4619
4631
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
4620
|
-
getBlobs(shas:
|
|
4632
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
4621
4633
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
4622
4634
|
}
|
|
4623
4635
|
|
|
@@ -4652,14 +4664,14 @@ declare module 'alinea/core/source/GitUtils' {
|
|
|
4652
4664
|
declare module 'alinea/core/source/IndexedDBSource' {
|
|
4653
4665
|
|
|
4654
4666
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
4655
|
-
import type { Source } from 'alinea/core/source/Source';
|
|
4667
|
+
import type { GetBlobsOptions, Source } from 'alinea/core/source/Source';
|
|
4656
4668
|
import { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
4657
4669
|
export class IndexedDBSource implements Source {
|
|
4658
4670
|
#private;
|
|
4659
4671
|
constructor(indexedDB: IDBFactory, name: string);
|
|
4660
4672
|
getTree(): Promise<ReadonlyTree>;
|
|
4661
4673
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
4662
|
-
getBlobs(shas:
|
|
4674
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
4663
4675
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
4664
4676
|
}
|
|
4665
4677
|
|
|
@@ -4668,14 +4680,14 @@ declare module 'alinea/core/source/IndexedDBSource' {
|
|
|
4668
4680
|
declare module 'alinea/core/source/MemorySource' {
|
|
4669
4681
|
|
|
4670
4682
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
4671
|
-
import type { Source } from 'alinea/core/source/Source';
|
|
4683
|
+
import type { GetBlobsOptions, Source } from 'alinea/core/source/Source';
|
|
4672
4684
|
import { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
4673
4685
|
export class MemorySource implements Source {
|
|
4674
4686
|
#private;
|
|
4675
4687
|
constructor(tree?: ReadonlyTree, blobs?: Map<string, Uint8Array>);
|
|
4676
4688
|
getTree(): Promise<ReadonlyTree>;
|
|
4677
4689
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
4678
|
-
getBlobs(shas:
|
|
4690
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
|
|
4679
4691
|
addBlob(contents: Uint8Array): Promise<string>;
|
|
4680
4692
|
applyChanges(batch: ChangesBatch): Promise<void>;
|
|
4681
4693
|
}
|
|
@@ -4697,9 +4709,12 @@ declare module 'alinea/core/source/Source' {
|
|
|
4697
4709
|
|
|
4698
4710
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
4699
4711
|
import type { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
4712
|
+
export interface GetBlobsOptions {
|
|
4713
|
+
signal?: AbortSignal;
|
|
4714
|
+
}
|
|
4700
4715
|
export interface RemoteSource {
|
|
4701
4716
|
getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
|
|
4702
|
-
getBlobs(shas:
|
|
4717
|
+
getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncIterable<[sha: string, blob: Uint8Array]>;
|
|
4703
4718
|
}
|
|
4704
4719
|
export interface Source extends RemoteSource {
|
|
4705
4720
|
getTree(): Promise<ReadonlyTree>;
|
|
@@ -4949,6 +4964,7 @@ declare module 'alinea/core/Trigger' {
|
|
|
4949
4964
|
declare module 'alinea/core/Type' {
|
|
4950
4965
|
|
|
4951
4966
|
import type { ComponentType } from 'react';
|
|
4967
|
+
import type { Config } from 'alinea/core/Config';
|
|
4952
4968
|
import type { EntryStatus } from 'alinea/core/Entry';
|
|
4953
4969
|
import type { Expr } from 'alinea/core/Expr';
|
|
4954
4970
|
import { Field, type EntryAnchorTarget, type FieldAnchorContext, type FieldBeforeSaveContext } from 'alinea/core/Field';
|
|
@@ -4961,7 +4977,9 @@ declare module 'alinea/core/Type' {
|
|
|
4961
4977
|
import type { EntryReferenceTarget } from 'alinea/core/db/EntryReference';
|
|
4962
4978
|
import type { SummaryProps } from 'alinea/core/media/Summary';
|
|
4963
4979
|
import type { Expand } from 'alinea/core/util/Types';
|
|
4964
|
-
export interface
|
|
4980
|
+
export interface EntryUrlInput {
|
|
4981
|
+
config: Config;
|
|
4982
|
+
data: Record<string, unknown>;
|
|
4965
4983
|
status: EntryStatus;
|
|
4966
4984
|
path: string;
|
|
4967
4985
|
parentPaths: Array<string>;
|
|
@@ -4969,6 +4987,9 @@ declare module 'alinea/core/Type' {
|
|
|
4969
4987
|
workspace: string;
|
|
4970
4988
|
root: string;
|
|
4971
4989
|
}
|
|
4990
|
+
export interface EntryUrlMeta extends EntryUrlInput {
|
|
4991
|
+
defaultUrl: string;
|
|
4992
|
+
}
|
|
4972
4993
|
export type EntryDefaultView = 'edit' | 'overview';
|
|
4973
4994
|
export type Type<Definition = object> = Definition & HasType;
|
|
4974
4995
|
type TypeRow<Definition> = Expand<{
|
|
@@ -5101,9 +5122,15 @@ declare module 'alinea/core/util/Assert' {
|
|
|
5101
5122
|
|
|
5102
5123
|
declare module 'alinea/core/util/Async' {
|
|
5103
5124
|
|
|
5104
|
-
/** Accumulate all entries of an
|
|
5105
|
-
export function accumulate<T>(gen:
|
|
5125
|
+
/** Accumulate all entries of an AsyncIterable into an array */
|
|
5126
|
+
export function accumulate<T>(gen: AsyncIterable<T>): Promise<Array<T>>;
|
|
5106
5127
|
export function toGenerator<T>(iterable: Iterable<T>): AsyncGenerator<T>;
|
|
5128
|
+
export interface MapConcurrentOptions {
|
|
5129
|
+
concurrency: number;
|
|
5130
|
+
signal?: AbortSignal;
|
|
5131
|
+
}
|
|
5132
|
+
/** Map concurrently while yielding results as they complete. */
|
|
5133
|
+
export function mapConcurrent<T, TResult>(iterable: Iterable<T>, mapper: (item: T, signal?: AbortSignal) => Promise<TResult>, options: MapConcurrentOptions): AsyncGenerator<TResult>;
|
|
5107
5134
|
export function genEffect<T, TReturn>(gen: AsyncIterable<T, TReturn>, effect: (result: T) => void): AsyncIterable<T>;
|
|
5108
5135
|
|
|
5109
5136
|
}
|
|
@@ -5266,7 +5293,7 @@ declare module 'alinea/core/util/EntryFilenames' {
|
|
|
5266
5293
|
|
|
5267
5294
|
import type { Config } from 'alinea/core/Config';
|
|
5268
5295
|
import { type Entry, type EntryStatus } from 'alinea/core/Entry';
|
|
5269
|
-
import type {
|
|
5296
|
+
import type { EntryUrlInput, Type } from 'alinea/core/Type';
|
|
5270
5297
|
export function entryInfo(fileName: string): [name: string, status: EntryStatus];
|
|
5271
5298
|
export function entryChildrenDir(config: Config, entry: {
|
|
5272
5299
|
workspace: string;
|
|
@@ -5290,7 +5317,7 @@ declare module 'alinea/core/util/EntryFilenames' {
|
|
|
5290
5317
|
status: EntryStatus;
|
|
5291
5318
|
}, parentPaths: Array<string>): string;
|
|
5292
5319
|
export function entryFile(config: Config, entry: Entry): string;
|
|
5293
|
-
export function entryUrl(type: Type, meta:
|
|
5320
|
+
export function entryUrl(type: Type, meta: EntryUrlInput): string;
|
|
5294
5321
|
export function pathSuffix(path: string, conflictingPaths: Array<string>): number | undefined;
|
|
5295
5322
|
export function applySuffix(path: string, suffix: number): string;
|
|
5296
5323
|
export function fileVersions(file: string): string[];
|
|
@@ -5890,8 +5917,9 @@ declare module 'alinea/dashboard/app/editor/FileEditor' {
|
|
|
5890
5917
|
import type { Entry } from 'alinea/core/Entry';
|
|
5891
5918
|
export interface FileEditorProps {
|
|
5892
5919
|
entry: Pick<Entry, 'root' | 'url' | 'workspace'>;
|
|
5920
|
+
parentPaths: Array<string>;
|
|
5893
5921
|
}
|
|
5894
|
-
export function FileEditor({ entry }: FileEditorProps): import("react").JSX.Element;
|
|
5922
|
+
export function FileEditor({ entry, parentPaths }: FileEditorProps): import("react").JSX.Element;
|
|
5895
5923
|
|
|
5896
5924
|
}
|
|
5897
5925
|
|
|
@@ -6853,8 +6881,9 @@ declare module 'alinea/dashboard/atoms/entry' {
|
|
|
6853
6881
|
|
|
6854
6882
|
import type { EntryReference, EntryReferenceScan } from 'alinea/core/db/EntryReference';
|
|
6855
6883
|
import { Entry, EntryStatus } from 'alinea/core/Entry';
|
|
6884
|
+
import type { Order } from 'alinea/core/Graph';
|
|
6856
6885
|
import { type EntryDefaultView } from 'alinea/core/Type';
|
|
6857
|
-
import { Atom } from 'jotai';
|
|
6886
|
+
import { Atom, Getter } from 'jotai';
|
|
6858
6887
|
import { ReactiveNode } from 'alinea/dashboard/atoms/ReactiveNode';
|
|
6859
6888
|
interface EntryData {
|
|
6860
6889
|
id: string;
|
|
@@ -7059,6 +7088,7 @@ declare module 'alinea/dashboard/atoms/entry' {
|
|
|
7059
7088
|
parentId: Atom<string | null>;
|
|
7060
7089
|
workspace: Atom<string>;
|
|
7061
7090
|
root: Atom<string>;
|
|
7091
|
+
parentPaths: Atom<string[]>;
|
|
7062
7092
|
hasChildren: Atom<boolean>;
|
|
7063
7093
|
canPublishParents: Atom<boolean>;
|
|
7064
7094
|
parentUnpublished: Atom<boolean>;
|
|
@@ -7073,6 +7103,48 @@ declare module 'alinea/dashboard/atoms/entry' {
|
|
|
7073
7103
|
id: string;
|
|
7074
7104
|
constructor(id: string);
|
|
7075
7105
|
}
|
|
7106
|
+
export interface TreeEntrySummary {
|
|
7107
|
+
id: string;
|
|
7108
|
+
title: string;
|
|
7109
|
+
type: string;
|
|
7110
|
+
status: EntryStatus;
|
|
7111
|
+
main: boolean;
|
|
7112
|
+
locale: string | null;
|
|
7113
|
+
parentId: string | null;
|
|
7114
|
+
parents: Array<string>;
|
|
7115
|
+
workspace: string;
|
|
7116
|
+
root: string;
|
|
7117
|
+
hasChildren: boolean;
|
|
7118
|
+
}
|
|
7119
|
+
interface TreeChildrenLocation {
|
|
7120
|
+
workspace: string;
|
|
7121
|
+
root: string;
|
|
7122
|
+
parentId: string | null;
|
|
7123
|
+
}
|
|
7124
|
+
export function loadTreeChildren(get: Getter, location: TreeChildrenLocation, locale: string | null, orderBy?: Order | Array<Order>): Promise<Array<TreeEntryAtoms>>;
|
|
7125
|
+
export class TreeEntryAtoms {
|
|
7126
|
+
#private;
|
|
7127
|
+
readonly id: string;
|
|
7128
|
+
constructor(id: string);
|
|
7129
|
+
ready: Atom<Promise<this>>;
|
|
7130
|
+
raw: (locale: string | null) => Atom<Promise<Omit<TreeEntrySummary, "hasChildren">>>;
|
|
7131
|
+
summary: (locale: string | null) => Atom<Promise<{
|
|
7132
|
+
id: string;
|
|
7133
|
+
title: string;
|
|
7134
|
+
type: string;
|
|
7135
|
+
status: EntryStatus;
|
|
7136
|
+
main: boolean;
|
|
7137
|
+
locale: string | null;
|
|
7138
|
+
parentId: string | null;
|
|
7139
|
+
parents: Array<string>;
|
|
7140
|
+
workspace: string;
|
|
7141
|
+
root: string;
|
|
7142
|
+
hasChildren: boolean;
|
|
7143
|
+
}>>;
|
|
7144
|
+
parents: Atom<Promise<TreeEntryAtoms[]>>;
|
|
7145
|
+
children: (locale: string | null) => Atom<Promise<TreeEntryAtoms[]>>;
|
|
7146
|
+
}
|
|
7147
|
+
export const treeEntryAtoms: (id: string) => TreeEntryAtoms;
|
|
7076
7148
|
export {};
|
|
7077
7149
|
|
|
7078
7150
|
}
|
|
@@ -7487,7 +7559,7 @@ declare module 'alinea/dashboard/atoms/ReactiveNode' {
|
|
|
7487
7559
|
|
|
7488
7560
|
declare module 'alinea/dashboard/atoms/root' {
|
|
7489
7561
|
|
|
7490
|
-
import {
|
|
7562
|
+
import type { EntryStatus } from 'alinea/core/Entry';
|
|
7491
7563
|
import type { RootData, RootI18n } from 'alinea/core/Root';
|
|
7492
7564
|
import type { DragItem, DragTypes, DropOperation, DropTarget } from '@react-types/shared';
|
|
7493
7565
|
import { type ExplorerAtoms } from 'alinea/dashboard/atoms/explorer';
|
|
@@ -7495,6 +7567,7 @@ declare module 'alinea/dashboard/atoms/root' {
|
|
|
7495
7567
|
import type { ComponentType } from 'react';
|
|
7496
7568
|
import type { DroppableCollectionInsertDropEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, Key } from 'react-aria-components';
|
|
7497
7569
|
import { LucideFile } from 'alinea/dashboard/icons';
|
|
7570
|
+
import { type TreeEntryAtoms } from 'alinea/dashboard/atoms/entry';
|
|
7498
7571
|
export interface RootViewProps {
|
|
7499
7572
|
root: RootData;
|
|
7500
7573
|
}
|
|
@@ -7534,6 +7607,7 @@ declare module 'alinea/dashboard/atoms/root' {
|
|
|
7534
7607
|
constructor(root: RootAtoms, locale: string | null, selectedKeys: Atom<Set<Key>>, viewState?: TreeViewState);
|
|
7535
7608
|
snapshot: Atom<TreeSnapshot>;
|
|
7536
7609
|
items: Atom<RootTreeItem[]>;
|
|
7610
|
+
children: (id: string) => Atom<Promise<TreeEntryAtoms[]>>;
|
|
7537
7611
|
item: (id: string) => Atom<RootTreeItem>;
|
|
7538
7612
|
selectedItem: Atom<RootTreeItem | undefined>;
|
|
7539
7613
|
ready: Atom<Promise<{
|
|
@@ -7551,6 +7625,7 @@ declare module 'alinea/dashboard/atoms/root' {
|
|
|
7551
7625
|
explorer: ExplorerAtoms;
|
|
7552
7626
|
constructor(workspace: string, key: string);
|
|
7553
7627
|
createTree(locale: string | null, selectedKeys: Atom<Set<Key>>, expandedKeys?: PrimitiveAtom<Set<string>>): TreeAtoms;
|
|
7628
|
+
treeEntries: (locale: string | null) => Atom<Promise<TreeEntryAtoms[]>>;
|
|
7554
7629
|
children: (parentId: string | null) => ExplorerAtoms;
|
|
7555
7630
|
label: Atom<string>;
|
|
7556
7631
|
icon: Atom<typeof LucideFile | ComponentType>;
|
|
@@ -8766,8 +8841,8 @@ declare module 'alinea/field/link/FileLink' {
|
|
|
8766
8841
|
}
|
|
8767
8842
|
export namespace FileLink {
|
|
8768
8843
|
const title: import("alinea/core/Expr").Expr<string>;
|
|
8769
|
-
const url: import("alinea/
|
|
8770
|
-
const href: import("alinea/
|
|
8844
|
+
const url: import("alinea/core/Expr").Expr<string>;
|
|
8845
|
+
const href: import("alinea/core/Expr").Expr<string>;
|
|
8771
8846
|
const extension: import("alinea/field/hidden").HiddenField<string>;
|
|
8772
8847
|
const size: import("alinea/field/hidden").HiddenField<number>;
|
|
8773
8848
|
}
|
|
@@ -8814,7 +8889,7 @@ declare module 'alinea/field/link/ImageLink' {
|
|
|
8814
8889
|
export namespace ImageLink {
|
|
8815
8890
|
const title: import("alinea/core/Expr").Expr<string>;
|
|
8816
8891
|
const alt: import("alinea/core/media/MediaAltField").MediaAltField;
|
|
8817
|
-
const src: import("alinea/
|
|
8892
|
+
const src: import("alinea/core/Expr").Expr<string>;
|
|
8818
8893
|
const extension: import("alinea/field/hidden").HiddenField<string>;
|
|
8819
8894
|
const size: import("alinea/field/hidden").HiddenField<number>;
|
|
8820
8895
|
const hash: import("alinea/field/hidden").HiddenField<string>;
|