@dxos/react-ui-table 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc

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 (53) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/browser/{chunk-FBURZBPH.mjs → chunk-4URYOFDL.mjs} +2 -3
  3. package/dist/lib/browser/chunk-4URYOFDL.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-YGC7LZJN.mjs → chunk-YDXPC7HA.mjs} +3 -3
  5. package/dist/lib/browser/chunk-YDXPC7HA.mjs.map +7 -0
  6. package/dist/lib/browser/index.mjs +3 -6
  7. package/dist/lib/browser/index.mjs.map +3 -3
  8. package/dist/lib/browser/meta.json +1 -1
  9. package/dist/lib/browser/testing/index.mjs +4 -3
  10. package/dist/lib/browser/testing/index.mjs.map +3 -3
  11. package/dist/lib/browser/types/index.mjs +1 -1
  12. package/dist/lib/node-esm/{chunk-GKIWDEZ7.mjs → chunk-2AN3QQ3D.mjs} +3 -3
  13. package/dist/lib/node-esm/chunk-2AN3QQ3D.mjs.map +7 -0
  14. package/dist/lib/node-esm/{chunk-DKKMSVKP.mjs → chunk-B2SZYAEC.mjs} +2 -3
  15. package/dist/lib/node-esm/chunk-B2SZYAEC.mjs.map +7 -0
  16. package/dist/lib/node-esm/index.mjs +3 -6
  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/testing/index.mjs +4 -3
  20. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  21. package/dist/lib/node-esm/types/index.mjs +1 -1
  22. package/dist/types/src/components/Table/DynamicTable.d.ts +1 -2
  23. package/dist/types/src/components/Table/DynamicTable.d.ts.map +1 -1
  24. package/dist/types/src/components/Table/Relations.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/Table/Table.stories.d.ts.map +1 -1
  26. package/dist/types/src/components/TableCellEditor/CellValidationMessage.d.ts.map +1 -1
  27. package/dist/types/src/components/TableCellEditor/TableCellEditor.stories.d.ts.map +1 -1
  28. package/dist/types/src/model/table-model.d.ts +1 -2
  29. package/dist/types/src/model/table-model.d.ts.map +1 -1
  30. package/dist/types/src/model/table-presentation.d.ts.map +1 -1
  31. package/dist/types/src/testing/useTestTableModel.d.ts.map +1 -1
  32. package/dist/types/src/types/Table.d.ts +1 -2
  33. package/dist/types/src/types/Table.d.ts.map +1 -1
  34. package/dist/types/src/util/dynamic-table.d.ts.map +1 -1
  35. package/dist/types/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +39 -45
  37. package/src/components/Table/DynamicTable.stories.tsx +2 -2
  38. package/src/components/Table/DynamicTable.tsx +3 -4
  39. package/src/components/Table/Relations.stories.tsx +1 -2
  40. package/src/components/Table/Table.stories.tsx +1 -2
  41. package/src/components/TableCellEditor/CellValidationMessage.tsx +1 -2
  42. package/src/components/TableCellEditor/TableCellEditor.stories.tsx +1 -2
  43. package/src/model/table-model.ts +1 -2
  44. package/src/model/table-presentation.test.ts +1 -8
  45. package/src/model/table-presentation.ts +3 -4
  46. package/src/testing/useTestTableModel.ts +2 -2
  47. package/src/types/Table.ts +1 -2
  48. package/src/util/dynamic-table.test.ts +1 -8
  49. package/src/util/dynamic-table.ts +1 -2
  50. package/dist/lib/browser/chunk-FBURZBPH.mjs.map +0 -7
  51. package/dist/lib/browser/chunk-YGC7LZJN.mjs.map +0 -7
  52. package/dist/lib/node-esm/chunk-DKKMSVKP.mjs.map +0 -7
  53. package/dist/lib/node-esm/chunk-GKIWDEZ7.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-table",
3
- "version": "0.8.4-main.abd8ff62ef",
3
+ "version": "0.8.4-main.bc2380dfbc",
4
4
  "description": "A table component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -8,7 +8,7 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/dxos/dxos"
10
10
  },
11
- "license": "MIT",
11
+ "license": "FSL-1.1-Apache-2.0",
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": false,
14
14
  "type": "module",
@@ -22,12 +22,6 @@
22
22
  "browser": "./dist/lib/browser/index.mjs",
23
23
  "node": "./dist/lib/node-esm/index.mjs"
24
24
  },
25
- "./deprecated": {
26
- "source": "./src/deprecated/index.ts",
27
- "types": "./dist/types/src/deprecated/index.d.ts",
28
- "browser": "./dist/lib/browser/deprecated/index.mjs",
29
- "node": "./dist/lib/node-esm/deprecated/index.mjs"
30
- },
31
25
  "./testing": {
32
26
  "source": "./src/testing/index.ts",
33
27
  "types": "./dist/types/src/testing/index.d.ts",
@@ -55,7 +49,7 @@
55
49
  "dependencies": {
56
50
  "@codemirror/autocomplete": "^6.19.0",
57
51
  "@codemirror/state": "^6.5.2",
58
- "@codemirror/view": "^6.38.4",
52
+ "@codemirror/view": "^6.38.5",
59
53
  "@effect-atom/atom-react": "^0.5.0",
60
54
  "@fluentui/react-tabster": "9.26.11",
61
55
  "@radix-ui/react-context": "1.1.1",
@@ -64,32 +58,32 @@
64
58
  "@radix-ui/react-use-controllable-state": "1.1.0",
65
59
  "date-fns": "^3.6.0",
66
60
  "lodash.orderby": "^4.6.0",
67
- "@dxos/context": "0.8.4-main.abd8ff62ef",
68
- "@dxos/echo": "0.8.4-main.abd8ff62ef",
69
- "@dxos/debug": "0.8.4-main.abd8ff62ef",
70
- "@dxos/echo-atom": "0.8.4-main.abd8ff62ef",
71
- "@dxos/async": "0.8.4-main.abd8ff62ef",
72
- "@dxos/keys": "0.8.4-main.abd8ff62ef",
73
- "@dxos/invariant": "0.8.4-main.abd8ff62ef",
74
- "@dxos/lit-grid": "0.8.4-main.abd8ff62ef",
75
- "@dxos/random": "0.8.4-main.abd8ff62ef",
76
- "@dxos/log": "0.8.4-main.abd8ff62ef",
77
- "@dxos/react-ui-attention": "0.8.4-main.abd8ff62ef",
78
- "@dxos/react-client": "0.8.4-main.abd8ff62ef",
79
- "@dxos/react-ui-components": "0.8.4-main.abd8ff62ef",
80
- "@dxos/react-ui-form": "0.8.4-main.abd8ff62ef",
81
- "@dxos/react-ui-editor": "0.8.4-main.abd8ff62ef",
82
- "@dxos/effect": "0.8.4-main.abd8ff62ef",
83
- "@dxos/react-ui-grid": "0.8.4-main.abd8ff62ef",
84
- "@dxos/react-ui-list": "0.8.4-main.abd8ff62ef",
85
- "@dxos/react-ui-search": "0.8.4-main.abd8ff62ef",
86
- "@dxos/react-ui-stack": "0.8.4-main.abd8ff62ef",
87
- "@dxos/react-ui-syntax-highlighter": "0.8.4-main.abd8ff62ef",
88
- "@dxos/react-ui-menu": "0.8.4-main.abd8ff62ef",
89
- "@dxos/types": "0.8.4-main.abd8ff62ef",
90
- "@dxos/ui-types": "0.8.4-main.abd8ff62ef",
91
- "@dxos/schema": "0.8.4-main.abd8ff62ef",
92
- "@dxos/util": "0.8.4-main.abd8ff62ef"
61
+ "@dxos/context": "0.8.4-main.bc2380dfbc",
62
+ "@dxos/debug": "0.8.4-main.bc2380dfbc",
63
+ "@dxos/async": "0.8.4-main.bc2380dfbc",
64
+ "@dxos/effect": "0.8.4-main.bc2380dfbc",
65
+ "@dxos/echo": "0.8.4-main.bc2380dfbc",
66
+ "@dxos/echo-atom": "0.8.4-main.bc2380dfbc",
67
+ "@dxos/invariant": "0.8.4-main.bc2380dfbc",
68
+ "@dxos/keys": "0.8.4-main.bc2380dfbc",
69
+ "@dxos/lit-grid": "0.8.4-main.bc2380dfbc",
70
+ "@dxos/log": "0.8.4-main.bc2380dfbc",
71
+ "@dxos/react-client": "0.8.4-main.bc2380dfbc",
72
+ "@dxos/react-ui-components": "0.8.4-main.bc2380dfbc",
73
+ "@dxos/react-ui-attention": "0.8.4-main.bc2380dfbc",
74
+ "@dxos/react-ui-editor": "0.8.4-main.bc2380dfbc",
75
+ "@dxos/react-ui-form": "0.8.4-main.bc2380dfbc",
76
+ "@dxos/random": "0.8.4-main.bc2380dfbc",
77
+ "@dxos/react-ui-grid": "0.8.4-main.bc2380dfbc",
78
+ "@dxos/react-ui-list": "0.8.4-main.bc2380dfbc",
79
+ "@dxos/react-ui-menu": "0.8.4-main.bc2380dfbc",
80
+ "@dxos/react-ui-search": "0.8.4-main.bc2380dfbc",
81
+ "@dxos/react-ui-stack": "0.8.4-main.bc2380dfbc",
82
+ "@dxos/react-ui-syntax-highlighter": "0.8.4-main.bc2380dfbc",
83
+ "@dxos/schema": "0.8.4-main.bc2380dfbc",
84
+ "@dxos/types": "0.8.4-main.bc2380dfbc",
85
+ "@dxos/ui-types": "0.8.4-main.bc2380dfbc",
86
+ "@dxos/util": "0.8.4-main.bc2380dfbc"
93
87
  },
94
88
  "devDependencies": {
95
89
  "@effect/platform": "0.94.4",
@@ -100,14 +94,14 @@
100
94
  "fast-check": "^3.19.0",
101
95
  "react": "~19.2.3",
102
96
  "react-dom": "~19.2.3",
103
- "vite": "^8.0.10",
104
- "@dxos/lit-ui": "0.8.4-main.abd8ff62ef",
105
- "@dxos/random": "0.8.4-main.abd8ff62ef",
106
- "@dxos/react-client": "0.8.4-main.abd8ff62ef",
107
- "@dxos/storybook-utils": "0.8.4-main.abd8ff62ef",
108
- "@dxos/react-ui": "0.8.4-main.abd8ff62ef",
109
- "@dxos/test-utils": "0.8.4-main.abd8ff62ef",
110
- "@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
97
+ "vite": "^8.0.13",
98
+ "@dxos/random": "0.8.4-main.bc2380dfbc",
99
+ "@dxos/lit-ui": "0.8.4-main.bc2380dfbc",
100
+ "@dxos/react-client": "0.8.4-main.bc2380dfbc",
101
+ "@dxos/react-ui": "0.8.4-main.bc2380dfbc",
102
+ "@dxos/test-utils": "0.8.4-main.bc2380dfbc",
103
+ "@dxos/storybook-utils": "0.8.4-main.bc2380dfbc",
104
+ "@dxos/ui-theme": "0.8.4-main.bc2380dfbc"
111
105
  },
112
106
  "peerDependencies": {
113
107
  "@effect-atom/atom-react": "^0.5.0",
@@ -115,8 +109,8 @@
115
109
  "effect": "3.20.0",
116
110
  "react": "~19.2.3",
117
111
  "react-dom": "~19.2.3",
118
- "@dxos/react-ui": "0.8.4-main.abd8ff62ef",
119
- "@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
112
+ "@dxos/react-ui": "0.8.4-main.bc2380dfbc",
113
+ "@dxos/ui-theme": "0.8.4-main.bc2380dfbc"
120
114
  },
121
115
  "publishConfig": {
122
116
  "access": "public"
@@ -6,10 +6,10 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import type * as Types from 'effect/Types';
7
7
  import React, { useMemo, useState } from 'react';
8
8
 
9
- import { type JsonSchema, Obj } from '@dxos/echo';
9
+ import { Filter, type JsonSchema, Obj } from '@dxos/echo';
10
10
  import { Format } from '@dxos/echo/internal';
11
11
  import { random } from '@dxos/random';
12
- import { Filter, useQuery, useSchema } from '@dxos/react-client/echo';
12
+ import { useQuery, useSchema } from '@dxos/react-client/echo';
13
13
  import { useClientStory, withClientProvider } from '@dxos/react-client/testing';
14
14
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
15
  import { type SchemaPropertyDefinition } from '@dxos/schema';
@@ -6,8 +6,7 @@ import { RegistryContext } from '@effect-atom/atom-react';
6
6
  import type * as Types from 'effect/Types';
7
7
  import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
8
8
 
9
- import { type Type } from '@dxos/echo';
10
- import { type JsonSchema } from '@dxos/echo';
9
+ import { type JsonSchema, type Type } from '@dxos/echo';
11
10
  import { type ThemedClassName, useDefaultValue } from '@dxos/react-ui';
12
11
  import { type ProjectionModel } from '@dxos/schema';
13
12
  import { mx } from '@dxos/ui-theme';
@@ -96,8 +95,8 @@ export const DynamicTable = <T extends Type.AnyEntity = Type.AnyEntity>({
96
95
  }, [registry, model]);
97
96
 
98
97
  return (
99
- <div role='none' className={mx('dx-expander grid', classNames)}>
100
- <div role='none' className='grid min-h-0 overflow-hidden'>
98
+ <div className={mx('dx-expander grid', classNames)}>
99
+ <div className='grid min-h-0 overflow-hidden'>
101
100
  <Table.Root ref={tableRef}>
102
101
  <Table.Content model={model} presentation={presentation} ignoreAttention onRowClick={onRowClick} />
103
102
  </Table.Root>
@@ -7,8 +7,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
7
7
  import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
8
8
  import { expect, userEvent, waitFor, within } from 'storybook/test';
9
9
 
10
- import { Obj, Type } from '@dxos/echo';
11
- import { View } from '@dxos/echo';
10
+ import { Obj, Type, View } from '@dxos/echo';
12
11
  import { invariant } from '@dxos/invariant';
13
12
  import { type DxGrid } from '@dxos/lit-grid';
14
13
  import { random } from '@dxos/random';
@@ -6,8 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import * as Schema from 'effect/Schema';
7
7
  import React, { useCallback } from 'react';
8
8
 
9
- import { Annotation, type Database, Format, Obj, type QueryAST, Ref, Type } from '@dxos/echo';
10
- import { View } from '@dxos/echo';
9
+ import { Annotation, type Database, Format, Obj, type QueryAST, Ref, Type, View } from '@dxos/echo';
11
10
  import { type Mutable, PropertyMetaAnnotationId } from '@dxos/echo/internal';
12
11
  import { invariant } from '@dxos/invariant';
13
12
  import { random } from '@dxos/random';
@@ -23,11 +23,10 @@ export const CellValidationMessage = ({
23
23
  }
24
24
 
25
25
  const bgClass = variant === 'error' ? 'bg-error-surface' : 'bg-warning-surface';
26
- const textClass = variant === 'error' ? 'text-error-surface-text' : 'text-warning-surface-text';
26
+ const textClass = variant === 'error' ? 'text-error-foreground' : 'text-warning-foreground';
27
27
 
28
28
  return (
29
29
  <div
30
- role='none'
31
30
  className={`absolute ${bgClass} ${textClass} rounded-h-sm text-xs p-1`}
32
31
  style={{
33
32
  ...{ '--dx-grid-cell-width': `${box?.inlineSize ?? 200}px` },
@@ -5,8 +5,7 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React from 'react';
7
7
 
8
- import { Obj } from '@dxos/echo';
9
- import { View } from '@dxos/echo';
8
+ import { Obj, View } from '@dxos/echo';
10
9
  import { random } from '@dxos/random';
11
10
  import { withClientProvider } from '@dxos/react-client/testing';
12
11
  import { Grid, type GridEditing, defaultRowSize } from '@dxos/react-ui-grid';
@@ -5,8 +5,7 @@
5
5
  import { Atom, type Registry } from '@effect-atom/atom-react';
6
6
 
7
7
  import { Resource } from '@dxos/context';
8
- import { type Database, Format, Obj, Order, Query, type QueryAST, Ref } from '@dxos/echo';
9
- import { type View } from '@dxos/echo';
8
+ import { type Database, Format, Obj, Order, Query, type QueryAST, Ref, type View } from '@dxos/echo';
10
9
  import { type JsonProp, type JsonSchemaType, type Mutable, toEffectSchema } from '@dxos/echo/internal';
11
10
  import { getSnapshot } from '@dxos/echo/internal';
12
11
  import { getValue, setValue } from '@dxos/effect';
@@ -14,14 +14,7 @@ import { Table } from '../types';
14
14
  import { TableModel, type TableModelProps } from './table-model';
15
15
  import { TablePresentation } from './table-presentation';
16
16
 
17
- // Quarantined in CI only — vite resolves `@dxos/react-ui-grid` to the hoisted
18
- // node_modules copy, which fails the `node` export condition under the
19
- // workflow's `--no-file-parallelism` runner. Tests pass locally so the suite
20
- // still runs during development.
21
- // Trunk.io tracking:
22
- // https://app.trunk.io/dxos/flaky-tests/test/e027ed98-4aea-5a63-b5ed-10baf76fb11e
23
- const describeOutsideCI = process.env.CI ? describe.skip : describe;
24
- describeOutsideCI('TablePresentation', () => {
17
+ describe('TablePresentation', () => {
25
18
  describe('getCells', () => {
26
19
  let registry: Registry.Registry;
27
20
  let data: any[];
@@ -5,8 +5,7 @@
5
5
  import { Atom, type Registry } from '@effect-atom/atom-react';
6
6
  import * as Predicate from 'effect/Predicate';
7
7
 
8
- import { Obj } from '@dxos/echo';
9
- import { type View } from '@dxos/echo';
8
+ import { Obj, type View } from '@dxos/echo';
10
9
  import { Format, TypeEnum, getValue } from '@dxos/echo/internal';
11
10
  import { cellClassesForFieldType, formatForDisplay } from '@dxos/react-ui-form';
12
11
  import {
@@ -473,8 +472,8 @@ export const cellClassesForRowSelection = (selected: boolean, selectionMode: Sel
473
472
 
474
473
  switch (selectionMode) {
475
474
  case 'single':
476
- return ['dx-grid__cell--no-focus-unfurl !bg-current-surface hover:bg-hover-surface cursor-pointer!'];
475
+ return ['dx-grid__cell--no-focus-unfurl bg-current-surface! hover:bg-hover-surface cursor-pointer!'];
477
476
  case 'multiple':
478
- return ['!bg-grid-cell-selected'];
477
+ return ['bg-grid-cell-selected!'];
479
478
  }
480
479
  };
@@ -5,10 +5,10 @@
5
5
  import { RegistryContext } from '@effect-atom/atom-react';
6
6
  import { type RefObject, useCallback, useContext, useMemo, useRef } from 'react';
7
7
 
8
- import { type Database, type Type } from '@dxos/echo';
8
+ import { type Database, Filter, type Type } from '@dxos/echo';
9
9
  import { isMutable } from '@dxos/echo/internal';
10
10
  import { random } from '@dxos/random';
11
- import { Filter, useQuery, useSchema } from '@dxos/react-client/echo';
11
+ import { useQuery, useSchema } from '@dxos/react-client/echo';
12
12
  import { useClientStory } from '@dxos/react-client/testing';
13
13
  import { useGlobalFilteredObjects } from '@dxos/react-ui-search';
14
14
  import { type ProjectionModel, getTypenameFromQuery } from '@dxos/schema';
@@ -6,8 +6,7 @@ import * as Match from 'effect/Match';
6
6
  import * as Schema from 'effect/Schema';
7
7
  import * as SchemaAST from 'effect/SchemaAST';
8
8
 
9
- import { Annotation, JsonSchema, Obj, Ref, Type } from '@dxos/echo';
10
- import { View } from '@dxos/echo';
9
+ import { Annotation, JsonSchema, Obj, Ref, Type, View } from '@dxos/echo';
11
10
  import { FormInputAnnotation, type JsonPath, type JsonSchemaType, LabelAnnotation } from '@dxos/echo/internal';
12
11
  import { ViewAnnotation } from '@dxos/schema';
13
12
 
@@ -9,14 +9,7 @@ import { Format } from '@dxos/echo';
9
9
 
10
10
  import { type TablePropertyDefinition, getBaseSchema, makeDynamicTable } from './dynamic-table';
11
11
 
12
- // Quarantined in CI only — flaky under the workflow's `--no-file-parallelism`
13
- // runner / hoisted node_modules layout. Local runs still cover the suite so
14
- // regressions surface during development.
15
- // Trunk.io tracking:
16
- // https://app.trunk.io/dxos/flaky-tests/test/fe424f97-f8a1-5f2f-a191-5b3ec4e8f6b7
17
- // https://app.trunk.io/dxos/flaky-tests/test/ee00f293-9b9b-55ed-b4cd-48a07edea96c
18
- const describeOutsideCI = process.env.CI ? describe.skip : describe;
19
- describeOutsideCI('makeDynamicTable', () => {
12
+ describe('makeDynamicTable', () => {
20
13
  /**
21
14
  * Base case: plain jsonSchema (not from Echo / JsonSchema.toJsonSchema). Does not exercise the path
22
15
  * where projection or schema are reactive, so this does not reproduce the Obj.update regression.
@@ -5,8 +5,7 @@
5
5
  import { type Registry } from '@effect-atom/atom-react';
6
6
  import type * as Types from 'effect/Types';
7
7
 
8
- import { Filter, JsonSchema, Obj, Order, Query, type QueryAST, Ref, Type } from '@dxos/echo';
9
- import { type View } from '@dxos/echo';
8
+ import { Filter, JsonSchema, Obj, Order, Query, type QueryAST, Ref, Type, type View } from '@dxos/echo';
10
9
  import {
11
10
  ProjectionModel,
12
11
  type SchemaPropertyDefinition,
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/Table.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\nimport * as Schema from 'effect/Schema';\nimport * as SchemaAST from 'effect/SchemaAST';\n\nimport { Annotation, JsonSchema, Obj, Ref, Type } from '@dxos/echo';\nimport { View } from '@dxos/echo';\nimport { FormInputAnnotation, type JsonPath, type JsonSchemaType, LabelAnnotation } from '@dxos/echo/internal';\nimport { ViewAnnotation } from '@dxos/schema';\n\nexport const Table = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n\n view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),\n\n sizes: Schema.Record({\n // TODO(wittjosiah): Should be JsonPath.\n key: Schema.String,\n value: Schema.Number,\n }).pipe(Schema.mutable, FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.table',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(['view']),\n Annotation.IconAnnotation.set({\n icon: 'ph--table--regular',\n hue: 'green',\n }),\n);\n\nexport interface Table extends Schema.Schema.Type<typeof Table> {}\n\ntype MakeProps = {\n name?: string;\n sizes?: Record<string, number>;\n view: View.View;\n /** Required to auto-size columns. */\n jsonSchema?: JsonSchemaType;\n};\n\n/**\n * Make a table as a view of a data set.\n */\nexport const make = ({ name, sizes = {}, view, jsonSchema }: MakeProps): Table => {\n const table = Obj.make(Table, { name, view: Ref.make(view), sizes } as Obj.MakeProps<typeof Table>);\n\n // Preset sizes.\n if (jsonSchema) {\n const schema = JsonSchema.toEffectSchema(jsonSchema);\n const properties = SchemaAST.getPropertySignatures(schema.ast);\n for (const property of properties) {\n const name = property.name.toString() as JsonPath;\n if (sizes?.[name]) {\n table.sizes[name] = sizes[name];\n continue;\n }\n\n Match.type<SchemaAST.AST>().pipe(\n Match.when({ _tag: 'BooleanKeyword' }, () => {\n table.sizes[name] = 100;\n }),\n Match.when({ _tag: 'NumberKeyword' }, () => {\n table.sizes[name] = 100;\n }),\n Match.orElse(() => {\n // Noop.\n }),\n )(property.type);\n }\n }\n\n return table;\n};\n"],
5
- "mappings": ";;;;;AAAA;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,eAAe;AAE3B,SAASC,YAAYC,YAAYC,KAAKC,KAAKC,YAAY;AACvD,SAASC,YAAY;AACrB,SAASC,qBAAyDC,uBAAuB;AACzF,SAASC,sBAAsB;AAExB,IAAMC,QAAeC,cAAO;EACjCC,MAAaC,cAAOC,KAAYC,eAAQ;EAExCC,MAAMZ,IAAIA,IAAIE,KAAKA,IAAI,EAAEQ,KAAKP,oBAAoBU,IAAI,KAAA,CAAA;EAEtDC,OAAcC,cAAO;;IAEnBC,KAAYP;IACZQ,OAAcC;EAChB,CAAA,EAAGR,KAAYS,gBAAShB,oBAAoBU,IAAI,KAAA,CAAA;AAClD,CAAA,EAAGH,KACDT,KAAKmB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBS,IAAI;EAAC;CAAO,GAC5BR,eAAeQ,IAAI;EAAC;CAAO,GAC3BhB,WAAW0B,eAAeV,IAAI;EAC5BW,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAgBK,IAAMC,OAAO,CAAC,EAAElB,MAAMM,QAAQ,CAAC,GAAGF,MAAMe,WAAU,MAAa;AACpE,QAAMC,QAAQ7B,IAAI2B,KAAKpB,OAAO;IAAEE;IAAMI,MAAMZ,IAAI0B,KAAKd,IAAAA;IAAOE;EAAM,CAAA;AAGlE,MAAIa,YAAY;AACd,UAAME,SAAS/B,WAAWgC,eAAeH,UAAAA;AACzC,UAAMI,aAAuBC,gCAAsBH,OAAOI,GAAG;AAC7D,eAAWC,YAAYH,YAAY;AACjC,YAAMvB,QAAO0B,SAAS1B,KAAK2B,SAAQ;AACnC,UAAIrB,QAAQN,KAAAA,GAAO;AACjBoB,cAAMd,MAAMN,KAAAA,IAAQM,MAAMN,KAAAA;AAC1B;MACF;AAEAd,MAAM0C,WAAI,EAAkB1B,KACpB2B,WAAK;QAAEC,MAAM;MAAiB,GAAG,MAAA;AACrCV,cAAMd,MAAMN,KAAAA,IAAQ;MACtB,CAAA,GACM6B,WAAK;QAAEC,MAAM;MAAgB,GAAG,MAAA;AACpCV,cAAMd,MAAMN,KAAAA,IAAQ;MACtB,CAAA,GACM+B,aAAO,MAAA;MAEb,CAAA,CAAA,EACAL,SAASE,IAAI;IACjB;EACF;AAEA,SAAOR;AACT;",
6
- "names": ["Match", "Schema", "SchemaAST", "Annotation", "JsonSchema", "Obj", "Ref", "Type", "View", "FormInputAnnotation", "LabelAnnotation", "ViewAnnotation", "Table", "Struct", "name", "String", "pipe", "optional", "view", "set", "sizes", "Record", "key", "value", "Number", "mutable", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "jsonSchema", "table", "schema", "toEffectSchema", "properties", "getPropertySignatures", "ast", "property", "toString", "type", "when", "_tag", "orElse"]
7
- }