origam 2.37.12 → 2.37.13
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/CHANGELOG.md +11 -0
- package/dist/src/interfaces/Commons/nuxt-module.interface.d.ts +12 -0
- package/dist/src/nuxt/module.cjs +4 -2
- package/dist/src/nuxt/module.js +4 -2
- package/dist/src/nuxt/plugin.client.cjs +3 -1
- package/dist/src/nuxt/plugin.client.js +2 -1
- package/dist/src/nuxt/plugin.server.cjs +3 -1
- package/dist/src/nuxt/plugin.server.js +2 -1
- package/dist/src/types/Icon/icon.type.d.ts +10 -0
- package/dist/src/utils/Commons/nuxt-icons.util.cjs +11 -0
- package/dist/src/utils/Commons/nuxt-icons.util.d.ts +11 -0
- package/dist/src/utils/Commons/nuxt-icons.util.js +3 -0
- package/dist/src/utils/index.cjs +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,17 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.37.13] - 2026-10-22
|
|
22
|
+
|
|
23
|
+
### Added — `origam/nuxt` : option `icons` (`defaultSet`, `aliases`) (#1228)
|
|
24
|
+
|
|
25
|
+
Le module Nuxt ne transmettait pas l'option `icons` de `createOrigam()`. Une application Nuxt devait écrire un plugin manuel pour changer le jeu d'icônes par défaut ou déclarer des alias.
|
|
26
|
+
|
|
27
|
+
- `IOrigamNuxtModuleOptions.icons` accepte `{ defaultSet?, aliases? }` (type `TNuxtIconOptions`, sous-ensemble sérialisable de `TIconOptions` qui réutilise `TIcon`). Le module la place dans `runtimeConfig.public.origam`, et les plugins client et serveur la passent à `createOrigam`.
|
|
28
|
+
- Non relayés : `sets` et les alias qui sont des composants. Ils contiennent des fonctions de rendu, que la config Nuxt ne peut pas sérialiser. Ils demandent toujours un plugin manuel.
|
|
29
|
+
- Doc : ligne `icons` dans `integrations/nuxt.md`.
|
|
30
|
+
- Vérifié : le TU `TU/nuxt/nuxt-icons.spec.ts` passe à 5/5. Avec l'alias `$info`, `OrigamIcon` rend la bonne classe ; sans l'option, rien ne change. Le test de câblage échoue quand on le retire du plugin (PR #1241).
|
|
31
|
+
|
|
21
32
|
## [2.37.12] - 2026-10-22
|
|
22
33
|
|
|
23
34
|
### Fixed — `OrigamListItem` : l'opacité de l'overlay actif est lue par jeton (#1230)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ILocaleOptions } from './locale.interface';
|
|
2
2
|
import type { IOrigamTheme } from './theme.interface';
|
|
3
|
+
import type { TNuxtIconOptions } from '../../types/Icon/icon.type';
|
|
3
4
|
import type { TMode, TTheme } from '../../types/Commons/theme.type';
|
|
4
5
|
/**
|
|
5
6
|
* Options passed by a consumer in `nuxt.config.ts` under the `origam` key.
|
|
@@ -41,6 +42,16 @@ export interface IOrigamNuxtModuleOptions {
|
|
|
41
42
|
* origam: { locale: { locale: 'ja', fallbackLocale: 'en', messages: { ja } } }
|
|
42
43
|
********************************************************/
|
|
43
44
|
locale?: ILocaleOptions;
|
|
45
|
+
/*********************************************************
|
|
46
|
+
* icons
|
|
47
|
+
*
|
|
48
|
+
* @description
|
|
49
|
+
* `defaultSet` and `aliases` of `createOrigam({ icons })`, forwarded by BOTH plugins. Serialisable subset only (it travels through `runtimeConfig`): aliases are strings or path arrays, never components. `sets` (render functions) is NOT relayed — keep a manual plugin for custom icon sets.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* origam: { icons: { aliases: { info: 'mdi-information-outline' } } }
|
|
53
|
+
********************************************************/
|
|
54
|
+
icons?: TNuxtIconOptions;
|
|
44
55
|
/**
|
|
45
56
|
* Theme (brand) applied when no cookie is set. Use `'auto'` to render no
|
|
46
57
|
* `data-theme` attribute (the default brand).
|
|
@@ -127,6 +138,7 @@ export interface IOrigamNuxtRuntimeConfig {
|
|
|
127
138
|
modeCookieName: string;
|
|
128
139
|
cookieMaxAge: number;
|
|
129
140
|
locale?: ILocaleOptions;
|
|
141
|
+
icons?: TNuxtIconOptions;
|
|
130
142
|
}
|
|
131
143
|
/*********************************************************
|
|
132
144
|
* IOrigamNuxtProvide
|
package/dist/src/nuxt/module.cjs
CHANGED
|
@@ -24,7 +24,8 @@ const DEFAULTS = {
|
|
|
24
24
|
autoImport: true,
|
|
25
25
|
includeUtilities: true,
|
|
26
26
|
prefix: "Origam",
|
|
27
|
-
locale: {}
|
|
27
|
+
locale: {},
|
|
28
|
+
icons: {}
|
|
28
29
|
};
|
|
29
30
|
const SCALAR_DEFAULTS = {
|
|
30
31
|
defaultTheme: DEFAULTS.defaultTheme,
|
|
@@ -141,7 +142,8 @@ const origamNuxtModule = (0, _kit.defineNuxtModule)({
|
|
|
141
142
|
cookieName,
|
|
142
143
|
modeCookieName,
|
|
143
144
|
cookieMaxAge,
|
|
144
|
-
locale: options.locale
|
|
145
|
+
locale: options.locale,
|
|
146
|
+
icons: options.icons
|
|
145
147
|
};
|
|
146
148
|
}
|
|
147
149
|
});
|
package/dist/src/nuxt/module.js
CHANGED
|
@@ -23,7 +23,8 @@ const DEFAULTS = {
|
|
|
23
23
|
autoImport: true,
|
|
24
24
|
includeUtilities: true,
|
|
25
25
|
prefix: "Origam",
|
|
26
|
-
locale: {}
|
|
26
|
+
locale: {},
|
|
27
|
+
icons: {}
|
|
27
28
|
};
|
|
28
29
|
const SCALAR_DEFAULTS = {
|
|
29
30
|
defaultTheme: DEFAULTS.defaultTheme,
|
|
@@ -137,7 +138,8 @@ const origamNuxtModule = defineNuxtModule({
|
|
|
137
138
|
cookieName,
|
|
138
139
|
modeCookieName,
|
|
139
140
|
cookieMaxAge,
|
|
140
|
-
locale: options.locale
|
|
141
|
+
locale: options.locale,
|
|
142
|
+
icons: options.icons
|
|
141
143
|
};
|
|
142
144
|
}
|
|
143
145
|
});
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _theme = require("../composables/Commons/theme.composable.cjs");
|
|
9
9
|
var _origam = require("../origam.cjs");
|
|
10
|
+
var _nuxtIcons = require("../utils/Commons/nuxt-icons.util.cjs");
|
|
10
11
|
var _nuxtLocale = require("../utils/Commons/nuxt-locale.util.cjs");
|
|
11
12
|
var _applyTheme = require("../utils/Commons/apply-theme.util.cjs");
|
|
12
13
|
var _app = require("#app");
|
|
@@ -33,7 +34,8 @@ module.exports = (0, _app.defineNuxtPlugin)({
|
|
|
33
34
|
const origam = (0, _origam.createOrigam)({
|
|
34
35
|
themes,
|
|
35
36
|
ssr: true,
|
|
36
|
-
...(0, _nuxtLocale.nuxtLocaleOptions)(config)
|
|
37
|
+
...(0, _nuxtLocale.nuxtLocaleOptions)(config),
|
|
38
|
+
...(0, _nuxtIcons.nuxtIconsOptions)(config)
|
|
37
39
|
});
|
|
38
40
|
nuxtApp.vueApp.use(origam);
|
|
39
41
|
const themeApi = (0, _theme.useTheme)();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref, watch } from "vue";
|
|
2
2
|
import { useTheme } from "../composables/Commons/theme.composable.js";
|
|
3
3
|
import { createOrigam } from "../origam.js";
|
|
4
|
+
import { nuxtIconsOptions } from "../utils/Commons/nuxt-icons.util.js";
|
|
4
5
|
import { nuxtLocaleOptions } from "../utils/Commons/nuxt-locale.util.js";
|
|
5
6
|
import { isModePinned } from "../utils/Commons/apply-theme.util.js";
|
|
6
7
|
import { defineNuxtPlugin, useCookie, useRuntimeConfig } from "#app";
|
|
@@ -24,7 +25,7 @@ export default defineNuxtPlugin({
|
|
|
24
25
|
const initialTheme = themeFromDom ?? themeCookie.value ?? config.defaultTheme;
|
|
25
26
|
const initialMode = modeCookie.value ?? config.defaultMode;
|
|
26
27
|
const themes = config.themes ?? [];
|
|
27
|
-
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config) });
|
|
28
|
+
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config), ...nuxtIconsOptions(config) });
|
|
28
29
|
nuxtApp.vueApp.use(origam);
|
|
29
30
|
const themeApi = useTheme();
|
|
30
31
|
themeApi.setTheme(initialTheme);
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
var _origam = require("../origam.cjs");
|
|
8
|
+
var _nuxtIcons = require("../utils/Commons/nuxt-icons.util.cjs");
|
|
8
9
|
var _nuxtLocale = require("../utils/Commons/nuxt-locale.util.cjs");
|
|
9
10
|
var _applyTheme = require("../utils/Commons/apply-theme.util.cjs");
|
|
10
11
|
var _ssrStyles = require("../utils/Commons/ssr-styles.util.cjs");
|
|
@@ -69,7 +70,8 @@ module.exports = (0, _app.defineNuxtPlugin)({
|
|
|
69
70
|
const origam = (0, _origam.createOrigam)({
|
|
70
71
|
themes,
|
|
71
72
|
ssr: true,
|
|
72
|
-
...(0, _nuxtLocale.nuxtLocaleOptions)(config)
|
|
73
|
+
...(0, _nuxtLocale.nuxtLocaleOptions)(config),
|
|
74
|
+
...(0, _nuxtIcons.nuxtIconsOptions)(config)
|
|
73
75
|
});
|
|
74
76
|
origam._defaultsRef.value = origam._activeDefaultsFor(resolvedTheme === _theme.ORIGAM_THEME_AUTO ? "" : resolvedTheme, resolvedMode);
|
|
75
77
|
nuxtApp.vueApp.use(origam);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createOrigam } from "../origam.js";
|
|
2
|
+
import { nuxtIconsOptions } from "../utils/Commons/nuxt-icons.util.js";
|
|
2
3
|
import { nuxtLocaleOptions } from "../utils/Commons/nuxt-locale.util.js";
|
|
3
4
|
import { isModePinned, themeToCss, themeToUnpinnedCss } from "../utils/Commons/apply-theme.util.js";
|
|
4
5
|
import { getSsrStyles } from "../utils/Commons/ssr-styles.util.js";
|
|
@@ -60,7 +61,7 @@ export default defineNuxtPlugin({
|
|
|
60
61
|
htmlAttrs,
|
|
61
62
|
style: ssrThemeCss ? [{ id: "origam-theme-ssr", key: "origam-theme-ssr", innerHTML: ssrThemeCss }] : []
|
|
62
63
|
});
|
|
63
|
-
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config) });
|
|
64
|
+
const origam = createOrigam({ themes, ssr: true, ...nuxtLocaleOptions(config), ...nuxtIconsOptions(config) });
|
|
64
65
|
origam._defaultsRef.value = origam._activeDefaultsFor(
|
|
65
66
|
resolvedTheme === ORIGAM_THEME_AUTO ? "" : resolvedTheme,
|
|
66
67
|
resolvedMode
|
|
@@ -7,6 +7,16 @@ export type TIconOptions = {
|
|
|
7
7
|
aliases?: Partial<IIconAliases>;
|
|
8
8
|
sets?: Record<string, IIconSet>;
|
|
9
9
|
};
|
|
10
|
+
/*********************************************************
|
|
11
|
+
* TNuxtIconOptions
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* The part of `TIconOptions` that survives `runtimeConfig` (JSON): `sets` (render functions) and component aliases are left out.
|
|
15
|
+
********************************************************/
|
|
16
|
+
export type TNuxtIconOptions = {
|
|
17
|
+
defaultSet?: string;
|
|
18
|
+
aliases?: Record<string, Exclude<TIcon, Component>>;
|
|
19
|
+
};
|
|
10
20
|
export type TIconInstance = {
|
|
11
21
|
component: TIconComponent;
|
|
12
22
|
icon?: TIcon;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IOrigamOptions } from '../../interfaces/Commons/commons.interface';
|
|
2
|
+
import type { IOrigamNuxtRuntimeConfig } from '../../interfaces/Commons/nuxt-module.interface';
|
|
3
|
+
/*********************************************************
|
|
4
|
+
* nuxtIconsOptions
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* The `createOrigam()` options derived from the module's `icons` setting (#1228). Shared by both Nuxt plugins so SSR and hydration use the SAME aliases.
|
|
8
|
+
* @description
|
|
9
|
+
* Returns `{}` when no icons are configured, so `createIcons()` keeps its defaults.
|
|
10
|
+
********************************************************/
|
|
11
|
+
export declare function nuxtIconsOptions(config: Pick<IOrigamNuxtRuntimeConfig, 'icons'>): Pick<IOrigamOptions, 'icons'>;
|
package/dist/src/utils/index.cjs
CHANGED
|
@@ -190,6 +190,17 @@ Object.keys(_locale).forEach(function (key) {
|
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
|
+
var _nuxtIcons = require("./Commons/nuxt-icons.util.cjs");
|
|
194
|
+
Object.keys(_nuxtIcons).forEach(function (key) {
|
|
195
|
+
if (key === "default" || key === "__esModule") return;
|
|
196
|
+
if (key in exports && exports[key] === _nuxtIcons[key]) return;
|
|
197
|
+
Object.defineProperty(exports, key, {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
get: function () {
|
|
200
|
+
return _nuxtIcons[key];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
193
204
|
var _nuxtLocale = require("./Commons/nuxt-locale.util.cjs");
|
|
194
205
|
Object.keys(_nuxtLocale).forEach(function (key) {
|
|
195
206
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -15,6 +15,7 @@ export * from './Commons/getCurrentInstance.util';
|
|
|
15
15
|
export * from './Commons/ssr-styles.util';
|
|
16
16
|
export * from './Commons/layout.util';
|
|
17
17
|
export * from './Commons/locale.util';
|
|
18
|
+
export * from './Commons/nuxt-icons.util';
|
|
18
19
|
export * from './Commons/nuxt-locale.util';
|
|
19
20
|
export * from './Commons/nested.util';
|
|
20
21
|
export * from './Commons/ripple.util';
|
package/dist/src/utils/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./Commons/getCurrentInstance.util.js";
|
|
|
15
15
|
export * from "./Commons/ssr-styles.util.js";
|
|
16
16
|
export * from "./Commons/layout.util.js";
|
|
17
17
|
export * from "./Commons/locale.util.js";
|
|
18
|
+
export * from "./Commons/nuxt-icons.util.js";
|
|
18
19
|
export * from "./Commons/nuxt-locale.util.js";
|
|
19
20
|
export * from "./Commons/nested.util.js";
|
|
20
21
|
export * from "./Commons/ripple.util.js";
|