@dxos/plugin-masonry 0.8.4-main.21d9917 → 0.8.4-main.2244d791bb
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/{chunk-2QCFP5QL.mjs → chunk-S5JKAK4O.mjs} +3 -3
- package/dist/lib/browser/chunk-S5JKAK4O.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +10 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-BNMIVM2K.mjs → react-surface-QKCNQ7HF.mjs} +11 -10
- package/dist/lib/browser/react-surface-QKCNQ7HF.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-6SGZVU7G.mjs → chunk-YNA44I6R.mjs} +3 -3
- package/dist/lib/node-esm/chunk-YNA44I6R.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-OK33CG7H.mjs → react-surface-XG56AMA7.mjs} +11 -10
- package/dist/lib/node-esm/react-surface-XG56AMA7.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/MasonryPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/MasonryContainer.d.ts +1 -1
- package/dist/types/src/components/MasonryContainer.d.ts.map +1 -1
- package/dist/types/src/types/Masonry.d.ts +6 -6
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -27
- package/src/MasonryPlugin.tsx +6 -5
- package/src/capabilities/react-surface/react-surface.tsx +4 -3
- package/src/components/MasonryContainer.stories.tsx +1 -1
- package/src/components/MasonryContainer.tsx +5 -5
- package/src/types/Masonry.ts +4 -4
- package/dist/lib/browser/chunk-2QCFP5QL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-BNMIVM2K.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6SGZVU7G.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-OK33CG7H.mjs.map +0 -7
|
@@ -21,7 +21,7 @@ var Masonry = Schema.Struct({
|
|
|
21
21
|
arrangement: Schema.Array(Schema.Struct({
|
|
22
22
|
ids: Schema.Array(Obj.ID),
|
|
23
23
|
hidden: Schema.optional(Schema.Boolean)
|
|
24
|
-
})
|
|
24
|
+
})).pipe(FormInputAnnotation.set(false), Schema.optional)
|
|
25
25
|
}).pipe(Type.object({
|
|
26
26
|
typename: "dxos.org/type/Masonry",
|
|
27
27
|
version: "0.2.0"
|
|
@@ -39,7 +39,7 @@ var MasonryV1 = Schema.Struct({
|
|
|
39
39
|
arrangement: Schema.Array(Schema.Struct({
|
|
40
40
|
ids: Schema.Array(Obj.ID),
|
|
41
41
|
hidden: Schema.optional(Schema.Boolean)
|
|
42
|
-
})
|
|
42
|
+
})).pipe(Schema.optional)
|
|
43
43
|
}).pipe(Type.object({
|
|
44
44
|
typename: "dxos.org/type/Masonry",
|
|
45
45
|
version: "0.1.0"
|
|
@@ -75,4 +75,4 @@ export {
|
|
|
75
75
|
Masonry_exports,
|
|
76
76
|
MasonryAction_exports
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-S5JKAK4O.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { View, ViewAnnotation } from '@dxos/schema';\n\nexport const Masonry = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n\n view: Type.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: 'dxos.org/type/Masonry',\n version: '0.2.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(true),\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//\n// V1\n//\n\nexport const MasonryV1 = Schema.Struct({\n arrangement: Schema.Array(\n Schema.Struct({\n ids: Schema.Array(Obj.ID),\n hidden: Schema.optional(Schema.Boolean),\n }),\n ).pipe(Schema.optional),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/Masonry',\n version: '0.1.0',\n }),\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 registered: ['registered'],\n }),\n Schema.optional,\n ),\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAAA;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,KAAKC,YAAY;AAC/B,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,MAAMC,sBAAsB;AAE9B,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,cAAOC,KAAYC,eAAQ;EAExCC,MAAMC,KAAKC,IAAIC,KAAKA,IAAI,EAAEL,KAAKM,oBAAoBC,IAAI,KAAA,CAAA;EAEvDC,aAAoBC,aACXZ,cAAO;IACZa,KAAYD,aAAME,IAAIC,EAAE;IACxBC,QAAeZ,gBAAgBa,cAAO;EACxC,CAAA,CAAA,EACAd,KAAKM,oBAAoBC,IAAI,KAAA,GAAeN,eAAQ;AAExD,CAAA,EAAGD,KACDG,KAAKY,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBX,IAAI;EAAC;CAAO,GAC5BY,eAAeZ,IAAI,IAAA,CAAA;AAYd,IAAMa,OAAO,CAAC,EAAEtB,MAAMU,cAAc,CAAA,GAAIN,KAAI,MAAa;AAC9D,SAAOS,IAAIS,KAAKxB,SAAS;IAAEE;IAAMI,MAAME,IAAIgB,KAAKlB,IAAAA;IAAOM;EAAY,CAAA;AACrE;AAMO,IAAMa,YAAmBxB,cAAO;EACrCW,aAAoBC,aACXZ,cAAO;IACZa,KAAYD,aAAME,IAAIC,EAAE;IACxBC,QAAeZ,gBAAgBa,cAAO;EACxC,CAAA,CAAA,EACAd,KAAYC,eAAQ;AACxB,CAAA,EAAGD,KACDG,KAAKY,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;;;AC3DF;;;;AAIA,YAAYK,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;;IACPC,YAAY;MAAC;;EACf,CAAA,GACOV,gBAAQ;AAEnB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "View", "ViewAnnotation", "Masonry", "Struct", "name", "String", "pipe", "optional", "view", "Type", "Ref", "View", "FormInputAnnotation", "set", "arrangement", "Array", "ids", "Obj", "ID", "hidden", "Boolean", "object", "typename", "version", "LabelAnnotation", "ViewAnnotation", "make", "MasonryV1", "Schema", "TypeInputOptionsAnnotation", "MasonryProps", "Struct", "name", "optional", "String", "typename", "pipe", "annotations", "title", "TypeInputOptionsAnnotation", "set", "location", "kind", "registered"]
|
|
7
|
+
}
|
|
@@ -4,17 +4,18 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
MasonryAction_exports,
|
|
6
6
|
Masonry_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S5JKAK4O.mjs";
|
|
8
8
|
|
|
9
9
|
// src/MasonryPlugin.tsx
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
|
-
import {
|
|
11
|
+
import { Plugin } from "@dxos/app-framework";
|
|
12
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
12
13
|
import { Type as Type2 } from "@dxos/echo";
|
|
13
14
|
import { View } from "@dxos/schema";
|
|
14
15
|
|
|
15
16
|
// src/capabilities/react-surface/index.ts
|
|
16
17
|
import { Capability } from "@dxos/app-framework";
|
|
17
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-
|
|
18
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-QKCNQ7HF.mjs"));
|
|
18
19
|
|
|
19
20
|
// src/translations.ts
|
|
20
21
|
import { Type } from "@dxos/echo";
|
|
@@ -39,11 +40,7 @@ var translations = [
|
|
|
39
40
|
];
|
|
40
41
|
|
|
41
42
|
// src/MasonryPlugin.tsx
|
|
42
|
-
var MasonryPlugin = Plugin.define(meta).pipe(
|
|
43
|
-
translations
|
|
44
|
-
}), Common.Plugin.addSurfaceModule({
|
|
45
|
-
activate: ReactSurface
|
|
46
|
-
}), Common.Plugin.addMetadataModule({
|
|
43
|
+
var MasonryPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
47
44
|
metadata: {
|
|
48
45
|
id: Type2.getTypename(Masonry_exports.Masonry),
|
|
49
46
|
metadata: {
|
|
@@ -62,10 +59,14 @@ var MasonryPlugin = Plugin.define(meta).pipe(Common.Plugin.addTranslationsModule
|
|
|
62
59
|
})
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
|
-
}),
|
|
62
|
+
}), AppPlugin.addSchemaModule({
|
|
66
63
|
schema: [
|
|
67
64
|
Masonry_exports.Masonry
|
|
68
65
|
]
|
|
66
|
+
}), AppPlugin.addSurfaceModule({
|
|
67
|
+
activate: ReactSurface
|
|
68
|
+
}), AppPlugin.addTranslationsModule({
|
|
69
|
+
translations
|
|
69
70
|
}), Plugin.make);
|
|
70
71
|
export {
|
|
71
72
|
MasonryPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MasonryPlugin.tsx", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,
|
|
6
|
-
"names": ["Effect", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Type } from '@dxos/echo';\nimport { type CreateObject } from '@dxos/plugin-space/types';\nimport { View } 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: 'ph--wall--regular',\n iconHue: 'green',\n inputSchema: MasonryAction.MasonryProps,\n createObject: ((props, { db }) =>\n Effect.promise(async () => {\n const { view } = await View.makeFromDatabase({ db, typename: props.typename });\n return Masonry.make({ name: props.name, view });\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 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\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 '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": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,QAAAA,aAAY;AAErB,SAASC,YAAY;;;ACNrB,SAASC,kBAAkB;AAEpB,IAAMC,eAAeC,WAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACFzE,SAASC,YAAY;AAMd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,YAAYC,gBAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,uBAAuB;QACvB,uBAAuB;QACvB,wBAAwB;MAC1B;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;MACjB;IACF;EACF;;;;AFVK,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC,MAAKC,YAAYC,gBAAQA,OAAO;IACpCJ,UAAU;MACRK,MAAM;MACNC,SAAS;MACTC,aAAaC,sBAAcC;MAC3BC,cAAe,CAACC,OAAO,EAAEC,GAAE,MAClBC,eAAQ,YAAA;AACb,cAAM,EAAEC,KAAI,IAAK,MAAMC,KAAKC,iBAAiB;UAAEJ;UAAIK,UAAUN,MAAMM;QAAS,CAAA;AAC5E,eAAOb,gBAAQc,KAAK;UAAEC,MAAMR,MAAMQ;UAAML;QAAK,CAAA;MAC/C,CAAA;IACJ;EACF;AACF,CAAA,GACAhB,UAAUsB,gBAAgB;EAAEC,QAAQ;IAACjB,gBAAQA;;AAAS,CAAA,GACtDN,UAAUwB,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpD1B,UAAU2B,sBAAsB;EAAEC;AAAa,CAAA,GAC/ChC,OAAOwB,IAAI;",
|
|
6
|
+
"names": ["Effect", "Plugin", "AppPlugin", "Type", "View", "Capability", "ReactSurface", "Capability", "lazy", "Type", "translations", "Type", "getTypename", "Masonry", "meta", "id", "MasonryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Type", "getTypename", "Masonry", "icon", "iconHue", "inputSchema", "MasonryAction", "MasonryProps", "createObject", "props", "db", "promise", "view", "View", "makeFromDatabase", "typename", "make", "name", "addSchemaModule", "schema", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":1966,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/MasonryContainer.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":1966,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/MasonryContainer.tsx":{"bytes":8879,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-masonry","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/Masonry.ts":{"bytes":5570,"imports":[{"path":"effect/Schema","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":2399,"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"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":4234,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/components/MasonryContainer.tsx","kind":"import-statement","original":"../../components/MasonryContainer"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":911,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":488,"imports":[{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2691,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/MasonryPlugin.tsx":{"bytes":5024,"imports":[{"path":"effect/Effect","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/schema","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"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"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4055},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-U46AGJ2D.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-S5JKAK4O.mjs","kind":"import-statement"},{"path":"effect/Effect","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/schema","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/react-surface-QKCNQ7HF.mjs","kind":"dynamic-import"},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["MasonryPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/MasonryPlugin.tsx":{"bytesInOutput":985},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":575}},"bytes":2029},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-S5JKAK4O.mjs","kind":"import-statement"}],"exports":["Masonry","MasonryAction"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":202},"dist/lib/browser/react-surface-QKCNQ7HF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6943},"dist/lib/browser/react-surface-QKCNQ7HF.mjs":{"imports":[{"path":"dist/lib/browser/chunk-U46AGJ2D.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-S5JKAK4O.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-masonry","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":865},"src/components/MasonryContainer.tsx":{"bytesInOutput":2252}},"bytes":3467},"dist/lib/browser/chunk-U46AGJ2D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":948},"dist/lib/browser/chunk-U46AGJ2D.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":482}},"bytes":561},"dist/lib/browser/chunk-S5JKAK4O.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4067},"dist/lib/browser/chunk-S5JKAK4O.mjs":{"imports":[{"path":"effect/Schema","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":["MasonryAction_exports","Masonry_exports"],"inputs":{"src/types/Masonry.ts":{"bytesInOutput":1215},"src/types/index.ts":{"bytesInOutput":0},"src/types/MasonryAction.ts":{"bytesInOutput":640}},"bytes":2178}}}
|
|
@@ -3,28 +3,29 @@ import {
|
|
|
3
3
|
} from "./chunk-U46AGJ2D.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Masonry_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S5JKAK4O.mjs";
|
|
7
7
|
|
|
8
8
|
// src/capabilities/react-surface/react-surface.tsx
|
|
9
9
|
import * as Effect from "effect/Effect";
|
|
10
10
|
import React2 from "react";
|
|
11
|
-
import {
|
|
11
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
12
|
+
import { Surface as Surface2 } from "@dxos/app-framework/ui";
|
|
12
13
|
import { Obj as Obj2 } from "@dxos/echo";
|
|
13
14
|
import { View } from "@dxos/schema";
|
|
14
15
|
|
|
15
16
|
// src/components/MasonryContainer.tsx
|
|
16
17
|
import React, { useEffect, useState } from "react";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
18
|
+
import { Surface, useCapabilities } from "@dxos/app-framework/ui";
|
|
19
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
19
20
|
import { Filter, Obj, Type } from "@dxos/echo";
|
|
20
21
|
import { useGlobalFilteredObjects } from "@dxos/plugin-search";
|
|
21
22
|
import { useObject, useQuery } from "@dxos/react-client/echo";
|
|
22
23
|
import { Masonry as MasonryComponent } from "@dxos/react-ui-masonry";
|
|
23
24
|
import { Card } from "@dxos/react-ui-mosaic";
|
|
24
25
|
import { getTypenameFromQuery } from "@dxos/schema";
|
|
25
|
-
var MasonryContainer = ({ view: viewOrRef, role }) => {
|
|
26
|
+
var MasonryContainer = ({ view: viewOrRef, role: _role }) => {
|
|
26
27
|
const [view] = useObject(viewOrRef);
|
|
27
|
-
const schemas = useCapabilities(
|
|
28
|
+
const schemas = useCapabilities(AppCapabilities.Schema);
|
|
28
29
|
const db = view && Obj.getDatabase(view);
|
|
29
30
|
const typename = view?.query ? getTypenameFromQuery(view.query.ast) : void 0;
|
|
30
31
|
const [cardSchema, setCardSchema] = useState();
|
|
@@ -61,7 +62,7 @@ var MasonryContainer = ({ view: viewOrRef, role }) => {
|
|
|
61
62
|
});
|
|
62
63
|
};
|
|
63
64
|
var Item = ({ data }) => {
|
|
64
|
-
return /* @__PURE__ */ React.createElement(Card.Root, null, /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement(Card.Title, null, Obj.getLabel(data)), /* @__PURE__ */ React.createElement(Card.Menu, null)), /* @__PURE__ */ React.createElement(Surface, {
|
|
65
|
+
return /* @__PURE__ */ React.createElement(Card.Root, null, /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement(Card.Title, null, Obj.getLabel(data)), /* @__PURE__ */ React.createElement(Card.Menu, null)), /* @__PURE__ */ React.createElement(Surface.Surface, {
|
|
65
66
|
role: "card--content",
|
|
66
67
|
limit: 1,
|
|
67
68
|
data: {
|
|
@@ -71,8 +72,8 @@ var Item = ({ data }) => {
|
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
// src/capabilities/react-surface/react-surface.tsx
|
|
74
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(
|
|
75
|
-
|
|
75
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
76
|
+
Surface2.create({
|
|
76
77
|
id: meta.id,
|
|
77
78
|
role: [
|
|
78
79
|
"article",
|
|
@@ -91,4 +92,4 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
91
92
|
export {
|
|
92
93
|
react_surface_default as default
|
|
93
94
|
};
|
|
94
|
-
//# sourceMappingURL=react-surface-
|
|
95
|
+
//# sourceMappingURL=react-surface-QKCNQ7HF.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/components/MasonryContainer.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { View } from '@dxos/schema';\n\nimport { MasonryContainer } from '../../components/MasonryContainer';\nimport { meta } from '../../meta';\nimport { Masonry } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: meta.id,\n role: ['article', 'section'],\n filter: (data): data is { subject: Masonry.Masonry | View.View } =>\n Obj.instanceOf(Masonry.Masonry, data.subject) || Obj.instanceOf(View.View, data.subject),\n component: ({ data, role }) => {\n const view = Obj.instanceOf(View.View, data.subject) ? data.subject : data.subject.view;\n return <MasonryContainer view={view} role={role} />;\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\nimport React, { useEffect, useState } from 'react';\n\nimport { Surface, useCapabilities } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Filter, Obj, type Ref, Type } from '@dxos/echo';\nimport { useGlobalFilteredObjects } from '@dxos/plugin-search';\nimport { useObject, useQuery } from '@dxos/react-client/echo';\nimport { Masonry as MasonryComponent } from '@dxos/react-ui-masonry';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type View, getTypenameFromQuery } from '@dxos/schema';\n\nexport type MasonryContainerProps = {\n view: View.View;\n role?: string;\n};\n\nexport const MasonryContainer = ({\n view: viewOrRef,\n role: _role,\n}: {\n view: View.View | Ref.Ref<View.View>;\n role?: string;\n}) => {\n const [view] = useObject(viewOrRef);\n const schemas = useCapabilities(AppCapabilities.Schema);\n const db = view && Obj.getDatabase(view);\n const typename = view?.query ? getTypenameFromQuery(view.query.ast) : undefined;\n\n const [cardSchema, setCardSchema] = useState<Schema.Schema.AnyNoContext>();\n\n useEffect(() => {\n const staticSchema = schemas.flat().find((schema) => Type.getTypename(schema) === typename);\n if (staticSchema) {\n setCardSchema(() => staticSchema);\n }\n if (!staticSchema && typename && db) {\n const query = db.schemaRegistry.query({ typename });\n const unsubscribe = query.subscribe(\n () => {\n const [schema] = query.results;\n if (schema) {\n setCardSchema(schema);\n }\n },\n { fire: true },\n );\n return unsubscribe;\n }\n }, [schemas, typename, db]);\n\n const objects = useQuery(db, cardSchema ? Filter.type(cardSchema) : Filter.nothing());\n const filteredObjects = useGlobalFilteredObjects(objects);\n\n return (\n <MasonryComponent.Root\n items={filteredObjects}\n render={Item as any}\n classNames='is-full max-is-full bs-full max-bs-full overflow-y-auto p-4'\n />\n );\n};\n\nconst Item = ({ data }: { data: any }) => {\n return (\n <Card.Root>\n <Card.Toolbar>\n <span />\n <Card.Title>{Obj.getLabel(data)}</Card.Title>\n <Card.Menu />\n </Card.Toolbar>\n <Surface.Surface role='card--content' limit={1} data={{ subject: data }} />\n </Card.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,WAAAA,gBAAe;AACxB,SAASC,OAAAA,YAAW;AACpB,SAASC,YAAY;;;ACLrB,OAAOC,SAASC,WAAWC,gBAAgB;AAE3C,SAASC,SAASC,uBAAuB;AACzC,SAASC,uBAAuB;AAChC,SAASC,QAAQC,KAAeC,YAAY;AAC5C,SAASC,gCAAgC;AACzC,SAASC,WAAWC,gBAAgB;AACpC,SAASC,WAAWC,wBAAwB;AAC5C,SAASC,YAAY;AACrB,SAAoBC,4BAA4B;AAOzC,IAAMC,mBAAmB,CAAC,EAC/BC,MAAMC,WACNC,MAAMC,MAAK,MAIZ;AACC,QAAM,CAACH,IAAAA,IAAQI,UAAUH,SAAAA;AACzB,QAAMI,UAAUC,gBAAgBC,gBAAgBC,MAAM;AACtD,QAAMC,KAAKT,QAAQU,IAAIC,YAAYX,IAAAA;AACnC,QAAMY,WAAWZ,MAAMa,QAAQC,qBAAqBd,KAAKa,MAAME,GAAG,IAAIC;AAEtE,QAAM,CAACC,YAAYC,aAAAA,IAAiBC,SAAAA;AAEpCC,YAAU,MAAA;AACR,UAAMC,eAAehB,QAAQiB,KAAI,EAAGC,KAAK,CAACC,WAAWC,KAAKC,YAAYF,MAAAA,MAAYZ,QAAAA;AAClF,QAAIS,cAAc;AAChBH,oBAAc,MAAMG,YAAAA;IACtB;AACA,QAAI,CAACA,gBAAgBT,YAAYH,IAAI;AACnC,YAAMI,QAAQJ,GAAGkB,eAAed,MAAM;QAAED;MAAS,CAAA;AACjD,YAAMgB,cAAcf,MAAMgB,UACxB,MAAA;AACE,cAAM,CAACL,MAAAA,IAAUX,MAAMiB;AACvB,YAAIN,QAAQ;AACVN,wBAAcM,MAAAA;QAChB;MACF,GACA;QAAEO,MAAM;MAAK,CAAA;AAEf,aAAOH;IACT;EACF,GAAG;IAACvB;IAASO;IAAUH;GAAG;AAE1B,QAAMuB,UAAUC,SAASxB,IAAIQ,aAAaiB,OAAOC,KAAKlB,UAAAA,IAAciB,OAAOE,QAAO,CAAA;AAClF,QAAMC,kBAAkBC,yBAAyBN,OAAAA;AAEjD,SACE,sBAAA,cAACO,iBAAiBC,MAAI;IACpBC,OAAOJ;IACPK,QAAQC;IACRC,YAAW;;AAGjB;AAEA,IAAMD,OAAO,CAAC,EAAEE,KAAI,MAAiB;AACnC,SACE,sBAAA,cAACC,KAAKN,MAAI,MACR,sBAAA,cAACM,KAAKC,SAAO,MACX,sBAAA,cAACC,QAAAA,IAAAA,GACD,sBAAA,cAACF,KAAKG,OAAK,MAAEvC,IAAIwC,SAASL,IAAAA,CAAAA,GAC1B,sBAAA,cAACC,KAAKK,MAAI,IAAA,CAAA,GAEZ,sBAAA,cAACC,QAAQA,SAAO;IAAClD,MAAK;IAAgBmD,OAAO;IAAGR,MAAM;MAAES,SAAST;IAAK;;AAG5E;;;AD9DA,IAAA,wBAAeU,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,SAAQC,OAAO;IACbC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SACPC,KAAIC,WAAWC,gBAAQA,SAASH,KAAKI,OAAO,KAAKH,KAAIC,WAAWG,KAAKA,MAAML,KAAKI,OAAO;IACzFE,WAAW,CAAC,EAAEN,MAAMF,KAAI,MAAE;AACxB,YAAMS,OAAON,KAAIC,WAAWG,KAAKA,MAAML,KAAKI,OAAO,IAAIJ,KAAKI,UAAUJ,KAAKI,QAAQG;AACnF,aAAO,gBAAAC,OAAA,cAACC,kBAAAA;QAAiBF;QAAYT;;IACvC;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "View", "React", "useEffect", "useState", "Surface", "useCapabilities", "AppCapabilities", "Filter", "Obj", "Type", "useGlobalFilteredObjects", "useObject", "useQuery", "Masonry", "MasonryComponent", "Card", "getTypenameFromQuery", "MasonryContainer", "view", "viewOrRef", "role", "_role", "useObject", "schemas", "useCapabilities", "AppCapabilities", "Schema", "db", "Obj", "getDatabase", "typename", "query", "getTypenameFromQuery", "ast", "undefined", "cardSchema", "setCardSchema", "useState", "useEffect", "staticSchema", "flat", "find", "schema", "Type", "getTypename", "schemaRegistry", "unsubscribe", "subscribe", "results", "fire", "objects", "useQuery", "Filter", "type", "nothing", "filteredObjects", "useGlobalFilteredObjects", "MasonryComponent", "Root", "items", "render", "Item", "classNames", "data", "Card", "Toolbar", "span", "Title", "getLabel", "Menu", "Surface", "limit", "subject", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Masonry", "subject", "View", "component", "view", "React", "MasonryContainer"]
|
|
7
|
+
}
|
|
@@ -22,7 +22,7 @@ var Masonry = Schema.Struct({
|
|
|
22
22
|
arrangement: Schema.Array(Schema.Struct({
|
|
23
23
|
ids: Schema.Array(Obj.ID),
|
|
24
24
|
hidden: Schema.optional(Schema.Boolean)
|
|
25
|
-
})
|
|
25
|
+
})).pipe(FormInputAnnotation.set(false), Schema.optional)
|
|
26
26
|
}).pipe(Type.object({
|
|
27
27
|
typename: "dxos.org/type/Masonry",
|
|
28
28
|
version: "0.2.0"
|
|
@@ -40,7 +40,7 @@ var MasonryV1 = Schema.Struct({
|
|
|
40
40
|
arrangement: Schema.Array(Schema.Struct({
|
|
41
41
|
ids: Schema.Array(Obj.ID),
|
|
42
42
|
hidden: Schema.optional(Schema.Boolean)
|
|
43
|
-
})
|
|
43
|
+
})).pipe(Schema.optional)
|
|
44
44
|
}).pipe(Type.object({
|
|
45
45
|
typename: "dxos.org/type/Masonry",
|
|
46
46
|
version: "0.1.0"
|
|
@@ -76,4 +76,4 @@ export {
|
|
|
76
76
|
Masonry_exports,
|
|
77
77
|
MasonryAction_exports
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
//# sourceMappingURL=chunk-YNA44I6R.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 { Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { View, ViewAnnotation } from '@dxos/schema';\n\nexport const Masonry = Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n\n view: Type.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: 'dxos.org/type/Masonry',\n version: '0.2.0',\n }),\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(true),\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//\n// V1\n//\n\nexport const MasonryV1 = Schema.Struct({\n arrangement: Schema.Array(\n Schema.Struct({\n ids: Schema.Array(Obj.ID),\n hidden: Schema.optional(Schema.Boolean),\n }),\n ).pipe(Schema.optional),\n}).pipe(\n Type.object({\n typename: 'dxos.org/type/Masonry',\n version: '0.1.0',\n }),\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 registered: ['registered'],\n }),\n Schema.optional,\n ),\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAAA;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,KAAKC,KAAKC,YAAY;AAC/B,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,MAAMC,sBAAsB;AAE9B,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,cAAOC,KAAYC,eAAQ;EAExCC,MAAMC,KAAKC,IAAIC,KAAKA,IAAI,EAAEL,KAAKM,oBAAoBC,IAAI,KAAA,CAAA;EAEvDC,aAAoBC,aACXZ,cAAO;IACZa,KAAYD,aAAME,IAAIC,EAAE;IACxBC,QAAeZ,gBAAgBa,cAAO;EACxC,CAAA,CAAA,EACAd,KAAKM,oBAAoBC,IAAI,KAAA,GAAeN,eAAQ;AAExD,CAAA,EAAGD,KACDG,KAAKY,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,gBAAgBX,IAAI;EAAC;CAAO,GAC5BY,eAAeZ,IAAI,IAAA,CAAA;AAYd,IAAMa,OAAO,CAAC,EAAEtB,MAAMU,cAAc,CAAA,GAAIN,KAAI,MAAa;AAC9D,SAAOS,IAAIS,KAAKxB,SAAS;IAAEE;IAAMI,MAAME,IAAIgB,KAAKlB,IAAAA;IAAOM;EAAY,CAAA;AACrE;AAMO,IAAMa,YAAmBxB,cAAO;EACrCW,aAAoBC,aACXZ,cAAO;IACZa,KAAYD,aAAME,IAAIC,EAAE;IACxBC,QAAeZ,gBAAgBa,cAAO;EACxC,CAAA,CAAA,EACAd,KAAYC,eAAQ;AACxB,CAAA,EAAGD,KACDG,KAAKY,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,CAAA;;;AC3DF;;;;AAIA,YAAYK,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;;IACPC,YAAY;MAAC;;EACf,CAAA,GACOV,gBAAQ;AAEnB,CAAA;",
|
|
6
|
+
"names": ["Schema", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "View", "ViewAnnotation", "Masonry", "Struct", "name", "String", "pipe", "optional", "view", "Type", "Ref", "View", "FormInputAnnotation", "set", "arrangement", "Array", "ids", "Obj", "ID", "hidden", "Boolean", "object", "typename", "version", "LabelAnnotation", "ViewAnnotation", "make", "MasonryV1", "Schema", "TypeInputOptionsAnnotation", "MasonryProps", "Struct", "name", "optional", "String", "typename", "pipe", "annotations", "title", "TypeInputOptionsAnnotation", "set", "location", "kind", "registered"]
|
|
7
|
+
}
|
|
@@ -5,17 +5,18 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
MasonryAction_exports,
|
|
7
7
|
Masonry_exports
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YNA44I6R.mjs";
|
|
9
9
|
|
|
10
10
|
// src/MasonryPlugin.tsx
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
|
-
import {
|
|
12
|
+
import { Plugin } from "@dxos/app-framework";
|
|
13
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
13
14
|
import { Type as Type2 } from "@dxos/echo";
|
|
14
15
|
import { View } from "@dxos/schema";
|
|
15
16
|
|
|
16
17
|
// src/capabilities/react-surface/index.ts
|
|
17
18
|
import { Capability } from "@dxos/app-framework";
|
|
18
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-
|
|
19
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("./react-surface-XG56AMA7.mjs"));
|
|
19
20
|
|
|
20
21
|
// src/translations.ts
|
|
21
22
|
import { Type } from "@dxos/echo";
|
|
@@ -40,11 +41,7 @@ var translations = [
|
|
|
40
41
|
];
|
|
41
42
|
|
|
42
43
|
// src/MasonryPlugin.tsx
|
|
43
|
-
var MasonryPlugin = Plugin.define(meta).pipe(
|
|
44
|
-
translations
|
|
45
|
-
}), Common.Plugin.addSurfaceModule({
|
|
46
|
-
activate: ReactSurface
|
|
47
|
-
}), Common.Plugin.addMetadataModule({
|
|
44
|
+
var MasonryPlugin = Plugin.define(meta).pipe(AppPlugin.addMetadataModule({
|
|
48
45
|
metadata: {
|
|
49
46
|
id: Type2.getTypename(Masonry_exports.Masonry),
|
|
50
47
|
metadata: {
|
|
@@ -63,10 +60,14 @@ var MasonryPlugin = Plugin.define(meta).pipe(Common.Plugin.addTranslationsModule
|
|
|
63
60
|
})
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
|
-
}),
|
|
63
|
+
}), AppPlugin.addSchemaModule({
|
|
67
64
|
schema: [
|
|
68
65
|
Masonry_exports.Masonry
|
|
69
66
|
]
|
|
67
|
+
}), AppPlugin.addSurfaceModule({
|
|
68
|
+
activate: ReactSurface
|
|
69
|
+
}), AppPlugin.addTranslationsModule({
|
|
70
|
+
translations
|
|
70
71
|
}), Plugin.make);
|
|
71
72
|
export {
|
|
72
73
|
MasonryPlugin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/MasonryPlugin.tsx", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,
|
|
6
|
-
"names": ["Effect", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Type } from '@dxos/echo';\nimport { type CreateObject } from '@dxos/plugin-space/types';\nimport { View } 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: 'ph--wall--regular',\n iconHue: 'green',\n inputSchema: MasonryAction.MasonryProps,\n createObject: ((props, { db }) =>\n Effect.promise(async () => {\n const { view } = await View.makeFromDatabase({ db, typename: props.typename });\n return Masonry.make({ name: props.name, view });\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 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\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 '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": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,QAAAA,aAAY;AAErB,SAASC,YAAY;;;ACNrB,SAASC,kBAAkB;AAEpB,IAAMC,eAAeC,WAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACFzE,SAASC,YAAY;AAMd,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,YAAYC,gBAAQA,OAAO,CAAA,GAAI;QACnC,kBAAkB;QAClB,uBAAuB;QACvB,sBAAsB;QACtB,wBAAwB;QACxB,2BAA2B;QAC3B,uBAAuB;QACvB,uBAAuB;QACvB,wBAAwB;MAC1B;MACA,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;MACjB;IACF;EACF;;;;AFVK,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,UAAUC,kBAAkB;EAC1BC,UAAU;IACRC,IAAIC,MAAKC,YAAYC,gBAAQA,OAAO;IACpCJ,UAAU;MACRK,MAAM;MACNC,SAAS;MACTC,aAAaC,sBAAcC;MAC3BC,cAAe,CAACC,OAAO,EAAEC,GAAE,MAClBC,eAAQ,YAAA;AACb,cAAM,EAAEC,KAAI,IAAK,MAAMC,KAAKC,iBAAiB;UAAEJ;UAAIK,UAAUN,MAAMM;QAAS,CAAA;AAC5E,eAAOb,gBAAQc,KAAK;UAAEC,MAAMR,MAAMQ;UAAML;QAAK,CAAA;MAC/C,CAAA;IACJ;EACF;AACF,CAAA,GACAhB,UAAUsB,gBAAgB;EAAEC,QAAQ;IAACjB,gBAAQA;;AAAS,CAAA,GACtDN,UAAUwB,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpD1B,UAAU2B,sBAAsB;EAAEC;AAAa,CAAA,GAC/ChC,OAAOwB,IAAI;",
|
|
6
|
+
"names": ["Effect", "Plugin", "AppPlugin", "Type", "View", "Capability", "ReactSurface", "Capability", "lazy", "Type", "translations", "Type", "getTypename", "Masonry", "meta", "id", "MasonryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addMetadataModule", "metadata", "id", "Type", "getTypename", "Masonry", "icon", "iconHue", "inputSchema", "MasonryAction", "MasonryProps", "createObject", "props", "db", "promise", "view", "View", "makeFromDatabase", "typename", "make", "name", "addSchemaModule", "schema", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":1966,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/MasonryContainer.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":1966,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/MasonryContainer.tsx":{"bytes":8879,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-masonry","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/types/Masonry.ts":{"bytes":5570,"imports":[{"path":"effect/Schema","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":2399,"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"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":4234,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/components/MasonryContainer.tsx","kind":"import-statement","original":"../../components/MasonryContainer"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../../types"}],"format":"esm"},"src/capabilities/react-surface/index.ts":{"bytes":911,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/react-surface/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":488,"imports":[{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":2691,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/MasonryPlugin.tsx":{"bytes":5024,"imports":[{"path":"effect/Effect","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/schema","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"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"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4056},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-P6EZJITS.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-YNA44I6R.mjs","kind":"import-statement"},{"path":"effect/Effect","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/schema","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/react-surface-XG56AMA7.mjs","kind":"dynamic-import"},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["MasonryPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/MasonryPlugin.tsx":{"bytesInOutput":985},"src/capabilities/react-surface/index.ts":{"bytesInOutput":148},"src/capabilities/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":575}},"bytes":2121},"dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-YNA44I6R.mjs","kind":"import-statement"}],"exports":["Masonry","MasonryAction"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":294},"dist/lib/node-esm/react-surface-XG56AMA7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6944},"dist/lib/node-esm/react-surface-XG56AMA7.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-P6EZJITS.mjs","kind":"import-statement"},{"path":"dist/lib/node-esm/chunk-YNA44I6R.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-search","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-masonry","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":865},"src/components/MasonryContainer.tsx":{"bytesInOutput":2252}},"bytes":3559},"dist/lib/node-esm/chunk-P6EZJITS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":950},"dist/lib/node-esm/chunk-P6EZJITS.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":482}},"bytes":654},"dist/lib/node-esm/chunk-YNA44I6R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4068},"dist/lib/node-esm/chunk-YNA44I6R.mjs":{"imports":[{"path":"effect/Schema","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":["MasonryAction_exports","Masonry_exports"],"inputs":{"src/types/Masonry.ts":{"bytesInOutput":1215},"src/types/index.ts":{"bytesInOutput":0},"src/types/MasonryAction.ts":{"bytesInOutput":640}},"bytes":2270}}}
|
|
@@ -4,28 +4,29 @@ import {
|
|
|
4
4
|
} from "./chunk-P6EZJITS.mjs";
|
|
5
5
|
import {
|
|
6
6
|
Masonry_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YNA44I6R.mjs";
|
|
8
8
|
|
|
9
9
|
// src/capabilities/react-surface/react-surface.tsx
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
11
|
import React2 from "react";
|
|
12
|
-
import {
|
|
12
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
13
|
+
import { Surface as Surface2 } from "@dxos/app-framework/ui";
|
|
13
14
|
import { Obj as Obj2 } from "@dxos/echo";
|
|
14
15
|
import { View } from "@dxos/schema";
|
|
15
16
|
|
|
16
17
|
// src/components/MasonryContainer.tsx
|
|
17
18
|
import React, { useEffect, useState } from "react";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
19
|
+
import { Surface, useCapabilities } from "@dxos/app-framework/ui";
|
|
20
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
20
21
|
import { Filter, Obj, Type } from "@dxos/echo";
|
|
21
22
|
import { useGlobalFilteredObjects } from "@dxos/plugin-search";
|
|
22
23
|
import { useObject, useQuery } from "@dxos/react-client/echo";
|
|
23
24
|
import { Masonry as MasonryComponent } from "@dxos/react-ui-masonry";
|
|
24
25
|
import { Card } from "@dxos/react-ui-mosaic";
|
|
25
26
|
import { getTypenameFromQuery } from "@dxos/schema";
|
|
26
|
-
var MasonryContainer = ({ view: viewOrRef, role }) => {
|
|
27
|
+
var MasonryContainer = ({ view: viewOrRef, role: _role }) => {
|
|
27
28
|
const [view] = useObject(viewOrRef);
|
|
28
|
-
const schemas = useCapabilities(
|
|
29
|
+
const schemas = useCapabilities(AppCapabilities.Schema);
|
|
29
30
|
const db = view && Obj.getDatabase(view);
|
|
30
31
|
const typename = view?.query ? getTypenameFromQuery(view.query.ast) : void 0;
|
|
31
32
|
const [cardSchema, setCardSchema] = useState();
|
|
@@ -62,7 +63,7 @@ var MasonryContainer = ({ view: viewOrRef, role }) => {
|
|
|
62
63
|
});
|
|
63
64
|
};
|
|
64
65
|
var Item = ({ data }) => {
|
|
65
|
-
return /* @__PURE__ */ React.createElement(Card.Root, null, /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement(Card.Title, null, Obj.getLabel(data)), /* @__PURE__ */ React.createElement(Card.Menu, null)), /* @__PURE__ */ React.createElement(Surface, {
|
|
66
|
+
return /* @__PURE__ */ React.createElement(Card.Root, null, /* @__PURE__ */ React.createElement(Card.Toolbar, null, /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement(Card.Title, null, Obj.getLabel(data)), /* @__PURE__ */ React.createElement(Card.Menu, null)), /* @__PURE__ */ React.createElement(Surface.Surface, {
|
|
66
67
|
role: "card--content",
|
|
67
68
|
limit: 1,
|
|
68
69
|
data: {
|
|
@@ -72,8 +73,8 @@ var Item = ({ data }) => {
|
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
// src/capabilities/react-surface/react-surface.tsx
|
|
75
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(
|
|
76
|
-
|
|
76
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
77
|
+
Surface2.create({
|
|
77
78
|
id: meta.id,
|
|
78
79
|
role: [
|
|
79
80
|
"article",
|
|
@@ -92,4 +93,4 @@ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capabilit
|
|
|
92
93
|
export {
|
|
93
94
|
react_surface_default as default
|
|
94
95
|
};
|
|
95
|
-
//# sourceMappingURL=react-surface-
|
|
96
|
+
//# sourceMappingURL=react-surface-XG56AMA7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/components/MasonryContainer.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { View } from '@dxos/schema';\n\nimport { MasonryContainer } from '../../components/MasonryContainer';\nimport { meta } from '../../meta';\nimport { Masonry } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: meta.id,\n role: ['article', 'section'],\n filter: (data): data is { subject: Masonry.Masonry | View.View } =>\n Obj.instanceOf(Masonry.Masonry, data.subject) || Obj.instanceOf(View.View, data.subject),\n component: ({ data, role }) => {\n const view = Obj.instanceOf(View.View, data.subject) ? data.subject : data.subject.view;\n return <MasonryContainer view={view} role={role} />;\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\nimport React, { useEffect, useState } from 'react';\n\nimport { Surface, useCapabilities } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Filter, Obj, type Ref, Type } from '@dxos/echo';\nimport { useGlobalFilteredObjects } from '@dxos/plugin-search';\nimport { useObject, useQuery } from '@dxos/react-client/echo';\nimport { Masonry as MasonryComponent } from '@dxos/react-ui-masonry';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type View, getTypenameFromQuery } from '@dxos/schema';\n\nexport type MasonryContainerProps = {\n view: View.View;\n role?: string;\n};\n\nexport const MasonryContainer = ({\n view: viewOrRef,\n role: _role,\n}: {\n view: View.View | Ref.Ref<View.View>;\n role?: string;\n}) => {\n const [view] = useObject(viewOrRef);\n const schemas = useCapabilities(AppCapabilities.Schema);\n const db = view && Obj.getDatabase(view);\n const typename = view?.query ? getTypenameFromQuery(view.query.ast) : undefined;\n\n const [cardSchema, setCardSchema] = useState<Schema.Schema.AnyNoContext>();\n\n useEffect(() => {\n const staticSchema = schemas.flat().find((schema) => Type.getTypename(schema) === typename);\n if (staticSchema) {\n setCardSchema(() => staticSchema);\n }\n if (!staticSchema && typename && db) {\n const query = db.schemaRegistry.query({ typename });\n const unsubscribe = query.subscribe(\n () => {\n const [schema] = query.results;\n if (schema) {\n setCardSchema(schema);\n }\n },\n { fire: true },\n );\n return unsubscribe;\n }\n }, [schemas, typename, db]);\n\n const objects = useQuery(db, cardSchema ? Filter.type(cardSchema) : Filter.nothing());\n const filteredObjects = useGlobalFilteredObjects(objects);\n\n return (\n <MasonryComponent.Root\n items={filteredObjects}\n render={Item as any}\n classNames='is-full max-is-full bs-full max-bs-full overflow-y-auto p-4'\n />\n );\n};\n\nconst Item = ({ data }: { data: any }) => {\n return (\n <Card.Root>\n <Card.Toolbar>\n <span />\n <Card.Title>{Obj.getLabel(data)}</Card.Title>\n <Card.Menu />\n </Card.Toolbar>\n <Surface.Surface role='card--content' limit={1} data={{ subject: data }} />\n </Card.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,WAAAA,gBAAe;AACxB,SAASC,OAAAA,YAAW;AACpB,SAASC,YAAY;;;ACLrB,OAAOC,SAASC,WAAWC,gBAAgB;AAE3C,SAASC,SAASC,uBAAuB;AACzC,SAASC,uBAAuB;AAChC,SAASC,QAAQC,KAAeC,YAAY;AAC5C,SAASC,gCAAgC;AACzC,SAASC,WAAWC,gBAAgB;AACpC,SAASC,WAAWC,wBAAwB;AAC5C,SAASC,YAAY;AACrB,SAAoBC,4BAA4B;AAOzC,IAAMC,mBAAmB,CAAC,EAC/BC,MAAMC,WACNC,MAAMC,MAAK,MAIZ;AACC,QAAM,CAACH,IAAAA,IAAQI,UAAUH,SAAAA;AACzB,QAAMI,UAAUC,gBAAgBC,gBAAgBC,MAAM;AACtD,QAAMC,KAAKT,QAAQU,IAAIC,YAAYX,IAAAA;AACnC,QAAMY,WAAWZ,MAAMa,QAAQC,qBAAqBd,KAAKa,MAAME,GAAG,IAAIC;AAEtE,QAAM,CAACC,YAAYC,aAAAA,IAAiBC,SAAAA;AAEpCC,YAAU,MAAA;AACR,UAAMC,eAAehB,QAAQiB,KAAI,EAAGC,KAAK,CAACC,WAAWC,KAAKC,YAAYF,MAAAA,MAAYZ,QAAAA;AAClF,QAAIS,cAAc;AAChBH,oBAAc,MAAMG,YAAAA;IACtB;AACA,QAAI,CAACA,gBAAgBT,YAAYH,IAAI;AACnC,YAAMI,QAAQJ,GAAGkB,eAAed,MAAM;QAAED;MAAS,CAAA;AACjD,YAAMgB,cAAcf,MAAMgB,UACxB,MAAA;AACE,cAAM,CAACL,MAAAA,IAAUX,MAAMiB;AACvB,YAAIN,QAAQ;AACVN,wBAAcM,MAAAA;QAChB;MACF,GACA;QAAEO,MAAM;MAAK,CAAA;AAEf,aAAOH;IACT;EACF,GAAG;IAACvB;IAASO;IAAUH;GAAG;AAE1B,QAAMuB,UAAUC,SAASxB,IAAIQ,aAAaiB,OAAOC,KAAKlB,UAAAA,IAAciB,OAAOE,QAAO,CAAA;AAClF,QAAMC,kBAAkBC,yBAAyBN,OAAAA;AAEjD,SACE,sBAAA,cAACO,iBAAiBC,MAAI;IACpBC,OAAOJ;IACPK,QAAQC;IACRC,YAAW;;AAGjB;AAEA,IAAMD,OAAO,CAAC,EAAEE,KAAI,MAAiB;AACnC,SACE,sBAAA,cAACC,KAAKN,MAAI,MACR,sBAAA,cAACM,KAAKC,SAAO,MACX,sBAAA,cAACC,QAAAA,IAAAA,GACD,sBAAA,cAACF,KAAKG,OAAK,MAAEvC,IAAIwC,SAASL,IAAAA,CAAAA,GAC1B,sBAAA,cAACC,KAAKK,MAAI,IAAA,CAAA,GAEZ,sBAAA,cAACC,QAAQA,SAAO;IAAClD,MAAK;IAAgBmD,OAAO;IAAGR,MAAM;MAAES,SAAST;IAAK;;AAG5E;;;AD9DA,IAAA,wBAAeU,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,SAAQC,OAAO;IACbC,IAAIC,KAAKD;IACTE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SACPC,KAAIC,WAAWC,gBAAQA,SAASH,KAAKI,OAAO,KAAKH,KAAIC,WAAWG,KAAKA,MAAML,KAAKI,OAAO;IACzFE,WAAW,CAAC,EAAEN,MAAMF,KAAI,MAAE;AACxB,YAAMS,OAAON,KAAIC,WAAWG,KAAKA,MAAML,KAAKI,OAAO,IAAIJ,KAAKI,UAAUJ,KAAKI,QAAQG;AACnF,aAAO,gBAAAC,OAAA,cAACC,kBAAAA;QAAiBF;QAAYT;;IACvC;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "View", "React", "useEffect", "useState", "Surface", "useCapabilities", "AppCapabilities", "Filter", "Obj", "Type", "useGlobalFilteredObjects", "useObject", "useQuery", "Masonry", "MasonryComponent", "Card", "getTypenameFromQuery", "MasonryContainer", "view", "viewOrRef", "role", "_role", "useObject", "schemas", "useCapabilities", "AppCapabilities", "Schema", "db", "Obj", "getDatabase", "typename", "query", "getTypenameFromQuery", "ast", "undefined", "cardSchema", "setCardSchema", "useState", "useEffect", "staticSchema", "flat", "find", "schema", "Type", "getTypename", "schemaRegistry", "unsubscribe", "subscribe", "results", "fire", "objects", "useQuery", "Filter", "type", "nothing", "filteredObjects", "useGlobalFilteredObjects", "MasonryComponent", "Root", "items", "render", "Item", "classNames", "data", "Card", "Toolbar", "span", "Title", "getLabel", "Menu", "Surface", "limit", "subject", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Masonry", "subject", "View", "component", "view", "React", "MasonryContainer"]
|
|
7
|
+
}
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
MasonryAction_exports,
|
|
4
4
|
Masonry_exports
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-YNA44I6R.mjs";
|
|
6
6
|
export {
|
|
7
7
|
Masonry_exports as Masonry,
|
|
8
8
|
MasonryAction_exports as MasonryAction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MasonryPlugin.d.ts","sourceRoot":"","sources":["../../../src/MasonryPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"MasonryPlugin.d.ts","sourceRoot":"","sources":["../../../src/MasonryPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAW7C,eAAO,MAAM,aAAa,4BAoBzB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/
|
|
2
|
+
export declare const ReactSurface: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").ReactSurface>>, Error>;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iJAAmE,CAAC"}
|