@dxos/react-ui-table 0.8.3 → 0.8.4-main.28f8d3d
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/lib/browser/chunk-L2LSB6KV.mjs +18 -0
- package/dist/lib/browser/chunk-L2LSB6KV.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZAOSIG3L.mjs +1814 -0
- package/dist/lib/browser/chunk-ZAOSIG3L.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +728 -2104
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +123 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -5
- package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs +20 -0
- package/dist/lib/node-esm/chunk-NXZ4CJYX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZOFFI3JJ.mjs +1815 -0
- package/dist/lib/node-esm/chunk-ZOFFI3JJ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +728 -2104
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +124 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -5
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts +4 -2
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts +1 -1
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/{relations.stories.d.ts → Relations.stories.d.ts} +2 -2
- package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -0
- package/dist/types/src/components/Table/RowActionsMenu.d.ts +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts +1 -0
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts +2 -1
- package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts +2 -1
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +8 -7
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/extension.d.ts.map +1 -1
- package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
- package/dist/types/src/components/testing.d.ts +3 -40
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAddRow.d.ts +13 -0
- package/dist/types/src/hooks/useAddRow.d.ts.map +1 -0
- package/dist/types/src/hooks/useTableModel.d.ts +8 -7
- package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/model/modal-controller.d.ts.map +1 -1
- package/dist/types/src/model/selection-model.d.ts +2 -1
- package/dist/types/src/model/selection-model.d.ts.map +1 -1
- package/dist/types/src/model/table-model.d.ts +58 -21
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts +10 -1
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/model/table-sorting.d.ts +4 -4
- package/dist/types/src/model/table-sorting.d.ts.map +1 -1
- package/dist/types/src/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/useTestTableModel.d.ts +41 -0
- package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +5 -6
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +8 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/util/dynamic-table.d.ts +3 -4
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/table-buttons.d.ts +15 -1
- package/dist/types/src/util/table-buttons.d.ts.map +1 -1
- package/dist/types/src/util/table-controls.d.ts.map +1 -1
- package/dist/types/src/util/table.d.ts +9 -11
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +52 -40
- package/src/components/Table/ColumnActionsMenu.tsx +1 -1
- package/src/components/Table/ColumnSettings.tsx +15 -11
- package/src/components/Table/CreateRefPanel.tsx +6 -4
- package/src/components/Table/DynamicTable.stories.tsx +4 -3
- package/src/components/Table/DynamicTable.tsx +17 -10
- package/src/components/Table/{relations.stories.tsx → Relations.stories.tsx} +37 -37
- package/src/components/Table/RowActionsMenu.tsx +3 -3
- package/src/components/Table/Table.stories.tsx +109 -148
- package/src/components/Table/Table.tsx +95 -66
- package/src/components/TableCellEditor/CellValidationMessage.tsx +7 -2
- package/src/components/TableCellEditor/FormCellEditor.tsx +30 -21
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +27 -30
- package/src/components/TableCellEditor/TableCellEditor.tsx +88 -34
- package/src/components/TableCellEditor/extension.ts +2 -2
- package/src/components/TableToolbar/TableToolbar.tsx +2 -2
- package/src/components/testing.ts +7 -24
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAddRow.ts +36 -0
- package/src/hooks/useTableModel.ts +21 -17
- package/src/index.ts +1 -2
- package/src/model/modal-controller.ts +1 -1
- package/src/model/selection-model.ts +6 -3
- package/src/model/table-model.test.ts +8 -8
- package/src/model/table-model.ts +278 -86
- package/src/model/table-presentation.test.ts +8 -8
- package/src/model/table-presentation.ts +240 -135
- package/src/model/table-sorting.ts +11 -11
- package/src/playwright/playwright.config.ts +17 -0
- package/src/playwright/smoke.spec.ts +113 -20
- package/src/testing/index.ts +5 -0
- package/src/testing/useTestTableModel.ts +123 -0
- package/src/translations.ts +7 -5
- package/src/types/index.ts +2 -2
- package/src/types/schema.ts +16 -0
- package/src/util/dynamic-table.ts +20 -18
- package/src/util/schema.ts +1 -1
- package/src/util/table-buttons.ts +26 -2
- package/src/util/table-controls.ts +4 -1
- package/src/util/table.ts +37 -111
- package/dist/lib/browser/chunk-TL7CKQQV.mjs +0 -27
- package/dist/lib/browser/chunk-TL7CKQQV.mjs.map +0 -7
- package/dist/lib/node/chunk-O2VPBNS5.cjs +0 -50
- package/dist/lib/node/chunk-O2VPBNS5.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -2739
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/types/index.cjs +0 -31
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-GBT6GD4G.mjs +0 -29
- package/dist/lib/node-esm/chunk-GBT6GD4G.mjs.map +0 -7
- package/dist/types/src/components/Table/relations.stories.d.ts.map +0 -1
- package/dist/types/src/types/table.d.ts +0 -56
- package/dist/types/src/types/table.d.ts.map +0 -1
- package/src/playwright/playwright.config.cts +0 -18
- package/src/types/table.ts +0 -27
package/src/util/table.ts
CHANGED
|
@@ -2,126 +2,52 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Match } from 'effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type JsonPath,
|
|
12
|
-
type JsonProp,
|
|
13
|
-
Ref,
|
|
14
|
-
TypedObject,
|
|
15
|
-
TypeEnum,
|
|
16
|
-
} from '@dxos/echo-schema';
|
|
17
|
-
import { type Client, PublicKey } from '@dxos/react-client';
|
|
18
|
-
import { live, type Space } from '@dxos/react-client/echo';
|
|
19
|
-
import { createFieldId, createView, getSchemaProperties, ViewProjection, type ViewType } from '@dxos/schema';
|
|
7
|
+
import { Obj } from '@dxos/echo';
|
|
8
|
+
import { type JsonPath, type JsonSchemaType, toEffectSchema } from '@dxos/echo-schema';
|
|
9
|
+
import { type SimpleType } from '@dxos/effect';
|
|
10
|
+
import { type CreateViewFromSpaceProps, type DataType, createViewFromSpace, getSchemaProperties } from '@dxos/schema';
|
|
20
11
|
|
|
21
|
-
import {
|
|
12
|
+
import { TableView } from '../types';
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
client: Client;
|
|
26
|
-
space: Space;
|
|
27
|
-
table: TableType;
|
|
28
|
-
typename?: string;
|
|
29
|
-
initialRow?: boolean;
|
|
14
|
+
type CreateTableProps = Omit<CreateViewFromSpaceProps, 'presentation'> & {
|
|
15
|
+
sizes?: Record<string, number>;
|
|
30
16
|
};
|
|
31
17
|
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
18
|
+
export const createTable = async ({
|
|
19
|
+
sizes,
|
|
20
|
+
...props
|
|
21
|
+
}: CreateTableProps): Promise<{
|
|
22
|
+
jsonSchema: JsonSchemaType;
|
|
23
|
+
view: DataType.View;
|
|
24
|
+
schema: ReturnType<typeof toEffectSchema>;
|
|
25
|
+
}> => {
|
|
26
|
+
const table = Obj.make(TableView, { sizes: {} });
|
|
27
|
+
const { jsonSchema, view } = await createViewFromSpace({ ...props, presentation: table });
|
|
28
|
+
|
|
29
|
+
// Preset sizes.
|
|
30
|
+
const schema = toEffectSchema(jsonSchema);
|
|
31
|
+
const shouldIncludeId = props.fields?.find((field) => field === 'id') !== undefined;
|
|
32
|
+
const properties = getSchemaProperties(schema.ast, {}, shouldIncludeId);
|
|
33
|
+
for (const property of properties) {
|
|
34
|
+
if (sizes?.[property.name]) {
|
|
35
|
+
table.sizes[property.name as JsonPath] = sizes[property.name];
|
|
36
|
+
continue;
|
|
43
37
|
}
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
createView({
|
|
49
|
-
// TODO(ZaymonFC): Don't hardcode name?
|
|
50
|
-
name: 'View',
|
|
51
|
-
typename: schema.typename,
|
|
52
|
-
jsonSchema: schema.jsonSchema,
|
|
53
|
-
fields,
|
|
39
|
+
Match.type<SimpleType>().pipe(
|
|
40
|
+
Match.when('boolean', () => {
|
|
41
|
+
table.sizes[property.name as JsonPath] = 100;
|
|
54
42
|
}),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return schema;
|
|
58
|
-
} else {
|
|
59
|
-
const [schema] = await space.db.schemaRegistry.register([createContactSchema()]);
|
|
60
|
-
const fields = ContactFields;
|
|
61
|
-
|
|
62
|
-
table.view = Ref.make(
|
|
63
|
-
createView({
|
|
64
|
-
name: 'View',
|
|
65
|
-
typename: schema.typename,
|
|
66
|
-
jsonSchema: schema.jsonSchema,
|
|
67
|
-
fields,
|
|
43
|
+
Match.when('number', () => {
|
|
44
|
+
table.sizes[property.name as JsonPath] = 100;
|
|
68
45
|
}),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (initialRow) {
|
|
74
|
-
// TODO(burdon): Last (first) row should not be in db and should be managed by the model.
|
|
75
|
-
space.db.add(live(schema, {}));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return schema;
|
|
46
|
+
Match.orElse(() => {
|
|
47
|
+
// Noop.
|
|
48
|
+
}),
|
|
49
|
+
)(property.type);
|
|
79
50
|
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const createContactSchema = () =>
|
|
83
|
-
TypedObject({
|
|
84
|
-
typename: `example.com/type/${PublicKey.random().truncate()}`,
|
|
85
|
-
version: '0.1.0',
|
|
86
|
-
})({
|
|
87
|
-
name: Schema.optional(Schema.String).annotations({ title: 'Name' }),
|
|
88
|
-
active: Schema.optional(Schema.Boolean).annotations({ title: 'Active' }),
|
|
89
|
-
email: Schema.optional(Format.Email),
|
|
90
|
-
salary: Schema.optional(Format.Currency()).annotations({ title: 'Salary' }),
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const ContactFields = ['name', 'email', 'salary', 'active'];
|
|
94
|
-
|
|
95
|
-
const createProjection = (schema: EchoSchema, view: ViewType): ViewProjection => {
|
|
96
|
-
const projection = new ViewProjection(schema.jsonSchema, view);
|
|
97
|
-
projection.setFieldProjection({
|
|
98
|
-
field: {
|
|
99
|
-
id: view.fields.find((f) => f.path === 'salary')!.id,
|
|
100
|
-
path: 'salary' as JsonPath,
|
|
101
|
-
size: 150,
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
projection.setFieldProjection({
|
|
105
|
-
field: {
|
|
106
|
-
id: view.fields.find((f) => f.path === 'active')!.id,
|
|
107
|
-
path: 'active' as JsonPath,
|
|
108
|
-
size: 100,
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
projection.setFieldProjection({
|
|
112
|
-
field: {
|
|
113
|
-
id: createFieldId(),
|
|
114
|
-
path: 'manager' as JsonPath,
|
|
115
|
-
referencePath: 'name' as JsonPath,
|
|
116
|
-
},
|
|
117
|
-
props: {
|
|
118
|
-
property: 'manager' as JsonProp,
|
|
119
|
-
type: TypeEnum.Ref,
|
|
120
|
-
format: FormatEnum.Ref,
|
|
121
|
-
referenceSchema: schema.typename,
|
|
122
|
-
title: 'Manager',
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
51
|
|
|
126
|
-
return
|
|
52
|
+
return { jsonSchema, schema, view };
|
|
127
53
|
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// packages/ui/react-ui-table/src/types/table.ts
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { Type } from "@dxos/echo";
|
|
4
|
-
import { ObjectId, Ref, Expando, LabelAnnotation } from "@dxos/echo-schema";
|
|
5
|
-
import { ViewType } from "@dxos/schema";
|
|
6
|
-
var TableSchema = Schema.Struct({
|
|
7
|
-
id: ObjectId,
|
|
8
|
-
name: Schema.optional(Schema.String),
|
|
9
|
-
view: Schema.optional(Ref(ViewType)),
|
|
10
|
-
// TODO(burdon): Document why threads is included here?
|
|
11
|
-
threads: Schema.optional(Schema.Array(Ref(
|
|
12
|
-
Expando
|
|
13
|
-
/* ThreadType */
|
|
14
|
-
)))
|
|
15
|
-
}).pipe(LabelAnnotation.set([
|
|
16
|
-
"name"
|
|
17
|
-
]));
|
|
18
|
-
var TableType = TableSchema.pipe(Type.Obj({
|
|
19
|
-
typename: "dxos.org/type/Table",
|
|
20
|
-
version: "0.1.0"
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
TableSchema,
|
|
25
|
-
TableType
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=chunk-TL7CKQQV.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/table.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\n// import { ThreadType } from '@dxos/plugin-space/types';\nimport { Type } from '@dxos/echo';\nimport { ObjectId, Ref, Expando, LabelAnnotation } from '@dxos/echo-schema';\nimport { ViewType } from '@dxos/schema';\n\nexport const TableSchema = Schema.Struct({\n id: ObjectId,\n name: Schema.optional(Schema.String),\n view: Schema.optional(Ref(ViewType)),\n // TODO(burdon): Document why threads is included here?\n threads: Schema.optional(Schema.Array(Ref(Expando /* ThreadType */))),\n}).pipe(LabelAnnotation.set(['name']));\n\n// TODO(burdon): Move out of react-ui-xxx.\nexport const TableType = TableSchema.pipe(\n Type.Obj({\n typename: 'dxos.org/type/Table',\n version: '0.1.0',\n }),\n);\nexport interface TableType extends Schema.Schema.Type<typeof TableType> {}\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;AAGvB,SAASC,YAAY;AACrB,SAASC,UAAUC,KAAKC,SAASC,uBAAuB;AACxD,SAASC,gBAAgB;AAElB,IAAMC,cAAcC,OAAOC,OAAO;EACvCC,IAAIC;EACJC,MAAMJ,OAAOK,SAASL,OAAOM,MAAM;EACnCC,MAAMP,OAAOK,SAASG,IAAIC,QAAAA,CAAAA;;EAE1BC,SAASV,OAAOK,SAASL,OAAOW,MAAMH;IAAII;;EAAsB,CAAA,CAAA;AAClE,CAAA,EAAGC,KAAKC,gBAAgBC,IAAI;EAAC;CAAO,CAAA;AAG7B,IAAMC,YAAYjB,YAAYc,KACnCI,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
|
|
6
|
-
"names": ["Schema", "Type", "ObjectId", "Ref", "Expando", "LabelAnnotation", "ViewType", "TableSchema", "Schema", "Struct", "id", "ObjectId", "name", "optional", "String", "view", "Ref", "ViewType", "threads", "Array", "Expando", "pipe", "LabelAnnotation", "set", "TableType", "Type", "Obj", "typename", "version"]
|
|
7
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var chunk_O2VPBNS5_exports = {};
|
|
20
|
-
__export(chunk_O2VPBNS5_exports, {
|
|
21
|
-
TableSchema: () => TableSchema,
|
|
22
|
-
TableType: () => TableType
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(chunk_O2VPBNS5_exports);
|
|
25
|
-
var import_effect = require("effect");
|
|
26
|
-
var import_echo = require("@dxos/echo");
|
|
27
|
-
var import_echo_schema = require("@dxos/echo-schema");
|
|
28
|
-
var import_schema = require("@dxos/schema");
|
|
29
|
-
var TableSchema = import_effect.Schema.Struct({
|
|
30
|
-
id: import_echo_schema.ObjectId,
|
|
31
|
-
name: import_effect.Schema.optional(import_effect.Schema.String),
|
|
32
|
-
view: import_effect.Schema.optional((0, import_echo_schema.Ref)(import_schema.ViewType)),
|
|
33
|
-
// TODO(burdon): Document why threads is included here?
|
|
34
|
-
threads: import_effect.Schema.optional(import_effect.Schema.Array((0, import_echo_schema.Ref)(
|
|
35
|
-
import_echo_schema.Expando
|
|
36
|
-
/* ThreadType */
|
|
37
|
-
)))
|
|
38
|
-
}).pipe(import_echo_schema.LabelAnnotation.set([
|
|
39
|
-
"name"
|
|
40
|
-
]));
|
|
41
|
-
var TableType = TableSchema.pipe(import_echo.Type.Obj({
|
|
42
|
-
typename: "dxos.org/type/Table",
|
|
43
|
-
version: "0.1.0"
|
|
44
|
-
}));
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
TableSchema,
|
|
48
|
-
TableType
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=chunk-O2VPBNS5.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/table.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\n// import { ThreadType } from '@dxos/plugin-space/types';\nimport { Type } from '@dxos/echo';\nimport { ObjectId, Ref, Expando, LabelAnnotation } from '@dxos/echo-schema';\nimport { ViewType } from '@dxos/schema';\n\nexport const TableSchema = Schema.Struct({\n id: ObjectId,\n name: Schema.optional(Schema.String),\n view: Schema.optional(Ref(ViewType)),\n // TODO(burdon): Document why threads is included here?\n threads: Schema.optional(Schema.Array(Ref(Expando /* ThreadType */))),\n}).pipe(LabelAnnotation.set(['name']));\n\n// TODO(burdon): Move out of react-ui-xxx.\nexport const TableType = TableSchema.pipe(\n Type.Obj({\n typename: 'dxos.org/type/Table',\n version: '0.1.0',\n }),\n);\nexport interface TableType extends Schema.Schema.Type<typeof TableType> {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAGvB,kBAAqB;AACrB,yBAAwD;AACxD,oBAAyB;AAElB,IAAMA,cAAcC,qBAAOC,OAAO;EACvCC,IAAIC;EACJC,MAAMJ,qBAAOK,SAASL,qBAAOM,MAAM;EACnCC,MAAMP,qBAAOK,aAASG,wBAAIC,sBAAAA,CAAAA;;EAE1BC,SAASV,qBAAOK,SAASL,qBAAOW,UAAMH;IAAII;;EAAsB,CAAA,CAAA;AAClE,CAAA,EAAGC,KAAKC,mCAAgBC,IAAI;EAAC;CAAO,CAAA;AAG7B,IAAMC,YAAYjB,YAAYc,KACnCI,iBAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;",
|
|
6
|
-
"names": ["TableSchema", "Schema", "Struct", "id", "ObjectId", "name", "optional", "String", "view", "Ref", "ViewType", "threads", "Array", "Expando", "pipe", "LabelAnnotation", "set", "TableType", "Type", "Obj", "typename", "version"]
|
|
7
|
-
}
|