@dxos/react-ui-table 0.8.2-main.2f9c567 → 0.8.2-main.5885341

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.
Files changed (41) hide show
  1. package/dist/lib/browser/chunk-YWNRUF4J.mjs +26 -0
  2. package/dist/lib/browser/chunk-YWNRUF4J.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +10 -11
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/types/index.mjs +1 -1
  7. package/dist/lib/node/{chunk-2QLLIPZK.cjs → chunk-TGG6OZ54.cjs} +11 -13
  8. package/dist/lib/node/chunk-TGG6OZ54.cjs.map +7 -0
  9. package/dist/lib/node/index.cjs +60 -61
  10. package/dist/lib/node/index.cjs.map +3 -3
  11. package/dist/lib/node/meta.json +1 -1
  12. package/dist/lib/node/types/index.cjs +3 -3
  13. package/dist/lib/node/types/index.cjs.map +1 -1
  14. package/dist/lib/node-esm/{chunk-N2RRVR7F.mjs → chunk-KKLP54L3.mjs} +9 -11
  15. package/dist/lib/node-esm/chunk-KKLP54L3.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +10 -11
  17. package/dist/lib/node-esm/index.mjs.map +3 -3
  18. package/dist/lib/node-esm/meta.json +1 -1
  19. package/dist/lib/node-esm/types/index.mjs +1 -1
  20. package/dist/types/src/components/Table/CreateRefPanel.d.ts.map +1 -1
  21. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  22. package/dist/types/src/components/Table/relations.stories.d.ts.map +1 -1
  23. package/dist/types/src/components/testing.d.ts +39 -39
  24. package/dist/types/src/components/testing.d.ts.map +1 -1
  25. package/dist/types/src/types/table.d.ts +42 -42
  26. package/dist/types/src/types/table.d.ts.map +1 -1
  27. package/dist/types/src/util/table.d.ts +2 -2
  28. package/dist/types/src/util/table.d.ts.map +1 -1
  29. package/package.json +33 -35
  30. package/src/components/Table/CreateRefPanel.tsx +3 -3
  31. package/src/components/Table/Table.stories.tsx +2 -1
  32. package/src/components/Table/relations.stories.tsx +9 -10
  33. package/src/components/testing.ts +6 -7
  34. package/src/model/table-model.test.ts +3 -4
  35. package/src/model/table-presentation.test.ts +3 -4
  36. package/src/types/table.ts +8 -16
  37. package/src/util/table.ts +7 -7
  38. package/dist/lib/browser/chunk-UGGYKLOH.mjs +0 -28
  39. package/dist/lib/browser/chunk-UGGYKLOH.mjs.map +0 -7
  40. package/dist/lib/node/chunk-2QLLIPZK.cjs.map +0 -7
  41. package/dist/lib/node-esm/chunk-N2RRVR7F.mjs.map +0 -7
@@ -0,0 +1,26 @@
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
@@ -0,0 +1,7 @@
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 +1,7 @@
1
1
  import {
2
2
  TableSchema,
3
3
  TableType
4
- } from "./chunk-UGGYKLOH.mjs";
4
+ } from "./chunk-YWNRUF4J.mjs";
5
5
 
6
6
  // packages/ui/react-ui-table/src/translations.ts
7
7
  var translationKey = "table";
@@ -150,8 +150,8 @@ var ColumnSettings = ({ model, modals, onNewColumn }) => {
150
150
  };
151
151
 
152
152
  // packages/ui/react-ui-table/src/components/Table/CreateRefPanel.tsx
153
- import { Schema } from "effect";
154
153
  import React3, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
154
+ import { S } from "@dxos/echo-schema";
155
155
  import { live } from "@dxos/react-client/echo";
156
156
  import { Popover } from "@dxos/react-ui";
157
157
  import { Form } from "@dxos/react-ui-form";
@@ -168,7 +168,7 @@ var CreateRefPanel = ({ model, modals, __gridScope }) => {
168
168
  typename: state.typename
169
169
  }).runSync();
170
170
  if (schema2) {
171
- const omit = Schema.omit("id");
171
+ const omit = S.omit("id");
172
172
  return omit(schema2);
173
173
  }
174
174
  }, [
@@ -344,8 +344,7 @@ var setProperties = (view, projection, properties) => {
344
344
  var touch = (value) => value;
345
345
 
346
346
  // packages/ui/react-ui-table/src/util/table.ts
347
- import { Schema as Schema2, SchemaAST } from "effect";
348
- import { Format, FormatEnum, TypedObject, TypeEnum } from "@dxos/echo-schema";
347
+ import { AST, Format, FormatEnum, S as S2, TypedObject, TypeEnum } from "@dxos/echo-schema";
349
348
  import { PublicKey } from "@dxos/react-client";
350
349
  import { live as live3, makeRef as makeRef2 } from "@dxos/react-client/echo";
351
350
  import { createFieldId, createView as createView2, getSchemaProperties, ViewProjection as ViewProjection2 } from "@dxos/schema";
@@ -386,13 +385,13 @@ var ContactSchema = TypedObject({
386
385
  typename: `example.com/type/${PublicKey.random().truncate()}`,
387
386
  version: "0.1.0"
388
387
  })({
389
- name: Schema2.optional(Schema2.String).annotations({
390
- [SchemaAST.TitleAnnotationId]: "Name"
388
+ name: S2.optional(S2.String).annotations({
389
+ [AST.TitleAnnotationId]: "Name"
391
390
  }),
392
- active: Schema2.optional(Schema2.Boolean),
393
- email: Schema2.optional(Format.Email),
394
- salary: Schema2.optional(Format.Currency()).annotations({
395
- [SchemaAST.TitleAnnotationId]: "Salary"
391
+ active: S2.optional(S2.Boolean),
392
+ email: S2.optional(Format.Email),
393
+ salary: S2.optional(Format.Currency()).annotations({
394
+ [AST.TitleAnnotationId]: "Salary"
396
395
  })
397
396
  });
398
397
  var ContactFields = [