@spotpatch/runtime 1.12.0 → 1.13.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.
- package/dist/{chunk-BXRMVHNT.js → chunk-ASRUAKA5.js} +1 -1
- package/dist/chunk-ASRUAKA5.js.map +1 -0
- package/dist/{chunk-7ES63LA7.js → chunk-P6X75LO5.js} +11 -1
- package/dist/chunk-P6X75LO5.js.map +1 -0
- package/dist/chunk-P7W3F4UA.js +115 -0
- package/dist/chunk-P7W3F4UA.js.map +1 -0
- package/dist/data-flow-panel.cjs +9 -0
- package/dist/data-flow-panel.cjs.map +1 -1
- package/dist/data-flow-panel.js +1 -1
- package/dist/external-handoff-panel.cjs +29 -9
- package/dist/external-handoff-panel.cjs.map +1 -1
- package/dist/external-handoff-panel.d.cts +3 -3
- package/dist/external-handoff-panel.d.ts +3 -3
- package/dist/external-handoff-panel.js +22 -11
- package/dist/external-handoff-panel.js.map +1 -1
- package/dist/index.cjs +1192 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1160 -351
- package/dist/index.js.map +1 -1
- package/dist/motion.cjs +1251 -0
- package/dist/motion.cjs.map +1 -0
- package/dist/motion.d.cts +79 -0
- package/dist/motion.d.ts +79 -0
- package/dist/motion.js +1092 -0
- package/dist/motion.js.map +1 -0
- package/package.json +17 -2
- package/dist/chunk-7ES63LA7.js.map +0 -1
- package/dist/chunk-BXRMVHNT.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/motion-controller.ts","../src/ui/execution-island.ts","../src/motion-entry.ts"],"sourcesContent":["import { gsap } from \"gsap\";\n\nimport type {\n FloatingSurfaceMotionController,\n FloatingSurfaceMotionElements,\n FloatingSurfaceProjection,\n} from \"./motion-extension-contract.js\";\n\nconst MOTION = Object.freeze({\n contentMilliseconds: 220,\n detailRevealDelaySeconds: 0.1,\n detailRevealSeconds: 0.3,\n detailRetireSeconds: 0.15,\n dispatchSeconds: 0.54,\n expandSeconds: 0.54,\n morphSeconds: 0.48,\n pressSeconds: 0.12,\n revealSeconds: 0.26,\n sceneRevealDelaySeconds: 0.06,\n sweepSeconds: 0.68,\n targetFeedbackDelaySeconds: 0.08,\n targetFeedbackSeconds: 0.22,\n});\n\nconst ISLAND_SIZE = Object.freeze({\n checkingWidth: 440,\n compactHeight: 62,\n dispatchingWidth: 448,\n expandedHeight: 164,\n expandedWidth: 520,\n failedWidth: 440,\n receivingWidth: 430,\n runningWidth: 468,\n successWidth: 356,\n});\n\ninterface PendingProjection {\n readonly projection: FloatingSurfaceProjection;\n readonly renderContent: () => void;\n}\n\ninterface SurfaceGeometry {\n readonly borderRadius: string;\n readonly rect: DOMRect;\n}\n\ninterface ElementOffset {\n readonly x: number;\n readonly y: number;\n}\n\ninterface SurfaceLayout {\n readonly geometry: SurfaceGeometry;\n readonly sharedOffsets: ReadonlyMap<HTMLElement, ElementOffset>;\n}\n\ntype DetailTransition = \"collapse\" | \"expand\" | undefined;\n\ntype SurfaceLayer = \"execution\" | \"pill\" | \"planner\";\n\nfunction surfaceLayer(scene: FloatingSurfaceProjection[\"scene\"]): SurfaceLayer {\n if (scene === \"pill\" || scene === \"capturing\") return \"pill\";\n if (scene === \"planner\") return \"planner\";\n return \"execution\";\n}\n\nfunction setSceneVisibility(\n elements: FloatingSurfaceMotionElements,\n projection: FloatingSurfaceProjection,\n): HTMLElement {\n const pillActive = projection.scene === \"pill\" || projection.scene === \"capturing\";\n const plannerActive = projection.scene === \"planner\";\n const executionActive = !pillActive && !plannerActive;\n\n elements.pill.hidden = !pillActive;\n elements.pill.inert = !pillActive;\n elements.planner.hidden = !plannerActive;\n elements.planner.inert = !plannerActive;\n elements.planner.setAttribute(\"aria-hidden\", String(!plannerActive));\n elements.execution.root.hidden = !executionActive;\n elements.execution.root.inert = !executionActive;\n elements.execution.root.setAttribute(\"aria-hidden\", String(!executionActive));\n\n return pillActive\n ? elements.pill\n : plannerActive\n ? elements.planner\n : elements.execution.root;\n}\n\nfunction supportsMotion(document: Document): boolean {\n return (\n document.defaultView?.matchMedia(\"(prefers-reduced-motion: reduce)\").matches !==\n true\n );\n}\n\nfunction finiteRect(rect: DOMRect): boolean {\n return (\n Number.isFinite(rect.left) &&\n Number.isFinite(rect.top) &&\n rect.width > 0 &&\n rect.height > 0\n );\n}\n\nfunction geometryChanged(previous: DOMRect, next: DOMRect): boolean {\n return (\n Math.abs(previous.left - next.left) > 0.5 ||\n Math.abs(previous.top - next.top) > 0.5 ||\n Math.abs(previous.width - next.width) > 0.5 ||\n Math.abs(previous.height - next.height) > 0.5\n );\n}\n\nfunction visibleBorderRadius(value: string | undefined, rect: DOMRect): string {\n if (value === undefined || value.length === 0) return \"0px\";\n const radius = Number.parseFloat(value);\n if (!Number.isFinite(radius) || !finiteRect(rect)) return value;\n return `${String(Math.min(radius, rect.width / 2, rect.height / 2))}px`;\n}\n\nfunction compactIslandWidth(projection: FloatingSurfaceProjection): number {\n if (projection.scene === \"agent-charging\") return ISLAND_SIZE.receivingWidth;\n if (projection.scene === \"handoff\") return ISLAND_SIZE.dispatchingWidth;\n if (projection.scene === \"success\") return ISLAND_SIZE.successWidth;\n if (projection.scene === \"failed\") return ISLAND_SIZE.failedWidth;\n if (projection.scene === \"running\" && projection.activity?.kind === \"check\") {\n return ISLAND_SIZE.checkingWidth;\n }\n return ISLAND_SIZE.runningWidth;\n}\n\nexport function createFloatingSurfaceMotionStyles(\n document: Document,\n): HTMLStyleElement {\n const style = document.createElement(\"style\");\n style.textContent = `\n .spotpatch-floating-surface {\n --spotpatch-island-surface: #050608;\n --spotpatch-island-primary: #f7f7fb;\n --spotpatch-island-subtle: #5f646e;\n --spotpatch-island-line: rgb(255 255 255 / 10%);\n --spotpatch-island-violet: #8b67ff;\n --spotpatch-island-cyan: #4dc8ff;\n --spotpatch-island-mint: #59dcb6;\n --spotpatch-island-error: #ef6f88;\n --spotpatch-island-compact-height: ${String(ISLAND_SIZE.compactHeight)}px;\n --spotpatch-island-compact-width: ${String(ISLAND_SIZE.runningWidth)}px;\n --spotpatch-island-expanded-height: ${String(ISLAND_SIZE.expandedHeight)}px;\n --spotpatch-island-expanded-width: ${String(ISLAND_SIZE.expandedWidth)}px;\n --spotpatch-island-ease: cubic-bezier(.22, 1, .36, 1);\n position: fixed;\n box-sizing: border-box;\n color-scheme: dark;\n -webkit-font-smoothing: antialiased;\n overflow: hidden;\n border: 1px solid var(--spotpatch-island-line);\n background:\n linear-gradient(180deg, rgb(255 255 255 / 2.8%), transparent 24%),\n rgb(5 6 8 / 98.8%);\n box-shadow:\n 0 24px 60px rgb(13 17 28 / 18%),\n 0 3px 10px rgb(13 17 28 / 10%),\n inset 0 1px rgb(255 255 255 / 6.5%),\n inset 0 0 0 1px rgb(255 255 255 / 1.2%);\n transform-origin: 100% 100%;\n }\n .spotpatch-floating-surface::before {\n position: absolute;\n z-index: 0;\n inset: 0;\n background:\n radial-gradient(180px 70px at 0% 50%, rgb(139 103 255 / 7%), transparent 72%),\n radial-gradient(180px 70px at 100% 50%, rgb(77 200 255 / 4.5%), transparent 72%);\n content: \"\";\n opacity: 0;\n pointer-events: none;\n }\n .spotpatch-floating-surface[data-scene=\"pill\"],\n .spotpatch-floating-surface[data-scene=\"capturing\"] {\n width: max-content;\n border-radius: 999px;\n }\n .spotpatch-floating-surface[data-scene=\"planner\"] { border-radius: 18px; }\n .spotpatch-floating-surface[data-scene=\"agent-charging\"],\n .spotpatch-floating-surface[data-scene=\"handoff\"],\n .spotpatch-floating-surface[data-scene=\"running\"],\n .spotpatch-floating-surface[data-scene=\"success\"],\n .spotpatch-floating-surface[data-scene=\"failed\"] {\n width: min(var(--spotpatch-island-compact-width), calc(100vw - 32px));\n height: var(--spotpatch-island-compact-height);\n max-width: calc(100vw - 32px);\n border-radius: 31px;\n }\n .spotpatch-floating-surface[data-scene=\"agent-charging\"]::before,\n .spotpatch-floating-surface[data-scene=\"handoff\"]::before,\n .spotpatch-floating-surface[data-scene=\"running\"]::before,\n .spotpatch-floating-surface[data-scene=\"success\"]::before,\n .spotpatch-floating-surface[data-scene=\"failed\"]::before { opacity: .82; }\n .spotpatch-floating-surface:has(.spotpatch-execution-island[data-expanded=\"true\"]) {\n width: min(var(--spotpatch-island-expanded-width), calc(100vw - 32px));\n height: min(var(--spotpatch-island-expanded-height), calc(100vh - 32px));\n border-radius: 30px;\n }\n .spotpatch-floating-surface > .spotpatch-trigger,\n .spotpatch-floating-surface > .spotpatch-dialog,\n .spotpatch-floating-surface > .spotpatch-execution-island {\n position: relative;\n z-index: 1;\n }\n .spotpatch-floating-surface > .spotpatch-trigger {\n display: inline-flex;\n min-height: 44px;\n align-items: center;\n gap: 10px;\n border: 0;\n border-radius: 999px;\n padding: 10px 17px;\n color: #f8fafc;\n background: transparent;\n box-shadow: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: 650;\n touch-action: none;\n user-select: none;\n }\n .spotpatch-trigger::before {\n width: 9px;\n height: 9px;\n border-radius: 999px;\n background: var(--spotpatch-accent);\n box-shadow: 0 0 0 4px rgb(99 102 241 / 10%);\n content: \"\";\n }\n .spotpatch-trigger:hover { transform: translateY(-1px); }\n .spotpatch-trigger[aria-pressed=\"true\"] { background: rgb(139 123 255 / 14%); }\n .spotpatch-trigger[aria-pressed=\"true\"]::before {\n animation: spotpatch-motion-pill-pulse 1.8s ease-in-out infinite;\n }\n .spotpatch-trigger[data-dragging=\"true\"] {\n cursor: grabbing;\n transform: scale(.98);\n }\n .spotpatch-floating-surface .spotpatch-dialog { filter: none; }\n .spotpatch-floating-surface .spotpatch-shell {\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n }\n .spotpatch-brand-name {\n color: #fff;\n font-size: 13.5px;\n font-weight: 680;\n letter-spacing: -.01em;\n }\n .spotpatch-brand-context {\n color: #8e98aa;\n font-size: 10.5px;\n font-weight: 560;\n letter-spacing: .02em;\n }\n .spotpatch-title {\n margin: 0;\n color: #fff;\n font-size: 18px;\n font-weight: 680;\n letter-spacing: -.015em;\n }\n .spotpatch-subtitle {\n max-width: 390px;\n margin: 4px 0 0;\n color: var(--spotpatch-text-secondary);\n font-size: 12.5px;\n line-height: 1.5;\n }\n .spotpatch-execution-island {\n position: relative;\n display: grid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 12px;\n overflow: hidden;\n border: 0;\n border-radius: inherit;\n padding: 0 18px;\n color: var(--spotpatch-island-primary);\n background: transparent;\n cursor: pointer;\n text-align: left;\n touch-action: none;\n }\n .spotpatch-execution-island[data-expanded=\"true\"] {\n min-height: var(--spotpatch-island-expanded-height);\n grid-template-columns: auto minmax(0, 1fr) auto;\n grid-template-rows: auto 1fr;\n align-items: start;\n row-gap: 16px;\n border-radius: 30px;\n padding: 18px 20px 16px;\n }\n .spotpatch-execution-mark {\n display: grid;\n width: 23px;\n height: 23px;\n flex: none;\n place-items: center;\n }\n .spotpatch-execution-logo {\n width: 22px;\n height: 22px;\n overflow: visible;\n filter: drop-shadow(0 0 7px rgb(139 103 255 / 16%));\n }\n .spotpatch-execution-content {\n display: flex;\n min-width: 0;\n align-items: baseline;\n gap: 8px;\n }\n [data-expanded=\"true\"] .spotpatch-execution-content {\n display: grid;\n gap: 4px;\n }\n .spotpatch-execution-headline-wrap,\n .spotpatch-execution-action-wrap {\n position: relative;\n display: block;\n min-width: 0;\n }\n .spotpatch-execution-headline,\n .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-action,\n .spotpatch-execution-action-outgoing {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .spotpatch-execution-headline,\n .spotpatch-execution-headline-outgoing {\n color: var(--spotpatch-island-primary);\n font-size: 15px;\n font-weight: 690;\n letter-spacing: -.018em;\n line-height: 1.35;\n }\n .spotpatch-execution-action,\n .spotpatch-execution-action-outgoing {\n color: #696f79;\n font-size: 11px;\n font-weight: 400;\n line-height: 1.35;\n }\n .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-action-outgoing {\n position: absolute;\n inset: 0;\n opacity: 0;\n pointer-events: none;\n }\n .spotpatch-execution-copy-changing .spotpatch-execution-headline,\n .spotpatch-execution-copy-changing .spotpatch-execution-action {\n animation: spotpatch-motion-copy-in ${String(MOTION.contentMilliseconds)}ms var(--spotpatch-island-ease) both;\n }\n .spotpatch-execution-copy-changing .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-copy-changing .spotpatch-execution-action-outgoing {\n animation: spotpatch-motion-copy-out ${String(MOTION.contentMilliseconds)}ms ease-in both;\n }\n .spotpatch-execution-meta {\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n gap: 10px;\n flex: none;\n color: #989da8;\n font-size: 11px;\n font-weight: 620;\n white-space: nowrap;\n }\n .spotpatch-execution-meta-dot {\n width: 6px;\n height: 6px;\n flex: none;\n border-radius: 50%;\n background: var(--spotpatch-island-violet);\n box-shadow: 0 0 8px rgb(139 103 255 / 38%);\n }\n [data-execution-scene=\"agent-charging\"] .spotpatch-execution-meta-dot,\n [data-execution-scene=\"handoff\"] .spotpatch-execution-meta-dot,\n [data-execution-scene=\"running\"] .spotpatch-execution-meta-dot {\n animation: spotpatch-motion-status-breathe 1.8s ease-in-out infinite;\n }\n .spotpatch-execution-meta[data-tone=\"success\"] .spotpatch-execution-meta-dot {\n background: var(--spotpatch-island-mint);\n box-shadow: 0 0 8px rgb(89 220 182 / 24%);\n }\n .spotpatch-execution-meta[data-tone=\"danger\"] .spotpatch-execution-meta-dot {\n background: var(--spotpatch-island-error);\n box-shadow: 0 0 8px rgb(239 111 136 / 22%);\n }\n .spotpatch-execution-timer {\n width: 34px;\n color: #737985;\n font: 400 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;\n text-align: right;\n }\n .spotpatch-execution-more {\n display: grid;\n width: 24px;\n height: 24px;\n padding: 0;\n border: 0;\n background: transparent;\n color: #686e78;\n font-size: 15px;\n line-height: 1;\n place-items: center;\n }\n [data-expanded=\"true\"] .spotpatch-execution-meta-dot,\n [data-expanded=\"true\"] .spotpatch-execution-meta-label,\n [data-expanded=\"true\"] .spotpatch-execution-timer { display: none; }\n [data-expanded=\"true\"] .spotpatch-execution-more {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgb(255 255 255 / 4.5%);\n color: #828894;\n }\n .spotpatch-execution-recent {\n position: absolute;\n top: 62px;\n right: 20px;\n left: 20px;\n display: grid;\n margin-top: 0;\n }\n .spotpatch-execution-recent[hidden] { display: none; }\n .spotpatch-execution-recent-item {\n display: grid;\n min-height: 28px;\n grid-template-columns: 52px minmax(0, 1fr) auto;\n align-items: center;\n border-top: 1px solid rgb(255 255 255 / 5.5%);\n }\n .spotpatch-execution-recent-item:first-child { border-top: 0; }\n .spotpatch-execution-recent-kind {\n color: #666c76;\n font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;\n text-transform: uppercase;\n }\n .spotpatch-execution-recent-detail {\n overflow: hidden;\n color: #b2b6bf;\n font-size: 11px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .spotpatch-execution-recent-state {\n color: #626974;\n font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;\n }\n .spotpatch-execution-recent-item[data-state=\"active\"] .spotpatch-execution-recent-kind {\n color: var(--spotpatch-island-violet);\n }\n .spotpatch-execution-recent-item[data-state=\"active\"] .spotpatch-execution-recent-detail {\n color: #f2f3f7;\n }\n .spotpatch-execution-recent-item[data-state=\"failure\"] .spotpatch-execution-recent-kind {\n color: var(--spotpatch-island-error);\n }\n .spotpatch-island-sweep {\n position: absolute;\n z-index: 2;\n bottom: 0;\n left: 44px;\n width: 20%;\n height: 1px;\n border-radius: 999px;\n background: linear-gradient(90deg, transparent, var(--spotpatch-island-violet), var(--spotpatch-island-cyan), transparent);\n box-shadow: 0 0 7px rgb(139 103 255 / 18%);\n opacity: 0;\n pointer-events: none;\n transform: translate3d(-160%, 0, 0);\n }\n @keyframes spotpatch-motion-copy-in {\n from { opacity: 0; filter: blur(2px); transform: translate3d(0, 3px, 0); }\n to { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0); }\n }\n @keyframes spotpatch-motion-copy-out {\n from { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0); }\n to { opacity: 0; filter: blur(2px); transform: translate3d(0, -3px, 0); }\n }\n @keyframes spotpatch-motion-status-breathe {\n 50% { opacity: .42; transform: scale(.82); }\n }\n @keyframes spotpatch-motion-pill-pulse {\n 50% { box-shadow: 0 0 0 6px rgb(99 102 241 / 5%); opacity: .72; }\n }\n .spotpatch-floating-surface[data-motion-paused=\"true\"] .spotpatch-execution-meta-dot,\n .spotpatch-floating-surface[data-motion-paused=\"true\"] .spotpatch-trigger::before {\n animation-play-state: paused;\n }\n @media (prefers-reduced-motion: reduce) {\n .spotpatch-trigger::before,\n .spotpatch-execution-meta-dot,\n .spotpatch-execution-headline,\n .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-action,\n .spotpatch-execution-action-outgoing {\n animation: none !important;\n filter: none !important;\n transform: none !important;\n }\n .spotpatch-island-sweep { display: none; }\n }\n @media (max-width: 520px) {\n .spotpatch-execution-island {\n grid-template-columns: auto minmax(0, 1fr) auto;\n gap: 10px;\n padding-right: 14px;\n padding-left: 14px;\n }\n .spotpatch-execution-action-wrap { display: none; }\n .spotpatch-execution-recent-item { grid-template-columns: 48px minmax(0, 1fr); }\n .spotpatch-execution-recent-state { display: none; }\n }\n `;\n return style;\n}\n\nexport function createFloatingSurfaceMotionController(\n document: Document,\n elements: FloatingSurfaceMotionElements,\n reconcile: () => void,\n): FloatingSurfaceMotionController {\n let currentScene: FloatingSurfaceProjection[\"scene\"] | undefined;\n let currentActivityKey: string | undefined;\n let morphTimeline: gsap.core.Timeline | undefined;\n let dispatchTimeline: gsap.core.Timeline | undefined;\n let pendingProjection: PendingProjection | undefined;\n let dispatchSource: HTMLElement | undefined;\n let dispatchTarget: HTMLElement | undefined;\n let disposed = false;\n\n const handleVisibility = (): void => {\n elements.surface.dataset.motionPaused = String(document.hidden);\n };\n document.addEventListener(\"visibilitychange\", handleVisibility);\n handleVisibility();\n\n const morphElements = [\n elements.surface,\n elements.pill,\n elements.planner,\n elements.execution.root,\n elements.execution.mark,\n elements.execution.content,\n elements.execution.meta,\n elements.execution.recent,\n ];\n\n const sharedExecutionElements = [\n elements.execution.mark,\n elements.execution.content,\n elements.execution.meta,\n ];\n\n function captureSurfaceLayout(includeSharedOffsets = false): SurfaceLayout {\n const surfaceRect = elements.surface.getBoundingClientRect();\n const computedRadius = document.defaultView\n ?.getComputedStyle(elements.surface)\n .borderRadius.trim();\n\n const sharedOffsets = new Map<HTMLElement, ElementOffset>();\n if (includeSharedOffsets && finiteRect(surfaceRect)) {\n for (const element of sharedExecutionElements) {\n const elementRect = element.getBoundingClientRect();\n if (!finiteRect(elementRect)) continue;\n sharedOffsets.set(\n element,\n Object.freeze({\n x: elementRect.left - surfaceRect.left,\n y: elementRect.top - surfaceRect.top,\n }),\n );\n }\n }\n\n return Object.freeze({\n geometry: Object.freeze({\n borderRadius: visibleBorderRadius(computedRadius, surfaceRect),\n rect: surfaceRect,\n }),\n sharedOffsets,\n });\n }\n\n function syncRecentVisibility(): void {\n elements.execution.recent.hidden =\n elements.execution.root.dataset.expanded !== \"true\";\n }\n\n function clearMorphProperties(): void {\n gsap.set(morphElements, {\n clearProps:\n \"borderRadius,filter,height,opacity,transform,visibility,width,willChange\",\n });\n delete elements.surface.dataset.motionMorphing;\n syncRecentVisibility();\n }\n\n function clearMorph(): void {\n morphTimeline?.kill();\n morphTimeline = undefined;\n gsap.killTweensOf(morphElements);\n clearMorphProperties();\n }\n\n function interruptMorph(includeSharedOffsets = false): SurfaceLayout {\n morphTimeline?.kill();\n morphTimeline = undefined;\n gsap.killTweensOf(morphElements);\n const layout = captureSurfaceLayout(includeSharedOffsets);\n clearMorphProperties();\n return layout;\n }\n\n function clearDispatch(): void {\n dispatchTimeline?.kill();\n dispatchTimeline = undefined;\n if (dispatchSource !== undefined) {\n gsap.killTweensOf(dispatchSource);\n gsap.set(dispatchSource, { clearProps: \"filter,transform\" });\n dispatchSource = undefined;\n }\n if (dispatchTarget !== undefined) {\n gsap.killTweensOf(dispatchTarget);\n gsap.set(dispatchTarget, { clearProps: \"boxShadow\" });\n dispatchTarget = undefined;\n }\n elements.surface.dataset.agentCharging = \"false\";\n }\n\n function completeDispatch(): void {\n dispatchTimeline = undefined;\n if (dispatchSource !== undefined) {\n gsap.set(dispatchSource, { clearProps: \"filter,transform\" });\n dispatchSource = undefined;\n }\n if (dispatchTarget !== undefined) {\n gsap.set(dispatchTarget, { clearProps: \"boxShadow\" });\n dispatchTarget = undefined;\n }\n elements.surface.dataset.agentCharging = \"false\";\n }\n\n function sweepOnce(): void {\n if (!supportsMotion(document) || document.hidden) return;\n gsap.killTweensOf(elements.execution.sweep);\n gsap.fromTo(\n elements.execution.sweep,\n { autoAlpha: 0, xPercent: -160 },\n {\n autoAlpha: 0.72,\n xPercent: 620,\n duration: MOTION.sweepSeconds,\n ease: \"power2.inOut\",\n onComplete: () => {\n gsap.set(elements.execution.sweep, {\n clearProps: \"opacity,transform,visibility\",\n });\n },\n },\n );\n }\n\n function animateGeometry(\n previous: SurfaceLayout,\n next: SurfaceLayout,\n activeScene: HTMLElement,\n reveal: boolean,\n detailTransition?: DetailTransition,\n ): void {\n const geometryHasChanged =\n geometryChanged(previous.geometry.rect, next.geometry.rect) ||\n previous.geometry.borderRadius !== next.geometry.borderRadius;\n const sharedLayoutHasChanged = sharedExecutionElements.some((element) => {\n const previousOffset = previous.sharedOffsets.get(element);\n const nextOffset = next.sharedOffsets.get(element);\n return (\n previousOffset !== undefined &&\n nextOffset !== undefined &&\n (Math.abs(previousOffset.x - nextOffset.x) > 0.5 ||\n Math.abs(previousOffset.y - nextOffset.y) > 0.5)\n );\n });\n\n if (\n !supportsMotion(document) ||\n !finiteRect(previous.geometry.rect) ||\n !finiteRect(next.geometry.rect) ||\n (!geometryHasChanged && !sharedLayoutHasChanged && detailTransition === undefined)\n ) {\n clearMorphProperties();\n return;\n }\n\n const morphDuration =\n detailTransition === \"expand\" ? MOTION.expandSeconds : MOTION.morphSeconds;\n elements.surface.dataset.motionMorphing = \"true\";\n morphTimeline = gsap.timeline({\n defaults: { overwrite: \"auto\" },\n onComplete: () => {\n clearMorphProperties();\n reconcile();\n morphTimeline = undefined;\n },\n });\n\n if (geometryHasChanged) {\n morphTimeline.fromTo(\n elements.surface,\n {\n borderRadius: previous.geometry.borderRadius,\n height: previous.geometry.rect.height,\n width: previous.geometry.rect.width,\n x: previous.geometry.rect.left - next.geometry.rect.left,\n y: previous.geometry.rect.top - next.geometry.rect.top,\n willChange: \"width,height,transform\",\n },\n {\n borderRadius: next.geometry.borderRadius,\n height: next.geometry.rect.height,\n width: next.geometry.rect.width,\n x: 0,\n y: 0,\n duration: morphDuration,\n ease: \"expo.inOut\",\n },\n 0,\n );\n }\n\n for (const element of sharedExecutionElements) {\n const previousOffset = previous.sharedOffsets.get(element);\n const nextOffset = next.sharedOffsets.get(element);\n if (previousOffset === undefined || nextOffset === undefined) continue;\n const x = previousOffset.x - nextOffset.x;\n const y = previousOffset.y - nextOffset.y;\n if (Math.abs(x) <= 0.5 && Math.abs(y) <= 0.5) continue;\n morphTimeline.fromTo(\n element,\n { x, y, willChange: \"transform\" },\n {\n x: 0,\n y: 0,\n duration: morphDuration,\n ease: \"expo.inOut\",\n },\n 0,\n );\n }\n\n if (detailTransition === \"expand\") {\n morphTimeline.fromTo(\n elements.execution.recent,\n { autoAlpha: 0, filter: \"blur(4px)\", y: 6 },\n {\n autoAlpha: 1,\n filter: \"blur(0px)\",\n y: 0,\n duration: MOTION.detailRevealSeconds,\n ease: \"power3.out\",\n },\n MOTION.detailRevealDelaySeconds,\n );\n } else if (detailTransition === \"collapse\") {\n morphTimeline.fromTo(\n elements.execution.recent,\n { autoAlpha: 1, filter: \"blur(0px)\", y: 0 },\n {\n autoAlpha: 0,\n filter: \"blur(3px)\",\n y: -4,\n duration: MOTION.detailRetireSeconds,\n ease: \"power2.in\",\n },\n 0,\n );\n }\n\n if (reveal) {\n morphTimeline.fromTo(\n activeScene,\n { autoAlpha: 0, y: 4 },\n {\n autoAlpha: 1,\n y: 0,\n duration: MOTION.revealSeconds,\n ease: \"power2.out\",\n clearProps: \"transform,opacity,visibility\",\n },\n MOTION.sceneRevealDelaySeconds,\n );\n }\n }\n\n function applyProjection(\n projection: FloatingSurfaceProjection,\n renderContent: () => void,\n ): void {\n if (disposed) return;\n const previousScene = currentScene;\n const sceneChanged = previousScene !== projection.scene;\n const layerChanged =\n previousScene === undefined ||\n surfaceLayer(previousScene) !== surfaceLayer(projection.scene);\n const wasExpanded = elements.execution.root.dataset.expanded === \"true\";\n const executionRemainsActive =\n previousScene !== undefined &&\n surfaceLayer(previousScene) === \"execution\" &&\n surfaceLayer(projection.scene) === \"execution\";\n const preserveInterruptedSharedLayout =\n executionRemainsActive && (wasExpanded || morphTimeline?.isActive() === true);\n const previousGeometry = interruptMorph(preserveInterruptedSharedLayout);\n const activityChanged = currentActivityKey !== projection.activity?.key;\n\n elements.surface.dataset.scene = projection.scene;\n elements.surface.dataset.tone = projection.tone;\n elements.surface.style.setProperty(\n \"--spotpatch-island-compact-width\",\n `${String(compactIslandWidth(projection))}px`,\n );\n renderContent();\n const activeScene = setSceneVisibility(elements, projection);\n const isExpanded = elements.execution.root.dataset.expanded === \"true\";\n const detailTransition: DetailTransition =\n executionRemainsActive && wasExpanded && !isExpanded ? \"collapse\" : undefined;\n if (detailTransition === \"collapse\") {\n elements.execution.recent.hidden = false;\n }\n reconcile();\n const nextGeometry = captureSurfaceLayout(\n preserveInterruptedSharedLayout || detailTransition !== undefined,\n );\n currentScene = projection.scene;\n currentActivityKey = projection.activity?.key;\n animateGeometry(\n previousGeometry,\n nextGeometry,\n activeScene,\n layerChanged,\n detailTransition,\n );\n\n const executionActive =\n projection.scene === \"handoff\" ||\n projection.scene === \"running\" ||\n projection.scene === \"success\" ||\n projection.scene === \"failed\";\n if (executionActive && (sceneChanged || activityChanged)) sweepOnce();\n }\n\n function updateLayout(updateContent: () => void): void {\n if (disposed) return;\n const wasExpanded = elements.execution.root.dataset.expanded === \"true\";\n const previousGeometry = interruptMorph(true);\n updateContent();\n const isExpanded = elements.execution.root.dataset.expanded === \"true\";\n const detailTransition: DetailTransition = wasExpanded\n ? isExpanded\n ? undefined\n : \"collapse\"\n : isExpanded\n ? \"expand\"\n : undefined;\n if (detailTransition === \"collapse\") {\n elements.execution.recent.hidden = false;\n }\n reconcile();\n const nextGeometry = captureSurfaceLayout(true);\n const activeScene = elements.execution.root.hidden\n ? elements.planner.hidden\n ? elements.pill\n : elements.planner\n : elements.execution.root;\n animateGeometry(\n previousGeometry,\n nextGeometry,\n activeScene,\n false,\n detailTransition,\n );\n }\n\n function cancel(): void {\n pendingProjection = undefined;\n clearMorph();\n clearDispatch();\n gsap.killTweensOf(elements.execution.sweep);\n gsap.set(elements.execution.sweep, {\n clearProps: \"opacity,transform,visibility\",\n });\n }\n\n function render(\n projection: FloatingSurfaceProjection,\n renderContent: () => void,\n ): void {\n if (disposed) return;\n const dispatchActive = dispatchTimeline?.isActive() === true;\n const leavesChargingScene =\n projection.scene !== \"planner\" && projection.scene !== \"agent-charging\";\n\n if (dispatchActive && currentScene === \"agent-charging\" && leavesChargingScene) {\n pendingProjection = Object.freeze({ projection, renderContent });\n return;\n }\n\n if (dispatchActive && projection.scene !== \"agent-charging\") {\n pendingProjection = undefined;\n clearDispatch();\n }\n\n applyProjection(projection, renderContent);\n }\n\n function dispatch(source: HTMLElement, target: HTMLElement): void {\n if (disposed || dispatchTimeline?.isActive() === true) return;\n if (!supportsMotion(document)) return;\n\n clearDispatch();\n dispatchSource = source;\n dispatchTarget = target;\n elements.surface.dataset.agentCharging = \"true\";\n dispatchTimeline = gsap.timeline({\n onComplete: () => {\n const nextProjection = pendingProjection;\n pendingProjection = undefined;\n completeDispatch();\n if (nextProjection !== undefined) {\n applyProjection(nextProjection.projection, nextProjection.renderContent);\n }\n },\n });\n dispatchTimeline.fromTo(\n source,\n { filter: \"brightness(1)\", scaleX: 1, scaleY: 1 },\n {\n filter: \"brightness(1.06)\",\n scaleX: 0.995,\n scaleY: 0.97,\n duration: MOTION.pressSeconds,\n ease: \"power2.out\",\n yoyo: true,\n repeat: 1,\n clearProps: \"filter,transform\",\n },\n 0,\n );\n dispatchTimeline.fromTo(\n target,\n { boxShadow: \"0 0 0 rgb(100 120 255 / 0%)\" },\n {\n boxShadow: \"0 0 18px rgb(100 120 255 / 14%)\",\n duration: MOTION.targetFeedbackSeconds,\n yoyo: true,\n repeat: 1,\n clearProps: \"boxShadow\",\n },\n MOTION.targetFeedbackDelaySeconds,\n );\n dispatchTimeline.to({}, { duration: MOTION.dispatchSeconds }, 0);\n }\n\n return Object.freeze({\n cancel,\n dispatch,\n render,\n updateLayout,\n dispose(): void {\n if (disposed) return;\n disposed = true;\n cancel();\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n },\n });\n}\n","import { createButton, createMarkedElement } from \"./dom.js\";\nimport { BRAND_MARK_CONTENT } from \"./brand-mark-content.js\";\nimport { createBrandMark } from \"./brand-mark.js\";\nimport type {\n FloatingSurfaceProjection,\n MotionExecutionIsland,\n} from \"./motion-extension-contract.js\";\n\nconst TIMER_INTERVAL_MS = 1_000;\n\nexport type { ExecutionActivityKind } from \"./motion-extension-contract.js\";\n\nfunction formatElapsed(milliseconds: number): string {\n const totalSeconds = Math.max(0, Math.floor(milliseconds / TIMER_INTERVAL_MS));\n const seconds = totalSeconds % 60;\n const totalMinutes = Math.floor(totalSeconds / 60);\n const minutes = totalMinutes % 60;\n const hours = Math.floor(totalMinutes / 60);\n const twoDigits = (value: number): string => String(value).padStart(2, \"0\");\n\n return hours > 0\n ? `${twoDigits(hours)}:${twoDigits(minutes)}:${twoDigits(seconds)}`\n : `${twoDigits(totalMinutes)}:${twoDigits(seconds)}`;\n}\n\nfunction validTimestamp(value: string | undefined): number | undefined {\n if (value === undefined) return undefined;\n const timestamp = Date.parse(value);\n return Number.isFinite(timestamp) ? timestamp : undefined;\n}\n\nfunction prefersReducedMotion(window: Window): boolean {\n const matchMedia: unknown = Reflect.get(window, \"matchMedia\");\n if (typeof matchMedia !== \"function\") return false;\n const result: unknown = Reflect.apply(matchMedia, window, [\n \"(prefers-reduced-motion: reduce)\",\n ]);\n return (\n typeof result === \"object\" &&\n result !== null &&\n \"matches\" in result &&\n result.matches === true\n );\n}\n\nexport function createExecutionIsland(\n document: Document,\n now: () => number = Date.now,\n): MotionExecutionIsland {\n const window = document.defaultView;\n\n if (window === null) {\n throw new Error(\"SpotPatch Execution Island requires an associated window.\");\n }\n\n const root = createButton(document, \"\", \"spotpatch-execution-island\");\n root.hidden = true;\n root.setAttribute(\"aria-hidden\", \"true\");\n root.setAttribute(\"aria-expanded\", \"false\");\n\n const logo = createBrandMark(\n document,\n BRAND_MARK_CONTENT,\n \"spotpatch-execution-island\",\n );\n logo.classList.add(\"spotpatch-execution-logo\");\n const mark = createMarkedElement(document, \"span\");\n mark.className = \"spotpatch-execution-mark\";\n mark.append(logo);\n\n const content = createMarkedElement(document, \"span\");\n content.className = \"spotpatch-execution-content\";\n content.setAttribute(\"role\", \"status\");\n content.setAttribute(\"aria-live\", \"polite\");\n content.setAttribute(\"aria-atomic\", \"true\");\n const headlineWrap = createMarkedElement(document, \"span\");\n headlineWrap.className = \"spotpatch-execution-headline-wrap\";\n const headline = createMarkedElement(document, \"strong\");\n headline.className = \"spotpatch-execution-headline\";\n const headlineOutgoing = createMarkedElement(document, \"strong\");\n headlineOutgoing.className = \"spotpatch-execution-headline-outgoing\";\n headlineOutgoing.setAttribute(\"aria-hidden\", \"true\");\n headlineWrap.append(headlineOutgoing, headline);\n const actionWrap = createMarkedElement(document, \"span\");\n actionWrap.className = \"spotpatch-execution-action-wrap\";\n const action = createMarkedElement(document, \"span\");\n action.className = \"spotpatch-execution-action\";\n const actionOutgoing = createMarkedElement(document, \"span\");\n actionOutgoing.className = \"spotpatch-execution-action-outgoing\";\n actionOutgoing.setAttribute(\"aria-hidden\", \"true\");\n actionWrap.append(actionOutgoing, action);\n const recent = createMarkedElement(document, \"span\");\n recent.className = \"spotpatch-execution-recent\";\n content.append(headlineWrap, actionWrap);\n\n const meta = createMarkedElement(document, \"span\");\n meta.className = \"spotpatch-execution-meta\";\n const metaDot = createMarkedElement(document, \"span\");\n metaDot.className = \"spotpatch-execution-meta-dot\";\n metaDot.setAttribute(\"aria-hidden\", \"true\");\n const metaLabel = createMarkedElement(document, \"span\");\n metaLabel.className = \"spotpatch-execution-meta-label\";\n const timer = createMarkedElement(document, \"span\");\n timer.className = \"spotpatch-execution-timer\";\n timer.hidden = true;\n meta.append(metaDot, metaLabel, timer);\n\n const more = createMarkedElement(document, \"span\");\n more.className = \"spotpatch-execution-more\";\n more.textContent = \"•••\";\n more.setAttribute(\"aria-hidden\", \"true\");\n meta.append(more);\n\n const sweep = createMarkedElement(document, \"span\");\n sweep.className = \"spotpatch-island-sweep\";\n sweep.setAttribute(\"aria-hidden\", \"true\");\n root.append(mark, content, meta, recent, sweep);\n\n const elements = Object.freeze({\n action,\n actionOutgoing,\n content,\n headline,\n headlineOutgoing,\n logo,\n mark,\n meta,\n metaDot,\n metaLabel,\n more,\n recent,\n root,\n sweep,\n timer,\n });\n let currentProjection: FloatingSurfaceProjection | undefined;\n let expandable = false;\n let expanded = false;\n let timerHandle: number | undefined;\n let startedAt: number | undefined;\n let disposed = false;\n\n const updateExpandedState = (): void => {\n expanded = expandable && expanded;\n root.dataset.expandable = String(expandable);\n root.dataset.expanded = String(expanded);\n root.setAttribute(\"aria-expanded\", String(expanded));\n more.textContent = expanded ? \"×\" : \"•••\";\n recent.hidden = !expanded;\n };\n\n const animateCopyChange = (\n element: HTMLElement,\n outgoing: HTMLElement,\n value: string,\n ): void => {\n if (element.textContent === value) return;\n outgoing.textContent = element.textContent;\n element.textContent = value;\n root.classList.remove(\"spotpatch-execution-copy-changing\");\n if (!prefersReducedMotion(window)) {\n void root.offsetWidth;\n root.classList.add(\"spotpatch-execution-copy-changing\");\n }\n };\n const syncProjectionCopy = (projection: FloatingSurfaceProjection): void => {\n const visibleHeadline = expanded\n ? (projection.expandedHeadline ?? projection.headline)\n : projection.headline;\n const visibleAction = expanded\n ? (projection.expandedAction ?? projection.action)\n : projection.action;\n animateCopyChange(headline, headlineOutgoing, visibleHeadline);\n animateCopyChange(action, actionOutgoing, visibleAction);\n root.setAttribute(\n \"aria-label\",\n [visibleHeadline, visibleAction, projection.meta].filter(Boolean).join(\". \"),\n );\n };\n\n const stopTimer = (): void => {\n if (timerHandle === undefined) return;\n window.clearInterval(timerHandle);\n timerHandle = undefined;\n };\n const updateTimer = (): void => {\n if (startedAt === undefined) return;\n timer.textContent = formatElapsed(now() - startedAt);\n };\n const startTimer = (): void => {\n if (timerHandle !== undefined || startedAt === undefined || document.hidden) {\n return;\n }\n updateTimer();\n timerHandle = window.setInterval(updateTimer, TIMER_INTERVAL_MS);\n };\n const syncTimer = (projection: FloatingSurfaceProjection): void => {\n stopTimer();\n startedAt =\n projection.scene === \"running\" ? validTimestamp(projection.startedAt) : undefined;\n const timed = startedAt !== undefined;\n timer.hidden = !timed;\n metaLabel.textContent = projection.meta;\n if (timed) startTimer();\n };\n const handleVisibility = (): void => {\n if (document.hidden) {\n stopTimer();\n } else if (currentProjection !== undefined) {\n syncTimer(currentProjection);\n }\n };\n document.addEventListener(\"visibilitychange\", handleVisibility);\n\n return Object.freeze({\n canExpand: () => expandable,\n elements,\n isExpanded: () => expanded,\n root,\n setExpanded(nextExpanded: boolean): void {\n expanded = nextExpanded;\n updateExpandedState();\n if (currentProjection !== undefined) syncProjectionCopy(currentProjection);\n },\n render(projection: FloatingSurfaceProjection): void {\n if (disposed) return;\n currentProjection = projection;\n root.dataset.executionScene = projection.scene;\n meta.dataset.tone = projection.tone;\n syncTimer(projection);\n\n recent.replaceChildren(\n ...projection.recentActivities.slice(-3).map((item) => {\n const row = createMarkedElement(document, \"span\");\n row.className = \"spotpatch-execution-recent-item\";\n row.dataset.state = item.state;\n const kind = createMarkedElement(document, \"span\");\n kind.className = \"spotpatch-execution-recent-kind\";\n kind.textContent = item.kind;\n const detail = createMarkedElement(document, \"span\");\n detail.className = \"spotpatch-execution-recent-detail\";\n detail.textContent = item.detail ?? item.label;\n const state = createMarkedElement(document, \"span\");\n state.className = \"spotpatch-execution-recent-state\";\n state.textContent = item.state;\n row.append(kind, detail, state);\n return row;\n }),\n );\n expandable = projection.recentActivities.length > 0;\n if (projection.scene === \"success\" || projection.scene === \"failed\") {\n expanded = false;\n }\n updateExpandedState();\n syncProjectionCopy(projection);\n },\n dispose(): void {\n if (disposed) return;\n disposed = true;\n stopTimer();\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n },\n });\n}\n","import {\n createFloatingSurfaceMotionController,\n createFloatingSurfaceMotionStyles,\n} from \"./ui/motion-controller.js\";\nimport { createExecutionIsland } from \"./ui/execution-island.js\";\nimport {\n registerFloatingSurfaceMotionExtension,\n type FloatingSurfaceMotionExtension,\n} from \"./ui/motion-extension-contract.js\";\n\nconst FLOATING_SURFACE_MOTION_EXTENSION = Object.freeze({\n createExecutionIsland,\n createController: createFloatingSurfaceMotionController,\n createStyles: createFloatingSurfaceMotionStyles,\n}) satisfies FloatingSurfaceMotionExtension;\n\nexport function installFloatingSurfaceMotionExtension(): void {\n registerFloatingSurfaceMotionExtension(FLOATING_SURFACE_MOTION_EXTENSION);\n}\n\nexport {\n createExecutionIsland,\n createFloatingSurfaceMotionController,\n createFloatingSurfaceMotionStyles,\n};\nexport {\n getFloatingSurfaceMotionExtension,\n registerFloatingSurfaceMotionExtension,\n type FloatingSurfaceMotionController,\n type FloatingSurfaceMotionElements,\n type FloatingSurfaceMotionExtension,\n type FloatingSurfaceProjection,\n type FloatingSurfaceScene,\n type FloatingSurfaceTone,\n type MotionExecutionIsland,\n} from \"./ui/motion-extension-contract.js\";\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY;AAQrB,IAAM,SAA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I,SAAU;AACd,0BAAoB;AACpB,WAAK,QAAQ,iBAAiB,WAAW;AACzC,WAAK,QAAQ,OAAO,WAAW;AAC/B,gBAAU,UAAU;AAEpB,aAAO;AAAA,QACL,GAAG,WAAW,iBAAiB,MAAM,EAAE,EAAE,IAAI,CAAC,SAAS;AACrD,gBAAM,MAAM,oBAAoB,UAAU,MAAM;AAChD,cAAI,YAAY;AAChB,cAAI,QAAQ,QAAQ,KAAK;AACzB,gBAAM,OAAO,oBAAoB,UAAU,MAAM;AACjD,eAAK,YAAY;AACjB,eAAK,cAAc,KAAK;AACxB,gBAAM,SAAS,oBAAoB,UAAU,MAAM;AACnD,iBAAO,YAAY;AACnB,iBAAO,cAAc,KAAK,UAAU,KAAK;AACzC,gBAAM,QAAQ,oBAAoB,UAAU,MAAM;AAClD,gBAAM,YAAY;AAClB,gBAAM,cAAc,KAAK;AACzB,cAAI,OAAO,MAAM,QAAQ,KAAK;AAC9B,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AACA,mBAAa,WAAW,iBAAiB,SAAS;AAClD,UAAI,WAAW,UAAU,aAAa,WAAW,UAAU,UAAU;AACnE,mBAAW;AAAA,MACb;AACA,0BAAoB;AACpB,yBAAmB,UAAU;AAAA,IAC/B;AAAA,IACA,UAAgB;AACd,UAAI,SAAU;AACd,iBAAW;AACX,gBAAU;AACV,eAAS,oBAAoB,oBAAoB,gBAAgB;AAAA,IACnE;AAAA,EACF,CAAC;AACH;;;AC7PA,IAAM,oCAAoC,OAAO,OAAO;AAAA,EACtD;AAAA,EACA,kBAAkB;AAAA,EAClB,cAAc;AAChB,CAAC;AAEM,SAAS,wCAA8C;AAC5D,yCAAuC,iCAAiC;AAC1E;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotpatch/runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Browser runtime, collectors, and Shadow DOM UI for SpotPatch.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -69,6 +69,16 @@
|
|
|
69
69
|
"types": "./dist/external-handoff-panel.d.cts",
|
|
70
70
|
"default": "./dist/external-handoff-panel.cjs"
|
|
71
71
|
}
|
|
72
|
+
},
|
|
73
|
+
"./motion": {
|
|
74
|
+
"import": {
|
|
75
|
+
"types": "./dist/motion.d.ts",
|
|
76
|
+
"default": "./dist/motion.js"
|
|
77
|
+
},
|
|
78
|
+
"require": {
|
|
79
|
+
"types": "./dist/motion.d.cts",
|
|
80
|
+
"default": "./dist/motion.cjs"
|
|
81
|
+
}
|
|
72
82
|
}
|
|
73
83
|
},
|
|
74
84
|
"typesVersions": {
|
|
@@ -81,10 +91,14 @@
|
|
|
81
91
|
],
|
|
82
92
|
"external-handoff-panel": [
|
|
83
93
|
"dist/external-handoff-panel.d.ts"
|
|
94
|
+
],
|
|
95
|
+
"motion": [
|
|
96
|
+
"dist/motion.d.ts"
|
|
84
97
|
]
|
|
85
98
|
}
|
|
86
99
|
},
|
|
87
100
|
"dependencies": {
|
|
101
|
+
"gsap": "3.15.0",
|
|
88
102
|
"@spotpatch/react-adapter": "^1.2.0",
|
|
89
103
|
"@spotpatch/shared": "^1.12.0"
|
|
90
104
|
},
|
|
@@ -93,8 +107,9 @@
|
|
|
93
107
|
"registry": "https://registry.npmjs.org/"
|
|
94
108
|
},
|
|
95
109
|
"scripts": {
|
|
96
|
-
"build": "tsup --config tsup.config.ts",
|
|
110
|
+
"build": "pnpm clean && tsup --config tsup.config.ts",
|
|
97
111
|
"clean": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"",
|
|
112
|
+
"dev": "tsup --config tsup.config.ts --watch",
|
|
98
113
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
99
114
|
}
|
|
100
115
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/ui-constants.ts","../src/ui/dom.ts"],"sourcesContent":["export const UI_MARKER_ATTRIBUTE = \"data-spotpatch-ui\" as const;\n\nexport const UI_Z_INDEX = Object.freeze({\n highlight: 2_147_483_646,\n controls: 2_147_483_647,\n});\n","import { UI_MARKER_ATTRIBUTE } from \"./ui-constants.js\";\n\nexport function createMarkedElement<K extends keyof HTMLElementTagNameMap>(\n document: Document,\n tagName: K,\n): HTMLElementTagNameMap[K] {\n const element = document.createElement(tagName);\n element.setAttribute(UI_MARKER_ATTRIBUTE, \"\");\n return element;\n}\n\nexport function createButton(\n document: Document,\n label: string,\n className = \"\",\n): HTMLButtonElement {\n const button = createMarkedElement(document, \"button\");\n button.type = \"button\";\n button.className = className;\n button.textContent = label;\n return button;\n}\n"],"mappings":";AAAO,IAAM,sBAAsB;AAE5B,IAAM,aAAa,OAAO,OAAO;AAAA,EACtC,WAAW;AAAA,EACX,UAAU;AACZ,CAAC;;;ACHM,SAAS,oBACd,UACA,SAC0B;AAC1B,QAAM,UAAU,SAAS,cAAc,OAAO;AAC9C,UAAQ,aAAa,qBAAqB,EAAE;AAC5C,SAAO;AACT;AAEO,SAAS,aACd,UACA,OACA,YAAY,IACO;AACnB,QAAM,SAAS,oBAAoB,UAAU,QAAQ;AACrD,SAAO,OAAO;AACd,SAAO,YAAY;AACnB,SAAO,cAAc;AACrB,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/external-handoff-contract.ts"],"sourcesContent":["import type {\n ErrorCode,\n ExternalAgentControlStatus,\n ExternalAgentManagedResult,\n ExternalHandoffCapability,\n ExternalHandoffPublishResult,\n ExternalHandoffStatusResult,\n ExternalHandoffFramework,\n SpotAnnotation,\n SpotPatchLocale,\n} from \"@spotpatch/shared/external-handoff-browser\";\n\nexport interface ExternalHandoffPanel {\n readonly cancelManagedButton: HTMLButtonElement;\n readonly connectButton: HTMLButtonElement;\n readonly disconnectButton: HTMLButtonElement;\n readonly refreshButton: HTMLButtonElement;\n readonly root: HTMLElement;\n readonly sendButton: HTMLButtonElement;\n readonly styles: HTMLStyleElement;\n readonly confirmDisclosure: (annotation: SpotAnnotation) => Promise<boolean>;\n readonly dispose: () => void;\n readonly renderCapability: (capability: ExternalHandoffCapability) => void;\n readonly renderControlUnavailable: () => void;\n readonly renderControlStatus: (status: ExternalAgentControlStatus) => void;\n readonly renderError: (code?: ErrorCode, retryable?: boolean) => void;\n readonly renderPublishResult: (result: ExternalHandoffPublishResult) => void;\n readonly renderPublishing: () => void;\n readonly renderManagedResult: (result: ExternalAgentManagedResult) => void;\n readonly renderStatus: (result: ExternalHandoffStatusResult) => void;\n readonly resolveButton: HTMLButtonElement;\n readonly revokeButton: HTMLButtonElement;\n readonly setBusy: (busy: boolean) => void;\n readonly setControlBusy: (busy: boolean) => void;\n readonly setContextReady: (ready: boolean) => void;\n readonly setSelectionVisible: (visible: boolean) => void;\n}\n\nexport interface ExternalHandoffWorkflow {\n readonly cancelPending: () => void;\n readonly dispose: () => void;\n readonly mount: () => void;\n}\n\nexport interface ExternalHandoffExtension {\n readonly createPanel: (\n document: Document,\n framework: ExternalHandoffFramework,\n locale: () => SpotPatchLocale,\n sessionId: string,\n subscribeLocale: (listener: () => void) => () => void,\n onViewChange: () => void,\n ) => ExternalHandoffPanel;\n readonly createWorkflow: (\n fetch: typeof globalThis.fetch,\n panel: ExternalHandoffPanel,\n selectedAnnotation: () => SpotAnnotation | undefined,\n sessionToken: string,\n window: Window,\n ) => ExternalHandoffWorkflow;\n}\n\nconst EXTERNAL_HANDOFF_EXTENSION_KEY = Symbol.for(\"spotpatch.external-handoff.v1\");\ntype ExtensionStore = Partial<Record<symbol, ExternalHandoffExtension>>;\n\nexport function registerExternalHandoffExtension(\n extension: ExternalHandoffExtension,\n): void {\n (globalThis as ExtensionStore)[EXTERNAL_HANDOFF_EXTENSION_KEY] = extension;\n}\n\nexport function getExternalHandoffExtension(): ExternalHandoffExtension | undefined {\n return (globalThis as ExtensionStore)[EXTERNAL_HANDOFF_EXTENSION_KEY];\n}\n"],"mappings":";AA8DA,IAAM,iCAAiC,uBAAO,IAAI,+BAA+B;AAG1E,SAAS,iCACd,WACM;AACN,EAAC,WAA8B,8BAA8B,IAAI;AACnE;AAEO,SAAS,8BAAoE;AAClF,SAAQ,WAA8B,8BAA8B;AACtE;","names":[]}
|