Loading editor/node/node_widget_runner.js +13 −0 Changes for editor/node/node_widget_runner.js: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -32,6 +32,19 @@ async function main() { const result = await Promise.resolve(fn(req)); if (hook === 'metadata' && result && typeof result === 'object') { if (!result.type_id || typeof result.type_id !== 'string' || !result.type_id.trim()) { const scriptBase = path.basename(scriptPath, path.extname(scriptPath)); const widgetName = (typeof result.name === 'string' && result.name.trim()) ? result.name.trim() : scriptBase; if (typeof mod.getUUID === 'function') { result.type_id = String(mod.getUUID()); } if (!result.type_id || !result.type_id.trim()) { throw new Error(`Widget ${widgetName} has no hardcoded UUID (type_id/getUUID missing)`); } } } if (hook === 'render') { let html = ''; if (typeof result === 'string') { Loading editor/node/widgets/accordion.js +6 −0 Changes for editor/node/widgets/accordion.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -71,3 +71,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur function css(k,v){const s=str(v);return s?`${k}:${s};`:'';} function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');} function esc(v){return String(v).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');} function getUUID() { return 'a2f7c1e3-49d8-4b5a-9c6e-8d1f3a7b2e04'; } module.exports.getUUID = getUUID; editor/node/widgets/article.js +6 −0 Changes for editor/node/widgets/article.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -56,3 +56,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur function css(k,v){const s=str(v);return s?`${k}:${s};`:'';} function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');} function esc(v){return String(v).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');} function getUUID() { return '58e70fdb-d4b4-45bf-8c59-e7a8ce2db735'; } module.exports.getUUID = getUUID; editor/node/widgets/button.js +6 −0 Changes for editor/node/widgets/button.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -121,3 +121,9 @@ function buildGtagSnippet(p){ } function jsEsc(v){return String(v).replace(/\\/g,'\\\\').replace(/'/g,"\\'");} function getUUID() { return 'f77fcdg4-5i98-7h6i-d7f9-2i89g4e989f7'; } module.exports.getUUID = getUUID; editor/node/widgets/container.js +6 −0 Changes for editor/node/widgets/container.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -97,3 +97,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur function css(k,v,important){const s=str(v);return s?`${k}:${s}${important?' !important':''};`:'';} function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');} function escCssUrl(v){return String(v).replace(/'/g,"%27");} function getUUID() { return 'a22a7ef9-0d43-4c1d-82b4-7d34b9545a24'; } module.exports.getUUID = getUUID; Loading
editor/node/node_widget_runner.js +13 −0 Changes for editor/node/node_widget_runner.js: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -32,6 +32,19 @@ async function main() { const result = await Promise.resolve(fn(req)); if (hook === 'metadata' && result && typeof result === 'object') { if (!result.type_id || typeof result.type_id !== 'string' || !result.type_id.trim()) { const scriptBase = path.basename(scriptPath, path.extname(scriptPath)); const widgetName = (typeof result.name === 'string' && result.name.trim()) ? result.name.trim() : scriptBase; if (typeof mod.getUUID === 'function') { result.type_id = String(mod.getUUID()); } if (!result.type_id || !result.type_id.trim()) { throw new Error(`Widget ${widgetName} has no hardcoded UUID (type_id/getUUID missing)`); } } } if (hook === 'render') { let html = ''; if (typeof result === 'string') { Loading
editor/node/widgets/accordion.js +6 −0 Changes for editor/node/widgets/accordion.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -71,3 +71,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur function css(k,v){const s=str(v);return s?`${k}:${s};`:'';} function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');} function esc(v){return String(v).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');} function getUUID() { return 'a2f7c1e3-49d8-4b5a-9c6e-8d1f3a7b2e04'; } module.exports.getUUID = getUUID;
editor/node/widgets/article.js +6 −0 Changes for editor/node/widgets/article.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -56,3 +56,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur function css(k,v){const s=str(v);return s?`${k}:${s};`:'';} function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');} function esc(v){return String(v).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''');} function getUUID() { return '58e70fdb-d4b4-45bf-8c59-e7a8ce2db735'; } module.exports.getUUID = getUUID;
editor/node/widgets/button.js +6 −0 Changes for editor/node/widgets/button.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -121,3 +121,9 @@ function buildGtagSnippet(p){ } function jsEsc(v){return String(v).replace(/\\/g,'\\\\').replace(/'/g,"\\'");} function getUUID() { return 'f77fcdg4-5i98-7h6i-d7f9-2i89g4e989f7'; } module.exports.getUUID = getUUID;
editor/node/widgets/container.js +6 −0 Changes for editor/node/widgets/container.js: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -97,3 +97,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur function css(k,v,important){const s=str(v);return s?`${k}:${s}${important?' !important':''};`:'';} function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');} function escCssUrl(v){return String(v).replace(/'/g,"%27");} function getUUID() { return 'a22a7ef9-0d43-4c1d-82b4-7d34b9545a24'; } module.exports.getUUID = getUUID;