@dxos/react-ui-table 0.8.3 → 0.8.4-main.1f223c7
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-63UUF4IG.mjs +66 -0
- package/dist/lib/browser/chunk-63UUF4IG.mjs.map +7 -0
- package/dist/lib/browser/chunk-BBXDTWCX.mjs +1822 -0
- package/dist/lib/browser/chunk-BBXDTWCX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +814 -2152
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +124 -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-K734DJB7.mjs +67 -0
- package/dist/lib/node-esm/chunk-K734DJB7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RNQDU7IQ.mjs +1823 -0
- package/dist/lib/node-esm/chunk-RNQDU7IQ.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +814 -2152
- 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 +125 -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 +50 -2
- package/dist/types/src/components/Table/DynamicTable.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/Relations.stories.d.ts +44 -0
- 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 +3 -2
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts +42 -3
- 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 +8 -3
- package/dist/types/src/components/TableCellEditor/FormCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts +9 -15
- package/dist/types/src/components/TableCellEditor/TableCellEditor.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts +39 -3
- package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.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 +14 -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 +59 -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 +3 -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 +22 -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 +28 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/util/dynamic-table.d.ts +4 -5
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +0 -1
- package/dist/types/src/util/index.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/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -44
- package/src/components/Table/ColumnActionsMenu.tsx +1 -1
- package/src/components/Table/ColumnSettings.tsx +15 -11
- package/src/components/Table/CreateRefPanel.tsx +30 -11
- package/src/components/Table/DynamicTable.stories.tsx +8 -5
- package/src/components/Table/DynamicTable.tsx +17 -10
- package/src/components/Table/{relations.stories.tsx → Relations.stories.tsx} +56 -47
- package/src/components/Table/RowActionsMenu.tsx +3 -3
- package/src/components/Table/Table.stories.tsx +126 -159
- package/src/components/Table/Table.tsx +167 -123
- package/src/components/TableCellEditor/CellValidationMessage.tsx +7 -2
- package/src/components/TableCellEditor/FormCellEditor.tsx +158 -48
- package/src/components/TableCellEditor/TableCellEditor.stories.tsx +31 -47
- package/src/components/TableCellEditor/TableCellEditor.tsx +106 -111
- 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 +38 -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 +12 -9
- package/src/model/table-model.ts +288 -88
- package/src/model/table-presentation.test.ts +12 -8
- package/src/model/table-presentation.ts +263 -138
- package/src/model/table-sorting.ts +22 -13
- package/src/playwright/playwright.config.ts +17 -0
- package/src/playwright/smoke.spec.ts +137 -44
- package/src/testing/index.ts +5 -0
- package/src/testing/useTestTableModel.ts +124 -0
- package/src/translations.ts +7 -5
- package/src/types/index.ts +2 -2
- package/src/types/schema.ts +73 -0
- package/src/util/dynamic-table.ts +24 -21
- package/src/util/index.ts +0 -1
- package/src/util/schema.ts +1 -1
- package/src/util/table-buttons.ts +28 -4
- package/src/util/table-controls.ts +4 -1
- 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 +0 -9
- package/dist/types/src/components/Table/relations.stories.d.ts.map +0 -1
- package/dist/types/src/components/TableCellEditor/extension.d.ts +0 -13
- package/dist/types/src/components/TableCellEditor/extension.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/dist/types/src/util/table.d.ts +0 -14
- package/dist/types/src/util/table.d.ts.map +0 -1
- package/src/components/TableCellEditor/extension.ts +0 -61
- package/src/playwright/playwright.config.cts +0 -18
- package/src/types/table.ts +0 -27
- package/src/util/table.ts +0 -127
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export type TableButton = 'columnSettings' | 'rowMenu' | 'newColumn' | 'referencedCell' | 'sort';
|
|
5
|
+
export type TableButton = 'columnSettings' | 'rowMenu' | 'newColumn' | 'referencedCell' | 'sort' | 'saveDraftRow';
|
|
6
6
|
|
|
7
7
|
export const BUTTON_IDENTIFIERS: { [K in TableButton]: string } = {
|
|
8
8
|
columnSettings: 'data-table-column-settings-button',
|
|
9
9
|
newColumn: 'data-table-new-column-button',
|
|
10
10
|
referencedCell: 'data-table-ref-cell-button',
|
|
11
11
|
rowMenu: 'data-table-row-menu-button',
|
|
12
|
+
saveDraftRow: 'data-table-save-draft-row-button',
|
|
12
13
|
sort: 'data-table-sort-button',
|
|
13
14
|
} as const;
|
|
14
15
|
|
|
@@ -16,6 +17,7 @@ type ButtonData =
|
|
|
16
17
|
| { type: 'columnSettings'; fieldId: string }
|
|
17
18
|
| { type: 'newColumn'; disabled?: boolean }
|
|
18
19
|
| { type: 'rowMenu'; rowIndex: number }
|
|
20
|
+
| { type: 'saveDraftRow'; rowIndex: number; disabled?: boolean }
|
|
19
21
|
| { type: 'sort'; fieldId: string; direction?: 'asc' | 'desc' };
|
|
20
22
|
|
|
21
23
|
const createButton = ({
|
|
@@ -24,7 +26,7 @@ const createButton = ({
|
|
|
24
26
|
disabled = false,
|
|
25
27
|
icon,
|
|
26
28
|
testId,
|
|
27
|
-
type = 'primary',
|
|
29
|
+
type: _type = 'primary',
|
|
28
30
|
}: {
|
|
29
31
|
attr: string;
|
|
30
32
|
data: Record<string, string>;
|
|
@@ -37,8 +39,7 @@ const createButton = ({
|
|
|
37
39
|
.map(([k, v]) => `${k}="${v}"`)
|
|
38
40
|
.join(' ');
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
return `<button ${attr} data-testid="${testId}" class="dx-button is-6 pli-0.5 min-bs-0 absolute inset-block-1 ${positionClass}" ${dataAttrs} ${disabled ? 'disabled' : ''}><svg data-size="4"><use href="/icons.svg#${icon}"/></svg></button>`;
|
|
42
|
+
return `<button ${attr} data-testid="${testId}" class="dx-button is-6 aspect-square pli-0.5 min-bs-0" ${dataAttrs} ${disabled ? 'disabled' : ''} data-dx-grid-action="accessory"><svg data-size="4"><use href="/icons.svg#${icon}"/></svg></button>`;
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
const addColumnButton = {
|
|
@@ -65,6 +66,7 @@ const columnSettingsButton = {
|
|
|
65
66
|
icon: columnSettingsButton.icon,
|
|
66
67
|
data: {
|
|
67
68
|
'data-field-id': fieldId,
|
|
69
|
+
'data-variant': 'ghost',
|
|
68
70
|
},
|
|
69
71
|
testId: 'table-column-settings-button',
|
|
70
72
|
});
|
|
@@ -118,9 +120,31 @@ const sortButton = {
|
|
|
118
120
|
}),
|
|
119
121
|
} as const;
|
|
120
122
|
|
|
123
|
+
const saveDraftRowButton = {
|
|
124
|
+
attr: BUTTON_IDENTIFIERS.saveDraftRow,
|
|
125
|
+
icon: 'ph--floppy-disk--regular',
|
|
126
|
+
render: ({ rowIndex, disabled }: Omit<Extract<ButtonData, { type: 'saveDraftRow' }>, 'type'>) => {
|
|
127
|
+
return createButton({
|
|
128
|
+
attr: BUTTON_IDENTIFIERS.saveDraftRow,
|
|
129
|
+
icon: saveDraftRowButton.icon,
|
|
130
|
+
disabled,
|
|
131
|
+
data: {
|
|
132
|
+
'data-row-index': rowIndex.toString(),
|
|
133
|
+
'data-variant': 'primary',
|
|
134
|
+
},
|
|
135
|
+
testId: 'table-save-draft-row-button',
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
getData: (el: HTMLElement): Extract<ButtonData, { type: 'saveDraftRow' }> => ({
|
|
139
|
+
type: 'saveDraftRow',
|
|
140
|
+
rowIndex: Number(el.getAttribute('data-row-index')!),
|
|
141
|
+
}),
|
|
142
|
+
} as const;
|
|
143
|
+
|
|
121
144
|
export const tableButtons = {
|
|
122
145
|
addColumn: addColumnButton,
|
|
123
146
|
columnSettings: columnSettingsButton,
|
|
124
147
|
rowMenu: rowMenuButton,
|
|
148
|
+
saveDraftRow: saveDraftRowButton,
|
|
125
149
|
sort: sortButton,
|
|
126
150
|
} as const;
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// Core types.
|
|
6
|
+
import { accessoryHandlesPointerdownAttrs } from '@dxos/lit-grid';
|
|
7
|
+
|
|
6
8
|
export type TableControl = 'checkbox' | 'switch';
|
|
7
9
|
|
|
8
10
|
export type ControlData =
|
|
@@ -41,7 +43,7 @@ const renderInput = (
|
|
|
41
43
|
preventToggle = false,
|
|
42
44
|
testId: string,
|
|
43
45
|
) => {
|
|
44
|
-
return `<input type="checkbox" class="${baseClass}" ${renderAttributes(attrs)} ${checked ? 'checked' : ''} ${preventToggle ? 'onclick="return false"' : ''} ${disabled ? 'disabled' : ''} data-testid="${testId}"/>`;
|
|
46
|
+
return `<input type="checkbox" class="${baseClass}" ${renderAttributes(attrs)} ${checked ? 'checked' : ''} ${preventToggle ? 'onclick="return false"' : ''} ${disabled ? 'disabled' : ''} data-testid="${testId}" data-dx-grid-action="accessory"/>`;
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
export const CheckboxStory = ({
|
|
@@ -64,6 +66,7 @@ export const SwitchStory = ({ colIndex, rowIndex, checked = false, disabled = fa
|
|
|
64
66
|
[CONTROL_IDENTIFIERS.switch]: '',
|
|
65
67
|
'data-row-index': rowIndex.toString(),
|
|
66
68
|
'data-col-index': colIndex.toString(),
|
|
69
|
+
...accessoryHandlesPointerdownAttrs,
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
return renderInput(BASE_CLASSES.switch, attrs, checked, disabled, true, 'table-switch');
|
|
@@ -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
|
-
}
|