[ic]plugin.js
const SDK = globalThis.SDK;
const PLUGIN_ID = "MyCompany_DOMMessaging";
const PLUGIN_CATEGORY = "general";
const PLUGIN_CLASS = SDK.Plugins.MyCompany_DOMMessaging = class extends SDK.IPluginBase
{
constructor()
{
super(PLUGIN_ID);
SDK.Lang.PushContext("plugins." + PLUGIN_ID.toLowerCase()); // "plugins.mycompany_dommessaging"
// Plugin info with language strings
this._info.SetName(globalThis.lang(".name"));
this._info.SetDescription(globalThis.lang(".description"));
this._info.SetCategory(PLUGIN_CATEGORY);
this._info.SetAuthor("MyCompany");
this._info.SetHelpUrl(globalThis.lang(".help-url"));
this._info.SetIsSingleGlobal(true);
this._info.SetRuntimeModuleMainScript("c3runtime/main.js");
this._info.SetDOMSideScripts(["c3runtime/domSide.js"]);
// PROPERTIES
this._info.SetProperties([
new SDK.PluginProperty("group", "app-config"), // [???] - Should show "Application Configuration"
new SDK.PluginProperty("text", "app-name", "My Application"), // [???] - Should show "Application Name"
new SDK.PluginProperty("text", "app-version", "1.0.0"), // [???] - Should show "Application Version"
new SDK.PluginProperty("longtext", "app-description", "A web application built with Construct 3"), // [???]
new SDK.PluginProperty("text", "permissions", "storage,activeTab"), // [???] - Should show "Permissions"
new SDK.PluginProperty("group", "layout-config"), // [???] - Should show "Layout Configuration"
new SDK.PluginProperty("text", "popup-layout", ""), // [???] - Should show "Popup Layout"
new SDK.PluginProperty("text", "options-layout", ""), // [???] - Should show "Options Layout"
new SDK.PluginProperty("text", "background-layout", "") // [???] - Should show "Background Layout"
]);
SDK.Lang.PopContext(); // Pop "plugins.mycompany_dommessaging"
}
};
PLUGIN_CLASS.Register(PLUGIN_ID, PLUGIN_CLASS);
eng-lang
{
"$schema": "../plugin.lang.schema.json",
"languageTag": "en-US",
"fileDescription": "Strings for DOM Messaging addon",
"text": {
"plugins": {
"mycompany_dommessaging": {
"name": "DOM Messaging",
"description": "Helper addon for creating web applications from Construct 3 projects",
"help-url": "https://example.com/help",
// PROPERTIES -
"properties": {
"app-config": {
"name": "Application Configuration",
"desc": "Basic application settings"
},
"app-name": {
"name": "Application Name",
"desc": "The name of your application"
},
"app-version": {
"name": "Application Version",
"desc": "The version number of your application (e.g., 1.0.0)"
},
"app-description": {
"name": "Application Description",
"desc": "A brief description of what your application does"
},
"permissions": {
"name": "Permissions",
"desc": "Application permissions (comma-separated)"
},
"background-layout": {
"name": "Background Layout",
"desc": "The name of the layout to use for the background script"
}
}
}
}
}
}
addon.json
{
"is-c3-addon": true,
"type": "plugin",
"name": "DOM Messaging",
"id": "MyCompany_DOMMessaging",
"version": "1.0.0.0",
"author": "MyCompany",
"website": "https://example.com",
"documentation": "https://example.com/docs",
"description": "Helper addon for creating applications from Construct 3 projects.",
"editor-scripts": [
"plugin.js" // Main plugin definition file
],
"file-list": [
"c3runtime/main.js",
"c3runtime/type.js",
"c3runtime/instance.js",
"c3runtime/actions.js",
"c3runtime/expressions.js",
"c3runtime/domSide.js",
"aces.json",
"lang/en-US.json" // Language file reference
]
}