fix(kompetenzen): revert ServiceDetailGrid to original light theme for UI consistency

Former-commit-id: 0ad718d43eaffa63bb9d1c2ddf698e94248a6764
This commit is contained in:
2026-05-07 15:07:45 +02:00
parent 5601bbfac0
commit 8cd9dd94fa
3033 changed files with 103 additions and 914674 deletions
@@ -1,9 +0,0 @@
/**
* @typedef {import('./lib/index.js').Action} Action
* @typedef {import('./lib/index.js').ActionTuple} ActionTuple
* @typedef {import('./lib/index.js').Index} Index
* @typedef {import('./lib/index.js').Visitor} Visitor
* @typedef {import('./lib/index.js').Visitors} Visitors
*/
export {CONTINUE, EXIT, SKIP, visit} from './lib/index.js'
@@ -1,7 +0,0 @@
/**
* @param {string} d
* @returns {string}
*/
export function color(d) {
return '\u001B[33m' + d + '\u001B[39m'
}
@@ -1,229 +0,0 @@
/**
* @typedef {import('estree-jsx').Node} Node
*/
/**
* @typedef {CONTINUE | EXIT | SKIP} Action
* Union of the action types.
*
* @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple
* List with one or two values, the first an action, the second an index.
*
* @typedef {number} Index
* Move to the sibling at `index` next (after node itself is completely
* traversed), when moving in an array.
*
* Useful if mutating the tree, such as removing the node the visitor is
* currently on, or any of its previous siblings.
* Results less than 0 or greater than or equal to `children.length` stop
* traversing the parent.
*/
/**
* @callback Visitor
* Handle a node.
*
* Visitors are free to transform `node`.
* They can also transform the parent of node (the last of `ancestors`).
*
* Replacing `node` itself, if `SKIP` is not returned, still causes its
* descendants to be walked (which is a bug).
*
* When adding or removing previous siblings of `node`, the `Visitor` should
* return a new `Index` to specify the sibling to traverse after `node` is
* traversed.
* Adding or removing next siblings of `node` is handled as expected without
* needing to return a new `Index`.
* @param {Node} node
* Found node.
* @param {string | undefined} key
* Field at which `node` lives in its parent (or where a list of nodes lives).
* @param {number | undefined} index
* Index where `node` lives if `parent[key]` is an array.
* @param {Array<Node>} ancestors
* Ancestors of `node`.
* @returns {Action | ActionTuple | Index | null | undefined | void}
* What to do next.
*
* An `Index` is treated as a tuple of `[CONTINUE, Index]`.
* An `Action` is treated as a tuple of `[Action]`.
*
* Passing a tuple back only makes sense if the `Action` is `SKIP`.
* When the `Action` is `EXIT`, that action can be returned.
* When the `Action` is `CONTINUE`, `Index` can be returned.
*/
/**
* @typedef Visitors
* Handle nodes when entering (preorder) and leaving (postorder).
* @property {Visitor | null | undefined} [enter]
* Handle nodes when entering (preorder) (optional).
* @property {Visitor | null | undefined} [leave]
* Handle nodes when leaving (postorder) (optional).
*/
import {color} from 'estree-util-visit/do-not-use-color'
const own = {}.hasOwnProperty
/**
* Continue traversing as normal.
*/
export const CONTINUE = Symbol('continue')
/**
* Stop traversing immediately.
*/
export const EXIT = Symbol('exit')
/**
* Do not traverse this node’s children.
*/
export const SKIP = Symbol('skip')
/**
* Visit nodes, with ancestral information.
*
* This algorithm performs *depth-first* *tree traversal* in *preorder*
* (**NLR**) and/or *postorder* (**LRN**).
*
* Walking the tree is an intensive task.
* Make use of the return values of the visitor(s) when possible.
* Instead of walking a tree multiple times, walk it once, use `unist-util-is`
* to check if a node matches, and then perform different operations.
*
* @param {Node} tree
* Tree to traverse
* @param {Visitor | Visitors | null | undefined} [visitor]
* Handle each node (optional).
* @returns {undefined}
* Nothing.
*/
export function visit(tree, visitor) {
/** @type {Visitor | undefined} */
let enter
/** @type {Visitor | undefined} */
let leave
if (typeof visitor === 'function') {
enter = visitor
} else if (visitor && typeof visitor === 'object') {
if (visitor.enter) enter = visitor.enter
if (visitor.leave) leave = visitor.leave
}
build(tree, undefined, undefined, [])()
/**
* @param {Node} node
* @param {string | undefined} key
* @param {number | undefined} index
* @param {Array<Node>} parents
*/
function build(node, key, index, parents) {
if (nodelike(node)) {
visit.displayName = 'node (' + color(node.type) + ')'
}
return visit
/**
* @returns {ActionTuple}
*/
function visit() {
/** @type {ActionTuple} */
const result = enter ? toResult(enter(node, key, index, parents)) : []
if (result[0] === EXIT) {
return result
}
if (result[0] !== SKIP) {
/** @type {keyof node} */
let cKey
for (cKey in node) {
if (
own.call(node, cKey) &&
node[cKey] &&
typeof node[cKey] === 'object' &&
// @ts-expect-error: custom esast extension.
cKey !== 'data' &&
// @ts-expect-error: custom esast extension.
cKey !== 'position'
) {
const grandparents = parents.concat(node)
/** @type {unknown} */
const value = node[cKey]
if (Array.isArray(value)) {
const nodes = /** @type {Array<unknown>} */ (value)
let cIndex = 0
while (cIndex > -1 && cIndex < nodes.length) {
const subvalue = nodes[cIndex]
if (nodelike(subvalue)) {
const subresult = build(
subvalue,
cKey,
cIndex,
grandparents
)()
if (subresult[0] === EXIT) return subresult
cIndex =
typeof subresult[1] === 'number' ? subresult[1] : cIndex + 1
} else {
cIndex++
}
}
} else if (nodelike(value)) {
const subresult = build(value, cKey, undefined, grandparents)()
if (subresult[0] === EXIT) return subresult
}
}
}
}
return leave ? toResult(leave(node, key, index, parents)) : result
}
}
}
/**
* Turn a return value into a clean result.
*
* @param {Action | ActionTuple | Index | null | undefined | void} value
* Valid return values from visitors.
* @returns {ActionTuple}
* Clean result.
*/
function toResult(value) {
if (Array.isArray(value)) {
return value
}
if (typeof value === 'number') {
return [CONTINUE, value]
}
return [value]
}
/**
* Check if something looks like a node.
*
* @param {unknown} value
* Anything.
* @returns {value is Node}
* Whether `value` looks like a node.
*/
function nodelike(value) {
return Boolean(
value &&
typeof value === 'object' &&
'type' in value &&
typeof value.type === 'string' &&
value.type.length > 0
)
}
@@ -1,96 +0,0 @@
{
"name": "estree-util-visit",
"version": "2.0.0",
"description": "esast (and estree) utility to visit nodes",
"license": "MIT",
"keywords": [
"esast",
"esast-util",
"util",
"utility",
"recma",
"esast",
"estree",
"javascript",
"ecmascript",
"tree",
"ast",
"node",
"visit",
"walk"
],
"repository": "syntax-tree/estree-util-visit",
"bugs": "https://github.com/syntax-tree/estree-util-visit/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"exports": {
".": "./index.js",
"./do-not-use-color": {
"node": "./lib/color.node.js",
"default": "./lib/color.default.js"
}
},
"files": [
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/estree-jsx": "^1.0.0",
"@types/unist": "^3.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"acorn": "^8.0.0",
"c8": "^8.0.0",
"prettier": "^3.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.55.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"ignoreCatch": true,
"strict": true
},
"xo": {
"prettier": true,
"rules": {
"max-depth": "off",
"n/file-extension-in-import": "off",
"unicorn/prefer-at": "off"
}
}
}