origam 2.38.2 → 2.39.1
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 +29 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +10 -0
- package/dist/src/assets/css/tokens/light.css +5 -0
- package/dist/src/assets/scss/tokens/_dark.scss +10 -0
- package/dist/src/assets/scss/tokens/_light.scss +5 -0
- package/dist/src/components/Card/OrigamCard.vue +12 -5
- package/dist/src/components/Code/OrigamCode.vue +2 -1
- package/dist/src/components/Dialog/OrigamDialog.vue +8 -4
- package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +8 -4
- package/dist/src/components/Form/OrigamForm.vue +20 -1
- package/dist/src/composables/Commons/content.composable.cjs +20 -0
- package/dist/src/composables/Commons/content.composable.d.ts +14 -0
- package/dist/src/composables/Commons/content.composable.js +9 -0
- 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/composables/index.cjs +12 -0
- package/dist/src/composables/index.d.ts +1 -0
- package/dist/src/composables/index.js +1 -0
- 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/Card/card.interface.d.ts +3 -11
- package/dist/src/interfaces/Commons/content.interface.cjs +1 -0
- package/dist/src/interfaces/Commons/content.interface.d.ts +26 -0
- package/dist/src/interfaces/Commons/content.interface.js +0 -0
- package/dist/src/interfaces/Commons/nuxt-module.interface.d.ts +20 -0
- package/dist/src/interfaces/Form/form.interface.d.ts +2 -1
- package/dist/src/interfaces/index.cjs +11 -0
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -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 +2 -2
- package/dist/src/nuxt/plugin.server.js +1 -1
- 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/types/tokens.type.d.ts +1 -1
- 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/index.cjs +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.trimBlankLines = trimBlankLines;
|
|
7
|
+
function trimBlankLines(text) {
|
|
8
|
+
let start = 0;
|
|
9
|
+
let end = text.length;
|
|
10
|
+
while (start < end && text[start] === "\n") start++;
|
|
11
|
+
while (end > start && text[end - 1] === "\n") end--;
|
|
12
|
+
return text.slice(start, end);
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*********************************************************
|
|
2
|
+
* trimBlankLines
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* Drops the leading and trailing line feeds of a code block given in a slot.
|
|
6
|
+
* Index scan rather than `/\n+$/`, whose backtracking is quadratic on a text
|
|
7
|
+
* holding many line feeds that are not at the end (Sonar S5852, #1388).
|
|
8
|
+
********************************************************/
|
|
9
|
+
export declare function trimBlankLines(text: string): string;
|
|
@@ -10,6 +10,7 @@ exports.resolveCodeGroupItems = resolveCodeGroupItems;
|
|
|
10
10
|
exports.resolveCodeGroupSlotItems = resolveCodeGroupSlotItems;
|
|
11
11
|
var _vue = require("vue");
|
|
12
12
|
var _codeGroup = require("../../consts/CodeGroup/code-group.const.cjs");
|
|
13
|
+
var _trimBlankLines = require("../Code/trim-blank-lines.util.cjs");
|
|
13
14
|
function flattenCodeGroupVNodes(nodes) {
|
|
14
15
|
const out = [];
|
|
15
16
|
for (const node of nodes ?? []) {
|
|
@@ -38,7 +39,7 @@ function extractCodeGroupText(node) {
|
|
|
38
39
|
visit(value.children);
|
|
39
40
|
};
|
|
40
41
|
visit(raw);
|
|
41
|
-
return parts.join("")
|
|
42
|
+
return (0, _trimBlankLines.trimBlankLines)(parts.join(""));
|
|
42
43
|
}
|
|
43
44
|
function resolveCodeGroupSlotItems(nodes) {
|
|
44
45
|
return flattenCodeGroupVNodes(nodes).map((vnode, index) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cloneVNode, Comment, Fragment, h, Text } from "vue";
|
|
2
2
|
import { CODE_GROUP_EMBED_PROPS } from "../../consts/CodeGroup/code-group.const.js";
|
|
3
|
+
import { trimBlankLines } from "../Code/trim-blank-lines.util.js";
|
|
3
4
|
export function flattenCodeGroupVNodes(nodes) {
|
|
4
5
|
const out = [];
|
|
5
6
|
for (const node of nodes ?? []) {
|
|
@@ -28,7 +29,7 @@ export function extractCodeGroupText(node) {
|
|
|
28
29
|
visit(value.children);
|
|
29
30
|
};
|
|
30
31
|
visit(raw);
|
|
31
|
-
return parts.join("")
|
|
32
|
+
return trimBlankLines(parts.join(""));
|
|
32
33
|
}
|
|
33
34
|
export function resolveCodeGroupSlotItems(nodes) {
|
|
34
35
|
return flattenCodeGroupVNodes(nodes).map((vnode, index) => {
|
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;
|
|
@@ -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';
|
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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "origam",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.39.1",
|
|
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": [
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"./tokens/scss/utilities": "./dist/src/assets/scss/tokens/_origam-utilities.scss",
|
|
68
68
|
"./tokens/types": "./dist/src/types/tokens.type.d.ts",
|
|
69
69
|
"./origam": "./dist/src/origam.js",
|
|
70
|
+
"./core": "./dist/src/origam-core.js",
|
|
70
71
|
"./nuxt": {
|
|
71
72
|
"types": "./dist/src/nuxt/module.d.ts",
|
|
72
73
|
"import": "./dist/src/nuxt/module.js",
|