@dxos/react-ui-mosaic 0.4.10-main.b112538 → 0.4.10-main.b1e8dec
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type * as S from '@effect/schema/Schema';
|
|
2
|
+
import * as E from '@dxos/echo-schema';
|
|
3
3
|
export declare const range: <T>(fn: (i: number) => T | undefined, length: number) => T[];
|
|
4
4
|
export type TestItem = {
|
|
5
5
|
id: string;
|
|
6
6
|
type: string;
|
|
7
7
|
} & Record<string, any>;
|
|
8
|
-
type ObjectFactory<T extends
|
|
9
|
-
schema?: Schema
|
|
8
|
+
type ObjectFactory<T extends E.EchoReactiveObject<any>> = {
|
|
9
|
+
schema?: S.Schema<any>;
|
|
10
10
|
createObject: () => T;
|
|
11
11
|
};
|
|
12
12
|
type ObjectFactoryMap = {
|
|
@@ -23,7 +23,7 @@ export declare class TestObjectGenerator {
|
|
|
23
23
|
types?: string[];
|
|
24
24
|
factories?: ObjectFactoryMap;
|
|
25
25
|
});
|
|
26
|
-
get schema(): Schema[];
|
|
26
|
+
get schema(): S.Schema<any>[];
|
|
27
27
|
createObject({ types }?: {
|
|
28
28
|
types?: string[];
|
|
29
29
|
}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAEhD,OAAO,KAAK,CAAC,MAAM,mBAAmB,CAAC;AAIvC,eAAO,MAAM,KAAK,cAAe,MAAM,4BAA4B,MAAM,QAG9C,CAAC;AAE5B,MAAM,MAAM,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAO1E,KAAK,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI;IACxD,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC,CAAC;CACvB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AAW/D,eAAO,MAAM,MAAM,UAAgC,CAAC;AACpD,eAAO,MAAM,QAAQ,UAAkB,CAAC;AAwDxC;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,SAAgB,SAAS,EAAE,gBAAgB,CAAC;gBAEhC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;KAAO;IASzF,IAAI,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAE5B;IAED,YAAY,CAAC,EAAE,KAAK,EAAE,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO;IAMjD,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAGtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-mosaic",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.b1e8dec",
|
|
4
4
|
"description": "An intermediate interface for drag-and-drop interactions.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -19,20 +19,22 @@
|
|
|
19
19
|
"@dnd-kit/modifiers": "^6.0.0",
|
|
20
20
|
"@dnd-kit/sortable": "^7.0.1",
|
|
21
21
|
"@dnd-kit/utilities": "^3.2.0",
|
|
22
|
+
"@effect/schema": "0.64.7",
|
|
22
23
|
"@preact/signals-core": "^1.6.0",
|
|
23
24
|
"@radix-ui/react-compose-refs": "^1.0.0",
|
|
25
|
+
"effect": "2.4.9",
|
|
24
26
|
"lodash.defaultsdeep": "^4.6.1",
|
|
25
27
|
"lodash.pick": "^4.4.0",
|
|
26
28
|
"react-resize-detector": "^7.1.2",
|
|
27
|
-
"@dxos/debug": "0.4.10-main.
|
|
28
|
-
"@dxos/invariant": "0.4.10-main.
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/react-ui
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/react-ui": "0.4.10-main.
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/react-ui-
|
|
35
|
-
"@dxos/
|
|
29
|
+
"@dxos/debug": "0.4.10-main.b1e8dec",
|
|
30
|
+
"@dxos/invariant": "0.4.10-main.b1e8dec",
|
|
31
|
+
"@dxos/keys": "0.4.10-main.b1e8dec",
|
|
32
|
+
"@dxos/react-ui": "0.4.10-main.b1e8dec",
|
|
33
|
+
"@dxos/log": "0.4.10-main.b1e8dec",
|
|
34
|
+
"@dxos/react-ui-card": "0.4.10-main.b1e8dec",
|
|
35
|
+
"@dxos/react-ui-types": "0.4.10-main.b1e8dec",
|
|
36
|
+
"@dxos/react-ui-theme": "0.4.10-main.b1e8dec",
|
|
37
|
+
"@dxos/util": "0.4.10-main.b1e8dec"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
38
40
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -46,12 +48,12 @@
|
|
|
46
48
|
"react-dom": "^18.2.0",
|
|
47
49
|
"vite": "^5.1.5",
|
|
48
50
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
49
|
-
"@dxos/app-graph": "0.4.10-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-client": "0.4.10-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/storybook-utils": "0.4.10-main.
|
|
51
|
+
"@dxos/app-graph": "0.4.10-main.b1e8dec",
|
|
52
|
+
"@dxos/gem-core": "0.4.10-main.b1e8dec",
|
|
53
|
+
"@dxos/echo-schema": "0.4.10-main.b1e8dec",
|
|
54
|
+
"@dxos/react-client": "0.4.10-main.b1e8dec",
|
|
55
|
+
"@dxos/random": "0.4.10-main.b1e8dec",
|
|
56
|
+
"@dxos/storybook-utils": "0.4.10-main.b1e8dec"
|
|
55
57
|
},
|
|
56
58
|
"peerDependencies": {
|
|
57
59
|
"@phosphor-icons/react": "^2.0.5",
|
package/src/testing/generator.ts
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
// TODO(burdon): Reconcile with @dxos/echo-generator.
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
|
|
7
|
+
import type * as S from '@effect/schema/Schema';
|
|
8
|
+
|
|
9
|
+
import * as E from '@dxos/echo-schema';
|
|
9
10
|
import { faker } from '@dxos/random';
|
|
10
11
|
|
|
11
12
|
// TODO(burdon): Util.
|
|
@@ -17,12 +18,12 @@ export const range = <T>(fn: (i: number) => T | undefined, length: number): T[]
|
|
|
17
18
|
export type TestItem = { id: string; type: string } & Record<string, any>;
|
|
18
19
|
|
|
19
20
|
type ObjectDataGenerator = {
|
|
20
|
-
createSchema?: () => Schema
|
|
21
|
+
createSchema?: () => S.Schema<any>;
|
|
21
22
|
createData: () => any;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
type ObjectFactory<T extends
|
|
25
|
-
schema?: Schema
|
|
25
|
+
type ObjectFactory<T extends E.EchoReactiveObject<any>> = {
|
|
26
|
+
schema?: S.Schema<any>; // TODO(burdon): Support both typed and expando schema.
|
|
26
27
|
createObject: () => T;
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -32,7 +33,7 @@ const createFactory = ({ createSchema, createData }: ObjectDataGenerator) => {
|
|
|
32
33
|
const schema = createSchema?.();
|
|
33
34
|
return {
|
|
34
35
|
schema,
|
|
35
|
-
createObject: () =>
|
|
36
|
+
createObject: () => (schema ? E.object(schema, createData()) : E.object(createData())),
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -57,27 +58,34 @@ const defaultGenerators: { [type: string]: ObjectDataGenerator } = {
|
|
|
57
58
|
},
|
|
58
59
|
|
|
59
60
|
project: {
|
|
60
|
-
createSchema: () =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
// createSchema: () =>
|
|
62
|
+
// return object(StoredEchoSchema, {
|
|
63
|
+
// typename: 'Project',
|
|
64
|
+
// version: '0.1.0',
|
|
65
|
+
// jsonSchema: effectToJsonSchema(
|
|
66
|
+
//
|
|
67
|
+
// ),
|
|
68
|
+
// })
|
|
69
|
+
// new Schema({
|
|
70
|
+
// props: [
|
|
71
|
+
// {
|
|
72
|
+
// id: 'title',
|
|
73
|
+
// type: Schema.PropType.STRING,
|
|
74
|
+
// },
|
|
75
|
+
// {
|
|
76
|
+
// id: 'repo',
|
|
77
|
+
// type: Schema.PropType.STRING,
|
|
78
|
+
// },
|
|
79
|
+
// {
|
|
80
|
+
// id: 'status',
|
|
81
|
+
// type: Schema.PropType.STRING,
|
|
82
|
+
// },
|
|
83
|
+
// {
|
|
84
|
+
// id: 'priority',
|
|
85
|
+
// type: Schema.PropType.NUMBER,
|
|
86
|
+
// },
|
|
87
|
+
// ],
|
|
88
|
+
// }),
|
|
81
89
|
createData: () => ({
|
|
82
90
|
title: faker.commerce.productName(),
|
|
83
91
|
repo: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,
|
|
@@ -102,7 +110,7 @@ export class TestObjectGenerator {
|
|
|
102
110
|
}, {});
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
get schema(): Schema[] {
|
|
113
|
+
get schema(): S.Schema<any>[] {
|
|
106
114
|
return Object.values(this.factories).map((f) => f.schema!);
|
|
107
115
|
}
|
|
108
116
|
|
|
@@ -6,7 +6,7 @@ import React, { type FC } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { faker } from '@dxos/random';
|
|
8
8
|
import { type PublicKey } from '@dxos/react-client';
|
|
9
|
-
import
|
|
9
|
+
import * as E from '@dxos/react-client/echo';
|
|
10
10
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
11
11
|
import { withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
const objects = [
|
|
50
50
|
factory.schema,
|
|
51
51
|
...range(factory.createObject, 10),
|
|
52
|
-
|
|
52
|
+
E.object({
|
|
53
53
|
type: 'kanban',
|
|
54
54
|
title: 'Projects',
|
|
55
55
|
schema: factory.schema,
|