@dxos/plugin-masonry 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/MasonryContainer-ND5DKOA5.mjs +103 -0
- package/dist/lib/neutral/MasonryContainer-ND5DKOA5.mjs.map +7 -0
- package/dist/lib/neutral/MasonryPlugin.mjs +26 -0
- package/dist/lib/neutral/MasonryPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +11 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-E42CTC55.mjs +19 -0
- package/dist/lib/neutral/chunk-E42CTC55.mjs.map +7 -0
- package/dist/lib/{browser/types/index.mjs → neutral/chunk-HDBVJK6S.mjs} +10 -8
- package/dist/lib/neutral/chunk-HDBVJK6S.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-WRCYV4HT.mjs +39 -0
- package/dist/lib/neutral/create-object-WRCYV4HT.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +14 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-7CZHE3XA.mjs +35 -0
- package/dist/lib/neutral/react-surface-7CZHE3XA.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +30 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- 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/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/containers/MasonryContainer/MasonryContainer.d.ts +1 -2
- 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 +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- 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 +3 -4
- package/dist/types/src/types/Masonry.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +76 -49
- package/src/MasonryPlugin.test.ts +26 -0
- package/src/MasonryPlugin.tsx +6 -35
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/react-surface.tsx +5 -4
- package/src/containers/MasonryContainer/MasonryContainer.stories.tsx +4 -4
- package/src/containers/MasonryContainer/MasonryContainer.tsx +10 -5
- package/src/index.ts +1 -2
- package/src/plugin.ts +9 -0
- package/src/types/Masonry.ts +2 -3
- package/src/types/MasonryAction.ts +1 -1
- package/dist/lib/browser/index.mjs +0 -97
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/index.mjs +0 -98
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/types/index.mjs +0 -67
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/components/index.mjs.map} +0 -0
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.765dc60934",
|
|
4
4
|
"description": "Masonry DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,63 +8,90 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/dxos/dxos"
|
|
10
10
|
},
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
15
|
"imports": {
|
|
16
|
-
"#capabilities":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#containers": {
|
|
27
|
+
"source": "./src/containers/index.ts",
|
|
28
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#meta": {
|
|
32
|
+
"source": "./src/meta.ts",
|
|
33
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#plugin": {
|
|
37
|
+
"source": "./src/MasonryPlugin.tsx",
|
|
38
|
+
"types": "./dist/types/src/MasonryPlugin.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/MasonryPlugin.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#translations": {
|
|
42
|
+
"source": "./src/translations.ts",
|
|
43
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
44
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
45
|
+
},
|
|
46
|
+
"#types": {
|
|
47
|
+
"source": "./src/types/index.ts",
|
|
48
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
49
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
50
|
+
}
|
|
21
51
|
},
|
|
22
52
|
"exports": {
|
|
23
53
|
".": {
|
|
24
54
|
"source": "./src/index.ts",
|
|
25
55
|
"types": "./dist/types/src/index.d.ts",
|
|
26
|
-
"
|
|
27
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
56
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
28
57
|
},
|
|
29
|
-
"./
|
|
30
|
-
"source": "./src/
|
|
31
|
-
"types": "./dist/types/src/
|
|
32
|
-
"
|
|
33
|
-
|
|
58
|
+
"./plugin": {
|
|
59
|
+
"source": "./src/plugin.ts",
|
|
60
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
62
|
+
},
|
|
63
|
+
"./translations": {
|
|
64
|
+
"source": "./src/translations.ts",
|
|
65
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
66
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
34
67
|
}
|
|
35
68
|
},
|
|
36
69
|
"types": "dist/types/src/index.d.ts",
|
|
37
|
-
"typesVersions": {
|
|
38
|
-
"*": {
|
|
39
|
-
"types": [
|
|
40
|
-
"dist/types/src/types/index.d.ts"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
70
|
"files": [
|
|
45
71
|
"dist",
|
|
46
72
|
"src"
|
|
47
73
|
],
|
|
48
74
|
"dependencies": {
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/app-
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/plugin-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/plugin-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/react-client": "0.8.4-main.
|
|
58
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
59
|
-
"@dxos/react-ui-
|
|
60
|
-
"@dxos/react-ui-
|
|
61
|
-
"@dxos/react-ui-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-ui-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
75
|
+
"@dxos/compute": "0.8.4-main.765dc60934",
|
|
76
|
+
"@dxos/app-framework": "0.8.4-main.765dc60934",
|
|
77
|
+
"@dxos/effect": "0.8.4-main.765dc60934",
|
|
78
|
+
"@dxos/app-toolkit": "0.8.4-main.765dc60934",
|
|
79
|
+
"@dxos/plugin-client": "0.8.4-main.765dc60934",
|
|
80
|
+
"@dxos/plugin-search": "0.8.4-main.765dc60934",
|
|
81
|
+
"@dxos/plugin-space": "0.8.4-main.765dc60934",
|
|
82
|
+
"@dxos/echo": "0.8.4-main.765dc60934",
|
|
83
|
+
"@dxos/react-client": "0.8.4-main.765dc60934",
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.765dc60934",
|
|
85
|
+
"@dxos/react-ui-form": "0.8.4-main.765dc60934",
|
|
86
|
+
"@dxos/react-ui-list": "0.8.4-main.765dc60934",
|
|
87
|
+
"@dxos/react-ui-masonry": "0.8.4-main.765dc60934",
|
|
88
|
+
"@dxos/react-ui-menu": "0.8.4-main.765dc60934",
|
|
89
|
+
"@dxos/schema": "0.8.4-main.765dc60934",
|
|
90
|
+
"@dxos/react-ui-search": "0.8.4-main.765dc60934",
|
|
91
|
+
"@dxos/react-ui-stack": "0.8.4-main.765dc60934",
|
|
92
|
+
"@dxos/types": "0.8.4-main.765dc60934",
|
|
93
|
+
"@dxos/util": "0.8.4-main.765dc60934",
|
|
94
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.765dc60934"
|
|
68
95
|
},
|
|
69
96
|
"devDependencies": {
|
|
70
97
|
"@types/react": "~19.2.7",
|
|
@@ -72,20 +99,20 @@
|
|
|
72
99
|
"effect": "3.20.0",
|
|
73
100
|
"react": "~19.2.3",
|
|
74
101
|
"react-dom": "~19.2.3",
|
|
75
|
-
"vite": "^
|
|
76
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
77
|
-
"@dxos/plugin-testing": "0.8.4-main.
|
|
78
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
102
|
+
"vite": "^8.0.13",
|
|
103
|
+
"@dxos/plugin-preview": "0.8.4-main.765dc60934",
|
|
104
|
+
"@dxos/plugin-testing": "0.8.4-main.765dc60934",
|
|
105
|
+
"@dxos/plugin-theme": "0.8.4-main.765dc60934",
|
|
106
|
+
"@dxos/random": "0.8.4-main.765dc60934",
|
|
107
|
+
"@dxos/storybook-utils": "0.8.4-main.765dc60934",
|
|
108
|
+
"@dxos/ui-theme": "0.8.4-main.765dc60934"
|
|
82
109
|
},
|
|
83
110
|
"peerDependencies": {
|
|
84
111
|
"effect": "3.20.0",
|
|
85
112
|
"react": "~19.2.3",
|
|
86
113
|
"react-dom": "~19.2.3",
|
|
87
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
88
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
114
|
+
"@dxos/react-ui": "0.8.4-main.765dc60934",
|
|
115
|
+
"@dxos/ui-theme": "0.8.4-main.765dc60934"
|
|
89
116
|
},
|
|
90
117
|
"publishConfig": {
|
|
91
118
|
"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/plugin';
|
|
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('CreateObject'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
});
|
package/src/MasonryPlugin.tsx
CHANGED
|
@@ -2,49 +2,20 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Option from 'effect/Option';
|
|
7
|
-
|
|
8
5
|
import { Plugin } from '@dxos/app-framework';
|
|
9
6
|
import { AppPlugin } from '@dxos/app-toolkit';
|
|
10
|
-
import { Annotation, Type } from '@dxos/echo';
|
|
11
|
-
import { Operation } from '@dxos/operation';
|
|
12
|
-
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
13
|
-
import { type CreateObject } from '@dxos/plugin-space/types';
|
|
14
|
-
import { ViewModel } from '@dxos/schema';
|
|
15
7
|
|
|
16
|
-
import { ReactSurface } from '#capabilities';
|
|
8
|
+
import { CreateObject, ReactSurface } from '#capabilities';
|
|
17
9
|
import { meta } from '#meta';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
import { translations } from './translations';
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
import { Masonry } from '#types';
|
|
21
12
|
|
|
22
13
|
export const MasonryPlugin = Plugin.define(meta).pipe(
|
|
23
|
-
AppPlugin.
|
|
24
|
-
metadata: {
|
|
25
|
-
id: Type.getTypename(Masonry.Masonry),
|
|
26
|
-
metadata: {
|
|
27
|
-
icon: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).icon,
|
|
28
|
-
iconHue: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).hue ?? 'white',
|
|
29
|
-
inputSchema: MasonryAction.MasonryProps,
|
|
30
|
-
createObject: ((props, options) =>
|
|
31
|
-
Effect.gen(function* () {
|
|
32
|
-
const object = yield* Effect.promise(async () => {
|
|
33
|
-
const { view } = await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename });
|
|
34
|
-
return Masonry.make({ name: props.name, view });
|
|
35
|
-
});
|
|
36
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
37
|
-
object,
|
|
38
|
-
target: options.target,
|
|
39
|
-
hidden: true,
|
|
40
|
-
targetNodeId: options.targetNodeId,
|
|
41
|
-
});
|
|
42
|
-
})) satisfies CreateObject,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
14
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
46
15
|
AppPlugin.addSchemaModule({ schema: [Masonry.Masonry] }),
|
|
47
16
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
48
17
|
AppPlugin.addTranslationsModule({ translations }),
|
|
49
18
|
Plugin.make,
|
|
50
19
|
);
|
|
20
|
+
|
|
21
|
+
export default MasonryPlugin;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
|
+
import { ViewModel } from '@dxos/schema';
|
|
13
|
+
|
|
14
|
+
import { Masonry, MasonryAction } from '#types';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
19
|
+
id: Type.getTypename(Masonry.Masonry),
|
|
20
|
+
inputSchema: MasonryAction.MasonryProps,
|
|
21
|
+
createObject: (props, options) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const object = yield* Effect.promise(async () => {
|
|
24
|
+
const { view } = await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename });
|
|
25
|
+
return Masonry.make({ name: props.name, view });
|
|
26
|
+
});
|
|
27
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
28
|
+
object,
|
|
29
|
+
target: options.target,
|
|
30
|
+
hidden: true,
|
|
31
|
+
targetNodeId: options.targetNodeId,
|
|
32
|
+
});
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
@@ -8,8 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
9
|
import { Surface } from '@dxos/app-framework/ui';
|
|
10
10
|
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
-
import { Obj } from '@dxos/echo';
|
|
12
|
-
import { View } from '@dxos/echo';
|
|
11
|
+
import { Obj, View } from '@dxos/echo';
|
|
13
12
|
|
|
14
13
|
import { MasonryContainer } from '#containers';
|
|
15
14
|
import { Masonry } from '#types';
|
|
@@ -20,8 +19,10 @@ export default Capability.makeModule(() =>
|
|
|
20
19
|
Surface.create({
|
|
21
20
|
id: 'root',
|
|
22
21
|
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
filter: AppSurface.oneOf(
|
|
23
|
+
AppSurface.object(AppSurface.Article, [Masonry.Masonry, View.View]),
|
|
24
|
+
AppSurface.object(AppSurface.Section, [Masonry.Masonry, View.View]),
|
|
25
|
+
),
|
|
25
26
|
component: ({ data, role }) => {
|
|
26
27
|
const view = Obj.instanceOf(View.View, data.subject) ? data.subject : data.subject.view;
|
|
27
28
|
return <MasonryContainer view={view} role={role} />;
|
|
@@ -7,13 +7,13 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { View } from '@dxos/echo';
|
|
11
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
10
|
+
import { Filter, View } from '@dxos/echo';
|
|
11
|
+
import { ClientPlugin } from '@dxos/plugin-client/testing';
|
|
12
12
|
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
13
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
13
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
14
14
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
15
15
|
import { random } from '@dxos/random';
|
|
16
|
-
import {
|
|
16
|
+
import { useObject, useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
17
17
|
import { ViewModel } from '@dxos/schema';
|
|
18
18
|
import { createObjectFactory } from '@dxos/schema/testing';
|
|
19
19
|
import { Organization } from '@dxos/types';
|
|
@@ -9,9 +9,8 @@ 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 {
|
|
13
|
-
import { Annotation, Filter, Obj, Query, type Ref, Type } from '@dxos/echo';
|
|
14
|
-
import { type View } from '@dxos/echo';
|
|
12
|
+
import { AppSurface, useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { Annotation, Filter, Obj, Query, type Ref, Type, type View } from '@dxos/echo';
|
|
15
14
|
import { useObject, useQuery } from '@dxos/react-client/echo';
|
|
16
15
|
import { Card, Panel, Toolbar } from '@dxos/react-ui';
|
|
17
16
|
import { Masonry as MasonryComponent } from '@dxos/react-ui-masonry';
|
|
@@ -87,7 +86,9 @@ export const MasonryContainer = ({
|
|
|
87
86
|
</Toolbar.Root>
|
|
88
87
|
</Panel.Toolbar>
|
|
89
88
|
<Panel.Content>
|
|
90
|
-
<MasonryComponent.Content
|
|
89
|
+
<MasonryComponent.Content>
|
|
90
|
+
<MasonryComponent.Viewport items={results} getId={(data: any) => data?.id} />
|
|
91
|
+
</MasonryComponent.Content>
|
|
91
92
|
</Panel.Content>
|
|
92
93
|
</Panel.Root>
|
|
93
94
|
</SearchList.Root>
|
|
@@ -117,7 +118,11 @@ const Item = ({ data }: { data: any }) => {
|
|
|
117
118
|
</Menu.Trigger>
|
|
118
119
|
<Menu.Content items={objectMenuItems} />
|
|
119
120
|
</Card.Toolbar>
|
|
120
|
-
<Surface.Surface
|
|
121
|
+
<Surface.Surface
|
|
122
|
+
type={AppSurface.Card}
|
|
123
|
+
limit={1}
|
|
124
|
+
data={{ subject: data } satisfies AppSurface.ObjectCardData}
|
|
125
|
+
/>
|
|
121
126
|
</Card.Root>
|
|
122
127
|
</Menu.Root>
|
|
123
128
|
);
|
package/src/index.ts
CHANGED
package/src/plugin.ts
ADDED
package/src/types/Masonry.ts
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { Annotation, Obj, Ref, Type } from '@dxos/echo';
|
|
8
|
-
import { View } from '@dxos/echo';
|
|
7
|
+
import { Annotation, Obj, Ref, Type, View } from '@dxos/echo';
|
|
9
8
|
import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
|
|
10
9
|
import { ViewAnnotation } from '@dxos/schema';
|
|
11
10
|
|
|
@@ -27,7 +26,7 @@ export const Masonry = Schema.Struct({
|
|
|
27
26
|
version: '0.1.0',
|
|
28
27
|
}),
|
|
29
28
|
LabelAnnotation.set(['name']),
|
|
30
|
-
ViewAnnotation.set(
|
|
29
|
+
ViewAnnotation.set(['view']),
|
|
31
30
|
Annotation.IconAnnotation.set({
|
|
32
31
|
icon: 'ph--wall--regular',
|
|
33
32
|
hue: 'green',
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import { TypeInputOptionsAnnotation } from '@dxos/plugin-space
|
|
7
|
+
import { TypeInputOptionsAnnotation } from '@dxos/plugin-space';
|
|
8
8
|
|
|
9
9
|
export const MasonryProps = Schema.Struct({
|
|
10
10
|
name: Schema.optional(Schema.String),
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/meta.ts
|
|
4
|
-
import { trim } from "@dxos/util";
|
|
5
|
-
var meta = {
|
|
6
|
-
id: "org.dxos.plugin.masonry",
|
|
7
|
-
name: "Masonry",
|
|
8
|
-
description: trim`
|
|
9
|
-
Responsive grid layout that displays query results in an adaptive masonry pattern.
|
|
10
|
-
Visualize collections of cards, images, or mixed content that automatically adjusts to available screen space.
|
|
11
|
-
`,
|
|
12
|
-
icon: "ph--wall--regular",
|
|
13
|
-
iconHue: "green",
|
|
14
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-masonry",
|
|
15
|
-
screenshots: []
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// src/MasonryPlugin.tsx
|
|
19
|
-
import * as Effect from "effect/Effect";
|
|
20
|
-
import * as Option from "effect/Option";
|
|
21
|
-
import { Plugin } from "@dxos/app-framework";
|
|
22
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
23
|
-
import { Annotation, Type as Type2 } from "@dxos/echo";
|
|
24
|
-
import { Operation } from "@dxos/operation";
|
|
25
|
-
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
26
|
-
import { ViewModel } from "@dxos/schema";
|
|
27
|
-
import { ReactSurface } from "#capabilities";
|
|
28
|
-
import { meta as meta3 } from "#meta";
|
|
29
|
-
import { Masonry as Masonry2, MasonryAction } from "#types";
|
|
30
|
-
|
|
31
|
-
// src/translations.ts
|
|
32
|
-
import { Type } from "@dxos/echo";
|
|
33
|
-
import { meta as meta2 } from "#meta";
|
|
34
|
-
import { Masonry } from "#types";
|
|
35
|
-
var translations = [
|
|
36
|
-
{
|
|
37
|
-
"en-US": {
|
|
38
|
-
[Type.getTypename(Masonry.Masonry)]: {
|
|
39
|
-
"typename.label": "Masonry",
|
|
40
|
-
"typename.label_zero": "Masonries",
|
|
41
|
-
"typename.label_one": "Masonry",
|
|
42
|
-
"typename.label_other": "Masonries",
|
|
43
|
-
"object-name.placeholder": "New masonry",
|
|
44
|
-
"add-object.label": "Add masonry",
|
|
45
|
-
"rename-object.label": "Rename masonry",
|
|
46
|
-
"delete-object.label": "Delete masonry",
|
|
47
|
-
"object-deleted.label": "Masonry deleted"
|
|
48
|
-
},
|
|
49
|
-
[meta2.id]: {
|
|
50
|
-
"plugin.name": "Masonry"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
// src/MasonryPlugin.tsx
|
|
57
|
-
var MasonryPlugin = Plugin.define(meta3).pipe(AppPlugin.addMetadataModule({
|
|
58
|
-
metadata: {
|
|
59
|
-
id: Type2.getTypename(Masonry2.Masonry),
|
|
60
|
-
metadata: {
|
|
61
|
-
icon: Annotation.IconAnnotation.get(Masonry2.Masonry).pipe(Option.getOrThrow).icon,
|
|
62
|
-
iconHue: Annotation.IconAnnotation.get(Masonry2.Masonry).pipe(Option.getOrThrow).hue ?? "white",
|
|
63
|
-
inputSchema: MasonryAction.MasonryProps,
|
|
64
|
-
createObject: (props, options) => Effect.gen(function* () {
|
|
65
|
-
const object = yield* Effect.promise(async () => {
|
|
66
|
-
const { view } = await ViewModel.makeFromDatabase({
|
|
67
|
-
db: options.db,
|
|
68
|
-
typename: props.typename
|
|
69
|
-
});
|
|
70
|
-
return Masonry2.make({
|
|
71
|
-
name: props.name,
|
|
72
|
-
view
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
76
|
-
object,
|
|
77
|
-
target: options.target,
|
|
78
|
-
hidden: true,
|
|
79
|
-
targetNodeId: options.targetNodeId
|
|
80
|
-
});
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}), AppPlugin.addSchemaModule({
|
|
85
|
-
schema: [
|
|
86
|
-
Masonry2.Masonry
|
|
87
|
-
]
|
|
88
|
-
}), AppPlugin.addSurfaceModule({
|
|
89
|
-
activate: ReactSurface
|
|
90
|
-
}), AppPlugin.addTranslationsModule({
|
|
91
|
-
translations
|
|
92
|
-
}), Plugin.make);
|
|
93
|
-
export {
|
|
94
|
-
MasonryPlugin,
|
|
95
|
-
meta
|
|
96
|
-
};
|
|
97
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts", "../../../src/MasonryPlugin.tsx", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.masonry',\n name: 'Masonry',\n description: trim`\n Responsive grid layout that displays query results in an adaptive masonry pattern.\n Visualize collections of cards, images, or mixed content that automatically adjusts to available screen space.\n `,\n icon: 'ph--wall--regular',\n iconHue: 'green',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-masonry',\n screenshots: [],\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Annotation, Type } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { type CreateObject } from '@dxos/plugin-space/types';\nimport { ViewModel } from '@dxos/schema';\n\nimport { ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { Masonry, MasonryAction } from '#types';\n\nimport { translations } from './translations';\n\nexport const MasonryPlugin = Plugin.define(meta).pipe(\n AppPlugin.addMetadataModule({\n metadata: {\n id: Type.getTypename(Masonry.Masonry),\n metadata: {\n icon: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).icon,\n iconHue: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).hue ?? 'white',\n inputSchema: MasonryAction.MasonryProps,\n createObject: ((props, options) =>\n Effect.gen(function* () {\n const object = yield* Effect.promise(async () => {\n const { view } = await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename });\n return Masonry.make({ name: props.name, view });\n });\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n hidden: true,\n targetNodeId: options.targetNodeId,\n });\n })) satisfies CreateObject,\n },\n },\n }),\n AppPlugin.addSchemaModule({ schema: [Masonry.Masonry] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\nimport { Masonry } from '#types';\n\nexport const translations = [\n {\n 'en-US': {\n [Type.getTypename(Masonry.Masonry)]: {\n 'typename.label': 'Masonry',\n 'typename.label_zero': 'Masonries',\n 'typename.label_one': 'Masonry',\n 'typename.label_other': 'Masonries',\n 'object-name.placeholder': 'New masonry',\n 'add-object.label': 'Add masonry',\n 'rename-object.label': 'Rename masonry',\n 'delete-object.label': 'Delete masonry',\n 'object-deleted.label': 'Masonry deleted',\n },\n [meta.id]: {\n 'plugin.name': 'Masonry',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
-
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa,CAAA;AACf;;;ACdA,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,QAAAA,aAAY;AACjC,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAE/B,SAASC,iBAAiB;AAE1B,SAASC,oBAAoB;AAC7B,SAASC,QAAAA,aAAY;AACrB,SAASC,WAAAA,UAASC,qBAAqB;;;ACbvC,SAASC,YAAY;AAGrB,SAASC,QAAAA,aAAY;AACrB,SAASC,eAAe;AAEjB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,YAAYC,QAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,oBAAoB;QACpB,uBAAuB;QACvB,uBAAuB;QACvB,wBAAwB;MAC1B;MACA,CAACC,MAAKC,EAAE,GAAG;QACT,eAAe;MACjB;IACF;EACF;;;;ADPK,IAAMC,gBAAgBC,OAAOC,OAAOC,KAAAA,EAAMC,KAC/CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC,MAAKC,YAAYC,SAAQA,OAAO;IACpCJ,UAAU;MACRK,MAAMC,WAAWC,eAAeC,IAAIJ,SAAQA,OAAO,EAAEP,KAAYY,iBAAU,EAAEJ;MAC7EK,SAASJ,WAAWC,eAAeC,IAAIJ,SAAQA,OAAO,EAAEP,KAAYY,iBAAU,EAAEE,OAAO;MACvFC,aAAaC,cAAcC;MAC3BC,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAAS,OAAcC,eAAQ,YAAA;AACnC,gBAAM,EAAEC,KAAI,IAAK,MAAMC,UAAUC,iBAAiB;YAAEC,IAAIP,QAAQO;YAAIC,UAAUT,MAAMS;UAAS,CAAA;AAC7F,iBAAOrB,SAAQsB,KAAK;YAAEC,MAAMX,MAAMW;YAAMN;UAAK,CAAA;QAC/C,CAAA;AACA,eAAO,OAAOO,UAAUC,OAAOC,eAAeC,WAAW;UACvDZ;UACAa,QAAQf,QAAQe;UAChBC,QAAQ;UACRC,cAAcjB,QAAQiB;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACApC,UAAUqC,gBAAgB;EAAEC,QAAQ;IAAChC,SAAQA;;AAAS,CAAA,GACtDN,UAAUuC,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpDzC,UAAU0C,sBAAsB;EAAEC;AAAa,CAAA,GAC/C/C,OAAOgC,IAAI;",
|
|
6
|
-
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "screenshots", "Effect", "Option", "Plugin", "AppPlugin", "Annotation", "Type", "Operation", "SpaceOperation", "ViewModel", "ReactSurface", "meta", "Masonry", "MasonryAction", "Type", "meta", "Masonry", "translations", "Type", "getTypename", "Masonry", "meta", "id", "MasonryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Type", "getTypename", "Masonry", "icon", "Annotation", "IconAnnotation", "get", "getOrThrow", "iconHue", "hue", "inputSchema", "MasonryAction", "MasonryProps", "createObject", "props", "options", "gen", "object", "promise", "view", "ViewModel", "makeFromDatabase", "db", "typename", "make", "name", "Operation", "invoke", "SpaceOperation", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":1966,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/translations.ts":{"bytes":2816,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/MasonryPlugin.tsx":{"bytes":7419,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/operations","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"},"src/index.ts":{"bytes":555,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/MasonryPlugin.tsx","kind":"import-statement","original":"./MasonryPlugin"}],"format":"esm"},"src/types/Masonry.ts":{"bytes":4879,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/MasonryAction.ts":{"bytes":2249,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":708,"imports":[{"path":"src/types/Masonry.ts","kind":"import-statement","original":"./Masonry"},{"path":"src/types/MasonryAction.ts","kind":"import-statement","original":"./MasonryAction"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5984},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/operations","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["MasonryPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/meta.ts":{"bytesInOutput":482},"src/index.ts":{"bytesInOutput":0},"src/MasonryPlugin.tsx":{"bytesInOutput":1708},"src/translations.ts":{"bytesInOutput":684}},"bytes":3068},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3722},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["Masonry","MasonryAction"],"entryPoint":"src/types/index.ts","inputs":{"src/types/Masonry.ts":{"bytesInOutput":1043},"src/types/index.ts":{"bytesInOutput":0},"src/types/MasonryAction.ts":{"bytesInOutput":596}},"bytes":1865},"dist/lib/browser/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/types/Masonry.ts", "../../../../src/types/MasonryAction.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Ref, Type } from '@dxos/echo';\nimport { View } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { ViewAnnotation } from '@dxos/schema';\n\nexport const Masonry = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n\n view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),\n\n arrangement: Schema.Array(\n Schema.Struct({\n ids: Schema.Array(Obj.ID),\n hidden: Schema.optional(Schema.Boolean),\n }),\n ).pipe(FormInputAnnotation.set(false), Schema.optional),\n // TODO(wittjosiah): Consider Masonry supporting not being just a view but referencing arbitrary data directly.\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.masonry',\n version: '0.1.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(true),\n Annotation.IconAnnotation.set({\n icon: 'ph--wall--regular',\n hue: 'green',\n }),\n);\n\nexport interface Masonry extends Schema.Schema.Type<typeof Masonry> {}\n\ntype MakeProps = Omit<Partial<Obj.MakeProps<typeof Masonry>>, 'view'> & {\n view: View.View;\n};\n\n/**\n * Make a masonry as a view of a data set.\n */\nexport const make = ({ name, arrangement = [], view }: MakeProps): Masonry => {\n return Obj.make(Masonry, { name, view: Ref.make(view), arrangement });\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { TypeInputOptionsAnnotation } from '@dxos/plugin-space/types';\n\nexport const MasonryProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): This should be a query input instead.\n typename: Schema.String.pipe(\n Schema.annotations({ title: 'Select card type' }),\n TypeInputOptionsAnnotation.set({\n location: ['database', 'runtime'],\n kind: ['user'],\n }),\n Schema.optional,\n ),\n});\n"],
|
|
5
|
-
"mappings": ";;;;;AAAA;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,YAAY;AACrB,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,sBAAsB;AAExB,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,cAAOC,KAAYC,eAAQ;EAExCC,MAAMC,IAAIA,IAAIC,KAAKA,IAAI,EAAEJ,KAAKK,oBAAoBC,IAAI,KAAA,CAAA;EAEtDC,aAAoBC,aACXX,cAAO;IACZY,KAAYD,aAAME,IAAIC,EAAE;IACxBC,QAAeX,gBAAgBY,cAAO;EACxC,CAAA,CAAA,EACAb,KAAKK,oBAAoBC,IAAI,KAAA,GAAeL,eAAQ;AAExD,CAAA,EAAGD,KACDc,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBZ,IAAI;EAAC;CAAO,GAC5Ba,eAAeb,IAAI,IAAA,GACnBc,WAAWC,eAAef,IAAI;EAC5BgB,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAYK,IAAMC,OAAO,CAAC,EAAE1B,MAAMS,cAAc,CAAA,GAAIL,KAAI,MAAa;AAC9D,SAAOQ,IAAIc,KAAK5B,SAAS;IAAEE;IAAMI,MAAMC,IAAIqB,KAAKtB,IAAAA;IAAOK;EAAY,CAAA;AACrE;;;AC/CA;;;;AAIA,YAAYkB,aAAY;AAExB,SAASC,kCAAkC;AAEpC,IAAMC,eAAsBC,eAAO;EACxCC,MAAaC,iBAAgBC,cAAM;;EAEnCC,UAAiBD,eAAOE,KACfC,oBAAY;IAAEC,OAAO;EAAmB,CAAA,GAC/CC,2BAA2BC,IAAI;IAC7BC,UAAU;MAAC;MAAY;;IACvBC,MAAM;MAAC;;EACT,CAAA,GACOT,gBAAQ;AAEnB,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "View", "FormInputAnnotation", "LabelAnnotation", "ViewAnnotation", "Masonry", "Struct", "name", "String", "pipe", "optional", "view", "Ref", "View", "FormInputAnnotation", "set", "arrangement", "Array", "ids", "Obj", "ID", "hidden", "Boolean", "Type", "object", "typename", "version", "LabelAnnotation", "ViewAnnotation", "Annotation", "IconAnnotation", "icon", "hue", "make", "Schema", "TypeInputOptionsAnnotation", "MasonryProps", "Struct", "name", "optional", "String", "typename", "pipe", "annotations", "title", "TypeInputOptionsAnnotation", "set", "location", "kind"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __export = (target, all) => {
|
|
4
|
-
for (var name in all)
|
|
5
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
__export
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=chunk-HSLMI22Q.mjs.map
|