@xnetjs/data 0.0.2
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 +229 -0
- package/dist/canvas-HSIKIQFK.js +7 -0
- package/dist/chunk-2L5ZUGG5.js +53 -0
- package/dist/chunk-4MTS5KAQ.js +22 -0
- package/dist/chunk-BQBPA5HS.js +76 -0
- package/dist/chunk-GZHARFKC.js +25 -0
- package/dist/chunk-IDMBCRUC.js +29 -0
- package/dist/chunk-SZC345Z2.js +2347 -0
- package/dist/chunk-VYR5GPJP.js +39 -0
- package/dist/chunk-WKIKJTI2.js +45 -0
- package/dist/comment-277JD7DV.js +7 -0
- package/dist/database-W3KEHLI3.js +7 -0
- package/dist/database-row-3O2QSNZN.js +7 -0
- package/dist/grant-QVZ454YC.js +7 -0
- package/dist/index.d.ts +4598 -0
- package/dist/index.js +5103 -0
- package/dist/page-O4WTOIEO.js +7 -0
- package/dist/task-SEKAYJH7.js +7 -0
- package/dist/ts-plugin/index.cjs +240 -0
- package/dist/ts-plugin/index.d.cts +46 -0
- package/dist/ts-plugin/index.d.ts +46 -0
- package/dist/ts-plugin/index.js +213 -0
- package/package.json +54 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineSchema,
|
|
3
|
+
relation,
|
|
4
|
+
text
|
|
5
|
+
} from "./chunk-SZC345Z2.js";
|
|
6
|
+
|
|
7
|
+
// src/schema/schemas/database-row.ts
|
|
8
|
+
var DatabaseRowSchema = defineSchema({
|
|
9
|
+
name: "DatabaseRow",
|
|
10
|
+
namespace: "xnet://xnet.fyi/",
|
|
11
|
+
properties: {
|
|
12
|
+
/**
|
|
13
|
+
* Reference to the parent database.
|
|
14
|
+
* This is a typed relation that only accepts Database node IDs.
|
|
15
|
+
*/
|
|
16
|
+
database: relation({
|
|
17
|
+
target: "xnet://xnet.fyi/Database@1.0.0",
|
|
18
|
+
required: true
|
|
19
|
+
}),
|
|
20
|
+
/**
|
|
21
|
+
* Fractional index for row ordering.
|
|
22
|
+
* Uses a string-based fractional indexing scheme (like Figma/Linear)
|
|
23
|
+
* that allows inserting between any two rows without reindexing.
|
|
24
|
+
*
|
|
25
|
+
* @see packages/data/src/database/fractional-index.ts
|
|
26
|
+
*/
|
|
27
|
+
sortKey: text({ required: true })
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Y.Doc for rich text cells.
|
|
31
|
+
* Only created when the row has rich text columns.
|
|
32
|
+
* Each rich text column gets its own Y.XmlFragment in the doc.
|
|
33
|
+
*/
|
|
34
|
+
document: "yjs"
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
DatabaseRowSchema
|
|
39
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineSchema,
|
|
3
|
+
file,
|
|
4
|
+
number,
|
|
5
|
+
select,
|
|
6
|
+
text
|
|
7
|
+
} from "./chunk-SZC345Z2.js";
|
|
8
|
+
|
|
9
|
+
// src/schema/schemas/database.ts
|
|
10
|
+
var DatabaseSchema = defineSchema({
|
|
11
|
+
name: "Database",
|
|
12
|
+
namespace: "xnet://xnet.fyi/",
|
|
13
|
+
properties: {
|
|
14
|
+
/** Database title */
|
|
15
|
+
title: text({ required: true, maxLength: 500 }),
|
|
16
|
+
/** Emoji or icon URL */
|
|
17
|
+
icon: text({}),
|
|
18
|
+
/** Cover image */
|
|
19
|
+
cover: file({ accept: ["image/*"] }),
|
|
20
|
+
/** Default view type for this database */
|
|
21
|
+
defaultView: select({
|
|
22
|
+
options: [
|
|
23
|
+
{ id: "table", name: "Table" },
|
|
24
|
+
{ id: "board", name: "Board" },
|
|
25
|
+
{ id: "list", name: "List" },
|
|
26
|
+
{ id: "gallery", name: "Gallery" },
|
|
27
|
+
{ id: "calendar", name: "Calendar" },
|
|
28
|
+
{ id: "timeline", name: "Timeline" }
|
|
29
|
+
],
|
|
30
|
+
default: "table"
|
|
31
|
+
}),
|
|
32
|
+
/**
|
|
33
|
+
* Cached row count for this database.
|
|
34
|
+
* Updated on row add/delete operations.
|
|
35
|
+
* Used for query routing decisions (local vs hub).
|
|
36
|
+
*/
|
|
37
|
+
rowCount: number({ min: 0, integer: true })
|
|
38
|
+
},
|
|
39
|
+
// Y.Doc for storing columns, views, and other collaborative state
|
|
40
|
+
document: "yjs"
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
DatabaseSchema
|
|
45
|
+
};
|