origam 2.39.0 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/src/assets/css/tokens/dark-pinned.css +3229 -0
- package/dist/src/assets/css/tokens/dark-system.css +3053 -0
- package/dist/src/components/Code/OrigamCode.vue +2 -1
- package/dist/src/composables/Icon/icon.composable.cjs +9 -2
- package/dist/src/composables/Icon/icon.composable.d.ts +10 -0
- package/dist/src/composables/Icon/icon.composable.js +6 -2
- package/dist/src/consts/Commons/mdi-core.const.cjs +61 -0
- package/dist/src/consts/Commons/mdi-core.const.d.ts +11 -0
- package/dist/src/consts/Commons/mdi-core.const.js +55 -0
- package/dist/src/consts/Commons/mdi.const.cjs +9 -54
- package/dist/src/consts/Commons/mdi.const.d.ts +2 -2
- package/dist/src/consts/Commons/mdi.const.js +3 -53
- package/dist/src/interfaces/Commons/nuxt-module.interface.d.ts +20 -0
- package/dist/src/interfaces/Commons/theme.interface.d.ts +13 -0
- package/dist/src/nuxt/create.core.cjs +12 -0
- package/dist/src/nuxt/create.core.d.ts +1 -0
- package/dist/src/nuxt/create.core.js +1 -0
- package/dist/src/nuxt/create.full.cjs +12 -0
- package/dist/src/nuxt/create.full.d.ts +7 -0
- package/dist/src/nuxt/create.full.js +1 -0
- package/dist/src/nuxt/module.cjs +84 -65
- package/dist/src/nuxt/module.js +78 -64
- package/dist/src/nuxt/plugin.client.cjs +2 -2
- package/dist/src/nuxt/plugin.client.js +1 -1
- package/dist/src/nuxt/plugin.server.cjs +6 -7
- package/dist/src/nuxt/plugin.server.js +6 -11
- package/dist/src/origam-core.cjs +153 -0
- package/dist/src/origam-core.d.ts +101 -0
- package/dist/src/origam-core.js +169 -0
- package/dist/src/origam.cjs +11 -133
- package/dist/src/origam.d.ts +14 -20
- package/dist/src/origam.js +7 -163
- package/dist/src/ssr.cjs +38 -0
- package/dist/src/ssr.d.ts +11 -0
- package/dist/src/ssr.js +3 -0
- package/dist/src/utils/Code/trim-blank-lines.util.cjs +13 -0
- package/dist/src/utils/Code/trim-blank-lines.util.d.ts +9 -0
- package/dist/src/utils/Code/trim-blank-lines.util.js +7 -0
- package/dist/src/utils/CodeGroup/code-group.util.cjs +2 -1
- package/dist/src/utils/CodeGroup/code-group.util.js +2 -1
- package/dist/src/utils/Commons/theme-ssr.util.cjs +20 -0
- package/dist/src/utils/Commons/theme-ssr.util.d.ts +17 -0
- package/dist/src/utils/Commons/theme-ssr.util.js +18 -0
- package/dist/src/utils/index.cjs +22 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.js +2 -0
- package/package.json +5 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderThemeCss = renderThemeCss;
|
|
7
|
+
var _applyTheme = require("./apply-theme.util.cjs");
|
|
8
|
+
function renderThemeCss(themes, options = {}) {
|
|
9
|
+
const brand = options.theme && options.theme !== "auto" ? options.theme : "";
|
|
10
|
+
const pinned = options.mode === "light" || options.mode === "dark" ? options.mode : null;
|
|
11
|
+
const active = themes.filter(theme => {
|
|
12
|
+
const brandMatches = brand ? theme.name === brand : !theme.name;
|
|
13
|
+
const modeMatches = !pinned || theme.mode === void 0 || theme.mode === "auto" || theme.mode === pinned;
|
|
14
|
+
return brandMatches && modeMatches;
|
|
15
|
+
});
|
|
16
|
+
if (pinned) {
|
|
17
|
+
return active.map(_applyTheme.themeToCss).join("\n");
|
|
18
|
+
}
|
|
19
|
+
return [...active.filter(t => t.mode !== "light" && t.mode !== "dark").map(_applyTheme.themeToCss), ...active.filter(t => t.mode === "light").map(_applyTheme.themeToUnpinnedCss), ...active.filter(t => t.mode === "dark").map(_applyTheme.themeToUnpinnedCss)].join("\n");
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IOrigamTheme, IRenderThemeCssOptions } from '../../interfaces';
|
|
2
|
+
/*********************************************************
|
|
3
|
+
* renderThemeCss (#1386)
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* Server-side theme CSS for ONE page: only the active brand, and only the
|
|
7
|
+
* active mode when it is pinned, never every installed theme. Same selection
|
|
8
|
+
* as the Nuxt server plugin (which now calls this function), so a plain Vue /
|
|
9
|
+
* Nitro host gets the identical no-flash first paint without importing
|
|
10
|
+
* `apply-theme.util` by its internal path.
|
|
11
|
+
* @description
|
|
12
|
+
* Mode pinned (`light` | `dark`): the blocks of that mode and the
|
|
13
|
+
* mode-agnostic ones. Not pinned: agnostic blocks, then light, then dark, the
|
|
14
|
+
* last two under `@media (prefers-color-scheme)` so dark wins (#1103).
|
|
15
|
+
* Put the result in a `<style>` in `<head>`.
|
|
16
|
+
********************************************************/
|
|
17
|
+
export declare function renderThemeCss(themes: readonly IOrigamTheme[], options?: IRenderThemeCssOptions): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { themeToCss, themeToUnpinnedCss } from "./apply-theme.util.js";
|
|
2
|
+
export function renderThemeCss(themes, options = {}) {
|
|
3
|
+
const brand = options.theme && options.theme !== "auto" ? options.theme : "";
|
|
4
|
+
const pinned = options.mode === "light" || options.mode === "dark" ? options.mode : null;
|
|
5
|
+
const active = themes.filter((theme) => {
|
|
6
|
+
const brandMatches = brand ? theme.name === brand : !theme.name;
|
|
7
|
+
const modeMatches = !pinned || theme.mode === void 0 || theme.mode === "auto" || theme.mode === pinned;
|
|
8
|
+
return brandMatches && modeMatches;
|
|
9
|
+
});
|
|
10
|
+
if (pinned) {
|
|
11
|
+
return active.map(themeToCss).join("\n");
|
|
12
|
+
}
|
|
13
|
+
return [
|
|
14
|
+
...active.filter((t) => t.mode !== "light" && t.mode !== "dark").map(themeToCss),
|
|
15
|
+
...active.filter((t) => t.mode === "light").map(themeToUnpinnedCss),
|
|
16
|
+
...active.filter((t) => t.mode === "dark").map(themeToUnpinnedCss)
|
|
17
|
+
].join("\n");
|
|
18
|
+
}
|
package/dist/src/utils/index.cjs
CHANGED
|
@@ -718,6 +718,17 @@ Object.keys(_parseHighlightLines).forEach(function (key) {
|
|
|
718
718
|
}
|
|
719
719
|
});
|
|
720
720
|
});
|
|
721
|
+
var _trimBlankLines = require("./Code/trim-blank-lines.util.cjs");
|
|
722
|
+
Object.keys(_trimBlankLines).forEach(function (key) {
|
|
723
|
+
if (key === "default" || key === "__esModule") return;
|
|
724
|
+
if (key in exports && exports[key] === _trimBlankLines[key]) return;
|
|
725
|
+
Object.defineProperty(exports, key, {
|
|
726
|
+
enumerable: true,
|
|
727
|
+
get: function () {
|
|
728
|
+
return _trimBlankLines[key];
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
});
|
|
721
732
|
var _codeGroup = require("./CodeGroup/code-group.util.cjs");
|
|
722
733
|
Object.keys(_codeGroup).forEach(function (key) {
|
|
723
734
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -849,4 +860,15 @@ Object.keys(_applyTheme).forEach(function (key) {
|
|
|
849
860
|
return _applyTheme[key];
|
|
850
861
|
}
|
|
851
862
|
});
|
|
863
|
+
});
|
|
864
|
+
var _themeSsr = require("./Commons/theme-ssr.util.cjs");
|
|
865
|
+
Object.keys(_themeSsr).forEach(function (key) {
|
|
866
|
+
if (key === "default" || key === "__esModule") return;
|
|
867
|
+
if (key in exports && exports[key] === _themeSsr[key]) return;
|
|
868
|
+
Object.defineProperty(exports, key, {
|
|
869
|
+
enumerable: true,
|
|
870
|
+
get: function () {
|
|
871
|
+
return _themeSsr[key];
|
|
872
|
+
}
|
|
873
|
+
});
|
|
852
874
|
});
|
|
@@ -63,6 +63,7 @@ export * from './DataTable/slot-name.util';
|
|
|
63
63
|
export * from './DataTable/skeleton-cell.util';
|
|
64
64
|
export * from './CommandPalette/fuzzy-match.util';
|
|
65
65
|
export * from './Code/parse-highlight-lines.util';
|
|
66
|
+
export * from './Code/trim-blank-lines.util';
|
|
66
67
|
export * from './CodeGroup/code-group.util';
|
|
67
68
|
export * from './TextareaField/sanitize-html.util';
|
|
68
69
|
export * from './TextareaField/html-to-markdown.util';
|
|
@@ -75,3 +76,4 @@ export * from './Chart/path.util';
|
|
|
75
76
|
export * from './Chart/mercator.util';
|
|
76
77
|
export * from './Commons/token-name.util';
|
|
77
78
|
export * from './Commons/apply-theme.util';
|
|
79
|
+
export * from './Commons/theme-ssr.util';
|
package/dist/src/utils/index.js
CHANGED
|
@@ -63,6 +63,7 @@ export * from "./DataTable/slot-name.util.js";
|
|
|
63
63
|
export * from "./DataTable/skeleton-cell.util.js";
|
|
64
64
|
export * from "./CommandPalette/fuzzy-match.util.js";
|
|
65
65
|
export * from "./Code/parse-highlight-lines.util.js";
|
|
66
|
+
export * from "./Code/trim-blank-lines.util.js";
|
|
66
67
|
export * from "./CodeGroup/code-group.util.js";
|
|
67
68
|
export * from "./TextareaField/sanitize-html.util.js";
|
|
68
69
|
export * from "./TextareaField/html-to-markdown.util.js";
|
|
@@ -75,3 +76,4 @@ export * from "./Chart/path.util.js";
|
|
|
75
76
|
export * from "./Chart/mercator.util.js";
|
|
76
77
|
export * from "./Commons/token-name.util.js";
|
|
77
78
|
export * from "./Commons/apply-theme.util.js";
|
|
79
|
+
export * from "./Commons/theme-ssr.util.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "origam",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.40.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "origam — a Vue 3 design system with multi-theme design tokens, CSS-first components and TypeScript types.",
|
|
6
6
|
"keywords": [
|
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
"./tokens/css/primitive": "./dist/src/assets/css/tokens/primitive.css",
|
|
60
60
|
"./tokens/css/light": "./dist/src/assets/css/tokens/light.css",
|
|
61
61
|
"./tokens/css/dark": "./dist/src/assets/css/tokens/dark.css",
|
|
62
|
+
"./tokens/css/dark-pinned": "./dist/src/assets/css/tokens/dark-pinned.css",
|
|
63
|
+
"./tokens/css/dark-system": "./dist/src/assets/css/tokens/dark-system.css",
|
|
62
64
|
"./tokens/css/utilities": "./dist/src/assets/css/tokens/origam-utilities.css",
|
|
63
65
|
"./tokens/scss": "./dist/src/assets/scss/tokens/_primitive.scss",
|
|
64
66
|
"./tokens/scss/primitive": "./dist/src/assets/scss/tokens/_primitive.scss",
|
|
@@ -67,6 +69,8 @@
|
|
|
67
69
|
"./tokens/scss/utilities": "./dist/src/assets/scss/tokens/_origam-utilities.scss",
|
|
68
70
|
"./tokens/types": "./dist/src/types/tokens.type.d.ts",
|
|
69
71
|
"./origam": "./dist/src/origam.js",
|
|
72
|
+
"./core": "./dist/src/origam-core.js",
|
|
73
|
+
"./ssr": "./dist/src/ssr.js",
|
|
70
74
|
"./nuxt": {
|
|
71
75
|
"types": "./dist/src/nuxt/module.d.ts",
|
|
72
76
|
"import": "./dist/src/nuxt/module.js",
|