@dxos/plugin-masonry 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.
- 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/{browser/index.mjs → neutral/chunk-E42CTC55.mjs} +1 -9
- package/dist/lib/neutral/chunk-E42CTC55.mjs.map +7 -0
- package/dist/lib/{browser/types/index.mjs → neutral/chunk-HDBVJK6S.mjs} +7 -7
- 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/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/MasonryPlugin.d.ts.map +1 -1
- 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/containers/MasonryContainer/MasonryContainer.d.ts +1 -2
- package/dist/types/src/containers/MasonryContainer/MasonryContainer.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- 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/types/Masonry.d.ts +1 -2
- package/dist/types/src/types/Masonry.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +73 -48
- package/src/MasonryPlugin.test.ts +2 -2
- package/src/MasonryPlugin.tsx +3 -33
- package/src/capabilities/create-object.ts +36 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/react-surface.tsx +1 -2
- package/src/containers/MasonryContainer/MasonryContainer.stories.tsx +4 -4
- package/src/containers/MasonryContainer/MasonryContainer.tsx +1 -2
- package/src/index.ts +1 -6
- package/src/plugin.ts +9 -0
- package/src/types/Masonry.ts +1 -2
- package/src/types/MasonryAction.ts +1 -1
- package/dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs +0 -57
- package/dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs.map +0 -7
- 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/MasonryPlugin-YENAI2WP.mjs +0 -58
- package/dist/lib/node-esm/MasonryPlugin-YENAI2WP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/index.mjs +0 -28
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/translations.mjs +0 -31
- package/dist/lib/node-esm/translations.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -69
- 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/dist/lib/{browser → neutral}/translations.mjs +0 -0
- /package/dist/lib/{browser → neutral}/translations.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.bc2380dfbc",
|
|
4
4
|
"description": "Masonry DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -8,37 +8,62 @@
|
|
|
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
|
-
"#
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"#
|
|
22
|
-
|
|
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
|
+
}
|
|
23
51
|
},
|
|
24
52
|
"exports": {
|
|
25
53
|
".": {
|
|
26
54
|
"source": "./src/index.ts",
|
|
27
55
|
"types": "./dist/types/src/index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
|
|
56
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./plugin": {
|
|
59
|
+
"source": "./src/plugin.ts",
|
|
60
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
61
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
30
62
|
},
|
|
31
63
|
"./translations": {
|
|
32
64
|
"source": "./src/translations.ts",
|
|
33
65
|
"types": "./dist/types/src/translations.d.ts",
|
|
34
|
-
"
|
|
35
|
-
"node": "./dist/lib/node-esm/translations.mjs"
|
|
36
|
-
},
|
|
37
|
-
"./types": {
|
|
38
|
-
"source": "./src/types/index.ts",
|
|
39
|
-
"types": "./dist/types/src/types/index.d.ts",
|
|
40
|
-
"browser": "./dist/lib/browser/types/index.mjs",
|
|
41
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
66
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
42
67
|
}
|
|
43
68
|
},
|
|
44
69
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -47,26 +72,26 @@
|
|
|
47
72
|
"src"
|
|
48
73
|
],
|
|
49
74
|
"dependencies": {
|
|
50
|
-
"@dxos/app-
|
|
51
|
-
"@dxos/app-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/plugin-search": "0.8.4-main.
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
60
|
-
"@dxos/react-ui-
|
|
61
|
-
"@dxos/react-ui-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/react-ui-
|
|
64
|
-
"@dxos/react-ui-
|
|
65
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
75
|
+
"@dxos/app-toolkit": "0.8.4-main.bc2380dfbc",
|
|
76
|
+
"@dxos/app-framework": "0.8.4-main.bc2380dfbc",
|
|
77
|
+
"@dxos/compute": "0.8.4-main.bc2380dfbc",
|
|
78
|
+
"@dxos/plugin-client": "0.8.4-main.bc2380dfbc",
|
|
79
|
+
"@dxos/effect": "0.8.4-main.bc2380dfbc",
|
|
80
|
+
"@dxos/echo": "0.8.4-main.bc2380dfbc",
|
|
81
|
+
"@dxos/plugin-search": "0.8.4-main.bc2380dfbc",
|
|
82
|
+
"@dxos/plugin-space": "0.8.4-main.bc2380dfbc",
|
|
83
|
+
"@dxos/react-client": "0.8.4-main.bc2380dfbc",
|
|
84
|
+
"@dxos/react-ui": "0.8.4-main.bc2380dfbc",
|
|
85
|
+
"@dxos/react-ui-list": "0.8.4-main.bc2380dfbc",
|
|
86
|
+
"@dxos/react-ui-menu": "0.8.4-main.bc2380dfbc",
|
|
87
|
+
"@dxos/react-ui-masonry": "0.8.4-main.bc2380dfbc",
|
|
88
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bc2380dfbc",
|
|
89
|
+
"@dxos/react-ui-search": "0.8.4-main.bc2380dfbc",
|
|
90
|
+
"@dxos/react-ui-stack": "0.8.4-main.bc2380dfbc",
|
|
91
|
+
"@dxos/types": "0.8.4-main.bc2380dfbc",
|
|
92
|
+
"@dxos/util": "0.8.4-main.bc2380dfbc",
|
|
93
|
+
"@dxos/schema": "0.8.4-main.bc2380dfbc",
|
|
94
|
+
"@dxos/react-ui-form": "0.8.4-main.bc2380dfbc"
|
|
70
95
|
},
|
|
71
96
|
"devDependencies": {
|
|
72
97
|
"@types/react": "~19.2.7",
|
|
@@ -74,20 +99,20 @@
|
|
|
74
99
|
"effect": "3.20.0",
|
|
75
100
|
"react": "~19.2.3",
|
|
76
101
|
"react-dom": "~19.2.3",
|
|
77
|
-
"vite": "^8.0.
|
|
78
|
-
"@dxos/plugin-testing": "0.8.4-main.
|
|
79
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
80
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
81
|
-
"@dxos/random": "0.8.4-main.
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
102
|
+
"vite": "^8.0.13",
|
|
103
|
+
"@dxos/plugin-testing": "0.8.4-main.bc2380dfbc",
|
|
104
|
+
"@dxos/plugin-preview": "0.8.4-main.bc2380dfbc",
|
|
105
|
+
"@dxos/plugin-theme": "0.8.4-main.bc2380dfbc",
|
|
106
|
+
"@dxos/random": "0.8.4-main.bc2380dfbc",
|
|
107
|
+
"@dxos/storybook-utils": "0.8.4-main.bc2380dfbc",
|
|
108
|
+
"@dxos/ui-theme": "0.8.4-main.bc2380dfbc"
|
|
84
109
|
},
|
|
85
110
|
"peerDependencies": {
|
|
86
111
|
"effect": "3.20.0",
|
|
87
112
|
"react": "~19.2.3",
|
|
88
113
|
"react-dom": "~19.2.3",
|
|
89
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
90
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
114
|
+
"@dxos/react-ui": "0.8.4-main.bc2380dfbc",
|
|
115
|
+
"@dxos/ui-theme": "0.8.4-main.bc2380dfbc"
|
|
91
116
|
},
|
|
92
117
|
"publishConfig": {
|
|
93
118
|
"access": "public"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
7
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
8
8
|
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
9
9
|
|
|
10
10
|
import { MasonryPlugin } from '#plugin';
|
|
@@ -20,7 +20,7 @@ describe('MasonryPlugin', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
expect(harness.manager.getActive()).toEqual(
|
|
23
|
-
expect.arrayContaining([moduleId('
|
|
23
|
+
expect.arrayContaining([moduleId('CreateObject'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
24
24
|
);
|
|
25
25
|
});
|
|
26
26
|
});
|
package/src/MasonryPlugin.tsx
CHANGED
|
@@ -2,46 +2,16 @@
|
|
|
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 { Operation } from '@dxos/compute';
|
|
11
|
-
import { Annotation, Type } from '@dxos/echo';
|
|
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
10
|
import { translations } from '#translations';
|
|
19
|
-
import { Masonry
|
|
11
|
+
import { Masonry } from '#types';
|
|
20
12
|
|
|
21
13
|
export const MasonryPlugin = Plugin.define(meta).pipe(
|
|
22
|
-
AppPlugin.
|
|
23
|
-
metadata: {
|
|
24
|
-
id: Type.getTypename(Masonry.Masonry),
|
|
25
|
-
metadata: {
|
|
26
|
-
icon: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).icon,
|
|
27
|
-
iconHue: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).hue ?? 'white',
|
|
28
|
-
inputSchema: MasonryAction.MasonryProps,
|
|
29
|
-
createObject: ((props, options) =>
|
|
30
|
-
Effect.gen(function* () {
|
|
31
|
-
const object = yield* Effect.promise(async () => {
|
|
32
|
-
const { view } = await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename });
|
|
33
|
-
return Masonry.make({ name: props.name, view });
|
|
34
|
-
});
|
|
35
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
36
|
-
object,
|
|
37
|
-
target: options.target,
|
|
38
|
-
hidden: true,
|
|
39
|
-
targetNodeId: options.targetNodeId,
|
|
40
|
-
});
|
|
41
|
-
})) satisfies CreateObject,
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
14
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
45
15
|
AppPlugin.addSchemaModule({ schema: [Masonry.Masonry] }),
|
|
46
16
|
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
47
17
|
AppPlugin.addTranslationsModule({ translations }),
|
|
@@ -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';
|
|
@@ -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';
|
|
@@ -10,8 +10,7 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
10
10
|
import { Surface, useCapabilities } from '@dxos/app-framework/ui';
|
|
11
11
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
12
12
|
import { AppSurface, useObjectMenuItems } from '@dxos/app-toolkit/ui';
|
|
13
|
-
import { Annotation, Filter, Obj, Query, type Ref, Type } from '@dxos/echo';
|
|
14
|
-
import { type View } from '@dxos/echo';
|
|
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';
|
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
|
|
|
@@ -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,57 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/MasonryPlugin.tsx
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import * as Option from "effect/Option";
|
|
6
|
-
import { Plugin } from "@dxos/app-framework";
|
|
7
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
8
|
-
import { Operation } from "@dxos/compute";
|
|
9
|
-
import { Annotation, Type } from "@dxos/echo";
|
|
10
|
-
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
11
|
-
import { ViewModel } from "@dxos/schema";
|
|
12
|
-
import { ReactSurface } from "#capabilities";
|
|
13
|
-
import { meta } from "#meta";
|
|
14
|
-
import { translations } from "#translations";
|
|
15
|
-
import { Masonry, MasonryAction } from "#types";
|
|
16
|
-
var MasonryPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
17
|
-
metadata: {
|
|
18
|
-
id: Type.getTypename(Masonry.Masonry),
|
|
19
|
-
metadata: {
|
|
20
|
-
icon: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).icon,
|
|
21
|
-
iconHue: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).hue ?? "white",
|
|
22
|
-
inputSchema: MasonryAction.MasonryProps,
|
|
23
|
-
createObject: (props, options) => Effect.gen(function* () {
|
|
24
|
-
const object = yield* Effect.promise(async () => {
|
|
25
|
-
const { view } = await ViewModel.makeFromDatabase({
|
|
26
|
-
db: options.db,
|
|
27
|
-
typename: props.typename
|
|
28
|
-
});
|
|
29
|
-
return Masonry.make({
|
|
30
|
-
name: props.name,
|
|
31
|
-
view
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
35
|
-
object,
|
|
36
|
-
target: options.target,
|
|
37
|
-
hidden: true,
|
|
38
|
-
targetNodeId: options.targetNodeId
|
|
39
|
-
});
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}), AppPlugin.addSchemaModule({
|
|
44
|
-
schema: [
|
|
45
|
-
Masonry.Masonry
|
|
46
|
-
]
|
|
47
|
-
}), AppPlugin.addSurfaceModule({
|
|
48
|
-
activate: ReactSurface
|
|
49
|
-
}), AppPlugin.addTranslationsModule({
|
|
50
|
-
translations
|
|
51
|
-
}), Plugin.make);
|
|
52
|
-
var MasonryPlugin_default = MasonryPlugin;
|
|
53
|
-
export {
|
|
54
|
-
MasonryPlugin,
|
|
55
|
-
MasonryPlugin_default as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=MasonryPlugin-KWQYOKCW.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MasonryPlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["//\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 { Operation } from '@dxos/compute';\nimport { Annotation, Type } from '@dxos/echo';\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 { translations } from '#translations';\nimport { Masonry, MasonryAction } from '#types';\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\nexport default MasonryPlugin;\n"],
|
|
5
|
-
"mappings": ";;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,YAAY;AACjC,SAASC,sBAAsB;AAE/B,SAASC,iBAAiB;AAE1B,SAASC,oBAAoB;AAC7B,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,SAASC,qBAAqB;AAEhC,IAAMC,gBAAgBZ,OAAOa,OAAOL,IAAAA,EAAMM,KAC/Cb,UAAUc,kBAAkB;EAC1BC,UAAU;IACRC,IAAIb,KAAKc,YAAYR,QAAQA,OAAO;IACpCM,UAAU;MACRG,MAAMhB,WAAWiB,eAAeC,IAAIX,QAAQA,OAAO,EAAEI,KAAYQ,iBAAU,EAAEH;MAC7EI,SAASpB,WAAWiB,eAAeC,IAAIX,QAAQA,OAAO,EAAEI,KAAYQ,iBAAU,EAAEE,OAAO;MACvFC,aAAad,cAAce;MAC3BC,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAAS,OAAcC,eAAQ,YAAA;AACnC,gBAAM,EAAEC,KAAI,IAAK,MAAM3B,UAAU4B,iBAAiB;YAAEC,IAAIN,QAAQM;YAAIC,UAAUR,MAAMQ;UAAS,CAAA;AAC7F,iBAAO1B,QAAQ2B,KAAK;YAAEC,MAAMV,MAAMU;YAAML;UAAK,CAAA;QAC/C,CAAA;AACA,eAAO,OAAO/B,UAAUqC,OAAOlC,eAAemC,WAAW;UACvDT;UACAU,QAAQZ,QAAQY;UAChBC,QAAQ;UACRC,cAAcd,QAAQc;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACA1C,UAAU2C,gBAAgB;EAAEC,QAAQ;IAACnC,QAAQA;;AAAS,CAAA,GACtDT,UAAU6C,iBAAiB;EAAEC,UAAUxC;AAAa,CAAA,GACpDN,UAAU+C,sBAAsB;EAAEvC;AAAa,CAAA,GAC/CT,OAAOqC,IAAI;AAGb,IAAA,wBAAezB;",
|
|
6
|
-
"names": ["Effect", "Option", "Plugin", "AppPlugin", "Operation", "Annotation", "Type", "SpaceOperation", "ViewModel", "ReactSurface", "meta", "translations", "Masonry", "MasonryAction", "MasonryPlugin", "define", "pipe", "addMetadataModule", "metadata", "id", "getTypename", "icon", "IconAnnotation", "get", "getOrThrow", "iconHue", "hue", "inputSchema", "MasonryProps", "createObject", "props", "options", "gen", "object", "promise", "view", "makeFromDatabase", "db", "typename", "make", "name", "invoke", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema", "addSurfaceModule", "activate", "addTranslationsModule"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const MasonryPlugin = Plugin.lazy(meta, () => import('./MasonryPlugin'));\n\nexport * from './meta';\n", "//\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"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,cAAc;;;ACCvB,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa,CAAA;AACf;;;ADVO,IAAMC,gBAAgBC,OAAOC,KAAKC,MAAM,MAAM,OAAO,8BAAA,CAAA;",
|
|
6
|
-
"names": ["Plugin", "trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "screenshots", "MasonryPlugin", "Plugin", "lazy", "meta"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":1885,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/MasonryPlugin.tsx":{"bytes":7411,"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/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","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":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":964,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/MasonryPlugin.tsx","kind":"dynamic-import","original":"./MasonryPlugin"}],"format":"esm"},"src/translations.ts":{"bytes":2723,"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/types/Masonry.ts":{"bytes":4815,"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":2149,"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":616,"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":1332},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs","kind":"dynamic-import"}],"exports":["MasonryPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":131},"src/meta.ts":{"bytesInOutput":482}},"bytes":765},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1326},"dist/lib/browser/translations.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":674}},"bytes":798},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3600},"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":1051},"src/types/index.ts":{"bytesInOutput":0},"src/types/MasonryAction.ts":{"bytesInOutput":596}},"bytes":1873},"dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3763},"dist/lib/browser/MasonryPlugin-KWQYOKCW.mjs":{"imports":[{"path":"dist/lib/browser/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","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":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["MasonryPlugin","default"],"entryPoint":"src/MasonryPlugin.tsx","inputs":{"src/MasonryPlugin.tsx":{"bytesInOutput":1758}},"bytes":1931},"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(['view']),\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,MAAMZ,IAAIA,IAAIE,KAAKA,IAAI,EAAEQ,KAAKP,oBAAoBU,IAAI,KAAA,CAAA;EAEtDC,aAAoBC,aACXR,cAAO;IACZS,KAAYD,aAAMhB,IAAIkB,EAAE;IACxBC,QAAeP,gBAAgBQ,cAAO;EACxC,CAAA,CAAA,EACAT,KAAKP,oBAAoBU,IAAI,KAAA,GAAeF,eAAQ;AAExD,CAAA,EAAGD,KACDT,KAAKmB,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAlB,gBAAgBS,IAAI;EAAC;CAAO,GAC5BR,eAAeQ,IAAI;EAAC;CAAO,GAC3Bf,WAAWyB,eAAeV,IAAI;EAC5BW,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAYK,IAAMC,OAAO,CAAC,EAAElB,MAAMM,cAAc,CAAA,GAAIF,KAAI,MAAa;AAC9D,SAAOb,IAAI2B,KAAKpB,SAAS;IAAEE;IAAMI,MAAMZ,IAAI0B,KAAKd,IAAAA;IAAOE;EAAY,CAAA;AACrE;;;AC/CA;;;;AAIA,YAAYa,aAAY;AAExB,SAASC,kCAAkC;AAEpC,IAAMC,eAAsBC,eAAO;EACxCC,MAAaC,iBAAgBC,cAAM;;EAEnCC,UAAiBD,eAAOE,KACfC,oBAAY;IAAEC,OAAO;EAAmB,CAAA,GAC/CT,2BAA2BU,IAAI;IAC7BC,UAAU;MAAC;MAAY;;IACvBC,MAAM;MAAC;;EACT,CAAA,GACOR,gBAAQ;AAEnB,CAAA;",
|
|
6
|
-
"names": ["Schema", "Annotation", "Obj", "Ref", "Type", "View", "FormInputAnnotation", "LabelAnnotation", "ViewAnnotation", "Masonry", "Struct", "name", "String", "pipe", "optional", "view", "set", "arrangement", "Array", "ids", "ID", "hidden", "Boolean", "object", "typename", "version", "IconAnnotation", "icon", "hue", "make", "Schema", "TypeInputOptionsAnnotation", "MasonryProps", "Struct", "name", "optional", "String", "typename", "pipe", "annotations", "title", "set", "location", "kind"]
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
3
|
-
|
|
4
|
-
// src/MasonryPlugin.tsx
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
|
-
import * as Option from "effect/Option";
|
|
7
|
-
import { Plugin } from "@dxos/app-framework";
|
|
8
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
9
|
-
import { Operation } from "@dxos/compute";
|
|
10
|
-
import { Annotation, Type } from "@dxos/echo";
|
|
11
|
-
import { SpaceOperation } from "@dxos/plugin-space/operations";
|
|
12
|
-
import { ViewModel } from "@dxos/schema";
|
|
13
|
-
import { ReactSurface } from "#capabilities";
|
|
14
|
-
import { meta } from "#meta";
|
|
15
|
-
import { translations } from "#translations";
|
|
16
|
-
import { Masonry, MasonryAction } from "#types";
|
|
17
|
-
var MasonryPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
18
|
-
metadata: {
|
|
19
|
-
id: Type.getTypename(Masonry.Masonry),
|
|
20
|
-
metadata: {
|
|
21
|
-
icon: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).icon,
|
|
22
|
-
iconHue: Annotation.IconAnnotation.get(Masonry.Masonry).pipe(Option.getOrThrow).hue ?? "white",
|
|
23
|
-
inputSchema: MasonryAction.MasonryProps,
|
|
24
|
-
createObject: (props, options) => Effect.gen(function* () {
|
|
25
|
-
const object = yield* Effect.promise(async () => {
|
|
26
|
-
const { view } = await ViewModel.makeFromDatabase({
|
|
27
|
-
db: options.db,
|
|
28
|
-
typename: props.typename
|
|
29
|
-
});
|
|
30
|
-
return Masonry.make({
|
|
31
|
-
name: props.name,
|
|
32
|
-
view
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
36
|
-
object,
|
|
37
|
-
target: options.target,
|
|
38
|
-
hidden: true,
|
|
39
|
-
targetNodeId: options.targetNodeId
|
|
40
|
-
});
|
|
41
|
-
})
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}), AppPlugin.addSchemaModule({
|
|
45
|
-
schema: [
|
|
46
|
-
Masonry.Masonry
|
|
47
|
-
]
|
|
48
|
-
}), AppPlugin.addSurfaceModule({
|
|
49
|
-
activate: ReactSurface
|
|
50
|
-
}), AppPlugin.addTranslationsModule({
|
|
51
|
-
translations
|
|
52
|
-
}), Plugin.make);
|
|
53
|
-
var MasonryPlugin_default = MasonryPlugin;
|
|
54
|
-
export {
|
|
55
|
-
MasonryPlugin,
|
|
56
|
-
MasonryPlugin_default as default
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=MasonryPlugin-YENAI2WP.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/MasonryPlugin.tsx"],
|
|
4
|
-
"sourcesContent": ["//\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 { Operation } from '@dxos/compute';\nimport { Annotation, Type } from '@dxos/echo';\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 { translations } from '#translations';\nimport { Masonry, MasonryAction } from '#types';\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\nexport default MasonryPlugin;\n"],
|
|
5
|
-
"mappings": ";;;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,YAAY;AACjC,SAASC,sBAAsB;AAE/B,SAASC,iBAAiB;AAE1B,SAASC,oBAAoB;AAC7B,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,SAASC,qBAAqB;AAEhC,IAAMC,gBAAgBZ,OAAOa,OAAOL,IAAAA,EAAMM,KAC/Cb,UAAUc,kBAAkB;EAC1BC,UAAU;IACRC,IAAIb,KAAKc,YAAYR,QAAQA,OAAO;IACpCM,UAAU;MACRG,MAAMhB,WAAWiB,eAAeC,IAAIX,QAAQA,OAAO,EAAEI,KAAYQ,iBAAU,EAAEH;MAC7EI,SAASpB,WAAWiB,eAAeC,IAAIX,QAAQA,OAAO,EAAEI,KAAYQ,iBAAU,EAAEE,OAAO;MACvFC,aAAad,cAAce;MAC3BC,cAAe,CAACC,OAAOC,YACdC,WAAI,aAAA;AACT,cAAMC,SAAS,OAAcC,eAAQ,YAAA;AACnC,gBAAM,EAAEC,KAAI,IAAK,MAAM3B,UAAU4B,iBAAiB;YAAEC,IAAIN,QAAQM;YAAIC,UAAUR,MAAMQ;UAAS,CAAA;AAC7F,iBAAO1B,QAAQ2B,KAAK;YAAEC,MAAMV,MAAMU;YAAML;UAAK,CAAA;QAC/C,CAAA;AACA,eAAO,OAAO/B,UAAUqC,OAAOlC,eAAemC,WAAW;UACvDT;UACAU,QAAQZ,QAAQY;UAChBC,QAAQ;UACRC,cAAcd,QAAQc;QACxB,CAAA;MACF,CAAA;IACJ;EACF;AACF,CAAA,GACA1C,UAAU2C,gBAAgB;EAAEC,QAAQ;IAACnC,QAAQA;;AAAS,CAAA,GACtDT,UAAU6C,iBAAiB;EAAEC,UAAUxC;AAAa,CAAA,GACpDN,UAAU+C,sBAAsB;EAAEvC;AAAa,CAAA,GAC/CT,OAAOqC,IAAI;AAGb,IAAA,wBAAezB;",
|
|
6
|
-
"names": ["Effect", "Option", "Plugin", "AppPlugin", "Operation", "Annotation", "Type", "SpaceOperation", "ViewModel", "ReactSurface", "meta", "translations", "Masonry", "MasonryAction", "MasonryPlugin", "define", "pipe", "addMetadataModule", "metadata", "id", "getTypename", "icon", "IconAnnotation", "get", "getOrThrow", "iconHue", "hue", "inputSchema", "MasonryProps", "createObject", "props", "options", "gen", "object", "promise", "view", "makeFromDatabase", "db", "typename", "make", "name", "invoke", "AddObject", "target", "hidden", "targetNodeId", "addSchemaModule", "schema", "addSurfaceModule", "activate", "addTranslationsModule"]
|
|
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
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
3
|
-
|
|
4
|
-
// src/index.ts
|
|
5
|
-
import { Plugin } from "@dxos/app-framework";
|
|
6
|
-
|
|
7
|
-
// src/meta.ts
|
|
8
|
-
import { trim } from "@dxos/util";
|
|
9
|
-
var meta = {
|
|
10
|
-
id: "org.dxos.plugin.masonry",
|
|
11
|
-
name: "Masonry",
|
|
12
|
-
description: trim`
|
|
13
|
-
Responsive grid layout that displays query results in an adaptive masonry pattern.
|
|
14
|
-
Visualize collections of cards, images, or mixed content that automatically adjusts to available screen space.
|
|
15
|
-
`,
|
|
16
|
-
icon: "ph--wall--regular",
|
|
17
|
-
iconHue: "green",
|
|
18
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-masonry",
|
|
19
|
-
screenshots: []
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// src/index.ts
|
|
23
|
-
var MasonryPlugin = Plugin.lazy(meta, () => import("./MasonryPlugin-YENAI2WP.mjs"));
|
|
24
|
-
export {
|
|
25
|
-
MasonryPlugin,
|
|
26
|
-
meta
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/index.ts", "../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const MasonryPlugin = Plugin.lazy(meta, () => import('./MasonryPlugin'));\n\nexport * from './meta';\n", "//\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"],
|
|
5
|
-
"mappings": ";;;;AAIA,SAASA,cAAc;;;ACCvB,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa,CAAA;AACf;;;ADVO,IAAMC,gBAAgBC,OAAOC,KAAKC,MAAM,MAAM,OAAO,8BAAA,CAAA;",
|
|
6
|
-
"names": ["Plugin", "trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "screenshots", "MasonryPlugin", "Plugin", "lazy", "meta"]
|
|
7
|
-
}
|