@dxos/plugin-masonry 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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.
- package/dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs +57 -0
- package/dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -75
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +30 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +3 -1
- package/dist/lib/browser/types/index.mjs.map +3 -3
- package/dist/lib/node-esm/MasonryPlugin-YENAI2WP.mjs +58 -0
- package/dist/lib/node-esm/MasonryPlugin-YENAI2WP.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -75
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +31 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +3 -1
- package/dist/lib/node-esm/types/index.mjs.map +3 -3
- package/dist/types/src/MasonryPlugin.d.ts +1 -0
- package/dist/types/src/MasonryPlugin.d.ts.map +1 -1
- package/dist/types/src/MasonryPlugin.test.d.ts +2 -0
- package/dist/types/src/MasonryPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/containers/MasonryContainer/MasonryContainer.d.ts.map +1 -1
- package/dist/types/src/containers/MasonryContainer/MasonryContainer.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +10 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Masonry.d.ts +2 -2
- package/dist/types/src/types/Masonry.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -36
- package/src/MasonryPlugin.test.ts +26 -0
- package/src/MasonryPlugin.tsx +4 -3
- package/src/capabilities/react-surface.tsx +4 -2
- package/src/containers/MasonryContainer/MasonryContainer.tsx +9 -3
- package/src/index.ts +6 -2
- package/src/types/Masonry.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-masonry",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.abd8ff62ef",
|
|
4
4
|
"description": "Masonry DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
+
"#plugin": "./src/MasonryPlugin.tsx",
|
|
16
17
|
"#capabilities": "./src/capabilities/index.ts",
|
|
17
18
|
"#components": "./src/components/index.ts",
|
|
18
19
|
"#containers": "./src/containers/index.ts",
|
|
19
20
|
"#meta": "./src/meta.ts",
|
|
21
|
+
"#translations": "./src/translations.ts",
|
|
20
22
|
"#types": "./src/types/index.ts"
|
|
21
23
|
},
|
|
22
24
|
"exports": {
|
|
@@ -26,6 +28,12 @@
|
|
|
26
28
|
"browser": "./dist/lib/browser/index.mjs",
|
|
27
29
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
28
30
|
},
|
|
31
|
+
"./translations": {
|
|
32
|
+
"source": "./src/translations.ts",
|
|
33
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
34
|
+
"browser": "./dist/lib/browser/translations.mjs",
|
|
35
|
+
"node": "./dist/lib/node-esm/translations.mjs"
|
|
36
|
+
},
|
|
29
37
|
"./types": {
|
|
30
38
|
"source": "./src/types/index.ts",
|
|
31
39
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -34,37 +42,31 @@
|
|
|
34
42
|
}
|
|
35
43
|
},
|
|
36
44
|
"types": "dist/types/src/index.d.ts",
|
|
37
|
-
"typesVersions": {
|
|
38
|
-
"*": {
|
|
39
|
-
"types": [
|
|
40
|
-
"dist/types/src/types/index.d.ts"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
45
|
"files": [
|
|
45
46
|
"dist",
|
|
46
47
|
"src"
|
|
47
48
|
],
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
50
|
-
"@dxos/app-toolkit": "0.8.4-main.
|
|
51
|
-
"@dxos/echo": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/plugin-client": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/plugin-search": "0.8.4-main.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/react-
|
|
59
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
60
|
-
"@dxos/react-ui-
|
|
61
|
-
"@dxos/react-ui-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/react-ui-
|
|
64
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
65
|
-
"@dxos/schema": "0.8.4-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/util": "0.8.4-main.
|
|
50
|
+
"@dxos/app-framework": "0.8.4-main.abd8ff62ef",
|
|
51
|
+
"@dxos/app-toolkit": "0.8.4-main.abd8ff62ef",
|
|
52
|
+
"@dxos/echo": "0.8.4-main.abd8ff62ef",
|
|
53
|
+
"@dxos/compute": "0.8.4-main.abd8ff62ef",
|
|
54
|
+
"@dxos/plugin-client": "0.8.4-main.abd8ff62ef",
|
|
55
|
+
"@dxos/plugin-space": "0.8.4-main.abd8ff62ef",
|
|
56
|
+
"@dxos/plugin-search": "0.8.4-main.abd8ff62ef",
|
|
57
|
+
"@dxos/react-client": "0.8.4-main.abd8ff62ef",
|
|
58
|
+
"@dxos/effect": "0.8.4-main.abd8ff62ef",
|
|
59
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
60
|
+
"@dxos/react-ui-form": "0.8.4-main.abd8ff62ef",
|
|
61
|
+
"@dxos/react-ui-list": "0.8.4-main.abd8ff62ef",
|
|
62
|
+
"@dxos/react-ui-menu": "0.8.4-main.abd8ff62ef",
|
|
63
|
+
"@dxos/react-ui-masonry": "0.8.4-main.abd8ff62ef",
|
|
64
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.abd8ff62ef",
|
|
65
|
+
"@dxos/react-ui-stack": "0.8.4-main.abd8ff62ef",
|
|
66
|
+
"@dxos/schema": "0.8.4-main.abd8ff62ef",
|
|
67
|
+
"@dxos/react-ui-search": "0.8.4-main.abd8ff62ef",
|
|
68
|
+
"@dxos/util": "0.8.4-main.abd8ff62ef",
|
|
69
|
+
"@dxos/types": "0.8.4-main.abd8ff62ef"
|
|
68
70
|
},
|
|
69
71
|
"devDependencies": {
|
|
70
72
|
"@types/react": "~19.2.7",
|
|
@@ -72,20 +74,20 @@
|
|
|
72
74
|
"effect": "3.20.0",
|
|
73
75
|
"react": "~19.2.3",
|
|
74
76
|
"react-dom": "~19.2.3",
|
|
75
|
-
"vite": "^
|
|
76
|
-
"@dxos/plugin-
|
|
77
|
-
"@dxos/plugin-
|
|
78
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
77
|
+
"vite": "^8.0.10",
|
|
78
|
+
"@dxos/plugin-testing": "0.8.4-main.abd8ff62ef",
|
|
79
|
+
"@dxos/plugin-preview": "0.8.4-main.abd8ff62ef",
|
|
80
|
+
"@dxos/plugin-theme": "0.8.4-main.abd8ff62ef",
|
|
81
|
+
"@dxos/random": "0.8.4-main.abd8ff62ef",
|
|
82
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef",
|
|
83
|
+
"@dxos/storybook-utils": "0.8.4-main.abd8ff62ef"
|
|
82
84
|
},
|
|
83
85
|
"peerDependencies": {
|
|
84
86
|
"effect": "3.20.0",
|
|
85
87
|
"react": "~19.2.3",
|
|
86
88
|
"react-dom": "~19.2.3",
|
|
87
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
88
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
89
|
+
"@dxos/react-ui": "0.8.4-main.abd8ff62ef",
|
|
90
|
+
"@dxos/ui-theme": "0.8.4-main.abd8ff62ef"
|
|
89
91
|
},
|
|
90
92
|
"publishConfig": {
|
|
91
93
|
"access": "public"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ClientPlugin } from '@dxos/plugin-client';
|
|
8
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
9
|
+
|
|
10
|
+
import { MasonryPlugin } from '#plugin';
|
|
11
|
+
|
|
12
|
+
import { meta } from './meta';
|
|
13
|
+
|
|
14
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
15
|
+
|
|
16
|
+
describe('MasonryPlugin', () => {
|
|
17
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
18
|
+
await using harness = await createComposerTestApp({
|
|
19
|
+
plugins: [ClientPlugin({}), MasonryPlugin()],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
expect(harness.manager.getActive()).toEqual(
|
|
23
|
+
expect.arrayContaining([moduleId('metadata'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
});
|
package/src/MasonryPlugin.tsx
CHANGED
|
@@ -7,18 +7,17 @@ import * as Option from 'effect/Option';
|
|
|
7
7
|
|
|
8
8
|
import { Plugin } from '@dxos/app-framework';
|
|
9
9
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
10
11
|
import { Annotation, Type } from '@dxos/echo';
|
|
11
|
-
import { Operation } from '@dxos/operation';
|
|
12
12
|
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
13
|
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
14
14
|
import { ViewModel } from '@dxos/schema';
|
|
15
15
|
|
|
16
16
|
import { ReactSurface } from '#capabilities';
|
|
17
17
|
import { meta } from '#meta';
|
|
18
|
+
import { translations } from '#translations';
|
|
18
19
|
import { Masonry, MasonryAction } from '#types';
|
|
19
20
|
|
|
20
|
-
import { translations } from './translations';
|
|
21
|
-
|
|
22
21
|
export const MasonryPlugin = Plugin.define(meta).pipe(
|
|
23
22
|
AppPlugin.addMetadataModule({
|
|
24
23
|
metadata: {
|
|
@@ -48,3 +47,5 @@ export const MasonryPlugin = Plugin.define(meta).pipe(
|
|
|
48
47
|
AppPlugin.addTranslationsModule({ translations }),
|
|
49
48
|
Plugin.make,
|
|
50
49
|
);
|
|
50
|
+
|
|
51
|
+
export default MasonryPlugin;
|
|
@@ -20,8 +20,10 @@ export default Capability.makeModule(() =>
|
|
|
20
20
|
Surface.create({
|
|
21
21
|
id: 'root',
|
|
22
22
|
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
filter: AppSurface.oneOf(
|
|
24
|
+
AppSurface.object(AppSurface.Article, [Masonry.Masonry, View.View]),
|
|
25
|
+
AppSurface.object(AppSurface.Section, [Masonry.Masonry, View.View]),
|
|
26
|
+
),
|
|
25
27
|
component: ({ data, role }) => {
|
|
26
28
|
const view = Obj.instanceOf(View.View, data.subject) ? data.subject : data.subject.view;
|
|
27
29
|
return <MasonryContainer view={view} role={role} />;
|
|
@@ -9,7 +9,7 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
9
9
|
|
|
10
10
|
import { Surface, useCapabilities } from '@dxos/app-framework/ui';
|
|
11
11
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
|
-
import {
|
|
12
|
+
import { AppSurface, useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
13
13
|
import { Annotation, Filter, Obj, Query, type Ref, Type } from '@dxos/echo';
|
|
14
14
|
import { type View } from '@dxos/echo';
|
|
15
15
|
import { useObject, useQuery } from '@dxos/react-client/echo';
|
|
@@ -87,7 +87,9 @@ export const MasonryContainer = ({
|
|
|
87
87
|
</Toolbar.Root>
|
|
88
88
|
</Panel.Toolbar>
|
|
89
89
|
<Panel.Content>
|
|
90
|
-
<MasonryComponent.Content
|
|
90
|
+
<MasonryComponent.Content>
|
|
91
|
+
<MasonryComponent.Viewport items={results} getId={(data: any) => data?.id} />
|
|
92
|
+
</MasonryComponent.Content>
|
|
91
93
|
</Panel.Content>
|
|
92
94
|
</Panel.Root>
|
|
93
95
|
</SearchList.Root>
|
|
@@ -117,7 +119,11 @@ const Item = ({ data }: { data: any }) => {
|
|
|
117
119
|
</Menu.Trigger>
|
|
118
120
|
<Menu.Content items={objectMenuItems} />
|
|
119
121
|
</Card.Toolbar>
|
|
120
|
-
<Surface.Surface
|
|
122
|
+
<Surface.Surface
|
|
123
|
+
type={AppSurface.Card}
|
|
124
|
+
limit={1}
|
|
125
|
+
data={{ subject: data } satisfies AppSurface.ObjectCardData}
|
|
126
|
+
/>
|
|
121
127
|
</Card.Root>
|
|
122
128
|
</Menu.Root>
|
|
123
129
|
);
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
6
8
|
|
|
7
|
-
export
|
|
9
|
+
export const MasonryPlugin = Plugin.lazy(meta, () => import('./MasonryPlugin'));
|
|
10
|
+
|
|
11
|
+
export * from './meta';
|
package/src/types/Masonry.ts
CHANGED