@brickflow/ui 0.0.51 → 0.0.53

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.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- export { BrickflowConfig, BrickflowI18n, BrickflowRouteLocationParam } from '../dist/runtime/composables/useTranslate.js';
2
+ export { BrickflowConfig } from '../dist/runtime/composables/useBrickflow.js';
3
+ export { BrickflowI18n, BrickflowRouteLocationParam } from '../dist/runtime/composables/useTranslate.js';
3
4
 
4
5
  interface ModuleOptions {
5
6
  componentPrefix?: string;
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "configKey": "brickflowUi",
6
6
  "name": "@brickflow/ui",
7
- "version": "0.0.51",
7
+ "version": "0.0.53",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, resolvePath, addTypeTemplate, addTemplate, updateTemplates, addImportsDir, addComponentsDir } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, resolvePath, addTypeTemplate, addTemplate, updateTemplates, addImports, addComponentsDir } from '@nuxt/kit';
2
2
  import tailwindcss from '@tailwindcss/vite';
3
3
  import { createJiti } from 'jiti';
4
4
  import { mkdir, access, readFile, writeFile, readdir } from 'node:fs/promises';
@@ -960,7 +960,22 @@ const module$1 = defineNuxtModule({
960
960
  }
961
961
  viteConfig.plugins.push(tailwindcss());
962
962
  });
963
- addImportsDir(resolver.resolve("./runtime/composables"));
963
+ addImports([
964
+ ...["provideBrickflow", "useBrickflow", "BrickflowConfig"].map((name) => ({
965
+ from: resolver.resolve("./runtime/composables/useBrickflow"),
966
+ name,
967
+ type: name === "useBrickflow"
968
+ })),
969
+ {
970
+ from: resolver.resolve("./runtime/composables/useScreen"),
971
+ name: "useScreen"
972
+ },
973
+ ...["useTheme", "Theme", "ThemeController"].map((name) => ({
974
+ from: resolver.resolve("./runtime/composables/useTheme"),
975
+ name,
976
+ type: name !== "useTheme"
977
+ }))
978
+ ]);
964
979
  addComponentsDir({
965
980
  ignore: ["**/*.demo.vue"],
966
981
  path: resolver.resolve("./runtime/components"),
@@ -0,0 +1,8 @@
1
+ import { type App } from 'vue';
2
+ import type { BrickflowI18n } from './useTranslate.js';
3
+ export interface BrickflowConfig {
4
+ i18n?: BrickflowI18n;
5
+ }
6
+ export declare function provideBrickflow<T extends BrickflowConfig>(app: App, config: T): void;
7
+ export declare function useBrickflow(): BrickflowConfig;
8
+ //# sourceMappingURL=useBrickflow.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { inject } from "vue";
2
+ const brickflowConfigKey = Symbol("brickflow-config");
3
+ export function provideBrickflow(app, config) {
4
+ app.provide(brickflowConfigKey, config);
5
+ }
6
+ export function useBrickflow() {
7
+ return inject(brickflowConfigKey, {});
8
+ }
@@ -1,8 +1,5 @@
1
1
  import type { RouteRecordNameGeneric } from 'vue-router';
2
- import { type App, type Ref } from 'vue';
3
- export interface BrickflowConfig {
4
- i18n?: BrickflowI18n;
5
- }
2
+ import { type Ref } from 'vue';
6
3
  export interface BrickflowI18n {
7
4
  getRealName: (route: {
8
5
  name: RouteRecordNameGeneric;
@@ -15,6 +12,5 @@ export interface BrickflowRouteLocationParam {
15
12
  path: string;
16
13
  query: Record<string, unknown>;
17
14
  }
18
- export declare function provideBrickflowConfig<T extends BrickflowConfig>(app: App, config: T): void;
19
15
  export declare function useTranslate(): BrickflowI18n;
20
16
  //# sourceMappingURL=useTranslate.d.ts.map
@@ -1,17 +1,12 @@
1
- import { inject, ref } from "vue";
2
- const brickflowConfigKey = Symbol("brickflow-config");
3
- const useTranslateFallback = () => {
4
- const getRealPath = (route) => typeof route === "string" ? route : route.path;
5
- return {
6
- getRealName: (route) => String(route.name),
7
- getRealPath,
8
- locale: ref("en"),
9
- localePath: getRealPath
10
- };
1
+ import { shallowRef } from "vue";
2
+ import { useBrickflow } from "./useBrickflow.js";
3
+ const getFallbackRealPath = (route) => typeof route === "string" ? route : route.path;
4
+ const translateFallback = {
5
+ getRealName: (route) => String(route.name),
6
+ getRealPath: getFallbackRealPath,
7
+ locale: shallowRef("en"),
8
+ localePath: getFallbackRealPath
11
9
  };
12
- export function provideBrickflowConfig(app, config) {
13
- app.provide(brickflowConfigKey, config);
14
- }
15
10
  export function useTranslate() {
16
- return inject(brickflowConfigKey, void 0)?.i18n ?? useTranslateFallback();
11
+ return useBrickflow().i18n ?? translateFallback;
17
12
  }
package/dist/types.d.mts CHANGED
@@ -1,4 +1,6 @@
1
- export { type BrickflowConfig, type BrickflowI18n, type BrickflowRouteLocationParam } from '../dist/runtime/composables/useTranslate.js'
1
+ export { type BrickflowConfig } from '../dist/runtime/composables/useBrickflow.js'
2
+
3
+ export { type BrickflowI18n, type BrickflowRouteLocationParam } from '../dist/runtime/composables/useTranslate.js'
2
4
 
3
5
  export { default } from './module.mjs'
4
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickflow/ui",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "type": "module",
5
5
  "description": "brickflow UI Nuxt module.",
6
6
  "files": [
@@ -17,7 +17,6 @@
17
17
  "import": "./dist/runtime/tailwind.js"
18
18
  },
19
19
  "./ui.css": {
20
- "development": "./src/runtime/ui.css",
21
20
  "default": "./dist/runtime/ui.css"
22
21
  }
23
22
  },