Files
sim/packages/workflow-renderer/package.json
T
Waleed ca0a7ff0c2 feat(rich-markdown-editor): live media embeds + shared embed detection util (#5290)
* feat(rich-markdown-editor): live media embeds + shared embed detection util

- Extract getEmbedInfo/EmbedInfo into pure @sim/utils/media-embed (carries the
  PR #5288 dropbox host-validation hardening); repoint the note block to it
- Add LinkEmbed: a ProseMirror widget-decoration plugin that renders media
  players (YouTube, Vimeo, Spotify, Dropbox, …) beneath standalone links in the
  rich markdown editor, in both editing and read-only surfaces. The document
  stays a plain markdown link, so markdown round-trips stay lossless
- Gate embeds behind an opt-in flag (on for the file editor, off for modal fields)
- Polish the knowledge chunk editor to the file editor's centered reading frame
  while keeping it plaintext for exact embedding fidelity

* fix(media-embed): gate provider detection on parsed hostname

Validate each platform against the URL's parsed host before extracting, so a
look-alike host (youtube.com.evil.com) or a provider domain in the path
(evil.com/youtube.com/...) can no longer render a trusted-looking embed. Dropbox
is no longer a special case — all providers share the hostMatches gate. Also
consolidates the five Spotify branches and orders Twitch clip before channel.

* fix(rich-markdown-editor): unique widget key per duplicate embed URL

Key embed widgets by source + per-source occurrence index so two standalone
links to the same URL render as two distinct players instead of collapsing into
one, while keeping the key stable across unrelated edits (no iframe reload).

* refactor(media-embed): tighten comments and drop a redundant guard

- Drop the redundant paragraph type-check in getStandaloneLinkHref (the caller
  already filters to paragraphs) and rename the param for clarity
- Remove an inline comment and a TSDoc sentence that restated logic documented
  elsewhere
2026-06-30 11:27:42 -07:00

50 lines
1.1 KiB
JSON

{
"name": "@sim/workflow-renderer",
"version": "0.1.0",
"private": true,
"sideEffects": [
"**/*.css",
"**/note-block-view.tsx"
],
"type": "module",
"license": "Apache-2.0",
"engines": {
"bun": ">=1.2.13",
"node": ">=20.0.0"
},
"exports": {
".": {
"types": "./src/index.ts",
"default": "./src/index.ts"
}
},
"scripts": {
"type-check": "tsc --noEmit",
"lint": "biome check --write --unsafe .",
"lint:check": "biome check .",
"format": "biome format --write .",
"format:check": "biome format ."
},
"peerDependencies": {
"@sim/emcn": "workspace:*",
"@sim/utils": "workspace:*",
"lucide-react": ">=0.479.0",
"react": "^19",
"reactflow": "^11.11.4",
"remark-breaks": "^4.0.0",
"streamdown": ">=2.5.0"
},
"devDependencies": {
"@sim/emcn": "workspace:*",
"@sim/tsconfig": "workspace:*",
"@sim/utils": "workspace:*",
"@types/react": "^19",
"lucide-react": "^0.479.0",
"react": "19.2.4",
"reactflow": "^11.11.4",
"remark-breaks": "^4.0.0",
"streamdown": "2.5.0",
"typescript": "^5.7.3"
}
}