origam 2.37.7 → 2.37.8
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 +10 -0
- package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +2 -0
- package/dist/src/interfaces/CodeGroup/code-group.interface.d.ts +4 -1
- package/dist/src/types/Icon/icon.type.d.ts +1 -1
- package/dist/src/utils/CodeGroup/code-group.util.cjs +1 -3
- package/dist/src/utils/CodeGroup/code-group.util.js +1 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,16 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.37.8] - 2026-10-21
|
|
22
|
+
|
|
23
|
+
### Fixed — `origam/utils` se charge de nouveau en Node pur (#1208)
|
|
24
|
+
|
|
25
|
+
Depuis 2.36.0, `utils/CodeGroup/code-group.util.ts` importait `OrigamCode.vue`. Le barrel `origam/utils` ne pouvait donc plus être chargé sans loader Vue (scripts Node, configs, tests). Un second chemin du même défaut passait par `types/Icon/icon.type.ts`, qui importait `OrigamIcon.vue` en valeur alors qu'il n'en utilisait que le type.
|
|
26
|
+
|
|
27
|
+
- `ICodeGroupResolveOptions` reçoit le composant de code (`codeComponent`) au lieu de l'importer : c'est `OrigamCodeGroup.vue` qui le passe.
|
|
28
|
+
- `icon.type.ts` passe en `import type`.
|
|
29
|
+
- Vérifié : le TU `utils-barrel-no-sfc-1208.spec.ts` parcourt le graphe d'imports de `utils/index.ts` et refuse tout `.vue`. Il est rouge sur le parent et vert après. `import('dist/src/utils/index.js')` réussit sous Node 24 (PR #1235).
|
|
30
|
+
|
|
21
31
|
## [2.37.7] - 2026-10-21
|
|
22
32
|
|
|
23
33
|
### Fixed — champs de saisie : id et props relayées différents entre le rendu serveur et le client (#1226)
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
<script lang="ts" setup>
|
|
58
58
|
import { computed, useSlots } from "vue";
|
|
59
59
|
import OrigamBtn from "../Btn/OrigamBtn.vue";
|
|
60
|
+
import OrigamCode from "../Code/OrigamCode.vue";
|
|
60
61
|
import OrigamTab from "../Tabs/OrigamTab.vue";
|
|
61
62
|
import OrigamTabPanel from "../Tabs/OrigamTabPanel.vue";
|
|
62
63
|
import OrigamTabPanels from "../Tabs/OrigamTabPanels.vue";
|
|
@@ -140,6 +141,7 @@ function getItems() {
|
|
|
140
141
|
label: props.label,
|
|
141
142
|
lineNumbers: props.lineNumbers,
|
|
142
143
|
wrap: props.wrap,
|
|
144
|
+
codeComponent: OrigamCode,
|
|
143
145
|
t
|
|
144
146
|
});
|
|
145
147
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VNode } from 'vue';
|
|
1
|
+
import type { Component, VNode } from 'vue';
|
|
2
2
|
import type { IBorderProps } from '../Commons/border.interface';
|
|
3
3
|
import type { ICommonsComponentEmits, ICommonsComponentProps, ITagProps } from '../Commons/commons.interface';
|
|
4
4
|
import type { IDimensionProps } from '../Commons/dimension.interface';
|
|
@@ -46,11 +46,14 @@ export interface ICodeGroupRenderedItem extends Omit<ICodeGroupResolvedItem, 'vn
|
|
|
46
46
|
* @description
|
|
47
47
|
* What `resolveCodeGroupItems` needs from the group: its `label` and `t` to
|
|
48
48
|
* name each scroller, and `lineNumbers` / `wrap` to forward to every block.
|
|
49
|
+
* `codeComponent` is `OrigamCode`, passed in so `utils/` never imports an SFC
|
|
50
|
+
* (#1208).
|
|
49
51
|
********************************************************/
|
|
50
52
|
export interface ICodeGroupResolveOptions {
|
|
51
53
|
label?: string;
|
|
52
54
|
lineNumbers: boolean;
|
|
53
55
|
wrap: boolean;
|
|
56
|
+
codeComponent: Component;
|
|
54
57
|
t: (key: string, ...params: unknown[]) => string;
|
|
55
58
|
}
|
|
56
59
|
/*********************************************************
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
import OrigamIcon from '../../components/Icon/OrigamIcon.vue';
|
|
2
|
+
import type OrigamIcon from '../../components/Icon/OrigamIcon.vue';
|
|
3
3
|
import type { IIconAliases, IIconProps, IIconSet } from '../../interfaces/Icon/icon.interface';
|
|
4
4
|
export type TIcon = string | Array<(string | [path: string, opacity: number])> | Component;
|
|
5
5
|
export type TIconOptions = {
|
|
@@ -9,9 +9,7 @@ exports.flattenCodeGroupVNodes = flattenCodeGroupVNodes;
|
|
|
9
9
|
exports.resolveCodeGroupItems = resolveCodeGroupItems;
|
|
10
10
|
exports.resolveCodeGroupSlotItems = resolveCodeGroupSlotItems;
|
|
11
11
|
var _vue = require("vue");
|
|
12
|
-
var _OrigamCode = _interopRequireDefault(require("../../components/Code/OrigamCode.vue"));
|
|
13
12
|
var _codeGroup = require("../../consts/CodeGroup/code-group.const.cjs");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
13
|
function flattenCodeGroupVNodes(nodes) {
|
|
16
14
|
const out = [];
|
|
17
15
|
for (const node of nodes ?? []) {
|
|
@@ -82,7 +80,7 @@ function resolveCodeGroupItems(items, nodes, options) {
|
|
|
82
80
|
...embed,
|
|
83
81
|
label: void 0,
|
|
84
82
|
value: void 0
|
|
85
|
-
}) : (0, _vue.h)(
|
|
83
|
+
}) : (0, _vue.h)(options.codeComponent, {
|
|
86
84
|
code: item.code,
|
|
87
85
|
lang: item.lang,
|
|
88
86
|
filename: item.filename,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { cloneVNode, Comment, Fragment, h, Text } from "vue";
|
|
2
|
-
import OrigamCode from "../../components/Code/OrigamCode.vue";
|
|
3
2
|
import { CODE_GROUP_EMBED_PROPS } from "../../consts/CodeGroup/code-group.const.js";
|
|
4
3
|
export function flattenCodeGroupVNodes(nodes) {
|
|
5
4
|
const out = [];
|
|
@@ -57,7 +56,7 @@ export function resolveCodeGroupItems(items, nodes, options) {
|
|
|
57
56
|
wrap: options.wrap || void 0,
|
|
58
57
|
scrollerAriaLabel
|
|
59
58
|
};
|
|
60
|
-
const vnode = item.vnode ? cloneVNode(item.vnode, { ...embed, label: void 0, value: void 0 }) : h(
|
|
59
|
+
const vnode = item.vnode ? cloneVNode(item.vnode, { ...embed, label: void 0, value: void 0 }) : h(options.codeComponent, { code: item.code, lang: item.lang, filename: item.filename, ...embed });
|
|
61
60
|
return { ...item, vnode };
|
|
62
61
|
});
|
|
63
62
|
}
|