@dxos/plugin-preview 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203
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-XLN6KTHK.mjs +17 -0
- package/dist/lib/browser/chunk-XLN6KTHK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +33 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/preview-popover-5YUZCO2D.mjs +82 -0
- package/dist/lib/browser/preview-popover-5YUZCO2D.mjs.map +7 -0
- package/dist/lib/browser/react-surface-W3FAIVY7.mjs +251 -0
- package/dist/lib/browser/react-surface-W3FAIVY7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2G4FUGDA.mjs +19 -0
- package/dist/lib/node-esm/chunk-2G4FUGDA.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +33 -38
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/preview-popover-7QRYVL73.mjs +84 -0
- package/dist/lib/node-esm/preview-popover-7QRYVL73.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-IO5DHYZB.mjs +252 -0
- package/dist/lib/node-esm/react-surface-IO5DHYZB.mjs.map +7 -0
- package/dist/types/src/PreviewPlugin.d.ts +2 -1
- package/dist/types/src/PreviewPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/preview-popover/index.d.ts +3 -0
- package/dist/types/src/capabilities/preview-popover/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/preview-popover/preview-popover.d.ts +5 -0
- package/dist/types/src/capabilities/preview-popover/preview-popover.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/cards/FormCard.d.ts +7 -0
- package/dist/types/src/cards/FormCard.d.ts.map +1 -0
- package/dist/types/src/cards/OrganizationCard.d.ts +5 -0
- package/dist/types/src/cards/OrganizationCard.d.ts.map +1 -0
- package/dist/types/src/cards/PersonCard.d.ts +5 -0
- package/dist/types/src/cards/PersonCard.d.ts.map +1 -0
- package/dist/types/src/cards/ProjectCard.d.ts +5 -0
- package/dist/types/src/cards/ProjectCard.d.ts.map +1 -0
- package/dist/types/src/cards/TaskCard.d.ts +5 -0
- package/dist/types/src/cards/TaskCard.d.ts.map +1 -0
- package/dist/types/src/cards/index.d.ts +6 -0
- package/dist/types/src/cards/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/stories/Card.stories.d.ts +32 -0
- package/dist/types/src/stories/Card.stories.d.ts.map +1 -0
- package/dist/types/src/stories/testing.d.ts +19 -0
- package/dist/types/src/stories/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +6 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -31
- package/src/PreviewPlugin.tsx +14 -26
- package/src/capabilities/index.ts +2 -4
- package/src/capabilities/preview-popover/index.ts +7 -0
- package/src/capabilities/preview-popover/preview-popover.ts +90 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +97 -0
- package/src/cards/FormCard.tsx +56 -0
- package/src/cards/OrganizationCard.tsx +29 -0
- package/src/cards/PersonCard.tsx +47 -0
- package/src/cards/ProjectCard.tsx +22 -0
- package/src/cards/TaskCard.tsx +40 -0
- package/src/{components → cards}/index.ts +3 -1
- package/src/index.ts +0 -1
- package/src/meta.ts +8 -5
- package/src/stories/Card.stories.tsx +76 -0
- package/src/stories/testing.tsx +84 -0
- package/src/translations.ts +6 -0
- package/dist/lib/browser/chunk-Z73ENKLE.mjs +0 -14
- package/dist/lib/browser/chunk-Z73ENKLE.mjs.map +0 -7
- package/dist/lib/browser/preview-popover-2UCEZUQW.mjs +0 -69
- package/dist/lib/browser/preview-popover-2UCEZUQW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-CZMUEWPV.mjs +0 -303
- package/dist/lib/browser/react-surface-CZMUEWPV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs +0 -16
- package/dist/lib/node-esm/chunk-2ORSL4GJ.mjs.map +0 -7
- package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs +0 -71
- package/dist/lib/node-esm/preview-popover-OSHWR2YE.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-IPZBISWS.mjs +0 -304
- package/dist/lib/node-esm/react-surface-IPZBISWS.mjs.map +0 -7
- package/dist/types/src/capabilities/preview-popover.d.ts +0 -4
- package/dist/types/src/capabilities/preview-popover.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/ContactCard.d.ts +0 -7
- package/dist/types/src/components/ContactCard.d.ts.map +0 -1
- package/dist/types/src/components/OrganizationCard.d.ts +0 -5
- package/dist/types/src/components/OrganizationCard.d.ts.map +0 -1
- package/dist/types/src/components/ProjectCard.d.ts +0 -5
- package/dist/types/src/components/ProjectCard.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -4
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/testing/ExtrinsicPreviews.stories.d.ts +0 -35
- package/dist/types/src/testing/ExtrinsicPreviews.stories.d.ts.map +0 -1
- package/dist/types/src/testing/IntrinsicPreviews.stories.d.ts +0 -35
- package/dist/types/src/testing/IntrinsicPreviews.stories.d.ts.map +0 -1
- package/dist/types/src/testing/PopoverPreviews.stories.d.ts +0 -35
- package/dist/types/src/testing/PopoverPreviews.stories.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -80
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -6
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/preview-popover.ts +0 -74
- package/src/capabilities/react-surface.tsx +0 -163
- package/src/components/ContactCard.tsx +0 -70
- package/src/components/OrganizationCard.tsx +0 -41
- package/src/components/ProjectCard.tsx +0 -20
- package/src/testing/ExtrinsicPreviews.stories.tsx +0 -55
- package/src/testing/IntrinsicPreviews.stories.tsx +0 -55
- package/src/testing/PopoverPreviews.stories.tsx +0 -55
- package/src/testing/util.tsx +0 -79
- package/src/types.ts +0 -11
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/cards/FormCard.tsx", "../../../src/cards/OrganizationCard.tsx", "../../../src/cards/PersonCard.tsx", "../../../src/cards/ProjectCard.tsx", "../../../src/cards/TaskCard.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 { Card } from '@dxos/react-ui-mosaic';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { Organization, Person, Pipeline, Task } from '@dxos/types';\n\nimport { FormCard, OrganizationCard, PersonCard, ProjectCard, TaskCard } from '../../cards';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n //\n // Specific schema types.\n // TODO(burdon): Create helpers and factor out.\n //\n\n Surface.create<{ subject: Person.Person }>({\n id: `${meta.id}/schema-popover--contact`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Person.Person } => Obj.instanceOf(Person.Person, data.subject),\n component: ({ data, role }) => {\n return <PersonCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}/schema-popover--organization`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Organization.Organization } =>\n Obj.instanceOf(Organization.Organization, data.subject),\n component: ({ data, role }) => {\n return <OrganizationCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}/schema-popover--project`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Pipeline.Pipeline } => Obj.instanceOf(Pipeline.Pipeline, data.subject),\n component: ({ data, role }) => {\n return <ProjectCard role={role} subject={data.subject} />;\n },\n }),\n Surface.create({\n id: `${meta.id}/schema-popover--task`,\n role: 'card--content',\n position: 'hoist',\n filter: (data): data is { subject: Task.Task } => Obj.instanceOf(Task.Task, data.subject),\n component: ({ data, role }) => {\n return <TaskCard role={role} subject={data.subject} />;\n },\n }),\n\n //\n // Fallback for any object.\n //\n\n Surface.create({\n id: `${meta.id}/fallback-popover`,\n role: 'card--content',\n position: 'fallback',\n filter: (data): data is { subject: Obj.Unknown; projection?: ProjectionModel } => Obj.isObject(data.subject),\n component: ({ data, role }) => {\n return <FormCard role={role} subject={data.subject} projection={data.projection} />;\n },\n }),\n\n Surface.create({\n id: `${meta.id}/section`,\n role: ['section'],\n position: 'fallback',\n filter: (data): data is { subject: Obj.Unknown } => Obj.isObject(data.subject),\n component: ({ data }) => {\n return (\n <div role='none' className='flex is-full justify-center'>\n <div role='none' className='pbs-2 pbe-2 card-min-width card-max-width'>\n <Card.Root>\n <Surface.Surface role='card--content' data={data} limit={1} />\n </Card.Root>\n </div>\n </div>\n );\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { type JsonPath, splitJsonPath } from '@dxos/effect';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Form, omitId } from '@dxos/react-ui-form';\nimport { type ProjectionModel } from '@dxos/schema';\nimport { descriptionMessage, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\n\nexport const FormCard = ({ subject, projection }: SurfaceComponentProps & { projection?: ProjectionModel }) => {\n const { t } = useTranslation(meta.id);\n const { invokePromise } = useOperationInvoker();\n const schema = Obj.getSchema(subject);\n const label = Obj.getLabel(subject) ?? Obj.getTypename(subject) ?? t('unable to create preview message');\n\n const handleNavigate = useCallback(async () => {\n await invokePromise(LayoutOperation.UpdatePopover, { state: false, anchorId: '' });\n await invokePromise(LayoutOperation.Open, { subject: [Obj.getDXN(subject).toString()] });\n }, [invokePromise, subject]);\n\n const handleSave = useCallback((values: any, { changed }: { changed: Record<string, boolean> }) => {\n const paths = Object.keys(changed).filter((path) => changed[path]);\n Obj.change(subject, () => {\n for (const path of paths) {\n const value = values[path];\n const parts = splitJsonPath(path as JsonPath);\n Obj.setValue(subject, parts, value);\n }\n });\n }, []);\n\n if (!schema) {\n // TODO(burdon): Use Alert.\n return <p className={mx(descriptionMessage)}>{t('unable to create preview message')}</p>;\n }\n\n return (\n <Form.Root schema={omitId(schema)} projection={projection} values={subject} autoSave onSave={handleSave}>\n {/* TODO(burdon): Scrolling issue. Need fixed height. */}\n <Form.Viewport>\n <Form.Content>\n <Form.FieldSet />\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type Organization } from '@dxos/types';\n\nexport const OrganizationCard = ({ subject }: SurfaceComponentProps<Organization.Organization>) => {\n const { image, description, website } = subject;\n\n return (\n <Card.Content>\n <Card.Poster\n alt={name ?? ''}\n {...(image ? { image } : { icon: 'ph--building-office--regular' })}\n classNames={!image && 'opacity-50'}\n />\n {description && (\n <Card.Row>\n <Card.Text variant='description'>{description}</Card.Text>\n </Card.Row>\n )}\n {website && <Card.Link label={website} href={website} />}\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Avatar } from '@dxos/react-ui';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type Person } from '@dxos/types';\n\nexport const PersonCard = ({ subject }: SurfaceComponentProps<Person.Person>) => {\n const { image, organization: { target: organization } = {}, emails = [] } = subject;\n\n return (\n <Avatar.Root>\n <Card.Content>\n {image && (\n <Card.Row className='plb-1'>\n <Avatar.Content\n imgSrc={image}\n icon='ph--user--regular'\n size={16}\n classNames={!image && 'opacity-50'}\n hue='neutral'\n variant='square'\n />\n </Card.Row>\n )}\n {organization?.name && (\n <Card.Action\n icon='ph--buildings--regular'\n label={organization.name}\n // onClick={onSelect ? () => onSelect(organization) : undefined}\n />\n )}\n {emails.map(({ value }) => (\n <Card.Row key={value} icon='ph--at--regular'>\n <Card.Text truncate className='text-primaryText'>\n {value}\n </Card.Text>\n </Card.Row>\n ))}\n </Card.Content>\n </Avatar.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { type Pipeline } from '@dxos/types';\n\nexport const ProjectCard = ({ subject }: SurfaceComponentProps<Pipeline.Pipeline>) => {\n const { name, image, description } = subject;\n\n return (\n <Card.Content>\n {image && <Card.Poster image={image} alt={Obj.getLabel(subject) ?? ''} aspect='auto' />}\n {/* <CardHeader label={name} subject={subject} db={db} /> */}\n {description && <Card.Text variant='description'>{description}</Card.Text>}\n </Card.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as SchemaAST from 'effect/SchemaAST';\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { type PropertyMetaAnnotation, PropertyMetaAnnotationId } from '@dxos/echo/internal';\nimport { Card } from '@dxos/react-ui-mosaic';\nimport { Task } from '@dxos/types';\n\nexport const TaskCard = ({ subject }: SurfaceComponentProps<Task.Task>) => {\n const { title, status } = subject;\n const statusOption = getActiveStatusOption(status);\n\n return (\n <Card.Content>\n <Card.Heading classNames='min-is-0 flex-1 truncate'>{title}</Card.Heading>\n {statusOption && (\n <span className='dx-tag' data-hue={statusOption.color}>\n {statusOption.title}\n </span>\n )}\n </Card.Content>\n );\n};\n\n// TODO(thure): Should this move upstream as a helper? Is there an easier way to get options?\nconst getActiveStatusOption = (status?: string) => {\n const properties = SchemaAST.getPropertySignatures(Task.Task.ast);\n const statusProperty = properties.find((p) => p.name === 'status');\n const statusMeta = SchemaAST.getAnnotation<PropertyMetaAnnotation>(PropertyMetaAnnotationId)(\n // TODO(thure): Typescript asserts `.type` doesn’t have `.types`, but in runtime it does.\n (statusProperty!.type as any).types[0],\n );\n const options = // TODO(thure): Typescript asserts `statusMeta` doesn’t have `.value`, but in runtime it does.\n (statusMeta as any).value.singleSelect.options as { id: string; title: string; color: string }[];\n return options.find(({ id }) => id === status);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,YAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,OAAAA,YAAW;AACpB,SAASC,QAAAA,aAAY;AAErB,SAASC,cAAcC,QAAQC,UAAUC,QAAAA,aAAY;;;ACRrD,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,2BAA2B;AACpC,SAASC,uBAAuB;AAEhC,SAASC,WAAW;AACpB,SAAwBC,qBAAqB;AAC7C,SAASC,sBAAsB;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C,KAAIC,WAAWU,MAAKA,MAAMZ,KAAKI,OAAO;IACxFC,WAAW,CAAC,EAAEL,MAAMH,KAAI,MAAE;AACxB,aAAO,gBAAAS,OAAA,cAACO,UAAAA;QAAShB;QAAYO,SAASJ,KAAKI;;IAC7C;EACF,CAAA;;;;EAMAX,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,UAAU;IACVC,QAAQ,CAACC,SAAyEC,KAAIa,SAASd,KAAKI,OAAO;IAC3GC,WAAW,CAAC,EAAEL,MAAMH,KAAI,MAAE;AACxB,aAAO,gBAAAS,OAAA,cAACS,UAAAA;QAASlB;QAAYO,SAASJ,KAAKI;QAASY,YAAYhB,KAAKgB;;IACvE;EACF,CAAA;EAEAvB,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;MAAC;;IACPC,UAAU;IACVC,QAAQ,CAACC,SAA2CC,KAAIa,SAASd,KAAKI,OAAO;IAC7EC,WAAW,CAAC,EAAEL,KAAI,MAAE;AAClB,aACE,gBAAAM,OAAA,cAACW,OAAAA;QAAIpB,MAAK;QAAOqB,WAAU;SACzB,gBAAAZ,OAAA,cAACW,OAAAA;QAAIpB,MAAK;QAAOqB,WAAU;SACzB,gBAAAZ,OAAA,cAACa,MAAKC,MAAI,MACR,gBAAAd,OAAA,cAACb,QAAQA,SAAO;QAACI,MAAK;QAAgBG;QAAYqB,OAAO;;IAKnE;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Card", "Organization", "Person", "Pipeline", "Task", "React", "useCallback", "useOperationInvoker", "LayoutOperation", "Obj", "splitJsonPath", "useTranslation", "Form", "omitId", "descriptionMessage", "mx", "FormCard", "subject", "projection", "t", "useTranslation", "meta", "id", "invokePromise", "useOperationInvoker", "schema", "Obj", "getSchema", "label", "getLabel", "getTypename", "handleNavigate", "useCallback", "LayoutOperation", "UpdatePopover", "state", "anchorId", "Open", "getDXN", "toString", "handleSave", "values", "changed", "paths", "Object", "keys", "filter", "path", "change", "value", "parts", "splitJsonPath", "setValue", "p", "className", "mx", "descriptionMessage", "Form", "Root", "omitId", "autoSave", "onSave", "Viewport", "Content", "FieldSet", "React", "Card", "OrganizationCard", "subject", "image", "description", "website", "React", "Card", "Content", "Poster", "alt", "name", "icon", "classNames", "Row", "Text", "variant", "Link", "label", "href", "React", "Avatar", "Card", "PersonCard", "subject", "image", "organization", "target", "emails", "React", "Avatar", "Root", "Card", "Content", "Row", "className", "imgSrc", "icon", "size", "classNames", "hue", "variant", "name", "Action", "label", "map", "value", "key", "Text", "truncate", "React", "Obj", "Card", "ProjectCard", "subject", "name", "image", "description", "React", "Card", "Content", "Poster", "alt", "Obj", "getLabel", "aspect", "Text", "variant", "SchemaAST", "React", "PropertyMetaAnnotationId", "Card", "Task", "TaskCard", "subject", "title", "status", "statusOption", "getActiveStatusOption", "React", "Card", "Content", "Heading", "classNames", "span", "className", "data-hue", "color", "properties", "getPropertySignatures", "Task", "ast", "statusProperty", "find", "p", "name", "statusMeta", "getAnnotation", "PropertyMetaAnnotationId", "type", "types", "options", "value", "singleSelect", "id", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "position", "filter", "data", "Obj", "instanceOf", "Person", "subject", "component", "React", "PersonCard", "Organization", "OrganizationCard", "Pipeline", "ProjectCard", "Task", "TaskCard", "isObject", "FormCard", "projection", "div", "className", "Card", "Root", "limit"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/meta.ts
|
|
4
|
+
import { trim } from "@dxos/util";
|
|
5
|
+
var meta = {
|
|
6
|
+
id: "dxos.org/plugin/preview",
|
|
7
|
+
name: "Preview",
|
|
8
|
+
description: trim`
|
|
9
|
+
Rich preview panel for viewing object content without opening full editors.
|
|
10
|
+
Quick peek at documents, images, and data with inline rendering.
|
|
11
|
+
`,
|
|
12
|
+
icon: "ph--eye--regular",
|
|
13
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
meta
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-2G4FUGDA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'dxos.org/plugin/preview',\n name: 'Preview',\n description: trim`\n Rich preview panel for viewing object content without opening full editors.\n Quick peek at documents, images, and data with inline rendering.\n `,\n icon: 'ph--eye--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-preview',\n};\n"],
|
|
5
|
+
"mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source"]
|
|
7
|
+
}
|
|
@@ -1,60 +1,55 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
PREVIEW_PLUGIN,
|
|
4
3
|
meta
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2G4FUGDA.mjs";
|
|
6
5
|
|
|
7
6
|
// src/PreviewPlugin.tsx
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { ActivationEvents, Plugin } from "@dxos/app-framework";
|
|
8
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
9
|
+
import { Organization, Person } from "@dxos/types";
|
|
11
10
|
|
|
12
|
-
// src/capabilities/index.ts
|
|
13
|
-
import {
|
|
14
|
-
var PreviewPopover = lazy(() => import("./preview-popover-
|
|
15
|
-
|
|
11
|
+
// src/capabilities/preview-popover/index.ts
|
|
12
|
+
import { Capability } from "@dxos/app-framework";
|
|
13
|
+
var PreviewPopover = Capability.lazy("PreviewPopover", () => import("./preview-popover-7QRYVL73.mjs"));
|
|
14
|
+
|
|
15
|
+
// src/capabilities/react-surface/index.ts
|
|
16
|
+
import { Capability as Capability2 } from "@dxos/app-framework";
|
|
17
|
+
var ReactSurface = Capability2.lazy("ReactSurface", () => import("./react-surface-IO5DHYZB.mjs"));
|
|
16
18
|
|
|
17
19
|
// src/translations.ts
|
|
18
20
|
var translations = [
|
|
19
21
|
{
|
|
20
22
|
"en-US": {
|
|
21
23
|
[meta.id]: {
|
|
22
|
-
"unable to create preview message": "No preview"
|
|
24
|
+
"unable to create preview message": "No preview",
|
|
25
|
+
"todo label": "To do",
|
|
26
|
+
"in-progress label": "In progress",
|
|
27
|
+
"done label": "Done",
|
|
28
|
+
"open object label": "Open",
|
|
29
|
+
"add object to space label": "Add to space",
|
|
30
|
+
"more options label": "More options"
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
}
|
|
26
34
|
];
|
|
27
35
|
|
|
28
36
|
// src/PreviewPlugin.tsx
|
|
29
|
-
var PreviewPlugin = ()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}),
|
|
45
|
-
defineModule({
|
|
46
|
-
id: `${meta.id}/module/preview-popover`,
|
|
47
|
-
activatesOn: Events.Startup,
|
|
48
|
-
activate: PreviewPopover
|
|
49
|
-
}),
|
|
50
|
-
defineModule({
|
|
51
|
-
id: `${meta.id}/module/react-surface`,
|
|
52
|
-
activatesOn: Events.SetupReactSurface,
|
|
53
|
-
activate: ReactSurface
|
|
54
|
-
})
|
|
55
|
-
]);
|
|
37
|
+
var PreviewPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
|
|
38
|
+
schema: [
|
|
39
|
+
Person.Person,
|
|
40
|
+
Organization.Organization
|
|
41
|
+
],
|
|
42
|
+
id: "schema"
|
|
43
|
+
}), AppPlugin.addSurfaceModule({
|
|
44
|
+
activate: ReactSurface
|
|
45
|
+
}), AppPlugin.addTranslationsModule({
|
|
46
|
+
translations
|
|
47
|
+
}), Plugin.addModule({
|
|
48
|
+
id: "preview-popover",
|
|
49
|
+
activatesOn: ActivationEvents.Startup,
|
|
50
|
+
activate: PreviewPopover
|
|
51
|
+
}), Plugin.make);
|
|
56
52
|
export {
|
|
57
|
-
PREVIEW_PLUGIN,
|
|
58
53
|
PreviewPlugin,
|
|
59
54
|
meta
|
|
60
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/PreviewPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../../src/PreviewPlugin.tsx", "../../../src/capabilities/preview-popover/index.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { ActivationEvents, Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Organization, Person } from '@dxos/types';\n\nimport { PreviewPopover, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const PreviewPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Person.Person, Organization.Organization], id: 'schema' }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'preview-popover',\n activatesOn: ActivationEvents.Startup,\n activate: PreviewPopover,\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const PreviewPopover = Capability.lazy('PreviewPopover', () => import('./preview-popover'));\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 Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'unable to create preview message': 'No preview',\n 'todo label': 'To do',\n 'in-progress label': 'In progress',\n 'done label': 'Done',\n 'open object label': 'Open',\n 'add object to space label': 'Add to space',\n 'more options label': 'More options',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,SAASA,kBAAkBC,cAAc;AACzC,SAASC,iBAAiB;AAC1B,SAASC,cAAcC,cAAc;;;ACFrC,SAASC,kBAAkB;AAEpB,IAAMC,iBAAiBC,WAAWC,KAAK,kBAAkB,MAAM,OAAO,gCAAA,CAAA;;;ACF7E,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,eAAeC,YAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACElE,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,oCAAoC;QACpC,cAAc;QACd,qBAAqB;QACrB,cAAc;QACd,qBAAqB;QACrB,6BAA6B;QAC7B,sBAAsB;MACxB;IACF;EACF;;;;AHTK,IAAMC,gBAAgBC,OAAOC,OAAOC,IAAAA,EAAMC,KAC/CC,UAAUC,gBAAgB;EAAEC,QAAQ;IAACC,OAAOA;IAAQC,aAAaA;;EAAeC,IAAI;AAAS,CAAA,GAC7FL,UAAUM,iBAAiB;EAAEC,UAAUC;AAAa,CAAA,GACpDR,UAAUS,sBAAsB;EAAEC;AAAa,CAAA,GAC/Cd,OAAOe,UAAU;EACfN,IAAI;EACJO,aAAaC,iBAAiBC;EAC9BP,UAAUQ;AACZ,CAAA,GACAnB,OAAOoB,IAAI;",
|
|
6
|
+
"names": ["ActivationEvents", "Plugin", "AppPlugin", "Organization", "Person", "Capability", "PreviewPopover", "Capability", "lazy", "Capability", "ReactSurface", "Capability", "lazy", "translations", "meta", "id", "PreviewPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addSchemaModule", "schema", "Person", "Organization", "id", "addSurfaceModule", "activate", "ReactSurface", "addTranslationsModule", "translations", "addModule", "activatesOn", "ActivationEvents", "Startup", "PreviewPopover", "make"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/meta.ts":{"bytes":1243,"imports":[],"format":"esm"},"src/capabilities/preview-popover.ts":{"bytes":8497,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"format":"esm"},"src/components/ContactCard.tsx":{"bytes":9246,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/OrganizationCard.tsx":{"bytes":4740,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"format":"esm"},"src/components/ProjectCard.tsx":{"bytes":2578,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":687,"imports":[{"path":"src/components/ContactCard.tsx","kind":"import-statement","original":"./ContactCard"},{"path":"src/components/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"src/components/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":24033,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1037,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":1178,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":4743,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","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"}],"format":"esm"},"src/index.ts":{"bytes":595,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3231},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2ORSL4GJ.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","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/preview-popover-OSHWR2YE.mjs","kind":"dynamic-import"},{"path":"dist/lib/node-esm/react-surface-IPZBISWS.mjs","kind":"dynamic-import"}],"exports":["PREVIEW_PLUGIN","PreviewPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/PreviewPlugin.tsx":{"bytesInOutput":952},"src/capabilities/index.ts":{"bytesInOutput":190},"src/translations.ts":{"bytesInOutput":137}},"bytes":1631},"dist/lib/node-esm/preview-popover-OSHWR2YE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4454},"dist/lib/node-esm/preview-popover-OSHWR2YE.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/preview-popover.ts","inputs":{"src/capabilities/preview-popover.ts":{"bytesInOutput":2066}},"bytes":2301},"dist/lib/node-esm/react-surface-IPZBISWS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19895},"dist/lib/node-esm/react-surface-IPZBISWS.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2ORSL4GJ.mjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-deck/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table/types","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":5926},"src/components/ContactCard.tsx":{"bytesInOutput":2884},"src/components/index.ts":{"bytesInOutput":0},"src/components/OrganizationCard.tsx":{"bytesInOutput":1438},"src/components/ProjectCard.tsx":{"bytesInOutput":709}},"bytes":11393},"dist/lib/node-esm/chunk-2ORSL4GJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":615},"dist/lib/node-esm/chunk-2ORSL4GJ.mjs":{"imports":[],"exports":["PREVIEW_PLUGIN","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":216}},"bytes":406}}}
|
|
1
|
+
{"inputs":{"src/meta.ts":{"bytes":1673,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover/preview-popover.ts":{"bytes":10686,"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/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/preview-popover/index.ts":{"bytes":935,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/preview-popover/preview-popover.ts","kind":"dynamic-import","original":"./preview-popover"}],"format":"esm"},"src/cards/FormCard.tsx":{"bytes":7809,"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/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/cards/OrganizationCard.tsx":{"bytes":3051,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true}],"format":"esm"},"src/cards/PersonCard.tsx":{"bytes":4490,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true}],"format":"esm"},"src/cards/ProjectCard.tsx":{"bytes":2488,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true}],"format":"esm"},"src/cards/TaskCard.tsx":{"bytes":5354,"imports":[{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"format":"esm"},"src/cards/index.ts":{"bytes":853,"imports":[{"path":"src/cards/FormCard.tsx","kind":"import-statement","original":"./FormCard"},{"path":"src/cards/OrganizationCard.tsx","kind":"import-statement","original":"./OrganizationCard"},{"path":"src/cards/PersonCard.tsx","kind":"import-statement","original":"./PersonCard"},{"path":"src/cards/ProjectCard.tsx","kind":"import-statement","original":"./ProjectCard"},{"path":"src/cards/TaskCard.tsx","kind":"import-statement","original":"./TaskCard"}],"format":"esm"},"src/capabilities/react-surface/react-surface.tsx":{"bytes":12495,"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/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"src/cards/index.ts","kind":"import-statement","original":"../../cards"},{"path":"src/meta.ts","kind":"import-statement","original":"../../meta"}],"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":595,"imports":[{"path":"src/capabilities/preview-popover/index.ts","kind":"import-statement","original":"./preview-popover"},{"path":"src/capabilities/react-surface/index.ts","kind":"import-statement","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":1903,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"src/PreviewPlugin.tsx":{"bytes":3183,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","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"}],"format":"esm"},"src/index.ts":{"bytes":555,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/PreviewPlugin.tsx","kind":"import-statement","original":"./PreviewPlugin"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3181},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2G4FUGDA.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/preview-popover-7QRYVL73.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/react-surface-IO5DHYZB.mjs","kind":"dynamic-import"}],"exports":["PreviewPlugin","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0},"src/PreviewPlugin.tsx":{"bytesInOutput":562},"src/capabilities/preview-popover/index.ts":{"bytesInOutput":154},"src/capabilities/index.ts":{"bytesInOutput":0},"src/capabilities/react-surface/index.ts":{"bytesInOutput":164},"src/translations.ts":{"bytesInOutput":378}},"bytes":1634},"dist/lib/node-esm/preview-popover-7QRYVL73.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5535},"dist/lib/node-esm/preview-popover-7QRYVL73.mjs":{"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/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/preview-popover/preview-popover.ts","inputs":{"src/capabilities/preview-popover/preview-popover.ts":{"bytesInOutput":2573}},"bytes":2824},"dist/lib/node-esm/react-surface-IO5DHYZB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18316},"dist/lib/node-esm/react-surface-IO5DHYZB.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-2G4FUGDA.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/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","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/effect","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"effect/SchemaAST","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo/internal","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface/react-surface.tsx","inputs":{"src/capabilities/react-surface/react-surface.tsx":{"bytesInOutput":3066},"src/cards/FormCard.tsx":{"bytesInOutput":1861},"src/cards/index.ts":{"bytesInOutput":0},"src/cards/OrganizationCard.tsx":{"bytesInOutput":714},"src/cards/PersonCard.tsx":{"bytesInOutput":1061},"src/cards/ProjectCard.tsx":{"bytesInOutput":537},"src/cards/TaskCard.tsx":{"bytesInOutput":1182}},"bytes":8913},"dist/lib/node-esm/chunk-2G4FUGDA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":802},"dist/lib/node-esm/chunk-2G4FUGDA.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":389}},"bytes":561}}}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/capabilities/preview-popover/preview-popover.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
6
|
+
import { AppCapabilities, LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
+
import { addEventListener } from "@dxos/async";
|
|
8
|
+
import { parseId } from "@dxos/client/echo";
|
|
9
|
+
import { Obj } from "@dxos/echo";
|
|
10
|
+
import { DXN } from "@dxos/keys";
|
|
11
|
+
import { log } from "@dxos/log";
|
|
12
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
13
|
+
import { DX_ANCHOR_ACTIVATE } from "@dxos/react-ui";
|
|
14
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-preview/src/capabilities/preview-popover/preview-popover.ts";
|
|
15
|
+
var customEventOptions = {
|
|
16
|
+
capture: true,
|
|
17
|
+
passive: false
|
|
18
|
+
};
|
|
19
|
+
var handlePreviewLookup = async (client, defaultSpace, { dxn, label }) => {
|
|
20
|
+
try {
|
|
21
|
+
const object = await defaultSpace.db.makeRef(DXN.parse(dxn)).load();
|
|
22
|
+
return {
|
|
23
|
+
label,
|
|
24
|
+
object
|
|
25
|
+
};
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var preview_popover_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
31
|
+
const capabilities = yield* Capability.Service;
|
|
32
|
+
const handleAnchorActivate = async ({ dxn, label, trigger, kind = "card", title: titleProp, side, props }) => {
|
|
33
|
+
const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);
|
|
34
|
+
const client = capabilities.get(ClientCapabilities.Client);
|
|
35
|
+
const registry = capabilities.get(Capabilities.AtomRegistry);
|
|
36
|
+
const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);
|
|
37
|
+
const layout = registry.get(layoutAtom);
|
|
38
|
+
const { spaceId } = parseId(layout.workspace);
|
|
39
|
+
const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;
|
|
40
|
+
const result = await handlePreviewLookup(client, space, {
|
|
41
|
+
dxn,
|
|
42
|
+
label
|
|
43
|
+
});
|
|
44
|
+
if (!result) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const title = titleProp ?? Obj.getLabel(result.object);
|
|
48
|
+
await invokePromise(LayoutOperation.UpdatePopover, {
|
|
49
|
+
subjectRef: dxn,
|
|
50
|
+
subject: result.object,
|
|
51
|
+
state: true,
|
|
52
|
+
variant: "virtual",
|
|
53
|
+
anchor: trigger,
|
|
54
|
+
...kind && {
|
|
55
|
+
kind
|
|
56
|
+
},
|
|
57
|
+
...title && {
|
|
58
|
+
title
|
|
59
|
+
},
|
|
60
|
+
...side && {
|
|
61
|
+
side
|
|
62
|
+
},
|
|
63
|
+
...props && {
|
|
64
|
+
props
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
let cleanup;
|
|
69
|
+
if (document.defaultView) {
|
|
70
|
+
cleanup = addEventListener(document.defaultView, DX_ANCHOR_ACTIVATE, handleAnchorActivate, customEventOptions);
|
|
71
|
+
} else {
|
|
72
|
+
log.warn("no default view found", void 0, {
|
|
73
|
+
F: __dxlog_file,
|
|
74
|
+
L: 85,
|
|
75
|
+
S: this,
|
|
76
|
+
C: (f, a) => f(...a)
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));
|
|
80
|
+
}));
|
|
81
|
+
export {
|
|
82
|
+
preview_popover_default as default
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=preview-popover-7QRYVL73.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/preview-popover/preview-popover.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';\nimport { addEventListener } from '@dxos/async';\nimport { type Client } from '@dxos/client';\nimport { type Space, parseId } from '@dxos/client/echo';\nimport { Obj } from '@dxos/echo';\nimport { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { DX_ANCHOR_ACTIVATE, type DxAnchorActivate } from '@dxos/react-ui';\nimport { type PreviewLinkRef, type PreviewLinkTarget } from '@dxos/ui-editor';\n\nconst customEventOptions = { capture: true, passive: false };\n\nconst handlePreviewLookup = async (\n client: Client,\n defaultSpace: Space,\n { dxn, label }: PreviewLinkRef,\n): Promise<PreviewLinkTarget | null> => {\n try {\n const object = await defaultSpace.db.makeRef(DXN.parse(dxn)).load();\n return { label, object };\n } catch {\n return null;\n }\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n\n // TODO(wittjosiah): Factor out lookup handlers to other plugins to make not ECHO-specific.\n const handleAnchorActivate = async ({\n dxn,\n label,\n trigger,\n kind = 'card',\n title: titleProp,\n side,\n props,\n }: DxAnchorActivate) => {\n const { invokePromise } = capabilities.get(Capabilities.OperationInvoker);\n const client = capabilities.get(ClientCapabilities.Client);\n const registry = capabilities.get(Capabilities.AtomRegistry);\n const [layoutAtom] = capabilities.getAll(AppCapabilities.Layout);\n const layout = registry.get(layoutAtom);\n const { spaceId } = parseId(layout.workspace);\n const space = (spaceId && client.spaces.get(spaceId)) ?? client.spaces.default;\n const result = await handlePreviewLookup(client, space, { dxn, label });\n if (!result) {\n return;\n }\n\n const title = titleProp ?? Obj.getLabel(result.object);\n\n await invokePromise(LayoutOperation.UpdatePopover, {\n subjectRef: dxn,\n subject: result.object,\n state: true,\n variant: 'virtual',\n anchor: trigger,\n ...(kind && { kind }),\n ...(title && { title }),\n ...(side && { side }),\n ...(props && { props }),\n });\n };\n\n let cleanup: () => void;\n if (document.defaultView) {\n cleanup = addEventListener(\n document.defaultView,\n DX_ANCHOR_ACTIVATE as any,\n handleAnchorActivate,\n customEventOptions,\n );\n } else {\n log.warn('no default view found');\n }\n\n return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => cleanup?.()));\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,uBAAuB;AACjD,SAASC,wBAAwB;AAEjC,SAAqBC,eAAe;AACpC,SAASC,WAAW;AACpB,SAASC,WAAW;AACpB,SAASC,WAAW;AACpB,SAASC,0BAA0B;AACnC,SAASC,0BAAiD;;AAG1D,IAAMC,qBAAqB;EAAEC,SAAS;EAAMC,SAAS;AAAM;AAE3D,IAAMC,sBAAsB,OAC1BC,QACAC,cACA,EAAEC,KAAKC,MAAK,MAAkB;AAE9B,MAAI;AACF,UAAMC,SAAS,MAAMH,aAAaI,GAAGC,QAAQd,IAAIe,MAAML,GAAAA,CAAAA,EAAMM,KAAI;AACjE,WAAO;MAAEL;MAAOC;IAAO;EACzB,QAAQ;AACN,WAAO;EACT;AACF;AAEA,IAAA,0BAAelB,WAAWuB,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOzB,WAAW0B;AAGvC,QAAMC,uBAAuB,OAAO,EAClCX,KACAC,OACAW,SACAC,OAAO,QACPC,OAAOC,WACPC,MACAC,MAAK,MACY;AACjB,UAAM,EAAEC,cAAa,IAAKT,aAAaU,IAAIpC,aAAaqC,gBAAgB;AACxE,UAAMtB,SAASW,aAAaU,IAAI3B,mBAAmB6B,MAAM;AACzD,UAAMC,WAAWb,aAAaU,IAAIpC,aAAawC,YAAY;AAC3D,UAAM,CAACC,UAAAA,IAAcf,aAAagB,OAAOxC,gBAAgByC,MAAM;AAC/D,UAAMC,SAASL,SAASH,IAAIK,UAAAA;AAC5B,UAAM,EAAEI,QAAO,IAAKxC,QAAQuC,OAAOE,SAAS;AAC5C,UAAMC,SAASF,WAAW9B,OAAOiC,OAAOZ,IAAIS,OAAAA,MAAa9B,OAAOiC,OAAOC;AACvE,UAAMC,SAAS,MAAMpC,oBAAoBC,QAAQgC,OAAO;MAAE9B;MAAKC;IAAM,CAAA;AACrE,QAAI,CAACgC,QAAQ;AACX;IACF;AAEA,UAAMnB,QAAQC,aAAa1B,IAAI6C,SAASD,OAAO/B,MAAM;AAErD,UAAMgB,cAAchC,gBAAgBiD,eAAe;MACjDC,YAAYpC;MACZqC,SAASJ,OAAO/B;MAChBoC,OAAO;MACPC,SAAS;MACTC,QAAQ5B;MACR,GAAIC,QAAQ;QAAEA;MAAK;MACnB,GAAIC,SAAS;QAAEA;MAAM;MACrB,GAAIE,QAAQ;QAAEA;MAAK;MACnB,GAAIC,SAAS;QAAEA;MAAM;IACvB,CAAA;EACF;AAEA,MAAIwB;AACJ,MAAIC,SAASC,aAAa;AACxBF,cAAUtD,iBACRuD,SAASC,aACTlD,oBACAkB,sBACAjB,kBAAAA;EAEJ,OAAO;AACLH,QAAIqD,KAAK,yBAAA,QAAA;;;;;;EACX;AAEA,SAAO5D,WAAW6D,YAAY9D,aAAa+D,MAAM,MAAM,MAAaC,YAAK,MAAMN,UAAAA,CAAAA,CAAAA;AACjF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "AppCapabilities", "LayoutOperation", "addEventListener", "parseId", "Obj", "DXN", "log", "ClientCapabilities", "DX_ANCHOR_ACTIVATE", "customEventOptions", "capture", "passive", "handlePreviewLookup", "client", "defaultSpace", "dxn", "label", "object", "db", "makeRef", "parse", "load", "makeModule", "fnUntraced", "capabilities", "Service", "handleAnchorActivate", "trigger", "kind", "title", "titleProp", "side", "props", "invokePromise", "get", "OperationInvoker", "Client", "registry", "AtomRegistry", "layoutAtom", "getAll", "Layout", "layout", "spaceId", "workspace", "space", "spaces", "default", "result", "getLabel", "UpdatePopover", "subjectRef", "subject", "state", "variant", "anchor", "cleanup", "document", "defaultView", "warn", "contributes", "Null", "sync"]
|
|
7
|
+
}
|