Documentation
¶
Overview ¶
Package plugin_webview provides conventions for plugin ObjectType web viewer registration.
Plugins that provide ObjectType viewers use the HandleWebView directive forwarding mechanism from bldr. The naming convention for web view IDs is:
object-viewer:{typeID}:{objectKey}
For example: object-viewer:unixfs/fs-node:my/fs
The plugin's configset includes a handle-web-view-rpc controller entry that matches this pattern and forwards HandleWebView directives to the plugin. The plugin then calls SetRenderMode with RenderMode_REACT_COMPONENT and a script_path pointing to the viewer component in the plugin's dist UnixFS.
Index ¶
Constants ¶
const ObjectViewerWebViewIDPrefix = "object-viewer:"
ObjectViewerWebViewIDPrefix is the prefix for ObjectType viewer web view IDs. Web views for ObjectType viewers use the pattern: "object-viewer:{typeID}:{objectKey}"
Variables ¶
This section is empty.
Functions ¶
func AllObjectViewerWebViewIDRegex ¶
func AllObjectViewerWebViewIDRegex() string
AllObjectViewerWebViewIDRegex returns the regex pattern for matching all ObjectType viewer HandleWebView directives.
func BuildWebViewID ¶
BuildWebViewID constructs a web view ID for an ObjectType viewer.
func ObjectViewerWebViewIDRegex ¶
ObjectViewerWebViewIDRegex returns the regex pattern for matching HandleWebView directives for a specific ObjectType.
Types ¶
This section is empty.