@brickflow/ui 0.0.39 → 0.0.40
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/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -536,10 +536,13 @@ const toComponentStyleKey = (path) => {
|
|
|
536
536
|
const componentName = basename(dirname(path));
|
|
537
537
|
return `${componentName[0]?.toLowerCase()}${componentName.slice(1)}`;
|
|
538
538
|
};
|
|
539
|
-
const collectComponentStyleValues = (source, componentPath,
|
|
539
|
+
const collectComponentStyleValues = (source, componentPath, config) => [
|
|
540
|
+
...collectUiStylePathsFromCode(source),
|
|
541
|
+
...collectUiConfigStyleReferencePaths(config.uiConfig).filter(([component]) => component === toComponentStyleKey(componentPath)).map((path) => path.slice(1))
|
|
542
|
+
].map((path) => path.join(".")).filter(Boolean).filter((path, index, paths) => paths.indexOf(path) === index).sort().map((path) => {
|
|
540
543
|
const segments = path.split(".");
|
|
541
|
-
const componentValue = readObjectPath(
|
|
542
|
-
const globalValue = readObjectPath(
|
|
544
|
+
const componentValue = readObjectPath(config.uiStyles, [toComponentStyleKey(componentPath), ...segments]);
|
|
545
|
+
const globalValue = readObjectPath(config.uiStyles, segments);
|
|
543
546
|
let value;
|
|
544
547
|
if (typeof componentValue === "string") {
|
|
545
548
|
value = componentValue;
|
|
@@ -778,7 +781,7 @@ const module$1 = defineNuxtModule({
|
|
|
778
781
|
filename: "brickflow/ui-catalog.ts",
|
|
779
782
|
getContents: async () => {
|
|
780
783
|
const files = await scanUiStyleFiles(componentsDirectory);
|
|
781
|
-
const
|
|
784
|
+
const config = await loadUiConfig();
|
|
782
785
|
const components = await Promise.all(
|
|
783
786
|
files.filter((path) => UI_COMPONENT_FILE_PATTERN.test(path)).sort().map(async (path) => {
|
|
784
787
|
const source = await readFile(path, "utf8");
|
|
@@ -802,7 +805,7 @@ const module$1 = defineNuxtModule({
|
|
|
802
805
|
path,
|
|
803
806
|
props: collectComponentProps(source),
|
|
804
807
|
slots: collectComponentSlots(source),
|
|
805
|
-
styles: collectComponentStyleValues(source, path,
|
|
808
|
+
styles: collectComponentStyleValues(source, path, config)
|
|
806
809
|
};
|
|
807
810
|
})
|
|
808
811
|
);
|
|
@@ -880,13 +883,15 @@ const module$1 = defineNuxtModule({
|
|
|
880
883
|
});
|
|
881
884
|
nuxt.hook("builder:watch", async (_event, path) => {
|
|
882
885
|
const absolutePath = resolve(nuxt.options.srcDir, path);
|
|
883
|
-
|
|
886
|
+
const isConfigFile = absolutePath === resolvedConfigPath;
|
|
887
|
+
const isRuntimeFile = !relative(runtimePath, absolutePath).startsWith("..") && UI_STYLE_FILE_PATTERN.test(path);
|
|
888
|
+
if (!isConfigFile && !isRuntimeFile) {
|
|
884
889
|
return;
|
|
885
890
|
}
|
|
886
891
|
await updateTemplates({
|
|
887
892
|
filter: (template) => template.filename === uiStyleTypeTemplate.filename || template.filename === uiConfigLiteralTypeTemplate.filename || template.filename === uiConfigSchemaTypeTemplate.filename
|
|
888
893
|
});
|
|
889
|
-
if (!relative(componentsDirectory, absolutePath).startsWith("..") && (UI_COMPONENT_FILE_PATTERN.test(path) || UI_DEMO_FILE_PATTERN.test(path))) {
|
|
894
|
+
if (isConfigFile || !relative(componentsDirectory, absolutePath).startsWith("..") && (UI_COMPONENT_FILE_PATTERN.test(path) || UI_DEMO_FILE_PATTERN.test(path))) {
|
|
890
895
|
await updateTemplates({ filter: (template) => template.filename === uiCatalogTemplate.filename });
|
|
891
896
|
}
|
|
892
897
|
});
|
|
@@ -13,5 +13,5 @@ export function provideBrickflowConfig(app, config) {
|
|
|
13
13
|
app.provide(brickflowConfigKey, config);
|
|
14
14
|
}
|
|
15
15
|
export function useTranslate() {
|
|
16
|
-
return inject(brickflowConfigKey)?.i18n ?? useTranslateFallback();
|
|
16
|
+
return inject(brickflowConfigKey, void 0)?.i18n ?? useTranslateFallback();
|
|
17
17
|
}
|
|
@@ -425,7 +425,7 @@ watch(
|
|
|
425
425
|
:key="component.id"
|
|
426
426
|
:aria-current="activeComponent?.id === component.id ? 'page' : void 0"
|
|
427
427
|
:class="[
|
|
428
|
-
'block rounded-lg px-3 py-2.5 text-sm transition',
|
|
428
|
+
'block rounded-lg px-3 py-2.5 text-sm font-semibold tracking-wide transition',
|
|
429
429
|
activeComponent?.id === component.id ? 'bg-blue-900 text-blue-100' : 'text-zinc-400 hover:bg-zinc-900 hover:text-zinc-100'
|
|
430
430
|
]"
|
|
431
431
|
:to="{
|
|
@@ -456,7 +456,7 @@ watch(
|
|
|
456
456
|
:key="component.id"
|
|
457
457
|
:aria-current="activeComponent?.id === component.id ? 'page' : void 0"
|
|
458
458
|
:class="[
|
|
459
|
-
'block rounded-lg px-3 py-2 text-sm transition',
|
|
459
|
+
'block rounded-lg px-3 py-2 text-sm font-semibold tracking-wide transition',
|
|
460
460
|
activeComponent?.id === component.id ? 'bg-blue-900 text-blue-100' : 'text-zinc-400 hover:bg-zinc-900 hover:text-zinc-100'
|
|
461
461
|
]"
|
|
462
462
|
:to="{
|
|
@@ -726,5 +726,5 @@ watch(
|
|
|
726
726
|
</style>
|
|
727
727
|
|
|
728
728
|
<style module>
|
|
729
|
-
:global(.ui-code-comment){color:var(--color-zinc-500)}:global(.ui-code-string){color:var(--color-emerald-400)}:global(.ui-code-keyword){color:var(--color-blue-400)}:global(.ui-code-number){color:var(--color-amber-300)}:global(.ui-code-tag){color:var(--color-cyan-500)}:global(.ui-code-attribute){color:var(--color-violet-300)}:global(.ui-code-punctuation){color:var(--color-zinc-400)}:global(.ui-color-swatch){background:var(--ui-color-swatch);border:1px solid hsla(0,0%,100%,.1);border-radius:.2rem;display:inline-block;height:.65rem;margin-right:.25rem;opacity:.85;vertical-align:-.1rem;width:.65rem}.mobileNavigation{width:min(18rem,calc(100vw - 3rem))}@media (width >= 40rem){.styleGrid{grid-template-columns:minmax(12rem,.8fr) minmax(0,1.8fr)}}.styleValue :global(.ui-code-keyword){color:var(--color-zinc-500)}.styleValue :global(.ui-code-attribute){color:var(--color-zinc-200)}.styleValue :global(.ui-code-string){color:var(--color-zinc-300)}.styleValue :global(.ui-code-number){color:var(--color-zinc-400)}.styleValue :global(.ui-code-punctuation){color:var(--color-zinc-500)}
|
|
729
|
+
:global(.ui-code-comment){color:var(--color-zinc-500,#71717a)}:global(.ui-code-string){color:var(--color-emerald-400,#34d399)}:global(.ui-code-keyword){color:var(--color-blue-400,#60a5fa)}:global(.ui-code-number){color:var(--color-amber-300,#fcd34d)}:global(.ui-code-tag){color:var(--color-cyan-500,#22d3ee)}:global(.ui-code-attribute){color:var(--color-violet-300,#c4b5fd)}:global(.ui-code-punctuation){color:var(--color-zinc-400,#a1a1aa)}:global(.ui-color-swatch){background:var(--ui-color-swatch);border:1px solid hsla(0,0%,100%,.1);border-radius:.2rem;display:inline-block;height:.65rem;margin-right:.25rem;opacity:.85;vertical-align:-.1rem;width:.65rem}.mobileNavigation{width:min(18rem,calc(100vw - 3rem))}@media (width >= 40rem){.styleGrid{grid-template-columns:minmax(12rem,.8fr) minmax(0,1.8fr)}}.styleValue :global(.ui-code-keyword){color:var(--color-zinc-500,#71717a)}.styleValue :global(.ui-code-attribute){color:var(--color-zinc-200,#e4e4e7)}.styleValue :global(.ui-code-string){color:var(--color-zinc-300,#d4d4d8)}.styleValue :global(.ui-code-number){color:var(--color-zinc-400,#a1a1aa)}.styleValue :global(.ui-code-punctuation){color:var(--color-zinc-500,#71717a)}
|
|
730
730
|
</style>
|