@jbpark/live-editor 1.12.0 → 1.14.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":"ast-Dq1EfxA5.js","names":["_generate","t","parseExpression","t","parseExpression","parseExpression","t","t","parse","t","parse","t","parseExpression"],"sources":["../src/utils/ast/types.ts","../src/utils/ast/helpers.ts","../src/utils/ast/value.ts","../src/utils/ast/binding.ts","../node_modules/.pnpm/nanoid@3.3.18/node_modules/nanoid/index.browser.js","../src/utils/ast/extract.ts","../src/utils/ast/update.ts","../src/utils/ast/tree.ts","../src/utils/ast/validate.ts"],"sourcesContent":["export interface Attribute {\n name: string;\n value: string | null;\n isStringLiteral?: boolean;\n}\n\nexport interface DataAttrNode {\n id?: string;\n tagName: string;\n attributes: Attribute[];\n dataAttributes: Attribute[];\n textContent: string;\n rawChildren?: string;\n loc?: {\n start: { line: number; column: number };\n end: { line: number; column: number };\n };\n children?: DataAttrNode[];\n isFragment?: boolean;\n bindings?: BindingItem[];\n}\n\nexport interface BindingOption {\n label: string;\n value: string;\n}\n\nexport const BINDING_TYPES = [\n 'array',\n 'object',\n 'string',\n 'number',\n 'boolean',\n 'color',\n 'jsx',\n 'richtext',\n 'date',\n 'url',\n 'icon-picker',\n 'asset-picker',\n] as const;\n\nexport type BindingType = (typeof BINDING_TYPES)[number];\n\nexport interface BindingRenderLeaf {\n type: BindingType;\n property?: string;\n render?: BindingRenderMap;\n}\n\nexport interface BindingRenderMap {\n [key: string]: BindingRenderLeaf | BindingRenderMap;\n}\n\nexport interface BindingItem {\n label: string;\n property: string;\n type?: BindingType;\n options?: BindingOption[];\n render?: BindingRenderMap;\n min?: number;\n max?: number;\n pattern?: string;\n required?: boolean;\n}\n\nexport type NodeValueType =\n | 'boolean'\n | 'number'\n | 'string'\n | 'null'\n | 'array'\n | 'object'\n | 'unknown';\n\nexport type EditableNodeValueType = 'boolean' | 'number' | 'string' | 'null';\n\nexport interface ExtractedNodeValue {\n type: NodeValueType;\n value: string | number | boolean | null;\n}\n","import _generate from '@babel/generator';\nimport { parseExpression } from '@babel/parser';\nimport * as t from '@babel/types';\n\nimport { REGEX } from '../../constants';\nimport type { Attribute } from './types';\n\n// Same @babel/* CJS/ESM interop issue as document.ts's traverse import:\n// @babel/generator's CJS build re-exports itself as `{ default: generate,\n// generate, CodeGenerator }`, and Vite's browser dependency pre-bundling\n// doesn't unwrap that inner `.default` again — `generate` resolved to the\n// whole exports object, not the function. Every generateCode() call threw,\n// which extract.ts's extractAttributes() silently swallows into a `null`\n// attribute value, and update.ts's callers surface as \"Failed to parse/\n// update this section\" toasts.\nconst generate =\n typeof _generate === 'function'\n ? _generate\n : (_generate as unknown as { default: typeof _generate }).default;\n\nexport const wrap = (code: string) => {\n return `<>${code}</>`;\n};\n\nexport const unwrap = (generated: string) => {\n return generated\n .replace(/^<>\\s*/g, '')\n .replace(/\\s*<\\/>\\s*;?\\s*$/g, '')\n .trim();\n};\n\nexport const attrValue = ({\n value,\n isStringLiteral,\n}: Attribute): t.JSXAttribute['value'] => {\n if (value === null) {\n return null;\n }\n\n if (isStringLiteral) {\n return t.stringLiteral(value);\n }\n\n const trimmed = value.trim();\n\n if (REGEX.NUMBER.test(trimmed)) {\n return t.jsxExpressionContainer(t.numericLiteral(parseFloat(trimmed)));\n }\n\n if (REGEX.BOOLEAN_OR_NULL.test(trimmed)) {\n const expr = parseExpression(trimmed, {\n plugins: ['jsx', 'typescript'],\n });\n return t.jsxExpressionContainer(expr);\n }\n\n try {\n const expr = parseExpression(trimmed, {\n plugins: ['jsx', 'typescript'],\n });\n return t.jsxExpressionContainer(expr);\n } catch {\n return t.stringLiteral(trimmed);\n }\n};\n\nexport const generateCode = (node: t.Node): string => {\n return generate(node, { jsescOption: { minimal: true } }).code;\n};\n","import { parseExpression } from '@babel/parser';\nimport * as t from '@babel/types';\n\nimport { REGEX } from '../../constants';\nimport { generateCode } from './helpers';\nimport type { ExtractedNodeValue, NodeValueType } from './types';\n\nconst dedent = (str: string): string => {\n const lines = str\n .replace(/^\\n/, '')\n .replace(/\\n\\s*$/, '')\n .split('\\n');\n\n const indent = lines.reduce((min, line) => {\n if (!line.trim()) {\n return min;\n }\n const match = line.match(/^(\\s*)/);\n return Math.min(min, match?.[1]?.length ?? 0);\n }, Infinity);\n\n return indent === Infinity\n ? str.trim()\n : lines.map(line => line.slice(indent)).join('\\n');\n};\n\n// AST 노드를 코드 실행(new Function/eval) 없이 순수 리터럴 구조만 재귀적으로\n// 실제 JS 값으로 변환한다. 함수 호출, 변수 참조 등 리터럴이 아닌 표현식은\n// 평가하지 않고 undefined를 반환한다 — 사용자 코드는 iframe 안에서만 실행한다는\n// 이 저장소의 원칙(AGENTS.md)을 이 패널 UI(메인 문서에서 렌더링됨)에서도 지키기 위함.\nexport const evaluateLiteral = (node: t.Node): unknown => {\n if (t.isStringLiteral(node)) {\n return node.value;\n }\n\n if (t.isNumericLiteral(node)) {\n return node.value;\n }\n\n if (t.isBooleanLiteral(node)) {\n return node.value;\n }\n\n if (t.isNullLiteral(node)) {\n return null;\n }\n\n if (t.isIdentifier(node) && node.name === 'undefined') {\n return undefined;\n }\n\n if (\n t.isUnaryExpression(node) &&\n node.operator === '-' &&\n t.isNumericLiteral(node.argument)\n ) {\n return -node.argument.value;\n }\n\n if (t.isTemplateLiteral(node) && node.expressions.length === 0) {\n return node.quasis[0]?.value.cooked ?? node.quasis[0]?.value.raw ?? '';\n }\n\n if (t.isJSXElement(node) || t.isJSXFragment(node)) {\n return generateCode(node);\n }\n\n if (t.isArrayExpression(node)) {\n return node.elements.map(element =>\n element ? evaluateLiteral(element) : null,\n );\n }\n\n if (t.isObjectExpression(node)) {\n const result: Record<string, unknown> = {};\n\n for (const prop of node.properties) {\n if (!t.isObjectProperty(prop)) {\n continue;\n }\n\n let key: string | null = null;\n\n if (t.isIdentifier(prop.key)) {\n key = prop.key.name;\n } else if (t.isStringLiteral(prop.key)) {\n key = prop.key.value;\n } else if (t.isNumericLiteral(prop.key)) {\n key = String(prop.key.value);\n }\n\n if (key === null) {\n continue;\n }\n\n result[key] = evaluateLiteral(prop.value);\n }\n\n return result;\n }\n\n return undefined;\n};\n\nexport const parseValue = (value: unknown): unknown => {\n if (typeof value !== 'string') {\n return value;\n }\n\n const trimmed = value.trim();\n\n if (!trimmed) {\n return value;\n }\n\n if (REGEX.NUMBER.test(trimmed)) {\n return parseFloat(trimmed);\n }\n\n if (REGEX.BOOLEAN_OR_NULL.test(trimmed)) {\n if (trimmed === 'true') {\n return true;\n }\n if (trimmed === 'false') {\n return false;\n }\n if (trimmed === 'null') {\n return null;\n }\n if (trimmed === 'undefined') {\n return undefined;\n }\n }\n\n if (\n (trimmed.startsWith('{') && trimmed.endsWith('}')) ||\n (trimmed.startsWith('[') && trimmed.endsWith(']'))\n ) {\n try {\n const ast = parseExpression(trimmed, {\n plugins: ['jsx', 'typescript'],\n });\n\n if (t.isObjectExpression(ast) || t.isArrayExpression(ast)) {\n return evaluateLiteral(ast);\n }\n } catch {\n /* ignore */\n }\n\n return value;\n }\n\n return value;\n};\n\nexport const extractNodeValue = (node: t.Node): ExtractedNodeValue => {\n if (t.isBooleanLiteral(node)) {\n return { type: 'boolean', value: node.value };\n }\n\n if (t.isNumericLiteral(node)) {\n return { type: 'number', value: node.value };\n }\n\n if (\n t.isUnaryExpression(node) &&\n node.operator === '-' &&\n t.isNumericLiteral(node.argument)\n ) {\n return { type: 'number', value: -node.argument.value };\n }\n\n if (t.isStringLiteral(node)) {\n return { type: 'string', value: node.value };\n }\n\n if (t.isTemplateLiteral(node)) {\n if (node.expressions.length === 0 && node.quasis.length === 1) {\n return {\n type: 'string',\n value: dedent(\n node.quasis[0]!.value.cooked ?? node.quasis[0]!.value.raw,\n ),\n };\n }\n return { type: 'string', value: generateCode(node) };\n }\n\n if (t.isNullLiteral(node)) {\n return { type: 'null', value: null };\n }\n\n if (t.isArrayExpression(node)) {\n return { type: 'array', value: generateCode(node) };\n }\n\n if (t.isObjectExpression(node)) {\n return { type: 'object', value: generateCode(node) };\n }\n\n if (t.isJSXElement(node) || t.isJSXFragment(node)) {\n return { type: 'string', value: generateCode(node) };\n }\n\n return { type: 'unknown', value: null };\n};\n\nexport const createNodeFromValue = (\n type: NodeValueType,\n value: unknown,\n): t.Expression | null => {\n switch (type) {\n case 'boolean': {\n return t.booleanLiteral(value === true);\n }\n case 'number': {\n return t.numericLiteral(Number(value));\n }\n case 'string': {\n return t.stringLiteral(String(value));\n }\n case 'null': {\n return t.nullLiteral();\n }\n case 'array':\n case 'object':\n case 'unknown': {\n return null;\n }\n default: {\n return null;\n }\n }\n};\n\nexport const parseArrayExpression = (value: string) => {\n try {\n const ast = parseExpression(value, {\n plugins: ['jsx', 'typescript'],\n });\n\n if (!t.isArrayExpression(ast)) {\n return null;\n }\n\n return ast;\n } catch (error) {\n console.error('❌ Array parsing error:', error);\n return null;\n }\n};\n\nexport const extractObjectProperties = (\n element: t.ObjectExpression,\n): Record<string, ExtractedNodeValue & { astNode: t.Node }> => {\n const properties: Record<string, ExtractedNodeValue & { astNode: t.Node }> =\n {};\n\n element.properties.forEach(prop => {\n if (t.isObjectProperty(prop) && t.isIdentifier(prop.key)) {\n const key = prop.key.name;\n\n if (key === 'children') {\n return;\n }\n\n const extracted = extractNodeValue(prop.value);\n\n properties[key] = {\n ...extracted,\n astNode: prop.value,\n };\n }\n });\n\n return properties;\n};\n\nexport const arrayExpressionToCode = (\n elements: t.ObjectExpression[],\n): string => {\n const nextAst = t.arrayExpression(elements);\n return generateCode(nextAst);\n};\n","import { parseExpression } from '@babel/parser';\nimport * as t from '@babel/types';\nimport { z } from 'zod';\n\nimport { BINDING_PROP, DATA_ATTR } from '../../constants';\nimport {\n BINDING_TYPES,\n type BindingItem,\n type BindingOption,\n type BindingRenderMap,\n type DataAttrNode,\n} from './types';\nimport { evaluateLiteral, parseArrayExpression } from './value';\n\nconst bindingTypeSchema = z.enum(BINDING_TYPES);\n\nconst bindingOptionSchema = z.object({\n label: z.string(),\n value: z.string(),\n});\n\nconst bindingRenderLeafSchema = z.object({\n type: bindingTypeSchema,\n property: z.string().optional(),\n});\n\nconst rawBindingItemSchema = z.object({\n label: z.string(),\n property: z.string().optional(),\n type: bindingTypeSchema.optional(),\n options: z.array(bindingOptionSchema).optional(),\n min: z.number().optional(),\n max: z.number().optional(),\n pattern: z.string().optional(),\n required: z.boolean().optional(),\n});\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n};\n\n// A render map entry is either a \"leaf\" (has its own `type`) or a nested\n// map of further entries — recurse into whichever it looks like, and drop\n// anything that matches neither instead of failing the whole map.\nconst sanitizeRenderMap = (value: unknown): BindingRenderMap | undefined => {\n if (!isPlainObject(value)) {\n return undefined;\n }\n\n const map: BindingRenderMap = {};\n\n for (const [key, raw] of Object.entries(value)) {\n if (!isPlainObject(raw)) {\n continue;\n }\n\n if ('type' in raw) {\n const leaf = bindingRenderLeafSchema.safeParse(raw);\n\n if (leaf.success) {\n const render = sanitizeRenderMap(raw.render);\n map[key] = render ? { ...leaf.data, render } : leaf.data;\n }\n continue;\n }\n\n const nested = sanitizeRenderMap(raw);\n\n if (nested) {\n map[key] = nested;\n }\n }\n\n return Object.keys(map).length > 0 ? map : undefined;\n};\n\nexport const parseBinding = (bindingValue: string | null): BindingItem[] => {\n if (!bindingValue) {\n return [];\n }\n\n const ast = parseArrayExpression(bindingValue);\n\n if (!ast) {\n return [];\n }\n\n const raw = evaluateLiteral(ast);\n\n if (!Array.isArray(raw)) {\n return [];\n }\n\n const items: BindingItem[] = [];\n\n for (const rawItem of raw) {\n if (!isPlainObject(rawItem)) {\n continue;\n }\n\n // Drop an unrecognized `type` instead of rejecting the whole item — an\n // authored binding with a typo'd/future type string still works as an\n // untyped field rather than disappearing entirely.\n const sanitizedType = bindingTypeSchema.safeParse(rawItem.type);\n\n // Drop individually malformed options instead of rejecting the whole\n // item — a select field with 3 valid options and 1 malformed one should\n // still work with the 3 valid ones.\n const sanitizedOptions = Array.isArray(rawItem.options)\n ? rawItem.options\n .map(option => {\n const parsed = bindingOptionSchema.safeParse(option);\n return parsed.success ? parsed.data : null;\n })\n .filter((option): option is BindingOption => option !== null)\n : undefined;\n\n const parsed = rawBindingItemSchema.safeParse({\n ...rawItem,\n type: sanitizedType.success ? sanitizedType.data : undefined,\n options: sanitizedOptions?.length ? sanitizedOptions : undefined,\n });\n\n if (!parsed.success) {\n continue;\n }\n\n const { label, property, type, options, min, max, pattern, required } =\n parsed.data;\n\n if (property === undefined && type !== 'richtext') {\n continue;\n }\n\n const render = sanitizeRenderMap(rawItem.render);\n\n items.push({\n label,\n property: property ?? BINDING_PROP.INNER_HTML,\n ...(type !== undefined && { type }),\n ...(options?.length && { options }),\n ...(render && { render }),\n ...(min !== undefined && { min }),\n ...(max !== undefined && { max }),\n ...(pattern !== undefined && { pattern }),\n ...(required !== undefined && { required }),\n });\n }\n\n return items;\n};\n\nexport const getCurrentValue = (\n node: DataAttrNode,\n property: string,\n): string => {\n switch (property) {\n case BINDING_PROP.INNER_TEXT: {\n return node.textContent || '';\n }\n\n case BINDING_PROP.INNER_HTML: {\n // richtext 타입: dangerouslySetInnerHTML={{ __html }} 에서 읽기\n const dsiAttr = node.attributes.find(\n a => a.name === 'dangerouslySetInnerHTML',\n );\n if (dsiAttr?.value) {\n try {\n const expr = parseExpression(dsiAttr.value, {\n plugins: ['jsx', 'typescript'],\n });\n if (t.isObjectExpression(expr)) {\n const htmlProp = expr.properties.find(\n p =>\n t.isObjectProperty(p) &&\n t.isIdentifier(p.key) &&\n p.key.name === '__html',\n ) as t.ObjectProperty | undefined;\n if (htmlProp) {\n if (t.isStringLiteral(htmlProp.value)) {\n return htmlProp.value.value;\n }\n if (\n t.isTemplateLiteral(htmlProp.value) &&\n htmlProp.value.expressions.length === 0\n ) {\n return (\n htmlProp.value.quasis[0]?.value.cooked ??\n htmlProp.value.quasis[0]?.value.raw ??\n ''\n );\n }\n }\n }\n } catch {\n // ignore\n }\n }\n return node.rawChildren || node.textContent || '';\n }\n\n case BINDING_PROP.CHILDREN: {\n return JSON.stringify(node?.children || []);\n }\n\n default: {\n const customAttr = node.attributes.find(attr => attr.name === property);\n const value = customAttr?.value || '';\n\n return value;\n }\n }\n};\n\nconst hasEditableBindings = (node: DataAttrNode): boolean => {\n const bindingAttr = node.dataAttributes.find(\n attr => attr.name === DATA_ATTR.BINDING,\n );\n\n if (!bindingAttr?.value) {\n return false;\n }\n\n const bindings = node.bindings || parseBinding(bindingAttr.value);\n\n return bindings.length > 0;\n};\n\nexport const findEditableChildren = (node: DataAttrNode): DataAttrNode[] => {\n const editableChildren: DataAttrNode[] = [];\n\n const traverse = (children: DataAttrNode[] | undefined) => {\n if (!children) {\n return;\n }\n\n for (const child of children) {\n if (hasEditableBindings(child)) {\n editableChildren.push(child);\n }\n traverse(child.children);\n }\n };\n\n traverse(node.children);\n\n return editableChildren;\n};\n","\nimport { urlAlphabet } from './url-alphabet/index.js'\n\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\n\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n\n\n\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n\n return (size = defaultSize) => {\n if (size <= 0) return ''\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step | 0\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\n\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\n\nlet nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n byte &= 63\n if (byte < 36) {\n id += byte.toString(36)\n } else if (byte < 62) {\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","import { parse } from '@babel/parser';\nimport * as t from '@babel/types';\nimport { nanoid } from 'nanoid';\n\nimport { BINDING_PROP, CONFIG, DATA_ATTR } from '../../constants';\nimport { createBoundedCache } from '../cache';\nimport { parseBinding } from './binding';\nimport { traverse } from './document';\nimport { attrValue, generateCode, wrap } from './helpers';\nimport type { Attribute, BindingItem, DataAttrNode } from './types';\n\nconst collectText = (\n children: (\n | t.JSXText\n | t.JSXExpressionContainer\n | t.JSXElement\n | t.JSXFragment\n | t.JSXSpreadChild\n )[],\n) => {\n return children\n .filter(c => t.isJSXText(c))\n .map(c => (c as t.JSXText).value.trim())\n .filter(v => v.length)\n .join(' ');\n};\n\nconst getTagName = (opening: t.JSXOpeningElement): string => {\n if (t.isJSXIdentifier(opening.name)) {\n return opening.name.name;\n }\n\n if (t.isJSXMemberExpression(opening.name)) {\n return resolveMemberName(opening.name);\n }\n\n return '';\n};\n\nconst resolveMemberName = (expr: t.JSXMemberExpression): string => {\n const parts: string[] = [];\n\n const collectMemberParts = (\n node: t.JSXMemberExpression['object'] | t.JSXMemberExpression['property'],\n ): void => {\n if (t.isJSXIdentifier(node)) {\n parts.push(node.name);\n } else if (t.isJSXMemberExpression(node)) {\n collectMemberParts(node.object);\n\n if (t.isJSXIdentifier(node.property)) {\n parts.push(node.property.name);\n }\n }\n };\n\n collectMemberParts(expr.object);\n\n if (t.isJSXIdentifier(expr.property)) {\n parts.push(expr.property.name);\n }\n\n return parts.join('.');\n};\n\nconst parseJSXName = (\n tagName: string,\n): t.JSXIdentifier | t.JSXMemberExpression => {\n const parts = tagName.split('.');\n\n if (parts.length === 1) {\n return t.jsxIdentifier(parts[0]!);\n }\n\n let expr: t.JSXIdentifier | t.JSXMemberExpression = t.jsxIdentifier(\n parts[0]!,\n );\n\n for (let i = 1; i < parts.length; i++) {\n expr = t.jsxMemberExpression(expr, t.jsxIdentifier(parts[i]!));\n }\n\n return expr;\n};\n\nconst extractCache = createBoundedCache<string, DataAttrNode[]>(\n CONFIG.CACHE_LIMIT,\n);\n\nconst extractAttributes = (\n attributes: (t.JSXAttribute | t.JSXSpreadAttribute)[],\n): { allAttrs: Attribute[]; dataAttrs: Attribute[] } => {\n const allAttrs: Attribute[] = [];\n const dataAttrs: Attribute[] = [];\n\n for (const attr of attributes) {\n if (!t.isJSXAttribute(attr) || !t.isJSXIdentifier(attr.name)) {\n continue;\n }\n\n const name = attr.name.name;\n let value: string | null = null;\n let isStringLiteral = false;\n\n if (attr.value) {\n if (t.isStringLiteral(attr.value)) {\n value = attr.value.value;\n isStringLiteral = true;\n } else if (t.isJSXExpressionContainer(attr.value)) {\n try {\n value = generateCode(attr.value.expression);\n isStringLiteral = false;\n } catch {\n value = null;\n }\n }\n }\n\n const entry = { name, value, isStringLiteral };\n\n allAttrs.push(entry);\n\n if (name.startsWith('data-')) {\n dataAttrs.push(entry);\n }\n }\n\n return { allAttrs, dataAttrs };\n};\n\nconst buildChildElements = (\n node: DataAttrNode,\n): (t.JSXText | t.JSXElement | t.JSXFragment)[] => {\n const childElements: (t.JSXText | t.JSXElement | t.JSXFragment)[] = [];\n\n if (node.textContent) {\n childElements.push(t.jsxText(node.textContent));\n }\n\n node.children?.forEach(child => {\n const childJSX = nodeToJSX(child);\n if (childJSX) {\n childElements.push(childJSX);\n }\n });\n\n return childElements;\n};\n\nexport const nodeToJSX = (\n node: DataAttrNode,\n): t.JSXElement | t.JSXFragment | null => {\n try {\n if (node.isFragment) {\n const childElements = buildChildElements(node);\n\n return t.jsxFragment(\n t.jsxOpeningFragment(),\n t.jsxClosingFragment(),\n childElements,\n );\n }\n\n if (\n node.tagName === 'div' &&\n node.dataAttributes.some(attr => attr.name === 'data-item')\n ) {\n if (node.children) {\n return nodeToJSX(node.children[0]!);\n }\n return null;\n }\n\n const attributes = node.attributes.map(attr => {\n const attrName = t.jsxIdentifier(attr.name);\n\n if (!attr.value) {\n return t.jsxAttribute(attrName, null);\n }\n\n return t.jsxAttribute(attrName, attrValue(attr));\n });\n\n const elementName = parseJSXName(node.tagName);\n\n const openingElement = t.jsxOpeningElement(elementName, attributes);\n\n const closingElement = t.jsxClosingElement(elementName);\n const children = buildChildElements(node);\n\n return t.jsxElement(openingElement, closingElement, children, false);\n } catch (error) {\n console.error('❌ DataAttrNode to JSX conversion error:', error);\n return null;\n }\n};\n\nconst createWrapperNode = (\n textContent: string,\n children: DataAttrNode[],\n): DataAttrNode => ({\n tagName: 'div',\n id: nanoid(6),\n attributes: [{ name: DATA_ATTR.ITEM, value: 'true' }],\n dataAttributes: [{ name: DATA_ATTR.ITEM, value: 'true' }],\n textContent,\n children,\n});\n\nconst createFragmentNode = (\n textContent: string,\n children: DataAttrNode[],\n): DataAttrNode => ({\n tagName: '',\n id: nanoid(6),\n attributes: [],\n dataAttributes: [],\n textContent,\n children,\n isFragment: true,\n});\n\nconst processChildrenBinding = (\n jsxElement: t.JSXElement,\n processedNodes?: WeakSet<t.JSXElement | t.JSXFragment>,\n shouldWrap: boolean = true,\n): DataAttrNode[] | undefined => {\n const jsxChildren = jsxElement.children.filter(\n child => t.isJSXElement(child) || t.isJSXFragment(child),\n );\n\n if (!jsxChildren.length) {\n return undefined;\n }\n\n const childrenNodes: DataAttrNode[] = [];\n\n jsxChildren.forEach(child => {\n if (t.isJSXElement(child)) {\n const childResults = extractFromNode(child, processedNodes);\n\n if (shouldWrap) {\n const wrapperNode = createWrapperNode(\n collectText(child.children),\n childResults,\n );\n childrenNodes.push(wrapperNode);\n } else {\n childrenNodes.push(...childResults);\n }\n } else if (t.isJSXFragment(child)) {\n processedNodes?.add(child);\n\n const fragmentChildren: DataAttrNode[] = [];\n\n child.children.forEach(fragmentChild => {\n if (t.isJSXElement(fragmentChild)) {\n const childResults = extractFromNode(fragmentChild, processedNodes);\n fragmentChildren.push(...childResults);\n }\n });\n\n if (fragmentChildren.length) {\n const fragmentNode = createFragmentNode(\n collectText(child.children),\n fragmentChildren,\n );\n childrenNodes.push(fragmentNode);\n }\n }\n });\n\n return childrenNodes.length ? childrenNodes : undefined;\n};\n\nconst skipItemsChildren = (\n jsxElement: t.JSXElement,\n processedNodes: WeakSet<t.JSXElement | t.JSXFragment>,\n propertyName: string = 'items',\n): void => {\n const opening = jsxElement.openingElement;\n\n const itemsAttr = opening.attributes.find(\n attr =>\n t.isJSXAttribute(attr) &&\n t.isJSXIdentifier(attr.name) &&\n attr.name.name === propertyName,\n );\n\n if (!itemsAttr || !t.isJSXAttribute(itemsAttr)) {\n return;\n }\n\n if (\n itemsAttr.value &&\n t.isJSXExpressionContainer(itemsAttr.value) &&\n t.isArrayExpression(itemsAttr.value.expression)\n ) {\n const arrayExpr = itemsAttr.value.expression;\n\n arrayExpr.elements.forEach(element => {\n if (t.isObjectExpression(element)) {\n element.properties.forEach(prop => {\n if (\n t.isObjectProperty(prop) &&\n t.isIdentifier(prop.key) &&\n t.isJSXElement(prop.value)\n ) {\n markProcessedJSX(prop.value, processedNodes);\n }\n });\n }\n });\n }\n};\n\nconst markProcessedJSX = (\n node: t.Node,\n processedNodes: WeakSet<t.JSXElement | t.JSXFragment>,\n): void => {\n if (t.isJSXElement(node) || t.isJSXFragment(node)) {\n processedNodes.add(node as t.JSXElement | t.JSXFragment);\n node.children.forEach(child => markProcessedJSX(child, processedNodes));\n return;\n }\n\n const expression =\n t.isJSXExpressionContainer(node) || t.isParenthesizedExpression(node);\n\n if (expression) {\n markProcessedJSX(node.expression, processedNodes);\n }\n};\n\ninterface NodeBindingInfo {\n tagName: string;\n allAttrs: Attribute[];\n dataAttrs: Attribute[];\n bindings: BindingItem[];\n childrenBinding: BindingItem | undefined;\n arrayBindings: BindingItem[];\n rawChildren: string | undefined;\n}\n\n// Shared prefix for the top-level traverse() visitor below and the manual\n// recursive descent in extractFromNode: read the tag name, attributes, and\n// parsed bindings off one JSXElement. What differs between the two callers\n// is how childrenNodes gets computed and whether the result is pushed at\n// all — traverse() only records elements with data-* attributes, while\n// extractFromNode always records the children it's asked to (see each call\n// site for details).\nconst readNodeBindingInfo = (node: t.JSXElement): NodeBindingInfo => {\n const opening = node.openingElement;\n const tagName = getTagName(opening);\n const { allAttrs, dataAttrs } = extractAttributes(opening.attributes);\n\n const bindingAttr = dataAttrs.find(attr => attr.name === DATA_ATTR.BINDING);\n const bindings = bindingAttr?.value ? parseBinding(bindingAttr.value) : [];\n\n const childrenBinding = bindings.find(\n b => b.property === BINDING_PROP.CHILDREN,\n );\n const arrayBindings = bindings.filter(\n b => b.property === BINDING_PROP.ITEMS || b.type === 'array',\n );\n\n const innerHtmlBinding = bindings.find(\n b => b.property === BINDING_PROP.INNER_HTML,\n );\n\n let rawChildren: string | undefined;\n if (innerHtmlBinding && node.children.length > 0) {\n rawChildren = node.children\n .map(child => generateCode(child))\n .join('')\n .trim();\n }\n\n return {\n tagName,\n allAttrs,\n dataAttrs,\n bindings,\n childrenBinding,\n arrayBindings,\n rawChildren,\n };\n};\n\nconst parseToNodes = (raw: string): DataAttrNode[] => {\n const wrapped = wrap(raw);\n const ast = parse(wrapped, {\n sourceType: 'module',\n plugins: ['jsx', 'typescript'],\n errorRecovery: true,\n });\n\n const results: DataAttrNode[] = [];\n\n // babel's traverse() below visits every JSXElement in the tree, top to\n // bottom, regardless of structure. But some elements are meant to be\n // recorded as *structural* children of another result — e.g. a node\n // wrapped by processChildrenBinding()/extractFromNode() into a parent's\n // `children` array, or an element sitting inside an `items` binding's\n // array literal (skipped via skipItemsChildren()/markProcessedJSX()) —\n // not as their own top-level entry in `results`. Without this WeakSet,\n // traverse() would independently re-visit those same elements once it\n // reaches them in the tree and add a second, duplicate entry for them.\n // Each helper below adds a node here the moment it pulls that node out\n // of the normal top-level flow, and the JSXElement() visitor skips\n // anything already marked.\n const processedNodes = new WeakSet<t.JSXElement | t.JSXFragment>();\n\n traverse(ast, {\n JSXElement(path) {\n if (processedNodes.has(path.node)) {\n return;\n }\n\n const {\n tagName,\n allAttrs,\n dataAttrs,\n bindings,\n childrenBinding,\n arrayBindings,\n rawChildren,\n } = readNodeBindingInfo(path.node);\n\n if (!tagName || !dataAttrs.length) {\n return;\n }\n\n let childrenNodes: DataAttrNode[] | undefined;\n\n if (childrenBinding) {\n childrenNodes = processChildrenBinding(path.node, processedNodes);\n }\n\n for (const arrayBinding of arrayBindings) {\n skipItemsChildren(path.node, processedNodes, arrayBinding.property);\n }\n\n results.push({\n tagName,\n attributes: allAttrs,\n dataAttributes: dataAttrs,\n textContent: collectText(path.node.children),\n rawChildren,\n children: childrenNodes,\n bindings,\n loc: path.node.loc\n ? {\n start: {\n line: path.node.loc.start.line,\n column: path.node.loc.start.column,\n },\n end: {\n line: path.node.loc.end.line,\n column: path.node.loc.end.column,\n },\n }\n : undefined,\n });\n },\n });\n\n return results;\n};\n\nexport function extract(raw: string): DataAttrNode[] {\n if (extractCache.has(raw)) {\n return extractCache.get(raw)!;\n }\n\n const results = parseToNodes(raw);\n\n extractCache.set(raw, results);\n\n return results;\n}\n\nfunction extractFromNode(\n node: t.JSXElement,\n processedNodes?: WeakSet<t.JSXElement | t.JSXFragment>,\n): DataAttrNode[] {\n processedNodes?.add(node);\n\n const {\n tagName,\n allAttrs,\n dataAttrs,\n bindings,\n childrenBinding,\n rawChildren,\n } = readNodeBindingInfo(node);\n\n let childrenNodes: DataAttrNode[] | undefined;\n\n if (childrenBinding) {\n childrenNodes = processChildrenBinding(node, processedNodes);\n }\n\n if (!childrenNodes) {\n childrenNodes = processChildrenBinding(node, processedNodes, false);\n }\n\n return [\n {\n tagName,\n attributes: allAttrs,\n dataAttributes: dataAttrs,\n textContent: collectText(node.children),\n rawChildren,\n children: childrenNodes,\n bindings,\n },\n ];\n}\n\nexport function clearExtractCache() {\n extractCache.clear();\n}\n","import { parse } from '@babel/parser';\nimport type { NodePath } from '@babel/traverse';\nimport * as t from '@babel/types';\nimport { nanoid } from 'nanoid';\n\nimport { BINDING_PROP, DATA_ATTR, REGEX } from '../../constants';\nimport { parseBinding } from './binding';\nimport { traverse } from './document';\nimport { nodeToJSX } from './extract';\nimport { attrValue, generateCode, unwrap, wrap } from './helpers';\nimport type { DataAttrNode } from './types';\n\nconst updateInnerText = (\n path: NodePath<t.JSXElement>,\n value: string,\n): boolean => {\n const jsxChildren = path.node.children;\n\n for (let i = jsxChildren.length - 1; i >= 0; i--) {\n if (t.isJSXText(jsxChildren[i])) {\n jsxChildren.splice(i, 1);\n }\n }\n\n jsxChildren.push(t.jsxText(value));\n return true;\n};\n\n// Injects a `{__PREFIX_<id>__}` JSX expression container as a placeholder,\n// then records how the placeholder's *generated source text* should be\n// string-replaced with the real value once generateCode() has run — used\n// for values (raw HTML, arbitrary JSX/expressions) that can't be\n// represented as AST literals, so we can't just build the real node here.\n//\n// `asRawContent: true` replaces the placeholder *including* its enclosing\n// braces, so the raw value lands as literal children content instead of a\n// JS expression (used for innerHTML). Leaving it false replaces only the\n// identifier inside the braces, so the value is inserted as the expression\n// itself (used for a `type: 'jsx'` attribute value).\nconst injectPlaceholder = (\n prefix: string,\n value: string,\n placeholders: Map<string, string>,\n { asRawContent = false }: { asRawContent?: boolean } = {},\n): t.JSXExpressionContainer => {\n const name = `__${prefix}_${nanoid(6)}__`;\n const container = t.jsxExpressionContainer(t.identifier(name));\n\n placeholders.set(asRawContent ? `{${name}}` : name, value);\n\n return container;\n};\n\nconst updateInnerHTML = (\n path: NodePath<t.JSXElement>,\n value: string,\n placeholders: Map<string, string>,\n): boolean => {\n path.node.children = [\n injectPlaceholder('HTML', value, placeholders, { asRawContent: true }),\n ];\n\n return true;\n};\n\nconst updateChildren = (\n path: NodePath<t.JSXElement>,\n value: string,\n): boolean => {\n try {\n const childrenData = JSON.parse(value) as DataAttrNode[];\n\n path.node.children.length = 0;\n\n childrenData.forEach(childData => {\n const jsxElement = nodeToJSX(childData);\n if (jsxElement) {\n path.node.children.push(jsxElement);\n }\n });\n\n return true;\n } catch (error) {\n console.error('❌ Children update error:', error);\n return false;\n }\n};\n\nconst updateRichtext = (\n path: NodePath<t.JSXElement>,\n value: string,\n): boolean => {\n path.node.children = [];\n\n const opening = path.node.openingElement;\n const htmlObject = t.objectExpression([\n t.objectProperty(t.identifier('__html'), t.stringLiteral(value)),\n ]);\n\n const existingAttr = opening.attributes.find(\n a =>\n t.isJSXAttribute(a) &&\n t.isJSXIdentifier(a.name) &&\n a.name.name === 'dangerouslySetInnerHTML',\n );\n\n if (existingAttr && t.isJSXAttribute(existingAttr)) {\n existingAttr.value = t.jsxExpressionContainer(htmlObject);\n } else {\n opening.attributes.push(\n t.jsxAttribute(\n t.jsxIdentifier('dangerouslySetInnerHTML'),\n t.jsxExpressionContainer(htmlObject),\n ),\n );\n }\n\n return true;\n};\n\nconst updateAttribute = (\n opening: t.JSXOpeningElement,\n propertyName: string,\n value: string,\n): boolean => {\n const customAttr = opening.attributes.find(\n attr =>\n t.isJSXAttribute(attr) &&\n t.isJSXIdentifier(attr.name) &&\n attr.name.name === propertyName,\n );\n\n if (customAttr && t.isJSXAttribute(customAttr)) {\n const trimmed = value.trim();\n const isExpression =\n trimmed.startsWith('[') ||\n trimmed.startsWith('{') ||\n REGEX.NUMBER.test(trimmed) ||\n REGEX.BOOLEAN_OR_NULL.test(trimmed);\n\n customAttr.value = attrValue({\n name: propertyName,\n value,\n isStringLiteral: !isExpression,\n });\n\n return true;\n }\n\n return false;\n};\n\nexport interface UpdateResult {\n code: string;\n success: boolean;\n}\n\nexport const update = (\n code: string,\n dataId: string,\n label: string,\n value: string,\n): UpdateResult => {\n try {\n const wrapped = wrap(code);\n const ast = parse(wrapped, {\n sourceType: 'module',\n plugins: ['jsx', 'typescript'],\n });\n\n let changed = false;\n const jsxPlaceholders = new Map<string, string>();\n\n traverse(ast, {\n JSXElement(path) {\n const opening = path.node.openingElement;\n\n const idAttr = opening.attributes.find(attr => {\n return (\n t.isJSXAttribute(attr) &&\n t.isJSXIdentifier(attr.name) &&\n attr.name.name === DATA_ATTR.ID &&\n attr.value &&\n t.isStringLiteral(attr.value) &&\n attr.value.value === dataId\n );\n });\n\n if (!idAttr) {\n return;\n }\n\n const bindingAttr = opening.attributes.find(\n (attr): attr is t.JSXAttribute =>\n t.isJSXAttribute(attr) &&\n t.isJSXIdentifier(attr.name) &&\n attr.name.name === DATA_ATTR.BINDING,\n );\n\n if (!bindingAttr?.value) {\n return;\n }\n\n let bindingValue = '';\n\n if (t.isStringLiteral(bindingAttr.value)) {\n bindingValue = bindingAttr.value.value;\n } else if (t.isJSXExpressionContainer(bindingAttr.value)) {\n try {\n bindingValue = generateCode(bindingAttr.value.expression);\n } catch {\n return;\n }\n }\n\n const bindings = parseBinding(bindingValue);\n\n const propertyBinding = bindings.find(\n binding => binding.label === label,\n );\n\n if (!propertyBinding) {\n return;\n }\n\n switch (propertyBinding.property) {\n case BINDING_PROP.INNER_TEXT: {\n changed = updateInnerText(path, value);\n break;\n }\n\n case BINDING_PROP.INNER_HTML: {\n if (propertyBinding.type === 'richtext') {\n changed = updateRichtext(path, value);\n } else {\n changed = updateInnerHTML(path, value, jsxPlaceholders);\n }\n break;\n }\n\n case BINDING_PROP.CHILDREN: {\n changed = updateChildren(path, value);\n break;\n }\n\n default: {\n if (propertyBinding.type === 'jsx') {\n const attr = opening.attributes.find(\n a =>\n t.isJSXAttribute(a) &&\n t.isJSXIdentifier(a.name) &&\n a.name.name === propertyBinding.property,\n );\n\n if (attr && t.isJSXAttribute(attr)) {\n attr.value = injectPlaceholder(\n 'JSX',\n value.trim(),\n jsxPlaceholders,\n );\n changed = true;\n }\n } else {\n changed = updateAttribute(\n opening,\n propertyBinding.property,\n value,\n );\n }\n\n break;\n }\n }\n },\n });\n\n if (!changed) {\n return { code, success: false };\n }\n\n let result = unwrap(generateCode(ast));\n\n for (const [placeholder, original] of jsxPlaceholders) {\n // 두 번째 인자가 문자열이면 $&, $$ 같은 특수 치환 패턴으로 해석되어\n // original 안에 그런 문자가 있으면 결과가 깨진다 — 함수형 치환자로 방지.\n result = result.replace(placeholder, () => original);\n }\n\n return { code: result, success: true };\n } catch (error) {\n console.error('❌ Code update error:', error);\n return { code, success: false };\n }\n};\n\nexport const bulkUpdate = (\n raw: string,\n entries: { dataId: string; label: string; value: string }[],\n): UpdateResult => {\n let current = raw;\n let allSucceeded = true;\n\n for (const entry of entries) {\n const result = update(current, entry.dataId, entry.label, entry.value);\n current = result.code;\n allSucceeded = allSucceeded && result.success;\n }\n\n return { code: current, success: allSucceeded };\n};\n","import { parseExpression } from '@babel/parser';\nimport * as t from '@babel/types';\nimport { nanoid } from 'nanoid';\n\nimport { DATA_ATTR } from '../../constants';\nimport { generateCode } from './helpers';\n\nexport const replaceIds = (\n code: string,\n generateId: () => string = () => nanoid(6),\n): string => {\n return code.replace(new RegExp(`${DATA_ATTR.ID}=\"[^\"]*\"`, 'g'), () => {\n return `${DATA_ATTR.ID}=\"${generateId()}\"`;\n });\n};\n\nexport const fillIds = (\n code: string,\n generateId: () => string = () => nanoid(6),\n): string => {\n return code.replace(new RegExp(`${DATA_ATTR.ID}=\"\"`, 'g'), () => {\n return `${DATA_ATTR.ID}=\"${generateId()}\"`;\n });\n};\n\nexport const clone = (\n element: t.Node,\n generateId: () => string = () => nanoid(6),\n) => {\n const cloned = t.cloneNode(element, true);\n const generatedCode = generateCode(cloned);\n const code = replaceIds(generatedCode, generateId);\n\n return parseExpression(code, {\n plugins: ['jsx', 'typescript'],\n });\n};\n","import type { BindingItem } from './types';\n\nexport interface ValidationResult {\n valid: boolean;\n message?: string;\n}\n\nconst VALID: ValidationResult = { valid: true };\n\nexport const validateBindingValue = (\n binding: BindingItem,\n value: unknown,\n): ValidationResult => {\n const isEmpty = value === '' || value === null || value === undefined;\n\n if (isEmpty) {\n if (binding.required) {\n return { valid: false, message: 'This field is required.' };\n }\n return VALID;\n }\n\n if (typeof value === 'number') {\n if (binding.min !== undefined && value < binding.min) {\n return { valid: false, message: `Must be at least ${binding.min}.` };\n }\n if (binding.max !== undefined && value > binding.max) {\n return { valid: false, message: `Must be at most ${binding.max}.` };\n }\n }\n\n if (typeof value === 'string' && binding.pattern) {\n let regex: RegExp;\n\n try {\n regex = new RegExp(binding.pattern);\n } catch {\n // Malformed pattern authored on the binding itself — don't block the\n // user's input for an authoring mistake that isn't theirs to fix.\n return VALID;\n }\n\n if (!regex.test(value)) {\n return {\n valid: false,\n message: 'Value does not match the required format.',\n };\n }\n }\n\n if (typeof value === 'string' && binding.type === 'url') {\n try {\n new URL(value);\n } catch {\n return { valid: false, message: 'Must be a valid URL.' };\n }\n }\n\n if (typeof value === 'string' && binding.type === 'date') {\n if (Number.isNaN(Date.parse(value))) {\n return { valid: false, message: 'Must be a valid date.' };\n }\n }\n\n return VALID;\n};\n"],"x_google_ignoreList":[4],"mappings":";;;;;AA2BA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;ACzBA,MAAM,WACJ,OAAOA,WAAAA,YAAc,aACjBA,WAAAA,UACCA,WAAAA,QAAuD;AAE9D,MAAa,QAAQ,SAAiB;CACpC,OAAO,KAAK,KAAK;AACnB;AAEA,MAAa,UAAU,cAAsB;CAC3C,OAAO,UACJ,QAAQ,WAAW,EAAE,CAAC,CACtB,QAAQ,qBAAqB,EAAE,CAAC,CAChC,KAAK;AACV;AAEA,MAAa,aAAa,EACxB,OACA,sBACwC;CACxC,IAAI,UAAU,MACZ,OAAO;CAGT,IAAI,iBACF,OAAOC,aAAE,cAAc,KAAK;CAG9B,MAAM,UAAU,MAAM,KAAK;CAE3B,IAAI,MAAM,OAAO,KAAK,OAAO,GAC3B,OAAOA,aAAE,uBAAuBA,aAAE,eAAe,WAAW,OAAO,CAAC,CAAC;CAGvE,IAAI,MAAM,gBAAgB,KAAK,OAAO,GAAG;EACvC,MAAM,QAAA,GAAOC,aAAAA,gBAAAA,CAAgB,SAAS,EACpC,SAAS,CAAC,OAAO,YAAY,EAC/B,CAAC;EACD,OAAOD,aAAE,uBAAuB,IAAI;CACtC;CAEA,IAAI;EACF,MAAM,QAAA,GAAOC,aAAAA,gBAAAA,CAAgB,SAAS,EACpC,SAAS,CAAC,OAAO,YAAY,EAC/B,CA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AAU,QAAQ,UAAU,KAAA,GAE/C;EACX,IAAI,QAAQ,UACV,OAAO;GAAE,OAAO;GAAO,SAAS;EAA0B;EAE5D,OAAO;CACT;CAEA,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,QAAQ,QAAQ,KAAA,KAAa,QAAQ,QAAQ,KAC/C,OAAO;GAAE,OAAO;GAAO,SAAS,oBAAoB,QAAQ,IAAI;EAAG;EAErE,IAAI,QAAQ,QAAQ,KAAA,KAAa,QAAQ,QAAQ,KAC/C,OAAO;GAAE,OAAO;GAAO,SAAS,mBAAmB,QAAQ,IAAI;EAAG;CAEtE;CAEA,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS;EAChD,IAAI;EAEJ,IAAI;GACF,QAAQ,IAAI,OAAO,QAAQ,OAAO;EACpC,QAAQ;GAGN,OAAO;EACT;EAEA,IAAI,CAAC,MAAM,KAAK,KAAK,GACnB,OAAO;GACL,OAAO;GACP,SAAS;EACX;CAEJ;CAEA,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS,OAChD,IAAI;EACF,IAAI,IAAI,KAAK;CACf,QAAQ;EACN,OAAO;GAAE,OAAO;GAAO,SAAS;EAAuB;CACzD;CAGF,IAAI,OAAO,UAAU,YAAY,QAAQ,SAAS,QAC5C;MAAA,OAAO,MAAM,KAAK,MAAM,KAAK,CAAC,GAChC,OAAO;GAAE,OAAO;GAAO,SAAS;EAAwB;CAAA;CAI5D,OAAO;AACT"}
@@ -1,4 +1,3 @@
1
- import { createRequire } from "node:module";
2
1
  //#region \0rolldown/runtime.js
3
2
  var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
@@ -21,7 +20,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
20
  value: mod,
22
21
  enumerable: true
23
22
  }) : target, mod));
24
- var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
25
23
  //#endregion
26
24
  //#region src/constants/index.ts
27
25
  const CONFIG = {
@@ -14439,303 +14437,6 @@ var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14439
14437
  };
14440
14438
  }));
14441
14439
  //#endregion
14442
- //#region node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
14443
- var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14444
- module.exports = (flag, argv = process.argv) => {
14445
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
14446
- const position = argv.indexOf(prefix + flag);
14447
- const terminatorPosition = argv.indexOf("--");
14448
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
14449
- };
14450
- }));
14451
- //#endregion
14452
- //#region node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
14453
- var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14454
- const os = __require("os");
14455
- const tty$1 = __require("tty");
14456
- const hasFlag = require_has_flag();
14457
- const { env } = process;
14458
- let forceColor;
14459
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) forceColor = 0;
14460
- else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) forceColor = 1;
14461
- if ("FORCE_COLOR" in env) {
14462
- if (env.FORCE_COLOR === "true") forceColor = 1;
14463
- else if (env.FORCE_COLOR === "false") forceColor = 0;
14464
- else forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
14465
- }
14466
- function translateLevel(level) {
14467
- if (level === 0) return false;
14468
- return {
14469
- level,
14470
- hasBasic: true,
14471
- has256: level >= 2,
14472
- has16m: level >= 3
14473
- };
14474
- }
14475
- function supportsColor(haveStream, streamIsTTY) {
14476
- if (forceColor === 0) return 0;
14477
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) return 3;
14478
- if (hasFlag("color=256")) return 2;
14479
- if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
14480
- const min = forceColor || 0;
14481
- if (env.TERM === "dumb") return min;
14482
- if (process.platform === "win32") {
14483
- const osRelease = os.release().split(".");
14484
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
14485
- return 1;
14486
- }
14487
- if ("CI" in env) {
14488
- if ([
14489
- "TRAVIS",
14490
- "CIRCLECI",
14491
- "APPVEYOR",
14492
- "GITLAB_CI",
14493
- "GITHUB_ACTIONS",
14494
- "BUILDKITE"
14495
- ].some((sign) => sign in env) || env.CI_NAME === "codeship") return 1;
14496
- return min;
14497
- }
14498
- if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
14499
- if (env.COLORTERM === "truecolor") return 3;
14500
- if ("TERM_PROGRAM" in env) {
14501
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
14502
- switch (env.TERM_PROGRAM) {
14503
- case "iTerm.app": return version >= 3 ? 3 : 2;
14504
- case "Apple_Terminal": return 2;
14505
- }
14506
- }
14507
- if (/-256(color)?$/i.test(env.TERM)) return 2;
14508
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
14509
- if ("COLORTERM" in env) return 1;
14510
- return min;
14511
- }
14512
- function getSupportLevel(stream) {
14513
- return translateLevel(supportsColor(stream, stream && stream.isTTY));
14514
- }
14515
- module.exports = {
14516
- supportsColor: getSupportLevel,
14517
- stdout: translateLevel(supportsColor(true, tty$1.isatty(1))),
14518
- stderr: translateLevel(supportsColor(true, tty$1.isatty(2)))
14519
- };
14520
- }));
14521
- //#endregion
14522
- //#region node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js
14523
- var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14524
- /**
14525
- * Module dependencies.
14526
- */
14527
- const tty = __require("tty");
14528
- const util = __require("util");
14529
- /**
14530
- * This is the Node.js implementation of `debug()`.
14531
- */
14532
- exports.init = init;
14533
- exports.log = log;
14534
- exports.formatArgs = formatArgs;
14535
- exports.save = save;
14536
- exports.load = load;
14537
- exports.useColors = useColors;
14538
- exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
14539
- /**
14540
- * Colors.
14541
- */
14542
- exports.colors = [
14543
- 6,
14544
- 2,
14545
- 3,
14546
- 4,
14547
- 5,
14548
- 1
14549
- ];
14550
- try {
14551
- const supportsColor = require_supports_color();
14552
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
14553
- 20,
14554
- 21,
14555
- 26,
14556
- 27,
14557
- 32,
14558
- 33,
14559
- 38,
14560
- 39,
14561
- 40,
14562
- 41,
14563
- 42,
14564
- 43,
14565
- 44,
14566
- 45,
14567
- 56,
14568
- 57,
14569
- 62,
14570
- 63,
14571
- 68,
14572
- 69,
14573
- 74,
14574
- 75,
14575
- 76,
14576
- 77,
14577
- 78,
14578
- 79,
14579
- 80,
14580
- 81,
14581
- 92,
14582
- 93,
14583
- 98,
14584
- 99,
14585
- 112,
14586
- 113,
14587
- 128,
14588
- 129,
14589
- 134,
14590
- 135,
14591
- 148,
14592
- 149,
14593
- 160,
14594
- 161,
14595
- 162,
14596
- 163,
14597
- 164,
14598
- 165,
14599
- 166,
14600
- 167,
14601
- 168,
14602
- 169,
14603
- 170,
14604
- 171,
14605
- 172,
14606
- 173,
14607
- 178,
14608
- 179,
14609
- 184,
14610
- 185,
14611
- 196,
14612
- 197,
14613
- 198,
14614
- 199,
14615
- 200,
14616
- 201,
14617
- 202,
14618
- 203,
14619
- 204,
14620
- 205,
14621
- 206,
14622
- 207,
14623
- 208,
14624
- 209,
14625
- 214,
14626
- 215,
14627
- 220,
14628
- 221
14629
- ];
14630
- } catch (error) {}
14631
- /**
14632
- * Build up the default `inspectOpts` object from the environment variables.
14633
- *
14634
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
14635
- */
14636
- exports.inspectOpts = Object.keys(process.env).filter((key) => {
14637
- return /^debug_/i.test(key);
14638
- }).reduce((obj, key) => {
14639
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
14640
- return k.toUpperCase();
14641
- });
14642
- let val = process.env[key];
14643
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
14644
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
14645
- else if (val === "null") val = null;
14646
- else val = Number(val);
14647
- obj[prop] = val;
14648
- return obj;
14649
- }, {});
14650
- /**
14651
- * Is stdout a TTY? Colored output is enabled when `true`.
14652
- */
14653
- function useColors() {
14654
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
14655
- }
14656
- /**
14657
- * Adds ANSI color escape codes if enabled.
14658
- *
14659
- * @api public
14660
- */
14661
- function formatArgs(args) {
14662
- const { namespace: name, useColors } = this;
14663
- if (useColors) {
14664
- const c = this.color;
14665
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
14666
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
14667
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
14668
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
14669
- } else args[0] = getDate() + name + " " + args[0];
14670
- }
14671
- function getDate() {
14672
- if (exports.inspectOpts.hideDate) return "";
14673
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
14674
- }
14675
- /**
14676
- * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
14677
- */
14678
- function log(...args) {
14679
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
14680
- }
14681
- /**
14682
- * Save `namespaces`.
14683
- *
14684
- * @param {String} namespaces
14685
- * @api private
14686
- */
14687
- function save(namespaces) {
14688
- if (namespaces) process.env.DEBUG = namespaces;
14689
- else delete process.env.DEBUG;
14690
- }
14691
- /**
14692
- * Load `namespaces`.
14693
- *
14694
- * @return {String} returns the previously persisted debug modes
14695
- * @api private
14696
- */
14697
- function load() {
14698
- return process.env.DEBUG;
14699
- }
14700
- /**
14701
- * Init logic for `debug` instances.
14702
- *
14703
- * Create a new `inspectOpts` object in case `useColors` is set
14704
- * differently for a particular `debug` instance.
14705
- */
14706
- function init(debug) {
14707
- debug.inspectOpts = {};
14708
- const keys = Object.keys(exports.inspectOpts);
14709
- for (let i = 0; i < keys.length; i++) debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
14710
- }
14711
- module.exports = require_common()(exports);
14712
- const { formatters } = module.exports;
14713
- /**
14714
- * Map %o to `util.inspect()`, all on a single line.
14715
- */
14716
- formatters.o = function(v) {
14717
- this.inspectOpts.colors = this.useColors;
14718
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
14719
- };
14720
- /**
14721
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
14722
- */
14723
- formatters.O = function(v) {
14724
- this.inspectOpts.colors = this.useColors;
14725
- return util.inspect(v, this.inspectOpts);
14726
- };
14727
- }));
14728
- //#endregion
14729
- //#region node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.js
14730
- var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14731
- /**
14732
- * Detect Electron renderer / nwjs process, which is node, but we should
14733
- * treat as a browser.
14734
- */
14735
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) module.exports = require_browser();
14736
- else module.exports = require_node$1();
14737
- }));
14738
- //#endregion
14739
14440
  //#region node_modules/.pnpm/@babel+types@7.29.8/node_modules/@babel/types/lib/utils/shallowEqual.js
14740
14441
  var require_shallowEqual = /* @__PURE__ */ __commonJSMin(((exports) => {
14741
14442
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -36749,74 +36450,57 @@ var require_inference = /* @__PURE__ */ __commonJSMin(((exports) => {
36749
36450
  }
36750
36451
  }));
36751
36452
  //#endregion
36752
- //#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
36753
- var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36754
- let p = process || {};
36755
- let argv = p.argv || [];
36756
- let env = p.env || {};
36757
- let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
36758
- let formatter = (open, close, replace = open) => (input) => {
36759
- let string = "" + input, index = string.indexOf(close, open.length);
36760
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
36761
- };
36762
- let replaceClose = (string, close, replace, index) => {
36763
- let result = "", cursor = 0;
36764
- do {
36765
- result += string.substring(cursor, index) + replace;
36766
- cursor = index + close.length;
36767
- index = string.indexOf(close, cursor);
36768
- } while (~index);
36769
- return result + string.substring(cursor);
36770
- };
36771
- let createColors = (enabled = isColorSupported) => {
36772
- let f = enabled ? formatter : () => String;
36453
+ //#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.browser.js
36454
+ var require_picocolors_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36455
+ var x = String;
36456
+ var create = function() {
36773
36457
  return {
36774
- isColorSupported: enabled,
36775
- reset: f("\x1B[0m", "\x1B[0m"),
36776
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
36777
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
36778
- italic: f("\x1B[3m", "\x1B[23m"),
36779
- underline: f("\x1B[4m", "\x1B[24m"),
36780
- inverse: f("\x1B[7m", "\x1B[27m"),
36781
- hidden: f("\x1B[8m", "\x1B[28m"),
36782
- strikethrough: f("\x1B[9m", "\x1B[29m"),
36783
- black: f("\x1B[30m", "\x1B[39m"),
36784
- red: f("\x1B[31m", "\x1B[39m"),
36785
- green: f("\x1B[32m", "\x1B[39m"),
36786
- yellow: f("\x1B[33m", "\x1B[39m"),
36787
- blue: f("\x1B[34m", "\x1B[39m"),
36788
- magenta: f("\x1B[35m", "\x1B[39m"),
36789
- cyan: f("\x1B[36m", "\x1B[39m"),
36790
- white: f("\x1B[37m", "\x1B[39m"),
36791
- gray: f("\x1B[90m", "\x1B[39m"),
36792
- bgBlack: f("\x1B[40m", "\x1B[49m"),
36793
- bgRed: f("\x1B[41m", "\x1B[49m"),
36794
- bgGreen: f("\x1B[42m", "\x1B[49m"),
36795
- bgYellow: f("\x1B[43m", "\x1B[49m"),
36796
- bgBlue: f("\x1B[44m", "\x1B[49m"),
36797
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
36798
- bgCyan: f("\x1B[46m", "\x1B[49m"),
36799
- bgWhite: f("\x1B[47m", "\x1B[49m"),
36800
- blackBright: f("\x1B[90m", "\x1B[39m"),
36801
- redBright: f("\x1B[91m", "\x1B[39m"),
36802
- greenBright: f("\x1B[92m", "\x1B[39m"),
36803
- yellowBright: f("\x1B[93m", "\x1B[39m"),
36804
- blueBright: f("\x1B[94m", "\x1B[39m"),
36805
- magentaBright: f("\x1B[95m", "\x1B[39m"),
36806
- cyanBright: f("\x1B[96m", "\x1B[39m"),
36807
- whiteBright: f("\x1B[97m", "\x1B[39m"),
36808
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
36809
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
36810
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
36811
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
36812
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
36813
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
36814
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
36815
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
36458
+ isColorSupported: false,
36459
+ reset: x,
36460
+ bold: x,
36461
+ dim: x,
36462
+ italic: x,
36463
+ underline: x,
36464
+ inverse: x,
36465
+ hidden: x,
36466
+ strikethrough: x,
36467
+ black: x,
36468
+ red: x,
36469
+ green: x,
36470
+ yellow: x,
36471
+ blue: x,
36472
+ magenta: x,
36473
+ cyan: x,
36474
+ white: x,
36475
+ gray: x,
36476
+ bgBlack: x,
36477
+ bgRed: x,
36478
+ bgGreen: x,
36479
+ bgYellow: x,
36480
+ bgBlue: x,
36481
+ bgMagenta: x,
36482
+ bgCyan: x,
36483
+ bgWhite: x,
36484
+ blackBright: x,
36485
+ redBright: x,
36486
+ greenBright: x,
36487
+ yellowBright: x,
36488
+ blueBright: x,
36489
+ magentaBright: x,
36490
+ cyanBright: x,
36491
+ whiteBright: x,
36492
+ bgBlackBright: x,
36493
+ bgRedBright: x,
36494
+ bgGreenBright: x,
36495
+ bgYellowBright: x,
36496
+ bgBlueBright: x,
36497
+ bgMagentaBright: x,
36498
+ bgCyanBright: x,
36499
+ bgWhiteBright: x
36816
36500
  };
36817
36501
  };
36818
- module.exports = createColors();
36819
- module.exports.createColors = createColors;
36502
+ module.exports = create();
36503
+ module.exports.createColors = create;
36820
36504
  }));
36821
36505
  //#endregion
36822
36506
  //#region node_modules/.pnpm/js-tokens@4.0.0/node_modules/js-tokens/index.js
@@ -36844,7 +36528,7 @@ var require_js_tokens = /* @__PURE__ */ __commonJSMin(((exports) => {
36844
36528
  //#region node_modules/.pnpm/@babel+code-frame@7.29.7/node_modules/@babel/code-frame/lib/index.js
36845
36529
  var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
36846
36530
  Object.defineProperty(exports, "__esModule", { value: true });
36847
- var picocolors = require_picocolors();
36531
+ var picocolors = require_picocolors_browser();
36848
36532
  var jsTokens = require_js_tokens();
36849
36533
  var helperValidatorIdentifier = require_lib$6();
36850
36534
  function isColorSupported() {
@@ -39349,7 +39033,7 @@ var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
39349
39033
  Object.defineProperty(exports, "__esModule", { value: true });
39350
39034
  exports.default = exports.SHOULD_STOP = exports.SHOULD_SKIP = exports.REMOVED = void 0;
39351
39035
  var virtualTypes = require_virtual_types();
39352
- var _debug = require_src();
39036
+ var _debug = require_browser();
39353
39037
  var _index = require_lib();
39354
39038
  var _index2 = require_scope();
39355
39039
  var _t = require_lib$4();
@@ -40082,6 +39766,7 @@ const createBoundedCache = (limit, onEvict) => {
40082
39766
  };
40083
39767
  //#endregion
40084
39768
  //#region src/utils/ast/document.ts
39769
+ const traverse = typeof import_lib$1.default === "function" ? import_lib$1.default : import_lib$1.default.default;
40085
39770
  const APP_CONTAINER_ID = "app-container";
40086
39771
  const SECTION_TAG = "section";
40087
39772
  const DATA_NAME_ATTR = "data-name";
@@ -40096,7 +39781,7 @@ const getAttrValue = (element, attrName) => {
40096
39781
  const isSectionElement = (node) => import_lib$2.isJSXElement(node) && getTagName(node) === SECTION_TAG;
40097
39782
  const findContainer = (ast) => {
40098
39783
  let container;
40099
- (0, import_lib$1.default)(ast, { JSXElement(path) {
39784
+ traverse(ast, { JSXElement(path) {
40100
39785
  if (getAttrValue(path.node, "id") === APP_CONTAINER_ID) {
40101
39786
  container = path.node;
40102
39787
  path.stop();
@@ -40240,6 +39925,6 @@ const createSectionPreviewCache = () => {
40240
39925
  return { compute };
40241
39926
  };
40242
39927
  //#endregion
40243
- export { DEFAULT_TEMPLATE as _, generateSectionPreviews as a, TS_PATTERNS as b, replaceDocumentSections as c, require_lib$3 as d, require_lib$4 as f, DATA_ATTR as g, CONFIG as h, generateSectionPreview as i, createBoundedCache as l, BINDING_PROP as m, createSectionPreviewCache as n, getSections as o, require_lib$7 as p, generateDocumentCode as r, parseDocument as s, clearDocumentParseCache as t, require_lib as u, DRAGGABLE_ITEMS as v, __toESM as x, REGEX as y };
39928
+ export { DEFAULT_TEMPLATE as _, generateSectionPreviews as a, TS_PATTERNS as b, replaceDocumentSections as c, require_lib$3 as d, require_lib$4 as f, DATA_ATTR as g, CONFIG as h, generateSectionPreview as i, traverse as l, BINDING_PROP as m, createSectionPreviewCache as n, getSections as o, require_lib$7 as p, generateDocumentCode as r, parseDocument as s, clearDocumentParseCache as t, createBoundedCache as u, DRAGGABLE_ITEMS as v, __toESM as x, REGEX as y };
40244
39929
 
40245
- //# sourceMappingURL=document-DocoSXLT.mjs.map
39930
+ //# sourceMappingURL=document-CSIscFpL.js.map