@popmelt.com/core 0.22.1 → 0.24.0

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.
Files changed (38) hide show
  1. package/README.md +30 -0
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/claude-plugin/skills/popmelt-core/SKILL.md +1 -0
  4. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  5. package/codex-plugin/skills/popmelt-core/SKILL.md +1 -0
  6. package/dist/ParticipantRuntime-PTBGXKSH.mjs +139 -0
  7. package/dist/PreviewRuntime-2SCFCGWC.mjs +2 -0
  8. package/dist/adapter-react-three-fiber.mjs +1 -1
  9. package/dist/bridge-entry.mjs +86 -89
  10. package/dist/browser-runtime-3Z4U66AP.mjs +2 -0
  11. package/dist/browser.d.mts +2 -1
  12. package/dist/browser.mjs +1 -1
  13. package/dist/chunk-6URDGUIL.mjs +2 -0
  14. package/dist/chunk-BYLH3WFB.mjs +2 -0
  15. package/dist/chunk-C4ONFAGF.mjs +399 -0
  16. package/dist/{chunk-7Z5QN5LB.mjs → chunk-DHAOAIKK.mjs} +1 -1
  17. package/dist/{chunk-RILGQYOR.mjs → chunk-EUDGPGCQ.mjs} +1 -1
  18. package/dist/chunk-EX63NVDN.mjs +2 -0
  19. package/dist/chunk-J3UIBBU2.mjs +1 -1
  20. package/dist/chunk-M3HCNQ4T.mjs +250 -0
  21. package/dist/chunk-N2ZEZCHO.mjs +1 -1
  22. package/dist/cli.mjs +112 -113
  23. package/dist/index.d.mts +3 -3
  24. package/dist/index.mjs +1 -1
  25. package/dist/media.mjs +1 -1
  26. package/dist/{options-5yRxW1AX.d.mts → participantBootstrap-Dqu2h47B.d.mts} +22 -1
  27. package/dist/plugin-astro.d.mts +2 -0
  28. package/dist/plugin-astro.mjs +3 -3
  29. package/dist/plugin-nuxt.d.mts +3 -1
  30. package/dist/plugin-nuxt.mjs +2 -1
  31. package/dist/plugin-vite.mjs +1 -1
  32. package/dist/server-T4EMCHVP.mjs +228 -0
  33. package/dist/server.d.mts +122 -1
  34. package/dist/server.mjs +96 -90
  35. package/package.json +1 -1
  36. package/dist/browser-runtime-Y7W67TJE.mjs +0 -2
  37. package/dist/chunk-QO2FFOQ4.mjs +0 -448
  38. package/dist/server-EEFXBJOO.mjs +0 -222
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
- import { P as PopmeltOptions, C as CommentMeta } from './options-5yRxW1AX.mjs';
4
- export { a as CommentMetaContext, b as CommentMetaValue, G as GetCommentMeta, c as PopmeltExtension, d as PopmeltExtensionRuntime } from './options-5yRxW1AX.mjs';
3
+ import { P as PopmeltOptions, C as CommentMeta } from './participantBootstrap-Dqu2h47B.mjs';
4
+ export { a as CommentMetaContext, b as CommentMetaValue, G as GetCommentMeta, c as PopmeltExtension, d as PopmeltExtensionRuntime, i as isPopmeltPreview } from './participantBootstrap-Dqu2h47B.mjs';
5
5
  import { I as ImageSubjectAdapterOptions, V as VideoSubjectAdapterOptions } from './video-adapter-CCLbp86L.mjs';
6
6
  import { P as PopmeltSubjectAdapter, A as Annotation, E as ElementInfo, a as AnnotationAttachment, S as SubjectFeedbackAttachment, b as StyleModification, T as TextModification, D as DomModification, c as SpacingTokenChange } from './subjects-DzjWdlAk.mjs';
7
7
  export { d as AnnotationType, B as BridgeStatus, C as ClaudeResponse, I as ImageObjectContext, O as OpaqueTargetReference, e as Point, f as PopmeltSubject, g as PopmeltSubjectBounds, h as PopmeltSubjectCreationSession, i as PopmeltSubjectOutlinePoint, j as PopmeltSubjectTrackingAnchor, k as PopmeltSurfaceSnapshot, R as ReactSourceLocation, l as StyleChange, m as ToolType, V as VideoObjectContext } from './subjects-DzjWdlAk.mjs';
@@ -27,7 +27,7 @@ declare global {
27
27
  }
28
28
 
29
29
  type PopmeltProviderProps = PropsWithChildren<PopmeltOptions>;
30
- declare function PopmeltProvider({ children, enabled, ...props }: PopmeltProviderProps): react.JSX.Element;
30
+ declare function PopmeltProvider({ children, enabled, multiplayer, ...props }: PopmeltProviderProps): react.JSX.Element;
31
31
 
32
32
  type ImageAnnotationOptions = Omit<ImageSubjectAdapterOptions, 'id'>;
33
33
 
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{b as t}from"./chunk-QO2FFOQ4.mjs";import"./chunk-N2ZEZCHO.mjs";import{b as e}from"./chunk-J3UIBBU2.mjs";export{t as PopmeltProvider,e as usePopmelt};
2
+ export{b as PopmeltProvider}from"./chunk-M3HCNQ4T.mjs";export{a as isPopmeltPreview}from"./chunk-EX63NVDN.mjs";import"./chunk-N2ZEZCHO.mjs";export{b as usePopmelt}from"./chunk-J3UIBBU2.mjs";import"./chunk-C4ONFAGF.mjs";import"./chunk-6URDGUIL.mjs";
package/dist/media.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as e,b as o,c as t,d as r,e as i,f as a,g as d,h as c,i as n,j as s,k as p,l as m,m as S,n as V}from"./chunk-N2ZEZCHO.mjs";export{a as ImageSubjectAdapter,p as VideoSubjectAdapter,r as createBrowserImageSubjectStore,S as createBrowserVideoSubjectStore,d as createImageSubjectAdapter,i as createMemoryImageSubjectStore,V as createMemoryVideoSubjectStore,m as createVideoSubjectAdapter,t as projectImageObjectBox,n as projectVideoObjectBox,o as unprojectImageObjectBounds,e as unprojectImagePoint,s as unprojectVideoObjectBounds,c as unprojectVideoPoint};
2
+ export{f as ImageSubjectAdapter,k as VideoSubjectAdapter,d as createBrowserImageSubjectStore,m as createBrowserVideoSubjectStore,g as createImageSubjectAdapter,e as createMemoryImageSubjectStore,n as createMemoryVideoSubjectStore,l as createVideoSubjectAdapter,c as projectImageObjectBox,i as projectVideoObjectBox,b as unprojectImageObjectBounds,a as unprojectImagePoint,j as unprojectVideoObjectBounds,h as unprojectVideoPoint}from"./chunk-N2ZEZCHO.mjs";
@@ -49,6 +49,8 @@ type PopmeltExtension = {
49
49
  /** Host integration options, independent of the UI renderer. */
50
50
  type PopmeltOptions = {
51
51
  enabled?: boolean;
52
+ /** Experimental peer canvases, invitations and multiplayer UI. Default: false. */
53
+ multiplayer?: boolean;
52
54
  bridgeUrl?: string;
53
55
  /** Stable project id generated by the framework plugin/bridge startup. */
54
56
  projectId?: string | null;
@@ -63,4 +65,23 @@ type PopmeltOptions = {
63
65
  getCommentMeta?: GetCommentMeta;
64
66
  };
65
67
 
66
- export type { CommentMeta as C, GetCommentMeta as G, PopmeltOptions as P, CommentMetaContext as a, CommentMetaValue as b, PopmeltExtension as c, PopmeltExtensionRuntime as d };
68
+ /** Public, credential-free description stamped by the application's dev server.
69
+ * The revision is context metadata (or `unversioned`), never sync/Send authority.
70
+ */
71
+ type ParticipantBootstrapConfig = {
72
+ version?: 1;
73
+ url: string;
74
+ projectId: string;
75
+ revision: string;
76
+ };
77
+ declare global {
78
+ interface Window {
79
+ __POPMELT_PARTICIPANTS__?: ParticipantBootstrapConfig;
80
+ }
81
+ }
82
+ /** Available before mounting Popmelt so trusted apps can suppress startup effects.
83
+ * This is a rendering hint, never a credential or an authorization decision.
84
+ */
85
+ declare function isPopmeltPreview(url?: string): boolean;
86
+
87
+ export { type CommentMeta as C, type GetCommentMeta as G, type PopmeltOptions as P, type CommentMetaContext as a, type CommentMetaValue as b, type PopmeltExtension as c, type PopmeltExtensionRuntime as d, isPopmeltPreview as i };
@@ -5,6 +5,8 @@ import 'node:http';
5
5
  type PopmeltAstroOptions = PopmeltPluginOptions & {
6
6
  /** Set false when an existing provider mounts the UI. */
7
7
  client?: boolean;
8
+ /** Experimental multiplayer UI. Default: false. */
9
+ multiplayer?: boolean;
8
10
  };
9
11
  type AstroSetup = {
10
12
  command: 'dev' | 'build' | 'preview' | 'sync';
@@ -1,8 +1,8 @@
1
- import{a as o}from"./chunk-7Z5QN5LB.mjs";import"./chunk-RILGQYOR.mjs";import"./chunk-NOHXTT24.mjs";import{fileURLToPath as a}from"url";function c(t={}){return{name:"popmelt",hooks:{"astro:config:setup"({command:r,config:i,updateConfig:n,injectScript:p}){if(r!=="dev")return;let{client:e=!0,...s}=t;n({vite:{plugins:[o({...s,projectRoot:t.projectRoot??a(i.root)})],optimizeDeps:{include:e?["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client","lucide-react"]:[]}}}),p("page",e?d:`
1
+ import{a as o}from"./chunk-DHAOAIKK.mjs";import"./chunk-EUDGPGCQ.mjs";import"./chunk-NOHXTT24.mjs";import{fileURLToPath as d}from"url";function c(t={}){return{name:"popmelt",hooks:{"astro:config:setup"({command:r,config:i,updateConfig:n,injectScript:p}){if(r!=="dev")return;let{client:e=!0,multiplayer:a=!1,...s}=t;n({vite:{plugins:[o({...s,projectRoot:t.projectRoot??d(i.root)})],optimizeDeps:{include:e?["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client","lucide-react"]:[]}}}),p("page",e?l(a):`
2
2
  import { bridgeUrl, projectId } from 'virtual:popmelt/bridge';
3
3
  if (bridgeUrl) window.__POPMELT_BRIDGE_URL__ = bridgeUrl;
4
4
  if (projectId) window.__POPMELT_PROJECT_ID__ = projectId;
5
- `)}}}}var d=`
5
+ `)}}}}var l=t=>`
6
6
  import { bridgeUrl, projectId } from 'virtual:popmelt/bridge';
7
7
  import { navigate } from 'astro:transitions/client';
8
8
  let disposed = false;
@@ -13,7 +13,7 @@ const start = () => {
13
13
  if (disposed) return;
14
14
  const { mountPopmelt } = await import('@popmelt.com/core/browser');
15
15
  if (disposed) return;
16
- const handle = await mountPopmelt({ enabled: true, bridgeUrl, projectId, navigate });
16
+ const handle = await mountPopmelt({ enabled: true, multiplayer: ${t===!0}, bridgeUrl, projectId, navigate });
17
17
  return handle;
18
18
  }).catch(error => { console.warn('[popmelt] startup failed:', error); });
19
19
  };
@@ -2,7 +2,9 @@ import { NuxtModule } from 'nuxt/schema';
2
2
  import { P as PopmeltPluginOptions } from './dev-server-rQIWJcSX.mjs';
3
3
  import 'node:http';
4
4
 
5
- type PopmeltNuxtOptions = Pick<PopmeltPluginOptions, 'port' | 'projectRoot' | 'bridge'>;
5
+ type PopmeltNuxtOptions = Pick<PopmeltPluginOptions, 'port' | 'projectRoot' | 'bridge'> & {
6
+ /** Experimental multiplayer UI. Default: false. */ multiplayer?: boolean;
7
+ };
6
8
  declare const popmeltNuxt: NuxtModule<PopmeltNuxtOptions>;
7
9
 
8
10
  export { type PopmeltNuxtOptions, popmeltNuxt as default };
@@ -1,4 +1,4 @@
1
- import{a as s,b as d}from"./chunk-RILGQYOR.mjs";import{b as i}from"./chunk-NOHXTT24.mjs";import{addPluginTemplate as l,defineNuxtModule as m}from"nuxt/kit";var a=m({meta:{name:"@popmelt.com/core/nuxt",configKey:"popmelt"},async setup(n,e){if(!e.options.dev)return;let p={config:{server:e.options.devServer},middlewares:{use(){}}},t=await s({...n,projectRoot:n.projectRoot??e.options.rootDir},p,3e3);if(t.port===null)return;e.hook("vite:extend",({config:r})=>{r.optimizeDeps??={},r.optimizeDeps.include=[...new Set([...r.optimizeDeps.include??[],"react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client","lucide-react"])]});let o=await d(t,p),u=o?i(o):void 0;e.hook("close",async()=>{u?.(),await o?.release()}),l({filename:"popmelt.client.mjs",mode:"client",getContents:()=>`import { defineNuxtPlugin } from '#app';
1
+ import{a as s,b as l}from"./chunk-EUDGPGCQ.mjs";import{b as i}from"./chunk-NOHXTT24.mjs";import{addPluginTemplate as d,defineNuxtModule as m}from"nuxt/kit";var a=m({meta:{name:"@popmelt.com/core/nuxt",configKey:"popmelt"},async setup(o,e){if(!e.options.dev)return;let n={config:{server:e.options.devServer},middlewares:{use(){}}},t=await s({...o,projectRoot:o.projectRoot??e.options.rootDir},n,3e3);if(t.port===null)return;e.hook("vite:extend",({config:p})=>{p.optimizeDeps??={},p.optimizeDeps.include=[...new Set([...p.optimizeDeps.include??[],"react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client","lucide-react"])]});let r=await l(t,n),u=r?i(r):void 0;e.hook("close",async()=>{u?.(),await r?.release()}),d({filename:"popmelt.client.mjs",mode:"client",getContents:()=>`import { defineNuxtPlugin } from '#app';
2
2
  export default defineNuxtPlugin((nuxtApp) => {
3
3
  let disposed = false;
4
4
  let mounting;
@@ -15,6 +15,7 @@ export default defineNuxtPlugin((nuxtApp) => {
15
15
  if (disposed) return;
16
16
  return mountPopmelt({
17
17
  enabled: true,
18
+ multiplayer: ${o.multiplayer===!0},
18
19
  bridgeUrl,
19
20
  projectId,
20
21
  navigate: (url) => nuxtApp.$router.push(url),
@@ -1 +1 @@
1
- import{a}from"./chunk-7Z5QN5LB.mjs";import"./chunk-RILGQYOR.mjs";import"./chunk-NOHXTT24.mjs";export{a as popmelt};
1
+ import{a}from"./chunk-DHAOAIKK.mjs";import"./chunk-EUDGPGCQ.mjs";import"./chunk-NOHXTT24.mjs";export{a as popmelt};