Functions
jsNullableLiteral
nonisolated static func jsNullableLiteral(_ value: String?) -> String
jsStringLiteral(value), or the bare token null when there is no value.
jsStringLiteral
nonisolated static func jsStringLiteral(_ value: String?) -> String
value as a double-quoted JavaScript string literal for the inline script. The app's jwt /
rpcToken, the server's violation text and the customer's font names go in there; a raw '
would end the string and a raw </script> the script (#20857 review, #20276).
latoFaceCss
nonisolated static func latoFaceCss(weight: Int, base64Ttf: String) -> String
One @font-face rule for the overlay page's Lato at weight, its src a base64 data:font/ttf
url. One line, nothing but base64Ttf varies.
overlayHtml
nonisolated static func overlayHtml(wcUrl: String, jwt: String?, rpcToken: String?, violation: String?, cpp: String?, baseUrl: String?, fonts: FontFields, mediaAssetPath: String?, fontFaces: String = "") -> String
The overlay page. Every value but wcUrl goes in through jsStringLiteral; wcUrl goes into
a src attribute as is, so pass only overlayWcUrl(publicationName:), never a value from a
publication or the app.
The font values and mediaAssetPath are null in the script when absent; the other slots
keep their pre-#20276 behaviour of an empty string. The text itself takes the configured body
font through --font-family-body, which bbApplyFonts sets on <html>; the heading parts of
the component read --font-family-heading (bb-components #146).
fontFaces is the first line of the <style>; the view passes bundledLatoFaces (#21293), one
line of css whose only variable part is base64, so it cannot end the style element.
overlayWcUrl
nonisolated static func overlayWcUrl(publicationName: String?) -> String
The component url for the publication's environment: cdn-dev / cdn-acc / cdn-test when
the publication name's second label is one of those, the production cdn otherwise.