@conduction/nextcloud-vue 2.56.0-beta.16 → 2.56.0-beta.17
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.
|
@@ -50,10 +50,15 @@ function isRowActionVisible(action, item) {
|
|
|
50
50
|
* @return {string} The slug.
|
|
51
51
|
*/
|
|
52
52
|
function slugifyActionLabel(label) {
|
|
53
|
-
|
|
53
|
+
// One pass collapses every run of other characters to a single '-', so at
|
|
54
|
+
// most one '-' can sit at either end; trimming it by index keeps this
|
|
55
|
+
// linear. `/^-+|-+$/g` here was a ReDoS on long runs of '-' (CodeQL).
|
|
56
|
+
const slug = String(label || '')
|
|
54
57
|
.toLowerCase()
|
|
55
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
56
|
-
|
|
58
|
+
.replace(/[^a-z0-9]+/g, '-');
|
|
59
|
+
const start = slug.startsWith('-') ? 1 : 0;
|
|
60
|
+
const end = slug.length > start && slug.endsWith('-') ? slug.length - 1 : slug.length;
|
|
61
|
+
return slug.slice(start, end)
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowActionItem.js","sources":["../../../src/utils/rowActionItem.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * How a row action renders as a menu entry.\n * CnRowActions and CnContextMenu both use these, so a row's actions menu and its right-click menu agree on which entries show and on each entry's key, testid and event payload.\n */\n\nimport { evaluateVisibleWhenLocal, isLocallyDecidableVisibleWhen } from './visibleWhen.js'\n\n/**\n * Whether an action is a built-in row action (View, Edit, Copy, Delete).\n *\n * @param {object} action The action.\n * @return {boolean} True for a built-in carrying an id.\n */\nfunction isBuiltin(action) {\n\treturn !!action && action.builtin === true && typeof action.id === 'string' && action.id !== ''\n}\n\n/**\n * Whether an action shows for an item.\n * A locally decidable `visibleWhen` that is false hides it; an endpoint or source condition is not decided here.\n * Then `visible` (a boolean or `(item) => boolean`) applies; without it the action shows.\n *\n * @param {object} action The action.\n * @param {object|string|number|null} item The row or right-clicked item.\n * @return {boolean} Whether the entry renders.\n */\nexport function isRowActionVisible(action, item) {\n\tif (action.visibleWhen\n\t\t&& isLocallyDecidableVisibleWhen(action.visibleWhen)\n\t\t&& evaluateVisibleWhenLocal(action.visibleWhen, item) === false) {\n\t\treturn false\n\t}\n\tif (action.visible === undefined) {\n\t\treturn true\n\t}\n\tif (typeof action.visible === 'function') {\n\t\treturn !!action.visible(item)\n\t}\n\treturn !!action.visible\n}\n\n/**\n * Slugify a label for a `data-testid` suffix: lowercase, kebab-case, non-alphanumerics stripped.\n *\n * @param {string} label The label.\n * @return {string} The slug.\n */\nexport function slugifyActionLabel(label) {\n\
|
|
1
|
+
{"version":3,"file":"rowActionItem.js","sources":["../../../src/utils/rowActionItem.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * How a row action renders as a menu entry.\n * CnRowActions and CnContextMenu both use these, so a row's actions menu and its right-click menu agree on which entries show and on each entry's key, testid and event payload.\n */\n\nimport { evaluateVisibleWhenLocal, isLocallyDecidableVisibleWhen } from './visibleWhen.js'\n\n/**\n * Whether an action is a built-in row action (View, Edit, Copy, Delete).\n *\n * @param {object} action The action.\n * @return {boolean} True for a built-in carrying an id.\n */\nfunction isBuiltin(action) {\n\treturn !!action && action.builtin === true && typeof action.id === 'string' && action.id !== ''\n}\n\n/**\n * Whether an action shows for an item.\n * A locally decidable `visibleWhen` that is false hides it; an endpoint or source condition is not decided here.\n * Then `visible` (a boolean or `(item) => boolean`) applies; without it the action shows.\n *\n * @param {object} action The action.\n * @param {object|string|number|null} item The row or right-clicked item.\n * @return {boolean} Whether the entry renders.\n */\nexport function isRowActionVisible(action, item) {\n\tif (action.visibleWhen\n\t\t&& isLocallyDecidableVisibleWhen(action.visibleWhen)\n\t\t&& evaluateVisibleWhenLocal(action.visibleWhen, item) === false) {\n\t\treturn false\n\t}\n\tif (action.visible === undefined) {\n\t\treturn true\n\t}\n\tif (typeof action.visible === 'function') {\n\t\treturn !!action.visible(item)\n\t}\n\treturn !!action.visible\n}\n\n/**\n * Slugify a label for a `data-testid` suffix: lowercase, kebab-case, non-alphanumerics stripped.\n *\n * @param {string} label The label.\n * @return {string} The slug.\n */\nexport function slugifyActionLabel(label) {\n\t// One pass collapses every run of other characters to a single '-', so at\n\t// most one '-' can sit at either end; trimming it by index keeps this\n\t// linear. `/^-+|-+$/g` here was a ReDoS on long runs of '-' (CodeQL).\n\tconst slug = String(label || '')\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, '-')\n\tconst start = slug.startsWith('-') ? 1 : 0\n\tconst end = slug.length > start && slug.endsWith('-') ? slug.length - 1 : slug.length\n\treturn slug.slice(start, end)\n}\n\n/**\n * The render key of an entry: `builtin:<id>` for a built-in, the label for an app action.\n * An app action with `id: \"edit\"` therefore never shares a key with the built-in Edit.\n *\n * @param {object} action The action.\n * @return {string} The key.\n */\nexport function rowActionKey(action) {\n\treturn isBuiltin(action) ? `builtin:${action.id}` : action.label\n}\n\n/**\n * The `data-testid` of an entry: `cn-action-item-<id>` for a built-in, in every locale, and the slug of the label for an app action.\n *\n * @param {object} action The action.\n * @return {string} The testid.\n */\nexport function rowActionTestId(action) {\n\treturn `cn-action-item-${isBuiltin(action) ? action.id : slugifyActionLabel(action.label)}`\n}\n\n/**\n * The `action` event payload for an entry: `action` is the label, `id` is the action's id when it has one, and `builtin: true` marks a built-in.\n *\n * @param {object} action The action.\n * @param {object|string|number|null} row The row or right-clicked item.\n * @return {{action: string, row: (object|string|number|null), id?: string, builtin?: true}} The payload.\n */\nexport function rowActionPayload(action, row) {\n\tconst payload = { action: action.label, row }\n\tif (typeof action.id === 'string' && action.id !== '') {\n\t\tpayload.id = action.id\n\t}\n\tif (isBuiltin(action)) {\n\t\tp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CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAM;AACtF,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;AAC9B,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,MAAM,EAAE;AACrC,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK;AACjE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,MAAM,EAAE;AACxC,CAAC,OAAO,CAAC,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;AAC9C,CAAC,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,GAAE;AAC9C,CAAC,IAAI,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE;AACxD,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,GAAE;AACxB,EAAE;AACF,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE;AACxB,EAAE,OAAO,CAAC,OAAO,GAAG,KAAI;AACxB,EAAE;AACF,CAAC,OAAO,OAAO;AACf;;;;"}
|
|
@@ -110018,10 +110018,15 @@ function isRowActionVisible(action, item) {
|
|
|
110018
110018
|
* @return {string} The slug.
|
|
110019
110019
|
*/
|
|
110020
110020
|
function slugifyActionLabel(label) {
|
|
110021
|
-
|
|
110021
|
+
// One pass collapses every run of other characters to a single '-', so at
|
|
110022
|
+
// most one '-' can sit at either end; trimming it by index keeps this
|
|
110023
|
+
// linear. `/^-+|-+$/g` here was a ReDoS on long runs of '-' (CodeQL).
|
|
110024
|
+
const slug = String(label || '')
|
|
110022
110025
|
.toLowerCase()
|
|
110023
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
110024
|
-
|
|
110026
|
+
.replace(/[^a-z0-9]+/g, '-');
|
|
110027
|
+
const start = slug.startsWith('-') ? 1 : 0;
|
|
110028
|
+
const end = slug.length > start && slug.endsWith('-') ? slug.length - 1 : slug.length;
|
|
110029
|
+
return slug.slice(start, end)
|
|
110025
110030
|
}
|
|
110026
110031
|
|
|
110027
110032
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/nextcloud-vue.cjs.js.map
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 35437389 bytes
|
|
4
|
+
sha256: a49cebe981b616ba6555ce135455260b6b111ebcea9afc9c34da210cbc38f32b
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/nextcloud-vue",
|
|
3
|
-
"version": "2.56.0-beta.
|
|
3
|
+
"version": "2.56.0-beta.17",
|
|
4
4
|
"description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
|
|
5
5
|
"homepage": "https://github.com/ConductionNL/nextcloud-vue#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -49,10 +49,15 @@ export function isRowActionVisible(action, item) {
|
|
|
49
49
|
* @return {string} The slug.
|
|
50
50
|
*/
|
|
51
51
|
export function slugifyActionLabel(label) {
|
|
52
|
-
|
|
52
|
+
// One pass collapses every run of other characters to a single '-', so at
|
|
53
|
+
// most one '-' can sit at either end; trimming it by index keeps this
|
|
54
|
+
// linear. `/^-+|-+$/g` here was a ReDoS on long runs of '-' (CodeQL).
|
|
55
|
+
const slug = String(label || '')
|
|
53
56
|
.toLowerCase()
|
|
54
57
|
.replace(/[^a-z0-9]+/g, '-')
|
|
55
|
-
|
|
58
|
+
const start = slug.startsWith('-') ? 1 : 0
|
|
59
|
+
const end = slug.length > start && slug.endsWith('-') ? slug.length - 1 : slug.length
|
|
60
|
+
return slug.slice(start, end)
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
/**
|