@dxos/react-ui-table 0.8.2-main.36232bc → 0.8.2-main.5ca3450
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-UGGYKLOH.mjs +28 -0
- package/dist/lib/browser/chunk-UGGYKLOH.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +40 -107
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node/{chunk-TGG6OZ54.cjs → chunk-2QLLIPZK.cjs} +13 -11
- package/dist/lib/node/chunk-2QLLIPZK.cjs.map +7 -0
- package/dist/lib/node/index.cjs +108 -173
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/types/index.cjs +3 -3
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{chunk-KKLP54L3.mjs → chunk-N2RRVR7F.mjs} +11 -9
- package/dist/lib/node-esm/chunk-N2RRVR7F.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +40 -107
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/components/Table/ColumnActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/ColumnSettings.d.ts.map +1 -1
- package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
- package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
- package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.d.ts.map +1 -1
- package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
- package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
- package/dist/types/src/components/TableCellEditor/TableCellEditor.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 +39 -39
- package/dist/types/src/components/testing.d.ts.map +1 -1
- package/dist/types/src/hooks/useTableModel.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.map +1 -1
- package/dist/types/src/model/table-model.d.ts.map +1 -1
- package/dist/types/src/model/table-presentation.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +43 -43
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
- package/dist/types/src/util/signals.d.ts.map +1 -1
- package/dist/types/src/util/table-buttons.d.ts +0 -14
- 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 +2 -2
- package/dist/types/src/util/table.d.ts.map +1 -1
- package/dist/types/src/util/tag.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -33
- package/src/components/Table/CreateRefPanel.tsx +3 -3
- package/src/components/Table/Table.stories.tsx +1 -2
- package/src/components/Table/Table.tsx +0 -6
- package/src/components/Table/relations.stories.tsx +10 -9
- package/src/components/testing.ts +7 -6
- package/src/model/table-model.test.ts +4 -3
- package/src/model/table-presentation.test.ts +4 -3
- package/src/model/table-presentation.ts +3 -5
- package/src/types/table.ts +16 -8
- package/src/util/table-buttons.ts +0 -23
- package/src/util/table.ts +7 -7
- package/dist/lib/browser/chunk-YWNRUF4J.mjs +0 -26
- package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +0 -7
- package/dist/lib/node/chunk-TGG6OZ54.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +0 -7
- package/dist/types/src/components/Table/RefPanel.d.ts +0 -9
- package/dist/types/src/components/Table/RefPanel.d.ts.map +0 -1
- package/src/components/Table/RefPanel.tsx +0 -52
|
@@ -8,10 +8,6 @@ type ButtonData = {
|
|
|
8
8
|
} | {
|
|
9
9
|
type: 'newColumn';
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
} | {
|
|
12
|
-
type: 'referencedCell';
|
|
13
|
-
schemaId: string;
|
|
14
|
-
targetId: string;
|
|
15
11
|
} | {
|
|
16
12
|
type: 'rowMenu';
|
|
17
13
|
rowIndex: number;
|
|
@@ -41,16 +37,6 @@ export declare const tableButtons: {
|
|
|
41
37
|
type: "columnSettings";
|
|
42
38
|
}>;
|
|
43
39
|
};
|
|
44
|
-
readonly referencedCell: {
|
|
45
|
-
readonly attr: string;
|
|
46
|
-
readonly icon: "ph--link-simple-horizontal--regular";
|
|
47
|
-
readonly render: ({ targetId, schemaId }: Omit<Extract<ButtonData, {
|
|
48
|
-
type: "referencedCell";
|
|
49
|
-
}>, "type">) => string;
|
|
50
|
-
readonly getData: (el: HTMLElement) => Extract<ButtonData, {
|
|
51
|
-
type: "referencedCell";
|
|
52
|
-
}>;
|
|
53
|
-
};
|
|
54
40
|
readonly rowMenu: {
|
|
55
41
|
readonly attr: string;
|
|
56
42
|
readonly icon: "ph--dots-three--regular";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-buttons.d.ts","sourceRoot":"","sources":["../../../../src/util/table-buttons.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAEjG,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAAC,IAAI,WAAW,GAAG,MAAM;CAMnD,CAAC;AAEX,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"table-buttons.d.ts","sourceRoot":"","sources":["../../../../src/util/table-buttons.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAEjG,eAAO,MAAM,kBAAkB,EAAE;KAAG,CAAC,IAAI,WAAW,GAAG,MAAM;CAMnD,CAAC;AAEX,KAAK,UAAU,GACX;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AAsGlE,eAAO,MAAM,YAAY;;;;wCA1EA,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;gCAShE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC;;;;;uCAMjD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAUrE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,gBAAgB,CAAA;SAAE,CAAC;;;;;wCASpD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BAU/D,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,CAAC;;;;;kDASnC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,EAAE,MAAM,CAAC;+BActE,WAAW,KAAG,OAAO,CAAC,UAAU,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;;CAYzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/G,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAE3G,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAwBX,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"table-controls.d.ts","sourceRoot":"","sources":["../../../../src/util/table-controls.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/G,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAE3G,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAwBX,eAAO,MAAM,aAAa,GAAI,0CAK3B,mBAAmB,KAAG,MAQxB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,2CAA2D,iBAAiB,KAAG,MAQ1G,CAAC;AAEF,eAAO,MAAM,aAAa;;;oEApBvB,mBAAmB,KAAG,MAAM;+BAwBb,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,UAAU,CAAA;SAAE,CAAC;;;;qEAda,iBAAiB,KAAG,MAAM;+BAuB/F,WAAW,KAAG,OAAO,CAAC,WAAW,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAA;SAAE,CAAC;;CAM9D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { type Client } from '@dxos/react-client';
|
|
3
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
4
4
|
import { type TableType } from '../types';
|
|
@@ -9,6 +9,6 @@ type InitialiseTableProps = {
|
|
|
9
9
|
typename?: string;
|
|
10
10
|
initialRow?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<
|
|
12
|
+
export declare const initializeTable: ({ client, space, table, typename, initialRow, }: InitialiseTableProps) => Promise<Schema.Schema.AnyNoContext>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../../src/util/table.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAC;AAW3C,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGpE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,iDAMnC,oBAAoB,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CA0C3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/util/tag.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/util/tag.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MAAM,EAAE,GAAG,SAgBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-table",
|
|
3
|
-
"version": "0.8.2-main.
|
|
3
|
+
"version": "0.8.2-main.5ca3450",
|
|
4
4
|
"description": "A table component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -51,31 +51,33 @@
|
|
|
51
51
|
"@radix-ui/react-slot": "1.1.2",
|
|
52
52
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
53
53
|
"date-fns": "^3.3.1",
|
|
54
|
+
"effect": "3.14.21",
|
|
54
55
|
"lodash.orderby": "^4.6.0",
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/effect": "0.8.2-main.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/plugin-space": "0.8.2-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/react-
|
|
68
|
-
"@dxos/react-
|
|
69
|
-
"@dxos/react-ui-
|
|
70
|
-
"@dxos/react-ui-
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/react-ui-
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/util": "0.8.2-main.
|
|
78
|
-
"@dxos/react-ui-tag-picker": "0.8.2-main.
|
|
56
|
+
"@dxos/debug": "0.8.2-main.5ca3450",
|
|
57
|
+
"@dxos/context": "0.8.2-main.5ca3450",
|
|
58
|
+
"@dxos/echo": "0.8.2-main.5ca3450",
|
|
59
|
+
"@dxos/effect": "0.8.2-main.5ca3450",
|
|
60
|
+
"@dxos/echo-schema": "0.8.2-main.5ca3450",
|
|
61
|
+
"@dxos/invariant": "0.8.2-main.5ca3450",
|
|
62
|
+
"@dxos/keys": "0.8.2-main.5ca3450",
|
|
63
|
+
"@dxos/lit-grid": "0.8.2-main.5ca3450",
|
|
64
|
+
"@dxos/live-object": "0.8.2-main.5ca3450",
|
|
65
|
+
"@dxos/log": "0.8.2-main.5ca3450",
|
|
66
|
+
"@dxos/plugin-space": "0.8.2-main.5ca3450",
|
|
67
|
+
"@dxos/plugin-search": "0.8.2-main.5ca3450",
|
|
68
|
+
"@dxos/react-ui-attention": "0.8.2-main.5ca3450",
|
|
69
|
+
"@dxos/react-client": "0.8.2-main.5ca3450",
|
|
70
|
+
"@dxos/react-ui-editor": "0.8.2-main.5ca3450",
|
|
71
|
+
"@dxos/react-ui-form": "0.8.2-main.5ca3450",
|
|
72
|
+
"@dxos/react-ui-grid": "0.8.2-main.5ca3450",
|
|
73
|
+
"@dxos/react-ui-menu": "0.8.2-main.5ca3450",
|
|
74
|
+
"@dxos/react-ui-searchlist": "0.8.2-main.5ca3450",
|
|
75
|
+
"@dxos/react-ui-stack": "0.8.2-main.5ca3450",
|
|
76
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-main.5ca3450",
|
|
77
|
+
"@dxos/react-ui-types": "0.8.2-main.5ca3450",
|
|
78
|
+
"@dxos/util": "0.8.2-main.5ca3450",
|
|
79
|
+
"@dxos/react-ui-tag-picker": "0.8.2-main.5ca3450",
|
|
80
|
+
"@dxos/schema": "0.8.2-main.5ca3450"
|
|
79
81
|
},
|
|
80
82
|
"devDependencies": {
|
|
81
83
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -86,19 +88,19 @@
|
|
|
86
88
|
"react": "~18.2.0",
|
|
87
89
|
"react-dom": "~18.2.0",
|
|
88
90
|
"vite": "5.4.7",
|
|
89
|
-
"@dxos/echo-signals": "0.8.2-main.
|
|
90
|
-
"@dxos/random": "0.8.2-main.
|
|
91
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
92
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
93
|
-
"@dxos/storybook-utils": "0.8.2-main.
|
|
94
|
-
"@dxos/test-utils": "0.8.2-main.
|
|
91
|
+
"@dxos/echo-signals": "0.8.2-main.5ca3450",
|
|
92
|
+
"@dxos/random": "0.8.2-main.5ca3450",
|
|
93
|
+
"@dxos/react-ui": "0.8.2-main.5ca3450",
|
|
94
|
+
"@dxos/react-ui-theme": "0.8.2-main.5ca3450",
|
|
95
|
+
"@dxos/storybook-utils": "0.8.2-main.5ca3450",
|
|
96
|
+
"@dxos/test-utils": "0.8.2-main.5ca3450"
|
|
95
97
|
},
|
|
96
98
|
"peerDependencies": {
|
|
97
99
|
"@phosphor-icons/react": "^2.1.5",
|
|
98
100
|
"react": "~18.2.0",
|
|
99
101
|
"react-dom": "~18.2.0",
|
|
100
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
101
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
102
|
+
"@dxos/react-ui": "0.8.2-main.5ca3450",
|
|
103
|
+
"@dxos/react-ui-theme": "0.8.2-main.5ca3450"
|
|
102
104
|
},
|
|
103
105
|
"publishConfig": {
|
|
104
106
|
"access": "public"
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import React, { useCallback, useMemo } from 'react';
|
|
6
7
|
|
|
7
|
-
import { S } from '@dxos/echo-schema';
|
|
8
8
|
import { live } from '@dxos/react-client/echo';
|
|
9
9
|
import { Popover } from '@dxos/react-ui';
|
|
10
10
|
import { Form } from '@dxos/react-ui-form';
|
|
@@ -20,14 +20,14 @@ export const CreateRefPanel = ({ model, modals, __gridScope }: GridScopedProps<C
|
|
|
20
20
|
const space = model?.space;
|
|
21
21
|
const state = modals.state.value;
|
|
22
22
|
|
|
23
|
-
const schema = useMemo<
|
|
23
|
+
const schema = useMemo<Schema.Schema<any> | undefined>(() => {
|
|
24
24
|
if (!space || state?.type !== 'createRefPanel') {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const [schema] = space.db.schemaRegistry.query({ typename: state.typename }).runSync();
|
|
29
29
|
if (schema) {
|
|
30
|
-
const omit =
|
|
30
|
+
const omit = Schema.omit<any, any, ['id']>('id');
|
|
31
31
|
return omit(schema);
|
|
32
32
|
}
|
|
33
33
|
}, [space, state]);
|
|
@@ -28,8 +28,7 @@ import { TableType } from '../../types';
|
|
|
28
28
|
import { initializeTable } from '../../util';
|
|
29
29
|
import { TableToolbar } from '../TableToolbar';
|
|
30
30
|
|
|
31
|
-
// NOTE(ZaymonFC):
|
|
32
|
-
faker.seed(0);
|
|
31
|
+
faker.seed(0); // NOTE(ZaymonFC): Required for smoke tests.
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
34
|
* Custom hook to create and manage a test table model for storybook demonstrations.
|
|
@@ -36,7 +36,6 @@ import { isNotFalsy, safeParseInt } from '@dxos/util';
|
|
|
36
36
|
import { ColumnActionsMenu } from './ColumnActionsMenu';
|
|
37
37
|
import { ColumnSettings } from './ColumnSettings';
|
|
38
38
|
import { CreateRefPanel } from './CreateRefPanel';
|
|
39
|
-
import { RefPanel } from './RefPanel';
|
|
40
39
|
import { RowActionsMenu } from './RowActionsMenu';
|
|
41
40
|
import { ModalController, type TableModel, type TablePresentation } from '../../model';
|
|
42
41
|
import { translationKey } from '../../translations';
|
|
@@ -181,10 +180,6 @@ const TableMain = forwardRef<TableController, TableMainProps>(
|
|
|
181
180
|
modals.showColumnCreator();
|
|
182
181
|
break;
|
|
183
182
|
}
|
|
184
|
-
case 'referencedCell': {
|
|
185
|
-
modals.showReferencePanel(data.targetId, data.schemaId);
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
183
|
case 'sort': {
|
|
189
184
|
model?.sorting?.toggleSort(data.fieldId);
|
|
190
185
|
break;
|
|
@@ -373,7 +368,6 @@ const TableMain = forwardRef<TableController, TableMainProps>(
|
|
|
373
368
|
<ColumnActionsMenu model={model} modals={modals} />
|
|
374
369
|
<ColumnSettings model={model} modals={modals} onNewColumn={handleNewColumn} />
|
|
375
370
|
<CreateRefPanel model={model} modals={modals} />
|
|
376
|
-
<RefPanel model={model} modals={modals} />
|
|
377
371
|
</Grid.Root>
|
|
378
372
|
);
|
|
379
373
|
},
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
7
|
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import { SchemaAST } from 'effect';
|
|
8
9
|
import React, { useEffect, useMemo } from 'react';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
+
import { type BaseObject, ImmutableSchema, type BaseSchema, type HasId } from '@dxos/echo-schema';
|
|
11
12
|
import { getAnnotation } from '@dxos/effect';
|
|
12
13
|
import { faker } from '@dxos/random';
|
|
13
14
|
import { live, makeRef } from '@dxos/react-client/echo';
|
|
14
15
|
import { useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import {
|
|
16
|
+
import { DataType, createView, ViewProjection, ViewType } from '@dxos/schema';
|
|
16
17
|
import { createAsyncGenerator, type ValueGenerator } from '@dxos/schema/testing';
|
|
17
18
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
19
|
|
|
@@ -33,9 +34,9 @@ const useTestModel = <T extends BaseObject & HasId>(schema: BaseSchema<T>, count
|
|
|
33
34
|
const { space } = useClientProvider();
|
|
34
35
|
|
|
35
36
|
const table = useMemo(() => {
|
|
36
|
-
// const { typename } = pipe(schema.ast,
|
|
37
|
+
// const { typename } = pipe(schema.ast, SchemaAST.getAnnotation<TypeAnnotation>(TypeAnnotationId), Option.getOrThrow);
|
|
37
38
|
const typename = schema.typename;
|
|
38
|
-
const name = getAnnotation<string>(
|
|
39
|
+
const name = getAnnotation<string>(SchemaAST.TitleAnnotationId)(schema.ast) ?? typename;
|
|
39
40
|
const view = createView({ name, typename, jsonSchema: schema.jsonSchema });
|
|
40
41
|
return live(TableType, { view: makeRef(view) });
|
|
41
42
|
}, [schema]);
|
|
@@ -81,12 +82,12 @@ const useTestModel = <T extends BaseObject & HasId>(schema: BaseSchema<T>, count
|
|
|
81
82
|
|
|
82
83
|
const DefaultStory = () => {
|
|
83
84
|
// TODO(burdon): Remove need for ImmutableSchema wrapper at API-level.
|
|
84
|
-
const orgSchema = useMemo(() => new ImmutableSchema(Organization), []);
|
|
85
|
-
const { model: orgModel, presentation: orgPresentation } = useTestModel<Organization>(orgSchema, 50);
|
|
85
|
+
const orgSchema = useMemo(() => new ImmutableSchema(DataType.Organization), []);
|
|
86
|
+
const { model: orgModel, presentation: orgPresentation } = useTestModel<DataType.Organization>(orgSchema, 50);
|
|
86
87
|
|
|
87
88
|
// TODO(burdon): Generate links with references.
|
|
88
|
-
const contactSchema = useMemo(() => new ImmutableSchema(
|
|
89
|
-
const { model: contactModel, presentation: contactPresentation } = useTestModel<
|
|
89
|
+
const contactSchema = useMemo(() => new ImmutableSchema(DataType.Person), []);
|
|
90
|
+
const { model: contactModel, presentation: contactPresentation } = useTestModel<DataType.Person>(contactSchema, 50);
|
|
90
91
|
|
|
91
92
|
return (
|
|
92
93
|
<div className='is-full bs-full grid grid-cols-2 divide-x divide-separator'>
|
|
@@ -106,7 +107,7 @@ const meta: Meta<typeof DefaultStory> = {
|
|
|
106
107
|
parameters: { translations },
|
|
107
108
|
decorators: [
|
|
108
109
|
withClientProvider({
|
|
109
|
-
types: [TableType, ViewType, Organization,
|
|
110
|
+
types: [TableType, ViewType, DataType.Organization, DataType.Person],
|
|
110
111
|
createIdentity: true,
|
|
111
112
|
createSpace: true,
|
|
112
113
|
}),
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import { useEffect } from 'react';
|
|
6
7
|
|
|
7
|
-
import { setValue, toJsonSchema,
|
|
8
|
+
import { setValue, toJsonSchema, TypeEnum, TypedObject, FormatEnum, ObjectId } from '@dxos/echo-schema';
|
|
8
9
|
import { faker } from '@dxos/random';
|
|
9
10
|
import { live, makeRef } from '@dxos/react-client/echo';
|
|
10
11
|
import { createView, type ViewProjection } from '@dxos/schema';
|
|
@@ -12,11 +13,11 @@ import { createView, type ViewProjection } from '@dxos/schema';
|
|
|
12
13
|
import { TableType } from '../types';
|
|
13
14
|
|
|
14
15
|
export const TestSchema = TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({
|
|
15
|
-
id:
|
|
16
|
-
name:
|
|
17
|
-
age:
|
|
18
|
-
active:
|
|
19
|
-
netWorth:
|
|
16
|
+
id: ObjectId,
|
|
17
|
+
name: Schema.optional(Schema.String),
|
|
18
|
+
age: Schema.optional(Schema.Number),
|
|
19
|
+
active: Schema.optional(Schema.Boolean),
|
|
20
|
+
netWorth: Schema.optional(Schema.Number),
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
export const createTable = (schema = TestSchema) => {
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { computed } from '@preact/signals-core';
|
|
6
|
+
import { Schema } from 'effect';
|
|
6
7
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
7
8
|
|
|
8
|
-
import {
|
|
9
|
+
import { TypedObject } from '@dxos/echo-schema';
|
|
9
10
|
import { updateCounter } from '@dxos/echo-schema/testing';
|
|
10
11
|
import { registerSignalsRuntime } from '@dxos/echo-signals';
|
|
11
12
|
import { createEchoSchema } from '@dxos/live-object/testing';
|
|
@@ -99,8 +100,8 @@ describe('TableModel', () => {
|
|
|
99
100
|
});
|
|
100
101
|
|
|
101
102
|
class Test extends TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({
|
|
102
|
-
title:
|
|
103
|
-
completed:
|
|
103
|
+
title: Schema.String,
|
|
104
|
+
completed: Schema.Boolean,
|
|
104
105
|
}) {}
|
|
105
106
|
|
|
106
107
|
const createTableModel = (props: Partial<TableModelProps> = {}): TableModel => {
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
5
6
|
import { describe, expect, it, beforeEach } from 'vitest';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import { TypedObject } from '@dxos/echo-schema';
|
|
8
9
|
import { live, makeRef } from '@dxos/live-object';
|
|
9
10
|
import { createEchoSchema } from '@dxos/live-object/testing';
|
|
10
11
|
import { createView, ViewProjection } from '@dxos/schema';
|
|
@@ -89,8 +90,8 @@ describe('TablePresentation', () => {
|
|
|
89
90
|
});
|
|
90
91
|
|
|
91
92
|
class Test extends TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({
|
|
92
|
-
title:
|
|
93
|
-
completed:
|
|
93
|
+
title: Schema.String,
|
|
94
|
+
completed: Schema.Boolean,
|
|
94
95
|
}) {}
|
|
95
96
|
|
|
96
97
|
const createTableModel = (props: Partial<TableModelProps> = {}): TableModel => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { signal } from '@preact/signals-core';
|
|
6
6
|
|
|
7
|
-
import { FormatEnum, getValue } from '@dxos/echo-schema';
|
|
7
|
+
import { FormatEnum, getDXN, getValue } from '@dxos/echo-schema';
|
|
8
8
|
import { cellClassesForFieldType, formatForDisplay } from '@dxos/react-ui-form';
|
|
9
9
|
import {
|
|
10
10
|
type DxGridPlane,
|
|
@@ -124,10 +124,8 @@ export class TablePresentation<T extends TableRow = TableRow> {
|
|
|
124
124
|
if (props.format === FormatEnum.Ref && props.referenceSchema) {
|
|
125
125
|
const targetObj = getValue(obj, field.path)?.target;
|
|
126
126
|
if (targetObj) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
schemaId: props.referenceSchema,
|
|
130
|
-
});
|
|
127
|
+
const dxn = getDXN(targetObj)?.toString();
|
|
128
|
+
cell.accessoryHtml = `<dx-ref-tag ref=${dxn} class="dx-button block is-6 pli-[3px] plb-[3px] pbe-[2px] min-bs-0 absolute inline-end-1"><dx-icon icon="ph--link-simple--regular"/></dx-ref-tag>`;
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
|
package/src/types/table.ts
CHANGED
|
@@ -2,20 +2,28 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Type } from '@dxos/echo';
|
|
6
8
|
// import { ThreadType } from '@dxos/plugin-space/types';
|
|
9
|
+
import { LabelAnnotationId } from '@dxos/echo-schema';
|
|
7
10
|
import { ViewType } from '@dxos/schema';
|
|
8
11
|
|
|
9
|
-
export const TableSchema =
|
|
10
|
-
id: ObjectId,
|
|
11
|
-
name:
|
|
12
|
-
view:
|
|
12
|
+
export const TableSchema = Schema.Struct({
|
|
13
|
+
id: Type.ObjectId,
|
|
14
|
+
name: Schema.optional(Schema.String),
|
|
15
|
+
view: Schema.optional(Type.Ref(ViewType)),
|
|
13
16
|
// TODO(burdon): Document why threads is included here?
|
|
14
|
-
threads:
|
|
17
|
+
threads: Schema.optional(Schema.Array(Type.Ref(Type.Expando /* ThreadType */))),
|
|
15
18
|
}).annotations({
|
|
16
19
|
// TODO(burdon): Move annotation to property.
|
|
17
20
|
[LabelAnnotationId]: 'name',
|
|
18
21
|
});
|
|
19
22
|
|
|
20
|
-
export const TableType = TableSchema.pipe(
|
|
21
|
-
|
|
23
|
+
export const TableType = TableSchema.pipe(
|
|
24
|
+
Type.def({
|
|
25
|
+
typename: 'dxos.org/type/Table',
|
|
26
|
+
version: '0.1.0',
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
export interface TableType extends Schema.Schema.Type<typeof TableType> {}
|
|
@@ -15,7 +15,6 @@ export const BUTTON_IDENTIFIERS: { [K in TableButton]: string } = {
|
|
|
15
15
|
type ButtonData =
|
|
16
16
|
| { type: 'columnSettings'; fieldId: string }
|
|
17
17
|
| { type: 'newColumn'; disabled?: boolean }
|
|
18
|
-
| { type: 'referencedCell'; schemaId: string; targetId: string }
|
|
19
18
|
| { type: 'rowMenu'; rowIndex: number }
|
|
20
19
|
| { type: 'sort'; fieldId: string; direction?: 'asc' | 'desc' };
|
|
21
20
|
|
|
@@ -76,27 +75,6 @@ const columnSettingsButton = {
|
|
|
76
75
|
}),
|
|
77
76
|
} as const;
|
|
78
77
|
|
|
79
|
-
const referencedCellButton = {
|
|
80
|
-
attr: BUTTON_IDENTIFIERS.referencedCell,
|
|
81
|
-
icon: 'ph--link-simple-horizontal--regular',
|
|
82
|
-
render: ({ targetId, schemaId }: Omit<Extract<ButtonData, { type: 'referencedCell' }>, 'type'>) => {
|
|
83
|
-
return createButton({
|
|
84
|
-
attr: BUTTON_IDENTIFIERS.referencedCell,
|
|
85
|
-
icon: referencedCellButton.icon,
|
|
86
|
-
data: {
|
|
87
|
-
'data-target-id': targetId,
|
|
88
|
-
'data-schema-id': schemaId,
|
|
89
|
-
},
|
|
90
|
-
testId: 'table-ref-cell-button',
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
getData: (el: HTMLElement): Extract<ButtonData, { type: 'referencedCell' }> => ({
|
|
94
|
-
type: 'referencedCell',
|
|
95
|
-
targetId: el.getAttribute('data-target-id')!,
|
|
96
|
-
schemaId: el.getAttribute('data-schema-id')!,
|
|
97
|
-
}),
|
|
98
|
-
} as const;
|
|
99
|
-
|
|
100
78
|
const rowMenuButton = {
|
|
101
79
|
attr: BUTTON_IDENTIFIERS.rowMenu,
|
|
102
80
|
icon: 'ph--dots-three--regular',
|
|
@@ -143,7 +121,6 @@ const sortButton = {
|
|
|
143
121
|
export const tableButtons = {
|
|
144
122
|
addColumn: addColumnButton,
|
|
145
123
|
columnSettings: columnSettingsButton,
|
|
146
|
-
referencedCell: referencedCellButton,
|
|
147
124
|
rowMenu: rowMenuButton,
|
|
148
125
|
sort: sortButton,
|
|
149
126
|
} as const;
|
package/src/util/table.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema, SchemaAST } from 'effect';
|
|
6
|
+
|
|
5
7
|
import {
|
|
6
|
-
AST,
|
|
7
8
|
type EchoSchema,
|
|
8
9
|
Format,
|
|
9
10
|
FormatEnum,
|
|
10
11
|
type JsonPath,
|
|
11
12
|
type JsonProp,
|
|
12
|
-
S,
|
|
13
13
|
TypedObject,
|
|
14
14
|
TypeEnum,
|
|
15
15
|
} from '@dxos/echo-schema';
|
|
@@ -34,7 +34,7 @@ export const initializeTable = async ({
|
|
|
34
34
|
table,
|
|
35
35
|
typename,
|
|
36
36
|
initialRow = true,
|
|
37
|
-
}: InitialiseTableProps): Promise<
|
|
37
|
+
}: InitialiseTableProps): Promise<Schema.Schema.AnyNoContext> => {
|
|
38
38
|
if (typename) {
|
|
39
39
|
const schema = await space.db.graph.getSchemaByTypename(typename, space.db);
|
|
40
40
|
if (!schema) {
|
|
@@ -82,10 +82,10 @@ const ContactSchema = TypedObject({
|
|
|
82
82
|
typename: `example.com/type/${PublicKey.random().truncate()}`,
|
|
83
83
|
version: '0.1.0',
|
|
84
84
|
})({
|
|
85
|
-
name:
|
|
86
|
-
active:
|
|
87
|
-
email:
|
|
88
|
-
salary:
|
|
85
|
+
name: Schema.optional(Schema.String).annotations({ [SchemaAST.TitleAnnotationId]: 'Name' }),
|
|
86
|
+
active: Schema.optional(Schema.Boolean),
|
|
87
|
+
email: Schema.optional(Format.Email),
|
|
88
|
+
salary: Schema.optional(Format.Currency()).annotations({ [SchemaAST.TitleAnnotationId]: 'Salary' }),
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
const ContactFields = ['name', 'email', 'salary', 'active'];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// packages/ui/react-ui-table/src/types/table.ts
|
|
2
|
-
import { EchoObject, Expando, LabelAnnotationId, ObjectId, Ref, S } from "@dxos/echo-schema";
|
|
3
|
-
import { ViewType } from "@dxos/schema";
|
|
4
|
-
var TableSchema = S.Struct({
|
|
5
|
-
id: ObjectId,
|
|
6
|
-
name: S.optional(S.String),
|
|
7
|
-
view: S.optional(Ref(ViewType)),
|
|
8
|
-
// TODO(burdon): Document why threads is included here?
|
|
9
|
-
threads: S.optional(S.Array(Ref(
|
|
10
|
-
Expando
|
|
11
|
-
/* ThreadType */
|
|
12
|
-
)))
|
|
13
|
-
}).annotations({
|
|
14
|
-
// TODO(burdon): Move annotation to property.
|
|
15
|
-
[LabelAnnotationId]: "name"
|
|
16
|
-
});
|
|
17
|
-
var TableType = TableSchema.pipe(EchoObject({
|
|
18
|
-
typename: "dxos.org/type/Table",
|
|
19
|
-
version: "0.1.0"
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
TableSchema,
|
|
24
|
-
TableType
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=chunk-YWNRUF4J.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 { EchoObject, Expando, LabelAnnotationId, ObjectId, Ref, S } from '@dxos/echo-schema';\n// import { ThreadType } from '@dxos/plugin-space/types';\nimport { ViewType } from '@dxos/schema';\n\nexport const TableSchema = S.Struct({\n id: ObjectId,\n name: S.optional(S.String),\n view: S.optional(Ref(ViewType)),\n // TODO(burdon): Document why threads is included here?\n threads: S.optional(S.Array(Ref(Expando /* ThreadType */))),\n}).annotations({\n // TODO(burdon): Move annotation to property.\n [LabelAnnotationId]: 'name',\n});\n\nexport const TableType = TableSchema.pipe(EchoObject({ typename: 'dxos.org/type/Table', version: '0.1.0' }));\nexport interface TableType extends S.Schema.Type<typeof TableType> {}\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,YAAYC,SAASC,mBAAmBC,UAAUC,KAAKC,SAAS;AAEzE,SAASC,gBAAgB;AAElB,IAAMC,cAAcC,EAAEC,OAAO;EAClCC,IAAIC;EACJC,MAAMJ,EAAEK,SAASL,EAAEM,MAAM;EACzBC,MAAMP,EAAEK,SAASG,IAAIC,QAAAA,CAAAA;;EAErBC,SAASV,EAAEK,SAASL,EAAEW,MAAMH;IAAII;;EAAsB,CAAA,CAAA;AACxD,CAAA,EAAGC,YAAY;;EAEb,CAACC,iBAAAA,GAAoB;AACvB,CAAA;AAEO,IAAMC,YAAYhB,YAAYiB,KAAKC,WAAW;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,CAAA;",
|
|
6
|
-
"names": ["EchoObject", "Expando", "LabelAnnotationId", "ObjectId", "Ref", "S", "ViewType", "TableSchema", "S", "Struct", "id", "ObjectId", "name", "optional", "String", "view", "Ref", "ViewType", "threads", "Array", "Expando", "annotations", "LabelAnnotationId", "TableType", "pipe", "EchoObject", "typename", "version"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/table.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { EchoObject, Expando, LabelAnnotationId, ObjectId, Ref, S } from '@dxos/echo-schema';\n// import { ThreadType } from '@dxos/plugin-space/types';\nimport { ViewType } from '@dxos/schema';\n\nexport const TableSchema = S.Struct({\n id: ObjectId,\n name: S.optional(S.String),\n view: S.optional(Ref(ViewType)),\n // TODO(burdon): Document why threads is included here?\n threads: S.optional(S.Array(Ref(Expando /* ThreadType */))),\n}).annotations({\n // TODO(burdon): Move annotation to property.\n [LabelAnnotationId]: 'name',\n});\n\nexport const TableType = TableSchema.pipe(EchoObject({ typename: 'dxos.org/type/Table', version: '0.1.0' }));\nexport interface TableType extends S.Schema.Type<typeof TableType> {}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAyE;AAEzE,oBAAyB;AAElB,IAAMA,cAAcC,qBAAEC,OAAO;EAClCC,IAAIC;EACJC,MAAMJ,qBAAEK,SAASL,qBAAEM,MAAM;EACzBC,MAAMP,qBAAEK,aAASG,wBAAIC,sBAAAA,CAAAA;;EAErBC,SAASV,qBAAEK,SAASL,qBAAEW,UAAMH;IAAII;;EAAsB,CAAA,CAAA;AACxD,CAAA,EAAGC,YAAY;;EAEb,CAACC,oCAAAA,GAAoB;AACvB,CAAA;AAEO,IAAMC,YAAYhB,YAAYiB,SAAKC,+BAAW;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,CAAA;",
|
|
6
|
-
"names": ["TableSchema", "S", "Struct", "id", "ObjectId", "name", "optional", "String", "view", "Ref", "ViewType", "threads", "Array", "Expando", "annotations", "LabelAnnotationId", "TableType", "pipe", "EchoObject", "typename", "version"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/table.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { EchoObject, Expando, LabelAnnotationId, ObjectId, Ref, S } from '@dxos/echo-schema';\n// import { ThreadType } from '@dxos/plugin-space/types';\nimport { ViewType } from '@dxos/schema';\n\nexport const TableSchema = S.Struct({\n id: ObjectId,\n name: S.optional(S.String),\n view: S.optional(Ref(ViewType)),\n // TODO(burdon): Document why threads is included here?\n threads: S.optional(S.Array(Ref(Expando /* ThreadType */))),\n}).annotations({\n // TODO(burdon): Move annotation to property.\n [LabelAnnotationId]: 'name',\n});\n\nexport const TableType = TableSchema.pipe(EchoObject({ typename: 'dxos.org/type/Table', version: '0.1.0' }));\nexport interface TableType extends S.Schema.Type<typeof TableType> {}\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,YAAYC,SAASC,mBAAmBC,UAAUC,KAAKC,SAAS;AAEzE,SAASC,gBAAgB;AAElB,IAAMC,cAAcC,EAAEC,OAAO;EAClCC,IAAIC;EACJC,MAAMJ,EAAEK,SAASL,EAAEM,MAAM;EACzBC,MAAMP,EAAEK,SAASG,IAAIC,QAAAA,CAAAA;;EAErBC,SAASV,EAAEK,SAASL,EAAEW,MAAMH;IAAII;;EAAsB,CAAA,CAAA;AACxD,CAAA,EAAGC,YAAY;;EAEb,CAACC,iBAAAA,GAAoB;AACvB,CAAA;AAEO,IAAMC,YAAYhB,YAAYiB,KAAKC,WAAW;EAAEC,UAAU;EAAuBC,SAAS;AAAQ,CAAA,CAAA;",
|
|
6
|
-
"names": ["EchoObject", "Expando", "LabelAnnotationId", "ObjectId", "Ref", "S", "ViewType", "TableSchema", "S", "Struct", "id", "ObjectId", "name", "optional", "String", "view", "Ref", "ViewType", "threads", "Array", "Expando", "annotations", "LabelAnnotationId", "TableType", "pipe", "EchoObject", "typename", "version"]
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type TableModel, type ModalController } from '../../model';
|
|
3
|
-
type RefPanelProps = {
|
|
4
|
-
model: TableModel;
|
|
5
|
-
modals: ModalController;
|
|
6
|
-
};
|
|
7
|
-
export declare const RefPanel: ({ model, modals }: RefPanelProps) => React.JSX.Element | null;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=RefPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Table/RefPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpE,KAAK,aAAa,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAUpE,eAAO,MAAM,QAAQ,sBAAuB,aAAa,6BA6BxD,CAAC"}
|