@dxos/react-ui-table 0.8.4-main.406dc2a → 0.8.4-main.548089c

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 (60) hide show
  1. package/dist/lib/browser/{chunk-4K7JPALT.mjs → chunk-2PFAPQL4.mjs} +3 -3
  2. package/dist/lib/browser/chunk-2PFAPQL4.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-OZTXLZGM.mjs → chunk-GS2UNGJK.mjs} +434 -463
  4. package/dist/lib/browser/chunk-GS2UNGJK.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +41 -38
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/browser/testing/index.mjs +4 -4
  9. package/dist/lib/browser/testing/index.mjs.map +3 -3
  10. package/dist/lib/browser/types/index.mjs +1 -1
  11. package/dist/lib/node-esm/{chunk-MK6OVUF6.mjs → chunk-6POOFFYF.mjs} +3 -3
  12. package/dist/lib/node-esm/chunk-6POOFFYF.mjs.map +7 -0
  13. package/dist/lib/node-esm/{chunk-S56Z4V4X.mjs → chunk-TRR3C5NX.mjs} +434 -463
  14. package/dist/lib/node-esm/chunk-TRR3C5NX.mjs.map +7 -0
  15. package/dist/lib/node-esm/index.mjs +41 -38
  16. package/dist/lib/node-esm/index.mjs.map +3 -3
  17. package/dist/lib/node-esm/meta.json +1 -1
  18. package/dist/lib/node-esm/testing/index.mjs +4 -4
  19. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  20. package/dist/lib/node-esm/types/index.mjs +1 -1
  21. package/dist/types/src/components/Table/Relations.stories.d.ts +2 -3
  22. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
  23. package/dist/types/src/components/Table/RowActionsMenu.d.ts.map +1 -1
  24. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts +2 -2
  26. package/dist/types/src/components/TableToolbar/TableToolbar.d.ts.map +1 -1
  27. package/dist/types/src/hooks/useTableModel.d.ts +2 -2
  28. package/dist/types/src/hooks/useTableModel.d.ts.map +1 -1
  29. package/dist/types/src/model/table-model.d.ts +3 -3
  30. package/dist/types/src/model/table-model.d.ts.map +1 -1
  31. package/dist/types/src/model/table-sorting.d.ts +2 -2
  32. package/dist/types/src/model/table-sorting.d.ts.map +1 -1
  33. package/dist/types/src/testing/useTestTableModel.d.ts +2 -2
  34. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
  35. package/dist/types/src/types/schema.d.ts +3 -3
  36. package/dist/types/src/types/schema.d.ts.map +1 -1
  37. package/dist/types/src/util/dynamic-table.d.ts +2 -2
  38. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  39. package/dist/types/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +41 -40
  41. package/src/components/Table/DynamicTable.stories.tsx +3 -3
  42. package/src/components/Table/Relations.stories.tsx +16 -22
  43. package/src/components/Table/RowActionsMenu.tsx +21 -13
  44. package/src/components/Table/Table.stories.tsx +12 -12
  45. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +6 -5
  46. package/src/components/TableToolbar/TableToolbar.tsx +31 -21
  47. package/src/hooks/useTableModel.ts +4 -4
  48. package/src/model/table-model.test.ts +2 -2
  49. package/src/model/table-model.ts +10 -7
  50. package/src/model/table-presentation.test.ts +2 -2
  51. package/src/model/table-sorting.ts +8 -8
  52. package/src/playwright/TableManager.ts +1 -1
  53. package/src/playwright/smoke.spec.ts +7 -5
  54. package/src/testing/useTestTableModel.ts +2 -2
  55. package/src/types/schema.ts +4 -4
  56. package/src/util/dynamic-table.ts +4 -5
  57. package/dist/lib/browser/chunk-4K7JPALT.mjs.map +0 -7
  58. package/dist/lib/browser/chunk-OZTXLZGM.mjs.map +0 -7
  59. package/dist/lib/node-esm/chunk-MK6OVUF6.mjs.map +0 -7
  60. package/dist/lib/node-esm/chunk-S56Z4V4X.mjs.map +0 -7
@@ -16,7 +16,7 @@ import * as Schema from "effect/Schema";
16
16
  import { Obj, Type } from "@dxos/echo";
17
17
  import { JsonPath, toEffectSchema } from "@dxos/echo/internal";
18
18
  import { ViewAnnotation } from "@dxos/echo/internal";
19
- import { createViewFromSpace, getSchemaProperties } from "@dxos/schema";
19
+ import { View, getSchemaProperties } from "@dxos/schema";
20
20
  var Table = Schema.Struct({
21
21
  sizes: Schema.Record({
22
22
  key: JsonPath,
@@ -34,7 +34,7 @@ var makeView = async ({ sizes, ...props }) => {
34
34
  const table = Obj.make(Table, {
35
35
  sizes: {}
36
36
  });
37
- const { jsonSchema, view } = await createViewFromSpace({
37
+ const { jsonSchema, view } = await View.makeFromSpace({
38
38
  ...props,
39
39
  presentation: table
40
40
  });
@@ -63,4 +63,4 @@ var makeView = async ({ sizes, ...props }) => {
63
63
  export {
64
64
  schema_exports
65
65
  };
66
- //# sourceMappingURL=chunk-4K7JPALT.mjs.map
66
+ //# sourceMappingURL=chunk-2PFAPQL4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { JsonPath, type JsonSchemaType, toEffectSchema } from '@dxos/echo/internal';\nimport { ViewAnnotation } from '@dxos/echo/internal';\nimport { type SimpleType } from '@dxos/effect';\nimport { View, getSchemaProperties } from '@dxos/schema';\n\nexport const Table = Schema.Struct({\n sizes: Schema.Record({\n key: JsonPath,\n value: Schema.Number,\n }).pipe(Schema.mutable),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Table',\n version: '0.1.0',\n }),\n ViewAnnotation.set(true),\n);\n\nexport type Table = Schema.Schema.Type<typeof Table>;\n\n/**\n * Make a table view.\n */\nexport const make = (props: Partial<Obj.MakeProps<typeof Table>> = {}) => Obj.make(Table, { sizes: {}, ...props });\n\ntype MakeViewProps = Omit<View.MakeFromSpaceProps, 'presentation'> & {\n sizes?: Record<string, number>;\n};\n\nexport const makeView = async ({\n sizes,\n ...props\n}: MakeViewProps): Promise<{\n jsonSchema: JsonSchemaType;\n view: View.View;\n schema: ReturnType<typeof toEffectSchema>;\n}> => {\n const table = Obj.make(Table, { sizes: {} });\n const { jsonSchema, view } = await View.makeFromSpace({ ...props, presentation: table });\n\n // Preset sizes.\n const schema = toEffectSchema(jsonSchema);\n const shouldIncludeId = props.fields?.find((field) => field === 'id') !== undefined;\n const properties = getSchemaProperties(schema.ast, {}, shouldIncludeId);\n for (const property of properties) {\n if (sizes?.[property.name]) {\n table.sizes[property.name as JsonPath] = sizes[property.name];\n continue;\n }\n\n Match.type<SimpleType>().pipe(\n Match.when('boolean', () => {\n table.sizes[property.name as JsonPath] = 100;\n }),\n Match.when('number', () => {\n table.sizes[property.name as JsonPath] = 100;\n }),\n Match.orElse(() => {\n // Noop.\n }),\n )(property.type);\n }\n\n return { jsonSchema, schema, view };\n};\n"],
5
+ "mappings": ";;;;;;;AAAA;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,UAA+BC,sBAAsB;AAC9D,SAASC,sBAAsB;AAE/B,SAASC,MAAMC,2BAA2B;AAEnC,IAAMC,QAAeC,cAAO;EACjCC,OAAcC,cAAO;IACnBC,KAAKC;IACLC,OAAcC;EAChB,CAAA,EAAGC,KAAYC,cAAO;AACxB,CAAA,EAAGD,KACDE,KAAKC,IAAI;EACPC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,eAAeC,IAAI,IAAA,CAAA;AAQd,IAAMC,OAAO,CAACC,QAA8C,CAAC,MAAMN,IAAIK,KAAKhB,OAAO;EAAEE,OAAO,CAAC;EAAG,GAAGe;AAAM,CAAA;AAMzG,IAAMC,WAAW,OAAO,EAC7BhB,OACA,GAAGe,MAAAA,MACW;AAKd,QAAME,QAAQR,IAAIK,KAAKhB,OAAO;IAAEE,OAAO,CAAC;EAAE,CAAA;AAC1C,QAAM,EAAEkB,YAAYC,KAAI,IAAK,MAAMC,KAAKC,cAAc;IAAE,GAAGN;IAAOO,cAAcL;EAAM,CAAA;AAGtF,QAAMM,SAASC,eAAeN,UAAAA;AAC9B,QAAMO,kBAAkBV,MAAMW,QAAQC,KAAK,CAACC,UAAUA,UAAU,IAAA,MAAUC;AAC1E,QAAMC,aAAaC,oBAAoBR,OAAOS,KAAK,CAAC,GAAGP,eAAAA;AACvD,aAAWQ,YAAYH,YAAY;AACjC,QAAI9B,QAAQiC,SAASC,IAAI,GAAG;AAC1BjB,YAAMjB,MAAMiC,SAASC,IAAI,IAAgBlC,MAAMiC,SAASC,IAAI;AAC5D;IACF;AAEAC,IAAMC,WAAI,EAAe9B,KACjB+B,WAAK,WAAW,MAAA;AACpBpB,YAAMjB,MAAMiC,SAASC,IAAI,IAAgB;IAC3C,CAAA,GACMG,WAAK,UAAU,MAAA;AACnBpB,YAAMjB,MAAMiC,SAASC,IAAI,IAAgB;IAC3C,CAAA,GACMI,aAAO,MAAA;IAEb,CAAA,CAAA,EACAL,SAASG,IAAI;EACjB;AAEA,SAAO;IAAElB;IAAYK;IAAQJ;EAAK;AACpC;",
6
+ "names": ["Match", "Schema", "Obj", "Type", "JsonPath", "toEffectSchema", "ViewAnnotation", "View", "getSchemaProperties", "Table", "Struct", "sizes", "Record", "key", "JsonPath", "value", "Number", "pipe", "mutable", "Type", "Obj", "typename", "version", "ViewAnnotation", "set", "make", "props", "makeView", "table", "jsonSchema", "view", "View", "makeFromSpace", "presentation", "schema", "toEffectSchema", "shouldIncludeId", "fields", "find", "field", "undefined", "properties", "getSchemaProperties", "ast", "property", "name", "Match", "type", "when", "orElse"]
7
+ }