meno-core 1.0.49 → 1.0.50
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.
- package/build-astro.ts +6 -2
- package/dist/build-static.js +5 -5
- package/dist/chunks/{chunk-JER5NQVM.js → chunk-56EUSC6D.js} +4 -4
- package/dist/chunks/{chunk-S2CX6HFM.js → chunk-7NIC4I3V.js} +42 -20
- package/dist/chunks/chunk-7NIC4I3V.js.map +7 -0
- package/dist/chunks/{chunk-EQYDSPBB.js → chunk-CVLFID6V.js} +64 -20
- package/dist/chunks/chunk-CVLFID6V.js.map +7 -0
- package/dist/chunks/{chunk-LKAGAQ3M.js → chunk-EDQSMAMP.js} +13 -2
- package/dist/chunks/{chunk-LKAGAQ3M.js.map → chunk-EDQSMAMP.js.map} +2 -2
- package/dist/chunks/{chunk-6IVUG7FY.js → chunk-LPVETICS.js} +19 -2
- package/dist/chunks/{chunk-6IVUG7FY.js.map → chunk-LPVETICS.js.map} +2 -2
- package/dist/chunks/{chunk-KPU2XHOS.js → chunk-PQ2HRXDR.js} +1 -1
- package/dist/chunks/chunk-PQ2HRXDR.js.map +7 -0
- package/dist/chunks/{chunk-CHD5UCFF.js → chunk-YWJJD5D6.js} +116 -32
- package/dist/chunks/chunk-YWJJD5D6.js.map +7 -0
- package/dist/chunks/{configService-CCA6AIDI.js → configService-VOY2MY2K.js} +2 -2
- package/dist/entries/server-router.js +5 -5
- package/dist/lib/client/index.js +41 -15
- package/dist/lib/client/index.js.map +3 -3
- package/dist/lib/server/index.js +11 -9
- package/dist/lib/server/index.js.map +2 -2
- package/dist/lib/shared/index.js +2 -2
- package/lib/client/core/ComponentBuilder.test.ts +34 -0
- package/lib/client/core/ComponentBuilder.ts +25 -3
- package/lib/client/core/builders/embedBuilder.ts +13 -5
- package/lib/client/core/builders/linkNodeBuilder.ts +13 -5
- package/lib/client/core/builders/localeListBuilder.ts +13 -5
- package/lib/client/templateEngine.ts +24 -0
- package/lib/server/fileWatcher.test.ts +134 -0
- package/lib/server/fileWatcher.ts +100 -32
- package/lib/server/jsonLoader.ts +1 -0
- package/lib/server/providers/fileSystemCMSProvider.ts +46 -14
- package/lib/server/services/configService.ts +1 -0
- package/lib/server/services/fileWatcherService.ts +17 -0
- package/lib/server/ssr/htmlGenerator.ts +11 -3
- package/lib/server/ssr/ssrRenderer.test.ts +258 -0
- package/lib/server/ssr/ssrRenderer.ts +46 -5
- package/lib/server/webflow/buildWebflow.ts +1 -1
- package/lib/server/websocketManager.test.ts +61 -6
- package/lib/server/websocketManager.ts +25 -1
- package/lib/shared/cssProperties.test.ts +28 -0
- package/lib/shared/cssProperties.ts +27 -1
- package/lib/shared/types/api.ts +10 -1
- package/lib/shared/types/cms.ts +18 -9
- package/lib/shared/validation/schemas.test.ts +93 -0
- package/lib/shared/validation/schemas.ts +56 -15
- package/package.json +1 -1
- package/dist/chunks/chunk-CHD5UCFF.js.map +0 -7
- package/dist/chunks/chunk-EQYDSPBB.js.map +0 -7
- package/dist/chunks/chunk-KPU2XHOS.js.map +0 -7
- package/dist/chunks/chunk-S2CX6HFM.js.map +0 -7
- /package/dist/chunks/{chunk-JER5NQVM.js.map → chunk-56EUSC6D.js.map} +0 -0
- /package/dist/chunks/{configService-CCA6AIDI.js.map → configService-VOY2MY2K.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../lib/shared/cssProperties.ts", "../../lib/shared/errorLogger.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * CSS Property Definition structure\n */\ninterface CSSPropertyDefinition {\n values?: readonly string[];\n type?: 'string' | 'select' | 'boolean' | 'number';\n}\n\n/**\n * CSS Properties with their valid values and metadata\n * Used for autocomplete suggestions for both property names and values\n */\nexport const CSS_PROPERTIES_DEFINITION: Record<string, CSSPropertyDefinition> = {\n // Display & Layout\n display: {\n values: ['block', 'flex', 'grid', 'inline', 'inline-block', 'inline-flex', 'inline-grid', 'none'],\n type: 'select',\n },\n position: {\n values: ['static', 'relative', 'absolute', 'fixed', 'sticky'],\n type: 'select',\n },\n top: { type: 'string' },\n right: { type: 'string' },\n bottom: { type: 'string' },\n left: { type: 'string' },\n inset: { type: 'string' },\n zIndex: { type: 'number' },\n\n // Dimensions\n width: { type: 'string' },\n height: { type: 'string' },\n minWidth: { type: 'string' },\n maxWidth: { type: 'string' },\n minHeight: { type: 'string' },\n maxHeight: { type: 'string' },\n aspectRatio: { type: 'string' },\n\n // Spacing\n margin: { type: 'string' },\n marginTop: { type: 'string' },\n marginRight: { type: 'string' },\n marginBottom: { type: 'string' },\n marginLeft: { type: 'string' },\n padding: { type: 'string' },\n paddingTop: { type: 'string' },\n paddingRight: { type: 'string' },\n paddingBottom: { type: 'string' },\n paddingLeft: { type: 'string' },\n gap: { type: 'string' },\n rowGap: { type: 'string' },\n columnGap: { type: 'string' },\n\n // Borders\n border: { type: 'string' },\n borderWidth: { type: 'string' },\n borderStyle: {\n values: ['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset', 'none'],\n type: 'select',\n },\n borderColor: { type: 'string' },\n borderTop: { type: 'string' },\n borderRight: { type: 'string' },\n borderBottom: { type: 'string' },\n borderLeft: { type: 'string' },\n borderRadius: { type: 'string' },\n borderTopLeftRadius: { type: 'string' },\n borderTopRightRadius: { type: 'string' },\n borderBottomLeftRadius: { type: 'string' },\n borderBottomRightRadius: { type: 'string' },\n\n // Background & Colors\n background: { type: 'string' },\n backgroundColor: { type: 'string' },\n backgroundImage: { type: 'string' },\n backgroundSize: {\n values: ['auto', 'cover', 'contain'],\n type: 'select',\n },\n backgroundPosition: {\n values: ['top', 'bottom', 'left', 'right', 'center'],\n type: 'select',\n },\n backgroundRepeat: {\n values: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'],\n type: 'select',\n },\n color: { type: 'string' },\n opacity: { type: 'number' },\n\n // Flexbox\n flex: { type: 'string' },\n flexDirection: {\n values: ['row', 'column', 'row-reverse', 'column-reverse'],\n type: 'select',\n },\n flexWrap: {\n values: ['nowrap', 'wrap', 'wrap-reverse'],\n type: 'select',\n },\n flexFlow: { type: 'string' },\n justifyContent: {\n values: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],\n type: 'select',\n },\n alignItems: {\n values: ['flex-start', 'flex-end', 'center', 'stretch', 'baseline'],\n type: 'select',\n },\n alignContent: {\n values: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'],\n type: 'select',\n },\n alignSelf: {\n values: ['auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'],\n type: 'select',\n },\n flexGrow: { type: 'number' },\n flexShrink: { type: 'number' },\n flexBasis: { type: 'string' },\n order: { type: 'number' },\n\n // Grid\n grid: { type: 'string' },\n gridTemplateColumns: { type: 'string' },\n gridTemplateRows: { type: 'string' },\n gridTemplateAreas: { type: 'string' },\n gridGap: { type: 'string' },\n gridColumn: { type: 'string' },\n gridRow: { type: 'string' },\n gridArea: { type: 'string' },\n gridAutoFlow: {\n values: ['row', 'column', 'row dense', 'column dense'],\n type: 'select',\n },\n gridAutoColumns: { type: 'string' },\n gridAutoRows: { type: 'string' },\n justifyItems: {\n values: ['start', 'end', 'center', 'stretch'],\n type: 'select',\n },\n justifySelf: {\n values: ['auto', 'start', 'end', 'center', 'stretch'],\n type: 'select',\n },\n placeContent: { type: 'string' },\n placeItems: { type: 'string' },\n placeSelf: { type: 'string' },\n\n // Text & Font\n fontSize: { type: 'string' },\n fontWeight: {\n values: ['100', '200', '300', '400', '500', '600', '700', '800', '900', 'normal', 'bold'],\n type: 'select',\n },\n fontFamily: { type: 'string' },\n fontStyle: {\n values: ['normal', 'italic', 'oblique'],\n type: 'select',\n },\n lineHeight: { type: 'string' },\n textAlign: {\n values: ['left', 'right', 'center', 'justify', 'start', 'end'],\n type: 'select',\n },\n textDecoration: {\n values: ['none', 'underline', 'overline', 'line-through'],\n type: 'select',\n },\n textTransform: {\n values: ['none', 'capitalize', 'uppercase', 'lowercase'],\n type: 'select',\n },\n letterSpacing: { type: 'string' },\n wordSpacing: { type: 'string' },\n wordBreak: {\n values: ['normal', 'break-all', 'keep-all', 'break-word'],\n type: 'select',\n },\n overflowWrap: {\n values: ['normal', 'break-word', 'anywhere'],\n type: 'select',\n },\n textIndent: { type: 'string' },\n verticalAlign: {\n values: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super'],\n type: 'select',\n },\n\n // Box Shadow & Effects\n boxShadow: { type: 'string' },\n textShadow: { type: 'string' },\n filter: { type: 'string' },\n backdropFilter: { type: 'string' },\n transform: { type: 'string' },\n transformOrigin: { type: 'string' },\n transition: { type: 'string' },\n animation: { type: 'string' },\n backfaceVisibility: {\n values: ['visible', 'hidden'],\n type: 'select',\n },\n mixBlendMode: {\n values: ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'],\n type: 'select',\n },\n clipPath: { type: 'string' },\n\n // Overflow & Content\n overflow: {\n values: ['visible', 'hidden', 'scroll', 'auto'],\n type: 'select',\n },\n overflowX: {\n values: ['visible', 'hidden', 'scroll', 'auto'],\n type: 'select',\n },\n overflowY: {\n values: ['visible', 'hidden', 'scroll', 'auto'],\n type: 'select',\n },\n whiteSpace: {\n values: ['normal', 'nowrap', 'pre', 'pre-wrap', 'pre-line'],\n type: 'select',\n },\n textOverflow: {\n values: ['clip', 'ellipsis'],\n type: 'select',\n },\n visibility: {\n values: ['visible', 'hidden', 'collapse'],\n type: 'select',\n },\n content: { type: 'string' },\n\n // Cursor & Interaction\n cursor: {\n values: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'not-allowed', 'help'],\n type: 'select',\n },\n pointerEvents: {\n values: ['auto', 'none'],\n type: 'select',\n },\n userSelect: {\n values: ['auto', 'none', 'text', 'all'],\n type: 'select',\n },\n\n // Outline\n outline: { type: 'string' },\n outlineWidth: { type: 'string' },\n outlineStyle: {\n values: ['none', 'solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset'],\n type: 'select',\n },\n outlineColor: { type: 'string' },\n outlineOffset: { type: 'string' },\n\n // Lists\n listStyle: { type: 'string' },\n listStyleType: {\n values: ['none', 'disc', 'circle', 'square', 'decimal', 'decimal-leading-zero', 'lower-roman', 'upper-roman', 'lower-alpha', 'upper-alpha'],\n type: 'select',\n },\n listStylePosition: {\n values: ['inside', 'outside'],\n type: 'select',\n },\n\n // Miscellaneous\n float: {\n values: ['left', 'right', 'none'],\n type: 'select',\n },\n clear: {\n values: ['left', 'right', 'both', 'none'],\n type: 'select',\n },\n boxSizing: {\n values: ['content-box', 'border-box'],\n type: 'select',\n },\n objectFit: {\n values: ['fill', 'contain', 'cover', 'scale-down'],\n type: 'select',\n },\n objectPosition: {\n values: ['top', 'bottom', 'left', 'right', 'center'],\n type: 'select',\n },\n resize: {\n values: ['none', 'both', 'horizontal', 'vertical'],\n type: 'select',\n },\n scrollBehavior: {\n values: ['auto', 'smooth'],\n type: 'select',\n },\n accentColor: { type: 'string' },\n\n // SVG\n stroke: { type: 'string' },\n strokeWidth: { type: 'string' },\n strokeDasharray: { type: 'string' },\n strokeDashoffset: { type: 'string' },\n strokeLinecap: {\n values: ['butt', 'round', 'square'],\n type: 'select',\n },\n strokeLinejoin: {\n values: ['miter', 'round', 'bevel'],\n type: 'select',\n },\n strokeOpacity: { type: 'number' },\n fill: { type: 'string' },\n fillOpacity: { type: 'number' },\n fillRule: {\n values: ['nonzero', 'evenodd'],\n type: 'select',\n },\n};\n\n/**\n * Common CSS properties for autocomplete suggestions (camelCase for React/JS)\n * Derived from CSS_PROPERTIES_DEFINITION keys\n */\nexport const CSS_PROPERTIES = Object.keys(CSS_PROPERTIES_DEFINITION);\n\n/**\n * Popularity tiers for CSS properties (lower = more common).\n * Properties not listed default to tier 3.\n * Used to sort autocomplete suggestions within each match group.\n */\nconst CSS_PROPERTY_PRIORITY: Record<string, number> = {\n // Tier 1: Most commonly used\n display: 1,\n position: 1,\n width: 1,\n height: 1,\n margin: 1,\n padding: 1,\n color: 1,\n backgroundColor: 1,\n fontSize: 1,\n fontWeight: 1,\n border: 1,\n borderRadius: 1,\n flex: 1,\n flexDirection: 1,\n justifyContent: 1,\n alignItems: 1,\n gap: 1,\n opacity: 1,\n overflow: 1,\n zIndex: 1,\n top: 1,\n right: 1,\n bottom: 1,\n left: 1,\n cursor: 1,\n background: 1,\n boxShadow: 1,\n transition: 1,\n transform: 1,\n lineHeight: 1,\n textAlign: 1,\n\n // Tier 2: Common but less frequent\n maxWidth: 2,\n maxHeight: 2,\n minWidth: 3,\n minHeight: 3,\n marginTop: 2,\n marginBottom: 2,\n marginLeft: 2,\n marginRight: 2,\n paddingTop: 2,\n paddingBottom: 2,\n paddingLeft: 2,\n paddingRight: 2,\n fontFamily: 2,\n fontStyle: 2,\n textDecoration: 2,\n textTransform: 2,\n letterSpacing: 2,\n borderWidth: 2,\n borderStyle: 2,\n borderColor: 2,\n borderBottom: 2,\n borderTop: 2,\n flexWrap: 2,\n flexGrow: 2,\n flexShrink: 2,\n flexBasis: 2,\n alignSelf: 2,\n gridTemplateColumns: 2,\n gridTemplateRows: 2,\n backgroundImage: 2,\n backgroundSize: 2,\n backgroundPosition: 2,\n whiteSpace: 2,\n textOverflow: 2,\n visibility: 2,\n pointerEvents: 2,\n userSelect: 2,\n boxSizing: 2,\n objectFit: 2,\n filter: 2,\n animation: 2,\n outline: 2,\n inset: 2,\n};\n\nfunction getPropertyPriority(property: string): number {\n return CSS_PROPERTY_PRIORITY[property] ?? 3;\n}\n\n/**\n * CSS Property Groups for organizing styles in the editor\n * Order determines display order in the UI\n */\nexport const CSS_PROPERTY_GROUPS: Record<string, string[]> = {\n 'Layout': ['display'],\n 'Spacing': ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n 'Size': ['width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'aspectRatio'],\n 'Position': ['position', 'top', 'right', 'bottom', 'left', 'inset', 'zIndex'],\n 'Flexbox': ['flex', 'flexDirection', 'flexWrap', 'flexFlow', 'justifyContent', 'alignItems', 'alignContent', 'gap', 'rowGap', 'columnGap', 'alignSelf', 'flexGrow', 'flexShrink', 'flexBasis', 'order'],\n 'Grid': ['grid', 'gridTemplateColumns', 'gridTemplateRows', 'gridTemplateAreas', 'gridGap', 'gridColumn', 'gridRow', 'gridArea', 'gridAutoFlow', 'gridAutoColumns', 'gridAutoRows', 'justifyItems', 'justifySelf', 'placeContent', 'placeItems', 'placeSelf'],\n 'Typography': ['fontWeight', 'fontSize', 'fontFamily', 'fontStyle', 'lineHeight', 'color', 'textAlign', 'textDecoration', 'textTransform', 'letterSpacing', 'wordSpacing', 'wordBreak', 'overflowWrap', 'textIndent', 'verticalAlign'],\n 'Background': ['background', 'backgroundColor', 'backgroundImage', 'backgroundSize', 'backgroundPosition', 'backgroundRepeat', 'opacity'],\n 'Borders': ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'border', 'borderWidth', 'borderStyle', 'borderColor', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n 'Outline': ['outline', 'outlineWidth', 'outlineStyle', 'outlineColor', 'outlineOffset'],\n 'Effects': ['boxShadow', 'textShadow', 'filter', 'backdropFilter', 'transform', 'transformOrigin', 'transition', 'animation', 'backfaceVisibility', 'mixBlendMode', 'clipPath'],\n 'Overflow': ['overflow', 'overflowX', 'overflowY', 'whiteSpace', 'textOverflow', 'visibility', 'content'],\n 'Interaction': ['cursor', 'pointerEvents', 'userSelect'],\n 'Lists': ['listStyle', 'listStyleType', 'listStylePosition'],\n 'Other': ['float', 'clear', 'boxSizing', 'objectFit', 'objectPosition', 'resize', 'scrollBehavior', 'accentColor'],\n 'SVG': ['stroke', 'strokeWidth', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeOpacity', 'fill', 'fillOpacity', 'fillRule'],\n};\n\n/**\n * Get the group name for a CSS property\n * @param propertyName - The CSS property name\n * @returns The group name or 'Other' if not found\n */\nexport function getPropertyGroup(propertyName: string): string {\n for (const [groupName, properties] of Object.entries(CSS_PROPERTY_GROUPS)) {\n if (properties.includes(propertyName)) {\n return groupName;\n }\n }\n return 'Other';\n}\n\n/**\n * Subset of CSS properties shown as \"always-visible\" rows in the visual style\n * editor mode (Webflow-like). Each property here renders even when unset, so\n * the user can see at a glance which properties are available and click an\n * empty row to start typing a value.\n *\n * Keys must be group names from CSS_PROPERTY_GROUPS so the visual editor can\n * reuse the same group headers as list mode.\n */\nexport const VISUAL_MODE_PROPERTIES: Record<string, string[]> = {\n 'Layout': ['display'],\n 'Grid': ['gridTemplateColumns'],\n 'Flexbox': ['flexDirection', 'flexWrap', 'justifyContent', 'alignItems', 'gap', 'flexGrow', 'flexShrink', 'flexBasis'],\n 'Spacing': ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n 'Size': ['width', 'height', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight'],\n 'Position': ['position', 'top', 'right', 'bottom', 'left', 'zIndex'],\n 'Typography': ['fontFamily', 'fontWeight', 'fontSize', 'lineHeight', 'color', 'letterSpacing', 'textAlign', 'textTransform', 'textDecoration'],\n 'Background': ['backgroundColor', 'backgroundImage', 'backgroundSize', 'backgroundPosition', 'backgroundRepeat', 'opacity'],\n 'Borders': ['borderRadius', 'borderWidth', 'borderStyle', 'borderColor'],\n 'Effects': ['boxShadow', 'transform', 'transition', 'filter'],\n 'Overflow': ['overflow', 'whiteSpace'],\n 'Interaction': ['cursor', 'pointerEvents'],\n};\n\nconst VISUAL_MODE_PROPERTIES_SET = new Set(\n Object.values(VISUAL_MODE_PROPERTIES).flat()\n);\n\n/**\n * True if `prop` belongs to the always-visible visual-mode list.\n */\nexport function isVisualModeProperty(prop: string): boolean {\n return VISUAL_MODE_PROPERTIES_SET.has(prop);\n}\n\n/**\n * Context used by visual-mode visibility rules. Captures everything a rule\n * needs to decide whether a property row is meaningful for the currently\n * selected element. Built once per render in `StyleEditor`.\n */\nexport interface VisualModeRuleContext {\n /** Effective `display` of the selected element \u2014 getComputedStyle().display\n * with declared (instance/inherited/effective) merge as fallback when the\n * iframe hasn't loaded yet. Defaults to 'block'. */\n display: string;\n /** Effective `display` of the DOM parent \u2014 used for flex/grid item props\n * whose applicability depends on the parent's layout mode. '' when no\n * parent is reachable (root element, iframe missing). */\n parentDisplay: string;\n /** Effective `position` of the selected element. Defaults to 'static'. */\n position: string;\n /** Lowercase HTML tag name of the selected element ('div', 'img', 'ul'\u2026). */\n tagName: string;\n /** True if any of paddingTop / paddingRight / paddingBottom / paddingLeft\n * is set anywhere in the cascade (instance + inherited + effective).\n * When true, the panel shows the four longhand rows and hides `padding`. */\n hasPaddingLonghand: boolean;\n /** Same as `hasPaddingLonghand` for the four `margin*` longhands. */\n hasMarginLonghand: boolean;\n /** True if `backgroundImage` (or the `background` shorthand) is set anywhere\n * in the cascade. Drives visibility of background-image-only properties\n * like `backgroundPosition` / `backgroundSize` / `backgroundRepeat`. */\n hasBackgroundImage: boolean;\n}\n\nexport type VisualModeRule = (ctx: VisualModeRuleContext) => boolean;\n\nconst isFlexDisplay = (d: string) => d === 'flex' || d === 'inline-flex';\nconst isGridDisplay = (d: string) => d === 'grid' || d === 'inline-grid';\nconst isListTag = (t: string) => t === 'ul' || t === 'ol' || t === 'li';\nconst isMediaTag = (t: string) => t === 'img' || t === 'video';\n\n/**\n * Visibility rules for the visual-mode style panel. Each entry is a predicate\n * that returns true when the row should be rendered for the current element\n * context. Properties without an entry are always visible. Properties that\n * are *explicitly set* on the element bypass these rules (the explicit-value\n * override is enforced by the caller, not here).\n */\nexport const VISUAL_MODE_RULES: Record<string, VisualModeRule> = {\n // Flex/Grid CONTAINER props \u2014 own display must be flex/grid.\n flexDirection: ctx => isFlexDisplay(ctx.display),\n flexWrap: ctx => isFlexDisplay(ctx.display),\n justifyContent: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n alignItems: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n alignContent: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n gap: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n rowGap: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n columnGap: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n gridTemplateColumns: ctx => isGridDisplay(ctx.display),\n gridTemplateRows: ctx => isGridDisplay(ctx.display),\n gridTemplateAreas: ctx => isGridDisplay(ctx.display),\n gridGap: ctx => isGridDisplay(ctx.display),\n gridAutoFlow: ctx => isGridDisplay(ctx.display),\n gridAutoColumns: ctx => isGridDisplay(ctx.display),\n gridAutoRows: ctx => isGridDisplay(ctx.display),\n justifyItems: ctx => isGridDisplay(ctx.display),\n placeItems: ctx => isGridDisplay(ctx.display),\n placeContent: ctx => isGridDisplay(ctx.display),\n\n // Flex/Grid ITEM props \u2014 PARENT display must be flex/grid.\n flex: ctx => isFlexDisplay(ctx.parentDisplay),\n flexFlow: ctx => isFlexDisplay(ctx.parentDisplay),\n flexGrow: ctx => isFlexDisplay(ctx.parentDisplay),\n flexShrink: ctx => isFlexDisplay(ctx.parentDisplay),\n flexBasis: ctx => isFlexDisplay(ctx.parentDisplay),\n alignSelf: ctx => isFlexDisplay(ctx.parentDisplay) || isGridDisplay(ctx.parentDisplay),\n justifySelf: ctx => isGridDisplay(ctx.parentDisplay),\n placeSelf: ctx => isGridDisplay(ctx.parentDisplay),\n order: ctx => isFlexDisplay(ctx.parentDisplay) || isGridDisplay(ctx.parentDisplay),\n gridArea: ctx => isGridDisplay(ctx.parentDisplay),\n gridColumn: ctx => isGridDisplay(ctx.parentDisplay),\n gridRow: ctx => isGridDisplay(ctx.parentDisplay),\n\n // Position-dependent inset properties.\n top: ctx => ctx.position !== 'static',\n right: ctx => ctx.position !== 'static',\n bottom: ctx => ctx.position !== 'static',\n left: ctx => ctx.position !== 'static',\n inset: ctx => ctx.position !== 'static',\n zIndex: ctx => ctx.position !== 'static',\n\n // Tag-based.\n objectFit: ctx => isMediaTag(ctx.tagName),\n objectPosition: ctx => isMediaTag(ctx.tagName),\n listStyle: ctx => isListTag(ctx.tagName),\n listStyleType: ctx => isListTag(ctx.tagName),\n listStylePosition: ctx => isListTag(ctx.tagName),\n\n // Padding/margin shorthand-vs-longhand auto-toggle.\n // When ANY longhand is set, hide shorthand; otherwise hide longhands.\n padding: ctx => !ctx.hasPaddingLonghand,\n paddingTop: ctx => ctx.hasPaddingLonghand,\n paddingRight: ctx => ctx.hasPaddingLonghand,\n paddingBottom: ctx => ctx.hasPaddingLonghand,\n paddingLeft: ctx => ctx.hasPaddingLonghand,\n margin: ctx => !ctx.hasMarginLonghand,\n marginTop: ctx => ctx.hasMarginLonghand,\n marginRight: ctx => ctx.hasMarginLonghand,\n marginBottom: ctx => ctx.hasMarginLonghand,\n marginLeft: ctx => ctx.hasMarginLonghand,\n\n // Background-image-only props \u2014 meaningless without a background image.\n backgroundPosition: ctx => ctx.hasBackgroundImage,\n backgroundSize: ctx => ctx.hasBackgroundImage,\n backgroundRepeat: ctx => ctx.hasBackgroundImage,\n};\n\n/**\n * True if `prop` should be visible in the visual-mode panel given `ctx`.\n * Properties without an entry in `VISUAL_MODE_RULES` default to visible.\n * Callers are responsible for the explicit-value override (a property that\n * the user has set must remain visible regardless of the rule outcome).\n */\nexport function isVisualModeRowVisible(prop: string, ctx: VisualModeRuleContext): boolean {\n const rule = VISUAL_MODE_RULES[prop];\n return rule ? rule(ctx) : true;\n}\n\n/**\n * Check if property matches the abbreviation pattern\n * For example, \"bC\" matches \"backgroundColor\" (b\u2192b, C\u2192C capital letter)\n */\nfunction matchesAbbreviation(property: string, input: string): boolean {\n if (!input) return false;\n\n let propertyIndex = 0;\n\n for (let inputIndex = 0; inputIndex < input.length; inputIndex++) {\n const inputChar = input[inputIndex];\n let found = false;\n\n // Search from current position to end of property for a match at a word boundary\n while (propertyIndex < property.length) {\n const propChar = property[propertyIndex];\n // Word boundary = first character OR capital letter\n const isWordBoundary = propertyIndex === 0 ||\n (propChar === propChar.toUpperCase() && propChar !== propChar.toLowerCase());\n\n if (isWordBoundary && inputChar.toLowerCase() === propChar.toLowerCase()) {\n // Match found at word boundary\n found = true;\n propertyIndex++; // Move past this character for next search\n break;\n }\n\n propertyIndex++;\n }\n\n if (!found) {\n return false; // Couldn't find this input character at a word boundary\n }\n }\n\n return true;\n}\n\n/**\n * Filter CSS properties based on input value\n * Supports both startsWith matching and camelCase abbreviation matching\n */\nexport function filterCSSProperties(input: string): string[] {\n const normalizedInput = (input ?? '').trim();\n if (!normalizedInput) {\n return CSS_PROPERTIES.slice(0, 15); // Show first 15 by default\n }\n\n // First, try startsWith matching (exact prefix match)\n const startsWithMatches = CSS_PROPERTIES.filter(prop =>\n prop.toLowerCase().startsWith(normalizedInput.toLowerCase())\n );\n\n // Then, try abbreviation/fuzzy matching\n const abbreviationMatches = CSS_PROPERTIES.filter(prop =>\n matchesAbbreviation(prop, normalizedInput) &&\n !startsWithMatches.includes(prop) // Don't duplicate startsWith matches\n );\n\n // Sort each group by popularity, then combine: exact matches first, then fuzzy matches\n const byPriority = (a: string, b: string) =>\n getPropertyPriority(a) - getPropertyPriority(b);\n\n return [\n ...startsWithMatches.sort(byPriority),\n ...abbreviationMatches.sort(byPriority),\n ];\n}\n\n/**\n * Get available values for a specific CSS property\n * @param propertyName - The CSS property name (e.g., 'flexDirection')\n * @returns Array of valid values for the property, or empty array if property has no predefined values\n */\nexport function getPropertyValues(propertyName: string): string[] {\n const values = CSS_PROPERTIES_DEFINITION[propertyName]?.values;\n return values ? Array.from(values) : [];\n}\n\n/**\n * Filter values for a specific CSS property based on input\n * Supports substring matching and returns values that contain the input\n * @param propertyName - The CSS property name (e.g., 'flexDirection')\n * @param input - The user input to filter values by\n * @returns Filtered array of valid values for the property\n */\nexport function filterPropertyValues(propertyName: string, input: string): string[] {\n const values = getPropertyValues(propertyName);\n if (!values.length) {\n return []; // No predefined values for this property\n }\n\n const normalizedInput = (input ?? '').trim().toLowerCase();\n if (!normalizedInput) {\n return values; // Return all values if no input\n }\n\n // Filter values that contain the input (substring match)\n return values.filter(value =>\n value.toLowerCase().includes(normalizedInput)\n );\n}\n\n/**\n * Get the property type for a CSS property\n * @param propertyName - The CSS property name\n * @returns The property type ('string' | 'select' | 'boolean' | 'number') or undefined\n */\nexport function getPropertyType(propertyName: string): 'string' | 'select' | 'boolean' | 'number' | undefined {\n return CSS_PROPERTIES_DEFINITION[propertyName]?.type;\n}\n\n/**\n * CSS properties whose numeric values are unitless by spec \u2014 `font-weight: 400`,\n * `line-height: 1.5`, `opacity: 0.8`, `z-index: 10`, etc. The auto-px commit\n * normalizer must NOT append `px` to bare numbers for these.\n */\nexport const UNITLESS_PROPERTIES: ReadonlySet<string> = new Set([\n 'fontWeight', 'lineHeight',\n 'opacity', 'fillOpacity', 'strokeOpacity', 'stopOpacity',\n 'zIndex', 'order',\n 'flexGrow', 'flexShrink', 'flex',\n 'columnCount', 'columns', 'tabSize', 'orphans', 'widows',\n 'gridRow', 'gridColumn', 'gridRowStart', 'gridRowEnd',\n 'gridColumnStart', 'gridColumnEnd',\n 'animationIterationCount',\n 'aspectRatio',\n 'scale',\n]);\n\n/**\n * Whether bare numeric values for `propertyName` should be treated as pixels at\n * commit time (e.g. typing `52` for `width` becomes `52px`). Unitless props,\n * `select`/`boolean` keyword props, and existing `number`-typed entries return false.\n */\nexport function appendsPxByDefault(propertyName: string): boolean {\n if (UNITLESS_PROPERTIES.has(propertyName)) return false;\n const def = CSS_PROPERTIES_DEFINITION[propertyName];\n if (def?.type === 'select' || def?.type === 'boolean' || def?.type === 'number') return false;\n return true;\n}\n", "/**\n * Error Logger\n * Centralized error logging with optional telemetry integration\n */\n\nimport type { ErrorCategory } from './errors';\n\ninterface ErrorLogEntry {\n location: string;\n category: ErrorCategory;\n error: unknown;\n context?: Record<string, unknown>;\n timestamp: number;\n}\n\ntype ErrorHandler = (entry: ErrorLogEntry) => void;\n\nlet errorHandler: ErrorHandler | null = null;\n\n/**\n * Set custom error handler (for telemetry integration)\n */\nexport function setErrorHandler(handler: ErrorHandler | null): void {\n errorHandler = handler;\n}\n\n/**\n * Check if running in development mode\n */\nfunction isDevelopment(): boolean {\n // Check for Node.js environment\n if (typeof process !== 'undefined' && process.env?.NODE_ENV) {\n return process.env.NODE_ENV === 'development';\n }\n // Browser environment - assume development if no production indicators\n return true;\n}\n\n/**\n * Log runtime error with context\n * Use for graceful degradation scenarios where error is handled but should be visible\n */\nexport function logRuntimeError(\n location: string,\n error: unknown,\n context?: Record<string, unknown>\n): void {\n const entry: ErrorLogEntry = {\n location,\n category: 'runtime',\n error,\n context,\n timestamp: Date.now(),\n };\n\n // Development: always log to console\n if (isDevelopment()) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`[${location}] ${errorMessage}`, context ?? '');\n }\n\n // Custom handler (telemetry, etc.)\n errorHandler?.(entry);\n}\n\n/**\n * Log network/API error\n */\nexport function logNetworkError(\n location: string,\n error: unknown,\n context?: Record<string, unknown>\n): void {\n const entry: ErrorLogEntry = {\n location,\n category: 'network',\n error,\n context,\n timestamp: Date.now(),\n };\n\n if (isDevelopment()) {\n console.error(`[${location}] Network error:`, error, context ?? '');\n }\n\n errorHandler?.(entry);\n}\n"],
|
|
5
|
-
"mappings": ";AAYO,IAAM,4BAAmE;AAAA;AAAA,EAE9E,SAAS;AAAA,IACP,QAAQ,CAAC,SAAS,QAAQ,QAAQ,UAAU,gBAAgB,eAAe,eAAe,MAAM;AAAA,IAChG,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,QAAQ,CAAC,UAAU,YAAY,YAAY,SAAS,QAAQ;AAAA,IAC5D,MA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AW,EAAE;AAAA,EAC9D;AAGA,iBAAe,KAAK;AACtB;AAKO,SAAS,gBACd,UACA,OACA,SACM;AACN,QAAM,QAAuB;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW,KAAK,IAAI;AAAA,EACtB;AAEA,MAAI,cAAc,GAAG;AACnB,YAAQ,MAAM,IAAI,QAAQ,oBAAoB,OAAO,WAAW,EAAE;AAAA,EACpE;AAEA,iBAAe,KAAK;AACtB;",
|
|
4
|
+
"sourcesContent": ["/**\n * CSS Property Definition structure\n */\ninterface CSSPropertyDefinition {\n values?: readonly string[];\n type?: 'string' | 'select' | 'boolean' | 'number';\n}\n\n/**\n * CSS Properties with their valid values and metadata\n * Used for autocomplete suggestions for both property names and values\n */\nexport const CSS_PROPERTIES_DEFINITION: Record<string, CSSPropertyDefinition> = {\n // Display & Layout\n display: {\n values: ['block', 'flex', 'grid', 'inline', 'inline-block', 'inline-flex', 'inline-grid', 'none'],\n type: 'select',\n },\n position: {\n values: ['static', 'relative', 'absolute', 'fixed', 'sticky'],\n type: 'select',\n },\n top: { type: 'string' },\n right: { type: 'string' },\n bottom: { type: 'string' },\n left: { type: 'string' },\n inset: { type: 'string' },\n zIndex: { type: 'number' },\n\n // Dimensions\n width: { type: 'string' },\n height: { type: 'string' },\n minWidth: { type: 'string' },\n maxWidth: { type: 'string' },\n minHeight: { type: 'string' },\n maxHeight: { type: 'string' },\n aspectRatio: { type: 'string' },\n\n // Spacing\n margin: { type: 'string' },\n marginTop: { type: 'string' },\n marginRight: { type: 'string' },\n marginBottom: { type: 'string' },\n marginLeft: { type: 'string' },\n padding: { type: 'string' },\n paddingTop: { type: 'string' },\n paddingRight: { type: 'string' },\n paddingBottom: { type: 'string' },\n paddingLeft: { type: 'string' },\n gap: { type: 'string' },\n rowGap: { type: 'string' },\n columnGap: { type: 'string' },\n\n // Borders\n border: { type: 'string' },\n borderWidth: { type: 'string' },\n borderStyle: {\n values: ['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset', 'none'],\n type: 'select',\n },\n borderColor: { type: 'string' },\n borderTop: { type: 'string' },\n borderRight: { type: 'string' },\n borderBottom: { type: 'string' },\n borderLeft: { type: 'string' },\n borderRadius: { type: 'string' },\n borderTopLeftRadius: { type: 'string' },\n borderTopRightRadius: { type: 'string' },\n borderBottomLeftRadius: { type: 'string' },\n borderBottomRightRadius: { type: 'string' },\n\n // Background & Colors\n background: { type: 'string' },\n backgroundColor: { type: 'string' },\n backgroundImage: { type: 'string' },\n backgroundSize: {\n values: ['auto', 'cover', 'contain'],\n type: 'select',\n },\n backgroundPosition: {\n values: ['top', 'bottom', 'left', 'right', 'center'],\n type: 'select',\n },\n backgroundRepeat: {\n values: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'],\n type: 'select',\n },\n color: { type: 'string' },\n opacity: { type: 'number' },\n\n // Flexbox\n flex: { type: 'string' },\n flexDirection: {\n values: ['row', 'column', 'row-reverse', 'column-reverse'],\n type: 'select',\n },\n flexWrap: {\n values: ['nowrap', 'wrap', 'wrap-reverse'],\n type: 'select',\n },\n flexFlow: { type: 'string' },\n justifyContent: {\n values: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'],\n type: 'select',\n },\n alignItems: {\n values: ['flex-start', 'flex-end', 'center', 'stretch', 'baseline'],\n type: 'select',\n },\n alignContent: {\n values: ['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'],\n type: 'select',\n },\n alignSelf: {\n values: ['auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'],\n type: 'select',\n },\n flexGrow: { type: 'number' },\n flexShrink: { type: 'number' },\n flexBasis: { type: 'string' },\n order: { type: 'number' },\n\n // Grid\n grid: { type: 'string' },\n gridTemplateColumns: { type: 'string' },\n gridTemplateRows: { type: 'string' },\n gridTemplateAreas: { type: 'string' },\n gridGap: { type: 'string' },\n gridColumn: { type: 'string' },\n gridRow: { type: 'string' },\n gridArea: { type: 'string' },\n gridAutoFlow: {\n values: ['row', 'column', 'row dense', 'column dense'],\n type: 'select',\n },\n gridAutoColumns: { type: 'string' },\n gridAutoRows: { type: 'string' },\n justifyItems: {\n values: ['start', 'end', 'center', 'stretch'],\n type: 'select',\n },\n justifySelf: {\n values: ['auto', 'start', 'end', 'center', 'stretch'],\n type: 'select',\n },\n placeContent: { type: 'string' },\n placeItems: { type: 'string' },\n placeSelf: { type: 'string' },\n\n // Text & Font\n fontSize: { type: 'string' },\n fontWeight: {\n values: ['100', '200', '300', '400', '500', '600', '700', '800', '900', 'normal', 'bold'],\n type: 'select',\n },\n fontFamily: { type: 'string' },\n fontStyle: {\n values: ['normal', 'italic', 'oblique'],\n type: 'select',\n },\n lineHeight: { type: 'string' },\n textAlign: {\n values: ['left', 'right', 'center', 'justify', 'start', 'end'],\n type: 'select',\n },\n textDecoration: {\n values: ['none', 'underline', 'overline', 'line-through'],\n type: 'select',\n },\n textTransform: {\n values: ['none', 'capitalize', 'uppercase', 'lowercase'],\n type: 'select',\n },\n letterSpacing: { type: 'string' },\n wordSpacing: { type: 'string' },\n wordBreak: {\n values: ['normal', 'break-all', 'keep-all', 'break-word'],\n type: 'select',\n },\n overflowWrap: {\n values: ['normal', 'break-word', 'anywhere'],\n type: 'select',\n },\n textIndent: { type: 'string' },\n verticalAlign: {\n values: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super'],\n type: 'select',\n },\n\n // Box Shadow & Effects\n boxShadow: { type: 'string' },\n textShadow: { type: 'string' },\n filter: { type: 'string' },\n backdropFilter: { type: 'string' },\n transform: { type: 'string' },\n transformOrigin: { type: 'string' },\n transition: { type: 'string' },\n animation: { type: 'string' },\n backfaceVisibility: {\n values: ['visible', 'hidden'],\n type: 'select',\n },\n mixBlendMode: {\n values: ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'],\n type: 'select',\n },\n clipPath: { type: 'string' },\n\n // Overflow & Content\n overflow: {\n values: ['visible', 'hidden', 'scroll', 'auto'],\n type: 'select',\n },\n overflowX: {\n values: ['visible', 'hidden', 'scroll', 'auto'],\n type: 'select',\n },\n overflowY: {\n values: ['visible', 'hidden', 'scroll', 'auto'],\n type: 'select',\n },\n whiteSpace: {\n values: ['normal', 'nowrap', 'pre', 'pre-wrap', 'pre-line'],\n type: 'select',\n },\n textOverflow: {\n values: ['clip', 'ellipsis'],\n type: 'select',\n },\n visibility: {\n values: ['visible', 'hidden', 'collapse'],\n type: 'select',\n },\n content: { type: 'string' },\n\n // Cursor & Interaction\n cursor: {\n values: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'not-allowed', 'help'],\n type: 'select',\n },\n pointerEvents: {\n values: ['auto', 'none'],\n type: 'select',\n },\n userSelect: {\n values: ['auto', 'none', 'text', 'all'],\n type: 'select',\n },\n\n // Outline\n outline: { type: 'string' },\n outlineWidth: { type: 'string' },\n outlineStyle: {\n values: ['none', 'solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset'],\n type: 'select',\n },\n outlineColor: { type: 'string' },\n outlineOffset: { type: 'string' },\n\n // Lists\n listStyle: { type: 'string' },\n listStyleType: {\n values: ['none', 'disc', 'circle', 'square', 'decimal', 'decimal-leading-zero', 'lower-roman', 'upper-roman', 'lower-alpha', 'upper-alpha'],\n type: 'select',\n },\n listStylePosition: {\n values: ['inside', 'outside'],\n type: 'select',\n },\n\n // Miscellaneous\n float: {\n values: ['left', 'right', 'none'],\n type: 'select',\n },\n clear: {\n values: ['left', 'right', 'both', 'none'],\n type: 'select',\n },\n boxSizing: {\n values: ['content-box', 'border-box'],\n type: 'select',\n },\n objectFit: {\n values: ['fill', 'contain', 'cover', 'scale-down'],\n type: 'select',\n },\n objectPosition: {\n values: ['top', 'bottom', 'left', 'right', 'center'],\n type: 'select',\n },\n resize: {\n values: ['none', 'both', 'horizontal', 'vertical'],\n type: 'select',\n },\n scrollBehavior: {\n values: ['auto', 'smooth'],\n type: 'select',\n },\n accentColor: { type: 'string' },\n\n // SVG\n stroke: { type: 'string' },\n strokeWidth: { type: 'string' },\n strokeDasharray: { type: 'string' },\n strokeDashoffset: { type: 'string' },\n strokeLinecap: {\n values: ['butt', 'round', 'square'],\n type: 'select',\n },\n strokeLinejoin: {\n values: ['miter', 'round', 'bevel'],\n type: 'select',\n },\n strokeOpacity: { type: 'number' },\n fill: { type: 'string' },\n fillOpacity: { type: 'number' },\n fillRule: {\n values: ['nonzero', 'evenodd'],\n type: 'select',\n },\n};\n\n/**\n * Common CSS properties for autocomplete suggestions (camelCase for React/JS)\n * Derived from CSS_PROPERTIES_DEFINITION keys\n */\nexport const CSS_PROPERTIES = Object.keys(CSS_PROPERTIES_DEFINITION);\n\n/**\n * Popularity tiers for CSS properties (lower = more common).\n * Properties not listed default to tier 3.\n * Used to sort autocomplete suggestions within each match group.\n */\nconst CSS_PROPERTY_PRIORITY: Record<string, number> = {\n // Tier 1: Most commonly used\n display: 1,\n position: 1,\n width: 1,\n height: 1,\n margin: 1,\n padding: 1,\n color: 1,\n backgroundColor: 1,\n fontSize: 1,\n fontWeight: 1,\n border: 1,\n borderRadius: 1,\n flex: 1,\n flexDirection: 1,\n justifyContent: 1,\n alignItems: 1,\n gap: 1,\n opacity: 1,\n overflow: 1,\n zIndex: 1,\n top: 1,\n right: 1,\n bottom: 1,\n left: 1,\n cursor: 1,\n background: 1,\n boxShadow: 1,\n transition: 1,\n transform: 1,\n lineHeight: 1,\n textAlign: 1,\n\n // Tier 2: Common but less frequent\n maxWidth: 2,\n maxHeight: 2,\n minWidth: 3,\n minHeight: 3,\n marginTop: 2,\n marginBottom: 2,\n marginLeft: 2,\n marginRight: 2,\n paddingTop: 2,\n paddingBottom: 2,\n paddingLeft: 2,\n paddingRight: 2,\n fontFamily: 2,\n fontStyle: 2,\n textDecoration: 2,\n textTransform: 2,\n letterSpacing: 2,\n borderWidth: 2,\n borderStyle: 2,\n borderColor: 2,\n borderBottom: 2,\n borderTop: 2,\n flexWrap: 2,\n flexGrow: 2,\n flexShrink: 2,\n flexBasis: 2,\n alignSelf: 2,\n gridTemplateColumns: 2,\n gridTemplateRows: 2,\n backgroundImage: 2,\n backgroundSize: 2,\n backgroundPosition: 2,\n whiteSpace: 2,\n textOverflow: 2,\n visibility: 2,\n pointerEvents: 2,\n userSelect: 2,\n boxSizing: 2,\n objectFit: 2,\n filter: 2,\n animation: 2,\n outline: 2,\n inset: 2,\n};\n\nfunction getPropertyPriority(property: string): number {\n return CSS_PROPERTY_PRIORITY[property] ?? 3;\n}\n\n/**\n * CSS Property Groups for organizing styles in the editor\n * Order determines display order in the UI\n */\nexport const CSS_PROPERTY_GROUPS: Record<string, string[]> = {\n 'Layout': ['display'],\n 'Spacing': ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n 'Size': ['width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'aspectRatio'],\n 'Position': ['position', 'top', 'right', 'bottom', 'left', 'inset', 'zIndex'],\n 'Flexbox': ['flex', 'flexDirection', 'flexWrap', 'flexFlow', 'justifyContent', 'alignItems', 'alignContent', 'gap', 'rowGap', 'columnGap', 'alignSelf', 'flexGrow', 'flexShrink', 'flexBasis', 'order'],\n 'Grid': ['grid', 'gridTemplateColumns', 'gridTemplateRows', 'gridTemplateAreas', 'gridGap', 'gridColumn', 'gridRow', 'gridArea', 'gridAutoFlow', 'gridAutoColumns', 'gridAutoRows', 'justifyItems', 'justifySelf', 'placeContent', 'placeItems', 'placeSelf'],\n 'Typography': ['fontWeight', 'fontSize', 'fontFamily', 'fontStyle', 'lineHeight', 'color', 'textAlign', 'textDecoration', 'textTransform', 'letterSpacing', 'wordSpacing', 'wordBreak', 'overflowWrap', 'textIndent', 'verticalAlign'],\n 'Background': ['background', 'backgroundColor', 'backgroundImage', 'backgroundSize', 'backgroundPosition', 'backgroundRepeat', 'opacity'],\n 'Borders': ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'border', 'borderWidth', 'borderStyle', 'borderColor', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft'],\n 'Outline': ['outline', 'outlineWidth', 'outlineStyle', 'outlineColor', 'outlineOffset'],\n 'Effects': ['boxShadow', 'textShadow', 'filter', 'backdropFilter', 'transform', 'transformOrigin', 'transition', 'animation', 'backfaceVisibility', 'mixBlendMode', 'clipPath'],\n 'Overflow': ['overflow', 'overflowX', 'overflowY', 'whiteSpace', 'textOverflow', 'visibility', 'content'],\n 'Interaction': ['cursor', 'pointerEvents', 'userSelect'],\n 'Lists': ['listStyle', 'listStyleType', 'listStylePosition'],\n 'Other': ['float', 'clear', 'boxSizing', 'objectFit', 'objectPosition', 'resize', 'scrollBehavior', 'accentColor'],\n 'SVG': ['stroke', 'strokeWidth', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeOpacity', 'fill', 'fillOpacity', 'fillRule'],\n};\n\n/**\n * Get the group name for a CSS property\n * @param propertyName - The CSS property name\n * @returns The group name or 'Other' if not found\n */\nexport function getPropertyGroup(propertyName: string): string {\n for (const [groupName, properties] of Object.entries(CSS_PROPERTY_GROUPS)) {\n if (properties.includes(propertyName)) {\n return groupName;\n }\n }\n return 'Other';\n}\n\n/**\n * Subset of CSS properties shown as \"always-visible\" rows in the visual style\n * editor mode (Webflow-like). Each property here renders even when unset, so\n * the user can see at a glance which properties are available and click an\n * empty row to start typing a value.\n *\n * Keys must be group names from CSS_PROPERTY_GROUPS so the visual editor can\n * reuse the same group headers as list mode.\n */\nexport const VISUAL_MODE_PROPERTIES: Record<string, string[]> = {\n 'Layout': ['display'],\n 'Grid': ['gridTemplateColumns'],\n 'Flexbox': ['flexDirection', 'flexWrap', 'justifyContent', 'alignItems', 'gap', 'flexGrow', 'flexShrink', 'flexBasis'],\n 'Spacing': ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft'],\n 'Size': ['width', 'height', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight'],\n 'Position': ['position', 'top', 'right', 'bottom', 'left', 'zIndex'],\n 'Typography': ['fontFamily', 'fontWeight', 'fontSize', 'lineHeight', 'color', 'letterSpacing', 'textAlign', 'textTransform', 'textDecoration'],\n 'Background': ['backgroundColor', 'backgroundImage', 'backgroundSize', 'backgroundPosition', 'backgroundRepeat', 'opacity'],\n 'Borders': ['borderRadius', 'borderWidth', 'borderStyle', 'borderColor'],\n 'Effects': ['boxShadow', 'transform', 'transition', 'filter'],\n 'Overflow': ['overflow', 'whiteSpace'],\n 'Interaction': ['cursor', 'pointerEvents'],\n};\n\nconst VISUAL_MODE_PROPERTIES_SET = new Set(\n Object.values(VISUAL_MODE_PROPERTIES).flat()\n);\n\n/**\n * True if `prop` belongs to the always-visible visual-mode list.\n */\nexport function isVisualModeProperty(prop: string): boolean {\n return VISUAL_MODE_PROPERTIES_SET.has(prop);\n}\n\n/**\n * Context used by visual-mode visibility rules. Captures everything a rule\n * needs to decide whether a property row is meaningful for the currently\n * selected element. Built once per render in `StyleEditor`.\n */\nexport interface VisualModeRuleContext {\n /** Effective `display` of the selected element \u2014 getComputedStyle().display\n * with declared (instance/inherited/effective) merge as fallback when the\n * iframe hasn't loaded yet. Defaults to 'block'. */\n display: string;\n /** Effective `display` of the DOM parent \u2014 used for flex/grid item props\n * whose applicability depends on the parent's layout mode. '' when no\n * parent is reachable (root element, iframe missing). */\n parentDisplay: string;\n /** Effective `position` of the selected element. Defaults to 'static'. */\n position: string;\n /** Lowercase HTML tag name of the selected element ('div', 'img', 'ul'\u2026). */\n tagName: string;\n /** True if any of paddingTop / paddingRight / paddingBottom / paddingLeft\n * is set anywhere in the cascade (instance + inherited + effective).\n * When true, the panel shows the four longhand rows and hides `padding`. */\n hasPaddingLonghand: boolean;\n /** Same as `hasPaddingLonghand` for the four `margin*` longhands. */\n hasMarginLonghand: boolean;\n /** True if `backgroundImage` (or the `background` shorthand) is set anywhere\n * in the cascade. Drives visibility of background-image-only properties\n * like `backgroundPosition` / `backgroundSize` / `backgroundRepeat`. */\n hasBackgroundImage: boolean;\n}\n\nexport type VisualModeRule = (ctx: VisualModeRuleContext) => boolean;\n\nconst isFlexDisplay = (d: string) => d === 'flex' || d === 'inline-flex';\nconst isGridDisplay = (d: string) => d === 'grid' || d === 'inline-grid';\nconst isListTag = (t: string) => t === 'ul' || t === 'ol' || t === 'li';\nconst isMediaTag = (t: string) => t === 'img' || t === 'video';\n\n/**\n * Visibility rules for the visual-mode style panel. Each entry is a predicate\n * that returns true when the row should be rendered for the current element\n * context. Properties without an entry are always visible. Properties that\n * are *explicitly set* on the element bypass these rules (the explicit-value\n * override is enforced by the caller, not here).\n */\nexport const VISUAL_MODE_RULES: Record<string, VisualModeRule> = {\n // Flex/Grid CONTAINER props \u2014 own display must be flex/grid.\n flexDirection: ctx => isFlexDisplay(ctx.display),\n flexWrap: ctx => isFlexDisplay(ctx.display),\n justifyContent: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n alignItems: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n alignContent: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n gap: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n rowGap: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n columnGap: ctx => isFlexDisplay(ctx.display) || isGridDisplay(ctx.display),\n gridTemplateColumns: ctx => isGridDisplay(ctx.display),\n gridTemplateRows: ctx => isGridDisplay(ctx.display),\n gridTemplateAreas: ctx => isGridDisplay(ctx.display),\n gridGap: ctx => isGridDisplay(ctx.display),\n gridAutoFlow: ctx => isGridDisplay(ctx.display),\n gridAutoColumns: ctx => isGridDisplay(ctx.display),\n gridAutoRows: ctx => isGridDisplay(ctx.display),\n justifyItems: ctx => isGridDisplay(ctx.display),\n placeItems: ctx => isGridDisplay(ctx.display),\n placeContent: ctx => isGridDisplay(ctx.display),\n\n // Flex/Grid ITEM props \u2014 PARENT display must be flex/grid.\n flex: ctx => isFlexDisplay(ctx.parentDisplay),\n flexFlow: ctx => isFlexDisplay(ctx.parentDisplay),\n flexGrow: ctx => isFlexDisplay(ctx.parentDisplay),\n flexShrink: ctx => isFlexDisplay(ctx.parentDisplay),\n flexBasis: ctx => isFlexDisplay(ctx.parentDisplay),\n alignSelf: ctx => isFlexDisplay(ctx.parentDisplay) || isGridDisplay(ctx.parentDisplay),\n justifySelf: ctx => isGridDisplay(ctx.parentDisplay),\n placeSelf: ctx => isGridDisplay(ctx.parentDisplay),\n order: ctx => isFlexDisplay(ctx.parentDisplay) || isGridDisplay(ctx.parentDisplay),\n gridArea: ctx => isGridDisplay(ctx.parentDisplay),\n gridColumn: ctx => isGridDisplay(ctx.parentDisplay),\n gridRow: ctx => isGridDisplay(ctx.parentDisplay),\n\n // Position-dependent inset properties.\n top: ctx => ctx.position !== 'static',\n right: ctx => ctx.position !== 'static',\n bottom: ctx => ctx.position !== 'static',\n left: ctx => ctx.position !== 'static',\n inset: ctx => ctx.position !== 'static',\n zIndex: ctx => ctx.position !== 'static',\n\n // Tag-based.\n objectFit: ctx => isMediaTag(ctx.tagName),\n objectPosition: ctx => isMediaTag(ctx.tagName),\n listStyle: ctx => isListTag(ctx.tagName),\n listStyleType: ctx => isListTag(ctx.tagName),\n listStylePosition: ctx => isListTag(ctx.tagName),\n\n // Padding/margin shorthand-vs-longhand auto-toggle.\n // When ANY longhand is set, hide shorthand; otherwise hide longhands.\n padding: ctx => !ctx.hasPaddingLonghand,\n paddingTop: ctx => ctx.hasPaddingLonghand,\n paddingRight: ctx => ctx.hasPaddingLonghand,\n paddingBottom: ctx => ctx.hasPaddingLonghand,\n paddingLeft: ctx => ctx.hasPaddingLonghand,\n margin: ctx => !ctx.hasMarginLonghand,\n marginTop: ctx => ctx.hasMarginLonghand,\n marginRight: ctx => ctx.hasMarginLonghand,\n marginBottom: ctx => ctx.hasMarginLonghand,\n marginLeft: ctx => ctx.hasMarginLonghand,\n\n // Background-image-only props \u2014 meaningless without a background image.\n backgroundPosition: ctx => ctx.hasBackgroundImage,\n backgroundSize: ctx => ctx.hasBackgroundImage,\n backgroundRepeat: ctx => ctx.hasBackgroundImage,\n};\n\n/**\n * True if `prop` should be visible in the visual-mode panel given `ctx`.\n * Properties without an entry in `VISUAL_MODE_RULES` default to visible.\n * Callers are responsible for the explicit-value override (a property that\n * the user has set must remain visible regardless of the rule outcome).\n */\nexport function isVisualModeRowVisible(prop: string, ctx: VisualModeRuleContext): boolean {\n const rule = VISUAL_MODE_RULES[prop];\n return rule ? rule(ctx) : true;\n}\n\n/**\n * Check if property matches the abbreviation pattern\n * For example, \"bC\" matches \"backgroundColor\" (b\u2192b, C\u2192C capital letter)\n */\nfunction matchesAbbreviation(property: string, input: string): boolean {\n if (!input) return false;\n\n let propertyIndex = 0;\n\n for (let inputIndex = 0; inputIndex < input.length; inputIndex++) {\n const inputChar = input[inputIndex];\n let found = false;\n\n // Search from current position to end of property for a match at a word boundary\n while (propertyIndex < property.length) {\n const propChar = property[propertyIndex];\n // Word boundary = first character OR capital letter\n const isWordBoundary = propertyIndex === 0 ||\n (propChar === propChar.toUpperCase() && propChar !== propChar.toLowerCase());\n\n if (isWordBoundary && inputChar.toLowerCase() === propChar.toLowerCase()) {\n // Match found at word boundary\n found = true;\n propertyIndex++; // Move past this character for next search\n break;\n }\n\n propertyIndex++;\n }\n\n if (!found) {\n return false; // Couldn't find this input character at a word boundary\n }\n }\n\n return true;\n}\n\n/**\n * Direction-abbreviation shortcuts. When the user types one of these exact\n * inputs, the mapped property is forced to the top of the suggestions list\n * (ahead of startsWith matches like `placeContent` for \"pl\"). \"u\" stands for\n * \"up\" \u2014 a natural mnemonic for `Top`.\n */\nconst PROPERTY_SHORTCUTS: Record<string, string> = {\n pl: 'paddingLeft',\n pr: 'paddingRight',\n pt: 'paddingTop',\n pu: 'paddingTop',\n pb: 'paddingBottom',\n ml: 'marginLeft',\n mr: 'marginRight',\n mt: 'marginTop',\n mu: 'marginTop',\n mb: 'marginBottom',\n};\n\n/**\n * Filter CSS properties based on input value\n * Supports both startsWith matching and camelCase abbreviation matching\n */\nexport function filterCSSProperties(input: string): string[] {\n const normalizedInput = (input ?? '').trim();\n if (!normalizedInput) {\n return CSS_PROPERTIES.slice(0, 15); // Show first 15 by default\n }\n\n // First, try startsWith matching (exact prefix match)\n const startsWithMatches = CSS_PROPERTIES.filter(prop =>\n prop.toLowerCase().startsWith(normalizedInput.toLowerCase())\n );\n\n // Then, try abbreviation/fuzzy matching\n const abbreviationMatches = CSS_PROPERTIES.filter(prop =>\n matchesAbbreviation(prop, normalizedInput) &&\n !startsWithMatches.includes(prop) // Don't duplicate startsWith matches\n );\n\n // Sort each group by popularity, then combine: exact matches first, then fuzzy matches\n const byPriority = (a: string, b: string) =>\n getPropertyPriority(a) - getPropertyPriority(b);\n\n const combined = [\n ...startsWithMatches.sort(byPriority),\n ...abbreviationMatches.sort(byPriority),\n ];\n\n const shortcut = PROPERTY_SHORTCUTS[normalizedInput.toLowerCase()];\n if (shortcut) {\n return [shortcut, ...combined.filter(prop => prop !== shortcut)];\n }\n\n return combined;\n}\n\n/**\n * Get available values for a specific CSS property\n * @param propertyName - The CSS property name (e.g., 'flexDirection')\n * @returns Array of valid values for the property, or empty array if property has no predefined values\n */\nexport function getPropertyValues(propertyName: string): string[] {\n const values = CSS_PROPERTIES_DEFINITION[propertyName]?.values;\n return values ? Array.from(values) : [];\n}\n\n/**\n * Filter values for a specific CSS property based on input\n * Supports substring matching and returns values that contain the input\n * @param propertyName - The CSS property name (e.g., 'flexDirection')\n * @param input - The user input to filter values by\n * @returns Filtered array of valid values for the property\n */\nexport function filterPropertyValues(propertyName: string, input: string): string[] {\n const values = getPropertyValues(propertyName);\n if (!values.length) {\n return []; // No predefined values for this property\n }\n\n const normalizedInput = (input ?? '').trim().toLowerCase();\n if (!normalizedInput) {\n return values; // Return all values if no input\n }\n\n // Filter values that contain the input (substring match)\n return values.filter(value =>\n value.toLowerCase().includes(normalizedInput)\n );\n}\n\n/**\n * Get the property type for a CSS property\n * @param propertyName - The CSS property name\n * @returns The property type ('string' | 'select' | 'boolean' | 'number') or undefined\n */\nexport function getPropertyType(propertyName: string): 'string' | 'select' | 'boolean' | 'number' | undefined {\n return CSS_PROPERTIES_DEFINITION[propertyName]?.type;\n}\n\n/**\n * CSS properties whose numeric values are unitless by spec \u2014 `font-weight: 400`,\n * `line-height: 1.5`, `opacity: 0.8`, `z-index: 10`, etc. The auto-px commit\n * normalizer must NOT append `px` to bare numbers for these.\n */\nexport const UNITLESS_PROPERTIES: ReadonlySet<string> = new Set([\n 'fontWeight', 'lineHeight',\n 'opacity', 'fillOpacity', 'strokeOpacity', 'stopOpacity',\n 'zIndex', 'order',\n 'flexGrow', 'flexShrink', 'flex',\n 'columnCount', 'columns', 'tabSize', 'orphans', 'widows',\n 'gridRow', 'gridColumn', 'gridRowStart', 'gridRowEnd',\n 'gridColumnStart', 'gridColumnEnd',\n 'animationIterationCount',\n 'aspectRatio',\n 'scale',\n]);\n\n/**\n * Whether bare numeric values for `propertyName` should be treated as pixels at\n * commit time (e.g. typing `52` for `width` becomes `52px`). Unitless props,\n * `select`/`boolean` keyword props, and existing `number`-typed entries return false.\n */\nexport function appendsPxByDefault(propertyName: string): boolean {\n if (UNITLESS_PROPERTIES.has(propertyName)) return false;\n const def = CSS_PROPERTIES_DEFINITION[propertyName];\n if (def?.type === 'select' || def?.type === 'boolean' || def?.type === 'number') return false;\n return true;\n}\n", "/**\n * Error Logger\n * Centralized error logging with optional telemetry integration\n */\n\nimport type { ErrorCategory } from './errors';\n\ninterface ErrorLogEntry {\n location: string;\n category: ErrorCategory;\n error: unknown;\n context?: Record<string, unknown>;\n timestamp: number;\n}\n\ntype ErrorHandler = (entry: ErrorLogEntry) => void;\n\nlet errorHandler: ErrorHandler | null = null;\n\n/**\n * Set custom error handler (for telemetry integration)\n */\nexport function setErrorHandler(handler: ErrorHandler | null): void {\n errorHandler = handler;\n}\n\n/**\n * Check if running in development mode\n */\nfunction isDevelopment(): boolean {\n // Check for Node.js environment\n if (typeof process !== 'undefined' && process.env?.NODE_ENV) {\n return process.env.NODE_ENV === 'development';\n }\n // Browser environment - assume development if no production indicators\n return true;\n}\n\n/**\n * Log runtime error with context\n * Use for graceful degradation scenarios where error is handled but should be visible\n */\nexport function logRuntimeError(\n location: string,\n error: unknown,\n context?: Record<string, unknown>\n): void {\n const entry: ErrorLogEntry = {\n location,\n category: 'runtime',\n error,\n context,\n timestamp: Date.now(),\n };\n\n // Development: always log to console\n if (isDevelopment()) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(`[${location}] ${errorMessage}`, context ?? '');\n }\n\n // Custom handler (telemetry, etc.)\n errorHandler?.(entry);\n}\n\n/**\n * Log network/API error\n */\nexport function logNetworkError(\n location: string,\n error: unknown,\n context?: Record<string, unknown>\n): void {\n const entry: ErrorLogEntry = {\n location,\n category: 'network',\n error,\n context,\n timestamp: Date.now(),\n };\n\n if (isDevelopment()) {\n console.error(`[${location}] Network error:`, error, context ?? '');\n }\n\n errorHandler?.(entry);\n}\n"],
|
|
5
|
+
"mappings": ";AAYO,IAAM,4BAAmE;AAAA;AAAA,EAE9E,SAAS;AAAA,IACP,QAAQ,CAAC,SAAS,QAAQ,QAAQ,UAAU,gBAAgB,eAAe,eAAe,MAAM;AAAA,IAChG,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,QAAQ,CAAC,UAAU,YAAY,YAAY,SAAS,QAAQ;AAAA,IAC5D,MAAM;AAAA,EACR;AAAA,EACA,KAAK,EAAE,MAAM,SAAS;AAAA,EACtB,OAAO,EAAE,MAAM,SAAS;AAAA,EACxB,QAAQ,EAAE,MAAM,SAAS;AAAA,EACzB,MAAM,EAAE,MAAM,SAAS;AAAA,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UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW,KAAK,IAAI;AAAA,EACtB;AAGA,MAAI,cAAc,GAAG;AACnB,UAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC1E,YAAQ,MAAM,IAAI,QAAQ,KAAK,YAAY,IAAI,WAAW,EAAE;AAAA,EAC9D;AAGA,iBAAe,KAAK;AACtB;AAKO,SAAS,gBACd,UACA,OACA,SACM;AACN,QAAM,QAAuB;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW,KAAK,IAAI;AAAA,EACtB;AAEA,MAAI,cAAc,GAAG;AACnB,YAAQ,MAAM,IAAI,QAAQ,oBAAoB,OAAO,WAAW,EAAE;AAAA,EACpE;AAEA,iBAAe,KAAK;AACtB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../lib/server/services/configService.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Config Service\n * Centralized configuration loading and access\n *\n * Consolidates multiple config loaders into a single service that loads\n * the project.config.json file once and exposes typed sections.\n */\n\nimport type { BreakpointConfig, BreakpointConfigInput, BreakpointEntry } from '../../shared/breakpoints';\nimport { DEFAULT_BREAKPOINTS, normalizeBreakpointConfig } from '../../shared/breakpoints';\nimport type { ResponsiveScales, BreakpointScales } from '../../shared/responsiveScaling';\nimport { DEFAULT_RESPONSIVE_SCALES } from '../../shared/responsiveScaling';\nimport type { I18nConfig } from '../../shared/types/components';\nimport type { LibrariesConfig, JSLibraryConfig, CSSLibraryConfig } from '../../shared/types/libraries';\nimport type { CSPConfig } from '../../shared/types/config';\nimport type { CustomCodeConfig } from '../../shared/types/api';\nimport type { RemConversionConfig } from '../../shared/pxToRem';\nimport { DEFAULT_REM_CONFIG } from '../../shared/pxToRem';\nimport { DEFAULT_I18N_CONFIG, migrateI18nConfig } from '../../shared/i18n';\nimport { projectPaths } from '../projectContext';\nimport { readTextFile, fileExists } from '../runtime';\n\n/**\n * Icons configuration\n */\nexport interface IconsConfig {\n favicon?: string;\n faviconDark?: string;\n appleTouchIcon?: string;\n}\n\n/**\n * Raw project config structure from project.config.json\n */\nexport type ImageFormat = 'webp' | 'avif';\n\ninterface RawProjectConfig {\n breakpoints?: BreakpointConfigInput;\n responsiveScales?: Partial<ResponsiveScales>;\n i18n?: unknown;\n icons?: IconsConfig;\n libraries?: LibrariesConfig;\n csp?: CSPConfig;\n baseComponent?: string;\n imageFormat?: ImageFormat;\n remConversion?: Partial<RemConversionConfig>;\n customCode?: CustomCodeConfig;\n showMenoBadge?: boolean;\n}\n\n/**\n * ConfigService\n * Loads project configuration once and provides typed access to sections\n */\nexport class ConfigService {\n private config: RawProjectConfig | null = null;\n private loaded = false;\n\n /**\n * Load configuration from project.config.json\n * Safe to call multiple times - only loads once\n */\n async load(): Promise<void> {\n if (this.loaded) {\n return;\n }\n\n try {\n if (await fileExists(projectPaths.config())) {\n const content = await readTextFile(projectPaths.config());\n this.config = JSON.parse(content);\n }\n } catch {\n // Fall through to defaults\n this.config = null;\n }\n\n this.loaded = true;\n }\n\n /**\n * Check if configuration has been loaded\n */\n isLoaded(): boolean {\n return this.loaded;\n }\n\n /**\n * Reset the service (for testing)\n */\n reset(): void {\n this.config = null;\n this.loaded = false;\n }\n\n /**\n * Get breakpoint configuration\n * Returns validated and normalized breakpoints (always object format)\n * Supports both legacy format { tablet: 1024 } and new format { tablet: { breakpoint: 1024, previewPoint: 768 } }\n */\n getBreakpoints(): BreakpointConfig {\n if (!this.config?.breakpoints || typeof this.config.breakpoints !== 'object') {\n return { ...DEFAULT_BREAKPOINTS };\n }\n\n // Validate breakpoint values before normalization\n const validInput: BreakpointConfigInput = {};\n for (const [key, value] of Object.entries(this.config.breakpoints)) {\n if (typeof value === 'number' && value > 0) {\n // Legacy format: number\n validInput[key] = value;\n } else if (typeof value === 'object' && value !== null) {\n // New format: object with breakpoint and optional previewPoint\n const entry = value as BreakpointEntry;\n if (typeof entry.breakpoint === 'number' && entry.breakpoint > 0) {\n validInput[key] = {\n breakpoint: entry.breakpoint,\n previewPoint: typeof entry.previewPoint === 'number' && entry.previewPoint > 0\n ? entry.previewPoint\n : entry.breakpoint,\n };\n }\n }\n }\n\n // Return normalized breakpoints or defaults if none valid\n if (Object.keys(validInput).length === 0) {\n return { ...DEFAULT_BREAKPOINTS };\n }\n\n return normalizeBreakpointConfig(validInput);\n }\n\n /**\n * Get i18n configuration\n * Automatically migrates old string[] format to LocaleConfig[] format\n */\n getI18n(): I18nConfig {\n if (!this.config?.i18n) {\n return { ...DEFAULT_I18N_CONFIG };\n }\n\n return migrateI18nConfig(this.config.i18n);\n }\n\n /**\n * Deep merge scale categories, preserving user-defined breakpoints\n * while filling in missing values from defaults\n */\n private mergeScaleCategory(\n userScales: BreakpointScales | undefined,\n defaultScales: BreakpointScales | undefined\n ): BreakpointScales | undefined {\n if (!userScales && !defaultScales) return undefined;\n if (!userScales) return defaultScales ? { ...defaultScales } : undefined;\n if (!defaultScales) return { ...userScales };\n\n // User scales take precedence, but include defaults for breakpoints not specified\n return {\n ...defaultScales,\n ...userScales,\n };\n }\n\n /**\n * Get responsive scales configuration\n * Supports dynamic breakpoints - scales are keyed by breakpoint name\n * Deep merges scale categories to preserve user breakpoint definitions\n */\n getResponsiveScales(): ResponsiveScales {\n if (!this.config?.responsiveScales || typeof this.config.responsiveScales !== 'object') {\n return { ...DEFAULT_RESPONSIVE_SCALES };\n }\n\n const userScales = this.config.responsiveScales;\n\n return {\n enabled: userScales.enabled ?? DEFAULT_RESPONSIVE_SCALES.enabled,\n mode: (userScales as { mode?: 'breakpoints' | 'fluid' }).mode ?? DEFAULT_RESPONSIVE_SCALES.mode,\n baseReference: userScales.baseReference ?? DEFAULT_RESPONSIVE_SCALES.baseReference,\n fluidRange: (userScales as { fluidRange?: { min: number; max: number } }).fluidRange\n ?? (DEFAULT_RESPONSIVE_SCALES.fluidRange ? { ...DEFAULT_RESPONSIVE_SCALES.fluidRange } : undefined),\n siteMargin: (userScales as { siteMargin?: { min: number; max: number } }).siteMargin\n ?? (DEFAULT_RESPONSIVE_SCALES.siteMargin ? { ...DEFAULT_RESPONSIVE_SCALES.siteMargin } : undefined),\n fontSize: this.mergeScaleCategory(\n userScales.fontSize as BreakpointScales | undefined,\n DEFAULT_RESPONSIVE_SCALES.fontSize\n ),\n padding: this.mergeScaleCategory(\n userScales.padding as BreakpointScales | undefined,\n DEFAULT_RESPONSIVE_SCALES.padding\n ),\n margin: this.mergeScaleCategory(\n userScales.margin as BreakpointScales | undefined,\n DEFAULT_RESPONSIVE_SCALES.margin\n ),\n gap: this.mergeScaleCategory(\n userScales.gap as BreakpointScales | undefined,\n DEFAULT_RESPONSIVE_SCALES.gap\n ),\n borderRadius: this.mergeScaleCategory(\n userScales.borderRadius as BreakpointScales | undefined,\n DEFAULT_RESPONSIVE_SCALES.borderRadius\n ),\n size: this.mergeScaleCategory(\n userScales.size as BreakpointScales | undefined,\n DEFAULT_RESPONSIVE_SCALES.size\n ),\n };\n }\n\n /**\n * Get rem conversion configuration\n */\n getRemConversion(): RemConversionConfig {\n if (!this.config?.remConversion || typeof this.config.remConversion !== 'object') {\n return { ...DEFAULT_REM_CONFIG };\n }\n return {\n enabled: this.config.remConversion.enabled ?? DEFAULT_REM_CONFIG.enabled,\n baseFontSize: this.config.remConversion.baseFontSize ?? DEFAULT_REM_CONFIG.baseFontSize,\n };\n }\n\n /**\n * Get icons configuration\n * Returns empty object if not configured\n */\n getIcons(): IconsConfig {\n if (!this.config?.icons || typeof this.config.icons !== 'object') {\n return {};\n }\n\n return this.config.icons;\n }\n\n /**\n * Get libraries configuration\n * Returns empty arrays if not configured\n * Normalizes string URLs to object format for backwards compatibility\n */\n getLibraries(): LibrariesConfig {\n if (!this.config?.libraries || typeof this.config.libraries !== 'object') {\n return { js: [], css: [] };\n }\n\n const libs = this.config.libraries;\n\n // Normalize JS libraries: support both string URLs and object format\n const normalizedJs = Array.isArray(libs.js)\n ? libs.js.map((lib) =>\n typeof lib === 'string' ? { url: lib } : lib\n ) as JSLibraryConfig[]\n : [];\n\n // Normalize CSS libraries: support both string URLs and object format\n const normalizedCss = Array.isArray(libs.css)\n ? libs.css.map((lib) =>\n typeof lib === 'string' ? { url: lib } : lib\n ) as CSSLibraryConfig[]\n : [];\n\n return {\n js: normalizedJs,\n css: normalizedCss,\n };\n }\n\n /**\n * Get CSP configuration\n * Returns empty object if not configured\n */\n getCSP(): CSPConfig {\n if (!this.config?.csp || typeof this.config.csp !== 'object') {\n return {};\n }\n\n return this.config.csp;\n }\n\n /**\n * Get base component name for new pages\n * Returns undefined if not configured\n */\n getBaseComponent(): string | undefined {\n if (!this.config?.baseComponent || typeof this.config.baseComponent !== 'string') {\n return undefined;\n }\n return this.config.baseComponent;\n }\n\n /**\n * Get image format setting\n * Returns 'webp' (default) or 'avif'\n */\n getCustomCode(): CustomCodeConfig {\n if (!this.config?.customCode || typeof this.config.customCode !== 'object') {\n return {};\n }\n return this.config.customCode;\n }\n\n getShowMenoBadge(): boolean {\n return this.config?.showMenoBadge === true;\n }\n\n getImageFormat(): ImageFormat {\n if (this.config?.imageFormat === 'avif') return 'avif';\n return 'webp';\n }\n\n /**\n * Get raw config value by key (for extension)\n */\n getRaw<T>(key: string): T | undefined {\n if (!this.config) {\n return undefined;\n }\n return (this.config as Record<string, unknown>)[key] as T | undefined;\n }\n}\n\n/**\n * Singleton instance for global access\n * Use this for convenience, or create your own instance for testing\n */\nexport const configService = new ConfigService();\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAsDO,IAAM,gBAAN,MAAoB;AAAA,EACjB,SAAkC;AAAA,EAClC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,MAAM,OAAsB;AAC1B,QAAI,KAAK,QAAQ;AACf;AAAA,IACF;AAEA,QAAI;AACF,UAAI,MAAM,WAAW,aAAa,OAAO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C;AAAA,IACV;AAEA,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,mBAAuC;AACrC,QAAI,CAAC,KAAK,QAAQ,iBAAiB,OAAO,KAAK,OAAO,kBAAkB,UAAU;AAChF,aAAO;AAAA,IACT;AACA,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAkC;AAChC,QAAI,CAAC,KAAK,QAAQ,cAAc,OAAO,KAAK,OAAO,eAAe,UAAU;AAC1E,aAAO,CAAC;AAAA,IACV;AACA,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,mBAA4B;AAC1B,WAAO,KAAK,QAAQ,kBAAkB;AAAA,EACxC;AAAA,EAEA,iBAA8B;AAC5B,QAAI,KAAK,QAAQ,gBAAgB,OAAQ,QAAO;AAChD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,OAAU,KAA4B;AACpC,QAAI,CAAC,KAAK,QAAQ;AAChB,aAAO;AAAA,IACT;AACA,WAAQ,KAAK,OAAmC,GAAG;AAAA,EACrD;AACF;AAMO,IAAM,gBAAgB,IAAI,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
parseJSON,
|
|
16
16
|
resolveSlugToPageId,
|
|
17
17
|
variableService
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CVLFID6V.js";
|
|
19
19
|
import {
|
|
20
20
|
configService
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PQ2HRXDR.js";
|
|
22
22
|
import {
|
|
23
23
|
bundleFile,
|
|
24
24
|
createRuntimeServer,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from "./chunk-J23ZX5AP.js";
|
|
45
45
|
import {
|
|
46
46
|
addItemUrls
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7NIC4I3V.js";
|
|
48
48
|
import {
|
|
49
49
|
parseLocaleFromPath
|
|
50
50
|
} from "./chunk-AZQYF6KE.js";
|
|
@@ -217,6 +217,27 @@ var WebSocketManager = class {
|
|
|
217
217
|
collection
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Broadcast CMS collections-list update notification.
|
|
222
|
+
* Emitted when a template file is added, removed, or its schema changes —
|
|
223
|
+
* tells connected clients to re-fetch the collections list.
|
|
224
|
+
*/
|
|
225
|
+
broadcastCollectionsUpdate() {
|
|
226
|
+
this.broadcast({
|
|
227
|
+
type: "hmr:cms-collections-update"
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Broadcast project.config.json update notification.
|
|
232
|
+
* Emitted when project.config.json changes (e.g. an AI tool adds a new
|
|
233
|
+
* locale) — tells connected clients to re-fetch config-derived state
|
|
234
|
+
* such as the i18n locale list.
|
|
235
|
+
*/
|
|
236
|
+
broadcastConfigUpdate() {
|
|
237
|
+
this.broadcast({
|
|
238
|
+
type: "hmr:config-update"
|
|
239
|
+
});
|
|
240
|
+
}
|
|
220
241
|
/**
|
|
221
242
|
* Get number of connected clients
|
|
222
243
|
*/
|
|
@@ -1313,6 +1334,27 @@ import { existsSync as existsSync4 } from "fs";
|
|
|
1313
1334
|
|
|
1314
1335
|
// lib/server/fileWatcher.ts
|
|
1315
1336
|
import { watch, existsSync as existsSync3 } from "fs";
|
|
1337
|
+
import { basename, dirname } from "path";
|
|
1338
|
+
function attachWhenDirExists(dirPath, attach, setWatcher) {
|
|
1339
|
+
if (existsSync3(dirPath)) {
|
|
1340
|
+
setWatcher(attach());
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
const parentDir = dirname(dirPath);
|
|
1344
|
+
const targetName = basename(dirPath);
|
|
1345
|
+
if (!existsSync3(parentDir)) {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
let parentWatcher = null;
|
|
1349
|
+
parentWatcher = watch(parentDir, (_event, filename) => {
|
|
1350
|
+
if (filename !== targetName) return;
|
|
1351
|
+
if (!existsSync3(dirPath)) return;
|
|
1352
|
+
parentWatcher?.close();
|
|
1353
|
+
parentWatcher = null;
|
|
1354
|
+
setWatcher(attach());
|
|
1355
|
+
});
|
|
1356
|
+
setWatcher(parentWatcher);
|
|
1357
|
+
}
|
|
1316
1358
|
var FileWatcher = class {
|
|
1317
1359
|
constructor(callbacks) {
|
|
1318
1360
|
this.callbacks = callbacks;
|
|
@@ -1326,6 +1368,7 @@ var FileWatcher = class {
|
|
|
1326
1368
|
cmsWatcher = null;
|
|
1327
1369
|
imagesWatcher = null;
|
|
1328
1370
|
librariesWatcher = null;
|
|
1371
|
+
projectConfigWatcher = null;
|
|
1329
1372
|
/**
|
|
1330
1373
|
* Start watching components directory
|
|
1331
1374
|
* Watches both .json and .js files to detect component definition and JavaScript changes
|
|
@@ -1369,23 +1412,29 @@ var FileWatcher = class {
|
|
|
1369
1412
|
);
|
|
1370
1413
|
}
|
|
1371
1414
|
/**
|
|
1372
|
-
* Start watching root templates directory for CMS template changes
|
|
1415
|
+
* Start watching root templates directory for CMS template changes.
|
|
1416
|
+
* Falls back to a deferred-attach watcher on the project root when
|
|
1417
|
+
* `templates/` doesn't exist yet (blank projects, projects that have never
|
|
1418
|
+
* had a CMS collection).
|
|
1373
1419
|
*/
|
|
1374
1420
|
watchTemplates(dirPath = projectPaths.templates()) {
|
|
1375
|
-
|
|
1376
|
-
return;
|
|
1377
|
-
}
|
|
1378
|
-
this.templatesWatcher = watch(
|
|
1421
|
+
attachWhenDirExists(
|
|
1379
1422
|
dirPath,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1423
|
+
() => watch(
|
|
1424
|
+
dirPath,
|
|
1425
|
+
{ recursive: true },
|
|
1426
|
+
async (event, filename) => {
|
|
1427
|
+
if (filename && filename.endsWith(".json")) {
|
|
1428
|
+
const pageName = `templates/${filename.replace(".json", "")}`;
|
|
1429
|
+
const pagePath = mapPageNameToPath(pageName);
|
|
1430
|
+
if (this.callbacks.onPageChange) {
|
|
1431
|
+
await this.callbacks.onPageChange(pagePath);
|
|
1432
|
+
}
|
|
1387
1433
|
}
|
|
1388
1434
|
}
|
|
1435
|
+
),
|
|
1436
|
+
(w) => {
|
|
1437
|
+
this.templatesWatcher = w;
|
|
1389
1438
|
}
|
|
1390
1439
|
);
|
|
1391
1440
|
}
|
|
@@ -1438,23 +1487,27 @@ var FileWatcher = class {
|
|
|
1438
1487
|
);
|
|
1439
1488
|
}
|
|
1440
1489
|
/**
|
|
1441
|
-
* Start watching CMS directory
|
|
1442
|
-
* Watches for changes in CMS content files (cms/{collection}/*.json)
|
|
1490
|
+
* Start watching CMS directory.
|
|
1491
|
+
* Watches for changes in CMS content files (cms/{collection}/*.json).
|
|
1492
|
+
* Falls back to a deferred-attach watcher when `cms/` doesn't exist yet.
|
|
1443
1493
|
*/
|
|
1444
1494
|
watchCMS(dirPath = projectPaths.cms()) {
|
|
1445
|
-
|
|
1446
|
-
return;
|
|
1447
|
-
}
|
|
1448
|
-
this.cmsWatcher = watch(
|
|
1495
|
+
attachWhenDirExists(
|
|
1449
1496
|
dirPath,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
if (
|
|
1455
|
-
|
|
1497
|
+
() => watch(
|
|
1498
|
+
dirPath,
|
|
1499
|
+
{ recursive: true },
|
|
1500
|
+
async (event, filename) => {
|
|
1501
|
+
if (filename && filename.endsWith(".json")) {
|
|
1502
|
+
const collection = filename.split("/")[0];
|
|
1503
|
+
if (this.callbacks.onCMSChange) {
|
|
1504
|
+
await this.callbacks.onCMSChange(collection);
|
|
1505
|
+
}
|
|
1456
1506
|
}
|
|
1457
1507
|
}
|
|
1508
|
+
),
|
|
1509
|
+
(w) => {
|
|
1510
|
+
this.cmsWatcher = w;
|
|
1458
1511
|
}
|
|
1459
1512
|
);
|
|
1460
1513
|
}
|
|
@@ -1475,6 +1528,24 @@ var FileWatcher = class {
|
|
|
1475
1528
|
}
|
|
1476
1529
|
);
|
|
1477
1530
|
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Start watching project.config.json for changes.
|
|
1533
|
+
* Picks up edits to i18n locales, breakpoints, libraries, icons, etc. so the
|
|
1534
|
+
* studio reflects external writes (e.g. an AI tool adding a new locale) without
|
|
1535
|
+
* a dev-server restart.
|
|
1536
|
+
*/
|
|
1537
|
+
watchProjectConfig() {
|
|
1538
|
+
const dirPath = getProjectRoot();
|
|
1539
|
+
this.projectConfigWatcher = watch(
|
|
1540
|
+
dirPath,
|
|
1541
|
+
{ recursive: false },
|
|
1542
|
+
async (_event, filename) => {
|
|
1543
|
+
if (filename === "project.config.json" && this.callbacks.onProjectConfigChange) {
|
|
1544
|
+
await this.callbacks.onProjectConfigChange();
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
);
|
|
1548
|
+
}
|
|
1478
1549
|
/**
|
|
1479
1550
|
* Start watching libraries directory for CSS/JS changes
|
|
1480
1551
|
*/
|
|
@@ -1507,6 +1578,7 @@ var FileWatcher = class {
|
|
|
1507
1578
|
this.watchCMS();
|
|
1508
1579
|
this.watchImages();
|
|
1509
1580
|
this.watchLibraries();
|
|
1581
|
+
this.watchProjectConfig();
|
|
1510
1582
|
}
|
|
1511
1583
|
/**
|
|
1512
1584
|
* Stop watching all directories
|
|
@@ -1548,6 +1620,10 @@ var FileWatcher = class {
|
|
|
1548
1620
|
this.librariesWatcher.close();
|
|
1549
1621
|
this.librariesWatcher = null;
|
|
1550
1622
|
}
|
|
1623
|
+
if (this.projectConfigWatcher) {
|
|
1624
|
+
this.projectConfigWatcher.close();
|
|
1625
|
+
this.projectConfigWatcher = null;
|
|
1626
|
+
}
|
|
1551
1627
|
}
|
|
1552
1628
|
/**
|
|
1553
1629
|
* Check if watchers are active
|
|
@@ -1598,9 +1674,11 @@ var FileWatcherService = class {
|
|
|
1598
1674
|
clearTimeout(this.refreshSchemasTimer);
|
|
1599
1675
|
}
|
|
1600
1676
|
const cmsService = this.cmsService;
|
|
1677
|
+
const wsManager = this.wsManager;
|
|
1601
1678
|
this.refreshSchemasTimer = setTimeout(async () => {
|
|
1602
1679
|
this.refreshSchemasTimer = null;
|
|
1603
1680
|
await cmsService.refreshSchemas();
|
|
1681
|
+
wsManager.broadcastCollectionsUpdate();
|
|
1604
1682
|
}, 50);
|
|
1605
1683
|
}
|
|
1606
1684
|
},
|
|
@@ -1617,11 +1695,17 @@ var FileWatcherService = class {
|
|
|
1617
1695
|
this.wsManager.broadcastEnumsUpdate();
|
|
1618
1696
|
},
|
|
1619
1697
|
onCMSChange: async (collection) => {
|
|
1698
|
+
this.cmsService?.clearItemsCache(collection);
|
|
1620
1699
|
this.wsManager.broadcastCMSUpdate(collection);
|
|
1621
1700
|
},
|
|
1622
1701
|
onImageAdded: this.onImageAdded,
|
|
1623
1702
|
onLibraryChange: async () => {
|
|
1624
1703
|
this.wsManager.broadcastLibrariesUpdate();
|
|
1704
|
+
},
|
|
1705
|
+
onProjectConfigChange: async () => {
|
|
1706
|
+
configService.reset();
|
|
1707
|
+
await configService.load();
|
|
1708
|
+
this.wsManager.broadcastConfigUpdate();
|
|
1625
1709
|
}
|
|
1626
1710
|
});
|
|
1627
1711
|
this.fileWatcher.watchAll();
|
|
@@ -3108,7 +3192,7 @@ async function createServer(config) {
|
|
|
3108
3192
|
|
|
3109
3193
|
// lib/server/providers/fileSystemPageProvider.ts
|
|
3110
3194
|
import { existsSync as existsSync5, readdirSync as readdirSync3, mkdirSync as mkdirSync3, rmdirSync as rmdirSync3 } from "fs";
|
|
3111
|
-
import { join as join4, dirname } from "path";
|
|
3195
|
+
import { join as join4, dirname as dirname2 } from "path";
|
|
3112
3196
|
|
|
3113
3197
|
// lib/shared/utils/fileUtils.ts
|
|
3114
3198
|
var isJSONFile = (name) => name.endsWith(".json");
|
|
@@ -3203,7 +3287,7 @@ var FileSystemPageProvider = class {
|
|
|
3203
3287
|
async save(path2, content) {
|
|
3204
3288
|
const { writeFile: writeFile2 } = await import("fs/promises");
|
|
3205
3289
|
const filePath = this.resolveFilePath(path2);
|
|
3206
|
-
const dir =
|
|
3290
|
+
const dir = dirname2(filePath);
|
|
3207
3291
|
if (!existsSync5(dir)) {
|
|
3208
3292
|
mkdirSync3(dir, { recursive: true });
|
|
3209
3293
|
}
|
|
@@ -3215,7 +3299,7 @@ var FileSystemPageProvider = class {
|
|
|
3215
3299
|
const rootDir = this.resolveRootDir(path2);
|
|
3216
3300
|
if (existsSync5(filePath)) {
|
|
3217
3301
|
await unlink(filePath);
|
|
3218
|
-
let dir =
|
|
3302
|
+
let dir = dirname2(filePath);
|
|
3219
3303
|
while (dir !== rootDir) {
|
|
3220
3304
|
try {
|
|
3221
3305
|
const remaining = readdirSync3(dir);
|
|
@@ -3227,7 +3311,7 @@ var FileSystemPageProvider = class {
|
|
|
3227
3311
|
} catch {
|
|
3228
3312
|
break;
|
|
3229
3313
|
}
|
|
3230
|
-
dir =
|
|
3314
|
+
dir = dirname2(dir);
|
|
3231
3315
|
}
|
|
3232
3316
|
}
|
|
3233
3317
|
}
|
|
@@ -3266,4 +3350,4 @@ export {
|
|
|
3266
3350
|
createServer,
|
|
3267
3351
|
FileSystemPageProvider
|
|
3268
3352
|
};
|
|
3269
|
-
//# sourceMappingURL=chunk-
|
|
3353
|
+
//# sourceMappingURL=chunk-YWJJD5D6.js.map
|