Define JSON Schema $refs for linking/embedding videos and linking documents

Created on 13 May 2025, about 5 hours ago

Overview

XB already has

  1. json-schema-definitions://experience_builder.module/image, which allows rendering an image
  2. json-schema-definitions://experience_builder.module/image-uri, which allows linking an image

The 3 missing $refs to use in SDCs' schemas:

  1. linking a video
  2. rendering ("embedding") a video
  3. linking a document
  4. 👈 (most) browsers can only natively render PDFs, all other document types require specialized embedding widgets — tackling that seems out of scope here?

Note that in core, the:

  • "document" media type allows txt rtf doc docx ppt pptx xls xlsx pdf odf odg odp ods odt fodt fods fodp fodg key numbers pages
  • "video" media type allows mp4
  • "remote video" media type allows YouTube + Vimeo

Proposed resolution

For the 3 missing concepts:

  1. Challenge: more often than not, you wouldn't link to a .mp4, .webm … URL, but you'd link to YouTube or Vimeo or …. How do we express that? 🤔 Seems like we'd need to draw inspiration from core's \Drupal\media\OEmbed\Resource, which has ::TYPE_LINK, ::TYPE_PHOTO, ::TYPE_RICH and ::TYPE_VIDEO.
  2. This pretty much requires an oembed URL, and then the oembed fetching to happen … inside the SDC itself? 🤔
  3. Linking to a document seems simple enough:
        "document-uri": {
          "title": "Document URL",
          "type": "string",
          "format": "uri-reference",
          "pattern": "^(/|https?://)?.*\\.(txt|rtf|doc|docx|ppt|pptx|xls|xlsx|pdf|odf|odg|odp|ods|odt|fodt|fods|fodp|fodg|key|numbers|pages)(\\?.*)?(#.*)?$"
        },
    

User interface changes

TBD

Feature request
Status

Active

Version

0.0

Component

Shape matching

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024