@neta-art/cohub 8.4.0 → 8.5.1
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/README.md +1 -1
- package/dist/board/core/draw-geometry.d.ts +21 -4
- package/dist/board/core/draw-geometry.js +93 -4
- package/dist/board/core/file-preview.js +1 -1
- package/dist/board/geometry.js +4 -3
- package/dist/board/index.d.ts +2 -2
- package/dist/board/index.js +2 -2
- package/dist/board/render/renderers/draw-card-renderer.js +25 -18
- package/dist/board/render/renderers/file-card-renderer.js +1 -1
- package/dist/board/render/renderers/geo-card-renderer.js +1 -2
- package/dist/board/render/renderers/task-card-renderer.js +7 -8
- package/dist/board/render/renderers/text-card-renderer.js +2 -1
- package/dist/board/render/renderers/unknown-card-renderer.js +1 -1
- package/dist/board/render/text-resolution.js +1 -1
- package/dist/board/render/themes/clean-theme.js +2 -1
- package/dist/chunks/http.d.ts +68 -2
- package/dist/chunks/http.js +19 -13
- package/dist/chunks/transport.js +1 -1
- package/dist/chunks/websocket.d.ts +27 -16
- package/dist/debugger.d.ts +2 -0
- package/dist/debugger.js +48 -38
- package/dist/http.d.ts +2 -2
- package/dist/index.d.ts +8 -3
- package/dist/index.js +95 -13
- package/dist/protocol/dist/board-authoring.d.ts +2 -2
- package/dist/protocol/dist/board-constants.js +2 -2
- package/dist/protocol/dist/board.js +1 -2
- package/dist/protocol/dist/index.d.ts +2 -2
- package/dist/protocol/dist/realtime/types.d.ts +2 -0
- package/dist/voice-input.js +1 -1
- package/package.json +8 -8
- /package/docs/{work-runtime-guide.md → app-runtime-guide.md} +0 -0
package/README.md
CHANGED
|
@@ -339,4 +339,4 @@ viewer a single seat instead.
|
|
|
339
339
|
|
|
340
340
|
For the complete API-to-scope mapping, initialization recipe, capability
|
|
341
341
|
recipes, a full working example, and a pitfalls checklist, see the
|
|
342
|
-
**[App Runtime Guide](./docs/
|
|
342
|
+
**[App Runtime Guide](./docs/app-runtime-guide.md)**.
|
|
@@ -12,14 +12,31 @@ declare function computeDrawBounds(points: DrawPoint[], size: number): Rect;
|
|
|
12
12
|
*/
|
|
13
13
|
declare function simplifyDrawIndices(points: DrawPoint[], tolerance: number): number[];
|
|
14
14
|
/**
|
|
15
|
-
* Build
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Build the legacy closed outline used by exports and callers that need a path.
|
|
16
|
+
* Interactive Board rendering uses `buildStrokeRibbonGeometry` below instead:
|
|
17
|
+
* filling one outline is unsafe when a freehand path folds back over itself.
|
|
18
18
|
*/
|
|
19
19
|
declare function buildStrokeOutline(points: DrawPoint[], size: number): Array<{
|
|
20
20
|
x: number;
|
|
21
21
|
y: number;
|
|
22
22
|
}>;
|
|
23
|
+
/** Whether a sample needs a round join rather than the neighboring segment caps. */
|
|
24
|
+
declare function isStrokeCorner(points: readonly DrawPoint[], index: number): boolean;
|
|
25
|
+
type StrokeRibbonGeometry = {
|
|
26
|
+
positions: Float32Array;
|
|
27
|
+
indices: Uint32Array;
|
|
28
|
+
uvs: Float32Array;
|
|
29
|
+
/** Normalized distance along the centerline for reveal animations. */
|
|
30
|
+
progress: Float32Array;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Tessellate a freehand stroke as independent, convex primitives.
|
|
34
|
+
*
|
|
35
|
+
* A whole-path polygon is deliberately avoided: a path that folds back can make
|
|
36
|
+
* its outline self-intersect, and GPU polygon triangulation then creates a large
|
|
37
|
+
* accidental fill. Segment quads plus round point joins overlap safely instead.
|
|
38
|
+
*/
|
|
39
|
+
declare function buildStrokeRibbonGeometry(points: readonly DrawPoint[], size: number): StrokeRibbonGeometry;
|
|
23
40
|
/**
|
|
24
41
|
* Distance from a world point to the stroke's polyline, in the shape's local
|
|
25
42
|
* space. Used for hit testing: a hit registers within half the stroke width plus
|
|
@@ -27,4 +44,4 @@ declare function buildStrokeOutline(points: DrawPoint[], size: number): Array<{
|
|
|
27
44
|
*/
|
|
28
45
|
declare function distanceToStroke(points: DrawPoint[], local: WorldPoint): number;
|
|
29
46
|
//#endregion
|
|
30
|
-
export { buildStrokeOutline, computeDrawBounds, distanceToStroke, sampleRadius, simplifyDrawIndices };
|
|
47
|
+
export { StrokeRibbonGeometry, buildStrokeOutline, buildStrokeRibbonGeometry, computeDrawBounds, distanceToStroke, isStrokeCorner, sampleRadius, simplifyDrawIndices };
|
|
@@ -81,9 +81,9 @@ function perpendicularDistance(point, a, b) {
|
|
|
81
81
|
return Math.hypot(point.x - projX, point.y - projY);
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Build
|
|
85
|
-
*
|
|
86
|
-
*
|
|
84
|
+
* Build the legacy closed outline used by exports and callers that need a path.
|
|
85
|
+
* Interactive Board rendering uses `buildStrokeRibbonGeometry` below instead:
|
|
86
|
+
* filling one outline is unsafe when a freehand path folds back over itself.
|
|
87
87
|
*/
|
|
88
88
|
function buildStrokeOutline(points, size) {
|
|
89
89
|
const n = points.length;
|
|
@@ -147,6 +147,95 @@ function buildStrokeOutline(points, size) {
|
|
|
147
147
|
y
|
|
148
148
|
}));
|
|
149
149
|
}
|
|
150
|
+
const RIBBON_CIRCLE_SIDES = 8;
|
|
151
|
+
/** Whether a sample needs a round join rather than the neighboring segment caps. */
|
|
152
|
+
function isStrokeCorner(points, index) {
|
|
153
|
+
if (index === 0 || index === points.length - 1) return true;
|
|
154
|
+
const before = points[index - 1];
|
|
155
|
+
const point = points[index];
|
|
156
|
+
const after = points[index + 1];
|
|
157
|
+
if (!before || !point || !after) return false;
|
|
158
|
+
const ax = point.x - before.x;
|
|
159
|
+
const ay = point.y - before.y;
|
|
160
|
+
const bx = after.x - point.x;
|
|
161
|
+
const by = after.y - point.y;
|
|
162
|
+
const aLength = Math.hypot(ax, ay);
|
|
163
|
+
const bLength = Math.hypot(bx, by);
|
|
164
|
+
if (aLength < 1e-6 || bLength < 1e-6) return true;
|
|
165
|
+
return (ax * bx + ay * by) / (aLength * bLength) < .92;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Tessellate a freehand stroke as independent, convex primitives.
|
|
169
|
+
*
|
|
170
|
+
* A whole-path polygon is deliberately avoided: a path that folds back can make
|
|
171
|
+
* its outline self-intersect, and GPU polygon triangulation then creates a large
|
|
172
|
+
* accidental fill. Segment quads plus round point joins overlap safely instead.
|
|
173
|
+
*/
|
|
174
|
+
function buildStrokeRibbonGeometry(points, size) {
|
|
175
|
+
const positions = [];
|
|
176
|
+
const indices = [];
|
|
177
|
+
const uvs = [];
|
|
178
|
+
const progress = [];
|
|
179
|
+
if (points.length === 0) return {
|
|
180
|
+
positions: /* @__PURE__ */ new Float32Array(),
|
|
181
|
+
indices: /* @__PURE__ */ new Uint32Array(),
|
|
182
|
+
uvs: /* @__PURE__ */ new Float32Array(),
|
|
183
|
+
progress: /* @__PURE__ */ new Float32Array()
|
|
184
|
+
};
|
|
185
|
+
const lengths = new Array(points.length).fill(0);
|
|
186
|
+
for (let i = 1; i < points.length; i += 1) {
|
|
187
|
+
const from = points[i - 1];
|
|
188
|
+
const to = points[i];
|
|
189
|
+
if (from && to) lengths[i] = (lengths[i - 1] ?? 0) + Math.hypot(to.x - from.x, to.y - from.y);
|
|
190
|
+
}
|
|
191
|
+
const total = Math.max(lengths.at(-1) ?? 0, 1e-6);
|
|
192
|
+
const addVertex = (x, y, at) => {
|
|
193
|
+
const normalized = at / total;
|
|
194
|
+
positions.push(x, y);
|
|
195
|
+
uvs.push(normalized, 0);
|
|
196
|
+
progress.push(normalized);
|
|
197
|
+
return positions.length / 2 - 1;
|
|
198
|
+
};
|
|
199
|
+
const addTriangle = (a, b, c) => indices.push(a, b, c);
|
|
200
|
+
const addRoundPoint = (point, at) => {
|
|
201
|
+
const radius = sampleRadius(size, point.p);
|
|
202
|
+
const center = addVertex(point.x, point.y, at);
|
|
203
|
+
const circle = [];
|
|
204
|
+
for (let side = 0; side < RIBBON_CIRCLE_SIDES; side += 1) {
|
|
205
|
+
const angle = side / RIBBON_CIRCLE_SIDES * Math.PI * 2;
|
|
206
|
+
circle.push(addVertex(point.x + Math.cos(angle) * radius, point.y + Math.sin(angle) * radius, at));
|
|
207
|
+
}
|
|
208
|
+
for (let side = 0; side < RIBBON_CIRCLE_SIDES; side += 1) addTriangle(center, circle[side], circle[(side + 1) % RIBBON_CIRCLE_SIDES]);
|
|
209
|
+
};
|
|
210
|
+
for (let i = 0; i < points.length; i += 1) {
|
|
211
|
+
const point = points[i];
|
|
212
|
+
if (!point) continue;
|
|
213
|
+
if (isStrokeCorner(points, i)) addRoundPoint(point, lengths[i] ?? 0);
|
|
214
|
+
if (i === points.length - 1) continue;
|
|
215
|
+
const next = points[i + 1];
|
|
216
|
+
if (!next) continue;
|
|
217
|
+
const dx = next.x - point.x;
|
|
218
|
+
const dy = next.y - point.y;
|
|
219
|
+
const length = Math.hypot(dx, dy);
|
|
220
|
+
if (length < 1e-6) continue;
|
|
221
|
+
const normalX = -dy / length;
|
|
222
|
+
const normalY = dx / length;
|
|
223
|
+
const radius = sampleRadius(size, point.p);
|
|
224
|
+
const leftA = addVertex(point.x + normalX * radius, point.y + normalY * radius, lengths[i] ?? 0);
|
|
225
|
+
const rightA = addVertex(point.x - normalX * radius, point.y - normalY * radius, lengths[i] ?? 0);
|
|
226
|
+
const nextRadius = sampleRadius(size, next.p);
|
|
227
|
+
const leftB = addVertex(next.x + normalX * nextRadius, next.y + normalY * nextRadius, lengths[i + 1] ?? 0);
|
|
228
|
+
const rightB = addVertex(next.x - normalX * nextRadius, next.y - normalY * nextRadius, lengths[i + 1] ?? 0);
|
|
229
|
+
addTriangle(leftA, rightA, leftB);
|
|
230
|
+
addTriangle(rightA, rightB, leftB);
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
positions: new Float32Array(positions),
|
|
234
|
+
indices: new Uint32Array(indices),
|
|
235
|
+
uvs: new Float32Array(uvs),
|
|
236
|
+
progress: new Float32Array(progress)
|
|
237
|
+
};
|
|
238
|
+
}
|
|
150
239
|
/**
|
|
151
240
|
* Distance from a world point to the stroke's polyline, in the shape's local
|
|
152
241
|
* space. Used for hit testing: a hit registers within half the stroke width plus
|
|
@@ -172,4 +261,4 @@ function distanceToStroke(points, local) {
|
|
|
172
261
|
return min;
|
|
173
262
|
}
|
|
174
263
|
//#endregion
|
|
175
|
-
export { buildStrokeOutline, computeDrawBounds, distanceToStroke, sampleRadius, simplifyDrawIndices };
|
|
264
|
+
export { buildStrokeOutline, buildStrokeRibbonGeometry, computeDrawBounds, distanceToStroke, isStrokeCorner, sampleRadius, simplifyDrawIndices };
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* snapshot rides along in every board transaction — so this stays small. */
|
|
20
20
|
const FILE_EXCERPT_MAX_CHARS = 480;
|
|
21
21
|
/** Files above this size are shown as `blank`; we never pull them for a preview. */
|
|
22
|
-
const FILE_EXCERPT_MAX_BYTES =
|
|
22
|
+
const FILE_EXCERPT_MAX_BYTES = 262144;
|
|
23
23
|
/** Frontmatter keys checked for a cover image, in precedence order. */
|
|
24
24
|
const COVER_KEYS = [
|
|
25
25
|
"cover",
|
package/dist/board/geometry.js
CHANGED
|
@@ -409,9 +409,10 @@ function resizeFrame(frame, handle, pointer, minSize = 24, keepAspect = false) {
|
|
|
409
409
|
let width = direction.x !== 0 ? clamp(direction.x * local.x, minSize, Number.POSITIVE_INFINITY) : rect.width;
|
|
410
410
|
let height = direction.y !== 0 ? clamp(direction.y * local.y, minSize, Number.POSITIVE_INFINITY) : rect.height;
|
|
411
411
|
if (keepAspect) {
|
|
412
|
-
if (direction.x !== 0 && direction.y !== 0)
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
if (direction.x !== 0 && direction.y !== 0) {
|
|
413
|
+
if (Math.abs(width / aspect) > height) height = width / aspect;
|
|
414
|
+
else width = height * aspect;
|
|
415
|
+
} else if (direction.x !== 0) height = width / aspect;
|
|
415
416
|
else if (direction.y !== 0) width = height * aspect;
|
|
416
417
|
width = Math.max(minSize, width);
|
|
417
418
|
height = Math.max(minSize, height);
|
package/dist/board/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, Boar
|
|
|
10
10
|
import { BoardNormalizedPoint, BoardScreenOffset, BoardScreenPoint, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CornerResizeHandle, EDGE_RESIZE_HANDLES, FIT_PADDING, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, ResizeHandle, ScreenPoint, Size, VIEWPORT_MARGIN_RATIO, WorldPoint, angleFromCenter, cameraForFocus, cameraForRect, cameraForState, clamp, clampZoom, degToRad, expandRect, fitToContent, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, handlePosition, itemBounds, normalizeRotation, normalizeViewport, normalizedPoint, panBy, pointToWorld, pointsBounds, radToDeg, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, resizeFrame, resizeFrameToSize, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, scaleFrames, screenOffset, screenPoint, screenToWorld, selectionBounds, unionRects, visibleWorldRect, worldOffset, worldPoint, worldRect, worldToScreen, zoomAround } from "./geometry.js";
|
|
11
11
|
import { ResolvedArrow, arrowBounds, arrowFrame, distanceToArrow, resolveArrow, sampleArrow, translateArrow } from "./core/arrow-geometry.js";
|
|
12
12
|
import { CONNECTION_ENDPOINT_GAP, ConnectionIndex, FrameLookup, ResolvedConnection, ResolvedConnectionEndpoint, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitTest, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor } from "./core/connections.js";
|
|
13
|
-
import { buildStrokeOutline, computeDrawBounds, distanceToStroke, sampleRadius, simplifyDrawIndices } from "./core/draw-geometry.js";
|
|
13
|
+
import { StrokeRibbonGeometry, buildStrokeOutline, buildStrokeRibbonGeometry, computeDrawBounds, distanceToStroke, isStrokeCorner, sampleRadius, simplifyDrawIndices } from "./core/draw-geometry.js";
|
|
14
14
|
import { BOARD_EXPORT_MAX_TEXTURES, BoardExportAssetSelection, selectBoardExportAssets } from "./core/export-assets.js";
|
|
15
15
|
import { BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BoardExportPlan, BoardExportPlanInput, BoardExportRegion, boardFrameLookup, exportConnectionBounds, exportItemBounds, normalizeBoardDocument, planBoardExport } from "./core/export-plan.js";
|
|
16
16
|
import { BoardFileSnapshotFacts, BuildSnapshotInput, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FileAvailability, FilePreviewKind, ResolvedCover, availabilityFromError, buildFileExcerpt, buildFileSnapshot, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, formatFileSize, isFileSnapshotFresh, mergeFileSnapshot, readCoverFromFrontmatter, readTitleFromFrontmatter, resolveCoverRef, resolveSpacePath, shouldFetchFileExcerpt, splitFrontmatter } from "./core/file-preview.js";
|
|
@@ -26,4 +26,4 @@ import { BoardAssetSource, BoardPlayableMedia, playableBoardMedia, playableBoard
|
|
|
26
26
|
import { patchBoardAppearance } from "./mutation.js";
|
|
27
27
|
import { applyBoardSemanticCommands, boardDocumentToSemanticCommands } from "./semantic-mutation.js";
|
|
28
28
|
import { featuredTaskArtifact, rankedTaskArtifacts, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot } from "./task.js";
|
|
29
|
-
export { AUTO_BOARD_CONNECTION_ANCHOR, type ArrowShapeProps, type AudioShapeProps, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAssetSource, BoardAudioItem, BoardAudioItemSchema, type BoardCameraFocus, type BoardCameraFocusParams, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, type BoardCameraState, BoardCameraStateSchema, BoardColorEntry, type BoardColorId, BoardColorValue, BoardConnection, BoardConnectionAnchor, BoardConnectionAnchorSchema, BoardConnectionDirection, BoardConnectionEndpoint, BoardConnectionEndpointSchema, BoardConnectionInput, BoardConnectionLine, BoardConnectionPatch, BoardConnectionPatchSchema, BoardConnectionRecord, BoardConnectionRouting, BoardConnectionRoutingConfig, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionSide, BoardConnectionStyle, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardExportAssetSelection, BoardExportPlan, BoardExportPlanInput, BoardExportRegion, BoardExtensionDefinition, BoardExtensionRegistry, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotFacts, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaKind, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardNormalizedPoint, BoardPlayableMedia, BoardPoint, BoardPointSchema, BoardPresetDefinition, BoardRelationSchema, BoardRemoteUrlSchema, BoardScreenOffset, BoardScreenPoint, BoardShapeColors, BoardStyledToolId, BoardTaskArtifact, BoardTaskArtifactSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardToolStyleMap, BoardToolStylePatch, type BoardTrackInterpolation, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, BuildSnapshotInput, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CompositionInput, ConnectionIndex, CornerResizeHandle, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPoint, DrawPointSchema, type DrawShapeProps, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, FileAvailability, FilePreviewKind, FrameLookup, GEO_KINDS, type GeoKind, type GeoShapeProps, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, type HandleDragResult, type ImageShapeProps, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, ProceduralClipInput, QualityProfile, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, RenderBounds, ResizeHandle, ResolvedArrow, ResolvedConnection, ResolvedConnectionEndpoint, ResolvedCover, SampledTrack, ScreenPoint, type ShapeCapabilities, ShapeDefinition, type ShapeGeometry, type ShapeHandle, type ShapeHandleId, type ShapeResizeMode, Size, SpaceFileRef, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, type TextShapeProps, TrackInput, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, type VideoShapeProps, WorldPoint, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
|
|
29
|
+
export { AUTO_BOARD_CONNECTION_ANCHOR, type ArrowShapeProps, type AudioShapeProps, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearance, BoardAppearanceSchema, BoardArrowItem, BoardArrowItemSchema, BoardAssetSource, BoardAudioItem, BoardAudioItemSchema, type BoardCameraFocus, type BoardCameraFocusParams, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, type BoardCameraState, BoardCameraStateSchema, BoardColorEntry, type BoardColorId, BoardColorValue, BoardConnection, BoardConnectionAnchor, BoardConnectionAnchorSchema, BoardConnectionDirection, BoardConnectionEndpoint, BoardConnectionEndpointSchema, BoardConnectionInput, BoardConnectionLine, BoardConnectionPatch, BoardConnectionPatchSchema, BoardConnectionRecord, BoardConnectionRouting, BoardConnectionRoutingConfig, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionSide, BoardConnectionStyle, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocument, BoardDocumentSchema, BoardDrawItem, BoardDrawItemSchema, BoardExportAssetSelection, BoardExportPlan, BoardExportPlanInput, BoardExportRegion, BoardExtensionDefinition, BoardExtensionRegistry, BoardFileItem, BoardFileItemSchema, BoardFileSnapshot, BoardFileSnapshotFacts, BoardFileSnapshotSchema, BoardFrame, BoardFrameItem, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItem, BoardGeoItemSchema, BoardImageItem, BoardImageItemSchema, BoardItem, BoardItemSchema, BoardItemStyle, BoardItemStyleSchema, BoardKnownItem, BoardMediaKind, BoardMediaSnapshot, BoardMediaSnapshotSchema, BoardNormalizedPoint, BoardPlayableMedia, BoardPoint, BoardPointSchema, BoardPresetDefinition, BoardRelationSchema, BoardRemoteUrlSchema, BoardScreenOffset, BoardScreenPoint, BoardShapeColors, BoardStyledToolId, BoardTaskArtifact, BoardTaskArtifactSchema, BoardTaskItem, BoardTaskItemSchema, BoardTaskSnapshot, BoardTaskSnapshotSchema, BoardTextItem, BoardTextItemSchema, BoardToolStyleMap, BoardToolStylePatch, type BoardTrackInterpolation, BoardUnknownItem, BoardVideoItem, BoardVideoItemSchema, BoardViewport, BoardViewportSchema, BoardWorldOffset, BoardWorldPoint, BoardWorldRect, BuildSnapshotInput, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, CompositionInput, ConnectionIndex, CornerResizeHandle, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPoint, DrawPointSchema, type DrawShapeProps, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, FileAvailability, FilePreviewKind, FrameLookup, GEO_KINDS, type GeoKind, type GeoShapeProps, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, type HandleDragResult, type ImageShapeProps, KNOWN_BOARD_ITEM_TYPES, KnownBoardItemType, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, Point, ProceduralClipInput, QualityProfile, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, Rect, RenderBounds, ResizeHandle, ResolvedArrow, ResolvedConnection, ResolvedConnectionEndpoint, ResolvedCover, SampledTrack, ScreenPoint, type ShapeCapabilities, ShapeDefinition, type ShapeGeometry, type ShapeHandle, type ShapeHandleId, type ShapeResizeMode, Size, SpaceFileRef, SpaceFileRefSchema, StrokeRibbonGeometry, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, type TextShapeProps, TrackInput, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, type VideoShapeProps, WorldPoint, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, buildStrokeRibbonGeometry, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isStrokeCorner, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
|
package/dist/board/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { boardImageKeySource, imageAssetKey } from "./image-key.js";
|
|
|
10
10
|
import { DEFAULT_BOARD_APPEARANCE, applyBoardAuthoringSnapshot, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardItemToAuthoringItem } from "./semantic-document.js";
|
|
11
11
|
import { arrowBounds, arrowFrame, distanceToArrow, resolveArrow, sampleArrow, translateArrow } from "./core/arrow-geometry.js";
|
|
12
12
|
import { CONNECTION_ENDPOINT_GAP, anchorPointOnFrame, anchorToWorld, autoConnectionSide, connectionArrowheads, connectionBounds, connectionHitTest, createConnectionIndex, distanceToConnection, pathMidpoint, resolveConnection, worldToAnchor } from "./core/connections.js";
|
|
13
|
-
import { buildStrokeOutline, computeDrawBounds, distanceToStroke, sampleRadius, simplifyDrawIndices } from "./core/draw-geometry.js";
|
|
13
|
+
import { buildStrokeOutline, buildStrokeRibbonGeometry, computeDrawBounds, distanceToStroke, isStrokeCorner, sampleRadius, simplifyDrawIndices } from "./core/draw-geometry.js";
|
|
14
14
|
import { BOARD_EXPORT_MAX_TEXTURES, selectBoardExportAssets } from "./core/export-assets.js";
|
|
15
15
|
import { BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, boardFrameLookup, exportConnectionBounds, exportItemBounds, normalizeBoardDocument, planBoardExport } from "./core/export-plan.js";
|
|
16
16
|
import { FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, availabilityFromError, buildFileExcerpt, buildFileSnapshot, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, formatFileSize, isFileSnapshotFresh, mergeFileSnapshot, readCoverFromFrontmatter, readTitleFromFrontmatter, resolveCoverRef, resolveSpacePath, shouldFetchFileExcerpt, splitFrontmatter } from "./core/file-preview.js";
|
|
@@ -23,4 +23,4 @@ import { getMediaExtension, getMediaResourceTitle, inferBoardMediaKind } from ".
|
|
|
23
23
|
import { playableBoardMedia, playableBoardMediaList, resetBoardPlaybackUrlCache } from "./media-playback.js";
|
|
24
24
|
import { patchBoardAppearance } from "./mutation.js";
|
|
25
25
|
import { applyBoardSemanticCommands, boardDocumentToSemanticCommands } from "./semantic-mutation.js";
|
|
26
|
-
export { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, BoardCameraStateSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardExtensionRegistry, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRelationSchema, BoardRemoteUrlSchema, BoardTaskArtifactSchema, BoardTaskItemSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPointSchema, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, GEO_KINDS, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, KNOWN_BOARD_ITEM_TYPES, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
|
|
26
|
+
export { AUTO_BOARD_CONNECTION_ANCHOR, BOARD_CHANNELS, BOARD_COLORS, BOARD_CONNECTION_DIRECTIONS, BOARD_CONNECTION_LINES, BOARD_CONNECTION_ROUTINGS, BOARD_CONNECTION_SIDES, BOARD_DOCUMENT_KIND, BOARD_EXPORT_DEFAULT_PADDING, BOARD_EXPORT_DEFAULT_SCALE, BOARD_EXPORT_ITEM_WARN_THRESHOLD, BOARD_EXPORT_MAX_EDGE, BOARD_EXPORT_MAX_PIXELS, BOARD_EXPORT_MAX_TEXTURES, BOARD_EXTENSION, BOARD_REMOTE_URL_MAX_LENGTH, BOARD_STROKE_MAX_SIZE, BOARD_STROKE_MIN_SIZE, BOARD_TASK_ARTIFACT_LIMIT, BoardAppearanceSchema, BoardArrowItemSchema, BoardAudioItemSchema, BoardCameraFocusParamsSchema, BoardCameraFocusSchema, BoardCameraStateSchema, BoardConnectionAnchorSchema, BoardConnectionEndpointSchema, BoardConnectionPatchSchema, BoardConnectionRoutingSchema, BoardConnectionSchema, BoardConnectionStyleSchema, BoardConnectionWaypointSchema, BoardDocumentSchema, BoardDrawItemSchema, BoardExtensionRegistry, BoardFileItemSchema, BoardFileSnapshotSchema, BoardFrameItemSchema, BoardFrameSchema, BoardGeoItemSchema, BoardImageItemSchema, BoardItemSchema, BoardItemStyleSchema, BoardMediaSnapshotSchema, BoardPointSchema, BoardRelationSchema, BoardRemoteUrlSchema, BoardTaskArtifactSchema, BoardTaskItemSchema, BoardTaskSnapshotSchema, BoardTextItemSchema, BoardVideoItemSchema, BoardViewportSchema, CONNECTION_ENDPOINT_GAP, CORNER_RESIZE_HANDLES, CORNER_ROTATION_ZONE_WIDTH, DEFAULT_BOARD_APPEARANCE, DEFAULT_BOARD_COLOR, DEFAULT_BOARD_CONNECTION_ROUTING, DEFAULT_BOARD_CONNECTION_STYLE, DEFAULT_BOARD_LIMITS, DEFAULT_BOARD_RELATION, DEFAULT_BOARD_TOOL_STYLES, DrawPointSchema, EDGE_RESIZE_HANDLES, FILE_EXCERPT_MAX_BYTES, FILE_EXCERPT_MAX_CHARS, FIT_PADDING, FULL_CAPABILITIES, GEO_KINDS, HANDLE_DIRECTION, HANDLE_HIT_RADIUS, KNOWN_BOARD_ITEM_TYPES, MAX_BOARD_ZOOM, MIN_BOARD_ZOOM, MIN_ITEM_SIZE, RESIZE_HANDLES, ROTATION_HANDLE_OFFSET, SpaceFileRefSchema, TEXT_FONT_FAMILY, TEXT_FONT_SIZE, TEXT_LINE_HEIGHT, TEXT_MAX_FONT_SIZE, TEXT_MIN_FONT_SIZE, UNKNOWN_BOARD_ITEM_TYPE, VIEWPORT_MARGIN_RATIO, anchorPointOnFrame, anchorToWorld, angleFromCenter, applyBoardAuthoringSnapshot, applyBoardSemanticCommands, arrowBounds, arrowFrame, autoConnectionSide, availabilityFromError, boardAuthoringItemToDocumentItem, boardAuthoringSnapshotToDocument, boardColorCssVar, boardDocumentToSemanticCommands, boardFrameLookup, boardImageKeySource, boardItemToAuthoringItem, boardTextLineHeight, buildFallbackShapeColors, buildFileExcerpt, buildFileSnapshot, buildStrokeOutline, buildStrokeRibbonGeometry, cameraForFocus, cameraForRect, cameraForState, clamp, clampBoardStrokeSize, clampBoardTextFontSize, clampZoom, compileComposition, composition, computeDrawBounds, connectionArrowheads, connectionBounds, connectionHitTest, connectionItemIds, connectionOtherItemId, connectionTouchesItem, createBoardConnection, createBoardExtensionRegistry, createBoardToolStyles, createConnectionIndex, definitionForItem, degToRad, distanceToArrow, distanceToConnection, distanceToStroke, expandRect, exportConnectionBounds, exportItemBounds, featuredTaskArtifact, fileBaseName, filePreviewKind, filePreviewMemoKey, filePreviewScope, fileTypeLabel, fitToContent, flipBoardConnection, formatFileSize, frameContainsPoint, frameCornerRotationHandleAt, frameCorners, frameEdgeHandleAt, frameHandlePosition, frameRayIntersection, frameRect, getMediaExtension, getMediaResourceTitle, getShapeDefinition, handlePosition, imageAssetKey, inferBoardMediaKind, isBoardColorId, isBoardPath, isFileBackedItem, isFileSnapshotFresh, isGeoKind, isMediaItem, isPublicBoardRemoteAddress, isStrokeCorner, isUnknownItem, itemBounds, measureBoardText, mergeFileSnapshot, normalizeBoardConnectionStyle, normalizeBoardDocument, normalizeBoardRemoteUrl, normalizeRotation, normalizeViewport, normalizedPoint, panBy, parseBoardDocument, parseBoardItemLoose, parseBoardManifest, patchBoardAppearance, pathMidpoint, pickBoardColor, planBoardExport, playableBoardMedia, playableBoardMediaList, pointToWorld, pointsBounds, proceduralClip, radToDeg, rankedTaskArtifacts, readCoverFromFrontmatter, readTitleFromFrontmatter, rectCenter, rectContainsPoint, rectForCameraFocus, rectsIntersect, registerShapeDefinition, resetBoardPlaybackUrlCache, resizeFrame, resizeFrameToSize, resizeModeForCapabilities, resolveArrow, resolveBoardColor, resolveConnection, resolveCoverRef, resolveSpacePath, rotateFrames, rotatePointAround, rotationHandleAnchor, rotationHandlePosition, sampleArrow, sampleCompositionTracks, sampleEasing, sampleRadius, sampleTrack, scaleFrames, screenOffset, screenPoint, screenToWorld, selectBoardExportAssets, selectionBounds, serializeBoardManifest, setBoardTextMeasurer, shapeBounds, shapeCapabilities, shapeHandles, shapeHitTest, shapeResizeMode, shouldFetchFileExcerpt, simplifyDrawIndices, splitFrontmatter, taskArtifactPreviewUrl, taskArtifacts, taskRunToBoardTaskSnapshot, track, translateArrow, unionRects, unknownRealType, unknownShapeDefinition, visibleWorldRect, withResolvedConnections, worldOffset, worldPoint, worldRect, worldToAnchor, worldToScreen, zoomAround };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildStrokeRibbonGeometry, computeDrawBounds } from "../../core/draw-geometry.js";
|
|
2
2
|
import { pickBoardColor } from "../../core/palette.js";
|
|
3
3
|
import { positionShell } from "./base-card-renderer.js";
|
|
4
4
|
import { drawFarStroke } from "./far-plate.js";
|
|
5
|
-
import { Container,
|
|
5
|
+
import { Container, Mesh, MeshGeometry, Texture } from "pixi.js";
|
|
6
6
|
//#region src/board/render/renderers/draw-card-renderer.ts
|
|
7
7
|
const partsByContainer = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
function sync(container, item, context) {
|
|
@@ -25,21 +25,22 @@ function sync(container, item, context) {
|
|
|
25
25
|
parts.sig = sig;
|
|
26
26
|
parts.points = item.points;
|
|
27
27
|
parts.baseWidth = computeDrawBounds(item.points, item.size).width;
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
28
|
+
const ribbon = buildStrokeRibbonGeometry(item.points, item.size);
|
|
29
|
+
const geometry = new MeshGeometry({
|
|
30
|
+
positions: ribbon.positions,
|
|
31
|
+
indices: ribbon.indices
|
|
32
|
+
});
|
|
33
|
+
const nextStroke = new Mesh({
|
|
34
|
+
geometry,
|
|
35
|
+
texture: Texture.WHITE
|
|
36
|
+
});
|
|
37
|
+
nextStroke.tint = color.stroke;
|
|
38
|
+
nextStroke.alpha = selected || hovered ? 1 : .92;
|
|
39
|
+
const previous = parts.stroke;
|
|
40
|
+
parts.stroke = nextStroke;
|
|
41
|
+
parts.root.removeChild(previous);
|
|
42
|
+
previous.destroy({ children: true });
|
|
43
|
+
parts.root.addChild(nextStroke);
|
|
43
44
|
}
|
|
44
45
|
const previewScale = item.frame.width / Math.max(1e-4, parts.baseWidth);
|
|
45
46
|
parts.stroke.scale.set(Number.isFinite(previewScale) ? previewScale : 1);
|
|
@@ -49,7 +50,13 @@ const drawCardRenderer = {
|
|
|
49
50
|
canRender: (item) => item.type === "draw",
|
|
50
51
|
create: (item, context) => {
|
|
51
52
|
const root = new Container();
|
|
52
|
-
const stroke = new
|
|
53
|
+
const stroke = new Mesh({
|
|
54
|
+
geometry: new MeshGeometry({
|
|
55
|
+
positions: /* @__PURE__ */ new Float32Array(),
|
|
56
|
+
indices: /* @__PURE__ */ new Uint32Array()
|
|
57
|
+
}),
|
|
58
|
+
texture: Texture.WHITE
|
|
59
|
+
});
|
|
53
60
|
root.addChild(stroke);
|
|
54
61
|
partsByContainer.set(root, {
|
|
55
62
|
root,
|
|
@@ -228,7 +228,7 @@ function sync(container, item, context) {
|
|
|
228
228
|
if (detail === "plate") return;
|
|
229
229
|
const title = item.snapshot?.title || fileBaseName(item.ref.path);
|
|
230
230
|
const excerpt = item.snapshot?.excerpt ?? "";
|
|
231
|
-
const innerWidth = Math.max(1, width -
|
|
231
|
+
const innerWidth = Math.max(1, width - 20);
|
|
232
232
|
const textSig = [
|
|
233
233
|
title,
|
|
234
234
|
excerpt,
|
|
@@ -6,7 +6,6 @@ import { drawFarPlate } from "./far-plate.js";
|
|
|
6
6
|
import { Container, Graphics, Text } from "pixi.js";
|
|
7
7
|
//#region src/board/render/renderers/geo-card-renderer.ts
|
|
8
8
|
const RADIUS = 8;
|
|
9
|
-
const LABEL_PADDING = 8;
|
|
10
9
|
const partsByContainer = /* @__PURE__ */ new WeakMap();
|
|
11
10
|
function traceOutline(graphics, geo, width, height) {
|
|
12
11
|
switch (geo) {
|
|
@@ -68,7 +67,7 @@ function sync(container, item, context) {
|
|
|
68
67
|
parts.label.visible = item.text.length > 0;
|
|
69
68
|
parts.label.style.fill = color.label;
|
|
70
69
|
}
|
|
71
|
-
syncTextWrapWidth(parts.label, parts, Math.max(1, width -
|
|
70
|
+
syncTextWrapWidth(parts.label, parts, Math.max(1, width - 16), resizing);
|
|
72
71
|
parts.label.position.set(width / 2, height / 2);
|
|
73
72
|
}
|
|
74
73
|
const geoCardRenderer = {
|
|
@@ -141,12 +141,11 @@ function drawStateMark(graphics, surface, cx, cy, color) {
|
|
|
141
141
|
}
|
|
142
142
|
function drawFailedBadge(graphics, width, color, context) {
|
|
143
143
|
const cx = Math.max(12, width - 12);
|
|
144
|
-
|
|
145
|
-
graphics.circle(cx, cy, 8).fill({
|
|
144
|
+
graphics.circle(cx, 12, 8).fill({
|
|
146
145
|
color: context.palette.bg,
|
|
147
146
|
alpha: .72
|
|
148
147
|
});
|
|
149
|
-
graphics.moveTo(cx - 2.5,
|
|
148
|
+
graphics.moveTo(cx - 2.5, 9.5).lineTo(cx + 2.5, 14.5).moveTo(cx + 2.5, 9.5).lineTo(cx - 2.5, 14.5).stroke({
|
|
150
149
|
color,
|
|
151
150
|
width: 1.5,
|
|
152
151
|
alpha: .96,
|
|
@@ -214,7 +213,7 @@ function sync(container, item, context) {
|
|
|
214
213
|
width: selected ? 2 : 1,
|
|
215
214
|
alpha: selected ? .96 : .82
|
|
216
215
|
});
|
|
217
|
-
parts.clip.clear().roundRect(1, 1, frame.width, frame.height,
|
|
216
|
+
parts.clip.clear().roundRect(1, 1, frame.width, frame.height, 3).fill({ color: 16777215 });
|
|
218
217
|
parts.previewBg.clear().rect(frame.x, frame.y, frame.width, frame.height).fill({
|
|
219
218
|
color: context.palette.hover,
|
|
220
219
|
alpha: .5
|
|
@@ -226,8 +225,8 @@ function sync(container, item, context) {
|
|
|
226
225
|
drawAudioWaveform(parts.previewArt, item.taskRunId, {
|
|
227
226
|
x: frame.x + PADDING,
|
|
228
227
|
y: frame.y + PADDING,
|
|
229
|
-
width: Math.max(1, frame.width -
|
|
230
|
-
height: Math.max(1, frame.height -
|
|
228
|
+
width: Math.max(1, frame.width - 24),
|
|
229
|
+
height: Math.max(1, frame.height - 24 - bottomInset)
|
|
231
230
|
}, context.colors.brand.stroke);
|
|
232
231
|
}
|
|
233
232
|
if (full && (artifact?.type === "audio" || artifact?.type === "video" && texture)) drawPlayBadge(parts.previewArt, frame, context);
|
|
@@ -264,9 +263,9 @@ function sync(container, item, context) {
|
|
|
264
263
|
if (textSig !== parts.textSig) {
|
|
265
264
|
parts.textSig = textSig;
|
|
266
265
|
parts.body.style.fill = surface === "failed" ? color : context.palette.text;
|
|
267
|
-
fitTextToLines(parts.body, bodyText, kind === "text" ? Math.max(1, Math.floor((height -
|
|
266
|
+
fitTextToLines(parts.body, bodyText, kind === "text" ? Math.max(1, Math.floor((height - 24 - (showMeta ? META_HEIGHT : 0)) / 16)) : 1, Math.max(24, width - 24));
|
|
268
267
|
parts.meta.style.fill = context.palette.text;
|
|
269
|
-
fitTextToLines(parts.meta, metaText, 1, Math.max(24, width -
|
|
268
|
+
fitTextToLines(parts.meta, metaText, 1, Math.max(24, width - 24));
|
|
270
269
|
}
|
|
271
270
|
parts.body.visible = full && Boolean(bodyText);
|
|
272
271
|
parts.meta.visible = showMeta;
|
|
@@ -41,10 +41,11 @@ const textCardRenderer = {
|
|
|
41
41
|
const root = new Container();
|
|
42
42
|
const resolution = textResolutionForZoom(context.zoom);
|
|
43
43
|
const color = pickBoardColor(context.colors, item.type === "text" ? item.color || "neutral" : "neutral", context.colorScheme);
|
|
44
|
+
const ink = item.type === "text" && (item.color === "neutral" || !item.color) ? context.palette.text : color.stroke;
|
|
44
45
|
const body = new Text({
|
|
45
46
|
text: "",
|
|
46
47
|
style: {
|
|
47
|
-
fill:
|
|
48
|
+
fill: ink,
|
|
48
49
|
fontFamily: BOARD_FONT_STACK,
|
|
49
50
|
fontSize: TEXT_FONT_SIZE,
|
|
50
51
|
fontWeight: "500",
|
|
@@ -40,7 +40,7 @@ function sync(container, item, context) {
|
|
|
40
40
|
width: selected ? 2 : 1,
|
|
41
41
|
alpha: .8
|
|
42
42
|
});
|
|
43
|
-
parts.box.roundRect(6, 6, width - 12, height - 12,
|
|
43
|
+
parts.box.roundRect(6, 6, width - 12, height - 12, 6).stroke({
|
|
44
44
|
color: context.palette.muted,
|
|
45
45
|
width: 1,
|
|
46
46
|
alpha: .4
|
|
@@ -24,7 +24,7 @@ function textZoomBucket(zoom) {
|
|
|
24
24
|
/** Effective text resolution for a given camera zoom. */
|
|
25
25
|
function textResolutionForZoom(zoom) {
|
|
26
26
|
const bucket = textZoomBucket(zoom);
|
|
27
|
-
return Math.min(getBoardResolution() * Math.max(1, bucket),
|
|
27
|
+
return Math.min(getBoardResolution() * Math.max(1, bucket), 6);
|
|
28
28
|
}
|
|
29
29
|
/** Update a Pixi text texture only when zoom crosses a resolution bucket. */
|
|
30
30
|
function syncTextResolution(text, state, zoom) {
|
|
@@ -62,8 +62,9 @@ function sync(parts, context) {
|
|
|
62
62
|
parts.sprite.destroy();
|
|
63
63
|
previousTexture.destroy(true);
|
|
64
64
|
}
|
|
65
|
+
const texture = buildGridTexture(context, size, palette.border, opacity, kind);
|
|
65
66
|
parts.sprite = new TilingSprite({
|
|
66
|
-
texture
|
|
67
|
+
texture,
|
|
67
68
|
width,
|
|
68
69
|
height
|
|
69
70
|
});
|
package/dist/chunks/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CreateInvitationInput, $i as AppContentKind, $n as SpaceFsCompleteUploadResponse, $r as UserRulesResponse, $t as ReferenceDirection, Ai as BoardAwarenessUpdatedEvent$1, An as SpaceActivityResponse, Ao as
|
|
1
|
+
import { $ as CreateInvitationInput, $i as AppContentKind, $n as SpaceFsCompleteUploadResponse, $r as UserRulesResponse, $t as ReferenceDirection, Aa as BoardPlaybackCommand, Ai as BoardAwarenessUpdatedEvent$1, An as SpaceActivityResponse, Ao as Usage, Ar as SpacePendingDiffSummary, Ba as BoardAuthoringReadInput, Br as SpaceTurnAuthorFilter, Bt as Permission, Ci as GenerationModelDeclaration, Cr as SpaceInvitationListResponse, Ct as LabelAssignmentRecord, Dn as SpaceAccessPolicy, Ea as BoardCreateInput, Eo as CreateSpaceCompletionInput, Er as SpaceMember, Et as LabelListItem, Fa as BoardSummary, Fr as SpaceRole, G as CheckpointDiffFileResponse, Ga as BoardSemanticMutation, H as Channel, Hi as SessionTurnPatchEvent, Hn as SpaceCommerceProduct, In as SpaceCheckpointDetailResponse, Io as RequestSource, Jn as SpaceConfigUpdateResponse, Jr as UserActivityQuery, Ki as BoardAwarenessUpdate, Kn as SpaceConfigInput, Kr as TaskRunDetailResponse, Kt as PublicUserPageResponse, Li as RealtimePatchOperation, Ln as SpaceCommerceBenefit, Mi as BoardPlaybackChangedEvent$1, Mo as ContentBlock, Mt as ModelCatalogEntry, Na as BoardPlaybackSnapshot, Nr as SpacePublicProfile, Oo as SpaceCompletionResult, Or as SpaceModListItem, Ot as LabelResourceType, Pr as SpaceRecord, Pt as PaletteOverviewResponse, Q as ClaimReferralResponse, Qn as SpaceFsCompleteUploadInput, Qr as UserProfile, Qt as ReferenceAggregateResponse, Rn as SpaceCommerceBuyerProfile, Rt as PatchResourceLabelsInput, Si as GenerationContentBlock, Sn as SessionTurnsPaginatedResponse, Ta as BoardCapabilities, Un as SpaceCommerceProductBenefitBinding, Ut as PromptTemplateCatalogResponse, Va as BoardAuthoringSnapshot, Vn as SpaceCommerceOrder, Wr as SpaceUsageResponse, Wt as PublicReferral, X as CheckpointDiffSummary, Xn as SpaceDefaultResponse, Yn as SpaceCreateResponse, Z as CheckpointRecord, Zn as SpaceEnvInput, Zr as UserActivityResponse, Zt as ReferenceAggregateGroupBy, _n as SessionTurnIndexResponse, _t as InvitationDetail, a as WebsocketClientOptions, ai as ChannelHealth, an as ReferralDashboard, at as CreateSpaceSessionInput, ba as NavigationCall, bn as SessionTurnStreamSnapshotResponse, bo as SpaceTurnsResponse, br as SpaceFsUploadResponse, cr as SpaceFsMoveInput, ct as CronJobUpdatePatch, d as BatchUserProfilesResponse, da as DesktopCommandError, en as ReferenceKind, et as CreateInvitationResponse, fa as DesktopCommandRecord, fr as SpaceFsReadFilesResponse, gn as SessionRecord, go as SessionForkRecord, hn as SessionMessagesResponse, ho as MessageRecord, ht as GlobalSearchType, ii as ChannelConfig, it as CreateSpacePromptResponse, ji as BoardChangedEvent$1, jo as BillingPayload, jr as SpacePresenceSnapshot, jt as MeResponse, ka as BoardMutationReceipt, ko as SpaceCompletionStreamEvent, kr as SpacePendingDiffFileResponse, l as AcceptInvitationResponse, la as DesktopCommand, lr as SpaceFsPreparingFile, lt as CursorPageInfo, mn as SessionMessagesPaginatedResponse, mo as SpacePublicEndpoints, ni as UserSessionsResponse, nn as ReferenceQueryableType, nr as SpaceFsCreateUploadResponse, pa as DesktopCommandStatus, pn as SessionMessageResponse, pr as SpaceFsTreeResponse, pt as GlobalSearchResponse, qi as AppArtifactDescriptor, qn as SpaceConfigResponse, qr as TaskRunRecord, r as WebsocketClient, rt as CreateSpacePromptInput, s as WebsocketEventPayload, sr as SpaceFsFileResponse, st as CronJobRecord, tn as ReferenceQueryResponse, tr as SpaceFsCreateUploadInput, tt as CreateSpaceInput, vn as SessionTurnResponse, wn as SkillCatalogResponse, wt as LabelItemsResponse, xa as NavigationLaunch, xn as SessionTurnWindowResponse, xr as SpaceFsWriteFileInput, yn as SessionTurnSignedUrlsResponse, yo as SessionTurnRecord, zr as SpaceSessionsResponse, zt as PatchResourceLabelsResponse } from "./websocket.js";
|
|
2
2
|
import { n as CohubEnvironment } from "./environment.js";
|
|
3
3
|
import { a as VoiceInputCreateOptions } from "./voice-input.js";
|
|
4
4
|
//#region ../protocol/dist/model/status.d.ts
|
|
@@ -200,6 +200,67 @@ type PublicFileUrlResponse = {
|
|
|
200
200
|
url: string;
|
|
201
201
|
};
|
|
202
202
|
//#endregion
|
|
203
|
+
//#region ../protocol/dist/app-navigation.d.ts
|
|
204
|
+
declare const APP_NAVIGATION_PROTOCOL = "cohub.app.navigation";
|
|
205
|
+
declare const APP_NAVIGATION_VERSION = 1;
|
|
206
|
+
type AppNavigationLaunch = NavigationLaunch;
|
|
207
|
+
type AppNavigationTarget = {
|
|
208
|
+
kind: "app";
|
|
209
|
+
/** Public App URL, app:// ref, or a stable App id. */
|
|
210
|
+
ref: string;
|
|
211
|
+
launch?: AppNavigationLaunch;
|
|
212
|
+
} | {
|
|
213
|
+
kind: "file";
|
|
214
|
+
spaceId: string;
|
|
215
|
+
path: string;
|
|
216
|
+
view?: {
|
|
217
|
+
line?: number;
|
|
218
|
+
column?: number;
|
|
219
|
+
};
|
|
220
|
+
} | {
|
|
221
|
+
kind: "session";
|
|
222
|
+
spaceId: string;
|
|
223
|
+
sessionId: string;
|
|
224
|
+
turnId?: string;
|
|
225
|
+
} | {
|
|
226
|
+
kind: "task";
|
|
227
|
+
spaceId: string;
|
|
228
|
+
taskRunId: string;
|
|
229
|
+
} | {
|
|
230
|
+
kind: "checkpoint";
|
|
231
|
+
spaceId: string;
|
|
232
|
+
checkpointId: string;
|
|
233
|
+
} | {
|
|
234
|
+
kind: "cronjob";
|
|
235
|
+
spaceId: string;
|
|
236
|
+
cronjobId: string;
|
|
237
|
+
};
|
|
238
|
+
type AppNavigationCall = NavigationCall;
|
|
239
|
+
type AppNavigationOpenMessage = {
|
|
240
|
+
protocol: typeof APP_NAVIGATION_PROTOCOL;
|
|
241
|
+
version: typeof APP_NAVIGATION_VERSION;
|
|
242
|
+
type: "open";
|
|
243
|
+
requestId: string;
|
|
244
|
+
target: AppNavigationTarget;
|
|
245
|
+
call?: AppNavigationCall;
|
|
246
|
+
};
|
|
247
|
+
type AppNavigationOpenResponse = {
|
|
248
|
+
protocol: typeof APP_NAVIGATION_PROTOCOL;
|
|
249
|
+
version: typeof APP_NAVIGATION_VERSION;
|
|
250
|
+
type: "open.result";
|
|
251
|
+
requestId: string;
|
|
252
|
+
handled: boolean;
|
|
253
|
+
reason?: "unsupported" | "invalid_target" | "inaccessible" | "timeout";
|
|
254
|
+
call?: {
|
|
255
|
+
ok: true;
|
|
256
|
+
result?: unknown;
|
|
257
|
+
} | {
|
|
258
|
+
ok: false;
|
|
259
|
+
code: string;
|
|
260
|
+
message: string;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
//#endregion
|
|
203
264
|
//#region ../protocol/dist/app-promotion-stats.d.ts
|
|
204
265
|
declare const APP_PROMOTION_EVENT_KEYS: readonly ["landing", "ready", "registration_completed", "paywall_viewed", "checkout_started"];
|
|
205
266
|
type AppPromotionEventKey = typeof APP_PROMOTION_EVENT_KEYS[number];
|
|
@@ -269,6 +330,8 @@ type AppContextChangedListener = (context: AppRuntimeContext) => void;
|
|
|
269
330
|
interface AppRuntimeTransport {
|
|
270
331
|
request<T>(message: Record<string, unknown>, options?: AppRuntimeRequestOptions): Promise<T | null>;
|
|
271
332
|
subscribeContextChanged?: (listener: AppContextChangedListener) => () => void;
|
|
333
|
+
/** Whether this transport can address the embedding Cohub workspace. */
|
|
334
|
+
supportsNavigation?: boolean;
|
|
272
335
|
}
|
|
273
336
|
/**
|
|
274
337
|
* Bridge-mode transport: posts messages to `window.parent` (the Cohub host
|
|
@@ -276,6 +339,7 @@ interface AppRuntimeTransport {
|
|
|
276
339
|
* Behaviorally identical to the previous module-level `request()` helper.
|
|
277
340
|
*/
|
|
278
341
|
declare class ParentBridgeTransport implements AppRuntimeTransport {
|
|
342
|
+
readonly supportsNavigation = true;
|
|
279
343
|
private trustedParentOrigin;
|
|
280
344
|
private contextListeners;
|
|
281
345
|
private contextListener;
|
|
@@ -293,6 +357,7 @@ declare class ParentBridgeTransport implements AppRuntimeTransport {
|
|
|
293
357
|
* checkout state is not available on the app's own origin in broker mode.
|
|
294
358
|
*/
|
|
295
359
|
declare class PopupBrokerTransport implements AppRuntimeTransport {
|
|
360
|
+
readonly supportsNavigation = false;
|
|
296
361
|
private readonly brokerOrigin;
|
|
297
362
|
private readonly appId?;
|
|
298
363
|
private readonly getAppId?;
|
|
@@ -344,6 +409,7 @@ declare class AppRuntimeApi {
|
|
|
344
409
|
private writeStoredGrants;
|
|
345
410
|
context(): Promise<AppRuntimeContext | null>;
|
|
346
411
|
onContextChanged(listener: AppContextChangedListener): () => void;
|
|
412
|
+
navigationOpen(target: AppNavigationTarget, call?: AppNavigationCall): Promise<AppNavigationOpenResponse>;
|
|
347
413
|
getAccessToken(options?: {
|
|
348
414
|
forceRefresh?: boolean;
|
|
349
415
|
}): Promise<string | null>;
|
|
@@ -2350,4 +2416,4 @@ declare class CohubHttpClient {
|
|
|
2350
2416
|
}
|
|
2351
2417
|
declare const createHttpClient: (options?: CohubClientOptions) => CohubHttpClient;
|
|
2352
2418
|
//#endregion
|
|
2353
|
-
export { AppUpdateInput as $, sanitizeAccessToken as $n, BuildSpacePathInput as $t, WaitForUiCommandOptions as A, PublicAssetMimeType as An,
|
|
2419
|
+
export { AppUpdateInput as $, sanitizeAccessToken as $n, BuildSpacePathInput as $t, WaitForUiCommandOptions as A, PublicAssetMimeType as An, CreateGenerationTaskResponse as Ar, WorkViewSource as At, AppPromotionCreateInput as B, ModelsApi as Bn, BoardEventName as Bt, DesktopCommandsApi as C, createSessionPatchReducer as Cn, PublicFileListEntry as Cr, WorkRecord as Ct, UiCommandStatus as D, SearchApi as Dn, PublicFileUrlResponse as Dr, WorkTargetType as Dt, UiCommandRecord as E, ReferencesApi as En, PublicFileUploadPlanEntry as Er, WorkStatus as Et, AppDetailResponse as F, UploadChatAttachmentInput as Fn, ModelStatusEntry as Fr, UserApi as Ft, AppPromotionStatsResponse as G, Fetch as Gn, SpaceChannelBindingRecord as Gt, AppPromotionProvider as H, CronJobsApi as Hn, BoardSubscriptionHandlers as Ht, AppExtractedPageMeta as I, UploadChatImageAttachmentInput as In, ModelStatusResponse as Ir, TasksApi as It, AppRecord as J, HttpTransport as Jn, SpacePublicFilesApi as Jt, AppPublicOwnerRecord as K, HttpError as Kn, SpaceClient as Kt, AppGetResponse as L, UploadPublicAssetInput as Ln, BoardAwarenessUpdatedEvent as Lt, AppContent as M, PublicAssetUploadProgress as Mn, GenerationUsageBilling as Mr, WorkVisibility as Mt, AppContentDownload as N, PublicAssetUploadProtocol as Nn, ListGenerationModelsResponse as Nr, ReferralsApi as Nt, UiCommandsApi as O, CreatePublicAssetUploadInput as On, SpaceStartupResponse as Or, WorkUpdateInput as Ot, AppCreateInput as P, PublicAssetsApi as Pn, PublicGenerationDeclaration as Pr, UsersApi as Pt, AppTargetType as Q, matchesUnauthorizedErrorToken as Qn, BuildSpaceInvitePathInput as Qt, AppMeta as R, SkillsApi as Rn, BoardChangedEvent as Rt, CreateUiCommandInput as S, SessionPatchStatus as Sn, PublicFileCreateUploadResponse as Sr, WorkPublicSpaceRecord as St, UiCommandError as T, ReferenceResourceSelector as Tn, PublicFileUploadEntryInput as Tr, WorkSessionResponse as Tt, AppPromotionProviderStatus as U, ChannelsApi as Un, SessionEventName as Ut, AppPromotionEventResponse as V, GenerationsApi as Vn, BoardPlaybackChangedEvent as Vt, AppPromotionRecord as W, CohubClientOptions as Wn, SessionSubscriptionHandlers as Wt, AppSessionResponse as X, UnauthorizedContext as Xn, SpacesApi as Xt, AppResolveResponse as Y, RawHttpResponse as Yn, SpaceTurnListOptions as Yt, AppStatus as Z, joinApiUrl as Zn, WebSocketConnectionState as Zt, WorkCommerceEntitlementsResponse as _, parseAssistantMessageCommit as _n, AppNavigationLaunch as _r, WorkPromotionProvider as _t, AppCommerceCreditConsumeResponse as a, GenerationStreamErrorEvent as an, AppRuntimeCheckoutStatus as ar, AppsApi as at, WorkCommercePurchaseResponse as b, SessionPatchReducer as bn, AppNavigationTarget as br, WorkPromotionStatsResponse as bt, AppCommerceEntitlementsResponse as c, GenerationStreamIntermediateMessage as cn, AppRuntimeModeConfig as cr, WorkContentDownload as ct, AppCommercePurchaseResponse as d, GenerationStreamStateEvent as dn, ParentBridgeTransport as dr, WorkExtractedPageMeta as dt, PublicInviteApi as en, AppContextChangedListener as er, AppVersionRecord as et, WorkCommerceApi as f, GenerationStreamSubscribeOptions as fn, PopupBrokerTransport as fr, WorkGetResponse as ft, WorkCommerceEntitlement as g, createSessionGenerationStreamClient as gn, AppNavigationCall as gr, WorkPromotionEventResponse as gt, WorkCommerceCreditConsumeStatus as h, SessionGenerationStreamClient as hn, resolveAppTransport as hr, WorkPromotionCreateInput as ht, AppCommerceCheckoutStatus as i, GenerationStreamCommitEvent as in, AppRuntimeCheckoutState as ir, AppVisibility as it, AppAuthorizeResponse as j, PublicAssetPurpose as jn, GenerationTaskResult as jr, WorkViewStatsResponse as jt, WaitForDesktopCommandOptions as k, CreatePublicAssetUploadResponse as kn, CreateGenerationTaskRequest as kr, WorkVersionRecord as kt, AppCommerceOrder as l, GenerationStreamLifecycleEvent as ln, AppRuntimeRequestOptions as lr, WorkCreateInput as lt, WorkCommerceCreditConsumeResponse as m, GenerationStreamTurnUpdatedEvent as mn, createSlugAppIdResolver as mr, WorkPresentationMeta as mt, createHttpClient as n, buildSpacePath as nn, AppRuntimeApi as nr, AppViewStatsResponse as nt, AppCommerceCreditConsumeStatus as o, GenerationStreamEvent as on, AppRuntimeContext as or, WorkAuthorizeResponse as ot, WorkCommerceCheckoutStatus as p, GenerationStreamSubscriptionHandlers as pn, createAppRuntime as pr, WorkMeta as pt, AppPublicSpaceRecord as q, HttpTraceContext as qn, SpaceEventName as qt, AppCommerceApi as r, AssistantMessageCommit as rn, AppRuntimeAuthorizationResult as rr, AppViewerGrantRecord as rt, AppCommerceEntitlement as s, GenerationStreamFinalizedEvent as sn, AppRuntimeInvocationContext as sr, WorkContent as st, CohubHttpClient as t, buildSpaceInvitePath as tn, AppIdResolver as tr, AppViewSource as tt, AppCommerceProductResolveResponse as u, GenerationStreamOutOfSyncEvent as un, AppRuntimeTransport as ur, WorkDetailResponse as ut, WorkCommerceOrder as v, SessionPatchApplyInput as vn, AppNavigationOpenMessage as vr, WorkPromotionProviderStatus as vt, UiCommand as w, SessionAccessApi as wn, PublicFileListResponse as wr, WorkResolveResponse as wt, CreateDesktopCommandInput as x, SessionPatchState as xn, PublicFileCreateUploadInput as xr, WorkPublicOwnerRecord as xt, WorkCommerceProductResolveResponse as y, SessionPatchApplyResult as yn, AppNavigationOpenResponse as yr, WorkPromotionRecord as yt, AppPresentationMeta as z, PromptsApi as zn, BoardClient as zt };
|