alinea 1.5.4 → 1.6.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "_id": "36bYvugxw883tiYAmoEtvMRAN3F",
2
+ "_id": "373yWLU9KFZpAOuYXOfaRVWYAMP",
3
3
  "_type": "Page",
4
4
  "_index": "a0",
5
5
  "_seeded": "welcome.json",
@@ -33,7 +33,7 @@ export const cms = createCMS({
33
33
  // Point to your local website
34
34
  development: 'http://localhost:3000',
35
35
  // The production URL of your website
36
- production: process.env.VERCEL_URL ?? 'https://example.com'
36
+ production: 'https://example.com'
37
37
  },
38
38
 
39
39
  // Enable live previews after adding <cms.previews widget /> to your layout
package/dist/LICENSES.md CHANGED
@@ -55,11 +55,11 @@ SOFTWARE.
55
55
 
56
56
  ===
57
57
 
58
- # lib0@0.2.88 (MIT)
58
+ # @headlessui/react@2.2.0 (MIT)
59
59
 
60
- The MIT License (MIT)
60
+ MIT License
61
61
 
62
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
62
+ Copyright (c) 2020 Tailwind Labs
63
63
 
64
64
  Permission is hereby granted, free of charge, to any person obtaining a copy
65
65
  of this software and associated documentation files (the "Software"), to deal
@@ -79,14 +79,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
79
79
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
80
80
  SOFTWARE.
81
81
 
82
-
83
82
  ===
84
83
 
85
- # @headlessui/react@2.2.0 (MIT)
84
+ # lib0@0.2.88 (MIT)
86
85
 
87
- MIT License
86
+ The MIT License (MIT)
88
87
 
89
- Copyright (c) 2020 Tailwind Labs
88
+ Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
90
89
 
91
90
  Permission is hereby granted, free of charge, to any person obtaining a copy
92
91
  of this software and associated documentation files (the "Software"), to deal
@@ -106,6 +105,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106
105
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
107
106
  SOFTWARE.
108
107
 
108
+
109
109
  ===
110
110
 
111
111
  # htmlparser2@9.1.0 (MIT)
@@ -131,7 +131,7 @@ IN THE SOFTWARE.
131
131
 
132
132
  ===
133
133
 
134
- # domhandler@5.0.3 (BSD-2-Clause)
134
+ # domutils@3.1.0 (BSD-2-Clause)
135
135
 
136
136
  Copyright (c) Felix Böhm
137
137
  All rights reserved.
@@ -148,24 +148,33 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
148
148
 
149
149
  ===
150
150
 
151
- # domutils@3.1.0 (BSD-2-Clause)
151
+ # @popperjs/core@2.11.8 (MIT)
152
152
 
153
- Copyright (c) Felix Böhm
154
- All rights reserved.
153
+ The MIT License (MIT)
155
154
 
156
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
155
+ Copyright (c) 2019 Federico Zivolo
157
156
 
158
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
157
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
158
+ this software and associated documentation files (the "Software"), to deal in
159
+ the Software without restriction, including without limitation the rights to
160
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
161
+ the Software, and to permit persons to whom the Software is furnished to do so,
162
+ subject to the following conditions:
159
163
 
160
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
164
+ The above copyright notice and this permission notice shall be included in all
165
+ copies or substantial portions of the Software.
161
166
 
162
- THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
163
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
167
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
168
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
169
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
170
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
171
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
172
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
164
173
 
165
174
 
166
175
  ===
167
176
 
168
- # entities@4.5.0 (BSD-2-Clause)
177
+ # domhandler@5.0.3 (BSD-2-Clause)
169
178
 
170
179
  Copyright (c) Felix Böhm
171
180
  All rights reserved.
@@ -182,28 +191,19 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
182
191
 
183
192
  ===
184
193
 
185
- # @popperjs/core@2.11.8 (MIT)
194
+ # entities@4.5.0 (BSD-2-Clause)
186
195
 
187
- The MIT License (MIT)
196
+ Copyright (c) Felix Böhm
197
+ All rights reserved.
188
198
 
189
- Copyright (c) 2019 Federico Zivolo
199
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
190
200
 
191
- Permission is hereby granted, free of charge, to any person obtaining a copy of
192
- this software and associated documentation files (the "Software"), to deal in
193
- the Software without restriction, including without limitation the rights to
194
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
195
- the Software, and to permit persons to whom the Software is furnished to do so,
196
- subject to the following conditions:
201
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
197
202
 
198
- The above copyright notice and this permission notice shall be included in all
199
- copies or substantial portions of the Software.
203
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
200
204
 
201
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
202
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
203
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
204
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
205
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
206
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
205
+ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
206
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
207
207
 
208
208
 
209
209
  ===
@@ -467,33 +467,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
467
467
  SOFTWARE.
468
468
 
469
469
 
470
- ===
471
-
472
- # react-is@16.13.1 (MIT)
473
-
474
- MIT License
475
-
476
- Copyright (c) Facebook, Inc. and its affiliates.
477
-
478
- Permission is hereby granted, free of charge, to any person obtaining a copy
479
- of this software and associated documentation files (the "Software"), to deal
480
- in the Software without restriction, including without limitation the rights
481
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
482
- copies of the Software, and to permit persons to whom the Software is
483
- furnished to do so, subject to the following conditions:
484
-
485
- The above copyright notice and this permission notice shall be included in all
486
- copies or substantial portions of the Software.
487
-
488
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
489
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
490
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
491
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
492
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
493
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
494
- SOFTWARE.
495
-
496
-
497
470
  ===
498
471
 
499
472
  # dom-serializer@2.0.0 (MIT)
@@ -513,23 +486,11 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
513
486
 
514
487
  ===
515
488
 
516
- # @headless-tree/react@0.0.15 (MIT)
517
-
518
- MIT
519
-
520
- ===
521
-
522
- # @headless-tree/core@0.0.15 (MIT)
523
-
524
- MIT
525
-
526
- ===
527
-
528
- # y-prosemirror@1.2.15 (MIT)
489
+ # react-is@16.13.1 (MIT)
529
490
 
530
- The MIT License (MIT)
491
+ MIT License
531
492
 
532
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
493
+ Copyright (c) Facebook, Inc. and its affiliates.
533
494
 
534
495
  Permission is hereby granted, free of charge, to any person obtaining a copy
535
496
  of this software and associated documentation files (the "Software"), to deal
@@ -550,6 +511,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
550
511
  SOFTWARE.
551
512
 
552
513
 
514
+ ===
515
+
516
+ # @headless-tree/core@0.0.15 (MIT)
517
+
518
+ MIT
519
+
520
+ ===
521
+
522
+ # @headless-tree/react@0.0.15 (MIT)
523
+
524
+ MIT
525
+
553
526
  ===
554
527
 
555
528
  # @babel/runtime@7.25.4 (MIT)
@@ -578,6 +551,33 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
578
551
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
579
552
 
580
553
 
554
+ ===
555
+
556
+ # y-prosemirror@1.2.15 (MIT)
557
+
558
+ The MIT License (MIT)
559
+
560
+ Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
561
+
562
+ Permission is hereby granted, free of charge, to any person obtaining a copy
563
+ of this software and associated documentation files (the "Software"), to deal
564
+ in the Software without restriction, including without limitation the rights
565
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
566
+ copies of the Software, and to permit persons to whom the Software is
567
+ furnished to do so, subject to the following conditions:
568
+
569
+ The above copyright notice and this permission notice shall be included in all
570
+ copies or substantial portions of the Software.
571
+
572
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
573
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
574
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
575
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
576
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
577
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
578
+ SOFTWARE.
579
+
580
+
581
581
  ===
582
582
 
583
583
  # @react-aria/focus@3.19.1 (Apache-2.0)
package/dist/bundled.d.ts CHANGED
@@ -1419,55 +1419,120 @@ declare module 'alinea/core/db/EntryIndex' {
1419
1419
  import type { ChangesBatch } from 'alinea/core/source/Change';
1420
1420
  import { type Source } from 'alinea/core/source/Source';
1421
1421
  import { ReadonlyTree } from 'alinea/core/source/Tree';
1422
+ import { Type } from 'alinea/core/Type';
1422
1423
  import { EntryTransaction } from 'alinea/core/db/EntryTransaction';
1423
1424
  export interface EntryFilter {
1424
1425
  ids?: ReadonlyArray<string>;
1425
1426
  search?: string;
1426
- condition?: (entry: Entry) => boolean;
1427
+ condition?(entry: Entry): boolean;
1428
+ }
1429
+ export interface EntryCondition {
1430
+ search?: string;
1431
+ nodes?: Iterable<EntryNode>;
1432
+ node?(node: EntryNode): boolean;
1433
+ language?(language: EntryLanguageNode): boolean;
1434
+ entry?(entry: Entry): boolean;
1435
+ }
1436
+ export function combineConditions(a: EntryCondition, b: EntryCondition): EntryCondition;
1437
+ interface EntryVersionData {
1438
+ id: string;
1439
+ type: string;
1440
+ index: string;
1441
+ searchableText: string;
1442
+ title: string;
1443
+ data: Record<string, unknown>;
1444
+ seeded: string | null;
1445
+ rowHash: string;
1446
+ fileHash: string;
1447
+ }
1448
+ interface EntryVersion extends EntryVersionData {
1449
+ locale: string | null;
1450
+ workspace: string;
1451
+ root: string;
1452
+ path: string;
1453
+ status: EntryStatus;
1454
+ parentDir: string;
1455
+ childrenDir: string;
1456
+ filePath: string;
1457
+ level: number;
1458
+ }
1459
+ class EntryLanguage extends Map<EntryStatus, EntryVersion> {
1460
+ readonly locale: string | null;
1461
+ readonly parentDir: string;
1462
+ readonly selfDir: string;
1463
+ constructor(versions: Array<EntryVersion>);
1464
+ }
1465
+ class EntryCollection extends Map<string | null, EntryLanguage> {
1466
+ versions: Array<EntryVersion>;
1467
+ readonly type: string;
1468
+ constructor(versions: Array<EntryVersion>);
1469
+ }
1470
+ class EntryLanguageNode {
1471
+ #private;
1472
+ private node;
1473
+ private language;
1474
+ inheritedStatus: EntryStatus | undefined;
1475
+ main: EntryVersion;
1476
+ active: EntryVersion;
1477
+ url: string;
1478
+ locale: string | null;
1479
+ path: string;
1480
+ readonly seeded: string | null;
1481
+ constructor(node: EntryNode, language: EntryLanguage);
1482
+ [Symbol.iterator](): MapIterator<[EntryStatus, EntryVersion]>;
1483
+ has(status: EntryStatus): boolean;
1484
+ get parentPaths(): string[];
1485
+ get entries(): Entry<Record<string, unknown>>[];
1486
+ filter(filter: EntryCondition): Generator<Entry>;
1487
+ }
1488
+ export class EntryNode extends Map<string | null, EntryLanguageNode> {
1489
+ entryType: Type;
1490
+ parent: EntryNode | null;
1491
+ children: () => Iterable<EntryNode>;
1492
+ readonly id: string;
1493
+ readonly index: string;
1494
+ readonly parentId: string | null;
1495
+ readonly parents: Array<string>;
1496
+ readonly workspace: string;
1497
+ readonly root: string;
1498
+ readonly type: string;
1499
+ readonly level: number;
1500
+ constructor(entryType: Type, parent: EntryNode | null, children: () => Iterable<EntryNode>, collection: EntryCollection);
1501
+ filter(filter: EntryCondition): Generator<Entry>;
1502
+ }
1503
+ export class EntryGraph {
1504
+ #private;
1505
+ nodes: Array<EntryNode>;
1506
+ constructor(config: Config, versionData: Map<string, EntryVersionData>, seeds: Map<string, Seed>);
1507
+ byId(id: string): EntryNode | undefined;
1508
+ byDir(dir: string): EntryNode | undefined;
1509
+ withChanges(batch: ChangesBatch): EntryGraph;
1510
+ filter({ search, ...filter }: EntryCondition): Generator<Entry>;
1427
1511
  }
1428
1512
  export class EntryIndex extends EventTarget {
1429
1513
  #private;
1430
1514
  tree: ReadonlyTree;
1431
- entries: Entry[];
1432
- byPath: Map<string, EntryNode>;
1433
- byId: Map<string, EntryNode>;
1434
1515
  initialSync: ReadonlyTree | undefined;
1516
+ graph: EntryGraph;
1435
1517
  constructor(config: Config);
1436
1518
  get sha(): string;
1519
+ filter(filter: EntryCondition): Iterable<Entry>;
1437
1520
  findFirst<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Entry<T> | undefined;
1438
- findMany<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Iterable<Entry<T>>;
1439
- filter({ ids, search, condition }: EntryFilter, preview?: Entry): Array<Entry>;
1521
+ findMany(filter: (entry: Entry) => boolean): Iterable<Entry>;
1440
1522
  syncWith(source: Source): Promise<string>;
1441
- fix(source: Source): Promise<void>;
1523
+ indexChanges(batch: ChangesBatch): Promise<string>;
1442
1524
  seed(source: Source): Promise<void>;
1525
+ byId(id: string): EntryNode | undefined;
1526
+ fix(source: Source): Promise<void>;
1443
1527
  transaction(source: Source): Promise<EntryTransaction>;
1444
- indexChanges(batch: ChangesBatch): Promise<string>;
1445
- updateSearch(entry: Entry): Promise<void>;
1446
- }
1447
- class Versions extends Map<EntryStatus, Entry> {
1448
- inheritedStatus: EntryStatus | undefined;
1449
- setInherited(parentStatus: EntryStatus | undefined): void;
1450
- get active(): Entry<Record<string, unknown>> | undefined;
1451
- get main(): Entry<Record<string, unknown>> | undefined;
1452
- versions(): Generator<Entry>;
1453
1528
  }
1454
- class EntryNode {
1455
- #private;
1456
- id: string;
1529
+ interface Seed {
1530
+ seedId: string;
1457
1531
  type: string;
1458
- byFile: Map<string, Entry<Record<string, unknown>>>;
1459
- locales: Map<string | null, Versions>;
1460
- constructor(config: Config, from: Entry);
1461
- get index(): string;
1462
- get parentId(): string | null;
1463
- get workspace(): string;
1464
- get root(): string;
1465
- get entries(): Entry<Record<string, unknown>>[];
1466
- pathOf(locale: string | null): string | undefined;
1467
- add(entry: Entry, parent: EntryNode | undefined): void;
1468
- sync(byId: Map<string, EntryNode>): void;
1469
- has(filePath: string): boolean;
1470
- remove(filePath: string): number;
1532
+ workspace: string;
1533
+ root: string;
1534
+ locale: string | null;
1535
+ data: Record<string, any>;
1471
1536
  }
1472
1537
  export {};
1473
1538
 
@@ -1489,7 +1554,7 @@ declare module 'alinea/core/db/EntryResolver' {
1489
1554
  import { type AnyQueryResult, type Edge, type EdgeQuery, type GraphQuery, type Projection, type Status } from 'alinea/core/Graph';
1490
1555
  import { type HasExpr } from 'alinea/core/Internal';
1491
1556
  import type { Resolver } from 'alinea/core/Resolver';
1492
- import type { EntryFilter, EntryIndex } from 'alinea/core/db/EntryIndex';
1557
+ import { type EntryCondition, type EntryFilter, type EntryGraph, type EntryIndex } from 'alinea/core/db/EntryIndex';
1493
1558
  import { LinkResolver } from 'alinea/core/db/LinkResolver';
1494
1559
  type Interim = any;
1495
1560
  export interface PostContext {
@@ -1507,12 +1572,12 @@ declare module 'alinea/core/db/EntryResolver' {
1507
1572
  expr(ctx: ResolveContext, entry: Entry, expr: Expr): unknown;
1508
1573
  projectTypes(types: Array<Type>): Array<[string, Expr]>;
1509
1574
  projection(query: GraphQuery<Projection>): Projection;
1510
- sourceFilter(entry: Entry, query: EdgeQuery): EntryFilter;
1575
+ sourceFilter(ctx: ResolveContext, entry: Entry, query: EdgeQuery): EntryCondition;
1511
1576
  selectProjection(ctx: ResolveContext, entry: Entry, value: Projection): unknown;
1512
1577
  select(ctx: ResolveContext, entry: Entry | null, query: GraphQuery<Projection>): unknown;
1513
1578
  condition(ctx: ResolveContext, query: EdgeQuery): EntryFilter;
1514
1579
  isSingleResult(query: GraphQuery & Partial<Edge>): boolean;
1515
- query(ctx: ResolveContext, query: GraphQuery<Projection>, preFilter?: EntryFilter): {
1580
+ query(ctx: ResolveContext, query: GraphQuery<Projection>, preFilter?: EntryCondition): {
1516
1581
  entries: Entry<Record<string, unknown>>[];
1517
1582
  getUnprocessed: () => unknown;
1518
1583
  getProcessed: () => Promise<any>;
@@ -1526,7 +1591,7 @@ declare module 'alinea/core/db/EntryResolver' {
1526
1591
  export interface ResolveContext {
1527
1592
  status: Status;
1528
1593
  locale?: string | null;
1529
- preview: Entry | undefined;
1594
+ graph: EntryGraph;
1530
1595
  searchTerms?: string;
1531
1596
  }
1532
1597
  export function statusChecker(status: Status): Check;
@@ -2,7 +2,7 @@
2
2
  var package_default = {
3
3
  bin: "./dist/cli.js",
4
4
  name: "alinea",
5
- version: "1.5.4",
5
+ version: "1.6.1",
6
6
  description: "Headless git-based CMS",
7
7
  repository: {
8
8
  type: "git",
package/dist/cli/Serve.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-F7QQQJ6Z.js";
3
+ } from "../chunks/chunk-FYKOIMF4.js";
4
4
  import "../chunks/chunk-NZLE2WMY.js";
5
5
 
6
6
  // src/cli/Serve.ts
package/dist/cli/bin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-F7QQQJ6Z.js";
3
+ } from "../chunks/chunk-FYKOIMF4.js";
4
4
  import "../chunks/chunk-NZLE2WMY.js";
5
5
 
6
6
  // node_modules/mri/lib/index.mjs
@@ -33,7 +33,7 @@ export const cms = createCMS({
33
33
  // Point to your local website
34
34
  development: 'http://localhost:3000',
35
35
  // The production URL of your website
36
- production: process.env.VERCEL_URL ?? 'https://example.com'
36
+ production: 'https://example.com'
37
37
  },
38
38
 
39
39
  // Enable live previews after adding <cms.previews widget /> to your layout
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-F7QQQJ6Z.js";
3
+ } from "../chunks/chunk-FYKOIMF4.js";
4
4
  import "../chunks/chunk-NZLE2WMY.js";
5
5
 
6
6
  // src/cloud/CloudRemote.ts
@@ -1,56 +1,121 @@
1
- import { Config } from 'alinea/core/Config';
2
- import type { Entry, EntryStatus } from 'alinea/core/Entry';
1
+ import { Config } from '../Config.js';
2
+ import type { Entry, EntryStatus } from '../Entry.js';
3
3
  import type { ChangesBatch } from '../source/Change.js';
4
4
  import { type Source } from '../source/Source.js';
5
5
  import { ReadonlyTree } from '../source/Tree.js';
6
+ import { Type } from '../Type.js';
6
7
  import { EntryTransaction } from './EntryTransaction.js';
7
8
  export interface EntryFilter {
8
9
  ids?: ReadonlyArray<string>;
9
10
  search?: string;
10
- condition?: (entry: Entry) => boolean;
11
+ condition?(entry: Entry): boolean;
12
+ }
13
+ export interface EntryCondition {
14
+ search?: string;
15
+ nodes?: Iterable<EntryNode>;
16
+ node?(node: EntryNode): boolean;
17
+ language?(language: EntryLanguageNode): boolean;
18
+ entry?(entry: Entry): boolean;
19
+ }
20
+ export declare function combineConditions(a: EntryCondition, b: EntryCondition): EntryCondition;
21
+ interface EntryVersionData {
22
+ id: string;
23
+ type: string;
24
+ index: string;
25
+ searchableText: string;
26
+ title: string;
27
+ data: Record<string, unknown>;
28
+ seeded: string | null;
29
+ rowHash: string;
30
+ fileHash: string;
31
+ }
32
+ interface EntryVersion extends EntryVersionData {
33
+ locale: string | null;
34
+ workspace: string;
35
+ root: string;
36
+ path: string;
37
+ status: EntryStatus;
38
+ parentDir: string;
39
+ childrenDir: string;
40
+ filePath: string;
41
+ level: number;
42
+ }
43
+ declare class EntryLanguage extends Map<EntryStatus, EntryVersion> {
44
+ readonly locale: string | null;
45
+ readonly parentDir: string;
46
+ readonly selfDir: string;
47
+ constructor(versions: Array<EntryVersion>);
48
+ }
49
+ declare class EntryCollection extends Map<string | null, EntryLanguage> {
50
+ versions: Array<EntryVersion>;
51
+ readonly type: string;
52
+ constructor(versions: Array<EntryVersion>);
53
+ }
54
+ declare class EntryLanguageNode {
55
+ #private;
56
+ private node;
57
+ private language;
58
+ inheritedStatus: EntryStatus | undefined;
59
+ main: EntryVersion;
60
+ active: EntryVersion;
61
+ url: string;
62
+ locale: string | null;
63
+ path: string;
64
+ readonly seeded: string | null;
65
+ constructor(node: EntryNode, language: EntryLanguage);
66
+ [Symbol.iterator](): MapIterator<[EntryStatus, EntryVersion]>;
67
+ has(status: EntryStatus): boolean;
68
+ get parentPaths(): string[];
69
+ get entries(): Entry<Record<string, unknown>>[];
70
+ filter(filter: EntryCondition): Generator<Entry>;
71
+ }
72
+ export declare class EntryNode extends Map<string | null, EntryLanguageNode> {
73
+ entryType: Type;
74
+ parent: EntryNode | null;
75
+ children: () => Iterable<EntryNode>;
76
+ readonly id: string;
77
+ readonly index: string;
78
+ readonly parentId: string | null;
79
+ readonly parents: Array<string>;
80
+ readonly workspace: string;
81
+ readonly root: string;
82
+ readonly type: string;
83
+ readonly level: number;
84
+ constructor(entryType: Type, parent: EntryNode | null, children: () => Iterable<EntryNode>, collection: EntryCollection);
85
+ filter(filter: EntryCondition): Generator<Entry>;
86
+ }
87
+ export declare class EntryGraph {
88
+ #private;
89
+ nodes: Array<EntryNode>;
90
+ constructor(config: Config, versionData: Map<string, EntryVersionData>, seeds: Map<string, Seed>);
91
+ byId(id: string): EntryNode | undefined;
92
+ byDir(dir: string): EntryNode | undefined;
93
+ withChanges(batch: ChangesBatch): EntryGraph;
94
+ filter({ search, ...filter }: EntryCondition): Generator<Entry>;
11
95
  }
12
96
  export declare class EntryIndex extends EventTarget {
13
97
  #private;
14
98
  tree: ReadonlyTree;
15
- entries: Entry[];
16
- byPath: Map<string, EntryNode>;
17
- byId: Map<string, EntryNode>;
18
99
  initialSync: ReadonlyTree | undefined;
100
+ graph: EntryGraph;
19
101
  constructor(config: Config);
20
102
  get sha(): string;
103
+ filter(filter: EntryCondition): Iterable<Entry>;
21
104
  findFirst<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Entry<T> | undefined;
22
- findMany<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Iterable<Entry<T>>;
23
- filter({ ids, search, condition }: EntryFilter, preview?: Entry): Array<Entry>;
105
+ findMany(filter: (entry: Entry) => boolean): Iterable<Entry>;
24
106
  syncWith(source: Source): Promise<string>;
25
- fix(source: Source): Promise<void>;
107
+ indexChanges(batch: ChangesBatch): Promise<string>;
26
108
  seed(source: Source): Promise<void>;
109
+ byId(id: string): EntryNode | undefined;
110
+ fix(source: Source): Promise<void>;
27
111
  transaction(source: Source): Promise<EntryTransaction>;
28
- indexChanges(batch: ChangesBatch): Promise<string>;
29
- updateSearch(entry: Entry): Promise<void>;
30
- }
31
- declare class Versions extends Map<EntryStatus, Entry> {
32
- inheritedStatus: EntryStatus | undefined;
33
- setInherited(parentStatus: EntryStatus | undefined): void;
34
- get active(): Entry<Record<string, unknown>> | undefined;
35
- get main(): Entry<Record<string, unknown>> | undefined;
36
- versions(): Generator<Entry>;
37
112
  }
38
- declare class EntryNode {
39
- #private;
40
- id: string;
113
+ interface Seed {
114
+ seedId: string;
41
115
  type: string;
42
- byFile: Map<string, Entry<Record<string, unknown>>>;
43
- locales: Map<string | null, Versions>;
44
- constructor(config: Config, from: Entry);
45
- get index(): string;
46
- get parentId(): string | null;
47
- get workspace(): string;
48
- get root(): string;
49
- get entries(): Entry<Record<string, unknown>>[];
50
- pathOf(locale: string | null): string | undefined;
51
- add(entry: Entry, parent: EntryNode | undefined): void;
52
- sync(byId: Map<string, EntryNode>): void;
53
- has(filePath: string): boolean;
54
- remove(filePath: string): number;
116
+ workspace: string;
117
+ root: string;
118
+ locale: string | null;
119
+ data: Record<string, any>;
55
120
  }
56
121
  export {};