@archduck/gst-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeConfigs-CRhPUSCj.js","sources":["../../src/utils/gstDebug.js","../../src/utils/logger.js","../../src/utils/mergeConfigs.js"],"sourcesContent":["/**\n * Debug tracing for the gst rendering pipeline\n *\n * Logs every decision the engine makes, named by decision point.\n * Controlled by meta.debug:\n * false / \"false\" / omitted -> no logging\n * true / \"true\" -> log decision + outcome\n * \"verbose\" -> also log inputs and reasoning\n *\n * Console output uses groupCollapsed in verbose mode so you can\n * expand individual decisions to see their context.\n */\n\n// Debug levels\nconst OFF = 0\nconst ON = 1\nconst VERBOSE = 2\n\nlet level = OFF\n\n// Category styling (CSS for console.log %c formatting)\nconst CATEGORY_STYLES = {\n config: 'color: #4a9eff; font-weight: bold',\n registry: 'color: #2ecc71; font-weight: bold',\n component: 'color: #9b59b6; font-weight: bold',\n render: 'color: #e67e22; font-weight: bold',\n visibility: 'color: #00bcd4; font-weight: bold',\n prop: 'color: #f1c40f; font-weight: bold',\n action: 'color: #e74c3c; font-weight: bold',\n layout: 'color: #1abc9c; font-weight: bold',\n hook: 'color: #e91e63; font-weight: bold',\n mount: 'color: #607d8b; font-weight: bold',\n}\n\nconst LABEL_STYLE = 'color: #999; font-weight: normal'\nconst VALUE_STYLE = 'color: #ccc; font-weight: normal'\n\n/**\n * Parse meta.debug into a level constant.\n * Accepts boolean, string boolean, or \"verbose\".\n */\nexport function parseDebugLevel(value) {\n if (value === false || value === 'false' || value === undefined || value === null) return OFF\n if (value === 'verbose') return VERBOSE\n return ON // true, 'true', or any truthy value\n}\n\n/**\n * Initialize the debug system from meta config.\n * Called once at mount time.\n */\nexport function initDebug(meta) {\n level = parseDebugLevel(meta?.debug)\n if (level > OFF) {\n const modeName = level === VERBOSE ? 'verbose' : 'on'\n console.log(\n `%c[gst]%c debug mode: %c${modeName}`,\n 'color: #4a9eff; font-weight: bold',\n 'color: #999',\n 'color: #fff; font-weight: bold'\n )\n }\n}\n\n/**\n * Check if debug is active (for guarding expensive context-building)\n */\nexport function isDebugActive() {\n return level > OFF\n}\n\nexport function isVerbose() {\n return level === VERBOSE\n}\n\n/**\n * Log a decision point.\n *\n * @param {string} category - One of: config, registry, component, render, visibility, prop, action, layout, hook, mount\n * @param {string} point - Decision point name (e.g. \"resolve-component\", \"render-branch\")\n * @param {string} outcome - What was decided (e.g. \"Input\", \"hidden\", \"branch:adapter\")\n * @param {Object} [context] - Additional context (only logged in verbose mode)\n */\nexport function trace(category, point, outcome, context) {\n if (level === OFF) return\n\n const catStyle = CATEGORY_STYLES[category] || CATEGORY_STYLES.config\n\n if (level === VERBOSE && context) {\n console.groupCollapsed(\n `%c[gst:${category}]%c ${point} %c-> ${outcome}`,\n catStyle, LABEL_STYLE, VALUE_STYLE\n )\n for (const [key, value] of Object.entries(context)) {\n if (value === undefined) continue\n if (typeof value === 'object' && value !== null) {\n console.log(` %c${key}:`, 'color: #888', value)\n } else {\n console.log(` %c${key}:%c ${value}`, 'color: #888', 'color: #ccc')\n }\n }\n console.groupEnd()\n } else {\n console.log(\n `%c[gst:${category}]%c ${point} %c-> ${outcome}`,\n catStyle, LABEL_STYLE, VALUE_STYLE\n )\n }\n}\n\n/**\n * Log a group of related decisions (e.g. all fields in a layout row).\n * Opens a collapsed group that contains individual trace calls.\n */\nexport function traceGroup(category, label, fn) {\n if (level === OFF) return fn()\n\n const catStyle = CATEGORY_STYLES[category] || CATEGORY_STYLES.config\n console.groupCollapsed(`%c[gst:${category}]%c ${label}`, catStyle, LABEL_STYLE)\n try {\n return fn()\n } finally {\n console.groupEnd()\n }\n}\n\n/**\n * Async version of traceGroup\n */\nexport async function traceGroupAsync(category, label, fn) {\n if (level === OFF) return fn()\n\n const catStyle = CATEGORY_STYLES[category] || CATEGORY_STYLES.config\n console.groupCollapsed(`%c[gst:${category}]%c ${label}`, catStyle, LABEL_STYLE)\n try {\n return await fn()\n } finally {\n console.groupEnd()\n }\n}\n","/**\n * GST-Forms Simplified Logger\n */\n\nimport { initDebug, parseDebugLevel } from './gstDebug.js'\n\nlet debugEnabled = false\nlet strictMode = false\nlet errorService = null\nconst warnedMessages = new Set()\n\n/**\n * Initialize logger\n * @param {object} meta - Form meta configuration\n */\nexport function initLogger(meta) {\n const envDebug = typeof import.meta !== 'undefined' && import.meta.env?.VITE_GST_DEBUG\n debugEnabled = parseDebugLevel(meta?.debug) > 0 || envDebug === 'true'\n strictMode = meta?.strict === true || meta?.strict === 'true' ||\n (typeof import.meta !== 'undefined' && import.meta.env?.VITE_GST_STRICT === 'true')\n\n // Initialize the structured debug tracing system\n initDebug(meta)\n}\n\n/**\n * Configure external error service\n */\nexport function configureErrorService(service) {\n if (service?.error) errorService = service\n}\n\n// Debug logging functions (only log when enabled)\nexport const logFormInit = (formId) => debugEnabled && console.log(`[GST-FORMS] ${formId} initialized`)\nexport const logFormReady = (formId) => debugEnabled && console.log(`[GST-FORMS] ${formId} ready`)\nexport const logConfig = (file, importance) => debugEnabled && console.log(`[CONFIG] Loaded ${file} (importance:${importance})`)\nexport const logMerge = (path, winner, losers = []) => debugEnabled && console.log(`[MERGE] ${path}: ${winner.file}(imp:${winner.importance})`)\nexport const logRegistry = (type, name, source, details = '') => debugEnabled && console.log(`[REGISTRY] ${type}.${name} -> ${source}${details ? ` (${details})` : ''}`)\nexport const logResolve = (path, type, value) => debugEnabled && console.log(`[RESOLVE] ${path}: ${type} -> ${typeof value === 'string' ? `\"${value}\"` : value}`)\nexport const logCall = (funcName, context = {}) => debugEnabled && console.log(`[CALL] functions.${funcName}()`)\nexport const logVisibility = (path, visible, clearedFields = []) => debugEnabled && console.log(`[VISIBILITY] ${path}: ${visible ? 'visible' : 'hidden'}${clearedFields.length ? ` (clearing: ${clearedFields.join(', ')})` : ''}`)\nexport const logAction = (buttonName, action) => debugEnabled && console.log(`[ACTION] buttons.${buttonName}: ${action}`)\n\n/**\n * Main logger with error/warn/info methods\n */\nexport const logger = {\n info(message, data) {\n if (process.env.NODE_ENV === 'development') console.log(`[INFO] ${message}`, data || '')\n errorService?.info?.(message, { ...data, source: 'gst-forms' })\n },\n\n warn(message, data) {\n // Strict mode: throw on warnings so bad configs fail fast\n if (strictMode) {\n throw new Error(`[GST strict] ${message}`)\n }\n\n // Deduplicate warnings - only show each unique warning once\n if (warnedMessages.has(message)) return\n warnedMessages.add(message)\n\n if (process.env.NODE_ENV === 'development' || debugEnabled) console.warn(`[WARN] ${message}`, data || '')\n errorService?.warn?.(message, { ...data, source: 'gst-forms' })\n },\n\n error(message, data) {\n console.error(`[ERROR] ${message}`, data || '')\n errorService?.error?.(message, { ...data, source: 'gst-forms' })\n },\n\n debug(category, message, data) {\n if (debugEnabled) console.log(`[DEBUG:${category}] ${message}`, data || '')\n },\n\n child(context) {\n return {\n info: (msg, data) => logger.info(`[${context}] ${msg}`, data),\n warn: (msg, data) => logger.warn(`[${context}] ${msg}`, data),\n error: (msg, data) => logger.error(`[${context}] ${msg}`, data),\n debug: (cat, msg, data) => logger.debug(cat, `[${context}] ${msg}`, data)\n }\n }\n}\n\n// Error types and handling\nexport const ErrorType = {\n CONFIGURATION: 'CONFIGURATION',\n VALIDATION: 'VALIDATION',\n RUNTIME: 'RUNTIME',\n LIFECYCLE: 'LIFECYCLE',\n REGISTRY: 'REGISTRY',\n FORMATTING: 'FORMATTING',\n PARSING: 'PARSING',\n RESOLUTION: 'RESOLUTION',\n LOADING: 'LOADING',\n ACTION: 'ACTION',\n UNKNOWN: 'UNKNOWN'\n}\n\nexport function handleError(type, message, context = {}, shouldThrow = false) {\n const error = new Error(message)\n error.type = type\n error.context = context\n\n logger.error(message, { type, ...context, stack: error.stack })\n\n if (shouldThrow) throw error\n return error\n}\n\n// Utility functions\nexport const isDebugEnabled = () => debugEnabled\nexport const isStrictMode = () => strictMode\nexport const getDebugConfig = () => ({ enabled: debugEnabled, strict: strictMode })\nexport const clearWarnedMessages = () => warnedMessages.clear()","/**\n * Runtime config composition utility\n *\n * Merges multiple form configs together, handling:\n * - Deep merge for objects (meta, fields, buttons, etc.)\n * - Spread syntax in arrays: { \"...\": \"^\" } includes base array items at that position\n * - Array replacement (not concatenation) by default\n *\n * @example\n * import { mergeConfigs } from '@archduck/gst-forms'\n *\n * const config = mergeConfigs(baseConfig, spanishPatch, gdprPatch)\n * <Form {...config} />\n *\n * @example\n * // Patches can use spread syntax in arrays to compose layouts\n * const adminPatch = {\n * fields: { adminBadge: { ... } },\n * // Prepend: new items first, then base items\n * layout: [{ rows: [['adminBadge']] }, { \"...\": \"^\" }]\n * }\n *\n * @example\n * // Append: base items first, then new items\n * const gdprPatch = {\n * layout: [{ \"...\": \"^\" }, { title: 'Privacy', rows: [['consent']] }]\n * }\n *\n * @example\n * // Insert in middle: items before, base, items after\n * const mixedPatch = {\n * layout: [{ rows: [['top']] }, { \"...\": \"^\" }, { rows: [['bottom']] }]\n * }\n */\n\n/**\n * Check if an item is a spread marker: { \"...\": \"^\" }\n */\nfunction isSpreadMarker(item) {\n return item && typeof item === 'object' && !Array.isArray(item) && item['...'] === '^'\n}\n\n/**\n * Resolve spread syntax in an array\n * Replaces { \"...\": \"^\" } markers with items from the base array\n *\n * @param {Array} sourceArray - Array that may contain spread markers\n * @param {Array} baseArray - Base array to spread from\n * @returns {Array} Resolved array with spread markers replaced\n */\nfunction resolveArraySpread(sourceArray, baseArray) {\n if (!Array.isArray(sourceArray)) return sourceArray\n if (!Array.isArray(baseArray)) baseArray = []\n\n const hasSpread = sourceArray.some(isSpreadMarker)\n if (!hasSpread) return sourceArray\n\n const result = []\n for (const item of sourceArray) {\n if (isSpreadMarker(item)) {\n result.push(...baseArray)\n } else {\n result.push(item)\n }\n }\n return result\n}\n\n/**\n * Deep merge two objects\n * - Objects are recursively merged\n * - Arrays: if source contains { \"...\": \"^\" }, spreads base array at that position\n * - Arrays without spread markers replace (don't concatenate)\n * - Source wins for type mismatches\n * - undefined values in source are skipped (don't overwrite target)\n */\nfunction deepMerge(target, source) {\n if (source === null || source === undefined) return target\n if (target === null || target === undefined) return source\n if (typeof target !== typeof source) return source\n if (typeof source !== 'object') return source\n\n // Handle arrays with spread syntax\n if (Array.isArray(source)) {\n const targetArray = Array.isArray(target) ? target : []\n return resolveArraySpread(source, targetArray)\n }\n\n const result = { ...target }\n for (const [key, value] of Object.entries(source)) {\n // Skip undefined values - they shouldn't overwrite existing values\n if (value === undefined) continue\n\n if (value && typeof value === 'object' && !Array.isArray(value) &&\n result[key] && typeof result[key] === 'object' && !Array.isArray(result[key])) {\n result[key] = deepMerge(result[key], value)\n } else if (Array.isArray(value)) {\n // Handle arrays with potential spread syntax\n const targetArray = Array.isArray(result[key]) ? result[key] : []\n result[key] = resolveArraySpread(value, targetArray)\n } else {\n result[key] = value\n }\n }\n return result\n}\n\n/**\n * Merge multiple configs together\n *\n * @param {...Object} configs - Configs to merge (base first, patches after)\n * @returns {Object} Merged config ready for <Form {...config} />\n *\n * Arrays use spread syntax for composition:\n * - { \"...\": \"^\" } in an array includes base array items at that position\n * - Arrays without spread markers replace the base array entirely\n */\nexport function mergeConfigs(...configs) {\n const validConfigs = configs.filter(c => c != null)\n if (validConfigs.length === 0) return {}\n if (validConfigs.length === 1) return { ...validConfigs[0] }\n\n // Deep merge all configs in order\n return validConfigs.reduce((result, config) => deepMerge(result, config), {})\n}\n\n/**\n * Merge just the registries from multiple configs\n * Useful when you only want to merge fields/buttons/etc.\n *\n * @param {...Object} registries - Registry objects to merge\n * @returns {Object} Merged registries\n */\nexport function mergeRegistries(...registries) {\n const valid = registries.filter(r => r != null)\n if (valid.length === 0) return {}\n if (valid.length === 1) return { ...valid[0] }\n\n return valid.reduce((acc, reg) => ({\n fields: deepMerge(acc.fields || {}, reg.fields || {}),\n buttons: deepMerge(acc.buttons || {}, reg.buttons || {}),\n optionSets: deepMerge(acc.optionSets || {}, reg.optionSets || {}),\n functions: { ...(acc.functions || {}), ...(reg.functions || {}) },\n hooks: deepMerge(acc.hooks || {}, reg.hooks || {})\n }), {})\n}\n\n// Also export deepMerge for advanced use cases\nexport { deepMerge }\n"],"names":["level","CATEGORY_STYLES","LABEL_STYLE","VALUE_STYLE","parseDebugLevel","value","initDebug","meta","isDebugActive","isVerbose","trace","category","point","outcome","context","catStyle","key","traceGroup","label","fn","traceGroupAsync","debugEnabled","strictMode","errorService","warnedMessages","initLogger","envDebug","__vite_import_meta_env__","configureErrorService","service","logFormInit","formId","logFormReady","logRegistry","type","name","source","details","logger","message","data","_a","msg","cat","ErrorType","handleError","shouldThrow","error","isDebugEnabled","isSpreadMarker","item","resolveArraySpread","sourceArray","baseArray","result","deepMerge","target","targetArray","mergeConfigs","configs","validConfigs","c","config","mergeRegistries","registries","valid","r","acc","reg"],"mappings":"AAkBA,IAAIA,IAAQ;AAGZ,MAAMC,IAAkB;AAAA,EACtB,QAAY;AAAA,EACZ,UAAY;AAAA,EACZ,WAAY;AAAA,EACZ,QAAY;AAAA,EACZ,YAAY;AAAA,EACZ,MAAY;AAAA,EACZ,QAAY;AAAA,EACZ,QAAY;AAAA,EACZ,MAAY;AAAA,EACZ,OAAY;AACd,GAEMC,IAAc,oCACdC,IAAc;AAMb,SAASC,EAAgBC,GAAO;AACrC,SAAIA,MAAU,MAASA,MAAU,WAAWA,MAAU,UAAaA,MAAU,OAAa,IACtFA,MAAU,YAAkB,IACzB;AACT;AAMO,SAASC,EAAUC,GAAM;AAC9B,EAAAP,IAAQI,EAAgBG,KAAA,gBAAAA,EAAM,KAAK,GAC/BP,IAAQ,KAEV,QAAQ;AAAA,IACN,2BAFeA,MAAU,IAAU,YAAY,IAEZ;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,EACN;AAEA;AAKO,SAASQ,IAAgB;AAC9B,SAAOR,IAAQ;AACjB;AAEO,SAASS,IAAY;AAC1B,SAAOT,MAAU;AACnB;AAUO,SAASU,EAAMC,GAAUC,GAAOC,GAASC,GAAS;AACvD,MAAId,MAAU,EAAK;AAEnB,QAA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1
+ "use strict";var u=typeof document<"u"?document.currentScript:null;const s=0,O=1,h=2;let i=s;const b={config:"color: #4a9eff; font-weight: bold",registry:"color: #2ecc71; font-weight: bold",component:"color: #9b59b6; font-weight: bold",render:"color: #e67e22; font-weight: bold",visibility:"color: #00bcd4; font-weight: bold",prop:"color: #f1c40f; font-weight: bold",action:"color: #e74c3c; font-weight: bold",layout:"color: #1abc9c; font-weight: bold",hook:"color: #e91e63; font-weight: bold",mount:"color: #607d8b; font-weight: bold"},E="color: #999; font-weight: normal",a="color: #ccc; font-weight: normal";function R(o){return o===!1||o==="false"||o===void 0||o===null?s:o==="verbose"?h:O}function N(o){i=R(o==null?void 0:o.debug),i>s&&console.log(`%c[gst]%c debug mode: %c${i===h?"verbose":"on"}`,"color: #4a9eff; font-weight: bold","color: #999","color: #fff; font-weight: bold")}function w(){return i>s}function S(){return i===h}function L(o,n,e,r){if(i===s)return;const t=b[o]||b.config;if(i===h&&r){console.groupCollapsed(`%c[gst:${o}]%c ${n} %c-> ${e}`,t,E,a);for(const[y,p]of Object.entries(r))p!==void 0&&(typeof p=="object"&&p!==null?console.log(` %c${y}:`,"color: #888",p):console.log(` %c${y}:%c ${p}`,"color: #888","color: #ccc"));console.groupEnd()}else console.log(`%c[gst:${o}]%c ${n} %c-> ${e}`,t,E,a)}function C(o,n,e){if(i===s)return e();const r=b[o]||b.config;console.groupCollapsed(`%c[gst:${o}]%c ${n}`,r,E);try{return e()}finally{console.groupEnd()}}async function G(o,n,e){if(i===s)return e();const r=b[o]||b.config;console.groupCollapsed(`%c[gst:${o}]%c ${n}`,r,E);try{return await e()}finally{console.groupEnd()}}const d={};let c=!1,$=!1,l=null;const A=new Set;function U(o){const n=typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:u&&u.tagName.toUpperCase()==="SCRIPT"&&u.src||new URL("chunks/mergeConfigs-Dgwcseh2.js",document.baseURI).href}<"u"&&(d==null?void 0:d.VITE_GST_DEBUG);c=R(o==null?void 0:o.debug)>0||n==="true",$=(o==null?void 0:o.strict)===!0||(o==null?void 0:o.strict)==="true"||typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:u&&u.tagName.toUpperCase()==="SCRIPT"&&u.src||new URL("chunks/mergeConfigs-Dgwcseh2.js",document.baseURI).href}<"u"&&(d==null?void 0:d.VITE_GST_STRICT)==="true",N(o)}function D(o){o!=null&&o.error&&(l=o)}const F=o=>c&&console.log(`[GST-FORMS] ${o} initialized`),k=o=>c&&console.log(`[GST-FORMS] ${o} ready`),M=(o,n,e,r="")=>c&&console.log(`[REGISTRY] ${o}.${n} -> ${e}${r?` (${r})`:""}`),g={info(o,n){var e;process.env.NODE_ENV==="development"&&console.log(`[INFO] ${o}`,n||""),(e=l==null?void 0:l.info)==null||e.call(l,o,{...n,source:"gst-forms"})},warn(o,n){var e;if($)throw new Error(`[GST strict] ${o}`);A.has(o)||(A.add(o),(process.env.NODE_ENV==="development"||c)&&console.warn(`[WARN] ${o}`,n||""),(e=l==null?void 0:l.warn)==null||e.call(l,o,{...n,source:"gst-forms"}))},error(o,n){var e;console.error(`[ERROR] ${o}`,n||""),(e=l==null?void 0:l.error)==null||e.call(l,o,{...n,source:"gst-forms"})},debug(o,n,e){c&&console.log(`[DEBUG:${o}] ${n}`,e||"")},child(o){return{info:(n,e)=>g.info(`[${o}] ${n}`,e),warn:(n,e)=>g.warn(`[${o}] ${n}`,e),error:(n,e)=>g.error(`[${o}] ${n}`,e),debug:(n,e,r)=>g.debug(n,`[${o}] ${e}`,r)}}},V={CONFIGURATION:"CONFIGURATION",VALIDATION:"VALIDATION",RUNTIME:"RUNTIME",LIFECYCLE:"LIFECYCLE",REGISTRY:"REGISTRY",FORMATTING:"FORMATTING",PARSING:"PARSING",RESOLUTION:"RESOLUTION",LOADING:"LOADING",ACTION:"ACTION",UNKNOWN:"UNKNOWN"};function j(o,n,e={},r=!1){const t=new Error(n);if(t.type=o,t.context=e,g.error(n,{type:o,...e,stack:t.stack}),r)throw t;return t}const Y=()=>c;function T(o){return o&&typeof o=="object"&&!Array.isArray(o)&&o["..."]==="^"}function I(o,n){if(!Array.isArray(o)||(Array.isArray(n)||(n=[]),!o.some(T)))return o;const r=[];for(const t of o)T(t)?r.push(...n):r.push(t);return r}function f(o,n){if(n==null)return o;if(o==null||typeof o!=typeof n||typeof n!="object")return n;if(Array.isArray(n)){const r=Array.isArray(o)?o:[];return I(n,r)}const e={...o};for(const[r,t]of Object.entries(n))if(t!==void 0)if(t&&typeof t=="object"&&!Array.isArray(t)&&e[r]&&typeof e[r]=="object"&&!Array.isArray(e[r]))e[r]=f(e[r],t);else if(Array.isArray(t)){const y=Array.isArray(e[r])?e[r]:[];e[r]=I(t,y)}else e[r]=t;return e}function B(...o){const n=o.filter(e=>e!=null);return n.length===0?{}:n.length===1?{...n[0]}:n.reduce((e,r)=>f(e,r),{})}function P(...o){const n=o.filter(e=>e!=null);return n.length===0?{}:n.length===1?{...n[0]}:n.reduce((e,r)=>({fields:f(e.fields||{},r.fields||{}),buttons:f(e.buttons||{},r.buttons||{}),optionSets:f(e.optionSets||{},r.optionSets||{}),functions:{...e.functions||{},...r.functions||{}},hooks:f(e.hooks||{},r.hooks||{})}),{})}exports.ErrorType=V;exports.configureErrorService=D;exports.deepMerge=f;exports.handleError=j;exports.initDebug=N;exports.initLogger=U;exports.isDebugActive=w;exports.isDebugEnabled=Y;exports.isVerbose=S;exports.logFormInit=F;exports.logFormReady=k;exports.logRegistry=M;exports.logger=g;exports.mergeConfigs=B;exports.mergeRegistries=P;exports.parseDebugLevel=R;exports.trace=L;exports.traceGroup=C;exports.traceGroupAsync=G;
2
+ //# sourceMappingURL=mergeConfigs-Dgwcseh2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeConfigs-Dgwcseh2.js","sources":["../../src/utils/gstDebug.js","../../src/utils/logger.js","../../src/utils/mergeConfigs.js"],"sourcesContent":["/**\n * Debug tracing for the gst rendering pipeline\n *\n * Logs every decision the engine makes, named by decision point.\n * Controlled by meta.debug:\n * false / \"false\" / omitted -> no logging\n * true / \"true\" -> log decision + outcome\n * \"verbose\" -> also log inputs and reasoning\n *\n * Console output uses groupCollapsed in verbose mode so you can\n * expand individual decisions to see their context.\n */\n\n// Debug levels\nconst OFF = 0\nconst ON = 1\nconst VERBOSE = 2\n\nlet level = OFF\n\n// Category styling (CSS for console.log %c formatting)\nconst CATEGORY_STYLES = {\n config: 'color: #4a9eff; font-weight: bold',\n registry: 'color: #2ecc71; font-weight: bold',\n component: 'color: #9b59b6; font-weight: bold',\n render: 'color: #e67e22; font-weight: bold',\n visibility: 'color: #00bcd4; font-weight: bold',\n prop: 'color: #f1c40f; font-weight: bold',\n action: 'color: #e74c3c; font-weight: bold',\n layout: 'color: #1abc9c; font-weight: bold',\n hook: 'color: #e91e63; font-weight: bold',\n mount: 'color: #607d8b; font-weight: bold',\n}\n\nconst LABEL_STYLE = 'color: #999; font-weight: normal'\nconst VALUE_STYLE = 'color: #ccc; font-weight: normal'\n\n/**\n * Parse meta.debug into a level constant.\n * Accepts boolean, string boolean, or \"verbose\".\n */\nexport function parseDebugLevel(value) {\n if (value === false || value === 'false' || value === undefined || value === null) return OFF\n if (value === 'verbose') return VERBOSE\n return ON // true, 'true', or any truthy value\n}\n\n/**\n * Initialize the debug system from meta config.\n * Called once at mount time.\n */\nexport function initDebug(meta) {\n level = parseDebugLevel(meta?.debug)\n if (level > OFF) {\n const modeName = level === VERBOSE ? 'verbose' : 'on'\n console.log(\n `%c[gst]%c debug mode: %c${modeName}`,\n 'color: #4a9eff; font-weight: bold',\n 'color: #999',\n 'color: #fff; font-weight: bold'\n )\n }\n}\n\n/**\n * Check if debug is active (for guarding expensive context-building)\n */\nexport function isDebugActive() {\n return level > OFF\n}\n\nexport function isVerbose() {\n return level === VERBOSE\n}\n\n/**\n * Log a decision point.\n *\n * @param {string} category - One of: config, registry, component, render, visibility, prop, action, layout, hook, mount\n * @param {string} point - Decision point name (e.g. \"resolve-component\", \"render-branch\")\n * @param {string} outcome - What was decided (e.g. \"Input\", \"hidden\", \"branch:adapter\")\n * @param {Object} [context] - Additional context (only logged in verbose mode)\n */\nexport function trace(category, point, outcome, context) {\n if (level === OFF) return\n\n const catStyle = CATEGORY_STYLES[category] || CATEGORY_STYLES.config\n\n if (level === VERBOSE && context) {\n console.groupCollapsed(\n `%c[gst:${category}]%c ${point} %c-> ${outcome}`,\n catStyle, LABEL_STYLE, VALUE_STYLE\n )\n for (const [key, value] of Object.entries(context)) {\n if (value === undefined) continue\n if (typeof value === 'object' && value !== null) {\n console.log(` %c${key}:`, 'color: #888', value)\n } else {\n console.log(` %c${key}:%c ${value}`, 'color: #888', 'color: #ccc')\n }\n }\n console.groupEnd()\n } else {\n console.log(\n `%c[gst:${category}]%c ${point} %c-> ${outcome}`,\n catStyle, LABEL_STYLE, VALUE_STYLE\n )\n }\n}\n\n/**\n * Log a group of related decisions (e.g. all fields in a layout row).\n * Opens a collapsed group that contains individual trace calls.\n */\nexport function traceGroup(category, label, fn) {\n if (level === OFF) return fn()\n\n const catStyle = CATEGORY_STYLES[category] || CATEGORY_STYLES.config\n console.groupCollapsed(`%c[gst:${category}]%c ${label}`, catStyle, LABEL_STYLE)\n try {\n return fn()\n } finally {\n console.groupEnd()\n }\n}\n\n/**\n * Async version of traceGroup\n */\nexport async function traceGroupAsync(category, label, fn) {\n if (level === OFF) return fn()\n\n const catStyle = CATEGORY_STYLES[category] || CATEGORY_STYLES.config\n console.groupCollapsed(`%c[gst:${category}]%c ${label}`, catStyle, LABEL_STYLE)\n try {\n return await fn()\n } finally {\n console.groupEnd()\n }\n}\n","/**\n * GST-Forms Simplified Logger\n */\n\nimport { initDebug, parseDebugLevel } from './gstDebug.js'\n\nlet debugEnabled = false\nlet strictMode = false\nlet errorService = null\nconst warnedMessages = new Set()\n\n/**\n * Initialize logger\n * @param {object} meta - Form meta configuration\n */\nexport function initLogger(meta) {\n const envDebug = typeof import.meta !== 'undefined' && import.meta.env?.VITE_GST_DEBUG\n debugEnabled = parseDebugLevel(meta?.debug) > 0 || envDebug === 'true'\n strictMode = meta?.strict === true || meta?.strict === 'true' ||\n (typeof import.meta !== 'undefined' && import.meta.env?.VITE_GST_STRICT === 'true')\n\n // Initialize the structured debug tracing system\n initDebug(meta)\n}\n\n/**\n * Configure external error service\n */\nexport function configureErrorService(service) {\n if (service?.error) errorService = service\n}\n\n// Debug logging functions (only log when enabled)\nexport const logFormInit = (formId) => debugEnabled && console.log(`[GST-FORMS] ${formId} initialized`)\nexport const logFormReady = (formId) => debugEnabled && console.log(`[GST-FORMS] ${formId} ready`)\nexport const logConfig = (file, importance) => debugEnabled && console.log(`[CONFIG] Loaded ${file} (importance:${importance})`)\nexport const logMerge = (path, winner, losers = []) => debugEnabled && console.log(`[MERGE] ${path}: ${winner.file}(imp:${winner.importance})`)\nexport const logRegistry = (type, name, source, details = '') => debugEnabled && console.log(`[REGISTRY] ${type}.${name} -> ${source}${details ? ` (${details})` : ''}`)\nexport const logResolve = (path, type, value) => debugEnabled && console.log(`[RESOLVE] ${path}: ${type} -> ${typeof value === 'string' ? `\"${value}\"` : value}`)\nexport const logCall = (funcName, context = {}) => debugEnabled && console.log(`[CALL] functions.${funcName}()`)\nexport const logVisibility = (path, visible, clearedFields = []) => debugEnabled && console.log(`[VISIBILITY] ${path}: ${visible ? 'visible' : 'hidden'}${clearedFields.length ? ` (clearing: ${clearedFields.join(', ')})` : ''}`)\nexport const logAction = (buttonName, action) => debugEnabled && console.log(`[ACTION] buttons.${buttonName}: ${action}`)\n\n/**\n * Main logger with error/warn/info methods\n */\nexport const logger = {\n info(message, data) {\n if (process.env.NODE_ENV === 'development') console.log(`[INFO] ${message}`, data || '')\n errorService?.info?.(message, { ...data, source: 'gst-forms' })\n },\n\n warn(message, data) {\n // Strict mode: throw on warnings so bad configs fail fast\n if (strictMode) {\n throw new Error(`[GST strict] ${message}`)\n }\n\n // Deduplicate warnings - only show each unique warning once\n if (warnedMessages.has(message)) return\n warnedMessages.add(message)\n\n if (process.env.NODE_ENV === 'development' || debugEnabled) console.warn(`[WARN] ${message}`, data || '')\n errorService?.warn?.(message, { ...data, source: 'gst-forms' })\n },\n\n error(message, data) {\n console.error(`[ERROR] ${message}`, data || '')\n errorService?.error?.(message, { ...data, source: 'gst-forms' })\n },\n\n debug(category, message, data) {\n if (debugEnabled) console.log(`[DEBUG:${category}] ${message}`, data || '')\n },\n\n child(context) {\n return {\n info: (msg, data) => logger.info(`[${context}] ${msg}`, data),\n warn: (msg, data) => logger.warn(`[${context}] ${msg}`, data),\n error: (msg, data) => logger.error(`[${context}] ${msg}`, data),\n debug: (cat, msg, data) => logger.debug(cat, `[${context}] ${msg}`, data)\n }\n }\n}\n\n// Error types and handling\nexport const ErrorType = {\n CONFIGURATION: 'CONFIGURATION',\n VALIDATION: 'VALIDATION',\n RUNTIME: 'RUNTIME',\n LIFECYCLE: 'LIFECYCLE',\n REGISTRY: 'REGISTRY',\n FORMATTING: 'FORMATTING',\n PARSING: 'PARSING',\n RESOLUTION: 'RESOLUTION',\n LOADING: 'LOADING',\n ACTION: 'ACTION',\n UNKNOWN: 'UNKNOWN'\n}\n\nexport function handleError(type, message, context = {}, shouldThrow = false) {\n const error = new Error(message)\n error.type = type\n error.context = context\n\n logger.error(message, { type, ...context, stack: error.stack })\n\n if (shouldThrow) throw error\n return error\n}\n\n// Utility functions\nexport const isDebugEnabled = () => debugEnabled\nexport const isStrictMode = () => strictMode\nexport const getDebugConfig = () => ({ enabled: debugEnabled, strict: strictMode })\nexport const clearWarnedMessages = () => warnedMessages.clear()","/**\n * Runtime config composition utility\n *\n * Merges multiple form configs together, handling:\n * - Deep merge for objects (meta, fields, buttons, etc.)\n * - Spread syntax in arrays: { \"...\": \"^\" } includes base array items at that position\n * - Array replacement (not concatenation) by default\n *\n * @example\n * import { mergeConfigs } from '@archduck/gst-forms'\n *\n * const config = mergeConfigs(baseConfig, spanishPatch, gdprPatch)\n * <Form {...config} />\n *\n * @example\n * // Patches can use spread syntax in arrays to compose layouts\n * const adminPatch = {\n * fields: { adminBadge: { ... } },\n * // Prepend: new items first, then base items\n * layout: [{ rows: [['adminBadge']] }, { \"...\": \"^\" }]\n * }\n *\n * @example\n * // Append: base items first, then new items\n * const gdprPatch = {\n * layout: [{ \"...\": \"^\" }, { title: 'Privacy', rows: [['consent']] }]\n * }\n *\n * @example\n * // Insert in middle: items before, base, items after\n * const mixedPatch = {\n * layout: [{ rows: [['top']] }, { \"...\": \"^\" }, { rows: [['bottom']] }]\n * }\n */\n\n/**\n * Check if an item is a spread marker: { \"...\": \"^\" }\n */\nfunction isSpreadMarker(item) {\n return item && typeof item === 'object' && !Array.isArray(item) && item['...'] === '^'\n}\n\n/**\n * Resolve spread syntax in an array\n * Replaces { \"...\": \"^\" } markers with items from the base array\n *\n * @param {Array} sourceArray - Array that may contain spread markers\n * @param {Array} baseArray - Base array to spread from\n * @returns {Array} Resolved array with spread markers replaced\n */\nfunction resolveArraySpread(sourceArray, baseArray) {\n if (!Array.isArray(sourceArray)) return sourceArray\n if (!Array.isArray(baseArray)) baseArray = []\n\n const hasSpread = sourceArray.some(isSpreadMarker)\n if (!hasSpread) return sourceArray\n\n const result = []\n for (const item of sourceArray) {\n if (isSpreadMarker(item)) {\n result.push(...baseArray)\n } else {\n result.push(item)\n }\n }\n return result\n}\n\n/**\n * Deep merge two objects\n * - Objects are recursively merged\n * - Arrays: if source contains { \"...\": \"^\" }, spreads base array at that position\n * - Arrays without spread markers replace (don't concatenate)\n * - Source wins for type mismatches\n * - undefined values in source are skipped (don't overwrite target)\n */\nfunction deepMerge(target, source) {\n if (source === null || source === undefined) return target\n if (target === null || target === undefined) return source\n if (typeof target !== typeof source) return source\n if (typeof source !== 'object') return source\n\n // Handle arrays with spread syntax\n if (Array.isArray(source)) {\n const targetArray = Array.isArray(target) ? target : []\n return resolveArraySpread(source, targetArray)\n }\n\n const result = { ...target }\n for (const [key, value] of Object.entries(source)) {\n // Skip undefined values - they shouldn't overwrite existing values\n if (value === undefined) continue\n\n if (value && typeof value === 'object' && !Array.isArray(value) &&\n result[key] && typeof result[key] === 'object' && !Array.isArray(result[key])) {\n result[key] = deepMerge(result[key], value)\n } else if (Array.isArray(value)) {\n // Handle arrays with potential spread syntax\n const targetArray = Array.isArray(result[key]) ? result[key] : []\n result[key] = resolveArraySpread(value, targetArray)\n } else {\n result[key] = value\n }\n }\n return result\n}\n\n/**\n * Merge multiple configs together\n *\n * @param {...Object} configs - Configs to merge (base first, patches after)\n * @returns {Object} Merged config ready for <Form {...config} />\n *\n * Arrays use spread syntax for composition:\n * - { \"...\": \"^\" } in an array includes base array items at that position\n * - Arrays without spread markers replace the base array entirely\n */\nexport function mergeConfigs(...configs) {\n const validConfigs = configs.filter(c => c != null)\n if (validConfigs.length === 0) return {}\n if (validConfigs.length === 1) return { ...validConfigs[0] }\n\n // Deep merge all configs in order\n return validConfigs.reduce((result, config) => deepMerge(result, config), {})\n}\n\n/**\n * Merge just the registries from multiple configs\n * Useful when you only want to merge fields/buttons/etc.\n *\n * @param {...Object} registries - Registry objects to merge\n * @returns {Object} Merged registries\n */\nexport function mergeRegistries(...registries) {\n const valid = registries.filter(r => r != null)\n if (valid.length === 0) return {}\n if (valid.length === 1) return { ...valid[0] }\n\n return valid.reduce((acc, reg) => ({\n fields: deepMerge(acc.fields || {}, reg.fields || {}),\n buttons: deepMerge(acc.buttons || {}, reg.buttons || {}),\n optionSets: deepMerge(acc.optionSets || {}, reg.optionSets || {}),\n functions: { ...(acc.functions || {}), ...(reg.functions || {}) },\n hooks: deepMerge(acc.hooks || {}, reg.hooks || {})\n }), {})\n}\n\n// Also export deepMerge for advanced use cases\nexport { deepMerge }\n"],"names":["OFF","ON","VERBOSE","level","CATEGORY_STYLES","LABEL_STYLE","VALUE_STYLE","parseDebugLevel","value","initDebug","meta","isDebugActive","isVerbose","trace","category","point","outcome","context","catStyle","key","traceGroup","label","fn","traceGroupAsync","debugEnabled","strictMode","errorService","warnedMessages","initLogger","envDebug","_documentCurrentScript","__vite_import_meta_env__","configureErrorService","service","logFormInit","formId","logFormReady","logRegistry","type","name","source","details","logger","message","data","_a","msg","cat","ErrorType","handleError","shouldThrow","error","isDebugEnabled","isSpreadMarker","item","resolveArraySpread","sourceArray","baseArray","result","deepMerge","target","targetArray","mergeConfigs","configs","validConfigs","c","config","mergeRegistries","registries","valid","r","acc","reg"],"mappings":"mEAcA,MAAMA,EAAM,EACNC,EAAK,EACLC,EAAU,EAEhB,IAAIC,EAAQH,EAGZ,MAAMI,EAAkB,CACtB,OAAY,oCACZ,SAAY,oCACZ,UAAY,oCACZ,OAAY,oCACZ,WAAY,oCACZ,KAAY,oCACZ,OAAY,oCACZ,OAAY,oCACZ,KAAY,oCACZ,MAAY,mCACd,EAEMC,EAAc,mCACdC,EAAc,mCAMb,SAASC,EAAgBC,EAAO,CACrC,OAAIA,IAAU,IAASA,IAAU,SAAWA,IAAU,QAAaA,IAAU,KAAaR,EACtFQ,IAAU,UAAkBN,EACzBD,CACT,CAMO,SAASQ,EAAUC,EAAM,CAC9BP,EAAQI,EAAgBG,GAAA,YAAAA,EAAM,KAAK,EAC/BP,EAAQH,GAEV,QAAQ,IACN,2BAFeG,IAAUD,EAAU,UAAY,IAEZ,GACnC,oCACA,cACA,gCACN,CAEA,CAKO,SAASS,GAAgB,CAC9B,OAAOR,EAAQH,CACjB,CAEO,SAASY,GAAY,CAC1B,OAAOT,IAAUD,CACnB,CAUO,SAASW,EAAMC,EAAUC,EAAOC,EAASC,EAAS,CACvD,GAAId,IAAUH,EAAK,OAEnB,MAAMkB,EAAWd,EAAgBU,CAAQ,GAAKV,EAAgB,OAE9D,GAAID,IAAUD,GAAWe,EAAS,CAChC,QAAQ,eACN,UAAUH,CAAQ,OAAOC,CAAK,SAASC,CAAO,GAC9CE,EAAUb,EAAaC,CAC7B,EACI,SAAW,CAACa,EAAKX,CAAK,IAAK,OAAO,QAAQS,CAAO,EAC3CT,IAAU,SACV,OAAOA,GAAU,UAAYA,IAAU,KACzC,QAAQ,IAAI,OAAOW,CAAG,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S,CACvC,MAAMC,EAAeD,EAAQ,OAAOE,GAAKA,GAAK,IAAI,EAClD,OAAID,EAAa,SAAW,EAAU,CAAA,EAClCA,EAAa,SAAW,EAAU,CAAE,GAAGA,EAAa,CAAC,CAAC,EAGnDA,EAAa,OAAO,CAACN,EAAQQ,IAAWP,EAAUD,EAAQQ,CAAM,EAAG,CAAA,CAAE,CAC9E,CASO,SAASC,KAAmBC,EAAY,CAC7C,MAAMC,EAAQD,EAAW,OAAOE,GAAKA,GAAK,IAAI,EAC9C,OAAID,EAAM,SAAW,EAAU,CAAA,EAC3BA,EAAM,SAAW,EAAU,CAAE,GAAGA,EAAM,CAAC,CAAC,EAErCA,EAAM,OAAO,CAACE,EAAKC,KAAS,CACjC,OAAQb,EAAUY,EAAI,QAAU,CAAA,EAAIC,EAAI,QAAU,EAAE,EACpD,QAASb,EAAUY,EAAI,SAAW,CAAA,EAAIC,EAAI,SAAW,EAAE,EACvD,WAAYb,EAAUY,EAAI,YAAc,CAAA,EAAIC,EAAI,YAAc,EAAE,EAChE,UAAW,CAAE,GAAID,EAAI,WAAa,CAAA,EAAK,GAAIC,EAAI,WAAa,CAAA,CAAG,EAC/D,MAAOb,EAAUY,EAAI,OAAS,CAAA,EAAIC,EAAI,OAAS,CAAA,CAAE,CACrD,GAAM,CAAA,CAAE,CACR"}
package/dist/core.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/core-Wpl1tnO4.js"),r=require("./chunks/mergeConfigs-Dgwcseh2.js");exports.bindFunctions=e.bindFunctions;exports.computed=e.computed;exports.createStage=e.createStage;exports.effect=e.effect;exports.enterRenderPhase=e.enterRenderPhase;exports.exitRenderPhase=e.exitRenderPhase;exports.generateDynamicClasses=e.generateDynamicClasses;exports.generateFieldDynamicClass=e.generateFieldDynamicClass;exports.generateScopeId=e.generateScopeId;exports.injectStyles=e.injectStyles;exports.injectStylesOnce=e.injectStylesOnce;exports.mount=e.mount;exports.parseDotNotation=e.parseDotNotation;exports.processButtonStyles=e.processButtonStyles;exports.processComponentStyles=e.processComponentStyles;exports.processFieldStyles=e.processFieldStyles;exports.processRegistryStyles=e.processRegistryStyles;exports.processStyles=e.processStyles;exports.reactive=e.reactive;exports.ref=e.ref;exports.removeStyles=e.removeStyles;exports.removeStylesOnce=e.removeStylesOnce;exports.renderElement=e.renderElement;exports.resolveRecordData=e.resolveRecordData;exports.resolveSpread=e.resolveSpread;exports.stop=e.stop;exports.toRaw=e.toRaw;exports.ErrorType=r.ErrorType;exports.configureErrorService=r.configureErrorService;exports.deepMerge=r.deepMerge;exports.handleError=r.handleError;exports.initLogger=r.initLogger;exports.isDebugEnabled=r.isDebugEnabled;exports.logger=r.logger;exports.mergeConfigs=r.mergeConfigs;exports.mergeRegistries=r.mergeRegistries;
2
+ //# sourceMappingURL=core.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/core.js ADDED
@@ -0,0 +1,41 @@
1
+ import { b as a, d as r, e as t, f as o, h as n, i as c, j as i, k as l, l as g, p, q as d, s as y, v as m, x as S, y as f, z as v, A as E, B as u, C as D, D as R, E as h, F as C, G as b, I as x, J as F, M as j, N as B } from "./chunks/core-ovxYfJ25.js";
2
+ import { E as M, c as N, d as O, h as P, a as k, e as q, l as w, m as z, n as A } from "./chunks/mergeConfigs-CRhPUSCj.js";
3
+ export {
4
+ M as ErrorType,
5
+ a as bindFunctions,
6
+ r as computed,
7
+ N as configureErrorService,
8
+ t as createStage,
9
+ O as deepMerge,
10
+ o as effect,
11
+ n as enterRenderPhase,
12
+ c as exitRenderPhase,
13
+ i as generateDynamicClasses,
14
+ l as generateFieldDynamicClass,
15
+ g as generateScopeId,
16
+ P as handleError,
17
+ k as initLogger,
18
+ p as injectStyles,
19
+ d as injectStylesOnce,
20
+ q as isDebugEnabled,
21
+ w as logger,
22
+ z as mergeConfigs,
23
+ A as mergeRegistries,
24
+ y as mount,
25
+ m as parseDotNotation,
26
+ S as processButtonStyles,
27
+ f as processComponentStyles,
28
+ v as processFieldStyles,
29
+ E as processRegistryStyles,
30
+ u as processStyles,
31
+ D as reactive,
32
+ R as ref,
33
+ h as removeStyles,
34
+ C as removeStylesOnce,
35
+ b as renderElement,
36
+ x as resolveRecordData,
37
+ F as resolveSpread,
38
+ j as stop,
39
+ B as toRaw
40
+ };
41
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/core-Wpl1tnO4.js"),s=require("./chunks/loaders-BEwXPBCN.js"),t=require("./chunks/mergeConfigs-Dgwcseh2.js");function m(o){const a=[],l=new Set,r=new Set;function d(c){if(!l.has(c)){if(r.has(c))throw new Error(`Circular dependency detected: ${c} depends on itself through ${[...r].join(" -> ")}`);r.add(c);for(const g of o[c]||[])o[g]!==void 0&&d(g);r.delete(c),l.add(c),a.push(c)}}for(const c of Object.keys(o))d(c);return a}function S(o){const a={};for(const[n,i]of Object.entries(o))a[n]=i.dependencies||[];const l=m(a),r={};for(const[n,i]of Object.entries(o))r[n]=i.dependencies||[];const d={};for(const[n,i]of Object.entries(o))if(i.registry&&(d[n]=n),i.children){for(const[u,f]of Object.entries(i.children))if(f.registry){const y=f.path||`${n}.${u}`;d[y]=u}}const c=new Set;for(const[n,i]of Object.entries(o))if(i.registry&&c.add(n),i.children)for(const[u,f]of Object.entries(i.children))f.registry&&c.add(u);const g={};for(const[n,i]of Object.entries(o))"default"in i?g[n]=i.default:i.registry?g[n]={}:g[n]={};function p(n){return n in g?g[n]:{}}return{resolutionOrder:l,dependencies:r,registryMapping:d,validRegistries:c,getDefault:p,declarations:Object.freeze({...o})}}function v(o){if(!o||typeof o!="object")return o;const a={};for(const[l,r]of Object.entries(o))if(r&&typeof r=="object"&&"value"in r&&typeof r.value=="function"){const d=r.value.toString();d.includes("=>")&&!d.startsWith("function")&&t.logger.warn(`Function "${l}" appears to be an arrow function in wrapper format. Arrow functions cannot access element context via 'this'. Use regular function syntax: function(context, event) { ... }`),a[l]=r.value}else typeof r=="function"?a[l]=r:t.logger.warn(`Non-function value found in functions object: "${l}"`);return a}exports.bindFunctions=e.bindFunctions;exports.buildContext=e.buildContext;exports.clearFieldValue=e.clearFieldValue;exports.computed=e.computed;exports.createStage=e.createStage;exports.effect=e.effect;exports.enableTracking=e.enableTracking;exports.enterRenderPhase=e.enterRenderPhase;exports.exitRenderPhase=e.exitRenderPhase;exports.generateDynamicClasses=e.generateDynamicClasses;exports.generateFieldDynamicClass=e.generateFieldDynamicClass;exports.generateScopeId=e.generateScopeId;exports.getByPath=e.getByPath;exports.getFieldValue=e.getFieldValue;exports.getRecordPath=e.getRecordPath;exports.injectStyles=e.injectStyles;exports.injectStylesOnce=e.injectStylesOnce;exports.isEventKey=e.isEventKey;exports.mount=e.mount;exports.normalizeDef=e.normalizeDef;exports.normalizeKey=e.normalizeKey;exports.parseDotNotation=e.parseDotNotation;exports.pauseTracking=e.pauseTracking;exports.processButtonStyles=e.processButtonStyles;exports.processComponentStyles=e.processComponentStyles;exports.processFieldStyles=e.processFieldStyles;exports.processRegistryStyles=e.processRegistryStyles;exports.processStyles=e.processStyles;exports.reactive=e.reactive;exports.ref=e.ref;exports.removeStyles=e.removeStyles;exports.removeStylesOnce=e.removeStylesOnce;exports.renderElement=e.renderElement;exports.renderSlot=e.renderSlot;exports.resolveRecordData=e.resolveRecordData;exports.resolveSpread=e.resolveSpread;exports.setByPath=e.setByPath;exports.setFieldValue=e.setFieldValue;exports.stop=e.stop;exports.toRaw=e.toRaw;exports.LiveConfig=s.LiveConfig;exports.applyMap=s.applyMap;exports.buildFormConfig=s.buildFormConfig;exports.buildScopeFor=s.buildScopeFor;exports.createLiveConfigRaw=s.createLiveConfig;exports.extractActions=s.extractActions;exports.extractLoadedState=s.extractLoadedState;exports.getDependents=s.getDependents;exports.getPath=s.getPath;exports.loadFile=s.loadFile;exports.loadJsonConfigRaw=s.loadJsonConfig;exports.loadLiveConfigRaw=s.loadLiveConfig;exports.mapRegistries=s.mapRegistries;exports.mergeMaps=s.mergeMaps;exports.processBulkApply=s.processBulkApply;exports.ErrorType=t.ErrorType;exports.configureErrorService=t.configureErrorService;exports.deepMerge=t.deepMerge;exports.handleError=t.handleError;exports.initDebug=t.initDebug;exports.initLogger=t.initLogger;exports.isDebugActive=t.isDebugActive;exports.isDebugEnabled=t.isDebugEnabled;exports.isVerbose=t.isVerbose;exports.logFormInit=t.logFormInit;exports.logFormReady=t.logFormReady;exports.logRegistry=t.logRegistry;exports.logger=t.logger;exports.mergeConfigs=t.mergeConfigs;exports.mergeRegistries=t.mergeRegistries;exports.parseDebugLevel=t.parseDebugLevel;exports.trace=t.trace;exports.traceGroup=t.traceGroup;exports.traceGroupAsync=t.traceGroupAsync;exports.createTLPSchema=S;exports.unwrapFunctions=v;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/utils/tlpSchema.js","../src/utils/configMerger.js"],"sourcesContent":["/**\n * @module tlpSchema\n * @description TLP (Top-Level Property) declaration system\n *\n * Replaces hardcoded constants (RESOLUTION_ORDER, PROPERTY_DEPENDENCIES,\n * VALID_REGISTRIES, DEFAULT_REGISTRY_MAPPING) with a single declarative schema.\n *\n * A TLP declaration describes one top-level config property: what it depends on,\n * whether it's a registry, its default value, and any children that are\n * themselves registries.\n *\n * gst-core ships with no built-in declarations. The consumer (gst-forms, or\n * any plugin) passes declarations to createTLPSchema() and gets back derived\n * constants: resolution order, dependency graph, registry mapping, etc.\n */\n\n/**\n * Topological sort on a dependency graph.\n * Returns an array where each entry appears after all its dependencies.\n *\n * @param {Object} graph - { node: [dependency, ...], ... }\n * @returns {string[]} Sorted node names\n */\nfunction topoSort(graph) {\n const sorted = []\n const visited = new Set()\n const visiting = new Set()\n\n function visit(node) {\n if (visited.has(node)) return\n if (visiting.has(node)) {\n throw new Error(`Circular dependency detected: ${node} depends on itself through ${[...visiting].join(' -> ')}`)\n }\n visiting.add(node)\n for (const dep of graph[node] || []) {\n if (graph[dep] !== undefined) {\n visit(dep)\n }\n }\n visiting.delete(node)\n visited.add(node)\n sorted.push(node)\n }\n\n for (const node of Object.keys(graph)) {\n visit(node)\n }\n\n return sorted\n}\n\n/**\n * Build a TLP schema from declarations.\n *\n * @param {Object} declarations - TLP declarations keyed by property name\n *\n * Each declaration can have:\n * - dependencies: string[] - other TLPs this one depends on (default: [])\n * - registry: boolean - whether this TLP is a registry (default: false).\n * All registries participate in dot-notation cross-references\n * (e.g. \"fields.email\", \"optionSets.countries\").\n * - default: any - default value. Registries default to {}, non-registries\n * to {} as well unless overridden (layout -> [], styles -> null, etc.)\n * - children: Object - nested properties that are themselves registries.\n * Keyed by child name, each child can have { registry, path }.\n * The path defaults to \"parentName.childName\" in the loaded config.\n *\n * @returns {Object} schema with derived constants:\n * - resolutionOrder: string[] - topologically sorted property names\n * - dependencies: Object - { property: [dependency, ...] }\n * - registryMapping: Object - { sourcePath: targetRegistryKey }\n * - validRegistries: Set - all registry names (for dot-notation cross-references)\n * - getDefault: (property) => defaultValue\n * - declarations: Object - the original declarations (frozen)\n */\nexport function createTLPSchema(declarations) {\n // Build dependency graph for topological sort\n const depGraph = {}\n for (const [name, decl] of Object.entries(declarations)) {\n depGraph[name] = decl.dependencies || []\n }\n\n const resolutionOrder = topoSort(depGraph)\n\n // Build dependencies map (same shape as PROPERTY_DEPENDENCIES)\n const dependencies = {}\n for (const [name, decl] of Object.entries(declarations)) {\n dependencies[name] = decl.dependencies || []\n }\n\n // Build registry mapping (same shape as DEFAULT_REGISTRY_MAPPING)\n // Maps source paths in loaded config to target registry keys\n const registryMapping = {}\n for (const [name, decl] of Object.entries(declarations)) {\n if (decl.registry) {\n registryMapping[name] = name\n }\n // Process children that are registries\n if (decl.children) {\n for (const [childName, childDecl] of Object.entries(decl.children)) {\n if (childDecl.registry) {\n const sourcePath = childDecl.path || `${name}.${childName}`\n registryMapping[sourcePath] = childName\n }\n }\n }\n }\n\n // Build validRegistries set (all registries participate in dot-notation)\n const validRegistries = new Set()\n for (const [name, decl] of Object.entries(declarations)) {\n if (decl.registry) {\n validRegistries.add(name)\n }\n if (decl.children) {\n for (const [childName, childDecl] of Object.entries(decl.children)) {\n if (childDecl.registry) {\n validRegistries.add(childName)\n }\n }\n }\n }\n\n // Build default getter\n const defaults = {}\n for (const [name, decl] of Object.entries(declarations)) {\n if ('default' in decl) {\n defaults[name] = decl.default\n } else if (decl.registry) {\n defaults[name] = {}\n } else {\n defaults[name] = {}\n }\n }\n\n function getDefault(property) {\n return property in defaults ? defaults[property] : {}\n }\n\n return {\n resolutionOrder,\n dependencies,\n registryMapping,\n validRegistries,\n getDefault,\n declarations: Object.freeze({ ...declarations })\n }\n}\n\n","// src/components/utils/configMerger.js\nimport { logger } from './logger.js'\n\n/**\n * Unwraps function wrappers from the wrapper format { value: fn, __importance: n }\n * to just the function value.\n *\n * Also detects and warns about arrow functions which cannot access element context via 'this'.\n *\n * @param {Object} functionsObj - Object containing functions or wrapped functions\n * @returns {Object} Object with unwrapped functions\n */\nexport function unwrapFunctions(functionsObj) {\n if (!functionsObj || typeof functionsObj !== 'object') return functionsObj\n\n const unwrapped = {}\n for (const [key, value] of Object.entries(functionsObj)) {\n // Handle wrapper format: { value: fn, __importance: n }\n if (value && typeof value === 'object' && 'value' in value && typeof value.value === 'function') {\n const fnStr = value.value.toString()\n if (fnStr.includes('=>') && !fnStr.startsWith('function')) {\n logger.warn(\n `Function \"${key}\" appears to be an arrow function in wrapper format. ` +\n `Arrow functions cannot access element context via 'this'. ` +\n `Use regular function syntax: function(context, event) { ... }`\n )\n }\n unwrapped[key] = value.value\n } else if (typeof value === 'function') {\n // Regular function - pass through\n unwrapped[key] = value\n } else {\n logger.warn(`Non-function value found in functions object: \"${key}\"`)\n }\n }\n return unwrapped\n}\n"],"names":["topoSort","graph","sorted","visited","visiting","visit","node","dep","createTLPSchema","declarations","depGraph","name","decl","resolutionOrder","dependencies","registryMapping","childName","childDecl","sourcePath","validRegistries","defaults","getDefault","property","unwrapFunctions","functionsObj","unwrapped","key","value","fnStr","logger"],"mappings":"sNAuBA,SAASA,EAASC,EAAO,CACvB,MAAMC,EAAS,CAAA,EACTC,EAAU,IAAI,IACdC,EAAW,IAAI,IAErB,SAASC,EAAMC,EAAM,CACnB,GAAI,CAAAH,EAAQ,IAAIG,CAAI,EACpB,IAAIF,EAAS,IAAIE,CAAI,EACnB,MAAM,IAAI,MAAM,iCAAiCA,CAAI,8BAA8B,CAAC,GAAGF,CAAQ,EAAE,KAAK,MAAM,CAAC,EAAE,EAEjHA,EAAS,IAAIE,CAAI,EACjB,UAAWC,KAAON,EAAMK,CAAI,GAAK,CAAA,EAC3BL,EAAMM,CAAG,IAAM,QACjBF,EAAME,CAAG,EAGbH,EAAS,OAAOE,CAAI,EACpBH,EAAQ,IAAIG,CAAI,EAChBJ,EAAO,KAAKI,CAAI,EAClB,CAEA,UAAWA,KAAQ,OAAO,KAAKL,CAAK,EAClCI,EAAMC,CAAI,EAGZ,OAAOJ,CACT,CA0BO,SAASM,EAAgBC,EAAc,CAE5C,MAAMC,EAAW,CAAA,EACjB,SAAW,CAACC,EAAMC,CAAI,IAAK,OAAO,QAAQH,CAAY,EACpDC,EAASC,CAAI,EAAIC,EAAK,cAAgB,CAAA,EAGxC,MAAMC,EAAkBb,EAASU,CAAQ,EAGnCI,EAAe,CAAA,EACrB,SAAW,CAACH,EAAMC,CAAI,IAAK,OAAO,QAAQH,CAAY,EACpDK,EAAaH,CAAI,EAAIC,EAAK,cAAgB,CAAA,EAK5C,MAAMG,EAAkB,CAAA,EACxB,SAAW,CAACJ,EAAMC,CAAI,IAAK,OAAO,QAAQH,CAAY,EAKpD,GAJIG,EAAK,WACPG,EAAgBJ,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DC,EAAAA,OAAO,KACL,aAAaH,CAAG,8KAG1B,EAEMD,EAAUC,CAAG,EAAIC,EAAM,KACzB,MAAW,OAAOA,GAAU,WAE1BF,EAAUC,CAAG,EAAIC,EAEjBE,EAAAA,OAAO,KAAK,kDAAkDH,CAAG,GAAG,EAGxE,OAAOD,CACT"}
package/dist/index.js ADDED
@@ -0,0 +1,147 @@
1
+ import { b as S, a as w, c as j, d as D, e as F, f as R, g as x, h as C, i as O, j as E, k as L, l as k, m as P, n as A, o as $, p as B, q as M, r as N, s as z, t as G, u as T, v as V, w as I, x as K, y as q, z as J, A as H, B as U, C as W, D as Q, E as X, F as Y, G as Z, H as _, I as ee, J as se, K as te, L as ae, M as ne, N as re } from "./chunks/core-ovxYfJ25.js";
2
+ import { L as ie, a as ce, b as le, c as fe, d as de, e as ue, f as pe, g as ge, h as ye, l as me, i as he, j as be, m as ve, k as Se, p as we } from "./chunks/loaders-B7J79C97.js";
3
+ import { l as d } from "./chunks/mergeConfigs-CRhPUSCj.js";
4
+ import { E as De, c as Fe, d as Re, h as xe, i as Ce, a as Oe, b as Ee, e as Le, f as ke, g as Pe, j as Ae, k as $e, m as Be, n as Me, p as Ne, t as ze, o as Ge, q as Te } from "./chunks/mergeConfigs-CRhPUSCj.js";
5
+ function g(t) {
6
+ const r = [], o = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Set();
7
+ function i(n) {
8
+ if (!o.has(n)) {
9
+ if (e.has(n))
10
+ throw new Error(`Circular dependency detected: ${n} depends on itself through ${[...e].join(" -> ")}`);
11
+ e.add(n);
12
+ for (const c of t[n] || [])
13
+ t[c] !== void 0 && i(c);
14
+ e.delete(n), o.add(n), r.push(n);
15
+ }
16
+ }
17
+ for (const n of Object.keys(t))
18
+ i(n);
19
+ return r;
20
+ }
21
+ function m(t) {
22
+ const r = {};
23
+ for (const [s, a] of Object.entries(t))
24
+ r[s] = a.dependencies || [];
25
+ const o = g(r), e = {};
26
+ for (const [s, a] of Object.entries(t))
27
+ e[s] = a.dependencies || [];
28
+ const i = {};
29
+ for (const [s, a] of Object.entries(t))
30
+ if (a.registry && (i[s] = s), a.children) {
31
+ for (const [l, f] of Object.entries(a.children))
32
+ if (f.registry) {
33
+ const p = f.path || `${s}.${l}`;
34
+ i[p] = l;
35
+ }
36
+ }
37
+ const n = /* @__PURE__ */ new Set();
38
+ for (const [s, a] of Object.entries(t))
39
+ if (a.registry && n.add(s), a.children)
40
+ for (const [l, f] of Object.entries(a.children))
41
+ f.registry && n.add(l);
42
+ const c = {};
43
+ for (const [s, a] of Object.entries(t))
44
+ "default" in a ? c[s] = a.default : a.registry ? c[s] = {} : c[s] = {};
45
+ function u(s) {
46
+ return s in c ? c[s] : {};
47
+ }
48
+ return {
49
+ resolutionOrder: o,
50
+ dependencies: e,
51
+ registryMapping: i,
52
+ validRegistries: n,
53
+ getDefault: u,
54
+ declarations: Object.freeze({ ...t })
55
+ };
56
+ }
57
+ function h(t) {
58
+ if (!t || typeof t != "object") return t;
59
+ const r = {};
60
+ for (const [o, e] of Object.entries(t))
61
+ if (e && typeof e == "object" && "value" in e && typeof e.value == "function") {
62
+ const i = e.value.toString();
63
+ i.includes("=>") && !i.startsWith("function") && d.warn(
64
+ `Function "${o}" appears to be an arrow function in wrapper format. Arrow functions cannot access element context via 'this'. Use regular function syntax: function(context, event) { ... }`
65
+ ), r[o] = e.value;
66
+ } else typeof e == "function" ? r[o] = e : d.warn(`Non-function value found in functions object: "${o}"`);
67
+ return r;
68
+ }
69
+ export {
70
+ De as ErrorType,
71
+ ie as LiveConfig,
72
+ ce as applyMap,
73
+ S as bindFunctions,
74
+ w as buildContext,
75
+ le as buildFormConfig,
76
+ fe as buildScopeFor,
77
+ j as clearFieldValue,
78
+ D as computed,
79
+ Fe as configureErrorService,
80
+ de as createLiveConfigRaw,
81
+ F as createStage,
82
+ m as createTLPSchema,
83
+ Re as deepMerge,
84
+ R as effect,
85
+ x as enableTracking,
86
+ C as enterRenderPhase,
87
+ O as exitRenderPhase,
88
+ ue as extractActions,
89
+ pe as extractLoadedState,
90
+ E as generateDynamicClasses,
91
+ L as generateFieldDynamicClass,
92
+ k as generateScopeId,
93
+ P as getByPath,
94
+ ge as getDependents,
95
+ A as getFieldValue,
96
+ ye as getPath,
97
+ $ as getRecordPath,
98
+ xe as handleError,
99
+ Ce as initDebug,
100
+ Oe as initLogger,
101
+ B as injectStyles,
102
+ M as injectStylesOnce,
103
+ Ee as isDebugActive,
104
+ Le as isDebugEnabled,
105
+ N as isEventKey,
106
+ ke as isVerbose,
107
+ me as loadFile,
108
+ he as loadJsonConfigRaw,
109
+ be as loadLiveConfigRaw,
110
+ Pe as logFormInit,
111
+ Ae as logFormReady,
112
+ $e as logRegistry,
113
+ d as logger,
114
+ ve as mapRegistries,
115
+ Be as mergeConfigs,
116
+ Se as mergeMaps,
117
+ Me as mergeRegistries,
118
+ z as mount,
119
+ G as normalizeDef,
120
+ T as normalizeKey,
121
+ Ne as parseDebugLevel,
122
+ V as parseDotNotation,
123
+ I as pauseTracking,
124
+ we as processBulkApply,
125
+ K as processButtonStyles,
126
+ q as processComponentStyles,
127
+ J as processFieldStyles,
128
+ H as processRegistryStyles,
129
+ U as processStyles,
130
+ W as reactive,
131
+ Q as ref,
132
+ X as removeStyles,
133
+ Y as removeStylesOnce,
134
+ Z as renderElement,
135
+ _ as renderSlot,
136
+ ee as resolveRecordData,
137
+ se as resolveSpread,
138
+ te as setByPath,
139
+ ae as setFieldValue,
140
+ ne as stop,
141
+ re as toRaw,
142
+ ze as trace,
143
+ Ge as traceGroup,
144
+ Te as traceGroupAsync,
145
+ h as unwrapFunctions
146
+ };
147
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/utils/tlpSchema.js","../src/utils/configMerger.js"],"sourcesContent":["/**\n * @module tlpSchema\n * @description TLP (Top-Level Property) declaration system\n *\n * Replaces hardcoded constants (RESOLUTION_ORDER, PROPERTY_DEPENDENCIES,\n * VALID_REGISTRIES, DEFAULT_REGISTRY_MAPPING) with a single declarative schema.\n *\n * A TLP declaration describes one top-level config property: what it depends on,\n * whether it's a registry, its default value, and any children that are\n * themselves registries.\n *\n * gst-core ships with no built-in declarations. The consumer (gst-forms, or\n * any plugin) passes declarations to createTLPSchema() and gets back derived\n * constants: resolution order, dependency graph, registry mapping, etc.\n */\n\n/**\n * Topological sort on a dependency graph.\n * Returns an array where each entry appears after all its dependencies.\n *\n * @param {Object} graph - { node: [dependency, ...], ... }\n * @returns {string[]} Sorted node names\n */\nfunction topoSort(graph) {\n const sorted = []\n const visited = new Set()\n const visiting = new Set()\n\n function visit(node) {\n if (visited.has(node)) return\n if (visiting.has(node)) {\n throw new Error(`Circular dependency detected: ${node} depends on itself through ${[...visiting].join(' -> ')}`)\n }\n visiting.add(node)\n for (const dep of graph[node] || []) {\n if (graph[dep] !== undefined) {\n visit(dep)\n }\n }\n visiting.delete(node)\n visited.add(node)\n sorted.push(node)\n }\n\n for (const node of Object.keys(graph)) {\n visit(node)\n }\n\n return sorted\n}\n\n/**\n * Build a TLP schema from declarations.\n *\n * @param {Object} declarations - TLP declarations keyed by property name\n *\n * Each declaration can have:\n * - dependencies: string[] - other TLPs this one depends on (default: [])\n * - registry: boolean - whether this TLP is a registry (default: false).\n * All registries participate in dot-notation cross-references\n * (e.g. \"fields.email\", \"optionSets.countries\").\n * - default: any - default value. Registries default to {}, non-registries\n * to {} as well unless overridden (layout -> [], styles -> null, etc.)\n * - children: Object - nested properties that are themselves registries.\n * Keyed by child name, each child can have { registry, path }.\n * The path defaults to \"parentName.childName\" in the loaded config.\n *\n * @returns {Object} schema with derived constants:\n * - resolutionOrder: string[] - topologically sorted property names\n * - dependencies: Object - { property: [dependency, ...] }\n * - registryMapping: Object - { sourcePath: targetRegistryKey }\n * - validRegistries: Set - all registry names (for dot-notation cross-references)\n * - getDefault: (property) => defaultValue\n * - declarations: Object - the original declarations (frozen)\n */\nexport function createTLPSchema(declarations) {\n // Build dependency graph for topological sort\n const depGraph = {}\n for (const [name, decl] of Object.entries(declarations)) {\n depGraph[name] = decl.dependencies || []\n }\n\n const resolutionOrder = topoSort(depGraph)\n\n // Build dependencies map (same shape as PROPERTY_DEPENDENCIES)\n const dependencies = {}\n for (const [name, decl] of Object.entries(declarations)) {\n dependencies[name] = decl.dependencies || []\n }\n\n // Build registry mapping (same shape as DEFAULT_REGISTRY_MAPPING)\n // Maps source paths in loaded config to target registry keys\n const registryMapping = {}\n for (const [name, decl] of Object.entries(declarations)) {\n if (decl.registry) {\n registryMapping[name] = name\n }\n // Process children that are registries\n if (decl.children) {\n for (const [childName, childDecl] of Object.entries(decl.children)) {\n if (childDecl.registry) {\n const sourcePath = childDecl.path || `${name}.${childName}`\n registryMapping[sourcePath] = childName\n }\n }\n }\n }\n\n // Build validRegistries set (all registries participate in dot-notation)\n const validRegistries = new Set()\n for (const [name, decl] of Object.entries(declarations)) {\n if (decl.registry) {\n validRegistries.add(name)\n }\n if (decl.children) {\n for (const [childName, childDecl] of Object.entries(decl.children)) {\n if (childDecl.registry) {\n validRegistries.add(childName)\n }\n }\n }\n }\n\n // Build default getter\n const defaults = {}\n for (const [name, decl] of Object.entries(declarations)) {\n if ('default' in decl) {\n defaults[name] = decl.default\n } else if (decl.registry) {\n defaults[name] = {}\n } else {\n defaults[name] = {}\n }\n }\n\n function getDefault(property) {\n return property in defaults ? defaults[property] : {}\n }\n\n return {\n resolutionOrder,\n dependencies,\n registryMapping,\n validRegistries,\n getDefault,\n declarations: Object.freeze({ ...declarations })\n }\n}\n\n","// src/components/utils/configMerger.js\nimport { logger } from './logger.js'\n\n/**\n * Unwraps function wrappers from the wrapper format { value: fn, __importance: n }\n * to just the function value.\n *\n * Also detects and warns about arrow functions which cannot access element context via 'this'.\n *\n * @param {Object} functionsObj - Object containing functions or wrapped functions\n * @returns {Object} Object with unwrapped functions\n */\nexport function unwrapFunctions(functionsObj) {\n if (!functionsObj || typeof functionsObj !== 'object') return functionsObj\n\n const unwrapped = {}\n for (const [key, value] of Object.entries(functionsObj)) {\n // Handle wrapper format: { value: fn, __importance: n }\n if (value && typeof value === 'object' && 'value' in value && typeof value.value === 'function') {\n const fnStr = value.value.toString()\n if (fnStr.includes('=>') && !fnStr.startsWith('function')) {\n logger.warn(\n `Function \"${key}\" appears to be an arrow function in wrapper format. ` +\n `Arrow functions cannot access element context via 'this'. ` +\n `Use regular function syntax: function(context, event) { ... }`\n )\n }\n unwrapped[key] = value.value\n } else if (typeof value === 'function') {\n // Regular function - pass through\n unwrapped[key] = value\n } else {\n logger.warn(`Non-function value found in functions object: \"${key}\"`)\n }\n }\n return unwrapped\n}\n"],"names":["topoSort","graph","sorted","visited","visiting","visit","node","dep","createTLPSchema","declarations","depGraph","name","decl","resolutionOrder","dependencies","registryMapping","childName","childDecl","sourcePath","validRegistries","defaults","getDefault","property","unwrapFunctions","functionsObj","unwrapped","key","value","fnStr","logger"],"mappings":";;;;AAuBA,SAASA,EAASC,GAAO;AACvB,QAAMC,IAAS,CAAA,GACTC,IAAU,oBAAI,IAAG,GACjBC,IAAW,oBAAI,IAAG;AAExB,WAASC,EAAMC,GAAM;AACnB,QAAI,CAAAH,EAAQ,IAAIG,CAAI,GACpB;AAAA,UAAIF,EAAS,IAAIE,CAAI;AACnB,cAAM,IAAI,MAAM,iCAAiCA,CAAI,8BAA8B,CAAC,GAAGF,CAAQ,EAAE,KAAK,MAAM,CAAC,EAAE;AAEjH,MAAAA,EAAS,IAAIE,CAAI;AACjB,iBAAWC,KAAON,EAAMK,CAAI,KAAK,CAAA;AAC/B,QAAIL,EAAMM,CAAG,MAAM,UACjBF,EAAME,CAAG;AAGb,MAAAH,EAAS,OAAOE,CAAI,GACpBH,EAAQ,IAAIG,CAAI,GAChBJ,EAAO,KAAKI,CAAI;AAAA;AAAA,EAClB;AAEA,aAAWA,KAAQ,OAAO,KAAKL,CAAK;AAClC,IAAAI,EAAMC,CAAI;AAGZ,SAAOJ;AACT;AA0BO,SAASM,EAAgBC,GAAc;AAE5C,Q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,IACL,iBAAAT;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,iBAAAI;AAAA,IACA,YAAAE;AAAA,IACA,cAAc,OAAO,OAAO,EAAE,GAAGZ,EAAY,CAAE;AAAA,EACnD;AACA;ACvIO,SAASc,EAAgBC,GAAc;AAC5C,MAAI,CAACA,KAAgB,OAAOA,KAAiB,SAAU,QAAOA;AAE9D,QAAMC,IAAY,CAAA;AAClB,aAAW,CAACC,GAAKC,CAAK,KAAK,OAAO,QAAQH,CAAY;AAEpD,QAAIG,KAAS,OAAOA,KAAU,YAAY,WAAWA,KAAS,OAAOA,EAAM,SAAU,YAAY;AAC/F,YAAMC,IAAQD,EAAM,MAAM,SAAQ;AAClC,MAAIC,EAAM,SAAS,IAAI,KAAK,CAACA,EAAM,WAAW,UAAU,KACtDC,EAAO;AAAA,QACL,aAAaH,CAAG;AAAA,MAG1B,GAEMD,EAAUC,CAAG,IAAIC,EAAM;AAAA,IACzB,MAAO,CAAI,OAAOA,KAAU,aAE1BF,EAAUC,CAAG,IAAIC,IAEjBE,EAAO,KAAK,kDAAkDH,CAAG,GAAG;AAGxE,SAAOD;AACT;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/loaders-BEwXPBCN.js"),i=require("./chunks/mergeConfigs-Dgwcseh2.js");exports.LiveConfig=e.LiveConfig;exports.applyMap=e.applyMap;exports.buildFormConfig=e.buildFormConfig;exports.createLiveConfig=e.createLiveConfig;exports.extractActions=e.extractActions;exports.getPath=e.getPath;exports.loadFile=e.loadFile;exports.loadJsonConfig=e.loadJsonConfig;exports.loadLiveConfig=e.loadLiveConfig;exports.mapRegistries=e.mapRegistries;exports.mergeMaps=e.mergeMaps;exports.deepMerge=i.deepMerge;exports.mergeConfigs=i.mergeConfigs;exports.mergeRegistries=i.mergeRegistries;
2
+ //# sourceMappingURL=loaders.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loaders.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { L as s, a as i, b as o, d as g, e as r, h as t, l as m, i as n, j as f, m as p, k as d } from "./chunks/loaders-B7J79C97.js";
2
+ import { d as C, m as L, n as c } from "./chunks/mergeConfigs-CRhPUSCj.js";
3
+ export {
4
+ s as LiveConfig,
5
+ i as applyMap,
6
+ o as buildFormConfig,
7
+ g as createLiveConfig,
8
+ C as deepMerge,
9
+ r as extractActions,
10
+ t as getPath,
11
+ m as loadFile,
12
+ n as loadJsonConfig,
13
+ f as loadLiveConfig,
14
+ p as mapRegistries,
15
+ L as mergeConfigs,
16
+ d as mergeMaps,
17
+ c as mergeRegistries
18
+ };
19
+ //# sourceMappingURL=loaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loaders.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@archduck/gst-core",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Compositional config-driven rendering engine",
6
+ "keywords": [
7
+ "forms",
8
+ "engine",
9
+ "configuration",
10
+ "compositional",
11
+ "reactive"
12
+ ],
13
+ "author": "Alan Aydelott",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://gitlab.com/Aydelott/gst-core.git"
18
+ },
19
+ "homepage": "https://gitlab.com/Aydelott/gst-core",
20
+ "bugs": {
21
+ "url": "https://gitlab.com/Aydelott/gst-core/-/issues"
22
+ },
23
+ "main": "./dist/index.cjs",
24
+ "module": "./dist/index.js",
25
+ "exports": {
26
+ ".": {
27
+ "import": "./dist/index.js",
28
+ "require": "./dist/index.cjs"
29
+ },
30
+ "./core": {
31
+ "import": "./dist/core.js",
32
+ "require": "./dist/core.cjs"
33
+ },
34
+ "./loaders": {
35
+ "import": "./dist/loaders.js",
36
+ "require": "./dist/loaders.cjs"
37
+ }
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "README.md",
42
+ "LICENSE"
43
+ ],
44
+ "dependencies": {
45
+ "@vue/reactivity": "^3.5.32"
46
+ }
47
+ }