Interactive Angular 19 demo for @sda/notification-elements-ui with 6 sections: Bell & Feed, Notification Center, Inbox, Comments & Threads, Mention Input, and Full-Featured layout. Includes mock data, dark mode toggle, and real-time event log. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
952 B
JavaScript
39 lines
952 B
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
|
const Template = require("../Template");
|
|
const HelperRuntimeModule = require("./HelperRuntimeModule");
|
|
|
|
/** @typedef {import("../Compilation")} Compilation */
|
|
|
|
class CreateScriptRuntimeModule extends HelperRuntimeModule {
|
|
constructor() {
|
|
super("trusted types script");
|
|
}
|
|
|
|
/**
|
|
* @returns {string | null} runtime code
|
|
*/
|
|
generate() {
|
|
const compilation = /** @type {Compilation} */ (this.compilation);
|
|
const { runtimeTemplate, outputOptions } = compilation;
|
|
const { trustedTypes } = outputOptions;
|
|
const fn = RuntimeGlobals.createScript;
|
|
|
|
return Template.asString(
|
|
`${fn} = ${runtimeTemplate.returningFunction(
|
|
trustedTypes
|
|
? `${RuntimeGlobals.getTrustedTypesPolicy}().createScript(script)`
|
|
: "script",
|
|
"script"
|
|
)};`
|
|
);
|
|
}
|
|
}
|
|
|
|
module.exports = CreateScriptRuntimeModule;
|