@dxos/react-ui-mosaic 0.4.10-main.7ce71da → 0.4.10-main.8583d5a
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 { S } from '@dxos/echo-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,EAAE,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAC3C,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.8583d5a",
|
|
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",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"lodash.defaultsdeep": "^4.6.1",
|
|
25
25
|
"lodash.pick": "^4.4.0",
|
|
26
26
|
"react-resize-detector": "^7.1.2",
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/keys": "0.4.10-main.
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/react-ui-
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/react-ui-
|
|
35
|
-
"@dxos/
|
|
27
|
+
"@dxos/invariant": "0.4.10-main.8583d5a",
|
|
28
|
+
"@dxos/debug": "0.4.10-main.8583d5a",
|
|
29
|
+
"@dxos/keys": "0.4.10-main.8583d5a",
|
|
30
|
+
"@dxos/log": "0.4.10-main.8583d5a",
|
|
31
|
+
"@dxos/react-ui-card": "0.4.10-main.8583d5a",
|
|
32
|
+
"@dxos/react-ui-theme": "0.4.10-main.8583d5a",
|
|
33
|
+
"@dxos/util": "0.4.10-main.8583d5a",
|
|
34
|
+
"@dxos/react-ui-types": "0.4.10-main.8583d5a",
|
|
35
|
+
"@dxos/react-ui": "0.4.10-main.8583d5a"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"d3": "^7.8.5",
|
|
45
45
|
"react": "^18.2.0",
|
|
46
46
|
"react-dom": "^18.2.0",
|
|
47
|
-
"vite": "^5.1.
|
|
47
|
+
"vite": "^5.1.7",
|
|
48
48
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
49
|
+
"@dxos/gem-core": "0.4.10-main.8583d5a",
|
|
50
|
+
"@dxos/random": "0.4.10-main.8583d5a",
|
|
51
|
+
"@dxos/react-client": "0.4.10-main.8583d5a",
|
|
52
|
+
"@dxos/echo-schema": "0.4.10-main.8583d5a",
|
|
53
|
+
"@dxos/app-graph": "0.4.10-main.8583d5a",
|
|
54
|
+
"@dxos/storybook-utils": "0.4.10-main.8583d5a"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@phosphor-icons/react": "^2.0.5",
|
package/src/testing/generator.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
// TODO(burdon): Reconcile with @dxos/echo-generator.
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import type { S } from '@dxos/echo-schema';
|
|
8
|
+
import * as E from '@dxos/echo-schema';
|
|
9
9
|
import { faker } from '@dxos/random';
|
|
10
10
|
|
|
11
11
|
// TODO(burdon): Util.
|
|
@@ -17,12 +17,12 @@ export const range = <T>(fn: (i: number) => T | undefined, length: number): T[]
|
|
|
17
17
|
export type TestItem = { id: string; type: string } & Record<string, any>;
|
|
18
18
|
|
|
19
19
|
type ObjectDataGenerator = {
|
|
20
|
-
createSchema?: () => Schema
|
|
20
|
+
createSchema?: () => S.Schema<any>;
|
|
21
21
|
createData: () => any;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
type ObjectFactory<T extends
|
|
25
|
-
schema?: Schema
|
|
24
|
+
type ObjectFactory<T extends E.EchoReactiveObject<any>> = {
|
|
25
|
+
schema?: S.Schema<any>; // TODO(burdon): Support both typed and expando schema.
|
|
26
26
|
createObject: () => T;
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ const createFactory = ({ createSchema, createData }: ObjectDataGenerator) => {
|
|
|
32
32
|
const schema = createSchema?.();
|
|
33
33
|
return {
|
|
34
34
|
schema,
|
|
35
|
-
createObject: () =>
|
|
35
|
+
createObject: () => (schema ? E.object(schema, createData()) : E.object(createData())),
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
@@ -57,27 +57,34 @@ const defaultGenerators: { [type: string]: ObjectDataGenerator } = {
|
|
|
57
57
|
},
|
|
58
58
|
|
|
59
59
|
project: {
|
|
60
|
-
createSchema: () =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
60
|
+
// createSchema: () =>
|
|
61
|
+
// return object(StoredEchoSchema, {
|
|
62
|
+
// typename: 'Project',
|
|
63
|
+
// version: '0.1.0',
|
|
64
|
+
// jsonSchema: effectToJsonSchema(
|
|
65
|
+
//
|
|
66
|
+
// ),
|
|
67
|
+
// })
|
|
68
|
+
// new Schema({
|
|
69
|
+
// props: [
|
|
70
|
+
// {
|
|
71
|
+
// id: 'title',
|
|
72
|
+
// type: Schema.PropType.STRING,
|
|
73
|
+
// },
|
|
74
|
+
// {
|
|
75
|
+
// id: 'repo',
|
|
76
|
+
// type: Schema.PropType.STRING,
|
|
77
|
+
// },
|
|
78
|
+
// {
|
|
79
|
+
// id: 'status',
|
|
80
|
+
// type: Schema.PropType.STRING,
|
|
81
|
+
// },
|
|
82
|
+
// {
|
|
83
|
+
// id: 'priority',
|
|
84
|
+
// type: Schema.PropType.NUMBER,
|
|
85
|
+
// },
|
|
86
|
+
// ],
|
|
87
|
+
// }),
|
|
81
88
|
createData: () => ({
|
|
82
89
|
title: faker.commerce.productName(),
|
|
83
90
|
repo: faker.datatype.boolean({ probability: 0.3 }) ? faker.internet.url() : undefined,
|
|
@@ -102,7 +109,7 @@ export class TestObjectGenerator {
|
|
|
102
109
|
}, {});
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
get schema(): Schema[] {
|
|
112
|
+
get schema(): S.Schema<any>[] {
|
|
106
113
|
return Object.values(this.factories).map((f) => f.schema!);
|
|
107
114
|
}
|
|
108
115
|
|
|
@@ -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,
|